From 319ce38fa4984d4cfe8575126bb0d7aa10ef27a1 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 10 Apr 2007 21:50:53 -0600 Subject: update SLANG version test --- src/mesa/shader/slang/slang_compile.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 3539d712e2c..d3f6986543e 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -1904,14 +1904,22 @@ compile_with_grammar(grammar id, const char *source, slang_code_unit * unit, byte *prod; GLuint size, start, version; slang_string preprocessed; + int maxVersion; + +#if FEATURE_ARB_shading_language_120 + maxVersion = 120; +#else + maxVersion = 110; +#endif /* First retrieve the version number. */ if (!_slang_preprocess_version(source, &version, &start, infolog)) return GL_FALSE; - if (version > 110) { + if (version > maxVersion) { slang_info_log_error(infolog, - "language version specified is not supported."); + "language version %.2f is not supported.", + version * 0.01); return GL_FALSE; } -- cgit v1.2.3 From ba876be0c0711f089c0cde9739f349b137430770 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 10 Apr 2007 21:51:27 -0600 Subject: fix/work-around allocation bugs for non-square matrices --- src/mesa/shader/slang/slang_codegen.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index ee82a107e0c..fe6b615c5d6 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -144,14 +144,17 @@ _slang_sizeof_type_specifier(const slang_type_specifier *spec) case SLANG_SPEC_MAT4: return 4 * 4; case SLANG_SPEC_MAT23: + return 2 * 4; /* special case */ case SLANG_SPEC_MAT32: - return 2 * 3; + return 3 * 4; /* special case: 3 registers (columns), not two */ case SLANG_SPEC_MAT24: - case SLANG_SPEC_MAT42: return 2 * 4; + case SLANG_SPEC_MAT42: + return 4 * 4; /* special case: 4 registers (columns), not two */ case SLANG_SPEC_MAT34: - case SLANG_SPEC_MAT43: return 3 * 4; + case SLANG_SPEC_MAT43: + return 4 * 4; /* special case: 4 registers (columns), not two */ case SLANG_SPEC_SAMPLER1D: case SLANG_SPEC_SAMPLER2D: case SLANG_SPEC_SAMPLER3D: -- cgit v1.2.3 From b0bba038467a0b22618be105010b7b3b3859b4e5 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 11 Apr 2007 08:11:52 -0600 Subject: use _mesa_reference_renderbuffer(), fix typo --- src/mesa/drivers/dri/i915tex/intel_fbo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i915tex/intel_fbo.c b/src/mesa/drivers/dri/i915tex/intel_fbo.c index 87ef22f52f4..349912ffecd 100644 --- a/src/mesa/drivers/dri/i915tex/intel_fbo.c +++ b/src/mesa/drivers/dri/i915tex/intel_fbo.c @@ -520,7 +520,7 @@ intel_framebuffer_renderbuffer(GLcontext * ctx, /** * When glFramebufferTexture[123]D is called this function sets up the - * gl_renderbuffer wrapp around the texture image. + * gl_renderbuffer wrapper around the texture image. * This will have the region info needed for hardware rendering. */ static struct intel_renderbuffer * @@ -606,7 +606,7 @@ intel_render_texture(GLcontext * ctx, irb = intel_wrap_texture(ctx, newImage); if (irb) { /* bind the wrapper to the attachment point */ - att->Renderbuffer = &irb->Base; + _mesa_reference_renderbuffer(&att->Renderbuffer, &irb->Base); } else { /* fallback to software rendering */ -- cgit v1.2.3 From 183d8e06206dd264adabdf8d6b6ad06143d237e8 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 11 Apr 2007 08:47:05 -0600 Subject: fix zoomed depth copies (bug 10608) --- src/mesa/swrast/s_copypix.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index 8f37a3dc8e5..ae5bdab3dda 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -536,8 +536,7 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, span.end = width; if (fb->Visual.rgbMode) { if (zoom) - _swrast_write_zoomed_rgba_span(ctx, destx, desty, &span, - span.array->rgba); + _swrast_write_zoomed_depth_span(ctx, destx, desty, &span); else _swrast_write_rgba_span(ctx, &span); } -- cgit v1.2.3 From 9f66025f54a3a9cc33cba56ec7c9f59721ddbec7 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 11 Apr 2007 09:00:56 -0600 Subject: fix invalid error detection problem in _mesa_bind_attrib_location(), bug 10602 --- src/mesa/shader/shader_api.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 1831d0fb2e7..cf42a5843ec 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -323,7 +323,13 @@ _mesa_bind_attrib_location(GLcontext *ctx, GLuint program, GLuint index, return; } - oldIndex = _mesa_get_attrib_location(ctx, program, name); + if (shProg->LinkStatus) { + /* get current index/location for the attribute */ + oldIndex = _mesa_get_attrib_location(ctx, program, name); + } + else { + oldIndex = -1; + } /* this will replace the current value if it's already in the list */ i = _mesa_add_attribute(shProg->Attributes, name, size, index); @@ -331,14 +337,12 @@ _mesa_bind_attrib_location(GLcontext *ctx, GLuint program, GLuint index, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindAttribLocation"); } - if (shProg->VertexProgram && oldIndex >= 0) { + if (shProg->VertexProgram && oldIndex >= 0 && oldIndex != index) { + /* If the index changed, need to search/replace references to that attribute + * in the vertex program. + */ _slang_remap_attribute(&shProg->VertexProgram->Base, oldIndex, index); } - -#if 0 - printf("===== post BindAttrib:\n"); - _mesa_print_program(&shProg->VertexProgram->Base); -#endif } -- cgit v1.2.3 From b61d74c57589cf22f003ac7f9db3aa47fd1b3cb2 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 11 Apr 2007 09:04:18 -0600 Subject: as with prev commit, also fix color index mode zoomed depth copies (bug 10608) --- src/mesa/swrast/s_copypix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index ae5bdab3dda..dbbfc58c6fd 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -542,7 +542,7 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, } else { if (zoom) - _swrast_write_zoomed_index_span(ctx, destx, desty, &span); + _swrast_write_zoomed_depth_span(ctx, destx, desty, &span); else _swrast_write_index_span(ctx, &span); } -- cgit v1.2.3 From afc58f5f7e23e627cb013306664fce8973afabe4 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 11 Apr 2007 11:13:37 -0600 Subject: s/Shadow/SHADOW/ --- src/mesa/shader/slang/slang_compile_variable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/shader/slang/slang_compile_variable.c b/src/mesa/shader/slang/slang_compile_variable.c index 819b4f901b3..664fd9bc576 100644 --- a/src/mesa/shader/slang/slang_compile_variable.c +++ b/src/mesa/shader/slang/slang_compile_variable.c @@ -393,9 +393,9 @@ gl_type_from_specifier(const slang_type_specifier * type) return GL_SAMPLER_3D_ARB; case SLANG_SPEC_SAMPLERCUBE: return GL_SAMPLER_CUBE_ARB; - case SLANG_SPEC_SAMPLER1DShadow: + case SLANG_SPEC_SAMPLER1DSHADOW: return GL_SAMPLER_1D_SHADOW_ARB; - case SLANG_SPEC_SAMPLER2DShadow: + case SLANG_SPEC_SAMPLER2DSHADOW: return GL_SAMPLER_2D_SHADOW_ARB; case SLANG_SPEC_ARRAy: return gl_type_from_specifier(type->_array); -- cgit v1.2.3 From f98f4f6d7a4756c7ed6723abdf5e8ceaf1ff2ed0 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 11 Apr 2007 12:29:38 -0600 Subject: move/fix texture sampling funcs --- .../shader/slang/library/slang_common_builtin.gc | 66 ++++++++++++++++++---- .../shader/slang/library/slang_fragment_builtin.gc | 37 ------------ 2 files changed, 54 insertions(+), 49 deletions(-) diff --git a/src/mesa/shader/slang/library/slang_common_builtin.gc b/src/mesa/shader/slang/library/slang_common_builtin.gc index 42a5d723b42..103bbc4b9d4 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin.gc +++ b/src/mesa/shader/slang/library/slang_common_builtin.gc @@ -1660,26 +1660,68 @@ vec4 textureCube(const samplerCube sampler, const vec3 coord) -vec4 shadow1D (sampler1DShadow sampler, vec3 coord) { - vec4 texel; - __asm vec4_shad1d texel, sampler, coord, 0.0; - return texel; +vec4 shadow1D(const sampler1DShadow sampler, const vec3 coord) +{ + __asm vec4_tex1d __retVal, sampler, coord; +} + +vec4 shadow1DProj(const sampler1DShadow sampler, const vec4 coord) +{ + vec4 pcoord; + pcoord.x = coord.x / coord.w; + pcoord.z = coord.z; + pcoord.w = bias; + __asm vec4_tex1d __retVal, sampler, pcoord; +} + +vec4 shadow2D(const sampler2DShadow sampler, const vec3 coord) +{ + __asm vec4_tex2d __retVal, sampler, coord; +} + +vec4 shadow2DProj(const sampler2DShadow sampler, const vec4 coord) +{ + vec4 pcoord; + pcoord.xy = coord.xy / coord.w; + pcoord.z = coord.z; + __asm vec4_tex2d __retVal, sampler, pcoord; } -vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord) { - return shadow1D (sampler, vec3 (coord.s / coord.q, 0.0, coord.p / coord.q)); + +//// GL_ARB_texture_rectangle: +vec4 texture2DRect(const sampler2DRect sampler, const vec2 coord) +{ + __asm vec4_tex_rect __retVal, sampler, coord; +} + +vec4 texture2DRectProj(const sampler2DRect sampler, const vec3 coord) +{ + // do projection here + vec4 pcoord; + pcoord.xy = coord.xy / coord.z; + __asm vec4_texp_rect __retVal, sampler, pcoord; +} + +vec4 texture2DRectProj(const sampler2DRect sampler, const vec4 coord) +{ + // do projection here + vec4 pcoord; + pcoord.xy = coord.xy / coord.w; + __asm vec4_texp_rect __retVal, sampler, pcoord; } -vec4 shadow2D (sampler2DShadow sampler, vec3 coord) { - vec4 texel; - __asm vec4_shad2d texel, sampler, coord, 0.0; - return texel; +vec4 shadow2DRect(const sampler2DRectShadow sampler, const vec3 coord) +{ +// XXX to do } -vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord) { - return shadow2D (sampler, vec3 (coord.s / coord.q, coord.t / coord.q, coord.p / coord.q)); +vec4 shadow2DRectProj(const sampler2DRectShadow sampler, const vec4 coord) +{ +// XXX to do } + + // // 8.9 Noise Functions // diff --git a/src/mesa/shader/slang/library/slang_fragment_builtin.gc b/src/mesa/shader/slang/library/slang_fragment_builtin.gc index 9a7e17bdaf2..416c6ff313d 100644 --- a/src/mesa/shader/slang/library/slang_fragment_builtin.gc +++ b/src/mesa/shader/slang/library/slang_fragment_builtin.gc @@ -150,9 +150,6 @@ vec4 shadow1DProj(const sampler1DShadow sampler, const vec4 coord, const float b __asm vec4_texb1d __retVal, sampler, pcoord; } - - - vec4 shadow2D(const sampler2DShadow sampler, const vec3 coord, const float bias) { vec4 coord4; @@ -172,40 +169,6 @@ vec4 shadow2DProj(const sampler2DShadow sampler, const vec4 coord, const float b -//// GL_ARB_texture_rectangle: -vec4 texture2DRect(const sampler2DRect sampler, const vec2 coord) -{ - __asm vec4_tex_rect __retVal, sampler, coord; -} - -vec4 texture2DRectProj(const sampler2DRect sampler, const vec3 coord) -{ - // do projection here - vec4 pcoord; - pcoord.xy = coord.xy / coord.z; - __asm vec4_texp_rect __retVal, sampler, pcoord; -} - -vec4 texture2DRectProj(const sampler2DRect sampler, const vec4 coord) -{ - // do projection here - vec4 pcoord; - pcoord.xy = coord.xy / coord.w; - __asm vec4_texp_rect __retVal, sampler, pcoord; -} - -vec4 shadow2DRect(const sampler2DRectShadow sampler, const vec3 coord) -{ -// XXX to do -} - -vec4 shadow2DRectProj(const sampler2DRectShadow sampler, const vec4 coord) -{ -// XXX to do -} - - - // // 8.8 Fragment Processing Functions // -- cgit v1.2.3 From 70b0e123c408fde95fca4ca699c06167c9a622fa Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 11 Apr 2007 12:30:03 -0600 Subject: checkpoint: updating non-square matrix constructors and operators --- src/mesa/shader/slang/library/slang_120_core.gc | 1002 +++++++++++++---------- 1 file changed, 555 insertions(+), 447 deletions(-) diff --git a/src/mesa/shader/slang/library/slang_120_core.gc b/src/mesa/shader/slang/library/slang_120_core.gc index cf5d44e8ce4..e08716d97cf 100644 --- a/src/mesa/shader/slang/library/slang_120_core.gc +++ b/src/mesa/shader/slang/library/slang_120_core.gc @@ -37,434 +37,555 @@ // From Shader Spec, ver. 1.20, rev. 6 // -mat2x3 __constructor (const float df) { - return mat2x3 ( - df, 0., 0., - 0., df, 0. - ); +//// mat2x3: 2 columns of vec3 + +mat2x3 __constructor(const float f00, const float f10, const float f20, + const float f01, const float f11, const float f21) +{ + __retVal[0].x = f00; + __retVal[0].y = f10; + __retVal[0].z = f20; + __retVal[1].x = f01; + __retVal[1].y = f11; + __retVal[1].z = f21; } -mat2x3 __constructor (const int di) { - float df; - __asm int_to_float df, di; - return mat2x3 (df); +mat2x3 __constructor(const float f) +{ + __retVal = mat2x3( f, 0.0, 0.0, + 0.0, f, 0.0); } -mat2x3 __constructor (const bool db) { - return mat2x3 (db ? 1. : 0.); +mat2x3 __constructor(const int i) +{ + const float f = float(i); + __retVal = mat2x3(f); } +mat2x3 __constructor(const bool b) +{ + const float f = float(b); + __retVal = mat2x3(f); +} -mat2x4 __constructor (const float df) { - return mat2x4 ( - df, 0., 0., 0., - 0., df, 0., 0. - ); +mat2x3 __constructor(const vec3 c0, const vec3 c1) +{ + __retVal[0] = c0; + __retVal[1] = c1; } -mat2x4 __constructor (const int di) { - float df; - __asm int_to_float df, di; - return mat2x4 (df); + + +//// mat2x4: 2 columns of vec4 + +mat2x4 __constructor(const float f00, const float f10, const float f20, const float f30, + const float f01, const float f11, const float f21, const float f31) +{ + __retVal[0].x = f00; + __retVal[0].y = f10; + __retVal[0].z = f20; + __retVal[0].w = f30; + __retVal[1].x = f01; + __retVal[1].y = f11; + __retVal[1].z = f21; + __retVal[1].w = f31; } -mat2x4 __constructor (const bool db) { - return mat2x4 (db ? 1. : 0.); +mat2x4 __constructor(const float f) +{ + __retVal = mat2x4( f, 0.0, 0.0, 0.0, + 0.0, f, 0.0, 0.0); } +mat2x4 __constructor(const int i) +{ + const float f = float(i); + __retVal = mat2x4(f); +} -mat3x2 __constructor (const float df) { - return mat3x2 ( - df, 0., - 0., df, - 0., 0. - ); +mat2x4 __constructor(const bool b) +{ + const float f = float(b); + __retVal = mat2x4(f); } -mat3x2 __constructor (const int di) { - float df; - __asm int_to_float df, di; - return mat3x2 (df); +mat2x4 __constructor(const vec4 c0, const vec4 c1) +{ + __retVal[0] = c0; + __retVal[1] = c1; } -mat3x2 __constructor (const bool db) { - return mat3x2 (db ? 1. : 0.); + + +//// mat3x2: 3 columns of vec2 + +mat3x2 __constructor(const float f00, const float f10, + const float f01, const float f11, + const float f02, const float f12) +{ + __retVal[0].x = f00; + __retVal[0].y = f10; + __retVal[1].x = f01; + __retVal[1].y = f11; + __retVal[2].x = f02; + __retVal[2].y = f12; } +mat3x2 __constructor(const float f) +{ + __retVal = mat3x2( f, 0.0, + 0.0, f, + 0.0, 0.0); +} -mat3x4 __constructor (const float df) { - return mat3x4 ( - df, 0., 0., 0., - 0., df, 0., 0., - 0., 0., df, 0. - ); +mat3x2 __constructor(const int i) +{ + const float f = float(i); + __retVal = mat3x2(f); } -mat3x4 __constructor (const int di) { - float df; - __asm int_to_float df, di; - return mat3x4 (df); +mat3x2 __constructor(const bool b) +{ + const float f = float(b); + __retVal = mat3x2(f); } -mat3x4 __constructor (const bool db) { - return mat3x4 (db ? 1. : 0.); +mat3x2 __constructor(const vec2 c0, const vec2 c1, const vec2 c2) +{ + __retVal[0] = c0; + __retVal[1] = c1; + __retVal[2] = c2; } -mat4x2 __constructor (const float df) { - return mat4x2 ( - df, 0., - 0., df, - 0., 0., - 0., 0. - ); + +//// mat3x4: 3 columns of vec4 + +mat3x4 __constructor(const float f00, const float f10, const float f20, const float f30, + const float f01, const float f11, const float f21, const float f31, + const float f02, const float f12, const float f22, const float f32) +{ + __retVal[0].x = f00; + __retVal[0].y = f10; + __retVal[0].z = f20; + __retVal[0].w = f30; + __retVal[1].x = f01; + __retVal[1].y = f11; + __retVal[1].z = f21; + __retVal[1].w = f31; + __retVal[2].x = f02; + __retVal[2].y = f12; + __retVal[2].z = f22; + __retVal[2].w = f32; } -mat4x2 __constructor (const int di) { - float df; - __asm int_to_float df, di; - return mat4x2 (df); +mat3x4 __constructor(const float f) +{ + __retVal = mat3x4( f, 0.0, 0.0, 0.0, + 0.0, f, 0.0, 0.0, + 0.0, 0.0, f, 0.0); } -mat4x2 __constructor (const bool db) { - return mat4x2 (db ? 1. : 0.); +mat3x4 __constructor(const int i) +{ + const float f = float(i); + __retVal = mat3x4(f); } +mat3x4 __constructor(const bool b) +{ + const float f = float(b); + __retVal = mat3x4(f); +} -mat4x3 __constructor (const float df) { - return mat4x3 ( - df, 0., 0., - 0., df, 0., - 0., 0., df, - 0., 0., 0. - ); +mat3x4 __constructor(const vec4 c0, const vec4 c1, const vec4 c2) +{ + __retVal[0] = c0; + __retVal[1] = c1; + __retVal[2] = c2; } -mat4x3 __constructor (const int di) { - float df; - __asm int_to_float df, di; - return mat4x3 (df); + + +//// mat4x2: 4 columns of vec2 + +mat4x2 __constructor(const float f00, const float f10, + const float f01, const float f11, + const float f02, const float f12, + const float f03, const float f13) +{ + __retVal[0].x = f00; + __retVal[0].y = f10; + __retVal[1].x = f01; + __retVal[1].y = f11; + __retVal[2].x = f02; + __retVal[2].y = f12; + __retVal[3].x = f03; + __retVal[3].y = f13; } -mat4x3 __constructor (const bool db) { - return mat4x3 (db ? 1. : 0.); +mat4x2 __constructor(const float f) +{ + __retVal = mat4x2( f, 0.0, + 0.0, 4, + 0.0, 0.0, + 0.0, 0.0); } +mat4x2 __constructor(const int i) +{ + const float f = float(i); + __retVal = mat4x2(f); +} -mat2 __constructor (const mat2 m) { - return m; +mat4x2 __constructor(const bool b) +{ + const float f = float(b); + __retVal = mat4x2(f); } -mat2 __constructor (const mat3x2 m) { - return mat2 ( - m[0], - m[1] - ); +mat4x2 __constructor(const vec2 c0, const vec2 c1, const vec2 c2, const vec2 c3) +{ + __retVal[0] = c0; + __retVal[1] = c1; + __retVal[2] = c2; + __retVal[3] = c3; } -mat2 __constructor (const mat4x2 m) { - return mat2 ( - m[0], - m[1] - ); + + +//// mat4x3: 4 columns of vec3 + +mat4x3 __constructor(const float f00, const float f10, const float f20, + const float f01, const float f11, const float f21, + const float f02, const float f12, const float f22, + const float f03, const float f13, const float f23) +{ + __retVal[0].x = f00; + __retVal[0].y = f10; + __retVal[0].z = f20; + __retVal[1].x = f01; + __retVal[1].y = f11; + __retVal[1].z = f21; + __retVal[2].x = f02; + __retVal[2].y = f12; + __retVal[2].z = f22; + __retVal[3].x = f03; + __retVal[3].y = f13; + __retVal[3].z = f23; } -mat2 __constructor (const mat2x3 m) { - return mat2 ( - m[0].xy, - m[1].xy - ); +mat4x3 __constructor(const float f) +{ + __retVal = mat4x3( f, 0.0, 0.0, + 0.0, f, 0.0, + 0.0, 0.0, f, + 0.0, 0.0, 0.0); } -mat2 __constructor (const mat2x4 m) { - return mat2 ( - m[0].xy, - m[1].xy - ); +mat4x3 __constructor(const int i) +{ + const float f = float(i); + __retVal = mat4x3(f); } -mat2 __constructor (const mat3 m) { - return mat2 ( - m[0].xy, - m[1].xy - ); +mat4x3 __constructor(const bool b) +{ + const float f = float(b); + __retVal = mat4x3(f); } -mat2 __constructor (const mat3x4 m) { - return mat2 ( - m[0].xy, - m[1].xy - ); +mat4x3 __constructor(const vec3 c0, const vec3 c1, const vec3 c2, const vec3 c3) +{ + __retVal[0] = c0; + __retVal[1] = c1; + __retVal[2] = c2; + __retVal[3] = c3; } -mat2 __constructor (const mat4x3 m) { - return mat2 ( - m[0].xy, - m[1].xy - ); + + +//// misc assorted matrix constructors + +mat2 __constructor(const mat2 m) +{ + __retVal = m; } -mat2 __constructor (const mat4 m) { - return mat2 ( - m[0].xy, - m[1].xy - ); +mat2 __constructor(const mat3x2 m) +{ + __retVal = mat2(m[0], m[1]); } +mat2 __constructor(const mat4x2 m) +{ + __retVal = mat2(m[0], m[1]); +} -mat2x3 __constructor (const mat2x3 m) { - return m; +mat2 __constructor(const mat2x3 m) +{ + __retVal = mat2(m[0].xy, m[1].xy); } -mat2x3 __constructor (const mat3 m) { - return mat2x3 ( - m[0], - m[1] - ); +mat2 __constructor(const mat2x4 m) +{ + __retVal = mat2(m[0].xy, m[1].xy); } -mat2x3 __constructor (const mat4x3 m) { - return mat2x3 ( - m[0], - m[1] - ); +mat2 __constructor(const mat3 m) +{ + __retVal = mat2(m[0].xy, m[1].xy); } -mat2x3 __constructor (const mat2x4 m) { - return mat2x3 ( - m[0].xyz, - m[1].xyz - ); +mat2 __constructor(const mat3x4 m) +{ + __retVal = mat2(m[0].xy, m[1].xy); } -mat2x3 __constructor (const mat3x4 m) { - return mat2x3 ( - m[0].xyz, - m[1].xyz - ); +mat2 __constructor(const mat4x3 m) +{ + __retVal = mat2(m[0].xy, m[1].xy); } -mat2x3 __constructor (const mat4 m) { - return mat2x3 ( - m[0].xyz, - m[1].xyz - ); +mat2 __constructor(const mat4 m) +{ + __retVal = mat2(m[0].xy, m[1].xy); } -mat2x3 __constructor (const mat2 m) { - return mat2x3 ( - m[0], 0., - m[1], 0. - ); + + +mat2x3 __constructor(const mat2x3 m) +{ + __retVal = m; } -mat2x3 __constructor (const mat3x2 m) { - return mat2x3 ( - m[0], 0., - m[1], 0. - ); +mat2x3 __constructor(const mat3 m) +{ + __retVal = mat2x3(m[0], m[1]); } -mat2x3 __constructor (const mat4x2 m) { - return mat2x3 ( - m[0], 0., - m[1], 0. - ); +mat2x3 __constructor(const mat4x3 m) +{ + __retVal = mat2x3(m[0], m[1]); } +mat2x3 __constructor(const mat2x4 m) +{ + __retVal = mat2x3(m[0].xyz, m[1].xyz); +} -mat2x4 __constructor (const mat2x4 m) { - return m; +mat2x3 __constructor(const mat3x4 m) +{ + __retVal = mat2x3(m[0].xyz, m[1].xyz); } -mat2x4 __constructor (const mat3x4 m) { - return mat2x4 ( - m[0], - m[1] - ); +mat2x3 __constructor(const mat4 m) +{ + __retVal = mat2x3(m[0].xyz, m[1].xyz); } -mat2x4 __constructor (const mat4 m) { - return mat2x4 ( - m[0], - m[1] - ); +mat2x3 __constructor(const mat2 m) +{ + __retVal = mat2x3(m[0].x, m[0].y, 0.0, + m[1].x, m[1].y, 0.0); } -mat2x4 __constructor (const mat2x3 m) { - return mat2x4 ( - m[0], 0., - m[1], 0. - ); +mat2x3 __constructor(const mat3x2 m) +{ + __retVal = mat2x3(m[0].x, m[0].y, 0.0, + m[1].x, m[1].y, 0.0); } -mat2x4 __constructor (const mat3 m) { - return mat2x4 ( - m[0], 0., - m[1], 0. - ); +mat2x3 __constructor(const mat4x2 m) +{ + __retVal = mat2x3(m[0].x, m[0].y, 0.0, + m[1].x, m[1].y, 0.0); } -mat2x4 __constructor (const mat4x3 m) { - return mat2x4 ( - m[0], 0., - m[1], 0. - ); + + +mat2x4 __constructor(const mat2x4 m) +{ + __retVal = m; } -mat2x4 __constructor (const mat2 m) { - return mat2x4 ( - m[0], 0., 0., - m[1], 0., 0. - ); +mat2x4 __constructor(const mat3x4 m) +{ + __retVal = mat2x4(m[0], m[1]); } -mat2x4 __constructor (const mat3x2 m) { - return mat2x4 ( - m[0], 0., 0., - m[1], 0., 0. - ); +mat2x4 __constructor(const mat4 m) +{ + __retVal = mat2x4(m[0], m[1]); } -mat2x4 __constructor (const mat4x2 m) { - return mat2x4 ( - m[0], 0., 0., - m[1], 0., 0. - ); +mat2x4 __constructor(const mat2x3 m) +{ + __retVal = mat2x4(m[0].x, m[0].y, m[0].z, 0.0, + m[1].x, m[1].y, m[1].z, 0.0); } +mat2x4 __constructor(const mat3 m) +{ + __retVal = mat2x4(m[0].x, m[0].y, m[0].z, 0.0, + m[1].x, m[1].y, m[1].z, 0.0); +} -mat3x2 __constructor (const mat3x2 m) { - return m; +mat2x4 __constructor(const mat4x3 m) +{ + __retVal = mat2x4(m[0].x, m[0].y, m[0].z, 0.0, + m[1].x, m[1].y, m[1].z, 0.0); } -mat3x2 __constructor (const mat4x2 m) { - return mat3x2 ( - m[0], - m[1], - m[2] - ); +mat2x4 __constructor(const mat2 m) +{ + __retVal = mat2x4(m[0].x, m[1].y, 0.0, 0.0, + m[1].x, m[1].y, 0.0, 0.0); } -mat3x2 __constructor (const mat3 m) { - return mat3x2 ( - m[0].xy, - m[1].xy, - m[2].xy - ); +mat2x4 __constructor(const mat3x2 m) +{ + __retVal = mat2x4(m[0].x, m[0].y, 0.0, 0.0, + m[1].x, m[1].y, 0.0, 0.0); } -mat3x2 __constructor (const mat3x4 m) { - return mat3x2 ( - m[0].xy, - m[1].xy, - m[2].xy - ); +mat2x4 __constructor(const mat4x2 m) +{ + __retVal = mat2x4(m[0].x, m[0].y, 0.0, 0.0, + m[1].x, m[1].y, 0.0, 0.0); } -mat3x2 __constructor (const mat4x3 m) { - return mat3x2 ( - m[0].xy, - m[1].xy, - m[2].xy - ); + + +mat3x2 __constructor(const mat3x2 m) +{ + __retVal = m; } -mat3x2 __constructor (const mat4 m) { - return mat3x2 ( - m[0].xy, - m[1].xy, - m[2].xy - ); +mat3x2 __constructor(const mat4x2 m) +{ + __retVal = mat3x2(m[0], m[1], m[2]); } -mat3x2 __constructor (const mat2 m) { - return mat3x2 ( - m[0], - m[1], - 0., 0. - ); +mat3x2 __constructor(const mat3 m) +{ + __retVal = mat3x2(m[0], m[1], m[2]); } -mat3x2 __constructor (const mat2x3 m) { - return mat3x2 ( - m[0].xy, - m[1].xy, - 0., 0. - ); +mat3x2 __constructor(const mat3x4 m) +{ + __retVal = mat3x2(m[0].x, m[0].y, + m[1].x, m[1].y, + m[2].x, m[2].y); } -mat3x2 __constructor (const mat2x4 m) { - return mat3x2 ( - m[0].xy, - m[1].xy, - 0., 0. - ); +mat3x2 __constructor(const mat4x3 m) +{ + __retVal = mat3x2(m[0].x, m[0].y, + m[1].x, m[1].y, + m[2].x, m[2].y); +} + +mat3x2 __constructor(const mat4 m) +{ + __retVal = mat3x2(m[0].x, m[0].y, + m[1].x, m[1].y, + 0.0, 0.0); } +mat3x2 __constructor(const mat2 m) +{ + __retVal = mat3x2(m[0], m[1], vec2(0.0)); +} + +mat3x2 __constructor(const mat2x3 m) +{ + __retVal = mat3x2(m[0].x, m[0].y, + m[1].x, m[1].y, + 0.0, 0.0); +} -mat3 __constructor (const mat3 m) { - return m; +mat3x2 __constructor(const mat2x4 m) +{ + __retVal = mat3x2(m[0].x, m[0].y, + m[1].x, m[1].y, + 0.0, 0.0); } -mat3 __constructor (const mat4x3 m) { - return mat3 ( + + + +mat3 __constructor(const mat3 m) +{ + __retVal = m; +} + +mat3 __constructor(const mat4x3 m) +{ + __retVal = mat3 ( m[0], m[1], m[2] ); } -mat3 __constructor (const mat3x4 m) { - return mat3 ( +mat3 __constructor(const mat3x4 m) +{ + __retVal = mat3 ( m[0].xyz, m[1].xyz, m[2].xyz ); } -mat3 __constructor (const mat4 m) { - return mat3 ( +mat3 __constructor(const mat4 m) +{ + __retVal = mat3 ( m[0].xyz, m[1].xyz, m[2].xyz ); } -mat3 __constructor (const mat2x3 m) { - return mat3 ( +mat3 __constructor(const mat2x3 m) +{ + __retVal = mat3 ( m[0], m[1], 0., 0., 1. ); } -mat3 __constructor (const mat2x4 m) { - return mat3 ( +mat3 __constructor(const mat2x4 m) +{ + __retVal = mat3 ( m[0].xyz, m[1].xyz, 0., 0., 1. ); } -mat3 __constructor (const mat3x2 m) { - return mat3 ( +mat3 __constructor(const mat3x2 m) +{ + __retVal = mat3 ( m[0], 0., m[1], 0., m[2], 1. ); } -mat3 __constructor (const mat4x2 m) { - return mat3 ( +mat3 __constructor(const mat4x2 m) +{ + __retVal = mat3 ( m[0], 0., m[1], 0., m[2], 1. ); } -mat3 __constructor (const mat2 m) { - return mat3 ( +mat3 __constructor(const mat2 m) +{ + __retVal = mat3 ( m[0], 0., m[1], 0., 0., 0., 1. @@ -472,68 +593,77 @@ mat3 __constructor (const mat2 m) { } -mat3x4 __constructor (const mat3x4 m) { - return m; +mat3x4 __constructor(const mat3x4 m) +{ + __retVal = m; } -mat3x4 __constructor (const mat4 m) { - return mat3x4 ( +mat3x4 __constructor(const mat4 m) +{ + __retVal = mat3x4 ( m[0], m[1], m[2] ); } -mat3x4 __constructor (const mat3 m) { - return mat3x4 ( +mat3x4 __constructor(const mat3 m) +{ + __retVal = mat3x4 ( m[0], 0., m[1], 0., m[2], 0. ); } -mat3x4 __constructor (const mat4x3 m) { - return mat3x4 ( +mat3x4 __constructor(const mat4x3 m) +{ + __retVal = mat3x4 ( m[0], 0., m[1], 0., m[2], 0. ); } -mat3x4 __constructor (const mat2x4 m) { - return mat3x4 ( +mat3x4 __constructor(const mat2x4 m) +{ + __retVal = mat3x4 ( m[0], m[1], 0., 0., 1., 0. ); } -mat3x4 __constructor (const mat2x3 m) { - return mat3x4 ( +mat3x4 __constructor(const mat2x3 m) +{ + __retVal = mat3x4 ( m[0], 0., m[1], 0., 0., 0., 1., 0. ); } -mat3x4 __constructor (const mat3x2 m) { - return mat3x4 ( +mat3x4 __constructor(const mat3x2 m) +{ + __retVal = mat3x4 ( m[0], 0., 0., m[1], 0., 0., m[2], 1., 0. ); } -mat3x4 __constructor (const mat4x2 m) { - return mat3x4 ( +mat3x4 __constructor(const mat4x2 m) +{ + __retVal = mat3x4 ( m[0], 0., 0., m[1], 0., 0., m[2], 1., 0. ); } -mat3x4 __constructor (const mat2 m) { - return mat3x4 ( +mat3x4 __constructor(const mat2 m) +{ + __retVal = mat3x4 ( m[0], 0., 0., m[1], 0., 0., 0., 0., 1., 0. @@ -541,12 +671,14 @@ mat3x4 __constructor (const mat2 m) { } -mat4x2 __constructor (const mat4x2 m) { - return m; +mat4x2 __constructor(const mat4x2 m) +{ + __retVal = m; } -mat4x2 __constructor (const mat4x3 m) { - return mat4x2 ( +mat4x2 __constructor(const mat4x3 m) +{ + __retVal = mat4x2 ( m[0].xy, m[1].xy, m[2].xy, @@ -554,8 +686,9 @@ mat4x2 __constructor (const mat4x3 m) { ); } -mat4x2 __constructor (const mat4 m) { - return mat4x2 ( +mat4x2 __constructor(const mat4 m) +{ + __retVal = mat4x2 ( m[0].xy, m[1].xy, m[2].xy, @@ -563,16 +696,18 @@ mat4x2 __constructor (const mat4 m) { ); } -mat4x2 __constructor (const mat3x2 m) { - return mat4x2 ( +mat4x2 __constructor(const mat3x2 m) +{ + __retVal = mat4x2 ( m[0], m[1], 0., 0. ); } -mat4x2 __constructor (const mat3 m) { - return mat4x2 ( +mat4x2 __constructor(const mat3 m) +{ + __retVal = mat4x2 ( m[0].xy, m[1].xy, m[2].xy, @@ -580,8 +715,9 @@ mat4x2 __constructor (const mat3 m) { ); } -mat4x2 __constructor (const mat3x4 m) { - return mat4x2 ( +mat4x2 __constructor(const mat3x4 m) +{ + __retVal = mat4x2 ( m[0].xy, m[1].xy, m[2].xy, @@ -589,8 +725,9 @@ mat4x2 __constructor (const mat3x4 m) { ); } -mat4x2 __constructor (const mat2 m) { - return mat4x2 ( +mat4x2 __constructor(const mat2 m) +{ + __retVal = mat4x2 ( m[0], m[1], 0., 0., @@ -598,8 +735,9 @@ mat4x2 __constructor (const mat2 m) { ); } -mat4x2 __constructor (const mat2x3 m) { - return mat4x2 ( +mat4x2 __constructor(const mat2x3 m) +{ + __retVal = mat4x2 ( m[0].xy, m[1].xy, 0., 0., @@ -607,8 +745,9 @@ mat4x2 __constructor (const mat2x3 m) { ); } -mat4x2 __constructor (const mat2x4 m) { - return mat4x2 ( +mat4x2 __constructor(const mat2x4 m) +{ + __retVal = mat4x2 ( m[0].xy, m[1].xy, 0., 0., @@ -617,12 +756,14 @@ mat4x2 __constructor (const mat2x4 m) { } -mat4x3 __constructor (const mat4x3 m) { - return m; +mat4x3 __constructor(const mat4x3 m) +{ + __retVal = m; } -mat4x3 __constructor (const mat4 m) { - return mat4x3 ( +mat4x3 __constructor(const mat4 m) +{ + __retVal = mat4x3 ( m[0].xyz, m[1].xyz, m[2].xyz, @@ -630,8 +771,9 @@ mat4x3 __constructor (const mat4 m) { ); } -mat4x3 __constructor (const mat3 m) { - return mat4x3 ( +mat4x3 __constructor(const mat3 m) +{ + __retVal = mat4x3 ( m[0], m[1], m[2], @@ -639,8 +781,9 @@ mat4x3 __constructor (const mat3 m) { ); } -mat4x3 __constructor (const mat3x4 m) { - return mat4x3 ( +mat4x3 __constructor(const mat3x4 m) +{ + __retVal = mat4x3 ( m[0].xyz, m[1].xyz, m[2].xyz, @@ -648,8 +791,9 @@ mat4x3 __constructor (const mat3x4 m) { ); } -mat4x3 __constructor (const mat4x2 m) { - return mat4x3 ( +mat4x3 __constructor(const mat4x2 m) +{ + __retVal = mat4x3 ( m[0], 0., m[1], 0., m[2], 1., @@ -657,8 +801,9 @@ mat4x3 __constructor (const mat4x2 m) { ); } -mat4x3 __constructor (const mat2x3 m) { - return mat4x3 ( +mat4x3 __constructor(const mat2x3 m) +{ + __retVal = mat4x3 ( m[0], m[1], 0., 0., 1., @@ -666,8 +811,9 @@ mat4x3 __constructor (const mat2x3 m) { ); } -mat4x3 __constructor (const mat3x2 m) { - return mat4x3 ( +mat4x3 __constructor(const mat3x2 m) +{ + __retVal = mat4x3 ( m[0], 0., m[1], 0., m[2], 1., @@ -675,8 +821,9 @@ mat4x3 __constructor (const mat3x2 m) { ); } -mat4x3 __constructor (const mat2x4 m) { - return mat4x3 ( +mat4x3 __constructor(const mat2x4 m) +{ + __retVal = mat4x3 ( m[0].xyz, m[1].xyz, 0., 0., 1., @@ -684,8 +831,9 @@ mat4x3 __constructor (const mat2x4 m) { ); } -mat4x3 __constructor (const mat2 m) { - return mat4x3 ( +mat4x3 __constructor(const mat2 m) +{ + __retVal = mat4x3 ( m[0], 0., m[1], 0., 0., 0., 1., @@ -694,12 +842,14 @@ mat4x3 __constructor (const mat2 m) { } -mat4 __constructor (const mat4 m) { - return m; +mat4 __constructor(const mat4 m) +{ + __retVal = m; } -mat4 __constructor (const mat3x4 m) { - return mat4 ( +mat4 __constructor(const mat3x4 m) +{ + __retVal = mat4 ( m[0], m[1], m[2], @@ -707,8 +857,9 @@ mat4 __constructor (const mat3x4 m) { ); } -mat4 __constructor (const mat4x3 m) { - return mat4 ( +mat4 __constructor(const mat4x3 m) +{ + __retVal = mat4 ( m[0], 0., m[1], 0., m[2], 0., @@ -716,8 +867,9 @@ mat4 __constructor (const mat4x3 m) { ); } -mat4 __constructor (const mat2x4 m) { - return mat4 ( +mat4 __constructor(const mat2x4 m) +{ + __retVal = mat4 ( m[0], m[1], 0., 0., 1., 0., @@ -725,8 +877,9 @@ mat4 __constructor (const mat2x4 m) { ); } -mat4 __constructor (const mat4x2 m) { - return mat4 ( +mat4 __constructor(const mat4x2 m) +{ + __retVal = mat4 ( m[0], 0., 0., m[1], 0., 0., m[2], 1., 0., @@ -734,8 +887,9 @@ mat4 __constructor (const mat4x2 m) { ); } -mat4 __constructor (const mat3 m) { - return mat4 ( +mat4 __constructor(const mat3 m) +{ + __retVal = mat4 ( m[0], 0., m[1], 0., m[2], 0., @@ -743,8 +897,9 @@ mat4 __constructor (const mat3 m) { ); } -mat4 __constructor (const mat2x3 m) { - return mat4 ( +mat4 __constructor(const mat2x3 m) +{ + __retVal = mat4 ( m[0], 0., m[1], 0., 0., 0., 1., 0., @@ -752,8 +907,9 @@ mat4 __constructor (const mat2x3 m) { ); } -mat4 __constructor (const mat3x2 m) { - return mat4 ( +mat4 __constructor(const mat3x2 m) +{ + __retVal = mat4 ( m[0], 0., 0., m[1], 0., 0., m[2], 1., 0., @@ -761,8 +917,9 @@ mat4 __constructor (const mat3x2 m) { ); } -mat4 __constructor (const mat2 m) { - return mat4 ( +mat4 __constructor(const mat2 m) +{ + __retVal = mat4 ( m[0], 0., 0., m[1], 0., 0., 0., 0., 1., 0., @@ -882,52 +1039,46 @@ void __operator /= (inout mat4x3 m, const mat4x3 n) { } -vec3 __operator * (const mat2x3 m, const vec2 v) { - return vec3 ( - v.x * m[0].x + v.y * m[1].x, - v.x * m[0].y + v.y * m[1].y, - v.x * m[0].z + v.y * m[1].z - ); +vec3 __operator * (const mat2x3 m, const vec2 v) +{ + __retVal.x = v.x * m[0].x + v.y * m[1].x; + __retVal.y = v.x * m[0].y + v.y * m[1].y; + __retVal.z = v.x * m[0].z + v.y * m[1].z; } -vec4 __operator * (const mat2x4 m, const vec2 v) { - return vec4 ( - v.x * m[0].x + v.y * m[1].x, - v.x * m[0].y + v.y * m[1].y, - v.x * m[0].z + v.y * m[1].z, - v.x * m[0].w + v.y * m[1].w - ); +vec4 __operator * (const mat2x4 m, const vec2 v) +{ + __retVal.x = v.x * m[0].x + v.y * m[1].x; + __retVal.y = v.x * m[0].y + v.y * m[1].y; + __retVal.z = v.x * m[0].z + v.y * m[1].z; + __retVal.w = v.x * m[0].w + v.y * m[1].w; } -vec2 __operator * (const mat3x2 m, const vec3 v) { - return vec2 ( - v.x * m[0].x + v.y * m[1].x + v.z * m[2].x, - v.x * m[0].y + v.y * m[1].y + v.z * m[2].y - ); +vec2 __operator * (const mat3x2 m, const vec3 v) +{ + __retVal.x = v.x * m[0].x + v.y * m[1].x + v.z * m[2].x; + __retVal.y = v.x * m[0].y + v.y * m[1].y + v.z * m[2].y; } -vec4 __operator * (const mat3x4 m, const vec3 v) { - return vec4 ( - v.x * m[0].x + v.y * m[1].x + v.z * m[2].x, - v.x * m[0].y + v.y * m[1].y + v.z * m[2].y, - v.x * m[0].z + v.y * m[1].z + v.z * m[2].z, - v.x * m[0].w + v.y * m[1].w + v.z * m[2].w - ); +vec4 __operator * (const mat3x4 m, const vec3 v) +{ + __retVal.x = v.x * m[0].x + v.y * m[1].x + v.z * m[2].x; + __retVal.y = v.x * m[0].y + v.y * m[1].y + v.z * m[2].y; + __retVal.z = v.x * m[0].z + v.y * m[1].z + v.z * m[2].z; + __retVal.w = v.x * m[0].w + v.y * m[1].w + v.z * m[2].w; } -vec2 __operator * (const mat4x2 m, const vec4 v) { - return vec2 ( - v.x * m[0].x + v.y * m[1].x + v.z * m[2].x + v.w * m[3].x, - v.x * m[0].y + v.y * m[1].y + v.z * m[2].y + v.w * m[3].y - ); +vec2 __operator * (const mat4x2 m, const vec4 v) +{ + __retVal.x = v.x * m[0].x + v.y * m[1].x + v.z * m[2].x + v.w * m[3].x; + __retVal.y = v.x * m[0].y + v.y * m[1].y + v.z * m[2].y + v.w * m[3].y; } -vec3 __operator * (const mat4x3 m, const vec4 v) { - return vec3 ( - v.x * m[0].x + v.y * m[1].x + v.z * m[2].x + v.w * m[3].x, - v.x * m[0].y + v.y * m[1].y + v.z * m[2].y + v.w * m[3].y, - v.x * m[0].z + v.y * m[1].z + v.z * m[2].z + v.w * m[3].z - ); +vec3 __operator * (const mat4x3 m, const vec4 v) +{ + __retVal.x = v.x * m[0].x + v.y * m[1].x + v.z * m[2].x + v.w * m[3].x; + __retVal.y = v.x * m[0].y + v.y * m[1].y + v.z * m[2].y + v.w * m[3].y; + __retVal.z = v.x * m[0].z + v.y * m[1].z + v.z * m[2].z + v.w * m[3].z; } @@ -1061,52 +1212,46 @@ void __operator *= (inout mat4x3 m, const mat4 n) { } -vec3 __operator * (const vec2 v, const mat3x2 m) { - return vec3 ( - v.x * m[0].x + v.y * m[0].y, - v.x * m[1].x + v.y * m[1].y, - v.x * m[2].x + v.y * m[2].y - ); +vec3 __operator * (const vec2 v, const mat3x2 m) +{ + __retVal.x = dot(v, m[0]); + __retVal.y = dot(v, m[1]); + __retVal.z = dot(v, m[2]); } -vec4 __operator * (const vec2 v, const mat4x2 m) { - return vec4 ( - v.x * m[0].x + v.y * m[0].y, - v.x * m[1].x + v.y * m[1].y, - v.x * m[2].x + v.y * m[2].y, - v.x * m[3].x + v.y * m[3].y - ); +vec4 __operator * (const vec2 v, const mat4x2 m) +{ + __retVal.x = dot(v, m[0]); + __retVal.y = dot(v, m[1]); + __retVal.z = dot(v, m[2]); + __retVal.w = dot(v, m[3]); } -vec2 __operator * (const vec3 v, const mat2x3 m) { - return vec2 ( - v.x * m[0].x + v.y * m[0].y + v.z * m[0].z, - v.x * m[1].x + v.y * m[1].y + v.z * m[1].z - ); +vec2 __operator * (const vec3 v, const mat2x3 m) +{ + __retVal.x = dot(v, m[0]); + __retVal.y = dot(v, m[1]); } -vec4 __operator * (const vec3 v, const mat4x3 m) { - return vec4 ( - v.x * m[0].x + v.y * m[0].y + v.z * m[0].z, - v.x * m[1].x + v.y * m[1].y + v.z * m[1].z, - v.x * m[2].x + v.y * m[2].y + v.z * m[2].z, - v.x * m[3].x + v.y * m[3].y + v.z * m[3].z - ); +vec4 __operator * (const vec3 v, const mat4x3 m) +{ + __retVal.x = dot(v, m[0]); + __retVal.y = dot(v, m[1]); + __retVal.z = dot(v, m[2]); + __retVal.w = dot(v, m[3]); } -vec2 __operator * (const vec4 v, const mat2x4 m) { - return vec2 ( - v.x * m[0].x + v.y * m[0].y + v.z * m[0].z + v.w * m[0].w, - v.x * m[1].x + v.y * m[1].y + v.z * m[1].z + v.w * m[1].w - ); +vec2 __operator * (const vec4 v, const mat2x4 m) +{ + __retVal.x = dot(v, m[0]); + __retVal.y = dot(v, m[1]); } -vec3 __operator * (const vec4 v, const mat3x4 m) { - return vec3 ( - v.x * m[0].x + v.y * m[0].y + v.z * m[0].z + v.w * m[0].w, - v.x * m[1].x + v.y * m[1].y + v.z * m[1].z + v.w * m[1].w, - v.x * m[2].x + v.y * m[2].y + v.z * m[2].z + v.w * m[2].w - ); +vec3 __operator * (const vec4 v, const mat3x4 m) +{ + __retVal.x = dot(v, m[0]); + __retVal.y = dot(v, m[1]); + __retVal.z = dot(v, m[2]); } @@ -1677,40 +1822,3 @@ mat4x3 __operator ++ (inout mat4x3 m, const int) { return mat4x3 (m[0]++, m[1]++, m[2]++, m[3]++); } - -void printMESA (const mat2x3 m) { - printMESA (m[0]); - printMESA (m[1]); -} - -void printMESA (const mat2x4 m) { - printMESA (m[0]); - printMESA (m[1]); -} - -void printMESA (const mat3x2 m) { - printMESA (m[0]); - printMESA (m[1]); - printMESA (m[2]); -} - -void printMESA (const mat3x4 m) { - printMESA (m[0]); - printMESA (m[1]); - printMESA (m[2]); -} - -void printMESA (const mat4x2 m) { - printMESA (m[0]); - printMESA (m[1]); - printMESA (m[2]); - printMESA (m[3]); -} - -void printMESA (const mat4x3 m) { - printMESA (m[0]); - printMESA (m[1]); - printMESA (m[2]); - printMESA (m[3]); -} - -- cgit v1.2.3 From bce7043ebcbb75cec727553341af4c66b03732ef Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 11 Apr 2007 12:30:31 -0600 Subject: regenerated --- src/mesa/shader/slang/library/slang_120_core_gc.h | 1176 +++++++++++--------- .../shader/slang/library/slang_common_builtin_gc.h | 173 +-- .../slang/library/slang_fragment_builtin_gc.h | 54 +- 3 files changed, 751 insertions(+), 652 deletions(-) diff --git a/src/mesa/shader/slang/library/slang_120_core_gc.h b/src/mesa/shader/slang/library/slang_120_core_gc.h index 2c7d396ad28..ef00e027683 100644 --- a/src/mesa/shader/slang/library/slang_120_core_gc.h +++ b/src/mesa/shader/slang/library/slang_120_core_gc.h @@ -2,560 +2,658 @@ /* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */ /* slang_120_core.gc */ -3,1,0,26,1,1,1,0,9,100,102,0,0,0,1,8,58,109,97,116,50,120,51,0,18,100,102,0,0,17,48,0,0,0,0,17,48, -0,0,0,0,17,48,0,0,0,0,18,100,102,0,0,17,48,0,0,0,0,0,0,0,1,0,26,1,1,1,0,5,100,105,0,0,0,1,3,2,0,9, -1,100,102,0,0,0,4,105,110,116,95,116,111,95,102,108,111,97,116,0,18,100,102,0,0,18,100,105,0,0,0,8, -58,109,97,116,50,120,51,0,18,100,102,0,0,0,0,0,1,0,26,1,1,1,0,1,100,98,0,0,0,1,8,58,109,97,116,50, -120,51,0,18,100,98,0,17,49,0,0,0,17,48,0,0,0,31,0,0,0,0,1,0,28,1,1,1,0,9,100,102,0,0,0,1,8,58,109, -97,116,50,120,52,0,18,100,102,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,18,100, -102,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,0,0,1,0,28,1,1,1,0,5,100,105,0,0,0,1,3,2,0,9,1,100,102,0,0,0, -4,105,110,116,95,116,111,95,102,108,111,97,116,0,18,100,102,0,0,18,100,105,0,0,0,8,58,109,97,116, -50,120,52,0,18,100,102,0,0,0,0,0,1,0,28,1,1,1,0,1,100,98,0,0,0,1,8,58,109,97,116,50,120,52,0,18, -100,98,0,17,49,0,0,0,17,48,0,0,0,31,0,0,0,0,1,0,27,1,1,1,0,9,100,102,0,0,0,1,8,58,109,97,116,51, -120,50,0,18,100,102,0,0,17,48,0,0,0,0,17,48,0,0,0,0,18,100,102,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,0, -0,1,0,27,1,1,1,0,5,100,105,0,0,0,1,3,2,0,9,1,100,102,0,0,0,4,105,110,116,95,116,111,95,102,108,111, -97,116,0,18,100,102,0,0,18,100,105,0,0,0,8,58,109,97,116,51,120,50,0,18,100,102,0,0,0,0,0,1,0,27,1, -1,1,0,1,100,98,0,0,0,1,8,58,109,97,116,51,120,50,0,18,100,98,0,17,49,0,0,0,17,48,0,0,0,31,0,0,0,0, -1,0,30,1,1,1,0,9,100,102,0,0,0,1,8,58,109,97,116,51,120,52,0,18,100,102,0,0,17,48,0,0,0,0,17,48,0, -0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,18,100,102,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0, -0,0,0,18,100,102,0,0,17,48,0,0,0,0,0,0,0,1,0,30,1,1,1,0,5,100,105,0,0,0,1,3,2,0,9,1,100,102,0,0,0, -4,105,110,116,95,116,111,95,102,108,111,97,116,0,18,100,102,0,0,18,100,105,0,0,0,8,58,109,97,116, -51,120,52,0,18,100,102,0,0,0,0,0,1,0,30,1,1,1,0,1,100,98,0,0,0,1,8,58,109,97,116,51,120,52,0,18, -100,98,0,17,49,0,0,0,17,48,0,0,0,31,0,0,0,0,1,0,29,1,1,1,0,9,100,102,0,0,0,1,8,58,109,97,116,52, -120,50,0,18,100,102,0,0,17,48,0,0,0,0,17,48,0,0,0,0,18,100,102,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17, -48,0,0,0,0,17,48,0,0,0,0,0,0,0,1,0,29,1,1,1,0,5,100,105,0,0,0,1,3,2,0,9,1,100,102,0,0,0,4,105,110, -116,95,116,111,95,102,108,111,97,116,0,18,100,102,0,0,18,100,105,0,0,0,8,58,109,97,116,52,120,50,0, -18,100,102,0,0,0,0,0,1,0,29,1,1,1,0,1,100,98,0,0,0,1,8,58,109,97,116,52,120,50,0,18,100,98,0,17,49, -0,0,0,17,48,0,0,0,31,0,0,0,0,1,0,31,1,1,1,0,9,100,102,0,0,0,1,8,58,109,97,116,52,120,51,0,18,100, -102,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,18,100,102,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48, -0,0,0,0,18,100,102,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,0,0,1,0,31,1,1,1,0,5,100,105,0, -0,0,1,3,2,0,9,1,100,102,0,0,0,4,105,110,116,95,116,111,95,102,108,111,97,116,0,18,100,102,0,0,18, -100,105,0,0,0,8,58,109,97,116,52,120,51,0,18,100,102,0,0,0,0,0,1,0,31,1,1,1,0,1,100,98,0,0,0,1,8, -58,109,97,116,52,120,51,0,18,100,98,0,17,49,0,0,0,17,48,0,0,0,31,0,0,0,0,1,0,13,1,1,1,0,13,109,0,0, -0,1,8,18,109,0,0,0,1,0,13,1,1,1,0,27,109,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,0,18, -109,0,16,10,49,0,57,0,0,0,0,1,0,13,1,1,1,0,29,109,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0, -57,0,18,109,0,16,10,49,0,57,0,0,0,0,1,0,13,1,1,1,0,26,109,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16, -8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,0,0,0,1,0,13,1,1,1,0,28,109,0,0,0,1, -8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,0, -0,0,1,0,13,1,1,1,0,14,109,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109, -0,16,10,49,0,57,59,120,121,0,0,0,0,0,1,0,13,1,1,1,0,30,109,0,0,0,1,8,58,109,97,116,50,0,18,109,0, -16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,0,0,0,1,0,13,1,1,1,0,31,109,0,0, -0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0, -0,0,0,0,1,0,13,1,1,1,0,15,109,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18, -109,0,16,10,49,0,57,59,120,121,0,0,0,0,0,1,0,26,1,1,1,0,26,109,0,0,0,1,8,18,109,0,0,0,1,0,26,1,1,1, -0,14,109,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,0,0, -0,1,0,26,1,1,1,0,31,109,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10, -49,0,57,0,0,0,0,1,0,26,1,1,1,0,28,109,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,59, -120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,0,0,0,1,0,26,1,1,1,0,30,109,0,0,0,1,8,58, -109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121, -122,0,0,0,0,0,1,0,26,1,1,1,0,15,109,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,59, -120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,0,0,0,1,0,26,1,1,1,0,13,109,0,0,0,1,8,58, -109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0, -0,0,0,0,1,0,26,1,1,1,0,27,109,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,0,17,48,0, -0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,0,0,0,1,0,26,1,1,1,0,29,109,0,0,0,1,8,58,109,97,116, -50,120,51,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,0,0,0,1,0, -28,1,1,1,0,28,109,0,0,0,1,8,18,109,0,0,0,1,0,28,1,1,1,0,30,109,0,0,0,1,8,58,109,97,116,50,120,52,0, -18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,0,0,0,1,0,28,1,1,1,0,15,109,0,0,0,1,8,58,109,97, -116,50,120,52,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,0,0,0,1,0,28,1,1,1,0,26,109,0,0,0, -1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48, -0,0,0,0,0,0,0,1,0,28,1,1,1,0,14,109,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,0,17, -48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,0,0,0,1,0,28,1,1,1,0,31,109,0,0,0,1,8,58,109,97, -116,50,120,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,0,0,0, -1,0,28,1,1,1,0,13,109,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,17, -48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,0,0,0,1,0,28,1,1,1,0,27,109,0,0,0, -1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10, -49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,0,0,0,1,0,28,1,1,1,0,29,109,0,0,0,1,8,58,109,97,116,50,120, -52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17, -48,0,0,0,0,0,0,0,1,0,27,1,1,1,0,27,109,0,0,0,1,8,18,109,0,0,0,1,0,27,1,1,1,0,29,109,0,0,0,1,8,58, -109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,18,109,0,16,10,50,0,57,0,0, -0,0,1,0,27,1,1,1,0,14,109,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0, -18,109,0,16,10,49,0,57,59,120,121,0,0,18,109,0,16,10,50,0,57,59,120,121,0,0,0,0,0,1,0,27,1,1,1,0, -30,109,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49, -0,57,59,120,121,0,0,18,109,0,16,10,50,0,57,59,120,121,0,0,0,0,0,1,0,27,1,1,1,0,31,109,0,0,0,1,8,58, -109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0, -18,109,0,16,10,50,0,57,59,120,121,0,0,0,0,0,1,0,27,1,1,1,0,15,109,0,0,0,1,8,58,109,97,116,51,120, -50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,18,109,0,16,10,50, -0,57,59,120,121,0,0,0,0,0,1,0,27,1,1,1,0,13,109,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8, -48,0,57,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,0,0,0,1,0,27,1,1,1,0,26,109,0,0,0,1, -8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121, -0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,0,0,1,0,27,1,1,1,0,28,109,0,0,0,1,8,58,109,97,116,51,120,50,0,18, -109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,17,48,0,0,0,0,17,48,0,0,0, -0,0,0,0,1,0,14,1,1,1,0,14,109,0,0,0,1,8,18,109,0,0,0,1,0,14,1,1,1,0,31,109,0,0,0,1,8,58,109,97,116, -51,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,18,109,0,16,10,50,0,57,0,0,0,0,1,0,14,1,1,1, -0,30,109,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0, -57,59,120,121,122,0,0,18,109,0,16,10,50,0,57,59,120,121,122,0,0,0,0,0,1,0,14,1,1,1,0,15,109,0,0,0, -1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121, -122,0,0,18,109,0,16,10,50,0,57,59,120,121,122,0,0,0,0,0,1,0,14,1,1,1,0,26,109,0,0,0,1,8,58,109,97, -116,51,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0, -0,0,0,0,1,0,14,1,1,1,0,28,109,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,59,120,121,122,0, -0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,0,0,1,0,14, -1,1,1,0,27,109,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10, -49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,0,0,0,1,0,14,1,1,1,0,29,109,0,0,0,1, -8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0, -18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,0,0,0,1,0,14,1,1,1,0,13,109,0,0,0,1,8,58,109,97,116,51,0,18, -109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0, -0,0,17,49,0,0,0,0,0,0,0,1,0,30,1,1,1,0,30,109,0,0,0,1,8,18,109,0,0,0,1,0,30,1,1,1,0,15,109,0,0,0,1, -8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,18,109,0,16,10,50,0, -57,0,0,0,0,1,0,30,1,1,1,0,14,109,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,0,17,48, -0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,0,0,0,1,0,30, -1,1,1,0,31,109,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0, -16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,0,0,0,1,0,30,1,1,1,0,28,109,0, -0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0, -17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,0,0,0,1,0,30,1,1,1,0,26,109,0,0,0,1,8,58,109,97,116,51, +3,1,0,26,1,1,1,0,9,102,48,48,0,0,1,1,0,9,102,49,48,0,0,1,1,0,9,102,50,48,0,0,1,1,0,9,102,48,49,0,0, +1,1,0,9,102,49,49,0,0,1,1,0,9,102,50,49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59, +120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,121,0,18,102,49,48,0, +20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,122,0,18,102,50,48,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,10,49,0,57,59,120,0,18,102,48,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0, +16,10,49,0,57,59,121,0,18,102,49,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,122, +0,18,102,50,49,0,20,0,0,1,0,26,1,1,1,0,9,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97, +116,50,120,51,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0, +48,0,0,0,0,20,0,0,1,0,26,1,1,1,0,5,105,0,0,0,1,3,2,1,9,1,102,0,2,58,102,108,111,97,116,0,18,105,0, +0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,18,102,0,0,0,20,0,0,1,0,26,1, +1,1,0,1,98,0,0,0,1,3,2,1,9,1,102,0,2,58,102,108,111,97,116,0,18,98,0,0,0,0,0,9,18,95,95,114,101, +116,86,97,108,0,58,109,97,116,50,120,51,0,18,102,0,0,0,20,0,0,1,0,26,1,1,1,0,11,99,48,0,0,1,1,0,11, +99,49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,10,49,0,57,18,99,49,0,20,0,0,1,0,28,1,1,1,0,9,102,48,48,0,0,1,1,0,9,102,49,48,0, +0,1,1,0,9,102,50,48,0,0,1,1,0,9,102,51,48,0,0,1,1,0,9,102,48,49,0,0,1,1,0,9,102,49,49,0,0,1,1,0,9, +102,50,49,0,0,1,1,0,9,102,51,49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,120,0, +18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,121,0,18,102,49,48,0,20,0,9, +18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,122,0,18,102,50,48,0,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,8,48,0,57,59,119,0,18,102,51,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49, +0,57,59,120,0,18,102,48,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,102, +49,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,122,0,18,102,50,49,0,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,10,49,0,57,59,119,0,18,102,51,49,0,20,0,0,1,0,28,1,1,1,0,9,102,0,0,0, +1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0, +48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1, +0,28,1,1,1,0,5,105,0,0,0,1,3,2,1,9,1,102,0,2,58,102,108,111,97,116,0,18,105,0,0,0,0,0,9,18,95,95, +114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,18,102,0,0,0,20,0,0,1,0,28,1,1,1,0,1,98,0,0,0,1, +3,2,1,9,1,102,0,2,58,102,108,111,97,116,0,18,98,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58, +109,97,116,50,120,52,0,18,102,0,0,0,20,0,0,1,0,28,1,1,1,0,12,99,48,0,0,1,1,0,12,99,49,0,0,0,1,9,18, +95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, +10,49,0,57,18,99,49,0,20,0,0,1,0,27,1,1,1,0,9,102,48,48,0,0,1,1,0,9,102,49,48,0,0,1,1,0,9,102,48, +49,0,0,1,1,0,9,102,49,49,0,0,1,1,0,9,102,48,50,0,0,1,1,0,9,102,49,50,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,16,8,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8, +48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0,18, +102,48,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,102,49,49,0,20,0,9, +18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,120,0,18,102,48,50,0,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,10,50,0,57,59,121,0,18,102,49,50,0,20,0,0,1,0,27,1,1,1,0,9,102,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18, +102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,27,1,1,1,0,5,105,0,0,0,1,3,2,1,9,1,102,0,2, +58,102,108,111,97,116,0,18,105,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120, +50,0,18,102,0,0,0,20,0,0,1,0,27,1,1,1,0,1,98,0,0,0,1,3,2,1,9,1,102,0,2,58,102,108,111,97,116,0,18, +98,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,18,102,0,0,0,20,0,0,1,0, +27,1,1,1,0,10,99,48,0,0,1,1,0,10,99,49,0,0,1,1,0,10,99,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108, +0,16,8,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,99,49,0,20,0,9, +18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,99,50,0,20,0,0,1,0,30,1,1,1,0,9,102,48,48,0,0,1, +1,0,9,102,49,48,0,0,1,1,0,9,102,50,48,0,0,1,1,0,9,102,51,48,0,0,1,1,0,9,102,48,49,0,0,1,1,0,9,102, +49,49,0,0,1,1,0,9,102,50,49,0,0,1,1,0,9,102,51,49,0,0,1,1,0,9,102,48,50,0,0,1,1,0,9,102,49,50,0,0, +1,1,0,9,102,50,50,0,0,1,1,0,9,102,51,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59, +120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,121,0,18,102,49,48,0, +20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,122,0,18,102,50,48,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,8,48,0,57,59,119,0,18,102,51,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0, +16,10,49,0,57,59,120,0,18,102,48,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,121, +0,18,102,49,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,122,0,18,102,50,49,0,20, +0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,119,0,18,102,51,49,0,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,10,50,0,57,59,120,0,18,102,48,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, +10,50,0,57,59,121,0,18,102,49,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,122,0, +18,102,50,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,119,0,18,102,51,50,0,20,0, +0,1,0,30,1,1,1,0,9,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,18,102, +0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0, +0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,30,1, +1,1,0,5,105,0,0,0,1,3,2,1,9,1,102,0,2,58,102,108,111,97,116,0,18,105,0,0,0,0,0,9,18,95,95,114,101, +116,86,97,108,0,58,109,97,116,51,120,52,0,18,102,0,0,0,20,0,0,1,0,30,1,1,1,0,1,98,0,0,0,1,3,2,1,9, +1,102,0,2,58,102,108,111,97,116,0,18,98,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116, +51,120,52,0,18,102,0,0,0,20,0,0,1,0,30,1,1,1,0,12,99,48,0,0,1,1,0,12,99,49,0,0,1,1,0,12,99,50,0,0, +0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97, +108,0,16,10,49,0,57,18,99,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,99,50,0,20, +0,0,1,0,29,1,1,1,0,9,102,48,48,0,0,1,1,0,9,102,49,48,0,0,1,1,0,9,102,48,49,0,0,1,1,0,9,102,49,49,0, +0,1,1,0,9,102,48,50,0,0,1,1,0,9,102,49,50,0,0,1,1,0,9,102,48,51,0,0,1,1,0,9,102,49,51,0,0,0,1,9,18, +95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86, +97,108,0,16,8,48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0, +57,59,120,0,18,102,48,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,102, +49,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,120,0,18,102,48,50,0,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,10,50,0,57,59,121,0,18,102,49,50,0,20,0,9,18,95,95,114,101,116,86,97, +108,0,16,10,51,0,57,59,120,0,18,102,48,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57, +59,121,0,18,102,49,51,0,20,0,0,1,0,29,1,1,1,0,9,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58, +109,97,116,52,120,50,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,16,10,52,0,0,17,48,0,48,0,0,0, +17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,29,1,1,1,0,5,105,0,0,0,1,3,2,1,9,1, +102,0,2,58,102,108,111,97,116,0,18,105,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116, +52,120,50,0,18,102,0,0,0,20,0,0,1,0,29,1,1,1,0,1,98,0,0,0,1,3,2,1,9,1,102,0,2,58,102,108,111,97, +116,0,18,98,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,18,102,0,0,0,20, +0,0,1,0,29,1,1,1,0,10,99,48,0,0,1,1,0,10,99,49,0,0,1,1,0,10,99,50,0,0,1,1,0,10,99,51,0,0,0,1,9,18, +95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, +10,49,0,57,18,99,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,99,50,0,20,0,9,18, +95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,99,51,0,20,0,0,1,0,31,1,1,1,0,9,102,48,48,0,0,1,1,0, +9,102,49,48,0,0,1,1,0,9,102,50,48,0,0,1,1,0,9,102,48,49,0,0,1,1,0,9,102,49,49,0,0,1,1,0,9,102,50, +49,0,0,1,1,0,9,102,48,50,0,0,1,1,0,9,102,49,50,0,0,1,1,0,9,102,50,50,0,0,1,1,0,9,102,48,51,0,0,1,1, +0,9,102,49,51,0,0,1,1,0,9,102,50,51,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,120, +0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,121,0,18,102,49,48,0,20,0, +9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,122,0,18,102,50,48,0,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,10,49,0,57,59,120,0,18,102,48,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, +10,49,0,57,59,121,0,18,102,49,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,122,0, +18,102,50,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,120,0,18,102,48,50,0,20,0, +9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,121,0,18,102,49,50,0,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,10,50,0,57,59,122,0,18,102,50,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, +10,51,0,57,59,120,0,18,102,48,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,59,121,0, +18,102,49,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,59,122,0,18,102,50,51,0,20,0, +0,1,0,31,1,1,1,0,9,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,18,102, +0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0, +0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,31,1, +1,1,0,5,105,0,0,0,1,3,2,1,9,1,102,0,2,58,102,108,111,97,116,0,18,105,0,0,0,0,0,9,18,95,95,114,101, +116,86,97,108,0,58,109,97,116,52,120,51,0,18,102,0,0,0,20,0,0,1,0,31,1,1,1,0,1,98,0,0,0,1,3,2,1,9, +1,102,0,2,58,102,108,111,97,116,0,18,98,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116, +52,120,51,0,18,102,0,0,0,20,0,0,1,0,31,1,1,1,0,11,99,48,0,0,1,1,0,11,99,49,0,0,1,1,0,11,99,50,0,0, +1,1,0,11,99,51,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,99,48,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,16,10,49,0,57,18,99,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50, +0,57,18,99,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,99,51,0,20,0,0,1,0,13,1,1, +1,0,13,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,13,1,1,1,0,27,109,0,0,0, +1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49, +0,57,0,0,20,0,0,1,0,13,1,1,1,0,29,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50, +0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,0,13,1,1,1,0,26,109,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,58,109,97,116,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10, +49,0,57,59,120,121,0,0,0,20,0,0,1,0,13,1,1,1,0,28,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, +58,109,97,116,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,0,20, +0,0,1,0,13,1,1,1,0,14,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,0,18,109,0, +16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,0,20,0,0,1,0,13,1,1,1,0,30,109,0, +0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0, +18,109,0,16,10,49,0,57,59,120,121,0,0,0,20,0,0,1,0,13,1,1,1,0,31,109,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,58,109,97,116,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59, +120,121,0,0,0,20,0,0,1,0,13,1,1,1,0,15,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97, +116,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,0,20,0,0,1,0, +26,1,1,1,0,26,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,26,1,1,1,0,14,109, +0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,0,18, +109,0,16,10,49,0,57,0,0,20,0,0,1,0,26,1,1,1,0,31,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58, +109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,0,26,1,1,1,0,28, +109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,59, +120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,0,20,0,0,1,0,26,1,1,1,0,30,109,0,0,0,1,9, +18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,59,120,121,122,0, +0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,0,20,0,0,1,0,26,1,1,1,0,15,109,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16, +10,49,0,57,59,120,121,122,0,0,0,20,0,0,1,0,26,1,1,1,0,13,109,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0, +17,48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0, +0,0,0,20,0,0,1,0,26,1,1,1,0,27,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120, +51,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,17,48,0,48,0,0,0,18,109,0, +16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,26,1,1,1, +0,29,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0, +57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,17,48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0, +18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,28,1,1,1,0,28,109,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,28,1,1,1,0,30,109,0,0,0,1,9,18,95,95,114,101,116,86, +97,108,0,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,0, +28,1,1,1,0,15,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,18,109,0,16, +8,48,0,57,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,0,28,1,1,1,0,26,109,0,0,0,1,9,18,95,95,114,101,116, +86,97,108,0,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59, +121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,17,48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109, +0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,122,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,28,1,1, +1,0,14,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0, +57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,17,48,0,48,0,0,0, +18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,122, +0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,28,1,1,1,0,31,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58, +109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0, +16,8,48,0,57,59,122,0,0,17,48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57, +59,121,0,0,18,109,0,16,10,49,0,57,59,122,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,28,1,1,1,0,13,109,0,0,0, +1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,59,120,0,0,18, +109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0, +18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,28,1,1,1,0,27,109, +0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,59,120, +0,0,18,109,0,16,8,48,0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,109,0,16,10,49,0,57,59, +120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,28,1,1,1, +0,29,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0, +57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,109,0,16,10,49, +0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0, +27,1,1,1,0,27,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,27,1,1,1,0,29,109, +0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,0,18, +109,0,16,10,49,0,57,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,0,27,1,1,1,0,14,109,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0, +18,109,0,16,10,50,0,57,0,0,20,0,0,1,0,27,1,1,1,0,30,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, +58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109, +0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18, +109,0,16,10,50,0,57,59,121,0,0,0,20,0,0,1,0,27,1,1,1,0,31,109,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0, +18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,120, +0,0,18,109,0,16,10,50,0,57,59,121,0,0,0,20,0,0,1,0,27,1,1,1,0,15,109,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57, +59,121,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,17, +48,0,48,0,0,0,0,20,0,0,1,0,27,1,1,1,0,13,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97, +116,51,120,50,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,58,118,101,99,50,0,17,48,0,48,0,0, +0,0,0,0,20,0,0,1,0,27,1,1,1,0,26,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51, +120,50,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57, +59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,27,1,1, +1,0,28,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0, +57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49, +0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,0,14,1,1,1,0,14,109,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,14,1,1,1,0,31,109,0,0,0,1,9,18,95,95,114,101,116,86, +97,108,0,58,109,97,116,51,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,18,109,0,16,10,50,0, +57,0,0,20,0,0,1,0,14,1,1,1,0,30,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0, +18,109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,18,109,0,16,10, +50,0,57,59,120,121,122,0,0,0,20,0,0,1,0,14,1,1,1,0,15,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108, +0,58,109,97,116,51,0,18,109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121, +122,0,0,18,109,0,16,10,50,0,57,59,120,121,122,0,0,0,20,0,0,1,0,14,1,1,1,0,26,109,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,58,109,97,116,51,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,17, +48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,0,14,1,1,1,0,28,109,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,58,109,97,116,51,0,18,109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0,57, +59,120,121,122,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,0,14,1,1,1,0,27,109,0,0,0, +1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18, +109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,0,20,0,0,1,0,14,1,1,1,0, +29,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,18,109,0,16,8,48,0,57,0,17,48, +0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,0,20,0,0,1,0, +14,1,1,1,0,13,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,18,109,0,16,8,48,0, +57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0, +0,0,20,0,0,1,0,30,1,1,1,0,30,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,30, +1,1,1,0,15,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,18,109,0,16,8, +48,0,57,0,18,109,0,16,10,49,0,57,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,0,30,1,1,1,0,14,109,0,0,0,1, +9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0, +18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,0,20,0,0,1,0,30,1,1, +1,0,31,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0, +57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,0, +20,0,0,1,0,30,1,1,1,0,28,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0, +18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0, +0,0,0,0,20,0,0,1,0,30,1,1,1,0,26,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51, 120,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0, -0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,0,0,0,1,0,30,1,1,1,0,27,109,0,0,0,1,8,58,109,97,116,51, +0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,30,1,1,1,0,27,109,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0, +18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,17,48, +0,0,0,0,0,20,0,0,1,0,30,1,1,1,0,29,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51, 120,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0, -0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,17,48,0,0,0,0,0,0,0,1,0,30,1,1,1,0,29,109,0, -0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16, -10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,17,48,0,0,0,0,0,0, -0,1,0,30,1,1,1,0,13,109,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0, -17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17, -49,0,0,0,0,17,48,0,0,0,0,0,0,0,1,0,29,1,1,1,0,29,109,0,0,0,1,8,18,109,0,0,0,1,0,29,1,1,1,0,31,109, -0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59, -120,121,0,0,18,109,0,16,10,50,0,57,59,120,121,0,0,18,109,0,16,10,51,0,57,59,120,121,0,0,0,0,0,1,0, -29,1,1,1,0,15,109,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109, -0,16,10,49,0,57,59,120,121,0,0,18,109,0,16,10,50,0,57,59,120,121,0,0,18,109,0,16,10,51,0,57,59,120, -121,0,0,0,0,0,1,0,29,1,1,1,0,27,109,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,0,18, -109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,0,0,0,1,0,29,1,1,1,0,14,109,0,0,0,1,8,58,109,97, -116,52,120,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,18,109, -0,16,10,50,0,57,59,120,121,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,0,0,1,0,29,1,1,1,0,30,109,0,0,0,1,8, +0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,30,1,1,1,0,13, +109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,0, +17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17, +48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,29,1,1,1,0,29,109,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,18,109,0,20,0,0,1,0,29,1,1,1,0,31,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, 58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0, -0,18,109,0,16,10,50,0,57,59,120,121,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,0,0,1,0,29,1,1,1,0,13,109,0, -0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0, -17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,0,0,1,0,29,1,1,1,0,26,109,0,0,0,1,8,58,109,97,116,52, -120,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,17,48,0,0,0,0, -17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,0,0,1,0,29,1,1,1,0,28,109,0,0,0,1,8,58,109,97,116,52, -120,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,17,48,0,0,0,0, -17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,0,0,1,0,31,1,1,1,0,31,109,0,0,0,1,8,18,109,0,0,0,1,0, -31,1,1,1,0,15,109,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,59,120,121,122,0,0,18, -109,0,16,10,49,0,57,59,120,121,122,0,0,18,109,0,16,10,50,0,57,59,120,121,122,0,0,18,109,0,16,10,51, -0,57,59,120,121,122,0,0,0,0,0,1,0,31,1,1,1,0,14,109,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0, -16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48, -0,0,0,0,0,0,0,1,0,31,1,1,1,0,30,109,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,59, -120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,18,109,0,16,10,50,0,57,59,120,121,122,0, -0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,0,0,1,0,31,1,1,1,0,29,109,0,0,0,1,8,58,109,97,116,52, -120,51,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16, -10,50,0,57,0,17,49,0,0,0,0,18,109,0,16,10,51,0,57,0,17,48,0,0,0,0,0,0,0,1,0,31,1,1,1,0,26,109,0,0, -0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17, -48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,0,0,1,0,31,1,1,1,0,27,109,0,0, -0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17, -48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,0,0, -1,0,31,1,1,1,0,28,109,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,59,120,121,122,0,0, -18,109,0,16,10,49,0,57,59,120,121,122,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0, -17,48,0,0,0,0,17,48,0,0,0,0,0,0,0,1,0,31,1,1,1,0,13,109,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109, -0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0, -17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,0,0,1,0,15,1,1,1,0,15,109,0,0,0,1,8,18, -109,0,0,0,1,0,15,1,1,1,0,30,109,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,0,18,109,0,16, -10,49,0,57,0,18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,0, -0,1,0,15,1,1,1,0,31,109,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109, -0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,18,109,0,16,10,51,0,57,0,17, -49,0,0,0,0,0,0,0,1,0,15,1,1,1,0,28,109,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,0,18,109, -0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0, -0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,0,0,1,0,15,1,1,1,0,29,109,0,0,0,1,8,58,109,97,116,52,0,18,109,0, -16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18, -109,0,16,10,50,0,57,0,17,49,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,51,0,57,0,17,48,0,0,0,0,17,49,0,0, -0,0,0,0,0,1,0,15,1,1,1,0,14,109,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0, -18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48, -0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,0,0,1,0,15,1,1,1,0,26,109,0,0,0,1,8,58,109,97,116,52,0,18, -109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0, -0,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,0,0,1,0, -15,1,1,1,0,27,109,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0, -18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,17,48, -0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,0,0,1,0,15,1,1,1,0,13,109,0,0,0, -1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57, -0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0, -0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,0,0,1,0,0,2,1,1,0,2,26,109,0,0,1,1,0,26,110,0,0,0,1, -9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57, -21,0,0,1,0,0,2,1,1,0,2,28,109,0,0,1,1,0,28,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0, -57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,0,1,0,0,2,1,1,0,2,27,109,0,0,1,1,0,27, -110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0, -16,10,49,0,57,21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,21,0,0,1,0,0,2,1,1,0,2,30,109,0, -0,1,1,0,30,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57, -18,110,0,16,10,49,0,57,21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,21,0,0,1,0,0,2,1,1,0,2, -29,109,0,0,1,1,0,29,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16, -10,49,0,57,18,110,0,16,10,49,0,57,21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,21,0,9,18, -109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,21,0,0,1,0,0,2,1,1,0,2,31,109,0,0,1,1,0,31,110,0,0,0,1, -9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57, -21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,21,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10, -51,0,57,21,0,0,1,0,0,2,2,1,0,2,26,109,0,0,1,1,0,26,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16, -8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,0,1,0,0,2,2,1,0,2,28,109,0,0,1, -1,0,28,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18, -110,0,16,10,49,0,57,22,0,0,1,0,0,2,2,1,0,2,27,109,0,0,1,1,0,27,110,0,0,0,1,9,18,109,0,16,8,48,0,57, -18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,9,18,109,0,16,10, -50,0,57,18,110,0,16,10,50,0,57,22,0,0,1,0,0,2,2,1,0,2,30,109,0,0,1,1,0,30,110,0,0,0,1,9,18,109,0, +0,18,109,0,16,10,50,0,57,59,120,121,0,0,18,109,0,16,10,51,0,57,59,120,121,0,0,0,20,0,0,1,0,29,1,1, +1,0,15,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0, +57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,18,109,0,16,10,50,0,57,59,120,121,0,0,18, +109,0,16,10,51,0,57,59,120,121,0,0,0,20,0,0,1,0,29,1,1,1,0,27,109,0,0,0,1,9,18,95,95,114,101,116, +86,97,108,0,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0, +0,17,48,0,0,0,0,0,20,0,0,1,0,29,1,1,1,0,14,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, +97,116,52,120,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,18, +109,0,16,10,50,0,57,59,120,121,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,29,1,1,1,0,30,109,0,0, +0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,59,120,121, +0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,18,109,0,16,10,50,0,57,59,120,121,0,0,17,48,0,0,0,0,17, +48,0,0,0,0,0,20,0,0,1,0,29,1,1,1,0,13,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116, +52,120,50,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0, +0,0,17,48,0,0,0,0,0,20,0,0,1,0,29,1,1,1,0,26,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, +97,116,52,120,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,17, +48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,29,1,1,1,0,28,109,0,0,0,1,9,18, +95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18, +109,0,16,10,49,0,57,59,120,121,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0, +0,1,0,31,1,1,1,0,31,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,0,31,1,1,1,0, +15,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57, +59,120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,18,109,0,16,10,50,0,57,59,120,121,122, +0,0,18,109,0,16,10,51,0,57,59,120,121,122,0,0,0,20,0,0,1,0,31,1,1,1,0,14,109,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0, +18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,31,1,1,1,0,30,109, +0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,59,120, +121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,18,109,0,16,10,50,0,57,59,120,121,122,0,0,17, +48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,31,1,1,1,0,29,109,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49, +0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,18,109,0,16,10,51,0,57,0,17,48,0,0,0,0, +0,20,0,0,1,0,31,1,1,1,0,26,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51, +0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48, +0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,31,1,1,1,0,27,109,0,0,0,1,9,18,95,95,114,101,116, +86,97,108,0,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57, +0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0, +20,0,0,1,0,31,1,1,1,0,28,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0, +18,109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,17,48,0,0,0,0, +17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,31,1,1,1,0,13, +109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,0, +17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17, +48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,0,15,1,1,1,0,15,109,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,18,109,0,20,0,0,1,0,15,1,1,1,0,30,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, +58,109,97,116,52,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,18,109,0,16,10,50,0,57,0,17,48, +0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,0,15,1,1,1,0,31,109,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,58,109,97,116,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10, +49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,18,109,0,16,10,51,0,57,0,17,49,0,0, +0,0,0,20,0,0,1,0,15,1,1,1,0,28,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0, +18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0, +0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,0,15,1,1,1,0,29,109,0,0,0, +1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,17, +48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0, +0,0,17,48,0,0,0,0,18,109,0,16,10,51,0,57,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,0,15,1,1,1,0,14, +109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,18,109,0,16,8,48,0,57,0,17,48,0, +0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0, +17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,0,15,1,1,1,0,26,109,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,58,109,97,116,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0, +57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0, +0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,0,15,1,1,1,0,27,109,0,0,0,1,9,18,95,95,114,101,116,86, +97,108,0,58,109,97,116,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,49, +0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0, +0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,0,15,1,1,1,0,13,109,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,58,109,97,116,52,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18, +109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48, +0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,0,0,2,1,1,0,2,26,109,0, +0,1,1,0,26,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57, +18,110,0,16,10,49,0,57,21,0,0,1,0,0,2,1,1,0,2,28,109,0,0,1,1,0,28,110,0,0,0,1,9,18,109,0,16,8,48,0, +57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,0,1,0,0,2,1,1,0, +2,27,109,0,0,1,1,0,27,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16, +10,49,0,57,18,110,0,16,10,49,0,57,21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,21,0,0,1,0, +0,2,1,1,0,2,30,109,0,0,1,1,0,30,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9, +18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57, +21,0,0,1,0,0,2,1,1,0,2,29,109,0,0,1,1,0,29,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0, +57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,9,18,109,0,16,10,50,0,57,18,110,0,16, +10,50,0,57,21,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,21,0,0,1,0,0,2,1,1,0,2,31,109,0,0, +1,1,0,31,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57, +18,110,0,16,10,49,0,57,21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,21,0,9,18,109,0,16,10, +51,0,57,18,110,0,16,10,51,0,57,21,0,0,1,0,0,2,2,1,0,2,26,109,0,0,1,1,0,26,110,0,0,0,1,9,18,109,0, +16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,0,1,0, +0,2,2,1,0,2,28,109,0,0,1,1,0,28,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9, +18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,0,1,0,0,2,2,1,0,2,27,109,0,0,1,1,0,27,110,0,0,0, +1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0, +57,22,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,22,0,0,1,0,0,2,2,1,0,2,30,109,0,0,1,1,0,30, +110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0, +16,10,49,0,57,22,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,22,0,0,1,0,0,2,2,1,0,2,29,109,0, +0,1,1,0,29,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57, +18,110,0,16,10,49,0,57,22,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,22,0,9,18,109,0,16,10, +51,0,57,18,110,0,16,10,51,0,57,22,0,0,1,0,0,2,2,1,0,2,31,109,0,0,1,1,0,31,110,0,0,0,1,9,18,109,0, 16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,9,18, -109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,22,0,0,1,0,0,2,2,1,0,2,29,109,0,0,1,1,0,29,110,0,0,0,1, -9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57, -22,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,22,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10, -51,0,57,22,0,0,1,0,0,2,2,1,0,2,31,109,0,0,1,1,0,31,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16, -8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,9,18,109,0,16,10,50,0,57,18, -110,0,16,10,50,0,57,22,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,22,0,0,1,0,0,2,4,1,0,2,26, -109,0,0,1,1,0,26,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,10, -49,0,57,18,110,0,16,10,49,0,57,24,0,0,1,0,0,2,4,1,0,2,28,109,0,0,1,1,0,28,110,0,0,0,1,9,18,109,0, -16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,0,1,0, -0,2,4,1,0,2,27,109,0,0,1,1,0,27,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9, -18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57, -24,0,0,1,0,0,2,4,1,0,2,30,109,0,0,1,1,0,30,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0, -57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0,16,10,50,0,57,18,110,0,16, -10,50,0,57,24,0,0,1,0,0,2,4,1,0,2,29,109,0,0,1,1,0,29,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0, -16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0,16,10,50,0,57,18, -110,0,16,10,50,0,57,24,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,24,0,0,1,0,0,2,4,1,0,2,31, -109,0,0,1,1,0,31,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,10, -49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,24,0,9,18,109, -0,16,10,51,0,57,18,110,0,16,10,51,0,57,24,0,0,1,0,11,2,21,1,1,0,26,109,0,0,1,1,0,10,118,0,0,0,1,8, -58,118,101,99,51,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0, -16,10,49,0,57,59,120,0,48,46,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,121,0,48,18,118,0,59,121, -0,18,109,0,16,10,49,0,57,59,121,0,48,46,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,122,0,48,18, -118,0,59,121,0,18,109,0,16,10,49,0,57,59,122,0,48,46,0,0,0,0,1,0,12,2,21,1,1,0,28,109,0,0,1,1,0,10, -118,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59, -121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,121,0,48, -18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57, -59,122,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,122,0,48,46,0,18,118,0,59,120,0,18,109,0, -16,8,48,0,57,59,119,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,119,0,48,46,0,0,0,0,1,0,10,2, -21,1,1,0,27,109,0,0,1,1,0,11,118,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,18,109,0,16,8,48,0, -57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,18,118,0,59,122,0,18,109,0, -16,10,50,0,57,59,120,0,48,46,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,121,0,48,18,118,0,59,121, -0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,121,0,48,46,0, -0,0,0,1,0,12,2,21,1,1,0,30,109,0,0,1,1,0,11,118,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,18, +109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,22,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,22, +0,0,1,0,0,2,4,1,0,2,26,109,0,0,1,1,0,26,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57, +24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,0,1,0,0,2,4,1,0,2,28,109,0,0,1,1,0,28, +110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0, +16,10,49,0,57,24,0,0,1,0,0,2,4,1,0,2,27,109,0,0,1,1,0,27,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18, +110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0,16,10,50,0, +57,18,110,0,16,10,50,0,57,24,0,0,1,0,0,2,4,1,0,2,30,109,0,0,1,1,0,30,110,0,0,0,1,9,18,109,0,16,8, +48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0, +16,10,50,0,57,18,110,0,16,10,50,0,57,24,0,0,1,0,0,2,4,1,0,2,29,109,0,0,1,1,0,29,110,0,0,0,1,9,18, +109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0, +9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,24,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0, +57,24,0,0,1,0,0,2,4,1,0,2,31,109,0,0,1,1,0,31,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48, +0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0,16,10,50,0,57,18,110,0, +16,10,50,0,57,24,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,24,0,0,1,0,11,2,21,1,1,0,26,109, +0,0,1,1,0,10,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,118,0,59,120,0,18,109,0,16, +8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,20,0,9,18,95,95,114, +101,116,86,97,108,0,59,121,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,121,0,48,18,118,0,59,121,0, +18,109,0,16,10,49,0,57,59,121,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,118,0,59, +120,0,18,109,0,16,8,48,0,57,59,122,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,122,0,48,46,20, +0,0,1,0,12,2,21,1,1,0,28,109,0,0,1,1,0,10,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0, +18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59, +120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,118,0,59,120,0,18,109,0,16,8,48,0, +57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,20,0,9,18,95,95,114,101,116, +86,97,108,0,59,122,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,122,0,48,18,118,0,59,121,0,18,109, +0,16,10,49,0,57,59,122,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18,118,0,59,120,0, +18,109,0,16,8,48,0,57,59,119,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,119,0,48,46,20,0,0,1, +0,10,2,21,1,1,0,27,109,0,0,1,1,0,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,118, +0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48, +46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0, +59,121,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0, +57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,121,0,48,46,20,0,0,1,0,12,2,21,1,1,0, +30,109,0,0,1,1,0,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,118,0,59,120,0,18, 109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,18,118,0,59, -122,0,18,109,0,16,10,50,0,57,59,120,0,48,46,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,121,0,48, -18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57, -59,121,0,48,46,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,122,0,48,18,118,0,59,121,0,18,109,0,16, -10,49,0,57,59,122,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,122,0,48,46,0,18,118,0,59, -120,0,18,109,0,16,8,48,0,57,59,119,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,119,0,48,46,18, -118,0,59,122,0,18,109,0,16,10,50,0,57,59,119,0,48,46,0,0,0,0,1,0,10,2,21,1,1,0,29,109,0,0,1,1,0,12, -118,0,0,0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59, -121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,120,0,48, -46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,120,0,48,46,0,18,118,0,59,120,0,18,109,0,16,8,48,0, -57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0, -16,10,50,0,57,59,121,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,121,0,48,46,0,0,0,0,1,0, -11,2,21,1,1,0,31,109,0,0,1,1,0,12,118,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,109,0,16,8, -48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,18,118,0,59,122,0,18, -109,0,16,10,50,0,57,59,120,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,120,0,48,46,0,18, +122,0,18,109,0,16,10,50,0,57,59,120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18, 118,0,59,120,0,18,109,0,16,8,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0, -48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,121,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51, -0,57,59,121,0,48,46,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,122,0,48,18,118,0,59,121,0,18,109, -0,16,10,49,0,57,59,122,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,122,0,48,46,18,118,0,59, -119,0,18,109,0,16,10,51,0,57,59,122,0,48,46,0,0,0,0,1,0,27,2,21,1,1,0,13,109,0,0,1,1,0,27,110,0,0, -0,1,8,58,109,97,116,51,120,50,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0, -57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,29,2,21,1,1,0,13,109,0,0,1,1,0,29,110,0,0,0, -1,8,58,109,97,116,52,120,50,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57, -48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,18,109,0,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,26,2,21,1, -1,0,26,109,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,18,110,0,16,8,48,0,57,48, -0,18,109,0,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,14,2,21,1,1,0,26,109,0,0,1,1,0,27,110,0,0,0,1,8, -58,109,97,116,51,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,18,109, -0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,31,2,21,1,1,0,26,109,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97, +48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,121,0,48,46,20,0,9,18,95,95,114,101,116,86,97, +108,0,59,122,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,122,0,48,18,118,0,59,121,0,18,109,0,16, +10,49,0,57,59,122,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,122,0,48,46,20,0,9,18,95,95, +114,101,116,86,97,108,0,59,119,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,119,0,48,18,118,0,59, +121,0,18,109,0,16,10,49,0,57,59,119,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,119,0,48, +46,20,0,0,1,0,10,2,21,1,1,0,29,109,0,0,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59, +120,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57, +59,120,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,120,0,48,46,18,118,0,59,119,0,18,109,0, +16,10,51,0,57,59,120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,118,0,59,120,0,18, +109,0,16,8,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,59, +122,0,18,109,0,16,10,50,0,57,59,121,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,121,0,48, +46,20,0,0,1,0,11,2,21,1,1,0,31,109,0,0,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59, +120,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57, +59,120,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,120,0,48,46,18,118,0,59,119,0,18,109,0, +16,10,51,0,57,59,120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,118,0,59,120,0,18, +109,0,16,8,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,59, +122,0,18,109,0,16,10,50,0,57,59,121,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,121,0,48, +46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,122, +0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,122,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0, +57,59,122,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,122,0,48,46,20,0,0,1,0,27,2,21,1,1,0, +13,109,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18, +109,0,18,110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,29,2,21,1,1,0,13, +109,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18, +109,0,18,110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,18,109,0,18,110,0,16,10,51, +0,57,48,0,0,0,0,1,0,26,2,21,1,1,0,26,109,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18, +109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,14,2,21,1,1,0,26, +109,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97,116,51,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18, +110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,31,2,21,1,1,0,26,109,0,0,1, +1,0,29,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110, +0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,18,109,0,18,110,0,16,10,51,0,57,48,0,0,0, +0,1,0,28,2,21,1,1,0,28,109,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,18,110,0, +16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,30,2,21,1,1,0,28,109,0,0,1,1,0,27, +110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16, +10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,15,2,21,1,1,0,28,109,0,0,1,1,0,29, +110,0,0,0,1,8,58,109,97,116,52,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0, +57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,18,109,0,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,13,2, +21,1,1,0,27,109,0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,0,18,109,0,18,110,0,16,8,48,0,57,48,0, +18,109,0,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,27,2,21,1,1,0,27,109,0,0,1,1,0,14,110,0,0,0,1,8,58, +109,97,116,51,120,50,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,18, +109,0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,29,2,21,1,1,0,27,109,0,0,1,1,0,31,110,0,0,0,1,8,58,109, +97,116,52,120,50,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,18,109, +0,18,110,0,16,10,50,0,57,48,0,18,109,0,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,26,2,21,1,1,0,14,109, +0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0, +18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,31,2,21,1,1,0,14,109,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97, 116,52,120,51,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,18,109,0, -18,110,0,16,10,50,0,57,48,0,18,109,0,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,28,2,21,1,1,0,28,109,0, -0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18, -110,0,16,10,49,0,57,48,0,0,0,0,1,0,30,2,21,1,1,0,28,109,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97,116, +18,110,0,16,10,50,0,57,48,0,18,109,0,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,28,2,21,1,1,0,30,109,0, +0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18, +110,0,16,10,49,0,57,48,0,0,0,0,1,0,30,2,21,1,1,0,30,109,0,0,1,1,0,14,110,0,0,0,1,8,58,109,97,116, 51,120,52,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,18,109,0,18, -110,0,16,10,50,0,57,48,0,0,0,0,1,0,15,2,21,1,1,0,28,109,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97,116, +110,0,16,10,50,0,57,48,0,0,0,0,1,0,15,2,21,1,1,0,30,109,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116, 52,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16, -10,50,0,57,48,0,18,109,0,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,13,2,21,1,1,0,27,109,0,0,1,1,0,26, +10,50,0,57,48,0,18,109,0,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,13,2,21,1,1,0,29,109,0,0,1,1,0,28, 110,0,0,0,1,8,58,109,97,116,50,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0, -57,48,0,0,0,0,1,0,27,2,21,1,1,0,27,109,0,0,1,1,0,14,110,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109, +57,48,0,0,0,0,1,0,27,2,21,1,1,0,29,109,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109, 0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57, -48,0,0,0,0,1,0,29,2,21,1,1,0,27,109,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0, +48,0,0,0,0,1,0,29,2,21,1,1,0,29,109,0,0,1,1,0,15,110,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0, 18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48, -0,18,109,0,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,26,2,21,1,1,0,14,109,0,0,1,1,0,26,110,0,0,0,1,8, +0,18,109,0,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,26,2,21,1,1,0,31,109,0,0,1,1,0,28,110,0,0,0,1,8, 58,109,97,116,50,120,51,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0, -0,0,0,1,0,31,2,21,1,1,0,14,109,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,18, -110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0, -18,109,0,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,28,2,21,1,1,0,30,109,0,0,1,1,0,26,110,0,0,0,1,8,58, -109,97,116,50,120,52,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,0, -0,0,1,0,30,2,21,1,1,0,30,109,0,0,1,1,0,14,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,18,110, -0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,0,0, -0,1,0,15,2,21,1,1,0,30,109,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,0,18,109,0,18,110,0,16,8,48, -0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,18,109,0,18, -110,0,16,10,51,0,57,48,0,0,0,0,1,0,13,2,21,1,1,0,29,109,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116, -50,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,27,2,21,1, -1,0,29,109,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,18,110,0,16,8,48,0,57,48, -0,18,109,0,18,110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,29,2,21,1,1, -0,29,109,0,0,1,1,0,15,110,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,18,110,0,16,8,48,0,57,48,0, -18,109,0,18,110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,18,109,0,18,110,0,16,10, -51,0,57,48,0,0,0,0,1,0,26,2,21,1,1,0,31,109,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116,50,120,51,0, -18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,14,2,21,1,1,0, -31,109,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0, -18,110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,31,2,21,1,1,0,31,109,0, -0,1,1,0,15,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18, -110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,18,109,0,18,110,0,16,10,51,0,57,48,0, -0,0,0,1,0,28,2,21,1,1,0,15,109,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,18, -110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,30,2,21,1,1,0,15,109,0,0,1, -1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110, -0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,0,2,3,1,0,2,26,109,0,0,1,1,0, -13,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,3,1,0,2,28,109,0,0,1,1,0,13,110,0,0, -0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,3,1,0,2,27,109,0,0,1,1,0,14,110,0,0,0,1,9,18, -109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,3,1,0,2,30,109,0,0,1,1,0,14,110,0,0,0,1,9,18,109,0,18, -109,0,18,110,0,48,20,0,0,1,0,0,2,3,1,0,2,29,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,18,109,0,18, -110,0,48,20,0,0,1,0,0,2,3,1,0,2,31,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20, -0,0,1,0,11,2,21,1,1,0,10,118,0,0,1,1,0,27,109,0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18, -109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,8,48,0,57,59,121,0,48,46,0,18,118,0, -59,120,0,18,109,0,16,10,49,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48, -46,0,18,118,0,59,120,0,18,109,0,16,10,50,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,50,0,57, -59,121,0,48,46,0,0,0,0,1,0,12,2,21,1,1,0,10,118,0,0,1,1,0,29,109,0,0,0,1,8,58,118,101,99,52,0,18, -118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,8,48,0,57,59,121,0, -48,46,0,18,118,0,59,120,0,18,109,0,16,10,49,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0, -57,59,121,0,48,46,0,18,118,0,59,120,0,18,109,0,16,10,50,0,57,59,120,0,48,18,118,0,59,121,0,18,109, -0,16,10,50,0,57,59,121,0,48,46,0,18,118,0,59,120,0,18,109,0,16,10,51,0,57,59,120,0,48,18,118,0,59, -121,0,18,109,0,16,10,51,0,57,59,121,0,48,46,0,0,0,0,1,0,10,2,21,1,1,0,11,118,0,0,1,1,0,26,109,0,0, -0,1,8,58,118,101,99,50,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18, -109,0,16,8,48,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,8,48,0,57,59,122,0,48,46,0,18,118, -0,59,120,0,18,109,0,16,10,49,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48, -46,18,118,0,59,122,0,18,109,0,16,10,49,0,57,59,122,0,48,46,0,0,0,0,1,0,12,2,21,1,1,0,11,118,0,0,1, -1,0,31,109,0,0,0,1,8,58,118,101,99,52,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118, -0,59,121,0,18,109,0,16,8,48,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,8,48,0,57,59,122,0, -48,46,0,18,118,0,59,120,0,18,109,0,16,10,49,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0, -57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,49,0,57,59,122,0,48,46,0,18,118,0,59,120,0,18, -109,0,16,10,50,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,50,0,57,59,121,0,48,46,18,118,0, -59,122,0,18,109,0,16,10,50,0,57,59,122,0,48,46,0,18,118,0,59,120,0,18,109,0,16,10,51,0,57,59,120,0, -48,18,118,0,59,121,0,18,109,0,16,10,51,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,51,0, -57,59,122,0,48,46,0,0,0,0,1,0,10,2,21,1,1,0,12,118,0,0,1,1,0,28,109,0,0,0,1,8,58,118,101,99,50,0, -18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,8,48,0,57,59,121, -0,48,46,18,118,0,59,122,0,18,109,0,16,8,48,0,57,59,122,0,48,46,18,118,0,59,119,0,18,109,0,16,8,48, -0,57,59,119,0,48,46,0,18,118,0,59,120,0,18,109,0,16,10,49,0,57,59,120,0,48,18,118,0,59,121,0,18, -109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,49,0,57,59,122,0,48,46,18,118, -0,59,119,0,18,109,0,16,10,49,0,57,59,119,0,48,46,0,0,0,0,1,0,11,2,21,1,1,0,12,118,0,0,1,1,0,30,109, -0,0,0,1,8,58,118,101,99,51,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0, -18,109,0,16,8,48,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,8,48,0,57,59,122,0,48,46,18,118, -0,59,119,0,18,109,0,16,8,48,0,57,59,119,0,48,46,0,18,118,0,59,120,0,18,109,0,16,10,49,0,57,59,120, -0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,49,0, -57,59,122,0,48,46,18,118,0,59,119,0,18,109,0,16,10,49,0,57,59,119,0,48,46,0,18,118,0,59,120,0,18, -109,0,16,10,50,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,50,0,57,59,121,0,48,46,18,118,0, -59,122,0,18,109,0,16,10,50,0,57,59,122,0,48,46,18,118,0,59,119,0,18,109,0,16,10,50,0,57,59,119,0, -48,46,0,0,0,0,1,0,0,2,1,1,0,2,26,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9, -18,109,0,16,10,49,0,57,18,97,0,21,0,0,1,0,0,2,1,1,0,2,28,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16, -8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,0,1,0,0,2,1,1,0,2,27,109,0,0,1,1,0,9, -97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,9,18,109,0, -16,10,50,0,57,18,97,0,21,0,0,1,0,0,2,1,1,0,2,30,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57, -18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,0,1,0,0,2, -1,1,0,2,29,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0, -57,18,97,0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,9,18,109,0,16,10,51,0,57,18,97,0,21,0,0,1,0, -0,2,1,1,0,2,31,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49, -0,57,18,97,0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,9,18,109,0,16,10,51,0,57,18,97,0,21,0,0,1, -0,0,2,2,1,0,2,26,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10, -49,0,57,18,97,0,22,0,0,1,0,0,2,2,1,0,2,28,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97, -0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,0,1,0,0,2,2,1,0,2,27,109,0,0,1,1,0,9,97,0,0,0,1,9,18, +0,0,0,1,0,14,2,21,1,1,0,31,109,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,0,18,109,0,18,110,0,16, +8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0, +31,2,21,1,1,0,31,109,0,0,1,1,0,15,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,18,110,0,16,8, +48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,18,109,0,18, +110,0,16,10,51,0,57,48,0,0,0,0,1,0,28,2,21,1,1,0,15,109,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116, +50,120,52,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,30, +2,21,1,1,0,15,109,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,18,110,0,16,8,48,0, +57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,0,2,3, +1,0,2,26,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,3,1,0,2,28, +109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,3,1,0,2,27,109,0,0,1,1, +0,14,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,3,1,0,2,30,109,0,0,1,1,0,14,110,0, +0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,3,1,0,2,29,109,0,0,1,1,0,15,110,0,0,0,1,9,18, +109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,3,1,0,2,31,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,18, +109,0,18,110,0,48,20,0,0,1,0,11,2,21,1,1,0,10,118,0,0,1,1,0,27,109,0,0,0,1,9,18,95,95,114,101,116, +86,97,108,0,59,120,0,58,100,111,116,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101, +116,86,97,108,0,59,121,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,0, +12,2,21,1,1,0,10,118,0,0,1,1,0,29,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100, +111,116,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58, +100,111,116,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122, +0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,50,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0, +59,119,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,51,0,57,0,0,20,0,0,1,0,10,2,21,1,1,0,11,118,0, +0,1,1,0,26,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,18,118,0,0,18, +109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,18,118,0, +0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,0,12,2,21,1,1,0,11,118,0,0,1,1,0,31,109,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18, +95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0, +9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,50,0,57,0,0, +20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,51,0, +57,0,0,20,0,0,1,0,10,2,21,1,1,0,12,118,0,0,1,1,0,28,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, +59,120,0,58,100,111,116,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97, +108,0,59,121,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,0,11,2,21,1,1,0,12, +118,0,0,1,1,0,30,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,18,118,0, +0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,18, +118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116, +0,18,118,0,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,0,0,2,1,1,0,2,26,109,0,0,1,1,0,9,97,0,0,0,1,9,18, +109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,0,1,0,0,2,1,1,0,2,28,109,0,0, +1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,0,1, +0,0,2,1,1,0,2,27,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10, +49,0,57,18,97,0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,0,1,0,0,2,1,1,0,2,30,109,0,0,1,1,0,9,97, +0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,9,18,109,0,16, +10,50,0,57,18,97,0,21,0,0,1,0,0,2,1,1,0,2,29,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18, +97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,9,18,109,0, +16,10,51,0,57,18,97,0,21,0,0,1,0,0,2,1,1,0,2,31,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57, +18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,9,18,109, +0,16,10,51,0,57,18,97,0,21,0,0,1,0,0,2,2,1,0,2,26,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0, +57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,0,1,0,0,2,2,1,0,2,28,109,0,0,1,1,0,9,97,0,0, +0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,0,1,0,0,2,2,1,0,2, +27,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97, +0,22,0,9,18,109,0,16,10,50,0,57,18,97,0,22,0,0,1,0,0,2,2,1,0,2,30,109,0,0,1,1,0,9,97,0,0,0,1,9,18, 109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,9,18,109,0,16,10,50,0,57,18, -97,0,22,0,0,1,0,0,2,2,1,0,2,30,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9, -18,109,0,16,10,49,0,57,18,97,0,22,0,9,18,109,0,16,10,50,0,57,18,97,0,22,0,0,1,0,0,2,2,1,0,2,29,109, -0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0, -9,18,109,0,16,10,50,0,57,18,97,0,22,0,9,18,109,0,16,10,51,0,57,18,97,0,22,0,0,1,0,0,2,2,1,0,2,31, -109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0, -22,0,9,18,109,0,16,10,50,0,57,18,97,0,22,0,9,18,109,0,16,10,51,0,57,18,97,0,22,0,0,1,0,0,2,3,1,0,2, -26,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97, -0,23,0,0,1,0,0,2,3,1,0,2,28,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18, -109,0,16,10,49,0,57,18,97,0,23,0,0,1,0,0,2,3,1,0,2,27,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8, -48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109,0,16,10,50,0,57,18,97,0,23,0,0, -1,0,0,2,3,1,0,2,30,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16, -10,49,0,57,18,97,0,23,0,9,18,109,0,16,10,50,0,57,18,97,0,23,0,0,1,0,0,2,3,1,0,2,29,109,0,0,1,1,0,9, -97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109,0, -16,10,50,0,57,18,97,0,23,0,9,18,109,0,16,10,51,0,57,18,97,0,23,0,0,1,0,0,2,3,1,0,2,31,109,0,0,1,1, -0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109, -0,16,10,50,0,57,18,97,0,23,0,9,18,109,0,16,10,51,0,57,18,97,0,23,0,0,1,0,0,2,4,1,0,2,26,109,0,0,1, -1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,0,1,0, -0,2,4,1,0,2,28,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49, -0,57,18,97,0,24,0,0,1,0,0,2,4,1,0,2,27,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0, -24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,0,57,18,97,0,24,0,0,1,0,0,2,4,1,0,2, -30,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97, -0,24,0,9,18,109,0,16,10,50,0,57,18,97,0,24,0,0,1,0,0,2,4,1,0,2,29,109,0,0,1,1,0,9,97,0,0,0,1,9,18, +97,0,22,0,0,1,0,0,2,2,1,0,2,29,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9, +18,109,0,16,10,49,0,57,18,97,0,22,0,9,18,109,0,16,10,50,0,57,18,97,0,22,0,9,18,109,0,16,10,51,0,57, +18,97,0,22,0,0,1,0,0,2,2,1,0,2,31,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0, +9,18,109,0,16,10,49,0,57,18,97,0,22,0,9,18,109,0,16,10,50,0,57,18,97,0,22,0,9,18,109,0,16,10,51,0, +57,18,97,0,22,0,0,1,0,0,2,3,1,0,2,26,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23, +0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,0,1,0,0,2,3,1,0,2,28,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0, +16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,0,1,0,0,2,3,1,0,2,27,109,0,0,1,1,0, +9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109,0, +16,10,50,0,57,18,97,0,23,0,0,1,0,0,2,3,1,0,2,30,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57, +18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109,0,16,10,50,0,57,18,97,0,23,0,0,1,0,0,2, +3,1,0,2,29,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0, +57,18,97,0,23,0,9,18,109,0,16,10,50,0,57,18,97,0,23,0,9,18,109,0,16,10,51,0,57,18,97,0,23,0,0,1,0, +0,2,3,1,0,2,31,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49, +0,57,18,97,0,23,0,9,18,109,0,16,10,50,0,57,18,97,0,23,0,9,18,109,0,16,10,51,0,57,18,97,0,23,0,0,1, +0,0,2,4,1,0,2,26,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10, +49,0,57,18,97,0,24,0,0,1,0,0,2,4,1,0,2,28,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97, +0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,0,1,0,0,2,4,1,0,2,27,109,0,0,1,1,0,9,97,0,0,0,1,9,18, 109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,0,57,18, -97,0,24,0,9,18,109,0,16,10,51,0,57,18,97,0,24,0,0,1,0,0,2,4,1,0,2,31,109,0,0,1,1,0,9,97,0,0,0,1,9, -18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,0,57, -18,97,0,24,0,9,18,109,0,16,10,51,0,57,18,97,0,24,0,0,1,0,26,2,26,1,1,0,26,109,0,0,1,1,0,26,110,0,0, -0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49, -0,57,18,110,0,16,10,49,0,57,46,0,0,0,0,1,0,28,2,26,1,1,0,28,109,0,0,1,1,0,28,110,0,0,0,1,8,58,109, -97,116,50,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110, -0,16,10,49,0,57,46,0,0,0,0,1,0,27,2,26,1,1,0,27,109,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97,116,51, -120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49, -0,57,46,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0,0,0,0,1,0,30,2,26,1,1,0,30,109,0,0,1, -1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18, -109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0, -0,0,0,1,0,29,2,26,1,1,0,29,109,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8, -48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,18,109,0,16, -10,50,0,57,18,110,0,16,10,50,0,57,46,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,46,0,0,0,0,1, -0,31,2,26,1,1,0,31,109,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57, +97,0,24,0,0,1,0,0,2,4,1,0,2,30,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9, +18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,0,57,18,97,0,24,0,0,1,0,0,2,4,1,0,2,29,109, +0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0, +9,18,109,0,16,10,50,0,57,18,97,0,24,0,9,18,109,0,16,10,51,0,57,18,97,0,24,0,0,1,0,0,2,4,1,0,2,31, +109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0, +24,0,9,18,109,0,16,10,50,0,57,18,97,0,24,0,9,18,109,0,16,10,51,0,57,18,97,0,24,0,0,1,0,26,2,26,1,1, +0,26,109,0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8, +48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,0,0,0,1,0,28,2,26,1,1,0,28,109,0,0, +1,1,0,28,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0, +18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,0,0,0,1,0,27,2,26,1,1,0,27,109,0,0,1,1,0,27,110, +0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16, +10,49,0,57,18,110,0,16,10,49,0,57,46,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0,0,0,0,1, +0,30,2,26,1,1,0,30,109,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57, 18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,18,109,0,16,10,50,0, -57,18,110,0,16,10,50,0,57,46,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,46,0,0,0,0,1,0,26,2, -27,1,1,0,26,109,0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,110, -0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,0,0,0,1,0,28,2,27,1,1,0,28, -109,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0, -57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,0,0,0,1,0,27,2,27,1,1,0,27,109,0,0,1,1, -0,27,110,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18, -109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,0, -0,0,0,1,0,30,2,27,1,1,0,30,109,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8, -48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,18,109,0,16, -10,50,0,57,18,110,0,16,10,50,0,57,47,0,0,0,0,1,0,29,2,27,1,1,0,29,109,0,0,1,1,0,29,110,0,0,0,1,8, -58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57, -18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,0,18,109,0,16,10,51,0, -57,18,110,0,16,10,51,0,57,47,0,0,0,0,1,0,31,2,27,1,1,0,31,109,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97, -116,52,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0, -16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,0,18,109,0,16,10,51,0,57,18, -110,0,16,10,51,0,57,47,0,0,0,0,1,0,26,2,22,1,1,0,26,109,0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116, -50,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10, -49,0,57,49,0,0,0,0,1,0,28,2,22,1,1,0,28,109,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116,50,120,52,0, +57,18,110,0,16,10,50,0,57,46,0,0,0,0,1,0,29,2,26,1,1,0,29,109,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97, +116,52,120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0, +16,10,49,0,57,46,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0,18,109,0,16,10,51,0,57,18, +110,0,16,10,51,0,57,46,0,0,0,0,1,0,31,2,26,1,1,0,31,109,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116, +52,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10, +49,0,57,46,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0,18,109,0,16,10,51,0,57,18,110,0,16, +10,51,0,57,46,0,0,0,0,1,0,26,2,27,1,1,0,26,109,0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,51, +0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57, +47,0,0,0,0,1,0,28,2,27,1,1,0,28,109,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0, +16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,0,0,0,1, +0,27,2,27,1,1,0,27,109,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57, +18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0, +57,18,110,0,16,10,50,0,57,47,0,0,0,0,1,0,30,2,27,1,1,0,30,109,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97, +116,51,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0, +16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,0,0,0,0,1,0,29,2,27,1,1,0,29, +109,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0, +57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16,10, +50,0,57,47,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,47,0,0,0,0,1,0,31,2,27,1,1,0,31,109,0,0, +1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0, +18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57, +47,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,47,0,0,0,0,1,0,26,2,22,1,1,0,26,109,0,0,1,1,0, +26,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109, +0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,0,0,0,1,0,28,2,22,1,1,0,28,109,0,0,1,1,0,28,110,0,0,0, +1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0, +57,18,110,0,16,10,49,0,57,49,0,0,0,0,1,0,27,2,22,1,1,0,27,109,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97, +116,51,120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0, +16,10,49,0,57,49,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,0,0,0,1,0,30,2,22,1,1,0,30, +109,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0, +57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,18,109,0,16,10,50,0,57,18,110,0,16,10, +50,0,57,49,0,0,0,0,1,0,29,2,22,1,1,0,29,109,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97,116,52,120,50,0, 18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49, -0,0,0,0,1,0,27,2,22,1,1,0,27,109,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16, -8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,18,109,0, -16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,0,0,0,1,0,30,2,22,1,1,0,30,109,0,0,1,1,0,30,110,0,0,0,1, -8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0, -57,18,110,0,16,10,49,0,57,49,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,0,0,0,1,0,29,2, -22,1,1,0,29,109,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,18,110, -0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,18,109,0,16,10,50,0,57,18, -110,0,16,10,50,0,57,49,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,49,0,0,0,0,1,0,31,2,22,1,1, -0,31,109,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8, -48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,18,109,0,16,10,50,0,57,18,110,0,16, -10,50,0,57,49,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,49,0,0,0,0,1,0,26,2,26,1,1,0,9,97,0, -0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18, -110,0,16,10,49,0,57,46,0,0,0,0,1,0,26,2,26,1,1,0,26,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50, -120,51,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,0,0,0,1,0,28,2,26, -1,1,0,9,97,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,97,0,18,110,0,16,8,48,0,57,46,0, -18,97,0,18,110,0,16,10,49,0,57,46,0,0,0,0,1,0,28,2,26,1,1,0,28,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109, -97,116,50,120,52,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,0,0,0,1, -0,27,2,26,1,1,0,9,97,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97,116,51,120,50,0,18,97,0,18,110,0,16,8,48, -0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,0,0,0,1,0,27,2, -26,1,1,0,27,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,18,98,0, -46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0,46,0,0,0,0,1,0,30,2,26,1,1, -0,9,97,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18, -97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,0,0,0,1,0,30,2,26,1,1,0,30, -109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0, -16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0,46,0,0,0,0,1,0,29,2,26,1,1,0,29,109,0,0, -1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10, -49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0,46,0,18,109,0,16,10,51,0,57,18,98,0,46,0,0,0,0, -1,0,29,2,26,1,1,0,9,97,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97,116,52,120,50,0,18,97,0,18,110,0,16,8, -48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,18,97,0,18, -110,0,16,10,51,0,57,46,0,0,0,0,1,0,31,2,26,1,1,0,31,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52, -120,51,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50, -0,57,18,98,0,46,0,18,109,0,16,10,51,0,57,18,98,0,46,0,0,0,0,1,0,31,2,26,1,1,0,9,97,0,0,1,1,0,31, -110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10, -49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,18,97,0,18,110,0,16,10,51,0,57,46,0,0,0,0,1,0,26, -2,27,1,1,0,9,97,0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18,97,0,18,110,0,16,8,48,0,57, -47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,0,0,0,1,0,26,2,27,1,1,0,26,109,0,0,1,1,0,9,98,0,0,0,1,8, -58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,0, -0,0,1,0,28,2,27,1,1,0,9,97,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,97,0,18,110,0, -16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,0,0,0,1,0,28,2,27,1,1,0,28,109,0,0,1,1,0,9, -98,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57, -18,98,0,47,0,0,0,0,1,0,27,2,27,1,1,0,9,97,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97,116,51,120,50,0,18, -97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0,57, -47,0,0,0,0,1,0,27,2,27,1,1,0,27,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16, -8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,0,0, -0,1,0,30,2,27,1,1,0,9,97,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,97,0,18,110,0,16, -8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0,57,47,0,0,0,0,1,0, -30,2,27,1,1,0,30,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,18, -98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,0,0,0,1,0,29,2, -27,1,1,0,29,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,18,98,0, -47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,18,109,0,16,10,51,0, -57,18,98,0,47,0,0,0,0,1,0,29,2,27,1,1,0,9,97,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97,116,52,120,50,0, -18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0, -57,47,0,18,97,0,18,110,0,16,10,51,0,57,47,0,0,0,0,1,0,31,2,27,1,1,0,31,109,0,0,1,1,0,9,98,0,0,0,1, -8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0, -18,109,0,16,10,50,0,57,18,98,0,47,0,18,109,0,16,10,51,0,57,18,98,0,47,0,0,0,0,1,0,31,2,27,1,1,0,9, -97,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0, -18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0,57,47,0,18,97,0,18,110,0,16,10,51,0,57,47, -0,0,0,0,1,0,26,2,21,1,1,0,9,97,0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18,97,0,18,110, -0,16,8,48,0,57,48,0,18,97,0,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,26,2,21,1,1,0,26,109,0,0,1,1,0,9, -98,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,98,0,48,0,18,109,0,16,10,49,0,57, -18,98,0,48,0,0,0,0,1,0,28,2,21,1,1,0,9,97,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18, -97,0,18,110,0,16,8,48,0,57,48,0,18,97,0,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,28,2,21,1,1,0,28,109, -0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,18,98,0,48,0,18,109,0,16, -10,49,0,57,18,98,0,48,0,0,0,0,1,0,27,2,21,1,1,0,9,97,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97,116,51, -120,50,0,18,97,0,18,110,0,16,8,48,0,57,48,0,18,97,0,18,110,0,16,10,49,0,57,48,0,18,97,0,18,110,0, -16,10,50,0,57,48,0,0,0,0,1,0,27,2,21,1,1,0,27,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,120,50, +0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57, +49,0,0,0,0,1,0,31,2,22,1,1,0,31,109,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0, +16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,18,109, +0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,49,0,0,0, +0,1,0,26,2,26,1,1,0,9,97,0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18,97,0,18,110,0,16, +8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,0,0,0,1,0,26,2,26,1,1,0,26,109,0,0,1,1,0,9,98,0, +0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98, +0,46,0,0,0,0,1,0,28,2,26,1,1,0,9,97,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,97,0, +18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,0,0,0,1,0,28,2,26,1,1,0,28,109,0,0, +1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10, +49,0,57,18,98,0,46,0,0,0,0,1,0,27,2,26,1,1,0,9,97,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97,116,51,120, +50,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10, +50,0,57,46,0,0,0,0,1,0,27,2,26,1,1,0,27,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,120,50,0,18, +109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0, +46,0,0,0,0,1,0,30,2,26,1,1,0,9,97,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,97,0,18, +110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,0, +0,0,1,0,30,2,26,1,1,0,30,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0, +57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0,46,0,0,0,0,1,0, +29,2,26,1,1,0,29,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,18, +98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0,46,0,18,109,0,16,10, +51,0,57,18,98,0,46,0,0,0,0,1,0,29,2,26,1,1,0,9,97,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97,116,52,120, +50,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10, +50,0,57,46,0,18,97,0,18,110,0,16,10,51,0,57,46,0,0,0,0,1,0,31,2,26,1,1,0,31,109,0,0,1,1,0,9,98,0,0, +0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0, +46,0,18,109,0,16,10,50,0,57,18,98,0,46,0,18,109,0,16,10,51,0,57,18,98,0,46,0,0,0,0,1,0,31,2,26,1,1, +0,9,97,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18, +97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,18,97,0,18,110,0,16,10,51,0, +57,46,0,0,0,0,1,0,26,2,27,1,1,0,9,97,0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18,97,0, +18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,0,0,0,1,0,26,2,27,1,1,0,26,109,0,0, +1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10, +49,0,57,18,98,0,47,0,0,0,0,1,0,28,2,27,1,1,0,9,97,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116,50,120, +52,0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,0,0,0,1,0,28,2,27,1,1, +0,28,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18, +109,0,16,10,49,0,57,18,98,0,47,0,0,0,0,1,0,27,2,27,1,1,0,9,97,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97, +116,51,120,50,0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18, +110,0,16,10,50,0,57,47,0,0,0,0,1,0,27,2,27,1,1,0,27,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51, +120,50,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,18,109,0,16,10,50, +0,57,18,98,0,47,0,0,0,0,1,0,30,2,27,1,1,0,9,97,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,52, +0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50, +0,57,47,0,0,0,0,1,0,30,2,27,1,1,0,30,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109, +0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47, +0,0,0,0,1,0,29,2,27,1,1,0,29,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8, +48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,18, +109,0,16,10,51,0,57,18,98,0,47,0,0,0,0,1,0,29,2,27,1,1,0,9,97,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97, +116,52,120,50,0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18, +110,0,16,10,50,0,57,47,0,18,97,0,18,110,0,16,10,51,0,57,47,0,0,0,0,1,0,31,2,27,1,1,0,31,109,0,0,1, +1,0,9,98,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49, +0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,18,109,0,16,10,51,0,57,18,98,0,47,0,0,0,0,1, +0,31,2,27,1,1,0,9,97,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,97,0,18,110,0,16,8,48, +0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0,57,47,0,18,97,0,18,110,0, +16,10,51,0,57,47,0,0,0,0,1,0,26,2,21,1,1,0,9,97,0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,51, +0,18,97,0,18,110,0,16,8,48,0,57,48,0,18,97,0,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,26,2,21,1,1,0, +26,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,98,0,48,0,18, +109,0,16,10,49,0,57,18,98,0,48,0,0,0,0,1,0,28,2,21,1,1,0,9,97,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97, +116,50,120,52,0,18,97,0,18,110,0,16,8,48,0,57,48,0,18,97,0,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0, +28,2,21,1,1,0,28,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,18, +98,0,48,0,18,109,0,16,10,49,0,57,18,98,0,48,0,0,0,0,1,0,27,2,21,1,1,0,9,97,0,0,1,1,0,27,110,0,0,0, +1,8,58,109,97,116,51,120,50,0,18,97,0,18,110,0,16,8,48,0,57,48,0,18,97,0,18,110,0,16,10,49,0,57,48, +0,18,97,0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,27,2,21,1,1,0,27,109,0,0,1,1,0,9,98,0,0,0,1,8,58, +109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,18,98,0,48,0,18,109,0,16,10,49,0,57,18,98,0,48,0,18, +109,0,16,10,50,0,57,18,98,0,48,0,0,0,0,1,0,30,2,21,1,1,0,9,97,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97, +116,51,120,52,0,18,97,0,18,110,0,16,8,48,0,57,48,0,18,97,0,18,110,0,16,10,49,0,57,48,0,18,97,0,18, +110,0,16,10,50,0,57,48,0,0,0,0,1,0,30,2,21,1,1,0,30,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51, +120,52,0,18,109,0,16,8,48,0,57,18,98,0,48,0,18,109,0,16,10,49,0,57,18,98,0,48,0,18,109,0,16,10,50, +0,57,18,98,0,48,0,0,0,0,1,0,29,2,21,1,1,0,29,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,120,50, 0,18,109,0,16,8,48,0,57,18,98,0,48,0,18,109,0,16,10,49,0,57,18,98,0,48,0,18,109,0,16,10,50,0,57,18, -98,0,48,0,0,0,0,1,0,30,2,21,1,1,0,9,97,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,97, -0,18,110,0,16,8,48,0,57,48,0,18,97,0,18,110,0,16,10,49,0,57,48,0,18,97,0,18,110,0,16,10,50,0,57,48, -0,0,0,0,1,0,30,2,21,1,1,0,30,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8, -48,0,57,18,98,0,48,0,18,109,0,16,10,49,0,57,18,98,0,48,0,18,109,0,16,10,50,0,57,18,98,0,48,0,0,0,0, -1,0,29,2,21,1,1,0,29,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57, -18,98,0,48,0,18,109,0,16,10,49,0,57,18,98,0,48,0,18,109,0,16,10,50,0,57,18,98,0,48,0,18,109,0,16, -10,51,0,57,18,98,0,48,0,0,0,0,1,0,29,2,21,1,1,0,9,97,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97,116,52, -120,50,0,18,97,0,18,110,0,16,8,48,0,57,48,0,18,97,0,18,110,0,16,10,49,0,57,48,0,18,97,0,18,110,0, -16,10,50,0,57,48,0,18,97,0,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,31,2,21,1,1,0,31,109,0,0,1,1,0,9, -98,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,18,98,0,48,0,18,109,0,16,10,49,0,57, -18,98,0,48,0,18,109,0,16,10,50,0,57,18,98,0,48,0,18,109,0,16,10,51,0,57,18,98,0,48,0,0,0,0,1,0,31, -2,21,1,1,0,9,97,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,97,0,18,110,0,16,8,48,0,57, -48,0,18,97,0,18,110,0,16,10,49,0,57,48,0,18,97,0,18,110,0,16,10,50,0,57,48,0,18,97,0,18,110,0,16, -10,51,0,57,48,0,0,0,0,1,0,26,2,22,1,1,0,9,97,0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,51,0, -18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10,49,0,57,49,0,0,0,0,1,0,26,2,22,1,1,0,26, -109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,98,0,49,0,18,109,0, -16,10,49,0,57,18,98,0,49,0,0,0,0,1,0,28,2,22,1,1,0,9,97,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116, -50,120,52,0,18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10,49,0,57,49,0,0,0,0,1,0,28,2, -22,1,1,0,28,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,18,98,0, -49,0,18,109,0,16,10,49,0,57,18,98,0,49,0,0,0,0,1,0,27,2,22,1,1,0,9,97,0,0,1,1,0,27,110,0,0,0,1,8, -58,109,97,116,51,120,50,0,18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10,49,0,57,49,0, -18,97,0,18,110,0,16,10,50,0,57,49,0,0,0,0,1,0,27,2,22,1,1,0,27,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109, -97,116,51,120,50,0,18,109,0,16,8,48,0,57,18,98,0,49,0,18,109,0,16,10,49,0,57,18,98,0,49,0,18,109,0, -16,10,50,0,57,18,98,0,49,0,0,0,0,1,0,30,2,22,1,1,0,9,97,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116, -51,120,52,0,18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10,49,0,57,49,0,18,97,0,18,110, -0,16,10,50,0,57,49,0,0,0,0,1,0,30,2,22,1,1,0,30,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,120, -52,0,18,109,0,16,8,48,0,57,18,98,0,49,0,18,109,0,16,10,49,0,57,18,98,0,49,0,18,109,0,16,10,50,0,57, -18,98,0,49,0,0,0,0,1,0,29,2,22,1,1,0,29,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,120,50,0,18, -109,0,16,8,48,0,57,18,98,0,49,0,18,109,0,16,10,49,0,57,18,98,0,49,0,18,109,0,16,10,50,0,57,18,98,0, -49,0,18,109,0,16,10,51,0,57,18,98,0,49,0,0,0,0,1,0,29,2,22,1,1,0,9,97,0,0,1,1,0,29,110,0,0,0,1,8, -58,109,97,116,52,120,50,0,18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10,49,0,57,49,0, -18,97,0,18,110,0,16,10,50,0,57,49,0,18,97,0,18,110,0,16,10,51,0,57,49,0,0,0,0,1,0,31,2,22,1,1,0,31, -109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,18,98,0,49,0,18,109,0, -16,10,49,0,57,18,98,0,49,0,18,109,0,16,10,50,0,57,18,98,0,49,0,18,109,0,16,10,51,0,57,18,98,0,49,0, -0,0,0,1,0,31,2,22,1,1,0,9,97,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,97,0,18,110,0, -16,8,48,0,57,49,0,18,97,0,18,110,0,16,10,49,0,57,49,0,18,97,0,18,110,0,16,10,50,0,57,49,0,18,97,0, -18,110,0,16,10,51,0,57,49,0,0,0,0,1,0,26,2,27,1,1,0,26,109,0,0,0,1,8,58,109,97,116,50,120,51,0,18, -109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,0,0,0,1,0,28,2,27,1,1,0,28,109,0,0,0,1,8,58, -109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,0,0,0,1,0,27,2,27,1, -1,0,27,109,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57, -54,0,18,109,0,16,10,50,0,57,54,0,0,0,0,1,0,30,2,27,1,1,0,30,109,0,0,0,1,8,58,109,97,116,51,120,52, -0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0,0,0,0,1,0,29, -2,27,1,1,0,29,109,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49, -0,57,54,0,18,109,0,16,10,50,0,57,54,0,18,109,0,16,10,51,0,57,54,0,0,0,0,1,0,31,2,27,1,1,0,31,109,0, -0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,18,109,0, -16,10,50,0,57,54,0,18,109,0,16,10,51,0,57,54,0,0,0,0,1,0,0,2,25,1,0,2,26,109,0,0,0,1,9,18,109,0,16, -8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,0,1,0,0,2,25,1,0,2,28,109,0,0,0,1,9,18,109,0,16,8,48, -0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,0,1,0,0,2,25,1,0,2,27,109,0,0,0,1,9,18,109,0,16,8,48,0,57, -52,0,9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57,52,0,0,1,0,0,2,25,1,0,2,30,109,0,0,0,1, -9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57,52,0,0,1,0,0,2, -25,1,0,2,29,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16, -10,50,0,57,52,0,9,18,109,0,16,10,51,0,57,52,0,0,1,0,0,2,25,1,0,2,31,109,0,0,0,1,9,18,109,0,16,8,48, -0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57,52,0,9,18,109,0,16,10,51,0,57,52, -0,0,1,0,0,2,24,1,0,2,26,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,0,1, -0,0,2,24,1,0,2,28,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,0,1,0,0,2, -24,1,0,2,27,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,9,18,109,0,16, -10,50,0,57,51,0,0,1,0,0,2,24,1,0,2,30,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49, -0,57,51,0,9,18,109,0,16,10,50,0,57,51,0,0,1,0,0,2,24,1,0,2,29,109,0,0,0,1,9,18,109,0,16,8,48,0,57, -51,0,9,18,109,0,16,10,49,0,57,51,0,9,18,109,0,16,10,50,0,57,51,0,9,18,109,0,16,10,51,0,57,51,0,0,1, -0,0,2,24,1,0,2,31,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,9,18,109, -0,16,10,50,0,57,51,0,9,18,109,0,16,10,51,0,57,51,0,0,1,0,26,2,25,1,0,2,26,109,0,0,1,1,0,5,0,0,0,1, -8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,61,0,18,109,0,16,10,49,0,57,61,0,0,0,0,1,0,28,2, -25,1,0,2,28,109,0,0,1,1,0,5,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,61,0,18,109, -0,16,10,49,0,57,61,0,0,0,0,1,0,27,2,25,1,0,2,27,109,0,0,1,1,0,5,0,0,0,1,8,58,109,97,116,51,120,50, -0,18,109,0,16,8,48,0,57,61,0,18,109,0,16,10,49,0,57,61,0,18,109,0,16,10,50,0,57,61,0,0,0,0,1,0,30, -2,25,1,0,2,30,109,0,0,1,1,0,5,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,61,0,18, -109,0,16,10,49,0,57,61,0,18,109,0,16,10,50,0,57,61,0,0,0,0,1,0,29,2,25,1,0,2,29,109,0,0,1,1,0,5,0, -0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,61,0,18,109,0,16,10,49,0,57,61,0,18,109,0, -16,10,50,0,57,61,0,18,109,0,16,10,51,0,57,61,0,0,0,0,1,0,31,2,25,1,0,2,31,109,0,0,1,1,0,5,0,0,0,1, -8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,61,0,18,109,0,16,10,49,0,57,61,0,18,109,0,16,10, -50,0,57,61,0,18,109,0,16,10,51,0,57,61,0,0,0,0,1,0,26,2,24,1,0,2,26,109,0,0,1,1,0,5,0,0,0,1,8,58, -109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,60,0,18,109,0,16,10,49,0,57,60,0,0,0,0,1,0,28,2,24,1, -0,2,28,109,0,0,1,1,0,5,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,60,0,18,109,0,16, -10,49,0,57,60,0,0,0,0,1,0,27,2,24,1,0,2,27,109,0,0,1,1,0,5,0,0,0,1,8,58,109,97,116,51,120,50,0,18, -109,0,16,8,48,0,57,60,0,18,109,0,16,10,49,0,57,60,0,18,109,0,16,10,50,0,57,60,0,0,0,0,1,0,30,2,24, -1,0,2,30,109,0,0,1,1,0,5,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,60,0,18,109,0, -16,10,49,0,57,60,0,18,109,0,16,10,50,0,57,60,0,0,0,0,1,0,29,2,24,1,0,2,29,109,0,0,1,1,0,5,0,0,0,1, -8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,60,0,18,109,0,16,10,49,0,57,60,0,18,109,0,16,10, -50,0,57,60,0,18,109,0,16,10,51,0,57,60,0,0,0,0,1,0,31,2,24,1,0,2,31,109,0,0,1,1,0,5,0,0,0,1,8,58, -109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,60,0,18,109,0,16,10,49,0,57,60,0,18,109,0,16,10,50,0, -57,60,0,18,109,0,16,10,51,0,57,60,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,26,109,0, -0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,8,48,0,57,0,0,0,9,58,112,114,105,110,116, -77,69,83,65,0,18,109,0,16,10,49,0,57,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,28, -109,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,8,48,0,57,0,0,0,9,58,112,114,105, -110,116,77,69,83,65,0,18,109,0,16,10,49,0,57,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1, -0,27,109,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,8,48,0,57,0,0,0,9,58,112,114, -105,110,116,77,69,83,65,0,18,109,0,16,10,49,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18, -109,0,16,10,50,0,57,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,30,109,0,0,0,1,9,58, -112,114,105,110,116,77,69,83,65,0,18,109,0,16,8,48,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65, -0,18,109,0,16,10,49,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,10,50,0,57,0,0,0, -0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,29,109,0,0,0,1,9,58,112,114,105,110,116,77,69,83, -65,0,18,109,0,16,8,48,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,10,49,0,57,0,0, -0,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,10,50,0,57,0,0,0,9,58,112,114,105,110,116,77, -69,83,65,0,18,109,0,16,10,51,0,57,0,0,0,0,1,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,31,109,0, -0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,8,48,0,57,0,0,0,9,58,112,114,105,110,116, -77,69,83,65,0,18,109,0,16,10,49,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,10, -50,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,18,109,0,16,10,51,0,57,0,0,0,0,0 +98,0,48,0,18,109,0,16,10,51,0,57,18,98,0,48,0,0,0,0,1,0,29,2,21,1,1,0,9,97,0,0,1,1,0,29,110,0,0,0, +1,8,58,109,97,116,52,120,50,0,18,97,0,18,110,0,16,8,48,0,57,48,0,18,97,0,18,110,0,16,10,49,0,57,48, +0,18,97,0,18,110,0,16,10,50,0,57,48,0,18,97,0,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,31,2,21,1,1,0, +31,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,18,98,0,48,0,18, +109,0,16,10,49,0,57,18,98,0,48,0,18,109,0,16,10,50,0,57,18,98,0,48,0,18,109,0,16,10,51,0,57,18,98, +0,48,0,0,0,0,1,0,31,2,21,1,1,0,9,97,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,97,0, +18,110,0,16,8,48,0,57,48,0,18,97,0,18,110,0,16,10,49,0,57,48,0,18,97,0,18,110,0,16,10,50,0,57,48,0, +18,97,0,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,26,2,22,1,1,0,9,97,0,0,1,1,0,26,110,0,0,0,1,8,58,109, +97,116,50,120,51,0,18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10,49,0,57,49,0,0,0,0,1, +0,26,2,22,1,1,0,26,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18, +98,0,49,0,18,109,0,16,10,49,0,57,18,98,0,49,0,0,0,0,1,0,28,2,22,1,1,0,9,97,0,0,1,1,0,28,110,0,0,0, +1,8,58,109,97,116,50,120,52,0,18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10,49,0,57,49, +0,0,0,0,1,0,28,2,22,1,1,0,28,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8, +48,0,57,18,98,0,49,0,18,109,0,16,10,49,0,57,18,98,0,49,0,0,0,0,1,0,27,2,22,1,1,0,9,97,0,0,1,1,0,27, +110,0,0,0,1,8,58,109,97,116,51,120,50,0,18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10, +49,0,57,49,0,18,97,0,18,110,0,16,10,50,0,57,49,0,0,0,0,1,0,27,2,22,1,1,0,27,109,0,0,1,1,0,9,98,0,0, +0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,18,98,0,49,0,18,109,0,16,10,49,0,57,18,98,0, +49,0,18,109,0,16,10,50,0,57,18,98,0,49,0,0,0,0,1,0,30,2,22,1,1,0,9,97,0,0,1,1,0,30,110,0,0,0,1,8, +58,109,97,116,51,120,52,0,18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10,49,0,57,49,0, +18,97,0,18,110,0,16,10,50,0,57,49,0,0,0,0,1,0,30,2,22,1,1,0,30,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109, +97,116,51,120,52,0,18,109,0,16,8,48,0,57,18,98,0,49,0,18,109,0,16,10,49,0,57,18,98,0,49,0,18,109,0, +16,10,50,0,57,18,98,0,49,0,0,0,0,1,0,29,2,22,1,1,0,29,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116, +52,120,50,0,18,109,0,16,8,48,0,57,18,98,0,49,0,18,109,0,16,10,49,0,57,18,98,0,49,0,18,109,0,16,10, +50,0,57,18,98,0,49,0,18,109,0,16,10,51,0,57,18,98,0,49,0,0,0,0,1,0,29,2,22,1,1,0,9,97,0,0,1,1,0,29, +110,0,0,0,1,8,58,109,97,116,52,120,50,0,18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10, +49,0,57,49,0,18,97,0,18,110,0,16,10,50,0,57,49,0,18,97,0,18,110,0,16,10,51,0,57,49,0,0,0,0,1,0,31, +2,22,1,1,0,31,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,18,98,0, +49,0,18,109,0,16,10,49,0,57,18,98,0,49,0,18,109,0,16,10,50,0,57,18,98,0,49,0,18,109,0,16,10,51,0, +57,18,98,0,49,0,0,0,0,1,0,31,2,22,1,1,0,9,97,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0, +18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10,49,0,57,49,0,18,97,0,18,110,0,16,10,50,0, +57,49,0,18,97,0,18,110,0,16,10,51,0,57,49,0,0,0,0,1,0,26,2,27,1,1,0,26,109,0,0,0,1,8,58,109,97,116, +50,120,51,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,0,0,0,1,0,28,2,27,1,1,0,28,109, +0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,0,0,0,1, +0,27,2,27,1,1,0,27,109,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16, +10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0,0,0,0,1,0,30,2,27,1,1,0,30,109,0,0,0,1,8,58,109,97,116, +51,120,52,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0,0,0, +0,1,0,29,2,27,1,1,0,29,109,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,54,0,18,109,0, +16,10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0,18,109,0,16,10,51,0,57,54,0,0,0,0,1,0,31,2,27,1,1,0, +31,109,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0, +18,109,0,16,10,50,0,57,54,0,18,109,0,16,10,51,0,57,54,0,0,0,0,1,0,0,2,25,1,0,2,26,109,0,0,0,1,9,18, +109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,0,1,0,0,2,25,1,0,2,28,109,0,0,0,1,9,18,109,0, +16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,0,1,0,0,2,25,1,0,2,27,109,0,0,0,1,9,18,109,0,16,8, +48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57,52,0,0,1,0,0,2,25,1,0,2,30,109, +0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57,52,0,0, +1,0,0,2,25,1,0,2,29,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,9,18, +109,0,16,10,50,0,57,52,0,9,18,109,0,16,10,51,0,57,52,0,0,1,0,0,2,25,1,0,2,31,109,0,0,0,1,9,18,109, +0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57,52,0,9,18,109,0,16,10, +51,0,57,52,0,0,1,0,0,2,24,1,0,2,26,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0, +57,51,0,0,1,0,0,2,24,1,0,2,28,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51, +0,0,1,0,0,2,24,1,0,2,27,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,9, +18,109,0,16,10,50,0,57,51,0,0,1,0,0,2,24,1,0,2,30,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18, +109,0,16,10,49,0,57,51,0,9,18,109,0,16,10,50,0,57,51,0,0,1,0,0,2,24,1,0,2,29,109,0,0,0,1,9,18,109, +0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,9,18,109,0,16,10,50,0,57,51,0,9,18,109,0,16,10, +51,0,57,51,0,0,1,0,0,2,24,1,0,2,31,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0, +57,51,0,9,18,109,0,16,10,50,0,57,51,0,9,18,109,0,16,10,51,0,57,51,0,0,1,0,26,2,25,1,0,2,26,109,0,0, +1,1,0,5,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,61,0,18,109,0,16,10,49,0,57,61,0, +0,0,0,1,0,28,2,25,1,0,2,28,109,0,0,1,1,0,5,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0, +57,61,0,18,109,0,16,10,49,0,57,61,0,0,0,0,1,0,27,2,25,1,0,2,27,109,0,0,1,1,0,5,0,0,0,1,8,58,109,97, +116,51,120,50,0,18,109,0,16,8,48,0,57,61,0,18,109,0,16,10,49,0,57,61,0,18,109,0,16,10,50,0,57,61,0, +0,0,0,1,0,30,2,25,1,0,2,30,109,0,0,1,1,0,5,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0, +57,61,0,18,109,0,16,10,49,0,57,61,0,18,109,0,16,10,50,0,57,61,0,0,0,0,1,0,29,2,25,1,0,2,29,109,0,0, +1,1,0,5,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,61,0,18,109,0,16,10,49,0,57,61,0, +18,109,0,16,10,50,0,57,61,0,18,109,0,16,10,51,0,57,61,0,0,0,0,1,0,31,2,25,1,0,2,31,109,0,0,1,1,0,5, +0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,61,0,18,109,0,16,10,49,0,57,61,0,18,109, +0,16,10,50,0,57,61,0,18,109,0,16,10,51,0,57,61,0,0,0,0,1,0,26,2,24,1,0,2,26,109,0,0,1,1,0,5,0,0,0, +1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,60,0,18,109,0,16,10,49,0,57,60,0,0,0,0,1,0,28, +2,24,1,0,2,28,109,0,0,1,1,0,5,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,60,0,18, +109,0,16,10,49,0,57,60,0,0,0,0,1,0,27,2,24,1,0,2,27,109,0,0,1,1,0,5,0,0,0,1,8,58,109,97,116,51,120, +50,0,18,109,0,16,8,48,0,57,60,0,18,109,0,16,10,49,0,57,60,0,18,109,0,16,10,50,0,57,60,0,0,0,0,1,0, +30,2,24,1,0,2,30,109,0,0,1,1,0,5,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,60,0,18, +109,0,16,10,49,0,57,60,0,18,109,0,16,10,50,0,57,60,0,0,0,0,1,0,29,2,24,1,0,2,29,109,0,0,1,1,0,5,0, +0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,60,0,18,109,0,16,10,49,0,57,60,0,18,109,0, +16,10,50,0,57,60,0,18,109,0,16,10,51,0,57,60,0,0,0,0,1,0,31,2,24,1,0,2,31,109,0,0,1,1,0,5,0,0,0,1, +8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,60,0,18,109,0,16,10,49,0,57,60,0,18,109,0,16,10, +50,0,57,60,0,18,109,0,16,10,51,0,57,60,0,0,0,0,0 diff --git a/src/mesa/shader/slang/library/slang_common_builtin_gc.h b/src/mesa/shader/slang/library/slang_common_builtin_gc.h index 417f1fce86a..6ba6969261a 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin_gc.h +++ b/src/mesa/shader/slang/library/slang_common_builtin_gc.h @@ -695,83 +695,100 @@ 115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101, 67,117,98,101,0,1,1,0,19,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118, 101,99,52,95,116,101,120,99,117,98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108, -101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,0,1,0,0,20,115,97, -109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4, -118,101,99,52,95,115,104,97,100,49,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114, -0,0,18,99,111,111,114,100,0,0,17,48,0,48,0,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,115,104, -97,100,111,119,49,68,80,114,111,106,0,1,0,0,20,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111, -114,100,0,0,0,1,8,58,115,104,97,100,111,119,49,68,0,18,115,97,109,112,108,101,114,0,0,58,118,101, -99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,17,48,0,48,0,0,0,18, -99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,0,0,0,1,0,12,0,115,104,97, -100,111,119,50,68,0,1,0,0,21,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,0,1,3, -2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,52,95,115,104,97,100,50,100,0,18,116,101,120,101, -108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,17,48,0,48,0,0,0,0,8,18,116, -101,120,101,108,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,0,0,21,115,97,109, -112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,0,1,8,58,115,104,97,100,111,119,50,68,0,18,115, -97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114, -100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99, -111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,0,0,0,1,0,9,0,110,111,105,115, -101,49,0,1,1,0,9,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,49,0,18,95,95,114,101,116, -86,97,108,0,0,18,120,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,1,0,10,120,0,0,0,1,4,102,108,111, -97,116,95,110,111,105,115,101,50,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,9,0,110, -111,105,115,101,49,0,1,1,0,11,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,51,0,18,95, -95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,1,0,12,120,0,0,0,1, -4,102,108,111,97,116,95,110,111,105,115,101,52,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0, -1,0,10,0,110,111,105,115,101,50,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0, -58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110, -111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,0,1,0,10,0,110,111,105,115,101,50,0, -1,1,0,10,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18, -120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58, -118,101,99,50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,0,1,0,10,0,110,111,105, -115,101,50,0,1,1,0,11,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115, -101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0, -18,120,0,58,118,101,99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0, -0,20,0,0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,12,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0, -58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0, -17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1,1,0,9, -120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0, -51,52,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18, -120,0,17,53,0,52,55,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1,1,0,10,120,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,57, -0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110, -111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0, -0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1,1,0,11,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0, -58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0, -17,51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115, -101,49,0,18,120,0,58,118,101,99,51,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0, -0,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1,1,0,12,120,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,49,57,0,51,52,0,0,0,17, -55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,53,0,52,55,0,0,0,17, -49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,20,0,0,1,0,12,0,110,111, -105,115,101,52,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105, +101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,0,1,1,0,20,115,97, +109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,49,100, +0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0, +0,1,0,12,0,115,104,97,100,111,119,49,68,80,114,111,106,0,1,1,0,20,115,97,109,112,108,101,114,0,0,1, +1,0,12,99,111,111,114,100,0,0,0,1,3,2,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114, +100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112, +99,111,111,114,100,0,59,122,0,18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0, +59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,49,100,0,18,95,95,114,101,116,86, +97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97, +100,111,119,50,68,0,1,1,0,21,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4, +118,101,99,52,95,116,101,120,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, +114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,1,0, +21,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,3,2,0,12,1,112,99,111,111, +114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18, +99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99,111,111,114,100, +0,59,122,0,20,0,4,118,101,99,52,95,116,101,120,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115, +97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101, +50,68,82,101,99,116,0,1,1,0,22,115,97,109,112,108,101,114,0,0,1,1,0,10,99,111,111,114,100,0,0,0,1, +4,118,101,99,52,95,116,101,120,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97, +109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68, +82,101,99,116,80,114,111,106,0,1,1,0,22,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100, +0,0,0,1,3,2,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99, +111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,122,0,49,20,0,4,118,101,99,52,95,116,101, +120,112,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0, +18,112,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,82,101,99,116,80,114, +111,106,0,1,1,0,22,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,3,2,0,12,1, +112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59, +120,121,0,18,99,111,111,114,100,0,59,119,0,49,20,0,4,118,101,99,52,95,116,101,120,112,95,114,101, +99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111, +114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,82,101,99,116,0,1,1,0,23,115,97,109,112,108, +101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,0,1,0,12,0,115,104,97,100,111,119,50,68,82,101,99, +116,80,114,111,106,0,1,1,0,23,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,0, +1,0,9,0,110,111,105,115,101,49,0,1,1,0,9,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101, +49,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,1,0,10, +120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,50,0,18,95,95,114,101,116,86,97,108,0,0,18, +120,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,1,0,11,120,0,0,0,1,4,102,108,111,97,116,95,110,111, +105,115,101,51,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,9,0,110,111,105,115,101,49, +0,1,1,0,12,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,52,0,18,95,95,114,101,116,86,97, +108,0,0,18,120,0,0,0,0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86, +97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,0,1,0,10,0, +110,111,105,115,101,50,0,1,1,0,10,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, +111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105, +115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0, +0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,11,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120, +0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110, +111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51, +0,50,51,0,0,0,0,46,0,0,20,0,0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,12,120,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101, +116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,49,57,0,51,52, +0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,0,1,0,11,0,110,111, +105,115,101,51,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105, 115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101, 49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110, -111,105,115,101,49,0,18,120,0,17,53,0,52,55,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -119,0,58,110,111,105,115,101,49,0,18,120,0,17,50,51,0,53,52,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105, -115,101,52,0,1,1,0,10,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115, -101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0, -18,120,0,58,118,101,99,50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,53,0, -52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58, -110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0, -0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0,11,120,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54, -54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111, -105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0, -48,52,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0, -18,120,0,58,118,101,99,51,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,0, -46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0,12,120,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54, -0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53, -0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108, -0,59,119,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,50,51,0,53,52,0,0,0,17,50,57, -0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,17,51,55,0,52,56,0,0,0,0,46,0,0,20,0,0,0 +111,105,115,101,49,0,18,120,0,17,53,0,52,55,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1, +1,0,10,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120, +0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118, +101,99,50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97, +108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,53,0,52,55,0,0,0,17,49, +55,0,56,53,0,0,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1,1,0,11,120,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101, +116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52, +0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, +122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53, +0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1,1,0,12,120,0,0,0, +1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18, +95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17, +49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,9,18, +95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17, +53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,20, +0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59, +120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58, +110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97, +108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,17,53,0,52,55,0,0,46,0,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120,0,17,50,51,0,53,52,0,0,46,0,0,20,0, +0,1,0,12,0,110,111,105,115,101,52,0,1,1,0,10,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120, +0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110, +111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0, +0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101, +99,50,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108, +0,59,119,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,50,51,0,53,52,0,0,0,17,50,57, +0,49,49,0,0,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0,11,120,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101, +116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52, +0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, +122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53, +0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111, +105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51, +49,0,57,49,0,0,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0,12,120,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101, +116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,49,57,0,51,52, +0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101, +116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,53,0,52,55,0,0, +0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,50,51, +0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,17,51,55,0,52,56,0,0,0,0,46,0,0,20,0,0, +0 diff --git a/src/mesa/shader/slang/library/slang_fragment_builtin_gc.h b/src/mesa/shader/slang/library/slang_fragment_builtin_gc.h index 88317107b2b..8b8202ea2f9 100644 --- a/src/mesa/shader/slang/library/slang_fragment_builtin_gc.h +++ b/src/mesa/shader/slang/library/slang_fragment_builtin_gc.h @@ -77,39 +77,23 @@ 121,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99,111, 111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118, 101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, -114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,82,101,99,116, -0,1,1,0,22,115,97,109,112,108,101,114,0,0,1,1,0,10,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95, -116,101,120,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0, -0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,82,101,99,116,80,114, -111,106,0,1,1,0,22,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,3,2,0,12,1, -112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59, -120,121,0,18,99,111,111,114,100,0,59,122,0,49,20,0,4,118,101,99,52,95,116,101,120,112,95,114,101, -99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111, -114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,82,101,99,116,80,114,111,106,0,1,1,0,22, -115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,3,2,0,12,1,112,99,111,111,114, -100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99, -111,111,114,100,0,59,119,0,49,20,0,4,118,101,99,52,95,116,101,120,112,95,114,101,99,116,0,18,95,95, -114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0, -12,0,115,104,97,100,111,119,50,68,82,101,99,116,0,1,1,0,23,115,97,109,112,108,101,114,0,0,1,1,0,11, -99,111,111,114,100,0,0,0,1,0,1,0,12,0,115,104,97,100,111,119,50,68,82,101,99,116,80,114,111,106,0, -1,1,0,23,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,0,1,0,9,0,100,70,100, -120,0,1,1,0,9,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,59,120, -0,0,18,112,0,59,120,120,120,120,0,0,0,0,1,0,10,0,100,70,100,120,0,1,1,0,10,112,0,0,0,1,4,118,101, -99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,112,0,59,120,121,121,121, -0,0,0,0,1,0,11,0,100,70,100,120,0,1,1,0,11,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95, +114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,9,0,100,70,100,120,0,1,1,0,9,112,0,0,0,1,4,118,101, +99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,112,0,59,120,120,120,120,0,0, +0,0,1,0,10,0,100,70,100,120,0,1,1,0,10,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114, +101,116,86,97,108,0,59,120,121,0,0,18,112,0,59,120,121,121,121,0,0,0,0,1,0,11,0,100,70,100,120,0,1, +1,0,11,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121, +122,0,0,18,112,0,59,120,121,122,122,0,0,0,0,1,0,12,0,100,70,100,120,0,1,1,0,12,112,0,0,0,1,4,118, +101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,0,0,1,0,9,0,100,70,100, +121,0,1,1,0,9,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120, +0,0,18,112,0,59,120,120,120,120,0,0,0,0,1,0,10,0,100,70,100,121,0,1,1,0,10,112,0,0,0,1,4,118,101, +99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,112,0,59,120,121,121,121, +0,0,0,0,1,0,11,0,100,70,100,121,0,1,1,0,11,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95, 114,101,116,86,97,108,0,59,120,121,122,0,0,18,112,0,59,120,121,122,122,0,0,0,0,1,0,12,0,100,70,100, -120,0,1,1,0,12,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,0,18, -112,0,0,0,0,1,0,9,0,100,70,100,121,0,1,1,0,9,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95, -114,101,116,86,97,108,0,59,120,0,0,18,112,0,59,120,120,120,120,0,0,0,0,1,0,10,0,100,70,100,121,0,1, -1,0,10,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0, -0,18,112,0,59,120,121,121,121,0,0,0,0,1,0,11,0,100,70,100,121,0,1,1,0,11,112,0,0,0,1,4,118,101,99, -52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,112,0,59,120,121,122, -122,0,0,0,0,1,0,12,0,100,70,100,121,0,1,1,0,12,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95, -95,114,101,116,86,97,108,0,0,18,112,0,0,0,0,1,0,9,0,102,119,105,100,116,104,0,1,1,0,9,112,0,0,0,1, -8,58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,0, -0,0,0,0,46,0,0,1,0,10,0,102,119,105,100,116,104,0,1,1,0,10,112,0,0,0,1,8,58,97,98,115,0,58,100,70, -100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,1,0,11,0,102, -119,105,100,116,104,0,1,1,0,11,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0, -58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,1,0,12,0,102,119,105,100,116,104,0,1,1, -0,12,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70, -100,121,0,18,112,0,0,0,0,0,46,0,0,0 +121,0,1,1,0,12,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,0,18, +112,0,0,0,0,1,0,9,0,102,119,105,100,116,104,0,1,1,0,9,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100, +120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,1,0,10,0,102,119, +105,100,116,104,0,1,1,0,10,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,58,97, +98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,1,0,11,0,102,119,105,100,116,104,0,1,1,0,11, +112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121, +0,18,112,0,0,0,0,0,46,0,0,1,0,12,0,102,119,105,100,116,104,0,1,1,0,12,112,0,0,0,1,8,58,97,98,115,0, +58,100,70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,0 -- cgit v1.2.3 From bf287356cfc806f9df862a05620f046f8980a8e7 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 11 Apr 2007 14:09:32 -0600 Subject: restore 200x200 window size, animation, version check --- progs/demos/fslight.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/progs/demos/fslight.c b/progs/demos/fslight.c index 736cc48ac67..493ce0e90f1 100644 --- a/progs/demos/fslight.c +++ b/progs/demos/fslight.c @@ -45,7 +45,7 @@ static GLint uTexture; static GLuint SphereList, RectList, CurList; static GLint win = 0; -static GLboolean anim = GL_FALSE; +static GLboolean anim = GL_TRUE; static GLboolean wire = GL_FALSE; static GLboolean pixelLight = GL_TRUE; @@ -477,8 +477,8 @@ Init(void) version = (const char *) glGetString(GL_VERSION); if (version[0] != '2' || version[1] != '.') { - printf("Warning: this program expects OpenGL 2.0\n"); - /*exit(1);*/ + printf("This program requires OpenGL 2.x, found %s\n", version); + exit(1); } GetExtensionFuncs(); @@ -579,6 +579,8 @@ Init(void) #if 0 TestFunctions(); +#else + (void) TestFunctions; #endif } @@ -603,7 +605,7 @@ main(int argc, char *argv[]) { glutInit(&argc, argv); glutInitWindowPosition( 0, 0); - glutInitWindowSize(100, 100); + glutInitWindowSize(200, 200); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); win = glutCreateWindow(argv[0]); glutReshapeFunc(Reshape); -- cgit v1.2.3 From 3c008a014f7c1d14209b70b4b030bf7738aa16d7 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 12 Apr 2007 15:22:32 -0600 Subject: New _mesa_reference_shader/program() function to consolidate refcounting. Note that (unlike texture objects), shader handles remain valid (in the hash table) after glDeleteShader/Program() if the refcount isn't zero. --- src/mesa/shader/shader_api.c | 202 ++++++++++++++++++++++++++++++++----------- src/mesa/shader/shader_api.h | 13 +++ 2 files changed, 166 insertions(+), 49 deletions(-) diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index cf42a5843ec..47622fdd521 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -68,15 +68,12 @@ _mesa_new_shader_program(GLcontext *ctx, GLuint name) /** - * Free the data that hangs off a shader program object, but not the object - * itself. + * Clear (free) the shader program state that gets produced by linking. */ void -_mesa_free_shader_program_data(GLcontext *ctx, - struct gl_shader_program *shProg) +_mesa_clear_shader_program_data(GLcontext *ctx, + struct gl_shader_program *shProg) { - assert(shProg->Type == GL_SHADER_PROGRAM); - if (shProg->VertexProgram) { if (shProg->VertexProgram->Base.Parameters == shProg->Uniforms) { /* to prevent a double-free in the next call */ @@ -95,7 +92,6 @@ _mesa_free_shader_program_data(GLcontext *ctx, shProg->FragmentProgram = NULL; } - if (shProg->Uniforms) { _mesa_free_parameter_list(shProg->Uniforms); shProg->Uniforms = NULL; @@ -108,12 +104,38 @@ _mesa_free_shader_program_data(GLcontext *ctx, } +/** + * Free all the data that hangs off a shader program object, but not the + * object itself. + */ +void +_mesa_free_shader_program_data(GLcontext *ctx, + struct gl_shader_program *shProg) +{ + GLuint i; + + assert(shProg->Type == GL_SHADER_PROGRAM); + + _mesa_clear_shader_program_data(ctx, shProg); + + /* detach shaders */ + for (i = 0; i < shProg->NumShaders; i++) { + _mesa_reference_shader(ctx, &shProg->Shaders[i], NULL); + } + if (shProg->Shaders) { + _mesa_free(shProg->Shaders); + shProg->Shaders = NULL; + } +} + + /** * Free/delete a shader program object. */ void _mesa_free_shader_program(GLcontext *ctx, struct gl_shader_program *shProg) { + printf("FREE SHADER PROG %d\n", shProg->Name); _mesa_free_shader_program_data(ctx, shProg); if (shProg->Shaders) { _mesa_free(shProg->Shaders); @@ -123,6 +145,52 @@ _mesa_free_shader_program(GLcontext *ctx, struct gl_shader_program *shProg) } +/** + * Set ptr to point to shProg. + * If ptr is pointing to another object, decrement its refcount (and delete + * if refcount hits zero). + * Then set ptr to point to shProg, incrementing its refcount. + */ +/* XXX this could be static */ +void +_mesa_reference_shader_program(GLcontext *ctx, + struct gl_shader_program **ptr, + struct gl_shader_program *shProg) +{ + assert(ptr); + if (*ptr == shProg) { + /* no-op */ + return; + } + if (*ptr) { + /* Unreference the old shader program */ + GLboolean deleteFlag = GL_FALSE; + struct gl_shader_program *old = *ptr; + + ASSERT(old->RefCount > 0); + old->RefCount--; + /*printf("SHPROG DECR %p (%d) to %d\n", + (void*) old, old->Name, old->RefCount);*/ + deleteFlag = (old->RefCount == 0); + + if (deleteFlag) { + _mesa_HashRemove(ctx->Shared->ShaderObjects, old->Name); + _mesa_free_shader_program(ctx, old); + } + + *ptr = NULL; + } + assert(!*ptr); + + if (shProg) { + shProg->RefCount++; + printf("SHPROG INCR %p (%d) to %d\n", + (void*) shProg, shProg->Name, shProg->RefCount); + *ptr = shProg; + } +} + + /** * Lookup a GLSL program object. */ @@ -168,6 +236,7 @@ void _mesa_free_shader(GLcontext *ctx, struct gl_shader *sh) { GLuint i; + printf("FREE SHADER %d\n", sh->Name); if (sh->Source) _mesa_free((void *) sh->Source); if (sh->InfoLog) @@ -182,6 +251,52 @@ _mesa_free_shader(GLcontext *ctx, struct gl_shader *sh) } +/** + * Set ptr to point to sh. + * If ptr is pointing to another shader, decrement its refcount (and delete + * if refcount hits zero). + * Then set ptr to point to sh, incrementing its refcount. + */ +/* XXX this could be static */ +void +_mesa_reference_shader(GLcontext *ctx, struct gl_shader **ptr, + struct gl_shader *sh) +{ + assert(ptr); + if (*ptr == sh) { + /* no-op */ + return; + } + if (*ptr) { + /* Unreference the old shader */ + GLboolean deleteFlag = GL_FALSE; + struct gl_shader *old = *ptr; + + ASSERT(old->RefCount > 0); + old->RefCount--; + printf("SHADER DECR %p (%d) to %d\n", + (void*) old, old->Name, old->RefCount); + deleteFlag = (old->RefCount == 0); + + if (deleteFlag) { + _mesa_HashRemove(ctx->Shared->ShaderObjects, old->Name); + _mesa_free_shader(ctx, old); + } + + *ptr = NULL; + } + assert(!*ptr); + + if (sh) { + /* reference new */ + sh->RefCount++; + printf("SHADER INCR %p (%d) to %d\n", + (void*) sh, sh->Name, sh->RefCount); + *ptr = sh; + } +} + + /** * Lookup a GLSL shader object. */ @@ -227,13 +342,7 @@ _mesa_init_shader_state(GLcontext * ctx) void _mesa_free_shader_state(GLcontext *ctx) { - if (ctx->Shader.CurrentProgram) { - ctx->Shader.CurrentProgram->RefCount--; - if (ctx->Shader.CurrentProgram->RefCount <= 0) { - _mesa_free_shader_program(ctx, ctx->Shader.CurrentProgram); - ctx->Shader.CurrentProgram = NULL; - } - } + _mesa_reference_shader_program(ctx, &ctx->Shader.CurrentProgram, NULL); } @@ -294,8 +403,8 @@ _mesa_attach_shader(GLcontext *ctx, GLuint program, GLuint shader) } /* append */ - shProg->Shaders[n] = sh; - sh->RefCount++; + shProg->Shaders[n] = NULL; /* since realloc() didn't zero the new space */ + _mesa_reference_shader(ctx, &shProg->Shaders[n], sh); shProg->NumShaders++; } @@ -381,13 +490,27 @@ _mesa_create_program(GLcontext *ctx) _mesa_HashInsert(ctx->Shared->ShaderObjects, name, shProg); + assert(shProg->RefCount == 1); + return name; } +/** + * Named w/ "2" to indicate OpenGL 2.x vs GL_ARB_fragment_programs's + * DeleteProgramARB. + */ void _mesa_delete_program2(GLcontext *ctx, GLuint name) { + /* + * NOTE: deleting shaders/programs works a bit differently than + * texture objects (and buffer objects, etc). Shader/program + * handles/IDs exist in the hash table until the object is really + * deleted (refcount==0). With texture objects, the handle/ID is + * removed from the hash table in glDeleteTextures() while the tex + * object itself might linger until its refcount goes to zero. + */ struct gl_shader_program *shProg; shProg = _mesa_lookup_shader_program(ctx, name); @@ -396,16 +519,10 @@ _mesa_delete_program2(GLcontext *ctx, GLuint name) return; } - /* always remove from hash table */ - _mesa_HashRemove(ctx->Shared->ShaderObjects, name); - shProg->DeletePending = GL_TRUE; - /* decrement refcount, delete if zero */ - shProg->RefCount--; - if (shProg->RefCount <= 0) { - _mesa_free_shader_program(ctx, shProg); - } + /* effectively, decr shProg's refcount */ + _mesa_reference_shader_program(ctx, &shProg, NULL); } @@ -418,10 +535,9 @@ _mesa_delete_shader(GLcontext *ctx, GLuint shader) } sh->DeletePending = GL_TRUE; - sh->RefCount--; - if (sh->RefCount <= 0) { - _mesa_free_shader(ctx, sh); - } + + /* effectively, decr sh's refcount */ + _mesa_reference_shader(ctx, &sh, NULL); } @@ -441,14 +557,11 @@ _mesa_detach_shader(GLcontext *ctx, GLuint program, GLuint shader) for (i = 0; i < n; i++) { if (shProg->Shaders[i]->Name == shader) { - struct gl_shader **newList; /* found it */ + struct gl_shader **newList; - shProg->Shaders[i]->RefCount--; - if (shProg->Shaders[i]->RefCount == 0) { - /* delete now */ - _mesa_free_shader(ctx, shProg->Shaders[i]); - } + /* derefernce */ + _mesa_reference_shader(ctx, &shProg->Shaders[i], NULL); /* alloc new, smaller array */ newList = (struct gl_shader **) @@ -876,6 +989,8 @@ _mesa_link_program(GLcontext *ctx, GLuint program) void _mesa_use_program(GLcontext *ctx, GLuint program) { + struct gl_shader_program *shProg; + if (ctx->Shader.CurrentProgram && ctx->Shader.CurrentProgram->Name == program) { /* no-op */ @@ -884,30 +999,19 @@ _mesa_use_program(GLcontext *ctx, GLuint program) FLUSH_VERTICES(ctx, _NEW_PROGRAM); - /* unbind old */ - if (ctx->Shader.CurrentProgram) { - ctx->Shader.CurrentProgram->RefCount--; - if (ctx->Shader.CurrentProgram->RefCount <= 0) { - _mesa_free_shader_program(ctx, ctx->Shader.CurrentProgram); - } - ctx->Shader.CurrentProgram = NULL; - } - if (program) { - struct gl_shader_program *shProg; shProg = _mesa_lookup_shader_program(ctx, program); if (!shProg) { _mesa_error(ctx, GL_INVALID_VALUE, "glUseProgramObjectARB(programObj)"); return; } - ctx->Shader.CurrentProgram = shProg; - shProg->RefCount++; } else { - /* don't use a shader program */ - ctx->Shader.CurrentProgram = NULL; - } + shProg = NULL; + } + + _mesa_reference_shader_program(ctx, &ctx->Shader.CurrentProgram, shProg); } diff --git a/src/mesa/shader/shader_api.h b/src/mesa/shader/shader_api.h index 16ed1a0c108..27e5870d705 100644 --- a/src/mesa/shader/shader_api.h +++ b/src/mesa/shader/shader_api.h @@ -44,6 +44,10 @@ _mesa_free_shader_state(GLcontext *ctx); extern struct gl_shader_program * _mesa_new_shader_program(GLcontext *ctx, GLuint name); +extern void +_mesa_clear_shader_program_data(GLcontext *ctx, + struct gl_shader_program *shProg); + extern void _mesa_free_shader_program_data(GLcontext *ctx, struct gl_shader_program *shProg); @@ -51,6 +55,11 @@ _mesa_free_shader_program_data(GLcontext *ctx, extern void _mesa_free_shader_program(GLcontext *ctx, struct gl_shader_program *shProg); +extern void +_mesa_reference_shader_program(GLcontext *ctx, + struct gl_shader_program **ptr, + struct gl_shader_program *shProg); + extern struct gl_shader_program * _mesa_lookup_shader_program(GLcontext *ctx, GLuint name); @@ -61,6 +70,10 @@ _mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type); extern void _mesa_free_shader(GLcontext *ctx, struct gl_shader *sh); +extern void +_mesa_reference_shader(GLcontext *ctx, struct gl_shader **ptr, + struct gl_shader *sh); + extern struct gl_shader * _mesa_lookup_shader(GLcontext *ctx, GLuint name); -- cgit v1.2.3 From 431d650f2b2969951cdc66822d1652da1bf6c286 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 12 Apr 2007 15:22:53 -0600 Subject: use _mesa_clear_shader_program_data() --- src/mesa/shader/slang/slang_link.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 0cad69d4100..20c66909b27 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -475,7 +475,7 @@ _slang_link(GLcontext *ctx, const struct gl_fragment_program *fragProg; GLuint i; - _mesa_free_shader_program_data(ctx, shProg); + _mesa_clear_shader_program_data(ctx, shProg); shProg->Uniforms = _mesa_new_parameter_list(); shProg->Varying = _mesa_new_parameter_list(); -- cgit v1.2.3 From 5b74fe08897d8897161566ef4cd59b09474d5837 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 12 Apr 2007 15:23:55 -0600 Subject: Added sanity checking in _slang_sizeof_type_specifier() to be sure sizes are what's expected. --- src/mesa/shader/slang/slang_codegen.c | 95 +++++++++++++++++++++++++---------- 1 file changed, 68 insertions(+), 27 deletions(-) diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index fe6b615c5d6..06bceea7d0f 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -107,54 +107,84 @@ _slang_field_offset(const slang_type_specifier *spec, slang_atom field) } +/** + * Return the size (in floats) of the given type specifier. + * If the size is greater than 4, the size should be a multiple of 4 + * so that the correct number of 4-float registers are allocated. + * For example, a mat3x2 is size 12 because we want to store the + * 3 columns in 3 float[4] registers. + */ GLuint _slang_sizeof_type_specifier(const slang_type_specifier *spec) { + GLuint sz; switch (spec->type) { case SLANG_SPEC_VOID: - return 0; + sz = 0; + break; case SLANG_SPEC_BOOL: - return 1; + sz = 1; + break; case SLANG_SPEC_BVEC2: - return 2; + sz = 2; + break; case SLANG_SPEC_BVEC3: - return 3; + sz = 3; + break; case SLANG_SPEC_BVEC4: - return 4; + sz = 4; + break; case SLANG_SPEC_INT: - return 1; + sz = 1; + break; case SLANG_SPEC_IVEC2: - return 2; + sz = 2; + break; case SLANG_SPEC_IVEC3: - return 3; + sz = 3; + break; case SLANG_SPEC_IVEC4: - return 4; + sz = 4; + break; case SLANG_SPEC_FLOAT: - return 1; + sz = 1; + break; case SLANG_SPEC_VEC2: - return 2; + sz = 2; + break; case SLANG_SPEC_VEC3: - return 3; + sz = 3; + break; case SLANG_SPEC_VEC4: - return 4; + sz = 4; + break; case SLANG_SPEC_MAT2: - return 2 * 2; + sz = 2 * 4; /* 2 columns (regs) */ + break; case SLANG_SPEC_MAT3: - return 3 * 3; + sz = 3 * 4; + break; case SLANG_SPEC_MAT4: - return 4 * 4; + sz = 4 * 4; + break; case SLANG_SPEC_MAT23: - return 2 * 4; /* special case */ + sz = 2 * 4; /* 2 columns (regs) */ + break; case SLANG_SPEC_MAT32: - return 3 * 4; /* special case: 3 registers (columns), not two */ + sz = 3 * 4; /* 3 columns (regs) */ + break; case SLANG_SPEC_MAT24: - return 2 * 4; + sz = 2 * 4; + break; case SLANG_SPEC_MAT42: - return 4 * 4; /* special case: 4 registers (columns), not two */ + sz = 4 * 4; /* 4 columns (regs) */ + break; case SLANG_SPEC_MAT34: - return 3 * 4; + sz = 3 * 4; + break; case SLANG_SPEC_MAT43: - return 4 * 4; /* special case: 4 registers (columns), not two */ + sz = 4 * 4; /* 4 columns (regs) */ + break; case SLANG_SPEC_SAMPLER1D: case SLANG_SPEC_SAMPLER2D: case SLANG_SPEC_SAMPLER3D: @@ -163,16 +193,27 @@ _slang_sizeof_type_specifier(const slang_type_specifier *spec) case SLANG_SPEC_SAMPLER2DSHADOW: case SLANG_SPEC_SAMPLER2DRECT: case SLANG_SPEC_SAMPLER2DRECTSHADOW: - return 1; /* a sampler is basically just an integer index */ + sz = 1; /* a sampler is basically just an integer index */ + break; case SLANG_SPEC_STRUCT: - return _slang_field_offset(spec, 0); /* special use */ + sz = _slang_field_offset(spec, 0); /* special use */ + if (sz > 4) { + sz = (sz + 3) & ~0x3; /* round up to multiple of four */ + } + break; case SLANG_SPEC_ARRAY: - return _slang_sizeof_type_specifier(spec->_array); + sz = _slang_sizeof_type_specifier(spec->_array); + break; default: _mesa_problem(NULL, "Unexpected type in _slang_sizeof_type_specifier()"); - return 0; + sz = 0; + } + + if (sz > 4) { + /* if size is > 4, it should be a multiple of four */ + assert((sz & 0x3) == 0); } - return 0; + return sz; } -- cgit v1.2.3 From 99193e4f7454bf5a9cfa0bc3ee6935d8cc85b7fa Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 12 Apr 2007 15:45:02 -0600 Subject: disable debug printfs --- src/mesa/shader/shader_api.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 47622fdd521..fc1ae287f4f 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -135,7 +135,6 @@ _mesa_free_shader_program_data(GLcontext *ctx, void _mesa_free_shader_program(GLcontext *ctx, struct gl_shader_program *shProg) { - printf("FREE SHADER PROG %d\n", shProg->Name); _mesa_free_shader_program_data(ctx, shProg); if (shProg->Shaders) { _mesa_free(shProg->Shaders); @@ -184,8 +183,8 @@ _mesa_reference_shader_program(GLcontext *ctx, if (shProg) { shProg->RefCount++; - printf("SHPROG INCR %p (%d) to %d\n", - (void*) shProg, shProg->Name, shProg->RefCount); + /*printf("SHPROG INCR %p (%d) to %d\n", + (void*) shProg, shProg->Name, shProg->RefCount);*/ *ptr = shProg; } } @@ -236,7 +235,6 @@ void _mesa_free_shader(GLcontext *ctx, struct gl_shader *sh) { GLuint i; - printf("FREE SHADER %d\n", sh->Name); if (sh->Source) _mesa_free((void *) sh->Source); if (sh->InfoLog) @@ -274,8 +272,8 @@ _mesa_reference_shader(GLcontext *ctx, struct gl_shader **ptr, ASSERT(old->RefCount > 0); old->RefCount--; - printf("SHADER DECR %p (%d) to %d\n", - (void*) old, old->Name, old->RefCount); + /*printf("SHADER DECR %p (%d) to %d\n", + (void*) old, old->Name, old->RefCount);*/ deleteFlag = (old->RefCount == 0); if (deleteFlag) { @@ -290,8 +288,8 @@ _mesa_reference_shader(GLcontext *ctx, struct gl_shader **ptr, if (sh) { /* reference new */ sh->RefCount++; - printf("SHADER INCR %p (%d) to %d\n", - (void*) sh, sh->Name, sh->RefCount); + /*printf("SHADER INCR %p (%d) to %d\n", + (void*) sh, sh->Name, sh->RefCount);*/ *ptr = sh; } } -- cgit v1.2.3 From f11604a30d9ec7ab74f03be2055f8bb8ca4fe211 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 12 Apr 2007 16:17:01 -0600 Subject: fix bug in _playback_copy_to_current(): need to skip version position data (see bug 10587) --- src/mesa/vbo/vbo_save_draw.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c index 75cbf020d7d..a5e4081acc2 100644 --- a/src/mesa/vbo/vbo_save_draw.c +++ b/src/mesa/vbo/vbo_save_draw.c @@ -58,6 +58,8 @@ static void _playback_copy_to_current( GLcontext *ctx, node->vertex_size * sizeof(GLfloat), data, node->vertex_store->bufferobj ); + data += node->attrsz[0]; /* skip version position */ + for (i = VBO_ATTRIB_POS+1 ; i < VBO_ATTRIB_MAX ; i++) { if (node->attrsz[i]) { GLfloat *current = (GLfloat *)vbo->currval[i].Ptr; -- cgit v1.2.3 From 30b6f11de1f2f3b9198388451b8a1f73f012c964 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 12 Apr 2007 16:18:27 -0600 Subject: s/version/vertex/ --- src/mesa/vbo/vbo_save_draw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c index a5e4081acc2..8940551d08b 100644 --- a/src/mesa/vbo/vbo_save_draw.c +++ b/src/mesa/vbo/vbo_save_draw.c @@ -58,7 +58,7 @@ static void _playback_copy_to_current( GLcontext *ctx, node->vertex_size * sizeof(GLfloat), data, node->vertex_store->bufferobj ); - data += node->attrsz[0]; /* skip version position */ + data += node->attrsz[0]; /* skip vertex position */ for (i = VBO_ATTRIB_POS+1 ; i < VBO_ATTRIB_MAX ; i++) { if (node->attrsz[i]) { -- cgit v1.2.3 From 50aaabc248c9823106ff772873cbf2631d4dadcd Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Fri, 13 Apr 2007 18:12:37 +0300 Subject: xmesa: export xmesa functions used by xfree86. This uses xmesa.h as the GLcore interface and avoids adding an explicit GLcore inteface which would not be a proper interface anyway. It puts the declarations of the three functions specific for XMesa/XFree86 in xmesa.h, we can push them down to xmesa_xf86.h if hiding behind XFree86Server ifdef's is not enough. --- include/GL/xmesa.h | 15 +++++++++++++++ src/mesa/drivers/x11/xm_api.c | 19 +++++++++++++++---- src/mesa/drivers/x11/xmesaP.h | 10 ---------- 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/include/GL/xmesa.h b/include/GL/xmesa.h index ab813b23baa..f185a15cdb8 100644 --- a/include/GL/xmesa.h +++ b/include/GL/xmesa.h @@ -180,6 +180,21 @@ extern XMesaContext XMesaCreateContext( XMesaVisual v, extern void XMesaDestroyContext( XMesaContext c ); +#ifdef XFree86Server +/* + * These are the extra routines required for integration with XFree86. + * None of these routines should be user visible. -KEM + */ +extern GLboolean XMesaForceCurrent( XMesaContext c ); + +extern GLboolean XMesaLoseCurrent( XMesaContext c ); + +extern GLboolean XMesaCopyContext( XMesaContext src, + XMesaContext dst, + GLuint mask ); +#endif /* XFree86Server */ + + /* * Create an XMesaBuffer from an X window. */ diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 24028a44ba7..6439d13fa5f 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1308,6 +1308,7 @@ xmesa_convert_from_x_visual_type( int visualType ) * visualCaveat - ala the GLX extension, usually GLX_NONE * Return; a new XMesaVisual or 0 if error. */ +PUBLIC XMesaVisual XMesaCreateVisual( XMesaDisplay *display, XMesaVisualInfo visinfo, GLboolean rgb_flag, @@ -1450,6 +1451,7 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display, } +PUBLIC void XMesaDestroyVisual( XMesaVisual v ) { #ifndef XFree86Server @@ -1467,6 +1469,7 @@ void XMesaDestroyVisual( XMesaVisual v ) * lists or NULL if no sharing is wanted. * \return an XMesaContext or NULL if error. */ +PUBLIC XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) { static GLboolean firstTime = GL_TRUE; @@ -1550,6 +1553,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) +PUBLIC void XMesaDestroyContext( XMesaContext c ) { GLcontext *mesaCtx = &c->mesa; @@ -1721,7 +1725,7 @@ XMesaCreateWindowBuffer2(XMesaVisual v, XMesaWindow w, XMesaContext c) } -XMesaBuffer +PUBLIC XMesaBuffer XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w) { return XMesaCreateWindowBuffer2( v, w, NULL ); @@ -1737,7 +1741,7 @@ XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w) * \c GLX_DIRECT_COLOR visual for the pixmap * \returns new XMesaBuffer or NULL if error */ -XMesaBuffer +PUBLIC XMesaBuffer XMesaCreatePixmapBuffer(XMesaVisual v, XMesaPixmap p, XMesaColormap cmap) { int client = 0; @@ -1802,7 +1806,7 @@ XMesaCreatePBuffer(XMesaVisual v, XMesaColormap cmap, /* * Deallocate an XMesaBuffer structure and all related info. */ -void +PUBLIC void XMesaDestroyBuffer(XMesaBuffer b) { xmesa_free_buffer(b); @@ -1845,6 +1849,7 @@ GLboolean XMesaMakeCurrent( XMesaContext c, XMesaBuffer b ) /* * Bind buffer b to context c and make c the current rendering context. */ +PUBLIC GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer, XMesaBuffer readBuffer ) { @@ -1958,6 +1963,8 @@ XMesaBuffer XMesaGetCurrentReadBuffer( void ) } +#ifdef XFree86Server +PUBLIC GLboolean XMesaForceCurrent(XMesaContext c) { if (c) { @@ -1976,6 +1983,7 @@ GLboolean XMesaForceCurrent(XMesaContext c) } +PUBLIC GLboolean XMesaLoseCurrent(XMesaContext c) { (void) c; @@ -1984,11 +1992,13 @@ GLboolean XMesaLoseCurrent(XMesaContext c) } +PUBLIC GLboolean XMesaCopyContext( XMesaContext xm_src, XMesaContext xm_dst, GLuint mask ) { _mesa_copy_context(&xm_src->mesa, &xm_dst->mesa, mask); return GL_TRUE; } +#endif /* XFree86Server */ /* @@ -2135,6 +2145,7 @@ static void FXgetImage( XMesaBuffer b ) * Copy the back buffer to the front buffer. If there's no back buffer * this is a no-op. */ +PUBLIC void XMesaSwapBuffers( XMesaBuffer b ) { GET_CURRENT_CONTEXT(ctx); @@ -2475,7 +2486,7 @@ unsigned long XMesaDitherColor( XMesaContext xmesa, GLint x, GLint y, * This is typically called when the window size changes and we need * to reallocate the buffer's back/depth/stencil/accum buffers. */ -void +PUBLIC void XMesaResizeBuffers( XMesaBuffer b ) { GET_CURRENT_CONTEXT(ctx); diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h index bd5dce14172..98d03ccf62f 100644 --- a/src/mesa/drivers/x11/xmesaP.h +++ b/src/mesa/drivers/x11/xmesaP.h @@ -573,16 +573,6 @@ extern XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v, XMesaWindow w, XMesaContext c ); -/* - * These are the extra routines required for integration with XFree86. - * None of these routines should be user visible. -KEM - */ -extern GLboolean XMesaForceCurrent(XMesaContext c); -extern GLboolean XMesaLoseCurrent(XMesaContext c); -extern GLboolean XMesaCopyContext( XMesaContext src, - XMesaContext dst, - GLuint mask ); - #define ENABLE_EXT_texure_compression_s3tc 0 /* SW texture compression */ -- cgit v1.2.3 From 9f8373d5cada37ed71e5908a7158d56d9a4c34d5 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Fri, 13 Apr 2007 18:13:08 +0300 Subject: xmesa: drop unused XMesaPutImageHelper. It could only be called from XMesaCopySubBuffer but this function is not used by XFree86. It seems that XMesaPutImageHelper would handle sub-images but never got finished. Proper sub-image helpers should be written if need be. --- include/GL/xmesa_xf86.h | 3 +-- src/mesa/drivers/x11/xm_image.c | 17 ----------------- src/mesa/drivers/x11/xm_image.h | 7 ------- 3 files changed, 1 insertion(+), 26 deletions(-) diff --git a/include/GL/xmesa_xf86.h b/include/GL/xmesa_xf86.h index c84ffe8a20f..7d5a7c5e995 100644 --- a/include/GL/xmesa_xf86.h +++ b/include/GL/xmesa_xf86.h @@ -124,8 +124,7 @@ do { \ do { \ /* Assumes: Images are always in ZPixmap format */ \ (void) __d; \ - if (__sx || __sy) /* The non-trivial case */ \ - XMesaPutImageHelper(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h); \ + ASSERT(!__sx && !__sy) /* The SubImage case */ \ ValidateGC(__b, __gc); \ (*__gc->ops->PutImage)(__b, __gc, ((XMesaDrawable)(__b))->depth, \ __x, __y, __w, __h, 0, ZPixmap, \ diff --git a/src/mesa/drivers/x11/xm_image.c b/src/mesa/drivers/x11/xm_image.c index b91d5679f9b..087b4e4c3a7 100644 --- a/src/mesa/drivers/x11/xm_image.c +++ b/src/mesa/drivers/x11/xm_image.c @@ -130,21 +130,4 @@ void XMesaPutPixel(XMesaImage *image, int x, int y, unsigned long pixel) } #endif -void XMesaPutImageHelper(ScreenPtr display, - DrawablePtr d, GCPtr gc, - XMesaImage *image, - int src_x, int src_y, - int dest_x, int dest_y, - unsigned int width, unsigned int height) -{ - /* NOT_DONE: Verify that the following works for all depths */ - char *src = (image->data + - src_y * image->bytes_per_line + - ((src_x * image->bits_per_pixel) >> 3)); - - ValidateGC(d, gc); - (*gc->ops->PutImage)(d, gc, d->depth, dest_x, dest_y, width, height, - 0, ZPixmap, src); -} - #endif /* XFree86Server */ diff --git a/src/mesa/drivers/x11/xm_image.h b/src/mesa/drivers/x11/xm_image.h index c91ab3935eb..240ccee1af5 100644 --- a/src/mesa/drivers/x11/xm_image.h +++ b/src/mesa/drivers/x11/xm_image.h @@ -81,11 +81,4 @@ extern void XMesaPutPixel(XMesaImage *image, int x, int y, unsigned long pixel); #endif -extern void XMesaPutImageHelper(ScreenPtr display, - DrawablePtr d, GCPtr gc, - XMesaImage *image, - int src_x, int src_y, - int dest_x, int dest_y, - unsigned int width, unsigned int height); - #endif /* _XM_IMAGE_H_ */ -- cgit v1.2.3 From 967c1056d5e86231e4a545a748973e1123cd19c1 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 13 Apr 2007 09:55:35 -0600 Subject: patch for Digital/Tru64 (bug 10635) - forwarded to OpenGL ARB as well --- include/GL/glxext.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/GL/glxext.h b/include/GL/glxext.h index d239badd74e..fb7ea22c1de 100644 --- a/include/GL/glxext.h +++ b/include/GL/glxext.h @@ -386,7 +386,7 @@ typedef struct { /* (as used in the GLX_OML_sync_control extension). */ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #include -#elif defined(__sun__) +#elif defined(__sun__) || defined(__digital__) #include #if defined(__STDC__) #if defined(__arch64__) -- cgit v1.2.3 From 3d59042afdaff9e67c6422cd8fa73d1bbbfbe940 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sat, 14 Apr 2007 04:52:27 +0100 Subject: r300: if we don't have TCL don't setup state emissions for vertex shaders --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 109 ++++++++++++++++++-------------- src/mesa/drivers/dri/r300/r300_ioctl.c | 49 +++++++------- src/mesa/drivers/dri/r300/r300_state.c | 34 +++++----- 3 files changed, 104 insertions(+), 88 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 0fb2e5a2e0f..77d0add3e35 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -281,7 +281,11 @@ CHECK( vpu, vpu_count(atom->cmd) ? (1 + vpu_count(atom->cmd)*4) : 0 ) void r300InitCmdBuf(r300ContextPtr r300) { int size, mtu; - + int has_tcl = 1; + + if (!(r300->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) + has_tcl = 0; + r300->hw.max_state_size = 2+2; /* reserve extra space for WAIT_IDLE and tex cache flush */ mtu = r300->radeon.glCtx->Const.MaxTextureUnits; @@ -291,33 +295,37 @@ void r300InitCmdBuf(r300ContextPtr r300) /* Initialize state atoms */ ALLOC_STATE( vpt, always, R300_VPT_CMDSIZE, "vpt", 0 ); - r300->hw.vpt.cmd[R300_VPT_CMD_0] = cmdpacket0(R300_SE_VPORT_XSCALE, 6); + r300->hw.vpt.cmd[R300_VPT_CMD_0] = cmdpacket0(R300_SE_VPORT_XSCALE, 6); ALLOC_STATE( vap_cntl, always, 2, "vap_cntl", 0 ); - r300->hw.vap_cntl.cmd[0] = cmdpacket0(R300_VAP_CNTL, 1); + r300->hw.vap_cntl.cmd[0] = cmdpacket0(R300_VAP_CNTL, 1); ALLOC_STATE( vte, always, 3, "vte", 0 ); - r300->hw.vte.cmd[0] = cmdpacket0(R300_SE_VTE_CNTL, 2); + r300->hw.vte.cmd[0] = cmdpacket0(R300_SE_VTE_CNTL, 2); ALLOC_STATE( unk2134, always, 3, "unk2134", 0 ); - r300->hw.unk2134.cmd[0] = cmdpacket0(0x2134, 2); + r300->hw.unk2134.cmd[0] = cmdpacket0(0x2134, 2); ALLOC_STATE( vap_cntl_status, always, 2, "vap_cntl_status", 0 ); - r300->hw.vap_cntl_status.cmd[0] = cmdpacket0(R300_VAP_CNTL_STATUS, 1); + r300->hw.vap_cntl_status.cmd[0] = cmdpacket0(R300_VAP_CNTL_STATUS, 1); ALLOC_STATE( vir[0], variable, R300_VIR_CMDSIZE, "vir/0", 0 ); - r300->hw.vir[0].cmd[R300_VIR_CMD_0] = cmdpacket0(R300_VAP_INPUT_ROUTE_0_0, 1); + r300->hw.vir[0].cmd[R300_VIR_CMD_0] = cmdpacket0(R300_VAP_INPUT_ROUTE_0_0, 1); ALLOC_STATE( vir[1], variable, R300_VIR_CMDSIZE, "vir/1", 1 ); - r300->hw.vir[1].cmd[R300_VIR_CMD_0] = cmdpacket0(R300_VAP_INPUT_ROUTE_1_0, 1); + r300->hw.vir[1].cmd[R300_VIR_CMD_0] = cmdpacket0(R300_VAP_INPUT_ROUTE_1_0, 1); ALLOC_STATE( vic, always, R300_VIC_CMDSIZE, "vic", 0 ); - r300->hw.vic.cmd[R300_VIC_CMD_0] = cmdpacket0(R300_VAP_INPUT_CNTL_0, 2); + r300->hw.vic.cmd[R300_VIC_CMD_0] = cmdpacket0(R300_VAP_INPUT_CNTL_0, 2); ALLOC_STATE( unk21DC, always, 2, "unk21DC", 0 ); - r300->hw.unk21DC.cmd[0] = cmdpacket0(0x21DC, 1); + r300->hw.unk21DC.cmd[0] = cmdpacket0(0x21DC, 1); ALLOC_STATE( unk221C, always, 2, "unk221C", 0 ); - r300->hw.unk221C.cmd[0] = cmdpacket0(R300_VAP_UNKNOWN_221C, 1); + r300->hw.unk221C.cmd[0] = cmdpacket0(R300_VAP_UNKNOWN_221C, 1); ALLOC_STATE( unk2220, always, 5, "unk2220", 0 ); - r300->hw.unk2220.cmd[0] = cmdpacket0(0x2220, 4); + r300->hw.unk2220.cmd[0] = cmdpacket0(0x2220, 4); ALLOC_STATE( unk2288, always, 2, "unk2288", 0 ); - r300->hw.unk2288.cmd[0] = cmdpacket0(R300_VAP_UNKNOWN_2288, 1); + r300->hw.unk2288.cmd[0] = cmdpacket0(R300_VAP_UNKNOWN_2288, 1); ALLOC_STATE( vof, always, R300_VOF_CMDSIZE, "vof", 0 ); - r300->hw.vof.cmd[R300_VOF_CMD_0] = cmdpacket0(R300_VAP_OUTPUT_VTX_FMT_0, 2); - ALLOC_STATE( pvs, always, R300_PVS_CMDSIZE, "pvs", 0 ); - r300->hw.pvs.cmd[R300_PVS_CMD_0] = cmdpacket0(R300_VAP_PVS_CNTL_1, 3); + r300->hw.vof.cmd[R300_VOF_CMD_0] = cmdpacket0(R300_VAP_OUTPUT_VTX_FMT_0, 2); + + if (has_tcl) { + ALLOC_STATE( pvs, always, R300_PVS_CMDSIZE, "pvs", 0 ); + r300->hw.pvs.cmd[R300_PVS_CMD_0] = cmdpacket0(R300_VAP_PVS_CNTL_1, 3); + } + ALLOC_STATE( gb_enable, always, 2, "gb_enable", 0 ); r300->hw.gb_enable.cmd[0] = cmdpacket0(R300_GB_ENABLE, 1); ALLOC_STATE( gb_misc, always, R300_GB_MISC_CMDSIZE, "gb_misc", 0 ); @@ -407,51 +415,54 @@ void r300InitCmdBuf(r300ContextPtr r300) ALLOC_STATE( zs, always, R300_ZS_CMDSIZE, "zstencil", 0 ); r300->hw.zs.cmd[R300_ZS_CMD_0] = cmdpacket0(R300_RB3D_ZSTENCIL_CNTL_0, 3); ALLOC_STATE( zstencil_format, always, 5, "zstencil_format", 0 ); - r300->hw.zstencil_format.cmd[0] = cmdpacket0(R300_RB3D_ZSTENCIL_FORMAT, 4); + r300->hw.zstencil_format.cmd[0] = cmdpacket0(R300_RB3D_ZSTENCIL_FORMAT, 4); ALLOC_STATE( zb, always, R300_ZB_CMDSIZE, "zb", 0 ); - r300->hw.zb.cmd[R300_ZB_CMD_0] = cmdpacket0(R300_RB3D_DEPTHOFFSET, 2); + r300->hw.zb.cmd[R300_ZB_CMD_0] = cmdpacket0(R300_RB3D_DEPTHOFFSET, 2); ALLOC_STATE( unk4F28, always, 2, "unk4F28", 0 ); - r300->hw.unk4F28.cmd[0] = cmdpacket0(0x4F28, 1); + r300->hw.unk4F28.cmd[0] = cmdpacket0(0x4F28, 1); ALLOC_STATE( unk4F30, always, 3, "unk4F30", 0 ); - r300->hw.unk4F30.cmd[0] = cmdpacket0(0x4F30, 2); + r300->hw.unk4F30.cmd[0] = cmdpacket0(0x4F30, 2); ALLOC_STATE( unk4F44, always, 2, "unk4F44", 0 ); - r300->hw.unk4F44.cmd[0] = cmdpacket0(0x4F44, 1); + r300->hw.unk4F44.cmd[0] = cmdpacket0(0x4F44, 1); ALLOC_STATE( unk4F54, always, 2, "unk4F54", 0 ); - r300->hw.unk4F54.cmd[0] = cmdpacket0(0x4F54, 1); - - ALLOC_STATE( vpi, vpu, R300_VPI_CMDSIZE, "vpi", 0 ); - r300->hw.vpi.cmd[R300_VPI_CMD_0] = cmdvpu(R300_PVS_UPLOAD_PROGRAM, 0); - ALLOC_STATE( vpp, vpu, R300_VPP_CMDSIZE, "vpp", 0 ); - r300->hw.vpp.cmd[R300_VPP_CMD_0] = cmdvpu(R300_PVS_UPLOAD_PARAMETERS, 0); - ALLOC_STATE( vps, vpu, R300_VPS_CMDSIZE, "vps", 0 ); - r300->hw.vps.cmd[R300_VPS_CMD_0] = cmdvpu(R300_PVS_UPLOAD_POINTSIZE, 1); + r300->hw.unk4F54.cmd[0] = cmdpacket0(0x4F54, 1); + + /* VPU only on TCL */ + if (has_tcl) { + ALLOC_STATE( vpi, vpu, R300_VPI_CMDSIZE, "vpi", 0 ); + r300->hw.vpi.cmd[R300_VPI_CMD_0] = cmdvpu(R300_PVS_UPLOAD_PROGRAM, 0); + ALLOC_STATE( vpp, vpu, R300_VPP_CMDSIZE, "vpp", 0 ); + r300->hw.vpp.cmd[R300_VPP_CMD_0] = cmdvpu(R300_PVS_UPLOAD_PARAMETERS, 0); + ALLOC_STATE( vps, vpu, R300_VPS_CMDSIZE, "vps", 0 ); + r300->hw.vps.cmd[R300_VPS_CMD_0] = cmdvpu(R300_PVS_UPLOAD_POINTSIZE, 1); + } /* Textures */ ALLOC_STATE( tex.filter, variable, mtu+1, "tex_filter", 0 ); - r300->hw.tex.filter.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_FILTER_0, 0); + r300->hw.tex.filter.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_FILTER_0, 0); ALLOC_STATE( tex.filter_1, variable, mtu+1, "tex_filter_1", 0 ); - r300->hw.tex.filter_1.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_FILTER1_0, 0); - + r300->hw.tex.filter_1.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_FILTER1_0, 0); + ALLOC_STATE( tex.size, variable, mtu+1, "tex_size", 0 ); - r300->hw.tex.size.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_SIZE_0, 0); + r300->hw.tex.size.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_SIZE_0, 0); ALLOC_STATE( tex.format, variable, mtu+1, "tex_format", 0 ); - r300->hw.tex.format.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_FORMAT_0, 0); + r300->hw.tex.format.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_FORMAT_0, 0); ALLOC_STATE( tex.pitch, variable, mtu+1, "tex_pitch", 0 ); - r300->hw.tex.pitch.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_PITCH_0, 0); - + r300->hw.tex.pitch.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_PITCH_0, 0); + ALLOC_STATE( tex.offset, variable, mtu+1, "tex_offset", 0 ); - r300->hw.tex.offset.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_OFFSET_0, 0); - + r300->hw.tex.offset.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_OFFSET_0, 0); + ALLOC_STATE( tex.chroma_key, variable, mtu+1, "tex_chroma_key", 0 ); - r300->hw.tex.chroma_key.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_CHROMA_KEY_0, 0); - + r300->hw.tex.chroma_key.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_CHROMA_KEY_0, 0); + ALLOC_STATE( tex.border_color, variable, mtu+1, "tex_border_color", 0 ); - r300->hw.tex.border_color.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_BORDER_COLOR_0, 0); - - + r300->hw.tex.border_color.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_BORDER_COLOR_0, 0); + + /* Setup the atom linked list */ make_empty_list(&r300->hw.atomlist); r300->hw.atomlist.name = "atom-list"; @@ -469,7 +480,9 @@ void r300InitCmdBuf(r300ContextPtr r300) insert_at_tail(&r300->hw.atomlist, &r300->hw.unk2220); insert_at_tail(&r300->hw.atomlist, &r300->hw.unk2288); insert_at_tail(&r300->hw.atomlist, &r300->hw.vof); - insert_at_tail(&r300->hw.atomlist, &r300->hw.pvs); + + if (has_tcl) + insert_at_tail(&r300->hw.atomlist, &r300->hw.pvs); insert_at_tail(&r300->hw.atomlist, &r300->hw.gb_enable); insert_at_tail(&r300->hw.atomlist, &r300->hw.gb_misc); insert_at_tail(&r300->hw.atomlist, &r300->hw.txe); @@ -520,9 +533,11 @@ void r300InitCmdBuf(r300ContextPtr r300) insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4F44); insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4F54); - insert_at_tail(&r300->hw.atomlist, &r300->hw.vpi); - insert_at_tail(&r300->hw.atomlist, &r300->hw.vpp); - insert_at_tail(&r300->hw.atomlist, &r300->hw.vps); + if (has_tcl) { + insert_at_tail(&r300->hw.atomlist, &r300->hw.vpi); + insert_at_tail(&r300->hw.atomlist, &r300->hw.vpp); + insert_at_tail(&r300->hw.atomlist, &r300->hw.vps); + } insert_at_tail(&r300->hw.atomlist, &r300->hw.tex.filter); insert_at_tail(&r300->hw.atomlist, &r300->hw.tex.filter_1); diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index 11e2d42e494..41774155213 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -179,8 +179,11 @@ static void r300EmitClearState(GLcontext * ctx) int cmd_reserved = 0; int cmd_written = 0; drm_radeon_cmd_header_t *cmd = NULL; - - + int has_tcl = 1; + + if (!(r300->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) + has_tcl = 0; + R300_STATECHANGE(r300, vir[0]); reg_start(R300_VAP_INPUT_ROUTE_0_0, 0); e32(0x21030003); @@ -279,26 +282,28 @@ static void r300EmitClearState(GLcontext * ctx) reg_start(R300_PFS_INSTR3_0, 0); e32(FP_SELA(0,NO,W,FP_TMP(0),0,0)); - - R300_STATECHANGE(r300, pvs); - reg_start(R300_VAP_PVS_CNTL_1, 2); - e32((0 << R300_PVS_CNTL_1_PROGRAM_START_SHIFT) | - (0 << R300_PVS_CNTL_1_POS_END_SHIFT) | - (1 << R300_PVS_CNTL_1_PROGRAM_END_SHIFT)); - e32(0); - e32(1 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT); - - R300_STATECHANGE(r300, vpi); - vsf_start_fragment(0x0, 8); - e32(VP_OUT(ADD,OUT,0,XYZW)); - e32(VP_IN(IN,0)); - e32(VP_ZERO()); - e32(0); - - e32(VP_OUT(ADD,OUT,1,XYZW)); - e32(VP_IN(IN,1)); - e32(VP_ZERO()); - e32(0); + + if (has_tcl) { + R300_STATECHANGE(r300, pvs); + reg_start(R300_VAP_PVS_CNTL_1, 2); + e32((0 << R300_PVS_CNTL_1_PROGRAM_START_SHIFT) | + (0 << R300_PVS_CNTL_1_POS_END_SHIFT) | + (1 << R300_PVS_CNTL_1_PROGRAM_END_SHIFT)); + e32(0); + e32(1 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT); + + R300_STATECHANGE(r300, vpi); + vsf_start_fragment(0x0, 8); + e32(VP_OUT(ADD,OUT,0,XYZW)); + e32(VP_IN(IN,0)); + e32(VP_ZERO()); + e32(0); + + e32(VP_OUT(ADD,OUT,1,XYZW)); + e32(VP_IN(IN,1)); + e32(VP_ZERO()); + e32(0); + } /*reg_start(0x4500,0); e32(2560-1);*/ diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 870d683f004..b941af19966 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1660,18 +1660,7 @@ void r300SetupVertexShader(r300ContextPtr rmesa) return ; } -/* This needs to be replaced by vertex shader generation code */ - - -#if 0 - /* textures enabled ? */ - if(rmesa->state.texture.tc_count>0){ - rmesa->state.vertex_shader=SINGLE_TEXTURE_VERTEX_SHADER; - } else { - rmesa->state.vertex_shader=FLAT_COLOR_VERTEX_SHADER; - } -#endif - + /* This needs to be replaced by vertex shader generation code */ r300GenerateSimpleVertexShader(rmesa); rmesa->state.vertex_shader.matrix[0].length=16; @@ -1805,7 +1794,8 @@ void r300UpdateShaderStates(r300ContextPtr rmesa) r300SetupPixelShader(rmesa); r300_setup_textures(ctx); - r300SetupVertexShader(rmesa); + if ((rmesa->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) + r300SetupVertexShader(rmesa); r300_setup_rs_unit(ctx); } @@ -1938,6 +1928,10 @@ static void r300InvalidateState(GLcontext * ctx, GLuint new_state) void r300ResetHwState(r300ContextPtr r300) { GLcontext* ctx = r300->radeon.glCtx; + int has_tcl = 1; + + if (!(r300->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) + has_tcl = 0; if (RADEON_DEBUG & DEBUG_STATE) fprintf(stderr, "%s\n", __FUNCTION__); @@ -2005,7 +1999,7 @@ void r300ResetHwState(r300ContextPtr r300) /* Initialize magic registers TODO : learn what they really do, or get rid of those we don't have to touch */ - if (!(r300->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) + if (!has_tcl) r300->hw.vap_cntl.cmd[1] = 0x0014045a; else r300->hw.vap_cntl.cmd[1] = 0x0030045A; //0x0030065a /* Dangerous */ @@ -2026,7 +2020,7 @@ void r300ResetHwState(r300ContextPtr r300) r300->hw.vap_cntl_status.cmd[1] = 0x00000002; /* disable VAP/TCL on non-TCL capable chips */ - if (!(r300->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) + if (!has_tcl) r300->hw.vap_cntl_status.cmd[1] |= R300_VAP_TCL_BYPASS; #if 0 /* Done in setup routing */ @@ -2272,10 +2266,12 @@ void r300ResetHwState(r300ContextPtr r300) r300->hw.vpp.cmd[i] = 0; #endif - r300->hw.vps.cmd[R300_VPS_ZERO_0] = 0; - r300->hw.vps.cmd[R300_VPS_ZERO_1] = 0; - r300->hw.vps.cmd[R300_VPS_POINTSIZE] = r300PackFloat32(1.0); - r300->hw.vps.cmd[R300_VPS_ZERO_3] = 0; + if (has_tcl) { + r300->hw.vps.cmd[R300_VPS_ZERO_0] = 0; + r300->hw.vps.cmd[R300_VPS_ZERO_1] = 0; + 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 fb1d22d23d0f2db518f10e6e1aeaea357de61cd9 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sat, 14 Apr 2007 17:42:59 +1000 Subject: r300: remove unneeded semicolon from macro --- src/mesa/drivers/dri/r300/r300_emit.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h index 1101a3545a0..16ea2c66419 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.h +++ b/src/mesa/drivers/dri/r300/r300_emit.h @@ -162,7 +162,7 @@ static __inline__ uint32_t cmdpacify(void) cmd_written, cmd_reserved); \ exit(-1); \ } \ - } while(0); + } while(0) #define efloat(f) e32(r300PackFloat32(f)) -- cgit v1.2.3 From 8d8a3cc39816168e5f04a668ae184cafe64d4fd2 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sat, 14 Apr 2007 17:44:33 +1000 Subject: r300: emit different clear paths for non-TCL, this gets the clear color correct --- src/mesa/drivers/dri/r300/r300_ioctl.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index 41774155213..90ac9881e8f 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -186,7 +186,10 @@ static void r300EmitClearState(GLcontext * ctx) R300_STATECHANGE(r300, vir[0]); reg_start(R300_VAP_INPUT_ROUTE_0_0, 0); - e32(0x21030003); + if (!has_tcl) + e32(0x22030003); + else + e32(0x21030003); /* disable fog */ R300_STATECHANGE(r300, fogs); @@ -201,7 +204,17 @@ static void r300EmitClearState(GLcontext * ctx) reg_start(R300_VAP_INPUT_CNTL_0, 1); e32(0x00000001); e32(0x00000405); - + + if (!has_tcl) { + /* comes from fglrx startup of clear */ + reg_start(R300_SE_VTE_CNTL, 1); + e32(0x043f); + 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); -- cgit v1.2.3 From e19cfabb6ec091982cc92ec59aa5dedf3cdf2302 Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 14 Apr 2007 07:49:21 -0600 Subject: fix negative zoom factor bug (10636), more comments --- src/mesa/swrast/s_zoom.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c index 1fac7498aa8..0908265fe9d 100644 --- a/src/mesa/swrast/s_zoom.c +++ b/src/mesa/swrast/s_zoom.c @@ -37,8 +37,9 @@ * Compute the bounds of the region resulting from zooming a pixel span. * The resulting region will be entirely inside the window/scissor bounds * so no additional clipping is needed. - * \param imageX, imageY position of the overall image being drawn + * \param imageX, imageY position of the mage being drawn (gl WindowPos) * \param spanX, spanY position of span being drawing + * \param width number of pixels in span * \param x0, x1 returned X bounds of zoomed region [x0, x1) * \param y0, y1 returned Y bounds of zoomed region [y0, y1) * \return GL_TRUE if any zoomed pixels visible, GL_FALSE if totally clipped @@ -98,7 +99,11 @@ compute_zoomed_bounds(GLcontext *ctx, GLint imageX, GLint imageY, /** - * Can use this for unzooming X or Y values. + * Convert a zoomed x image coordinate back to an unzoomed x coord. + * 'zx' is screen position of a pixel in the zoomed image, who's left edge + * is at 'imageX'. + * return corresponding x coord in the original, unzoomed image. + * This can use this for unzooming X or Y values. */ static INLINE GLint unzoom_x(GLfloat zoomX, GLint imageX, GLint zx) @@ -108,7 +113,10 @@ unzoom_x(GLfloat zoomX, GLint imageX, GLint zx) zx - imageX = (x - imageX) * zoomX; (zx - imageX) / zoomX = x - imageX; */ - GLint x = imageX + (GLint) ((zx - imageX) / zoomX); + GLint x; + if (zoomX < 0.0) + zx++; + x = imageX + (GLint) ((zx - imageX) / zoomX); return x; } -- cgit v1.2.3 From 4fc46a6c82419ec379896a9b9992c3cb6721904f Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 14 Apr 2007 08:06:54 -0600 Subject: more _mesa_unreference_framebuffer() calls, remove dead code --- src/mesa/main/context.c | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 59170716f15..2041d26299e 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1450,30 +1450,6 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer, } } -#if 0 /** XXX enable this someday */ - if (oldCtx && oldCtx != newCtx) { - /* unbind old context's draw/read buffers */ - if (oldCtx->DrawBuffer && oldCtx->DrawBuffer->Name == 0) { - oldCtx->DrawBuffer->RefCount--; - oldCtx->DrawBuffer = NULL; - } - if (oldCtx->ReadBuffer && oldCtx->ReadBuffer->Name == 0) { - oldCtx->ReadBuffer->RefCount--; - oldCtx->ReadBuffer = NULL; - } - if (oldCtx->WinSysDrawBuffer) { - ASSERT(oldCtx->WinSysDrawBuffer->Name == 0); - oldCtx->WinSysDrawBuffer->RefCount--; - oldCtx->WinSysDrawBuffer = NULL; - } - if (oldCtx->WinSysReadBuffer) { - ASSERT(oldCtx->WinSysReadBuffer->Name == 0); - oldCtx->WinSysReadBuffer->RefCount--; - oldCtx->WinSysReadBuffer = NULL; - } - } -#endif - /* We used to call _glapi_check_multithread() here. Now do it in drivers */ _glapi_set_context((void *) newCtx); ASSERT(_mesa_get_current_context() == newCtx); @@ -1481,6 +1457,8 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer, if (oldCtx) { _mesa_unreference_framebuffer(&oldCtx->WinSysDrawBuffer); _mesa_unreference_framebuffer(&oldCtx->WinSysReadBuffer); + _mesa_unreference_framebuffer(&oldCtx->DrawBuffer); + _mesa_unreference_framebuffer(&oldCtx->ReadBuffer); } if (!newCtx) { -- cgit v1.2.3 From 216eb81c53908c9ac774a378425691aa66205a88 Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 14 Apr 2007 08:09:12 -0600 Subject: set osmesa renderbuffer refcount=1 upon creation, free renderbuffer in OSMesaDestroyContext() --- src/mesa/drivers/osmesa/osmesa.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index 3d7c8509ba3..ad8b20283ce 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 6.5.3 * - * 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"), @@ -1041,6 +1041,7 @@ new_osmesa_renderbuffer(GLcontext *ctx, GLenum format, GLenum type) const GLuint name = 0; struct gl_renderbuffer *rb = _mesa_new_renderbuffer(ctx, name); if (rb) { + rb->RefCount = 1; rb->Delete = osmesa_delete_renderbuffer; rb->AllocStorage = osmesa_renderbuffer_storage; @@ -1237,6 +1238,7 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, /* create front color buffer in user-provided memory (no back buffer) */ osmesa->rb = new_osmesa_renderbuffer(&osmesa->mesa, format, type); _mesa_add_renderbuffer(osmesa->gl_buffer, BUFFER_FRONT_LEFT, osmesa->rb); + assert(osmesa->rb->RefCount == 2); _mesa_add_soft_renderbuffers(osmesa->gl_buffer, GL_FALSE, /* color */ @@ -1297,6 +1299,9 @@ GLAPI void GLAPIENTRY OSMesaDestroyContext( OSMesaContext osmesa ) { if (osmesa) { + if (osmesa->rb) + _mesa_reference_renderbuffer(&osmesa->rb, NULL); + _swsetup_DestroyContext( &osmesa->mesa ); _tnl_DestroyContext( &osmesa->mesa ); _vbo_DestroyContext( &osmesa->mesa ); -- cgit v1.2.3 From fde15a2bae2f2ca552763705f12d53e4606feabf Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 14 Apr 2007 09:33:20 -0600 Subject: Fix sample_depth_texture() to handle texture rectangle coords. --- src/mesa/swrast/s_texfilter.c | 115 +++++++++++++++++++++++++++++++----------- 1 file changed, 85 insertions(+), 30 deletions(-) diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index b2c5574d95d..5413fc04101 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.2 + * Version: 6.5.3 * - * 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"), @@ -2026,6 +2026,60 @@ sample_lambda_cube( GLcontext *ctx, /* Texture Rectangle Sampling Functions */ /**********************************************************************/ + +/** + * Do clamp/wrap for a texture rectangle coord, GL_NEAREST filter mode. + */ +static INLINE GLint +clamp_rect_coord_nearest(GLenum wrapMode, GLfloat coord, GLint max) +{ + if (wrapMode == GL_CLAMP) { + return IFLOOR( CLAMP(coord, 0.0F, max - 1) ); + } + else if (wrapMode == GL_CLAMP_TO_EDGE) { + return IFLOOR( CLAMP(coord, 0.5F, max - 0.5F) ); + } + else { + return IFLOOR( CLAMP(coord, -0.5F, max + 0.5F) ); + } +} + + +/* + * As above, but GL_LINEAR filtering. + */ +static INLINE void +clamp_rect_coord_linear(GLenum wrapMode, GLfloat coord, GLint max, + GLint *i0out, GLint *i1out) +{ + GLfloat fcol; + GLint i0, i1; + if (wrapMode == GL_CLAMP) { + /* Not exactly what the spec says, but it matches NVIDIA output */ + fcol = CLAMP(coord - 0.5F, 0.0, max-1); + i0 = IFLOOR(fcol); + i1 = i0 + 1; + } + else if (wrapMode == GL_CLAMP_TO_EDGE) { + fcol = CLAMP(coord, 0.5F, max - 0.5F); + fcol -= 0.5F; + i0 = IFLOOR(fcol); + i1 = i0 + 1; + if (i1 > max - 1) + i1 = max - 1; + } + else { + ASSERT(wrapMode == GL_CLAMP_TO_BORDER); + fcol = CLAMP(coord, -0.5F, max + 0.5F); + fcol -= 0.5F; + i0 = IFLOOR(fcol); + i1 = i0 + 1; + } + *i0out = i0; + *i1out = i1; +} + + static void sample_nearest_rect(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, @@ -2050,29 +2104,10 @@ sample_nearest_rect(GLcontext *ctx, tObj->WrapT == GL_CLAMP_TO_BORDER); ASSERT(img->_BaseFormat != GL_COLOR_INDEX); - /* XXX move Wrap mode tests outside of loops for common cases */ for (i = 0; i < n; i++) { GLint row, col; - /* NOTE: we DO NOT use [0, 1] texture coordinates! */ - if (tObj->WrapS == GL_CLAMP) { - col = IFLOOR( CLAMP(texcoords[i][0], 0.0F, width - 1) ); - } - else if (tObj->WrapS == GL_CLAMP_TO_EDGE) { - col = IFLOOR( CLAMP(texcoords[i][0], 0.5F, width - 0.5F) ); - } - else { - col = IFLOOR( CLAMP(texcoords[i][0], -0.5F, width + 0.5F) ); - } - if (tObj->WrapT == GL_CLAMP) { - row = IFLOOR( CLAMP(texcoords[i][1], 0.0F, height - 1) ); - } - else if (tObj->WrapT == GL_CLAMP_TO_EDGE) { - row = IFLOOR( CLAMP(texcoords[i][1], 0.5F, height - 0.5F) ); - } - else { - row = IFLOOR( CLAMP(texcoords[i][1], -0.5F, height + 0.5F) ); - } - + col = clamp_rect_coord_nearest(tObj->WrapS, texcoords[i][0], width); + row = clamp_rect_coord_nearest(tObj->WrapT, texcoords[i][1], height); if (col < 0 || col > width_minus_1 || row < 0 || row > height_minus_1) COPY_CHAN4(rgba[i], tObj->_BorderChan); else @@ -2286,9 +2321,17 @@ sample_depth_texture( GLcontext *ctx, for (i = 0; i < n; i++) { GLfloat depthSample; GLint col, row; - /* XXX fix for texture rectangle! */ - COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapS, texcoords[i][0], width, col); - COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapT, texcoords[i][1], height, row); + + if (tObj->Target == 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 { + COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapS, texcoords[i][0], + width, col); + COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapT, texcoords[i][1], + height, row); + } if (col >= 0 && row >= 0 && col < width && row < height) { img->FetchTexelf(img, col, row, 0, &depthSample); } @@ -2362,9 +2405,18 @@ sample_depth_texture( GLcontext *ctx, GLfloat u, v; GLuint useBorderTexel; - /* XXX fix for texture rectangle! */ - 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); + if (tObj->Target == 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 { + 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); + } useBorderTexel = 0; if (img->Border) { @@ -2727,7 +2779,10 @@ _swrast_choose_texture_sample_func( GLcontext *ctx, return &sample_nearest_cube; } case GL_TEXTURE_RECTANGLE_NV: - if (needLambda) { + if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) { + return &sample_depth_texture; + } + else if (needLambda) { return &sample_lambda_rect; } else if (t->MinFilter == GL_LINEAR) { -- cgit v1.2.3 From 83ad64d94a69c23f6b55ba15c7f031140bff3256 Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 14 Apr 2007 09:36:17 -0600 Subject: implement shadow2DRect functions --- .../shader/slang/library/slang_common_builtin.gc | 9 +- .../shader/slang/library/slang_common_builtin_gc.h | 137 +++++++++++---------- 2 files changed, 72 insertions(+), 74 deletions(-) diff --git a/src/mesa/shader/slang/library/slang_common_builtin.gc b/src/mesa/shader/slang/library/slang_common_builtin.gc index 103bbc4b9d4..ab14408046f 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin.gc +++ b/src/mesa/shader/slang/library/slang_common_builtin.gc @@ -1704,20 +1704,17 @@ vec4 texture2DRectProj(const sampler2DRect sampler, const vec3 coord) vec4 texture2DRectProj(const sampler2DRect sampler, const vec4 coord) { - // do projection here - vec4 pcoord; - pcoord.xy = coord.xy / coord.w; - __asm vec4_texp_rect __retVal, sampler, pcoord; + __asm vec4_texp_rect __retVal, sampler, ccoord; } vec4 shadow2DRect(const sampler2DRectShadow sampler, const vec3 coord) { -// XXX to do + __asm vec4_tex_rect __retVal, sampler, coord; } vec4 shadow2DRectProj(const sampler2DRectShadow sampler, const vec4 coord) { -// XXX to do + __asm vec4_texp_rect __retVal, sampler, coord; } diff --git a/src/mesa/shader/slang/library/slang_common_builtin_gc.h b/src/mesa/shader/slang/library/slang_common_builtin_gc.h index 6ba6969261a..85ab76ab1bc 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin_gc.h +++ b/src/mesa/shader/slang/library/slang_common_builtin_gc.h @@ -720,75 +720,76 @@ 111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,122,0,49,20,0,4,118,101,99,52,95,116,101, 120,112,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0, 18,112,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,82,101,99,116,80,114, -111,106,0,1,1,0,22,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,3,2,0,12,1, -112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59, -120,121,0,18,99,111,111,114,100,0,59,119,0,49,20,0,4,118,101,99,52,95,116,101,120,112,95,114,101, -99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111, -114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,82,101,99,116,0,1,1,0,23,115,97,109,112,108, -101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,0,1,0,12,0,115,104,97,100,111,119,50,68,82,101,99, -116,80,114,111,106,0,1,1,0,23,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,0, -1,0,9,0,110,111,105,115,101,49,0,1,1,0,9,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101, -49,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,1,0,10, -120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,50,0,18,95,95,114,101,116,86,97,108,0,0,18, -120,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,1,0,11,120,0,0,0,1,4,102,108,111,97,116,95,110,111, -105,115,101,51,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,9,0,110,111,105,115,101,49, -0,1,1,0,12,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,52,0,18,95,95,114,101,116,86,97, -108,0,0,18,120,0,0,0,0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114,101, +111,106,0,1,1,0,22,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99, +52,95,116,101,120,112,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108, +101,114,0,0,18,99,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,82,101,99,116,0, +1,1,0,23,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116, +101,120,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0, +18,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,82,101,99,116,80,114,111,106,0, +1,1,0,23,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116, +101,120,112,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0, +0,18,99,111,111,114,100,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,1,0,9,120,0,0,0,1,4,102,108,111, +97,116,95,110,111,105,115,101,49,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,9,0,110, +111,105,115,101,49,0,1,1,0,10,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,50,0,18,95, +95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,1,0,11,120,0,0,0,1, +4,102,108,111,97,116,95,110,111,105,115,101,51,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0, +1,0,9,0,110,111,105,115,101,49,0,1,1,0,12,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101, +52,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,9, +120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0, +20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0, +51,52,0,0,46,0,0,20,0,0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,10,120,0,0,0,1,9,18,95,95,114,101, 116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,0,1,0,10,0, -110,111,105,115,101,50,0,1,1,0,10,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, +97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,57,0,51,52,0,0,0, +17,55,0,54,54,0,0,0,0,46,0,0,20,0,0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,11,120,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51, +52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,0,1,0,10,0,110,111,105,115,101,50,0, +1,1,0,12,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18, +120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58, +118,101,99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0, +0,46,0,0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, +121,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,9,18,95,95,114,101,116, +86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,17,53,0,52,55,0,0,46,0,0,20,0,0,1,0,11,0, +110,111,105,115,101,51,0,1,1,0,10,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, 111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105, 115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0, -0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,11,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120, -0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110, -111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51, -0,50,51,0,0,0,0,46,0,0,20,0,0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,12,120,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,49,57,0,51,52, -0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,0,1,0,11,0,110,111, -105,115,101,51,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105, -115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101, -49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110, -111,105,115,101,49,0,18,120,0,17,53,0,52,55,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1, -1,0,10,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120, +9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50, +0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1,1, +0,11,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0, +0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118, +101,99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95, +95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,53, +0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105, +115,101,51,0,1,1,0,12,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115, +101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0, +18,120,0,58,118,101,99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0, +55,55,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0, +18,120,0,58,118,101,99,52,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17, +49,51,0,49,57,0,0,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0,9,120,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0, +9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,17,53,0,52,55,0,0, +46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120,0,17,50, +51,0,53,52,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0,10,120,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116, +86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,57,0,51,52,0,0, +0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115, +101,49,0,18,120,0,58,118,101,99,50,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,20,0,9,18, +95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17, +50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0, +11,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0, +0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101, +99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,53,0, +52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86, +97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,50,51,0,53,52,0,0,0, +17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1, +1,0,12,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120, 0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118, -101,99,50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,53,0,52,55,0,0,0,17,49, -55,0,56,53,0,0,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1,1,0,11,120,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52, -0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53, -0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1,1,0,12,120,0,0,0, -1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17, -49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17, -53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,20, -0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59, -120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58, -110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,17,53,0,52,55,0,0,46,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120,0,17,50,51,0,53,52,0,0,46,0,0,20,0, -0,1,0,12,0,110,111,105,115,101,52,0,1,1,0,10,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120, -0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110, -111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0, -0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101, -99,50,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108, -0,59,119,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,50,51,0,53,52,0,0,0,17,50,57, -0,49,49,0,0,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0,11,120,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52, -0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53, -0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111, -105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51, -49,0,57,49,0,0,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0,12,120,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,49,57,0,51,52, -0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,53,0,52,55,0,0, -0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,50,51, -0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,17,51,55,0,52,56,0,0,0,0,46,0,0,20,0,0, -0 +101,99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0, +46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58, +118,101,99,52,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57, +0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120, +0,58,118,101,99,52,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,17,51,55, +0,52,56,0,0,0,0,46,0,0,20,0,0,0 -- cgit v1.2.3 From 9519785e298c665f8aafe57a6a1b2d5c5d484a6d Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 14 Apr 2007 09:38:20 -0600 Subject: illegal to set GL_TEXTURE_MAX_LEVEL w/ GL_TEXTURE_RECTANGLE_ARB --- src/mesa/main/texstate.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index bed2c1220a0..51e19b7f4e7 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -1440,11 +1440,11 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) break; case GL_TEXTURE_BASE_LEVEL: if (params[0] < 0.0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); + _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)"); return; } - if (target == GL_TEXTURE_RECTANGLE_NV && params[0] != 0.0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); + if (target == GL_TEXTURE_RECTANGLE_ARB && params[0] != 0.0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)"); return; } FLUSH_VERTICES(ctx, _NEW_TEXTURE); @@ -1452,7 +1452,11 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) break; case GL_TEXTURE_MAX_LEVEL: if (params[0] < 0.0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); + _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)"); + return; + } + if (target == GL_TEXTURE_RECTANGLE_ARB) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameter(param)"); return; } FLUSH_VERTICES(ctx, _NEW_TEXTURE); -- cgit v1.2.3 From da56df9d722a2eb8223434d130436bcb6ea47188 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Mon, 16 Apr 2007 16:04:12 +0200 Subject: Make sure we are locked when creating drm buffer objects. Don't place buffer objects on unfenced list when newly created. Fix a buffer object wait-for-idle deadlock. --- src/mesa/drivers/dri/common/dri_bufmgr.c | 12 +++++++++--- src/mesa/drivers/dri/common/dri_drmpool.c | 2 +- src/mesa/drivers/dri/i915tex/intel_batchpool.c | 2 +- src/mesa/drivers/dri/i915tex/intel_buffer_objects.c | 4 ++++ src/mesa/drivers/dri/i915tex/intel_regions.c | 8 ++++++++ src/mesa/drivers/dri/i915tex/intel_screen.c | 14 ++++++++++++++ 6 files changed, 37 insertions(+), 5 deletions(-) diff --git a/src/mesa/drivers/dri/common/dri_bufmgr.c b/src/mesa/drivers/dri/common/dri_bufmgr.c index 65d65459657..eaa4fb09c70 100644 --- a/src/mesa/drivers/dri/common/dri_bufmgr.c +++ b/src/mesa/drivers/dri/common/dri_bufmgr.c @@ -190,11 +190,16 @@ driBOKernel(struct _DriBufferObject *buf) void driBOWaitIdle(struct _DriBufferObject *buf, int lazy) { - assert(buf->private != NULL); + struct _DriBufferPool *pool; + void *priv; _glthread_LOCK_MUTEX(buf->mutex); - BM_CKFATAL(buf->pool->waitIdle(buf->pool, buf->private, lazy)); + pool = buf->pool; + priv = buf->private; _glthread_UNLOCK_MUTEX(buf->mutex); + + assert(priv != NULL); + BM_CKFATAL(buf->pool->waitIdle(pool, priv, lazy)); } void * @@ -296,7 +301,8 @@ driBOData(struct _DriBufferObject *buf, pool->destroy(pool, buf->private); if (!flags) flags = buf->flags; - buf->private = pool->create(pool, size, flags, 0, buf->alignment); + buf->private = pool->create(pool, size, flags, DRM_BO_HINT_DONT_FENCE, + buf->alignment); if (!buf->private) BM_CKFATAL(-ENOMEM); BM_CKFATAL(pool->map(pool, buf->private, diff --git a/src/mesa/drivers/dri/common/dri_drmpool.c b/src/mesa/drivers/dri/common/dri_drmpool.c index b5b324be500..878a148b397 100644 --- a/src/mesa/drivers/dri/common/dri_drmpool.c +++ b/src/mesa/drivers/dri/common/dri_drmpool.c @@ -185,7 +185,7 @@ pool_setstatic(struct _DriBufferPool *pool, unsigned long offset, return NULL; ret = drmBOCreate(pool->fd, offset, size, 0, NULL, drm_bo_type_fake, - flags, 0, buf); + flags, DRM_BO_HINT_DONT_FENCE, buf); if (ret) { free(buf); diff --git a/src/mesa/drivers/dri/i915tex/intel_batchpool.c b/src/mesa/drivers/dri/i915tex/intel_batchpool.c index 3c17c50204b..2503b8a62a1 100644 --- a/src/mesa/drivers/dri/i915tex/intel_batchpool.c +++ b/src/mesa/drivers/dri/i915tex/intel_batchpool.c @@ -96,7 +96,7 @@ createBPool(int fd, unsigned long bufSize, unsigned numBufs, unsigned flags, _glthread_INIT_MUTEX(p->mutex); if (drmBOCreate(fd, 0, numBufs * bufSize, 0, NULL, drm_bo_type_dc, - flags, 0, &p->kernelBO)) { + flags, DRM_BO_HINT_DONT_FENCE, &p->kernelBO)) { free(p->bufs); free(p); return NULL; diff --git a/src/mesa/drivers/dri/i915tex/intel_buffer_objects.c b/src/mesa/drivers/dri/i915tex/intel_buffer_objects.c index ba3c7f0c1f7..91c45ad95be 100644 --- a/src/mesa/drivers/dri/i915tex/intel_buffer_objects.c +++ b/src/mesa/drivers/dri/i915tex/intel_buffer_objects.c @@ -76,7 +76,9 @@ intel_bufferobj_release_region(struct intel_context *intel, */ driGenBuffers(intel->intelScreen->regionPool, "buffer object", 1, &intel_obj->buffer, 64, 0, 0); + LOCK_HARDWARE(intel); driBOData(intel_obj->buffer, intel_obj->Base.Size, NULL, 0); + UNLOCK_HARDWARE(intel); } /* Break the COW tie to the region. Both the pbo and the region end @@ -137,7 +139,9 @@ intel_bufferobj_data(GLcontext * ctx, if (intel_obj->region) intel_bufferobj_release_region(intel, intel_obj); + LOCK_HARDWARE(intel); driBOData(intel_obj->buffer, size, data, 0); + UNLOCK_HARDWARE(intel); } diff --git a/src/mesa/drivers/dri/i915tex/intel_regions.c b/src/mesa/drivers/dri/i915tex/intel_regions.c index a114bdf8965..7d19bd07d36 100644 --- a/src/mesa/drivers/dri/i915tex/intel_regions.c +++ b/src/mesa/drivers/dri/i915tex/intel_regions.c @@ -90,6 +90,7 @@ intel_region_alloc(intelScreenPrivate *intelScreen, GLuint cpp, GLuint pitch, GLuint height) { struct intel_region *region = calloc(sizeof(*region), 1); + struct intel_context *intel = intelScreenContext(intelScreen); DBG("%s\n", __FUNCTION__); @@ -107,7 +108,9 @@ intel_region_alloc(intelScreenPrivate *intelScreen, 0, #endif 0); + LOCK_HARDWARE(intel); driBOData(region->buffer, pitch * cpp * height, NULL, 0); + UNLOCK_HARDWARE(intel); return region; } @@ -392,6 +395,8 @@ void intel_region_release_pbo(intelScreenPrivate *intelScreen, struct intel_region *region) { + struct intel_context *intel = intelScreenContext(intelScreen); + assert(region->buffer == region->pbo->buffer); region->pbo->region = NULL; region->pbo = NULL; @@ -400,8 +405,11 @@ intel_region_release_pbo(intelScreenPrivate *intelScreen, driGenBuffers(intelScreen->regionPool, "region", 1, ®ion->buffer, 64, 0, 0); + + LOCK_HARDWARE(intel); driBOData(region->buffer, region->cpp * region->pitch * region->height, NULL, 0); + UNLOCK_HARDWARE(intel); } /* Break the COW tie to the pbo. Both the pbo and the region end up diff --git a/src/mesa/drivers/dri/i915tex/intel_screen.c b/src/mesa/drivers/dri/i915tex/intel_screen.c index 9034ee1b223..87a5aeb17c9 100644 --- a/src/mesa/drivers/dri/i915tex/intel_screen.c +++ b/src/mesa/drivers/dri/i915tex/intel_screen.c @@ -878,9 +878,19 @@ __driCreateNewScreen_20050727(__DRInativeDisplay * dpy, int scrn, static const __DRIversion ddx_expected = { 1, 5, 0 }; static const __DRIversion dri_expected = { 4, 0, 0 }; static const __DRIversion drm_expected = { 1, 7, 0 }; + int tmpContextID; + GLuint tmpContext; dri_interface = interface; + if (!(*dri_interface->createContext)(dpy, modes->screen, + modes->fbconfigID, + &tmpContextID, &tmpContext)) { + fprintf(stderr, "Could not create temporary context.\n"); + return NULL; + } + DRM_LIGHT_LOCK(fd, &((drm_sarea_t *)pSAREA)->lock, tmpContext); + if (!driCheckDriDdxDrmVersions2("i915", dri_version, &dri_expected, ddx_version, &ddx_expected, @@ -892,6 +902,10 @@ __driCreateNewScreen_20050727(__DRInativeDisplay * dpy, int scrn, ddx_version, dri_version, drm_version, frame_buffer, pSAREA, fd, internal_api_version, &intelAPI); + + DRM_UNLOCK(fd, &((drm_sarea_t *)pSAREA)->lock, tmpContext); + (void) (*dri_interface->destroyContext)(dpy, modes->screen, tmpContextID); + if (psp != NULL) { I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv; *driver_modes = intelFillInModes(dri_priv->cpp * 8, -- cgit v1.2.3 From e812a2a484660c87383e7e7d8897a9bcf85cf9cc Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 16 Apr 2007 09:11:20 -0600 Subject: use b->display instead of b->xm_visual->display to fix some problems detected w/ valgrind --- src/mesa/drivers/x11/xm_buffer.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c index 10621cb7a15..51d183bb435 100644 --- a/src/mesa/drivers/x11/xm_buffer.c +++ b/src/mesa/drivers/x11/xm_buffer.c @@ -383,18 +383,18 @@ xmesa_delete_framebuffer(struct gl_framebuffer *fb) } if (b->gc) - XMesaFreeGC(b->xm_visual->display, b->gc); + XMesaFreeGC(b->display, b->gc); if (b->cleargc) - XMesaFreeGC(b->xm_visual->display, b->cleargc); + XMesaFreeGC(b->display, b->cleargc); if (b->swapgc) - XMesaFreeGC(b->xm_visual->display, b->swapgc); + XMesaFreeGC(b->display, b->swapgc); - if (b->xm_visual->mesa_visual.doubleBufferMode) { + if (fb->Visual.doubleBufferMode) { /* free back ximage/pixmap/shmregion */ if (b->backxrb->ximage) { #if defined(USE_XSHM) && !defined(XFree86Server) if (b->shm) { - XShmDetach( b->xm_visual->display, &b->shminfo ); + XShmDetach( b->display, &b->shminfo ); XDestroyImage( b->backxrb->ximage ); shmdt( b->shminfo.shmaddr ); } @@ -404,9 +404,9 @@ xmesa_delete_framebuffer(struct gl_framebuffer *fb) b->backxrb->ximage = NULL; } if (b->backxrb->pixmap) { - XMesaFreePixmap( b->xm_visual->display, b->backxrb->pixmap ); + XMesaFreePixmap( b->display, b->backxrb->pixmap ); if (b->xm_visual->hpcr_clear_flag) { - XMesaFreePixmap( b->xm_visual->display, + XMesaFreePixmap( b->display, b->xm_visual->hpcr_clear_pixmap ); XMesaDestroyImage( b->xm_visual->hpcr_clear_ximage ); } -- cgit v1.2.3 From 3dfcd48469b63c601010ea43e0d5e9ea1dc5dfab Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 16 Apr 2007 10:32:48 -0600 Subject: Fix some assertions that could occur when an error was earlier logged. --- src/mesa/shader/slang/slang_emit.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index 0fd99b85d2e..c2f2e85ff14 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -151,6 +151,8 @@ alloc_temp_storage(slang_emit_info *emitInfo, slang_ir_node *n, GLint size) if (!_slang_alloc_temp(emitInfo->vt, n->Store)) { slang_info_log_error(emitInfo->log, "Ran out of registers, too many temporaries"); + _mesa_free(n->Store); + n->Store = NULL; return GL_FALSE; } return GL_TRUE; @@ -895,7 +897,11 @@ emit_tex(slang_emit_info *emitInfo, slang_ir_node *n) /* Child[0] is the sampler (a uniform which'll indicate the texture unit) */ assert(n->Children[0]->Store); + /* Store->Index is the sampler index */ + assert(n->Children[0]->Store->Index >= 0); + /* Store->Size is the texture target */ assert(n->Children[0]->Store->Size >= TEXTURE_1D_INDEX); + assert(n->Children[0]->Store->Size <= TEXTURE_RECT_INDEX); inst->Sampler = n->Children[0]->Store->Index; /* i.e. uniform's index */ inst->TexSrcTarget = n->Children[0]->Store->Size; @@ -913,17 +919,26 @@ emit_move(slang_emit_info *emitInfo, slang_ir_node *n) /* lhs */ emit(emitInfo, n->Children[0]); + if (!n->Children[0]->Store || n->Children[0]->Store->Index < 0) { + /* an error should have been already recorded */ + return NULL; + } /* rhs */ assert(n->Children[1]); inst = emit(emitInfo, n->Children[1]); - if (!n->Children[1]->Store) { - slang_info_log_error(emitInfo->log, "invalid assignment"); + if (!n->Children[1]->Store || n->Children[1]->Store->Index < 0) { + if (!emitInfo->log->text) { + slang_info_log_error(emitInfo->log, "invalid assignment"); + } return NULL; } + assert(n->Children[1]->Store->Index >= 0); + /*assert(n->Children[0]->Store->Size == n->Children[1]->Store->Size);*/ + n->Store = n->Children[0]->Store; #if PEEPHOLE_OPTIMIZATIONS @@ -1567,9 +1582,9 @@ emit(slang_emit_info *emitInfo, slang_ir_node *n) } if (n->Store->Index < 0) { - printf("#### VAR %s not allocated!\n", (char*)n->Var->a_name); + /* probably ran out of registers */ + return NULL; } - assert(n->Store->Index >= 0); assert(n->Store->Size > 0); break; -- cgit v1.2.3 From 64e8088667d000a70beff93e8c300ac0bd261a60 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 16 Apr 2007 10:36:28 -0600 Subject: Use generic program limits instead of NV-specific ones to init program constants. Previously, this limited us to 12 temp regs for vertex programs. Many vertex shaders could exceed that. This forces us to stop using t_vb_arbprogram.c for now because of its particular register indexing scheme. Need to increase bits allocated for register indexing, etc. --- src/mesa/main/context.c | 8 ++++---- src/mesa/tnl/t_vb_arbprogram.c | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 2041d26299e..93442b91aaa 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -805,10 +805,10 @@ _mesa_init_constants(GLcontext *ctx) ctx->Const.VertexProgram.MaxTexInstructions = 0; ctx->Const.VertexProgram.MaxTexIndirections = 0; ctx->Const.VertexProgram.MaxAttribs = MAX_NV_VERTEX_PROGRAM_INPUTS; - ctx->Const.VertexProgram.MaxTemps = MAX_NV_VERTEX_PROGRAM_TEMPS; + ctx->Const.VertexProgram.MaxTemps = MAX_PROGRAM_TEMPS; ctx->Const.VertexProgram.MaxParameters = MAX_NV_VERTEX_PROGRAM_PARAMS; ctx->Const.VertexProgram.MaxLocalParams = MAX_PROGRAM_LOCAL_PARAMS; - ctx->Const.VertexProgram.MaxEnvParams = MAX_NV_VERTEX_PROGRAM_PARAMS; + ctx->Const.VertexProgram.MaxEnvParams = MAX_PROGRAM_ENV_PARAMS; ctx->Const.VertexProgram.MaxAddressRegs = MAX_VERTEX_PROGRAM_ADDRESS_REGS; ctx->Const.VertexProgram.MaxUniformComponents = 4 * MAX_UNIFORMS; init_natives(&ctx->Const.VertexProgram); @@ -820,10 +820,10 @@ _mesa_init_constants(GLcontext *ctx) ctx->Const.FragmentProgram.MaxTexInstructions = MAX_FRAGMENT_PROGRAM_TEX_INSTRUCTIONS; ctx->Const.FragmentProgram.MaxTexIndirections = MAX_FRAGMENT_PROGRAM_TEX_INDIRECTIONS; ctx->Const.FragmentProgram.MaxAttribs = MAX_NV_FRAGMENT_PROGRAM_INPUTS; - ctx->Const.FragmentProgram.MaxTemps = MAX_NV_FRAGMENT_PROGRAM_TEMPS; + ctx->Const.FragmentProgram.MaxTemps = MAX_PROGRAM_TEMPS; ctx->Const.FragmentProgram.MaxParameters = MAX_NV_FRAGMENT_PROGRAM_PARAMS; ctx->Const.FragmentProgram.MaxLocalParams = MAX_PROGRAM_LOCAL_PARAMS; - ctx->Const.FragmentProgram.MaxEnvParams = MAX_NV_FRAGMENT_PROGRAM_PARAMS; + ctx->Const.FragmentProgram.MaxEnvParams = MAX_PROGRAM_ENV_PARAMS; ctx->Const.FragmentProgram.MaxAddressRegs = MAX_FRAGMENT_PROGRAM_ADDRESS_REGS; ctx->Const.FragmentProgram.MaxUniformComponents = 4 * MAX_UNIFORMS; init_natives(&ctx->Const.FragmentProgram); diff --git a/src/mesa/tnl/t_vb_arbprogram.c b/src/mesa/tnl/t_vb_arbprogram.c index 2edb1c5ac4c..58c82cf715a 100644 --- a/src/mesa/tnl/t_vb_arbprogram.c +++ b/src/mesa/tnl/t_vb_arbprogram.c @@ -1477,8 +1477,11 @@ validate_vertex_program( GLcontext *ctx, struct tnl_pipeline_stage *stage ) struct arb_vp_machine *m = ARB_VP_MACHINE(stage); struct gl_vertex_program *program = ctx->VertexProgram._Current; + /* don't use this module since it only handles 12 temp regs */ + /* Need to allocate more bits for register indexes, etc. */ +#define FORCE_OLD 1 #if FORCE_OLD - if (0 &&program) { + if (0) { #else if (program) { #endif -- cgit v1.2.3 From 4b3835dadf37267ad5fba8ffd675e826d3691f9a Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 16 Apr 2007 10:58:30 -0600 Subject: unhook t_vb_arbprogram.c code - it's going away --- src/mesa/tnl/t_pipeline.c | 10 +++------- src/mesa/tnl/t_pipeline.h | 9 ++------- src/mesa/tnl/t_vb_program.c | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/mesa/tnl/t_pipeline.c b/src/mesa/tnl/t_pipeline.c index a50a3f0f2f2..c7188da34aa 100644 --- a/src/mesa/tnl/t_pipeline.c +++ b/src/mesa/tnl/t_pipeline.c @@ -1,9 +1,8 @@ - /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.3 * - * 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"), @@ -204,16 +203,13 @@ const struct tnl_pipeline_stage *_tnl_default_pipeline[] = { &_tnl_texgen_stage, &_tnl_texture_transform_stage, &_tnl_point_attenuation_stage, -#if defined(FEATURE_NV_vertex_program) || defined(FEATURE_ARB_vertex_program) - &_tnl_arb_vertex_program_stage, &_tnl_vertex_program_stage, -#endif &_tnl_render_stage, NULL }; const struct tnl_pipeline_stage *_tnl_vp_pipeline[] = { - &_tnl_arb_vertex_program_stage, + &_tnl_vertex_program_stage, &_tnl_render_stage, NULL }; diff --git a/src/mesa/tnl/t_pipeline.h b/src/mesa/tnl/t_pipeline.h index b987ba4116f..0952854b855 100644 --- a/src/mesa/tnl/t_pipeline.h +++ b/src/mesa/tnl/t_pipeline.h @@ -1,9 +1,8 @@ - /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.3 * - * 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"), @@ -52,11 +51,7 @@ extern const struct tnl_pipeline_stage _tnl_fog_coordinate_stage; extern const struct tnl_pipeline_stage _tnl_texgen_stage; extern const struct tnl_pipeline_stage _tnl_texture_transform_stage; extern const struct tnl_pipeline_stage _tnl_point_attenuation_stage; -extern const struct tnl_pipeline_stage _tnl_arb_vertex_program_stage; extern const struct tnl_pipeline_stage _tnl_vertex_program_stage; -#if FEATURE_ARB_vertex_shader -extern const struct tnl_pipeline_stage _tnl_arb_vertex_shader_stage; -#endif extern const struct tnl_pipeline_stage _tnl_render_stage; /* Shorthand to plug in the default pipeline: diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index 0a959a04af1..260f9d7b1ab 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -44,6 +44,20 @@ +/** + * Called via ctx->Driver.ProgramStringNotify() after a new vertex program + * string has been parsed. + */ +void +_tnl_program_string(GLcontext *ctx, GLenum target, struct gl_program *program) +{ + /* No-op. + * If we had derived anything from the program that was private to this + * stage we'd recompute/validate it here. + */ +} + + /*! * Private storage for the vertex program pipeline stage. */ -- cgit v1.2.3 From aa6992a296a51d8a336b88baf9c2a93e0ba5a812 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 16 Apr 2007 10:59:00 -0600 Subject: remove t_vb_arbprogram.c --- src/mesa/sources | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/mesa/sources b/src/mesa/sources index 73fd58125ad..bdb056f11ec 100644 --- a/src/mesa/sources +++ b/src/mesa/sources @@ -118,8 +118,6 @@ TNL_SOURCES = \ tnl/t_context.c \ tnl/t_pipeline.c \ tnl/t_draw.c \ - tnl/t_vb_arbprogram.c \ - tnl/t_vb_arbprogram_sse.c \ tnl/t_vb_program.c \ tnl/t_vb_render.c \ tnl/t_vb_texgen.c \ -- cgit v1.2.3 From 921b0084198168effa08f688f078249ae29ee6c3 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 16 Apr 2007 11:03:14 -0600 Subject: removed unused t_vb_arbprogram stage --- src/mesa/tnl/t_vb_arbprogram.c | 1617 ------------------------------------ src/mesa/tnl/t_vb_arbprogram.h | 206 ----- src/mesa/tnl/t_vb_arbprogram_sse.c | 1330 ----------------------------- 3 files changed, 3153 deletions(-) delete mode 100644 src/mesa/tnl/t_vb_arbprogram.c delete mode 100644 src/mesa/tnl/t_vb_arbprogram.h delete mode 100644 src/mesa/tnl/t_vb_arbprogram_sse.c diff --git a/src/mesa/tnl/t_vb_arbprogram.c b/src/mesa/tnl/t_vb_arbprogram.c deleted file mode 100644 index 58c82cf715a..00000000000 --- a/src/mesa/tnl/t_vb_arbprogram.c +++ /dev/null @@ -1,1617 +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. - */ - -/** - * \file t_arb_program.c - * Compile vertex programs to an intermediate representation. - * Execute vertex programs over a buffer of vertices. - * \author Keith Whitwell, Brian Paul - */ - -#include "glheader.h" -#include "context.h" -#include "imports.h" -#include "macros.h" -#include "mtypes.h" -#include "arbprogparse.h" -#include "light.h" -#include "program.h" -#include "prog_instruction.h" -#include "prog_parameter.h" -#include "prog_statevars.h" -#include "programopt.h" -#include "math/m_matrix.h" -#include "t_context.h" -#include "t_pipeline.h" -#include "t_vb_arbprogram.h" -#include "tnl.h" - - -#define DISASSEM 0 - - -struct compilation { - GLuint reg_active; - union instruction *csr; -}; - - -#define ARB_VP_MACHINE(stage) ((struct arb_vp_machine *)(stage->privatePtr)) - -#define PUFF(x) ((x)[1] = (x)[2] = (x)[3] = (x)[0]) - - - -/* Lower precision functions for the EXP, LOG and LIT opcodes. The - * LOG2() implementation is probably not accurate enough, and the - * attempted optimization for Exp2 is definitely not accurate - * enough - it discards all of t's fractional bits! - */ -static GLfloat RoughApproxLog2(GLfloat t) -{ - return LOG2(t); -} - -static GLfloat RoughApproxExp2(GLfloat t) -{ -#if 0 - fi_type fi; - fi.i = (GLint) t; - fi.i = (fi.i << 23) + 0x3f800000; - return fi.f; -#else - return (GLfloat) _mesa_pow(2.0, t); -#endif -} - -static GLfloat RoughApproxPower(GLfloat x, GLfloat y) -{ - if (x == 0.0 && y == 0.0) - return 1.0; /* spec requires this */ - else - return RoughApproxExp2(y * RoughApproxLog2(x)); -} - - -/* Higher precision functions for the EX2, LG2 and POW opcodes: - */ -static GLfloat ApproxLog2(GLfloat t) -{ - return (GLfloat) (LOGF(t) * 1.442695F); -} - -static GLfloat ApproxExp2(GLfloat t) -{ - return (GLfloat) _mesa_pow(2.0, t); -} - -static GLfloat ApproxPower(GLfloat x, GLfloat y) -{ - return (GLfloat) _mesa_pow(x, y); -} - - -/** - * Perform a reduced swizzle: - */ -static void do_RSW( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.rsw.dst]; - const GLfloat *arg0 = m->File[op.rsw.file0][op.rsw.idx0]; - const GLuint swz = op.rsw.swz; - const GLuint neg = op.rsw.neg; - GLfloat tmp[4]; - - /* Need a temporary to be correct in the case where result == arg0. - */ - COPY_4V(tmp, arg0); - - result[0] = tmp[GET_SWZ(swz, 0)]; - result[1] = tmp[GET_SWZ(swz, 1)]; - result[2] = tmp[GET_SWZ(swz, 2)]; - result[3] = tmp[GET_SWZ(swz, 3)]; - - if (neg) { - if (neg & 0x1) result[0] = -result[0]; - if (neg & 0x2) result[1] = -result[1]; - if (neg & 0x4) result[2] = -result[2]; - if (neg & 0x8) result[3] = -result[3]; - } -} - -/** - * Perform a full swizzle - */ -static void do_SWZ( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.rsw.dst]; - const GLfloat *arg0 = m->File[op.rsw.file0][op.rsw.idx0]; - const GLuint swz = op.rsw.swz; - const GLuint neg = op.rsw.neg; - GLfloat tmp[6]; - tmp[4] = 0.0; - tmp[5] = 1.0; - - /* Need a temporary to be correct in the case where result == arg0. - */ - COPY_4V(tmp, arg0); - - result[0] = tmp[GET_SWZ(swz, 0)]; - result[1] = tmp[GET_SWZ(swz, 1)]; - result[2] = tmp[GET_SWZ(swz, 2)]; - result[3] = tmp[GET_SWZ(swz, 3)]; - - if (neg) { - if (neg & 0x1) result[0] = -result[0]; - if (neg & 0x2) result[1] = -result[1]; - if (neg & 0x4) result[2] = -result[2]; - if (neg & 0x8) result[3] = -result[3]; - } -} - -/* Used to implement write masking. To make things easier for the sse - * generator I've gone back to a 1 argument version of this function - * (dst.msk = arg), rather than the semantically cleaner (dst = SEL - * arg0, arg1, msk) - * - * That means this is the only instruction which doesn't write a full - * 4 dwords out. This would make such a program harder to analyse, - * but it looks like analysis is going to take place on a higher level - * anyway. - */ -static void do_MSK( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *dst = m->File[0][op.msk.dst]; - const GLfloat *arg = m->File[op.msk.file][op.msk.idx]; - - if (op.msk.mask & WRITEMASK_X) dst[0] = arg[0]; - if (op.msk.mask & WRITEMASK_Y) dst[1] = arg[1]; - if (op.msk.mask & WRITEMASK_Z) dst[2] = arg[2]; - if (op.msk.mask & WRITEMASK_W) dst[3] = arg[3]; -} - - -static void do_PRT( struct arb_vp_machine *m, union instruction op ) -{ - const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - - _mesa_printf("%d: %f %f %f %f\n", m->vtx_nr, - arg0[0], arg0[1], arg0[2], arg0[3]); -} - - -/** - * The traditional ALU and texturing instructions. All operate on - * internal registers and ignore write masks and swizzling issues. - */ - -static void do_ABS( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.alu.dst]; - const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - - result[0] = (arg0[0] < 0.0) ? -arg0[0] : arg0[0]; - result[1] = (arg0[1] < 0.0) ? -arg0[1] : arg0[1]; - result[2] = (arg0[2] < 0.0) ? -arg0[2] : arg0[2]; - result[3] = (arg0[3] < 0.0) ? -arg0[3] : arg0[3]; -} - -static void do_ADD( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.alu.dst]; - const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - const GLfloat *arg1 = m->File[op.alu.file1][op.alu.idx1]; - - result[0] = arg0[0] + arg1[0]; - result[1] = arg0[1] + arg1[1]; - result[2] = arg0[2] + arg1[2]; - result[3] = arg0[3] + arg1[3]; -} - - -static void do_DP3( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.alu.dst]; - const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - const GLfloat *arg1 = m->File[op.alu.file1][op.alu.idx1]; - - result[0] = (arg0[0] * arg1[0] + - arg0[1] * arg1[1] + - arg0[2] * arg1[2]); - - PUFF(result); -} - - - -static void do_DP4( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.alu.dst]; - const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - const GLfloat *arg1 = m->File[op.alu.file1][op.alu.idx1]; - - result[0] = (arg0[0] * arg1[0] + - arg0[1] * arg1[1] + - arg0[2] * arg1[2] + - arg0[3] * arg1[3]); - - PUFF(result); -} - -static void do_DPH( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.alu.dst]; - const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - const GLfloat *arg1 = m->File[op.alu.file1][op.alu.idx1]; - - result[0] = (arg0[0] * arg1[0] + - arg0[1] * arg1[1] + - arg0[2] * arg1[2] + - 1.0 * arg1[3]); - - PUFF(result); -} - -static void do_DST( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.alu.dst]; - const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - const GLfloat *arg1 = m->File[op.alu.file1][op.alu.idx1]; - - /* This should be ok even if result == arg0 or result == arg1. - */ - result[0] = 1.0F; - result[1] = arg0[1] * arg1[1]; - result[2] = arg0[2]; - result[3] = arg1[3]; -} - - -/* Intended to be high precision: - */ -static void do_EX2( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.alu.dst]; - const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - - result[0] = ApproxExp2(arg0[0]); - PUFF(result); -} - - -/* Allowed to be lower precision: - */ -static void do_EXP( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.alu.dst]; - const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - const GLfloat tmp = arg0[0]; - const GLfloat flr_tmp = FLOORF(tmp); - const GLfloat frac_tmp = tmp - flr_tmp; - - result[0] = LDEXPF(1.0, (int)flr_tmp); - result[1] = frac_tmp; - result[2] = RoughApproxExp2(tmp); - result[3] = 1.0F; -} - -static void do_FLR( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.alu.dst]; - const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - - result[0] = FLOORF(arg0[0]); - result[1] = FLOORF(arg0[1]); - result[2] = FLOORF(arg0[2]); - result[3] = FLOORF(arg0[3]); -} - -static void do_FRC( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.alu.dst]; - const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - - result[0] = arg0[0] - FLOORF(arg0[0]); - result[1] = arg0[1] - FLOORF(arg0[1]); - result[2] = arg0[2] - FLOORF(arg0[2]); - result[3] = arg0[3] - FLOORF(arg0[3]); -} - -static void do_INT( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.alu.dst]; - const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - - result[0] = (GLfloat) (GLint) arg0[0]; - result[1] = (GLfloat) (GLint) arg0[1]; - result[2] = (GLfloat) (GLint) arg0[2]; - result[3] = (GLfloat) (GLint) arg0[3]; -} - -/* High precision log base 2: - */ -static void do_LG2( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.alu.dst]; - const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - - result[0] = ApproxLog2(arg0[0]); - PUFF(result); -} - - - -static void do_LIT( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.alu.dst]; - const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - GLfloat tmp[4]; /* use temp in case arg0 == result register */ - - tmp[0] = 1.0; - tmp[1] = arg0[0]; - if (arg0[0] > 0.0) { - tmp[2] = RoughApproxPower(arg0[1], arg0[3]); - } - else { - tmp[2] = 0.0; - } - tmp[3] = 1.0; - - COPY_4V(result, tmp); -} - - -/* Intended to allow a lower precision than required for LG2 above. - */ -static void do_LOG( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.alu.dst]; - const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - const GLfloat tmp = FABSF(arg0[0]); - int exponent; - const GLfloat mantissa = FREXPF(tmp, &exponent); - - result[0] = (GLfloat) (exponent - 1); - result[1] = 2.0 * mantissa; /* map [.5, 1) -> [1, 2) */ - result[2] = exponent + LOG2(mantissa); - result[3] = 1.0; -} - -static void do_MAX( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.alu.dst]; - const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - const GLfloat *arg1 = m->File[op.alu.file1][op.alu.idx1]; - - result[0] = (arg0[0] > arg1[0]) ? arg0[0] : arg1[0]; - result[1] = (arg0[1] > arg1[1]) ? arg0[1] : arg1[1]; - result[2] = (arg0[2] > arg1[2]) ? arg0[2] : arg1[2]; - result[3] = (arg0[3] > arg1[3]) ? arg0[3] : arg1[3]; -} - - -static void do_MIN( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.alu.dst]; - const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - const GLfloat *arg1 = m->File[op.alu.file1][op.alu.idx1]; - - result[0] = (arg0[0] < arg1[0]) ? arg0[0] : arg1[0]; - result[1] = (arg0[1] < arg1[1]) ? arg0[1] : arg1[1]; - result[2] = (arg0[2] < arg1[2]) ? arg0[2] : arg1[2]; - result[3] = (arg0[3] < arg1[3]) ? arg0[3] : arg1[3]; -} - -static void do_MOV( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.alu.dst]; - const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - - result[0] = arg0[0]; - result[1] = arg0[1]; - result[2] = arg0[2]; - result[3] = arg0[3]; -} - -static void do_MUL( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.alu.dst]; - const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - const GLfloat *arg1 = m->File[op.alu.file1][op.alu.idx1]; - - result[0] = arg0[0] * arg1[0]; - result[1] = arg0[1] * arg1[1]; - result[2] = arg0[2] * arg1[2]; - result[3] = arg0[3] * arg1[3]; -} - - -/* Intended to be "high" precision - */ -static void do_POW( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.alu.dst]; - const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - const GLfloat *arg1 = m->File[op.alu.file1][op.alu.idx1]; - - result[0] = (GLfloat)ApproxPower(arg0[0], arg1[0]); - PUFF(result); -} - -static void do_REL( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.alu.dst]; - const GLuint idx = (op.alu.idx0 + (GLint)m->File[0][REG_ADDR][0]) & (MAX_NV_VERTEX_PROGRAM_PARAMS-1); - const GLfloat *arg0 = m->File[op.alu.file0][idx]; - - result[0] = arg0[0]; - result[1] = arg0[1]; - result[2] = arg0[2]; - result[3] = arg0[3]; -} - -static void do_RCP( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.alu.dst]; - const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - - result[0] = 1.0F / arg0[0]; - PUFF(result); -} - -static void do_RSQ( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.alu.dst]; - const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - - result[0] = INV_SQRTF(FABSF(arg0[0])); - PUFF(result); -} - - -static void do_SGE( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.alu.dst]; - const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - const GLfloat *arg1 = m->File[op.alu.file1][op.alu.idx1]; - - result[0] = (arg0[0] >= arg1[0]) ? 1.0F : 0.0F; - result[1] = (arg0[1] >= arg1[1]) ? 1.0F : 0.0F; - result[2] = (arg0[2] >= arg1[2]) ? 1.0F : 0.0F; - result[3] = (arg0[3] >= arg1[3]) ? 1.0F : 0.0F; -} - - -static void do_SLT( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.alu.dst]; - const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - const GLfloat *arg1 = m->File[op.alu.file1][op.alu.idx1]; - - result[0] = (arg0[0] < arg1[0]) ? 1.0F : 0.0F; - result[1] = (arg0[1] < arg1[1]) ? 1.0F : 0.0F; - result[2] = (arg0[2] < arg1[2]) ? 1.0F : 0.0F; - result[3] = (arg0[3] < arg1[3]) ? 1.0F : 0.0F; -} - -static void do_SUB( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.alu.dst]; - const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - const GLfloat *arg1 = m->File[op.alu.file1][op.alu.idx1]; - - result[0] = arg0[0] - arg1[0]; - result[1] = arg0[1] - arg1[1]; - result[2] = arg0[2] - arg1[2]; - result[3] = arg0[3] - arg1[3]; -} - - -static void do_XPD( struct arb_vp_machine *m, union instruction op ) -{ - GLfloat *result = m->File[0][op.alu.dst]; - const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - const GLfloat *arg1 = m->File[op.alu.file1][op.alu.idx1]; - GLfloat tmp[3]; - - tmp[0] = arg0[1] * arg1[2] - arg0[2] * arg1[1]; - tmp[1] = arg0[2] * arg1[0] - arg0[0] * arg1[2]; - tmp[2] = arg0[0] * arg1[1] - arg0[1] * arg1[0]; - - /* Need a temporary to be correct in the case where result == arg0 - * or result == arg1. - */ - result[0] = tmp[0]; - result[1] = tmp[1]; - result[2] = tmp[2]; -} - -static void do_NOP( struct arb_vp_machine *m, union instruction op ) -{ -} - -/* Some useful debugging functions: - */ -static void print_mask( GLuint mask ) -{ - _mesa_printf("."); - if (mask & WRITEMASK_X) _mesa_printf("x"); - if (mask & WRITEMASK_Y) _mesa_printf("y"); - if (mask & WRITEMASK_Z) _mesa_printf("z"); - if (mask & WRITEMASK_W) _mesa_printf("w"); -} - -static void print_reg( GLuint file, GLuint reg ) -{ - static const char *reg_file[] = { - "REG", - "LOCAL_PARAM", - "ENV_PARAM", - "STATE_VAR", - }; - - if (file == 0) { - if (reg == REG_RES) - _mesa_printf("RES"); - else if (reg >= REG_ARG0 && reg <= REG_ARG1) - _mesa_printf("ARG%d", reg - REG_ARG0); - else if (reg >= REG_TMP0 && reg <= REG_TMP11) - _mesa_printf("TMP%d", reg - REG_TMP0); - else if (reg >= REG_IN0 && reg <= REG_IN31) - _mesa_printf("IN%d", reg - REG_IN0); - else if (reg >= REG_OUT0 && reg <= REG_OUT23) - _mesa_printf("OUT%d", reg - REG_OUT0); - else if (reg == REG_ADDR) - _mesa_printf("ADDR"); - else if (reg == REG_ID) - _mesa_printf("ID"); - else - _mesa_printf("REG%d", reg); - } - else - _mesa_printf("%s:%d", reg_file[file], reg); -} - - -static void print_RSW( union instruction op ) -{ - GLuint swz = op.rsw.swz; - GLuint neg = op.rsw.neg; - GLuint i; - - _mesa_printf("RSW "); - print_reg(0, op.rsw.dst); - _mesa_printf(", "); - print_reg(op.rsw.file0, op.rsw.idx0); - _mesa_printf("."); - for (i = 0; i < 4; i++, swz >>= 3) { - const char *cswz = "xyzw01"; - if (neg & (1<>= 3) { - const char *cswz = "xyzw01"; - if (neg & (1< 1) { - _mesa_printf(", "); - print_reg(op.alu.file1, op.alu.idx1); - } - _mesa_printf("\n"); -} - -static void print_MSK( union instruction op ) -{ - _mesa_printf("MSK "); - print_reg(0, op.msk.dst); - print_mask(op.msk.mask); - _mesa_printf(", "); - print_reg(op.msk.file, op.msk.idx); - _mesa_printf("\n"); -} - -static void print_NOP( union instruction op ) -{ -} - -void -_tnl_disassem_vba_insn( union instruction op ) -{ - switch (op.alu.opcode) { - case OPCODE_ABS: - case OPCODE_ADD: - case OPCODE_DP3: - case OPCODE_DP4: - case OPCODE_DPH: - case OPCODE_DST: - case OPCODE_EX2: - case OPCODE_EXP: - case OPCODE_FLR: - case OPCODE_FRC: - case OPCODE_INT: - case OPCODE_LG2: - case OPCODE_LIT: - case OPCODE_LOG: - case OPCODE_MAX: - case OPCODE_MIN: - case OPCODE_MOV: - case OPCODE_MUL: - case OPCODE_POW: - case OPCODE_PRINT: - case OPCODE_RCP: - case OPCODE_RSQ: - case OPCODE_SGE: - case OPCODE_SLT: - case OPCODE_SUB: - case OPCODE_XPD: - print_ALU(op); - break; - case OPCODE_ARA: - case OPCODE_ARL: - case OPCODE_ARL_NV: - case OPCODE_ARR: - case OPCODE_BRA: - case OPCODE_CAL: - case OPCODE_END: - case OPCODE_MAD: - case OPCODE_POPA: - case OPCODE_PUSHA: - case OPCODE_RCC: - case OPCODE_RET: - case OPCODE_SSG: - print_NOP(op); - break; - case OPCODE_SWZ: - print_SWZ(op); - break; - case RSW: - print_RSW(op); - break; - case MSK: - print_MSK(op); - break; - case REL: - print_ALU(op); - break; - default: - _mesa_problem(NULL, "Bad opcode in _tnl_disassem_vba_insn()"); - } -} - -typedef void (*gpu_function)(struct arb_vp_machine *m, union instruction op); - -static gpu_function opcode_func[MAX_OPCODE+3] = -{ - do_NOP, - do_ABS, - do_ADD, - do_NOP,/*ARA*/ - do_NOP,/*ARL*/ - do_NOP,/*ARL_NV*/ - do_NOP,/*ARR*/ - do_NOP,/*BGNLOOP*/ - do_NOP,/*BGNSUB*/ - do_NOP,/*BRA*/ - do_NOP,/*BRK*/ - do_NOP,/*CAL*/ - do_NOP,/*CMP*/ - do_NOP,/*CONT*/ - do_NOP,/*COS*/ - do_NOP,/*DDX*/ - do_NOP,/*DDY*/ - do_DP3, - do_DP4, - do_DPH, - do_DST, - do_NOP,/*ELSE*/ - do_NOP,/*END*/ - do_NOP,/*ENDIF*/ - do_NOP,/*ENDLOOP*/ - do_NOP,/*ENDSUB*/ - do_EX2, - do_EXP, - do_FLR, - do_FRC, - do_NOP,/*IF*/ - do_INT, - do_NOP,/*KIL*/ - do_NOP,/*KIL_NV*/ - do_LG2, - do_LIT, - do_LOG, - do_NOP,/*LRP*/ - do_NOP,/*MAD*/ - do_MAX, - do_MIN, - do_MOV, - do_MUL, - do_NOP,/*NOISE1*/ - do_NOP,/*NOISE2*/ - do_NOP,/*NOISE3*/ - do_NOP,/*NOISE4*/ - do_NOP,/*PK2H*/ - do_NOP,/*PK2US*/ - do_NOP,/*PK4B*/ - do_NOP,/*PK4UB*/ - do_POW, - do_NOP,/*POPA*/ - do_PRT, - do_NOP,/*PUSHA*/ - do_NOP,/*RCC*/ - do_RCP,/*RCP*/ - do_NOP,/*RET*/ - do_NOP,/*RFL*/ - do_RSQ, - do_NOP,/*SCS*/ - do_NOP,/*SEQ*/ - do_NOP,/*SFL*/ - do_SGE, - do_NOP,/*SGT*/ - do_NOP,/*SIN*/ - do_NOP,/*SLE*/ - do_SLT, - do_NOP,/*SNE*/ - do_NOP,/*SSG*/ - do_NOP,/*STR*/ - do_SUB, - do_SWZ,/*SWZ*/ - do_NOP,/*TEX*/ - do_NOP,/*TXB*/ - do_NOP,/*TXD*/ - do_NOP,/*TXL*/ - do_NOP,/*TXP*/ - do_NOP,/*TXP_NV*/ - do_NOP,/*UP2H*/ - do_NOP,/*UP2US*/ - do_NOP,/*UP4B*/ - do_NOP,/*UP4UB*/ - do_NOP,/*X2D*/ - do_XPD, - do_RSW, - do_MSK, - do_REL, -}; - -static union instruction *cvp_next_instruction( struct compilation *cp ) -{ - union instruction *op = cp->csr++; - _mesa_bzero(op, sizeof(*op)); - return op; -} - -static struct reg cvp_make_reg( GLuint file, GLuint idx ) -{ - struct reg reg; - reg.file = file; - reg.idx = idx; - return reg; -} - -static struct reg cvp_emit_rel( struct compilation *cp, - struct reg reg, - struct reg tmpreg ) -{ - union instruction *op = cvp_next_instruction(cp); - op->alu.opcode = REL; - op->alu.file0 = reg.file; - op->alu.idx0 = reg.idx; - op->alu.dst = tmpreg.idx; - return tmpreg; -} - - -static struct reg cvp_load_reg( struct compilation *cp, - GLuint file, - GLuint index, - GLuint rel, - GLuint tmpidx ) -{ - struct reg tmpreg = cvp_make_reg(FILE_REG, tmpidx); - struct reg reg; - - switch (file) { - case PROGRAM_TEMPORARY: - assert(REG_TMP0 + index <= REG_TMP11); - return cvp_make_reg(FILE_REG, REG_TMP0 + index); - - case PROGRAM_INPUT: - return cvp_make_reg(FILE_REG, REG_IN0 + index); - - case PROGRAM_OUTPUT: - return cvp_make_reg(FILE_REG, REG_OUT0 + index); - - /* These two aren't populated by the parser? - */ - case PROGRAM_LOCAL_PARAM: - reg = cvp_make_reg(FILE_LOCAL_PARAM, index); - if (rel) - return cvp_emit_rel(cp, reg, tmpreg); - else - return reg; - - case PROGRAM_ENV_PARAM: - reg = cvp_make_reg(FILE_ENV_PARAM, index); - if (rel) - return cvp_emit_rel(cp, reg, tmpreg); - else - return reg; - - case PROGRAM_STATE_VAR: - case PROGRAM_CONSTANT: - case PROGRAM_UNIFORM: - reg = cvp_make_reg(FILE_STATE_PARAM, index); - if (rel) - return cvp_emit_rel(cp, reg, tmpreg); - else - return reg; - - /* Invalid values: - */ - case PROGRAM_WRITE_ONLY: - case PROGRAM_ADDRESS: - default: - _mesa_problem(NULL, "Invalid register file %d in cvp_load_reg()", file); - assert(0); - return tmpreg; /* can't happen */ - } -} - -static struct reg cvp_emit_arg( struct compilation *cp, - const struct prog_src_register *src, - GLuint arg ) -{ - struct reg reg = cvp_load_reg( cp, src->File, src->Index, src->RelAddr, arg ); - union instruction rsw, noop; - - /* Emit any necessary swizzling. - */ - _mesa_bzero(&rsw, sizeof(rsw)); - rsw.rsw.neg = src->NegateBase ? WRITEMASK_XYZW : 0; - - /* we're expecting 2-bit swizzles below... */ -#if 1 /* XXX THESE ASSERTIONS CURRENTLY FAIL DURING GLEAN TESTS! */ -/* hopefully no longer happens? */ - ASSERT(GET_SWZ(src->Swizzle, 0) < 4); - ASSERT(GET_SWZ(src->Swizzle, 1) < 4); - ASSERT(GET_SWZ(src->Swizzle, 2) < 4); - ASSERT(GET_SWZ(src->Swizzle, 3) < 4); -#endif - rsw.rsw.swz = src->Swizzle; - - _mesa_bzero(&noop, sizeof(noop)); - noop.rsw.neg = 0; - noop.rsw.swz = SWIZZLE_NOOP; - - if (_mesa_memcmp(&rsw, &noop, sizeof(rsw)) !=0) { - union instruction *op = cvp_next_instruction(cp); - struct reg rsw_reg = cvp_make_reg(FILE_REG, REG_ARG0 + arg); - *op = rsw; - op->rsw.opcode = RSW; - op->rsw.file0 = reg.file; - op->rsw.idx0 = reg.idx; - op->rsw.dst = rsw_reg.idx; - return rsw_reg; - } - else - return reg; -} - -static GLuint cvp_choose_result( struct compilation *cp, - const struct prog_dst_register *dst, - union instruction *fixup ) -{ - GLuint mask = dst->WriteMask; - GLuint idx; - - switch (dst->File) { - case PROGRAM_TEMPORARY: - idx = REG_TMP0 + dst->Index; - break; - case PROGRAM_OUTPUT: - idx = REG_OUT0 + dst->Index; - break; - default: -#if 0 - /* IF/ELSE/ENDIF instructions will hit this */ - assert(0); -#endif - return REG_RES; /* can't happen */ - } - - /* Optimization: When writing (with a writemask) to an undefined - * value for the first time, the writemask may be ignored. - */ - if (mask != WRITEMASK_XYZW && (cp->reg_active & (1 << idx))) { - fixup->msk.opcode = MSK; - fixup->msk.dst = idx; - fixup->msk.file = FILE_REG; - fixup->msk.idx = REG_RES; - fixup->msk.mask = mask; - cp->reg_active |= 1 << idx; - return REG_RES; - } - else { - _mesa_bzero(fixup, sizeof(*fixup)); - cp->reg_active |= 1 << idx; - return idx; - } -} - - -static void cvp_emit_inst( struct compilation *cp, - const struct prog_instruction *inst ) -{ - union instruction *op; - union instruction fixup; - struct reg reg[3]; - GLuint result, nr_args, i; - - /* Need to handle SWZ, ARL specially. - */ - switch (inst->Opcode) { - /* Split into mul and add: - */ - case OPCODE_MAD: - result = cvp_choose_result( cp, &inst->DstReg, &fixup ); - for (i = 0; i < 3; i++) - reg[i] = cvp_emit_arg( cp, &inst->SrcReg[i], REG_ARG0+i ); - - op = cvp_next_instruction(cp); - op->alu.opcode = OPCODE_MUL; - op->alu.file0 = reg[0].file; - op->alu.idx0 = reg[0].idx; - op->alu.file1 = reg[1].file; - op->alu.idx1 = reg[1].idx; - op->alu.dst = REG_ARG0; - - op = cvp_next_instruction(cp); - op->alu.opcode = OPCODE_ADD; - op->alu.file0 = FILE_REG; - op->alu.idx0 = REG_ARG0; - op->alu.file1 = reg[2].file; - op->alu.idx1 = reg[2].idx; - op->alu.dst = result; - - if (result == REG_RES) { - op = cvp_next_instruction(cp); - *op = fixup; - } - break; - - case OPCODE_ARL: - reg[0] = cvp_emit_arg( cp, &inst->SrcReg[0], REG_ARG0 ); - - op = cvp_next_instruction(cp); - op->alu.opcode = OPCODE_FLR; - op->alu.dst = REG_ADDR; - op->alu.file0 = reg[0].file; - op->alu.idx0 = reg[0].idx; - break; - - case OPCODE_END: - break; - - case OPCODE_SWZ: - result = cvp_choose_result( cp, &inst->DstReg, &fixup ); - reg[0] = cvp_load_reg( cp, inst->SrcReg[0].File, - inst->SrcReg[0].Index, inst->SrcReg[0].RelAddr, REG_ARG0 ); - op = cvp_next_instruction(cp); - op->rsw.opcode = inst->Opcode; - op->rsw.file0 = reg[0].file; - op->rsw.idx0 = reg[0].idx; - op->rsw.dst = result; - op->rsw.swz = inst->SrcReg[0].Swizzle; - op->rsw.neg = inst->SrcReg[0].NegateBase; - - if (result == REG_RES) { - op = cvp_next_instruction(cp); - *op = fixup; - } - break; - - case OPCODE_NOP: - break; - - case OPCODE_BRA: - /* XXX implement */ - break; - - default: - result = cvp_choose_result( cp, &inst->DstReg, &fixup ); - nr_args = _mesa_num_inst_src_regs(inst->Opcode); - for (i = 0; i < nr_args; i++) - reg[i] = cvp_emit_arg( cp, &inst->SrcReg[i], REG_ARG0 + i ); - - op = cvp_next_instruction(cp); - op->alu.opcode = inst->Opcode; - op->alu.file0 = reg[0].file; - op->alu.idx0 = reg[0].idx; - op->alu.file1 = reg[1].file; - op->alu.idx1 = reg[1].idx; - op->alu.dst = result; - - if (result == REG_RES) { - op = cvp_next_instruction(cp); - *op = fixup; - } - break; - } -} - -static void free_tnl_data( struct gl_vertex_program *program ) -{ - struct tnl_compiled_program *p = (struct tnl_compiled_program *) program->TnlData; - if (p->compiled_func) - _mesa_free((void *)p->compiled_func); - _mesa_free(p); - program->TnlData = NULL; -} - -static void compile_vertex_program( struct gl_vertex_program *program, - GLboolean try_codegen ) -{ - struct compilation cp; - struct tnl_compiled_program *p = CALLOC_STRUCT(tnl_compiled_program); - GLint i; - -#if 1 - if (!program->IsNVProgram && program->IsPositionInvariant) { - printf("Adding MVP code\n"); - if (!program->Base.Parameters) - program->Base.Parameters = _mesa_new_parameter_list(); - _mesa_insert_mvp_code(NULL, program); - program->IsPositionInvariant = 0; - } -#endif - - if (program->TnlData) - free_tnl_data( program ); - - program->TnlData = p; - - /* Initialize cp. Note that ctx and VB aren't used in compilation - * so we don't have to worry about statechanges: - */ - _mesa_memset(&cp, 0, sizeof(cp)); - cp.csr = p->instructions; - - /* Compile instructions: - */ - for (i = 0; i < program->Base.NumInstructions; i++) { - cvp_emit_inst(&cp, &program->Base.Instructions[i]); - } - - /* Finish up: - */ - p->nr_instructions = cp.csr - p->instructions; - - /* Print/disassemble: - */ - if (DISASSEM) { - for (i = 0; i < p->nr_instructions; i++) { - _tnl_disassem_vba_insn(p->instructions[i]); - } - _mesa_printf("\n\n"); - } - -#ifdef USE_SSE_ASM - if (try_codegen) - _tnl_sse_codegen_vertex_program(p); -#endif - -} - - - -/* ---------------------------------------------------------------------- - * Execution - */ -static void userclip( GLcontext *ctx, - GLvector4f *clip, - GLubyte *clipmask, - GLubyte *clipormask, - GLubyte *clipandmask ) -{ - GLuint p; - - for (p = 0; p < ctx->Const.MaxClipPlanes; p++) { - if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { - GLuint nr, i; - const GLfloat a = ctx->Transform._ClipUserPlane[p][0]; - const GLfloat b = ctx->Transform._ClipUserPlane[p][1]; - const GLfloat c = ctx->Transform._ClipUserPlane[p][2]; - const GLfloat d = ctx->Transform._ClipUserPlane[p][3]; - GLfloat *coord = (GLfloat *)clip->data; - GLuint stride = clip->stride; - GLuint count = clip->count; - - for (nr = 0, i = 0 ; i < count ; i++) { - GLfloat dp = (coord[0] * a + - coord[1] * b + - coord[2] * c + - coord[3] * d); - - if (dp < 0) { - nr++; - clipmask[i] |= CLIP_USER_BIT; - } - - STRIDE_F(coord, stride); - } - - if (nr > 0) { - *clipormask |= CLIP_USER_BIT; - if (nr == count) { - *clipandmask |= CLIP_USER_BIT; - return; - } - } - } - } -} - - -static GLboolean -do_ndc_cliptest(GLcontext *ctx, struct arb_vp_machine *m) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = m->VB; - - /* Cliptest and perspective divide. Clip functions must clear - * the clipmask. - */ - m->ormask = 0; - m->andmask = CLIP_FRUSTUM_BITS; - - if (tnl->NeedNdcCoords) { - VB->NdcPtr = - _mesa_clip_tab[VB->ClipPtr->size]( VB->ClipPtr, - &m->ndcCoords, - m->clipmask, - &m->ormask, - &m->andmask ); - } - else { - VB->NdcPtr = NULL; - _mesa_clip_np_tab[VB->ClipPtr->size]( VB->ClipPtr, - NULL, - m->clipmask, - &m->ormask, - &m->andmask ); - } - - if (m->andmask) { - /* All vertices are outside the frustum */ - return GL_FALSE; - } - - /* Test userclip planes. This contributes to VB->ClipMask. - */ - /** XXX NEW_SLANG _Enabled ??? */ - if (ctx->Transform.ClipPlanesEnabled && (!ctx->VertexProgram._Enabled || - ctx->VertexProgram.Current->IsPositionInvariant)) { - userclip( ctx, - VB->ClipPtr, - m->clipmask, - &m->ormask, - &m->andmask ); - - if (m->andmask) { - return GL_FALSE; - } - } - - VB->ClipAndMask = m->andmask; - VB->ClipOrMask = m->ormask; - VB->ClipMask = m->clipmask; - - return GL_TRUE; -} - - -static INLINE void call_func( struct tnl_compiled_program *p, - struct arb_vp_machine *m ) -{ - p->compiled_func(m); -} - - -/** - * Execute the given vertex program. - * - * TODO: Integrate the t_vertex.c code here, to build machine vertices - * directly at this point. - * - * TODO: Eliminate the VB struct entirely and just use - * struct arb_vertex_machine. - */ -static GLboolean -run_arb_vertex_program(GLcontext *ctx, struct tnl_pipeline_stage *stage) -{ - const struct gl_vertex_program *program = ctx->VertexProgram._Current; - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - struct arb_vp_machine *m = ARB_VP_MACHINE(stage); - struct tnl_compiled_program *p; - GLuint i, j; - GLbitfield outputs; - -#define FORCE_PROG_EXECUTE_C 1 -#if FORCE_PROG_EXECUTE_C - return GL_TRUE; -#else - if (!program) - return GL_TRUE; -#endif - - if (program->Base.Parameters) { - _mesa_load_state_parameters(ctx, program->Base.Parameters); - } - - p = (struct tnl_compiled_program *)program->TnlData; - assert(p); - - - m->nr_inputs = m->nr_outputs = 0; - - for (i = 0; i < VERT_ATTRIB_MAX; i++) { - if (program->Base.InputsRead & (1<nr_inputs++; - m->input[j].idx = i; - m->input[j].data = (GLfloat *)m->VB->AttribPtr[i]->data; - m->input[j].stride = m->VB->AttribPtr[i]->stride; - m->input[j].size = m->VB->AttribPtr[i]->size; - ASSIGN_4V(m->File[0][REG_IN0 + i], 0, 0, 0, 1); - } - } - - for (i = 0; i < VERT_RESULT_MAX; i++) { - if (program->Base.OutputsWritten & (1 << i)) { - GLuint j = m->nr_outputs++; - m->output[j].idx = i; - m->output[j].data = (GLfloat *)m->attribs[i].data; - } - } - - - /* Run the actual program: - */ - for (m->vtx_nr = 0; m->vtx_nr < VB->Count; m->vtx_nr++) { - for (j = 0; j < m->nr_inputs; j++) { - GLuint idx = REG_IN0 + m->input[j].idx; - switch (m->input[j].size) { - case 4: m->File[0][idx][3] = m->input[j].data[3]; - case 3: m->File[0][idx][2] = m->input[j].data[2]; - case 2: m->File[0][idx][1] = m->input[j].data[1]; - case 1: m->File[0][idx][0] = m->input[j].data[0]; - } -#if 0 - printf(" attr %d/%d: %g %g %g %g\n", j, idx-REG_IN0, - m->input[j].data[0], - m->input[j].data[1], - m->input[j].data[2], - m->input[j].data[3]); -#endif - STRIDE_F(m->input[j].data, m->input[j].stride); - } - - - if (p->compiled_func) { - call_func( p, m ); - } - else { - GLint pc; - for (pc = 0; pc < p->nr_instructions; pc++) { - union instruction inst = p->instructions[pc]; - opcode_func[inst.alu.opcode]( m, inst ); - } - } - - for (j = 0; j < m->nr_outputs; j++) { - GLuint idx = REG_OUT0 + m->output[j].idx; - m->output[j].data[0] = m->File[0][idx][0]; - m->output[j].data[1] = m->File[0][idx][1]; - m->output[j].data[2] = m->File[0][idx][2]; - m->output[j].data[3] = m->File[0][idx][3]; - m->output[j].data += 4; - } - - } - - /* Setup the VB pointers so that the next pipeline stages get - * their data from the right place (the program output arrays). - * - * TODO: 1) Have tnl use these RESULT values for outputs rather - * than trying to shoe-horn inputs and outputs into one set of - * values. - * - * TODO: 2) Integrate t_vertex.c so that we just go straight ahead - * and build machine vertices here. - */ - - /* XXX There seems to be confusion between using the VERT_ATTRIB_* - * values vs _TNL_ATTRIB_* tokens here: - */ - outputs = program->Base.OutputsWritten; - - if (program->IsPositionInvariant) { - /* We need the exact same transform as in the fixed function path here - to guarantee invariance, depending on compiler optimization flags results - could be different otherwise */ - VB->ClipPtr = TransformRaw( &m->attribs[0], - &ctx->_ModelProjectMatrix, - m->VB->AttribPtr[0] ); - - /* Drivers expect this to be clean to element 4... - */ - switch (VB->ClipPtr->size) { - case 1: - /* impossible */ - case 2: - _mesa_vector4f_clean_elem( VB->ClipPtr, VB->Count, 2 ); - /* fall-through */ - case 3: - _mesa_vector4f_clean_elem( VB->ClipPtr, VB->Count, 3 ); - /* fall-through */ - case 4: - break; - } - } - else { - VB->ClipPtr = &m->attribs[VERT_RESULT_HPOS]; - VB->ClipPtr->count = VB->Count; - } - - if (outputs & (1<ColorPtr[0] = - VB->AttribPtr[VERT_ATTRIB_COLOR0] = &m->attribs[VERT_RESULT_COL0]; - } - - if (outputs & (1<ColorPtr[1] = &m->attribs[VERT_RESULT_BFC0]; - } - - if (outputs & (1<SecondaryColorPtr[0] = - VB->AttribPtr[VERT_ATTRIB_COLOR1] = &m->attribs[VERT_RESULT_COL1]; - } - - if (outputs & (1<SecondaryColorPtr[1] = &m->attribs[VERT_RESULT_BFC1]; - } - - if (outputs & (1<FogCoordPtr = - VB->AttribPtr[VERT_ATTRIB_FOG] = &m->attribs[VERT_RESULT_FOGC]; - } - - if (outputs & (1<AttribPtr[_TNL_ATTRIB_POINTSIZE] = &m->attribs[VERT_RESULT_PSIZ]; - } - - for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { - if (outputs & (1<<(VERT_RESULT_TEX0+i))) { - VB->TexCoordPtr[i] = - VB->AttribPtr[VERT_ATTRIB_TEX0+i] = &m->attribs[VERT_RESULT_TEX0 + i]; - } - } - - for (i = 0; i < ctx->Const.MaxVarying; i++) { - if (outputs & (1 << (VERT_RESULT_VAR0 + i))) { - /* Note: varying results get put into the generic attributes */ - VB->AttribPtr[VERT_ATTRIB_GENERIC0+i] - = &m->attribs[VERT_RESULT_VAR0 + i]; - } - } - -#if 0 - for (i = 0; i < VB->Count; i++) { - printf("Out %d: %f %f %f %f %f %f %f %f\n", i, - VEC_ELT(VB->ClipPtr, GLfloat, i)[0], - VEC_ELT(VB->ClipPtr, GLfloat, i)[1], - VEC_ELT(VB->ClipPtr, GLfloat, i)[2], - VEC_ELT(VB->ClipPtr, GLfloat, i)[3], - VEC_ELT(VB->AttribPtr[VERT_ATTRIB_TEX0], GLfloat, i)[0], - VEC_ELT(VB->AttribPtr[VERT_ATTRIB_TEX0], GLfloat, i)[1], - VEC_ELT(VB->AttribPtr[VERT_ATTRIB_TEX0], GLfloat, i)[2], - VEC_ELT(VB->AttribPtr[VERT_ATTRIB_TEX0], GLfloat, i)[3]); - } -#endif - - /* Perform NDC and cliptest operations: - */ - return do_ndc_cliptest(ctx, m); -} - - -static void -validate_vertex_program( GLcontext *ctx, struct tnl_pipeline_stage *stage ) -{ - struct arb_vp_machine *m = ARB_VP_MACHINE(stage); - struct gl_vertex_program *program = ctx->VertexProgram._Current; - - /* don't use this module since it only handles 12 temp regs */ - /* Need to allocate more bits for register indexes, etc. */ -#define FORCE_OLD 1 -#if FORCE_OLD - if (0) { -#else - if (program) { -#endif - if (!program->TnlData) - compile_vertex_program( program, m->try_codegen ); - - /* Grab the state GL state and put into registers: - */ - m->File[FILE_LOCAL_PARAM] = program->Base.LocalParams; - m->File[FILE_ENV_PARAM] = ctx->VertexProgram.Parameters; - /* GL_NV_vertex_programs can't reference GL state */ - if (program->Base.Parameters) - m->File[FILE_STATE_PARAM] = program->Base.Parameters->ParameterValues; - else - m->File[FILE_STATE_PARAM] = NULL; - } -} - - -/** - * Called the first time stage->run is called. In effect, don't - * allocate data until the first time the stage is run. - */ -static GLboolean init_vertex_program( GLcontext *ctx, - struct tnl_pipeline_stage *stage ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &(tnl->vb); - struct arb_vp_machine *m; - const GLuint size = VB->Size; - GLuint i; - - /* spot checks to be sure the opcode table is correct */ - assert(opcode_func[OPCODE_SGE] == do_SGE); - assert(opcode_func[OPCODE_XPD] == do_XPD); - - stage->privatePtr = _mesa_calloc(sizeof(*m)); - m = ARB_VP_MACHINE(stage); - if (!m) - return GL_FALSE; - - /* arb_vertex_machine struct should subsume the VB: - */ - m->VB = VB; - - m->File[0] = (GLfloat(*)[4])ALIGN_MALLOC(REG_MAX * sizeof(GLfloat) * 4, 16); - - /* Initialize regs where necessary: - */ - ASSIGN_4V(m->File[0][REG_ID], 0, 0, 0, 1); - ASSIGN_4V(m->File[0][REG_ONES], 1, 1, 1, 1); - ASSIGN_4V(m->File[0][REG_SWZ], 1, -1, 0, 0); - ASSIGN_4V(m->File[0][REG_NEG], -1, -1, -1, -1); - ASSIGN_4V(m->File[0][REG_LIT], 1, 0, 0, 1); - ASSIGN_4V(m->File[0][REG_LIT2], 1, .5, .2, 1); /* debug value */ - - if (_mesa_getenv("MESA_EXPERIMENTAL")) - m->try_codegen = GL_TRUE; - - /* Allocate arrays of vertex output values */ - for (i = 0; i < VERT_RESULT_MAX; i++) { - _mesa_vector4f_alloc( &m->attribs[i], 0, size, 32 ); - m->attribs[i].size = 4; - } - - /* a few other misc allocations */ - _mesa_vector4f_alloc( &m->ndcCoords, 0, size, 32 ); - m->clipmask = (GLubyte *) ALIGN_MALLOC(sizeof(GLubyte)*size, 32 ); - - if (ctx->VertexProgram._MaintainTnlProgram) - _mesa_allow_light_in_model( ctx, GL_FALSE ); - - m->fpucntl_rnd_neg = RND_NEG_FPU; /* const value */ - m->fpucntl_restore = RESTORE_FPU; /* const value */ - - return GL_TRUE; -} - - -/** - * Destructor for this pipeline stage. - */ -static void dtr( struct tnl_pipeline_stage *stage ) -{ - struct arb_vp_machine *m = ARB_VP_MACHINE(stage); - - if (m) { - GLuint i; - - /* free the vertex program result arrays */ - for (i = 0; i < VERT_RESULT_MAX; i++) - _mesa_vector4f_free( &m->attribs[i] ); - - /* free misc arrays */ - _mesa_vector4f_free( &m->ndcCoords ); - ALIGN_FREE( m->clipmask ); - ALIGN_FREE( m->File[0] ); - - _mesa_free( m ); - stage->privatePtr = NULL; - } -} - - -/** - * Public description of this pipeline stage. - */ -const struct tnl_pipeline_stage _tnl_arb_vertex_program_stage = -{ - "arb-vertex-program", - NULL, /* private_data */ - init_vertex_program, /* create */ - dtr, /* destroy */ - validate_vertex_program, /* validate */ - run_arb_vertex_program /* run */ -}; - - -/** - * Called via ctx->Driver.ProgramStringNotify() after a new vertex program - * string has been parsed. - */ -void -_tnl_program_string(GLcontext *ctx, GLenum target, struct gl_program *program) -{ - if (target == GL_VERTEX_PROGRAM_ARB) { - /* free any existing tnl data hanging off the program */ - struct gl_vertex_program *vprog = (struct gl_vertex_program *) program; - if (vprog->TnlData) { - free_tnl_data(vprog); - } - } -} diff --git a/src/mesa/tnl/t_vb_arbprogram.h b/src/mesa/tnl/t_vb_arbprogram.h deleted file mode 100644 index 1bec2a411e8..00000000000 --- a/src/mesa/tnl/t_vb_arbprogram.h +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/** - * \file t_arb_program.c - * Compile vertex programs to an intermediate representation. - * Execute vertex programs over a buffer of vertices. - * \author Keith Whitwell, Brian Paul - */ - - -#ifndef _T_VB_ARBPROGRAM_H_ -#define _T_VB_ARBPROGRAM_H_ - - -/* New, internal instructions: - */ -#define RSW (MAX_OPCODE) -#define MSK (MAX_OPCODE+1) -#define REL (MAX_OPCODE+2) - -/** - * Register files for vertex programs - */ -#define FILE_REG 0 /* temporaries */ -#define FILE_LOCAL_PARAM 1 /* local parameters */ -#define FILE_ENV_PARAM 2 /* global parameters */ -#define FILE_STATE_PARAM 3 /* GL state references */ - -#define REG_ARG0 0 -#define REG_ARG1 1 -#define REG_ARG2 2 -#define REG_RES 3 -#define REG_ADDR 4 -#define REG_TMP0 5 -#define REG_TMP11 16 -#define REG_OUT0 17 -#define REG_OUT23 40 -#define REG_IN0 41 -#define REG_IN31 72 -#define REG_ID 73 /* 0,0,0,1 */ -#define REG_ONES 74 /* 1,1,1,1 */ -#define REG_SWZ 75 /* 1,-1,0,0 */ -#define REG_NEG 76 /* -1,-1,-1,-1 */ -#define REG_LIT 77 /* 1,0,0,1 */ -#define REG_LIT2 78 /* 1,0,0,1 */ -#define REG_SCRATCH 79 /* internal temporary. XXX we can't actually use this because 70 doesn't fit in the 5-bit 'dst' instruction field! */ -#define REG_UNDEF 127 /* special case - never used */ -#define REG_MAX 128 -#define REG_INVALID ~0 - - -#if 0 -#define REG_OUT14 31 -#define REG_IN0 32 -#define REG_IN31 63 -#define REG_ID 64 /* 0,0,0,1 */ -#define REG_ONES 65 /* 1,1,1,1 */ -#define REG_SWZ 66 /* 1,-1,0,0 */ -#define REG_NEG 67 /* -1,-1,-1,-1 */ -#define REG_LIT 68 /* 1,0,0,1 */ -#define REG_LIT2 69 /* 1,0,0,1 */ -#define REG_SCRATCH 70 /* internal temporary. XXX we can't actually use this because 70 doesn't fit in the 5-bit 'dst' instruction field! */ -#define REG_UNDEF 127 /* special case - never used */ -#define REG_MAX 128 -#define REG_INVALID ~0 -#endif - -/* ARB_vp instructions are broken down into one or more of the - * following micro-instructions, each representable in a 64 bit packed - * structure. - */ -struct reg { - GLuint file:2; - GLuint idx:8; -}; - - -union instruction { - struct { - GLuint opcode:7; - GLuint dst:6; - GLuint file0:2; - GLuint idx0:8; - GLuint file1:2; - GLuint idx1:7; - GLuint pad:2; - GLuint pad2; - } alu; - - struct { - GLuint opcode:7; - GLuint dst:6; - GLuint file0:2; - GLuint idx0:8; - GLuint neg:4; - GLuint swz:12; /* xyzw01 */ - } rsw; - - struct { - GLuint opcode:7; - GLuint dst:6; - GLuint file:2; - GLuint idx:8; - GLuint mask:4; - GLuint pad:7; - GLuint pad2; - } msk; -}; - - -/** - * Reduced swizzle is a 3-bit field, for simplicity same as normal swizzle, X/Y/Z/W/0/1 allowed. - */ - -struct input { - GLuint idx; - GLfloat *data; - GLuint stride; - GLuint size; -}; - -struct output { - GLuint idx; - GLfloat *data; -}; - - - -/*--------------------------------------------------------------------------- */ -#if defined(USE_SSE_ASM) -#ifdef NO_FAST_MATH -#define RESTORE_FPU (DEFAULT_X86_FPU) -#define RND_NEG_FPU (DEFAULT_X86_FPU | 0x400) -#else -#define RESTORE_FPU (FAST_X86_FPU) -#define RND_NEG_FPU (FAST_X86_FPU | 0x400) -#endif -#else -#define RESTORE_FPU 0 -#define RND_NEG_FPU 0 -#endif - - -/** - * Private storage for the vertex program pipeline stage. - */ -struct arb_vp_machine { - GLfloat (*File[4])[4]; /* All values referencable from the program. */ - - struct input input[VERT_ATTRIB_MAX]; - GLuint nr_inputs; - - struct output output[VERT_RESULT_MAX]; - GLuint nr_outputs; - - GLvector4f attribs[VERT_RESULT_MAX]; /**< result vectors. */ - GLvector4f ndcCoords; /**< normalized device coords */ - GLubyte *clipmask; /**< clip flags */ - GLubyte ormask, andmask; /**< for clipping */ - - GLuint vtx_nr; /**< loop counter */ - - struct vertex_buffer *VB; - - GLshort fpucntl_rnd_neg; /* constant value */ - GLshort fpucntl_restore; /* constant value */ - - GLboolean try_codegen; -}; - -struct tnl_compiled_program { - union instruction instructions[1024]; - GLint nr_instructions; - void (*compiled_func)( struct arb_vp_machine * ); /**< codegen'd program */ -}; - -void _tnl_program_string_change( struct gl_vertex_program * ); -void _tnl_program_destroy( struct gl_vertex_program * ); - -void _tnl_disassem_vba_insn( union instruction op ); - -GLboolean _tnl_sse_codegen_vertex_program(struct tnl_compiled_program *p); - -#endif diff --git a/src/mesa/tnl/t_vb_arbprogram_sse.c b/src/mesa/tnl/t_vb_arbprogram_sse.c deleted file mode 100644 index d0f66fd6196..00000000000 --- a/src/mesa/tnl/t_vb_arbprogram_sse.c +++ /dev/null @@ -1,1330 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.3 - * - * Copyright (C) 1999-2004 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. - */ - -/** - * \file t_vb_arb_program_sse.c - * - * Translate simplified vertex_program representation to - * x86/x87/SSE/SSE2 machine code using mesa's rtasm runtime assembler. - * - * This is very much a first attempt - build something that works. - * There are probably better approaches for applying SSE to vertex - * programs, and the whole thing is crying out for static analysis of - * the programs to avoid redundant operations. - * - * \author Keith Whitwell - */ - -#include "glheader.h" -#include "context.h" -#include "imports.h" -#include "macros.h" -#include "mtypes.h" -#include "arbprogparse.h" -#include "program.h" -#include "prog_instruction.h" -#include "math/m_matrix.h" -#include "math/m_translate.h" -#include "t_context.h" -#include "t_vb_arbprogram.h" - -#if defined(USE_SSE_ASM) - -#include "x86/rtasm/x86sse.h" -#include "x86/common_x86_asm.h" - -#define X 0 -#define Y 1 -#define Z 2 -#define W 3 - -/* Reg usage: - * - * EAX - temp - * EBX - point to 'm->File[0]' - * ECX - point to 'm->File[3]' - * EDX - holds 'm' - * EBP, - * ESI, - * EDI - */ - -#define DISASSEM 0 - -#define FAIL \ -do { \ - _mesa_printf("x86 translation failed in %s\n", __FUNCTION__); \ - return GL_FALSE; \ -} while (0) - -struct compilation { - struct x86_function func; - struct tnl_compiled_program *p; - GLuint insn_counter; - - struct { - GLuint file:2; - GLuint idx:7; - GLuint dirty:1; - GLuint last_used:10; - } xmm[8]; - - struct { - struct x86_reg base; - } file[4]; - - GLboolean have_sse2; - GLshort fpucntl; -}; - -static INLINE GLboolean eq( struct x86_reg a, - struct x86_reg b ) -{ - return (a.file == b.file && - a.idx == b.idx && - a.mod == b.mod && - a.disp == b.disp); -} - -static GLint get_offset( const void *a, const void *b ) -{ - return (const char *)b - (const char *)a; -} - - -static struct x86_reg get_reg_ptr(GLuint file, - GLuint idx ) -{ - struct x86_reg reg; - - switch (file) { - case FILE_REG: - reg = x86_make_reg(file_REG32, reg_BX); - assert(idx != REG_UNDEF); - break; - case FILE_STATE_PARAM: - reg = x86_make_reg(file_REG32, reg_CX); - break; - default: - assert(0); - } - - return x86_make_disp(reg, 16 * idx); -} - - -static void spill( struct compilation *cp, GLuint idx ) -{ - struct x86_reg oldval = get_reg_ptr(cp->xmm[idx].file, - cp->xmm[idx].idx); - - assert(cp->xmm[idx].dirty); - sse_movups(&cp->func, oldval, x86_make_reg(file_XMM, idx)); - cp->xmm[idx].dirty = 0; -} - -static struct x86_reg get_xmm_reg( struct compilation *cp ) -{ - GLuint i; - GLuint oldest = 0; - - for (i = 0; i < 8; i++) - if (cp->xmm[i].last_used < cp->xmm[oldest].last_used) - oldest = i; - - /* Need to write out the old value? - */ - if (cp->xmm[oldest].dirty) - spill(cp, oldest); - - assert(cp->xmm[oldest].last_used != cp->insn_counter); - - cp->xmm[oldest].file = FILE_REG; - cp->xmm[oldest].idx = REG_UNDEF; - cp->xmm[oldest].last_used = cp->insn_counter; - return x86_make_reg(file_XMM, oldest); -} - -static void invalidate_xmm( struct compilation *cp, - GLuint file, GLuint idx ) -{ - GLuint i; - - /* Invalidate any old copy of this register in XMM0-7. - */ - for (i = 0; i < 8; i++) { - if (cp->xmm[i].file == file && cp->xmm[i].idx == idx) { - cp->xmm[i].file = FILE_REG; - cp->xmm[i].idx = REG_UNDEF; - cp->xmm[i].dirty = 0; - break; - } - } -} - - -/* Return an XMM reg to receive the results of an operation. - */ -static struct x86_reg get_dst_xmm_reg( struct compilation *cp, - GLuint file, GLuint idx ) -{ - struct x86_reg reg; - - /* Invalidate any old copy of this register in XMM0-7. Don't reuse - * as this may be one of the arguments. - */ - invalidate_xmm( cp, file, idx ); - - reg = get_xmm_reg( cp ); - cp->xmm[reg.idx].file = file; - cp->xmm[reg.idx].idx = idx; - cp->xmm[reg.idx].dirty = 1; - return reg; -} - -/* As above, but return a pointer. Note - this pointer may alias - * those returned by get_arg_ptr(). - */ -static struct x86_reg get_dst_ptr( struct compilation *cp, - GLuint file, GLuint idx ) -{ - /* Invalidate any old copy of this register in XMM0-7. Don't reuse - * as this may be one of the arguments. - */ - invalidate_xmm( cp, file, idx ); - - return get_reg_ptr(file, idx); -} - - - -/* Return an XMM reg if the argument is resident, otherwise return a - * base+offset pointer to the saved value. - */ -static struct x86_reg get_arg( struct compilation *cp, GLuint file, GLuint idx ) -{ - GLuint i; - - for (i = 0; i < 8; i++) { - if (cp->xmm[i].file == file && - cp->xmm[i].idx == idx) { - cp->xmm[i].last_used = cp->insn_counter; - return x86_make_reg(file_XMM, i); - } - } - - return get_reg_ptr(file, idx); -} - -/* As above, but always return a pointer: - */ -static struct x86_reg get_arg_ptr( struct compilation *cp, GLuint file, GLuint idx ) -{ - GLuint i; - - /* If there is a modified version of this register in one of the - * XMM regs, write it out to memory. - */ - for (i = 0; i < 8; i++) { - if (cp->xmm[i].file == file && - cp->xmm[i].idx == idx && - cp->xmm[i].dirty) - spill(cp, i); - } - - return get_reg_ptr(file, idx); -} - -/* Emulate pshufd insn in regular SSE, if necessary: - */ -static void emit_pshufd( struct compilation *cp, - struct x86_reg dst, - struct x86_reg arg0, - GLubyte shuf ) -{ - if (cp->have_sse2) { - sse2_pshufd(&cp->func, dst, arg0, shuf); - cp->func.fn = 0; - } - else { - if (!eq(dst, arg0)) - sse_movups(&cp->func, dst, arg0); - - sse_shufps(&cp->func, dst, dst, shuf); - } -} - -static void set_fpu_round_neg_inf( struct compilation *cp ) -{ - if (cp->fpucntl != RND_NEG_FPU) { - struct x86_reg regEDX = x86_make_reg(file_REG32, reg_DX); - struct arb_vp_machine *m = NULL; - - cp->fpucntl = RND_NEG_FPU; - x87_fnclex(&cp->func); - x87_fldcw(&cp->func, x86_make_disp(regEDX, get_offset(m, &m->fpucntl_rnd_neg))); - } -} - - -/* Perform a reduced swizzle. - */ -static GLboolean emit_RSW( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg(cp, op.rsw.file0, op.rsw.idx0); - struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.rsw.dst); - GLuint swz = GET_SWZ(op.rsw.swz, 0) | (GET_SWZ(op.rsw.swz, 1) << 2) | - (GET_SWZ(op.rsw.swz, 2) << 4| (GET_SWZ(op.rsw.swz, 3) << 6)); - GLuint neg = op.rsw.neg; - - emit_pshufd(cp, dst, arg0, swz); - - if (neg) { - struct x86_reg negs = get_arg(cp, FILE_REG, REG_SWZ); - struct x86_reg tmp = get_xmm_reg(cp); - /* Load 1,-1,0,0 - * Use neg as arg to pshufd - * Multiply - */ - /* is the emit_pshufd necessary? only SWZ can negate individual components */ - emit_pshufd(cp, tmp, negs, - SHUF((neg & 1) ? 1 : 0, - (neg & 2) ? 1 : 0, - (neg & 4) ? 1 : 0, - (neg & 8) ? 1 : 0)); - sse_mulps(&cp->func, dst, tmp); - } - - return GL_TRUE; -} - -/* Perform a full swizzle - */ -static GLboolean emit_SWZ( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg(cp, op.rsw.file0, op.rsw.idx0); - struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.rsw.dst); - struct x86_reg negs = get_arg(cp, FILE_REG, REG_SWZ); - struct x86_reg tmp = get_xmm_reg(cp); - GLubyte neg = op.rsw.neg; - GLubyte shuf2, swz, savepos, savemask, swizzle[4]; - - swizzle[0] = GET_SWZ(op.rsw.swz, 0); - swizzle[1] = GET_SWZ(op.rsw.swz, 1); - swizzle[2] = GET_SWZ(op.rsw.swz, 2); - swizzle[3] = GET_SWZ(op.rsw.swz, 3); - - swz = SHUF((swizzle[0] & 3), (swizzle[1] & 3), - (swizzle[2] & 3), (swizzle[3] & 3)); - - emit_pshufd(cp, dst, arg0, swz); - - /* can handle negation and replace with zero with the same shuffle/mul */ - shuf2 = SHUF(swizzle[0] == 4 ? 2 : (neg & 1), - swizzle[1] == 4 ? 2 : ((neg & 2) >> 1), - swizzle[2] == 4 ? 2 : ((neg & 4) >> 2), - swizzle[3] == 4 ? 2 : ((neg & 8) >> 3)); - - /* now the hard part is getting those 1's in there... */ - savepos = 0; - savemask = 0; - if (swizzle[0] == 5) savepos = 1; - if (swizzle[1] == 5) savepos = 2; - else savemask |= 1 << 2; - if (swizzle[2] == 5) savepos = 3; - else savemask |= 2 << 4; - if (swizzle[3] == 5) savepos = 4; - else savemask |= 3 << 6; - if (savepos) { - /* need a mov first as movss from memory will overwrite high bits of xmm reg */ - sse_movups(&cp->func, tmp, negs); - /* can only replace lowest 32bits, thus move away that part first */ - emit_pshufd(cp, dst, dst, savemask); - sse_movss(&cp->func, dst, tmp); - emit_pshufd(cp, dst, dst, (savepos - 1) | (savemask & 0xfc)); - } - - if (shuf2) { - /* Load 1,-1,0,0 - * Use neg as arg to pshufd - * Multiply - */ - emit_pshufd(cp, tmp, negs, shuf2); - sse_mulps(&cp->func, dst, tmp); - } - - return GL_TRUE; -} - -/* Helper for writemask: - */ -static GLboolean emit_shuf_copy1( struct compilation *cp, - struct x86_reg dst, - struct x86_reg arg0, - struct x86_reg arg1, - GLubyte shuf ) -{ - struct x86_reg tmp = get_xmm_reg(cp); - sse_movups(&cp->func, dst, arg1); - emit_pshufd(cp, dst, dst, shuf); - emit_pshufd(cp, tmp, arg0, shuf); - - sse_movss(&cp->func, dst, tmp); - - emit_pshufd(cp, dst, dst, shuf); - return GL_TRUE; -} - - -/* Helper for writemask: - */ -static GLboolean emit_shuf_copy2( struct compilation *cp, - struct x86_reg dst, - struct x86_reg arg0, - struct x86_reg arg1, - GLubyte shuf ) -{ - struct x86_reg tmp = get_xmm_reg(cp); - emit_pshufd(cp, dst, arg1, shuf); - emit_pshufd(cp, tmp, arg0, shuf); - - sse_shufps(&cp->func, dst, tmp, SHUF(X, Y, Z, W)); - - emit_pshufd(cp, dst, dst, shuf); - return GL_TRUE; -} - - -static void emit_x87_ex2( struct compilation *cp ) -{ - struct x86_reg st0 = x86_make_reg(file_x87, 0); - struct x86_reg st1 = x86_make_reg(file_x87, 1); - struct x86_reg st3 = x86_make_reg(file_x87, 3); - - set_fpu_round_neg_inf( cp ); - - x87_fld(&cp->func, st0); /* a a */ - x87_fprndint( &cp->func ); /* int(a) a */ - x87_fld(&cp->func, st0); /* int(a) int(a) a */ - x87_fstp(&cp->func, st3); /* int(a) a int(a)*/ - x87_fsubp(&cp->func, st1); /* frac(a) int(a) */ - x87_f2xm1(&cp->func); /* (2^frac(a))-1 int(a)*/ - x87_fld1(&cp->func); /* 1 (2^frac(a))-1 int(a)*/ - x87_faddp(&cp->func, st1); /* 2^frac(a) int(a) */ - x87_fscale(&cp->func); /* 2^a */ -} - -#if 0 -static GLboolean emit_MSK2( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg(cp, op.msk.file, op.msk.arg); - struct x86_reg arg1 = get_arg(cp, FILE_REG, op.msk.dst); /* NOTE! */ - struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.msk.dst); - - /* make full width bitmask in tmp - * dst = ~tmp - * tmp &= arg0 - * dst &= arg1 - * dst |= tmp - */ - emit_pshufd(cp, tmp, get_arg(cp, FILE_REG, REG_NEGS), - SHUF((op.msk.mask & 1) ? 2 : 0, - (op.msk.mask & 2) ? 2 : 0, - (op.msk.mask & 4) ? 2 : 0, - (op.msk.mask & 8) ? 2 : 0)); - sse2_pnot(&cp->func, dst, tmp); - sse2_pand(&cp->func, arg0, tmp); - sse2_pand(&cp->func, arg1, dst); - sse2_por(&cp->func, tmp, dst); - return GL_TRUE; -} -#endif - - -/* Used to implement write masking. This and most of the other instructions - * here would be easier to implement if there had been a translation - * to a 2 argument format (dst/arg0, arg1) at the shader level before - * attempting to translate to x86/sse code. - */ -static GLboolean emit_MSK( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg = get_arg(cp, op.msk.file, op.msk.idx); - struct x86_reg dst0 = get_arg(cp, FILE_REG, op.msk.dst); /* NOTE! */ - struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.msk.dst); - - /* Note that dst and dst0 refer to the same program variable, but - * will definitely be different XMM registers. We're effectively - * treating this as a 2 argument SEL now, just one of which happens - * always to be the same register as the destination. - */ - - switch (op.msk.mask) { - case 0: - sse_movups(&cp->func, dst, dst0); - return GL_TRUE; - - case WRITEMASK_X: - if (arg.file == file_XMM) { - sse_movups(&cp->func, dst, dst0); - sse_movss(&cp->func, dst, arg); - } - else { - struct x86_reg tmp = get_xmm_reg(cp); - sse_movups(&cp->func, dst, dst0); - sse_movss(&cp->func, tmp, arg); - sse_movss(&cp->func, dst, tmp); - } - return GL_TRUE; - - case WRITEMASK_XY: - sse_movups(&cp->func, dst, dst0); - sse_shufps(&cp->func, dst, arg, SHUF(X, Y, Z, W)); - return GL_TRUE; - - case WRITEMASK_ZW: - sse_movups(&cp->func, dst, arg); - sse_shufps(&cp->func, dst, dst0, SHUF(X, Y, Z, W)); - return GL_TRUE; - - case WRITEMASK_YZW: - if (dst0.file == file_XMM) { - sse_movups(&cp->func, dst, arg); - sse_movss(&cp->func, dst, dst0); - } - else { - struct x86_reg tmp = get_xmm_reg(cp); - sse_movups(&cp->func, dst, arg); - sse_movss(&cp->func, tmp, dst0); - sse_movss(&cp->func, dst, tmp); - } - return GL_TRUE; - - case WRITEMASK_Y: - emit_shuf_copy1(cp, dst, arg, dst0, SHUF(Y,X,Z,W)); - return GL_TRUE; - - case WRITEMASK_Z: - emit_shuf_copy1(cp, dst, arg, dst0, SHUF(Z,Y,X,W)); - return GL_TRUE; - - case WRITEMASK_W: - emit_shuf_copy1(cp, dst, arg, dst0, SHUF(W,Y,Z,X)); - return GL_TRUE; - - case WRITEMASK_XZ: - emit_shuf_copy2(cp, dst, arg, dst0, SHUF(X,Z,Y,W)); - return GL_TRUE; - - case WRITEMASK_XW: - emit_shuf_copy2(cp, dst, arg, dst0, SHUF(X,W,Z,Y)); - - case WRITEMASK_YZ: - emit_shuf_copy2(cp, dst, arg, dst0, SHUF(Z,Y,X,W)); - return GL_TRUE; - - case WRITEMASK_YW: - emit_shuf_copy2(cp, dst, arg, dst0, SHUF(W,Y,Z,X)); - return GL_TRUE; - - case WRITEMASK_XZW: - emit_shuf_copy1(cp, dst, dst0, arg, SHUF(Y,X,Z,W)); - return GL_TRUE; - - case WRITEMASK_XYW: - emit_shuf_copy1(cp, dst, dst0, arg, SHUF(Z,Y,X,W)); - return GL_TRUE; - - case WRITEMASK_XYZ: - emit_shuf_copy1(cp, dst, dst0, arg, SHUF(W,Y,Z,X)); - return GL_TRUE; - - case WRITEMASK_XYZW: - sse_movups(&cp->func, dst, arg); - return GL_TRUE; - - default: - assert(0); - break; - } -} - - - -static GLboolean emit_PRT( struct compilation *cp, union instruction op ) -{ - FAIL; -} - - -/** - * The traditional instructions. All operate on internal registers - * and ignore write masks and swizzling issues. - */ - -static GLboolean emit_ABS( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg(cp, op.alu.file0, op.alu.idx0); - struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); - struct x86_reg neg = get_reg_ptr(FILE_REG, REG_NEG); - - sse_movups(&cp->func, dst, arg0); - sse_mulps(&cp->func, dst, neg); - sse_maxps(&cp->func, dst, arg0); - return GL_TRUE; -} - -static GLboolean emit_ADD( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg(cp, op.alu.file0, op.alu.idx0); - struct x86_reg arg1 = get_arg(cp, op.alu.file1, op.alu.idx1); - struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); - - sse_movups(&cp->func, dst, arg0); - sse_addps(&cp->func, dst, arg1); - return GL_TRUE; -} - - -/* The dotproduct instructions don't really do that well in sse: - */ -static GLboolean emit_DP3( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg(cp, op.alu.file0, op.alu.idx0); - struct x86_reg arg1 = get_arg(cp, op.alu.file1, op.alu.idx1); - struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); - struct x86_reg tmp = get_xmm_reg(cp); - - sse_movups(&cp->func, dst, arg0); - sse_mulps(&cp->func, dst, arg1); - - /* Now the hard bit: sum the first 3 values: - */ - sse_movhlps(&cp->func, tmp, dst); - sse_addss(&cp->func, dst, tmp); /* a*x+c*z, b*y, ?, ? */ - emit_pshufd(cp, tmp, dst, SHUF(Y,X,W,Z)); - sse_addss(&cp->func, dst, tmp); - sse_shufps(&cp->func, dst, dst, SHUF(X, X, X, X)); - return GL_TRUE; -} - - - -static GLboolean emit_DP4( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg(cp, op.alu.file0, op.alu.idx0); - struct x86_reg arg1 = get_arg(cp, op.alu.file1, op.alu.idx1); - struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); - struct x86_reg tmp = get_xmm_reg(cp); - - sse_movups(&cp->func, dst, arg0); - sse_mulps(&cp->func, dst, arg1); - - /* Now the hard bit: sum the values: - */ - sse_movhlps(&cp->func, tmp, dst); - sse_addps(&cp->func, dst, tmp); /* a*x+c*z, b*y+d*w, a*x+c*z, b*y+d*w */ - emit_pshufd(cp, tmp, dst, SHUF(Y,X,W,Z)); - sse_addss(&cp->func, dst, tmp); - sse_shufps(&cp->func, dst, dst, SHUF(X, X, X, X)); - return GL_TRUE; -} - -static GLboolean emit_DPH( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg(cp, op.alu.file0, op.alu.idx0); - struct x86_reg arg1 = get_arg(cp, op.alu.file1, op.alu.idx1); - struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); - struct x86_reg tmp = get_xmm_reg(cp); - - sse_movups(&cp->func, dst, arg0); - sse_mulps(&cp->func, dst, arg1); - - /* Now the hard bit: sum the values (from DP3): - */ - sse_movhlps(&cp->func, tmp, dst); - sse_addss(&cp->func, dst, tmp); /* a*x+c*z, b*y, ?, ? */ - emit_pshufd(cp, tmp, dst, SHUF(Y,X,W,Z)); - sse_addss(&cp->func, dst, tmp); - emit_pshufd(cp, tmp, arg1, SHUF(W,W,W,W)); - sse_addss(&cp->func, dst, tmp); - sse_shufps(&cp->func, dst, dst, SHUF(X, X, X, X)); - return GL_TRUE; -} - -#if 0 -static GLboolean emit_DST( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); - struct x86_reg arg1 = get_arg_ptr(cp, op.alu.file1, op.alu.idx1); - struct x86_reg dst = get_dst_ptr(cp, FILE_REG, op.alu.dst); - -/* dst[0] = 1.0 * 1.0F; */ -/* dst[1] = arg0[1] * arg1[1]; */ -/* dst[2] = arg0[2] * 1.0; */ -/* dst[3] = 1.0 * arg1[3]; */ - - /* Would rather do some of this with integer regs, but: - * 1) No proper support for immediate values yet - * 2) I'd need to push/pop somewhere to get a free reg. - */ - x87_fld1(&cp->func); - x87_fstp(&cp->func, dst); /* would rather do an immediate store... */ - x87_fld(&cp->func, x86_make_disp(arg0, 4)); - x87_fmul(&cp->func, x86_make_disp(arg1, 4)); - x87_fstp(&cp->func, x86_make_disp(dst, 4)); - - if (!eq(arg0, dst)) { - x86_fld(&cp->func, x86_make_disp(arg0, 8)); - x86_stp(&cp->func, x86_make_disp(dst, 8)); - } - - if (!eq(arg1, dst)) { - x86_fld(&cp->func, x86_make_disp(arg0, 12)); - x86_stp(&cp->func, x86_make_disp(dst, 12)); - } - - return GL_TRUE; -} -#else -static GLboolean emit_DST( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg(cp, op.alu.file0, op.alu.idx0); - struct x86_reg arg1 = get_arg(cp, op.alu.file1, op.alu.idx1); - struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); - struct x86_reg tmp = get_xmm_reg(cp); - struct x86_reg ones = get_reg_ptr(FILE_REG, REG_ONES); - - emit_shuf_copy2(cp, dst, arg0, ones, SHUF(X,W,Z,Y)); - emit_shuf_copy2(cp, tmp, arg1, ones, SHUF(X,Z,Y,W)); - sse_mulps(&cp->func, dst, tmp); - -/* dst[0] = 1.0 * 1.0F; */ -/* dst[1] = arg0[1] * arg1[1]; */ -/* dst[2] = arg0[2] * 1.0; */ -/* dst[3] = 1.0 * arg1[3]; */ - - return GL_TRUE; -} -#endif - -static GLboolean emit_LG2( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); - struct x86_reg dst = get_dst_ptr(cp, FILE_REG, op.alu.dst); - - x87_fld1(&cp->func); /* 1 */ - x87_fld(&cp->func, arg0); /* a0 1 */ - x87_fyl2x(&cp->func); /* log2(a0) */ - x87_fst(&cp->func, x86_make_disp(dst, 0)); - x87_fst(&cp->func, x86_make_disp(dst, 4)); - x87_fst(&cp->func, x86_make_disp(dst, 8)); - x87_fstp(&cp->func, x86_make_disp(dst, 12)); - - return GL_TRUE; -} - - -static GLboolean emit_EX2( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); - struct x86_reg dst = get_dst_ptr(cp, FILE_REG, op.alu.dst); - - /* CAUTION: dst may alias arg0! - */ - x87_fld(&cp->func, arg0); - - emit_x87_ex2(cp); - - x87_fst(&cp->func, x86_make_disp(dst, 0)); - x87_fst(&cp->func, x86_make_disp(dst, 4)); - x87_fst(&cp->func, x86_make_disp(dst, 8)); - x87_fst(&cp->func, x86_make_disp(dst, 12)); - return GL_TRUE; -} - -static GLboolean emit_EXP( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); - struct x86_reg dst = get_dst_ptr(cp, FILE_REG, op.alu.dst); - struct x86_reg st0 = x86_make_reg(file_x87, 0); - struct x86_reg st1 = x86_make_reg(file_x87, 1); - struct x86_reg st3 = x86_make_reg(file_x87, 3); - - /* CAUTION: dst may alias arg0! - */ - x87_fld(&cp->func, arg0); /* arg0.x */ - x87_fld(&cp->func, st0); /* arg arg */ - - /* by default, fpu is setup to round-to-nearest. We want to - * change this now, and track the state through to the end of the - * generated function so that it isn't repeated unnecessarily. - * Alternately, could subtract .5 to get round to -inf behaviour. - */ - set_fpu_round_neg_inf( cp ); - x87_fprndint( &cp->func ); /* flr(a) a */ - x87_fld(&cp->func, st0); /* flr(a) flr(a) a */ - x87_fld1(&cp->func); /* 1 floor(a) floor(a) a */ - x87_fst(&cp->func, x86_make_disp(dst, 12)); /* stack unchanged */ - x87_fscale(&cp->func); /* 2^floor(a) floor(a) a */ - x87_fst(&cp->func, st3); /* 2^floor(a) floor(a) a 2^floor(a)*/ - x87_fstp(&cp->func, x86_make_disp(dst, 0)); /* flr(a) a 2^flr(a) */ - x87_fsubrp(&cp->func, st1); /* frac(a) 2^flr(a) */ - x87_fst(&cp->func, x86_make_disp(dst, 4)); /* frac(a) 2^flr(a) */ - x87_f2xm1(&cp->func); /* (2^frac(a))-1 2^flr(a)*/ - x87_fld1(&cp->func); /* 1 (2^frac(a))-1 2^flr(a)*/ - x87_faddp(&cp->func, st1); /* 2^frac(a) 2^flr(a) */ - x87_fmulp(&cp->func, st1); /* 2^a */ - x87_fst(&cp->func, x86_make_disp(dst, 8)); - - - -/* dst[0] = 2^floor(tmp); */ -/* dst[1] = frac(tmp); */ -/* dst[2] = 2^floor(tmp) * 2^frac(tmp); */ -/* dst[3] = 1.0F; */ - return GL_TRUE; -} - -static GLboolean emit_LOG( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); - struct x86_reg dst = get_dst_ptr(cp, FILE_REG, op.alu.dst); - struct x86_reg st0 = x86_make_reg(file_x87, 0); - struct x86_reg st1 = x86_make_reg(file_x87, 1); - struct x86_reg st2 = x86_make_reg(file_x87, 2); - - /* CAUTION: dst may alias arg0! - */ - x87_fld(&cp->func, arg0); /* arg0.x */ - x87_fabs(&cp->func); /* |arg0.x| */ - x87_fxtract(&cp->func); /* mantissa(arg0.x), exponent(arg0.x) */ - x87_fst(&cp->func, st2); /* mantissa, exponent, mantissa */ - x87_fld1(&cp->func); /* 1, mantissa, exponent, mantissa */ - x87_fyl2x(&cp->func); /* log2(mantissa), exponent, mantissa */ - x87_fadd(&cp->func, st0, st1); /* e+l2(m), e, m */ - x87_fstp(&cp->func, x86_make_disp(dst, 8)); /* e, m */ - - x87_fld1(&cp->func); /* 1, e, m */ - x87_fsub(&cp->func, st1, st0); /* 1, e-1, m */ - x87_fstp(&cp->func, x86_make_disp(dst, 12)); /* e-1,m */ - x87_fstp(&cp->func, dst); /* m */ - - x87_fadd(&cp->func, st0, st0); /* 2m */ - x87_fstp(&cp->func, x86_make_disp(dst, 4)); - - return GL_TRUE; -} - -static GLboolean emit_FLR( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); - struct x86_reg dst = get_dst_ptr(cp, FILE_REG, op.alu.dst); - int i; - - set_fpu_round_neg_inf( cp ); - - for (i = 0; i < 4; i++) { - x87_fld(&cp->func, x86_make_disp(arg0, i*4)); - x87_fprndint( &cp->func ); - x87_fstp(&cp->func, x86_make_disp(dst, i*4)); - } - - - return GL_TRUE; -} - -static GLboolean emit_FRC( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); - struct x86_reg dst = get_dst_ptr(cp, FILE_REG, op.alu.dst); - struct x86_reg st0 = x86_make_reg(file_x87, 0); - struct x86_reg st1 = x86_make_reg(file_x87, 1); - int i; - - set_fpu_round_neg_inf( cp ); - - /* Knowing liveness info or even just writemask would be useful - * here: - */ - for (i = 0; i < 4; i++) { - x87_fld(&cp->func, x86_make_disp(arg0, i*4)); - x87_fld(&cp->func, st0); /* a a */ - x87_fprndint( &cp->func ); /* flr(a) a */ - x87_fsubrp(&cp->func, st1); /* frc(a) */ - x87_fstp(&cp->func, x86_make_disp(dst, i*4)); - } - - return GL_TRUE; -} - - - -static GLboolean emit_LIT( struct compilation *cp, union instruction op ) -{ -#if 1 - struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); - struct x86_reg dst = get_dst_ptr(cp, FILE_REG, op.alu.dst); - struct x86_reg lit = get_arg(cp, FILE_REG, REG_LIT); - struct x86_reg tmp = get_xmm_reg(cp); - struct x86_reg st1 = x86_make_reg(file_x87, 1); - struct x86_reg regEAX = x86_make_reg(file_REG32, reg_AX); - GLubyte *fixup1, *fixup2; - - - /* Load the interesting parts of arg0: - */ - x87_fld(&cp->func, x86_make_disp(arg0, 12)); /* a3 */ - x87_fld(&cp->func, x86_make_disp(arg0, 4)); /* a1 a3 */ - x87_fld(&cp->func, x86_make_disp(arg0, 0)); /* a0 a1 a3 */ - - /* Intialize dst: - */ - sse_movaps(&cp->func, tmp, lit); - sse_movaps(&cp->func, dst, tmp); - - /* Check arg0[0]: - */ - x87_fldz(&cp->func); /* 0 a0 a1 a3 */ - x87_fucomp(&cp->func, st1); /* a0 a1 a3 */ - x87_fnstsw(&cp->func, regEAX); - x86_sahf(&cp->func); - fixup1 = x86_jcc_forward(&cp->func, cc_AE); - - x87_fstp(&cp->func, x86_make_disp(dst, 4)); /* a1 a3 */ - - /* Check arg0[1]: - */ - x87_fldz(&cp->func); /* 0 a1 a3 */ - x87_fucomp(&cp->func, st1); /* a1 a3 */ - x87_fnstsw(&cp->func, regEAX); - x86_sahf(&cp->func); - fixup2 = x86_jcc_forward(&cp->func, cc_AE); - - /* Compute pow(a1, a3) - */ - x87_fyl2x(&cp->func); /* a3*log2(a1) */ - - emit_x87_ex2( cp ); /* 2^(a3*log2(a1)) */ - - x87_fstp(&cp->func, x86_make_disp(dst, 8)); - - /* Land jumps: - */ - x86_fixup_fwd_jump(&cp->func, fixup1); - x86_fixup_fwd_jump(&cp->func, fixup2); -#else - struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); - struct x86_reg ones = get_reg_ptr(FILE_REG, REG_LIT); - sse_movups(&cp->func, dst, ones); -#endif - return GL_TRUE; -} - - - -static GLboolean emit_MAX( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg(cp, op.alu.file0, op.alu.idx0); - struct x86_reg arg1 = get_arg(cp, op.alu.file1, op.alu.idx1); - struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); - - sse_movups(&cp->func, dst, arg0); - sse_maxps(&cp->func, dst, arg1); - return GL_TRUE; -} - - -static GLboolean emit_MIN( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg(cp, op.alu.file0, op.alu.idx0); - struct x86_reg arg1 = get_arg(cp, op.alu.file1, op.alu.idx1); - struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); - - sse_movups(&cp->func, dst, arg0); - sse_minps(&cp->func, dst, arg1); - return GL_TRUE; -} - -static GLboolean emit_MOV( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg(cp, op.alu.file0, op.alu.idx0); - struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); - - sse_movups(&cp->func, dst, arg0); - return GL_TRUE; -} - -static GLboolean emit_MUL( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg(cp, op.alu.file0, op.alu.idx0); - struct x86_reg arg1 = get_arg(cp, op.alu.file1, op.alu.idx1); - struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); - - sse_movups(&cp->func, dst, arg0); - sse_mulps(&cp->func, dst, arg1); - return GL_TRUE; -} - - -static GLboolean emit_POW( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); - struct x86_reg arg1 = get_arg_ptr(cp, op.alu.file1, op.alu.idx1); - struct x86_reg dst = get_dst_ptr(cp, FILE_REG, op.alu.dst); - - x87_fld(&cp->func, arg1); /* a1 */ - x87_fld(&cp->func, arg0); /* a0 a1 */ - x87_fyl2x(&cp->func); /* a1*log2(a0) */ - - emit_x87_ex2( cp ); /* 2^(a1*log2(a0)) */ - - x87_fst(&cp->func, x86_make_disp(dst, 0)); - x87_fst(&cp->func, x86_make_disp(dst, 4)); - x87_fst(&cp->func, x86_make_disp(dst, 8)); - x87_fstp(&cp->func, x86_make_disp(dst, 12)); - - return GL_TRUE; -} - -static GLboolean emit_REL( struct compilation *cp, union instruction op ) -{ -/* GLuint idx = (op.alu.idx0 + (GLint)cp->File[0][REG_ADDR][0]) & (MAX_NV_VERTEX_PROGRAM_PARAMS-1); */ -/* GLuint idx = 0; */ -/* struct x86_reg arg0 = get_arg(cp, op.alu.file0, idx); */ -/* struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); */ - -/* dst[0] = arg0[0]; */ -/* dst[1] = arg0[1]; */ -/* dst[2] = arg0[2]; */ -/* dst[3] = arg0[3]; */ - - FAIL; -} - -static GLboolean emit_RCP( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg(cp, op.alu.file0, op.alu.idx0); - struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); - - if (cp->have_sse2) { - sse2_rcpss(&cp->func, dst, arg0); - } - else { - struct x86_reg ones = get_reg_ptr(FILE_REG, REG_ONES); - sse_movss(&cp->func, dst, ones); - sse_divss(&cp->func, dst, arg0); - } - - sse_shufps(&cp->func, dst, dst, SHUF(X, X, X, X)); - return GL_TRUE; -} - -static GLboolean emit_RSQ( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg(cp, op.alu.file0, op.alu.idx0); - struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); -#if 0 - struct x86_reg neg = get_reg_ptr(FILE_REG, REG_NEG); - -/* get abs value first. This STILL doesn't work. - Looks like we get bogus neg values ? -*/ - sse_movss(&cp->func, dst, arg0); - sse_mulss(&cp->func, dst, neg); - sse_maxss(&cp->func, dst, arg0); - - sse_rsqrtss(&cp->func, dst, dst); -#endif - sse_rsqrtss(&cp->func, dst, arg0); - sse_shufps(&cp->func, dst, dst, SHUF(X, X, X, X)); - return GL_TRUE; -} - - -static GLboolean emit_SGE( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg(cp, op.alu.file0, op.alu.idx0); - struct x86_reg arg1 = get_arg(cp, op.alu.file1, op.alu.idx1); - struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); - struct x86_reg ones = get_reg_ptr(FILE_REG, REG_ONES); - - sse_movups(&cp->func, dst, arg0); - sse_cmpps(&cp->func, dst, arg1, cc_NotLessThan); - sse_andps(&cp->func, dst, ones); - return GL_TRUE; -} - - -static GLboolean emit_SLT( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg(cp, op.alu.file0, op.alu.idx0); - struct x86_reg arg1 = get_arg(cp, op.alu.file1, op.alu.idx1); - struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); - struct x86_reg ones = get_reg_ptr(FILE_REG, REG_ONES); - - sse_movups(&cp->func, dst, arg0); - sse_cmpps(&cp->func, dst, arg1, cc_LessThan); - sse_andps(&cp->func, dst, ones); - return GL_TRUE; -} - -static GLboolean emit_SUB( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg(cp, op.alu.file0, op.alu.idx0); - struct x86_reg arg1 = get_arg(cp, op.alu.file1, op.alu.idx1); - struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); - - sse_movups(&cp->func, dst, arg0); - sse_subps(&cp->func, dst, arg1); - return GL_TRUE; -} - - -static GLboolean emit_XPD( struct compilation *cp, union instruction op ) -{ - struct x86_reg arg0 = get_arg(cp, op.alu.file0, op.alu.idx0); - struct x86_reg arg1 = get_arg(cp, op.alu.file1, op.alu.idx1); - struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); - struct x86_reg tmp0 = get_xmm_reg(cp); - struct x86_reg tmp1 = get_xmm_reg(cp); - - /* Could avoid tmp0, tmp1 if we overwrote arg0, arg1. Need a way - * to invalidate registers. This will come with better analysis - * (liveness analysis) of the incoming program. - */ - emit_pshufd(cp, dst, arg0, SHUF(Y, Z, X, W)); - emit_pshufd(cp, tmp1, arg1, SHUF(Z, X, Y, W)); - sse_mulps(&cp->func, dst, tmp1); - emit_pshufd(cp, tmp0, arg0, SHUF(Z, X, Y, W)); - emit_pshufd(cp, tmp1, arg1, SHUF(Y, Z, X, W)); - sse_mulps(&cp->func, tmp0, tmp1); - sse_subps(&cp->func, dst, tmp0); - -/* dst[0] = arg0[1] * arg1[2] - arg0[2] * arg1[1]; */ -/* dst[1] = arg0[2] * arg1[0] - arg0[0] * arg1[2]; */ -/* dst[2] = arg0[0] * arg1[1] - arg0[1] * arg1[0]; */ -/* dst[3] is undef */ - - return GL_TRUE; -} - -static GLboolean emit_NOP( struct compilation *cp, union instruction op ) -{ - return GL_TRUE; -} - - -static GLboolean (* const emit_func[])(struct compilation *, union instruction) = -{ - emit_ABS, - emit_ADD, - emit_NOP, /* ARA */ - emit_NOP, /* ARL */ - emit_NOP, /* ARL_NV */ - emit_NOP, /* ARR */ - emit_NOP, /* BRA */ - emit_NOP, /* CAL */ - emit_NOP, /* CMP */ - emit_NOP, /* COS */ - emit_NOP, /* DDX */ - emit_NOP, /* DDY */ - emit_DP3, - emit_DP4, - emit_DPH, - emit_DST, - emit_NOP, /* END */ - emit_EX2, - emit_EXP, - emit_FLR, - emit_FRC, - emit_NOP, /* KIL */ - emit_NOP, /* KIL_NV */ - emit_LG2, - emit_LIT, - emit_LOG, - emit_NOP, /* LRP */ - emit_NOP, /* MAD */ - emit_MAX, - emit_MIN, - emit_MOV, - emit_MUL, - emit_NOP, /* PK2H */ - emit_NOP, /* PK2US */ - emit_NOP, /* PK4B */ - emit_NOP, /* PK4UB */ - emit_POW, - emit_NOP, /* POPA */ - emit_PRT, - emit_NOP, /* PUSHA */ - emit_NOP, /* RCC */ - emit_RCP, - emit_NOP, /* RET */ - emit_NOP, /* RFL */ - emit_RSQ, - emit_NOP, /* SCS */ - emit_NOP, /* SEQ */ - emit_NOP, /* SFL */ - emit_SGE, - emit_NOP, /* SGT */ - emit_NOP, /* SIN */ - emit_NOP, /* SLE */ - emit_SLT, - emit_NOP, /* SNE */ - emit_NOP, /* SSG */ - emit_NOP, /* STR */ - emit_SUB, - emit_SWZ, /* SWZ */ - emit_NOP, /* TEX */ - emit_NOP, /* TXB */ - emit_NOP, /* TXD */ - emit_NOP, /* TXL */ - emit_NOP, /* TXP */ - emit_NOP, /* TXP_NV */ - emit_NOP, /* UP2H */ - emit_NOP, /* UP2US */ - emit_NOP, /* UP4B */ - emit_NOP, /* UP4UB */ - emit_NOP, /* X2D */ - emit_XPD, - emit_RSW, - emit_MSK, - emit_REL, -}; - - - -static GLboolean build_vertex_program( struct compilation *cp ) -{ - struct arb_vp_machine *m = NULL; - GLuint j; - - struct x86_reg regEBX = x86_make_reg(file_REG32, reg_BX); - struct x86_reg regECX = x86_make_reg(file_REG32, reg_CX); - struct x86_reg regEDX = x86_make_reg(file_REG32, reg_DX); - - x86_push(&cp->func, regEBX); - - x86_mov(&cp->func, regEDX, x86_fn_arg(&cp->func, 1)); - x86_mov(&cp->func, regEBX, x86_make_disp(regEDX, get_offset(m, m->File + FILE_REG))); - x86_mov(&cp->func, regECX, x86_make_disp(regEDX, get_offset(m, m->File + FILE_STATE_PARAM))); - - for (j = 0; j < cp->p->nr_instructions; j++) { - union instruction inst = cp->p->instructions[j]; - cp->insn_counter = j+1; /* avoid zero */ - - if (DISASSEM) { - _mesa_printf("%p: ", cp->func.csr); - _tnl_disassem_vba_insn( inst ); - } - cp->func.fn = NULL; - - if (!emit_func[inst.alu.opcode]( cp, inst )) { - return GL_FALSE; - } - } - - /* TODO: only for outputs: - */ - for (j = 0; j < 8; j++) { - if (cp->xmm[j].dirty) - spill(cp, j); - } - - - /* Exit mmx state? - */ - if (cp->func.need_emms) - mmx_emms(&cp->func); - - /* Restore FPU control word? - */ - if (cp->fpucntl != RESTORE_FPU) { - x87_fnclex(&cp->func); - x87_fldcw(&cp->func, x86_make_disp(regEDX, get_offset(m, &m->fpucntl_restore))); - } - - x86_pop(&cp->func, regEBX); - x86_ret(&cp->func); - - return GL_TRUE; -} - -/** - * Execute the given vertex program. - * - * TODO: Integrate the t_vertex.c code here, to build machine vertices - * directly at this point. - * - * TODO: Eliminate the VB struct entirely and just use - * struct arb_vertex_machine. - */ -GLboolean -_tnl_sse_codegen_vertex_program(struct tnl_compiled_program *p) -{ - struct compilation cp; - - /* sanity checks */ - assert(emit_func[OPCODE_ABS] == emit_ABS); - assert(emit_func[OPCODE_MUL] == emit_MUL); - assert(emit_func[OPCODE_XPD] == emit_XPD); - - _mesa_memset(&cp, 0, sizeof(cp)); - cp.p = p; - cp.have_sse2 = 1; - - if (p->compiled_func) { - _mesa_free((void *)p->compiled_func); - p->compiled_func = NULL; - } - - x86_init_func(&cp.func); - - cp.fpucntl = RESTORE_FPU; - - - /* Note ctx state is not referenced in building the function, so it - * depends only on the list of instructions: - */ - if (!build_vertex_program(&cp)) { - x86_release_func( &cp.func ); - return GL_FALSE; - } - - - p->compiled_func = (void (*)(struct arb_vp_machine *))x86_get_func( &cp.func ); - return GL_TRUE; -} - - - -#else - -GLboolean -_tnl_sse_codegen_vertex_program(struct tnl_compiled_program *p) -{ - /* Dummy version for when USE_SSE_ASM not defined */ - return GL_FALSE; -} - -#endif -- cgit v1.2.3 From 1560de2c3c7f9d4e07b34e805e649769ca5a0cbe Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 16 Apr 2007 15:09:39 -0600 Subject: need to clamp MAD for linear fog --- src/mesa/shader/programopt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/shader/programopt.c b/src/mesa/shader/programopt.c index f1d8ce30654..fc5b0497fe3 100644 --- a/src/mesa/shader/programopt.c +++ b/src/mesa/shader/programopt.c @@ -199,6 +199,7 @@ _mesa_append_fog_code(GLcontext *ctx, struct gl_fragment_program *fprog) inst->SrcReg[2].File = PROGRAM_STATE_VAR; inst->SrcReg[2].Index = fogPRefOpt; inst->SrcReg[2].Swizzle = SWIZZLE_Y; + inst->SaturateMode = SATURATE_ZERO_ONE; inst++; } else { -- cgit v1.2.3 From 96e05da1c959b3dad7250ccfad1bf540bbec2fbf Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 16 Apr 2007 15:15:23 -0600 Subject: remove _tnl_arb_vertex_program_stage --- src/mesa/drivers/dri/i915/intel_context.c | 1 - src/mesa/drivers/dri/i915tex/intel_context.c | 1 - src/mesa/drivers/dri/mga/mga_xmesa.c | 1 - src/mesa/drivers/dri/r200/r200_context.c | 1 - src/mesa/drivers/dri/r300/r300_context.c | 1 - src/mesa/drivers/dri/tdfx/tdfx_context.c | 6 ------ 6 files changed, 11 deletions(-) diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c index d201fcf323a..e1e7cdb7233 100644 --- a/src/mesa/drivers/dri/i915/intel_context.c +++ b/src/mesa/drivers/dri/i915/intel_context.c @@ -196,7 +196,6 @@ static const struct tnl_pipeline_stage *intel_pipeline[] = { &_tnl_texgen_stage, &_tnl_texture_transform_stage, &_tnl_point_attenuation_stage, - &_tnl_arb_vertex_program_stage, &_tnl_vertex_program_stage, #if 1 &_intel_render_stage, /* ADD: unclipped rastersetup-to-dma */ diff --git a/src/mesa/drivers/dri/i915tex/intel_context.c b/src/mesa/drivers/dri/i915tex/intel_context.c index 6a3456e154b..c6c66e26cae 100644 --- a/src/mesa/drivers/dri/i915tex/intel_context.c +++ b/src/mesa/drivers/dri/i915tex/intel_context.c @@ -209,7 +209,6 @@ static const struct tnl_pipeline_stage *intel_pipeline[] = { &_tnl_texgen_stage, &_tnl_texture_transform_stage, &_tnl_point_attenuation_stage, - &_tnl_arb_vertex_program_stage, &_tnl_vertex_program_stage, #if 1 &_intel_render_stage, /* ADD: unclipped rastersetup-to-dma */ diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index 5b65d1a3028..f4e651afa0c 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -372,7 +372,6 @@ static const struct tnl_pipeline_stage *mga_pipeline[] = { &_tnl_fog_coordinate_stage, &_tnl_texgen_stage, &_tnl_texture_transform_stage, - &_tnl_arb_vertex_program_stage, &_tnl_vertex_program_stage, /* REMOVE: point attenuation stage */ diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 3abcdf9e183..0507eb86e69 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -192,7 +192,6 @@ static const struct tnl_pipeline_stage *r200_pipeline[] = { &_tnl_texgen_stage, &_tnl_texture_transform_stage, &_tnl_point_attenuation_stage, - &_tnl_arb_vertex_program_stage, &_tnl_vertex_program_stage, /* Try again to go to tcl? * - no good for asymmetric-twoside (do with multipass) diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 1f8d95078fb..58350fe0ab4 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -148,7 +148,6 @@ static const struct tnl_pipeline_stage *r300_pipeline[] = { &_tnl_fog_coordinate_stage, &_tnl_texgen_stage, &_tnl_texture_transform_stage, - &_tnl_arb_vertex_program_stage, &_tnl_vertex_program_stage, /* Try again to go to tcl? diff --git a/src/mesa/drivers/dri/tdfx/tdfx_context.c b/src/mesa/drivers/dri/tdfx/tdfx_context.c index a9163f49a8f..b4eea2566f6 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_context.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_context.c @@ -165,12 +165,6 @@ static const struct tnl_pipeline_stage *tdfx_pipeline[] = { &_tnl_texgen_stage, &_tnl_texture_transform_stage, &_tnl_point_attenuation_stage, -#if 0 -#if defined(FEATURE_NV_vertex_program) || defined(FEATURE_ARB_vertex_program) - &_tnl_arb_vertex_program_stage, - &_tnl_vertex_program_stage, -#endif -#endif &_tnl_render_stage, 0, }; -- cgit v1.2.3 From dfee7619d433a8b27fb5573d92873f9355ca6a5d Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 16 Apr 2007 15:15:53 -0600 Subject: remove _tnl_arb_vertex_program_stage --- src/mesa/drivers/glide/fxdd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index 43d3cd94051..4e56f7bde50 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -1663,7 +1663,6 @@ static const struct tnl_pipeline_stage *fx_pipeline[] = { &_tnl_texture_transform_stage, &_tnl_point_attenuation_stage, #if defined(FEATURE_NV_vertex_program) || defined(FEATURE_ARB_vertex_program) - &_tnl_arb_vertex_program_stage, &_tnl_vertex_program_stage, #endif &_tnl_render_stage, -- cgit v1.2.3 From 5888010362debf0f32c1596c9082a16048b29f39 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 16 Apr 2007 17:16:46 -0600 Subject: Fix glActiveStencilFaceEXT dispatch problem (bug 10523). OK, _all_ extensions that might get enabled by the driver need to be in the card_extensions[] list. driInitExtensions() is called at least twice: first during screen creation, then once for each context that's created. The first call sets up the dispatch table. The second call just sets the extension enable/disable flags. --- src/mesa/drivers/dri/r300/r300_context.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 58350fe0ab4..c362b027e99 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -124,11 +124,8 @@ const struct dri_extension card_extensions[] = { {"GL_NV_blend_square", NULL}, {"GL_NV_vertex_program", GL_NV_vertex_program_functions}, {"GL_SGIS_generate_mipmap", NULL}, - {NULL, NULL} -}; - -const struct dri_extension stencil_two_side[] = { {"GL_EXT_stencil_two_side", GL_EXT_stencil_two_side_functions}, + {NULL, NULL} }; extern struct tnl_pipeline_stage _r300_render_stage; @@ -334,8 +331,8 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, driInitExtensions(ctx, card_extensions, GL_TRUE); - if (driQueryOptionb(&r300->radeon.optionCache, "disable_stencil_two_side") == 0) - driInitSingleExtension(ctx, stencil_two_side); + if (driQueryOptionb(&r300->radeon.optionCache, "disable_stencil_two_side")) + _mesa_disable_extension(ctx, "GL_EXT_stencil_two_side"); if (r300->radeon.glCtx->Mesa_DXTn && !driQueryOptionb (&r300->radeon.optionCache, "disable_s3tc")) { _mesa_enable_extension( ctx, "GL_EXT_texture_compression_s3tc" ); -- cgit v1.2.3 From 34ca2be76920db75a31abcccde30570b659fed19 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 16 Apr 2007 17:18:39 -0600 Subject: move GL_EXT_stencil_two_side into alphabetical position --- src/mesa/drivers/dri/r300/r300_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index c362b027e99..c58cef65476 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -108,6 +108,7 @@ const struct dri_extension card_extensions[] = { // {"GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, {"GL_EXT_gpu_program_parameters", GL_EXT_gpu_program_parameters_functions}, {"GL_EXT_secondary_color", GL_EXT_secondary_color_functions}, + {"GL_EXT_stencil_two_side", GL_EXT_stencil_two_side_functions}, {"GL_EXT_stencil_wrap", NULL}, {"GL_EXT_texture_edge_clamp", NULL}, {"GL_EXT_texture_env_combine", NULL}, @@ -124,7 +125,6 @@ const struct dri_extension card_extensions[] = { {"GL_NV_blend_square", NULL}, {"GL_NV_vertex_program", GL_NV_vertex_program_functions}, {"GL_SGIS_generate_mipmap", NULL}, - {"GL_EXT_stencil_two_side", GL_EXT_stencil_two_side_functions}, {NULL, NULL} }; -- cgit v1.2.3 From 4a7c45118d5f122a4550f259424b6820fe3945eb Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 16 Apr 2007 17:36:39 -0600 Subject: just clean-ups --- src/mesa/drivers/dri/i915/i915_state.c | 47 +++++++++++++------------- src/mesa/drivers/dri/i915tex/i915_state.c | 56 +++++++++++++------------------ 2 files changed, 48 insertions(+), 55 deletions(-) diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c index 5e00e6597b0..0d5ca32969a 100644 --- a/src/mesa/drivers/dri/i915/i915_state.c +++ b/src/mesa/drivers/dri/i915/i915_state.c @@ -541,17 +541,19 @@ void i915_update_fog( GLcontext *ctx ) else { enabled = ctx->Fog.Enabled; mode = ctx->Fog.Mode; - - try_pixel_fog = (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT && - ctx->Hint.Fog == GL_NICEST && - 0); /* XXX - DISABLE -- Need ortho fallback */ +#if 0 + /* XXX - DISABLED -- Need ortho fallback */ + try_pixel_fog = (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT + &&ctx->Hint.Fog == GL_NICEST); +#else + try_pixel_fog = 0; +#endif } if (!enabled) { i915->vertex_fog = I915_FOG_NONE; } else if (try_pixel_fog) { - I915_STATECHANGE(i915, I915_UPLOAD_FOG); i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_FOGFUNC_MASK; i915->vertex_fog = I915_FOG_PIXEL; @@ -567,8 +569,8 @@ void i915_update_fog( GLcontext *ctx ) i915->vertex_fog = I915_FOG_VERTEX; } else { - GLfloat c1 = ctx->Fog.End/(ctx->Fog.End-ctx->Fog.Start); - GLfloat c2 = 1.0/(ctx->Fog.End-ctx->Fog.Start); + GLfloat c2 = 1.0 / (ctx->Fog.End - ctx->Fog.Start); + GLfloat c1 = ctx->Fog.End * c2; i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_C1_MASK; i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_PIXEL_LINEAR; @@ -576,10 +578,11 @@ void i915_update_fog( GLcontext *ctx ) ((GLuint)(c1 * FMC1_C1_ONE)) & FMC1_C1_MASK; if (i915->state.Fog[I915_FOGREG_MODE1] & FMC1_FOGINDEX_Z) { - i915->state.Fog[I915_FOGREG_MODE2] = (GLuint)(c2 * FMC2_C2_ONE); + i915->state.Fog[I915_FOGREG_MODE2] + = (GLuint)(c2 * FMC2_C2_ONE); } else { - union { float f; int i; } fi; + fi_type fi; fi.f = c2; i915->state.Fog[I915_FOGREG_MODE2] = fi.i; } @@ -602,24 +605,22 @@ void i915_update_fog( GLcontext *ctx ) i915->vertex_fog = I915_FOG_VERTEX; } - { - I915_STATECHANGE(i915, I915_UPLOAD_CTX); - I915_ACTIVESTATE(i915, I915_UPLOAD_FOG, enabled); - if (enabled) - i915->state.Ctx[I915_CTXREG_LIS5] |= S5_FOG_ENABLE; - else - i915->state.Ctx[I915_CTXREG_LIS5] &= ~S5_FOG_ENABLE; - } + I915_STATECHANGE(i915, I915_UPLOAD_CTX); + I915_ACTIVESTATE(i915, I915_UPLOAD_FOG, enabled); + if (enabled) + i915->state.Ctx[I915_CTXREG_LIS5] |= S5_FOG_ENABLE; + else + i915->state.Ctx[I915_CTXREG_LIS5] &= ~S5_FOG_ENABLE; - /* always enbale pixel fog - * vertex fog use precaculted fog coord will conflict with appended - * fog program + /* Always enable pixel fog. Vertex fog using fog coord will conflict + * with fog code appended onto fragment program. */ _tnl_allow_vertex_fog( ctx, 0 ); _tnl_allow_pixel_fog( ctx, 1 ); } -static void i915Fogfv(GLcontext *ctx, GLenum pname, const GLfloat *param) +static void +i915Fogfv(GLcontext *ctx, GLenum pname, const GLfloat *param) { i915ContextPtr i915 = I915_CONTEXT(ctx); @@ -634,8 +635,8 @@ static void i915Fogfv(GLcontext *ctx, GLenum pname, const GLfloat *param) I915_STATECHANGE(i915, I915_UPLOAD_FOG); if (i915->state.Fog[I915_FOGREG_MODE1] & FMC1_FOGINDEX_Z) { - i915->state.Fog[I915_FOGREG_MODE3] = (GLuint)(ctx->Fog.Density * - FMC3_D_ONE); + i915->state.Fog[I915_FOGREG_MODE3] + = (GLuint)(ctx->Fog.Density * FMC3_D_ONE); } else { union { float f; int i; } fi; diff --git a/src/mesa/drivers/dri/i915tex/i915_state.c b/src/mesa/drivers/dri/i915tex/i915_state.c index 1fafadced02..d3217fa0caa 100644 --- a/src/mesa/drivers/dri/i915tex/i915_state.c +++ b/src/mesa/drivers/dri/i915tex/i915_state.c @@ -563,7 +563,6 @@ i915_update_fog(GLcontext * ctx) if (ctx->FragmentProgram._Active) { /* Pull in static fog state from program */ - mode = ctx->FragmentProgram._Current->FogOption; enabled = (mode != GL_NONE); try_pixel_fog = 0; @@ -571,15 +570,19 @@ i915_update_fog(GLcontext * ctx) else { enabled = ctx->Fog.Enabled; mode = ctx->Fog.Mode; - - try_pixel_fog = (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT && ctx->Hint.Fog == GL_NICEST && 0); /* XXX - DISABLE -- Need ortho fallback */ +#if 0 + /* XXX - DISABLED -- Need ortho fallback */ + try_pixel_fog = (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT + && ctx->Hint.Fog == GL_NICEST); +#else + try_pixel_fog = 0; +#endif } if (!enabled) { i915->vertex_fog = I915_FOG_NONE; } else if (try_pixel_fog) { - I915_STATECHANGE(i915, I915_UPLOAD_FOG); i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_FOGFUNC_MASK; i915->vertex_fog = I915_FOG_PIXEL; @@ -591,12 +594,13 @@ i915_update_fog(GLcontext * ctx) * either fallback or append fog instructions to end of * program in the case of linear fog. */ + printf("vertex fog!\n"); i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_VERTEX; i915->vertex_fog = I915_FOG_VERTEX; } else { - GLfloat c1 = ctx->Fog.End / (ctx->Fog.End - ctx->Fog.Start); GLfloat c2 = 1.0 / (ctx->Fog.End - ctx->Fog.Start); + GLfloat c1 = ctx->Fog.End * c2; i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_C1_MASK; i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_PIXEL_LINEAR; @@ -604,15 +608,11 @@ i915_update_fog(GLcontext * ctx) ((GLuint) (c1 * FMC1_C1_ONE)) & FMC1_C1_MASK; if (i915->state.Fog[I915_FOGREG_MODE1] & FMC1_FOGINDEX_Z) { - i915->state.Fog[I915_FOGREG_MODE2] = - (GLuint) (c2 * FMC2_C2_ONE); + i915->state.Fog[I915_FOGREG_MODE2] + = (GLuint) (c2 * FMC2_C2_ONE); } else { - union - { - float f; - int i; - } fi; + fi_type fi; fi.f = c2; i915->state.Fog[I915_FOGREG_MODE2] = fi.i; } @@ -628,26 +628,22 @@ i915_update_fog(GLcontext * ctx) break; } } - else { /* if (i915->vertex_fog != I915_FOG_VERTEX) */ - + else { /* if (i915->vertex_fog != I915_FOG_VERTEX) */ I915_STATECHANGE(i915, I915_UPLOAD_FOG); i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_FOGFUNC_MASK; i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_VERTEX; i915->vertex_fog = I915_FOG_VERTEX; } - { - I915_STATECHANGE(i915, I915_UPLOAD_CTX); - I915_ACTIVESTATE(i915, I915_UPLOAD_FOG, enabled); - if (enabled) - i915->state.Ctx[I915_CTXREG_LIS5] |= S5_FOG_ENABLE; - else - i915->state.Ctx[I915_CTXREG_LIS5] &= ~S5_FOG_ENABLE; - } + I915_STATECHANGE(i915, I915_UPLOAD_CTX); + I915_ACTIVESTATE(i915, I915_UPLOAD_FOG, enabled); + if (enabled) + i915->state.Ctx[I915_CTXREG_LIS5] |= S5_FOG_ENABLE; + else + i915->state.Ctx[I915_CTXREG_LIS5] &= ~S5_FOG_ENABLE; - /* always enbale pixel fog - * vertex fog use precaculted fog coord will conflict with appended - * fog program + /* Always enable pixel fog. Vertex fog using fog coord will conflict + * with fog code appended onto fragment program. */ _tnl_allow_vertex_fog( ctx, 0 ); _tnl_allow_pixel_fog( ctx, 1 ); @@ -669,15 +665,11 @@ i915Fogfv(GLcontext * ctx, GLenum pname, const GLfloat * param) I915_STATECHANGE(i915, I915_UPLOAD_FOG); if (i915->state.Fog[I915_FOGREG_MODE1] & FMC1_FOGINDEX_Z) { - i915->state.Fog[I915_FOGREG_MODE3] = (GLuint) (ctx->Fog.Density * - FMC3_D_ONE); + i915->state.Fog[I915_FOGREG_MODE3] = + (GLuint) (ctx->Fog.Density * FMC3_D_ONE); } else { - union - { - float f; - int i; - } fi; + fi_type fi; fi.f = ctx->Fog.Density; i915->state.Fog[I915_FOGREG_MODE3] = fi.i; } -- cgit v1.2.3 From badc346206453714e95e19d381e1a0495b63ceab Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 16 Apr 2007 17:56:13 -0600 Subject: lots of changes, fixes, clean-ups --- progs/demos/fogcoord.c | 364 +++++++++++++++++++++++++------------------------ 1 file changed, 185 insertions(+), 179 deletions(-) diff --git a/progs/demos/fogcoord.c b/progs/demos/fogcoord.c index 19a15f05b87..00c73c6f048 100644 --- a/progs/demos/fogcoord.c +++ b/progs/demos/fogcoord.c @@ -7,151 +7,136 @@ * Daniel Borca */ - +#define GL_GLEXT_PROTOTYPES #include #include #include #include -#include "readtex.h" - -#define TEXTURE_FILE "../images/bw.rgb" - -#define ARRAYS 0 /* use glDrawElements */ - -#define VERBOSE 1 /* tell me what happens */ +#define DEPTH 5.0f -#define DEPTH 15.0f +static PFNGLFOGCOORDFEXTPROC glFogCoordf_ext; +static PFNGLFOGCOORDPOINTEREXTPROC glFogCoordPointer_ext; -#if !defined(GLAPIENTRYP) -# define GLAPIENTRYP * -#endif - -typedef void (GLAPIENTRYP GLFOGCOORDFEXTPROC) (GLfloat f); -typedef void (GLAPIENTRYP GLFOGCOORDPOINTEREXTPROC) (GLenum, GLsizei, const GLvoid *); - -static GLFOGCOORDFEXTPROC glFogCoordf_ext; -#if ARRAYS -static GLFOGCOORDPOINTEREXTPROC glFogCoordPointer_ext; -#endif static GLboolean have_fog_coord; static GLfloat camz; -static GLuint texture[1]; static GLint fogMode; static GLboolean fogCoord; static GLfloat fogDensity = 0.75; -static GLfloat fogStart = 1.0, fogEnd = 40.0; +static GLfloat fogStart = 1.0, fogEnd = DEPTH; static GLfloat fogColor[4] = {0.6f, 0.3f, 0.0f, 1.0f}; +static const char *ModeStr = NULL; +static GLboolean Arrays = GL_FALSE; +static GLboolean Texture = GL_TRUE; -static void APIENTRY glFogCoordf_nop (GLfloat f) +static void +Reset(void) { - (void)f; + fogMode = 1; + fogCoord = 1; + fogDensity = 0.75; + fogStart = 1.0; + fogEnd = DEPTH; + Arrays = GL_FALSE; + Texture = GL_TRUE; } -static int BuildTexture (const char *filename, GLuint texid[]) +static void APIENTRY +glFogCoordf_nop (GLfloat f) { - GLubyte *tex_data; - GLenum tex_format; - GLint tex_width, tex_height; + (void)f; +} - tex_data = LoadRGBImage(filename, &tex_width, &tex_height, &tex_format); - if (tex_data == NULL) { - return -1; - } - { - GLint tex_max; - glGetIntegerv(GL_MAX_TEXTURE_SIZE, &tex_max); - if ((tex_width > tex_max) || (tex_height > tex_max)) { - return -1; - } +static void +PrintString(const char *s) +{ + while (*s) { + glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s); + s++; } +} - glGenTextures(1, texid); - - glBindTexture(GL_TEXTURE_2D, texid[0]); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - - glTexImage2D(GL_TEXTURE_2D, 0, tex_format, tex_width, tex_height, 0, - tex_format, GL_UNSIGNED_BYTE, tex_data); - return 0; +static void +PrintInfo(void) +{ + char s[100]; + + glDisable(GL_FOG); + glColor3f(0, 1, 1); + + sprintf(s, "Mode(m): %s Start(s/S): %g End(e/E): %g Density(d/D): %g", + ModeStr, fogStart, fogEnd, fogDensity); + glWindowPos2iARB(5, 20); + PrintString(s); + + sprintf(s, "Arrays(a): %s glFogCoord(c): %s EyeZ(z/z): %g", + (Arrays ? "Yes" : "No"), + (fogCoord ? "Yes" : "No"), + camz); + glWindowPos2iARB(5, 5); + PrintString(s); } -static int SetFogMode (GLint fogMode) +static int +SetFogMode(GLint fogMode) { fogMode &= 3; switch (fogMode) { case 0: + ModeStr = "Off"; glDisable(GL_FOG); -#if VERBOSE - printf("fog(disable)\n"); -#endif break; case 1: + ModeStr = "GL_LINEAR"; glEnable(GL_FOG); glFogi(GL_FOG_MODE, GL_LINEAR); glFogf(GL_FOG_START, fogStart); glFogf(GL_FOG_END, fogEnd); -#if VERBOSE - printf("fog(GL_LINEAR, %.2f, %.2f)\n", fogStart, fogEnd); -#endif break; case 2: + ModeStr = "GL_EXP"; glEnable(GL_FOG); glFogi(GL_FOG_MODE, GL_EXP); glFogf(GL_FOG_DENSITY, fogDensity); -#if VERBOSE - printf("fog(GL_EXP, %.2f)\n", fogDensity); -#endif break; case 3: + ModeStr = "GL_EXP2"; glEnable(GL_FOG); glFogi(GL_FOG_MODE, GL_EXP2); glFogf(GL_FOG_DENSITY, fogDensity); -#if VERBOSE - printf("fog(GL_EXP2, %.2f)\n", fogDensity); -#endif break; } return fogMode; } -static GLboolean SetFogCoord (GLboolean fogCoord) +static GLboolean +SetFogCoord(GLboolean fogCoord) { glFogCoordf_ext = glFogCoordf_nop; if (!have_fog_coord) { -#if VERBOSE - printf("fog(GL_FRAGMENT_DEPTH_EXT)%s\n", fogCoord ? " EXT_fog_coord not available!" : ""); -#endif return GL_FALSE; } if (fogCoord) { - glFogCoordf_ext = (GLFOGCOORDFEXTPROC)glutGetProcAddress("glFogCoordfEXT"); + glFogCoordf_ext = (PFNGLFOGCOORDFEXTPROC)glutGetProcAddress("glFogCoordfEXT"); glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT); -#if VERBOSE - printf("fog(GL_FOG_COORDINATE_EXT)\n"); -#endif - } else { + } + else { glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FRAGMENT_DEPTH_EXT); -#if VERBOSE - printf("fog(GL_FRAGMENT_DEPTH_EXT)\n"); -#endif } return fogCoord; } -#if ARRAYS /* could reuse vertices */ static GLuint vertex_index[] = { /* Back */ @@ -172,19 +157,19 @@ static GLuint vertex_index[] = { static GLfloat vertex_pointer[][3] = { /* Back */ - {-2.5f,-2.5f,-DEPTH}, { 2.5f,-2.5f,-DEPTH}, { 2.5f, 2.5f,-DEPTH}, {-2.5f, 2.5f,-DEPTH}, + {-1.0f,-1.0f,-DEPTH}, { 1.0f,-1.0f,-DEPTH}, { 1.0f, 1.0f,-DEPTH}, {-1.0f, 1.0f,-DEPTH}, /* Floor */ - {-2.5f,-2.5f,-DEPTH}, { 2.5f,-2.5f,-DEPTH}, { 2.5f,-2.5f, DEPTH}, {-2.5f,-2.5f, DEPTH}, + {-1.0f,-1.0f,-DEPTH}, { 1.0f,-1.0f,-DEPTH}, { 1.0f,-1.0f, 0.0}, {-1.0f,-1.0f, 0.0}, /* Roof */ - {-2.5f, 2.5f,-DEPTH}, { 2.5f, 2.5f,-DEPTH}, { 2.5f, 2.5f, DEPTH}, {-2.5f, 2.5f, DEPTH}, + {-1.0f, 1.0f,-DEPTH}, { 1.0f, 1.0f,-DEPTH}, { 1.0f, 1.0f, 0.0}, {-1.0f, 1.0f, 0.0}, /* Right */ - { 2.5f,-2.5f, DEPTH}, { 2.5f, 2.5f, DEPTH}, { 2.5f, 2.5f,-DEPTH}, { 2.5f,-2.5f,-DEPTH}, + { 1.0f,-1.0f, 0.0}, { 1.0f, 1.0f, 0.0}, { 1.0f, 1.0f,-DEPTH}, { 1.0f,-1.0f,-DEPTH}, /* Left */ - {-2.5f,-2.5f, DEPTH}, {-2.5f, 2.5f, DEPTH}, {-2.5f, 2.5f,-DEPTH}, {-2.5f,-2.5f,-DEPTH} + {-1.0f,-1.0f, 0.0}, {-1.0f, 1.0f, 0.0}, {-1.0f, 1.0f,-DEPTH}, {-1.0f,-1.0f,-DEPTH} }; static GLfloat texcoord_pointer[][2] = { @@ -192,118 +177,139 @@ static GLfloat texcoord_pointer[][2] = { {0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, 1.0f}, {0.0f, 1.0f}, /* Floor */ - {0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, 1.0f}, {0.0f, 1.0f}, + {0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, DEPTH}, {0.0f, DEPTH}, /* Roof */ - {0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, 1.0f}, {0.0f, 1.0f}, + {1.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, DEPTH}, {1.0f, DEPTH}, /* Right */ - {0.0f, 0.0f}, {0.0f, 1.0f}, {1.0f, 1.0f}, {1.0f, 0.0f}, + {0.0f, 1.0f}, {0.0f, 0.0f}, {DEPTH, 0.0f}, {DEPTH, 1.0f}, /* Left */ - {0.0f, 0.0f}, {0.0f, 1.0f}, {1.0f, 1.0f}, {1.0f, 0.0f} + {0.0f, 0.0f}, {0.0f, 1.0f}, {DEPTH, 1.0f}, {DEPTH, 0.0f} }; -static GLfloat fogcoord_pointer[][1] = { +static GLfloat fogcoord_pointer[] = { /* Back */ - {1.0f}, {1.0f}, {1.0f}, {1.0f}, + DEPTH, DEPTH, DEPTH, DEPTH, /* Floor */ - {1.0f}, {1.0f}, {0.0f}, {0.0f}, + DEPTH, DEPTH, 0.0, 0.0, /* Roof */ - {1.0f}, {1.0f}, {0.0f}, {0.0f}, + DEPTH, DEPTH, 0.0, 0.0, /* Right */ - {0.0f}, {0.0f}, {1.0f}, {1.0f}, + 0.0, 0.0, DEPTH, DEPTH, /* Left */ - {0.0f}, {0.0f}, {1.0f}, {1.0f} + 0.0, 0.0, DEPTH, DEPTH }; -#endif -static void Display( void ) +static void +Display( void ) { glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity (); - glTranslatef(0.0f, 0.0f, camz); + glTranslatef(0.0f, 0.0f, -camz); -#if ARRAYS - glDrawElements(GL_QUADS, sizeof(vertex_index) / sizeof(vertex_index[0]), GL_UNSIGNED_INT, vertex_index); -#else - /* Back */ - glBegin(GL_QUADS); - glFogCoordf_ext(1.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f(-2.5f,-2.5f,-DEPTH); - glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 0.0f); glVertex3f( 2.5f,-2.5f,-DEPTH); - glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 1.0f); glVertex3f( 2.5f, 2.5f,-DEPTH); - glFogCoordf_ext(1.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f(-2.5f, 2.5f,-DEPTH); - glEnd(); + SetFogMode(fogMode); - /* Floor */ - glBegin(GL_QUADS); - glFogCoordf_ext(1.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f(-2.5f,-2.5f,-DEPTH); - glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 0.0f); glVertex3f( 2.5f,-2.5f,-DEPTH); - glFogCoordf_ext(0.0f); glTexCoord2f(1.0f, 1.0f); glVertex3f( 2.5f,-2.5f, DEPTH); - glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f(-2.5f,-2.5f, DEPTH); - glEnd(); + glColor3f(1, 1, 1); - /* Roof */ - glBegin(GL_QUADS); - glFogCoordf_ext(1.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f(-2.5f, 2.5f,-DEPTH); - glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 0.0f); glVertex3f( 2.5f, 2.5f,-DEPTH); - glFogCoordf_ext(0.0f); glTexCoord2f(1.0f, 1.0f); glVertex3f( 2.5f, 2.5f, DEPTH); - glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f(-2.5f, 2.5f, DEPTH); - glEnd(); + if (Texture) + glEnable(GL_TEXTURE_2D); - /* Right */ - glBegin(GL_QUADS); - glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f( 2.5f,-2.5f, DEPTH); - glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f( 2.5f, 2.5f, DEPTH); - glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 1.0f); glVertex3f( 2.5f, 2.5f,-DEPTH); - glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 0.0f); glVertex3f( 2.5f,-2.5f,-DEPTH); - glEnd(); + if (Arrays) { + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glDrawElements(GL_QUADS, sizeof(vertex_index) / sizeof(vertex_index[0]), + GL_UNSIGNED_INT, vertex_index); + glDisableClientState(GL_VERTEX_ARRAY); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + } + else { + /* Back */ + glBegin(GL_QUADS); + glFogCoordf_ext(DEPTH); glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f,-1.0f,-DEPTH); + glFogCoordf_ext(DEPTH); glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f,-1.0f,-DEPTH); + glFogCoordf_ext(DEPTH); glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f, 1.0f,-DEPTH); + glFogCoordf_ext(DEPTH); glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f,-DEPTH); + glEnd(); + + /* Floor */ + glBegin(GL_QUADS); + glFogCoordf_ext(DEPTH); glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f,-1.0f,-DEPTH); + glFogCoordf_ext(DEPTH); glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f,-1.0f,-DEPTH); + glFogCoordf_ext(0.0f); glTexCoord2f(1.0f, DEPTH); glVertex3f( 1.0f,-1.0f,0.0); + glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, DEPTH); glVertex3f(-1.0f,-1.0f,0.0); + glEnd(); + + /* Roof */ + glBegin(GL_QUADS); + glFogCoordf_ext(DEPTH); glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, 1.0f,-DEPTH); + glFogCoordf_ext(DEPTH); glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, 1.0f,-DEPTH); + glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, DEPTH); glVertex3f( 1.0f, 1.0f,0.0); + glFogCoordf_ext(0.0f); glTexCoord2f(1.0f, DEPTH); glVertex3f(-1.0f, 1.0f,0.0); + glEnd(); + + /* Right */ + glBegin(GL_QUADS); + glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f( 1.0f,-1.0f,0.0); + glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, 1.0f,0.0); + glFogCoordf_ext(DEPTH); glTexCoord2f(DEPTH, 0.0f); glVertex3f( 1.0f, 1.0f,-DEPTH); + glFogCoordf_ext(DEPTH); glTexCoord2f(DEPTH, 1.0f); glVertex3f( 1.0f,-1.0f,-DEPTH); + glEnd(); + + /* Left */ + glBegin(GL_QUADS); + glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f,-1.0f,0.0); + glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f,0.0); + glFogCoordf_ext(DEPTH); glTexCoord2f(DEPTH, 1.0f); glVertex3f(-1.0f, 1.0f,-DEPTH); + glFogCoordf_ext(DEPTH); glTexCoord2f(DEPTH, 0.0f); glVertex3f(-1.0f,-1.0f,-DEPTH); + glEnd(); + } - /* Left */ - glBegin(GL_QUADS); - glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f(-2.5f,-2.5f, DEPTH); - glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f(-2.5f, 2.5f, DEPTH); - glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 1.0f); glVertex3f(-2.5f, 2.5f,-DEPTH); - glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 0.0f); glVertex3f(-2.5f,-2.5f,-DEPTH); - glEnd(); -#endif + glDisable(GL_TEXTURE_2D); + + PrintInfo(); glutSwapBuffers(); } -static void Reshape( int width, int height ) +static void +Reshape( int width, int height ) { glViewport(0, 0, width, height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); - gluPerspective(45.0f, (GLfloat)(width)/(GLfloat)(height), 0.1f, 100.0f); + glFrustum(-1, 1, -1, 1, 1.0, 100); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); } -static void Key( unsigned char key, int x, int y ) +static void +Key( unsigned char key, int x, int y ) { (void) x; (void) y; switch (key) { + case 'a': + Arrays = !Arrays; + break; case 'f': + case 'm': fogMode = SetFogMode(fogMode + 1); break; - case '+': - if (fogDensity < 1.0) { - fogDensity += 0.05; - } + case 'D': + fogDensity += 0.05; SetFogMode(fogMode); break; - case '-': + case 'd': if (fogDensity > 0.0) { fogDensity -= 0.05; } @@ -311,31 +317,43 @@ static void Key( unsigned char key, int x, int y ) break; case 's': if (fogStart > 0.0) { - fogStart -= 1.0; + fogStart -= 0.25; } SetFogMode(fogMode); break; case 'S': - if (fogStart < fogEnd) { - fogStart += 1.0; + if (fogStart < 100.0) { + fogStart += 0.25; } SetFogMode(fogMode); break; case 'e': - if (fogEnd > fogStart) { - fogEnd -= 1.0; + if (fogEnd > 0.0) { + fogEnd -= 0.25; } SetFogMode(fogMode); break; case 'E': if (fogEnd < 100.0) { - fogEnd += 1.0; + fogEnd += 0.25; } SetFogMode(fogMode); break; case 'c': fogCoord = SetFogCoord(fogCoord ^ GL_TRUE); break; + case 't': + Texture = !Texture; + break; + case 'z': + camz -= 0.1; + break; + case 'Z': + camz += 0.1; + break; + case 'r': + Reset(); + break; case 27: exit(0); break; @@ -344,37 +362,28 @@ static void Key( unsigned char key, int x, int y ) } -static void SpecialKey( int key, int x, int y ) +static void +Init(void) { - (void) x; - (void) y; - switch (key) { - case GLUT_KEY_UP: - if (camz < (DEPTH - 1.0)) { - camz += 1.0f; - } - break; - case GLUT_KEY_DOWN: - if (camz > -19.0) { - camz -= 1.0f; - } - break; - } - glutPostRedisplay(); -} + static const GLubyte teximage[2][2][4] = { + { { 255, 255, 255, 255}, { 128, 128, 128, 255} }, + { { 128, 128, 128, 255}, { 255, 255, 255, 255} } + }; + printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); -static void Init( void ) -{ have_fog_coord = glutExtensionSupported("GL_EXT_fog_coord"); - - if (BuildTexture(TEXTURE_FILE, texture) == -1) { - exit(1); + if (!have_fog_coord) { + printf("GL_EXT_fog_coord not supported!\n"); } - glEnable(GL_TEXTURE_2D); - glClearColor(0.0f, 0.0f, 0.0f, 0.5f); - glClearDepth(1.0f); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0, + GL_RGBA, GL_UNSIGNED_BYTE, teximage); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + + glClearColor(0.1f, 0.1f, 0.1f, 0.0f); + glDepthFunc(GL_LEQUAL); glEnable(GL_DEPTH_TEST); glShadeModel(GL_SMOOTH); @@ -383,11 +392,8 @@ static void Init( void ) glFogfv(GL_FOG_COLOR, fogColor); glHint(GL_FOG_HINT, GL_NICEST); fogCoord = SetFogCoord(GL_TRUE); /* try to enable fog_coord */ - fogMode = SetFogMode(2); /* GL_EXP */ - - camz = -19.0f; + fogMode = SetFogMode(1); -#if ARRAYS glEnableClientState(GL_VERTEX_ARRAY); glVertexPointer(3, GL_FLOAT, 0, vertex_pointer); @@ -395,24 +401,24 @@ static void Init( void ) glTexCoordPointer(2, GL_FLOAT, 0, texcoord_pointer); if (have_fog_coord) { - glFogCoordPointer_ext = (GLFOGCOORDPOINTEREXTPROC)glutGetProcAddress("glFogCoordPointerEXT"); + glFogCoordPointer_ext = (PFNGLFOGCOORDPOINTEREXTPROC)glutGetProcAddress("glFogCoordPointerEXT"); glEnableClientState(GL_FOG_COORDINATE_ARRAY_EXT); glFogCoordPointer_ext(GL_FLOAT, 0, fogcoord_pointer); } -#endif + + Reset(); } -int main( int argc, char *argv[] ) +int +main( int argc, char *argv[] ) { glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 640, 480 ); + glutInitWindowSize( 600, 600 ); glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); glutCreateWindow(argv[0]); glutReshapeFunc( Reshape ); glutKeyboardFunc( Key ); - glutSpecialFunc( SpecialKey ); glutDisplayFunc( Display ); Init(); glutMainLoop(); -- cgit v1.2.3 From 6459adf79b0a3622515d5f2197a791538ca2f342 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Tue, 17 Apr 2007 07:05:15 +0000 Subject: r300: r300_render.c:391: warning: unused variable 'i' --- src/mesa/drivers/dri/r300/r300_render.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 63b21b9379a..ecd7fead263 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -388,7 +388,6 @@ int r300Fallback(GLcontext *ctx) struct r300_fragment_program *rp = (struct r300_fragment_program *) (char *)ctx->FragmentProgram._Current; - int i; if (rp) { if (!rp->translated) -- cgit v1.2.3 From 36949abec763e56a5356b65e2f2570cfed11d853 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 17 Apr 2007 14:01:42 +0200 Subject: cleanups for t_vb_program.c use VertexProgram._Current instead of VertexProgram.Current in a few more places. Only fixup fogc and psiz in case this is really a nv program (others are fine if undefined), and fix this case up so the values actually get written. --- src/mesa/tnl/t_vb_program.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index 260f9d7b1ab..3d7ea3a06ab 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -84,7 +84,7 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine) MEMCPY(machine->VertAttribs, ctx->Current.Attrib, MAX_VERTEX_PROGRAM_ATTRIBS * 4 * sizeof(GLfloat)); - if (ctx->VertexProgram.Current->IsNVProgram) { + if (ctx->VertexProgram._Current->IsNVProgram) { GLuint i; /* Output/result regs are initialized to [0,0,0,1] */ for (i = 0; i < MAX_NV_VERTEX_PROGRAM_OUTPUTS; i++) { @@ -225,7 +225,7 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage ) return GL_TRUE; #endif - if (ctx->VertexProgram.Current->IsNVProgram) { + if (program->IsNVProgram) { _mesa_load_tracked_matrices(ctx); } else { @@ -276,17 +276,6 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage ) /* execute the program */ _mesa_execute_program(ctx, &program->Base, &machine); - /* Fixup fog an point size results if needed */ - if (ctx->Fog.Enabled && - (program->Base.OutputsWritten & (1 << VERT_RESULT_FOGC)) == 0) { - machine.Outputs[VERT_RESULT_FOGC][0] = 1.0; - } - - if (ctx->VertexProgram.PointSizeEnabled && - (program->Base.OutputsWritten & (1 << VERT_RESULT_PSIZ)) == 0) { - machine.Outputs[VERT_RESULT_PSIZ][0] = ctx->Point.Size; - } - /* copy the output registers into the VB->attribs arrays */ for (j = 0; j < numOutputs; j++) { const GLuint attr = outputs[j]; @@ -301,6 +290,23 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage ) #endif } + /* Fixup fog and point size results if needed */ + if (program->IsNVProgram) { + if (ctx->Fog.Enabled && + (program->Base.OutputsWritten & (1 << VERT_RESULT_FOGC)) == 0) { + for (i = 0; i < VB->Count; i++) { + store->results[VERT_RESULT_FOGC].data[i][0] = 1.0; + } + } + + if (ctx->VertexProgram.PointSizeEnabled && + (program->Base.OutputsWritten & (1 << VERT_RESULT_PSIZ)) == 0) { + for (i = 0; i < VB->Count; i++) { + store->results[VERT_RESULT_PSIZ].data[i][0] = ctx->Point.Size; + } + } + } + /* Setup the VB pointers so that the next pipeline stages get * their data from the right place (the program output arrays). */ -- cgit v1.2.3 From 1a9483c95492bee3fbda131181945b6c878bf52f Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Tue, 17 Apr 2007 15:21:54 +0200 Subject: Defer buffer pool creation to the first context creation. This way we have a hw context so that we can take the hardware lock. Also, at this point, AIGLX isn't locked with the X server context as it is at screen creation. --- src/mesa/drivers/dri/i915tex/intel_context.c | 8 +++ src/mesa/drivers/dri/i915tex/intel_screen.c | 87 ++++++++++++++-------------- src/mesa/drivers/dri/i915tex/intel_screen.h | 3 + 3 files changed, 55 insertions(+), 43 deletions(-) diff --git a/src/mesa/drivers/dri/i915tex/intel_context.c b/src/mesa/drivers/dri/i915tex/intel_context.c index c6c66e26cae..20b2b41ef24 100644 --- a/src/mesa/drivers/dri/i915tex/intel_context.c +++ b/src/mesa/drivers/dri/i915tex/intel_context.c @@ -346,7 +346,15 @@ intelInitContext(struct intel_context *intel, drmI830Sarea *saPriv = (drmI830Sarea *) (((GLubyte *) sPriv->pSAREA) + intelScreen->sarea_priv_offset); int fthrottle_mode; + GLboolean havePools; + DRM_LIGHT_LOCK(sPriv->fd, &sPriv->pSAREA->lock, driContextPriv->hHWContext); + havePools = intelCreatePools(intelScreen); + DRM_UNLOCK(sPriv->fd, &sPriv->pSAREA->lock, driContextPriv->hHWContext); + + if (!havePools) + return GL_FALSE; + if (!_mesa_initialize_context(&intel->ctx, mesaVis, shareCtx, functions, (void *) intel)) diff --git a/src/mesa/drivers/dri/i915tex/intel_screen.c b/src/mesa/drivers/dri/i915tex/intel_screen.c index 87a5aeb17c9..dd01161b5bb 100644 --- a/src/mesa/drivers/dri/i915tex/intel_screen.c +++ b/src/mesa/drivers/dri/i915tex/intel_screen.c @@ -386,6 +386,45 @@ intelUpdateScreenFromSAREA(intelScreenPrivate * intelScreen, intelPrintSAREA(sarea); } +GLboolean +intelCreatePools(intelScreenPrivate *intelScreen) +{ + unsigned batchPoolSize = 1024*1024; + __DRIscreenPrivate * sPriv = intelScreen->driScrnPriv; + + if (intelScreen->havePools) + return GL_TRUE; + + batchPoolSize /= intelScreen->maxBatchSize; + intelScreen->regionPool = driDRMPoolInit(sPriv->fd); + + if (!intelScreen->regionPool) + return GL_FALSE; + + intelScreen->staticPool = driDRMStaticPoolInit(sPriv->fd); + + if (!intelScreen->staticPool) + return GL_FALSE; + + intelScreen->texPool = intelScreen->regionPool; + + intelScreen->batchPool = driBatchPoolInit(sPriv->fd, + DRM_BO_FLAG_EXE | + DRM_BO_FLAG_MEM_TT | + DRM_BO_FLAG_MEM_LOCAL, + intelScreen->maxBatchSize, + batchPoolSize, 5); + if (!intelScreen->batchPool) { + fprintf(stderr, "Failed to initialize batch pool - possible incorrect agpgart installed\n"); + return GL_FALSE; + } + + intel_recreate_static_regions(intelScreen); + intelScreen->havePools = GL_TRUE; + + return GL_TRUE; +} + static GLboolean intelInitDriver(__DRIscreenPrivate * sPriv) @@ -393,7 +432,6 @@ intelInitDriver(__DRIscreenPrivate * sPriv) intelScreenPrivate *intelScreen; I830DRIPtr gDRIPriv = (I830DRIPtr) sPriv->pDevPriv; drmI830Sarea *sarea; - unsigned batchPoolSize = 1024*1024; PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface-> @@ -426,7 +464,6 @@ intelInitDriver(__DRIscreenPrivate * sPriv) intelScreen->deviceID = gDRIPriv->deviceID; if (intelScreen->deviceID == PCI_CHIP_I865_G) intelScreen->maxBatchSize = 4096; - batchPoolSize /= intelScreen->maxBatchSize; intelScreen->mem = gDRIPriv->mem; intelScreen->cpp = gDRIPriv->cpp; @@ -517,31 +554,6 @@ intelInitDriver(__DRIscreenPrivate * sPriv) (*glx_enable_extension) (psc, "GLX_SGI_make_current_read"); } - intelScreen->regionPool = driDRMPoolInit(sPriv->fd); - - if (!intelScreen->regionPool) - return GL_FALSE; - - intelScreen->staticPool = driDRMStaticPoolInit(sPriv->fd); - - if (!intelScreen->staticPool) - return GL_FALSE; - - intelScreen->texPool = intelScreen->regionPool; - - intelScreen->batchPool = driBatchPoolInit(sPriv->fd, - DRM_BO_FLAG_EXE | - DRM_BO_FLAG_MEM_TT | - DRM_BO_FLAG_MEM_LOCAL, - intelScreen->maxBatchSize, - batchPoolSize, 5); - if (!intelScreen->batchPool) { - fprintf(stderr, "Failed to initialize batch pool - possible incorrect agpgart installed\n"); - return GL_FALSE; - } - - intel_recreate_static_regions(intelScreen); - return GL_TRUE; } @@ -553,9 +565,11 @@ intelDestroyScreen(__DRIscreenPrivate * sPriv) intelUnmapScreenRegions(intelScreen); - driPoolTakeDown(intelScreen->regionPool); - driPoolTakeDown(intelScreen->staticPool); - driPoolTakeDown(intelScreen->batchPool); + if (intelScreen->havePools) { + driPoolTakeDown(intelScreen->regionPool); + driPoolTakeDown(intelScreen->staticPool); + driPoolTakeDown(intelScreen->batchPool); + } FREE(intelScreen); sPriv->private = NULL; } @@ -878,19 +892,9 @@ __driCreateNewScreen_20050727(__DRInativeDisplay * dpy, int scrn, static const __DRIversion ddx_expected = { 1, 5, 0 }; static const __DRIversion dri_expected = { 4, 0, 0 }; static const __DRIversion drm_expected = { 1, 7, 0 }; - int tmpContextID; - GLuint tmpContext; dri_interface = interface; - if (!(*dri_interface->createContext)(dpy, modes->screen, - modes->fbconfigID, - &tmpContextID, &tmpContext)) { - fprintf(stderr, "Could not create temporary context.\n"); - return NULL; - } - DRM_LIGHT_LOCK(fd, &((drm_sarea_t *)pSAREA)->lock, tmpContext); - if (!driCheckDriDdxDrmVersions2("i915", dri_version, &dri_expected, ddx_version, &ddx_expected, @@ -903,9 +907,6 @@ __driCreateNewScreen_20050727(__DRInativeDisplay * dpy, int scrn, frame_buffer, pSAREA, fd, internal_api_version, &intelAPI); - DRM_UNLOCK(fd, &((drm_sarea_t *)pSAREA)->lock, tmpContext); - (void) (*dri_interface->destroyContext)(dpy, modes->screen, tmpContextID); - if (psp != NULL) { I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv; *driver_modes = intelFillInModes(dri_priv->cpp * 8, diff --git a/src/mesa/drivers/dri/i915tex/intel_screen.h b/src/mesa/drivers/dri/i915tex/intel_screen.h index 05e2f1f2eac..bac43aadddf 100644 --- a/src/mesa/drivers/dri/i915tex/intel_screen.h +++ b/src/mesa/drivers/dri/i915tex/intel_screen.h @@ -95,6 +95,7 @@ typedef struct struct _DriBufferPool *regionPool; struct _DriBufferPool *staticPool; unsigned int maxBatchSize; + GLboolean havePools; } intelScreenPrivate; @@ -130,5 +131,7 @@ extern struct intel_context *intelScreenContext(intelScreenPrivate *intelScreen) extern void intelUpdateScreenRotation(__DRIscreenPrivate * sPriv, drmI830Sarea * sarea); +extern GLboolean +intelCreatePools(intelScreenPrivate *intelScreen); #endif -- cgit v1.2.3 From 41fc55dd81ebf1def2d4a8df8fee849d6e97eaab Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 17 Apr 2007 08:29:37 -0600 Subject: don't set GL_TEXTURE_MAX_LEVEL for GL_TEXTURE_RECTANGLE_ARB as that generates an error --- src/mesa/main/attrib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 0df8d230500..e2cfb8a1f66 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -765,7 +765,8 @@ pop_texture_group(GLcontext *ctx, const struct gl_texture_attrib *texAttrib) _mesa_TexParameterf(target, GL_TEXTURE_MIN_LOD, obj->MinLod); _mesa_TexParameterf(target, GL_TEXTURE_MAX_LOD, obj->MaxLod); _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, obj->BaseLevel); - _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, obj->MaxLevel); + if (target != GL_TEXTURE_RECTANGLE_ARB) + _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, obj->MaxLevel); if (ctx->Extensions.EXT_texture_filter_anisotropic) { _mesa_TexParameterf(target, GL_TEXTURE_MAX_ANISOTROPY_EXT, obj->MaxAnisotropy); -- cgit v1.2.3 From 893b368a82c4d84b8f2c43c178e4f1881dbfe698 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 17 Apr 2007 09:15:57 -0600 Subject: more matrix function updates --- src/mesa/shader/slang/library/slang_120_core.gc | 396 ++++++++++++++++++------ 1 file changed, 300 insertions(+), 96 deletions(-) diff --git a/src/mesa/shader/slang/library/slang_120_core.gc b/src/mesa/shader/slang/library/slang_120_core.gc index e08716d97cf..15ca3a81ad7 100644 --- a/src/mesa/shader/slang/library/slang_120_core.gc +++ b/src/mesa/shader/slang/library/slang_120_core.gc @@ -1082,108 +1082,204 @@ vec3 __operator * (const mat4x3 m, const vec4 v) } -mat3x2 __operator * (const mat2 m, const mat3x2 n) { - return mat3x2 (m * n[0], m * n[1], m * n[2]); +mat3x2 __operator * (const mat2 m, const mat3x2 n) +{ + //return mat3x2 (m * n[0], m * n[1], m * n[2]); + __retVal[0] = m * n[0]; + __retVal[1] = m * n[1]; + __retVal[2] = m * n[2]; } -mat4x2 __operator * (const mat2 m, const mat4x2 n) { - return mat4x2 (m * n[0], m * n[1], m * n[2], m * n[3]); +mat4x2 __operator * (const mat2 m, const mat4x2 n) +{ + //return mat4x2 (m * n[0], m * n[1], m * n[2], m * n[3]); + __retVal[0] = m * n[0]; + __retVal[1] = m * n[1]; + __retVal[2] = m * n[2]; + __retVal[3] = m * n[3]; } -mat2x3 __operator * (const mat2x3 m, const mat2 n) { - return mat2x3 (m * n[0], m * n[1]); +mat2x3 __operator * (const mat2x3 m, const mat2 n) +{ + //return mat2x3 (m * n[0], m * n[1]); + __retVal[0] = m * n[0]; + __retVal[1] = m * n[1]; } -mat3 __operator * (const mat2x3 m, const mat3x2 n) { - return mat3 (m * n[0], m * n[1], m * n[2]); +mat3 __operator * (const mat2x3 m, const mat3x2 n) +{ + //return mat3 (m * n[0], m * n[1], m * n[2]); + __retVal[0] = m * n[0]; + __retVal[1] = m * n[1]; + __retVal[2] = m * n[2]; } -mat4x3 __operator * (const mat2x3 m, const mat4x2 n) { - return mat4x3 (m * n[0], m * n[1], m * n[2], m * n[3]); +mat4x3 __operator * (const mat2x3 m, const mat4x2 n) +{ + //return mat4x3 (m * n[0], m * n[1], m * n[2], m * n[3]); + __retVal[0] = m * n[0]; + __retVal[1] = m * n[1]; + __retVal[2] = m * n[2]; + __retVal[3] = m * n[3]; } -mat2x4 __operator * (const mat2x4 m, const mat2 n) { - return mat2x4 (m * n[0], m * n[1]); +mat2x4 __operator * (const mat2x4 m, const mat2 n) +{ + //return mat2x4 (m * n[0], m * n[1]); + __retVal[0] = m * n[0]; + __retVal[1] = m * n[1]; } -mat3x4 __operator * (const mat2x4 m, const mat3x2 n) { - return mat3x4 (m * n[0], m * n[1], m * n[2]); +mat3x4 __operator * (const mat2x4 m, const mat3x2 n) +{ + //return mat3x4 (m * n[0], m * n[1], m * n[2]); + __retVal[0] = m * n[0]; + __retVal[1] = m * n[1]; + __retVal[2] = m * n[2]; } -mat4 __operator * (const mat2x4 m, const mat4x2 n) { - return mat4 (m * n[0], m * n[1], m * n[2], m * n[3]); +mat4 __operator * (const mat2x4 m, const mat4x2 n) +{ + //return mat4 (m * n[0], m * n[1], m * n[2], m * n[3]); + __retVal[0] = m * n[0]; + __retVal[1] = m * n[1]; + __retVal[2] = m * n[2]; + __retVal[3] = m * n[3]; } -mat2 __operator * (const mat3x2 m, const mat2x3 n) { - return mat2 (m * n[0], m * n[1]); +mat2 __operator * (const mat3x2 m, const mat2x3 n) +{ + //return mat2 (m * n[0], m * n[1]); + __retVal[0] = m * n[0]; + __retVal[1] = m * n[1]; } -mat3x2 __operator * (const mat3x2 m, const mat3 n) { - return mat3x2 (m * n[0], m * n[1], m * n[2]); +mat3x2 __operator * (const mat3x2 m, const mat3 n) +{ + //return mat3x2 (m * n[0], m * n[1], m * n[2]); + __retVal[0] = m * n[0]; + __retVal[1] = m * n[1]; + __retVal[2] = m * n[2]; } -mat4x2 __operator * (const mat3x2 m, const mat4x3 n) { - return mat4x2 (m * n[0], m * n[1], m * n[2], m * n[3]); +mat4x2 __operator * (const mat3x2 m, const mat4x3 n) +{ + //return mat4x2 (m * n[0], m * n[1], m * n[2], m * n[3]); + __retVal[0] = m * n[0]; + __retVal[1] = m * n[1]; + __retVal[2] = m * n[2]; + __retVal[3] = m * n[3]; } -mat2x3 __operator * (const mat3 m, const mat2x3 n) { - return mat2x3 (m * n[0], m * n[1]); +mat2x3 __operator * (const mat3 m, const mat2x3 n) +{ + //return mat2x3 (m * n[0], m * n[1]); + __retVal[0] = m * n[0]; + __retVal[1] = m * n[1]; } -mat4x3 __operator * (const mat3 m, const mat4x3 n) { - return mat4x3 (m * n[0], m * n[1], m * n[2], m * n[3]); +mat4x3 __operator * (const mat3 m, const mat4x3 n) +{ + //return mat4x3 (m * n[0], m * n[1], m * n[2], m * n[3]); + __retVal[0] = m * n[0]; + __retVal[1] = m * n[1]; + __retVal[2] = m * n[2]; + __retVal[3] = m * n[3]; } -mat2x4 __operator * (const mat3x4 m, const mat2x3 n) { - return mat2x4 (m * n[0], m * n[1]); +mat2x4 __operator * (const mat3x4 m, const mat2x3 n) +{ + //return mat2x4 (m * n[0], m * n[1]); + __retVal[0] = m * n[0]; + __retVal[1] = m * n[1]; } -mat3x4 __operator * (const mat3x4 m, const mat3 n) { - return mat3x4 (m * n[0], m * n[1], m * n[2]); +mat3x4 __operator * (const mat3x4 m, const mat3 n) +{ + //return mat3x4 (m * n[0], m * n[1], m * n[2]); + __retVal[0] = m * n[0]; + __retVal[1] = m * n[1]; + __retVal[2] = m * n[2]; } -mat4 __operator * (const mat3x4 m, const mat4x3 n) { - return mat4 (m * n[0], m * n[1], m * n[2], m * n[3]); +mat4 __operator * (const mat3x4 m, const mat4x3 n) +{ + //return mat4 (m * n[0], m * n[1], m * n[2], m * n[3]); + __retVal[0] = m * n[0]; + __retVal[1] = m * n[1]; + __retVal[2] = m * n[2]; + __retVal[3] = m * n[3]; } -mat2 __operator * (const mat4x2 m, const mat2x4 n) { - return mat2 (m * n[0], m * n[1]); +mat2 __operator * (const mat4x2 m, const mat2x4 n) +{ + //return = mat2 (m * n[0], m * n[1]); + __retVal[0] = m * n[0]; + __retVal[1] = m * n[1]; } -mat3x2 __operator * (const mat4x2 m, const mat3x4 n) { - return mat3x2 (m * n[0], m * n[1], m * n[2]); +mat3x2 __operator * (const mat4x2 m, const mat3x4 n) +{ + //return mat3x2 (m * n[0], m * n[1], m * n[2]); + __retVal[0] = m * n[0]; + __retVal[1] = m * n[1]; + __retVal[2] = m * n[2]; } -mat4x2 __operator * (const mat4x2 m, const mat4 n) { - return mat4x2 (m * n[0], m * n[1], m * n[2], m * n[3]); +mat4x2 __operator * (const mat4x2 m, const mat4 n) +{ + //return mat4x2 (m * n[0], m * n[1], m * n[2], m * n[3]); + __retVal[0] = m * n[0]; + __retVal[1] = m * n[1]; + __retVal[2] = m * n[2]; + __retVal[3] = m * n[3]; } -mat2x3 __operator * (const mat4x3 m, const mat2x4 n) { - return mat2x3 (m * n[0], m * n[1]); +mat2x3 __operator * (const mat4x3 m, const mat2x4 n) +{ + //return mat2x3 (m * n[0], m * n[1]); + __retVal[0] = m * n[0]; + __retVal[1] = m * n[1]; } -mat3 __operator * (const mat4x3 m, const mat3x4 n) { - return mat3 (m * n[0], m * n[1], m * n[2]); +mat3 __operator * (const mat4x3 m, const mat3x4 n) +{ + //return mat3 (m * n[0], m * n[1], m * n[2]); + __retVal[0] = m * n[0]; + __retVal[1] = m * n[1]; + __retVal[2] = m * n[2]; } -mat4x3 __operator * (const mat4x3 m, const mat4 n) { - return mat4x3 (m * n[0], m * n[1], m * n[2], m * n[3]); +mat4x3 __operator * (const mat4x3 m, const mat4 n) +{ + //return mat4x3 (m * n[0], m * n[1], m * n[2], m * n[3]); + __retVal[0] = m * n[0]; + __retVal[1] = m * n[1]; + __retVal[2] = m * n[2]; + __retVal[3] = m * n[3]; } -mat2x4 __operator * (const mat4 m, const mat2x4 n) { - return mat2x4 (m * n[0], m * n[1]); +mat2x4 __operator * (const mat4 m, const mat2x4 n) +{ + //return mat2x4 (m * n[0], m * n[1]); + __retVal[0] = m * n[0]; + __retVal[1] = m * n[1]; } -mat3x4 __operator * (const mat4 m, const mat3x4 n) { - return mat3x4 (m * n[0], m * n[1], m * n[2]); +mat3x4 __operator * (const mat4 m, const mat3x4 n) +{ + //return mat3x4 (m * n[0], m * n[1], m * n[2]); + __retVal[0] = m * n[0]; + __retVal[1] = m * n[1]; + __retVal[2] = m * n[2]; } @@ -1576,101 +1672,209 @@ mat4x3 __operator - (const float a, const mat4x3 n) { } -mat2x3 __operator * (const float a, const mat2x3 n) { - return mat2x3 (a * n[0], a * n[1]); +mat2x3 __operator * (const float a, const mat2x3 n) +{ + //return mat2x3 (a * n[0], a * n[1]); + __retVal[0] = a * n[0]; + __retVal[1] = a * n[1]; } -mat2x3 __operator * (const mat2x3 m, const float b) { - return mat2x3 (m[0] * b, m[1] * b); +mat2x3 __operator * (const mat2x3 m, const float b) +{ + //return mat2x3 (m[0] * b, m[1] * b); + __retVal[0] = m[0] * b; + __retVal[1] = m[1] * b; } -mat2x4 __operator * (const float a, const mat2x4 n) { - return mat2x4 (a * n[0], a * n[1]); +mat2x4 __operator * (const float a, const mat2x4 n) +{ + //return mat2x4 (a * n[0], a * n[1]); + __retVal[0] = a * n[0]; + __retVal[1] = a * n[1]; } -mat2x4 __operator * (const mat2x4 m, const float b) { - return mat2x4 (m[0] * b, m[1] * b); +mat2x4 __operator * (const mat2x4 m, const float b) +{ + //return mat2x4 (m[0] * b, m[1] * b); + __retVal[0] = m[0] * b; + __retVal[1] = m[1] * b; } -mat3x2 __operator * (const float a, const mat3x2 n) { - return mat3x2 (a * n[0], a * n[1], a * n[2]); +mat3x2 __operator * (const float a, const mat3x2 n) +{ + //return mat3x2 (a * n[0], a * n[1], a * n[2]); + __retVal[0] = a * n[0]; + __retVal[1] = a * n[1]; + __retVal[2] = a * n[2]; } -mat3x2 __operator * (const mat3x2 m, const float b) { - return mat3x2 (m[0] * b, m[1] * b, m[2] * b); +mat3x2 __operator * (const mat3x2 m, const float b) +{ + //return mat3x2 (m[0] * b, m[1] * b, m[2] * b); + __retVal[0] = m[0] * b; + __retVal[1] = m[1] * b; + __retVal[2] = m[2] * b; } -mat3x4 __operator * (const float a, const mat3x4 n) { - return mat3x4 (a * n[0], a * n[1], a * n[2]); +mat3x4 __operator * (const float a, const mat3x4 n) +{ + //return mat3x4 (a * n[0], a * n[1], a * n[2]); + __retVal[0] = a * n[0]; + __retVal[1] = a * n[1]; + __retVal[2] = a * n[2]; } -mat3x4 __operator * (const mat3x4 m, const float b) { - return mat3x4 (m[0] * b, m[1] * b, m[2] * b); +mat3x4 __operator * (const mat3x4 m, const float b) +{ + //return mat3x4 (m[0] * b, m[1] * b, m[2] * b); + __retVal[0] = m[0] * b; + __retVal[1] = m[1] * b; + __retVal[2] = m[2] * b; } -mat4x2 __operator * (const mat4x2 m, const float b) { - return mat4x2 (m[0] * b, m[1] * b, m[2] * b, m[3] * b); +mat4x2 __operator * (const mat4x2 m, const float b) +{ + //return mat4x2 (m[0] * b, m[1] * b, m[2] * b, m[3] * b); + __retVal[0] = m[0] * b; + __retVal[1] = m[1] * b; + __retVal[2] = m[2] * b; + __retVal[3] = m[3] * b; } -mat4x2 __operator * (const float a, const mat4x2 n) { - return mat4x2 (a * n[0], a * n[1], a * n[2], a * n[3]); +mat4x2 __operator * (const float a, const mat4x2 n) +{ + //return mat4x2 (a * n[0], a * n[1], a * n[2], a * n[3]); + __retVal[0] = a * n[0]; + __retVal[1] = a * n[1]; + __retVal[2] = a * n[2]; + __retVal[3] = a * n[3]; } -mat4x3 __operator * (const mat4x3 m, const float b) { - return mat4x3 (m[0] * b, m[1] * b, m[2] * b, m[3] * b); +mat4x3 __operator * (const mat4x3 m, const float b) +{ + //return mat4x3 (m[0] * b, m[1] * b, m[2] * b, m[3] * b); + __retVal[0] = m[0] * b; + __retVal[1] = m[1] * b; + __retVal[2] = m[2] * b; + __retVal[3] = m[3] * b; } -mat4x3 __operator * (const float a, const mat4x3 n) { - return mat4x3 (a * n[0], a * n[1], a * n[2], a * n[3]); +mat4x3 __operator * (const float a, const mat4x3 n) +{ + //return mat4x3 (a * n[0], a * n[1], a * n[2], a * n[3]); + __retVal[0] = a * n[0]; + __retVal[1] = a * n[1]; + __retVal[2] = a * n[2]; + __retVal[3] = a * n[3]; } -mat2x3 __operator / (const float a, const mat2x3 n) { - return mat2x3 (a / n[0], a / n[1]); +mat2x3 __operator / (const float a, const mat2x3 n) +{ + //return mat2x3 (a / n[0], a / n[1]); + const float inv = 1.0 / a; + __retVal[0] = inv * n[0]; + __retVal[1] = inv * n[1]; } -mat2x3 __operator / (const mat2x3 m, const float b) { - return mat2x3 (m[0] / b, m[1] / b); +mat2x3 __operator / (const mat2x3 m, const float b) +{ + //return mat2x3 (m[0] / b, m[1] / b); + const float inv = 1.0 / b; + __retVal[0] = m[0] * inv; + __retVal[1] = m[1] * inv; } -mat2x4 __operator / (const float a, const mat2x4 n) { - return mat2x4 (a / n[0], a / n[1]); +mat2x4 __operator / (const float a, const mat2x4 n) +{ + //return mat2x4 (a / n[0], a / n[1]); + const float inv = 1.0 / a; + __retVal[0] = inv * n[0]; + __retVal[1] = inv * n[1]; } -mat2x4 __operator / (const mat2x4 m, const float b) { - return mat2x4 (m[0] / b, m[1] / b); +mat2x4 __operator / (const mat2x4 m, const float b) +{ + //return mat2x4 (m[0] / b, m[1] / b); + const float inv = 1.0 / b; + __retVal[0] = m[0] * inv; + __retVal[1] = m[1] * inv; } -mat3x2 __operator / (const float a, const mat3x2 n) { - return mat3x2 (a / n[0], a / n[1], a / n[2]); +mat3x2 __operator / (const float a, const mat3x2 n) +{ + //return mat3x2 (a / n[0], a / n[1], a / n[2]); + const float inv = 1.0 / a; + __retVal[0] = inv * n[0]; + __retVal[1] = inv * n[1]; + __retVal[2] = inv * n[2]; } -mat3x2 __operator / (const mat3x2 m, const float b) { - return mat3x2 (m[0] / b, m[1] / b, m[2] / b); +mat3x2 __operator / (const mat3x2 m, const float b) +{ + //return mat3x2 (m[0] / b, m[1] / b, m[2] / b); + const float inv = 1.0 / b; + __retVal[0] = m[0] * inv; + __retVal[1] = m[1] * inv; + __retVal[2] = m[2] * inv; } -mat3x4 __operator / (const float a, const mat3x4 n) { - return mat3x4 (a / n[0], a / n[1], a / n[2]); +mat3x4 __operator / (const float a, const mat3x4 n) +{ + //return mat3x4 (a / n[0], a / n[1], a / n[2]); + const float inv = 1.0 / a; + __retVal[0] = inv * n[0]; + __retVal[1] = inv * n[1]; + __retVal[2] = inv * n[2]; } -mat3x4 __operator / (const mat3x4 m, const float b) { - return mat3x4 (m[0] / b, m[1] / b, m[2] / b); +mat3x4 __operator / (const mat3x4 m, const float b) +{ + //return mat3x4 (m[0] / b, m[1] / b, m[2] / b); + const float inv = 1.0 / b; + __retVal[0] = m[0] * inv; + __retVal[1] = m[1] * inv; + __retVal[2] = m[2] * inv; } -mat4x2 __operator / (const mat4x2 m, const float b) { - return mat4x2 (m[0] / b, m[1] / b, m[2] / b, m[3] / b); +mat4x2 __operator / (const mat4x2 m, const float b) +{ + //return mat4x2 (m[0] / b, m[1] / b, m[2] / b, m[3] / b); + const float inv = 1.0 / b; + __retVal[0] = m[0] * inv; + __retVal[1] = m[1] * inv; + __retVal[2] = m[2] * inv; + __retVal[3] = m[3] * inv; } -mat4x2 __operator / (const float a, const mat4x2 n) { - return mat4x2 (a / n[0], a / n[1], a / n[2], a / n[3]); +mat4x2 __operator / (const float a, const mat4x2 n) +{ + //return mat4x2 (a / n[0], a / n[1], a / n[2], a / n[3]); + const float inv = 1.0 / a; + __retVal[0] = inv * n[0]; + __retVal[1] = inv * n[1]; + __retVal[2] = inv * n[2]; + __retVal[3] = inv * n[3]; } -mat4x3 __operator / (const mat4x3 m, const float b) { - return mat4x3 (m[0] / b, m[1] / b, m[2] / b, m[3] / b); +mat4x3 __operator / (const mat4x3 m, const float b) +{ + //return mat4x3 (m[0] / b, m[1] / b, m[2] / b, m[3] / b); + const float inv = 1.0 / b; + __retVal[0] = m[0] * inv; + __retVal[1] = m[1] * inv; + __retVal[2] = m[2] * inv; + __retVal[3] = m[3] * inv; } -mat4x3 __operator / (const float a, const mat4x3 n) { - return mat4x3 (a / n[0], a / n[1], a / n[2], a / n[3]); +mat4x3 __operator / (const float a, const mat4x3 n) +{ + //return mat4x3 (a / n[0], a / n[1], a / n[2], a / n[3]); + const float inv = 1.0 / a; + __retVal[0] = inv * n[0]; + __retVal[1] = inv * n[1]; + __retVal[2] = inv * n[2]; + __retVal[3] = inv * n[3]; } -- cgit v1.2.3 From 468a33d19a0187b55a01660c65306db128280bd3 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 17 Apr 2007 09:16:30 -0600 Subject: fix/simplify some texture functions --- .../shader/slang/library/slang_common_builtin.gc | 33 +++++++--------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/src/mesa/shader/slang/library/slang_common_builtin.gc b/src/mesa/shader/slang/library/slang_common_builtin.gc index ab14408046f..3780a38139d 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin.gc +++ b/src/mesa/shader/slang/library/slang_common_builtin.gc @@ -1609,11 +1609,8 @@ vec4 texture1D(const sampler1D sampler, const float coord) vec4 texture1DProj(const sampler1D sampler, const vec2 coord) { - // new coord with .z moved to .w - vec4 coord4; - coord4.x = coord.x; - coord4.w = coord.y; - __asm vec4_texp1d __retVal, sampler, coord4; + // need to swizzle .y into .w + __asm vec4_texp1d __retVal, sampler, coord.xyyy; } vec4 texture1DProj(const sampler1D sampler, const vec4 coord) @@ -1629,11 +1626,8 @@ vec4 texture2D(const sampler2D sampler, const vec2 coord) vec4 texture2DProj(const sampler2D sampler, const vec3 coord) { - // new coord with .z moved to .w - vec4 coord4; - coord4.xy = coord.xy; - coord4.w = coord.z; - __asm vec4_texp2d __retVal, sampler, coord4; + // need to swizzle 'z' into 'w'. + __asm vec4_texp2d __retVal, sampler, coord.xyzz; } vec4 texture2DProj(const sampler2D sampler, const vec4 coord) @@ -1667,11 +1661,8 @@ vec4 shadow1D(const sampler1DShadow sampler, const vec3 coord) vec4 shadow1DProj(const sampler1DShadow sampler, const vec4 coord) { - vec4 pcoord; - pcoord.x = coord.x / coord.w; - pcoord.z = coord.z; - pcoord.w = bias; - __asm vec4_tex1d __retVal, sampler, pcoord; + // .s and .p will be divided by .q + __asm vec4_texp1d __retVal, sampler, coord; } vec4 shadow2D(const sampler2DShadow sampler, const vec3 coord) @@ -1681,10 +1672,8 @@ vec4 shadow2D(const sampler2DShadow sampler, const vec3 coord) vec4 shadow2DProj(const sampler2DShadow sampler, const vec4 coord) { - vec4 pcoord; - pcoord.xy = coord.xy / coord.w; - pcoord.z = coord.z; - __asm vec4_tex2d __retVal, sampler, pcoord; + // .s, .t and .p will be divided by .q + __asm vec4_texp2d __retVal, sampler, coord; } @@ -1696,10 +1685,8 @@ vec4 texture2DRect(const sampler2DRect sampler, const vec2 coord) vec4 texture2DRectProj(const sampler2DRect sampler, const vec3 coord) { - // do projection here - vec4 pcoord; - pcoord.xy = coord.xy / coord.z; - __asm vec4_texp_rect __retVal, sampler, pcoord; + // need to swizzle .y into .w + __asm vec4_texp_rect __retVal, sampler, coord.xyzz; } vec4 texture2DRectProj(const sampler2DRect sampler, const vec4 coord) -- cgit v1.2.3 From 9cbcf7c696372c680c87cf60c2e290e78e9e14c8 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 17 Apr 2007 09:16:59 -0600 Subject: regenerated --- src/mesa/shader/slang/library/slang_120_core_gc.h | 593 ++++++++++++--------- .../shader/slang/library/slang_common_builtin_gc.h | 223 ++++---- 2 files changed, 438 insertions(+), 378 deletions(-) diff --git a/src/mesa/shader/slang/library/slang_120_core_gc.h b/src/mesa/shader/slang/library/slang_120_core_gc.h index ef00e027683..b7ef5ed6c64 100644 --- a/src/mesa/shader/slang/library/slang_120_core_gc.h +++ b/src/mesa/shader/slang/library/slang_120_core_gc.h @@ -363,276 +363,347 @@ 46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,122, 0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,122,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0, 57,59,122,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,122,0,48,46,20,0,0,1,0,27,2,21,1,1,0, -13,109,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18, -109,0,18,110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,29,2,21,1,1,0,13, -109,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18, -109,0,18,110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,18,109,0,18,110,0,16,10,51, -0,57,48,0,0,0,0,1,0,26,2,21,1,1,0,26,109,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18, -109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,14,2,21,1,1,0,26, -109,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97,116,51,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18, -110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,31,2,21,1,1,0,26,109,0,0,1, -1,0,29,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110, -0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,18,109,0,18,110,0,16,10,51,0,57,48,0,0,0, -0,1,0,28,2,21,1,1,0,28,109,0,0,1,1,0,13,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,18,110,0, -16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,30,2,21,1,1,0,28,109,0,0,1,1,0,27, -110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16, -10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,15,2,21,1,1,0,28,109,0,0,1,1,0,29, -110,0,0,0,1,8,58,109,97,116,52,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0, -57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,18,109,0,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,13,2, -21,1,1,0,27,109,0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,0,18,109,0,18,110,0,16,8,48,0,57,48,0, -18,109,0,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,27,2,21,1,1,0,27,109,0,0,1,1,0,14,110,0,0,0,1,8,58, -109,97,116,51,120,50,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,18, -109,0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,29,2,21,1,1,0,27,109,0,0,1,1,0,31,110,0,0,0,1,8,58,109, -97,116,52,120,50,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,18,109, -0,18,110,0,16,10,50,0,57,48,0,18,109,0,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,26,2,21,1,1,0,14,109, -0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0, -18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,31,2,21,1,1,0,14,109,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97, -116,52,120,51,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,18,109,0, -18,110,0,16,10,50,0,57,48,0,18,109,0,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,28,2,21,1,1,0,30,109,0, -0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18, -110,0,16,10,49,0,57,48,0,0,0,0,1,0,30,2,21,1,1,0,30,109,0,0,1,1,0,14,110,0,0,0,1,8,58,109,97,116, -51,120,52,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,18,109,0,18, -110,0,16,10,50,0,57,48,0,0,0,0,1,0,15,2,21,1,1,0,30,109,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116, -52,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16, -10,50,0,57,48,0,18,109,0,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,13,2,21,1,1,0,29,109,0,0,1,1,0,28, -110,0,0,0,1,8,58,109,97,116,50,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0, -57,48,0,0,0,0,1,0,27,2,21,1,1,0,29,109,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109, -0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57, -48,0,0,0,0,1,0,29,2,21,1,1,0,29,109,0,0,1,1,0,15,110,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0, -18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48, -0,18,109,0,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,26,2,21,1,1,0,31,109,0,0,1,1,0,28,110,0,0,0,1,8, -58,109,97,116,50,120,51,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0, -0,0,0,1,0,14,2,21,1,1,0,31,109,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,0,18,109,0,18,110,0,16, -8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0, -31,2,21,1,1,0,31,109,0,0,1,1,0,15,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,18,110,0,16,8, -48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,18,109,0,18, -110,0,16,10,51,0,57,48,0,0,0,0,1,0,28,2,21,1,1,0,15,109,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116, -50,120,52,0,18,109,0,18,110,0,16,8,48,0,57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,30, -2,21,1,1,0,15,109,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,18,110,0,16,8,48,0, -57,48,0,18,109,0,18,110,0,16,10,49,0,57,48,0,18,109,0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,0,2,3, -1,0,2,26,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,3,1,0,2,28, -109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,3,1,0,2,27,109,0,0,1,1, -0,14,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,3,1,0,2,30,109,0,0,1,1,0,14,110,0, -0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,3,1,0,2,29,109,0,0,1,1,0,15,110,0,0,0,1,9,18, -109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,3,1,0,2,31,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,18, -109,0,18,110,0,48,20,0,0,1,0,11,2,21,1,1,0,10,118,0,0,1,1,0,27,109,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,59,120,0,58,100,111,116,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,121,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,0, -12,2,21,1,1,0,10,118,0,0,1,1,0,29,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100, +13,109,0,0,1,1,0,27,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0, +16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0, +57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20, +0,0,1,0,29,2,21,1,1,0,13,109,0,0,1,1,0,29,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0, +57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109, +0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110, +0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,18,110,0,16,10, +51,0,57,48,20,0,0,1,0,26,2,21,1,1,0,26,109,0,0,1,1,0,13,110,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10, +49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,0,1,0,14,2,21,1,1,0,26,109,0,0,1,1,0,27,110,0,0,0, +1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,0,1,0,31,2,21,1,1,0,26, +109,0,0,1,1,0,29,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16, +8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57, +48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,9, +18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,18,110,0,16,10,51,0,57,48,20,0,0,1,0,28,2, +21,1,1,0,28,109,0,0,1,1,0,13,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0, +18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0, +16,10,49,0,57,48,20,0,0,1,0,30,2,21,1,1,0,28,109,0,0,1,1,0,27,110,0,0,0,1,9,18,95,95,114,101,116, +86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0, +16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50, +0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,0,1,0,15,2,21,1,1,0,28,109,0,0,1,1,0,29,110,0,0,0,1,9, +18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95, +114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97, +108,0,16,10,51,0,57,18,109,0,18,110,0,16,10,51,0,57,48,20,0,0,1,0,13,2,21,1,1,0,27,109,0,0,1,1,0, +26,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48, +20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,0,1, +0,27,2,21,1,1,0,27,109,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, +109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18, +110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16, +10,50,0,57,48,20,0,0,1,0,29,2,21,1,1,0,27,109,0,0,1,1,0,31,110,0,0,0,1,9,18,95,95,114,101,116,86, +97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16, +10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0, +57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109, +0,18,110,0,16,10,51,0,57,48,20,0,0,1,0,26,2,21,1,1,0,14,109,0,0,1,1,0,26,110,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,0,1,0,31,2,21,1,1,0,14,109,0,0,1, +1,0,31,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57, +48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9, +18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95, +114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,18,110,0,16,10,51,0,57,48,20,0,0,1,0,28,2,21,1,1,0, +30,109,0,0,1,1,0,26,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0, +16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0, +57,48,20,0,0,1,0,30,2,21,1,1,0,30,109,0,0,1,1,0,14,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, +16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0, +57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109, +0,18,110,0,16,10,50,0,57,48,20,0,0,1,0,15,2,21,1,1,0,30,109,0,0,1,1,0,31,110,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108, +0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10, +51,0,57,18,109,0,18,110,0,16,10,51,0,57,48,20,0,0,1,0,13,2,21,1,1,0,29,109,0,0,1,1,0,28,110,0,0,0, +1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,0,1,0,27,2,21,1,1, +0,29,109,0,0,1,1,0,30,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110, +0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49, +0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48, +20,0,0,1,0,29,2,21,1,1,0,29,109,0,0,1,1,0,15,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8, +48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18, +109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18, +110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,18,110,0,16, +10,51,0,57,48,20,0,0,1,0,26,2,21,1,1,0,31,109,0,0,1,1,0,28,110,0,0,0,1,9,18,95,95,114,101,116,86, +97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16, +10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,0,1,0,14,2,21,1,1,0,31,109,0,0,1,1,0,30,110,0,0, +0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,0,1,0,31,2,21,1,1,0,31, +109,0,0,1,1,0,15,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16, +8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57, +48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,9, +18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,18,110,0,16,10,51,0,57,48,20,0,0,1,0,28,2, +21,1,1,0,15,109,0,0,1,1,0,28,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0, +18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0, +16,10,49,0,57,48,20,0,0,1,0,30,2,21,1,1,0,15,109,0,0,1,1,0,30,110,0,0,0,1,9,18,95,95,114,101,116, +86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0, +16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50, +0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,0,1,0,0,2,3,1,0,2,26,109,0,0,1,1,0,13,110,0,0,0,1,9, +18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2,3,1,0,2,28,109,0,0,1,1,0,13,110,0,0,0,1,9,18,109,0,18, +109,0,18,110,0,48,20,0,0,1,0,0,2,3,1,0,2,27,109,0,0,1,1,0,14,110,0,0,0,1,9,18,109,0,18,109,0,18, +110,0,48,20,0,0,1,0,0,2,3,1,0,2,30,109,0,0,1,1,0,14,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20, +0,0,1,0,0,2,3,1,0,2,29,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,0,2, +3,1,0,2,31,109,0,0,1,1,0,15,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,0,11,2,21,1,1,0, +10,118,0,0,1,1,0,27,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,18, +118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116, +0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100, +111,116,0,18,118,0,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,0,12,2,21,1,1,0,10,118,0,0,1,1,0,29,109,0, +0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,18,118,0,0,18,109,0,16,8,48,0, +57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10, +49,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,18,118,0,0,18,109,0, +16,10,50,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,100,111,116,0,18,118,0,0,18, +109,0,16,10,51,0,57,0,0,20,0,0,1,0,10,2,21,1,1,0,11,118,0,0,1,1,0,26,109,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,59,120,0,58,100,111,116,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,0, +12,2,21,1,1,0,11,118,0,0,1,1,0,31,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100, 111,116,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58, 100,111,116,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122, 0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,50,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -59,119,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,51,0,57,0,0,20,0,0,1,0,10,2,21,1,1,0,11,118,0, -0,1,1,0,26,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,18,118,0,0,18, +59,119,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,51,0,57,0,0,20,0,0,1,0,10,2,21,1,1,0,12,118,0, +0,1,1,0,28,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,18,118,0,0,18, 109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,18,118,0, -0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,0,12,2,21,1,1,0,11,118,0,0,1,1,0,31,109,0,0,0,1,9,18,95,95, +0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,0,11,2,21,1,1,0,12,118,0,0,1,1,0,30,109,0,0,0,1,9,18,95,95, 114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18, 95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0, 9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,50,0,57,0,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,51,0, -57,0,0,20,0,0,1,0,10,2,21,1,1,0,12,118,0,0,1,1,0,28,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -59,120,0,58,100,111,116,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,59,121,0,58,100,111,116,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,0,11,2,21,1,1,0,12, -118,0,0,1,1,0,30,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,18,118,0, -0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,18, -118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116, -0,18,118,0,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,0,0,2,1,1,0,2,26,109,0,0,1,1,0,9,97,0,0,0,1,9,18, -109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,0,1,0,0,2,1,1,0,2,28,109,0,0, -1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,0,1, -0,0,2,1,1,0,2,27,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10, -49,0,57,18,97,0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,0,1,0,0,2,1,1,0,2,30,109,0,0,1,1,0,9,97, -0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,9,18,109,0,16, -10,50,0,57,18,97,0,21,0,0,1,0,0,2,1,1,0,2,29,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18, -97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,9,18,109,0, -16,10,51,0,57,18,97,0,21,0,0,1,0,0,2,1,1,0,2,31,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57, -18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,9,18,109, -0,16,10,51,0,57,18,97,0,21,0,0,1,0,0,2,2,1,0,2,26,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0, -57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,0,1,0,0,2,2,1,0,2,28,109,0,0,1,1,0,9,97,0,0, -0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,0,1,0,0,2,2,1,0,2, -27,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97, -0,22,0,9,18,109,0,16,10,50,0,57,18,97,0,22,0,0,1,0,0,2,2,1,0,2,30,109,0,0,1,1,0,9,97,0,0,0,1,9,18, -109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,9,18,109,0,16,10,50,0,57,18, -97,0,22,0,0,1,0,0,2,2,1,0,2,29,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9, -18,109,0,16,10,49,0,57,18,97,0,22,0,9,18,109,0,16,10,50,0,57,18,97,0,22,0,9,18,109,0,16,10,51,0,57, -18,97,0,22,0,0,1,0,0,2,2,1,0,2,31,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0, -9,18,109,0,16,10,49,0,57,18,97,0,22,0,9,18,109,0,16,10,50,0,57,18,97,0,22,0,9,18,109,0,16,10,51,0, -57,18,97,0,22,0,0,1,0,0,2,3,1,0,2,26,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23, -0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,0,1,0,0,2,3,1,0,2,28,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0, -16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,0,1,0,0,2,3,1,0,2,27,109,0,0,1,1,0, -9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109,0, -16,10,50,0,57,18,97,0,23,0,0,1,0,0,2,3,1,0,2,30,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57, -18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109,0,16,10,50,0,57,18,97,0,23,0,0,1,0,0,2, -3,1,0,2,29,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0, -57,18,97,0,23,0,9,18,109,0,16,10,50,0,57,18,97,0,23,0,9,18,109,0,16,10,51,0,57,18,97,0,23,0,0,1,0, -0,2,3,1,0,2,31,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49, -0,57,18,97,0,23,0,9,18,109,0,16,10,50,0,57,18,97,0,23,0,9,18,109,0,16,10,51,0,57,18,97,0,23,0,0,1, -0,0,2,4,1,0,2,26,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10, -49,0,57,18,97,0,24,0,0,1,0,0,2,4,1,0,2,28,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97, -0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,0,1,0,0,2,4,1,0,2,27,109,0,0,1,1,0,9,97,0,0,0,1,9,18, -109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,0,57,18, -97,0,24,0,0,1,0,0,2,4,1,0,2,30,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9, -18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,0,57,18,97,0,24,0,0,1,0,0,2,4,1,0,2,29,109, -0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0, -9,18,109,0,16,10,50,0,57,18,97,0,24,0,9,18,109,0,16,10,51,0,57,18,97,0,24,0,0,1,0,0,2,4,1,0,2,31, -109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0, -24,0,9,18,109,0,16,10,50,0,57,18,97,0,24,0,9,18,109,0,16,10,51,0,57,18,97,0,24,0,0,1,0,26,2,26,1,1, -0,26,109,0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8, -48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,0,0,0,1,0,28,2,26,1,1,0,28,109,0,0, -1,1,0,28,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0, -18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,0,0,0,1,0,27,2,26,1,1,0,27,109,0,0,1,1,0,27,110, -0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16, -10,49,0,57,18,110,0,16,10,49,0,57,46,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0,0,0,0,1, -0,30,2,26,1,1,0,30,109,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57, +20,0,0,1,0,0,2,1,1,0,2,26,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109, +0,16,10,49,0,57,18,97,0,21,0,0,1,0,0,2,1,1,0,2,28,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0, +57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,0,1,0,0,2,1,1,0,2,27,109,0,0,1,1,0,9,97,0,0, +0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,9,18,109,0,16,10,50, +0,57,18,97,0,21,0,0,1,0,0,2,1,1,0,2,30,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0, +21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,0,1,0,0,2,1,1,0,2, +29,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97, +0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,9,18,109,0,16,10,51,0,57,18,97,0,21,0,0,1,0,0,2,1,1,0, +2,31,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18, +97,0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,9,18,109,0,16,10,51,0,57,18,97,0,21,0,0,1,0,0,2,2, +1,0,2,26,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57, +18,97,0,22,0,0,1,0,0,2,2,1,0,2,28,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0, +9,18,109,0,16,10,49,0,57,18,97,0,22,0,0,1,0,0,2,2,1,0,2,27,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0, +16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,9,18,109,0,16,10,50,0,57,18,97,0, +22,0,0,1,0,0,2,2,1,0,2,30,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109, +0,16,10,49,0,57,18,97,0,22,0,9,18,109,0,16,10,50,0,57,18,97,0,22,0,0,1,0,0,2,2,1,0,2,29,109,0,0,1, +1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,9,18, +109,0,16,10,50,0,57,18,97,0,22,0,9,18,109,0,16,10,51,0,57,18,97,0,22,0,0,1,0,0,2,2,1,0,2,31,109,0, +0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,9, +18,109,0,16,10,50,0,57,18,97,0,22,0,9,18,109,0,16,10,51,0,57,18,97,0,22,0,0,1,0,0,2,3,1,0,2,26,109, +0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0, +0,1,0,0,2,3,1,0,2,28,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16, +10,49,0,57,18,97,0,23,0,0,1,0,0,2,3,1,0,2,27,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18, +97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109,0,16,10,50,0,57,18,97,0,23,0,0,1,0,0,2,3, +1,0,2,30,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57, +18,97,0,23,0,9,18,109,0,16,10,50,0,57,18,97,0,23,0,0,1,0,0,2,3,1,0,2,29,109,0,0,1,1,0,9,97,0,0,0,1, +9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109,0,16,10,50,0, +57,18,97,0,23,0,9,18,109,0,16,10,51,0,57,18,97,0,23,0,0,1,0,0,2,3,1,0,2,31,109,0,0,1,1,0,9,97,0,0, +0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109,0,16,10,50, +0,57,18,97,0,23,0,9,18,109,0,16,10,51,0,57,18,97,0,23,0,0,1,0,0,2,4,1,0,2,26,109,0,0,1,1,0,9,97,0, +0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,0,1,0,0,2,4,1,0,2, +28,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97, +0,24,0,0,1,0,0,2,4,1,0,2,27,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18, +109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,0,57,18,97,0,24,0,0,1,0,0,2,4,1,0,2,30,109,0, +0,1,1,0,9,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,9, +18,109,0,16,10,50,0,57,18,97,0,24,0,0,1,0,0,2,4,1,0,2,29,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0,16, +8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,0,57,18,97,0,24,0, +9,18,109,0,16,10,51,0,57,18,97,0,24,0,0,1,0,0,2,4,1,0,2,31,109,0,0,1,1,0,9,97,0,0,0,1,9,18,109,0, +16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,0,57,18,97,0, +24,0,9,18,109,0,16,10,51,0,57,18,97,0,24,0,0,1,0,26,2,26,1,1,0,26,109,0,0,1,1,0,26,110,0,0,0,1,8, +58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57, +18,110,0,16,10,49,0,57,46,0,0,0,0,1,0,28,2,26,1,1,0,28,109,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97, +116,50,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0, +16,10,49,0,57,46,0,0,0,0,1,0,27,2,26,1,1,0,27,109,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97,116,51,120, +50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0, +57,46,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0,0,0,0,1,0,30,2,26,1,1,0,30,109,0,0,1,1, +0,30,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18, +109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0, +0,0,0,1,0,29,2,26,1,1,0,29,109,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8, +48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,18,109,0,16, +10,50,0,57,18,110,0,16,10,50,0,57,46,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,46,0,0,0,0,1, +0,31,2,26,1,1,0,31,109,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57, 18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,18,109,0,16,10,50,0, -57,18,110,0,16,10,50,0,57,46,0,0,0,0,1,0,29,2,26,1,1,0,29,109,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97, -116,52,120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0, -16,10,49,0,57,46,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0,18,109,0,16,10,51,0,57,18, -110,0,16,10,51,0,57,46,0,0,0,0,1,0,31,2,26,1,1,0,31,109,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116, -52,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10, -49,0,57,46,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0,18,109,0,16,10,51,0,57,18,110,0,16, -10,51,0,57,46,0,0,0,0,1,0,26,2,27,1,1,0,26,109,0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,51, -0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57, -47,0,0,0,0,1,0,28,2,27,1,1,0,28,109,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0, -16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,0,0,0,1, -0,27,2,27,1,1,0,27,109,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57, -18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0, -57,18,110,0,16,10,50,0,57,47,0,0,0,0,1,0,30,2,27,1,1,0,30,109,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97, -116,51,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0, -16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,0,0,0,0,1,0,29,2,27,1,1,0,29, -109,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0, -57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16,10, -50,0,57,47,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,47,0,0,0,0,1,0,31,2,27,1,1,0,31,109,0,0, -1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0, -18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57, -47,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,47,0,0,0,0,1,0,26,2,22,1,1,0,26,109,0,0,1,1,0, -26,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109, -0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,0,0,0,1,0,28,2,22,1,1,0,28,109,0,0,1,1,0,28,110,0,0,0, -1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0, -57,18,110,0,16,10,49,0,57,49,0,0,0,0,1,0,27,2,22,1,1,0,27,109,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97, -116,51,120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0, -16,10,49,0,57,49,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,0,0,0,1,0,30,2,22,1,1,0,30, -109,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0, -57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,18,109,0,16,10,50,0,57,18,110,0,16,10, -50,0,57,49,0,0,0,0,1,0,29,2,22,1,1,0,29,109,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97,116,52,120,50,0, +57,18,110,0,16,10,50,0,57,46,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,46,0,0,0,0,1,0,26,2, +27,1,1,0,26,109,0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,110, +0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,0,0,0,1,0,28,2,27,1,1,0,28, +109,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0, +57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,0,0,0,1,0,27,2,27,1,1,0,27,109,0,0,1,1, +0,27,110,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18, +109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,0, +0,0,0,1,0,30,2,27,1,1,0,30,109,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8, +48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,18,109,0,16, +10,50,0,57,18,110,0,16,10,50,0,57,47,0,0,0,0,1,0,29,2,27,1,1,0,29,109,0,0,1,1,0,29,110,0,0,0,1,8, +58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57, +18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,0,18,109,0,16,10,51,0, +57,18,110,0,16,10,51,0,57,47,0,0,0,0,1,0,31,2,27,1,1,0,31,109,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97, +116,52,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0, +16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,0,18,109,0,16,10,51,0,57,18, +110,0,16,10,51,0,57,47,0,0,0,0,1,0,26,2,22,1,1,0,26,109,0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116, +50,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10, +49,0,57,49,0,0,0,0,1,0,28,2,22,1,1,0,28,109,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116,50,120,52,0, 18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49, -0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57, -49,0,0,0,0,1,0,31,2,22,1,1,0,31,109,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0, -16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,18,109, -0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,49,0,0,0, -0,1,0,26,2,26,1,1,0,9,97,0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18,97,0,18,110,0,16, -8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,0,0,0,1,0,26,2,26,1,1,0,26,109,0,0,1,1,0,9,98,0, -0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98, -0,46,0,0,0,0,1,0,28,2,26,1,1,0,9,97,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,97,0, -18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,0,0,0,1,0,28,2,26,1,1,0,28,109,0,0, -1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10, -49,0,57,18,98,0,46,0,0,0,0,1,0,27,2,26,1,1,0,9,97,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97,116,51,120, -50,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10, -50,0,57,46,0,0,0,0,1,0,27,2,26,1,1,0,27,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,120,50,0,18, -109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0, -46,0,0,0,0,1,0,30,2,26,1,1,0,9,97,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,97,0,18, -110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,0, -0,0,1,0,30,2,26,1,1,0,30,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0, -57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0,46,0,0,0,0,1,0, -29,2,26,1,1,0,29,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,18, -98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0,46,0,18,109,0,16,10, -51,0,57,18,98,0,46,0,0,0,0,1,0,29,2,26,1,1,0,9,97,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97,116,52,120, -50,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10, -50,0,57,46,0,18,97,0,18,110,0,16,10,51,0,57,46,0,0,0,0,1,0,31,2,26,1,1,0,31,109,0,0,1,1,0,9,98,0,0, -0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0, -46,0,18,109,0,16,10,50,0,57,18,98,0,46,0,18,109,0,16,10,51,0,57,18,98,0,46,0,0,0,0,1,0,31,2,26,1,1, -0,9,97,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18, -97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,18,97,0,18,110,0,16,10,51,0, -57,46,0,0,0,0,1,0,26,2,27,1,1,0,9,97,0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18,97,0, -18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,0,0,0,1,0,26,2,27,1,1,0,26,109,0,0, -1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10, -49,0,57,18,98,0,47,0,0,0,0,1,0,28,2,27,1,1,0,9,97,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116,50,120, -52,0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,0,0,0,1,0,28,2,27,1,1, -0,28,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18, -109,0,16,10,49,0,57,18,98,0,47,0,0,0,0,1,0,27,2,27,1,1,0,9,97,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97, -116,51,120,50,0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18, -110,0,16,10,50,0,57,47,0,0,0,0,1,0,27,2,27,1,1,0,27,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51, -120,50,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,18,109,0,16,10,50, -0,57,18,98,0,47,0,0,0,0,1,0,30,2,27,1,1,0,9,97,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,52, -0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50, -0,57,47,0,0,0,0,1,0,30,2,27,1,1,0,30,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109, -0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47, -0,0,0,0,1,0,29,2,27,1,1,0,29,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8, -48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,18, -109,0,16,10,51,0,57,18,98,0,47,0,0,0,0,1,0,29,2,27,1,1,0,9,97,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97, -116,52,120,50,0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18, -110,0,16,10,50,0,57,47,0,18,97,0,18,110,0,16,10,51,0,57,47,0,0,0,0,1,0,31,2,27,1,1,0,31,109,0,0,1, -1,0,9,98,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49, -0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,18,109,0,16,10,51,0,57,18,98,0,47,0,0,0,0,1, -0,31,2,27,1,1,0,9,97,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,97,0,18,110,0,16,8,48, -0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0,57,47,0,18,97,0,18,110,0, -16,10,51,0,57,47,0,0,0,0,1,0,26,2,21,1,1,0,9,97,0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,51, -0,18,97,0,18,110,0,16,8,48,0,57,48,0,18,97,0,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,26,2,21,1,1,0, -26,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,98,0,48,0,18, -109,0,16,10,49,0,57,18,98,0,48,0,0,0,0,1,0,28,2,21,1,1,0,9,97,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97, -116,50,120,52,0,18,97,0,18,110,0,16,8,48,0,57,48,0,18,97,0,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0, -28,2,21,1,1,0,28,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,18, -98,0,48,0,18,109,0,16,10,49,0,57,18,98,0,48,0,0,0,0,1,0,27,2,21,1,1,0,9,97,0,0,1,1,0,27,110,0,0,0, -1,8,58,109,97,116,51,120,50,0,18,97,0,18,110,0,16,8,48,0,57,48,0,18,97,0,18,110,0,16,10,49,0,57,48, -0,18,97,0,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,27,2,21,1,1,0,27,109,0,0,1,1,0,9,98,0,0,0,1,8,58, -109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,18,98,0,48,0,18,109,0,16,10,49,0,57,18,98,0,48,0,18, -109,0,16,10,50,0,57,18,98,0,48,0,0,0,0,1,0,30,2,21,1,1,0,9,97,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97, -116,51,120,52,0,18,97,0,18,110,0,16,8,48,0,57,48,0,18,97,0,18,110,0,16,10,49,0,57,48,0,18,97,0,18, -110,0,16,10,50,0,57,48,0,0,0,0,1,0,30,2,21,1,1,0,30,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51, -120,52,0,18,109,0,16,8,48,0,57,18,98,0,48,0,18,109,0,16,10,49,0,57,18,98,0,48,0,18,109,0,16,10,50, -0,57,18,98,0,48,0,0,0,0,1,0,29,2,21,1,1,0,29,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,120,50, -0,18,109,0,16,8,48,0,57,18,98,0,48,0,18,109,0,16,10,49,0,57,18,98,0,48,0,18,109,0,16,10,50,0,57,18, -98,0,48,0,18,109,0,16,10,51,0,57,18,98,0,48,0,0,0,0,1,0,29,2,21,1,1,0,9,97,0,0,1,1,0,29,110,0,0,0, -1,8,58,109,97,116,52,120,50,0,18,97,0,18,110,0,16,8,48,0,57,48,0,18,97,0,18,110,0,16,10,49,0,57,48, -0,18,97,0,18,110,0,16,10,50,0,57,48,0,18,97,0,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,31,2,21,1,1,0, -31,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,18,98,0,48,0,18, -109,0,16,10,49,0,57,18,98,0,48,0,18,109,0,16,10,50,0,57,18,98,0,48,0,18,109,0,16,10,51,0,57,18,98, -0,48,0,0,0,0,1,0,31,2,21,1,1,0,9,97,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,97,0, -18,110,0,16,8,48,0,57,48,0,18,97,0,18,110,0,16,10,49,0,57,48,0,18,97,0,18,110,0,16,10,50,0,57,48,0, -18,97,0,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,26,2,22,1,1,0,9,97,0,0,1,1,0,26,110,0,0,0,1,8,58,109, -97,116,50,120,51,0,18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10,49,0,57,49,0,0,0,0,1, -0,26,2,22,1,1,0,26,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18, -98,0,49,0,18,109,0,16,10,49,0,57,18,98,0,49,0,0,0,0,1,0,28,2,22,1,1,0,9,97,0,0,1,1,0,28,110,0,0,0, -1,8,58,109,97,116,50,120,52,0,18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10,49,0,57,49, -0,0,0,0,1,0,28,2,22,1,1,0,28,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8, -48,0,57,18,98,0,49,0,18,109,0,16,10,49,0,57,18,98,0,49,0,0,0,0,1,0,27,2,22,1,1,0,9,97,0,0,1,1,0,27, -110,0,0,0,1,8,58,109,97,116,51,120,50,0,18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10, -49,0,57,49,0,18,97,0,18,110,0,16,10,50,0,57,49,0,0,0,0,1,0,27,2,22,1,1,0,27,109,0,0,1,1,0,9,98,0,0, -0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,18,98,0,49,0,18,109,0,16,10,49,0,57,18,98,0, -49,0,18,109,0,16,10,50,0,57,18,98,0,49,0,0,0,0,1,0,30,2,22,1,1,0,9,97,0,0,1,1,0,30,110,0,0,0,1,8, -58,109,97,116,51,120,52,0,18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10,49,0,57,49,0, -18,97,0,18,110,0,16,10,50,0,57,49,0,0,0,0,1,0,30,2,22,1,1,0,30,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109, -97,116,51,120,52,0,18,109,0,16,8,48,0,57,18,98,0,49,0,18,109,0,16,10,49,0,57,18,98,0,49,0,18,109,0, -16,10,50,0,57,18,98,0,49,0,0,0,0,1,0,29,2,22,1,1,0,29,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116, -52,120,50,0,18,109,0,16,8,48,0,57,18,98,0,49,0,18,109,0,16,10,49,0,57,18,98,0,49,0,18,109,0,16,10, -50,0,57,18,98,0,49,0,18,109,0,16,10,51,0,57,18,98,0,49,0,0,0,0,1,0,29,2,22,1,1,0,9,97,0,0,1,1,0,29, -110,0,0,0,1,8,58,109,97,116,52,120,50,0,18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10, -49,0,57,49,0,18,97,0,18,110,0,16,10,50,0,57,49,0,18,97,0,18,110,0,16,10,51,0,57,49,0,0,0,0,1,0,31, -2,22,1,1,0,31,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,18,98,0, -49,0,18,109,0,16,10,49,0,57,18,98,0,49,0,18,109,0,16,10,50,0,57,18,98,0,49,0,18,109,0,16,10,51,0, -57,18,98,0,49,0,0,0,0,1,0,31,2,22,1,1,0,9,97,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0, -18,97,0,18,110,0,16,8,48,0,57,49,0,18,97,0,18,110,0,16,10,49,0,57,49,0,18,97,0,18,110,0,16,10,50,0, -57,49,0,18,97,0,18,110,0,16,10,51,0,57,49,0,0,0,0,1,0,26,2,27,1,1,0,26,109,0,0,0,1,8,58,109,97,116, -50,120,51,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,0,0,0,1,0,28,2,27,1,1,0,28,109, -0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,0,0,0,1, -0,27,2,27,1,1,0,27,109,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16, -10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0,0,0,0,1,0,30,2,27,1,1,0,30,109,0,0,0,1,8,58,109,97,116, -51,120,52,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0,0,0, -0,1,0,29,2,27,1,1,0,29,109,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,54,0,18,109,0, -16,10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0,18,109,0,16,10,51,0,57,54,0,0,0,0,1,0,31,2,27,1,1,0, -31,109,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0, -18,109,0,16,10,50,0,57,54,0,18,109,0,16,10,51,0,57,54,0,0,0,0,1,0,0,2,25,1,0,2,26,109,0,0,0,1,9,18, -109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,0,1,0,0,2,25,1,0,2,28,109,0,0,0,1,9,18,109,0, -16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,0,1,0,0,2,25,1,0,2,27,109,0,0,0,1,9,18,109,0,16,8, -48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57,52,0,0,1,0,0,2,25,1,0,2,30,109, -0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57,52,0,0, -1,0,0,2,25,1,0,2,29,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,9,18, -109,0,16,10,50,0,57,52,0,9,18,109,0,16,10,51,0,57,52,0,0,1,0,0,2,25,1,0,2,31,109,0,0,0,1,9,18,109, -0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57,52,0,9,18,109,0,16,10, -51,0,57,52,0,0,1,0,0,2,24,1,0,2,26,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0, -57,51,0,0,1,0,0,2,24,1,0,2,28,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51, -0,0,1,0,0,2,24,1,0,2,27,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,9, -18,109,0,16,10,50,0,57,51,0,0,1,0,0,2,24,1,0,2,30,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18, +0,0,0,0,1,0,27,2,22,1,1,0,27,109,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16, +8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,18,109,0, +16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,0,0,0,1,0,30,2,22,1,1,0,30,109,0,0,1,1,0,30,110,0,0,0,1, +8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0, +57,18,110,0,16,10,49,0,57,49,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,0,0,0,1,0,29,2, +22,1,1,0,29,109,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,18,110, +0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,18,109,0,16,10,50,0,57,18, +110,0,16,10,50,0,57,49,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,49,0,0,0,0,1,0,31,2,22,1,1, +0,31,109,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8, +48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,18,109,0,16,10,50,0,57,18,110,0,16, +10,50,0,57,49,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,49,0,0,0,0,1,0,26,2,26,1,1,0,9,97,0, +0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18, +110,0,16,10,49,0,57,46,0,0,0,0,1,0,26,2,26,1,1,0,26,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,50, +120,51,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,0,0,0,1,0,28,2,26, +1,1,0,9,97,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,97,0,18,110,0,16,8,48,0,57,46,0, +18,97,0,18,110,0,16,10,49,0,57,46,0,0,0,0,1,0,28,2,26,1,1,0,28,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109, +97,116,50,120,52,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,0,0,0,1, +0,27,2,26,1,1,0,9,97,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97,116,51,120,50,0,18,97,0,18,110,0,16,8,48, +0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,0,0,0,1,0,27,2, +26,1,1,0,27,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,18,98,0, +46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0,46,0,0,0,0,1,0,30,2,26,1,1, +0,9,97,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18, +97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,0,0,0,1,0,30,2,26,1,1,0,30, +109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0, +16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0,46,0,0,0,0,1,0,29,2,26,1,1,0,29,109,0,0, +1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10, +49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0,46,0,18,109,0,16,10,51,0,57,18,98,0,46,0,0,0,0, +1,0,29,2,26,1,1,0,9,97,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97,116,52,120,50,0,18,97,0,18,110,0,16,8, +48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,18,97,0,18, +110,0,16,10,51,0,57,46,0,0,0,0,1,0,31,2,26,1,1,0,31,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52, +120,51,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50, +0,57,18,98,0,46,0,18,109,0,16,10,51,0,57,18,98,0,46,0,0,0,0,1,0,31,2,26,1,1,0,9,97,0,0,1,1,0,31, +110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10, +49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,18,97,0,18,110,0,16,10,51,0,57,46,0,0,0,0,1,0,26, +2,27,1,1,0,9,97,0,0,1,1,0,26,110,0,0,0,1,8,58,109,97,116,50,120,51,0,18,97,0,18,110,0,16,8,48,0,57, +47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,0,0,0,1,0,26,2,27,1,1,0,26,109,0,0,1,1,0,9,98,0,0,0,1,8, +58,109,97,116,50,120,51,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,0, +0,0,1,0,28,2,27,1,1,0,9,97,0,0,1,1,0,28,110,0,0,0,1,8,58,109,97,116,50,120,52,0,18,97,0,18,110,0, +16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,0,0,0,1,0,28,2,27,1,1,0,28,109,0,0,1,1,0,9, +98,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57, +18,98,0,47,0,0,0,0,1,0,27,2,27,1,1,0,9,97,0,0,1,1,0,27,110,0,0,0,1,8,58,109,97,116,51,120,50,0,18, +97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0,57, +47,0,0,0,0,1,0,27,2,27,1,1,0,27,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16, +8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,0,0, +0,1,0,30,2,27,1,1,0,9,97,0,0,1,1,0,30,110,0,0,0,1,8,58,109,97,116,51,120,52,0,18,97,0,18,110,0,16, +8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0,57,47,0,0,0,0,1,0, +30,2,27,1,1,0,30,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,51,120,52,0,18,109,0,16,8,48,0,57,18, +98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,0,0,0,1,0,29,2, +27,1,1,0,29,109,0,0,1,1,0,9,98,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,18,98,0, +47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,18,109,0,16,10,51,0, +57,18,98,0,47,0,0,0,0,1,0,29,2,27,1,1,0,9,97,0,0,1,1,0,29,110,0,0,0,1,8,58,109,97,116,52,120,50,0, +18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0, +57,47,0,18,97,0,18,110,0,16,10,51,0,57,47,0,0,0,0,1,0,31,2,27,1,1,0,31,109,0,0,1,1,0,9,98,0,0,0,1, +8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0, +18,109,0,16,10,50,0,57,18,98,0,47,0,18,109,0,16,10,51,0,57,18,98,0,47,0,0,0,0,1,0,31,2,27,1,1,0,9, +97,0,0,1,1,0,31,110,0,0,0,1,8,58,109,97,116,52,120,51,0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0, +18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0,57,47,0,18,97,0,18,110,0,16,10,51,0,57,47, +0,0,0,0,1,0,26,2,21,1,1,0,9,97,0,0,1,1,0,26,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48, +0,57,18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97, +0,18,110,0,16,10,49,0,57,48,20,0,0,1,0,26,2,21,1,1,0,26,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86, +97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,48,20,0,0,1,0,28,2,21,1,1,0,9,97,0,0,1,1,0, +28,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20, +0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,0,1,0,28, +2,21,1,1,0,28,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0, +16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0, +57,18,98,0,48,20,0,0,1,0,27,2,21,1,1,0,9,97,0,0,1,1,0,27,110,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10, +49,0,57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18, +97,0,18,110,0,16,10,50,0,57,48,20,0,0,1,0,27,2,21,1,1,0,27,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108, +0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,48,20,0,0,1,0,30,2,21,1,1,0,9,97,0,0,1,1,0,30,110,0, +0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18, +95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,48,20,0,0,1,0,30,2,21,1,1,0,30, +109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57, +18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,48, +20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,48,20,0,0,1,0, +29,2,21,1,1,0,29,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109, +0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49, +0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98, +0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,98,0,48,20,0, +0,1,0,29,2,21,1,1,0,9,97,0,0,1,1,0,29,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57, +18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18, +110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16, +10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,97,0,18,110,0,16,10,51,0,57, +48,20,0,0,1,0,31,2,21,1,1,0,31,109,0,0,1,1,0,9,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8, +48,0,57,18,109,0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18, +109,0,16,10,49,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16, +10,50,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57, +18,98,0,48,20,0,0,1,0,31,2,21,1,1,0,9,97,0,0,1,1,0,31,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108, +0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0, +57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0, +18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,97,0,18,110,0, +16,10,51,0,57,48,20,0,0,1,0,26,2,22,1,1,0,9,97,0,0,1,1,0,26,110,0,0,0,1,3,2,1,9,1,105,110,118,0,2, +17,49,0,48,0,0,18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,105,110,118,0,18, +110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,105,110,118,0,18, +110,0,16,10,49,0,57,48,20,0,0,1,0,26,2,22,1,1,0,26,109,0,0,1,1,0,9,98,0,0,0,1,3,2,1,9,1,105,110, +118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16, +8,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10, +49,0,57,18,105,110,118,0,48,20,0,0,1,0,28,2,22,1,1,0,9,97,0,0,1,1,0,28,110,0,0,0,1,3,2,1,9,1,105, +110,118,0,2,17,49,0,48,0,0,18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,105, +110,118,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,105, +110,118,0,18,110,0,16,10,49,0,57,48,20,0,0,1,0,28,2,22,1,1,0,28,109,0,0,1,1,0,9,98,0,0,0,1,3,2,1,9, +1,105,110,118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, +109,0,16,8,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18, +109,0,16,10,49,0,57,18,105,110,118,0,48,20,0,0,1,0,27,2,22,1,1,0,9,97,0,0,1,1,0,27,110,0,0,0,1,3,2, +1,9,1,105,110,118,0,2,17,49,0,48,0,0,18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0, +57,18,105,110,118,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57, +18,105,110,118,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57, +18,105,110,118,0,18,110,0,16,10,50,0,57,48,20,0,0,1,0,27,2,22,1,1,0,27,109,0,0,1,1,0,9,98,0,0,0,1, +3,2,1,9,1,105,110,118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48, +0,57,18,109,0,16,8,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0, +57,18,109,0,16,10,49,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0, +57,18,109,0,16,10,50,0,57,18,105,110,118,0,48,20,0,0,1,0,30,2,22,1,1,0,9,97,0,0,1,1,0,30,110,0,0,0, +1,3,2,1,9,1,105,110,118,0,2,17,49,0,48,0,0,18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8, +48,0,57,18,105,110,118,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49, +0,57,18,105,110,118,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0, +57,18,105,110,118,0,18,110,0,16,10,50,0,57,48,20,0,0,1,0,30,2,22,1,1,0,30,109,0,0,1,1,0,9,98,0,0,0, +1,3,2,1,9,1,105,110,118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8, +48,0,57,18,109,0,16,8,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49, +0,57,18,109,0,16,10,49,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0, +57,18,109,0,16,10,50,0,57,18,105,110,118,0,48,20,0,0,1,0,29,2,22,1,1,0,29,109,0,0,1,1,0,9,98,0,0,0, +1,3,2,1,9,1,105,110,118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8, +48,0,57,18,109,0,16,8,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49, +0,57,18,109,0,16,10,49,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0, +57,18,109,0,16,10,50,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0, +57,18,109,0,16,10,51,0,57,18,105,110,118,0,48,20,0,0,1,0,29,2,22,1,1,0,9,97,0,0,1,1,0,29,110,0,0,0, +1,3,2,1,9,1,105,110,118,0,2,17,49,0,48,0,0,18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8, +48,0,57,18,105,110,118,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49, +0,57,18,105,110,118,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0, +57,18,105,110,118,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0, +57,18,105,110,118,0,18,110,0,16,10,51,0,57,48,20,0,0,1,0,31,2,22,1,1,0,31,109,0,0,1,1,0,9,98,0,0,0, +1,3,2,1,9,1,105,110,118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8, +48,0,57,18,109,0,16,8,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49, +0,57,18,109,0,16,10,49,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0, +57,18,109,0,16,10,50,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0, +57,18,109,0,16,10,51,0,57,18,105,110,118,0,48,20,0,0,1,0,31,2,22,1,1,0,9,97,0,0,1,1,0,31,110,0,0,0, +1,3,2,1,9,1,105,110,118,0,2,17,49,0,48,0,0,18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8, +48,0,57,18,105,110,118,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49, +0,57,18,105,110,118,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0, +57,18,105,110,118,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0, +57,18,105,110,118,0,18,110,0,16,10,51,0,57,48,20,0,0,1,0,26,2,27,1,1,0,26,109,0,0,0,1,8,58,109,97, +116,50,120,51,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,0,0,0,1,0,28,2,27,1,1,0,28, +109,0,0,0,1,8,58,109,97,116,50,120,52,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,0,0, +0,1,0,27,2,27,1,1,0,27,109,0,0,0,1,8,58,109,97,116,51,120,50,0,18,109,0,16,8,48,0,57,54,0,18,109,0, +16,10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0,0,0,0,1,0,30,2,27,1,1,0,30,109,0,0,0,1,8,58,109,97, +116,51,120,52,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0, +0,0,0,1,0,29,2,27,1,1,0,29,109,0,0,0,1,8,58,109,97,116,52,120,50,0,18,109,0,16,8,48,0,57,54,0,18, +109,0,16,10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0,18,109,0,16,10,51,0,57,54,0,0,0,0,1,0,31,2,27, +1,1,0,31,109,0,0,0,1,8,58,109,97,116,52,120,51,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57, +54,0,18,109,0,16,10,50,0,57,54,0,18,109,0,16,10,51,0,57,54,0,0,0,0,1,0,0,2,25,1,0,2,26,109,0,0,0,1, +9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,0,1,0,0,2,25,1,0,2,28,109,0,0,0,1,9,18, +109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,0,1,0,0,2,25,1,0,2,27,109,0,0,0,1,9,18,109,0, +16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57,52,0,0,1,0,0,2,25,1,0,2, +30,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57, +52,0,0,1,0,0,2,25,1,0,2,29,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0, +9,18,109,0,16,10,50,0,57,52,0,9,18,109,0,16,10,51,0,57,52,0,0,1,0,0,2,25,1,0,2,31,109,0,0,0,1,9,18, +109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57,52,0,9,18,109,0,16, +10,51,0,57,52,0,0,1,0,0,2,24,1,0,2,26,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49, +0,57,51,0,0,1,0,0,2,24,1,0,2,28,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57, +51,0,0,1,0,0,2,24,1,0,2,27,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0, +9,18,109,0,16,10,50,0,57,51,0,0,1,0,0,2,24,1,0,2,30,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18, 109,0,16,10,49,0,57,51,0,9,18,109,0,16,10,50,0,57,51,0,0,1,0,0,2,24,1,0,2,29,109,0,0,0,1,9,18,109, 0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,9,18,109,0,16,10,50,0,57,51,0,9,18,109,0,16,10, 51,0,57,51,0,0,1,0,0,2,24,1,0,2,31,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0, diff --git a/src/mesa/shader/slang/library/slang_common_builtin_gc.h b/src/mesa/shader/slang/library/slang_common_builtin_gc.h index 85ab76ab1bc..52f6b172d6e 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin_gc.h +++ b/src/mesa/shader/slang/library/slang_common_builtin_gc.h @@ -670,126 +670,115 @@ 109,112,108,101,114,0,0,1,1,0,9,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,49,100,0, 18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0, 1,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,16,115,97,109,112,108,101,114,0, -0,1,1,0,10,99,111,111,114,100,0,0,0,1,3,2,0,12,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114, -100,52,0,59,120,0,18,99,111,111,114,100,0,59,120,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18, -99,111,111,114,100,0,59,121,0,20,0,4,118,101,99,52,95,116,101,120,112,49,100,0,18,95,95,114,101, -116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,0,12,0,116, -101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,16,115,97,109,112,108,101,114,0,0,1,1,0,12,99, -111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,49,100,0,18,95,95,114,101,116,86,97,108, -0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117, -114,101,50,68,0,1,1,0,17,115,97,109,112,108,101,114,0,0,1,1,0,10,99,111,111,114,100,0,0,0,1,4,118, -101,99,52,95,116,101,120,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114, -0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,1, -0,17,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,3,2,0,12,1,99,111,111,114, -100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,20,0,9, -18,99,111,111,114,100,52,0,59,119,0,18,99,111,111,114,100,0,59,122,0,20,0,4,118,101,99,52,95,116, -101,120,112,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99, -111,111,114,100,52,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,1,0,17, -115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120, -112,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111, -114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,0,1,1,0,18,115,97,109,112,108,101,114,0, -0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,51,100,0,18,95,95,114,101,116, -86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120, -116,117,114,101,51,68,80,114,111,106,0,1,1,0,18,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111, -114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,51,100,0,18,95,95,114,101,116,86,97,108,0,0,18, -115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101, -67,117,98,101,0,1,1,0,19,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118, -101,99,52,95,116,101,120,99,117,98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108, -101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,0,1,1,0,20,115,97, -109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,49,100, +0,1,1,0,10,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,49,100,0,18,95,95,114,101, +116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,120,121,121,121,0,0, +0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,16,115,97,109,112,108,101, +114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,49,100,0,18,95,95, +114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0, +116,101,120,116,117,114,101,50,68,0,1,1,0,17,115,97,109,112,108,101,114,0,0,1,1,0,10,99,111,111, +114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115, +97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50, +68,80,114,111,106,0,1,1,0,17,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4, +118,101,99,52,95,116,101,120,112,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108, +101,114,0,0,18,99,111,111,114,100,0,59,120,121,122,122,0,0,0,0,1,0,12,0,116,101,120,116,117,114, +101,50,68,80,114,111,106,0,1,1,0,17,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0, +0,1,4,118,101,99,52,95,116,101,120,112,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109, +112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,0,1,1, +0,18,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101, +120,51,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111, +114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,80,114,111,106,0,1,1,0,18,115,97,109, +112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,51,100, 0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0, -0,1,0,12,0,115,104,97,100,111,119,49,68,80,114,111,106,0,1,1,0,20,115,97,109,112,108,101,114,0,0,1, -1,0,12,99,111,111,114,100,0,0,0,1,3,2,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114, -100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112, -99,111,111,114,100,0,59,122,0,18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0, -59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,49,100,0,18,95,95,114,101,116,86, -97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97, -100,111,119,50,68,0,1,1,0,21,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4, -118,101,99,52,95,116,101,120,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, -114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,1,0, -21,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,3,2,0,12,1,112,99,111,111, -114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18, -99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99,111,111,114,100, -0,59,122,0,20,0,4,118,101,99,52,95,116,101,120,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115, -97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101, -50,68,82,101,99,116,0,1,1,0,22,115,97,109,112,108,101,114,0,0,1,1,0,10,99,111,111,114,100,0,0,0,1, -4,118,101,99,52,95,116,101,120,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97, -109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68, -82,101,99,116,80,114,111,106,0,1,1,0,22,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100, -0,0,0,1,3,2,0,12,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99, -111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,122,0,49,20,0,4,118,101,99,52,95,116,101, -120,112,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0, -18,112,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,82,101,99,116,80,114, -111,106,0,1,1,0,22,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99, -52,95,116,101,120,112,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108, -101,114,0,0,18,99,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,82,101,99,116,0, -1,1,0,23,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116, -101,120,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0, -18,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,82,101,99,116,80,114,111,106,0, -1,1,0,23,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116, -101,120,112,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0, -0,18,99,111,111,114,100,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,1,0,9,120,0,0,0,1,4,102,108,111, -97,116,95,110,111,105,115,101,49,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,9,0,110, -111,105,115,101,49,0,1,1,0,10,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,50,0,18,95, -95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,1,0,11,120,0,0,0,1, -4,102,108,111,97,116,95,110,111,105,115,101,51,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0, -1,0,9,0,110,111,105,115,101,49,0,1,1,0,12,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101, -52,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,9, -120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0, -51,52,0,0,46,0,0,20,0,0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,10,120,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,57,0,51,52,0,0,0, -17,55,0,54,54,0,0,0,0,46,0,0,20,0,0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,11,120,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51, -52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,0,1,0,10,0,110,111,105,115,101,50,0, -1,1,0,12,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18, -120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58, -118,101,99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0, -0,46,0,0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114,101,116,86,97, +0,1,0,12,0,116,101,120,116,117,114,101,67,117,98,101,0,1,1,0,19,115,97,109,112,108,101,114,0,0,1,1, +0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,99,117,98,101,0,18,95,95,114,101, +116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104, +97,100,111,119,49,68,0,1,1,0,20,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1, +4,118,101,99,52,95,116,101,120,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108, +101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,80,114,111,106,0,1, +1,0,20,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116, +101,120,112,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99, +111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,0,1,1,0,21,115,97,109,112,108,101, +114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,50,100,0,18,95,95,114, +101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,115, +104,97,100,111,119,50,68,80,114,111,106,0,1,1,0,21,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111, +111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,50,100,0,18,95,95,114,101,116,86,97,108,0,0, +18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114, +101,50,68,82,101,99,116,0,1,1,0,22,115,97,109,112,108,101,114,0,0,1,1,0,10,99,111,111,114,100,0,0, +0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115, +97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50, +68,82,101,99,116,80,114,111,106,0,1,1,0,22,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114, +100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108, +0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,120,121,122,122,0,0,0,0,1,0,12,0, +116,101,120,116,117,114,101,50,68,82,101,99,116,80,114,111,106,0,1,1,0,22,115,97,109,112,108,101, +114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,95,114,101,99,116,0, +18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,99,111,111,114,100,0,0, +0,0,1,0,12,0,115,104,97,100,111,119,50,68,82,101,99,116,0,1,1,0,23,115,97,109,112,108,101,114,0,0, +1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,0,18,95,95, +114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0, +115,104,97,100,111,119,50,68,82,101,99,116,80,114,111,106,0,1,1,0,23,115,97,109,112,108,101,114,0, +0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,95,114,101,99,116,0,18,95, +95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,9, +0,110,111,105,115,101,49,0,1,1,0,9,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,49,0,18, +95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,1,0,10,120,0,0,0, +1,4,102,108,111,97,116,95,110,111,105,115,101,50,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0, +0,1,0,9,0,110,111,105,115,101,49,0,1,1,0,11,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115, +101,51,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,1,0, +12,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,52,0,18,95,95,114,101,116,86,97,108,0,0, +18,120,0,0,0,0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114,101,116,86,97, 108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -121,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,17,53,0,52,55,0,0,46,0,0,20,0,0,1,0,11,0, -110,111,105,115,101,51,0,1,1,0,10,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, +121,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,0,1,0,10,0,110,111,105, +115,101,50,0,1,1,0,10,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115, +101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0, +18,120,0,58,118,101,99,50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,0,1,0,10,0, +110,111,105,115,101,50,0,1,1,0,11,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, +111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105, +115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51, +0,0,0,0,46,0,0,20,0,0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,12,120,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86, +97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,49,57,0,51,52,0,0,0, +17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105, +115,101,51,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115, +101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0, +18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111, +105,115,101,49,0,18,120,0,17,53,0,52,55,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1,1,0, +10,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0, +0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101, +99,50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108, +0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,53,0,52,55,0,0,0,17,49,55,0, +56,53,0,0,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1,1,0,11,120,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116, +86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52,0,0, +0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122, +0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0, +0,17,49,49,0,48,52,0,0,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1,1,0,12,120,0,0,0,1,9, +18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,49,57, +0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,53,0, +52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,20,0,0,1, +0,12,0,110,111,105,115,101,52,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58, +110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111, +105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, +122,0,58,110,111,105,115,101,49,0,18,120,0,17,53,0,52,55,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86, +97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120,0,17,50,51,0,53,52,0,0,46,0,0,20,0,0,1,0,12,0, +110,111,105,115,101,52,0,1,1,0,10,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, 111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105, 115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0, 9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50, -0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1,1, -0,11,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0, -0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118, -101,99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95, -95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,53, -0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105, -115,101,51,0,1,1,0,12,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115, -101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0, -18,120,0,58,118,101,99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0, -55,55,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0, -18,120,0,58,118,101,99,52,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17, -49,51,0,49,57,0,0,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0,9,120,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0, -9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,17,53,0,52,55,0,0, -46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120,0,17,50, -51,0,53,52,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0,10,120,0,0,0,1,9,18,95,95,114, +0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, +119,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49, +49,0,0,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0,11,120,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86, +97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52,0,0,0, +17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0, +58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0, +17,49,49,0,48,52,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105, +115,101,49,0,18,120,0,58,118,101,99,51,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0, +57,49,0,0,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0,12,120,0,0,0,1,9,18,95,95,114, 101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,57,0,51,52,0,0, -0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115, -101,49,0,18,120,0,58,118,101,99,50,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17, -50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0, -11,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0, -0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101, -99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,53,0, -52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,50,51,0,53,52,0,0,0, -17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1, -1,0,12,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120, -0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118, -101,99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0, -46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58, -118,101,99,52,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57, -0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120, -0,58,118,101,99,52,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,17,51,55, -0,52,56,0,0,0,0,46,0,0,20,0,0,0 +86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,49,57,0,51,52,0,0, +0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116, +86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,53,0,52,55,0,0,0, +17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,50,51,0,53, +52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,17,51,55,0,52,56,0,0,0,0,46,0,0,20,0,0,0 -- cgit v1.2.3 From d2d86a3f0b38716196ea2b3ffa4cbbd0420de1b3 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 17 Apr 2007 10:19:47 -0600 Subject: In bind_inputs() set VB->EdgeFlag to NULL if it's not needed. Otherwise, the clip/interp code was finding VB->EdgeFlag to be non-null and reading/writing it when the memory may have been freed earlier in free_space(). This fixes several VTK segfaults/failures reported by Brad King @ Kitware. --- src/mesa/tnl/t_draw.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c index c97cf5f7b21..5b2b2ae5495 100644 --- a/src/mesa/tnl/t_draw.c +++ b/src/mesa/tnl/t_draw.c @@ -251,7 +251,10 @@ static void bind_inputs( GLcontext *ctx, VB->AttribPtr[_TNL_ATTRIB_EDGEFLAG], VB->Count ); } - + else { + /* the data previously pointed to by EdgeFlag may have been freed */ + VB->EdgeFlag = NULL; + } } -- cgit v1.2.3 From 04bda46739beb0dab7c8820bdbe67136470d42be Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 17 Apr 2007 15:56:46 -0600 Subject: Enable texture sampling for vertex programs/shaders. This is a bit of a hack for now because the tnl module is using the swrast module to fetch texels. The texture fetch/filter code should probably be moved into the main/ module since it doesn't really depend upon other swrast code. --- src/mesa/main/texstate.c | 25 +++++++++++++------ src/mesa/swrast/s_context.c | 4 ++-- src/mesa/swrast/s_context.h | 3 +++ src/mesa/tnl/t_vb_program.c | 58 ++++++++++++++++++++++++++++++++++++--------- 4 files changed, 70 insertions(+), 20 deletions(-) diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 51e19b7f4e7..197e8212ad0 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -2921,17 +2921,24 @@ static void update_texture_state( GLcontext *ctx ) { GLuint unit; - struct gl_fragment_program *fprog; + struct gl_fragment_program *fprog = NULL; + struct gl_vertex_program *vprog = NULL; if (ctx->Shader.CurrentProgram && ctx->Shader.CurrentProgram->LinkStatus) { fprog = ctx->Shader.CurrentProgram->FragmentProgram; - } - else if (ctx->FragmentProgram._Enabled) { - fprog = ctx->FragmentProgram.Current; + vprog = ctx->Shader.CurrentProgram->VertexProgram; } else { - fprog = NULL; + if (ctx->FragmentProgram._Enabled) { + fprog = ctx->FragmentProgram.Current; + } + if (ctx->VertexProgram._Enabled) { + /* XXX enable this if/when non-shader vertex programs get + * texture fetches: + vprog = ctx->VertexProgram.Current; + */ + } } ctx->NewState |= _NEW_TEXTURE; /* TODO: only set this if there are @@ -2960,8 +2967,12 @@ update_texture_state( GLcontext *ctx ) * by a fragment shader/program. When multiple flags are set, we'll * settle on the one with highest priority (see texture_override below). */ - if (fprog) { - enableBits = fprog->Base.TexturesUsed[unit]; + if (fprog || vprog) { + enableBits = 0x0; + if (fprog) + enableBits |= fprog->Base.TexturesUsed[unit]; + if (vprog) + enableBits |= vprog->Base.TexturesUsed[unit]; } else { if (!texUnit->Enabled) diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index e113adb6892..c8efb962d03 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -488,7 +488,7 @@ _swrast_invalidate_state( GLcontext *ctx, GLbitfield new_state ) } -static void +void _swrast_update_texture_samplers(GLcontext *ctx) { SWcontext *swrast = SWRAST_CONTEXT(ctx); @@ -617,7 +617,7 @@ _swrast_validate_derived( GLcontext *ctx ) _NEW_PROGRAM)) _swrast_update_fragment_program( ctx, swrast->NewState ); - if (swrast->NewState & _NEW_TEXTURE) + if (swrast->NewState & (_NEW_TEXTURE | _NEW_PROGRAM)) _swrast_update_texture_samplers( ctx ); if (swrast->NewState & (_NEW_TEXTURE | _NEW_PROGRAM)) diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h index 3a9a48922ef..1cf3813fd36 100644 --- a/src/mesa/swrast/s_context.h +++ b/src/mesa/swrast/s_context.h @@ -228,6 +228,9 @@ typedef struct extern void _swrast_validate_derived( GLcontext *ctx ); +extern void +_swrast_update_texture_samplers(GLcontext *ctx); + #define SWRAST_CONTEXT(ctx) ((SWcontext *)ctx->swrast_context) diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index 3d7ea3a06ab..81e166bde50 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -25,12 +25,13 @@ /** * \file tnl/t_vb_program.c - * \brief Pipeline stage for executing NVIDIA vertex programs. + * \brief Pipeline stage for executing vertex programs. * \author Brian Paul, Keith Whitwell */ #include "glheader.h" +#include "colormac.h" #include "context.h" #include "macros.h" #include "imports.h" @@ -42,6 +43,32 @@ #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. + * The texture sampling code is in swrast, though it doesn't have any + * real dependencies on the rest of swrast. It should probably be + * moved into main/ someday. + */ + +static void +vp_fetch_texel(GLcontext *ctx, const GLfloat texcoord[4], GLfloat lambda, + GLuint unit, GLfloat color[4]) +{ + GLchan rgba[4]; + SWcontext *swrast = SWRAST_CONTEXT(ctx); + + /* XXX use a float-valued TextureSample routine here!!! */ + swrast->TextureSample[unit](ctx, ctx->Texture.Unit[unit]._Current, + 1, (const GLfloat (*)[4]) texcoord, + &lambda, &rgba); + color[0] = CHAN_TO_FLOAT(rgba[0]); + color[1] = CHAN_TO_FLOAT(rgba[1]); + color[2] = CHAN_TO_FLOAT(rgba[2]); + color[3] = CHAN_TO_FLOAT(rgba[3]); +} /** @@ -107,6 +134,9 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine) /* init call stack */ machine->StackDepth = 0; + + machine->FetchTexelLod = vp_fetch_texel; + machine->FetchTexelDeriv = NULL; /* not used by vertex programs */ } @@ -216,19 +246,14 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage ) GLuint outputs[VERT_RESULT_MAX], numOutputs; GLuint i, j; -#define FORCE_PROG_EXECUTE_C 1 -#if FORCE_PROG_EXECUTE_C if (!program) return GL_TRUE; -#else - if (!program || !program->IsNVProgram) - return GL_TRUE; -#endif if (program->IsNVProgram) { _mesa_load_tracked_matrices(ctx); } else { + /* ARB program or vertex shader */ _mesa_load_state_parameters(ctx, program->Base.Parameters); } @@ -380,8 +405,8 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage ) * Called the first time stage->run is called. In effect, don't * allocate data until the first time the stage is run. */ -static GLboolean init_vp( GLcontext *ctx, - struct tnl_pipeline_stage *stage ) +static GLboolean +init_vp(GLcontext *ctx, struct tnl_pipeline_stage *stage) { TNLcontext *tnl = TNL_CONTEXT(ctx); struct vertex_buffer *VB = &(tnl->vb); @@ -411,7 +436,8 @@ static GLboolean init_vp( GLcontext *ctx, /** * Destructor for this pipeline stage. */ -static void dtr( struct tnl_pipeline_stage *stage ) +static void +dtr(struct tnl_pipeline_stage *stage) { struct vp_stage_data *store = VP_STAGE_DATA(stage); @@ -432,6 +458,16 @@ static void dtr( struct tnl_pipeline_stage *stage ) } +static void +validate_vp_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage) +{ + if (ctx->VertexProgram._Current) { + _swrast_update_texture_samplers(ctx); + } +} + + + /** * Public description of this pipeline stage. */ @@ -441,6 +477,6 @@ const struct tnl_pipeline_stage _tnl_vertex_program_stage = NULL, /* private_data */ init_vp, /* create */ dtr, /* destroy */ - NULL, /* validate */ + validate_vp_stage, /* validate */ run_vp /* run -- initially set to ctr */ }; -- cgit v1.2.3 From a4b2b8833751555d1e6cbc65f449b7182aa52e54 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 17 Apr 2007 16:00:17 -0600 Subject: omit the glide/svga sources from stand-alone libGL (anyone using them?) --- src/mesa/Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/mesa/Makefile b/src/mesa/Makefile index 0ab4fc5149c..c03c5f80ff2 100644 --- a/src/mesa/Makefile +++ b/src/mesa/Makefile @@ -89,9 +89,7 @@ fbdev: $(CORE_OBJECTS) $(FBDEV_DRIVER_OBJECTS) $(COMMON_DRIVER_OBJECTS) # Stand-alone Mesa libGL and libOSMesa STAND_ALONE_DRIVER_SOURCES = \ $(COMMON_DRIVER_SOURCES) \ - $(X11_DRIVER_SOURCES) \ - $(GLIDE_DRIVER_SOURCES) \ - $(SVGA_DRIVER_SOURCES) + $(X11_DRIVER_SOURCES) STAND_ALONE_DRIVER_OBJECTS = $(STAND_ALONE_DRIVER_SOURCES:.c=.o) -- cgit v1.2.3 From 565cd49b5fc7a5bd1e533542888bf322b83b8e56 Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Wed, 18 Apr 2007 12:37:09 +0800 Subject: fig segment fault issue in TAG(triangle), (see bug 10589) Bit SS_TWOSIDE_BIT is set if gl_FrontFacing lives in fragment input (see commit 10b5895597d5e069183cb647d17eb412effceb4f). However, VB->ColorPtr[1] isn't assigned after that. --- src/mesa/swrast_setup/ss_tritmp.h | 43 ++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/src/mesa/swrast_setup/ss_tritmp.h b/src/mesa/swrast_setup/ss_tritmp.h index 5b14b283f12..1fdf0cb5999 100644 --- a/src/mesa/swrast_setup/ss_tritmp.h +++ b/src/mesa/swrast_setup/ss_tritmp.h @@ -63,22 +63,24 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) if (facing == 1) { if (IND & SS_TWOSIDE_BIT) { if (IND & SS_RGBA_BIT) { - 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 (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]); - } - else { - SS_COLOR(v[0]->color, vbcolor[0]); - SS_COLOR(v[1]->color, vbcolor[0]); - SS_COLOR(v[2]->color, vbcolor[0]); - } + 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 (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]); + } + else { + SS_COLOR(v[0]->color, vbcolor[0]); + SS_COLOR(v[1]->color, vbcolor[0]); + SS_COLOR(v[2]->color, vbcolor[0]); + } + } if (VB->SecondaryColorPtr[1]) { GLfloat (*vbspec)[4] = VB->SecondaryColorPtr[1]->data; @@ -167,9 +169,12 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) if (IND & SS_TWOSIDE_BIT) { if (facing == 1) { if (IND & SS_RGBA_BIT) { - 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 (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 (VB->SecondaryColorPtr[1]) { COPY_CHAN4(v[0]->specular, saved_spec[0]); COPY_CHAN4(v[1]->specular, saved_spec[1]); -- cgit v1.2.3 From d9443c24945381e12c82d46d638685a499033457 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 18 Apr 2007 08:52:18 -0600 Subject: add progs/glsl/ to DEMO_FILES, s/pre/rc1/ --- Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 5e0c01252d2..a656da5002a 100644 --- a/Makefile +++ b/Makefile @@ -155,10 +155,10 @@ ultrix-gcc: # Rules for making release tarballs -DIRECTORY = Mesa-6.5.3pre -LIB_NAME = MesaLib-6.5.3pre -DEMO_NAME = MesaDemos-6.5.3pre -GLUT_NAME = MesaGLUT-6.5.3pre +DIRECTORY = Mesa-6.5.3rc1 +LIB_NAME = MesaLib-6.5.3rc1 +DEMO_NAME = MesaDemos-6.5.3rc1 +GLUT_NAME = MesaGLUT-6.5.3rc1 MAIN_FILES = \ $(DIRECTORY)/Makefile* \ @@ -364,6 +364,9 @@ DEMO_FILES = \ $(DIRECTORY)/progs/samples/Makefile* \ $(DIRECTORY)/progs/samples/README \ $(DIRECTORY)/progs/samples/*.c \ + $(DIRECTORY)/progs/glsl/Makefile* \ + $(DIRECTORY)/progs/glsl/*.c \ + $(DIRECTORY)/progs/glsl/*.txt \ $(DIRECTORY)/progs/windml/Makefile.ugl \ $(DIRECTORY)/progs/windml/*.c \ $(DIRECTORY)/progs/windml/*.bmp \ -- cgit v1.2.3 From e3caa5f891125d273174ff4a136c8ca313430138 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 18 Apr 2007 09:07:56 -0600 Subject: prep for 6.5.3 release --- docs/download.html | 2 +- docs/news.html | 8 ++++++++ docs/relnotes-6.5.3.html | 46 +++++++++++++++++++++++++--------------------- docs/thanks.html | 2 +- 4 files changed, 35 insertions(+), 23 deletions(-) diff --git a/docs/download.html b/docs/download.html index bf5fb24f206..1afe64ef964 100644 --- a/docs/download.html +++ b/docs/download.html @@ -9,7 +9,7 @@

Downloading

-Last development release: 6.5.2 +Last development release: 6.5.3

diff --git a/docs/news.html b/docs/news.html index 721d65e1d7e..88c0ebe0a3c 100644 --- a/docs/news.html +++ b/docs/news.html @@ -11,6 +11,14 @@

News

+

April ?, 2007

+

+Mesa 6.5.3 is released. +This is a development release which will lead up to the Mesa 7.0 release +(which will advertise OpenGL 2.1 API support). +

+ +

March 26, 2007

The new Shading Language compiler branch has been merged into the git diff --git a/docs/relnotes-6.5.3.html b/docs/relnotes-6.5.3.html index d7249aec8fb..b0da0c530b8 100644 --- a/docs/relnotes-6.5.3.html +++ b/docs/relnotes-6.5.3.html @@ -8,10 +8,11 @@ -

Mesa 6.5.3 Release Notes / (in progress)

+

Mesa 6.5.3 Release Notes / April ??, 2007

-Mesa 6.5.3 is a 6.5 follow-on development release with many internal changes. +Mesa 6.5.3 is a development release with many changes and new features. +Mesa 7.0 is expected to follow shortly.

@@ -23,10 +24,10 @@ TBD

New features

    -
  • OpenGL 2.0 support. +
  • OpenGL 2.0 and 2.1 API support.
  • Entirely new Shading Language code generator.
  • Much faster software execution of vertex, fragment shaders. -
  • New vertex buffer object infrastructure (replaces old array_cache code). +
  • New vertex buffer object (vbo) infrastructure
  • Updated glext.h file (version 39)
  • Updated glxext.h file (version 18)
  • GL_MAX_DRAWBUFFERS is now 4 (software rendering) so @@ -43,18 +44,21 @@ TBD
  • Overlapping glCopyPixels with negative Y zoom didn't work (bug 10521)
  • Fixed a number of framebuffer/renderbuffer reference counting bugs
  • Fixed a few bugs in software-emulated alpha planes +
  • Assorted minor bug fixes in glCopy/DrawPixels, glPixelZoom, etc. +
  • Assorted DRI driver bug fixes.

Internal code changes

-
    -
  • Massive changes to the Shading Language compiler. -
  • The _MaintainTnlProgram, _MaintainTexEnvProgram, _TexEnvProgram and -_TnlProgram fields have been moved. -
  • The ctx->Vertex/FragmentProgram._Current fields point to the program -in effect, whether it comes from a shader, user-program or generated -fixed-function program. +
  • Old array_cache module replaced by new vbo module. All geometry +rendering is now cast in the form of vertex buffer objects. +
  • Massive changes to the Shading Language compiler and related state. +
  • Vertex/fragment shaders are compiled into GPU instructions and +programs very similar to GL_ARB_vertex/fragment_program. +
  • Vertex and fragment programs are executed with the same code now. +
  • The SSE-optimized vertex program path has been removed since it didn't +support more than 12 temp registers, didn't support branching/looping, etc.
@@ -72,17 +76,17 @@ fixed-function program. Driver Status ---------------------- ---------------------- DRI drivers varies with the driver -XMesa/GLX (on Xlib) implements OpenGL 2.0 -OSMesa (off-screen) implements OpenGL 2.0 -Glide (3dfx Voodoo1/2) implements OpenGL 1.3 -SVGA implements OpenGL 1.3 -Wind River UGL implements OpenGL 1.3 +XMesa/GLX (on Xlib) implements OpenGL 2.1 +OSMesa (off-screen) implements OpenGL 2.1 Windows/Win32 implements OpenGL 1.5 -DJGPP implements OpenGL 1.5 -GGI implements OpenGL 1.3 -BeOS implements OpenGL 1.5 -Allegro needs updating -D3D needs updating +Glide (3dfx Voodoo1/2) implements OpenGL 1.3 +SVGA unsupported +Wind River UGL unsupported +DJGPP unsupported +GGI unsupported +BeOS unsupported +Allegro unsupported +D3D unsupported diff --git a/docs/thanks.html b/docs/thanks.html index 78b9e3e5ec6..2031788f0dc 100644 --- a/docs/thanks.html +++ b/docs/thanks.html @@ -42,7 +42,7 @@ WIDTH="88" HEIGHT="31" ALIGN="BOTTOM" ALT="Sourceforge.net" BORDER="0">

-
  • The Mesa CVS repository is hosted by +
  • The Mesa git repository is hosted by freedesktop.org.

    -- cgit v1.2.3 From 6d01f3f1ec21da5bdf3191869ee0be42b3c11d57 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 18 Apr 2007 09:28:38 -0600 Subject: added href to shading language info --- docs/relnotes-6.5.3.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/relnotes-6.5.3.html b/docs/relnotes-6.5.3.html index b0da0c530b8..8f6ea8bea31 100644 --- a/docs/relnotes-6.5.3.html +++ b/docs/relnotes-6.5.3.html @@ -25,7 +25,8 @@ TBD

    New features

    • OpenGL 2.0 and 2.1 API support. -
    • Entirely new Shading Language code generator. +
    • Entirely new Shading Language code generator. See the +Shading Language page for more information.
    • Much faster software execution of vertex, fragment shaders.
    • New vertex buffer object (vbo) infrastructure
    • Updated glext.h file (version 39) -- cgit v1.2.3 From 8598f550916449b99351a51e2a20e4c4cff021d3 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 18 Apr 2007 09:30:07 -0600 Subject: glean glsl test now does over 150 tests --- docs/shading.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/shading.html b/docs/shading.html index fd96a41e85a..3a10f1b0ce0 100644 --- a/docs/shading.html +++ b/docs/shading.html @@ -294,7 +294,7 @@ A new Glean test has been create to exercise the GLSL compiler.

      -The glsl1 test runs over 130 sub-tests to check that the language +The glsl1 test runs over 150 sub-tests to check that the language features and built-in functions work properly. This test should be run frequently while working on the compiler to catch regressions. -- cgit v1.2.3 From 30a79f76fc4ae3bbf2307489bf9da1527f124e91 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 18 Apr 2007 12:08:18 -0600 Subject: improved fog comment --- src/mesa/swrast/s_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index c8efb962d03..55b835bf85c 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -155,7 +155,7 @@ _swrast_update_polygon( GLcontext *ctx ) /** * Update the _PreferPixelFog field to indicate if we need to compute - * fog factors per-fragment. + * fog blend factors (from the fog coords) per-fragment. */ static void _swrast_update_fog_hint( GLcontext *ctx ) -- cgit v1.2.3 From 884af408644e3fa9aa0ffc544f84ec4a7f3a93b9 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 18 Apr 2007 12:09:40 -0600 Subject: check _PreferPixelFog in _swrast_span_default_fog(), see bug 10669 --- src/mesa/swrast/s_span.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index b0c04ad0216..c6efea30753 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.3 * - * 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"), @@ -69,14 +69,23 @@ _swrast_span_default_z( GLcontext *ctx, SWspan *span ) /** - * Init span's fog interpolation values to the RasterPos fog. + * 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 ) { - span->attrStart[FRAG_ATTRIB_FOGC][0] - = _swrast_z_to_fogfactor(ctx, ctx->Current.RasterDistance); + 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; span->interpMask |= SPAN_FOG; -- cgit v1.2.3 From e57e752eeef1611cbc8bf9e0aca8c2467267f027 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 18 Apr 2007 12:41:16 -0600 Subject: call ProgramStringNotify() after linking --- src/mesa/shader/slang/slang_link.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 20c66909b27..360af0922fa 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -566,6 +566,9 @@ _slang_link(GLcontext *ctx, _slang_update_inputs_outputs(&shProg->FragmentProgram->Base); if (fragProg && shProg->FragmentProgram) { + /* notify driver that a new fragment program has been compiled/linked */ + ctx->Driver.ProgramStringNotify(ctx, GL_FRAGMENT_PROGRAM_ARB, + &shProg->FragmentProgram->Base); #if 0 printf("************** original fragment program\n"); _mesa_print_program(&fragProg->Base); @@ -579,6 +582,9 @@ _slang_link(GLcontext *ctx, } if (vertProg && shProg->VertexProgram) { + /* notify driver that a new vertex program has been compiled/linked */ + ctx->Driver.ProgramStringNotify(ctx, GL_VERTEX_PROGRAM_ARB, + &shProg->VertexProgram->Base); #if 0 printf("************** original vertex program\n"); _mesa_print_program(&vertProg->Base); -- cgit v1.2.3 From 6d3d9c1c6de33646b63d47892863939ee1b1e624 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 18 Apr 2007 14:19:17 -0600 Subject: Replace _mesa_parameter_longest_name() with _mesa_longest_parameter_name(). The later takes a type parameter so we can match uniforms or attributes/inputs. Used by the GL_ACTIVE_ATTRIBUTE_MAX_LENGTH and GL_ACTIVE_UNIFORM_MAX_LENGTH queries. Fixes problem reported by Brad King in VTK. --- src/mesa/shader/prog_parameter.c | 13 ++++++++----- src/mesa/shader/prog_parameter.h | 4 +++- src/mesa/shader/shader_api.c | 4 ++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index 2c8a3407634..fe90ca6d7bb 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -586,18 +586,21 @@ _mesa_clone_parameter_list(const struct gl_program_parameter_list *list) /** - * Find longest name of any parameter in list. + * Find longest name of all uniform parameters in list. */ GLuint -_mesa_parameter_longest_name(const struct gl_program_parameter_list *list) +_mesa_longest_parameter_name(const struct gl_program_parameter_list *list, + enum register_file type) { GLuint i, maxLen = 0; if (!list) return 0; for (i = 0; i < list->NumParameters; i++) { - GLuint len = _mesa_strlen(list->Parameters[i].Name); - if (len > maxLen) - maxLen = len; + if (list->Parameters[i].Type == type) { + GLuint len = _mesa_strlen(list->Parameters[i].Name); + if (len > maxLen) + maxLen = len; + } } return maxLen; } diff --git a/src/mesa/shader/prog_parameter.h b/src/mesa/shader/prog_parameter.h index 3d32a64f383..879623b127a 100644 --- a/src/mesa/shader/prog_parameter.h +++ b/src/mesa/shader/prog_parameter.h @@ -131,6 +131,8 @@ _mesa_lookup_parameter_constant(const struct gl_program_parameter_list *list, GLint *posOut, GLuint *swizzleOut); extern GLuint -_mesa_parameter_longest_name(const struct gl_program_parameter_list *list); +_mesa_longest_parameter_name(const struct gl_program_parameter_list *list, + enum register_file type); + #endif /* PROG_PARAMETER_H */ diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index fc1ae287f4f..41646e7664d 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -763,13 +763,13 @@ _mesa_get_programiv(GLcontext *ctx, GLuint program, *params = shProg->Attributes ? shProg->Attributes->NumParameters : 0; break; case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH: - *params = _mesa_parameter_longest_name(shProg->Attributes); + *params = _mesa_longest_parameter_name(shProg->Attributes, PROGRAM_INPUT); break; case GL_ACTIVE_UNIFORMS: *params = shProg->Uniforms ? shProg->Uniforms->NumParameters : 0; break; case GL_ACTIVE_UNIFORM_MAX_LENGTH: - *params = _mesa_parameter_longest_name(shProg->Uniforms); + *params = _mesa_longest_parameter_name(shProg->Uniforms, PROGRAM_UNIFORM); break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramiv(pname)"); -- cgit v1.2.3 From f3e8c32376d8bdf1c48a0a2ad97eddcde7fc2f00 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 18 Apr 2007 14:53:23 -0600 Subject: s/GL_SHADER_PROGRAM/GL_SHADER_PROGRAM_MESA/ (a Mesa-specific token) --- src/mesa/main/context.c | 2 +- src/mesa/main/mtypes.h | 2 +- src/mesa/shader/shader_api.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 93442b91aaa..9dc7b11e361 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -629,7 +629,7 @@ delete_shader_cb(GLuint id, void *data, void *userData) } else { struct gl_shader_program *shProg = (struct gl_shader_program *) data; - ASSERT(shProg->Type == GL_SHADER_PROGRAM); + ASSERT(shProg->Type == GL_SHADER_PROGRAM_MESA); _mesa_free_shader_program(ctx, shProg); } } diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 89cdc790897..0044494bd3c 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -47,7 +47,7 @@ /** * Special, internal token */ -#define GL_SHADER_PROGRAM 0x9999 +#define GL_SHADER_PROGRAM_MESA 0x9999 /** diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 41646e7664d..004c9c8ec3a 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -58,7 +58,7 @@ _mesa_new_shader_program(GLcontext *ctx, GLuint name) struct gl_shader_program *shProg; shProg = CALLOC_STRUCT(gl_shader_program); if (shProg) { - shProg->Type = GL_SHADER_PROGRAM; + shProg->Type = GL_SHADER_PROGRAM_MESA; shProg->Name = name; shProg->RefCount = 1; shProg->Attributes = _mesa_new_parameter_list(); @@ -114,7 +114,7 @@ _mesa_free_shader_program_data(GLcontext *ctx, { GLuint i; - assert(shProg->Type == GL_SHADER_PROGRAM); + assert(shProg->Type == GL_SHADER_PROGRAM_MESA); _mesa_clear_shader_program_data(ctx, shProg); @@ -204,7 +204,7 @@ _mesa_lookup_shader_program(GLcontext *ctx, GLuint name) * in the same hash table. Check the object's type to be sure it's * what we're expecting. */ - if (shProg && shProg->Type != GL_SHADER_PROGRAM) { + if (shProg && shProg->Type != GL_SHADER_PROGRAM_MESA) { return NULL; } return shProg; @@ -308,7 +308,7 @@ _mesa_lookup_shader(GLcontext *ctx, GLuint name) * in the same hash table. Check the object's type to be sure it's * what we're expecting. */ - if (sh && sh->Type == GL_SHADER_PROGRAM) { + if (sh && sh->Type == GL_SHADER_PROGRAM_MESA) { assert(sh->Type == GL_VERTEX_SHADER || sh->Type == GL_FRAGMENT_SHADER); return NULL; -- cgit v1.2.3 From bac15c8db87261ea168caa98d818bd6917ca14d6 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 18 Apr 2007 14:55:18 -0600 Subject: Remove bad assertions, decrement NumShaders in _mesa_detach_shader(). Fixes crashes w/ Brad King's depth peeling test. --- src/mesa/shader/shader_api.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 004c9c8ec3a..0c4f4837fbf 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -309,8 +309,6 @@ _mesa_lookup_shader(GLcontext *ctx, GLuint name) * what we're expecting. */ if (sh && sh->Type == GL_SHADER_PROGRAM_MESA) { - assert(sh->Type == GL_VERTEX_SHADER || - sh->Type == GL_FRAGMENT_SHADER); return NULL; } return sh; @@ -576,6 +574,7 @@ _mesa_detach_shader(GLcontext *ctx, GLuint program, GLuint shader) _mesa_free(shProg->Shaders); shProg->Shaders = newList; + shProg->NumShaders = n - 1; return; } } -- cgit v1.2.3 From 2a2f8d806f74619f0a7cf97fdc7f7b3ad1cad81b Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Wed, 18 Apr 2007 23:54:00 +0300 Subject: xmesa: drop glide (FX) backend. glide is no longer compiled with stand-alone libGL, so this will not link. There are still the glide config files. some code in demos and the GLX_MESA_set_3dfx_mode code which could be removed. --- src/mesa/drivers/x11/fakeglx.c | 13 +-- src/mesa/drivers/x11/xm_api.c | 258 +---------------------------------------- src/mesa/drivers/x11/xmesaP.h | 19 +-- 3 files changed, 6 insertions(+), 284 deletions(-) diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index eecd52aa32b..b6569b1938f 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1440,7 +1440,7 @@ Fake_glXMakeContextCurrent( Display *dpy, GLXDrawable draw, } if (!drawBuffer) { /* drawable must be a new window! */ - drawBuffer = XMesaCreateWindowBuffer2( xmctx->xm_visual, draw, xmctx); + drawBuffer = XMesaCreateWindowBuffer( xmctx->xm_visual, draw ); if (!drawBuffer) { /* Out of memory, or context/drawable depth mismatch */ return False; @@ -1457,8 +1457,7 @@ Fake_glXMakeContextCurrent( Display *dpy, GLXDrawable draw, } if (!readBuffer) { /* drawable must be a new window! */ - readBuffer = XMesaCreateWindowBuffer2(glxCtx->xmesaContext->xm_visual, - read, xmctx); + readBuffer = XMesaCreateWindowBuffer( xmctx->xm_visual, read ); if (!readBuffer) { /* Out of memory, or context/drawable depth mismatch */ return False; @@ -1930,12 +1929,6 @@ Fake_glXWaitX( void ) static const char * get_extensions( void ) { -#ifdef FX - const char *fx = _mesa_getenv("MESA_GLX_FX"); - if (fx && fx[0] != 'd') { - return EXTENSIONS; - } -#endif return EXTENSIONS + 23; /* skip "GLX_MESA_set_3dfx_mode" */ } @@ -2107,7 +2100,7 @@ Fake_glXCreateWindow( Display *dpy, GLXFBConfig config, Window win, if (!xmvis) return 0; - xmbuf = XMesaCreateWindowBuffer2(xmvis, win, NULL); + xmbuf = XMesaCreateWindowBuffer(xmvis, win); if (!xmbuf) return 0; diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 6439d13fa5f..6f671969fec 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1557,12 +1557,6 @@ PUBLIC void XMesaDestroyContext( XMesaContext c ) { GLcontext *mesaCtx = &c->mesa; -#ifdef FX - XMesaBuffer xmbuf = XMESA_BUFFER(mesaCtx->DrawBuffer); - - if (xmbuf && xmbuf->FXctx) - fxMesaDestroyContext(xmbuf->FXctx); -#endif _swsetup_DestroyContext( mesaCtx ); _swrast_DestroyContext( mesaCtx ); _tnl_DestroyContext( mesaCtx ); @@ -1578,17 +1572,13 @@ void XMesaDestroyContext( XMesaContext c ) * X window or pixmap. * \param v the window's XMesaVisual * \param w the window we're wrapping - * \param c context used to initialize the buffer if 3Dfx mode in use. * \return new XMesaBuffer or NULL if error */ -XMesaBuffer -XMesaCreateWindowBuffer2(XMesaVisual v, XMesaWindow w, XMesaContext c) +PUBLIC XMesaBuffer +XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w) { #ifndef XFree86Server XWindowAttributes attr; -#endif -#ifdef FX - char *fxEnvVar; #endif int client = 0; XMesaBuffer b; @@ -1596,7 +1586,6 @@ XMesaCreateWindowBuffer2(XMesaVisual v, XMesaWindow w, XMesaContext c) assert(v); assert(w); - (void) c; /* Check that window depth matches visual depth */ #ifdef XFree86Server @@ -1642,96 +1631,10 @@ XMesaCreateWindowBuffer2(XMesaVisual v, XMesaWindow w, XMesaContext c) return NULL; } -#ifdef FX - fxEnvVar = _mesa_getenv("MESA_GLX_FX"); - if (fxEnvVar) { - if (fxEnvVar[0]!='d') { - int attribs[100]; - int numAttribs = 0; - int hw; - if (v->mesa_visual.depthBits > 0) { - attribs[numAttribs++] = FXMESA_DEPTH_SIZE; - attribs[numAttribs++] = v->mesa_visual.depthBits; - } - if (v->mesa_visual.doubleBufferMode) { - attribs[numAttribs++] = FXMESA_DOUBLEBUFFER; - } - if (v->mesa_visual.accumRedBits > 0) { - attribs[numAttribs++] = FXMESA_ACCUM_SIZE; - attribs[numAttribs++] = v->mesa_visual.accumRedBits; - } - if (v->mesa_visual.stencilBits > 0) { - attribs[numAttribs++] = FXMESA_STENCIL_SIZE; - attribs[numAttribs++] = v->mesa_visual.stencilBits; - } - if (v->mesa_visual.alphaBits > 0) { - attribs[numAttribs++] = FXMESA_ALPHA_SIZE; - attribs[numAttribs++] = v->mesa_visual.alphaBits; - } - if (1) { - attribs[numAttribs++] = FXMESA_SHARE_CONTEXT; - attribs[numAttribs++] = (int) &(c->mesa); - } - attribs[numAttribs++] = FXMESA_NONE; - - /* [dBorca] we should take an envvar for `fxMesaSelectCurrentBoard'!!! */ - hw = fxMesaSelectCurrentBoard(0); - - /* if these fail, there's a new bug somewhere */ - ASSERT(b->mesa_buffer.Width > 0); - ASSERT(b->mesa_buffer.Height > 0); - - if ((hw == GR_SSTTYPE_VOODOO) || (hw == GR_SSTTYPE_Voodoo2)) { - b->FXctx = fxMesaCreateBestContext(0, b->mesa_buffer.Width, - b->mesa_buffer.Height, attribs); - if ((v->undithered_pf!=PF_Index) && (b->backxrb->ximage)) { - b->FXisHackUsable = b->FXctx ? GL_TRUE : GL_FALSE; - if (b->FXctx && (fxEnvVar[0]=='w' || fxEnvVar[0]=='W')) { - b->FXwindowHack = GL_TRUE; - FX_grSstControl(GR_CONTROL_DEACTIVATE); - } - else { - b->FXwindowHack = GL_FALSE; - } - } - } - else { - if (fxEnvVar[0]=='w' || fxEnvVar[0]=='W') - b->FXctx = fxMesaCreateContext(w, GR_RESOLUTION_NONE, - GR_REFRESH_75Hz, attribs); - else - b->FXctx = fxMesaCreateBestContext(0, b->mesa_buffer.Width, - b->mesa_buffer.Height, attribs); - b->FXisHackUsable = GL_FALSE; - b->FXwindowHack = GL_FALSE; - } - /* - fprintf(stderr, - "voodoo %d, wid %d height %d hack: usable %d active %d\n", - hw, b->mesa_buffer.Width, b->mesa_buffer.Height, - b->FXisHackUsable, b->FXwindowHack); - */ - } - } - else { - _mesa_warning(NULL, "WARNING: This Mesa Library includes the Glide driver but\n"); - _mesa_warning(NULL, " you have not defined the MESA_GLX_FX env. var.\n"); - _mesa_warning(NULL, " (check the README.3DFX file for more information).\n\n"); - _mesa_warning(NULL, " you can disable this message with a 'export MESA_GLX_FX=disable'.\n"); - } -#endif - return b; } -PUBLIC XMesaBuffer -XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w) -{ - return XMesaCreateWindowBuffer2( v, w, NULL ); -} - - /** * Create a new XMesaBuffer from an X pixmap. * @@ -1857,15 +1760,6 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer, if (!drawBuffer || !readBuffer) return GL_FALSE; /* must specify buffers! */ -#ifdef FX - if (drawBuffer->FXctx) { - fxMesaMakeCurrent(drawBuffer->FXctx); - - c->xm_buffer = drawBuffer; - - return GL_TRUE; - } -#endif if (&(c->mesa) == _mesa_get_current_context() && c->mesa.DrawBuffer == &drawBuffer->mesa_buffer && c->mesa.ReadBuffer == &readBuffer->mesa_buffer @@ -2006,141 +1900,12 @@ GLboolean XMesaCopyContext( XMesaContext xm_src, XMesaContext xm_dst, GLuint mas */ GLboolean XMesaSetFXmode( GLint mode ) { -#ifdef FX - const char *fx = _mesa_getenv("MESA_GLX_FX"); - if (fx && fx[0] != 'd') { - GET_CURRENT_CONTEXT(ctx); - GrHwConfiguration hw; - if (!FX_grSstQueryHardware(&hw)) { - /*fprintf(stderr, "!grSstQueryHardware\n");*/ - return GL_FALSE; - } - if (hw.num_sst < 1) { - /*fprintf(stderr, "hw.num_sst < 1\n");*/ - return GL_FALSE; - } - if (ctx) { - /* [dBorca] Hack alert: - * oh, this is sooo wrong: ctx above is - * really an fxMesaContext, not an XMesaContext - */ - XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer); - if (mode == XMESA_FX_WINDOW) { - if (xmbuf->FXisHackUsable) { - FX_grSstControl(GR_CONTROL_DEACTIVATE); - xmbuf->FXwindowHack = GL_TRUE; - return GL_TRUE; - } - } - else if (mode == XMESA_FX_FULLSCREEN) { - FX_grSstControl(GR_CONTROL_ACTIVATE); - xmbuf->FXwindowHack = GL_FALSE; - return GL_TRUE; - } - else { - /* Error: Bad mode value */ - } - } - } - /*fprintf(stderr, "fallthrough\n");*/ -#else (void) mode; -#endif return GL_FALSE; } -#ifdef FX -/* - * Read image from VooDoo frame buffer into X/Mesa's back XImage. - */ -static void FXgetImage( XMesaBuffer b ) -{ - GET_CURRENT_CONTEXT(ctx); - static unsigned short pixbuf[MAX_WIDTH]; - GLuint x, y; - GLuint width, height; - XMesaContext xmesa = XMESA_CONTEXT(ctx); - -#ifdef XFree86Server - x = b->frontxrb->pixmap->x; - y = b->frontxrb->pixmap->y; - width = b->frontxrb->pixmap->width; - height = b->frontxrb->pixmap->height; - depth = b->frontxrb->pixmap->depth; -#else - xmesa_get_window_size(b->display, b, &width, &height); - x = y = 0; -#endif - if (b->mesa_buffer.Width != width || b->mesa_buffer.Height != height) { - b->mesa_buffer.Width = MIN2((int)width, b->FXctx->width); - b->mesa_buffer.Height = MIN2((int)height, b->FXctx->height); - if (b->mesa_buffer.Width & 1) - b->mesa_buffer.Width--; /* prevent odd width */ - } - - /* [dBorca] we're always in the right GR_COLORFORMAT... aren't we? */ - /* grLfbWriteColorFormat(GR_COLORFORMAT_ARGB); */ - if (b->xm_visual->undithered_pf==PF_5R6G5B) { - /* Special case: 16bpp RGB */ - grLfbReadRegion( GR_BUFFER_FRONTBUFFER, /* src buffer */ - 0, b->FXctx->height - b->mesa_buffer.Height, /*pos*/ - b->mesa_buffer.Width, b->mesa_buffer.Height, /* size */ - b->mesa_buffer.Width * sizeof(GLushort), /* stride */ - b->backxrb->ximage->data); /* dest buffer */ - } - else if (b->xm_visual->dithered_pf==PF_Dither - && GET_VISUAL_DEPTH(b->xm_visual)==8) { - /* Special case: 8bpp RGB */ - for (y=0;ymesa_buffer.Height;y++) { - GLubyte *ptr = (GLubyte*) b->backxrb->ximage->data - + b->backxrb->ximage->bytes_per_line * y; - XDITHER_SETUP(y); - - /* read row from 3Dfx frame buffer */ - grLfbReadRegion( GR_BUFFER_FRONTBUFFER, - 0, b->FXctx->height-(b->mesa_buffer.Height-y), - b->mesa_buffer.Width, 1, - 0, - pixbuf ); - - /* write to XImage back buffer */ - for (x=0;xmesa_buffer.Width;x++) { - GLubyte r = (pixbuf[x] & 0xf800) >> 8; - GLubyte g = (pixbuf[x] & 0x07e0) >> 3; - GLubyte b = (pixbuf[x] & 0x001f) << 3; - *ptr++ = XDITHER( x, r, g, b); - } - } - } - else { - /* General case: slow! */ - for (y=0;ymesa_buffer.Height;y++) { - /* read row from 3Dfx frame buffer */ - grLfbReadRegion( GR_BUFFER_FRONTBUFFER, - 0, b->FXctx->height-(b->mesa_buffer.Height-y), - b->mesa_buffer.Width, 1, - 0, - pixbuf ); - - /* write to XImage back buffer */ - for (x=0;xmesa_buffer.Width;x++) { - XMesaPutPixel(b->backxrb->ximage,x,y, - xmesa_color_to_pixel(ctx, - (pixbuf[x] & 0xf800) >> 8, - (pixbuf[x] & 0x07e0) >> 3, - (pixbuf[x] & 0x001f) << 3, - 0xff, - b->xm_visual->undithered_pf)); - } - } - } - /* grLfbWriteColorFormat(GR_COLORFORMAT_ABGR); */ -} -#endif - - /* * Copy the back buffer to the front buffer. If there's no back buffer * this is a no-op. @@ -2162,16 +1927,6 @@ void XMesaSwapBuffers( XMesaBuffer b ) _mesa_notifySwapBuffers(ctx); if (b->db_mode) { -#ifdef FX - if (b->FXctx) { - fxMesaSwapBuffers(); - - if (b->FXwindowHack) - FXgetImage(b); - else - return; - } -#endif if (b->backxrb->ximage) { /* Copy Ximage (back buf) from client memory to server window */ #if defined(USE_XSHM) && !defined(XFree86Server) @@ -2238,15 +1993,6 @@ void XMesaCopySubBuffer( XMesaBuffer b, int x, int y, int width, int height ) if (b->db_mode) { int yTop = b->mesa_buffer.Height - y - height; -#ifdef FX - if (b->FXctx) { - fxMesaSwapBuffers(); - if (b->FXwindowHack) - FXgetImage(b); - else - return; - } -#endif if (b->backxrb->ximage) { /* Copy Ximage from host's memory to server's window */ #if defined(USE_XSHM) && !defined(XFree86Server) diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h index 98d03ccf62f..7b72e6b2f98 100644 --- a/src/mesa/drivers/x11/xmesaP.h +++ b/src/mesa/drivers/x11/xmesaP.h @@ -29,10 +29,7 @@ #include "GL/xmesa.h" #include "mtypes.h" -#if defined(FX) -#include "GL/fxmesa.h" -#include "../glide/fxdrv.h" -#endif + #ifdef XFree86Server #include "xm_image.h" #endif @@ -260,13 +257,6 @@ struct xmesa_buffer { unsigned long alloced_colors[256]; #endif -#if defined( FX ) - /* For 3Dfx Glide only */ - GLboolean FXisHackUsable; /* Can we render into window? */ - GLboolean FXwindowHack; /* Are we rendering into a window? */ - fxMesaContext FXctx; -#endif - struct xmesa_buffer *Next; /* Linked list pointer: */ }; @@ -567,13 +557,6 @@ extern void xmesa_choose_triangle( GLcontext *ctx ); extern void xmesa_register_swrast_functions( GLcontext *ctx ); - -/* XXX this is a hack to implement shared display lists with 3Dfx */ -extern XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v, - XMesaWindow w, - XMesaContext c ); - - #define ENABLE_EXT_texure_compression_s3tc 0 /* SW texture compression */ #ifdef XFree86Server -- cgit v1.2.3 From aaa57412c1a682730f27f08bd89a79b8b81f982f Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 18 Apr 2007 15:22:43 -0600 Subject: fix error strings, add a sanity check --- src/mesa/shader/shader_api.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 0c4f4837fbf..a8ca7d62212 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -575,6 +575,18 @@ _mesa_detach_shader(GLcontext *ctx, GLuint program, GLuint shader) shProg->Shaders = newList; shProg->NumShaders = n - 1; + +#ifdef DEBUG + /* sanity check */ + { + for (j = 0; j < shProg->NumShaders; j++) { + assert(shProg->Shaders[j]->Type == GL_VERTEX_SHADER || + shProg->Shaders[j]->Type == GL_FRAGMENT_SHADER); + assert(shProg->Shaders[j]->RefCount > 0); + } + } +#endif + return; } } @@ -598,12 +610,12 @@ _mesa_get_active_attrib(GLcontext *ctx, GLuint program, GLuint index, GLint sz; if (!shProg) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveUniform"); + _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveAttrib"); return; } if (!shProg->Attributes || index >= shProg->Attributes->NumParameters) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveUniform(index)"); + _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveAttrib(index)"); return; } -- cgit v1.2.3 From 274ac7a801766a0ae766219ec6a40ed52e479d07 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 18 Apr 2007 16:05:53 -0600 Subject: Fix some bugs related to querying active uniforms. --- src/mesa/shader/prog_parameter.c | 17 ++++++++++++++++ src/mesa/shader/prog_parameter.h | 4 ++++ src/mesa/shader/shader_api.c | 42 ++++++++++++++++++++++++++++++---------- 3 files changed, 53 insertions(+), 10 deletions(-) diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index fe90ca6d7bb..e2f1047463f 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -605,3 +605,20 @@ _mesa_longest_parameter_name(const struct gl_program_parameter_list *list, return maxLen; } + +/** + * Count the number of parameters in the last that match the given type. + */ +GLuint +_mesa_num_parameters_of_type(const struct gl_program_parameter_list *list, + enum register_file type) +{ + GLuint i, count = 0; + if (list) { + for (i = 0; i < list->NumParameters; i++) { + if (list->Parameters[i].Type == type) + count++; + } + } + return count; +} diff --git a/src/mesa/shader/prog_parameter.h b/src/mesa/shader/prog_parameter.h index 879623b127a..2e0feb972ec 100644 --- a/src/mesa/shader/prog_parameter.h +++ b/src/mesa/shader/prog_parameter.h @@ -134,5 +134,9 @@ extern GLuint _mesa_longest_parameter_name(const struct gl_program_parameter_list *list, enum register_file type); +extern GLuint +_mesa_num_parameters_of_type(const struct gl_program_parameter_list *list, + enum register_file type); + #endif /* PROG_PARAMETER_H */ diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index a8ca7d62212..74bdef061b5 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -38,6 +38,7 @@ #include "glheader.h" #include "context.h" #include "hash.h" +#include "macros.h" #include "program.h" #include "prog_parameter.h" #include "prog_print.h" @@ -643,6 +644,7 @@ _mesa_get_active_uniform(GLcontext *ctx, GLuint program, GLuint index, struct gl_shader_program *shProg = _mesa_lookup_shader_program(ctx, program); GLint sz; + GLuint ind, j; if (!shProg) { _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveUniform"); @@ -654,13 +656,26 @@ _mesa_get_active_uniform(GLcontext *ctx, GLuint program, GLuint index, return; } - copy_string(nameOut, maxLength, length, - shProg->Uniforms->Parameters[index].Name); - sz = shProg->Uniforms->Parameters[index].Size; - if (size) - *size = sz; - if (type) - *type = vec_types[sz]; /* XXX this is a temporary hack */ + ind = 0; + for (j = 0; j < shProg->Uniforms->NumParameters; j++) { + if (shProg->Uniforms->Parameters[j].Type == PROGRAM_UNIFORM || + shProg->Uniforms->Parameters[j].Type == PROGRAM_SAMPLER) { + if (ind == index) { + /* found it */ + copy_string(nameOut, maxLength, length, + shProg->Uniforms->Parameters[j].Name); + sz = shProg->Uniforms->Parameters[j].Size; + if (size) + *size = sz; + if (type) + *type = vec_types[sz-1]; /* XXX this is a temporary hack */ + return; + } + ind++; + } + } + + _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveUniform(index)"); } @@ -774,13 +789,20 @@ _mesa_get_programiv(GLcontext *ctx, GLuint program, *params = shProg->Attributes ? shProg->Attributes->NumParameters : 0; break; case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH: - *params = _mesa_longest_parameter_name(shProg->Attributes, PROGRAM_INPUT); + *params = _mesa_longest_parameter_name(shProg->Attributes, + PROGRAM_INPUT) + 1; break; case GL_ACTIVE_UNIFORMS: - *params = shProg->Uniforms ? shProg->Uniforms->NumParameters : 0; + *params + = _mesa_num_parameters_of_type(shProg->Uniforms, PROGRAM_UNIFORM) + + _mesa_num_parameters_of_type(shProg->Uniforms, PROGRAM_SAMPLER); break; case GL_ACTIVE_UNIFORM_MAX_LENGTH: - *params = _mesa_longest_parameter_name(shProg->Uniforms, PROGRAM_UNIFORM); + *params = MAX2( + _mesa_longest_parameter_name(shProg->Uniforms, PROGRAM_UNIFORM), + _mesa_longest_parameter_name(shProg->Uniforms, PROGRAM_SAMPLER)); + if (*params > 0) + (*params)++; /* add one for terminating zero */ break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramiv(pname)"); -- cgit v1.2.3 From c93e883b205a679aa80f6228459890f9118ad909 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 18 Apr 2007 16:27:35 -0600 Subject: Start fixing some issues with uniform variables and their types. --- src/mesa/shader/prog_parameter.c | 31 ++++++++++++++++++------------- src/mesa/shader/prog_parameter.h | 7 ++++--- src/mesa/shader/shader_api.c | 9 ++------- src/mesa/shader/slang/slang_codegen.c | 7 +++++-- src/mesa/shader/slang/slang_link.c | 4 ++-- 5 files changed, 31 insertions(+), 27 deletions(-) diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index e2f1047463f..7f17be74f72 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -81,7 +81,7 @@ _mesa_free_parameter_list(struct gl_program_parameter_list *paramList) GLint _mesa_add_parameter(struct gl_program_parameter_list *paramList, enum register_file type, const char *name, - GLuint size, const GLfloat *values, + GLuint size, GLenum datatype, const GLfloat *values, const gl_state_index state[STATE_LENGTH]) { const GLuint oldNum = paramList->NumParameters; @@ -126,6 +126,7 @@ _mesa_add_parameter(struct gl_program_parameter_list *paramList, p->Name = name ? _mesa_strdup(name) : NULL; p->Type = type; p->Size = size; + p->DataType = datatype; if (values) { COPY_4V(paramList->ParameterValues[oldNum + i], values); values += 4; @@ -156,7 +157,7 @@ _mesa_add_named_parameter(struct gl_program_parameter_list *paramList, const char *name, const GLfloat values[4]) { return _mesa_add_parameter(paramList, PROGRAM_NAMED_PARAM, name, - 4, values, NULL); + 4, GL_NONE, values, NULL); } @@ -187,7 +188,7 @@ _mesa_add_named_constant(struct gl_program_parameter_list *paramList, #endif size = 4; /** XXX fix */ return _mesa_add_parameter(paramList, PROGRAM_CONSTANT, name, - size, values, NULL); + size, GL_NONE, values, NULL); } @@ -239,7 +240,7 @@ _mesa_add_unnamed_constant(struct gl_program_parameter_list *paramList, /* add a new parameter to store this constant */ pos = _mesa_add_parameter(paramList, PROGRAM_CONSTANT, NULL, - size, values, NULL); + size, GL_NONE, values, NULL); if (pos >= 0 && swizzleOut) { if (size == 1) *swizzleOut = SWIZZLE_XXXX; @@ -252,16 +253,19 @@ _mesa_add_unnamed_constant(struct gl_program_parameter_list *paramList, GLint _mesa_add_uniform(struct gl_program_parameter_list *paramList, - const char *name, GLuint size) + const char *name, GLuint size, GLenum datatype) { GLint i = _mesa_lookup_parameter_index(paramList, -1, name); + ASSERT(datatype != GL_NONE); if (i >= 0 && paramList->Parameters[i].Type == PROGRAM_UNIFORM) { + ASSERT(paramList->Parameters[i].Size == size); + ASSERT(paramList->Parameters[i].DataType == datatype); /* already in list */ return i; } else { i = _mesa_add_parameter(paramList, PROGRAM_UNIFORM, name, - size, NULL, NULL); + size, datatype, NULL, NULL); return i; } @@ -270,7 +274,7 @@ _mesa_add_uniform(struct gl_program_parameter_list *paramList, GLint _mesa_add_sampler(struct gl_program_parameter_list *paramList, - const char *name) + const char *name, GLenum datatype) { GLint i = _mesa_lookup_parameter_index(paramList, -1, name); if (i >= 0 && paramList->Parameters[i].Type == PROGRAM_SAMPLER) { @@ -280,7 +284,7 @@ _mesa_add_sampler(struct gl_program_parameter_list *paramList, else { const GLint size = 1; i = _mesa_add_parameter(paramList, PROGRAM_SAMPLER, name, - size, NULL, NULL); + size, datatype, NULL, NULL); return i; } } @@ -301,7 +305,7 @@ _mesa_add_varying(struct gl_program_parameter_list *paramList, else { assert(size == 4); i = _mesa_add_parameter(paramList, PROGRAM_VARYING, name, - size, NULL, NULL); + size, GL_NONE, NULL, NULL); return i; } } @@ -330,7 +334,7 @@ _mesa_add_attribute(struct gl_program_parameter_list *paramList, if (size < 0) size = 4; i = _mesa_add_parameter(paramList, PROGRAM_INPUT, name, - size, NULL, state); + size, GL_NONE, NULL, state); } return i; } @@ -396,7 +400,8 @@ _mesa_add_state_reference(struct gl_program_parameter_list *paramList, name = _mesa_program_state_string(stateTokens); index = _mesa_add_parameter(paramList, PROGRAM_STATE_VAR, name, - size, NULL, (gl_state_index *) stateTokens); + size, GL_NONE, + NULL, (gl_state_index *) stateTokens); paramList->StateFlags |= _mesa_program_state_flags(stateTokens); /* free name string here since we duplicated it in add_parameter() */ @@ -565,8 +570,8 @@ _mesa_clone_parameter_list(const struct gl_program_parameter_list *list) for (i = 0; i < list->NumParameters; i++) { struct gl_program_parameter *p = list->Parameters + i; GLuint size = MIN2(p->Size, 4); - GLint j = _mesa_add_parameter(clone, p->Type, p->Name, - size, list->ParameterValues[i], NULL); + GLint j = _mesa_add_parameter(clone, p->Type, p->Name, size, p->DataType, + list->ParameterValues[i], NULL); ASSERT(j >= 0); /* copy state indexes */ if (p->Type == PROGRAM_STATE_VAR) { diff --git a/src/mesa/shader/prog_parameter.h b/src/mesa/shader/prog_parameter.h index 2e0feb972ec..09ff851ea73 100644 --- a/src/mesa/shader/prog_parameter.h +++ b/src/mesa/shader/prog_parameter.h @@ -46,6 +46,7 @@ struct gl_program_parameter { const char *Name; /**< Null-terminated string */ enum register_file Type; /**< PROGRAM_NAMED_PARAM, CONSTANT or STATE_VAR */ + GLenum DataType; /**< GL_FLOAT, GL_FLOAT_VEC2, etc */ GLuint Size; /**< Number of components (1..4) */ /** * A sequence of STATE_* tokens and integers to identify GL state. @@ -80,7 +81,7 @@ _mesa_clone_parameter_list(const struct gl_program_parameter_list *list); extern GLint _mesa_add_parameter(struct gl_program_parameter_list *paramList, enum register_file type, const char *name, - GLuint size, const GLfloat *values, + GLuint size, GLenum datatype, const GLfloat *values, const gl_state_index state[STATE_LENGTH]); extern GLint @@ -99,11 +100,11 @@ _mesa_add_unnamed_constant(struct gl_program_parameter_list *paramList, extern GLint _mesa_add_uniform(struct gl_program_parameter_list *paramList, - const char *name, GLuint size); + const char *name, GLuint size, GLenum datatype); extern GLint _mesa_add_sampler(struct gl_program_parameter_list *paramList, - const char *name); + const char *name, GLenum datatype); extern GLint _mesa_add_varying(struct gl_program_parameter_list *paramList, diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 74bdef061b5..418ef5c7239 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -638,12 +638,8 @@ _mesa_get_active_uniform(GLcontext *ctx, GLuint program, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLchar *nameOut) { - static const GLenum vec_types[] = { - GL_FLOAT, GL_FLOAT_VEC2, GL_FLOAT_VEC3, GL_FLOAT_VEC4 - }; struct gl_shader_program *shProg = _mesa_lookup_shader_program(ctx, program); - GLint sz; GLuint ind, j; if (!shProg) { @@ -664,11 +660,10 @@ _mesa_get_active_uniform(GLcontext *ctx, GLuint program, GLuint index, /* found it */ copy_string(nameOut, maxLength, length, shProg->Uniforms->Parameters[j].Name); - sz = shProg->Uniforms->Parameters[j].Size; if (size) - *size = sz; + *size = shProg->Uniforms->Parameters[j].Size; if (type) - *type = vec_types[sz-1]; /* XXX this is a temporary hack */ + *type = shProg->Uniforms->Parameters[j].DataType; return; } ind++; diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 06bceea7d0f..d8c06f064d9 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -2829,7 +2829,8 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var, * store->Index = sampler uniform location * store->Size = texture type index (1D, 2D, 3D, cube, etc) */ - GLint samplerUniform = _mesa_add_sampler(prog->Parameters, varName); + GLenum datatype = GL_SAMPLER_2D; + GLint samplerUniform = _mesa_add_sampler(prog->Parameters, varName, datatype); store = _slang_new_ir_storage(PROGRAM_SAMPLER, samplerUniform, texIndex); if (dbg) printf("SAMPLER "); } @@ -2839,7 +2840,9 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var, * MAX2(var->array_len, 1); if (prog) { /* user-defined uniform */ - GLint uniformLoc = _mesa_add_uniform(prog->Parameters, varName, size); + GLenum datatype = GL_FLOAT_VEC4; /* XXX */ + GLint uniformLoc = _mesa_add_uniform(prog->Parameters, varName, + size, datatype); store = _slang_new_ir_storage(PROGRAM_UNIFORM, uniformLoc, size); } else { diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 360af0922fa..48c0d68375e 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -202,10 +202,10 @@ link_uniform_vars(struct gl_shader_program *shProg, struct gl_program *prog) j = _mesa_add_state_reference(shProg->Uniforms, p->StateIndexes); break; case PROGRAM_UNIFORM: - j = _mesa_add_uniform(shProg->Uniforms, p->Name, p->Size); + j = _mesa_add_uniform(shProg->Uniforms, p->Name, p->Size, p->DataType); break; case PROGRAM_SAMPLER: - j = _mesa_add_sampler(shProg->Uniforms, p->Name); + j = _mesa_add_sampler(shProg->Uniforms, p->Name, p->DataType); break; default: _mesa_problem(NULL, "bad parameter type in link_uniform_vars()"); -- cgit v1.2.3 From addd03da2e254d16088171012c9ca0d157b0d4c2 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 18 Apr 2007 16:43:40 -0600 Subject: added _slang_gltype_from_specifier() --- src/mesa/shader/slang/slang_compile_variable.c | 68 ----------------------- src/mesa/shader/slang/slang_typeinfo.c | 76 ++++++++++++++++++++++++++ src/mesa/shader/slang/slang_typeinfo.h | 2 + 3 files changed, 78 insertions(+), 68 deletions(-) diff --git a/src/mesa/shader/slang/slang_compile_variable.c b/src/mesa/shader/slang/slang_compile_variable.c index 664fd9bc576..6632da9f8f3 100644 --- a/src/mesa/shader/slang/slang_compile_variable.c +++ b/src/mesa/shader/slang/slang_compile_variable.c @@ -337,71 +337,3 @@ _slang_locate_variable(const slang_variable_scope * scope, return _slang_locate_variable(scope->outer_scope, a_name, 1); return NULL; } - -#if 0 -static GLenum -gl_type_from_specifier(const slang_type_specifier * type) -{ - switch (type->type) { - case SLANG_SPEC_BOOL: - return GL_BOOL_ARB; - case SLANG_SPEC_BVEC2: - return GL_BOOL_VEC2_ARB; - case SLANG_SPEC_BVEC3: - return GL_BOOL_VEC3_ARB; - case SLANG_SPEC_BVEC4: - return GL_BOOL_VEC4_ARB; - case SLANG_SPEC_INT: - return GL_INT; - case SLANG_SPEC_IVEC2: - return GL_INT_VEC2_ARB; - case SLANG_SPEC_IVEC3: - return GL_INT_VEC3_ARB; - case SLANG_SPEC_IVEC4: - return GL_INT_VEC4_ARB; - case SLANG_SPEC_FLOAT: - return GL_FLOAT; - case SLANG_SPEC_VEC2: - return GL_FLOAT_VEC2_ARB; - case SLANG_SPEC_VEC3: - return GL_FLOAT_VEC3_ARB; - case SLANG_SPEC_VEC4: - return GL_FLOAT_VEC4_ARB; - case SLANG_SPEC_MAT2: - return GL_FLOAT_MAT2_ARB; - case SLANG_SPEC_MAT3: - return GL_FLOAT_MAT3_ARB; - case SLANG_SPEC_MAT4: - return GL_FLOAT_MAT4_ARB; - case SLANG_SPEC_MAT23: - return GL_FLOAT_MAT2x3_ARB; - case SLANG_SPEC_MAT32: - return GL_FLOAT_MAT3x2_ARB; - case SLANG_SPEC_MAT24: - return GL_FLOAT_MAT2x4_ARB; - case SLANG_SPEC_MAT42: - return GL_FLOAT_MAT4x2_ARB; - case SLANG_SPEC_MAT34: - return GL_FLOAT_MAT3x4_ARB; - case SLANG_SPEC_MAT43: - return GL_FLOAT_MAT4x3_ARB; - case SLANG_SPEC_SAMPLER1D: - return GL_SAMPLER_1D_ARB; - case SLANG_SPEC_SAMPLER2D: - return GL_SAMPLER_2D_ARB; - case SLANG_SPEC_SAMPLER3D: - return GL_SAMPLER_3D_ARB; - case SLANG_SPEC_SAMPLERCUBE: - return GL_SAMPLER_CUBE_ARB; - case SLANG_SPEC_SAMPLER1DSHADOW: - return GL_SAMPLER_1D_SHADOW_ARB; - case SLANG_SPEC_SAMPLER2DSHADOW: - return GL_SAMPLER_2D_SHADOW_ARB; - case SLANG_SPEC_ARRAy: - return gl_type_from_specifier(type->_array); - default: - return GL_FLOAT; - } -} -#endif - diff --git a/src/mesa/shader/slang/slang_typeinfo.c b/src/mesa/shader/slang/slang_typeinfo.c index 2af8eb736bb..957c302c5b3 100644 --- a/src/mesa/shader/slang/slang_typeinfo.c +++ b/src/mesa/shader/slang/slang_typeinfo.c @@ -944,3 +944,79 @@ _slang_type_dim(slang_type_specifier_type ty) return 0; } } + + +/** + * Return the GL_* type that corresponds to a SLANG_SPEC_* type. + */ +GLenum +_slang_gltype_from_specifier(const slang_type_specifier *type) +{ + switch (type->type) { + case SLANG_SPEC_BOOL: + return GL_BOOL; + case SLANG_SPEC_BVEC2: + return GL_BOOL_VEC2; + case SLANG_SPEC_BVEC3: + return GL_BOOL_VEC3; + case SLANG_SPEC_BVEC4: + return GL_BOOL_VEC4; + case SLANG_SPEC_INT: + return GL_INT; + case SLANG_SPEC_IVEC2: + return GL_INT_VEC2; + case SLANG_SPEC_IVEC3: + return GL_INT_VEC3; + case SLANG_SPEC_IVEC4: + return GL_INT_VEC4; + case SLANG_SPEC_FLOAT: + return GL_FLOAT; + case SLANG_SPEC_VEC2: + return GL_FLOAT_VEC2; + case SLANG_SPEC_VEC3: + return GL_FLOAT_VEC3; + case SLANG_SPEC_VEC4: + return GL_FLOAT_VEC4; + case SLANG_SPEC_MAT2: + return GL_FLOAT_MAT2; + case SLANG_SPEC_MAT3: + return GL_FLOAT_MAT3; + case SLANG_SPEC_MAT4: + return GL_FLOAT_MAT4; + case SLANG_SPEC_MAT23: + return GL_FLOAT_MAT2x3; + case SLANG_SPEC_MAT32: + return GL_FLOAT_MAT3x2; + case SLANG_SPEC_MAT24: + return GL_FLOAT_MAT2x4; + case SLANG_SPEC_MAT42: + return GL_FLOAT_MAT4x2; + case SLANG_SPEC_MAT34: + return GL_FLOAT_MAT3x4; + case SLANG_SPEC_MAT43: + return GL_FLOAT_MAT4x3; + case SLANG_SPEC_SAMPLER1D: + return GL_SAMPLER_1D; + case SLANG_SPEC_SAMPLER2D: + return GL_SAMPLER_2D; + case SLANG_SPEC_SAMPLER3D: + return GL_SAMPLER_3D; + case SLANG_SPEC_SAMPLERCUBE: + return GL_SAMPLER_CUBE; + case SLANG_SPEC_SAMPLER1DSHADOW: + return GL_SAMPLER_1D_SHADOW; + case SLANG_SPEC_SAMPLER2DSHADOW: + return GL_SAMPLER_2D_SHADOW; + case SLANG_SPEC_SAMPLER2DRECT: + return GL_SAMPLER_2D_RECT_ARB; + case SLANG_SPEC_SAMPLER2DRECTSHADOW: + return GL_SAMPLER_2D_RECT_SHADOW_ARB; + case SLANG_SPEC_ARRAY: + return _slang_gltype_from_specifier(type->_array); + case SLANG_SPEC_STRUCT: + /* fall-through */ + default: + return GL_NONE; + } +} + diff --git a/src/mesa/shader/slang/slang_typeinfo.h b/src/mesa/shader/slang/slang_typeinfo.h index ffffd09a5c2..587331e8b1e 100644 --- a/src/mesa/shader/slang/slang_typeinfo.h +++ b/src/mesa/shader/slang/slang_typeinfo.h @@ -196,5 +196,7 @@ _slang_type_base(slang_type_specifier_type); extern GLuint _slang_type_dim(slang_type_specifier_type); +extern GLenum +_slang_gltype_from_specifier(const slang_type_specifier *type); #endif -- cgit v1.2.3 From 36a6a59972857676108c4ee72e677734848d3056 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 18 Apr 2007 16:44:02 -0600 Subject: record proper datatypes for uniforms/samplers --- src/mesa/shader/slang/slang_codegen.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index d8c06f064d9..2f7002ceeb3 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -2817,11 +2817,10 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var, struct gl_program *prog = A->program; const char *varName = (char *) var->a_name; GLboolean success = GL_TRUE; - GLint texIndex; slang_ir_storage *store = NULL; int dbg = 0; - - texIndex = sampler_to_texture_index(var->type.specifier.type); + const GLenum datatype = _slang_gltype_from_specifier(&var->type.specifier); + const GLint texIndex = sampler_to_texture_index(var->type.specifier.type); if (texIndex != -1) { /* Texture sampler: @@ -2829,8 +2828,8 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var, * store->Index = sampler uniform location * store->Size = texture type index (1D, 2D, 3D, cube, etc) */ - GLenum datatype = GL_SAMPLER_2D; - GLint samplerUniform = _mesa_add_sampler(prog->Parameters, varName, datatype); + GLint samplerUniform + = _mesa_add_sampler(prog->Parameters, varName, datatype); store = _slang_new_ir_storage(PROGRAM_SAMPLER, samplerUniform, texIndex); if (dbg) printf("SAMPLER "); } @@ -2840,7 +2839,6 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var, * MAX2(var->array_len, 1); if (prog) { /* user-defined uniform */ - GLenum datatype = GL_FLOAT_VEC4; /* XXX */ GLint uniformLoc = _mesa_add_uniform(prog->Parameters, varName, size, datatype); store = _slang_new_ir_storage(PROGRAM_UNIFORM, uniformLoc, size); -- cgit v1.2.3 From 8d370fb2eee702e1ba2c622716645d450272549a Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 18 Apr 2007 16:46:53 -0600 Subject: new comments --- src/mesa/shader/prog_parameter.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index 7f17be74f72..a01a6456fb6 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -251,6 +251,14 @@ _mesa_add_unnamed_constant(struct gl_program_parameter_list *paramList, } +/** + * Add a uniform to the parameter list. + * Note that if the uniform is an array, size may be greater than + * what's implied by the datatype. + * \param name uniform's name + * \param size number of floats to allocate + * \param datatype GL_FLOAT_VEC3, GL_FLOAT_MAT4, etc. + */ GLint _mesa_add_uniform(struct gl_program_parameter_list *paramList, const char *name, GLuint size, GLenum datatype) @@ -272,6 +280,11 @@ _mesa_add_uniform(struct gl_program_parameter_list *paramList, } +/** + * Add a sampler to the parameter list. + * \param name uniform's name + * \param datatype GL_SAMPLER_2D, GL_SAMPLER_2D_RECT_ARB, etc. + */ GLint _mesa_add_sampler(struct gl_program_parameter_list *paramList, const char *name, GLenum datatype) -- cgit v1.2.3 From 6b3027e291baf6a7dc5e63780d05f89753a13d74 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 18 Apr 2007 16:48:55 -0600 Subject: comments, assertions --- src/mesa/shader/prog_parameter.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index a01a6456fb6..9e3d3fecf22 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -274,7 +274,6 @@ _mesa_add_uniform(struct gl_program_parameter_list *paramList, else { i = _mesa_add_parameter(paramList, PROGRAM_UNIFORM, name, size, datatype, NULL, NULL); - return i; } } @@ -291,11 +290,13 @@ _mesa_add_sampler(struct gl_program_parameter_list *paramList, { GLint i = _mesa_lookup_parameter_index(paramList, -1, name); if (i >= 0 && paramList->Parameters[i].Type == PROGRAM_SAMPLER) { + ASSERT(paramList->Parameters[i].Size == 1); + ASSERT(paramList->Parameters[i].DataType == datatype); /* already in list */ return i; } else { - const GLint size = 1; + const GLint size = 1; /* a sampler is basically a texture unit number */ i = _mesa_add_parameter(paramList, PROGRAM_SAMPLER, name, size, datatype, NULL, NULL); return i; -- cgit v1.2.3 From 5ca8d4ccf24af1c174ff791f15cf9f19defd9b7e Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 18 Apr 2007 18:05:33 -0600 Subject: fix an uninitialized variable and a warning --- src/mesa/shader/slang/slang_codegen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 2f7002ceeb3..a928abd55db 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -1752,7 +1752,7 @@ static slang_ir_node * _slang_gen_temporary(GLint size) { slang_ir_storage *store; - slang_ir_node *n; + slang_ir_node *n = NULL; store = _slang_new_ir_storage(PROGRAM_TEMPORARY, -1, size); if (store) { @@ -2905,7 +2905,7 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var, if (dbg) printf("ATTRIB "); } else if (var->type.qualifier == SLANG_QUAL_FIXEDINPUT) { - GLuint swizzle; + GLuint swizzle = SWIZZLE_XYZW; /* silence compiler warning */ GLint index = _slang_input_index(varName, GL_FRAGMENT_PROGRAM_ARB, &swizzle); GLint size = 4; /* XXX? */ -- cgit v1.2.3 From 8e6207396c6314d07614c80670f4e3196e3a8551 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 19 Apr 2007 11:21:14 -0600 Subject: Don't allow deferredTexture if using occlusion query and a frag shader. Occlusion query might depend on the shader killing/discarding fragments. Helps fix depth peeling technique. Also, minor tweaks in interpolate_wpos(). --- src/mesa/swrast/s_span.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index c6efea30753..f3b79986186 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -776,6 +776,9 @@ interpolate_wpos(GLcontext *ctx, SWspan *span) { GLfloat (*wpos)[4] = span->array->attribs[FRAG_ATTRIB_WPOS]; GLuint i; + const GLfloat zScale = 1.0 / ctx->DrawBuffer->_DepthMaxF; + GLfloat w, dw; + if (span->arrayMask & SPAN_XY) { for (i = 0; i < span->end; i++) { wpos[i][0] = (GLfloat) span->array->x[i]; @@ -788,10 +791,13 @@ interpolate_wpos(GLcontext *ctx, SWspan *span) wpos[i][1] = (GLfloat) span->y; } } + + w = span->attrStart[FRAG_ATTRIB_WPOS][3]; + dw = span->attrStepX[FRAG_ATTRIB_WPOS][3]; for (i = 0; i < span->end; i++) { - wpos[i][2] = (GLfloat) span->array->z[i] / ctx->DrawBuffer->_DepthMaxF; - wpos[i][3] = span->attrStart[FRAG_ATTRIB_WPOS][3] - + i * span->attrStepX[FRAG_ATTRIB_WPOS][3]; + wpos[i][2] = (GLfloat) span->array->z[i] * zScale; + wpos[i][3] = w; + w += dw; } } @@ -1401,7 +1407,10 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) ASSERT((span->interpMask & span->arrayMask) == 0); ASSERT((span->interpMask & SPAN_RGBA) ^ (span->arrayMask & SPAN_RGBA)); - /* check for conditions that prevent deferred shading */ + /* 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; @@ -1413,6 +1422,10 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) /* 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; } -- cgit v1.2.3 From 6bde08815fae2a5ba95e0446d8c73040d1f321bc Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 19 Apr 2007 11:23:26 -0600 Subject: In _mesa_unpack_depth_span() look for special cases of GLuint->GLushort and GLushort->GLuint conversion. This improves performance and avoids int/float/int conversion problems that can introduce errors during glCopyTexImage(). Another fix for the depth peeling algorithm. --- src/mesa/main/image.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 394a7c65cdf..dcd7f10b26e 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -3893,6 +3893,36 @@ _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, { GLfloat depthTemp[MAX_WIDTH], *depthValues; + /* Look for special cases first. + * Not only are these faster, they're less prone to numeric conversion + * problems. Otherwise, converting from an int type to a float then + * back to an int type can introduce errors that will show up as + * artifacts in things like depth peeling which uses glCopyTexImage. + */ + if (ctx->Pixel.DepthScale == 1.0 && ctx->Pixel.DepthBias == 0.0) { + if (srcType == GL_UNSIGNED_INT && dstType == GL_UNSIGNED_SHORT) { + const GLuint *src = (const GLuint *) source; + GLushort *dst = (GLushort *) dest; + GLuint i; + for (i = 0; i < n; i++) { + dst[i] = src[i] >> 16; + } + return; + } + if (srcType == GL_UNSIGNED_SHORT && dstType == GL_UNSIGNED_INT) { + const GLushort *src = (const GLushort *) source; + GLuint *dst = (GLuint *) dest; + GLuint i; + for (i = 0; i < n; i++) { + dst[i] = src[i] | (src[i] << 16); + } + return; + } + /* XXX may want to add additional cases here someday */ + } + + /* general case path */ + if (dstType == GL_FLOAT) { depthValues = (GLfloat *) dest; } @@ -3903,6 +3933,7 @@ _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, /* XXX we need to obey srcPacking->SwapBytes here!!! */ (void) srcPacking; + /* convert incoming values to GLfloat */ switch (srcType) { case GL_BYTE: DEPTH_VALUES(GLbyte, BYTE_TO_FLOAT); -- cgit v1.2.3 From 4abcaf3949a7ad9580a05d6029f2289adb4bcf03 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 19 Apr 2007 14:04:30 -0600 Subject: init A.curFuncEndLabel = NULL --- src/mesa/shader/slang/slang_compile.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index d3f6986543e..7ea6cc064ed 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -1617,6 +1617,7 @@ parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O, A.space.vars = O->vars; A.program = O->program; A.vartable = O->vartable; + A.curFuncEndLabel = NULL; _slang_codegen_global_variable(&A, var, C->type); } -- cgit v1.2.3 From 00da9afb8493a883b4a4db47484e875781c72c71 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 19 Apr 2007 14:06:27 -0600 Subject: fix crash when program has invalid structure field --- src/mesa/shader/slang/slang_codegen.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index a928abd55db..f1761743dd2 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -2320,15 +2320,16 @@ _slang_gen_field(slang_assemble_ctx * A, slang_operation *oper) /* oper->a_id is the field name */ slang_ir_node *base, *n; slang_typeinfo field_ti; - GLint fieldSize, fieldOffset; + GLint fieldSize, fieldOffset = -1; /* type of field */ slang_typeinfo_construct(&field_ti); _slang_typeof_operation(A, oper, &field_ti); fieldSize = _slang_sizeof_type_specifier(&field_ti.spec); - fieldOffset = _slang_field_offset(&ti.spec, oper->a_id); + if (fieldSize > 0) + fieldOffset = _slang_field_offset(&ti.spec, oper->a_id); - if (fieldOffset < 0) { + if (fieldSize == 0 || fieldOffset < 0) { slang_info_log_error(A->log, "\"%s\" is not a member of struct \"%s\"", (char *) oper->a_id, -- cgit v1.2.3 From 24a93dd6a427567071bd5aecd7bf53828381bc73 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 19 Apr 2007 14:06:43 -0600 Subject: remove invalid assertion --- src/mesa/shader/slang/slang_codegen.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index f1761743dd2..6519040b662 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -1202,7 +1202,6 @@ _slang_gen_function_call(slang_assemble_ctx *A, slang_function *fun, /*_slang_label_delete(A->curFuncEndLabel);*/ A->curFuncEndLabel = prevFuncEndLabel; - assert(A->curFuncEndLabel); return n; } -- cgit v1.2.3 From 121f2212ccfa716e4853d0eead3755103d8c89e4 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 19 Apr 2007 14:07:16 -0600 Subject: remove invalid assertion (span->facing may be set because of polygonmode) --- src/mesa/swrast/s_stencil.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c index 43475c0e816..2b898486b22 100644 --- a/src/mesa/swrast/s_stencil.c +++ b/src/mesa/swrast/s_stencil.c @@ -1009,8 +1009,6 @@ stencil_and_ztest_pixels( GLcontext *ctx, SWspan *span, GLuint face ) GLboolean _swrast_stencil_and_ztest_span(GLcontext *ctx, SWspan *span) { - /* span->facing can only be non-zero if using two-sided stencil */ - ASSERT(ctx->Stencil._TestTwoSide || span->facing == 0); if (span->arrayMask & SPAN_XY) return stencil_and_ztest_pixels(ctx, span, span->facing); else -- cgit v1.2.3 From 020cdb47cf172c6ef8da78abcf6621233439d08b Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 19 Apr 2007 14:15:11 -0600 Subject: Fix valgrind problem caused by reading text[-1]. --- src/mesa/shader/grammar/grammar.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mesa/shader/grammar/grammar.c b/src/mesa/shader/grammar/grammar.c index 989e9544911..a9775961d3a 100644 --- a/src/mesa/shader/grammar/grammar.c +++ b/src/mesa/shader/grammar/grammar.c @@ -2693,14 +2693,16 @@ fast_match (dict *di, const byte *text, int *index, rule *ru, int *_PP, bytepool if (status == mr_matched) { - if (sp->m_emits != NULL) - if (emit_push (sp->m_emits, _BP->_F + _P, text[ind - 1], save_ind, &ctx)) + if (sp->m_emits != NULL) { + const byte ch = (ind <= 0) ? 0 : text[ind - 1]; + if (emit_push (sp->m_emits, _BP->_F + _P, ch, save_ind, &ctx)) { free_regbyte_ctx_stack (ctx, *rbc); return mr_internal_error; } - _P = _P2; + } + _P = _P2; } /* if the rule operator is a logical or, we pick up the first matching specifier */ -- cgit v1.2.3 From 8b5fce6bcc88cd9dd321f0db95c1714e5e5e85a1 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 19 Apr 2007 14:24:10 -0600 Subject: Put gl_program_machine into swrast structure rather than using a local variable. Basically an easy way to make sure the memory gets initialized once (to zero) to avoid lots of valgrind warnings. --- src/mesa/swrast/s_context.h | 8 ++++++-- src/mesa/swrast/s_fragprog.c | 15 +++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h index 1cf3813fd36..dfe311a40bc 100644 --- a/src/mesa/swrast/s_context.h +++ b/src/mesa/swrast/s_context.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.2 + * Version: 6.5.3 * - * 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"), @@ -46,6 +46,7 @@ #include "mtypes.h" #include "swrast.h" #include "s_span.h" +#include "prog_execute.h" typedef void (*texture_sample_func)(GLcontext *ctx, @@ -222,6 +223,9 @@ typedef struct validate_texture_image_func ValidateTextureImage; + /** State used during execution of fragment programs */ + struct gl_program_machine FragProgMachine; + } SWcontext; diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index 7f7c0d6db52..1b5f20d42d6 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -25,7 +25,6 @@ #include "glheader.h" #include "colormac.h" #include "context.h" -#include "prog_execute.h" #include "prog_instruction.h" #include "s_fragprog.h" @@ -105,7 +104,7 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine, if (ctx->FragmentProgram.CallbackEnabled) inputsRead = ~0; - if (program->Base.Target == GL_FRAGMENT_PROGRAM_NV) { + if (1/*program->Base.Target == GL_FRAGMENT_PROGRAM_NV*/) { /* Clear temporary registers (undefined for ARB_f_p) */ _mesa_bzero(machine->Temporaries, MAX_PROGRAM_TEMPS * 4 * sizeof(GLfloat)); @@ -142,19 +141,19 @@ run_program(GLcontext *ctx, SWspan *span, GLuint start, GLuint end) SWcontext *swrast = SWRAST_CONTEXT(ctx); const struct gl_fragment_program *program = ctx->FragmentProgram._Current; const GLbitfield outputsWritten = program->Base.OutputsWritten; - struct gl_program_machine machine; + struct gl_program_machine *machine = &swrast->FragProgMachine; GLuint i; for (i = start; i < end; i++) { if (span->array->mask[i]) { - init_machine(ctx, &machine, program, span, i); + init_machine(ctx, machine, program, span, i); - if (_mesa_execute_program(ctx, &program->Base, &machine)) { + if (_mesa_execute_program(ctx, &program->Base, machine)) { /* Store result color */ if (outputsWritten & (1 << FRAG_RESULT_COLR)) { COPY_4V(span->array->attribs[FRAG_ATTRIB_COL0][i], - machine.Outputs[FRAG_RESULT_COLR]); + machine->Outputs[FRAG_RESULT_COLR]); } else { /* Multiple drawbuffers / render targets @@ -165,14 +164,14 @@ run_program(GLcontext *ctx, SWspan *span, GLuint start, GLuint end) for (output = 0; output < swrast->_NumColorOutputs; output++) { if (outputsWritten & (1 << (FRAG_RESULT_DATA0 + output))) { COPY_4V(span->array->attribs[FRAG_ATTRIB_COL0+output][i], - machine.Outputs[FRAG_RESULT_DATA0 + output]); + machine->Outputs[FRAG_RESULT_DATA0 + output]); } } } /* Store result depth/z */ if (outputsWritten & (1 << FRAG_RESULT_DEPR)) { - const GLfloat depth = machine.Outputs[FRAG_RESULT_DEPR][2]; + const GLfloat depth = machine->Outputs[FRAG_RESULT_DEPR][2]; if (depth <= 0.0) span->array->z[i] = 0; else if (depth >= 1.0) -- cgit v1.2.3 From ba3d384e94faaedd4b1e0a90c1a765452bf594f3 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 19 Apr 2007 14:24:29 -0600 Subject: dFdx(), etc. don't work yet --- docs/shading.html | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/shading.html b/docs/shading.html index 3a10f1b0ce0..64ec9990d0a 100644 --- a/docs/shading.html +++ b/docs/shading.html @@ -44,6 +44,7 @@ in Mesa:

    • Comparison of user-defined structs
    • Linking of multiple shaders is not supported
    • gl_ClipVertex +
    • The derivative functions such as dFdx() are not implemented

    -- cgit v1.2.3 From 535c37e85d9283f177825e7534e5d0abb4d93886 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 19 Apr 2007 14:24:58 -0600 Subject: Notes about shared lib version. Document depth-peel fixes. --- docs/relnotes-6.5.3.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/relnotes-6.5.3.html b/docs/relnotes-6.5.3.html index 8f6ea8bea31..0d0398aaf41 100644 --- a/docs/relnotes-6.5.3.html +++ b/docs/relnotes-6.5.3.html @@ -22,6 +22,22 @@ TBD +

    Shared library numbering

    +

    +Mesa 6.5.3 supports the OpenGL 2.0/2.1 API. However, the (unix) +shared library version is still 1.5 (i.e. libGL.so.1.5.xxxxxx). +Bumping the shared library version to 2.x would cause linking problems +with existing OpenGL applications. Since OpenGL 2.x is backward +compatible with OpenGL 1.x the shared library version number doesn't +have to be incremented (which would indicate an incompatible ABI). +

    +

    +Other OpenGL vendors name their OpenGL 2.x libraries libGL.so.1.0.xxxxx +for the same reason. +

    + + +

    New features

    • OpenGL 2.0 and 2.1 API support. @@ -47,6 +63,7 @@ TBD
    • Fixed a few bugs in software-emulated alpha planes
    • Assorted minor bug fixes in glCopy/DrawPixels, glPixelZoom, etc.
    • Assorted DRI driver bug fixes. +
    • Fixed a number of bugs that prevented "depth-peeling" rendering from working.
    -- cgit v1.2.3 From d60009bd6dba15d094b0d0bcb8180b7a2e1c1708 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Fri, 20 Apr 2007 17:35:01 +0300 Subject: Revert "xmesa: drop glide (FX) backend." This reverts commit 2a2f8d806f74619f0a7cf97fdc7f7b3ad1cad81b. --- src/mesa/drivers/x11/fakeglx.c | 13 ++- src/mesa/drivers/x11/xm_api.c | 258 ++++++++++++++++++++++++++++++++++++++++- src/mesa/drivers/x11/xmesaP.h | 19 ++- 3 files changed, 284 insertions(+), 6 deletions(-) diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index b6569b1938f..eecd52aa32b 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1440,7 +1440,7 @@ Fake_glXMakeContextCurrent( Display *dpy, GLXDrawable draw, } if (!drawBuffer) { /* drawable must be a new window! */ - drawBuffer = XMesaCreateWindowBuffer( xmctx->xm_visual, draw ); + drawBuffer = XMesaCreateWindowBuffer2( xmctx->xm_visual, draw, xmctx); if (!drawBuffer) { /* Out of memory, or context/drawable depth mismatch */ return False; @@ -1457,7 +1457,8 @@ Fake_glXMakeContextCurrent( Display *dpy, GLXDrawable draw, } if (!readBuffer) { /* drawable must be a new window! */ - readBuffer = XMesaCreateWindowBuffer( xmctx->xm_visual, read ); + readBuffer = XMesaCreateWindowBuffer2(glxCtx->xmesaContext->xm_visual, + read, xmctx); if (!readBuffer) { /* Out of memory, or context/drawable depth mismatch */ return False; @@ -1929,6 +1930,12 @@ Fake_glXWaitX( void ) static const char * get_extensions( void ) { +#ifdef FX + const char *fx = _mesa_getenv("MESA_GLX_FX"); + if (fx && fx[0] != 'd') { + return EXTENSIONS; + } +#endif return EXTENSIONS + 23; /* skip "GLX_MESA_set_3dfx_mode" */ } @@ -2100,7 +2107,7 @@ Fake_glXCreateWindow( Display *dpy, GLXFBConfig config, Window win, if (!xmvis) return 0; - xmbuf = XMesaCreateWindowBuffer(xmvis, win); + xmbuf = XMesaCreateWindowBuffer2(xmvis, win, NULL); if (!xmbuf) return 0; diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 6f671969fec..6439d13fa5f 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1557,6 +1557,12 @@ PUBLIC void XMesaDestroyContext( XMesaContext c ) { GLcontext *mesaCtx = &c->mesa; +#ifdef FX + XMesaBuffer xmbuf = XMESA_BUFFER(mesaCtx->DrawBuffer); + + if (xmbuf && xmbuf->FXctx) + fxMesaDestroyContext(xmbuf->FXctx); +#endif _swsetup_DestroyContext( mesaCtx ); _swrast_DestroyContext( mesaCtx ); _tnl_DestroyContext( mesaCtx ); @@ -1572,13 +1578,17 @@ void XMesaDestroyContext( XMesaContext c ) * X window or pixmap. * \param v the window's XMesaVisual * \param w the window we're wrapping + * \param c context used to initialize the buffer if 3Dfx mode in use. * \return new XMesaBuffer or NULL if error */ -PUBLIC XMesaBuffer -XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w) +XMesaBuffer +XMesaCreateWindowBuffer2(XMesaVisual v, XMesaWindow w, XMesaContext c) { #ifndef XFree86Server XWindowAttributes attr; +#endif +#ifdef FX + char *fxEnvVar; #endif int client = 0; XMesaBuffer b; @@ -1586,6 +1596,7 @@ XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w) assert(v); assert(w); + (void) c; /* Check that window depth matches visual depth */ #ifdef XFree86Server @@ -1631,10 +1642,96 @@ XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w) return NULL; } +#ifdef FX + fxEnvVar = _mesa_getenv("MESA_GLX_FX"); + if (fxEnvVar) { + if (fxEnvVar[0]!='d') { + int attribs[100]; + int numAttribs = 0; + int hw; + if (v->mesa_visual.depthBits > 0) { + attribs[numAttribs++] = FXMESA_DEPTH_SIZE; + attribs[numAttribs++] = v->mesa_visual.depthBits; + } + if (v->mesa_visual.doubleBufferMode) { + attribs[numAttribs++] = FXMESA_DOUBLEBUFFER; + } + if (v->mesa_visual.accumRedBits > 0) { + attribs[numAttribs++] = FXMESA_ACCUM_SIZE; + attribs[numAttribs++] = v->mesa_visual.accumRedBits; + } + if (v->mesa_visual.stencilBits > 0) { + attribs[numAttribs++] = FXMESA_STENCIL_SIZE; + attribs[numAttribs++] = v->mesa_visual.stencilBits; + } + if (v->mesa_visual.alphaBits > 0) { + attribs[numAttribs++] = FXMESA_ALPHA_SIZE; + attribs[numAttribs++] = v->mesa_visual.alphaBits; + } + if (1) { + attribs[numAttribs++] = FXMESA_SHARE_CONTEXT; + attribs[numAttribs++] = (int) &(c->mesa); + } + attribs[numAttribs++] = FXMESA_NONE; + + /* [dBorca] we should take an envvar for `fxMesaSelectCurrentBoard'!!! */ + hw = fxMesaSelectCurrentBoard(0); + + /* if these fail, there's a new bug somewhere */ + ASSERT(b->mesa_buffer.Width > 0); + ASSERT(b->mesa_buffer.Height > 0); + + if ((hw == GR_SSTTYPE_VOODOO) || (hw == GR_SSTTYPE_Voodoo2)) { + b->FXctx = fxMesaCreateBestContext(0, b->mesa_buffer.Width, + b->mesa_buffer.Height, attribs); + if ((v->undithered_pf!=PF_Index) && (b->backxrb->ximage)) { + b->FXisHackUsable = b->FXctx ? GL_TRUE : GL_FALSE; + if (b->FXctx && (fxEnvVar[0]=='w' || fxEnvVar[0]=='W')) { + b->FXwindowHack = GL_TRUE; + FX_grSstControl(GR_CONTROL_DEACTIVATE); + } + else { + b->FXwindowHack = GL_FALSE; + } + } + } + else { + if (fxEnvVar[0]=='w' || fxEnvVar[0]=='W') + b->FXctx = fxMesaCreateContext(w, GR_RESOLUTION_NONE, + GR_REFRESH_75Hz, attribs); + else + b->FXctx = fxMesaCreateBestContext(0, b->mesa_buffer.Width, + b->mesa_buffer.Height, attribs); + b->FXisHackUsable = GL_FALSE; + b->FXwindowHack = GL_FALSE; + } + /* + fprintf(stderr, + "voodoo %d, wid %d height %d hack: usable %d active %d\n", + hw, b->mesa_buffer.Width, b->mesa_buffer.Height, + b->FXisHackUsable, b->FXwindowHack); + */ + } + } + else { + _mesa_warning(NULL, "WARNING: This Mesa Library includes the Glide driver but\n"); + _mesa_warning(NULL, " you have not defined the MESA_GLX_FX env. var.\n"); + _mesa_warning(NULL, " (check the README.3DFX file for more information).\n\n"); + _mesa_warning(NULL, " you can disable this message with a 'export MESA_GLX_FX=disable'.\n"); + } +#endif + return b; } +PUBLIC XMesaBuffer +XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w) +{ + return XMesaCreateWindowBuffer2( v, w, NULL ); +} + + /** * Create a new XMesaBuffer from an X pixmap. * @@ -1760,6 +1857,15 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer, if (!drawBuffer || !readBuffer) return GL_FALSE; /* must specify buffers! */ +#ifdef FX + if (drawBuffer->FXctx) { + fxMesaMakeCurrent(drawBuffer->FXctx); + + c->xm_buffer = drawBuffer; + + return GL_TRUE; + } +#endif if (&(c->mesa) == _mesa_get_current_context() && c->mesa.DrawBuffer == &drawBuffer->mesa_buffer && c->mesa.ReadBuffer == &readBuffer->mesa_buffer @@ -1900,12 +2006,141 @@ GLboolean XMesaCopyContext( XMesaContext xm_src, XMesaContext xm_dst, GLuint mas */ GLboolean XMesaSetFXmode( GLint mode ) { +#ifdef FX + const char *fx = _mesa_getenv("MESA_GLX_FX"); + if (fx && fx[0] != 'd') { + GET_CURRENT_CONTEXT(ctx); + GrHwConfiguration hw; + if (!FX_grSstQueryHardware(&hw)) { + /*fprintf(stderr, "!grSstQueryHardware\n");*/ + return GL_FALSE; + } + if (hw.num_sst < 1) { + /*fprintf(stderr, "hw.num_sst < 1\n");*/ + return GL_FALSE; + } + if (ctx) { + /* [dBorca] Hack alert: + * oh, this is sooo wrong: ctx above is + * really an fxMesaContext, not an XMesaContext + */ + XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer); + if (mode == XMESA_FX_WINDOW) { + if (xmbuf->FXisHackUsable) { + FX_grSstControl(GR_CONTROL_DEACTIVATE); + xmbuf->FXwindowHack = GL_TRUE; + return GL_TRUE; + } + } + else if (mode == XMESA_FX_FULLSCREEN) { + FX_grSstControl(GR_CONTROL_ACTIVATE); + xmbuf->FXwindowHack = GL_FALSE; + return GL_TRUE; + } + else { + /* Error: Bad mode value */ + } + } + } + /*fprintf(stderr, "fallthrough\n");*/ +#else (void) mode; +#endif return GL_FALSE; } +#ifdef FX +/* + * Read image from VooDoo frame buffer into X/Mesa's back XImage. + */ +static void FXgetImage( XMesaBuffer b ) +{ + GET_CURRENT_CONTEXT(ctx); + static unsigned short pixbuf[MAX_WIDTH]; + GLuint x, y; + GLuint width, height; + XMesaContext xmesa = XMESA_CONTEXT(ctx); + +#ifdef XFree86Server + x = b->frontxrb->pixmap->x; + y = b->frontxrb->pixmap->y; + width = b->frontxrb->pixmap->width; + height = b->frontxrb->pixmap->height; + depth = b->frontxrb->pixmap->depth; +#else + xmesa_get_window_size(b->display, b, &width, &height); + x = y = 0; +#endif + if (b->mesa_buffer.Width != width || b->mesa_buffer.Height != height) { + b->mesa_buffer.Width = MIN2((int)width, b->FXctx->width); + b->mesa_buffer.Height = MIN2((int)height, b->FXctx->height); + if (b->mesa_buffer.Width & 1) + b->mesa_buffer.Width--; /* prevent odd width */ + } + + /* [dBorca] we're always in the right GR_COLORFORMAT... aren't we? */ + /* grLfbWriteColorFormat(GR_COLORFORMAT_ARGB); */ + if (b->xm_visual->undithered_pf==PF_5R6G5B) { + /* Special case: 16bpp RGB */ + grLfbReadRegion( GR_BUFFER_FRONTBUFFER, /* src buffer */ + 0, b->FXctx->height - b->mesa_buffer.Height, /*pos*/ + b->mesa_buffer.Width, b->mesa_buffer.Height, /* size */ + b->mesa_buffer.Width * sizeof(GLushort), /* stride */ + b->backxrb->ximage->data); /* dest buffer */ + } + else if (b->xm_visual->dithered_pf==PF_Dither + && GET_VISUAL_DEPTH(b->xm_visual)==8) { + /* Special case: 8bpp RGB */ + for (y=0;ymesa_buffer.Height;y++) { + GLubyte *ptr = (GLubyte*) b->backxrb->ximage->data + + b->backxrb->ximage->bytes_per_line * y; + XDITHER_SETUP(y); + + /* read row from 3Dfx frame buffer */ + grLfbReadRegion( GR_BUFFER_FRONTBUFFER, + 0, b->FXctx->height-(b->mesa_buffer.Height-y), + b->mesa_buffer.Width, 1, + 0, + pixbuf ); + + /* write to XImage back buffer */ + for (x=0;xmesa_buffer.Width;x++) { + GLubyte r = (pixbuf[x] & 0xf800) >> 8; + GLubyte g = (pixbuf[x] & 0x07e0) >> 3; + GLubyte b = (pixbuf[x] & 0x001f) << 3; + *ptr++ = XDITHER( x, r, g, b); + } + } + } + else { + /* General case: slow! */ + for (y=0;ymesa_buffer.Height;y++) { + /* read row from 3Dfx frame buffer */ + grLfbReadRegion( GR_BUFFER_FRONTBUFFER, + 0, b->FXctx->height-(b->mesa_buffer.Height-y), + b->mesa_buffer.Width, 1, + 0, + pixbuf ); + + /* write to XImage back buffer */ + for (x=0;xmesa_buffer.Width;x++) { + XMesaPutPixel(b->backxrb->ximage,x,y, + xmesa_color_to_pixel(ctx, + (pixbuf[x] & 0xf800) >> 8, + (pixbuf[x] & 0x07e0) >> 3, + (pixbuf[x] & 0x001f) << 3, + 0xff, + b->xm_visual->undithered_pf)); + } + } + } + /* grLfbWriteColorFormat(GR_COLORFORMAT_ABGR); */ +} +#endif + + /* * Copy the back buffer to the front buffer. If there's no back buffer * this is a no-op. @@ -1927,6 +2162,16 @@ void XMesaSwapBuffers( XMesaBuffer b ) _mesa_notifySwapBuffers(ctx); if (b->db_mode) { +#ifdef FX + if (b->FXctx) { + fxMesaSwapBuffers(); + + if (b->FXwindowHack) + FXgetImage(b); + else + return; + } +#endif if (b->backxrb->ximage) { /* Copy Ximage (back buf) from client memory to server window */ #if defined(USE_XSHM) && !defined(XFree86Server) @@ -1993,6 +2238,15 @@ void XMesaCopySubBuffer( XMesaBuffer b, int x, int y, int width, int height ) if (b->db_mode) { int yTop = b->mesa_buffer.Height - y - height; +#ifdef FX + if (b->FXctx) { + fxMesaSwapBuffers(); + if (b->FXwindowHack) + FXgetImage(b); + else + return; + } +#endif if (b->backxrb->ximage) { /* Copy Ximage from host's memory to server's window */ #if defined(USE_XSHM) && !defined(XFree86Server) diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h index 7b72e6b2f98..98d03ccf62f 100644 --- a/src/mesa/drivers/x11/xmesaP.h +++ b/src/mesa/drivers/x11/xmesaP.h @@ -29,7 +29,10 @@ #include "GL/xmesa.h" #include "mtypes.h" - +#if defined(FX) +#include "GL/fxmesa.h" +#include "../glide/fxdrv.h" +#endif #ifdef XFree86Server #include "xm_image.h" #endif @@ -257,6 +260,13 @@ struct xmesa_buffer { unsigned long alloced_colors[256]; #endif +#if defined( FX ) + /* For 3Dfx Glide only */ + GLboolean FXisHackUsable; /* Can we render into window? */ + GLboolean FXwindowHack; /* Are we rendering into a window? */ + fxMesaContext FXctx; +#endif + struct xmesa_buffer *Next; /* Linked list pointer: */ }; @@ -557,6 +567,13 @@ extern void xmesa_choose_triangle( GLcontext *ctx ); extern void xmesa_register_swrast_functions( GLcontext *ctx ); + +/* XXX this is a hack to implement shared display lists with 3Dfx */ +extern XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v, + XMesaWindow w, + XMesaContext c ); + + #define ENABLE_EXT_texure_compression_s3tc 0 /* SW texture compression */ #ifdef XFree86Server -- cgit v1.2.3 From 6aa5668871e7f366b33e85fabc72885fc269a7d4 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Fri, 20 Apr 2007 17:51:55 +0300 Subject: xmesa: spilt FX code to separate functions. --- src/mesa/drivers/x11/fakeglx.c | 18 ++++++++++++++---- src/mesa/drivers/x11/xm_api.c | 36 ++++++++++++++++-------------------- src/mesa/drivers/x11/xmesaP.h | 7 ++++--- 3 files changed, 34 insertions(+), 27 deletions(-) diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index eecd52aa32b..86a4deabc67 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1440,11 +1440,14 @@ Fake_glXMakeContextCurrent( Display *dpy, GLXDrawable draw, } if (!drawBuffer) { /* drawable must be a new window! */ - drawBuffer = XMesaCreateWindowBuffer2( xmctx->xm_visual, draw, xmctx); + drawBuffer = XMesaCreateWindowBuffer( xmctx->xm_visual, draw ); if (!drawBuffer) { /* Out of memory, or context/drawable depth mismatch */ return False; } +#ifdef FX + FXcreateContext( xmctx->xm_visual, draw, xmctx, drawBuffer ); +#endif } /* Find the XMesaBuffer which corresponds to the GLXDrawable 'read' */ @@ -1457,12 +1460,14 @@ Fake_glXMakeContextCurrent( Display *dpy, GLXDrawable draw, } if (!readBuffer) { /* drawable must be a new window! */ - readBuffer = XMesaCreateWindowBuffer2(glxCtx->xmesaContext->xm_visual, - read, xmctx); + readBuffer = XMesaCreateWindowBuffer( xmctx->xm_visual, read ); if (!readBuffer) { /* Out of memory, or context/drawable depth mismatch */ return False; } +#ifdef FX + FXcreateContext( xmctx->xm_visual, read, xmctx, readBuffer ); +#endif } MakeCurrent_PrevContext = ctx; @@ -2107,10 +2112,15 @@ Fake_glXCreateWindow( Display *dpy, GLXFBConfig config, Window win, if (!xmvis) return 0; - xmbuf = XMesaCreateWindowBuffer2(xmvis, win, NULL); + xmbuf = XMesaCreateWindowBuffer(xmvis, win); if (!xmbuf) return 0; +#ifdef FX + /* XXX this will segfault if actually called */ + FXcreateContext(xmvis, win, NULL, xmbuf); +#endif + (void) dpy; (void) attribList; /* Ignored in GLX 1.3 */ diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 6439d13fa5f..3e65ebd99b5 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1578,17 +1578,13 @@ void XMesaDestroyContext( XMesaContext c ) * X window or pixmap. * \param v the window's XMesaVisual * \param w the window we're wrapping - * \param c context used to initialize the buffer if 3Dfx mode in use. * \return new XMesaBuffer or NULL if error */ -XMesaBuffer -XMesaCreateWindowBuffer2(XMesaVisual v, XMesaWindow w, XMesaContext c) +PUBLIC XMesaBuffer +XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w) { #ifndef XFree86Server XWindowAttributes attr; -#endif -#ifdef FX - char *fxEnvVar; #endif int client = 0; XMesaBuffer b; @@ -1596,7 +1592,6 @@ XMesaCreateWindowBuffer2(XMesaVisual v, XMesaWindow w, XMesaContext c) assert(v); assert(w); - (void) c; /* Check that window depth matches visual depth */ #ifdef XFree86Server @@ -1642,8 +1637,14 @@ XMesaCreateWindowBuffer2(XMesaVisual v, XMesaWindow w, XMesaContext c) return NULL; } + return b; +} + #ifdef FX - fxEnvVar = _mesa_getenv("MESA_GLX_FX"); +void +FXcreateContext(XMesaVisual v, XMesaWindow w, XMesaContext c, XMesaBuffer b) +{ + char *fxEnvVar = _mesa_getenv("MESA_GLX_FX"); if (fxEnvVar) { if (fxEnvVar[0]!='d') { int attribs[100]; @@ -1719,17 +1720,8 @@ XMesaCreateWindowBuffer2(XMesaVisual v, XMesaWindow w, XMesaContext c) _mesa_warning(NULL, " (check the README.3DFX file for more information).\n\n"); _mesa_warning(NULL, " you can disable this message with a 'export MESA_GLX_FX=disable'.\n"); } -#endif - - return b; -} - - -PUBLIC XMesaBuffer -XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w) -{ - return XMesaCreateWindowBuffer2( v, w, NULL ); } +#endif /** @@ -2004,9 +1996,9 @@ GLboolean XMesaCopyContext( XMesaContext xm_src, XMesaContext xm_dst, GLuint mas /* * Switch 3Dfx support hack between window and full-screen mode. */ +#ifdef FX GLboolean XMesaSetFXmode( GLint mode ) { -#ifdef FX const char *fx = _mesa_getenv("MESA_GLX_FX"); if (fx && fx[0] != 'd') { GET_CURRENT_CONTEXT(ctx); @@ -2043,11 +2035,15 @@ GLboolean XMesaSetFXmode( GLint mode ) } } /*fprintf(stderr, "fallthrough\n");*/ + return GL_FALSE; +} #else +GLboolean XMesaSetFXmode( GLint mode ) +{ (void) mode; -#endif return GL_FALSE; } +#endif diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h index 98d03ccf62f..170fc678eb2 100644 --- a/src/mesa/drivers/x11/xmesaP.h +++ b/src/mesa/drivers/x11/xmesaP.h @@ -569,9 +569,10 @@ extern void xmesa_register_swrast_functions( GLcontext *ctx ); /* XXX this is a hack to implement shared display lists with 3Dfx */ -extern XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v, - XMesaWindow w, - XMesaContext c ); +extern void FXcreateContext( XMesaVisual v, + XMesaWindow w, + XMesaContext c, + XMesaBuffer b ); #define ENABLE_EXT_texure_compression_s3tc 0 /* SW texture compression */ -- cgit v1.2.3 From 4d944b502f8a1ae372d9248e888612bffb5eb6a5 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Fri, 20 Apr 2007 18:12:38 +0300 Subject: xmesa: split FX functions to separate file, part 1. --- src/mesa/drivers/x11/xm_api.c | 239 +------------------------------------ src/mesa/drivers/x11/xm_glide.c | 257 ++++++++++++++++++++++++++++++++++++++++ src/mesa/drivers/x11/xm_glide.h | 36 ++++++ src/mesa/drivers/x11/xmesaP.h | 8 +- 4 files changed, 300 insertions(+), 240 deletions(-) create mode 100644 src/mesa/drivers/x11/xm_glide.c create mode 100644 src/mesa/drivers/x11/xm_glide.h diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 3e65ebd99b5..692eb5f8078 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1640,88 +1640,6 @@ XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w) return b; } -#ifdef FX -void -FXcreateContext(XMesaVisual v, XMesaWindow w, XMesaContext c, XMesaBuffer b) -{ - char *fxEnvVar = _mesa_getenv("MESA_GLX_FX"); - if (fxEnvVar) { - if (fxEnvVar[0]!='d') { - int attribs[100]; - int numAttribs = 0; - int hw; - if (v->mesa_visual.depthBits > 0) { - attribs[numAttribs++] = FXMESA_DEPTH_SIZE; - attribs[numAttribs++] = v->mesa_visual.depthBits; - } - if (v->mesa_visual.doubleBufferMode) { - attribs[numAttribs++] = FXMESA_DOUBLEBUFFER; - } - if (v->mesa_visual.accumRedBits > 0) { - attribs[numAttribs++] = FXMESA_ACCUM_SIZE; - attribs[numAttribs++] = v->mesa_visual.accumRedBits; - } - if (v->mesa_visual.stencilBits > 0) { - attribs[numAttribs++] = FXMESA_STENCIL_SIZE; - attribs[numAttribs++] = v->mesa_visual.stencilBits; - } - if (v->mesa_visual.alphaBits > 0) { - attribs[numAttribs++] = FXMESA_ALPHA_SIZE; - attribs[numAttribs++] = v->mesa_visual.alphaBits; - } - if (1) { - attribs[numAttribs++] = FXMESA_SHARE_CONTEXT; - attribs[numAttribs++] = (int) &(c->mesa); - } - attribs[numAttribs++] = FXMESA_NONE; - - /* [dBorca] we should take an envvar for `fxMesaSelectCurrentBoard'!!! */ - hw = fxMesaSelectCurrentBoard(0); - - /* if these fail, there's a new bug somewhere */ - ASSERT(b->mesa_buffer.Width > 0); - ASSERT(b->mesa_buffer.Height > 0); - - if ((hw == GR_SSTTYPE_VOODOO) || (hw == GR_SSTTYPE_Voodoo2)) { - b->FXctx = fxMesaCreateBestContext(0, b->mesa_buffer.Width, - b->mesa_buffer.Height, attribs); - if ((v->undithered_pf!=PF_Index) && (b->backxrb->ximage)) { - b->FXisHackUsable = b->FXctx ? GL_TRUE : GL_FALSE; - if (b->FXctx && (fxEnvVar[0]=='w' || fxEnvVar[0]=='W')) { - b->FXwindowHack = GL_TRUE; - FX_grSstControl(GR_CONTROL_DEACTIVATE); - } - else { - b->FXwindowHack = GL_FALSE; - } - } - } - else { - if (fxEnvVar[0]=='w' || fxEnvVar[0]=='W') - b->FXctx = fxMesaCreateContext(w, GR_RESOLUTION_NONE, - GR_REFRESH_75Hz, attribs); - else - b->FXctx = fxMesaCreateBestContext(0, b->mesa_buffer.Width, - b->mesa_buffer.Height, attribs); - b->FXisHackUsable = GL_FALSE; - b->FXwindowHack = GL_FALSE; - } - /* - fprintf(stderr, - "voodoo %d, wid %d height %d hack: usable %d active %d\n", - hw, b->mesa_buffer.Width, b->mesa_buffer.Height, - b->FXisHackUsable, b->FXwindowHack); - */ - } - } - else { - _mesa_warning(NULL, "WARNING: This Mesa Library includes the Glide driver but\n"); - _mesa_warning(NULL, " you have not defined the MESA_GLX_FX env. var.\n"); - _mesa_warning(NULL, " (check the README.3DFX file for more information).\n\n"); - _mesa_warning(NULL, " you can disable this message with a 'export MESA_GLX_FX=disable'.\n"); - } -} -#endif /** @@ -1993,51 +1911,7 @@ GLboolean XMesaCopyContext( XMesaContext xm_src, XMesaContext xm_dst, GLuint mas #endif /* XFree86Server */ -/* - * Switch 3Dfx support hack between window and full-screen mode. - */ -#ifdef FX -GLboolean XMesaSetFXmode( GLint mode ) -{ - const char *fx = _mesa_getenv("MESA_GLX_FX"); - if (fx && fx[0] != 'd') { - GET_CURRENT_CONTEXT(ctx); - GrHwConfiguration hw; - if (!FX_grSstQueryHardware(&hw)) { - /*fprintf(stderr, "!grSstQueryHardware\n");*/ - return GL_FALSE; - } - if (hw.num_sst < 1) { - /*fprintf(stderr, "hw.num_sst < 1\n");*/ - return GL_FALSE; - } - if (ctx) { - /* [dBorca] Hack alert: - * oh, this is sooo wrong: ctx above is - * really an fxMesaContext, not an XMesaContext - */ - XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer); - if (mode == XMESA_FX_WINDOW) { - if (xmbuf->FXisHackUsable) { - FX_grSstControl(GR_CONTROL_DEACTIVATE); - xmbuf->FXwindowHack = GL_TRUE; - return GL_TRUE; - } - } - else if (mode == XMESA_FX_FULLSCREEN) { - FX_grSstControl(GR_CONTROL_ACTIVATE); - xmbuf->FXwindowHack = GL_FALSE; - return GL_TRUE; - } - else { - /* Error: Bad mode value */ - } - } - } - /*fprintf(stderr, "fallthrough\n");*/ - return GL_FALSE; -} -#else +#ifndef FX GLboolean XMesaSetFXmode( GLint mode ) { (void) mode; @@ -2047,96 +1921,6 @@ GLboolean XMesaSetFXmode( GLint mode ) -#ifdef FX -/* - * Read image from VooDoo frame buffer into X/Mesa's back XImage. - */ -static void FXgetImage( XMesaBuffer b ) -{ - GET_CURRENT_CONTEXT(ctx); - static unsigned short pixbuf[MAX_WIDTH]; - GLuint x, y; - GLuint width, height; - XMesaContext xmesa = XMESA_CONTEXT(ctx); - -#ifdef XFree86Server - x = b->frontxrb->pixmap->x; - y = b->frontxrb->pixmap->y; - width = b->frontxrb->pixmap->width; - height = b->frontxrb->pixmap->height; - depth = b->frontxrb->pixmap->depth; -#else - xmesa_get_window_size(b->display, b, &width, &height); - x = y = 0; -#endif - if (b->mesa_buffer.Width != width || b->mesa_buffer.Height != height) { - b->mesa_buffer.Width = MIN2((int)width, b->FXctx->width); - b->mesa_buffer.Height = MIN2((int)height, b->FXctx->height); - if (b->mesa_buffer.Width & 1) - b->mesa_buffer.Width--; /* prevent odd width */ - } - - /* [dBorca] we're always in the right GR_COLORFORMAT... aren't we? */ - /* grLfbWriteColorFormat(GR_COLORFORMAT_ARGB); */ - if (b->xm_visual->undithered_pf==PF_5R6G5B) { - /* Special case: 16bpp RGB */ - grLfbReadRegion( GR_BUFFER_FRONTBUFFER, /* src buffer */ - 0, b->FXctx->height - b->mesa_buffer.Height, /*pos*/ - b->mesa_buffer.Width, b->mesa_buffer.Height, /* size */ - b->mesa_buffer.Width * sizeof(GLushort), /* stride */ - b->backxrb->ximage->data); /* dest buffer */ - } - else if (b->xm_visual->dithered_pf==PF_Dither - && GET_VISUAL_DEPTH(b->xm_visual)==8) { - /* Special case: 8bpp RGB */ - for (y=0;ymesa_buffer.Height;y++) { - GLubyte *ptr = (GLubyte*) b->backxrb->ximage->data - + b->backxrb->ximage->bytes_per_line * y; - XDITHER_SETUP(y); - - /* read row from 3Dfx frame buffer */ - grLfbReadRegion( GR_BUFFER_FRONTBUFFER, - 0, b->FXctx->height-(b->mesa_buffer.Height-y), - b->mesa_buffer.Width, 1, - 0, - pixbuf ); - - /* write to XImage back buffer */ - for (x=0;xmesa_buffer.Width;x++) { - GLubyte r = (pixbuf[x] & 0xf800) >> 8; - GLubyte g = (pixbuf[x] & 0x07e0) >> 3; - GLubyte b = (pixbuf[x] & 0x001f) << 3; - *ptr++ = XDITHER( x, r, g, b); - } - } - } - else { - /* General case: slow! */ - for (y=0;ymesa_buffer.Height;y++) { - /* read row from 3Dfx frame buffer */ - grLfbReadRegion( GR_BUFFER_FRONTBUFFER, - 0, b->FXctx->height-(b->mesa_buffer.Height-y), - b->mesa_buffer.Width, 1, - 0, - pixbuf ); - - /* write to XImage back buffer */ - for (x=0;xmesa_buffer.Width;x++) { - XMesaPutPixel(b->backxrb->ximage,x,y, - xmesa_color_to_pixel(ctx, - (pixbuf[x] & 0xf800) >> 8, - (pixbuf[x] & 0x07e0) >> 3, - (pixbuf[x] & 0x001f) << 3, - 0xff, - b->xm_visual->undithered_pf)); - } - } - } - /* grLfbWriteColorFormat(GR_COLORFORMAT_ABGR); */ -} -#endif - - /* * Copy the back buffer to the front buffer. If there's no back buffer * this is a no-op. @@ -2159,16 +1943,10 @@ void XMesaSwapBuffers( XMesaBuffer b ) if (b->db_mode) { #ifdef FX - if (b->FXctx) { - fxMesaSwapBuffers(); - - if (b->FXwindowHack) - FXgetImage(b); - else - return; - } + if (FXswapBuffers(b)) + return; #endif - if (b->backxrb->ximage) { + if (b->backxrb->ximage) { /* Copy Ximage (back buf) from client memory to server window */ #if defined(USE_XSHM) && !defined(XFree86Server) if (b->shm) { @@ -2235,13 +2013,8 @@ void XMesaCopySubBuffer( XMesaBuffer b, int x, int y, int width, int height ) if (b->db_mode) { int yTop = b->mesa_buffer.Height - y - height; #ifdef FX - if (b->FXctx) { - fxMesaSwapBuffers(); - if (b->FXwindowHack) - FXgetImage(b); - else - return; - } + if (FXswapBuffers(b)) + return; #endif if (b->backxrb->ximage) { /* Copy Ximage from host's memory to server's window */ diff --git a/src/mesa/drivers/x11/xm_glide.c b/src/mesa/drivers/x11/xm_glide.c new file mode 100644 index 00000000000..37787a7922b --- /dev/null +++ b/src/mesa/drivers/x11/xm_glide.c @@ -0,0 +1,257 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5 + * + * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +#include "glxheader.h" +#include "xmesaP.h" + +#ifdef FX +void +FXcreateContext(XMesaVisual v, XMesaWindow w, XMesaContext c, XMesaBuffer b) +{ + char *fxEnvVar = _mesa_getenv("MESA_GLX_FX"); + if (fxEnvVar) { + if (fxEnvVar[0]!='d') { + int attribs[100]; + int numAttribs = 0; + int hw; + if (v->mesa_visual.depthBits > 0) { + attribs[numAttribs++] = FXMESA_DEPTH_SIZE; + attribs[numAttribs++] = v->mesa_visual.depthBits; + } + if (v->mesa_visual.doubleBufferMode) { + attribs[numAttribs++] = FXMESA_DOUBLEBUFFER; + } + if (v->mesa_visual.accumRedBits > 0) { + attribs[numAttribs++] = FXMESA_ACCUM_SIZE; + attribs[numAttribs++] = v->mesa_visual.accumRedBits; + } + if (v->mesa_visual.stencilBits > 0) { + attribs[numAttribs++] = FXMESA_STENCIL_SIZE; + attribs[numAttribs++] = v->mesa_visual.stencilBits; + } + if (v->mesa_visual.alphaBits > 0) { + attribs[numAttribs++] = FXMESA_ALPHA_SIZE; + attribs[numAttribs++] = v->mesa_visual.alphaBits; + } + if (1) { + attribs[numAttribs++] = FXMESA_SHARE_CONTEXT; + attribs[numAttribs++] = (int) &(c->mesa); + } + attribs[numAttribs++] = FXMESA_NONE; + + /* [dBorca] we should take an envvar for `fxMesaSelectCurrentBoard'!!! */ + hw = fxMesaSelectCurrentBoard(0); + + /* if these fail, there's a new bug somewhere */ + ASSERT(b->mesa_buffer.Width > 0); + ASSERT(b->mesa_buffer.Height > 0); + + if ((hw == GR_SSTTYPE_VOODOO) || (hw == GR_SSTTYPE_Voodoo2)) { + b->FXctx = fxMesaCreateBestContext(0, b->mesa_buffer.Width, + b->mesa_buffer.Height, attribs); + if ((v->undithered_pf!=PF_Index) && (b->backxrb->ximage)) { + b->FXisHackUsable = b->FXctx ? GL_TRUE : GL_FALSE; + if (b->FXctx && (fxEnvVar[0]=='w' || fxEnvVar[0]=='W')) { + b->FXwindowHack = GL_TRUE; + FX_grSstControl(GR_CONTROL_DEACTIVATE); + } + else { + b->FXwindowHack = GL_FALSE; + } + } + } + else { + if (fxEnvVar[0]=='w' || fxEnvVar[0]=='W') + b->FXctx = fxMesaCreateContext(w, GR_RESOLUTION_NONE, + GR_REFRESH_75Hz, attribs); + else + b->FXctx = fxMesaCreateBestContext(0, b->mesa_buffer.Width, + b->mesa_buffer.Height, attribs); + b->FXisHackUsable = GL_FALSE; + b->FXwindowHack = GL_FALSE; + } + /* + fprintf(stderr, + "voodoo %d, wid %d height %d hack: usable %d active %d\n", + hw, b->mesa_buffer.Width, b->mesa_buffer.Height, + b->FXisHackUsable, b->FXwindowHack); + */ + } + } + else { + _mesa_warning(NULL, "WARNING: This Mesa Library includes the Glide driver but\n"); + _mesa_warning(NULL, " you have not defined the MESA_GLX_FX env. var.\n"); + _mesa_warning(NULL, " (check the README.3DFX file for more information).\n\n"); + _mesa_warning(NULL, " you can disable this message with a 'export MESA_GLX_FX=disable'.\n"); + } +} + + +/* + * Read image from VooDoo frame buffer into X/Mesa's back XImage. + */ +static void FXgetImage( XMesaBuffer b ) +{ + GET_CURRENT_CONTEXT(ctx); + static unsigned short pixbuf[MAX_WIDTH]; + GLuint x, y; + GLuint width, height; + XMesaContext xmesa = XMESA_CONTEXT(ctx); + +#ifdef XFree86Server + x = b->frontxrb->pixmap->x; + y = b->frontxrb->pixmap->y; + width = b->frontxrb->pixmap->width; + height = b->frontxrb->pixmap->height; + depth = b->frontxrb->pixmap->depth; +#else + xmesa_get_window_size(b->display, b, &width, &height); + x = y = 0; +#endif + if (b->mesa_buffer.Width != width || b->mesa_buffer.Height != height) { + b->mesa_buffer.Width = MIN2((int)width, b->FXctx->width); + b->mesa_buffer.Height = MIN2((int)height, b->FXctx->height); + if (b->mesa_buffer.Width & 1) + b->mesa_buffer.Width--; /* prevent odd width */ + } + + /* [dBorca] we're always in the right GR_COLORFORMAT... aren't we? */ + /* grLfbWriteColorFormat(GR_COLORFORMAT_ARGB); */ + if (b->xm_visual->undithered_pf==PF_5R6G5B) { + /* Special case: 16bpp RGB */ + grLfbReadRegion( GR_BUFFER_FRONTBUFFER, /* src buffer */ + 0, b->FXctx->height - b->mesa_buffer.Height, /*pos*/ + b->mesa_buffer.Width, b->mesa_buffer.Height, /* size */ + b->mesa_buffer.Width * sizeof(GLushort), /* stride */ + b->backxrb->ximage->data); /* dest buffer */ + } + else if (b->xm_visual->dithered_pf==PF_Dither + && GET_VISUAL_DEPTH(b->xm_visual)==8) { + /* Special case: 8bpp RGB */ + for (y=0;ymesa_buffer.Height;y++) { + GLubyte *ptr = (GLubyte*) b->backxrb->ximage->data + + b->backxrb->ximage->bytes_per_line * y; + XDITHER_SETUP(y); + + /* read row from 3Dfx frame buffer */ + grLfbReadRegion( GR_BUFFER_FRONTBUFFER, + 0, b->FXctx->height-(b->mesa_buffer.Height-y), + b->mesa_buffer.Width, 1, + 0, + pixbuf ); + + /* write to XImage back buffer */ + for (x=0;xmesa_buffer.Width;x++) { + GLubyte r = (pixbuf[x] & 0xf800) >> 8; + GLubyte g = (pixbuf[x] & 0x07e0) >> 3; + GLubyte b = (pixbuf[x] & 0x001f) << 3; + *ptr++ = XDITHER( x, r, g, b); + } + } + } + else { + /* General case: slow! */ + for (y=0;ymesa_buffer.Height;y++) { + /* read row from 3Dfx frame buffer */ + grLfbReadRegion( GR_BUFFER_FRONTBUFFER, + 0, b->FXctx->height-(b->mesa_buffer.Height-y), + b->mesa_buffer.Width, 1, + 0, + pixbuf ); + + /* write to XImage back buffer */ + for (x=0;xmesa_buffer.Width;x++) { + XMesaPutPixel(b->backxrb->ximage,x,y, + xmesa_color_to_pixel(ctx, + (pixbuf[x] & 0xf800) >> 8, + (pixbuf[x] & 0x07e0) >> 3, + (pixbuf[x] & 0x001f) << 3, + 0xff, + b->xm_visual->undithered_pf)); + } + } + } + /* grLfbWriteColorFormat(GR_COLORFORMAT_ABGR); */ +} + + +GLboolean FXswapBuffers( XMesaBuffer b ) +{ + if (b->FXctx) { + fxMesaSwapBuffers(); + + if (!b->FXwindowHack) + return GL_TRUE; + + FXgetImage(b); + } + return GL_FALSE; +} + + +/* + * Switch 3Dfx support hack between window and full-screen mode. + */ +GLboolean XMesaSetFXmode( GLint mode ) +{ + const char *fx = _mesa_getenv("MESA_GLX_FX"); + if (fx && fx[0] != 'd') { + GET_CURRENT_CONTEXT(ctx); + GrHwConfiguration hw; + if (!FX_grSstQueryHardware(&hw)) { + /*fprintf(stderr, "!grSstQueryHardware\n");*/ + return GL_FALSE; + } + if (hw.num_sst < 1) { + /*fprintf(stderr, "hw.num_sst < 1\n");*/ + return GL_FALSE; + } + if (ctx) { + /* [dBorca] Hack alert: + * oh, this is sooo wrong: ctx above is + * really an fxMesaContext, not an XMesaContext + */ + XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer); + if (mode == XMESA_FX_WINDOW) { + if (xmbuf->FXisHackUsable) { + FX_grSstControl(GR_CONTROL_DEACTIVATE); + xmbuf->FXwindowHack = GL_TRUE; + return GL_TRUE; + } + } + else if (mode == XMESA_FX_FULLSCREEN) { + FX_grSstControl(GR_CONTROL_ACTIVATE); + xmbuf->FXwindowHack = GL_FALSE; + return GL_TRUE; + } + else { + /* Error: Bad mode value */ + } + } + } + /*fprintf(stderr, "fallthrough\n");*/ + return GL_FALSE; +} +#endif diff --git a/src/mesa/drivers/x11/xm_glide.h b/src/mesa/drivers/x11/xm_glide.h new file mode 100644 index 00000000000..7458c57415a --- /dev/null +++ b/src/mesa/drivers/x11/xm_glide.h @@ -0,0 +1,36 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5 + * + * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +#ifndef _XM_GLIDE_H_ +#define _XM_GLIDE_H_ + +extern void FXcreateContext( XMesaVisual v, + XMesaWindow w, + XMesaContext c, + XMesaBuffer b ); + +extern GLboolean FXswapBuffers( XMesaBuffer b ); + +#endif /* _XM_GLIDE_H_ */ diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h index 170fc678eb2..cae5c0d9bc5 100644 --- a/src/mesa/drivers/x11/xmesaP.h +++ b/src/mesa/drivers/x11/xmesaP.h @@ -32,6 +32,7 @@ #if defined(FX) #include "GL/fxmesa.h" #include "../glide/fxdrv.h" +#include "xm_glide.h" #endif #ifdef XFree86Server #include "xm_image.h" @@ -568,13 +569,6 @@ extern void xmesa_register_swrast_functions( GLcontext *ctx ); -/* XXX this is a hack to implement shared display lists with 3Dfx */ -extern void FXcreateContext( XMesaVisual v, - XMesaWindow w, - XMesaContext c, - XMesaBuffer b ); - - #define ENABLE_EXT_texure_compression_s3tc 0 /* SW texture compression */ #ifdef XFree86Server -- cgit v1.2.3 From 6346a753c6e77373cffcec6dd0df253efd159dd4 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Fri, 20 Apr 2007 18:25:42 +0300 Subject: xmesa: split FX functions to separate file, part 2. --- src/mesa/drivers/x11/xm_api.c | 21 ++++++++------------- src/mesa/drivers/x11/xm_glide.c | 21 ++++++++++++++++++++- src/mesa/drivers/x11/xm_glide.h | 4 ++++ src/mesa/drivers/x11/xmesaP.h | 1 - 4 files changed, 32 insertions(+), 15 deletions(-) diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 692eb5f8078..5e2327a2d3b 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1557,12 +1557,11 @@ PUBLIC void XMesaDestroyContext( XMesaContext c ) { GLcontext *mesaCtx = &c->mesa; -#ifdef FX - XMesaBuffer xmbuf = XMESA_BUFFER(mesaCtx->DrawBuffer); - if (xmbuf && xmbuf->FXctx) - fxMesaDestroyContext(xmbuf->FXctx); +#ifdef FX + FXdestroyContext( XMESA_BUFFER(mesaCtx->DrawBuffer) ); #endif + _swsetup_DestroyContext( mesaCtx ); _swrast_DestroyContext( mesaCtx ); _tnl_DestroyContext( mesaCtx ); @@ -1767,15 +1766,6 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer, if (!drawBuffer || !readBuffer) return GL_FALSE; /* must specify buffers! */ -#ifdef FX - if (drawBuffer->FXctx) { - fxMesaMakeCurrent(drawBuffer->FXctx); - - c->xm_buffer = drawBuffer; - - return GL_TRUE; - } -#endif if (&(c->mesa) == _mesa_get_current_context() && c->mesa.DrawBuffer == &drawBuffer->mesa_buffer && c->mesa.ReadBuffer == &readBuffer->mesa_buffer @@ -1786,6 +1776,11 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer, c->xm_buffer = drawBuffer; +#ifdef FX + if (FXmakeCurrent( drawBuffer )) + return GL_TRUE; +#endif + /* Call this periodically to detect when the user has begun using * GL rendering from multiple threads. */ diff --git a/src/mesa/drivers/x11/xm_glide.c b/src/mesa/drivers/x11/xm_glide.c index 37787a7922b..ae4f4282dbb 100644 --- a/src/mesa/drivers/x11/xm_glide.c +++ b/src/mesa/drivers/x11/xm_glide.c @@ -27,6 +27,8 @@ #include "xmesaP.h" #ifdef FX +#include "../glide/fxdrv.h" + void FXcreateContext(XMesaVisual v, XMesaWindow w, XMesaContext c, XMesaBuffer b) { @@ -109,6 +111,24 @@ FXcreateContext(XMesaVisual v, XMesaWindow w, XMesaContext c, XMesaBuffer b) } +void FXdestroyContext( XMesaBuffer b ) +{ + if (b && b->FXctx) + fxMesaDestroyContext(b->FXctx); +} + + +GLboolean FXmakeCurrent( XMesaBuffer b ) +{ + if (b->FXctx) { + fxMesaMakeCurrent(b->FXctx); + + return GL_TRUE; + } + return GL_FALSE; +} + + /* * Read image from VooDoo frame buffer into X/Mesa's back XImage. */ @@ -118,7 +138,6 @@ static void FXgetImage( XMesaBuffer b ) static unsigned short pixbuf[MAX_WIDTH]; GLuint x, y; GLuint width, height; - XMesaContext xmesa = XMESA_CONTEXT(ctx); #ifdef XFree86Server x = b->frontxrb->pixmap->x; diff --git a/src/mesa/drivers/x11/xm_glide.h b/src/mesa/drivers/x11/xm_glide.h index 7458c57415a..f7d0316524d 100644 --- a/src/mesa/drivers/x11/xm_glide.h +++ b/src/mesa/drivers/x11/xm_glide.h @@ -31,6 +31,10 @@ extern void FXcreateContext( XMesaVisual v, XMesaContext c, XMesaBuffer b ); +extern void FXdestroyContext( XMesaBuffer b ); + +extern GLboolean FXmakeCurrent( XMesaBuffer b ); + extern GLboolean FXswapBuffers( XMesaBuffer b ); #endif /* _XM_GLIDE_H_ */ diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h index cae5c0d9bc5..01988867476 100644 --- a/src/mesa/drivers/x11/xmesaP.h +++ b/src/mesa/drivers/x11/xmesaP.h @@ -31,7 +31,6 @@ #include "mtypes.h" #if defined(FX) #include "GL/fxmesa.h" -#include "../glide/fxdrv.h" #include "xm_glide.h" #endif #ifdef XFree86Server -- cgit v1.2.3 From e4e2068ac9d21ce50e863ccf3171462ab61c3ec8 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Wed, 18 Apr 2007 23:44:01 +0300 Subject: xmesa: minor cosmetic mainly drop 'client' argument from initialize_visual_and_buffer(). --- src/mesa/drivers/x11/xm_api.c | 54 ++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 29 deletions(-) diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 5e2327a2d3b..212f7b576e0 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1036,10 +1036,16 @@ setup_monochrome( XMesaVisual v, XMesaBuffer b ) * \return GL_TRUE=success, GL_FALSE=failure */ static GLboolean -initialize_visual_and_buffer(int client, XMesaVisual v, XMesaBuffer b, +initialize_visual_and_buffer(XMesaVisual v, XMesaBuffer b, GLboolean rgb_flag, XMesaDrawable window, XMesaColormap cmap) { + int client = 0; + +#ifdef XFree86Server + client = (window) ? CLIENT_ID(window->id) : 0; +#endif + ASSERT(!b || b->xm_visual == v); /* Save true bits/pixel */ @@ -1103,6 +1109,8 @@ initialize_visual_and_buffer(int client, XMesaVisual v, XMesaBuffer b, } if (b && window) { + char *data; + /* Do window-specific initializations */ /* these should have been set in create_xmesa_buffer */ @@ -1170,15 +1178,15 @@ initialize_visual_and_buffer(int client, XMesaVisual v, XMesaBuffer b, } /* Initialize the row buffer XImage for use in write_color_span() */ + data = (char*) MALLOC(MAX_WIDTH*4); #ifdef XFree86Server - b->rowimage = XMesaCreateImage(GET_VISUAL_DEPTH(v), MAX_WIDTH, 1, - (char *)MALLOC(MAX_WIDTH*4)); + b->rowimage = XMesaCreateImage(GET_VISUAL_DEPTH(v), MAX_WIDTH, 1, data); #else b->rowimage = XCreateImage( v->display, v->visinfo->visual, v->visinfo->depth, ZPixmap, 0, /*format, offset*/ - (char*) MALLOC(MAX_WIDTH*4), /*data*/ + data, /*data*/ MAX_WIDTH, 1, /*width, height*/ 32, /*bitmap_pad*/ 0 /*bytes_per_line*/ ); @@ -1410,7 +1418,7 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display, if (alpha_flag) v->mesa_visual.alphaBits = 8; - (void) initialize_visual_and_buffer( 0, v, NULL, rgb_flag, 0, 0 ); + (void) initialize_visual_and_buffer( v, NULL, rgb_flag, 0, 0 ); { const int xclass = v->mesa_visual.visualType; @@ -1585,31 +1593,25 @@ XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w) #ifndef XFree86Server XWindowAttributes attr; #endif - int client = 0; XMesaBuffer b; XMesaColormap cmap; + int depth; assert(v); assert(w); /* Check that window depth matches visual depth */ #ifdef XFree86Server - client = CLIENT_ID(((XMesaDrawable)w)->id); - - if (GET_VISUAL_DEPTH(v) != ((XMesaDrawable)w)->depth) { - _mesa_warning(NULL, "XMesaCreateWindowBuffer: depth mismatch between visual (%d) and window (%d)!\n", - GET_VISUAL_DEPTH(v), ((XMesaDrawable) w)->depth); - return NULL; - } + depth = ((XMesaDrawable)w)->depth; #else XGetWindowAttributes( v->display, w, &attr ); - - if (GET_VISUAL_DEPTH(v) != attr.depth) { + depth = attr.depth; +#endif + if (GET_VISUAL_DEPTH(v) != depth) { _mesa_warning(NULL, "XMesaCreateWindowBuffer: depth mismatch between visual (%d) and window (%d)!\n", - GET_VISUAL_DEPTH(v), attr.depth); + GET_VISUAL_DEPTH(v), depth); return NULL; } -#endif /* Find colormap */ #ifdef XFree86Server @@ -1630,7 +1632,7 @@ XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w) if (!b) return NULL; - if (!initialize_visual_and_buffer( client, v, b, v->mesa_visual.rgbMode, + if (!initialize_visual_and_buffer( v, b, v->mesa_visual.rgbMode, (XMesaDrawable) w, cmap )) { xmesa_free_buffer(b); return NULL; @@ -1653,7 +1655,6 @@ XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w) PUBLIC XMesaBuffer XMesaCreatePixmapBuffer(XMesaVisual v, XMesaPixmap p, XMesaColormap cmap) { - int client = 0; XMesaBuffer b; assert(v); @@ -1662,11 +1663,7 @@ XMesaCreatePixmapBuffer(XMesaVisual v, XMesaPixmap p, XMesaColormap cmap) if (!b) return NULL; -#ifdef XFree86Server - client = CLIENT_ID(((XMesaDrawable)p)->id); -#endif - - if (!initialize_visual_and_buffer(client, v, b, v->mesa_visual.rgbMode, + if (!initialize_visual_and_buffer(v, b, v->mesa_visual.rgbMode, (XMesaDrawable) p, cmap)) { xmesa_free_buffer(b); return NULL; @@ -1681,10 +1678,7 @@ XMesaBuffer XMesaCreatePBuffer(XMesaVisual v, XMesaColormap cmap, unsigned int width, unsigned int height) { -#ifdef XFree86Server - return 0; -#else - int client = 0; +#ifndef XFree86Server XMesaWindow root; XMesaDrawable drawable; /* X Pixmap Drawable */ XMesaBuffer b; @@ -1700,13 +1694,15 @@ XMesaCreatePBuffer(XMesaVisual v, XMesaColormap cmap, if (!b) return NULL; - if (!initialize_visual_and_buffer(client, v, b, v->mesa_visual.rgbMode, + if (!initialize_visual_and_buffer(v, b, v->mesa_visual.rgbMode, drawable, cmap)) { xmesa_free_buffer(b); return NULL; } return b; +#else + return 0; #endif } -- cgit v1.2.3 From 5491c8194c03761a1a45a17539db6bc241bacf9c Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Fri, 20 Apr 2007 18:51:20 +0300 Subject: xmesa: call _glapi_set_dispatch() for all xserver DDXes. This is to unify the xmesa code across xserver DDX'es. The call is intented for XGL, but it does not hurt to call for other DDX'es. In fact it was not guarded against XGL when it was first added in xserver. --- src/mesa/drivers/x11/xm_api.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 212f7b576e0..a07d0a90cf3 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1869,9 +1869,7 @@ PUBLIC GLboolean XMesaForceCurrent(XMesaContext c) { if (c) { -#ifdef XGLServer _glapi_set_dispatch(c->mesa.CurrentDispatch); -#endif if (&(c->mesa) != _mesa_get_current_context()) { _mesa_make_current(&c->mesa, c->mesa.DrawBuffer, c->mesa.ReadBuffer); -- cgit v1.2.3 From 720cf3aa134ea5b8603aa692777af713864b9b66 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 20 Apr 2007 18:55:13 -0600 Subject: added new xm_glide.c file --- src/mesa/sources | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/sources b/src/mesa/sources index bdb056f11ec..6a6d594e4bd 100644 --- a/src/mesa/sources +++ b/src/mesa/sources @@ -246,6 +246,7 @@ X11_DRIVER_SOURCES = \ drivers/x11/xm_api.c \ drivers/x11/xm_buffer.c \ drivers/x11/xm_dd.c \ + drivers/x11/xm_glide.c \ drivers/x11/xm_line.c \ drivers/x11/xm_span.c \ drivers/x11/xm_tri.c -- cgit v1.2.3 From 7fd3a6c5219393d77a8e0431d2b49d15f5304c3a Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 20 Apr 2007 19:01:21 -0600 Subject: Long obsolete. --- src/mesa/main/KNOWN_BUGS | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 src/mesa/main/KNOWN_BUGS diff --git a/src/mesa/main/KNOWN_BUGS b/src/mesa/main/KNOWN_BUGS deleted file mode 100644 index efbb0ca40fc..00000000000 --- a/src/mesa/main/KNOWN_BUGS +++ /dev/null @@ -1,21 +0,0 @@ - - -Performance issues with EXT_point_parameters & quake2 - - - -Using glPolygonMode() where the front and back modes aren't the -same causes poor performance on 3Dfx. - - - -Broken drivers: some of the Mesa device drivers (such as BeOS, D3D, -etc) haven't been updated for Mesa 3.3's device driver changes. - - - -glDrawRangeElements() should use vertex array locking to improve performance -but trying to do so causes a rendering error. Reported by Scott McMillan. -Fixed by disabling locking in glDrawRangeElements (varray.c) but that's -really just hiding a bug in array locking. - -- cgit v1.2.3 From e7e5279fc06da96c7018855b5933b144caee24ab Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 20 Apr 2007 19:18:13 -0600 Subject: Remove unused Imakefiles. --- progs/redbook/Imakefile | 221 ------------------------------------------------ progs/samples/Imakefile | 101 ---------------------- src/mesa/main/Imakefile | 129 ---------------------------- 3 files changed, 451 deletions(-) delete mode 100644 progs/redbook/Imakefile delete mode 100644 progs/samples/Imakefile delete mode 100644 src/mesa/main/Imakefile diff --git a/progs/redbook/Imakefile b/progs/redbook/Imakefile deleted file mode 100644 index ab3b6d7f793..00000000000 --- a/progs/redbook/Imakefile +++ /dev/null @@ -1,221 +0,0 @@ -LOCAL_LIBRARIES = $(XLIB) $(TOP)\lib\Mesaaux.a $(TOP)\lib\Mesaglu.a $(TOP)\lib\MesaGL.a - -INCLUDES = -I$(TOP)\include - -SRCS = accanti.c \ - accnot.c \ - accpersp.c \ - accum.c \ - aim.c \ - alpha.c \ - alpha3D.c \ - anti.c \ - antiindex.c \ - antipindex.c \ - antipoint.c \ - antipoly.c \ - bezcurve.c \ - bezmesh.c \ - bezsurf.c \ - checker.c \ - checker2.c \ - chess.c \ - clip.c \ - colormat.c \ - cone.c \ - cube.c \ - curve.c \ - depthcue.c \ - disk.c \ - dof.c \ - dofnot.c \ - double.c \ - drawf.c \ - feedback.c \ - fog.c \ - fogindex.c \ - font.c \ - light.c \ - linelist.c \ - lines.c \ - list.c \ - list2.c \ - maplight.c \ - material.c \ - mipmap.c \ - model.c \ - movelight.c \ - nurbs.c \ - pickdepth.c \ - pickline.c \ - picksquare.c \ - plane.c \ - planet.c \ - planetup.c \ - polys.c \ - robot.c \ - sccolorlight.c \ - scene.c \ - scenebamb.c \ - sceneflat.c \ - select.c \ - simple.c \ - smooth.c \ - sphere.c \ - stencil.c \ - stroke.c \ - surface.c \ - tea.c \ - teaambient.c \ - teapots.c \ - texgen.c \ - texturesurf.c \ - trim.c \ - xfont.c - -PROGRAMS = ProgramTargetName(accanti) \ - ProgramTargetName(accnot) \ - ProgramTargetName(accpersp) \ - ProgramTargetName(accum) \ - ProgramTargetName(aim) \ - ProgramTargetName(alpha) \ - ProgramTargetName(alpha3D) \ - ProgramTargetName(anti) \ - ProgramTargetName(antiindex) \ - ProgramTargetName(antipindex) \ - ProgramTargetName(antipoint) \ - ProgramTargetName(antipoly) \ - ProgramTargetName(bezcurve) \ - ProgramTargetName(bezmesh) \ - ProgramTargetName(bezsurf) \ - ProgramTargetName(checker) \ - ProgramTargetName(checker2) \ - ProgramTargetName(chess) \ - ProgramTargetName(clip) \ - ProgramTargetName(colormat) \ - ProgramTargetName(cone) \ - ProgramTargetName(cube) \ - ProgramTargetName(curve) \ - ProgramTargetName(depthcue) \ - ProgramTargetName(disk) \ - ProgramTargetName(dof) \ - ProgramTargetName(dofnot) \ - ProgramTargetName(double) \ - ProgramTargetName(drawf) \ - ProgramTargetName(feedback) \ - ProgramTargetName(fog) \ - ProgramTargetName(fogindex) \ - ProgramTargetName(font) \ - ProgramTargetName(light) \ - ProgramTargetName(linelist) \ - ProgramTargetName(lines) \ - ProgramTargetName(list) \ - ProgramTargetName(list2) \ - ProgramTargetName(maplight) \ - ProgramTargetName(material) \ - ProgramTargetName(mipmap) \ - ProgramTargetName(model) \ - ProgramTargetName(movelight) \ - ProgramTargetName(nurbs) \ - ProgramTargetName(pickdepth) \ - ProgramTargetName(pickline) \ - ProgramTargetName(picksquare) \ - ProgramTargetName(plane) \ - ProgramTargetName(planet) \ - ProgramTargetName(planetup) \ - ProgramTargetName(polys) \ - ProgramTargetName(robot) \ - ProgramTargetName(sccolorlight) \ - ProgramTargetName(scene) \ - ProgramTargetName(scenebamb) \ - ProgramTargetName(sceneflat) \ - ProgramTargetName(select) \ - ProgramTargetName(simple) \ - ProgramTargetName(smooth) \ - ProgramTargetName(sphere) \ - ProgramTargetName(stencil) \ - ProgramTargetName(stroke) \ - ProgramTargetName(surface) \ - ProgramTargetName(tea) \ - ProgramTargetName(teaambient) \ - ProgramTargetName(teapots) \ - ProgramTargetName(texgen) \ - ProgramTargetName(texturesurf) \ - ProgramTargetName(trim) \ - ProgramTargetName(xfont) - -AllTarget($(PROGRAMS)) - -NormalProgramTarget(accanti,accanti.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(accnot,accnot.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(accpersp,accpersp.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(accum,accum.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(aim,aim.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(alpha,alpha.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(alpha3D,alpha3D.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(anti,anti.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(antiindex,antiindex.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(antipindex,antipindex.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(antipoint,antipoint.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(antipoly,antipoly.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(bezcurve,bezcurve.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(bezmesh,bezmesh.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(bezsurf,bezsurf.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(checker,checker.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(checker2,checker2.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(chess,chess.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(clip,clip.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(colormat,colormat.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(cone,cone.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(cube,cube.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(curve,curve.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(depthcue,depthcue.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(disk,disk.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(dof,dof.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(dofnot,dofnot.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(double,double.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(drawf,drawf.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(feedback,feedback.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(fog,fog.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(fogindex,fogindex.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(font,font.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(light,light.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(linelist,linelist.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(lines,lines.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(list,list.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(list2,list2.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(maplight,maplight.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(material,material.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(mipmap,mipmap.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(model,model.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(movelight,movelight.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(nurbs,nurbs.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(pickdepth,pickdepth.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(pickline,pickline.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(picksquare,picksquare.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(plane,plane.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(planet,planet.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(planetup,planetup.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(polys,polys.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(robot,robot.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(sccolorlight,sccolorlight.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(scene,scene.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(scenebamb,scenebamb.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(sceneflat,sceneflat.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(select,select.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(simple,simple.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(smooth,smooth.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(sphere,sphere.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(stencil,stencil.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(stroke,stroke.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(surface,surface.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(tea,tea.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(teaambient,teaambient.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(teapots,teapots.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(texgen,texgen.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(texturesurf,texturesurf.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(trim,trim.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(xfont,xfont.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) - -DependTarget() - diff --git a/progs/samples/Imakefile b/progs/samples/Imakefile deleted file mode 100644 index 948a9783597..00000000000 --- a/progs/samples/Imakefile +++ /dev/null @@ -1,101 +0,0 @@ -LOCAL_LIBRARIES = $(XLIB) $(TOP)\lib\glut.a $(TOP)\lib\Mesaglu.a $(TOP)\lib\MesaGL.a - -INCLUDES = -I$(TOP)\include - -SRCS = accum.c \ - bitmap1.c \ - bitmap2.c \ - blendeq.c \ - blendxor.c \ - copy.c \ - cursor.c \ - depth.c \ - eval.c \ - fog.c \ - font.c \ - line.c \ - logo.c \ - nurb.c \ - oglinfo.c \ - olympic.c \ - overlay.c \ - point.c \ - prim.c \ - quad.c \ - select.c \ - shape.c \ - speed.c \ - sphere.c \ - star.c \ - stencil.c \ - stretch.c \ - texture.c \ - tri.c \ - wave.c - -PROGRAMS = ProgramTargetName(accum) \ - ProgramTargetName(bitmap1) \ - ProgramTargetName(bitmap2) \ - ProgramTargetName(blendeq) \ - ProgramTargetName(blendxor) \ - ProgramTargetName(copy) \ - ProgramTargetName(cursor) \ - ProgramTargetName(depth) \ - ProgramTargetName(eval) \ - ProgramTargetName(fog) \ - ProgramTargetName(font) \ - ProgramTargetName(line) \ - ProgramTargetName(logo) \ - ProgramTargetName(nurb) \ - ProgramTargetName(oglinfo) \ - ProgramTargetName(olympic) \ - ProgramTargetName(overlay) \ - ProgramTargetName(point) \ - ProgramTargetName(prim) \ - ProgramTargetName(quad) \ - ProgramTargetName(select) \ - ProgramTargetName(shape) \ - ProgramTargetName(speed) \ - ProgramTargetName(sphere) \ - ProgramTargetName(star) \ - ProgramTargetName(stencil) \ - ProgramTargetName(stretch) \ - ProgramTargetName(texture) \ - ProgramTargetName(tri) \ - ProgramTargetName(wave) - -AllTarget($(PROGRAMS)) - -NormalProgramTarget(accum,accum.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(bitmap1,bitmap1.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(bitmap2,bitmap2.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(blendeq,blendeq.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(blendxor,blendxor.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(copy,copy.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(cursor,cursor.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(depth,depth.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(eval,eval.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(fog,fog.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(font,font.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(line,line.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(logo,logo.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(nurb,nurb.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(oglinfo,oglinfo.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(olympic,olympic.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(overlay,overlay.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(point,point.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(prim,prim.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(quad,quad.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(select,select.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(shape,shape.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(speed,speed.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(sphere,sphere.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(star,star.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(stencil,stencil.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(stretch,stretch.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(texture,texture.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(tri,tri.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) -NormalProgramTarget(wave,wave.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter) - -DependTarget() - diff --git a/src/mesa/main/Imakefile b/src/mesa/main/Imakefile deleted file mode 100644 index fe0658c6c76..00000000000 --- a/src/mesa/main/Imakefile +++ /dev/null @@ -1,129 +0,0 @@ -#define DoNormalLib NO -#define DoSharedLib YES -#define DoDebugLib NO -#define DoProfileLib NO -#define LibName MESAGL -#define SoRev SOX11REV -#define LibHeaders NO - -#include - -REQUIREDLIBS = $(X11ROOT)\\XFree86\\lib\\ Xext X11 -BUILDLIBDIR = $(TOP)\\lib - -INCLUDES = -I$(TOP)\\include - -SRCS = \ -accum.c \ -alpha.c \ -alphabuf.c \ -api1.c \ -api2.c \ -attrib.c \ -bitmap.c \ -blend.c \ -bresenhm.c \ -clip.c \ -context.c \ -copypix.c \ -dd.c \ -depth.c \ -draw.c \ -drawpix.c \ -enable.c \ -eval2.c \ -feedback.c \ -fog.c \ -fortran.c \ -get.c \ -hash.c \ -glx.c \ -interp.c \ -light.c \ -lines.c \ -list.c \ -logic.c \ -masking.c \ -misc.c \ -osmesa.c \ -pb.c \ -pixel.c \ -points.c \ -polygons.c \ -readpix.c \ -scissor.c \ -span.c \ -stencil.c \ -svgamesa.c \ -texture.c \ -varray.c \ -vb.c \ -vertex.c \ -xfonts.c \ -xform.c \ -xm_api.c \ -xm_dd.c \ -xm_line.c \ -xm_span.c \ -xm_tri.c - -OBJS = \ -accum.o \ -alpha.o \ -alphabuf.o \ -api1.o \ -api2.o \ -attrib.o \ -bitmap.o \ -blend.o \ -bresenhm.o \ -clip.o \ -context.o \ -copypix.o \ -dd.o \ -depth.o \ -draw.o \ -drawpix.o \ -enable.o \ -eval2.o \ -feedback.o \ -fog.o \ -fortran.o \ -get.o \ -hash.o \ -glx.o \ -interp.o \ -light.o \ -lines.o \ -list.o \ -logic.o \ -masking.o \ -misc.o \ -osmesa.o \ -pb.o \ -pixel.o \ -points.o \ -polygons.o \ -readpix.o \ -scissor.o \ -span.o \ -stencil.o \ -svgamesa.o \ -texture.o \ -varray.o \ -vb.o \ -vertex.o \ -xfonts.o \ -xform.o \ -xm_api.o \ -xm_dd.o \ -xm_line.o \ -xm_span.o \ -xm_tri.o - -LINTLIBS = - -#include - -DependTarget() - -- cgit v1.2.3 From 838a2a2633e0f39000afea740c87ebce7cb0c4e7 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Fri, 20 Apr 2007 21:53:38 -0400 Subject: Make xcb backend compile. Add nouveau to match linux-dri config. --- configs/linux-dri-xcb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configs/linux-dri-xcb b/configs/linux-dri-xcb index cb327fa60f9..5620fe58e70 100644 --- a/configs/linux-dri-xcb +++ b/configs/linux-dri-xcb @@ -22,7 +22,8 @@ ARCH_FLAGS ?= DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ -D_BSD_SOURCE -D_GNU_SOURCE \ -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \ - -DGLX_DIRECT_RENDERING -DHAVE_ALIAS -DUSE_XCB -DHAVE_POSIX_MEMALIGN + -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \ + -DHAVE_ALIAS -DUSE_XCB -DHAVE_POSIX_MEMALIGN X11_INCLUDES = `pkg-config --cflags-only-I x11` `pkg-config --cflags-only-I xcb` `pkg-config --cflags-only-I x11-xcb` `pkg-config --cflags-only-I xcb-glx` @@ -65,4 +66,4 @@ WINDOW_SYSTEM=dri # gamma are missing because they have not been converted to use the new # interface. DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon s3v \ - savage sis tdfx trident unichrome ffb + savage sis tdfx trident unichrome ffb nouveau -- cgit v1.2.3 From c9855a60f4b4b478bd036db8cefc06d1c7ff521d Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 21 Apr 2007 09:47:03 -0600 Subject: Call _mesa_warning() instead of _mesa_problem() when external s3tc lib not found. The later incorrectly encourages filing a bug (10703, for example). --- src/mesa/main/texcompress_s3tc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c index c823967b7a0..c48063d9192 100644 --- a/src/mesa/main/texcompress_s3tc.c +++ b/src/mesa/main/texcompress_s3tc.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.2 + * Version: 6.5.3 * - * 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"), @@ -245,7 +245,7 @@ texstore_rgb_dxt1(TEXSTORE_PARAMS) dst, dstRowStride); } else { - _mesa_problem(ctx, "external dxt library not available"); + _mesa_warning(ctx, "external dxt library not available"); } if (tempImage) @@ -307,7 +307,7 @@ texstore_rgba_dxt1(TEXSTORE_PARAMS) dst, dstRowStride); } else { - _mesa_problem(ctx, "external dxt library not available"); + _mesa_warning(ctx, "external dxt library not available"); } if (tempImage) @@ -368,7 +368,7 @@ texstore_rgba_dxt3(TEXSTORE_PARAMS) dst, dstRowStride); } else { - _mesa_problem(ctx, "external dxt library not available"); + _mesa_warning(ctx, "external dxt library not available"); } if (tempImage) @@ -429,7 +429,7 @@ texstore_rgba_dxt5(TEXSTORE_PARAMS) dst, dstRowStride); } else { - _mesa_problem(ctx, "external dxt library not available"); + _mesa_warning(ctx, "external dxt library not available"); } if (tempImage) -- cgit v1.2.3 From fe16b9f6633e468aa2244c36e540c1cfac2517e6 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 19 Apr 2007 15:22:04 -0600 Subject: move allocation of shProg->Attributes earlier in function --- src/mesa/shader/slang/slang_link.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 48c0d68375e..5a9385571b6 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -290,6 +290,9 @@ _slang_resolve_attributes(struct gl_shader_program *shProg, assert(prog->Target == GL_VERTEX_PROGRAM_ARB); + if (!shProg->Attributes) + shProg->Attributes = _mesa_new_parameter_list(); + /* Build a bitmask indicating which attribute indexes have been * explicitly bound by the user with glBindAttributeLocation(). */ @@ -299,9 +302,6 @@ _slang_resolve_attributes(struct gl_shader_program *shProg, usedAttributes |= attr; } - if (!shProg->Attributes) - shProg->Attributes = _mesa_new_parameter_list(); - /* * Scan program for generic attribute references */ -- cgit v1.2.3 From 4b7c6fc5a655bfb8f165cb94521bc49521303a35 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 19 Apr 2007 15:23:34 -0600 Subject: free shProg->Attributes in _mesa_free_shader_program_data() --- src/mesa/shader/shader_api.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 418ef5c7239..64f2a9fa126 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -119,6 +119,11 @@ _mesa_free_shader_program_data(GLcontext *ctx, _mesa_clear_shader_program_data(ctx, shProg); + if (shProg->Attributes) { + _mesa_free_parameter_list(shProg->Attributes); + shProg->Attributes = NULL; + } + /* detach shaders */ for (i = 0; i < shProg->NumShaders; i++) { _mesa_reference_shader(ctx, &shProg->Shaders[i], NULL); -- cgit v1.2.3 From f2346498aacdfc3e574fed43e0fe13ad3f8e2a2d Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 19 Apr 2007 15:28:42 -0600 Subject: fix memleak in slang_operation_insert() --- src/mesa/shader/slang/slang_compile_operation.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mesa/shader/slang/slang_compile_operation.c b/src/mesa/shader/slang/slang_compile_operation.c index 410d215a8d4..5d80bc77c64 100644 --- a/src/mesa/shader/slang/slang_compile_operation.c +++ b/src/mesa/shader/slang/slang_compile_operation.c @@ -205,6 +205,8 @@ slang_operation_insert(GLuint *numChildren, slang_operation **children, *children = NULL; return NULL; } + if (*children) + _mesa_free(*children); *children = ops; (*numChildren)++; return newOp; -- cgit v1.2.3 From 98ef18909a97dea9a28f0fe30797c0353a1117ce Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 19 Apr 2007 15:30:11 -0600 Subject: new varnames in slang_operation_insert() --- src/mesa/shader/slang/slang_compile_operation.c | 34 ++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/mesa/shader/slang/slang_compile_operation.c b/src/mesa/shader/slang/slang_compile_operation.c index 5d80bc77c64..dfba1965ce6 100644 --- a/src/mesa/shader/slang/slang_compile_operation.c +++ b/src/mesa/shader/slang/slang_compile_operation.c @@ -175,40 +175,40 @@ slang_operation_grow(GLuint *numChildren, slang_operation **children) /** * Insert a new slang_operation into an array. - * \param numChildren pointer to current number of children (in/out) - * \param children address of array (in/out) - * \param pos position to insert - * \return pointer to the new operation + * \param numElements pointer to current array size (in/out) + * \param array address of the array (in/out) + * \param pos position to insert new element + * \return pointer to the new operation/element */ slang_operation * -slang_operation_insert(GLuint *numChildren, slang_operation **children, +slang_operation_insert(GLuint *numElements, slang_operation **array, GLuint pos) { slang_operation *ops; - assert(pos <= *numChildren); + assert(pos <= *numElements); ops = (slang_operation *) - _mesa_malloc((*numChildren + 1) * sizeof(slang_operation)); + _mesa_malloc((*numElements + 1) * sizeof(slang_operation)); if (ops) { slang_operation *newOp; newOp = ops + pos; if (pos > 0) - _mesa_memcpy(ops, *children, pos * sizeof(slang_operation)); - if (pos < *numChildren) - _mesa_memcpy(newOp + 1, (*children) + pos, - (*numChildren - pos) * sizeof(slang_operation)); + _mesa_memcpy(ops, *array, pos * sizeof(slang_operation)); + if (pos < *numElements) + _mesa_memcpy(newOp + 1, (*array) + pos, + (*numElements - pos) * sizeof(slang_operation)); if (!slang_operation_construct(newOp)) { _mesa_free(ops); - *numChildren = 0; - *children = NULL; + *numElements = 0; + *array = NULL; return NULL; } - if (*children) - _mesa_free(*children); - *children = ops; - (*numChildren)++; + if (*array) + _mesa_free(*array); + *array = ops; + (*numElements)++; return newOp; } return NULL; -- cgit v1.2.3 From 11e3f733ba5c26f68fb8a7d69e6f94c1b5361f7d Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 19 Apr 2007 15:37:24 -0600 Subject: free subroutine array (fix mem leak) --- src/mesa/shader/slang/slang_emit.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index c2f2e85ff14..badeb69b3fe 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -1762,6 +1762,7 @@ _slang_resolve_subroutines(slang_emit_info *emitInfo) mainP->Instructions = _mesa_realloc_instructions(mainP->Instructions, mainP->NumInstructions, total); + mainP->NumInstructions = total; for (i = 0; i < emitInfo->NumSubroutines; i++) { struct gl_program *sub = emitInfo->Subroutines[i]; _mesa_copy_instructions(mainP->Instructions + subroutineLoc[i], @@ -1771,7 +1772,13 @@ _slang_resolve_subroutines(slang_emit_info *emitInfo) sub->Parameters = NULL; /* prevent double-free */ _mesa_delete_program(ctx, sub); } - mainP->NumInstructions = total; + + /* free subroutine list */ + if (emitInfo->Subroutines) { + _mesa_free(emitInfo->Subroutines); + emitInfo->Subroutines = NULL; + } + emitInfo->NumSubroutines = 0; /* Examine CAL instructions. * At this point, the BranchTarget field of the CAL instructions is -- cgit v1.2.3 From a7f7366d382b2fe124f1495baf0360bffa30f0c0 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 20 Apr 2007 08:11:51 -0600 Subject: another bit of debug code --- src/mesa/shader/prog_execute.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c index 013d65ce869..356d4ce2490 100644 --- a/src/mesa/shader/prog_execute.c +++ b/src/mesa/shader/prog_execute.c @@ -933,6 +933,9 @@ _mesa_execute_program(GLcontext * ctx, else { cond = eval_condition(machine, inst); } + if (DEBUG_PROG) { + printf("IF: %d\n", cond); + } /* do if/else */ if (cond) { /* do if-clause (just continue execution) */ -- cgit v1.2.3 From 4cc2674aee98a4c2972f4f097a89b7b4a30df4ab Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 20 Apr 2007 08:12:17 -0600 Subject: fix instruction comment code --- src/mesa/shader/prog_instruction.c | 8 +++++++- src/mesa/shader/program.c | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mesa/shader/prog_instruction.c b/src/mesa/shader/prog_instruction.c index 1e8e0812262..d6b5652a276 100644 --- a/src/mesa/shader/prog_instruction.c +++ b/src/mesa/shader/prog_instruction.c @@ -108,7 +108,13 @@ struct prog_instruction * _mesa_copy_instructions(struct prog_instruction *dest, const struct prog_instruction *src, GLuint n) { - return _mesa_memcpy(dest, src, n * sizeof(struct prog_instruction)); + GLuint i; + _mesa_memcpy(dest, src, n * sizeof(struct prog_instruction)); + for (i = 0; i < n; i++) { + if (src[i].Comment) + dest[i].Comment = _mesa_strdup(src[i].Comment); + } + return dest; } diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index e872d78611f..42059198282 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -281,6 +281,8 @@ _mesa_delete_program(GLcontext *ctx, struct gl_program *prog) for (i = 0; i < prog->NumInstructions; i++) { if (prog->Instructions[i].Data) _mesa_free(prog->Instructions[i].Data); + if (prog->Instructions[i].Comment) + _mesa_free((char *) prog->Instructions[i].Comment); } _mesa_free(prog->Instructions); } -- cgit v1.2.3 From ced6f76404ff1a6713c85edff17551f82c33cc24 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 20 Apr 2007 08:21:49 -0600 Subject: undo a test/debug change --- src/mesa/swrast/s_fragprog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index 1b5f20d42d6..882fec29efe 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -104,7 +104,7 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine, if (ctx->FragmentProgram.CallbackEnabled) inputsRead = ~0; - if (1/*program->Base.Target == GL_FRAGMENT_PROGRAM_NV*/) { + if (program->Base.Target == GL_FRAGMENT_PROGRAM_NV) { /* Clear temporary registers (undefined for ARB_f_p) */ _mesa_bzero(machine->Temporaries, MAX_PROGRAM_TEMPS * 4 * sizeof(GLfloat)); -- cgit v1.2.3 From 82839e8430aa7f88357cad887ae2d804072de568 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 20 Apr 2007 08:30:24 -0600 Subject: Memory pool manager. Instead of doing intricate malloc/free tracking during compiling, allocate everything (which would be discarded after compiling) from a pool that can be freed en masse when done. --- src/mesa/shader/slang/slang_mem.c | 142 ++++++++++++++++++++++++++++++++++++++ src/mesa/shader/slang/slang_mem.h | 59 ++++++++++++++++ 2 files changed, 201 insertions(+) create mode 100644 src/mesa/shader/slang/slang_mem.c create mode 100644 src/mesa/shader/slang/slang_mem.h diff --git a/src/mesa/shader/slang/slang_mem.c b/src/mesa/shader/slang/slang_mem.c new file mode 100644 index 00000000000..c7be9a7dc1a --- /dev/null +++ b/src/mesa/shader/slang/slang_mem.c @@ -0,0 +1,142 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5.3 + * + * Copyright (C) 2005-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. + */ + +/** + * \file slang_mem.c + * + * Memory manager for GLSL compiler. The general idea is to do all + * allocations out of a large pool then just free the pool when done + * compiling to avoid intricate malloc/free tracking and memory leaks. + * + * \author Brian Paul + */ + +#include "context.h" +#include "slang_mem.h" + +#define GRANULARITY 8 +#define ROUND_UP(B) ( ((B) + (GRANULARITY - 1)) & ~(GRANULARITY - 1) ) + + +slang_mempool * +_slang_new_mempool(GLuint initialSize) +{ + slang_mempool *pool = (slang_mempool *) _mesa_calloc(sizeof(slang_mempool)); + if (pool) { + pool->Data = (char *) _mesa_calloc(initialSize); + if (!pool->Data) { + _mesa_free(pool); + return NULL; + } + pool->Size = initialSize; + pool->Used = 0; + } + return pool; +} + + +void +_slang_delete_mempool(slang_mempool *pool) +{ + GLuint total = 0; + while (pool) { + slang_mempool *next = pool->Next; + total += pool->Used; + _mesa_free(pool->Data); + _mesa_free(pool); + pool = next; + } + printf("TOTAL USED %u\n", total); +} + + +/** + * Alloc 'bytes' from shader mempool. + */ +void * +_slang_alloc(GLuint bytes) +{ + slang_mempool *pool; + GET_CURRENT_CONTEXT(ctx); + + pool = (slang_mempool *) ctx->Shader.MemPool; + + while (pool) { + if (pool->Used + bytes <= pool->Size) { + /* found room */ + void *addr = (void *) (pool->Data + pool->Used); + pool->Used += ROUND_UP(bytes); + /*printf("alloc %u Used %u\n", bytes, pool->Used);*/ + return addr; + } + else if (pool->Next) { + /* try next block */ + pool = pool->Next; + } + else { + /* alloc new pool */ + assert(bytes <= pool->Size); /* XXX or max2() */ + pool->Next = _slang_new_mempool(pool->Size); + if (!pool->Next) { + /* we're _really_ out of memory */ + return NULL; + } + else { + pool->Used = ROUND_UP(bytes); + return (void *) pool->Data; + } + } + } + return NULL; +} + + +void * +_slang_realloc(void *oldBuffer, GLuint oldSize, GLuint newSize) +{ + const GLuint copySize = (oldSize < newSize) ? oldSize : newSize; + void *newBuffer = _slang_alloc(newSize); + if (newBuffer && oldBuffer && copySize > 0) + _mesa_memcpy(newBuffer, oldBuffer, copySize); + return newBuffer; +} + + +/** + * Clone string, storing in current mempool. + */ +char * +_slang_strdup(const char *s) +{ + if (s) { + size_t l = _mesa_strlen(s); + char *s2 = (char *) _slang_alloc(l + 1); + if (s2) + _mesa_strcpy(s2, s); + return s2; + } + else { + return NULL; + } +} diff --git a/src/mesa/shader/slang/slang_mem.h b/src/mesa/shader/slang/slang_mem.h new file mode 100644 index 00000000000..f44892666bf --- /dev/null +++ b/src/mesa/shader/slang/slang_mem.h @@ -0,0 +1,59 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5.3 + * + * Copyright (C) 2005-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. + */ + + +#ifndef SLANG_MEM_H +#define SLANG_MEM_H + + +#include "imports.h" + + +typedef struct slang_mempool_ +{ + GLuint Size, Used; + char *Data; + struct slang_mempool_ *Next; +} slang_mempool; + + +extern slang_mempool * +_slang_new_mempool(GLuint initialSize); + +extern void +_slang_delete_mempool(slang_mempool *pool); + +extern void * +_slang_alloc(GLuint bytes); + +extern void * +_slang_realloc(void *oldBuffer, GLuint oldSize, GLuint newSize); + +extern char * +_slang_strdup(const char *s); + + +#define USE_MEMPOOL 1 /* XXX temporary */ + +#endif -- cgit v1.2.3 From 1fbdd9d794ca61512eb65d3e228f5fb29fb1ed83 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 20 Apr 2007 08:30:42 -0600 Subject: added slang_mem.c --- src/mesa/sources | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/sources b/src/mesa/sources index 6a6d594e4bd..0066c591644 100644 --- a/src/mesa/sources +++ b/src/mesa/sources @@ -182,6 +182,7 @@ SLANG_SOURCES = \ shader/slang/slang_library_noise.c \ shader/slang/slang_link.c \ shader/slang/slang_log.c \ + shader/slang/slang_mem.c \ shader/slang/slang_preprocess.c \ shader/slang/slang_print.c \ shader/slang/slang_simplify.c \ -- cgit v1.2.3 From 81c4fee160cd2840caf77bbdbf462e783911141a Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 20 Apr 2007 11:53:48 -0600 Subject: remove unused vars, assertions --- src/mesa/shader/nvfragparse.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index ffa7ba4701b..02da3ade7df 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -1140,13 +1140,12 @@ Parse_ScalarSrcReg(struct parse_state *parseState, else if (token[0] == '{') { /* vector literal */ GLfloat values[4]; - GLuint paramIndex, swizzle; + GLuint paramIndex; (void) Parse_String(parseState, "{"); if (!Parse_VectorConstant(parseState, values)) RETURN_ERROR; paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values, 4, NULL); - ASSERT(swizzle == SWIZZLE_NOOP); srcReg->File = PROGRAM_NAMED_PARAM; srcReg->Index = paramIndex; } @@ -1167,12 +1166,11 @@ Parse_ScalarSrcReg(struct parse_state *parseState, else if (IsDigit(token[0])) { /* scalar literal */ GLfloat values[4]; - GLuint paramIndex, swizzle; + GLuint paramIndex; if (!Parse_ScalarConstant(parseState, values)) RETURN_ERROR; paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values, 4, NULL); - ASSERT(swizzle == SWIZZLE_NOOP); srcReg->Index = paramIndex; srcReg->File = PROGRAM_NAMED_PARAM; needSuffix = GL_FALSE; -- cgit v1.2.3 From 257f799849a1eb3e81851b92a8fd27efa8f93d47 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 20 Apr 2007 11:54:30 -0600 Subject: remove more unused vars, assertions --- src/mesa/shader/nvfragparse.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 02da3ade7df..0f1a1eade4a 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -1036,25 +1036,23 @@ Parse_VectorSrc(struct parse_state *parseState, else if (IsDigit(token[0]) || token[0] == '-' || token[0] == '+' || token[0] == '.'){ /* literal scalar constant */ GLfloat values[4]; - GLuint paramIndex, swizzle; + GLuint paramIndex; if (!Parse_ScalarConstant(parseState, values)) RETURN_ERROR; paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values, 4, NULL); - ASSERT(swizzle == SWIZZLE_NOOP); srcReg->File = PROGRAM_NAMED_PARAM; srcReg->Index = paramIndex; } else if (token[0] == '{'){ /* literal vector constant */ GLfloat values[4]; - GLuint paramIndex, swizzle; + GLuint paramIndex; (void) Parse_String(parseState, "{"); if (!Parse_VectorConstant(parseState, values)) RETURN_ERROR; paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values, 4, NULL); - ASSERT(swizzle == SWIZZLE_NOOP); srcReg->File = PROGRAM_NAMED_PARAM; srcReg->Index = paramIndex; } -- cgit v1.2.3 From bc74cb4c0ae6210eab403ee879492fc19644b3f2 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 20 Apr 2007 11:59:18 -0600 Subject: destroy window upon exit --- progs/demos/arbfplight.c | 4 +++- progs/demos/fplight.c | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/progs/demos/arbfplight.c b/progs/demos/arbfplight.c index d9c564fbe56..bc2c7e312ab 100644 --- a/progs/demos/arbfplight.c +++ b/progs/demos/arbfplight.c @@ -24,6 +24,7 @@ static GLuint VertProg; static GLboolean Anim = GL_TRUE; static GLboolean Wire = GL_FALSE; static GLboolean PixelLight = GL_TRUE; +static GLint Win; static GLint T0 = 0; static GLint Frames = 0; @@ -148,6 +149,7 @@ static void Key( unsigned char key, int x, int y ) case 27: glDeleteProgramsARB_func(1, &VertProg); glDeleteProgramsARB_func(1, &FragProg); + glutDestroyWindow(Win); exit(0); break; } @@ -382,7 +384,7 @@ int main( int argc, char *argv[] ) glutInitWindowPosition( 0, 0 ); glutInitWindowSize( 200, 200 ); glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); + Win = glutCreateWindow(argv[0]); glutReshapeFunc( Reshape ); glutKeyboardFunc( Key ); glutSpecialFunc( SpecialKey ); diff --git a/progs/demos/fplight.c b/progs/demos/fplight.c index c7a38248d38..fb510cccc8a 100644 --- a/progs/demos/fplight.c +++ b/progs/demos/fplight.c @@ -24,7 +24,7 @@ static GLuint VertProg; static GLboolean Anim = GL_TRUE; static GLboolean Wire = GL_FALSE; static GLboolean PixelLight = GL_TRUE; - +static GLint Win; static GLfloat Xrot = 0, Yrot = 0; @@ -136,8 +136,8 @@ static void Key( unsigned char key, int x, int y ) } break; case 27: + glutDestroyWindow(Win); exit(0); - break; } glutPostRedisplay(); } @@ -272,7 +272,7 @@ int main( int argc, char *argv[] ) glutInitWindowPosition( 0, 0 ); glutInitWindowSize( 200, 200 ); glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); + Win = glutCreateWindow(argv[0]); glutReshapeFunc( Reshape ); glutKeyboardFunc( Key ); glutSpecialFunc( SpecialKey ); -- cgit v1.2.3 From d5e7234ba80c59505838c67c92501fa7cfde0b66 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 20 Apr 2007 12:59:26 -0600 Subject: call grammar_alloc_free() to fix memleaks --- src/mesa/shader/slang/slang_preprocess.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mesa/shader/slang/slang_preprocess.c b/src/mesa/shader/slang/slang_preprocess.c index 66a6a983927..72281eda57d 100644 --- a/src/mesa/shader/slang/slang_preprocess.c +++ b/src/mesa/shader/slang/slang_preprocess.c @@ -1138,10 +1138,12 @@ preprocess_source (slang_string *output, const char *source, grammar pid, gramma goto error; } + grammar_alloc_free(prod); pp_state_free (&state); return GL_TRUE; error: + grammar_alloc_free(prod); pp_state_free (&state); return GL_FALSE; } -- cgit v1.2.3 From 4e0a64675cbd815f6063977f3effbf21acced3fe Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 21 Apr 2007 10:18:49 -0600 Subject: added MemPool field --- src/mesa/main/mtypes.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 0044494bd3c..71215d54709 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2133,6 +2133,7 @@ struct gl_shader_state GLboolean EmitHighLevelInstructions; /**< IF/ELSE/ENDIF vs. BRA, etc. */ GLboolean EmitCondCodes; /**< Use condition codes? */ GLboolean EmitComments; /**< Annotated instructions */ + void *MemPool; }; -- cgit v1.2.3 From ad3cc95485c488e3920f9c460b373338043000c5 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Sat, 21 Apr 2007 10:47:54 -0700 Subject: Fix FBO completeness bug in shadowtex. --- progs/demos/shadowtex.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/progs/demos/shadowtex.c b/progs/demos/shadowtex.c index b32fb45b4fa..b11c6f53630 100644 --- a/progs/demos/shadowtex.c +++ b/progs/demos/shadowtex.c @@ -296,14 +296,27 @@ RenderShadowMap(void) 0, 1, 0); /* up */ if (UseFBO) { + GLenum fbo_status; + glTexImage2D(GL_TEXTURE_2D, 0, depthFormat, ShadowTexWidth, ShadowTexHeight, 0, depthFormat, depthType, NULL); + + /* Set the filter mode so that the texture is texture-complete. + * Otherwise it will cause the framebuffer to fail the framebuffer + * completeness test. + */ + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, ShadowFBO); glDrawBuffer(GL_NONE); glReadBuffer(GL_NONE); - assert(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) - == GL_FRAMEBUFFER_COMPLETE_EXT); + + fbo_status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); + if (fbo_status != GL_FRAMEBUFFER_COMPLETE_EXT) { + fprintf(stderr, "FBO not complete! status = 0x%04x\n", fbo_status); + assert(fbo_status == GL_FRAMEBUFFER_COMPLETE_EXT); + } } assert(!glIsEnabled(GL_TEXTURE_1D)); -- cgit v1.2.3 From cd3e39340f057712fcf02a35dff85645e475053a Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 21 Apr 2007 12:08:56 -0600 Subject: Use new memory pool allocator. Lots of debug code still in place... --- src/mesa/shader/slang/slang_codegen.c | 28 +++++- src/mesa/shader/slang/slang_compile.c | 84 +++++++++++++++++ src/mesa/shader/slang/slang_compile_function.c | 25 +++++ src/mesa/shader/slang/slang_compile_operation.c | 27 ++++++ src/mesa/shader/slang/slang_compile_struct.c | 29 ++++++ src/mesa/shader/slang/slang_compile_variable.c | 36 +++++++- src/mesa/shader/slang/slang_emit.c | 9 ++ src/mesa/shader/slang/slang_ir.c | 6 +- src/mesa/shader/slang/slang_label.c | 27 ++++++ src/mesa/shader/slang/slang_log.c | 12 +++ src/mesa/shader/slang/slang_mem.c | 117 ++++++++++++++++++++++-- src/mesa/shader/slang/slang_mem.h | 10 +- src/mesa/shader/slang/slang_storage.c | 29 ++++++ src/mesa/shader/slang/slang_typeinfo.c | 29 ++++++ src/mesa/shader/slang/slang_utility.c | 36 ++++++-- src/mesa/shader/slang/slang_utility.h | 12 ++- src/mesa/shader/slang/slang_vartable.c | 24 +++++ 17 files changed, 511 insertions(+), 29 deletions(-) diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 6519040b662..71ef132e38b 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -48,6 +48,7 @@ #include "slang_codegen.h" #include "slang_compile.h" #include "slang_label.h" +#include "slang_mem.h" #include "slang_simplify.h" #include "slang_emit.h" #include "slang_vartable.h" @@ -459,7 +460,11 @@ static slang_ir_node * new_node3(slang_ir_opcode op, slang_ir_node *c0, slang_ir_node *c1, slang_ir_node *c2) { +#if USE_MEMPOOL + slang_ir_node *n = (slang_ir_node *) _slang_alloc(sizeof(slang_ir_node)); +#else slang_ir_node *n = (slang_ir_node *) calloc(1, sizeof(slang_ir_node)); +#endif if (n) { n->Opcode = op; n->Children[0] = c0; @@ -922,12 +927,21 @@ slang_inline_function_call(slang_assemble_ctx * A, slang_function *fun, assert(fun->param_count == totalArgs); /* allocate temporary arrays */ +#if USE_MEMPOOL + paramMode = (ParamMode *) + _slang_alloc(totalArgs * sizeof(ParamMode)); + substOld = (slang_variable **) + _slang_alloc(totalArgs * sizeof(slang_variable *)); + substNew = (slang_operation **) + _slang_alloc(totalArgs * sizeof(slang_operation *)); +#else paramMode = (ParamMode *) _mesa_calloc(totalArgs * sizeof(ParamMode)); substOld = (slang_variable **) _mesa_calloc(totalArgs * sizeof(slang_variable *)); substNew = (slang_operation **) _mesa_calloc(totalArgs * sizeof(slang_operation *)); +#endif #if 0 printf("Inline call to %s (total vars=%d nparams=%d)\n", @@ -1128,9 +1142,11 @@ slang_inline_function_call(slang_assemble_ctx * A, slang_function *fun, } } +#if !USE_MEMPOOL _mesa_free(paramMode); _mesa_free(substOld); _mesa_free(substNew); +#endif #if 0 printf("Done Inline call to %s (total vars=%d nparams=%d)\n", @@ -1188,7 +1204,9 @@ _slang_gen_function_call(slang_assemble_ctx *A, slang_function *fun, /* Replace the function call with the inlined block */ slang_operation_destruct(oper); *oper = *inlined; - /* XXX slang_operation_destruct(inlined) ??? */ +#if !USE_MEMPOOL + _mesa_free(inlined); +#endif #if 0 assert(inlined->locals); @@ -1318,7 +1336,9 @@ _slang_gen_asm(slang_assemble_ctx *A, slang_operation *oper, n->Store = n0->Store; n->Writemask = writemask; +#if !USE_MEMPOOL free(n0); +#endif } return n; @@ -1759,9 +1779,11 @@ _slang_gen_temporary(GLint size) if (n) { n->Store = store; } +#if !USE_MEMPOOL else { free(store); } +#endif } return n; } @@ -1871,9 +1893,11 @@ _slang_gen_logical_and(slang_assemble_ctx *A, slang_operation *oper) n = _slang_gen_select(A, select); +#if !USE_MEMPOOL /* xxx wrong */ free(select->children); free(select); +#endif return n; } @@ -1902,9 +1926,11 @@ _slang_gen_logical_or(slang_assemble_ctx *A, slang_operation *oper) n = _slang_gen_select(A, select); +#if !USE_MEMPOOL /* xxx wrong */ free(select->children); free(select); +#endif return n; } diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 7ea6cc064ed..d1c82a092d5 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -39,6 +39,7 @@ #include "slang_storage.h" #include "slang_emit.h" #include "slang_log.h" +#include "slang_mem.h" #include "slang_vartable.h" #include "slang_simplify.h" @@ -193,7 +194,11 @@ parse_float(slang_parse_ctx * C, float *number) parse_identifier_str(C, &fractional); parse_identifier_str(C, &exponent); +#if USE_MEMPOOL + whole = (char *) (_slang_alloc((_mesa_strlen(integral) + +#else whole = (char *) (slang_alloc_malloc((_mesa_strlen(integral) + +#endif _mesa_strlen(fractional) + _mesa_strlen(exponent) + 3) * sizeof(char))); if (whole == NULL) { @@ -209,7 +214,11 @@ parse_float(slang_parse_ctx * C, float *number) *number = (float) (_mesa_strtod(whole, (char **) NULL)); +#if USE_MEMPOOL + _slang_free(whole); +#else slang_alloc_free(whole); +#endif return 1; } @@ -288,7 +297,11 @@ convert_to_array(slang_parse_ctx * C, slang_variable * var, * parse the expression */ var->type.specifier.type = SLANG_SPEC_ARRAY; var->type.specifier._array = (slang_type_specifier *) +#if USE_MEMPOOL + _slang_alloc(sizeof(slang_type_specifier)); +#else slang_alloc_malloc(sizeof(slang_type_specifier)); +#endif if (var->type.specifier._array == NULL) { slang_info_log_memory(C->L); return GL_FALSE; @@ -371,13 +384,21 @@ parse_struct(slang_parse_ctx * C, slang_output_ctx * O, slang_struct ** st) } /* set-up a new struct */ +#if USE_MEMPOOL + *st = (slang_struct *) _slang_alloc(sizeof(slang_struct)); +#else *st = (slang_struct *) slang_alloc_malloc(sizeof(slang_struct)); +#endif if (*st == NULL) { slang_info_log_memory(C->L); return 0; } if (!slang_struct_construct(*st)) { +#if USE_MEMPOOL + _slang_free(*st); +#else slang_alloc_free(*st); +#endif *st = NULL; slang_info_log_memory(C->L); return 0; @@ -403,7 +424,11 @@ parse_struct(slang_parse_ctx * C, slang_output_ctx * O, slang_struct ** st) slang_struct *s; O->structs->structs = +#if USE_MEMPOOL + (slang_struct *) _slang_realloc(O->structs->structs, +#else (slang_struct *) slang_alloc_realloc(O->structs->structs, +#endif O->structs->num_structs * sizeof(slang_struct), (O->structs->num_structs + @@ -617,13 +642,21 @@ parse_type_specifier(slang_parse_ctx * C, slang_output_ctx * O, } spec->_struct = +#if USE_MEMPOOL + (slang_struct *) _slang_alloc(sizeof(slang_struct)); +#else (slang_struct *) slang_alloc_malloc(sizeof(slang_struct)); +#endif if (spec->_struct == NULL) { slang_info_log_memory(C->L); return 0; } if (!slang_struct_construct(spec->_struct)) { +#if USE_MEMPOOL + _slang_free(spec->_struct); +#else slang_alloc_free(spec->_struct); +#endif spec->_struct = NULL; return 0; } @@ -905,7 +938,11 @@ handle_nary_expression(slang_parse_ctx * C, slang_operation * op, *total_ops -= n; *ops = (slang_operation *) +#if USE_MEMPOOL + _slang_realloc(*ops, +#else slang_alloc_realloc(*ops, +#endif (*total_ops + n) * sizeof(slang_operation), *total_ops * sizeof(slang_operation)); if (*ops == NULL) { @@ -938,7 +975,11 @@ parse_expression(slang_parse_ctx * C, slang_output_ctx * O, /* allocate default operation, becomes a no-op if not used */ ops = (slang_operation *) +#if USE_MEMPOOL + _slang_realloc(ops, +#else slang_alloc_realloc(ops, +#endif num_ops * sizeof(slang_operation), (num_ops + 1) * sizeof(slang_operation)); if (ops == NULL) { @@ -1182,7 +1223,11 @@ parse_expression(slang_parse_ctx * C, slang_output_ctx * O, slang_operation_destruct(oper); *oper = *ops; /* struct copy */ +#if USE_MEMPOOL + _slang_free(ops); +#else slang_alloc_free(ops); +#endif return 1; } @@ -1447,13 +1492,21 @@ parse_function_definition(slang_parse_ctx * C, slang_output_ctx * O, /* create function's body operation */ func->body = +#if USE_MEMPOOL + (slang_operation *) _slang_alloc(sizeof(slang_operation)); +#else (slang_operation *) slang_alloc_malloc(sizeof(slang_operation)); +#endif if (func->body == NULL) { slang_info_log_memory(C->L); return 0; } if (!slang_operation_construct(func->body)) { +#if USE_MEMPOOL + _slang_free(func->body); +#else slang_alloc_free(func->body); +#endif func->body = NULL; slang_info_log_memory(C->L); return 0; @@ -1485,7 +1538,11 @@ initialize_global(slang_assemble_ctx * A, slang_variable * var) /* put the variable into operation's scope */ op_id.locals->variables = +#if USE_MEMPOOL + (slang_variable **) _slang_alloc(sizeof(slang_variable *)); +#else (slang_variable **) slang_alloc_malloc(sizeof(slang_variable *)); +#endif if (op_id.locals->variables == NULL) { slang_operation_destruct(&op_id); return GL_FALSE; @@ -1501,7 +1558,11 @@ initialize_global(slang_assemble_ctx * A, slang_variable * var) } op_assign.type = SLANG_OPER_ASSIGN; op_assign.children = +#if USE_MEMPOOL + (slang_operation *) _slang_alloc(2 * sizeof(slang_operation)); +#else (slang_operation *) slang_alloc_malloc(2 * sizeof(slang_operation)); +#endif if (op_assign.children == NULL) { slang_operation_destruct(&op_assign); op_id.locals->num_variables = 0; @@ -1516,7 +1577,11 @@ initialize_global(slang_assemble_ctx * A, slang_variable * var) /* carefully destroy the operations */ op_assign.num_children = 0; +#if USE_MEMPOOL + _slang_free(op_assign.children); +#else slang_alloc_free(op_assign.children); +#endif op_assign.children = NULL; slang_operation_destruct(&op_assign); op_id.locals->num_variables = 0; @@ -1577,13 +1642,21 @@ parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O, if (!slang_type_specifier_copy(&var->type.specifier, &type->specifier)) return 0; var->initializer = +#if USE_MEMPOOL + (slang_operation *) _slang_alloc(sizeof(slang_operation)); +#else (slang_operation *) slang_alloc_malloc(sizeof(slang_operation)); +#endif if (var->initializer == NULL) { slang_info_log_memory(C->L); return 0; } if (!slang_operation_construct(var->initializer)) { +#if USE_MEMPOOL + _slang_free(var->initializer); +#else slang_alloc_free(var->initializer); +#endif var->initializer = NULL; slang_info_log_memory(C->L); return 0; @@ -1715,7 +1788,11 @@ parse_function(slang_parse_ctx * C, slang_output_ctx * O, int definition, if (found_func == NULL) { /* New function, add it to the function list */ O->funs->functions = +#if USE_MEMPOOL + (slang_function *) _slang_realloc(O->funs->functions, +#else (slang_function *) slang_alloc_realloc(O->funs->functions, +#endif O->funs->num_functions * sizeof(slang_function), (O->funs->num_functions + @@ -1862,6 +1939,8 @@ parse_code_unit(slang_parse_ctx * C, slang_code_unit * unit, C->I++; _slang_pop_var_table(o.vartable); + _slang_delete_var_table(o.vartable); + return GL_TRUE; } @@ -2121,6 +2200,8 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader) type = SLANG_UNIT_FRAGMENT_SHADER; } + ctx->Shader.MemPool = _slang_new_mempool(1024*1024); + /* XXX temporary hack */ if (!shader->Programs) { GLenum progTarget; @@ -2161,6 +2242,9 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader) slang_info_log_destruct(&info_log); _slang_code_object_dtr(&obj); + _slang_delete_mempool((slang_mempool *) ctx->Shader.MemPool); + ctx->Shader.MemPool = NULL; + return success; } diff --git a/src/mesa/shader/slang/slang_compile_function.c b/src/mesa/shader/slang/slang_compile_function.c index 2f74050b865..bb5be3feecd 100644 --- a/src/mesa/shader/slang/slang_compile_function.c +++ b/src/mesa/shader/slang/slang_compile_function.c @@ -30,6 +30,7 @@ #include "imports.h" #include "slang_compile.h" +#include "slang_mem.h" /* slang_fixup_table */ @@ -43,7 +44,11 @@ slang_fixup_table_init(slang_fixup_table * fix) void slang_fixup_table_free(slang_fixup_table * fix) { +#if USE_MEMPOOL + _slang_free(fix->table); +#else slang_alloc_free(fix->table); +#endif slang_fixup_table_init(fix); } @@ -54,7 +59,11 @@ GLboolean slang_fixup_save(slang_fixup_table *fixups, GLuint address) { fixups->table = (GLuint *) +#if USE_MEMPOOL + _slang_realloc(fixups->table, +#else slang_alloc_realloc(fixups->table, +#endif fixups->count * sizeof(GLuint), (fixups->count + 1) * sizeof(GLuint)); if (fixups->table == NULL) @@ -76,7 +85,11 @@ slang_function_construct(slang_function * func) return 0; func->parameters = (slang_variable_scope *) +#if USE_MEMPOOL + _slang_alloc(sizeof(slang_variable_scope)); +#else slang_alloc_malloc(sizeof(slang_variable_scope)); +#endif if (func->parameters == NULL) { slang_variable_destruct(&func->header); return 0; @@ -95,10 +108,18 @@ slang_function_destruct(slang_function * func) { slang_variable_destruct(&func->header); slang_variable_scope_destruct(func->parameters); +#if USE_MEMPOOL + _slang_free(func->parameters); +#else slang_alloc_free(func->parameters); +#endif if (func->body != NULL) { slang_operation_destruct(func->body); +#if USE_MEMPOOL + _slang_free(func->body); +#else slang_alloc_free(func->body); +#endif } slang_fixup_table_free(&func->fixups); } @@ -122,7 +143,11 @@ slang_function_scope_destruct(slang_function_scope * scope) for (i = 0; i < scope->num_functions; i++) slang_function_destruct(scope->functions + i); +#if USE_MEMPOOL + _slang_free(scope->functions); +#else slang_alloc_free(scope->functions); +#endif } diff --git a/src/mesa/shader/slang/slang_compile_operation.c b/src/mesa/shader/slang/slang_compile_operation.c index dfba1965ce6..c19a1b101bf 100644 --- a/src/mesa/shader/slang/slang_compile_operation.c +++ b/src/mesa/shader/slang/slang_compile_operation.c @@ -30,6 +30,7 @@ #include "imports.h" #include "slang_compile.h" +#include "slang_mem.h" /** @@ -60,9 +61,11 @@ slang_operation_destruct(slang_operation * oper) for (i = 0; i < oper->num_children; i++) slang_operation_destruct(oper->children + i); +#if !USE_MEMPOOL slang_alloc_free(oper->children); slang_variable_scope_destruct(oper->locals); slang_alloc_free(oper->locals); +#endif oper->children = NULL; oper->num_children = 0; oper->locals = NULL; @@ -82,7 +85,11 @@ slang_operation_copy(slang_operation * x, const slang_operation * y) return GL_FALSE; z.type = y->type; z.children = (slang_operation *) +#if USE_MEMPOOL + _slang_alloc(y->num_children * sizeof(slang_operation)); +#else slang_alloc_malloc(y->num_children * sizeof(slang_operation)); +#endif if (z.children == NULL) { slang_operation_destruct(&z); return GL_FALSE; @@ -128,7 +135,11 @@ slang_operation * slang_operation_new(GLuint count) { slang_operation *ops +#if USE_MEMPOOL + = (slang_operation *) _slang_alloc(count * sizeof(slang_operation)); +#else = (slang_operation *) _mesa_malloc(count * sizeof(slang_operation)); +#endif assert(count > 0); if (ops) { GLuint i; @@ -146,7 +157,9 @@ void slang_operation_delete(slang_operation *oper) { slang_operation_destruct(oper); +#if !USE_MEMPOOL _mesa_free(oper); +#endif } @@ -156,13 +169,19 @@ slang_operation_grow(GLuint *numChildren, slang_operation **children) slang_operation *ops; ops = (slang_operation *) +#if USE_MEMPOOL + _slang_realloc(*children, +#else slang_alloc_realloc(*children, +#endif *numChildren * sizeof(slang_operation), (*numChildren + 1) * sizeof(slang_operation)); if (ops) { slang_operation *newOp = ops + *numChildren; if (!slang_operation_construct(newOp)) { +#if !USE_MEMPOOL _mesa_free(ops); +#endif *children = NULL; return NULL; } @@ -189,7 +208,11 @@ slang_operation_insert(GLuint *numElements, slang_operation **array, assert(pos <= *numElements); ops = (slang_operation *) +#if USE_MEMPOOL + _slang_alloc((*numElements + 1) * sizeof(slang_operation)); +#else _mesa_malloc((*numElements + 1) * sizeof(slang_operation)); +#endif if (ops) { slang_operation *newOp; newOp = ops + pos; @@ -200,13 +223,17 @@ slang_operation_insert(GLuint *numElements, slang_operation **array, (*numElements - pos) * sizeof(slang_operation)); if (!slang_operation_construct(newOp)) { +#if !USE_MEMPOOL _mesa_free(ops); +#endif *numElements = 0; *array = NULL; return NULL; } +#if !USE_MEMPOOL if (*array) _mesa_free(*array); +#endif *array = ops; (*numElements)++; return newOp; diff --git a/src/mesa/shader/slang/slang_compile_struct.c b/src/mesa/shader/slang/slang_compile_struct.c index 89c79d431be..4a4773217a8 100644 --- a/src/mesa/shader/slang/slang_compile_struct.c +++ b/src/mesa/shader/slang/slang_compile_struct.c @@ -29,6 +29,7 @@ */ #include "imports.h" +#include "slang_mem.h" #include "slang_compile.h" @@ -47,7 +48,11 @@ slang_struct_scope_destruct(slang_struct_scope * scope) for (i = 0; i < scope->num_structs; i++) slang_struct_destruct(scope->structs + i); +#if USE_MEMPOOL + _slang_free(scope->structs); +#else slang_alloc_free(scope->structs); +#endif /* do not free scope->outer_scope */ } @@ -59,7 +64,11 @@ slang_struct_scope_copy(slang_struct_scope * x, const slang_struct_scope * y) _slang_struct_scope_ctr(&z); z.structs = +#if USE_MEMPOOL + (slang_struct *) _slang_alloc(y->num_structs * +#else (slang_struct *) slang_alloc_malloc(y->num_structs * +#endif sizeof(slang_struct)); if (z.structs == NULL) { slang_struct_scope_destruct(&z); @@ -102,16 +111,28 @@ slang_struct_construct(slang_struct * stru) { stru->a_name = SLANG_ATOM_NULL; stru->fields = (slang_variable_scope *) +#if USE_MEMPOOL + _slang_alloc(sizeof(slang_variable_scope)); +#else slang_alloc_malloc(sizeof(slang_variable_scope)); +#endif if (stru->fields == NULL) return 0; _slang_variable_scope_ctr(stru->fields); stru->structs = +#if USE_MEMPOOL + (slang_struct_scope *) _slang_alloc(sizeof(slang_struct_scope)); +#else (slang_struct_scope *) slang_alloc_malloc(sizeof(slang_struct_scope)); +#endif if (stru->structs == NULL) { slang_variable_scope_destruct(stru->fields); +#if USE_MEMPOOL + _slang_free(stru->fields); +#else slang_alloc_free(stru->fields); +#endif return 0; } _slang_struct_scope_ctr(stru->structs); @@ -122,9 +143,17 @@ void slang_struct_destruct(slang_struct * stru) { slang_variable_scope_destruct(stru->fields); +#if USE_MEMPOOL + _slang_free(stru->fields); +#else slang_alloc_free(stru->fields); +#endif slang_struct_scope_destruct(stru->structs); +#if USE_MEMPOOL + _slang_free(stru->structs); +#else slang_alloc_free(stru->structs); +#endif } int diff --git a/src/mesa/shader/slang/slang_compile_variable.c b/src/mesa/shader/slang/slang_compile_variable.c index 6632da9f8f3..aedf3d46632 100644 --- a/src/mesa/shader/slang/slang_compile_variable.c +++ b/src/mesa/shader/slang/slang_compile_variable.c @@ -30,8 +30,8 @@ #include "imports.h" #include "slang_compile.h" +#include "slang_mem.h" -/* slang_type_specifier_type */ typedef struct { @@ -135,10 +135,16 @@ slang_fully_specified_type_copy(slang_fully_specified_type * x, static slang_variable * slang_variable_new(void) { +#if USE_MEMPOOL + slang_variable *v = (slang_variable *) _slang_alloc(sizeof(slang_variable)); +#else slang_variable *v = (slang_variable *) malloc(sizeof(slang_variable)); +#endif if (v) { if (!slang_variable_construct(v)) { +#if !USE_MEMPOOL free(v); +#endif v = NULL; } } @@ -150,7 +156,9 @@ static void slang_variable_delete(slang_variable * var) { slang_variable_destruct(var); +#if !USE_MEMPOOL free(var); +#endif } @@ -162,7 +170,11 @@ slang_variable_scope * _slang_variable_scope_new(slang_variable_scope *parent) { slang_variable_scope *s; +#if USE_MEMPOOL + s = (slang_variable_scope *) _slang_alloc(sizeof(slang_variable_scope)); +#else s = (slang_variable_scope *) _mesa_calloc(sizeof(slang_variable_scope)); +#endif s->outer_scope = parent; return s; } @@ -187,7 +199,11 @@ slang_variable_scope_destruct(slang_variable_scope * scope) if (scope->variables[i]) slang_variable_delete(scope->variables[i]); } +#if USE_MEMPOOL + _slang_free(scope->variables); +#else slang_alloc_free(scope->variables); +#endif /* do not free scope->outer_scope */ } @@ -200,7 +216,11 @@ slang_variable_scope_copy(slang_variable_scope * x, _slang_variable_scope_ctr(&z); z.variables = (slang_variable **) +#if USE_MEMPOOL + _slang_alloc(y->num_variables * sizeof(slang_variable *)); +#else _mesa_calloc(y->num_variables * sizeof(slang_variable *)); +#endif if (z.variables == NULL) { slang_variable_scope_destruct(&z); return 0; @@ -235,7 +255,11 @@ slang_variable_scope_grow(slang_variable_scope *scope) { const int n = scope->num_variables; scope->variables = (slang_variable **) +#if USE_MEMPOOL + _slang_realloc(scope->variables, +#else slang_alloc_realloc(scope->variables, +#endif n * sizeof(slang_variable *), (n + 1) * sizeof(slang_variable *)); if (!scope->variables) @@ -276,7 +300,11 @@ slang_variable_destruct(slang_variable * var) slang_fully_specified_type_destruct(&var->type); if (var->initializer != NULL) { slang_operation_destruct(var->initializer); +#if USE_MEMPOOL + _slang_free(var->initializer); +#else slang_alloc_free(var->initializer); +#endif } #if 0 if (var->aux) { @@ -301,13 +329,19 @@ slang_variable_copy(slang_variable * x, const slang_variable * y) z.array_len = y->array_len; if (y->initializer != NULL) { z.initializer +#if USE_MEMPOOL + = (slang_operation *) _slang_alloc(sizeof(slang_operation)); +#else = (slang_operation *) slang_alloc_malloc(sizeof(slang_operation)); +#endif if (z.initializer == NULL) { slang_variable_destruct(&z); return 0; } if (!slang_operation_construct(z.initializer)) { +#if !USE_MEMPOOL slang_alloc_free(z.initializer); +#endif slang_variable_destruct(&z); return 0; } diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index badeb69b3fe..c6683720191 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -45,6 +45,7 @@ #include "prog_print.h" #include "slang_builtin.h" #include "slang_emit.h" +#include "slang_mem.h" #define PEEPHOLE_OPTIMIZATIONS 1 @@ -126,7 +127,11 @@ slang_ir_storage * _slang_new_ir_storage(enum register_file file, GLint index, GLint size) { slang_ir_storage *st; +#if USE_MEMPOOL + st = (slang_ir_storage *) _slang_alloc(sizeof(slang_ir_storage)); +#else st = (slang_ir_storage *) _mesa_calloc(sizeof(slang_ir_storage)); +#endif if (st) { st->File = file; st->Index = index; @@ -151,7 +156,11 @@ alloc_temp_storage(slang_emit_info *emitInfo, slang_ir_node *n, GLint size) if (!_slang_alloc_temp(emitInfo->vt, n->Store)) { slang_info_log_error(emitInfo->log, "Ran out of registers, too many temporaries"); +#if USE_MEMPOOL + _slang_free(n->Store); +#else _mesa_free(n->Store); +#endif n->Store = NULL; return GL_FALSE; } diff --git a/src/mesa/shader/slang/slang_ir.c b/src/mesa/shader/slang/slang_ir.c index 0c2e65ab5e3..b99866761f3 100644 --- a/src/mesa/shader/slang/slang_ir.c +++ b/src/mesa/shader/slang/slang_ir.c @@ -143,7 +143,7 @@ _slang_free_ir(slang_ir_node *n) if (n->Store) { n->Store->RefCount--; if (n->Store->RefCount == 0) { -#if 0 +#if !USE_MEMPOOL free(n->Store); #endif n->Store = NULL; @@ -153,7 +153,9 @@ _slang_free_ir(slang_ir_node *n) for (i = 0; i < 3; i++) _slang_free_ir(n->Children[i]); /* Do not free n->List since it's a child elsewhere */ +#if !USE_MEMPOOL free(n); +#endif } @@ -163,8 +165,10 @@ _slang_free_ir(slang_ir_node *n) void _slang_free_ir_tree(slang_ir_node *n) { +#if 0 _slang_refcount_storage(n); _slang_free_ir(n); +#endif } diff --git a/src/mesa/shader/slang/slang_label.c b/src/mesa/shader/slang/slang_label.c index e6a03f9e4f0..a4529be74fb 100644 --- a/src/mesa/shader/slang/slang_label.c +++ b/src/mesa/shader/slang/slang_label.c @@ -8,14 +8,24 @@ #include "slang_label.h" +#include "slang_mem.h" + slang_label * _slang_label_new(const char *name) { +#if !USE_MEMPOOL slang_label *l = (slang_label *) _mesa_calloc(sizeof(slang_label)); +#else + slang_label *l = (slang_label *) _slang_alloc(sizeof(slang_label)); +#endif if (l) { +#if !USE_MEMPOOL l->Name = _mesa_strdup(name); +#else + l->Name = _slang_strdup(name); +#endif l->Location = -1; } return l; @@ -28,9 +38,17 @@ slang_label * _slang_label_new_unique(const char *name) { static int id = 1; +#if !USE_MEMPOOL slang_label *l = (slang_label *) _mesa_calloc(sizeof(slang_label)); +#else + slang_label *l = (slang_label *) _slang_alloc(sizeof(slang_label)); +#endif if (l) { +#if !USE_MEMPOOL l->Name = (char *) _mesa_malloc(_mesa_strlen(name) + 10); +#else + l->Name = (char *) _slang_alloc(_mesa_strlen(name) + 10); +#endif if (!l->Name) { _mesa_free(l); return NULL; @@ -45,11 +63,13 @@ _slang_label_new_unique(const char *name) void _slang_label_delete(slang_label *l) { +#if !USE_MEMPOOL if (l->Name) _mesa_free(l->Name); if (l->References) _mesa_free(l->References); _mesa_free(l); +#endif } @@ -58,8 +78,13 @@ _slang_label_add_reference(slang_label *l, GLuint inst) { const GLuint oldSize = l->NumReferences * sizeof(GLuint); assert(l->Location < 0); +#if !USE_MEMPOOL l->References = _mesa_realloc(l->References, oldSize, oldSize + sizeof(GLuint)); +#else + l->References = _slang_realloc(l->References, + oldSize, oldSize + sizeof(GLuint)); +#endif if (l->References) { l->References[l->NumReferences] = inst; l->NumReferences++; @@ -92,7 +117,9 @@ _slang_label_set_location(slang_label *l, GLint location, } if (l->References) { +#if !USE_MEMPOOL _mesa_free(l->References); +#endif l->References = NULL; } } diff --git a/src/mesa/shader/slang/slang_log.c b/src/mesa/shader/slang/slang_log.c index e8387444914..e9234bafec7 100644 --- a/src/mesa/shader/slang/slang_log.c +++ b/src/mesa/shader/slang/slang_log.c @@ -42,7 +42,11 @@ void slang_info_log_destruct(slang_info_log * log) { if (!log->dont_free_text) +#if 0 slang_alloc_free(log->text); +#else + _mesa_free(log->text); +#endif } static int @@ -59,10 +63,18 @@ slang_info_log_message(slang_info_log * log, const char *prefix, if (log->text != NULL) { GLuint old_len = slang_string_length(log->text); log->text = (char *) +#if 0 slang_alloc_realloc(log->text, old_len + 1, old_len + size); +#else + _mesa_realloc(log->text, old_len + 1, old_len + size); +#endif } else { +#if 0 log->text = (char *) (slang_alloc_malloc(size)); +#else + log->text = (char *) (_mesa_malloc(size)); +#endif if (log->text != NULL) log->text[0] = '\0'; } diff --git a/src/mesa/shader/slang/slang_mem.c b/src/mesa/shader/slang/slang_mem.c index c7be9a7dc1a..e1d1e6ba14e 100644 --- a/src/mesa/shader/slang/slang_mem.c +++ b/src/mesa/shader/slang/slang_mem.c @@ -33,18 +33,33 @@ */ #include "context.h" +#include "macros.h" #include "slang_mem.h" + #define GRANULARITY 8 #define ROUND_UP(B) ( ((B) + (GRANULARITY - 1)) & ~(GRANULARITY - 1) ) +/** If 1, use conventional malloc/free. Helpful for debugging */ +#define USE_MALLOC_FREE 0 + + +struct slang_mempool_ +{ + GLuint Size, Used, Count, Largest; + char *Data; + struct slang_mempool_ *Next; +}; + + slang_mempool * _slang_new_mempool(GLuint initialSize) { slang_mempool *pool = (slang_mempool *) _mesa_calloc(sizeof(slang_mempool)); if (pool) { pool->Data = (char *) _mesa_calloc(initialSize); + /*printf("ALLOC MEMPOOL %d at %p\n", initialSize, pool->Data);*/ if (!pool->Data) { _mesa_free(pool); return NULL; @@ -62,13 +77,45 @@ _slang_delete_mempool(slang_mempool *pool) GLuint total = 0; while (pool) { slang_mempool *next = pool->Next; + /* + printf("DELETE MEMPOOL %u / %u count=%u largest=%u\n", + pool->Used, pool->Size, pool->Count, pool->Largest); + */ total += pool->Used; _mesa_free(pool->Data); _mesa_free(pool); pool = next; } - printf("TOTAL USED %u\n", total); + /*printf("TOTAL ALLOCATED: %u\n", total);*/ +} + + +#ifdef DEBUG +static void +check_zero(const char *addr, GLuint n) +{ + GLuint i; + for (i = 0; i < n; i++) { + assert(addr[i]==0); + } +} +#endif + + +#ifdef DEBUG +static GLboolean +is_valid_address(const slang_mempool *pool, void *addr) +{ + while (pool) { + if ((char *) addr >= pool->Data && + (char *) addr < pool->Data + pool->Used) + return GL_TRUE; + + pool = pool->Next; + } + return GL_FALSE; } +#endif /** @@ -77,16 +124,26 @@ _slang_delete_mempool(slang_mempool *pool) void * _slang_alloc(GLuint bytes) { +#if USE_MALLOC_FREE + return _mesa_calloc(bytes); +#else slang_mempool *pool; GET_CURRENT_CONTEXT(ctx); - pool = (slang_mempool *) ctx->Shader.MemPool; + if (bytes == 0) + bytes = 1; + while (pool) { if (pool->Used + bytes <= pool->Size) { /* found room */ void *addr = (void *) (pool->Data + pool->Used); +#ifdef DEBUG + check_zero((char*) addr, bytes); +#endif pool->Used += ROUND_UP(bytes); + pool->Largest = MAX2(pool->Largest, bytes); + pool->Count++; /*printf("alloc %u Used %u\n", bytes, pool->Used);*/ return addr; } @@ -96,30 +153,54 @@ _slang_alloc(GLuint bytes) } else { /* alloc new pool */ - assert(bytes <= pool->Size); /* XXX or max2() */ - pool->Next = _slang_new_mempool(pool->Size); + const GLuint sz = MAX2(bytes, pool->Size); + pool->Next = _slang_new_mempool(sz); if (!pool->Next) { /* we're _really_ out of memory */ return NULL; } else { + pool = pool->Next; + pool->Largest = bytes; + pool->Count++; pool->Used = ROUND_UP(bytes); +#ifdef DEBUG + check_zero((char*) pool->Data, bytes); +#endif return (void *) pool->Data; } } } return NULL; +#endif } void * _slang_realloc(void *oldBuffer, GLuint oldSize, GLuint newSize) { - const GLuint copySize = (oldSize < newSize) ? oldSize : newSize; - void *newBuffer = _slang_alloc(newSize); - if (newBuffer && oldBuffer && copySize > 0) - _mesa_memcpy(newBuffer, oldBuffer, copySize); - return newBuffer; +#if USE_MALLOC_FREE + return _mesa_realloc(oldBuffer, oldSize, newSize); +#else + GET_CURRENT_CONTEXT(ctx); + slang_mempool *pool = (slang_mempool *) ctx->Shader.MemPool; + + if (newSize < oldSize) { + return oldBuffer; + } + else { + const GLuint copySize = (oldSize < newSize) ? oldSize : newSize; + void *newBuffer = _slang_alloc(newSize); + + if (oldBuffer) + ASSERT(is_valid_address(pool, oldBuffer)); + + if (newBuffer && oldBuffer && copySize > 0) + _mesa_memcpy(newBuffer, oldBuffer, copySize); + + return newBuffer; + } +#endif } @@ -140,3 +221,21 @@ _slang_strdup(const char *s) return NULL; } } + + +/** + * Don't actually free memory, but mark it (for debugging). + */ +void +_slang_free(void *addr) +{ +#if USE_MALLOC_FREE + _mesa_free(addr); +#else + if (addr) { + GET_CURRENT_CONTEXT(ctx); + slang_mempool *pool = (slang_mempool *) ctx->Shader.MemPool; + ASSERT(is_valid_address(pool, addr)); + } +#endif +} diff --git a/src/mesa/shader/slang/slang_mem.h b/src/mesa/shader/slang/slang_mem.h index f44892666bf..a91c2b8791f 100644 --- a/src/mesa/shader/slang/slang_mem.h +++ b/src/mesa/shader/slang/slang_mem.h @@ -30,12 +30,7 @@ #include "imports.h" -typedef struct slang_mempool_ -{ - GLuint Size, Used; - char *Data; - struct slang_mempool_ *Next; -} slang_mempool; +typedef struct slang_mempool_ slang_mempool; extern slang_mempool * @@ -53,6 +48,9 @@ _slang_realloc(void *oldBuffer, GLuint oldSize, GLuint newSize); extern char * _slang_strdup(const char *s); +extern void +_slang_free(void *addr); + #define USE_MEMPOOL 1 /* XXX temporary */ diff --git a/src/mesa/shader/slang/slang_storage.c b/src/mesa/shader/slang/slang_storage.c index ecd60481b6b..e7fb63c289a 100644 --- a/src/mesa/shader/slang/slang_storage.c +++ b/src/mesa/shader/slang/slang_storage.c @@ -30,6 +30,7 @@ #include "imports.h" #include "slang_storage.h" +#include "slang_mem.h" /* slang_storage_array */ @@ -47,7 +48,11 @@ slang_storage_array_destruct(slang_storage_array * arr) { if (arr->aggregate != NULL) { slang_storage_aggregate_destruct(arr->aggregate); +#if USE_MEMPOOL + _slang_free(arr->aggregate); +#else slang_alloc_free(arr->aggregate); +#endif } } @@ -68,7 +73,11 @@ slang_storage_aggregate_destruct(slang_storage_aggregate * agg) for (i = 0; i < agg->count; i++) slang_storage_array_destruct(agg->arrays + i); +#if USE_MEMPOOL + _slang_free(agg->arrays); +#else slang_alloc_free(agg->arrays); +#endif } static slang_storage_array * @@ -77,7 +86,11 @@ slang_storage_aggregate_push_new(slang_storage_aggregate * agg) slang_storage_array *arr = NULL; agg->arrays = (slang_storage_array *) +#if USE_MEMPOOL + _slang_realloc(agg->arrays, +#else slang_alloc_realloc(agg->arrays, +#endif agg->count * sizeof(slang_storage_array), (agg->count + 1) * sizeof(slang_storage_array)); if (agg->arrays != NULL) { @@ -114,11 +127,19 @@ aggregate_matrix(slang_storage_aggregate * agg, slang_storage_type basic_type, arr->length = columns; arr->aggregate = (slang_storage_aggregate *) +#if USE_MEMPOOL + _slang_alloc(sizeof(slang_storage_aggregate)); +#else slang_alloc_malloc(sizeof(slang_storage_aggregate)); +#endif if (arr->aggregate == NULL) return GL_FALSE; if (!slang_storage_aggregate_construct(arr->aggregate)) { +#if USE_MEMPOOL + _slang_free(arr->aggregate); +#else slang_alloc_free(arr->aggregate); +#endif arr->aggregate = NULL; return GL_FALSE; } @@ -221,11 +242,19 @@ _slang_aggregate_variable(slang_storage_aggregate * agg, arr->type = SLANG_STORE_AGGREGATE; arr->aggregate = (slang_storage_aggregate *) +#if USE_MEMPOOL + _slang_alloc(sizeof(slang_storage_aggregate)); +#else slang_alloc_malloc(sizeof(slang_storage_aggregate)); +#endif if (arr->aggregate == NULL) return GL_FALSE; if (!slang_storage_aggregate_construct(arr->aggregate)) { +#if USE_MEMPOOL + _slang_free(arr->aggregate); +#else slang_alloc_free(arr->aggregate); +#endif arr->aggregate = NULL; return GL_FALSE; } diff --git a/src/mesa/shader/slang/slang_typeinfo.c b/src/mesa/shader/slang/slang_typeinfo.c index 957c302c5b3..c688423d8d2 100644 --- a/src/mesa/shader/slang/slang_typeinfo.c +++ b/src/mesa/shader/slang/slang_typeinfo.c @@ -32,6 +32,7 @@ #include "slang_typeinfo.h" #include "slang_compile.h" #include "slang_log.h" +#include "slang_mem.h" #include "prog_instruction.h" @@ -178,11 +179,19 @@ slang_type_specifier_dtr(slang_type_specifier * self) { if (self->_struct != NULL) { slang_struct_destruct(self->_struct); +#if USE_MEMPOOL + _slang_free(self->_struct); +#else slang_alloc_free(self->_struct); +#endif } if (self->_array != NULL) { slang_type_specifier_dtr(self->_array); +#if USE_MEMPOOL + _slang_free(self->_array); +#else slang_alloc_free(self->_array); +#endif } } @@ -195,13 +204,21 @@ slang_type_specifier_copy(slang_type_specifier * x, slang_type_specifier_ctr(&z); z.type = y->type; if (z.type == SLANG_SPEC_STRUCT) { +#if USE_MEMPOOL + z._struct = (slang_struct *) _slang_alloc(sizeof(slang_struct)); +#else z._struct = (slang_struct *) slang_alloc_malloc(sizeof(slang_struct)); +#endif if (z._struct == NULL) { slang_type_specifier_dtr(&z); return GL_FALSE; } if (!slang_struct_construct(z._struct)) { +#if USE_MEMPOOL + _slang_free(z._struct); +#else slang_alloc_free(z._struct); +#endif slang_type_specifier_dtr(&z); return GL_FALSE; } @@ -213,7 +230,11 @@ slang_type_specifier_copy(slang_type_specifier * x, else if (z.type == SLANG_SPEC_ARRAY) { z._array = (slang_type_specifier *) +#if USE_MEMPOOL + _slang_alloc(sizeof(slang_type_specifier)); +#else slang_alloc_malloc(sizeof(slang_type_specifier)); +#endif if (z._array == NULL) { slang_type_specifier_dtr(&z); return GL_FALSE; @@ -596,11 +617,19 @@ _slang_typeof_operation_(slang_operation * op, /* struct initializer */ ti->spec.type = SLANG_SPEC_STRUCT; ti->spec._struct = +#if USE_MEMPOOL + (slang_struct *) _slang_alloc(sizeof(slang_struct)); +#else (slang_struct *) slang_alloc_malloc(sizeof(slang_struct)); +#endif if (ti->spec._struct == NULL) return GL_FALSE; if (!slang_struct_construct(ti->spec._struct)) { +#if USE_MEMPOOL + _slang_free(ti->spec._struct); +#else slang_alloc_free(ti->spec._struct); +#endif ti->spec._struct = NULL; return GL_FALSE; } diff --git a/src/mesa/shader/slang/slang_utility.c b/src/mesa/shader/slang/slang_utility.c index 0fbfcc5840a..786b8990dfe 100644 --- a/src/mesa/shader/slang/slang_utility.c +++ b/src/mesa/shader/slang/slang_utility.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.6 + * Version: 6.5.3 * - * Copyright (C) 2005-2006 Brian Paul All Rights Reserved. + * Copyright (C) 2005-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"), @@ -30,6 +30,7 @@ #include "imports.h" #include "slang_utility.h" +#include "slang_mem.h" char * slang_string_concat (char *dst, const char *src) @@ -155,8 +156,13 @@ slang_atom_pool_destruct (slang_atom_pool * pool) slang_atom_entry *next; next = entry->next; +#if USE_MEMPOOL + _slang_free(entry->id); + _slang_free(entry); +#else slang_alloc_free(entry->id); slang_alloc_free(entry); +#endif entry = next; } } @@ -165,7 +171,8 @@ slang_atom_pool_destruct (slang_atom_pool * pool) /* * Search the atom pool for an atom with a given name. * If atom is not found, create and add it to the pool. - * Returns ATOM_NULL if the atom was not found and the function failed to create a new atom. + * Returns ATOM_NULL if the atom was not found and the function failed + * to create a new atom. */ slang_atom slang_atom_pool_atom(slang_atom_pool * pool, const char * id) @@ -187,8 +194,10 @@ slang_atom_pool_atom(slang_atom_pool * pool, const char * id) } hash %= SLANG_ATOM_POOL_SIZE; - /* Now the hash points to a linked list of atoms with names that have the same hash value. - * Search the linked list for a given name. */ + /* Now the hash points to a linked list of atoms with names that + * have the same hash value. Search the linked list for a given + * name. + */ entry = &pool->entries[hash]; while (*entry != NULL) { /* If the same, return the associated atom. */ @@ -199,15 +208,26 @@ slang_atom_pool_atom(slang_atom_pool * pool, const char * id) } /* Okay, we have not found an atom. Create a new entry for it. - * Note that the points to the last entry's field. */ + * Note that the points to the last entry's field. + */ +#if USE_MEMPOOL + *entry = (slang_atom_entry *) (_slang_alloc(sizeof(slang_atom_entry))); +#else *entry = (slang_atom_entry *) (slang_alloc_malloc(sizeof(slang_atom_entry))); +#endif if (*entry == NULL) return SLANG_ATOM_NULL; - /* Initialize a new entry. Because we'll need the actual name of the atom, we use the pointer - * to this string as an actual atom's value. */ + /* Initialize a new entry. Because we'll need the actual name of + * the atom, we use the pointer to this string as an actual atom's + * value. + */ (**entry).next = NULL; +#if USE_MEMPOOL + (**entry).id = _slang_strdup(id); +#else (**entry).id = slang_string_duplicate(id); +#endif if ((**entry).id == NULL) return SLANG_ATOM_NULL; return (slang_atom) (**entry).id; diff --git a/src/mesa/shader/slang/slang_utility.h b/src/mesa/shader/slang/slang_utility.h index 360241916f8..98a4cd59912 100644 --- a/src/mesa/shader/slang/slang_utility.h +++ b/src/mesa/shader/slang/slang_utility.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.6 + * Version: 6.5.3 * - * Copyright (C) 2005-2006 Brian Paul All Rights Reserved. + * Copyright (C) 2005-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"), @@ -22,21 +22,27 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#if !defined SLANG_UTILITY_H +#ifndef SLANG_UTILITY_H #define SLANG_UTILITY_H +#include "slang_mem.h" + /* Compile-time assertions. If the expression is zero, try to declare an * array of size [-1] to cause compilation error. */ #define static_assert(expr) do { int _array[(expr) ? 1 : -1]; (void) _array[0]; } while (0) +#if !USE_MEMPOOL #define slang_alloc_free(ptr) _mesa_free (ptr) #define slang_alloc_malloc(size) _mesa_malloc (size) #define slang_alloc_realloc(ptr, old_size, size) _mesa_realloc (ptr, old_size, size) +#endif #define slang_string_compare(str1, str2) _mesa_strcmp (str1, str2) #define slang_string_copy(dst, src) _mesa_strcpy (dst, src) +#if !USE_MEMPOOL #define slang_string_duplicate(src) _mesa_strdup (src) +#endif #define slang_string_length(str) _mesa_strlen (str) char *slang_string_concat (char *, const char *); diff --git a/src/mesa/shader/slang/slang_vartable.c b/src/mesa/shader/slang/slang_vartable.c index e3efa179085..27f8aeb4bde 100644 --- a/src/mesa/shader/slang/slang_vartable.c +++ b/src/mesa/shader/slang/slang_vartable.c @@ -2,6 +2,7 @@ #include "imports.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" @@ -49,7 +50,11 @@ slang_var_table * _slang_new_var_table(GLuint maxRegisters) { slang_var_table *vt +#if USE_MEMPOOL + = (slang_var_table *) _slang_alloc(sizeof(slang_var_table)); +#else = (slang_var_table *) _mesa_calloc(sizeof(slang_var_table)); +#endif if (vt) { vt->MaxRegisters = maxRegisters; } @@ -64,7 +69,9 @@ _slang_delete_var_table(slang_var_table *vt) _mesa_problem(NULL, "non-empty var table in _slang_delete_var_table()"); return; } +#if !USE_MEMPOOL _mesa_free(vt); +#endif } @@ -77,7 +84,11 @@ _slang_delete_var_table(slang_var_table *vt) void _slang_push_var_table(slang_var_table *vt) { +#if USE_MEMPOOL + struct table *t = (struct table *) _slang_alloc(sizeof(struct table)); +#else struct table *t = (struct table *) _mesa_calloc(sizeof(struct table)); +#endif if (t) { t->Level = vt->CurLevel++; t->Parent = vt->Top; @@ -137,10 +148,16 @@ _slang_pop_var_table(slang_var_table *vt) } if (t->Vars) +#if USE_MEMPOOL + t->Vars = NULL; +#else free(t->Vars); +#endif vt->Top = t->Parent; +#if !USE_MEMPOOL free(t); +#endif vt->CurLevel--; } @@ -156,7 +173,14 @@ _slang_add_variable(slang_var_table *vt, slang_variable *v) t = vt->Top; assert(t); if (dbg) printf("Adding var %s\n", (char *) v->a_name); +#if USE_MEMPOOL + t->Vars = + (slang_variable **) _slang_realloc(t->Vars, + t->NumVars * sizeof(slang_variable *), + (t->NumVars + 1) * sizeof(slang_variable *)); +#else t->Vars = realloc(t->Vars, (t->NumVars + 1) * sizeof(slang_variable *)); +#endif t->Vars[t->NumVars] = v; t->NumVars++; } -- cgit v1.2.3 From e261d66d81d47c4a2380ffcb7b39164b8e191168 Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 21 Apr 2007 12:29:46 -0600 Subject: Remove all the USE_MEMPOOL debug code. --- src/mesa/shader/slang/slang_codegen.c | 47 ++-------- src/mesa/shader/slang/slang_compile.c | 113 ++++-------------------- src/mesa/shader/slang/slang_compile_function.c | 28 +----- src/mesa/shader/slang/slang_compile_operation.c | 42 ++------- src/mesa/shader/slang/slang_compile_struct.c | 33 +------ src/mesa/shader/slang/slang_compile_variable.c | 47 ++-------- src/mesa/shader/slang/slang_emit.c | 8 -- src/mesa/shader/slang/slang_ir.c | 15 ++-- src/mesa/shader/slang/slang_label.c | 41 +++------ src/mesa/shader/slang/slang_mem.h | 2 - src/mesa/shader/slang/slang_storage.c | 38 +------- src/mesa/shader/slang/slang_typeinfo.c | 31 +------ src/mesa/shader/slang/slang_utility.c | 19 +--- src/mesa/shader/slang/slang_utility.h | 12 +-- src/mesa/shader/slang/slang_vartable.c | 36 ++------ 15 files changed, 78 insertions(+), 434 deletions(-) diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 71ef132e38b..ba97d6257bd 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -460,11 +460,7 @@ static slang_ir_node * new_node3(slang_ir_opcode op, slang_ir_node *c0, slang_ir_node *c1, slang_ir_node *c2) { -#if USE_MEMPOOL slang_ir_node *n = (slang_ir_node *) _slang_alloc(sizeof(slang_ir_node)); -#else - slang_ir_node *n = (slang_ir_node *) calloc(1, sizeof(slang_ir_node)); -#endif if (n) { n->Opcode = op; n->Children[0] = c0; @@ -927,21 +923,12 @@ slang_inline_function_call(slang_assemble_ctx * A, slang_function *fun, assert(fun->param_count == totalArgs); /* allocate temporary arrays */ -#if USE_MEMPOOL paramMode = (ParamMode *) _slang_alloc(totalArgs * sizeof(ParamMode)); substOld = (slang_variable **) _slang_alloc(totalArgs * sizeof(slang_variable *)); substNew = (slang_operation **) _slang_alloc(totalArgs * sizeof(slang_operation *)); -#else - paramMode = (ParamMode *) - _mesa_calloc(totalArgs * sizeof(ParamMode)); - substOld = (slang_variable **) - _mesa_calloc(totalArgs * sizeof(slang_variable *)); - substNew = (slang_operation **) - _mesa_calloc(totalArgs * sizeof(slang_operation *)); -#endif #if 0 printf("Inline call to %s (total vars=%d nparams=%d)\n", @@ -1142,11 +1129,9 @@ slang_inline_function_call(slang_assemble_ctx * A, slang_function *fun, } } -#if !USE_MEMPOOL - _mesa_free(paramMode); - _mesa_free(substOld); - _mesa_free(substNew); -#endif + _slang_free(paramMode); + _slang_free(substOld); + _slang_free(substNew); #if 0 printf("Done Inline call to %s (total vars=%d nparams=%d)\n", @@ -1204,9 +1189,7 @@ _slang_gen_function_call(slang_assemble_ctx *A, slang_function *fun, /* Replace the function call with the inlined block */ slang_operation_destruct(oper); *oper = *inlined; -#if !USE_MEMPOOL - _mesa_free(inlined); -#endif + _slang_free(inlined); #if 0 assert(inlined->locals); @@ -1336,9 +1319,7 @@ _slang_gen_asm(slang_assemble_ctx *A, slang_operation *oper, n->Store = n0->Store; n->Writemask = writemask; -#if !USE_MEMPOOL - free(n0); -#endif + _slang_free(n0); } return n; @@ -1779,11 +1760,9 @@ _slang_gen_temporary(GLint size) if (n) { n->Store = store; } -#if !USE_MEMPOOL else { - free(store); + _slang_free(store); } -#endif } return n; } @@ -1892,13 +1871,6 @@ _slang_gen_logical_and(slang_assemble_ctx *A, slang_operation *oper) select->children[2].literal_size = 1; n = _slang_gen_select(A, select); - -#if !USE_MEMPOOL - /* xxx wrong */ - free(select->children); - free(select); -#endif - return n; } @@ -1925,13 +1897,6 @@ _slang_gen_logical_or(slang_assemble_ctx *A, slang_operation *oper) slang_operation_copy(&select->children[2], &oper->children[1]); n = _slang_gen_select(A, select); - -#if !USE_MEMPOOL - /* xxx wrong */ - free(select->children); - free(select); -#endif - return n; } diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index d1c82a092d5..f23a29633bd 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -194,13 +194,9 @@ parse_float(slang_parse_ctx * C, float *number) parse_identifier_str(C, &fractional); parse_identifier_str(C, &exponent); -#if USE_MEMPOOL - whole = (char *) (_slang_alloc((_mesa_strlen(integral) + -#else - whole = (char *) (slang_alloc_malloc((_mesa_strlen(integral) + -#endif - _mesa_strlen(fractional) + - _mesa_strlen(exponent) + 3) * sizeof(char))); + whole = (char *) _slang_alloc((_mesa_strlen(integral) + + _mesa_strlen(fractional) + + _mesa_strlen(exponent) + 3) * sizeof(char)); if (whole == NULL) { slang_info_log_memory(C->L); return 0; @@ -214,11 +210,8 @@ parse_float(slang_parse_ctx * C, float *number) *number = (float) (_mesa_strtod(whole, (char **) NULL)); -#if USE_MEMPOOL _slang_free(whole); -#else - slang_alloc_free(whole); -#endif + return 1; } @@ -297,11 +290,7 @@ convert_to_array(slang_parse_ctx * C, slang_variable * var, * parse the expression */ var->type.specifier.type = SLANG_SPEC_ARRAY; var->type.specifier._array = (slang_type_specifier *) -#if USE_MEMPOOL _slang_alloc(sizeof(slang_type_specifier)); -#else - slang_alloc_malloc(sizeof(slang_type_specifier)); -#endif if (var->type.specifier._array == NULL) { slang_info_log_memory(C->L); return GL_FALSE; @@ -384,21 +373,13 @@ parse_struct(slang_parse_ctx * C, slang_output_ctx * O, slang_struct ** st) } /* set-up a new struct */ -#if USE_MEMPOOL *st = (slang_struct *) _slang_alloc(sizeof(slang_struct)); -#else - *st = (slang_struct *) slang_alloc_malloc(sizeof(slang_struct)); -#endif if (*st == NULL) { slang_info_log_memory(C->L); return 0; } if (!slang_struct_construct(*st)) { -#if USE_MEMPOOL _slang_free(*st); -#else - slang_alloc_free(*st); -#endif *st = NULL; slang_info_log_memory(C->L); return 0; @@ -424,15 +405,11 @@ parse_struct(slang_parse_ctx * C, slang_output_ctx * O, slang_struct ** st) slang_struct *s; O->structs->structs = -#if USE_MEMPOOL (slang_struct *) _slang_realloc(O->structs->structs, -#else - (slang_struct *) slang_alloc_realloc(O->structs->structs, -#endif - O->structs->num_structs * - sizeof(slang_struct), - (O->structs->num_structs + - 1) * sizeof(slang_struct)); + O->structs->num_structs + * sizeof(slang_struct), + (O->structs->num_structs + 1) + * sizeof(slang_struct)); if (O->structs->structs == NULL) { slang_info_log_memory(C->L); return 0; @@ -641,22 +618,13 @@ parse_type_specifier(slang_parse_ctx * C, slang_output_ctx * O, return 0; } - spec->_struct = -#if USE_MEMPOOL - (slang_struct *) _slang_alloc(sizeof(slang_struct)); -#else - (slang_struct *) slang_alloc_malloc(sizeof(slang_struct)); -#endif + spec->_struct = (slang_struct *) _slang_alloc(sizeof(slang_struct)); if (spec->_struct == NULL) { slang_info_log_memory(C->L); return 0; } if (!slang_struct_construct(spec->_struct)) { -#if USE_MEMPOOL _slang_free(spec->_struct); -#else - slang_alloc_free(spec->_struct); -#endif spec->_struct = NULL; return 0; } @@ -938,13 +906,9 @@ handle_nary_expression(slang_parse_ctx * C, slang_operation * op, *total_ops -= n; *ops = (slang_operation *) -#if USE_MEMPOOL _slang_realloc(*ops, -#else - slang_alloc_realloc(*ops, -#endif - (*total_ops + n) * sizeof(slang_operation), - *total_ops * sizeof(slang_operation)); + (*total_ops + n) * sizeof(slang_operation), + *total_ops * sizeof(slang_operation)); if (*ops == NULL) { slang_info_log_memory(C->L); return 0; @@ -975,13 +939,9 @@ parse_expression(slang_parse_ctx * C, slang_output_ctx * O, /* allocate default operation, becomes a no-op if not used */ ops = (slang_operation *) -#if USE_MEMPOOL _slang_realloc(ops, -#else - slang_alloc_realloc(ops, -#endif - num_ops * sizeof(slang_operation), - (num_ops + 1) * sizeof(slang_operation)); + num_ops * sizeof(slang_operation), + (num_ops + 1) * sizeof(slang_operation)); if (ops == NULL) { slang_info_log_memory(C->L); return 0; @@ -1223,11 +1183,7 @@ parse_expression(slang_parse_ctx * C, slang_output_ctx * O, slang_operation_destruct(oper); *oper = *ops; /* struct copy */ -#if USE_MEMPOOL _slang_free(ops); -#else - slang_alloc_free(ops); -#endif return 1; } @@ -1491,22 +1447,13 @@ parse_function_definition(slang_parse_ctx * C, slang_output_ctx * O, return 0; /* create function's body operation */ - func->body = -#if USE_MEMPOOL - (slang_operation *) _slang_alloc(sizeof(slang_operation)); -#else - (slang_operation *) slang_alloc_malloc(sizeof(slang_operation)); -#endif + func->body = (slang_operation *) _slang_alloc(sizeof(slang_operation)); if (func->body == NULL) { slang_info_log_memory(C->L); return 0; } if (!slang_operation_construct(func->body)) { -#if USE_MEMPOOL _slang_free(func->body); -#else - slang_alloc_free(func->body); -#endif func->body = NULL; slang_info_log_memory(C->L); return 0; @@ -1538,11 +1485,7 @@ initialize_global(slang_assemble_ctx * A, slang_variable * var) /* put the variable into operation's scope */ op_id.locals->variables = -#if USE_MEMPOOL (slang_variable **) _slang_alloc(sizeof(slang_variable *)); -#else - (slang_variable **) slang_alloc_malloc(sizeof(slang_variable *)); -#endif if (op_id.locals->variables == NULL) { slang_operation_destruct(&op_id); return GL_FALSE; @@ -1558,11 +1501,7 @@ initialize_global(slang_assemble_ctx * A, slang_variable * var) } op_assign.type = SLANG_OPER_ASSIGN; op_assign.children = -#if USE_MEMPOOL (slang_operation *) _slang_alloc(2 * sizeof(slang_operation)); -#else - (slang_operation *) slang_alloc_malloc(2 * sizeof(slang_operation)); -#endif if (op_assign.children == NULL) { slang_operation_destruct(&op_assign); op_id.locals->num_variables = 0; @@ -1577,11 +1516,7 @@ initialize_global(slang_assemble_ctx * A, slang_variable * var) /* carefully destroy the operations */ op_assign.num_children = 0; -#if USE_MEMPOOL _slang_free(op_assign.children); -#else - slang_alloc_free(op_assign.children); -#endif op_assign.children = NULL; slang_operation_destruct(&op_assign); op_id.locals->num_variables = 0; @@ -1642,21 +1577,13 @@ parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O, if (!slang_type_specifier_copy(&var->type.specifier, &type->specifier)) return 0; var->initializer = -#if USE_MEMPOOL (slang_operation *) _slang_alloc(sizeof(slang_operation)); -#else - (slang_operation *) slang_alloc_malloc(sizeof(slang_operation)); -#endif if (var->initializer == NULL) { slang_info_log_memory(C->L); return 0; } if (!slang_operation_construct(var->initializer)) { -#if USE_MEMPOOL _slang_free(var->initializer); -#else - slang_alloc_free(var->initializer); -#endif var->initializer = NULL; slang_info_log_memory(C->L); return 0; @@ -1788,15 +1715,11 @@ parse_function(slang_parse_ctx * C, slang_output_ctx * O, int definition, if (found_func == NULL) { /* New function, add it to the function list */ O->funs->functions = -#if USE_MEMPOOL (slang_function *) _slang_realloc(O->funs->functions, -#else - (slang_function *) slang_alloc_realloc(O->funs->functions, -#endif - O->funs->num_functions * - sizeof(slang_function), - (O->funs->num_functions + - 1) * sizeof(slang_function)); + O->funs->num_functions + * sizeof(slang_function), + (O->funs->num_functions + 1) + * sizeof(slang_function)); if (O->funs->functions == NULL) { slang_info_log_memory(C->L); slang_function_destruct(&parsed_func); diff --git a/src/mesa/shader/slang/slang_compile_function.c b/src/mesa/shader/slang/slang_compile_function.c index bb5be3feecd..80769b33ae8 100644 --- a/src/mesa/shader/slang/slang_compile_function.c +++ b/src/mesa/shader/slang/slang_compile_function.c @@ -44,11 +44,7 @@ slang_fixup_table_init(slang_fixup_table * fix) void slang_fixup_table_free(slang_fixup_table * fix) { -#if USE_MEMPOOL _slang_free(fix->table); -#else - slang_alloc_free(fix->table); -#endif slang_fixup_table_init(fix); } @@ -59,13 +55,9 @@ GLboolean slang_fixup_save(slang_fixup_table *fixups, GLuint address) { fixups->table = (GLuint *) -#if USE_MEMPOOL _slang_realloc(fixups->table, -#else - slang_alloc_realloc(fixups->table, -#endif - fixups->count * sizeof(GLuint), - (fixups->count + 1) * sizeof(GLuint)); + fixups->count * sizeof(GLuint), + (fixups->count + 1) * sizeof(GLuint)); if (fixups->table == NULL) return GL_FALSE; fixups->table[fixups->count] = address; @@ -85,11 +77,7 @@ slang_function_construct(slang_function * func) return 0; func->parameters = (slang_variable_scope *) -#if USE_MEMPOOL _slang_alloc(sizeof(slang_variable_scope)); -#else - slang_alloc_malloc(sizeof(slang_variable_scope)); -#endif if (func->parameters == NULL) { slang_variable_destruct(&func->header); return 0; @@ -108,18 +96,10 @@ slang_function_destruct(slang_function * func) { slang_variable_destruct(&func->header); slang_variable_scope_destruct(func->parameters); -#if USE_MEMPOOL _slang_free(func->parameters); -#else - slang_alloc_free(func->parameters); -#endif if (func->body != NULL) { slang_operation_destruct(func->body); -#if USE_MEMPOOL _slang_free(func->body); -#else - slang_alloc_free(func->body); -#endif } slang_fixup_table_free(&func->fixups); } @@ -143,11 +123,7 @@ slang_function_scope_destruct(slang_function_scope * scope) for (i = 0; i < scope->num_functions; i++) slang_function_destruct(scope->functions + i); -#if USE_MEMPOOL _slang_free(scope->functions); -#else - slang_alloc_free(scope->functions); -#endif } diff --git a/src/mesa/shader/slang/slang_compile_operation.c b/src/mesa/shader/slang/slang_compile_operation.c index c19a1b101bf..b18e08d2ae5 100644 --- a/src/mesa/shader/slang/slang_compile_operation.c +++ b/src/mesa/shader/slang/slang_compile_operation.c @@ -61,11 +61,9 @@ slang_operation_destruct(slang_operation * oper) for (i = 0; i < oper->num_children; i++) slang_operation_destruct(oper->children + i); -#if !USE_MEMPOOL - slang_alloc_free(oper->children); + _slang_free(oper->children); slang_variable_scope_destruct(oper->locals); - slang_alloc_free(oper->locals); -#endif + _slang_free(oper->locals); oper->children = NULL; oper->num_children = 0; oper->locals = NULL; @@ -85,11 +83,7 @@ slang_operation_copy(slang_operation * x, const slang_operation * y) return GL_FALSE; z.type = y->type; z.children = (slang_operation *) -#if USE_MEMPOOL _slang_alloc(y->num_children * sizeof(slang_operation)); -#else - slang_alloc_malloc(y->num_children * sizeof(slang_operation)); -#endif if (z.children == NULL) { slang_operation_destruct(&z); return GL_FALSE; @@ -135,11 +129,7 @@ slang_operation * slang_operation_new(GLuint count) { slang_operation *ops -#if USE_MEMPOOL = (slang_operation *) _slang_alloc(count * sizeof(slang_operation)); -#else - = (slang_operation *) _mesa_malloc(count * sizeof(slang_operation)); -#endif assert(count > 0); if (ops) { GLuint i; @@ -157,9 +147,7 @@ void slang_operation_delete(slang_operation *oper) { slang_operation_destruct(oper); -#if !USE_MEMPOOL - _mesa_free(oper); -#endif + _slang_free(oper); } @@ -169,19 +157,13 @@ slang_operation_grow(GLuint *numChildren, slang_operation **children) slang_operation *ops; ops = (slang_operation *) -#if USE_MEMPOOL _slang_realloc(*children, -#else - slang_alloc_realloc(*children, -#endif - *numChildren * sizeof(slang_operation), - (*numChildren + 1) * sizeof(slang_operation)); + *numChildren * sizeof(slang_operation), + (*numChildren + 1) * sizeof(slang_operation)); if (ops) { slang_operation *newOp = ops + *numChildren; if (!slang_operation_construct(newOp)) { -#if !USE_MEMPOOL - _mesa_free(ops); -#endif + _slang_free(ops); *children = NULL; return NULL; } @@ -208,11 +190,7 @@ slang_operation_insert(GLuint *numElements, slang_operation **array, assert(pos <= *numElements); ops = (slang_operation *) -#if USE_MEMPOOL _slang_alloc((*numElements + 1) * sizeof(slang_operation)); -#else - _mesa_malloc((*numElements + 1) * sizeof(slang_operation)); -#endif if (ops) { slang_operation *newOp; newOp = ops + pos; @@ -223,17 +201,13 @@ slang_operation_insert(GLuint *numElements, slang_operation **array, (*numElements - pos) * sizeof(slang_operation)); if (!slang_operation_construct(newOp)) { -#if !USE_MEMPOOL - _mesa_free(ops); -#endif + _slang_free(ops); *numElements = 0; *array = NULL; return NULL; } -#if !USE_MEMPOOL if (*array) - _mesa_free(*array); -#endif + _slang_free(*array); *array = ops; (*numElements)++; return newOp; diff --git a/src/mesa/shader/slang/slang_compile_struct.c b/src/mesa/shader/slang/slang_compile_struct.c index 4a4773217a8..97a34d24fe0 100644 --- a/src/mesa/shader/slang/slang_compile_struct.c +++ b/src/mesa/shader/slang/slang_compile_struct.c @@ -48,11 +48,7 @@ slang_struct_scope_destruct(slang_struct_scope * scope) for (i = 0; i < scope->num_structs; i++) slang_struct_destruct(scope->structs + i); -#if USE_MEMPOOL _slang_free(scope->structs); -#else - slang_alloc_free(scope->structs); -#endif /* do not free scope->outer_scope */ } @@ -63,13 +59,8 @@ slang_struct_scope_copy(slang_struct_scope * x, const slang_struct_scope * y) GLuint i; _slang_struct_scope_ctr(&z); - z.structs = -#if USE_MEMPOOL - (slang_struct *) _slang_alloc(y->num_structs * -#else - (slang_struct *) slang_alloc_malloc(y->num_structs * -#endif - sizeof(slang_struct)); + z.structs = (slang_struct *) + _slang_alloc(y->num_structs * sizeof(slang_struct)); if (z.structs == NULL) { slang_struct_scope_destruct(&z); return 0; @@ -111,28 +102,16 @@ slang_struct_construct(slang_struct * stru) { stru->a_name = SLANG_ATOM_NULL; stru->fields = (slang_variable_scope *) -#if USE_MEMPOOL _slang_alloc(sizeof(slang_variable_scope)); -#else - slang_alloc_malloc(sizeof(slang_variable_scope)); -#endif if (stru->fields == NULL) return 0; _slang_variable_scope_ctr(stru->fields); stru->structs = -#if USE_MEMPOOL (slang_struct_scope *) _slang_alloc(sizeof(slang_struct_scope)); -#else - (slang_struct_scope *) slang_alloc_malloc(sizeof(slang_struct_scope)); -#endif if (stru->structs == NULL) { slang_variable_scope_destruct(stru->fields); -#if USE_MEMPOOL _slang_free(stru->fields); -#else - slang_alloc_free(stru->fields); -#endif return 0; } _slang_struct_scope_ctr(stru->structs); @@ -143,17 +122,9 @@ void slang_struct_destruct(slang_struct * stru) { slang_variable_scope_destruct(stru->fields); -#if USE_MEMPOOL _slang_free(stru->fields); -#else - slang_alloc_free(stru->fields); -#endif slang_struct_scope_destruct(stru->structs); -#if USE_MEMPOOL _slang_free(stru->structs); -#else - slang_alloc_free(stru->structs); -#endif } int diff --git a/src/mesa/shader/slang/slang_compile_variable.c b/src/mesa/shader/slang/slang_compile_variable.c index aedf3d46632..d53255075f6 100644 --- a/src/mesa/shader/slang/slang_compile_variable.c +++ b/src/mesa/shader/slang/slang_compile_variable.c @@ -135,16 +135,10 @@ slang_fully_specified_type_copy(slang_fully_specified_type * x, static slang_variable * slang_variable_new(void) { -#if USE_MEMPOOL slang_variable *v = (slang_variable *) _slang_alloc(sizeof(slang_variable)); -#else - slang_variable *v = (slang_variable *) malloc(sizeof(slang_variable)); -#endif if (v) { if (!slang_variable_construct(v)) { -#if !USE_MEMPOOL - free(v); -#endif + _slang_free(v); v = NULL; } } @@ -156,9 +150,7 @@ static void slang_variable_delete(slang_variable * var) { slang_variable_destruct(var); -#if !USE_MEMPOOL - free(var); -#endif + _slang_free(var); } @@ -170,12 +162,9 @@ slang_variable_scope * _slang_variable_scope_new(slang_variable_scope *parent) { slang_variable_scope *s; -#if USE_MEMPOOL s = (slang_variable_scope *) _slang_alloc(sizeof(slang_variable_scope)); -#else - s = (slang_variable_scope *) _mesa_calloc(sizeof(slang_variable_scope)); -#endif - s->outer_scope = parent; + if (s) + s->outer_scope = parent; return s; } @@ -199,11 +188,7 @@ slang_variable_scope_destruct(slang_variable_scope * scope) if (scope->variables[i]) slang_variable_delete(scope->variables[i]); } -#if USE_MEMPOOL _slang_free(scope->variables); -#else - slang_alloc_free(scope->variables); -#endif /* do not free scope->outer_scope */ } @@ -216,11 +201,7 @@ slang_variable_scope_copy(slang_variable_scope * x, _slang_variable_scope_ctr(&z); z.variables = (slang_variable **) -#if USE_MEMPOOL _slang_alloc(y->num_variables * sizeof(slang_variable *)); -#else - _mesa_calloc(y->num_variables * sizeof(slang_variable *)); -#endif if (z.variables == NULL) { slang_variable_scope_destruct(&z); return 0; @@ -255,13 +236,9 @@ slang_variable_scope_grow(slang_variable_scope *scope) { const int n = scope->num_variables; scope->variables = (slang_variable **) -#if USE_MEMPOOL _slang_realloc(scope->variables, -#else - slang_alloc_realloc(scope->variables, -#endif - n * sizeof(slang_variable *), - (n + 1) * sizeof(slang_variable *)); + n * sizeof(slang_variable *), + (n + 1) * sizeof(slang_variable *)); if (!scope->variables) return NULL; @@ -300,11 +277,7 @@ slang_variable_destruct(slang_variable * var) slang_fully_specified_type_destruct(&var->type); if (var->initializer != NULL) { slang_operation_destruct(var->initializer); -#if USE_MEMPOOL _slang_free(var->initializer); -#else - slang_alloc_free(var->initializer); -#endif } #if 0 if (var->aux) { @@ -329,19 +302,13 @@ slang_variable_copy(slang_variable * x, const slang_variable * y) z.array_len = y->array_len; if (y->initializer != NULL) { z.initializer -#if USE_MEMPOOL = (slang_operation *) _slang_alloc(sizeof(slang_operation)); -#else - = (slang_operation *) slang_alloc_malloc(sizeof(slang_operation)); -#endif if (z.initializer == NULL) { slang_variable_destruct(&z); return 0; } if (!slang_operation_construct(z.initializer)) { -#if !USE_MEMPOOL - slang_alloc_free(z.initializer); -#endif + _slang_free(z.initializer); slang_variable_destruct(&z); return 0; } diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index c6683720191..7804e192360 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -127,11 +127,7 @@ slang_ir_storage * _slang_new_ir_storage(enum register_file file, GLint index, GLint size) { slang_ir_storage *st; -#if USE_MEMPOOL st = (slang_ir_storage *) _slang_alloc(sizeof(slang_ir_storage)); -#else - st = (slang_ir_storage *) _mesa_calloc(sizeof(slang_ir_storage)); -#endif if (st) { st->File = file; st->Index = index; @@ -156,11 +152,7 @@ alloc_temp_storage(slang_emit_info *emitInfo, slang_ir_node *n, GLint size) if (!_slang_alloc_temp(emitInfo->vt, n->Store)) { slang_info_log_error(emitInfo->log, "Ran out of registers, too many temporaries"); -#if USE_MEMPOOL _slang_free(n->Store); -#else - _mesa_free(n->Store); -#endif n->Store = NULL; return GL_FALSE; } diff --git a/src/mesa/shader/slang/slang_ir.c b/src/mesa/shader/slang/slang_ir.c index b99866761f3..9517bdf29da 100644 --- a/src/mesa/shader/slang/slang_ir.c +++ b/src/mesa/shader/slang/slang_ir.c @@ -26,6 +26,7 @@ #include "imports.h" #include "context.h" #include "slang_ir.h" +#include "slang_mem.h" #include "prog_print.h" @@ -113,6 +114,7 @@ _slang_ir_name(slang_ir_opcode opcode) } +#if 0 /* no longer needed with mempool */ /** * Since many IR nodes might point to the same IR storage info, we need * to be careful when deleting things. @@ -131,6 +133,7 @@ _slang_refcount_storage(slang_ir_node *n) for (i = 0; i < 3; i++) _slang_refcount_storage(n->Children[i]); } +#endif static void @@ -140,22 +143,20 @@ _slang_free_ir(slang_ir_node *n) if (!n) return; +#if 0 if (n->Store) { n->Store->RefCount--; if (n->Store->RefCount == 0) { -#if !USE_MEMPOOL - free(n->Store); -#endif + _slang_free(n->Store); n->Store = NULL; } } +#endif for (i = 0; i < 3; i++) _slang_free_ir(n->Children[i]); /* Do not free n->List since it's a child elsewhere */ -#if !USE_MEMPOOL - free(n); -#endif + _slang_free(n); } @@ -167,8 +168,8 @@ _slang_free_ir_tree(slang_ir_node *n) { #if 0 _slang_refcount_storage(n); - _slang_free_ir(n); #endif + _slang_free_ir(n); } diff --git a/src/mesa/shader/slang/slang_label.c b/src/mesa/shader/slang/slang_label.c index a4529be74fb..1ca1ef0c7c0 100644 --- a/src/mesa/shader/slang/slang_label.c +++ b/src/mesa/shader/slang/slang_label.c @@ -15,17 +15,9 @@ slang_label * _slang_label_new(const char *name) { -#if !USE_MEMPOOL - slang_label *l = (slang_label *) _mesa_calloc(sizeof(slang_label)); -#else slang_label *l = (slang_label *) _slang_alloc(sizeof(slang_label)); -#endif if (l) { -#if !USE_MEMPOOL - l->Name = _mesa_strdup(name); -#else l->Name = _slang_strdup(name); -#endif l->Location = -1; } return l; @@ -38,17 +30,9 @@ slang_label * _slang_label_new_unique(const char *name) { static int id = 1; -#if !USE_MEMPOOL - slang_label *l = (slang_label *) _mesa_calloc(sizeof(slang_label)); -#else slang_label *l = (slang_label *) _slang_alloc(sizeof(slang_label)); -#endif if (l) { -#if !USE_MEMPOOL - l->Name = (char *) _mesa_malloc(_mesa_strlen(name) + 10); -#else l->Name = (char *) _slang_alloc(_mesa_strlen(name) + 10); -#endif if (!l->Name) { _mesa_free(l); return NULL; @@ -63,13 +47,15 @@ _slang_label_new_unique(const char *name) void _slang_label_delete(slang_label *l) { -#if !USE_MEMPOOL - if (l->Name) - _mesa_free(l->Name); - if (l->References) - _mesa_free(l->References); - _mesa_free(l); -#endif + if (l->Name) { + _slang_free(l->Name); + l->Name = NULL; + } + if (l->References) { + _slang_free(l->References); + l->References = NULL; + } + _slang_free(l); } @@ -78,13 +64,8 @@ _slang_label_add_reference(slang_label *l, GLuint inst) { const GLuint oldSize = l->NumReferences * sizeof(GLuint); assert(l->Location < 0); -#if !USE_MEMPOOL - l->References = _mesa_realloc(l->References, - oldSize, oldSize + sizeof(GLuint)); -#else l->References = _slang_realloc(l->References, oldSize, oldSize + sizeof(GLuint)); -#endif if (l->References) { l->References[l->NumReferences] = inst; l->NumReferences++; @@ -117,9 +98,7 @@ _slang_label_set_location(slang_label *l, GLint location, } if (l->References) { -#if !USE_MEMPOOL - _mesa_free(l->References); -#endif + _slang_free(l->References); l->References = NULL; } } diff --git a/src/mesa/shader/slang/slang_mem.h b/src/mesa/shader/slang/slang_mem.h index a91c2b8791f..49885b6c982 100644 --- a/src/mesa/shader/slang/slang_mem.h +++ b/src/mesa/shader/slang/slang_mem.h @@ -52,6 +52,4 @@ extern void _slang_free(void *addr); -#define USE_MEMPOOL 1 /* XXX temporary */ - #endif diff --git a/src/mesa/shader/slang/slang_storage.c b/src/mesa/shader/slang/slang_storage.c index e7fb63c289a..bc32aa4b022 100644 --- a/src/mesa/shader/slang/slang_storage.c +++ b/src/mesa/shader/slang/slang_storage.c @@ -48,11 +48,7 @@ slang_storage_array_destruct(slang_storage_array * arr) { if (arr->aggregate != NULL) { slang_storage_aggregate_destruct(arr->aggregate); -#if USE_MEMPOOL _slang_free(arr->aggregate); -#else - slang_alloc_free(arr->aggregate); -#endif } } @@ -73,11 +69,7 @@ slang_storage_aggregate_destruct(slang_storage_aggregate * agg) for (i = 0; i < agg->count; i++) slang_storage_array_destruct(agg->arrays + i); -#if USE_MEMPOOL _slang_free(agg->arrays); -#else - slang_alloc_free(agg->arrays); -#endif } static slang_storage_array * @@ -86,13 +78,9 @@ slang_storage_aggregate_push_new(slang_storage_aggregate * agg) slang_storage_array *arr = NULL; agg->arrays = (slang_storage_array *) -#if USE_MEMPOOL _slang_realloc(agg->arrays, -#else - slang_alloc_realloc(agg->arrays, -#endif - agg->count * sizeof(slang_storage_array), - (agg->count + 1) * sizeof(slang_storage_array)); + agg->count * sizeof(slang_storage_array), + (agg->count + 1) * sizeof(slang_storage_array)); if (agg->arrays != NULL) { arr = agg->arrays + agg->count; if (!slang_storage_array_construct(arr)) @@ -125,21 +113,12 @@ aggregate_matrix(slang_storage_aggregate * agg, slang_storage_type basic_type, return GL_FALSE; arr->type = SLANG_STORE_AGGREGATE; arr->length = columns; - arr->aggregate = - (slang_storage_aggregate *) -#if USE_MEMPOOL + arr->aggregate = (slang_storage_aggregate *) _slang_alloc(sizeof(slang_storage_aggregate)); -#else - slang_alloc_malloc(sizeof(slang_storage_aggregate)); -#endif if (arr->aggregate == NULL) return GL_FALSE; if (!slang_storage_aggregate_construct(arr->aggregate)) { -#if USE_MEMPOOL _slang_free(arr->aggregate); -#else - slang_alloc_free(arr->aggregate); -#endif arr->aggregate = NULL; return GL_FALSE; } @@ -240,21 +219,12 @@ _slang_aggregate_variable(slang_storage_aggregate * agg, if (arr == NULL) return GL_FALSE; arr->type = SLANG_STORE_AGGREGATE; - arr->aggregate = - (slang_storage_aggregate *) -#if USE_MEMPOOL + arr->aggregate = (slang_storage_aggregate *) _slang_alloc(sizeof(slang_storage_aggregate)); -#else - slang_alloc_malloc(sizeof(slang_storage_aggregate)); -#endif if (arr->aggregate == NULL) return GL_FALSE; if (!slang_storage_aggregate_construct(arr->aggregate)) { -#if USE_MEMPOOL _slang_free(arr->aggregate); -#else - slang_alloc_free(arr->aggregate); -#endif arr->aggregate = NULL; return GL_FALSE; } diff --git a/src/mesa/shader/slang/slang_typeinfo.c b/src/mesa/shader/slang/slang_typeinfo.c index c688423d8d2..da0b32bc444 100644 --- a/src/mesa/shader/slang/slang_typeinfo.c +++ b/src/mesa/shader/slang/slang_typeinfo.c @@ -179,19 +179,11 @@ slang_type_specifier_dtr(slang_type_specifier * self) { if (self->_struct != NULL) { slang_struct_destruct(self->_struct); -#if USE_MEMPOOL _slang_free(self->_struct); -#else - slang_alloc_free(self->_struct); -#endif } if (self->_array != NULL) { slang_type_specifier_dtr(self->_array); -#if USE_MEMPOOL _slang_free(self->_array); -#else - slang_alloc_free(self->_array); -#endif } } @@ -204,21 +196,13 @@ slang_type_specifier_copy(slang_type_specifier * x, slang_type_specifier_ctr(&z); z.type = y->type; if (z.type == SLANG_SPEC_STRUCT) { -#if USE_MEMPOOL z._struct = (slang_struct *) _slang_alloc(sizeof(slang_struct)); -#else - z._struct = (slang_struct *) slang_alloc_malloc(sizeof(slang_struct)); -#endif if (z._struct == NULL) { slang_type_specifier_dtr(&z); return GL_FALSE; } if (!slang_struct_construct(z._struct)) { -#if USE_MEMPOOL _slang_free(z._struct); -#else - slang_alloc_free(z._struct); -#endif slang_type_specifier_dtr(&z); return GL_FALSE; } @@ -228,13 +212,8 @@ slang_type_specifier_copy(slang_type_specifier * x, } } else if (z.type == SLANG_SPEC_ARRAY) { - z._array = - (slang_type_specifier *) -#if USE_MEMPOOL + z._array = (slang_type_specifier *) _slang_alloc(sizeof(slang_type_specifier)); -#else - slang_alloc_malloc(sizeof(slang_type_specifier)); -#endif if (z._array == NULL) { slang_type_specifier_dtr(&z); return GL_FALSE; @@ -617,19 +596,11 @@ _slang_typeof_operation_(slang_operation * op, /* struct initializer */ ti->spec.type = SLANG_SPEC_STRUCT; ti->spec._struct = -#if USE_MEMPOOL (slang_struct *) _slang_alloc(sizeof(slang_struct)); -#else - (slang_struct *) slang_alloc_malloc(sizeof(slang_struct)); -#endif if (ti->spec._struct == NULL) return GL_FALSE; if (!slang_struct_construct(ti->spec._struct)) { -#if USE_MEMPOOL _slang_free(ti->spec._struct); -#else - slang_alloc_free(ti->spec._struct); -#endif ti->spec._struct = NULL; return GL_FALSE; } diff --git a/src/mesa/shader/slang/slang_utility.c b/src/mesa/shader/slang/slang_utility.c index 786b8990dfe..2a2dc8e54ff 100644 --- a/src/mesa/shader/slang/slang_utility.c +++ b/src/mesa/shader/slang/slang_utility.c @@ -153,16 +153,9 @@ slang_atom_pool_destruct (slang_atom_pool * pool) entry = pool->entries[i]; while (entry != NULL) { - slang_atom_entry *next; - - next = entry->next; -#if USE_MEMPOOL + slang_atom_entry *next = entry->next; _slang_free(entry->id); _slang_free(entry); -#else - slang_alloc_free(entry->id); - slang_alloc_free(entry); -#endif entry = next; } } @@ -210,11 +203,7 @@ slang_atom_pool_atom(slang_atom_pool * pool, const char * id) /* Okay, we have not found an atom. Create a new entry for it. * Note that the points to the last entry's field. */ -#if USE_MEMPOOL - *entry = (slang_atom_entry *) (_slang_alloc(sizeof(slang_atom_entry))); -#else - *entry = (slang_atom_entry *) (slang_alloc_malloc(sizeof(slang_atom_entry))); -#endif + *entry = (slang_atom_entry *) _slang_alloc(sizeof(slang_atom_entry)); if (*entry == NULL) return SLANG_ATOM_NULL; @@ -223,11 +212,7 @@ slang_atom_pool_atom(slang_atom_pool * pool, const char * id) * value. */ (**entry).next = NULL; -#if USE_MEMPOOL (**entry).id = _slang_strdup(id); -#else - (**entry).id = slang_string_duplicate(id); -#endif if ((**entry).id == NULL) return SLANG_ATOM_NULL; return (slang_atom) (**entry).id; diff --git a/src/mesa/shader/slang/slang_utility.h b/src/mesa/shader/slang/slang_utility.h index 98a4cd59912..032c5618107 100644 --- a/src/mesa/shader/slang/slang_utility.h +++ b/src/mesa/shader/slang/slang_utility.h @@ -25,24 +25,15 @@ #ifndef SLANG_UTILITY_H #define SLANG_UTILITY_H -#include "slang_mem.h" - /* Compile-time assertions. If the expression is zero, try to declare an * array of size [-1] to cause compilation error. */ #define static_assert(expr) do { int _array[(expr) ? 1 : -1]; (void) _array[0]; } while (0) -#if !USE_MEMPOOL -#define slang_alloc_free(ptr) _mesa_free (ptr) -#define slang_alloc_malloc(size) _mesa_malloc (size) -#define slang_alloc_realloc(ptr, old_size, size) _mesa_realloc (ptr, old_size, size) -#endif + #define slang_string_compare(str1, str2) _mesa_strcmp (str1, str2) #define slang_string_copy(dst, src) _mesa_strcpy (dst, src) -#if !USE_MEMPOOL -#define slang_string_duplicate(src) _mesa_strdup (src) -#endif #define slang_string_length(str) _mesa_strlen (str) char *slang_string_concat (char *, const char *); @@ -107,4 +98,3 @@ const char *slang_atom_pool_id (slang_atom_pool *, slang_atom); #endif - diff --git a/src/mesa/shader/slang/slang_vartable.c b/src/mesa/shader/slang/slang_vartable.c index 27f8aeb4bde..5814481ea79 100644 --- a/src/mesa/shader/slang/slang_vartable.c +++ b/src/mesa/shader/slang/slang_vartable.c @@ -50,11 +50,7 @@ slang_var_table * _slang_new_var_table(GLuint maxRegisters) { slang_var_table *vt -#if USE_MEMPOOL = (slang_var_table *) _slang_alloc(sizeof(slang_var_table)); -#else - = (slang_var_table *) _mesa_calloc(sizeof(slang_var_table)); -#endif if (vt) { vt->MaxRegisters = maxRegisters; } @@ -69,9 +65,7 @@ _slang_delete_var_table(slang_var_table *vt) _mesa_problem(NULL, "non-empty var table in _slang_delete_var_table()"); return; } -#if !USE_MEMPOOL - _mesa_free(vt); -#endif + _slang_free(vt); } @@ -84,11 +78,7 @@ _slang_delete_var_table(slang_var_table *vt) void _slang_push_var_table(slang_var_table *vt) { -#if USE_MEMPOOL struct table *t = (struct table *) _slang_alloc(sizeof(struct table)); -#else - struct table *t = (struct table *) _mesa_calloc(sizeof(struct table)); -#endif if (t) { t->Level = vt->CurLevel++; t->Parent = vt->Top; @@ -147,17 +137,13 @@ _slang_pop_var_table(slang_var_table *vt) } } - if (t->Vars) -#if USE_MEMPOOL + if (t->Vars) { + _slang_free(t->Vars); t->Vars = NULL; -#else - free(t->Vars); -#endif + } vt->Top = t->Parent; -#if !USE_MEMPOOL - free(t); -#endif + _slang_free(t); vt->CurLevel--; } @@ -173,14 +159,10 @@ _slang_add_variable(slang_var_table *vt, slang_variable *v) t = vt->Top; assert(t); if (dbg) printf("Adding var %s\n", (char *) v->a_name); -#if USE_MEMPOOL - t->Vars = - (slang_variable **) _slang_realloc(t->Vars, - t->NumVars * sizeof(slang_variable *), - (t->NumVars + 1) * sizeof(slang_variable *)); -#else - t->Vars = realloc(t->Vars, (t->NumVars + 1) * sizeof(slang_variable *)); -#endif + t->Vars = (slang_variable **) + _slang_realloc(t->Vars, + t->NumVars * sizeof(slang_variable *), + (t->NumVars + 1) * sizeof(slang_variable *)); t->Vars[t->NumVars] = v; t->NumVars++; } -- cgit v1.2.3 From fc3d6bd3519eac28d071ad6c3cfdf739a71921bb Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 21 Apr 2007 12:30:54 -0600 Subject: memory leaks fixed --- docs/shading.html | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/shading.html b/docs/shading.html index 64ec9990d0a..aa19c88d86d 100644 --- a/docs/shading.html +++ b/docs/shading.html @@ -67,7 +67,6 @@ All other major features of the shading language should function.
  • The quality of generated code is pretty good, register usage is fair.
  • Shader error detection and reporting of errors (InfoLog) is not very good yet. -
  • There are known memory leaks in the compiler.
  • The ftransform() function doesn't necessarily match the results of fixed-function transformation. -- cgit v1.2.3 From 2d2c6a622d07a690dedd2b21012f3fbf2347e982 Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 21 Apr 2007 12:31:51 -0600 Subject: prep for 6.5.3 rc2 --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index a656da5002a..a50ede01542 100644 --- a/Makefile +++ b/Makefile @@ -155,10 +155,10 @@ ultrix-gcc: # Rules for making release tarballs -DIRECTORY = Mesa-6.5.3rc1 -LIB_NAME = MesaLib-6.5.3rc1 -DEMO_NAME = MesaDemos-6.5.3rc1 -GLUT_NAME = MesaGLUT-6.5.3rc1 +DIRECTORY = Mesa-6.5.3rc2 +LIB_NAME = MesaLib-6.5.3rc2 +DEMO_NAME = MesaDemos-6.5.3rc2 +GLUT_NAME = MesaGLUT-6.5.3rc2 MAIN_FILES = \ $(DIRECTORY)/Makefile* \ -- cgit v1.2.3 From b3ab925e910defa0955cac1adb6167a0bff1076f Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 21 Apr 2007 12:36:39 -0600 Subject: Rename occlude.[ch] to queryobj.[ch] to better reflect contents. --- src/mesa/main/occlude.c | 538 ----------------------------------------------- src/mesa/main/occlude.h | 70 ------ src/mesa/main/queryobj.c | 538 +++++++++++++++++++++++++++++++++++++++++++++++ src/mesa/main/queryobj.h | 70 ++++++ 4 files changed, 608 insertions(+), 608 deletions(-) delete mode 100644 src/mesa/main/occlude.c delete mode 100644 src/mesa/main/occlude.h create mode 100644 src/mesa/main/queryobj.c create mode 100644 src/mesa/main/queryobj.h diff --git a/src/mesa/main/occlude.c b/src/mesa/main/occlude.c deleted file mode 100644 index 5fef4a800dc..00000000000 --- a/src/mesa/main/occlude.c +++ /dev/null @@ -1,538 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -#include "glheader.h" -#include "context.h" -#include "hash.h" -#include "imports.h" -#include "occlude.h" -#include "mtypes.h" - - -/** - * Allocate a new query object. This is a fallback routine called via - * ctx->Driver.NewQueryObject(). - * \param ctx - rendering context - * \param id - the new object's ID - * \return pointer to new query_object object or NULL if out of memory. - */ -struct gl_query_object * -_mesa_new_query_object(GLcontext *ctx, GLuint id) -{ - struct gl_query_object *q = MALLOC_STRUCT(gl_query_object); - (void) ctx; - if (q) { - q->Id = id; - q->Result = 0; - q->Active = GL_FALSE; - q->Ready = GL_TRUE; /* correct, see spec */ - } - return q; -} - - -/** - * Delete an occlusion query object. - * Not removed from hash table here. - * XXX maybe add Delete() method to gl_query_object class and call that instead - */ -static void -delete_query_object(struct gl_query_object *q) -{ - FREE(q); -} - - -static struct gl_query_object * -lookup_query_object(GLcontext *ctx, GLuint id) -{ - return (struct gl_query_object *) - _mesa_HashLookup(ctx->Query.QueryObjects, id); -} - - - -void GLAPIENTRY -_mesa_GenQueriesARB(GLsizei n, GLuint *ids) -{ - GLuint first; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (n < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGenQueriesARB(n < 0)"); - return; - } - - /* No query objects can be active at this time! */ - if (ctx->Query.CurrentOcclusionObject || - ctx->Query.CurrentTimerObject) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGenQueriesARB"); - return; - } - - first = _mesa_HashFindFreeKeyBlock(ctx->Query.QueryObjects, n); - if (first) { - GLsizei i; - for (i = 0; i < n; i++) { - struct gl_query_object *q - = ctx->Driver.NewQueryObject(ctx, first + i); - if (!q) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenQueriesARB"); - return; - } - ids[i] = first + i; - _mesa_HashInsert(ctx->Query.QueryObjects, first + i, q); - } - } -} - - -void GLAPIENTRY -_mesa_DeleteQueriesARB(GLsizei n, const GLuint *ids) -{ - GLint i; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (n < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteQueriesARB(n < 0)"); - return; - } - - /* No query objects can be active at this time! */ - if (ctx->Query.CurrentOcclusionObject || - ctx->Query.CurrentTimerObject) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glDeleteQueriesARB"); - return; - } - - for (i = 0; i < n; i++) { - if (ids[i] > 0) { - struct gl_query_object *q = lookup_query_object(ctx, ids[i]); - if (q) { - ASSERT(!q->Active); /* should be caught earlier */ - _mesa_HashRemove(ctx->Query.QueryObjects, ids[i]); - delete_query_object(q); - } - } - } -} - - -GLboolean GLAPIENTRY -_mesa_IsQueryARB(GLuint id) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - - if (id && lookup_query_object(ctx, id)) - return GL_TRUE; - else - return GL_FALSE; -} - - -void GLAPIENTRY -_mesa_BeginQueryARB(GLenum target, GLuint id) -{ - struct gl_query_object *q; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - FLUSH_VERTICES(ctx, _NEW_DEPTH); - - switch (target) { - case GL_SAMPLES_PASSED_ARB: - if (!ctx->Extensions.ARB_occlusion_query) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBeginQueryARB(target)"); - return; - } - if (ctx->Query.CurrentOcclusionObject) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glBeginQueryARB"); - return; - } - break; -#if FEATURE_EXT_timer_query - case GL_TIME_ELAPSED_EXT: - if (!ctx->Extensions.EXT_timer_query) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBeginQueryARB(target)"); - return; - } - if (ctx->Query.CurrentTimerObject) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glBeginQueryARB"); - return; - } - break; -#endif - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glBeginQueryARB(target)"); - return; - } - - if (id == 0) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glBeginQueryARB(id==0)"); - return; - } - - q = lookup_query_object(ctx, id); - if (!q) { - /* create new object */ - q = ctx->Driver.NewQueryObject(ctx, id); - if (!q) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBeginQueryARB"); - return; - } - _mesa_HashInsert(ctx->Query.QueryObjects, id, q); - } - else { - /* pre-existing object */ - if (q->Active) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBeginQueryARB(query already active)"); - return; - } - } - - q->Active = GL_TRUE; - q->Result = 0; - q->Ready = GL_FALSE; - - if (target == GL_SAMPLES_PASSED_ARB) { - ctx->Query.CurrentOcclusionObject = q; - } -#if FEATURE_EXT_timer_query - else if (target == GL_TIME_ELAPSED_EXT) { - ctx->Query.CurrentTimerObject = q; - } -#endif - - if (ctx->Driver.BeginQuery) { - ctx->Driver.BeginQuery(ctx, target, q); - } -} - - -void GLAPIENTRY -_mesa_EndQueryARB(GLenum target) -{ - struct gl_query_object *q; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - FLUSH_VERTICES(ctx, _NEW_DEPTH); - - switch (target) { - case GL_SAMPLES_PASSED_ARB: - if (!ctx->Extensions.ARB_occlusion_query) { - _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); - return; - } - q = ctx->Query.CurrentOcclusionObject; - ctx->Query.CurrentOcclusionObject = NULL; - break; -#if FEATURE_EXT_timer_query - case GL_TIME_ELAPSED_EXT: - if (!ctx->Extensions.EXT_timer_query) { - _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); - return; - } - q = ctx->Query.CurrentTimerObject; - ctx->Query.CurrentTimerObject = NULL; - break; -#endif - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); - return; - } - - if (!q || !q->Active) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glEndQueryARB(no matching glBeginQueryARB)"); - return; - } - - q->Active = GL_FALSE; - if (ctx->Driver.EndQuery) { - ctx->Driver.EndQuery(ctx, target, q); - } - else { - /* if we're using software rendering/querying */ - q->Ready = GL_TRUE; - } -} - - -void GLAPIENTRY -_mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params) -{ - struct gl_query_object *q; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - switch (target) { - case GL_SAMPLES_PASSED_ARB: - if (!ctx->Extensions.ARB_occlusion_query) { - _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); - return; - } - q = ctx->Query.CurrentOcclusionObject; - break; -#if FEATURE_EXT_timer_query - case GL_TIME_ELAPSED_EXT: - if (!ctx->Extensions.EXT_timer_query) { - _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); - return; - } - q = ctx->Query.CurrentTimerObject; - break; -#endif - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryivARB(target)"); - return; - } - - switch (pname) { - case GL_QUERY_COUNTER_BITS_ARB: - *params = 8 * sizeof(q->Result); - break; - case GL_CURRENT_QUERY_ARB: - *params = q ? q->Id : 0; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryivARB(pname)"); - return; - } -} - - -void GLAPIENTRY -_mesa_GetQueryObjectivARB(GLuint id, GLenum pname, GLint *params) -{ - struct gl_query_object *q = NULL; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (id) - q = lookup_query_object(ctx, id); - - if (!q || q->Active) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetQueryObjectivARB(id=%d is invalid or active)", id); - return; - } - - switch (pname) { - case GL_QUERY_RESULT_ARB: - while (!q->Ready) { - /* Wait for the query to finish! */ - /* If using software rendering, the result will always be ready - * by time we get here. Otherwise, we must be using hardware! - */ - ASSERT(ctx->Driver.EndQuery); - } - /* if result is too large for returned type, clamp to max value */ - if (q->Result > 0x7fffffff) { - *params = 0x7fffffff; - } - else { - *params = q->Result; - } - break; - case GL_QUERY_RESULT_AVAILABLE_ARB: - /* XXX revisit when we have a hardware implementation! */ - *params = q->Ready; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryObjectivARB(pname)"); - return; - } -} - - -void GLAPIENTRY -_mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params) -{ - struct gl_query_object *q = NULL; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (id) - q = lookup_query_object(ctx, id); - - if (!q || q->Active) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetQueryObjectuivARB(id=%d is invalid or active)", id); - return; - } - - switch (pname) { - case GL_QUERY_RESULT_ARB: - while (!q->Ready) { - /* Wait for the query to finish! */ - /* If using software rendering, the result will always be ready - * by time we get here. Otherwise, we must be using hardware! - */ - ASSERT(ctx->Driver.EndQuery); - } - /* if result is too large for returned type, clamp to max value */ - if (q->Result > 0xffffffff) { - *params = 0xffffffff; - } - else { - *params = q->Result; - } - break; - case GL_QUERY_RESULT_AVAILABLE_ARB: - /* XXX revisit when we have a hardware implementation! */ - *params = q->Ready; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryObjectuivARB(pname)"); - return; - } -} - - -#if FEATURE_EXT_timer_query - -/** - * New with GL_EXT_timer_query - */ -void GLAPIENTRY -_mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params) -{ - struct gl_query_object *q = NULL; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (id) - q = lookup_query_object(ctx, id); - - if (!q || q->Active) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetQueryObjectui64vARB(id=%d is invalid or active)", id); - return; - } - - switch (pname) { - case GL_QUERY_RESULT_ARB: - while (!q->Ready) { - /* Wait for the query to finish! */ - /* If using software rendering, the result will always be ready - * by time we get here. Otherwise, we must be using hardware! - */ - ASSERT(ctx->Driver.EndQuery); - } - *params = q->Result; - break; - case GL_QUERY_RESULT_AVAILABLE_ARB: - /* XXX revisit when we have a hardware implementation! */ - *params = q->Ready; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryObjecti64vARB(pname)"); - return; - } -} - - -/** - * New with GL_EXT_timer_query - */ -void GLAPIENTRY -_mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params) -{ - struct gl_query_object *q = NULL; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (id) - q = lookup_query_object(ctx, id); - - if (!q || q->Active) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetQueryObjectuui64vARB(id=%d is invalid or active)", id); - return; - } - - switch (pname) { - case GL_QUERY_RESULT_ARB: - while (!q->Ready) { - /* Wait for the query to finish! */ - /* If using software rendering, the result will always be ready - * by time we get here. Otherwise, we must be using hardware! - */ - ASSERT(ctx->Driver.EndQuery); - } - *params = q->Result; - break; - case GL_QUERY_RESULT_AVAILABLE_ARB: - /* XXX revisit when we have a hardware implementation! */ - *params = q->Ready; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryObjectui64vARB(pname)"); - return; - } -} - -#endif /* FEATURE_EXT_timer_query */ - - -/** - * Allocate/init the context state related to query objects. - */ -void -_mesa_init_query(GLcontext *ctx) -{ -#if FEATURE_ARB_occlusion_query - ctx->Query.QueryObjects = _mesa_NewHashTable(); - ctx->Query.CurrentOcclusionObject = NULL; -#endif -} - - -/** - * Callback for deleting a query object. Called by _mesa_HashDeleteAll(). - */ -static void -delete_queryobj_cb(GLuint id, void *data, void *userData) -{ - struct gl_query_object *q= (struct gl_query_object *) data; - (void) userData; - delete_query_object(q); -} - - -/** - * Free the context state related to query objects. - */ -void -_mesa_free_query_data(GLcontext *ctx) -{ - _mesa_HashDeleteAll(ctx->Query.QueryObjects, delete_queryobj_cb, NULL); - _mesa_DeleteHashTable(ctx->Query.QueryObjects); -} diff --git a/src/mesa/main/occlude.h b/src/mesa/main/occlude.h deleted file mode 100644 index ada8cf83560..00000000000 --- a/src/mesa/main/occlude.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -#ifndef OCCLUDE_H -#define OCCLUDE_H - - -extern struct gl_query_object * -_mesa_new_query_object(GLcontext *ctx, GLuint id); - -extern void -_mesa_init_query(GLcontext *ctx); - -extern void -_mesa_free_query_data(GLcontext *ctx); - -extern void GLAPIENTRY -_mesa_GenQueriesARB(GLsizei n, GLuint *ids); - -extern void GLAPIENTRY -_mesa_DeleteQueriesARB(GLsizei n, const GLuint *ids); - -extern GLboolean GLAPIENTRY -_mesa_IsQueryARB(GLuint id); - -extern void GLAPIENTRY -_mesa_BeginQueryARB(GLenum target, GLuint id); - -extern void GLAPIENTRY -_mesa_EndQueryARB(GLenum target); - -extern void GLAPIENTRY -_mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params); - -extern void GLAPIENTRY -_mesa_GetQueryObjectivARB(GLuint id, GLenum pname, GLint *params); - -extern void GLAPIENTRY -_mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params); - -extern void GLAPIENTRY -_mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params); - -extern void GLAPIENTRY -_mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params); - - -#endif /* OCCLUDE_H */ diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c new file mode 100644 index 00000000000..5fef4a800dc --- /dev/null +++ b/src/mesa/main/queryobj.c @@ -0,0 +1,538 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5.1 + * + * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +#include "glheader.h" +#include "context.h" +#include "hash.h" +#include "imports.h" +#include "occlude.h" +#include "mtypes.h" + + +/** + * Allocate a new query object. This is a fallback routine called via + * ctx->Driver.NewQueryObject(). + * \param ctx - rendering context + * \param id - the new object's ID + * \return pointer to new query_object object or NULL if out of memory. + */ +struct gl_query_object * +_mesa_new_query_object(GLcontext *ctx, GLuint id) +{ + struct gl_query_object *q = MALLOC_STRUCT(gl_query_object); + (void) ctx; + if (q) { + q->Id = id; + q->Result = 0; + q->Active = GL_FALSE; + q->Ready = GL_TRUE; /* correct, see spec */ + } + return q; +} + + +/** + * Delete an occlusion query object. + * Not removed from hash table here. + * XXX maybe add Delete() method to gl_query_object class and call that instead + */ +static void +delete_query_object(struct gl_query_object *q) +{ + FREE(q); +} + + +static struct gl_query_object * +lookup_query_object(GLcontext *ctx, GLuint id) +{ + return (struct gl_query_object *) + _mesa_HashLookup(ctx->Query.QueryObjects, id); +} + + + +void GLAPIENTRY +_mesa_GenQueriesARB(GLsizei n, GLuint *ids) +{ + GLuint first; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (n < 0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glGenQueriesARB(n < 0)"); + return; + } + + /* No query objects can be active at this time! */ + if (ctx->Query.CurrentOcclusionObject || + ctx->Query.CurrentTimerObject) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glGenQueriesARB"); + return; + } + + first = _mesa_HashFindFreeKeyBlock(ctx->Query.QueryObjects, n); + if (first) { + GLsizei i; + for (i = 0; i < n; i++) { + struct gl_query_object *q + = ctx->Driver.NewQueryObject(ctx, first + i); + if (!q) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenQueriesARB"); + return; + } + ids[i] = first + i; + _mesa_HashInsert(ctx->Query.QueryObjects, first + i, q); + } + } +} + + +void GLAPIENTRY +_mesa_DeleteQueriesARB(GLsizei n, const GLuint *ids) +{ + GLint i; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (n < 0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteQueriesARB(n < 0)"); + return; + } + + /* No query objects can be active at this time! */ + if (ctx->Query.CurrentOcclusionObject || + ctx->Query.CurrentTimerObject) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glDeleteQueriesARB"); + return; + } + + for (i = 0; i < n; i++) { + if (ids[i] > 0) { + struct gl_query_object *q = lookup_query_object(ctx, ids[i]); + if (q) { + ASSERT(!q->Active); /* should be caught earlier */ + _mesa_HashRemove(ctx->Query.QueryObjects, ids[i]); + delete_query_object(q); + } + } + } +} + + +GLboolean GLAPIENTRY +_mesa_IsQueryARB(GLuint id) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); + + if (id && lookup_query_object(ctx, id)) + return GL_TRUE; + else + return GL_FALSE; +} + + +void GLAPIENTRY +_mesa_BeginQueryARB(GLenum target, GLuint id) +{ + struct gl_query_object *q; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + FLUSH_VERTICES(ctx, _NEW_DEPTH); + + switch (target) { + case GL_SAMPLES_PASSED_ARB: + if (!ctx->Extensions.ARB_occlusion_query) { + _mesa_error(ctx, GL_INVALID_ENUM, "glBeginQueryARB(target)"); + return; + } + if (ctx->Query.CurrentOcclusionObject) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glBeginQueryARB"); + return; + } + break; +#if FEATURE_EXT_timer_query + case GL_TIME_ELAPSED_EXT: + if (!ctx->Extensions.EXT_timer_query) { + _mesa_error(ctx, GL_INVALID_ENUM, "glBeginQueryARB(target)"); + return; + } + if (ctx->Query.CurrentTimerObject) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glBeginQueryARB"); + return; + } + break; +#endif + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glBeginQueryARB(target)"); + return; + } + + if (id == 0) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glBeginQueryARB(id==0)"); + return; + } + + q = lookup_query_object(ctx, id); + if (!q) { + /* create new object */ + q = ctx->Driver.NewQueryObject(ctx, id); + if (!q) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBeginQueryARB"); + return; + } + _mesa_HashInsert(ctx->Query.QueryObjects, id, q); + } + else { + /* pre-existing object */ + if (q->Active) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glBeginQueryARB(query already active)"); + return; + } + } + + q->Active = GL_TRUE; + q->Result = 0; + q->Ready = GL_FALSE; + + if (target == GL_SAMPLES_PASSED_ARB) { + ctx->Query.CurrentOcclusionObject = q; + } +#if FEATURE_EXT_timer_query + else if (target == GL_TIME_ELAPSED_EXT) { + ctx->Query.CurrentTimerObject = q; + } +#endif + + if (ctx->Driver.BeginQuery) { + ctx->Driver.BeginQuery(ctx, target, q); + } +} + + +void GLAPIENTRY +_mesa_EndQueryARB(GLenum target) +{ + struct gl_query_object *q; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + FLUSH_VERTICES(ctx, _NEW_DEPTH); + + switch (target) { + case GL_SAMPLES_PASSED_ARB: + if (!ctx->Extensions.ARB_occlusion_query) { + _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); + return; + } + q = ctx->Query.CurrentOcclusionObject; + ctx->Query.CurrentOcclusionObject = NULL; + break; +#if FEATURE_EXT_timer_query + case GL_TIME_ELAPSED_EXT: + if (!ctx->Extensions.EXT_timer_query) { + _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); + return; + } + q = ctx->Query.CurrentTimerObject; + ctx->Query.CurrentTimerObject = NULL; + break; +#endif + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); + return; + } + + if (!q || !q->Active) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glEndQueryARB(no matching glBeginQueryARB)"); + return; + } + + q->Active = GL_FALSE; + if (ctx->Driver.EndQuery) { + ctx->Driver.EndQuery(ctx, target, q); + } + else { + /* if we're using software rendering/querying */ + q->Ready = GL_TRUE; + } +} + + +void GLAPIENTRY +_mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params) +{ + struct gl_query_object *q; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + switch (target) { + case GL_SAMPLES_PASSED_ARB: + if (!ctx->Extensions.ARB_occlusion_query) { + _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); + return; + } + q = ctx->Query.CurrentOcclusionObject; + break; +#if FEATURE_EXT_timer_query + case GL_TIME_ELAPSED_EXT: + if (!ctx->Extensions.EXT_timer_query) { + _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); + return; + } + q = ctx->Query.CurrentTimerObject; + break; +#endif + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryivARB(target)"); + return; + } + + switch (pname) { + case GL_QUERY_COUNTER_BITS_ARB: + *params = 8 * sizeof(q->Result); + break; + case GL_CURRENT_QUERY_ARB: + *params = q ? q->Id : 0; + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryivARB(pname)"); + return; + } +} + + +void GLAPIENTRY +_mesa_GetQueryObjectivARB(GLuint id, GLenum pname, GLint *params) +{ + struct gl_query_object *q = NULL; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (id) + q = lookup_query_object(ctx, id); + + if (!q || q->Active) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetQueryObjectivARB(id=%d is invalid or active)", id); + return; + } + + switch (pname) { + case GL_QUERY_RESULT_ARB: + while (!q->Ready) { + /* Wait for the query to finish! */ + /* If using software rendering, the result will always be ready + * by time we get here. Otherwise, we must be using hardware! + */ + ASSERT(ctx->Driver.EndQuery); + } + /* if result is too large for returned type, clamp to max value */ + if (q->Result > 0x7fffffff) { + *params = 0x7fffffff; + } + else { + *params = q->Result; + } + break; + case GL_QUERY_RESULT_AVAILABLE_ARB: + /* XXX revisit when we have a hardware implementation! */ + *params = q->Ready; + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryObjectivARB(pname)"); + return; + } +} + + +void GLAPIENTRY +_mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params) +{ + struct gl_query_object *q = NULL; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (id) + q = lookup_query_object(ctx, id); + + if (!q || q->Active) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetQueryObjectuivARB(id=%d is invalid or active)", id); + return; + } + + switch (pname) { + case GL_QUERY_RESULT_ARB: + while (!q->Ready) { + /* Wait for the query to finish! */ + /* If using software rendering, the result will always be ready + * by time we get here. Otherwise, we must be using hardware! + */ + ASSERT(ctx->Driver.EndQuery); + } + /* if result is too large for returned type, clamp to max value */ + if (q->Result > 0xffffffff) { + *params = 0xffffffff; + } + else { + *params = q->Result; + } + break; + case GL_QUERY_RESULT_AVAILABLE_ARB: + /* XXX revisit when we have a hardware implementation! */ + *params = q->Ready; + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryObjectuivARB(pname)"); + return; + } +} + + +#if FEATURE_EXT_timer_query + +/** + * New with GL_EXT_timer_query + */ +void GLAPIENTRY +_mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params) +{ + struct gl_query_object *q = NULL; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (id) + q = lookup_query_object(ctx, id); + + if (!q || q->Active) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetQueryObjectui64vARB(id=%d is invalid or active)", id); + return; + } + + switch (pname) { + case GL_QUERY_RESULT_ARB: + while (!q->Ready) { + /* Wait for the query to finish! */ + /* If using software rendering, the result will always be ready + * by time we get here. Otherwise, we must be using hardware! + */ + ASSERT(ctx->Driver.EndQuery); + } + *params = q->Result; + break; + case GL_QUERY_RESULT_AVAILABLE_ARB: + /* XXX revisit when we have a hardware implementation! */ + *params = q->Ready; + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryObjecti64vARB(pname)"); + return; + } +} + + +/** + * New with GL_EXT_timer_query + */ +void GLAPIENTRY +_mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params) +{ + struct gl_query_object *q = NULL; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (id) + q = lookup_query_object(ctx, id); + + if (!q || q->Active) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetQueryObjectuui64vARB(id=%d is invalid or active)", id); + return; + } + + switch (pname) { + case GL_QUERY_RESULT_ARB: + while (!q->Ready) { + /* Wait for the query to finish! */ + /* If using software rendering, the result will always be ready + * by time we get here. Otherwise, we must be using hardware! + */ + ASSERT(ctx->Driver.EndQuery); + } + *params = q->Result; + break; + case GL_QUERY_RESULT_AVAILABLE_ARB: + /* XXX revisit when we have a hardware implementation! */ + *params = q->Ready; + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryObjectui64vARB(pname)"); + return; + } +} + +#endif /* FEATURE_EXT_timer_query */ + + +/** + * Allocate/init the context state related to query objects. + */ +void +_mesa_init_query(GLcontext *ctx) +{ +#if FEATURE_ARB_occlusion_query + ctx->Query.QueryObjects = _mesa_NewHashTable(); + ctx->Query.CurrentOcclusionObject = NULL; +#endif +} + + +/** + * Callback for deleting a query object. Called by _mesa_HashDeleteAll(). + */ +static void +delete_queryobj_cb(GLuint id, void *data, void *userData) +{ + struct gl_query_object *q= (struct gl_query_object *) data; + (void) userData; + delete_query_object(q); +} + + +/** + * Free the context state related to query objects. + */ +void +_mesa_free_query_data(GLcontext *ctx) +{ + _mesa_HashDeleteAll(ctx->Query.QueryObjects, delete_queryobj_cb, NULL); + _mesa_DeleteHashTable(ctx->Query.QueryObjects); +} diff --git a/src/mesa/main/queryobj.h b/src/mesa/main/queryobj.h new file mode 100644 index 00000000000..ada8cf83560 --- /dev/null +++ b/src/mesa/main/queryobj.h @@ -0,0 +1,70 @@ +/* + * Mesa 3-D graphics library + * Version: 6.5 + * + * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +#ifndef OCCLUDE_H +#define OCCLUDE_H + + +extern struct gl_query_object * +_mesa_new_query_object(GLcontext *ctx, GLuint id); + +extern void +_mesa_init_query(GLcontext *ctx); + +extern void +_mesa_free_query_data(GLcontext *ctx); + +extern void GLAPIENTRY +_mesa_GenQueriesARB(GLsizei n, GLuint *ids); + +extern void GLAPIENTRY +_mesa_DeleteQueriesARB(GLsizei n, const GLuint *ids); + +extern GLboolean GLAPIENTRY +_mesa_IsQueryARB(GLuint id); + +extern void GLAPIENTRY +_mesa_BeginQueryARB(GLenum target, GLuint id); + +extern void GLAPIENTRY +_mesa_EndQueryARB(GLenum target); + +extern void GLAPIENTRY +_mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params); + +extern void GLAPIENTRY +_mesa_GetQueryObjectivARB(GLuint id, GLenum pname, GLint *params); + +extern void GLAPIENTRY +_mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params); + +extern void GLAPIENTRY +_mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params); + +extern void GLAPIENTRY +_mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params); + + +#endif /* OCCLUDE_H */ -- cgit v1.2.3 From 74afcabd8599565c1b6d06ea5f355662a81c3778 Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 21 Apr 2007 12:42:54 -0600 Subject: Rename occlude.[ch] to queryobj.[ch] --- src/mesa/main/context.c | 2 +- src/mesa/main/dlist.c | 2 +- src/mesa/main/queryobj.c | 2 +- src/mesa/main/state.c | 6 +++--- src/mesa/sources | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 9dc7b11e361..ace68499d79 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -107,13 +107,13 @@ #include "lines.h" #include "macros.h" #include "matrix.h" -#include "occlude.h" #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" #include "state.h" diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 49bc2933bf5..c8c68214ce8 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -66,10 +66,10 @@ #include "dlist.h" #include "macros.h" #include "matrix.h" -#include "occlude.h" #include "pixel.h" #include "points.h" #include "polygon.h" +#include "queryobj.h" #include "state.h" #include "texobj.h" #include "teximage.h" diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c index 5fef4a800dc..0e59ba615a7 100644 --- a/src/mesa/main/queryobj.c +++ b/src/mesa/main/queryobj.c @@ -27,7 +27,7 @@ #include "context.h" #include "hash.h" #include "imports.h" -#include "occlude.h" +#include "queryobj.h" #include "mtypes.h" diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 9ae71c57383..32af3ccc620 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -70,12 +70,12 @@ #include "lines.h" #include "macros.h" #include "matrix.h" -#if FEATURE_ARB_occlusion_query || FEATURE_EXT_timer_query -#include "occlude.h" -#endif #include "pixel.h" #include "points.h" #include "polygon.h" +#if FEATURE_ARB_occlusion_query || FEATURE_EXT_timer_query +#include "queryobj.h" +#endif #include "rastpos.h" #include "state.h" #include "stencil.h" diff --git a/src/mesa/sources b/src/mesa/sources index 0066c591644..dbfc01d0edf 100644 --- a/src/mesa/sources +++ b/src/mesa/sources @@ -41,10 +41,10 @@ MAIN_SOURCES = \ main/matrix.c \ main/mipmap.c \ main/mm.c \ - main/occlude.c \ main/pixel.c \ main/points.c \ main/polygon.c \ + main/queryobj.c \ main/rastpos.c \ main/rbadaptors.c \ main/renderbuffer.c \ -- cgit v1.2.3 From b1502588c4755fa9d3d7b4eabed6332575033037 Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 21 Apr 2007 12:54:23 -0600 Subject: s/occlude.h/queryobj.h/ --- src/mesa/drivers/common/driverfuncs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index f543de183a1..adf9aafe596 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -28,9 +28,9 @@ #include "buffers.h" #include "context.h" #include "framebuffer.h" -#include "occlude.h" #include "program.h" #include "prog_execute.h" +#include "queryobj.h" #include "renderbuffer.h" #include "texcompress.h" #include "texformat.h" -- cgit v1.2.3 From b5e9b0e56231065f6324bbd3c2c35ca53b46ddf8 Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 21 Apr 2007 13:18:06 -0600 Subject: Remove the !rb->Data check that was added a few months ago. Was changed while debugging #7205. Broke the shadowtext demo. Revisit this if the problem w/ bug 7205 returns... --- src/mesa/swrast/s_depth.c | 2 +- src/mesa/swrast/s_stencil.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c index dde2b1db83a..408174c990f 100644 --- a/src/mesa/swrast/s_depth.c +++ b/src/mesa/swrast/s_depth.c @@ -1350,7 +1350,7 @@ _swrast_clear_depth_buffer( GLcontext *ctx, struct gl_renderbuffer *rb ) GLuint clearValue; GLint x, y, width, height; - if (!rb || !ctx->Depth.Mask || !rb->Data) { + if (!rb || !ctx->Depth.Mask) { /* no depth buffer, or writing to it is disabled */ return; } diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c index 2b898486b22..89991fad02d 100644 --- a/src/mesa/swrast/s_stencil.c +++ b/src/mesa/swrast/s_stencil.c @@ -1152,7 +1152,7 @@ _swrast_clear_stencil_buffer( GLcontext *ctx, struct gl_renderbuffer *rb ) const GLuint stencilMax = (1 << stencilBits) - 1; GLint x, y, width, height; - if (!rb || mask == 0 || !rb->Data) + if (!rb || mask == 0) return; ASSERT(rb->DataType == GL_UNSIGNED_BYTE || -- cgit v1.2.3 From e5cf37c1786057252a4db28d4ae75bd24a0e020b Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 21 Apr 2007 14:12:57 -0600 Subject: fix SkipPixels bugs in _mesa_pack_bitmap(), bug 10690 --- src/mesa/main/image.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index dcd7f10b26e..2220e39f7d7 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -955,8 +955,8 @@ _mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source, /* handling SkipPixels is a bit tricky (no pun intended!) */ GLint i; if (packing->LsbFirst) { - GLubyte srcMask = 1 << (packing->SkipPixels & 0x7); - GLubyte dstMask = 128; + GLubyte srcMask = 128; + GLubyte dstMask = 1 << (packing->SkipPixels & 0x7); const GLubyte *s = src; GLubyte *d = dst; *d = 0; @@ -982,8 +982,8 @@ _mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source, } } else { - GLubyte srcMask = 128 >> (packing->SkipPixels & 0x7); - GLubyte dstMask = 128; + GLubyte srcMask = 128; + GLubyte dstMask = 128 >> (packing->SkipPixels & 0x7); const GLubyte *s = src; GLubyte *d = dst; *d = 0; -- cgit v1.2.3 From 112e1f2b5ab86626eb9b3de9075e9f165a397e7b Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 21 Apr 2007 15:56:10 -0600 Subject: specularColor.alpha should default to 1, not 0 --- src/mesa/main/rastpos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c index 4a0c24fdbcc..2d71014a187 100644 --- a/src/mesa/main/rastpos.c +++ b/src/mesa/main/rastpos.c @@ -138,7 +138,7 @@ shade_rastpos(GLcontext *ctx, COPY_3V(diffuseColor, base[0]); diffuseColor[3] = CLAMP( ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3], 0.0F, 1.0F ); - ASSIGN_4V(specularColor, 0.0, 0.0, 0.0, 0.0); + ASSIGN_4V(specularColor, 0.0, 0.0, 0.0, 1.0); foreach (light, &ctx->Light.EnabledList) { GLfloat attenuation = 1.0; -- cgit v1.2.3 From f793e90e823a58c0408771c38f3a6209f78a3617 Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 21 Apr 2007 15:58:37 -0600 Subject: Fix color sum bug 10688. --- src/mesa/swrast/s_bitmap.c | 3 +-- src/mesa/swrast/s_copypix.c | 9 +++------ src/mesa/swrast/s_drawpix.c | 9 +++------ src/mesa/swrast/s_span.c | 7 ++++++- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/mesa/swrast/s_bitmap.c b/src/mesa/swrast/s_bitmap.c index 59c42e524f0..4c237052457 100644 --- a/src/mesa/swrast/s_bitmap.c +++ b/src/mesa/swrast/s_bitmap.c @@ -85,8 +85,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_XY); _swrast_span_default_color(ctx, &span); - if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) - _swrast_span_default_secondary_color(ctx, &span); + _swrast_span_default_secondary_color(ctx, &span); if (ctx->Depth.Test) _swrast_span_default_z(ctx, &span); if (swrast->_FogEnabled) diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index dbbfc58c6fd..012839cb88a 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -109,8 +109,7 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, _swrast_span_default_z(ctx, &span); if (swrast->_FogEnabled) _swrast_span_default_fog(ctx, &span); - if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) - _swrast_span_default_secondary_color(ctx, &span); + _swrast_span_default_secondary_color(ctx, &span); /* allocate space for GLfloat image */ tmpImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); @@ -245,8 +244,7 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, _swrast_span_default_z(ctx, &span); if (swrast->_FogEnabled) _swrast_span_default_fog(ctx, &span); - if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) - _swrast_span_default_secondary_color(ctx, &span); + _swrast_span_default_secondary_color(ctx, &span); if (overlapping) { tmpImage = (GLfloat *) _mesa_malloc(width * height * sizeof(GLfloat) * 4); @@ -492,8 +490,7 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, } _swrast_span_default_color(ctx, &span); - if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) - _swrast_span_default_secondary_color(ctx, &span); + _swrast_span_default_secondary_color(ctx, &span); if (swrast->_FogEnabled) _swrast_span_default_fog(ctx, &span); diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index 70b57b917c9..cd5b7bc2935 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -71,8 +71,7 @@ fast_draw_rgba_pixels(GLcontext *ctx, GLint x, GLint y, } INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA); - if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) - _swrast_span_default_secondary_color(ctx, &span); + _swrast_span_default_secondary_color(ctx, &span); if (ctx->Depth.Test) _swrast_span_default_z(ctx, &span); if (swrast->_FogEnabled) @@ -443,8 +442,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_Z); _swrast_span_default_color(ctx, &span); - if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) - _swrast_span_default_secondary_color(ctx, &span); + _swrast_span_default_secondary_color(ctx, &span); if (swrast->_FogEnabled) _swrast_span_default_fog(ctx, &span); if (ctx->Texture._EnabledCoordUnits) @@ -565,8 +563,7 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, return; INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA); - if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) - _swrast_span_default_secondary_color(ctx, &span); + _swrast_span_default_secondary_color(ctx, &span); if (ctx->Depth.Test) _swrast_span_default_z(ctx, &span); if (swrast->_FogEnabled) diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index f3b79986186..0b17791567a 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -130,10 +130,15 @@ _swrast_span_default_color( GLcontext *ctx, SWspan *span ) } +/** + * 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) { - if (ctx->Visual.rgbMode) { + 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]); -- cgit v1.2.3 From ad02042db2802733bc27809ad05d97db5966fd11 Mon Sep 17 00:00:00 2001 From: Sean D'Epagnier Date: Sat, 21 Apr 2007 20:18:42 -0700 Subject: Fixed fallout, glfbdev driver was calling a nop function that was removed. --- src/mesa/drivers/fbdev/glfbdev.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c index f9d57dbdd81..0ece3864d08 100644 --- a/src/mesa/drivers/fbdev/glfbdev.c +++ b/src/mesa/drivers/fbdev/glfbdev.c @@ -802,7 +802,6 @@ glFBDevDestroyContext( GLFBDevContextPtr context ) if (fbdevctx == context) { /* destroying current context */ _mesa_make_current(NULL, NULL, NULL); - _mesa_notifyDestroy(&context->glcontext); } _mesa_free_context_data(&context->glcontext); _mesa_free(context); -- cgit v1.2.3 From d59e6f233b02ffe2c36c2fb89ec26c208a421540 Mon Sep 17 00:00:00 2001 From: Brian Date: Sun, 22 Apr 2007 15:32:10 -0600 Subject: import glxext.h version 19 --- docs/relnotes-6.5.3.html | 2 +- include/GL/glxext.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/relnotes-6.5.3.html b/docs/relnotes-6.5.3.html index 0d0398aaf41..61ae904d02a 100644 --- a/docs/relnotes-6.5.3.html +++ b/docs/relnotes-6.5.3.html @@ -46,7 +46,7 @@ for the same reason.
  • Much faster software execution of vertex, fragment shaders.
  • New vertex buffer object (vbo) infrastructure
  • Updated glext.h file (version 39) -
  • Updated glxext.h file (version 18) +
  • Updated glxext.h file (version 19)
  • GL_MAX_DRAWBUFFERS is now 4 (software rendering) so "multiple render targets" are really supported. diff --git a/include/GL/glxext.h b/include/GL/glxext.h index fb7ea22c1de..0f66df6277a 100644 --- a/include/GL/glxext.h +++ b/include/GL/glxext.h @@ -46,9 +46,9 @@ extern "C" { /*************************************************************/ /* Header file version number, required by OpenGL ABI for Linux */ -/* glxext.h last updated 2007/02/13 */ +/* glxext.h last updated 2007/04/21 */ /* Current version at http://www.opengl.org/registry/ */ -#define GLX_GLXEXT_VERSION 18 +#define GLX_GLXEXT_VERSION 19 #ifndef GLX_VERSION_1_3 #define GLX_WINDOW_BIT 0x00000001 -- cgit v1.2.3 From 0bdf216dd06d5136b8529297297aa962bab548c2 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 23 Apr 2007 21:21:52 -0600 Subject: Improve the code for interpolating fragment attributes a little. More to come... --- src/mesa/swrast/s_aalinetemp.h | 84 ++++++++++++------------- src/mesa/swrast/s_aatritemp.h | 136 ++++++++++++++++++----------------------- src/mesa/swrast/s_context.c | 30 +++++---- src/mesa/swrast/s_context.h | 25 ++++++-- src/mesa/swrast/s_linetemp.h | 41 ++++++------- src/mesa/swrast/s_pointtemp.h | 50 ++++++--------- src/mesa/swrast/s_tritemp.h | 38 ++++-------- 7 files changed, 182 insertions(+), 222 deletions(-) diff --git a/src/mesa/swrast/s_aalinetemp.h b/src/mesa/swrast/s_aalinetemp.h index dd741630a1d..b0b73e816dd 100644 --- a/src/mesa/swrast/s_aalinetemp.h +++ b/src/mesa/swrast/s_aalinetemp.h @@ -81,31 +81,26 @@ NAME(plot)(GLcontext *ctx, struct LineInfo *line, int ix, int iy) line->span.array->spec[i][BCOMP] = solve_plane_chan(fx, fy, line->sbPlane); #endif #if defined(DO_TEXVAR) - { - GLuint attr; - for (attr = swrast->_MinFragmentAttrib; attr < swrast->_MaxFragmentAttrib; attr++) { - if (swrast->_FragmentAttribs & (1 << attr)) { - 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) { - const GLuint unit = attr - FRAG_ATTRIB_TEX0; - line->span.array->lambda[unit][i] - = compute_lambda(line->sPlane[attr], - line->tPlane[attr], invQ, - line->texWidth[attr], line->texHeight[attr]); - } - } + 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) { + const GLuint unit = attr - FRAG_ATTRIB_TEX0; + line->span.array->lambda[unit][i] + = compute_lambda(line->sPlane[attr], + line->tPlane[attr], invQ, + line->texWidth[attr], line->texHeight[attr]); + } + ATTRIB_LOOP_END #endif if (line->span.end == MAX_WIDTH) { @@ -207,33 +202,30 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1) #endif #if defined(DO_TEXVAR) { - GLuint attr; const GLfloat invW0 = v0->win[3]; const GLfloat invW1 = v1->win[3]; line.span.arrayMask |= (SPAN_TEXTURE | SPAN_LAMBDA | SPAN_VARYING); - for (attr = swrast->_MinFragmentAttrib; attr < swrast->_MaxFragmentAttrib; attr++) { - if (swrast->_FragmentAttribs & (1 << attr)) { - 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) { - 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]; - line.texWidth[attr] = (GLfloat) texImage->Width; + 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) { + 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]; + line.texWidth[attr] = (GLfloat) texImage->Width; line.texHeight[attr] = (GLfloat) texImage->Height; - } } - } + ATTRIB_LOOP_END } #endif diff --git a/src/mesa/swrast/s_aatritemp.h b/src/mesa/swrast/s_aatritemp.h index bbf9cc611d8..f6c8e68a9b7 100644 --- a/src/mesa/swrast/s_aatritemp.h +++ b/src/mesa/swrast/s_aatritemp.h @@ -179,40 +179,37 @@ #endif #if defined(DO_TEXVAR) { - GLuint attr; const GLfloat invW0 = v0->win[3]; const GLfloat invW1 = v1->win[3]; const GLfloat invW2 = v2->win[3]; - for (attr = swrast->_MinFragmentAttrib; attr < swrast->_MaxFragmentAttrib; attr++) { - if (swrast->_FragmentAttribs & (1 << attr)) { - 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) { - 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; - } - else { - texWidth[attr] = texHeight[attr] = 1.0; - } + 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) { + 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; } - } + else { + texWidth[attr] = texHeight[attr] = 1.0; + } + ATTRIB_LOOP_END } span.arrayMask |= (SPAN_TEXTURE | SPAN_LAMBDA | SPAN_VARYING); #endif @@ -283,23 +280,18 @@ array->spec[count][BCOMP] = solve_plane_chan(cx, cy, sbPlane); #endif #if defined(DO_TEXVAR) - { - GLuint attr; - for (attr = swrast->_MinFragmentAttrib; attr < swrast->_MaxFragmentAttrib; attr++) { - if (swrast->_FragmentAttribs & (1 << attr)) { - 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) { - 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_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) { + 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++; @@ -380,26 +372,21 @@ array->spec[ix][BCOMP] = solve_plane_chan(cx, cy, sbPlane); #endif #if defined(DO_TEXVAR) - { - GLuint attr; - for (attr = swrast->_MinFragmentAttrib; attr < swrast->_MaxFragmentAttrib; attr++) { - if (swrast->_FragmentAttribs & (1 << attr)) { - 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) { - 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_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) { + 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++; @@ -445,18 +432,15 @@ /* shift texcoords, varying */ { SWspanarrays *array = span.array; - GLuint attr; - for (attr = swrast->_MinFragmentAttrib; attr < swrast->_MaxFragmentAttrib; attr++) { - if (swrast->_FragmentAttribs & (1 << attr)) { - 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_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 diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 55b835bf85c..d4782aacb97 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -505,45 +505,43 @@ _swrast_update_texture_samplers(GLcontext *ctx) /** - * Update the swrast->_FragmentAttribs field. + * Update swrast->_ActiveAttribs and swrast->_NumActiveAttribs */ static void _swrast_update_fragment_attribs(GLcontext *ctx) { SWcontext *swrast = SWRAST_CONTEXT(ctx); + GLuint attribsMask; if (ctx->FragmentProgram._Current) { - swrast->_FragmentAttribs - = ctx->FragmentProgram._Current->Base.InputsRead; + attribsMask = ctx->FragmentProgram._Current->Base.InputsRead; } else { GLuint u; - swrast->_FragmentAttribs = 0x0; + attribsMask = 0x0; if (ctx->Depth.Test) - swrast->_FragmentAttribs |= FRAG_BIT_WPOS; + attribsMask |= FRAG_BIT_WPOS; if (NEED_SECONDARY_COLOR(ctx)) - swrast->_FragmentAttribs |= FRAG_BIT_COL1; + attribsMask |= FRAG_BIT_COL1; if (swrast->_FogEnabled) - swrast->_FragmentAttribs |= FRAG_BIT_FOGC; + attribsMask |= FRAG_BIT_FOGC; for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { if (ctx->Texture.Unit[u]._ReallyEnabled) { - swrast->_FragmentAttribs |= FRAG_BIT_TEX(u); + attribsMask |= FRAG_BIT_TEX(u); } } } - /* Find lowest, highest bit set in _FragmentAttribs */ + /* Update _ActiveAttribs[] list */ { - GLuint bits = swrast->_FragmentAttribs; - GLuint i = 0;; - while (bits) { - i++; - bits = bits >> 1; + GLuint i, num = 0; + for (i = 0; i < FRAG_ATTRIB_MAX; i++) { + if (attribsMask & (1 << i)) + swrast->_ActiveAttribs[num++] = i; } - swrast->_MaxFragmentAttrib = i; - swrast->_MinFragmentAttrib = FRAG_ATTRIB_TEX0; /* XXX temporary */ + swrast->_NumActiveAttribs = num; } } diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h index dfe311a40bc..c8333b8e0a1 100644 --- a/src/mesa/swrast/s_context.h +++ b/src/mesa/swrast/s_context.h @@ -138,12 +138,10 @@ typedef struct GLbitfield _ColorOutputsMask; GLuint _NumColorOutputs; - /** Fragment attributes to compute during rasterization. - * Mask of FRAG_BIT_* flags. - */ - GLbitfield _FragmentAttribs; - GLuint _MinFragmentAttrib; /**< Lowest bit set in _FragmentAttribs */ - GLuint _MaxFragmentAttrib; /**< Highest bit set in _FragmentAttribs + 1 */ + /** List/array of the fragment attributes to interpolate */ + GLuint _ActiveAttribs[FRAG_ATTRIB_MAX]; + /** Number of fragment attributes to interpolate */ + GLuint _NumActiveAttribs; /* Accum buffer temporaries. */ @@ -277,4 +275,19 @@ _swrast_update_texture_samplers(GLcontext *ctx); #define FixedToChan(X) FixedToInt(X) #endif + +/** + * For looping over fragment attributes in the pointe, line + * triangle rasterizers. + */ +#define ATTRIB_LOOP_BEGIN \ + { \ + GLuint a; \ + for (a = 0; a < swrast->_NumActiveAttribs; a++) { \ + const GLuint attr = swrast->_ActiveAttribs[a]; + +#define ATTRIB_LOOP_END } } + + + #endif diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h index 7b66291eb5e..6c52e8dd478 100644 --- a/src/mesa/swrast/s_linetemp.h +++ b/src/mesa/swrast/s_linetemp.h @@ -314,28 +314,25 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 ) const GLfloat invLen = 1.0F / numPixels; const GLfloat invw0 = vert0->win[3]; const GLfloat invw1 = vert1->win[3]; - GLuint attr; - for (attr = swrast->_MinFragmentAttrib; attr < swrast->_MaxFragmentAttrib; attr++) { - if (swrast->_FragmentAttribs & (1 << attr)) { - 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; - } - } + 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; + ATTRIB_LOOP_END } #endif diff --git a/src/mesa/swrast/s_pointtemp.h b/src/mesa/swrast/s_pointtemp.h index 1956eeba50b..23ac5712366 100644 --- a/src/mesa/swrast/s_pointtemp.h +++ b/src/mesa/swrast/s_pointtemp.h @@ -63,7 +63,6 @@ */ - static void NAME ( GLcontext *ctx, const SWvertex *vert ) { @@ -89,7 +88,6 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) #endif #if FLAGS & TEXTURE GLfloat attrib[FRAG_ATTRIB_MAX][4]; /* texture & varying */ - GLuint attr; #endif SWcontext *swrast = SWRAST_CONTEXT(ctx); SWspan *span = &(swrast->PointSpan); @@ -123,24 +121,20 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) span->arrayMask |= (SPAN_TEXTURE | SPAN_LAMBDA); if (ctx->FragmentProgram._Active) { /* Don't divide texture s,t,r by q (use TXP to do that) */ - for (attr = swrast->_MinFragmentAttrib; attr < swrast->_MaxFragmentAttrib; attr++) { - if (swrast->_FragmentAttribs & (1 << attr)) { - COPY_4V(attrib[attr], vert->attrib[attr]); - } - } + ATTRIB_LOOP_BEGIN + COPY_4V(attrib[attr], vert->attrib[attr]); + ATTRIB_LOOP_END } else { /* Divide texture s,t,r by q here */ - for (attr = swrast->_MinFragmentAttrib; attr < swrast->_MaxFragmentAttrib; attr++) { - if (swrast->_FragmentAttribs & (1 << attr)) { - 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_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 } /* need these for fragment programs */ span->attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F; @@ -279,15 +273,13 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) span->array->index[count] = colorIndex; #endif #if FLAGS & TEXTURE - for (attr = swrast->_MinFragmentAttrib; attr < swrast->_MaxFragmentAttrib; attr++) { - if (swrast->_FragmentAttribs & (1 << attr)) { - 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_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 @@ -406,11 +398,9 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) span->array->index[count] = colorIndex; #endif #if FLAGS & TEXTURE - for (attr = swrast->_MinFragmentAttrib; attr < swrast->_MaxFragmentAttrib; attr++) { - if (swrast->_FragmentAttribs & (1 << attr)) { - COPY_4V(span->array->attribs[attr][count], attribs[attr]); - } - } + ATTRIB_LOOP_BEGIN + COPY_4V(span->array->attribs[attr][count], attribs[attr]); + ATTRIB_LOOP_END #endif span->array->x[count] = (GLint) vert->win[0]; diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h index b25d3d1550c..deab7edbedb 100644 --- a/src/mesa/swrast/s_tritemp.h +++ b/src/mesa/swrast/s_tritemp.h @@ -117,20 +117,6 @@ #endif -#define TEXVAR_LOOP(CODE) \ - { \ - GLuint attr; \ - for (attr = swrast->_MinFragmentAttrib; \ - attr < swrast->_MaxFragmentAttrib; attr++) { \ - if (swrast->_FragmentAttribs & (1 << attr)) { \ - CODE \ - } \ - } \ - } - - - - /* * Some code we unfortunately need to prevent negative interpolated colors. */ @@ -620,7 +606,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, { /* win[3] is 1/W */ const GLfloat wMax = vMax->win[3], wMin = vMin->win[3], wMid = vMid->win[3]; - TEXVAR_LOOP( + 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; @@ -637,7 +623,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, 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); - ) + ATTRIB_LOOP_END } #endif @@ -1001,7 +987,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, } #endif #ifdef INTERP_TEX - TEXVAR_LOOP( + 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; @@ -1015,7 +1001,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, 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]; - ) + ATTRIB_LOOP_END #endif } /*if setupLeft*/ @@ -1072,12 +1058,12 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, dtInner = dtOuter + span.intTexStep[1]; #endif #ifdef INTERP_TEX - TEXVAR_LOOP( + 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]; - ) + ATTRIB_LOOP_END #endif while (lines > 0) { @@ -1121,12 +1107,12 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, #endif #ifdef INTERP_TEX - TEXVAR_LOOP( + 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]; - ) + ATTRIB_LOOP_END #endif /* This is where we actually generate fragments */ @@ -1209,12 +1195,12 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, tLeft += dtOuter; #endif #ifdef INTERP_TEX - TEXVAR_LOOP( + ATTRIB_LOOP_BEGIN sLeft[attr] += dsOuter[attr]; tLeft[attr] += dtOuter[attr]; uLeft[attr] += duOuter[attr]; vLeft[attr] += dvOuter[attr]; - ) + ATTRIB_LOOP_END #endif } else { @@ -1254,12 +1240,12 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, tLeft += dtInner; #endif #ifdef INTERP_TEX - TEXVAR_LOOP( + ATTRIB_LOOP_BEGIN sLeft[attr] += dsInner[attr]; tLeft[attr] += dtInner[attr]; uLeft[attr] += duInner[attr]; vLeft[attr] += dvInner[attr]; - ) + ATTRIB_LOOP_END #endif } } /*while lines>0*/ -- cgit v1.2.3 From 335769a875d653f6076e653d3f63c6a4ba64dba2 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 23 Apr 2007 21:27:13 -0600 Subject: some re-org, clean-up --- src/mesa/swrast_setup/ss_context.c | 71 ++++++++++++++++++++++++-------------- 1 file changed, 46 insertions(+), 25 deletions(-) diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c index e1b60d0e855..075f7791bae 100644 --- a/src/mesa/swrast_setup/ss_context.c +++ b/src/mesa/swrast_setup/ss_context.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.3 * - * 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"), @@ -85,6 +85,10 @@ _swsetup_RenderPrimitive( GLcontext *ctx, GLenum mode ) _swrast_render_primitive( ctx, mode ); } + +/** + * Helper macros for setup_vertex_format() + */ #define SWZ ((SWvertex *)0) #define SWOffset(MEMBER) (((char *)&(SWZ->MEMBER)) - ((char *)SWZ)) @@ -96,32 +100,20 @@ do { \ e++; \ } while (0) -/* - * We patch this function into tnl->Driver.Render.Start. - * It's called when we start rendering a vertex buffer. + +/** + * Tell the tnl module how to build SWvertex objects for swrast. + * We'll build the map[] array with that info and pass it to + * _tnl_install_attrs(). */ static void -_swsetup_RenderStart( GLcontext *ctx ) +setup_vertex_format(GLcontext *ctx) { - SScontext *swsetup = SWSETUP_CONTEXT(ctx); TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - GLuint new_state = swsetup->NewState; - - if (new_state & _SWSETUP_NEW_RENDERINDEX) { - _swsetup_choose_trifuncs( ctx ); - } - - swsetup->NewState = 0; - - _swrast_render_start( ctx ); - - /* Important: - */ - VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr; - + SScontext *swsetup = SWSETUP_CONTEXT(ctx); - if (!RENDERINPUTS_EQUAL(tnl->render_inputs_bitset, swsetup->last_index_bitset)) { + if (!RENDERINPUTS_EQUAL(tnl->render_inputs_bitset, + swsetup->last_index_bitset)) { DECLARE_RENDERINPUTS(index_bitset); struct tnl_attr_map map[_TNL_ATTRIB_MAX]; int i, e = 0; @@ -142,10 +134,12 @@ _swsetup_RenderStart( GLcontext *ctx ) if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1F, fog); - if (RENDERINPUTS_TEST_RANGE( index_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX )) { + if (RENDERINPUTS_TEST_RANGE(index_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX)) + { for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) { if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX(i) )) { - EMIT_ATTR( _TNL_ATTRIB_TEX(i), EMIT_4F, attrib[FRAG_ATTRIB_TEX0 + i] ); + EMIT_ATTR( _TNL_ATTRIB_TEX(i), EMIT_4F, + attrib[FRAG_ATTRIB_TEX0 + i] ); } } } @@ -172,6 +166,33 @@ _swsetup_RenderStart( GLcontext *ctx ) } } + +/** + * Prepare to render a vertex buffer. + * Called via tnl->Driver.Render.Start. + */ +static void +_swsetup_RenderStart( GLcontext *ctx ) +{ + SScontext *swsetup = SWSETUP_CONTEXT(ctx); + TNLcontext *tnl = TNL_CONTEXT(ctx); + struct vertex_buffer *VB = &tnl->vb; + + if (swsetup->NewState & _SWSETUP_NEW_RENDERINDEX) { + _swsetup_choose_trifuncs(ctx); + } + + swsetup->NewState = 0; + + _swrast_render_start(ctx); + + /* Important */ + VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr; + + setup_vertex_format(ctx); +} + + /* * We patch this function into tnl->Driver.Render.Finish. * It's called when we finish rendering a vertex buffer. -- cgit v1.2.3 From afc132e7a9c2b2c870b61ef10311272b36ea9bf2 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 23 Apr 2007 22:01:34 -0600 Subject: remove SWvertex->fog field, use attrib field --- src/mesa/swrast/s_aalinetemp.h | 4 +++- src/mesa/swrast/s_aatritemp.h | 6 +++++- src/mesa/swrast/s_context.c | 2 +- src/mesa/swrast/s_linetemp.h | 5 +++-- src/mesa/swrast/s_pointtemp.h | 2 +- src/mesa/swrast/s_tritemp.h | 12 ++++++------ src/mesa/swrast/swrast.h | 1 - 7 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/mesa/swrast/s_aalinetemp.h b/src/mesa/swrast/s_aalinetemp.h index b0b73e816dd..ef26e9edc8b 100644 --- a/src/mesa/swrast/s_aalinetemp.h +++ b/src/mesa/swrast/s_aalinetemp.h @@ -153,7 +153,9 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1) #ifdef DO_FOG line.span.arrayMask |= SPAN_FOG; compute_plane(line.x0, line.y0, line.x1, line.y1, - v0->fog, v1->fog, line.fPlane); + v0->attrib[FRAG_ATTRIB_FOGC][0], + v1->attrib[FRAG_ATTRIB_FOGC][0], + line.fPlane); #endif #ifdef DO_RGBA line.span.arrayMask |= SPAN_RGBA; diff --git a/src/mesa/swrast/s_aatritemp.h b/src/mesa/swrast/s_aatritemp.h index f6c8e68a9b7..8ff52cb932b 100644 --- a/src/mesa/swrast/s_aatritemp.h +++ b/src/mesa/swrast/s_aatritemp.h @@ -136,7 +136,11 @@ span.arrayMask |= SPAN_Z; #endif #ifdef DO_FOG - compute_plane(p0, p1, p2, v0->fog, v1->fog, v2->fog, fogPlane); + 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 diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index d4782aacb97..522a66fad83 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -910,7 +910,7 @@ _swrast_print_vertex( GLcontext *ctx, const SWvertex *v ) v->specular[0], v->specular[1], v->specular[2], v->specular[3]); #endif - _mesa_debug(ctx, "fog %f\n", v->fog); + _mesa_debug(ctx, "fog %f\n", v->attrib[FRAG_ATTRIB_FOGC][0]); _mesa_debug(ctx, "index %d\n", v->index); _mesa_debug(ctx, "pointsize %f\n", v->pointSize); _mesa_debug(ctx, "\n"); diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h index 6c52e8dd478..76da4467104 100644 --- a/src/mesa/swrast/s_linetemp.h +++ b/src/mesa/swrast/s_linetemp.h @@ -280,8 +280,9 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 ) #endif #ifdef INTERP_FOG interpFlags |= SPAN_FOG; - span.attrStart[FRAG_ATTRIB_FOGC][0] = vert0->fog; - span.attrStepX[FRAG_ATTRIB_FOGC][0] = (vert1->fog - vert0->fog) / numPixels; + 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 #ifdef INTERP_TEX interpFlags |= SPAN_TEXTURE; diff --git a/src/mesa/swrast/s_pointtemp.h b/src/mesa/swrast/s_pointtemp.h index 23ac5712366..500b3fef9df 100644 --- a/src/mesa/swrast/s_pointtemp.h +++ b/src/mesa/swrast/s_pointtemp.h @@ -105,7 +105,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) */ span->interpMask = SPAN_FOG; span->arrayMask = SPAN_XY | SPAN_Z; - span->attrStart[FRAG_ATTRIB_FOGC][0] = vert->fog; + 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 diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h index deab7edbedb..97c79428c06 100644 --- a/src/mesa/swrast/s_tritemp.h +++ b/src/mesa/swrast/s_tritemp.h @@ -458,11 +458,11 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, { # ifdef INTERP_W const GLfloat wMax = vMax->win[3], wMin = vMin->win[3], wMid = vMid->win[3]; - const GLfloat eMaj_dfog = vMax->fog * wMax - vMin->fog * wMin; - const GLfloat eBot_dfog = vMid->fog * wMid - vMin->fog * wMin; + 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->fog - vMin->fog; - const GLfloat eBot_dfog = vMid->fog - vMin->fog; + 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); @@ -867,9 +867,9 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, #endif #ifdef INTERP_FOG # ifdef INTERP_W - fogLeft = vLower->fog * vLower->win[3] + (span.attrStepX[FRAG_ATTRIB_FOGC][0] * adjx + span.attrStepY[FRAG_ATTRIB_FOGC][0] * adjy) * (1.0F/FIXED_SCALE); + 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->fog + (span.attrStepX[FRAG_ATTRIB_FOGC][0] * adjx + span.attrStepY[FRAG_ATTRIB_FOGC][0] * adjy) * (1.0F/FIXED_SCALE); + 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 diff --git a/src/mesa/swrast/swrast.h b/src/mesa/swrast/swrast.h index 9e1fe24bb40..12264a159ad 100644 --- a/src/mesa/swrast/swrast.h +++ b/src/mesa/swrast/swrast.h @@ -69,7 +69,6 @@ typedef struct { GLfloat win[4]; GLchan color[4]; GLchan specular[4]; - GLfloat fog; GLfloat index; GLfloat pointSize; GLfloat attrib[FRAG_ATTRIB_MAX][4]; /**< texcoords & varying, more to come */ -- cgit v1.2.3 From c27adc52ce48d371b94170581be173b77c16e6e6 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 23 Apr 2007 22:03:11 -0600 Subject: remove SWvertex->fog field, use attrib field --- src/mesa/swrast_setup/ss_context.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c index 075f7791bae..360cc61cb14 100644 --- a/src/mesa/swrast_setup/ss_context.c +++ b/src/mesa/swrast_setup/ss_context.c @@ -132,7 +132,7 @@ setup_vertex_format(GLcontext *ctx) EMIT_ATTR( _TNL_ATTRIB_COLOR_INDEX, EMIT_1F, index ); if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) - EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1F, fog); + EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1F, attrib[FRAG_ATTRIB_FOGC]); if (RENDERINPUTS_TEST_RANGE(index_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX)) { @@ -277,7 +277,7 @@ _swsetup_Translate( GLcontext *ctx, const void *vertex, SWvertex *dest ) UNCLAMPED_FLOAT_TO_RGBA_CHAN( dest->specular, tmp ); _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_FOG, tmp ); - dest->fog = tmp[0]; + dest->attrib[FRAG_ATTRIB_FOGC][0] = tmp[0]; _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR_INDEX, tmp ); dest->index = tmp[0]; -- cgit v1.2.3 From 3db3dc58bcc361637d7473ee4b7c4e3b036c283c Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 23 Apr 2007 22:04:03 -0600 Subject: disable some errant code --- src/mesa/swrast/s_context.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 522a66fad83..c55de89085d 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -520,10 +520,12 @@ _swrast_update_fragment_attribs(GLcontext *ctx) GLuint u; attribsMask = 0x0; +#if 0 /* not yet */ if (ctx->Depth.Test) attribsMask |= FRAG_BIT_WPOS; if (NEED_SECONDARY_COLOR(ctx)) attribsMask |= FRAG_BIT_COL1; +#endif if (swrast->_FogEnabled) attribsMask |= FRAG_BIT_FOGC; -- cgit v1.2.3 From 47ad443c55cf07b32bac04b97066cfd3c2aa3554 Mon Sep 17 00:00:00 2001 From: Sean D'Epagnier Date: Mon, 23 Apr 2007 21:17:30 -0700 Subject: Added proper cleanup code --- src/mesa/drivers/fbdev/glfbdev.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c index 0ece3864d08..6c6511b7e53 100644 --- a/src/mesa/drivers/fbdev/glfbdev.c +++ b/src/mesa/drivers/fbdev/glfbdev.c @@ -682,9 +682,16 @@ 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 } } @@ -799,6 +806,13 @@ glFBDevDestroyContext( GLFBDevContextPtr context ) GLFBDevContextPtr fbdevctx = glFBDevGetCurrentContext(); if (context) { + GLcontext *mesaCtx = &context->glcontext; + + _swsetup_DestroyContext( mesaCtx ); + _swrast_DestroyContext( mesaCtx ); + _tnl_DestroyContext( mesaCtx ); + _vbo_DestroyContext( mesaCtx ); + if (fbdevctx == context) { /* destroying current context */ _mesa_make_current(NULL, NULL, NULL); -- cgit v1.2.3 From 7868ab6617e1b6e80c43e3daf7c9cca3693a6c11 Mon Sep 17 00:00:00 2001 From: Matthias Hopf Date: Tue, 24 Apr 2007 07:48:35 -0600 Subject: add missing semicolon --- include/GL/xmesa_xf86.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/GL/xmesa_xf86.h b/include/GL/xmesa_xf86.h index 7d5a7c5e995..0a15110f651 100644 --- a/include/GL/xmesa_xf86.h +++ b/include/GL/xmesa_xf86.h @@ -124,7 +124,7 @@ do { \ do { \ /* Assumes: Images are always in ZPixmap format */ \ (void) __d; \ - ASSERT(!__sx && !__sy) /* The SubImage case */ \ + ASSERT(!__sx && !__sy); /* The SubImage case */ \ ValidateGC(__b, __gc); \ (*__gc->ops->PutImage)(__b, __gc, ((XMesaDrawable)(__b))->depth, \ __x, __y, __w, __h, 0, ZPixmap, \ -- cgit v1.2.3 From 208ea84524728abc3ae46549c00eebe16c9576b8 Mon Sep 17 00:00:00 2001 From: Karl Schultze Date: Tue, 24 Apr 2007 08:19:07 -0600 Subject: fix double const, move an assertion --- src/mesa/shader/slang/slang_codegen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index ba97d6257bd..c6151f8feaa 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -1614,7 +1614,7 @@ _slang_gen_continue(slang_assemble_ctx * A, const slang_operation *oper) * Determine if the given operation is of a specific type. */ static GLboolean -is_operation_type(const const slang_operation *oper, slang_operation_type type) +is_operation_type(const slang_operation *oper, slang_operation_type type) { if (oper->type == type) return GL_TRUE; @@ -2911,9 +2911,9 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var, store = _slang_new_ir_storage(PROGRAM_OUTPUT, index, size); } else { - assert(type == SLANG_UNIT_FRAGMENT_BUILTIN); GLint index = _slang_output_index(varName, GL_FRAGMENT_PROGRAM_ARB); GLint size = 4; /* XXX? */ + assert(type == SLANG_UNIT_FRAGMENT_BUILTIN); store = _slang_new_ir_storage(PROGRAM_OUTPUT, index, size); } if (dbg) printf("OUTPUT "); -- cgit v1.2.3 From 3b0bd0ce1747bf9145d4fcee83515d7a1e7a5f03 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 24 Apr 2007 08:52:34 -0600 Subject: new VC8 project files --- windows/VC8/mesa/gdi/gdi.vcproj | 260 +++++ windows/VC8/mesa/glu/glu.vcproj | 1022 +++++++++++++++++++ windows/VC8/mesa/mesa.sln | 43 + windows/VC8/mesa/mesa/mesa.vcproj | 1753 +++++++++++++++++++++++++++++++++ windows/VC8/mesa/osmesa/osmesa.vcproj | 243 +++++ windows/VC8/progs/demos/gears.vcproj | 239 +++++ windows/VC8/progs/glut/glut.vcproj | 449 +++++++++ windows/VC8/progs/progs.sln | 28 + 8 files changed, 4037 insertions(+) create mode 100644 windows/VC8/mesa/gdi/gdi.vcproj create mode 100644 windows/VC8/mesa/glu/glu.vcproj create mode 100644 windows/VC8/mesa/mesa.sln create mode 100644 windows/VC8/mesa/mesa/mesa.vcproj create mode 100644 windows/VC8/mesa/osmesa/osmesa.vcproj create mode 100644 windows/VC8/progs/demos/gears.vcproj create mode 100644 windows/VC8/progs/glut/glut.vcproj create mode 100644 windows/VC8/progs/progs.sln diff --git a/windows/VC8/mesa/gdi/gdi.vcproj b/windows/VC8/mesa/gdi/gdi.vcproj new file mode 100644 index 00000000000..0aab8cf9d46 --- /dev/null +++ b/windows/VC8/mesa/gdi/gdi.vcproj @@ -0,0 +1,260 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/windows/VC8/mesa/glu/glu.vcproj b/windows/VC8/mesa/glu/glu.vcproj new file mode 100644 index 00000000000..8679aa18cea --- /dev/null +++ b/windows/VC8/mesa/glu/glu.vcproj @@ -0,0 +1,1022 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/windows/VC8/mesa/mesa.sln b/windows/VC8/mesa/mesa.sln new file mode 100644 index 00000000000..46d361ae28a --- /dev/null +++ b/windows/VC8/mesa/mesa.sln @@ -0,0 +1,43 @@ +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual C++ Express 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gdi", "gdi\gdi.vcproj", "{A1B24907-E196-4826-B6AF-26723629B633}" + ProjectSection(ProjectDependencies) = postProject + {2120C974-2717-4709-B44F-D6E6D0A56448} = {2120C974-2717-4709-B44F-D6E6D0A56448} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glu", "glu\glu.vcproj", "{2E50FDAF-430B-475B-AE6B-60B68F2875BA}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mesa", "mesa\mesa.vcproj", "{2120C974-2717-4709-B44F-D6E6D0A56448}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "osmesa", "osmesa\osmesa.vcproj", "{8D6CD423-383B-49E7-81BC-D20C70B07DF5}" + ProjectSection(ProjectDependencies) = postProject + {A1B24907-E196-4826-B6AF-26723629B633} = {A1B24907-E196-4826-B6AF-26723629B633} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A1B24907-E196-4826-B6AF-26723629B633}.Debug|Win32.ActiveCfg = Debug|Win32 + {A1B24907-E196-4826-B6AF-26723629B633}.Debug|Win32.Build.0 = Debug|Win32 + {A1B24907-E196-4826-B6AF-26723629B633}.Release|Win32.ActiveCfg = Release|Win32 + {A1B24907-E196-4826-B6AF-26723629B633}.Release|Win32.Build.0 = Release|Win32 + {2E50FDAF-430B-475B-AE6B-60B68F2875BA}.Debug|Win32.ActiveCfg = Debug|Win32 + {2E50FDAF-430B-475B-AE6B-60B68F2875BA}.Debug|Win32.Build.0 = Debug|Win32 + {2E50FDAF-430B-475B-AE6B-60B68F2875BA}.Release|Win32.ActiveCfg = Release|Win32 + {2E50FDAF-430B-475B-AE6B-60B68F2875BA}.Release|Win32.Build.0 = Release|Win32 + {2120C974-2717-4709-B44F-D6E6D0A56448}.Debug|Win32.ActiveCfg = Debug|Win32 + {2120C974-2717-4709-B44F-D6E6D0A56448}.Debug|Win32.Build.0 = Debug|Win32 + {2120C974-2717-4709-B44F-D6E6D0A56448}.Release|Win32.ActiveCfg = Release|Win32 + {2120C974-2717-4709-B44F-D6E6D0A56448}.Release|Win32.Build.0 = Release|Win32 + {8D6CD423-383B-49E7-81BC-D20C70B07DF5}.Debug|Win32.ActiveCfg = Debug|Win32 + {8D6CD423-383B-49E7-81BC-D20C70B07DF5}.Debug|Win32.Build.0 = Debug|Win32 + {8D6CD423-383B-49E7-81BC-D20C70B07DF5}.Release|Win32.ActiveCfg = Release|Win32 + {8D6CD423-383B-49E7-81BC-D20C70B07DF5}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/windows/VC8/mesa/mesa/mesa.vcproj b/windows/VC8/mesa/mesa/mesa.vcproj new file mode 100644 index 00000000000..58856842a36 --- /dev/null +++ b/windows/VC8/mesa/mesa/mesa.vcproj @@ -0,0 +1,1753 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/windows/VC8/mesa/osmesa/osmesa.vcproj b/windows/VC8/mesa/osmesa/osmesa.vcproj new file mode 100644 index 00000000000..2ba0077fca2 --- /dev/null +++ b/windows/VC8/mesa/osmesa/osmesa.vcproj @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/windows/VC8/progs/demos/gears.vcproj b/windows/VC8/progs/demos/gears.vcproj new file mode 100644 index 00000000000..891acd641ab --- /dev/null +++ b/windows/VC8/progs/demos/gears.vcproj @@ -0,0 +1,239 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/windows/VC8/progs/glut/glut.vcproj b/windows/VC8/progs/glut/glut.vcproj new file mode 100644 index 00000000000..f86cc1b15a9 --- /dev/null +++ b/windows/VC8/progs/glut/glut.vcproj @@ -0,0 +1,449 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/windows/VC8/progs/progs.sln b/windows/VC8/progs/progs.sln new file mode 100644 index 00000000000..3d91afa1a32 --- /dev/null +++ b/windows/VC8/progs/progs.sln @@ -0,0 +1,28 @@ +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual C++ Express 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gears", "demos\gears.vcproj", "{3A7B0671-10F8-45D1-B012-F6D650F817CE}" + ProjectSection(ProjectDependencies) = postProject + {0234F0D2-C8A6-4C4D-93E7-0E2248049C67} = {0234F0D2-C8A6-4C4D-93E7-0E2248049C67} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glut", "glut\glut.vcproj", "{0234F0D2-C8A6-4C4D-93E7-0E2248049C67}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3A7B0671-10F8-45D1-B012-F6D650F817CE}.Debug|Win32.ActiveCfg = Debug|Win32 + {3A7B0671-10F8-45D1-B012-F6D650F817CE}.Debug|Win32.Build.0 = Debug|Win32 + {3A7B0671-10F8-45D1-B012-F6D650F817CE}.Release|Win32.ActiveCfg = Release|Win32 + {3A7B0671-10F8-45D1-B012-F6D650F817CE}.Release|Win32.Build.0 = Release|Win32 + {0234F0D2-C8A6-4C4D-93E7-0E2248049C67}.Debug|Win32.ActiveCfg = Debug|Win32 + {0234F0D2-C8A6-4C4D-93E7-0E2248049C67}.Debug|Win32.Build.0 = Debug|Win32 + {0234F0D2-C8A6-4C4D-93E7-0E2248049C67}.Release|Win32.ActiveCfg = Release|Win32 + {0234F0D2-C8A6-4C4D-93E7-0E2248049C67}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal -- cgit v1.2.3 From 286faac68e7f8c51fd1afa801c75db33a427f8b6 Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Tue, 24 Apr 2007 08:53:28 -0600 Subject: assorted fixes for Windows/VC8 --- src/glu/sgi/glu.def | 2 +- src/glut/glx/glut_win.c | 6 ++++++ src/mesa/drivers/osmesa/osmesa.def | 2 +- src/mesa/drivers/windows/gdi/mesa.def | 37 +++++++++++++++++++++++++++++++--- src/mesa/drivers/windows/gdi/wmesa.c | 22 ++++++++++++++++++++ src/mesa/main/imports.c | 4 ++-- src/mesa/shader/slang/slang_vartable.c | 2 +- 7 files changed, 67 insertions(+), 8 deletions(-) diff --git a/src/glu/sgi/glu.def b/src/glu/sgi/glu.def index ffec651a0a4..0c8b021767e 100644 --- a/src/glu/sgi/glu.def +++ b/src/glu/sgi/glu.def @@ -1,4 +1,4 @@ -DESCRIPTION 'Mesa GLU (OpenGL work-alike) for Win32' +;DESCRIPTION 'Mesa GLU (OpenGL work-alike) for Win32' VERSION 5.1 ; ; Module definition file for GLU (GLU32.DLL) diff --git a/src/glut/glx/glut_win.c b/src/glut/glx/glut_win.c index 0f48e0ba339..18554b3e97f 100644 --- a/src/glut/glx/glut_win.c +++ b/src/glut/glx/glut_win.c @@ -349,12 +349,18 @@ getVisualInfoRGB(unsigned int mode) __glutScreen, list); } +#ifndef VisualIDMask +#define VisualIDMask 0 +#endif + static XVisualInfo * getVisualInfoID(int id) { XVisualInfo temp; int count; +#if !defined(_WIN32) temp.visualid = id; +#endif return XGetVisualInfo(__glutDisplay, VisualIDMask, &temp, &count); } diff --git a/src/mesa/drivers/osmesa/osmesa.def b/src/mesa/drivers/osmesa/osmesa.def index a92a30f351d..71e96873d81 100644 --- a/src/mesa/drivers/osmesa/osmesa.def +++ b/src/mesa/drivers/osmesa/osmesa.def @@ -1,4 +1,4 @@ -DESCRIPTION 'Mesa OSMesa lib for Win32' +;DESCRIPTION 'Mesa OSMesa lib for Win32' VERSION 4.1 EXPORTS diff --git a/src/mesa/drivers/windows/gdi/mesa.def b/src/mesa/drivers/windows/gdi/mesa.def index 8d654281215..c525945426f 100644 --- a/src/mesa/drivers/windows/gdi/mesa.def +++ b/src/mesa/drivers/windows/gdi/mesa.def @@ -1,6 +1,6 @@ ; DO NOT EDIT - This file generated automatically by mesadef.py script -DESCRIPTION 'Mesa (OpenGL work-alike) for Win32' -VERSION 6.0 +;DESCRIPTION 'Mesa (OpenGL work-alike) for Win32' +VERSION 6.5 ; ; Module definition file for Mesa (OPENGL32.DLL) ; @@ -867,6 +867,8 @@ EXPORTS _glapi_get_proc_address _mesa_add_soft_renderbuffers _mesa_add_renderbuffer + _mesa_attach_shader + _mesa_bind_attrib_location _mesa_buffer_data _mesa_buffer_get_subdata _mesa_buffer_map @@ -875,15 +877,21 @@ EXPORTS _mesa_bzero _mesa_calloc _mesa_choose_tex_format + _mesa_compile_shader _mesa_compressed_texture_size _mesa_create_framebuffer + _mesa_create_program + _mesa_create_shader _mesa_create_visual _mesa_delete_array_object _mesa_delete_buffer_object _mesa_delete_program + _mesa_delete_program2 + _mesa_delete_shader _mesa_delete_texture_object _mesa_destroy_framebuffer _mesa_destroy_visual + _mesa_detach_shader _mesa_enable_1_3_extensions _mesa_enable_1_4_extensions _mesa_enable_1_5_extensions @@ -894,13 +902,28 @@ EXPORTS _mesa_free _mesa_free_context_data _mesa_free_texture_image_data + _mesa_get_active_attrib + _mesa_get_active_uniform + _mesa_get_attached_shaders + _mesa_get_attrib_location _mesa_get_compressed_teximage _mesa_get_current_context + _mesa_get_handle + _mesa_get_programiv + _mesa_get_program_info_log + _mesa_get_program_register + _mesa_get_shaderiv + _mesa_get_shader_info_log + _mesa_get_shader_source _mesa_get_teximage - _mesa_init_default_imports + _mesa_get_uniformfv + _mesa_get_uniform_location _mesa_init_driver_functions _mesa_init_renderbuffer _mesa_initialize_context + _mesa_is_program + _mesa_is_shader + _mesa_link_program _mesa_make_current _mesa_memcpy _mesa_memset @@ -914,10 +937,12 @@ EXPORTS _mesa_new_texture_image _mesa_new_texture_object _mesa_problem + _mesa_reference_renderbuffer _mesa_remove_renderbuffer _mesa_render_texture _mesa_ResizeBuffersMESA _mesa_resize_framebuffer + _mesa_shader_source _mesa_store_compressed_teximage1d _mesa_store_compressed_teximage2d _mesa_store_compressed_teximage3d @@ -932,7 +957,12 @@ EXPORTS _mesa_store_texsubimage3d _mesa_strcmp _mesa_test_proxy_teximage + _mesa_uniform + _mesa_uniform_matrix + _mesa_unreference_framebuffer _mesa_update_framebuffer_visual + _mesa_use_program + _mesa_validate_program _mesa_Viewport _swrast_Accum _swrast_Bitmap @@ -954,6 +984,7 @@ EXPORTS _swrast_copy_texsubimage3d _swrast_CreateContext _swrast_DestroyContext + _swrast_exec_fragment_program _swrast_InvalidateState _swrast_ReadPixels _swsetup_Wakeup diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c index 078b590af87..00d9ee77835 100644 --- a/src/mesa/drivers/windows/gdi/wmesa.c +++ b/src/mesa/drivers/windows/gdi/wmesa.c @@ -1448,3 +1448,25 @@ 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/imports.c b/src/mesa/main/imports.c index 9de7a89c998..786f812fce2 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -584,11 +584,11 @@ _mesa_ffsll(long long val) assert(sizeof(val) == 8); - bit = ffs(val); + bit = _mesa_ffs(val); if (bit != 0) return bit; - bit = ffs(val >> 32); + bit = _mesa_ffs(val >> 32); if (bit != 0) return 32 + bit; diff --git a/src/mesa/shader/slang/slang_vartable.c b/src/mesa/shader/slang/slang_vartable.c index 5814481ea79..8a3c299d19c 100644 --- a/src/mesa/shader/slang/slang_vartable.c +++ b/src/mesa/shader/slang/slang_vartable.c @@ -319,9 +319,9 @@ GLboolean _slang_is_temp(const slang_var_table *vt, const slang_ir_storage *store) { struct table *t = vt->Top; + GLuint comp; assert(store->Index >= 0); assert(store->Index < vt->MaxRegisters); - GLuint comp; if (store->Swizzle == SWIZZLE_NOOP) comp = 0; else -- cgit v1.2.3 From b1b154c4981b0a1bcdfce1f6f4eabee61e792ab0 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 24 Apr 2007 08:58:12 -0600 Subject: added new VC* files, bump version to rc3 --- Makefile | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index a50ede01542..8aef783f2e8 100644 --- a/Makefile +++ b/Makefile @@ -155,10 +155,10 @@ ultrix-gcc: # Rules for making release tarballs -DIRECTORY = Mesa-6.5.3rc2 -LIB_NAME = MesaLib-6.5.3rc2 -DEMO_NAME = MesaDemos-6.5.3rc2 -GLUT_NAME = MesaGLUT-6.5.3rc2 +DIRECTORY = Mesa-6.5.3rc3 +LIB_NAME = MesaLib-6.5.3rc3 +DEMO_NAME = MesaDemos-6.5.3rc3 +GLUT_NAME = MesaGLUT-6.5.3rc3 MAIN_FILES = \ $(DIRECTORY)/Makefile* \ @@ -288,7 +288,14 @@ MAIN_FILES = \ $(DIRECTORY)/windows/VC7/mesa/glu/glu.vcproj \ $(DIRECTORY)/windows/VC7/mesa/mesa.sln \ $(DIRECTORY)/windows/VC7/mesa/mesa/mesa.vcproj \ - $(DIRECTORY)/windows/VC7/mesa/osmesa/osmesa.vcproj + $(DIRECTORY)/windows/VC7/mesa/osmesa/osmesa.vcproj \ + $(DIRECTORY)/windows/VC8/mesa/gdi/gdi.vcproj \ + $(DIRECTORY)/windows/VC8/mesa/glu/glu.vcproj \ + $(DIRECTORY)/windows/VC8/mesa/mesa/mesa.vcproj \ + $(DIRECTORY)/windows/VC8/mesa/osmesa/osmesa.vcproj \ + $(DIRECTORY)/windows/VC8/progs/demos/gears.vcproj \ + $(DIRECTORY)/windows/VC8/progs/glut/glut.vcproj + DRI_FILES = \ $(DIRECTORY)/include/GL/internal/dri_interface.h \ -- cgit v1.2.3 From f38dcc8a6a9dc09af123692ce2147675ad7c4ade Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 24 Apr 2007 10:19:19 -0600 Subject: added missing VC8 .sln files --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 8aef783f2e8..8a45efc76cc 100644 --- a/Makefile +++ b/Makefile @@ -289,10 +289,12 @@ MAIN_FILES = \ $(DIRECTORY)/windows/VC7/mesa/mesa.sln \ $(DIRECTORY)/windows/VC7/mesa/mesa/mesa.vcproj \ $(DIRECTORY)/windows/VC7/mesa/osmesa/osmesa.vcproj \ + $(DIRECTORY)/windows/VC8/mesa/mesa.sln \ $(DIRECTORY)/windows/VC8/mesa/gdi/gdi.vcproj \ $(DIRECTORY)/windows/VC8/mesa/glu/glu.vcproj \ $(DIRECTORY)/windows/VC8/mesa/mesa/mesa.vcproj \ $(DIRECTORY)/windows/VC8/mesa/osmesa/osmesa.vcproj \ + $(DIRECTORY)/widnows/VC8/progs/progs.sln \ $(DIRECTORY)/windows/VC8/progs/demos/gears.vcproj \ $(DIRECTORY)/windows/VC8/progs/glut/glut.vcproj -- cgit v1.2.3 From 3e5eda9ee9ff7c0e393dcc5ecb88198f1990c32f Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 24 Apr 2007 10:21:10 -0600 Subject: fix typo --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8a45efc76cc..3eafa44c9b3 100644 --- a/Makefile +++ b/Makefile @@ -294,7 +294,7 @@ MAIN_FILES = \ $(DIRECTORY)/windows/VC8/mesa/glu/glu.vcproj \ $(DIRECTORY)/windows/VC8/mesa/mesa/mesa.vcproj \ $(DIRECTORY)/windows/VC8/mesa/osmesa/osmesa.vcproj \ - $(DIRECTORY)/widnows/VC8/progs/progs.sln \ + $(DIRECTORY)/windows/VC8/progs/progs.sln \ $(DIRECTORY)/windows/VC8/progs/demos/gears.vcproj \ $(DIRECTORY)/windows/VC8/progs/glut/glut.vcproj -- cgit v1.2.3 From 8a8a5bd104e8cd9362415db77d5f6a3945939589 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 24 Apr 2007 16:16:25 -0600 Subject: s/INTERP_TEX/INTERP_ATTRIBS/ --- src/mesa/swrast/s_triangle.c | 4 ++-- src/mesa/swrast/s_tritemp.h | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index 3b7960bf80f..dbb634e3364 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -803,7 +803,7 @@ fast_persp_span(GLcontext *ctx, SWspan *span, #define INTERP_FOG 1 #define INTERP_RGB 1 #define INTERP_ALPHA 1 -#define INTERP_TEX 1 +#define INTERP_ATTRIBS 1 #define SETUP_CODE \ struct persp_info info; \ @@ -874,7 +874,7 @@ fast_persp_span(GLcontext *ctx, SWspan *span, #define INTERP_RGB 1 #define INTERP_SPEC 1 #define INTERP_ALPHA 1 -#define INTERP_TEX 1 +#define INTERP_ATTRIBS 1 #define RENDER_SPAN( span ) _swrast_write_rgba_span(ctx, &span); #include "s_tritemp.h" diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h index 97c79428c06..b8601bd5b4b 100644 --- a/src/mesa/swrast/s_tritemp.h +++ b/src/mesa/swrast/s_tritemp.h @@ -38,7 +38,8 @@ * INTERP_INDEX - if defined, interpolate color index values * INTERP_INT_TEX - if defined, interpolate integer ST texcoords * (fast, simple 2-D texture mapping) - * INTERP_TEX - if defined, interpolate texcoords and varying vars + * INTERP_ATTRIBS - if defined, interpolate arbitrary attribs (texcoords, + * varying vars, etc) * NOTE: OpenGL STRQ = Mesa STUV (R was taken for red) * * When one can directly address pixels in the color buffer the following @@ -601,7 +602,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, span.intTexStep[1] = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_TEX0][1]); } #endif -#ifdef INTERP_TEX +#ifdef INTERP_ATTRIBS span.interpMask |= (SPAN_TEXTURE | SPAN_VARYING); { /* win[3] is 1/W */ @@ -719,7 +720,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, GLfixed sLeft=0, dsOuter=0, dsInner; GLfixed tLeft=0, dtOuter=0, dtInner; #endif -#ifdef INTERP_TEX +#ifdef INTERP_ATTRIBS GLfloat sLeft[FRAG_ATTRIB_MAX]; GLfloat tLeft[FRAG_ATTRIB_MAX]; GLfloat uLeft[FRAG_ATTRIB_MAX]; @@ -986,7 +987,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, dtOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_TEX0][1] + dxOuter * span.attrStepX[FRAG_ATTRIB_TEX0][1]); } #endif -#ifdef INTERP_TEX +#ifdef INTERP_ATTRIBS ATTRIB_LOOP_BEGIN const GLfloat invW = vLower->win[3]; const GLfloat s0 = vLower->attrib[attr][0] * invW; @@ -1057,7 +1058,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, dsInner = dsOuter + span.intTexStep[0]; dtInner = dtOuter + span.intTexStep[1]; #endif -#ifdef INTERP_TEX +#ifdef INTERP_ATTRIBS ATTRIB_LOOP_BEGIN dsInner[attr] = dsOuter[attr] + span.attrStepX[attr][0]; dtInner[attr] = dtOuter[attr] + span.attrStepX[attr][1]; @@ -1106,7 +1107,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, span.intTex[1] = tLeft; #endif -#ifdef INTERP_TEX +#ifdef INTERP_ATTRIBS ATTRIB_LOOP_BEGIN span.attrStart[attr][0] = sLeft[attr]; span.attrStart[attr][1] = tLeft[attr]; @@ -1194,7 +1195,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, sLeft += dsOuter; tLeft += dtOuter; #endif -#ifdef INTERP_TEX +#ifdef INTERP_ATTRIBS ATTRIB_LOOP_BEGIN sLeft[attr] += dsOuter[attr]; tLeft[attr] += dtOuter[attr]; @@ -1239,7 +1240,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, sLeft += dsInner; tLeft += dtInner; #endif -#ifdef INTERP_TEX +#ifdef INTERP_ATTRIBS ATTRIB_LOOP_BEGIN sLeft[attr] += dsInner[attr]; tLeft[attr] += dtInner[attr]; @@ -1276,7 +1277,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, #undef INTERP_SPEC #undef INTERP_INDEX #undef INTERP_INT_TEX -#undef INTERP_TEX +#undef INTERP_ATTRIBS #undef TEX_UNIT_LOOP #undef VARYING_LOOP -- cgit v1.2.3 From 97693436a5740fb56c29fcd1cb0a1aa562349902 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 24 Apr 2007 16:20:50 -0600 Subject: only need one CI-mode triangle function --- src/mesa/swrast/s_triangle.c | 38 +++++++++----------------------------- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index dbb634e3364..975d559e427 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -67,24 +67,9 @@ _swrast_culltriangle( GLcontext *ctx, /* - * Render a flat-shaded color index triangle. + * Render a smooth or flat-shaded color index triangle. */ -#define NAME flat_ci_triangle -#define INTERP_Z 1 -#define INTERP_FOG 1 -#define SETUP_CODE \ - span.interpMask |= SPAN_INDEX; \ - span.index = FloatToFixed(v2->index);\ - span.indexStep = 0; -#define RENDER_SPAN( span ) _swrast_write_index_span(ctx, &span); -#include "s_tritemp.h" - - - -/* - * Render a smooth-shaded color index triangle. - */ -#define NAME smooth_ci_triangle +#define NAME ci_triangle #define INTERP_Z 1 #define INTERP_FOG 1 #define INTERP_INDEX 1 @@ -1054,6 +1039,11 @@ _swrast_choose_triangle( GLcontext *ctx ) } } + if (!rgbmode) { + USE(ci_triangle); + return; + } + if (ctx->Texture._EnabledCoordUnits || ctx->FragmentProgram._Current || ctx->ATIFragmentShader._Enabled) { @@ -1125,21 +1115,11 @@ _swrast_choose_triangle( GLcontext *ctx ) ASSERT(!ctx->Texture._EnabledCoordUnits); if (ctx->Light.ShadeModel==GL_SMOOTH) { /* smooth shaded, no texturing, stippled or some raster ops */ - if (rgbmode) { - USE(smooth_rgba_triangle); - } - else { - USE(smooth_ci_triangle); - } + USE(smooth_rgba_triangle); } else { /* flat shaded, no texturing, stippled or some raster ops */ - if (rgbmode) { - USE(flat_rgba_triangle); - } - else { - USE(flat_ci_triangle); - } + USE(flat_rgba_triangle); } } } -- cgit v1.2.3 From 9ede048127ea71282fd97e01516dedcfb03e2a23 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 24 Apr 2007 16:40:54 -0600 Subject: trim down the number of line drawing functions, special cases --- src/mesa/swrast/s_lines.c | 41 +++++------------------------------------ src/mesa/swrast/s_linetemp.h | 34 +++------------------------------- 2 files changed, 8 insertions(+), 67 deletions(-) diff --git a/src/mesa/swrast/s_lines.c b/src/mesa/swrast/s_lines.c index 7b2a52b4ffa..80702e41a3c 100644 --- a/src/mesa/swrast/s_lines.c +++ b/src/mesa/swrast/s_lines.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.3 * - * 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"), @@ -171,34 +171,13 @@ draw_wide_line( GLcontext *ctx, SWspan *span, GLboolean xMajor ) #include "s_linetemp.h" -/* Single-texture line, w/ fog, Z, specular, etc. */ +/* General-purpose textured line (any/all features). */ #define NAME textured_line #define INTERP_RGBA -#define INTERP_Z -#define INTERP_FOG -#define INTERP_TEX -#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) { \ - draw_wide_line(ctx, &span, (GLboolean)(dx > dy)); \ - } \ - else { \ - _swrast_write_rgba_span(ctx, &span); \ - } -#include "s_linetemp.h" - - -/* Multi-texture or separate specular line, w/ fog, Z, specular, etc. */ -#define NAME multitextured_line -#define INTERP_RGBA #define INTERP_SPEC #define INTERP_Z #define INTERP_FOG -#define INTERP_MULTITEX -#define INTERP_VARYING +#define INTERP_ATTRIBS #define RENDER_SPAN(span) \ if (ctx->Line.StippleFlag) { \ span.arrayMask |= SPAN_MASK; \ @@ -251,8 +230,6 @@ _mesa_print_line_function(GLcontext *ctx) _mesa_printf("general_rgba_line\n"); else if (swrast->Line == textured_line) _mesa_printf("textured_line\n"); - else if (swrast->Line == multitextured_line) - _mesa_printf("multitextured_line\n"); else _mesa_printf("Driver func %p\n", (void *(*)()) swrast->Line); } @@ -302,15 +279,7 @@ _swrast_choose_line( GLcontext *ctx ) else if (ctx->Texture._EnabledCoordUnits || ctx->FragmentProgram._Current) { /* textured lines */ - if (ctx->Texture._EnabledCoordUnits > 0x1 - || NEED_SECONDARY_COLOR(ctx) - || ctx->FragmentProgram._Current) { - /* multi-texture and/or separate specular color */ - USE(multitextured_line); - } - else { - USE(textured_line); - } + USE(textured_line); } else if (ctx->Depth.Test || swrast->_FogEnabled || ctx->Line._Width != 1.0 || ctx->Line.StippleFlag) { diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h index 76da4467104..b6e8f287f45 100644 --- a/src/mesa/swrast/s_linetemp.h +++ b/src/mesa/swrast/s_linetemp.h @@ -35,9 +35,7 @@ * INTERP_RGBA - if defined, interpolate RGBA values * INTERP_SPEC - if defined, interpolate specular RGB values * INTERP_INDEX - if defined, interpolate color index values - * INTERP_TEX - if defined, interpolate unit 0 texcoords - * INTERP_MULTITEX - if defined, interpolate multi-texcoords - * INTERP_VARYING - if defined, interpolate GLSL varyings + * INTERP_ATTRIBS - if defined, interpolate attribs (texcoords, varying, etc) * * When one can directly address pixels in the color buffer the following * macros can be defined and used to directly compute pixel addresses during @@ -284,32 +282,7 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 ) span.attrStepX[FRAG_ATTRIB_FOGC][0] = (vert1->attrib[FRAG_ATTRIB_FOGC][0] - vert0->attrib[FRAG_ATTRIB_FOGC][0]) / numPixels; #endif -#ifdef INTERP_TEX - interpFlags |= SPAN_TEXTURE; - { - const GLfloat invw0 = vert0->win[3]; - const GLfloat invw1 = vert1->win[3]; - const GLfloat invLen = 1.0F / numPixels; - GLfloat ds, dt, dr, dq; - span.attrStart[FRAG_ATTRIB_TEX0][0] = invw0 * vert0->attrib[FRAG_ATTRIB_TEX0][0]; - span.attrStart[FRAG_ATTRIB_TEX0][1] = invw0 * vert0->attrib[FRAG_ATTRIB_TEX0][1]; - span.attrStart[FRAG_ATTRIB_TEX0][2] = invw0 * vert0->attrib[FRAG_ATTRIB_TEX0][2]; - span.attrStart[FRAG_ATTRIB_TEX0][3] = invw0 * vert0->attrib[FRAG_ATTRIB_TEX0][3]; - ds = (invw1 * vert1->attrib[FRAG_ATTRIB_TEX0][0]) - span.attrStart[FRAG_ATTRIB_TEX0][0]; - dt = (invw1 * vert1->attrib[FRAG_ATTRIB_TEX0][1]) - span.attrStart[FRAG_ATTRIB_TEX0][1]; - dr = (invw1 * vert1->attrib[FRAG_ATTRIB_TEX0][2]) - span.attrStart[FRAG_ATTRIB_TEX0][2]; - dq = (invw1 * vert1->attrib[FRAG_ATTRIB_TEX0][3]) - span.attrStart[FRAG_ATTRIB_TEX0][3]; - span.attrStepX[FRAG_ATTRIB_TEX0][0] = ds * invLen; - span.attrStepX[FRAG_ATTRIB_TEX0][1] = dt * invLen; - span.attrStepX[FRAG_ATTRIB_TEX0][2] = dr * invLen; - span.attrStepX[FRAG_ATTRIB_TEX0][3] = dq * invLen; - span.attrStepY[FRAG_ATTRIB_TEX0][0] = 0.0F; - span.attrStepY[FRAG_ATTRIB_TEX0][1] = 0.0F; - span.attrStepY[FRAG_ATTRIB_TEX0][2] = 0.0F; - span.attrStepY[FRAG_ATTRIB_TEX0][3] = 0.0F; - } -#endif -#if defined(INTERP_MULTITEX) || defined(INTERP_VARYING) +#if defined(INTERP_ATTRIBS) interpFlags |= (SPAN_TEXTURE | SPAN_VARYING); { const GLfloat invLen = 1.0F / numPixels; @@ -443,8 +416,7 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 ) #undef INTERP_FOG #undef INTERP_RGBA #undef INTERP_SPEC -#undef INTERP_TEX -#undef INTERP_MULTITEX +#undef INTERP_ATTRIBS #undef INTERP_INDEX #undef PIXEL_ADDRESS #undef PIXEL_TYPE -- cgit v1.2.3 From ddcf81990625aae34dfc65fedb17913f279fe9f7 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 24 Apr 2007 16:47:07 -0600 Subject: s/TEXTURE/ATTRIBS/ --- src/mesa/swrast/s_points.c | 10 +++++----- src/mesa/swrast/s_pointtemp.h | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/mesa/swrast/s_points.c b/src/mesa/swrast/s_points.c index 5879bccf1e3..1401b772caf 100644 --- a/src/mesa/swrast/s_points.c +++ b/src/mesa/swrast/s_points.c @@ -38,7 +38,7 @@ #define RGBA 0x1 #define INDEX 0x2 #define SMOOTH 0x4 -#define TEXTURE 0x8 +#define ATTRIBS 0x8 #define SPECULAR 0x10 #define LARGE 0x20 #define ATTENUATE 0x40 @@ -104,7 +104,7 @@ /* * Textured RGBA points. */ -#define FLAGS (RGBA | LARGE | TEXTURE | SPECULAR) +#define FLAGS (RGBA | LARGE | ATTRIBS | SPECULAR) #define NAME textured_rgba_point #include "s_pointtemp.h" @@ -112,7 +112,7 @@ /* * Antialiased points with texture mapping. */ -#define FLAGS (RGBA | SMOOTH | TEXTURE | SPECULAR) +#define FLAGS (RGBA | SMOOTH | ATTRIBS | SPECULAR) #define NAME antialiased_tex_rgba_point #include "s_pointtemp.h" @@ -128,7 +128,7 @@ /* * Distance attenuated, textured RGBA points. */ -#define FLAGS (RGBA | ATTENUATE | TEXTURE | SPECULAR) +#define FLAGS (RGBA | ATTENUATE | ATTRIBS | SPECULAR) #define NAME atten_textured_rgba_point #include "s_pointtemp.h" @@ -136,7 +136,7 @@ /* * Distance attenuated, antialiased points with or without texture mapping. */ -#define FLAGS (RGBA | ATTENUATE | TEXTURE | SMOOTH) +#define FLAGS (RGBA | ATTENUATE | ATTRIBS | SMOOTH) #define NAME atten_antialiased_rgba_point #include "s_pointtemp.h" diff --git a/src/mesa/swrast/s_pointtemp.h b/src/mesa/swrast/s_pointtemp.h index 500b3fef9df..d118a532a45 100644 --- a/src/mesa/swrast/s_pointtemp.h +++ b/src/mesa/swrast/s_pointtemp.h @@ -39,14 +39,14 @@ * * RGBA = do rgba instead of color index * SMOOTH = do antialiasing - * TEXTURE = do texture coords + * 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 * * Notes: LARGE and ATTENUATE are exclusive of each other. - * TEXTURE requires RGBA + * ATTRIBS requires RGBA */ @@ -86,7 +86,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) #if FLAGS & INDEX const GLuint colorIndex = (GLuint) vert->index; /* XXX round? */ #endif -#if FLAGS & TEXTURE +#if FLAGS & ATTRIBS GLfloat attrib[FRAG_ATTRIB_MAX][4]; /* texture & varying */ #endif SWcontext *swrast = SWRAST_CONTEXT(ctx); @@ -117,7 +117,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) #if FLAGS & INDEX span->arrayMask |= SPAN_INDEX; #endif -#if FLAGS & TEXTURE +#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) */ @@ -272,7 +272,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) #if FLAGS & INDEX span->array->index[count] = colorIndex; #endif -#if FLAGS & TEXTURE +#if FLAGS & ATTRIBS ATTRIB_LOOP_BEGIN COPY_4V(span->array->attribs[attr][count], attrib[attr]); if (attr < FRAG_ATTRIB_VAR0) { @@ -397,7 +397,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) #if FLAGS & INDEX span->array->index[count] = colorIndex; #endif -#if FLAGS & TEXTURE +#if FLAGS & ATTRIBS ATTRIB_LOOP_BEGIN COPY_4V(span->array->attribs[attr][count], attribs[attr]); ATTRIB_LOOP_END -- cgit v1.2.3 From 4003bde6fffc3e5b9e1a115ba952b988dffb099a Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 24 Apr 2007 16:47:33 -0600 Subject: get rid of an extra textured triangle function --- src/mesa/swrast/s_triangle.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index 975d559e427..fc9d29bbf7f 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -124,7 +124,7 @@ _swrast_culltriangle( GLcontext *ctx, * Render an RGB, GL_DECAL, textured triangle. * Interpolate S,T only w/out mipmapping or perspective correction. * - * No fog. + * No fog. No depth testing. */ #define NAME simple_textured_triangle #define INTERP_INT_TEX 1 @@ -850,9 +850,9 @@ fast_persp_span(GLcontext *ctx, SWspan *span, /* - * Render a smooth-shaded, textured, RGBA triangle. + * Render an RGBA triangle with arbitrary attributes. */ -#define NAME general_textured_triangle +#define NAME general_triangle #define INTERP_Z 1 #define INTERP_W 1 #define INTERP_FOG 1 @@ -1092,7 +1092,7 @@ _swrast_choose_triangle( GLcontext *ctx ) } else { #if (CHAN_BITS == 16 || CHAN_BITS == 32) - USE(general_textured_triangle); + USE(general_triangle); #else USE(affine_textured_triangle); #endif @@ -1100,7 +1100,7 @@ _swrast_choose_triangle( GLcontext *ctx ) } else { #if (CHAN_BITS == 16 || CHAN_BITS == 32) - USE(general_textured_triangle); + USE(general_triangle); #else USE(persp_textured_triangle); #endif @@ -1108,7 +1108,7 @@ _swrast_choose_triangle( GLcontext *ctx ) } else { /* general case textured triangles */ - USE(general_textured_triangle); + USE(general_triangle); } } else { -- cgit v1.2.3 From eca456b63d41700617987ba45a09e8f2168b9577 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 24 Apr 2007 16:57:38 -0600 Subject: s/DO_TEXVAR/DO_ATTRIBS/ --- src/mesa/swrast/s_aaline.c | 6 +++--- src/mesa/swrast/s_aalinetemp.h | 8 ++++---- src/mesa/swrast/s_aatriangle.c | 4 ++-- src/mesa/swrast/s_aatritemp.h | 18 +++++++++--------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/mesa/swrast/s_aaline.c b/src/mesa/swrast/s_aaline.c index c81095163b0..3bb53dc2d7f 100644 --- a/src/mesa/swrast/s_aaline.c +++ b/src/mesa/swrast/s_aaline.c @@ -67,7 +67,7 @@ struct LineInfo GLfloat iPlane[4]; /* DO_SPEC */ GLfloat srPlane[4], sgPlane[4], sbPlane[4]; - /* DO_TEXVAR */ + /* DO_ATTRIBS */ GLfloat sPlane[FRAG_ATTRIB_MAX][4]; GLfloat tPlane[FRAG_ATTRIB_MAX][4]; GLfloat uPlane[FRAG_ATTRIB_MAX][4]; @@ -499,7 +499,7 @@ segment(GLcontext *ctx, #define DO_Z #define DO_FOG #define DO_RGBA -#define DO_TEXVAR +#define DO_ATTRIBS #include "s_aalinetemp.h" @@ -507,7 +507,7 @@ segment(GLcontext *ctx, #define DO_Z #define DO_FOG #define DO_RGBA -#define DO_TEXVAR +#define DO_ATTRIBS #define DO_SPEC #include "s_aalinetemp.h" diff --git a/src/mesa/swrast/s_aalinetemp.h b/src/mesa/swrast/s_aalinetemp.h index ef26e9edc8b..402d64b9f75 100644 --- a/src/mesa/swrast/s_aalinetemp.h +++ b/src/mesa/swrast/s_aalinetemp.h @@ -80,7 +80,7 @@ NAME(plot)(GLcontext *ctx, struct LineInfo *line, int ix, int iy) 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_TEXVAR) +#if defined(DO_ATTRIBS) ATTRIB_LOOP_BEGIN GLfloat (*attribArray)[4] = line->span.array->attribs[attr]; GLfloat invQ; @@ -202,7 +202,7 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1) constant_plane(v1->index, line.iPlane); } #endif -#if defined(DO_TEXVAR) +#if defined(DO_ATTRIBS) { const GLfloat invW0 = v0->win[3]; const GLfloat invW1 = v1->win[3]; @@ -225,7 +225,7 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1) const struct gl_texture_object *obj = ctx->Texture.Unit[u]._Current; const struct gl_texture_image *texImage = obj->Image[0][obj->BaseLevel]; line.texWidth[attr] = (GLfloat) texImage->Width; - line.texHeight[attr] = (GLfloat) texImage->Height; + line.texHeight[attr] = (GLfloat) texImage->Height; } ATTRIB_LOOP_END } @@ -290,5 +290,5 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1) #undef DO_RGBA #undef DO_INDEX #undef DO_SPEC -#undef DO_TEXVAR +#undef DO_ATTRIBS #undef NAME diff --git a/src/mesa/swrast/s_aatriangle.c b/src/mesa/swrast/s_aatriangle.c index 5e3059af93b..0d95f06a9de 100644 --- a/src/mesa/swrast/s_aatriangle.c +++ b/src/mesa/swrast/s_aatriangle.c @@ -408,7 +408,7 @@ tex_aa_tri(GLcontext *ctx, #define DO_Z #define DO_FOG #define DO_RGBA -#define DO_TEXVAR +#define DO_ATTRIBS #include "s_aatritemp.h" } @@ -422,7 +422,7 @@ spec_tex_aa_tri(GLcontext *ctx, #define DO_Z #define DO_FOG #define DO_RGBA -#define DO_TEXVAR +#define DO_ATTRIBS #define DO_SPEC #include "s_aatritemp.h" } diff --git a/src/mesa/swrast/s_aatritemp.h b/src/mesa/swrast/s_aatritemp.h index 8ff52cb932b..39456cc192b 100644 --- a/src/mesa/swrast/s_aatritemp.h +++ b/src/mesa/swrast/s_aatritemp.h @@ -36,7 +36,7 @@ * DO_RGBA - if defined, compute RGBA values * DO_INDEX - if defined, compute color index values * DO_SPEC - if defined, compute specular RGB values - * DO_TEXVAR - if defined, compute texcoords, varying + * DO_ATTRIBS - if defined, compute texcoords, varying, etc. */ /*void triangle( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv )*/ @@ -70,7 +70,7 @@ #ifdef DO_SPEC GLfloat srPlane[4], sgPlane[4], sbPlane[4]; #endif -#if defined(DO_TEXVAR) +#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 */ @@ -181,7 +181,7 @@ } span.arrayMask |= SPAN_SPEC; #endif -#if defined(DO_TEXVAR) +#if defined(DO_ATTRIBS) { const GLfloat invW0 = v0->win[3]; const GLfloat invW1 = v1->win[3]; @@ -283,7 +283,7 @@ array->spec[count][GCOMP] = solve_plane_chan(cx, cy, sgPlane); array->spec[count][BCOMP] = solve_plane_chan(cx, cy, sbPlane); #endif -#if defined(DO_TEXVAR) +#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; @@ -375,7 +375,7 @@ array->spec[ix][GCOMP] = solve_plane_chan(cx, cy, sgPlane); array->spec[ix][BCOMP] = solve_plane_chan(cx, cy, sbPlane); #endif -#if defined(DO_TEXVAR) +#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; @@ -426,13 +426,13 @@ array->attribs[FRAG_ATTRIB_FOGC][j][0] = array->attribs[FRAG_ATTRIB_FOGC][j + left][0]; #endif -#if defined(DO_TEXVAR) +#if defined(DO_ATTRIBS) array->lambda[0][j] = array->lambda[0][j + left]; #endif array->coverage[j] = array->coverage[j + left]; } } -#ifdef DO_TEXVAR +#ifdef DO_ATTRIBS /* shift texcoords, varying */ { SWspanarrays *array = span.array; @@ -482,8 +482,8 @@ #undef DO_SPEC #endif -#ifdef DO_TEXVAR -#undef DO_TEXVAR +#ifdef DO_ATTRIBS +#undef DO_ATTRIBS #endif #ifdef DO_OCCLUSION_TEST -- cgit v1.2.3 From c93b2a1cb71cef1a7fe900fb937a510ae4005ff2 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 24 Apr 2007 22:22:14 -0600 Subject: s/fog/attrib[FRAG_ATTRIB_FOGC][0]/ --- src/mesa/drivers/dri/mach64/mach64_native_vb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/mach64/mach64_native_vb.c b/src/mesa/drivers/dri/mach64/mach64_native_vb.c index 519ec81e548..81bcf802c71 100644 --- a/src/mesa/drivers/dri/mach64/mach64_native_vb.c +++ b/src/mesa/drivers/dri/mach64/mach64_native_vb.c @@ -81,7 +81,7 @@ void TAG(translate_vertex)(GLcontext *ctx, dst->specular[2] = ((GLubyte *)p)[0]; dst->specular[1] = ((GLubyte *)p)[1]; dst->specular[0] = ((GLubyte *)p)[2]; - dst->fog = ((GLubyte *)p)[3]; + dst->attrib[FRAG_ATTRIB_FOGC][0] = ((GLubyte *)p)[3]; p++; case TINY_VERTEX_FORMAT: -- cgit v1.2.3 From c233aa27684cd0c6c44200c3afcf4a9d5863a947 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 24 Apr 2007 22:32:41 -0600 Subject: s/fog/attrib[FRAG_ATTRIB_FOGC][0]/ --- src/mesa/tnl_dd/t_dd_vb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/tnl_dd/t_dd_vb.c b/src/mesa/tnl_dd/t_dd_vb.c index 629f328a4d1..6cdd1bc0313 100644 --- a/src/mesa/tnl_dd/t_dd_vb.c +++ b/src/mesa/tnl_dd/t_dd_vb.c @@ -135,7 +135,7 @@ void TAG(translate_vertex)(GLcontext *ctx, dst->specular[1] = src->v.specular.green; dst->specular[2] = src->v.specular.blue; - dst->fog = src->v.specular.alpha/255.0; + dst->attrib[FRAG_ATTRIB_FOGC][0] = src->v.specular.alpha/255.0; if (HAVE_PTEX_VERTICES && ((HAVE_TEX2_VERTICES && format == PROJ_TEX3_VERTEX_FORMAT) || -- cgit v1.2.3 From 6d27194dffa52e076aba49edb222a70fcc77628b Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 25 Apr 2007 09:58:15 -0600 Subject: fix attribsMask (re-fixes depth peeling algorithm) --- src/mesa/swrast/s_context.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index c55de89085d..2f25edbd811 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -536,6 +536,13 @@ _swrast_update_fragment_attribs(GLcontext *ctx) } } + /* 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); + /* Update _ActiveAttribs[] list */ { GLuint i, num = 0; -- cgit v1.2.3 From 3de20aead2b3d6f8cf6e99e5f8e15cff13d638cf Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 25 Apr 2007 10:01:30 -0600 Subject: RC4 --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 3eafa44c9b3..014d7aa9c39 100644 --- a/Makefile +++ b/Makefile @@ -155,10 +155,10 @@ ultrix-gcc: # Rules for making release tarballs -DIRECTORY = Mesa-6.5.3rc3 -LIB_NAME = MesaLib-6.5.3rc3 -DEMO_NAME = MesaDemos-6.5.3rc3 -GLUT_NAME = MesaGLUT-6.5.3rc3 +DIRECTORY = Mesa-6.5.3rc4 +LIB_NAME = MesaLib-6.5.3rc4 +DEMO_NAME = MesaDemos-6.5.3rc4 +GLUT_NAME = MesaGLUT-6.5.3rc4 MAIN_FILES = \ $(DIRECTORY)/Makefile* \ -- cgit v1.2.3 From 5814922d25fffb043b75ba8c1fd601e740e25ad7 Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Wed, 25 Apr 2007 10:28:37 -0600 Subject: updates for 6.5.3 w/ VC8 --- docs/README.WIN32 | 318 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 163 insertions(+), 155 deletions(-) diff --git a/docs/README.WIN32 b/docs/README.WIN32 index 8dc59b00fd4..ce595076bd5 100644 --- a/docs/README.WIN32 +++ b/docs/README.WIN32 @@ -1,155 +1,163 @@ -File: docs/README.WIN32 - -Last updated: Mar 31, 2006 - Karl Schultz - kschultz@users.sourceforge.net - -Quick Start ------ ----- - -Unzip the MesaLib, MesaGLUT, and MesaDemos ZIP files into the same -directory. The libs and demos build separately, so if you do not care -about the demos or GLUT, you only need to unzip MesaLib. If you unzip -more than one ZIP file, they all need to be unzipped into the same -directory. Don't worry, you will not overwrite anything. - -The Windows build system uses Microsoft Visual Studio. Project files -for a specific version of Visual Studio are in their own directory in -the top-level "windows" directory. For example, Visual Studio 6 files -are in windows/VC6. If a directory does not exist for your version of -Visual Studio, you can try importing the project files from an earlier -version of Visual Studio. At this time, project files exist for -Version 6 and Version 7. The code has been built with a beta version -of Version 8 and it runs on 64-bit Windows. If you want to try this, -start by importing the VC7 files and create the 64-bit targets in the -configuration manager. - -It is likely that the new and free Visual Studio Express can be used -to build Mesa, but it hasn't been tried yet. Start with the VC7 -project files. - -The project files to build the core Mesa library, Windows Mesa -drivers, OSMesa, and GLU are in the mesa directory. The project files -to build GLUT and some demo programs are in the progs directory. - -Makefiles are no longer shipped or supported, but can be generated -from the projects using Visual Studio. - - -Windows Drivers -------- ------- - -At this time, only the GDI driver is known to work. Most of the demos -in progs/demos should work with this driver. - -Source code also exists in the tree for other drivers in -src/mesa/drivers/windows, but the status of this code is unknown. - -The GDI driver operates basically by writing pixel spans into a DIB -section and then blitting the DIB to the window. The driver was -recently cleaned up and rewitten and so may have bugs or may be -missing some functionality. The older versions of the CVS source may -be useful in figuring out any problems, or report them to me. - -To build Mesa with the GDI driver, build the mesa, gdi, and glu -projects in the Visual Studio workspace found at - - windows/VC6/mesa/mesa.dsw -or - windows/VC7/mesa/mesa.sln - -The osmesa DLL can also be built with the osmesa project. - -The build system creates a lib top-level directory and copies -resulting LIB and DLL files to this lib directory. The files are: - - OPENGL32.LIB, GLU32.LIB, OSMESA32.LIB - OPENGL32.DLL, GLU32.DLL, OSMESA32.DLL - -If the MesaDemos ZIP file was extracted, the DLL files are also copied -to the demos directory. This facilitates running the demos as described -below. - - -GLUT and Demos ----- --- ----- - -A Visual Studio workspace can be found at - - windows/VC6/progs/progs.dsw -or - windows/VC7/progs/progs.sln - -It can be used to build GLUT and a few demos. The GLUT lib and DLL -are copied to the top-level lib directory, along with the Mesa libs. - -The demo build system expects to find the LIB files in the top level -lib directory, so you must build the Mesa libs first. The demo -executables are placed in the demos directory, because some of them -rely on data files found there. Also, the Mesa lib DLL's were copied -there by the Mesa lib build process. Therefore, you should be able to -simply run the demo executables from the demo directory. - -If you want to run the demos from the Visual Studio, you may have to -change the startup directory and explicitly state where the executables are. - -You may also build all the demo programs by using a makefile. Go to -the progs/demos directory and make sure you have executed VCVARS32.BAT -or whatever setup script is appropriate for your compiler. Then, - - nmake -f Makefile.win - -should build all the demos. - - -Build System Notes ------ ------ ----- - -VC6 ---- - -Visual Studio 6 does not recognize files with the .cc extension as C++ -language files, without a lot of unnatural tweaking. So, the VC6 -build process uses custom build steps to compile these files in the -GLU library. - -Two additional configurations are provided, Debug x86 and Release x86 -that activate the shader code compilation by defining SLANG_86. It is -unknown if and how this works. - -VC7 ---- - -The above-mentioned .cc problem does not exist in this version. - - -General -------- - -After building, you can copy the above DLL files to a place in your -PATH such as $SystemRoot/SYSTEM32. If you don't like putting things -in a system directory, place them in the same directory as the -executable(s). Be careful about accidentially overwriting files of -the same name in the SYSTEM32 directory. - -The DLL files are built so that the external entry points use the -stdcall calling convention. - -Static LIB files are not built. The LIB files that are built with are -the linker import files associated with the DLL files. - -The si-glu sources are used to build the GLU libs. This was done -mainly to get the better tessellator code. - -To build "mangled" Mesa, add the preprocessor define USE_MGL_NAMESPACE -to the project settings. You will also need to edit src/mesa.def to -change all the gl* symbols to mgl*. Because this is easy to do with a -global replace operation in a text editor, no additional mangled -version of mesa.def is maintained or shipped. - -If you have a Windows-related build problem or question, it is -probably better to direct it to me (kschultz@users.sourceforge.net), -rather than directly to the other Mesa developers. I will help you as -much as I can. I also monitor the Mesa mailing lists and will answer -questions in this area there as well. - - -Karl Schultz +File: docs/README.WIN32 + +Last updated: Apr 25, 2007 - Karl Schultz - kschultz@users.sourceforge.net + +Quick Start +----- ----- + +Unzip the MesaLib, MesaGLUT, and MesaDemos ZIP files into the same +directory. The libs and demos build separately, so if you do not care +about the demos or GLUT, you only need to unzip MesaLib. If you unzip +more than one ZIP file, they all need to be unzipped into the same +directory. Don't worry, you will not overwrite anything. + +The Windows build system uses Microsoft Visual Studio. Project files +for a specific version of Visual Studio are in their own directory in +the top-level "windows" directory. For example, Visual Studio 8 files +are in windows/VC8. + +Support has been dropped for versions of Visual Studio prior to 8. The +main reason is because Microsoft now provides a free compiler and +developer environment. Visual Studio Express can be found at + +http://msdn.microsoft.com/vstudio/express/visualc/default.aspx + +You'll also need the Platform SDK. Instructions for obtaining and +using the SDK with Visual Studio Express can be found at + +http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/ + +If you are stuck using VC6 or VC7, you may start with these project +files, but you may need to modify them to reflect changes in the +Mesa source code tree. If you sucessfully update the project files, +please submit them to the author of this document so that they may +be included in the next distribution. + +The project files to build the core Mesa library, Windows Mesa +drivers, OSMesa, and GLU are in the mesa directory. The project files +to build GLUT and some demo programs are in the progs directory. + +Makefiles are no longer shipped or supported, but can be generated +from the projects using Visual Studio. + + +Windows Drivers +------- ------- + +At this time, only the GDI driver is known to work. Most of the demos +in progs/demos should work with this driver. + +Source code also exists in the tree for other drivers in +src/mesa/drivers/windows, but the status of this code is unknown. + +The GDI driver operates basically by writing pixel spans into a DIB +section and then blitting the DIB to the window. The driver was +recently cleaned up and rewitten and so may have bugs or may be +missing some functionality. The older versions of the CVS source may +be useful in figuring out any problems, or report them to me. + +To build Mesa with the GDI driver, build the mesa, gdi, and glu +projects in the Visual Studio workspace found at + + windows/VC8/mesa/mesa.sln + +The osmesa DLL can also be built with the osmesa project. + +The build system creates a lib top-level directory and copies +resulting LIB and DLL files to this lib directory. The files are: + + OPENGL32.LIB, GLU32.LIB, OSMESA32.LIB + OPENGL32.DLL, GLU32.DLL, OSMESA32.DLL + +If the MesaDemos ZIP file was extracted, the DLL files are also copied +to the demos directory. This facilitates running the demos as described +below. + + +GLUT and Demos +---- --- ----- + +A Visual Studio workspace can be found at + + windows/VC8/progs/progs.sln + +It can be used to build GLUT and a few demos. The GLUT lib and DLL +are copied to the top-level lib directory, along with the Mesa libs. + +The demo build system expects to find the LIB files in the top level +lib directory, so you must build the Mesa libs first. The demo +executables are placed in the demos directory, because some of them +rely on data files found there. Also, the Mesa lib DLL's were copied +there by the Mesa lib build process. Therefore, you should be able to +simply run the demo executables from the demo directory. + +If you want to run the demos from the Visual Studio, you may have to +change the startup directory and explicitly state where the executables are. + +You may also build all the demo programs by using a makefile. Go to +the progs/demos directory and make sure you have executed VCVARS32.BAT +or whatever setup script is appropriate for your compiler. Then, + + nmake -f Makefile.win + +should build all the demos. + + +Build System Notes +----- ------ ----- + +VC6 (not actively supported) +--- + +Visual Studio 6 does not recognize files with the .cc extension as C++ +language files, without a lot of unnatural tweaking. So, the VC6 +build process uses custom build steps to compile these files in the +GLU library. + +Two additional configurations are provided, Debug x86 and Release x86 +that activate the shader code compilation by defining SLANG_86. It is +unknown if and how this works. + +VC7 (not actively supported) +--- + +The above-mentioned .cc problem does not exist in this version. + +VC8 +--- + +No notes. + + +General +------- + +After building, you can copy the above DLL files to a place in your +PATH such as $SystemRoot/SYSTEM32. If you don't like putting things +in a system directory, place them in the same directory as the +executable(s). Be careful about accidentially overwriting files of +the same name in the SYSTEM32 directory. + +The DLL files are built so that the external entry points use the +stdcall calling convention. + +Static LIB files are not built. The LIB files that are built with are +the linker import files associated with the DLL files. + +The si-glu sources are used to build the GLU libs. This was done +mainly to get the better tessellator code. + +To build "mangled" Mesa, add the preprocessor define USE_MGL_NAMESPACE +to the project settings. You will also need to edit src/mesa.def to +change all the gl* symbols to mgl*. Because this is easy to do with a +global replace operation in a text editor, no additional mangled +version of mesa.def is maintained or shipped. + +If you have a Windows-related build problem or question, it is +probably better to direct it to me (kschultz@users.sourceforge.net), +rather than directly to the other Mesa developers. I will help you as +much as I can. I also monitor the Mesa mailing lists and will answer +questions in this area there as well. + + +Karl Schultz -- cgit v1.2.3 From 4a28548cbfa425edd8b8ad16c93869a9c612a42f Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 26 Apr 2007 07:46:38 -0600 Subject: use sqrt(), not sqrtf() for Windows --- progs/demos/arbfslight.c | 2 +- progs/demos/fslight.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/progs/demos/arbfslight.c b/progs/demos/arbfslight.c index 374de568872..69575f06236 100644 --- a/progs/demos/arbfslight.c +++ b/progs/demos/arbfslight.c @@ -62,7 +62,7 @@ static PFNGLUNIFORM3FVARBPROC glUniform4fvARB = NULL; static void normalize (GLfloat *dst, const GLfloat *src) { - GLfloat len = sqrtf (src[0] * src[0] + src[1] * src[1] + src[2] * src[2]); + GLfloat len = sqrt (src[0] * src[0] + src[1] * src[1] + src[2] * src[2]); dst[0] = src[0] / len; dst[1] = src[1] / len; dst[2] = src[2] / len; diff --git a/progs/demos/fslight.c b/progs/demos/fslight.c index 493ce0e90f1..e6d83bf8fb3 100644 --- a/progs/demos/fslight.c +++ b/progs/demos/fslight.c @@ -58,7 +58,7 @@ static GLfloat xRot = 90.0f, yRot = 0.0f; static void normalize(GLfloat *dst, const GLfloat *src) { - GLfloat len = sqrtf(src[0] * src[0] + src[1] * src[1] + src[2] * src[2]); + GLfloat len = sqrt(src[0] * src[0] + src[1] * src[1] + src[2] * src[2]); dst[0] = src[0] / len; dst[1] = src[1] / len; dst[2] = src[2] / len; -- cgit v1.2.3 From f42d4ab41ed5d6a160e9902cd9e81ca644e31a35 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 26 Apr 2007 07:46:59 -0600 Subject: move #include after other #includes for Windows --- progs/demos/tessdemo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/progs/demos/tessdemo.c b/progs/demos/tessdemo.c index 26403eee0a2..f71cea12744 100644 --- a/progs/demos/tessdemo.c +++ b/progs/demos/tessdemo.c @@ -4,10 +4,10 @@ * Updated for GLU 1.3 tessellation by Gareth Hughes */ -#include #include #include #include +#include #define MAX_POINTS 256 #define MAX_CONTOURS 32 -- cgit v1.2.3 From 1dd7c002143703f2eb76c0f372b6913bf7e06cf7 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 26 Apr 2007 07:48:35 -0600 Subject: Windows updates --- progs/demos/Makefile.win | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/progs/demos/Makefile.win b/progs/demos/Makefile.win index 4ac32361b26..0d0b19b9fe7 100644 --- a/progs/demos/Makefile.win +++ b/progs/demos/Makefile.win @@ -22,9 +22,11 @@ LIBS = GLUT32.LIB OPENGL32.LIB all: OPENGL32.DLL GLU32.DLL GLUT32.DLL \ readtex.h readtex.c showbuffer.h showbuffer.c \ + extfuncs.h trackball.h trackball.c \ arbfplight.exe arbfslight.exe arbocclude.exe bounce.exe \ - clearspd.exe cubemap.exe drawpix.exe fire.exe fogcoord.exe \ - fplight.exe gamma.exe gearbox.exe \ + clearspd.exe cubemap.exe drawpix.exe engine.exe \ + fire.exe fogcoord.exe \ + fplight.exe fslight.exe gamma.exe gearbox.exe \ gears.exe geartrain.exe gloss.exe \ glinfo.exe glslnoise.exe \ gltestperf.exe glutfx.exe ipers.exe isosurf.exe lodbias.exe \ @@ -42,14 +44,16 @@ bounce.exe: bounce.obj clearspd.exe: clearspd.obj cubemap.exe: cubemap.obj readtex.obj drawpix.exe: drawpix.obj readtex.obj +engine.exe: engine.obj readtex.obj trackball.obj fire.exe: fire.obj readtex.obj fogcoord.exe: fogcoord.obj readtex.obj fplight.exe: fplight.obj +fslight.exe: fslight.obj gamma.exe: gamma.obj gearbox.exe: gearbox.obj gears.exe: gears.obj geartrain.exe: geartrain.obj -gloss.exe: gloss.obj readtex.obj +gloss.exe: gloss.obj readtex.obj trackball.obj glinfo.exe: glinfo.obj glslnoise.exe: glslnoise.obj gltestperf.exe: gltestperf.obj @@ -105,14 +109,23 @@ showbuffer.c: $(TOP)\progs\util\showbuffer.c showbuffer.h: $(TOP)\progs\util\showbuffer.h copy $** . +trackball.c: $(TOP)\progs\util\trackball.c + copy $** . + +trackball.h: $(TOP)\progs\util\trackball.h + copy $** . + +extfuncs.h: $(TOP)\progs\util\extfuncs.h + copy $** . + .obj.exe: $(link) $(ldebug) -out:$@ $** /LIBPATH:$(LIBDIR) $(LIBS) .c.obj: - $(cc) $(cdebug) $(cflags) $(cvars) /I$(INCDIR) $*.c + $(cc) $(cdebug) $(cflags) $(cvars) -D_USE_MATH_DEFINES /I$(INCDIR) $*.c clean:: - del *.obj *.exe readtex.* showbuffer.* + del *.obj *.exe readtex.* showbuffer.* trackball.* clobber:: -- cgit v1.2.3 From 1606f2c1230cc01482b5dacb7596835a00299411 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 26 Apr 2007 07:49:33 -0600 Subject: enable 2.1 extensions --- src/mesa/drivers/windows/gdi/wmesa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c index 00d9ee77835..c5cd2c615b7 100644 --- a/src/mesa/drivers/windows/gdi/wmesa.c +++ b/src/mesa/drivers/windows/gdi/wmesa.c @@ -1239,6 +1239,7 @@ WMesaContext WMesaCreateContext(HDC hDC, _mesa_enable_1_4_extensions(ctx); _mesa_enable_1_5_extensions(ctx); _mesa_enable_2_0_extensions(ctx); + _mesa_enable_2_1_extensions(ctx); /* Initialize the software rasterizer and helper modules. */ if (!_swrast_CreateContext(ctx) || -- cgit v1.2.3 From 4099531a0af5717087dca993ba780ec98936c4fc Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 26 Apr 2007 07:50:26 -0600 Subject: bump Windows to OpenGL 2.1, set release date --- docs/relnotes-6.5.3.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/relnotes-6.5.3.html b/docs/relnotes-6.5.3.html index 61ae904d02a..0e69a84ee0e 100644 --- a/docs/relnotes-6.5.3.html +++ b/docs/relnotes-6.5.3.html @@ -8,7 +8,7 @@ -

    Mesa 6.5.3 Release Notes / April ??, 2007

    +

    Mesa 6.5.3 Release Notes / April 26, 2007

    Mesa 6.5.3 is a development release with many changes and new features. @@ -96,7 +96,7 @@ Driver Status DRI drivers varies with the driver XMesa/GLX (on Xlib) implements OpenGL 2.1 OSMesa (off-screen) implements OpenGL 2.1 -Windows/Win32 implements OpenGL 1.5 +Windows/Win32 implements OpenGL 2.1 Glide (3dfx Voodoo1/2) implements OpenGL 1.3 SVGA unsupported Wind River UGL unsupported -- cgit v1.2.3 From b7f5b8af65603002f73b5f83b34d090536df6e00 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 26 Apr 2007 10:45:44 -0600 Subject: Unconditionally update _TriangleCaps bits. Fixes software fallback bugs, such as #10687. --- src/mesa/main/state.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 32af3ccc620..96ee5127e11 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -1060,7 +1060,7 @@ update_tricaps(GLcontext *ctx, GLbitfield new_state) /* * Points */ - if (new_state & _NEW_POINT) { + if (1/*new_state & _NEW_POINT*/) { if (ctx->Point.SmoothFlag) ctx->_TriangleCaps |= DD_POINT_SMOOTH; if (ctx->Point._Size != 1.0F) @@ -1072,7 +1072,7 @@ update_tricaps(GLcontext *ctx, GLbitfield new_state) /* * Lines */ - if (new_state & _NEW_LINE) { + if (1/*new_state & _NEW_LINE*/) { if (ctx->Line.SmoothFlag) ctx->_TriangleCaps |= DD_LINE_SMOOTH; if (ctx->Line.StippleFlag) @@ -1084,7 +1084,7 @@ update_tricaps(GLcontext *ctx, GLbitfield new_state) /* * Polygons */ - if (new_state & _NEW_POLYGON) { + if (1/*new_state & _NEW_POLYGON*/) { if (ctx->Polygon.SmoothFlag) ctx->_TriangleCaps |= DD_TRI_SMOOTH; if (ctx->Polygon.StippleFlag) -- cgit v1.2.3 From 54d59cfb70f270dfec1253aff540953ee653bb7e Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 26 Apr 2007 12:20:53 -0600 Subject: Added error check that all varying vars needed by the fragment shader are produced by vertex shader. --- src/mesa/shader/slang/slang_link.c | 43 +++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 5a9385571b6..d6d1c7523e5 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -114,18 +114,18 @@ link_varying_vars(struct gl_shader_program *shProg, struct gl_program *prog) varsRead |= (1 << inst->SrcReg[j].Index); } } - /* XXX update program OutputsWritten, InputsRead */ } if (prog->Target == GL_VERTEX_PROGRAM_ARB) { prog->OutputsWritten |= varsWritten; + /*printf("VERT OUTPUTS: 0x%x \n", varsWritten);*/ } else { assert(prog->Target == GL_FRAGMENT_PROGRAM_ARB); prog->InputsRead |= varsRead; + /*printf("FRAG INPUTS: 0x%x\n", varsRead);*/ } - free(map); return GL_TRUE; @@ -452,6 +452,21 @@ fragment_program(struct gl_program *prog) } +/** + * Record a linking error. + */ +static void +link_error(struct gl_shader_program *shProg, const char *msg) +{ + if (shProg->InfoLog) { + _mesa_free(shProg->InfoLog); + } + shProg->InfoLog = _mesa_strdup(msg); + shProg->LinkStatus = GL_FALSE; +} + + + /** * Shader linker. Currently: * @@ -553,18 +568,30 @@ _slang_link(GLcontext *ctx, _slang_update_inputs_outputs(&shProg->VertexProgram->Base); if (!(shProg->VertexProgram->Base.OutputsWritten & (1 << VERT_RESULT_HPOS))) { /* the vertex program did not compute a vertex position */ - if (shProg->InfoLog) { - _mesa_free(shProg->InfoLog); - } - shProg->InfoLog - = _mesa_strdup("gl_Position was not written by vertex shader\n"); - shProg->LinkStatus = GL_FALSE; + link_error(shProg, + "gl_Position was not written by vertex shader\n"); return; } } if (shProg->FragmentProgram) _slang_update_inputs_outputs(&shProg->FragmentProgram->Base); + /* Check that all the varying vars needed by the fragment shader are + * actually produced by the vertex shader. + */ + if (shProg->FragmentProgram) { + const GLbitfield varyingRead + = shProg->FragmentProgram->Base.InputsRead >> FRAG_ATTRIB_VAR0; + const GLbitfield varyingWritten = shProg->VertexProgram ? + shProg->VertexProgram->Base.OutputsWritten >> VERT_RESULT_VAR0 : 0x0; + if ((varyingRead & varyingWritten) != varyingRead) { + link_error(shProg, + "Fragment program using varying vars not written by vertex shader\n"); + return; + } + } + + if (fragProg && shProg->FragmentProgram) { /* notify driver that a new fragment program has been compiled/linked */ ctx->Driver.ProgramStringNotify(ctx, GL_FRAGMENT_PROGRAM_ARB, -- cgit v1.2.3 From 74edc663a60522ff95dbd2b1e8711f3d5bfae60a Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 27 Apr 2007 08:00:37 -0600 Subject: set 6.5.3 release date --- docs/news.html | 2 +- docs/relnotes-6.5.3.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/news.html b/docs/news.html index 88c0ebe0a3c..d23fc6dfc6b 100644 --- a/docs/news.html +++ b/docs/news.html @@ -11,7 +11,7 @@

    News

    -

    April ?, 2007

    +

    April 27, 2007

    Mesa 6.5.3 is released. This is a development release which will lead up to the Mesa 7.0 release diff --git a/docs/relnotes-6.5.3.html b/docs/relnotes-6.5.3.html index 0e69a84ee0e..df7526f4705 100644 --- a/docs/relnotes-6.5.3.html +++ b/docs/relnotes-6.5.3.html @@ -8,7 +8,7 @@ -

    Mesa 6.5.3 Release Notes / April 26, 2007

    +

    Mesa 6.5.3 Release Notes / April 27, 2007

    Mesa 6.5.3 is a development release with many changes and new features. -- cgit v1.2.3 From 65bab0dad85962de221b06bcf93b8bfe678a382b Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 27 Apr 2007 08:00:51 -0600 Subject: remove rc4 suffix --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 014d7aa9c39..a6999aaeef9 100644 --- a/Makefile +++ b/Makefile @@ -155,10 +155,10 @@ ultrix-gcc: # Rules for making release tarballs -DIRECTORY = Mesa-6.5.3rc4 -LIB_NAME = MesaLib-6.5.3rc4 -DEMO_NAME = MesaDemos-6.5.3rc4 -GLUT_NAME = MesaGLUT-6.5.3rc4 +DIRECTORY = Mesa-6.5.3 +LIB_NAME = MesaLib-6.5.3 +DEMO_NAME = MesaDemos-6.5.3 +GLUT_NAME = MesaGLUT-6.5.3 MAIN_FILES = \ $(DIRECTORY)/Makefile* \ -- cgit v1.2.3 From c4b3b8dece089be52416ddadc0cf23b65f1de00b Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 27 Apr 2007 15:22:58 -0600 Subject: asin(), acos(), atan() just return 0.5 for now to avoid crashing. Fix someday. --- .../shader/slang/library/slang_common_builtin.gc | 163 ++- .../shader/slang/library/slang_common_builtin_gc.h | 1205 ++++++++++---------- 2 files changed, 688 insertions(+), 680 deletions(-) diff --git a/src/mesa/shader/slang/library/slang_common_builtin.gc b/src/mesa/shader/slang/library/slang_common_builtin.gc index 3780a38139d..a3d037cd572 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin.gc +++ b/src/mesa/shader/slang/library/slang_common_builtin.gc @@ -311,96 +311,93 @@ vec4 tan(const vec4 angle) -float asin (float x) { - float y; - __asm float_arcsine y, x; - return y; +float asin(const float x) +{ + // XXX FIX ME! + // __asm float_arcsine y, x; + __retVal = 0.5; } -vec2 asin (vec2 v) { - return vec2 ( - asin (v.x), - asin (v.y) - ); +vec2 asin(const vec2 v) +{ + __retVal.x = asin(v.x); + __retVal.y = asin(v.y); } -vec3 asin (vec3 v) { - return vec3 ( - asin (v.x), - asin (v.y), - asin (v.z) - ); +vec3 asin(const vec3 v) +{ + __retVal.x = asin(v.x); + __retVal.y = asin(v.y); + __retVal.z = asin(v.z); } -vec4 asin (vec4 v) { - return vec4 ( - asin (v.x), - asin (v.y), - asin (v.z), - asin (v.w) - ); +vec4 asin(const vec4 v) +{ + __retVal.x = asin(v.x); + __retVal.y = asin(v.y); + __retVal.z = asin(v.z); } -float acos (float x) { - return 1.5708 - asin (x); +float acos(const float x) +{ + // XXX FIX ME! + __retVal = 0.5; } -vec2 acos (vec2 v) { - return vec2 ( - acos (v.x), - acos (v.y) - ); +vec2 acos(const vec2 v) +{ + __retVal.x = acos(v.x); + __retVal.y = acos(v.y); } -vec3 acos (vec3 v) { - return vec3 ( - acos (v.x), - acos (v.y), - acos (v.z) - ); +vec3 acos(const vec3 v) +{ + __retVal.x = acos(v.x); + __retVal.y = acos(v.y); + __retVal.z = acos(v.z); } -vec4 acos (vec4 v) { - return vec4 ( - acos (v.x), - acos (v.y), - acos (v.z), - acos (v.w) - ); +vec4 acos(const vec4 v) +{ + __retVal.x = acos(v.x); + __retVal.y = acos(v.y); + __retVal.z = acos(v.z); + __retVal.w = acos(v.w); } -float atan (float y_over_x) { - float z; - __asm float_arctan z, y_over_x; - return z; +float atan(const float y_over_x) +{ + // XXX FIX ME + //__asm float_arctan z, y_over_x; + __retVal = 0.5; } -vec2 atan (vec2 y_over_x) { - return vec2 ( - atan (y_over_x.x), - atan (y_over_x.y) - ); +vec2 atan(const vec2 y_over_x) +{ + __retVal.x = atan(y_over_x.x); + __retVal.y = atan(y_over_x.y); } -vec3 atan (vec3 y_over_x) { - return vec3 ( - atan (y_over_x.x), - atan (y_over_x.y), - atan (y_over_x.z) - ); +vec3 atan(const vec3 y_over_x) +{ + __retVal.x = atan(y_over_x.x); + __retVal.y = atan(y_over_x.y); + __retVal.z = atan(y_over_x.z); } -vec4 atan (vec4 y_over_x) { - return vec4 ( - atan (y_over_x.x), - atan (y_over_x.y), - atan (y_over_x.z), - atan (y_over_x.w) - ); +vec4 atan(const vec4 y_over_x) +{ + __retVal.x = atan(y_over_x.x); + __retVal.y = atan(y_over_x.y); + __retVal.z = atan(y_over_x.z); + __retVal.w = atan(y_over_x.w); } -float atan (float y, float x) { - float z = atan (y / x); +float atan(const float y, const float x) +{ + if (x == 0.0) + return 0.0; + float z = atan(y / x); if (x < 0.0) { if (y < 0.0) @@ -410,30 +407,28 @@ float atan (float y, float x) { return z; } -vec2 atan (vec2 u, vec2 v) { - return vec2 ( - atan (u.x, v.x), - atan (u.y, v.y) - ); +vec2 atan(const vec2 u, const vec2 v) +{ + __retVal.x = atan(u.x, v.x); + __retVal.y = atan(u.y, v.y); } -vec3 atan (vec3 u, vec3 v) { - return vec3 ( - atan (u.x, v.x), - atan (u.y, v.y), - atan (u.z, v.z) - ); +vec3 atan(const vec3 u, const vec3 v) +{ + __retVal.x = atan(u.x, v.x); + __retVal.y = atan(u.y, v.y); + __retVal.z = atan(u.z, v.z); } -vec4 atan (vec4 u, vec4 v) { - return vec4 ( - atan (u.x, v.x), - atan (u.y, v.y), - atan (u.z, v.z), - atan (u.w, v.w) - ); +vec4 atan(const vec4 u, const vec4 v) +{ + __retVal.x = atan(u.x, v.x); + __retVal.y = atan(u.y, v.y); + __retVal.z = atan(u.z, v.z); + __retVal.w = atan(u.w, v.w); } + // // 8.2 Exponential Functions // diff --git a/src/mesa/shader/slang/library/slang_common_builtin_gc.h b/src/mesa/shader/slang/library/slang_common_builtin_gc.h index 52f6b172d6e..8db5f1be937 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin_gc.h +++ b/src/mesa/shader/slang/library/slang_common_builtin_gc.h @@ -166,619 +166,632 @@ 97,110,103,108,101,0,0,0,0,0,3,2,1,11,1,99,0,2,58,99,111,115,0,18,97,110,103,108,101,0,0,0,0,0,8, 18,115,0,18,99,0,49,0,0,1,0,12,0,116,97,110,0,1,1,0,12,97,110,103,108,101,0,0,0,1,3,2,1,12,1,115,0, 2,58,115,105,110,0,18,97,110,103,108,101,0,0,0,0,0,3,2,1,12,1,99,0,2,58,99,111,115,0,18,97,110,103, -108,101,0,0,0,0,0,8,18,115,0,18,99,0,49,0,0,1,0,9,0,97,115,105,110,0,1,0,0,9,120,0,0,0,1,3,2,0,9,1, -121,0,0,0,4,102,108,111,97,116,95,97,114,99,115,105,110,101,0,18,121,0,0,18,120,0,0,0,8,18,121,0,0, -0,1,0,10,0,97,115,105,110,0,1,0,0,10,118,0,0,0,1,8,58,118,101,99,50,0,58,97,115,105,110,0,18,118,0, -59,120,0,0,0,0,58,97,115,105,110,0,18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,97,115,105,110,0,1,0,0, -11,118,0,0,0,1,8,58,118,101,99,51,0,58,97,115,105,110,0,18,118,0,59,120,0,0,0,0,58,97,115,105,110, -0,18,118,0,59,121,0,0,0,0,58,97,115,105,110,0,18,118,0,59,122,0,0,0,0,0,0,0,1,0,12,0,97,115,105, -110,0,1,0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,58,97,115,105,110,0,18,118,0,59,120,0,0,0,0,58,97, -115,105,110,0,18,118,0,59,121,0,0,0,0,58,97,115,105,110,0,18,118,0,59,122,0,0,0,0,58,97,115,105, -110,0,18,118,0,59,119,0,0,0,0,0,0,0,1,0,9,0,97,99,111,115,0,1,0,0,9,120,0,0,0,1,8,17,49,0,53,55,48, -56,0,0,58,97,115,105,110,0,18,120,0,0,0,47,0,0,1,0,10,0,97,99,111,115,0,1,0,0,10,118,0,0,0,1,8,58, -118,101,99,50,0,58,97,99,111,115,0,18,118,0,59,120,0,0,0,0,58,97,99,111,115,0,18,118,0,59,121,0,0, -0,0,0,0,0,1,0,11,0,97,99,111,115,0,1,0,0,11,118,0,0,0,1,8,58,118,101,99,51,0,58,97,99,111,115,0,18, -118,0,59,120,0,0,0,0,58,97,99,111,115,0,18,118,0,59,121,0,0,0,0,58,97,99,111,115,0,18,118,0,59,122, -0,0,0,0,0,0,0,1,0,12,0,97,99,111,115,0,1,0,0,12,118,0,0,0,1,8,58,118,101,99,52,0,58,97,99,111,115, -0,18,118,0,59,120,0,0,0,0,58,97,99,111,115,0,18,118,0,59,121,0,0,0,0,58,97,99,111,115,0,18,118,0, -59,122,0,0,0,0,58,97,99,111,115,0,18,118,0,59,119,0,0,0,0,0,0,0,1,0,9,0,97,116,97,110,0,1,0,0,9, -121,95,111,118,101,114,95,120,0,0,0,1,3,2,0,9,1,122,0,0,0,4,102,108,111,97,116,95,97,114,99,116,97, -110,0,18,122,0,0,18,121,95,111,118,101,114,95,120,0,0,0,8,18,122,0,0,0,1,0,10,0,97,116,97,110,0,1, -0,0,10,121,95,111,118,101,114,95,120,0,0,0,1,8,58,118,101,99,50,0,58,97,116,97,110,0,18,121,95,111, -118,101,114,95,120,0,59,120,0,0,0,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,121,0, -0,0,0,0,0,0,1,0,11,0,97,116,97,110,0,1,0,0,11,121,95,111,118,101,114,95,120,0,0,0,1,8,58,118,101, -99,51,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,0,58,97,116,97,110,0,18, -121,95,111,118,101,114,95,120,0,59,121,0,0,0,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120, -0,59,122,0,0,0,0,0,0,0,1,0,12,0,97,116,97,110,0,1,0,0,12,121,95,111,118,101,114,95,120,0,0,0,1,8, -58,118,101,99,52,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,0,58,97,116, -97,110,0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0,0,58,97,116,97,110,0,18,121,95,111,118, -101,114,95,120,0,59,122,0,0,0,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,119,0,0,0, -0,0,0,0,1,0,9,0,97,116,97,110,0,1,0,0,9,121,0,0,1,0,0,9,120,0,0,0,1,3,2,0,9,1,122,0,2,58,97,116,97, -110,0,18,121,0,18,120,0,49,0,0,0,0,10,18,120,0,17,48,0,48,0,0,40,0,2,10,18,121,0,17,48,0,48,0,0,40, -0,8,18,122,0,17,51,0,49,52,49,53,57,51,0,0,47,0,9,14,0,8,18,122,0,17,51,0,49,52,49,53,57,51,0,0,46, -0,0,9,14,0,8,18,122,0,0,0,1,0,10,0,97,116,97,110,0,1,0,0,10,117,0,0,1,0,0,10,118,0,0,0,1,8,58,118, -101,99,50,0,58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,0,58,97,116,97,110,0,18, -117,0,59,121,0,0,18,118,0,59,121,0,0,0,0,0,0,0,1,0,11,0,97,116,97,110,0,1,0,0,11,117,0,0,1,0,0,11, -118,0,0,0,1,8,58,118,101,99,51,0,58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,0,58, -97,116,97,110,0,18,117,0,59,121,0,0,18,118,0,59,121,0,0,0,0,58,97,116,97,110,0,18,117,0,59,122,0,0, -18,118,0,59,122,0,0,0,0,0,0,0,1,0,12,0,97,116,97,110,0,1,0,0,12,117,0,0,1,0,0,12,118,0,0,0,1,8,58, -118,101,99,52,0,58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,0,58,97,116,97,110,0, -18,117,0,59,121,0,0,18,118,0,59,121,0,0,0,0,58,97,116,97,110,0,18,117,0,59,122,0,0,18,118,0,59,122, -0,0,0,0,58,97,116,97,110,0,18,117,0,59,119,0,0,18,118,0,59,119,0,0,0,0,0,0,0,1,0,9,0,112,111,119,0, -1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101, -116,86,97,108,0,59,120,0,0,18,97,0,0,18,98,0,0,0,0,1,0,10,0,112,111,119,0,1,1,0,10,97,0,0,1,1,0,10, -98,0,0,0,1,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0, -0,18,97,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95, -114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,18,98,0,59,121,0,0,0,0,1,0,11,0,112,111,119, -0,1,1,0,11,97,0,0,1,1,0,11,98,0,0,0,1,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114, -101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,112, -111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,18,98,0,59,121,0, -0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18, -97,0,59,122,0,0,18,98,0,59,122,0,0,0,0,1,0,12,0,112,111,119,0,1,1,0,12,97,0,0,1,1,0,12,98,0,0,0,1, +108,101,0,0,0,0,0,8,18,115,0,18,99,0,49,0,0,1,0,9,0,97,115,105,110,0,1,1,0,9,120,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,17,48,0,53,0,0,20,0,0,1,0,10,0,97,115,105,110,0,1,1,0,10,118,0,0,0,1,9, +18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,115,105,110,0,18,118,0,59,120,0,0,0,20,0,9,18,95, +95,114,101,116,86,97,108,0,59,121,0,58,97,115,105,110,0,18,118,0,59,121,0,0,0,20,0,0,1,0,11,0,97, +115,105,110,0,1,1,0,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,115,105,110,0, +18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,115,105,110,0,18,118, +0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,115,105,110,0,18,118,0,59, +122,0,0,0,20,0,0,1,0,12,0,97,115,105,110,0,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, +59,120,0,58,97,115,105,110,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121, +0,58,97,115,105,110,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97, +115,105,110,0,18,118,0,59,122,0,0,0,20,0,0,1,0,9,0,97,99,111,115,0,1,1,0,9,120,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,17,48,0,53,0,0,20,0,0,1,0,10,0,97,99,111,115,0,1,1,0,10,118,0,0,0,1,9,18, +95,95,114,101,116,86,97,108,0,59,120,0,58,97,99,111,115,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,59,121,0,58,97,99,111,115,0,18,118,0,59,121,0,0,0,20,0,0,1,0,11,0,97,99, +111,115,0,1,1,0,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,99,111,115,0,18, +118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,99,111,115,0,18,118,0,59, +121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,99,111,115,0,18,118,0,59,122,0,0, +0,20,0,0,1,0,12,0,97,99,111,115,0,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0, +58,97,99,111,115,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,99, +111,115,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,99,111,115, +0,18,118,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,99,111,115,0,18,118, +0,59,119,0,0,0,20,0,0,1,0,9,0,97,116,97,110,0,1,1,0,9,121,95,111,118,101,114,95,120,0,0,0,1,9,18, +95,95,114,101,116,86,97,108,0,17,48,0,53,0,0,20,0,0,1,0,10,0,97,116,97,110,0,1,1,0,10,121,95,111, +118,101,114,95,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,18,121, +95,111,118,101,114,95,120,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97, +116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0,20,0,0,1,0,11,0,97,116,97,110,0,1,1,0, +11,121,95,111,118,101,114,95,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97, +110,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, +121,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0,20,0,9,18,95,95,114,101, +116,86,97,108,0,59,122,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,122,0,0,0,20,0,0, +1,0,12,0,97,116,97,110,0,1,1,0,12,121,95,111,118,101,114,95,120,0,0,0,1,9,18,95,95,114,101,116,86, +97,108,0,59,120,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,20,0,9,18,95, +95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,121,0, +0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,18,121,95,111,118,101,114, +95,120,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,116,97,110,0,18,121, +95,111,118,101,114,95,120,0,59,119,0,0,0,20,0,0,1,0,9,0,97,116,97,110,0,1,1,0,9,121,0,0,1,1,0,9, +120,0,0,0,1,10,18,120,0,17,48,0,48,0,0,38,0,8,17,48,0,48,0,0,0,9,14,0,3,2,0,9,1,122,0,2,58,97,116, +97,110,0,18,121,0,18,120,0,49,0,0,0,0,10,18,120,0,17,48,0,48,0,0,40,0,2,10,18,121,0,17,48,0,48,0,0, +40,0,8,18,122,0,17,51,0,49,52,49,53,57,51,0,0,47,0,9,14,0,8,18,122,0,17,51,0,49,52,49,53,57,51,0,0, +46,0,0,9,14,0,8,18,122,0,0,0,1,0,10,0,97,116,97,110,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,9,18, +95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0, +0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,18,117,0,59,121,0,0,18,118,0, +59,121,0,0,0,20,0,0,1,0,11,0,97,116,97,110,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,20,0,9, +18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,18,117,0,59,121,0,0,18,118,0,59,121,0, +0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,18,117,0,59,122,0,0,18,118, +0,59,122,0,0,0,20,0,0,1,0,12,0,97,116,97,110,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,20,0, +9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,18,117,0,59,121,0,0,18,118,0,59,121, +0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,18,117,0,59,122,0,0,18, +118,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,116,97,110,0,18,117,0,59, +119,0,0,18,118,0,59,119,0,0,0,20,0,0,1,0,9,0,112,111,119,0,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,4,102, +108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,0,18, +98,0,0,0,0,1,0,10,0,112,111,119,0,1,1,0,10,97,0,0,1,1,0,10,98,0,0,0,1,4,102,108,111,97,116,95,112, +111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0, +0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18, +97,0,59,121,0,0,18,98,0,59,121,0,0,0,0,1,0,11,0,112,111,119,0,1,1,0,11,97,0,0,1,1,0,11,98,0,0,0,1, 4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0, 59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116, 86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,112,111,119, -101,114,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,18,98,0,59,122,0,0,0,4, -102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,97,0,59, -119,0,0,18,98,0,59,119,0,0,0,0,1,0,9,0,101,120,112,0,1,1,0,9,97,0,0,0,1,4,102,108,111,97,116,95, -101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,0,0,0,1,0,10,0,101,120,112,0,1,1, -0,10,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0, -18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,121, -0,0,18,97,0,59,121,0,0,0,0,1,0,11,0,101,120,112,0,1,1,0,11,97,0,0,0,1,4,102,108,111,97,116,95,101, -120,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95, -101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,4,102,108,111,97, -116,95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,0,0,1,0,12,0, -101,120,112,0,1,1,0,12,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116,86,97, +101,114,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,18,98,0,59,122,0,0,0,0,1, +0,12,0,112,111,119,0,1,1,0,12,97,0,0,1,1,0,12,98,0,0,0,1,4,102,108,111,97,116,95,112,111,119,101, +114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102, +108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121, +0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97, +108,0,59,122,0,0,18,97,0,59,122,0,0,18,98,0,59,122,0,0,0,4,102,108,111,97,116,95,112,111,119,101, +114,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,97,0,59,119,0,0,18,98,0,59,119,0,0,0,0,1,0,9, +0,101,120,112,0,1,1,0,9,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116,86, +97,108,0,59,120,0,0,18,97,0,0,0,0,1,0,10,0,101,120,112,0,1,1,0,10,97,0,0,0,1,4,102,108,111,97,116, +95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97, +116,95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,0,1,0,11,0, +101,120,112,0,1,1,0,11,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116,86,97, 108,0,59,120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116, 86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101, -116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,0,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114, -101,116,86,97,108,0,59,119,0,0,18,97,0,59,119,0,0,0,0,1,0,9,0,108,111,103,50,0,1,1,0,9,120,0,0,0,1, -4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,120,0,0,0, -0,1,0,10,0,108,111,103,50,0,1,1,0,10,118,0,0,0,1,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95, -114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,108,111,103,50,0, -18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,0,1,0,11,0,108,111,103,50,0,1,1, -0,11,118,0,0,0,1,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120, -0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108, -0,59,121,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116, -86,97,108,0,59,122,0,0,18,118,0,59,122,0,0,0,0,1,0,12,0,108,111,103,50,0,1,1,0,12,118,0,0,0,1,4, -102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120, -0,0,0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118, -0,59,121,0,0,0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0, -0,18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0, -59,119,0,0,18,118,0,59,119,0,0,0,0,1,0,9,0,108,111,103,0,1,1,0,9,120,0,0,0,1,3,2,1,9,1,99,0,2,17, -48,0,54,57,51,49,52,55,49,56,49,0,0,0,0,8,58,108,111,103,50,0,18,120,0,0,0,18,99,0,48,0,0,1,0,10,0, -108,111,103,0,1,1,0,10,118,0,0,0,1,3,2,1,9,1,99,0,2,17,48,0,54,57,51,49,52,55,49,56,49,0,0,0,0,8, -58,108,111,103,50,0,18,118,0,0,0,18,99,0,48,0,0,1,0,11,0,108,111,103,0,1,1,0,11,118,0,0,0,1,3,2,1, -9,1,99,0,2,17,48,0,54,57,51,49,52,55,49,56,49,0,0,0,0,8,58,108,111,103,50,0,18,118,0,0,0,18,99,0, -48,0,0,1,0,12,0,108,111,103,0,1,1,0,12,118,0,0,0,1,3,2,1,9,1,99,0,2,17,48,0,54,57,51,49,52,55,49, -56,49,0,0,0,0,8,58,108,111,103,50,0,18,118,0,0,0,18,99,0,48,0,0,1,0,9,0,101,120,112,50,0,1,1,0,9, -97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18, -97,0,0,0,0,1,0,10,0,101,120,112,50,0,1,1,0,10,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0, -18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120, -112,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,0,1,0,11,0,101,120,112, -50,0,1,1,0,11,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0, -59,120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86, -97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101, -116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,0,0,1,0,12,0,101,120,112,50,0,1,1,0,12,97,0,0,0,1,4, -102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120, -0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0, -59,121,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0, -18,97,0,59,122,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59, -119,0,0,18,97,0,59,119,0,0,0,0,1,0,9,0,115,113,114,116,0,1,1,0,9,120,0,0,0,1,3,2,0,9,1,114,0,0,0,4, -102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0, -18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,0,1,0,10,0,115,113,114,116,0,1,1,0,10,118, -0,0,0,1,3,2,0,9,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,120,0,0,0, -4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,4, -102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114, -99,112,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,0,0,0,0,1,0,11,0,115,113,114,116,0,1,1, -0,11,118,0,0,0,1,3,2,0,9,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59, -120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114, -0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116, -95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,0,0,0,4,102,108,111,97,116,95, -114,115,113,0,18,114,0,0,18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114, -101,116,86,97,108,0,59,122,0,0,18,114,0,0,0,0,1,0,12,0,115,113,114,116,0,1,1,0,12,118,0,0,0,1,3,2, -0,9,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,120,0,0,0,4,102,108, -111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,4,102,108,111, -97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18, -95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114, -0,0,18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59, -122,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,119,0,0,0,4,102, -108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,114,0,0,0,0,1,0,9,0, -105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,9,120,0,0,0,1,4,102,108,111,97,116,95,114,115, -113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,120,0,0,0,0,1,0,10,0,105,110,118,101,114,115, -101,115,113,114,116,0,1,1,0,10,118,0,0,0,1,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101, -116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95, -114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,0,1,0,11,0,105,110,118,101,114,115,101, -115,113,114,116,0,1,1,0,11,118,0,0,0,1,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116, -86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114, -101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95, -95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59,122,0,0,0,0,1,0,12,0,105,110,118,101,114,115,101, -115,113,114,116,0,1,1,0,12,118,0,0,0,1,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116, -86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114, -101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95, -95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,114,115,113,0, -18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,118,0,59,119,0,0,0,0,1,0,9,0,110,111,114,109,97,108, -105,122,101,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,17,49,0,48,0,0,20,0, -0,1,0,10,0,110,111,114,109,97,108,105,122,101,0,1,1,0,10,118,0,0,0,1,3,2,1,9,1,115,0,2,58,105,110, -118,101,114,115,101,115,113,114,116,0,58,100,111,116,0,18,118,0,0,18,118,0,0,0,0,0,0,0,4,118,101, -99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118, -0,0,18,115,0,59,120,120,0,0,0,0,1,0,11,0,110,111,114,109,97,108,105,122,101,0,1,1,0,11,118,0,0,0,1, -3,2,0,9,1,116,109,112,0,0,0,4,118,101,99,51,95,100,111,116,0,18,116,109,112,0,0,18,118,0,0,18,118, -0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,116,109,112,0,0,18,116,109,112,0,0,0,4,118,101,99, -52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118, -0,0,18,116,109,112,0,59,120,120,120,0,0,0,0,1,0,12,0,110,111,114,109,97,108,105,122,101,0,1,1,0,12, -118,0,0,0,1,3,2,0,9,1,116,109,112,0,0,0,4,118,101,99,52,95,100,111,116,0,18,116,109,112,0,0,18,118, -0,0,18,118,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,116,109,112,0,0,18,116,109,112,0,0,0,4, -118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122, -0,0,18,118,0,0,18,116,109,112,0,59,120,120,120,0,0,0,0,1,0,9,0,97,98,115,0,1,1,0,9,97,0,0,0,1,4, -118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,0,0,0,1,0,10,0,97, -98,115,0,1,1,0,10,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,59, -120,121,0,0,18,97,0,0,0,0,1,0,11,0,97,98,115,0,1,1,0,11,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0, -18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,0,0,1,0,12,0,97,98,115,0,1,1,0,12,97, -0,0,0,1,4,118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,0,9,0, -115,105,103,110,0,1,1,0,9,120,0,0,0,1,3,2,0,9,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52,95,115,103, -116,0,18,112,0,59,120,0,0,18,120,0,0,17,48,0,48,0,0,0,0,4,118,101,99,52,95,115,103,116,0,18,110,0, -59,120,0,0,17,48,0,48,0,0,0,18,120,0,0,0,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95, -95,114,101,116,86,97,108,0,59,120,0,0,18,112,0,0,18,110,0,0,0,0,1,0,10,0,115,105,103,110,0,1,1,0, -10,118,0,0,0,1,3,2,0,10,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52,95,115,103,116,0,18,112,0,59,120, -121,0,0,18,118,0,0,17,48,0,48,0,0,0,0,4,118,101,99,52,95,115,103,116,0,18,110,0,59,120,121,0,0,17, -48,0,48,0,0,0,18,118,0,0,0,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116, -86,97,108,0,59,120,121,0,0,18,112,0,0,18,110,0,0,0,0,1,0,11,0,115,105,103,110,0,1,1,0,11,118,0,0,0, -1,3,2,0,11,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52,95,115,103,116,0,18,112,0,59,120,121,122,0,0,18, -118,0,0,17,48,0,48,0,0,0,0,4,118,101,99,52,95,115,103,116,0,18,110,0,59,120,121,122,0,0,17,48,0,48, -0,0,0,18,118,0,0,0,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97, -108,0,59,120,121,122,0,0,18,112,0,0,18,110,0,0,0,0,1,0,12,0,115,105,103,110,0,1,1,0,12,118,0,0,0,1, -3,2,0,12,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52,95,115,103,116,0,18,112,0,0,18,118,0,0,17,48,0,48, -0,0,0,0,4,118,101,99,52,95,115,103,116,0,18,110,0,0,17,48,0,48,0,0,0,18,118,0,0,0,4,118,101,99,52, -95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,18,110,0,0,0,0,1,0, -9,0,102,108,111,111,114,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,102,108,111,111,114,0,18,95,95,114, -101,116,86,97,108,0,59,120,0,0,18,97,0,0,0,0,1,0,10,0,102,108,111,111,114,0,1,1,0,10,97,0,0,0,1,4, -118,101,99,52,95,102,108,111,111,114,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,0, -0,1,0,11,0,102,108,111,111,114,0,1,1,0,11,97,0,0,0,1,4,118,101,99,52,95,102,108,111,111,114,0,18, -95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,0,0,1,0,12,0,102,108,111,111,114,0,1,1, -0,12,97,0,0,0,1,4,118,101,99,52,95,102,108,111,111,114,0,18,95,95,114,101,116,86,97,108,0,0,18,97, -0,0,0,0,1,0,9,0,99,101,105,108,0,1,1,0,9,97,0,0,0,1,3,2,0,9,1,98,0,2,18,97,0,54,0,0,4,118,101,99, -52,95,102,108,111,111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18, -98,0,54,20,0,0,1,0,10,0,99,101,105,108,0,1,1,0,10,97,0,0,0,1,3,2,0,10,1,98,0,2,18,97,0,54,0,0,4, -118,101,99,52,95,102,108,111,111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59, -120,121,0,18,98,0,54,20,0,0,1,0,11,0,99,101,105,108,0,1,1,0,11,97,0,0,0,1,3,2,0,11,1,98,0,2,18,97, -0,54,0,0,4,118,101,99,52,95,102,108,111,111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86, -97,108,0,59,120,121,122,0,18,98,0,54,20,0,0,1,0,12,0,99,101,105,108,0,1,1,0,12,97,0,0,0,1,3,2,0,12, -1,98,0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111,111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95, -114,101,116,86,97,108,0,18,98,0,54,20,0,0,1,0,9,0,102,114,97,99,116,0,1,1,0,9,97,0,0,0,1,4,118,101, -99,52,95,102,114,97,99,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,0,0,0,1,0,10,0,102, -114,97,99,116,0,1,1,0,10,97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18,95,95,114,101,116,86,97, -108,0,59,120,121,0,0,18,97,0,0,0,0,1,0,11,0,102,114,97,99,116,0,1,1,0,11,97,0,0,0,1,4,118,101,99, -52,95,102,114,97,99,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,0,0,1,0,12,0, -102,114,97,99,116,0,1,1,0,12,97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18,95,95,114,101,116,86, -97,108,0,0,18,97,0,0,0,0,1,0,9,0,109,111,100,0,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1,111,110, -101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66, -0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,97,0,18,98,0,58,102,108,111,111,114, -0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,0,10,0,109,111,100,0,1,1,0,10, -97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95, -114,99,112,0,18,111,110,101,79,118,101,114,66,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0, -59,120,121,0,18,97,0,18,98,0,58,102,108,111,111,114,0,18,97,0,18,111,110,101,79,118,101,114,66,0, -48,0,0,48,47,20,0,0,1,0,11,0,109,111,100,0,1,1,0,11,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1,111,110, -101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66, -0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,18,97,0,18,98,0,58,102,108,111, -111,114,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,0,12,0,109,111,100,0,1, -1,0,12,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97, -116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97, -108,0,18,97,0,18,98,0,58,102,108,111,111,114,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0, -48,47,20,0,0,1,0,10,0,109,111,100,0,1,1,0,10,97,0,0,1,1,0,10,98,0,0,0,1,3,2,0,9,1,111,110,101,79, -118,101,114,66,120,0,0,1,1,111,110,101,79,118,101,114,66,121,0,0,0,4,102,108,111,97,116,95,114,99, -112,0,18,111,110,101,79,118,101,114,66,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99, -112,0,18,111,110,101,79,118,101,114,66,121,0,0,18,98,0,59,121,0,0,0,9,18,95,95,114,101,116,86,97, -108,0,59,120,0,18,97,0,59,120,0,18,98,0,59,120,0,58,102,108,111,111,114,0,18,97,0,59,120,0,18,111, -110,101,79,118,101,114,66,120,0,48,0,0,48,47,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18, -97,0,59,121,0,18,98,0,59,121,0,58,102,108,111,111,114,0,18,97,0,59,121,0,18,111,110,101,79,118,101, -114,66,121,0,48,0,0,48,47,20,0,0,1,0,11,0,109,111,100,0,1,1,0,11,97,0,0,1,1,0,11,98,0,0,0,1,3,2,0, -9,1,111,110,101,79,118,101,114,66,120,0,0,1,1,111,110,101,79,118,101,114,66,121,0,0,1,1,111,110, -101,79,118,101,114,66,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114, +116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,0,0,1,0,12,0,101,120,112,0,1,1,0,12,97,0,0,0,1,4,102, +108,111,97,116,95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4, +102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0, +0,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0,59,122, +0,0,0,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,97,0,59, +119,0,0,0,0,1,0,9,0,108,111,103,50,0,1,1,0,9,120,0,0,0,1,4,102,108,111,97,116,95,108,111,103,50,0, +18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,120,0,0,0,0,1,0,10,0,108,111,103,50,0,1,1,0,10,118, +0,0,0,1,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18, +118,0,59,120,0,0,0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59, +121,0,0,18,118,0,59,121,0,0,0,0,1,0,11,0,108,111,103,50,0,1,1,0,11,118,0,0,0,1,4,102,108,111,97, +116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102, +108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0, +0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59, +122,0,0,0,0,1,0,12,0,108,111,103,50,0,1,1,0,12,118,0,0,0,1,4,102,108,111,97,116,95,108,111,103,50, +0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,108, +111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97, +116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59,122,0,0,0,4,102, +108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,118,0,59,119,0,0, +0,0,1,0,9,0,108,111,103,0,1,1,0,9,120,0,0,0,1,3,2,1,9,1,99,0,2,17,48,0,54,57,51,49,52,55,49,56,49, +0,0,0,0,8,58,108,111,103,50,0,18,120,0,0,0,18,99,0,48,0,0,1,0,10,0,108,111,103,0,1,1,0,10,118,0,0, +0,1,3,2,1,9,1,99,0,2,17,48,0,54,57,51,49,52,55,49,56,49,0,0,0,0,8,58,108,111,103,50,0,18,118,0,0,0, +18,99,0,48,0,0,1,0,11,0,108,111,103,0,1,1,0,11,118,0,0,0,1,3,2,1,9,1,99,0,2,17,48,0,54,57,51,49,52, +55,49,56,49,0,0,0,0,8,58,108,111,103,50,0,18,118,0,0,0,18,99,0,48,0,0,1,0,12,0,108,111,103,0,1,1,0, +12,118,0,0,0,1,3,2,1,9,1,99,0,2,17,48,0,54,57,51,49,52,55,49,56,49,0,0,0,0,8,58,108,111,103,50,0, +18,118,0,0,0,18,99,0,48,0,0,1,0,9,0,101,120,112,50,0,1,1,0,9,97,0,0,0,1,4,102,108,111,97,116,95, +101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,0,0,0,1,0,10,0,101,120,112,50, +0,1,1,0,10,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59, +120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97, +108,0,59,121,0,0,18,97,0,59,121,0,0,0,0,1,0,11,0,101,120,112,50,0,1,1,0,11,97,0,0,0,1,4,102,108, +111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4, +102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121, +0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0, +59,122,0,0,0,0,1,0,12,0,101,120,112,50,0,1,1,0,12,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112, +50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,101, +120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,4,102,108,111,97,116, +95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,0,4,102,108,111, +97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,97,0,59,119,0,0,0,0,1,0, +9,0,115,113,114,116,0,1,1,0,9,120,0,0,0,1,3,2,0,9,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113, +0,18,114,0,0,18,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59, +120,0,0,18,114,0,0,0,0,1,0,10,0,115,113,114,116,0,1,1,0,10,118,0,0,0,1,3,2,0,9,1,114,0,0,0,4,102, +108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99, +112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113, +0,18,114,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97, +108,0,59,121,0,0,18,114,0,0,0,0,1,0,11,0,115,113,114,116,0,1,1,0,11,118,0,0,0,1,3,2,0,9,1,114,0,0, +0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95, +114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114, +115,113,0,18,114,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101, +116,86,97,108,0,59,121,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0, +59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18, +114,0,0,0,0,1,0,12,0,115,113,114,116,0,1,1,0,12,118,0,0,0,1,3,2,0,9,1,114,0,0,0,4,102,108,111,97, +116,95,114,115,113,0,18,114,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95, +95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0, +0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59, +121,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,122,0,0,0,4,102, +108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,114,0,0,0,4,102,108, +111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0, +18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,114,0,0,0,0,1,0,9,0,105,110,118,101,114,115,101,115, +113,114,116,0,1,1,0,9,120,0,0,0,1,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97, +108,0,59,120,0,0,18,120,0,0,0,0,1,0,10,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,10, +118,0,0,0,1,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18, +118,0,59,120,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0, +0,18,118,0,59,121,0,0,0,0,1,0,11,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,11,118,0,0, +0,1,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59, +120,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118, +0,59,121,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0, +18,118,0,59,122,0,0,0,0,1,0,12,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,12,118,0,0,0, +1,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59, +120,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118, +0,59,121,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0, +18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59, +119,0,0,18,118,0,59,119,0,0,0,0,1,0,9,0,110,111,114,109,97,108,105,122,101,0,1,1,0,9,120,0,0,0,1,9, +18,95,95,114,101,116,86,97,108,0,59,120,0,17,49,0,48,0,0,20,0,0,1,0,10,0,110,111,114,109,97,108, +105,122,101,0,1,1,0,10,118,0,0,0,1,3,2,1,9,1,115,0,2,58,105,110,118,101,114,115,101,115,113,114, +116,0,58,100,111,116,0,18,118,0,0,18,118,0,0,0,0,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112, +108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,115,0,59,120,120,0,0,0,0,1, +0,11,0,110,111,114,109,97,108,105,122,101,0,1,1,0,11,118,0,0,0,1,3,2,0,9,1,116,109,112,0,0,0,4,118, +101,99,51,95,100,111,116,0,18,116,109,112,0,0,18,118,0,0,18,118,0,0,0,4,102,108,111,97,116,95,114, +115,113,0,18,116,109,112,0,0,18,116,109,112,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108, +121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,116,109,112,0,59,120,120, +120,0,0,0,0,1,0,12,0,110,111,114,109,97,108,105,122,101,0,1,1,0,12,118,0,0,0,1,3,2,0,9,1,116,109, +112,0,0,0,4,118,101,99,52,95,100,111,116,0,18,116,109,112,0,0,18,118,0,0,18,118,0,0,0,4,102,108, +111,97,116,95,114,115,113,0,18,116,109,112,0,0,18,116,109,112,0,0,0,4,118,101,99,52,95,109,117,108, +116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,116,109, +112,0,59,120,120,120,0,0,0,0,1,0,9,0,97,98,115,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0, +18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,0,0,0,1,0,10,0,97,98,115,0,1,1,0,10,97,0,0,0,1, +4,118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,0,0,1,0, +11,0,97,98,115,0,1,1,0,11,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108, +0,59,120,121,122,0,0,18,97,0,0,0,0,1,0,12,0,97,98,115,0,1,1,0,12,97,0,0,0,1,4,118,101,99,52,95,97, +98,115,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,0,9,0,115,105,103,110,0,1,1,0,9,120,0, +0,0,1,3,2,0,9,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52,95,115,103,116,0,18,112,0,59,120,0,0,18,120, +0,0,17,48,0,48,0,0,0,0,4,118,101,99,52,95,115,103,116,0,18,110,0,59,120,0,0,17,48,0,48,0,0,0,18, +120,0,0,0,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59, +120,0,0,18,112,0,0,18,110,0,0,0,0,1,0,10,0,115,105,103,110,0,1,1,0,10,118,0,0,0,1,3,2,0,10,1,112,0, +0,1,1,110,0,0,0,4,118,101,99,52,95,115,103,116,0,18,112,0,59,120,121,0,0,18,118,0,0,17,48,0,48,0,0, +0,0,4,118,101,99,52,95,115,103,116,0,18,110,0,59,120,121,0,0,17,48,0,48,0,0,0,18,118,0,0,0,4,118, +101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,112, +0,0,18,110,0,0,0,0,1,0,11,0,115,105,103,110,0,1,1,0,11,118,0,0,0,1,3,2,0,11,1,112,0,0,1,1,110,0,0, +0,4,118,101,99,52,95,115,103,116,0,18,112,0,59,120,121,122,0,0,18,118,0,0,17,48,0,48,0,0,0,0,4,118, +101,99,52,95,115,103,116,0,18,110,0,59,120,121,122,0,0,17,48,0,48,0,0,0,18,118,0,0,0,4,118,101,99, +52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,112,0, +0,18,110,0,0,0,0,1,0,12,0,115,105,103,110,0,1,1,0,12,118,0,0,0,1,3,2,0,12,1,112,0,0,1,1,110,0,0,0, +4,118,101,99,52,95,115,103,116,0,18,112,0,0,18,118,0,0,17,48,0,48,0,0,0,0,4,118,101,99,52,95,115, +103,116,0,18,110,0,0,17,48,0,48,0,0,0,18,118,0,0,0,4,118,101,99,52,95,115,117,98,116,114,97,99,116, +0,18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,18,110,0,0,0,0,1,0,9,0,102,108,111,111,114,0,1,1,0, +9,97,0,0,0,1,4,118,101,99,52,95,102,108,111,111,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0, +18,97,0,0,0,0,1,0,10,0,102,108,111,111,114,0,1,1,0,10,97,0,0,0,1,4,118,101,99,52,95,102,108,111, +111,114,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,0,0,1,0,11,0,102,108,111,111, +114,0,1,1,0,11,97,0,0,0,1,4,118,101,99,52,95,102,108,111,111,114,0,18,95,95,114,101,116,86,97,108, +0,59,120,121,122,0,0,18,97,0,0,0,0,1,0,12,0,102,108,111,111,114,0,1,1,0,12,97,0,0,0,1,4,118,101,99, +52,95,102,108,111,111,114,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,0,9,0,99,101,105, +108,0,1,1,0,9,97,0,0,0,1,3,2,0,9,1,98,0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111,111,114,0, +18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,98,0,54,20,0,0,1,0,10,0,99, +101,105,108,0,1,1,0,10,97,0,0,0,1,3,2,0,10,1,98,0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111, +111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18,98,0,54,20,0,0, +1,0,11,0,99,101,105,108,0,1,1,0,11,97,0,0,0,1,3,2,0,11,1,98,0,2,18,97,0,54,0,0,4,118,101,99,52,95, +102,108,111,111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,18, +98,0,54,20,0,0,1,0,12,0,99,101,105,108,0,1,1,0,12,97,0,0,0,1,3,2,0,12,1,98,0,2,18,97,0,54,0,0,4, +118,101,99,52,95,102,108,111,111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18, +98,0,54,20,0,0,1,0,9,0,102,114,97,99,116,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0, +18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,0,0,0,1,0,10,0,102,114,97,99,116,0,1,1,0,10,97, +0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0, +0,0,0,1,0,11,0,102,114,97,99,116,0,1,1,0,11,97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18,95,95, +114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,0,0,1,0,12,0,102,114,97,99,116,0,1,1,0,12,97, +0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,0,9, +0,109,111,100,0,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1,111,110,101,79,118,101,114,66,0,0,0,4, +102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,0,18,98,0,0,0,9,18,95,95,114, +101,116,86,97,108,0,59,120,0,18,97,0,18,98,0,58,102,108,111,111,114,0,18,97,0,18,111,110,101,79, +118,101,114,66,0,48,0,0,48,47,20,0,0,1,0,10,0,109,111,100,0,1,1,0,10,97,0,0,1,1,0,9,98,0,0,0,1,3,2, +0,9,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79, +118,101,114,66,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18,97,0,18,98,0,58, +102,108,111,111,114,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,0,11,0,109, +111,100,0,1,1,0,11,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1,111,110,101,79,118,101,114,66,0,0,0,4,102, +108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,0,18,98,0,0,0,9,18,95,95,114,101, +116,86,97,108,0,59,120,121,122,0,18,97,0,18,98,0,58,102,108,111,111,114,0,18,97,0,18,111,110,101, +79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,0,12,0,109,111,100,0,1,1,0,12,97,0,0,1,1,0,9,98,0,0,0,1, +3,2,0,9,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101, +79,118,101,114,66,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,18,98,0,58,102,108, +111,111,114,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,0,10,0,109,111,100, +0,1,1,0,10,97,0,0,1,1,0,10,98,0,0,0,1,3,2,0,9,1,111,110,101,79,118,101,114,66,120,0,0,1,1,111,110, +101,79,118,101,114,66,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114, 66,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114, -66,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114, -66,122,0,0,18,98,0,59,122,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,97,0,59,120,0,18,98, +66,121,0,0,18,98,0,59,121,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,97,0,59,120,0,18,98, 0,59,120,0,58,102,108,111,111,114,0,18,97,0,59,120,0,18,111,110,101,79,118,101,114,66,120,0,48,0,0, 48,47,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,97,0,59,121,0,18,98,0,59,121,0,58,102, -108,111,111,114,0,18,97,0,59,121,0,18,111,110,101,79,118,101,114,66,121,0,48,0,0,48,47,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,122,0,18,97,0,59,122,0,18,98,0,59,122,0,58,102,108,111,111,114,0, -18,97,0,59,122,0,18,111,110,101,79,118,101,114,66,122,0,48,0,0,48,47,20,0,0,1,0,12,0,109,111,100,0, -1,1,0,12,97,0,0,1,1,0,12,98,0,0,0,1,3,2,0,9,1,111,110,101,79,118,101,114,66,120,0,0,1,1,111,110, -101,79,118,101,114,66,121,0,0,1,1,111,110,101,79,118,101,114,66,122,0,0,1,1,111,110,101,79,118,101, -114,66,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,120,0,0,18, -98,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,121,0,0,18, -98,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,122,0,0,18, -98,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,119,0,0,18, -98,0,59,119,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,97,0,59,120,0,18,98,0,59,120,0,58, -102,108,111,111,114,0,18,97,0,59,120,0,18,111,110,101,79,118,101,114,66,120,0,48,0,0,48,47,20,0,9, -18,95,95,114,101,116,86,97,108,0,59,121,0,18,97,0,59,121,0,18,98,0,59,121,0,58,102,108,111,111,114, -0,18,97,0,59,121,0,18,111,110,101,79,118,101,114,66,121,0,48,0,0,48,47,20,0,9,18,95,95,114,101,116, -86,97,108,0,59,122,0,18,97,0,59,122,0,18,98,0,59,122,0,58,102,108,111,111,114,0,18,97,0,59,122,0, -18,111,110,101,79,118,101,114,66,122,0,48,0,0,48,47,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119, -0,18,97,0,59,119,0,18,98,0,59,119,0,58,102,108,111,111,114,0,18,97,0,59,119,0,18,111,110,101,79, -118,101,114,66,122,0,48,0,0,48,47,20,0,0,1,0,9,0,109,105,110,0,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,4, -118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,18, -98,0,59,120,0,0,0,0,1,0,10,0,109,105,110,0,1,1,0,10,97,0,0,1,1,0,10,98,0,0,0,1,4,118,101,99,52,95, -109,105,110,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,59,120,121,0,0,18,98,0,59, -120,121,0,0,0,0,1,0,11,0,109,105,110,0,1,1,0,11,97,0,0,1,1,0,11,98,0,0,0,1,4,118,101,99,52,95,109, -105,110,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,59,120,121,122,0,0,18,98,0, -59,120,121,122,0,0,0,0,1,0,12,0,109,105,110,0,1,1,0,12,97,0,0,1,1,0,12,98,0,0,0,1,4,118,101,99,52, -95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,0,10,0,109,105,110,0, -1,1,0,10,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108, -0,0,18,97,0,59,120,121,0,0,18,98,0,59,120,120,0,0,0,0,1,0,11,0,109,105,110,0,1,1,0,11,97,0,0,1,1,0, -9,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,59,120, -121,122,0,0,18,98,0,59,120,120,120,0,0,0,0,1,0,12,0,109,105,110,0,1,1,0,12,97,0,0,1,1,0,9,98,0,0,0, -1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,59,120,120, -120,120,0,0,0,0,1,0,9,0,109,97,120,0,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,97, -120,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0,0,0,0,1,0,10, -0,109,97,120,0,1,1,0,10,97,0,0,1,1,0,10,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,0,0,18,97,0,59,120,121,0,0,18,98,0,59,120,121,0,0,0,0,1,0,11,0,109, -97,120,0,1,1,0,11,97,0,0,1,1,0,11,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116, -86,97,108,0,59,120,121,122,0,0,18,97,0,59,120,121,122,0,0,18,98,0,59,120,121,122,0,0,0,0,1,0,12,0, -109,97,120,0,1,1,0,12,97,0,0,1,1,0,12,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101, -116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,0,10,0,109,97,120,0,1,1,0,10,97,0,0,1,1,0,9,98,0,0,0,1, -4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,59,120,121,0,0,18,98,0, -59,120,120,0,0,0,0,1,0,11,0,109,97,120,0,1,1,0,11,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109, -97,120,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,59,120,121,122,0,0,18,98,0,59,120,120,120,0,0, -0,0,1,0,12,0,109,97,120,0,1,1,0,12,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95, -95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,59,120,120,120,120,0,0,0,0,1,0,9,0,99,108,97,109, -112,0,1,1,0,9,118,97,108,0,0,1,1,0,9,109,105,110,86,97,108,0,0,1,1,0,9,109,97,120,86,97,108,0,0,0, -1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18, -109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,0,10,0,99,108,97,109,112,0,1,1,0,10, -118,97,108,0,0,1,1,0,9,109,105,110,86,97,108,0,0,1,1,0,9,109,97,120,86,97,108,0,0,0,1,4,118,101,99, -52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86, -97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,0,11,0,99,108,97,109,112,0,1,1,0,11,118,97,108,0,0,1, -1,0,9,109,105,110,86,97,108,0,0,1,1,0,9,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97, -109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109, -97,120,86,97,108,0,0,0,0,1,0,12,0,99,108,97,109,112,0,1,1,0,12,118,97,108,0,0,1,1,0,9,109,105,110, -86,97,108,0,0,1,1,0,9,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95, +108,111,111,114,0,18,97,0,59,121,0,18,111,110,101,79,118,101,114,66,121,0,48,0,0,48,47,20,0,0,1,0, +11,0,109,111,100,0,1,1,0,11,97,0,0,1,1,0,11,98,0,0,0,1,3,2,0,9,1,111,110,101,79,118,101,114,66,120, +0,0,1,1,111,110,101,79,118,101,114,66,121,0,0,1,1,111,110,101,79,118,101,114,66,122,0,0,0,4,102, +108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,120,0,0,18,98,0,59,120,0,0,0,4,102, +108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,121,0,0,18,98,0,59,121,0,0,0,4,102, +108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,122,0,0,18,98,0,59,122,0,0,0,9,18, +95,95,114,101,116,86,97,108,0,59,120,0,18,97,0,59,120,0,18,98,0,59,120,0,58,102,108,111,111,114,0, +18,97,0,59,120,0,18,111,110,101,79,118,101,114,66,120,0,48,0,0,48,47,20,0,9,18,95,95,114,101,116, +86,97,108,0,59,121,0,18,97,0,59,121,0,18,98,0,59,121,0,58,102,108,111,111,114,0,18,97,0,59,121,0, +18,111,110,101,79,118,101,114,66,121,0,48,0,0,48,47,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122, +0,18,97,0,59,122,0,18,98,0,59,122,0,58,102,108,111,111,114,0,18,97,0,59,122,0,18,111,110,101,79, +118,101,114,66,122,0,48,0,0,48,47,20,0,0,1,0,12,0,109,111,100,0,1,1,0,12,97,0,0,1,1,0,12,98,0,0,0, +1,3,2,0,9,1,111,110,101,79,118,101,114,66,120,0,0,1,1,111,110,101,79,118,101,114,66,121,0,0,1,1, +111,110,101,79,118,101,114,66,122,0,0,1,1,111,110,101,79,118,101,114,66,119,0,0,0,4,102,108,111,97, +116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97, +116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97, +116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,122,0,0,18,98,0,59,122,0,0,0,4,102,108,111,97, +116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,119,0,0,18,98,0,59,119,0,0,0,9,18,95,95,114, +101,116,86,97,108,0,59,120,0,18,97,0,59,120,0,18,98,0,59,120,0,58,102,108,111,111,114,0,18,97,0,59, +120,0,18,111,110,101,79,118,101,114,66,120,0,48,0,0,48,47,20,0,9,18,95,95,114,101,116,86,97,108,0, +59,121,0,18,97,0,59,121,0,18,98,0,59,121,0,58,102,108,111,111,114,0,18,97,0,59,121,0,18,111,110, +101,79,118,101,114,66,121,0,48,0,0,48,47,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,97,0, +59,122,0,18,98,0,59,122,0,58,102,108,111,111,114,0,18,97,0,59,122,0,18,111,110,101,79,118,101,114, +66,122,0,48,0,0,48,47,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18,97,0,59,119,0,18,98,0,59, +119,0,58,102,108,111,111,114,0,18,97,0,59,119,0,18,111,110,101,79,118,101,114,66,122,0,48,0,0,48, +47,20,0,0,1,0,9,0,109,105,110,0,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0, +18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0,0,0,0,1,0,10,0,109, +105,110,0,1,1,0,10,97,0,0,1,1,0,10,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101, +116,86,97,108,0,59,120,121,0,0,18,97,0,59,120,121,0,0,18,98,0,59,120,121,0,0,0,0,1,0,11,0,109,105, +110,0,1,1,0,11,97,0,0,1,1,0,11,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86, +97,108,0,59,120,121,122,0,0,18,97,0,59,120,121,122,0,0,18,98,0,59,120,121,122,0,0,0,0,1,0,12,0,109, +105,110,0,1,1,0,12,97,0,0,1,1,0,12,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101, +116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,0,10,0,109,105,110,0,1,1,0,10,97,0,0,1,1,0,9,98,0,0,0, +1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,59,120,121,0,0,18,98, +0,59,120,120,0,0,0,0,1,0,11,0,109,105,110,0,1,1,0,11,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95, +109,105,110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,59,120,121,122,0,0,18,98,0,59,120,120,120, +0,0,0,0,1,0,12,0,109,105,110,0,1,1,0,12,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0, +18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,59,120,120,120,120,0,0,0,0,1,0,9,0,109,97,120, +0,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108, +0,59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0,0,0,0,1,0,10,0,109,97,120,0,1,1,0,10,97,0,0,1,1,0, +10,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18, +97,0,59,120,121,0,0,18,98,0,59,120,121,0,0,0,0,1,0,11,0,109,97,120,0,1,1,0,11,97,0,0,1,1,0,11,98,0, +0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0, +59,120,121,122,0,0,18,98,0,59,120,121,122,0,0,0,0,1,0,12,0,109,97,120,0,1,1,0,12,97,0,0,1,1,0,12, +98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0, +0,0,1,0,10,0,109,97,120,0,1,1,0,10,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95, +95,114,101,116,86,97,108,0,0,18,97,0,59,120,121,0,0,18,98,0,59,120,120,0,0,0,0,1,0,11,0,109,97,120, +0,1,1,0,11,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97, +108,0,0,18,97,0,59,120,121,122,0,0,18,98,0,59,120,120,120,0,0,0,0,1,0,12,0,109,97,120,0,1,1,0,12, +97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,0,18,97, +0,0,18,98,0,59,120,120,120,120,0,0,0,0,1,0,9,0,99,108,97,109,112,0,1,1,0,9,118,97,108,0,0,1,1,0,9, +109,105,110,86,97,108,0,0,1,1,0,9,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109, +112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97, +120,86,97,108,0,0,0,0,1,0,10,0,99,108,97,109,112,0,1,1,0,10,118,97,108,0,0,1,1,0,9,109,105,110,86, +97,108,0,0,1,1,0,9,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95, 114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0, -0,0,0,1,0,10,0,99,108,97,109,112,0,1,1,0,10,118,97,108,0,0,1,1,0,10,109,105,110,86,97,108,0,0,1,1, -0,10,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86, -97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,0,11,0, -99,108,97,109,112,0,1,1,0,11,118,97,108,0,0,1,1,0,11,109,105,110,86,97,108,0,0,1,1,0,11,109,97,120, -86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118, -97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,0,12,0,99,108,97,109,112, -0,1,1,0,12,118,97,108,0,0,1,1,0,12,109,105,110,86,97,108,0,0,1,1,0,12,109,97,120,86,97,108,0,0,0,1, -4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109, -105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,0,9,0,109,105,120,0,1,1,0,9,120,0,0,1,1,0, -9,121,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0, -18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,10,0,109,105,120,0,1,1,0,10,120,0,0,1,1,0,10,121,0,0,1,1,0, -9,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121, -0,0,18,120,0,0,0,0,1,0,11,0,109,105,120,0,1,1,0,11,120,0,0,1,1,0,11,121,0,0,1,1,0,9,97,0,0,0,1,4, -118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0, -0,0,1,0,12,0,109,105,120,0,1,1,0,12,120,0,0,1,1,0,12,121,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95, -108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,10,0,109, -105,120,0,1,1,0,10,120,0,0,1,1,0,10,121,0,0,1,1,0,10,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0, -18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,11,0,109,105,120,0,1,1, -0,11,120,0,0,1,1,0,11,121,0,0,1,1,0,11,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114, -101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,12,0,109,105,120,0,1,1,0,12,120,0,0, -1,1,0,12,121,0,0,1,1,0,12,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97, -108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,9,0,115,116,101,112,0,1,1,0,9,101,100,103,101,0,0, -1,1,0,9,120,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0, -18,120,0,0,18,101,100,103,101,0,0,0,0,1,0,10,0,115,116,101,112,0,1,1,0,10,101,100,103,101,0,0,1,1, -0,10,120,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0, -18,120,0,0,18,101,100,103,101,0,0,0,0,1,0,11,0,115,116,101,112,0,1,1,0,11,101,100,103,101,0,0,1,1, -0,11,120,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122, -0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1,0,12,0,115,116,101,112,0,1,1,0,12,101,100,103,101,0,0, -1,1,0,12,120,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0, -0,18,101,100,103,101,0,0,0,0,1,0,10,0,115,116,101,112,0,1,1,0,9,101,100,103,101,0,0,1,1,0,10,118,0, -0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0, -18,101,100,103,101,0,59,120,120,0,0,0,0,1,0,11,0,115,116,101,112,0,1,1,0,9,101,100,103,101,0,0,1,1, -0,11,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122, -0,0,18,118,0,0,18,101,100,103,101,0,59,120,120,120,0,0,0,0,1,0,12,0,115,116,101,112,0,1,1,0,9,101, -100,103,101,0,0,1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97, -108,0,0,18,118,0,0,18,101,100,103,101,0,59,120,120,120,120,0,0,0,0,1,0,9,0,115,109,111,111,116,104, -115,116,101,112,0,1,1,0,9,101,100,103,101,48,0,0,1,1,0,9,101,100,103,101,49,0,0,1,1,0,9,120,0,0,0, -1,3,2,0,9,1,116,0,2,58,99,108,97,109,112,0,18,120,0,18,101,100,103,101,48,0,47,18,101,100,103,101, -49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0, -48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,10,0,115,109,111,111,116,104,115,116, -101,112,0,1,1,0,10,101,100,103,101,48,0,0,1,1,0,10,101,100,103,101,49,0,0,1,1,0,10,118,0,0,0,1,3,2, -0,10,1,116,0,2,58,99,108,97,109,112,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0, -18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17, -51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,11,0,115,109,111,111,116,104,115,116,101,112, -0,1,1,0,11,101,100,103,101,48,0,0,1,1,0,11,101,100,103,101,49,0,0,1,1,0,11,118,0,0,0,1,3,2,0,11,1, -116,0,2,58,99,108,97,109,112,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101, -100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51,0,48, -0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,12,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0, -12,101,100,103,101,48,0,0,1,1,0,12,101,100,103,101,49,0,0,1,1,0,12,118,0,0,0,1,3,2,0,12,1,116,0,2, -58,99,108,97,109,112,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103, -101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17, -50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,10,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,9,101, -100,103,101,48,0,0,1,1,0,9,101,100,103,101,49,0,0,1,1,0,10,118,0,0,0,1,3,2,0,10,1,116,0,2,58,99, -108,97,109,112,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48, -0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48, -0,0,18,116,0,48,47,48,0,0,1,0,11,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,9,101,100,103, -101,48,0,0,1,1,0,9,101,100,103,101,49,0,0,1,1,0,11,118,0,0,0,1,3,2,0,11,1,116,0,2,58,99,108,97,109, +0,0,0,1,0,11,0,99,108,97,109,112,0,1,1,0,11,118,97,108,0,0,1,1,0,9,109,105,110,86,97,108,0,0,1,1,0, +9,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97, +108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,0,12,0,99, +108,97,109,112,0,1,1,0,12,118,97,108,0,0,1,1,0,9,109,105,110,86,97,108,0,0,1,1,0,9,109,97,120,86, +97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97, +108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,0,10,0,99,108,97,109,112,0, +1,1,0,10,118,97,108,0,0,1,1,0,10,109,105,110,86,97,108,0,0,1,1,0,10,109,97,120,86,97,108,0,0,0,1,4, +118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109, +105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,0,11,0,99,108,97,109,112,0,1,1,0,11,118,97, +108,0,0,1,1,0,11,109,105,110,86,97,108,0,0,1,1,0,11,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52, +95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97, +108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,0,12,0,99,108,97,109,112,0,1,1,0,12,118,97,108,0,0,1,1,0, +12,109,105,110,86,97,108,0,0,1,1,0,12,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97, +109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109, +97,120,86,97,108,0,0,0,0,1,0,9,0,109,105,120,0,1,1,0,9,120,0,0,1,1,0,9,121,0,0,1,1,0,9,97,0,0,0,1, +4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0, +0,0,0,1,0,10,0,109,105,120,0,1,1,0,10,120,0,0,1,1,0,10,121,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52, +95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,11,0, +109,105,120,0,1,1,0,11,120,0,0,1,1,0,11,121,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,108,114,112, +0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,12,0,109,105,120,0,1, +1,0,12,120,0,0,1,1,0,12,121,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114, +101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,10,0,109,105,120,0,1,1,0,10,120,0,0, +1,1,0,10,121,0,0,1,1,0,10,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97, +108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,11,0,109,105,120,0,1,1,0,11,120,0,0,1,1,0,11,121,0, +0,1,1,0,11,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0, +0,18,121,0,0,18,120,0,0,0,0,1,0,12,0,109,105,120,0,1,1,0,12,120,0,0,1,1,0,12,121,0,0,1,1,0,12,97,0, +0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18, +120,0,0,0,0,1,0,9,0,115,116,101,112,0,1,1,0,9,101,100,103,101,0,0,1,1,0,9,120,0,0,0,1,4,118,101,99, +52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,120,0,0,18,101,100,103,101,0,0, +0,0,1,0,10,0,115,116,101,112,0,1,1,0,10,101,100,103,101,0,0,1,1,0,10,120,0,0,0,1,4,118,101,99,52, +95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,120,0,0,18,101,100,103,101,0,0, +0,0,1,0,11,0,115,116,101,112,0,1,1,0,11,101,100,103,101,0,0,1,1,0,11,120,0,0,0,1,4,118,101,99,52, +95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,120,0,0,18,101,100,103,101, +0,0,0,0,1,0,12,0,115,116,101,112,0,1,1,0,12,101,100,103,101,0,0,1,1,0,12,120,0,0,0,1,4,118,101,99, +52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1,0, +10,0,115,116,101,112,0,1,1,0,9,101,100,103,101,0,0,1,1,0,10,118,0,0,0,1,4,118,101,99,52,95,115,103, +116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,101,100,103,101,0,59,120,120,0, +0,0,0,1,0,11,0,115,116,101,112,0,1,1,0,9,101,100,103,101,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99,52, +95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,101,100,103,101, +0,59,120,120,120,0,0,0,0,1,0,12,0,115,116,101,112,0,1,1,0,9,101,100,103,101,0,0,1,1,0,12,118,0,0,0, +1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,101,100,103, +101,0,59,120,120,120,120,0,0,0,0,1,0,9,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,9,101,100, +103,101,48,0,0,1,1,0,9,101,100,103,101,49,0,0,1,1,0,9,120,0,0,0,1,3,2,0,9,1,116,0,2,58,99,108,97, +109,112,0,18,120,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47, +49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0, +18,116,0,48,47,48,0,0,1,0,10,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,10,101,100,103,101, +48,0,0,1,1,0,10,101,100,103,101,49,0,0,1,1,0,10,118,0,0,0,1,3,2,0,10,1,116,0,2,58,99,108,97,109, 112,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0, 17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18, -116,0,48,47,48,0,0,1,0,12,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,9,101,100,103,101,48,0, -0,1,1,0,9,101,100,103,101,49,0,0,1,1,0,12,118,0,0,0,1,3,2,0,12,1,116,0,2,58,99,108,97,109,112,0,18, -118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0, -48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48, -47,48,0,0,1,0,9,0,108,101,110,103,116,104,0,1,1,0,9,120,0,0,0,1,8,58,97,98,115,0,18,120,0,0,0,0,0, -1,0,9,0,108,101,110,103,116,104,0,1,1,0,10,118,0,0,0,1,3,2,0,9,1,114,0,0,0,3,2,1,9,1,112,0,2,58, -100,111,116,0,18,118,0,0,18,118,0,0,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,112, -0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0, -0,0,1,0,9,0,108,101,110,103,116,104,0,1,1,0,11,118,0,0,0,1,3,2,0,9,1,114,0,0,0,3,2,1,9,1,112,0,2, -58,100,111,116,0,18,118,0,0,18,118,0,0,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18, -112,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114, -0,0,0,0,1,0,9,0,108,101,110,103,116,104,0,1,1,0,12,118,0,0,0,1,3,2,0,9,1,114,0,0,0,3,2,1,9,1,112,0, -2,58,100,111,116,0,18,118,0,0,18,118,0,0,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18, -112,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114, -0,0,0,0,1,0,9,0,100,105,115,116,97,110,99,101,0,1,1,0,9,120,0,0,1,1,0,9,121,0,0,0,1,3,2,1,9,1,100, -0,2,18,120,0,18,121,0,47,0,0,9,18,95,95,114,101,116,86,97,108,0,58,108,101,110,103,116,104,0,18, -100,0,0,0,20,0,0,1,0,9,0,100,105,115,116,97,110,99,101,0,1,1,0,10,118,0,0,1,1,0,10,117,0,0,0,1,3,2, -1,10,1,100,50,0,2,18,118,0,18,117,0,47,0,0,9,18,95,95,114,101,116,86,97,108,0,58,108,101,110,103, -116,104,0,18,100,50,0,0,0,20,0,0,1,0,9,0,100,105,115,116,97,110,99,101,0,1,1,0,11,118,0,0,1,1,0,11, -117,0,0,0,1,3,2,1,11,1,100,51,0,2,18,118,0,18,117,0,47,0,0,9,18,95,95,114,101,116,86,97,108,0,58, -108,101,110,103,116,104,0,18,100,51,0,0,0,20,0,0,1,0,9,0,100,105,115,116,97,110,99,101,0,1,1,0,12, -118,0,0,1,1,0,12,117,0,0,0,1,3,2,1,12,1,100,52,0,2,18,118,0,18,117,0,47,0,0,9,18,95,95,114,101,116, -86,97,108,0,58,108,101,110,103,116,104,0,18,100,52,0,0,0,20,0,0,1,0,11,0,99,114,111,115,115,0,1,1, -0,11,118,0,0,1,1,0,11,117,0,0,0,1,4,118,101,99,51,95,99,114,111,115,115,0,18,95,95,114,101,116,86, -97,108,0,59,120,121,122,0,0,18,118,0,0,18,117,0,0,0,0,1,0,9,0,102,97,99,101,102,111,114,119,97,114, -100,0,1,1,0,9,78,0,0,1,1,0,9,73,0,0,1,1,0,9,78,114,101,102,0,0,0,1,3,2,1,9,1,100,0,2,58,100,111, -116,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,0,9,1,115,0,0,0,4,118,101,99,52,95,115,103,116,0, -18,115,0,59,120,0,0,17,48,0,48,0,0,0,18,100,0,0,0,8,58,109,105,120,0,18,78,0,54,0,18,78,0,0,18,115, -0,0,0,0,0,1,0,10,0,102,97,99,101,102,111,114,119,97,114,100,0,1,1,0,10,78,0,0,1,1,0,10,73,0,0,1,1, -0,10,78,114,101,102,0,0,0,1,3,2,1,9,1,100,0,2,58,100,111,116,0,18,78,114,101,102,0,0,18,73,0,0,0,0, -0,3,2,0,9,1,115,0,0,0,4,118,101,99,52,95,115,103,116,0,18,115,0,59,120,0,0,17,48,0,48,0,0,0,18,100, -0,0,0,8,58,109,105,120,0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0,0,1,0,11,0,102,97,99,101,102,111, -114,119,97,114,100,0,1,1,0,11,78,0,0,1,1,0,11,73,0,0,1,1,0,11,78,114,101,102,0,0,0,1,3,2,1,9,1,100, -0,2,58,100,111,116,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,0,9,1,115,0,0,0,4,118,101,99,52,95, -115,103,116,0,18,115,0,59,120,0,0,17,48,0,48,0,0,0,18,100,0,0,0,8,58,109,105,120,0,18,78,0,54,0,18, -78,0,0,18,115,0,0,0,0,0,1,0,12,0,102,97,99,101,102,111,114,119,97,114,100,0,1,1,0,12,78,0,0,1,1,0, -12,73,0,0,1,1,0,12,78,114,101,102,0,0,0,1,3,2,1,9,1,100,0,2,58,100,111,116,0,18,78,114,101,102,0,0, -18,73,0,0,0,0,0,3,2,0,9,1,115,0,0,0,4,118,101,99,52,95,115,103,116,0,18,115,0,59,120,0,0,17,48,0, -48,0,0,0,18,100,0,0,0,8,58,109,105,120,0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0,0,1,0,9,0,114,101, -102,108,101,99,116,0,1,1,0,9,73,0,0,1,1,0,9,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,116,0, -18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,0,10,0,114,101,102,108,101,99,116,0,1,1,0,10,73,0,0,1, -1,0,10,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47, -0,0,1,0,11,0,114,101,102,108,101,99,116,0,1,1,0,11,73,0,0,1,1,0,11,78,0,0,0,1,8,18,73,0,17,50,0,48, -0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,0,12,0,114,101,102,108,101,99, -116,0,1,1,0,12,73,0,0,1,1,0,12,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,18,78,0,0,18, -73,0,0,0,48,18,78,0,48,47,0,0,1,0,9,0,114,101,102,114,97,99,116,0,1,1,0,9,73,0,0,1,1,0,9,78,0,0,1, -1,0,9,101,116,97,0,0,0,1,3,2,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,17,49, -0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,47,48,47, -0,0,10,18,107,0,17,48,0,48,0,0,40,0,8,17,48,0,48,0,0,0,9,14,0,8,18,101,116,97,0,18,73,0,48,18,101, -116,97,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18,107,0,0,0,46,18,78,0,48, -47,0,0,1,0,10,0,114,101,102,114,97,99,116,0,1,1,0,10,73,0,0,1,1,0,10,78,0,0,1,1,0,9,101,116,97,0,0, -0,1,3,2,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,17,49,0,48,0,0,58,100,111, -116,0,18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,47,48,47,0,0,10,18,107,0,17, -48,0,48,0,0,40,0,8,17,48,0,48,0,0,0,9,14,0,8,18,101,116,97,0,18,73,0,48,18,101,116,97,0,58,100,111, -116,0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18,107,0,0,0,46,18,78,0,48,47,0,0,1,0,11,0,114, -101,102,114,97,99,116,0,1,1,0,11,73,0,0,1,1,0,11,78,0,0,1,1,0,9,101,116,97,0,0,0,1,3,2,0,9,1,107,0, -2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,17,49,0,48,0,0,58,100,111,116,0,18,78,0,0,18, -73,0,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,47,48,47,0,0,10,18,107,0,17,48,0,48,0,0,40,0,8, -17,48,0,48,0,0,0,9,14,0,8,18,101,116,97,0,18,73,0,48,18,101,116,97,0,58,100,111,116,0,18,78,0,0,18, -73,0,0,0,48,58,115,113,114,116,0,18,107,0,0,0,46,18,78,0,48,47,0,0,1,0,12,0,114,101,102,114,97,99, -116,0,1,1,0,12,73,0,0,1,1,0,12,78,0,0,1,1,0,9,101,116,97,0,0,0,1,3,2,0,9,1,107,0,2,17,49,0,48,0,0, -18,101,116,97,0,18,101,116,97,0,48,17,49,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,58,100, -111,116,0,18,78,0,0,18,73,0,0,0,48,47,48,47,0,0,10,18,107,0,17,48,0,48,0,0,40,0,8,17,48,0,48,0,0,0, -9,14,0,8,18,101,116,97,0,18,73,0,48,18,101,116,97,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58, -115,113,114,116,0,18,107,0,0,0,46,18,78,0,48,47,0,0,1,0,13,0,109,97,116,114,105,120,67,111,109,112, -77,117,108,116,0,1,0,0,13,109,0,0,1,0,0,13,110,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57, -18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,14,0,109, -97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,14,109,0,0,1,0,0,14,110,0,0,0,1,8,58,109, -97,116,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10, -49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,15,0,109,97,116,114,105, -120,67,111,109,112,77,117,108,116,0,1,0,0,15,109,0,0,1,0,0,15,110,0,0,0,1,8,58,109,97,116,52,0,18, -109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0, -18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57, -48,0,0,0,0,1,0,2,0,108,101,115,115,84,104,97,110,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,4,118,101, -99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1, -0,3,0,108,101,115,115,84,104,97,110,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99,52,95,115, -108,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0, -108,101,115,115,84,104,97,110,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,115,108, -116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,108,101,115,115,84,104, -97,110,0,1,1,0,6,117,0,0,1,1,0,6,118,0,0,0,1,4,118,101,99,52,95,115,108,116,0,18,95,95,114,101,116, -86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,108,101,115,115,84,104,97,110,0,1,1,0, -7,117,0,0,1,1,0,7,118,0,0,0,1,4,118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,59, -120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,108,101,115,115,84,104,97,110,0,1,1,0,8,117,0,0, -1,1,0,8,118,0,0,0,1,4,118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0, -18,118,0,0,0,0,1,0,2,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,10,117,0,0,1,1,0,10, -118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18, -117,0,0,18,118,0,0,0,0,1,0,3,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,11,117,0,0, -1,1,0,11,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121, -122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0, -12,117,0,0,1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0, -0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,6,117, -0,0,1,1,0,6,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0, -7,117,0,0,1,1,0,7,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,59, -120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,108,101,115,115,84,104,97,110,69,113,117,97,108, -0,1,1,0,8,117,0,0,1,1,0,8,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114,101,116,86,97, -108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,10,117, -0,0,1,1,0,10,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,11,117, -0,0,1,1,0,11,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,12, -117,0,0,1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,0, -18,117,0,0,18,118,0,0,0,0,1,0,2,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,6,117,0,0,1,1,0, -6,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18, -117,0,0,18,118,0,0,0,0,1,0,3,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,7,117,0,0,1,1,0,7, -118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0, -18,117,0,0,18,118,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,8,117,0,0,1,1,0, -8,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18, -118,0,0,0,0,1,0,2,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,10,117,0,0, -1,1,0,10,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121, -0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0, -1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97, -108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84,104,97, -110,69,113,117,97,108,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18, -95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,103,114,101,97,116,101,114,84, -104,97,110,69,113,117,97,108,0,1,1,0,6,117,0,0,1,1,0,6,118,0,0,0,1,4,118,101,99,52,95,115,103,101, -0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,103,114,101,97, -116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,7,117,0,0,1,1,0,7,118,0,0,0,1,4,118,101,99,52, -95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0, -4,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,8,117,0,0,1,1,0,8,118,0,0,0, -1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1, -0,2,0,101,113,117,97,108,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,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,117,0,0,18,118,0,0,0,0,1,0,3,0,101,113,117,97, -108,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,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,117,0,0,18,118,0,0,0,0,1,0,4,0,101,113,117,97,108,0,1,1,0,12,117, -0,0,1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0,18, -117,0,0,18,118,0,0,0,0,1,0,2,0,101,113,117,97,108,0,1,1,0,6,117,0,0,1,1,0,6,118,0,0,0,1,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,117,0,0,18,118,0,0,0,0,1, -0,3,0,101,113,117,97,108,0,1,1,0,7,117,0,0,1,1,0,7,118,0,0,0,1,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,117,0,0,18,118,0,0,0,0,1,0,4,0,101,113,117,97, -108,0,1,1,0,8,117,0,0,1,1,0,8,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86, -97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,110,111,116,69,113,117,97,108,0,1,1,0,10,117,0,0,1,1, -0,10,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0, -18,117,0,0,18,118,0,0,0,0,1,0,3,0,110,111,116,69,113,117,97,108,0,1,1,0,11,117,0,0,1,1,0,11,118,0, -0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117, -0,0,18,118,0,0,0,0,1,0,4,0,110,111,116,69,113,117,97,108,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,4, -118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2, -0,110,111,116,69,113,117,97,108,0,1,1,0,6,117,0,0,1,1,0,6,118,0,0,0,1,4,118,101,99,52,95,115,110, -101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,110,111, -116,69,113,117,97,108,0,1,1,0,7,117,0,0,1,1,0,7,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95, -95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,110,111,116,69,113, -117,97,108,0,1,1,0,8,117,0,0,1,1,0,8,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101, -116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,1,0,97,110,121,0,1,1,0,2,118,0,0,0,1,3,2,0,9,1,115, -117,109,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,118,0,59,120,0,0,18, -118,0,59,121,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18, -115,117,109,0,59,120,0,0,17,48,0,48,0,0,0,0,0,1,0,1,0,97,110,121,0,1,1,0,3,118,0,0,0,1,3,2,0,9,1, -115,117,109,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,118,0,59,120,0,0, -18,118,0,59,121,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,115,117,109,0, -59,120,0,0,18,118,0,59,122,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0, -59,120,0,0,18,115,117,109,0,59,120,0,0,17,48,0,48,0,0,0,0,0,1,0,1,0,97,110,121,0,1,1,0,4,118,0,0,0, -1,3,2,0,9,1,115,117,109,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,118,0, -59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18, -115,117,109,0,59,120,0,0,18,118,0,59,122,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59, -120,0,0,18,115,117,109,0,59,120,0,0,18,118,0,59,119,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95, -95,114,101,116,86,97,108,0,59,120,0,0,18,115,117,109,0,59,120,0,0,17,48,0,48,0,0,0,0,0,1,0,1,0,97, -108,108,0,1,1,0,10,118,0,0,0,1,3,2,0,9,1,112,114,111,100,0,0,0,4,118,101,99,52,95,109,117,108,116, -105,112,108,121,0,18,112,114,111,100,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118, -101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,112,114,111,100,0,59,120, -0,0,17,48,0,48,0,0,0,0,8,18,118,0,59,120,0,18,118,0,59,121,0,34,0,0,1,0,1,0,97,108,108,0,1,1,0,3, -118,0,0,0,1,3,2,0,9,1,112,114,111,100,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0, -18,112,114,111,100,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,109, -117,108,116,105,112,108,121,0,18,112,114,111,100,0,59,120,0,0,18,112,114,111,100,0,59,120,0,0,18, -118,0,59,122,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18, -112,114,111,100,0,59,120,0,0,17,48,0,48,0,0,0,0,0,1,0,1,0,97,108,108,0,1,1,0,4,118,0,0,0,1,3,2,0,9, -1,112,114,111,100,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0, -59,120,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112, -108,121,0,18,112,114,111,100,0,59,120,0,0,18,112,114,111,100,0,59,120,0,0,18,118,0,59,122,0,0,0,4, -118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,59,120,0,0,18,112,114,111, -100,0,59,120,0,0,18,118,0,59,119,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97, -108,0,59,120,0,0,18,112,114,111,100,0,59,120,0,0,17,48,0,48,0,0,0,0,0,1,0,2,0,110,111,116,0,1,1,0, -2,118,0,0,0,1,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, -118,0,0,17,48,0,48,0,0,0,0,0,1,0,3,0,110,111,116,0,1,1,0,3,118,0,0,0,1,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,118,0,0,17,48,0,48,0,0,0,0,0,1,0,4,0, -110,111,116,0,1,1,0,4,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108, -0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,0,1,1,0,16,115,97, -109,112,108,101,114,0,0,1,1,0,9,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,49,100,0, -18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0, -1,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,16,115,97,109,112,108,101,114,0, -0,1,1,0,10,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,49,100,0,18,95,95,114,101, -116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,120,121,121,121,0,0, -0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,16,115,97,109,112,108,101, -114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,49,100,0,18,95,95, -114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0, -116,101,120,116,117,114,101,50,68,0,1,1,0,17,115,97,109,112,108,101,114,0,0,1,1,0,10,99,111,111, -114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115, -97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50, -68,80,114,111,106,0,1,1,0,17,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4, -118,101,99,52,95,116,101,120,112,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108, -101,114,0,0,18,99,111,111,114,100,0,59,120,121,122,122,0,0,0,0,1,0,12,0,116,101,120,116,117,114, -101,50,68,80,114,111,106,0,1,1,0,17,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0, -0,1,4,118,101,99,52,95,116,101,120,112,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109, -112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,0,1,1, -0,18,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101, -120,51,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111, -114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,80,114,111,106,0,1,1,0,18,115,97,109, -112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,51,100, -0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0, -0,1,0,12,0,116,101,120,116,117,114,101,67,117,98,101,0,1,1,0,19,115,97,109,112,108,101,114,0,0,1,1, -0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,99,117,98,101,0,18,95,95,114,101, -116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104, -97,100,111,119,49,68,0,1,1,0,20,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1, -4,118,101,99,52,95,116,101,120,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108, -101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,80,114,111,106,0,1, -1,0,20,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116, -101,120,112,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99, -111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,0,1,1,0,21,115,97,109,112,108,101, -114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,50,100,0,18,95,95,114, -101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,115, -104,97,100,111,119,50,68,80,114,111,106,0,1,1,0,21,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111, -111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,50,100,0,18,95,95,114,101,116,86,97,108,0,0, +116,0,48,47,48,0,0,1,0,11,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,11,101,100,103,101,48, +0,0,1,1,0,11,101,100,103,101,49,0,0,1,1,0,11,118,0,0,0,1,3,2,0,11,1,116,0,2,58,99,108,97,109,112,0, +18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48, +0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48, +47,48,0,0,1,0,12,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,12,101,100,103,101,48,0,0,1,1,0, +12,101,100,103,101,49,0,0,1,1,0,12,118,0,0,0,1,3,2,0,12,1,116,0,2,58,99,108,97,109,112,0,18,118,0, +18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0, +0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0, +0,1,0,10,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,9,101,100,103,101,48,0,0,1,1,0,9,101, +100,103,101,49,0,0,1,1,0,10,118,0,0,0,1,3,2,0,10,1,116,0,2,58,99,108,97,109,112,0,18,118,0,18,101, +100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49, +0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,11, +0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,9,101,100,103,101,48,0,0,1,1,0,9,101,100,103,101, +49,0,0,1,1,0,11,118,0,0,0,1,3,2,0,11,1,116,0,2,58,99,108,97,109,112,0,18,118,0,18,101,100,103,101, +48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0, +0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,12,0,115,109, +111,111,116,104,115,116,101,112,0,1,1,0,9,101,100,103,101,48,0,0,1,1,0,9,101,100,103,101,49,0,0,1, +1,0,12,118,0,0,0,1,3,2,0,12,1,116,0,2,58,99,108,97,109,112,0,18,118,0,18,101,100,103,101,48,0,47, +18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8, +18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,9,0,108,101,110,103, +116,104,0,1,1,0,9,120,0,0,0,1,8,58,97,98,115,0,18,120,0,0,0,0,0,1,0,9,0,108,101,110,103,116,104,0, +1,1,0,10,118,0,0,0,1,3,2,0,9,1,114,0,0,0,3,2,1,9,1,112,0,2,58,100,111,116,0,18,118,0,0,18,118,0,0, +0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,112,0,0,0,4,102,108,111,97,116,95,114,99, +112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,0,1,0,9,0,108,101,110,103,116,104,0, +1,1,0,11,118,0,0,0,1,3,2,0,9,1,114,0,0,0,3,2,1,9,1,112,0,2,58,100,111,116,0,18,118,0,0,18,118,0,0, +0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,112,0,0,0,4,102,108,111,97,116,95,114,99, +112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,0,1,0,9,0,108,101,110,103,116,104,0, +1,1,0,12,118,0,0,0,1,3,2,0,9,1,114,0,0,0,3,2,1,9,1,112,0,2,58,100,111,116,0,18,118,0,0,18,118,0,0, +0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,112,0,0,0,4,102,108,111,97,116,95,114,99, +112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,0,1,0,9,0,100,105,115,116,97,110,99, +101,0,1,1,0,9,120,0,0,1,1,0,9,121,0,0,0,1,3,2,1,9,1,100,0,2,18,120,0,18,121,0,47,0,0,9,18,95,95, +114,101,116,86,97,108,0,58,108,101,110,103,116,104,0,18,100,0,0,0,20,0,0,1,0,9,0,100,105,115,116, +97,110,99,101,0,1,1,0,10,118,0,0,1,1,0,10,117,0,0,0,1,3,2,1,10,1,100,50,0,2,18,118,0,18,117,0,47,0, +0,9,18,95,95,114,101,116,86,97,108,0,58,108,101,110,103,116,104,0,18,100,50,0,0,0,20,0,0,1,0,9,0, +100,105,115,116,97,110,99,101,0,1,1,0,11,118,0,0,1,1,0,11,117,0,0,0,1,3,2,1,11,1,100,51,0,2,18,118, +0,18,117,0,47,0,0,9,18,95,95,114,101,116,86,97,108,0,58,108,101,110,103,116,104,0,18,100,51,0,0,0, +20,0,0,1,0,9,0,100,105,115,116,97,110,99,101,0,1,1,0,12,118,0,0,1,1,0,12,117,0,0,0,1,3,2,1,12,1, +100,52,0,2,18,118,0,18,117,0,47,0,0,9,18,95,95,114,101,116,86,97,108,0,58,108,101,110,103,116,104, +0,18,100,52,0,0,0,20,0,0,1,0,11,0,99,114,111,115,115,0,1,1,0,11,118,0,0,1,1,0,11,117,0,0,0,1,4,118, +101,99,51,95,99,114,111,115,115,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0, +18,117,0,0,0,0,1,0,9,0,102,97,99,101,102,111,114,119,97,114,100,0,1,1,0,9,78,0,0,1,1,0,9,73,0,0,1, +1,0,9,78,114,101,102,0,0,0,1,3,2,1,9,1,100,0,2,58,100,111,116,0,18,78,114,101,102,0,0,18,73,0,0,0, +0,0,3,2,0,9,1,115,0,0,0,4,118,101,99,52,95,115,103,116,0,18,115,0,59,120,0,0,17,48,0,48,0,0,0,18, +100,0,0,0,8,58,109,105,120,0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0,0,1,0,10,0,102,97,99,101,102, +111,114,119,97,114,100,0,1,1,0,10,78,0,0,1,1,0,10,73,0,0,1,1,0,10,78,114,101,102,0,0,0,1,3,2,1,9,1, +100,0,2,58,100,111,116,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,0,9,1,115,0,0,0,4,118,101,99,52, +95,115,103,116,0,18,115,0,59,120,0,0,17,48,0,48,0,0,0,18,100,0,0,0,8,58,109,105,120,0,18,78,0,54,0, +18,78,0,0,18,115,0,0,0,0,0,1,0,11,0,102,97,99,101,102,111,114,119,97,114,100,0,1,1,0,11,78,0,0,1,1, +0,11,73,0,0,1,1,0,11,78,114,101,102,0,0,0,1,3,2,1,9,1,100,0,2,58,100,111,116,0,18,78,114,101,102,0, +0,18,73,0,0,0,0,0,3,2,0,9,1,115,0,0,0,4,118,101,99,52,95,115,103,116,0,18,115,0,59,120,0,0,17,48,0, +48,0,0,0,18,100,0,0,0,8,58,109,105,120,0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0,0,1,0,12,0,102,97, +99,101,102,111,114,119,97,114,100,0,1,1,0,12,78,0,0,1,1,0,12,73,0,0,1,1,0,12,78,114,101,102,0,0,0, +1,3,2,1,9,1,100,0,2,58,100,111,116,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,0,9,1,115,0,0,0,4, +118,101,99,52,95,115,103,116,0,18,115,0,59,120,0,0,17,48,0,48,0,0,0,18,100,0,0,0,8,58,109,105,120, +0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0,0,1,0,9,0,114,101,102,108,101,99,116,0,1,1,0,9,73,0,0,1,1, +0,9,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0, +0,1,0,10,0,114,101,102,108,101,99,116,0,1,1,0,10,73,0,0,1,1,0,10,78,0,0,0,1,8,18,73,0,17,50,0,48,0, +0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,0,11,0,114,101,102,108,101,99,116, +0,1,1,0,11,73,0,0,1,1,0,11,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0, +0,0,48,18,78,0,48,47,0,0,1,0,12,0,114,101,102,108,101,99,116,0,1,1,0,12,73,0,0,1,1,0,12,78,0,0,0,1, +8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,0,9,0,114, +101,102,114,97,99,116,0,1,1,0,9,73,0,0,1,1,0,9,78,0,0,1,1,0,9,101,116,97,0,0,0,1,3,2,0,9,1,107,0,2, +17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,17,49,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73, +0,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,47,48,47,0,0,10,18,107,0,17,48,0,48,0,0,40,0,8,17, +48,0,48,0,0,0,9,14,0,8,18,101,116,97,0,18,73,0,48,18,101,116,97,0,58,100,111,116,0,18,78,0,0,18,73, +0,0,0,48,58,115,113,114,116,0,18,107,0,0,0,46,18,78,0,48,47,0,0,1,0,10,0,114,101,102,114,97,99,116, +0,1,1,0,10,73,0,0,1,1,0,10,78,0,0,1,1,0,9,101,116,97,0,0,0,1,3,2,0,9,1,107,0,2,17,49,0,48,0,0,18, +101,116,97,0,18,101,116,97,0,48,17,49,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,58,100,111, +116,0,18,78,0,0,18,73,0,0,0,48,47,48,47,0,0,10,18,107,0,17,48,0,48,0,0,40,0,8,17,48,0,48,0,0,0,9, +14,0,8,18,101,116,97,0,18,73,0,48,18,101,116,97,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58,115, +113,114,116,0,18,107,0,0,0,46,18,78,0,48,47,0,0,1,0,11,0,114,101,102,114,97,99,116,0,1,1,0,11,73,0, +0,1,1,0,11,78,0,0,1,1,0,9,101,116,97,0,0,0,1,3,2,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18, +101,116,97,0,48,17,49,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0, +18,73,0,0,0,48,47,48,47,0,0,10,18,107,0,17,48,0,48,0,0,40,0,8,17,48,0,48,0,0,0,9,14,0,8,18,101,116, +97,0,18,73,0,48,18,101,116,97,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18, +107,0,0,0,46,18,78,0,48,47,0,0,1,0,12,0,114,101,102,114,97,99,116,0,1,1,0,12,73,0,0,1,1,0,12,78,0, +0,1,1,0,9,101,116,97,0,0,0,1,3,2,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48, +17,49,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,47, +48,47,0,0,10,18,107,0,17,48,0,48,0,0,40,0,8,17,48,0,48,0,0,0,9,14,0,8,18,101,116,97,0,18,73,0,48, +18,101,116,97,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18,107,0,0,0,46,18, +78,0,48,47,0,0,1,0,13,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,13,109,0,0,1, +0,0,13,110,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0, +16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,14,0,109,97,116,114,105,120,67,111,109,112,77, +117,108,116,0,1,0,0,14,109,0,0,1,0,0,14,110,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,18, +110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57, +18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,15,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0, +1,0,0,15,109,0,0,1,0,0,15,110,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48, +0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10, +50,0,57,48,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,2,0,108,101,115,115,84, +104,97,110,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,4,118,101,99,52,95,115,108,116,0,18,95,95,114, +101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,108,101,115,115,84,104,97,110, +0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86, +97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,108,101,115,115,84,104,97,110,0,1,1, +0,12,117,0,0,1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108, +0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,108,101,115,115,84,104,97,110,0,1,1,0,6,117,0,0,1,1,0,6,118, +0,0,0,1,4,118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0, +0,18,118,0,0,0,0,1,0,3,0,108,101,115,115,84,104,97,110,0,1,1,0,7,117,0,0,1,1,0,7,118,0,0,0,1,4,118, +101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0, +0,0,0,1,0,4,0,108,101,115,115,84,104,97,110,0,1,1,0,8,117,0,0,1,1,0,8,118,0,0,0,1,4,118,101,99,52, +95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,108,101,115, +115,84,104,97,110,69,113,117,97,108,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,4,118,101,99,52,95,115, +108,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,108, +101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99, +52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0, +1,0,4,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,4, +118,101,99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2, +0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,6,117,0,0,1,1,0,6,118,0,0,0,1,4,118,101, +99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1, +0,3,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,7,117,0,0,1,1,0,7,118,0,0,0,1,4,118, +101,99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0, +0,0,0,1,0,4,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,8,117,0,0,1,1,0,8,118,0,0,0, +1,4,118,101,99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1, +0,2,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,4,118,101, +99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1, +0,3,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,4,118,101, +99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0, +0,1,0,4,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,4,118, +101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0, +103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,6,117,0,0,1,1,0,6,118,0,0,0,1,4,118,101,99,52,95, +115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0, +103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,7,117,0,0,1,1,0,7,118,0,0,0,1,4,118,101,99,52,95, +115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4, +0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,8,117,0,0,1,1,0,8,118,0,0,0,1,4,118,101,99,52, +95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,103,114,101, +97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,4,118,101, +99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1, +0,3,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,11,117,0,0,1,1,0,11,118,0, +0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117, +0,0,18,118,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,12, +117,0,0,1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,0, +18,117,0,0,18,118,0,0,0,0,1,0,2,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1, +0,6,117,0,0,1,1,0,6,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0, +59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,103,114,101,97,116,101,114,84,104,97,110,69,113, +117,97,108,0,1,1,0,7,117,0,0,1,1,0,7,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101, +116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84, +104,97,110,69,113,117,97,108,0,1,1,0,8,117,0,0,1,1,0,8,118,0,0,0,1,4,118,101,99,52,95,115,103,101, +0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,101,113,117,97,108,0,1,1,0, +10,117,0,0,1,1,0,10,118,0,0,0,1,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,117,0,0,18,118,0,0,0,0,1,0,3,0,101,113,117,97,108,0,1,1,0,11,117,0,0,1,1,0,11, +118,0,0,0,1,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,117,0,0,18,118,0,0,0,0,1,0,4,0,101,113,117,97,108,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,4,118, +101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0, +101,113,117,97,108,0,1,1,0,6,117,0,0,1,1,0,6,118,0,0,0,1,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,117,0,0,18,118,0,0,0,0,1,0,3,0,101,113,117,97,108,0,1,1, +0,7,117,0,0,1,1,0,7,118,0,0,0,1,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,117,0,0,18,118,0,0,0,0,1,0,4,0,101,113,117,97,108,0,1,1,0,8,117,0,0,1,1,0,8, +118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118, +0,0,0,0,1,0,2,0,110,111,116,69,113,117,97,108,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,4,118,101,99, +52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0, +3,0,110,111,116,69,113,117,97,108,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99,52,95,115, +110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0, +110,111,116,69,113,117,97,108,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,115,110, +101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,110,111,116,69,113,117, +97,108,0,1,1,0,6,117,0,0,1,1,0,6,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116, +86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,110,111,116,69,113,117,97,108,0,1,1,0, +7,117,0,0,1,1,0,7,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59, +120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,110,111,116,69,113,117,97,108,0,1,1,0,8,117,0,0, +1,1,0,8,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0, +18,118,0,0,0,0,1,0,1,0,97,110,121,0,1,1,0,2,118,0,0,0,1,3,2,0,9,1,115,117,109,0,0,0,4,118,101,99, +52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101, +99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,115,117,109,0,59,120,0,0,17, +48,0,48,0,0,0,0,0,1,0,1,0,97,110,121,0,1,1,0,3,118,0,0,0,1,3,2,0,9,1,115,117,109,0,0,0,4,118,101, +99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118, +101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,115,117,109,0,59,120,0,0,18,118,0,59,122, +0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,115,117,109, +0,59,120,0,0,17,48,0,48,0,0,0,0,0,1,0,1,0,97,110,121,0,1,1,0,4,118,0,0,0,1,3,2,0,9,1,115,117,109,0, +0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0,59, +121,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,115,117,109,0,59,120,0,0, +18,118,0,59,122,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,115,117,109,0, +59,120,0,0,18,118,0,59,119,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0, +59,120,0,0,18,115,117,109,0,59,120,0,0,17,48,0,48,0,0,0,0,0,1,0,1,0,97,108,108,0,1,1,0,10,118,0,0, +0,1,3,2,0,9,1,112,114,111,100,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112, +114,111,100,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,115,110,101, +0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,112,114,111,100,0,59,120,0,0,17,48,0,48,0,0,0,0,8, +18,118,0,59,120,0,18,118,0,59,121,0,34,0,0,1,0,1,0,97,108,108,0,1,1,0,3,118,0,0,0,1,3,2,0,9,1,112, +114,111,100,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,59,120, +0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0, +18,112,114,111,100,0,59,120,0,0,18,112,114,111,100,0,59,120,0,0,18,118,0,59,122,0,0,0,4,118,101,99, +52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,112,114,111,100,0,59,120,0,0,17, +48,0,48,0,0,0,0,0,1,0,1,0,97,108,108,0,1,1,0,4,118,0,0,0,1,3,2,0,9,1,112,114,111,100,0,0,0,4,118, +101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,59,120,0,0,18,118,0,59,120,0,0, +18,118,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,59, +120,0,0,18,112,114,111,100,0,59,120,0,0,18,118,0,59,122,0,0,0,4,118,101,99,52,95,109,117,108,116, +105,112,108,121,0,18,112,114,111,100,0,59,120,0,0,18,112,114,111,100,0,59,120,0,0,18,118,0,59,119, +0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,112,114,111, +100,0,59,120,0,0,17,48,0,48,0,0,0,0,0,1,0,2,0,110,111,116,0,1,1,0,2,118,0,0,0,1,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,118,0,0,17,48,0,48,0,0,0,0,0,1,0, +3,0,110,111,116,0,1,1,0,3,118,0,0,0,1,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,118,0,0,17,48,0,48,0,0,0,0,0,1,0,4,0,110,111,116,0,1,1,0,4,118,0,0,0,1, +4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,17,48,0,48,0,0,0,0, +0,1,0,12,0,116,101,120,116,117,114,101,49,68,0,1,1,0,16,115,97,109,112,108,101,114,0,0,1,1,0,9,99, +111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,49,100,0,18,95,95,114,101,116,86,97,108,0,0, 18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114, -101,50,68,82,101,99,116,0,1,1,0,22,115,97,109,112,108,101,114,0,0,1,1,0,10,99,111,111,114,100,0,0, -0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115, +101,49,68,80,114,111,106,0,1,1,0,16,115,97,109,112,108,101,114,0,0,1,1,0,10,99,111,111,114,100,0,0, +0,1,4,118,101,99,52,95,116,101,120,112,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109, +112,108,101,114,0,0,18,99,111,111,114,100,0,59,120,121,121,121,0,0,0,0,1,0,12,0,116,101,120,116, +117,114,101,49,68,80,114,111,106,0,1,1,0,16,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114, +100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115, 97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50, -68,82,101,99,116,80,114,111,106,0,1,1,0,22,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114, -100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108, -0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,120,121,122,122,0,0,0,0,1,0,12,0, -116,101,120,116,117,114,101,50,68,82,101,99,116,80,114,111,106,0,1,1,0,22,115,97,109,112,108,101, -114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,95,114,101,99,116,0, -18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,99,111,111,114,100,0,0, -0,0,1,0,12,0,115,104,97,100,111,119,50,68,82,101,99,116,0,1,1,0,23,115,97,109,112,108,101,114,0,0, -1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,0,18,95,95, +68,0,1,1,0,17,115,97,109,112,108,101,114,0,0,1,1,0,10,99,111,111,114,100,0,0,0,1,4,118,101,99,52, +95,116,101,120,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99, +111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,1,0,17,115, +97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112, +50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114, +100,0,59,120,121,122,122,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,1,0, +17,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101, +120,112,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111, +111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,0,1,1,0,18,115,97,109,112,108,101, +114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,51,100,0,18,95,95,114, +101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116, +101,120,116,117,114,101,51,68,80,114,111,106,0,1,1,0,18,115,97,109,112,108,101,114,0,0,1,1,0,12,99, +111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,51,100,0,18,95,95,114,101,116,86,97,108, +0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117, +114,101,67,117,98,101,0,1,1,0,19,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0, +1,4,118,101,99,52,95,116,101,120,99,117,98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109, +112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,0,1,1,0,20, +115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120, +49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114, +100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,80,114,111,106,0,1,1,0,20,115,97,109,112,108,101, +114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,49,100,0,18,95,95, 114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0, -115,104,97,100,111,119,50,68,82,101,99,116,80,114,111,106,0,1,1,0,23,115,97,109,112,108,101,114,0, -0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,95,114,101,99,116,0,18,95, -95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,9, -0,110,111,105,115,101,49,0,1,1,0,9,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,49,0,18, -95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,1,0,10,120,0,0,0, -1,4,102,108,111,97,116,95,110,111,105,115,101,50,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0, -0,1,0,9,0,110,111,105,115,101,49,0,1,1,0,11,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115, -101,51,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,1,0, -12,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,52,0,18,95,95,114,101,116,86,97,108,0,0, -18,120,0,0,0,0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -121,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,0,1,0,10,0,110,111,105, -115,101,50,0,1,1,0,10,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115, +115,104,97,100,111,119,50,68,0,1,1,0,21,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100, +0,0,0,1,4,118,101,99,52,95,116,101,120,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109, +112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,80,114,111, +106,0,1,1,0,21,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52, +95,116,101,120,112,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0, +18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,82,101,99,116,0,1,1,0,22, +115,97,109,112,108,101,114,0,0,1,1,0,10,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120, +95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111, +111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,82,101,99,116,80,114,111,106,0,1,1, +0,22,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101, +120,112,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0, +18,99,111,111,114,100,0,59,120,121,122,122,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,82, +101,99,116,80,114,111,106,0,1,1,0,22,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0, +0,0,1,4,118,101,99,52,95,116,101,120,112,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18, +115,97,109,112,108,101,114,0,0,18,99,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50, +68,82,101,99,116,0,1,1,0,23,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4, +118,101,99,52,95,116,101,120,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109, +112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,82,101,99, +116,80,114,111,106,0,1,1,0,23,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4, +118,101,99,52,95,116,101,120,112,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97, +109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,1,0,9,120, +0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,49,0,18,95,95,114,101,116,86,97,108,0,0,18,120, +0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,1,0,10,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105, +115,101,50,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1, +1,0,11,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,51,0,18,95,95,114,101,116,86,97,108, +0,0,18,120,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,1,0,12,120,0,0,0,1,4,102,108,111,97,116,95, +110,111,105,115,101,52,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,10,0,110,111,105, +115,101,50,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115, 101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0, -18,120,0,58,118,101,99,50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,0,1,0,10,0, -110,111,105,115,101,50,0,1,1,0,11,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, +18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,10,120,0,0,0,1, +9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95, +95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,49, +57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,11, +120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0, +20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101, +99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,0,1,0,10,0, +110,111,105,115,101,50,0,1,1,0,12,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, +111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105, +115,101,49,0,18,120,0,58,118,101,99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51, +0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1,1,0,9,120,0,0,0,1,9, +18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0, +20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,17,53,0,52, +55,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1,1,0,10,120,0,0,0,1,9,18,95,95,114,101,116, +86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97, +108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,57,0,51,52,0,0,0,17, +55,0,54,54,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101, +49,0,18,120,0,58,118,101,99,50,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,20,0,0,1,0,11, +0,110,111,105,115,101,51,0,1,1,0,11,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, 111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105, 115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51, -0,0,0,0,46,0,0,20,0,0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,12,120,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,49,57,0,51,52,0,0,0, -17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105, -115,101,51,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115, -101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0, -18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111, -105,115,101,49,0,18,120,0,17,53,0,52,55,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1,1,0, -10,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0, -0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101, +0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120, +0,58,118,101,99,51,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,20, +0,0,1,0,11,0,110,111,105,115,101,51,0,1,1,0,12,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59, +120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58, +110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17, +51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58, +110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17, +49,49,0,48,52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0, +9,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0, +20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0, +51,52,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18, +120,0,17,53,0,52,55,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115, +101,49,0,18,120,0,17,50,51,0,53,52,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0,10, +120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0, +20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101, 99,50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108, 0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,53,0,52,55,0,0,0,17,49,55,0, -56,53,0,0,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1,1,0,11,120,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52,0,0, -0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122, -0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0, -0,17,49,49,0,48,52,0,0,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1,1,0,12,120,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,49,57, -0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,53,0, -52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,20,0,0,1, -0,12,0,110,111,105,115,101,52,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58, -110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111, -105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -122,0,58,110,111,105,115,101,49,0,18,120,0,17,53,0,52,55,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120,0,17,50,51,0,53,52,0,0,46,0,0,20,0,0,1,0,12,0, -110,111,105,115,101,52,0,1,1,0,10,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, +56,53,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0, +18,120,0,58,118,101,99,50,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,0,46,0,0,20,0,0,1,0,12,0, +110,111,105,115,101,52,0,1,1,0,11,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, +111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105, +115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51, +0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120, +0,58,118,101,99,51,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,20, +0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99, +51,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,0,46,0,0,20,0,0,1,0,12,0, +110,111,105,115,101,52,0,1,1,0,12,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, 111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105, -115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0, -9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50, -0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -119,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49, -49,0,0,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0,11,120,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52,0,0,0, -17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0, -58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0, -17,49,49,0,48,52,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105, -115,101,49,0,18,120,0,58,118,101,99,51,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0, -57,49,0,0,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0,12,120,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,49,57,0,51,52,0,0, -0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,53,0,52,55,0,0,0, -17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,50,51,0,53, -52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,17,51,55,0,52,56,0,0,0,0,46,0,0,20,0,0,0 +115,101,49,0,18,120,0,58,118,101,99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51, +0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105, +115,101,49,0,18,120,0,58,118,101,99,52,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48, +52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110, +111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17, +51,49,0,57,49,0,0,0,17,51,55,0,52,56,0,0,0,0,46,0,0,20,0,0,0 -- cgit v1.2.3 From 7ff72a76590d5abdbe0891da51a5fed37d6fe312 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 27 Apr 2007 15:23:19 -0600 Subject: document broken inverse trig functions --- docs/shading.html | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/shading.html b/docs/shading.html index aa19c88d86d..99342a329f7 100644 --- a/docs/shading.html +++ b/docs/shading.html @@ -45,6 +45,7 @@ in Mesa:

  • Linking of multiple shaders is not supported
  • gl_ClipVertex
  • The derivative functions such as dFdx() are not implemented +
  • The inverse trig functions asin(), acos(), and atan() are not implemented

    -- cgit v1.2.3 From 4b1d1b7b1865191a2687d548edb6c9a066005925 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 27 Apr 2007 15:25:00 -0600 Subject: document perspective correction issues --- docs/shading.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/shading.html b/docs/shading.html index 99342a329f7..0e1a5e1a7bc 100644 --- a/docs/shading.html +++ b/docs/shading.html @@ -46,6 +46,8 @@ in Mesa:

  • gl_ClipVertex
  • The derivative functions such as dFdx() are not implemented
  • The inverse trig functions asin(), acos(), and atan() are not implemented +
  • The gl_Color and gl_SecondaryColor varying vars are interpolated + without perspective correction

    -- cgit v1.2.3 From cce5084941f3cd23678d07569a07b6b9cf958868 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 27 Apr 2007 15:41:07 -0600 Subject: "Fix" for bug 9170. May need more attention. --- src/mesa/drivers/dri/r300/r300_state.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index b941af19966..4730fdff749 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1269,6 +1269,9 @@ void r300_setup_textures(GLcontext *ctx) tmu_mappings[i] = hw_tmu; t=r300->state.texture.unit[i].texobj; + /* XXX questionable fix for bug 9170: */ + if (!t) + continue; if((t->format & 0xffffff00)==0xffffff00) { WARN_ONCE("unknown texture format (entry %x) encountered. Help me !\n", t->format & 0xff); -- cgit v1.2.3 From 02e958a1e448bc5928fe668d302fc431aac97555 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 27 Apr 2007 16:27:36 -0600 Subject: added glGetActiveAttrib --- progs/util/extfuncs.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/progs/util/extfuncs.h b/progs/util/extfuncs.h index 90302bb5107..5d647cdae7f 100644 --- a/progs/util/extfuncs.h +++ b/progs/util/extfuncs.h @@ -11,6 +11,7 @@ static PFNGLCREATEPROGRAMPROC glCreateProgram_func = NULL; static PFNGLCREATESHADERPROC glCreateShader_func = NULL; static PFNGLDELETEPROGRAMPROC glDeleteProgram_func = NULL; static PFNGLDELETESHADERPROC glDeleteShader_func = NULL; +static PFNGLGETACTIVEATTRIBPROC glGetActiveAttrib_func = NULL; static PFNGLGETATTACHEDSHADERSPROC glGetAttachedShaders_func = NULL; static PFNGLGETATTRIBLOCATIONPROC glGetAttribLocation_func = NULL; static PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog_func = NULL; @@ -78,6 +79,7 @@ GetExtensionFuncs(void) glCreateShader_func = (PFNGLCREATESHADERPROC) glutGetProcAddress("glCreateShader"); glDeleteProgram_func = (PFNGLDELETEPROGRAMPROC) glutGetProcAddress("glDeleteProgram"); glDeleteShader_func = (PFNGLDELETESHADERPROC) glutGetProcAddress("glDeleteShader"); + glGetActiveAttrib_func = (PFNGLGETACTIVEATTRIBPROC) glutGetProcAddress("glGetActiveAttrib"); glGetAttachedShaders_func = (PFNGLGETATTACHEDSHADERSPROC) glutGetProcAddress("glGetAttachedShaders"); glGetAttribLocation_func = (PFNGLGETATTRIBLOCATIONPROC) glutGetProcAddress("glGetAttribLocation"); glGetProgramInfoLog_func = (PFNGLGETPROGRAMINFOLOGPROC) glutGetProcAddress("glGetProgramInfoLog"); -- cgit v1.2.3 From 502ebe90e808853768a64853adfb8960dee64d68 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 27 Apr 2007 16:53:26 -0600 Subject: 7.0 release notes (template) --- docs/relnotes-7.0.html | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 docs/relnotes-7.0.html diff --git a/docs/relnotes-7.0.html b/docs/relnotes-7.0.html new file mode 100644 index 00000000000..534cc59436a --- /dev/null +++ b/docs/relnotes-7.0.html @@ -0,0 +1,67 @@ + + +Mesa Release Notes + + + + + + + +

    Mesa 7.0 Release Notes / (in progress)

    + +

    +Mesa 7.0 is a stable release, featuring OpenGL 2.1 API support. +

    + + +

    MD5 checksums

    +
    +TBD
    +
    + + +

    New features

    +
      +
    • OpenGL 2.0 and 2.1 API support. +
    + +

    Bug fixes

    +
      +
    + + +

    Internal code changes

    +
      +
    + + +

    To Do (someday) items

    +
      +
    • Switch to freeglut +
    • Fix linux-glide target/driver. +
    • Improved lambda and derivative calculation for frag progs. +
    + + +

    Driver Status

    + +
    +Driver			Status
    +----------------------	----------------------
    +DRI drivers		varies with the driver
    +XMesa/GLX (on Xlib)	implements OpenGL 2.1
    +OSMesa (off-screen)	implements OpenGL 2.1
    +Windows/Win32		implements OpenGL 2.1
    +Glide (3dfx Voodoo1/2)	implements OpenGL 1.3
    +SVGA			unsupported
    +Wind River UGL		unsupported
    +DJGPP			unsupported
    +GGI			unsupported
    +BeOS			unsupported
    +Allegro			unsupported
    +D3D			unsupported
    +
    + + + -- cgit v1.2.3 From 430e0364137565a8c5e227afd904a99bfcb5348e Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 27 Apr 2007 16:53:42 -0600 Subject: added 6.5.3 MD5 sums --- docs/relnotes-6.5.3.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/relnotes-6.5.3.html b/docs/relnotes-6.5.3.html index df7526f4705..0d68d990134 100644 --- a/docs/relnotes-6.5.3.html +++ b/docs/relnotes-6.5.3.html @@ -18,7 +18,15 @@ Mesa 7.0 is expected to follow shortly.

    MD5 checksums

    -TBD
    +39f33ea64e34e2d5b20640b008b57649  MesaLib-6.5.3.tar.gz
    +46359457147c469745f24b5074a186f0  MesaLib-6.5.3.tar.bz2
    +a8946fa861634ce15971396f47992c41  MesaLib-6.5.3.zip
    +08e26948d57eaca74d02a530b2d8106e  MesaDemos-6.5.3.tar.gz
    +8af91773ab2653fe537499676b05f2e8  MesaDemos-6.5.3.tar.bz2
    +783f81b171bf89b0929abc894efd25a6  MesaDemos-6.5.3.zip
    +9467d415388fe1ad82991fb20704b812  MesaGLUT-6.5.3.tar.gz
    +360843e46b7ebb6909290b023f9b26fa  MesaGLUT-6.5.3.tar.bz2
    +7686065e5c15a30de08a1610860b6840  MesaGLUT-6.5.3.zip
     
    -- cgit v1.2.3 From c4615abb11a0fa0f6c2e0bdd543771564beb94c9 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 27 Apr 2007 16:54:05 -0600 Subject: added 7.0 relnotes link --- docs/relnotes.html | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/relnotes.html b/docs/relnotes.html index f73500d4aca..c698dfe1312 100644 --- a/docs/relnotes.html +++ b/docs/relnotes.html @@ -20,6 +20,7 @@ The release notes summarize what's new or changed in each Mesa release.

      +
    • 7.0 release notes
    • 6.5.3 release notes
    • 6.5.2 release notes
    • 6.5.1 release notes -- cgit v1.2.3 From af846712fdc3a6946dca74ea67e393fbd106ea84 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 27 Apr 2007 17:00:13 -0600 Subject: updates for 7.0 --- docs/intro.html | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/docs/intro.html b/docs/intro.html index 33a006a74b5..ec481a90913 100644 --- a/docs/intro.html +++ b/docs/intro.html @@ -128,10 +128,15 @@ specification as well as the GL_ARB_vertex_program and GL_ARB_fragment_program extensions.

      +

      +May 2007: Mesa 7.0 is released, implementing the OpenGL 2.1 specification +and OpenGL Shading Language. +

      +

      Ongoing: Mesa is used as the core of many hardware OpenGL drivers for -the XFree86 X.org X servers within the +the XFree86 and X.org X servers within the DRI project. I continue to enhance Mesa with new extensions and features.

      @@ -141,9 +146,16 @@ I continue to enhance Mesa with new extensions and features.

      Major Versions

      -This is a summary of the major versions of Mesa. Note that Mesa's major -version number tracks OpenGL's minor version number (+1). -Work is underway to implement the OpenGL 2.0 specification. +This is a summary of the major versions of Mesa. +Mesa's major version number has been incremented whenever a new version +of the OpenGL specification is implemented. +

      + + +

      Version 7.x features

      +

      +Version 7.x of Mesa implements the OpenGL 2.1 API. The main feature +of OpenGL 2.x is the OpenGL Shading Language.

      -- cgit v1.2.3 From e371a5f08460f2b7a9574d35171e970c7bde4b5f Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 27 Apr 2007 17:01:23 -0600 Subject: Version bumps for 7.0 --- Makefile | 8 ++++---- configs/default | 6 +++--- src/mesa/main/version.h | 14 +++++++------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index a6999aaeef9..e039b5e280f 100644 --- a/Makefile +++ b/Makefile @@ -155,10 +155,10 @@ ultrix-gcc: # Rules for making release tarballs -DIRECTORY = Mesa-6.5.3 -LIB_NAME = MesaLib-6.5.3 -DEMO_NAME = MesaDemos-6.5.3 -GLUT_NAME = MesaGLUT-6.5.3 +DIRECTORY = Mesa-7.0pre +LIB_NAME = MesaLib-7.0pre +DEMO_NAME = MesaDemos-7.0pre +GLUT_NAME = MesaGLUT-7.0pre MAIN_FILES = \ $(DIRECTORY)/Makefile* \ diff --git a/configs/default b/configs/default index b162287b352..b6a051e2b38 100644 --- a/configs/default +++ b/configs/default @@ -8,9 +8,9 @@ CONFIG_NAME = default # Version info -MESA_MAJOR=6 -MESA_MINOR=5 -MESA_TINY=3 +MESA_MAJOR=7 +MESA_MINOR=0 +MESA_TINY=0 # external projects. This should be useless now that we use libdrm. DRM_SOURCE_PATH=$(TOP)/../drm diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index e4a74cb0d41..afc0bc2ec91 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.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. * @@ -28,10 +28,10 @@ /* Mesa version */ -#define MESA_MAJOR 6 -#define MESA_MINOR 5 -#define MESA_PATCH 3 -#define MESA_VERSION_STRING "6.5.3" +#define MESA_MAJOR 7 +#define MESA_MINOR 0 +#define MESA_PATCH 0 +#define MESA_VERSION_STRING "7.0" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) @@ -40,9 +40,9 @@ /* OpenGL API version */ #define OPENGL_MAJOR 2 -#define OPENGL_MINOR 0 +#define OPENGL_MINOR 1 #define OPENGL_PATCH 0 -#define OPENGL_VERSION_STRING "2.0" +#define OPENGL_VERSION_STRING "2.1" /* To make version comparison easy */ #define OPENGL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -- cgit v1.2.3 From d741b10be6c254a3c52f93b9f2241aeb8ba7eba1 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 27 Apr 2007 17:05:29 -0600 Subject: 7.0 blurb --- docs/news.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/news.html b/docs/news.html index d23fc6dfc6b..cd09e2532d4 100644 --- a/docs/news.html +++ b/docs/news.html @@ -11,6 +11,13 @@

      News

      +

      May ???, 2007

      +

      +Mesa 7.0 is released. +This is a stable release featuring OpenGL 2.1 support. +

      + +

      April 27, 2007

      Mesa 6.5.3 is released. -- cgit v1.2.3 From bfaf6156fbc81c8073b7562365331d306d4de75a Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 28 Apr 2007 07:50:06 -0600 Subject: additional checks that attr is a texcoord --- src/mesa/swrast/s_aalinetemp.h | 4 ++-- src/mesa/swrast/s_aatritemp.h | 6 +++--- src/mesa/swrast/s_pointtemp.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mesa/swrast/s_aalinetemp.h b/src/mesa/swrast/s_aalinetemp.h index 402d64b9f75..80cec0b31d4 100644 --- a/src/mesa/swrast/s_aalinetemp.h +++ b/src/mesa/swrast/s_aalinetemp.h @@ -93,7 +93,7 @@ NAME(plot)(GLcontext *ctx, struct LineInfo *line, int ix, int iy) 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) { + if (attr < FRAG_ATTRIB_VAR0 && attr >= FRAG_ATTRIB_TEX0) { const GLuint unit = attr - FRAG_ATTRIB_TEX0; line->span.array->lambda[unit][i] = compute_lambda(line->sPlane[attr], @@ -220,7 +220,7 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1) 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) { + 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]; diff --git a/src/mesa/swrast/s_aatritemp.h b/src/mesa/swrast/s_aatritemp.h index 39456cc192b..4162ed68532 100644 --- a/src/mesa/swrast/s_aatritemp.h +++ b/src/mesa/swrast/s_aatritemp.h @@ -203,7 +203,7 @@ 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) { + 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]; @@ -289,7 +289,7 @@ 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) { + 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, @@ -381,7 +381,7 @@ 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) { + 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], diff --git a/src/mesa/swrast/s_pointtemp.h b/src/mesa/swrast/s_pointtemp.h index d118a532a45..dddc2f7f40c 100644 --- a/src/mesa/swrast/s_pointtemp.h +++ b/src/mesa/swrast/s_pointtemp.h @@ -275,7 +275,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) #if FLAGS & ATTRIBS ATTRIB_LOOP_BEGIN COPY_4V(span->array->attribs[attr][count], attrib[attr]); - if (attr < FRAG_ATTRIB_VAR0) { + if (attr < FRAG_ATTRIB_VAR0 && attr >= FRAG_ATTRIB_TEX0) { const GLuint u = attr - FRAG_ATTRIB_TEX0; span->array->lambda[u][count] = 0.0; } -- cgit v1.2.3 From 4ca7c804db63c9eeaddf1f65dc92006e2cabacec Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 28 Apr 2007 08:01:18 -0600 Subject: fix GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB bug (10787) --- src/mesa/shader/arbprogram.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c index 5583f16ce8d..4b5f63ef920 100644 --- a/src/mesa/shader/arbprogram.c +++ b/src/mesa/shader/arbprogram.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.2 + * 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"), @@ -703,10 +703,18 @@ _mesa_GetProgramivARB(GLenum target, GLenum pname, GLint *params) * The spec says that even if this query returns true, there's * no guarantee that the program will run in hardware. */ - if (ctx->Driver.IsProgramNative) + if (prog->Id == 0) { + /* default/null program */ + *params = GL_FALSE; + } + else if (ctx->Driver.IsProgramNative) { + /* ask the driver */ *params = ctx->Driver.IsProgramNative( ctx, target, prog ); - else + } + else { + /* probably running in software */ *params = GL_TRUE; + } return; default: /* continue with fragment-program only queries below */ -- cgit v1.2.3 From bcc3baadbafc3f3deb79e3a753d9ee3867917073 Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 28 Apr 2007 08:50:07 -0600 Subject: use EMIT_1F or EMIT_4F for fog depending on fragment program (bug 10788) --- src/mesa/swrast_setup/ss_context.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c index 360cc61cb14..ccf0eb3d28c 100644 --- a/src/mesa/swrast_setup/ss_context.c +++ b/src/mesa/swrast_setup/ss_context.c @@ -131,8 +131,10 @@ setup_vertex_format(GLcontext *ctx) 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_FOG )) - EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1F, attrib[FRAG_ATTRIB_FOGC]); + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) { + const GLint emit = ctx->FragmentProgram._Current ? EMIT_4F : EMIT_1F; + EMIT_ATTR( _TNL_ATTRIB_FOG, emit, attrib[FRAG_ATTRIB_FOGC]); + } if (RENDERINPUTS_TEST_RANGE(index_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX)) { -- cgit v1.2.3 From af0ae93863b4c876e70efa4e7406f04a3409f135 Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 28 Apr 2007 08:51:23 -0600 Subject: only load front/back face attrib if using a shader (bug 10788) --- src/mesa/swrast/s_fragprog.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index 882fec29efe..09493873aa2 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -113,8 +113,10 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine, /* Setup pointer to input attributes */ machine->Attribs = span->array->attribs; - /* Store front/back facing value in register FOGC.Y */ - machine->Attribs[FRAG_ATTRIB_FOGC][col][1] = (GLfloat) ctx->_Facing; + if (ctx->Shader.CurrentProgram) { + /* Store front/back facing value in register FOGC.Y */ + machine->Attribs[FRAG_ATTRIB_FOGC][col][1] = (GLfloat) ctx->_Facing; + } machine->CurElement = col; -- cgit v1.2.3 From cbf280dc26efa2ad6a8514cd110dcdfcb7c20bd9 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Sun, 29 Apr 2007 13:52:11 +0200 Subject: r300: radeonMakeCurrent cleanups. r300UpdateWindow is superfluous or even possibly wrong here; _mesa_make_current will set the viewport when necessary. So the conditional _mesa_set_viewport call can go as well. --- src/mesa/drivers/dri/r300/radeon_context.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/mesa/drivers/dri/r300/radeon_context.c b/src/mesa/drivers/dri/r300/radeon_context.c index 22f943ebf38..ef1f25dd413 100644 --- a/src/mesa/drivers/dri/r300/radeon_context.c +++ b/src/mesa/drivers/dri/r300/radeon_context.c @@ -283,7 +283,6 @@ GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv, radeon->dri.drawable = driDrawPriv; radeonSetCliprects(radeon); - r300UpdateWindow(radeon->glCtx); r300UpdateViewportOffset(radeon->glCtx); } @@ -293,11 +292,6 @@ GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv, (GLframebuffer *) driReadPriv-> driverPrivate); - if (!radeon->glCtx->Viewport.Width) { - _mesa_set_viewport(radeon->glCtx, 0, 0, - driDrawPriv->w, driDrawPriv->h); - } - _mesa_update_state(radeon->glCtx); } else { if (RADEON_DEBUG & DEBUG_DRI) -- cgit v1.2.3 From c409dbcae3607e6f83f50a28d9bbb51f5ad51be4 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Thu, 29 Mar 2007 09:42:37 +0200 Subject: r300: Page flipping fixes. Mostly making sure the page flipping state is respected when necessary. --- src/mesa/drivers/dri/r300/r300_ioctl.c | 2 +- src/mesa/drivers/dri/r300/radeon_context.c | 2 ++ src/mesa/drivers/dri/r300/radeon_lock.c | 3 ++- src/mesa/drivers/dri/r300/radeon_lock.h | 1 + src/mesa/drivers/dri/r300/radeon_state.c | 3 ++- 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index 90ac9881e8f..c4dc97b8d49 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -370,7 +370,7 @@ static void r300Clear(GLcontext * ctx, GLbitfield mask) _swrast_Clear(ctx, mask); } - swapped = r300->radeon.doPageFlip && (r300->radeon.sarea->pfCurrentPage == 1); + swapped = r300->radeon.sarea->pfCurrentPage == 1; /* Make sure it fits there. */ r300EnsureCmdBufSpace(r300, 421*3, __FUNCTION__); diff --git a/src/mesa/drivers/dri/r300/radeon_context.c b/src/mesa/drivers/dri/r300/radeon_context.c index ef1f25dd413..9b3f8905076 100644 --- a/src/mesa/drivers/dri/r300/radeon_context.c +++ b/src/mesa/drivers/dri/r300/radeon_context.c @@ -293,6 +293,8 @@ GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv, driverPrivate); _mesa_update_state(radeon->glCtx); + + radeonUpdatePageFlipping(radeon); } else { if (RADEON_DEBUG & DEBUG_DRI) fprintf(stderr, "%s ctx is null\n", __FUNCTION__); diff --git a/src/mesa/drivers/dri/r300/radeon_lock.c b/src/mesa/drivers/dri/r300/radeon_lock.c index ec501c3dc06..84181e2e99e 100644 --- a/src/mesa/drivers/dri/r300/radeon_lock.c +++ b/src/mesa/drivers/dri/r300/radeon_lock.c @@ -50,13 +50,14 @@ int prevLockLine = 0; /* Turn on/off page flipping according to the flags in the sarea: */ -static void radeonUpdatePageFlipping(radeonContextPtr radeon) +void radeonUpdatePageFlipping(radeonContextPtr radeon) { int use_back; radeon->doPageFlip = radeon->sarea->pfState; if (radeon->glCtx->WinSysDrawBuffer) { driFlipRenderbuffers(radeon->glCtx->WinSysDrawBuffer, radeon->sarea->pfCurrentPage); + r300UpdateDrawBuffer(radeon->glCtx); } use_back = (radeon->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT); diff --git a/src/mesa/drivers/dri/r300/radeon_lock.h b/src/mesa/drivers/dri/r300/radeon_lock.h index 632329fde1e..b11ddf0895e 100644 --- a/src/mesa/drivers/dri/r300/radeon_lock.h +++ b/src/mesa/drivers/dri/r300/radeon_lock.h @@ -41,6 +41,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "radeon_context.h" extern void radeonGetLock(radeonContextPtr radeon, GLuint flags); +extern void radeonUpdatePageFlipping(radeonContextPtr radeon); /* Turn DEBUG_LOCKING on to find locking conflicts. */ diff --git a/src/mesa/drivers/dri/r300/radeon_state.c b/src/mesa/drivers/dri/r300/radeon_state.c index 902e9583a63..82bfd951b92 100644 --- a/src/mesa/drivers/dri/r300/radeon_state.c +++ b/src/mesa/drivers/dri/r300/radeon_state.c @@ -154,7 +154,8 @@ void radeonSetCliprects(radeonContextPtr radeon) if (draw_fb->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT) { /* Can't ignore 2d windows if we are page flipping. */ - if (drawable->numBackClipRects == 0 || radeon->doPageFlip) { + if (drawable->numBackClipRects == 0 || radeon->doPageFlip || + radeon->sarea->pfCurrentPage == 1) { radeon->numClipRects = drawable->numClipRects; radeon->pClipRects = drawable->pClipRects; } else { -- cgit v1.2.3 From 65faf023679988f93da82b4c7ebdc689f2094459 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Mon, 30 Apr 2007 18:28:24 +0200 Subject: r300: Don't crash in radeonUpdatePageFlipping when !radeon->glCtx->DrawBuffer. This feels like a kludge, maybe there's a better solution. --- src/mesa/drivers/dri/r300/radeon_lock.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/r300/radeon_lock.c b/src/mesa/drivers/dri/r300/radeon_lock.c index 84181e2e99e..0d0d9ab7f06 100644 --- a/src/mesa/drivers/dri/r300/radeon_lock.c +++ b/src/mesa/drivers/dri/r300/radeon_lock.c @@ -60,7 +60,9 @@ void radeonUpdatePageFlipping(radeonContextPtr radeon) r300UpdateDrawBuffer(radeon->glCtx); } - use_back = (radeon->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT); + use_back = radeon->glCtx->DrawBuffer ? + (radeon->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == + BUFFER_BIT_BACK_LEFT) : 1; use_back ^= (radeon->sarea->pfCurrentPage == 1); if (use_back) { -- cgit v1.2.3 From 7559364027eef3d9943d09a03e094400807ecdad Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 1 May 2007 10:22:08 -0600 Subject: Rewrite of slang_inline_asm_function() to do full parameter/argument substitution. We had been taking a short-cut w/ asm inlines by just using parameters in order rather than doing full formal parameter -> actual argument substitution like ordinary inlined function calls. This worked in all cases but one: mix() in which the parameters were used in a different order. This fixes bug 10821. --- src/mesa/shader/slang/slang_codegen.c | 95 +++++++++++++++++++++++------------ 1 file changed, 64 insertions(+), 31 deletions(-) diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index c6151f8feaa..cf32b501a62 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -700,37 +700,6 @@ _slang_find_node_type(slang_operation *oper, slang_operation_type type) } -/** - * Produce inline code for a call to an assembly instruction. - * XXX Note: children are passed as asm args in-order, not by name! - */ -static slang_operation * -slang_inline_asm_function(slang_assemble_ctx *A, - slang_function *fun, slang_operation *oper) -{ - const GLuint numArgs = oper->num_children; - const slang_operation *args = oper->children; - GLuint i; - slang_operation *inlined = slang_operation_new(1); - - /*assert(oper->type == SLANG_OPER_CALL); or vec4_add, etc */ - /* - printf("Inline asm %s\n", (char*) fun->header.a_name); - */ - inlined->type = fun->body->children[0].type; - inlined->a_id = fun->body->children[0].a_id; - inlined->num_children = numArgs; - inlined->children = slang_operation_new(numArgs); - inlined->locals->outer_scope = oper->locals->outer_scope; - - for (i = 0; i < numArgs; i++) { - slang_operation_copy(inlined->children + i, args + i); - } - - return inlined; -} - - static void slang_resolve_variable(slang_operation *oper) { @@ -891,6 +860,70 @@ slang_substitute(slang_assemble_ctx *A, slang_operation *oper, +/** + * Produce inline code for a call to an assembly instruction. + * This is typically used to compile a call to a built-in function like this: + * + * vec4 mix(const vec4 x, const vec4 y, const vec4 a) + * { + * __asm vec4_lrp __retVal, a, y, x; + * } + * + * We basically translate a SLANG_OPER_CALL into a SLANG_OPER_ASM. + */ +static slang_operation * +slang_inline_asm_function(slang_assemble_ctx *A, + slang_function *fun, slang_operation *oper) +{ + const GLuint numArgs = oper->num_children; + GLuint i; + slang_operation *inlined; + const GLboolean haveRetValue = _slang_function_has_return_value(fun); + slang_variable **substOld; + slang_operation **substNew; + + ASSERT(slang_is_asm_function(fun)); + ASSERT(fun->param_count == numArgs + haveRetValue); + + /* + printf("Inline %s as %s\n", + (char*) fun->header.a_name, + (char*) fun->body->children[0].a_id); + */ + + /* + * We'll substitute formal params with actual args in the asm call. + */ + substOld = (slang_variable **) + _slang_alloc(numArgs * sizeof(slang_variable *)); + substNew = (slang_operation **) + _slang_alloc(numArgs * sizeof(slang_operation *)); + for (i = 0; i < numArgs; i++) { + substOld[i] = fun->parameters->variables[i]; + substNew[i] = oper->children + i; + } + + /* make a copy of the code to inline */ + inlined = slang_operation_new(1); + slang_operation_copy(inlined, &fun->body->children[0]); + if (haveRetValue) { + /* get rid of the __retVal child */ + for (i = 0; i < numArgs; i++) { + inlined->children[i] = inlined->children[i + 1]; + } + inlined->num_children--; + } + + /* now do formal->actual substitutions */ + slang_substitute(A, inlined, numArgs, substOld, substNew, GL_FALSE); + + _slang_free(substOld); + _slang_free(substNew); + + return inlined; +} + + /** * Inline the given function call operation. * Return a new slang_operation that corresponds to the inlined code. -- cgit v1.2.3 From bfd5cf72c47646c0ae7e518d0a6adcbb81bd5e69 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 1 May 2007 10:23:15 -0600 Subject: fog, mix() bug fixes --- docs/relnotes-7.0.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/relnotes-7.0.html b/docs/relnotes-7.0.html index 534cc59436a..0cd7db8e2e6 100644 --- a/docs/relnotes-7.0.html +++ b/docs/relnotes-7.0.html @@ -28,6 +28,8 @@ TBD

      Bug fixes

        +
      • Fixed a few fog-related bugs. +
      • Fixed broken GLSL mix() function.
      -- cgit v1.2.3 From 594b5ad87db09aef7fa2dc9f2d52e567ab92ff70 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 1 May 2007 14:02:49 -0600 Subject: implement acos(), asin(), atan() --- .../shader/slang/library/slang_common_builtin.gc | 23 +++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/mesa/shader/slang/library/slang_common_builtin.gc b/src/mesa/shader/slang/library/slang_common_builtin.gc index a3d037cd572..04876ad1554 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin.gc +++ b/src/mesa/shader/slang/library/slang_common_builtin.gc @@ -313,9 +313,16 @@ vec4 tan(const vec4 angle) float asin(const float x) { - // XXX FIX ME! - // __asm float_arcsine y, x; - __retVal = 0.5; + const float a0 = 1.5707288; // PI/2? + const float a1 = -0.2121144; + const float a2 = 0.0742610; + //const float a3 = -0.0187293; + const float halfPi = 3.1415926 * 0.5; + const float y = abs(x); + // three terms seem to be enough: + __retVal = (halfPi - sqrt(1.0 - y) * (a0 + y * (a1 + a2 * y))) * sign(x); + // otherwise, try four: + //__retVal = (halfPi - sqrt(1.0 - y) * (a0 + y * (a1 + y * (a2 + y * a3)))) * sign(x); } vec2 asin(const vec2 v) @@ -340,8 +347,8 @@ vec4 asin(const vec4 v) float acos(const float x) { - // XXX FIX ME! - __retVal = 0.5; + const float halfPi = 3.1415926 * 0.5; + __retVal = halfPi - asin(x); } vec2 acos(const vec2 v) @@ -365,11 +372,9 @@ vec4 acos(const vec4 v) __retVal.w = acos(v.w); } -float atan(const float y_over_x) +float atan(const float x) { - // XXX FIX ME - //__asm float_arctan z, y_over_x; - __retVal = 0.5; + __retVal = asin(x * inversesqrt(x * x + 1.0)); } vec2 atan(const vec2 y_over_x) -- cgit v1.2.3 From 03f201d9353315fc53ac2d7515e77827c8feafa1 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 1 May 2007 14:03:16 -0600 Subject: regenerated --- .../shader/slang/library/slang_common_builtin_gc.h | 163 +++++++++++---------- 1 file changed, 85 insertions(+), 78 deletions(-) diff --git a/src/mesa/shader/slang/library/slang_common_builtin_gc.h b/src/mesa/shader/slang/library/slang_common_builtin_gc.h index 8db5f1be937..10b64ed89dd 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin_gc.h +++ b/src/mesa/shader/slang/library/slang_common_builtin_gc.h @@ -166,89 +166,96 @@ 97,110,103,108,101,0,0,0,0,0,3,2,1,11,1,99,0,2,58,99,111,115,0,18,97,110,103,108,101,0,0,0,0,0,8, 18,115,0,18,99,0,49,0,0,1,0,12,0,116,97,110,0,1,1,0,12,97,110,103,108,101,0,0,0,1,3,2,1,12,1,115,0, 2,58,115,105,110,0,18,97,110,103,108,101,0,0,0,0,0,3,2,1,12,1,99,0,2,58,99,111,115,0,18,97,110,103, -108,101,0,0,0,0,0,8,18,115,0,18,99,0,49,0,0,1,0,9,0,97,115,105,110,0,1,1,0,9,120,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,17,48,0,53,0,0,20,0,0,1,0,10,0,97,115,105,110,0,1,1,0,10,118,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,115,105,110,0,18,118,0,59,120,0,0,0,20,0,9,18,95, -95,114,101,116,86,97,108,0,59,121,0,58,97,115,105,110,0,18,118,0,59,121,0,0,0,20,0,0,1,0,11,0,97, -115,105,110,0,1,1,0,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,115,105,110,0, -18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,115,105,110,0,18,118, -0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,115,105,110,0,18,118,0,59, -122,0,0,0,20,0,0,1,0,12,0,97,115,105,110,0,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -59,120,0,58,97,115,105,110,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121, -0,58,97,115,105,110,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97, -115,105,110,0,18,118,0,59,122,0,0,0,20,0,0,1,0,9,0,97,99,111,115,0,1,1,0,9,120,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,17,48,0,53,0,0,20,0,0,1,0,10,0,97,99,111,115,0,1,1,0,10,118,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,59,120,0,58,97,99,111,115,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,59,121,0,58,97,99,111,115,0,18,118,0,59,121,0,0,0,20,0,0,1,0,11,0,97,99, -111,115,0,1,1,0,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,99,111,115,0,18, -118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,99,111,115,0,18,118,0,59, -121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,99,111,115,0,18,118,0,59,122,0,0, -0,20,0,0,1,0,12,0,97,99,111,115,0,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0, -58,97,99,111,115,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,99, +108,101,0,0,0,0,0,8,18,115,0,18,99,0,49,0,0,1,0,9,0,97,115,105,110,0,1,1,0,9,120,0,0,0,1,3,2,1,9,1, +97,48,0,2,17,49,0,53,55,48,55,50,56,56,0,0,0,0,3,2,1,9,1,97,49,0,2,17,48,0,50,49,50,49,49,52,52,0, +0,54,0,0,3,2,1,9,1,97,50,0,2,17,48,0,48,55,52,50,54,49,48,0,0,0,0,3,2,1,9,1,104,97,108,102,80,105, +0,2,17,51,0,49,52,49,53,57,50,54,0,0,17,48,0,53,0,0,48,0,0,3,2,1,9,1,121,0,2,58,97,98,115,0,18,120, +0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,104,97,108,102,80,105,0,58,115,113,114,116,0,17,49, +0,48,0,0,18,121,0,47,0,0,18,97,48,0,18,121,0,18,97,49,0,18,97,50,0,18,121,0,48,46,48,46,48,47,58, +115,105,103,110,0,18,120,0,0,0,48,20,0,0,1,0,10,0,97,115,105,110,0,1,1,0,10,118,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,59,120,0,58,97,115,105,110,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101, +116,86,97,108,0,59,121,0,58,97,115,105,110,0,18,118,0,59,121,0,0,0,20,0,0,1,0,11,0,97,115,105,110, +0,1,1,0,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,115,105,110,0,18,118,0,59, +120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,115,105,110,0,18,118,0,59,121,0,0, +0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,115,105,110,0,18,118,0,59,122,0,0,0,20,0, +0,1,0,12,0,97,115,105,110,0,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97, +115,105,110,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,115,105, +110,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,115,105,110,0, +18,118,0,59,122,0,0,0,20,0,0,1,0,9,0,97,99,111,115,0,1,1,0,9,120,0,0,0,1,3,2,1,9,1,104,97,108,102, +80,105,0,2,17,51,0,49,52,49,53,57,50,54,0,0,17,48,0,53,0,0,48,0,0,9,18,95,95,114,101,116,86,97,108, +0,18,104,97,108,102,80,105,0,58,97,115,105,110,0,18,120,0,0,0,47,20,0,0,1,0,10,0,97,99,111,115,0,1, +1,0,10,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,99,111,115,0,18,118,0,59,120, +0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,99,111,115,0,18,118,0,59,121,0,0,0,20, +0,0,1,0,11,0,97,99,111,115,0,1,1,0,11,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58, +97,99,111,115,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,99, 111,115,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,99,111,115, -0,18,118,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,99,111,115,0,18,118, -0,59,119,0,0,0,20,0,0,1,0,9,0,97,116,97,110,0,1,1,0,9,121,95,111,118,101,114,95,120,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,17,48,0,53,0,0,20,0,0,1,0,10,0,97,116,97,110,0,1,1,0,10,121,95,111, -118,101,114,95,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,18,121, -95,111,118,101,114,95,120,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97, -116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0,20,0,0,1,0,11,0,97,116,97,110,0,1,1,0, -11,121,95,111,118,101,114,95,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97, +0,18,118,0,59,122,0,0,0,20,0,0,1,0,12,0,97,99,111,115,0,1,1,0,12,118,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,59,120,0,58,97,99,111,115,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86, +97,108,0,59,121,0,58,97,99,111,115,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0, +59,122,0,58,97,99,111,115,0,18,118,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0, +58,97,99,111,115,0,18,118,0,59,119,0,0,0,20,0,0,1,0,9,0,97,116,97,110,0,1,1,0,9,120,0,0,0,1,9,18, +95,95,114,101,116,86,97,108,0,58,97,115,105,110,0,18,120,0,58,105,110,118,101,114,115,101,115,113, +114,116,0,18,120,0,18,120,0,48,17,49,0,48,0,0,46,0,0,48,0,0,20,0,0,1,0,10,0,97,116,97,110,0,1,1,0, +10,121,95,111,118,101,114,95,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97, 110,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -121,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,122,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,122,0,0,0,20,0,0, -1,0,12,0,97,116,97,110,0,1,1,0,12,121,95,111,118,101,114,95,120,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,59,120,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,20,0,9,18,95, -95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,121,0, -0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,18,121,95,111,118,101,114, -95,120,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,116,97,110,0,18,121, -95,111,118,101,114,95,120,0,59,119,0,0,0,20,0,0,1,0,9,0,97,116,97,110,0,1,1,0,9,121,0,0,1,1,0,9, -120,0,0,0,1,10,18,120,0,17,48,0,48,0,0,38,0,8,17,48,0,48,0,0,0,9,14,0,3,2,0,9,1,122,0,2,58,97,116, -97,110,0,18,121,0,18,120,0,49,0,0,0,0,10,18,120,0,17,48,0,48,0,0,40,0,2,10,18,121,0,17,48,0,48,0,0, -40,0,8,18,122,0,17,51,0,49,52,49,53,57,51,0,0,47,0,9,14,0,8,18,122,0,17,51,0,49,52,49,53,57,51,0,0, -46,0,0,9,14,0,8,18,122,0,0,0,1,0,10,0,97,116,97,110,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,9,18, +121,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0,20,0,0,1,0,11,0,97,116,97, +110,0,1,1,0,11,121,95,111,118,101,114,95,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0, +58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86, +97,108,0,59,121,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0,20,0,9,18,95, +95,114,101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,122,0, +0,0,20,0,0,1,0,12,0,97,116,97,110,0,1,1,0,12,121,95,111,118,101,114,95,120,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,20, +0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,18,121,95,111,118,101,114,95,120, +0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,18,121,95,111, +118,101,114,95,120,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,116,97, +110,0,18,121,95,111,118,101,114,95,120,0,59,119,0,0,0,20,0,0,1,0,9,0,97,116,97,110,0,1,1,0,9,121,0, +0,1,1,0,9,120,0,0,0,1,10,18,120,0,17,48,0,48,0,0,38,0,8,17,48,0,48,0,0,0,9,14,0,3,2,0,9,1,122,0,2, +58,97,116,97,110,0,18,121,0,18,120,0,49,0,0,0,0,10,18,120,0,17,48,0,48,0,0,40,0,2,10,18,121,0,17, +48,0,48,0,0,40,0,8,18,122,0,17,51,0,49,52,49,53,57,51,0,0,47,0,9,14,0,8,18,122,0,17,51,0,49,52,49, +53,57,51,0,0,46,0,0,9,14,0,8,18,122,0,0,0,1,0,10,0,97,116,97,110,0,1,1,0,10,117,0,0,1,1,0,10,118,0, +0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0, +59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,18,117,0,59,121,0, +0,18,118,0,59,121,0,0,0,20,0,0,1,0,11,0,97,116,97,110,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,9,18, 95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0, 0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,18,117,0,59,121,0,0,18,118,0, -59,121,0,0,0,20,0,0,1,0,11,0,97,116,97,110,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,20,0,9, -18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,18,117,0,59,121,0,0,18,118,0,59,121,0, -0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,18,117,0,59,122,0,0,18,118, -0,59,122,0,0,0,20,0,0,1,0,12,0,97,116,97,110,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,20,0, -9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,18,117,0,59,121,0,0,18,118,0,59,121, -0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,18,117,0,59,122,0,0,18, -118,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,116,97,110,0,18,117,0,59, -119,0,0,18,118,0,59,119,0,0,0,20,0,0,1,0,9,0,112,111,119,0,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,4,102, -108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,0,18, -98,0,0,0,0,1,0,10,0,112,111,119,0,1,1,0,10,97,0,0,1,1,0,10,98,0,0,0,1,4,102,108,111,97,116,95,112, -111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0, -0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18, -97,0,59,121,0,0,18,98,0,59,121,0,0,0,0,1,0,11,0,112,111,119,0,1,1,0,11,97,0,0,1,1,0,11,98,0,0,0,1, +59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,18,117,0,59,122,0, +0,18,118,0,59,122,0,0,0,20,0,0,1,0,12,0,97,116,97,110,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,9,18, +95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0, +0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,18,117,0,59,121,0,0,18,118,0, +59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,18,117,0,59,122,0, +0,18,118,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,116,97,110,0,18,117, +0,59,119,0,0,18,118,0,59,119,0,0,0,20,0,0,1,0,9,0,112,111,119,0,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1, 4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0, -59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116, -86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,112,111,119, -101,114,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,18,98,0,59,122,0,0,0,0,1, -0,12,0,112,111,119,0,1,1,0,12,97,0,0,1,1,0,12,98,0,0,0,1,4,102,108,111,97,116,95,112,111,119,101, -114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102, -108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121, -0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97, -108,0,59,122,0,0,18,97,0,59,122,0,0,18,98,0,59,122,0,0,0,4,102,108,111,97,116,95,112,111,119,101, -114,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,97,0,59,119,0,0,18,98,0,59,119,0,0,0,0,1,0,9, -0,101,120,112,0,1,1,0,9,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116,86, -97,108,0,59,120,0,0,18,97,0,0,0,0,1,0,10,0,101,120,112,0,1,1,0,10,97,0,0,0,1,4,102,108,111,97,116, -95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97, -116,95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,0,1,0,11,0, -101,120,112,0,1,1,0,11,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116,86,97, -108,0,59,120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116, -86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101, -116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,0,0,1,0,12,0,101,120,112,0,1,1,0,12,97,0,0,0,1,4,102, -108,111,97,116,95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4, -102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0, -0,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0,59,122, -0,0,0,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,97,0,59, -119,0,0,0,0,1,0,9,0,108,111,103,50,0,1,1,0,9,120,0,0,0,1,4,102,108,111,97,116,95,108,111,103,50,0, -18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,120,0,0,0,0,1,0,10,0,108,111,103,50,0,1,1,0,10,118, -0,0,0,1,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18, -118,0,59,120,0,0,0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59, +0,18,98,0,0,0,0,1,0,10,0,112,111,119,0,1,1,0,10,97,0,0,1,1,0,10,98,0,0,0,1,4,102,108,111,97,116,95, +112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,18,98,0,59, +120,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,121,0, +0,18,97,0,59,121,0,0,18,98,0,59,121,0,0,0,0,1,0,11,0,112,111,119,0,1,1,0,11,97,0,0,1,1,0,11,98,0,0, +0,1,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18, +97,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114, +101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,112, +111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,18,98,0,59,122,0, +0,0,0,1,0,12,0,112,111,119,0,1,1,0,12,97,0,0,1,1,0,12,98,0,0,0,1,4,102,108,111,97,116,95,112,111, +119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0,0,0, +4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0, +59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116, +86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,18,98,0,59,122,0,0,0,4,102,108,111,97,116,95,112,111,119, +101,114,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,97,0,59,119,0,0,18,98,0,59,119,0,0,0,0,1, +0,9,0,101,120,112,0,1,1,0,9,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116, +86,97,108,0,59,120,0,0,18,97,0,0,0,0,1,0,10,0,101,120,112,0,1,1,0,10,97,0,0,0,1,4,102,108,111,97, +116,95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4,102,108, +111,97,116,95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,0,1,0, +11,0,101,120,112,0,1,1,0,11,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116, +86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101, +116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114, +101,116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,0,0,1,0,12,0,101,120,112,0,1,1,0,12,97,0,0,0,1,4, +102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0, +0,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121, +0,0,0,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0,59, +122,0,0,0,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,97, +0,59,119,0,0,0,0,1,0,9,0,108,111,103,50,0,1,1,0,9,120,0,0,0,1,4,102,108,111,97,116,95,108,111,103, +50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,120,0,0,0,0,1,0,10,0,108,111,103,50,0,1,1,0,10, +118,0,0,0,1,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0, +18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59, 121,0,0,18,118,0,59,121,0,0,0,0,1,0,11,0,108,111,103,50,0,1,1,0,11,118,0,0,0,1,4,102,108,111,97, 116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102, 108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0, -- cgit v1.2.3 From 04c401c91ea288e8a4d2c501b6e24c3ecbc83664 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 2 May 2007 08:29:14 -0600 Subject: add *gc, *syn files to tarballs --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index e039b5e280f..88b6b79979d 100644 --- a/Makefile +++ b/Makefile @@ -222,6 +222,9 @@ MAIN_FILES = \ $(DIRECTORY)/src/mesa/shader/slang/descrip.mms \ $(DIRECTORY)/src/mesa/shader/slang/sources \ $(DIRECTORY)/src/mesa/shader/slang/library/*.[ch] \ + $(DIRECTORY)/src/mesa/shader/slang/library/*.gc \ + $(DIRECTORY)/src/mesa/shader/slang/library/*.syn \ + $(DIRECTORY)/src/mesa/shader/slang/library/Makefile \ $(DIRECTORY)/src/mesa/swrast/*.[ch] \ $(DIRECTORY)/src/mesa/swrast/descrip.mms \ $(DIRECTORY)/src/mesa/swrast/sources \ -- cgit v1.2.3 From 99f24c8d17f3a39ff0ebbeb1f7fa80142d8be648 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 2 May 2007 08:48:20 -0600 Subject: fix some StepX/StepY mix-ups in alpha interpolation --- src/mesa/swrast/s_tritemp.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h index b8601bd5b4b..dcc3e958cb1 100644 --- a/src/mesa/swrast/s_tritemp.h +++ b/src/mesa/swrast/s_tritemp.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. * @@ -499,7 +499,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, # endif /* GL_FLOAT */ # ifdef INTERP_ALPHA span.attrStepX[FRAG_ATTRIB_COL0][3] = oneOverArea * (eMaj_da * eBot.dy - eMaj.dy * eBot_da); - span.attrStepX[FRAG_ATTRIB_COL0][3] = oneOverArea * (eMaj.dx * eBot_da - eMaj_da * eBot.dx); + 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 @@ -523,7 +523,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, span.blueStep = 0; # endif /* GL_FLOAT */ # 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; # if CHAN_TYPE == GL_FLOAT span.alphaStep = 0.0F; # else @@ -893,11 +893,11 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, # endif # ifdef INTERP_ALPHA # if CHAN_TYPE == GL_FLOAT - aLeft = vLower->color[ACOMP] + (span.attrStepX[FRAG_ATTRIB_COL0][3] * adjx + span.attrStepX[FRAG_ATTRIB_COL0][3] * adjy) * (1.0F / FIXED_SCALE); - fdaOuter = span.attrStepX[FRAG_ATTRIB_COL0][3] + dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][3]; + 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.attrStepX[FRAG_ATTRIB_COL0][3] + dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][3]); + fdaOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL0][3] + dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][3]); # endif # endif } -- cgit v1.2.3 From b2f1d6422bee5b08513ae83eb4903c0e20593266 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 2 May 2007 08:48:43 -0600 Subject: fix some renderbuffer/wrapper bugs --- src/mesa/drivers/x11/xm_dd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c index 543ff69c411..c8546236fbf 100644 --- a/src/mesa/drivers/x11/xm_dd.c +++ b/src/mesa/drivers/x11/xm_dd.c @@ -438,7 +438,7 @@ xmesa_DrawPixels_8R8G8B( GLcontext *ctx, { const SWcontext *swrast = SWRAST_CONTEXT( ctx ); struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0][0]; - struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb->Wrapped; + struct xmesa_renderbuffer *xrb = xmesa_renderbuffer(rb->Wrapped); if (swrast->NewState) _swrast_validate_derived( ctx ); @@ -546,7 +546,7 @@ xmesa_DrawPixels_5R6G5B( GLcontext *ctx, const GLvoid *pixels ) { struct xmesa_renderbuffer *xrb - = (struct xmesa_renderbuffer *) ctx->DrawBuffer->_ColorDrawBuffers[0][0]; + = xmesa_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0][0]->Wrapped); const XMesaContext xmesa = XMESA_CONTEXT(ctx); const SWcontext *swrast = SWRAST_CONTEXT( ctx ); XMesaDisplay *dpy = xmesa->xm_visual->display; @@ -652,10 +652,10 @@ xmesa_CopyPixels( GLcontext *ctx, const SWcontext *swrast = SWRAST_CONTEXT( ctx ); XMesaDisplay *dpy = xmesa->xm_visual->display; const XMesaGC gc = ((XMesaBuffer) ctx->DrawBuffer)->gc; - struct xmesa_renderbuffer *srcXrb = (struct xmesa_renderbuffer *) - ctx->ReadBuffer->_ColorReadBuffer; - struct xmesa_renderbuffer *dstXrb = (struct xmesa_renderbuffer *) - ctx->DrawBuffer->_ColorDrawBuffers[0][0]; + struct xmesa_renderbuffer *srcXrb + = xmesa_renderbuffer(ctx->ReadBuffer->_ColorReadBuffer->Wrapped); + struct xmesa_renderbuffer *dstXrb + = xmesa_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0][0]->Wrapped); ASSERT(dpy); ASSERT(gc); -- cgit v1.2.3 From 5c1b53d58de68582c378e28fbb2fe4c0277139a9 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 2 May 2007 12:06:43 -0600 Subject: Document a deficiency in the _swrast_Translate() function with regard to point size. --- src/mesa/swrast_setup/ss_context.c | 3 ++- src/mesa/tnl/t_vertex.c | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c index ccf0eb3d28c..3f6d29403cc 100644 --- a/src/mesa/swrast_setup/ss_context.c +++ b/src/mesa/swrast_setup/ss_context.c @@ -263,7 +263,7 @@ _swsetup_Translate( GLcontext *ctx, const void *vertex, SWvertex *dest ) dest->win[2] = m[10] * tmp[2] + m[14]; dest->win[3] = tmp[3]; - + /** XXX try to limit these loops someday */ for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++) _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_TEX0+i, dest->attrib[FRAG_ATTRIB_TEX0 + i] ); @@ -284,6 +284,7 @@ _swsetup_Translate( GLcontext *ctx, const void *vertex, SWvertex *dest ) _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR_INDEX, tmp ); dest->index = tmp[0]; + /* XXX See _tnl_get_attr about pointsize ... */ _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_POINTSIZE, tmp ); dest->pointSize = tmp[0]; } diff --git a/src/mesa/tnl/t_vertex.c b/src/mesa/tnl/t_vertex.c index c666b387422..6aae6020375 100644 --- a/src/mesa/tnl/t_vertex.c +++ b/src/mesa/tnl/t_vertex.c @@ -229,7 +229,15 @@ void _tnl_get_attr( GLcontext *ctx, const void *vin, /* Else return the value from ctx->Current. */ - _mesa_memcpy( dest, ctx->Current.Attrib[attr], 4*sizeof(GLfloat)); + if (attr == _TNL_ATTRIB_POINTSIZE) { + /* If the hardware vertex doesn't have point size then use size from + * GLcontext. XXX this will be wrong if drawing attenuated points! + */ + dest[0] = ctx->Point._Size; + } + else { + _mesa_memcpy( dest, ctx->Current.Attrib[attr], 4*sizeof(GLfloat)); + } } -- cgit v1.2.3 From 77e7535c0f94b94d26aa2e3d7b19c812beaba2ae Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 2 May 2007 18:42:57 -0600 Subject: fix some DDX,DDY mix-ups --- src/mesa/shader/slang/slang_ir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/shader/slang/slang_ir.c b/src/mesa/shader/slang/slang_ir.c index 9517bdf29da..a6903cc8b62 100644 --- a/src/mesa/shader/slang/slang_ir.c +++ b/src/mesa/shader/slang/slang_ir.c @@ -63,7 +63,7 @@ static const slang_ir_info IrInfo[] = { { IR_ABS, "IR_ABS", OPCODE_ABS, 4, 1 }, { IR_NEG, "IR_NEG", OPCODE_NOP, 4, 1 }, /* special case: emit_negation() */ { IR_DDX, "IR_DDX", OPCODE_DDX, 4, 1 }, - { IR_DDX, "IR_DDY", OPCODE_DDX, 4, 1 }, + { IR_DDY, "IR_DDY", OPCODE_DDY, 4, 1 }, { IR_SIN, "IR_SIN", OPCODE_SIN, 1, 1 }, { IR_COS, "IR_COS", OPCODE_COS, 1, 1 }, { IR_NOISE1, "IR_NOISE1", OPCODE_NOISE1, 1, 1 }, -- cgit v1.2.3 From 62da6a1b3e341e53981e2817595e0eea107fe6cb Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 2 May 2007 18:44:34 -0600 Subject: Resuscitate some of the DDX,DDY code. Only works for program input registers at this time. Good enough for the common case of texcoords, though. --- src/mesa/shader/prog_execute.c | 291 +++++++---------------------------------- src/mesa/shader/prog_execute.h | 3 + 2 files changed, 51 insertions(+), 243 deletions(-) diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c index 356d4ce2490..9faf9d86134 100644 --- a/src/mesa/shader/prog_execute.c +++ b/src/mesa/shader/prog_execute.c @@ -218,120 +218,64 @@ fetch_vector4(const struct prog_src_register *source, } } -#if 0 + /** - * Fetch the derivative with respect to X for the given register. - * \return GL_TRUE if it was easily computed or GL_FALSE if we - * need to execute another instance of the program (ugh)! + * Fetch the derivative with respect to X or Y for the given register. + * XXX this currently only works for fragment program input attribs. */ -static GLboolean +static void fetch_vector4_deriv(GLcontext * ctx, const struct prog_src_register *source, - const SWspan * span, - char xOrY, GLint column, GLfloat result[4]) + const struct gl_program_machine *machine, + char xOrY, GLfloat result[4]) { - GLfloat src[4]; + if (source->File == PROGRAM_INPUT && source->Index < machine->NumDeriv) { + const GLint col = machine->CurElement; + const GLfloat w = machine->Attribs[FRAG_ATTRIB_WPOS][col][3]; + const GLfloat invQ = 1.0f / w; + GLfloat deriv[4]; - ASSERT(xOrY == 'X' || xOrY == 'Y'); - - switch (source->Index) { - case FRAG_ATTRIB_WPOS: if (xOrY == 'X') { - src[0] = 1.0; - src[1] = 0.0; - src[2] = span->attrStepX[FRAG_ATTRIB_WPOS][2] - / ctx->DrawBuffer->_DepthMaxF; - src[3] = span->attrStepX[FRAG_ATTRIB_WPOS][3]; + deriv[0] = machine->DerivX[source->Index][0] * invQ; + deriv[1] = machine->DerivX[source->Index][1] * invQ; + deriv[2] = machine->DerivX[source->Index][2] * invQ; + deriv[3] = machine->DerivX[source->Index][3] * invQ; } else { - src[0] = 0.0; - src[1] = 1.0; - src[2] = span->attrStepY[FRAG_ATTRIB_WPOS][2] - / ctx->DrawBuffer->_DepthMaxF; - src[3] = span->attrStepY[FRAG_ATTRIB_WPOS][3]; - } - break; - case FRAG_ATTRIB_COL0: - case FRAG_ATTRIB_COL1: - if (xOrY == 'X') { - src[0] = span->attrStepX[source->Index][0] * (1.0F / CHAN_MAXF); - src[1] = span->attrStepX[source->Index][1] * (1.0F / CHAN_MAXF); - src[2] = span->attrStepX[source->Index][2] * (1.0F / CHAN_MAXF); - src[3] = span->attrStepX[source->Index][3] * (1.0F / CHAN_MAXF); - } - else { - src[0] = span->attrStepY[source->Index][0] * (1.0F / CHAN_MAXF); - src[1] = span->attrStepY[source->Index][1] * (1.0F / CHAN_MAXF); - src[2] = span->attrStepY[source->Index][2] * (1.0F / CHAN_MAXF); - src[3] = span->attrStepY[source->Index][3] * (1.0F / CHAN_MAXF); - } - break; - case FRAG_ATTRIB_FOGC: - if (xOrY == 'X') { - src[0] = span->attrStepX[FRAG_ATTRIB_FOGC][0] * (1.0F / CHAN_MAXF); - src[1] = 0.0; - src[2] = 0.0; - src[3] = 0.0; + deriv[0] = machine->DerivY[source->Index][0] * invQ; + deriv[1] = machine->DerivY[source->Index][1] * invQ; + deriv[2] = machine->DerivY[source->Index][2] * invQ; + deriv[3] = machine->DerivY[source->Index][3] * invQ; } - else { - src[0] = span->attrStepY[FRAG_ATTRIB_FOGC][0] * (1.0F / CHAN_MAXF); - src[1] = 0.0; - src[2] = 0.0; - src[3] = 0.0; + + result[0] = deriv[GET_SWZ(source->Swizzle, 0)]; + result[1] = deriv[GET_SWZ(source->Swizzle, 1)]; + result[2] = deriv[GET_SWZ(source->Swizzle, 2)]; + result[3] = deriv[GET_SWZ(source->Swizzle, 3)]; + + if (source->NegateBase) { + result[0] = -result[0]; + result[1] = -result[1]; + result[2] = -result[2]; + result[3] = -result[3]; } - break; - default: - assert(source->Index < FRAG_ATTRIB_MAX); - /* texcoord or varying */ - if (xOrY == 'X') { - /* this is a little tricky - I think I've got it right */ - const GLfloat invQ = 1.0f / (span->attrStart[source->Index][3] - + - span->attrStepX[source->Index][3] * - column); - src[0] = span->attrStepX[source->Index][0] * invQ; - src[1] = span->attrStepX[source->Index][1] * invQ; - src[2] = span->attrStepX[source->Index][2] * invQ; - src[3] = span->attrStepX[source->Index][3] * invQ; + if (source->Abs) { + result[0] = FABSF(result[0]); + result[1] = FABSF(result[1]); + result[2] = FABSF(result[2]); + result[3] = FABSF(result[3]); } - else { - /* Tricky, as above, but in Y direction */ - const GLfloat invQ = 1.0f / (span->attrStart[source->Index][3] - + span->attrStepY[source->Index][3]); - src[0] = span->attrStepY[source->Index][0] * invQ; - src[1] = span->attrStepY[source->Index][1] * invQ; - src[2] = span->attrStepY[source->Index][2] * invQ; - src[3] = span->attrStepY[source->Index][3] * invQ; + if (source->NegateAbs) { + result[0] = -result[0]; + result[1] = -result[1]; + result[2] = -result[2]; + result[3] = -result[3]; } - break; } - - result[0] = src[GET_SWZ(source->Swizzle, 0)]; - result[1] = src[GET_SWZ(source->Swizzle, 1)]; - result[2] = src[GET_SWZ(source->Swizzle, 2)]; - result[3] = src[GET_SWZ(source->Swizzle, 3)]; - - if (source->NegateBase) { - result[0] = -result[0]; - result[1] = -result[1]; - result[2] = -result[2]; - result[3] = -result[3]; - } - if (source->Abs) { - result[0] = FABSF(result[0]); - result[1] = FABSF(result[1]); - result[2] = FABSF(result[2]); - result[3] = FABSF(result[3]); - } - if (source->NegateAbs) { - result[0] = -result[0]; - result[1] = -result[1]; - result[2] = -result[2]; - result[3] = -result[3]; + else { + ASSIGN_4V(result, 0.0, 0.0, 0.0, 0.0); } - return GL_TRUE; } -#endif /** @@ -519,106 +463,6 @@ store_vector4(const struct prog_instruction *inst, } -#if 0 -/** - * Initialize a new machine state instance from an existing one, adding - * the partial derivatives onto the input registers. - * Used to implement DDX and DDY instructions in non-trivial cases. - */ -static void -init_machine_deriv(GLcontext * ctx, - const struct gl_program_machine *machine, - const struct gl_fragment_program *program, - const SWspan * span, char xOrY, - struct gl_program_machine *dMachine) -{ - GLuint attr; - - ASSERT(xOrY == 'X' || xOrY == 'Y'); - - /* copy existing machine */ - _mesa_memcpy(dMachine, machine, sizeof(struct gl_program_machine)); - - if (program->Base.Target == GL_FRAGMENT_PROGRAM_NV) { - /* XXX also need to do this when using valgrind */ - /* Clear temporary registers (undefined for ARB_f_p) */ - _mesa_bzero((void *) machine->Temporaries, - MAX_PROGRAM_TEMPS * 4 * sizeof(GLfloat)); - } - - /* Add derivatives */ - if (program->Base.InputsRead & FRAG_BIT_WPOS) { - GLfloat *wpos = machine->Attribs[FRAG_ATTRIB_WPOS][machine->CurElement]; - if (xOrY == 'X') { - wpos[0] += 1.0F; - wpos[1] += 0.0F; - wpos[2] += span->attrStepX[FRAG_ATTRIB_WPOS][2]; - wpos[3] += span->attrStepX[FRAG_ATTRIB_WPOS][3]; - } - else { - wpos[0] += 0.0F; - wpos[1] += 1.0F; - wpos[2] += span->attrStepY[FRAG_ATTRIB_WPOS][2]; - wpos[3] += span->attrStepY[FRAG_ATTRIB_WPOS][3]; - } - } - - /* primary, secondary colors */ - for (attr = FRAG_ATTRIB_COL0; attr <= FRAG_ATTRIB_COL1; attr++) { - if (program->Base.InputsRead & (1 << attr)) { - GLfloat *col = machine->Attribs[attr][machine->CurElement]; - if (xOrY == 'X') { - col[0] += span->attrStepX[attr][0] * (1.0F / CHAN_MAXF); - col[1] += span->attrStepX[attr][1] * (1.0F / CHAN_MAXF); - col[2] += span->attrStepX[attr][2] * (1.0F / CHAN_MAXF); - col[3] += span->attrStepX[attr][3] * (1.0F / CHAN_MAXF); - } - else { - col[0] += span->attrStepY[attr][0] * (1.0F / CHAN_MAXF); - col[1] += span->attrStepY[attr][1] * (1.0F / CHAN_MAXF); - col[2] += span->attrStepY[attr][2] * (1.0F / CHAN_MAXF); - col[3] += span->attrStepY[attr][3] * (1.0F / CHAN_MAXF); - } - } - } - if (program->Base.InputsRead & FRAG_BIT_FOGC) { - GLfloat *fogc = machine->Attribs[FRAG_ATTRIB_FOGC][machine->CurElement]; - if (xOrY == 'X') { - fogc[0] += span->attrStepX[FRAG_ATTRIB_FOGC][0]; - } - else { - fogc[0] += span->attrStepY[FRAG_ATTRIB_FOGC][0]; - } - } - /* texcoord and varying vars */ - for (attr = FRAG_ATTRIB_TEX0; attr < FRAG_ATTRIB_MAX; attr++) { - if (program->Base.InputsRead & (1 << attr)) { - GLfloat *val = machine->Attribs[attr][machine->CurElement]; - /* XXX perspective-correct interpolation */ - if (xOrY == 'X') { - val[0] += span->attrStepX[attr][0]; - val[1] += span->attrStepX[attr][1]; - val[2] += span->attrStepX[attr][2]; - val[3] += span->attrStepX[attr][3]; - } - else { - val[0] += span->attrStepY[attr][0]; - val[1] += span->attrStepY[attr][1]; - val[2] += span->attrStepY[attr][2]; - val[3] += span->attrStepY[attr][3]; - } - } - } - - /* init condition codes */ - dMachine->CondCodes[0] = COND_EQ; - dMachine->CondCodes[1] = COND_EQ; - dMachine->CondCodes[2] = COND_EQ; - dMachine->CondCodes[3] = COND_EQ; -} -#endif - - /** * Execute the given vertex/fragment program. * @@ -762,57 +606,18 @@ _mesa_execute_program(GLcontext * ctx, break; case OPCODE_DDX: /* Partial derivative with respect to X */ { -#if 0 - GLfloat a[4], aNext[4], result[4]; - struct gl_program_machine dMachine; - if (!fetch_vector4_deriv(ctx, &inst->SrcReg[0], span, 'X', - column, result)) { - /* This is tricky. Make a copy of the current machine state, - * increment the input registers by the dx or dy partial - * derivatives, then re-execute the program up to the - * preceeding instruction, then fetch the source register. - * Finally, find the difference in the register values for - * the original and derivative runs. - */ - fetch_vector4(&inst->SrcReg[0], machine, program, a); - init_machine_deriv(ctx, machine, program, span, - 'X', &dMachine); - execute_program(ctx, program, pc, &dMachine, span, column); - fetch_vector4(&inst->SrcReg[0], &dMachine, program, - aNext); - result[0] = aNext[0] - a[0]; - result[1] = aNext[1] - a[1]; - result[2] = aNext[2] - a[2]; - result[3] = aNext[3] - a[3]; - } + GLfloat result[4]; + fetch_vector4_deriv(ctx, &inst->SrcReg[0], machine, + 'X', result); store_vector4(inst, machine, result); -#else - store_vector4(inst, machine, ZeroVec); -#endif } break; case OPCODE_DDY: /* Partial derivative with respect to Y */ { -#if 0 - GLfloat a[4], aNext[4], result[4]; - struct gl_program_machine dMachine; - if (!fetch_vector4_deriv(ctx, &inst->SrcReg[0], span, 'Y', - column, result)) { - init_machine_deriv(ctx, machine, program, span, - 'Y', &dMachine); - fetch_vector4(&inst->SrcReg[0], machine, program, a); - execute_program(ctx, program, pc, &dMachine, span, column); - fetch_vector4(&inst->SrcReg[0], &dMachine, program, - aNext); - result[0] = aNext[0] - a[0]; - result[1] = aNext[1] - a[1]; - result[2] = aNext[2] - a[2]; - result[3] = aNext[3] - a[3]; - } + GLfloat result[4]; + fetch_vector4_deriv(ctx, &inst->SrcReg[0], machine, + 'Y', result); store_vector4(inst, machine, result); -#else - store_vector4(inst, machine, ZeroVec); -#endif } break; case OPCODE_DP3: diff --git a/src/mesa/shader/prog_execute.h b/src/mesa/shader/prog_execute.h index 47845e9111f..be29eceedaa 100644 --- a/src/mesa/shader/prog_execute.h +++ b/src/mesa/shader/prog_execute.h @@ -48,6 +48,9 @@ struct gl_program_machine /** Fragment Input attributes */ GLfloat (*Attribs)[MAX_WIDTH][4]; + GLfloat (*DerivX)[4]; + GLfloat (*DerivY)[4]; + GLuint NumDeriv; /**< Max index into DerivX/Y arrays */ GLuint CurElement; /**< Index into Attribs arrays */ /** Vertex Input attribs */ -- cgit v1.2.3 From 60d136f63c5a5a18b12952ec8e8532cbce086a4d Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 2 May 2007 18:45:44 -0600 Subject: changes to get DDX/DDY working again --- src/mesa/swrast/s_fragprog.c | 4 ++++ src/mesa/swrast/s_span.c | 4 ++++ src/mesa/tnl/t_vb_program.c | 2 ++ 3 files changed, 10 insertions(+) diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index 09493873aa2..b1501221cad 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -113,6 +113,10 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine, /* Setup pointer to input attributes */ machine->Attribs = span->array->attribs; + machine->DerivX = (GLfloat (*)[4]) span->attrStepX; + machine->DerivY = (GLfloat (*)[4]) span->attrStepY; + machine->NumDeriv = FRAG_ATTRIB_MAX; + if (ctx->Shader.CurrentProgram) { /* Store front/back facing value in register FOGC.Y */ machine->Attribs[FRAG_ATTRIB_FOGC][col][1] = (GLfloat) ctx->_Facing; diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 0b17791567a..097d2c7b51c 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -1357,7 +1357,11 @@ shade_texture_span(GLcontext *ctx, SWspan *span) if ((inputsRead >= FRAG_BIT_VAR0) && (span->interpMask & SPAN_VARYING)) interpolate_varying(ctx, span); +#if 0 if (inputsRead & FRAG_BIT_WPOS) +#else + /* XXX always interpolate wpos so that DDX/DDY work */ +#endif interpolate_wpos(ctx, span); /* Run fragment program/shader now */ diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index 81e166bde50..9961af70ce7 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -126,6 +126,8 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine) } } + machine->NumDeriv = 0; + /* init condition codes */ machine->CondCodes[0] = COND_EQ; machine->CondCodes[1] = COND_EQ; -- cgit v1.2.3 From 18cfe0c801229c91d3973282b0693b8fd7df74f3 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 2 May 2007 18:46:45 -0600 Subject: document recent GLSL, R300 fixes --- docs/relnotes-7.0.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/relnotes-7.0.html b/docs/relnotes-7.0.html index 0cd7db8e2e6..6772bc02a8a 100644 --- a/docs/relnotes-7.0.html +++ b/docs/relnotes-7.0.html @@ -30,6 +30,9 @@ TBD
      • Fixed a few fog-related bugs.
      • Fixed broken GLSL mix() function. +
      • Implemented GLSL asin(), acos(), atan() functions. +
      • Fixed an R300 driver bug that caused Xorg composite manager to crash +
      • GLSL dFdx() and dFdy() work for fragment program inputs now (texcoords)
      -- cgit v1.2.3 From 2dfb03beb2751c873d7a7499ffb52dac7d758184 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 2 May 2007 18:48:51 -0600 Subject: New test of the dFdx(), dFdy() functions. --- progs/glsl/Makefile | 1 + progs/glsl/deriv.c | 321 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 322 insertions(+) create mode 100644 progs/glsl/deriv.c diff --git a/progs/glsl/Makefile b/progs/glsl/Makefile index e08d4102c88..b51a2a32b47 100644 --- a/progs/glsl/Makefile +++ b/progs/glsl/Makefile @@ -16,6 +16,7 @@ LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) $(T PROGS = \ brick \ bump \ + deriv \ mandelbrot \ noise \ toyball \ diff --git a/progs/glsl/deriv.c b/progs/glsl/deriv.c new file mode 100644 index 00000000000..63beef1c941 --- /dev/null +++ b/progs/glsl/deriv.c @@ -0,0 +1,321 @@ +/** + * Test OpenGL 2.0 dx/dy functions for texcoords. + * Brian Paul + * 2 May 2007 + * + * NOTE: resize the window to observe how the partial derivatives of + * the texcoords change. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include "extfuncs.h" + + +static char *FragProgFile = NULL; +static char *VertProgFile = NULL; +static GLuint fragShader; +static GLuint vertShader; +static GLuint program; +static GLuint SphereList, RectList, CurList; +static GLint win = 0; +static GLboolean anim = GL_TRUE; +static GLfloat xRot = 0.0f, yRot = 0.0f; + + +static void +Redisplay(void) +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glPushMatrix(); + glRotatef(xRot, 1.0f, 0.0f, 0.0f); + glRotatef(yRot, 0.0f, 1.0f, 0.0f); + glCallList(CurList); + glPopMatrix(); + + glutSwapBuffers(); +} + + +static void +Idle(void) +{ + yRot = glutGet(GLUT_ELAPSED_TIME) * 0.1; + glutPostRedisplay(); +} + + +static void +Reshape(int width, int height) +{ + glViewport(0, 0, width, height); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef(0.0f, 0.0f, -15.0f); +} + + +static void +CleanUp(void) +{ + glDeleteShader_func(fragShader); + glDeleteShader_func(vertShader); + glDeleteProgram_func(program); + glutDestroyWindow(win); +} + + +static void +Key(unsigned char key, int x, int y) +{ + (void) x; + (void) y; + + switch(key) { + case ' ': + case 'a': + anim = !anim; + if (anim) + glutIdleFunc(Idle); + else + glutIdleFunc(NULL); + break; + case 'o': + if (CurList == SphereList) + CurList = RectList; + else + CurList = SphereList; + break; + case 27: + CleanUp(); + exit(0); + break; + } + glutPostRedisplay(); +} + + +static void +SpecialKey(int key, int x, int y) +{ + const GLfloat step = 3.0f; + + (void) x; + (void) y; + + switch(key) { + case GLUT_KEY_UP: + xRot -= step; + break; + case GLUT_KEY_DOWN: + xRot += step; + break; + case GLUT_KEY_LEFT: + yRot -= step; + break; + case GLUT_KEY_RIGHT: + yRot += step; + break; + } + glutPostRedisplay(); +} + + +static void +MakeSphere(void) +{ + GLUquadricObj *obj = gluNewQuadric(); + SphereList = glGenLists(1); + gluQuadricTexture(obj, GL_TRUE); + glNewList(SphereList, GL_COMPILE); + gluSphere(obj, 2.0f, 30, 15); + glEndList(); +} + + +static void +MakeRect(void) +{ + RectList = glGenLists(1); + glNewList(RectList, GL_COMPILE); + glNormal3f(0, 0, 1); + glBegin(GL_POLYGON); + glTexCoord2f(0, 0); glVertex2f(-2, -2); + glTexCoord2f(1, 0); glVertex2f( 2, -2); + glTexCoord2f(1, 1); glVertex2f( 2, 2); + glTexCoord2f(0, 1); glVertex2f(-2, 2); + glEnd(); + glEndList(); +} + + + +static void +LoadAndCompileShader(GLuint shader, const char *text) +{ + GLint stat; + + glShaderSource_func(shader, 1, (const GLchar **) &text, NULL); + + glCompileShader_func(shader); + + glGetShaderiv_func(shader, GL_COMPILE_STATUS, &stat); + if (!stat) { + GLchar log[1000]; + GLsizei len; + glGetShaderInfoLog_func(shader, 1000, &len, log); + fprintf(stderr, "fslight: problem compiling shader:\n%s\n", log); + exit(1); + } +} + + +/** + * Read a shader from a file. + */ +static void +ReadShader(GLuint shader, const char *filename) +{ + const int max = 100*1000; + int n; + char *buffer = (char*) malloc(max); + FILE *f = fopen(filename, "r"); + if (!f) { + fprintf(stderr, "fslight: Unable to open shader file %s\n", filename); + exit(1); + } + + n = fread(buffer, 1, max, f); + printf("fslight: read %d bytes from shader file %s\n", n, filename); + if (n > 0) { + buffer[n] = 0; + LoadAndCompileShader(shader, buffer); + } + + fclose(f); + free(buffer); +} + + +static void +CheckLink(GLuint prog) +{ + GLint stat; + glGetProgramiv_func(prog, GL_LINK_STATUS, &stat); + if (!stat) { + GLchar log[1000]; + GLsizei len; + glGetProgramInfoLog_func(prog, 1000, &len, log); + fprintf(stderr, "Linker error:\n%s\n", log); + } +} + + +static void +Init(void) +{ + static const char *fragShaderText = + "void main() {\n" + " gl_FragColor = abs(dFdy(gl_TexCoord[0])) * 50.0;\n" + " // gl_FragColor = gl_TexCoord[0];\n" + "}\n"; + static const char *vertShaderText = + "varying vec3 normal;\n" + "void main() {\n" + " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" + " gl_TexCoord[0] = gl_MultiTexCoord0;\n" + "}\n"; + const char *version; + + version = (const char *) glGetString(GL_VERSION); + if (version[0] != '2' || version[1] != '.') { + printf("This program requires OpenGL 2.x, found %s\n", version); + exit(1); + } + + GetExtensionFuncs(); + + fragShader = glCreateShader_func(GL_FRAGMENT_SHADER); + if (FragProgFile) + ReadShader(fragShader, FragProgFile); + else + LoadAndCompileShader(fragShader, fragShaderText); + + vertShader = glCreateShader_func(GL_VERTEX_SHADER); + if (VertProgFile) + ReadShader(vertShader, VertProgFile); + else + LoadAndCompileShader(vertShader, vertShaderText); + + program = glCreateProgram_func(); + glAttachShader_func(program, fragShader); + glAttachShader_func(program, vertShader); + glLinkProgram_func(program); + CheckLink(program); + glUseProgram_func(program); + + /*assert(glGetError() == 0);*/ + + glClearColor(0.3f, 0.3f, 0.3f, 0.0f); + glEnable(GL_DEPTH_TEST); + + MakeSphere(); + MakeRect(); + + CurList = SphereList; + + printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER)); + + assert(glIsProgram_func(program)); + assert(glIsShader_func(fragShader)); + assert(glIsShader_func(vertShader)); + + glColor3f(1, 0, 0); +} + + +static void +ParseOptions(int argc, char *argv[]) +{ + int i; + for (i = 1; i < argc; i++) { + if (strcmp(argv[i], "-fs") == 0) { + FragProgFile = argv[i+1]; + } + else if (strcmp(argv[i], "-vs") == 0) { + VertProgFile = argv[i+1]; + } + } +} + + +int +main(int argc, char *argv[]) +{ + glutInit(&argc, argv); + glutInitWindowPosition( 0, 0); + glutInitWindowSize(200, 200); + glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); + win = glutCreateWindow(argv[0]); + glutReshapeFunc(Reshape); + glutKeyboardFunc(Key); + glutSpecialFunc(SpecialKey); + glutDisplayFunc(Redisplay); + if (anim) + glutIdleFunc(Idle); + ParseOptions(argc, argv); + Init(); + glutMainLoop(); + return 0; +} -- cgit v1.2.3 From dc881e19098ec3d04246ad07baded5ad4d916b66 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 2 May 2007 18:54:57 -0600 Subject: get rid of OSMESA stuff --- progs/glsl/Makefile | 6 ------ 1 file changed, 6 deletions(-) diff --git a/progs/glsl/Makefile b/progs/glsl/Makefile index b51a2a32b47..37fa312c30c 100644 --- a/progs/glsl/Makefile +++ b/progs/glsl/Makefile @@ -5,12 +5,6 @@ include $(TOP)/configs/current INCDIR = $(TOP)/include -OSMESA_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lOSMesa -lGLU -lGL $(APP_LIB_DEPS) - -OSMESA16_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lOSMesa16 -lGLU -lGL $(APP_LIB_DEPS) - -OSMESA32_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lOSMesa32 -lGLU -lGL $(APP_LIB_DEPS) - LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME) PROGS = \ -- cgit v1.2.3 From 3cddba688d45e61f0c8a76fd4c163745f09844d1 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 2 May 2007 18:55:45 -0600 Subject: get rid of normal vector --- progs/glsl/deriv.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/progs/glsl/deriv.c b/progs/glsl/deriv.c index 63beef1c941..8b652bc1e46 100644 --- a/progs/glsl/deriv.c +++ b/progs/glsl/deriv.c @@ -149,7 +149,6 @@ MakeRect(void) { RectList = glGenLists(1); glNewList(RectList, GL_COMPILE); - glNormal3f(0, 0, 1); glBegin(GL_POLYGON); glTexCoord2f(0, 0); glVertex2f(-2, -2); glTexCoord2f(1, 0); glVertex2f( 2, -2); @@ -231,7 +230,6 @@ Init(void) " // gl_FragColor = gl_TexCoord[0];\n" "}\n"; static const char *vertShaderText = - "varying vec3 normal;\n" "void main() {\n" " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" " gl_TexCoord[0] = gl_MultiTexCoord0;\n" -- cgit v1.2.3 From 121533defb48abddbf796aed62c1282cfa5234f9 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 3 May 2007 09:50:08 -0600 Subject: add some #includes to silence warnings --- src/mesa/drivers/dri/i965/brw_cc.c | 1 + src/mesa/drivers/dri/i965/brw_draw.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/brw_cc.c b/src/mesa/drivers/dri/i965/brw_cc.c index 84a02f8a8c9..8a1d1527db3 100644 --- a/src/mesa/drivers/dri/i965/brw_cc.c +++ b/src/mesa/drivers/dri/i965/brw_cc.c @@ -34,6 +34,7 @@ #include "brw_state.h" #include "brw_defines.h" #include "brw_util.h" +#include "macros.h" #include "enums.h" static void upload_cc_vp( struct brw_context *brw ) diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index 4eb2eedd422..c7798b14a93 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -46,7 +46,7 @@ #include "tnl/tnl.h" #include "vbo/vbo_context.h" - +#include "swrast/swrast.h" -- cgit v1.2.3 From c6443eb1a38946437fe38123f600ed9944a9bb70 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 3 May 2007 12:33:25 -0600 Subject: fix some matrix/state token indexing bugs (see bug 10848) --- src/mesa/drivers/dri/r300/r300_vertprog.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index 52fd1de4495..e8917980ba5 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -883,10 +883,11 @@ static void position_invariant(struct gl_program *prog) gl_state_index tokens[STATE_LENGTH] = { STATE_MVP_MATRIX, 0, 0, 0, 0 }; + /* tokens[4] = matrix modifier */ #ifdef PREFER_DP4 - tokens[5] = STATE_MATRIX; + tokens[4] = 0; /* not transposed or inverted */ #else - tokens[5] = STATE_MATRIX_TRANSPOSE; + tokens[4] = STATE_MATRIX_TRANSPOSE; #endif paramList = prog->Parameters; @@ -895,7 +896,7 @@ static void position_invariant(struct gl_program *prog) for (i=0; i < 4; i++) { GLint idx; - tokens[3] = tokens[4] = i; + tokens[2] = tokens[3] = i; /* matrix row[i]..row[i] */ idx = _mesa_add_state_reference(paramList, tokens); #ifdef PREFER_DP4 vpi[i].Opcode = OPCODE_DP4; -- cgit v1.2.3 From a6dad578b510d8876413871d7dc50738b7d32eb6 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 3 May 2007 13:52:33 -0600 Subject: document R300 bug fix 10848 --- docs/relnotes-7.0.html | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/relnotes-7.0.html b/docs/relnotes-7.0.html index 6772bc02a8a..75e3431d40d 100644 --- a/docs/relnotes-7.0.html +++ b/docs/relnotes-7.0.html @@ -32,6 +32,7 @@ TBD
    • Fixed broken GLSL mix() function.
    • Implemented GLSL asin(), acos(), atan() functions.
    • Fixed an R300 driver bug that caused Xorg composite manager to crash +
    • Fixed R300 vertex program/matrix bug (10848)
    • GLSL dFdx() and dFdy() work for fragment program inputs now (texcoords)
    -- cgit v1.2.3 From e75fbd3f918e86e545dfe6046b5d17a85be76f38 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 4 May 2007 18:26:41 -0600 Subject: Assorted miniglx updates. --- docs/MiniGLX.html | 13 ---- docs/contents.html | 2 +- docs/fbdev-dri.html | 210 ++++++++++++++++------------------------------------ docs/subset.html | 17 +---- 4 files changed, 70 insertions(+), 172 deletions(-) diff --git a/docs/MiniGLX.html b/docs/MiniGLX.html index 3429812993a..e7ebae68519 100644 --- a/docs/MiniGLX.html +++ b/docs/MiniGLX.html @@ -88,19 +88,6 @@ driver (such as radeon_dri.so) at runtime.  The environment variable LIBGL_DRIVERS_PATH should name the directory where these modules are located.

    -Prior to running a MiniGXL application, the following kernel modules -must be installed:
    -
    -
    agpgart.o
    -radeonfb.o  (assuming Radeon hardware)
    -radeon.o  (assuming Radeon hardware)
    -
    -
    -Finally, MiniGLX reads a configuration file (by default, -/etc/miniglx.conf) to determine basic configuration information. - The configuration file may also be located in the directory -specified by the MINIGLX_CONF environment variable).
    -
    The remainder of this section describes the MiniGLX API functions.

    3.1 Initialization

    diff --git a/docs/contents.html b/docs/contents.html index d8f427e59bc..a21341a5891 100644 --- a/docs/contents.html +++ b/docs/contents.html @@ -71,8 +71,8 @@ a:visited {
  • Help Wanted
  • Development Notes
  • Source Documentation -
  • Subset Information
  • fbdev/DRI Environment +
  • Mesa Subset Driver
  • glFBDev Driver
  • GL Dispatch diff --git a/docs/fbdev-dri.html b/docs/fbdev-dri.html index 4af503932be..cdc4bd62f83 100644 --- a/docs/fbdev-dri.html +++ b/docs/fbdev-dri.html @@ -12,161 +12,64 @@

    1. Introduction

    -The fbdev/DRI sub-project within Mesa brings hardware accelerated OpenGL -rendering to the Linux fbdev environment. -The X Window System / XFree86 is not needed. +The fbdev/DRI environment supports hardware-accelerated 3D rendering without +the X window system. This is typically used for embedded applications.

    -Basically, the DRI drivers for hardware -accelerated OpenGL for XFree86 have been ported to fbdev so that X is -not needed. -This means fbdev/DRI works in full-screen mode only. +Contributors to this project include Jon Smirl, Keith Whitwell and Dave Airlie.

    -DRI driver writers may find this simplified environment easier to work in, -compared to the full XFree86/DRI environment. +Applications in the fbdev/DRI environment use +the MiniGLX interface to choose pixel +formats, create rendering contexts, etc. It's a subset of the GLX and +Xlib interfaces allowing some degree of application portability between +the X and X-less environments.

    -

    -Much of the work for this project has been done by Jon Smirl and -Keith Whitwell. -

    - -

    -To use fbdev/DRI, you'll need a Linux 2.4 or 2.6 kernel. -

    - -

    Background Info

    - -

    -The Mesa-based DRI drivers used to be hosted in the DRI tree (which is -basically a copy of the XFree86 tree). -Since the Mesa-based DRI drivers are moreso "Mesa drivers" than "XFree86 -drivers" and the fact that with some work, the drivers could be used -without X, the driver code was moved into the Mesa tree. -

    - -

    -So now the DRI drivers can be compiled for two different environments: -fbdev and XFree86. -To build the drivers for XFree86, one has to download/build the DRI -source tree. -Eventually, we'd like to be able to build the drivers for XFree86 outside -of the XFree86/DRI trees. -

    - - -

    2. Compilation

    -

    2.1 Compiling the DRM modules

    -

    -First, you'll need the DRM (Direct Rendering Manager) kernel module sources. -They're found in a module of the DRI CVS tree. -To obtain the code do the following: +You'll need the DRM and pciaccess libraries. Check with:

    -   cvs -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/dri login
    -
    -

    -Press Enter/Return when prompted for a password. Then, -

    -
    -   cvs -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/dri co drm
    +   pkg-config --modversion libdrm
    +   pkg-config --modversion pciaccess
     

    -Compile the DRM kernel modules: +You'll need fbdev header files. Check with:

    -  cd drm/linux
    -  make
    +   ls -l /usr/include/linux/fb.h
     

    -Note: you may need to be root in order to make a few symlinks. -

    -

    -When compilation is done, you should have at least the following -kernel modules: -

    -
    -  gamma.o
    -  i810.o
    -  i830.o
    -  mach64.o
    -  mga.o
    -  r128.o
    -  radeon.o
    -  savage.o
    -  sis.o
    -  tdfx.o
    -  via.o
    -
    -

    -You'll probably want to copy/move them into your kernel module directory -(for example: /lib/modules/2.4.18-14/kernel/drivers/char/drm/). -

    - - - -

    2.2 Compiling the Mesa drivers

    - -

    -Begin by editing the Mesa/configs/default file to set -the DRM_SOURCE_PATH variable. -Set it to the location where the DRM module sources are located. -For example, if your current directory in step 2.1 was /home/fred/ -set DRM_SOURCE_PATH to /home/fred/drm -

    - -

    -Next, assuming you're starting with a fresh Mesa CVS checkout, -do the following: +Compile Mesa with the 'linux-solo' configuration:

        make linux-solo
     

    -If you previously built the source tree, run make realclean -first to remove the old object files. -

    - -

    -When this is finished, check the Mesa/lib/ directory -to verify that the following files were made: +When complete you should have the following:

    -
      -
    • libGL.so.1.2 - the client-side OpenGL library - (and a few symlinks to it). -
    • libGLU.so.1.1 - the GLU library (and a few symlinks to it). -
    • libglut.so.3.7 - the GLUT library (and a few symlinks to it). -
    • mga_dri.so - DRI driver for Matrox G200/G400 cards. -
    • r128_dri.so - DRI driver for ATI Rage 128 cards. -
    • r200_dri.so - DRI driver for ATI R200 Radeon cards. -
    • radeon_dri.so - DRI driver for original ATI Radeon cards. -
    • i810_dri.so - DRI driver for Intel i810/i815 chips. -
    • i830_dri.so - DRI driver for Intel i830/i845 chips. -
    • mga_dri.so - DRI driver for Matrox G200/G400 cards. -
    • sis_dri.so - DRI driver for SIS cards. -
    • tdfx_dri.so - DRI driver for 3dfx Voodoo 3/4/5 cards. -
    • gamma_dri.so - DRI driver for 3Dlabs gamma cards. -
    • fb_dri.so - software-only fbdev driver. -
    • miniglx.conf - configuration file for the MiniGLX interface +
    • lib/libGL.so - the GL library which applications link with +
    • lib/*_dri_so - DRI drivers +
    • lib/miniglx.conf - sample MiniGLX config file +
    • progs/miniglx/* - several MiniGLX sample programs
    +

    3. Using fbdev/DRI

    -If XFree86 is currently running, exit/stop the X server so you're -working from the console. +If an X server currently running, exit/stop it so you're working from +the console.

    @@ -175,12 +78,23 @@ working from the console.

    You'll need to load the kernel modules specific to your graphics hardware. Typically, this consists of the agpgart module, an fbdev driver module -and the DRM kernel module (from step 2.1). +and the DRM kernel module. +

    +

    +As root, the kernel modules can be loaded as follows:

    +

    +If you have Intel i915/i945 hardware: +

    +
    +   modprobe agpgart            # the AGP GART module
    +   modprobe intelfb            # the Intel fbdev driver
    +   modprobe i915               # the i915/945 DRI kernel module
    +

    -If you have ATI Radeon/R200 hardware, run as root: +If you have ATI Radeon/R200 hardware:

        modprobe agpgart            # the AGP GART module
    @@ -189,7 +103,7 @@ If you have ATI Radeon/R200 hardware, run as root:
     

    -If you have ATI Rage 128 hardware, run as root: +If you have ATI Rage 128 hardware:

        modprobe agpgart            # the AGP GART module
    @@ -198,7 +112,7 @@ If you have ATI Rage 128 hardware, run as root:
     

    -If you have Matrox G200/G400 hardware, run as root: +If you have Matrox G200/G400 hardware:

        modprobe agpgart            # the AGP GART module
    @@ -207,37 +121,46 @@ If you have Matrox G200/G400 hardware, run as root:
     

    -Then run lsmod to be sure the modules are loaded. -For a Radeon card, you should see something like this: +To verify that the agpgart, fbdev and drm modules are loaded:

    -Module                  Size  Used by    Not tainted
    -radeon                110308   0  (unused)
    -radeonfb               21900   0  (unused)
    -agpgart                43072   1 
    +   ls -l /dev/agpgart /dev/fb* /dev/dri
     
    - +

    +Alternately, use lsmod to inspect the currently installed modules. +If you have problems, look at the output of dmesg. +

    3.2 Configuration File

    -The Mesa/lib/miniglx.conf file should be installed -in /etc/. +Copy the sample miniglx.conf to /etc/miniglx.conf and review/edit its contents. +Alternately, the MINIGLX_CONF environment variable can be used to +indicate the location of miniglx.conf

    +To determine the pciBusID value, run lspci and examine the output. +For example: +

    +
    +   /sbin/lspci:
    +   00:02.0 VGA compatible controller: Intel Corporation 82915G/GV/910GL Express Chipset Family Graphics Controller (rev 04)
    +

    -Edit /etc/miniglx.conf to be sure it's set up correctly -for your hardware. -Comments in the file explain the options. +00:02.0 indicates that pciBusID should be PCI:0:2:0

    + +

    3.3 Running fbdev/DRI Programs

    Make sure your LD_LIBRARY_PATH environment variable is set to the -Mesa/lib/ directory. +location of the libGL.so library. You may need to append other paths +to LD_LIBRARY_PATH if libpciaccess.so is in a non-standard location, +for example.

    @@ -268,27 +191,24 @@ them from a remote shell so that you can stop them with ctrl-C.

    4.0 Troubleshooting

    -

    +

      +
    1. If you try to run miniglxtest and get the following: -

      +
          [miniglx] failed to probe chipset
          connect: Connection refused
          server connection lost
       
      -

      It means that the sample_server process is not running. -

      - +
      +
      +
    2. 5.0 Programming Information

      -

      -The full OpenGL API is available with fbdev/DRI. -

      -

      OpenGL/Mesa is interfaced to fbdev via the MiniGLX interface. diff --git a/docs/subset.html b/docs/subset.html index dd1d742a821..4ac2eadffb9 100644 --- a/docs/subset.html +++ b/docs/subset.html @@ -1,17 +1,18 @@ -Mesa Subset +Mesa Subset Driver -

      Mesa Subset

      +

      Mesa Subset Driver

      In 2002/2003 Tungsten Graphics was contracted to develop a subset Mesa/Radeon driver for an embedded environment. The result is a reduced-size DRI driver -for the ATI R200 chip, for use with Linux fbdev rather than XFree86. +for the ATI R200 chip, for use with +fbdev/DRI environment.

      @@ -19,15 +20,5 @@ The specification for this subset can be found here.

      -

      -The MiniGLX specification describes the -interface between fbdev and Mesa. -

      - -

      -More info to come... -

      - - -- cgit v1.2.3 From ae5f67575d4696633a877e88e42499c42d8d5238 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 4 May 2007 18:27:12 -0600 Subject: Makefile clean-ups for miniglx. --- configs/linux-solo | 13 ++++++++++--- src/glx/mini/Makefile | 21 +++++++++++++-------- src/mesa/drivers/dri/Makefile.template | 3 ++- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/configs/linux-solo b/configs/linux-solo index 730c245d90e..a6cab8c9b3b 100644 --- a/configs/linux-solo +++ b/configs/linux-solo @@ -15,6 +15,13 @@ PIC_FLAGS = -fPIC # Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support. ARCH_FLAGS ?= +# DRM and pciaccess +LIBDRM_CFLAGS = `pkg-config --cflags libdrm` +LIBDRM_LIB = `pkg-config --libs libdrm` +PCIACCESS_CFLAGS = `pkg-config --cflags pciaccess` +PCIACCESS_LIB = `pkg-config --libs pciaccess` + + DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ -D_BSD_SOURCE -D_GNU_SOURCE -DHAVE_POSIX_MEMALIGN \ -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DDRM_USE_MALLOC -DIN_DRI_DRIVER @@ -28,7 +35,7 @@ CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) ASM_SOURCES = # Library/program dependencies -DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl -L$(TOP)/$(LIB_DIR) +DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl -L$(TOP)/$(LIB_DIR) $(PCIACCESS_LIB) GL_LIB_DEPS = -lm -lpthread -ldl GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm @@ -39,5 +46,5 @@ SRC_DIRS = glx/mini mesa glu glut/mini DRIVER_DIRS = dri PROGRAM_DIRS = miniglx -#DRI_DIRS = ffb gamma sis savage -DRI_DIRS = i810 i915 mach64 mga r128 r200 radeon tdfx unichrome fb +#DRI_DIRS = ffb gamma sis savage tdfx unichrome fb +DRI_DIRS = i810 i915tex i915 mach64 mga r128 r200 radeon diff --git a/src/glx/mini/Makefile b/src/glx/mini/Makefile index 72943105c25..71f085d5cd9 100644 --- a/src/glx/mini/Makefile +++ b/src/glx/mini/Makefile @@ -1,5 +1,4 @@ -# Build a subset DRI-based libGL.so library. -# Indirect rendering not supported, etc. +# Build the MiniGLX libGL.so library. TOP = ../../.. include $(TOP)/configs/current @@ -29,7 +28,9 @@ INCLUDE_DIRS = \ -I$(TOP)/src/mesa/glapi \ -I$(TOP)/src/glx/x11 \ -I$(TOP)/src/mesa/drivers/dri/common \ - `pkg-config --cflags libdrm` + $(LIBDRM_CFLAGS) \ + $(PCIACCESS_CFLAGS) + ##### RULES ##### @@ -43,16 +44,20 @@ INCLUDE_DIRS = \ ##### TARGETS ##### -default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) +default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/miniglx.conf # Make libGL $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile - $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \ + @ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \ -major 1 -minor 2 $(MKLIB_OPTIONS) \ - -install $(TOP)/$(LIB_DIR) $(GL_LIB_DEPS) $(OBJECTS) `/usr/bin/pkg-config --libs libdrm` `/usr/bin/pkg-config --libs pciaccess` - rm -f $(TOP)/$(LIB_DIR)/miniglx.conf - install example.miniglx.conf $(TOP)/$(LIB_DIR)/miniglx.conf + -install $(TOP)/$(LIB_DIR) $(GL_LIB_DEPS) $(OBJECTS) \ + $(LIBDRM_LIB) $(PCIACCESS_LIB) + + +# install sample miniglx.conf +$(TOP)/$(LIB_DIR)/miniglx.conf: + $(INSTALL) example.miniglx.conf $(TOP)/$(LIB_DIR)/miniglx.conf drmtest: xf86drm.o drmtest.o diff --git a/src/mesa/drivers/dri/Makefile.template b/src/mesa/drivers/dri/Makefile.template index 5261a4b55d1..26f9bb74c87 100644 --- a/src/mesa/drivers/dri/Makefile.template +++ b/src/mesa/drivers/dri/Makefile.template @@ -29,7 +29,8 @@ WINOBJ= WINLIB=-L$(MESA)/src/glx/mini MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini INCLUDES = $(MINIGLX_INCLUDES) \ - $(SHARED_INCLUDES) + $(SHARED_INCLUDES) \ + $(PCIACCESS_CFLAGS) OBJECTS = $(C_SOURCES:.c=.o) \ $(MINIGLX_SOURCES:.c=.o) \ -- cgit v1.2.3 From 91948f99ddd08b2929aa0b993994f2745eff8bd5 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 4 May 2007 18:32:02 -0600 Subject: add
    tag --- docs/fbdev-dri.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/fbdev-dri.html b/docs/fbdev-dri.html index cdc4bd62f83..294ddb1e057 100644 --- a/docs/fbdev-dri.html +++ b/docs/fbdev-dri.html @@ -204,7 +204,7 @@ It means that the sample_server process is not running.

  • - +

    5.0 Programming Information

    -- cgit v1.2.3 From b3378f6cc5ea9473ae7ca257ed95c39cec728ffd Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sat, 5 May 2007 15:43:01 +1000 Subject: nouveau: disable nouveau build by default Until this is API/ABI stable building it by default isn't a good idea. --- configs/linux-dri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/linux-dri b/configs/linux-dri index 1a9146e2990..5f945a73f1a 100644 --- a/configs/linux-dri +++ b/configs/linux-dri @@ -67,4 +67,4 @@ WINDOW_SYSTEM=dri # gamma are missing because they have not been converted to use the new # interface. DRI_DIRS = i810 i915tex i915 i965 mach64 mga r128 r200 r300 radeon s3v \ - savage sis tdfx trident unichrome ffb nouveau + savage sis tdfx trident unichrome ffb -- cgit v1.2.3 From 5e2a66466d7f75181ccc54fba70f2a4f95d44272 Mon Sep 17 00:00:00 2001 From: Aapo Tahkola Date: Sat, 5 May 2007 17:07:46 +0300 Subject: don't use hw to perform vertex transform etc. when using swtcl. This for compatibility with vertex programs and the fact that swtcl very rarely gets hit with tcl capable hw. --- src/mesa/drivers/dri/r300/r300_context.h | 5 --- src/mesa/drivers/dri/r300/r300_state.c | 62 ++--------------------------- src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c | 8 +++- 3 files changed, 10 insertions(+), 65 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index c8b81d98497..da253ba6702 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -576,11 +576,6 @@ struct r300_vertex_shader_fragment { struct r300_vertex_shader_state { struct r300_vertex_shader_fragment program; - /* a bit of a waste - each uses only a subset of allocated space.. - but easier to program */ - struct r300_vertex_shader_fragment matrix[3]; - struct r300_vertex_shader_fragment vector[2]; - struct r300_vertex_shader_fragment unknown1; struct r300_vertex_shader_fragment unknown2; diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 4730fdff749..a1e2d529b60 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1568,13 +1568,6 @@ static void r300GenerateSimpleVertexShader(r300ContextPtr r300) r300->state.vertex_shader.unknown_ptr2=0x0; /* magic value */ r300->state.vertex_shader.unknown_ptr3=0x4; /* magic value */ - /* Initialize matrix and vector parameters.. these should really be restructured */ - /* TODO: fix vertex_shader structure */ - r300->state.vertex_shader.matrix[0].length=16; - r300->state.vertex_shader.matrix[1].length=0; - r300->state.vertex_shader.matrix[2].length=0; - r300->state.vertex_shader.vector[0].length=0; - r300->state.vertex_shader.vector[1].length=0; r300->state.vertex_shader.unknown1.length=0; r300->state.vertex_shader.unknown2.length=0; @@ -1586,48 +1579,11 @@ static void r300GenerateSimpleVertexShader(r300ContextPtr r300) r300->state.vertex_shader.program_end++; \ } - /* Multiply vertex coordinates with transform matrix */ - - WRITE_OP( - EASY_VSF_OP(MUL, 0, ALL, TMP), - VSF_PARAM(3), - VSF_ATTR_W(0), - EASY_VSF_SOURCE(0, W, W, W, W, NONE, NONE) - ) - - WRITE_OP( - EASY_VSF_OP(MUL, 1, ALL, RESULT), - VSF_REG(1), - VSF_ATTR_UNITY(1), - VSF_UNITY(1) - ) - - WRITE_OP( - EASY_VSF_OP(MAD, 0, ALL, TMP), - VSF_PARAM(2), - VSF_ATTR_Z(0), - VSF_TMP(0) - ) - - WRITE_OP( - EASY_VSF_OP(MAD, 0, ALL, TMP), - VSF_PARAM(1), - VSF_ATTR_Y(0), - VSF_TMP(0) - ) - - WRITE_OP( - EASY_VSF_OP(MAD, 0, ALL, RESULT), - VSF_PARAM(0), - VSF_ATTR_X(0), - VSF_TMP(0) - ) - o_reg += 2; - - for (i = VERT_ATTRIB_COLOR1; i < VERT_ATTRIB_MAX; i++) + + for (i = VERT_ATTRIB_POS; i < VERT_ATTRIB_MAX; i++) if (r300->state.sw_tcl_inputs[i] != -1) { WRITE_OP( - EASY_VSF_OP(MUL, o_reg++ /* 2+i */, ALL, RESULT), + EASY_VSF_OP(MUL, o_reg++, ALL, RESULT), VSF_REG(r300->state.sw_tcl_inputs[i]), VSF_ATTR_UNITY(r300->state.sw_tcl_inputs[i]), VSF_UNITY(r300->state.sw_tcl_inputs[i]) @@ -1666,20 +1622,8 @@ void r300SetupVertexShader(r300ContextPtr rmesa) /* This needs to be replaced by vertex shader generation code */ r300GenerateSimpleVertexShader(rmesa); - rmesa->state.vertex_shader.matrix[0].length=16; - memcpy(rmesa->state.vertex_shader.matrix[0].body.f, ctx->_ModelProjectMatrix.m, 16*4); - setup_vertex_shader_fragment(rmesa, VSF_DEST_PROGRAM, &(rmesa->state.vertex_shader.program)); - setup_vertex_shader_fragment(rmesa, VSF_DEST_MATRIX0, &(rmesa->state.vertex_shader.matrix[0])); -#if 0 - setup_vertex_shader_fragment(rmesa, VSF_DEST_MATRIX1, &(rmesa->state.vertex_shader.matrix[0])); - setup_vertex_shader_fragment(rmesa, VSF_DEST_MATRIX2, &(rmesa->state.vertex_shader.matrix[0])); - - setup_vertex_shader_fragment(rmesa, VSF_DEST_VECTOR0, &(rmesa->state.vertex_shader.vector[0])); - setup_vertex_shader_fragment(rmesa, VSF_DEST_VECTOR1, &(rmesa->state.vertex_shader.vector[1])); -#endif - #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)); diff --git a/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c b/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c index 0625e5bc571..9a5173cad1a 100644 --- a/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c +++ b/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c @@ -68,7 +68,13 @@ void radeon_vb_to_rvb(r300ContextPtr rmesa, struct radeon_vertex_buffer *rvb, st rvb->Count = vb->Count; - CONV_VB(VERT_ATTRIB_POS, ObjPtr); + 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]); -- cgit v1.2.3 From 16cec9f7674f9754bc03282d6b5596fbb086acd1 Mon Sep 17 00:00:00 2001 From: Aapo Tahkola Date: Sun, 6 May 2007 14:28:23 +0300 Subject: r300: fix primary color on rs480 --- src/mesa/drivers/dri/r300/r300_ioctl.c | 1 + src/mesa/drivers/dri/r300/r300_maos.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index c4dc97b8d49..82414259df9 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -206,6 +206,7 @@ static void r300EmitClearState(GLcontext * ctx) e32(0x00000405); if (!has_tcl) { + R300_STATECHANGE(r300, vte); /* comes from fglrx startup of clear */ reg_start(R300_SE_VTE_CNTL, 1); e32(0x043f); diff --git a/src/mesa/drivers/dri/r300/r300_maos.c b/src/mesa/drivers/dri/r300/r300_maos.c index b0d96f7601a..b2ce6cb991c 100644 --- a/src/mesa/drivers/dri/r300/r300_maos.c +++ b/src/mesa/drivers/dri/r300/r300_maos.c @@ -440,6 +440,12 @@ int r300EmitArrays(GLcontext *ctx) inputs[i] = nr++; else inputs[i] = -1; + + if(!(r300->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) { + for (i = 0; i < VERT_ATTRIB_MAX; i++) + if (inputs[i] > 0) + inputs[i]++; + } RENDERINPUTS_COPY( rmesa->state.render_inputs_bitset, inputs_bitset ); } -- cgit v1.2.3 From 62cbe6c3f3ba972c653d00c3f3797dde576c29fa Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 6 May 2007 11:36:24 +0000 Subject: r300: Use the defined values for R300_VAP_CNTL_STATUS. --- src/mesa/drivers/dri/r300/r300_state.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index a1e2d529b60..2a1b6c3848f 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1962,9 +1962,9 @@ 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] = 0x00000000; + r300->hw.vap_cntl_status.cmd[1] = R300_VC_NO_SWAP; else - r300->hw.vap_cntl_status.cmd[1] = 0x00000002; + r300->hw.vap_cntl_status.cmd[1] = R300_VC_32BIT_SWAP; /* disable VAP/TCL on non-TCL capable chips */ if (!has_tcl) -- cgit v1.2.3 From 81d1a04e04185a91ca6ecc0148083c761a52c6c9 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 6 May 2007 11:52:03 +0000 Subject: r300: Point size is now set in a separate function; removed the deprecated code. --- src/mesa/drivers/dri/r300/r300_state.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 2a1b6c3848f..fcc8cb8a2c3 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -2044,10 +2044,6 @@ void r300ResetHwState(r300ContextPtr r300) r300->hw.unk4214.cmd[1] = 0x00050005; r300PointSize(ctx, 0.0); -#if 0 - r300->hw.ps.cmd[R300_PS_POINTSIZE] = (6 << R300_POINTSIZE_X_SHIFT) | - (6 << R300_POINTSIZE_Y_SHIFT); -#endif r300->hw.unk4230.cmd[1] = 0x18000006; r300->hw.unk4230.cmd[2] = 0x00020006; -- cgit v1.2.3 From 56d966357447d55df838daa8ed3bfcc97d405beb Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 6 May 2007 11:54:00 +0000 Subject: r300: R300_ZS_... is now set in separate functions; removed the deprecated code. --- src/mesa/drivers/dri/r300/r300_state.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index fcc8cb8a2c3..469239aa928 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1886,20 +1886,6 @@ void r300ResetHwState(r300ContextPtr r300) /* This is a place to initialize registers which have bitfields accessed by different functions and not all bits are used */ -#if 0 - /* initialize similiar to r200 */ - r300->hw.zs.cmd[R300_ZS_CNTL_0] = 0; - r300->hw.zs.cmd[R300_ZS_CNTL_1] = - (R300_ZS_ALWAYS << R300_RB3D_ZS1_FRONT_FUNC_SHIFT) | - (R300_ZS_KEEP << R300_RB3D_ZS1_FRONT_FAIL_OP_SHIFT) | - (R300_ZS_KEEP << R300_RB3D_ZS1_FRONT_ZPASS_OP_SHIFT) | - (R300_ZS_KEEP << R300_RB3D_ZS1_FRONT_ZFAIL_OP_SHIFT) | - (R300_ZS_ALWAYS << R300_RB3D_ZS1_BACK_FUNC_SHIFT) | - (R300_ZS_KEEP << R300_RB3D_ZS1_BACK_FAIL_OP_SHIFT) | - (R300_ZS_KEEP << R300_RB3D_ZS1_BACK_ZPASS_OP_SHIFT) | - (R300_ZS_KEEP << R300_RB3D_ZS1_BACK_ZFAIL_OP_SHIFT); - r300->hw.zs.cmd[R300_ZS_CNTL_2] = 0x00ffff00; -#endif /* go and compute register values from GL state */ -- cgit v1.2.3 From 74cae00c0e5333c29b9c4483e0015019452ff7ce Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 6 May 2007 11:56:36 +0000 Subject: r300: Removed more deprecated state code that is now set in separate functions. --- src/mesa/drivers/dri/r300/r300_state.c | 76 ---------------------------------- 1 file changed, 76 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 469239aa928..ded140cf27f 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1911,19 +1911,6 @@ void r300ResetHwState(r300ContextPtr r300) r300UpdateTextureState(ctx); -// r300_setup_routing(ctx, GL_TRUE); - -#if 0 /* Done in prior to rendering */ - if(hw_tcl_on == GL_FALSE){ - r300EmitArrays(ctx, GL_TRUE); /* Just do the routing */ - r300_setup_textures(ctx); - r300_setup_rs_unit(ctx); - - r300SetupVertexShader(r300); - r300SetupPixelShader(r300); - } -#endif - r300_set_blend_state(ctx); r300AlphaFunc(ctx, ctx->Color.AlphaFunc, ctx->Color.AlphaRef); @@ -1956,17 +1943,6 @@ void r300ResetHwState(r300ContextPtr r300) if (!has_tcl) r300->hw.vap_cntl_status.cmd[1] |= R300_VAP_TCL_BYPASS; -#if 0 /* Done in setup routing */ - ((drm_r300_cmd_header_t*)r300->hw.vir[0].cmd)->packet0.count = 1; - r300->hw.vir[0].cmd[1] = 0x21030003; - - ((drm_r300_cmd_header_t*)r300->hw.vir[1].cmd)->packet0.count = 1; - r300->hw.vir[1].cmd[1] = 0xF688F688; - - r300->hw.vic.cmd[R300_VIR_CNTL_0] = 0x00000001; - r300->hw.vic.cmd[R300_VIR_CNTL_1] = 0x00000405; -#endif - r300->hw.unk21DC.cmd[1] = 0xAAAAAAAA; r300->hw.unk221C.cmd[1] = R300_221C_NORMAL; @@ -1982,17 +1958,6 @@ void r300ResetHwState(r300ContextPtr r300) else r300->hw.unk2288.cmd[1] = R300_2288_RV350; -#if 0 - r300->hw.vof.cmd[R300_VOF_CNTL_0] = R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT - | R300_VAP_OUTPUT_VTX_FMT_0__COLOR_PRESENT; - r300->hw.vof.cmd[R300_VOF_CNTL_1] = 0; /* no textures */ - - - r300->hw.pvs.cmd[R300_PVS_CNTL_1] = 0; - r300->hw.pvs.cmd[R300_PVS_CNTL_2] = 0; - r300->hw.pvs.cmd[R300_PVS_CNTL_3] = 0; -#endif - r300->hw.gb_enable.cmd[1] = R300_GB_POINT_STUFF_ENABLE | R300_GB_LINE_STUFF_ENABLE | R300_GB_TRIANGLE_STUFF_ENABLE /*| R300_GB_UNK31*/; @@ -2020,8 +1985,6 @@ void r300ResetHwState(r300ContextPtr r300) 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] = 0x00000000; /* No antialiasing */ - //r300->hw.txe.cmd[R300_TXE_ENABLE] = 0; - r300->hw.unk4200.cmd[1] = r300PackFloat32(0.0); r300->hw.unk4200.cmd[2] = r300PackFloat32(0.0); r300->hw.unk4200.cmd[3] = r300PackFloat32(1.0); @@ -2064,31 +2027,12 @@ void r300ResetHwState(r300ContextPtr r300) r300->hw.unk43E8.cmd[1] = 0x00FFFFFF; -#if 0 - r300->hw.fp.cmd[R300_FP_CNTL0] = 0; - r300->hw.fp.cmd[R300_FP_CNTL1] = 0; - r300->hw.fp.cmd[R300_FP_CNTL2] = 0; - r300->hw.fp.cmd[R300_FP_NODE0] = 0; - r300->hw.fp.cmd[R300_FP_NODE1] = 0; - r300->hw.fp.cmd[R300_FP_NODE2] = 0; - r300->hw.fp.cmd[R300_FP_NODE3] = 0; -#endif - r300->hw.unk46A4.cmd[1] = 0x00001B01; r300->hw.unk46A4.cmd[2] = 0x00001B0F; r300->hw.unk46A4.cmd[3] = 0x00001B0F; r300->hw.unk46A4.cmd[4] = 0x00001B0F; r300->hw.unk46A4.cmd[5] = 0x00000001; -#if 0 - for(i = 1; i <= 64; ++i) { - /* create NOP instructions */ - r300->hw.fpi[0].cmd[i] = FP_INSTRC(MAD, FP_ARGC(SRC0C_XYZ), FP_ARGC(ONE), FP_ARGC(ZERO)); - r300->hw.fpi[1].cmd[i] = FP_SELC(0,XYZ,NO,FP_TMP(0),0,0); - r300->hw.fpi[2].cmd[i] = FP_INSTRA(MAD, FP_ARGA(SRC0A), FP_ARGA(ONE), FP_ARGA(ZERO)); - r300->hw.fpi[3].cmd[i] = FP_SELA(0,W,NO,FP_TMP(0),0,0); - } -#endif 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 ); @@ -2102,11 +2046,6 @@ void r300ResetHwState(r300ContextPtr r300) r300->hw.unk4E00.cmd[1] = 0; -#if 0 - r300->hw.bld.cmd[R300_BLD_CBLEND] = 0; - r300->hw.bld.cmd[R300_BLD_ABLEND] = 0; -#endif - r300BlendColor(ctx, ctx->Color.BlendColor); r300->hw.blend_color.cmd[2] = 0; r300->hw.blend_color.cmd[3] = 0; @@ -2180,21 +2119,6 @@ void r300ResetHwState(r300ContextPtr r300) r300->hw.unk4F54.cmd[1] = 0; -#if 0 - ((drm_r300_cmd_header_t*)r300->hw.vpi.cmd)->vpu.count = 0; - for(i = 1; i < R300_VPI_CMDSIZE; i += 4) { - /* MOV t0, t0 */ - r300->hw.vpi.cmd[i+0] = VP_OUT(ADD,TMP,0,XYZW); - r300->hw.vpi.cmd[i+1] = VP_IN(TMP,0); - r300->hw.vpi.cmd[i+2] = VP_ZERO(); - r300->hw.vpi.cmd[i+3] = VP_ZERO(); - } - - ((drm_r300_cmd_header_t*)r300->hw.vpp.cmd)->vpu.count = 0; - for(i = 1; i < R300_VPP_CMDSIZE; ++i) - r300->hw.vpp.cmd[i] = 0; -#endif - if (has_tcl) { r300->hw.vps.cmd[R300_VPS_ZERO_0] = 0; r300->hw.vps.cmd[R300_VPS_ZERO_1] = 0; -- cgit v1.2.3 From 8445960d9fc9271324b2f920c6712750b7229fb6 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 6 May 2007 12:09:42 +0000 Subject: r300: Added R300_AA_DISABLE for R300_GB_AA_CONFIG. --- src/mesa/drivers/dri/r300/r300_reg.h | 1 + src/mesa/drivers/dri/r300/r300_state.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h index b296aaa07a9..3754a5be395 100644 --- a/src/mesa/drivers/dri/r300/r300_reg.h +++ b/src/mesa/drivers/dri/r300/r300_reg.h @@ -488,6 +488,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. # define R300_GB_W_SELECT_1 (1<<4) #define R300_GB_AA_CONFIG 0x4020 +# define R300_AA_DISABLE 0x00 # define R300_AA_ENABLE 0x01 # define R300_AA_SUBSAMPLES_2 0 # define R300_AA_SUBSAMPLES_3 (1<<1) diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index ded140cf27f..3e06c44381a 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1983,7 +1983,7 @@ void r300ResetHwState(r300ContextPtr r300) | R300_GB_TILE_SIZE_16; /* 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] = 0x00000000; /* No antialiasing */ + r300->hw.gb_misc.cmd[R300_GB_MISC_AA_CONFIG] = R300_AA_DISABLE; /* No antialiasing */ r300->hw.unk4200.cmd[1] = r300PackFloat32(0.0); r300->hw.unk4200.cmd[2] = r300PackFloat32(0.0); -- cgit v1.2.3 From 88ae491bd224843be963f67db3531857bed68cd1 Mon Sep 17 00:00:00 2001 From: Aapo Tahkola Date: Sun, 6 May 2007 19:10:39 +0300 Subject: r300: fix broken vbos --- src/mesa/drivers/dri/r300/r300_context.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index da253ba6702..afdfc29e433 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -52,7 +52,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * directly, see i965 driver for example. */ /* #define RADEON_VTXFMT_A */ +#ifdef RADEON_VTXFMT_A #define HW_VBOS +#endif /* We don't handle 16 bits elts swapping yet */ #ifdef MESA_BIG_ENDIAN -- cgit v1.2.3 From 660bdc616b01fdca30ca5aebcb5e90b3488e7b49 Mon Sep 17 00:00:00 2001 From: Aapo Tahkola Date: Sun, 6 May 2007 19:18:10 +0300 Subject: rs480: fix textures and secondary color(?). clipping is still busted. tested on r480 --- src/mesa/drivers/dri/r300/r300_maos.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_maos.c b/src/mesa/drivers/dri/r300/r300_maos.c index b2ce6cb991c..8de464bcd81 100644 --- a/src/mesa/drivers/dri/r300/r300_maos.c +++ b/src/mesa/drivers/dri/r300/r300_maos.c @@ -400,6 +400,7 @@ int r300EmitArrays(GLcontext *ctx) GLuint i; GLuint InputsRead = 0, OutputsWritten = 0; int *inputs = NULL; + int vir_inputs[VERT_ATTRIB_MAX]; GLint tab[VERT_ATTRIB_MAX]; int swizzle[VERT_ATTRIB_MAX][4]; @@ -442,9 +443,22 @@ int r300EmitArrays(GLcontext *ctx) inputs[i] = -1; if(!(r300->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) { - for (i = 0; i < VERT_ATTRIB_MAX; i++) - if (inputs[i] > 0) - inputs[i]++; + /* 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_COLOR0] = 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 ); -- cgit v1.2.3 From 8f1c63b263be86758c96d1b8fb4cfc7cac552dab Mon Sep 17 00:00:00 2001 From: Aapo Tahkola Date: Sun, 6 May 2007 19:25:45 +0300 Subject: rs480: fix secondary color for real this time --- src/mesa/drivers/dri/r300/r300_maos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/r300/r300_maos.c b/src/mesa/drivers/dri/r300/r300_maos.c index 8de464bcd81..34f2e569e92 100644 --- a/src/mesa/drivers/dri/r300/r300_maos.c +++ b/src/mesa/drivers/dri/r300/r300_maos.c @@ -454,7 +454,7 @@ int r300EmitArrays(GLcontext *ctx) inputs[VERT_ATTRIB_COLOR0] = 2; if (InputsRead & (1 << VERT_ATTRIB_COLOR1)) - inputs[VERT_ATTRIB_COLOR0] = 3; + inputs[VERT_ATTRIB_COLOR1] = 3; for (i = VERT_ATTRIB_TEX0; i <= VERT_ATTRIB_TEX7; i++) if (InputsRead & (1 << i)) -- cgit v1.2.3 From 8130a4fe982a7583e439a1fac61c5050f85bdf46 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 7 May 2007 07:06:08 +1000 Subject: radeon: enable xpress chipsets glxgears and googleearth now run so that seems like a good start Thanks to Aapo Tahkola for doing the 3D work on this so far, I got lost after the GART changes. --- src/mesa/drivers/dri/r300/r300_context.c | 3 +++ src/mesa/drivers/dri/r300/radeon_context.c | 6 ++++++ src/mesa/drivers/dri/radeon/radeon_screen.c | 3 +-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index c58cef65476..265b8defd84 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -187,6 +187,9 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, if (!r300) return GL_FALSE; + if (!(screen->chip_flags & RADEON_CHIPSET_TCL)) + hw_tcl_on = future_hw_tcl_on = 0; + /* Parse configuration files. * Do this here so that initialMaxAnisotropy is set before we create * the default textures. diff --git a/src/mesa/drivers/dri/r300/radeon_context.c b/src/mesa/drivers/dri/r300/radeon_context.c index 9b3f8905076..e9634b427a6 100644 --- a/src/mesa/drivers/dri/r300/radeon_context.c +++ b/src/mesa/drivers/dri/r300/radeon_context.c @@ -90,9 +90,15 @@ static const GLubyte *radeonGetString(GLcontext * ctx, GLenum name) offset = driGetRendererString(buffer, chipname, DRIVER_DATE, agp_mode); + if (IS_R300_CLASS(radeon->radeonScreen)) { sprintf(&buffer[offset], " %sTCL", + (radeon->radeonScreen->chip_flags & RADEON_CHIPSET_TCL) + ? "" : "NO-"); + } else { + sprintf(&buffer[offset], " %sTCL", !(radeon->TclFallback & RADEON_TCL_FALLBACK_TCL_DISABLE) ? "" : "NO-"); + } return (GLubyte *) buffer; } diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index b0c8fae2859..b476864d035 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -656,8 +656,7 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv ) case PCI_CHIP_RC410_5A61: case PCI_CHIP_RC410_5A62: screen->chip_family = CHIP_FAMILY_RS400; - fprintf(stderr, "Warning, xpress200 detected. Won't work.\n"); - return NULL; + fprintf(stderr, "Warning, xpress200 detected.\n"); break; default: -- cgit v1.2.3 From f1770c32103ed23d11422e7e33e8326d09d99370 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 7 May 2007 14:13:23 -0600 Subject: better comments for _mesa_debug(), _mesa_warning(), etc --- src/mesa/main/imports.c | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 786f812fce2..ca5f079f72a 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -20,9 +20,9 @@ /* * 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"), @@ -921,14 +921,11 @@ _mesa_vsprintf( char *str, const char *fmt, va_list args ) /*@{*/ /** - * Display a warning. + * Report a warning (a recoverable error condition) to stderr if + * either DEBUG is defined or the MESA_DEBUG env var is set. * * \param ctx GL context. * \param fmtString printf() alike format string. - * - * If debugging is enabled (either at compile-time via the DEBUG macro, or - * run-time via the MESA_DEBUG environment variable), prints the warning to - * stderr via fprintf(). */ void _mesa_warning( GLcontext *ctx, const char *fmtString, ... ) @@ -951,13 +948,11 @@ _mesa_warning( GLcontext *ctx, const char *fmtString, ... ) } /** - * This function is called when the Mesa user has stumbled into a code - * path which may not be implemented fully or correctly. + * Report an internla implementation problem. + * Prints the message to stderr via fprintf(). * * \param ctx GL context. * \param s problem description string. - * - * Prints the message to stderr via fprintf(). */ void _mesa_problem( const GLcontext *ctx, const char *fmtString, ... ) @@ -975,18 +970,16 @@ _mesa_problem( const GLcontext *ctx, const char *fmtString, ... ) } /** - * Display an error message. + * Record an OpenGL state error. These usually occur when the users + * passes invalid parameters to a GL function. * - * If in debug mode, print error message. - * Also, record the error code by calling _mesa_record_error(). + * If debugging is enabled (either at compile-time via the DEBUG macro, or + * run-time via the MESA_DEBUG environment variable), report the error with + * _mesa_debug(). * * \param ctx the GL context. * \param error the error value. * \param fmtString printf() style format string, followed by optional args - * - * If debugging is enabled (either at compile-time via the DEBUG macro, or - * run-time via the MESA_DEBUG environment variable), interperts the error code and - * prints the error message via _mesa_debug(). */ void _mesa_error( GLcontext *ctx, GLenum error, const char *fmtString, ... ) @@ -1056,12 +1049,11 @@ _mesa_error( GLcontext *ctx, GLenum error, const char *fmtString, ... ) } /** - * Report debug information. + * Report debug information. Print error message to stderr via fprintf(). + * No-op if DEBUG mode not enabled. * * \param ctx GL context. - * \param fmtString printf() alike format string. - * - * Prints the message to stderr via fprintf(). + * \param fmtString printf()-style format string, followed by optional args. */ void _mesa_debug( const GLcontext *ctx, const char *fmtString, ... ) -- cgit v1.2.3 From 401629c721d04941747106f543b6bc3d1fc2634c Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 8 May 2007 10:49:31 +1000 Subject: miniglx/glut: should use the x/y pos to create window This allows moving miniglx glut windows around the framebuffer --- src/glut/mini/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glut/mini/window.c b/src/glut/mini/window.c index 73266769c53..5a59e64de6c 100644 --- a/src/glut/mini/window.c +++ b/src/glut/mini/window.c @@ -90,7 +90,7 @@ int APIENTRY glutCreateWindow (const char *title) attr.event_mask = StructureNotifyMask | ExposureMask; mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask; - win = XCreateWindow( dpy, root, 0, 0, g_width, g_height, + win = XCreateWindow( dpy, root, g_xpos, g_ypos, g_width, g_height, 0, visinfo->depth, InputOutput, visinfo->visual, mask, &attr ); if (!win) { -- cgit v1.2.3 From 47e33a27dfabd752dbd3ff5fbb9ba9ba32976ebe Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 8 May 2007 10:51:44 +1000 Subject: miniglx: fixup use of create windows x and y coordinates This makes miniglx take not of the x and y from XCreateWindow --- src/glx/mini/miniglx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/glx/mini/miniglx.c b/src/glx/mini/miniglx.c index ce45d374646..71a0658eae3 100644 --- a/src/glx/mini/miniglx.c +++ b/src/glx/mini/miniglx.c @@ -1528,8 +1528,8 @@ XCreateWindow( Display *dpy, Window parent, int x, int y, } /* init other per-window fields */ - win->x = 0; - win->y = 0; + win->x = x; + win->y = y; win->w = width; win->h = height; win->visual = visual; /* ptr assignment */ @@ -1537,7 +1537,7 @@ XCreateWindow( Display *dpy, Window parent, int x, int y, win->bytesPerPixel = dpy->driverContext.cpp; win->rowStride = dpy->driverContext.shared.virtualWidth * win->bytesPerPixel; win->size = win->rowStride * height; - win->frontStart = dpy->driverContext.FBAddress; + win->frontStart = dpy->driverContext.FBAddress + (win->rowStride * win->x) + (win->y * win->bytesPerPixel); win->frontBottom = (GLubyte *) win->frontStart + (height-1) * win->rowStride; /* This is incorrect: the hardware driver could put the backbuffer -- cgit v1.2.3 From 8a7f474c691dc077c081b59e30937e526400860f Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 8 May 2007 10:53:43 +1000 Subject: i915/miniglx: remove unused code --- src/mesa/drivers/dri/i915tex/server/intel_dri.c | 28 ------------------------- 1 file changed, 28 deletions(-) diff --git a/src/mesa/drivers/dri/i915tex/server/intel_dri.c b/src/mesa/drivers/dri/i915tex/server/intel_dri.c index 4d1ac09f644..2d425d04ac3 100644 --- a/src/mesa/drivers/dri/i915tex/server/intel_dri.c +++ b/src/mesa/drivers/dri/i915tex/server/intel_dri.c @@ -895,31 +895,6 @@ I830DRIUnmapScreenRegions(const DRIDriverContext *ctx, I830Rec *pI830, drmI830Sa } } -#if 0 -static void -I830InitTextureHeap(const DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea) -{ - /* Start up the simple memory manager for agp space */ - drmI830MemInitHeap drmHeap; - drmHeap.region = I830_MEM_REGION_AGP; - drmHeap.start = 0; - drmHeap.size = sarea->tex_size; - - if (drmCommandWrite(ctx->drmFD, DRM_I830_INIT_HEAP, - &drmHeap, sizeof(drmHeap))) { - fprintf(stderr, - "[drm] Failed to initialized agp heap manager\n"); - } else { - fprintf(stderr, - "[drm] Initialized kernel agp heap manager, %d\n", - sarea->tex_size); - - I830SetParam(ctx, I830_SETPARAM_TEX_LRU_LOG_GRANULARITY, - sarea->log_tex_granularity); - } -} -#endif - static Bool I830DRIDoMappings(DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea) { @@ -943,9 +918,6 @@ I830DRIDoMappings(DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea) I830DRIMapScreenRegions(ctx, pI830, sarea); SetupDRIMM(ctx, pI830); -#if 0 - I830InitTextureHeap(ctx, pI830, sarea); -#endif if (ctx->pciDevice != PCI_CHIP_845_G && ctx->pciDevice != PCI_CHIP_I830_M) { I830SetParam(ctx, I830_SETPARAM_USE_MI_BATCHBUFFER_START, 1 ); -- cgit v1.2.3 From c6abbbfd0296ca0f8e4eecb29fce20cd7125f98a Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Tue, 8 May 2007 18:05:10 +0000 Subject: r300: Cleaned up a lot of cruft in r300_render.c. --- src/mesa/drivers/dri/r300/r300_render.c | 77 ++------------------------------- 1 file changed, 4 insertions(+), 73 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index ecd7fead263..20b33024266 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -198,7 +198,6 @@ static void inline fire_EB(r300ContextPtr rmesa, unsigned long addr, int vertex_ int cmd_reserved = 0; int cmd_written = 0; drm_radeon_cmd_header_t *cmd = NULL; - unsigned long addr_a; unsigned long t_addr; unsigned long magic_1, magic_2; GLcontext *ctx; @@ -211,8 +210,6 @@ static void inline fire_EB(r300ContextPtr rmesa, unsigned long addr, int vertex_ return ; } #ifdef OPTIMIZE_ELTS - addr_a = 0; - magic_1 = (addr % 32) / 4; t_addr = addr & (~0x1d); magic_2 = (vertex_count + 1 + (t_addr & 0x2)) / 2 + magic_1; @@ -236,22 +233,14 @@ static void inline fire_EB(r300ContextPtr rmesa, unsigned long addr, int vertex_ } if(elt_size == 4){ - e32(vertex_count /*+ addr_a/4*/); /* Total number of dwords needed? */ + e32(vertex_count); /* Total number of dwords needed? */ } else { e32(magic_2); /* Total number of dwords needed? */ } //cp_delay(rmesa, 1); -#if 0 - fprintf(stderr, "magic_1 %d\n", magic_1); - fprintf(stderr, "t_addr %x\n", t_addr); - fprintf(stderr, "magic_2 %d\n", magic_2); - exit(1); -#endif #else (void)magic_2, (void)magic_1, (void)t_addr; - addr_a = 0; - check_space(6); start_packet3(RADEON_CP_PACKET3_3D_DRAW_INDX_2, 0); @@ -266,9 +255,9 @@ static void inline fire_EB(r300ContextPtr rmesa, unsigned long addr, int vertex_ e32(addr /*& 0xffffffe3*/); if(elt_size == 4){ - e32(vertex_count /*+ addr_a/4*/); /* Total number of dwords needed? */ + e32(vertex_count); /* Total number of dwords needed? */ } else { - e32((vertex_count+1)/2 /*+ addr_a/4*/); /* Total number of dwords needed? */ + e32((vertex_count+1)/2); /* Total number of dwords needed? */ } //cp_delay(rmesa, 1); #endif @@ -289,29 +278,12 @@ static void r300_render_vb_primitive(r300ContextPtr rmesa, if(rmesa->state.VB.Elts){ r300EmitAOS(rmesa, rmesa->state.aos_count, /*0*/start); -#if 0 - int cmd_reserved = 0; - int cmd_written = 0; - drm_radeon_cmd_header_t *cmd = NULL; - int i; - start_index32_packet(num_verts, type); - for(i=0; i < num_verts; i++) - e32(((unsigned long *)rmesa->state.VB.Elts)[i]/*rmesa->state.Elts[start+i]*/); /* start ? */ -#else - if(num_verts == 1){ - //start_index32_packet(num_verts, type); - //e32(rmesa->state.Elts[start]); - return; - } - 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); fire_EB(rmesa, rmesa->state.elt_dma.aos_offset, num_verts, type, rmesa->state.VB.elt_size); -#endif }else{ r300EmitAOS(rmesa, rmesa->state.aos_count, start); fire_AOS(rmesa, num_verts, type); @@ -401,20 +373,6 @@ int r300Fallback(GLcontext *ctx) */ FALLBACK_IF(ctx->RenderMode != GL_RENDER); -#if 0 - /* These should work now.. */ - FALLBACK_IF(ctx->Color.DitherFlag); - /* GL_ALPHA_TEST */ - FALLBACK_IF(ctx->Color.AlphaEnabled); - /* GL_BLEND */ - FALLBACK_IF(ctx->Color.BlendEnabled); - /* GL_POLYGON_OFFSET_FILL */ - FALLBACK_IF(ctx->Polygon.OffsetFill); - /* FOG seems to trigger an unknown output - * in vertex program. - */ - FALLBACK_IF(ctx->Fog.Enabled); -#endif FALLBACK_IF(ctx->Stencil._TestTwoSide && (ctx->Stencil.Ref[0] != ctx->Stencil.Ref[1] || ctx->Stencil.ValueMask[0] != ctx->Stencil.ValueMask[1] || @@ -425,12 +383,6 @@ int r300Fallback(GLcontext *ctx) FALLBACK_IF(ctx->Polygon.OffsetPoint); /* GL_POLYGON_OFFSET_LINE */ FALLBACK_IF(ctx->Polygon.OffsetLine); -#if 0 - /* GL_STENCIL_TEST */ - FALLBACK_IF(ctx->Stencil.Enabled); - /* GL_POLYGON_SMOOTH disabling to get blender going */ - FALLBACK_IF(ctx->Polygon.SmoothFlag); -#endif /* GL_POLYGON_STIPPLE */ FALLBACK_IF(ctx->Polygon.StippleFlag); /* GL_MULTISAMPLE_ARB */ @@ -464,7 +416,6 @@ int r300Fallback(GLcontext *ctx) static GLboolean r300_run_render(GLcontext *ctx, struct tnl_pipeline_stage *stage) { - if (RADEON_DEBUG & DEBUG_PRIMS) fprintf(stderr, "%s\n", __FUNCTION__); @@ -504,31 +455,11 @@ static GLboolean r300_run_tcl_render(GLcontext *ctx, r300UpdateShaders(rmesa); vp = (struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx); -#if 0 /* Draw every second request with software arb vp */ - vp->native++; - vp->native &= 1; - //vp->native = GL_FALSE; -#endif - -#if 0 /* You dont want to know what this does... */ - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct tnl_cache *cache; - struct tnl_cache_item *c; - - cache = tnl->vp_cache; - c = cache->items[0xc000cc0e % cache->size]; - - if(c && c->data == vp) - vp->native = GL_FALSE; - -#endif -#if 0 - vp->native = GL_FALSE; -#endif if (vp->native == GL_FALSE) { hw_tcl_on = GL_FALSE; return GL_TRUE; } + //r300UpdateShaderStates(rmesa); return r300_run_vb_render(ctx, stage); -- cgit v1.2.3 From 6c036812be53b741b9801a14aad8163775150ca7 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Tue, 8 May 2007 18:28:04 +0000 Subject: r300: Clean up the vertex buffer emission code and reduced code duplication. I tested both the unoptimized and optimized versions with Quake 3 Arena; there are no problems. --- src/mesa/drivers/dri/r300/r300_render.c | 37 ++++++++++----------------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 20b33024266..4b846226ccb 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -209,7 +209,7 @@ static void inline fire_EB(r300ContextPtr rmesa, unsigned long addr, int vertex_ WARN_ONCE("Badly aligned buffer\n"); return ; } -#ifdef OPTIMIZE_ELTS + magic_1 = (addr % 32) / 4; t_addr = addr & (~0x1d); magic_2 = (vertex_count + 1 + (t_addr & 0x2)) / 2 + magic_1; @@ -224,43 +224,28 @@ static void inline fire_EB(r300ContextPtr rmesa, unsigned long addr, int vertex_ } 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 /*& 0xffffffe3*/); + e32(addr); } else { e32(R300_EB_UNK1 | (magic_1 << 16) | R300_EB_UNK2); e32(t_addr); } - - if(elt_size == 4){ - e32(vertex_count); /* Total number of dwords needed? */ - } else { - e32(magic_2); /* Total number of dwords needed? */ - } - //cp_delay(rmesa, 1); #else - (void)magic_2, (void)magic_1, (void)t_addr; - - check_space(6); - - 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); - } else { - e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (vertex_count<<16) | type); - } - - start_packet3(RADEON_CP_PACKET3_INDX_BUFFER, 2); e32(R300_EB_UNK1 | (0 << 16) | R300_EB_UNK2); - e32(addr /*& 0xffffffe3*/); + e32(addr); +#endif if(elt_size == 4){ - e32(vertex_count); /* Total number of dwords needed? */ + e32(vertex_count); } else { - e32((vertex_count+1)/2); /* Total number of dwords needed? */ - } - //cp_delay(rmesa, 1); +#ifdef OPTIMIZE_ELTS + e32(magic_2); +#else + e32((vertex_count+1)/2); #endif + } } static void r300_render_vb_primitive(r300ContextPtr rmesa, -- cgit v1.2.3 From 9301a6a32598a948b07bb5b33392e4ea88bde06a Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Tue, 8 May 2007 18:43:56 +0000 Subject: r300: Print the OpenGL define instead of a 2-digit char code in the warning. --- src/mesa/drivers/dri/r300/r300_render.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 4b846226ccb..62687071dc0 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -104,7 +104,7 @@ static int r300_get_primitive_type(r300ContextPtr rmesa, GLcontext *ctx, int pri type=R300_VAP_VF_CNTL__PRIM_POLYGON; break; default: - fprintf(stderr, "%s:%s Do not know how to handle primitive %02x - help me !\n", + fprintf(stderr, "%s:%s Do not know how to handle primitive 0x%04x - help me !\n", __FILE__, __FUNCTION__, prim & PRIM_MODE_MASK); return -1; @@ -116,59 +116,48 @@ static int r300_get_primitive_type(r300ContextPtr rmesa, GLcontext *ctx, int pri int r300_get_num_verts(r300ContextPtr rmesa, int num_verts, int prim) { int verts_off=0; - char *name="UNKNOWN"; switch (prim & PRIM_MODE_MASK) { case GL_POINTS: - name="P"; verts_off = 0; break; case GL_LINES: - name="L"; verts_off = num_verts % 2; break; case GL_LINE_STRIP: - name="LS"; if(num_verts < 2) verts_off = num_verts; break; case GL_LINE_LOOP: - name="LL"; if(num_verts < 2) verts_off = num_verts; break; case GL_TRIANGLES: - name="T"; verts_off = num_verts % 3; break; case GL_TRIANGLE_STRIP: - name="TS"; if(num_verts < 3) verts_off = num_verts; break; case GL_TRIANGLE_FAN: - name="TF"; if(num_verts < 3) verts_off = num_verts; break; case GL_QUADS: - name="Q"; verts_off = num_verts % 4; break; case GL_QUAD_STRIP: - name="QS"; if(num_verts < 4) verts_off = num_verts; else verts_off = num_verts % 2; break; case GL_POLYGON: - name="P"; if(num_verts < 3) verts_off = num_verts; break; default: - fprintf(stderr, "%s:%s Do not know how to handle primitive %02x - help me !\n", + fprintf(stderr, "%s:%s Do not know how to handle primitive 0x%04x - help me !\n", __FILE__, __FUNCTION__, prim & PRIM_MODE_MASK); return -1; @@ -177,12 +166,14 @@ int r300_get_num_verts(r300ContextPtr rmesa, int num_verts, int prim) if (RADEON_DEBUG & DEBUG_VERTS) { if (num_verts - verts_off == 0) { - WARN_ONCE("user error: Need more than %d vertices to draw primitive %s !\n", num_verts, name); + WARN_ONCE("user error: Need more than %d vertices to draw primitive 0x%04x !\n", + num_verts, prim & PRIM_MODE_MASK); return 0; } if (verts_off > 0) { - WARN_ONCE("user error: %d is not a valid number of vertices for primitive %s !\n", num_verts, name); + WARN_ONCE("user error: %d is not a valid number of vertices for primitive 0x%04x !\n", + num_verts, prim & PRIM_MODE_MASK); } } -- cgit v1.2.3 From fbeae4f70c177ce55fa137f5e0ca5747e914140a Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Tue, 8 May 2007 18:47:26 +0000 Subject: r300: Moved the pipeline stages together for readability. --- src/mesa/drivers/dri/r300/r300_render.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 62687071dc0..e5c9c65124e 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -401,15 +401,6 @@ static GLboolean r300_run_render(GLcontext *ctx, return r300_run_vb_render(ctx, stage); } -const struct tnl_pipeline_stage _r300_render_stage = { - "r300 hw rasterize", - NULL, - NULL, - NULL, - NULL, - r300_run_render /* run */ -}; - static GLboolean r300_run_tcl_render(GLcontext *ctx, struct tnl_pipeline_stage *stage) { @@ -441,6 +432,15 @@ static GLboolean r300_run_tcl_render(GLcontext *ctx, return r300_run_vb_render(ctx, stage); } +const struct tnl_pipeline_stage _r300_render_stage = { + "r300 hw rasterize", + NULL, + NULL, + NULL, + NULL, + r300_run_render /* run */ +}; + const struct tnl_pipeline_stage _r300_tcl_stage = { "r300 tcl", NULL, @@ -449,4 +449,3 @@ const struct tnl_pipeline_stage _r300_tcl_stage = { NULL, r300_run_tcl_render /* run */ }; - -- cgit v1.2.3 From 313c4c2643e0bf0f52efc4924a395f107ed3a493 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Tue, 8 May 2007 19:22:15 +0000 Subject: r300: General render clean up; added some Doxygen documentation, too. --- src/mesa/drivers/dri/r300/r300_render.c | 99 ++++++++++++++++----------------- 1 file changed, 47 insertions(+), 52 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index e5c9c65124e..e6413fb8f63 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -26,8 +26,20 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ /* - * Authors: - * Nicolai Haehnle + * \file + * + * \brief R300 Render (Vertex Buffer Implementation) + * + * The immediate implementation has been removed from CVS in favor of the vertex + * buffer implementation. + * + * When falling back to software TCL still attempt to use hardware + * rasterization. + * + * I am not sure that the cache related registers are setup correctly, but + * obviously this does work... Further investigation is needed. + * + * \author Nicolai Haehnle */ #include "glheader.h" @@ -61,14 +73,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. extern int future_hw_tcl_on; -/********************************************************************** -* Hardware rasterization -* -* When we fell back to software TCL, we still try to use the -* rasterization hardware for rendering. -**********************************************************************/ - -static int r300_get_primitive_type(r300ContextPtr rmesa, GLcontext *ctx, int prim) +static int r300PrimitiveType(r300ContextPtr rmesa, GLcontext *ctx, int prim) { int type=-1; @@ -113,7 +118,7 @@ static int r300_get_primitive_type(r300ContextPtr rmesa, GLcontext *ctx, int pri return type; } -int r300_get_num_verts(r300ContextPtr rmesa, int num_verts, int prim) +static int r300NumVerts(r300ContextPtr rmesa, int num_verts, int prim) { int verts_off=0; @@ -180,11 +185,7 @@ int r300_get_num_verts(r300ContextPtr rmesa, int num_verts, int prim) return num_verts - verts_off; } -/* Immediate implementation has been removed from CVS. */ - -/* vertex buffer implementation */ - -static void inline fire_EB(r300ContextPtr rmesa, unsigned long addr, int vertex_count, int type, int elt_size) +static void inline r300FireEB(r300ContextPtr rmesa, unsigned long addr, int vertex_count, int type, int elt_size) { int cmd_reserved = 0; int cmd_written = 0; @@ -239,7 +240,7 @@ static void inline fire_EB(r300ContextPtr rmesa, unsigned long addr, int vertex_ } } -static void r300_render_vb_primitive(r300ContextPtr rmesa, +static void r300RunRenderPrimitive(r300ContextPtr rmesa, GLcontext *ctx, int start, int end, @@ -247,8 +248,8 @@ static void r300_render_vb_primitive(r300ContextPtr rmesa, { int type, num_verts; - type=r300_get_primitive_type(rmesa, ctx, prim); - num_verts=r300_get_num_verts(rmesa, end-start, prim); + type=r300PrimitiveType(rmesa, ctx, prim); + num_verts=r300NumVerts(rmesa, end-start, prim); if(type<0 || num_verts <= 0)return; @@ -259,14 +260,14 @@ static void r300_render_vb_primitive(r300ContextPtr rmesa, return; } r300EmitElts(ctx, rmesa->state.VB.Elts, num_verts, rmesa->state.VB.elt_size); - fire_EB(rmesa, rmesa->state.elt_dma.aos_offset, num_verts, type, rmesa->state.VB.elt_size); + r300FireEB(rmesa, rmesa->state.elt_dma.aos_offset, num_verts, type, rmesa->state.VB.elt_size); }else{ r300EmitAOS(rmesa, rmesa->state.aos_count, start); fire_AOS(rmesa, num_verts, type); } } -GLboolean r300_run_vb_render(GLcontext *ctx, +static GLboolean r300RunRender(GLcontext *ctx, struct tnl_pipeline_stage *stage) { r300ContextPtr rmesa = R300_CONTEXT(ctx); @@ -304,7 +305,7 @@ GLboolean r300_run_vb_render(GLcontext *ctx, GLuint start = VB->Primitive[i].start; GLuint length = VB->Primitive[i].count; - r300_render_vb_primitive(rmesa, ctx, start, start + length, prim); + r300RunRenderPrimitive(rmesa, ctx, start, start + length, prim); } reg_start(R300_RB3D_DSTCACHE_CTLSTAT,0); @@ -333,20 +334,16 @@ GLboolean r300_run_vb_render(GLcontext *ctx, int r300Fallback(GLcontext *ctx) { r300ContextPtr r300 = R300_CONTEXT(ctx); - struct r300_fragment_program *rp = + struct r300_fragment_program *fp = (struct r300_fragment_program *) (char *)ctx->FragmentProgram._Current; - if (rp) { - if (!rp->translated) - r300_translate_fragment_shader(r300, rp); - - FALLBACK_IF(!rp->translated); + if (fp) { + if (!fp->translated) + r300_translate_fragment_shader(r300, fp); + FALLBACK_IF(!fp->translated); } - /* We do not do SELECT or FEEDBACK (yet ?) - * Is it worth doing them ? - */ FALLBACK_IF(ctx->RenderMode != GL_RENDER); FALLBACK_IF(ctx->Stencil._TestTwoSide && @@ -354,6 +351,14 @@ int r300Fallback(GLcontext *ctx) ctx->Stencil.ValueMask[0] != ctx->Stencil.ValueMask[1] || ctx->Stencil.WriteMask[0] != ctx->Stencil.WriteMask[1])); + /* GL_COLOR_LOGIC_OP */ + FALLBACK_IF(ctx->Color.ColorLogicOpEnabled); + + /* GL_POINT_SPRITE_ARB, GL_POINT_SPRITE_NV */ + if (ctx->Extensions.NV_point_sprite || + ctx->Extensions.ARB_point_sprite) + FALLBACK_IF(ctx->Point.PointSprite); + if(!r300->disable_lowimpact_fallback){ /* GL_POLYGON_OFFSET_POINT */ FALLBACK_IF(ctx->Polygon.OffsetPoint); @@ -361,9 +366,9 @@ int r300Fallback(GLcontext *ctx) FALLBACK_IF(ctx->Polygon.OffsetLine); /* GL_POLYGON_STIPPLE */ FALLBACK_IF(ctx->Polygon.StippleFlag); - /* GL_MULTISAMPLE_ARB */ + /* GL_MULTISAMPLE */ FALLBACK_IF(ctx->Multisample.Enabled); - /* blender ? */ + /* GL_LINE_STIPPLE */ FALLBACK_IF(ctx->Line.StippleFlag); /* GL_LINE_SMOOTH */ FALLBACK_IF(ctx->Line.SmoothFlag); @@ -371,15 +376,6 @@ int r300Fallback(GLcontext *ctx) FALLBACK_IF(ctx->Point.SmoothFlag); } - /* Fallback for LOGICOP */ - FALLBACK_IF(ctx->Color.ColorLogicOpEnabled); - - /* Rest could be done with vertex fragments */ - if (ctx->Extensions.NV_point_sprite || - ctx->Extensions.ARB_point_sprite) - /* GL_POINT_SPRITE_NV */ - FALLBACK_IF(ctx->Point.PointSprite); - return R300_FALLBACK_NONE; } @@ -389,7 +385,7 @@ int r300Fallback(GLcontext *ctx) * rasterization) or false to indicate that the pipeline has finished * after we render something. */ -static GLboolean r300_run_render(GLcontext *ctx, +static GLboolean r300RunNonTNLRender(GLcontext *ctx, struct tnl_pipeline_stage *stage) { if (RADEON_DEBUG & DEBUG_PRIMS) @@ -398,10 +394,10 @@ static GLboolean r300_run_render(GLcontext *ctx, if (r300Fallback(ctx) >= R300_FALLBACK_RAST) return GL_TRUE; - return r300_run_vb_render(ctx, stage); + return r300RunRender(ctx, stage); } -static GLboolean r300_run_tcl_render(GLcontext *ctx, +static GLboolean r300RunTCLRender(GLcontext *ctx, struct tnl_pipeline_stage *stage) { r300ContextPtr rmesa = R300_CONTEXT(ctx); @@ -411,6 +407,7 @@ static GLboolean r300_run_tcl_render(GLcontext *ctx, if (RADEON_DEBUG & DEBUG_PRIMS) fprintf(stderr, "%s\n", __FUNCTION__); + if(hw_tcl_on == GL_FALSE) return GL_TRUE; @@ -427,25 +424,23 @@ static GLboolean r300_run_tcl_render(GLcontext *ctx, return GL_TRUE; } - //r300UpdateShaderStates(rmesa); - - return r300_run_vb_render(ctx, stage); + return r300RunRender(ctx, stage); } const struct tnl_pipeline_stage _r300_render_stage = { - "r300 hw rasterize", + "r300 Hardware Rasterization", NULL, NULL, NULL, NULL, - r300_run_render /* run */ + r300RunNonTNLRender }; const struct tnl_pipeline_stage _r300_tcl_stage = { - "r300 tcl", + "r300 Hardware Transform, Clipping and Lighting", NULL, NULL, NULL, NULL, - r300_run_tcl_render /* run */ + r300RunTCLRender }; -- cgit v1.2.3 From f1d785188b170f1d3e79ba257cb8634f13685bca Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Tue, 8 May 2007 19:31:30 +0000 Subject: r300: Cleaned up r300_render.c using Indent with appropriate options. This corrects the mess of space and tab indenting that existed in this file, and probably others. The diff is actually very small if you use an external diff program and ignore whitespace. --- src/mesa/drivers/dri/r300/r300_render.c | 250 ++++++++++++++++---------------- 1 file changed, 127 insertions(+), 123 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index e6413fb8f63..db6b77a0c22 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -24,7 +24,6 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ - /* * \file * @@ -41,7 +40,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * * \author Nicolai Haehnle */ - #include "glheader.h" #include "state.h" #include "imports.h" @@ -50,14 +48,12 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "context.h" #include "dd.h" #include "simple_list.h" - #include "api_arrayelt.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" #include "vbo/vbo.h" #include "tnl/tnl.h" #include "tnl/t_vp_build.h" - #include "radeon_reg.h" #include "radeon_macros.h" #include "radeon_ioctl.h" @@ -70,122 +66,125 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_tex.h" #include "r300_maos.h" #include "r300_emit.h" - extern int future_hw_tcl_on; -static int r300PrimitiveType(r300ContextPtr rmesa, GLcontext *ctx, int prim) +static int r300PrimitiveType(r300ContextPtr rmesa, GLcontext * ctx, + int prim) { - int type=-1; + int type = -1; switch (prim & PRIM_MODE_MASK) { case GL_POINTS: - type=R300_VAP_VF_CNTL__PRIM_POINTS; - break; + type = R300_VAP_VF_CNTL__PRIM_POINTS; + break; case GL_LINES: - type=R300_VAP_VF_CNTL__PRIM_LINES; - break; + type = R300_VAP_VF_CNTL__PRIM_LINES; + break; case GL_LINE_STRIP: - type=R300_VAP_VF_CNTL__PRIM_LINE_STRIP; - break; + type = R300_VAP_VF_CNTL__PRIM_LINE_STRIP; + break; case GL_LINE_LOOP: - type=R300_VAP_VF_CNTL__PRIM_LINE_LOOP; - break; - case GL_TRIANGLES: - type=R300_VAP_VF_CNTL__PRIM_TRIANGLES; - break; - case GL_TRIANGLE_STRIP: - type=R300_VAP_VF_CNTL__PRIM_TRIANGLE_STRIP; - break; - case GL_TRIANGLE_FAN: - type=R300_VAP_VF_CNTL__PRIM_TRIANGLE_FAN; - break; + type = R300_VAP_VF_CNTL__PRIM_LINE_LOOP; + break; + case GL_TRIANGLES: + type = R300_VAP_VF_CNTL__PRIM_TRIANGLES; + break; + case GL_TRIANGLE_STRIP: + type = R300_VAP_VF_CNTL__PRIM_TRIANGLE_STRIP; + break; + case GL_TRIANGLE_FAN: + type = R300_VAP_VF_CNTL__PRIM_TRIANGLE_FAN; + break; case GL_QUADS: - type=R300_VAP_VF_CNTL__PRIM_QUADS; - break; + type = R300_VAP_VF_CNTL__PRIM_QUADS; + break; case GL_QUAD_STRIP: - type=R300_VAP_VF_CNTL__PRIM_QUAD_STRIP; - break; + type = R300_VAP_VF_CNTL__PRIM_QUAD_STRIP; + break; case GL_POLYGON: - type=R300_VAP_VF_CNTL__PRIM_POLYGON; + type = R300_VAP_VF_CNTL__PRIM_POLYGON; break; - default: - fprintf(stderr, "%s:%s Do not know how to handle primitive 0x%04x - help me !\n", - __FILE__, __FUNCTION__, - prim & PRIM_MODE_MASK); + default: + fprintf(stderr, + "%s:%s Do not know how to handle primitive 0x%04x - help me !\n", + __FILE__, __FUNCTION__, prim & PRIM_MODE_MASK); return -1; - break; - } - return type; + break; + } + return type; } static int r300NumVerts(r300ContextPtr rmesa, int num_verts, int prim) { - int verts_off=0; + int verts_off = 0; switch (prim & PRIM_MODE_MASK) { case GL_POINTS: verts_off = 0; - break; + break; case GL_LINES: verts_off = num_verts % 2; - break; + break; case GL_LINE_STRIP: - if(num_verts < 2) + if (num_verts < 2) verts_off = num_verts; - break; + break; case GL_LINE_LOOP: - if(num_verts < 2) + if (num_verts < 2) verts_off = num_verts; - break; - case GL_TRIANGLES: + break; + case GL_TRIANGLES: verts_off = num_verts % 3; - break; - case GL_TRIANGLE_STRIP: - if(num_verts < 3) + break; + case GL_TRIANGLE_STRIP: + if (num_verts < 3) verts_off = num_verts; - break; - case GL_TRIANGLE_FAN: - if(num_verts < 3) + break; + case GL_TRIANGLE_FAN: + if (num_verts < 3) verts_off = num_verts; - break; + break; case GL_QUADS: verts_off = num_verts % 4; - break; + break; case GL_QUAD_STRIP: - if(num_verts < 4) + if (num_verts < 4) verts_off = num_verts; else verts_off = num_verts % 2; - break; + break; case GL_POLYGON: - if(num_verts < 3) + if (num_verts < 3) verts_off = num_verts; break; - default: - fprintf(stderr, "%s:%s Do not know how to handle primitive 0x%04x - help me !\n", - __FILE__, __FUNCTION__, - prim & PRIM_MODE_MASK); + default: + fprintf(stderr, + "%s:%s Do not know how to handle primitive 0x%04x - help me !\n", + __FILE__, __FUNCTION__, prim & PRIM_MODE_MASK); return -1; - break; - } + break; + } if (RADEON_DEBUG & DEBUG_VERTS) { if (num_verts - verts_off == 0) { - WARN_ONCE("user error: Need more than %d vertices to draw primitive 0x%04x !\n", - num_verts, prim & PRIM_MODE_MASK); + WARN_ONCE + ("user error: Need more than %d vertices to draw primitive 0x%04x !\n", + num_verts, prim & PRIM_MODE_MASK); return 0; } if (verts_off > 0) { - WARN_ONCE("user error: %d is not a valid number of vertices for primitive 0x%04x !\n", - num_verts, prim & PRIM_MODE_MASK); + WARN_ONCE + ("user error: %d is not a valid number of vertices for primitive 0x%04x !\n", + num_verts, prim & PRIM_MODE_MASK); } } return num_verts - verts_off; } -static void inline r300FireEB(r300ContextPtr rmesa, unsigned long addr, int vertex_count, int type, int elt_size) +static void inline r300FireEB(r300ContextPtr rmesa, unsigned long addr, + int vertex_count, int type, int elt_size) { int cmd_reserved = 0; int cmd_written = 0; @@ -197,9 +196,9 @@ static void inline r300FireEB(r300ContextPtr rmesa, unsigned long addr, int vert assert(elt_size == 2 || elt_size == 4); - if(addr & (elt_size-1)){ + if (addr & (elt_size - 1)) { WARN_ONCE("Badly aligned buffer\n"); - return ; + return; } magic_1 = (addr % 32) / 4; @@ -209,15 +208,18 @@ static void inline r300FireEB(r300ContextPtr rmesa, unsigned long addr, int vert check_space(6); 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); + 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); } start_packet3(RADEON_CP_PACKET3_INDX_BUFFER, 2); #ifdef OPTIMIZE_ELTS - if(elt_size == 4){ + if (elt_size == 4) { e32(R300_EB_UNK1 | (0 << 16) | R300_EB_UNK2); e32(addr); } else { @@ -229,46 +231,46 @@ static void inline r300FireEB(r300ContextPtr rmesa, unsigned long addr, int vert e32(addr); #endif - if(elt_size == 4){ + if (elt_size == 4) { e32(vertex_count); } else { #ifdef OPTIMIZE_ELTS e32(magic_2); #else - e32((vertex_count+1)/2); + e32((vertex_count + 1) / 2); #endif } } -static void r300RunRenderPrimitive(r300ContextPtr rmesa, - GLcontext *ctx, - int start, - int end, - int prim) +static void r300RunRenderPrimitive(r300ContextPtr rmesa, GLcontext * ctx, + int start, int end, int prim) { - int type, num_verts; - - type=r300PrimitiveType(rmesa, ctx, prim); - num_verts=r300NumVerts(rmesa, end-start, prim); + int type, num_verts; - if(type<0 || num_verts <= 0)return; + type = r300PrimitiveType(rmesa, ctx, prim); + num_verts = r300NumVerts(rmesa, end - start, prim); - if(rmesa->state.VB.Elts){ - r300EmitAOS(rmesa, rmesa->state.aos_count, /*0*/start); - if(num_verts > 65535){ /* not implemented yet */ - WARN_ONCE("Too many elts\n"); + if (type < 0 || num_verts <= 0) return; + + if (rmesa->state.VB.Elts) { + r300EmitAOS(rmesa, rmesa->state.aos_count, /*0 */ 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); + r300FireEB(rmesa, rmesa->state.elt_dma.aos_offset, + num_verts, type, rmesa->state.VB.elt_size); + } else { + r300EmitAOS(rmesa, rmesa->state.aos_count, start); + fire_AOS(rmesa, num_verts, type); } - r300EmitElts(ctx, rmesa->state.VB.Elts, num_verts, rmesa->state.VB.elt_size); - r300FireEB(rmesa, rmesa->state.elt_dma.aos_offset, num_verts, type, rmesa->state.VB.elt_size); - }else{ - r300EmitAOS(rmesa, rmesa->state.aos_count, start); - fire_AOS(rmesa, num_verts, type); - } } -static GLboolean r300RunRender(GLcontext *ctx, - struct tnl_pipeline_stage *stage) +static GLboolean r300RunRender(GLcontext * ctx, + struct tnl_pipeline_stage *stage) { r300ContextPtr rmesa = R300_CONTEXT(ctx); struct radeon_vertex_buffer *VB = &rmesa->state.VB; @@ -277,12 +279,11 @@ static GLboolean r300RunRender(GLcontext *ctx, int cmd_written = 0; drm_radeon_cmd_header_t *cmd = NULL; - if (RADEON_DEBUG & DEBUG_PRIMS) fprintf(stderr, "%s\n", __FUNCTION__); if (stage) { - TNLcontext *tnl = TNL_CONTEXT(ctx); + TNLcontext *tnl = TNL_CONTEXT(ctx); radeon_vb_to_rvb(rmesa, VB, &tnl->vb); } @@ -292,27 +293,29 @@ static GLboolean r300RunRender(GLcontext *ctx, r300UpdateShaderStates(rmesa); - reg_start(R300_RB3D_DSTCACHE_CTLSTAT,0); + reg_start(R300_RB3D_DSTCACHE_CTLSTAT, 0); e32(R300_RB3D_DSTCACHE_UNKNOWN_0A); - reg_start(R300_RB3D_ZCACHE_CTLSTAT,0); + reg_start(R300_RB3D_ZCACHE_CTLSTAT, 0); e32(R300_RB3D_ZCACHE_UNKNOWN_03); r300EmitState(rmesa); - for(i=0; i < VB->PrimitiveCount; i++){ + for (i = 0; i < VB->PrimitiveCount; i++) { GLuint prim = _tnl_translate_prim(&VB->Primitive[i]); GLuint start = VB->Primitive[i].start; GLuint length = VB->Primitive[i].count; - r300RunRenderPrimitive(rmesa, ctx, start, start + length, prim); + r300RunRenderPrimitive(rmesa, ctx, start, start + length, + prim); } - reg_start(R300_RB3D_DSTCACHE_CTLSTAT,0); - e32(R300_RB3D_DSTCACHE_UNKNOWN_0A /*R300_RB3D_DSTCACHE_UNKNOWN_02*/); + reg_start(R300_RB3D_DSTCACHE_CTLSTAT, 0); + e32(R300_RB3D_DSTCACHE_UNKNOWN_0A + /*R300_RB3D_DSTCACHE_UNKNOWN_02 */ ); - reg_start(R300_RB3D_ZCACHE_CTLSTAT,0); - e32(R300_RB3D_ZCACHE_UNKNOWN_03 /*R300_RB3D_ZCACHE_UNKNOWN_01*/); + reg_start(R300_RB3D_ZCACHE_CTLSTAT, 0); + e32(R300_RB3D_ZCACHE_UNKNOWN_03 /*R300_RB3D_ZCACHE_UNKNOWN_01 */ ); #ifdef USER_BUFFERS r300UseArrays(ctx); @@ -331,12 +334,11 @@ static GLboolean r300RunRender(GLcontext *ctx, } \ } while(0) -int r300Fallback(GLcontext *ctx) +int r300Fallback(GLcontext * ctx) { r300ContextPtr r300 = R300_CONTEXT(ctx); - struct r300_fragment_program *fp = - (struct r300_fragment_program *) - (char *)ctx->FragmentProgram._Current; + struct r300_fragment_program *fp = (struct r300_fragment_program *) + (char *)ctx->FragmentProgram._Current; if (fp) { if (!fp->translated) @@ -346,20 +348,22 @@ int r300Fallback(GLcontext *ctx) FALLBACK_IF(ctx->RenderMode != GL_RENDER); - FALLBACK_IF(ctx->Stencil._TestTwoSide && - (ctx->Stencil.Ref[0] != ctx->Stencil.Ref[1] || - ctx->Stencil.ValueMask[0] != ctx->Stencil.ValueMask[1] || - ctx->Stencil.WriteMask[0] != ctx->Stencil.WriteMask[1])); + FALLBACK_IF(ctx->Stencil._TestTwoSide + && (ctx->Stencil.Ref[0] != ctx->Stencil.Ref[1] + || ctx->Stencil.ValueMask[0] != + ctx->Stencil.ValueMask[1] + || ctx->Stencil.WriteMask[0] != + ctx->Stencil.WriteMask[1])); /* GL_COLOR_LOGIC_OP */ FALLBACK_IF(ctx->Color.ColorLogicOpEnabled); /* GL_POINT_SPRITE_ARB, GL_POINT_SPRITE_NV */ - if (ctx->Extensions.NV_point_sprite || - ctx->Extensions.ARB_point_sprite) + if (ctx->Extensions.NV_point_sprite + || ctx->Extensions.ARB_point_sprite) FALLBACK_IF(ctx->Point.PointSprite); - if(!r300->disable_lowimpact_fallback){ + if (!r300->disable_lowimpact_fallback) { /* GL_POLYGON_OFFSET_POINT */ FALLBACK_IF(ctx->Polygon.OffsetPoint); /* GL_POLYGON_OFFSET_LINE */ @@ -385,8 +389,8 @@ int r300Fallback(GLcontext *ctx) * rasterization) or false to indicate that the pipeline has finished * after we render something. */ -static GLboolean r300RunNonTNLRender(GLcontext *ctx, - struct tnl_pipeline_stage *stage) +static GLboolean r300RunNonTNLRender(GLcontext * ctx, + struct tnl_pipeline_stage *stage) { if (RADEON_DEBUG & DEBUG_PRIMS) fprintf(stderr, "%s\n", __FUNCTION__); @@ -397,18 +401,18 @@ static GLboolean r300RunNonTNLRender(GLcontext *ctx, return r300RunRender(ctx, stage); } -static GLboolean r300RunTCLRender(GLcontext *ctx, - struct tnl_pipeline_stage *stage) +static GLboolean r300RunTCLRender(GLcontext * ctx, + struct tnl_pipeline_stage *stage) { r300ContextPtr rmesa = R300_CONTEXT(ctx); struct r300_vertex_program *vp; - hw_tcl_on=future_hw_tcl_on; + hw_tcl_on = future_hw_tcl_on; if (RADEON_DEBUG & DEBUG_PRIMS) fprintf(stderr, "%s\n", __FUNCTION__); - if(hw_tcl_on == GL_FALSE) + if (hw_tcl_on == GL_FALSE) return GL_TRUE; if (r300Fallback(ctx) >= R300_FALLBACK_TCL) { -- cgit v1.2.3 From 377ce9e074632d99d7b12f17a6e535971f755ba3 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Tue, 8 May 2007 19:35:36 +0000 Subject: r300: Merged some comments into the Doxygen documentation. --- src/mesa/drivers/dri/r300/r300_render.c | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index db6b77a0c22..628a9fb42d1 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -32,6 +32,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * The immediate implementation has been removed from CVS in favor of the vertex * buffer implementation. * + * The render functions are called by the pipeline manager to render a batch of + * primitives. They return TRUE to pass on to the next stage (i.e. software + * rasterization) or FALSE to indicate that the pipeline has finished after + * rendering something. + * * When falling back to software TCL still attempt to use hardware * rasterization. * @@ -254,8 +259,8 @@ static void r300RunRenderPrimitive(r300ContextPtr rmesa, GLcontext * ctx, return; if (rmesa->state.VB.Elts) { - r300EmitAOS(rmesa, rmesa->state.aos_count, /*0 */ start); - if (num_verts > 65535) { /* not implemented yet */ + r300EmitAOS(rmesa, rmesa->state.aos_count, start); + if (num_verts > 65535) { WARN_ONCE("Too many elts\n"); return; } @@ -311,11 +316,10 @@ static GLboolean r300RunRender(GLcontext * ctx, } reg_start(R300_RB3D_DSTCACHE_CTLSTAT, 0); - e32(R300_RB3D_DSTCACHE_UNKNOWN_0A - /*R300_RB3D_DSTCACHE_UNKNOWN_02 */ ); + e32(R300_RB3D_DSTCACHE_UNKNOWN_0A); reg_start(R300_RB3D_ZCACHE_CTLSTAT, 0); - e32(R300_RB3D_ZCACHE_UNKNOWN_03 /*R300_RB3D_ZCACHE_UNKNOWN_01 */ ); + e32(R300_RB3D_ZCACHE_UNKNOWN_03); #ifdef USER_BUFFERS r300UseArrays(ctx); @@ -355,40 +359,25 @@ int r300Fallback(GLcontext * ctx) || ctx->Stencil.WriteMask[0] != ctx->Stencil.WriteMask[1])); - /* GL_COLOR_LOGIC_OP */ FALLBACK_IF(ctx->Color.ColorLogicOpEnabled); - /* GL_POINT_SPRITE_ARB, GL_POINT_SPRITE_NV */ if (ctx->Extensions.NV_point_sprite || ctx->Extensions.ARB_point_sprite) FALLBACK_IF(ctx->Point.PointSprite); if (!r300->disable_lowimpact_fallback) { - /* GL_POLYGON_OFFSET_POINT */ FALLBACK_IF(ctx->Polygon.OffsetPoint); - /* GL_POLYGON_OFFSET_LINE */ FALLBACK_IF(ctx->Polygon.OffsetLine); - /* GL_POLYGON_STIPPLE */ FALLBACK_IF(ctx->Polygon.StippleFlag); - /* GL_MULTISAMPLE */ FALLBACK_IF(ctx->Multisample.Enabled); - /* GL_LINE_STIPPLE */ FALLBACK_IF(ctx->Line.StippleFlag); - /* GL_LINE_SMOOTH */ FALLBACK_IF(ctx->Line.SmoothFlag); - /* GL_POINT_SMOOTH */ FALLBACK_IF(ctx->Point.SmoothFlag); } return R300_FALLBACK_NONE; } -/** - * Called by the pipeline manager to render a batch of primitives. - * We can return true to pass on to the next stage (i.e. software - * rasterization) or false to indicate that the pipeline has finished - * after we render something. - */ static GLboolean r300RunNonTNLRender(GLcontext * ctx, struct tnl_pipeline_stage *stage) { -- cgit v1.2.3 From 73bc8b63ac2206a1c1dfd02891493db6e747a36f Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Tue, 8 May 2007 19:38:44 +0000 Subject: r300: Last few r300_render.c clean up. --- src/mesa/drivers/dri/r300/r300_render.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 628a9fb42d1..0e585855e99 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -196,8 +196,7 @@ static void inline r300FireEB(r300ContextPtr rmesa, unsigned long addr, drm_radeon_cmd_header_t *cmd = NULL; unsigned long t_addr; unsigned long magic_1, magic_2; - GLcontext *ctx; - ctx = rmesa->radeon.glCtx; + GLcontext *ctx = rmesa->radeon.glCtx; assert(elt_size == 2 || elt_size == 4); @@ -207,7 +206,7 @@ static void inline r300FireEB(r300ContextPtr rmesa, unsigned long addr, } magic_1 = (addr % 32) / 4; - t_addr = addr & (~0x1d); + t_addr = addr & ~0x1d; magic_2 = (vertex_count + 1 + (t_addr & 0x2)) / 2 + magic_1; check_space(6); -- cgit v1.2.3 From d132f7245deabc8bdb7effafcb489df4cee59f2e Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Tue, 8 May 2007 19:46:25 +0000 Subject: r300: Removed some deprecated code from r300_context.c and corrected an unused variable warning in r300_render.c. --- src/mesa/drivers/dri/r300/r300_context.c | 6 ------ src/mesa/drivers/dri/r300/r300_render.c | 1 - 2 files changed, 7 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 265b8defd84..21750aab33c 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -355,12 +355,6 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, radeon_init_vtxfmt_a(r300); #endif -#if 0 - /* plug in a few more device driver functions */ - /* XXX these should really go right after _mesa_init_driver_functions() */ - r300InitPixelFuncs(ctx); - r300InitSwtcl(ctx); -#endif TNL_CONTEXT(ctx)->Driver.RunPipeline = _tnl_run_pipeline; tcl_mode = driQueryOptioni(&r300->radeon.optionCache, "tcl_mode"); diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 0e585855e99..be10a185875 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -196,7 +196,6 @@ static void inline r300FireEB(r300ContextPtr rmesa, unsigned long addr, drm_radeon_cmd_header_t *cmd = NULL; unsigned long t_addr; unsigned long magic_1, magic_2; - GLcontext *ctx = rmesa->radeon.glCtx; assert(elt_size == 2 || elt_size == 4); -- cgit v1.2.3 From 58eaf0accaa38f6e02d7af928ea0851cb4ae91cd Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 8 May 2007 13:48:52 -0600 Subject: a somewhat nicer demo w/ command line options --- progs/miniglx/miniglxtest.c | 244 +++++++++++++++++++++++++++++--------------- 1 file changed, 163 insertions(+), 81 deletions(-) diff --git a/progs/miniglx/miniglxtest.c b/progs/miniglx/miniglxtest.c index ecc5786b73a..4c5118f3684 100644 --- a/progs/miniglx/miniglxtest.c +++ b/progs/miniglx/miniglxtest.c @@ -1,5 +1,3 @@ -/* $Id: miniglxtest.c,v 1.3 2004/03/25 14:58:39 brianp Exp $ */ - /* * Test the mini GLX interface. */ @@ -7,6 +5,7 @@ #include #include +#include #include #include #define USE_MINI_GLX 1 @@ -15,91 +14,88 @@ #else #include #endif +#include "../util/writebuf.c" -#define FRONTBUFFER 1 -#define NR 6 -#define DO_SLEEPS 1 -#define NR_DISPLAYS 2 +static GLXContext ctx; -GLXContext ctx; +static GLuint NumFrames = 100; +static GLuint NumDisplays = 1; +static GLboolean Texture = GL_FALSE; +static GLboolean SingleBuffer = GL_FALSE; +static GLboolean Sleeps = GL_TRUE; -static void _subset_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ) +static void +rect(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) { - glBegin( GL_QUADS ); - glVertex2f( x1, y1 ); - glVertex2f( x2, y1 ); - glVertex2f( x2, y2 ); - glVertex2f( x1, y2 ); + glBegin(GL_QUADS); + glTexCoord2f(0, 0); glColor3f(0, 0, 1); glVertex2f(x1, y1); + glTexCoord2f(1, 0); glColor3f(1, 0, 0); glVertex2f(x2, y1); + glTexCoord2f(1, 1); glColor3f(0, 1, 0); glVertex2f(x2, y2); + glTexCoord2f(0, 1); glColor3f(0, 0, 0); glVertex2f(x1, y2); glEnd(); } - -static void redraw( Display *dpy, Window w, int rot ) +static void +redraw(Display *dpy, Window w, int rot) { - printf("Redraw event\n"); - -#if FRONTBUFFER - glDrawBuffer( GL_FRONT ); -#else -/* glDrawBuffer( GL_BACK ); */ -#endif + GLfloat a; - glClearColor( rand()/(float)RAND_MAX, - rand()/(float)RAND_MAX, - rand()/(float)RAND_MAX, - 1); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glClear( GL_COLOR_BUFFER_BIT ); - -#if 1 - glColor3f( rand()/(float)RAND_MAX, - rand()/(float)RAND_MAX, - rand()/(float)RAND_MAX ); glPushMatrix(); - glRotatef(rot, 0, 0, 1); - glScalef(.5, .5, .5); - _subset_Rectf( -1, -1, 1, 1 ); + glRotatef(rot, 0, 0, 1); + glScalef(.5, .5, .5); + for (a = 0.0; a < 360.0; a += 30.0) { + glPushMatrix(); + glRotatef(a, 0, 0, 1); + glRotatef(40, 1, 0, 0); + glColor3f(a / 360.0, 1-a/360.0, 0); + rect(0.3, -0.25, 1.5, 0.25); + glPopMatrix(); + } glPopMatrix(); -#endif -#if FRONTBUFFER - glFlush(); -#else - glXSwapBuffers( dpy, w ); -#endif - glFinish(); + if (SingleBuffer) + glFlush(); + else + glXSwapBuffers(dpy, w); } -static Window make_rgb_db_window( Display *dpy, - unsigned int width, unsigned int height ) +static Window +make_window(Display *dpy, unsigned int width, unsigned int height) { - int attrib[] = { GLX_RGBA, - GLX_RED_SIZE, 1, - GLX_GREEN_SIZE, 1, - GLX_BLUE_SIZE, 1, -#if !FRONTBUFFER - GLX_DOUBLEBUFFER, -#endif - None }; - int scrnum; + int attrib_single[] = { GLX_RGBA, + GLX_RED_SIZE, 1, + GLX_GREEN_SIZE, 1, + GLX_BLUE_SIZE, 1, + GLX_DEPTH_SIZE, 1, + None }; + int attrib_double[] = { GLX_RGBA, + GLX_RED_SIZE, 1, + GLX_GREEN_SIZE, 1, + GLX_BLUE_SIZE, 1, + GLX_DEPTH_SIZE, 1, + GLX_DOUBLEBUFFER, + None }; + int *attrib = SingleBuffer ? attrib_single : attrib_double; + int scrnum = 0; XSetWindowAttributes attr; unsigned long mask; Window root; Window win; XVisualInfo *visinfo; - scrnum = 0; - root = RootWindow( dpy, scrnum ); + root = RootWindow(dpy, scrnum); - if (!(visinfo = glXChooseVisual( dpy, scrnum, attrib ))) { + if (!(visinfo = glXChooseVisual(dpy, scrnum, attrib))) { printf("Error: couldn't get an RGB, Double-buffered visual\n"); exit(1); } - if(!(ctx = glXCreateContext( dpy, visinfo, NULL, True ))) { + if (!(ctx = glXCreateContext(dpy, visinfo, NULL, True))) { printf("Error: glXCreateContext failed\n"); exit(1); } @@ -107,19 +103,19 @@ static Window make_rgb_db_window( Display *dpy, /* window attributes */ attr.background_pixel = 0; attr.border_pixel = 0; - attr.colormap = XCreateColormap( dpy, root, visinfo->visual, AllocNone); + attr.colormap = XCreateColormap(dpy, root, visinfo->visual, AllocNone); attr.event_mask = StructureNotifyMask | ExposureMask; mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask; - win = XCreateWindow( dpy, root, 0, 0, width, height, + win = XCreateWindow(dpy, root, 0, 0, width, height, 0, visinfo->depth, InputOutput, - visinfo->visual, mask, &attr ); + visinfo->visual, mask, &attr); if (!win) { printf("Error: XCreateWindow failed\n"); exit(1); } - glXMakeCurrent( dpy, win, ctx ); + glXMakeCurrent(dpy, win, ctx); glViewport(0, 0, width, height); @@ -127,22 +123,28 @@ static Window make_rgb_db_window( Display *dpy, } -static void event_loop( Display *dpy, Window win ) +static void +event_loop(Display *dpy, Window win) { int i; - printf("Hang on... drawing %d frames\n", NR); - for (i = 0; i < NR; i++) { - redraw( dpy, win, i*10 ); - if (DO_SLEEPS) { - printf("sleep(1)\n"); - sleep(1); + printf("Drawing %d frames\n", NumFrames); + + for (i = 0; i < NumFrames; i++) { + redraw(dpy, win, -i*2); + if (i == 1) { + glReadBuffer(GL_BACK); + WritePPMFile("frame1.ppm", 800,600); + } + if (Sleeps) { + usleep(20000); } } } -static int foo( void ) +static int +runtest(void) { Display *dpy; Window win; @@ -153,41 +155,121 @@ static int foo( void ) return 1; } - win = make_rgb_db_window( dpy, 800, 600); + win = make_window(dpy, 800, 600); srand(getpid()); - glShadeModel( GL_FLAT ); - glClearColor( 0.5, 0.5, 0.5, 1.0 ); + /* init GL state */ + glClearColor(0.5, 0.5, 0.5, 1.0); + glEnable(GL_DEPTH_TEST); + if (Texture) { + GLubyte image[16][16][4]; + GLint i, j; + for (i = 0; i < 16; i++) { + for (j = 0; j < 16; j++) { + if (((i / 2) ^ (j / 2)) & 1) { + image[i][j][0] = 255; + image[i][j][1] = 255; + image[i][j][2] = 255; + image[i][j][3] = 255; + } + else { + image[i][j][0] = 128; + image[i][j][1] = 128; + image[i][j][2] = 128; + image[i][j][3] = 128; + } + } + } + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, + GL_RGBA, GL_UNSIGNED_BYTE, image); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glEnable(GL_TEXTURE_2D); + } + if (SingleBuffer) { + glDrawBuffer(GL_FRONT); + glReadBuffer(GL_FRONT); + } + else { + glDrawBuffer(GL_BACK); + } - XMapWindow( dpy, win ); + XMapWindow(dpy, win); + /* wait for window to get mapped */ { XEvent e; while (1) { - XNextEvent( dpy, &e ); + XNextEvent(dpy, &e); if (e.type == MapNotify && e.xmap.window == win) { break; } } } - event_loop( dpy, win ); + event_loop(dpy, win); - glXDestroyContext( dpy, ctx ); - XDestroyWindow( dpy, win ); + glXDestroyContext(dpy, ctx); + XDestroyWindow(dpy, win); - XCloseDisplay( dpy ); + XCloseDisplay(dpy); return 0; } -int main() +static void +usage(void) +{ + printf("Usage:\n"); + printf(" -f N render N frames (default %d)\n", NumFrames); + printf(" -d N do N display cycles\n"); + printf(" -t texturing\n"); + printf(" -s single buffering\n"); + printf(" -n no usleep() delay\n"); +} + + +static void +parse_args(int argc, char *argv[]) { int i; - for (i = 0 ; i < NR_DISPLAYS ; i++) { - if (foo() != 0) + for (i = 1; i < argc; i++) { + if (strcmp(argv[i], "-f") == 0) { + NumFrames = atoi(argv[i + 1]); + i++; + } + else if (strcmp(argv[i], "-d") == 0) { + NumDisplays = atoi(argv[i + 1]); + i++; + } + else if (strcmp(argv[i], "-n") == 0) { + Sleeps = GL_FALSE; + } + else if (strcmp(argv[i], "-s") == 0) { + SingleBuffer = GL_TRUE; + } + else if (strcmp(argv[i], "-t") == 0) { + Texture = GL_TRUE; + } + else { + usage(); + exit(1); + } + } +} + + +int +main(int argc, char *argv[]) +{ + int i; + + parse_args(argc, argv); + + for (i = 0; i < NumDisplays; i++) { + if (runtest() != 0) break; } -- cgit v1.2.3 From ed2fddc98ef017d8b6460e326d08ce2635458812 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 8 May 2007 14:03:04 -0600 Subject: special case for -pthread (bug 10876) --- bin/mklib | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/mklib b/bin/mklib index 09f4fac9e51..21d48edd771 100755 --- a/bin/mklib +++ b/bin/mklib @@ -100,6 +100,10 @@ do -L*) DEPS="$DEPS $1" ;; + -pthread) + # this is a special case (see bugzilla 10876) + DEPS="$DEPS $1" + ;; '-cplusplus') CPLUSPLUS=1 ;; -- cgit v1.2.3 From da37ac5ee7b8207e08f2f8dafbc27f02a9fa51c3 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 8 May 2007 14:08:45 -0600 Subject: remove some debug code --- progs/miniglx/miniglxtest.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/progs/miniglx/miniglxtest.c b/progs/miniglx/miniglxtest.c index 4c5118f3684..85c25be4ed5 100644 --- a/progs/miniglx/miniglxtest.c +++ b/progs/miniglx/miniglxtest.c @@ -14,7 +14,6 @@ #else #include #endif -#include "../util/writebuf.c" static GLXContext ctx; @@ -132,10 +131,6 @@ event_loop(Display *dpy, Window win) for (i = 0; i < NumFrames; i++) { redraw(dpy, win, -i*2); - if (i == 1) { - glReadBuffer(GL_BACK); - WritePPMFile("frame1.ppm", 800,600); - } if (Sleeps) { usleep(20000); } -- cgit v1.2.3 From c578354642b87125d28fd7c46e4e8e734dd0492f Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Tue, 8 May 2007 21:04:57 +0000 Subject: r300: Renamed the VBO functions to the R300 name format. --- src/mesa/drivers/dri/r300/r300_context.c | 2 +- src/mesa/drivers/dri/r300/r300_context.h | 4 ++-- src/mesa/drivers/dri/r300/r300_ioctl.c | 2 +- src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 21750aab33c..dd348e223c2 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -215,7 +215,7 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, #endif #ifdef HW_VBOS if (hw_tcl_on) { - r300_init_vbo_funcs(&functions); + r300InitVBOFuncs(&functions); } #endif if (!radeonInitContext(&r300->radeon, &functions, diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index afdfc29e433..78e0b1ac9d0 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -929,8 +929,8 @@ extern void radeon_init_vtxfmt_a(r300ContextPtr rmesa); #endif #ifdef HW_VBOS -extern void r300_init_vbo_funcs(struct dd_function_table *functions); -extern void r300_evict_vbos(GLcontext *ctx, int amount); +extern void r300InitVBOFuncs(struct dd_function_table *functions); +extern void r300EvictVBOs(GLcontext *ctx, int amount); #endif #define RADEON_D_CAPTURE 0 diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index 82414259df9..1b73389600b 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -442,7 +442,7 @@ static void r300RefillCurrentDmaRegion(r300ContextPtr rmesa, int size) #ifdef HW_VBOS if (dmabuf->id == 0) { /* Just kick all */ - r300_evict_vbos(rmesa->radeon.glCtx, /*RADEON_BUFFER_SIZE*16*/1<<30); + r300EvictVBOs(rmesa->radeon.glCtx, /*RADEON_BUFFER_SIZE*16*/1<<30); dmabuf->id = radeon_mm_alloc(rmesa, 4, size); } #endif diff --git a/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c b/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c index 9a5173cad1a..a15a17d1d33 100644 --- a/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c +++ b/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c @@ -618,7 +618,7 @@ static void r300DeleteBuffer(GLcontext *ctx, struct gl_buffer_object *obj) _mesa_delete_buffer_object(ctx, obj); } -void r300_evict_vbos(GLcontext *ctx, int amount) +void r300EvictVBOs(GLcontext *ctx, int amount) { r300ContextPtr rmesa = R300_CONTEXT(ctx); struct _mesa_HashTable *hash = ctx->Shared->BufferObjects; @@ -649,7 +649,7 @@ void r300_evict_vbos(GLcontext *ctx, int amount) } -void r300_init_vbo_funcs(struct dd_function_table *functions) +void r300InitVBOFuncs(struct dd_function_table *functions) { functions->NewBufferObject = r300NewBufferObject; functions->BufferData = r300BufferData; -- cgit v1.2.3 From f5b0cafbb11d911949a059688c0dd05e3c5c10b8 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 02:18:29 +0000 Subject: r300: Removed obsolete pixel_shader.h header file. --- src/mesa/drivers/dri/r300/pixel_shader.h | 103 ------------------------------- 1 file changed, 103 deletions(-) delete mode 100644 src/mesa/drivers/dri/r300/pixel_shader.h diff --git a/src/mesa/drivers/dri/r300/pixel_shader.h b/src/mesa/drivers/dri/r300/pixel_shader.h deleted file mode 100644 index 0d04859f9b8..00000000000 --- a/src/mesa/drivers/dri/r300/pixel_shader.h +++ /dev/null @@ -1,103 +0,0 @@ -#ifndef __PIXEL_SHADER_H__ -#define __PIXEL_SHADER_H__ - -#include "r300_reg.h" - - -/* INSTR 0 */ - -#define PFS_OP_MAD 0 -#define PFS_OP_DP3 1 -#define PFS_OP_DP4 2 -#define PFS_OP_MIN 4 -#define PFS_OP_MAX 5 -#define PFS_OP_CMP 8 -#define PFS_OP_FRC 9 -#define PFS_OP_OUTC_REPL_ALPHA 10 - -/* "or" these with arg0 value to negate or take absolute value of an argument */ -#define PFS_ARG_NEG (1<<5) -#define PFS_ARG_ABS (1<<6) - -#define MAKE_PFS_INSTR0(op, arg0, arg1, arg2, flags) \ - ( ((op)<<23) \ - | ((arg0)< Date: Wed, 9 May 2007 02:24:59 +0000 Subject: r300: Renamed vertex_shader.h to r300_vertprog.h --- src/mesa/drivers/dri/r300/r300_context.h | 2 +- src/mesa/drivers/dri/r300/r300_vertprog.h | 90 ++++++++++++++++++++++++++++++ src/mesa/drivers/dri/r300/vertex_shader.h | 92 ------------------------------- 3 files changed, 91 insertions(+), 93 deletions(-) create mode 100644 src/mesa/drivers/dri/r300/r300_vertprog.h delete mode 100644 src/mesa/drivers/dri/r300/vertex_shader.h diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 78e0b1ac9d0..e26d563a47b 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -95,7 +95,7 @@ typedef struct r300_context *r300ContextPtr; /* We should probably change types within vertex_shader and pixel_shader structure later on */ #define CARD32 GLuint -#include "vertex_shader.h" +#include "r300_vertprog.h" #include "r300_fragprog.h" #undef CARD32 diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.h b/src/mesa/drivers/dri/r300/r300_vertprog.h new file mode 100644 index 00000000000..55a215a4e84 --- /dev/null +++ b/src/mesa/drivers/dri/r300/r300_vertprog.h @@ -0,0 +1,90 @@ +#ifndef __R300_VERTPROG_H_ +#define __R300_VERTPROG_H_ + +typedef struct { + CARD32 op; + CARD32 src1; + CARD32 src2; + CARD32 src3; + } VERTEX_SHADER_INSTRUCTION; + +#define VSF_FLAG_X 1 +#define VSF_FLAG_Y 2 +#define VSF_FLAG_Z 4 +#define VSF_FLAG_W 8 +#define VSF_FLAG_XYZ (VSF_FLAG_X | VSF_FLAG_Y | VSF_FLAG_Z) +#define VSF_FLAG_ALL 0xf +#define VSF_FLAG_NONE 0 + +#define VSF_OUT_CLASS_TMP 0 +#define VSF_OUT_CLASS_ADDR 1 +#define VSF_OUT_CLASS_RESULT 2 + + +/* first CARD32 of an instruction */ + +/* possible operations: + DOT, MUL, ADD, MAD, FRC, MAX, MIN, SGE, SLT, EXP, LOG, LIT, POW, RCP, RSQ, EX2, + LG2, MAD_2 */ + +#define MAKE_VSF_OP(op, out_reg_index, out_reg_fields, class) \ + ((op) \ + | ((out_reg_index) << R300_VPI_OUT_REG_INDEX_SHIFT) \ + | ((out_reg_fields) << 20) \ + | ( (class) << 8 ) ) + +#define EASY_VSF_OP(op, out_reg_index, out_reg_fields, class) \ + MAKE_VSF_OP(R300_VPI_OUT_OP_##op, out_reg_index, VSF_FLAG_##out_reg_fields, VSF_OUT_CLASS_##class) \ + +/* according to Nikolai, the subsequent 3 CARD32 are sources, use same define for each */ + +#define VSF_IN_CLASS_TMP 0 +#define VSF_IN_CLASS_ATTR 1 +#define VSF_IN_CLASS_PARAM 2 +#define VSF_IN_CLASS_NONE 9 + +#define VSF_IN_COMPONENT_X 0 +#define VSF_IN_COMPONENT_Y 1 +#define VSF_IN_COMPONENT_Z 2 +#define VSF_IN_COMPONENT_W 3 +#define VSF_IN_COMPONENT_ZERO 4 +#define VSF_IN_COMPONENT_ONE 5 + +#define MAKE_VSF_SOURCE(in_reg_index, comp_x, comp_y, comp_z, comp_w, class, negate) \ + ( ((in_reg_index)< Date: Wed, 9 May 2007 02:27:08 +0000 Subject: r300: Removed the ugly CARD32 type. --- src/mesa/drivers/dri/r300/r300_context.h | 4 ---- src/mesa/drivers/dri/r300/r300_vertprog.h | 14 +++++++------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index e26d563a47b..0473bc23be8 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -92,12 +92,8 @@ typedef struct r300_context *r300ContextPtr; #define WARN_ONCE(a, ...) {} #endif - /* We should probably change types within vertex_shader - and pixel_shader structure later on */ -#define CARD32 GLuint #include "r300_vertprog.h" #include "r300_fragprog.h" -#undef CARD32 static __inline__ uint32_t r300PackFloat32(float fl) { diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.h b/src/mesa/drivers/dri/r300/r300_vertprog.h index 55a215a4e84..433e98960bc 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.h +++ b/src/mesa/drivers/dri/r300/r300_vertprog.h @@ -2,11 +2,11 @@ #define __R300_VERTPROG_H_ typedef struct { - CARD32 op; - CARD32 src1; - CARD32 src2; - CARD32 src3; - } VERTEX_SHADER_INSTRUCTION; + GLuint op; + GLuint src1; + GLuint src2; + GLuint src3; +} VERTEX_SHADER_INSTRUCTION; #define VSF_FLAG_X 1 #define VSF_FLAG_Y 2 @@ -21,7 +21,7 @@ typedef struct { #define VSF_OUT_CLASS_RESULT 2 -/* first CARD32 of an instruction */ +/* first DWORD of an instruction */ /* possible operations: DOT, MUL, ADD, MAD, FRC, MAX, MIN, SGE, SLT, EXP, LOG, LIT, POW, RCP, RSQ, EX2, @@ -36,7 +36,7 @@ typedef struct { #define EASY_VSF_OP(op, out_reg_index, out_reg_fields, class) \ MAKE_VSF_OP(R300_VPI_OUT_OP_##op, out_reg_index, VSF_FLAG_##out_reg_fields, VSF_OUT_CLASS_##class) \ -/* according to Nikolai, the subsequent 3 CARD32 are sources, use same define for each */ +/* according to Nikolai, the subsequent 3 DWORDs are sources, use same define for each */ #define VSF_IN_CLASS_TMP 0 #define VSF_IN_CLASS_ATTR 1 -- cgit v1.2.3 From 59494bafb482b30f3eef468d6f11396418a09a15 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 02:35:07 +0000 Subject: r300: Use an array for the vertex program sources and corrected an error from 4960af08ad50a3a6ea039145de2698234c2cc892. --- src/mesa/drivers/dri/r300/r300_state.c | 6 +- src/mesa/drivers/dri/r300/r300_vertprog.c | 156 +++++++++++++++--------------- src/mesa/drivers/dri/r300/r300_vertprog.h | 6 +- 3 files changed, 84 insertions(+), 84 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 3e06c44381a..96678b82a2e 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1573,9 +1573,9 @@ static void r300GenerateSimpleVertexShader(r300ContextPtr r300) #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].src1=(source1); \ - r300->state.vertex_shader.program.body.i[r300->state.vertex_shader.program_end].src2=(source2); \ - r300->state.vertex_shader.program.body.i[r300->state.vertex_shader.program_end].src3=(source3); \ + 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++; \ } diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index e8917980ba5..486a3f2f040 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -468,13 +468,13 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, u_temp_i, VSF_FLAG_ALL, VSF_OUT_CLASS_TMP); - o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[2]), + o_inst->src[0]=MAKE_VSF_SOURCE(t_src_index(vp, &src[2]), SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W, t_src_class(src[2].File), VSF_FLAG_NONE) | (src[2].RelAddr << 4); - o_inst->src2=ZERO_SRC_2; - o_inst->src3=ZERO_SRC_2; + o_inst->src[1]=ZERO_SRC_2; + o_inst->src[2]=ZERO_SRC_2; o_inst++; src[2].File=PROGRAM_TEMPORARY; @@ -490,13 +490,13 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, u_temp_i, VSF_FLAG_ALL, VSF_OUT_CLASS_TMP); - o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), + o_inst->src[0]=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W, t_src_class(src[0].File), VSF_FLAG_NONE) | (src[0].RelAddr << 4); - o_inst->src2=ZERO_SRC_0; - o_inst->src3=ZERO_SRC_0; + o_inst->src[1]=ZERO_SRC_0; + o_inst->src[2]=ZERO_SRC_0; o_inst++; src[0].File=PROGRAM_TEMPORARY; @@ -511,9 +511,9 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct case OPCODE_POW: o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_POW, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - o_inst->src1=t_src_scalar(vp, &src[0]); - o_inst->src2=ZERO_SRC_0; - o_inst->src3=t_src_scalar(vp, &src[1]); + o_inst->src[0]=t_src_scalar(vp, &src[0]); + o_inst->src[1]=ZERO_SRC_0; + o_inst->src[2]=t_src_scalar(vp, &src[1]); goto next; case OPCODE_MOV://ADD RESULT 1.X Y Z W PARAM 0{} {X Y Z W} PARAM 0{} {ZERO ZERO ZERO ZERO} @@ -521,17 +521,17 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct #if 1 o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - o_inst->src1=t_src(vp, &src[0]); - o_inst->src2=ZERO_SRC_0; - o_inst->src3=ZERO_SRC_0; + o_inst->src[0]=t_src(vp, &src[0]); + o_inst->src[1]=ZERO_SRC_0; + o_inst->src[2]=ZERO_SRC_0; #else hw_op=(src[0].File == PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 : R300_VPI_OUT_OP_MAD; o_inst->op=MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - o_inst->src1=t_src(vp, &src[0]); - o_inst->src2=ONE_SRC_0; - o_inst->src3=ZERO_SRC_0; + o_inst->src[0]=t_src(vp, &src[0]); + o_inst->src[1]=ONE_SRC_0; + o_inst->src[2]=ZERO_SRC_0; #endif goto next; @@ -543,15 +543,15 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct o_inst->op=MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - o_inst->src1=ONE_SRC_0; - o_inst->src2=t_src(vp, &src[0]); - o_inst->src3=t_src(vp, &src[1]); + o_inst->src[0]=ONE_SRC_0; + o_inst->src[1]=t_src(vp, &src[0]); + o_inst->src[2]=t_src(vp, &src[1]); #else o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - o_inst->src1=t_src(vp, &src[0]); - o_inst->src2=t_src(vp, &src[1]); - o_inst->src3=ZERO_SRC_1; + o_inst->src[0]=t_src(vp, &src[0]); + o_inst->src[1]=t_src(vp, &src[1]); + o_inst->src[2]=ZERO_SRC_1; #endif goto next; @@ -563,9 +563,9 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct o_inst->op=MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - o_inst->src1=t_src(vp, &src[0]); - o_inst->src2=t_src(vp, &src[1]); - o_inst->src3=t_src(vp, &src[2]); + o_inst->src[0]=t_src(vp, &src[0]); + o_inst->src[1]=t_src(vp, &src[1]); + o_inst->src[2]=t_src(vp, &src[2]); goto next; case OPCODE_MUL: /* HW mul can take third arg but appears to have some other limitations. */ @@ -574,17 +574,17 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct o_inst->op=MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - o_inst->src1=t_src(vp, &src[0]); - o_inst->src2=t_src(vp, &src[1]); + o_inst->src[0]=t_src(vp, &src[0]); + o_inst->src[1]=t_src(vp, &src[1]); - o_inst->src3=ZERO_SRC_1; + o_inst->src[2]=ZERO_SRC_1; goto next; case OPCODE_DP3://DOT RESULT 1.X Y Z W PARAM 0{} {X Y Z ZERO} PARAM 0{} {X Y Z ZERO} o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_DOT, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), + o_inst->src[0]=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), t_swizzle(GET_SWZ(src[0].Swizzle, 0)), t_swizzle(GET_SWZ(src[0].Swizzle, 1)), t_swizzle(GET_SWZ(src[0].Swizzle, 2)), @@ -592,7 +592,7 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct t_src_class(src[0].File), src[0].NegateBase ? VSF_FLAG_XYZ : VSF_FLAG_NONE) | (src[0].RelAddr << 4); - o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]), + o_inst->src[1]=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]), t_swizzle(GET_SWZ(src[1].Swizzle, 0)), t_swizzle(GET_SWZ(src[1].Swizzle, 1)), t_swizzle(GET_SWZ(src[1].Swizzle, 2)), @@ -600,7 +600,7 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct t_src_class(src[1].File), src[1].NegateBase ? VSF_FLAG_XYZ : VSF_FLAG_NONE) | (src[1].RelAddr << 4); - o_inst->src3=ZERO_SRC_1; + o_inst->src[2]=ZERO_SRC_1; goto next; case OPCODE_SUB://ADD RESULT 1.X Y Z W TMP 0{} {X Y Z W} PARAM 1{X Y Z W } {X Y Z W} neg Xneg Yneg Zneg W @@ -610,9 +610,9 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct o_inst->op=MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - o_inst->src1=t_src(vp, &src[0]); - o_inst->src2=ONE_SRC_0; - o_inst->src3=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]), + o_inst->src[0]=t_src(vp, &src[0]); + o_inst->src[1]=ONE_SRC_0; + o_inst->src[2]=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]), t_swizzle(GET_SWZ(src[1].Swizzle, 0)), t_swizzle(GET_SWZ(src[1].Swizzle, 1)), t_swizzle(GET_SWZ(src[1].Swizzle, 2)), @@ -623,15 +623,15 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - o_inst->src1=t_src(vp, &src[0]); - o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]), + o_inst->src[0]=t_src(vp, &src[0]); + o_inst->src[1]=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]), t_swizzle(GET_SWZ(src[1].Swizzle, 0)), t_swizzle(GET_SWZ(src[1].Swizzle, 1)), t_swizzle(GET_SWZ(src[1].Swizzle, 2)), t_swizzle(GET_SWZ(src[1].Swizzle, 3)), t_src_class(src[1].File), (!src[1].NegateBase) ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[1].RelAddr << 4); - o_inst->src3=0; + o_inst->src[2]=0; #endif goto next; @@ -639,15 +639,15 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_MAX, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - o_inst->src1=t_src(vp, &src[0]); - o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), + o_inst->src[0]=t_src(vp, &src[0]); + o_inst->src[1]=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), t_swizzle(GET_SWZ(src[0].Swizzle, 0)), t_swizzle(GET_SWZ(src[0].Swizzle, 1)), t_swizzle(GET_SWZ(src[0].Swizzle, 2)), t_swizzle(GET_SWZ(src[0].Swizzle, 3)), t_src_class(src[0].File), (!src[0].NegateBase) ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[0].RelAddr << 4); - o_inst->src3=0; + o_inst->src[2]=0; goto next; case OPCODE_FLR: @@ -657,16 +657,16 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_FRC, u_temp_i, t_dst_mask(vpi->DstReg.WriteMask), VSF_OUT_CLASS_TMP); - o_inst->src1=t_src(vp, &src[0]); - o_inst->src2=ZERO_SRC_0; - o_inst->src3=ZERO_SRC_0; + o_inst->src[0]=t_src(vp, &src[0]); + o_inst->src[1]=ZERO_SRC_0; + o_inst->src[2]=ZERO_SRC_0; o_inst++; o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - o_inst->src1=t_src(vp, &src[0]); - o_inst->src2=MAKE_VSF_SOURCE(u_temp_i, + o_inst->src[0]=t_src(vp, &src[0]); + o_inst->src[1]=MAKE_VSF_SOURCE(u_temp_i, VSF_IN_COMPONENT_X, VSF_IN_COMPONENT_Y, VSF_IN_COMPONENT_Z, @@ -675,7 +675,7 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct /* Not 100% sure about this */ (!src[0].NegateBase) ? VSF_FLAG_ALL : VSF_FLAG_NONE/*VSF_FLAG_ALL*/); - o_inst->src3=ZERO_SRC_0; + o_inst->src[2]=ZERO_SRC_0; u_temp_i--; goto next; @@ -683,36 +683,36 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_LG2, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), + o_inst->src[0]=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), t_swizzle(GET_SWZ(src[0].Swizzle, 0)), t_swizzle(GET_SWZ(src[0].Swizzle, 0)), t_swizzle(GET_SWZ(src[0].Swizzle, 0)), t_swizzle(GET_SWZ(src[0].Swizzle, 0)), t_src_class(src[0].File), src[0].NegateBase ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[0].RelAddr << 4); - o_inst->src2=ZERO_SRC_0; - o_inst->src3=ZERO_SRC_0; + o_inst->src[1]=ZERO_SRC_0; + o_inst->src[2]=ZERO_SRC_0; goto next; case OPCODE_LIT://LIT TMP 1.Y Z TMP 1{} {X W Z Y} TMP 1{} {Y W Z X} TMP 1{} {Y X Z W} o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_LIT, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); /* NOTE: Users swizzling might not work. */ - o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), + o_inst->src[0]=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x t_swizzle(GET_SWZ(src[0].Swizzle, 3)), // w VSF_IN_COMPONENT_ZERO, // z t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y t_src_class(src[0].File), src[0].NegateBase ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[0].RelAddr << 4); - o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), + o_inst->src[1]=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y t_swizzle(GET_SWZ(src[0].Swizzle, 3)), // w VSF_IN_COMPONENT_ZERO, // z t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x t_src_class(src[0].File), src[0].NegateBase ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[0].RelAddr << 4); - o_inst->src3=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), + o_inst->src[2]=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x VSF_IN_COMPONENT_ZERO, // z @@ -725,15 +725,15 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_DOT, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), + o_inst->src[0]=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), t_swizzle(GET_SWZ(src[0].Swizzle, 0)), t_swizzle(GET_SWZ(src[0].Swizzle, 1)), t_swizzle(GET_SWZ(src[0].Swizzle, 2)), VSF_IN_COMPONENT_ONE, t_src_class(src[0].File), src[0].NegateBase ? VSF_FLAG_XYZ : VSF_FLAG_NONE) | (src[0].RelAddr << 4); - o_inst->src2=t_src(vp, &src[1]); - o_inst->src3=ZERO_SRC_1; + o_inst->src[1]=t_src(vp, &src[1]); + o_inst->src[2]=ZERO_SRC_1; goto next; case OPCODE_XPD: @@ -745,7 +745,7 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_MAD, u_temp_i, t_dst_mask(vpi->DstReg.WriteMask), VSF_OUT_CLASS_TMP); - o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), + o_inst->src[0]=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y t_swizzle(GET_SWZ(src[0].Swizzle, 2)), // z t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x @@ -753,7 +753,7 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct t_src_class(src[0].File), src[0].NegateBase ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[0].RelAddr << 4); - o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]), + o_inst->src[1]=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]), t_swizzle(GET_SWZ(src[1].Swizzle, 2)), // z t_swizzle(GET_SWZ(src[1].Swizzle, 0)), // x t_swizzle(GET_SWZ(src[1].Swizzle, 1)), // y @@ -761,14 +761,14 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct t_src_class(src[1].File), src[1].NegateBase ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[1].RelAddr << 4); - o_inst->src3=ZERO_SRC_1; + o_inst->src[2]=ZERO_SRC_1; o_inst++; u_temp_i--; o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_MAD, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - o_inst->src1=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]), + o_inst->src[0]=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]), t_swizzle(GET_SWZ(src[1].Swizzle, 1)), // y t_swizzle(GET_SWZ(src[1].Swizzle, 2)), // z t_swizzle(GET_SWZ(src[1].Swizzle, 0)), // x @@ -776,7 +776,7 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct t_src_class(src[1].File), (!src[1].NegateBase) ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[1].RelAddr << 4); - o_inst->src2=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), + o_inst->src[1]=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), t_swizzle(GET_SWZ(src[0].Swizzle, 2)), // z t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y @@ -784,7 +784,7 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct t_src_class(src[0].File), src[0].NegateBase ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[0].RelAddr << 4); - o_inst->src3=MAKE_VSF_SOURCE(u_temp_i+1, + o_inst->src[2]=MAKE_VSF_SOURCE(u_temp_i+1, VSF_IN_COMPONENT_X, VSF_IN_COMPONENT_Y, VSF_IN_COMPONENT_Z, @@ -810,21 +810,21 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct if(are_srcs_scalar){ switch(operands){ case 1: - o_inst->src1=t_src_scalar(vp, &src[0]); - o_inst->src2=ZERO_SRC_0; - o_inst->src3=ZERO_SRC_0; + o_inst->src[0]=t_src_scalar(vp, &src[0]); + o_inst->src[1]=ZERO_SRC_0; + o_inst->src[2]=ZERO_SRC_0; break; case 2: - o_inst->src1=t_src_scalar(vp, &src[0]); - o_inst->src2=t_src_scalar(vp, &src[1]); - o_inst->src3=ZERO_SRC_1; + o_inst->src[0]=t_src_scalar(vp, &src[0]); + o_inst->src[1]=t_src_scalar(vp, &src[1]); + o_inst->src[2]=ZERO_SRC_1; break; case 3: - o_inst->src1=t_src_scalar(vp, &src[0]); - o_inst->src2=t_src_scalar(vp, &src[1]); - o_inst->src3=t_src_scalar(vp, &src[2]); + o_inst->src[0]=t_src_scalar(vp, &src[0]); + o_inst->src[1]=t_src_scalar(vp, &src[1]); + o_inst->src[2]=t_src_scalar(vp, &src[2]); break; default: @@ -835,21 +835,21 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct }else{ switch(operands){ case 1: - o_inst->src1=t_src(vp, &src[0]); - o_inst->src2=ZERO_SRC_0; - o_inst->src3=ZERO_SRC_0; + o_inst->src[0]=t_src(vp, &src[0]); + o_inst->src[1]=ZERO_SRC_0; + o_inst->src[2]=ZERO_SRC_0; break; case 2: - o_inst->src1=t_src(vp, &src[0]); - o_inst->src2=t_src(vp, &src[1]); - o_inst->src3=ZERO_SRC_1; + o_inst->src[0]=t_src(vp, &src[0]); + o_inst->src[1]=t_src(vp, &src[1]); + o_inst->src[2]=ZERO_SRC_1; break; case 3: - o_inst->src1=t_src(vp, &src[0]); - o_inst->src2=t_src(vp, &src[1]); - o_inst->src3=t_src(vp, &src[2]); + o_inst->src[0]=t_src(vp, &src[0]); + o_inst->src[1]=t_src(vp, &src[1]); + o_inst->src[2]=t_src(vp, &src[2]); break; default: diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.h b/src/mesa/drivers/dri/r300/r300_vertprog.h index 433e98960bc..005fca976b6 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.h +++ b/src/mesa/drivers/dri/r300/r300_vertprog.h @@ -1,11 +1,11 @@ #ifndef __R300_VERTPROG_H_ #define __R300_VERTPROG_H_ +#include "r300_reg.h" + typedef struct { GLuint op; - GLuint src1; - GLuint src2; - GLuint src3; + GLuint src[3]; } VERTEX_SHADER_INSTRUCTION; #define VSF_FLAG_X 1 -- cgit v1.2.3 From 8d62afdb6a1575642fbe0e4bf3e6b279f92500e2 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 02:41:38 +0000 Subject: r300: Removed the obsolete pfs_reg_t type from r300_fragprog.h. --- src/mesa/drivers/dri/r300/r300_fragprog.h | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.h b/src/mesa/drivers/dri/r300/r300_fragprog.h index d883aee2d72..1d683acdd92 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog.h +++ b/src/mesa/drivers/dri/r300/r300_fragprog.h @@ -41,26 +41,6 @@ #include "r300_context.h" - -#if 0 -/* representation of a register for emit_arith/swizzle */ -typedef struct _pfs_reg_t { - enum { - REG_TYPE_INPUT, - REG_TYPE_OUTPUT, - REG_TYPE_TEMP, - REG_TYPE_CONST - } type:2; - GLuint index:6; - GLuint v_swz:5; - GLuint s_swz:5; - GLuint negate_v:1; - GLuint negate_s:1; - GLuint absolute:1; - GLboolean no_use:1; - GLboolean valid:1; -} pfs_reg_t; -#endif typedef struct r300_fragment_program_swizzle { GLuint length; GLuint src[4]; -- cgit v1.2.3 From e90ad3dbbbacc954b1f87e9c985739654797ee1a Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 02:46:57 +0000 Subject: r300: Indented r300_ioctl.[ch]. --- src/mesa/drivers/dri/r300/r300_ioctl.c | 301 ++++++++++++++++++--------------- src/mesa/drivers/dri/r300/r300_ioctl.h | 11 +- 2 files changed, 169 insertions(+), 143 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index 1b73389600b..de0a482eb5d 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -61,14 +61,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. static void r300ClearBuffer(r300ContextPtr r300, int flags, int buffer) { - GLcontext* ctx = r300->radeon.glCtx; + GLcontext *ctx = r300->radeon.glCtx; __DRIdrawablePrivate *dPriv = r300->radeon.dri.drawable; GLuint cboffset, cbpitch; - drm_r300_cmd_header_t* cmd2; + drm_r300_cmd_header_t *cmd2; int cmd_reserved = 0; int cmd_written = 0; drm_radeon_cmd_header_t *cmd = NULL; - r300ContextPtr rmesa=r300; + r300ContextPtr rmesa = r300; if (RADEON_DEBUG & DEBUG_IOCTL) fprintf(stderr, "%s: %s buffer (%i,%i %ix%i)\n", @@ -87,69 +87,81 @@ static void r300ClearBuffer(r300ContextPtr r300, int flags, int buffer) cp_wait(r300, R300_WAIT_3D | R300_WAIT_3D_CLEAN); end_3d(rmesa); - + R300_STATECHANGE(r300, cb); reg_start(R300_RB3D_COLOROFFSET0, 0); e32(cboffset); - + if (r300->radeon.radeonScreen->cpp == 4) cbpitch |= R300_COLOR_FORMAT_ARGB8888; else cbpitch |= R300_COLOR_FORMAT_RGB565; - + if (r300->radeon.sarea->tiling_enabled) cbpitch |= R300_COLOR_TILE_ENABLE; - + reg_start(R300_RB3D_COLORPITCH0, 0); e32(cbpitch); R300_STATECHANGE(r300, cmk); reg_start(R300_RB3D_COLORMASK, 0); - + if (flags & CLEARBUFFER_COLOR) { e32((ctx->Color.ColorMask[BCOMP] ? R300_COLORMASK0_B : 0) | - (ctx->Color.ColorMask[GCOMP] ? R300_COLORMASK0_G : 0) | - (ctx->Color.ColorMask[RCOMP] ? R300_COLORMASK0_R : 0) | - (ctx->Color.ColorMask[ACOMP] ? R300_COLORMASK0_A : 0)); + (ctx->Color.ColorMask[GCOMP] ? R300_COLORMASK0_G : 0) | + (ctx->Color.ColorMask[RCOMP] ? R300_COLORMASK0_R : 0) | + (ctx->Color.ColorMask[ACOMP] ? R300_COLORMASK0_A : 0)); } else { e32(0); } - + R300_STATECHANGE(r300, zs); reg_start(R300_RB3D_ZSTENCIL_CNTL_0, 2); - + { - uint32_t t1, t2; - - t1 = 0x0; - t2 = 0x0; - - if (flags & CLEARBUFFER_DEPTH) { - t1 |= R300_RB3D_Z_WRITE_ONLY; - t2 |= (R300_ZS_ALWAYS << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT); - } else { - t1 |= R300_RB3D_Z_DISABLED_1; // disable - } - - if (flags & CLEARBUFFER_STENCIL) { - t1 |= R300_RB3D_STENCIL_ENABLE; - t2 |= - (R300_ZS_ALWAYS<state.stencil.clear); + uint32_t t1, t2; + + t1 = 0x0; + t2 = 0x0; + + if (flags & CLEARBUFFER_DEPTH) { + t1 |= R300_RB3D_Z_WRITE_ONLY; + t2 |= + (R300_ZS_ALWAYS << + R300_RB3D_ZS1_DEPTH_FUNC_SHIFT); + } else { + t1 |= R300_RB3D_Z_DISABLED_1; // disable + } + + if (flags & CLEARBUFFER_STENCIL) { + t1 |= R300_RB3D_STENCIL_ENABLE; + t2 |= + (R300_ZS_ALWAYS << + R300_RB3D_ZS1_FRONT_FUNC_SHIFT) | + (R300_ZS_REPLACE << + R300_RB3D_ZS1_FRONT_FAIL_OP_SHIFT) | + (R300_ZS_REPLACE << + R300_RB3D_ZS1_FRONT_ZPASS_OP_SHIFT) | + (R300_ZS_REPLACE << + R300_RB3D_ZS1_FRONT_ZFAIL_OP_SHIFT) | + (R300_ZS_ALWAYS << + R300_RB3D_ZS1_BACK_FUNC_SHIFT) | + (R300_ZS_REPLACE << + R300_RB3D_ZS1_BACK_FAIL_OP_SHIFT) | + (R300_ZS_REPLACE << + R300_RB3D_ZS1_BACK_ZPASS_OP_SHIFT) | + (R300_ZS_REPLACE << + R300_RB3D_ZS1_BACK_ZFAIL_OP_SHIFT); + } + + e32(t1); + e32(t2); + e32(r300->state.stencil.clear); } - - cmd2 = (drm_r300_cmd_header_t*)r300AllocCmdBuf(r300, 9, __FUNCTION__); + + cmd2 = + (drm_r300_cmd_header_t *) r300AllocCmdBuf(r300, 9, + __FUNCTION__); cmd2[0].packet3.cmd_type = R300_CMD_PACKET3; cmd2[0].packet3.packet = R300_CMD_PACKET3_CLEAR; cmd2[1].u = r300PackFloat32(dPriv->w / 2.0); @@ -161,11 +173,10 @@ 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); + reg_start(R300_RB3D_DSTCACHE_CTLSTAT, 0); e32(R300_RB3D_DSTCACHE_UNKNOWN_0A); - - reg_start(R300_RB3D_ZCACHE_CTLSTAT,0); + reg_start(R300_RB3D_ZCACHE_CTLSTAT, 0); e32(R300_RB3D_ZCACHE_UNKNOWN_03); cp_wait(rmesa, R300_WAIT_3D | R300_WAIT_3D_CLEAN); } @@ -173,7 +184,7 @@ static void r300ClearBuffer(r300ContextPtr r300, int flags, int buffer) static void r300EmitClearState(GLcontext * ctx) { r300ContextPtr r300 = R300_CONTEXT(ctx); - r300ContextPtr rmesa=r300; + r300ContextPtr rmesa = r300; __DRIdrawablePrivate *dPriv = r300->radeon.dri.drawable; int i; int cmd_reserved = 0; @@ -182,20 +193,20 @@ static void r300EmitClearState(GLcontext * ctx) int has_tcl = 1; if (!(r300->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) - has_tcl = 0; - + has_tcl = 0; + R300_STATECHANGE(r300, vir[0]); reg_start(R300_VAP_INPUT_ROUTE_0_0, 0); if (!has_tcl) - e32(0x22030003); + e32(0x22030003); else - e32(0x21030003); - + e32(0x21030003); + /* disable fog */ R300_STATECHANGE(r300, fogs); reg_start(R300_RE_FOG_STATE, 0); e32(0x0); - + R300_STATECHANGE(r300, vir[1]); reg_start(R300_VAP_INPUT_ROUTE_1_0, 0); e32(0xF688F688); @@ -206,26 +217,26 @@ static void r300EmitClearState(GLcontext * ctx) e32(0x00000405); if (!has_tcl) { - R300_STATECHANGE(r300, vte); - /* comes from fglrx startup of clear */ - reg_start(R300_SE_VTE_CNTL, 1); - e32(0x043f); - 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(0x043f); + 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(0); /* no textures */ - - + e32(R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT | + R300_VAP_OUTPUT_VTX_FMT_0__COLOR_PRESENT); + e32(0); /* no textures */ + R300_STATECHANGE(r300, txe); reg_start(R300_TX_ENABLE, 0); e32(0); - + R300_STATECHANGE(r300, vpt); reg_start(R300_SE_VPORT_XSCALE, 5); efloat(1.0); @@ -234,28 +245,28 @@ static void r300EmitClearState(GLcontext * ctx) efloat(dPriv->y); efloat(1.0); efloat(0.0); - + R300_STATECHANGE(r300, at); reg_start(R300_PP_ALPHA_TEST, 0); e32(0); - + R300_STATECHANGE(r300, bld); reg_start(R300_RB3D_CBLEND, 1); e32(0); e32(0); - + R300_STATECHANGE(r300, unk221C); reg_start(R300_VAP_UNKNOWN_221C, 0); e32(R300_221C_CLEAR); - + R300_STATECHANGE(r300, ps); reg_start(R300_RE_POINTSIZE, 0); e32(((dPriv->w * 6) << R300_POINTSIZE_X_SHIFT) | - ((dPriv->h * 6) << R300_POINTSIZE_Y_SHIFT)); - + ((dPriv->h * 6) << R300_POINTSIZE_Y_SHIFT)); + R300_STATECHANGE(r300, ri); reg_start(R300_RS_INTERP_0, 8); - for(i = 0; i < 8; ++i){ + for (i = 0; i < 8; ++i) { e32(R300_RS_INTERP_USED); } @@ -264,11 +275,11 @@ static void r300EmitClearState(GLcontext * ctx) reg_start(R300_RS_CNTL_0, 1); e32((1 << R300_RS_CNTL_CI_CNT_SHIFT) | R300_RS_CNTL_0_UNKNOWN_18); e32(0); - + R300_STATECHANGE(r300, rr); reg_start(R300_RS_ROUTE_0, 0); e32(0x00004000); - + R300_STATECHANGE(r300, fp); reg_start(R300_PFS_CNTL_0, 2); e32(0); @@ -279,48 +290,49 @@ static void r300EmitClearState(GLcontext * ctx) e32(0); e32(0); e32(R300_PFS_NODE_OUTPUT_COLOR); - + R300_STATECHANGE(r300, fpi[0]); R300_STATECHANGE(r300, fpi[1]); R300_STATECHANGE(r300, fpi[2]); R300_STATECHANGE(r300, fpi[3]); - + reg_start(R300_PFS_INSTR0_0, 0); - e32(FP_INSTRC(MAD, FP_ARGC(SRC0C_XYZ), FP_ARGC(ONE), FP_ARGC(ZERO))); - + e32(FP_INSTRC + (MAD, FP_ARGC(SRC0C_XYZ), FP_ARGC(ONE), FP_ARGC(ZERO))); + reg_start(R300_PFS_INSTR1_0, 0); - e32(FP_SELC(0,NO,XYZ,FP_TMP(0),0,0)); - + e32(FP_SELC(0, NO, XYZ, FP_TMP(0), 0, 0)); + reg_start(R300_PFS_INSTR2_0, 0); e32(FP_INSTRA(MAD, FP_ARGA(SRC0A), FP_ARGA(ONE), FP_ARGA(ZERO))); - + reg_start(R300_PFS_INSTR3_0, 0); - e32(FP_SELA(0,NO,W,FP_TMP(0),0,0)); + e32(FP_SELA(0, NO, W, FP_TMP(0), 0, 0)); if (has_tcl) { - R300_STATECHANGE(r300, pvs); - reg_start(R300_VAP_PVS_CNTL_1, 2); - e32((0 << R300_PVS_CNTL_1_PROGRAM_START_SHIFT) | - (0 << R300_PVS_CNTL_1_POS_END_SHIFT) | - (1 << R300_PVS_CNTL_1_PROGRAM_END_SHIFT)); - e32(0); - e32(1 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT); - - R300_STATECHANGE(r300, vpi); - vsf_start_fragment(0x0, 8); - e32(VP_OUT(ADD,OUT,0,XYZW)); - e32(VP_IN(IN,0)); - e32(VP_ZERO()); - e32(0); - - e32(VP_OUT(ADD,OUT,1,XYZW)); - e32(VP_IN(IN,1)); - e32(VP_ZERO()); - e32(0); + R300_STATECHANGE(r300, pvs); + reg_start(R300_VAP_PVS_CNTL_1, 2); + e32((0 << R300_PVS_CNTL_1_PROGRAM_START_SHIFT) | + (0 << R300_PVS_CNTL_1_POS_END_SHIFT) | + (1 << R300_PVS_CNTL_1_PROGRAM_END_SHIFT)); + e32(0); + e32(1 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT); + + R300_STATECHANGE(r300, vpi); + vsf_start_fragment(0x0, 8); + e32(VP_OUT(ADD, OUT, 0, XYZW)); + e32(VP_IN(IN, 0)); + e32(VP_ZERO()); + e32(0); + + e32(VP_OUT(ADD, OUT, 1, XYZW)); + e32(VP_IN(IN, 1)); + e32(VP_ZERO()); + e32(0); } - + /*reg_start(0x4500,0); - e32(2560-1);*/ + e32(2560-1); */ } /** @@ -358,8 +370,8 @@ static void r300Clear(GLcontext * ctx, GLbitfield mask) bits |= CLEARBUFFER_DEPTH; mask &= ~BUFFER_BIT_DEPTH; } - - if ( (mask & BUFFER_BIT_STENCIL) && r300->state.stencil.hw_stencil) { + + if ((mask & BUFFER_BIT_STENCIL) && r300->state.stencil.hw_stencil) { bits |= CLEARBUFFER_STENCIL; mask &= ~BUFFER_BIT_STENCIL; } @@ -374,8 +386,8 @@ static void r300Clear(GLcontext * ctx, GLbitfield mask) swapped = r300->radeon.sarea->pfCurrentPage == 1; /* Make sure it fits there. */ - r300EnsureCmdBufSpace(r300, 421*3, __FUNCTION__); - if(flags || bits) + r300EnsureCmdBufSpace(r300, 421 * 3, __FUNCTION__); + if (flags || bits) r300EmitClearState(ctx); if (flags & BUFFER_BIT_FRONT_LEFT) { @@ -384,7 +396,8 @@ static void r300Clear(GLcontext * ctx, GLbitfield mask) } if (flags & BUFFER_BIT_BACK_LEFT) { - r300ClearBuffer(r300, bits | CLEARBUFFER_COLOR, swapped ^ 1); + r300ClearBuffer(r300, bits | CLEARBUFFER_COLOR, + swapped ^ 1); bits = 0; } @@ -393,7 +406,6 @@ static void r300Clear(GLcontext * ctx, GLbitfield mask) } - void r300Flush(GLcontext * ctx) { r300ContextPtr r300 = R300_CONTEXT(ctx); @@ -411,8 +423,8 @@ void r300Flush(GLcontext * ctx) static void r300RefillCurrentDmaRegion(r300ContextPtr rmesa, int size) { struct r300_dma_buffer *dmabuf; - size = MAX2(size, RADEON_BUFFER_SIZE*16); - + size = MAX2(size, RADEON_BUFFER_SIZE * 16); + if (RADEON_DEBUG & (DEBUG_IOCTL | DEBUG_DMA)) fprintf(stderr, "%s\n", __FUNCTION__); @@ -421,39 +433,42 @@ static void r300RefillCurrentDmaRegion(r300ContextPtr rmesa, int size) } if (rmesa->dma.current.buf) - r300ReleaseDmaRegion(rmesa, &rmesa->dma.current, __FUNCTION__); + r300ReleaseDmaRegion(rmesa, &rmesa->dma.current, + __FUNCTION__); if (rmesa->dma.nr_released_bufs > 4) r300FlushCmdBuf(rmesa, __FUNCTION__); - + dmabuf = CALLOC_STRUCT(r300_dma_buffer); - dmabuf->buf = (void *)1; /* hack */ + dmabuf->buf = (void *)1; /* hack */ dmabuf->refcount = 1; dmabuf->id = radeon_mm_alloc(rmesa, 4, size); if (dmabuf->id == 0) { LOCK_HARDWARE(&rmesa->radeon); /* no need to validate */ - + r300FlushCmdBufLocked(rmesa, __FUNCTION__); radeonWaitForIdleLocked(&rmesa->radeon); - + dmabuf->id = radeon_mm_alloc(rmesa, 4, size); #ifdef HW_VBOS if (dmabuf->id == 0) { /* Just kick all */ - r300EvictVBOs(rmesa->radeon.glCtx, /*RADEON_BUFFER_SIZE*16*/1<<30); + r300EvictVBOs(rmesa->radeon.glCtx, + /*RADEON_BUFFER_SIZE*16 */ 1 << 30); dmabuf->id = radeon_mm_alloc(rmesa, 4, size); } #endif UNLOCK_HARDWARE(&rmesa->radeon); - + if (dmabuf->id == 0) { - fprintf(stderr, "Error: Could not get dma buffer... exiting\n"); + fprintf(stderr, + "Error: Could not get dma buffer... exiting\n"); exit(-1); } } - + rmesa->dma.current.buf = dmabuf; rmesa->dma.current.address = radeon_mm_ptr(rmesa, dmabuf->id); rmesa->dma.current.end = size; @@ -462,7 +477,8 @@ static void r300RefillCurrentDmaRegion(r300ContextPtr rmesa, int size) } void r300ReleaseDmaRegion(r300ContextPtr rmesa, - struct r300_dma_region *region, const char *caller) + struct r300_dma_region *region, + const char *caller) { if (RADEON_DEBUG & DEBUG_IOCTL) fprintf(stderr, "%s from %s\n", __FUNCTION__, caller); @@ -504,8 +520,7 @@ void r300AllocDmaRegion(r300ContextPtr rmesa, (rmesa->dma.current.ptr + alignment) & ~alignment; if (rmesa->dma.current.ptr + bytes > rmesa->dma.current.end) - r300RefillCurrentDmaRegion(rmesa, - (bytes + 0x7) & ~0x7); + r300RefillCurrentDmaRegion(rmesa, (bytes + 0x7) & ~0x7); region->start = rmesa->dma.current.start; region->ptr = rmesa->dma.current.start; @@ -530,7 +545,7 @@ static void r300RefillCurrentDmaRegion(r300ContextPtr rmesa) int size = 0; drmDMAReq dma; int ret; - + if (RADEON_DEBUG & (DEBUG_IOCTL | DEBUG_DMA)) fprintf(stderr, "%s\n", __FUNCTION__); @@ -539,7 +554,8 @@ static void r300RefillCurrentDmaRegion(r300ContextPtr rmesa) } if (rmesa->dma.current.buf) - r300ReleaseDmaRegion(rmesa, &rmesa->dma.current, __FUNCTION__); + r300ReleaseDmaRegion(rmesa, &rmesa->dma.current, + __FUNCTION__); if (rmesa->dma.nr_released_bufs > 4) r300FlushCmdBuf(rmesa, __FUNCTION__); @@ -573,7 +589,8 @@ static void r300RefillCurrentDmaRegion(r300ContextPtr rmesa) if (ret != 0) { UNLOCK_HARDWARE(&rmesa->radeon); - fprintf(stderr, "Error: Could not get dma buffer... exiting\n"); + fprintf(stderr, + "Error: Could not get dma buffer... exiting\n"); exit(-1); } } @@ -595,7 +612,8 @@ static void r300RefillCurrentDmaRegion(r300ContextPtr rmesa) } void r300ReleaseDmaRegion(r300ContextPtr rmesa, - struct r300_dma_region *region, const char *caller) + struct r300_dma_region *region, + const char *caller) { if (RADEON_DEBUG & DEBUG_IOCTL) fprintf(stderr, "%s from %s\n", __FUNCTION__, caller); @@ -610,15 +628,16 @@ void r300ReleaseDmaRegion(r300ContextPtr rmesa, drm_radeon_cmd_header_t *cmd; if (RADEON_DEBUG & (DEBUG_IOCTL | DEBUG_DMA)) - fprintf(stderr, "%s -- DISCARD BUF %d\n", __FUNCTION__, - region->buf->buf->idx); + fprintf(stderr, "%s -- DISCARD BUF %d\n", + __FUNCTION__, region->buf->buf->idx); cmd = (drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, - sizeof(*cmd) / 4, + sizeof + (*cmd) / 4, __FUNCTION__); cmd->dma.cmd_type = R300_CMD_DMA_DISCARD; cmd->dma.buf_idx = region->buf->buf->idx; - + FREE(region->buf); rmesa->dma.nr_released_bufs++; } @@ -691,9 +710,11 @@ GLboolean r300IsGartMemory(r300ContextPtr rmesa, const GLvoid * pointer, GLint size) { int offset = - (char *)pointer - (char *)rmesa->radeon.radeonScreen->gartTextures.map; + (char *)pointer - + (char *)rmesa->radeon.radeonScreen->gartTextures.map; int valid = (size >= 0 && offset >= 0 - && offset + size < rmesa->radeon.radeonScreen->gartTextures.size); + && offset + size < + rmesa->radeon.radeonScreen->gartTextures.size); if (RADEON_DEBUG & DEBUG_IOCTL) fprintf(stderr, "r300IsGartMemory( %p ) : %d\n", pointer, @@ -702,17 +723,21 @@ GLboolean r300IsGartMemory(r300ContextPtr rmesa, const GLvoid * pointer, return valid; } -GLuint r300GartOffsetFromVirtual(r300ContextPtr rmesa, const GLvoid * pointer) +GLuint r300GartOffsetFromVirtual(r300ContextPtr rmesa, + const GLvoid * pointer) { int offset = - (char *)pointer - (char *)rmesa->radeon.radeonScreen->gartTextures.map; + (char *)pointer - + (char *)rmesa->radeon.radeonScreen->gartTextures.map; //fprintf(stderr, "offset=%08x\n", offset); - if (offset < 0 || offset > rmesa->radeon.radeonScreen->gartTextures.size) + if (offset < 0 + || offset > rmesa->radeon.radeonScreen->gartTextures.size) return ~0; else - return rmesa->radeon.radeonScreen->gart_texture_offset + offset; + return rmesa->radeon.radeonScreen->gart_texture_offset + + offset; } void r300InitIoctlFuncs(struct dd_function_table *functions) diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.h b/src/mesa/drivers/dri/r300/r300_ioctl.h index 52325646e9f..cebd22fabed 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.h +++ b/src/mesa/drivers/dri/r300/r300_ioctl.h @@ -42,8 +42,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. extern GLuint r300GetMemoryOffsetMESA(__DRInativeDisplay * dpy, int scrn, const GLvoid * pointer); -extern GLboolean r300IsGartMemory(r300ContextPtr rmesa, const GLvoid * pointer, - GLint size); +extern GLboolean r300IsGartMemory(r300ContextPtr rmesa, + const GLvoid * pointer, GLint size); extern GLuint r300GartOffsetFromVirtual(r300ContextPtr rmesa, const GLvoid * pointer); @@ -51,10 +51,11 @@ extern GLuint r300GartOffsetFromVirtual(r300ContextPtr rmesa, extern void r300Flush(GLcontext * ctx); extern void r300ReleaseDmaRegion(r300ContextPtr rmesa, - struct r300_dma_region *region, const char *caller); + struct r300_dma_region *region, + const char *caller); extern void r300AllocDmaRegion(r300ContextPtr rmesa, - struct r300_dma_region *region, - int bytes, int alignment); + struct r300_dma_region *region, int bytes, + int alignment); extern void r300InitIoctlFuncs(struct dd_function_table *functions); -- cgit v1.2.3 From 204bc4e441631ae41c6a3f9dfc9af52304235c8e Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 02:49:14 +0000 Subject: r300: Indented r300_maos.[ch]. --- src/mesa/drivers/dri/r300/r300_maos.c | 385 +++++++++++++++++++--------------- src/mesa/drivers/dri/r300/r300_maos.h | 6 +- 2 files changed, 223 insertions(+), 168 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_maos.c b/src/mesa/drivers/dri/r300/r300_maos.c index 34f2e569e92..c424e7a31a9 100644 --- a/src/mesa/drivers/dri/r300/r300_maos.c +++ b/src/mesa/drivers/dri/r300/r300_maos.c @@ -65,7 +65,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define DEBUG_ALL DEBUG_VERTS - #if defined(USE_X86_ASM) #define COPY_DWORDS( dst, src, nr ) \ do { \ @@ -88,7 +87,7 @@ do { \ static void emit_vec4(GLcontext * ctx, struct r300_dma_region *rvb, - GLvoid *data, int stride, int count) + GLvoid * data, int stride, int count) { int i; int *out = (int *)(rvb->address + rvb->start); @@ -109,7 +108,7 @@ static void emit_vec4(GLcontext * ctx, static void emit_vec8(GLcontext * ctx, struct r300_dma_region *rvb, - GLvoid *data, int stride, int count) + GLvoid * data, int stride, int count) { int i; int *out = (int *)(rvb->address + rvb->start); @@ -131,14 +130,15 @@ static void emit_vec8(GLcontext * ctx, static void emit_vec12(GLcontext * ctx, struct r300_dma_region *rvb, - GLvoid *data, int stride, int count) + GLvoid * data, int stride, int count) { int i; int *out = (int *)(rvb->address + rvb->start); if (RADEON_DEBUG & DEBUG_VERTS) fprintf(stderr, "%s count %d stride %d out %p data %p\n", - __FUNCTION__, count, stride, (void *)out, (void *)data); + __FUNCTION__, count, stride, (void *)out, + (void *)data); if (stride == 12) COPY_DWORDS(out, data, count * 3); @@ -154,7 +154,7 @@ static void emit_vec12(GLcontext * ctx, static void emit_vec16(GLcontext * ctx, struct r300_dma_region *rvb, - GLvoid *data, int stride, int count) + GLvoid * data, int stride, int count) { int i; int *out = (int *)(rvb->address + rvb->start); @@ -178,7 +178,7 @@ static void emit_vec16(GLcontext * ctx, static void emit_vector(GLcontext * ctx, struct r300_dma_region *rvb, - GLvoid *data, int size, int stride, int count) + GLvoid * data, int size, int stride, int count) { r300ContextPtr rmesa = R300_CONTEXT(ctx); @@ -186,20 +186,20 @@ static void emit_vector(GLcontext * ctx, fprintf(stderr, "%s count %d size %d stride %d\n", __FUNCTION__, count, size, stride); - /* Gets triggered when playing with future_hw_tcl_on ...*/ + /* 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; + rvb->aos_offset = GET_START(rvb); + rvb->aos_stride = 0; } else { r300AllocDmaRegion(rmesa, rvb, size * count * 4, 4); /* alignment? */ - rvb->aos_offset = GET_START(rvb); - rvb->aos_stride = size; + rvb->aos_offset = GET_START(rvb); + rvb->aos_stride = size; } - + /* Emit the data */ switch (size) { @@ -223,28 +223,32 @@ static void emit_vector(GLcontext * ctx, } -void r300EmitElts(GLcontext * ctx, void *elts, unsigned long n_elts, int elt_size) +void r300EmitElts(GLcontext * ctx, void *elts, unsigned long n_elts, + int elt_size) { r300ContextPtr rmesa = R300_CONTEXT(ctx); - struct r300_dma_region *rvb=&rmesa->state.elt_dma; + 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)){ - rvb->address = rmesa->radeon.radeonScreen->gartTextures.map; + + if (r300IsGartMemory(rmesa, elts, n_elts * elt_size)) { + rvb->address = + rmesa->radeon.radeonScreen->gartTextures.map; rvb->start = ((char *)elts) - rvb->address; - rvb->aos_offset = rmesa->radeon.radeonScreen->gart_texture_offset + rvb->start; - - return ; - }else if(r300IsGartMemory(rmesa, elts, 1)){ + rvb->aos_offset = + rmesa->radeon.radeonScreen->gart_texture_offset + + rvb->start; + + return; + } else if (r300IsGartMemory(rmesa, elts, 1)) { WARN_ONCE("Pointer not within GART memory!\n"); exit(1); } - + r300AllocDmaRegion(rmesa, rvb, n_elts * elt_size, elt_size); - rvb->aos_offset = GET_START(rvb); - + rvb->aos_offset = GET_START(rvb); + out = rvb->address + rvb->start; memcpy(out, elts, n_elts * elt_size); } @@ -254,18 +258,18 @@ static GLuint t_type(struct dt *dt) 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; + break; } - + return AOS_FORMAT_FLOAT; } @@ -274,18 +278,18 @@ 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; + break; } - + return 0; } @@ -294,65 +298,76 @@ 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, GLint *tab, GLuint nr) +static GLuint t_vir0(uint32_t * dst, struct dt *dt, int *inputs, + GLint * tab, GLuint nr) { GLuint i, dw; - - 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; - + + 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; + if (i + 2 == nr) { dw |= (1 << (13 + 16)); } dst[i >> 1] = dw; } - + if (nr & 1) { - dw = t_vir0_size(&dt[tab[nr - 1]]) | (inputs[tab[nr - 1]] << 8) | (t_type(&dt[tab[nr - 1]]) << 14); + dw = t_vir0_size(&dt[tab[nr - 1]]) | (inputs[tab[nr - 1]] + << 8) | + (t_type(&dt[tab[nr - 1]]) << 14); dw |= 1 << 13; - + dst[nr >> 1] = dw; } - + return (nr + 1) >> 1; } static GLuint t_swizzle(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 t_vir1(uint32_t *dst, int swizzle[][4], GLuint nr) +static GLuint t_vir1(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] = + t_swizzle(swizzle[i]) | R300_INPUT_ROUTE_ENABLE; + 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; - + dst[nr >> 1] = + t_swizzle(swizzle[nr - 1]) | R300_INPUT_ROUTE_ENABLE; + return (nr + 1) >> 1; } @@ -365,23 +380,23 @@ static GLuint t_vic(GLcontext * ctx, GLuint InputsRead) { r300ContextPtr r300 = 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; - + r300->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++; vic_1 |= R300_INPUT_CNTL_TC0 << i; } - + return vic_1; } @@ -390,7 +405,7 @@ static GLuint t_vic(GLcontext * ctx, GLuint InputsRead) * This function should never return R300_FALLBACK_TCL when using software tcl. */ -int r300EmitArrays(GLcontext *ctx) +int r300EmitArrays(GLcontext * ctx) { r300ContextPtr rmesa = R300_CONTEXT(ctx); r300ContextPtr r300 = rmesa; @@ -403,88 +418,102 @@ int r300EmitArrays(GLcontext *ctx) int vir_inputs[VERT_ATTRIB_MAX]; GLint tab[VERT_ATTRIB_MAX]; int swizzle[VERT_ATTRIB_MAX][4]; - + if (hw_tcl_on) { - 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); inputs = prog->inputs; InputsRead = CURRENT_VERTEX_SHADER(ctx)->key.InputsRead; - OutputsWritten = CURRENT_VERTEX_SHADER(ctx)->key.OutputsWritten; + OutputsWritten = + CURRENT_VERTEX_SHADER(ctx)->key.OutputsWritten; } else { DECLARE_RENDERINPUTS(inputs_bitset); inputs = r300->state.sw_tcl_inputs; - - RENDERINPUTS_COPY( inputs_bitset, TNL_CONTEXT(ctx)->render_inputs_bitset ); - - assert(RENDERINPUTS_TEST( inputs_bitset, _TNL_ATTRIB_POS )); + + 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_COLOR0 )); + + assert(RENDERINPUTS_TEST(inputs_bitset, _TNL_ATTRIB_NORMAL) + == 0); + + assert(RENDERINPUTS_TEST + (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(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) )) { + if (RENDERINPUTS_TEST + (inputs_bitset, _TNL_ATTRIB_TEX(i))) { InputsRead |= 1 << (VERT_ATTRIB_TEX0 + i); - OutputsWritten |= 1 << (VERT_RESULT_TEX0 + i); + OutputsWritten |= + 1 << (VERT_RESULT_TEX0 + i); } - + for (i = 0, nr = 0; i < VERT_ATTRIB_MAX; i++) if (InputsRead & (1 << i)) inputs[i] = nr++; 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) 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++) + + for (i = VERT_ATTRIB_TEX0; i <= VERT_ATTRIB_TEX7; + i++) if (InputsRead & (1 << i)) - inputs[i] = 6 + (i - VERT_ATTRIB_TEX0); + 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); assert(OutputsWritten); - + for (i = 0, nr = 0; i < VERT_ATTRIB_MAX; i++) if (InputsRead & (1 << i)) tab[nr++] = i; - + if (nr > R300_MAX_AOS_ARRAYS) return R300_FALLBACK_TCL; - + for (i = 0; i < nr; i++) { int ci; int comp_size, 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; - + #if MESA_BIG_ENDIAN #define SWAP_INT(a, b) do { \ int __temp; \ @@ -492,107 +521,129 @@ int r300EmitArrays(GLcontext *ctx) 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, /*(count-1)*stride */ 4)) { +#endif /* MESA_BIG_ENDIAN */ + + if (r300IsGartMemory + (rmesa, VB->AttribPtr[tab[i]].data, + /*(count-1)*stride */ 4)) { if (VB->AttribPtr[tab[i]].stride % 4) return R300_FALLBACK_TCL; - - rmesa->state.aos[i].address = VB->AttribPtr[tab[i]].data; + + rmesa->state.aos[i].address = + 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 = t_emit_size(&VB->AttribPtr[tab[i]]); + 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 = + t_emit_size(&VB->AttribPtr[tab[i]]); } else { /* TODO: emit_vector can only handle 4 byte vectors */ if (VB->AttribPtr[tab[i]].type != GL_FLOAT) return R300_FALLBACK_TCL; - - emit_vector(ctx, &rmesa->state.aos[i], VB->AttribPtr[tab[i]].data, - t_emit_size(&VB->AttribPtr[tab[i]]), VB->AttribPtr[tab[i]].stride, count); + + emit_vector(ctx, &rmesa->state.aos[i], + VB->AttribPtr[tab[i]].data, + t_emit_size(&VB->AttribPtr[tab[i]]), + 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 = + t_aos_size(&VB->AttribPtr[tab[i]]); + comp_size = _mesa_sizeof_type(VB->AttribPtr[tab[i]].type); - + 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; } - + if (found) { 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 { - 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); + 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); return R300_FALLBACK_TCL; } } - + /* 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, inputs, tab, nr); + ((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, + 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); + ((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); /* Set up 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] = 0x5555; /* Hard coded value, no idea what it means */ r300->hw.vic.cmd[R300_VIC_CNTL_1] = t_vic(ctx, InputsRead); /* Stage 3: VAP output */ - + R300_STATECHANGE(r300, vof); - - r300->hw.vof.cmd[R300_VOF_CNTL_0]=0; - r300->hw.vof.cmd[R300_VOF_CNTL_1]=0; - + + 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; - + 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; - + 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; - + 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(OutputsWritten & (1 << VERT_RESULT_BFC1)) - r300->hw.vof.cmd[R300_VOF_CNTL_0] |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_3_PRESENT;*/ + 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)) if (OutputsWritten & (1 << VERT_RESULT_PSIZ)) - r300->hw.vof.cmd[R300_VOF_CNTL_0] |= R300_VAP_OUTPUT_VTX_FMT_0__PT_SIZE_PRESENT; + 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)); - 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)); - rmesa->state.aos_count = nr; - + return R300_FALLBACK_NONE; } @@ -601,37 +652,40 @@ void r300UseArrays(GLcontext * ctx) { r300ContextPtr rmesa = R300_CONTEXT(ctx); int i; - - if(rmesa->state.elt_dma.buf) + + if (rmesa->state.elt_dma.buf) radeon_mm_use(rmesa, rmesa->state.elt_dma.buf->id); - - for (i=0; i < rmesa->state.aos_count;i++) { + + for (i = 0; i < rmesa->state.aos_count; i++) { if (rmesa->state.aos[i].buf) radeon_mm_use(rmesa, rmesa->state.aos[i].buf->id); } - + #ifdef HW_VBOS - + #define USE_VBO(a) \ do { \ if (ctx->Array.ArrayObj->a.BufferObj->Name \ && ctx->Array.ArrayObj->a.Enabled) \ radeon_mm_use(rmesa, ((struct r300_buffer_object *)ctx->Array.ArrayObj->a.BufferObj)->id); \ } while(0) - - if (ctx->Array.ElementArrayBufferObj->Name && ctx->Array.ElementArrayBufferObj->OnCard) - radeon_mm_use(rmesa, ((struct r300_buffer_object *)ctx->Array.ElementArrayBufferObj)->id); - + + if (ctx->Array.ElementArrayBufferObj->Name + && ctx->Array.ElementArrayBufferObj->OnCard) + radeon_mm_use(rmesa, + ((struct r300_buffer_object *)ctx->Array. + ElementArrayBufferObj)->id); + USE_VBO(Vertex); USE_VBO(Normal); USE_VBO(Color); USE_VBO(SecondaryColor); USE_VBO(FogCoord); - - for (i=0; i < MAX_TEXTURE_COORD_UNITS; i++) + + for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) USE_VBO(TexCoord[i]); #endif - + } #endif @@ -641,7 +695,8 @@ void r300ReleaseArrays(GLcontext * ctx) int i; r300ReleaseDmaRegion(rmesa, &rmesa->state.elt_dma, __FUNCTION__); - for (i=0;istate.aos_count;i++) { - r300ReleaseDmaRegion(rmesa, &rmesa->state.aos[i], __FUNCTION__); + for (i = 0; i < rmesa->state.aos_count; i++) { + r300ReleaseDmaRegion(rmesa, &rmesa->state.aos[i], + __FUNCTION__); } } diff --git a/src/mesa/drivers/dri/r300/r300_maos.h b/src/mesa/drivers/dri/r300/r300_maos.h index ab283178944..67fc6e2490d 100644 --- a/src/mesa/drivers/dri/r300/r300_maos.h +++ b/src/mesa/drivers/dri/r300/r300_maos.h @@ -39,8 +39,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_context.h" -extern void r300EmitElts(GLcontext * ctx, void *elts, unsigned long n_elts, int elt_size); -extern int r300EmitArrays(GLcontext *ctx); +extern void r300EmitElts(GLcontext * ctx, void *elts, unsigned long n_elts, + int elt_size); +extern int r300EmitArrays(GLcontext * ctx); #ifdef USER_BUFFERS void r300UseArrays(GLcontext * ctx); @@ -50,4 +51,3 @@ extern void r300ReleaseArrays(GLcontext * ctx); #endif #endif - -- cgit v1.2.3 From 6665658a568058150d33cd39dd4635472052b99d Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 02:50:13 +0000 Subject: r300: Indented r300_shader.[ch]. --- src/mesa/drivers/dri/r300/r300_shader.c | 89 +++++++++++++++++---------------- 1 file changed, 47 insertions(+), 42 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_shader.c b/src/mesa/drivers/dri/r300/r300_shader.c index 41c07a31888..9f300e0d95b 100644 --- a/src/mesa/drivers/dri/r300/r300_shader.c +++ b/src/mesa/drivers/dri/r300/r300_shader.c @@ -8,81 +8,86 @@ #include "r300_fragprog.h" static void -r300BindProgram(GLcontext *ctx, GLenum target, struct gl_program *prog) +r300BindProgram(GLcontext * ctx, GLenum target, struct gl_program *prog) { - switch(target){ - case GL_VERTEX_PROGRAM_ARB: - case GL_FRAGMENT_PROGRAM_ARB: + switch (target) { + case GL_VERTEX_PROGRAM_ARB: + case GL_FRAGMENT_PROGRAM_ARB: break; - default: - WARN_ONCE("Target not supported yet!\n"); + default: + WARN_ONCE("Target not supported yet!\n"); break; } } -static struct gl_program * -r300NewProgram(GLcontext *ctx, GLenum target, GLuint id) +static struct gl_program *r300NewProgram(GLcontext * ctx, GLenum target, + GLuint id) { struct r300_vertex_program_cont *vp; struct r300_fragment_program *fp; - - switch(target){ - case GL_VERTEX_STATE_PROGRAM_NV: - case GL_VERTEX_PROGRAM_ARB: - vp=CALLOC_STRUCT(r300_vertex_program_cont); - return _mesa_init_vertex_program(ctx, &vp->mesa_program, target, id); - case GL_FRAGMENT_PROGRAM_ARB: - fp=CALLOC_STRUCT(r300_fragment_program); - fp->ctx = ctx; - return _mesa_init_fragment_program(ctx, &fp->mesa_program, target, id); - case GL_FRAGMENT_PROGRAM_NV: - fp=CALLOC_STRUCT(r300_fragment_program); - return _mesa_init_fragment_program(ctx, &fp->mesa_program, target, id); - default: - _mesa_problem(ctx, "Bad target in r300NewProgram"); + + switch (target) { + case GL_VERTEX_STATE_PROGRAM_NV: + case GL_VERTEX_PROGRAM_ARB: + vp = CALLOC_STRUCT(r300_vertex_program_cont); + return _mesa_init_vertex_program(ctx, &vp->mesa_program, + target, id); + case GL_FRAGMENT_PROGRAM_ARB: + fp = CALLOC_STRUCT(r300_fragment_program); + fp->ctx = ctx; + return _mesa_init_fragment_program(ctx, &fp->mesa_program, + target, id); + case GL_FRAGMENT_PROGRAM_NV: + fp = CALLOC_STRUCT(r300_fragment_program); + return _mesa_init_fragment_program(ctx, &fp->mesa_program, + target, id); + default: + _mesa_problem(ctx, "Bad target in r300NewProgram"); } - - return NULL; + + return NULL; } -static void -r300DeleteProgram(GLcontext *ctx, struct gl_program *prog) +static void r300DeleteProgram(GLcontext * ctx, struct gl_program *prog) { _mesa_delete_program(ctx, prog); } static void -r300ProgramStringNotify(GLcontext *ctx, GLenum target, struct gl_program *prog) +r300ProgramStringNotify(GLcontext * ctx, GLenum target, + struct gl_program *prog) { - struct r300_vertex_program_cont *vp=(void *)prog; - struct r300_fragment_program *fp = (struct r300_fragment_program *) prog; - - switch(target) { + struct r300_vertex_program_cont *vp = (void *)prog; + struct r300_fragment_program *fp = + (struct r300_fragment_program *)prog; + + switch (target) { case GL_VERTEX_PROGRAM_ARB: vp->progs = NULL; /*vp->translated = GL_FALSE; - memset(&vp->translated, 0, sizeof(struct r300_vertex_program) - sizeof(struct gl_vertex_program));*/ - /*r300_translate_vertex_shader(vp);*/ - break; + memset(&vp->translated, 0, sizeof(struct r300_vertex_program) - sizeof(struct gl_vertex_program)); */ + /*r300_translate_vertex_shader(vp); */ + break; case GL_FRAGMENT_PROGRAM_ARB: fp->translated = GL_FALSE; - break; + break; } /* need this for tcl fallbacks */ _tnl_program_string(ctx, target, prog); } static GLboolean -r300IsProgramNative(GLcontext *ctx, GLenum target, struct gl_program *prog) +r300IsProgramNative(GLcontext * ctx, GLenum target, + struct gl_program *prog) { return 1; } void r300InitShaderFuncs(struct dd_function_table *functions) { - functions->NewProgram=r300NewProgram; - functions->BindProgram=r300BindProgram; - functions->DeleteProgram=r300DeleteProgram; - functions->ProgramStringNotify=r300ProgramStringNotify; - functions->IsProgramNative=r300IsProgramNative; + functions->NewProgram = r300NewProgram; + functions->BindProgram = r300BindProgram; + functions->DeleteProgram = r300DeleteProgram; + functions->ProgramStringNotify = r300ProgramStringNotify; + functions->IsProgramNative = r300IsProgramNative; } -- cgit v1.2.3 From 5c8296a6ab9ae443fecba220251d70c6670b14ed Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 02:51:13 +0000 Subject: r300: Indented r300_cmdbuf.[ch]. --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 492 +++++++++++++++++--------------- src/mesa/drivers/dri/r300/r300_cmdbuf.h | 42 +-- 2 files changed, 285 insertions(+), 249 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 77d0add3e35..dbb38bf3acd 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -52,15 +52,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_emit.h" #include "r300_state.h" - // Set this to 1 for extremely verbose debugging of command buffers #define DEBUG_CMDBUF 0 - /** * Send the current command buffer via ioctl to the hardware. */ -int r300FlushCmdBufLocked(r300ContextPtr r300, const char* caller) +int r300FlushCmdBufLocked(r300ContextPtr r300, const char *caller) { int ret; int i; @@ -83,22 +81,25 @@ int r300FlushCmdBufLocked(r300ContextPtr r300, const char* caller) r300->cmdbuf.cmd_buf[i]); } - cmd.buf = (char*)(r300->cmdbuf.cmd_buf + start); + cmd.buf = (char *)(r300->cmdbuf.cmd_buf + start); cmd.bufsz = (r300->cmdbuf.count_used - start) * 4; if (r300->radeon.state.scissor.enabled) { cmd.nbox = r300->radeon.state.scissor.numClipRects; - cmd.boxes = (drm_clip_rect_t *)r300->radeon.state.scissor.pClipRects; + cmd.boxes = + (drm_clip_rect_t *) r300->radeon.state.scissor. + pClipRects; } else { cmd.nbox = r300->radeon.numClipRects; - cmd.boxes = (drm_clip_rect_t *)r300->radeon.pClipRects; + cmd.boxes = (drm_clip_rect_t *) r300->radeon.pClipRects; } - + ret = drmCommandWrite(r300->radeon.dri.fd, - DRM_RADEON_CMDBUF, &cmd, sizeof(cmd)); - + DRM_RADEON_CMDBUF, &cmd, sizeof(cmd)); + if (RADEON_DEBUG & DEBUG_SYNC) { - fprintf(stderr, "Syncing in %s (from %s)\n\n", __FUNCTION__, caller); + fprintf(stderr, "Syncing in %s (from %s)\n\n", + __FUNCTION__, caller); radeonWaitForIdleLocked(&r300->radeon); } @@ -109,14 +110,13 @@ int r300FlushCmdBufLocked(r300ContextPtr r300, const char* caller) return ret; } - -int r300FlushCmdBuf(r300ContextPtr r300, const char* caller) +int r300FlushCmdBuf(r300ContextPtr r300, const char *caller) { int ret; LOCK_HARDWARE(&r300->radeon); - ret=r300FlushCmdBufLocked(r300, caller); + ret = r300FlushCmdBufLocked(r300, caller); UNLOCK_HARDWARE(&r300->radeon); @@ -128,18 +128,19 @@ int r300FlushCmdBuf(r300ContextPtr r300, const char* caller) return ret; } - -void r300_print_state_atom(r300ContextPtr r300, struct r300_state_atom *state) +void r300_print_state_atom(r300ContextPtr r300, + struct r300_state_atom *state) { int i; - int dwords = (*state->check)(r300, state); + int dwords = (*state->check) (r300, state); - fprintf(stderr, " emit %s/%d/%d\n", state->name, dwords, state->cmd_size); + 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", state->name, i, - state->cmd[i]); + fprintf(stderr, " %s[%d]: %08X\n", + state->name, i, state->cmd[i]); } /** @@ -148,22 +149,24 @@ void r300_print_state_atom(r300ContextPtr r300, struct r300_state_atom *state) * The caller must have ensured that there is enough space in the command * buffer. */ -static __inline__ void r300DoEmitState(r300ContextPtr r300, GLboolean dirty) +static __inline__ void r300DoEmitState(r300ContextPtr r300, + GLboolean dirty) { - struct r300_state_atom* atom; - uint32_t* dest; + struct r300_state_atom *atom; + uint32_t *dest; 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); + int dwords = (*atom->check) (r300, atom); if (dwords) r300_print_state_atom(r300, atom); else - fprintf(stderr, " skip state %s\n", + fprintf(stderr, + " skip state %s\n", atom->name); } } @@ -171,32 +174,31 @@ static __inline__ void r300DoEmitState(r300ContextPtr r300, GLboolean dirty) /* Emit WAIT */ *dest = cmdwait(R300_WAIT_3D | R300_WAIT_3D_CLEAN); - dest ++; - r300->cmdbuf.count_used ++; + dest++; + r300->cmdbuf.count_used++; /* Emit cache flush */ *dest = cmdpacket0(R300_TX_CNTL, 1); - dest ++; - r300->cmdbuf.count_used ++; - + dest++; + r300->cmdbuf.count_used++; + *dest = R300_TX_FLUSH; - dest ++; - r300->cmdbuf.count_used ++; - + dest++; + r300->cmdbuf.count_used++; + /* Emit END3D */ *dest = cmdpacify(); - dest ++; - r300->cmdbuf.count_used ++; - + dest++; + r300->cmdbuf.count_used++; /* Emit actual atoms */ foreach(atom, &r300->hw.atomlist) { if ((atom->dirty || r300->hw.all_dirty) == dirty) { - int dwords = (*atom->check)(r300, atom); + int dwords = (*atom->check) (r300, atom); if (dwords) { - memcpy(dest, atom->cmd, dwords*4); + memcpy(dest, atom->cmd, dwords * 4); dest += dwords; r300->cmdbuf.count_used += dwords; atom->dirty = GL_FALSE; @@ -216,7 +218,8 @@ void r300EmitState(r300ContextPtr r300) if (RADEON_DEBUG & (DEBUG_STATE | DEBUG_PRIMS)) fprintf(stderr, "%s\n", __FUNCTION__); - if (r300->cmdbuf.count_used && !r300->hw.is_dirty && !r300->hw.all_dirty) + if (r300->cmdbuf.count_used && !r300->hw.is_dirty + && !r300->hw.all_dirty) return; /* To avoid going across the entire set of states multiple times, just check @@ -255,13 +258,12 @@ static int check_##NM( r300ContextPtr r300, \ #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 ) - +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 - #define ALLOC_STATE( ATOM, CHK, SZ, NM, IDX ) \ do { \ r300->hw.ATOM.cmd_size = (SZ); \ @@ -272,8 +274,6 @@ CHECK( vpu, vpu_count(atom->cmd) ? (1 + vpu_count(atom->cmd)*4) : 0 ) r300->hw.ATOM.dirty = GL_FALSE; \ r300->hw.max_state_size += (SZ); \ } while (0) - - /** * Allocate memory for the command buffer and initialize the state atom * list. Note that the initial hardware state is set by r300InitState(). @@ -284,9 +284,9 @@ void r300InitCmdBuf(r300ContextPtr r300) int has_tcl = 1; if (!(r300->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) - has_tcl = 0; + has_tcl = 0; - r300->hw.max_state_size = 2+2; /* reserve extra space for WAIT_IDLE and tex cache flush */ + r300->hw.max_state_size = 2 + 2; /* reserve extra space for WAIT_IDLE and tex cache flush */ mtu = r300->radeon.glCtx->Const.MaxTextureUnits; if (RADEON_DEBUG & DEBUG_TEXTURE) { @@ -294,175 +294,210 @@ void r300InitCmdBuf(r300ContextPtr r300) } /* Initialize state atoms */ - ALLOC_STATE( vpt, always, R300_VPT_CMDSIZE, "vpt", 0 ); - r300->hw.vpt.cmd[R300_VPT_CMD_0] = cmdpacket0(R300_SE_VPORT_XSCALE, 6); - ALLOC_STATE( vap_cntl, always, 2, "vap_cntl", 0 ); + ALLOC_STATE(vpt, always, R300_VPT_CMDSIZE, "vpt", 0); + r300->hw.vpt.cmd[R300_VPT_CMD_0] = + cmdpacket0(R300_SE_VPORT_XSCALE, 6); + ALLOC_STATE(vap_cntl, always, 2, "vap_cntl", 0); r300->hw.vap_cntl.cmd[0] = cmdpacket0(R300_VAP_CNTL, 1); - ALLOC_STATE( vte, always, 3, "vte", 0 ); + ALLOC_STATE(vte, always, 3, "vte", 0); r300->hw.vte.cmd[0] = cmdpacket0(R300_SE_VTE_CNTL, 2); - ALLOC_STATE( unk2134, always, 3, "unk2134", 0 ); + ALLOC_STATE(unk2134, always, 3, "unk2134", 0); r300->hw.unk2134.cmd[0] = cmdpacket0(0x2134, 2); - ALLOC_STATE( vap_cntl_status, always, 2, "vap_cntl_status", 0 ); - r300->hw.vap_cntl_status.cmd[0] = cmdpacket0(R300_VAP_CNTL_STATUS, 1); - ALLOC_STATE( vir[0], variable, R300_VIR_CMDSIZE, "vir/0", 0 ); - r300->hw.vir[0].cmd[R300_VIR_CMD_0] = cmdpacket0(R300_VAP_INPUT_ROUTE_0_0, 1); - ALLOC_STATE( vir[1], variable, R300_VIR_CMDSIZE, "vir/1", 1 ); - r300->hw.vir[1].cmd[R300_VIR_CMD_0] = cmdpacket0(R300_VAP_INPUT_ROUTE_1_0, 1); - ALLOC_STATE( vic, always, R300_VIC_CMDSIZE, "vic", 0 ); - r300->hw.vic.cmd[R300_VIC_CMD_0] = cmdpacket0(R300_VAP_INPUT_CNTL_0, 2); - ALLOC_STATE( unk21DC, always, 2, "unk21DC", 0 ); + ALLOC_STATE(vap_cntl_status, always, 2, "vap_cntl_status", 0); + r300->hw.vap_cntl_status.cmd[0] = + cmdpacket0(R300_VAP_CNTL_STATUS, 1); + ALLOC_STATE(vir[0], variable, R300_VIR_CMDSIZE, "vir/0", 0); + r300->hw.vir[0].cmd[R300_VIR_CMD_0] = + cmdpacket0(R300_VAP_INPUT_ROUTE_0_0, 1); + ALLOC_STATE(vir[1], variable, R300_VIR_CMDSIZE, "vir/1", 1); + r300->hw.vir[1].cmd[R300_VIR_CMD_0] = + cmdpacket0(R300_VAP_INPUT_ROUTE_1_0, 1); + ALLOC_STATE(vic, always, R300_VIC_CMDSIZE, "vic", 0); + r300->hw.vic.cmd[R300_VIC_CMD_0] = + cmdpacket0(R300_VAP_INPUT_CNTL_0, 2); + ALLOC_STATE(unk21DC, always, 2, "unk21DC", 0); r300->hw.unk21DC.cmd[0] = cmdpacket0(0x21DC, 1); - ALLOC_STATE( unk221C, always, 2, "unk221C", 0 ); + ALLOC_STATE(unk221C, always, 2, "unk221C", 0); r300->hw.unk221C.cmd[0] = cmdpacket0(R300_VAP_UNKNOWN_221C, 1); - ALLOC_STATE( unk2220, always, 5, "unk2220", 0 ); + ALLOC_STATE(unk2220, always, 5, "unk2220", 0); r300->hw.unk2220.cmd[0] = cmdpacket0(0x2220, 4); - ALLOC_STATE( unk2288, always, 2, "unk2288", 0 ); + ALLOC_STATE(unk2288, always, 2, "unk2288", 0); r300->hw.unk2288.cmd[0] = cmdpacket0(R300_VAP_UNKNOWN_2288, 1); - ALLOC_STATE( vof, always, R300_VOF_CMDSIZE, "vof", 0 ); - r300->hw.vof.cmd[R300_VOF_CMD_0] = cmdpacket0(R300_VAP_OUTPUT_VTX_FMT_0, 2); - + ALLOC_STATE(vof, always, R300_VOF_CMDSIZE, "vof", 0); + r300->hw.vof.cmd[R300_VOF_CMD_0] = + cmdpacket0(R300_VAP_OUTPUT_VTX_FMT_0, 2); + if (has_tcl) { - ALLOC_STATE( pvs, always, R300_PVS_CMDSIZE, "pvs", 0 ); - r300->hw.pvs.cmd[R300_PVS_CMD_0] = cmdpacket0(R300_VAP_PVS_CNTL_1, 3); + ALLOC_STATE(pvs, always, R300_PVS_CMDSIZE, "pvs", 0); + r300->hw.pvs.cmd[R300_PVS_CMD_0] = + cmdpacket0(R300_VAP_PVS_CNTL_1, 3); } - ALLOC_STATE( gb_enable, always, 2, "gb_enable", 0 ); - r300->hw.gb_enable.cmd[0] = cmdpacket0(R300_GB_ENABLE, 1); - ALLOC_STATE( gb_misc, always, R300_GB_MISC_CMDSIZE, "gb_misc", 0 ); - r300->hw.gb_misc.cmd[0] = cmdpacket0(R300_GB_MSPOS0, 5); - ALLOC_STATE( txe, always, R300_TXE_CMDSIZE, "txe", 0 ); - r300->hw.txe.cmd[R300_TXE_CMD_0] = cmdpacket0(R300_TX_ENABLE, 1); - ALLOC_STATE( unk4200, always, 5, "unk4200", 0 ); - r300->hw.unk4200.cmd[0] = cmdpacket0(0x4200, 4); - ALLOC_STATE( unk4214, always, 2, "unk4214", 0 ); - r300->hw.unk4214.cmd[0] = cmdpacket0(0x4214, 1); - ALLOC_STATE( ps, always, R300_PS_CMDSIZE, "ps", 0 ); - r300->hw.ps.cmd[0] = cmdpacket0(R300_RE_POINTSIZE, 1); - ALLOC_STATE( unk4230, always, 4, "unk4230", 0 ); - r300->hw.unk4230.cmd[0] = cmdpacket0(0x4230, 3); - ALLOC_STATE( lcntl, always, 2, "lcntl", 0 ); - r300->hw.lcntl.cmd[0] = cmdpacket0(R300_RE_LINE_CNT, 1); - ALLOC_STATE( unk4260, always, 4, "unk4260", 0 ); - r300->hw.unk4260.cmd[0] = cmdpacket0(0x4260, 3); - ALLOC_STATE( shade, always, 5, "shade", 0 ); - r300->hw.shade.cmd[0] = cmdpacket0(R300_RE_SHADE, 4); - ALLOC_STATE( polygon_mode, always, 4, "polygon_mode", 0 ); - r300->hw.polygon_mode.cmd[0] = cmdpacket0(R300_RE_POLYGON_MODE, 3); - ALLOC_STATE( fogp, always, 3, "fogp", 0 ); - r300->hw.fogp.cmd[0] = cmdpacket0(R300_RE_FOG_SCALE, 2); - ALLOC_STATE( zbias_cntl, always, 2, "zbias_cntl", 0 ); - r300->hw.zbias_cntl.cmd[0] = cmdpacket0(R300_RE_ZBIAS_CNTL, 1); - ALLOC_STATE( zbs, always, R300_ZBS_CMDSIZE, "zbs", 0 ); - r300->hw.zbs.cmd[R300_ZBS_CMD_0] = cmdpacket0(R300_RE_ZBIAS_T_FACTOR, 4); - ALLOC_STATE( occlusion_cntl, always, 2, "occlusion_cntl", 0 ); - r300->hw.occlusion_cntl.cmd[0] = cmdpacket0(R300_RE_OCCLUSION_CNTL, 1); - ALLOC_STATE( cul, always, R300_CUL_CMDSIZE, "cul", 0 ); - r300->hw.cul.cmd[R300_CUL_CMD_0] = cmdpacket0(R300_RE_CULL_CNTL, 1); - ALLOC_STATE( unk42C0, always, 3, "unk42C0", 0 ); - r300->hw.unk42C0.cmd[0] = cmdpacket0(0x42C0, 2); - ALLOC_STATE( rc, always, R300_RC_CMDSIZE, "rc", 0 ); - r300->hw.rc.cmd[R300_RC_CMD_0] = cmdpacket0(R300_RS_CNTL_0, 2); - ALLOC_STATE( ri, always, R300_RI_CMDSIZE, "ri", 0 ); - r300->hw.ri.cmd[R300_RI_CMD_0] = cmdpacket0(R300_RS_INTERP_0, 8); - ALLOC_STATE( rr, variable, R300_RR_CMDSIZE, "rr", 0 ); - r300->hw.rr.cmd[R300_RR_CMD_0] = cmdpacket0(R300_RS_ROUTE_0, 1); - ALLOC_STATE( unk43A4, always, 3, "unk43A4", 0 ); - r300->hw.unk43A4.cmd[0] = cmdpacket0(0x43A4, 2); - ALLOC_STATE( unk43E8, always, 2, "unk43E8", 0 ); - r300->hw.unk43E8.cmd[0] = cmdpacket0(0x43E8, 1); - ALLOC_STATE( fp, always, R300_FP_CMDSIZE, "fp", 0 ); - r300->hw.fp.cmd[R300_FP_CMD_0] = cmdpacket0(R300_PFS_CNTL_0, 3); - r300->hw.fp.cmd[R300_FP_CMD_1] = cmdpacket0(R300_PFS_NODE_0, 4); - ALLOC_STATE( fpt, variable, R300_FPT_CMDSIZE, "fpt", 0 ); - r300->hw.fpt.cmd[R300_FPT_CMD_0] = cmdpacket0(R300_PFS_TEXI_0, 0); - ALLOC_STATE( unk46A4, always, 6, "unk46A4", 0 ); - r300->hw.unk46A4.cmd[0] = cmdpacket0(0x46A4, 5); - ALLOC_STATE( fpi[0], variable, R300_FPI_CMDSIZE, "fpi/0", 0 ); - r300->hw.fpi[0].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR0_0, 1); - ALLOC_STATE( fpi[1], variable, R300_FPI_CMDSIZE, "fpi/1", 1 ); - r300->hw.fpi[1].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR1_0, 1); - ALLOC_STATE( fpi[2], variable, R300_FPI_CMDSIZE, "fpi/2", 2 ); - r300->hw.fpi[2].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR2_0, 1); - ALLOC_STATE( fpi[3], variable, R300_FPI_CMDSIZE, "fpi/3", 3 ); - r300->hw.fpi[3].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR3_0, 1); - ALLOC_STATE( fogs, always, R300_FOGS_CMDSIZE, "fogs", 0 ); - r300->hw.fogs.cmd[R300_FOGS_CMD_0] = cmdpacket0(R300_RE_FOG_STATE, 1); - ALLOC_STATE( fogc, always, R300_FOGC_CMDSIZE, "fogc", 0 ); - r300->hw.fogc.cmd[R300_FOGC_CMD_0] = cmdpacket0(R300_FOG_COLOR_R, 3); - ALLOC_STATE( at, always, R300_AT_CMDSIZE, "at", 0 ); - r300->hw.at.cmd[R300_AT_CMD_0] = cmdpacket0(R300_PP_ALPHA_TEST, 2); - ALLOC_STATE( unk4BD8, always, 2, "unk4BD8", 0 ); - r300->hw.unk4BD8.cmd[0] = cmdpacket0(0x4BD8, 1); - ALLOC_STATE( fpp, variable, R300_FPP_CMDSIZE, "fpp", 0 ); - r300->hw.fpp.cmd[R300_FPP_CMD_0] = cmdpacket0(R300_PFS_PARAM_0_X, 0); - ALLOC_STATE( unk4E00, always, 2, "unk4E00", 0 ); - r300->hw.unk4E00.cmd[0] = cmdpacket0(0x4E00, 1); - ALLOC_STATE( bld, always, R300_BLD_CMDSIZE, "bld", 0 ); - r300->hw.bld.cmd[R300_BLD_CMD_0] = cmdpacket0(R300_RB3D_CBLEND, 2); - ALLOC_STATE( cmk, always, R300_CMK_CMDSIZE, "cmk", 0 ); - r300->hw.cmk.cmd[R300_CMK_CMD_0] = cmdpacket0(R300_RB3D_COLORMASK, 1); - ALLOC_STATE( blend_color, always, 4, "blend_color", 0 ); - r300->hw.blend_color.cmd[0] = cmdpacket0(R300_RB3D_BLEND_COLOR, 3); - ALLOC_STATE( cb, always, R300_CB_CMDSIZE, "cb", 0 ); - r300->hw.cb.cmd[R300_CB_CMD_0] = cmdpacket0(R300_RB3D_COLOROFFSET0, 1); - r300->hw.cb.cmd[R300_CB_CMD_1] = cmdpacket0(R300_RB3D_COLORPITCH0, 1); - ALLOC_STATE( unk4E50, always, 10, "unk4E50", 0 ); - r300->hw.unk4E50.cmd[0] = cmdpacket0(0x4E50, 9); - ALLOC_STATE( unk4E88, always, 2, "unk4E88", 0 ); - r300->hw.unk4E88.cmd[0] = cmdpacket0(0x4E88, 1); - ALLOC_STATE( unk4EA0, always, 3, "unk4EA0 R350 only", 0 ); - r300->hw.unk4EA0.cmd[0] = cmdpacket0(0x4EA0, 2); - ALLOC_STATE( zs, always, R300_ZS_CMDSIZE, "zstencil", 0 ); - r300->hw.zs.cmd[R300_ZS_CMD_0] = cmdpacket0(R300_RB3D_ZSTENCIL_CNTL_0, 3); - ALLOC_STATE( zstencil_format, always, 5, "zstencil_format", 0 ); - r300->hw.zstencil_format.cmd[0] = cmdpacket0(R300_RB3D_ZSTENCIL_FORMAT, 4); - ALLOC_STATE( zb, always, R300_ZB_CMDSIZE, "zb", 0 ); - r300->hw.zb.cmd[R300_ZB_CMD_0] = cmdpacket0(R300_RB3D_DEPTHOFFSET, 2); - ALLOC_STATE( unk4F28, always, 2, "unk4F28", 0 ); + ALLOC_STATE(gb_enable, always, 2, "gb_enable", 0); + r300->hw.gb_enable.cmd[0] = cmdpacket0(R300_GB_ENABLE, 1); + ALLOC_STATE(gb_misc, always, R300_GB_MISC_CMDSIZE, "gb_misc", 0); + r300->hw.gb_misc.cmd[0] = cmdpacket0(R300_GB_MSPOS0, 5); + ALLOC_STATE(txe, always, R300_TXE_CMDSIZE, "txe", 0); + r300->hw.txe.cmd[R300_TXE_CMD_0] = cmdpacket0(R300_TX_ENABLE, 1); + ALLOC_STATE(unk4200, always, 5, "unk4200", 0); + r300->hw.unk4200.cmd[0] = cmdpacket0(0x4200, 4); + ALLOC_STATE(unk4214, always, 2, "unk4214", 0); + r300->hw.unk4214.cmd[0] = cmdpacket0(0x4214, 1); + ALLOC_STATE(ps, always, R300_PS_CMDSIZE, "ps", 0); + r300->hw.ps.cmd[0] = cmdpacket0(R300_RE_POINTSIZE, 1); + ALLOC_STATE(unk4230, always, 4, "unk4230", 0); + r300->hw.unk4230.cmd[0] = cmdpacket0(0x4230, 3); + ALLOC_STATE(lcntl, always, 2, "lcntl", 0); + r300->hw.lcntl.cmd[0] = cmdpacket0(R300_RE_LINE_CNT, 1); + ALLOC_STATE(unk4260, always, 4, "unk4260", 0); + r300->hw.unk4260.cmd[0] = cmdpacket0(0x4260, 3); + ALLOC_STATE(shade, always, 5, "shade", 0); + r300->hw.shade.cmd[0] = cmdpacket0(R300_RE_SHADE, 4); + ALLOC_STATE(polygon_mode, always, 4, "polygon_mode", 0); + r300->hw.polygon_mode.cmd[0] = cmdpacket0(R300_RE_POLYGON_MODE, 3); + ALLOC_STATE(fogp, always, 3, "fogp", 0); + r300->hw.fogp.cmd[0] = cmdpacket0(R300_RE_FOG_SCALE, 2); + ALLOC_STATE(zbias_cntl, always, 2, "zbias_cntl", 0); + r300->hw.zbias_cntl.cmd[0] = cmdpacket0(R300_RE_ZBIAS_CNTL, 1); + ALLOC_STATE(zbs, always, R300_ZBS_CMDSIZE, "zbs", 0); + r300->hw.zbs.cmd[R300_ZBS_CMD_0] = + cmdpacket0(R300_RE_ZBIAS_T_FACTOR, 4); + ALLOC_STATE(occlusion_cntl, always, 2, "occlusion_cntl", 0); + r300->hw.occlusion_cntl.cmd[0] = + cmdpacket0(R300_RE_OCCLUSION_CNTL, 1); + ALLOC_STATE(cul, always, R300_CUL_CMDSIZE, "cul", 0); + r300->hw.cul.cmd[R300_CUL_CMD_0] = + cmdpacket0(R300_RE_CULL_CNTL, 1); + ALLOC_STATE(unk42C0, always, 3, "unk42C0", 0); + r300->hw.unk42C0.cmd[0] = cmdpacket0(0x42C0, 2); + ALLOC_STATE(rc, always, R300_RC_CMDSIZE, "rc", 0); + r300->hw.rc.cmd[R300_RC_CMD_0] = cmdpacket0(R300_RS_CNTL_0, 2); + ALLOC_STATE(ri, always, R300_RI_CMDSIZE, "ri", 0); + r300->hw.ri.cmd[R300_RI_CMD_0] = cmdpacket0(R300_RS_INTERP_0, 8); + ALLOC_STATE(rr, variable, R300_RR_CMDSIZE, "rr", 0); + r300->hw.rr.cmd[R300_RR_CMD_0] = cmdpacket0(R300_RS_ROUTE_0, 1); + ALLOC_STATE(unk43A4, always, 3, "unk43A4", 0); + r300->hw.unk43A4.cmd[0] = cmdpacket0(0x43A4, 2); + ALLOC_STATE(unk43E8, always, 2, "unk43E8", 0); + r300->hw.unk43E8.cmd[0] = cmdpacket0(0x43E8, 1); + ALLOC_STATE(fp, always, R300_FP_CMDSIZE, "fp", 0); + r300->hw.fp.cmd[R300_FP_CMD_0] = cmdpacket0(R300_PFS_CNTL_0, 3); + r300->hw.fp.cmd[R300_FP_CMD_1] = cmdpacket0(R300_PFS_NODE_0, 4); + ALLOC_STATE(fpt, variable, R300_FPT_CMDSIZE, "fpt", 0); + r300->hw.fpt.cmd[R300_FPT_CMD_0] = cmdpacket0(R300_PFS_TEXI_0, 0); + ALLOC_STATE(unk46A4, always, 6, "unk46A4", 0); + r300->hw.unk46A4.cmd[0] = cmdpacket0(0x46A4, 5); + ALLOC_STATE(fpi[0], variable, R300_FPI_CMDSIZE, "fpi/0", 0); + r300->hw.fpi[0].cmd[R300_FPI_CMD_0] = + cmdpacket0(R300_PFS_INSTR0_0, 1); + ALLOC_STATE(fpi[1], variable, R300_FPI_CMDSIZE, "fpi/1", 1); + r300->hw.fpi[1].cmd[R300_FPI_CMD_0] = + cmdpacket0(R300_PFS_INSTR1_0, 1); + ALLOC_STATE(fpi[2], variable, R300_FPI_CMDSIZE, "fpi/2", 2); + r300->hw.fpi[2].cmd[R300_FPI_CMD_0] = + cmdpacket0(R300_PFS_INSTR2_0, 1); + ALLOC_STATE(fpi[3], variable, R300_FPI_CMDSIZE, "fpi/3", 3); + r300->hw.fpi[3].cmd[R300_FPI_CMD_0] = + cmdpacket0(R300_PFS_INSTR3_0, 1); + ALLOC_STATE(fogs, always, R300_FOGS_CMDSIZE, "fogs", 0); + r300->hw.fogs.cmd[R300_FOGS_CMD_0] = + cmdpacket0(R300_RE_FOG_STATE, 1); + ALLOC_STATE(fogc, always, R300_FOGC_CMDSIZE, "fogc", 0); + r300->hw.fogc.cmd[R300_FOGC_CMD_0] = + cmdpacket0(R300_FOG_COLOR_R, 3); + ALLOC_STATE(at, always, R300_AT_CMDSIZE, "at", 0); + r300->hw.at.cmd[R300_AT_CMD_0] = cmdpacket0(R300_PP_ALPHA_TEST, 2); + ALLOC_STATE(unk4BD8, always, 2, "unk4BD8", 0); + r300->hw.unk4BD8.cmd[0] = cmdpacket0(0x4BD8, 1); + ALLOC_STATE(fpp, variable, R300_FPP_CMDSIZE, "fpp", 0); + r300->hw.fpp.cmd[R300_FPP_CMD_0] = + cmdpacket0(R300_PFS_PARAM_0_X, 0); + ALLOC_STATE(unk4E00, always, 2, "unk4E00", 0); + r300->hw.unk4E00.cmd[0] = cmdpacket0(0x4E00, 1); + ALLOC_STATE(bld, always, R300_BLD_CMDSIZE, "bld", 0); + r300->hw.bld.cmd[R300_BLD_CMD_0] = cmdpacket0(R300_RB3D_CBLEND, 2); + ALLOC_STATE(cmk, always, R300_CMK_CMDSIZE, "cmk", 0); + r300->hw.cmk.cmd[R300_CMK_CMD_0] = + cmdpacket0(R300_RB3D_COLORMASK, 1); + ALLOC_STATE(blend_color, always, 4, "blend_color", 0); + r300->hw.blend_color.cmd[0] = cmdpacket0(R300_RB3D_BLEND_COLOR, 3); + ALLOC_STATE(cb, always, R300_CB_CMDSIZE, "cb", 0); + r300->hw.cb.cmd[R300_CB_CMD_0] = + cmdpacket0(R300_RB3D_COLOROFFSET0, 1); + r300->hw.cb.cmd[R300_CB_CMD_1] = + cmdpacket0(R300_RB3D_COLORPITCH0, 1); + ALLOC_STATE(unk4E50, always, 10, "unk4E50", 0); + r300->hw.unk4E50.cmd[0] = cmdpacket0(0x4E50, 9); + ALLOC_STATE(unk4E88, always, 2, "unk4E88", 0); + r300->hw.unk4E88.cmd[0] = cmdpacket0(0x4E88, 1); + ALLOC_STATE(unk4EA0, always, 3, "unk4EA0 R350 only", 0); + r300->hw.unk4EA0.cmd[0] = cmdpacket0(0x4EA0, 2); + ALLOC_STATE(zs, always, R300_ZS_CMDSIZE, "zstencil", 0); + r300->hw.zs.cmd[R300_ZS_CMD_0] = + cmdpacket0(R300_RB3D_ZSTENCIL_CNTL_0, 3); + ALLOC_STATE(zstencil_format, always, 5, "zstencil_format", 0); + r300->hw.zstencil_format.cmd[0] = + cmdpacket0(R300_RB3D_ZSTENCIL_FORMAT, 4); + ALLOC_STATE(zb, always, R300_ZB_CMDSIZE, "zb", 0); + r300->hw.zb.cmd[R300_ZB_CMD_0] = + cmdpacket0(R300_RB3D_DEPTHOFFSET, 2); + ALLOC_STATE(unk4F28, always, 2, "unk4F28", 0); r300->hw.unk4F28.cmd[0] = cmdpacket0(0x4F28, 1); - ALLOC_STATE( unk4F30, always, 3, "unk4F30", 0 ); + ALLOC_STATE(unk4F30, always, 3, "unk4F30", 0); r300->hw.unk4F30.cmd[0] = cmdpacket0(0x4F30, 2); - ALLOC_STATE( unk4F44, always, 2, "unk4F44", 0 ); + ALLOC_STATE(unk4F44, always, 2, "unk4F44", 0); r300->hw.unk4F44.cmd[0] = cmdpacket0(0x4F44, 1); - ALLOC_STATE( unk4F54, always, 2, "unk4F54", 0 ); + ALLOC_STATE(unk4F54, always, 2, "unk4F54", 0); r300->hw.unk4F54.cmd[0] = cmdpacket0(0x4F54, 1); /* VPU only on TCL */ if (has_tcl) { - ALLOC_STATE( vpi, vpu, R300_VPI_CMDSIZE, "vpi", 0 ); - r300->hw.vpi.cmd[R300_VPI_CMD_0] = cmdvpu(R300_PVS_UPLOAD_PROGRAM, 0); - ALLOC_STATE( vpp, vpu, R300_VPP_CMDSIZE, "vpp", 0 ); - r300->hw.vpp.cmd[R300_VPP_CMD_0] = cmdvpu(R300_PVS_UPLOAD_PARAMETERS, 0); - ALLOC_STATE( vps, vpu, R300_VPS_CMDSIZE, "vps", 0 ); - r300->hw.vps.cmd[R300_VPS_CMD_0] = cmdvpu(R300_PVS_UPLOAD_POINTSIZE, 1); + ALLOC_STATE(vpi, vpu, R300_VPI_CMDSIZE, "vpi", 0); + r300->hw.vpi.cmd[R300_VPI_CMD_0] = + cmdvpu(R300_PVS_UPLOAD_PROGRAM, 0); + ALLOC_STATE(vpp, vpu, R300_VPP_CMDSIZE, "vpp", 0); + r300->hw.vpp.cmd[R300_VPP_CMD_0] = + cmdvpu(R300_PVS_UPLOAD_PARAMETERS, 0); + ALLOC_STATE(vps, vpu, R300_VPS_CMDSIZE, "vps", 0); + r300->hw.vps.cmd[R300_VPS_CMD_0] = + cmdvpu(R300_PVS_UPLOAD_POINTSIZE, 1); } /* Textures */ - ALLOC_STATE( tex.filter, variable, mtu+1, "tex_filter", 0 ); - r300->hw.tex.filter.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_FILTER_0, 0); - - ALLOC_STATE( tex.filter_1, variable, mtu+1, "tex_filter_1", 0 ); - r300->hw.tex.filter_1.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_FILTER1_0, 0); - - ALLOC_STATE( tex.size, variable, mtu+1, "tex_size", 0 ); - r300->hw.tex.size.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_SIZE_0, 0); - - ALLOC_STATE( tex.format, variable, mtu+1, "tex_format", 0 ); - r300->hw.tex.format.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_FORMAT_0, 0); - - ALLOC_STATE( tex.pitch, variable, mtu+1, "tex_pitch", 0 ); - r300->hw.tex.pitch.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_PITCH_0, 0); - - ALLOC_STATE( tex.offset, variable, mtu+1, "tex_offset", 0 ); - r300->hw.tex.offset.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_OFFSET_0, 0); - - ALLOC_STATE( tex.chroma_key, variable, mtu+1, "tex_chroma_key", 0 ); - r300->hw.tex.chroma_key.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_CHROMA_KEY_0, 0); - - ALLOC_STATE( tex.border_color, variable, mtu+1, "tex_border_color", 0 ); - r300->hw.tex.border_color.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_BORDER_COLOR_0, 0); - - + ALLOC_STATE(tex.filter, variable, mtu + 1, "tex_filter", 0); + r300->hw.tex.filter.cmd[R300_TEX_CMD_0] = + cmdpacket0(R300_TX_FILTER_0, 0); + + ALLOC_STATE(tex.filter_1, variable, mtu + 1, "tex_filter_1", 0); + r300->hw.tex.filter_1.cmd[R300_TEX_CMD_0] = + cmdpacket0(R300_TX_FILTER1_0, 0); + + ALLOC_STATE(tex.size, variable, mtu + 1, "tex_size", 0); + r300->hw.tex.size.cmd[R300_TEX_CMD_0] = + cmdpacket0(R300_TX_SIZE_0, 0); + + ALLOC_STATE(tex.format, variable, mtu + 1, "tex_format", 0); + r300->hw.tex.format.cmd[R300_TEX_CMD_0] = + cmdpacket0(R300_TX_FORMAT_0, 0); + + ALLOC_STATE(tex.pitch, variable, mtu + 1, "tex_pitch", 0); + r300->hw.tex.pitch.cmd[R300_TEX_CMD_0] = + cmdpacket0(R300_TX_PITCH_0, 0); + + ALLOC_STATE(tex.offset, variable, mtu + 1, "tex_offset", 0); + r300->hw.tex.offset.cmd[R300_TEX_CMD_0] = + cmdpacket0(R300_TX_OFFSET_0, 0); + + ALLOC_STATE(tex.chroma_key, variable, mtu + 1, "tex_chroma_key", + 0); + r300->hw.tex.chroma_key.cmd[R300_TEX_CMD_0] = + cmdpacket0(R300_TX_CHROMA_KEY_0, 0); + + ALLOC_STATE(tex.border_color, variable, mtu + 1, + "tex_border_color", 0); + r300->hw.tex.border_color.cmd[R300_TEX_CMD_0] = + cmdpacket0(R300_TX_BORDER_COLOR_0, 0); + /* Setup the atom linked list */ make_empty_list(&r300->hw.atomlist); r300->hw.atomlist.name = "atom-list"; @@ -482,7 +517,7 @@ void r300InitCmdBuf(r300ContextPtr r300) insert_at_tail(&r300->hw.atomlist, &r300->hw.vof); if (has_tcl) - insert_at_tail(&r300->hw.atomlist, &r300->hw.pvs); + insert_at_tail(&r300->hw.atomlist, &r300->hw.pvs); insert_at_tail(&r300->hw.atomlist, &r300->hw.gb_enable); insert_at_tail(&r300->hw.atomlist, &r300->hw.gb_misc); insert_at_tail(&r300->hw.atomlist, &r300->hw.txe); @@ -534,9 +569,9 @@ void r300InitCmdBuf(r300ContextPtr r300) insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4F54); if (has_tcl) { - insert_at_tail(&r300->hw.atomlist, &r300->hw.vpi); - insert_at_tail(&r300->hw.atomlist, &r300->hw.vpp); - insert_at_tail(&r300->hw.atomlist, &r300->hw.vps); + insert_at_tail(&r300->hw.atomlist, &r300->hw.vpi); + insert_at_tail(&r300->hw.atomlist, &r300->hw.vpp); + insert_at_tail(&r300->hw.atomlist, &r300->hw.vps); } insert_at_tail(&r300->hw.atomlist, &r300->hw.tex.filter); @@ -552,36 +587,37 @@ void r300InitCmdBuf(r300ContextPtr r300) r300->hw.all_dirty = GL_TRUE; /* Initialize command buffer */ - size = 256 * driQueryOptioni(&r300->radeon.optionCache, "command_buffer_size"); - if (size < 2*r300->hw.max_state_size) { - size = 2*r300->hw.max_state_size+65535; + size = + 256 * driQueryOptioni(&r300->radeon.optionCache, + "command_buffer_size"); + if (size < 2 * r300->hw.max_state_size) { + size = 2 * r300->hw.max_state_size + 65535; } - if (size > 64*256) - size = 64*256; + if (size > 64 * 256) + size = 64 * 256; - if (RADEON_DEBUG & (DEBUG_IOCTL|DEBUG_DMA)) { + if (RADEON_DEBUG & (DEBUG_IOCTL | DEBUG_DMA)) { fprintf(stderr, "sizeof(drm_r300_cmd_header_t)=%zd\n", sizeof(drm_r300_cmd_header_t)); fprintf(stderr, "sizeof(drm_radeon_cmd_buffer_t)=%zd\n", sizeof(drm_radeon_cmd_buffer_t)); fprintf(stderr, "Allocating %d bytes command buffer (max state is %d bytes)\n", - size*4, r300->hw.max_state_size*4); + size * 4, r300->hw.max_state_size * 4); } r300->cmdbuf.size = size; - r300->cmdbuf.cmd_buf = (uint32_t*)CALLOC(size*4); + r300->cmdbuf.cmd_buf = (uint32_t *) CALLOC(size * 4); r300->cmdbuf.count_used = 0; r300->cmdbuf.count_reemit = 0; } - /** * Destroy the command buffer and state atoms. */ void r300DestroyCmdBuf(r300ContextPtr r300) { - struct r300_state_atom* atom; + struct r300_state_atom *atom; FREE(r300->cmdbuf.cmd_buf); @@ -658,28 +694,28 @@ void r300EmitAOS(r300ContextPtr rmesa, GLuint nr, GLuint offset) drm_radeon_cmd_header_t *cmd = NULL; if (RADEON_DEBUG & DEBUG_VERTS) - fprintf(stderr, "%s: nr=%d, ofs=0x%08x\n", __func__, nr, offset); + fprintf(stderr, "%s: nr=%d, ofs=0x%08x\n", __func__, nr, + offset); - start_packet3(RADEON_CP_PACKET3_3D_LOAD_VBPNTR, sz-1); + start_packet3(RADEON_CP_PACKET3_3D_LOAD_VBPNTR, sz - 1); e32(nr); - for(i=0;i+1state.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) - ); + 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); + 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); + 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); } } - diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.h b/src/mesa/drivers/dri/r300/r300_cmdbuf.h index b471f2ac463..f4fec670bfc 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.h +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.h @@ -37,9 +37,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_context.h" - -extern int r300FlushCmdBufLocked(r300ContextPtr r300, const char* caller); -extern int r300FlushCmdBuf(r300ContextPtr r300, const char* caller); +extern int r300FlushCmdBufLocked(r300ContextPtr r300, const char *caller); +extern int r300FlushCmdBuf(r300ContextPtr r300, const char *caller); extern void r300EmitState(r300ContextPtr r300); @@ -48,13 +47,13 @@ extern void r300DestroyCmdBuf(r300ContextPtr r300); extern void r300EmitAOS(r300ContextPtr rmesa, GLuint nr, GLuint offset); - /** * Make sure that enough space is available in the command buffer * by flushing if necessary. */ static __inline__ void r300EnsureCmdBufSpace(r300ContextPtr r300, - int dwords, const char* caller) + int dwords, + const char *caller) { assert(dwords < r300->cmdbuf.size); @@ -62,7 +61,6 @@ static __inline__ void r300EnsureCmdBufSpace(r300ContextPtr r300, r300FlushCmdBuf(r300, caller); } - /** * Allocate the given number of dwords in the command buffer and return * a pointer to the allocated area. @@ -70,10 +68,11 @@ 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, - int dwords, const char* caller) +static __inline__ uint32_t *r300RawAllocCmdBuf(r300ContextPtr r300, + int dwords, + const char *caller) { - uint32_t* ptr; + uint32_t *ptr; r300EnsureCmdBufSpace(r300, dwords, caller); @@ -82,16 +81,17 @@ static __inline__ uint32_t* r300RawAllocCmdBuf(r300ContextPtr r300, return ptr; } -static __inline__ uint32_t* r300AllocCmdBuf(r300ContextPtr r300, - int dwords, const char* caller) +static __inline__ uint32_t *r300AllocCmdBuf(r300ContextPtr r300, + int dwords, const char *caller) { - uint32_t* ptr; + uint32_t *ptr; r300EnsureCmdBufSpace(r300, dwords, caller); if (!r300->cmdbuf.count_used) { if (RADEON_DEBUG & DEBUG_IOCTL) - fprintf(stderr, "Reemit state after flush (from %s)\n", + fprintf(stderr, + "Reemit state after flush (from %s)\n", caller); r300EmitState(r300); } @@ -102,17 +102,17 @@ static __inline__ uint32_t* r300AllocCmdBuf(r300ContextPtr r300, } extern void r300EmitBlit(r300ContextPtr rmesa, - GLuint color_fmt, - GLuint src_pitch, - GLuint src_offset, - GLuint dst_pitch, - GLuint dst_offset, - GLint srcx, GLint srcy, - GLint dstx, GLint dsty, GLuint w, GLuint h); + GLuint color_fmt, + GLuint src_pitch, + GLuint src_offset, + GLuint dst_pitch, + GLuint dst_offset, + GLint srcx, GLint srcy, + GLint dstx, GLint dsty, GLuint w, GLuint h); extern void r300EmitWait(r300ContextPtr rmesa, GLuint flags); extern void r300EmitLOAD_VBPNTR(r300ContextPtr rmesa, int start); extern void r300EmitVertexShader(r300ContextPtr rmesa); extern void r300EmitPixelShader(r300ContextPtr rmesa); -#endif /* __R300_CMDBUF_H__ */ +#endif /* __R300_CMDBUF_H__ */ -- cgit v1.2.3 From 36c8bc6141cd8c0aafed02a5fbee15a13b0b0ca1 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 02:52:37 +0000 Subject: r300: Indented r300_emit.h. --- src/mesa/drivers/dri/r300/r300_emit.h | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h index 16ea2c66419..90c2b8c1419 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.h +++ b/src/mesa/drivers/dri/r300/r300_emit.h @@ -208,28 +208,28 @@ void static inline end_3d(r300ContextPtr rmesa) { drm_radeon_cmd_header_t *cmd = NULL; - cmd = (drm_radeon_cmd_header_t*)r300AllocCmdBuf(rmesa, - 1, + cmd = + (drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, 1, __FUNCTION__); - cmd[0].header.cmd_type=R300_CMD_END3D; + cmd[0].header.cmd_type = R300_CMD_END3D; } void static inline cp_delay(r300ContextPtr rmesa, unsigned short count) { drm_radeon_cmd_header_t *cmd = NULL; - cmd = (drm_radeon_cmd_header_t*)r300AllocCmdBuf(rmesa, - 1, + cmd = + (drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, 1, __FUNCTION__); - cmd[0].i=cmdcpdelay(count); + cmd[0].i = cmdcpdelay(count); } void static inline cp_wait(r300ContextPtr rmesa, unsigned char flags) { drm_radeon_cmd_header_t *cmd = NULL; - cmd = (drm_radeon_cmd_header_t*)r300AllocCmdBuf(rmesa, - 1, + cmd = + (drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, 1, __FUNCTION__); cmd[0].i = cmdwait(flags); } @@ -237,7 +237,8 @@ void static inline cp_wait(r300ContextPtr rmesa, unsigned char flags) /** * fire vertex buffer */ -static void inline fire_AOS(r300ContextPtr rmesa, int vertex_count, int type) +static void inline +fire_AOS(r300ContextPtr rmesa, int vertex_count, int type) { int cmd_reserved = 0; int cmd_written = 0; @@ -248,8 +249,8 @@ static void inline fire_AOS(r300ContextPtr rmesa, int vertex_count, int type) #ifdef NOTNEEDED_ANYMORE e32(0x840c0024); #endif - 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); } /** -- cgit v1.2.3 From be56660ba0faf41ec61c79aab2b358c6436dd44b Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 02:59:11 +0000 Subject: r300: Indented r300_state.[ch]. --- src/mesa/drivers/dri/r300/r300_state.c | 1188 ++++++++++++++++++-------------- src/mesa/drivers/dri/r300/r300_state.h | 16 +- 2 files changed, 696 insertions(+), 508 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 96678b82a2e..75d606fdcc4 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -79,7 +79,7 @@ static void r300BlendColor(GLcontext * ctx, const GLfloat cf[4]) CLAMPED_FLOAT_TO_UBYTE(color[3], cf[3]); rmesa->hw.blend_color.cmd[1] = r300PackColor(4, color[3], color[0], - color[1], color[2]); + color[1], color[2]); } /** @@ -133,7 +133,7 @@ static int blend_factor(GLenum factor, GLboolean is_src) break; case GL_SRC_ALPHA_SATURATE: func = (is_src) ? R300_BLEND_GL_SRC_ALPHA_SATURATE : - R300_BLEND_GL_ZERO; + R300_BLEND_GL_ZERO; break; case GL_CONSTANT_COLOR: func = R300_BLEND_GL_CONST_COLOR; @@ -166,12 +166,15 @@ static int blend_factor(GLenum factor, GLboolean is_src) */ /* helper function */ -static void r300_set_blend_cntl(r300ContextPtr r300, int func, int eqn, int cbits, int funcA, int eqnA) +static void r300_set_blend_cntl(r300ContextPtr r300, int func, int eqn, + int cbits, int funcA, int eqnA) { GLuint new_ablend, new_cblend; #if 0 - fprintf(stderr, "eqnA=%08x funcA=%08x eqn=%08x func=%08x cbits=%08x\n", eqnA, funcA, eqn, func, cbits); + fprintf(stderr, + "eqnA=%08x funcA=%08x eqn=%08x func=%08x cbits=%08x\n", + eqnA, funcA, eqn, func, cbits); #endif new_ablend = eqnA | funcA; new_cblend = eqn | func; @@ -184,20 +187,19 @@ static void r300_set_blend_cntl(r300ContextPtr r300, int func, int eqn, int cbit */ #if 0 if (new_ablend == new_cblend) { - new_cblend |= R300_BLEND_NO_SEPARATE; + new_cblend |= R300_BLEND_NO_SEPARATE; } #endif new_cblend |= cbits; - if((new_ablend != r300->hw.bld.cmd[R300_BLD_ABLEND]) || - (new_cblend != r300->hw.bld.cmd[R300_BLD_CBLEND])) { + if ((new_ablend != r300->hw.bld.cmd[R300_BLD_ABLEND]) || + (new_cblend != r300->hw.bld.cmd[R300_BLD_CBLEND])) { R300_STATECHANGE(r300, bld); - r300->hw.bld.cmd[R300_BLD_ABLEND]=new_ablend; - r300->hw.bld.cmd[R300_BLD_CBLEND]=new_cblend; + r300->hw.bld.cmd[R300_BLD_ABLEND] = new_ablend; + r300->hw.bld.cmd[R300_BLD_CBLEND] = new_cblend; } } - static void r300_set_blend_state(GLcontext * ctx) { r300ContextPtr r300 = R300_CONTEXT(ctx); @@ -209,14 +211,15 @@ static void r300_set_blend_state(GLcontext * ctx) int eqnA = R300_COMB_FCN_ADD_CLAMP; if (RGBA_LOGICOP_ENABLED(ctx) || !ctx->Color.BlendEnabled) { - r300_set_blend_cntl(r300, - func, eqn, 0, - func, eqn); + r300_set_blend_cntl(r300, func, eqn, 0, func, eqn); return; } - func = (blend_factor(ctx->Color.BlendSrcRGB, GL_TRUE) << R300_SRC_BLEND_SHIFT) | - (blend_factor(ctx->Color.BlendDstRGB, GL_FALSE) << R300_DST_BLEND_SHIFT); + func = + (blend_factor(ctx->Color.BlendSrcRGB, GL_TRUE) << + R300_SRC_BLEND_SHIFT) | (blend_factor(ctx->Color.BlendDstRGB, + GL_FALSE) << + R300_DST_BLEND_SHIFT); switch (ctx->Color.BlendEquationRGB) { case GL_FUNC_ADD: @@ -250,9 +253,11 @@ static void r300_set_blend_state(GLcontext * ctx) return; } - - funcA = (blend_factor(ctx->Color.BlendSrcA, GL_TRUE) << R300_SRC_BLEND_SHIFT) | - (blend_factor(ctx->Color.BlendDstA, GL_FALSE) << R300_DST_BLEND_SHIFT); + funcA = + (blend_factor(ctx->Color.BlendSrcA, GL_TRUE) << + R300_SRC_BLEND_SHIFT) | (blend_factor(ctx->Color.BlendDstA, + GL_FALSE) << + R300_DST_BLEND_SHIFT); switch (ctx->Color.BlendEquationA) { case GL_FUNC_ADD: @@ -280,14 +285,16 @@ static void r300_set_blend_state(GLcontext * ctx) break; default: - fprintf(stderr, "[%s:%u] Invalid A blend equation (0x%04x).\n", + fprintf(stderr, + "[%s:%u] Invalid A blend equation (0x%04x).\n", __func__, __LINE__, ctx->Color.BlendEquationA); return; } r300_set_blend_cntl(r300, - func, eqn, R300_BLEND_UNKNOWN | R300_BLEND_ENABLE, - funcA, eqnA); + func, eqn, + R300_BLEND_UNKNOWN | R300_BLEND_ENABLE, funcA, + eqnA); } static void r300BlendEquationSeparate(GLcontext * ctx, @@ -306,7 +313,7 @@ static void r300BlendFuncSeparate(GLcontext * ctx, /** * Update our tracked culling state based on Mesa's state. */ -static void r300UpdateCulling(GLcontext* ctx) +static void r300UpdateCulling(GLcontext * ctx) { r300ContextPtr r300 = R300_CONTEXT(ctx); uint32_t val = 0; @@ -314,7 +321,7 @@ static void r300UpdateCulling(GLcontext* ctx) R300_STATECHANGE(r300, cul); if (ctx->Polygon.CullFlag) { if (ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK) - val = R300_CULL_FRONT|R300_CULL_BACK; + val = R300_CULL_FRONT | R300_CULL_BACK; else if (ctx->Polygon.CullFaceMode == GL_FRONT) val = R300_CULL_FRONT; else @@ -328,13 +335,13 @@ static void r300UpdateCulling(GLcontext* ctx) r300->hw.cul.cmd[R300_CUL_CULL] = val; } -static void update_early_z(GLcontext *ctx) +static void update_early_z(GLcontext * ctx) { /* updates register R300_RB3D_EARLY_Z (0x4F14) if depth test is not enabled it should be R300_EARLY_Z_DISABLE if depth is enabled and alpha not it should be R300_EARLY_Z_ENABLE if depth and alpha is enabled it should be R300_EARLY_Z_DISABLE - */ + */ r300ContextPtr r300 = R300_CONTEXT(ctx); R300_STATECHANGE(r300, zstencil_format); @@ -344,14 +351,16 @@ static void update_early_z(GLcontext *ctx) else { if (ctx->Depth.Test && ctx->Depth.Func != GL_NEVER) /* enable early Z */ - r300->hw.zstencil_format.cmd[2] = R300_EARLY_Z_ENABLE; + r300->hw.zstencil_format.cmd[2] = + R300_EARLY_Z_ENABLE; else /* disable early Z */ - r300->hw.zstencil_format.cmd[2] = R300_EARLY_Z_DISABLE; + r300->hw.zstencil_format.cmd[2] = + R300_EARLY_Z_DISABLE; } } -static void update_alpha(GLcontext *ctx) +static void update_alpha(GLcontext * ctx) { r300ContextPtr r300 = R300_CONTEXT(ctx); GLubyte refByte; @@ -383,7 +392,7 @@ static void update_alpha(GLcontext *ctx) pp_misc |= R300_ALPHA_TEST_GEQUAL; break; case GL_ALWAYS: - /*pp_misc |= R300_ALPHA_TEST_PASS;*/ + /*pp_misc |= R300_ALPHA_TEST_PASS; */ really_enabled = GL_FALSE; break; } @@ -395,7 +404,6 @@ static void update_alpha(GLcontext *ctx) pp_misc = 0x0; } - R300_STATECHANGE(r300, at); r300->hw.at.cmd[R300_AT_ALPHA_TEST] = pp_misc; update_early_z(ctx); @@ -403,8 +411,8 @@ static void update_alpha(GLcontext *ctx) static void r300AlphaFunc(GLcontext * ctx, GLenum func, GLfloat ref) { - (void) func; - (void) ref; + (void)func; + (void)ref; update_alpha(ctx); } @@ -431,24 +439,31 @@ static int translate_func(int func) return 0; } -static void update_depth(GLcontext* ctx) +static void update_depth(GLcontext * ctx) { r300ContextPtr r300 = R300_CONTEXT(ctx); R300_STATECHANGE(r300, zs); r300->hw.zs.cmd[R300_ZS_CNTL_0] &= R300_RB3D_STENCIL_ENABLE; - r300->hw.zs.cmd[R300_ZS_CNTL_1] &= ~(R300_ZS_MASK << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT); + r300->hw.zs.cmd[R300_ZS_CNTL_1] &= + ~(R300_ZS_MASK << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT); if (ctx->Depth.Test && ctx->Depth.Func != GL_NEVER) { if (ctx->Depth.Mask) - r300->hw.zs.cmd[R300_ZS_CNTL_0] |= R300_RB3D_Z_TEST_AND_WRITE; + r300->hw.zs.cmd[R300_ZS_CNTL_0] |= + R300_RB3D_Z_TEST_AND_WRITE; else - r300->hw.zs.cmd[R300_ZS_CNTL_0] |= R300_RB3D_Z_TEST; + r300->hw.zs.cmd[R300_ZS_CNTL_0] |= + R300_RB3D_Z_TEST; - r300->hw.zs.cmd[R300_ZS_CNTL_1] |= translate_func(ctx->Depth.Func) << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT; + r300->hw.zs.cmd[R300_ZS_CNTL_1] |= + translate_func(ctx->Depth. + Func) << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT; } else { r300->hw.zs.cmd[R300_ZS_CNTL_0] |= R300_RB3D_Z_DISABLED_1; - r300->hw.zs.cmd[R300_ZS_CNTL_1] |= translate_func(GL_NEVER) << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT; + r300->hw.zs.cmd[R300_ZS_CNTL_1] |= + translate_func(GL_NEVER) << + R300_RB3D_ZS1_DEPTH_FUNC_SHIFT; } update_early_z(ctx); @@ -459,7 +474,7 @@ static void update_depth(GLcontext* ctx) * * \note Mesa already filters redundant calls to glEnable/glDisable. */ -static void r300Enable(GLcontext* ctx, GLenum cap, GLboolean state) +static void r300Enable(GLcontext * ctx, GLenum cap, GLboolean state) { r300ContextPtr r300 = R300_CONTEXT(ctx); @@ -482,11 +497,14 @@ static void r300Enable(GLcontext* ctx, GLenum cap, GLboolean 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 ); + 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; @@ -519,7 +537,8 @@ static void r300Enable(GLcontext* ctx, GLenum cap, GLboolean state) } } else { #if R200_MERGED - FALLBACK(&r300->radeon, RADEON_FALLBACK_STENCIL, state); + FALLBACK(&r300->radeon, RADEON_FALLBACK_STENCIL, + state); #endif } break; @@ -534,10 +553,10 @@ static void r300Enable(GLcontext* ctx, GLenum cap, GLboolean state) case GL_POLYGON_OFFSET_FILL: R300_STATECHANGE(r300, occlusion_cntl); - if(state){ - r300->hw.occlusion_cntl.cmd[1] |= (3<<0); + if (state) { + r300->hw.occlusion_cntl.cmd[1] |= (3 << 0); } else { - r300->hw.occlusion_cntl.cmd[1] &= ~(3<<0); + r300->hw.occlusion_cntl.cmd[1] &= ~(3 << 0); } break; default: @@ -546,11 +565,10 @@ static void r300Enable(GLcontext* ctx, GLenum cap, GLboolean state) } } - -static void r300UpdatePolygonMode(GLcontext *ctx) +static void r300UpdatePolygonMode(GLcontext * ctx) { r300ContextPtr r300 = R300_CONTEXT(ctx); - uint32_t hw_mode=0; + uint32_t hw_mode = 0; if (ctx->Polygon.FrontMode != GL_FILL || ctx->Polygon.BackMode != GL_FILL) { @@ -569,25 +587,25 @@ static void r300UpdatePolygonMode(GLcontext *ctx) switch (f) { case GL_LINE: hw_mode |= R300_PM_FRONT_LINE; - break; - case GL_POINT: /* noop */ + break; + case GL_POINT: /* noop */ hw_mode |= R300_PM_FRONT_POINT; - break; + break; case GL_FILL: hw_mode |= R300_PM_FRONT_FILL; - break; + break; } switch (b) { case GL_LINE: hw_mode |= R300_PM_BACK_LINE; - break; - case GL_POINT: /* noop */ + break; + case GL_POINT: /* noop */ hw_mode |= R300_PM_BACK_POINT; - break; + break; case GL_FILL: hw_mode |= R300_PM_BACK_FILL; - break; + break; } } @@ -602,20 +620,19 @@ static void r300UpdatePolygonMode(GLcontext *ctx) * * \note Mesa already filters redundant calls to this function. */ -static void r300CullFace(GLcontext* ctx, GLenum mode) +static void r300CullFace(GLcontext * ctx, GLenum mode) { (void)mode; r300UpdateCulling(ctx); } - /** * Change the polygon orientation. * * \note Mesa already filters redundant calls to this function. */ -static void r300FrontFace(GLcontext* ctx, GLenum mode) +static void r300FrontFace(GLcontext * ctx, GLenum mode) { (void)mode; @@ -623,42 +640,39 @@ static void r300FrontFace(GLcontext* ctx, GLenum mode) r300UpdatePolygonMode(ctx); } - /** * Change the depth testing function. * * \note Mesa already filters redundant calls to this function. */ -static void r300DepthFunc(GLcontext* ctx, GLenum func) +static void r300DepthFunc(GLcontext * ctx, GLenum func) { - (void) func; + (void)func; update_depth(ctx); } - /** * Enable/Disable depth writing. * * \note Mesa already filters redundant calls to this function. */ -static void r300DepthMask(GLcontext* ctx, GLboolean mask) +static void r300DepthMask(GLcontext * ctx, GLboolean mask) { - (void) mask; + (void)mask; update_depth(ctx); } - /** * Handle glColorMask() */ -static void r300ColorMask(GLcontext* ctx, - GLboolean r, GLboolean g, GLboolean b, GLboolean a) +static void r300ColorMask(GLcontext * ctx, + GLboolean r, GLboolean g, GLboolean b, + GLboolean a) { r300ContextPtr r300 = R300_CONTEXT(ctx); int mask = (r ? R300_COLORMASK0_R : 0) | - (g ? R300_COLORMASK0_G : 0) | - (b ? R300_COLORMASK0_B : 0) | - (a ? R300_COLORMASK0_A : 0); + (g ? R300_COLORMASK0_G : 0) | + (b ? R300_COLORMASK0_B : 0) | (a ? R300_COLORMASK0_A : 0); if (mask != r300->hw.cmk.cmd[R300_CMK_COLORMASK]) { R300_STATECHANGE(r300, cmk); @@ -669,12 +683,15 @@ static void r300ColorMask(GLcontext* ctx, /* ============================================================= * Fog */ -static void r300Fogfv( GLcontext *ctx, GLenum pname, const GLfloat *param ) +static void r300Fogfv(GLcontext * ctx, GLenum pname, const GLfloat * param) { r300ContextPtr r300 = R300_CONTEXT(ctx); - union { int i; float f; } fogScale, fogStart; + union { + int i; + float f; + } fogScale, fogStart; - (void) param; + (void)param; fogScale.i = r300->hw.fogp.cmd[R300_FOGP_SCALE]; fogStart.i = r300->hw.fogp.cmd[R300_FOGP_START]; @@ -687,29 +704,37 @@ static void r300Fogfv( GLcontext *ctx, GLenum pname, const GLfloat *param ) case GL_LINEAR: R300_STATECHANGE(r300, fogs); r300->hw.fogs.cmd[R300_FOGS_STATE] = - (r300->hw.fogs.cmd[R300_FOGS_STATE] & ~R300_FOG_MODE_MASK) | R300_FOG_MODE_LINEAR; + (r300->hw.fogs. + cmd[R300_FOGS_STATE] & ~R300_FOG_MODE_MASK) | + R300_FOG_MODE_LINEAR; if (ctx->Fog.Start == ctx->Fog.End) { fogScale.f = -1.0; fogStart.f = 1.0; - } - else { - fogScale.f = 1.0 / (ctx->Fog.End-ctx->Fog.Start); - fogStart.f = -ctx->Fog.Start / (ctx->Fog.End-ctx->Fog.Start); + } else { + fogScale.f = + 1.0 / (ctx->Fog.End - ctx->Fog.Start); + fogStart.f = + -ctx->Fog.Start / (ctx->Fog.End - + ctx->Fog.Start); } break; case GL_EXP: R300_STATECHANGE(r300, fogs); r300->hw.fogs.cmd[R300_FOGS_STATE] = - (r300->hw.fogs.cmd[R300_FOGS_STATE] & ~R300_FOG_MODE_MASK) | R300_FOG_MODE_EXP; - fogScale.f = 0.0933*ctx->Fog.Density; + (r300->hw.fogs. + cmd[R300_FOGS_STATE] & ~R300_FOG_MODE_MASK) | + R300_FOG_MODE_EXP; + fogScale.f = 0.0933 * ctx->Fog.Density; fogStart.f = 0.0; break; case GL_EXP2: R300_STATECHANGE(r300, fogs); r300->hw.fogs.cmd[R300_FOGS_STATE] = - (r300->hw.fogs.cmd[R300_FOGS_STATE] & ~R300_FOG_MODE_MASK) | R300_FOG_MODE_EXP2; - fogScale.f = 0.3*ctx->Fog.Density; + (r300->hw.fogs. + cmd[R300_FOGS_STATE] & ~R300_FOG_MODE_MASK) | + R300_FOG_MODE_EXP2; + fogScale.f = 0.3 * ctx->Fog.Density; fogStart.f = 0.0; default: return; @@ -718,11 +743,11 @@ static void r300Fogfv( GLcontext *ctx, GLenum pname, const GLfloat *param ) case GL_FOG_DENSITY: switch (ctx->Fog.Mode) { case GL_EXP: - fogScale.f = 0.0933*ctx->Fog.Density; + fogScale.f = 0.0933 * ctx->Fog.Density; fogStart.f = 0.0; break; case GL_EXP2: - fogScale.f = 0.3*ctx->Fog.Density; + fogScale.f = 0.3 * ctx->Fog.Density; fogStart.f = 0.0; default: break; @@ -734,18 +759,23 @@ static void r300Fogfv( GLcontext *ctx, GLenum pname, const GLfloat *param ) if (ctx->Fog.Start == ctx->Fog.End) { fogScale.f = -1.0; fogStart.f = 1.0; - } - else { - fogScale.f = 1.0 / (ctx->Fog.End-ctx->Fog.Start); - fogStart.f = -ctx->Fog.Start / (ctx->Fog.End-ctx->Fog.Start); + } else { + fogScale.f = + 1.0 / (ctx->Fog.End - ctx->Fog.Start); + fogStart.f = + -ctx->Fog.Start / (ctx->Fog.End - + ctx->Fog.Start); } } break; case GL_FOG_COLOR: R300_STATECHANGE(r300, fogc); - r300->hw.fogc.cmd[R300_FOGC_R] = (GLuint) (ctx->Fog.Color[0]*1023.0F) & 0x3FF; - r300->hw.fogc.cmd[R300_FOGC_G] = (GLuint) (ctx->Fog.Color[1]*1023.0F) & 0x3FF; - r300->hw.fogc.cmd[R300_FOGC_B] = (GLuint) (ctx->Fog.Color[2]*1023.0F) & 0x3FF; + r300->hw.fogc.cmd[R300_FOGC_R] = + (GLuint) (ctx->Fog.Color[0] * 1023.0F) & 0x3FF; + r300->hw.fogc.cmd[R300_FOGC_G] = + (GLuint) (ctx->Fog.Color[1] * 1023.0F) & 0x3FF; + r300->hw.fogc.cmd[R300_FOGC_B] = + (GLuint) (ctx->Fog.Color[2] * 1023.0F) & 0x3FF; break; case GL_FOG_COORD_SRC: break; @@ -772,14 +802,14 @@ static void r300PointSize(GLcontext * ctx, GLfloat size) R300_STATECHANGE(r300, ps); r300->hw.ps.cmd[R300_PS_POINTSIZE] = - ((int)(size * 6) << R300_POINTSIZE_X_SHIFT) | - ((int)(size * 6) << R300_POINTSIZE_Y_SHIFT); + ((int)(size * 6) << R300_POINTSIZE_X_SHIFT) | + ((int)(size * 6) << R300_POINTSIZE_Y_SHIFT); } /* ============================================================= * Line state */ -static void r300LineWidth(GLcontext *ctx, GLfloat widthf) +static void r300LineWidth(GLcontext * ctx, GLfloat widthf) { r300ContextPtr r300 = R300_CONTEXT(ctx); @@ -790,7 +820,7 @@ static void r300LineWidth(GLcontext *ctx, GLfloat widthf) r300->hw.lcntl.cmd[1] |= R300_LINE_CNT_VE; } -static void r300PolygonMode(GLcontext *ctx, GLenum face, GLenum mode) +static void r300PolygonMode(GLcontext * ctx, GLenum face, GLenum mode) { (void)face; (void)mode; @@ -846,70 +876,97 @@ static void r300ShadeModel(GLcontext * ctx, GLenum mode) } static void r300StencilFuncSeparate(GLcontext * ctx, GLenum face, - GLenum func, GLint ref, GLuint mask) + GLenum func, GLint ref, GLuint mask) { r300ContextPtr rmesa = R300_CONTEXT(ctx); - GLuint refmask = (((ctx->Stencil.Ref[0] & 0xff) << R300_RB3D_ZS2_STENCIL_REF_SHIFT) | - ((ctx->Stencil.ValueMask[0] & 0xff) << R300_RB3D_ZS2_STENCIL_MASK_SHIFT)); + GLuint refmask = + (((ctx->Stencil. + Ref[0] & 0xff) << R300_RB3D_ZS2_STENCIL_REF_SHIFT) | ((ctx-> + Stencil. + ValueMask + [0] & + 0xff) + << + R300_RB3D_ZS2_STENCIL_MASK_SHIFT)); GLuint flag; R300_STATECHANGE(rmesa, zs); - rmesa->hw.zs.cmd[R300_ZS_CNTL_1] &= ~( - (R300_ZS_MASK << R300_RB3D_ZS1_FRONT_FUNC_SHIFT) - | (R300_ZS_MASK << R300_RB3D_ZS1_BACK_FUNC_SHIFT)); + rmesa->hw.zs.cmd[R300_ZS_CNTL_1] &= ~((R300_ZS_MASK << + R300_RB3D_ZS1_FRONT_FUNC_SHIFT) + | (R300_ZS_MASK << + R300_RB3D_ZS1_BACK_FUNC_SHIFT)); - rmesa->hw.zs.cmd[R300_ZS_CNTL_2] &= ~((R300_RB3D_ZS2_STENCIL_MASK << R300_RB3D_ZS2_STENCIL_REF_SHIFT) | - (R300_RB3D_ZS2_STENCIL_MASK << R300_RB3D_ZS2_STENCIL_MASK_SHIFT)); + rmesa->hw.zs.cmd[R300_ZS_CNTL_2] &= + ~((R300_RB3D_ZS2_STENCIL_MASK << + R300_RB3D_ZS2_STENCIL_REF_SHIFT) | + (R300_RB3D_ZS2_STENCIL_MASK << + R300_RB3D_ZS2_STENCIL_MASK_SHIFT)); flag = translate_func(ctx->Stencil.Function[0]); - rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |= (flag << R300_RB3D_ZS1_FRONT_FUNC_SHIFT); + rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |= + (flag << R300_RB3D_ZS1_FRONT_FUNC_SHIFT); if (ctx->Stencil._TestTwoSide) flag = translate_func(ctx->Stencil.Function[1]); - rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |= (flag << R300_RB3D_ZS1_BACK_FUNC_SHIFT); + rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |= + (flag << R300_RB3D_ZS1_BACK_FUNC_SHIFT); rmesa->hw.zs.cmd[R300_ZS_CNTL_2] |= refmask; } -static void r300StencilMaskSeparate(GLcontext * ctx, GLenum face, GLuint mask) +static void r300StencilMaskSeparate(GLcontext * ctx, GLenum face, + GLuint mask) { r300ContextPtr rmesa = R300_CONTEXT(ctx); R300_STATECHANGE(rmesa, zs); - rmesa->hw.zs.cmd[R300_ZS_CNTL_2] &= ~(R300_RB3D_ZS2_STENCIL_MASK << R300_RB3D_ZS2_STENCIL_WRITE_MASK_SHIFT); - rmesa->hw.zs.cmd[R300_ZS_CNTL_2] |= (ctx->Stencil.WriteMask[0] & 0xff) << R300_RB3D_ZS2_STENCIL_WRITE_MASK_SHIFT; + rmesa->hw.zs.cmd[R300_ZS_CNTL_2] &= + ~(R300_RB3D_ZS2_STENCIL_MASK << + R300_RB3D_ZS2_STENCIL_WRITE_MASK_SHIFT); + rmesa->hw.zs.cmd[R300_ZS_CNTL_2] |= + (ctx->Stencil. + WriteMask[0] & 0xff) << + R300_RB3D_ZS2_STENCIL_WRITE_MASK_SHIFT; } - -static void r300StencilOpSeparate(GLcontext * ctx, GLenum face, GLenum fail, - GLenum zfail, GLenum zpass) +static void r300StencilOpSeparate(GLcontext * ctx, GLenum face, + GLenum fail, GLenum zfail, GLenum zpass) { r300ContextPtr rmesa = R300_CONTEXT(ctx); R300_STATECHANGE(rmesa, zs); - /* It is easier to mask what's left.. */ + /* It is easier to mask what's left.. */ rmesa->hw.zs.cmd[R300_ZS_CNTL_1] &= (R300_ZS_MASK << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT) | (R300_ZS_MASK << R300_RB3D_ZS1_FRONT_FUNC_SHIFT) | (R300_ZS_MASK << R300_RB3D_ZS1_BACK_FUNC_SHIFT); rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |= - (translate_stencil_op(ctx->Stencil.FailFunc[0]) << R300_RB3D_ZS1_FRONT_FAIL_OP_SHIFT) - |(translate_stencil_op(ctx->Stencil.ZFailFunc[0]) << R300_RB3D_ZS1_FRONT_ZFAIL_OP_SHIFT) - |(translate_stencil_op(ctx->Stencil.ZPassFunc[0]) << R300_RB3D_ZS1_FRONT_ZPASS_OP_SHIFT); + (translate_stencil_op(ctx->Stencil.FailFunc[0]) << + R300_RB3D_ZS1_FRONT_FAIL_OP_SHIFT) + | (translate_stencil_op(ctx->Stencil.ZFailFunc[0]) << + R300_RB3D_ZS1_FRONT_ZFAIL_OP_SHIFT) + | (translate_stencil_op(ctx->Stencil.ZPassFunc[0]) << + R300_RB3D_ZS1_FRONT_ZPASS_OP_SHIFT); if (ctx->Stencil._TestTwoSide) { rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |= - (translate_stencil_op(ctx->Stencil.FailFunc[1]) << R300_RB3D_ZS1_BACK_FAIL_OP_SHIFT) - |(translate_stencil_op(ctx->Stencil.ZFailFunc[1]) << R300_RB3D_ZS1_BACK_ZFAIL_OP_SHIFT) - |(translate_stencil_op(ctx->Stencil.ZPassFunc[1]) << R300_RB3D_ZS1_BACK_ZPASS_OP_SHIFT); + (translate_stencil_op(ctx->Stencil.FailFunc[1]) << + R300_RB3D_ZS1_BACK_FAIL_OP_SHIFT) + | (translate_stencil_op(ctx->Stencil.ZFailFunc[1]) << + R300_RB3D_ZS1_BACK_ZFAIL_OP_SHIFT) + | (translate_stencil_op(ctx->Stencil.ZPassFunc[1]) << + R300_RB3D_ZS1_BACK_ZPASS_OP_SHIFT); } else { rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |= - (translate_stencil_op(ctx->Stencil.FailFunc[0]) << R300_RB3D_ZS1_BACK_FAIL_OP_SHIFT) - |(translate_stencil_op(ctx->Stencil.ZFailFunc[0]) << R300_RB3D_ZS1_BACK_ZFAIL_OP_SHIFT) - |(translate_stencil_op(ctx->Stencil.ZPassFunc[0]) << R300_RB3D_ZS1_BACK_ZPASS_OP_SHIFT); + (translate_stencil_op(ctx->Stencil.FailFunc[0]) << + R300_RB3D_ZS1_BACK_FAIL_OP_SHIFT) + | (translate_stencil_op(ctx->Stencil.ZFailFunc[0]) << + R300_RB3D_ZS1_BACK_ZFAIL_OP_SHIFT) + | (translate_stencil_op(ctx->Stencil.ZPassFunc[0]) << + R300_RB3D_ZS1_BACK_ZPASS_OP_SHIFT); } } @@ -919,8 +976,10 @@ static void r300ClearStencil(GLcontext * ctx, GLint s) rmesa->state.stencil.clear = ((GLuint) (ctx->Stencil.Clear & 0xff) | - (R300_RB3D_ZS2_STENCIL_MASK << R300_RB3D_ZS2_STENCIL_MASK_SHIFT) | - ((ctx->Stencil.WriteMask[0] & 0xff) << R300_RB3D_ZS2_STENCIL_WRITE_MASK_SHIFT)); + (R300_RB3D_ZS2_STENCIL_MASK << + R300_RB3D_ZS2_STENCIL_MASK_SHIFT) | ((ctx->Stencil. + WriteMask[0] & 0xff) << + R300_RB3D_ZS2_STENCIL_WRITE_MASK_SHIFT)); } /* ============================================================= @@ -951,11 +1010,11 @@ void r300UpdateWindow(GLcontext * ctx) R300_FIREVERTICES(rmesa); R300_STATECHANGE(rmesa, vpt); - rmesa->hw.vpt.cmd[R300_VPT_XSCALE] = r300PackFloat32(sx); + rmesa->hw.vpt.cmd[R300_VPT_XSCALE] = r300PackFloat32(sx); rmesa->hw.vpt.cmd[R300_VPT_XOFFSET] = r300PackFloat32(tx); - rmesa->hw.vpt.cmd[R300_VPT_YSCALE] = r300PackFloat32(sy); + rmesa->hw.vpt.cmd[R300_VPT_YSCALE] = r300PackFloat32(sy); rmesa->hw.vpt.cmd[R300_VPT_YOFFSET] = r300PackFloat32(ty); - rmesa->hw.vpt.cmd[R300_VPT_ZSCALE] = r300PackFloat32(sz); + rmesa->hw.vpt.cmd[R300_VPT_ZSCALE] = r300PackFloat32(sz); rmesa->hw.vpt.cmd[R300_VPT_ZOFFSET] = r300PackFloat32(tz); } @@ -969,43 +1028,43 @@ static void r300Viewport(GLcontext * ctx, GLint x, GLint y, r300UpdateWindow(ctx); } -static void r300DepthRange(GLcontext * ctx, GLclampd nearval, GLclampd farval) +static void r300DepthRange(GLcontext * ctx, GLclampd nearval, + GLclampd farval) { r300UpdateWindow(ctx); } -void r300UpdateViewportOffset( GLcontext *ctx ) +void r300UpdateViewportOffset(GLcontext * ctx) { r300ContextPtr rmesa = R300_CONTEXT(ctx); - __DRIdrawablePrivate *dPriv = ((radeonContextPtr)rmesa)->dri.drawable; - GLfloat xoffset = (GLfloat)dPriv->x; - GLfloat yoffset = (GLfloat)dPriv->y + dPriv->h; + __DRIdrawablePrivate *dPriv = + ((radeonContextPtr) rmesa)->dri.drawable; + GLfloat xoffset = (GLfloat) dPriv->x; + GLfloat yoffset = (GLfloat) dPriv->y + dPriv->h; const GLfloat *v = ctx->Viewport._WindowMap.m; GLfloat tx = v[MAT_TX] + xoffset + SUBPIXEL_X; - GLfloat ty = (- v[MAT_TY]) + yoffset + SUBPIXEL_Y; + GLfloat ty = (-v[MAT_TY]) + yoffset + SUBPIXEL_Y; - if ( rmesa->hw.vpt.cmd[R300_VPT_XOFFSET] != r300PackFloat32(tx) || - rmesa->hw.vpt.cmd[R300_VPT_YOFFSET] != r300PackFloat32(ty)) - { - /* Note: this should also modify whatever data the context reset - * code uses... - */ - R300_STATECHANGE( rmesa, vpt ); - rmesa->hw.vpt.cmd[R300_VPT_XOFFSET] = r300PackFloat32(tx); - rmesa->hw.vpt.cmd[R300_VPT_YOFFSET] = r300PackFloat32(ty); + if (rmesa->hw.vpt.cmd[R300_VPT_XOFFSET] != r300PackFloat32(tx) || + rmesa->hw.vpt.cmd[R300_VPT_YOFFSET] != r300PackFloat32(ty)) { + /* Note: this should also modify whatever data the context reset + * code uses... + */ + R300_STATECHANGE(rmesa, vpt); + rmesa->hw.vpt.cmd[R300_VPT_XOFFSET] = r300PackFloat32(tx); + rmesa->hw.vpt.cmd[R300_VPT_YOFFSET] = r300PackFloat32(ty); } - radeonUpdateScissor( ctx ); + radeonUpdateScissor(ctx); } /** * Tell the card where to render (offset, pitch). * Effected by glDrawBuffer, etc */ -void -r300UpdateDrawBuffer(GLcontext *ctx) +void r300UpdateDrawBuffer(GLcontext * ctx) { r300ContextPtr rmesa = R300_CONTEXT(ctx); r300ContextPtr r300 = rmesa; @@ -1014,13 +1073,15 @@ r300UpdateDrawBuffer(GLcontext *ctx) if (fb->_ColorDrawBufferMask[0] == BUFFER_BIT_FRONT_LEFT) { /* draw to front */ - drb = (driRenderbuffer *) fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer; - } - else if (fb->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT) { + drb = + (driRenderbuffer *) fb->Attachment[BUFFER_FRONT_LEFT]. + Renderbuffer; + } else if (fb->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT) { /* draw to back */ - drb = (driRenderbuffer *) fb->Attachment[BUFFER_BACK_LEFT].Renderbuffer; - } - else { + drb = + (driRenderbuffer *) fb->Attachment[BUFFER_BACK_LEFT]. + Renderbuffer; + } else { /* drawing to multiple buffers, or none */ return; } @@ -1028,66 +1089,71 @@ r300UpdateDrawBuffer(GLcontext *ctx) assert(drb); assert(drb->flippedPitch); + R300_STATECHANGE(rmesa, cb); - R300_STATECHANGE( rmesa, cb ); - - r300->hw.cb.cmd[R300_CB_OFFSET] = drb->flippedOffset + //r300->radeon.state.color.drawOffset + - r300->radeon.radeonScreen->fbLocation; - r300->hw.cb.cmd[R300_CB_PITCH] = drb->flippedPitch;//r300->radeon.state.color.drawPitch; + r300->hw.cb.cmd[R300_CB_OFFSET] = drb->flippedOffset + //r300->radeon.state.color.drawOffset + + r300->radeon.radeonScreen->fbLocation; + r300->hw.cb.cmd[R300_CB_PITCH] = drb->flippedPitch; //r300->radeon.state.color.drawPitch; if (r300->radeon.radeonScreen->cpp == 4) - r300->hw.cb.cmd[R300_CB_PITCH] |= R300_COLOR_FORMAT_ARGB8888; + r300->hw.cb.cmd[R300_CB_PITCH] |= + R300_COLOR_FORMAT_ARGB8888; else r300->hw.cb.cmd[R300_CB_PITCH] |= R300_COLOR_FORMAT_RGB565; if (r300->radeon.sarea->tiling_enabled) r300->hw.cb.cmd[R300_CB_PITCH] |= R300_COLOR_TILE_ENABLE; #if 0 - R200_STATECHANGE( rmesa, ctx ); + R200_STATECHANGE(rmesa, ctx); /* Note: we used the (possibly) page-flipped values */ rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] - = ((drb->flippedOffset + rmesa->r200Screen->fbLocation) - & R200_COLOROFFSET_MASK); + = ((drb->flippedOffset + rmesa->r200Screen->fbLocation) + & R200_COLOROFFSET_MASK); rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = drb->flippedPitch; if (rmesa->sarea->tiling_enabled) { - rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] |= R200_COLOR_TILE_ENABLE; + rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] |= + R200_COLOR_TILE_ENABLE; } #endif } static void -r300FetchStateParameter(GLcontext *ctx, - const gl_state_index state[STATE_LENGTH], - GLfloat *value) +r300FetchStateParameter(GLcontext * ctx, + const gl_state_index state[STATE_LENGTH], + GLfloat * value) { r300ContextPtr r300 = R300_CONTEXT(ctx); - switch(state[0]) { + switch (state[0]) { case STATE_INTERNAL: - switch(state[1]) { + switch (state[1]) { case STATE_R300_WINDOW_DIMENSION: - value[0] = r300->radeon.dri.drawable->w*0.5f;/* width*0.5 */ - value[1] = r300->radeon.dri.drawable->h*0.5f;/* height*0.5 */ - value[2] = 0.5F; /* for moving range [-1 1] -> [0 1] */ - value[3] = 1.0F; /* not used */ + value[0] = r300->radeon.dri.drawable->w * 0.5f; /* width*0.5 */ + value[1] = r300->radeon.dri.drawable->h * 0.5f; /* height*0.5 */ + value[2] = 0.5F; /* for moving range [-1 1] -> [0 1] */ + value[3] = 1.0F; /* not used */ break; - case STATE_R300_TEXRECT_FACTOR: { - struct gl_texture_object* t = ctx->Texture.Unit[state[2]].CurrentRect; - - if (t && t->Image[0][t->BaseLevel]) { - struct gl_texture_image* image = t->Image[0][t->BaseLevel]; - value[0] = 1.0 / image->Width2; - value[1] = 1.0 / image->Height2; - } else { - value[0] = 1.0; - value[1] = 1.0; + case STATE_R300_TEXRECT_FACTOR:{ + struct gl_texture_object *t = + ctx->Texture.Unit[state[2]]. + CurrentRect; + + if (t && t->Image[0][t->BaseLevel]) { + struct gl_texture_image *image = + t->Image[0][t->BaseLevel]; + value[0] = 1.0 / image->Width2; + value[1] = 1.0 / image->Height2; + } else { + value[0] = 1.0; + value[1] = 1.0; + } + value[2] = 1.0; + value[3] = 1.0; + break; } - value[2] = 1.0; - value[3] = 1.0; - break; } default: break; @@ -1109,23 +1175,25 @@ void r300UpdateStateParameters(GLcontext * ctx, GLuint new_state) struct gl_program_parameter_list *paramList; GLuint i; - if(!(new_state & (_NEW_BUFFERS|_NEW_PROGRAM))) - return; + if (!(new_state & (_NEW_BUFFERS | _NEW_PROGRAM))) + return; fp = (struct r300_fragment_program *)ctx->FragmentProgram._Current; if (!fp) - return; + return; paramList = fp->mesa_program.Base.Parameters; if (!paramList) - return; + return; for (i = 0; i < paramList->NumParameters; i++) { - if (paramList->Parameters[i].Type == PROGRAM_STATE_VAR){ + if (paramList->Parameters[i].Type == PROGRAM_STATE_VAR) { r300FetchStateParameter(ctx, - paramList->Parameters[i].StateIndexes, - paramList->ParameterValues[i]); + paramList->Parameters[i]. + StateIndexes, + paramList-> + ParameterValues[i]); } } } @@ -1133,7 +1201,8 @@ void r300UpdateStateParameters(GLcontext * ctx, GLuint new_state) /* ============================================================= * Polygon state */ -static void r300PolygonOffset(GLcontext * ctx, GLfloat factor, GLfloat units) +static void r300PolygonOffset(GLcontext * ctx, GLfloat factor, + GLfloat units) { r300ContextPtr rmesa = R300_CONTEXT(ctx); GLfloat constant = units; @@ -1141,10 +1210,10 @@ static void r300PolygonOffset(GLcontext * ctx, GLfloat factor, GLfloat units) switch (ctx->Visual.depthBits) { case 16: constant *= 4.0; - break; + break; case 24: constant *= 2.0; - break; + break; } factor *= 12.0; @@ -1160,7 +1229,6 @@ static void r300PolygonOffset(GLcontext * ctx, GLfloat factor, GLfloat units) /* Routing and texture-related */ - /* r300 doesnt handle GL_CLAMP and GL_MIRROR_CLAMP_EXT correctly when filter is NEAREST. * Since texwrap produces same results for GL_CLAMP and GL_CLAMP_TO_EDGE we use them instead. * We need to recalculate wrap modes whenever filter mode is changed because someone might do: @@ -1172,70 +1240,75 @@ static void r300PolygonOffset(GLcontext * ctx, GLfloat factor, GLfloat units) */ static unsigned long gen_fixed_filter(unsigned long f) { - unsigned long mag, min, needs_fixing=0; + unsigned long mag, min, needs_fixing = 0; //return f; /* We ignore MIRROR bit so we dont have to do everything twice */ - if((f & ((7-1) << R300_TX_WRAP_S_SHIFT)) == (R300_TX_CLAMP << R300_TX_WRAP_S_SHIFT)){ + if ((f & ((7 - 1) << R300_TX_WRAP_S_SHIFT)) == + (R300_TX_CLAMP << R300_TX_WRAP_S_SHIFT)) { needs_fixing |= 1; } - if((f & ((7-1) << R300_TX_WRAP_T_SHIFT)) == (R300_TX_CLAMP << R300_TX_WRAP_T_SHIFT)){ + if ((f & ((7 - 1) << R300_TX_WRAP_T_SHIFT)) == + (R300_TX_CLAMP << R300_TX_WRAP_T_SHIFT)) { needs_fixing |= 2; } - if((f & ((7-1) << R300_TX_WRAP_Q_SHIFT)) == (R300_TX_CLAMP << R300_TX_WRAP_Q_SHIFT)){ + if ((f & ((7 - 1) << R300_TX_WRAP_Q_SHIFT)) == + (R300_TX_CLAMP << R300_TX_WRAP_Q_SHIFT)) { needs_fixing |= 4; } - if(!needs_fixing) + if (!needs_fixing) return f; - mag=f & R300_TX_MAG_FILTER_MASK; - min=f & R300_TX_MIN_FILTER_MASK; + mag = f & R300_TX_MAG_FILTER_MASK; + min = f & R300_TX_MIN_FILTER_MASK; /* TODO: Check for anisto filters too */ - if((mag != R300_TX_MAG_FILTER_NEAREST) && (min != R300_TX_MIN_FILTER_NEAREST)) + if ((mag != R300_TX_MAG_FILTER_NEAREST) + && (min != R300_TX_MIN_FILTER_NEAREST)) return f; /* r300 cant handle these modes hence we force nearest to linear */ - if((mag == R300_TX_MAG_FILTER_NEAREST) && (min != R300_TX_MIN_FILTER_NEAREST)){ + if ((mag == R300_TX_MAG_FILTER_NEAREST) + && (min != R300_TX_MIN_FILTER_NEAREST)) { f &= ~R300_TX_MAG_FILTER_NEAREST; f |= R300_TX_MAG_FILTER_LINEAR; return f; } - if((min == R300_TX_MIN_FILTER_NEAREST) && (mag != R300_TX_MAG_FILTER_NEAREST)){ + if ((min == R300_TX_MIN_FILTER_NEAREST) + && (mag != R300_TX_MAG_FILTER_NEAREST)) { f &= ~R300_TX_MIN_FILTER_NEAREST; f |= R300_TX_MIN_FILTER_LINEAR; return f; } /* Both are nearest */ - if(needs_fixing & 1){ - f &= ~((7-1) << R300_TX_WRAP_S_SHIFT); + if (needs_fixing & 1) { + f &= ~((7 - 1) << R300_TX_WRAP_S_SHIFT); f |= R300_TX_CLAMP_TO_EDGE << R300_TX_WRAP_S_SHIFT; } - if(needs_fixing & 2){ - f &= ~((7-1) << R300_TX_WRAP_T_SHIFT); + if (needs_fixing & 2) { + f &= ~((7 - 1) << R300_TX_WRAP_T_SHIFT); f |= R300_TX_CLAMP_TO_EDGE << R300_TX_WRAP_T_SHIFT; } - if(needs_fixing & 4){ - f &= ~((7-1) << R300_TX_WRAP_Q_SHIFT); + if (needs_fixing & 4) { + f &= ~((7 - 1) << R300_TX_WRAP_Q_SHIFT); f |= R300_TX_CLAMP_TO_EDGE << R300_TX_WRAP_Q_SHIFT; } return f; } -void r300_setup_textures(GLcontext *ctx) +void r300_setup_textures(GLcontext * ctx) { int i, mtu; struct r300_tex_obj *t; r300ContextPtr r300 = R300_CONTEXT(ctx); - int hw_tmu=0; - int last_hw_tmu=-1; /* -1 translates into no setup costs for fields */ + int hw_tmu = 0; + int last_hw_tmu = -1; /* -1 translates into no setup costs for fields */ int tmu_mappings[R300_MAX_TEXTURE_UNITS] = { -1, }; - struct r300_fragment_program *rp = - (struct r300_fragment_program *) - (char *)ctx->FragmentProgram._Current; + struct r300_fragment_program *rp = (struct r300_fragment_program *) + (char *)ctx->FragmentProgram._Current; R300_STATECHANGE(r300, txe); R300_STATECHANGE(r300, tex.filter); @@ -1247,59 +1320,72 @@ void r300_setup_textures(GLcontext *ctx) R300_STATECHANGE(r300, tex.chroma_key); R300_STATECHANGE(r300, tex.border_color); - r300->hw.txe.cmd[R300_TXE_ENABLE]=0x0; + r300->hw.txe.cmd[R300_TXE_ENABLE] = 0x0; mtu = r300->radeon.glCtx->Const.MaxTextureUnits; if (RADEON_DEBUG & DEBUG_STATE) fprintf(stderr, "mtu=%d\n", mtu); - if(mtu > R300_MAX_TEXTURE_UNITS) { - fprintf(stderr, "Aiiee ! mtu=%d is greater than R300_MAX_TEXTURE_UNITS=%d\n", + if (mtu > R300_MAX_TEXTURE_UNITS) { + fprintf(stderr, + "Aiiee ! mtu=%d is greater than R300_MAX_TEXTURE_UNITS=%d\n", mtu, R300_MAX_TEXTURE_UNITS); exit(-1); } /* We cannot let disabled tmu offsets pass DRM */ - for(i=0; i < mtu; i++) { + for (i = 0; i < mtu; i++) { if (ctx->Texture.Unit[i]._ReallyEnabled) { -#if 0 /* Enables old behaviour */ +#if 0 /* Enables old behaviour */ hw_tmu = i; #endif tmu_mappings[i] = hw_tmu; - t=r300->state.texture.unit[i].texobj; + t = r300->state.texture.unit[i].texobj; /* XXX questionable fix for bug 9170: */ if (!t) continue; - if((t->format & 0xffffff00)==0xffffff00) { - WARN_ONCE("unknown texture format (entry %x) encountered. Help me !\n", t->format & 0xff); + if ((t->format & 0xffffff00) == 0xffffff00) { + WARN_ONCE + ("unknown texture format (entry %x) encountered. Help me !\n", + t->format & 0xff); } if (RADEON_DEBUG & DEBUG_STATE) - fprintf(stderr, "Activating texture unit %d\n", i); + fprintf(stderr, + "Activating texture unit %d\n", i); r300->hw.txe.cmd[R300_TXE_ENABLE] |= (1 << hw_tmu); - r300->hw.tex.filter.cmd[R300_TEX_VALUE_0 + hw_tmu] = gen_fixed_filter(t->filter) | (hw_tmu << 28); + r300->hw.tex.filter.cmd[R300_TEX_VALUE_0 + + hw_tmu] = + gen_fixed_filter(t->filter) | (hw_tmu << 28); /* Currently disabled! */ - r300->hw.tex.filter_1.cmd[R300_TEX_VALUE_0 + hw_tmu] = 0x0; //0x20501f80; - r300->hw.tex.size.cmd[R300_TEX_VALUE_0 + hw_tmu] = t->size; - r300->hw.tex.format.cmd[R300_TEX_VALUE_0 + hw_tmu] = t->format; - r300->hw.tex.pitch.cmd[R300_TEX_VALUE_0 + hw_tmu] = t->pitch_reg; - r300->hw.tex.offset.cmd[R300_TEX_VALUE_0 + hw_tmu] = t->offset; - - if(t->offset & R300_TXO_MACRO_TILE) { + r300->hw.tex.filter_1.cmd[R300_TEX_VALUE_0 + hw_tmu] = 0x0; //0x20501f80; + r300->hw.tex.size.cmd[R300_TEX_VALUE_0 + hw_tmu] = + t->size; + r300->hw.tex.format.cmd[R300_TEX_VALUE_0 + + hw_tmu] = t->format; + r300->hw.tex.pitch.cmd[R300_TEX_VALUE_0 + hw_tmu] = + t->pitch_reg; + r300->hw.tex.offset.cmd[R300_TEX_VALUE_0 + + hw_tmu] = t->offset; + + if (t->offset & R300_TXO_MACRO_TILE) { WARN_ONCE("macro tiling enabled!\n"); } - if(t->offset & R300_TXO_MICRO_TILE) { + if (t->offset & R300_TXO_MICRO_TILE) { WARN_ONCE("micro tiling enabled!\n"); } - r300->hw.tex.chroma_key.cmd[R300_TEX_VALUE_0 + hw_tmu] = 0x0; - r300->hw.tex.border_color.cmd[R300_TEX_VALUE_0 + hw_tmu] = t->pp_border_color; + r300->hw.tex.chroma_key.cmd[R300_TEX_VALUE_0 + + hw_tmu] = 0x0; + r300->hw.tex.border_color.cmd[R300_TEX_VALUE_0 + + hw_tmu] = + t->pp_border_color; last_hw_tmu = hw_tmu; @@ -1307,22 +1393,29 @@ void r300_setup_textures(GLcontext *ctx) } } - r300->hw.tex.filter.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_FILTER_0, last_hw_tmu + 1); - r300->hw.tex.filter_1.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_FILTER1_0, last_hw_tmu + 1); - r300->hw.tex.size.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_SIZE_0, last_hw_tmu + 1); - r300->hw.tex.format.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_FORMAT_0, last_hw_tmu + 1); - r300->hw.tex.pitch.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_PITCH_0, last_hw_tmu + 1); - r300->hw.tex.offset.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_OFFSET_0, last_hw_tmu + 1); - r300->hw.tex.chroma_key.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_CHROMA_KEY_0, last_hw_tmu + 1); - r300->hw.tex.border_color.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_BORDER_COLOR_0, last_hw_tmu + 1); - - - if (!rp) /* should only happenen once, just after context is created */ + r300->hw.tex.filter.cmd[R300_TEX_CMD_0] = + cmdpacket0(R300_TX_FILTER_0, last_hw_tmu + 1); + r300->hw.tex.filter_1.cmd[R300_TEX_CMD_0] = + cmdpacket0(R300_TX_FILTER1_0, last_hw_tmu + 1); + r300->hw.tex.size.cmd[R300_TEX_CMD_0] = + cmdpacket0(R300_TX_SIZE_0, last_hw_tmu + 1); + r300->hw.tex.format.cmd[R300_TEX_CMD_0] = + cmdpacket0(R300_TX_FORMAT_0, last_hw_tmu + 1); + r300->hw.tex.pitch.cmd[R300_TEX_CMD_0] = + cmdpacket0(R300_TX_PITCH_0, last_hw_tmu + 1); + r300->hw.tex.offset.cmd[R300_TEX_CMD_0] = + cmdpacket0(R300_TX_OFFSET_0, last_hw_tmu + 1); + r300->hw.tex.chroma_key.cmd[R300_TEX_CMD_0] = + cmdpacket0(R300_TX_CHROMA_KEY_0, last_hw_tmu + 1); + r300->hw.tex.border_color.cmd[R300_TEX_CMD_0] = + cmdpacket0(R300_TX_BORDER_COLOR_0, last_hw_tmu + 1); + + if (!rp) /* should only happenen once, just after context is created */ return; R300_STATECHANGE(r300, fpt); - for(i = 0; i < rp->tex.length; i++){ + for (i = 0; i < rp->tex.length; i++) { int unit; int opcode; unsigned long val; @@ -1333,37 +1426,45 @@ void r300_setup_textures(GLcontext *ctx) val = rp->tex.inst[i]; val &= ~R300_FPITX_IMAGE_MASK; - opcode = (val & R300_FPITX_OPCODE_MASK) >> R300_FPITX_OPCODE_SHIFT; + opcode = + (val & R300_FPITX_OPCODE_MASK) >> + R300_FPITX_OPCODE_SHIFT; if (opcode == R300_FPITX_OP_KIL) { - r300->hw.fpt.cmd[R300_FPT_INSTR_0+i] = val; + r300->hw.fpt.cmd[R300_FPT_INSTR_0 + i] = val; } else { if (tmu_mappings[unit] >= 0) { - val |= tmu_mappings[unit] << R300_FPITX_IMAGE_SHIFT; - r300->hw.fpt.cmd[R300_FPT_INSTR_0+i] = val; + val |= + tmu_mappings[unit] << + R300_FPITX_IMAGE_SHIFT; + r300->hw.fpt.cmd[R300_FPT_INSTR_0 + i] = + val; } else { // We get here when the corresponding texture image is incomplete // (e.g. incomplete mipmaps etc.) - r300->hw.fpt.cmd[R300_FPT_INSTR_0+i] = val; + r300->hw.fpt.cmd[R300_FPT_INSTR_0 + i] = + val; } } } - r300->hw.fpt.cmd[R300_FPT_CMD_0] = cmdpacket0(R300_PFS_TEXI_0, rp->tex.length); + r300->hw.fpt.cmd[R300_FPT_CMD_0] = + cmdpacket0(R300_PFS_TEXI_0, rp->tex.length); if (RADEON_DEBUG & DEBUG_STATE) - fprintf(stderr, "TX_ENABLE: %08x last_hw_tmu=%d\n", r300->hw.txe.cmd[R300_TXE_ENABLE], last_hw_tmu); + fprintf(stderr, "TX_ENABLE: %08x last_hw_tmu=%d\n", + r300->hw.txe.cmd[R300_TXE_ENABLE], last_hw_tmu); } union r300_outputs_written { - GLuint vp_outputs; /* hw_tcl_on */ - DECLARE_RENDERINPUTS(index_bitset); /* !hw_tcl_on */ + GLuint vp_outputs; /* hw_tcl_on */ + DECLARE_RENDERINPUTS(index_bitset); /* !hw_tcl_on */ }; #define R300_OUTPUTS_WRITTEN_TEST(ow, vp_result, tnl_attrib) \ ((hw_tcl_on) ? (ow).vp_outputs & (1 << (vp_result)) : \ RENDERINPUTS_TEST( (ow.index_bitset), (tnl_attrib) )) -void r300_setup_rs_unit(GLcontext *ctx) +void r300_setup_rs_unit(GLcontext * ctx) { r300ContextPtr r300 = R300_CONTEXT(ctx); /* I'm still unsure if these are needed */ @@ -1383,16 +1484,19 @@ void r300_setup_rs_unit(GLcontext *ctx) int in_texcoords, col_interp_nr; int i; - if(hw_tcl_on) - OutputsWritten.vp_outputs = CURRENT_VERTEX_SHADER(ctx)->key.OutputsWritten; + if (hw_tcl_on) + 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; + InputsRead = + ctx->FragmentProgram._Current->Base.InputsRead; else { fprintf(stderr, "No ctx->FragmentProgram._Current!!\n"); - return; /* This should only ever happen once.. */ + return; /* This should only ever happen once.. */ } R300_STATECHANGE(r300, ri); @@ -1403,12 +1507,12 @@ void r300_setup_rs_unit(GLcontext *ctx) r300->hw.rr.cmd[R300_RR_ROUTE_1] = 0; - if (InputsRead & FRAG_BIT_WPOS){ + if (InputsRead & FRAG_BIT_WPOS) { for (i = 0; i < ctx->Const.MaxTextureUnits; i++) if (!(InputsRead & (FRAG_BIT_TEX0 << i))) break; - if(i == ctx->Const.MaxTextureUnits){ + if (i == ctx->Const.MaxTextureUnits) { fprintf(stderr, "\tno free texcoord found...\n"); exit(0); } @@ -1417,84 +1521,97 @@ void r300_setup_rs_unit(GLcontext *ctx) InputsRead &= ~FRAG_BIT_WPOS; } - for (i=0;iConst.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]; + 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]; r300->hw.rr.cmd[R300_RR_ROUTE_0 + fp_reg] = 0; - if (InputsRead & (FRAG_BIT_TEX0<state.texture.tc_count != 0); - r300->hw.rr.cmd[R300_RR_ROUTE_0 + fp_reg] |= - R300_RS_ROUTE_ENABLE - | i /* source INTERP */ - | (fp_reg << R300_RS_ROUTE_DEST_SHIFT); + r300->hw.rr.cmd[R300_RR_ROUTE_0 + fp_reg] |= R300_RS_ROUTE_ENABLE | i /* source INTERP */ + | (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); //exit(-1); } - InputsRead &= ~(FRAG_BIT_TEX0<Base); //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_RS_ROUTE_0_COLOR + | (fp_reg++ << R300_RS_ROUTE_0_COLOR_DEST_SHIFT); InputsRead &= ~FRAG_BIT_COL0; col_interp_nr++; } - out: + 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"); //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; + if (high_rr < 1) + high_rr = 1; col_interp_nr++; } /* 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_RS_ROUTE_0_COLOR + | (fp_reg++ << R300_RS_ROUTE_0_COLOR_DEST_SHIFT); col_interp_nr++; } r300->hw.rc.cmd[1] = 0 - | (in_texcoords << R300_RS_CNTL_TC_CNT_SHIFT) - | (col_interp_nr << R300_RS_CNTL_CI_CNT_SHIFT) - | R300_RS_CNTL_0_UNKNOWN_18; + | (in_texcoords << R300_RS_CNTL_TC_CNT_SHIFT) + | (col_interp_nr << R300_RS_CNTL_CI_CNT_SHIFT) + | 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 vpucount(ptr) (((drm_r300_cmd_header_t*)(ptr))->vpu.count) @@ -1506,39 +1623,55 @@ void r300_setup_rs_unit(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) +void static inline setup_vertex_shader_fragment(r300ContextPtr r300, + int dest, + struct + r300_vertex_shader_fragment + *vsf) { int i; - if(vsf->length==0)return; + if (vsf->length == 0) + return; - if(vsf->length & 0x3){ - fprintf(stderr,"VERTEX_SHADER_FRAGMENT must have length divisible by 4\n"); + if (vsf->length & 0x3) { + fprintf(stderr, + "VERTEX_SHADER_FRAGMENT must have length divisible by 4\n"); exit(-1); - } + } - switch((dest>>8) & 0xf){ + switch ((dest >> 8) & 0xf) { case 0: R300_STATECHANGE(r300, vpi); - for(i=0;ilength;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)); + 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)); break; case 2: R300_STATECHANGE(r300, vpp); - for(i=0;ilength;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)); + 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)); break; case 4: R300_STATECHANGE(r300, vps); - for(i=0;ilength;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)); + 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)); 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); exit(-1); } } @@ -1557,19 +1690,19 @@ 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 */ + 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 */ - r300->state.vertex_shader.program_start=0x0; - r300->state.vertex_shader.unknown_ptr1=0x4; /* magic value ? */ - r300->state.vertex_shader.program_end=0x0; + r300->state.vertex_shader.program_start = 0x0; + r300->state.vertex_shader.unknown_ptr1 = 0x4; /* magic value ? */ + 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.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; + 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); \ @@ -1579,118 +1712,150 @@ static void r300GenerateSimpleVertexShader(r300ContextPtr r300) r300->state.vertex_shader.program_end++; \ } - for (i = VERT_ATTRIB_POS; i < VERT_ATTRIB_MAX; i++) if (r300->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.sw_tcl_inputs[i]), - VSF_UNITY(r300->state.sw_tcl_inputs[i]) - ) + WRITE_OP(EASY_VSF_OP(MUL, o_reg++, ALL, RESULT), + VSF_REG(r300->state.sw_tcl_inputs[i]), + VSF_ATTR_UNITY(r300->state. + sw_tcl_inputs[i]), + VSF_UNITY(r300->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; + 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; - r300->state.vertex_shader.unknown_ptr1=r300->state.vertex_shader.program_end; /* magic value ? */ - 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 ? */ + r300->state.vertex_shader.unknown_ptr1 = r300->state.vertex_shader.program_end; /* magic value ? */ + 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 ? */ } - void r300SetupVertexShader(r300ContextPtr rmesa) { - GLcontext* ctx = rmesa->radeon.glCtx; + GLcontext *ctx = rmesa->radeon.glCtx; /* Reset state, in case we don't use something */ - ((drm_r300_cmd_header_t*)rmesa->hw.vpp.cmd)->vpu.count = 0; - ((drm_r300_cmd_header_t*)rmesa->hw.vpi.cmd)->vpu.count = 0; - ((drm_r300_cmd_header_t*)rmesa->hw.vps.cmd)->vpu.count = 0; + ((drm_r300_cmd_header_t *) rmesa->hw.vpp.cmd)->vpu.count = 0; + ((drm_r300_cmd_header_t *) rmesa->hw.vpi.cmd)->vpu.count = 0; + ((drm_r300_cmd_header_t *) rmesa->hw.vps.cmd)->vpu.count = 0; /* Not sure why this doesnt work... 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 ; + return; } /* 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->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->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->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); /* This is done for vertex shader fragments, but also needs to be done for vap_pvs, - so I leave it as a reminder */ + so I leave it as a reminder */ #if 0 - reg_start(R300_VAP_PVS_WAITIDLE,0); - e32(0x00000000); + reg_start(R300_VAP_PVS_WAITIDLE, 0); + e32(0x00000000); #endif } void r300SetupVertexProgram(r300ContextPtr rmesa) { - GLcontext* ctx = rmesa->radeon.glCtx; + 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; + ((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; /* 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; + ((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)); + 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; + 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); - 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); - 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); + 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); + 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); + 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); /* This is done for vertex shader fragments, but also needs to be done for vap_pvs, - so I leave it as a reminder */ + so I leave it as a reminder */ #if 0 - reg_start(R300_VAP_PVS_WAITIDLE,0); - e32(0x00000000); + reg_start(R300_VAP_PVS_WAITIDLE, 0); + e32(0x00000000); #endif } -extern void _tnl_UpdateFixedFunctionProgram( GLcontext *ctx ); +extern void _tnl_UpdateFixedFunctionProgram(GLcontext * ctx); extern int future_hw_tcl_on; void r300UpdateShaders(r300ContextPtr rmesa) @@ -1705,26 +1870,30 @@ void r300UpdateShaders(r300ContextPtr rmesa) rmesa->NewGLState = 0; for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) { - rmesa->temp_attrib[i] = TNL_CONTEXT(ctx)->vb.AttribPtr[i]; - TNL_CONTEXT(ctx)->vb.AttribPtr[i] = &rmesa->dummy_attrib[i]; + rmesa->temp_attrib[i] = + TNL_CONTEXT(ctx)->vb.AttribPtr[i]; + TNL_CONTEXT(ctx)->vb.AttribPtr[i] = + &rmesa->dummy_attrib[i]; } _tnl_UpdateFixedFunctionProgram(ctx); for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) { - TNL_CONTEXT(ctx)->vb.AttribPtr[i] = rmesa->temp_attrib[i]; + TNL_CONTEXT(ctx)->vb.AttribPtr[i] = + rmesa->temp_attrib[i]; } r300_select_vertex_shader(rmesa); - vp = (struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx); + vp = (struct r300_vertex_program *) + CURRENT_VERTEX_SHADER(ctx); /*if (vp->translated == GL_FALSE) - r300_translate_vertex_shader(vp);*/ + r300_translate_vertex_shader(vp); */ if (vp->translated == GL_FALSE) { fprintf(stderr, "Failing back to sw-tcl\n"); hw_tcl_on = future_hw_tcl_on = 0; r300ResetHwState(rmesa); - return ; + return; } r300UpdateStateParameters(ctx, _NEW_PROGRAM); } @@ -1742,7 +1911,7 @@ void r300UpdateShaderStates(r300ContextPtr rmesa) r300_setup_textures(ctx); if ((rmesa->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) - r300SetupVertexShader(rmesa); + r300SetupVertexShader(rmesa); r300_setup_rs_unit(ctx); } @@ -1758,20 +1927,21 @@ static unsigned int r300PackFloat24(float f) int exponent; unsigned int float24 = 0; - if (f == 0.0) return 0; + if (f == 0.0) + return 0; mantissa = frexpf(f, &exponent); /* Handle -ve */ if (mantissa < 0) { - float24 |= (1<<23); + float24 |= (1 << 23); mantissa = mantissa * -1.0; } /* Handle exponent, bias of 63 */ exponent += 62; float24 |= (exponent << 16); /* Kill 7 LSB of mantissa */ - float24 |= (r300PackFloat32(mantissa) & 0x7FFFFF) >> 7; + float24 |= (r300PackFloat32(mantissa) & 0x7FFFFF) >> 7; return float24; } @@ -1779,20 +1949,19 @@ static unsigned int r300PackFloat24(float f) void r300SetupPixelShader(r300ContextPtr rmesa) { GLcontext *ctx = rmesa->radeon.glCtx; - struct r300_fragment_program *rp = - (struct r300_fragment_program *) - (char *)ctx->FragmentProgram._Current; - int i,k; + struct r300_fragment_program *rp = (struct r300_fragment_program *) + (char *)ctx->FragmentProgram._Current; + int i, k; - if (!rp) /* should only happenen once, just after context is created */ + if (!rp) /* should only happenen once, just after context is created */ return; r300_translate_fragment_shader(rmesa, rp); if (!rp->translated) { - fprintf(stderr, "%s: No valid fragment shader, exiting\n", __func__); + fprintf(stderr, "%s: No valid fragment shader, exiting\n", + __func__); return; } - #define OUTPUT_FIELD(st, reg, field) \ R300_STATECHANGE(rmesa, st); \ for(i=0;i<=rp->alu_end;i++) \ @@ -1807,40 +1976,49 @@ void r300SetupPixelShader(r300ContextPtr rmesa) R300_STATECHANGE(rmesa, fp); /* I just want to say, the way these nodes are stored.. weird.. */ - for (i=0,k=(4-(rp->cur_node+1));i<4;i++,k++) { - if (i<(rp->cur_node+1)) { - rmesa->hw.fp.cmd[R300_FP_NODE0+k]= - (rp->node[i].alu_offset << R300_PFS_NODE_ALU_OFFSET_SHIFT) - | (rp->node[i].alu_end << R300_PFS_NODE_ALU_END_SHIFT) - | (rp->node[i].tex_offset << R300_PFS_NODE_TEX_OFFSET_SHIFT) - | (rp->node[i].tex_end << R300_PFS_NODE_TEX_END_SHIFT) - | rp->node[i].flags; /* ( (k==3) ? R300_PFS_NODE_LAST_NODE : 0); */ + for (i = 0, k = (4 - (rp->cur_node + 1)); i < 4; i++, k++) { + if (i < (rp->cur_node + 1)) { + rmesa->hw.fp.cmd[R300_FP_NODE0 + k] = + (rp->node[i]. + alu_offset << R300_PFS_NODE_ALU_OFFSET_SHIFT) + | (rp->node[i]. + alu_end << R300_PFS_NODE_ALU_END_SHIFT) + | (rp->node[i]. + tex_offset << + R300_PFS_NODE_TEX_OFFSET_SHIFT) + | (rp->node[i]. + tex_end << R300_PFS_NODE_TEX_END_SHIFT) + | rp->node[i].flags; /* ( (k==3) ? R300_PFS_NODE_LAST_NODE : 0); */ } else { - rmesa->hw.fp.cmd[R300_FP_NODE0+(3-i)] = 0; + rmesa->hw.fp.cmd[R300_FP_NODE0 + (3 - i)] = 0; } } - /* PFS_CNTL_0 */ - rmesa->hw.fp.cmd[R300_FP_CNTL0]= - rp->cur_node - | (rp->first_node_has_tex<<3); - /* PFS_CNTL_1 */ - rmesa->hw.fp.cmd[R300_FP_CNTL1]=rp->max_temp_idx; - /* PFS_CNTL_2 */ - rmesa->hw.fp.cmd[R300_FP_CNTL2]= - (rp->alu_offset << R300_PFS_CNTL_ALU_OFFSET_SHIFT) - | (rp->alu_end << R300_PFS_CNTL_ALU_END_SHIFT) - | (rp->tex_offset << R300_PFS_CNTL_TEX_OFFSET_SHIFT) - | (rp->tex_end << R300_PFS_CNTL_TEX_END_SHIFT); + /* PFS_CNTL_0 */ + rmesa->hw.fp.cmd[R300_FP_CNTL0] = + rp->cur_node | (rp->first_node_has_tex << 3); + /* PFS_CNTL_1 */ + rmesa->hw.fp.cmd[R300_FP_CNTL1] = rp->max_temp_idx; + /* PFS_CNTL_2 */ + rmesa->hw.fp.cmd[R300_FP_CNTL2] = + (rp->alu_offset << R300_PFS_CNTL_ALU_OFFSET_SHIFT) + | (rp->alu_end << R300_PFS_CNTL_ALU_END_SHIFT) + | (rp->tex_offset << R300_PFS_CNTL_TEX_OFFSET_SHIFT) + | (rp->tex_end << R300_PFS_CNTL_TEX_END_SHIFT); R300_STATECHANGE(rmesa, fpp); - for(i=0;iconst_nr;i++){ - rmesa->hw.fpp.cmd[R300_FPP_PARAM_0+4*i+0]=r300PackFloat24(rp->constant[i][0]); - rmesa->hw.fpp.cmd[R300_FPP_PARAM_0+4*i+1]=r300PackFloat24(rp->constant[i][1]); - rmesa->hw.fpp.cmd[R300_FPP_PARAM_0+4*i+2]=r300PackFloat24(rp->constant[i][2]); - rmesa->hw.fpp.cmd[R300_FPP_PARAM_0+4*i+3]=r300PackFloat24(rp->constant[i][3]); + for (i = 0; i < rp->const_nr; i++) { + rmesa->hw.fpp.cmd[R300_FPP_PARAM_0 + 4 * i + 0] = + r300PackFloat24(rp->constant[i][0]); + rmesa->hw.fpp.cmd[R300_FPP_PARAM_0 + 4 * i + 1] = + r300PackFloat24(rp->constant[i][1]); + rmesa->hw.fpp.cmd[R300_FPP_PARAM_0 + 4 * i + 2] = + r300PackFloat24(rp->constant[i][2]); + rmesa->hw.fpp.cmd[R300_FPP_PARAM_0 + 4 * i + 3] = + r300PackFloat24(rp->constant[i][3]); } - rmesa->hw.fpp.cmd[R300_FPP_CMD_0]=cmdpacket0(R300_PFS_PARAM_0_X, rp->const_nr*4); + rmesa->hw.fpp.cmd[R300_FPP_CMD_0] = + cmdpacket0(R300_PFS_PARAM_0_X, rp->const_nr * 4); } /** @@ -1863,7 +2041,7 @@ static void r300InvalidateState(GLcontext * ctx, GLuint new_state) r300UpdateStateParameters(ctx, new_state); #ifdef HW_VBOS - if(new_state & _NEW_ARRAY) + if (new_state & _NEW_ARRAY) r300->state.VB.lock_uptodate = GL_FALSE; #endif r300->NewGLState |= new_state; @@ -1874,28 +2052,28 @@ static void r300InvalidateState(GLcontext * ctx, GLuint new_state) */ void r300ResetHwState(r300ContextPtr r300) { - GLcontext* ctx = r300->radeon.glCtx; + GLcontext *ctx = r300->radeon.glCtx; int has_tcl = 1; if (!(r300->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) - has_tcl = 0; + has_tcl = 0; 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 */ + /* 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 */ + /* go and compute register values from GL state */ r300UpdateWindow(ctx); r300ColorMask(ctx, - ctx->Color.ColorMask[RCOMP], - ctx->Color.ColorMask[GCOMP], - ctx->Color.ColorMask[BCOMP], - ctx->Color.ColorMask[ACOMP]); + ctx->Color.ColorMask[RCOMP], + ctx->Color.ColorMask[GCOMP], + ctx->Color.ColorMask[BCOMP], + ctx->Color.ColorMask[ACOMP]); r300Enable(ctx, GL_DEPTH_TEST, ctx->Depth.Test); r300DepthMask(ctx, ctx->Depth.Mask); @@ -1904,8 +2082,12 @@ void r300ResetHwState(r300ContextPtr r300) /* stencil */ r300Enable(ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled); r300StencilMaskSeparate(ctx, 0, ctx->Stencil.WriteMask[0]); - r300StencilFuncSeparate(ctx, 0, ctx->Stencil.Function[0], ctx->Stencil.Ref[0], ctx->Stencil.ValueMask[0]); - r300StencilOpSeparate(ctx, 0, ctx->Stencil.FailFunc[0], ctx->Stencil.ZFailFunc[0], ctx->Stencil.ZPassFunc[0]); + r300StencilFuncSeparate(ctx, 0, ctx->Stencil.Function[0], + ctx->Stencil.Ref[0], + ctx->Stencil.ValueMask[0]); + r300StencilOpSeparate(ctx, 0, ctx->Stencil.FailFunc[0], + ctx->Stencil.ZFailFunc[0], + ctx->Stencil.ZPassFunc[0]); r300UpdateCulling(ctx); @@ -1916,20 +2098,19 @@ 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 */ + /* 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.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 - | R300_VPORT_Y_OFFSET_ENA - | R300_VPORT_Z_SCALE_ENA - | R300_VPORT_Z_OFFSET_ENA - | R300_VTX_W0_FMT; + | R300_VPORT_X_OFFSET_ENA + | R300_VPORT_Y_SCALE_ENA + | R300_VPORT_Y_OFFSET_ENA + | R300_VPORT_Z_SCALE_ENA + | R300_VPORT_Z_OFFSET_ENA | R300_VTX_W0_FMT; r300->hw.vte.cmd[2] = 0x00000008; r300->hw.unk2134.cmd[1] = 0x00FFFFFF; @@ -1959,31 +2140,34 @@ void r300ResetHwState(r300ContextPtr r300) r300->hw.unk2288.cmd[1] = R300_2288_RV350; r300->hw.gb_enable.cmd[1] = R300_GB_POINT_STUFF_ENABLE - | R300_GB_LINE_STUFF_ENABLE - | R300_GB_TRIANGLE_STUFF_ENABLE /*| R300_GB_UNK31*/; + | R300_GB_LINE_STUFF_ENABLE + | R300_GB_TRIANGLE_STUFF_ENABLE /*| R300_GB_UNK31 */ ; 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; + (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; + 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? */ - 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 */ + 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 */ r300->hw.unk4200.cmd[1] = r300PackFloat32(0.0); r300->hw.unk4200.cmd[2] = r300PackFloat32(0.0); @@ -2015,13 +2199,13 @@ void r300ResetHwState(r300ContextPtr r300) r300->hw.polygon_mode.cmd[3] = 0x00000000; r300->hw.zbias_cntl.cmd[1] = 0x00000000; - r300PolygonOffset(ctx, ctx->Polygon.OffsetFactor, ctx->Polygon.OffsetUnits); + r300PolygonOffset(ctx, ctx->Polygon.OffsetFactor, + ctx->Polygon.OffsetUnits); r300Enable(ctx, GL_POLYGON_OFFSET_FILL, ctx->Polygon.OffsetFill); r300->hw.unk42C0.cmd[1] = 0x4B7FFFFF; r300->hw.unk42C0.cmd[2] = 0x00000000; - r300->hw.unk43A4.cmd[1] = 0x0000001C; r300->hw.unk43A4.cmd[2] = 0x2DA49525; @@ -2034,12 +2218,12 @@ 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 ); + 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); r300->hw.at.cmd[R300_AT_UNKNOWN] = 0; r300->hw.unk4BD8.cmd[1] = 0; @@ -2051,12 +2235,15 @@ void r300ResetHwState(r300ContextPtr r300) r300->hw.blend_color.cmd[3] = 0; /* Again, r300ClearBuffer uses this */ - r300->hw.cb.cmd[R300_CB_OFFSET] = r300->radeon.state.color.drawOffset + - r300->radeon.radeonScreen->fbLocation; - r300->hw.cb.cmd[R300_CB_PITCH] = r300->radeon.state.color.drawPitch; + r300->hw.cb.cmd[R300_CB_OFFSET] = + r300->radeon.state.color.drawOffset + + r300->radeon.radeonScreen->fbLocation; + r300->hw.cb.cmd[R300_CB_PITCH] = + r300->radeon.state.color.drawPitch; if (r300->radeon.radeonScreen->cpp == 4) - r300->hw.cb.cmd[R300_CB_PITCH] |= R300_COLOR_FORMAT_ARGB8888; + r300->hw.cb.cmd[R300_CB_PITCH] |= + R300_COLOR_FORMAT_ARGB8888; else r300->hw.cb.cmd[R300_CB_PITCH] |= R300_COLOR_FORMAT_RGB565; @@ -2080,11 +2267,13 @@ void r300ResetHwState(r300ContextPtr r300) switch (ctx->Visual.depthBits) { case 16: - r300->hw.zstencil_format.cmd[1] = R300_DEPTH_FORMAT_16BIT_INT_Z; - break; + r300->hw.zstencil_format.cmd[1] = + R300_DEPTH_FORMAT_16BIT_INT_Z; + break; case 24: - r300->hw.zstencil_format.cmd[1] = R300_DEPTH_FORMAT_24BIT_INT_Z; - break; + r300->hw.zstencil_format.cmd[1] = + R300_DEPTH_FORMAT_24BIT_INT_Z; + break; default: fprintf(stderr, "Error: Unsupported depth %d... exiting\n", ctx->Visual.depthBits); @@ -2098,16 +2287,18 @@ void r300ResetHwState(r300ContextPtr r300) r300->hw.zstencil_format.cmd[4] = 0x00000000; r300->hw.zb.cmd[R300_ZB_OFFSET] = - r300->radeon.radeonScreen->depthOffset + - r300->radeon.radeonScreen->fbLocation; - r300->hw.zb.cmd[R300_ZB_PITCH] = r300->radeon.radeonScreen->depthPitch; + r300->radeon.radeonScreen->depthOffset + + r300->radeon.radeonScreen->fbLocation; + r300->hw.zb.cmd[R300_ZB_PITCH] = + r300->radeon.radeonScreen->depthPitch; - if (r300->radeon.sarea->tiling_enabled) { + if (r300->radeon.sarea->tiling_enabled) { /* Turn off when clearing buffers ? */ r300->hw.zb.cmd[R300_ZB_PITCH] |= R300_DEPTH_TILE_ENABLE; if (ctx->Visual.depthBits == 24) - r300->hw.zb.cmd[R300_ZB_PITCH] |= R300_DEPTH_MICROTILE_ENABLE; + r300->hw.zb.cmd[R300_ZB_PITCH] |= + R300_DEPTH_MICROTILE_ENABLE; } r300->hw.unk4F28.cmd[1] = 0; @@ -2120,18 +2311,16 @@ void r300ResetHwState(r300ContextPtr r300) r300->hw.unk4F54.cmd[1] = 0; if (has_tcl) { - r300->hw.vps.cmd[R300_VPS_ZERO_0] = 0; - r300->hw.vps.cmd[R300_VPS_ZERO_1] = 0; - r300->hw.vps.cmd[R300_VPS_POINTSIZE] = r300PackFloat32(1.0); - r300->hw.vps.cmd[R300_VPS_ZERO_3] = 0; + r300->hw.vps.cmd[R300_VPS_ZERO_0] = 0; + r300->hw.vps.cmd[R300_VPS_ZERO_1] = 0; + 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; } - - /** * Calculate initial hardware state and register state functions. * Assumes that the command buffer and state atoms have been @@ -2163,14 +2352,14 @@ void r300InitState(r300ContextPtr r300) /* Only have hw stencil when depth buffer is 24 bits deep */ r300->state.stencil.hw_stencil = (ctx->Visual.stencilBits > 0 && - ctx->Visual.depthBits == 24); + ctx->Visual.depthBits == 24); memset(&(r300->state.texture), 0, sizeof(r300->state.texture)); r300ResetHwState(r300); } -static void r300RenderMode( GLcontext *ctx, GLenum mode ) +static void r300RenderMode(GLcontext * ctx, GLenum mode) { r300ContextPtr rmesa = R300_CONTEXT(ctx); (void)rmesa; @@ -2180,7 +2369,7 @@ static void r300RenderMode( GLcontext *ctx, GLenum mode ) /** * Initialize driver's state callback functions */ -void r300InitStateFuncs(struct dd_function_table* functions) +void r300InitStateFuncs(struct dd_function_table *functions) { radeonInitStateFuncs(functions); @@ -2213,6 +2402,5 @@ void r300InitStateFuncs(struct dd_function_table* functions) functions->PolygonOffset = r300PolygonOffset; functions->PolygonMode = r300PolygonMode; - functions->RenderMode = r300RenderMode; + functions->RenderMode = r300RenderMode; } - diff --git a/src/mesa/drivers/dri/r300/r300_state.h b/src/mesa/drivers/dri/r300/r300_state.h index 52e606f2416..59e6baec921 100644 --- a/src/mesa/drivers/dri/r300/r300_state.h +++ b/src/mesa/drivers/dri/r300/r300_state.h @@ -58,23 +58,23 @@ do { \ \ } while (0) - extern void r300ResetHwState(r300ContextPtr r300); extern void r300UpdateStateParameters(GLcontext * ctx, GLuint new_state); extern void r300InitState(r300ContextPtr r300); -extern void r300InitStateFuncs(struct dd_function_table* functions); -extern void r300UpdateViewportOffset( GLcontext *ctx ); +extern void r300InitStateFuncs(struct dd_function_table *functions); +extern void r300UpdateViewportOffset(GLcontext * ctx); extern void r300UpdateWindow(GLcontext * ctx); -extern void r300UpdateDrawBuffer(GLcontext *ctx); +extern void r300UpdateDrawBuffer(GLcontext * ctx); extern void r300SetupVertexShader(r300ContextPtr rmesa); extern void r300SetupPixelShader(r300ContextPtr rmesa); -extern void r300_setup_textures(GLcontext *ctx); -extern void r300_setup_rs_unit(GLcontext *ctx); +extern void r300_setup_textures(GLcontext * ctx); +extern void r300_setup_rs_unit(GLcontext * ctx); extern void r300UpdateShaders(r300ContextPtr rmesa); extern void r300UpdateShaderStates(r300ContextPtr rmesa); -extern void r300_print_state_atom(r300ContextPtr r300, struct r300_state_atom *state); +extern void r300_print_state_atom(r300ContextPtr r300, + struct r300_state_atom *state); -#endif /* __R300_STATE_H__ */ +#endif /* __R300_STATE_H__ */ -- cgit v1.2.3 From 72608aedc3b8e2fdf0eb57d1a9b5673d4ddeff6b Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 03:12:22 +0000 Subject: r300: Added the Linux Kernel indent script. --- src/mesa/drivers/dri/r300/Lindent | 2 ++ 1 file changed, 2 insertions(+) create mode 100755 src/mesa/drivers/dri/r300/Lindent diff --git a/src/mesa/drivers/dri/r300/Lindent b/src/mesa/drivers/dri/r300/Lindent new file mode 100755 index 00000000000..7d8d8896e30 --- /dev/null +++ b/src/mesa/drivers/dri/r300/Lindent @@ -0,0 +1,2 @@ +#!/bin/sh +indent -npro -kr -i8 -ts8 -sob -l80 -ss -ncs "$@" -- cgit v1.2.3 From 504fafe38942bc26ab9595e9d14be4d42421cd5c Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 03:12:51 +0000 Subject: r300: Updated .gitignore. --- src/mesa/drivers/dri/r300/.gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/r300/.gitignore b/src/mesa/drivers/dri/r300/.gitignore index 3773d8ea73f..f8118b7c327 100644 --- a/src/mesa/drivers/dri/r300/.gitignore +++ b/src/mesa/drivers/dri/r300/.gitignore @@ -1,3 +1,3 @@ radeon_chipset.h -radeon_screen.* +radeon_screen.[ch] server -- cgit v1.2.3 From 0950e9727e4a99b78f6c3ba009dd86c06d48611d Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 03:14:08 +0000 Subject: mesa: Added Vim swap files to .gitignore. --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c71c0cf72ee..033e6e10bde 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ -*~ *.a *.o *.so +*.sw[a-z] +*~ depend depend.bak lib -- cgit v1.2.3 From eca50a27e1ecf5721a2570723b06bf22e7855f86 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 03:18:14 +0000 Subject: r300: Removed some obsolete code from r300_tex.c. --- src/mesa/drivers/dri/r300/r300_tex.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c index eb72802f8b4..027950bb2db 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.c +++ b/src/mesa/drivers/dri/r300/r300_tex.c @@ -158,11 +158,6 @@ static void r300SetTexWrap(r300TexObjPtr t, GLenum swrap, GLenum twrap, t->filter |= hw_swrap << R300_TX_WRAP_S_SHIFT; t->filter |= hw_twrap << R300_TX_WRAP_T_SHIFT; t->filter |= hw_qwrap << R300_TX_WRAP_Q_SHIFT; - -#if 0 - t->format_x &= ~R200_CLAMP_Q_MASK; - t->border_fallback = (is_clamp && is_clamp_to_border); -#endif } static void r300SetTexMaxAnisotropy(r300TexObjPtr t, GLfloat max) @@ -196,9 +191,6 @@ static void r300SetTexFilter(r300TexObjPtr t, GLenum minf, GLenum magf) GLuint anisotropy = (t->filter & R300_TX_MAX_ANISO_MASK); t->filter &= ~(R300_TX_MIN_FILTER_MASK | R300_TX_MAG_FILTER_MASK); -#if 0 - //t->format_x &= ~R200_VOLUME_FILTER_MASK; -#endif if (anisotropy == R300_TX_MAX_ANISO_1_TO_1) { switch (minf) { @@ -1173,18 +1165,4 @@ void r300InitTextureFuncs(struct dd_function_table *functions) functions->CompressedTexSubImage2D = r300CompressedTexSubImage2D; driInitTextureFormats(); - -#if 0 - /* moved or obsolete code */ - r300ContextPtr rmesa = R300_CONTEXT(ctx); - driInitTextureObjects(ctx, &rmesa->swapped, - DRI_TEXMGR_DO_TEXTURE_1D - | DRI_TEXMGR_DO_TEXTURE_2D); - - /* Hack: r300NewTextureObject is not yet installed when the - * default textures are created. Therefore set MaxAnisotropy of the - * default 2D texture now. */ - ctx->Shared->Default2D->MaxAnisotropy = - driQueryOptionf(&rmesa->optionCache, "def_max_anisotropy"); -#endif } -- cgit v1.2.3 From 4917955205e474fd6c3ad15a7dc886e04e83f34c Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 03:22:37 +0000 Subject: r300: Added a warning when texture state update fails. --- src/mesa/drivers/dri/r300/r300_texstate.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index 14b0c6063b7..b17652e4ddf 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -590,15 +590,13 @@ static GLboolean r300UpdateTextureUnit(GLcontext * ctx, int unit) void r300UpdateTextureState(GLcontext * ctx) { - GLboolean ok; - - ok = (r300UpdateTextureUnit(ctx, 0) && - r300UpdateTextureUnit(ctx, 1) && - r300UpdateTextureUnit(ctx, 2) && - r300UpdateTextureUnit(ctx, 3) && - r300UpdateTextureUnit(ctx, 4) && - r300UpdateTextureUnit(ctx, 5) && - r300UpdateTextureUnit(ctx, 6) && - r300UpdateTextureUnit(ctx, 7) - ); + int i; + + for (i = 0; i < 8; i++) { + if (!r300UpdateTextureUnit(ctx, i)) { + _mesa_warning(ctx, + "failed to update texture state for unit %d.\n", + i); + } + } } -- cgit v1.2.3 From fe2c58d2d520d49bbf4c922885ae4f0bf27fcde9 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 03:25:33 +0000 Subject: r300: Converted a few fprintf calls to _mesa_warning calls. --- src/mesa/drivers/dri/r300/r300_vertprog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index 486a3f2f040..6e023ef2ffa 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -255,7 +255,7 @@ static unsigned long t_src_index(struct r300_vertex_program *vp, struct prog_src return vp->inputs[src->Index]; }else{ if (src->Index < 0) { - fprintf(stderr, "WARNING negative offsets for indirect addressing do not work\n"); + _mesa_warning ("negative offsets for indirect addressing do not work.\n"); return 0; } return src->Index; -- cgit v1.2.3 From 28b47110b617c137ba18b9273c6172135a99b29d Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 03:32:15 +0000 Subject: r300: Converted exit calls to _mesa_exit calls. Note that the exit codes are inconsistent and should be fixed. --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 2 +- src/mesa/drivers/dri/r300/r300_emit.h | 4 ++-- src/mesa/drivers/dri/r300/r300_ioctl.c | 4 ++-- src/mesa/drivers/dri/r300/r300_maos.c | 4 ++-- src/mesa/drivers/dri/r300/r300_state.c | 18 +++++++++--------- src/mesa/drivers/dri/r300/r300_texmem.c | 2 +- src/mesa/drivers/dri/r300/r300_vertprog.c | 18 +++++++++--------- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index dbb38bf3acd..9bfdc85c4ab 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -122,7 +122,7 @@ int r300FlushCmdBuf(r300ContextPtr r300, const char *caller) if (ret) { fprintf(stderr, "drmRadeonCmdBuffer: %d (exiting)\n", ret); - exit(ret); + _mesa_exit(ret); } return ret; diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h index 90c2b8c1419..e616986c08f 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.h +++ b/src/mesa/drivers/dri/r300/r300_emit.h @@ -160,7 +160,7 @@ static __inline__ uint32_t cmdpacify(void) "cmd_written=%d cmd_reserved=%d\n", \ __FILE__, __FUNCTION__, __LINE__, \ cmd_written, cmd_reserved); \ - exit(-1); \ + _mesa_exit(-1); \ } \ } while(0) @@ -195,7 +195,7 @@ static __inline__ uint32_t cmdpacify(void) fprintf(stderr,"Too big packet3 %08x: cannot " \ "store %d dwords\n", \ _p, _n); \ - exit(-1); \ + _mesa_exit(-1); \ } \ cmd[0].i = cmdpacket3(R300_CMD_PACKET3_RAW); \ cmd[1].i = _p | ((_n & 0x3fff)<<16); \ diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index de0a482eb5d..05fe5e2c904 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -465,7 +465,7 @@ static void r300RefillCurrentDmaRegion(r300ContextPtr rmesa, int size) if (dmabuf->id == 0) { fprintf(stderr, "Error: Could not get dma buffer... exiting\n"); - exit(-1); + _mesa_exit(-1); } } @@ -591,7 +591,7 @@ static void r300RefillCurrentDmaRegion(r300ContextPtr rmesa) UNLOCK_HARDWARE(&rmesa->radeon); fprintf(stderr, "Error: Could not get dma buffer... exiting\n"); - exit(-1); + _mesa_exit(-1); } } diff --git a/src/mesa/drivers/dri/r300/r300_maos.c b/src/mesa/drivers/dri/r300/r300_maos.c index c424e7a31a9..94b1f65f263 100644 --- a/src/mesa/drivers/dri/r300/r300_maos.c +++ b/src/mesa/drivers/dri/r300/r300_maos.c @@ -217,7 +217,7 @@ static void emit_vector(GLcontext * ctx, break; default: assert(0); - exit(1); + _mesa_exit(1); break; } @@ -243,7 +243,7 @@ void r300EmitElts(GLcontext * ctx, void *elts, unsigned long n_elts, return; } else if (r300IsGartMemory(rmesa, elts, 1)) { WARN_ONCE("Pointer not within GART memory!\n"); - exit(1); + _mesa_exit(1); } r300AllocDmaRegion(rmesa, rvb, n_elts * elt_size, elt_size); diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 75d606fdcc4..fbdb4ca98f4 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1330,7 +1330,7 @@ void r300_setup_textures(GLcontext * ctx) fprintf(stderr, "Aiiee ! mtu=%d is greater than R300_MAX_TEXTURE_UNITS=%d\n", mtu, R300_MAX_TEXTURE_UNITS); - exit(-1); + _mesa_exit(-1); } /* We cannot let disabled tmu offsets pass DRM */ @@ -1514,7 +1514,7 @@ void r300_setup_rs_unit(GLcontext * ctx) if (i == ctx->Const.MaxTextureUnits) { fprintf(stderr, "\tno free texcoord found...\n"); - exit(0); + _mesa_exit(0); } InputsRead |= (FRAG_BIT_TEX0 << i); @@ -1542,7 +1542,7 @@ void r300_setup_rs_unit(GLcontext * ctx) ("fragprog wants coords for tex%d, vp doesn't provide them!\n", i); //_mesa_print_program(&CURRENT_VERTEX_SHADER(ctx)->Base); - //exit(-1); + //_mesa_exit(-1); } InputsRead &= ~(FRAG_BIT_TEX0 << i); fp_reg++; @@ -1562,7 +1562,7 @@ void r300_setup_rs_unit(GLcontext * ctx) ("fragprog wants col0, vp doesn't provide it\n"); goto out; /* FIXME */ //_mesa_print_program(&CURRENT_VERTEX_SHADER(ctx)->Base); - //exit(-1); + //_mesa_exit(-1); } r300->hw.rr.cmd[R300_RR_ROUTE_0] |= 0 @@ -1579,7 +1579,7 @@ void r300_setup_rs_unit(GLcontext * ctx) _TNL_ATTRIB_COLOR1)) { WARN_ONCE ("fragprog wants col1, vp doesn't provide it\n"); - //exit(-1); + //_mesa_exit(-1); } r300->hw.rr.cmd[R300_RR_ROUTE_1] |= @@ -1637,7 +1637,7 @@ void static inline setup_vertex_shader_fragment(r300ContextPtr r300, if (vsf->length & 0x3) { fprintf(stderr, "VERTEX_SHADER_FRAGMENT must have length divisible by 4\n"); - exit(-1); + _mesa_exit(-1); } switch ((dest >> 8) & 0xf) { @@ -1672,7 +1672,7 @@ void static inline setup_vertex_shader_fragment(r300ContextPtr r300, fprintf(stderr, "%s:%s don't know how to handle dest %04x\n", __FILE__, __FUNCTION__, dest); - exit(-1); + _mesa_exit(-1); } } @@ -2277,7 +2277,7 @@ void r300ResetHwState(r300ContextPtr r300) default: fprintf(stderr, "Error: Unsupported depth %d... exiting\n", ctx->Visual.depthBits); - exit(-1); + _mesa_exit(-1); } /* z compress? */ @@ -2347,7 +2347,7 @@ void r300InitState(r300ContextPtr r300) default: fprintf(stderr, "Error: Unsupported depth %d... exiting\n", ctx->Visual.depthBits); - exit(-1); + _mesa_exit(-1); } /* Only have hw stencil when depth buffer is 24 bits deep */ diff --git a/src/mesa/drivers/dri/r300/r300_texmem.c b/src/mesa/drivers/dri/r300/r300_texmem.c index c527677cd0c..4750c468db4 100644 --- a/src/mesa/drivers/dri/r300/r300_texmem.c +++ b/src/mesa/drivers/dri/r300/r300_texmem.c @@ -485,7 +485,7 @@ static void uploadSubImage( r300ContextPtr rmesa, r300TexObjPtr t, fprintf( stderr, " blit width=%d height=%d data=%p\n", t->image[face][hwlevel].width, t->image[face][hwlevel].height, t->image[face][hwlevel].data ); - exit( 1 ); + _mesa_exit( 1 ); } } diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index 6e023ef2ffa..c7bfd8e8a81 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -121,7 +121,7 @@ int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program_cont * if(mesa_vp->Base.Parameters->NumParameters * 4 > VSF_MAX_FRAGMENT_LENGTH){ fprintf(stderr, "%s:Params exhausted\n", __FUNCTION__); - exit(-1); + _mesa_exit(-1); } paramList = mesa_vp->Base.Parameters; @@ -173,7 +173,7 @@ static unsigned long t_dst_class(enum register_file file) */ default: fprintf(stderr, "problem in %s", __FUNCTION__); - exit(0); + _mesa_exit(0); } } @@ -207,7 +207,7 @@ static unsigned long t_src_class(enum register_file file) */ default: fprintf(stderr, "problem in %s", __FUNCTION__); - exit(0); + _mesa_exit(0); } } @@ -311,7 +311,7 @@ static unsigned long t_opcode(enum prog_opcode opcode) default: fprintf(stderr, "%s: Should not be called with opcode %d!", __FUNCTION__, opcode); } - exit(-1); + _mesa_exit(-1); return 0; } @@ -325,7 +325,7 @@ static unsigned long op_operands(enum prog_opcode opcode) return op_names[i].ip; fprintf(stderr, "op %d not found in op_names\n", opcode); - exit(-1); + _mesa_exit(-1); return 0; } @@ -796,7 +796,7 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct case OPCODE_RCC: fprintf(stderr, "Dont know how to handle op %d yet\n", vpi->Opcode); - exit(-1); + _mesa_exit(-1); break; case OPCODE_END: break; @@ -829,7 +829,7 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct default: fprintf(stderr, "scalars and op RCC not handled yet"); - exit(-1); + _mesa_exit(-1); break; } }else{ @@ -854,7 +854,7 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct default: fprintf(stderr, "scalars and op RCC not handled yet"); - exit(-1); + _mesa_exit(-1); break; } } @@ -1080,7 +1080,7 @@ void r300_select_vertex_shader(r300ContextPtr r300) if(i == ctx->Const.MaxTextureUnits){ fprintf(stderr, "\tno free texcoord found\n"); - exit(0); + _mesa_exit(0); } InputsRead |= (FRAG_BIT_TEX0 << i); -- cgit v1.2.3 From b8640db021feca2765df8ad3d31e9c818cc352ac Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 03:36:28 +0000 Subject: r300: Corrected the exit codes for consistency; they are all -1 for error now. The one exception is 300FlushCmdBuf. --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 2 +- src/mesa/drivers/dri/r300/r300_maos.c | 4 ++-- src/mesa/drivers/dri/r300/r300_state.c | 2 +- src/mesa/drivers/dri/r300/r300_texmem.c | 2 +- src/mesa/drivers/dri/r300/r300_vertprog.c | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 9bfdc85c4ab..294fcd75948 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -121,7 +121,7 @@ int r300FlushCmdBuf(r300ContextPtr r300, const char *caller) UNLOCK_HARDWARE(&r300->radeon); if (ret) { - fprintf(stderr, "drmRadeonCmdBuffer: %d (exiting)\n", ret); + fprintf(stderr, "drmRadeonCmdBuffer: %d\n", ret); _mesa_exit(ret); } diff --git a/src/mesa/drivers/dri/r300/r300_maos.c b/src/mesa/drivers/dri/r300/r300_maos.c index 94b1f65f263..d3105e0d160 100644 --- a/src/mesa/drivers/dri/r300/r300_maos.c +++ b/src/mesa/drivers/dri/r300/r300_maos.c @@ -217,7 +217,7 @@ static void emit_vector(GLcontext * ctx, break; default: assert(0); - _mesa_exit(1); + _mesa_exit(-1); break; } @@ -243,7 +243,7 @@ void r300EmitElts(GLcontext * ctx, void *elts, unsigned long n_elts, return; } else if (r300IsGartMemory(rmesa, elts, 1)) { WARN_ONCE("Pointer not within GART memory!\n"); - _mesa_exit(1); + _mesa_exit(-1); } r300AllocDmaRegion(rmesa, rvb, n_elts * elt_size, elt_size); diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index fbdb4ca98f4..18c15ae83de 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1514,7 +1514,7 @@ void r300_setup_rs_unit(GLcontext * ctx) if (i == ctx->Const.MaxTextureUnits) { fprintf(stderr, "\tno free texcoord found...\n"); - _mesa_exit(0); + _mesa_exit(-1); } InputsRead |= (FRAG_BIT_TEX0 << i); diff --git a/src/mesa/drivers/dri/r300/r300_texmem.c b/src/mesa/drivers/dri/r300/r300_texmem.c index 4750c468db4..5d52f777e3b 100644 --- a/src/mesa/drivers/dri/r300/r300_texmem.c +++ b/src/mesa/drivers/dri/r300/r300_texmem.c @@ -485,7 +485,7 @@ static void uploadSubImage( r300ContextPtr rmesa, r300TexObjPtr t, fprintf( stderr, " blit width=%d height=%d data=%p\n", t->image[face][hwlevel].width, t->image[face][hwlevel].height, t->image[face][hwlevel].data ); - _mesa_exit( 1 ); + _mesa_exit(-1); } } diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index c7bfd8e8a81..245ceb4d122 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -173,7 +173,7 @@ static unsigned long t_dst_class(enum register_file file) */ default: fprintf(stderr, "problem in %s", __FUNCTION__); - _mesa_exit(0); + _mesa_exit(-1); } } @@ -207,7 +207,7 @@ static unsigned long t_src_class(enum register_file file) */ default: fprintf(stderr, "problem in %s", __FUNCTION__); - _mesa_exit(0); + _mesa_exit(-1); } } @@ -1080,7 +1080,7 @@ void r300_select_vertex_shader(r300ContextPtr r300) if(i == ctx->Const.MaxTextureUnits){ fprintf(stderr, "\tno free texcoord found\n"); - _mesa_exit(0); + _mesa_exit(-1); } InputsRead |= (FRAG_BIT_TEX0 << i); -- cgit v1.2.3 From f0126a76ac9fc9c20b1b1aecf1d476d5fd432f36 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 03:38:45 +0000 Subject: r300: Corrected an error in r300_vertprog.c. Cannot use _mesa_warning here because we don't have a context pointer; perhaps R300 specific warning and error functions are needed. --- src/mesa/drivers/dri/r300/r300_vertprog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index 245ceb4d122..ddb4996ee02 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -255,7 +255,7 @@ static unsigned long t_src_index(struct r300_vertex_program *vp, struct prog_src return vp->inputs[src->Index]; }else{ if (src->Index < 0) { - _mesa_warning ("negative offsets for indirect addressing do not work.\n"); + fprintf (stderr, "negative offsets for indirect addressing do not work.\n"); return 0; } return src->Index; -- cgit v1.2.3 From d316b4dc22f4d5f0b91e665885a090395e2766c7 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 03:40:06 +0000 Subject: r300: Corrected a couple of "control reaches end of non-void function" warnings. --- src/mesa/drivers/dri/r300/r300_vertprog.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index ddb4996ee02..39d127c64ac 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -174,6 +174,7 @@ static unsigned long t_dst_class(enum register_file file) default: fprintf(stderr, "problem in %s", __FUNCTION__); _mesa_exit(-1); + return -1; } } @@ -208,6 +209,7 @@ static unsigned long t_src_class(enum register_file file) default: fprintf(stderr, "problem in %s", __FUNCTION__); _mesa_exit(-1); + return -1; } } -- cgit v1.2.3 From 328b307e2f7665bda57afa0739680ca61b54f783 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 03:44:40 +0000 Subject: r300: Cleaned up the R300 Makefile. --- src/mesa/drivers/dri/r300/Makefile | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile index d4bf0ae892f..65a6b03b741 100644 --- a/src/mesa/drivers/dri/r300/Makefile +++ b/src/mesa/drivers/dri/r300/Makefile @@ -1,6 +1,5 @@ # src/mesa/drivers/dri/r300/Makefile - TOP = ../../../../.. include $(TOP)/configs/current @@ -45,30 +44,8 @@ DRIVER_SOURCES = \ r300_maos.c \ $(EGL_SOURCES) -# \ -# r200_context.c \ -# r200_ioctl.c \ -# r200_state.c \ -# r200_state_init.c \ -# r200_cmdbuf.c \ -# r200_pixel.c \ -# r200_tex.c \ -# r200_texmem.c \ -# r200_texstate.c \ -# r200_swtcl.c \ -# r200_maos.c \ -# r200_sanity.c \ -# r200_vtxfmt.c \ -# r200_vtxfmt_c.c \ -# r200_vtxfmt_sse.c \ -# r200_vtxfmt_x86.c - - C_SOURCES = $(COMMON_SOURCES) $(DRIVER_SOURCES) -X86_SOURCES = -#r200_vtxtmp_x86.S - DRIVER_DEFINES = -DCOMPILE_R300 -DGLX_DIRECT_RENDERING -DR200_MERGED=0 \ -DRADEON_COMMON=1 -DRADEON_COMMON_FOR_R300 @@ -87,7 +64,6 @@ COMMON_SYMLINKS = \ ##### TARGETS ##### - include ../Makefile.template server: @@ -100,4 +76,3 @@ $(COMMON_SYMLINKS): @[ -e $@ ] || ln -sf ../radeon/$@ ./ symlinks: $(SYMLINKS) $(COMMON_SYMLINKS) - -- cgit v1.2.3 From 9e91351826002ef86b529ea85c3bfe5d2c58f634 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 04:08:27 +0000 Subject: r300: Indented r300_fragprog.[ch]. --- src/mesa/drivers/dri/r300/r300_fragprog.c | 1081 ++++++++++++++--------------- src/mesa/drivers/dri/r300/r300_fragprog.h | 3 +- 2 files changed, 528 insertions(+), 556 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.c b/src/mesa/drivers/dri/r300/r300_fragprog.c index 26b09b4db23..127aa12eb37 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog.c @@ -95,9 +95,9 @@ #define REG_NEGV_SHIFT 18 #define REG_NEGS_SHIFT 19 #define REG_ABS_SHIFT 20 -#define REG_NO_USE_SHIFT 21 // Hack for refcounting -#define REG_VALID_SHIFT 22 // Does the register contain a defined value? -#define REG_BUILTIN_SHIFT 23 // Is it a builtin (like all zero/all one)? +#define REG_NO_USE_SHIFT 21 // Hack for refcounting +#define REG_VALID_SHIFT 22 // Does the register contain a defined value? +#define REG_BUILTIN_SHIFT 23 // Is it a builtin (like all zero/all one)? #define REG_TYPE_MASK (0x03 << REG_TYPE_SHIFT) #define REG_INDEX_MASK (0x3F << REG_INDEX_SHIFT) @@ -160,7 +160,6 @@ #define REG_NEGS(reg) \ reg = (reg | REG_NEGS_MASK) - /* * Datas structures for fragment program generation */ @@ -172,22 +171,23 @@ static const struct { int v_op; int s_op; } r300_fpop[] = { - { "MAD", 3, R300_FPI0_OUTC_MAD, R300_FPI2_OUTA_MAD }, - { "DP3", 2, R300_FPI0_OUTC_DP3, R300_FPI2_OUTA_DP4 }, - { "DP4", 2, R300_FPI0_OUTC_DP4, R300_FPI2_OUTA_DP4 }, - { "MIN", 2, R300_FPI0_OUTC_MIN, R300_FPI2_OUTA_MIN }, - { "MAX", 2, R300_FPI0_OUTC_MAX, R300_FPI2_OUTA_MAX }, - { "CMP", 3, R300_FPI0_OUTC_CMP, R300_FPI2_OUTA_CMP }, - { "FRC", 1, R300_FPI0_OUTC_FRC, R300_FPI2_OUTA_FRC }, - { "EX2", 1, R300_FPI0_OUTC_REPL_ALPHA, R300_FPI2_OUTA_EX2 }, - { "LG2", 1, R300_FPI0_OUTC_REPL_ALPHA, R300_FPI2_OUTA_LG2 }, - { "RCP", 1, R300_FPI0_OUTC_REPL_ALPHA, R300_FPI2_OUTA_RCP }, - { "RSQ", 1, R300_FPI0_OUTC_REPL_ALPHA, R300_FPI2_OUTA_RSQ }, - { "REPL_ALPHA", 1, R300_FPI0_OUTC_REPL_ALPHA, PFS_INVAL }, - { "CMPH", 3, R300_FPI0_OUTC_CMPH, PFS_INVAL }, + /* *INDENT-OFF* */ + {"MAD", 3, R300_FPI0_OUTC_MAD, R300_FPI2_OUTA_MAD}, + {"DP3", 2, R300_FPI0_OUTC_DP3, R300_FPI2_OUTA_DP4}, + {"DP4", 2, R300_FPI0_OUTC_DP4, R300_FPI2_OUTA_DP4}, + {"MIN", 2, R300_FPI0_OUTC_MIN, R300_FPI2_OUTA_MIN}, + {"MAX", 2, R300_FPI0_OUTC_MAX, R300_FPI2_OUTA_MAX}, + {"CMP", 3, R300_FPI0_OUTC_CMP, R300_FPI2_OUTA_CMP}, + {"FRC", 1, R300_FPI0_OUTC_FRC, R300_FPI2_OUTA_FRC}, + {"EX2", 1, R300_FPI0_OUTC_REPL_ALPHA, R300_FPI2_OUTA_EX2}, + {"LG2", 1, R300_FPI0_OUTC_REPL_ALPHA, R300_FPI2_OUTA_LG2}, + {"RCP", 1, R300_FPI0_OUTC_REPL_ALPHA, R300_FPI2_OUTA_RCP}, + {"RSQ", 1, R300_FPI0_OUTC_REPL_ALPHA, R300_FPI2_OUTA_RSQ}, + {"REPL_ALPHA", 1, R300_FPI0_OUTC_REPL_ALPHA, PFS_INVAL}, + {"CMPH", 3, R300_FPI0_OUTC_CMPH, PFS_INVAL}, + /* *INDENT-ON* */ }; - /* vector swizzles r300 can support natively, with a couple of * cases we handle specially * @@ -201,25 +201,27 @@ static const struct { SWIZZLE_##y, \ SWIZZLE_##z, \ SWIZZLE_ZERO)) +/* native swizzles */ static const struct r300_pfs_swizzle { - GLuint hash; /* swizzle value this matches */ - GLuint base; /* base value for hw swizzle */ - GLuint stride; /* difference in base between arg0/1/2 */ + GLuint hash; /* swizzle value this matches */ + GLuint base; /* base value for hw swizzle */ + GLuint stride; /* difference in base between arg0/1/2 */ GLuint flags; } v_swiz[] = { -/* native swizzles */ - { MAKE_SWZ3(X, Y, Z), R300_FPI0_ARGC_SRC0C_XYZ, 4, SLOT_SRC_VECTOR }, - { MAKE_SWZ3(X, X, X), R300_FPI0_ARGC_SRC0C_XXX, 4, SLOT_SRC_VECTOR }, - { MAKE_SWZ3(Y, Y, Y), R300_FPI0_ARGC_SRC0C_YYY, 4, SLOT_SRC_VECTOR }, - { MAKE_SWZ3(Z, Z, Z), R300_FPI0_ARGC_SRC0C_ZZZ, 4, SLOT_SRC_VECTOR }, - { MAKE_SWZ3(W, W, W), R300_FPI0_ARGC_SRC0A, 1, SLOT_SRC_SCALAR }, - { MAKE_SWZ3(Y, Z, X), R300_FPI0_ARGC_SRC0C_YZX, 1, SLOT_SRC_VECTOR }, - { MAKE_SWZ3(Z, X, Y), R300_FPI0_ARGC_SRC0C_ZXY, 1, SLOT_SRC_VECTOR }, - { MAKE_SWZ3(W, Z, Y), R300_FPI0_ARGC_SRC0CA_WZY, 1, SLOT_SRC_BOTH }, - { MAKE_SWZ3(ONE, ONE, ONE), R300_FPI0_ARGC_ONE, 0, 0}, - { MAKE_SWZ3(ZERO, ZERO, ZERO), R300_FPI0_ARGC_ZERO, 0, 0}, - { MAKE_SWZ3(HALF, HALF, HALF), R300_FPI0_ARGC_HALF, 0, 0}, - { PFS_INVAL, 0, 0, 0}, + /* *INDENT-OFF* */ + {MAKE_SWZ3(X, Y, Z), R300_FPI0_ARGC_SRC0C_XYZ, 4, SLOT_SRC_VECTOR}, + {MAKE_SWZ3(X, X, X), R300_FPI0_ARGC_SRC0C_XXX, 4, SLOT_SRC_VECTOR}, + {MAKE_SWZ3(Y, Y, Y), R300_FPI0_ARGC_SRC0C_YYY, 4, SLOT_SRC_VECTOR}, + {MAKE_SWZ3(Z, Z, Z), R300_FPI0_ARGC_SRC0C_ZZZ, 4, SLOT_SRC_VECTOR}, + {MAKE_SWZ3(W, W, W), R300_FPI0_ARGC_SRC0A, 1, SLOT_SRC_SCALAR}, + {MAKE_SWZ3(Y, Z, X), R300_FPI0_ARGC_SRC0C_YZX, 1, SLOT_SRC_VECTOR}, + {MAKE_SWZ3(Z, X, Y), R300_FPI0_ARGC_SRC0C_ZXY, 1, SLOT_SRC_VECTOR}, + {MAKE_SWZ3(W, Z, Y), R300_FPI0_ARGC_SRC0CA_WZY, 1, SLOT_SRC_BOTH}, + {MAKE_SWZ3(ONE, ONE, ONE), R300_FPI0_ARGC_ONE, 0, 0}, + {MAKE_SWZ3(ZERO, ZERO, ZERO), R300_FPI0_ARGC_ZERO, 0, 0}, + {MAKE_SWZ3(HALF, HALF, HALF), R300_FPI0_ARGC_HALF, 0, 0}, + {PFS_INVAL, 0, 0, 0}, + /* *INDENT-ON* */ }; /* used during matching of non-native swizzles */ @@ -232,28 +234,32 @@ static const struct { int mask; /* actual outmask */ int count; /* count of components matched */ } s_mask[] = { - { SWZ_X_MASK|SWZ_Y_MASK|SWZ_Z_MASK, 1|2|4, 3}, - { SWZ_X_MASK|SWZ_Y_MASK, 1|2, 2}, - { SWZ_X_MASK|SWZ_Z_MASK, 1|4, 2}, - { SWZ_Y_MASK|SWZ_Z_MASK, 2|4, 2}, - { SWZ_X_MASK, 1, 1}, - { SWZ_Y_MASK, 2, 1}, - { SWZ_Z_MASK, 4, 1}, - { PFS_INVAL, PFS_INVAL, PFS_INVAL} + /* *INDENT-OFF* */ + {SWZ_X_MASK | SWZ_Y_MASK | SWZ_Z_MASK, 1 | 2 | 4, 3}, + {SWZ_X_MASK | SWZ_Y_MASK, 1 | 2, 2}, + {SWZ_X_MASK | SWZ_Z_MASK, 1 | 4, 2}, + {SWZ_Y_MASK | SWZ_Z_MASK, 2 | 4, 2}, + {SWZ_X_MASK, 1, 1}, + {SWZ_Y_MASK, 2, 1}, + {SWZ_Z_MASK, 4, 1}, + {PFS_INVAL, PFS_INVAL, PFS_INVAL} + /* *INDENT-ON* */ }; static const struct { - int base; /* hw value of swizzle */ - int stride; /* difference between SRC0/1/2 */ + int base; /* hw value of swizzle */ + int stride; /* difference between SRC0/1/2 */ GLuint flags; } s_swiz[] = { - { R300_FPI2_ARGA_SRC0C_X, 3, SLOT_SRC_VECTOR }, - { R300_FPI2_ARGA_SRC0C_Y, 3, SLOT_SRC_VECTOR }, - { R300_FPI2_ARGA_SRC0C_Z, 3, SLOT_SRC_VECTOR }, - { R300_FPI2_ARGA_SRC0A , 1, SLOT_SRC_SCALAR }, - { R300_FPI2_ARGA_ZERO , 0, 0 }, - { R300_FPI2_ARGA_ONE , 0, 0 }, - { R300_FPI2_ARGA_HALF , 0, 0 } + /* *INDENT-OFF* */ + {R300_FPI2_ARGA_SRC0C_X, 3, SLOT_SRC_VECTOR}, + {R300_FPI2_ARGA_SRC0C_Y, 3, SLOT_SRC_VECTOR}, + {R300_FPI2_ARGA_SRC0C_Z, 3, SLOT_SRC_VECTOR}, + {R300_FPI2_ARGA_SRC0A, 1, SLOT_SRC_SCALAR}, + {R300_FPI2_ARGA_ZERO, 0, 0}, + {R300_FPI2_ARGA_ONE, 0, 0}, + {R300_FPI2_ARGA_HALF, 0, 0} + /* *INDENT-ON* */ }; /* boiler-plate reg, for convenience */ @@ -297,9 +303,8 @@ static const GLuint pfs_zero = REG(REG_TYPE_CONST, */ static void dump_program(struct r300_fragment_program *rp); static void emit_arith(struct r300_fragment_program *rp, int op, - GLuint dest, int mask, - GLuint src0, GLuint src1, GLuint src2, - int flags); + GLuint dest, int mask, + GLuint src0, GLuint src1, GLuint src2, int flags); /** * Get an R300 temporary that can be written to in the given slot. @@ -309,7 +314,7 @@ static int get_hw_temp(struct r300_fragment_program *rp, int slot) COMPILE_STATE; int r; - for(r = 0; r < PFS_NUM_TEMP_REGS; ++r) { + for (r = 0; r < PFS_NUM_TEMP_REGS; ++r) { if (cs->hwtemps[r].free >= 0 && cs->hwtemps[r].free <= slot) break; } @@ -318,7 +323,6 @@ static int get_hw_temp(struct r300_fragment_program *rp, int slot) ERROR("Out of hardware temps\n"); return 0; } - // Reserved is used to avoid the following scenario: // R300 temporary X is first assigned to Mesa temporary Y during vector ops // R300 temporary X is then assigned to Mesa temporary Z for further vector ops @@ -349,7 +353,7 @@ static int get_hw_temp_tex(struct r300_fragment_program *rp) COMPILE_STATE; int r; - for(r = 0; r < PFS_NUM_TEMP_REGS; ++r) { + for (r = 0; r < PFS_NUM_TEMP_REGS; ++r) { if (cs->used_in_node & (1 << r)) continue; @@ -359,7 +363,7 @@ static int get_hw_temp_tex(struct r300_fragment_program *rp) } if (r >= PFS_NUM_TEMP_REGS) - return get_hw_temp(rp, 0); /* Will cause an indirection */ + return get_hw_temp(rp, 0); /* Will cause an indirection */ cs->hwtemps[r].reserved = cs->hwtemps[r].free; cs->hwtemps[r].free = -1; @@ -393,10 +397,9 @@ static void free_hw_temp(struct r300_fragment_program *rp, int idx) // I'm certain the register allocation could be further sanitized, // but it's tricky because of stuff that can happen inside emit_tex // and emit_arith. - cs->hwtemps[idx].free = cs->nrslots+1; + cs->hwtemps[idx].free = cs->nrslots + 1; } - /** * Create a new Mesa temporary register. */ @@ -478,12 +481,13 @@ static void free_temp(struct r300_fragment_program *rp, GLuint r) * of the fragment program (actually, up until the next time the fragment * program is translated). */ -static GLuint emit_const4fv(struct r300_fragment_program *rp, const GLfloat* cp) +static GLuint emit_const4fv(struct r300_fragment_program *rp, + const GLfloat * cp) { GLuint reg = undef; int index; - for(index = 0; index < rp->const_nr; ++index) { + for (index = 0; index < rp->const_nr; ++index) { if (rp->constant[index] == cp) break; } @@ -527,13 +531,10 @@ static inline GLuint absolute(GLuint r) } static int swz_native(struct r300_fragment_program *rp, - GLuint src, - GLuint *r, - GLuint arbneg) + GLuint src, GLuint * r, GLuint arbneg) { /* Native swizzle, handle negation */ - src = (src & ~REG_NEGS_MASK) | - (((arbneg >> 3) & 1) << REG_NEGS_SHIFT); + src = (src & ~REG_NEGS_MASK) | (((arbneg >> 3) & 1) << REG_NEGS_SHIFT); if ((arbneg & 0x7) == 0x0) { src = src & ~REG_NEGV_MASK; @@ -547,21 +548,13 @@ static int swz_native(struct r300_fragment_program *rp, src |= REG_NEGV_MASK; emit_arith(rp, PFS_OP_MAD, - *r, - arbneg & 0x7, - keep(src), - pfs_one, - pfs_zero, - 0); + *r, arbneg & 0x7, keep(src), pfs_one, pfs_zero, 0); src = src & ~REG_NEGV_MASK; emit_arith(rp, PFS_OP_MAD, *r, (arbneg ^ 0x7) | WRITEMASK_W, - src, - pfs_one, - pfs_zero, - 0); + src, pfs_one, pfs_zero, 0); } return 3; @@ -569,10 +562,7 @@ static int swz_native(struct r300_fragment_program *rp, static int swz_emit_partial(struct r300_fragment_program *rp, GLuint src, - GLuint *r, - int mask, - int mc, - GLuint arbneg) + GLuint * r, int mask, int mc, GLuint arbneg) { GLuint tmp; GLuint wmask = 0; @@ -597,9 +587,7 @@ static int swz_emit_partial(struct r300_fragment_program *rp, *r, arbneg & s_mask[mask].mask, keep(src) | REG_NEGV_MASK, - pfs_one, - pfs_zero, - 0); + pfs_one, pfs_zero, 0); if (!wmask) { REG_SET_NO_USE(src, GL_TRUE); } else { @@ -607,12 +595,7 @@ static int swz_emit_partial(struct r300_fragment_program *rp, } emit_arith(rp, PFS_OP_MAD, - *r, - tmp | wmask, - src, - pfs_one, - pfs_zero, - 0); + *r, tmp | wmask, src, pfs_one, pfs_zero, 0); } else { if (!wmask) { REG_SET_NO_USE(src, GL_TRUE); @@ -623,10 +606,7 @@ static int swz_emit_partial(struct r300_fragment_program *rp, PFS_OP_MAD, *r, (arbneg & s_mask[mask].mask) | wmask, - src | REG_NEGV_MASK, - pfs_one, - pfs_zero, - 0); + src | REG_NEGV_MASK, pfs_one, pfs_zero, 0); } } else { if (!wmask) { @@ -637,19 +617,14 @@ static int swz_emit_partial(struct r300_fragment_program *rp, emit_arith(rp, PFS_OP_MAD, *r, s_mask[mask].mask | wmask, - src, - pfs_one, - pfs_zero, - 0); + src, pfs_one, pfs_zero, 0); } return s_mask[mask].count; } static GLuint do_swizzle(struct r300_fragment_program *rp, - GLuint src, - GLuint arbswz, - GLuint arbneg) + GLuint src, GLuint arbswz, GLuint arbneg) { GLuint r = undef; GLuint vswz; @@ -660,41 +635,38 @@ static GLuint do_swizzle(struct r300_fragment_program *rp, * emit result to a temp, and do new swizzle from the temp. */ #if 0 - if (REG_GET_VSWZ(src) != SWIZZLE_XYZ || - REG_GET_SSWZ(src) != SWIZZLE_W) { + if (REG_GET_VSWZ(src) != SWIZZLE_XYZ || REG_GET_SSWZ(src) != SWIZZLE_W) { GLuint temp = get_temp_reg(rp); emit_arith(rp, PFS_OP_MAD, - temp, - WRITEMASK_XYZW, - src, - pfs_one, - pfs_zero, - 0); + temp, WRITEMASK_XYZW, src, pfs_one, pfs_zero, 0); src = temp; } #endif - if (REG_GET_VSWZ(src) != SWIZZLE_XYZ || - REG_GET_SSWZ(src) != SWIZZLE_W) { - GLuint vsrcswz = (v_swiz[REG_GET_VSWZ(src)].hash & (SWZ_X_MASK|SWZ_Y_MASK|SWZ_Z_MASK)) | REG_GET_SSWZ(src) << 9; - GLint i; - - GLuint newswz = 0; - GLuint offset; - for(i=0; i < 4; ++i){ - offset = GET_SWZ(arbswz, i); - - newswz |= (offset <= 3)?GET_SWZ(vsrcswz, offset) << i*3:offset << i*3; - } + if (REG_GET_VSWZ(src) != SWIZZLE_XYZ || REG_GET_SSWZ(src) != SWIZZLE_W) { + GLuint vsrcswz = + (v_swiz[REG_GET_VSWZ(src)]. + hash & (SWZ_X_MASK | SWZ_Y_MASK | SWZ_Z_MASK)) | + REG_GET_SSWZ(src) << 9; + GLint i; + + GLuint newswz = 0; + GLuint offset; + for (i = 0; i < 4; ++i) { + offset = GET_SWZ(arbswz, i); + + newswz |= + (offset <= 3) ? GET_SWZ(vsrcswz, + offset) << i * + 3 : offset << i * 3; + } - arbswz = newswz & (SWZ_X_MASK|SWZ_Y_MASK|SWZ_Z_MASK); - REG_SET_SSWZ(src, GET_SWZ(newswz, 3)); - } - else - { - /* set scalar swizzling */ - REG_SET_SSWZ(src, GET_SWZ(arbswz, 3)); + arbswz = newswz & (SWZ_X_MASK | SWZ_Y_MASK | SWZ_Z_MASK); + REG_SET_SSWZ(src, GET_SWZ(newswz, 3)); + } else { + /* set scalar swizzling */ + REG_SET_SSWZ(src, GET_SWZ(arbswz, 3)); } do { @@ -704,14 +676,12 @@ static GLuint do_swizzle(struct r300_fragment_program *rp, REG_SET_VSWZ(src, vswz); chash = v_swiz[REG_GET_VSWZ(src)].hash & - s_mask[c_mask].hash; + s_mask[c_mask].hash; if (chash == (arbswz & s_mask[c_mask].hash)) { if (s_mask[c_mask].count == 3) { v_match += swz_native(rp, - src, - &r, - arbneg); + src, &r, arbneg); } else { v_match += swz_emit_partial(rp, src, @@ -730,7 +700,7 @@ static GLuint do_swizzle(struct r300_fragment_program *rp, */ arbswz |= (PFS_INVAL & s_mask[c_mask].hash); } - } while(v_swiz[++vswz].hash != PFS_INVAL); + } while (v_swiz[++vswz].hash != PFS_INVAL); REG_SET_VSWZ(src, SWIZZLE_XYZ); } while (s_mask[++c_mask].hash != PFS_INVAL); @@ -756,16 +726,19 @@ static GLuint t_src(struct r300_fragment_program *rp, break; case PROGRAM_LOCAL_PARAM: r = emit_const4fv(rp, - rp->mesa_program.Base.LocalParams[fpsrc.Index]); + rp->mesa_program.Base.LocalParams[fpsrc. + Index]); break; case PROGRAM_ENV_PARAM: r = emit_const4fv(rp, - rp->ctx->FragmentProgram.Parameters[fpsrc.Index]); + rp->ctx->FragmentProgram.Parameters[fpsrc. + Index]); break; case PROGRAM_STATE_VAR: case PROGRAM_NAMED_PARAM: r = emit_const4fv(rp, - rp->mesa_program.Base.Parameters->ParameterValues[fpsrc.Index]); + rp->mesa_program.Base.Parameters-> + ParameterValues[fpsrc.Index]); break; default: ERROR("unknown SrcReg->File %x\n", fpsrc.File); @@ -782,15 +755,15 @@ static GLuint t_scalar_src(struct r300_fragment_program *rp, struct prog_src_register fpsrc) { struct prog_src_register src = fpsrc; - int sc = GET_SWZ(fpsrc.Swizzle, 0); /* X */ + int sc = GET_SWZ(fpsrc.Swizzle, 0); /* X */ - src.Swizzle = ((sc<<0)|(sc<<3)|(sc<<6)|(sc<<9)); + src.Swizzle = ((sc << 0) | (sc << 3) | (sc << 6) | (sc << 9)); return t_src(rp, src); } static GLuint t_dst(struct r300_fragment_program *rp, - struct prog_dst_register dest) + struct prog_dst_register dest) { GLuint r = undef; @@ -818,33 +791,29 @@ static GLuint t_dst(struct r300_fragment_program *rp, } } -static int t_hw_src(struct r300_fragment_program *rp, - GLuint src, - GLboolean tex) +static int t_hw_src(struct r300_fragment_program *rp, GLuint src, GLboolean tex) { COMPILE_STATE; int idx; int index = REG_GET_INDEX(src); - switch(REG_GET_TYPE(src)) { + switch (REG_GET_TYPE(src)) { case REG_TYPE_TEMP: /* NOTE: if reg==-1 here, a source is being read that - * hasn't been written to. Undefined results. + * hasn't been written to. Undefined results. */ if (cs->temps[index].reg == -1) cs->temps[index].reg = get_hw_temp(rp, cs->nrslots); idx = cs->temps[index].reg; - if (!REG_GET_NO_USE(src) && - (--cs->temps[index].refcount == 0)) + if (!REG_GET_NO_USE(src) && (--cs->temps[index].refcount == 0)) free_temp(rp, src); break; case REG_TYPE_INPUT: idx = cs->inputs[index].reg; - if (!REG_GET_NO_USE(src) && - (--cs->inputs[index].refcount == 0)) + if (!REG_GET_NO_USE(src) && (--cs->inputs[index].refcount == 0)) free_hw_temp(rp, cs->inputs[index].reg); break; case REG_TYPE_CONST: @@ -861,16 +830,14 @@ static int t_hw_src(struct r300_fragment_program *rp, } static int t_hw_dst(struct r300_fragment_program *rp, - GLuint dest, - GLboolean tex, - int slot) + GLuint dest, GLboolean tex, int slot) { COMPILE_STATE; int idx; GLuint index = REG_GET_INDEX(dest); assert(REG_GET_VALID(dest)); - switch(REG_GET_TYPE(dest)) { + switch (REG_GET_TYPE(dest)) { case REG_TYPE_TEMP: if (cs->temps[REG_GET_INDEX(dest)].reg == -1) { if (!tex) { @@ -881,20 +848,21 @@ static int t_hw_dst(struct r300_fragment_program *rp, } idx = cs->temps[index].reg; - if (!REG_GET_NO_USE(dest) && - (--cs->temps[index].refcount == 0)) + if (!REG_GET_NO_USE(dest) && (--cs->temps[index].refcount == 0)) free_temp(rp, dest); cs->dest_in_node |= (1 << idx); cs->used_in_node |= (1 << idx); break; case REG_TYPE_OUTPUT: - switch(index) { + switch (index) { case FRAG_RESULT_COLR: - rp->node[rp->cur_node].flags |= R300_PFS_NODE_OUTPUT_COLOR; + rp->node[rp->cur_node].flags |= + R300_PFS_NODE_OUTPUT_COLOR; break; case FRAG_RESULT_DEPR: - rp->node[rp->cur_node].flags |= R300_PFS_NODE_OUTPUT_DEPTH; + rp->node[rp->cur_node].flags |= + R300_PFS_NODE_OUTPUT_DEPTH; break; } return index; @@ -924,8 +892,7 @@ static void emit_nop(struct r300_fragment_program *rp) } static void emit_tex(struct r300_fragment_program *rp, - struct prog_instruction *fpi, - int opcode) + struct prog_instruction *fpi, int opcode) { COMPILE_STATE; GLuint coord = t_src(rp, fpi->SrcReg[0]); @@ -950,19 +917,24 @@ static void emit_tex(struct r300_fragment_program *rp, * support for programs. */ gl_state_index tokens[STATE_LENGTH] = { - STATE_INTERNAL, STATE_R300_TEXRECT_FACTOR, 0, 0, 0 + STATE_INTERNAL, STATE_R300_TEXRECT_FACTOR, 0, 0, + 0 }; int factor_index; GLuint factorreg; tokens[2] = unit; - factor_index = _mesa_add_state_reference(rp->mesa_program.Base.Parameters, tokens); - factorreg = emit_const4fv(rp, - rp->mesa_program.Base.Parameters->ParameterValues[factor_index]); + factor_index = + _mesa_add_state_reference(rp->mesa_program.Base. + Parameters, tokens); + factorreg = + emit_const4fv(rp, + rp->mesa_program.Base.Parameters-> + ParameterValues[factor_index]); tempreg = keep(get_temp_reg(rp)); emit_arith(rp, PFS_OP_MAD, tempreg, WRITEMASK_XYZW, - coord, factorreg, pfs_zero, 0); + coord, factorreg, pfs_zero, 0); /* Ensure correct node indirection */ uin = cs->used_in_node; @@ -980,7 +952,9 @@ static void emit_tex(struct r300_fragment_program *rp, rdest = dest; dest = get_temp_reg_tex(rp); } - hwdest = t_hw_dst(rp, dest, GL_TRUE, rp->node[rp->cur_node].alu_offset); + hwdest = + t_hw_dst(rp, dest, GL_TRUE, + rp->node[rp->cur_node].alu_offset); /* Use a temp that hasn't been used in this node, rather * than causing an indirection @@ -996,19 +970,18 @@ static void emit_tex(struct r300_fragment_program *rp, hwsrc = t_hw_src(rp, coord, GL_TRUE); } - /* Indirection if source has been written in this node, or if the * dest has been read/written in this node */ if ((REG_GET_TYPE(coord) != REG_TYPE_CONST && - (din & (1<node[rp->cur_node].alu_offset == cs->nrslots) emit_nop(rp); rp->node[rp->cur_node].alu_end = - cs->nrslots - rp->node[rp->cur_node].alu_offset - 1; + cs->nrslots - rp->node[rp->cur_node].alu_offset - 1; assert(rp->node[rp->cur_node].alu_end >= 0); if (++rp->cur_node >= PFS_MAX_TEX_INDIRECT) { @@ -1029,12 +1002,11 @@ static void emit_tex(struct r300_fragment_program *rp, if (rp->cur_node == 0) rp->first_node_has_tex = 1; - rp->tex.inst[rp->tex.length++] = 0 - | (hwsrc << R300_FPITX_SRC_SHIFT) - | (hwdest << R300_FPITX_DST_SHIFT) - | (unit << R300_FPITX_IMAGE_SHIFT) - /* not entirely sure about this */ - | (opcode << R300_FPITX_OPCODE_SHIFT); + rp->tex.inst[rp->tex.length++] = 0 | (hwsrc << R300_FPITX_SRC_SHIFT) + | (hwdest << R300_FPITX_DST_SHIFT) + | (unit << R300_FPITX_IMAGE_SHIFT) + /* not entirely sure about this */ + | (opcode << R300_FPITX_OPCODE_SHIFT); cs->dest_in_node |= (1 << hwdest); if (REG_GET_TYPE(coord) != REG_TYPE_CONST) @@ -1054,14 +1026,12 @@ static void emit_tex(struct r300_fragment_program *rp, free_temp(rp, tempreg); } - /** * Returns the first slot where we could possibly allow writing to dest, * according to register allocation. */ -static int get_earliest_allowed_write( - struct r300_fragment_program* rp, - GLuint dest, int mask) +static int get_earliest_allowed_write(struct r300_fragment_program *rp, + GLuint dest, int mask) { COMPILE_STATE; int idx; @@ -1069,18 +1039,18 @@ static int get_earliest_allowed_write( GLuint index = REG_GET_INDEX(dest); assert(REG_GET_VALID(dest)); - switch(REG_GET_TYPE(dest)) { - case REG_TYPE_TEMP: - if (cs->temps[index].reg == -1) - return 0; - - idx = cs->temps[index].reg; - break; - case REG_TYPE_OUTPUT: - return 0; - default: - ERROR("invalid dest reg type %d\n", REG_GET_TYPE(dest)); + switch (REG_GET_TYPE(dest)) { + case REG_TYPE_TEMP: + if (cs->temps[index].reg == -1) return 0; + + idx = cs->temps[index].reg; + break; + case REG_TYPE_OUTPUT: + return 0; + default: + ERROR("invalid dest reg type %d\n", REG_GET_TYPE(dest)); + return 0; } pos = cs->hwtemps[idx].reserved; @@ -1096,7 +1066,6 @@ static int get_earliest_allowed_write( return pos; } - /** * Allocates a slot for an ALU instruction that can consist of * a vertex part or a scalar part or both. @@ -1111,13 +1080,10 @@ static int get_earliest_allowed_write( * * @return the index of the slot */ -static int find_and_prepare_slot(struct r300_fragment_program* rp, - GLboolean emit_vop, - GLboolean emit_sop, - int argc, - GLuint* src, - GLuint dest, - int mask) +static int find_and_prepare_slot(struct r300_fragment_program *rp, + GLboolean emit_vop, + GLboolean emit_sop, + int argc, GLuint * src, GLuint dest, int mask) { COMPILE_STATE; int hwsrc[3]; @@ -1128,7 +1094,7 @@ static int find_and_prepare_slot(struct r300_fragment_program* rp, int tempssrc[3]; int pos; int regnr; - int i,j; + int i, j; // Determine instruction slots, whether sources are required on // vector or scalar side, and the smallest slot number where @@ -1143,7 +1109,7 @@ static int find_and_prepare_slot(struct r300_fragment_program* rp, if (rp->node[rp->cur_node].alu_offset > pos) pos = rp->node[rp->cur_node].alu_offset; - for(i = 0; i < argc; ++i) { + for (i = 0; i < argc; ++i) { if (!REG_GET_BUILTIN(src[i])) { if (emit_vop) used |= v_swiz[REG_GET_VSWZ(src[i])].flags << i; @@ -1151,7 +1117,7 @@ static int find_and_prepare_slot(struct r300_fragment_program* rp, used |= s_swiz[REG_GET_SSWZ(src[i])].flags << i; } - hwsrc[i] = t_hw_src(rp, src[i], GL_FALSE); /* Note: sideeffects wrt refcounting! */ + hwsrc[i] = t_hw_src(rp, src[i], GL_FALSE); /* Note: sideeffects wrt refcounting! */ regnr = hwsrc[i] & 31; if (REG_GET_TYPE(src[i]) == REG_TYPE_TEMP) { @@ -1167,7 +1133,7 @@ static int find_and_prepare_slot(struct r300_fragment_program* rp, } // Find a slot that fits - for(; ; ++pos) { + for (;; ++pos) { if (cs->slot[pos].used & used & SLOT_OP_BOTH) continue; @@ -1184,19 +1150,18 @@ static int find_and_prepare_slot(struct r300_fragment_program* rp, cs->nrslots++; } - // Note: When we need both parts (vector and scalar) of a source, // we always try to put them into the same position. This makes the // code easier to read, and it is optimal (i.e. one doesn't gain // anything by splitting the parts). // It also avoids headaches with swizzles that access both parts (i.e WXY) tempused = cs->slot[pos].used; - for(i = 0; i < 3; ++i) { + for (i = 0; i < 3; ++i) { tempvsrc[i] = cs->slot[pos].vsrc[i]; tempssrc[i] = cs->slot[pos].ssrc[i]; } - for(i = 0; i < argc; ++i) { + for (i = 0; i < argc; ++i) { int flags = (used >> i) & SLOT_SRC_BOTH; if (!flags) { @@ -1204,7 +1169,7 @@ static int find_and_prepare_slot(struct r300_fragment_program* rp, continue; } - for(j = 0; j < 3; ++j) { + for (j = 0; j < 3; ++j) { if ((tempused >> j) & flags & SLOT_SRC_VECTOR) { if (tempvsrc[j] != hwsrc[i]) continue; @@ -1235,22 +1200,24 @@ static int find_and_prepare_slot(struct r300_fragment_program* rp, // Found a slot, reserve it cs->slot[pos].used = tempused | (used & SLOT_OP_BOTH); - for(i = 0; i < 3; ++i) { + for (i = 0; i < 3; ++i) { cs->slot[pos].vsrc[i] = tempvsrc[i]; cs->slot[pos].ssrc[i] = tempssrc[i]; } - for(i = 0; i < argc; ++i) { + for (i = 0; i < argc; ++i) { if (REG_GET_TYPE(src[i]) == REG_TYPE_TEMP) { int regnr = hwsrc[i] & 31; if (used & (SLOT_SRC_VECTOR << i)) { if (cs->hwtemps[regnr].vector_lastread < pos) - cs->hwtemps[regnr].vector_lastread = pos; + cs->hwtemps[regnr].vector_lastread = + pos; } if (used & (SLOT_SRC_SCALAR << i)) { if (cs->hwtemps[regnr].scalar_lastread < pos) - cs->hwtemps[regnr].scalar_lastread = pos; + cs->hwtemps[regnr].scalar_lastread = + pos; } } } @@ -1258,65 +1225,78 @@ static int find_and_prepare_slot(struct r300_fragment_program* rp, // Emit the source fetch code rp->alu.inst[pos].inst1 &= ~R300_FPI1_SRC_MASK; rp->alu.inst[pos].inst1 |= - ((cs->slot[pos].vsrc[0] << R300_FPI1_SRC0C_SHIFT) | - (cs->slot[pos].vsrc[1] << R300_FPI1_SRC1C_SHIFT) | - (cs->slot[pos].vsrc[2] << R300_FPI1_SRC2C_SHIFT)); + ((cs->slot[pos].vsrc[0] << R300_FPI1_SRC0C_SHIFT) | + (cs->slot[pos].vsrc[1] << R300_FPI1_SRC1C_SHIFT) | + (cs->slot[pos].vsrc[2] << R300_FPI1_SRC2C_SHIFT)); rp->alu.inst[pos].inst3 &= ~R300_FPI3_SRC_MASK; rp->alu.inst[pos].inst3 |= - ((cs->slot[pos].ssrc[0] << R300_FPI3_SRC0A_SHIFT) | - (cs->slot[pos].ssrc[1] << R300_FPI3_SRC1A_SHIFT) | - (cs->slot[pos].ssrc[2] << R300_FPI3_SRC2A_SHIFT)); + ((cs->slot[pos].ssrc[0] << R300_FPI3_SRC0A_SHIFT) | + (cs->slot[pos].ssrc[1] << R300_FPI3_SRC1A_SHIFT) | + (cs->slot[pos].ssrc[2] << R300_FPI3_SRC2A_SHIFT)); // Emit the argument selection code if (emit_vop) { int swz[3]; - for(i = 0; i < 3; ++i) { + for (i = 0; i < 3; ++i) { if (i < argc) { swz[i] = (v_swiz[REG_GET_VSWZ(src[i])].base + - (srcpos[i] * v_swiz[REG_GET_VSWZ(src[i])].stride)) | - ((src[i] & REG_NEGV_MASK) ? ARG_NEG : 0) | - ((src[i] & REG_ABS_MASK) ? ARG_ABS : 0); + (srcpos[i] * + v_swiz[REG_GET_VSWZ(src[i])]. + stride)) | ((src[i] & REG_NEGV_MASK) + ? ARG_NEG : 0) | ((src[i] + & + REG_ABS_MASK) + ? + ARG_ABS + : 0); } else { swz[i] = R300_FPI0_ARGC_ZERO; } } rp->alu.inst[pos].inst0 &= - ~(R300_FPI0_ARG0C_MASK|R300_FPI0_ARG1C_MASK|R300_FPI0_ARG2C_MASK); + ~(R300_FPI0_ARG0C_MASK | R300_FPI0_ARG1C_MASK | + R300_FPI0_ARG2C_MASK); rp->alu.inst[pos].inst0 |= - (swz[0] << R300_FPI0_ARG0C_SHIFT) | - (swz[1] << R300_FPI0_ARG1C_SHIFT) | - (swz[2] << R300_FPI0_ARG2C_SHIFT); + (swz[0] << R300_FPI0_ARG0C_SHIFT) | (swz[1] << + R300_FPI0_ARG1C_SHIFT) + | (swz[2] << R300_FPI0_ARG2C_SHIFT); } if (emit_sop) { int swz[3]; - for(i = 0; i < 3; ++i) { + for (i = 0; i < 3; ++i) { if (i < argc) { swz[i] = (s_swiz[REG_GET_SSWZ(src[i])].base + - (srcpos[i] * s_swiz[REG_GET_SSWZ(src[i])].stride)) | - ((src[i] & REG_NEGV_MASK) ? ARG_NEG : 0) | - ((src[i] & REG_ABS_MASK) ? ARG_ABS : 0); + (srcpos[i] * + s_swiz[REG_GET_SSWZ(src[i])]. + stride)) | ((src[i] & REG_NEGV_MASK) + ? ARG_NEG : 0) | ((src[i] + & + REG_ABS_MASK) + ? + ARG_ABS + : 0); } else { swz[i] = R300_FPI2_ARGA_ZERO; } } rp->alu.inst[pos].inst2 &= - ~(R300_FPI2_ARG0A_MASK|R300_FPI2_ARG1A_MASK|R300_FPI2_ARG2A_MASK); + ~(R300_FPI2_ARG0A_MASK | R300_FPI2_ARG1A_MASK | + R300_FPI2_ARG2A_MASK); rp->alu.inst[pos].inst2 |= - (swz[0] << R300_FPI2_ARG0A_SHIFT) | - (swz[1] << R300_FPI2_ARG1A_SHIFT) | - (swz[2] << R300_FPI2_ARG2A_SHIFT); + (swz[0] << R300_FPI2_ARG0A_SHIFT) | (swz[1] << + R300_FPI2_ARG1A_SHIFT) + | (swz[2] << R300_FPI2_ARG2A_SHIFT); } return pos; } - /** * Append an ALU instruction to the instruction list. */ @@ -1324,10 +1304,7 @@ static void emit_arith(struct r300_fragment_program *rp, int op, GLuint dest, int mask, - GLuint src0, - GLuint src1, - GLuint src2, - int flags) + GLuint src0, GLuint src1, GLuint src2, int flags) { COMPILE_STATE; GLuint src[3] = { src0, src1, src2 }; @@ -1356,11 +1333,13 @@ static void emit_arith(struct r300_fragment_program *rp, if ((mask & WRITEMASK_W) || vop == R300_FPI0_OUTC_REPL_ALPHA) emit_sop = GL_TRUE; - pos = find_and_prepare_slot(rp, emit_vop, emit_sop, argc, src, dest, mask); + pos = + find_and_prepare_slot(rp, emit_vop, emit_sop, argc, src, dest, + mask); if (pos < 0) return; - hwdest = t_hw_dst(rp, dest, GL_FALSE, pos); /* Note: Side effects wrt register allocation */ + hwdest = t_hw_dst(rp, dest, GL_FALSE, pos); /* Note: Side effects wrt register allocation */ if (flags & PFS_FLAG_SAT) { vop |= R300_FPI0_OUTC_SAT; @@ -1376,13 +1355,16 @@ static void emit_arith(struct r300_fragment_program *rp, if (REG_GET_TYPE(dest) == REG_TYPE_OUTPUT) { if (REG_GET_INDEX(dest) == FRAG_RESULT_COLR) { rp->alu.inst[pos].inst1 |= - (mask & WRITEMASK_XYZ) << R300_FPI1_DSTC_OUTPUT_MASK_SHIFT; - } else assert(0); + (mask & WRITEMASK_XYZ) << + R300_FPI1_DSTC_OUTPUT_MASK_SHIFT; + } else + assert(0); } else { rp->alu.inst[pos].inst1 |= - (mask & WRITEMASK_XYZ) << R300_FPI1_DSTC_REG_MASK_SHIFT; + (mask & WRITEMASK_XYZ) << + R300_FPI1_DSTC_REG_MASK_SHIFT; - cs->hwtemps[hwdest].vector_valid = pos+1; + cs->hwtemps[hwdest].vector_valid = pos + 1; } } @@ -1394,15 +1376,20 @@ static void emit_arith(struct r300_fragment_program *rp, if (REG_GET_TYPE(dest) == REG_TYPE_OUTPUT) { if (REG_GET_INDEX(dest) == FRAG_RESULT_COLR) { rp->alu.inst[pos].inst3 |= - (hwdest << R300_FPI3_DSTA_SHIFT) | R300_FPI3_DSTA_OUTPUT; - } else if (REG_GET_INDEX(dest) == FRAG_RESULT_DEPR) { - rp->alu.inst[pos].inst3 |= R300_FPI3_DSTA_DEPTH; - } else assert(0); + (hwdest << R300_FPI3_DSTA_SHIFT) | + R300_FPI3_DSTA_OUTPUT; + } else if (REG_GET_INDEX(dest) == + FRAG_RESULT_DEPR) { + rp->alu.inst[pos].inst3 |= + R300_FPI3_DSTA_DEPTH; + } else + assert(0); } else { rp->alu.inst[pos].inst3 |= - (hwdest << R300_FPI3_DSTA_SHIFT) | R300_FPI3_DSTA_REG; + (hwdest << R300_FPI3_DSTA_SHIFT) | + R300_FPI3_DSTA_REG; - cs->hwtemps[hwdest].scalar_valid = pos+1; + cs->hwtemps[hwdest].scalar_valid = pos + 1; } } } @@ -1416,7 +1403,7 @@ static GLuint get_attrib(struct r300_fragment_program *rp, GLuint attr) struct gl_fragment_program *mp = &rp->mesa_program; GLuint r = undef; - if (!(mp->Base.InputsRead & (1<Base.InputsRead & (1 << attr))) { ERROR("Attribute %d was not provided!\n", attr); return undef; } @@ -1430,20 +1417,19 @@ static GLuint get_attrib(struct r300_fragment_program *rp, GLuint attr) static GLfloat SinCosConsts[2][4] = { { - 1.273239545, // 4/PI - -0.405284735, // -4/(PI*PI) - 3.141592654, // PI - 0.2225 // weight - }, + 1.273239545, // 4/PI + -0.405284735, // -4/(PI*PI) + 3.141592654, // PI + 0.2225 // weight + }, { - 0.75, - 0.0, - 0.159154943, // 1/(2*PI) - 6.283185307 // 2*PI - } + 0.75, + 0.0, + 0.159154943, // 1/(2*PI) + 6.283185307 // 2*PI + } }; - /** * Emit a LIT instruction. * \p flags may be PFS_FLAG_SAT @@ -1466,13 +1452,11 @@ static GLfloat SinCosConsts[2][4] = { * emit_arith is a bit too conservative because it doesn't understand * partial writes to the vector component. */ -static const GLfloat LitConst[4] = { 127.999999, 127.999999, 127.999999, -127.999999 }; +static const GLfloat LitConst[4] = + { 127.999999, 127.999999, 127.999999, -127.999999 }; static void emit_lit(struct r300_fragment_program *rp, - GLuint dest, - int mask, - GLuint src, - int flags) + GLuint dest, int mask, GLuint src, int flags) { COMPILE_STATE; GLuint cnst; @@ -1503,39 +1487,38 @@ static void emit_lit(struct r300_fragment_program *rp, // First slot emit_arith(rp, PFS_OP_MAX, temp, WRITEMASK_XY, - keep(src), pfs_zero, undef, 0); - emit_arith(rp, PFS_OP_MAX, temp, WRITEMASK_W, - src, cnst, undef, 0); + keep(src), pfs_zero, undef, 0); + emit_arith(rp, PFS_OP_MAX, temp, WRITEMASK_W, src, cnst, undef, 0); // Second slot emit_arith(rp, PFS_OP_MIN, temp, WRITEMASK_Z, - swizzle(temp, W, W, W, W), cnst, undef, 0); + swizzle(temp, W, W, W, W), cnst, undef, 0); emit_arith(rp, PFS_OP_LG2, temp, WRITEMASK_W, - swizzle(temp, Y, Y, Y, Y), undef, undef, 0); + swizzle(temp, Y, Y, Y, Y), undef, undef, 0); // Third slot // If desired, we saturate the y result here. // This does not affect the use as a condition variable in the CMP later emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_W, - temp, swizzle(temp, Z, Z, Z, Z), pfs_zero, 0); + temp, swizzle(temp, Z, Z, Z, Z), pfs_zero, 0); emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_Y, - swizzle(temp, X, X, X, X), pfs_one, pfs_zero, flags); + swizzle(temp, X, X, X, X), pfs_one, pfs_zero, flags); // Fourth slot emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_X, - pfs_one, pfs_one, pfs_zero, 0); - emit_arith(rp, PFS_OP_EX2, temp, WRITEMASK_W, - temp, undef, undef, 0); + pfs_one, pfs_one, pfs_zero, 0); + emit_arith(rp, PFS_OP_EX2, temp, WRITEMASK_W, temp, undef, undef, 0); // Fifth slot emit_arith(rp, PFS_OP_CMP, temp, WRITEMASK_Z, - pfs_zero, swizzle(temp, W, W, W, W), negate(swizzle(temp, Y, Y, Y, Y)), flags); - emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_W, - pfs_one, pfs_one, pfs_zero, 0); + pfs_zero, swizzle(temp, W, W, W, W), + negate(swizzle(temp, Y, Y, Y, Y)), flags); + emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_W, pfs_one, pfs_one, + pfs_zero, 0); if (needTemporary) { emit_arith(rp, PFS_OP_MAD, dest, mask, - temp, pfs_one, pfs_zero, flags); + temp, pfs_one, pfs_zero, flags); free_temp(rp, temp); } else { // Decrease refcount of the destination @@ -1543,7 +1526,6 @@ static void emit_lit(struct r300_fragment_program *rp, } } - static GLboolean parse_program(struct r300_fragment_program *rp) { struct gl_fragment_program *mp = &rp->mesa_program; @@ -1558,7 +1540,7 @@ static GLboolean parse_program(struct r300_fragment_program *rp) return GL_FALSE; } - for (fpi=mp->Base.Instructions; fpi->Opcode != OPCODE_END; fpi++) { + for (fpi = mp->Base.Instructions; fpi->Opcode != OPCODE_END; fpi++) { if (fpi->SaturateMode == SATURATE_ZERO_ONE) flags = PFS_FLAG_SAT; else @@ -1573,15 +1555,13 @@ static GLboolean parse_program(struct r300_fragment_program *rp) case OPCODE_ABS: src[0] = t_src(rp, fpi->SrcReg[0]); emit_arith(rp, PFS_OP_MAD, dest, mask, - absolute(src[0]), pfs_one, pfs_zero, - flags); + absolute(src[0]), pfs_one, pfs_zero, flags); break; case OPCODE_ADD: src[0] = t_src(rp, fpi->SrcReg[0]); src[1] = t_src(rp, fpi->SrcReg[1]); emit_arith(rp, PFS_OP_MAD, dest, mask, - src[0], pfs_one, src[1], - flags); + src[0], pfs_one, src[1], flags); break; case OPCODE_CMP: src[0] = t_src(rp, fpi->SrcReg[0]); @@ -1591,8 +1571,7 @@ static GLboolean parse_program(struct r300_fragment_program *rp) * r300 - if src2.c < 0.0 ? src1.c : src0.c */ emit_arith(rp, PFS_OP_CMP, dest, mask, - src[2], src[1], src[0], - flags); + src[2], src[1], src[0], flags); break; case OPCODE_COS: /* @@ -1613,47 +1592,38 @@ static GLboolean parse_program(struct r300_fragment_program *rp) emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_X, swizzle(src[0], X, X, X, X), swizzle(const_sin[1], Z, Z, Z, Z), - swizzle(const_sin[1], X, X, X, X), - 0); + swizzle(const_sin[1], X, X, X, X), 0); emit_arith(rp, PFS_OP_FRC, temp[0], WRITEMASK_X, swizzle(temp[0], X, X, X, X), - undef, - undef, - 0); + undef, undef, 0); - emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_Z, - swizzle(temp[0], X, X, X, X), - swizzle(const_sin[1], W, W, W, W), //2*PI - negate(swizzle(const_sin[0], Z, Z, Z, Z)), //-PI + emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_Z, swizzle(temp[0], X, X, X, X), swizzle(const_sin[1], W, W, W, W), //2*PI + negate(swizzle(const_sin[0], Z, Z, Z, Z)), //-PI 0); /* SIN */ - emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_X | WRITEMASK_Y, - swizzle(temp[0], Z, Z, Z, Z), - const_sin[0], - pfs_zero, - 0); + emit_arith(rp, PFS_OP_MAD, temp[0], + WRITEMASK_X | WRITEMASK_Y, swizzle(temp[0], + Z, Z, Z, + Z), + const_sin[0], pfs_zero, 0); emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_X, swizzle(temp[0], Y, Y, Y, Y), absolute(swizzle(temp[0], Z, Z, Z, Z)), - swizzle(temp[0], X, X, X, X), - 0); + swizzle(temp[0], X, X, X, X), 0); emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_Y, swizzle(temp[0], X, X, X, X), absolute(swizzle(temp[0], X, X, X, X)), - negate(swizzle(temp[0], X, X, X, X)), - 0); - + negate(swizzle(temp[0], X, X, X, X)), 0); - emit_arith(rp, PFS_OP_MAD, dest, mask, + emit_arith(rp, PFS_OP_MAD, dest, mask, swizzle(temp[0], Y, Y, Y, Y), swizzle(const_sin[0], W, W, W, W), - swizzle(temp[0], X, X, X, X), - flags); + swizzle(temp[0], X, X, X, X), flags); free_temp(rp, temp[0]); break; @@ -1661,15 +1631,13 @@ static GLboolean parse_program(struct r300_fragment_program *rp) src[0] = t_src(rp, fpi->SrcReg[0]); src[1] = t_src(rp, fpi->SrcReg[1]); emit_arith(rp, PFS_OP_DP3, dest, mask, - src[0], src[1], undef, - flags); + src[0], src[1], undef, flags); break; case OPCODE_DP4: src[0] = t_src(rp, fpi->SrcReg[0]); src[1] = t_src(rp, fpi->SrcReg[1]); emit_arith(rp, PFS_OP_DP4, dest, mask, - src[0], src[1], undef, - flags); + src[0], src[1], undef, flags); break; case OPCODE_DPH: src[0] = t_src(rp, fpi->SrcReg[0]); @@ -1681,11 +1649,9 @@ static GLboolean parse_program(struct r300_fragment_program *rp) temp[0] = get_temp_reg(rp); src[0].s_swz = SWIZZLE_ONE; emit_arith(rp, PFS_OP_MAD, temp[0], mask, - src[0], pfs_one, pfs_zero, - 0); + src[0], pfs_one, pfs_zero, 0); emit_arith(rp, PFS_OP_DP4, dest, mask, - temp[0], src[1], undef, - flags); + temp[0], src[1], undef, flags); free_temp(rp, temp[0]); #else emit_arith(rp, PFS_OP_DP4, dest, mask, @@ -1708,18 +1674,16 @@ static GLboolean parse_program(struct r300_fragment_program *rp) /* result.x = 1.0 * result.w = src1.w */ if (mask & WRITEMASK_XW) { - REG_SET_VSWZ(src[1], SWIZZLE_111); /*Cheat*/ + REG_SET_VSWZ(src[1], SWIZZLE_111); /*Cheat */ emit_arith(rp, PFS_OP_MAD, dest, mask & WRITEMASK_XW, - src[1], pfs_one, pfs_zero, - flags); + src[1], pfs_one, pfs_zero, flags); } break; case OPCODE_EX2: src[0] = t_scalar_src(rp, fpi->SrcReg[0]); emit_arith(rp, PFS_OP_EX2, dest, mask, - src[0], undef, undef, - flags); + src[0], undef, undef, flags); break; case OPCODE_FLR: src[0] = t_src(rp, fpi->SrcReg[0]); @@ -1728,18 +1692,15 @@ static GLboolean parse_program(struct r300_fragment_program *rp) * MAD dest, src0, 1.0, -temp */ emit_arith(rp, PFS_OP_FRC, temp[0], mask, - keep(src[0]), undef, undef, - 0); + keep(src[0]), undef, undef, 0); emit_arith(rp, PFS_OP_MAD, dest, mask, - src[0], pfs_one, negate(temp[0]), - flags); + src[0], pfs_one, negate(temp[0]), flags); free_temp(rp, temp[0]); break; case OPCODE_FRC: src[0] = t_src(rp, fpi->SrcReg[0]); emit_arith(rp, PFS_OP_FRC, dest, mask, - src[0], undef, undef, - flags); + src[0], undef, undef, flags); break; case OPCODE_KIL: emit_tex(rp, fpi, R300_FPITX_OP_KIL); @@ -1747,8 +1708,7 @@ static GLboolean parse_program(struct r300_fragment_program *rp) case OPCODE_LG2: src[0] = t_scalar_src(rp, fpi->SrcReg[0]); emit_arith(rp, PFS_OP_LG2, dest, mask, - src[0], undef, undef, - flags); + src[0], undef, undef, flags); break; case OPCODE_LIT: src[0] = t_src(rp, fpi->SrcReg[0]); @@ -1768,8 +1728,7 @@ static GLboolean parse_program(struct r300_fragment_program *rp) negate(keep(src[0])), keep(src[2]), src[2], 0); emit_arith(rp, PFS_OP_MAD, dest, mask, - src[0], src[1], temp[0], - flags); + src[0], src[1], temp[0], flags); free_temp(rp, temp[0]); break; case OPCODE_MAD: @@ -1777,63 +1736,53 @@ static GLboolean parse_program(struct r300_fragment_program *rp) src[1] = t_src(rp, fpi->SrcReg[1]); src[2] = t_src(rp, fpi->SrcReg[2]); emit_arith(rp, PFS_OP_MAD, dest, mask, - src[0], src[1], src[2], - flags); + src[0], src[1], src[2], flags); break; case OPCODE_MAX: src[0] = t_src(rp, fpi->SrcReg[0]); src[1] = t_src(rp, fpi->SrcReg[1]); emit_arith(rp, PFS_OP_MAX, dest, mask, - src[0], src[1], undef, - flags); + src[0], src[1], undef, flags); break; case OPCODE_MIN: src[0] = t_src(rp, fpi->SrcReg[0]); src[1] = t_src(rp, fpi->SrcReg[1]); emit_arith(rp, PFS_OP_MIN, dest, mask, - src[0], src[1], undef, - flags); + src[0], src[1], undef, flags); break; case OPCODE_MOV: case OPCODE_SWZ: src[0] = t_src(rp, fpi->SrcReg[0]); emit_arith(rp, PFS_OP_MAD, dest, mask, - src[0], pfs_one, pfs_zero, - flags); + src[0], pfs_one, pfs_zero, flags); break; case OPCODE_MUL: src[0] = t_src(rp, fpi->SrcReg[0]); src[1] = t_src(rp, fpi->SrcReg[1]); emit_arith(rp, PFS_OP_MAD, dest, mask, - src[0], src[1], pfs_zero, - flags); + src[0], src[1], pfs_zero, flags); break; case OPCODE_POW: src[0] = t_scalar_src(rp, fpi->SrcReg[0]); src[1] = t_scalar_src(rp, fpi->SrcReg[1]); temp[0] = get_temp_reg(rp); emit_arith(rp, PFS_OP_LG2, temp[0], WRITEMASK_W, - src[0], undef, undef, - 0); + src[0], undef, undef, 0); emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_W, - temp[0], src[1], pfs_zero, - 0); + temp[0], src[1], pfs_zero, 0); emit_arith(rp, PFS_OP_EX2, dest, fpi->DstReg.WriteMask, - temp[0], undef, undef, - 0); + temp[0], undef, undef, 0); free_temp(rp, temp[0]); break; case OPCODE_RCP: src[0] = t_scalar_src(rp, fpi->SrcReg[0]); emit_arith(rp, PFS_OP_RCP, dest, mask, - src[0], undef, undef, - flags); + src[0], undef, undef, flags); break; case OPCODE_RSQ: src[0] = t_scalar_src(rp, fpi->SrcReg[0]); emit_arith(rp, PFS_OP_RSQ, dest, mask, - absolute(src[0]), pfs_zero, pfs_zero, - flags); + absolute(src[0]), pfs_zero, pfs_zero, flags); break; case OPCODE_SCS: /* @@ -1850,61 +1799,55 @@ static GLboolean parse_program(struct r300_fragment_program *rp) src[0] = t_scalar_src(rp, fpi->SrcReg[0]); /* x = -abs(x)+0.5*PI */ - emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_Z, - swizzle(const_sin[0], Z, Z, Z, Z), //PI + emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_Z, swizzle(const_sin[0], Z, Z, Z, Z), //PI pfs_half, - negate(abs(swizzle(keep(src[0]), X, X, X, X))), + negate(abs + (swizzle(keep(src[0]), X, X, X, X))), 0); /* C*x (sin) */ emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_W, swizzle(const_sin[0], Y, Y, Y, Y), swizzle(keep(src[0]), X, X, X, X), - pfs_zero, - 0); + pfs_zero, 0); /* B*x, C*x (cos) */ - emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_X | WRITEMASK_Y, - swizzle(temp[0], Z, Z, Z, Z), - const_sin[0], - pfs_zero, - 0); + emit_arith(rp, PFS_OP_MAD, temp[0], + WRITEMASK_X | WRITEMASK_Y, swizzle(temp[0], + Z, Z, Z, + Z), + const_sin[0], pfs_zero, 0); /* B*x (sin) */ emit_arith(rp, PFS_OP_MAD, temp[1], WRITEMASK_W, swizzle(const_sin[0], X, X, X, X), - keep(src[0]), - pfs_zero, - 0); + keep(src[0]), pfs_zero, 0); - /* y = B*x + C*x*abs(x) (sin)*/ - emit_arith(rp, PFS_OP_MAD, temp[1], WRITEMASK_Z, + /* y = B*x + C*x*abs(x) (sin) */ + emit_arith(rp, PFS_OP_MAD, temp[1], WRITEMASK_Z, absolute(src[0]), swizzle(temp[0], W, W, W, W), - swizzle(temp[1], W, W, W, W), - 0); + swizzle(temp[1], W, W, W, W), 0); - /* y = B*x + C*x*abs(x) (cos)*/ + /* y = B*x + C*x*abs(x) (cos) */ emit_arith(rp, PFS_OP_MAD, temp[1], WRITEMASK_W, swizzle(temp[0], Y, Y, Y, Y), absolute(swizzle(temp[0], Z, Z, Z, Z)), - swizzle(temp[0], X, X, X, X), - 0); + swizzle(temp[0], X, X, X, X), 0); /* y*abs(y) - y (cos), y*abs(y) - y (sin) */ - emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_X | WRITEMASK_Y, - swizzle(temp[1], W, Z, Y, X), + emit_arith(rp, PFS_OP_MAD, temp[0], + WRITEMASK_X | WRITEMASK_Y, swizzle(temp[1], + W, Z, Y, + X), absolute(swizzle(temp[1], W, Z, Y, X)), - negate(swizzle(temp[1], W, Z, Y, X)), - - 0); + negate(swizzle(temp[1], W, Z, Y, X)), 0); /* dest.xy = mad(temp.xy, P, temp2.wz) */ - emit_arith(rp, PFS_OP_MAD, dest, mask & (WRITEMASK_X | WRITEMASK_Y), - temp[0], + emit_arith(rp, PFS_OP_MAD, dest, + mask & (WRITEMASK_X | WRITEMASK_Y), temp[0], swizzle(const_sin[0], W, W, W, W), - swizzle(temp[1], W, Z, Y, X), - flags); + swizzle(temp[1], W, Z, Y, X), flags); free_temp(rp, temp[0]); free_temp(rp, temp[1]); @@ -1917,11 +1860,9 @@ static GLboolean parse_program(struct r300_fragment_program *rp) * dest.c = (temp.c < 0.0) ? 0 : 1 */ emit_arith(rp, PFS_OP_MAD, temp[0], mask, - src[0], pfs_one, negate(src[1]), - 0); + src[0], pfs_one, negate(src[1]), 0); emit_arith(rp, PFS_OP_CMP, dest, mask, - pfs_one, pfs_zero, temp[0], - 0); + pfs_one, pfs_zero, temp[0], 0); free_temp(rp, temp[0]); break; case OPCODE_SIN: @@ -1937,53 +1878,43 @@ static GLboolean parse_program(struct r300_fragment_program *rp) const_sin[1] = emit_const4fv(rp, SinCosConsts[1]); src[0] = t_scalar_src(rp, fpi->SrcReg[0]); - /* do range reduction */ emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_X, swizzle(keep(src[0]), X, X, X, X), swizzle(const_sin[1], Z, Z, Z, Z), - pfs_half, - 0); + pfs_half, 0); emit_arith(rp, PFS_OP_FRC, temp[0], WRITEMASK_X, swizzle(temp[0], X, X, X, X), - undef, - undef, - 0); + undef, undef, 0); - emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_Z, - swizzle(temp[0], X, X, X, X), - swizzle(const_sin[1], W, W, W, W), //2*PI - negate(swizzle(const_sin[0], Z, Z, Z, Z)), //PI + emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_Z, swizzle(temp[0], X, X, X, X), swizzle(const_sin[1], W, W, W, W), //2*PI + negate(swizzle(const_sin[0], Z, Z, Z, Z)), //PI 0); /* SIN */ - emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_X | WRITEMASK_Y, - swizzle(temp[0], Z, Z, Z, Z), - const_sin[0], - pfs_zero, - 0); + emit_arith(rp, PFS_OP_MAD, temp[0], + WRITEMASK_X | WRITEMASK_Y, swizzle(temp[0], + Z, Z, Z, + Z), + const_sin[0], pfs_zero, 0); emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_X, swizzle(temp[0], Y, Y, Y, Y), absolute(swizzle(temp[0], Z, Z, Z, Z)), - swizzle(temp[0], X, X, X, X), - 0); + swizzle(temp[0], X, X, X, X), 0); emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_Y, swizzle(temp[0], X, X, X, X), absolute(swizzle(temp[0], X, X, X, X)), - negate(swizzle(temp[0], X, X, X, X)), - 0); - + negate(swizzle(temp[0], X, X, X, X)), 0); - emit_arith(rp, PFS_OP_MAD, dest, mask, + emit_arith(rp, PFS_OP_MAD, dest, mask, swizzle(temp[0], Y, Y, Y, Y), swizzle(const_sin[0], W, W, W, W), - swizzle(temp[0], X, X, X, X), - flags); + swizzle(temp[0], X, X, X, X), flags); free_temp(rp, temp[0]); break; @@ -1995,19 +1926,16 @@ static GLboolean parse_program(struct r300_fragment_program *rp) * dest.c = (temp.c < 0.0) ? 1 : 0 */ emit_arith(rp, PFS_OP_MAD, temp[0], mask, - src[0], pfs_one, negate(src[1]), - 0); + src[0], pfs_one, negate(src[1]), 0); emit_arith(rp, PFS_OP_CMP, dest, mask, - pfs_zero, pfs_one, temp[0], - 0); + pfs_zero, pfs_one, temp[0], 0); free_temp(rp, temp[0]); break; case OPCODE_SUB: src[0] = t_src(rp, fpi->SrcReg[0]); src[1] = t_src(rp, fpi->SrcReg[1]); emit_arith(rp, PFS_OP_MAD, dest, mask, - src[0], pfs_one, negate(src[1]), - flags); + src[0], pfs_one, negate(src[1]), flags); break; case OPCODE_TEX: emit_tex(rp, fpi, R300_FPITX_OP_TEX); @@ -2018,28 +1946,29 @@ static GLboolean parse_program(struct r300_fragment_program *rp) case OPCODE_TXP: emit_tex(rp, fpi, R300_FPITX_OP_TXP); break; - case OPCODE_XPD: { - src[0] = t_src(rp, fpi->SrcReg[0]); - src[1] = t_src(rp, fpi->SrcReg[1]); - temp[0] = get_temp_reg(rp); - /* temp = src0.zxy * src1.yzx */ - emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_XYZ, - swizzle(keep(src[0]), Z, X, Y, W), - swizzle(keep(src[1]), Y, Z, X, W), - pfs_zero, - 0); - /* dest.xyz = src0.yzx * src1.zxy - temp - * dest.w = undefined - * */ - emit_arith(rp, PFS_OP_MAD, dest, mask & WRITEMASK_XYZ, - swizzle(src[0], Y, Z, X, W), - swizzle(src[1], Z, X, Y, W), - negate(temp[0]), - flags); - /* cleanup */ - free_temp(rp, temp[0]); - break; - } + case OPCODE_XPD:{ + src[0] = t_src(rp, fpi->SrcReg[0]); + src[1] = t_src(rp, fpi->SrcReg[1]); + temp[0] = get_temp_reg(rp); + /* temp = src0.zxy * src1.yzx */ + emit_arith(rp, PFS_OP_MAD, temp[0], + WRITEMASK_XYZ, swizzle(keep(src[0]), + Z, X, Y, W), + swizzle(keep(src[1]), Y, Z, X, W), + pfs_zero, 0); + /* dest.xyz = src0.yzx * src1.zxy - temp + * dest.w = undefined + * */ + emit_arith(rp, PFS_OP_MAD, dest, + mask & WRITEMASK_XYZ, swizzle(src[0], + Y, Z, + X, W), + swizzle(src[1], Z, X, Y, W), + negate(temp[0]), flags); + /* cleanup */ + free_temp(rp, temp[0]); + break; + } default: ERROR("unknown fpi->Opcode %d\n", fpi->Opcode); break; @@ -2065,8 +1994,8 @@ static void insert_wpos(struct gl_program *prog) /* should do something else if no temps left... */ prog->NumTemporaries++; - fpi = _mesa_alloc_instructions (prog->NumInstructions + 3); - _mesa_init_instructions (fpi, prog->NumInstructions + 3); + fpi = _mesa_alloc_instructions(prog->NumInstructions + 3); + _mesa_init_instructions(fpi, prog->NumInstructions + 3); /* perspective divide */ fpi[i].Opcode = OPCODE_RCP; @@ -2109,35 +2038,39 @@ static void insert_wpos(struct gl_program *prog) fpi[i].SrcReg[0].File = PROGRAM_TEMPORARY; fpi[i].SrcReg[0].Index = tempregi; - fpi[i].SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ZERO); + fpi[i].SrcReg[0].Swizzle = + MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ZERO); fpi[i].SrcReg[1].File = PROGRAM_STATE_VAR; fpi[i].SrcReg[1].Index = window_index; - fpi[i].SrcReg[1].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ZERO); + fpi[i].SrcReg[1].Swizzle = + MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ZERO); fpi[i].SrcReg[2].File = PROGRAM_STATE_VAR; fpi[i].SrcReg[2].Index = window_index; - fpi[i].SrcReg[2].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ZERO); + fpi[i].SrcReg[2].Swizzle = + MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ZERO); i++; - _mesa_copy_instructions (&fpi[i], prog->Instructions, prog->NumInstructions); + _mesa_copy_instructions(&fpi[i], prog->Instructions, + prog->NumInstructions); free(prog->Instructions); prog->Instructions = fpi; prog->NumInstructions += i; - fpi = &prog->Instructions[prog->NumInstructions-1]; + fpi = &prog->Instructions[prog->NumInstructions - 1]; assert(fpi->Opcode == OPCODE_END); - for(fpi = &prog->Instructions[3]; fpi->Opcode != OPCODE_END; fpi++){ - for(i=0; i<3; i++) - if( fpi->SrcReg[i].File == PROGRAM_INPUT && - fpi->SrcReg[i].Index == FRAG_ATTRIB_WPOS ){ - fpi->SrcReg[i].File = PROGRAM_TEMPORARY; - fpi->SrcReg[i].Index = tempregi; - } + for (fpi = &prog->Instructions[3]; fpi->Opcode != OPCODE_END; fpi++) { + for (i = 0; i < 3; i++) + if (fpi->SrcReg[i].File == PROGRAM_INPUT && + fpi->SrcReg[i].Index == FRAG_ATTRIB_WPOS) { + fpi->SrcReg[i].File = PROGRAM_TEMPORARY; + fpi->SrcReg[i].Index = tempregi; + } } } @@ -2150,25 +2083,26 @@ static void init_program(r300ContextPtr r300, struct r300_fragment_program *rp) struct gl_fragment_program *mp = &rp->mesa_program; struct prog_instruction *fpi; GLuint InputsRead = mp->Base.InputsRead; - GLuint temps_used = 0; /* for rp->temps[] */ - int i,j; + GLuint temps_used = 0; /* for rp->temps[] */ + int i, j; /* New compile, reset tracking data */ - rp->optimization = driQueryOptioni(&r300->radeon.optionCache, "fp_optimization"); + rp->optimization = + driQueryOptioni(&r300->radeon.optionCache, "fp_optimization"); rp->translated = GL_FALSE; - rp->error = GL_FALSE; - rp->cs = cs = &(R300_CONTEXT(rp->ctx)->state.pfs_compile); + rp->error = GL_FALSE; + rp->cs = cs = &(R300_CONTEXT(rp->ctx)->state.pfs_compile); rp->tex.length = 0; - rp->cur_node = 0; + rp->cur_node = 0; rp->first_node_has_tex = 0; - rp->const_nr = 0; + rp->const_nr = 0; rp->max_temp_idx = 0; rp->node[0].alu_end = -1; rp->node[0].tex_end = -1; _mesa_memset(cs, 0, sizeof(*rp->cs)); - for (i=0;islot[i].vsrc[j] = SRC_CONST; cs->slot[i].ssrc[j] = SRC_CONST; } @@ -2183,10 +2117,11 @@ static void init_program(r300ContextPtr r300, struct r300_fragment_program *rp) */ /* Texcoords come first */ - for (i=0;ictx->Const.MaxTextureUnits;i++) { + for (i = 0; i < rp->ctx->Const.MaxTextureUnits; i++) { if (InputsRead & (FRAG_BIT_TEX0 << i)) { - cs->inputs[FRAG_ATTRIB_TEX0+i].refcount = 0; - cs->inputs[FRAG_ATTRIB_TEX0+i].reg = get_hw_temp(rp, 0); + cs->inputs[FRAG_ATTRIB_TEX0 + i].refcount = 0; + cs->inputs[FRAG_ATTRIB_TEX0 + i].reg = + get_hw_temp(rp, 0); } } InputsRead &= ~FRAG_BITS_TEX_ANY; @@ -2215,11 +2150,11 @@ static void init_program(r300ContextPtr r300, struct r300_fragment_program *rp) /* Anything else */ if (InputsRead) { - WARN_ONCE("Don't know how to handle inputs 0x%x\n", - InputsRead); + WARN_ONCE("Don't know how to handle inputs 0x%x\n", InputsRead); /* force read from hwreg 0 for now */ - for (i=0;i<32;i++) - if (InputsRead & (1<inputs[i].reg = 0; + for (i = 0; i < 32; i++) + if (InputsRead & (1 << i)) + cs->inputs[i].reg = 0; } /* Pre-parse the mesa program, grabbing refcounts on input/temp regs. @@ -2230,14 +2165,14 @@ static void init_program(r300ContextPtr r300, struct r300_fragment_program *rp) return; } - for (fpi=mp->Base.Instructions;fpi->Opcode != OPCODE_END; fpi++) { + for (fpi = mp->Base.Instructions; fpi->Opcode != OPCODE_END; fpi++) { int idx; - for (i=0;i<3;i++) { + for (i = 0; i < 3; i++) { idx = fpi->SrcReg[i].Index; switch (fpi->SrcReg[i].File) { case PROGRAM_TEMPORARY: - if (!(temps_used & (1<temps[idx].reg = -1; cs->temps[idx].refcount = 1; temps_used |= (1 << idx); @@ -2247,13 +2182,14 @@ static void init_program(r300ContextPtr r300, struct r300_fragment_program *rp) case PROGRAM_INPUT: cs->inputs[idx].refcount++; break; - default: break; + default: + break; } } idx = fpi->DstReg.Index; if (fpi->DstReg.File == PROGRAM_TEMPORARY) { - if (!(temps_used & (1<temps[idx].reg = -1; cs->temps[idx].refcount = 1; temps_used |= (1 << idx); @@ -2273,7 +2209,8 @@ static void update_params(struct r300_fragment_program *rp) _mesa_load_state_parameters(rp->ctx, mp->Base.Parameters); } -void r300_translate_fragment_shader(r300ContextPtr r300, struct r300_fragment_program *rp) +void r300_translate_fragment_shader(r300ContextPtr r300, + struct r300_fragment_program *rp) { struct r300_pfs_compile_state *cs = NULL; @@ -2289,18 +2226,19 @@ void r300_translate_fragment_shader(r300ContextPtr r300, struct r300_fragment_pr /* Finish off */ rp->node[rp->cur_node].alu_end = - cs->nrslots - rp->node[rp->cur_node].alu_offset - 1; + cs->nrslots - rp->node[rp->cur_node].alu_offset - 1; if (rp->node[rp->cur_node].tex_end < 0) rp->node[rp->cur_node].tex_end = 0; rp->alu_offset = 0; - rp->alu_end = cs->nrslots - 1; + rp->alu_end = cs->nrslots - 1; rp->tex_offset = 0; - rp->tex_end = rp->tex.length ? rp->tex.length - 1 : 0; + rp->tex_end = rp->tex.length ? rp->tex.length - 1 : 0; assert(rp->node[rp->cur_node].alu_end >= 0); assert(rp->alu_end >= 0); rp->translated = GL_TRUE; - if (RADEON_DEBUG & DEBUG_PIXEL) dump_program(rp); + if (RADEON_DEBUG & DEBUG_PIXEL) + dump_program(rp); r300UpdateStateParameters(rp->ctx, _NEW_PROGRAM); } @@ -2317,26 +2255,29 @@ static void dump_program(struct r300_fragment_program *rp) fprintf(stderr, "Mesa program:\n"); fprintf(stderr, "-------------\n"); - _mesa_print_program(&rp->mesa_program.Base); + _mesa_print_program(&rp->mesa_program.Base); fflush(stdout); fprintf(stderr, "Hardware program\n"); fprintf(stderr, "----------------\n"); - for (n = 0; n < (rp->cur_node+1); n++) { - fprintf(stderr, "NODE %d: alu_offset: %d, tex_offset: %d, "\ + for (n = 0; n < (rp->cur_node + 1); n++) { + fprintf(stderr, "NODE %d: alu_offset: %d, tex_offset: %d, " "alu_end: %d, tex_end: %d\n", n, rp->node[n].alu_offset, rp->node[n].tex_offset, - rp->node[n].alu_end, - rp->node[n].tex_end); + rp->node[n].alu_end, rp->node[n].tex_end); if (rp->tex.length) { fprintf(stderr, " TEX:\n"); - for(i = rp->node[n].tex_offset; i <= rp->node[n].tex_offset+rp->node[n].tex_end; ++i) { - const char* instr; - - switch((rp->tex.inst[i] >> R300_FPITX_OPCODE_SHIFT) & 15) { + for (i = rp->node[n].tex_offset; + i <= rp->node[n].tex_offset + rp->node[n].tex_end; + ++i) { + const char *instr; + + switch ((rp->tex. + inst[i] >> R300_FPITX_OPCODE_SHIFT) & + 15) { case R300_FPITX_OP_TEX: instr = "TEX"; break; @@ -2353,94 +2294,121 @@ static void dump_program(struct r300_fragment_program *rp) instr = "UNKNOWN"; } - fprintf(stderr, " %s t%i, %c%i, texture[%i] (%08x)\n", - instr, - (rp->tex.inst[i] >> R300_FPITX_DST_SHIFT) & 31, - (rp->tex.inst[i] & R300_FPITX_SRC_CONST) ? 'c': 't', - (rp->tex.inst[i] >> R300_FPITX_SRC_SHIFT) & 31, - (rp->tex.inst[i] & R300_FPITX_IMAGE_MASK) >> R300_FPITX_IMAGE_SHIFT, - rp->tex.inst[i]); + fprintf(stderr, + " %s t%i, %c%i, texture[%i] (%08x)\n", + instr, + (rp->tex. + inst[i] >> R300_FPITX_DST_SHIFT) & 31, + (rp->tex. + inst[i] & R300_FPITX_SRC_CONST) ? 'c' : + 't', + (rp->tex. + inst[i] >> R300_FPITX_SRC_SHIFT) & 31, + (rp->tex. + inst[i] & R300_FPITX_IMAGE_MASK) >> + R300_FPITX_IMAGE_SHIFT, + rp->tex.inst[i]); } } - for(i = rp->node[n].alu_offset; i <= rp->node[n].alu_offset+rp->node[n].alu_end; ++i) { + for (i = rp->node[n].alu_offset; + i <= rp->node[n].alu_offset + rp->node[n].alu_end; ++i) { char srcc[3][10], dstc[20]; char srca[3][10], dsta[20]; char argc[3][20]; char arga[3][20]; char flags[5], tmp[10]; - for(j = 0; j < 3; ++j) { - int regc = rp->alu.inst[i].inst1 >> (j*6); - int rega = rp->alu.inst[i].inst3 >> (j*6); + for (j = 0; j < 3; ++j) { + int regc = rp->alu.inst[i].inst1 >> (j * 6); + int rega = rp->alu.inst[i].inst3 >> (j * 6); - sprintf(srcc[j], "%c%i", (regc & 32) ? 'c' : 't', regc & 31); - sprintf(srca[j], "%c%i", (rega & 32) ? 'c' : 't', rega & 31); + sprintf(srcc[j], "%c%i", + (regc & 32) ? 'c' : 't', regc & 31); + sprintf(srca[j], "%c%i", + (rega & 32) ? 'c' : 't', rega & 31); } dstc[0] = 0; sprintf(flags, "%s%s%s", - (rp->alu.inst[i].inst1 & R300_FPI1_DSTC_REG_X) ? "x" : "", - (rp->alu.inst[i].inst1 & R300_FPI1_DSTC_REG_Y) ? "y" : "", - (rp->alu.inst[i].inst1 & R300_FPI1_DSTC_REG_Z) ? "z" : ""); + (rp->alu.inst[i]. + inst1 & R300_FPI1_DSTC_REG_X) ? "x" : "", + (rp->alu.inst[i]. + inst1 & R300_FPI1_DSTC_REG_Y) ? "y" : "", + (rp->alu.inst[i]. + inst1 & R300_FPI1_DSTC_REG_Z) ? "z" : ""); if (flags[0] != 0) { sprintf(dstc, "t%i.%s ", - (rp->alu.inst[i].inst1 >> R300_FPI1_DSTC_SHIFT) & 31, - flags); + (rp->alu.inst[i]. + inst1 >> R300_FPI1_DSTC_SHIFT) & 31, + flags); } sprintf(flags, "%s%s%s", - (rp->alu.inst[i].inst1 & R300_FPI1_DSTC_OUTPUT_X) ? "x" : "", - (rp->alu.inst[i].inst1 & R300_FPI1_DSTC_OUTPUT_Y) ? "y" : "", - (rp->alu.inst[i].inst1 & R300_FPI1_DSTC_OUTPUT_Z) ? "z" : ""); + (rp->alu.inst[i]. + inst1 & R300_FPI1_DSTC_OUTPUT_X) ? "x" : "", + (rp->alu.inst[i]. + inst1 & R300_FPI1_DSTC_OUTPUT_Y) ? "y" : "", + (rp->alu.inst[i]. + inst1 & R300_FPI1_DSTC_OUTPUT_Z) ? "z" : ""); if (flags[0] != 0) { sprintf(tmp, "o%i.%s", - (rp->alu.inst[i].inst1 >> R300_FPI1_DSTC_SHIFT) & 31, - flags); + (rp->alu.inst[i]. + inst1 >> R300_FPI1_DSTC_SHIFT) & 31, + flags); strcat(dstc, tmp); } dsta[0] = 0; if (rp->alu.inst[i].inst3 & R300_FPI3_DSTA_REG) { - sprintf(dsta, "t%i.w ", (rp->alu.inst[i].inst3 >> R300_FPI3_DSTA_SHIFT) & 31); + sprintf(dsta, "t%i.w ", + (rp->alu.inst[i]. + inst3 >> R300_FPI3_DSTA_SHIFT) & 31); } if (rp->alu.inst[i].inst3 & R300_FPI3_DSTA_OUTPUT) { - sprintf(tmp, "o%i.w ", (rp->alu.inst[i].inst3 >> R300_FPI3_DSTA_SHIFT) & 31); + sprintf(tmp, "o%i.w ", + (rp->alu.inst[i]. + inst3 >> R300_FPI3_DSTA_SHIFT) & 31); strcat(dsta, tmp); } if (rp->alu.inst[i].inst3 & R300_FPI3_DSTA_DEPTH) { strcat(dsta, "Z"); } - fprintf(stderr, "%3i: xyz: %3s %3s %3s -> %-20s (%08x)\n" - " w: %3s %3s %3s -> %-20s (%08x)\n", - i, - srcc[0], srcc[1], srcc[2], dstc, rp->alu.inst[i].inst1, - srca[0], srca[1], srca[2], dsta, rp->alu.inst[i].inst3); + fprintf(stderr, + "%3i: xyz: %3s %3s %3s -> %-20s (%08x)\n" + " w: %3s %3s %3s -> %-20s (%08x)\n", i, + srcc[0], srcc[1], srcc[2], dstc, + rp->alu.inst[i].inst1, srca[0], srca[1], + srca[2], dsta, rp->alu.inst[i].inst3); - for(j = 0; j < 3; ++j) { - int regc = rp->alu.inst[i].inst0 >> (j*7); - int rega = rp->alu.inst[i].inst2 >> (j*7); + for (j = 0; j < 3; ++j) { + int regc = rp->alu.inst[i].inst0 >> (j * 7); + int rega = rp->alu.inst[i].inst2 >> (j * 7); int d; char buf[20]; d = regc & 31; if (d < 12) { - switch(d % 4) { - case R300_FPI0_ARGC_SRC0C_XYZ: - sprintf(buf, "%s.xyz", srcc[d / 4]); - break; - case R300_FPI0_ARGC_SRC0C_XXX: - sprintf(buf, "%s.xxx", srcc[d / 4]); - break; - case R300_FPI0_ARGC_SRC0C_YYY: - sprintf(buf, "%s.yyy", srcc[d / 4]); - break; - case R300_FPI0_ARGC_SRC0C_ZZZ: - sprintf(buf, "%s.zzz", srcc[d / 4]); - break; + switch (d % 4) { + case R300_FPI0_ARGC_SRC0C_XYZ: + sprintf(buf, "%s.xyz", + srcc[d / 4]); + break; + case R300_FPI0_ARGC_SRC0C_XXX: + sprintf(buf, "%s.xxx", + srcc[d / 4]); + break; + case R300_FPI0_ARGC_SRC0C_YYY: + sprintf(buf, "%s.yyy", + srcc[d / 4]); + break; + case R300_FPI0_ARGC_SRC0C_ZZZ: + sprintf(buf, "%s.zzz", + srcc[d / 4]); + break; } } else if (d < 15) { - sprintf(buf, "%s.www", srca[d-12]); + sprintf(buf, "%s.www", srca[d - 12]); } else if (d == 20) { sprintf(buf, "0.0"); } else if (d == 21) { @@ -2449,32 +2417,35 @@ static void dump_program(struct r300_fragment_program *rp) sprintf(buf, "0.5"); } else if (d >= 23 && d < 32) { d -= 23; - switch(d/3) { - case 0: - sprintf(buf, "%s.yzx", srcc[d % 3]); - break; - case 1: - sprintf(buf, "%s.zxy", srcc[d % 3]); - break; - case 2: - sprintf(buf, "%s.Wzy", srcc[d % 3]); - break; + switch (d / 3) { + case 0: + sprintf(buf, "%s.yzx", + srcc[d % 3]); + break; + case 1: + sprintf(buf, "%s.zxy", + srcc[d % 3]); + break; + case 2: + sprintf(buf, "%s.Wzy", + srcc[d % 3]); + break; } } else { sprintf(buf, "%i", d); } sprintf(argc[j], "%s%s%s%s", - (regc & 32) ? "-" : "", - (regc & 64) ? "|" : "", - buf, - (regc & 64) ? "|" : ""); + (regc & 32) ? "-" : "", + (regc & 64) ? "|" : "", + buf, (regc & 64) ? "|" : ""); d = rega & 31; if (d < 9) { - sprintf(buf, "%s.%c", srcc[d / 3], 'x' + (char)(d%3)); + sprintf(buf, "%s.%c", srcc[d / 3], + 'x' + (char)(d % 3)); } else if (d < 12) { - sprintf(buf, "%s.w", srca[d-9]); + sprintf(buf, "%s.w", srca[d - 9]); } else if (d == 16) { sprintf(buf, "0.0"); } else if (d == 17) { @@ -2486,16 +2457,16 @@ static void dump_program(struct r300_fragment_program *rp) } sprintf(arga[j], "%s%s%s%s", - (rega & 32) ? "-" : "", - (rega & 64) ? "|" : "", - buf, - (rega & 64) ? "|" : ""); + (rega & 32) ? "-" : "", + (rega & 64) ? "|" : "", + buf, (rega & 64) ? "|" : ""); } fprintf(stderr, " xyz: %8s %8s %8s op: %08x\n" - " w: %8s %8s %8s op: %08x\n", - argc[0], argc[1], argc[2], rp->alu.inst[i].inst0, - arga[0], arga[1], arga[2], rp->alu.inst[i].inst2); + " w: %8s %8s %8s op: %08x\n", + argc[0], argc[1], argc[2], + rp->alu.inst[i].inst0, arga[0], arga[1], + arga[2], rp->alu.inst[i].inst2); } } } diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.h b/src/mesa/drivers/dri/r300/r300_fragprog.h index 1d683acdd92..79f3e70fa63 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog.h +++ b/src/mesa/drivers/dri/r300/r300_fragprog.h @@ -98,6 +98,7 @@ typedef struct r300_fragment_program_swizzle { struct r300_fragment_program; -extern void r300_translate_fragment_shader(r300ContextPtr r300, struct r300_fragment_program *rp); +extern void r300_translate_fragment_shader(r300ContextPtr r300, + struct r300_fragment_program *rp); #endif -- cgit v1.2.3 From 81c6516af1f3f7284032cb54ffca5225a54f6b26 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 04:12:04 +0000 Subject: r300: Indented r300_vertprog.[ch]. --- src/mesa/drivers/dri/r300/r300_vertprog.c | 1158 +++++++++++++++++------------ src/mesa/drivers/dri/r300/r300_vertprog.h | 7 +- 2 files changed, 674 insertions(+), 491 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index 39d127c64ac..4d0c9c27190 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -56,62 +56,66 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define SCALAR_FLAG (1<<31) #define FLAG_MASK (1<<31) -#define OP_MASK (0xf) /* we are unlikely to have more than 15 */ +#define OP_MASK (0xf) /* we are unlikely to have more than 15 */ #define OPN(operator, ip) {#operator, OPCODE_##operator, ip} -static struct{ +static struct { char *name; int opcode; - unsigned long ip; /* number of input operands and flags */ -}op_names[]={ + unsigned long ip; /* number of input operands and flags */ +} op_names[] = { + /* *INDENT-OFF* */ OPN(ABS, 1), OPN(ADD, 2), - OPN(ARL, 1|SCALAR_FLAG), + OPN(ARL, 1 | SCALAR_FLAG), OPN(DP3, 2), OPN(DP4, 2), OPN(DPH, 2), OPN(DST, 2), - OPN(EX2, 1|SCALAR_FLAG), - OPN(EXP, 1|SCALAR_FLAG), + OPN(EX2, 1 | SCALAR_FLAG), + OPN(EXP, 1 | SCALAR_FLAG), OPN(FLR, 1), OPN(FRC, 1), - OPN(LG2, 1|SCALAR_FLAG), + OPN(LG2, 1 | SCALAR_FLAG), OPN(LIT, 1), - OPN(LOG, 1|SCALAR_FLAG), + OPN(LOG, 1 | SCALAR_FLAG), OPN(MAD, 3), OPN(MAX, 2), OPN(MIN, 2), OPN(MOV, 1), OPN(MUL, 2), - OPN(POW, 2|SCALAR_FLAG), - OPN(RCP, 1|SCALAR_FLAG), - OPN(RSQ, 1|SCALAR_FLAG), + OPN(POW, 2 | SCALAR_FLAG), + OPN(RCP, 1 | SCALAR_FLAG), + OPN(RSQ, 1 | SCALAR_FLAG), OPN(SGE, 2), OPN(SLT, 2), OPN(SUB, 2), OPN(SWZ, 1), OPN(XPD, 2), - OPN(RCC, 0), //extra + OPN(RCC, 0), //extra OPN(PRINT, 0), - OPN(END, 0), + OPN(END, 0) + /* *INDENT-ON* */ }; + #undef OPN -int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program_cont *vp, float *dst) +int r300VertexProgUpdateParams(GLcontext * ctx, + struct r300_vertex_program_cont *vp, float *dst) { int pi; struct gl_vertex_program *mesa_vp = &vp->mesa_program; - float *dst_o=dst; - struct gl_program_parameter_list *paramList; + float *dst_o = dst; + struct gl_program_parameter_list *paramList; if (mesa_vp->IsNVProgram) { _mesa_load_tracked_matrices(ctx); - for (pi=0; pi < MAX_NV_VERTEX_PROGRAM_PARAMS; pi++) { - *dst++=ctx->VertexProgram.Parameters[pi][0]; - *dst++=ctx->VertexProgram.Parameters[pi][1]; - *dst++=ctx->VertexProgram.Parameters[pi][2]; - *dst++=ctx->VertexProgram.Parameters[pi][3]; + for (pi = 0; pi < MAX_NV_VERTEX_PROGRAM_PARAMS; pi++) { + *dst++ = ctx->VertexProgram.Parameters[pi][0]; + *dst++ = ctx->VertexProgram.Parameters[pi][1]; + *dst++ = ctx->VertexProgram.Parameters[pi][2]; + *dst++ = ctx->VertexProgram.Parameters[pi][3]; } return dst - dst_o; } @@ -119,26 +123,29 @@ int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program_cont * assert(mesa_vp->Base.Parameters); _mesa_load_state_parameters(ctx, mesa_vp->Base.Parameters); - if(mesa_vp->Base.Parameters->NumParameters * 4 > VSF_MAX_FRAGMENT_LENGTH){ + if (mesa_vp->Base.Parameters->NumParameters * 4 > + VSF_MAX_FRAGMENT_LENGTH) { fprintf(stderr, "%s:Params exhausted\n", __FUNCTION__); _mesa_exit(-1); } - paramList = mesa_vp->Base.Parameters; - for(pi=0; pi < paramList->NumParameters; pi++){ - switch(paramList->Parameters[pi].Type){ + paramList = mesa_vp->Base.Parameters; + for (pi = 0; pi < paramList->NumParameters; pi++) { + switch (paramList->Parameters[pi].Type) { case PROGRAM_STATE_VAR: case PROGRAM_NAMED_PARAM: //fprintf(stderr, "%s", vp->Parameters->Parameters[pi].Name); case PROGRAM_CONSTANT: - *dst++=paramList->ParameterValues[pi][0]; - *dst++=paramList->ParameterValues[pi][1]; - *dst++=paramList->ParameterValues[pi][2]; - *dst++=paramList->ParameterValues[pi][3]; - break; + *dst++ = paramList->ParameterValues[pi][0]; + *dst++ = paramList->ParameterValues[pi][1]; + *dst++ = paramList->ParameterValues[pi][2]; + *dst++ = paramList->ParameterValues[pi][3]; + break; - default: _mesa_problem(NULL, "Bad param type in %s", __FUNCTION__); + default: + _mesa_problem(NULL, "Bad param type in %s", + __FUNCTION__); } } @@ -155,32 +162,33 @@ static unsigned long t_dst_mask(GLuint mask) static unsigned long t_dst_class(enum register_file file) { - switch(file){ - case PROGRAM_TEMPORARY: - return VSF_OUT_CLASS_TMP; - case PROGRAM_OUTPUT: - return VSF_OUT_CLASS_RESULT; - case PROGRAM_ADDRESS: - return VSF_OUT_CLASS_ADDR; + switch (file) { + case PROGRAM_TEMPORARY: + return VSF_OUT_CLASS_TMP; + case PROGRAM_OUTPUT: + return VSF_OUT_CLASS_RESULT; + case PROGRAM_ADDRESS: + return VSF_OUT_CLASS_ADDR; /* - case PROGRAM_INPUT: - case PROGRAM_LOCAL_PARAM: - case PROGRAM_ENV_PARAM: - case PROGRAM_NAMED_PARAM: - case PROGRAM_STATE_VAR: - case PROGRAM_WRITE_ONLY: - case PROGRAM_ADDRESS: - */ - default: - fprintf(stderr, "problem in %s", __FUNCTION__); - _mesa_exit(-1); - return -1; + case PROGRAM_INPUT: + case PROGRAM_LOCAL_PARAM: + case PROGRAM_ENV_PARAM: + case PROGRAM_NAMED_PARAM: + case PROGRAM_STATE_VAR: + case PROGRAM_WRITE_ONLY: + case PROGRAM_ADDRESS: + */ + default: + fprintf(stderr, "problem in %s", __FUNCTION__); + _mesa_exit(-1); + return -1; } } -static unsigned long t_dst_index(struct r300_vertex_program *vp, struct prog_dst_register *dst) +static unsigned long t_dst_index(struct r300_vertex_program *vp, + struct prog_dst_register *dst) { - if(dst->File == PROGRAM_OUTPUT) + if (dst->File == PROGRAM_OUTPUT) return vp->outputs[dst->Index]; return dst->Index; @@ -189,27 +197,27 @@ static unsigned long t_dst_index(struct r300_vertex_program *vp, struct prog_dst static unsigned long t_src_class(enum register_file file) { - switch(file){ - case PROGRAM_TEMPORARY: - return VSF_IN_CLASS_TMP; + switch (file) { + case PROGRAM_TEMPORARY: + return VSF_IN_CLASS_TMP; - case PROGRAM_INPUT: - return VSF_IN_CLASS_ATTR; + case PROGRAM_INPUT: + return VSF_IN_CLASS_ATTR; - case PROGRAM_LOCAL_PARAM: - case PROGRAM_ENV_PARAM: - case PROGRAM_NAMED_PARAM: - case PROGRAM_STATE_VAR: - return VSF_IN_CLASS_PARAM; + case PROGRAM_LOCAL_PARAM: + case PROGRAM_ENV_PARAM: + case PROGRAM_NAMED_PARAM: + case PROGRAM_STATE_VAR: + return VSF_IN_CLASS_PARAM; /* - case PROGRAM_OUTPUT: - case PROGRAM_WRITE_ONLY: - case PROGRAM_ADDRESS: - */ - default: - fprintf(stderr, "problem in %s", __FUNCTION__); - _mesa_exit(-1); - return -1; + case PROGRAM_OUTPUT: + case PROGRAM_WRITE_ONLY: + case PROGRAM_ADDRESS: + */ + default: + fprintf(stderr, "problem in %s", __FUNCTION__); + _mesa_exit(-1); + return -1; } } @@ -224,94 +232,104 @@ static void vp_dump_inputs(struct r300_vertex_program *vp, char *caller) { int i; - if(vp == NULL){ - fprintf(stderr, "vp null in call to %s from %s\n", __FUNCTION__, caller); - return ; + if (vp == NULL) { + fprintf(stderr, "vp null in call to %s from %s\n", __FUNCTION__, + caller); + return; } fprintf(stderr, "%s:<", caller); - for(i=0; i < VERT_ATTRIB_MAX; i++) + for (i = 0; i < VERT_ATTRIB_MAX; i++) fprintf(stderr, "%d ", vp->inputs[i]); fprintf(stderr, ">\n"); } #endif -static unsigned long t_src_index(struct r300_vertex_program *vp, struct prog_src_register *src) +static unsigned long t_src_index(struct r300_vertex_program *vp, + struct prog_src_register *src) { int i; - int max_reg=-1; + int max_reg = -1; - if(src->File == PROGRAM_INPUT){ - if(vp->inputs[src->Index] != -1) + if (src->File == PROGRAM_INPUT) { + if (vp->inputs[src->Index] != -1) return vp->inputs[src->Index]; - for(i=0; i < VERT_ATTRIB_MAX; i++) - if(vp->inputs[i] > max_reg) - max_reg=vp->inputs[i]; + for (i = 0; i < VERT_ATTRIB_MAX; i++) + if (vp->inputs[i] > max_reg) + max_reg = vp->inputs[i]; - vp->inputs[src->Index]=max_reg+1; + vp->inputs[src->Index] = max_reg + 1; //vp_dump_inputs(vp, __FUNCTION__); return vp->inputs[src->Index]; - }else{ + } else { if (src->Index < 0) { - fprintf (stderr, "negative offsets for indirect addressing do not work.\n"); + fprintf(stderr, + "negative offsets for indirect addressing do not work.\n"); return 0; } return src->Index; } } -static unsigned long t_src(struct r300_vertex_program *vp, struct prog_src_register *src) +static unsigned long t_src(struct r300_vertex_program *vp, + struct prog_src_register *src) { /* src->NegateBase uses the NEGATE_ flags from program_instruction.h, * which equal our VSF_FLAGS_ values, so it's safe to just pass it here. */ return MAKE_VSF_SOURCE(t_src_index(vp, src), - t_swizzle(GET_SWZ(src->Swizzle, 0)), - t_swizzle(GET_SWZ(src->Swizzle, 1)), - t_swizzle(GET_SWZ(src->Swizzle, 2)), - t_swizzle(GET_SWZ(src->Swizzle, 3)), - t_src_class(src->File), - src->NegateBase) | (src->RelAddr << 4); + t_swizzle(GET_SWZ(src->Swizzle, 0)), + t_swizzle(GET_SWZ(src->Swizzle, 1)), + t_swizzle(GET_SWZ(src->Swizzle, 2)), + t_swizzle(GET_SWZ(src->Swizzle, 3)), + t_src_class(src->File), + src->NegateBase) | (src->RelAddr << 4); } -static unsigned long t_src_scalar(struct r300_vertex_program *vp, struct prog_src_register *src) +static unsigned long t_src_scalar(struct r300_vertex_program *vp, + struct prog_src_register *src) { return MAKE_VSF_SOURCE(t_src_index(vp, src), - t_swizzle(GET_SWZ(src->Swizzle, 0)), - t_swizzle(GET_SWZ(src->Swizzle, 0)), - t_swizzle(GET_SWZ(src->Swizzle, 0)), - t_swizzle(GET_SWZ(src->Swizzle, 0)), - t_src_class(src->File), - src->NegateBase ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src->RelAddr << 4); + t_swizzle(GET_SWZ(src->Swizzle, 0)), + t_swizzle(GET_SWZ(src->Swizzle, 0)), + t_swizzle(GET_SWZ(src->Swizzle, 0)), + t_swizzle(GET_SWZ(src->Swizzle, 0)), + t_src_class(src->File), + src-> + NegateBase ? VSF_FLAG_ALL : VSF_FLAG_NONE) | + (src->RelAddr << 4); } static unsigned long t_opcode(enum prog_opcode opcode) { - switch(opcode){ - case OPCODE_ARL: return R300_VPI_OUT_OP_ARL; - case OPCODE_DST: return R300_VPI_OUT_OP_DST; - case OPCODE_EX2: return R300_VPI_OUT_OP_EX2; - case OPCODE_EXP: return R300_VPI_OUT_OP_EXP; - case OPCODE_FRC: return R300_VPI_OUT_OP_FRC; - case OPCODE_LG2: return R300_VPI_OUT_OP_LG2; - case OPCODE_LOG: return R300_VPI_OUT_OP_LOG; - case OPCODE_MAX: return R300_VPI_OUT_OP_MAX; - case OPCODE_MIN: return R300_VPI_OUT_OP_MIN; - case OPCODE_MUL: return R300_VPI_OUT_OP_MUL; - case OPCODE_RCP: return R300_VPI_OUT_OP_RCP; - case OPCODE_RSQ: return R300_VPI_OUT_OP_RSQ; - case OPCODE_SGE: return R300_VPI_OUT_OP_SGE; - case OPCODE_SLT: return R300_VPI_OUT_OP_SLT; - case OPCODE_DP4: return R300_VPI_OUT_OP_DOT; - - default: - fprintf(stderr, "%s: Should not be called with opcode %d!", __FUNCTION__, opcode); + switch (opcode) { + /* *INDENT-OFF* */ + case OPCODE_ARL: return R300_VPI_OUT_OP_ARL; + case OPCODE_DST: return R300_VPI_OUT_OP_DST; + case OPCODE_EX2: return R300_VPI_OUT_OP_EX2; + case OPCODE_EXP: return R300_VPI_OUT_OP_EXP; + case OPCODE_FRC: return R300_VPI_OUT_OP_FRC; + case OPCODE_LG2: return R300_VPI_OUT_OP_LG2; + case OPCODE_LOG: return R300_VPI_OUT_OP_LOG; + case OPCODE_MAX: return R300_VPI_OUT_OP_MAX; + case OPCODE_MIN: return R300_VPI_OUT_OP_MIN; + case OPCODE_MUL: return R300_VPI_OUT_OP_MUL; + case OPCODE_RCP: return R300_VPI_OUT_OP_RCP; + case OPCODE_RSQ: return R300_VPI_OUT_OP_RSQ; + case OPCODE_SGE: return R300_VPI_OUT_OP_SGE; + case OPCODE_SLT: return R300_VPI_OUT_OP_SLT; + case OPCODE_DP4: return R300_VPI_OUT_OP_DOT; + /* *INDENT-ON* */ + + default: + fprintf(stderr, "%s: Should not be called with opcode %d!", + __FUNCTION__, opcode); } _mesa_exit(-1); return 0; @@ -322,8 +340,8 @@ static unsigned long op_operands(enum prog_opcode opcode) int i; /* Can we trust mesas opcodes to be in order ? */ - for(i=0; i < sizeof(op_names) / sizeof(*op_names); i++) - if(op_names[i].opcode == opcode) + for (i = 0; i < sizeof(op_names) / sizeof(*op_names); i++) + if (op_names[i].opcode == opcode) return op_names[i].ip; fprintf(stderr, "op %d not found in op_names\n", opcode); @@ -331,11 +349,12 @@ static unsigned long op_operands(enum prog_opcode opcode) return 0; } -static GLboolean valid_dst(struct r300_vertex_program *vp, struct prog_dst_register *dst) +static GLboolean valid_dst(struct r300_vertex_program *vp, + struct prog_dst_register *dst) { - if(dst->File == PROGRAM_OUTPUT && vp->outputs[dst->Index] == -1) { + if (dst->File == PROGRAM_OUTPUT && vp->outputs[dst->Index] == -1) { return GL_FALSE; - } else if(dst->File == PROGRAM_ADDRESS) { + } else if (dst->File == PROGRAM_ADDRESS) { assert(dst->Index == 0); } @@ -391,9 +410,10 @@ static GLboolean valid_dst(struct r300_vertex_program *vp, struct prog_dst_regis u_temp_i=VSF_MAX_FRAGMENT_TEMPS-1; \ } while (0) -static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct prog_instruction *vpi) +static void r300_translate_vertex_shader(struct r300_vertex_program *vp, + struct prog_instruction *vpi) { - int i, cur_reg=0; + int i, cur_reg = 0; VERTEX_SHADER_INSTRUCTION *o_inst; unsigned long operands; int are_srcs_scalar; @@ -401,341 +421,475 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct /* Initial value should be last tmp reg that hw supports. Strangely enough r300 doesnt mind even though these would be out of range. Smart enough to realize that it doesnt need it? */ - int u_temp_i=VSF_MAX_FRAGMENT_TEMPS-1; + int u_temp_i = VSF_MAX_FRAGMENT_TEMPS - 1; struct prog_src_register src[3]; - vp->pos_end=0; /* Not supported yet */ - vp->program.length=0; - /*vp->num_temporaries=mesa_vp->Base.NumTemporaries;*/ + vp->pos_end = 0; /* Not supported yet */ + vp->program.length = 0; + /*vp->num_temporaries=mesa_vp->Base.NumTemporaries; */ - for(i=0; i < VERT_ATTRIB_MAX; i++) + for (i = 0; i < VERT_ATTRIB_MAX; i++) vp->inputs[i] = -1; - for(i=0; i < VERT_RESULT_MAX; i++) + for (i = 0; i < VERT_RESULT_MAX; i++) vp->outputs[i] = -1; assert(vp->key.OutputsWritten & (1 << VERT_RESULT_HPOS)); /* Assign outputs */ - if(vp->key.OutputsWritten & (1 << VERT_RESULT_HPOS)) + if (vp->key.OutputsWritten & (1 << VERT_RESULT_HPOS)) vp->outputs[VERT_RESULT_HPOS] = cur_reg++; - if(vp->key.OutputsWritten & (1 << VERT_RESULT_PSIZ)) + if (vp->key.OutputsWritten & (1 << VERT_RESULT_PSIZ)) vp->outputs[VERT_RESULT_PSIZ] = cur_reg++; - if(vp->key.OutputsWritten & (1 << VERT_RESULT_COL0)) + if (vp->key.OutputsWritten & (1 << VERT_RESULT_COL0)) vp->outputs[VERT_RESULT_COL0] = cur_reg++; - if(vp->key.OutputsWritten & (1 << VERT_RESULT_COL1)) + if (vp->key.OutputsWritten & (1 << VERT_RESULT_COL1)) vp->outputs[VERT_RESULT_COL1] = cur_reg++; -#if 0 /* Not supported yet */ - if(vp->key.OutputsWritten & (1 << VERT_RESULT_BFC0)) +#if 0 /* Not supported yet */ + if (vp->key.OutputsWritten & (1 << VERT_RESULT_BFC0)) vp->outputs[VERT_RESULT_BFC0] = cur_reg++; - if(vp->key.OutputsWritten & (1 << VERT_RESULT_BFC1)) + if (vp->key.OutputsWritten & (1 << VERT_RESULT_BFC1)) vp->outputs[VERT_RESULT_BFC1] = cur_reg++; - if(vp->key.OutputsWritten & (1 << VERT_RESULT_FOGC)) + if (vp->key.OutputsWritten & (1 << VERT_RESULT_FOGC)) vp->outputs[VERT_RESULT_FOGC] = cur_reg++; #endif - for(i=VERT_RESULT_TEX0; i <= VERT_RESULT_TEX7; i++) - if(vp->key.OutputsWritten & (1 << i)) + for (i = VERT_RESULT_TEX0; i <= VERT_RESULT_TEX7; i++) + if (vp->key.OutputsWritten & (1 << i)) vp->outputs[i] = cur_reg++; vp->translated = GL_TRUE; vp->native = GL_TRUE; - o_inst=vp->program.body.i; - for(; vpi->Opcode != OPCODE_END; vpi++, o_inst++){ + o_inst = vp->program.body.i; + for (; vpi->Opcode != OPCODE_END; vpi++, o_inst++) { FREE_TEMPS(); - if(!valid_dst(vp, &vpi->DstReg)) - { + if (!valid_dst(vp, &vpi->DstReg)) { /* redirect result to unused temp */ vpi->DstReg.File = PROGRAM_TEMPORARY; vpi->DstReg.Index = u_temp_i; } - operands=op_operands(vpi->Opcode); - are_srcs_scalar=operands & SCALAR_FLAG; + operands = op_operands(vpi->Opcode); + are_srcs_scalar = operands & SCALAR_FLAG; operands &= OP_MASK; - for(i=0; i < operands; i++) - src[i]=vpi->SrcReg[i]; - - if(operands == 3){ /* TODO: scalars */ - if( CMP_SRCS(src[1], src[2]) || CMP_SRCS(src[0], src[2]) ){ - o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, u_temp_i, - VSF_FLAG_ALL, VSF_OUT_CLASS_TMP); - - o_inst->src[0]=MAKE_VSF_SOURCE(t_src_index(vp, &src[2]), - SWIZZLE_X, SWIZZLE_Y, - SWIZZLE_Z, SWIZZLE_W, - t_src_class(src[2].File), VSF_FLAG_NONE) | (src[2].RelAddr << 4); - - o_inst->src[1]=ZERO_SRC_2; - o_inst->src[2]=ZERO_SRC_2; + for (i = 0; i < operands; i++) + src[i] = vpi->SrcReg[i]; + + if (operands == 3) { /* TODO: scalars */ + if (CMP_SRCS(src[1], src[2]) + || CMP_SRCS(src[0], src[2])) { + o_inst->op = + MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, u_temp_i, + VSF_FLAG_ALL, + VSF_OUT_CLASS_TMP); + + o_inst->src[0] = + MAKE_VSF_SOURCE(t_src_index(vp, &src[2]), + SWIZZLE_X, SWIZZLE_Y, + SWIZZLE_Z, SWIZZLE_W, + t_src_class(src[2].File), + VSF_FLAG_NONE) | (src[2]. + RelAddr << + 4); + + o_inst->src[1] = ZERO_SRC_2; + o_inst->src[2] = ZERO_SRC_2; o_inst++; - src[2].File=PROGRAM_TEMPORARY; - src[2].Index=u_temp_i; - src[2].RelAddr=0; + src[2].File = PROGRAM_TEMPORARY; + src[2].Index = u_temp_i; + src[2].RelAddr = 0; u_temp_i--; } } - if(operands >= 2){ - if( CMP_SRCS(src[1], src[0]) ){ - o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, u_temp_i, - VSF_FLAG_ALL, VSF_OUT_CLASS_TMP); - - o_inst->src[0]=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), - SWIZZLE_X, SWIZZLE_Y, - SWIZZLE_Z, SWIZZLE_W, - t_src_class(src[0].File), VSF_FLAG_NONE) | (src[0].RelAddr << 4); - - o_inst->src[1]=ZERO_SRC_0; - o_inst->src[2]=ZERO_SRC_0; + if (operands >= 2) { + if (CMP_SRCS(src[1], src[0])) { + o_inst->op = + MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, u_temp_i, + VSF_FLAG_ALL, + VSF_OUT_CLASS_TMP); + + o_inst->src[0] = + MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), + SWIZZLE_X, SWIZZLE_Y, + SWIZZLE_Z, SWIZZLE_W, + t_src_class(src[0].File), + VSF_FLAG_NONE) | (src[0]. + RelAddr << + 4); + + o_inst->src[1] = ZERO_SRC_0; + o_inst->src[2] = ZERO_SRC_0; o_inst++; - src[0].File=PROGRAM_TEMPORARY; - src[0].Index=u_temp_i; - src[0].RelAddr=0; + src[0].File = PROGRAM_TEMPORARY; + src[0].Index = u_temp_i; + src[0].RelAddr = 0; u_temp_i--; } } /* These ops need special handling. */ - switch(vpi->Opcode){ + switch (vpi->Opcode) { case OPCODE_POW: - o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_POW, t_dst_index(vp, &vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - o_inst->src[0]=t_src_scalar(vp, &src[0]); - o_inst->src[1]=ZERO_SRC_0; - o_inst->src[2]=t_src_scalar(vp, &src[1]); + o_inst->op = + MAKE_VSF_OP(R300_VPI_OUT_OP_POW, + t_dst_index(vp, &vpi->DstReg), + t_dst_mask(vpi->DstReg.WriteMask), + t_dst_class(vpi->DstReg.File)); + o_inst->src[0] = t_src_scalar(vp, &src[0]); + o_inst->src[1] = ZERO_SRC_0; + o_inst->src[2] = t_src_scalar(vp, &src[1]); goto next; - case OPCODE_MOV://ADD RESULT 1.X Y Z W PARAM 0{} {X Y Z W} PARAM 0{} {ZERO ZERO ZERO ZERO} + case OPCODE_MOV: //ADD RESULT 1.X Y Z W PARAM 0{} {X Y Z W} PARAM 0{} {ZERO ZERO ZERO ZERO} case OPCODE_SWZ: #if 1 - o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, t_dst_index(vp, &vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - o_inst->src[0]=t_src(vp, &src[0]); - o_inst->src[1]=ZERO_SRC_0; - o_inst->src[2]=ZERO_SRC_0; + o_inst->op = + MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, + t_dst_index(vp, &vpi->DstReg), + t_dst_mask(vpi->DstReg.WriteMask), + t_dst_class(vpi->DstReg.File)); + o_inst->src[0] = t_src(vp, &src[0]); + o_inst->src[1] = ZERO_SRC_0; + o_inst->src[2] = ZERO_SRC_0; #else - hw_op=(src[0].File == PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 : R300_VPI_OUT_OP_MAD; - - o_inst->op=MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - o_inst->src[0]=t_src(vp, &src[0]); - o_inst->src[1]=ONE_SRC_0; - o_inst->src[2]=ZERO_SRC_0; + hw_op = + (src[0].File == + PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 : + R300_VPI_OUT_OP_MAD; + + o_inst->op = + MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg), + t_dst_mask(vpi->DstReg.WriteMask), + t_dst_class(vpi->DstReg.File)); + o_inst->src[0] = t_src(vp, &src[0]); + o_inst->src[1] = ONE_SRC_0; + o_inst->src[2] = ZERO_SRC_0; #endif goto next; case OPCODE_ADD: #if 1 - hw_op=(src[0].File == PROGRAM_TEMPORARY && - src[1].File == PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 : R300_VPI_OUT_OP_MAD; - - o_inst->op=MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - o_inst->src[0]=ONE_SRC_0; - o_inst->src[1]=t_src(vp, &src[0]); - o_inst->src[2]=t_src(vp, &src[1]); + hw_op = (src[0].File == PROGRAM_TEMPORARY && + src[1].File == + PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 : + R300_VPI_OUT_OP_MAD; + + o_inst->op = + MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg), + t_dst_mask(vpi->DstReg.WriteMask), + t_dst_class(vpi->DstReg.File)); + o_inst->src[0] = ONE_SRC_0; + o_inst->src[1] = t_src(vp, &src[0]); + o_inst->src[2] = t_src(vp, &src[1]); #else - o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, t_dst_index(vp, &vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - o_inst->src[0]=t_src(vp, &src[0]); - o_inst->src[1]=t_src(vp, &src[1]); - o_inst->src[2]=ZERO_SRC_1; + o_inst->op = + MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, + t_dst_index(vp, &vpi->DstReg), + t_dst_mask(vpi->DstReg.WriteMask), + t_dst_class(vpi->DstReg.File)); + o_inst->src[0] = t_src(vp, &src[0]); + o_inst->src[1] = t_src(vp, &src[1]); + o_inst->src[2] = ZERO_SRC_1; #endif goto next; case OPCODE_MAD: - hw_op=(src[0].File == PROGRAM_TEMPORARY && - src[1].File == PROGRAM_TEMPORARY && - src[2].File == PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 : R300_VPI_OUT_OP_MAD; - - o_inst->op=MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - o_inst->src[0]=t_src(vp, &src[0]); - o_inst->src[1]=t_src(vp, &src[1]); - o_inst->src[2]=t_src(vp, &src[2]); + hw_op = (src[0].File == PROGRAM_TEMPORARY && + src[1].File == PROGRAM_TEMPORARY && + src[2].File == + PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 : + R300_VPI_OUT_OP_MAD; + + o_inst->op = + MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg), + t_dst_mask(vpi->DstReg.WriteMask), + t_dst_class(vpi->DstReg.File)); + o_inst->src[0] = t_src(vp, &src[0]); + o_inst->src[1] = t_src(vp, &src[1]); + o_inst->src[2] = t_src(vp, &src[2]); goto next; - case OPCODE_MUL: /* HW mul can take third arg but appears to have some other limitations. */ - hw_op=(src[0].File == PROGRAM_TEMPORARY && - src[1].File == PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 : R300_VPI_OUT_OP_MAD; + case OPCODE_MUL: /* HW mul can take third arg but appears to have some other limitations. */ + hw_op = (src[0].File == PROGRAM_TEMPORARY && + src[1].File == + PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 : + R300_VPI_OUT_OP_MAD; - o_inst->op=MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - o_inst->src[0]=t_src(vp, &src[0]); - o_inst->src[1]=t_src(vp, &src[1]); + o_inst->op = + MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg), + t_dst_mask(vpi->DstReg.WriteMask), + t_dst_class(vpi->DstReg.File)); + o_inst->src[0] = t_src(vp, &src[0]); + o_inst->src[1] = t_src(vp, &src[1]); - o_inst->src[2]=ZERO_SRC_1; + o_inst->src[2] = ZERO_SRC_1; goto next; - case OPCODE_DP3://DOT RESULT 1.X Y Z W PARAM 0{} {X Y Z ZERO} PARAM 0{} {X Y Z ZERO} - o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_DOT, t_dst_index(vp, &vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - - o_inst->src[0]=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), - t_swizzle(GET_SWZ(src[0].Swizzle, 0)), - t_swizzle(GET_SWZ(src[0].Swizzle, 1)), - t_swizzle(GET_SWZ(src[0].Swizzle, 2)), - SWIZZLE_ZERO, - t_src_class(src[0].File), - src[0].NegateBase ? VSF_FLAG_XYZ : VSF_FLAG_NONE) | (src[0].RelAddr << 4); - - o_inst->src[1]=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]), - t_swizzle(GET_SWZ(src[1].Swizzle, 0)), - t_swizzle(GET_SWZ(src[1].Swizzle, 1)), - t_swizzle(GET_SWZ(src[1].Swizzle, 2)), - SWIZZLE_ZERO, - t_src_class(src[1].File), - src[1].NegateBase ? VSF_FLAG_XYZ : VSF_FLAG_NONE) | (src[1].RelAddr << 4); - - o_inst->src[2]=ZERO_SRC_1; + case OPCODE_DP3: //DOT RESULT 1.X Y Z W PARAM 0{} {X Y Z ZERO} PARAM 0{} {X Y Z ZERO} + o_inst->op = + MAKE_VSF_OP(R300_VPI_OUT_OP_DOT, + t_dst_index(vp, &vpi->DstReg), + t_dst_mask(vpi->DstReg.WriteMask), + t_dst_class(vpi->DstReg.File)); + + o_inst->src[0] = + MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), + t_swizzle(GET_SWZ + (src[0].Swizzle, 0)), + t_swizzle(GET_SWZ + (src[0].Swizzle, 1)), + t_swizzle(GET_SWZ + (src[0].Swizzle, 2)), + SWIZZLE_ZERO, + t_src_class(src[0].File), + src[0]. + NegateBase ? VSF_FLAG_XYZ : + VSF_FLAG_NONE) | (src[0]. + RelAddr << 4); + + o_inst->src[1] = + MAKE_VSF_SOURCE(t_src_index(vp, &src[1]), + t_swizzle(GET_SWZ + (src[1].Swizzle, 0)), + t_swizzle(GET_SWZ + (src[1].Swizzle, 1)), + t_swizzle(GET_SWZ + (src[1].Swizzle, 2)), + SWIZZLE_ZERO, + t_src_class(src[1].File), + src[1]. + NegateBase ? VSF_FLAG_XYZ : + VSF_FLAG_NONE) | (src[1]. + RelAddr << 4); + + o_inst->src[2] = ZERO_SRC_1; goto next; - case OPCODE_SUB://ADD RESULT 1.X Y Z W TMP 0{} {X Y Z W} PARAM 1{X Y Z W } {X Y Z W} neg Xneg Yneg Zneg W + case OPCODE_SUB: //ADD RESULT 1.X Y Z W TMP 0{} {X Y Z W} PARAM 1{X Y Z W } {X Y Z W} neg Xneg Yneg Zneg W #if 1 - hw_op=(src[0].File == PROGRAM_TEMPORARY && - src[1].File == PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 : R300_VPI_OUT_OP_MAD; - - o_inst->op=MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - o_inst->src[0]=t_src(vp, &src[0]); - o_inst->src[1]=ONE_SRC_0; - o_inst->src[2]=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]), - t_swizzle(GET_SWZ(src[1].Swizzle, 0)), - t_swizzle(GET_SWZ(src[1].Swizzle, 1)), - t_swizzle(GET_SWZ(src[1].Swizzle, 2)), - t_swizzle(GET_SWZ(src[1].Swizzle, 3)), - t_src_class(src[1].File), - (!src[1].NegateBase) ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[1].RelAddr << 4); + hw_op = (src[0].File == PROGRAM_TEMPORARY && + src[1].File == + PROGRAM_TEMPORARY) ? R300_VPI_OUT_OP_MAD_2 : + R300_VPI_OUT_OP_MAD; + + o_inst->op = + MAKE_VSF_OP(hw_op, t_dst_index(vp, &vpi->DstReg), + t_dst_mask(vpi->DstReg.WriteMask), + t_dst_class(vpi->DstReg.File)); + o_inst->src[0] = t_src(vp, &src[0]); + o_inst->src[1] = ONE_SRC_0; + o_inst->src[2] = + MAKE_VSF_SOURCE(t_src_index(vp, &src[1]), + t_swizzle(GET_SWZ + (src[1].Swizzle, 0)), + t_swizzle(GET_SWZ + (src[1].Swizzle, 1)), + t_swizzle(GET_SWZ + (src[1].Swizzle, 2)), + t_swizzle(GET_SWZ + (src[1].Swizzle, 3)), + t_src_class(src[1].File), + (!src[1]. + NegateBase) ? VSF_FLAG_ALL : + VSF_FLAG_NONE) | (src[1]. + RelAddr << 4); #else - o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, t_dst_index(vp, &vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - - o_inst->src[0]=t_src(vp, &src[0]); - o_inst->src[1]=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]), - t_swizzle(GET_SWZ(src[1].Swizzle, 0)), - t_swizzle(GET_SWZ(src[1].Swizzle, 1)), - t_swizzle(GET_SWZ(src[1].Swizzle, 2)), - t_swizzle(GET_SWZ(src[1].Swizzle, 3)), - t_src_class(src[1].File), - (!src[1].NegateBase) ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[1].RelAddr << 4); - o_inst->src[2]=0; + o_inst->op = + MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, + t_dst_index(vp, &vpi->DstReg), + t_dst_mask(vpi->DstReg.WriteMask), + t_dst_class(vpi->DstReg.File)); + + o_inst->src[0] = t_src(vp, &src[0]); + o_inst->src[1] = + MAKE_VSF_SOURCE(t_src_index(vp, &src[1]), + t_swizzle(GET_SWZ + (src[1].Swizzle, 0)), + t_swizzle(GET_SWZ + (src[1].Swizzle, 1)), + t_swizzle(GET_SWZ + (src[1].Swizzle, 2)), + t_swizzle(GET_SWZ + (src[1].Swizzle, 3)), + t_src_class(src[1].File), + (!src[1]. + NegateBase) ? VSF_FLAG_ALL : + VSF_FLAG_NONE) | (src[1]. + RelAddr << 4); + o_inst->src[2] = 0; #endif goto next; - case OPCODE_ABS://MAX RESULT 1.X Y Z W PARAM 0{} {X Y Z W} PARAM 0{X Y Z W } {X Y Z W} neg Xneg Yneg Zneg W - o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_MAX, t_dst_index(vp, &vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - - o_inst->src[0]=t_src(vp, &src[0]); - o_inst->src[1]=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), - t_swizzle(GET_SWZ(src[0].Swizzle, 0)), - t_swizzle(GET_SWZ(src[0].Swizzle, 1)), - t_swizzle(GET_SWZ(src[0].Swizzle, 2)), - t_swizzle(GET_SWZ(src[0].Swizzle, 3)), - t_src_class(src[0].File), - (!src[0].NegateBase) ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[0].RelAddr << 4); - o_inst->src[2]=0; + case OPCODE_ABS: //MAX RESULT 1.X Y Z W PARAM 0{} {X Y Z W} PARAM 0{X Y Z W } {X Y Z W} neg Xneg Yneg Zneg W + o_inst->op = + MAKE_VSF_OP(R300_VPI_OUT_OP_MAX, + t_dst_index(vp, &vpi->DstReg), + t_dst_mask(vpi->DstReg.WriteMask), + t_dst_class(vpi->DstReg.File)); + + o_inst->src[0] = t_src(vp, &src[0]); + o_inst->src[1] = + MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), + t_swizzle(GET_SWZ + (src[0].Swizzle, 0)), + t_swizzle(GET_SWZ + (src[0].Swizzle, 1)), + t_swizzle(GET_SWZ + (src[0].Swizzle, 2)), + t_swizzle(GET_SWZ + (src[0].Swizzle, 3)), + t_src_class(src[0].File), + (!src[0]. + NegateBase) ? VSF_FLAG_ALL : + VSF_FLAG_NONE) | (src[0]. + RelAddr << 4); + o_inst->src[2] = 0; goto next; case OPCODE_FLR: - /* FRC TMP 0.X Y Z W PARAM 0{} {X Y Z W} - ADD RESULT 1.X Y Z W PARAM 0{} {X Y Z W} TMP 0{X Y Z W } {X Y Z W} neg Xneg Yneg Zneg W */ + /* FRC TMP 0.X Y Z W PARAM 0{} {X Y Z W} + ADD RESULT 1.X Y Z W PARAM 0{} {X Y Z W} TMP 0{X Y Z W } {X Y Z W} neg Xneg Yneg Zneg W */ - o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_FRC, u_temp_i, - t_dst_mask(vpi->DstReg.WriteMask), VSF_OUT_CLASS_TMP); + o_inst->op = MAKE_VSF_OP(R300_VPI_OUT_OP_FRC, u_temp_i, + t_dst_mask(vpi->DstReg. + WriteMask), + VSF_OUT_CLASS_TMP); - o_inst->src[0]=t_src(vp, &src[0]); - o_inst->src[1]=ZERO_SRC_0; - o_inst->src[2]=ZERO_SRC_0; + o_inst->src[0] = t_src(vp, &src[0]); + o_inst->src[1] = ZERO_SRC_0; + o_inst->src[2] = ZERO_SRC_0; o_inst++; - o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, t_dst_index(vp, &vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - - o_inst->src[0]=t_src(vp, &src[0]); - o_inst->src[1]=MAKE_VSF_SOURCE(u_temp_i, - VSF_IN_COMPONENT_X, - VSF_IN_COMPONENT_Y, - VSF_IN_COMPONENT_Z, - VSF_IN_COMPONENT_W, - VSF_IN_CLASS_TMP, - /* Not 100% sure about this */ - (!src[0].NegateBase) ? VSF_FLAG_ALL : VSF_FLAG_NONE/*VSF_FLAG_ALL*/); - - o_inst->src[2]=ZERO_SRC_0; + o_inst->op = + MAKE_VSF_OP(R300_VPI_OUT_OP_ADD, + t_dst_index(vp, &vpi->DstReg), + t_dst_mask(vpi->DstReg.WriteMask), + t_dst_class(vpi->DstReg.File)); + + o_inst->src[0] = t_src(vp, &src[0]); + o_inst->src[1] = MAKE_VSF_SOURCE(u_temp_i, + VSF_IN_COMPONENT_X, + VSF_IN_COMPONENT_Y, + VSF_IN_COMPONENT_Z, + VSF_IN_COMPONENT_W, + VSF_IN_CLASS_TMP, + /* Not 100% sure about this */ + (!src[0]. + NegateBase) ? + VSF_FLAG_ALL : + VSF_FLAG_NONE + /*VSF_FLAG_ALL */ ); + + o_inst->src[2] = ZERO_SRC_0; u_temp_i--; goto next; - case OPCODE_LG2:// LG2 RESULT 1.X Y Z W PARAM 0{} {X X X X} - o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_LG2, t_dst_index(vp, &vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - - o_inst->src[0]=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), - t_swizzle(GET_SWZ(src[0].Swizzle, 0)), - t_swizzle(GET_SWZ(src[0].Swizzle, 0)), - t_swizzle(GET_SWZ(src[0].Swizzle, 0)), - t_swizzle(GET_SWZ(src[0].Swizzle, 0)), - t_src_class(src[0].File), - src[0].NegateBase ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[0].RelAddr << 4); - o_inst->src[1]=ZERO_SRC_0; - o_inst->src[2]=ZERO_SRC_0; + case OPCODE_LG2: // LG2 RESULT 1.X Y Z W PARAM 0{} {X X X X} + o_inst->op = + MAKE_VSF_OP(R300_VPI_OUT_OP_LG2, + t_dst_index(vp, &vpi->DstReg), + t_dst_mask(vpi->DstReg.WriteMask), + t_dst_class(vpi->DstReg.File)); + + o_inst->src[0] = + MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), + t_swizzle(GET_SWZ + (src[0].Swizzle, 0)), + t_swizzle(GET_SWZ + (src[0].Swizzle, 0)), + t_swizzle(GET_SWZ + (src[0].Swizzle, 0)), + t_swizzle(GET_SWZ + (src[0].Swizzle, 0)), + t_src_class(src[0].File), + src[0]. + NegateBase ? VSF_FLAG_ALL : + VSF_FLAG_NONE) | (src[0]. + RelAddr << 4); + o_inst->src[1] = ZERO_SRC_0; + o_inst->src[2] = ZERO_SRC_0; goto next; - case OPCODE_LIT://LIT TMP 1.Y Z TMP 1{} {X W Z Y} TMP 1{} {Y W Z X} TMP 1{} {Y X Z W} - o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_LIT, t_dst_index(vp, &vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); + case OPCODE_LIT: //LIT TMP 1.Y Z TMP 1{} {X W Z Y} TMP 1{} {Y W Z X} TMP 1{} {Y X Z W} + o_inst->op = + MAKE_VSF_OP(R300_VPI_OUT_OP_LIT, + t_dst_index(vp, &vpi->DstReg), + t_dst_mask(vpi->DstReg.WriteMask), + t_dst_class(vpi->DstReg.File)); /* NOTE: Users swizzling might not work. */ - o_inst->src[0]=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), - t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x - t_swizzle(GET_SWZ(src[0].Swizzle, 3)), // w - VSF_IN_COMPONENT_ZERO, // z - t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y - t_src_class(src[0].File), - src[0].NegateBase ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[0].RelAddr << 4); - o_inst->src[1]=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), - t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y - t_swizzle(GET_SWZ(src[0].Swizzle, 3)), // w - VSF_IN_COMPONENT_ZERO, // z - t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x - t_src_class(src[0].File), - src[0].NegateBase ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[0].RelAddr << 4); - o_inst->src[2]=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), - t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y - t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x - VSF_IN_COMPONENT_ZERO, // z - t_swizzle(GET_SWZ(src[0].Swizzle, 3)), // w - t_src_class(src[0].File), - src[0].NegateBase ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[0].RelAddr << 4); + o_inst->src[0] = MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x + t_swizzle(GET_SWZ(src[0].Swizzle, 3)), // w + VSF_IN_COMPONENT_ZERO, // z + t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y + t_src_class(src[0]. + File), + src[0]. + NegateBase ? + VSF_FLAG_ALL : + VSF_FLAG_NONE) | + (src[0].RelAddr << 4); + o_inst->src[1] = MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y + t_swizzle(GET_SWZ(src[0].Swizzle, 3)), // w + VSF_IN_COMPONENT_ZERO, // z + t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x + t_src_class(src[0]. + File), + src[0]. + NegateBase ? + VSF_FLAG_ALL : + VSF_FLAG_NONE) | + (src[0].RelAddr << 4); + o_inst->src[2] = MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y + t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x + VSF_IN_COMPONENT_ZERO, // z + t_swizzle(GET_SWZ(src[0].Swizzle, 3)), // w + t_src_class(src[0]. + File), + src[0]. + NegateBase ? + VSF_FLAG_ALL : + VSF_FLAG_NONE) | + (src[0].RelAddr << 4); goto next; - case OPCODE_DPH://DOT RESULT 1.X Y Z W PARAM 0{} {X Y Z ONE} PARAM 0{} {X Y Z W} - o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_DOT, t_dst_index(vp, &vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - - o_inst->src[0]=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), - t_swizzle(GET_SWZ(src[0].Swizzle, 0)), - t_swizzle(GET_SWZ(src[0].Swizzle, 1)), - t_swizzle(GET_SWZ(src[0].Swizzle, 2)), - VSF_IN_COMPONENT_ONE, - t_src_class(src[0].File), - src[0].NegateBase ? VSF_FLAG_XYZ : VSF_FLAG_NONE) | (src[0].RelAddr << 4); - o_inst->src[1]=t_src(vp, &src[1]); - o_inst->src[2]=ZERO_SRC_1; + case OPCODE_DPH: //DOT RESULT 1.X Y Z W PARAM 0{} {X Y Z ONE} PARAM 0{} {X Y Z W} + o_inst->op = + MAKE_VSF_OP(R300_VPI_OUT_OP_DOT, + t_dst_index(vp, &vpi->DstReg), + t_dst_mask(vpi->DstReg.WriteMask), + t_dst_class(vpi->DstReg.File)); + + o_inst->src[0] = + MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), + t_swizzle(GET_SWZ + (src[0].Swizzle, 0)), + t_swizzle(GET_SWZ + (src[0].Swizzle, 1)), + t_swizzle(GET_SWZ + (src[0].Swizzle, 2)), + VSF_IN_COMPONENT_ONE, + t_src_class(src[0].File), + src[0]. + NegateBase ? VSF_FLAG_XYZ : + VSF_FLAG_NONE) | (src[0]. + RelAddr << 4); + o_inst->src[1] = t_src(vp, &src[1]); + o_inst->src[2] = ZERO_SRC_1; goto next; case OPCODE_XPD: @@ -744,135 +898,162 @@ static void r300_translate_vertex_shader(struct r300_vertex_program *vp, struct NOTE: might need MAD_2 */ - o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_MAD, u_temp_i, - t_dst_mask(vpi->DstReg.WriteMask), VSF_OUT_CLASS_TMP); - - o_inst->src[0]=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), - t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y - t_swizzle(GET_SWZ(src[0].Swizzle, 2)), // z - t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x - t_swizzle(GET_SWZ(src[0].Swizzle, 3)), // w - t_src_class(src[0].File), - src[0].NegateBase ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[0].RelAddr << 4); - - o_inst->src[1]=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]), - t_swizzle(GET_SWZ(src[1].Swizzle, 2)), // z - t_swizzle(GET_SWZ(src[1].Swizzle, 0)), // x - t_swizzle(GET_SWZ(src[1].Swizzle, 1)), // y - t_swizzle(GET_SWZ(src[1].Swizzle, 3)), // w - t_src_class(src[1].File), - src[1].NegateBase ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[1].RelAddr << 4); - - o_inst->src[2]=ZERO_SRC_1; + o_inst->op = MAKE_VSF_OP(R300_VPI_OUT_OP_MAD, u_temp_i, + t_dst_mask(vpi->DstReg. + WriteMask), + VSF_OUT_CLASS_TMP); + + o_inst->src[0] = MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y + t_swizzle(GET_SWZ(src[0].Swizzle, 2)), // z + t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x + t_swizzle(GET_SWZ(src[0].Swizzle, 3)), // w + t_src_class(src[0]. + File), + src[0]. + NegateBase ? + VSF_FLAG_ALL : + VSF_FLAG_NONE) | + (src[0].RelAddr << 4); + + o_inst->src[1] = MAKE_VSF_SOURCE(t_src_index(vp, &src[1]), t_swizzle(GET_SWZ(src[1].Swizzle, 2)), // z + t_swizzle(GET_SWZ(src[1].Swizzle, 0)), // x + t_swizzle(GET_SWZ(src[1].Swizzle, 1)), // y + t_swizzle(GET_SWZ(src[1].Swizzle, 3)), // w + t_src_class(src[1]. + File), + src[1]. + NegateBase ? + VSF_FLAG_ALL : + VSF_FLAG_NONE) | + (src[1].RelAddr << 4); + + o_inst->src[2] = ZERO_SRC_1; o_inst++; u_temp_i--; - o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_MAD, t_dst_index(vp, &vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - - o_inst->src[0]=MAKE_VSF_SOURCE(t_src_index(vp, &src[1]), - t_swizzle(GET_SWZ(src[1].Swizzle, 1)), // y - t_swizzle(GET_SWZ(src[1].Swizzle, 2)), // z - t_swizzle(GET_SWZ(src[1].Swizzle, 0)), // x - t_swizzle(GET_SWZ(src[1].Swizzle, 3)), // w - t_src_class(src[1].File), - (!src[1].NegateBase) ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[1].RelAddr << 4); - - o_inst->src[1]=MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), - t_swizzle(GET_SWZ(src[0].Swizzle, 2)), // z - t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x - t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y - t_swizzle(GET_SWZ(src[0].Swizzle, 3)), // w - t_src_class(src[0].File), - src[0].NegateBase ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src[0].RelAddr << 4); - - o_inst->src[2]=MAKE_VSF_SOURCE(u_temp_i+1, - VSF_IN_COMPONENT_X, - VSF_IN_COMPONENT_Y, - VSF_IN_COMPONENT_Z, - VSF_IN_COMPONENT_W, - VSF_IN_CLASS_TMP, - VSF_FLAG_NONE); + o_inst->op = + MAKE_VSF_OP(R300_VPI_OUT_OP_MAD, + t_dst_index(vp, &vpi->DstReg), + t_dst_mask(vpi->DstReg.WriteMask), + t_dst_class(vpi->DstReg.File)); + + o_inst->src[0] = MAKE_VSF_SOURCE(t_src_index(vp, &src[1]), t_swizzle(GET_SWZ(src[1].Swizzle, 1)), // y + t_swizzle(GET_SWZ(src[1].Swizzle, 2)), // z + t_swizzle(GET_SWZ(src[1].Swizzle, 0)), // x + t_swizzle(GET_SWZ(src[1].Swizzle, 3)), // w + t_src_class(src[1]. + File), + (!src[1]. + NegateBase) ? + VSF_FLAG_ALL : + VSF_FLAG_NONE) | + (src[1].RelAddr << 4); + + o_inst->src[1] = MAKE_VSF_SOURCE(t_src_index(vp, &src[0]), t_swizzle(GET_SWZ(src[0].Swizzle, 2)), // z + t_swizzle(GET_SWZ(src[0].Swizzle, 0)), // x + t_swizzle(GET_SWZ(src[0].Swizzle, 1)), // y + t_swizzle(GET_SWZ(src[0].Swizzle, 3)), // w + t_src_class(src[0]. + File), + src[0]. + NegateBase ? + VSF_FLAG_ALL : + VSF_FLAG_NONE) | + (src[0].RelAddr << 4); + + o_inst->src[2] = MAKE_VSF_SOURCE(u_temp_i + 1, + VSF_IN_COMPONENT_X, + VSF_IN_COMPONENT_Y, + VSF_IN_COMPONENT_Z, + VSF_IN_COMPONENT_W, + VSF_IN_CLASS_TMP, + VSF_FLAG_NONE); goto next; case OPCODE_RCC: - fprintf(stderr, "Dont know how to handle op %d yet\n", vpi->Opcode); + fprintf(stderr, "Dont know how to handle op %d yet\n", + vpi->Opcode); _mesa_exit(-1); - break; + break; case OPCODE_END: break; default: break; } - o_inst->op=MAKE_VSF_OP(t_opcode(vpi->Opcode), t_dst_index(vp, &vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); - - if(are_srcs_scalar){ - switch(operands){ - case 1: - o_inst->src[0]=t_src_scalar(vp, &src[0]); - o_inst->src[1]=ZERO_SRC_0; - o_inst->src[2]=ZERO_SRC_0; + o_inst->op = + MAKE_VSF_OP(t_opcode(vpi->Opcode), + t_dst_index(vp, &vpi->DstReg), + t_dst_mask(vpi->DstReg.WriteMask), + t_dst_class(vpi->DstReg.File)); + + if (are_srcs_scalar) { + switch (operands) { + case 1: + o_inst->src[0] = t_src_scalar(vp, &src[0]); + o_inst->src[1] = ZERO_SRC_0; + o_inst->src[2] = ZERO_SRC_0; break; - case 2: - o_inst->src[0]=t_src_scalar(vp, &src[0]); - o_inst->src[1]=t_src_scalar(vp, &src[1]); - o_inst->src[2]=ZERO_SRC_1; + case 2: + o_inst->src[0] = t_src_scalar(vp, &src[0]); + o_inst->src[1] = t_src_scalar(vp, &src[1]); + o_inst->src[2] = ZERO_SRC_1; break; - case 3: - o_inst->src[0]=t_src_scalar(vp, &src[0]); - o_inst->src[1]=t_src_scalar(vp, &src[1]); - o_inst->src[2]=t_src_scalar(vp, &src[2]); + case 3: + o_inst->src[0] = t_src_scalar(vp, &src[0]); + o_inst->src[1] = t_src_scalar(vp, &src[1]); + o_inst->src[2] = t_src_scalar(vp, &src[2]); break; - default: - fprintf(stderr, "scalars and op RCC not handled yet"); - _mesa_exit(-1); + default: + fprintf(stderr, + "scalars and op RCC not handled yet"); + _mesa_exit(-1); break; } - }else{ - switch(operands){ - case 1: - o_inst->src[0]=t_src(vp, &src[0]); - o_inst->src[1]=ZERO_SRC_0; - o_inst->src[2]=ZERO_SRC_0; + } else { + switch (operands) { + case 1: + o_inst->src[0] = t_src(vp, &src[0]); + o_inst->src[1] = ZERO_SRC_0; + o_inst->src[2] = ZERO_SRC_0; break; - case 2: - o_inst->src[0]=t_src(vp, &src[0]); - o_inst->src[1]=t_src(vp, &src[1]); - o_inst->src[2]=ZERO_SRC_1; + case 2: + o_inst->src[0] = t_src(vp, &src[0]); + o_inst->src[1] = t_src(vp, &src[1]); + o_inst->src[2] = ZERO_SRC_1; break; - case 3: - o_inst->src[0]=t_src(vp, &src[0]); - o_inst->src[1]=t_src(vp, &src[1]); - o_inst->src[2]=t_src(vp, &src[2]); + case 3: + o_inst->src[0] = t_src(vp, &src[0]); + o_inst->src[1] = t_src(vp, &src[1]); + o_inst->src[2] = t_src(vp, &src[2]); break; - default: - fprintf(stderr, "scalars and op RCC not handled yet"); - _mesa_exit(-1); + default: + fprintf(stderr, + "scalars and op RCC not handled yet"); + _mesa_exit(-1); break; } } - next: ; + next:; } /* Will most likely segfault before we get here... fix later. */ - if(o_inst - vp->program.body.i >= VSF_MAX_FRAGMENT_LENGTH/4) { + if (o_inst - vp->program.body.i >= VSF_MAX_FRAGMENT_LENGTH / 4) { vp->program.length = 0; vp->native = GL_FALSE; - return ; + return; } - vp->program.length=(o_inst - vp->program.body.i) * 4; + vp->program.length = (o_inst - vp->program.body.i) * 4; #if 0 fprintf(stderr, "hw program:\n"); - for(i=0; i < vp->program.length; i++) + for (i = 0; i < vp->program.length; i++) fprintf(stderr, "%08x\n", vp->program.body.d[i]); #endif } @@ -885,20 +1066,20 @@ static void position_invariant(struct gl_program *prog) gl_state_index tokens[STATE_LENGTH] = { STATE_MVP_MATRIX, 0, 0, 0, 0 }; - /* tokens[4] = matrix modifier */ + /* tokens[4] = matrix modifier */ #ifdef PREFER_DP4 - tokens[4] = 0; /* not transposed or inverted */ + tokens[4] = 0; /* not transposed or inverted */ #else tokens[4] = STATE_MATRIX_TRANSPOSE; #endif paramList = prog->Parameters; - vpi = _mesa_alloc_instructions (prog->NumInstructions + 4); - _mesa_init_instructions (vpi, prog->NumInstructions + 4); + vpi = _mesa_alloc_instructions(prog->NumInstructions + 4); + _mesa_init_instructions(vpi, prog->NumInstructions + 4); - for (i=0; i < 4; i++) { + for (i = 0; i < 4; i++) { GLint idx; - tokens[2] = tokens[3] = i; /* matrix row[i]..row[i] */ + tokens[2] = tokens[3] = i; /* matrix row[i]..row[i] */ idx = _mesa_add_state_reference(paramList, tokens); #ifdef PREFER_DP4 vpi[i].Opcode = OPCODE_DP4; @@ -950,34 +1131,35 @@ static void position_invariant(struct gl_program *prog) #endif } - _mesa_copy_instructions (&vpi[i], prog->Instructions, prog->NumInstructions); + _mesa_copy_instructions(&vpi[i], prog->Instructions, + prog->NumInstructions); free(prog->Instructions); prog->Instructions = vpi; prog->NumInstructions += 4; - vpi = &prog->Instructions[prog->NumInstructions-1]; + vpi = &prog->Instructions[prog->NumInstructions - 1]; assert(vpi->Opcode == OPCODE_END); } static void insert_wpos(struct r300_vertex_program *vp, - struct gl_program *prog, - GLuint temp_index) + struct gl_program *prog, GLuint temp_index) { struct prog_instruction *vpi; struct prog_instruction *vpi_insert; int i = 0; - vpi = _mesa_alloc_instructions (prog->NumInstructions + 2); - _mesa_init_instructions (vpi, prog->NumInstructions + 2); + vpi = _mesa_alloc_instructions(prog->NumInstructions + 2); + _mesa_init_instructions(vpi, prog->NumInstructions + 2); /* all but END */ - _mesa_copy_instructions (vpi, prog->Instructions, prog->NumInstructions - 1); + _mesa_copy_instructions(vpi, prog->Instructions, + prog->NumInstructions - 1); /* END */ - _mesa_copy_instructions (&vpi[prog->NumInstructions + 1], - &prog->Instructions[prog->NumInstructions - 1], - 1); + _mesa_copy_instructions(&vpi[prog->NumInstructions + 1], + &prog->Instructions[prog->NumInstructions - 1], + 1); vpi_insert = &vpi[prog->NumInstructions - 1]; vpi_insert[i].Opcode = OPCODE_MOV; @@ -995,7 +1177,7 @@ static void insert_wpos(struct r300_vertex_program *vp, vpi_insert[i].Opcode = OPCODE_MOV; vpi_insert[i].DstReg.File = PROGRAM_OUTPUT; - vpi_insert[i].DstReg.Index = VERT_RESULT_TEX0+vp->wpos_idx; + vpi_insert[i].DstReg.Index = VERT_RESULT_TEX0 + vp->wpos_idx; vpi_insert[i].DstReg.WriteMask = WRITEMASK_XYZW; vpi_insert[i].DstReg.CondMask = COND_TR; @@ -1009,7 +1191,7 @@ static void insert_wpos(struct r300_vertex_program *vp, prog->Instructions = vpi; prog->NumInstructions += i; - vpi = &prog->Instructions[prog->NumInstructions-1]; + vpi = &prog->Instructions[prog->NumInstructions - 1]; assert(vpi->Opcode == OPCODE_END); } @@ -1022,9 +1204,9 @@ static void pos_as_texcoord(struct r300_vertex_program *vp, /* should do something else if no temps left... */ prog->NumTemporaries++; - for(vpi = prog->Instructions; vpi->Opcode != OPCODE_END; vpi++){ - if( vpi->DstReg.File == PROGRAM_OUTPUT && - vpi->DstReg.Index == VERT_RESULT_HPOS ){ + for (vpi = prog->Instructions; vpi->Opcode != OPCODE_END; vpi++) { + if (vpi->DstReg.File == PROGRAM_OUTPUT && + vpi->DstReg.Index == VERT_RESULT_HPOS) { vpi->DstReg.File = PROGRAM_TEMPORARY; vpi->DstReg.Index = tempregi; } @@ -1032,9 +1214,10 @@ static void pos_as_texcoord(struct r300_vertex_program *vp, insert_wpos(vp, prog, tempregi); } -static struct r300_vertex_program *build_program(struct r300_vertex_program_key *wanted_key, - struct gl_vertex_program *mesa_vp, - GLint wpos_idx) +static struct r300_vertex_program *build_program(struct r300_vertex_program_key + *wanted_key, + struct gl_vertex_program + *mesa_vp, GLint wpos_idx) { struct r300_vertex_program *vp; @@ -1043,16 +1226,16 @@ static struct r300_vertex_program *build_program(struct r300_vertex_program_key vp->wpos_idx = wpos_idx; - if(mesa_vp->IsPositionInvariant) { + if (mesa_vp->IsPositionInvariant) { position_invariant(&mesa_vp->Base); } - if(wpos_idx > -1) + if (wpos_idx > -1) pos_as_texcoord(vp, &mesa_vp->Base); assert(mesa_vp->Base.NumInstructions); - vp->num_temporaries=mesa_vp->Base.NumTemporaries; + vp->num_temporaries = mesa_vp->Base.NumTemporaries; r300_translate_vertex_shader(vp, mesa_vp->Base.Instructions); @@ -1075,12 +1258,12 @@ void r300_select_vertex_shader(r300ContextPtr r300) wanted_key.OutputsWritten |= 1 << VERT_RESULT_HPOS; wpos_idx = -1; - if (InputsRead & FRAG_BIT_WPOS){ + if (InputsRead & FRAG_BIT_WPOS) { for (i = 0; i < ctx->Const.MaxTextureUnits; i++) if (!(InputsRead & (FRAG_BIT_TEX0 << i))) break; - if(i == ctx->Const.MaxTextureUnits){ + if (i == ctx->Const.MaxTextureUnits) { fprintf(stderr, "\tno free texcoord found\n"); _mesa_exit(-1); } @@ -1092,26 +1275,27 @@ void r300_select_vertex_shader(r300ContextPtr r300) if (InputsRead & FRAG_BIT_COL0) wanted_key.OutputsWritten |= 1 << VERT_RESULT_COL0; - if ((InputsRead & FRAG_BIT_COL1) /*|| - (InputsRead & FRAG_BIT_FOGC)*/) + if ((InputsRead & FRAG_BIT_COL1) /*|| + (InputsRead & FRAG_BIT_FOGC) */ ) wanted_key.OutputsWritten |= 1 << VERT_RESULT_COL1; for (i = 0; i < ctx->Const.MaxTextureUnits; i++) if (InputsRead & (FRAG_BIT_TEX0 << i)) - wanted_key.OutputsWritten |= 1 << (VERT_RESULT_TEX0 + i); + wanted_key.OutputsWritten |= + 1 << (VERT_RESULT_TEX0 + i); wanted_key.InputsRead = vpc->mesa_program.Base.InputsRead; - if(vpc->mesa_program.IsPositionInvariant) { + if (vpc->mesa_program.IsPositionInvariant) { /* we wan't position don't we ? */ wanted_key.InputsRead |= (1 << VERT_ATTRIB_POS); } for (vp = vpc->progs; vp; vp = vp->next) - if (_mesa_memcmp(&vp->key, &wanted_key, sizeof(wanted_key)) == 0) { + if (_mesa_memcmp(&vp->key, &wanted_key, sizeof(wanted_key)) == + 0) { r300->selected_vp = vp; - return ; + return; } - //_mesa_print_program(&vpc->mesa_program.Base); vp = build_program(&wanted_key, &vpc->mesa_program, wpos_idx); diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.h b/src/mesa/drivers/dri/r300/r300_vertprog.h index 005fca976b6..252d5a901f4 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.h +++ b/src/mesa/drivers/dri/r300/r300_vertprog.h @@ -20,7 +20,6 @@ typedef struct { #define VSF_OUT_CLASS_ADDR 1 #define VSF_OUT_CLASS_RESULT 2 - /* first DWORD of an instruction */ /* possible operations: @@ -57,7 +56,7 @@ typedef struct { | ((comp_z)< Date: Wed, 9 May 2007 04:20:35 +0000 Subject: r300: Don't indent the tables in r300_texstate.c. --- src/mesa/drivers/dri/r300/r300_texstate.c | 170 +++++++++++++++--------------- 1 file changed, 87 insertions(+), 83 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index b17652e4ddf..6a104719269 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -55,96 +55,100 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define _ASSIGN(entry, format) \ [ MESA_FORMAT_ ## entry ] = { format, 0, 1} +/* + * Note that the _REV formats are the same as the non-REV formats. This is + * because the REV and non-REV formats are identical as a byte string, but + * differ when accessed as 16-bit or 32-bit words depending on the endianness of + * the host. Since the textures are transferred to the R300 as a byte string + * (i.e. without any byte-swapping), the R300 sees the REV and non-REV formats + * identically. -- paulus + */ + static const struct { GLuint format, filter, flag; } tx_table_be[] = { - /* - * Note that the _REV formats are the same as the non-REV formats. - * This is because the REV and non-REV formats are identical as a - * byte string, but differ when accessed as 16-bit or 32-bit words - * depending on the endianness of the host. Since the textures are - * transferred to the R300 as a byte string (i.e. without any - * byte-swapping), the R300 sees the REV and non-REV formats - * identically. -- paulus - */ - _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, 0xffffffff), - _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-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, 0xffffffff), + _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 { GLuint format, filter, flag; } tx_table_le[] = { - _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(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-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(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* */ +}; #undef _ASSIGN -- cgit v1.2.3 From 93e957cc65003367b70f23611ef58c1c2bb64b7c Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 04:25:27 +0000 Subject: r300: Removed some disabled R200 code from the R300 driver. --- src/mesa/drivers/dri/r300/r300_tex.c | 2 -- src/mesa/drivers/dri/r300/r300_texstate.c | 51 +------------------------------ 2 files changed, 1 insertion(+), 52 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c index 027950bb2db..3eb575cbddb 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.c +++ b/src/mesa/drivers/dri/r300/r300_tex.c @@ -240,11 +240,9 @@ static void r300SetTexFilter(r300TexObjPtr t, GLenum minf, GLenum magf) switch (magf) { case GL_NEAREST: t->filter |= R300_TX_MAG_FILTER_NEAREST; - /*t->format_x |= R200_VOLUME_FILTER_NEAREST;*/ break; case GL_LINEAR: t->filter |= R300_TX_MAG_FILTER_LINEAR; - /*t->format_x |= R200_VOLUME_FILTER_LINEAR;*/ break; } } diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index 6a104719269..9e72b6fa6e0 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -340,37 +340,6 @@ static void r300SetTexImages(r300ContextPtr rmesa, t->base.totalSize *= 6; /* total texmem needed */ } - /* Hardware state: - */ -#if 0 - t->format &= ~(R200_TXFORMAT_WIDTH_MASK | - R200_TXFORMAT_HEIGHT_MASK | - R200_TXFORMAT_CUBIC_MAP_ENABLE | - R200_TXFORMAT_F5_WIDTH_MASK | - R200_TXFORMAT_F5_HEIGHT_MASK); - t->format |= ((log2Width << R200_TXFORMAT_WIDTH_SHIFT) | - (log2Height << R200_TXFORMAT_HEIGHT_SHIFT)); -#endif -#if 0 - t->format_x &= ~(R200_DEPTH_LOG2_MASK | R200_TEXCOORD_MASK); - if (tObj->Target == GL_TEXTURE_3D) { - t->format_x |= (log2Depth << R200_DEPTH_LOG2_SHIFT); - t->format_x |= R200_TEXCOORD_VOLUME; - } else if (tObj->Target == GL_TEXTURE_CUBE_MAP) { - ASSERT(log2Width == log2Height); - t->format |= R300_TX_FORMAT_CUBIC_MAP; - - t->format_x |= R200_TEXCOORD_CUBIC_ENV; - t->pp_cubic_faces = ((log2Width << R200_FACE_WIDTH_1_SHIFT) | - (log2Height << R200_FACE_HEIGHT_1_SHIFT) | - (log2Width << R200_FACE_WIDTH_2_SHIFT) | - (log2Height << R200_FACE_HEIGHT_2_SHIFT) | - (log2Width << R200_FACE_WIDTH_3_SHIFT) | - (log2Height << R200_FACE_HEIGHT_3_SHIFT) | - (log2Width << R200_FACE_WIDTH_4_SHIFT) | - (log2Height << R200_FACE_HEIGHT_4_SHIFT)); - } -#endif if (tObj->Target == GL_TEXTURE_CUBE_MAP) { ASSERT(log2Width == log2Height); t->format |= R300_TX_FORMAT_CUBIC_MAP; @@ -439,18 +408,9 @@ static GLboolean enable_tex_3d(GLcontext * ctx, int unit) struct gl_texture_object *tObj = texUnit->_Current; r300TexObjPtr t = (r300TexObjPtr) tObj->DriverData; - /* Need to load the 3d images associated with this unit. - */ -#if 0 - if (t->format & R200_TXFORMAT_NON_POWER2) { - t->format &= ~R200_TXFORMAT_NON_POWER2; - t->base.dirty_images[0] = ~0; - } -#endif ASSERT(tObj->Target == GL_TEXTURE_3D); - /* R100 & R200 do not support mipmaps for 3D textures. - */ + /* r300 does not support mipmaps for 3D textures. */ if ((tObj->MinFilter != GL_NEAREST) && (tObj->MinFilter != GL_LINEAR)) { return GL_FALSE; } @@ -475,15 +435,6 @@ static GLboolean enable_tex_cube(GLcontext * ctx, int unit) r300TexObjPtr t = (r300TexObjPtr) tObj->DriverData; GLuint face; - /* Need to load the 2d images associated with this unit. - */ -#if 0 - if (t->format & R200_TXFORMAT_NON_POWER2) { - t->format &= ~R200_TXFORMAT_NON_POWER2; - for (face = 0; face < 6; face++) - t->base.dirty_images[face] = ~0; - } -#endif ASSERT(tObj->Target == GL_TEXTURE_CUBE_MAP); if (t->base.dirty_images[0] || t->base.dirty_images[1] || -- cgit v1.2.3 From 5d61cfd1fd4032ae08513979bfd6d7dc1afa9c35 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 04:27:31 +0000 Subject: r300: Removed a disabled/obsolete e32 in the AOS function. --- src/mesa/drivers/dri/r300/r300_emit.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h index e616986c08f..e4aecba9483 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.h +++ b/src/mesa/drivers/dri/r300/r300_emit.h @@ -246,9 +246,6 @@ fire_AOS(r300ContextPtr rmesa, int vertex_count, int type) check_space(9); start_packet3(RADEON_CP_PACKET3_3D_DRAW_VBUF_2, 0); -#ifdef NOTNEEDED_ANYMORE - e32(0x840c0024); -#endif e32(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_LIST | (vertex_count << 16) | type); } -- cgit v1.2.3 From c9b87b8ad880755fb522cf4abd6d2499022312cf Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 04:30:16 +0000 Subject: r300: Removed the unused immediate vertices mode macro. Immediate vertices mode hasn't been supported since early CVS versions of the R300 driver. --- src/mesa/drivers/dri/r300/r300_emit.h | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h index e4aecba9483..cf428524d6f 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.h +++ b/src/mesa/drivers/dri/r300/r300_emit.h @@ -272,19 +272,4 @@ fire_AOS(r300ContextPtr rmesa, int vertex_count, int type) type); \ } while (0); -/** - * Interestingly enough this ones needs the call to setup_AOS, even thought - * some of the data so setup is not needed and some is not as arbitrary - * as when used by DRAW_VBUF_2 or DRAW_INDX_2 - */ -#define start_immediate_packet(vertex_count, type, vertex_size) \ - do { \ - int _vc; \ - _vc = (vertex_count); \ - start_packet3(RADEON_CP_PACKET3_3D_DRAW_IMMD_2, \ - _vc*(vertex_size)); \ - e32(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_EMBEDDED | \ - (_vc<<16) | type); \ - } while (0); - #endif -- cgit v1.2.3 From 32c8d002d02194241f4b64234f5dcd6652a1f58d Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 13:55:14 +0000 Subject: r300: Indented r300_context.[ch]. --- src/mesa/drivers/dri/r300/r300_context.c | 118 +++++++++++-------- src/mesa/drivers/dri/r300/r300_context.h | 193 +++++++++++++++---------------- 2 files changed, 165 insertions(+), 146 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index dd348e223c2..4092ebe0101 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -70,8 +70,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "xmlpool.h" /* for symbolic values of enum-type options */ /* hw_tcl_on derives from future_hw_tcl_on when its safe to change it. */ -int future_hw_tcl_on=1; -int hw_tcl_on=1; +int future_hw_tcl_on = 1; +int hw_tcl_on = 1; #define need_GL_EXT_stencil_two_side #define need_GL_ARB_multisample @@ -88,6 +88,7 @@ int hw_tcl_on=1; #include "extension_helper.h" const struct dri_extension card_extensions[] = { + /* *INDENT-OFF* */ {"GL_ARB_multisample", GL_ARB_multisample_functions}, {"GL_ARB_multitexture", NULL}, {"GL_ARB_texture_border_clamp", NULL}, @@ -126,6 +127,7 @@ const struct dri_extension card_extensions[] = { {"GL_NV_vertex_program", GL_NV_vertex_program_functions}, {"GL_SGIS_generate_mipmap", NULL}, {NULL, NULL} + /* *INDENT-ON* */ }; extern struct tnl_pipeline_stage _r300_render_stage; @@ -164,7 +166,6 @@ static const struct tnl_pipeline_stage *r300_pipeline[] = { 0, }; - /* Create the device specific rendering context. */ GLboolean r300CreateContext(const __GLcontextModes * glVisual, @@ -183,7 +184,7 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, assert(screen); /* Allocate the R300 context */ - r300 = (r300ContextPtr)CALLOC(sizeof(*r300)); + r300 = (r300ContextPtr) CALLOC(sizeof(*r300)); if (!r300) return GL_FALSE; @@ -219,13 +220,15 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, } #endif if (!radeonInitContext(&r300->radeon, &functions, - glVisual, driContextPriv, sharedContextPrivate)) { + glVisual, driContextPriv, + sharedContextPrivate)) { FREE(r300); return GL_FALSE; } /* Init r300 context data */ - r300->dma.buf0_address = r300->radeon.radeonScreen->buffers->list[0].address; + r300->dma.buf0_address = + r300->radeon.radeonScreen->buffers->list[0].address; (void)memset(r300->texture_heaps, 0, sizeof(r300->texture_heaps)); make_empty_list(&r300->swapped); @@ -233,6 +236,7 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, r300->nr_heaps = 1 /* screen->numTexHeaps */ ; assert(r300->nr_heaps < RADEON_NR_TEX_HEAPS); for (i = 0; i < r300->nr_heaps; i++) { + /* *INDENT-OFF* */ r300->texture_heaps[i] = driCreateTextureHeap(i, r300, screen-> texSize[i], 12, @@ -248,9 +252,10 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, (destroy_texture_object_t *) r300DestroyTexObj); + /* *INDENT-ON* */ } r300->texture_depth = driQueryOptioni(&r300->radeon.optionCache, - "texture_depth"); + "texture_depth"); if (r300->texture_depth == DRI_CONF_TEXTURE_DEPTH_FB) r300->texture_depth = (screen->cpp == 4) ? DRI_CONF_TEXTURE_DEPTH_32 : DRI_CONF_TEXTURE_DEPTH_16; @@ -262,12 +267,13 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, ctx = r300->radeon.glCtx; - ctx->Const.MaxTextureImageUnits = driQueryOptioni(&r300->radeon.optionCache, - "texture_image_units"); - ctx->Const.MaxTextureCoordUnits = driQueryOptioni(&r300->radeon.optionCache, - "texture_coord_units"); - ctx->Const.MaxTextureUnits = MIN2(ctx->Const.MaxTextureImageUnits, - ctx->Const.MaxTextureCoordUnits); + ctx->Const.MaxTextureImageUnits = + driQueryOptioni(&r300->radeon.optionCache, "texture_image_units"); + ctx->Const.MaxTextureCoordUnits = + driQueryOptioni(&r300->radeon.optionCache, "texture_coord_units"); + ctx->Const.MaxTextureUnits = + MIN2(ctx->Const.MaxTextureImageUnits, + ctx->Const.MaxTextureCoordUnits); ctx->Const.MaxTextureMaxAnisotropy = 16.0; ctx->Const.MinPointSize = 1.0; @@ -283,7 +289,8 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, #ifdef USER_BUFFERS /* Needs further modifications */ #if 0 - ctx->Const.MaxArrayLockSize = (/*512*/RADEON_BUFFER_SIZE*16*1024) / (4*4); + ctx->Const.MaxArrayLockSize = + ( /*512 */ RADEON_BUFFER_SIZE * 16 * 1024) / (4 * 4); #endif #endif @@ -313,39 +320,48 @@ 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; + ctx->Const.VertexProgram.MaxInstructions = VSF_MAX_FRAGMENT_LENGTH / 4; + ctx->Const.VertexProgram.MaxNativeInstructions = + VSF_MAX_FRAGMENT_LENGTH / 4; + ctx->Const.VertexProgram.MaxNativeAttribs = 16; /* r420 */ + ctx->Const.VertexProgram.MaxTemps = 32; + ctx->Const.VertexProgram.MaxNativeTemps = + /*VSF_MAX_FRAGMENT_TEMPS */ 32; + ctx->Const.VertexProgram.MaxNativeParameters = 256; /* r420 */ + ctx->Const.VertexProgram.MaxNativeAddressRegs = 1; ctx->Const.FragmentProgram.MaxNativeTemps = PFS_NUM_TEMP_REGS; - ctx->Const.FragmentProgram.MaxNativeAttribs = 11; /* copy i915... */ + ctx->Const.FragmentProgram.MaxNativeAttribs = 11; /* copy i915... */ ctx->Const.FragmentProgram.MaxNativeParameters = PFS_NUM_CONST_REGS; ctx->Const.FragmentProgram.MaxNativeAluInstructions = PFS_MAX_ALU_INST; ctx->Const.FragmentProgram.MaxNativeTexInstructions = PFS_MAX_TEX_INST; - ctx->Const.FragmentProgram.MaxNativeInstructions = PFS_MAX_ALU_INST+PFS_MAX_TEX_INST; - ctx->Const.FragmentProgram.MaxNativeTexIndirections = PFS_MAX_TEX_INDIRECT; - ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* and these are?? */ + ctx->Const.FragmentProgram.MaxNativeInstructions = + PFS_MAX_ALU_INST + PFS_MAX_TEX_INST; + ctx->Const.FragmentProgram.MaxNativeTexIndirections = + PFS_MAX_TEX_INDIRECT; + ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* and these are?? */ _tnl_ProgramCacheInit(ctx); ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE; driInitExtensions(ctx, card_extensions, GL_TRUE); - if (driQueryOptionb(&r300->radeon.optionCache, "disable_stencil_two_side")) - _mesa_disable_extension(ctx, "GL_EXT_stencil_two_side"); - - if (r300->radeon.glCtx->Mesa_DXTn && !driQueryOptionb (&r300->radeon.optionCache, "disable_s3tc")) { - _mesa_enable_extension( ctx, "GL_EXT_texture_compression_s3tc" ); - _mesa_enable_extension( ctx, "GL_S3_s3tc" ); - } - else if (driQueryOptionb (&r300->radeon.optionCache, "force_s3tc_enable")) { - _mesa_enable_extension( ctx, "GL_EXT_texture_compression_s3tc" ); + if (driQueryOptionb + (&r300->radeon.optionCache, "disable_stencil_two_side")) + _mesa_disable_extension(ctx, "GL_EXT_stencil_two_side"); + + if (r300->radeon.glCtx->Mesa_DXTn + && !driQueryOptionb(&r300->radeon.optionCache, "disable_s3tc")) { + _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc"); + _mesa_enable_extension(ctx, "GL_S3_s3tc"); + } else + if (driQueryOptionb(&r300->radeon.optionCache, "force_s3tc_enable")) + { + _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc"); } - r300->disable_lowimpact_fallback = driQueryOptionb(&r300->radeon.optionCache, "disable_lowimpact_fallback"); + r300->disable_lowimpact_fallback = + driQueryOptionb(&r300->radeon.optionCache, + "disable_lowimpact_fallback"); radeonInitSpanFuncs(ctx); r300InitCmdBuf(r300); @@ -367,10 +383,12 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, if (tcl_mode == DRI_CONF_TCL_SW || !(r300->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) { if (r300->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL) { - r300->radeon.radeonScreen->chip_flags &= ~RADEON_CHIPSET_TCL; + r300->radeon.radeonScreen->chip_flags &= + ~RADEON_CHIPSET_TCL; fprintf(stderr, "Disabling HW TCL support\n"); } - TCL_FALLBACK(r300->radeon.glCtx, RADEON_TCL_FALLBACK_TCL_DISABLE, 1); + TCL_FALLBACK(r300->radeon.glCtx, + RADEON_TCL_FALLBACK_TCL_DISABLE, 1); } return GL_TRUE; @@ -378,7 +396,7 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, static void r300FreeGartAllocations(r300ContextPtr r300) { - int i, ret, tries=0, done_age, in_use=0; + int i, ret, tries = 0, done_age, in_use = 0; drm_radeon_mem_free_t memfree; memfree.region = RADEON_MEM_REGION_GART; @@ -398,7 +416,7 @@ static void r300FreeGartAllocations(r300ContextPtr r300) if (in_use) r300FlushCmdBuf(r300, __FUNCTION__); - done_age = radeonGetAge((radeonContextPtr)r300); + done_age = radeonGetAge((radeonContextPtr) r300); for (i = r300->rmm->u_last; i > 0; i--) { if (r300->rmm->u_list[i].ptr == NULL) { @@ -413,19 +431,20 @@ static void r300FreeGartAllocations(r300ContextPtr r300) assert(r300->rmm->u_list[i].h_pending == 0); tries = 0; - while(r300->rmm->u_list[i].age > done_age && tries++ < 1000) { + while (r300->rmm->u_list[i].age > done_age && tries++ < 1000) { usleep(10); - done_age = radeonGetAge((radeonContextPtr)r300); + done_age = radeonGetAge((radeonContextPtr) r300); } if (tries >= 1000) { WARN_ONCE("Failed to idle region!"); } memfree.region_offset = (char *)r300->rmm->u_list[i].ptr - - (char *)r300->radeon.radeonScreen->gartTextures.map; + (char *)r300->radeon.radeonScreen->gartTextures.map; ret = drmCommandWrite(r300->radeon.radeonScreen->driScreen->fd, - DRM_RADEON_FREE, &memfree, sizeof(memfree)); + DRM_RADEON_FREE, &memfree, + sizeof(memfree)); if (ret) { fprintf(stderr, "Failed to free at %p\nret = %s\n", r300->rmm->u_list[i].ptr, strerror(-ret)); @@ -439,14 +458,15 @@ static void r300FreeGartAllocations(r300ContextPtr r300) LOCK_HARDWARE(&(r300->radeon)); ret = mmFreeMem(r300->rmm->u_list[i].fb); UNLOCK_HARDWARE(&(r300->radeon)); - if (ret) fprintf(stderr, "failed to free!\n"); + if (ret) + fprintf(stderr, "failed to free!\n"); r300->rmm->u_list[i].fb = NULL; } r300->rmm->u_list[i].ref_count = 0; } } - r300->rmm->u_head = i; -#endif /* USER_BUFFERS */ + r300->rmm->u_head = i; +#endif /* USER_BUFFERS */ } /* Destroy the device specific context. @@ -474,7 +494,8 @@ void r300DestroyContext(__DRIcontextPrivate * driContextPriv) if (r300) { GLboolean release_texture_heaps; - release_texture_heaps = (r300->radeon.glCtx->Shared->RefCount == 1); + release_texture_heaps = + (r300->radeon.glCtx->Shared->RefCount == 1); _swsetup_DestroyContext(r300->radeon.glCtx); _tnl_ProgramCacheDestroy(r300->radeon.glCtx); _tnl_DestroyContext(r300->radeon.glCtx); @@ -482,7 +503,8 @@ void r300DestroyContext(__DRIcontextPrivate * driContextPriv) _swrast_DestroyContext(r300->radeon.glCtx); if (r300->dma.current.buf) { - r300ReleaseDmaRegion(r300, &r300->dma.current, __FUNCTION__ ); + r300ReleaseDmaRegion(r300, &r300->dma.current, + __FUNCTION__); #ifndef USER_BUFFERS r300FlushCmdBuf(r300, __FUNCTION__); #endif diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 0473bc23be8..4cc3352ab0f 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -97,13 +97,15 @@ typedef struct r300_context *r300ContextPtr; static __inline__ uint32_t r300PackFloat32(float fl) { - union { float fl; uint32_t u; } u; + union { + float fl; + uint32_t u; + } u; u.fl = fl; return u.u; } - /************ DMA BUFFERS **************/ /* Need refcounting on dma buffers: @@ -128,10 +130,10 @@ struct r300_dma_region { char *address; /* == buf->address */ int start, end, ptr; /* offsets from start of buf */ - 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 */ + 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 { @@ -173,16 +175,15 @@ struct r300_tex_obj { drm_radeon_tex_image_t image[6][RADEON_MAX_TEXTURE_LEVELS]; /* Six, for the cube faces */ - - GLuint pitch; /* this isn't sent to hardware just used in calculations */ + 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 */ GLuint filter; GLuint filter_1; GLuint pitch_reg; - GLuint size; /* npot only */ + GLuint size; /* npot only */ GLuint format; - GLuint offset; /* Image location in the card's address space. + GLuint offset; /* Image location in the card's address space. All cube faces follow. */ GLuint unknown4; GLuint unknown5; @@ -196,10 +197,9 @@ struct r300_tex_obj { GLuint pp_cubic_faces; /* cube face 1,2,3,4 log2 sizes */ GLuint format_x; - GLboolean border_fallback; - GLuint tile_bits; /* hw texture tile bits used on this texture */ + GLuint tile_bits; /* hw texture tile bits used on this texture */ }; struct r300_texture_env_state { @@ -208,7 +208,6 @@ struct r300_texture_env_state { GLenum envMode; }; - /* The blit width for texture uploads */ #define R300_BLIT_WIDTH_BYTES 1024 @@ -216,7 +215,7 @@ struct r300_texture_env_state { struct r300_texture_state { struct r300_texture_env_state unit[R300_MAX_TEXTURE_UNITS]; - int tc_count; /* number of incoming texture coordinates from VAP */ + int tc_count; /* number of incoming texture coordinates from VAP */ }; /** @@ -228,16 +227,15 @@ struct r300_texture_state { */ struct r300_state_atom { struct r300_state_atom *next, *prev; - const char* name; /* for debug */ + const char *name; /* for debug */ int cmd_size; /* maximum size in dwords */ GLuint idx; /* index in an array (e.g. textures) */ - uint32_t* cmd; + uint32_t *cmd; GLboolean dirty; - int (*check)(r300ContextPtr, struct r300_state_atom* atom); + int (*check) (r300ContextPtr, struct r300_state_atom * atom); }; - #define R300_VPT_CMD_0 0 #define R300_VPT_XSCALE 1 #define R300_VPT_XOFFSET 2 @@ -247,7 +245,7 @@ struct r300_state_atom { #define R300_VPT_ZOFFSET 6 #define R300_VPT_CMDSIZE 7 -#define R300_VIR_CMD_0 0 /* vir is variable size (at least 1) */ +#define R300_VIR_CMD_0 0 /* vir is variable size (at least 1) */ #define R300_VIR_CNTL_0 1 #define R300_VIR_CNTL_1 2 #define R300_VIR_CNTL_2 3 @@ -268,7 +266,6 @@ struct r300_state_atom { #define R300_VOF_CNTL_1 2 #define R300_VOF_CMDSIZE 3 - #define R300_PVS_CMD_0 0 #define R300_PVS_CNTL_1 1 #define R300_PVS_CNTL_2 2 @@ -318,7 +315,7 @@ struct r300_state_atom { #define R300_RI_INTERP_7 8 #define R300_RI_CMDSIZE 9 -#define R300_RR_CMD_0 0 /* rr is variable size (at least 1) */ +#define R300_RR_CMD_0 0 /* rr is variable size (at least 1) */ #define R300_RR_ROUTE_0 1 #define R300_RR_ROUTE_1 2 #define R300_RR_ROUTE_2 3 @@ -400,11 +397,11 @@ struct r300_state_atom { #define R300_VPI_CMD_0 0 #define R300_VPI_INSTR_0 1 -#define R300_VPI_CMDSIZE 1025 /* 256 16 byte instructions */ +#define R300_VPI_CMDSIZE 1025 /* 256 16 byte instructions */ #define R300_VPP_CMD_0 0 #define R300_VPP_PARAM_0 1 -#define R300_VPP_CMDSIZE 1025 /* 256 4-component parameters */ +#define R300_VPP_CMDSIZE 1025 /* 256 4-component parameters */ #define R300_VPS_CMD_0 0 #define R300_VPS_ZERO_0 1 @@ -426,54 +423,54 @@ struct r300_state_atom { struct r300_hw_state { struct r300_state_atom atomlist; - GLboolean is_dirty; - GLboolean all_dirty; - int max_state_size; /* in dwords */ + GLboolean is_dirty; + GLboolean all_dirty; + int max_state_size; /* in dwords */ struct r300_state_atom vpt; /* viewport (1D98) */ struct r300_state_atom vap_cntl; - struct r300_state_atom vof; /* VAP output format register 0x2090 */ + struct r300_state_atom vof; /* VAP output format register 0x2090 */ struct r300_state_atom vte; /* (20B0) */ struct r300_state_atom unk2134; /* (2134) */ struct r300_state_atom vap_cntl_status; struct r300_state_atom vir[2]; /* vap input route (2150/21E0) */ 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 unk2288; /* (2288) */ + struct r300_state_atom unk21DC; /* (21DC) */ + struct r300_state_atom unk221C; /* (221C) */ + struct r300_state_atom unk2220; /* (2220) */ + struct r300_state_atom unk2288; /* (2288) */ struct r300_state_atom pvs; /* pvs_cntl (22D0) */ - struct r300_state_atom gb_enable; /* (4008) */ - struct r300_state_atom gb_misc; /* Multisampling position shifts ? (4010) */ - struct r300_state_atom unk4200; /* (4200) */ - struct r300_state_atom unk4214; /* (4214) */ + struct r300_state_atom gb_enable; /* (4008) */ + struct r300_state_atom gb_misc; /* Multisampling position shifts ? (4010) */ + struct r300_state_atom unk4200; /* (4200) */ + struct r300_state_atom unk4214; /* (4214) */ struct r300_state_atom ps; /* pointsize (421C) */ - struct r300_state_atom unk4230; /* (4230) */ + struct r300_state_atom unk4230; /* (4230) */ struct r300_state_atom lcntl; /* line control */ - struct r300_state_atom unk4260; /* (4260) */ + struct r300_state_atom unk4260; /* (4260) */ struct r300_state_atom shade; struct r300_state_atom polygon_mode; struct r300_state_atom fogp; /* fog parameters (4294) */ - struct r300_state_atom unk429C; /* (429C) */ + struct r300_state_atom unk429C; /* (429C) */ struct r300_state_atom zbias_cntl; struct r300_state_atom zbs; /* zbias (42A4) */ struct r300_state_atom occlusion_cntl; struct r300_state_atom cul; /* cull cntl (42B8) */ - struct r300_state_atom unk42C0; /* (42C0) */ + struct r300_state_atom unk42C0; /* (42C0) */ struct r300_state_atom rc; /* rs control (4300) */ struct r300_state_atom ri; /* rs interpolators (4310) */ struct r300_state_atom rr; /* rs route (4330) */ struct r300_state_atom unk43A4; /* (43A4) */ struct r300_state_atom unk43E8; /* (43E8) */ struct r300_state_atom fp; /* fragment program cntl + nodes (4600) */ - struct r300_state_atom fpt; /* texi - (4620) */ + struct r300_state_atom fpt; /* texi - (4620) */ struct r300_state_atom unk46A4; /* (46A4) */ struct r300_state_atom fpi[4]; /* fp instructions (46C0/47C0/48C0/49C0) */ struct r300_state_atom fogs; /* fog state (4BC0) */ struct r300_state_atom fogc; /* fog color (4BC8) */ struct r300_state_atom at; /* alpha test (4BD4) */ struct r300_state_atom unk4BD8; /* (4BD8) */ - struct r300_state_atom fpp; /* 0x4C00 and following */ + struct r300_state_atom fpp; /* 0x4C00 and following */ struct r300_state_atom unk4E00; /* (4E00) */ struct r300_state_atom bld; /* blending (4E04) */ struct r300_state_atom cmk; /* colormask (4E0C) */ @@ -493,11 +490,11 @@ struct r300_hw_state { struct r300_state_atom vpi; /* vp instructions */ struct r300_state_atom vpp; /* vp parameters */ struct r300_state_atom vps; /* vertex point size (?) */ - /* 8 texture units */ - /* the state is grouped by function and not by - texture unit. This makes single unit updates - really awkward - we are much better off - updating the whole thing at once */ + /* 8 texture units */ + /* the state is grouped by function and not by + texture unit. This makes single unit updates + really awkward - we are much better off + updating the whole thing at once */ struct { struct r300_state_atom filter; struct r300_state_atom filter_1; @@ -507,11 +504,10 @@ struct r300_hw_state { struct r300_state_atom offset; struct r300_state_atom chroma_key; struct r300_state_atom border_color; - } tex; + } tex; struct r300_state_atom txe; /* tex enable (4104) */ }; - /** * This structure holds the command buffer while it is being constructed. * @@ -520,13 +516,12 @@ struct r300_hw_state { * otherwise. */ struct r300_cmdbuf { - int size; /* DWORDs allocated for buffer */ - uint32_t* cmd_buf; - int count_used; /* DWORDs filled so far */ - int count_reemit; /* size of re-emission batch */ + int size; /* DWORDs allocated for buffer */ + uint32_t *cmd_buf; + int count_used; /* DWORDs filled so far */ + int count_reemit; /* size of re-emission batch */ }; - /** * State cache */ @@ -558,9 +553,9 @@ struct r300_vertex_shader_fragment { union { GLuint d[VSF_MAX_FRAGMENT_LENGTH]; float f[VSF_MAX_FRAGMENT_LENGTH]; - VERTEX_SHADER_INSTRUCTION i[VSF_MAX_FRAGMENT_LENGTH/4]; - } body; - }; + VERTEX_SHADER_INSTRUCTION i[VSF_MAX_FRAGMENT_LENGTH / 4]; + } body; +}; #define VSF_DEST_PROGRAM 0x0 #define VSF_DEST_MATRIX0 0x200 @@ -578,15 +573,15 @@ struct r300_vertex_shader_state { struct r300_vertex_shader_fragment unknown2; int program_start; - int unknown_ptr1; /* pointer within program space */ + int unknown_ptr1; /* pointer within program space */ int program_end; int param_offset; int param_count; - int unknown_ptr2; /* pointer within program space */ - int unknown_ptr3; /* pointer within program space */ - }; + int unknown_ptr2; /* pointer within program space */ + int unknown_ptr3; /* pointer within program space */ +}; extern int hw_tcl_on; @@ -596,7 +591,6 @@ extern int hw_tcl_on; /* Should but doesnt work */ //#define CURRENT_VERTEX_SHADER(ctx) (R300_CONTEXT(ctx)->curr_vp) - /* r300_vertex_shader_state and r300_vertex_program should probably be merged together someday. * Keeping them them seperate for now should ensure fixed pipeline keeps functioning properly. */ @@ -614,7 +608,7 @@ struct r300_vertex_program { struct r300_vertex_shader_fragment program; int pos_end; - int num_temporaries; /* Number of temp vars used by program */ + int num_temporaries; /* Number of temp vars used by program */ int wpos_idx; int inputs[VERT_ATTRIB_MAX]; int outputs[VERT_RESULT_MAX]; @@ -624,7 +618,7 @@ struct r300_vertex_program { }; struct r300_vertex_program_cont { - struct gl_vertex_program mesa_program; /* Must be first */ + struct gl_vertex_program mesa_program; /* Must be first */ struct r300_vertex_shader_fragment params; struct r300_vertex_program *progs; }; @@ -637,8 +631,8 @@ struct r300_vertex_program_cont { /* Mapping Mesa registers to R300 temporaries */ struct reg_acc { - int reg; /* Assigned hw temp */ - unsigned int refcount; /* Number of uses by mesa program */ + int reg; /* Assigned hw temp */ + unsigned int refcount; /* Number of uses by mesa program */ }; /** @@ -669,7 +663,6 @@ struct reg_lifetime { int scalar_lastread; }; - /** * Store usage information about an ALU instruction slot during the * compilation of a fragment program. @@ -695,7 +688,7 @@ struct r300_pfs_compile_slot { * Store information during compilation of fragment programs. */ struct r300_pfs_compile_state { - int nrslots; /* number of ALU slots used so far */ + int nrslots; /* number of ALU slots used so far */ /* Track which (parts of) slots are already filled with instructions */ struct r300_pfs_compile_slot slot[PFS_MAX_ALU_INST]; @@ -706,7 +699,7 @@ struct r300_pfs_compile_state { /* Used to map Mesa's inputs/temps onto hardware temps */ int temp_in_use; struct reg_acc temps[PFS_NUM_TEMP_REGS]; - struct reg_acc inputs[32]; /* don't actually need 32... */ + struct reg_acc inputs[32]; /* don't actually need 32... */ /* Track usage of hardware temps, for register allocation, * indirection detection, etc. */ @@ -762,7 +755,7 @@ struct r300_fragment_program { * gl_program_parameter_list::ParameterValues, or a pointer to a * global constant (e.g. for sin/cos-approximation) */ - const GLfloat* constant[PFS_NUM_CONST_REGS]; + const GLfloat *constant[PFS_NUM_CONST_REGS]; int const_nr; int max_temp_idx; @@ -792,12 +785,12 @@ struct radeon_vertex_buffer { int Count; void *Elts; int elt_size; - int elt_min, elt_max; /* debug */ + int elt_min, elt_max; /* debug */ struct dt AttribPtr[VERT_ATTRIB_MAX]; - const struct _mesa_prim *Primitive; - GLuint PrimitiveCount; + const struct _mesa_prim *Primitive; + GLuint PrimitiveCount; GLint LockFirst; GLsizei LockCount; int lock_uptodate; @@ -805,16 +798,16 @@ struct radeon_vertex_buffer { struct r300_aos_rec { GLuint offset; - int element_size; /* in dwords */ - int stride; /* distance between elements, in dwords */ + int element_size; /* in dwords */ + int stride; /* distance between elements, in dwords */ int format; - int ncomponents; /* number of components - between 1 and 4, inclusive */ + int ncomponents; /* number of components - between 1 and 4, inclusive */ - int reg; /* which register they are assigned to. */ + int reg; /* which register they are assigned to. */ - }; +}; struct r300_state { struct r300_depthbuffer_state depth; @@ -829,12 +822,12 @@ struct r300_state { GLuint *Elts; struct r300_dma_region elt_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 */ + 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 */ + 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; @@ -848,7 +841,7 @@ struct r300_state { * R300 context structure. */ struct r300_context { - struct radeon_context radeon; /* parent class, must be first */ + struct radeon_context radeon; /* parent class, must be first */ struct r300_hw_state hw; struct r300_cmdbuf cmdbuf; @@ -892,18 +885,17 @@ struct r300_buffer_object { #define R300_CONTEXT(ctx) ((r300ContextPtr)(ctx->DriverCtx)) -static __inline GLuint r300PackColor( GLuint cpp, - GLubyte r, GLubyte g, - GLubyte b, GLubyte a ) +static __inline GLuint r300PackColor(GLuint cpp, + GLubyte r, GLubyte g, GLubyte b, GLubyte a) { - switch ( cpp ) { - case 2: - return PACK_COLOR_565( r, g, b ); - case 4: - return PACK_COLOR_8888( r, g, b, a ); - default: - return 0; - } + switch (cpp) { + case 2: + return PACK_COLOR_565(r, g, b); + case 4: + return PACK_COLOR_8888(r, g, b, a); + default: + return 0; + } } extern void r300DestroyContext(__DRIcontextPrivate * driContextPriv); extern GLboolean r300CreateContext(const __GLcontextModes * glVisual, @@ -914,11 +906,16 @@ extern int r300_get_num_verts(r300ContextPtr rmesa, int num_verts, int prim); extern void r300_select_vertex_shader(r300ContextPtr r300); extern void r300InitShaderFuncs(struct dd_function_table *functions); -extern int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program_cont *vp, float *dst); -extern int r300Fallback(GLcontext *ctx); +extern int r300VertexProgUpdateParams(GLcontext * ctx, + struct r300_vertex_program_cont *vp, + float *dst); +extern int r300Fallback(GLcontext * ctx); -extern void radeon_vb_to_rvb(r300ContextPtr rmesa, struct radeon_vertex_buffer *rvb, struct vertex_buffer *vb); -extern GLboolean r300_run_vb_render(GLcontext *ctx, struct tnl_pipeline_stage *stage); +extern void radeon_vb_to_rvb(r300ContextPtr rmesa, + struct radeon_vertex_buffer *rvb, + struct vertex_buffer *vb); +extern GLboolean r300_run_vb_render(GLcontext * ctx, + struct tnl_pipeline_stage *stage); #ifdef RADEON_VTXFMT_A extern void radeon_init_vtxfmt_a(r300ContextPtr rmesa); @@ -926,7 +923,7 @@ extern void radeon_init_vtxfmt_a(r300ContextPtr rmesa); #ifdef HW_VBOS extern void r300InitVBOFuncs(struct dd_function_table *functions); -extern void r300EvictVBOs(GLcontext *ctx, int amount); +extern void r300EvictVBOs(GLcontext * ctx, int amount); #endif #define RADEON_D_CAPTURE 0 -- cgit v1.2.3 From dcc8e5f4c1b504c3ddfabda6da2c3d0f2d685c9e Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 13:59:28 +0000 Subject: r300: Indented r300_tex.[ch]. --- src/mesa/drivers/dri/r300/r300_tex.c | 304 ++++++++++++++++++----------------- 1 file changed, 157 insertions(+), 147 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c index 3eb575cbddb..e8005163617 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.c +++ b/src/mesa/drivers/dri/r300/r300_tex.c @@ -63,7 +63,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. static void r300SetTexWrap(r300TexObjPtr t, GLenum swrap, GLenum twrap, GLenum rwrap) { - unsigned long hw_swrap=0, hw_twrap=0, hw_qwrap=0; + unsigned long hw_swrap = 0, hw_twrap = 0, hw_qwrap = 0; t->filter &= ~(R300_TX_WRAP_S_MASK | R300_TX_WRAP_T_MASK | R300_TX_WRAP_Q_MASK); @@ -224,12 +224,12 @@ static void r300SetTexFilter(r300TexObjPtr t, GLenum minf, GLenum magf) case GL_NEAREST_MIPMAP_NEAREST: case GL_LINEAR_MIPMAP_NEAREST: t->filter |= - R300_TX_MIN_FILTER_ANISO_NEAREST_MIP_NEAREST; + R300_TX_MIN_FILTER_ANISO_NEAREST_MIP_NEAREST; break; case GL_NEAREST_MIPMAP_LINEAR: case GL_LINEAR_MIPMAP_LINEAR: t->filter |= - R300_TX_MIN_FILTER_ANISO_NEAREST_MIP_LINEAR; + R300_TX_MIN_FILTER_ANISO_NEAREST_MIP_LINEAR; break; } } @@ -287,35 +287,37 @@ static r300TexObjPtr r300AllocTexObj(struct gl_texture_object *texObj) } /* try to find a format which will only need a memcopy */ -static const struct gl_texture_format *r300Choose8888TexFormat( GLenum srcFormat, - GLenum srcType ) +static const struct gl_texture_format *r300Choose8888TexFormat(GLenum srcFormat, + GLenum srcType) { const GLuint ui = 1; - const GLubyte littleEndian = *((const GLubyte *) &ui); + 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; + } else + return _dri_texformat_argb8888; } static const struct gl_texture_format *r300ChooseTextureFormat(GLcontext * ctx, @@ -334,10 +336,8 @@ static const struct gl_texture_format *r300ChooseTextureFormat(GLcontext * ctx, #if 0 fprintf(stderr, "InternalFormat=%s(%d) type=%s format=%s\n", _mesa_lookup_enum_by_nr(internalFormat), internalFormat, - _mesa_lookup_enum_by_nr(type), - _mesa_lookup_enum_by_nr(format)); - fprintf(stderr, "do32bpt=%d force16bpt=%d\n", - do32bpt, force16bpt); + _mesa_lookup_enum_by_nr(type), _mesa_lookup_enum_by_nr(format)); + fprintf(stderr, "do32bpt=%d force16bpt=%d\n", do32bpt, force16bpt); #endif switch (internalFormat) { @@ -383,7 +383,8 @@ static const struct gl_texture_format *r300ChooseTextureFormat(GLcontext * ctx, case GL_RGBA12: case GL_RGBA16: return !force16bpt ? - r300Choose8888TexFormat(format, type) : _dri_texformat_argb4444; + r300Choose8888TexFormat(format, + type) : _dri_texformat_argb4444; case GL_RGBA4: case GL_RGBA2: @@ -450,43 +451,43 @@ static const struct gl_texture_format *r300ChooseTextureFormat(GLcontext * ctx, case GL_RGB_S3TC: case GL_RGB4_S3TC: case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: - return &_mesa_texformat_rgb_dxt1; - + return &_mesa_texformat_rgb_dxt1; + case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: - return &_mesa_texformat_rgba_dxt1; - + return &_mesa_texformat_rgba_dxt1; + case GL_RGBA_S3TC: case GL_RGBA4_S3TC: case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: - return &_mesa_texformat_rgba_dxt3; - + return &_mesa_texformat_rgba_dxt3; + case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - return &_mesa_texformat_rgba_dxt5; - - case GL_ALPHA16F_ARB: - return &_mesa_texformat_alpha_float16; + return &_mesa_texformat_rgba_dxt5; + + case GL_ALPHA16F_ARB: + return &_mesa_texformat_alpha_float16; case GL_ALPHA32F_ARB: - return &_mesa_texformat_alpha_float32; + return &_mesa_texformat_alpha_float32; case GL_LUMINANCE16F_ARB: - return &_mesa_texformat_luminance_float16; + return &_mesa_texformat_luminance_float16; case GL_LUMINANCE32F_ARB: - return &_mesa_texformat_luminance_float32; + return &_mesa_texformat_luminance_float32; case GL_LUMINANCE_ALPHA16F_ARB: - return &_mesa_texformat_luminance_alpha_float16; + return &_mesa_texformat_luminance_alpha_float16; case GL_LUMINANCE_ALPHA32F_ARB: - return &_mesa_texformat_luminance_alpha_float32; + return &_mesa_texformat_luminance_alpha_float32; case GL_INTENSITY16F_ARB: - return &_mesa_texformat_intensity_float16; + return &_mesa_texformat_intensity_float16; case GL_INTENSITY32F_ARB: - return &_mesa_texformat_intensity_float32; + return &_mesa_texformat_intensity_float32; case GL_RGB16F_ARB: - return &_mesa_texformat_rgba_float16; + return &_mesa_texformat_rgba_float16; case GL_RGB32F_ARB: - return &_mesa_texformat_rgba_float32; + return &_mesa_texformat_rgba_float32; case GL_RGBA16F_ARB: - return &_mesa_texformat_rgba_float16; + return &_mesa_texformat_rgba_float16; case GL_RGBA32F_ARB: - return &_mesa_texformat_rgba_float32; + return &_mesa_texformat_rgba_float32; default: _mesa_problem(ctx, @@ -761,43 +762,44 @@ static void r300TexSubImage2D(GLcontext * ctx, GLenum target, GLint level, t->dirty_images[face] |= (1 << level); } -static void r300CompressedTexImage2D( GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint height, GLint border, - GLsizei imageSize, const GLvoid *data, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ) +static void r300CompressedTexImage2D(GLcontext * ctx, GLenum target, + GLint level, GLint internalFormat, + GLint width, GLint height, GLint border, + GLsizei imageSize, const GLvoid * data, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage) { - driTextureObject * t = (driTextureObject *) texObj->DriverData; - GLuint face; - - /* which cube face or ordinary 2D image */ - switch (target) { - case GL_TEXTURE_CUBE_MAP_POSITIVE_X: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: - face = (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X; - ASSERT(face < 6); - break; - default: - face = 0; - } + driTextureObject *t = (driTextureObject *) texObj->DriverData; + GLuint face; - if ( t != NULL ) { - driSwapOutTextureObject( t ); - } - else { - t = (driTextureObject *) r300AllocTexObj( texObj ); - if (!t) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D"); - return; - } - } + /* which cube face or ordinary 2D image */ + switch (target) { + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + face = + (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X; + ASSERT(face < 6); + break; + default: + face = 0; + } + + if (t != NULL) { + driSwapOutTextureObject(t); + } else { + t = (driTextureObject *) r300AllocTexObj(texObj); + if (!t) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, + "glCompressedTexImage2D"); + return; + } + } - texImage->IsClientData = GL_FALSE; + texImage->IsClientData = GL_FALSE; /* can't call this, different parameters. Would never evaluate to true anyway currently if (r300ValidateClientStorage( ctx, target, internalFormat, @@ -807,67 +809,70 @@ static void r300CompressedTexImage2D( GLcontext *ctx, GLenum target, GLint level if (RADEON_DEBUG & DEBUG_TEXTURE) fprintf(stderr, "%s: Using client storage\n", __FUNCTION__); } - else */{ - if (RADEON_DEBUG & DEBUG_TEXTURE) - fprintf(stderr, "%s: Using normal storage\n", __FUNCTION__); - - /* Normal path: copy (to cached memory) and eventually upload - * via another copy to GART memory and then a blit... Could - * eliminate one copy by going straight to (permanent) GART. - * - * Note, this will call r300ChooseTextureFormat. - */ - _mesa_store_compressed_teximage2d(ctx, target, level, internalFormat, width, - height, border, imageSize, data, texObj, texImage); - - t->dirty_images[face] |= (1 << level); - } -} + else */ { + if (RADEON_DEBUG & DEBUG_TEXTURE) + fprintf(stderr, "%s: Using normal storage\n", + __FUNCTION__); + /* Normal path: copy (to cached memory) and eventually upload + * via another copy to GART memory and then a blit... Could + * eliminate one copy by going straight to (permanent) GART. + * + * Note, this will call r300ChooseTextureFormat. + */ + _mesa_store_compressed_teximage2d(ctx, target, level, + internalFormat, width, height, + border, imageSize, data, + texObj, texImage); + + t->dirty_images[face] |= (1 << level); + } +} -static void r300CompressedTexSubImage2D( GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, - GLenum format, - GLsizei imageSize, const GLvoid *data, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ) +static void r300CompressedTexSubImage2D(GLcontext * ctx, GLenum target, + GLint level, GLint xoffset, + GLint yoffset, GLsizei width, + GLsizei height, GLenum format, + GLsizei imageSize, const GLvoid * data, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage) { - driTextureObject * t = (driTextureObject *) texObj->DriverData; - GLuint face; - - - /* which cube face or ordinary 2D image */ - switch (target) { - case GL_TEXTURE_CUBE_MAP_POSITIVE_X: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: - face = (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X; - ASSERT(face < 6); - break; - default: - face = 0; - } + driTextureObject *t = (driTextureObject *) texObj->DriverData; + GLuint face; - assert( t ); /* this _should_ be true */ - if ( t ) { - driSwapOutTextureObject( t ); - } - else { - t = (driTextureObject *) r300AllocTexObj( texObj ); - if (!t) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage3D"); - return; - } - } + /* which cube face or ordinary 2D image */ + switch (target) { + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + face = + (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X; + ASSERT(face < 6); + break; + default: + face = 0; + } + + assert(t); /* this _should_ be true */ + if (t) { + driSwapOutTextureObject(t); + } else { + t = (driTextureObject *) r300AllocTexObj(texObj); + if (!t) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, + "glCompressedTexSubImage3D"); + return; + } + } - _mesa_store_compressed_texsubimage2d(ctx, target, level, xoffset, yoffset, width, - height, format, imageSize, data, texObj, texImage); + _mesa_store_compressed_texsubimage2d(ctx, target, level, xoffset, + yoffset, width, height, format, + imageSize, data, texObj, texImage); - t->dirty_images[face] |= (1 << level); + t->dirty_images[face] |= (1 << level); } #if ENABLE_HW_3D_TEXTURE @@ -976,7 +981,7 @@ static void r300TexEnv(GLcontext * ctx, GLenum target, */ switch (pname) { case GL_TEXTURE_LOD_BIAS_EXT:{ -#if 0 /* Needs to be relocated in order to make sure we got the right tmu */ +#if 0 /* Needs to be relocated in order to make sure we got the right tmu */ GLfloat bias, min; GLuint b; @@ -996,10 +1001,16 @@ static void r300TexEnv(GLcontext * ctx, GLenum target, b = 0x1000 / 16.0 * bias; b &= R300_LOD_BIAS_MASK; - if(b != (rmesa->hw.tex.unknown1.cmd[R300_TEX_VALUE_0+unit] & R300_LOD_BIAS_MASK)){ + if (b != + (rmesa->hw.tex.unknown1. + cmd[R300_TEX_VALUE_0 + + unit] & R300_LOD_BIAS_MASK)) { R300_STATECHANGE(rmesa, tex.unknown1); - rmesa->hw.tex.unknown1.cmd[R300_TEX_VALUE_0+unit] &= ~R300_LOD_BIAS_MASK; - rmesa->hw.tex.unknown1.cmd[R300_TEX_VALUE_0+unit] |= b; + rmesa->hw.tex.unknown1.cmd[R300_TEX_VALUE_0 + + unit] &= + ~R300_LOD_BIAS_MASK; + rmesa->hw.tex.unknown1.cmd[R300_TEX_VALUE_0 + + unit] |= b; } #endif break; @@ -1130,7 +1141,6 @@ static struct gl_texture_object *r300NewTextureObject(GLcontext * ctx, return obj; } - void r300InitTextureFuncs(struct dd_function_table *functions) { /* Note: we only plug in the functions we implement in the driver @@ -1158,9 +1168,9 @@ void r300InitTextureFuncs(struct dd_function_table *functions) functions->TexEnv = r300TexEnv; functions->TexParameter = r300TexParameter; - - functions->CompressedTexImage2D = r300CompressedTexImage2D; - functions->CompressedTexSubImage2D = r300CompressedTexSubImage2D; + + functions->CompressedTexImage2D = r300CompressedTexImage2D; + functions->CompressedTexSubImage2D = r300CompressedTexSubImage2D; driInitTextureFormats(); } -- cgit v1.2.3 From 3e4302fe3b3cf0d559b1288f3965f800ee35cd41 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 9 May 2007 08:04:32 -0600 Subject: Check that texture units/samplers specified with glUniform1i() are legal. --- src/mesa/shader/shader_api.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 64f2a9fa126..3a54e68d0de 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.3 + * Version: 7.0 * * Copyright (C) 2004-2007 Brian Paul All Rights Reserved. * @@ -1072,12 +1072,20 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count, * If we're setting a sampler, we must use glUniformi1()! */ if (shProg->Uniforms->Parameters[location].Type == PROGRAM_SAMPLER) { + GLint unit; if (type != GL_INT || count != 1) { _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(only glUniform1i can be used " "to set sampler uniforms)"); return; } + /* check that the sampler (tex unit index) is legal */ + unit = ((GLint *) values)[0]; + if (unit >= ctx->Const.MaxTextureImageUnits) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glUniform1(invalid sampler/tex unit index)"); + return; + } } if (count < 0) { -- cgit v1.2.3 From 516259d609d1f9c598fefb38d82103211c9463db Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 9 May 2007 08:07:10 -0600 Subject: Clean-up in I830AllocVidMem(), s/int/unsigned long/ for ret variable. --- src/mesa/drivers/dri/i915/server/intel_dri.c | 27 +++++++++++++------------ src/mesa/drivers/dri/i915tex/server/intel_dri.c | 27 +++++++++++++------------ 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/src/mesa/drivers/dri/i915/server/intel_dri.c b/src/mesa/drivers/dri/i915/server/intel_dri.c index 169fdbece30..b6946b75d20 100644 --- a/src/mesa/drivers/dri/i915/server/intel_dri.c +++ b/src/mesa/drivers/dri/i915/server/intel_dri.c @@ -455,12 +455,14 @@ static unsigned long AllocFromAGP(const DRIDriverContext *ctx, I830Rec *pI830, l } unsigned long -I830AllocVidMem(const DRIDriverContext *ctx, I830Rec *pI830, I830MemRange *result, I830MemPool *pool, long size, unsigned long alignment, int flags) +I830AllocVidMem(const DRIDriverContext *ctx, I830Rec *pI830, + I830MemRange *result, I830MemPool *pool, long size, + unsigned long alignment, int flags) { - int ret; + unsigned long ret; - if (!result) - return 0; + if (!result) + return 0; /* Make sure these are initialised. */ result->Size = 0; @@ -470,16 +472,15 @@ I830AllocVidMem(const DRIDriverContext *ctx, I830Rec *pI830, I830MemRange *resul return 0; } - if (pool->Free.Size < size) - return AllocFromAGP(ctx, pI830, size, alignment, result); - else - { - ret = AllocFromPool(ctx, pI830, result, pool, size, alignment, flags); - - if (ret==0) - return AllocFromAGP(ctx, pI830, size, alignment, result); - return ret; + if (pool->Free.Size < size) { + ret = AllocFromAGP(ctx, pI830, size, alignment, result); + } + else { + ret = AllocFromPool(ctx, pI830, result, pool, size, alignment, flags); + if (ret == 0) + ret = AllocFromAGP(ctx, pI830, size, alignment, result); } + return ret; } static Bool BindAgpRange(const DRIDriverContext *ctx, I830MemRange *mem) diff --git a/src/mesa/drivers/dri/i915tex/server/intel_dri.c b/src/mesa/drivers/dri/i915tex/server/intel_dri.c index 2d425d04ac3..e49c4214ad4 100644 --- a/src/mesa/drivers/dri/i915tex/server/intel_dri.c +++ b/src/mesa/drivers/dri/i915tex/server/intel_dri.c @@ -483,12 +483,14 @@ static unsigned long AllocFromAGP(const DRIDriverContext *ctx, I830Rec *pI830, l } unsigned long -I830AllocVidMem(const DRIDriverContext *ctx, I830Rec *pI830, I830MemRange *result, I830MemPool *pool, long size, unsigned long alignment, int flags) +I830AllocVidMem(const DRIDriverContext *ctx, I830Rec *pI830, + I830MemRange *result, I830MemPool *pool, long size, + unsigned long alignment, int flags) { - int ret; + unsigned long ret; - if (!result) - return 0; + if (!result) + return 0; /* Make sure these are initialised. */ result->Size = 0; @@ -498,16 +500,15 @@ I830AllocVidMem(const DRIDriverContext *ctx, I830Rec *pI830, I830MemRange *resul return 0; } - if (pool->Free.Size < size) - return AllocFromAGP(ctx, pI830, size, alignment, result); - else - { - ret = AllocFromPool(ctx, pI830, result, pool, size, alignment, flags); - - if (ret==0) - return AllocFromAGP(ctx, pI830, size, alignment, result); - return ret; + if (pool->Free.Size < size) { + ret = AllocFromAGP(ctx, pI830, size, alignment, result); + } + else { + ret = AllocFromPool(ctx, pI830, result, pool, size, alignment, flags); + if (ret == 0) + ret = AllocFromAGP(ctx, pI830, size, alignment, result); } + return ret; } static Bool BindAgpRange(const DRIDriverContext *ctx, I830MemRange *mem) -- cgit v1.2.3 From bb97694fad934e53d24012dde42ee6434e4c8397 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 14:09:35 +0000 Subject: r300: Indented r300_texstate.[ch] --- src/mesa/drivers/dri/r300/r300_texstate.c | 104 ++++++++++++++++++------------ 1 file changed, 61 insertions(+), 43 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index 9e72b6fa6e0..d20a61e07ee 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -46,7 +46,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_tex.h" #include "r300_reg.h" - #define VALID_FORMAT(f) ( ((f) <= MESA_FORMAT_RGBA_DXT5 \ || ((f) >= MESA_FORMAT_RGBA_FLOAT32 && \ (f) <= MESA_FORMAT_INTENSITY_FLOAT16)) \ @@ -152,7 +151,6 @@ static const struct { #undef _ASSIGN - /** * This function computes the number of bytes of storage needed for * the given texture object (all mipmap levels, all cube faces). @@ -180,14 +178,18 @@ static void r300SetTexImages(r300ContextPtr rmesa, if (VALID_FORMAT(baseImage->TexFormat->MesaFormat)) { if (_mesa_little_endian()) { t->format = - tx_table_le[baseImage->TexFormat->MesaFormat].format; + tx_table_le[baseImage->TexFormat->MesaFormat]. + format; t->filter |= - tx_table_le[baseImage->TexFormat->MesaFormat].filter; + tx_table_le[baseImage->TexFormat->MesaFormat]. + filter; } else { t->format = - tx_table_be[baseImage->TexFormat->MesaFormat].format; + tx_table_be[baseImage->TexFormat->MesaFormat]. + format; t->filter |= - tx_table_be[baseImage->TexFormat->MesaFormat].filter; + tx_table_be[baseImage->TexFormat->MesaFormat]. + filter; } } else { _mesa_problem(NULL, "unexpected texture format in %s", @@ -217,18 +219,22 @@ static void r300SetTexImages(r300ContextPtr rmesa, t->tile_bits = 0; /* figure out if this texture is suitable for tiling. */ -#if 0 /* Disabled for now */ +#if 0 /* Disabled for now */ if (texelBytes) { - if (rmesa->texmicrotile && (tObj->Target != GL_TEXTURE_RECTANGLE_NV) && - /* texrect might be able to use micro tiling too in theory? */ - (baseImage->Height > 1)) { + if (rmesa->texmicrotile + && (tObj->Target != GL_TEXTURE_RECTANGLE_NV) && + /* texrect might be able to use micro tiling too in theory? */ + (baseImage->Height > 1)) { /* allow 32 (bytes) x 1 mip (which will use two times the space the non-tiled version would use) max if base texture is large enough */ if ((numLevels == 1) || - (((baseImage->Width * texelBytes / baseImage->Height) <= 32) && - (baseImage->Width * texelBytes > 64)) || - ((baseImage->Width * texelBytes / baseImage->Height) <= 16)) { + (((baseImage->Width * texelBytes / + baseImage->Height) <= 32) + && (baseImage->Width * texelBytes > 64)) + || + ((baseImage->Width * texelBytes / + baseImage->Height) <= 16)) { t->tile_bits |= R300_TXO_MICRO_TILE; } } @@ -250,9 +256,10 @@ static void r300SetTexImages(r300ContextPtr rmesa, /* find image size in bytes */ if (texImage->IsCompressed) { - if ((t->format & R300_TX_FORMAT_DXT1) == R300_TX_FORMAT_DXT1) { + if ((t->format & R300_TX_FORMAT_DXT1) == + R300_TX_FORMAT_DXT1) { // fprintf(stderr,"DXT 1 %d %08X\n", texImage->Width, t->format); - if ((texImage->Width + 3) < 8) /* width one block */ + if ((texImage->Width + 3) < 8) /* width one block */ size = texImage->CompressedSize * 4; else if ((texImage->Width + 3) < 16) size = texImage->CompressedSize * 2; @@ -260,7 +267,8 @@ static void r300SetTexImages(r300ContextPtr rmesa, size = texImage->CompressedSize; } else { /* DXT3/5, 16 bytes per block */ - WARN_ONCE("DXT 3/5 suffers from multitexturing problems!\n"); + WARN_ONCE + ("DXT 3/5 suffers from multitexturing problems!\n"); // fprintf(stderr,"DXT 3/5 %d\n", texImage->Width); if ((texImage->Width + 3) < 8) size = texImage->CompressedSize * 2; @@ -268,14 +276,18 @@ static void r300SetTexImages(r300ContextPtr rmesa, size = texImage->CompressedSize; } } else if (tObj->Target == GL_TEXTURE_RECTANGLE_NV) { - size = ((texImage->Width * texelBytes + 63) & ~63) * texImage->Height; + size = + ((texImage->Width * texelBytes + + 63) & ~63) * texImage->Height; blitWidth = 64 / texelBytes; } else if (t->tile_bits & R300_TXO_MICRO_TILE) { /* tile pattern is 16 bytes x2. mipmaps stay 32 byte aligned, - though the actual offset may be different (if texture is less than - 32 bytes width) to the untiled case */ + though the actual offset may be different (if texture is less than + 32 bytes width) to the untiled case */ int w = (texImage->Width * texelBytes * 2 + 31) & ~31; - size = (w * ((texImage->Height + 1) / 2)) * texImage->Depth; + size = + (w * ((texImage->Height + 1) / 2)) * + texImage->Depth; blitWidth = MAX2(texImage->Width, 64 / texelBytes); } else { int w = (texImage->Width * texelBytes + 31) & ~31; @@ -284,11 +296,12 @@ static void r300SetTexImages(r300ContextPtr rmesa, } assert(size > 0); - if(0) + if (0) fprintf(stderr, "w=%d h=%d d=%d tb=%d intFormat=%d\n", - texImage->Width, texImage->Height, - texImage->Depth, texImage->TexFormat->TexelBytes, - texImage->InternalFormat); + texImage->Width, texImage->Height, + texImage->Depth, + texImage->TexFormat->TexelBytes, + texImage->InternalFormat); /* Align to 32-byte offset. It is faster to do this unconditionally * (no branch penalty). @@ -300,22 +313,25 @@ static void r300SetTexImages(r300ContextPtr rmesa, /* fix x and y coords up later together with offset */ t->image[0][i].x = curOffset; t->image[0][i].y = 0; - t->image[0][i].width = MIN2(size / texelBytes, blitWidth); - t->image[0][i].height = (size / texelBytes) / t->image[0][i].width; + t->image[0][i].width = + MIN2(size / texelBytes, blitWidth); + t->image[0][i].height = + (size / texelBytes) / t->image[0][i].width; } else { t->image[0][i].x = curOffset % R300_BLIT_WIDTH_BYTES; t->image[0][i].y = curOffset / R300_BLIT_WIDTH_BYTES; - t->image[0][i].width = MIN2(size, R300_BLIT_WIDTH_BYTES); + t->image[0][i].width = + MIN2(size, R300_BLIT_WIDTH_BYTES); t->image[0][i].height = size / t->image[0][i].width; } if (0) fprintf(stderr, - "level %d: %dx%d x=%d y=%d w=%d h=%d size=%d at %d\n", - i, texImage->Width, texImage->Height, - t->image[0][i].x, t->image[0][i].y, - t->image[0][i].width, t->image[0][i].height, - size, curOffset); + "level %d: %dx%d x=%d y=%d w=%d h=%d size=%d at %d\n", + i, texImage->Width, texImage->Height, + t->image[0][i].x, t->image[0][i].y, + t->image[0][i].width, t->image[0][i].height, + size, curOffset); curOffset += size; } @@ -345,9 +361,12 @@ static void r300SetTexImages(r300ContextPtr rmesa, t->format |= R300_TX_FORMAT_CUBIC_MAP; } - t->size = (((tObj->Image[0][t->base.firstLevel]->Width - 1) << R300_TX_WIDTHMASK_SHIFT) - |((tObj->Image[0][t->base.firstLevel]->Height - 1) << R300_TX_HEIGHTMASK_SHIFT)) - |((numLevels - 1) << R300_TX_MAX_MIP_LEVEL_SHIFT); + t->size = + (((tObj->Image[0][t->base.firstLevel]->Width - + 1) << R300_TX_WIDTHMASK_SHIFT) + | ((tObj->Image[0][t->base.firstLevel]->Height - 1) << + R300_TX_HEIGHTMASK_SHIFT)) + | ((numLevels - 1) << R300_TX_MAX_MIP_LEVEL_SHIFT); /* Only need to round to nearest 32 for textures, but the blitter * requires 64-byte aligned pitches, and we may/may not need the @@ -356,15 +375,15 @@ static void r300SetTexImages(r300ContextPtr rmesa, if (baseImage->IsCompressed) { t->pitch = (tObj->Image[0][t->base.firstLevel]->Width + 63) & ~(63); - } - else if (tObj->Target == GL_TEXTURE_RECTANGLE_NV) { + } else if (tObj->Target == GL_TEXTURE_RECTANGLE_NV) { unsigned int align = blitWidth - 1; t->pitch = ((tObj->Image[0][t->base.firstLevel]->Width * - texelBytes) + 63) & ~(63); + texelBytes) + 63) & ~(63); t->size |= R300_TX_SIZE_TXPITCH_EN; - t->pitch_reg = (((tObj->Image[0][t->base.firstLevel]->Width) + align) & ~align) - 1; - } - else { + t->pitch_reg = + (((tObj->Image[0][t->base.firstLevel]->Width) + + align) & ~align) - 1; + } else { t->pitch = ((tObj->Image[0][t->base.firstLevel]->Width * texelBytes) + 63) & ~(63); @@ -375,7 +394,6 @@ static void r300SetTexImages(r300ContextPtr rmesa, /* FYI: r300UploadTexImages( rmesa, t ) used to be called here */ } - /* ================================================================ * Texture unit state management */ @@ -540,7 +558,7 @@ static GLboolean r300UpdateTextureUnit(GLcontext * ctx, int unit) return GL_FALSE; } else { return GL_TRUE; - } + } } void r300UpdateTextureState(GLcontext * ctx) -- cgit v1.2.3 From c970811dab9e289b9f021cb67f39990f175c7ec5 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 14:11:17 +0000 Subject: r300: Indented r300_texmem.[ch]. --- src/mesa/drivers/dri/r300/r300_texmem.c | 157 +++++++++++++++++--------------- 1 file changed, 83 insertions(+), 74 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_texmem.c b/src/mesa/drivers/dri/r300/r300_texmem.c index 5d52f777e3b..221dda41b0e 100644 --- a/src/mesa/drivers/dri/r300/r300_texmem.c +++ b/src/mesa/drivers/dri/r300/r300_texmem.c @@ -210,10 +210,8 @@ static void r300UploadRectSubImage(r300ContextPtr rmesa, /* In this case, could also use GART texturing. This is * currently disabled, but has been tested & works. */ - t->offset = - r300GartOffsetFromVirtual(rmesa, texImage->Data); - t->pitch = - texImage->RowStride * texFormat->TexelBytes - 32; + t->offset = r300GartOffsetFromVirtual(rmesa, texImage->Data); + t->pitch = texImage->RowStride * texFormat->TexelBytes - 32; if (RADEON_DEBUG & DEBUG_TEXTURE) fprintf(stderr, @@ -283,10 +281,7 @@ static void r300UploadRectSubImage(r300ContextPtr rmesa, blit_format, dstPitch, GET_START(®ion), dstPitch | (t->tile_bits >> 16), - t->bufAddr, - 0, 0, - 0, done, - width, lines); + t->bufAddr, 0, 0, 0, done, width, lines); r300EmitWait(rmesa, R300_WAIT_2D); #ifdef USER_BUFFERS @@ -303,10 +298,10 @@ static void r300UploadRectSubImage(r300ContextPtr rmesa, * Upload the texture image associated with texture \a t at the specified * level at the address relative to \a start. */ -static void uploadSubImage( r300ContextPtr rmesa, r300TexObjPtr t, - GLint hwlevel, - GLint x, GLint y, GLint width, GLint height, - GLuint face ) +static void uploadSubImage(r300ContextPtr rmesa, r300TexObjPtr t, + GLint hwlevel, + GLint x, GLint y, GLint width, GLint height, + GLuint face) { struct gl_texture_image *texImage = NULL; GLuint offset; @@ -316,71 +311,74 @@ static void uploadSubImage( r300ContextPtr rmesa, r300TexObjPtr t, drm_radeon_tex_image_t tmp; const int level = hwlevel + t->base.firstLevel; - if ( RADEON_DEBUG & DEBUG_TEXTURE ) { - fprintf( stderr, "%s( %p, %p ) level/width/height/face = %d/%d/%d/%u\n", - __FUNCTION__, (void *)t, (void *)t->base.tObj, - level, width, height, face ); + if (RADEON_DEBUG & DEBUG_TEXTURE) { + fprintf(stderr, + "%s( %p, %p ) level/width/height/face = %d/%d/%d/%u\n", + __FUNCTION__, (void *)t, (void *)t->base.tObj, level, + width, height, face); } ASSERT(face < 6); /* Ensure we have a valid texture to upload */ - if ( ( hwlevel < 0 ) || ( hwlevel >= RADEON_MAX_TEXTURE_LEVELS ) ) { + if ((hwlevel < 0) || (hwlevel >= RADEON_MAX_TEXTURE_LEVELS)) { _mesa_problem(NULL, "bad texture level in %s", __FUNCTION__); return; } texImage = t->base.tObj->Image[face][level]; - if ( !texImage ) { - if ( RADEON_DEBUG & DEBUG_TEXTURE ) - fprintf( stderr, "%s: texImage %d is NULL!\n", __FUNCTION__, level ); + if (!texImage) { + if (RADEON_DEBUG & DEBUG_TEXTURE) + fprintf(stderr, "%s: texImage %d is NULL!\n", + __FUNCTION__, level); return; } - if ( !texImage->Data ) { - if ( RADEON_DEBUG & DEBUG_TEXTURE ) - fprintf( stderr, "%s: image data is NULL!\n", __FUNCTION__ ); + if (!texImage->Data) { + if (RADEON_DEBUG & DEBUG_TEXTURE) + fprintf(stderr, "%s: image data is NULL!\n", + __FUNCTION__); return; } - if (t->base.tObj->Target == GL_TEXTURE_RECTANGLE_NV) { assert(level == 0); assert(hwlevel == 0); - if ( RADEON_DEBUG & DEBUG_TEXTURE ) - fprintf( stderr, "%s: image data is rectangular\n", __FUNCTION__); - r300UploadRectSubImage( rmesa, t, texImage, x, y, width, height ); + if (RADEON_DEBUG & DEBUG_TEXTURE) + fprintf(stderr, "%s: image data is rectangular\n", + __FUNCTION__); + r300UploadRectSubImage(rmesa, t, texImage, x, y, width, height); return; } else if (texImage->IsClientData) { - if ( RADEON_DEBUG & DEBUG_TEXTURE ) - fprintf( stderr, "%s: image data is in GART client storage\n", - __FUNCTION__); - r300UploadGARTClientSubImage( rmesa, t, texImage, hwlevel, - x, y, width, height ); + if (RADEON_DEBUG & DEBUG_TEXTURE) + fprintf(stderr, + "%s: image data is in GART client storage\n", + __FUNCTION__); + r300UploadGARTClientSubImage(rmesa, t, texImage, hwlevel, x, y, + width, height); return; - } else if ( RADEON_DEBUG & DEBUG_TEXTURE ) - fprintf( stderr, "%s: image data is in normal memory\n", + } else if (RADEON_DEBUG & DEBUG_TEXTURE) + fprintf(stderr, "%s: image data is in normal memory\n", __FUNCTION__); - imageWidth = texImage->Width; imageHeight = texImage->Height; offset = t->bufAddr + t->base.totalSize / 6 * face; - if ( RADEON_DEBUG & (DEBUG_TEXTURE|DEBUG_IOCTL) ) { + if (RADEON_DEBUG & (DEBUG_TEXTURE | DEBUG_IOCTL)) { GLint imageX = 0; GLint imageY = 0; GLint blitX = t->image[face][hwlevel].x; GLint blitY = t->image[face][hwlevel].y; GLint blitWidth = t->image[face][hwlevel].width; GLint blitHeight = t->image[face][hwlevel].height; - fprintf( stderr, " upload image: %d,%d at %d,%d\n", - imageWidth, imageHeight, imageX, imageY ); - fprintf( stderr, " upload blit: %d,%d at %d,%d\n", - blitWidth, blitHeight, blitX, blitY ); - fprintf( stderr, " blit ofs: 0x%07x level: %d/%d\n", - (GLuint)offset, hwlevel, level ); + fprintf(stderr, " upload image: %d,%d at %d,%d\n", + imageWidth, imageHeight, imageX, imageY); + fprintf(stderr, " upload blit: %d,%d at %d,%d\n", + blitWidth, blitHeight, blitX, blitY); + fprintf(stderr, " blit ofs: 0x%07x level: %d/%d\n", + (GLuint) offset, hwlevel, level); } t->image[face][hwlevel].data = texImage->Data; @@ -395,12 +393,15 @@ static void uploadSubImage( r300ContextPtr rmesa, r300TexObjPtr t, tex.offset = offset; tex.image = &tmp; /* copy (x,y,width,height,data) */ - memcpy( &tmp, &t->image[face][hwlevel], sizeof(tmp) ); + memcpy(&tmp, &t->image[face][hwlevel], sizeof(tmp)); if (texImage->TexFormat->TexelBytes > 4) { - const int log2TexelBytes = (3 + (texImage->TexFormat->TexelBytes >> 4)); - tex.format = RADEON_TXFORMAT_I8; /* any 1-byte texel format */ - tex.pitch = MAX2((texImage->Width * texImage->TexFormat->TexelBytes) / 64, 1); + const int log2TexelBytes = + (3 + (texImage->TexFormat->TexelBytes >> 4)); + tex.format = RADEON_TXFORMAT_I8; /* any 1-byte texel format */ + tex.pitch = + MAX2((texImage->Width * texImage->TexFormat->TexelBytes) / + 64, 1); tex.height = imageHeight; tex.width = imageWidth << log2TexelBytes; tex.offset += (tmp.x << log2TexelBytes) & ~1023; @@ -410,7 +411,7 @@ static void uploadSubImage( r300ContextPtr rmesa, r300TexObjPtr t, /* use multi-byte upload scheme */ tex.height = imageHeight; tex.width = imageWidth; - switch(texImage->TexFormat->TexelBytes) { + switch (texImage->TexFormat->TexelBytes) { case 1: tex.format = RADEON_TXFORMAT_I8; break; @@ -421,23 +422,29 @@ static void uploadSubImage( r300ContextPtr rmesa, r300TexObjPtr t, tex.format = RADEON_TXFORMAT_ARGB8888; break; } - tex.pitch = MAX2((texImage->Width * texImage->TexFormat->TexelBytes) / 64, 1); + tex.pitch = + MAX2((texImage->Width * texImage->TexFormat->TexelBytes) / + 64, 1); tex.offset += tmp.x & ~1023; tmp.x = tmp.x % 1024; if (t->tile_bits & R300_TXO_MICRO_TILE) { /* need something like "tiled coordinates" ? */ tmp.y = tmp.x / (tex.pitch * 128) * 2; - tmp.x = tmp.x % (tex.pitch * 128) / 2 / texImage->TexFormat->TexelBytes; + tmp.x = + tmp.x % (tex.pitch * 128) / 2 / + texImage->TexFormat->TexelBytes; tex.pitch |= RADEON_DST_TILE_MICRO >> 22; } else { tmp.x = tmp.x >> (texImage->TexFormat->TexelBytes >> 1); } #if 1 if ((t->tile_bits & R300_TXO_MACRO_TILE) && - (texImage->Width * texImage->TexFormat->TexelBytes >= 256) && - ((!(t->tile_bits & R300_TXO_MICRO_TILE) && (texImage->Height >= 8)) || - (texImage->Height >= 16))) { + (texImage->Width * texImage->TexFormat->TexelBytes >= 256) + && + ((!(t->tile_bits & R300_TXO_MICRO_TILE) + && (texImage->Height >= 8)) + || (texImage->Height >= 16))) { /* weird: R200 disables macro tiling if mip width is smaller than 256 bytes, OR if height is smaller than 8 automatically, but if micro tiling is active the limit is height 16 instead ? */ @@ -451,40 +458,42 @@ static void uploadSubImage( r300ContextPtr rmesa, r300TexObjPtr t, /* set tex.height to 1/4 since 1 "macropixel" (dxt-block) has 4 real pixels. Needed so the kernel module reads the right amount of data. */ - tex.format = RADEON_TXFORMAT_I8; /* any 1-byte texel format */ + tex.format = RADEON_TXFORMAT_I8; /* any 1-byte texel format */ tex.pitch = (R300_BLIT_WIDTH_BYTES / 64); tex.height = (imageHeight + 3) / 4; tex.width = (imageWidth + 3) / 4; - if ((t->format & R300_TX_FORMAT_DXT1) == R300_TX_FORMAT_DXT1) - { + if ((t->format & R300_TX_FORMAT_DXT1) == R300_TX_FORMAT_DXT1) { tex.width *= 8; } else { tex.width *= 16; } } - LOCK_HARDWARE( &rmesa->radeon ); + LOCK_HARDWARE(&rmesa->radeon); do { - ret = drmCommandWriteRead( rmesa->radeon.dri.fd, DRM_RADEON_TEXTURE, - &tex, sizeof(drm_radeon_texture_t) ); + ret = + drmCommandWriteRead(rmesa->radeon.dri.fd, + DRM_RADEON_TEXTURE, &tex, + sizeof(drm_radeon_texture_t)); if (ret) { - if (RADEON_DEBUG & DEBUG_IOCTL) - fprintf(stderr, "DRM_RADEON_TEXTURE: again!\n"); - usleep(1); + if (RADEON_DEBUG & DEBUG_IOCTL) + fprintf(stderr, + "DRM_RADEON_TEXTURE: again!\n"); + usleep(1); } - } while ( ret == -EAGAIN ); - - UNLOCK_HARDWARE( &rmesa->radeon ); - - if ( ret ) { - fprintf( stderr, "DRM_RADEON_TEXTURE: return = %d\n", ret ); - fprintf( stderr, " offset=0x%08x\n", - offset ); - fprintf( stderr, " image width=%d height=%d\n", - imageWidth, imageHeight ); - fprintf( stderr, " blit width=%d height=%d data=%p\n", - t->image[face][hwlevel].width, t->image[face][hwlevel].height, - t->image[face][hwlevel].data ); + } while (ret == -EAGAIN); + + UNLOCK_HARDWARE(&rmesa->radeon); + + if (ret) { + fprintf(stderr, "DRM_RADEON_TEXTURE: return = %d\n", ret); + fprintf(stderr, " offset=0x%08x\n", offset); + fprintf(stderr, " image width=%d height=%d\n", + imageWidth, imageHeight); + fprintf(stderr, " blit width=%d height=%d data=%p\n", + t->image[face][hwlevel].width, + t->image[face][hwlevel].height, + t->image[face][hwlevel].data); _mesa_exit(-1); } } -- cgit v1.2.3 From 901fc0de18ea1fe7b148d0eb9883080c59b406b1 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 14:12:34 +0000 Subject: r300: Indented r300_state.[ch]. --- src/mesa/drivers/dri/r300/r300_state.c | 151 +++++++++++---------------------- 1 file changed, 50 insertions(+), 101 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 18c15ae83de..2d5b10d3ce2 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -351,12 +351,10 @@ static void update_early_z(GLcontext * ctx) else { if (ctx->Depth.Test && ctx->Depth.Func != GL_NEVER) /* enable early Z */ - r300->hw.zstencil_format.cmd[2] = - R300_EARLY_Z_ENABLE; + r300->hw.zstencil_format.cmd[2] = R300_EARLY_Z_ENABLE; else /* disable early Z */ - r300->hw.zstencil_format.cmd[2] = - R300_EARLY_Z_DISABLE; + r300->hw.zstencil_format.cmd[2] = R300_EARLY_Z_DISABLE; } } @@ -453,8 +451,7 @@ static void update_depth(GLcontext * ctx) r300->hw.zs.cmd[R300_ZS_CNTL_0] |= R300_RB3D_Z_TEST_AND_WRITE; else - r300->hw.zs.cmd[R300_ZS_CNTL_0] |= - R300_RB3D_Z_TEST; + r300->hw.zs.cmd[R300_ZS_CNTL_0] |= R300_RB3D_Z_TEST; r300->hw.zs.cmd[R300_ZS_CNTL_1] |= translate_func(ctx->Depth. @@ -462,8 +459,7 @@ static void update_depth(GLcontext * ctx) } else { r300->hw.zs.cmd[R300_ZS_CNTL_0] |= R300_RB3D_Z_DISABLED_1; r300->hw.zs.cmd[R300_ZS_CNTL_1] |= - translate_func(GL_NEVER) << - R300_RB3D_ZS1_DEPTH_FUNC_SHIFT; + translate_func(GL_NEVER) << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT; } update_early_z(ctx); @@ -494,20 +490,16 @@ static void r300Enable(GLcontext * ctx, GLenum cap, GLboolean state) case GL_FOG: R300_STATECHANGE(r300, fogs); if (state) { - r300->hw.fogs.cmd[R300_FOGS_STATE] |= - R300_FOG_ENABLE; + 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_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_COLOR, ctx->Fog.Color); } else { - r300->hw.fogs.cmd[R300_FOGS_STATE] &= - ~R300_FOG_ENABLE; + r300->hw.fogs.cmd[R300_FOGS_STATE] &= ~R300_FOG_ENABLE; } break; @@ -537,8 +529,7 @@ static void r300Enable(GLcontext * ctx, GLenum cap, GLboolean state) } } else { #if R200_MERGED - FALLBACK(&r300->radeon, RADEON_FALLBACK_STENCIL, - state); + FALLBACK(&r300->radeon, RADEON_FALLBACK_STENCIL, state); #endif } break; @@ -666,8 +657,7 @@ static void r300DepthMask(GLcontext * ctx, GLboolean mask) * Handle glColorMask() */ static void r300ColorMask(GLcontext * ctx, - GLboolean r, GLboolean g, GLboolean b, - GLboolean a) + GLboolean r, GLboolean g, GLboolean b, GLboolean a) { r300ContextPtr r300 = R300_CONTEXT(ctx); int mask = (r ? R300_COLORMASK0_R : 0) | @@ -901,8 +891,7 @@ static void r300StencilFuncSeparate(GLcontext * ctx, GLenum face, rmesa->hw.zs.cmd[R300_ZS_CNTL_2] &= ~((R300_RB3D_ZS2_STENCIL_MASK << R300_RB3D_ZS2_STENCIL_REF_SHIFT) | - (R300_RB3D_ZS2_STENCIL_MASK << - R300_RB3D_ZS2_STENCIL_MASK_SHIFT)); + (R300_RB3D_ZS2_STENCIL_MASK << R300_RB3D_ZS2_STENCIL_MASK_SHIFT)); flag = translate_func(ctx->Stencil.Function[0]); rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |= @@ -916,8 +905,7 @@ static void r300StencilFuncSeparate(GLcontext * ctx, GLenum face, rmesa->hw.zs.cmd[R300_ZS_CNTL_2] |= refmask; } -static void r300StencilMaskSeparate(GLcontext * ctx, GLenum face, - GLuint mask) +static void r300StencilMaskSeparate(GLcontext * ctx, GLenum face, GLuint mask) { r300ContextPtr rmesa = R300_CONTEXT(ctx); @@ -927,8 +915,7 @@ static void r300StencilMaskSeparate(GLcontext * ctx, GLenum face, R300_RB3D_ZS2_STENCIL_WRITE_MASK_SHIFT); rmesa->hw.zs.cmd[R300_ZS_CNTL_2] |= (ctx->Stencil. - WriteMask[0] & 0xff) << - R300_RB3D_ZS2_STENCIL_WRITE_MASK_SHIFT; + WriteMask[0] & 0xff) << R300_RB3D_ZS2_STENCIL_WRITE_MASK_SHIFT; } static void r300StencilOpSeparate(GLcontext * ctx, GLenum face, @@ -1028,8 +1015,7 @@ static void r300Viewport(GLcontext * ctx, GLint x, GLint y, r300UpdateWindow(ctx); } -static void r300DepthRange(GLcontext * ctx, GLclampd nearval, - GLclampd farval) +static void r300DepthRange(GLcontext * ctx, GLclampd nearval, GLclampd farval) { r300UpdateWindow(ctx); } @@ -1037,8 +1023,7 @@ static void r300DepthRange(GLcontext * ctx, GLclampd nearval, void r300UpdateViewportOffset(GLcontext * ctx) { r300ContextPtr rmesa = R300_CONTEXT(ctx); - __DRIdrawablePrivate *dPriv = - ((radeonContextPtr) rmesa)->dri.drawable; + __DRIdrawablePrivate *dPriv = ((radeonContextPtr) rmesa)->dri.drawable; GLfloat xoffset = (GLfloat) dPriv->x; GLfloat yoffset = (GLfloat) dPriv->y + dPriv->h; const GLfloat *v = ctx->Viewport._WindowMap.m; @@ -1096,8 +1081,7 @@ void r300UpdateDrawBuffer(GLcontext * ctx) r300->hw.cb.cmd[R300_CB_PITCH] = drb->flippedPitch; //r300->radeon.state.color.drawPitch; if (r300->radeon.radeonScreen->cpp == 4) - r300->hw.cb.cmd[R300_CB_PITCH] |= - R300_COLOR_FORMAT_ARGB8888; + r300->hw.cb.cmd[R300_CB_PITCH] |= R300_COLOR_FORMAT_ARGB8888; else r300->hw.cb.cmd[R300_CB_PITCH] |= R300_COLOR_FORMAT_RGB565; @@ -1138,8 +1122,7 @@ r300FetchStateParameter(GLcontext * ctx, case STATE_R300_TEXRECT_FACTOR:{ struct gl_texture_object *t = - ctx->Texture.Unit[state[2]]. - CurrentRect; + ctx->Texture.Unit[state[2]].CurrentRect; if (t && t->Image[0][t->BaseLevel]) { struct gl_texture_image *image = @@ -1192,8 +1175,7 @@ void r300UpdateStateParameters(GLcontext * ctx, GLuint new_state) r300FetchStateParameter(ctx, paramList->Parameters[i]. StateIndexes, - paramList-> - ParameterValues[i]); + paramList->ParameterValues[i]); } } } @@ -1201,8 +1183,7 @@ void r300UpdateStateParameters(GLcontext * ctx, GLuint new_state) /* ============================================================= * Polygon state */ -static void r300PolygonOffset(GLcontext * ctx, GLfloat factor, - GLfloat units) +static void r300PolygonOffset(GLcontext * ctx, GLfloat factor, GLfloat units) { r300ContextPtr rmesa = R300_CONTEXT(ctx); GLfloat constant = units; @@ -1427,8 +1408,7 @@ void r300_setup_textures(GLcontext * ctx) val &= ~R300_FPITX_IMAGE_MASK; opcode = - (val & R300_FPITX_OPCODE_MASK) >> - R300_FPITX_OPCODE_SHIFT; + (val & R300_FPITX_OPCODE_MASK) >> R300_FPITX_OPCODE_SHIFT; if (opcode == R300_FPITX_OP_KIL) { r300->hw.fpt.cmd[R300_FPT_INSTR_0 + i] = val; } else { @@ -1436,13 +1416,11 @@ void r300_setup_textures(GLcontext * ctx) val |= tmu_mappings[unit] << R300_FPITX_IMAGE_SHIFT; - r300->hw.fpt.cmd[R300_FPT_INSTR_0 + i] = - val; + r300->hw.fpt.cmd[R300_FPT_INSTR_0 + i] = val; } else { // We get here when the corresponding texture image is incomplete // (e.g. incomplete mipmaps etc.) - r300->hw.fpt.cmd[R300_FPT_INSTR_0 + i] = - val; + r300->hw.fpt.cmd[R300_FPT_INSTR_0 + i] = val; } } } @@ -1492,8 +1470,7 @@ void r300_setup_rs_unit(GLcontext * ctx) r300->state.render_inputs_bitset); if (ctx->FragmentProgram._Current) - InputsRead = - ctx->FragmentProgram._Current->Base.InputsRead; + InputsRead = ctx->FragmentProgram._Current->Base.InputsRead; else { fprintf(stderr, "No ctx->FragmentProgram._Current!!\n"); return; /* This should only ever happen once.. */ @@ -1549,15 +1526,13 @@ void r300_setup_rs_unit(GLcontext * ctx) } /* Need to count all coords enabled at vof */ if (R300_OUTPUTS_WRITTEN_TEST - (OutputsWritten, VERT_RESULT_TEX0 + i, - _TNL_ATTRIB_TEX(i))) + (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)) { + (OutputsWritten, VERT_RESULT_COL0, _TNL_ATTRIB_COLOR0)) { WARN_ONCE ("fragprog wants col0, vp doesn't provide it\n"); goto out; /* FIXME */ @@ -1575,8 +1550,7 @@ void r300_setup_rs_unit(GLcontext * ctx) if (InputsRead & FRAG_BIT_COL1) { if (!R300_OUTPUTS_WRITTEN_TEST - (OutputsWritten, VERT_RESULT_COL1, - _TNL_ATTRIB_COLOR1)) { + (OutputsWritten, VERT_RESULT_COL1, _TNL_ATTRIB_COLOR1)) { WARN_ONCE ("fragprog wants col1, vp doesn't provide it\n"); //_mesa_exit(-1); @@ -1599,8 +1573,7 @@ void r300_setup_rs_unit(GLcontext * ctx) col_interp_nr++; } - r300->hw.rc.cmd[1] = 0 - | (in_texcoords << R300_RS_CNTL_TC_CNT_SHIFT) + r300->hw.rc.cmd[1] = 0 | (in_texcoords << R300_RS_CNTL_TC_CNT_SHIFT) | (col_interp_nr << R300_RS_CNTL_CI_CNT_SHIFT) | R300_RS_CNTL_0_UNKNOWN_18; @@ -1623,9 +1596,7 @@ void r300_setup_rs_unit(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 +void static inline setup_vertex_shader_fragment(r300ContextPtr r300, int dest, struct r300_vertex_shader_fragment *vsf) { @@ -1645,8 +1616,7 @@ void static inline setup_vertex_shader_fragment(r300ContextPtr r300, 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]); + 4 * (dest & 0xff)] = (vsf->body.d[i]); bump_vpu_count(r300->hw.vpi.cmd, vsf->length + 4 * (dest & 0xff)); break; @@ -1655,8 +1625,7 @@ void static inline setup_vertex_shader_fragment(r300ContextPtr r300, 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]); + 4 * (dest & 0xff)] = (vsf->body.d[i]); bump_vpu_count(r300->hw.vpp.cmd, vsf->length + 4 * (dest & 0xff)); break; @@ -1757,16 +1726,13 @@ void r300SetupVertexShader(r300ContextPtr rmesa) r300GenerateSimpleVertexShader(rmesa); setup_vertex_shader_fragment(rmesa, VSF_DEST_PROGRAM, - &(rmesa->state.vertex_shader. - program)); + &(rmesa->state.vertex_shader.program)); #if 0 setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN1, - &(rmesa->state.vertex_shader. - unknown1)); + &(rmesa->state.vertex_shader.unknown1)); setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN2, - &(rmesa->state.vertex_shader. - unknown2)); + &(rmesa->state.vertex_shader.unknown2)); #endif R300_STATECHANGE(rmesa, pvs); @@ -1806,10 +1772,8 @@ void r300SetupVertexProgram(r300ContextPtr rmesa) ((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 */ , + 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); @@ -1819,16 +1783,13 @@ void r300SetupVertexProgram(r300ContextPtr rmesa) ((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)); + 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)); + &(rmesa->state.vertex_shader.unknown1)); setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN2, - &(rmesa->state.vertex_shader. - unknown2)); + &(rmesa->state.vertex_shader.unknown2)); #endif inst_count = prog->program.length / 4 - 1; @@ -1984,8 +1945,7 @@ void r300SetupPixelShader(r300ContextPtr rmesa) | (rp->node[i]. alu_end << R300_PFS_NODE_ALU_END_SHIFT) | (rp->node[i]. - tex_offset << - R300_PFS_NODE_TEX_OFFSET_SHIFT) + tex_offset << R300_PFS_NODE_TEX_OFFSET_SHIFT) | (rp->node[i]. tex_end << R300_PFS_NODE_TEX_END_SHIFT) | rp->node[i].flags; /* ( (k==3) ? R300_PFS_NODE_LAST_NODE : 0); */ @@ -2072,8 +2032,7 @@ void r300ResetHwState(r300ContextPtr r300) r300ColorMask(ctx, ctx->Color.ColorMask[RCOMP], ctx->Color.ColorMask[GCOMP], - ctx->Color.ColorMask[BCOMP], - ctx->Color.ColorMask[ACOMP]); + ctx->Color.ColorMask[BCOMP], ctx->Color.ColorMask[ACOMP]); r300Enable(ctx, GL_DEPTH_TEST, ctx->Depth.Test); r300DepthMask(ctx, ctx->Depth.Mask); @@ -2083,8 +2042,7 @@ void r300ResetHwState(r300ContextPtr r300) r300Enable(ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled); r300StencilMaskSeparate(ctx, 0, ctx->Stencil.WriteMask[0]); r300StencilFuncSeparate(ctx, 0, ctx->Stencil.Function[0], - ctx->Stencil.Ref[0], - ctx->Stencil.ValueMask[0]); + ctx->Stencil.Ref[0], ctx->Stencil.ValueMask[0]); r300StencilOpSeparate(ctx, 0, ctx->Stencil.FailFunc[0], ctx->Stencil.ZFailFunc[0], ctx->Stencil.ZPassFunc[0]); @@ -2150,13 +2108,11 @@ void r300ResetHwState(r300ContextPtr r300) 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) + 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) + 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; @@ -2165,8 +2121,7 @@ void r300ResetHwState(r300ContextPtr r300) R300_GB_TILE_ENABLE | R300_GB_TILE_PIPE_COUNT_RV300 | R300_GB_TILE_SIZE_16; /* 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_SELECT] = R300_GB_FOG_SELECT_1_1_W; r300->hw.gb_misc.cmd[R300_GB_MISC_AA_CONFIG] = R300_AA_DISABLE; /* No antialiasing */ r300->hw.unk4200.cmd[1] = r300PackFloat32(0.0); @@ -2238,12 +2193,10 @@ void r300ResetHwState(r300ContextPtr r300) r300->hw.cb.cmd[R300_CB_OFFSET] = r300->radeon.state.color.drawOffset + r300->radeon.radeonScreen->fbLocation; - r300->hw.cb.cmd[R300_CB_PITCH] = - r300->radeon.state.color.drawPitch; + r300->hw.cb.cmd[R300_CB_PITCH] = r300->radeon.state.color.drawPitch; if (r300->radeon.radeonScreen->cpp == 4) - r300->hw.cb.cmd[R300_CB_PITCH] |= - R300_COLOR_FORMAT_ARGB8888; + r300->hw.cb.cmd[R300_CB_PITCH] |= R300_COLOR_FORMAT_ARGB8888; else r300->hw.cb.cmd[R300_CB_PITCH] |= R300_COLOR_FORMAT_RGB565; @@ -2267,12 +2220,10 @@ void r300ResetHwState(r300ContextPtr r300) switch (ctx->Visual.depthBits) { case 16: - r300->hw.zstencil_format.cmd[1] = - R300_DEPTH_FORMAT_16BIT_INT_Z; + r300->hw.zstencil_format.cmd[1] = R300_DEPTH_FORMAT_16BIT_INT_Z; break; case 24: - r300->hw.zstencil_format.cmd[1] = - R300_DEPTH_FORMAT_24BIT_INT_Z; + r300->hw.zstencil_format.cmd[1] = R300_DEPTH_FORMAT_24BIT_INT_Z; break; default: fprintf(stderr, "Error: Unsupported depth %d... exiting\n", @@ -2289,8 +2240,7 @@ void r300ResetHwState(r300ContextPtr r300) r300->hw.zb.cmd[R300_ZB_OFFSET] = r300->radeon.radeonScreen->depthOffset + r300->radeon.radeonScreen->fbLocation; - r300->hw.zb.cmd[R300_ZB_PITCH] = - r300->radeon.radeonScreen->depthPitch; + r300->hw.zb.cmd[R300_ZB_PITCH] = r300->radeon.radeonScreen->depthPitch; if (r300->radeon.sarea->tiling_enabled) { /* Turn off when clearing buffers ? */ @@ -2313,8 +2263,7 @@ void r300ResetHwState(r300ContextPtr r300) if (has_tcl) { r300->hw.vps.cmd[R300_VPS_ZERO_0] = 0; r300->hw.vps.cmd[R300_VPS_ZERO_1] = 0; - r300->hw.vps.cmd[R300_VPS_POINTSIZE] = - r300PackFloat32(1.0); + r300->hw.vps.cmd[R300_VPS_POINTSIZE] = r300PackFloat32(1.0); r300->hw.vps.cmd[R300_VPS_ZERO_3] = 0; } //END: TODO -- cgit v1.2.3 From 76d7b62cd27fba8b5739e6523fdbf9a14eedefe7 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 14:17:16 +0000 Subject: r300: Indented r300_cmdbuf.[ch]. --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 78 +++++++++++---------------------- src/mesa/drivers/dri/r300/r300_cmdbuf.h | 9 ++-- 2 files changed, 29 insertions(+), 58 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 294fcd75948..37cb508d723 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -87,8 +87,7 @@ int r300FlushCmdBufLocked(r300ContextPtr r300, const char *caller) if (r300->radeon.state.scissor.enabled) { cmd.nbox = r300->radeon.state.scissor.numClipRects; cmd.boxes = - (drm_clip_rect_t *) r300->radeon.state.scissor. - pClipRects; + (drm_clip_rect_t *) r300->radeon.state.scissor.pClipRects; } else { cmd.nbox = r300->radeon.numClipRects; cmd.boxes = (drm_clip_rect_t *) r300->radeon.pClipRects; @@ -128,8 +127,7 @@ int r300FlushCmdBuf(r300ContextPtr r300, const char *caller) return ret; } -void r300_print_state_atom(r300ContextPtr r300, - struct r300_state_atom *state) +void r300_print_state_atom(r300ContextPtr r300, struct r300_state_atom *state) { int i; int dwords = (*state->check) (r300, state); @@ -149,8 +147,7 @@ void r300_print_state_atom(r300ContextPtr r300, * The caller must have ensured that there is enough space in the command * buffer. */ -static __inline__ void r300DoEmitState(r300ContextPtr r300, - GLboolean dirty) +static __inline__ void r300DoEmitState(r300ContextPtr r300, GLboolean dirty) { struct r300_state_atom *atom; uint32_t *dest; @@ -259,8 +256,7 @@ static int check_##NM( r300ContextPtr r300, \ #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(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 @@ -295,8 +291,7 @@ void r300InitCmdBuf(r300ContextPtr r300) /* Initialize state atoms */ ALLOC_STATE(vpt, always, R300_VPT_CMDSIZE, "vpt", 0); - r300->hw.vpt.cmd[R300_VPT_CMD_0] = - cmdpacket0(R300_SE_VPORT_XSCALE, 6); + r300->hw.vpt.cmd[R300_VPT_CMD_0] = cmdpacket0(R300_SE_VPORT_XSCALE, 6); ALLOC_STATE(vap_cntl, always, 2, "vap_cntl", 0); r300->hw.vap_cntl.cmd[0] = cmdpacket0(R300_VAP_CNTL, 1); ALLOC_STATE(vte, always, 3, "vte", 0); @@ -304,8 +299,7 @@ void r300InitCmdBuf(r300ContextPtr r300) ALLOC_STATE(unk2134, always, 3, "unk2134", 0); r300->hw.unk2134.cmd[0] = cmdpacket0(0x2134, 2); ALLOC_STATE(vap_cntl_status, always, 2, "vap_cntl_status", 0); - r300->hw.vap_cntl_status.cmd[0] = - cmdpacket0(R300_VAP_CNTL_STATUS, 1); + r300->hw.vap_cntl_status.cmd[0] = cmdpacket0(R300_VAP_CNTL_STATUS, 1); ALLOC_STATE(vir[0], variable, R300_VIR_CMDSIZE, "vir/0", 0); r300->hw.vir[0].cmd[R300_VIR_CMD_0] = cmdpacket0(R300_VAP_INPUT_ROUTE_0_0, 1); @@ -313,8 +307,7 @@ void r300InitCmdBuf(r300ContextPtr r300) r300->hw.vir[1].cmd[R300_VIR_CMD_0] = cmdpacket0(R300_VAP_INPUT_ROUTE_1_0, 1); ALLOC_STATE(vic, always, R300_VIC_CMDSIZE, "vic", 0); - r300->hw.vic.cmd[R300_VIC_CMD_0] = - cmdpacket0(R300_VAP_INPUT_CNTL_0, 2); + r300->hw.vic.cmd[R300_VIC_CMD_0] = cmdpacket0(R300_VAP_INPUT_CNTL_0, 2); ALLOC_STATE(unk21DC, always, 2, "unk21DC", 0); r300->hw.unk21DC.cmd[0] = cmdpacket0(0x21DC, 1); ALLOC_STATE(unk221C, always, 2, "unk221C", 0); @@ -363,11 +356,9 @@ void r300InitCmdBuf(r300ContextPtr r300) r300->hw.zbs.cmd[R300_ZBS_CMD_0] = cmdpacket0(R300_RE_ZBIAS_T_FACTOR, 4); ALLOC_STATE(occlusion_cntl, always, 2, "occlusion_cntl", 0); - r300->hw.occlusion_cntl.cmd[0] = - cmdpacket0(R300_RE_OCCLUSION_CNTL, 1); + r300->hw.occlusion_cntl.cmd[0] = cmdpacket0(R300_RE_OCCLUSION_CNTL, 1); ALLOC_STATE(cul, always, R300_CUL_CMDSIZE, "cul", 0); - r300->hw.cul.cmd[R300_CUL_CMD_0] = - cmdpacket0(R300_RE_CULL_CNTL, 1); + r300->hw.cul.cmd[R300_CUL_CMD_0] = cmdpacket0(R300_RE_CULL_CNTL, 1); ALLOC_STATE(unk42C0, always, 3, "unk42C0", 0); r300->hw.unk42C0.cmd[0] = cmdpacket0(0x42C0, 2); ALLOC_STATE(rc, always, R300_RC_CMDSIZE, "rc", 0); @@ -388,44 +379,34 @@ void r300InitCmdBuf(r300ContextPtr r300) ALLOC_STATE(unk46A4, always, 6, "unk46A4", 0); r300->hw.unk46A4.cmd[0] = cmdpacket0(0x46A4, 5); ALLOC_STATE(fpi[0], variable, R300_FPI_CMDSIZE, "fpi/0", 0); - r300->hw.fpi[0].cmd[R300_FPI_CMD_0] = - cmdpacket0(R300_PFS_INSTR0_0, 1); + r300->hw.fpi[0].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR0_0, 1); ALLOC_STATE(fpi[1], variable, R300_FPI_CMDSIZE, "fpi/1", 1); - r300->hw.fpi[1].cmd[R300_FPI_CMD_0] = - cmdpacket0(R300_PFS_INSTR1_0, 1); + r300->hw.fpi[1].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR1_0, 1); ALLOC_STATE(fpi[2], variable, R300_FPI_CMDSIZE, "fpi/2", 2); - r300->hw.fpi[2].cmd[R300_FPI_CMD_0] = - cmdpacket0(R300_PFS_INSTR2_0, 1); + r300->hw.fpi[2].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR2_0, 1); ALLOC_STATE(fpi[3], variable, R300_FPI_CMDSIZE, "fpi/3", 3); - r300->hw.fpi[3].cmd[R300_FPI_CMD_0] = - cmdpacket0(R300_PFS_INSTR3_0, 1); + r300->hw.fpi[3].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR3_0, 1); ALLOC_STATE(fogs, always, R300_FOGS_CMDSIZE, "fogs", 0); - r300->hw.fogs.cmd[R300_FOGS_CMD_0] = - cmdpacket0(R300_RE_FOG_STATE, 1); + r300->hw.fogs.cmd[R300_FOGS_CMD_0] = cmdpacket0(R300_RE_FOG_STATE, 1); ALLOC_STATE(fogc, always, R300_FOGC_CMDSIZE, "fogc", 0); - r300->hw.fogc.cmd[R300_FOGC_CMD_0] = - cmdpacket0(R300_FOG_COLOR_R, 3); + r300->hw.fogc.cmd[R300_FOGC_CMD_0] = cmdpacket0(R300_FOG_COLOR_R, 3); ALLOC_STATE(at, always, R300_AT_CMDSIZE, "at", 0); r300->hw.at.cmd[R300_AT_CMD_0] = cmdpacket0(R300_PP_ALPHA_TEST, 2); ALLOC_STATE(unk4BD8, always, 2, "unk4BD8", 0); r300->hw.unk4BD8.cmd[0] = cmdpacket0(0x4BD8, 1); ALLOC_STATE(fpp, variable, R300_FPP_CMDSIZE, "fpp", 0); - r300->hw.fpp.cmd[R300_FPP_CMD_0] = - cmdpacket0(R300_PFS_PARAM_0_X, 0); + r300->hw.fpp.cmd[R300_FPP_CMD_0] = cmdpacket0(R300_PFS_PARAM_0_X, 0); ALLOC_STATE(unk4E00, always, 2, "unk4E00", 0); r300->hw.unk4E00.cmd[0] = cmdpacket0(0x4E00, 1); ALLOC_STATE(bld, always, R300_BLD_CMDSIZE, "bld", 0); r300->hw.bld.cmd[R300_BLD_CMD_0] = cmdpacket0(R300_RB3D_CBLEND, 2); ALLOC_STATE(cmk, always, R300_CMK_CMDSIZE, "cmk", 0); - r300->hw.cmk.cmd[R300_CMK_CMD_0] = - cmdpacket0(R300_RB3D_COLORMASK, 1); + r300->hw.cmk.cmd[R300_CMK_CMD_0] = cmdpacket0(R300_RB3D_COLORMASK, 1); ALLOC_STATE(blend_color, always, 4, "blend_color", 0); r300->hw.blend_color.cmd[0] = cmdpacket0(R300_RB3D_BLEND_COLOR, 3); ALLOC_STATE(cb, always, R300_CB_CMDSIZE, "cb", 0); - r300->hw.cb.cmd[R300_CB_CMD_0] = - cmdpacket0(R300_RB3D_COLOROFFSET0, 1); - r300->hw.cb.cmd[R300_CB_CMD_1] = - cmdpacket0(R300_RB3D_COLORPITCH0, 1); + r300->hw.cb.cmd[R300_CB_CMD_0] = cmdpacket0(R300_RB3D_COLOROFFSET0, 1); + r300->hw.cb.cmd[R300_CB_CMD_1] = cmdpacket0(R300_RB3D_COLORPITCH0, 1); ALLOC_STATE(unk4E50, always, 10, "unk4E50", 0); r300->hw.unk4E50.cmd[0] = cmdpacket0(0x4E50, 9); ALLOC_STATE(unk4E88, always, 2, "unk4E88", 0); @@ -439,8 +420,7 @@ void r300InitCmdBuf(r300ContextPtr r300) r300->hw.zstencil_format.cmd[0] = cmdpacket0(R300_RB3D_ZSTENCIL_FORMAT, 4); ALLOC_STATE(zb, always, R300_ZB_CMDSIZE, "zb", 0); - r300->hw.zb.cmd[R300_ZB_CMD_0] = - cmdpacket0(R300_RB3D_DEPTHOFFSET, 2); + r300->hw.zb.cmd[R300_ZB_CMD_0] = cmdpacket0(R300_RB3D_DEPTHOFFSET, 2); ALLOC_STATE(unk4F28, always, 2, "unk4F28", 0); r300->hw.unk4F28.cmd[0] = cmdpacket0(0x4F28, 1); ALLOC_STATE(unk4F30, always, 3, "unk4F30", 0); @@ -473,28 +453,24 @@ void r300InitCmdBuf(r300ContextPtr r300) cmdpacket0(R300_TX_FILTER1_0, 0); ALLOC_STATE(tex.size, variable, mtu + 1, "tex_size", 0); - r300->hw.tex.size.cmd[R300_TEX_CMD_0] = - cmdpacket0(R300_TX_SIZE_0, 0); + r300->hw.tex.size.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_SIZE_0, 0); ALLOC_STATE(tex.format, variable, mtu + 1, "tex_format", 0); r300->hw.tex.format.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_FORMAT_0, 0); ALLOC_STATE(tex.pitch, variable, mtu + 1, "tex_pitch", 0); - r300->hw.tex.pitch.cmd[R300_TEX_CMD_0] = - cmdpacket0(R300_TX_PITCH_0, 0); + r300->hw.tex.pitch.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_PITCH_0, 0); ALLOC_STATE(tex.offset, variable, mtu + 1, "tex_offset", 0); r300->hw.tex.offset.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_OFFSET_0, 0); - ALLOC_STATE(tex.chroma_key, variable, mtu + 1, "tex_chroma_key", - 0); + ALLOC_STATE(tex.chroma_key, variable, mtu + 1, "tex_chroma_key", 0); r300->hw.tex.chroma_key.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_CHROMA_KEY_0, 0); - ALLOC_STATE(tex.border_color, variable, mtu + 1, - "tex_border_color", 0); + ALLOC_STATE(tex.border_color, variable, mtu + 1, "tex_border_color", 0); r300->hw.tex.border_color.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_BORDER_COLOR_0, 0); @@ -650,8 +626,7 @@ void r300EmitBlit(r300ContextPtr rmesa, assert(w < (1 << 16)); assert(h < (1 << 16)); - cmd = (drm_r300_cmd_header_t *) r300AllocCmdBuf(rmesa, 8, - __FUNCTION__); + cmd = (drm_r300_cmd_header_t *) r300AllocCmdBuf(rmesa, 8, __FUNCTION__); cmd[0].header.cmd_type = R300_CMD_PACKET3; cmd[0].header.pad0 = R300_CMD_PACKET3_RAW; @@ -678,8 +653,7 @@ void r300EmitWait(r300ContextPtr rmesa, GLuint flags) assert(!(flags & ~(R300_WAIT_2D | R300_WAIT_3D))); - cmd = (drm_r300_cmd_header_t *) r300AllocCmdBuf(rmesa, 1, - __FUNCTION__); + cmd = (drm_r300_cmd_header_t *) r300AllocCmdBuf(rmesa, 1, __FUNCTION__); cmd[0].u = 0; cmd[0].wait.cmd_type = R300_CMD_WAIT; cmd[0].wait.flags = flags; diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.h b/src/mesa/drivers/dri/r300/r300_cmdbuf.h index f4fec670bfc..9ef1cdbe622 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.h +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.h @@ -52,8 +52,7 @@ extern void r300EmitAOS(r300ContextPtr rmesa, GLuint nr, GLuint offset); * by flushing if necessary. */ static __inline__ void r300EnsureCmdBufSpace(r300ContextPtr r300, - int dwords, - const char *caller) + int dwords, const char *caller) { assert(dwords < r300->cmdbuf.size); @@ -69,8 +68,7 @@ static __inline__ void r300EnsureCmdBufSpace(r300ContextPtr r300, * correct hardware state after an unlock. */ static __inline__ uint32_t *r300RawAllocCmdBuf(r300ContextPtr r300, - int dwords, - const char *caller) + int dwords, const char *caller) { uint32_t *ptr; @@ -91,8 +89,7 @@ static __inline__ uint32_t *r300AllocCmdBuf(r300ContextPtr r300, if (!r300->cmdbuf.count_used) { if (RADEON_DEBUG & DEBUG_IOCTL) fprintf(stderr, - "Reemit state after flush (from %s)\n", - caller); + "Reemit state after flush (from %s)\n", caller); r300EmitState(r300); } -- cgit v1.2.3 From 62ef001de7c16aff459114c1dcc8097270689e6d Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 9 May 2007 08:17:57 -0600 Subject: add pointers to git repo for drm/libpciaccess, replace & with & --- docs/fbdev-dri.html | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/fbdev-dri.html b/docs/fbdev-dri.html index 294ddb1e057..c7f59bb0c2f 100644 --- a/docs/fbdev-dri.html +++ b/docs/fbdev-dri.html @@ -39,6 +39,19 @@ You'll need the DRM and pciaccess libraries. Check with: pkg-config --modversion pciaccess +

    +You can get them from the git repository with: +

    +
    +   git clone git://anongit.freedesktop.org/git/mesa/drm
    +   git clone git://anongit.freedesktop.org/git/xorg/lib/libpciaccess
    +
    + +

    +See the README files in those projects for build/install instructions. +

    + +

    You'll need fbdev header files. Check with:

    @@ -168,7 +181,7 @@ Change to the Mesa/progs/miniglx/ directory and start the sample_server program in the background:

    -   ./sample_server &
    +   ./sample_server &
     

    -- cgit v1.2.3 From 7b165de5f8a4c3d99b8b9f1820e12d5899b3884f Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 14:19:45 +0000 Subject: r300: Last of the indent changes. :) --- src/mesa/drivers/dri/r300/r300_emit.h | 12 ++++------ src/mesa/drivers/dri/r300/r300_fragprog.c | 2 +- src/mesa/drivers/dri/r300/r300_ioctl.c | 31 ++++++++----------------- src/mesa/drivers/dri/r300/r300_maos.c | 38 +++++++++++-------------------- src/mesa/drivers/dri/r300/r300_program.h | 6 ++--- src/mesa/drivers/dri/r300/r300_render.c | 9 +++----- src/mesa/drivers/dri/r300/r300_shader.c | 9 +++----- src/mesa/drivers/dri/r300/r300_texmem.c | 7 +++--- src/mesa/drivers/dri/r300/r300_vertprog.c | 3 +-- 9 files changed, 41 insertions(+), 76 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h index cf428524d6f..8922d8c57d9 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.h +++ b/src/mesa/drivers/dri/r300/r300_emit.h @@ -209,8 +209,7 @@ void static inline end_3d(r300ContextPtr rmesa) drm_radeon_cmd_header_t *cmd = NULL; cmd = - (drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, 1, - __FUNCTION__); + (drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, 1, __FUNCTION__); cmd[0].header.cmd_type = R300_CMD_END3D; } @@ -219,8 +218,7 @@ void static inline cp_delay(r300ContextPtr rmesa, unsigned short count) drm_radeon_cmd_header_t *cmd = NULL; cmd = - (drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, 1, - __FUNCTION__); + (drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, 1, __FUNCTION__); cmd[0].i = cmdcpdelay(count); } @@ -229,16 +227,14 @@ void static inline cp_wait(r300ContextPtr rmesa, unsigned char flags) drm_radeon_cmd_header_t *cmd = NULL; cmd = - (drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, 1, - __FUNCTION__); + (drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, 1, __FUNCTION__); cmd[0].i = cmdwait(flags); } /** * fire vertex buffer */ -static void inline -fire_AOS(r300ContextPtr rmesa, int vertex_count, int type) +static void inline fire_AOS(r300ContextPtr rmesa, int vertex_count, int type) { int cmd_reserved = 0; int cmd_written = 0; diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.c b/src/mesa/drivers/dri/r300/r300_fragprog.c index 127aa12eb37..0efdf686f03 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog.c @@ -918,7 +918,7 @@ static void emit_tex(struct r300_fragment_program *rp, */ gl_state_index tokens[STATE_LENGTH] = { STATE_INTERNAL, STATE_R300_TEXRECT_FACTOR, 0, 0, - 0 + 0 }; int factor_index; GLuint factorreg; diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index 05fe5e2c904..884a7d49e45 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -127,8 +127,7 @@ static void r300ClearBuffer(r300ContextPtr r300, int flags, int buffer) if (flags & CLEARBUFFER_DEPTH) { t1 |= R300_RB3D_Z_WRITE_ONLY; t2 |= - (R300_ZS_ALWAYS << - R300_RB3D_ZS1_DEPTH_FUNC_SHIFT); + (R300_ZS_ALWAYS << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT); } else { t1 |= R300_RB3D_Z_DISABLED_1; // disable } @@ -159,9 +158,7 @@ static void r300ClearBuffer(r300ContextPtr r300, int flags, int buffer) e32(r300->state.stencil.clear); } - cmd2 = - (drm_r300_cmd_header_t *) r300AllocCmdBuf(r300, 9, - __FUNCTION__); + cmd2 = (drm_r300_cmd_header_t *) r300AllocCmdBuf(r300, 9, __FUNCTION__); cmd2[0].packet3.cmd_type = R300_CMD_PACKET3; cmd2[0].packet3.packet = R300_CMD_PACKET3_CLEAR; cmd2[1].u = r300PackFloat32(dPriv->w / 2.0); @@ -297,8 +294,7 @@ static void r300EmitClearState(GLcontext * ctx) R300_STATECHANGE(r300, fpi[3]); reg_start(R300_PFS_INSTR0_0, 0); - e32(FP_INSTRC - (MAD, FP_ARGC(SRC0C_XYZ), FP_ARGC(ONE), FP_ARGC(ZERO))); + e32(FP_INSTRC(MAD, FP_ARGC(SRC0C_XYZ), FP_ARGC(ONE), FP_ARGC(ZERO))); reg_start(R300_PFS_INSTR1_0, 0); e32(FP_SELC(0, NO, XYZ, FP_TMP(0), 0, 0)); @@ -396,8 +392,7 @@ static void r300Clear(GLcontext * ctx, GLbitfield mask) } if (flags & BUFFER_BIT_BACK_LEFT) { - r300ClearBuffer(r300, bits | CLEARBUFFER_COLOR, - swapped ^ 1); + r300ClearBuffer(r300, bits | CLEARBUFFER_COLOR, swapped ^ 1); bits = 0; } @@ -433,8 +428,7 @@ static void r300RefillCurrentDmaRegion(r300ContextPtr rmesa, int size) } if (rmesa->dma.current.buf) - r300ReleaseDmaRegion(rmesa, &rmesa->dma.current, - __FUNCTION__); + r300ReleaseDmaRegion(rmesa, &rmesa->dma.current, __FUNCTION__); if (rmesa->dma.nr_released_bufs > 4) r300FlushCmdBuf(rmesa, __FUNCTION__); @@ -477,8 +471,7 @@ static void r300RefillCurrentDmaRegion(r300ContextPtr rmesa, int size) } void r300ReleaseDmaRegion(r300ContextPtr rmesa, - struct r300_dma_region *region, - const char *caller) + struct r300_dma_region *region, const char *caller) { if (RADEON_DEBUG & DEBUG_IOCTL) fprintf(stderr, "%s from %s\n", __FUNCTION__, caller); @@ -554,8 +547,7 @@ static void r300RefillCurrentDmaRegion(r300ContextPtr rmesa) } if (rmesa->dma.current.buf) - r300ReleaseDmaRegion(rmesa, &rmesa->dma.current, - __FUNCTION__); + r300ReleaseDmaRegion(rmesa, &rmesa->dma.current, __FUNCTION__); if (rmesa->dma.nr_released_bufs > 4) r300FlushCmdBuf(rmesa, __FUNCTION__); @@ -612,8 +604,7 @@ static void r300RefillCurrentDmaRegion(r300ContextPtr rmesa) } void r300ReleaseDmaRegion(r300ContextPtr rmesa, - struct r300_dma_region *region, - const char *caller) + struct r300_dma_region *region, const char *caller) { if (RADEON_DEBUG & DEBUG_IOCTL) fprintf(stderr, "%s from %s\n", __FUNCTION__, caller); @@ -723,8 +714,7 @@ GLboolean r300IsGartMemory(r300ContextPtr rmesa, const GLvoid * pointer, return valid; } -GLuint r300GartOffsetFromVirtual(r300ContextPtr rmesa, - const GLvoid * pointer) +GLuint r300GartOffsetFromVirtual(r300ContextPtr rmesa, const GLvoid * pointer) { int offset = (char *)pointer - @@ -736,8 +726,7 @@ GLuint r300GartOffsetFromVirtual(r300ContextPtr rmesa, || offset > rmesa->radeon.radeonScreen->gartTextures.size) return ~0; else - return rmesa->radeon.radeonScreen->gart_texture_offset + - offset; + return rmesa->radeon.radeonScreen->gart_texture_offset + offset; } void r300InitIoctlFuncs(struct dd_function_table *functions) diff --git a/src/mesa/drivers/dri/r300/r300_maos.c b/src/mesa/drivers/dri/r300/r300_maos.c index d3105e0d160..15bb41ddc0c 100644 --- a/src/mesa/drivers/dri/r300/r300_maos.c +++ b/src/mesa/drivers/dri/r300/r300_maos.c @@ -137,8 +137,7 @@ static void emit_vec12(GLcontext * ctx, if (RADEON_DEBUG & DEBUG_VERTS) fprintf(stderr, "%s count %d stride %d out %p data %p\n", - __FUNCTION__, count, stride, (void *)out, - (void *)data); + __FUNCTION__, count, stride, (void *)out, (void *)data); if (stride == 12) COPY_DWORDS(out, data, count * 3); @@ -233,8 +232,7 @@ void r300EmitElts(GLcontext * ctx, void *elts, unsigned long n_elts, assert(elt_size == 2 || elt_size == 4); if (r300IsGartMemory(rmesa, elts, n_elts * elt_size)) { - rvb->address = - rmesa->radeon.radeonScreen->gartTextures.map; + rvb->address = rmesa->radeon.radeonScreen->gartTextures.map; rvb->start = ((char *)elts) - rvb->address; rvb->aos_offset = rmesa->radeon.radeonScreen->gart_texture_offset + @@ -357,8 +355,7 @@ static GLuint t_vir1(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]) | R300_INPUT_ROUTE_ENABLE; dst[i >> 1] |= (t_swizzle(swizzle[i + 1]) | R300_INPUT_ROUTE_ENABLE) << 16; @@ -425,8 +422,7 @@ int r300EmitArrays(GLcontext * ctx) CURRENT_VERTEX_SHADER(ctx); inputs = prog->inputs; InputsRead = CURRENT_VERTEX_SHADER(ctx)->key.InputsRead; - OutputsWritten = - CURRENT_VERTEX_SHADER(ctx)->key.OutputsWritten; + OutputsWritten = CURRENT_VERTEX_SHADER(ctx)->key.OutputsWritten; } else { DECLARE_RENDERINPUTS(inputs_bitset); inputs = r300->state.sw_tcl_inputs; @@ -441,8 +437,7 @@ int r300EmitArrays(GLcontext * ctx) assert(RENDERINPUTS_TEST(inputs_bitset, _TNL_ATTRIB_NORMAL) == 0); - assert(RENDERINPUTS_TEST - (inputs_bitset, _TNL_ATTRIB_COLOR0)); + assert(RENDERINPUTS_TEST(inputs_bitset, _TNL_ATTRIB_COLOR0)); InputsRead |= 1 << VERT_ATTRIB_COLOR0; OutputsWritten |= 1 << VERT_RESULT_COL0; @@ -455,8 +450,7 @@ int r300EmitArrays(GLcontext * ctx) if (RENDERINPUTS_TEST (inputs_bitset, _TNL_ATTRIB_TEX(i))) { InputsRead |= 1 << (VERT_ATTRIB_TEX0 + i); - OutputsWritten |= - 1 << (VERT_RESULT_TEX0 + i); + OutputsWritten |= 1 << (VERT_RESULT_TEX0 + i); } for (i = 0, nr = 0; i < VERT_ATTRIB_MAX; i++) @@ -482,11 +476,9 @@ int r300EmitArrays(GLcontext * ctx) if (InputsRead & (1 << VERT_ATTRIB_COLOR1)) inputs[VERT_ATTRIB_COLOR1] = 3; - for (i = VERT_ATTRIB_TEX0; i <= VERT_ATTRIB_TEX7; - i++) + for (i = VERT_ATTRIB_TEX0; i <= VERT_ATTRIB_TEX7; i++) if (InputsRead & (1 << i)) - inputs[i] = - 6 + (i - VERT_ATTRIB_TEX0); + inputs[i] = 6 + (i - VERT_ATTRIB_TEX0); } RENDERINPUTS_COPY(rmesa->state.render_inputs_bitset, @@ -528,9 +520,8 @@ int r300EmitArrays(GLcontext * ctx) } #endif /* MESA_BIG_ENDIAN */ - if (r300IsGartMemory - (rmesa, VB->AttribPtr[tab[i]].data, - /*(count-1)*stride */ 4)) { + if (r300IsGartMemory(rmesa, VB->AttribPtr[tab[i]].data, + /*(count-1)*stride */ 4)) { if (VB->AttribPtr[tab[i]].stride % 4) return R300_FALLBACK_TCL; @@ -540,8 +531,7 @@ int r300EmitArrays(GLcontext * ctx) rmesa->state.aos[i].aos_offset = r300GartOffsetFromVirtual(rmesa, VB-> - AttribPtr[tab[i]]. - data); + AttribPtr[tab[i]].data); rmesa->state.aos[i].aos_stride = VB->AttribPtr[tab[i]].stride / 4; @@ -639,8 +629,7 @@ int r300EmitArrays(GLcontext * ctx) 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_1] |= (4 << (3 * i)); rmesa->state.aos_count = nr; @@ -696,7 +685,6 @@ void r300ReleaseArrays(GLcontext * ctx) r300ReleaseDmaRegion(rmesa, &rmesa->state.elt_dma, __FUNCTION__); for (i = 0; i < rmesa->state.aos_count; i++) { - r300ReleaseDmaRegion(rmesa, &rmesa->state.aos[i], - __FUNCTION__); + r300ReleaseDmaRegion(rmesa, &rmesa->state.aos[i], __FUNCTION__); } } diff --git a/src/mesa/drivers/dri/r300/r300_program.h b/src/mesa/drivers/dri/r300/r300_program.h index 3210660df1c..eddd783f073 100644 --- a/src/mesa/drivers/dri/r300/r300_program.h +++ b/src/mesa/drivers/dri/r300/r300_program.h @@ -145,6 +145,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ((arg1) << R300_FPI2_ARG1A_SHIFT) | \ ((arg2) << R300_FPI2_ARG2A_SHIFT)) -extern void debug_vp(GLcontext *ctx, struct gl_vertex_program *vp); - -#endif /* __R300_PROGRAM_H__ */ +extern void debug_vp(GLcontext * ctx, struct gl_vertex_program *vp); + +#endif /* __R300_PROGRAM_H__ */ diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index be10a185875..6b8c908fb3b 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -73,8 +73,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_emit.h" extern int future_hw_tcl_on; -static int r300PrimitiveType(r300ContextPtr rmesa, GLcontext * ctx, - int prim) +static int r300PrimitiveType(r300ContextPtr rmesa, GLcontext * ctx, int prim) { int type = -1; @@ -309,8 +308,7 @@ static GLboolean r300RunRender(GLcontext * ctx, GLuint start = VB->Primitive[i].start; GLuint length = VB->Primitive[i].count; - r300RunRenderPrimitive(rmesa, ctx, start, start + length, - prim); + r300RunRenderPrimitive(rmesa, ctx, start, start + length, prim); } reg_start(R300_RB3D_DSTCACHE_CTLSTAT, 0); @@ -359,8 +357,7 @@ int r300Fallback(GLcontext * ctx) FALLBACK_IF(ctx->Color.ColorLogicOpEnabled); - if (ctx->Extensions.NV_point_sprite - || ctx->Extensions.ARB_point_sprite) + if (ctx->Extensions.NV_point_sprite || ctx->Extensions.ARB_point_sprite) FALLBACK_IF(ctx->Point.PointSprite); if (!r300->disable_lowimpact_fallback) { diff --git a/src/mesa/drivers/dri/r300/r300_shader.c b/src/mesa/drivers/dri/r300/r300_shader.c index 9f300e0d95b..0953d32e3d6 100644 --- a/src/mesa/drivers/dri/r300/r300_shader.c +++ b/src/mesa/drivers/dri/r300/r300_shader.c @@ -54,12 +54,10 @@ static void r300DeleteProgram(GLcontext * ctx, struct gl_program *prog) } static void -r300ProgramStringNotify(GLcontext * ctx, GLenum target, - struct gl_program *prog) +r300ProgramStringNotify(GLcontext * ctx, GLenum target, struct gl_program *prog) { struct r300_vertex_program_cont *vp = (void *)prog; - struct r300_fragment_program *fp = - (struct r300_fragment_program *)prog; + struct r300_fragment_program *fp = (struct r300_fragment_program *)prog; switch (target) { case GL_VERTEX_PROGRAM_ARB: @@ -77,8 +75,7 @@ r300ProgramStringNotify(GLcontext * ctx, GLenum target, } static GLboolean -r300IsProgramNative(GLcontext * ctx, GLenum target, - struct gl_program *prog) +r300IsProgramNative(GLcontext * ctx, GLenum target, struct gl_program *prog) { return 1; } diff --git a/src/mesa/drivers/dri/r300/r300_texmem.c b/src/mesa/drivers/dri/r300/r300_texmem.c index 221dda41b0e..2c8740bff76 100644 --- a/src/mesa/drivers/dri/r300/r300_texmem.c +++ b/src/mesa/drivers/dri/r300/r300_texmem.c @@ -441,10 +441,9 @@ static void uploadSubImage(r300ContextPtr rmesa, r300TexObjPtr t, #if 1 if ((t->tile_bits & R300_TXO_MACRO_TILE) && (texImage->Width * texImage->TexFormat->TexelBytes >= 256) - && - ((!(t->tile_bits & R300_TXO_MICRO_TILE) - && (texImage->Height >= 8)) - || (texImage->Height >= 16))) { + && ((!(t->tile_bits & R300_TXO_MICRO_TILE) + && (texImage->Height >= 8)) + || (texImage->Height >= 16))) { /* weird: R200 disables macro tiling if mip width is smaller than 256 bytes, OR if height is smaller than 8 automatically, but if micro tiling is active the limit is height 16 instead ? */ diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index 4d0c9c27190..3e664e933ef 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -1215,8 +1215,7 @@ static void pos_as_texcoord(struct r300_vertex_program *vp, } static struct r300_vertex_program *build_program(struct r300_vertex_program_key - *wanted_key, - struct gl_vertex_program + *wanted_key, struct gl_vertex_program *mesa_vp, GLint wpos_idx) { struct r300_vertex_program *vp; -- cgit v1.2.3 From faf47d9f84d4089e49917bc9a0f7836d3d26436c Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 14:45:42 +0000 Subject: r300: Added a "not implemented yet" comment back. --- src/mesa/drivers/dri/r300/r300_render.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 6b8c908fb3b..c0ce8c0ca22 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -258,6 +258,7 @@ static void r300RunRenderPrimitive(r300ContextPtr rmesa, GLcontext * ctx, if (rmesa->state.VB.Elts) { r300EmitAOS(rmesa, rmesa->state.aos_count, start); if (num_verts > 65535) { + /* not implemented yet */ WARN_ONCE("Too many elts\n"); return; } -- cgit v1.2.3 From fe6a2c4295a138160088fb29a9d89a5d9b8c522a Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 15:07:34 +0000 Subject: r300: Changed r300_run_vb_render calls to r300RunRender in some conditionally disabled code. --- src/mesa/drivers/dri/r300/r300_context.h | 4 ++-- src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 4cc3352ab0f..b7d2552b189 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -914,8 +914,8 @@ extern int r300Fallback(GLcontext * ctx); extern void radeon_vb_to_rvb(r300ContextPtr rmesa, struct radeon_vertex_buffer *rvb, struct vertex_buffer *vb); -extern GLboolean r300_run_vb_render(GLcontext * ctx, - struct tnl_pipeline_stage *stage); +extern GLboolean r300RunRender(GLcontext * ctx, + struct tnl_pipeline_stage *stage); #ifdef RADEON_VTXFMT_A extern void radeon_init_vtxfmt_a(r300ContextPtr rmesa); diff --git a/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c b/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c index a15a17d1d33..bdd731fdf59 100644 --- a/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c +++ b/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c @@ -337,7 +337,7 @@ static void radeonDrawRangeElements(GLcontext *ctx, rmesa->state.VB.elt_min = min; rmesa->state.VB.elt_max = max; - if (r300_run_vb_render(ctx, NULL)) { + if (r300RunRender(ctx, NULL)) { r300ReleaseDmaRegion(rmesa, &rvb, __FUNCTION__); return GL_FALSE; } @@ -398,7 +398,7 @@ static GLboolean radeonDrawArrays( GLcontext *ctx, rmesa->state.VB.elt_min = 0; rmesa->state.VB.elt_max = 0; - if (r300_run_vb_render(ctx, NULL)) + if (r300RunRender(ctx, NULL)) return GL_FALSE; return GL_TRUE; -- cgit v1.2.3 From d28f6d91760374e2eb71b541b0f259f81dd73c69 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 15:19:05 +0000 Subject: r300: Fixed some more function names. Note there might be some calls to the old function names in conditionally disabled code, but I think I've got them all. --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 4 ++-- src/mesa/drivers/dri/r300/r300_context.h | 4 ++-- src/mesa/drivers/dri/r300/r300_fragprog.c | 2 +- src/mesa/drivers/dri/r300/r300_fragprog.h | 2 +- src/mesa/drivers/dri/r300/r300_render.c | 2 +- src/mesa/drivers/dri/r300/r300_shader.c | 2 +- src/mesa/drivers/dri/r300/r300_state.c | 30 ++++++++++++++--------------- src/mesa/drivers/dri/r300/r300_state.h | 6 ++---- src/mesa/drivers/dri/r300/r300_vertprog.c | 6 +++--- src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c | 2 +- 10 files changed, 29 insertions(+), 31 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 37cb508d723..369dc0b366b 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -127,7 +127,7 @@ int r300FlushCmdBuf(r300ContextPtr r300, const char *caller) return ret; } -void r300_print_state_atom(r300ContextPtr r300, struct r300_state_atom *state) +void r300PrintStateAtom(r300ContextPtr r300, struct r300_state_atom *state) { int i; int dwords = (*state->check) (r300, state); @@ -160,7 +160,7 @@ static __inline__ void r300DoEmitState(r300ContextPtr r300, GLboolean dirty) int dwords = (*atom->check) (r300, atom); if (dwords) - r300_print_state_atom(r300, atom); + r300PrintStateAtom(r300, atom); else fprintf(stderr, " skip state %s\n", diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index b7d2552b189..31ce210f8de 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -902,9 +902,9 @@ extern GLboolean r300CreateContext(const __GLcontextModes * glVisual, __DRIcontextPrivate * driContextPriv, void *sharedContextPrivate); -extern int r300_get_num_verts(r300ContextPtr rmesa, int num_verts, int prim); +extern int r300NumVerts(r300ContextPtr rmesa, int num_verts, int prim); -extern void r300_select_vertex_shader(r300ContextPtr r300); +extern void r300SelectVertexShader(r300ContextPtr r300); extern void r300InitShaderFuncs(struct dd_function_table *functions); extern int r300VertexProgUpdateParams(GLcontext * ctx, struct r300_vertex_program_cont *vp, diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.c b/src/mesa/drivers/dri/r300/r300_fragprog.c index 0efdf686f03..7a82dc4ba1b 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog.c @@ -2209,7 +2209,7 @@ static void update_params(struct r300_fragment_program *rp) _mesa_load_state_parameters(rp->ctx, mp->Base.Parameters); } -void r300_translate_fragment_shader(r300ContextPtr r300, +void r300TranslateFragmentShader(r300ContextPtr r300, struct r300_fragment_program *rp) { struct r300_pfs_compile_state *cs = NULL; diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.h b/src/mesa/drivers/dri/r300/r300_fragprog.h index 79f3e70fa63..218a3c965da 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog.h +++ b/src/mesa/drivers/dri/r300/r300_fragprog.h @@ -98,7 +98,7 @@ typedef struct r300_fragment_program_swizzle { struct r300_fragment_program; -extern void r300_translate_fragment_shader(r300ContextPtr r300, +extern void r300TranslateFragmentShader(r300ContextPtr r300, struct r300_fragment_program *rp); #endif diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index c0ce8c0ca22..a4b8be25bd5 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -343,7 +343,7 @@ int r300Fallback(GLcontext * ctx) if (fp) { if (!fp->translated) - r300_translate_fragment_shader(r300, fp); + r300TranslateFragmentShader(r300, fp); FALLBACK_IF(!fp->translated); } diff --git a/src/mesa/drivers/dri/r300/r300_shader.c b/src/mesa/drivers/dri/r300/r300_shader.c index 0953d32e3d6..f54a4f9f474 100644 --- a/src/mesa/drivers/dri/r300/r300_shader.c +++ b/src/mesa/drivers/dri/r300/r300_shader.c @@ -64,7 +64,7 @@ r300ProgramStringNotify(GLcontext * ctx, GLenum target, struct gl_program *prog) vp->progs = NULL; /*vp->translated = GL_FALSE; memset(&vp->translated, 0, sizeof(struct r300_vertex_program) - sizeof(struct gl_vertex_program)); */ - /*r300_translate_vertex_shader(vp); */ + /*r300TranslateVertexShader(vp); */ break; case GL_FRAGMENT_PROGRAM_ARB: fp->translated = GL_FALSE; diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 2d5b10d3ce2..5a7ba8d0f0a 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -166,7 +166,7 @@ static int blend_factor(GLenum factor, GLboolean is_src) */ /* helper function */ -static void r300_set_blend_cntl(r300ContextPtr r300, int func, int eqn, +static void r300SetBlendCntl(r300ContextPtr r300, int func, int eqn, int cbits, int funcA, int eqnA) { GLuint new_ablend, new_cblend; @@ -200,7 +200,7 @@ static void r300_set_blend_cntl(r300ContextPtr r300, int func, int eqn, } } -static void r300_set_blend_state(GLcontext * ctx) +static void r300SetBlendState(GLcontext * ctx) { r300ContextPtr r300 = R300_CONTEXT(ctx); int func = (R300_BLEND_GL_ONE << R300_SRC_BLEND_SHIFT) | @@ -211,7 +211,7 @@ static void r300_set_blend_state(GLcontext * ctx) int eqnA = R300_COMB_FCN_ADD_CLAMP; if (RGBA_LOGICOP_ENABLED(ctx) || !ctx->Color.BlendEnabled) { - r300_set_blend_cntl(r300, func, eqn, 0, func, eqn); + r300SetBlendCntl(r300, func, eqn, 0, func, eqn); return; } @@ -291,7 +291,7 @@ static void r300_set_blend_state(GLcontext * ctx) return; } - r300_set_blend_cntl(r300, + r300SetBlendCntl(r300, func, eqn, R300_BLEND_UNKNOWN | R300_BLEND_ENABLE, funcA, eqnA); @@ -300,14 +300,14 @@ static void r300_set_blend_state(GLcontext * ctx) static void r300BlendEquationSeparate(GLcontext * ctx, GLenum modeRGB, GLenum modeA) { - r300_set_blend_state(ctx); + r300SetBlendState(ctx); } static void r300BlendFuncSeparate(GLcontext * ctx, GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorA, GLenum dfactorA) { - r300_set_blend_state(ctx); + r300SetBlendState(ctx); } /** @@ -510,7 +510,7 @@ static void r300Enable(GLcontext * ctx, GLenum cap, GLboolean state) case GL_BLEND: case GL_COLOR_LOGIC_OP: - r300_set_blend_state(ctx); + r300SetBlendState(ctx); break; case GL_DEPTH_TEST: @@ -1280,7 +1280,7 @@ static unsigned long gen_fixed_filter(unsigned long f) return f; } -void r300_setup_textures(GLcontext * ctx) +static void r300SetupTextures(GLcontext * ctx) { int i, mtu; struct r300_tex_obj *t; @@ -1442,7 +1442,7 @@ union r300_outputs_written { ((hw_tcl_on) ? (ow).vp_outputs & (1 << (vp_result)) : \ RENDERINPUTS_TEST( (ow.index_bitset), (tnl_attrib) )) -void r300_setup_rs_unit(GLcontext * ctx) +void r300SetupRSUnit(GLcontext * ctx) { r300ContextPtr r300 = R300_CONTEXT(ctx); /* I'm still unsure if these are needed */ @@ -1844,11 +1844,11 @@ void r300UpdateShaders(r300ContextPtr rmesa) rmesa->temp_attrib[i]; } - r300_select_vertex_shader(rmesa); + r300SelectVertexShader(rmesa); vp = (struct r300_vertex_program *) CURRENT_VERTEX_SHADER(ctx); /*if (vp->translated == GL_FALSE) - r300_translate_vertex_shader(vp); */ + r300TranslateVertexShader(vp); */ if (vp->translated == GL_FALSE) { fprintf(stderr, "Failing back to sw-tcl\n"); hw_tcl_on = future_hw_tcl_on = 0; @@ -1869,11 +1869,11 @@ void r300UpdateShaderStates(r300ContextPtr rmesa) r300UpdateTextureState(ctx); r300SetupPixelShader(rmesa); - r300_setup_textures(ctx); + r300SetupTextures(ctx); if ((rmesa->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) r300SetupVertexShader(rmesa); - r300_setup_rs_unit(ctx); + r300SetupRSUnit(ctx); } /* This is probably wrong for some values, I need to test this @@ -1917,7 +1917,7 @@ void r300SetupPixelShader(r300ContextPtr rmesa) if (!rp) /* should only happenen once, just after context is created */ return; - r300_translate_fragment_shader(rmesa, rp); + r300TranslateFragmentShader(rmesa, rp); if (!rp->translated) { fprintf(stderr, "%s: No valid fragment shader, exiting\n", __func__); @@ -2051,7 +2051,7 @@ void r300ResetHwState(r300ContextPtr r300) r300UpdateTextureState(ctx); - r300_set_blend_state(ctx); + r300SetBlendState(ctx); r300AlphaFunc(ctx, ctx->Color.AlphaFunc, ctx->Color.AlphaRef); r300Enable(ctx, GL_ALPHA_TEST, ctx->Color.AlphaEnabled); diff --git a/src/mesa/drivers/dri/r300/r300_state.h b/src/mesa/drivers/dri/r300/r300_state.h index 59e6baec921..00323cd834e 100644 --- a/src/mesa/drivers/dri/r300/r300_state.h +++ b/src/mesa/drivers/dri/r300/r300_state.h @@ -44,7 +44,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. } while(0) #define R300_PRINT_STATE(r300, atom) \ - r300_print_state_atom(r300, &r300->hw.atom) + r300PrintStateAtom(r300, &r300->hw.atom) /* Fire the buffered vertices no matter what. TODO: This has not been implemented yet @@ -69,12 +69,10 @@ extern void r300UpdateDrawBuffer(GLcontext * ctx); extern void r300SetupVertexShader(r300ContextPtr rmesa); extern void r300SetupPixelShader(r300ContextPtr rmesa); -extern void r300_setup_textures(GLcontext * ctx); -extern void r300_setup_rs_unit(GLcontext * ctx); extern void r300UpdateShaders(r300ContextPtr rmesa); extern void r300UpdateShaderStates(r300ContextPtr rmesa); -extern void r300_print_state_atom(r300ContextPtr r300, +extern void r300PrintStateAtom(r300ContextPtr r300, struct r300_state_atom *state); #endif /* __R300_STATE_H__ */ diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index 3e664e933ef..b0a7a66137e 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -410,7 +410,7 @@ static GLboolean valid_dst(struct r300_vertex_program *vp, u_temp_i=VSF_MAX_FRAGMENT_TEMPS-1; \ } while (0) -static void r300_translate_vertex_shader(struct r300_vertex_program *vp, +static void r300TranslateVertexShader(struct r300_vertex_program *vp, struct prog_instruction *vpi) { int i, cur_reg = 0; @@ -1236,12 +1236,12 @@ static struct r300_vertex_program *build_program(struct r300_vertex_program_key vp->num_temporaries = mesa_vp->Base.NumTemporaries; - r300_translate_vertex_shader(vp, mesa_vp->Base.Instructions); + r300TranslateVertexShader(vp, mesa_vp->Base.Instructions); return vp; } -void r300_select_vertex_shader(r300ContextPtr r300) +void r300SelectVertexShader(r300ContextPtr r300) { GLcontext *ctx = ctx = r300->radeon.glCtx; GLuint InputsRead; diff --git a/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c b/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c index bdd731fdf59..f9c4e2db0c9 100644 --- a/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c +++ b/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c @@ -205,7 +205,7 @@ static void radeonDrawRangeElements(GLcontext *ctx, mode == GL_TRIANGLES) { while (count) { - i = r300_get_num_verts(rmesa, MIN2(count, 65535), mode); + i = r300NumVerts(rmesa, MIN2(count, 65535), mode); radeonDrawRangeElements(mode, min, max, i, type, indices); -- cgit v1.2.3 From 4f20fe8a930007ca8fd5ddaf3969902fa60a7714 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 15:21:13 +0000 Subject: r300: Added R300_PRIM_NUM_VERTICES_MASK suggested by Jerome Glisse. --- src/mesa/drivers/dri/r300/r300_reg.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h index 3754a5be395..8131478e548 100644 --- a/src/mesa/drivers/dri/r300/r300_reg.h +++ b/src/mesa/drivers/dri/r300/r300_reg.h @@ -1555,6 +1555,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define R300_PRIM_COLOR_ORDER_BGRA (0 << 6) #define R300_PRIM_COLOR_ORDER_RGBA (1 << 6) #define R300_PRIM_NUM_VERTICES_SHIFT 16 +#define R300_PRIM_NUM_VERTICES_MASK 0xffff /* Draw a primitive from vertex data in arrays loaded via 3D_LOAD_VBPNTR. * Two parameter dwords: -- cgit v1.2.3 From c48e4c6f09e4951a871163537a1e2117116e620b Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 15:28:38 +0000 Subject: r300: Fixed indenting from previous commit d28f6d91760374e2eb71b541b0f259f81dd73c69. --- src/mesa/drivers/dri/r300/r300_fragprog.c | 2 +- src/mesa/drivers/dri/r300/r300_fragprog.h | 2 +- src/mesa/drivers/dri/r300/r300_state.c | 7 +++---- src/mesa/drivers/dri/r300/r300_state.h | 2 +- src/mesa/drivers/dri/r300/r300_vertprog.c | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.c b/src/mesa/drivers/dri/r300/r300_fragprog.c index 7a82dc4ba1b..53866414f93 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog.c @@ -2210,7 +2210,7 @@ static void update_params(struct r300_fragment_program *rp) } void r300TranslateFragmentShader(r300ContextPtr r300, - struct r300_fragment_program *rp) + struct r300_fragment_program *rp) { struct r300_pfs_compile_state *cs = NULL; diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.h b/src/mesa/drivers/dri/r300/r300_fragprog.h index 218a3c965da..b92312aef09 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog.h +++ b/src/mesa/drivers/dri/r300/r300_fragprog.h @@ -99,6 +99,6 @@ typedef struct r300_fragment_program_swizzle { struct r300_fragment_program; extern void r300TranslateFragmentShader(r300ContextPtr r300, - struct r300_fragment_program *rp); + struct r300_fragment_program *rp); #endif diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 5a7ba8d0f0a..af4326ed7e5 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -167,7 +167,7 @@ static int blend_factor(GLenum factor, GLboolean is_src) /* helper function */ static void r300SetBlendCntl(r300ContextPtr r300, int func, int eqn, - int cbits, int funcA, int eqnA) + int cbits, int funcA, int eqnA) { GLuint new_ablend, new_cblend; @@ -292,9 +292,8 @@ static void r300SetBlendState(GLcontext * ctx) } r300SetBlendCntl(r300, - func, eqn, - R300_BLEND_UNKNOWN | R300_BLEND_ENABLE, funcA, - eqnA); + func, eqn, + R300_BLEND_UNKNOWN | R300_BLEND_ENABLE, funcA, eqnA); } static void r300BlendEquationSeparate(GLcontext * ctx, diff --git a/src/mesa/drivers/dri/r300/r300_state.h b/src/mesa/drivers/dri/r300/r300_state.h index 00323cd834e..3b9d8e74041 100644 --- a/src/mesa/drivers/dri/r300/r300_state.h +++ b/src/mesa/drivers/dri/r300/r300_state.h @@ -73,6 +73,6 @@ extern void r300UpdateShaders(r300ContextPtr rmesa); extern void r300UpdateShaderStates(r300ContextPtr rmesa); extern void r300PrintStateAtom(r300ContextPtr r300, - struct r300_state_atom *state); + struct r300_state_atom *state); #endif /* __R300_STATE_H__ */ diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index b0a7a66137e..8b1143758e8 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -411,7 +411,7 @@ static GLboolean valid_dst(struct r300_vertex_program *vp, } while (0) static void r300TranslateVertexShader(struct r300_vertex_program *vp, - struct prog_instruction *vpi) + struct prog_instruction *vpi) { int i, cur_reg = 0; VERTEX_SHADER_INSTRUCTION *o_inst; -- cgit v1.2.3 From 7e7b1f7c4d928e433e60d0d115dcf21a740db57c Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 15:38:18 +0000 Subject: r300: Fix a couple of static errors. --- src/mesa/drivers/dri/r300/r300_render.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index a4b8be25bd5..665b7dc29d9 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -118,7 +118,7 @@ static int r300PrimitiveType(r300ContextPtr rmesa, GLcontext * ctx, int prim) return type; } -static int r300NumVerts(r300ContextPtr rmesa, int num_verts, int prim) +int r300NumVerts(r300ContextPtr rmesa, int num_verts, int prim) { int verts_off = 0; @@ -272,7 +272,7 @@ static void r300RunRenderPrimitive(r300ContextPtr rmesa, GLcontext * ctx, } } -static GLboolean r300RunRender(GLcontext * ctx, +GLboolean r300RunRender(GLcontext * ctx, struct tnl_pipeline_stage *stage) { r300ContextPtr rmesa = R300_CONTEXT(ctx); -- cgit v1.2.3 From 4ed59c6012490e83622057bd16075070fdc49d7f Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 15:57:30 +0000 Subject: r300: The empty check_space doesn't and never has done anything; removed it. --- src/mesa/drivers/dri/r300/r300_emit.h | 5 ----- src/mesa/drivers/dri/r300/r300_render.c | 2 -- 2 files changed, 7 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h index 8922d8c57d9..bccb84933ad 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.h +++ b/src/mesa/drivers/dri/r300/r300_emit.h @@ -59,10 +59,6 @@ #define CP_PACKET0(reg, n) (RADEON_CP_PACKET0 | ((n)<<16) | ((reg)>>2)) -void static inline check_space(int dwords) -{ -} - static __inline__ uint32_t cmdpacket0(int reg, int count) { drm_r300_cmd_header_t cmd; @@ -239,7 +235,6 @@ static void inline fire_AOS(r300ContextPtr rmesa, int vertex_count, int type) int cmd_reserved = 0; int cmd_written = 0; drm_radeon_cmd_header_t *cmd = NULL; - check_space(9); start_packet3(RADEON_CP_PACKET3_3D_DRAW_VBUF_2, 0); e32(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_LIST | (vertex_count << 16) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 665b7dc29d9..87990247457 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -207,8 +207,6 @@ static void inline r300FireEB(r300ContextPtr rmesa, unsigned long addr, t_addr = addr & ~0x1d; magic_2 = (vertex_count + 1 + (t_addr & 0x2)) / 2 + magic_1; - check_space(6); - start_packet3(RADEON_CP_PACKET3_3D_DRAW_INDX_2, 0); if (elt_size == 4) { e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | -- cgit v1.2.3 From 2b5ef29a7b90724c47454547acd387f0629fdd1b Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 16:10:08 +0000 Subject: r300: Removed the deprecated VTXFMT code. This was okayed by Jerome Glisse and Keith Whitwell on the dri-devel IRC channel and list, respectively. --- src/mesa/drivers/dri/r300/Makefile | 1 - src/mesa/drivers/dri/r300/r300_context.c | 10 +- src/mesa/drivers/dri/r300/r300_context.h | 19 - src/mesa/drivers/dri/r300/r300_ioctl.c | 8 - src/mesa/drivers/dri/r300/r300_maos.c | 26 -- src/mesa/drivers/dri/r300/r300_render.c | 44 ++ src/mesa/drivers/dri/r300/r300_state.c | 4 - src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c | 662 ---------------------------- 8 files changed, 45 insertions(+), 729 deletions(-) delete mode 100644 src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile index 65a6b03b741..cd05927e5e3 100644 --- a/src/mesa/drivers/dri/r300/Makefile +++ b/src/mesa/drivers/dri/r300/Makefile @@ -28,7 +28,6 @@ DRIVER_SOURCES = \ radeon_span.c \ radeon_state.c \ radeon_mm.c \ - radeon_vtxfmt_a.c \ \ r300_context.c \ r300_ioctl.c \ diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 4092ebe0101..12308af45fd 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -214,11 +214,7 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, #ifdef USER_BUFFERS radeon_mm_init(r300); #endif -#ifdef HW_VBOS - if (hw_tcl_on) { - r300InitVBOFuncs(&functions); - } -#endif + if (!radeonInitContext(&r300->radeon, &functions, glVisual, driContextPriv, sharedContextPrivate)) { @@ -367,10 +363,6 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, r300InitCmdBuf(r300); r300InitState(r300); -#ifdef RADEON_VTXFMT_A - radeon_init_vtxfmt_a(r300); -#endif - TNL_CONTEXT(ctx)->Driver.RunPipeline = _tnl_run_pipeline; tcl_mode = driQueryOptioni(&r300->radeon.optionCache, "tcl_mode"); diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 31ce210f8de..9bda2409bd0 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -48,13 +48,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "radeon_context.h" #define USER_BUFFERS -/* KW: Disable this code. Driver should hook into vbo module - * directly, see i965 driver for example. - */ -/* #define RADEON_VTXFMT_A */ -#ifdef RADEON_VTXFMT_A -#define HW_VBOS -#endif /* We don't handle 16 bits elts swapping yet */ #ifdef MESA_BIG_ENDIAN @@ -911,21 +904,9 @@ extern int r300VertexProgUpdateParams(GLcontext * ctx, float *dst); extern int r300Fallback(GLcontext * ctx); -extern void radeon_vb_to_rvb(r300ContextPtr rmesa, - struct radeon_vertex_buffer *rvb, - struct vertex_buffer *vb); extern GLboolean r300RunRender(GLcontext * ctx, struct tnl_pipeline_stage *stage); -#ifdef RADEON_VTXFMT_A -extern void radeon_init_vtxfmt_a(r300ContextPtr rmesa); -#endif - -#ifdef HW_VBOS -extern void r300InitVBOFuncs(struct dd_function_table *functions); -extern void r300EvictVBOs(GLcontext * ctx, int amount); -#endif - #define RADEON_D_CAPTURE 0 #define RADEON_D_PLAYBACK 1 #define RADEON_D_PLAYBACK_RAW 2 diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index 884a7d49e45..ace9131b33b 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -446,14 +446,6 @@ static void r300RefillCurrentDmaRegion(r300ContextPtr rmesa, int size) dmabuf->id = radeon_mm_alloc(rmesa, 4, size); -#ifdef HW_VBOS - if (dmabuf->id == 0) { - /* Just kick all */ - r300EvictVBOs(rmesa->radeon.glCtx, - /*RADEON_BUFFER_SIZE*16 */ 1 << 30); - dmabuf->id = radeon_mm_alloc(rmesa, 4, size); - } -#endif UNLOCK_HARDWARE(&rmesa->radeon); if (dmabuf->id == 0) { diff --git a/src/mesa/drivers/dri/r300/r300_maos.c b/src/mesa/drivers/dri/r300/r300_maos.c index 15bb41ddc0c..3beeb7b1ab8 100644 --- a/src/mesa/drivers/dri/r300/r300_maos.c +++ b/src/mesa/drivers/dri/r300/r300_maos.c @@ -649,32 +649,6 @@ void r300UseArrays(GLcontext * ctx) if (rmesa->state.aos[i].buf) radeon_mm_use(rmesa, rmesa->state.aos[i].buf->id); } - -#ifdef HW_VBOS - -#define USE_VBO(a) \ - do { \ - if (ctx->Array.ArrayObj->a.BufferObj->Name \ - && ctx->Array.ArrayObj->a.Enabled) \ - radeon_mm_use(rmesa, ((struct r300_buffer_object *)ctx->Array.ArrayObj->a.BufferObj)->id); \ - } while(0) - - if (ctx->Array.ElementArrayBufferObj->Name - && ctx->Array.ElementArrayBufferObj->OnCard) - radeon_mm_use(rmesa, - ((struct r300_buffer_object *)ctx->Array. - ElementArrayBufferObj)->id); - - USE_VBO(Vertex); - USE_VBO(Normal); - USE_VBO(Color); - USE_VBO(SecondaryColor); - USE_VBO(FogCoord); - - for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) - USE_VBO(TexCoord[i]); -#endif - } #endif diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 87990247457..1dac3142ee6 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -270,6 +270,50 @@ static void r300RunRenderPrimitive(r300ContextPtr rmesa, GLcontext * ctx, } } +#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; +} + GLboolean r300RunRender(GLcontext * ctx, struct tnl_pipeline_stage *stage) { diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index af4326ed7e5..3b595d98fa6 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1999,10 +1999,6 @@ static void r300InvalidateState(GLcontext * ctx, GLuint new_state) r300UpdateStateParameters(ctx, new_state); -#ifdef HW_VBOS - if (new_state & _NEW_ARRAY) - r300->state.VB.lock_uptodate = GL_FALSE; -#endif r300->NewGLState |= new_state; } diff --git a/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c b/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c deleted file mode 100644 index f9c4e2db0c9..00000000000 --- a/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c +++ /dev/null @@ -1,662 +0,0 @@ -/* - * Copyright (C) 2005 Aapo Tahkola. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/* - * Authors: - * Aapo Tahkola - */ - -#include "context.h" -#include "r300_context.h" -#include "r300_cmdbuf.h" -#include "r300_ioctl.h" -#include "r300_maos.h" -#include "r300_state.h" -#include "radeon_mm.h" - -#include "hash.h" -#include "dispatch.h" -#include "bufferobj.h" -#include "vtxfmt.h" -#include "api_validate.h" -#include "state.h" -#include "image.h" - -#include "vbo/vbo_context.h" - -#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 - -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; -} - -#ifdef RADEON_VTXFMT_A - -extern void _tnl_array_init( GLcontext *ctx ); - -#define CONV(a, b) \ - do { \ - if (ctx->Array.ArrayObj->b.Enabled) { \ - rmesa->state.VB.AttribPtr[(a)].size = ctx->Array.ArrayObj->b.Size; \ - rmesa->state.VB.AttribPtr[(a)].data = ctx->Array.ArrayObj->b.BufferObj->Name \ - ? (void *)ADD_POINTERS(ctx->Array.ArrayObj->b.Ptr, ctx->Array.ArrayObj->b.BufferObj->Data) \ - : (void *)ctx->Array.ArrayObj->b.Ptr; \ - rmesa->state.VB.AttribPtr[(a)].stride = ctx->Array.ArrayObj->b.StrideB; \ - rmesa->state.VB.AttribPtr[(a)].type = ctx->Array.ArrayObj->b.Type; \ - enabled |= 1 << (a); \ - } \ - } while (0) - -static int setup_arrays(r300ContextPtr rmesa, GLint start) -{ - int i; - struct dt def = { 4, GL_FLOAT, 0, NULL }; - GLcontext *ctx; - GLuint enabled = 0; - - ctx = rmesa->radeon.glCtx; - i = r300Fallback(ctx); - if (i) - return i; - - memset(rmesa->state.VB.AttribPtr, 0, VERT_ATTRIB_MAX*sizeof(struct dt)); - - CONV(VERT_ATTRIB_POS, Vertex); - CONV(VERT_ATTRIB_NORMAL, Normal); - CONV(VERT_ATTRIB_COLOR0, Color); - CONV(VERT_ATTRIB_COLOR1, SecondaryColor); - CONV(VERT_ATTRIB_FOG, FogCoord); - - for (i=0; i < MAX_TEXTURE_COORD_UNITS; i++) - CONV(VERT_ATTRIB_TEX0 + i, TexCoord[i]); - - if (ctx->VertexProgram._Enabled) - for (i=0; i < VERT_ATTRIB_MAX; i++) - CONV(i, VertexAttrib[i]); - - for (i=0; i < VERT_ATTRIB_MAX; i++) { - rmesa->state.VB.AttribPtr[i].data += rmesa->state.VB.AttribPtr[i].stride * start; - } - - for(i=0; i < VERT_ATTRIB_MAX; i++){ - if(rmesa->state.VB.AttribPtr[i].type != GL_UNSIGNED_BYTE && -#if MESA_LITTLE_ENDIAN - rmesa->state.VB.AttribPtr[i].type != GL_SHORT && -#endif - rmesa->state.VB.AttribPtr[i].type != GL_FLOAT){ - WARN_ONCE("Unsupported format %d at index %d\n", rmesa->state.VB.AttribPtr[i].type, i); - return R300_FALLBACK_TCL; - } - - /*fprintf(stderr, "%d: ", i); - - switch(rmesa->state.VB.AttribPtr[i].type){ - case GL_BYTE: fprintf(stderr, "byte "); break; - case GL_UNSIGNED_BYTE: fprintf(stderr, "u byte "); break; - case GL_SHORT: fprintf(stderr, "short "); break; - case GL_UNSIGNED_SHORT: fprintf(stderr, "u short "); break; - case GL_INT: fprintf(stderr, "int "); break; - case GL_UNSIGNED_INT: fprintf(stderr, "u int "); break; - case GL_FLOAT: fprintf(stderr, "float "); break; - case GL_2_BYTES: fprintf(stderr, "2 bytes "); break; - case GL_3_BYTES: fprintf(stderr, "3 bytes "); break; - case GL_4_BYTES: fprintf(stderr, "4 bytes "); break; - case GL_DOUBLE: fprintf(stderr, "double "); break; - default: fprintf(stderr, "unknown "); break; - } - - fprintf(stderr, "Size %d ", rmesa->state.VB.AttribPtr[i].size); - fprintf(stderr, "Ptr %p ", rmesa->state.VB.AttribPtr[i].data); - fprintf(stderr, "Stride %d ", rmesa->state.VB.AttribPtr[i].stride); - fprintf(stderr, "\n");*/ - } - return R300_FALLBACK_NONE; -} - -void radeon_init_vtxfmt_a(r300ContextPtr rmesa); - - -static void radeonDrawRangeElements(GLcontext *ctx, - GLenum mode, - GLuint min, - GLuint max, - GLsizei count, - GLenum type, - const GLvoid *c_indices) -{ -#if 1 - return GL_FALSE; -#else - r300ContextPtr rmesa = R300_CONTEXT(ctx); - struct tnl_prim prim; - int elt_size; - int i; - void *ptr = NULL; - struct r300_dma_region rvb; - const GLvoid *indices = c_indices; - - if (count > 65535) { - /* TODO */ - if (mode == GL_POINTS || - mode == GL_LINES || - mode == GL_QUADS || - mode == GL_TRIANGLES) { - - while (count) { - i = r300NumVerts(rmesa, MIN2(count, 65535), mode); - - radeonDrawRangeElements(mode, min, max, i, type, indices); - - indices += i * _mesa_sizeof_type(type); - count -= i; - } - return GL_TRUE; - } - WARN_ONCE("Too many verts!\n"); - return GL_FALSE; - } - - if (ctx->Array.ElementArrayBufferObj->Name) { - /* use indices in the buffer object */ - if (!ctx->Array.ElementArrayBufferObj->Data) { - _mesa_warning(ctx, "DrawRangeElements with empty vertex elements buffer!"); - return GL_TRUE; - } - /* actual address is the sum of pointers */ - indices = (GLvoid *) - ADD_POINTERS(ctx->Array.ElementArrayBufferObj->Data, (const GLubyte *) c_indices); - } - - FLUSH_CURRENT( ctx, 0 ); -#ifdef OPTIMIZE_ELTS - min = 0; -#endif - - memset(&rvb, 0, sizeof(rvb)); - switch (type){ - case GL_UNSIGNED_BYTE: -#ifdef FORCE_32BITS_ELTS - elt_size = 4; -#else - elt_size = 2; -#endif - r300AllocDmaRegion(rmesa, &rvb, count * elt_size, elt_size); - rvb.aos_offset = GET_START(&rvb); - ptr = rvb.address + rvb.start; - -#ifdef FORCE_32BITS_ELTS - for(i=0; i < count; i++) - ((unsigned int *)ptr)[i] = ((unsigned char *)indices)[i] - min; -#else - for(i=0; i < count; i++) - ((unsigned short int *)ptr)[i] = ((unsigned char *)indices)[i] - min; -#endif - break; - - case GL_UNSIGNED_SHORT: -#ifdef FORCE_32BITS_ELTS - elt_size = 4; -#else - elt_size = 2; -#endif -#ifdef OPTIMIZE_ELTS - if (min == 0 && ctx->Array.ElementArrayBufferObj->Name){ - ptr = indices; - break; - } -#endif - r300AllocDmaRegion(rmesa, &rvb, count * elt_size, elt_size); - rvb.aos_offset = GET_START(&rvb); - ptr = rvb.address + rvb.start; - -#ifdef FORCE_32BITS_ELTS - for(i=0; i < count; i++) - ((unsigned int *)ptr)[i] = ((unsigned short int *)indices)[i] - min; -#else - for(i=0; i < count; i++) - ((unsigned short int *)ptr)[i] = ((unsigned short int *)indices)[i] - min; -#endif - break; - - case GL_UNSIGNED_INT: -#ifdef FORCE_32BITS_ELTS - elt_size = 4; -#else - if (max - min <= 65535) - elt_size = 2; - else - elt_size = 4; -#endif - r300AllocDmaRegion(rmesa, &rvb, count * elt_size, elt_size); - rvb.aos_offset = GET_START(&rvb); - ptr = rvb.address + rvb.start; - - if (elt_size == 2) - for (i=0; i < count; i++) - ((unsigned short int *)ptr)[i] = ((unsigned int *)indices)[i] - min; - else - for (i=0; i < count; i++) - ((unsigned int *)ptr)[i] = ((unsigned int *)indices)[i] - min; - break; - - default: - WARN_ONCE("Unknown elt type!\n"); - return GL_FALSE; - } - - /* XXX: setup_arrays before state update? */ - - if (ctx->NewState) - _mesa_update_state( ctx ); - - r300UpdateShaders(rmesa); - - if (setup_arrays(rmesa, min) >= R300_FALLBACK_TCL) { - r300ReleaseDmaRegion(rmesa, &rvb, __FUNCTION__); - return GL_FALSE; - } - - rmesa->state.VB.Count = max - min + 1; - - r300UpdateShaderStates(rmesa); - - rmesa->state.VB.Primitive = &prim; - rmesa->state.VB.PrimitiveCount = 1; - - prim.mode = mode | PRIM_BEGIN | PRIM_END; - if (rmesa->state.VB.LockCount) - prim.start = min - rmesa->state.VB.LockFirst; - else - prim.start = 0; - prim.count = count; - - rmesa->state.VB.Elts = ptr; - rmesa->state.VB.elt_size = elt_size; - rmesa->state.VB.elt_min = min; - rmesa->state.VB.elt_max = max; - - if (r300RunRender(ctx, NULL)) { - r300ReleaseDmaRegion(rmesa, &rvb, __FUNCTION__); - return GL_FALSE; - } - - if(rvb.buf) - radeon_mm_use(rmesa, rvb.buf->id); - - r300ReleaseDmaRegion(rmesa, &rvb, __FUNCTION__); - return GL_TRUE; -#endif -} - -static GLboolean radeonDrawArrays( GLcontext *ctx, - GLenum mode, GLint start, GLsizei count ) -{ -#if 1 - return GL_FALSE; -#else - GET_CURRENT_CONTEXT(ctx); - r300ContextPtr rmesa = R300_CONTEXT(ctx); - struct tnl_prim prim; - - if (count > 65535) { - /* TODO: split into multiple draws. - */ - WARN_ONCE("Too many verts!\n"); - return GL_FALSE; - } - - FLUSH_CURRENT( ctx, 0 ); - - if (ctx->NewState) - _mesa_update_state( ctx ); - - /* XXX: setup_arrays before state update? */ - - r300UpdateShaders(rmesa); - - if (setup_arrays(rmesa, start) >= R300_FALLBACK_TCL) - return GL_FALSE; - - rmesa->state.VB.Count = count; - - r300UpdateShaderStates(rmesa); - - rmesa->state.VB.Primitive = &prim; - rmesa->state.VB.PrimitiveCount = 1; - - prim.mode = mode | PRIM_BEGIN | PRIM_END; - if (rmesa->state.VB.LockCount) - prim.start = start - rmesa->state.VB.LockFirst; - else - prim.start = 0; - prim.count = count; - - rmesa->state.VB.Elts = NULL; - rmesa->state.VB.elt_size = 0; - rmesa->state.VB.elt_min = 0; - rmesa->state.VB.elt_max = 0; - - if (r300RunRender(ctx, NULL)) - return GL_FALSE; - - return GL_TRUE; -#endif -} - -static void radeon_draw_prims( GLcontext *ctx, - const struct gl_client_array *arrays[], - const struct _mesa_prim *prim, - GLuint nr_prims, - const struct _mesa_index_buffer *ib, - GLuint min_index, - GLuint max_index) -{ - if (ib == NULL) { - for (i = 0; i < nr_prims; i++) { - if (!radeonDrawArrays(ctx, - prim->mode, - prim->start, - prim->count)) { - /* Fallback - */ - _tnl_draw_prims(ctx, - arrays, - prim + i, - nr_prims - i, - ib, - min_index, - max_index); - return; - } - } - } else { - for (i = 0; i < nr_prims; i++) { - if (!radeonDrawRangeElements(ctx, - prim->mode, - min_index, - max_index, - prim->count, - ib->types, - ib->ptr)) { - /* Fallback - */ - _tnl_draw_prims(ctx, - arrays, - prim + i, - nr_prims - i, - ib, - min_index, - max_index); - return; - } - } - } -} - -void radeon_init_vtxfmt_a(r300ContextPtr rmesa) -{ - GLcontext *ctx; - struct vbo_context *vbo = vbo_context(ctx); - - vbo->draw_prims = radeon_draw_prims; -} - -#endif - -#ifdef HW_VBOS - -static struct gl_buffer_object * -r300NewBufferObject(GLcontext *ctx, GLuint name, GLenum target ) -{ - struct r300_buffer_object *obj; - - (void) ctx; - - obj = MALLOC_STRUCT(r300_buffer_object); - _mesa_initialize_buffer_object(&obj->mesa_obj, name, target); - return &obj->mesa_obj; -} - -static void r300BufferData(GLcontext *ctx, GLenum target, GLsizeiptrARB size, - const GLvoid *data, GLenum usage, struct gl_buffer_object *obj) -{ - r300ContextPtr rmesa = R300_CONTEXT(ctx); - struct r300_buffer_object *r300_obj = (struct r300_buffer_object *)obj; - - /* Free previous buffer */ - if (obj->OnCard) { - radeon_mm_free(rmesa, r300_obj->id); - obj->OnCard = GL_FALSE; - } else { - if (obj->Data) - _mesa_free(obj->Data); - } -#ifdef OPTIMIZE_ELTS - if (0) { -#else - if (target == GL_ELEMENT_ARRAY_BUFFER_ARB) { -#endif - fallback: - obj->Data = malloc(size); - - if (data) - _mesa_memcpy(obj->Data, data, size); - - obj->OnCard = GL_FALSE; - } else { - r300_obj->id = radeon_mm_alloc(rmesa, 4, size); - if (r300_obj->id == 0) - goto fallback; - - obj->Data = radeon_mm_map(rmesa, r300_obj->id, RADEON_MM_W); - - if (data) - _mesa_memcpy(obj->Data, data, size); - - radeon_mm_unmap(rmesa, r300_obj->id); - obj->OnCard = GL_TRUE; - } - - obj->Size = size; - obj->Usage = usage; -} - -static void r300BufferSubData(GLcontext *ctx, GLenum target, GLintptrARB offset, - GLsizeiptrARB size, const GLvoid * data, struct gl_buffer_object * bufObj) -{ - r300ContextPtr rmesa = R300_CONTEXT(ctx); - struct r300_buffer_object *r300_obj = (struct r300_buffer_object *)bufObj; - (void) ctx; (void) target; - void *ptr; - - if (bufObj->Data && ((GLuint) (size + offset) <= bufObj->Size)) { - if (bufObj->OnCard){ - ptr = radeon_mm_map(rmesa, r300_obj->id, RADEON_MM_W); - - _mesa_memcpy( (GLubyte *) ptr + offset, data, size ); - - radeon_mm_unmap(rmesa, r300_obj->id); - } else { - _mesa_memcpy( (GLubyte *) bufObj->Data + offset, data, size ); - } - } -} - -static void *r300MapBuffer(GLcontext *ctx, GLenum target, GLenum access, - struct gl_buffer_object *bufObj) -{ - r300ContextPtr rmesa = R300_CONTEXT(ctx); - struct r300_buffer_object *r300_obj = (struct r300_buffer_object *)bufObj; - - (void) ctx; - (void) target; - (void) access; - //ASSERT(!bufObj->OnCard); - /* Just return a direct pointer to the data */ - if (bufObj->Pointer) { - /* already mapped! */ - return NULL; - } - - if (!bufObj->OnCard) { - bufObj->Pointer = bufObj->Data; - return bufObj->Pointer; - } - - switch (access) { - case GL_READ_ONLY: - bufObj->Pointer = radeon_mm_map(rmesa, r300_obj->id, RADEON_MM_R); - break; - - case GL_WRITE_ONLY: - bufObj->Pointer = radeon_mm_map(rmesa, r300_obj->id, RADEON_MM_W); - break; - - case GL_READ_WRITE: - bufObj->Pointer = radeon_mm_map(rmesa, r300_obj->id, RADEON_MM_RW); - break; - - default: - WARN_ONCE("Unknown access type\n"); - bufObj->Pointer = NULL; - break; - } - - return bufObj->Pointer; -} - -static GLboolean r300UnmapBuffer(GLcontext *ctx, GLenum target, struct gl_buffer_object *bufObj) -{ - r300ContextPtr rmesa = R300_CONTEXT(ctx); - struct r300_buffer_object *r300_obj = (struct r300_buffer_object *)bufObj; - - (void) ctx; - (void) target; - //ASSERT(!bufObj->OnCard); - /* XXX we might assert here that bufObj->Pointer is non-null */ - if (!bufObj->OnCard) { - bufObj->Pointer = NULL; - return GL_TRUE; - } - radeon_mm_unmap(rmesa, r300_obj->id); - - bufObj->Pointer = NULL; - return GL_TRUE; -} - -static void r300DeleteBuffer(GLcontext *ctx, struct gl_buffer_object *obj) -{ - r300ContextPtr rmesa = R300_CONTEXT(ctx); - struct r300_buffer_object *r300_obj = (struct r300_buffer_object *)obj; - - if (obj->OnCard) { - radeon_mm_free(rmesa, r300_obj->id); - obj->Data = NULL; - } - _mesa_delete_buffer_object(ctx, obj); -} - -void r300EvictVBOs(GLcontext *ctx, int amount) -{ - r300ContextPtr rmesa = R300_CONTEXT(ctx); - struct _mesa_HashTable *hash = ctx->Shared->BufferObjects; - GLuint k = _mesa_HashFirstEntry(hash); - - while (amount > 0 && k) { - struct gl_buffer_object *obj = _mesa_lookup_bufferobj(ctx, k); - struct r300_buffer_object *r300_obj - = (struct r300_buffer_object *) obj; - - if (obj->OnCard && obj->Size) { - GLvoid *data; - obj->Data = _mesa_malloc(obj->Size); - - data = radeon_mm_map(rmesa, r300_obj->id, RADEON_MM_R); - _mesa_memcpy(obj->Data, data, obj->Size); - radeon_mm_unmap(rmesa, r300_obj->id); - - radeon_mm_free(rmesa, r300_obj->id); - r300_obj->id = 0; - obj->OnCard = GL_FALSE; - - amount -= obj->Size; - } - - k = _mesa_HashNextEntry(hash, k); - } - -} - -void r300InitVBOFuncs(struct dd_function_table *functions) -{ - functions->NewBufferObject = r300NewBufferObject; - functions->BufferData = r300BufferData; - functions->BufferSubData = r300BufferSubData; - functions->MapBuffer = r300MapBuffer; - functions->UnmapBuffer = r300UnmapBuffer; - functions->DeleteBuffer = r300DeleteBuffer; -} - -#endif -- cgit v1.2.3 From cea0c2b14426bf315ae606656274dae5eedd1b6a Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 18:01:43 +0000 Subject: r300: Indented both copies of radeon_span.[ch] in preparation for merging. --- src/mesa/drivers/dri/r300/radeon_span.c | 189 ++++++++++++++---------------- src/mesa/drivers/dri/r300/radeon_span.h | 12 +- src/mesa/drivers/dri/radeon/radeon_span.c | 163 ++++++++++++-------------- src/mesa/drivers/dri/radeon/radeon_span.h | 10 +- 4 files changed, 173 insertions(+), 201 deletions(-) diff --git a/src/mesa/drivers/dri/r300/radeon_span.c b/src/mesa/drivers/dri/r300/radeon_span.c index cc779d684fb..9cae955de8b 100644 --- a/src/mesa/drivers/dri/r300/radeon_span.c +++ b/src/mesa/drivers/dri/r300/radeon_span.c @@ -39,6 +39,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Keith Whitwell * */ + #include #include "glheader.h" #include "imports.h" @@ -51,10 +52,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "drirenderbuffer.h" - #define DBG 0 - /* * Note that all information needed to access pixels in a renderbuffer * should be obtained through the gl_renderbuffer parameter, not per-context @@ -85,8 +84,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define HW_UNLOCK() - - /* ================================================================ * Color buffer */ @@ -101,7 +98,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define GET_PTR(X,Y) (buf + ((Y) * drb->flippedPitch + (X)) * 2) #include "spantmp2.h" - /* 32 bit, ARGB8888 color spanline and pixel functions */ #define SPANTMP_PIXEL_FMT GL_BGRA @@ -112,7 +108,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define GET_PTR(X,Y) (buf + ((Y) * drb->flippedPitch + (X)) * 4) #include "spantmp2.h" - /* ================================================================ * Depth buffer */ @@ -127,59 +122,52 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * too... */ -static GLuint -radeon_mba_z32( const driRenderbuffer *drb, GLint x, GLint y ) +static GLuint radeon_mba_z32(const driRenderbuffer * drb, GLint x, GLint y) { - GLuint pitch = drb->pitch; - if (1 /*|| drb->depthHasSurface */) { - return 4 * (x + y * pitch); - } - else { - GLuint ba, address = 0; /* a[0..1] = 0 */ - - ba = (y / 8) * (pitch / 8) + (x / 8); - - address |= (x & 0x7) << 2; /* a[2..4] = x[0..2] */ - address |= (y & 0x3) << 5; /* a[5..6] = y[0..1] */ - address |= - (((x & 0x10) >> 2) ^ (y & 0x4)) << 5; /* a[7] = x[4] ^ y[2] */ - address |= (ba & 0x3) << 8; /* a[8..9] = ba[0..1] */ - - address |= (y & 0x8) << 7; /* a[10] = y[3] */ - address |= - (((x & 0x8) << 1) ^ (y & 0x10)) << 7; /* a[11] = x[3] ^ y[4] */ - address |= (ba & ~0x3) << 10; /* a[12..] = ba[2..] */ - - return address; - } -} + GLuint pitch = drb->pitch; + if (1 /*|| drb->depthHasSurface */ ) { + return 4 * (x + y * pitch); + } else { + GLuint ba, address = 0; /* a[0..1] = 0 */ + + ba = (y / 8) * (pitch / 8) + (x / 8); + + address |= (x & 0x7) << 2; /* a[2..4] = x[0..2] */ + address |= (y & 0x3) << 5; /* a[5..6] = y[0..1] */ + address |= (((x & 0x10) >> 2) ^ (y & 0x4)) << 5; /* a[7] = x[4] ^ y[2] */ + address |= (ba & 0x3) << 8; /* a[8..9] = ba[0..1] */ + address |= (y & 0x8) << 7; /* a[10] = y[3] */ + address |= (((x & 0x8) << 1) ^ (y & 0x10)) << 7; /* a[11] = x[3] ^ y[4] */ + address |= (ba & ~0x3) << 10; /* a[12..] = ba[2..] */ + + return address; + } +} static INLINE GLuint -radeon_mba_z16( const driRenderbuffer *drb, GLint x, GLint y ) +radeon_mba_z16(const driRenderbuffer * drb, GLint x, GLint y) { - GLuint pitch = drb->pitch; - if (1 /*|| drb->depthHasSurface */) { - return 2 * (x + y * pitch); - } - else { - GLuint ba, address = 0; /* a[0] = 0 */ - - ba = (y / 16) * (pitch / 32) + (x / 32); - - address |= (x & 0x7) << 1; /* a[1..3] = x[0..2] */ - address |= (y & 0x7) << 4; /* a[4..6] = y[0..2] */ - address |= (x & 0x8) << 4; /* a[7] = x[3] */ - address |= (ba & 0x3) << 8; /* a[8..9] = ba[0..1] */ - address |= (y & 0x8) << 7; /* a[10] = y[3] */ - address |= ((x & 0x10) ^ (y & 0x10)) << 7;/* a[11] = x[4] ^ y[4] */ - address |= (ba & ~0x3) << 10; /* a[12..] = ba[2..] */ - - return address; - } + GLuint pitch = drb->pitch; + if (1 /*|| drb->depthHasSurface */ ) { + return 2 * (x + y * pitch); + } else { + GLuint ba, address = 0; /* a[0] = 0 */ + + ba = (y / 16) * (pitch / 32) + (x / 32); + + address |= (x & 0x7) << 1; /* a[1..3] = x[0..2] */ + address |= (y & 0x7) << 4; /* a[4..6] = y[0..2] */ + address |= (x & 0x8) << 4; /* a[7] = x[3] */ + address |= (ba & 0x3) << 8; /* a[8..9] = ba[0..1] */ + address |= (y & 0x8) << 7; /* a[10] = y[3] */ + address |= ((x & 0x10) ^ (y & 0x10)) << 7; /* a[11] = x[4] ^ y[4] */ + address |= (ba & ~0x3) << 10; /* a[12..] = ba[2..] */ + + return address; + } } - /* 16-bit depth buffer functions */ #define WRITE_DEPTH( _x, _y, d ) \ @@ -191,7 +179,6 @@ radeon_mba_z16( const driRenderbuffer *drb, GLint x, GLint y ) #define TAG(x) radeon##x##_z16 #include "depthtmp.h" - /* 24 bit depth, 8 bit stencil depthbuffer functions * * Careful: It looks like the R300 uses ZZZS byte order while the R200 @@ -215,7 +202,6 @@ do { \ #define TAG(x) radeon##x##_z24_s8 #include "depthtmp.h" - /* ================================================================ * Stencil buffer */ @@ -241,84 +227,79 @@ do { \ #define TAG(x) radeon##x##_z24_s8 #include "stenciltmp.h" - - /* Move locking out to get reasonable span performance (10x better * than doing this in HW_LOCK above). WaitForIdle() is the main * culprit. */ -static void radeonSpanRenderStart( GLcontext *ctx ) +static void radeonSpanRenderStart(GLcontext * ctx) { - radeonContextPtr rmesa = RADEON_CONTEXT( ctx ); - { + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + static int first = 1; - r300ContextPtr r300 = (r300ContextPtr)rmesa; - + r300ContextPtr r300 = (r300ContextPtr) rmesa; + if (first) { - r300->span_dlocking = getenv("R300_SPAN_DISABLE_LOCKING") ? 1 : 0; + r300->span_dlocking = + getenv("R300_SPAN_DISABLE_LOCKING") ? 1 : 0; if (r300->span_dlocking == 0) { - fprintf(stderr, "Try R300_SPAN_DISABLE_LOCKING env var if this hangs.\n"); + fprintf(stderr, + "Try R300_SPAN_DISABLE_LOCKING env var if this hangs.\n"); fflush(stderr); sleep(1); } first = 0; } - + if (r300->span_dlocking) { r300Flush(ctx); - LOCK_HARDWARE( rmesa ); - radeonWaitForIdleLocked( rmesa ); - UNLOCK_HARDWARE( rmesa ); - + LOCK_HARDWARE(rmesa); + radeonWaitForIdleLocked(rmesa); + UNLOCK_HARDWARE(rmesa); + return; } - } - // R300_FIREVERTICES( rmesa ); - // old code has flush - r300Flush(ctx); - LOCK_HARDWARE( rmesa ); - radeonWaitForIdleLocked( rmesa ); + // R300_FIREVERTICES( rmesa ); + // old code has flush + r300Flush(ctx); + LOCK_HARDWARE(rmesa); + radeonWaitForIdleLocked(rmesa); } -static void radeonSpanRenderFinish( GLcontext *ctx ) +static void radeonSpanRenderFinish(GLcontext * ctx) { - radeonContextPtr rmesa = RADEON_CONTEXT( ctx ); - r300ContextPtr r300 = (r300ContextPtr)rmesa; - _swrast_flush( ctx ); - if (r300->span_dlocking == 0) - UNLOCK_HARDWARE( rmesa ); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + r300ContextPtr r300 = (r300ContextPtr) rmesa; + _swrast_flush(ctx); + if (r300->span_dlocking == 0) + UNLOCK_HARDWARE(rmesa); } -void radeonInitSpanFuncs( GLcontext *ctx ) +void radeonInitSpanFuncs(GLcontext * ctx) { - struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx); - swdd->SpanRenderStart = radeonSpanRenderStart; - swdd->SpanRenderFinish = radeonSpanRenderFinish; + struct swrast_device_driver *swdd = + _swrast_GetDeviceDriverReference(ctx); + swdd->SpanRenderStart = radeonSpanRenderStart; + swdd->SpanRenderFinish = radeonSpanRenderFinish; } - /** * Plug in the Get/Put routines for the given driRenderbuffer. */ -void -radeonSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis) +void radeonSetSpanFunctions(driRenderbuffer * drb, const GLvisual * vis) { - if (drb->Base.InternalFormat == GL_RGBA) { - if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) { - radeonInitPointers_RGB565(&drb->Base); - } - else { - radeonInitPointers_ARGB8888(&drb->Base); - } - } - else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { - radeonInitDepthPointers_z16(&drb->Base); - } - else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { - radeonInitDepthPointers_z24_s8(&drb->Base); - } - else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { - radeonInitStencilPointers_z24_s8(&drb->Base); - } + if (drb->Base.InternalFormat == GL_RGBA) { + if (vis->redBits == 5 && vis->greenBits == 6 + && vis->blueBits == 5) { + radeonInitPointers_RGB565(&drb->Base); + } else { + radeonInitPointers_ARGB8888(&drb->Base); + } + } else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { + radeonInitDepthPointers_z16(&drb->Base); + } else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { + radeonInitDepthPointers_z24_s8(&drb->Base); + } else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { + radeonInitStencilPointers_z24_s8(&drb->Base); + } } diff --git a/src/mesa/drivers/dri/r300/radeon_span.h b/src/mesa/drivers/dri/r300/radeon_span.h index c4280b1b6d1..8f0823f412b 100644 --- a/src/mesa/drivers/dri/r300/radeon_span.h +++ b/src/mesa/drivers/dri/r300/radeon_span.h @@ -1,10 +1,15 @@ -/* +/************************************************************************** + +Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and + VA Linux Systems Inc., Fremont, California. 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. +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 @@ -29,18 +34,17 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /* * Authors: + * Gareth Hughes * Keith Whitwell + * Kevin E. Martin */ #ifndef __RADEON_SPAN_H__ #define __RADEON_SPAN_H__ -#ifdef GLX_DIRECT_RENDERING - #include "drirenderbuffer.h" extern void radeonInitSpanFuncs(GLcontext * ctx); extern void radeonSetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis); #endif -#endif diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index c49f5870c63..39452f8b4e7 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -1,9 +1,13 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_span.c,v 1.6 2002/10/30 12:51:56 alanh Exp $ */ /************************************************************************** +Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and VA Linux Systems Inc., Fremont, California. +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. + All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining @@ -47,10 +51,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "drirenderbuffer.h" - #define DBG 0 - /* * Note that all information needed to access pixels in a renderbuffer * should be obtained through the gl_renderbuffer parameter, not per-context @@ -81,8 +83,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define HW_UNLOCK() - - /* ================================================================ * Color buffer */ @@ -97,7 +97,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define GET_PTR(X,Y) (buf + ((Y) * drb->flippedPitch + (X)) * 2) #include "spantmp2.h" - /* 32 bit, ARGB8888 color spanline and pixel functions */ #define SPANTMP_PIXEL_FMT GL_BGRA @@ -108,7 +107,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define GET_PTR(X,Y) (buf + ((Y) * drb->flippedPitch + (X)) * 4) #include "spantmp2.h" - /* ================================================================ * Depth buffer */ @@ -123,59 +121,52 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * too... */ -static GLuint -radeon_mba_z32( const driRenderbuffer *drb, GLint x, GLint y ) +static GLuint radeon_mba_z32(const driRenderbuffer * drb, GLint x, GLint y) { - GLuint pitch = drb->pitch; - if (drb->depthHasSurface) { - return 4 * (x + y * pitch); - } - else { - GLuint ba, address = 0; /* a[0..1] = 0 */ - - ba = (y / 16) * (pitch / 16) + (x / 16); - - address |= (x & 0x7) << 2; /* a[2..4] = x[0..2] */ - address |= (y & 0x3) << 5; /* a[5..6] = y[0..1] */ - address |= - (((x & 0x10) >> 2) ^ (y & 0x4)) << 5; /* a[7] = x[4] ^ y[2] */ - address |= (ba & 0x3) << 8; /* a[8..9] = ba[0..1] */ - - address |= (y & 0x8) << 7; /* a[10] = y[3] */ - address |= - (((x & 0x8) << 1) ^ (y & 0x10)) << 7; /* a[11] = x[3] ^ y[4] */ - address |= (ba & ~0x3) << 10; /* a[12..] = ba[2..] */ - - return address; - } -} + GLuint pitch = drb->pitch; + if (drb->depthHasSurface) { + return 4 * (x + y * pitch); + } else { + GLuint ba, address = 0; /* a[0..1] = 0 */ + + ba = (y / 16) * (pitch / 16) + (x / 16); + address |= (x & 0x7) << 2; /* a[2..4] = x[0..2] */ + address |= (y & 0x3) << 5; /* a[5..6] = y[0..1] */ + address |= (((x & 0x10) >> 2) ^ (y & 0x4)) << 5; /* a[7] = x[4] ^ y[2] */ + address |= (ba & 0x3) << 8; /* a[8..9] = ba[0..1] */ + + address |= (y & 0x8) << 7; /* a[10] = y[3] */ + address |= (((x & 0x8) << 1) ^ (y & 0x10)) << 7; /* a[11] = x[3] ^ y[4] */ + address |= (ba & ~0x3) << 10; /* a[12..] = ba[2..] */ + + return address; + } +} static INLINE GLuint -radeon_mba_z16( const driRenderbuffer *drb, GLint x, GLint y ) +radeon_mba_z16(const driRenderbuffer * drb, GLint x, GLint y) { - GLuint pitch = drb->pitch; - if (drb->depthHasSurface) { - return 2 * (x + y * pitch); - } - else { - GLuint ba, address = 0; /* a[0] = 0 */ - - ba = (y / 16) * (pitch / 32) + (x / 32); - - address |= (x & 0x7) << 1; /* a[1..3] = x[0..2] */ - address |= (y & 0x7) << 4; /* a[4..6] = y[0..2] */ - address |= (x & 0x8) << 4; /* a[7] = x[3] */ - address |= (ba & 0x3) << 8; /* a[8..9] = ba[0..1] */ - address |= (y & 0x8) << 7; /* a[10] = y[3] */ - address |= ((x & 0x10) ^ (y & 0x10)) << 7;/* a[11] = x[4] ^ y[4] */ - address |= (ba & ~0x3) << 10; /* a[12..] = ba[2..] */ - - return address; - } + GLuint pitch = drb->pitch; + if (drb->depthHasSurface) { + return 2 * (x + y * pitch); + } else { + GLuint ba, address = 0; /* a[0] = 0 */ + + ba = (y / 16) * (pitch / 32) + (x / 32); + + address |= (x & 0x7) << 1; /* a[1..3] = x[0..2] */ + address |= (y & 0x7) << 4; /* a[4..6] = y[0..2] */ + address |= (x & 0x8) << 4; /* a[7] = x[3] */ + address |= (ba & 0x3) << 8; /* a[8..9] = ba[0..1] */ + address |= (y & 0x8) << 7; /* a[10] = y[3] */ + address |= ((x & 0x10) ^ (y & 0x10)) << 7; /* a[11] = x[4] ^ y[4] */ + address |= (ba & ~0x3) << 10; /* a[12..] = ba[2..] */ + + return address; + } } - /* 16-bit depth buffer functions */ #define WRITE_DEPTH( _x, _y, d ) \ @@ -187,7 +178,6 @@ radeon_mba_z16( const driRenderbuffer *drb, GLint x, GLint y ) #define TAG(x) radeon##x##_z16 #include "depthtmp.h" - /* 24 bit depth, 8 bit stencil depthbuffer functions */ #define WRITE_DEPTH( _x, _y, d ) \ @@ -206,7 +196,6 @@ do { \ #define TAG(x) radeon##x##_z24_s8 #include "depthtmp.h" - /* ================================================================ * Stencil buffer */ @@ -233,57 +222,51 @@ do { \ #define TAG(x) radeon##x##_z24_s8 #include "stenciltmp.h" - - /* Move locking out to get reasonable span performance (10x better * than doing this in HW_LOCK above). WaitForIdle() is the main * culprit. */ -static void radeonSpanRenderStart( GLcontext *ctx ) +static void radeonSpanRenderStart(GLcontext * ctx) { - radeonContextPtr rmesa = RADEON_CONTEXT( ctx ); - RADEON_FIREVERTICES( rmesa ); - LOCK_HARDWARE( rmesa ); - radeonWaitForIdleLocked( rmesa ); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + RADEON_FIREVERTICES(rmesa); + LOCK_HARDWARE(rmesa); + radeonWaitForIdleLocked(rmesa); } -static void radeonSpanRenderFinish( GLcontext *ctx ) +static void radeonSpanRenderFinish(GLcontext * ctx) { - radeonContextPtr rmesa = RADEON_CONTEXT( ctx ); - _swrast_flush( ctx ); - UNLOCK_HARDWARE( rmesa ); + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + _swrast_flush(ctx); + UNLOCK_HARDWARE(rmesa); } -void radeonInitSpanFuncs( GLcontext *ctx ) +void radeonInitSpanFuncs(GLcontext * ctx) { - struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx); - swdd->SpanRenderStart = radeonSpanRenderStart; - swdd->SpanRenderFinish = radeonSpanRenderFinish; + struct swrast_device_driver *swdd = + _swrast_GetDeviceDriverReference(ctx); + swdd->SpanRenderStart = radeonSpanRenderStart; + swdd->SpanRenderFinish = radeonSpanRenderFinish; } - /** * Plug in the Get/Put routines for the given driRenderbuffer. */ -void -radeonSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis) +void radeonSetSpanFunctions(driRenderbuffer * drb, const GLvisual * vis) { - if (drb->Base.InternalFormat == GL_RGBA) { - if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) { - radeonInitPointers_RGB565(&drb->Base); - } - else { - radeonInitPointers_ARGB8888(&drb->Base); - } - } - else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { - radeonInitDepthPointers_z16(&drb->Base); - } - else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { - radeonInitDepthPointers_z24_s8(&drb->Base); - } - else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { - radeonInitStencilPointers_z24_s8(&drb->Base); - } + if (drb->Base.InternalFormat == GL_RGBA) { + if (vis->redBits == 5 && vis->greenBits == 6 + && vis->blueBits == 5) { + radeonInitPointers_RGB565(&drb->Base); + } else { + radeonInitPointers_ARGB8888(&drb->Base); + } + } else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { + radeonInitDepthPointers_z16(&drb->Base); + } else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { + radeonInitDepthPointers_z24_s8(&drb->Base); + } else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { + radeonInitStencilPointers_z24_s8(&drb->Base); + } } diff --git a/src/mesa/drivers/dri/radeon/radeon_span.h b/src/mesa/drivers/dri/radeon/radeon_span.h index 13b308e1c41..56bbb5a713e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.h +++ b/src/mesa/drivers/dri/radeon/radeon_span.h @@ -1,8 +1,12 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_span.h,v 1.2 2002/02/22 21:45:01 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and VA Linux Systems Inc., Fremont, California. +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. All Rights Reserved. @@ -30,8 +34,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /* * Authors: - * Kevin E. Martin * Gareth Hughes + * Keith Whitwell + * Kevin E. Martin */ #ifndef __RADEON_SPAN_H__ @@ -40,7 +45,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "drirenderbuffer.h" extern void radeonInitSpanFuncs( GLcontext *ctx ); - extern void radeonSetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis); #endif -- cgit v1.2.3 From 2db667290a19d15122d8d0c011f4b813bb542bc5 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 18:06:10 +0000 Subject: r300: Further reduced the diff between radeon_span.[ch]. --- src/mesa/drivers/dri/r300/radeon_span.c | 2 -- src/mesa/drivers/dri/radeon/radeon_span.c | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/r300/radeon_span.c b/src/mesa/drivers/dri/r300/radeon_span.c index 9cae955de8b..8b20034b191 100644 --- a/src/mesa/drivers/dri/r300/radeon_span.c +++ b/src/mesa/drivers/dri/r300/radeon_span.c @@ -40,9 +40,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ -#include #include "glheader.h" -#include "imports.h" #include "swrast/swrast.h" #include "r300_state.h" diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index 39452f8b4e7..fd7a8c4fbfc 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -179,6 +179,9 @@ radeon_mba_z16(const driRenderbuffer * drb, GLint x, GLint y) #include "depthtmp.h" /* 24 bit depth, 8 bit stencil depthbuffer functions + * + * Careful: It looks like the R300 uses ZZZS byte order while the R200 + * uses SZZZ for 24 bit depth, 8 bit stencil mode. */ #define WRITE_DEPTH( _x, _y, d ) \ do { \ -- cgit v1.2.3 From ed42bd6e2005e8d725b29b26f6062e5c008efcce Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 18:07:16 +0000 Subject: r300: Removed the obsolete GLX_DIRECT_RENDERING define. --- src/mesa/drivers/dri/r300/Makefile | 2 +- src/mesa/drivers/dri/r300/r300_maos.h | 3 --- src/mesa/drivers/dri/r300/r300_tex.h | 3 --- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile index cd05927e5e3..b0b47be4a24 100644 --- a/src/mesa/drivers/dri/r300/Makefile +++ b/src/mesa/drivers/dri/r300/Makefile @@ -45,7 +45,7 @@ DRIVER_SOURCES = \ C_SOURCES = $(COMMON_SOURCES) $(DRIVER_SOURCES) -DRIVER_DEFINES = -DCOMPILE_R300 -DGLX_DIRECT_RENDERING -DR200_MERGED=0 \ +DRIVER_DEFINES = -DCOMPILE_R300 -DR200_MERGED=0 \ -DRADEON_COMMON=1 -DRADEON_COMMON_FOR_R300 SYMLINKS = \ diff --git a/src/mesa/drivers/dri/r300/r300_maos.h b/src/mesa/drivers/dri/r300/r300_maos.h index 67fc6e2490d..055e8c58eaf 100644 --- a/src/mesa/drivers/dri/r300/r300_maos.h +++ b/src/mesa/drivers/dri/r300/r300_maos.h @@ -35,8 +35,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __R300_MAOS_H__ #define __R300_MAOS_H__ -#ifdef GLX_DIRECT_RENDERING - #include "r300_context.h" extern void r300EmitElts(GLcontext * ctx, void *elts, unsigned long n_elts, @@ -50,4 +48,3 @@ void r300UseArrays(GLcontext * ctx); extern void r300ReleaseArrays(GLcontext * ctx); #endif -#endif diff --git a/src/mesa/drivers/dri/r300/r300_tex.h b/src/mesa/drivers/dri/r300/r300_tex.h index 10aabc8b4b7..74fa08e97d9 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.h +++ b/src/mesa/drivers/dri/r300/r300_tex.h @@ -35,8 +35,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __r300_TEX_H__ #define __r300_TEX_H__ -#ifdef GLX_DIRECT_RENDERING - extern void r300UpdateTextureState(GLcontext * ctx); extern int r300UploadTexImages(r300ContextPtr rmesa, r300TexObjPtr t, @@ -46,5 +44,4 @@ extern void r300DestroyTexObj(r300ContextPtr rmesa, r300TexObjPtr t); extern void r300InitTextureFuncs(struct dd_function_table *functions); -#endif #endif /* __r300_TEX_H__ */ -- cgit v1.2.3 From 0e6b7eb9c018e2b1e25144ac652350c33768788b Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 18:11:38 +0000 Subject: r300: Don't need to sleep here; might cause performance problems the first time. --- src/mesa/drivers/dri/r300/radeon_span.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mesa/drivers/dri/r300/radeon_span.c b/src/mesa/drivers/dri/r300/radeon_span.c index 8b20034b191..5e85733ae66 100644 --- a/src/mesa/drivers/dri/r300/radeon_span.c +++ b/src/mesa/drivers/dri/r300/radeon_span.c @@ -244,7 +244,6 @@ static void radeonSpanRenderStart(GLcontext * ctx) fprintf(stderr, "Try R300_SPAN_DISABLE_LOCKING env var if this hangs.\n"); fflush(stderr); - sleep(1); } first = 0; } -- cgit v1.2.3 From 967c2d220d795d9f16dbba413d57cb9dcd58ae6d Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 18:14:42 +0000 Subject: r300: Converted "rp" variables (r300_fragment_program) to "fp". --- src/mesa/drivers/dri/r300/r300_fragprog.c | 742 +++++++++++++++--------------- src/mesa/drivers/dri/r300/r300_fragprog.h | 2 +- src/mesa/drivers/dri/r300/r300_state.c | 64 +-- 3 files changed, 404 insertions(+), 404 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.c b/src/mesa/drivers/dri/r300/r300_fragprog.c index 53866414f93..556e3041ed7 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog.c @@ -58,11 +58,11 @@ #define ERROR(fmt, args...) do { \ fprintf(stderr, "%s::%s(): " fmt "\n", \ __FILE__, __func__, ##args); \ - rp->error = GL_TRUE; \ + fp->error = GL_TRUE; \ } while(0) #define PFS_INVAL 0xFFFFFFFF -#define COMPILE_STATE struct r300_pfs_compile_state *cs = rp->cs +#define COMPILE_STATE struct r300_pfs_compile_state *cs = fp->cs #define SWIZZLE_XYZ 0 #define SWIZZLE_XXX 1 @@ -76,7 +76,7 @@ #define SWIZZLE_000 9 #define SWIZZLE_HHH 10 -#define swizzle(r, x, y, z, w) do_swizzle(rp, r, \ +#define swizzle(r, x, y, z, w) do_swizzle(fp, r, \ ((SWIZZLE_##x<<0)| \ (SWIZZLE_##y<<3)| \ (SWIZZLE_##z<<6)| \ @@ -301,15 +301,15 @@ static const GLuint pfs_zero = REG(REG_TYPE_CONST, /* * Common functions prototypes */ -static void dump_program(struct r300_fragment_program *rp); -static void emit_arith(struct r300_fragment_program *rp, int op, +static void dump_program(struct r300_fragment_program *fp); +static void emit_arith(struct r300_fragment_program *fp, int op, GLuint dest, int mask, GLuint src0, GLuint src1, GLuint src2, int flags); /** * Get an R300 temporary that can be written to in the given slot. */ -static int get_hw_temp(struct r300_fragment_program *rp, int slot) +static int get_hw_temp(struct r300_fragment_program *fp, int slot) { COMPILE_STATE; int r; @@ -339,8 +339,8 @@ static int get_hw_temp(struct r300_fragment_program *rp, int slot) cs->hwtemps[r].vector_valid = 0; cs->hwtemps[r].scalar_valid = 0; - if (r > rp->max_temp_idx) - rp->max_temp_idx = r; + if (r > fp->max_temp_idx) + fp->max_temp_idx = r; return r; } @@ -348,7 +348,7 @@ static int get_hw_temp(struct r300_fragment_program *rp, int slot) /** * Get an R300 temporary that will act as a TEX destination register. */ -static int get_hw_temp_tex(struct r300_fragment_program *rp) +static int get_hw_temp_tex(struct r300_fragment_program *fp) { COMPILE_STATE; int r; @@ -363,7 +363,7 @@ static int get_hw_temp_tex(struct r300_fragment_program *rp) } if (r >= PFS_NUM_TEMP_REGS) - return get_hw_temp(rp, 0); /* Will cause an indirection */ + return get_hw_temp(fp, 0); /* Will cause an indirection */ cs->hwtemps[r].reserved = cs->hwtemps[r].free; cs->hwtemps[r].free = -1; @@ -375,8 +375,8 @@ static int get_hw_temp_tex(struct r300_fragment_program *rp) cs->hwtemps[r].vector_valid = cs->nrslots; cs->hwtemps[r].scalar_valid = cs->nrslots; - if (r > rp->max_temp_idx) - rp->max_temp_idx = r; + if (r > fp->max_temp_idx) + fp->max_temp_idx = r; return r; } @@ -384,7 +384,7 @@ static int get_hw_temp_tex(struct r300_fragment_program *rp) /** * Mark the given hardware register as free. */ -static void free_hw_temp(struct r300_fragment_program *rp, int idx) +static void free_hw_temp(struct r300_fragment_program *fp, int idx) { COMPILE_STATE; @@ -403,7 +403,7 @@ static void free_hw_temp(struct r300_fragment_program *rp, int idx) /** * Create a new Mesa temporary register. */ -static GLuint get_temp_reg(struct r300_fragment_program *rp) +static GLuint get_temp_reg(struct r300_fragment_program *fp) { COMPILE_STATE; GLuint r = undef; @@ -429,7 +429,7 @@ static GLuint get_temp_reg(struct r300_fragment_program *rp) * Create a new Mesa temporary register that will act as the destination * register for a texture read. */ -static GLuint get_temp_reg_tex(struct r300_fragment_program *rp) +static GLuint get_temp_reg_tex(struct r300_fragment_program *fp) { COMPILE_STATE; GLuint r = undef; @@ -443,7 +443,7 @@ static GLuint get_temp_reg_tex(struct r300_fragment_program *rp) cs->temp_in_use |= (1 << --index); cs->temps[index].refcount = 0xFFFFFFFF; - cs->temps[index].reg = get_hw_temp_tex(rp); + cs->temps[index].reg = get_hw_temp_tex(fp); REG_SET_TYPE(r, REG_TYPE_TEMP); REG_SET_INDEX(r, index); @@ -454,7 +454,7 @@ static GLuint get_temp_reg_tex(struct r300_fragment_program *rp) /** * Free a Mesa temporary and the associated R300 temporary. */ -static void free_temp(struct r300_fragment_program *rp, GLuint r) +static void free_temp(struct r300_fragment_program *fp, GLuint r) { COMPILE_STATE; GLuint index = REG_GET_INDEX(r); @@ -463,11 +463,11 @@ static void free_temp(struct r300_fragment_program *rp, GLuint r) return; if (REG_GET_TYPE(r) == REG_TYPE_TEMP) { - free_hw_temp(rp, cs->temps[index].reg); + free_hw_temp(fp, cs->temps[index].reg); cs->temps[index].reg = -1; cs->temp_in_use &= ~(1 << index); } else if (REG_GET_TYPE(r) == REG_TYPE_INPUT) { - free_hw_temp(rp, cs->inputs[index].reg); + free_hw_temp(fp, cs->inputs[index].reg); cs->inputs[index].reg = -1; } } @@ -481,25 +481,25 @@ static void free_temp(struct r300_fragment_program *rp, GLuint r) * of the fragment program (actually, up until the next time the fragment * program is translated). */ -static GLuint emit_const4fv(struct r300_fragment_program *rp, +static GLuint emit_const4fv(struct r300_fragment_program *fp, const GLfloat * cp) { GLuint reg = undef; int index; - for (index = 0; index < rp->const_nr; ++index) { - if (rp->constant[index] == cp) + for (index = 0; index < fp->const_nr; ++index) { + if (fp->constant[index] == cp) break; } - if (index >= rp->const_nr) { + if (index >= fp->const_nr) { if (index >= PFS_NUM_CONST_REGS) { ERROR("Out of hw constants!\n"); return reg; } - rp->const_nr++; - rp->constant[index] = cp; + fp->const_nr++; + fp->constant[index] = cp; } REG_SET_TYPE(reg, REG_TYPE_CONST); @@ -530,7 +530,7 @@ static inline GLuint absolute(GLuint r) return r; } -static int swz_native(struct r300_fragment_program *rp, +static int swz_native(struct r300_fragment_program *fp, GLuint src, GLuint * r, GLuint arbneg) { /* Native swizzle, handle negation */ @@ -544,13 +544,13 @@ static int swz_native(struct r300_fragment_program *rp, *r = src; } else { if (!REG_GET_VALID(*r)) - *r = get_temp_reg(rp); + *r = get_temp_reg(fp); src |= REG_NEGV_MASK; - emit_arith(rp, + emit_arith(fp, PFS_OP_MAD, *r, arbneg & 0x7, keep(src), pfs_one, pfs_zero, 0); src = src & ~REG_NEGV_MASK; - emit_arith(rp, + emit_arith(fp, PFS_OP_MAD, *r, (arbneg ^ 0x7) | WRITEMASK_W, @@ -560,7 +560,7 @@ static int swz_native(struct r300_fragment_program *rp, return 3; } -static int swz_emit_partial(struct r300_fragment_program *rp, +static int swz_emit_partial(struct r300_fragment_program *fp, GLuint src, GLuint * r, int mask, int mc, GLuint arbneg) { @@ -568,7 +568,7 @@ static int swz_emit_partial(struct r300_fragment_program *rp, GLuint wmask = 0; if (!REG_GET_VALID(*r)) - *r = get_temp_reg(rp); + *r = get_temp_reg(fp); /* A partial match, VSWZ/mask define what parts of the * desired swizzle we match @@ -582,7 +582,7 @@ static int swz_emit_partial(struct r300_fragment_program *rp, if (tmp) { tmp = tmp ^ s_mask[mask].mask; if (tmp) { - emit_arith(rp, + emit_arith(fp, PFS_OP_MAD, *r, arbneg & s_mask[mask].mask, @@ -593,7 +593,7 @@ static int swz_emit_partial(struct r300_fragment_program *rp, } else { REG_SET_NO_USE(src, GL_FALSE); } - emit_arith(rp, + emit_arith(fp, PFS_OP_MAD, *r, tmp | wmask, src, pfs_one, pfs_zero, 0); } else { @@ -602,7 +602,7 @@ static int swz_emit_partial(struct r300_fragment_program *rp, } else { REG_SET_NO_USE(src, GL_FALSE); } - emit_arith(rp, + emit_arith(fp, PFS_OP_MAD, *r, (arbneg & s_mask[mask].mask) | wmask, @@ -614,7 +614,7 @@ static int swz_emit_partial(struct r300_fragment_program *rp, } else { REG_SET_NO_USE(src, GL_FALSE); } - emit_arith(rp, PFS_OP_MAD, + emit_arith(fp, PFS_OP_MAD, *r, s_mask[mask].mask | wmask, src, pfs_one, pfs_zero, 0); @@ -623,7 +623,7 @@ static int swz_emit_partial(struct r300_fragment_program *rp, return s_mask[mask].count; } -static GLuint do_swizzle(struct r300_fragment_program *rp, +static GLuint do_swizzle(struct r300_fragment_program *fp, GLuint src, GLuint arbswz, GLuint arbneg) { GLuint r = undef; @@ -636,8 +636,8 @@ static GLuint do_swizzle(struct r300_fragment_program *rp, */ #if 0 if (REG_GET_VSWZ(src) != SWIZZLE_XYZ || REG_GET_SSWZ(src) != SWIZZLE_W) { - GLuint temp = get_temp_reg(rp); - emit_arith(rp, + GLuint temp = get_temp_reg(fp); + emit_arith(fp, PFS_OP_MAD, temp, WRITEMASK_XYZW, src, pfs_one, pfs_zero, 0); src = temp; @@ -680,10 +680,10 @@ static GLuint do_swizzle(struct r300_fragment_program *rp, if (chash == (arbswz & s_mask[c_mask].hash)) { if (s_mask[c_mask].count == 3) { - v_match += swz_native(rp, + v_match += swz_native(fp, src, &r, arbneg); } else { - v_match += swz_emit_partial(rp, + v_match += swz_emit_partial(fp, src, &r, c_mask, @@ -708,7 +708,7 @@ static GLuint do_swizzle(struct r300_fragment_program *rp, return r; } -static GLuint t_src(struct r300_fragment_program *rp, +static GLuint t_src(struct r300_fragment_program *fp, struct prog_src_register fpsrc) { GLuint r = undef; @@ -725,19 +725,19 @@ static GLuint t_src(struct r300_fragment_program *rp, REG_SET_TYPE(r, REG_TYPE_INPUT); break; case PROGRAM_LOCAL_PARAM: - r = emit_const4fv(rp, - rp->mesa_program.Base.LocalParams[fpsrc. + r = emit_const4fv(fp, + fp->mesa_program.Base.LocalParams[fpsrc. Index]); break; case PROGRAM_ENV_PARAM: - r = emit_const4fv(rp, - rp->ctx->FragmentProgram.Parameters[fpsrc. + r = emit_const4fv(fp, + fp->ctx->FragmentProgram.Parameters[fpsrc. Index]); break; case PROGRAM_STATE_VAR: case PROGRAM_NAMED_PARAM: - r = emit_const4fv(rp, - rp->mesa_program.Base.Parameters-> + r = emit_const4fv(fp, + fp->mesa_program.Base.Parameters-> ParameterValues[fpsrc.Index]); break; default: @@ -747,11 +747,11 @@ static GLuint t_src(struct r300_fragment_program *rp, /* no point swizzling ONE/ZERO/HALF constants... */ if (REG_GET_VSWZ(r) < SWIZZLE_111 || REG_GET_SSWZ(r) < SWIZZLE_ZERO) - r = do_swizzle(rp, r, fpsrc.Swizzle, fpsrc.NegateBase); + r = do_swizzle(fp, r, fpsrc.Swizzle, fpsrc.NegateBase); return r; } -static GLuint t_scalar_src(struct r300_fragment_program *rp, +static GLuint t_scalar_src(struct r300_fragment_program *fp, struct prog_src_register fpsrc) { struct prog_src_register src = fpsrc; @@ -759,10 +759,10 @@ static GLuint t_scalar_src(struct r300_fragment_program *rp, src.Swizzle = ((sc << 0) | (sc << 3) | (sc << 6) | (sc << 9)); - return t_src(rp, src); + return t_src(fp, src); } -static GLuint t_dst(struct r300_fragment_program *rp, +static GLuint t_dst(struct r300_fragment_program *fp, struct prog_dst_register dest) { GLuint r = undef; @@ -791,7 +791,7 @@ static GLuint t_dst(struct r300_fragment_program *rp, } } -static int t_hw_src(struct r300_fragment_program *rp, GLuint src, GLboolean tex) +static int t_hw_src(struct r300_fragment_program *fp, GLuint src, GLboolean tex) { COMPILE_STATE; int idx; @@ -803,18 +803,18 @@ static int t_hw_src(struct r300_fragment_program *rp, GLuint src, GLboolean tex) * hasn't been written to. Undefined results. */ if (cs->temps[index].reg == -1) - cs->temps[index].reg = get_hw_temp(rp, cs->nrslots); + cs->temps[index].reg = get_hw_temp(fp, cs->nrslots); idx = cs->temps[index].reg; if (!REG_GET_NO_USE(src) && (--cs->temps[index].refcount == 0)) - free_temp(rp, src); + free_temp(fp, src); break; case REG_TYPE_INPUT: idx = cs->inputs[index].reg; if (!REG_GET_NO_USE(src) && (--cs->inputs[index].refcount == 0)) - free_hw_temp(rp, cs->inputs[index].reg); + free_hw_temp(fp, cs->inputs[index].reg); break; case REG_TYPE_CONST: return (index | SRC_CONST); @@ -829,7 +829,7 @@ static int t_hw_src(struct r300_fragment_program *rp, GLuint src, GLboolean tex) return idx; } -static int t_hw_dst(struct r300_fragment_program *rp, +static int t_hw_dst(struct r300_fragment_program *fp, GLuint dest, GLboolean tex, int slot) { COMPILE_STATE; @@ -841,15 +841,15 @@ static int t_hw_dst(struct r300_fragment_program *rp, case REG_TYPE_TEMP: if (cs->temps[REG_GET_INDEX(dest)].reg == -1) { if (!tex) { - cs->temps[index].reg = get_hw_temp(rp, slot); + cs->temps[index].reg = get_hw_temp(fp, slot); } else { - cs->temps[index].reg = get_hw_temp_tex(rp); + cs->temps[index].reg = get_hw_temp_tex(fp); } } idx = cs->temps[index].reg; if (!REG_GET_NO_USE(dest) && (--cs->temps[index].refcount == 0)) - free_temp(rp, dest); + free_temp(fp, dest); cs->dest_in_node |= (1 << idx); cs->used_in_node |= (1 << idx); @@ -857,11 +857,11 @@ static int t_hw_dst(struct r300_fragment_program *rp, case REG_TYPE_OUTPUT: switch (index) { case FRAG_RESULT_COLR: - rp->node[rp->cur_node].flags |= + fp->node[fp->cur_node].flags |= R300_PFS_NODE_OUTPUT_COLOR; break; case FRAG_RESULT_DEPR: - rp->node[rp->cur_node].flags |= + fp->node[fp->cur_node].flags |= R300_PFS_NODE_OUTPUT_DEPTH; break; } @@ -875,7 +875,7 @@ static int t_hw_dst(struct r300_fragment_program *rp, return idx; } -static void emit_nop(struct r300_fragment_program *rp) +static void emit_nop(struct r300_fragment_program *fp) { COMPILE_STATE; @@ -884,18 +884,18 @@ static void emit_nop(struct r300_fragment_program *rp) return; } - rp->alu.inst[cs->nrslots].inst0 = NOP_INST0; - rp->alu.inst[cs->nrslots].inst1 = NOP_INST1; - rp->alu.inst[cs->nrslots].inst2 = NOP_INST2; - rp->alu.inst[cs->nrslots].inst3 = NOP_INST3; + fp->alu.inst[cs->nrslots].inst0 = NOP_INST0; + fp->alu.inst[cs->nrslots].inst1 = NOP_INST1; + fp->alu.inst[cs->nrslots].inst2 = NOP_INST2; + fp->alu.inst[cs->nrslots].inst3 = NOP_INST3; cs->nrslots++; } -static void emit_tex(struct r300_fragment_program *rp, +static void emit_tex(struct r300_fragment_program *fp, struct prog_instruction *fpi, int opcode) { COMPILE_STATE; - GLuint coord = t_src(rp, fpi->SrcReg[0]); + GLuint coord = t_src(fp, fpi->SrcReg[0]); GLuint dest = undef, rdest = undef; GLuint din, uin; int unit = fpi->TexSrcUnit; @@ -925,49 +925,49 @@ static void emit_tex(struct r300_fragment_program *rp, tokens[2] = unit; factor_index = - _mesa_add_state_reference(rp->mesa_program.Base. + _mesa_add_state_reference(fp->mesa_program.Base. Parameters, tokens); factorreg = - emit_const4fv(rp, - rp->mesa_program.Base.Parameters-> + emit_const4fv(fp, + fp->mesa_program.Base.Parameters-> ParameterValues[factor_index]); - tempreg = keep(get_temp_reg(rp)); + tempreg = keep(get_temp_reg(fp)); - emit_arith(rp, PFS_OP_MAD, tempreg, WRITEMASK_XYZW, + emit_arith(fp, PFS_OP_MAD, tempreg, WRITEMASK_XYZW, coord, factorreg, pfs_zero, 0); /* Ensure correct node indirection */ uin = cs->used_in_node; din = cs->dest_in_node; - hwsrc = t_hw_src(rp, tempreg, GL_TRUE); + hwsrc = t_hw_src(fp, tempreg, GL_TRUE); } else { - hwsrc = t_hw_src(rp, coord, GL_TRUE); + hwsrc = t_hw_src(fp, coord, GL_TRUE); } - dest = t_dst(rp, fpi->DstReg); + dest = t_dst(fp, fpi->DstReg); /* r300 doesn't seem to be able to do TEX->output reg */ if (REG_GET_TYPE(dest) == REG_TYPE_OUTPUT) { rdest = dest; - dest = get_temp_reg_tex(rp); + dest = get_temp_reg_tex(fp); } hwdest = - t_hw_dst(rp, dest, GL_TRUE, - rp->node[rp->cur_node].alu_offset); + t_hw_dst(fp, dest, GL_TRUE, + fp->node[fp->cur_node].alu_offset); /* Use a temp that hasn't been used in this node, rather * than causing an indirection */ if (uin & (1 << hwdest)) { - free_hw_temp(rp, hwdest); - hwdest = get_hw_temp_tex(rp); + free_hw_temp(fp, hwdest); + hwdest = get_hw_temp_tex(fp); cs->temps[REG_GET_INDEX(dest)].reg = hwdest; } } else { hwdest = 0; unit = 0; - hwsrc = t_hw_src(rp, coord, GL_TRUE); + hwsrc = t_hw_src(fp, coord, GL_TRUE); } /* Indirection if source has been written in this node, or if the @@ -977,32 +977,32 @@ static void emit_tex(struct r300_fragment_program *rp, (din & (1 << hwsrc))) || (uin & (1 << hwdest))) { /* Finish off current node */ - if (rp->node[rp->cur_node].alu_offset == cs->nrslots) - emit_nop(rp); + if (fp->node[fp->cur_node].alu_offset == cs->nrslots) + emit_nop(fp); - rp->node[rp->cur_node].alu_end = - cs->nrslots - rp->node[rp->cur_node].alu_offset - 1; - assert(rp->node[rp->cur_node].alu_end >= 0); + fp->node[fp->cur_node].alu_end = + cs->nrslots - fp->node[fp->cur_node].alu_offset - 1; + assert(fp->node[fp->cur_node].alu_end >= 0); - if (++rp->cur_node >= PFS_MAX_TEX_INDIRECT) { + if (++fp->cur_node >= PFS_MAX_TEX_INDIRECT) { ERROR("too many levels of texture indirection\n"); return; } /* Start new node */ - rp->node[rp->cur_node].tex_offset = rp->tex.length; - rp->node[rp->cur_node].alu_offset = cs->nrslots; - rp->node[rp->cur_node].tex_end = -1; - rp->node[rp->cur_node].alu_end = -1; - rp->node[rp->cur_node].flags = 0; + fp->node[fp->cur_node].tex_offset = fp->tex.length; + fp->node[fp->cur_node].alu_offset = cs->nrslots; + fp->node[fp->cur_node].tex_end = -1; + fp->node[fp->cur_node].alu_end = -1; + fp->node[fp->cur_node].flags = 0; cs->used_in_node = 0; cs->dest_in_node = 0; } - if (rp->cur_node == 0) - rp->first_node_has_tex = 1; + if (fp->cur_node == 0) + fp->first_node_has_tex = 1; - rp->tex.inst[rp->tex.length++] = 0 | (hwsrc << R300_FPITX_SRC_SHIFT) + fp->tex.inst[fp->tex.length++] = 0 | (hwsrc << R300_FPITX_SRC_SHIFT) | (hwdest << R300_FPITX_DST_SHIFT) | (unit << R300_FPITX_IMAGE_SHIFT) /* not entirely sure about this */ @@ -1012,25 +1012,25 @@ static void emit_tex(struct r300_fragment_program *rp, if (REG_GET_TYPE(coord) != REG_TYPE_CONST) cs->used_in_node |= (1 << hwsrc); - rp->node[rp->cur_node].tex_end++; + fp->node[fp->cur_node].tex_end++; /* Copy from temp to output if needed */ if (REG_GET_VALID(rdest)) { - emit_arith(rp, PFS_OP_MAD, rdest, WRITEMASK_XYZW, dest, + emit_arith(fp, PFS_OP_MAD, rdest, WRITEMASK_XYZW, dest, pfs_one, pfs_zero, 0); - free_temp(rp, dest); + free_temp(fp, dest); } /* Free temp register */ if (tempreg != 0) - free_temp(rp, tempreg); + free_temp(fp, tempreg); } /** * Returns the first slot where we could possibly allow writing to dest, * according to register allocation. */ -static int get_earliest_allowed_write(struct r300_fragment_program *rp, +static int get_earliest_allowed_write(struct r300_fragment_program *fp, GLuint dest, int mask) { COMPILE_STATE; @@ -1080,7 +1080,7 @@ static int get_earliest_allowed_write(struct r300_fragment_program *rp, * * @return the index of the slot */ -static int find_and_prepare_slot(struct r300_fragment_program *rp, +static int find_and_prepare_slot(struct r300_fragment_program *fp, GLboolean emit_vop, GLboolean emit_sop, int argc, GLuint * src, GLuint dest, int mask) @@ -1105,10 +1105,10 @@ static int find_and_prepare_slot(struct r300_fragment_program *rp, if (emit_sop) used |= SLOT_OP_SCALAR; - pos = get_earliest_allowed_write(rp, dest, mask); + pos = get_earliest_allowed_write(fp, dest, mask); - if (rp->node[rp->cur_node].alu_offset > pos) - pos = rp->node[rp->cur_node].alu_offset; + if (fp->node[fp->cur_node].alu_offset > pos) + pos = fp->node[fp->cur_node].alu_offset; for (i = 0; i < argc; ++i) { if (!REG_GET_BUILTIN(src[i])) { if (emit_vop) @@ -1117,7 +1117,7 @@ static int find_and_prepare_slot(struct r300_fragment_program *rp, used |= s_swiz[REG_GET_SSWZ(src[i])].flags << i; } - hwsrc[i] = t_hw_src(rp, src[i], GL_FALSE); /* Note: sideeffects wrt refcounting! */ + hwsrc[i] = t_hw_src(fp, src[i], GL_FALSE); /* Note: sideeffects wrt refcounting! */ regnr = hwsrc[i] & 31; if (REG_GET_TYPE(src[i]) == REG_TYPE_TEMP) { @@ -1143,10 +1143,10 @@ static int find_and_prepare_slot(struct r300_fragment_program *rp, return -1; } - rp->alu.inst[pos].inst0 = NOP_INST0; - rp->alu.inst[pos].inst1 = NOP_INST1; - rp->alu.inst[pos].inst2 = NOP_INST2; - rp->alu.inst[pos].inst3 = NOP_INST3; + fp->alu.inst[pos].inst0 = NOP_INST0; + fp->alu.inst[pos].inst1 = NOP_INST1; + fp->alu.inst[pos].inst2 = NOP_INST2; + fp->alu.inst[pos].inst3 = NOP_INST3; cs->nrslots++; } @@ -1223,14 +1223,14 @@ static int find_and_prepare_slot(struct r300_fragment_program *rp, } // Emit the source fetch code - rp->alu.inst[pos].inst1 &= ~R300_FPI1_SRC_MASK; - rp->alu.inst[pos].inst1 |= + fp->alu.inst[pos].inst1 &= ~R300_FPI1_SRC_MASK; + fp->alu.inst[pos].inst1 |= ((cs->slot[pos].vsrc[0] << R300_FPI1_SRC0C_SHIFT) | (cs->slot[pos].vsrc[1] << R300_FPI1_SRC1C_SHIFT) | (cs->slot[pos].vsrc[2] << R300_FPI1_SRC2C_SHIFT)); - rp->alu.inst[pos].inst3 &= ~R300_FPI3_SRC_MASK; - rp->alu.inst[pos].inst3 |= + fp->alu.inst[pos].inst3 &= ~R300_FPI3_SRC_MASK; + fp->alu.inst[pos].inst3 |= ((cs->slot[pos].ssrc[0] << R300_FPI3_SRC0A_SHIFT) | (cs->slot[pos].ssrc[1] << R300_FPI3_SRC1A_SHIFT) | (cs->slot[pos].ssrc[2] << R300_FPI3_SRC2A_SHIFT)); @@ -1256,10 +1256,10 @@ static int find_and_prepare_slot(struct r300_fragment_program *rp, } } - rp->alu.inst[pos].inst0 &= + fp->alu.inst[pos].inst0 &= ~(R300_FPI0_ARG0C_MASK | R300_FPI0_ARG1C_MASK | R300_FPI0_ARG2C_MASK); - rp->alu.inst[pos].inst0 |= + fp->alu.inst[pos].inst0 |= (swz[0] << R300_FPI0_ARG0C_SHIFT) | (swz[1] << R300_FPI0_ARG1C_SHIFT) | (swz[2] << R300_FPI0_ARG2C_SHIFT); @@ -1285,10 +1285,10 @@ static int find_and_prepare_slot(struct r300_fragment_program *rp, } } - rp->alu.inst[pos].inst2 &= + fp->alu.inst[pos].inst2 &= ~(R300_FPI2_ARG0A_MASK | R300_FPI2_ARG1A_MASK | R300_FPI2_ARG2A_MASK); - rp->alu.inst[pos].inst2 |= + fp->alu.inst[pos].inst2 |= (swz[0] << R300_FPI2_ARG0A_SHIFT) | (swz[1] << R300_FPI2_ARG1A_SHIFT) | (swz[2] << R300_FPI2_ARG2A_SHIFT); @@ -1300,7 +1300,7 @@ static int find_and_prepare_slot(struct r300_fragment_program *rp, /** * Append an ALU instruction to the instruction list. */ -static void emit_arith(struct r300_fragment_program *rp, +static void emit_arith(struct r300_fragment_program *fp, int op, GLuint dest, int mask, @@ -1334,12 +1334,12 @@ static void emit_arith(struct r300_fragment_program *rp, emit_sop = GL_TRUE; pos = - find_and_prepare_slot(rp, emit_vop, emit_sop, argc, src, dest, + find_and_prepare_slot(fp, emit_vop, emit_sop, argc, src, dest, mask); if (pos < 0) return; - hwdest = t_hw_dst(rp, dest, GL_FALSE, pos); /* Note: Side effects wrt register allocation */ + hwdest = t_hw_dst(fp, dest, GL_FALSE, pos); /* Note: Side effects wrt register allocation */ if (flags & PFS_FLAG_SAT) { vop |= R300_FPI0_OUTC_SAT; @@ -1348,19 +1348,19 @@ static void emit_arith(struct r300_fragment_program *rp, /* Throw the pieces together and get FPI0/1 */ if (emit_vop) { - rp->alu.inst[pos].inst0 |= vop; + fp->alu.inst[pos].inst0 |= vop; - rp->alu.inst[pos].inst1 |= hwdest << R300_FPI1_DSTC_SHIFT; + fp->alu.inst[pos].inst1 |= hwdest << R300_FPI1_DSTC_SHIFT; if (REG_GET_TYPE(dest) == REG_TYPE_OUTPUT) { if (REG_GET_INDEX(dest) == FRAG_RESULT_COLR) { - rp->alu.inst[pos].inst1 |= + fp->alu.inst[pos].inst1 |= (mask & WRITEMASK_XYZ) << R300_FPI1_DSTC_OUTPUT_MASK_SHIFT; } else assert(0); } else { - rp->alu.inst[pos].inst1 |= + fp->alu.inst[pos].inst1 |= (mask & WRITEMASK_XYZ) << R300_FPI1_DSTC_REG_MASK_SHIFT; @@ -1370,22 +1370,22 @@ static void emit_arith(struct r300_fragment_program *rp, /* And now FPI2/3 */ if (emit_sop) { - rp->alu.inst[pos].inst2 |= sop; + fp->alu.inst[pos].inst2 |= sop; if (mask & WRITEMASK_W) { if (REG_GET_TYPE(dest) == REG_TYPE_OUTPUT) { if (REG_GET_INDEX(dest) == FRAG_RESULT_COLR) { - rp->alu.inst[pos].inst3 |= + fp->alu.inst[pos].inst3 |= (hwdest << R300_FPI3_DSTA_SHIFT) | R300_FPI3_DSTA_OUTPUT; } else if (REG_GET_INDEX(dest) == FRAG_RESULT_DEPR) { - rp->alu.inst[pos].inst3 |= + fp->alu.inst[pos].inst3 |= R300_FPI3_DSTA_DEPTH; } else assert(0); } else { - rp->alu.inst[pos].inst3 |= + fp->alu.inst[pos].inst3 |= (hwdest << R300_FPI3_DSTA_SHIFT) | R300_FPI3_DSTA_REG; @@ -1398,9 +1398,9 @@ static void emit_arith(struct r300_fragment_program *rp, } #if 0 -static GLuint get_attrib(struct r300_fragment_program *rp, GLuint attr) +static GLuint get_attrib(struct r300_fragment_program *fp, GLuint attr) { - struct gl_fragment_program *mp = &rp->mesa_program; + struct gl_fragment_program *mp = &fp->mesa_program; GLuint r = undef; if (!(mp->Base.InputsRead & (1 << attr))) { @@ -1455,7 +1455,7 @@ static GLfloat SinCosConsts[2][4] = { static const GLfloat LitConst[4] = { 127.999999, 127.999999, 127.999999, -127.999999 }; -static void emit_lit(struct r300_fragment_program *rp, +static void emit_lit(struct r300_fragment_program *fp, GLuint dest, int mask, GLuint src, int flags) { COMPILE_STATE; @@ -1463,7 +1463,7 @@ static void emit_lit(struct r300_fragment_program *rp, int needTemporary; GLuint temp; - cnst = emit_const4fv(rp, LitConst); + cnst = emit_const4fv(fp, LitConst); needTemporary = 0; if ((mask & WRITEMASK_XYZW) != WRITEMASK_XYZW) { @@ -1475,7 +1475,7 @@ static void emit_lit(struct r300_fragment_program *rp, } if (needTemporary) { - temp = keep(get_temp_reg(rp)); + temp = keep(get_temp_reg(fp)); } else { temp = keep(dest); } @@ -1486,49 +1486,49 @@ static void emit_lit(struct r300_fragment_program *rp, // so swizzling between the two parts can create fake dependencies. // First slot - emit_arith(rp, PFS_OP_MAX, temp, WRITEMASK_XY, + emit_arith(fp, PFS_OP_MAX, temp, WRITEMASK_XY, keep(src), pfs_zero, undef, 0); - emit_arith(rp, PFS_OP_MAX, temp, WRITEMASK_W, src, cnst, undef, 0); + emit_arith(fp, PFS_OP_MAX, temp, WRITEMASK_W, src, cnst, undef, 0); // Second slot - emit_arith(rp, PFS_OP_MIN, temp, WRITEMASK_Z, + emit_arith(fp, PFS_OP_MIN, temp, WRITEMASK_Z, swizzle(temp, W, W, W, W), cnst, undef, 0); - emit_arith(rp, PFS_OP_LG2, temp, WRITEMASK_W, + emit_arith(fp, PFS_OP_LG2, temp, WRITEMASK_W, swizzle(temp, Y, Y, Y, Y), undef, undef, 0); // Third slot // If desired, we saturate the y result here. // This does not affect the use as a condition variable in the CMP later - emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_W, + emit_arith(fp, PFS_OP_MAD, temp, WRITEMASK_W, temp, swizzle(temp, Z, Z, Z, Z), pfs_zero, 0); - emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_Y, + emit_arith(fp, PFS_OP_MAD, temp, WRITEMASK_Y, swizzle(temp, X, X, X, X), pfs_one, pfs_zero, flags); // Fourth slot - emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_X, + emit_arith(fp, PFS_OP_MAD, temp, WRITEMASK_X, pfs_one, pfs_one, pfs_zero, 0); - emit_arith(rp, PFS_OP_EX2, temp, WRITEMASK_W, temp, undef, undef, 0); + emit_arith(fp, PFS_OP_EX2, temp, WRITEMASK_W, temp, undef, undef, 0); // Fifth slot - emit_arith(rp, PFS_OP_CMP, temp, WRITEMASK_Z, + emit_arith(fp, PFS_OP_CMP, temp, WRITEMASK_Z, pfs_zero, swizzle(temp, W, W, W, W), negate(swizzle(temp, Y, Y, Y, Y)), flags); - emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_W, pfs_one, pfs_one, + emit_arith(fp, PFS_OP_MAD, temp, WRITEMASK_W, pfs_one, pfs_one, pfs_zero, 0); if (needTemporary) { - emit_arith(rp, PFS_OP_MAD, dest, mask, + emit_arith(fp, PFS_OP_MAD, dest, mask, temp, pfs_one, pfs_zero, flags); - free_temp(rp, temp); + free_temp(fp, temp); } else { // Decrease refcount of the destination - t_hw_dst(rp, dest, GL_FALSE, cs->nrslots); + t_hw_dst(fp, dest, GL_FALSE, cs->nrslots); } } -static GLboolean parse_program(struct r300_fragment_program *rp) +static GLboolean parse_program(struct r300_fragment_program *fp) { - struct gl_fragment_program *mp = &rp->mesa_program; + struct gl_fragment_program *mp = &fp->mesa_program; const struct prog_instruction *inst = mp->Base.Instructions; struct prog_instruction *fpi; GLuint src[3], dest, temp[2]; @@ -1547,30 +1547,30 @@ static GLboolean parse_program(struct r300_fragment_program *rp) flags = 0; if (fpi->Opcode != OPCODE_KIL) { - dest = t_dst(rp, fpi->DstReg); + dest = t_dst(fp, fpi->DstReg); mask = fpi->DstReg.WriteMask; } switch (fpi->Opcode) { case OPCODE_ABS: - src[0] = t_src(rp, fpi->SrcReg[0]); - emit_arith(rp, PFS_OP_MAD, dest, mask, + src[0] = t_src(fp, fpi->SrcReg[0]); + emit_arith(fp, PFS_OP_MAD, dest, mask, absolute(src[0]), pfs_one, pfs_zero, flags); break; case OPCODE_ADD: - src[0] = t_src(rp, fpi->SrcReg[0]); - src[1] = t_src(rp, fpi->SrcReg[1]); - emit_arith(rp, PFS_OP_MAD, dest, mask, + src[0] = t_src(fp, fpi->SrcReg[0]); + src[1] = t_src(fp, fpi->SrcReg[1]); + emit_arith(fp, PFS_OP_MAD, dest, mask, src[0], pfs_one, src[1], flags); break; case OPCODE_CMP: - src[0] = t_src(rp, fpi->SrcReg[0]); - src[1] = t_src(rp, fpi->SrcReg[1]); - src[2] = t_src(rp, fpi->SrcReg[2]); + src[0] = t_src(fp, fpi->SrcReg[0]); + src[1] = t_src(fp, fpi->SrcReg[1]); + src[2] = t_src(fp, fpi->SrcReg[2]); /* ARB_f_p - if src0.c < 0.0 ? src1.c : src2.c * r300 - if src2.c < 0.0 ? src1.c : src0.c */ - emit_arith(rp, PFS_OP_CMP, dest, mask, + emit_arith(fp, PFS_OP_CMP, dest, mask, src[2], src[1], src[0], flags); break; case OPCODE_COS: @@ -1582,206 +1582,206 @@ static GLboolean parse_program(struct r300_fragment_program *rp) * x = (x*2*PI)-PI * result = sin(x) */ - temp[0] = get_temp_reg(rp); - const_sin[0] = emit_const4fv(rp, SinCosConsts[0]); - const_sin[1] = emit_const4fv(rp, SinCosConsts[1]); - src[0] = t_scalar_src(rp, fpi->SrcReg[0]); + temp[0] = get_temp_reg(fp); + const_sin[0] = emit_const4fv(fp, SinCosConsts[0]); + const_sin[1] = emit_const4fv(fp, SinCosConsts[1]); + src[0] = t_scalar_src(fp, fpi->SrcReg[0]); /* add 0.5*PI and do range reduction */ - emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_X, + emit_arith(fp, PFS_OP_MAD, temp[0], WRITEMASK_X, swizzle(src[0], X, X, X, X), swizzle(const_sin[1], Z, Z, Z, Z), swizzle(const_sin[1], X, X, X, X), 0); - emit_arith(rp, PFS_OP_FRC, temp[0], WRITEMASK_X, + emit_arith(fp, PFS_OP_FRC, temp[0], WRITEMASK_X, swizzle(temp[0], X, X, X, X), undef, undef, 0); - emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_Z, swizzle(temp[0], X, X, X, X), swizzle(const_sin[1], W, W, W, W), //2*PI + emit_arith(fp, PFS_OP_MAD, temp[0], WRITEMASK_Z, swizzle(temp[0], X, X, X, X), swizzle(const_sin[1], W, W, W, W), //2*PI negate(swizzle(const_sin[0], Z, Z, Z, Z)), //-PI 0); /* SIN */ - emit_arith(rp, PFS_OP_MAD, temp[0], + emit_arith(fp, PFS_OP_MAD, temp[0], WRITEMASK_X | WRITEMASK_Y, swizzle(temp[0], Z, Z, Z, Z), const_sin[0], pfs_zero, 0); - emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_X, + emit_arith(fp, PFS_OP_MAD, temp[0], WRITEMASK_X, swizzle(temp[0], Y, Y, Y, Y), absolute(swizzle(temp[0], Z, Z, Z, Z)), swizzle(temp[0], X, X, X, X), 0); - emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_Y, + emit_arith(fp, PFS_OP_MAD, temp[0], WRITEMASK_Y, swizzle(temp[0], X, X, X, X), absolute(swizzle(temp[0], X, X, X, X)), negate(swizzle(temp[0], X, X, X, X)), 0); - emit_arith(rp, PFS_OP_MAD, dest, mask, + emit_arith(fp, PFS_OP_MAD, dest, mask, swizzle(temp[0], Y, Y, Y, Y), swizzle(const_sin[0], W, W, W, W), swizzle(temp[0], X, X, X, X), flags); - free_temp(rp, temp[0]); + free_temp(fp, temp[0]); break; case OPCODE_DP3: - src[0] = t_src(rp, fpi->SrcReg[0]); - src[1] = t_src(rp, fpi->SrcReg[1]); - emit_arith(rp, PFS_OP_DP3, dest, mask, + src[0] = t_src(fp, fpi->SrcReg[0]); + src[1] = t_src(fp, fpi->SrcReg[1]); + emit_arith(fp, PFS_OP_DP3, dest, mask, src[0], src[1], undef, flags); break; case OPCODE_DP4: - src[0] = t_src(rp, fpi->SrcReg[0]); - src[1] = t_src(rp, fpi->SrcReg[1]); - emit_arith(rp, PFS_OP_DP4, dest, mask, + src[0] = t_src(fp, fpi->SrcReg[0]); + src[1] = t_src(fp, fpi->SrcReg[1]); + emit_arith(fp, PFS_OP_DP4, dest, mask, src[0], src[1], undef, flags); break; case OPCODE_DPH: - src[0] = t_src(rp, fpi->SrcReg[0]); - src[1] = t_src(rp, fpi->SrcReg[1]); + src[0] = t_src(fp, fpi->SrcReg[0]); + src[1] = t_src(fp, fpi->SrcReg[1]); /* src0.xyz1 -> temp * DP4 dest, temp, src1 */ #if 0 - temp[0] = get_temp_reg(rp); + temp[0] = get_temp_reg(fp); src[0].s_swz = SWIZZLE_ONE; - emit_arith(rp, PFS_OP_MAD, temp[0], mask, + emit_arith(fp, PFS_OP_MAD, temp[0], mask, src[0], pfs_one, pfs_zero, 0); - emit_arith(rp, PFS_OP_DP4, dest, mask, + emit_arith(fp, PFS_OP_DP4, dest, mask, temp[0], src[1], undef, flags); - free_temp(rp, temp[0]); + free_temp(fp, temp[0]); #else - emit_arith(rp, PFS_OP_DP4, dest, mask, + emit_arith(fp, PFS_OP_DP4, dest, mask, swizzle(src[0], X, Y, Z, ONE), src[1], undef, flags); #endif break; case OPCODE_DST: - src[0] = t_src(rp, fpi->SrcReg[0]); - src[1] = t_src(rp, fpi->SrcReg[1]); + src[0] = t_src(fp, fpi->SrcReg[0]); + src[1] = t_src(fp, fpi->SrcReg[1]); /* dest.y = src0.y * src1.y */ if (mask & WRITEMASK_Y) - emit_arith(rp, PFS_OP_MAD, dest, WRITEMASK_Y, + emit_arith(fp, PFS_OP_MAD, dest, WRITEMASK_Y, keep(src[0]), keep(src[1]), pfs_zero, flags); /* dest.z = src0.z */ if (mask & WRITEMASK_Z) - emit_arith(rp, PFS_OP_MAD, dest, WRITEMASK_Z, + emit_arith(fp, PFS_OP_MAD, dest, WRITEMASK_Z, src[0], pfs_one, pfs_zero, flags); /* result.x = 1.0 * result.w = src1.w */ if (mask & WRITEMASK_XW) { REG_SET_VSWZ(src[1], SWIZZLE_111); /*Cheat */ - emit_arith(rp, PFS_OP_MAD, dest, + emit_arith(fp, PFS_OP_MAD, dest, mask & WRITEMASK_XW, src[1], pfs_one, pfs_zero, flags); } break; case OPCODE_EX2: - src[0] = t_scalar_src(rp, fpi->SrcReg[0]); - emit_arith(rp, PFS_OP_EX2, dest, mask, + src[0] = t_scalar_src(fp, fpi->SrcReg[0]); + emit_arith(fp, PFS_OP_EX2, dest, mask, src[0], undef, undef, flags); break; case OPCODE_FLR: - src[0] = t_src(rp, fpi->SrcReg[0]); - temp[0] = get_temp_reg(rp); + src[0] = t_src(fp, fpi->SrcReg[0]); + temp[0] = get_temp_reg(fp); /* FRC temp, src0 * MAD dest, src0, 1.0, -temp */ - emit_arith(rp, PFS_OP_FRC, temp[0], mask, + emit_arith(fp, PFS_OP_FRC, temp[0], mask, keep(src[0]), undef, undef, 0); - emit_arith(rp, PFS_OP_MAD, dest, mask, + emit_arith(fp, PFS_OP_MAD, dest, mask, src[0], pfs_one, negate(temp[0]), flags); - free_temp(rp, temp[0]); + free_temp(fp, temp[0]); break; case OPCODE_FRC: - src[0] = t_src(rp, fpi->SrcReg[0]); - emit_arith(rp, PFS_OP_FRC, dest, mask, + src[0] = t_src(fp, fpi->SrcReg[0]); + emit_arith(fp, PFS_OP_FRC, dest, mask, src[0], undef, undef, flags); break; case OPCODE_KIL: - emit_tex(rp, fpi, R300_FPITX_OP_KIL); + emit_tex(fp, fpi, R300_FPITX_OP_KIL); break; case OPCODE_LG2: - src[0] = t_scalar_src(rp, fpi->SrcReg[0]); - emit_arith(rp, PFS_OP_LG2, dest, mask, + src[0] = t_scalar_src(fp, fpi->SrcReg[0]); + emit_arith(fp, PFS_OP_LG2, dest, mask, src[0], undef, undef, flags); break; case OPCODE_LIT: - src[0] = t_src(rp, fpi->SrcReg[0]); - emit_lit(rp, dest, mask, src[0], flags); + src[0] = t_src(fp, fpi->SrcReg[0]); + emit_lit(fp, dest, mask, src[0], flags); break; case OPCODE_LRP: - src[0] = t_src(rp, fpi->SrcReg[0]); - src[1] = t_src(rp, fpi->SrcReg[1]); - src[2] = t_src(rp, fpi->SrcReg[2]); + src[0] = t_src(fp, fpi->SrcReg[0]); + src[1] = t_src(fp, fpi->SrcReg[1]); + src[2] = t_src(fp, fpi->SrcReg[2]); /* result = tmp0tmp1 + (1 - tmp0)tmp2 * = tmp0tmp1 + tmp2 + (-tmp0)tmp2 * MAD temp, -tmp0, tmp2, tmp2 * MAD result, tmp0, tmp1, temp */ - temp[0] = get_temp_reg(rp); - emit_arith(rp, PFS_OP_MAD, temp[0], mask, + temp[0] = get_temp_reg(fp); + emit_arith(fp, PFS_OP_MAD, temp[0], mask, negate(keep(src[0])), keep(src[2]), src[2], 0); - emit_arith(rp, PFS_OP_MAD, dest, mask, + emit_arith(fp, PFS_OP_MAD, dest, mask, src[0], src[1], temp[0], flags); - free_temp(rp, temp[0]); + free_temp(fp, temp[0]); break; case OPCODE_MAD: - src[0] = t_src(rp, fpi->SrcReg[0]); - src[1] = t_src(rp, fpi->SrcReg[1]); - src[2] = t_src(rp, fpi->SrcReg[2]); - emit_arith(rp, PFS_OP_MAD, dest, mask, + src[0] = t_src(fp, fpi->SrcReg[0]); + src[1] = t_src(fp, fpi->SrcReg[1]); + src[2] = t_src(fp, fpi->SrcReg[2]); + emit_arith(fp, PFS_OP_MAD, dest, mask, src[0], src[1], src[2], flags); break; case OPCODE_MAX: - src[0] = t_src(rp, fpi->SrcReg[0]); - src[1] = t_src(rp, fpi->SrcReg[1]); - emit_arith(rp, PFS_OP_MAX, dest, mask, + src[0] = t_src(fp, fpi->SrcReg[0]); + src[1] = t_src(fp, fpi->SrcReg[1]); + emit_arith(fp, PFS_OP_MAX, dest, mask, src[0], src[1], undef, flags); break; case OPCODE_MIN: - src[0] = t_src(rp, fpi->SrcReg[0]); - src[1] = t_src(rp, fpi->SrcReg[1]); - emit_arith(rp, PFS_OP_MIN, dest, mask, + src[0] = t_src(fp, fpi->SrcReg[0]); + src[1] = t_src(fp, fpi->SrcReg[1]); + emit_arith(fp, PFS_OP_MIN, dest, mask, src[0], src[1], undef, flags); break; case OPCODE_MOV: case OPCODE_SWZ: - src[0] = t_src(rp, fpi->SrcReg[0]); - emit_arith(rp, PFS_OP_MAD, dest, mask, + src[0] = t_src(fp, fpi->SrcReg[0]); + emit_arith(fp, PFS_OP_MAD, dest, mask, src[0], pfs_one, pfs_zero, flags); break; case OPCODE_MUL: - src[0] = t_src(rp, fpi->SrcReg[0]); - src[1] = t_src(rp, fpi->SrcReg[1]); - emit_arith(rp, PFS_OP_MAD, dest, mask, + src[0] = t_src(fp, fpi->SrcReg[0]); + src[1] = t_src(fp, fpi->SrcReg[1]); + emit_arith(fp, PFS_OP_MAD, dest, mask, src[0], src[1], pfs_zero, flags); break; case OPCODE_POW: - src[0] = t_scalar_src(rp, fpi->SrcReg[0]); - src[1] = t_scalar_src(rp, fpi->SrcReg[1]); - temp[0] = get_temp_reg(rp); - emit_arith(rp, PFS_OP_LG2, temp[0], WRITEMASK_W, + src[0] = t_scalar_src(fp, fpi->SrcReg[0]); + src[1] = t_scalar_src(fp, fpi->SrcReg[1]); + temp[0] = get_temp_reg(fp); + emit_arith(fp, PFS_OP_LG2, temp[0], WRITEMASK_W, src[0], undef, undef, 0); - emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_W, + emit_arith(fp, PFS_OP_MAD, temp[0], WRITEMASK_W, temp[0], src[1], pfs_zero, 0); - emit_arith(rp, PFS_OP_EX2, dest, fpi->DstReg.WriteMask, + emit_arith(fp, PFS_OP_EX2, dest, fpi->DstReg.WriteMask, temp[0], undef, undef, 0); - free_temp(rp, temp[0]); + free_temp(fp, temp[0]); break; case OPCODE_RCP: - src[0] = t_scalar_src(rp, fpi->SrcReg[0]); - emit_arith(rp, PFS_OP_RCP, dest, mask, + src[0] = t_scalar_src(fp, fpi->SrcReg[0]); + emit_arith(fp, PFS_OP_RCP, dest, mask, src[0], undef, undef, flags); break; case OPCODE_RSQ: - src[0] = t_scalar_src(rp, fpi->SrcReg[0]); - emit_arith(rp, PFS_OP_RSQ, dest, mask, + src[0] = t_scalar_src(fp, fpi->SrcReg[0]); + emit_arith(fp, PFS_OP_RSQ, dest, mask, absolute(src[0]), pfs_zero, pfs_zero, flags); break; case OPCODE_SCS: @@ -1792,51 +1792,51 @@ static GLboolean parse_program(struct r300_fragment_program *rp) * result.y = sin(x) (sin) * */ - temp[0] = get_temp_reg(rp); - temp[1] = get_temp_reg(rp); - const_sin[0] = emit_const4fv(rp, SinCosConsts[0]); - const_sin[1] = emit_const4fv(rp, SinCosConsts[1]); - src[0] = t_scalar_src(rp, fpi->SrcReg[0]); + temp[0] = get_temp_reg(fp); + temp[1] = get_temp_reg(fp); + const_sin[0] = emit_const4fv(fp, SinCosConsts[0]); + const_sin[1] = emit_const4fv(fp, SinCosConsts[1]); + src[0] = t_scalar_src(fp, fpi->SrcReg[0]); /* x = -abs(x)+0.5*PI */ - emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_Z, swizzle(const_sin[0], Z, Z, Z, Z), //PI + emit_arith(fp, PFS_OP_MAD, temp[0], WRITEMASK_Z, swizzle(const_sin[0], Z, Z, Z, Z), //PI pfs_half, negate(abs (swizzle(keep(src[0]), X, X, X, X))), 0); /* C*x (sin) */ - emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_W, + emit_arith(fp, PFS_OP_MAD, temp[0], WRITEMASK_W, swizzle(const_sin[0], Y, Y, Y, Y), swizzle(keep(src[0]), X, X, X, X), pfs_zero, 0); /* B*x, C*x (cos) */ - emit_arith(rp, PFS_OP_MAD, temp[0], + emit_arith(fp, PFS_OP_MAD, temp[0], WRITEMASK_X | WRITEMASK_Y, swizzle(temp[0], Z, Z, Z, Z), const_sin[0], pfs_zero, 0); /* B*x (sin) */ - emit_arith(rp, PFS_OP_MAD, temp[1], WRITEMASK_W, + emit_arith(fp, PFS_OP_MAD, temp[1], WRITEMASK_W, swizzle(const_sin[0], X, X, X, X), keep(src[0]), pfs_zero, 0); /* y = B*x + C*x*abs(x) (sin) */ - emit_arith(rp, PFS_OP_MAD, temp[1], WRITEMASK_Z, + emit_arith(fp, PFS_OP_MAD, temp[1], WRITEMASK_Z, absolute(src[0]), swizzle(temp[0], W, W, W, W), swizzle(temp[1], W, W, W, W), 0); /* y = B*x + C*x*abs(x) (cos) */ - emit_arith(rp, PFS_OP_MAD, temp[1], WRITEMASK_W, + emit_arith(fp, PFS_OP_MAD, temp[1], WRITEMASK_W, swizzle(temp[0], Y, Y, Y, Y), absolute(swizzle(temp[0], Z, Z, Z, Z)), swizzle(temp[0], X, X, X, X), 0); /* y*abs(y) - y (cos), y*abs(y) - y (sin) */ - emit_arith(rp, PFS_OP_MAD, temp[0], + emit_arith(fp, PFS_OP_MAD, temp[0], WRITEMASK_X | WRITEMASK_Y, swizzle(temp[1], W, Z, Y, X), @@ -1844,26 +1844,26 @@ static GLboolean parse_program(struct r300_fragment_program *rp) negate(swizzle(temp[1], W, Z, Y, X)), 0); /* dest.xy = mad(temp.xy, P, temp2.wz) */ - emit_arith(rp, PFS_OP_MAD, dest, + emit_arith(fp, PFS_OP_MAD, dest, mask & (WRITEMASK_X | WRITEMASK_Y), temp[0], swizzle(const_sin[0], W, W, W, W), swizzle(temp[1], W, Z, Y, X), flags); - free_temp(rp, temp[0]); - free_temp(rp, temp[1]); + free_temp(fp, temp[0]); + free_temp(fp, temp[1]); break; case OPCODE_SGE: - src[0] = t_src(rp, fpi->SrcReg[0]); - src[1] = t_src(rp, fpi->SrcReg[1]); - temp[0] = get_temp_reg(rp); + src[0] = t_src(fp, fpi->SrcReg[0]); + src[1] = t_src(fp, fpi->SrcReg[1]); + temp[0] = get_temp_reg(fp); /* temp = src0 - src1 * dest.c = (temp.c < 0.0) ? 0 : 1 */ - emit_arith(rp, PFS_OP_MAD, temp[0], mask, + emit_arith(fp, PFS_OP_MAD, temp[0], mask, src[0], pfs_one, negate(src[1]), 0); - emit_arith(rp, PFS_OP_CMP, dest, mask, + emit_arith(fp, PFS_OP_CMP, dest, mask, pfs_one, pfs_zero, temp[0], 0); - free_temp(rp, temp[0]); + free_temp(fp, temp[0]); break; case OPCODE_SIN: /* @@ -1873,85 +1873,85 @@ static GLboolean parse_program(struct r300_fragment_program *rp) * itself squared. */ - temp[0] = get_temp_reg(rp); - const_sin[0] = emit_const4fv(rp, SinCosConsts[0]); - const_sin[1] = emit_const4fv(rp, SinCosConsts[1]); - src[0] = t_scalar_src(rp, fpi->SrcReg[0]); + temp[0] = get_temp_reg(fp); + const_sin[0] = emit_const4fv(fp, SinCosConsts[0]); + const_sin[1] = emit_const4fv(fp, SinCosConsts[1]); + src[0] = t_scalar_src(fp, fpi->SrcReg[0]); /* do range reduction */ - emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_X, + emit_arith(fp, PFS_OP_MAD, temp[0], WRITEMASK_X, swizzle(keep(src[0]), X, X, X, X), swizzle(const_sin[1], Z, Z, Z, Z), pfs_half, 0); - emit_arith(rp, PFS_OP_FRC, temp[0], WRITEMASK_X, + emit_arith(fp, PFS_OP_FRC, temp[0], WRITEMASK_X, swizzle(temp[0], X, X, X, X), undef, undef, 0); - emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_Z, swizzle(temp[0], X, X, X, X), swizzle(const_sin[1], W, W, W, W), //2*PI + emit_arith(fp, PFS_OP_MAD, temp[0], WRITEMASK_Z, swizzle(temp[0], X, X, X, X), swizzle(const_sin[1], W, W, W, W), //2*PI negate(swizzle(const_sin[0], Z, Z, Z, Z)), //PI 0); /* SIN */ - emit_arith(rp, PFS_OP_MAD, temp[0], + emit_arith(fp, PFS_OP_MAD, temp[0], WRITEMASK_X | WRITEMASK_Y, swizzle(temp[0], Z, Z, Z, Z), const_sin[0], pfs_zero, 0); - emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_X, + emit_arith(fp, PFS_OP_MAD, temp[0], WRITEMASK_X, swizzle(temp[0], Y, Y, Y, Y), absolute(swizzle(temp[0], Z, Z, Z, Z)), swizzle(temp[0], X, X, X, X), 0); - emit_arith(rp, PFS_OP_MAD, temp[0], WRITEMASK_Y, + emit_arith(fp, PFS_OP_MAD, temp[0], WRITEMASK_Y, swizzle(temp[0], X, X, X, X), absolute(swizzle(temp[0], X, X, X, X)), negate(swizzle(temp[0], X, X, X, X)), 0); - emit_arith(rp, PFS_OP_MAD, dest, mask, + emit_arith(fp, PFS_OP_MAD, dest, mask, swizzle(temp[0], Y, Y, Y, Y), swizzle(const_sin[0], W, W, W, W), swizzle(temp[0], X, X, X, X), flags); - free_temp(rp, temp[0]); + free_temp(fp, temp[0]); break; case OPCODE_SLT: - src[0] = t_src(rp, fpi->SrcReg[0]); - src[1] = t_src(rp, fpi->SrcReg[1]); - temp[0] = get_temp_reg(rp); + src[0] = t_src(fp, fpi->SrcReg[0]); + src[1] = t_src(fp, fpi->SrcReg[1]); + temp[0] = get_temp_reg(fp); /* temp = src0 - src1 * dest.c = (temp.c < 0.0) ? 1 : 0 */ - emit_arith(rp, PFS_OP_MAD, temp[0], mask, + emit_arith(fp, PFS_OP_MAD, temp[0], mask, src[0], pfs_one, negate(src[1]), 0); - emit_arith(rp, PFS_OP_CMP, dest, mask, + emit_arith(fp, PFS_OP_CMP, dest, mask, pfs_zero, pfs_one, temp[0], 0); - free_temp(rp, temp[0]); + free_temp(fp, temp[0]); break; case OPCODE_SUB: - src[0] = t_src(rp, fpi->SrcReg[0]); - src[1] = t_src(rp, fpi->SrcReg[1]); - emit_arith(rp, PFS_OP_MAD, dest, mask, + src[0] = t_src(fp, fpi->SrcReg[0]); + src[1] = t_src(fp, fpi->SrcReg[1]); + emit_arith(fp, PFS_OP_MAD, dest, mask, src[0], pfs_one, negate(src[1]), flags); break; case OPCODE_TEX: - emit_tex(rp, fpi, R300_FPITX_OP_TEX); + emit_tex(fp, fpi, R300_FPITX_OP_TEX); break; case OPCODE_TXB: - emit_tex(rp, fpi, R300_FPITX_OP_TXB); + emit_tex(fp, fpi, R300_FPITX_OP_TXB); break; case OPCODE_TXP: - emit_tex(rp, fpi, R300_FPITX_OP_TXP); + emit_tex(fp, fpi, R300_FPITX_OP_TXP); break; case OPCODE_XPD:{ - src[0] = t_src(rp, fpi->SrcReg[0]); - src[1] = t_src(rp, fpi->SrcReg[1]); - temp[0] = get_temp_reg(rp); + src[0] = t_src(fp, fpi->SrcReg[0]); + src[1] = t_src(fp, fpi->SrcReg[1]); + temp[0] = get_temp_reg(fp); /* temp = src0.zxy * src1.yzx */ - emit_arith(rp, PFS_OP_MAD, temp[0], + emit_arith(fp, PFS_OP_MAD, temp[0], WRITEMASK_XYZ, swizzle(keep(src[0]), Z, X, Y, W), swizzle(keep(src[1]), Y, Z, X, W), @@ -1959,14 +1959,14 @@ static GLboolean parse_program(struct r300_fragment_program *rp) /* dest.xyz = src0.yzx * src1.zxy - temp * dest.w = undefined * */ - emit_arith(rp, PFS_OP_MAD, dest, + emit_arith(fp, PFS_OP_MAD, dest, mask & WRITEMASK_XYZ, swizzle(src[0], Y, Z, X, W), swizzle(src[1], Z, X, Y, W), negate(temp[0]), flags); /* cleanup */ - free_temp(rp, temp[0]); + free_temp(fp, temp[0]); break; } default: @@ -1974,7 +1974,7 @@ static GLboolean parse_program(struct r300_fragment_program *rp) break; } - if (rp->error) + if (fp->error) return GL_FALSE; } @@ -2077,30 +2077,30 @@ static void insert_wpos(struct gl_program *prog) /* - Init structures * - Determine what hwregs each input corresponds to */ -static void init_program(r300ContextPtr r300, struct r300_fragment_program *rp) +static void init_program(r300ContextPtr r300, struct r300_fragment_program *fp) { struct r300_pfs_compile_state *cs = NULL; - struct gl_fragment_program *mp = &rp->mesa_program; + struct gl_fragment_program *mp = &fp->mesa_program; struct prog_instruction *fpi; GLuint InputsRead = mp->Base.InputsRead; - GLuint temps_used = 0; /* for rp->temps[] */ + GLuint temps_used = 0; /* for fp->temps[] */ int i, j; /* New compile, reset tracking data */ - rp->optimization = + fp->optimization = driQueryOptioni(&r300->radeon.optionCache, "fp_optimization"); - rp->translated = GL_FALSE; - rp->error = GL_FALSE; - rp->cs = cs = &(R300_CONTEXT(rp->ctx)->state.pfs_compile); - rp->tex.length = 0; - rp->cur_node = 0; - rp->first_node_has_tex = 0; - rp->const_nr = 0; - rp->max_temp_idx = 0; - rp->node[0].alu_end = -1; - rp->node[0].tex_end = -1; - - _mesa_memset(cs, 0, sizeof(*rp->cs)); + fp->translated = GL_FALSE; + fp->error = GL_FALSE; + fp->cs = cs = &(R300_CONTEXT(fp->ctx)->state.pfs_compile); + fp->tex.length = 0; + fp->cur_node = 0; + fp->first_node_has_tex = 0; + fp->const_nr = 0; + fp->max_temp_idx = 0; + fp->node[0].alu_end = -1; + fp->node[0].tex_end = -1; + + _mesa_memset(cs, 0, sizeof(*fp->cs)); for (i = 0; i < PFS_MAX_ALU_INST; i++) { for (j = 0; j < 3; j++) { cs->slot[i].vsrc[j] = SRC_CONST; @@ -2117,11 +2117,11 @@ static void init_program(r300ContextPtr r300, struct r300_fragment_program *rp) */ /* Texcoords come first */ - for (i = 0; i < rp->ctx->Const.MaxTextureUnits; i++) { + for (i = 0; i < fp->ctx->Const.MaxTextureUnits; i++) { if (InputsRead & (FRAG_BIT_TEX0 << i)) { cs->inputs[FRAG_ATTRIB_TEX0 + i].refcount = 0; cs->inputs[FRAG_ATTRIB_TEX0 + i].reg = - get_hw_temp(rp, 0); + get_hw_temp(fp, 0); } } InputsRead &= ~FRAG_BITS_TEX_ANY; @@ -2129,7 +2129,7 @@ static void init_program(r300ContextPtr r300, struct r300_fragment_program *rp) /* fragment position treated as a texcoord */ if (InputsRead & FRAG_BIT_WPOS) { cs->inputs[FRAG_ATTRIB_WPOS].refcount = 0; - cs->inputs[FRAG_ATTRIB_WPOS].reg = get_hw_temp(rp, 0); + cs->inputs[FRAG_ATTRIB_WPOS].reg = get_hw_temp(fp, 0); insert_wpos(&mp->Base); } InputsRead &= ~FRAG_BIT_WPOS; @@ -2137,14 +2137,14 @@ static void init_program(r300ContextPtr r300, struct r300_fragment_program *rp) /* Then primary colour */ if (InputsRead & FRAG_BIT_COL0) { cs->inputs[FRAG_ATTRIB_COL0].refcount = 0; - cs->inputs[FRAG_ATTRIB_COL0].reg = get_hw_temp(rp, 0); + cs->inputs[FRAG_ATTRIB_COL0].reg = get_hw_temp(fp, 0); } InputsRead &= ~FRAG_BIT_COL0; /* Secondary color */ if (InputsRead & FRAG_BIT_COL1) { cs->inputs[FRAG_ATTRIB_COL1].refcount = 0; - cs->inputs[FRAG_ATTRIB_COL1].reg = get_hw_temp(rp, 0); + cs->inputs[FRAG_ATTRIB_COL1].reg = get_hw_temp(fp, 0); } InputsRead &= ~FRAG_BIT_COL1; @@ -2200,53 +2200,53 @@ static void init_program(r300ContextPtr r300, struct r300_fragment_program *rp) cs->temp_in_use = temps_used; } -static void update_params(struct r300_fragment_program *rp) +static void update_params(struct r300_fragment_program *fp) { - struct gl_fragment_program *mp = &rp->mesa_program; + struct gl_fragment_program *mp = &fp->mesa_program; /* Ask Mesa nicely to fill in ParameterValues for us */ if (mp->Base.Parameters) - _mesa_load_state_parameters(rp->ctx, mp->Base.Parameters); + _mesa_load_state_parameters(fp->ctx, mp->Base.Parameters); } void r300TranslateFragmentShader(r300ContextPtr r300, - struct r300_fragment_program *rp) + struct r300_fragment_program *fp) { struct r300_pfs_compile_state *cs = NULL; - if (!rp->translated) { + if (!fp->translated) { - init_program(r300, rp); - cs = rp->cs; + init_program(r300, fp); + cs = fp->cs; - if (parse_program(rp) == GL_FALSE) { - dump_program(rp); + if (parse_program(fp) == GL_FALSE) { + dump_program(fp); return; } /* Finish off */ - rp->node[rp->cur_node].alu_end = - cs->nrslots - rp->node[rp->cur_node].alu_offset - 1; - if (rp->node[rp->cur_node].tex_end < 0) - rp->node[rp->cur_node].tex_end = 0; - rp->alu_offset = 0; - rp->alu_end = cs->nrslots - 1; - rp->tex_offset = 0; - rp->tex_end = rp->tex.length ? rp->tex.length - 1 : 0; - assert(rp->node[rp->cur_node].alu_end >= 0); - assert(rp->alu_end >= 0); - - rp->translated = GL_TRUE; + fp->node[fp->cur_node].alu_end = + cs->nrslots - fp->node[fp->cur_node].alu_offset - 1; + if (fp->node[fp->cur_node].tex_end < 0) + fp->node[fp->cur_node].tex_end = 0; + fp->alu_offset = 0; + fp->alu_end = cs->nrslots - 1; + fp->tex_offset = 0; + fp->tex_end = fp->tex.length ? fp->tex.length - 1 : 0; + assert(fp->node[fp->cur_node].alu_end >= 0); + assert(fp->alu_end >= 0); + + fp->translated = GL_TRUE; if (RADEON_DEBUG & DEBUG_PIXEL) - dump_program(rp); - r300UpdateStateParameters(rp->ctx, _NEW_PROGRAM); + dump_program(fp); + r300UpdateStateParameters(fp->ctx, _NEW_PROGRAM); } - update_params(rp); + update_params(fp); } /* just some random things... */ -static void dump_program(struct r300_fragment_program *rp) +static void dump_program(struct r300_fragment_program *fp) { int n, i, j; static int pc = 0; @@ -2255,27 +2255,27 @@ static void dump_program(struct r300_fragment_program *rp) fprintf(stderr, "Mesa program:\n"); fprintf(stderr, "-------------\n"); - _mesa_print_program(&rp->mesa_program.Base); + _mesa_print_program(&fp->mesa_program.Base); fflush(stdout); fprintf(stderr, "Hardware program\n"); fprintf(stderr, "----------------\n"); - for (n = 0; n < (rp->cur_node + 1); n++) { + for (n = 0; n < (fp->cur_node + 1); n++) { fprintf(stderr, "NODE %d: alu_offset: %d, tex_offset: %d, " "alu_end: %d, tex_end: %d\n", n, - rp->node[n].alu_offset, - rp->node[n].tex_offset, - rp->node[n].alu_end, rp->node[n].tex_end); + fp->node[n].alu_offset, + fp->node[n].tex_offset, + fp->node[n].alu_end, fp->node[n].tex_end); - if (rp->tex.length) { + if (fp->tex.length) { fprintf(stderr, " TEX:\n"); - for (i = rp->node[n].tex_offset; - i <= rp->node[n].tex_offset + rp->node[n].tex_end; + for (i = fp->node[n].tex_offset; + i <= fp->node[n].tex_offset + fp->node[n].tex_end; ++i) { const char *instr; - switch ((rp->tex. + switch ((fp->tex. inst[i] >> R300_FPITX_OPCODE_SHIFT) & 15) { case R300_FPITX_OP_TEX: @@ -2297,22 +2297,22 @@ static void dump_program(struct r300_fragment_program *rp) fprintf(stderr, " %s t%i, %c%i, texture[%i] (%08x)\n", instr, - (rp->tex. + (fp->tex. inst[i] >> R300_FPITX_DST_SHIFT) & 31, - (rp->tex. + (fp->tex. inst[i] & R300_FPITX_SRC_CONST) ? 'c' : 't', - (rp->tex. + (fp->tex. inst[i] >> R300_FPITX_SRC_SHIFT) & 31, - (rp->tex. + (fp->tex. inst[i] & R300_FPITX_IMAGE_MASK) >> R300_FPITX_IMAGE_SHIFT, - rp->tex.inst[i]); + fp->tex.inst[i]); } } - for (i = rp->node[n].alu_offset; - i <= rp->node[n].alu_offset + rp->node[n].alu_end; ++i) { + for (i = fp->node[n].alu_offset; + i <= fp->node[n].alu_offset + fp->node[n].alu_end; ++i) { char srcc[3][10], dstc[20]; char srca[3][10], dsta[20]; char argc[3][20]; @@ -2320,8 +2320,8 @@ static void dump_program(struct r300_fragment_program *rp) char flags[5], tmp[10]; for (j = 0; j < 3; ++j) { - int regc = rp->alu.inst[i].inst1 >> (j * 6); - int rega = rp->alu.inst[i].inst3 >> (j * 6); + int regc = fp->alu.inst[i].inst1 >> (j * 6); + int rega = fp->alu.inst[i].inst3 >> (j * 6); sprintf(srcc[j], "%c%i", (regc & 32) ? 'c' : 't', regc & 31); @@ -2331,46 +2331,46 @@ static void dump_program(struct r300_fragment_program *rp) dstc[0] = 0; sprintf(flags, "%s%s%s", - (rp->alu.inst[i]. + (fp->alu.inst[i]. inst1 & R300_FPI1_DSTC_REG_X) ? "x" : "", - (rp->alu.inst[i]. + (fp->alu.inst[i]. inst1 & R300_FPI1_DSTC_REG_Y) ? "y" : "", - (rp->alu.inst[i]. + (fp->alu.inst[i]. inst1 & R300_FPI1_DSTC_REG_Z) ? "z" : ""); if (flags[0] != 0) { sprintf(dstc, "t%i.%s ", - (rp->alu.inst[i]. + (fp->alu.inst[i]. inst1 >> R300_FPI1_DSTC_SHIFT) & 31, flags); } sprintf(flags, "%s%s%s", - (rp->alu.inst[i]. + (fp->alu.inst[i]. inst1 & R300_FPI1_DSTC_OUTPUT_X) ? "x" : "", - (rp->alu.inst[i]. + (fp->alu.inst[i]. inst1 & R300_FPI1_DSTC_OUTPUT_Y) ? "y" : "", - (rp->alu.inst[i]. + (fp->alu.inst[i]. inst1 & R300_FPI1_DSTC_OUTPUT_Z) ? "z" : ""); if (flags[0] != 0) { sprintf(tmp, "o%i.%s", - (rp->alu.inst[i]. + (fp->alu.inst[i]. inst1 >> R300_FPI1_DSTC_SHIFT) & 31, flags); strcat(dstc, tmp); } dsta[0] = 0; - if (rp->alu.inst[i].inst3 & R300_FPI3_DSTA_REG) { + if (fp->alu.inst[i].inst3 & R300_FPI3_DSTA_REG) { sprintf(dsta, "t%i.w ", - (rp->alu.inst[i]. + (fp->alu.inst[i]. inst3 >> R300_FPI3_DSTA_SHIFT) & 31); } - if (rp->alu.inst[i].inst3 & R300_FPI3_DSTA_OUTPUT) { + if (fp->alu.inst[i].inst3 & R300_FPI3_DSTA_OUTPUT) { sprintf(tmp, "o%i.w ", - (rp->alu.inst[i]. + (fp->alu.inst[i]. inst3 >> R300_FPI3_DSTA_SHIFT) & 31); strcat(dsta, tmp); } - if (rp->alu.inst[i].inst3 & R300_FPI3_DSTA_DEPTH) { + if (fp->alu.inst[i].inst3 & R300_FPI3_DSTA_DEPTH) { strcat(dsta, "Z"); } @@ -2378,12 +2378,12 @@ static void dump_program(struct r300_fragment_program *rp) "%3i: xyz: %3s %3s %3s -> %-20s (%08x)\n" " w: %3s %3s %3s -> %-20s (%08x)\n", i, srcc[0], srcc[1], srcc[2], dstc, - rp->alu.inst[i].inst1, srca[0], srca[1], - srca[2], dsta, rp->alu.inst[i].inst3); + fp->alu.inst[i].inst1, srca[0], srca[1], + srca[2], dsta, fp->alu.inst[i].inst3); for (j = 0; j < 3; ++j) { - int regc = rp->alu.inst[i].inst0 >> (j * 7); - int rega = rp->alu.inst[i].inst2 >> (j * 7); + int regc = fp->alu.inst[i].inst0 >> (j * 7); + int rega = fp->alu.inst[i].inst2 >> (j * 7); int d; char buf[20]; @@ -2465,8 +2465,8 @@ static void dump_program(struct r300_fragment_program *rp) fprintf(stderr, " xyz: %8s %8s %8s op: %08x\n" " w: %8s %8s %8s op: %08x\n", argc[0], argc[1], argc[2], - rp->alu.inst[i].inst0, arga[0], arga[1], - arga[2], rp->alu.inst[i].inst2); + fp->alu.inst[i].inst0, arga[0], arga[1], + arga[2], fp->alu.inst[i].inst2); } } } diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.h b/src/mesa/drivers/dri/r300/r300_fragprog.h index b92312aef09..72fca778455 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog.h +++ b/src/mesa/drivers/dri/r300/r300_fragprog.h @@ -99,6 +99,6 @@ typedef struct r300_fragment_program_swizzle { struct r300_fragment_program; extern void r300TranslateFragmentShader(r300ContextPtr r300, - struct r300_fragment_program *rp); + struct r300_fragment_program *fp); #endif diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 3b595d98fa6..5689b4ac594 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1287,7 +1287,7 @@ static void r300SetupTextures(GLcontext * ctx) int hw_tmu = 0; int last_hw_tmu = -1; /* -1 translates into no setup costs for fields */ int tmu_mappings[R300_MAX_TEXTURE_UNITS] = { -1, }; - struct r300_fragment_program *rp = (struct r300_fragment_program *) + struct r300_fragment_program *fp = (struct r300_fragment_program *) (char *)ctx->FragmentProgram._Current; R300_STATECHANGE(r300, txe); @@ -1390,20 +1390,20 @@ static void r300SetupTextures(GLcontext * ctx) r300->hw.tex.border_color.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_BORDER_COLOR_0, last_hw_tmu + 1); - if (!rp) /* should only happenen once, just after context is created */ + if (!fp) /* should only happenen once, just after context is created */ return; R300_STATECHANGE(r300, fpt); - for (i = 0; i < rp->tex.length; i++) { + for (i = 0; i < fp->tex.length; i++) { int unit; int opcode; unsigned long val; - unit = rp->tex.inst[i] >> R300_FPITX_IMAGE_SHIFT; + unit = fp->tex.inst[i] >> R300_FPITX_IMAGE_SHIFT; unit &= 15; - val = rp->tex.inst[i]; + val = fp->tex.inst[i]; val &= ~R300_FPITX_IMAGE_MASK; opcode = @@ -1425,7 +1425,7 @@ static void r300SetupTextures(GLcontext * ctx) } r300->hw.fpt.cmd[R300_FPT_CMD_0] = - cmdpacket0(R300_PFS_TEXI_0, rp->tex.length); + cmdpacket0(R300_PFS_TEXI_0, fp->tex.length); if (RADEON_DEBUG & DEBUG_STATE) fprintf(stderr, "TX_ENABLE: %08x last_hw_tmu=%d\n", @@ -1909,24 +1909,24 @@ static unsigned int r300PackFloat24(float f) void r300SetupPixelShader(r300ContextPtr rmesa) { GLcontext *ctx = rmesa->radeon.glCtx; - struct r300_fragment_program *rp = (struct r300_fragment_program *) + struct r300_fragment_program *fp = (struct r300_fragment_program *) (char *)ctx->FragmentProgram._Current; int i, k; - if (!rp) /* should only happenen once, just after context is created */ + if (!fp) /* should only happenen once, just after context is created */ return; - r300TranslateFragmentShader(rmesa, rp); - if (!rp->translated) { + r300TranslateFragmentShader(rmesa, fp); + if (!fp->translated) { fprintf(stderr, "%s: No valid fragment shader, exiting\n", __func__); return; } #define OUTPUT_FIELD(st, reg, field) \ R300_STATECHANGE(rmesa, st); \ - for(i=0;i<=rp->alu_end;i++) \ - rmesa->hw.st.cmd[R300_FPI_INSTR_0+i]=rp->alu.inst[i].field;\ - rmesa->hw.st.cmd[R300_FPI_CMD_0]=cmdpacket0(reg, rp->alu_end+1); + 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); @@ -1936,18 +1936,18 @@ void r300SetupPixelShader(r300ContextPtr rmesa) R300_STATECHANGE(rmesa, fp); /* I just want to say, the way these nodes are stored.. weird.. */ - for (i = 0, k = (4 - (rp->cur_node + 1)); i < 4; i++, k++) { - if (i < (rp->cur_node + 1)) { + 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] = - (rp->node[i]. + (fp->node[i]. alu_offset << R300_PFS_NODE_ALU_OFFSET_SHIFT) - | (rp->node[i]. + | (fp->node[i]. alu_end << R300_PFS_NODE_ALU_END_SHIFT) - | (rp->node[i]. + | (fp->node[i]. tex_offset << R300_PFS_NODE_TEX_OFFSET_SHIFT) - | (rp->node[i]. + | (fp->node[i]. tex_end << R300_PFS_NODE_TEX_END_SHIFT) - | rp->node[i].flags; /* ( (k==3) ? R300_PFS_NODE_LAST_NODE : 0); */ + | fp->node[i].flags; /* ( (k==3) ? R300_PFS_NODE_LAST_NODE : 0); */ } else { rmesa->hw.fp.cmd[R300_FP_NODE0 + (3 - i)] = 0; } @@ -1955,29 +1955,29 @@ void r300SetupPixelShader(r300ContextPtr rmesa) /* PFS_CNTL_0 */ rmesa->hw.fp.cmd[R300_FP_CNTL0] = - rp->cur_node | (rp->first_node_has_tex << 3); + fp->cur_node | (fp->first_node_has_tex << 3); /* PFS_CNTL_1 */ - rmesa->hw.fp.cmd[R300_FP_CNTL1] = rp->max_temp_idx; + rmesa->hw.fp.cmd[R300_FP_CNTL1] = fp->max_temp_idx; /* PFS_CNTL_2 */ rmesa->hw.fp.cmd[R300_FP_CNTL2] = - (rp->alu_offset << R300_PFS_CNTL_ALU_OFFSET_SHIFT) - | (rp->alu_end << R300_PFS_CNTL_ALU_END_SHIFT) - | (rp->tex_offset << R300_PFS_CNTL_TEX_OFFSET_SHIFT) - | (rp->tex_end << R300_PFS_CNTL_TEX_END_SHIFT); + (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); - for (i = 0; i < rp->const_nr; i++) { + for (i = 0; i < fp->const_nr; i++) { rmesa->hw.fpp.cmd[R300_FPP_PARAM_0 + 4 * i + 0] = - r300PackFloat24(rp->constant[i][0]); + r300PackFloat24(fp->constant[i][0]); rmesa->hw.fpp.cmd[R300_FPP_PARAM_0 + 4 * i + 1] = - r300PackFloat24(rp->constant[i][1]); + r300PackFloat24(fp->constant[i][1]); rmesa->hw.fpp.cmd[R300_FPP_PARAM_0 + 4 * i + 2] = - r300PackFloat24(rp->constant[i][2]); + r300PackFloat24(fp->constant[i][2]); rmesa->hw.fpp.cmd[R300_FPP_PARAM_0 + 4 * i + 3] = - r300PackFloat24(rp->constant[i][3]); + r300PackFloat24(fp->constant[i][3]); } rmesa->hw.fpp.cmd[R300_FPP_CMD_0] = - cmdpacket0(R300_PFS_PARAM_0_X, rp->const_nr * 4); + cmdpacket0(R300_PFS_PARAM_0_X, fp->const_nr * 4); } /** -- cgit v1.2.3 From a6aa1f80168a8134286040920d804a8fc86773ce Mon Sep 17 00:00:00 2001 From: Christoph Bill Date: Wed, 9 May 2007 18:24:06 +0000 Subject: r300: Added some Doxygen comments. --- src/mesa/drivers/dri/r300/r300_context.h | 28 ++++++++++------------------ src/mesa/drivers/dri/r300/r300_state.c | 2 +- src/mesa/drivers/dri/r300/r300_tex.c | 2 +- src/mesa/drivers/dri/r300/radeon_context.h | 13 ------------- 4 files changed, 12 insertions(+), 33 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 9bda2409bd0..9f36c4238cd 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -27,10 +27,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* - * Authors: - * Keith Whitwell - * Nicolai Haehnle +/** + * \file + * + * \author Keith Whitwell + * \author Nicolai Haehnle */ #ifndef __R300_CONTEXT_H__ @@ -88,6 +89,9 @@ typedef struct r300_context *r300ContextPtr; #include "r300_vertprog.h" #include "r300_fragprog.h" +/** + * This function takes a float and packs it into a uint32_t + */ static __inline__ uint32_t r300PackFloat32(float fl) { union { @@ -104,7 +108,7 @@ static __inline__ uint32_t r300PackFloat32(float fl) /* Need refcounting on dma buffers: */ struct r300_dma_buffer { - int refcount; /* the number of retained regions in buf */ + int refcount; /**< the number of retained regions in buf */ drmBufPtr buf; int id; }; @@ -831,7 +835,7 @@ struct r300_state { #define R300_FALLBACK_RAST 2 /** - * R300 context structure. + * \brief R300 context structure. */ struct r300_context { struct radeon_context radeon; /* parent class, must be first */ @@ -878,18 +882,6 @@ struct r300_buffer_object { #define R300_CONTEXT(ctx) ((r300ContextPtr)(ctx->DriverCtx)) -static __inline GLuint r300PackColor(GLuint cpp, - GLubyte r, GLubyte g, GLubyte b, GLubyte a) -{ - switch (cpp) { - case 2: - return PACK_COLOR_565(r, g, b); - case 4: - return PACK_COLOR_8888(r, g, b, a); - default: - return 0; - } -} extern void r300DestroyContext(__DRIcontextPrivate * driContextPriv); extern GLboolean r300CreateContext(const __GLcontextModes * glVisual, __DRIcontextPrivate * driContextPriv, diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 5689b4ac594..a173ff298a8 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -78,7 +78,7 @@ static void r300BlendColor(GLcontext * ctx, const GLfloat cf[4]) CLAMPED_FLOAT_TO_UBYTE(color[2], cf[2]); CLAMPED_FLOAT_TO_UBYTE(color[3], cf[3]); - rmesa->hw.blend_color.cmd[1] = r300PackColor(4, color[3], color[0], + rmesa->hw.blend_color.cmd[1] = PACK_COLOR_8888(color[3], color[0], color[1], color[2]); } diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c index e8005163617..71673e857b8 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.c +++ b/src/mesa/drivers/dri/r300/r300_tex.c @@ -249,7 +249,7 @@ static void r300SetTexFilter(r300TexObjPtr t, GLenum minf, GLenum magf) static void r300SetTexBorderColor(r300TexObjPtr t, GLubyte c[4]) { - t->pp_border_color = r300PackColor(4, c[0], c[1], c[2], c[3]); + t->pp_border_color = PACK_COLOR_8888(c[0], c[1], c[2], c[3]); } /** diff --git a/src/mesa/drivers/dri/r300/radeon_context.h b/src/mesa/drivers/dri/r300/radeon_context.h index 07a0c7cbd6d..edcea3bce1e 100644 --- a/src/mesa/drivers/dri/r300/radeon_context.h +++ b/src/mesa/drivers/dri/r300/radeon_context.h @@ -46,19 +46,6 @@ struct radeon_context; typedef struct radeon_context radeonContextRec; typedef struct radeon_context* radeonContextPtr; -static __inline GLuint radeonPackColor(GLuint cpp, - GLubyte r, GLubyte g, GLubyte b, GLubyte a) -{ - switch (cpp) { - case 2: - return PACK_COLOR_565(r, g, b); - case 4: - return PACK_COLOR_8888(a, r, g, b); - default: - return 0; - } -} - #define TEX_0 0x1 #define TEX_1 0x2 #define TEX_2 0x4 -- cgit v1.2.3 From 3c9e5cb0bda24b73b4e02fc1dbe77ac9c6aed426 Mon Sep 17 00:00:00 2001 From: Christoph Bill Date: Wed, 9 May 2007 18:25:12 +0000 Subject: r300: Added a few more Doxygen comments. --- src/mesa/drivers/dri/r300/r300_cmdbuf.h | 9 ++++++--- src/mesa/drivers/dri/r300/r300_fragprog.c | 12 ++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.h b/src/mesa/drivers/dri/r300/r300_cmdbuf.h index 9ef1cdbe622..3c336e1589b 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.h +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.h @@ -27,9 +27,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* - * Authors: - * Nicolai Haehnle +/** + * \file + * + * \author Nicolai Haehnle */ #ifndef __R300_CMDBUF_H__ @@ -50,6 +51,8 @@ extern void r300EmitAOS(r300ContextPtr rmesa, GLuint nr, GLuint offset); /** * Make sure that enough space is available in the command buffer * by flushing if necessary. + * + * \param dwords The number of dwords we need to be free on the command buffer */ static __inline__ void r300EnsureCmdBufSpace(r300ContextPtr r300, int dwords, const char *caller) diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.c b/src/mesa/drivers/dri/r300/r300_fragprog.c index 556e3041ed7..4bc4320f988 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog.c @@ -31,13 +31,13 @@ * Jerome Glisse */ -/*TODO'S +/** + * \todo Depth write, WPOS/FOGC inputs + * + * \todo FogOption * - * - Depth write, WPOS/FOGC inputs - * - FogOption - * - Verify results of opcodes for accuracy, I've only checked them - * in specific cases. - * - and more... + * \todo Verify results of opcodes for accuracy, I've only checked them in + * specific cases. */ #include "glheader.h" -- cgit v1.2.3 From 01fdb34b3933e567a902bbec27c942d510872ca1 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 18:31:04 +0000 Subject: r300; Indent would destroy r300_reg.h, so add *INDENT-OFF*. --- src/mesa/drivers/dri/r300/r300_reg.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h index 8131478e548..e309a48c423 100644 --- a/src/mesa/drivers/dri/r300/r300_reg.h +++ b/src/mesa/drivers/dri/r300/r300_reg.h @@ -26,6 +26,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef _R300_REG_H #define _R300_REG_H +/* *INDENT-OFF* */ + #define R300_MC_INIT_MISC_LAT_TIMER 0x180 # define R300_MC_MISC__MC_CPR_INIT_LAT_SHIFT 0 # define R300_MC_MISC__MC_VF_INIT_LAT_SHIFT 4 @@ -1604,5 +1606,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. */ #define R300_CP_CMD_BITBLT_MULTI 0xC0009B00 +/* *INDENT-ON* */ #endif /* _R300_REG_H */ -- cgit v1.2.3 From ff7a41a159099f92248c6560140d1b947c0e8cc5 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 18:37:46 +0000 Subject: r300: Don't need to include the deprecated r300_program.h in some files. The only file that still requires r300_program.h is r300_ioctl.c; and it should use the new defines in r300_reg.h! --- src/mesa/drivers/dri/r300/r300_render.c | 1 - src/mesa/drivers/dri/r300/r300_state.c | 1 - src/mesa/drivers/dri/r300/r300_vertprog.c | 1 - 3 files changed, 3 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 1dac3142ee6..e459cad65ac 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -67,7 +67,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_ioctl.h" #include "r300_state.h" #include "r300_reg.h" -#include "r300_program.h" #include "r300_tex.h" #include "r300_maos.h" #include "r300_emit.h" diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index a173ff298a8..9f391a27a09 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -58,7 +58,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_ioctl.h" #include "r300_state.h" #include "r300_reg.h" -#include "r300_program.h" #include "r300_emit.h" #include "r300_fragprog.h" #include "r300_tex.h" diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index 8b1143758e8..90f18ad2257 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -39,7 +39,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "tnl/tnl.h" #include "r300_context.h" -#include "r300_program.h" #if SWIZZLE_X != VSF_IN_COMPONENT_X || \ SWIZZLE_Y != VSF_IN_COMPONENT_Y || \ -- cgit v1.2.3 From df747eb354ca71227c9aa8aa10753be11203ca23 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 18:44:56 +0000 Subject: r300: Removed a bit of disabled code. --- src/mesa/drivers/dri/r300/r300_ioctl.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index ace9131b33b..c787b3fd56c 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -326,9 +326,6 @@ static void r300EmitClearState(GLcontext * ctx) e32(VP_ZERO()); e32(0); } - - /*reg_start(0x4500,0); - e32(2560-1); */ } /** -- cgit v1.2.3 From 56c2f7bb42eaeb443e2e273383d1d5974fc89e03 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 19:24:59 +0000 Subject: r300: Removed the dangerous R300_SPAN_DISABLE_LOCKING flag. Enabling R300_SPAN_DISABLE_LOCKING would probably cause more lockups; I think there are a couple of other little bugs in this code, too. It's best to remove it. --- src/mesa/drivers/dri/r300/r300_context.h | 1 - src/mesa/drivers/dri/r300/radeon_span.c | 34 ++++++-------------------------- 2 files changed, 6 insertions(+), 29 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 9f36c4238cd..8dc8f981994 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -871,7 +871,6 @@ struct r300_context { #endif GLboolean texmicrotile; - GLboolean span_dlocking; GLboolean disable_lowimpact_fallback; }; diff --git a/src/mesa/drivers/dri/r300/radeon_span.c b/src/mesa/drivers/dri/r300/radeon_span.c index 5e85733ae66..5003f7cbc87 100644 --- a/src/mesa/drivers/dri/r300/radeon_span.c +++ b/src/mesa/drivers/dri/r300/radeon_span.c @@ -233,32 +233,12 @@ do { \ static void radeonSpanRenderStart(GLcontext * ctx) { radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - - static int first = 1; +#if COMPILE_R300 r300ContextPtr r300 = (r300ContextPtr) rmesa; - - if (first) { - r300->span_dlocking = - getenv("R300_SPAN_DISABLE_LOCKING") ? 1 : 0; - if (r300->span_dlocking == 0) { - fprintf(stderr, - "Try R300_SPAN_DISABLE_LOCKING env var if this hangs.\n"); - fflush(stderr); - } - first = 0; - } - - if (r300->span_dlocking) { - r300Flush(ctx); - LOCK_HARDWARE(rmesa); - radeonWaitForIdleLocked(rmesa); - UNLOCK_HARDWARE(rmesa); - - return; - } - // R300_FIREVERTICES( rmesa ); - // old code has flush - r300Flush(ctx); + R300_FIREVERTICES(r300); +#else + RADEON_FIREVERTICES(rmesa); +#endif LOCK_HARDWARE(rmesa); radeonWaitForIdleLocked(rmesa); } @@ -266,10 +246,8 @@ static void radeonSpanRenderStart(GLcontext * ctx) static void radeonSpanRenderFinish(GLcontext * ctx) { radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - r300ContextPtr r300 = (r300ContextPtr) rmesa; _swrast_flush(ctx); - if (r300->span_dlocking == 0) - UNLOCK_HARDWARE(rmesa); + UNLOCK_HARDWARE(rmesa); } void radeonInitSpanFuncs(GLcontext * ctx) -- cgit v1.2.3 From f4a2b9f83d2b9571a2baea3c430ec15e28ac833c Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 19:30:59 +0000 Subject: r300: I have no idea why this was forced on, but it seems to work fine when restored to the previous behaviour. --- src/mesa/drivers/dri/r300/radeon_span.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/r300/radeon_span.c b/src/mesa/drivers/dri/r300/radeon_span.c index 5003f7cbc87..5f1ff7ade79 100644 --- a/src/mesa/drivers/dri/r300/radeon_span.c +++ b/src/mesa/drivers/dri/r300/radeon_span.c @@ -123,7 +123,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. static GLuint radeon_mba_z32(const driRenderbuffer * drb, GLint x, GLint y) { GLuint pitch = drb->pitch; - if (1 /*|| drb->depthHasSurface */ ) { + if (drb->depthHasSurface) { return 4 * (x + y * pitch); } else { GLuint ba, address = 0; /* a[0..1] = 0 */ @@ -147,7 +147,7 @@ static INLINE GLuint radeon_mba_z16(const driRenderbuffer * drb, GLint x, GLint y) { GLuint pitch = drb->pitch; - if (1 /*|| drb->depthHasSurface */ ) { + if (drb->depthHasSurface) { return 2 * (x + y * pitch); } else { GLuint ba, address = 0; /* a[0] = 0 */ -- cgit v1.2.3 From 6fe41a4c01f4ec9f280f52901554a58aa8b30627 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 20:36:48 +0000 Subject: r300: Further reduced the radeon_span.c diff. --- src/mesa/drivers/dri/r300/radeon_span.c | 43 +++++++++++++++++++++++++- src/mesa/drivers/dri/radeon/radeon_span.c | 51 +++++++++++++++++++++++++++++-- 2 files changed, 91 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/r300/radeon_span.c b/src/mesa/drivers/dri/r300/radeon_span.c index 5f1ff7ade79..eae09d6b35e 100644 --- a/src/mesa/drivers/dri/r300/radeon_span.c +++ b/src/mesa/drivers/dri/r300/radeon_span.c @@ -128,7 +128,11 @@ static GLuint radeon_mba_z32(const driRenderbuffer * drb, GLint x, GLint y) } else { GLuint ba, address = 0; /* a[0..1] = 0 */ +#ifdef COMPILE_R300 ba = (y / 8) * (pitch / 8) + (x / 8); +#else + ba = (y / 16) * (pitch / 16) + (x / 16); +#endif address |= (x & 0x7) << 2; /* a[2..4] = x[0..2] */ address |= (y & 0x3) << 5; /* a[5..6] = y[0..1] */ @@ -182,6 +186,7 @@ radeon_mba_z16(const driRenderbuffer * drb, GLint x, GLint y) * Careful: It looks like the R300 uses ZZZS byte order while the R200 * uses SZZZ for 24 bit depth, 8 bit stencil mode. */ +#ifdef COMPILE_R300 #define WRITE_DEPTH( _x, _y, d ) \ do { \ GLuint offset = radeon_mba_z32( drb, _x + xo, _y + yo ); \ @@ -190,12 +195,28 @@ do { \ tmp |= ((d << 8) & 0xffffff00); \ *(GLuint *)(buf + offset) = tmp; \ } while (0) +#else +#define WRITE_DEPTH( _x, _y, d ) \ +do { \ + GLuint offset = radeon_mba_z32( drb, _x + xo, _y + yo ); \ + GLuint tmp = *(GLuint *)(buf + offset); \ + tmp &= 0xff000000; \ + tmp |= ((d) & 0x00ffffff); \ + *(GLuint *)(buf + offset) = tmp; \ +} while (0) +#endif +#ifdef COMPILE_R300 #define READ_DEPTH( d, _x, _y ) \ do { \ d = (*(GLuint *)(buf + radeon_mba_z32( drb, _x + xo, \ _y + yo )) & 0xffffff00) >> 8; \ }while(0) +#else +#define READ_DEPTH( d, _x, _y ) \ + d = *(GLuint *)(buf + radeon_mba_z32( drb, _x + xo, \ + _y + yo )) & 0x00ffffff; +#endif #define TAG(x) radeon##x##_z24_s8 #include "depthtmp.h" @@ -206,6 +227,7 @@ do { \ /* 24 bit depth, 8 bit stencil depthbuffer functions */ +#ifdef COMPILE_R300 #define WRITE_STENCIL( _x, _y, d ) \ do { \ GLuint offset = radeon_mba_z32( drb, _x + xo, _y + yo ); \ @@ -214,13 +236,32 @@ do { \ tmp |= (d) & 0xff; \ *(GLuint *)(buf + offset) = tmp; \ } while (0) +#else +#define WRITE_STENCIL( _x, _y, d ) \ +do { \ + GLuint offset = radeon_mba_z32( drb, _x + xo, _y + yo ); \ + GLuint tmp = *(GLuint *)(buf + offset); \ + tmp &= 0x00ffffff; \ + tmp |= (((d) & 0xff) << 24); \ + *(GLuint *)(buf + offset) = tmp; \ +} while (0) +#endif +#ifdef COMPILE_R300 #define READ_STENCIL( d, _x, _y ) \ do { \ GLuint offset = radeon_mba_z32( drb, _x + xo, _y + yo ); \ GLuint tmp = *(GLuint *)(buf + offset); \ d = tmp & 0x000000ff; \ } while (0) +#else +#define READ_STENCIL( d, _x, _y ) \ +do { \ + GLuint offset = radeon_mba_z32( drb, _x + xo, _y + yo ); \ + GLuint tmp = *(GLuint *)(buf + offset); \ + d = (tmp & 0xff000000) >> 24; \ +} while (0) +#endif #define TAG(x) radeon##x##_z24_s8 #include "stenciltmp.h" @@ -233,7 +274,7 @@ do { \ static void radeonSpanRenderStart(GLcontext * ctx) { radeonContextPtr rmesa = RADEON_CONTEXT(ctx); -#if COMPILE_R300 +#ifdef COMPILE_R300 r300ContextPtr r300 = (r300ContextPtr) rmesa; R300_FIREVERTICES(r300); #else diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index fd7a8c4fbfc..732a85ecf0b 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -129,7 +129,11 @@ static GLuint radeon_mba_z32(const driRenderbuffer * drb, GLint x, GLint y) } else { GLuint ba, address = 0; /* a[0..1] = 0 */ +#ifdef COMPILE_R300 + ba = (y / 8) * (pitch / 8) + (x / 8); +#else ba = (y / 16) * (pitch / 16) + (x / 16); +#endif address |= (x & 0x7) << 2; /* a[2..4] = x[0..2] */ address |= (y & 0x3) << 5; /* a[5..6] = y[0..1] */ @@ -183,6 +187,16 @@ radeon_mba_z16(const driRenderbuffer * drb, GLint x, GLint y) * Careful: It looks like the R300 uses ZZZS byte order while the R200 * uses SZZZ for 24 bit depth, 8 bit stencil mode. */ +#ifdef COMPILE_R300 +#define WRITE_DEPTH( _x, _y, d ) \ +do { \ + GLuint offset = radeon_mba_z32( drb, _x + xo, _y + yo ); \ + GLuint tmp = *(GLuint *)(buf + offset); \ + tmp &= 0x000000ff; \ + tmp |= ((d << 8) & 0xffffff00); \ + *(GLuint *)(buf + offset) = tmp; \ +} while (0) +#else #define WRITE_DEPTH( _x, _y, d ) \ do { \ GLuint offset = radeon_mba_z32( drb, _x + xo, _y + yo ); \ @@ -191,10 +205,19 @@ do { \ tmp |= ((d) & 0x00ffffff); \ *(GLuint *)(buf + offset) = tmp; \ } while (0) +#endif +#ifdef COMPILE_R300 +#define READ_DEPTH( d, _x, _y ) \ + do { \ + d = (*(GLuint *)(buf + radeon_mba_z32( drb, _x + xo, \ + _y + yo )) & 0xffffff00) >> 8; \ + }while(0) +#else #define READ_DEPTH( d, _x, _y ) \ d = *(GLuint *)(buf + radeon_mba_z32( drb, _x + xo, \ _y + yo )) & 0x00ffffff; +#endif #define TAG(x) radeon##x##_z24_s8 #include "depthtmp.h" @@ -205,6 +228,16 @@ do { \ /* 24 bit depth, 8 bit stencil depthbuffer functions */ +#ifdef COMPILE_R300 +#define WRITE_STENCIL( _x, _y, d ) \ +do { \ + GLuint offset = radeon_mba_z32( drb, _x + xo, _y + yo ); \ + GLuint tmp = *(GLuint *)(buf + offset); \ + tmp &= 0xffffff00; \ + tmp |= (d) & 0xff; \ + *(GLuint *)(buf + offset) = tmp; \ +} while (0) +#else #define WRITE_STENCIL( _x, _y, d ) \ do { \ GLuint offset = radeon_mba_z32( drb, _x + xo, _y + yo ); \ @@ -213,14 +246,23 @@ do { \ tmp |= (((d) & 0xff) << 24); \ *(GLuint *)(buf + offset) = tmp; \ } while (0) +#endif +#ifdef COMPILE_R300 #define READ_STENCIL( d, _x, _y ) \ do { \ GLuint offset = radeon_mba_z32( drb, _x + xo, _y + yo ); \ GLuint tmp = *(GLuint *)(buf + offset); \ - tmp &= 0xff000000; \ - d = tmp >> 24; \ + d = tmp & 0x000000ff; \ +} while (0) +#else +#define READ_STENCIL( d, _x, _y ) \ +do { \ + GLuint offset = radeon_mba_z32( drb, _x + xo, _y + yo ); \ + GLuint tmp = *(GLuint *)(buf + offset); \ + d = (tmp & 0xff000000) >> 24; \ } while (0) +#endif #define TAG(x) radeon##x##_z24_s8 #include "stenciltmp.h" @@ -233,7 +275,12 @@ do { \ static void radeonSpanRenderStart(GLcontext * ctx) { radeonContextPtr rmesa = RADEON_CONTEXT(ctx); +#ifdef COMPILE_R300 + r300ContextPtr r300 = (r300ContextPtr) rmesa; + R300_FIREVERTICES(r300); +#else RADEON_FIREVERTICES(rmesa); +#endif LOCK_HARDWARE(rmesa); radeonWaitForIdleLocked(rmesa); } -- cgit v1.2.3 From a15470606125478ae314e7dc00821e46292ac810 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 20:41:27 +0000 Subject: r300: Indented radeon_span.h --- src/mesa/drivers/dri/r300/radeon_span.h | 2 +- src/mesa/drivers/dri/radeon/radeon_span.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/r300/radeon_span.h b/src/mesa/drivers/dri/r300/radeon_span.h index 8f0823f412b..9abe0864b17 100644 --- a/src/mesa/drivers/dri/r300/radeon_span.h +++ b/src/mesa/drivers/dri/r300/radeon_span.h @@ -45,6 +45,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "drirenderbuffer.h" extern void radeonInitSpanFuncs(GLcontext * ctx); -extern void radeonSetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis); +extern void radeonSetSpanFunctions(driRenderbuffer * rb, const GLvisual * vis); #endif diff --git a/src/mesa/drivers/dri/radeon/radeon_span.h b/src/mesa/drivers/dri/radeon/radeon_span.h index 56bbb5a713e..9abe0864b17 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.h +++ b/src/mesa/drivers/dri/radeon/radeon_span.h @@ -44,7 +44,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "drirenderbuffer.h" -extern void radeonInitSpanFuncs( GLcontext *ctx ); -extern void radeonSetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis); +extern void radeonInitSpanFuncs(GLcontext * ctx); +extern void radeonSetSpanFunctions(driRenderbuffer * rb, const GLvisual * vis); #endif -- cgit v1.2.3 From 88288b614eb89b8995cbc2ece4bbdb25b7adb191 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 20:49:49 +0000 Subject: r300: Renamed the R300 memory manager from "radeon" to "r300"; it's R300 specific. --- src/mesa/drivers/dri/r300/Makefile | 2 +- src/mesa/drivers/dri/r300/r300_context.c | 6 +- src/mesa/drivers/dri/r300/r300_context.h | 2 +- src/mesa/drivers/dri/r300/r300_ioctl.c | 10 +- src/mesa/drivers/dri/r300/r300_maos.c | 6 +- src/mesa/drivers/dri/r300/r300_mem.c | 492 +++++++++++++++++++++++++++++++ src/mesa/drivers/dri/r300/r300_mem.h | 40 +++ src/mesa/drivers/dri/r300/r300_texmem.c | 4 +- src/mesa/drivers/dri/r300/radeon_mm.c | 492 ------------------------------- src/mesa/drivers/dri/r300/radeon_mm.h | 40 --- 10 files changed, 547 insertions(+), 547 deletions(-) create mode 100644 src/mesa/drivers/dri/r300/r300_mem.c create mode 100644 src/mesa/drivers/dri/r300/r300_mem.h delete mode 100644 src/mesa/drivers/dri/r300/radeon_mm.c delete mode 100644 src/mesa/drivers/dri/r300/radeon_mm.h diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile index b0b47be4a24..9b4ba0d7380 100644 --- a/src/mesa/drivers/dri/r300/Makefile +++ b/src/mesa/drivers/dri/r300/Makefile @@ -27,7 +27,7 @@ DRIVER_SOURCES = \ radeon_lock.c \ radeon_span.c \ radeon_state.c \ - radeon_mm.c \ + r300_mem.c \ \ r300_context.c \ r300_ioctl.c \ diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 12308af45fd..4407f8c4b58 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -62,7 +62,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_maos.h" #ifdef USER_BUFFERS -#include "radeon_mm.h" +#include "r300_mem.h" #endif #include "vblank.h" @@ -212,7 +212,7 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, r300InitShaderFuncs(&functions); #ifdef USER_BUFFERS - radeon_mm_init(r300); + r300_mem_init(r300); #endif if (!radeonInitContext(&r300->radeon, &functions, @@ -529,7 +529,7 @@ void r300DestroyContext(__DRIcontextPrivate * driContextPriv) /* the memory manager might be accessed when Mesa frees the shared * state, so don't destroy it earlier */ - radeon_mm_destroy(r300); + r300_mem_destroy(r300); #endif /* free the option cache */ diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 8dc8f981994..8c4ed51af50 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -865,7 +865,7 @@ struct r300_context { GLuint prefer_gart_client_texturing; #ifdef USER_BUFFERS - struct radeon_memory_manager *rmm; + struct r300_memory_manager *rmm; GLvector4f dummy_attrib[_TNL_ATTRIB_MAX]; GLvector4f *temp_attrib[_TNL_ATTRIB_MAX]; #endif diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index c787b3fd56c..1bf19850b79 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -410,7 +410,7 @@ void r300Flush(GLcontext * ctx) } #ifdef USER_BUFFERS -#include "radeon_mm.h" +#include "r300_mem.h" static void r300RefillCurrentDmaRegion(r300ContextPtr rmesa, int size) { @@ -434,14 +434,14 @@ static void r300RefillCurrentDmaRegion(r300ContextPtr rmesa, int size) dmabuf->buf = (void *)1; /* hack */ dmabuf->refcount = 1; - dmabuf->id = radeon_mm_alloc(rmesa, 4, size); + dmabuf->id = r300_mem_alloc(rmesa, 4, size); if (dmabuf->id == 0) { LOCK_HARDWARE(&rmesa->radeon); /* no need to validate */ r300FlushCmdBufLocked(rmesa, __FUNCTION__); radeonWaitForIdleLocked(&rmesa->radeon); - dmabuf->id = radeon_mm_alloc(rmesa, 4, size); + dmabuf->id = r300_mem_alloc(rmesa, 4, size); UNLOCK_HARDWARE(&rmesa->radeon); @@ -453,7 +453,7 @@ static void r300RefillCurrentDmaRegion(r300ContextPtr rmesa, int size) } rmesa->dma.current.buf = dmabuf; - rmesa->dma.current.address = radeon_mm_ptr(rmesa, dmabuf->id); + rmesa->dma.current.address = r300_mem_ptr(rmesa, dmabuf->id); rmesa->dma.current.end = size; rmesa->dma.current.start = 0; rmesa->dma.current.ptr = 0; @@ -472,7 +472,7 @@ void r300ReleaseDmaRegion(r300ContextPtr rmesa, rmesa->dma.flush(rmesa); if (--region->buf->refcount == 0) { - radeon_mm_free(rmesa, region->buf->id); + r300_mem_free(rmesa, region->buf->id); FREE(region->buf); rmesa->dma.nr_released_bufs++; } diff --git a/src/mesa/drivers/dri/r300/r300_maos.c b/src/mesa/drivers/dri/r300/r300_maos.c index 3beeb7b1ab8..54557c8eda3 100644 --- a/src/mesa/drivers/dri/r300/r300_maos.c +++ b/src/mesa/drivers/dri/r300/r300_maos.c @@ -51,7 +51,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_ioctl.h" #ifdef USER_BUFFERS -#include "radeon_mm.h" +#include "r300_mem.h" #endif #if SWIZZLE_X != R300_INPUT_ROUTE_SELECT_X || \ @@ -643,11 +643,11 @@ void r300UseArrays(GLcontext * ctx) int i; if (rmesa->state.elt_dma.buf) - radeon_mm_use(rmesa, rmesa->state.elt_dma.buf->id); + r300_mem_use(rmesa, rmesa->state.elt_dma.buf->id); for (i = 0; i < rmesa->state.aos_count; i++) { if (rmesa->state.aos[i].buf) - radeon_mm_use(rmesa, rmesa->state.aos[i].buf->id); + r300_mem_use(rmesa, rmesa->state.aos[i].buf->id); } } #endif diff --git a/src/mesa/drivers/dri/r300/r300_mem.c b/src/mesa/drivers/dri/r300/r300_mem.c new file mode 100644 index 00000000000..2c1deddb246 --- /dev/null +++ b/src/mesa/drivers/dri/r300/r300_mem.c @@ -0,0 +1,492 @@ +/* + * Copyright (C) 2005 Aapo Tahkola. + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +/* + * Authors: + * Aapo Tahkola + */ +#include + +#include "r300_context.h" +#include "r300_cmdbuf.h" +#include "r300_ioctl.h" +#include "r300_mem.h" +#include "radeon_ioctl.h" + +#ifdef USER_BUFFERS + +static void resize_u_list(r300ContextPtr rmesa) +{ + void *temp; + int nsize; + + temp = rmesa->rmm->u_list; + nsize = rmesa->rmm->u_size * 2; + + rmesa->rmm->u_list = _mesa_malloc(nsize * sizeof(*rmesa->rmm->u_list)); + _mesa_memset(rmesa->rmm->u_list, 0, nsize * sizeof(*rmesa->rmm->u_list)); + + if (temp) { + r300FlushCmdBuf(rmesa, __FUNCTION__); + + _mesa_memcpy(rmesa->rmm->u_list, temp, rmesa->rmm->u_size * sizeof(*rmesa->rmm->u_list)); + _mesa_free(temp); + } + + rmesa->rmm->u_size = nsize; +} + +void r300_mem_init(r300ContextPtr rmesa) +{ + rmesa->rmm = malloc(sizeof(struct r300_memory_manager)); + memset(rmesa->rmm, 0, sizeof(struct r300_memory_manager)); + + rmesa->rmm->u_size = 128; + resize_u_list(rmesa); +} + +void r300_mem_destroy(r300ContextPtr rmesa) +{ + _mesa_free(rmesa->rmm->u_list); + rmesa->rmm->u_list = NULL; + + _mesa_free(rmesa->rmm); + rmesa->rmm = NULL; +} + +void *r300_mem_ptr(r300ContextPtr rmesa, int id) +{ + assert(id <= rmesa->rmm->u_last); + return rmesa->rmm->u_list[id].ptr; +} + +int r300_mem_find(r300ContextPtr rmesa, void *ptr) +{ + int i; + + for (i=1; i < rmesa->rmm->u_size+1; i++) + if(rmesa->rmm->u_list[i].ptr && + ptr >= rmesa->rmm->u_list[i].ptr && + ptr < rmesa->rmm->u_list[i].ptr + rmesa->rmm->u_list[i].size) + break; + + if (i < rmesa->rmm->u_size + 1) + return i; + + fprintf(stderr, "%p failed\n", ptr); + return 0; +} + +//#define MM_DEBUG +int r300_mem_alloc(r300ContextPtr rmesa, int alignment, int size) +{ + drm_radeon_mem_alloc_t alloc; + int offset = 0, ret; + int i, free=-1; + int done_age; + drm_radeon_mem_free_t memfree; + int tries=0; + static int bytes_wasted=0, allocated=0; + + if(size < 4096) + bytes_wasted += 4096 - size; + + allocated += size; + +#if 0 + static int t=0; + if (t != time(NULL)) { + t = time(NULL); + fprintf(stderr, "slots used %d, wasted %d kb, allocated %d\n", rmesa->rmm->u_last, bytes_wasted/1024, allocated/1024); + } +#endif + + memfree.region = RADEON_MEM_REGION_GART; + + again: + + done_age = radeonGetAge((radeonContextPtr)rmesa); + + if (rmesa->rmm->u_last + 1 >= rmesa->rmm->u_size) + resize_u_list(rmesa); + + for (i = rmesa->rmm->u_last + 1; i > 0; i --) { + if (rmesa->rmm->u_list[i].ptr == NULL) { + free = i; + continue; + } + + if (rmesa->rmm->u_list[i].h_pending == 0 && + rmesa->rmm->u_list[i].pending && rmesa->rmm->u_list[i].age <= done_age) { + memfree.region_offset = (char *)rmesa->rmm->u_list[i].ptr - + (char *)rmesa->radeon.radeonScreen->gartTextures.map; + + ret = drmCommandWrite(rmesa->radeon.radeonScreen->driScreen->fd, + DRM_RADEON_FREE, &memfree, sizeof(memfree)); + + if (ret) { + fprintf(stderr, "Failed to free at %p\n", rmesa->rmm->u_list[i].ptr); + fprintf(stderr, "ret = %s\n", strerror(-ret)); + exit(1); + } else { +#ifdef MM_DEBUG + fprintf(stderr, "really freed %d at age %x\n", i, radeonGetAge((radeonContextPtr)rmesa)); +#endif + if (i == rmesa->rmm->u_last) + rmesa->rmm->u_last --; + + if(rmesa->rmm->u_list[i].size < 4096) + bytes_wasted -= 4096 - rmesa->rmm->u_list[i].size; + + allocated -= rmesa->rmm->u_list[i].size; + rmesa->rmm->u_list[i].pending = 0; + rmesa->rmm->u_list[i].ptr = NULL; + + if (rmesa->rmm->u_list[i].fb) { + LOCK_HARDWARE(&(rmesa->radeon)); + ret = mmFreeMem(rmesa->rmm->u_list[i].fb); + UNLOCK_HARDWARE(&(rmesa->radeon)); + + if (ret != 0) + fprintf(stderr, "failed to free!\n"); + rmesa->rmm->u_list[i].fb = NULL; + } + rmesa->rmm->u_list[i].ref_count = 0; + free = i; + } + } + } + rmesa->rmm->u_head = i; + + if (free == -1) { + WARN_ONCE("Ran out of slots!\n"); + //usleep(100); + r300FlushCmdBuf(rmesa, __FUNCTION__); + tries++; + if(tries>100){ + WARN_ONCE("Ran out of slots!\n"); + exit(1); + } + goto again; + } + + alloc.region = RADEON_MEM_REGION_GART; + alloc.alignment = alignment; + alloc.size = size; + alloc.region_offset = &offset; + + ret = drmCommandWriteRead( rmesa->radeon.dri.fd, DRM_RADEON_ALLOC, &alloc, sizeof(alloc)); + if (ret) { +#if 0 + WARN_ONCE("Ran out of mem!\n"); + r300FlushCmdBuf(rmesa, __FUNCTION__); + //usleep(100); + tries2++; + tries = 0; + if(tries2>100){ + WARN_ONCE("Ran out of GART memory!\n"); + exit(1); + } + goto again; +#else + WARN_ONCE("Ran out of GART memory (for %d)!\nPlease consider adjusting GARTSize option.\n", size); + return 0; +#endif + } + + i = free; + + if (i > rmesa->rmm->u_last) + rmesa->rmm->u_last = i; + + rmesa->rmm->u_list[i].ptr = ((GLubyte *)rmesa->radeon.radeonScreen->gartTextures.map) + offset; + rmesa->rmm->u_list[i].size = size; + rmesa->rmm->u_list[i].age = 0; + rmesa->rmm->u_list[i].fb = NULL; + //fprintf(stderr, "alloc %p at id %d\n", rmesa->rmm->u_list[i].ptr, i); + +#ifdef MM_DEBUG + fprintf(stderr, "allocated %d at age %x\n", i, radeonGetAge((radeonContextPtr)rmesa)); +#endif + + return i; +} + +#include "r300_emit.h" +static void emit_lin_cp(r300ContextPtr rmesa, unsigned long dst, unsigned long src, unsigned long size) +{ + int cmd_reserved = 0; + int cmd_written = 0; + drm_radeon_cmd_header_t *cmd = NULL; + int cp_size; + + + while (size > 0){ + cp_size = size; + if(cp_size > /*8190*/4096) + cp_size = /*8190*/4096; + + reg_start(0x146c,1); + e32(0x52cc32fb); + + reg_start(0x15ac,1); + e32(src); + e32(cp_size); + + reg_start(0x1704,0); + e32(0x0); + + reg_start(0x1404,1); + e32(dst); + e32(cp_size); + + reg_start(0x1700,0); + e32(0x0); + + reg_start(0x1640,3); + e32(0x00000000); + e32(0x00001fff); + e32(0x00000000); + e32(0x00001fff); + + start_packet3(RADEON_CP_PACKET3_UNK1B, 2); + e32(0 << 16 | 0); + e32(0 << 16 | 0); + e32(cp_size << 16 | 0x1); + + dst += cp_size; + src += cp_size; + size -= cp_size; + } + + reg_start(R300_RB3D_DSTCACHE_CTLSTAT,0); + e32(R300_RB3D_DSTCACHE_UNKNOWN_0A); + + reg_start(0x342c,0); + e32(0x00000005); + + reg_start(0x1720,0); + e32(0x00010000); +} + +void r300_mem_use(r300ContextPtr rmesa, int id) +{ + uint64_t ull; +#ifdef MM_DEBUG + fprintf(stderr, "%s: %d at age %x\n", __FUNCTION__, id, radeonGetAge((radeonContextPtr)rmesa)); +#endif + drm_r300_cmd_header_t *cmd; + + assert(id <= rmesa->rmm->u_last); + + if(id == 0) + return; + +#if 0 /* FB VBOs. Needs further changes... */ + rmesa->rmm->u_list[id].ref_count ++; + if (rmesa->rmm->u_list[id].ref_count > 100 && rmesa->rmm->u_list[id].fb == NULL && + rmesa->rmm->u_list[id].size != RADEON_BUFFER_SIZE*16 /*&& rmesa->rmm->u_list[id].size > 40*/) { + driTexHeap *heap; + struct mem_block *mb; + + LOCK_HARDWARE(&(rmesa->radeon)); + + heap = rmesa->texture_heaps[0]; + + mb = mmAllocMem(heap->memory_heap, rmesa->rmm->u_list[id].size, heap->alignmentShift, 0); + + UNLOCK_HARDWARE(&(rmesa->radeon)); + + if (mb) { + rmesa->rmm->u_list[id].fb = mb; + + emit_lin_cp(rmesa, rmesa->radeon.radeonScreen->texOffset[0] + rmesa->rmm->u_list[id].fb->ofs, + r300GartOffsetFromVirtual(rmesa, rmesa->rmm->u_list[id].ptr), + rmesa->rmm->u_list[id].size); + } else { + WARN_ONCE("Upload to fb failed, %d, %d\n", rmesa->rmm->u_list[id].size, id); + } + //fprintf(stderr, "Upload to fb! %d, %d\n", rmesa->rmm->u_list[id].ref_count, id); + } + /*if (rmesa->rmm->u_list[id].fb) { + emit_lin_cp(rmesa, rmesa->radeon.radeonScreen->texOffset[0] + rmesa->rmm->u_list[id].fb->ofs, + r300GartOffsetFromVirtual(rmesa, rmesa->rmm->u_list[id].ptr), + rmesa->rmm->u_list[id].size); + }*/ +#endif + + cmd = (drm_r300_cmd_header_t *)r300AllocCmdBuf(rmesa, 2 + sizeof(ull) / 4, __FUNCTION__); + cmd[0].scratch.cmd_type = R300_CMD_SCRATCH; + cmd[0].scratch.reg = R300_MEM_SCRATCH; + cmd[0].scratch.n_bufs = 1; + cmd[0].scratch.flags = 0; + cmd ++; + + ull = (uint64_t)(intptr_t)&rmesa->rmm->u_list[id].age; + _mesa_memcpy(cmd, &ull, sizeof(ull)); + cmd += sizeof(ull) / 4; + + cmd[0].u = /*id*/0; + + LOCK_HARDWARE(&rmesa->radeon); /* Protect from DRM. */ + rmesa->rmm->u_list[id].h_pending ++; + UNLOCK_HARDWARE(&rmesa->radeon); +} + +unsigned long r300_mem_offset(r300ContextPtr rmesa, int id) +{ + unsigned long offset; + + assert(id <= rmesa->rmm->u_last); + + if (rmesa->rmm->u_list[id].fb) { + offset = rmesa->radeon.radeonScreen->texOffset[0] + rmesa->rmm->u_list[id].fb->ofs; + } else { + offset = (char *)rmesa->rmm->u_list[id].ptr - + (char *)rmesa->radeon.radeonScreen->gartTextures.map; + offset += rmesa->radeon.radeonScreen->gart_texture_offset; + } + + return offset; +} + +int r300_mem_on_card(r300ContextPtr rmesa, int id) +{ + assert(id <= rmesa->rmm->u_last); + + if (rmesa->rmm->u_list[id].fb) + return GL_TRUE; + + return GL_FALSE; +} + +void *r300_mem_map(r300ContextPtr rmesa, int id, int access) +{ +#ifdef MM_DEBUG + fprintf(stderr, "%s: %d at age %x\n", __FUNCTION__, id, radeonGetAge((radeonContextPtr)rmesa)); +#endif + void *ptr; + int tries = 0; + + assert(id <= rmesa->rmm->u_last); + + rmesa->rmm->u_list[id].ref_count = 0; + if (rmesa->rmm->u_list[id].fb) { + WARN_ONCE("Mapping fb!\n"); + /* Idle gart only and do upload on unmap */ + //rmesa->rmm->u_list[id].fb = NULL; + + + if(rmesa->rmm->u_list[id].mapped == 1) + WARN_ONCE("buffer %d already mapped\n", id); + + rmesa->rmm->u_list[id].mapped = 1; + ptr = r300_mem_ptr(rmesa, id); + + return ptr; + } + + if (access == R300_MEM_R) { + + if(rmesa->rmm->u_list[id].mapped == 1) + WARN_ONCE("buffer %d already mapped\n", id); + + rmesa->rmm->u_list[id].mapped = 1; + ptr = r300_mem_ptr(rmesa, id); + + return ptr; + } + + + if (rmesa->rmm->u_list[id].h_pending) + r300FlushCmdBuf(rmesa, __FUNCTION__); + + if (rmesa->rmm->u_list[id].h_pending) { + return NULL; + } + + while(rmesa->rmm->u_list[id].age > radeonGetAge((radeonContextPtr)rmesa) && tries++ < 1000) + usleep(10); + + if (tries >= 1000) { + fprintf(stderr, "Idling failed (%x vs %x)\n", + rmesa->rmm->u_list[id].age, radeonGetAge((radeonContextPtr)rmesa)); + return NULL; + } + + if(rmesa->rmm->u_list[id].mapped == 1) + WARN_ONCE("buffer %d already mapped\n", id); + + rmesa->rmm->u_list[id].mapped = 1; + ptr = r300_mem_ptr(rmesa, id); + + return ptr; +} + +void r300_mem_unmap(r300ContextPtr rmesa, int id) +{ +#ifdef MM_DEBUG + fprintf(stderr, "%s: %d at age %x\n", __FUNCTION__, id, radeonGetAge((radeonContextPtr)rmesa)); +#endif + + assert(id <= rmesa->rmm->u_last); + + if(rmesa->rmm->u_list[id].mapped == 0) + WARN_ONCE("buffer %d not mapped\n", id); + + rmesa->rmm->u_list[id].mapped = 0; + + if (rmesa->rmm->u_list[id].fb) + emit_lin_cp(rmesa, rmesa->radeon.radeonScreen->texOffset[0] + rmesa->rmm->u_list[id].fb->ofs, + r300GartOffsetFromVirtual(rmesa, rmesa->rmm->u_list[id].ptr), + rmesa->rmm->u_list[id].size); +} + +void r300_mem_free(r300ContextPtr rmesa, int id) +{ +#ifdef MM_DEBUG + fprintf(stderr, "%s: %d at age %x\n", __FUNCTION__, id, radeonGetAge((radeonContextPtr)rmesa)); +#endif + + assert(id <= rmesa->rmm->u_last); + + if(id == 0) + return; + + if(rmesa->rmm->u_list[id].ptr == NULL){ + WARN_ONCE("Not allocated!\n"); + return ; + } + + if(rmesa->rmm->u_list[id].pending){ + WARN_ONCE("%p already pended!\n", rmesa->rmm->u_list[id].ptr); + return ; + } + + rmesa->rmm->u_list[id].pending = 1; +} +#endif diff --git a/src/mesa/drivers/dri/r300/r300_mem.h b/src/mesa/drivers/dri/r300/r300_mem.h new file mode 100644 index 00000000000..1e99b176383 --- /dev/null +++ b/src/mesa/drivers/dri/r300/r300_mem.h @@ -0,0 +1,40 @@ +#ifndef __R300_MEM_H__ +#define __R300_MEM_H__ + +//#define R300_MEM_PDL 0 +#define R300_MEM_UL 1 + +#define R300_MEM_R 1 +#define R300_MEM_W 2 +#define R300_MEM_RW (R300_MEM_R | R300_MEM_W) + +#define R300_MEM_SCRATCH 2 + +struct r300_memory_manager { + struct { + void *ptr; + uint32_t size; + uint32_t age; + uint32_t h_pending; + int pending; + int mapped; + int ref_count; + struct mem_block *fb; + } *u_list; + int u_head, u_tail, u_size, u_last; + +}; + +extern void r300_mem_init(r300ContextPtr rmesa); +extern void r300_mem_destroy(r300ContextPtr rmesa); +extern void *r300_mem_ptr(r300ContextPtr rmesa, int id); +extern int r300_mem_find(r300ContextPtr rmesa, void *ptr); +extern int r300_mem_alloc(r300ContextPtr rmesa, int alignment, int size); +extern void r300_mem_use(r300ContextPtr rmesa, int id); +extern unsigned long r300_mem_offset(r300ContextPtr rmesa, int id); +extern int r300_mem_on_card(r300ContextPtr rmesa, int id); +extern void *r300_mem_map(r300ContextPtr rmesa, int id, int access); +extern void r300_mem_unmap(r300ContextPtr rmesa, int id); +extern void r300_mem_free(r300ContextPtr rmesa, int id); + +#endif diff --git a/src/mesa/drivers/dri/r300/r300_texmem.c b/src/mesa/drivers/dri/r300/r300_texmem.c index 2c8740bff76..4377b7cdc7b 100644 --- a/src/mesa/drivers/dri/r300/r300_texmem.c +++ b/src/mesa/drivers/dri/r300/r300_texmem.c @@ -56,7 +56,7 @@ SOFTWARE. #include /* for usleep() */ #ifdef USER_BUFFERS -#include "radeon_mm.h" +#include "r300_mem.h" #endif /** @@ -285,7 +285,7 @@ static void r300UploadRectSubImage(r300ContextPtr rmesa, r300EmitWait(rmesa, R300_WAIT_2D); #ifdef USER_BUFFERS - radeon_mm_use(rmesa, region.buf->id); + r300_mem_use(rmesa, region.buf->id); #endif r300ReleaseDmaRegion(rmesa, ®ion, __FUNCTION__); diff --git a/src/mesa/drivers/dri/r300/radeon_mm.c b/src/mesa/drivers/dri/r300/radeon_mm.c deleted file mode 100644 index 1502dac8fc3..00000000000 --- a/src/mesa/drivers/dri/r300/radeon_mm.c +++ /dev/null @@ -1,492 +0,0 @@ -/* - * Copyright (C) 2005 Aapo Tahkola. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/* - * Authors: - * Aapo Tahkola - */ -#include - -#include "r300_context.h" -#include "r300_cmdbuf.h" -#include "r300_ioctl.h" -#include "radeon_mm.h" -#include "radeon_ioctl.h" - -#ifdef USER_BUFFERS - -static void resize_u_list(r300ContextPtr rmesa) -{ - void *temp; - int nsize; - - temp = rmesa->rmm->u_list; - nsize = rmesa->rmm->u_size * 2; - - rmesa->rmm->u_list = _mesa_malloc(nsize * sizeof(*rmesa->rmm->u_list)); - _mesa_memset(rmesa->rmm->u_list, 0, nsize * sizeof(*rmesa->rmm->u_list)); - - if (temp) { - r300FlushCmdBuf(rmesa, __FUNCTION__); - - _mesa_memcpy(rmesa->rmm->u_list, temp, rmesa->rmm->u_size * sizeof(*rmesa->rmm->u_list)); - _mesa_free(temp); - } - - rmesa->rmm->u_size = nsize; -} - -void radeon_mm_init(r300ContextPtr rmesa) -{ - rmesa->rmm = malloc(sizeof(struct radeon_memory_manager)); - memset(rmesa->rmm, 0, sizeof(struct radeon_memory_manager)); - - rmesa->rmm->u_size = 128; - resize_u_list(rmesa); -} - -void radeon_mm_destroy(r300ContextPtr rmesa) -{ - _mesa_free(rmesa->rmm->u_list); - rmesa->rmm->u_list = NULL; - - _mesa_free(rmesa->rmm); - rmesa->rmm = NULL; -} - -void *radeon_mm_ptr(r300ContextPtr rmesa, int id) -{ - assert(id <= rmesa->rmm->u_last); - return rmesa->rmm->u_list[id].ptr; -} - -int radeon_mm_find(r300ContextPtr rmesa, void *ptr) -{ - int i; - - for (i=1; i < rmesa->rmm->u_size+1; i++) - if(rmesa->rmm->u_list[i].ptr && - ptr >= rmesa->rmm->u_list[i].ptr && - ptr < rmesa->rmm->u_list[i].ptr + rmesa->rmm->u_list[i].size) - break; - - if (i < rmesa->rmm->u_size + 1) - return i; - - fprintf(stderr, "%p failed\n", ptr); - return 0; -} - -//#define MM_DEBUG -int radeon_mm_alloc(r300ContextPtr rmesa, int alignment, int size) -{ - drm_radeon_mem_alloc_t alloc; - int offset = 0, ret; - int i, free=-1; - int done_age; - drm_radeon_mem_free_t memfree; - int tries=0; - static int bytes_wasted=0, allocated=0; - - if(size < 4096) - bytes_wasted += 4096 - size; - - allocated += size; - -#if 0 - static int t=0; - if (t != time(NULL)) { - t = time(NULL); - fprintf(stderr, "slots used %d, wasted %d kb, allocated %d\n", rmesa->rmm->u_last, bytes_wasted/1024, allocated/1024); - } -#endif - - memfree.region = RADEON_MEM_REGION_GART; - - again: - - done_age = radeonGetAge((radeonContextPtr)rmesa); - - if (rmesa->rmm->u_last + 1 >= rmesa->rmm->u_size) - resize_u_list(rmesa); - - for (i = rmesa->rmm->u_last + 1; i > 0; i --) { - if (rmesa->rmm->u_list[i].ptr == NULL) { - free = i; - continue; - } - - if (rmesa->rmm->u_list[i].h_pending == 0 && - rmesa->rmm->u_list[i].pending && rmesa->rmm->u_list[i].age <= done_age) { - memfree.region_offset = (char *)rmesa->rmm->u_list[i].ptr - - (char *)rmesa->radeon.radeonScreen->gartTextures.map; - - ret = drmCommandWrite(rmesa->radeon.radeonScreen->driScreen->fd, - DRM_RADEON_FREE, &memfree, sizeof(memfree)); - - if (ret) { - fprintf(stderr, "Failed to free at %p\n", rmesa->rmm->u_list[i].ptr); - fprintf(stderr, "ret = %s\n", strerror(-ret)); - exit(1); - } else { -#ifdef MM_DEBUG - fprintf(stderr, "really freed %d at age %x\n", i, radeonGetAge((radeonContextPtr)rmesa)); -#endif - if (i == rmesa->rmm->u_last) - rmesa->rmm->u_last --; - - if(rmesa->rmm->u_list[i].size < 4096) - bytes_wasted -= 4096 - rmesa->rmm->u_list[i].size; - - allocated -= rmesa->rmm->u_list[i].size; - rmesa->rmm->u_list[i].pending = 0; - rmesa->rmm->u_list[i].ptr = NULL; - - if (rmesa->rmm->u_list[i].fb) { - LOCK_HARDWARE(&(rmesa->radeon)); - ret = mmFreeMem(rmesa->rmm->u_list[i].fb); - UNLOCK_HARDWARE(&(rmesa->radeon)); - - if (ret != 0) - fprintf(stderr, "failed to free!\n"); - rmesa->rmm->u_list[i].fb = NULL; - } - rmesa->rmm->u_list[i].ref_count = 0; - free = i; - } - } - } - rmesa->rmm->u_head = i; - - if (free == -1) { - WARN_ONCE("Ran out of slots!\n"); - //usleep(100); - r300FlushCmdBuf(rmesa, __FUNCTION__); - tries++; - if(tries>100){ - WARN_ONCE("Ran out of slots!\n"); - exit(1); - } - goto again; - } - - alloc.region = RADEON_MEM_REGION_GART; - alloc.alignment = alignment; - alloc.size = size; - alloc.region_offset = &offset; - - ret = drmCommandWriteRead( rmesa->radeon.dri.fd, DRM_RADEON_ALLOC, &alloc, sizeof(alloc)); - if (ret) { -#if 0 - WARN_ONCE("Ran out of mem!\n"); - r300FlushCmdBuf(rmesa, __FUNCTION__); - //usleep(100); - tries2++; - tries = 0; - if(tries2>100){ - WARN_ONCE("Ran out of GART memory!\n"); - exit(1); - } - goto again; -#else - WARN_ONCE("Ran out of GART memory (for %d)!\nPlease consider adjusting GARTSize option.\n", size); - return 0; -#endif - } - - i = free; - - if (i > rmesa->rmm->u_last) - rmesa->rmm->u_last = i; - - rmesa->rmm->u_list[i].ptr = ((GLubyte *)rmesa->radeon.radeonScreen->gartTextures.map) + offset; - rmesa->rmm->u_list[i].size = size; - rmesa->rmm->u_list[i].age = 0; - rmesa->rmm->u_list[i].fb = NULL; - //fprintf(stderr, "alloc %p at id %d\n", rmesa->rmm->u_list[i].ptr, i); - -#ifdef MM_DEBUG - fprintf(stderr, "allocated %d at age %x\n", i, radeonGetAge((radeonContextPtr)rmesa)); -#endif - - return i; -} - -#include "r300_emit.h" -static void emit_lin_cp(r300ContextPtr rmesa, unsigned long dst, unsigned long src, unsigned long size) -{ - int cmd_reserved = 0; - int cmd_written = 0; - drm_radeon_cmd_header_t *cmd = NULL; - int cp_size; - - - while (size > 0){ - cp_size = size; - if(cp_size > /*8190*/4096) - cp_size = /*8190*/4096; - - reg_start(0x146c,1); - e32(0x52cc32fb); - - reg_start(0x15ac,1); - e32(src); - e32(cp_size); - - reg_start(0x1704,0); - e32(0x0); - - reg_start(0x1404,1); - e32(dst); - e32(cp_size); - - reg_start(0x1700,0); - e32(0x0); - - reg_start(0x1640,3); - e32(0x00000000); - e32(0x00001fff); - e32(0x00000000); - e32(0x00001fff); - - start_packet3(RADEON_CP_PACKET3_UNK1B, 2); - e32(0 << 16 | 0); - e32(0 << 16 | 0); - e32(cp_size << 16 | 0x1); - - dst += cp_size; - src += cp_size; - size -= cp_size; - } - - reg_start(R300_RB3D_DSTCACHE_CTLSTAT,0); - e32(R300_RB3D_DSTCACHE_UNKNOWN_0A); - - reg_start(0x342c,0); - e32(0x00000005); - - reg_start(0x1720,0); - e32(0x00010000); -} - -void radeon_mm_use(r300ContextPtr rmesa, int id) -{ - uint64_t ull; -#ifdef MM_DEBUG - fprintf(stderr, "%s: %d at age %x\n", __FUNCTION__, id, radeonGetAge((radeonContextPtr)rmesa)); -#endif - drm_r300_cmd_header_t *cmd; - - assert(id <= rmesa->rmm->u_last); - - if(id == 0) - return; - -#if 0 /* FB VBOs. Needs further changes... */ - rmesa->rmm->u_list[id].ref_count ++; - if (rmesa->rmm->u_list[id].ref_count > 100 && rmesa->rmm->u_list[id].fb == NULL && - rmesa->rmm->u_list[id].size != RADEON_BUFFER_SIZE*16 /*&& rmesa->rmm->u_list[id].size > 40*/) { - driTexHeap *heap; - struct mem_block *mb; - - LOCK_HARDWARE(&(rmesa->radeon)); - - heap = rmesa->texture_heaps[0]; - - mb = mmAllocMem(heap->memory_heap, rmesa->rmm->u_list[id].size, heap->alignmentShift, 0); - - UNLOCK_HARDWARE(&(rmesa->radeon)); - - if (mb) { - rmesa->rmm->u_list[id].fb = mb; - - emit_lin_cp(rmesa, rmesa->radeon.radeonScreen->texOffset[0] + rmesa->rmm->u_list[id].fb->ofs, - r300GartOffsetFromVirtual(rmesa, rmesa->rmm->u_list[id].ptr), - rmesa->rmm->u_list[id].size); - } else { - WARN_ONCE("Upload to fb failed, %d, %d\n", rmesa->rmm->u_list[id].size, id); - } - //fprintf(stderr, "Upload to fb! %d, %d\n", rmesa->rmm->u_list[id].ref_count, id); - } - /*if (rmesa->rmm->u_list[id].fb) { - emit_lin_cp(rmesa, rmesa->radeon.radeonScreen->texOffset[0] + rmesa->rmm->u_list[id].fb->ofs, - r300GartOffsetFromVirtual(rmesa, rmesa->rmm->u_list[id].ptr), - rmesa->rmm->u_list[id].size); - }*/ -#endif - - cmd = (drm_r300_cmd_header_t *)r300AllocCmdBuf(rmesa, 2 + sizeof(ull) / 4, __FUNCTION__); - cmd[0].scratch.cmd_type = R300_CMD_SCRATCH; - cmd[0].scratch.reg = RADEON_MM_SCRATCH; - cmd[0].scratch.n_bufs = 1; - cmd[0].scratch.flags = 0; - cmd ++; - - ull = (uint64_t)(intptr_t)&rmesa->rmm->u_list[id].age; - _mesa_memcpy(cmd, &ull, sizeof(ull)); - cmd += sizeof(ull) / 4; - - cmd[0].u = /*id*/0; - - LOCK_HARDWARE(&rmesa->radeon); /* Protect from DRM. */ - rmesa->rmm->u_list[id].h_pending ++; - UNLOCK_HARDWARE(&rmesa->radeon); -} - -unsigned long radeon_mm_offset(r300ContextPtr rmesa, int id) -{ - unsigned long offset; - - assert(id <= rmesa->rmm->u_last); - - if (rmesa->rmm->u_list[id].fb) { - offset = rmesa->radeon.radeonScreen->texOffset[0] + rmesa->rmm->u_list[id].fb->ofs; - } else { - offset = (char *)rmesa->rmm->u_list[id].ptr - - (char *)rmesa->radeon.radeonScreen->gartTextures.map; - offset += rmesa->radeon.radeonScreen->gart_texture_offset; - } - - return offset; -} - -int radeon_mm_on_card(r300ContextPtr rmesa, int id) -{ - assert(id <= rmesa->rmm->u_last); - - if (rmesa->rmm->u_list[id].fb) - return GL_TRUE; - - return GL_FALSE; -} - -void *radeon_mm_map(r300ContextPtr rmesa, int id, int access) -{ -#ifdef MM_DEBUG - fprintf(stderr, "%s: %d at age %x\n", __FUNCTION__, id, radeonGetAge((radeonContextPtr)rmesa)); -#endif - void *ptr; - int tries = 0; - - assert(id <= rmesa->rmm->u_last); - - rmesa->rmm->u_list[id].ref_count = 0; - if (rmesa->rmm->u_list[id].fb) { - WARN_ONCE("Mapping fb!\n"); - /* Idle gart only and do upload on unmap */ - //rmesa->rmm->u_list[id].fb = NULL; - - - if(rmesa->rmm->u_list[id].mapped == 1) - WARN_ONCE("buffer %d already mapped\n", id); - - rmesa->rmm->u_list[id].mapped = 1; - ptr = radeon_mm_ptr(rmesa, id); - - return ptr; - } - - if (access == RADEON_MM_R) { - - if(rmesa->rmm->u_list[id].mapped == 1) - WARN_ONCE("buffer %d already mapped\n", id); - - rmesa->rmm->u_list[id].mapped = 1; - ptr = radeon_mm_ptr(rmesa, id); - - return ptr; - } - - - if (rmesa->rmm->u_list[id].h_pending) - r300FlushCmdBuf(rmesa, __FUNCTION__); - - if (rmesa->rmm->u_list[id].h_pending) { - return NULL; - } - - while(rmesa->rmm->u_list[id].age > radeonGetAge((radeonContextPtr)rmesa) && tries++ < 1000) - usleep(10); - - if (tries >= 1000) { - fprintf(stderr, "Idling failed (%x vs %x)\n", - rmesa->rmm->u_list[id].age, radeonGetAge((radeonContextPtr)rmesa)); - return NULL; - } - - if(rmesa->rmm->u_list[id].mapped == 1) - WARN_ONCE("buffer %d already mapped\n", id); - - rmesa->rmm->u_list[id].mapped = 1; - ptr = radeon_mm_ptr(rmesa, id); - - return ptr; -} - -void radeon_mm_unmap(r300ContextPtr rmesa, int id) -{ -#ifdef MM_DEBUG - fprintf(stderr, "%s: %d at age %x\n", __FUNCTION__, id, radeonGetAge((radeonContextPtr)rmesa)); -#endif - - assert(id <= rmesa->rmm->u_last); - - if(rmesa->rmm->u_list[id].mapped == 0) - WARN_ONCE("buffer %d not mapped\n", id); - - rmesa->rmm->u_list[id].mapped = 0; - - if (rmesa->rmm->u_list[id].fb) - emit_lin_cp(rmesa, rmesa->radeon.radeonScreen->texOffset[0] + rmesa->rmm->u_list[id].fb->ofs, - r300GartOffsetFromVirtual(rmesa, rmesa->rmm->u_list[id].ptr), - rmesa->rmm->u_list[id].size); -} - -void radeon_mm_free(r300ContextPtr rmesa, int id) -{ -#ifdef MM_DEBUG - fprintf(stderr, "%s: %d at age %x\n", __FUNCTION__, id, radeonGetAge((radeonContextPtr)rmesa)); -#endif - - assert(id <= rmesa->rmm->u_last); - - if(id == 0) - return; - - if(rmesa->rmm->u_list[id].ptr == NULL){ - WARN_ONCE("Not allocated!\n"); - return ; - } - - if(rmesa->rmm->u_list[id].pending){ - WARN_ONCE("%p already pended!\n", rmesa->rmm->u_list[id].ptr); - return ; - } - - rmesa->rmm->u_list[id].pending = 1; -} -#endif diff --git a/src/mesa/drivers/dri/r300/radeon_mm.h b/src/mesa/drivers/dri/r300/radeon_mm.h deleted file mode 100644 index 81f89917e60..00000000000 --- a/src/mesa/drivers/dri/r300/radeon_mm.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef __RADEON_MM_H__ -#define __RADEON_MM_H__ - -//#define RADEON_MM_PDL 0 -#define RADEON_MM_UL 1 - -#define RADEON_MM_R 1 -#define RADEON_MM_W 2 -#define RADEON_MM_RW (RADEON_MM_R | RADEON_MM_W) - -#define RADEON_MM_SCRATCH 2 - -struct radeon_memory_manager { - struct { - void *ptr; - uint32_t size; - uint32_t age; - uint32_t h_pending; - int pending; - int mapped; - int ref_count; - struct mem_block *fb; - } *u_list; - int u_head, u_tail, u_size, u_last; - -}; - -extern void radeon_mm_init(r300ContextPtr rmesa); -extern void radeon_mm_destroy(r300ContextPtr rmesa); -extern void *radeon_mm_ptr(r300ContextPtr rmesa, int id); -extern int radeon_mm_find(r300ContextPtr rmesa, void *ptr); -extern int radeon_mm_alloc(r300ContextPtr rmesa, int alignment, int size); -extern void radeon_mm_use(r300ContextPtr rmesa, int id); -extern unsigned long radeon_mm_offset(r300ContextPtr rmesa, int id); -extern int radeon_mm_on_card(r300ContextPtr rmesa, int id); -extern void *radeon_mm_map(r300ContextPtr rmesa, int id, int access); -extern void radeon_mm_unmap(r300ContextPtr rmesa, int id); -extern void radeon_mm_free(r300ContextPtr rmesa, int id); - -#endif -- cgit v1.2.3 From a9ab36b8f2f650d6af362ed3be5fd2c1fe40e7eb Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 20:52:09 +0000 Subject: r300: radeon_span.h is now common code; radeon_span.c still needs some work. --- src/mesa/drivers/dri/r300/.gitignore | 1 + src/mesa/drivers/dri/r300/Makefile | 3 +- src/mesa/drivers/dri/r300/radeon_span.h | 50 --------------------------------- 3 files changed, 3 insertions(+), 51 deletions(-) delete mode 100644 src/mesa/drivers/dri/r300/radeon_span.h diff --git a/src/mesa/drivers/dri/r300/.gitignore b/src/mesa/drivers/dri/r300/.gitignore index f8118b7c327..3689a6a78e5 100644 --- a/src/mesa/drivers/dri/r300/.gitignore +++ b/src/mesa/drivers/dri/r300/.gitignore @@ -1,3 +1,4 @@ radeon_chipset.h radeon_screen.[ch] +radeon_span.h server diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile index 9b4ba0d7380..9e60f970d67 100644 --- a/src/mesa/drivers/dri/r300/Makefile +++ b/src/mesa/drivers/dri/r300/Makefile @@ -59,7 +59,8 @@ SYMLINKS = \ COMMON_SYMLINKS = \ radeon_chipset.h \ radeon_screen.c \ - radeon_screen.h + radeon_screen.h \ + radeon_span.h ##### TARGETS ##### diff --git a/src/mesa/drivers/dri/r300/radeon_span.h b/src/mesa/drivers/dri/r300/radeon_span.h deleted file mode 100644 index 9abe0864b17..00000000000 --- a/src/mesa/drivers/dri/r300/radeon_span.h +++ /dev/null @@ -1,50 +0,0 @@ -/************************************************************************** - -Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and - VA Linux Systems Inc., Fremont, California. -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. - -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial -portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Gareth Hughes - * Keith Whitwell - * Kevin E. Martin - */ - -#ifndef __RADEON_SPAN_H__ -#define __RADEON_SPAN_H__ - -#include "drirenderbuffer.h" - -extern void radeonInitSpanFuncs(GLcontext * ctx); -extern void radeonSetSpanFunctions(driRenderbuffer * rb, const GLvisual * vis); - -#endif -- cgit v1.2.3 From 4d5d4e1f97bf8d5c55ef817f7a28f920accc151b Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 21:06:28 +0000 Subject: r300: Cleaned up radeon_context.h slightly; mostly Indent. --- src/mesa/drivers/dri/r300/r300_context.h | 1 - src/mesa/drivers/dri/r300/radeon_context.h | 40 +- src/mesa/drivers/dri/r300/radeon_state.h | 2 - src/mesa/drivers/dri/radeon/radeon_context.h | 669 +++++++++++++-------------- 4 files changed, 347 insertions(+), 365 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 8c4ed51af50..bae188397d2 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -46,7 +46,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "macros.h" #include "mtypes.h" #include "colormac.h" -#include "radeon_context.h" #define USER_BUFFERS diff --git a/src/mesa/drivers/dri/r300/radeon_context.h b/src/mesa/drivers/dri/r300/radeon_context.h index edcea3bce1e..2f239417a97 100644 --- a/src/mesa/drivers/dri/r300/radeon_context.h +++ b/src/mesa/drivers/dri/r300/radeon_context.h @@ -1,10 +1,15 @@ -/* +/************************************************************************** + +Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and + VA Linux Systems Inc., Fremont, California. 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. +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 @@ -29,7 +34,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /* * Authors: + * Gareth Hughes * Keith Whitwell + * Kevin E. Martin * Nicolai Haehnle */ @@ -44,7 +51,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. struct radeon_context; typedef struct radeon_context radeonContextRec; -typedef struct radeon_context* radeonContextPtr; +typedef struct radeon_context *radeonContextPtr; #define TEX_0 0x1 #define TEX_1 0x2 @@ -56,17 +63,16 @@ typedef struct radeon_context* radeonContextPtr; #define TEX_7 0x80 #define TEX_ALL 0xff - /* Rasterizing fallbacks */ /* See correponding strings in r200_swtcl.c */ -#define RADEON_FALLBACK_TEXTURE 0x01 -#define RADEON_FALLBACK_DRAW_BUFFER 0x02 -#define RADEON_FALLBACK_STENCIL 0x04 -#define RADEON_FALLBACK_RENDER_MODE 0x08 -#define RADEON_FALLBACK_BLEND_EQ 0x10 -#define RADEON_FALLBACK_BLEND_FUNC 0x20 -#define RADEON_FALLBACK_DISABLE 0x40 -#define RADEON_FALLBACK_BORDER_MODE 0x80 +#define RADEON_FALLBACK_TEXTURE 0x0001 +#define RADEON_FALLBACK_DRAW_BUFFER 0x0002 +#define RADEON_FALLBACK_STENCIL 0x0004 +#define RADEON_FALLBACK_RENDER_MODE 0x0008 +#define RADEON_FALLBACK_BLEND_EQ 0x0010 +#define RADEON_FALLBACK_BLEND_FUNC 0x0020 +#define RADEON_FALLBACK_DISABLE 0x0040 +#define RADEON_FALLBACK_BORDER_MODE 0x0080 #if R200_MERGED extern void radeonFallback(GLcontext * ctx, GLuint bit, GLboolean mode); @@ -103,19 +109,18 @@ extern void radeonTclFallback(GLcontext * ctx, GLuint bit, GLboolean mode); #define TCL_FALLBACK( ctx, bit, mode ) ; #endif - struct radeon_dri_mirror { __DRIcontextPrivate *context; /* DRI context */ __DRIscreenPrivate *screen; /* DRI screen */ /** * DRI drawable bound to this context for drawing. */ - __DRIdrawablePrivate *drawable; + __DRIdrawablePrivate *drawable; /** * DRI drawable bound to this context for reading. */ - __DRIdrawablePrivate *readable; + __DRIdrawablePrivate *readable; drm_context_t hwContext; drm_hw_lock_t *hwLock; @@ -151,7 +156,7 @@ struct radeon_state { * structure. */ struct radeon_context { - GLcontext *glCtx; /* Mesa context */ + GLcontext *glCtx; /* Mesa context */ radeonScreenPtr radeonScreen; /* Screen private DRI data */ /* Fallback state */ @@ -187,7 +192,6 @@ struct radeon_context { GLuint swap_count; GLuint swap_missed_count; - /* Derived state */ struct radeon_state state; @@ -202,7 +206,7 @@ extern void radeonSwapBuffers(__DRIdrawablePrivate * dPriv); extern void radeonCopySubBuffer(__DRIdrawablePrivate * dPriv, int x, int y, int w, int h); extern GLboolean radeonInitContext(radeonContextPtr radeon, - struct dd_function_table* functions, + struct dd_function_table *functions, const __GLcontextModes * glVisual, __DRIcontextPrivate * driContextPriv, void *sharedContextPrivate); @@ -239,4 +243,4 @@ extern int RADEON_DEBUG; #define DEBUG_PIXEL 0x2000 #define DEBUG_MEMORY 0x4000 -#endif /* __RADEON_CONTEXT_H__ */ +#endif /* __RADEON_CONTEXT_H__ */ diff --git a/src/mesa/drivers/dri/r300/radeon_state.h b/src/mesa/drivers/dri/r300/radeon_state.h index c2d041eb4ae..821cb40c7eb 100644 --- a/src/mesa/drivers/dri/r300/radeon_state.h +++ b/src/mesa/drivers/dri/r300/radeon_state.h @@ -31,8 +31,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __RADEON_STATE_H__ #define __RADEON_STATE_H__ -#include "radeon_context.h" - extern void radeonRecalcScissorRects(radeonContextPtr radeon); extern void radeonSetCliprects(radeonContextPtr radeon); extern void radeonUpdateScissor(GLcontext* ctx); diff --git a/src/mesa/drivers/dri/radeon/radeon_context.h b/src/mesa/drivers/dri/radeon/radeon_context.h index 02cea2f4e37..8dedd66f563 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.h +++ b/src/mesa/drivers/dri/radeon/radeon_context.h @@ -1,8 +1,12 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_context.h,v 1.6 2002/12/16 16:18:58 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and VA Linux Systems Inc., Fremont, California. +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. All Rights Reserved. @@ -30,9 +34,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /* * Authors: - * Kevin E. Martin * Gareth Hughes * Keith Whitwell + * Kevin E. Martin + * Nicolai Haehnle */ #ifndef __RADEON_CONTEXT_H__ @@ -54,7 +59,10 @@ typedef struct radeon_context *radeonContextPtr; /* This union is used to avoid warnings/miscompilation with float to uint32_t casts due to strict-aliasing */ -typedef union { GLfloat f; uint32_t ui32; } float_ui32_type; +typedef union { + GLfloat f; + uint32_t ui32; +} float_ui32_type; #include "radeon_lock.h" #include "radeon_screen.h" @@ -62,8 +70,13 @@ typedef union { GLfloat f; uint32_t ui32; } float_ui32_type; #include "math/m_vector.h" -/* Flags for software fallback cases */ -/* See correponding strings in radeon_swtcl.c */ +#define TEX_0 0x1 +#define TEX_1 0x2 +#define TEX_2 0x4 +#define TEX_ALL 0x7 + +/* Rasterizing fallbacks */ +/* See correponding strings in r200_swtcl.c */ #define RADEON_FALLBACK_TEXTURE 0x0001 #define RADEON_FALLBACK_DRAW_BUFFER 0x0002 #define RADEON_FALLBACK_STENCIL 0x0004 @@ -84,46 +97,41 @@ typedef union { GLfloat f; uint32_t ui32; } float_ui32_type; #include "tnl_dd/t_dd_vertex.h" #undef TAG -typedef void (*radeon_tri_func)( radeonContextPtr, +typedef void (*radeon_tri_func) (radeonContextPtr, radeonVertex *, - radeonVertex *, - radeonVertex * ); - -typedef void (*radeon_line_func)( radeonContextPtr, - radeonVertex *, - radeonVertex * ); + radeonVertex *, radeonVertex *); -typedef void (*radeon_point_func)( radeonContextPtr, - radeonVertex * ); +typedef void (*radeon_line_func) (radeonContextPtr, + radeonVertex *, radeonVertex *); +typedef void (*radeon_point_func) (radeonContextPtr, radeonVertex *); struct radeon_colorbuffer_state { - GLuint clear; - int roundEnable; + GLuint clear; + int roundEnable; }; - struct radeon_depthbuffer_state { - GLuint clear; - GLfloat scale; + GLuint clear; + GLfloat scale; }; struct radeon_scissor_state { - drm_clip_rect_t rect; - GLboolean enabled; + drm_clip_rect_t rect; + GLboolean enabled; - GLuint numClipRects; /* Cliprects active */ - GLuint numAllocedClipRects; /* Cliprects available */ - drm_clip_rect_t *pClipRects; + GLuint numClipRects; /* Cliprects active */ + GLuint numAllocedClipRects; /* Cliprects available */ + drm_clip_rect_t *pClipRects; }; struct radeon_stencilbuffer_state { - GLboolean hwBuffer; - GLuint clear; /* rb3d_stencilrefmask value */ + GLboolean hwBuffer; + GLuint clear; /* rb3d_stencilrefmask value */ }; struct radeon_stipple_state { - GLuint mask[32]; + GLuint mask[32]; }; /* used for both tcl_vtx and vc_frmt tex bits (they are identical) */ @@ -133,70 +141,61 @@ struct radeon_stipple_state { #define RADEON_Q_BIT(unit) \ (unit == 0 ? RADEON_CP_VC_FRMT_Q0 : (RADEON_CP_VC_FRMT_Q1 >> 2) << (2 * unit)) -#define TEX_0 0x1 -#define TEX_1 0x2 -#define TEX_2 0x4 -#define TEX_ALL 0x7 - typedef struct radeon_tex_obj radeonTexObj, *radeonTexObjPtr; /* Texture object in locally shared texture space. */ struct radeon_tex_obj { - driTextureObject base; + driTextureObject base; - GLuint bufAddr; /* Offset to start of locally - shared texture block */ + GLuint bufAddr; /* Offset to start of locally + shared texture block */ - GLuint dirty_state; /* Flags (1 per texunit) for - whether or not this texobj - has dirty hardware state - (pp_*) that needs to be - brought into the - texunit. */ + GLuint dirty_state; /* Flags (1 per texunit) for + whether or not this texobj + has dirty hardware state + (pp_*) that needs to be + brought into the + texunit. */ - drm_radeon_tex_image_t image[6][RADEON_MAX_TEXTURE_LEVELS]; - /* Six, for the cube faces */ + drm_radeon_tex_image_t image[6][RADEON_MAX_TEXTURE_LEVELS]; + /* Six, for the cube faces */ - GLuint pp_txfilter; /* hardware register values */ - GLuint pp_txformat; - GLuint pp_txoffset; /* Image location in texmem. - All cube faces follow. */ - GLuint pp_txsize; /* npot only */ - GLuint pp_txpitch; /* npot only */ - GLuint pp_border_color; - GLuint pp_cubic_faces; /* cube face 1,2,3,4 log2 sizes */ + GLuint pp_txfilter; /* hardware register values */ + GLuint pp_txformat; + GLuint pp_txoffset; /* Image location in texmem. + All cube faces follow. */ + GLuint pp_txsize; /* npot only */ + GLuint pp_txpitch; /* npot only */ + GLuint pp_border_color; + GLuint pp_cubic_faces; /* cube face 1,2,3,4 log2 sizes */ - GLboolean border_fallback; + GLboolean border_fallback; - GLuint tile_bits; /* hw texture tile bits used on this texture */ + GLuint tile_bits; /* hw texture tile bits used on this texture */ }; - struct radeon_texture_env_state { - radeonTexObjPtr texobj; - GLenum format; - GLenum envMode; + radeonTexObjPtr texobj; + GLenum format; + GLenum envMode; }; struct radeon_texture_state { - struct radeon_texture_env_state unit[RADEON_MAX_TEXTURE_UNITS]; + struct radeon_texture_env_state unit[RADEON_MAX_TEXTURE_UNITS]; }; - struct radeon_state_atom { - struct radeon_state_atom *next, *prev; - const char *name; /* for debug */ - int cmd_size; /* size in bytes */ - GLuint is_tcl; - int *cmd; /* one or more cmd's */ - int *lastcmd; /* one or more cmd's */ - GLboolean dirty; /* dirty-mark in emit_state_list */ - GLboolean (*check)( GLcontext * ); /* is this state active? */ + struct radeon_state_atom *next, *prev; + const char *name; /* for debug */ + int cmd_size; /* size in bytes */ + GLuint is_tcl; + int *cmd; /* one or more cmd's */ + int *lastcmd; /* one or more cmd's */ + GLboolean dirty; /* dirty-mark in emit_state_list */ + GLboolean(*check) (GLcontext *); /* is this state active? */ }; - - /* Trying to keep these relatively short as the variables are becoming * extravagently long. Drop the driver name prefix off the front of * everything - I think we know which driver we're in by now, and keep the @@ -263,9 +262,9 @@ struct radeon_state_atom { #define TEX_PP_BORDER_COLOR 8 #define TEX_STATE_SIZE 9 -#define TXR_CMD_0 0 /* rectangle textures */ -#define TXR_PP_TEX_SIZE 1 /* 0x1d04, 0x1d0c for NPOT! */ -#define TXR_PP_TEX_PITCH 2 /* 0x1d08, 0x1d10 for NPOT! */ +#define TXR_CMD_0 0 /* rectangle textures */ +#define TXR_PP_TEX_SIZE 1 /* 0x1d04, 0x1d0c for NPOT! */ +#define TXR_PP_TEX_PITCH 2 /* 0x1d08, 0x1d10 for NPOT! */ #define TXR_STATE_SIZE 3 #define CUBE_CMD_0 0 @@ -297,11 +296,11 @@ struct radeon_state_atom { #define TCL_PER_LIGHT_CTL_3 11 #define TCL_STATE_SIZE 12 -#define MTL_CMD_0 0 -#define MTL_EMMISSIVE_RED 1 -#define MTL_EMMISSIVE_GREEN 2 -#define MTL_EMMISSIVE_BLUE 3 -#define MTL_EMMISSIVE_ALPHA 4 +#define MTL_CMD_0 0 +#define MTL_EMMISSIVE_RED 1 +#define MTL_EMMISSIVE_GREEN 2 +#define MTL_EMMISSIVE_BLUE 3 +#define MTL_EMMISSIVE_ALPHA 4 #define MTL_AMBIENT_RED 5 #define MTL_AMBIENT_GREEN 6 #define MTL_AMBIENT_BLUE 7 @@ -365,7 +364,7 @@ struct radeon_state_atom { #define LIT_SPOT_EXPONENT 27 #define LIT_SPOT_CUTOFF 28 #define LIT_SPECULAR_THRESH 29 -#define LIT_RANGE_CUTOFF 30 /* ? */ +#define LIT_RANGE_CUTOFF 30 /* ? */ #define LIT_ATTEN_CONST_INV 31 #define LIT_STATE_SIZE 32 @@ -409,59 +408,54 @@ struct radeon_state_atom { #define SHN_SHININESS 1 #define SHN_STATE_SIZE 2 - - - - struct radeon_hw_state { - /* Head of the linked list of state atoms. */ - struct radeon_state_atom atomlist; - - /* Hardware state, stored as cmdbuf commands: - * -- Need to doublebuffer for - * - eliding noop statechange loops? (except line stipple count) - */ - struct radeon_state_atom ctx; - struct radeon_state_atom set; - struct radeon_state_atom lin; - struct radeon_state_atom msk; - struct radeon_state_atom vpt; - struct radeon_state_atom tcl; - struct radeon_state_atom msc; - struct radeon_state_atom tex[3]; - struct radeon_state_atom cube[3]; - struct radeon_state_atom zbs; - struct radeon_state_atom mtl; - struct radeon_state_atom mat[6]; - struct radeon_state_atom lit[8]; /* includes vec, scl commands */ - struct radeon_state_atom ucp[6]; - struct radeon_state_atom eye; /* eye pos */ - struct radeon_state_atom grd; /* guard band clipping */ - struct radeon_state_atom fog; - struct radeon_state_atom glt; - struct radeon_state_atom txr[3]; /* for NPOT */ - - int max_state_size; /* Number of bytes necessary for a full state emit. */ - GLboolean is_dirty, all_dirty; + /* Head of the linked list of state atoms. */ + struct radeon_state_atom atomlist; + + /* Hardware state, stored as cmdbuf commands: + * -- Need to doublebuffer for + * - eliding noop statechange loops? (except line stipple count) + */ + struct radeon_state_atom ctx; + struct radeon_state_atom set; + struct radeon_state_atom lin; + struct radeon_state_atom msk; + struct radeon_state_atom vpt; + struct radeon_state_atom tcl; + struct radeon_state_atom msc; + struct radeon_state_atom tex[3]; + struct radeon_state_atom cube[3]; + struct radeon_state_atom zbs; + struct radeon_state_atom mtl; + struct radeon_state_atom mat[6]; + struct radeon_state_atom lit[8]; /* includes vec, scl commands */ + struct radeon_state_atom ucp[6]; + struct radeon_state_atom eye; /* eye pos */ + struct radeon_state_atom grd; /* guard band clipping */ + struct radeon_state_atom fog; + struct radeon_state_atom glt; + struct radeon_state_atom txr[3]; /* for NPOT */ + + int max_state_size; /* Number of bytes necessary for a full state emit. */ + GLboolean is_dirty, all_dirty; }; struct radeon_state { - /* Derived state for internal purposes: - */ - struct radeon_colorbuffer_state color; - struct radeon_depthbuffer_state depth; - struct radeon_scissor_state scissor; - struct radeon_stencilbuffer_state stencil; - struct radeon_stipple_state stipple; - struct radeon_texture_state texture; + /* Derived state for internal purposes: + */ + struct radeon_colorbuffer_state color; + struct radeon_depthbuffer_state depth; + struct radeon_scissor_state scissor; + struct radeon_stencilbuffer_state stencil; + struct radeon_stipple_state stipple; + struct radeon_texture_state texture; }; - /* Need refcounting on dma buffers: */ struct radeon_dma_buffer { - int refcount; /* the number of retained regions in buf */ - drmBufPtr buf; + int refcount; /* the number of retained regions in buf */ + drmBufPtr buf; }; #define GET_START(rvb) (rmesa->radeonScreen->gart_buffer_offset + \ @@ -471,139 +465,130 @@ struct radeon_dma_buffer { /* A retained region, eg vertices for indexed vertices. */ struct radeon_dma_region { - struct radeon_dma_buffer *buf; - char *address; /* == buf->address */ - int start, end, ptr; /* offsets from start of buf */ - int aos_start; - int aos_stride; - int aos_size; + struct radeon_dma_buffer *buf; + char *address; /* == buf->address */ + int start, end, ptr; /* offsets from start of buf */ + int aos_start; + int aos_stride; + int aos_size; }; - struct radeon_dma { - /* Active dma region. Allocations for vertices and retained - * regions come from here. Also used for emitting random vertices, - * these may be flushed by calling flush_current(); - */ - struct radeon_dma_region current; - - void (*flush)( radeonContextPtr ); + /* Active dma region. Allocations for vertices and retained + * regions come from here. Also used for emitting random vertices, + * these may be flushed by calling flush_current(); + */ + struct radeon_dma_region current; - char *buf0_address; /* start of buf[0], for index calcs */ - GLuint nr_released_bufs; /* flush after so many buffers released */ + void (*flush) (radeonContextPtr); + + char *buf0_address; /* start of buf[0], for index calcs */ + GLuint nr_released_bufs; /* flush after so many buffers released */ }; struct radeon_dri_mirror { - __DRIcontextPrivate *context; /* DRI context */ - __DRIscreenPrivate *screen; /* DRI screen */ + __DRIcontextPrivate *context; /* DRI context */ + __DRIscreenPrivate *screen; /* DRI screen */ /** * DRI drawable bound to this context for drawing. */ - __DRIdrawablePrivate *drawable; + __DRIdrawablePrivate *drawable; /** * DRI drawable bound to this context for reading. */ - __DRIdrawablePrivate *readable; + __DRIdrawablePrivate *readable; - drm_context_t hwContext; - drm_hw_lock_t *hwLock; - int fd; - int drmMinor; + drm_context_t hwContext; + drm_hw_lock_t *hwLock; + int fd; + int drmMinor; }; - -#define RADEON_CMD_BUF_SZ (8*1024) +#define RADEON_CMD_BUF_SZ (8*1024) struct radeon_store { - GLuint statenr; - GLuint primnr; - char cmd_buf[RADEON_CMD_BUF_SZ]; - int cmd_used; - int elts_start; + GLuint statenr; + GLuint primnr; + char cmd_buf[RADEON_CMD_BUF_SZ]; + int cmd_used; + int elts_start; }; - /* radeon_tcl.c */ struct radeon_tcl_info { - GLuint vertex_format; - GLuint hw_primitive; - - /* Temporary for cases where incoming vertex data is incompatible - * with maos code. - */ - GLvector4f ObjClean; - - struct radeon_dma_region *aos_components[8]; - GLuint nr_aos_components; - - GLuint *Elts; - - struct radeon_dma_region indexed_verts; - struct radeon_dma_region obj; - struct radeon_dma_region rgba; - struct radeon_dma_region spec; - struct radeon_dma_region fog; - struct radeon_dma_region tex[RADEON_MAX_TEXTURE_UNITS]; - struct radeon_dma_region norm; + GLuint vertex_format; + GLuint hw_primitive; + + /* Temporary for cases where incoming vertex data is incompatible + * with maos code. + */ + GLvector4f ObjClean; + + struct radeon_dma_region *aos_components[8]; + GLuint nr_aos_components; + + GLuint *Elts; + + struct radeon_dma_region indexed_verts; + struct radeon_dma_region obj; + struct radeon_dma_region rgba; + struct radeon_dma_region spec; + struct radeon_dma_region fog; + struct radeon_dma_region tex[RADEON_MAX_TEXTURE_UNITS]; + struct radeon_dma_region norm; }; - /* radeon_swtcl.c */ struct radeon_swtcl_info { - GLuint RenderIndex; - GLuint vertex_size; - GLuint vertex_format; + GLuint RenderIndex; + GLuint vertex_size; + GLuint vertex_format; - struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX]; - GLuint vertex_attr_count; + struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX]; + GLuint vertex_attr_count; - GLubyte *verts; + GLubyte *verts; - /* Fallback rasterization functions - */ - radeon_point_func draw_point; - radeon_line_func draw_line; - radeon_tri_func draw_tri; + /* Fallback rasterization functions + */ + radeon_point_func draw_point; + radeon_line_func draw_line; + radeon_tri_func draw_tri; - GLuint hw_primitive; - GLenum render_primitive; - GLuint numverts; + GLuint hw_primitive; + GLenum render_primitive; + GLuint numverts; /** * Offset of the 4UB color data within a hardware (swtcl) vertex. */ - GLuint coloroffset; + GLuint coloroffset; /** * Offset of the 3UB specular color data within a hardware (swtcl) vertex. */ - GLuint specoffset; + GLuint specoffset; - GLboolean needproj; + GLboolean needproj; - struct radeon_dma_region indexed_verts; + struct radeon_dma_region indexed_verts; }; - struct radeon_ioctl { - GLuint vertex_offset; - GLuint vertex_size; + GLuint vertex_offset; + GLuint vertex_size; }; - - #define RADEON_MAX_PRIMS 64 - - struct radeon_prim { - GLuint start; - GLuint end; - GLuint prim; + GLuint start; + GLuint end; + GLuint prim; }; /* A maximum total of 20 elements per vertex: 3 floats for position, 3 @@ -615,145 +600,141 @@ struct radeon_prim { */ #define RADEON_MAX_VERTEX_SIZE 20 - struct radeon_context { - GLcontext *glCtx; /* Mesa context */ - - /* Driver and hardware state management - */ - struct radeon_hw_state hw; - struct radeon_state state; - - /* Texture object bookkeeping - */ - unsigned nr_heaps; - driTexHeap * texture_heaps[ RADEON_NR_TEX_HEAPS ]; - driTextureObject swapped; - int texture_depth; - float initialMaxAnisotropy; - - /* Rasterization and vertex state: - */ - GLuint TclFallback; - GLuint Fallback; - GLuint NewGLState; - DECLARE_RENDERINPUTS(tnl_index_bitset); /* index of bits for last tnl_install_attrs */ - - /* Vertex buffers - */ - struct radeon_ioctl ioctl; - struct radeon_dma dma; - struct radeon_store store; - /* A full state emit as of the first state emit in the main store, in case - * the context is lost. - */ - struct radeon_store backup_store; - - /* Page flipping - */ - GLuint doPageFlip; - - /* Busy waiting - */ - GLuint do_usleeps; - GLuint do_irqs; - GLuint irqsEmitted; - drm_radeon_irq_wait_t iw; - - /* Drawable, cliprect and scissor information - */ - GLuint numClipRects; /* Cliprects for the draw buffer */ - drm_clip_rect_t *pClipRects; - unsigned int lastStamp; - GLboolean lost_context; - GLboolean save_on_next_emit; - radeonScreenPtr radeonScreen; /* Screen private DRI data */ - drm_radeon_sarea_t *sarea; /* Private SAREA data */ - - /* TCL stuff - */ - GLmatrix TexGenMatrix[RADEON_MAX_TEXTURE_UNITS]; - GLboolean recheck_texgen[RADEON_MAX_TEXTURE_UNITS]; - GLboolean TexGenNeedNormals[RADEON_MAX_TEXTURE_UNITS]; - GLuint TexGenEnabled; - GLuint NeedTexMatrix; - GLuint TexMatColSwap; - GLmatrix tmpmat[RADEON_MAX_TEXTURE_UNITS]; - GLuint last_ReallyEnabled; - - /* VBI - */ - GLuint vbl_seq; - GLuint vblank_flags; - - int64_t swap_ust; - int64_t swap_missed_ust; - - GLuint swap_count; - GLuint swap_missed_count; - - - /* radeon_tcl.c - */ - struct radeon_tcl_info tcl; - - /* radeon_swtcl.c - */ - struct radeon_swtcl_info swtcl; - - /* Mirrors of some DRI state - */ - struct radeon_dri_mirror dri; - - /* Configuration cache - */ - driOptionCache optionCache; - - GLboolean using_hyperz; - GLboolean texmicrotile; - - /* Performance counters - */ - GLuint boxes; /* Draw performance boxes */ - GLuint hardwareWentIdle; - GLuint c_clears; - GLuint c_drawWaits; - GLuint c_textureSwaps; - GLuint c_textureBytes; - GLuint c_vertexBuffers; + GLcontext *glCtx; /* Mesa context */ + + /* Driver and hardware state management + */ + struct radeon_hw_state hw; + struct radeon_state state; + + /* Texture object bookkeeping + */ + unsigned nr_heaps; + driTexHeap *texture_heaps[RADEON_NR_TEX_HEAPS]; + driTextureObject swapped; + int texture_depth; + float initialMaxAnisotropy; + + /* Rasterization and vertex state: + */ + GLuint TclFallback; + GLuint Fallback; + GLuint NewGLState; + DECLARE_RENDERINPUTS(tnl_index_bitset); /* index of bits for last tnl_install_attrs */ + + /* Vertex buffers + */ + struct radeon_ioctl ioctl; + struct radeon_dma dma; + struct radeon_store store; + /* A full state emit as of the first state emit in the main store, in case + * the context is lost. + */ + struct radeon_store backup_store; + + /* Page flipping + */ + GLuint doPageFlip; + + /* Busy waiting + */ + GLuint do_usleeps; + GLuint do_irqs; + GLuint irqsEmitted; + drm_radeon_irq_wait_t iw; + + /* Drawable, cliprect and scissor information + */ + GLuint numClipRects; /* Cliprects for the draw buffer */ + drm_clip_rect_t *pClipRects; + unsigned int lastStamp; + GLboolean lost_context; + GLboolean save_on_next_emit; + radeonScreenPtr radeonScreen; /* Screen private DRI data */ + drm_radeon_sarea_t *sarea; /* Private SAREA data */ + + /* TCL stuff + */ + GLmatrix TexGenMatrix[RADEON_MAX_TEXTURE_UNITS]; + GLboolean recheck_texgen[RADEON_MAX_TEXTURE_UNITS]; + GLboolean TexGenNeedNormals[RADEON_MAX_TEXTURE_UNITS]; + GLuint TexGenEnabled; + GLuint NeedTexMatrix; + GLuint TexMatColSwap; + GLmatrix tmpmat[RADEON_MAX_TEXTURE_UNITS]; + GLuint last_ReallyEnabled; + + /* VBI + */ + GLuint vbl_seq; + GLuint vblank_flags; + + int64_t swap_ust; + int64_t swap_missed_ust; + + GLuint swap_count; + GLuint swap_missed_count; + + /* radeon_tcl.c + */ + struct radeon_tcl_info tcl; + + /* radeon_swtcl.c + */ + struct radeon_swtcl_info swtcl; + + /* Mirrors of some DRI state + */ + struct radeon_dri_mirror dri; + + /* Configuration cache + */ + driOptionCache optionCache; + + GLboolean using_hyperz; + GLboolean texmicrotile; + + /* Performance counters + */ + GLuint boxes; /* Draw performance boxes */ + GLuint hardwareWentIdle; + GLuint c_clears; + GLuint c_drawWaits; + GLuint c_textureSwaps; + GLuint c_textureBytes; + GLuint c_vertexBuffers; }; #define RADEON_CONTEXT(ctx) ((radeonContextPtr)(ctx->DriverCtx)) - -static __inline GLuint radeonPackColor( GLuint cpp, - GLubyte r, GLubyte g, - GLubyte b, GLubyte a ) +static __inline GLuint radeonPackColor(GLuint cpp, + GLubyte r, GLubyte g, + GLubyte b, GLubyte a) { - switch ( cpp ) { - case 2: - return PACK_COLOR_565( r, g, b ); - case 4: - return PACK_COLOR_8888( a, r, g, b ); - default: - return 0; - } + switch (cpp) { + case 2: + return PACK_COLOR_565(r, g, b); + case 4: + return PACK_COLOR_8888(a, r, g, b); + default: + return 0; + } } #define RADEON_OLD_PACKETS 1 - -extern void radeonDestroyContext( __DRIcontextPrivate *driContextPriv ); -extern GLboolean radeonCreateContext(const __GLcontextModes *glVisual, - __DRIcontextPrivate *driContextPriv, +extern void radeonDestroyContext(__DRIcontextPrivate * driContextPriv); +extern GLboolean radeonCreateContext(const __GLcontextModes * glVisual, + __DRIcontextPrivate * driContextPriv, void *sharedContextPrivate); -extern void radeonSwapBuffers( __DRIdrawablePrivate *dPriv ); +extern void radeonSwapBuffers(__DRIdrawablePrivate * dPriv); extern void radeonCopySubBuffer(__DRIdrawablePrivate * dPriv, int x, int y, int w, int h); -extern GLboolean radeonMakeCurrent( __DRIcontextPrivate *driContextPriv, - __DRIdrawablePrivate *driDrawPriv, - __DRIdrawablePrivate *driReadPriv ); -extern GLboolean radeonUnbindContext( __DRIcontextPrivate *driContextPriv ); +extern GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv, + __DRIdrawablePrivate * driDrawPriv, + __DRIdrawablePrivate * driReadPriv); +extern GLboolean radeonUnbindContext(__DRIcontextPrivate * driContextPriv); /* ================================================================ * Debugging: @@ -766,18 +747,18 @@ extern int RADEON_DEBUG; #define RADEON_DEBUG 0 #endif -#define DEBUG_TEXTURE 0x001 -#define DEBUG_STATE 0x002 -#define DEBUG_IOCTL 0x004 -#define DEBUG_PRIMS 0x008 -#define DEBUG_VERTS 0x010 -#define DEBUG_FALLBACKS 0x020 -#define DEBUG_VFMT 0x040 -#define DEBUG_CODEGEN 0x080 -#define DEBUG_VERBOSE 0x100 -#define DEBUG_DRI 0x200 -#define DEBUG_DMA 0x400 -#define DEBUG_SANITY 0x800 -#define DEBUG_SYNC 0x1000 - -#endif /* __RADEON_CONTEXT_H__ */ +#define DEBUG_TEXTURE 0x0001 +#define DEBUG_STATE 0x0002 +#define DEBUG_IOCTL 0x0004 +#define DEBUG_PRIMS 0x0008 +#define DEBUG_VERTS 0x0010 +#define DEBUG_FALLBACKS 0x0020 +#define DEBUG_VFMT 0x0040 +#define DEBUG_CODEGEN 0x0080 +#define DEBUG_VERBOSE 0x0100 +#define DEBUG_DRI 0x0200 +#define DEBUG_DMA 0x0400 +#define DEBUG_SANITY 0x0800 +#define DEBUG_SYNC 0x1000 + +#endif /* __RADEON_CONTEXT_H__ */ -- cgit v1.2.3 From 16c503f39a05726f3e994e42cb1c03e0a308b80d Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 9 May 2007 16:22:53 -0600 Subject: Tweak the shell scripting for descending into and building subdirs. In general, use this: @for dir in $(SUBDIRS) ; do \ if [ -d $$dir ] ; then \ (cd $$dir && $(MAKE)) || exit 1; \ fi \ done Basically, silently skip missing subdirs but generate an error and stop if there's a compilation or install problem. This was done inconsistantly before. In once case, a missing subdir was causing us to go into an infinte loop! --- Makefile | 13 ++++++++++--- progs/Makefile | 4 ++-- src/Makefile | 6 +++--- src/mesa/drivers/dri/Makefile | 14 +++++++++----- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 88b6b79979d..4984e4dceb7 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,9 @@ SUBDIRS = src progs default: $(TOP)/configs/current @for dir in $(SUBDIRS) ; do \ - (cd $$dir ; $(MAKE)) || exit 1 ; \ + if [ -d $$dir ] ; then \ + (cd $$dir && $(MAKE)) || exit 1 ; \ + fi \ done @@ -16,7 +18,9 @@ doxygen: clean: @for dir in $(SUBDIRS) ; do \ - (cd $$dir ; $(MAKE) clean) ; \ + if [ -d $$dir ] ; then \ + (cd $$dir && $(MAKE) clean) ; \ + fi \ done @@ -34,9 +38,12 @@ realclean: install: @for dir in $(SUBDIRS) ; do \ - (cd $$dir ; $(MAKE) install) || exit 1 ; \ + if [ -d $$dir ] ; then \ + (cd $$dir && $(MAKE) install) || exit 1 ; \ + fi \ done + # DirectFBGL module installation linux-directfb-install: cd src/mesa/drivers/directfb && $(MAKE) install diff --git a/progs/Makefile b/progs/Makefile index d5ec17d43e5..5e705efa7ee 100644 --- a/progs/Makefile +++ b/progs/Makefile @@ -17,7 +17,7 @@ message: subdirs: @for dir in $(SUBDIRS) ; do \ if [ -d $$dir ] ; then \ - (cd $$dir ; $(MAKE)) || exit 1 ; \ + (cd $$dir && $(MAKE)) || exit 1 ; \ fi \ done @@ -27,6 +27,6 @@ install: clean: @for dir in $(SUBDIRS) tests ; do \ if [ -d $$dir ] ; then \ - (cd $$dir ; $(MAKE) clean) ; \ + (cd $$dir && $(MAKE) clean) ; \ fi \ done diff --git a/src/Makefile b/src/Makefile index f52a06a3c96..f93987e6880 100644 --- a/src/Makefile +++ b/src/Makefile @@ -17,14 +17,14 @@ message: subdirs: @for dir in $(SUBDIRS) ; do \ if [ -d $$dir ] ; then \ - (cd $$dir ; $(MAKE)) || exit 1 ; \ + (cd $$dir && $(MAKE)) || exit 1; \ fi \ done install: @for dir in $(SUBDIRS) ; do \ if [ -d $$dir ] ; then \ - (cd $$dir ; $(MAKE) install) || exit 1 ; \ + (cd $$dir && $(MAKE) install) || exit 1 ; \ fi \ done @@ -35,6 +35,6 @@ $(TOP)/$(LIB_DIR): clean: @for dir in $(SUBDIRS) ; do \ if [ -d $$dir ] ; then \ - (cd $$dir ; $(MAKE) clean) ; \ + (cd $$dir && $(MAKE) clean) ; \ fi \ done diff --git a/src/mesa/drivers/dri/Makefile b/src/mesa/drivers/dri/Makefile index 1db878bab70..4abcc16c1bc 100644 --- a/src/mesa/drivers/dri/Makefile +++ b/src/mesa/drivers/dri/Makefile @@ -14,21 +14,25 @@ $(TOP)/$(LIB_DIR): subdirs: - echo $(DRI_DIRS) @for dir in $(DRI_DIRS) ; do \ - echo $$dir ; \ - (cd $$dir && $(MAKE)) || exit 1; \ + if [ -d $$dir ] ; then \ + (cd $$dir && $(MAKE)) || exit 1 ; \ + fi \ done install: @for dir in $(DRI_DIRS) ; do \ - (cd $$dir && $(MAKE) install) || exit 1; \ + if [ -d $$dir ] ; then \ + (cd $$dir && $(MAKE) install) || exit 1 ; \ + fi \ done clean: @for dir in $(DRI_DIRS) ; do \ - (cd $$dir && $(MAKE) clean) ; \ + if [ -d $$dir ] ; then \ + (cd $$dir && $(MAKE) clean ; \ + fi \ done -rm -f common/*.o -- cgit v1.2.3 From 0dcea4bf8eeddf5d1f3b40c6ba5eedec298b040c Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 21:41:03 +0000 Subject: r300: Converted a few "if (0)" into "if (RADEON_DEBUG & DEBUG_TEXTURE)". --- src/mesa/drivers/dri/r300/r300_tex.c | 4 ++-- src/mesa/drivers/dri/r300/r300_texmem.c | 2 +- src/mesa/drivers/dri/r300/r300_texstate.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c index 71673e857b8..78b6dd24dac 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.c +++ b/src/mesa/drivers/dri/r300/r300_tex.c @@ -510,7 +510,7 @@ r300ValidateClientStorage(GLcontext * ctx, GLenum target, { r300ContextPtr rmesa = R300_CONTEXT(ctx); - if (0) + if (RADEON_DEBUG & DEBUG_TEXTURE) fprintf(stderr, "intformat %s format %s type %s\n", _mesa_lookup_enum_by_nr(internalFormat), _mesa_lookup_enum_by_nr(format), @@ -567,7 +567,7 @@ r300ValidateClientStorage(GLcontext * ctx, GLenum target, GLint srcRowStride = _mesa_image_row_stride(packing, srcWidth, format, type); - if (0) + if (RADEON_DEBUG & DEBUG_TEXTURE) fprintf(stderr, "%s: srcRowStride %d/%x\n", __FUNCTION__, srcRowStride, srcRowStride); diff --git a/src/mesa/drivers/dri/r300/r300_texmem.c b/src/mesa/drivers/dri/r300/r300_texmem.c index 4377b7cdc7b..13178e9973c 100644 --- a/src/mesa/drivers/dri/r300/r300_texmem.c +++ b/src/mesa/drivers/dri/r300/r300_texmem.c @@ -255,7 +255,7 @@ static void r300UploadRectSubImage(r300ContextPtr rmesa, /* Copy texdata to dma: */ - if (0) + if (RADEON_DEBUG & DEBUG_TEXTURE) fprintf(stderr, "%s: src_pitch %d dst_pitch %d\n", __FUNCTION__, src_pitch, dstPitch); diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index d20a61e07ee..7bd7cf22e89 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -296,7 +296,7 @@ static void r300SetTexImages(r300ContextPtr rmesa, } assert(size > 0); - if (0) + if (RADEON_DEBUG & DEBUG_TEXTURE) fprintf(stderr, "w=%d h=%d d=%d tb=%d intFormat=%d\n", texImage->Width, texImage->Height, texImage->Depth, @@ -325,7 +325,7 @@ static void r300SetTexImages(r300ContextPtr rmesa, t->image[0][i].height = size / t->image[0][i].width; } - if (0) + if (RADEON_DEBUG & DEBUG_TEXTURE) fprintf(stderr, "level %d: %dx%d x=%d y=%d w=%d h=%d size=%d at %d\n", i, texImage->Width, texImage->Height, -- cgit v1.2.3 From 672ecba175d4062b983031df15b686ee39f45d17 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 21:44:07 +0000 Subject: r300: Removed the "texmicrotile" variable; the tiling code is disabled via a compiler conditional anyway; probably broken? --- src/mesa/drivers/dri/r300/r300_context.c | 2 -- src/mesa/drivers/dri/r300/r300_context.h | 1 - src/mesa/drivers/dri/r300/r300_texstate.c | 3 +-- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 4407f8c4b58..4ddf0244680 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -200,8 +200,6 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, r300->initialMaxAnisotropy = driQueryOptionf(&r300->radeon.optionCache, "def_max_anisotropy"); - //r300->texmicrotile = GL_TRUE; - /* Init default driver functions then plug in our R300-specific functions * (the texture functions are especially important) */ diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index bae188397d2..8630c9edda5 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -869,7 +869,6 @@ struct r300_context { GLvector4f *temp_attrib[_TNL_ATTRIB_MAX]; #endif - GLboolean texmicrotile; GLboolean disable_lowimpact_fallback; }; diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index 7bd7cf22e89..49231d415f5 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -221,8 +221,7 @@ static void r300SetTexImages(r300ContextPtr rmesa, /* figure out if this texture is suitable for tiling. */ #if 0 /* Disabled for now */ if (texelBytes) { - if (rmesa->texmicrotile - && (tObj->Target != GL_TEXTURE_RECTANGLE_NV) && + if ((tObj->Target != GL_TEXTURE_RECTANGLE_NV) && /* texrect might be able to use micro tiling too in theory? */ (baseImage->Height > 1)) { -- cgit v1.2.3 From d0be8b959adae87b920b185fbe4efe6f981837fd Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 22:03:43 +0000 Subject: r300: Added some more Doxygen documentation and made some functions static. --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 7 +++-- src/mesa/drivers/dri/r300/r300_context.c | 11 +++++--- src/mesa/drivers/dri/r300/r300_context.h | 6 ---- src/mesa/drivers/dri/r300/r300_fragprog.c | 12 ++++---- src/mesa/drivers/dri/r300/r300_ioctl.c | 10 ++++--- src/mesa/drivers/dri/r300/r300_maos.c | 7 +++-- src/mesa/drivers/dri/r300/r300_mem.c | 10 ++++--- src/mesa/drivers/dri/r300/r300_render.c | 46 +++++++++++++++++++------------ src/mesa/drivers/dri/r300/r300_state.c | 7 +++-- src/mesa/drivers/dri/r300/r300_tex.c | 7 +++-- src/mesa/drivers/dri/r300/r300_texmem.c | 9 +++--- src/mesa/drivers/dri/r300/r300_texstate.c | 7 +++-- src/mesa/drivers/dri/r300/r300_vertprog.c | 8 ++++-- 13 files changed, 83 insertions(+), 64 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 369dc0b366b..48f5ea4c562 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -27,9 +27,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* - * Authors: - * Nicolai Haehnle +/** + * \file + * + * \author Nicolai Haehnle */ #include "glheader.h" diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 4ddf0244680..4f70d7055a4 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -27,11 +27,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* - * Authors: - * Keith Whitwell - * Nicolai Haehnle +/** + * \file + * + * \author Keith Whitwell + * + * \author Nicolai Haehnle */ + #include "glheader.h" #include "api_arrayelt.h" #include "context.h" diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 8630c9edda5..c287871b370 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -884,17 +884,11 @@ extern GLboolean r300CreateContext(const __GLcontextModes * glVisual, __DRIcontextPrivate * driContextPriv, void *sharedContextPrivate); -extern int r300NumVerts(r300ContextPtr rmesa, int num_verts, int prim); - extern void r300SelectVertexShader(r300ContextPtr r300); extern void r300InitShaderFuncs(struct dd_function_table *functions); extern int r300VertexProgUpdateParams(GLcontext * ctx, struct r300_vertex_program_cont *vp, float *dst); -extern int r300Fallback(GLcontext * ctx); - -extern GLboolean r300RunRender(GLcontext * ctx, - struct tnl_pipeline_stage *stage); #define RADEON_D_CAPTURE 0 #define RADEON_D_PLAYBACK 1 diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.c b/src/mesa/drivers/dri/r300/r300_fragprog.c index 4bc4320f988..c6fbe3f9aae 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog.c @@ -25,13 +25,13 @@ * */ -/* - * Authors: - * Ben Skeggs - * Jerome Glisse - */ - /** + * \file + * + * \author Ben Skeggs + * + * \author Jerome Glisse + * * \todo Depth write, WPOS/FOGC inputs * * \todo FogOption diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index 1bf19850b79..d2cc97d213e 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -29,10 +29,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* - * Authors: - * Keith Whitwell - * Nicolai Haehnle +/** + * \file + * + * \author Keith Whitwell + * + * \author Nicolai Haehnle */ #include diff --git a/src/mesa/drivers/dri/r300/r300_maos.c b/src/mesa/drivers/dri/r300/r300_maos.c index 54557c8eda3..ec174441e99 100644 --- a/src/mesa/drivers/dri/r300/r300_maos.c +++ b/src/mesa/drivers/dri/r300/r300_maos.c @@ -27,9 +27,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* - * Authors: - * Keith Whitwell +/** + * \file + * + * \author Keith Whitwell */ #include "glheader.h" diff --git a/src/mesa/drivers/dri/r300/r300_mem.c b/src/mesa/drivers/dri/r300/r300_mem.c index 2c1deddb246..c08e8367a39 100644 --- a/src/mesa/drivers/dri/r300/r300_mem.c +++ b/src/mesa/drivers/dri/r300/r300_mem.c @@ -24,11 +24,13 @@ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ - -/* - * Authors: - * Aapo Tahkola + +/** + * \file + * + * \author Aapo Tahkola */ + #include #include "r300_context.h" diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index e459cad65ac..fee29878f6d 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -24,7 +24,8 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* + +/** * \file * * \brief R300 Render (Vertex Buffer Implementation) @@ -45,6 +46,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * * \author Nicolai Haehnle */ + #include "glheader.h" #include "state.h" #include "imports.h" @@ -72,6 +74,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_emit.h" 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 type = -1; @@ -117,7 +122,7 @@ static int r300PrimitiveType(r300ContextPtr rmesa, GLcontext * ctx, int prim) return type; } -int r300NumVerts(r300ContextPtr rmesa, int num_verts, int prim) +static int r300NumVerts(r300ContextPtr rmesa, int num_verts, int prim) { int verts_off = 0; @@ -274,46 +279,49 @@ static void r300RunRenderPrimitive(r300ContextPtr rmesa, GLcontext * ctx, 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) +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++) + + 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]); - + 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; } -GLboolean r300RunRender(GLcontext * ctx, +static GLboolean r300RunRender(GLcontext * ctx, struct tnl_pipeline_stage *stage) { r300ContextPtr rmesa = R300_CONTEXT(ctx); @@ -349,8 +357,8 @@ GLboolean r300RunRender(GLcontext * ctx, GLuint prim = _tnl_translate_prim(&VB->Primitive[i]); GLuint start = VB->Primitive[i].start; GLuint length = VB->Primitive[i].count; - - r300RunRenderPrimitive(rmesa, ctx, start, start + length, prim); + GLuint end = VB->Primitive[i].start + VB->Primitive[i].count; + r300RunRenderPrimitive(rmesa, ctx, start, end, prim); } reg_start(R300_RB3D_DSTCACHE_CTLSTAT, 0); @@ -362,7 +370,9 @@ GLboolean r300RunRender(GLcontext * ctx, #ifdef USER_BUFFERS r300UseArrays(ctx); #endif + r300ReleaseArrays(ctx); + return GL_FALSE; } @@ -376,7 +386,7 @@ GLboolean r300RunRender(GLcontext * ctx, } \ } while(0) -int r300Fallback(GLcontext * ctx) +static int r300Fallback(GLcontext * ctx) { r300ContextPtr r300 = R300_CONTEXT(ctx); struct r300_fragment_program *fp = (struct r300_fragment_program *) diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 9f391a27a09..bbe3a4caead 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -29,9 +29,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* - * Authors: - * Nicolai Haehnle +/** + * \file + * + * \author Nicolai Haehnle */ #include "glheader.h" diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c index 78b6dd24dac..d78e3dfb23e 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.c +++ b/src/mesa/drivers/dri/r300/r300_tex.c @@ -26,9 +26,10 @@ 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 +/** + * \file + * + * \author Keith Whitwell */ #include "glheader.h" diff --git a/src/mesa/drivers/dri/r300/r300_texmem.c b/src/mesa/drivers/dri/r300/r300_texmem.c index 13178e9973c..db80325309a 100644 --- a/src/mesa/drivers/dri/r300/r300_texmem.c +++ b/src/mesa/drivers/dri/r300/r300_texmem.c @@ -28,11 +28,12 @@ SOFTWARE. **************************************************************************/ -/* - * Authors: - * Kevin E. Martin - * Gareth Hughes +/** + * \file + * + * \author Gareth Hughes * + * \author Kevin E. Martin */ #include diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index 49231d415f5..35f96ce8d6f 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -27,9 +27,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* - * Authors: - * Keith Whitwell +/** + * \file + * + * \author Keith Whitwell */ #include "glheader.h" diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index 90f18ad2257..1d90ade2ed1 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -25,10 +25,12 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* - * Authors: - * Aapo Tahkola +/** + * \file + * + * \author Aapo Tahkola */ + #include "glheader.h" #include "macros.h" #include "enums.h" -- cgit v1.2.3 From 795ebb1a3b5b486e8668086137decfc6ed2a7df5 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 22:06:19 +0000 Subject: r300: Probably a good idea to always check the vertices; it's a WARN_ONCE so the performance impact is extremely minimal. --- src/mesa/drivers/dri/r300/r300_render.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index fee29878f6d..1ecddf69c15 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -169,23 +169,22 @@ static int r300NumVerts(r300ContextPtr rmesa, int num_verts, int prim) fprintf(stderr, "%s:%s Do not know how to handle primitive 0x%04x - help me !\n", __FILE__, __FUNCTION__, prim & PRIM_MODE_MASK); - return -1; + return 0; break; } - if (RADEON_DEBUG & DEBUG_VERTS) { - if (num_verts - verts_off == 0) { - WARN_ONCE - ("user error: Need more than %d vertices to draw primitive 0x%04x !\n", - num_verts, prim & PRIM_MODE_MASK); - return 0; - } + if (num_verts - verts_off == 0) { + WARN_ONCE + ("user error: Need more than %d vertices to draw primitive 0x%04x !\n", + num_verts, prim & PRIM_MODE_MASK); + return 0; + } - if (verts_off > 0) { - WARN_ONCE - ("user error: %d is not a valid number of vertices for primitive 0x%04x !\n", - num_verts, prim & PRIM_MODE_MASK); - } + if (verts_off > 0) { + WARN_ONCE + ("user error: %d is not a valid number of vertices for primitive 0x%04x !\n", + num_verts, prim & PRIM_MODE_MASK); + return 0; } return num_verts - verts_off; -- cgit v1.2.3 From 574bf4d34618308efa390232641e25c034ec3dc7 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 22:07:10 +0000 Subject: r300: Return -1 for error. --- src/mesa/drivers/dri/r300/r300_render.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 1ecddf69c15..449b46eb7d5 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -169,7 +169,7 @@ static int r300NumVerts(r300ContextPtr rmesa, int num_verts, int prim) fprintf(stderr, "%s:%s Do not know how to handle primitive 0x%04x - help me !\n", __FILE__, __FUNCTION__, prim & PRIM_MODE_MASK); - return 0; + return -1; break; } @@ -177,14 +177,14 @@ static int r300NumVerts(r300ContextPtr rmesa, int num_verts, int prim) WARN_ONCE ("user error: Need more than %d vertices to draw primitive 0x%04x !\n", num_verts, prim & PRIM_MODE_MASK); - return 0; + return -1; } if (verts_off > 0) { WARN_ONCE ("user error: %d is not a valid number of vertices for primitive 0x%04x !\n", num_verts, prim & PRIM_MODE_MASK); - return 0; + return -1; } return num_verts - verts_off; -- cgit v1.2.3 From b47018937896c67aabab69a30c485a2620abcf19 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Wed, 9 May 2007 22:16:18 +0000 Subject: r300: Name the render functions in r300_render.c consistently. --- src/mesa/drivers/dri/r300/r300_render.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 449b46eb7d5..a118dab7401 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -424,7 +424,7 @@ static int r300Fallback(GLcontext * ctx) return R300_FALLBACK_NONE; } -static GLboolean r300RunNonTNLRender(GLcontext * ctx, +static GLboolean r300RunNonTCLRender(GLcontext * ctx, struct tnl_pipeline_stage *stage) { if (RADEON_DEBUG & DEBUG_PRIMS) @@ -472,7 +472,7 @@ const struct tnl_pipeline_stage _r300_render_stage = { NULL, NULL, NULL, - r300RunNonTNLRender + r300RunNonTCLRender }; const struct tnl_pipeline_stage _r300_tcl_stage = { -- cgit v1.2.3 From 58dacc8df1f05cf1d9983a3f45b574b0f20f54c6 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 9 May 2007 21:45:27 -0700 Subject: Refactor Enable / Disable and IsEnabled bits related to texture targets. --- src/mesa/main/enable.c | 132 +++++++++++++++++++------------------------------ 1 file changed, 50 insertions(+), 82 deletions(-) diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 11b4ad6400e..a1067317697 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -190,6 +190,25 @@ _mesa_DisableClientState( GLenum cap ) } +/** + * Helper function to enable or disable a texture target. + */ +static GLboolean +enable_texture(GLcontext *ctx, GLboolean state, GLuint bit) +{ + const GLuint curr = ctx->Texture.CurrentUnit; + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr]; + const GLuint newenabled = (state) + ? (texUnit->Enabled & ~bit) : (texUnit->Enabled | bit); + + if (!ctx->DrawBuffer->Visual.rgbMode || texUnit->Enabled == newenabled) + return GL_FALSE; + + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->Enabled = newenabled; + return GL_TRUE; +} + /** * Helper function to enable or disable state. @@ -558,45 +577,21 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) FLUSH_VERTICES(ctx, _NEW_STENCIL); ctx->Stencil.Enabled = state; break; - case GL_TEXTURE_1D: { - const GLuint curr = ctx->Texture.CurrentUnit; - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr]; - GLuint newenabled = texUnit->Enabled & ~TEXTURE_1D_BIT; - if (state) - newenabled |= TEXTURE_1D_BIT; - if (!ctx->DrawBuffer->Visual.rgbMode - || texUnit->Enabled == newenabled) + case GL_TEXTURE_1D: + if (!enable_texture(ctx, state, TEXTURE_1D_BIT)) { return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Enabled = newenabled; + } break; - } - case GL_TEXTURE_2D: { - const GLuint curr = ctx->Texture.CurrentUnit; - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr]; - GLuint newenabled = texUnit->Enabled & ~TEXTURE_2D_BIT; - if (state) - newenabled |= TEXTURE_2D_BIT; - if (!ctx->DrawBuffer->Visual.rgbMode - || texUnit->Enabled == newenabled) + case GL_TEXTURE_2D: + if (!enable_texture(ctx, state, TEXTURE_2D_BIT)) { return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Enabled = newenabled; + } break; - } - case GL_TEXTURE_3D: { - const GLuint curr = ctx->Texture.CurrentUnit; - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr]; - GLuint newenabled = texUnit->Enabled & ~TEXTURE_3D_BIT; - if (state) - newenabled |= TEXTURE_3D_BIT; - if (!ctx->DrawBuffer->Visual.rgbMode - || texUnit->Enabled == newenabled) + case GL_TEXTURE_3D: + if (!enable_texture(ctx, state, TEXTURE_3D_BIT)) { return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Enabled = newenabled; + } break; - } case GL_TEXTURE_GEN_Q: { GLuint unit = ctx->Texture.CurrentUnit; struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; @@ -715,18 +710,9 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) /* GL_ARB_texture_cube_map */ case GL_TEXTURE_CUBE_MAP_ARB: - { - const GLuint curr = ctx->Texture.CurrentUnit; - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr]; - GLuint newenabled = texUnit->Enabled & ~TEXTURE_CUBE_BIT; - CHECK_EXTENSION(ARB_texture_cube_map, cap); - if (state) - newenabled |= TEXTURE_CUBE_BIT; - if (!ctx->DrawBuffer->Visual.rgbMode - || texUnit->Enabled == newenabled) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Enabled = newenabled; + CHECK_EXTENSION(ARB_texture_cube_map, cap); + if (!enable_texture(ctx, state, TEXTURE_CUBE_BIT)) { + return; } break; @@ -879,18 +865,8 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) /* GL_NV_texture_rectangle */ case GL_TEXTURE_RECTANGLE_NV: CHECK_EXTENSION(NV_texture_rectangle, cap); - { - const GLuint curr = ctx->Texture.CurrentUnit; - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr]; - GLuint newenabled = texUnit->Enabled & ~TEXTURE_RECT_BIT; - CHECK_EXTENSION(NV_texture_rectangle, cap); - if (state) - newenabled |= TEXTURE_RECT_BIT; - if (!ctx->DrawBuffer->Visual.rgbMode - || texUnit->Enabled == newenabled) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Enabled = newenabled; + if (!enable_texture(ctx, state, TEXTURE_RECT_BIT)) { + return; } break; @@ -1001,6 +977,18 @@ _mesa_Disable( GLenum cap ) } +/** + * Helper function to determine whether a texture target is enabled. + */ +static GLboolean +is_texture_enabled(GLcontext *ctx, GLuint bit) +{ + const struct gl_texture_unit *const texUnit = + &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + return (texUnit->Enabled & bit) ? GL_TRUE : GL_FALSE; +} + + /** * Return simple enable/disable state. * @@ -1117,23 +1105,11 @@ _mesa_IsEnabled( GLenum cap ) case GL_STENCIL_TEST: return ctx->Stencil.Enabled; case GL_TEXTURE_1D: - { - const struct gl_texture_unit *texUnit; - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - return (texUnit->Enabled & TEXTURE_1D_BIT) ? GL_TRUE : GL_FALSE; - } + return is_texture_enabled(ctx, TEXTURE_1D_BIT); case GL_TEXTURE_2D: - { - const struct gl_texture_unit *texUnit; - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - return (texUnit->Enabled & TEXTURE_2D_BIT) ? GL_TRUE : GL_FALSE; - } + return is_texture_enabled(ctx, TEXTURE_2D_BIT); case GL_TEXTURE_3D: - { - const struct gl_texture_unit *texUnit; - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - return (texUnit->Enabled & TEXTURE_3D_BIT) ? GL_TRUE : GL_FALSE; - } + return is_texture_enabled(ctx, TEXTURE_2D_BIT); case GL_TEXTURE_GEN_Q: { const struct gl_texture_unit *texUnit; @@ -1219,11 +1195,7 @@ _mesa_IsEnabled( GLenum cap ) /* GL_ARB_texture_cube_map */ case GL_TEXTURE_CUBE_MAP_ARB: CHECK_EXTENSION(ARB_texture_cube_map); - { - const struct gl_texture_unit *texUnit; - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - return (texUnit->Enabled & TEXTURE_CUBE_BIT) ? GL_TRUE : GL_FALSE; - } + return is_texture_enabled(ctx, TEXTURE_CUBE_BIT); /* GL_EXT_secondary_color */ case GL_COLOR_SUM_EXT: @@ -1343,11 +1315,7 @@ _mesa_IsEnabled( GLenum cap ) /* GL_NV_texture_rectangle */ case GL_TEXTURE_RECTANGLE_NV: CHECK_EXTENSION(NV_texture_rectangle); - { - const struct gl_texture_unit *texUnit; - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - return (texUnit->Enabled & TEXTURE_RECT_BIT) ? GL_TRUE : GL_FALSE; - } + return is_texture_enabled(ctx, TEXTURE_RECT_BIT); /* GL_EXT_stencil_two_side */ case GL_STENCIL_TEST_TWO_SIDE_EXT: -- cgit v1.2.3 From e2e4b60c7d9fc3618c0f9d7496c9ce3d5eee3ab5 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 9 May 2007 21:46:43 -0700 Subject: Refactor the way TestProxyTexImage is called in texture_error_check. --- src/mesa/main/teximage.c | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 706d3466955..9fb430f39b4 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1329,8 +1329,9 @@ texture_error_check( GLcontext *ctx, GLenum target, GLint depth, GLint border ) { const GLboolean isProxy = _mesa_is_proxy_texture(target); - GLboolean sizeOK; + GLboolean sizeOK = GL_TRUE; GLboolean colorFormat, indexFormat; + GLenum proxy_target; /* Basic level check (more checking in ctx->Driver.TestProxyTexImage) */ if (level < 0 || level >= MAX_TEXTURE_LEVELS) { @@ -1365,10 +1366,9 @@ texture_error_check( GLcontext *ctx, GLenum target, */ if (dimensions == 1) { if (target == GL_PROXY_TEXTURE_1D || target == GL_TEXTURE_1D) { - sizeOK = ctx->Driver.TestProxyTexImage(ctx, GL_PROXY_TEXTURE_1D, - level, internalFormat, - format, type, - width, 1, 1, border); + proxy_target = GL_PROXY_TEXTURE_1D; + height = 1; + width = 1; } else { _mesa_error( ctx, GL_INVALID_ENUM, "glTexImage1D(target)" ); @@ -1376,11 +1376,9 @@ texture_error_check( GLcontext *ctx, GLenum target, } } else if (dimensions == 2) { + depth = 1; if (target == GL_PROXY_TEXTURE_2D || target == GL_TEXTURE_2D) { - sizeOK = ctx->Driver.TestProxyTexImage(ctx, GL_PROXY_TEXTURE_2D, - level, internalFormat, - format, type, - width, height, 1, border); + proxy_target = GL_PROXY_TEXTURE_2D; } else if (target == GL_PROXY_TEXTURE_CUBE_MAP_ARB || (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && @@ -1389,10 +1387,8 @@ texture_error_check( GLcontext *ctx, GLenum target, _mesa_error(ctx, GL_INVALID_ENUM, "glTexImage2D(target)"); return GL_TRUE; } - sizeOK = (width == height) && - ctx->Driver.TestProxyTexImage(ctx, GL_PROXY_TEXTURE_CUBE_MAP_ARB, - level, internalFormat, format, type, - width, height, 1, border); + proxy_target = GL_PROXY_TEXTURE_CUBE_MAP_ARB; + sizeOK = (width == height); } else if (target == GL_PROXY_TEXTURE_RECTANGLE_NV || target == GL_TEXTURE_RECTANGLE_NV) { @@ -1400,11 +1396,7 @@ texture_error_check( GLcontext *ctx, GLenum target, _mesa_error(ctx, GL_INVALID_ENUM, "glTexImage2D(target)"); return GL_TRUE; } - sizeOK = ctx->Driver.TestProxyTexImage(ctx, - GL_PROXY_TEXTURE_RECTANGLE_NV, - level, internalFormat, - format, type, - width, height, 1, border); + proxy_target = GL_PROXY_TEXTURE_RECTANGLE_NV; } else { _mesa_error(ctx, GL_INVALID_ENUM, "glTexImage2D(target)"); @@ -1413,10 +1405,7 @@ texture_error_check( GLcontext *ctx, GLenum target, } else if (dimensions == 3) { if (target == GL_PROXY_TEXTURE_3D || target == GL_TEXTURE_3D) { - sizeOK = ctx->Driver.TestProxyTexImage(ctx, GL_PROXY_TEXTURE_3D, - level, internalFormat, - format, type, - width, height, depth, border); + proxy_target = GL_PROXY_TEXTURE_3D; } else { _mesa_error( ctx, GL_INVALID_ENUM, "glTexImage3D(target)" ); @@ -1428,6 +1417,10 @@ texture_error_check( GLcontext *ctx, GLenum target, return GL_TRUE; } + sizeOK = sizeOK && ctx->Driver.TestProxyTexImage(ctx, proxy_target, level, + internalFormat, format, + type, width, height, + depth, border); if (!sizeOK) { if (!isProxy) { _mesa_error(ctx, GL_INVALID_VALUE, -- cgit v1.2.3 From e282f89a380bfbc8ad4840b535b499541635ca9f Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 9 May 2007 21:49:35 -0700 Subject: Refactor queries of GL_(SOURCE|OPERAND)[012]_(ALPHA|RGB). Most switch-statements that have cases for these enums already use code like: const GLuint idx = pname - GL_SOURCE0_RGB; ... texUnit->Combine.SourceRGB[idx] ... This patch just brings the remaining bits up to speed. --- src/mesa/main/texstate.c | 152 +++++------------------------------------------ 1 file changed, 16 insertions(+), 136 deletions(-) diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 197e8212ad0..1b45eae42c3 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -849,108 +849,48 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) } break; case GL_SOURCE0_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->Combine.SourceRGB[0]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; case GL_SOURCE1_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->Combine.SourceRGB[1]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; case GL_SOURCE2_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->Combine.SourceRGB[2]; + const unsigned rgb_idx = pname - GL_SOURCE0_RGB; + *params = (GLfloat) texUnit->Combine.SourceRGB[rgb_idx]; } else { _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; case GL_SOURCE0_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->Combine.SourceA[0]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; case GL_SOURCE1_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->Combine.SourceA[1]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; case GL_SOURCE2_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->Combine.SourceA[2]; + const unsigned alpha_idx = pname - GL_SOURCE0_ALPHA; + *params = (GLfloat) texUnit->Combine.SourceA[alpha_idx]; } else { _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; case GL_OPERAND0_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->Combine.OperandRGB[0]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; case GL_OPERAND1_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->Combine.OperandRGB[1]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; case GL_OPERAND2_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->Combine.OperandRGB[2]; + const unsigned op_rgb = pname - GL_OPERAND0_RGB; + *params = (GLfloat) texUnit->Combine.OperandRGB[op_rgb]; } else { _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; case GL_OPERAND0_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->Combine.OperandA[0]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; case GL_OPERAND1_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->Combine.OperandA[1]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; case GL_OPERAND2_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->Combine.OperandA[2]; + const unsigned op_alpha = pname - GL_OPERAND0_ALPHA; + *params = (GLfloat) texUnit->Combine.OperandA[op_alpha]; } else { _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); @@ -1073,108 +1013,48 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) } break; case GL_SOURCE0_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->Combine.SourceRGB[0]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; case GL_SOURCE1_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->Combine.SourceRGB[1]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; case GL_SOURCE2_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->Combine.SourceRGB[2]; + const unsigned rgb_idx = pname - GL_SOURCE0_RGB; + *params = (GLint) texUnit->Combine.SourceRGB[rgb_idx]; } else { _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; case GL_SOURCE0_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->Combine.SourceA[0]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; case GL_SOURCE1_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->Combine.SourceA[1]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; case GL_SOURCE2_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->Combine.SourceA[2]; + const unsigned alpha_idx = pname - GL_SOURCE0_ALPHA; + *params = (GLint) texUnit->Combine.SourceA[alpha_idx]; } else { _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; case GL_OPERAND0_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->Combine.OperandRGB[0]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; case GL_OPERAND1_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->Combine.OperandRGB[1]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; case GL_OPERAND2_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->Combine.OperandRGB[2]; + const unsigned op_rgb = pname - GL_OPERAND0_RGB; + *params = (GLint) texUnit->Combine.OperandRGB[op_rgb]; } else { _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; case GL_OPERAND0_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->Combine.OperandA[0]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; case GL_OPERAND1_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->Combine.OperandA[1]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; case GL_OPERAND2_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->Combine.OperandA[2]; + const unsigned op_alpha = pname - GL_OPERAND0_ALPHA; + *params = (GLint) texUnit->Combine.OperandA[op_alpha]; } else { _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); -- cgit v1.2.3 From 87a980a795b29c5114c07a74aa5d95b6e7a7f971 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 9 May 2007 21:51:49 -0700 Subject: Refactor the loop in unbind_texobj_from_texunits. Common code was pulled out of the per-target if-statment and put at the end of the for-loop. The common code is guarded by a new variable, curr, that is set to point to the unit's current target in each if-statement. --- src/mesa/main/texobj.c | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 3cfbfa5eb54..56d816e45f7 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -630,40 +630,34 @@ unbind_texobj_from_texunits(GLcontext *ctx, struct gl_texture_object *texObj) for (u = 0; u < MAX_TEXTURE_IMAGE_UNITS; u++) { struct gl_texture_unit *unit = &ctx->Texture.Unit[u]; + struct gl_texture_object **curr = NULL; + if (texObj == unit->Current1D) { + curr = &unit->Current1D; unit->Current1D = ctx->Shared->Default1D; - ctx->Shared->Default1D->RefCount++; - texObj->RefCount--; - if (texObj == unit->_Current) - unit->_Current = unit->Current1D; } else if (texObj == unit->Current2D) { + curr = &unit->Current2D; unit->Current2D = ctx->Shared->Default2D; - ctx->Shared->Default2D->RefCount++; - texObj->RefCount--; - if (texObj == unit->_Current) - unit->_Current = unit->Current2D; } else if (texObj == unit->Current3D) { + curr = &unit->Current3D; unit->Current3D = ctx->Shared->Default3D; - ctx->Shared->Default3D->RefCount++; - texObj->RefCount--; - if (texObj == unit->_Current) - unit->_Current = unit->Current3D; } else if (texObj == unit->CurrentCubeMap) { + curr = &unit->CurrentCubeMap; unit->CurrentCubeMap = ctx->Shared->DefaultCubeMap; - ctx->Shared->DefaultCubeMap->RefCount++; - texObj->RefCount--; - if (texObj == unit->_Current) - unit->_Current = unit->CurrentCubeMap; } else if (texObj == unit->CurrentRect) { + curr = &unit->CurrentRect; unit->CurrentRect = ctx->Shared->DefaultRect; - ctx->Shared->DefaultRect->RefCount++; + } + + if (curr) { + (*curr)->RefCount++; texObj->RefCount--; if (texObj == unit->_Current) - unit->_Current = unit->CurrentRect; + unit->_Current = *curr; } } } -- cgit v1.2.3 From c9e723e5013443df984cb3987ffa3a9ba3384b89 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 10 May 2007 08:20:04 -0700 Subject: Convert "bit" parameters to GLbitfield. Fix cut-and-paste bug in _mesa_IsEnabled These changes are based on patch review comments from Brian Paul, Alan Hourihane, and vehemens. --- src/mesa/main/enable.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index a1067317697..1cc84465922 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -194,7 +194,7 @@ _mesa_DisableClientState( GLenum cap ) * Helper function to enable or disable a texture target. */ static GLboolean -enable_texture(GLcontext *ctx, GLboolean state, GLuint bit) +enable_texture(GLcontext *ctx, GLboolean state, GLbitfield bit) { const GLuint curr = ctx->Texture.CurrentUnit; struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr]; @@ -981,7 +981,7 @@ _mesa_Disable( GLenum cap ) * Helper function to determine whether a texture target is enabled. */ static GLboolean -is_texture_enabled(GLcontext *ctx, GLuint bit) +is_texture_enabled(GLcontext *ctx, GLbitfield bit) { const struct gl_texture_unit *const texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; @@ -1109,7 +1109,7 @@ _mesa_IsEnabled( GLenum cap ) case GL_TEXTURE_2D: return is_texture_enabled(ctx, TEXTURE_2D_BIT); case GL_TEXTURE_3D: - return is_texture_enabled(ctx, TEXTURE_2D_BIT); + return is_texture_enabled(ctx, TEXTURE_3D_BIT); case GL_TEXTURE_GEN_Q: { const struct gl_texture_unit *texUnit; -- cgit v1.2.3 From 2f6a0840c4c1d1223ca39ff16ce6ae0cbecbaedf Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 10 May 2007 10:51:54 -0600 Subject: Replace `pkg-config --cflags libdrm` with LIBDRM_CFLAGS, remove disabled lines, remove obsolete comments. --- src/mesa/drivers/dri/Makefile.template | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/mesa/drivers/dri/Makefile.template b/src/mesa/drivers/dri/Makefile.template index 26f9bb74c87..6f2314ee8cb 100644 --- a/src/mesa/drivers/dri/Makefile.template +++ b/src/mesa/drivers/dri/Makefile.template @@ -25,6 +25,7 @@ OBJECTS = $(C_SOURCES:.c=.o) \ $(ASM_SOURCES:.S=.o) else +# miniglx WINOBJ= WINLIB=-L$(MESA)/src/glx/mini MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini @@ -55,7 +56,8 @@ SHARED_INCLUDES = \ -I$(TOP)/src/mesa/swrast_setup \ -I$(TOP)/src/egl/main \ -I$(TOP)/src/egl/drivers/dri \ - `pkg-config --cflags libdrm` + $(LIBDRM_CFLAGS) + ##### RULES ##### @@ -71,11 +73,6 @@ SHARED_INCLUDES = \ default: depend symlinks $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME) -#$(TOP)/$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile -# @echo BUILDING FOR: $(WINDOW_SYSTEM) -# $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(TOP)/$(LIB_DIR) \ -# $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS) - $(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template $(TOP)/bin/mklib -noprefix -o $@ \ $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(DRI_LIB_DEPS) @@ -85,9 +82,6 @@ $(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME) $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR) - -# Run 'make depend' to update the dependencies if you change -# what's included by any source file. depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS) touch depend $(MKDEP) $(MKDEP_OPTIONS) $(DRIVER_DEFINES) $(INCLUDES) $(C_SOURCES) \ @@ -104,8 +98,10 @@ clean: -rm -f *.o */*.o *~ *.so *~ server/*.o $(SYMLINKS) -rm -f depend depend.bak + install: $(LIBNAME) $(INSTALL) -d $(DRI_DRIVER_INSTALL_DIR) $(INSTALL) -m 755 $(LIBNAME) $(DRI_DRIVER_INSTALL_DIR) + include depend -- cgit v1.2.3 From 58239d2ae31b12c11055ca3cd0799803670b0b88 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 10 May 2007 10:52:19 -0600 Subject: document tex sampler bug fix, code changes --- docs/relnotes-7.0.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/relnotes-7.0.html b/docs/relnotes-7.0.html index 75e3431d40d..51f0812538b 100644 --- a/docs/relnotes-7.0.html +++ b/docs/relnotes-7.0.html @@ -34,11 +34,14 @@ TBD

  • Fixed an R300 driver bug that caused Xorg composite manager to crash
  • Fixed R300 vertex program/matrix bug (10848)
  • GLSL dFdx() and dFdy() work for fragment program inputs now (texcoords) +
  • Specifying an invalid texture unit as a sampler could lead to a crash

    Internal code changes

      +
    • Some texture code consolidation and simplifiction (Ian Romanick) +
    • R300 driver clean-ups.
    -- cgit v1.2.3 From e856edb2794cba9d321486f602a9e07b917ce949 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Thu, 10 May 2007 17:45:27 +0000 Subject: r300: Moved some more of the emit code into r300_render.c. --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 35 ---------------------- src/mesa/drivers/dri/r300/r300_cmdbuf.h | 2 -- src/mesa/drivers/dri/r300/r300_emit.h | 14 --------- src/mesa/drivers/dri/r300/r300_render.c | 51 +++++++++++++++++++++++++++++++-- 4 files changed, 48 insertions(+), 54 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 48f5ea4c562..1aacf69a0aa 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -659,38 +659,3 @@ void r300EmitWait(r300ContextPtr rmesa, GLuint flags) cmd[0].wait.cmd_type = R300_CMD_WAIT; cmd[0].wait.flags = flags; } - -void r300EmitAOS(r300ContextPtr rmesa, GLuint nr, GLuint offset) -{ - int sz = 1 + (nr >> 1) * 3 + (nr & 1) * 2; - int i; - int cmd_reserved = 0; - int cmd_written = 0; - drm_radeon_cmd_header_t *cmd = NULL; - - if (RADEON_DEBUG & DEBUG_VERTS) - fprintf(stderr, "%s: nr=%d, ofs=0x%08x\n", __func__, nr, - 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); - } - - 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); - } -} diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.h b/src/mesa/drivers/dri/r300/r300_cmdbuf.h index 3c336e1589b..bfb2eda26fe 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.h +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.h @@ -46,8 +46,6 @@ extern void r300EmitState(r300ContextPtr r300); extern void r300InitCmdBuf(r300ContextPtr r300); extern void r300DestroyCmdBuf(r300ContextPtr r300); -extern void r300EmitAOS(r300ContextPtr rmesa, GLuint nr, GLuint offset); - /** * Make sure that enough space is available in the command buffer * by flushing if necessary. diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h index bccb84933ad..b8242ad41e2 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.h +++ b/src/mesa/drivers/dri/r300/r300_emit.h @@ -227,20 +227,6 @@ void static inline cp_wait(r300ContextPtr rmesa, unsigned char flags) cmd[0].i = cmdwait(flags); } -/** - * fire vertex buffer - */ -static void inline fire_AOS(r300ContextPtr rmesa, int vertex_count, int type) -{ - int cmd_reserved = 0; - int cmd_written = 0; - 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); -} - /** * These are followed by the corresponding data */ diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index a118dab7401..a5d8afd94cf 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -190,8 +190,8 @@ static int r300NumVerts(r300ContextPtr rmesa, int num_verts, int prim) return num_verts - verts_off; } -static void inline r300FireEB(r300ContextPtr rmesa, unsigned long addr, - int vertex_count, int type, int elt_size) +static void r300FireEB(r300ContextPtr rmesa, unsigned long addr, + int vertex_count, int type, int elt_size) { int cmd_reserved = 0; int cmd_written = 0; @@ -245,6 +245,52 @@ static void inline r300FireEB(r300ContextPtr rmesa, unsigned long addr, } } +static void r300EmitAOS(r300ContextPtr rmesa, GLuint nr, GLuint offset) +{ + int sz = 1 + (nr >> 1) * 3 + (nr & 1) * 2; + int i; + int cmd_reserved = 0; + int cmd_written = 0; + drm_radeon_cmd_header_t *cmd = NULL; + + if (RADEON_DEBUG & DEBUG_VERTS) + fprintf(stderr, "%s: nr=%d, ofs=0x%08x\n", __func__, nr, + 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); + } + + 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); + } +} + +static void fire_AOS(r300ContextPtr rmesa, int vertex_count, int type) +{ + int cmd_reserved = 0; + int cmd_written = 0; + 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); +} + static void r300RunRenderPrimitive(r300ContextPtr rmesa, GLcontext * ctx, int start, int end, int prim) { @@ -355,7 +401,6 @@ static GLboolean r300RunRender(GLcontext * ctx, for (i = 0; i < VB->PrimitiveCount; i++) { GLuint prim = _tnl_translate_prim(&VB->Primitive[i]); GLuint start = VB->Primitive[i].start; - GLuint length = VB->Primitive[i].count; GLuint end = VB->Primitive[i].start + VB->Primitive[i].count; r300RunRenderPrimitive(rmesa, ctx, start, end, prim); } -- cgit v1.2.3 From eed67a6e3e98fd189c4a6cb591ad94ff4ccc6871 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Thu, 10 May 2007 17:50:25 +0000 Subject: r300: Moved some more emit code into r300_render.c. --- src/mesa/drivers/dri/r300/r300_maos.c | 29 ---------------------------- src/mesa/drivers/dri/r300/r300_render.c | 34 +++++++++++++++++++++++++++++++-- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_maos.c b/src/mesa/drivers/dri/r300/r300_maos.c index ec174441e99..9e07445b1d4 100644 --- a/src/mesa/drivers/dri/r300/r300_maos.c +++ b/src/mesa/drivers/dri/r300/r300_maos.c @@ -223,35 +223,6 @@ static void emit_vector(GLcontext * ctx, } -void r300EmitElts(GLcontext * ctx, void *elts, unsigned long n_elts, - int elt_size) -{ - 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)) { - rvb->address = rmesa->radeon.radeonScreen->gartTextures.map; - rvb->start = ((char *)elts) - rvb->address; - rvb->aos_offset = - rmesa->radeon.radeonScreen->gart_texture_offset + - rvb->start; - - return; - } else if (r300IsGartMemory(rmesa, elts, 1)) { - WARN_ONCE("Pointer not within GART memory!\n"); - _mesa_exit(-1); - } - - r300AllocDmaRegion(rmesa, rvb, n_elts * elt_size, elt_size); - rvb->aos_offset = GET_START(rvb); - - out = rvb->address + rvb->start; - memcpy(out, elts, n_elts * elt_size); -} - static GLuint t_type(struct dt *dt) { switch (dt->type) { diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index a5d8afd94cf..5a00ed7f8e8 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -245,6 +245,36 @@ static void r300FireEB(r300ContextPtr rmesa, unsigned long addr, } } +static void r300EmitElts(GLcontext * ctx, void *elts, unsigned long n_elts, + int elt_size) +{ + 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)) { + rvb->address = rmesa->radeon.radeonScreen->gartTextures.map; + rvb->start = ((char *)elts) - rvb->address; + rvb->aos_offset = + rmesa->radeon.radeonScreen->gart_texture_offset + + rvb->start; + + return; + } else if (r300IsGartMemory(rmesa, elts, 1)) { + WARN_ONCE("Pointer not within GART memory!\n"); + _mesa_exit(-1); + } + + r300AllocDmaRegion(rmesa, rvb, n_elts * elt_size, elt_size); + rvb->aos_offset = GET_START(rvb); + + out = rvb->address + rvb->start; + memcpy(out, elts, n_elts * elt_size); +} + + static void r300EmitAOS(r300ContextPtr rmesa, GLuint nr, GLuint offset) { int sz = 1 + (nr >> 1) * 3 + (nr & 1) * 2; @@ -280,7 +310,7 @@ static void r300EmitAOS(r300ContextPtr rmesa, GLuint nr, GLuint offset) } } -static void fire_AOS(r300ContextPtr rmesa, int vertex_count, int type) +static void r300FireAOS(r300ContextPtr rmesa, int vertex_count, int type) { int cmd_reserved = 0; int cmd_written = 0; @@ -315,7 +345,7 @@ static void r300RunRenderPrimitive(r300ContextPtr rmesa, GLcontext * ctx, num_verts, type, rmesa->state.VB.elt_size); } else { r300EmitAOS(rmesa, rmesa->state.aos_count, start); - fire_AOS(rmesa, num_verts, type); + r300FireAOS(rmesa, num_verts, type); } } -- cgit v1.2.3 From 02e44e41c8bf4b4311b7d244543a0681db851bdd Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Thu, 10 May 2007 21:28:04 +0000 Subject: r300: Removed obsolete start_index16_packet/start_index32_packet. It's all in r300_render.c now. --- src/mesa/drivers/dri/r300/r300_emit.h | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h index b8242ad41e2..ae084d4b1da 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.h +++ b/src/mesa/drivers/dri/r300/r300_emit.h @@ -227,26 +227,4 @@ void static inline cp_wait(r300ContextPtr rmesa, unsigned char flags) cmd[0].i = cmdwait(flags); } -/** - * These are followed by the corresponding data - */ -#define start_index32_packet(vertex_count, type) \ - do { \ - int _vc; \ - _vc = (vertex_count); \ - start_packet3(RADEON_CP_PACKET3_3D_DRAW_INDX_2, _vc); \ - e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (_vc<<16) | \ - type | R300_VAP_VF_CNTL__INDEX_SIZE_32bit); \ - } while (0); - -#define start_index16_packet(vertex_count, type) \ - do { \ - int _vc, _n; \ - _vc = (vertex_count); \ - _n = (vertex_count+1)>>1; \ - start_packet3(RADEON_CP_PACKET3_3D_DRAW_INDX_2, _n); \ - e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (_vc<<16) | \ - type); \ - } while (0); - #endif -- cgit v1.2.3 From d7e3d1dc42664e79d52e7dafd04e834cd4caf9d8 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Thu, 10 May 2007 21:40:20 +0000 Subject: r300: Corrected a compile error introduced by one of the previous commits. --- src/mesa/drivers/dri/r300/r300_maos.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_maos.h b/src/mesa/drivers/dri/r300/r300_maos.h index 055e8c58eaf..2f366e307f8 100644 --- a/src/mesa/drivers/dri/r300/r300_maos.h +++ b/src/mesa/drivers/dri/r300/r300_maos.h @@ -37,8 +37,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_context.h" -extern void r300EmitElts(GLcontext * ctx, void *elts, unsigned long n_elts, - int elt_size); extern int r300EmitArrays(GLcontext * ctx); #ifdef USER_BUFFERS -- cgit v1.2.3 From c103453d4f95ea5a965c613c9ad337406e7c7cdb Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Thu, 10 May 2007 22:01:41 +0000 Subject: r300: Added TODO comment regarding texture tiling; I'm not sure about this. --- src/mesa/drivers/dri/r300/r300_texstate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index 35f96ce8d6f..bef597e4dc0 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -31,6 +31,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * \file * * \author Keith Whitwell + * + * \todo Enable R300 texture tiling code? */ #include "glheader.h" -- cgit v1.2.3 From 64a6a50155e665c2b81e9d70ce71cfd5f1fcaef1 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 10 May 2007 15:00:41 -0700 Subject: Fix reversed enable logic in enable_texture Fix bug inserted in commit c9e723e5013443df984cb3987ffa3a9ba3384b89. Discovered by Oliver McFadden (z3ro). --- src/mesa/main/enable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 1cc84465922..0e14345e730 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -198,7 +198,7 @@ enable_texture(GLcontext *ctx, GLboolean state, GLbitfield bit) { const GLuint curr = ctx->Texture.CurrentUnit; struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr]; - const GLuint newenabled = (state) + const GLuint newenabled = (!state) ? (texUnit->Enabled & ~bit) : (texUnit->Enabled | bit); if (!ctx->DrawBuffer->Visual.rgbMode || texUnit->Enabled == newenabled) -- cgit v1.2.3 From fa546c367d3251b6917f99158c6230fb375a4935 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 10 May 2007 14:48:55 -0600 Subject: Implement exp() in terms of __asm float_power. Fix typo in mod(vec4) function. exp() was using __asm float_exp (OPCODE_EXP) but that computes base two, not e. See bug 10907. --- .../shader/slang/library/slang_common_builtin.gc | 26 +++++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/mesa/shader/slang/library/slang_common_builtin.gc b/src/mesa/shader/slang/library/slang_common_builtin.gc index 04876ad1554..45cf1c6fd09 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin.gc +++ b/src/mesa/shader/slang/library/slang_common_builtin.gc @@ -471,28 +471,32 @@ vec4 pow(const vec4 a, const vec4 b) float exp(const float a) { - __asm float_exp __retVal.x, a; + const float e = 2.71828; + __asm float_power __retVal, e, a; } vec2 exp(const vec2 a) { - __asm float_exp __retVal.x, a.x; - __asm float_exp __retVal.y, a.y; + const float e = 2.71828; + __asm float_power __retVal.x, e, a.x; + __asm float_power __retVal.y, e, a.y; } vec3 exp(const vec3 a) { - __asm float_exp __retVal.x, a.x; - __asm float_exp __retVal.y, a.y; - __asm float_exp __retVal.z, a.z; + const float e = 2.71828; + __asm float_power __retVal.x, e, a.x; + __asm float_power __retVal.y, e, a.y; + __asm float_power __retVal.z, e, a.z; } vec4 exp(const vec4 a) { - __asm float_exp __retVal.x, a.x; - __asm float_exp __retVal.y, a.y; - __asm float_exp __retVal.z, a.z; - __asm float_exp __retVal.w, a.w; + const float e = 2.71828; + __asm float_power __retVal.x, e, a.x; + __asm float_power __retVal.y, e, a.y; + __asm float_power __retVal.z, e, a.z; + __asm float_power __retVal.w, e, a.w; } @@ -894,7 +898,7 @@ vec4 mod(const vec4 a, const vec4 b) __retVal.x = a.x - b.x * floor(a.x * oneOverBx); __retVal.y = a.y - b.y * floor(a.y * oneOverBy); __retVal.z = a.z - b.z * floor(a.z * oneOverBz); - __retVal.w = a.w - b.w * floor(a.w * oneOverBz); + __retVal.w = a.w - b.w * floor(a.w * oneOverBw); } -- cgit v1.2.3 From 544e441f5307aa33c6b2d8fc5773eb7e9632fc15 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 10 May 2007 14:49:06 -0600 Subject: regenerated --- .../shader/slang/library/slang_common_builtin_gc.h | 1052 ++++++++++---------- 1 file changed, 528 insertions(+), 524 deletions(-) diff --git a/src/mesa/shader/slang/library/slang_common_builtin_gc.h b/src/mesa/shader/slang/library/slang_common_builtin_gc.h index 10b64ed89dd..a896c5a287e 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin_gc.h +++ b/src/mesa/shader/slang/library/slang_common_builtin_gc.h @@ -240,565 +240,569 @@ 59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116, 86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,18,98,0,59,122,0,0,0,4,102,108,111,97,116,95,112,111,119, 101,114,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,97,0,59,119,0,0,18,98,0,59,119,0,0,0,0,1, -0,9,0,101,120,112,0,1,1,0,9,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116, -86,97,108,0,59,120,0,0,18,97,0,0,0,0,1,0,10,0,101,120,112,0,1,1,0,10,97,0,0,0,1,4,102,108,111,97, -116,95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4,102,108, -111,97,116,95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,0,1,0, -11,0,101,120,112,0,1,1,0,11,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116, -86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101, -116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114, -101,116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,0,0,1,0,12,0,101,120,112,0,1,1,0,12,97,0,0,0,1,4, -102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0, -0,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121, -0,0,0,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0,59, -122,0,0,0,4,102,108,111,97,116,95,101,120,112,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,97, -0,59,119,0,0,0,0,1,0,9,0,108,111,103,50,0,1,1,0,9,120,0,0,0,1,4,102,108,111,97,116,95,108,111,103, -50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,120,0,0,0,0,1,0,10,0,108,111,103,50,0,1,1,0,10, -118,0,0,0,1,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0, -18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59, -121,0,0,18,118,0,59,121,0,0,0,0,1,0,11,0,108,111,103,50,0,1,1,0,11,118,0,0,0,1,4,102,108,111,97, -116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102, -108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0, -0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59, -122,0,0,0,0,1,0,12,0,108,111,103,50,0,1,1,0,12,118,0,0,0,1,4,102,108,111,97,116,95,108,111,103,50, -0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,108, -111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97, -116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59,122,0,0,0,4,102, -108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,118,0,59,119,0,0, -0,0,1,0,9,0,108,111,103,0,1,1,0,9,120,0,0,0,1,3,2,1,9,1,99,0,2,17,48,0,54,57,51,49,52,55,49,56,49, -0,0,0,0,8,58,108,111,103,50,0,18,120,0,0,0,18,99,0,48,0,0,1,0,10,0,108,111,103,0,1,1,0,10,118,0,0, -0,1,3,2,1,9,1,99,0,2,17,48,0,54,57,51,49,52,55,49,56,49,0,0,0,0,8,58,108,111,103,50,0,18,118,0,0,0, -18,99,0,48,0,0,1,0,11,0,108,111,103,0,1,1,0,11,118,0,0,0,1,3,2,1,9,1,99,0,2,17,48,0,54,57,51,49,52, -55,49,56,49,0,0,0,0,8,58,108,111,103,50,0,18,118,0,0,0,18,99,0,48,0,0,1,0,12,0,108,111,103,0,1,1,0, -12,118,0,0,0,1,3,2,1,9,1,99,0,2,17,48,0,54,57,51,49,52,55,49,56,49,0,0,0,0,8,58,108,111,103,50,0, -18,118,0,0,0,18,99,0,48,0,0,1,0,9,0,101,120,112,50,0,1,1,0,9,97,0,0,0,1,4,102,108,111,97,116,95, -101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,0,0,0,1,0,10,0,101,120,112,50, -0,1,1,0,10,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59, -120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97, -108,0,59,121,0,0,18,97,0,59,121,0,0,0,0,1,0,11,0,101,120,112,50,0,1,1,0,11,97,0,0,0,1,4,102,108, -111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4, -102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121, -0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0, -59,122,0,0,0,0,1,0,12,0,101,120,112,50,0,1,1,0,12,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112, -50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,101, -120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,4,102,108,111,97,116, -95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,0,4,102,108,111, -97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,97,0,59,119,0,0,0,0,1,0, -9,0,115,113,114,116,0,1,1,0,9,120,0,0,0,1,3,2,0,9,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113, -0,18,114,0,0,18,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59, -120,0,0,18,114,0,0,0,0,1,0,10,0,115,113,114,116,0,1,1,0,10,118,0,0,0,1,3,2,0,9,1,114,0,0,0,4,102, -108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99, -112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113, -0,18,114,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97, -108,0,59,121,0,0,18,114,0,0,0,0,1,0,11,0,115,113,114,116,0,1,1,0,11,118,0,0,0,1,3,2,0,9,1,114,0,0, -0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95, -114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114, -115,113,0,18,114,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101, -116,86,97,108,0,59,121,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0, -59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18, -114,0,0,0,0,1,0,12,0,115,113,114,116,0,1,1,0,12,118,0,0,0,1,3,2,0,9,1,114,0,0,0,4,102,108,111,97, -116,95,114,115,113,0,18,114,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95, -95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0, -0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59, -121,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,122,0,0,0,4,102, -108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,114,0,0,0,4,102,108, -111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0, -18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,114,0,0,0,0,1,0,9,0,105,110,118,101,114,115,101,115, -113,114,116,0,1,1,0,9,120,0,0,0,1,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97, -108,0,59,120,0,0,18,120,0,0,0,0,1,0,10,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,10, -118,0,0,0,1,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18, -118,0,59,120,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0, -0,18,118,0,59,121,0,0,0,0,1,0,11,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,11,118,0,0, -0,1,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59, -120,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118, -0,59,121,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0, -18,118,0,59,122,0,0,0,0,1,0,12,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,12,118,0,0,0, -1,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59, -120,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118, -0,59,121,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0, -18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59, -119,0,0,18,118,0,59,119,0,0,0,0,1,0,9,0,110,111,114,109,97,108,105,122,101,0,1,1,0,9,120,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,59,120,0,17,49,0,48,0,0,20,0,0,1,0,10,0,110,111,114,109,97,108, -105,122,101,0,1,1,0,10,118,0,0,0,1,3,2,1,9,1,115,0,2,58,105,110,118,101,114,115,101,115,113,114, -116,0,58,100,111,116,0,18,118,0,0,18,118,0,0,0,0,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112, -108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,115,0,59,120,120,0,0,0,0,1, -0,11,0,110,111,114,109,97,108,105,122,101,0,1,1,0,11,118,0,0,0,1,3,2,0,9,1,116,109,112,0,0,0,4,118, -101,99,51,95,100,111,116,0,18,116,109,112,0,0,18,118,0,0,18,118,0,0,0,4,102,108,111,97,116,95,114, +0,9,0,101,120,112,0,1,1,0,9,97,0,0,0,1,3,2,1,9,1,101,0,2,17,50,0,55,49,56,50,56,0,0,0,0,4,102,108, +111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,0,18,101,0,0,18,97,0,0,0,0,1, +0,10,0,101,120,112,0,1,1,0,10,97,0,0,0,1,3,2,1,9,1,101,0,2,17,50,0,55,49,56,50,56,0,0,0,0,4,102, +108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,101,0,0,18, +97,0,59,120,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0, +59,121,0,0,18,101,0,0,18,97,0,59,121,0,0,0,0,1,0,11,0,101,120,112,0,1,1,0,11,97,0,0,0,1,3,2,1,9,1, +101,0,2,17,50,0,55,49,56,50,56,0,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114, +101,116,86,97,108,0,59,120,0,0,18,101,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,112,111,119, +101,114,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,101,0,0,18,97,0,59,121,0,0,0,4,102,108, +111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,101,0,0,18,97,0, +59,122,0,0,0,0,1,0,12,0,101,120,112,0,1,1,0,12,97,0,0,0,1,3,2,1,9,1,101,0,2,17,50,0,55,49,56,50,56, +0,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0, +18,101,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116, +86,97,108,0,59,121,0,0,18,101,0,0,18,97,0,59,121,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114, +0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,101,0,0,18,97,0,59,122,0,0,0,4,102,108,111,97,116, +95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,101,0,0,18,97,0,59,119,0,0, +0,0,1,0,9,0,108,111,103,50,0,1,1,0,9,120,0,0,0,1,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95, +114,101,116,86,97,108,0,59,120,0,0,18,120,0,0,0,0,1,0,10,0,108,111,103,50,0,1,1,0,10,118,0,0,0,1,4, +102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120, +0,0,0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118, +0,59,121,0,0,0,0,1,0,11,0,108,111,103,50,0,1,1,0,11,118,0,0,0,1,4,102,108,111,97,116,95,108,111, +103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95, +108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,4,102,108,111, +97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59,122,0,0,0,0,1,0, +12,0,108,111,103,50,0,1,1,0,12,118,0,0,0,1,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114, +101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,108,111,103,50,0,18, +95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,108,111,103, +50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,108, +111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,118,0,59,119,0,0,0,0,1,0,9,0,108,111, +103,0,1,1,0,9,120,0,0,0,1,3,2,1,9,1,99,0,2,17,48,0,54,57,51,49,52,55,49,56,49,0,0,0,0,8,58,108,111, +103,50,0,18,120,0,0,0,18,99,0,48,0,0,1,0,10,0,108,111,103,0,1,1,0,10,118,0,0,0,1,3,2,1,9,1,99,0,2, +17,48,0,54,57,51,49,52,55,49,56,49,0,0,0,0,8,58,108,111,103,50,0,18,118,0,0,0,18,99,0,48,0,0,1,0, +11,0,108,111,103,0,1,1,0,11,118,0,0,0,1,3,2,1,9,1,99,0,2,17,48,0,54,57,51,49,52,55,49,56,49,0,0,0, +0,8,58,108,111,103,50,0,18,118,0,0,0,18,99,0,48,0,0,1,0,12,0,108,111,103,0,1,1,0,12,118,0,0,0,1,3, +2,1,9,1,99,0,2,17,48,0,54,57,51,49,52,55,49,56,49,0,0,0,0,8,58,108,111,103,50,0,18,118,0,0,0,18,99, +0,48,0,0,1,0,9,0,101,120,112,50,0,1,1,0,9,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18, +95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,0,0,0,1,0,10,0,101,120,112,50,0,1,1,0,10,97,0,0,0, +1,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59, +120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18, +97,0,59,121,0,0,0,0,1,0,11,0,101,120,112,50,0,1,1,0,11,97,0,0,0,1,4,102,108,111,97,116,95,101,120, +112,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95, +101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,4,102,108,111,97, +116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,0,0,1,0,12, +0,101,120,112,50,0,1,1,0,12,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101, +116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95, +114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0, +18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,0,4,102,108,111,97,116,95,101,120, +112,50,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,97,0,59,119,0,0,0,0,1,0,9,0,115,113,114, +116,0,1,1,0,9,120,0,0,0,1,3,2,0,9,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18, +120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114, +0,0,0,0,1,0,10,0,115,113,114,116,0,1,1,0,10,118,0,0,0,1,3,2,0,9,1,114,0,0,0,4,102,108,111,97,116, +95,114,115,113,0,18,114,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95, +114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0, +18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,121, +0,0,18,114,0,0,0,0,1,0,11,0,115,113,114,116,0,1,1,0,11,118,0,0,0,1,3,2,0,9,1,114,0,0,0,4,102,108, +111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0, +18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18, +114,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108, +0,59,121,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,122,0,0,0,4, +102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,114,0,0,0,0,1,0, +12,0,115,113,114,116,0,1,1,0,12,118,0,0,0,1,3,2,0,9,1,114,0,0,0,4,102,108,111,97,116,95,114,115, +113,0,18,114,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116, +86,97,108,0,59,120,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59, +121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114, +0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,122,0,0,0,4,102,108,111,97,116, +95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,114,0,0,0,4,102,108,111,97,116,95, +114,115,113,0,18,114,0,0,18,118,0,59,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114, +101,116,86,97,108,0,59,119,0,0,18,114,0,0,0,0,1,0,9,0,105,110,118,101,114,115,101,115,113,114,116, +0,1,1,0,9,120,0,0,0,1,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59, +120,0,0,18,120,0,0,0,0,1,0,10,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,10,118,0,0,0,1, +4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120, +0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0, +59,121,0,0,0,0,1,0,11,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,11,118,0,0,0,1,4,102, +108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0, +4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121, +0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0, +59,122,0,0,0,0,1,0,12,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,12,118,0,0,0,1,4,102, +108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0, +4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121, +0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0, +59,122,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18, +118,0,59,119,0,0,0,0,1,0,9,0,110,111,114,109,97,108,105,122,101,0,1,1,0,9,120,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,59,120,0,17,49,0,48,0,0,20,0,0,1,0,10,0,110,111,114,109,97,108,105,122,101, +0,1,1,0,10,118,0,0,0,1,3,2,1,9,1,115,0,2,58,105,110,118,101,114,115,101,115,113,114,116,0,58,100, +111,116,0,18,118,0,0,18,118,0,0,0,0,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18, +95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,115,0,59,120,120,0,0,0,0,1,0,11,0,110, +111,114,109,97,108,105,122,101,0,1,1,0,11,118,0,0,0,1,3,2,0,9,1,116,109,112,0,0,0,4,118,101,99,51, +95,100,111,116,0,18,116,109,112,0,0,18,118,0,0,18,118,0,0,0,4,102,108,111,97,116,95,114,115,113,0, +18,116,109,112,0,0,18,116,109,112,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95, +95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,116,109,112,0,59,120,120,120,0,0,0,0,1, +0,12,0,110,111,114,109,97,108,105,122,101,0,1,1,0,12,118,0,0,0,1,3,2,0,9,1,116,109,112,0,0,0,4,118, +101,99,52,95,100,111,116,0,18,116,109,112,0,0,18,118,0,0,18,118,0,0,0,4,102,108,111,97,116,95,114, 115,113,0,18,116,109,112,0,0,18,116,109,112,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108, 121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,116,109,112,0,59,120,120, -120,0,0,0,0,1,0,12,0,110,111,114,109,97,108,105,122,101,0,1,1,0,12,118,0,0,0,1,3,2,0,9,1,116,109, -112,0,0,0,4,118,101,99,52,95,100,111,116,0,18,116,109,112,0,0,18,118,0,0,18,118,0,0,0,4,102,108, -111,97,116,95,114,115,113,0,18,116,109,112,0,0,18,116,109,112,0,0,0,4,118,101,99,52,95,109,117,108, -116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,116,109, -112,0,59,120,120,120,0,0,0,0,1,0,9,0,97,98,115,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0, -18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,0,0,0,1,0,10,0,97,98,115,0,1,1,0,10,97,0,0,0,1, -4,118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,0,0,1,0, -11,0,97,98,115,0,1,1,0,11,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108, -0,59,120,121,122,0,0,18,97,0,0,0,0,1,0,12,0,97,98,115,0,1,1,0,12,97,0,0,0,1,4,118,101,99,52,95,97, -98,115,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,0,9,0,115,105,103,110,0,1,1,0,9,120,0, -0,0,1,3,2,0,9,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52,95,115,103,116,0,18,112,0,59,120,0,0,18,120, -0,0,17,48,0,48,0,0,0,0,4,118,101,99,52,95,115,103,116,0,18,110,0,59,120,0,0,17,48,0,48,0,0,0,18, -120,0,0,0,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59, -120,0,0,18,112,0,0,18,110,0,0,0,0,1,0,10,0,115,105,103,110,0,1,1,0,10,118,0,0,0,1,3,2,0,10,1,112,0, -0,1,1,110,0,0,0,4,118,101,99,52,95,115,103,116,0,18,112,0,59,120,121,0,0,18,118,0,0,17,48,0,48,0,0, -0,0,4,118,101,99,52,95,115,103,116,0,18,110,0,59,120,121,0,0,17,48,0,48,0,0,0,18,118,0,0,0,4,118, -101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,112, -0,0,18,110,0,0,0,0,1,0,11,0,115,105,103,110,0,1,1,0,11,118,0,0,0,1,3,2,0,11,1,112,0,0,1,1,110,0,0, -0,4,118,101,99,52,95,115,103,116,0,18,112,0,59,120,121,122,0,0,18,118,0,0,17,48,0,48,0,0,0,0,4,118, -101,99,52,95,115,103,116,0,18,110,0,59,120,121,122,0,0,17,48,0,48,0,0,0,18,118,0,0,0,4,118,101,99, -52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,112,0, -0,18,110,0,0,0,0,1,0,12,0,115,105,103,110,0,1,1,0,12,118,0,0,0,1,3,2,0,12,1,112,0,0,1,1,110,0,0,0, -4,118,101,99,52,95,115,103,116,0,18,112,0,0,18,118,0,0,17,48,0,48,0,0,0,0,4,118,101,99,52,95,115, -103,116,0,18,110,0,0,17,48,0,48,0,0,0,18,118,0,0,0,4,118,101,99,52,95,115,117,98,116,114,97,99,116, -0,18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,18,110,0,0,0,0,1,0,9,0,102,108,111,111,114,0,1,1,0, -9,97,0,0,0,1,4,118,101,99,52,95,102,108,111,111,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0, -18,97,0,0,0,0,1,0,10,0,102,108,111,111,114,0,1,1,0,10,97,0,0,0,1,4,118,101,99,52,95,102,108,111, -111,114,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,0,0,1,0,11,0,102,108,111,111, -114,0,1,1,0,11,97,0,0,0,1,4,118,101,99,52,95,102,108,111,111,114,0,18,95,95,114,101,116,86,97,108, -0,59,120,121,122,0,0,18,97,0,0,0,0,1,0,12,0,102,108,111,111,114,0,1,1,0,12,97,0,0,0,1,4,118,101,99, -52,95,102,108,111,111,114,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,0,9,0,99,101,105, -108,0,1,1,0,9,97,0,0,0,1,3,2,0,9,1,98,0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111,111,114,0, -18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,98,0,54,20,0,0,1,0,10,0,99, -101,105,108,0,1,1,0,10,97,0,0,0,1,3,2,0,10,1,98,0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111, -111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18,98,0,54,20,0,0, -1,0,11,0,99,101,105,108,0,1,1,0,11,97,0,0,0,1,3,2,0,11,1,98,0,2,18,97,0,54,0,0,4,118,101,99,52,95, -102,108,111,111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,18, -98,0,54,20,0,0,1,0,12,0,99,101,105,108,0,1,1,0,12,97,0,0,0,1,3,2,0,12,1,98,0,2,18,97,0,54,0,0,4, -118,101,99,52,95,102,108,111,111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18, -98,0,54,20,0,0,1,0,9,0,102,114,97,99,116,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0, -18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,0,0,0,1,0,10,0,102,114,97,99,116,0,1,1,0,10,97, -0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0, -0,0,0,1,0,11,0,102,114,97,99,116,0,1,1,0,11,97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18,95,95, -114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,0,0,1,0,12,0,102,114,97,99,116,0,1,1,0,12,97, -0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,0,9, -0,109,111,100,0,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1,111,110,101,79,118,101,114,66,0,0,0,4, -102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,0,18,98,0,0,0,9,18,95,95,114, -101,116,86,97,108,0,59,120,0,18,97,0,18,98,0,58,102,108,111,111,114,0,18,97,0,18,111,110,101,79, -118,101,114,66,0,48,0,0,48,47,20,0,0,1,0,10,0,109,111,100,0,1,1,0,10,97,0,0,1,1,0,9,98,0,0,0,1,3,2, -0,9,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79, -118,101,114,66,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18,97,0,18,98,0,58, -102,108,111,111,114,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,0,11,0,109, -111,100,0,1,1,0,11,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1,111,110,101,79,118,101,114,66,0,0,0,4,102, -108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,0,18,98,0,0,0,9,18,95,95,114,101, -116,86,97,108,0,59,120,121,122,0,18,97,0,18,98,0,58,102,108,111,111,114,0,18,97,0,18,111,110,101, -79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,0,12,0,109,111,100,0,1,1,0,12,97,0,0,1,1,0,9,98,0,0,0,1, -3,2,0,9,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101, -79,118,101,114,66,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,18,98,0,58,102,108, -111,111,114,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,0,10,0,109,111,100, -0,1,1,0,10,97,0,0,1,1,0,10,98,0,0,0,1,3,2,0,9,1,111,110,101,79,118,101,114,66,120,0,0,1,1,111,110, -101,79,118,101,114,66,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114, -66,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114, -66,121,0,0,18,98,0,59,121,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,97,0,59,120,0,18,98, -0,59,120,0,58,102,108,111,111,114,0,18,97,0,59,120,0,18,111,110,101,79,118,101,114,66,120,0,48,0,0, -48,47,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,97,0,59,121,0,18,98,0,59,121,0,58,102, -108,111,111,114,0,18,97,0,59,121,0,18,111,110,101,79,118,101,114,66,121,0,48,0,0,48,47,20,0,0,1,0, -11,0,109,111,100,0,1,1,0,11,97,0,0,1,1,0,11,98,0,0,0,1,3,2,0,9,1,111,110,101,79,118,101,114,66,120, -0,0,1,1,111,110,101,79,118,101,114,66,121,0,0,1,1,111,110,101,79,118,101,114,66,122,0,0,0,4,102, -108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,120,0,0,18,98,0,59,120,0,0,0,4,102, -108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,121,0,0,18,98,0,59,121,0,0,0,4,102, -108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,122,0,0,18,98,0,59,122,0,0,0,9,18, -95,95,114,101,116,86,97,108,0,59,120,0,18,97,0,59,120,0,18,98,0,59,120,0,58,102,108,111,111,114,0, -18,97,0,59,120,0,18,111,110,101,79,118,101,114,66,120,0,48,0,0,48,47,20,0,9,18,95,95,114,101,116, -86,97,108,0,59,121,0,18,97,0,59,121,0,18,98,0,59,121,0,58,102,108,111,111,114,0,18,97,0,59,121,0, -18,111,110,101,79,118,101,114,66,121,0,48,0,0,48,47,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122, -0,18,97,0,59,122,0,18,98,0,59,122,0,58,102,108,111,111,114,0,18,97,0,59,122,0,18,111,110,101,79, -118,101,114,66,122,0,48,0,0,48,47,20,0,0,1,0,12,0,109,111,100,0,1,1,0,12,97,0,0,1,1,0,12,98,0,0,0, -1,3,2,0,9,1,111,110,101,79,118,101,114,66,120,0,0,1,1,111,110,101,79,118,101,114,66,121,0,0,1,1, -111,110,101,79,118,101,114,66,122,0,0,1,1,111,110,101,79,118,101,114,66,119,0,0,0,4,102,108,111,97, -116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97, -116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97, -116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,122,0,0,18,98,0,59,122,0,0,0,4,102,108,111,97, -116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,119,0,0,18,98,0,59,119,0,0,0,9,18,95,95,114, -101,116,86,97,108,0,59,120,0,18,97,0,59,120,0,18,98,0,59,120,0,58,102,108,111,111,114,0,18,97,0,59, -120,0,18,111,110,101,79,118,101,114,66,120,0,48,0,0,48,47,20,0,9,18,95,95,114,101,116,86,97,108,0, -59,121,0,18,97,0,59,121,0,18,98,0,59,121,0,58,102,108,111,111,114,0,18,97,0,59,121,0,18,111,110, -101,79,118,101,114,66,121,0,48,0,0,48,47,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,97,0, -59,122,0,18,98,0,59,122,0,58,102,108,111,111,114,0,18,97,0,59,122,0,18,111,110,101,79,118,101,114, -66,122,0,48,0,0,48,47,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18,97,0,59,119,0,18,98,0,59, -119,0,58,102,108,111,111,114,0,18,97,0,59,119,0,18,111,110,101,79,118,101,114,66,122,0,48,0,0,48, -47,20,0,0,1,0,9,0,109,105,110,0,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0, -18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0,0,0,0,1,0,10,0,109, -105,110,0,1,1,0,10,97,0,0,1,1,0,10,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101, -116,86,97,108,0,59,120,121,0,0,18,97,0,59,120,121,0,0,18,98,0,59,120,121,0,0,0,0,1,0,11,0,109,105, -110,0,1,1,0,11,97,0,0,1,1,0,11,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86, -97,108,0,59,120,121,122,0,0,18,97,0,59,120,121,122,0,0,18,98,0,59,120,121,122,0,0,0,0,1,0,12,0,109, -105,110,0,1,1,0,12,97,0,0,1,1,0,12,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101, -116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,0,10,0,109,105,110,0,1,1,0,10,97,0,0,1,1,0,9,98,0,0,0, -1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,59,120,121,0,0,18,98, -0,59,120,120,0,0,0,0,1,0,11,0,109,105,110,0,1,1,0,11,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95, -109,105,110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,59,120,121,122,0,0,18,98,0,59,120,120,120, -0,0,0,0,1,0,12,0,109,105,110,0,1,1,0,12,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0, -18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,59,120,120,120,120,0,0,0,0,1,0,9,0,109,97,120, -0,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108, -0,59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0,0,0,0,1,0,10,0,109,97,120,0,1,1,0,10,97,0,0,1,1,0, -10,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18, -97,0,59,120,121,0,0,18,98,0,59,120,121,0,0,0,0,1,0,11,0,109,97,120,0,1,1,0,11,97,0,0,1,1,0,11,98,0, -0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0, -59,120,121,122,0,0,18,98,0,59,120,121,122,0,0,0,0,1,0,12,0,109,97,120,0,1,1,0,12,97,0,0,1,1,0,12, -98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0, -0,0,1,0,10,0,109,97,120,0,1,1,0,10,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95, -95,114,101,116,86,97,108,0,0,18,97,0,59,120,121,0,0,18,98,0,59,120,120,0,0,0,0,1,0,11,0,109,97,120, -0,1,1,0,11,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97, -108,0,0,18,97,0,59,120,121,122,0,0,18,98,0,59,120,120,120,0,0,0,0,1,0,12,0,109,97,120,0,1,1,0,12, -97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,0,18,97, -0,0,18,98,0,59,120,120,120,120,0,0,0,0,1,0,9,0,99,108,97,109,112,0,1,1,0,9,118,97,108,0,0,1,1,0,9, -109,105,110,86,97,108,0,0,1,1,0,9,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109, -112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97, -120,86,97,108,0,0,0,0,1,0,10,0,99,108,97,109,112,0,1,1,0,10,118,97,108,0,0,1,1,0,9,109,105,110,86, +120,0,0,0,0,1,0,9,0,97,98,115,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0,18,95,95,114,101, +116,86,97,108,0,59,120,0,0,18,97,0,0,0,0,1,0,10,0,97,98,115,0,1,1,0,10,97,0,0,0,1,4,118,101,99,52, +95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,0,0,1,0,11,0,97,98,115,0, +1,1,0,11,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122, +0,0,18,97,0,0,0,0,1,0,12,0,97,98,115,0,1,1,0,12,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0,18,95,95, +114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,0,9,0,115,105,103,110,0,1,1,0,9,120,0,0,0,1,3,2,0,9,1, +112,0,0,1,1,110,0,0,0,4,118,101,99,52,95,115,103,116,0,18,112,0,59,120,0,0,18,120,0,0,17,48,0,48,0, +0,0,0,4,118,101,99,52,95,115,103,116,0,18,110,0,59,120,0,0,17,48,0,48,0,0,0,18,120,0,0,0,4,118,101, +99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,112,0,0,18, +110,0,0,0,0,1,0,10,0,115,105,103,110,0,1,1,0,10,118,0,0,0,1,3,2,0,10,1,112,0,0,1,1,110,0,0,0,4,118, +101,99,52,95,115,103,116,0,18,112,0,59,120,121,0,0,18,118,0,0,17,48,0,48,0,0,0,0,4,118,101,99,52, +95,115,103,116,0,18,110,0,59,120,121,0,0,17,48,0,48,0,0,0,18,118,0,0,0,4,118,101,99,52,95,115,117, +98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,112,0,0,18,110,0,0,0,0,1, +0,11,0,115,105,103,110,0,1,1,0,11,118,0,0,0,1,3,2,0,11,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52,95, +115,103,116,0,18,112,0,59,120,121,122,0,0,18,118,0,0,17,48,0,48,0,0,0,0,4,118,101,99,52,95,115,103, +116,0,18,110,0,59,120,121,122,0,0,17,48,0,48,0,0,0,18,118,0,0,0,4,118,101,99,52,95,115,117,98,116, +114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,112,0,0,18,110,0,0,0,0,1,0, +12,0,115,105,103,110,0,1,1,0,12,118,0,0,0,1,3,2,0,12,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52,95, +115,103,116,0,18,112,0,0,18,118,0,0,17,48,0,48,0,0,0,0,4,118,101,99,52,95,115,103,116,0,18,110,0,0, +17,48,0,48,0,0,0,18,118,0,0,0,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101, +116,86,97,108,0,0,18,112,0,0,18,110,0,0,0,0,1,0,9,0,102,108,111,111,114,0,1,1,0,9,97,0,0,0,1,4,118, +101,99,52,95,102,108,111,111,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,0,0,0,1,0, +10,0,102,108,111,111,114,0,1,1,0,10,97,0,0,0,1,4,118,101,99,52,95,102,108,111,111,114,0,18,95,95, +114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,0,0,1,0,11,0,102,108,111,111,114,0,1,1,0,11,97,0, +0,0,1,4,118,101,99,52,95,102,108,111,111,114,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0, +18,97,0,0,0,0,1,0,12,0,102,108,111,111,114,0,1,1,0,12,97,0,0,0,1,4,118,101,99,52,95,102,108,111, +111,114,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,0,9,0,99,101,105,108,0,1,1,0,9,97,0,0, +0,1,3,2,0,9,1,98,0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111,111,114,0,18,98,0,0,18,98,0,0,0, +9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,98,0,54,20,0,0,1,0,10,0,99,101,105,108,0,1,1,0,10, +97,0,0,0,1,3,2,0,10,1,98,0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111,111,114,0,18,98,0,0,18, +98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18,98,0,54,20,0,0,1,0,11,0,99,101,105,108, +0,1,1,0,11,97,0,0,0,1,3,2,0,11,1,98,0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111,111,114,0,18, +98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,18,98,0,54,20,0,0,1,0,12,0, +99,101,105,108,0,1,1,0,12,97,0,0,0,1,3,2,0,12,1,98,0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108, +111,111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,98,0,54,20,0,0,1,0,9,0, +102,114,97,99,116,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18,95,95,114,101,116,86, +97,108,0,59,120,0,0,18,97,0,0,0,0,1,0,10,0,102,114,97,99,116,0,1,1,0,10,97,0,0,0,1,4,118,101,99,52, +95,102,114,97,99,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,0,0,1,0,11,0,102,114, +97,99,116,0,1,1,0,11,97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18,95,95,114,101,116,86,97,108, +0,59,120,121,122,0,0,18,97,0,0,0,0,1,0,12,0,102,114,97,99,116,0,1,1,0,12,97,0,0,0,1,4,118,101,99, +52,95,102,114,97,99,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,0,9,0,109,111,100,0,1,1,0, +9,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95, +114,99,112,0,18,111,110,101,79,118,101,114,66,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0, +59,120,0,18,97,0,18,98,0,58,102,108,111,111,114,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0, +0,48,47,20,0,0,1,0,10,0,109,111,100,0,1,1,0,10,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1,111,110,101,79, +118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,0,18, +98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18,97,0,18,98,0,58,102,108,111,111,114,0, +18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,0,11,0,109,111,100,0,1,1,0,11,97, +0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114, +99,112,0,18,111,110,101,79,118,101,114,66,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59, +120,121,122,0,18,97,0,18,98,0,58,102,108,111,111,114,0,18,97,0,18,111,110,101,79,118,101,114,66,0, +48,0,0,48,47,20,0,0,1,0,12,0,109,111,100,0,1,1,0,12,97,0,0,1,1,0,9,98,0,0,0,1,3,2,0,9,1,111,110, +101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66, +0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,18,98,0,58,102,108,111,111,114,0,18,97, +0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,0,10,0,109,111,100,0,1,1,0,10,97,0,0,1, +1,0,10,98,0,0,0,1,3,2,0,9,1,111,110,101,79,118,101,114,66,120,0,0,1,1,111,110,101,79,118,101,114, +66,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,120,0,0,18,98,0, +59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,121,0,0,18,98,0, +59,121,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,97,0,59,120,0,18,98,0,59,120,0,58,102, +108,111,111,114,0,18,97,0,59,120,0,18,111,110,101,79,118,101,114,66,120,0,48,0,0,48,47,20,0,9,18, +95,95,114,101,116,86,97,108,0,59,121,0,18,97,0,59,121,0,18,98,0,59,121,0,58,102,108,111,111,114,0, +18,97,0,59,121,0,18,111,110,101,79,118,101,114,66,121,0,48,0,0,48,47,20,0,0,1,0,11,0,109,111,100,0, +1,1,0,11,97,0,0,1,1,0,11,98,0,0,0,1,3,2,0,9,1,111,110,101,79,118,101,114,66,120,0,0,1,1,111,110, +101,79,118,101,114,66,121,0,0,1,1,111,110,101,79,118,101,114,66,122,0,0,0,4,102,108,111,97,116,95, +114,99,112,0,18,111,110,101,79,118,101,114,66,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95, +114,99,112,0,18,111,110,101,79,118,101,114,66,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95, +114,99,112,0,18,111,110,101,79,118,101,114,66,122,0,0,18,98,0,59,122,0,0,0,9,18,95,95,114,101,116, +86,97,108,0,59,120,0,18,97,0,59,120,0,18,98,0,59,120,0,58,102,108,111,111,114,0,18,97,0,59,120,0, +18,111,110,101,79,118,101,114,66,120,0,48,0,0,48,47,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121, +0,18,97,0,59,121,0,18,98,0,59,121,0,58,102,108,111,111,114,0,18,97,0,59,121,0,18,111,110,101,79, +118,101,114,66,121,0,48,0,0,48,47,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,97,0,59,122, +0,18,98,0,59,122,0,58,102,108,111,111,114,0,18,97,0,59,122,0,18,111,110,101,79,118,101,114,66,122, +0,48,0,0,48,47,20,0,0,1,0,12,0,109,111,100,0,1,1,0,12,97,0,0,1,1,0,12,98,0,0,0,1,3,2,0,9,1,111,110, +101,79,118,101,114,66,120,0,0,1,1,111,110,101,79,118,101,114,66,121,0,0,1,1,111,110,101,79,118,101, +114,66,122,0,0,1,1,111,110,101,79,118,101,114,66,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18, +111,110,101,79,118,101,114,66,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18, +111,110,101,79,118,101,114,66,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18, +111,110,101,79,118,101,114,66,122,0,0,18,98,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18, +111,110,101,79,118,101,114,66,119,0,0,18,98,0,59,119,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59, +120,0,18,97,0,59,120,0,18,98,0,59,120,0,58,102,108,111,111,114,0,18,97,0,59,120,0,18,111,110,101, +79,118,101,114,66,120,0,48,0,0,48,47,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,97,0,59, +121,0,18,98,0,59,121,0,58,102,108,111,111,114,0,18,97,0,59,121,0,18,111,110,101,79,118,101,114,66, +121,0,48,0,0,48,47,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,97,0,59,122,0,18,98,0,59, +122,0,58,102,108,111,111,114,0,18,97,0,59,122,0,18,111,110,101,79,118,101,114,66,122,0,48,0,0,48, +47,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18,97,0,59,119,0,18,98,0,59,119,0,58,102,108, +111,111,114,0,18,97,0,59,119,0,18,111,110,101,79,118,101,114,66,119,0,48,0,0,48,47,20,0,0,1,0,9,0, +109,105,110,0,1,1,0,9,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101, +116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0,0,0,0,1,0,10,0,109,105,110,0,1,1,0, +10,97,0,0,1,1,0,10,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,59, +120,121,0,0,18,97,0,59,120,121,0,0,18,98,0,59,120,121,0,0,0,0,1,0,11,0,109,105,110,0,1,1,0,11,97,0, +0,1,1,0,11,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,59,120,121, +122,0,0,18,97,0,59,120,121,122,0,0,18,98,0,59,120,121,122,0,0,0,0,1,0,12,0,109,105,110,0,1,1,0,12, +97,0,0,1,1,0,12,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,0,18, +97,0,0,18,98,0,0,0,0,1,0,10,0,109,105,110,0,1,1,0,10,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95, +109,105,110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,59,120,121,0,0,18,98,0,59,120,120,0,0,0,0, +1,0,11,0,109,105,110,0,1,1,0,11,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95, +95,114,101,116,86,97,108,0,0,18,97,0,59,120,121,122,0,0,18,98,0,59,120,120,120,0,0,0,0,1,0,12,0, +109,105,110,0,1,1,0,12,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101, +116,86,97,108,0,0,18,97,0,0,18,98,0,59,120,120,120,120,0,0,0,0,1,0,9,0,109,97,120,0,1,1,0,9,97,0,0, +1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18, +97,0,59,120,0,0,18,98,0,59,120,0,0,0,0,1,0,10,0,109,97,120,0,1,1,0,10,97,0,0,1,1,0,10,98,0,0,0,1,4, +118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,59,120,121,0, +0,18,98,0,59,120,121,0,0,0,0,1,0,11,0,109,97,120,0,1,1,0,11,97,0,0,1,1,0,11,98,0,0,0,1,4,118,101, +99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,59,120,121,122,0, +0,18,98,0,59,120,121,122,0,0,0,0,1,0,12,0,109,97,120,0,1,1,0,12,97,0,0,1,1,0,12,98,0,0,0,1,4,118, +101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,0,10,0,109, +97,120,0,1,1,0,10,97,0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116, +86,97,108,0,0,18,97,0,59,120,121,0,0,18,98,0,59,120,120,0,0,0,0,1,0,11,0,109,97,120,0,1,1,0,11,97, +0,0,1,1,0,9,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0, +59,120,121,122,0,0,18,98,0,59,120,120,120,0,0,0,0,1,0,12,0,109,97,120,0,1,1,0,12,97,0,0,1,1,0,9,98, +0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,59, +120,120,120,120,0,0,0,0,1,0,9,0,99,108,97,109,112,0,1,1,0,9,118,97,108,0,0,1,1,0,9,109,105,110,86, 97,108,0,0,1,1,0,9,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95, 114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0, -0,0,0,1,0,11,0,99,108,97,109,112,0,1,1,0,11,118,97,108,0,0,1,1,0,9,109,105,110,86,97,108,0,0,1,1,0, +0,0,0,1,0,10,0,99,108,97,109,112,0,1,1,0,10,118,97,108,0,0,1,1,0,9,109,105,110,86,97,108,0,0,1,1,0, 9,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97, -108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,0,12,0,99, -108,97,109,112,0,1,1,0,12,118,97,108,0,0,1,1,0,9,109,105,110,86,97,108,0,0,1,1,0,9,109,97,120,86, +108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,0,11,0,99, +108,97,109,112,0,1,1,0,11,118,97,108,0,0,1,1,0,9,109,105,110,86,97,108,0,0,1,1,0,9,109,97,120,86, 97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97, -108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,0,10,0,99,108,97,109,112,0, -1,1,0,10,118,97,108,0,0,1,1,0,10,109,105,110,86,97,108,0,0,1,1,0,10,109,97,120,86,97,108,0,0,0,1,4, +108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,0,12,0,99,108,97,109,112,0, +1,1,0,12,118,97,108,0,0,1,1,0,9,109,105,110,86,97,108,0,0,1,1,0,9,109,97,120,86,97,108,0,0,0,1,4, 118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109, -105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,0,11,0,99,108,97,109,112,0,1,1,0,11,118,97, -108,0,0,1,1,0,11,109,105,110,86,97,108,0,0,1,1,0,11,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52, +105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,0,10,0,99,108,97,109,112,0,1,1,0,10,118,97, +108,0,0,1,1,0,10,109,105,110,86,97,108,0,0,1,1,0,10,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52, 95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97, -108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,0,12,0,99,108,97,109,112,0,1,1,0,12,118,97,108,0,0,1,1,0, -12,109,105,110,86,97,108,0,0,1,1,0,12,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97, +108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,0,11,0,99,108,97,109,112,0,1,1,0,11,118,97,108,0,0,1,1,0, +11,109,105,110,86,97,108,0,0,1,1,0,11,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97, 109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109, -97,120,86,97,108,0,0,0,0,1,0,9,0,109,105,120,0,1,1,0,9,120,0,0,1,1,0,9,121,0,0,1,1,0,9,97,0,0,0,1, -4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0, -0,0,0,1,0,10,0,109,105,120,0,1,1,0,10,120,0,0,1,1,0,10,121,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52, -95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,11,0, -109,105,120,0,1,1,0,11,120,0,0,1,1,0,11,121,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,108,114,112, -0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,12,0,109,105,120,0,1, -1,0,12,120,0,0,1,1,0,12,121,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114, -101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,10,0,109,105,120,0,1,1,0,10,120,0,0, -1,1,0,10,121,0,0,1,1,0,10,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97, -108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,11,0,109,105,120,0,1,1,0,11,120,0,0,1,1,0,11,121,0, -0,1,1,0,11,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0, -0,18,121,0,0,18,120,0,0,0,0,1,0,12,0,109,105,120,0,1,1,0,12,120,0,0,1,1,0,12,121,0,0,1,1,0,12,97,0, -0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18, -120,0,0,0,0,1,0,9,0,115,116,101,112,0,1,1,0,9,101,100,103,101,0,0,1,1,0,9,120,0,0,0,1,4,118,101,99, -52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,120,0,0,18,101,100,103,101,0,0, -0,0,1,0,10,0,115,116,101,112,0,1,1,0,10,101,100,103,101,0,0,1,1,0,10,120,0,0,0,1,4,118,101,99,52, -95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,120,0,0,18,101,100,103,101,0,0, -0,0,1,0,11,0,115,116,101,112,0,1,1,0,11,101,100,103,101,0,0,1,1,0,11,120,0,0,0,1,4,118,101,99,52, -95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,120,0,0,18,101,100,103,101, -0,0,0,0,1,0,12,0,115,116,101,112,0,1,1,0,12,101,100,103,101,0,0,1,1,0,12,120,0,0,0,1,4,118,101,99, -52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1,0, -10,0,115,116,101,112,0,1,1,0,9,101,100,103,101,0,0,1,1,0,10,118,0,0,0,1,4,118,101,99,52,95,115,103, -116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,101,100,103,101,0,59,120,120,0, -0,0,0,1,0,11,0,115,116,101,112,0,1,1,0,9,101,100,103,101,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99,52, -95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,101,100,103,101, -0,59,120,120,120,0,0,0,0,1,0,12,0,115,116,101,112,0,1,1,0,9,101,100,103,101,0,0,1,1,0,12,118,0,0,0, -1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,101,100,103, -101,0,59,120,120,120,120,0,0,0,0,1,0,9,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,9,101,100, -103,101,48,0,0,1,1,0,9,101,100,103,101,49,0,0,1,1,0,9,120,0,0,0,1,3,2,0,9,1,116,0,2,58,99,108,97, -109,112,0,18,120,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47, -49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0, -18,116,0,48,47,48,0,0,1,0,10,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,10,101,100,103,101, -48,0,0,1,1,0,10,101,100,103,101,49,0,0,1,1,0,10,118,0,0,0,1,3,2,0,10,1,116,0,2,58,99,108,97,109, -112,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0, +97,120,86,97,108,0,0,0,0,1,0,12,0,99,108,97,109,112,0,1,1,0,12,118,97,108,0,0,1,1,0,12,109,105,110, +86,97,108,0,0,1,1,0,12,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95, +95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97, +108,0,0,0,0,1,0,9,0,109,105,120,0,1,1,0,9,120,0,0,1,1,0,9,121,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99, +52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,10, +0,109,105,120,0,1,1,0,10,120,0,0,1,1,0,10,121,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,108,114, +112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,11,0,109,105,120, +0,1,1,0,11,120,0,0,1,1,0,11,121,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95, +114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,12,0,109,105,120,0,1,1,0,12,120, +0,0,1,1,0,12,121,0,0,1,1,0,9,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86, +97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,10,0,109,105,120,0,1,1,0,10,120,0,0,1,1,0,10, +121,0,0,1,1,0,10,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18, +97,0,0,18,121,0,0,18,120,0,0,0,0,1,0,11,0,109,105,120,0,1,1,0,11,120,0,0,1,1,0,11,121,0,0,1,1,0,11, +97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0, +0,18,120,0,0,0,0,1,0,12,0,109,105,120,0,1,1,0,12,120,0,0,1,1,0,12,121,0,0,1,1,0,12,97,0,0,0,1,4, +118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0, +0,0,1,0,9,0,115,116,101,112,0,1,1,0,9,101,100,103,101,0,0,1,1,0,9,120,0,0,0,1,4,118,101,99,52,95, +115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1, +0,10,0,115,116,101,112,0,1,1,0,10,101,100,103,101,0,0,1,1,0,10,120,0,0,0,1,4,118,101,99,52,95,115, +103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1, +0,11,0,115,116,101,112,0,1,1,0,11,101,100,103,101,0,0,1,1,0,11,120,0,0,0,1,4,118,101,99,52,95,115, +103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,120,0,0,18,101,100,103,101,0,0,0, +0,1,0,12,0,115,116,101,112,0,1,1,0,12,101,100,103,101,0,0,1,1,0,12,120,0,0,0,1,4,118,101,99,52,95, +115,103,116,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1,0,10,0, +115,116,101,112,0,1,1,0,9,101,100,103,101,0,0,1,1,0,10,118,0,0,0,1,4,118,101,99,52,95,115,103,116, +0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,101,100,103,101,0,59,120,120,0,0,0, +0,1,0,11,0,115,116,101,112,0,1,1,0,9,101,100,103,101,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99,52,95, +115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,101,100,103,101,0, +59,120,120,120,0,0,0,0,1,0,12,0,115,116,101,112,0,1,1,0,9,101,100,103,101,0,0,1,1,0,12,118,0,0,0,1, +4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,101,100,103,101, +0,59,120,120,120,120,0,0,0,0,1,0,9,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,9,101,100,103, +101,48,0,0,1,1,0,9,101,100,103,101,49,0,0,1,1,0,9,120,0,0,0,1,3,2,0,9,1,116,0,2,58,99,108,97,109, +112,0,18,120,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0, 17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18, -116,0,48,47,48,0,0,1,0,11,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,11,101,100,103,101,48, -0,0,1,1,0,11,101,100,103,101,49,0,0,1,1,0,11,118,0,0,0,1,3,2,0,11,1,116,0,2,58,99,108,97,109,112,0, +116,0,48,47,48,0,0,1,0,10,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,10,101,100,103,101,48, +0,0,1,1,0,10,101,100,103,101,49,0,0,1,1,0,10,118,0,0,0,1,3,2,0,10,1,116,0,2,58,99,108,97,109,112,0, 18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48, 0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48, -47,48,0,0,1,0,12,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,12,101,100,103,101,48,0,0,1,1,0, -12,101,100,103,101,49,0,0,1,1,0,12,118,0,0,0,1,3,2,0,12,1,116,0,2,58,99,108,97,109,112,0,18,118,0, +47,48,0,0,1,0,11,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,11,101,100,103,101,48,0,0,1,1,0, +11,101,100,103,101,49,0,0,1,1,0,11,118,0,0,0,1,3,2,0,11,1,116,0,2,58,99,108,97,109,112,0,18,118,0, 18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0, 0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0, -0,1,0,10,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,9,101,100,103,101,48,0,0,1,1,0,9,101, -100,103,101,49,0,0,1,1,0,10,118,0,0,0,1,3,2,0,10,1,116,0,2,58,99,108,97,109,112,0,18,118,0,18,101, +0,1,0,12,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,12,101,100,103,101,48,0,0,1,1,0,12,101, +100,103,101,49,0,0,1,1,0,12,118,0,0,0,1,3,2,0,12,1,116,0,2,58,99,108,97,109,112,0,18,118,0,18,101, 100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49, -0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,11, +0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,10, 0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,9,101,100,103,101,48,0,0,1,1,0,9,101,100,103,101, -49,0,0,1,1,0,11,118,0,0,0,1,3,2,0,11,1,116,0,2,58,99,108,97,109,112,0,18,118,0,18,101,100,103,101, +49,0,0,1,1,0,10,118,0,0,0,1,3,2,0,10,1,116,0,2,58,99,108,97,109,112,0,18,118,0,18,101,100,103,101, 48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0, -0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,12,0,115,109, +0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,11,0,115,109, 111,111,116,104,115,116,101,112,0,1,1,0,9,101,100,103,101,48,0,0,1,1,0,9,101,100,103,101,49,0,0,1, -1,0,12,118,0,0,0,1,3,2,0,12,1,116,0,2,58,99,108,97,109,112,0,18,118,0,18,101,100,103,101,48,0,47, +1,0,11,118,0,0,0,1,3,2,0,11,1,116,0,2,58,99,108,97,109,112,0,18,118,0,18,101,100,103,101,48,0,47, 18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8, -18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,9,0,108,101,110,103, -116,104,0,1,1,0,9,120,0,0,0,1,8,58,97,98,115,0,18,120,0,0,0,0,0,1,0,9,0,108,101,110,103,116,104,0, -1,1,0,10,118,0,0,0,1,3,2,0,9,1,114,0,0,0,3,2,1,9,1,112,0,2,58,100,111,116,0,18,118,0,0,18,118,0,0, -0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,112,0,0,0,4,102,108,111,97,116,95,114,99, -112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,0,1,0,9,0,108,101,110,103,116,104,0, -1,1,0,11,118,0,0,0,1,3,2,0,9,1,114,0,0,0,3,2,1,9,1,112,0,2,58,100,111,116,0,18,118,0,0,18,118,0,0, -0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,112,0,0,0,4,102,108,111,97,116,95,114,99, -112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,0,1,0,9,0,108,101,110,103,116,104,0, -1,1,0,12,118,0,0,0,1,3,2,0,9,1,114,0,0,0,3,2,1,9,1,112,0,2,58,100,111,116,0,18,118,0,0,18,118,0,0, -0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,112,0,0,0,4,102,108,111,97,116,95,114,99, -112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,0,1,0,9,0,100,105,115,116,97,110,99, -101,0,1,1,0,9,120,0,0,1,1,0,9,121,0,0,0,1,3,2,1,9,1,100,0,2,18,120,0,18,121,0,47,0,0,9,18,95,95, -114,101,116,86,97,108,0,58,108,101,110,103,116,104,0,18,100,0,0,0,20,0,0,1,0,9,0,100,105,115,116, -97,110,99,101,0,1,1,0,10,118,0,0,1,1,0,10,117,0,0,0,1,3,2,1,10,1,100,50,0,2,18,118,0,18,117,0,47,0, -0,9,18,95,95,114,101,116,86,97,108,0,58,108,101,110,103,116,104,0,18,100,50,0,0,0,20,0,0,1,0,9,0, -100,105,115,116,97,110,99,101,0,1,1,0,11,118,0,0,1,1,0,11,117,0,0,0,1,3,2,1,11,1,100,51,0,2,18,118, -0,18,117,0,47,0,0,9,18,95,95,114,101,116,86,97,108,0,58,108,101,110,103,116,104,0,18,100,51,0,0,0, -20,0,0,1,0,9,0,100,105,115,116,97,110,99,101,0,1,1,0,12,118,0,0,1,1,0,12,117,0,0,0,1,3,2,1,12,1, -100,52,0,2,18,118,0,18,117,0,47,0,0,9,18,95,95,114,101,116,86,97,108,0,58,108,101,110,103,116,104, -0,18,100,52,0,0,0,20,0,0,1,0,11,0,99,114,111,115,115,0,1,1,0,11,118,0,0,1,1,0,11,117,0,0,0,1,4,118, -101,99,51,95,99,114,111,115,115,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0, -18,117,0,0,0,0,1,0,9,0,102,97,99,101,102,111,114,119,97,114,100,0,1,1,0,9,78,0,0,1,1,0,9,73,0,0,1, -1,0,9,78,114,101,102,0,0,0,1,3,2,1,9,1,100,0,2,58,100,111,116,0,18,78,114,101,102,0,0,18,73,0,0,0, -0,0,3,2,0,9,1,115,0,0,0,4,118,101,99,52,95,115,103,116,0,18,115,0,59,120,0,0,17,48,0,48,0,0,0,18, -100,0,0,0,8,58,109,105,120,0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0,0,1,0,10,0,102,97,99,101,102, -111,114,119,97,114,100,0,1,1,0,10,78,0,0,1,1,0,10,73,0,0,1,1,0,10,78,114,101,102,0,0,0,1,3,2,1,9,1, +18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,12,0,115,109,111,111, +116,104,115,116,101,112,0,1,1,0,9,101,100,103,101,48,0,0,1,1,0,9,101,100,103,101,49,0,0,1,1,0,12, +118,0,0,0,1,3,2,0,12,1,116,0,2,58,99,108,97,109,112,0,18,118,0,18,101,100,103,101,48,0,47,18,101, +100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116, +0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,0,9,0,108,101,110,103,116,104, +0,1,1,0,9,120,0,0,0,1,8,58,97,98,115,0,18,120,0,0,0,0,0,1,0,9,0,108,101,110,103,116,104,0,1,1,0,10, +118,0,0,0,1,3,2,0,9,1,114,0,0,0,3,2,1,9,1,112,0,2,58,100,111,116,0,18,118,0,0,18,118,0,0,0,0,0,4, +102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,112,0,0,0,4,102,108,111,97,116,95,114,99,112,0, +18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,0,1,0,9,0,108,101,110,103,116,104,0,1,1,0, +11,118,0,0,0,1,3,2,0,9,1,114,0,0,0,3,2,1,9,1,112,0,2,58,100,111,116,0,18,118,0,0,18,118,0,0,0,0,0, +4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,112,0,0,0,4,102,108,111,97,116,95,114,99,112,0, +18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,0,1,0,9,0,108,101,110,103,116,104,0,1,1,0, +12,118,0,0,0,1,3,2,0,9,1,114,0,0,0,3,2,1,9,1,112,0,2,58,100,111,116,0,18,118,0,0,18,118,0,0,0,0,0, +4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,112,0,0,0,4,102,108,111,97,116,95,114,99,112,0, +18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,0,1,0,9,0,100,105,115,116,97,110,99,101,0, +1,1,0,9,120,0,0,1,1,0,9,121,0,0,0,1,3,2,1,9,1,100,0,2,18,120,0,18,121,0,47,0,0,9,18,95,95,114,101, +116,86,97,108,0,58,108,101,110,103,116,104,0,18,100,0,0,0,20,0,0,1,0,9,0,100,105,115,116,97,110,99, +101,0,1,1,0,10,118,0,0,1,1,0,10,117,0,0,0,1,3,2,1,10,1,100,50,0,2,18,118,0,18,117,0,47,0,0,9,18,95, +95,114,101,116,86,97,108,0,58,108,101,110,103,116,104,0,18,100,50,0,0,0,20,0,0,1,0,9,0,100,105,115, +116,97,110,99,101,0,1,1,0,11,118,0,0,1,1,0,11,117,0,0,0,1,3,2,1,11,1,100,51,0,2,18,118,0,18,117,0, +47,0,0,9,18,95,95,114,101,116,86,97,108,0,58,108,101,110,103,116,104,0,18,100,51,0,0,0,20,0,0,1,0, +9,0,100,105,115,116,97,110,99,101,0,1,1,0,12,118,0,0,1,1,0,12,117,0,0,0,1,3,2,1,12,1,100,52,0,2,18, +118,0,18,117,0,47,0,0,9,18,95,95,114,101,116,86,97,108,0,58,108,101,110,103,116,104,0,18,100,52,0, +0,0,20,0,0,1,0,11,0,99,114,111,115,115,0,1,1,0,11,118,0,0,1,1,0,11,117,0,0,0,1,4,118,101,99,51,95, +99,114,111,115,115,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,117,0,0,0,0, +1,0,9,0,102,97,99,101,102,111,114,119,97,114,100,0,1,1,0,9,78,0,0,1,1,0,9,73,0,0,1,1,0,9,78,114, +101,102,0,0,0,1,3,2,1,9,1,100,0,2,58,100,111,116,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,0,9,1, +115,0,0,0,4,118,101,99,52,95,115,103,116,0,18,115,0,59,120,0,0,17,48,0,48,0,0,0,18,100,0,0,0,8,58, +109,105,120,0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0,0,1,0,10,0,102,97,99,101,102,111,114,119,97, +114,100,0,1,1,0,10,78,0,0,1,1,0,10,73,0,0,1,1,0,10,78,114,101,102,0,0,0,1,3,2,1,9,1,100,0,2,58,100, +111,116,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,0,9,1,115,0,0,0,4,118,101,99,52,95,115,103,116, +0,18,115,0,59,120,0,0,17,48,0,48,0,0,0,18,100,0,0,0,8,58,109,105,120,0,18,78,0,54,0,18,78,0,0,18, +115,0,0,0,0,0,1,0,11,0,102,97,99,101,102,111,114,119,97,114,100,0,1,1,0,11,78,0,0,1,1,0,11,73,0,0, +1,1,0,11,78,114,101,102,0,0,0,1,3,2,1,9,1,100,0,2,58,100,111,116,0,18,78,114,101,102,0,0,18,73,0,0, +0,0,0,3,2,0,9,1,115,0,0,0,4,118,101,99,52,95,115,103,116,0,18,115,0,59,120,0,0,17,48,0,48,0,0,0,18, +100,0,0,0,8,58,109,105,120,0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0,0,1,0,12,0,102,97,99,101,102, +111,114,119,97,114,100,0,1,1,0,12,78,0,0,1,1,0,12,73,0,0,1,1,0,12,78,114,101,102,0,0,0,1,3,2,1,9,1, 100,0,2,58,100,111,116,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,0,9,1,115,0,0,0,4,118,101,99,52, 95,115,103,116,0,18,115,0,59,120,0,0,17,48,0,48,0,0,0,18,100,0,0,0,8,58,109,105,120,0,18,78,0,54,0, -18,78,0,0,18,115,0,0,0,0,0,1,0,11,0,102,97,99,101,102,111,114,119,97,114,100,0,1,1,0,11,78,0,0,1,1, -0,11,73,0,0,1,1,0,11,78,114,101,102,0,0,0,1,3,2,1,9,1,100,0,2,58,100,111,116,0,18,78,114,101,102,0, -0,18,73,0,0,0,0,0,3,2,0,9,1,115,0,0,0,4,118,101,99,52,95,115,103,116,0,18,115,0,59,120,0,0,17,48,0, -48,0,0,0,18,100,0,0,0,8,58,109,105,120,0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0,0,1,0,12,0,102,97, -99,101,102,111,114,119,97,114,100,0,1,1,0,12,78,0,0,1,1,0,12,73,0,0,1,1,0,12,78,114,101,102,0,0,0, -1,3,2,1,9,1,100,0,2,58,100,111,116,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,0,9,1,115,0,0,0,4, -118,101,99,52,95,115,103,116,0,18,115,0,59,120,0,0,17,48,0,48,0,0,0,18,100,0,0,0,8,58,109,105,120, -0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0,0,1,0,9,0,114,101,102,108,101,99,116,0,1,1,0,9,73,0,0,1,1, -0,9,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0, -0,1,0,10,0,114,101,102,108,101,99,116,0,1,1,0,10,73,0,0,1,1,0,10,78,0,0,0,1,8,18,73,0,17,50,0,48,0, -0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,0,11,0,114,101,102,108,101,99,116, -0,1,1,0,11,73,0,0,1,1,0,11,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0, -0,0,48,18,78,0,48,47,0,0,1,0,12,0,114,101,102,108,101,99,116,0,1,1,0,12,73,0,0,1,1,0,12,78,0,0,0,1, -8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,0,9,0,114, -101,102,114,97,99,116,0,1,1,0,9,73,0,0,1,1,0,9,78,0,0,1,1,0,9,101,116,97,0,0,0,1,3,2,0,9,1,107,0,2, -17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,17,49,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73, -0,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,47,48,47,0,0,10,18,107,0,17,48,0,48,0,0,40,0,8,17, -48,0,48,0,0,0,9,14,0,8,18,101,116,97,0,18,73,0,48,18,101,116,97,0,58,100,111,116,0,18,78,0,0,18,73, -0,0,0,48,58,115,113,114,116,0,18,107,0,0,0,46,18,78,0,48,47,0,0,1,0,10,0,114,101,102,114,97,99,116, -0,1,1,0,10,73,0,0,1,1,0,10,78,0,0,1,1,0,9,101,116,97,0,0,0,1,3,2,0,9,1,107,0,2,17,49,0,48,0,0,18, -101,116,97,0,18,101,116,97,0,48,17,49,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,58,100,111, -116,0,18,78,0,0,18,73,0,0,0,48,47,48,47,0,0,10,18,107,0,17,48,0,48,0,0,40,0,8,17,48,0,48,0,0,0,9, -14,0,8,18,101,116,97,0,18,73,0,48,18,101,116,97,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58,115, -113,114,116,0,18,107,0,0,0,46,18,78,0,48,47,0,0,1,0,11,0,114,101,102,114,97,99,116,0,1,1,0,11,73,0, -0,1,1,0,11,78,0,0,1,1,0,9,101,116,97,0,0,0,1,3,2,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18, -101,116,97,0,48,17,49,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0, -18,73,0,0,0,48,47,48,47,0,0,10,18,107,0,17,48,0,48,0,0,40,0,8,17,48,0,48,0,0,0,9,14,0,8,18,101,116, -97,0,18,73,0,48,18,101,116,97,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18, -107,0,0,0,46,18,78,0,48,47,0,0,1,0,12,0,114,101,102,114,97,99,116,0,1,1,0,12,73,0,0,1,1,0,12,78,0, -0,1,1,0,9,101,116,97,0,0,0,1,3,2,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48, +18,78,0,0,18,115,0,0,0,0,0,1,0,9,0,114,101,102,108,101,99,116,0,1,1,0,9,73,0,0,1,1,0,9,78,0,0,0,1, +8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,0,10,0,114, +101,102,108,101,99,116,0,1,1,0,10,73,0,0,1,1,0,10,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111, +116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,0,11,0,114,101,102,108,101,99,116,0,1,1,0,11,73, +0,0,1,1,0,11,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,18,78,0, +48,47,0,0,1,0,12,0,114,101,102,108,101,99,116,0,1,1,0,12,73,0,0,1,1,0,12,78,0,0,0,1,8,18,73,0,17, +50,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,0,9,0,114,101,102,114,97, +99,116,0,1,1,0,9,73,0,0,1,1,0,9,78,0,0,1,1,0,9,101,116,97,0,0,0,1,3,2,0,9,1,107,0,2,17,49,0,48,0,0, +18,101,116,97,0,18,101,116,97,0,48,17,49,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,58,100, +111,116,0,18,78,0,0,18,73,0,0,0,48,47,48,47,0,0,10,18,107,0,17,48,0,48,0,0,40,0,8,17,48,0,48,0,0,0, +9,14,0,8,18,101,116,97,0,18,73,0,48,18,101,116,97,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58, +115,113,114,116,0,18,107,0,0,0,46,18,78,0,48,47,0,0,1,0,10,0,114,101,102,114,97,99,116,0,1,1,0,10, +73,0,0,1,1,0,10,78,0,0,1,1,0,9,101,116,97,0,0,0,1,3,2,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0, +18,101,116,97,0,48,17,49,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0, +0,18,73,0,0,0,48,47,48,47,0,0,10,18,107,0,17,48,0,48,0,0,40,0,8,17,48,0,48,0,0,0,9,14,0,8,18,101, +116,97,0,18,73,0,48,18,101,116,97,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0, +18,107,0,0,0,46,18,78,0,48,47,0,0,1,0,11,0,114,101,102,114,97,99,116,0,1,1,0,11,73,0,0,1,1,0,11,78, +0,0,1,1,0,9,101,116,97,0,0,0,1,3,2,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48, 17,49,0,48,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,47, 48,47,0,0,10,18,107,0,17,48,0,48,0,0,40,0,8,17,48,0,48,0,0,0,9,14,0,8,18,101,116,97,0,18,73,0,48, 18,101,116,97,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18,107,0,0,0,46,18, -78,0,48,47,0,0,1,0,13,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,13,109,0,0,1, -0,0,13,110,0,0,0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0, -16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,14,0,109,97,116,114,105,120,67,111,109,112,77, -117,108,116,0,1,0,0,14,109,0,0,1,0,0,14,110,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,18, -110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57, -18,110,0,16,10,50,0,57,48,0,0,0,0,1,0,15,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0, -1,0,0,15,109,0,0,1,0,0,15,110,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48, +78,0,48,47,0,0,1,0,12,0,114,101,102,114,97,99,116,0,1,1,0,12,73,0,0,1,1,0,12,78,0,0,1,1,0,9,101, +116,97,0,0,0,1,3,2,0,9,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,17,49,0,48,0,0, +58,100,111,116,0,18,78,0,0,18,73,0,0,0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,47,48,47,0,0,10, +18,107,0,17,48,0,48,0,0,40,0,8,17,48,0,48,0,0,0,9,14,0,8,18,101,116,97,0,18,73,0,48,18,101,116,97, +0,58,100,111,116,0,18,78,0,0,18,73,0,0,0,48,58,115,113,114,116,0,18,107,0,0,0,46,18,78,0,48,47,0,0, +1,0,13,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,13,109,0,0,1,0,0,13,110,0,0, +0,1,8,58,109,97,116,50,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57, +18,110,0,16,10,49,0,57,48,0,0,0,0,1,0,14,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0, +1,0,0,14,109,0,0,1,0,0,14,110,0,0,0,1,8,58,109,97,116,51,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48, 0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10, -50,0,57,48,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,2,0,108,101,115,115,84, -104,97,110,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,4,118,101,99,52,95,115,108,116,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,108,101,115,115,84,104,97,110, -0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86, -97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,108,101,115,115,84,104,97,110,0,1,1, -0,12,117,0,0,1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108, -0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,108,101,115,115,84,104,97,110,0,1,1,0,6,117,0,0,1,1,0,6,118, -0,0,0,1,4,118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0, -0,18,118,0,0,0,0,1,0,3,0,108,101,115,115,84,104,97,110,0,1,1,0,7,117,0,0,1,1,0,7,118,0,0,0,1,4,118, -101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0, -0,0,0,1,0,4,0,108,101,115,115,84,104,97,110,0,1,1,0,8,117,0,0,1,1,0,8,118,0,0,0,1,4,118,101,99,52, -95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,108,101,115, -115,84,104,97,110,69,113,117,97,108,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,4,118,101,99,52,95,115, -108,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,108, -101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99, +50,0,57,48,0,0,0,0,1,0,15,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,15,109,0, +0,1,0,0,15,110,0,0,0,1,8,58,109,97,116,52,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18, +109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0, +18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,48,0,0,0,0,1,0,2,0,108,101,115,115,84,104,97,110,0,1, +1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,4,118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97, +108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,108,101,115,115,84,104,97,110,0,1,1,0,11, +117,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,59, +120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,108,101,115,115,84,104,97,110,0,1,1,0,12,117,0,0, +1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0, +0,18,118,0,0,0,0,1,0,2,0,108,101,115,115,84,104,97,110,0,1,1,0,6,117,0,0,1,1,0,6,118,0,0,0,1,4,118, +101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0, +0,1,0,3,0,108,101,115,115,84,104,97,110,0,1,1,0,7,117,0,0,1,1,0,7,118,0,0,0,1,4,118,101,99,52,95, +115,108,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4, +0,108,101,115,115,84,104,97,110,0,1,1,0,8,117,0,0,1,1,0,8,118,0,0,0,1,4,118,101,99,52,95,115,108, +116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,108,101,115,115,84,104, +97,110,69,113,117,97,108,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0, +18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,108,101,115,115, +84,104,97,110,69,113,117,97,108,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99,52,95,115,108, +101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,108, +101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,4,118,101,99, +52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,108,101, +115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,6,117,0,0,1,1,0,6,118,0,0,0,1,4,118,101,99,52,95, +115,108,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0, +108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,7,117,0,0,1,1,0,7,118,0,0,0,1,4,118,101,99, 52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0, -1,0,4,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,4, +1,0,4,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,8,117,0,0,1,1,0,8,118,0,0,0,1,4, 118,101,99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2, -0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,6,117,0,0,1,1,0,6,118,0,0,0,1,4,118,101, -99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1, -0,3,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,7,117,0,0,1,1,0,7,118,0,0,0,1,4,118, -101,99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0, -0,0,0,1,0,4,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,8,117,0,0,1,1,0,8,118,0,0,0, -1,4,118,101,99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1, -0,2,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,4,118,101, -99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1, -0,3,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,4,118,101, -99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0, -0,1,0,4,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,4,118, -101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0, -103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,6,117,0,0,1,1,0,6,118,0,0,0,1,4,118,101,99,52,95, -115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0, -103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,7,117,0,0,1,1,0,7,118,0,0,0,1,4,118,101,99,52,95, -115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4, -0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,8,117,0,0,1,1,0,8,118,0,0,0,1,4,118,101,99,52, -95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,103,114,101, -97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,4,118,101, -99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1, -0,3,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,11,117,0,0,1,1,0,11,118,0, -0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117, -0,0,18,118,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,12, -117,0,0,1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,0, -18,117,0,0,18,118,0,0,0,0,1,0,2,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1, -0,6,117,0,0,1,1,0,6,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0, -59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,103,114,101,97,116,101,114,84,104,97,110,69,113, -117,97,108,0,1,1,0,7,117,0,0,1,1,0,7,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101, -116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84, -104,97,110,69,113,117,97,108,0,1,1,0,8,117,0,0,1,1,0,8,118,0,0,0,1,4,118,101,99,52,95,115,103,101, -0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,101,113,117,97,108,0,1,1,0, -10,117,0,0,1,1,0,10,118,0,0,0,1,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,117,0,0,18,118,0,0,0,0,1,0,3,0,101,113,117,97,108,0,1,1,0,11,117,0,0,1,1,0,11, -118,0,0,0,1,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,117,0,0,18,118,0,0,0,0,1,0,4,0,101,113,117,97,108,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,4,118, -101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0, -101,113,117,97,108,0,1,1,0,6,117,0,0,1,1,0,6,118,0,0,0,1,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,117,0,0,18,118,0,0,0,0,1,0,3,0,101,113,117,97,108,0,1,1, -0,7,117,0,0,1,1,0,7,118,0,0,0,1,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,117,0,0,18,118,0,0,0,0,1,0,4,0,101,113,117,97,108,0,1,1,0,8,117,0,0,1,1,0,8, -118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118, -0,0,0,0,1,0,2,0,110,111,116,69,113,117,97,108,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,4,118,101,99, -52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0, -3,0,110,111,116,69,113,117,97,108,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99,52,95,115, -110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0, -110,111,116,69,113,117,97,108,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,115,110, -101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,110,111,116,69,113,117, -97,108,0,1,1,0,6,117,0,0,1,1,0,6,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116, -86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,110,111,116,69,113,117,97,108,0,1,1,0, -7,117,0,0,1,1,0,7,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59, -120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,110,111,116,69,113,117,97,108,0,1,1,0,8,117,0,0, -1,1,0,8,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0, -18,118,0,0,0,0,1,0,1,0,97,110,121,0,1,1,0,2,118,0,0,0,1,3,2,0,9,1,115,117,109,0,0,0,4,118,101,99, -52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101, +0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,4,118,101,99,52, +95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0, +103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99,52, +95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0, +4,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,4,118,101,99, +52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,103,114, +101,97,116,101,114,84,104,97,110,0,1,1,0,6,117,0,0,1,1,0,6,118,0,0,0,1,4,118,101,99,52,95,115,103, +116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,103,114, +101,97,116,101,114,84,104,97,110,0,1,1,0,7,117,0,0,1,1,0,7,118,0,0,0,1,4,118,101,99,52,95,115,103, +116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,103, +114,101,97,116,101,114,84,104,97,110,0,1,1,0,8,117,0,0,1,1,0,8,118,0,0,0,1,4,118,101,99,52,95,115, +103,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,103,114,101,97,116, +101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,4,118,101,99,52,95, +115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0, +103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1, +4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18, +118,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,12,117,0,0, +1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0, +0,18,118,0,0,0,0,1,0,2,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,6,117, +0,0,1,1,0,6,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120, +121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97, +108,0,1,1,0,7,117,0,0,1,1,0,7,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86, +97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,103,114,101,97,116,101,114,84,104,97, +110,69,113,117,97,108,0,1,1,0,8,117,0,0,1,1,0,8,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95, +95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,101,113,117,97,108,0,1,1,0,10,117,0, +0,1,1,0,10,118,0,0,0,1,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,117,0,0,18,118,0,0,0,0,1,0,3,0,101,113,117,97,108,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0, +1,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,117,0,0, +18,118,0,0,0,0,1,0,4,0,101,113,117,97,108,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,4,118,101,99,52, +95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,101,113,117, +97,108,0,1,1,0,6,117,0,0,1,1,0,6,118,0,0,0,1,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,117,0,0,18,118,0,0,0,0,1,0,3,0,101,113,117,97,108,0,1,1,0,7,117,0,0, +1,1,0,7,118,0,0,0,1,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,117,0,0,18,118,0,0,0,0,1,0,4,0,101,113,117,97,108,0,1,1,0,8,117,0,0,1,1,0,8,118,0,0,0,1, +4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0, +2,0,110,111,116,69,113,117,97,108,0,1,1,0,10,117,0,0,1,1,0,10,118,0,0,0,1,4,118,101,99,52,95,115, +110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,110, +111,116,69,113,117,97,108,0,1,1,0,11,117,0,0,1,1,0,11,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0, +18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,110,111,116, +69,113,117,97,108,0,1,1,0,12,117,0,0,1,1,0,12,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95, +95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,0,2,0,110,111,116,69,113,117,97,108,0,1,1, +0,6,117,0,0,1,1,0,6,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0, +59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,0,3,0,110,111,116,69,113,117,97,108,0,1,1,0,7,117,0,0,1, +1,0,7,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122, +0,0,18,117,0,0,18,118,0,0,0,0,1,0,4,0,110,111,116,69,113,117,97,108,0,1,1,0,8,117,0,0,1,1,0,8,118, +0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0, +0,0,1,0,1,0,97,110,121,0,1,1,0,2,118,0,0,0,1,3,2,0,9,1,115,117,109,0,0,0,4,118,101,99,52,95,97,100, +100,0,18,115,117,109,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,115, +110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,115,117,109,0,59,120,0,0,17,48,0,48,0,0,0, +0,0,1,0,1,0,97,110,121,0,1,1,0,3,118,0,0,0,1,3,2,0,9,1,115,117,109,0,0,0,4,118,101,99,52,95,97,100, +100,0,18,115,117,109,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,97, +100,100,0,18,115,117,109,0,59,120,0,0,18,115,117,109,0,59,120,0,0,18,118,0,59,122,0,0,0,4,118,101, 99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,115,117,109,0,59,120,0,0,17, -48,0,48,0,0,0,0,0,1,0,1,0,97,110,121,0,1,1,0,3,118,0,0,0,1,3,2,0,9,1,115,117,109,0,0,0,4,118,101, +48,0,48,0,0,0,0,0,1,0,1,0,97,110,121,0,1,1,0,4,118,0,0,0,1,3,2,0,9,1,115,117,109,0,0,0,4,118,101, 99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118, 101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,115,117,109,0,59,120,0,0,18,118,0,59,122, -0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,115,117,109, -0,59,120,0,0,17,48,0,48,0,0,0,0,0,1,0,1,0,97,110,121,0,1,1,0,4,118,0,0,0,1,3,2,0,9,1,115,117,109,0, -0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0,59, -121,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,115,117,109,0,59,120,0,0, -18,118,0,59,122,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,115,117,109,0, -59,120,0,0,18,118,0,59,119,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0, -59,120,0,0,18,115,117,109,0,59,120,0,0,17,48,0,48,0,0,0,0,0,1,0,1,0,97,108,108,0,1,1,0,10,118,0,0, -0,1,3,2,0,9,1,112,114,111,100,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112, -114,111,100,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,115,110,101, -0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,112,114,111,100,0,59,120,0,0,17,48,0,48,0,0,0,0,8, -18,118,0,59,120,0,18,118,0,59,121,0,34,0,0,1,0,1,0,97,108,108,0,1,1,0,3,118,0,0,0,1,3,2,0,9,1,112, -114,111,100,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,59,120, -0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0, -18,112,114,111,100,0,59,120,0,0,18,112,114,111,100,0,59,120,0,0,18,118,0,59,122,0,0,0,4,118,101,99, -52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,112,114,111,100,0,59,120,0,0,17, -48,0,48,0,0,0,0,0,1,0,1,0,97,108,108,0,1,1,0,4,118,0,0,0,1,3,2,0,9,1,112,114,111,100,0,0,0,4,118, -101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,59,120,0,0,18,118,0,59,120,0,0, -18,118,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,59, -120,0,0,18,112,114,111,100,0,59,120,0,0,18,118,0,59,122,0,0,0,4,118,101,99,52,95,109,117,108,116, -105,112,108,121,0,18,112,114,111,100,0,59,120,0,0,18,112,114,111,100,0,59,120,0,0,18,118,0,59,119, -0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,112,114,111, -100,0,59,120,0,0,17,48,0,48,0,0,0,0,0,1,0,2,0,110,111,116,0,1,1,0,2,118,0,0,0,1,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,118,0,0,17,48,0,48,0,0,0,0,0,1,0, -3,0,110,111,116,0,1,1,0,3,118,0,0,0,1,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,118,0,0,17,48,0,48,0,0,0,0,0,1,0,4,0,110,111,116,0,1,1,0,4,118,0,0,0,1, -4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,17,48,0,48,0,0,0,0, -0,1,0,12,0,116,101,120,116,117,114,101,49,68,0,1,1,0,16,115,97,109,112,108,101,114,0,0,1,1,0,9,99, -111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,49,100,0,18,95,95,114,101,116,86,97,108,0,0, -18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114, -101,49,68,80,114,111,106,0,1,1,0,16,115,97,109,112,108,101,114,0,0,1,1,0,10,99,111,111,114,100,0,0, -0,1,4,118,101,99,52,95,116,101,120,112,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109, -112,108,101,114,0,0,18,99,111,111,114,100,0,59,120,121,121,121,0,0,0,0,1,0,12,0,116,101,120,116, -117,114,101,49,68,80,114,111,106,0,1,1,0,16,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114, -100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115, -97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50, -68,0,1,1,0,17,115,97,109,112,108,101,114,0,0,1,1,0,10,99,111,111,114,100,0,0,0,1,4,118,101,99,52, -95,116,101,120,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99, -111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,1,0,17,115, -97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112, -50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114, -100,0,59,120,121,122,122,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,1,0, -17,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101, +0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,115,117,109,0,59,120,0,0,18, +118,0,59,119,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18, +115,117,109,0,59,120,0,0,17,48,0,48,0,0,0,0,0,1,0,1,0,97,108,108,0,1,1,0,10,118,0,0,0,1,3,2,0,9,1, +112,114,111,100,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,59, +120,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114, +101,116,86,97,108,0,59,120,0,0,18,112,114,111,100,0,59,120,0,0,17,48,0,48,0,0,0,0,8,18,118,0,59, +120,0,18,118,0,59,121,0,34,0,0,1,0,1,0,97,108,108,0,1,1,0,3,118,0,0,0,1,3,2,0,9,1,112,114,111,100, +0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,59,120,0,0,18,118, +0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114, +111,100,0,59,120,0,0,18,112,114,111,100,0,59,120,0,0,18,118,0,59,122,0,0,0,4,118,101,99,52,95,115, +110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,112,114,111,100,0,59,120,0,0,17,48,0,48,0, +0,0,0,0,1,0,1,0,97,108,108,0,1,1,0,4,118,0,0,0,1,3,2,0,9,1,112,114,111,100,0,0,0,4,118,101,99,52, +95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0, +59,121,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,59,120,0,0, +18,112,114,111,100,0,59,120,0,0,18,118,0,59,122,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112, +108,121,0,18,112,114,111,100,0,59,120,0,0,18,112,114,111,100,0,59,120,0,0,18,118,0,59,119,0,0,0,4, +118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,112,114,111,100,0,59, +120,0,0,17,48,0,48,0,0,0,0,0,1,0,2,0,110,111,116,0,1,1,0,2,118,0,0,0,1,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,118,0,0,17,48,0,48,0,0,0,0,0,1,0,3,0,110, +111,116,0,1,1,0,3,118,0,0,0,1,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,118,0,0,17,48,0,48,0,0,0,0,0,1,0,4,0,110,111,116,0,1,1,0,4,118,0,0,0,1,4,118, +101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,0, +12,0,116,101,120,116,117,114,101,49,68,0,1,1,0,16,115,97,109,112,108,101,114,0,0,1,1,0,9,99,111, +111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18, +115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101, +49,68,80,114,111,106,0,1,1,0,16,115,97,109,112,108,101,114,0,0,1,1,0,10,99,111,111,114,100,0,0,0,1, +4,118,101,99,52,95,116,101,120,112,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112, +108,101,114,0,0,18,99,111,111,114,100,0,59,120,121,121,121,0,0,0,0,1,0,12,0,116,101,120,116,117, +114,101,49,68,80,114,111,106,0,1,1,0,16,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100, +0,0,0,1,4,118,101,99,52,95,116,101,120,112,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97, +109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,0, +1,1,0,17,115,97,109,112,108,101,114,0,0,1,1,0,10,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116, +101,120,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111, +111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,1,0,17,115,97, +109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,50, +100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0, +59,120,121,122,122,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,1,0,17, +115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120, +112,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111, +114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,0,1,1,0,18,115,97,109,112,108,101,114,0, +0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,51,100,0,18,95,95,114,101,116, +86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120, +116,117,114,101,51,68,80,114,111,106,0,1,1,0,18,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111, +114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,51,100,0,18,95,95,114,101,116,86,97,108,0,0,18, +115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101, +67,117,98,101,0,1,1,0,19,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118, +101,99,52,95,116,101,120,99,117,98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108, +101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,0,1,1,0,20,115,97, +109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,49,100, +0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0, +0,1,0,12,0,115,104,97,100,111,119,49,68,80,114,111,106,0,1,1,0,20,115,97,109,112,108,101,114,0,0,1, +1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,49,100,0,18,95,95,114,101,116, +86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97, +100,111,119,50,68,0,1,1,0,21,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4, +118,101,99,52,95,116,101,120,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, +114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,1,0, +21,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101, 120,112,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111, -111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,0,1,1,0,18,115,97,109,112,108,101, -114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,51,100,0,18,95,95,114, -101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116, -101,120,116,117,114,101,51,68,80,114,111,106,0,1,1,0,18,115,97,109,112,108,101,114,0,0,1,1,0,12,99, -111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,51,100,0,18,95,95,114,101,116,86,97,108, -0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117, -114,101,67,117,98,101,0,1,1,0,19,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0, -1,4,118,101,99,52,95,116,101,120,99,117,98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109, -112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,0,1,1,0,20, -115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120, -49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114, -100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,80,114,111,106,0,1,1,0,20,115,97,109,112,108,101, -114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,49,100,0,18,95,95, -114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0, -115,104,97,100,111,119,50,68,0,1,1,0,21,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100, -0,0,0,1,4,118,101,99,52,95,116,101,120,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109, -112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,80,114,111, -106,0,1,1,0,21,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99,52, -95,116,101,120,112,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0, -18,99,111,111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,82,101,99,116,0,1,1,0,22, -115,97,109,112,108,101,114,0,0,1,1,0,10,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120, +111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,82,101,99,116,0,1,1,0,22,115,97,109, +112,108,101,114,0,0,1,1,0,10,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,114,101, +99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114, +100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,82,101,99,116,80,114,111,106,0,1,1,0,22,115, +97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112, 95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111, -111,114,100,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,82,101,99,116,80,114,111,106,0,1,1, -0,22,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101, -120,112,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0, -18,99,111,111,114,100,0,59,120,121,122,122,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,82, -101,99,116,80,114,111,106,0,1,1,0,22,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0, -0,0,1,4,118,101,99,52,95,116,101,120,112,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18, -115,97,109,112,108,101,114,0,0,18,99,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50, -68,82,101,99,116,0,1,1,0,23,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4, -118,101,99,52,95,116,101,120,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109, -112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,82,101,99, -116,80,114,111,106,0,1,1,0,23,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4, -118,101,99,52,95,116,101,120,112,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97, -109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,1,0,9,120, -0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,49,0,18,95,95,114,101,116,86,97,108,0,0,18,120, -0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,1,0,10,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105, -115,101,50,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1, -1,0,11,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,51,0,18,95,95,114,101,116,86,97,108, -0,0,18,120,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,1,0,12,120,0,0,0,1,4,102,108,111,97,116,95, -110,111,105,115,101,52,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,10,0,110,111,105, -115,101,50,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115, -101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0, -18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,10,120,0,0,0,1, -9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95, -95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,49, -57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,11, -120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101, -99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,0,1,0,10,0, -110,111,105,115,101,50,0,1,1,0,12,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, -111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105, -115,101,49,0,18,120,0,58,118,101,99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51, -0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1,1,0,9,120,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,17,53,0,52, -55,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1,1,0,10,120,0,0,0,1,9,18,95,95,114,101,116, +111,114,100,0,59,120,121,122,122,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,82,101,99,116, +80,114,111,106,0,1,1,0,22,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118, +101,99,52,95,116,101,120,112,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109, +112,108,101,114,0,0,18,99,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,82,101, +99,116,0,1,1,0,23,115,97,109,112,108,101,114,0,0,1,1,0,11,99,111,111,114,100,0,0,0,1,4,118,101,99, +52,95,116,101,120,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, +114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,82,101,99,116,80,114, +111,106,0,1,1,0,23,115,97,109,112,108,101,114,0,0,1,1,0,12,99,111,111,114,100,0,0,0,1,4,118,101,99, +52,95,116,101,120,112,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108, +101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,1,0,9,120,0,0,0,1,4, +102,108,111,97,116,95,110,111,105,115,101,49,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1, +0,9,0,110,111,105,115,101,49,0,1,1,0,10,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,50, +0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,1,0,11,120, +0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,51,0,18,95,95,114,101,116,86,97,108,0,0,18,120, +0,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,1,0,12,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105, +115,101,52,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,0,10,0,110,111,105,115,101,50,0,1, +1,0,9,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0, +0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57, +0,51,52,0,0,46,0,0,20,0,0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,10,120,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116, +86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,57,0,51,52,0,0, +0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,0,1,0,10,0,110,111,105,115,101,50,0,1,1,0,11,120,0,0,0,1,9,18, +95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57, +0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,0,1,0,10,0,110,111,105,115,101, +50,0,1,1,0,12,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0, +18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0, +58,118,101,99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0, +0,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105,115,101,51,0,1,1,0,9,120,0,0,0,1,9,18,95,95,114,101,116, 86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,57,0,51,52,0,0,0,17, -55,0,54,54,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101, -49,0,18,120,0,58,118,101,99,50,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,20,0,0,1,0,11, -0,110,111,105,115,101,51,0,1,1,0,11,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, -111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105, -115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51, -0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120, -0,58,118,101,99,51,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,20, -0,0,1,0,11,0,110,111,105,115,101,51,0,1,1,0,12,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59, +108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,17,53,0,52,55,0,0,46,0,0,20, +0,0,1,0,11,0,110,111,105,115,101,51,0,1,1,0,10,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59, 120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58, -110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17, -51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58, -110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17, -49,49,0,48,52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0, -9,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0, -51,52,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18, -120,0,17,53,0,52,55,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115, -101,49,0,18,120,0,17,50,51,0,53,52,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0,10, -120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101, -99,50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108, -0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,53,0,52,55,0,0,0,17,49,55,0, -56,53,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0, -18,120,0,58,118,101,99,50,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,0,46,0,0,20,0,0,1,0,12,0, -110,111,105,115,101,52,0,1,1,0,11,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, -111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105, -115,101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51, -0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120, -0,58,118,101,99,51,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,20, -0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99, -51,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,0,46,0,0,20,0,0,1,0,12,0, -110,111,105,115,101,52,0,1,1,0,12,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, +110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0, +46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58, +118,101,99,50,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,20,0,0,1,0,11,0,110,111,105, +115,101,51,0,1,1,0,11,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115, +101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0, +18,120,0,58,118,101,99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0, +0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101, +99,51,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,20,0,0,1,0,11,0, +110,111,105,115,101,51,0,1,1,0,12,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, 111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105, 115,101,49,0,18,120,0,58,118,101,99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51, 0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105, 115,101,49,0,18,120,0,58,118,101,99,52,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48, -52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110, -111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17, -51,49,0,57,49,0,0,0,17,51,55,0,52,56,0,0,0,0,46,0,0,20,0,0,0 +52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0,9,120,0,0, +0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18, +95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0, +46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,17,53, +0,52,55,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,18, +120,0,17,50,51,0,53,52,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101,52,0,1,1,0,10,120,0,0,0,1,9, +18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,18,120,0,0,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,57, +0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110, +111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0, +0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101, +99,50,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101, +52,0,1,1,0,11,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0, +18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0, +58,118,101,99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,9, +18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0, +17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101, +116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,51,0,17,50,51,0,53,52, +0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,0,46,0,0,20,0,0,1,0,12,0,110,111,105,115,101, +52,0,1,1,0,12,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0, +18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,18,120,0, +58,118,101,99,52,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0, +0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,18,120,0, +58,118,101,99,52,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49, +57,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,18, +120,0,58,118,101,99,52,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,17, +51,55,0,52,56,0,0,0,0,46,0,0,20,0,0,0 -- cgit v1.2.3 From 3dec7c57b0159a4d8fbb980de73264ef8b8a3720 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 10 May 2007 16:14:10 -0600 Subject: document exp(), mod() fixes --- docs/relnotes-7.0.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/relnotes-7.0.html b/docs/relnotes-7.0.html index 51f0812538b..f329134bab0 100644 --- a/docs/relnotes-7.0.html +++ b/docs/relnotes-7.0.html @@ -30,6 +30,8 @@ TBD
    • Fixed a few fog-related bugs.
    • Fixed broken GLSL mix() function. +
    • Fixed broken GLSL exp() functions. +
    • Fixed GLSL mod4(vec4, vec4) bug.
    • Implemented GLSL asin(), acos(), atan() functions.
    • Fixed an R300 driver bug that caused Xorg composite manager to crash
    • Fixed R300 vertex program/matrix bug (10848) -- cgit v1.2.3 From aed53ba525e4a105a5e817786fa6346d64ad81a6 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 10 May 2007 17:30:44 -0600 Subject: re-indent some code --- src/mesa/main/image.c | 116 +++++++++++++++++++++++++++----------------------- 1 file changed, 62 insertions(+), 54 deletions(-) diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 2220e39f7d7..8f890b57d6c 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.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. * @@ -4263,60 +4263,68 @@ _mesa_unpack_image( GLuint dimensions, const GLvoid *src = _mesa_image_address(dimensions, unpack, pixels, width, height, format, type, img, row, 0); - if ((type == GL_BITMAP) && (unpack->SkipPixels & 0x7)) { - GLint i; - flipBytes = GL_FALSE; - if (unpack->LsbFirst) { - GLubyte srcMask = 1 << (unpack->SkipPixels & 0x7); - GLubyte dstMask = 128; - const GLubyte *s = src; - GLubyte *d = dst; - *d = 0; - for (i = 0; i < width; i++) { - if (*s & srcMask) { - *d |= dstMask; - } - if (srcMask == 128) { - srcMask = 1; - s++; - } else { - srcMask = srcMask << 1; - } - if (dstMask == 1) { - dstMask = 128; - d++; - *d = 0; - } else { - dstMask = dstMask >> 1; - } - } - } else { - GLubyte srcMask = 128 >> (unpack->SkipPixels & 0x7); - GLubyte dstMask = 128; - const GLubyte *s = src; - GLubyte *d = dst; + if ((type == GL_BITMAP) && (unpack->SkipPixels & 0x7)) { + GLint i; + flipBytes = GL_FALSE; + if (unpack->LsbFirst) { + GLubyte srcMask = 1 << (unpack->SkipPixels & 0x7); + GLubyte dstMask = 128; + const GLubyte *s = src; + GLubyte *d = dst; + *d = 0; + for (i = 0; i < width; i++) { + if (*s & srcMask) { + *d |= dstMask; + } + if (srcMask == 128) { + srcMask = 1; + s++; + } + else { + srcMask = srcMask << 1; + } + if (dstMask == 1) { + dstMask = 128; + d++; + *d = 0; + } + else { + dstMask = dstMask >> 1; + } + } + } + else { + GLubyte srcMask = 128 >> (unpack->SkipPixels & 0x7); + GLubyte dstMask = 128; + const GLubyte *s = src; + GLubyte *d = dst; + *d = 0; + for (i = 0; i < width; i++) { + if (*s & srcMask) { + *d |= dstMask; + } + if (srcMask == 1) { + srcMask = 128; + s++; + } + else { + srcMask = srcMask >> 1; + } + if (dstMask == 1) { + dstMask = 128; + d++; *d = 0; - for (i = 0; i < width; i++) { - if (*s & srcMask) { - *d |= dstMask; - } - if (srcMask == 1) { - srcMask = 128; - s++; - } else { - srcMask = srcMask >> 1; - } - if (dstMask == 1) { - dstMask = 128; - d++; - *d = 0; - } else { - dstMask = dstMask >> 1; - } - } - } - } else - _mesa_memcpy(dst, src, bytesPerRow); + } + else { + dstMask = dstMask >> 1; + } + } + } + } + else { + _mesa_memcpy(dst, src, bytesPerRow); + } + /* byte flipping/swapping */ if (flipBytes) { flip_bytes((GLubyte *) dst, bytesPerRow); -- cgit v1.2.3 From f0707c789a4c8f02b9b9f51012bd41691779e166 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 10 May 2007 17:33:14 -0600 Subject: more indentation fixes, remove 'register' keywords --- src/mesa/main/image.c | 55 ++++++++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 8f890b57d6c..caaf2816571 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -64,27 +64,27 @@ */ static GLboolean _mesa_type_is_packed(GLenum type) - { - switch (type) { - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: - case GL_UNSIGNED_SHORT_4_4_4_4: - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - case GL_UNSIGNED_SHORT_5_5_5_1: - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_INT_10_10_10_2: - case GL_UNSIGNED_INT_2_10_10_10_REV: - case GL_UNSIGNED_SHORT_8_8_MESA: - case GL_UNSIGNED_SHORT_8_8_REV_MESA: - case GL_UNSIGNED_INT_24_8_EXT: - return GL_TRUE; - } +{ + switch (type) { + case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_2_3_3_REV: + case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5_REV: + case GL_UNSIGNED_SHORT_4_4_4_4: + case GL_UNSIGNED_SHORT_4_4_4_4_REV: + case GL_UNSIGNED_SHORT_5_5_5_1: + case GL_UNSIGNED_SHORT_1_5_5_5_REV: + case GL_UNSIGNED_INT_8_8_8_8: + case GL_UNSIGNED_INT_8_8_8_8_REV: + case GL_UNSIGNED_INT_10_10_10_2: + case GL_UNSIGNED_INT_2_10_10_10_REV: + case GL_UNSIGNED_SHORT_8_8_MESA: + case GL_UNSIGNED_SHORT_8_8_REV_MESA: + case GL_UNSIGNED_INT_24_8_EXT: + return GL_TRUE; + } - return GL_FALSE; + return GL_FALSE; } /** @@ -103,9 +103,8 @@ _mesa_type_is_packed(GLenum type) static void flip_bytes( GLubyte *p, GLuint n ) { - register GLuint i, a, b; - - for (i=0;i> 8) | ((p[i] << 8) & 0xff00); } } @@ -144,9 +142,8 @@ _mesa_swap2( GLushort *p, GLuint n ) void _mesa_swap4( GLuint *p, GLuint n ) { - register GLuint i, a, b; - - for (i=0;i> 24) | ((b >> 8) & 0xff00) -- cgit v1.2.3 From 86e4f52f3c0f79592c49f7fb4182b500b15431d7 Mon Sep 17 00:00:00 2001 From: Patrick Baggett Date: Fri, 11 May 2007 08:19:33 -0600 Subject: Fix some bugs related to loop counters and conditional branching. --- src/mesa/x86/3dnow_normal.S | 48 ++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/mesa/x86/3dnow_normal.S b/src/mesa/x86/3dnow_normal.S index 4345c1b574e..f3bbcb27b7f 100644 --- a/src/mesa/x86/3dnow_normal.S +++ b/src/mesa/x86/3dnow_normal.S @@ -129,8 +129,8 @@ LLBL (G3TN_transform): PREFETCH ( REGIND(EDX) ) MOVD ( MM1, REGOFF(-8, EAX) ) /* write r2 */ - DEC_L ( EBP ) /* decrement normal counter */ - JA ( LLBL (G3TN_transform) ) + SUB_L ( CONST(1), EBP ) /* decrement normal counter */ + JNZ ( LLBL (G3TN_transform) ) POP_L ( EDX ) /* end of transform --- */ @@ -164,9 +164,9 @@ LLBL (G3TN_norm_w_lengths): MOVD ( MM1, REGOFF(8, EAX) ) /* write new x2 */ ADD_L ( CONST(16), EAX ) /* next r */ - DEC_L ( EBP ) /* decrement normal counter */ + SUB_L ( CONST(1), EBP ) /* decrement normal counter */ - JA ( LLBL (G3TN_norm_w_lengths) ) + JNZ ( LLBL (G3TN_norm_w_lengths) ) JMP ( LLBL (G3TN_exit_3dnow) ) ALIGNTEXT32 @@ -192,7 +192,7 @@ LLBL (G3TN_norm): MOVQ ( MM5, MM4 ) PUNPCKLDQ ( MM3, MM3 ) - DEC_L ( EBP ) /* decrement normal counter */ + SUB_L ( CONST(1), EBP ) /* decrement normal counter */ PFMUL ( MM5, MM5 ) PFRSQIT1 ( MM3, MM5 ) @@ -204,7 +204,7 @@ LLBL (G3TN_norm): PFMUL ( MM5, MM1 ) /* | x2 (normalize*/ MOVD ( MM1, REGOFF(-8, EAX) ) /* write new x2 */ - JA ( LLBL (G3TN_norm) ) + JNZ ( LLBL (G3TN_norm) ) LLBL (G3TN_exit_3dnow): FEMMS @@ -289,13 +289,13 @@ LLBL (G3TNNR_norm_w_lengths): /* use precalculated lengths */ ADD_L ( CONST(4), EDI ) /* next length */ PFMUL ( MM3, MM6 ) /* x1 (normalized) | x0 (normalized) */ - DEC_L ( EBP ) /* decrement normal counter */ + SUB_L ( CONST(1), EBP ) /* decrement normal counter */ MOVQ ( MM6, REGOFF(-16, EAX) ) /* write r0, r1 */ MOVD ( MM7, REGOFF(-8, EAX) ) /* write r2 */ MOVD ( REGIND(EDI), MM3 ) /* | length (x) */ - JA ( LLBL (G3TNNR_norm_w_lengths) ) + JNZ ( LLBL (G3TNNR_norm_w_lengths) ) JMP ( LLBL (G3TNNR_exit_3dnow) ) ALIGNTEXT32 @@ -331,7 +331,7 @@ LLBL (G3TNNR_norm): /* need to calculate lengths */ PFMUL ( MM5, MM5 ) PFRSQIT1 ( MM3, MM5 ) - DEC_L ( EBP ) /* decrement normal counter */ + SUB_L ( CONST(1), EBP ) /* decrement normal counter */ PFRCPIT2 ( MM4, MM5 ) PFMUL ( MM5, MM6 ) /* x1 (normalized) | x0 (normalized) */ @@ -340,7 +340,7 @@ LLBL (G3TNNR_norm): /* need to calculate lengths */ PFMUL ( MM5, MM7 ) /* | x2 (normalized) */ MOVD ( MM7, REGOFF(-8, EAX) ) /* write r2 */ - JA ( LLBL (G3TNNR_norm) ) + JNZ ( LLBL (G3TNNR_norm) ) LLBL (G3TNNR_exit_3dnow): @@ -411,11 +411,11 @@ LLBL (G3TRNR_rescale): PFMUL ( MM2, MM5 ) /* | x2*m10 */ ADD_L ( CONST(16), EAX ) /* next r */ - DEC_L ( EBP ) /* decrement normal counter */ + SUB_L ( CONST(1), EBP ) /* decrement normal counter */ MOVQ ( MM4, REGOFF(-16, EAX) ) /* write r0, r1 */ MOVD ( MM5, REGOFF(-8, EAX) ) /* write r2 */ - JA ( LLBL (G3TRNR_rescale) ) /* cnt > 0 ? -> process next normal */ + JNZ ( LLBL (G3TRNR_rescale) ) /* cnt > 0 ? -> process next normal */ FEMMS @@ -511,8 +511,8 @@ LLBL (G3TR_rescale): PFADD ( MM2, MM1 ) /* *not used* | x0*m8+x1*m9+x2*m10 */ MOVD ( MM1, REGOFF(-8, EAX) ) /* write r2 */ - DEC_L ( EDI ) /* decrement normal counter */ - JA ( LLBL (G3TR_rescale) ) + SUB_L ( CONST(1), EDI ) /* decrement normal counter */ + JNZ ( LLBL (G3TR_rescale) ) FEMMS @@ -574,11 +574,11 @@ LLBL (G3TNR_transform): PFMUL ( MM2, MM5 ) /* | x2*m10 */ ADD_L ( CONST(16), EAX ) /* next r */ - DEC_L ( EDI ) /* decrement normal counter */ + SUB_L ( CONST(1), EDI ) /* decrement normal counter */ MOVQ ( MM4, REGOFF(-16, EAX) ) /* write r0, r1 */ MOVD ( MM5, REGOFF(-8, EAX) ) /* write r2 */ - JA ( LLBL (G3TNR_transform) ) + JNZ ( LLBL (G3TNR_transform) ) FEMMS @@ -663,9 +663,9 @@ LLBL (G3T_transform): PFADD ( MM2, MM1 ) /* *not used* | x0*m8+x1*m9+x2*m10 */ MOVD ( MM1, REGOFF(-8, EAX) ) /* write r2 */ - DEC_L ( EDI ) /* decrement normal counter */ + SUB_L ( CONST(1), EDI ) /* decrement normal counter */ - JA ( LLBL (G3T_transform) ) + JNZ ( LLBL (G3T_transform) ) FEMMS @@ -730,9 +730,9 @@ LLBL (G3N_norm1): /* use precalculated lengths */ ADD_L ( CONST(16), EAX ) /* next r */ ADD_L ( CONST(4), EDX ) /* next length */ - DEC_L ( EBP ) /* decrement normal counter */ + SUB_L ( CONST(1), EBP ) /* decrement normal counter */ - JA ( LLBL (G3N_norm1) ) + JNZ ( LLBL (G3N_norm1) ) JMP ( LLBL (G3N_end1) ) @@ -765,7 +765,7 @@ LLBL (G3N_norm2): /* need to calculate lengths */ PFMUL ( MM5, MM5 ) PFRSQIT1 ( MM3, MM5 ) - DEC_L ( EBP ) /* decrement normal counter */ + SUB_L ( CONST(1), EBP ) /* decrement normal counter */ PFRCPIT2 ( MM4, MM5 ) @@ -775,7 +775,7 @@ LLBL (G3N_norm2): /* need to calculate lengths */ PFMUL ( MM5, MM1 ) /* | x2 (normalized) */ MOVD ( MM1, REGOFF(-8, EAX) ) /* write new x2 */ - JA ( LLBL (G3N_norm2) ) + JNZ ( LLBL (G3N_norm2) ) LLBL (G3N_end1): FEMMS @@ -835,8 +835,8 @@ LLBL (G3R_rescale): MOVQ ( MM1, REGOFF(-16, EAX) ) /* write r0, r1 */ MOVD ( MM2, REGOFF(-8, EAX) ) /* write r2 */ - DEC_L ( EDX ) /* decrement normal counter */ - JA ( LLBL (G3R_rescale) ) + SUB_L ( CONST(1), EDX ) /* decrement normal counter */ + JNZ ( LLBL (G3R_rescale) ) FEMMS -- cgit v1.2.3 From 6c342ad8593c3b2fe5162aeb2db8c309c15b2faf Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 11 May 2007 08:39:18 -0600 Subject: When feeding back texcoords, don't divide by W. See bug 10913. --- src/mesa/swrast/s_feedback.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/mesa/swrast/s_feedback.c b/src/mesa/swrast/s_feedback.c index 5d3fbdfeb6e..32a5d3df713 100644 --- a/src/mesa/swrast/s_feedback.c +++ b/src/mesa/swrast/s_feedback.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.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"), @@ -48,7 +48,6 @@ static void feedback_vertex( GLcontext *ctx, { GLfloat win[4]; GLfloat color[4]; - GLfloat tc[4]; const GLfloat *vtc = v->attrib[FRAG_ATTRIB_TEX0]; win[0] = v->win[0]; @@ -61,18 +60,7 @@ static void feedback_vertex( GLcontext *ctx, color[2] = CHAN_TO_FLOAT(pv->color[2]); color[3] = CHAN_TO_FLOAT(pv->color[3]); - if (vtc[3] != 1.0 && vtc[3] != 0.0) { - GLfloat invq = 1.0F / vtc[3]; - tc[0] = vtc[0] * invq; - tc[1] = vtc[1] * invq; - tc[2] = vtc[2] * invq; - tc[3] = vtc[3]; - } - else { - COPY_4V(tc, vtc); - } - - _mesa_feedback_vertex( ctx, win, color, (GLfloat) v->index, tc ); + _mesa_feedback_vertex( ctx, win, color, (GLfloat) v->index, vtc ); } -- cgit v1.2.3 From c33c00764c64f63ae71b4bb5264f9796d5762495 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 11 May 2007 08:41:34 -0600 Subject: Remove unused FB_* tokens, re-indent code. --- src/mesa/swrast/s_feedback.c | 96 +++++++++++++++++++++----------------------- 1 file changed, 46 insertions(+), 50 deletions(-) diff --git a/src/mesa/swrast/s_feedback.c b/src/mesa/swrast/s_feedback.c index 32a5d3df713..3a15d0c3675 100644 --- a/src/mesa/swrast/s_feedback.c +++ b/src/mesa/swrast/s_feedback.c @@ -34,17 +34,9 @@ #include "s_triangle.h" -#define FB_3D 0x01 -#define FB_4D 0x02 -#define FB_INDEX 0x04 -#define FB_COLOR 0x08 -#define FB_TEXTURE 0X10 - - - -static void feedback_vertex( GLcontext *ctx, - const SWvertex *v, const SWvertex *pv ) +static void +feedback_vertex(GLcontext * ctx, const SWvertex * v, const SWvertex * pv) { GLfloat win[4]; GLfloat color[4]; @@ -60,89 +52,93 @@ static void feedback_vertex( GLcontext *ctx, 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, (GLfloat) v->index, vtc); } /* * Put triangle in feedback buffer. */ -void _swrast_feedback_triangle( GLcontext *ctx, - const SWvertex *v0, - const SWvertex *v1, - const SWvertex *v2) +void +_swrast_feedback_triangle(GLcontext *ctx, const SWvertex *v0, + const SWvertex *v1, const SWvertex *v2) { - if (_swrast_culltriangle( ctx, v0, v1, v2 )) { - FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_POLYGON_TOKEN ); - FEEDBACK_TOKEN( ctx, (GLfloat) 3 ); /* three vertices */ + if (_swrast_culltriangle(ctx, v0, v1, v2)) { + FEEDBACK_TOKEN(ctx, (GLfloat) (GLint) GL_POLYGON_TOKEN); + FEEDBACK_TOKEN(ctx, (GLfloat) 3); /* three vertices */ if (ctx->Light.ShadeModel == GL_SMOOTH) { - feedback_vertex( ctx, v0, v0 ); - feedback_vertex( ctx, v1, v1 ); - feedback_vertex( ctx, v2, v2 ); - } else { - feedback_vertex( ctx, v0, v2 ); - feedback_vertex( ctx, v1, v2 ); - feedback_vertex( ctx, v2, v2 ); + feedback_vertex(ctx, v0, v0); + feedback_vertex(ctx, v1, v1); + feedback_vertex(ctx, v2, v2); + } + else { + feedback_vertex(ctx, v0, v2); + feedback_vertex(ctx, v1, v2); + feedback_vertex(ctx, v2, v2); } } } -void _swrast_feedback_line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 ) +void +_swrast_feedback_line(GLcontext *ctx, const SWvertex *v0, + const SWvertex *v1) { GLenum token = GL_LINE_TOKEN; SWcontext *swrast = SWRAST_CONTEXT(ctx); - if (swrast->StippleCounter==0) + if (swrast->StippleCounter == 0) token = GL_LINE_RESET_TOKEN; - FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) token ); + FEEDBACK_TOKEN(ctx, (GLfloat) (GLint) token); if (ctx->Light.ShadeModel == GL_SMOOTH) { - feedback_vertex( ctx, v0, v0 ); - feedback_vertex( ctx, v1, v1 ); - } else { - feedback_vertex( ctx, v0, v1 ); - feedback_vertex( ctx, v1, v1 ); + feedback_vertex(ctx, v0, v0); + feedback_vertex(ctx, v1, v1); + } + else { + feedback_vertex(ctx, v0, v1); + feedback_vertex(ctx, v1, v1); } swrast->StippleCounter++; } -void _swrast_feedback_point( GLcontext *ctx, const SWvertex *v ) +void +_swrast_feedback_point(GLcontext *ctx, const SWvertex *v) { - FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_POINT_TOKEN ); - feedback_vertex( ctx, v, v ); + FEEDBACK_TOKEN(ctx, (GLfloat) (GLint) GL_POINT_TOKEN); + feedback_vertex(ctx, v, v); } -void _swrast_select_triangle( GLcontext *ctx, - const SWvertex *v0, - const SWvertex *v1, - const SWvertex *v2) +void +_swrast_select_triangle(GLcontext *ctx, const SWvertex *v0, + const SWvertex *v1, const SWvertex *v2) { - if (_swrast_culltriangle( ctx, v0, v1, v2 )) { + 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->win[2] * zs); + _mesa_update_hitflag(ctx, v1->win[2] * zs); + _mesa_update_hitflag(ctx, v2->win[2] * zs); } } -void _swrast_select_line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 ) +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->win[2] * zs); + _mesa_update_hitflag(ctx, v1->win[2] * zs); } -void _swrast_select_point( GLcontext *ctx, const SWvertex *v ) +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->win[2] * zs); } -- cgit v1.2.3 From b63c70666fe3187ac17024f29ff7c2c49849c1e0 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 17:07:09 +0000 Subject: r300: Renamed r300_maos.c to r300_emit.c; it contains mostly emit code now. --- src/mesa/drivers/dri/r300/Makefile | 2 +- src/mesa/drivers/dri/r300/r300_context.c | 2 +- src/mesa/drivers/dri/r300/r300_emit.c | 636 +++++++++++++++++++++++++++++++ src/mesa/drivers/dri/r300/r300_emit.h | 8 + src/mesa/drivers/dri/r300/r300_maos.c | 636 ------------------------------- src/mesa/drivers/dri/r300/r300_maos.h | 48 --- src/mesa/drivers/dri/r300/r300_render.c | 1 - src/mesa/drivers/dri/r300/r300_state.c | 1 - 8 files changed, 646 insertions(+), 688 deletions(-) create mode 100644 src/mesa/drivers/dri/r300/r300_emit.c delete mode 100644 src/mesa/drivers/dri/r300/r300_maos.c delete mode 100644 src/mesa/drivers/dri/r300/r300_maos.h diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile index 9e60f970d67..c1d223c7600 100644 --- a/src/mesa/drivers/dri/r300/Makefile +++ b/src/mesa/drivers/dri/r300/Makefile @@ -40,7 +40,7 @@ DRIVER_SOURCES = \ r300_vertprog.c \ r300_fragprog.c \ r300_shader.c \ - r300_maos.c \ + r300_emit.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 4f70d7055a4..00ff9812b89 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -62,7 +62,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_state.h" #include "r300_ioctl.h" #include "r300_tex.h" -#include "r300_maos.h" +#include "r300_emit.h" #ifdef USER_BUFFERS #include "r300_mem.h" diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c new file mode 100644 index 00000000000..d2ae8be9f1a --- /dev/null +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -0,0 +1,636 @@ +/* +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. + +**************************************************************************/ + +/** + * \file + * + * \author Keith Whitwell + */ + +#include "glheader.h" +#include "mtypes.h" +#include "colormac.h" +#include "imports.h" +#include "macros.h" +#include "image.h" + +#include "swrast_setup/swrast_setup.h" +#include "math/m_translate.h" +#include "tnl/tnl.h" +#include "tnl/t_context.h" + +#include "r300_context.h" +#include "radeon_ioctl.h" +#include "r300_state.h" +#include "r300_emit.h" +#include "r300_ioctl.h" + +#ifdef USER_BUFFERS +#include "r300_mem.h" +#endif + +#if SWIZZLE_X != R300_INPUT_ROUTE_SELECT_X || \ + SWIZZLE_Y != R300_INPUT_ROUTE_SELECT_Y || \ + SWIZZLE_Z != R300_INPUT_ROUTE_SELECT_Z || \ + SWIZZLE_W != R300_INPUT_ROUTE_SELECT_W || \ + SWIZZLE_ZERO != R300_INPUT_ROUTE_SELECT_ZERO || \ + SWIZZLE_ONE != R300_INPUT_ROUTE_SELECT_ONE +#error Cannot change these! +#endif + +#define DEBUG_ALL DEBUG_VERTS + +#if defined(USE_X86_ASM) +#define COPY_DWORDS( dst, src, nr ) \ +do { \ + int __tmp; \ + __asm__ __volatile__( "rep ; movsl" \ + : "=%c" (__tmp), "=D" (dst), "=S" (__tmp) \ + : "0" (nr), \ + "D" ((long)dst), \ + "S" ((long)src) ); \ +} while (0) +#else +#define COPY_DWORDS( dst, src, nr ) \ +do { \ + int j; \ + for ( j = 0 ; j < nr ; j++ ) \ + dst[j] = ((int *)src)[j]; \ + dst += nr; \ +} while (0) +#endif + +static void emit_vec4(GLcontext * ctx, + struct r300_dma_region *rvb, + GLvoid * data, int stride, int count) +{ + int i; + int *out = (int *)(rvb->address + rvb->start); + + if (RADEON_DEBUG & DEBUG_VERTS) + fprintf(stderr, "%s count %d stride %d\n", + __FUNCTION__, count, stride); + + if (stride == 4) + COPY_DWORDS(out, data, count); + else + for (i = 0; i < count; i++) { + out[0] = *(int *)data; + out++; + data += stride; + } +} + +static void emit_vec8(GLcontext * ctx, + struct r300_dma_region *rvb, + GLvoid * data, int stride, int count) +{ + int i; + int *out = (int *)(rvb->address + rvb->start); + + if (RADEON_DEBUG & DEBUG_VERTS) + fprintf(stderr, "%s count %d stride %d\n", + __FUNCTION__, count, stride); + + if (stride == 8) + COPY_DWORDS(out, data, count * 2); + else + for (i = 0; i < count; i++) { + out[0] = *(int *)data; + out[1] = *(int *)(data + 4); + out += 2; + data += stride; + } +} + +static void emit_vec12(GLcontext * ctx, + struct r300_dma_region *rvb, + GLvoid * data, int stride, int count) +{ + int i; + int *out = (int *)(rvb->address + rvb->start); + + if (RADEON_DEBUG & DEBUG_VERTS) + fprintf(stderr, "%s count %d stride %d out %p data %p\n", + __FUNCTION__, count, stride, (void *)out, (void *)data); + + if (stride == 12) + COPY_DWORDS(out, data, count * 3); + else + for (i = 0; i < count; i++) { + out[0] = *(int *)data; + out[1] = *(int *)(data + 4); + out[2] = *(int *)(data + 8); + out += 3; + data += stride; + } +} + +static void emit_vec16(GLcontext * ctx, + struct r300_dma_region *rvb, + GLvoid * data, int stride, int count) +{ + int i; + int *out = (int *)(rvb->address + rvb->start); + + if (RADEON_DEBUG & DEBUG_VERTS) + fprintf(stderr, "%s count %d stride %d\n", + __FUNCTION__, count, stride); + + if (stride == 16) + COPY_DWORDS(out, data, count * 4); + else + for (i = 0; i < count; i++) { + out[0] = *(int *)data; + out[1] = *(int *)(data + 4); + out[2] = *(int *)(data + 8); + out[3] = *(int *)(data + 12); + out += 4; + data += stride; + } +} + +static void emit_vector(GLcontext * ctx, + struct r300_dma_region *rvb, + GLvoid * data, int size, int stride, int count) +{ + 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); + + 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? */ + rvb->aos_offset = GET_START(rvb); + rvb->aos_stride = size; + } + + /* Emit the data + */ + switch (size) { + case 1: + emit_vec4(ctx, rvb, data, stride, count); + break; + case 2: + emit_vec8(ctx, rvb, data, stride, count); + break; + case 3: + emit_vec12(ctx, rvb, data, stride, count); + break; + case 4: + emit_vec16(ctx, rvb, data, stride, count); + break; + default: + assert(0); + _mesa_exit(-1); + break; + } + +} + +static GLuint t_type(struct dt *dt) +{ + 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; +} + +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, + GLint * tab, GLuint nr) +{ + GLuint i, dw; + + 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; + + if (i + 2 == nr) { + dw |= (1 << (13 + 16)); + } + dst[i >> 1] = dw; + } + + 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; + + dst[nr >> 1] = dw; + } + + return (nr + 1) >> 1; +} + +static GLuint t_swizzle(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 t_vir1(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; + } + + if (nr & 1) + dst[nr >> 1] = + t_swizzle(swizzle[nr - 1]) | R300_INPUT_ROUTE_ENABLE; + + 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); + 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; + + r300->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++; + vic_1 |= R300_INPUT_CNTL_TC0 << i; + } + + return vic_1; +} + +/* 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); + r300ContextPtr r300 = rmesa; + struct radeon_vertex_buffer *VB = &rmesa->state.VB; + GLuint nr; + GLuint count = VB->Count; + GLuint i; + GLuint InputsRead = 0, OutputsWritten = 0; + int *inputs = NULL; + int vir_inputs[VERT_ATTRIB_MAX]; + GLint tab[VERT_ATTRIB_MAX]; + int swizzle[VERT_ATTRIB_MAX][4]; + + 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; + } else { + DECLARE_RENDERINPUTS(inputs_bitset); + inputs = r300->state.sw_tcl_inputs; + + 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_COLOR0)); + InputsRead |= 1 << VERT_ATTRIB_COLOR0; + OutputsWritten |= 1 << VERT_RESULT_COL0; + + if (RENDERINPUTS_TEST(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))) { + 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)) + inputs[i] = nr++; + 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); + } + assert(InputsRead); + assert(OutputsWritten); + + for (i = 0, nr = 0; i < VERT_ATTRIB_MAX; i++) + if (InputsRead & (1 << i)) + tab[nr++] = i; + + if (nr > R300_MAX_AOS_ARRAYS) + return R300_FALLBACK_TCL; + + for (i = 0; i < nr; i++) { + int ci; + int comp_size, 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; + +#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, + /*(count-1)*stride */ 4)) { + if (VB->AttribPtr[tab[i]].stride % 4) + return R300_FALLBACK_TCL; + + rmesa->state.aos[i].address = + 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 = + t_emit_size(&VB->AttribPtr[tab[i]]); + } else { + /* TODO: emit_vector can only handle 4 byte vectors */ + if (VB->AttribPtr[tab[i]].type != GL_FLOAT) + return R300_FALLBACK_TCL; + + emit_vector(ctx, &rmesa->state.aos[i], + VB->AttribPtr[tab[i]].data, + t_emit_size(&VB->AttribPtr[tab[i]]), + VB->AttribPtr[tab[i]].stride, count); + } + + rmesa->state.aos[i].aos_size = + t_aos_size(&VB->AttribPtr[tab[i]]); + + comp_size = _mesa_sizeof_type(VB->AttribPtr[tab[i]].type); + + for (fix = 0; fix <= 4 - VB->AttribPtr[tab[i]].size; fix++) { + if ((rmesa->state.aos[i].aos_offset - + comp_size * fix) % 4) + continue; + + found = 1; + break; + } + + if (found) { + 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 { + 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); + return R300_FALLBACK_TCL; + } + } + + /* 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, + 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); + + /* Set up 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] = t_vic(ctx, InputsRead); + + /* Stage 3: VAP output */ + + 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(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)) + + 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)); + + rmesa->state.aos_count = nr; + + return R300_FALLBACK_NONE; +} + +#ifdef USER_BUFFERS +void r300UseArrays(GLcontext * ctx) +{ + r300ContextPtr rmesa = R300_CONTEXT(ctx); + int i; + + if (rmesa->state.elt_dma.buf) + r300_mem_use(rmesa, rmesa->state.elt_dma.buf->id); + + for (i = 0; i < rmesa->state.aos_count; i++) { + if (rmesa->state.aos[i].buf) + r300_mem_use(rmesa, rmesa->state.aos[i].buf->id); + } +} +#endif + +void r300ReleaseArrays(GLcontext * ctx) +{ + r300ContextPtr rmesa = R300_CONTEXT(ctx); + int i; + + r300ReleaseDmaRegion(rmesa, &rmesa->state.elt_dma, __FUNCTION__); + for (i = 0; i < rmesa->state.aos_count; i++) { + r300ReleaseDmaRegion(rmesa, &rmesa->state.aos[i], __FUNCTION__); + } +} diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h index ae084d4b1da..5e3efcfcf0b 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.h +++ b/src/mesa/drivers/dri/r300/r300_emit.h @@ -227,4 +227,12 @@ void static inline cp_wait(r300ContextPtr rmesa, unsigned char flags) cmd[0].i = cmdwait(flags); } +extern int r300EmitArrays(GLcontext * ctx); + +#ifdef USER_BUFFERS +void r300UseArrays(GLcontext * ctx); +#endif + +extern void r300ReleaseArrays(GLcontext * ctx); + #endif diff --git a/src/mesa/drivers/dri/r300/r300_maos.c b/src/mesa/drivers/dri/r300/r300_maos.c deleted file mode 100644 index 9e07445b1d4..00000000000 --- a/src/mesa/drivers/dri/r300/r300_maos.c +++ /dev/null @@ -1,636 +0,0 @@ -/* -Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. - -The Weather Channel (TM) funded Tungsten Graphics to develop the -initial release of the Radeon 8500 driver under the XFree86 license. -This notice must be preserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial -portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/** - * \file - * - * \author Keith Whitwell - */ - -#include "glheader.h" -#include "mtypes.h" -#include "colormac.h" -#include "imports.h" -#include "macros.h" -#include "image.h" - -#include "swrast_setup/swrast_setup.h" -#include "math/m_translate.h" -#include "tnl/tnl.h" -#include "tnl/t_context.h" - -#include "r300_context.h" -#include "radeon_ioctl.h" -#include "r300_state.h" -#include "r300_maos.h" -#include "r300_ioctl.h" - -#ifdef USER_BUFFERS -#include "r300_mem.h" -#endif - -#if SWIZZLE_X != R300_INPUT_ROUTE_SELECT_X || \ - SWIZZLE_Y != R300_INPUT_ROUTE_SELECT_Y || \ - SWIZZLE_Z != R300_INPUT_ROUTE_SELECT_Z || \ - SWIZZLE_W != R300_INPUT_ROUTE_SELECT_W || \ - SWIZZLE_ZERO != R300_INPUT_ROUTE_SELECT_ZERO || \ - SWIZZLE_ONE != R300_INPUT_ROUTE_SELECT_ONE -#error Cannot change these! -#endif - -#define DEBUG_ALL DEBUG_VERTS - -#if defined(USE_X86_ASM) -#define COPY_DWORDS( dst, src, nr ) \ -do { \ - int __tmp; \ - __asm__ __volatile__( "rep ; movsl" \ - : "=%c" (__tmp), "=D" (dst), "=S" (__tmp) \ - : "0" (nr), \ - "D" ((long)dst), \ - "S" ((long)src) ); \ -} while (0) -#else -#define COPY_DWORDS( dst, src, nr ) \ -do { \ - int j; \ - for ( j = 0 ; j < nr ; j++ ) \ - dst[j] = ((int *)src)[j]; \ - dst += nr; \ -} while (0) -#endif - -static void emit_vec4(GLcontext * ctx, - struct r300_dma_region *rvb, - GLvoid * data, int stride, int count) -{ - int i; - int *out = (int *)(rvb->address + rvb->start); - - if (RADEON_DEBUG & DEBUG_VERTS) - fprintf(stderr, "%s count %d stride %d\n", - __FUNCTION__, count, stride); - - if (stride == 4) - COPY_DWORDS(out, data, count); - else - for (i = 0; i < count; i++) { - out[0] = *(int *)data; - out++; - data += stride; - } -} - -static void emit_vec8(GLcontext * ctx, - struct r300_dma_region *rvb, - GLvoid * data, int stride, int count) -{ - int i; - int *out = (int *)(rvb->address + rvb->start); - - if (RADEON_DEBUG & DEBUG_VERTS) - fprintf(stderr, "%s count %d stride %d\n", - __FUNCTION__, count, stride); - - if (stride == 8) - COPY_DWORDS(out, data, count * 2); - else - for (i = 0; i < count; i++) { - out[0] = *(int *)data; - out[1] = *(int *)(data + 4); - out += 2; - data += stride; - } -} - -static void emit_vec12(GLcontext * ctx, - struct r300_dma_region *rvb, - GLvoid * data, int stride, int count) -{ - int i; - int *out = (int *)(rvb->address + rvb->start); - - if (RADEON_DEBUG & DEBUG_VERTS) - fprintf(stderr, "%s count %d stride %d out %p data %p\n", - __FUNCTION__, count, stride, (void *)out, (void *)data); - - if (stride == 12) - COPY_DWORDS(out, data, count * 3); - else - for (i = 0; i < count; i++) { - out[0] = *(int *)data; - out[1] = *(int *)(data + 4); - out[2] = *(int *)(data + 8); - out += 3; - data += stride; - } -} - -static void emit_vec16(GLcontext * ctx, - struct r300_dma_region *rvb, - GLvoid * data, int stride, int count) -{ - int i; - int *out = (int *)(rvb->address + rvb->start); - - if (RADEON_DEBUG & DEBUG_VERTS) - fprintf(stderr, "%s count %d stride %d\n", - __FUNCTION__, count, stride); - - if (stride == 16) - COPY_DWORDS(out, data, count * 4); - else - for (i = 0; i < count; i++) { - out[0] = *(int *)data; - out[1] = *(int *)(data + 4); - out[2] = *(int *)(data + 8); - out[3] = *(int *)(data + 12); - out += 4; - data += stride; - } -} - -static void emit_vector(GLcontext * ctx, - struct r300_dma_region *rvb, - GLvoid * data, int size, int stride, int count) -{ - 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); - - 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? */ - rvb->aos_offset = GET_START(rvb); - rvb->aos_stride = size; - } - - /* Emit the data - */ - switch (size) { - case 1: - emit_vec4(ctx, rvb, data, stride, count); - break; - case 2: - emit_vec8(ctx, rvb, data, stride, count); - break; - case 3: - emit_vec12(ctx, rvb, data, stride, count); - break; - case 4: - emit_vec16(ctx, rvb, data, stride, count); - break; - default: - assert(0); - _mesa_exit(-1); - break; - } - -} - -static GLuint t_type(struct dt *dt) -{ - 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; -} - -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, - GLint * tab, GLuint nr) -{ - GLuint i, dw; - - 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; - - if (i + 2 == nr) { - dw |= (1 << (13 + 16)); - } - dst[i >> 1] = dw; - } - - 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; - - dst[nr >> 1] = dw; - } - - return (nr + 1) >> 1; -} - -static GLuint t_swizzle(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 t_vir1(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; - } - - if (nr & 1) - dst[nr >> 1] = - t_swizzle(swizzle[nr - 1]) | R300_INPUT_ROUTE_ENABLE; - - 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); - 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; - - r300->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++; - vic_1 |= R300_INPUT_CNTL_TC0 << i; - } - - return vic_1; -} - -/* 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); - r300ContextPtr r300 = rmesa; - struct radeon_vertex_buffer *VB = &rmesa->state.VB; - GLuint nr; - GLuint count = VB->Count; - GLuint i; - GLuint InputsRead = 0, OutputsWritten = 0; - int *inputs = NULL; - int vir_inputs[VERT_ATTRIB_MAX]; - GLint tab[VERT_ATTRIB_MAX]; - int swizzle[VERT_ATTRIB_MAX][4]; - - 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; - } else { - DECLARE_RENDERINPUTS(inputs_bitset); - inputs = r300->state.sw_tcl_inputs; - - 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_COLOR0)); - InputsRead |= 1 << VERT_ATTRIB_COLOR0; - OutputsWritten |= 1 << VERT_RESULT_COL0; - - if (RENDERINPUTS_TEST(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))) { - 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)) - inputs[i] = nr++; - 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); - } - assert(InputsRead); - assert(OutputsWritten); - - for (i = 0, nr = 0; i < VERT_ATTRIB_MAX; i++) - if (InputsRead & (1 << i)) - tab[nr++] = i; - - if (nr > R300_MAX_AOS_ARRAYS) - return R300_FALLBACK_TCL; - - for (i = 0; i < nr; i++) { - int ci; - int comp_size, 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; - -#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, - /*(count-1)*stride */ 4)) { - if (VB->AttribPtr[tab[i]].stride % 4) - return R300_FALLBACK_TCL; - - rmesa->state.aos[i].address = - 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 = - t_emit_size(&VB->AttribPtr[tab[i]]); - } else { - /* TODO: emit_vector can only handle 4 byte vectors */ - if (VB->AttribPtr[tab[i]].type != GL_FLOAT) - return R300_FALLBACK_TCL; - - emit_vector(ctx, &rmesa->state.aos[i], - VB->AttribPtr[tab[i]].data, - t_emit_size(&VB->AttribPtr[tab[i]]), - VB->AttribPtr[tab[i]].stride, count); - } - - rmesa->state.aos[i].aos_size = - t_aos_size(&VB->AttribPtr[tab[i]]); - - comp_size = _mesa_sizeof_type(VB->AttribPtr[tab[i]].type); - - for (fix = 0; fix <= 4 - VB->AttribPtr[tab[i]].size; fix++) { - if ((rmesa->state.aos[i].aos_offset - - comp_size * fix) % 4) - continue; - - found = 1; - break; - } - - if (found) { - 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 { - 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); - return R300_FALLBACK_TCL; - } - } - - /* 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, - 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); - - /* Set up 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] = t_vic(ctx, InputsRead); - - /* Stage 3: VAP output */ - - 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(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)) - - 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)); - - rmesa->state.aos_count = nr; - - return R300_FALLBACK_NONE; -} - -#ifdef USER_BUFFERS -void r300UseArrays(GLcontext * ctx) -{ - r300ContextPtr rmesa = R300_CONTEXT(ctx); - int i; - - if (rmesa->state.elt_dma.buf) - r300_mem_use(rmesa, rmesa->state.elt_dma.buf->id); - - for (i = 0; i < rmesa->state.aos_count; i++) { - if (rmesa->state.aos[i].buf) - r300_mem_use(rmesa, rmesa->state.aos[i].buf->id); - } -} -#endif - -void r300ReleaseArrays(GLcontext * ctx) -{ - r300ContextPtr rmesa = R300_CONTEXT(ctx); - int i; - - r300ReleaseDmaRegion(rmesa, &rmesa->state.elt_dma, __FUNCTION__); - for (i = 0; i < rmesa->state.aos_count; i++) { - r300ReleaseDmaRegion(rmesa, &rmesa->state.aos[i], __FUNCTION__); - } -} diff --git a/src/mesa/drivers/dri/r300/r300_maos.h b/src/mesa/drivers/dri/r300/r300_maos.h deleted file mode 100644 index 2f366e307f8..00000000000 --- a/src/mesa/drivers/dri/r300/r300_maos.h +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. - -The Weather Channel (TM) funded Tungsten Graphics to develop the -initial release of the Radeon 8500 driver under the XFree86 license. -This notice must be preserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial -portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Keith Whitwell - */ - -#ifndef __R300_MAOS_H__ -#define __R300_MAOS_H__ - -#include "r300_context.h" - -extern int r300EmitArrays(GLcontext * ctx); - -#ifdef USER_BUFFERS -void r300UseArrays(GLcontext * ctx); -#endif - -extern void r300ReleaseArrays(GLcontext * ctx); - -#endif diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 5a00ed7f8e8..d49d218a8eb 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -70,7 +70,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_state.h" #include "r300_reg.h" #include "r300_tex.h" -#include "r300_maos.h" #include "r300_emit.h" extern int future_hw_tcl_on; diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index bbe3a4caead..ef918137627 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -62,7 +62,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_emit.h" #include "r300_fragprog.h" #include "r300_tex.h" -#include "r300_maos.h" #include "drirenderbuffer.h" -- cgit v1.2.3 From d4e3b0b2c28d15eee43ebaadd9cd007ccbad91d6 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 17:10:59 +0000 Subject: r300: Cleaned up function naming in r300_emit.c. --- src/mesa/drivers/dri/r300/r300_emit.c | 47 ++++++++++++++--------------------- 1 file changed, 19 insertions(+), 28 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index d2ae8be9f1a..2c26069f9b3 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -86,9 +86,9 @@ do { \ } while (0) #endif -static void emit_vec4(GLcontext * ctx, - struct r300_dma_region *rvb, - GLvoid * data, int stride, int count) +static void r300EmitVec4(GLcontext * ctx, + struct r300_dma_region *rvb, + GLvoid * data, int stride, int count) { int i; int *out = (int *)(rvb->address + rvb->start); @@ -107,9 +107,9 @@ static void emit_vec4(GLcontext * ctx, } } -static void emit_vec8(GLcontext * ctx, - struct r300_dma_region *rvb, - GLvoid * data, int stride, int count) +static void r300EmitVec8(GLcontext * ctx, + struct r300_dma_region *rvb, + GLvoid * data, int stride, int count) { int i; int *out = (int *)(rvb->address + rvb->start); @@ -129,9 +129,9 @@ static void emit_vec8(GLcontext * ctx, } } -static void emit_vec12(GLcontext * ctx, - struct r300_dma_region *rvb, - GLvoid * data, int stride, int count) +static void r300EmitVec12(GLcontext * ctx, + struct r300_dma_region *rvb, + GLvoid * data, int stride, int count) { int i; int *out = (int *)(rvb->address + rvb->start); @@ -152,9 +152,9 @@ static void emit_vec12(GLcontext * ctx, } } -static void emit_vec16(GLcontext * ctx, - struct r300_dma_region *rvb, - GLvoid * data, int stride, int count) +static void r300EmitVec16(GLcontext * ctx, + struct r300_dma_region *rvb, + GLvoid * data, int stride, int count) { int i; int *out = (int *)(rvb->address + rvb->start); @@ -176,7 +176,7 @@ static void emit_vec16(GLcontext * ctx, } } -static void emit_vector(GLcontext * ctx, +static void r300EmitVec(GLcontext * ctx, struct r300_dma_region *rvb, GLvoid * data, int size, int stride, int count) { @@ -204,16 +204,16 @@ static void emit_vector(GLcontext * ctx, */ switch (size) { case 1: - emit_vec4(ctx, rvb, data, stride, count); + r300EmitVec4(ctx, rvb, data, stride, count); break; case 2: - emit_vec8(ctx, rvb, data, stride, count); + r300EmitVec8(ctx, rvb, data, stride, count); break; case 3: - emit_vec12(ctx, rvb, data, stride, count); + r300EmitVec12(ctx, rvb, data, stride, count); break; case 4: - emit_vec16(ctx, rvb, data, stride, count); + r300EmitVec16(ctx, rvb, data, stride, count); break; default: assert(0); @@ -228,13 +228,10 @@ static GLuint t_type(struct dt *dt) 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; @@ -248,13 +245,10 @@ 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; @@ -268,13 +262,10 @@ 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; @@ -510,11 +501,11 @@ int r300EmitArrays(GLcontext * ctx) rmesa->state.aos[i].aos_size = t_emit_size(&VB->AttribPtr[tab[i]]); } else { - /* TODO: emit_vector can only handle 4 byte vectors */ + /* TODO: r300EmitVec can only handle 4 byte vectors */ if (VB->AttribPtr[tab[i]].type != GL_FLOAT) return R300_FALLBACK_TCL; - emit_vector(ctx, &rmesa->state.aos[i], + r300EmitVec(ctx, &rmesa->state.aos[i], VB->AttribPtr[tab[i]].data, t_emit_size(&VB->AttribPtr[tab[i]]), VB->AttribPtr[tab[i]].stride, count); -- cgit v1.2.3 From 01ec508c7f722f58139fa3fd5d0a052dd5b5476c Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 19:21:08 +0000 Subject: r300: Cleaned up function names in r300_state.c. --- src/mesa/drivers/dri/r300/r300_state.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index ef918137627..f80ae0ca615 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -78,7 +78,7 @@ static void r300BlendColor(GLcontext * ctx, const GLfloat cf[4]) CLAMPED_FLOAT_TO_UBYTE(color[3], cf[3]); rmesa->hw.blend_color.cmd[1] = PACK_COLOR_8888(color[3], color[0], - color[1], color[2]); + color[1], color[2]); } /** @@ -333,7 +333,7 @@ static void r300UpdateCulling(GLcontext * ctx) r300->hw.cul.cmd[R300_CUL_CULL] = val; } -static void update_early_z(GLcontext * ctx) +static void r300SetEarlyZState(GLcontext * ctx) { /* updates register R300_RB3D_EARLY_Z (0x4F14) if depth test is not enabled it should be R300_EARLY_Z_DISABLE @@ -356,7 +356,7 @@ static void update_early_z(GLcontext * ctx) } } -static void update_alpha(GLcontext * ctx) +static void r300SetAlphaState(GLcontext * ctx) { r300ContextPtr r300 = R300_CONTEXT(ctx); GLubyte refByte; @@ -402,14 +402,15 @@ static void update_alpha(GLcontext * ctx) R300_STATECHANGE(r300, at); r300->hw.at.cmd[R300_AT_ALPHA_TEST] = pp_misc; - update_early_z(ctx); + + r300SetEarlyZState(ctx); } static void r300AlphaFunc(GLcontext * ctx, GLenum func, GLfloat ref) { (void)func; (void)ref; - update_alpha(ctx); + r300SetAlphaState(ctx); } static int translate_func(int func) @@ -435,7 +436,7 @@ static int translate_func(int func) return 0; } -static void update_depth(GLcontext * ctx) +static void r300SetDepthState(GLcontext * ctx) { r300ContextPtr r300 = R300_CONTEXT(ctx); @@ -460,7 +461,7 @@ static void update_depth(GLcontext * ctx) translate_func(GL_NEVER) << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT; } - update_early_z(ctx); + r300SetEarlyZState(ctx); } /** @@ -503,7 +504,7 @@ static void r300Enable(GLcontext * ctx, GLenum cap, GLboolean state) break; case GL_ALPHA_TEST: - update_alpha(ctx); + r300SetAlphaState(ctx); break; case GL_BLEND: @@ -512,7 +513,7 @@ static void r300Enable(GLcontext * ctx, GLenum cap, GLboolean state) break; case GL_DEPTH_TEST: - update_depth(ctx); + r300SetDepthState(ctx); break; case GL_STENCIL_TEST: @@ -637,7 +638,7 @@ static void r300FrontFace(GLcontext * ctx, GLenum mode) static void r300DepthFunc(GLcontext * ctx, GLenum func) { (void)func; - update_depth(ctx); + r300SetDepthState(ctx); } /** @@ -648,7 +649,7 @@ static void r300DepthFunc(GLcontext * ctx, GLenum func) static void r300DepthMask(GLcontext * ctx, GLboolean mask) { (void)mask; - update_depth(ctx); + r300SetDepthState(ctx); } /** -- cgit v1.2.3 From 69ff5a3dbc8f4e72acbfd1bc80598408f9e6a4c4 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 19:28:35 +0000 Subject: r300: Function naming correction in r300_texmem.c. --- src/mesa/drivers/dri/r300/r300_texmem.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_texmem.c b/src/mesa/drivers/dri/r300/r300_texmem.c index db80325309a..eef5ff186f4 100644 --- a/src/mesa/drivers/dri/r300/r300_texmem.c +++ b/src/mesa/drivers/dri/r300/r300_texmem.c @@ -299,10 +299,10 @@ static void r300UploadRectSubImage(r300ContextPtr rmesa, * Upload the texture image associated with texture \a t at the specified * level at the address relative to \a start. */ -static void uploadSubImage(r300ContextPtr rmesa, r300TexObjPtr t, - GLint hwlevel, - GLint x, GLint y, GLint width, GLint height, - GLuint face) +static void r300UploadSubImage(r300ContextPtr rmesa, r300TexObjPtr t, + GLint hwlevel, + GLint x, GLint y, GLint width, GLint height, + GLuint face) { struct gl_texture_image *texImage = NULL; GLuint offset; @@ -566,9 +566,10 @@ int r300UploadTexImages(r300ContextPtr rmesa, r300TexObjPtr t, GLuint face) dirty_images[face] & (1 << (i + t->base.firstLevel))) != 0) { - uploadSubImage(rmesa, t, i, 0, 0, - t->image[face][i].width, - t->image[face][i].height, face); + r300UploadSubImage(rmesa, t, i, 0, 0, + t->image[face][i].width, + t->image[face][i].height, + face); } } t->base.dirty_images[face] = 0; -- cgit v1.2.3 From 1b39be3790a093e5b54974221478905b853cadb4 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 19:44:35 +0000 Subject: r300: Removed some checking in r300NumVerts that is not needed. According to Aapo Tahkola the OpenGL specification defines the behaviour when there are not enough vertices for the primitive type, thus DRI drivers do not need to perform verification on the number of vertices per primitive. --- src/mesa/drivers/dri/r300/r300_render.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index d49d218a8eb..5249aa2137d 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -172,20 +172,6 @@ static int r300NumVerts(r300ContextPtr rmesa, int num_verts, int prim) break; } - if (num_verts - verts_off == 0) { - WARN_ONCE - ("user error: Need more than %d vertices to draw primitive 0x%04x !\n", - num_verts, prim & PRIM_MODE_MASK); - return -1; - } - - if (verts_off > 0) { - WARN_ONCE - ("user error: %d is not a valid number of vertices for primitive 0x%04x !\n", - num_verts, prim & PRIM_MODE_MASK); - return -1; - } - return num_verts - verts_off; } @@ -259,7 +245,6 @@ static void r300EmitElts(GLcontext * ctx, void *elts, unsigned long n_elts, rvb->aos_offset = rmesa->radeon.radeonScreen->gart_texture_offset + rvb->start; - return; } else if (r300IsGartMemory(rmesa, elts, 1)) { WARN_ONCE("Pointer not within GART memory!\n"); -- cgit v1.2.3 From eab6e1652271f46361f95e21e9e5afcb5ffa37d7 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 11 May 2007 15:12:40 -0600 Subject: remove some unneeded code in init_machine() --- src/mesa/swrast/s_fragprog.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index b1501221cad..e47dbbdaf35 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -99,11 +99,6 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine, const struct gl_fragment_program *program, const SWspan *span, GLuint col) { - GLuint inputsRead = program->Base.InputsRead; - - if (ctx->FragmentProgram.CallbackEnabled) - inputsRead = ~0; - if (program->Base.Target == GL_FRAGMENT_PROGRAM_NV) { /* Clear temporary registers (undefined for ARB_f_p) */ _mesa_bzero(machine->Temporaries, -- cgit v1.2.3 From 749e093e33a46a7201ec795e71e7fba6f756da7b Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 11 May 2007 15:34:29 -0600 Subject: don't ignore return value of _slang_codegen_global_variable() --- src/mesa/shader/slang/slang_compile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index f23a29633bd..a4dd5b8b4ae 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -1618,7 +1618,8 @@ parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O, A.program = O->program; A.vartable = O->vartable; A.curFuncEndLabel = NULL; - _slang_codegen_global_variable(&A, var, C->type); + if (!_slang_codegen_global_variable(&A, var, C->type)) + return 0; } /* allocate global address space for a variable with a known size */ -- cgit v1.2.3 From cc358d861d76c58613145fa764e0481e7b693c2b Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 11 May 2007 15:35:12 -0600 Subject: user-declared uniform structs not supported yet (see bug 10908) --- src/mesa/shader/slang/slang_codegen.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index cf32b501a62..60ffc48f54b 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -2863,9 +2863,22 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var, * MAX2(var->array_len, 1); if (prog) { /* user-defined uniform */ - GLint uniformLoc = _mesa_add_uniform(prog->Parameters, varName, - size, datatype); - store = _slang_new_ir_storage(PROGRAM_UNIFORM, uniformLoc, size); + if (datatype == GL_NONE) { + if (var->type.specifier.type == SLANG_SPEC_STRUCT) { + _mesa_problem(NULL, "user-declared uniform structs not supported yet"); + } + else { + slang_info_log_error(A->log, + "invalid datatype for uniform variable %s", + (char *) var->a_name); + } + return GL_FALSE; + } + else { + GLint uniformLoc = _mesa_add_uniform(prog->Parameters, varName, + size, datatype); + store = _slang_new_ir_storage(PROGRAM_UNIFORM, uniformLoc, size); + } } else { /* pre-defined uniform, like gl_ModelviewMatrix */ -- cgit v1.2.3 From a87390504f8aa8e5262cf721d28c80da9fcfbd44 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 19:57:07 +0000 Subject: r300: Moved some code around in r300_render.c and general clean up. --- src/mesa/drivers/dri/r300/r300_render.c | 80 ++++++++++++++++----------------- 1 file changed, 38 insertions(+), 42 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 5249aa2137d..f7b178d0747 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -78,38 +78,36 @@ extern int future_hw_tcl_on; */ static int r300PrimitiveType(r300ContextPtr rmesa, GLcontext * ctx, int prim) { - int type = -1; - switch (prim & PRIM_MODE_MASK) { case GL_POINTS: - type = R300_VAP_VF_CNTL__PRIM_POINTS; + return R300_VAP_VF_CNTL__PRIM_POINTS; break; case GL_LINES: - type = R300_VAP_VF_CNTL__PRIM_LINES; + return R300_VAP_VF_CNTL__PRIM_LINES; break; case GL_LINE_STRIP: - type = R300_VAP_VF_CNTL__PRIM_LINE_STRIP; + return R300_VAP_VF_CNTL__PRIM_LINE_STRIP; break; case GL_LINE_LOOP: - type = R300_VAP_VF_CNTL__PRIM_LINE_LOOP; + return R300_VAP_VF_CNTL__PRIM_LINE_LOOP; break; case GL_TRIANGLES: - type = R300_VAP_VF_CNTL__PRIM_TRIANGLES; + return R300_VAP_VF_CNTL__PRIM_TRIANGLES; break; case GL_TRIANGLE_STRIP: - type = R300_VAP_VF_CNTL__PRIM_TRIANGLE_STRIP; + return R300_VAP_VF_CNTL__PRIM_TRIANGLE_STRIP; break; case GL_TRIANGLE_FAN: - type = R300_VAP_VF_CNTL__PRIM_TRIANGLE_FAN; + return R300_VAP_VF_CNTL__PRIM_TRIANGLE_FAN; break; case GL_QUADS: - type = R300_VAP_VF_CNTL__PRIM_QUADS; + return R300_VAP_VF_CNTL__PRIM_QUADS; break; case GL_QUAD_STRIP: - type = R300_VAP_VF_CNTL__PRIM_QUAD_STRIP; + return R300_VAP_VF_CNTL__PRIM_QUAD_STRIP; break; case GL_POLYGON: - type = R300_VAP_VF_CNTL__PRIM_POLYGON; + return R300_VAP_VF_CNTL__PRIM_POLYGON; break; default: fprintf(stderr, @@ -118,7 +116,6 @@ static int r300PrimitiveType(r300ContextPtr rmesa, GLcontext * ctx, int prim) return -1; break; } - return type; } static int r300NumVerts(r300ContextPtr rmesa, int num_verts, int prim) @@ -175,6 +172,34 @@ 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) +{ + 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)) { + rvb->address = rmesa->radeon.radeonScreen->gartTextures.map; + rvb->start = ((char *)elts) - rvb->address; + rvb->aos_offset = + rmesa->radeon.radeonScreen->gart_texture_offset + + rvb->start; + return; + } else if (r300IsGartMemory(rmesa, elts, 1)) { + WARN_ONCE("Pointer not within GART memory!\n"); + _mesa_exit(-1); + } + + r300AllocDmaRegion(rmesa, rvb, n_elts * elt_size, elt_size); + rvb->aos_offset = GET_START(rvb); + + out = rvb->address + rvb->start; + memcpy(out, elts, n_elts * elt_size); +} + static void r300FireEB(r300ContextPtr rmesa, unsigned long addr, int vertex_count, int type, int elt_size) { @@ -230,35 +255,6 @@ static void r300FireEB(r300ContextPtr rmesa, unsigned long addr, } } -static void r300EmitElts(GLcontext * ctx, void *elts, unsigned long n_elts, - int elt_size) -{ - 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)) { - rvb->address = rmesa->radeon.radeonScreen->gartTextures.map; - rvb->start = ((char *)elts) - rvb->address; - rvb->aos_offset = - rmesa->radeon.radeonScreen->gart_texture_offset + - rvb->start; - return; - } else if (r300IsGartMemory(rmesa, elts, 1)) { - WARN_ONCE("Pointer not within GART memory!\n"); - _mesa_exit(-1); - } - - r300AllocDmaRegion(rmesa, rvb, n_elts * elt_size, elt_size); - rvb->aos_offset = GET_START(rvb); - - out = rvb->address + rvb->start; - memcpy(out, elts, n_elts * elt_size); -} - - static void r300EmitAOS(r300ContextPtr rmesa, GLuint nr, GLuint offset) { int sz = 1 + (nr >> 1) * 3 + (nr & 1) * 2; -- cgit v1.2.3 From 5b23d3661342bbe3857829f3e306623ddb6b3dfe Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 20:06:43 +0000 Subject: r300: Assert if the primitive type is unknown; this can't really happen. --- src/mesa/drivers/dri/r300/r300_render.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index f7b178d0747..8a567d8afaa 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -110,9 +110,7 @@ static int r300PrimitiveType(r300ContextPtr rmesa, GLcontext * ctx, int prim) return R300_VAP_VF_CNTL__PRIM_POLYGON; break; default: - fprintf(stderr, - "%s:%s Do not know how to handle primitive 0x%04x - help me !\n", - __FILE__, __FUNCTION__, prim & PRIM_MODE_MASK); + assert (0); return -1; break; } @@ -162,9 +160,7 @@ static int r300NumVerts(r300ContextPtr rmesa, int num_verts, int prim) verts_off = num_verts; break; default: - fprintf(stderr, - "%s:%s Do not know how to handle primitive 0x%04x - help me !\n", - __FILE__, __FUNCTION__, prim & PRIM_MODE_MASK); + assert (0); return -1; break; } -- cgit v1.2.3 From c729e67321e689e6109b36f64c9fc31f76c10e35 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 20:09:01 +0000 Subject: r300: Use __FUNCTION__ not __func__. Just for consistency; most of the code already uses __FUNCTION__. --- src/mesa/drivers/dri/r300/r300_emit.h | 6 +++--- src/mesa/drivers/dri/r300/r300_fragprog.c | 2 +- src/mesa/drivers/dri/r300/r300_render.c | 2 +- src/mesa/drivers/dri/r300/r300_state.c | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h index 5e3efcfcf0b..7be098f743c 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.h +++ b/src/mesa/drivers/dri/r300/r300_emit.h @@ -134,7 +134,7 @@ static __inline__ uint32_t cmdpacify(void) cmd = (drm_radeon_cmd_header_t*) \ r300AllocCmdBuf(rmesa, \ (_n+2), \ - __func__); \ + __FUNCTION__); \ cmd_reserved=_n+2; \ cmd_written=1; \ cmd[0].i=cmdpacket0((reg), _n+1); \ @@ -169,7 +169,7 @@ static __inline__ uint32_t cmdpacify(void) cmd = (drm_radeon_cmd_header_t*) \ r300AllocCmdBuf(rmesa, \ (_n+1), \ - __func__); \ + __FUNCTION__); \ cmd_reserved = _n+2; \ cmd_written =1; \ cmd[0].i = cmdvpu((dest), _n/4); \ @@ -184,7 +184,7 @@ static __inline__ uint32_t cmdpacify(void) cmd = (drm_radeon_cmd_header_t*) \ r300AllocCmdBuf(rmesa, \ (_n+3), \ - __func__); \ + __FUNCTION__); \ cmd_reserved = _n+3; \ cmd_written = 2; \ if(_n > 0x3fff) { \ diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.c b/src/mesa/drivers/dri/r300/r300_fragprog.c index c6fbe3f9aae..cce8e685865 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog.c @@ -57,7 +57,7 @@ */ #define ERROR(fmt, args...) do { \ fprintf(stderr, "%s::%s(): " fmt "\n", \ - __FILE__, __func__, ##args); \ + __FILE__, __FUNCTION__, ##args); \ fp->error = GL_TRUE; \ } while(0) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 8a567d8afaa..d967c69c427 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -260,7 +260,7 @@ static void r300EmitAOS(r300ContextPtr rmesa, GLuint nr, GLuint offset) drm_radeon_cmd_header_t *cmd = NULL; if (RADEON_DEBUG & DEBUG_VERTS) - fprintf(stderr, "%s: nr=%d, ofs=0x%08x\n", __func__, nr, + fprintf(stderr, "%s: nr=%d, ofs=0x%08x\n", __FUNCTION__, nr, offset); start_packet3(RADEON_CP_PACKET3_3D_LOAD_VBPNTR, sz - 1); diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index f80ae0ca615..4f25ff7e812 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -248,7 +248,7 @@ static void r300SetBlendState(GLcontext * ctx) default: fprintf(stderr, "[%s:%u] Invalid RGB blend equation (0x%04x).\n", - __func__, __LINE__, ctx->Color.BlendEquationRGB); + __FUNCTION__, __LINE__, ctx->Color.BlendEquationRGB); return; } @@ -286,7 +286,7 @@ static void r300SetBlendState(GLcontext * ctx) default: fprintf(stderr, "[%s:%u] Invalid A blend equation (0x%04x).\n", - __func__, __LINE__, ctx->Color.BlendEquationA); + __FUNCTION__, __LINE__, ctx->Color.BlendEquationA); return; } @@ -1919,7 +1919,7 @@ void r300SetupPixelShader(r300ContextPtr rmesa) r300TranslateFragmentShader(rmesa, fp); if (!fp->translated) { fprintf(stderr, "%s: No valid fragment shader, exiting\n", - __func__); + __FUNCTION__); return; } #define OUTPUT_FIELD(st, reg, field) \ -- cgit v1.2.3 From cbd29adbc8f79b9cdeda531cf6bd866efc5ad89d Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 20:48:35 +0000 Subject: r300: Indented r300_mem.c; I forgot this because it used to be radeon_mm.c. --- src/mesa/drivers/dri/r300/r300_mem.c | 395 +++++++++++++++++++---------------- 1 file changed, 219 insertions(+), 176 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_mem.c b/src/mesa/drivers/dri/r300/r300_mem.c index c08e8367a39..21c5d22d1b4 100644 --- a/src/mesa/drivers/dri/r300/r300_mem.c +++ b/src/mesa/drivers/dri/r300/r300_mem.c @@ -45,20 +45,22 @@ static void resize_u_list(r300ContextPtr rmesa) { void *temp; int nsize; - + temp = rmesa->rmm->u_list; nsize = rmesa->rmm->u_size * 2; - + rmesa->rmm->u_list = _mesa_malloc(nsize * sizeof(*rmesa->rmm->u_list)); - _mesa_memset(rmesa->rmm->u_list, 0, nsize * sizeof(*rmesa->rmm->u_list)); - + _mesa_memset(rmesa->rmm->u_list, 0, + nsize * sizeof(*rmesa->rmm->u_list)); + if (temp) { r300FlushCmdBuf(rmesa, __FUNCTION__); - - _mesa_memcpy(rmesa->rmm->u_list, temp, rmesa->rmm->u_size * sizeof(*rmesa->rmm->u_list)); + + _mesa_memcpy(rmesa->rmm->u_list, temp, + rmesa->rmm->u_size * sizeof(*rmesa->rmm->u_list)); _mesa_free(temp); } - + rmesa->rmm->u_size = nsize; } @@ -66,7 +68,7 @@ void r300_mem_init(r300ContextPtr rmesa) { rmesa->rmm = malloc(sizeof(struct r300_memory_manager)); memset(rmesa->rmm, 0, sizeof(struct r300_memory_manager)); - + rmesa->rmm->u_size = 128; resize_u_list(rmesa); } @@ -89,16 +91,17 @@ void *r300_mem_ptr(r300ContextPtr rmesa, int id) int r300_mem_find(r300ContextPtr rmesa, void *ptr) { int i; - - for (i=1; i < rmesa->rmm->u_size+1; i++) - if(rmesa->rmm->u_list[i].ptr && - ptr >= rmesa->rmm->u_list[i].ptr && - ptr < rmesa->rmm->u_list[i].ptr + rmesa->rmm->u_list[i].size) + + for (i = 1; i < rmesa->rmm->u_size + 1; i++) + if (rmesa->rmm->u_list[i].ptr && + ptr >= rmesa->rmm->u_list[i].ptr && + ptr < + rmesa->rmm->u_list[i].ptr + rmesa->rmm->u_list[i].size) break; - + if (i < rmesa->rmm->u_size + 1) return i; - + fprintf(stderr, "%p failed\n", ptr); return 0; } @@ -108,73 +111,86 @@ int r300_mem_alloc(r300ContextPtr rmesa, int alignment, int size) { drm_radeon_mem_alloc_t alloc; int offset = 0, ret; - int i, free=-1; + int i, free = -1; int done_age; drm_radeon_mem_free_t memfree; - int tries=0; - static int bytes_wasted=0, allocated=0; - - if(size < 4096) + int tries = 0; + static int bytes_wasted = 0, allocated = 0; + + if (size < 4096) bytes_wasted += 4096 - size; - + allocated += size; - + #if 0 - static int t=0; + static int t = 0; if (t != time(NULL)) { t = time(NULL); - fprintf(stderr, "slots used %d, wasted %d kb, allocated %d\n", rmesa->rmm->u_last, bytes_wasted/1024, allocated/1024); + fprintf(stderr, "slots used %d, wasted %d kb, allocated %d\n", + rmesa->rmm->u_last, bytes_wasted / 1024, + allocated / 1024); } #endif - + memfree.region = RADEON_MEM_REGION_GART; - - again: - - done_age = radeonGetAge((radeonContextPtr)rmesa); - + + again: + + done_age = radeonGetAge((radeonContextPtr) rmesa); + if (rmesa->rmm->u_last + 1 >= rmesa->rmm->u_size) resize_u_list(rmesa); - - for (i = rmesa->rmm->u_last + 1; i > 0; i --) { + + for (i = rmesa->rmm->u_last + 1; i > 0; i--) { if (rmesa->rmm->u_list[i].ptr == NULL) { free = i; continue; } - + if (rmesa->rmm->u_list[i].h_pending == 0 && - rmesa->rmm->u_list[i].pending && rmesa->rmm->u_list[i].age <= done_age) { - memfree.region_offset = (char *)rmesa->rmm->u_list[i].ptr - - (char *)rmesa->radeon.radeonScreen->gartTextures.map; + rmesa->rmm->u_list[i].pending + && rmesa->rmm->u_list[i].age <= done_age) { + memfree.region_offset = + (char *)rmesa->rmm->u_list[i].ptr - + (char *)rmesa->radeon.radeonScreen->gartTextures. + map; - ret = drmCommandWrite(rmesa->radeon.radeonScreen->driScreen->fd, - DRM_RADEON_FREE, &memfree, sizeof(memfree)); + ret = + drmCommandWrite(rmesa->radeon.radeonScreen-> + driScreen->fd, DRM_RADEON_FREE, + &memfree, sizeof(memfree)); if (ret) { - fprintf(stderr, "Failed to free at %p\n", rmesa->rmm->u_list[i].ptr); + fprintf(stderr, "Failed to free at %p\n", + rmesa->rmm->u_list[i].ptr); fprintf(stderr, "ret = %s\n", strerror(-ret)); exit(1); } else { #ifdef MM_DEBUG - fprintf(stderr, "really freed %d at age %x\n", i, radeonGetAge((radeonContextPtr)rmesa)); + fprintf(stderr, "really freed %d at age %x\n", + i, + radeonGetAge((radeonContextPtr) rmesa)); #endif if (i == rmesa->rmm->u_last) - rmesa->rmm->u_last --; - - if(rmesa->rmm->u_list[i].size < 4096) - bytes_wasted -= 4096 - rmesa->rmm->u_list[i].size; + rmesa->rmm->u_last--; + + if (rmesa->rmm->u_list[i].size < 4096) + bytes_wasted -= + 4096 - rmesa->rmm->u_list[i].size; allocated -= rmesa->rmm->u_list[i].size; rmesa->rmm->u_list[i].pending = 0; rmesa->rmm->u_list[i].ptr = NULL; - + if (rmesa->rmm->u_list[i].fb) { LOCK_HARDWARE(&(rmesa->radeon)); - ret = mmFreeMem(rmesa->rmm->u_list[i].fb); + ret = + mmFreeMem(rmesa->rmm->u_list[i].fb); UNLOCK_HARDWARE(&(rmesa->radeon)); - + if (ret != 0) - fprintf(stderr, "failed to free!\n"); + fprintf(stderr, + "failed to free!\n"); rmesa->rmm->u_list[i].fb = NULL; } rmesa->rmm->u_list[i].ref_count = 0; @@ -183,93 +199,99 @@ int r300_mem_alloc(r300ContextPtr rmesa, int alignment, int size) } } rmesa->rmm->u_head = i; - + if (free == -1) { WARN_ONCE("Ran out of slots!\n"); //usleep(100); r300FlushCmdBuf(rmesa, __FUNCTION__); tries++; - if(tries>100){ + if (tries > 100) { WARN_ONCE("Ran out of slots!\n"); exit(1); } goto again; } - + alloc.region = RADEON_MEM_REGION_GART; alloc.alignment = alignment; alloc.size = size; alloc.region_offset = &offset; - ret = drmCommandWriteRead( rmesa->radeon.dri.fd, DRM_RADEON_ALLOC, &alloc, sizeof(alloc)); - if (ret) { + ret = + drmCommandWriteRead(rmesa->radeon.dri.fd, DRM_RADEON_ALLOC, &alloc, + sizeof(alloc)); + if (ret) { #if 0 WARN_ONCE("Ran out of mem!\n"); r300FlushCmdBuf(rmesa, __FUNCTION__); //usleep(100); tries2++; tries = 0; - if(tries2>100){ + if (tries2 > 100) { WARN_ONCE("Ran out of GART memory!\n"); exit(1); } goto again; #else - WARN_ONCE("Ran out of GART memory (for %d)!\nPlease consider adjusting GARTSize option.\n", size); + WARN_ONCE + ("Ran out of GART memory (for %d)!\nPlease consider adjusting GARTSize option.\n", + size); return 0; #endif } - + i = free; - + if (i > rmesa->rmm->u_last) rmesa->rmm->u_last = i; - - rmesa->rmm->u_list[i].ptr = ((GLubyte *)rmesa->radeon.radeonScreen->gartTextures.map) + offset; + + rmesa->rmm->u_list[i].ptr = + ((GLubyte *) rmesa->radeon.radeonScreen->gartTextures.map) + offset; rmesa->rmm->u_list[i].size = size; rmesa->rmm->u_list[i].age = 0; rmesa->rmm->u_list[i].fb = NULL; //fprintf(stderr, "alloc %p at id %d\n", rmesa->rmm->u_list[i].ptr, i); - + #ifdef MM_DEBUG - fprintf(stderr, "allocated %d at age %x\n", i, radeonGetAge((radeonContextPtr)rmesa)); + fprintf(stderr, "allocated %d at age %x\n", i, + radeonGetAge((radeonContextPtr) rmesa)); #endif - + return i; } #include "r300_emit.h" -static void emit_lin_cp(r300ContextPtr rmesa, unsigned long dst, unsigned long src, unsigned long size) +static void emit_lin_cp(r300ContextPtr rmesa, unsigned long dst, + unsigned long src, unsigned long size) { int cmd_reserved = 0; int cmd_written = 0; drm_radeon_cmd_header_t *cmd = NULL; int cp_size; - - - while (size > 0){ + + while (size > 0) { cp_size = size; - if(cp_size > /*8190*/4096) - cp_size = /*8190*/4096; - - reg_start(0x146c,1); + if (cp_size > /*8190 */ 4096) + cp_size = /*8190 */ 4096; + + reg_start(0x146c, 1); e32(0x52cc32fb); - - reg_start(0x15ac,1); + + reg_start(0x15ac, 1); e32(src); e32(cp_size); - - reg_start(0x1704,0); + + reg_start(0x1704, 0); e32(0x0); - reg_start(0x1404,1); + reg_start(0x1404, 1); e32(dst); e32(cp_size); - - reg_start(0x1700,0); + + reg_start(0x1700, 0); e32(0x0); - - reg_start(0x1640,3); + + reg_start(0x1640, 3); e32(0x00000000); e32(0x00001fff); e32(0x00000000); @@ -279,19 +301,19 @@ static void emit_lin_cp(r300ContextPtr rmesa, unsigned long dst, unsigned long s e32(0 << 16 | 0); e32(0 << 16 | 0); e32(cp_size << 16 | 0x1); - + dst += cp_size; src += cp_size; size -= cp_size; } - - reg_start(R300_RB3D_DSTCACHE_CTLSTAT,0); + + reg_start(R300_RB3D_DSTCACHE_CTLSTAT, 0); e32(R300_RB3D_DSTCACHE_UNKNOWN_0A); - - reg_start(0x342c,0); + + reg_start(0x342c, 0); e32(0x00000005); - - reg_start(0x1720,0); + + reg_start(0x1720, 0); e32(0x00010000); } @@ -299,196 +321,217 @@ void r300_mem_use(r300ContextPtr rmesa, int id) { uint64_t ull; #ifdef MM_DEBUG - fprintf(stderr, "%s: %d at age %x\n", __FUNCTION__, id, radeonGetAge((radeonContextPtr)rmesa)); -#endif + fprintf(stderr, "%s: %d at age %x\n", __FUNCTION__, id, + radeonGetAge((radeonContextPtr) rmesa)); +#endif drm_r300_cmd_header_t *cmd; - + assert(id <= rmesa->rmm->u_last); - - if(id == 0) + + if (id == 0) return; - -#if 0 /* FB VBOs. Needs further changes... */ - rmesa->rmm->u_list[id].ref_count ++; - if (rmesa->rmm->u_list[id].ref_count > 100 && rmesa->rmm->u_list[id].fb == NULL && - rmesa->rmm->u_list[id].size != RADEON_BUFFER_SIZE*16 /*&& rmesa->rmm->u_list[id].size > 40*/) { + +#if 0 /* FB VBOs. Needs further changes... */ + rmesa->rmm->u_list[id].ref_count++; + if (rmesa->rmm->u_list[id].ref_count > 100 + && rmesa->rmm->u_list[id].fb == NULL + && rmesa->rmm->u_list[id].size != + RADEON_BUFFER_SIZE * 16 /*&& rmesa->rmm->u_list[id].size > 40 */ ) { driTexHeap *heap; struct mem_block *mb; - + LOCK_HARDWARE(&(rmesa->radeon)); - + heap = rmesa->texture_heaps[0]; - - mb = mmAllocMem(heap->memory_heap, rmesa->rmm->u_list[id].size, heap->alignmentShift, 0); - + + mb = mmAllocMem(heap->memory_heap, rmesa->rmm->u_list[id].size, + heap->alignmentShift, 0); + UNLOCK_HARDWARE(&(rmesa->radeon)); - + if (mb) { rmesa->rmm->u_list[id].fb = mb; - - emit_lin_cp(rmesa, rmesa->radeon.radeonScreen->texOffset[0] + rmesa->rmm->u_list[id].fb->ofs, - r300GartOffsetFromVirtual(rmesa, rmesa->rmm->u_list[id].ptr), - rmesa->rmm->u_list[id].size); + + emit_lin_cp(rmesa, + rmesa->radeon.radeonScreen->texOffset[0] + + rmesa->rmm->u_list[id].fb->ofs, + r300GartOffsetFromVirtual(rmesa, + rmesa->rmm-> + u_list[id].ptr), + rmesa->rmm->u_list[id].size); } else { - WARN_ONCE("Upload to fb failed, %d, %d\n", rmesa->rmm->u_list[id].size, id); + WARN_ONCE("Upload to fb failed, %d, %d\n", + rmesa->rmm->u_list[id].size, id); } //fprintf(stderr, "Upload to fb! %d, %d\n", rmesa->rmm->u_list[id].ref_count, id); } /*if (rmesa->rmm->u_list[id].fb) { - emit_lin_cp(rmesa, rmesa->radeon.radeonScreen->texOffset[0] + rmesa->rmm->u_list[id].fb->ofs, - r300GartOffsetFromVirtual(rmesa, rmesa->rmm->u_list[id].ptr), - rmesa->rmm->u_list[id].size); - }*/ + emit_lin_cp(rmesa, rmesa->radeon.radeonScreen->texOffset[0] + rmesa->rmm->u_list[id].fb->ofs, + r300GartOffsetFromVirtual(rmesa, rmesa->rmm->u_list[id].ptr), + rmesa->rmm->u_list[id].size); + } */ #endif - - cmd = (drm_r300_cmd_header_t *)r300AllocCmdBuf(rmesa, 2 + sizeof(ull) / 4, __FUNCTION__); + + cmd = + (drm_r300_cmd_header_t *) r300AllocCmdBuf(rmesa, + 2 + sizeof(ull) / 4, + __FUNCTION__); cmd[0].scratch.cmd_type = R300_CMD_SCRATCH; cmd[0].scratch.reg = R300_MEM_SCRATCH; cmd[0].scratch.n_bufs = 1; cmd[0].scratch.flags = 0; - cmd ++; - - ull = (uint64_t)(intptr_t)&rmesa->rmm->u_list[id].age; + cmd++; + + ull = (uint64_t) (intptr_t) & rmesa->rmm->u_list[id].age; _mesa_memcpy(cmd, &ull, sizeof(ull)); cmd += sizeof(ull) / 4; - - cmd[0].u = /*id*/0; - - LOCK_HARDWARE(&rmesa->radeon); /* Protect from DRM. */ - rmesa->rmm->u_list[id].h_pending ++; + + cmd[0].u = /*id */ 0; + + LOCK_HARDWARE(&rmesa->radeon); /* Protect from DRM. */ + rmesa->rmm->u_list[id].h_pending++; UNLOCK_HARDWARE(&rmesa->radeon); } unsigned long r300_mem_offset(r300ContextPtr rmesa, int id) { unsigned long offset; - + assert(id <= rmesa->rmm->u_last); - + if (rmesa->rmm->u_list[id].fb) { - offset = rmesa->radeon.radeonScreen->texOffset[0] + rmesa->rmm->u_list[id].fb->ofs; + offset = + rmesa->radeon.radeonScreen->texOffset[0] + + rmesa->rmm->u_list[id].fb->ofs; } else { offset = (char *)rmesa->rmm->u_list[id].ptr - - (char *)rmesa->radeon.radeonScreen->gartTextures.map; + (char *)rmesa->radeon.radeonScreen->gartTextures.map; offset += rmesa->radeon.radeonScreen->gart_texture_offset; } - + return offset; } int r300_mem_on_card(r300ContextPtr rmesa, int id) { assert(id <= rmesa->rmm->u_last); - + if (rmesa->rmm->u_list[id].fb) return GL_TRUE; - + return GL_FALSE; } - + void *r300_mem_map(r300ContextPtr rmesa, int id, int access) { #ifdef MM_DEBUG - fprintf(stderr, "%s: %d at age %x\n", __FUNCTION__, id, radeonGetAge((radeonContextPtr)rmesa)); -#endif + fprintf(stderr, "%s: %d at age %x\n", __FUNCTION__, id, + radeonGetAge((radeonContextPtr) rmesa)); +#endif void *ptr; int tries = 0; - + assert(id <= rmesa->rmm->u_last); - + rmesa->rmm->u_list[id].ref_count = 0; if (rmesa->rmm->u_list[id].fb) { WARN_ONCE("Mapping fb!\n"); /* Idle gart only and do upload on unmap */ //rmesa->rmm->u_list[id].fb = NULL; - - - if(rmesa->rmm->u_list[id].mapped == 1) + + if (rmesa->rmm->u_list[id].mapped == 1) WARN_ONCE("buffer %d already mapped\n", id); - + rmesa->rmm->u_list[id].mapped = 1; ptr = r300_mem_ptr(rmesa, id); - + return ptr; } - + if (access == R300_MEM_R) { - - if(rmesa->rmm->u_list[id].mapped == 1) + + if (rmesa->rmm->u_list[id].mapped == 1) WARN_ONCE("buffer %d already mapped\n", id); - + rmesa->rmm->u_list[id].mapped = 1; ptr = r300_mem_ptr(rmesa, id); - + return ptr; } - - + if (rmesa->rmm->u_list[id].h_pending) r300FlushCmdBuf(rmesa, __FUNCTION__); - + if (rmesa->rmm->u_list[id].h_pending) { return NULL; } - - while(rmesa->rmm->u_list[id].age > radeonGetAge((radeonContextPtr)rmesa) && tries++ < 1000) + + while (rmesa->rmm->u_list[id].age > + radeonGetAge((radeonContextPtr) rmesa) && tries++ < 1000) usleep(10); - + if (tries >= 1000) { fprintf(stderr, "Idling failed (%x vs %x)\n", - rmesa->rmm->u_list[id].age, radeonGetAge((radeonContextPtr)rmesa)); + rmesa->rmm->u_list[id].age, + radeonGetAge((radeonContextPtr) rmesa)); return NULL; } - - if(rmesa->rmm->u_list[id].mapped == 1) + + if (rmesa->rmm->u_list[id].mapped == 1) WARN_ONCE("buffer %d already mapped\n", id); - + rmesa->rmm->u_list[id].mapped = 1; ptr = r300_mem_ptr(rmesa, id); - + return ptr; } void r300_mem_unmap(r300ContextPtr rmesa, int id) { #ifdef MM_DEBUG - fprintf(stderr, "%s: %d at age %x\n", __FUNCTION__, id, radeonGetAge((radeonContextPtr)rmesa)); -#endif - + fprintf(stderr, "%s: %d at age %x\n", __FUNCTION__, id, + radeonGetAge((radeonContextPtr) rmesa)); +#endif + assert(id <= rmesa->rmm->u_last); - - if(rmesa->rmm->u_list[id].mapped == 0) + + if (rmesa->rmm->u_list[id].mapped == 0) WARN_ONCE("buffer %d not mapped\n", id); - + rmesa->rmm->u_list[id].mapped = 0; - + if (rmesa->rmm->u_list[id].fb) - emit_lin_cp(rmesa, rmesa->radeon.radeonScreen->texOffset[0] + rmesa->rmm->u_list[id].fb->ofs, - r300GartOffsetFromVirtual(rmesa, rmesa->rmm->u_list[id].ptr), - rmesa->rmm->u_list[id].size); + emit_lin_cp(rmesa, + rmesa->radeon.radeonScreen->texOffset[0] + + rmesa->rmm->u_list[id].fb->ofs, + r300GartOffsetFromVirtual(rmesa, + rmesa->rmm->u_list[id]. + ptr), + rmesa->rmm->u_list[id].size); } void r300_mem_free(r300ContextPtr rmesa, int id) { #ifdef MM_DEBUG - fprintf(stderr, "%s: %d at age %x\n", __FUNCTION__, id, radeonGetAge((radeonContextPtr)rmesa)); -#endif - + fprintf(stderr, "%s: %d at age %x\n", __FUNCTION__, id, + radeonGetAge((radeonContextPtr) rmesa)); +#endif + assert(id <= rmesa->rmm->u_last); - - if(id == 0) + + if (id == 0) return; - - if(rmesa->rmm->u_list[id].ptr == NULL){ + + if (rmesa->rmm->u_list[id].ptr == NULL) { WARN_ONCE("Not allocated!\n"); - return ; + return; } - - if(rmesa->rmm->u_list[id].pending){ + + if (rmesa->rmm->u_list[id].pending) { WARN_ONCE("%p already pended!\n", rmesa->rmm->u_list[id].ptr); - return ; + return; } - + rmesa->rmm->u_list[id].pending = 1; } #endif -- cgit v1.2.3 From 6a69bb586445da4c6bdfa00fa775a9286ead3c31 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 21:08:56 +0000 Subject: r300: Removed deprecated/disabled VBO code from r300_mem.c Also removed a couple of unused fields from the r300_memory_manager structure. --- src/mesa/drivers/dri/r300/r300_context.c | 9 -- src/mesa/drivers/dri/r300/r300_mem.c | 158 +------------------------------ src/mesa/drivers/dri/r300/r300_mem.h | 5 +- 3 files changed, 4 insertions(+), 168 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 00ff9812b89..9ea14ab4c78 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -447,15 +447,6 @@ static void r300FreeGartAllocations(r300ContextPtr r300) r300->rmm->u_list[i].pending = 0; r300->rmm->u_list[i].ptr = NULL; - if (r300->rmm->u_list[i].fb) { - LOCK_HARDWARE(&(r300->radeon)); - ret = mmFreeMem(r300->rmm->u_list[i].fb); - UNLOCK_HARDWARE(&(r300->radeon)); - if (ret) - fprintf(stderr, "failed to free!\n"); - r300->rmm->u_list[i].fb = NULL; - } - r300->rmm->u_list[i].ref_count = 0; } } r300->rmm->u_head = i; diff --git a/src/mesa/drivers/dri/r300/r300_mem.c b/src/mesa/drivers/dri/r300/r300_mem.c index 21c5d22d1b4..f8f9d4fcdf1 100644 --- a/src/mesa/drivers/dri/r300/r300_mem.c +++ b/src/mesa/drivers/dri/r300/r300_mem.c @@ -181,19 +181,6 @@ int r300_mem_alloc(r300ContextPtr rmesa, int alignment, int size) allocated -= rmesa->rmm->u_list[i].size; rmesa->rmm->u_list[i].pending = 0; rmesa->rmm->u_list[i].ptr = NULL; - - if (rmesa->rmm->u_list[i].fb) { - LOCK_HARDWARE(&(rmesa->radeon)); - ret = - mmFreeMem(rmesa->rmm->u_list[i].fb); - UNLOCK_HARDWARE(&(rmesa->radeon)); - - if (ret != 0) - fprintf(stderr, - "failed to free!\n"); - rmesa->rmm->u_list[i].fb = NULL; - } - rmesa->rmm->u_list[i].ref_count = 0; free = i; } } @@ -249,7 +236,6 @@ int r300_mem_alloc(r300ContextPtr rmesa, int alignment, int size) ((GLubyte *) rmesa->radeon.radeonScreen->gartTextures.map) + offset; rmesa->rmm->u_list[i].size = size; rmesa->rmm->u_list[i].age = 0; - rmesa->rmm->u_list[i].fb = NULL; //fprintf(stderr, "alloc %p at id %d\n", rmesa->rmm->u_list[i].ptr, i); #ifdef MM_DEBUG @@ -260,63 +246,6 @@ int r300_mem_alloc(r300ContextPtr rmesa, int alignment, int size) return i; } -#include "r300_emit.h" -static void emit_lin_cp(r300ContextPtr rmesa, unsigned long dst, - unsigned long src, unsigned long size) -{ - int cmd_reserved = 0; - int cmd_written = 0; - drm_radeon_cmd_header_t *cmd = NULL; - int cp_size; - - while (size > 0) { - cp_size = size; - if (cp_size > /*8190 */ 4096) - cp_size = /*8190 */ 4096; - - reg_start(0x146c, 1); - e32(0x52cc32fb); - - reg_start(0x15ac, 1); - e32(src); - e32(cp_size); - - reg_start(0x1704, 0); - e32(0x0); - - reg_start(0x1404, 1); - e32(dst); - e32(cp_size); - - reg_start(0x1700, 0); - e32(0x0); - - reg_start(0x1640, 3); - e32(0x00000000); - e32(0x00001fff); - e32(0x00000000); - e32(0x00001fff); - - start_packet3(RADEON_CP_PACKET3_UNK1B, 2); - e32(0 << 16 | 0); - e32(0 << 16 | 0); - e32(cp_size << 16 | 0x1); - - dst += cp_size; - src += cp_size; - size -= cp_size; - } - - reg_start(R300_RB3D_DSTCACHE_CTLSTAT, 0); - e32(R300_RB3D_DSTCACHE_UNKNOWN_0A); - - reg_start(0x342c, 0); - e32(0x00000005); - - reg_start(0x1720, 0); - e32(0x00010000); -} - void r300_mem_use(r300ContextPtr rmesa, int id) { uint64_t ull; @@ -331,47 +260,6 @@ void r300_mem_use(r300ContextPtr rmesa, int id) if (id == 0) return; -#if 0 /* FB VBOs. Needs further changes... */ - rmesa->rmm->u_list[id].ref_count++; - if (rmesa->rmm->u_list[id].ref_count > 100 - && rmesa->rmm->u_list[id].fb == NULL - && rmesa->rmm->u_list[id].size != - RADEON_BUFFER_SIZE * 16 /*&& rmesa->rmm->u_list[id].size > 40 */ ) { - driTexHeap *heap; - struct mem_block *mb; - - LOCK_HARDWARE(&(rmesa->radeon)); - - heap = rmesa->texture_heaps[0]; - - mb = mmAllocMem(heap->memory_heap, rmesa->rmm->u_list[id].size, - heap->alignmentShift, 0); - - UNLOCK_HARDWARE(&(rmesa->radeon)); - - if (mb) { - rmesa->rmm->u_list[id].fb = mb; - - emit_lin_cp(rmesa, - rmesa->radeon.radeonScreen->texOffset[0] + - rmesa->rmm->u_list[id].fb->ofs, - r300GartOffsetFromVirtual(rmesa, - rmesa->rmm-> - u_list[id].ptr), - rmesa->rmm->u_list[id].size); - } else { - WARN_ONCE("Upload to fb failed, %d, %d\n", - rmesa->rmm->u_list[id].size, id); - } - //fprintf(stderr, "Upload to fb! %d, %d\n", rmesa->rmm->u_list[id].ref_count, id); - } - /*if (rmesa->rmm->u_list[id].fb) { - emit_lin_cp(rmesa, rmesa->radeon.radeonScreen->texOffset[0] + rmesa->rmm->u_list[id].fb->ofs, - r300GartOffsetFromVirtual(rmesa, rmesa->rmm->u_list[id].ptr), - rmesa->rmm->u_list[id].size); - } */ -#endif - cmd = (drm_r300_cmd_header_t *) r300AllocCmdBuf(rmesa, 2 + sizeof(ull) / 4, @@ -399,29 +287,13 @@ unsigned long r300_mem_offset(r300ContextPtr rmesa, int id) assert(id <= rmesa->rmm->u_last); - if (rmesa->rmm->u_list[id].fb) { - offset = - rmesa->radeon.radeonScreen->texOffset[0] + - rmesa->rmm->u_list[id].fb->ofs; - } else { - offset = (char *)rmesa->rmm->u_list[id].ptr - - (char *)rmesa->radeon.radeonScreen->gartTextures.map; - offset += rmesa->radeon.radeonScreen->gart_texture_offset; - } + offset = (char *)rmesa->rmm->u_list[id].ptr - + (char *)rmesa->radeon.radeonScreen->gartTextures.map; + offset += rmesa->radeon.radeonScreen->gart_texture_offset; return offset; } -int r300_mem_on_card(r300ContextPtr rmesa, int id) -{ - assert(id <= rmesa->rmm->u_last); - - if (rmesa->rmm->u_list[id].fb) - return GL_TRUE; - - return GL_FALSE; -} - void *r300_mem_map(r300ContextPtr rmesa, int id, int access) { #ifdef MM_DEBUG @@ -433,21 +305,6 @@ void *r300_mem_map(r300ContextPtr rmesa, int id, int access) assert(id <= rmesa->rmm->u_last); - rmesa->rmm->u_list[id].ref_count = 0; - if (rmesa->rmm->u_list[id].fb) { - WARN_ONCE("Mapping fb!\n"); - /* Idle gart only and do upload on unmap */ - //rmesa->rmm->u_list[id].fb = NULL; - - if (rmesa->rmm->u_list[id].mapped == 1) - WARN_ONCE("buffer %d already mapped\n", id); - - rmesa->rmm->u_list[id].mapped = 1; - ptr = r300_mem_ptr(rmesa, id); - - return ptr; - } - if (access == R300_MEM_R) { if (rmesa->rmm->u_list[id].mapped == 1) @@ -499,15 +356,6 @@ void r300_mem_unmap(r300ContextPtr rmesa, int id) WARN_ONCE("buffer %d not mapped\n", id); rmesa->rmm->u_list[id].mapped = 0; - - if (rmesa->rmm->u_list[id].fb) - emit_lin_cp(rmesa, - rmesa->radeon.radeonScreen->texOffset[0] + - rmesa->rmm->u_list[id].fb->ofs, - r300GartOffsetFromVirtual(rmesa, - rmesa->rmm->u_list[id]. - ptr), - rmesa->rmm->u_list[id].size); } void r300_mem_free(r300ContextPtr rmesa, int id) diff --git a/src/mesa/drivers/dri/r300/r300_mem.h b/src/mesa/drivers/dri/r300/r300_mem.h index 1e99b176383..d2932380ec6 100644 --- a/src/mesa/drivers/dri/r300/r300_mem.h +++ b/src/mesa/drivers/dri/r300/r300_mem.h @@ -18,10 +18,8 @@ struct r300_memory_manager { uint32_t h_pending; int pending; int mapped; - int ref_count; - struct mem_block *fb; } *u_list; - int u_head, u_tail, u_size, u_last; + int u_head, u_size, u_last; }; @@ -32,7 +30,6 @@ extern int r300_mem_find(r300ContextPtr rmesa, void *ptr); extern int r300_mem_alloc(r300ContextPtr rmesa, int alignment, int size); extern void r300_mem_use(r300ContextPtr rmesa, int id); extern unsigned long r300_mem_offset(r300ContextPtr rmesa, int id); -extern int r300_mem_on_card(r300ContextPtr rmesa, int id); extern void *r300_mem_map(r300ContextPtr rmesa, int id, int access); extern void r300_mem_unmap(r300ContextPtr rmesa, int id); extern void r300_mem_free(r300ContextPtr rmesa, int id); -- cgit v1.2.3 From ef29d6af6c24487a66155586feb9ab3eb0c3a229 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 21:22:37 +0000 Subject: r300: Removed the r300BindProgram function; mesa default does better checking. --- src/mesa/drivers/dri/r300/r300_shader.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_shader.c b/src/mesa/drivers/dri/r300/r300_shader.c index f54a4f9f474..ac4ed441cb2 100644 --- a/src/mesa/drivers/dri/r300/r300_shader.c +++ b/src/mesa/drivers/dri/r300/r300_shader.c @@ -7,19 +7,6 @@ #include "r300_context.h" #include "r300_fragprog.h" -static void -r300BindProgram(GLcontext * ctx, GLenum target, struct gl_program *prog) -{ - switch (target) { - case GL_VERTEX_PROGRAM_ARB: - case GL_FRAGMENT_PROGRAM_ARB: - break; - default: - WARN_ONCE("Target not supported yet!\n"); - break; - } -} - static struct gl_program *r300NewProgram(GLcontext * ctx, GLenum target, GLuint id) { @@ -62,9 +49,7 @@ r300ProgramStringNotify(GLcontext * ctx, GLenum target, struct gl_program *prog) switch (target) { case GL_VERTEX_PROGRAM_ARB: vp->progs = NULL; - /*vp->translated = GL_FALSE; - memset(&vp->translated, 0, sizeof(struct r300_vertex_program) - sizeof(struct gl_vertex_program)); */ - /*r300TranslateVertexShader(vp); */ + vp->translated = GL_FALSE; break; case GL_FRAGMENT_PROGRAM_ARB: fp->translated = GL_FALSE; @@ -83,7 +68,6 @@ r300IsProgramNative(GLcontext * ctx, GLenum target, struct gl_program *prog) void r300InitShaderFuncs(struct dd_function_table *functions) { functions->NewProgram = r300NewProgram; - functions->BindProgram = r300BindProgram; functions->DeleteProgram = r300DeleteProgram; functions->ProgramStringNotify = r300ProgramStringNotify; functions->IsProgramNative = r300IsProgramNative; -- cgit v1.2.3 From bcaf8fc7b10327fd7936b22ec9b552e93497cee4 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 21:31:22 +0000 Subject: r300: Cleaned up the blend factor function. --- src/mesa/drivers/dri/r300/r300_state.c | 36 ++++++++++++++++------------------ 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 4f25ff7e812..625797b4b9f 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -97,60 +97,58 @@ static void r300BlendColor(GLcontext * ctx, const GLfloat cf[4]) */ static int blend_factor(GLenum factor, GLboolean is_src) { - int func; - switch (factor) { case GL_ZERO: - func = R300_BLEND_GL_ZERO; + return R300_BLEND_GL_ZERO; break; case GL_ONE: - func = R300_BLEND_GL_ONE; + return R300_BLEND_GL_ONE; break; case GL_DST_COLOR: - func = R300_BLEND_GL_DST_COLOR; + return R300_BLEND_GL_DST_COLOR; break; case GL_ONE_MINUS_DST_COLOR: - func = R300_BLEND_GL_ONE_MINUS_DST_COLOR; + return R300_BLEND_GL_ONE_MINUS_DST_COLOR; break; case GL_SRC_COLOR: - func = R300_BLEND_GL_SRC_COLOR; + return R300_BLEND_GL_SRC_COLOR; break; case GL_ONE_MINUS_SRC_COLOR: - func = R300_BLEND_GL_ONE_MINUS_SRC_COLOR; + return R300_BLEND_GL_ONE_MINUS_SRC_COLOR; break; case GL_SRC_ALPHA: - func = R300_BLEND_GL_SRC_ALPHA; + return R300_BLEND_GL_SRC_ALPHA; break; case GL_ONE_MINUS_SRC_ALPHA: - func = R300_BLEND_GL_ONE_MINUS_SRC_ALPHA; + return R300_BLEND_GL_ONE_MINUS_SRC_ALPHA; break; case GL_DST_ALPHA: - func = R300_BLEND_GL_DST_ALPHA; + return R300_BLEND_GL_DST_ALPHA; break; case GL_ONE_MINUS_DST_ALPHA: - func = R300_BLEND_GL_ONE_MINUS_DST_ALPHA; + return R300_BLEND_GL_ONE_MINUS_DST_ALPHA; break; case GL_SRC_ALPHA_SATURATE: - func = (is_src) ? R300_BLEND_GL_SRC_ALPHA_SATURATE : + return (is_src) ? R300_BLEND_GL_SRC_ALPHA_SATURATE : R300_BLEND_GL_ZERO; break; case GL_CONSTANT_COLOR: - func = R300_BLEND_GL_CONST_COLOR; + return R300_BLEND_GL_CONST_COLOR; break; case GL_ONE_MINUS_CONSTANT_COLOR: - func = R300_BLEND_GL_ONE_MINUS_CONST_COLOR; + return R300_BLEND_GL_ONE_MINUS_CONST_COLOR; break; case GL_CONSTANT_ALPHA: - func = R300_BLEND_GL_CONST_ALPHA; + return R300_BLEND_GL_CONST_ALPHA; break; case GL_ONE_MINUS_CONSTANT_ALPHA: - func = R300_BLEND_GL_ONE_MINUS_CONST_ALPHA; + return R300_BLEND_GL_ONE_MINUS_CONST_ALPHA; break; default: fprintf(stderr, "unknown blend factor %x\n", factor); - func = (is_src) ? R300_BLEND_GL_ONE : R300_BLEND_GL_ZERO; + return (is_src) ? R300_BLEND_GL_ONE : R300_BLEND_GL_ZERO; + break; } - return func; } /** -- cgit v1.2.3 From 67363327e59a2f4699802b1a26c232ad092c1c6e Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 21:36:13 +0000 Subject: r300: Corrected a small error from 37cbf38c344012f9d6e938937dac3697b73721a8. --- src/mesa/drivers/dri/r300/r300_shader.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mesa/drivers/dri/r300/r300_shader.c b/src/mesa/drivers/dri/r300/r300_shader.c index ac4ed441cb2..59fe17ba10e 100644 --- a/src/mesa/drivers/dri/r300/r300_shader.c +++ b/src/mesa/drivers/dri/r300/r300_shader.c @@ -49,7 +49,6 @@ r300ProgramStringNotify(GLcontext * ctx, GLenum target, struct gl_program *prog) switch (target) { case GL_VERTEX_PROGRAM_ARB: vp->progs = NULL; - vp->translated = GL_FALSE; break; case GL_FRAGMENT_PROGRAM_ARB: fp->translated = GL_FALSE; -- cgit v1.2.3 From 3f709f16ef1feb7c5e6f67c1deef56d97695a86d Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 21:40:00 +0000 Subject: r300: Enable hardware 3D texture support. Fixes the stex3d demo. --- src/mesa/drivers/dri/r300/r300_tex.c | 14 -------------- src/mesa/drivers/dri/r300/r300_texstate.c | 10 ++-------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c index d78e3dfb23e..a8be0f6ff74 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.c +++ b/src/mesa/drivers/dri/r300/r300_tex.c @@ -876,7 +876,6 @@ static void r300CompressedTexSubImage2D(GLcontext * ctx, GLenum target, t->dirty_images[face] |= (1 << level); } -#if ENABLE_HW_3D_TEXTURE static void r300TexImage3D(GLcontext * ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint height, GLint depth, @@ -930,9 +929,7 @@ static void r300TexImage3D(GLcontext * ctx, GLenum target, GLint level, t->dirty_images[0] |= (1 << level); } } -#endif -#if ENABLE_HW_3D_TEXTURE static void r300TexSubImage3D(GLcontext * ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, @@ -966,7 +963,6 @@ r300TexSubImage3D(GLcontext * ctx, GLenum target, GLint level, t->dirty_images[0] |= (1 << level); } -#endif static void r300TexEnv(GLcontext * ctx, GLenum target, GLenum pname, const GLfloat * param) @@ -1087,9 +1083,7 @@ static void r300BindTexture(GLcontext * ctx, GLenum target, if ((target == GL_TEXTURE_1D) || (target == GL_TEXTURE_2D) -#if ENABLE_HW_3D_TEXTURE || (target == GL_TEXTURE_3D) -#endif || (target == GL_TEXTURE_CUBE_MAP) || (target == GL_TEXTURE_RECTANGLE_NV)) { assert(texObj->DriverData != NULL); @@ -1150,18 +1144,10 @@ void r300InitTextureFuncs(struct dd_function_table *functions) functions->ChooseTextureFormat = r300ChooseTextureFormat; functions->TexImage1D = r300TexImage1D; functions->TexImage2D = r300TexImage2D; -#if ENABLE_HW_3D_TEXTURE functions->TexImage3D = r300TexImage3D; -#else - functions->TexImage3D = _mesa_store_teximage3d; -#endif functions->TexSubImage1D = r300TexSubImage1D; functions->TexSubImage2D = r300TexSubImage2D; -#if ENABLE_HW_3D_TEXTURE functions->TexSubImage3D = r300TexSubImage3D; -#else - functions->TexSubImage3D = _mesa_store_texsubimage3d; -#endif functions->NewTextureObject = r300NewTextureObject; functions->BindTexture = r300BindTexture; functions->DeleteTexture = r300DeleteTexture; diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index bef597e4dc0..8b36bd8bb2b 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -420,7 +420,6 @@ static GLboolean enable_tex_2d(GLcontext * ctx, int unit) return GL_TRUE; } -#if ENABLE_HW_3D_TEXTURE static GLboolean enable_tex_3d(GLcontext * ctx, int unit) { r300ContextPtr rmesa = R300_CONTEXT(ctx); @@ -445,7 +444,6 @@ static GLboolean enable_tex_3d(GLcontext * ctx, int unit) return GL_TRUE; } -#endif static GLboolean enable_tex_cube(GLcontext * ctx, int unit) { @@ -546,14 +544,10 @@ static GLboolean r300UpdateTextureUnit(GLcontext * ctx, int unit) } else if (texUnit->_ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT)) { return (enable_tex_2d(ctx, unit) && update_tex_common(ctx, unit)); - } -#if ENABLE_HW_3D_TEXTURE - else if (texUnit->_ReallyEnabled & (TEXTURE_3D_BIT)) { + } else if (texUnit->_ReallyEnabled & (TEXTURE_3D_BIT)) { return (enable_tex_3d(ctx, unit) && update_tex_common(ctx, unit)); - } -#endif - else if (texUnit->_ReallyEnabled & (TEXTURE_CUBE_BIT)) { + } else if (texUnit->_ReallyEnabled & (TEXTURE_CUBE_BIT)) { return (enable_tex_cube(ctx, unit) && update_tex_common(ctx, unit)); } else if (texUnit->_ReallyEnabled) { -- cgit v1.2.3 From b6087270a092adc18223864a9e961c59404ce1dd Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 21:45:14 +0000 Subject: r300: Cleaned up function names in r300_texstate.c. --- src/mesa/drivers/dri/r300/r300_texstate.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index 8b36bd8bb2b..705502ebf2b 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -400,7 +400,7 @@ static void r300SetTexImages(r300ContextPtr rmesa, * Texture unit state management */ -static GLboolean enable_tex_2d(GLcontext * ctx, int unit) +static GLboolean r300EnableTexture2D(GLcontext * ctx, int unit) { r300ContextPtr rmesa = R300_CONTEXT(ctx); struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; @@ -420,7 +420,7 @@ static GLboolean enable_tex_2d(GLcontext * ctx, int unit) return GL_TRUE; } -static GLboolean enable_tex_3d(GLcontext * ctx, int unit) +static GLboolean r300EnableTexture3D(GLcontext * ctx, int unit) { r300ContextPtr rmesa = R300_CONTEXT(ctx); struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; @@ -445,7 +445,7 @@ static GLboolean enable_tex_3d(GLcontext * ctx, int unit) return GL_TRUE; } -static GLboolean enable_tex_cube(GLcontext * ctx, int unit) +static GLboolean r300EnableTextureCube(GLcontext * ctx, int unit) { r300ContextPtr rmesa = R300_CONTEXT(ctx); struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; @@ -481,7 +481,7 @@ static GLboolean enable_tex_cube(GLcontext * ctx, int unit) return GL_TRUE; } -static GLboolean enable_tex_rect(GLcontext * ctx, int unit) +static GLboolean r300EnableTextureRect(GLcontext * ctx, int unit) { r300ContextPtr rmesa = R300_CONTEXT(ctx); struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; @@ -501,7 +501,7 @@ static GLboolean enable_tex_rect(GLcontext * ctx, int unit) return GL_TRUE; } -static GLboolean update_tex_common(GLcontext * ctx, int unit) +static GLboolean r300UpdateTexture(GLcontext * ctx, int unit) { r300ContextPtr rmesa = R300_CONTEXT(ctx); struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; @@ -539,17 +539,17 @@ static GLboolean r300UpdateTextureUnit(GLcontext * ctx, int unit) struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; if (texUnit->_ReallyEnabled & (TEXTURE_RECT_BIT)) { - return (enable_tex_rect(ctx, unit) && - update_tex_common(ctx, unit)); + return (r300EnableTextureRect(ctx, unit) && + r300UpdateTexture(ctx, unit)); } else if (texUnit->_ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT)) { - return (enable_tex_2d(ctx, unit) && - update_tex_common(ctx, unit)); + return (r300EnableTexture2D(ctx, unit) && + r300UpdateTexture(ctx, unit)); } else if (texUnit->_ReallyEnabled & (TEXTURE_3D_BIT)) { - return (enable_tex_3d(ctx, unit) && - update_tex_common(ctx, unit)); + return (r300EnableTexture3D(ctx, unit) && + r300UpdateTexture(ctx, unit)); } else if (texUnit->_ReallyEnabled & (TEXTURE_CUBE_BIT)) { - return (enable_tex_cube(ctx, unit) && - update_tex_common(ctx, unit)); + return (r300EnableTextureCube(ctx, unit) && + r300UpdateTexture(ctx, unit)); } else if (texUnit->_ReallyEnabled) { return GL_FALSE; } else { -- cgit v1.2.3 From 0aa998b2ab6fdfe139b54de9868e2383440685d0 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 21:56:10 +0000 Subject: r300: Merged radeon_span.c. --- src/mesa/drivers/dri/r300/.gitignore | 2 +- src/mesa/drivers/dri/r300/Makefile | 2 +- src/mesa/drivers/dri/r300/radeon_span.c | 321 ------------------------------ src/mesa/drivers/dri/radeon/radeon_span.c | 7 +- 4 files changed, 8 insertions(+), 324 deletions(-) delete mode 100644 src/mesa/drivers/dri/r300/radeon_span.c diff --git a/src/mesa/drivers/dri/r300/.gitignore b/src/mesa/drivers/dri/r300/.gitignore index 3689a6a78e5..3a308633597 100644 --- a/src/mesa/drivers/dri/r300/.gitignore +++ b/src/mesa/drivers/dri/r300/.gitignore @@ -1,4 +1,4 @@ radeon_chipset.h radeon_screen.[ch] -radeon_span.h +radeon_span.[ch] server diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile index c1d223c7600..46b38a944a3 100644 --- a/src/mesa/drivers/dri/r300/Makefile +++ b/src/mesa/drivers/dri/r300/Makefile @@ -25,7 +25,6 @@ DRIVER_SOURCES = \ radeon_context.c \ radeon_ioctl.c \ radeon_lock.c \ - radeon_span.c \ radeon_state.c \ r300_mem.c \ \ @@ -60,6 +59,7 @@ COMMON_SYMLINKS = \ radeon_chipset.h \ radeon_screen.c \ radeon_screen.h \ + radeon_span.c \ radeon_span.h ##### TARGETS ##### diff --git a/src/mesa/drivers/dri/r300/radeon_span.c b/src/mesa/drivers/dri/r300/radeon_span.c deleted file mode 100644 index eae09d6b35e..00000000000 --- a/src/mesa/drivers/dri/r300/radeon_span.c +++ /dev/null @@ -1,321 +0,0 @@ -/************************************************************************** - -Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. -Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and - VA Linux Systems Inc., Fremont, California. - -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. - -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial -portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Kevin E. Martin - * Gareth Hughes - * Keith Whitwell - * - */ - -#include "glheader.h" -#include "swrast/swrast.h" - -#include "r300_state.h" -#include "radeon_ioctl.h" -#include "r300_ioctl.h" -#include "radeon_span.h" - -#include "drirenderbuffer.h" - -#define DBG 0 - -/* - * Note that all information needed to access pixels in a renderbuffer - * should be obtained through the gl_renderbuffer parameter, not per-context - * information. - */ -#define LOCAL_VARS \ - driRenderbuffer *drb = (driRenderbuffer *) rb; \ - const __DRIdrawablePrivate *dPriv = drb->dPriv; \ - const GLuint bottom = dPriv->h - 1; \ - GLubyte *buf = (GLubyte *) drb->flippedData \ - + (dPriv->y * drb->flippedPitch + dPriv->x) * drb->cpp; \ - GLuint p; \ - (void) p; - -#define LOCAL_DEPTH_VARS \ - driRenderbuffer *drb = (driRenderbuffer *) rb; \ - const __DRIdrawablePrivate *dPriv = drb->dPriv; \ - const GLuint bottom = dPriv->h - 1; \ - GLuint xo = dPriv->x; \ - GLuint yo = dPriv->y; \ - GLubyte *buf = (GLubyte *) drb->Base.Data; - -#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS - -#define Y_FLIP(Y) (bottom - (Y)) - -#define HW_LOCK() - -#define HW_UNLOCK() - -/* ================================================================ - * Color buffer - */ - -/* 16 bit, RGB565 color spanline and pixel functions - */ -#define SPANTMP_PIXEL_FMT GL_RGB -#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5 - -#define TAG(x) radeon##x##_RGB565 -#define TAG2(x,y) radeon##x##_RGB565##y -#define GET_PTR(X,Y) (buf + ((Y) * drb->flippedPitch + (X)) * 2) -#include "spantmp2.h" - -/* 32 bit, ARGB8888 color spanline and pixel functions - */ -#define SPANTMP_PIXEL_FMT GL_BGRA -#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV - -#define TAG(x) radeon##x##_ARGB8888 -#define TAG2(x,y) radeon##x##_ARGB8888##y -#define GET_PTR(X,Y) (buf + ((Y) * drb->flippedPitch + (X)) * 4) -#include "spantmp2.h" - -/* ================================================================ - * Depth buffer - */ - -/* The Radeon family has depth tiling on all the time, so we have to convert - * the x,y coordinates into the memory bus address (mba) in the same - * manner as the engine. In each case, the linear block address (ba) - * is calculated, and then wired with x and y to produce the final - * memory address. - * The chip will do address translation on its own if the surface registers - * are set up correctly. It is not quite enough to get it working with hyperz - * too... - */ - -static GLuint radeon_mba_z32(const driRenderbuffer * drb, GLint x, GLint y) -{ - GLuint pitch = drb->pitch; - if (drb->depthHasSurface) { - return 4 * (x + y * pitch); - } else { - GLuint ba, address = 0; /* a[0..1] = 0 */ - -#ifdef COMPILE_R300 - ba = (y / 8) * (pitch / 8) + (x / 8); -#else - ba = (y / 16) * (pitch / 16) + (x / 16); -#endif - - address |= (x & 0x7) << 2; /* a[2..4] = x[0..2] */ - address |= (y & 0x3) << 5; /* a[5..6] = y[0..1] */ - address |= (((x & 0x10) >> 2) ^ (y & 0x4)) << 5; /* a[7] = x[4] ^ y[2] */ - address |= (ba & 0x3) << 8; /* a[8..9] = ba[0..1] */ - - address |= (y & 0x8) << 7; /* a[10] = y[3] */ - address |= (((x & 0x8) << 1) ^ (y & 0x10)) << 7; /* a[11] = x[3] ^ y[4] */ - address |= (ba & ~0x3) << 10; /* a[12..] = ba[2..] */ - - return address; - } -} - -static INLINE GLuint -radeon_mba_z16(const driRenderbuffer * drb, GLint x, GLint y) -{ - GLuint pitch = drb->pitch; - if (drb->depthHasSurface) { - return 2 * (x + y * pitch); - } else { - GLuint ba, address = 0; /* a[0] = 0 */ - - ba = (y / 16) * (pitch / 32) + (x / 32); - - address |= (x & 0x7) << 1; /* a[1..3] = x[0..2] */ - address |= (y & 0x7) << 4; /* a[4..6] = y[0..2] */ - address |= (x & 0x8) << 4; /* a[7] = x[3] */ - address |= (ba & 0x3) << 8; /* a[8..9] = ba[0..1] */ - address |= (y & 0x8) << 7; /* a[10] = y[3] */ - address |= ((x & 0x10) ^ (y & 0x10)) << 7; /* a[11] = x[4] ^ y[4] */ - address |= (ba & ~0x3) << 10; /* a[12..] = ba[2..] */ - - return address; - } -} - -/* 16-bit depth buffer functions - */ -#define WRITE_DEPTH( _x, _y, d ) \ - *(GLushort *)(buf + radeon_mba_z16( drb, _x + xo, _y + yo )) = d; - -#define READ_DEPTH( d, _x, _y ) \ - d = *(GLushort *)(buf + radeon_mba_z16( drb, _x + xo, _y + yo )); - -#define TAG(x) radeon##x##_z16 -#include "depthtmp.h" - -/* 24 bit depth, 8 bit stencil depthbuffer functions - * - * Careful: It looks like the R300 uses ZZZS byte order while the R200 - * uses SZZZ for 24 bit depth, 8 bit stencil mode. - */ -#ifdef COMPILE_R300 -#define WRITE_DEPTH( _x, _y, d ) \ -do { \ - GLuint offset = radeon_mba_z32( drb, _x + xo, _y + yo ); \ - GLuint tmp = *(GLuint *)(buf + offset); \ - tmp &= 0x000000ff; \ - tmp |= ((d << 8) & 0xffffff00); \ - *(GLuint *)(buf + offset) = tmp; \ -} while (0) -#else -#define WRITE_DEPTH( _x, _y, d ) \ -do { \ - GLuint offset = radeon_mba_z32( drb, _x + xo, _y + yo ); \ - GLuint tmp = *(GLuint *)(buf + offset); \ - tmp &= 0xff000000; \ - tmp |= ((d) & 0x00ffffff); \ - *(GLuint *)(buf + offset) = tmp; \ -} while (0) -#endif - -#ifdef COMPILE_R300 -#define READ_DEPTH( d, _x, _y ) \ - do { \ - d = (*(GLuint *)(buf + radeon_mba_z32( drb, _x + xo, \ - _y + yo )) & 0xffffff00) >> 8; \ - }while(0) -#else -#define READ_DEPTH( d, _x, _y ) \ - d = *(GLuint *)(buf + radeon_mba_z32( drb, _x + xo, \ - _y + yo )) & 0x00ffffff; -#endif - -#define TAG(x) radeon##x##_z24_s8 -#include "depthtmp.h" - -/* ================================================================ - * Stencil buffer - */ - -/* 24 bit depth, 8 bit stencil depthbuffer functions - */ -#ifdef COMPILE_R300 -#define WRITE_STENCIL( _x, _y, d ) \ -do { \ - GLuint offset = radeon_mba_z32( drb, _x + xo, _y + yo ); \ - GLuint tmp = *(GLuint *)(buf + offset); \ - tmp &= 0xffffff00; \ - tmp |= (d) & 0xff; \ - *(GLuint *)(buf + offset) = tmp; \ -} while (0) -#else -#define WRITE_STENCIL( _x, _y, d ) \ -do { \ - GLuint offset = radeon_mba_z32( drb, _x + xo, _y + yo ); \ - GLuint tmp = *(GLuint *)(buf + offset); \ - tmp &= 0x00ffffff; \ - tmp |= (((d) & 0xff) << 24); \ - *(GLuint *)(buf + offset) = tmp; \ -} while (0) -#endif - -#ifdef COMPILE_R300 -#define READ_STENCIL( d, _x, _y ) \ -do { \ - GLuint offset = radeon_mba_z32( drb, _x + xo, _y + yo ); \ - GLuint tmp = *(GLuint *)(buf + offset); \ - d = tmp & 0x000000ff; \ -} while (0) -#else -#define READ_STENCIL( d, _x, _y ) \ -do { \ - GLuint offset = radeon_mba_z32( drb, _x + xo, _y + yo ); \ - GLuint tmp = *(GLuint *)(buf + offset); \ - d = (tmp & 0xff000000) >> 24; \ -} while (0) -#endif - -#define TAG(x) radeon##x##_z24_s8 -#include "stenciltmp.h" - -/* Move locking out to get reasonable span performance (10x better - * than doing this in HW_LOCK above). WaitForIdle() is the main - * culprit. - */ - -static void radeonSpanRenderStart(GLcontext * ctx) -{ - radeonContextPtr rmesa = RADEON_CONTEXT(ctx); -#ifdef COMPILE_R300 - r300ContextPtr r300 = (r300ContextPtr) rmesa; - R300_FIREVERTICES(r300); -#else - RADEON_FIREVERTICES(rmesa); -#endif - LOCK_HARDWARE(rmesa); - radeonWaitForIdleLocked(rmesa); -} - -static void radeonSpanRenderFinish(GLcontext * ctx) -{ - radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - _swrast_flush(ctx); - UNLOCK_HARDWARE(rmesa); -} - -void radeonInitSpanFuncs(GLcontext * ctx) -{ - struct swrast_device_driver *swdd = - _swrast_GetDeviceDriverReference(ctx); - swdd->SpanRenderStart = radeonSpanRenderStart; - swdd->SpanRenderFinish = radeonSpanRenderFinish; -} - -/** - * Plug in the Get/Put routines for the given driRenderbuffer. - */ -void radeonSetSpanFunctions(driRenderbuffer * drb, const GLvisual * vis) -{ - if (drb->Base.InternalFormat == GL_RGBA) { - if (vis->redBits == 5 && vis->greenBits == 6 - && vis->blueBits == 5) { - radeonInitPointers_RGB565(&drb->Base); - } else { - radeonInitPointers_ARGB8888(&drb->Base); - } - } else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { - radeonInitDepthPointers_z16(&drb->Base); - } else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { - radeonInitDepthPointers_z24_s8(&drb->Base); - } else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { - radeonInitStencilPointers_z24_s8(&drb->Base); - } -} diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index 732a85ecf0b..4551190d10c 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -43,11 +43,16 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "glheader.h" #include "swrast/swrast.h" +#ifdef COMPILE_R300 +#include "r300_ioctl.h" +#include "r300_state.h" +#else #include "radeon_context.h" #include "radeon_ioctl.h" #include "radeon_state.h" -#include "radeon_span.h" #include "radeon_tex.h" +#endif +#include "radeon_span.h" #include "drirenderbuffer.h" -- cgit v1.2.3 From 98d25a5a28b1d6e4ed299904aec4104f7d6c80b0 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 22:02:52 +0000 Subject: r300: Initial work on merging radeon_lock.[ch]. --- src/mesa/drivers/dri/r300/radeon_lock.c | 94 +++++++++++++----------- src/mesa/drivers/dri/r300/radeon_lock.h | 9 ++- src/mesa/drivers/dri/radeon/radeon_lock.c | 117 +++++++++++++++--------------- src/mesa/drivers/dri/radeon/radeon_lock.h | 10 ++- 4 files changed, 127 insertions(+), 103 deletions(-) diff --git a/src/mesa/drivers/dri/r300/radeon_lock.c b/src/mesa/drivers/dri/r300/radeon_lock.c index 0d0d9ab7f06..978d2fae0cc 100644 --- a/src/mesa/drivers/dri/r300/radeon_lock.c +++ b/src/mesa/drivers/dri/r300/radeon_lock.c @@ -1,10 +1,15 @@ -/* +/************************************************************************** + +Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and + VA Linux Systems Inc., Fremont, California. 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. +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 @@ -29,9 +34,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /* * Authors: + * Gareth Hughes * Keith Whitwell + * Kevin E. Martin */ -#include #include "radeon_lock.h" #include "radeon_ioctl.h" @@ -50,53 +56,57 @@ int prevLockLine = 0; /* Turn on/off page flipping according to the flags in the sarea: */ -void radeonUpdatePageFlipping(radeonContextPtr radeon) +void radeonUpdatePageFlipping(radeonContextPtr rmesa) { int use_back; - radeon->doPageFlip = radeon->sarea->pfState; - if (radeon->glCtx->WinSysDrawBuffer) { - driFlipRenderbuffers(radeon->glCtx->WinSysDrawBuffer, radeon->sarea->pfCurrentPage); - r300UpdateDrawBuffer(radeon->glCtx); - } + rmesa->doPageFlip = rmesa->sarea->pfState; + if (rmesa->glCtx->WinSysDrawBuffer) { + driFlipRenderbuffers(rmesa->glCtx->WinSysDrawBuffer, + rmesa->sarea->pfCurrentPage); + r300UpdateDrawBuffer(rmesa->glCtx); + } - use_back = radeon->glCtx->DrawBuffer ? - (radeon->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == - BUFFER_BIT_BACK_LEFT) : 1; - use_back ^= (radeon->sarea->pfCurrentPage == 1); + use_back = rmesa->glCtx->DrawBuffer ? + (rmesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == + BUFFER_BIT_BACK_LEFT) : 1; + use_back ^= (rmesa->sarea->pfCurrentPage == 1); if (use_back) { - radeon->state.color.drawOffset = radeon->radeonScreen->backOffset; - radeon->state.color.drawPitch = radeon->radeonScreen->backPitch; + rmesa->state.color.drawOffset = + rmesa->radeonScreen->backOffset; + rmesa->state.color.drawPitch = rmesa->radeonScreen->backPitch; } else { - radeon->state.color.drawOffset = radeon->radeonScreen->frontOffset; - radeon->state.color.drawPitch = radeon->radeonScreen->frontPitch; + rmesa->state.color.drawOffset = + rmesa->radeonScreen->frontOffset; + rmesa->state.color.drawPitch = + rmesa->radeonScreen->frontPitch; } } /** * Called by radeonGetLock() after the lock has been obtained. */ -static void r300RegainedLock(radeonContextPtr radeon) -{ +static void r300RegainedLock(radeonContextPtr rmesa) +{ int i; - __DRIdrawablePrivate *const drawable = radeon->dri.drawable; - r300ContextPtr r300 = (r300ContextPtr)radeon; - drm_radeon_sarea_t *sarea = radeon->sarea; + __DRIdrawablePrivate *const drawable = rmesa->dri.drawable; + r300ContextPtr r300 = (r300ContextPtr) rmesa; + drm_radeon_sarea_t *sarea = rmesa->sarea; - if ( radeon->lastStamp != drawable->lastStamp ) { - radeonUpdatePageFlipping(radeon); - radeonSetCliprects(radeon); + if (rmesa->lastStamp != drawable->lastStamp) { + radeonUpdatePageFlipping(rmesa); + radeonSetCliprects(rmesa); #if 1 - r300UpdateViewportOffset( radeon->glCtx ); - driUpdateFramebufferSize(radeon->glCtx, drawable); + r300UpdateViewportOffset(rmesa->glCtx); + driUpdateFramebufferSize(rmesa->glCtx, drawable); #else - radeonUpdateScissor(radeon->glCtx); + radeonUpdateScissor(rmesa->glCtx); #endif } - if (sarea->ctx_owner != radeon->dri.hwContext) { - sarea->ctx_owner = radeon->dri.hwContext; + if (sarea->ctx_owner != rmesa->dri.hwContext) { + sarea->ctx_owner = rmesa->dri.hwContext; for (i = 0; i < r300->nr_heaps; i++) { DRI_AGE_TEXTURES(r300->texture_heaps[i]); @@ -112,15 +122,15 @@ static void r300RegainedLock(radeonContextPtr radeon) * the hardware lock when it changes the window state, this routine will * automatically be called after such a change. */ -void radeonGetLock(radeonContextPtr radeon, GLuint flags) +void radeonGetLock(radeonContextPtr rmesa, GLuint flags) { - __DRIdrawablePrivate *const drawable = radeon->dri.drawable; - __DRIdrawablePrivate *const readable = radeon->dri.readable; - __DRIscreenPrivate *sPriv = radeon->dri.screen; - - assert (drawable != NULL); + __DRIdrawablePrivate *const drawable = rmesa->dri.drawable; + __DRIdrawablePrivate *const readable = rmesa->dri.readable; + __DRIscreenPrivate *sPriv = rmesa->dri.screen; + + assert(drawable != NULL); - drmGetLock(radeon->dri.fd, radeon->dri.hwContext, flags); + drmGetLock(rmesa->dri.fd, rmesa->dri.hwContext, flags); /* The window might have moved, so we might need to get new clip * rects. @@ -130,13 +140,13 @@ void radeonGetLock(radeonContextPtr radeon, GLuint flags) * Since the hardware state depends on having the latest drawable * clip rects, all state checking must be done _after_ this call. */ - DRI_VALIDATE_DRAWABLE_INFO( sPriv, drawable ); + DRI_VALIDATE_DRAWABLE_INFO(sPriv, drawable); if (drawable != readable) { - DRI_VALIDATE_DRAWABLE_INFO( sPriv, readable ); + DRI_VALIDATE_DRAWABLE_INFO(sPriv, readable); } - if (IS_R300_CLASS(radeon->radeonScreen)) - r300RegainedLock(radeon); - - radeon->lost_context = GL_TRUE; + if (IS_R300_CLASS(rmesa->radeonScreen)) + r300RegainedLock(rmesa); + + rmesa->lost_context = GL_TRUE; } diff --git a/src/mesa/drivers/dri/r300/radeon_lock.h b/src/mesa/drivers/dri/r300/radeon_lock.h index b11ddf0895e..2a358e9bdd6 100644 --- a/src/mesa/drivers/dri/r300/radeon_lock.h +++ b/src/mesa/drivers/dri/r300/radeon_lock.h @@ -1,10 +1,15 @@ -/* +/************************************************************************** + +Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and + VA Linux Systems Inc., Fremont, California. 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. +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 @@ -29,7 +34,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /* * Authors: + * Gareth Hughes * Keith Whitwell + * Kevin E. Martin */ #ifndef __RADEON_LOCK_H__ diff --git a/src/mesa/drivers/dri/radeon/radeon_lock.c b/src/mesa/drivers/dri/radeon/radeon_lock.c index 312041e0351..30a0c3863c2 100644 --- a/src/mesa/drivers/dri/radeon/radeon_lock.c +++ b/src/mesa/drivers/dri/radeon/radeon_lock.c @@ -1,8 +1,12 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_lock.c,v 1.5 2002/10/30 12:51:55 alanh Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and VA Linux Systems Inc., Fremont, California. +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. All Rights Reserved. @@ -30,8 +34,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /* * Authors: - * Kevin E. Martin * Gareth Hughes + * Keith Whitwell + * Kevin E. Martin */ #include "glheader.h" @@ -44,7 +49,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "drirenderbuffer.h" - #if DEBUG_LOCKING char *prevLockFile = NULL; int prevLockLine = 0; @@ -52,17 +56,15 @@ int prevLockLine = 0; /* Turn on/off page flipping according to the flags in the sarea: */ -static void -radeonUpdatePageFlipping( radeonContextPtr rmesa ) +static void radeonUpdatePageFlipping(radeonContextPtr rmesa) { - rmesa->doPageFlip = rmesa->sarea->pfState; - if (rmesa->glCtx->WinSysDrawBuffer) { - driFlipRenderbuffers(rmesa->glCtx->WinSysDrawBuffer, - rmesa->sarea->pfCurrentPage); - } + rmesa->doPageFlip = rmesa->sarea->pfState; + if (rmesa->glCtx->WinSysDrawBuffer) { + driFlipRenderbuffers(rmesa->glCtx->WinSysDrawBuffer, + rmesa->sarea->pfCurrentPage); + } } - /* Update the hardware state. This is called if another context has * grabbed the hardware lock, which includes the X server. This * function also updates the driver's window state after the X server @@ -71,51 +73,52 @@ radeonUpdatePageFlipping( radeonContextPtr rmesa ) * the hardware lock when it changes the window state, this routine will * automatically be called after such a change. */ -void radeonGetLock( radeonContextPtr rmesa, GLuint flags ) +void radeonGetLock(radeonContextPtr rmesa, GLuint flags) { - __DRIdrawablePrivate *const drawable = rmesa->dri.drawable; - __DRIdrawablePrivate *const readable = rmesa->dri.readable; - __DRIscreenPrivate *sPriv = rmesa->dri.screen; - drm_radeon_sarea_t *sarea = rmesa->sarea; - - drmGetLock( rmesa->dri.fd, rmesa->dri.hwContext, flags ); - - /* The window might have moved, so we might need to get new clip - * rects. - * - * NOTE: This releases and regrabs the hw lock to allow the X server - * to respond to the DRI protocol request for new drawable info. - * Since the hardware state depends on having the latest drawable - * clip rects, all state checking must be done _after_ this call. - */ - DRI_VALIDATE_DRAWABLE_INFO( sPriv, drawable ); - if (drawable != readable) { - DRI_VALIDATE_DRAWABLE_INFO( sPriv, readable ); - } - - if ( rmesa->lastStamp != drawable->lastStamp ) { - radeonUpdatePageFlipping( rmesa ); - radeonSetCliprects( rmesa ); - radeonUpdateViewportOffset( rmesa->glCtx ); - driUpdateFramebufferSize(rmesa->glCtx, drawable); - } - - RADEON_STATECHANGE( rmesa, ctx ); - if (rmesa->sarea->tiling_enabled) { - rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] |= RADEON_COLOR_TILE_ENABLE; - } - else { - rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] &= ~RADEON_COLOR_TILE_ENABLE; - } - - if ( sarea->ctx_owner != rmesa->dri.hwContext ) { - int i; - sarea->ctx_owner = rmesa->dri.hwContext; - - for ( i = 0 ; i < rmesa->nr_heaps ; i++ ) { - DRI_AGE_TEXTURES( rmesa->texture_heaps[ i ] ); - } - } - - rmesa->lost_context = GL_TRUE; + __DRIdrawablePrivate *const drawable = rmesa->dri.drawable; + __DRIdrawablePrivate *const readable = rmesa->dri.readable; + __DRIscreenPrivate *sPriv = rmesa->dri.screen; + drm_radeon_sarea_t *sarea = rmesa->sarea; + + drmGetLock(rmesa->dri.fd, rmesa->dri.hwContext, flags); + + /* The window might have moved, so we might need to get new clip + * rects. + * + * NOTE: This releases and regrabs the hw lock to allow the X server + * to respond to the DRI protocol request for new drawable info. + * Since the hardware state depends on having the latest drawable + * clip rects, all state checking must be done _after_ this call. + */ + DRI_VALIDATE_DRAWABLE_INFO(sPriv, drawable); + if (drawable != readable) { + DRI_VALIDATE_DRAWABLE_INFO(sPriv, readable); + } + + if (rmesa->lastStamp != drawable->lastStamp) { + radeonUpdatePageFlipping(rmesa); + radeonSetCliprects(rmesa); + radeonUpdateViewportOffset(rmesa->glCtx); + driUpdateFramebufferSize(rmesa->glCtx, drawable); + } + + RADEON_STATECHANGE(rmesa, ctx); + if (rmesa->sarea->tiling_enabled) { + rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] |= + RADEON_COLOR_TILE_ENABLE; + } else { + rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] &= + ~RADEON_COLOR_TILE_ENABLE; + } + + if (sarea->ctx_owner != rmesa->dri.hwContext) { + int i; + sarea->ctx_owner = rmesa->dri.hwContext; + + for (i = 0; i < rmesa->nr_heaps; i++) { + DRI_AGE_TEXTURES(rmesa->texture_heaps[i]); + } + } + + rmesa->lost_context = GL_TRUE; } diff --git a/src/mesa/drivers/dri/radeon/radeon_lock.h b/src/mesa/drivers/dri/radeon/radeon_lock.h index 4e8617eb8f1..3ba69e86c1c 100644 --- a/src/mesa/drivers/dri/radeon/radeon_lock.h +++ b/src/mesa/drivers/dri/radeon/radeon_lock.h @@ -1,8 +1,12 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_lock.h,v 1.3 2002/10/30 12:51:55 alanh Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and VA Linux Systems Inc., Fremont, California. +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. All Rights Reserved. @@ -30,8 +34,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /* * Authors: - * Kevin E. Martin * Gareth Hughes + * Keith Whitwell + * Kevin E. Martin */ #ifndef __RADEON_LOCK_H__ @@ -83,7 +88,6 @@ extern int prevLockLine; * do not do any drawing !!! */ - /* Lock the hardware and validate our state. */ #define LOCK_HARDWARE( rmesa ) \ -- cgit v1.2.3 From 5a09ea01e06a648b37eb167914fb1549e066326d Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 22:21:19 +0000 Subject: r300: Reduced the diff on radeon_lock.[ch]. --- src/mesa/drivers/dri/r300/radeon_lock.c | 49 +++++++++++-------------------- src/mesa/drivers/dri/r300/radeon_lock.h | 44 +++++++++++++-------------- src/mesa/drivers/dri/radeon/radeon_lock.h | 4 +-- 3 files changed, 41 insertions(+), 56 deletions(-) diff --git a/src/mesa/drivers/dri/r300/radeon_lock.c b/src/mesa/drivers/dri/r300/radeon_lock.c index 978d2fae0cc..bc3c2d6c6b3 100644 --- a/src/mesa/drivers/dri/r300/radeon_lock.c +++ b/src/mesa/drivers/dri/r300/radeon_lock.c @@ -84,36 +84,6 @@ void radeonUpdatePageFlipping(radeonContextPtr rmesa) } } -/** - * Called by radeonGetLock() after the lock has been obtained. - */ -static void r300RegainedLock(radeonContextPtr rmesa) -{ - int i; - __DRIdrawablePrivate *const drawable = rmesa->dri.drawable; - r300ContextPtr r300 = (r300ContextPtr) rmesa; - drm_radeon_sarea_t *sarea = rmesa->sarea; - - if (rmesa->lastStamp != drawable->lastStamp) { - radeonUpdatePageFlipping(rmesa); - radeonSetCliprects(rmesa); -#if 1 - r300UpdateViewportOffset(rmesa->glCtx); - driUpdateFramebufferSize(rmesa->glCtx, drawable); -#else - radeonUpdateScissor(rmesa->glCtx); -#endif - } - - if (sarea->ctx_owner != rmesa->dri.hwContext) { - sarea->ctx_owner = rmesa->dri.hwContext; - - for (i = 0; i < r300->nr_heaps; i++) { - DRI_AGE_TEXTURES(r300->texture_heaps[i]); - } - } -} - /* Update the hardware state. This is called if another context has * grabbed the hardware lock, which includes the X server. This * function also updates the driver's window state after the X server @@ -127,6 +97,8 @@ void radeonGetLock(radeonContextPtr rmesa, GLuint flags) __DRIdrawablePrivate *const drawable = rmesa->dri.drawable; __DRIdrawablePrivate *const readable = rmesa->dri.readable; __DRIscreenPrivate *sPriv = rmesa->dri.screen; + drm_radeon_sarea_t *sarea = rmesa->sarea; + r300ContextPtr r300 = (r300ContextPtr) rmesa; assert(drawable != NULL); @@ -145,8 +117,21 @@ void radeonGetLock(radeonContextPtr rmesa, GLuint flags) DRI_VALIDATE_DRAWABLE_INFO(sPriv, readable); } - if (IS_R300_CLASS(rmesa->radeonScreen)) - r300RegainedLock(rmesa); + if (rmesa->lastStamp != drawable->lastStamp) { + radeonUpdatePageFlipping(rmesa); + radeonSetCliprects(rmesa); + r300UpdateViewportOffset(rmesa->glCtx); + driUpdateFramebufferSize(rmesa->glCtx, drawable); + } + + if (sarea->ctx_owner != rmesa->dri.hwContext) { + int i; + + sarea->ctx_owner = rmesa->dri.hwContext; + for (i = 0; i < r300->nr_heaps; i++) { + DRI_AGE_TEXTURES(r300->texture_heaps[i]); + } + } rmesa->lost_context = GL_TRUE; } diff --git a/src/mesa/drivers/dri/r300/radeon_lock.h b/src/mesa/drivers/dri/r300/radeon_lock.h index 2a358e9bdd6..e131967e423 100644 --- a/src/mesa/drivers/dri/r300/radeon_lock.h +++ b/src/mesa/drivers/dri/r300/radeon_lock.h @@ -47,8 +47,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #endif #include "radeon_context.h" -extern void radeonGetLock(radeonContextPtr radeon, GLuint flags); -extern void radeonUpdatePageFlipping(radeonContextPtr radeon); +extern void radeonGetLock(radeonContextPtr rmesa, GLuint flags); +extern void radeonUpdatePageFlipping(radeonContextPtr rmesa); /* Turn DEBUG_LOCKING on to find locking conflicts. */ @@ -72,11 +72,11 @@ extern int prevLockLine; #define DEBUG_CHECK_LOCK() \ do { \ - if ( prevLockFile ) { \ - fprintf( stderr, \ + if (prevLockFile) { \ + fprintf(stderr, \ "LOCK SET!\n\tPrevious %s:%d\n\tCurrent: %s:%d\n", \ - prevLockFile, prevLockLine, __FILE__, __LINE__ ); \ - exit( 1 ); \ + prevLockFile, prevLockLine, __FILE__, __LINE__); \ + exit(1); \ } \ } while (0) @@ -96,37 +96,37 @@ extern int prevLockLine; /* Lock the hardware and validate our state. */ -#define LOCK_HARDWARE( radeon ) \ +#define LOCK_HARDWARE( rmesa ) \ do { \ char __ret = 0; \ DEBUG_CHECK_LOCK(); \ - DRM_CAS( (radeon)->dri.hwLock, (radeon)->dri.hwContext, \ - (DRM_LOCK_HELD | (radeon)->dri.hwContext), __ret ); \ - if ( __ret ) \ - radeonGetLock( (radeon), 0 ); \ + DRM_CAS(rmesa->dri.hwLock, rmesa->dri.hwContext, \ + (DRM_LOCK_HELD | rmesa->dri.hwContext), __ret); \ + if (__ret) \ + radeonGetLock(rmesa, 0); \ DEBUG_LOCK(); \ } while (0) #if R200_MERGED -#define UNLOCK_HARDWARE( radeon ) \ +#define UNLOCK_HARDWARE( rmesa ) \ do { \ - DRM_UNLOCK( (radeon)->dri.fd, \ - (radeon)->dri.hwLock, \ - (radeon)->dri.hwContext ); \ + DRM_UNLOCK(rmesa->dri.fd, \ + rmesa->dri.hwLock, \ + rmesa->dri.hwContext); \ DEBUG_RESET(); \ - if (IS_R200_CLASS(radeon->radeonScreen)) { \ - r200ContextPtr __r200 = (r200ContextPtr)(radeon); \ + if (IS_R200_CLASS(rmesa->radeonScreen)) { \ + r200ContextPtr __r200 = (r200ContextPtr)rmesa; \ if (__r200->save_on_next_unlock) \ - r200SaveHwState( __r200 ); \ + r200SaveHwState(__r200); \ __r200->save_on_next_unlock = GL_FALSE; \ } \ } while (0) #else -#define UNLOCK_HARDWARE( radeon ) \ +#define UNLOCK_HARDWARErmesa \ do { \ - DRM_UNLOCK( (radeon)->dri.fd, \ - (radeon)->dri.hwLock, \ - (radeon)->dri.hwContext ); \ + DRM_UNLOCK(rmesa->dri.fd, \ + rmesa->dri.hwLock, \ + rmesa->dri.hwContext); \ DEBUG_RESET(); \ } while (0) #endif diff --git a/src/mesa/drivers/dri/radeon/radeon_lock.h b/src/mesa/drivers/dri/radeon/radeon_lock.h index 3ba69e86c1c..e793541e3f0 100644 --- a/src/mesa/drivers/dri/radeon/radeon_lock.h +++ b/src/mesa/drivers/dri/radeon/radeon_lock.h @@ -42,7 +42,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __RADEON_LOCK_H__ #define __RADEON_LOCK_H__ -extern void radeonGetLock( radeonContextPtr rmesa, GLuint flags ); +extern void radeonGetLock(radeonContextPtr rmesa, GLuint flags); /* Turn DEBUG_LOCKING on to find locking conflicts. */ @@ -109,4 +109,4 @@ extern int prevLockLine; DEBUG_RESET(); \ } while (0) -#endif /* __RADEON_LOCK_H__ */ +#endif /* __RADEON_LOCK_H__ */ -- cgit v1.2.3 From f405fbb36de167eb3294358d97e6f62a420f3bff Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 22:23:31 +0000 Subject: r300: Corrected some macro errors from the previous commit. --- src/mesa/drivers/dri/r300/radeon_lock.h | 22 +++++++++++----------- src/mesa/drivers/dri/radeon/radeon_lock.h | 12 ++++++------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/mesa/drivers/dri/r300/radeon_lock.h b/src/mesa/drivers/dri/r300/radeon_lock.h index e131967e423..3c1c8c2a0de 100644 --- a/src/mesa/drivers/dri/r300/radeon_lock.h +++ b/src/mesa/drivers/dri/r300/radeon_lock.h @@ -100,22 +100,22 @@ extern int prevLockLine; do { \ char __ret = 0; \ DEBUG_CHECK_LOCK(); \ - DRM_CAS(rmesa->dri.hwLock, rmesa->dri.hwContext, \ - (DRM_LOCK_HELD | rmesa->dri.hwContext), __ret); \ + DRM_CAS((rmesa)->dri.hwLock, (rmesa)->dri.hwContext, \ + (DRM_LOCK_HELD | (rmesa)->dri.hwContext), __ret); \ if (__ret) \ - radeonGetLock(rmesa, 0); \ + radeonGetLock((rmesa), 0); \ DEBUG_LOCK(); \ } while (0) #if R200_MERGED #define UNLOCK_HARDWARE( rmesa ) \ do { \ - DRM_UNLOCK(rmesa->dri.fd, \ - rmesa->dri.hwLock, \ - rmesa->dri.hwContext); \ + DRM_UNLOCK((rmesa)->dri.fd, \ + (rmesa)->dri.hwLock, \ + (rmesa)->dri.hwContext); \ DEBUG_RESET(); \ - if (IS_R200_CLASS(rmesa->radeonScreen)) { \ - r200ContextPtr __r200 = (r200ContextPtr)rmesa; \ + if (IS_R200_CLASS((rmesa)->radeonScreen)) { \ + r200ContextPtr __r200 = (r200ContextPtr)(rmesa); \ if (__r200->save_on_next_unlock) \ r200SaveHwState(__r200); \ __r200->save_on_next_unlock = GL_FALSE; \ @@ -124,9 +124,9 @@ extern int prevLockLine; #else #define UNLOCK_HARDWARErmesa \ do { \ - DRM_UNLOCK(rmesa->dri.fd, \ - rmesa->dri.hwLock, \ - rmesa->dri.hwContext); \ + DRM_UNLOCK((rmesa)->dri.fd, \ + (rmesa)->dri.hwLock, \ + (rmesa)->dri.hwContext); \ DEBUG_RESET(); \ } while (0) #endif diff --git a/src/mesa/drivers/dri/radeon/radeon_lock.h b/src/mesa/drivers/dri/radeon/radeon_lock.h index e793541e3f0..86e96aa7d2c 100644 --- a/src/mesa/drivers/dri/radeon/radeon_lock.h +++ b/src/mesa/drivers/dri/radeon/radeon_lock.h @@ -94,18 +94,18 @@ extern int prevLockLine; do { \ char __ret = 0; \ DEBUG_CHECK_LOCK(); \ - DRM_CAS( rmesa->dri.hwLock, rmesa->dri.hwContext, \ - (DRM_LOCK_HELD | rmesa->dri.hwContext), __ret ); \ + DRM_CAS( (rmesa)->dri.hwLock, (rmesa)->dri.hwContext, \ + (DRM_LOCK_HELD | (rmesa)->dri.hwContext), __ret ); \ if ( __ret ) \ - radeonGetLock( rmesa, 0 ); \ + radeonGetLock( (rmesa), 0 ); \ DEBUG_LOCK(); \ } while (0) #define UNLOCK_HARDWARE( rmesa ) \ do { \ - DRM_UNLOCK( rmesa->dri.fd, \ - rmesa->dri.hwLock, \ - rmesa->dri.hwContext ); \ + DRM_UNLOCK( (rmesa)->dri.fd, \ + (rmesa)->dri.hwLock, \ + (rmesa)->dri.hwContext ); \ DEBUG_RESET(); \ } while (0) -- cgit v1.2.3 From 93f9e61f433788cd70acbe2a8fbdc6a4f5fd0881 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 22:26:47 +0000 Subject: r300: Corrected another error; regexp replaced something it shouldn't have. --- src/mesa/drivers/dri/r300/radeon_lock.h | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/mesa/drivers/dri/r300/radeon_lock.h b/src/mesa/drivers/dri/r300/radeon_lock.h index 3c1c8c2a0de..c47adc9575b 100644 --- a/src/mesa/drivers/dri/r300/radeon_lock.h +++ b/src/mesa/drivers/dri/r300/radeon_lock.h @@ -107,27 +107,12 @@ extern int prevLockLine; DEBUG_LOCK(); \ } while (0) -#if R200_MERGED #define UNLOCK_HARDWARE( rmesa ) \ do { \ DRM_UNLOCK((rmesa)->dri.fd, \ (rmesa)->dri.hwLock, \ (rmesa)->dri.hwContext); \ DEBUG_RESET(); \ - if (IS_R200_CLASS((rmesa)->radeonScreen)) { \ - r200ContextPtr __r200 = (r200ContextPtr)(rmesa); \ - if (__r200->save_on_next_unlock) \ - r200SaveHwState(__r200); \ - __r200->save_on_next_unlock = GL_FALSE; \ - } \ } while (0) -#else -#define UNLOCK_HARDWARErmesa \ - do { \ - DRM_UNLOCK((rmesa)->dri.fd, \ - (rmesa)->dri.hwLock, \ - (rmesa)->dri.hwContext); \ - DEBUG_RESET(); \ - } while (0) -#endif + #endif /* __RADEON_LOCK_H__ */ -- cgit v1.2.3 From b8b0dd1e2056742401fe610d205f6272b313dc63 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 23:03:40 +0000 Subject: Revert "r300: Merged radeon_span.c." This reverts commit 0aa998b2ab6fdfe139b54de9868e2383440685d0. --- src/mesa/drivers/dri/r300/.gitignore | 2 +- src/mesa/drivers/dri/r300/Makefile | 2 +- src/mesa/drivers/dri/r300/radeon_span.c | 321 ++++++++++++++++++++++++++++++ src/mesa/drivers/dri/radeon/radeon_span.c | 7 +- 4 files changed, 324 insertions(+), 8 deletions(-) create mode 100644 src/mesa/drivers/dri/r300/radeon_span.c diff --git a/src/mesa/drivers/dri/r300/.gitignore b/src/mesa/drivers/dri/r300/.gitignore index 3a308633597..3689a6a78e5 100644 --- a/src/mesa/drivers/dri/r300/.gitignore +++ b/src/mesa/drivers/dri/r300/.gitignore @@ -1,4 +1,4 @@ radeon_chipset.h radeon_screen.[ch] -radeon_span.[ch] +radeon_span.h server diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile index 46b38a944a3..c1d223c7600 100644 --- a/src/mesa/drivers/dri/r300/Makefile +++ b/src/mesa/drivers/dri/r300/Makefile @@ -25,6 +25,7 @@ DRIVER_SOURCES = \ radeon_context.c \ radeon_ioctl.c \ radeon_lock.c \ + radeon_span.c \ radeon_state.c \ r300_mem.c \ \ @@ -59,7 +60,6 @@ COMMON_SYMLINKS = \ radeon_chipset.h \ radeon_screen.c \ radeon_screen.h \ - radeon_span.c \ radeon_span.h ##### TARGETS ##### diff --git a/src/mesa/drivers/dri/r300/radeon_span.c b/src/mesa/drivers/dri/r300/radeon_span.c new file mode 100644 index 00000000000..eae09d6b35e --- /dev/null +++ b/src/mesa/drivers/dri/r300/radeon_span.c @@ -0,0 +1,321 @@ +/************************************************************************** + +Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. +Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and + VA Linux Systems Inc., Fremont, California. + +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. + +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice (including the +next paragraph) shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +**************************************************************************/ + +/* + * Authors: + * Kevin E. Martin + * Gareth Hughes + * Keith Whitwell + * + */ + +#include "glheader.h" +#include "swrast/swrast.h" + +#include "r300_state.h" +#include "radeon_ioctl.h" +#include "r300_ioctl.h" +#include "radeon_span.h" + +#include "drirenderbuffer.h" + +#define DBG 0 + +/* + * Note that all information needed to access pixels in a renderbuffer + * should be obtained through the gl_renderbuffer parameter, not per-context + * information. + */ +#define LOCAL_VARS \ + driRenderbuffer *drb = (driRenderbuffer *) rb; \ + const __DRIdrawablePrivate *dPriv = drb->dPriv; \ + const GLuint bottom = dPriv->h - 1; \ + GLubyte *buf = (GLubyte *) drb->flippedData \ + + (dPriv->y * drb->flippedPitch + dPriv->x) * drb->cpp; \ + GLuint p; \ + (void) p; + +#define LOCAL_DEPTH_VARS \ + driRenderbuffer *drb = (driRenderbuffer *) rb; \ + const __DRIdrawablePrivate *dPriv = drb->dPriv; \ + const GLuint bottom = dPriv->h - 1; \ + GLuint xo = dPriv->x; \ + GLuint yo = dPriv->y; \ + GLubyte *buf = (GLubyte *) drb->Base.Data; + +#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS + +#define Y_FLIP(Y) (bottom - (Y)) + +#define HW_LOCK() + +#define HW_UNLOCK() + +/* ================================================================ + * Color buffer + */ + +/* 16 bit, RGB565 color spanline and pixel functions + */ +#define SPANTMP_PIXEL_FMT GL_RGB +#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5 + +#define TAG(x) radeon##x##_RGB565 +#define TAG2(x,y) radeon##x##_RGB565##y +#define GET_PTR(X,Y) (buf + ((Y) * drb->flippedPitch + (X)) * 2) +#include "spantmp2.h" + +/* 32 bit, ARGB8888 color spanline and pixel functions + */ +#define SPANTMP_PIXEL_FMT GL_BGRA +#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV + +#define TAG(x) radeon##x##_ARGB8888 +#define TAG2(x,y) radeon##x##_ARGB8888##y +#define GET_PTR(X,Y) (buf + ((Y) * drb->flippedPitch + (X)) * 4) +#include "spantmp2.h" + +/* ================================================================ + * Depth buffer + */ + +/* The Radeon family has depth tiling on all the time, so we have to convert + * the x,y coordinates into the memory bus address (mba) in the same + * manner as the engine. In each case, the linear block address (ba) + * is calculated, and then wired with x and y to produce the final + * memory address. + * The chip will do address translation on its own if the surface registers + * are set up correctly. It is not quite enough to get it working with hyperz + * too... + */ + +static GLuint radeon_mba_z32(const driRenderbuffer * drb, GLint x, GLint y) +{ + GLuint pitch = drb->pitch; + if (drb->depthHasSurface) { + return 4 * (x + y * pitch); + } else { + GLuint ba, address = 0; /* a[0..1] = 0 */ + +#ifdef COMPILE_R300 + ba = (y / 8) * (pitch / 8) + (x / 8); +#else + ba = (y / 16) * (pitch / 16) + (x / 16); +#endif + + address |= (x & 0x7) << 2; /* a[2..4] = x[0..2] */ + address |= (y & 0x3) << 5; /* a[5..6] = y[0..1] */ + address |= (((x & 0x10) >> 2) ^ (y & 0x4)) << 5; /* a[7] = x[4] ^ y[2] */ + address |= (ba & 0x3) << 8; /* a[8..9] = ba[0..1] */ + + address |= (y & 0x8) << 7; /* a[10] = y[3] */ + address |= (((x & 0x8) << 1) ^ (y & 0x10)) << 7; /* a[11] = x[3] ^ y[4] */ + address |= (ba & ~0x3) << 10; /* a[12..] = ba[2..] */ + + return address; + } +} + +static INLINE GLuint +radeon_mba_z16(const driRenderbuffer * drb, GLint x, GLint y) +{ + GLuint pitch = drb->pitch; + if (drb->depthHasSurface) { + return 2 * (x + y * pitch); + } else { + GLuint ba, address = 0; /* a[0] = 0 */ + + ba = (y / 16) * (pitch / 32) + (x / 32); + + address |= (x & 0x7) << 1; /* a[1..3] = x[0..2] */ + address |= (y & 0x7) << 4; /* a[4..6] = y[0..2] */ + address |= (x & 0x8) << 4; /* a[7] = x[3] */ + address |= (ba & 0x3) << 8; /* a[8..9] = ba[0..1] */ + address |= (y & 0x8) << 7; /* a[10] = y[3] */ + address |= ((x & 0x10) ^ (y & 0x10)) << 7; /* a[11] = x[4] ^ y[4] */ + address |= (ba & ~0x3) << 10; /* a[12..] = ba[2..] */ + + return address; + } +} + +/* 16-bit depth buffer functions + */ +#define WRITE_DEPTH( _x, _y, d ) \ + *(GLushort *)(buf + radeon_mba_z16( drb, _x + xo, _y + yo )) = d; + +#define READ_DEPTH( d, _x, _y ) \ + d = *(GLushort *)(buf + radeon_mba_z16( drb, _x + xo, _y + yo )); + +#define TAG(x) radeon##x##_z16 +#include "depthtmp.h" + +/* 24 bit depth, 8 bit stencil depthbuffer functions + * + * Careful: It looks like the R300 uses ZZZS byte order while the R200 + * uses SZZZ for 24 bit depth, 8 bit stencil mode. + */ +#ifdef COMPILE_R300 +#define WRITE_DEPTH( _x, _y, d ) \ +do { \ + GLuint offset = radeon_mba_z32( drb, _x + xo, _y + yo ); \ + GLuint tmp = *(GLuint *)(buf + offset); \ + tmp &= 0x000000ff; \ + tmp |= ((d << 8) & 0xffffff00); \ + *(GLuint *)(buf + offset) = tmp; \ +} while (0) +#else +#define WRITE_DEPTH( _x, _y, d ) \ +do { \ + GLuint offset = radeon_mba_z32( drb, _x + xo, _y + yo ); \ + GLuint tmp = *(GLuint *)(buf + offset); \ + tmp &= 0xff000000; \ + tmp |= ((d) & 0x00ffffff); \ + *(GLuint *)(buf + offset) = tmp; \ +} while (0) +#endif + +#ifdef COMPILE_R300 +#define READ_DEPTH( d, _x, _y ) \ + do { \ + d = (*(GLuint *)(buf + radeon_mba_z32( drb, _x + xo, \ + _y + yo )) & 0xffffff00) >> 8; \ + }while(0) +#else +#define READ_DEPTH( d, _x, _y ) \ + d = *(GLuint *)(buf + radeon_mba_z32( drb, _x + xo, \ + _y + yo )) & 0x00ffffff; +#endif + +#define TAG(x) radeon##x##_z24_s8 +#include "depthtmp.h" + +/* ================================================================ + * Stencil buffer + */ + +/* 24 bit depth, 8 bit stencil depthbuffer functions + */ +#ifdef COMPILE_R300 +#define WRITE_STENCIL( _x, _y, d ) \ +do { \ + GLuint offset = radeon_mba_z32( drb, _x + xo, _y + yo ); \ + GLuint tmp = *(GLuint *)(buf + offset); \ + tmp &= 0xffffff00; \ + tmp |= (d) & 0xff; \ + *(GLuint *)(buf + offset) = tmp; \ +} while (0) +#else +#define WRITE_STENCIL( _x, _y, d ) \ +do { \ + GLuint offset = radeon_mba_z32( drb, _x + xo, _y + yo ); \ + GLuint tmp = *(GLuint *)(buf + offset); \ + tmp &= 0x00ffffff; \ + tmp |= (((d) & 0xff) << 24); \ + *(GLuint *)(buf + offset) = tmp; \ +} while (0) +#endif + +#ifdef COMPILE_R300 +#define READ_STENCIL( d, _x, _y ) \ +do { \ + GLuint offset = radeon_mba_z32( drb, _x + xo, _y + yo ); \ + GLuint tmp = *(GLuint *)(buf + offset); \ + d = tmp & 0x000000ff; \ +} while (0) +#else +#define READ_STENCIL( d, _x, _y ) \ +do { \ + GLuint offset = radeon_mba_z32( drb, _x + xo, _y + yo ); \ + GLuint tmp = *(GLuint *)(buf + offset); \ + d = (tmp & 0xff000000) >> 24; \ +} while (0) +#endif + +#define TAG(x) radeon##x##_z24_s8 +#include "stenciltmp.h" + +/* Move locking out to get reasonable span performance (10x better + * than doing this in HW_LOCK above). WaitForIdle() is the main + * culprit. + */ + +static void radeonSpanRenderStart(GLcontext * ctx) +{ + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); +#ifdef COMPILE_R300 + r300ContextPtr r300 = (r300ContextPtr) rmesa; + R300_FIREVERTICES(r300); +#else + RADEON_FIREVERTICES(rmesa); +#endif + LOCK_HARDWARE(rmesa); + radeonWaitForIdleLocked(rmesa); +} + +static void radeonSpanRenderFinish(GLcontext * ctx) +{ + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + _swrast_flush(ctx); + UNLOCK_HARDWARE(rmesa); +} + +void radeonInitSpanFuncs(GLcontext * ctx) +{ + struct swrast_device_driver *swdd = + _swrast_GetDeviceDriverReference(ctx); + swdd->SpanRenderStart = radeonSpanRenderStart; + swdd->SpanRenderFinish = radeonSpanRenderFinish; +} + +/** + * Plug in the Get/Put routines for the given driRenderbuffer. + */ +void radeonSetSpanFunctions(driRenderbuffer * drb, const GLvisual * vis) +{ + if (drb->Base.InternalFormat == GL_RGBA) { + if (vis->redBits == 5 && vis->greenBits == 6 + && vis->blueBits == 5) { + radeonInitPointers_RGB565(&drb->Base); + } else { + radeonInitPointers_ARGB8888(&drb->Base); + } + } else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { + radeonInitDepthPointers_z16(&drb->Base); + } else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { + radeonInitDepthPointers_z24_s8(&drb->Base); + } else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { + radeonInitStencilPointers_z24_s8(&drb->Base); + } +} diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index 4551190d10c..732a85ecf0b 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -43,16 +43,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "glheader.h" #include "swrast/swrast.h" -#ifdef COMPILE_R300 -#include "r300_ioctl.h" -#include "r300_state.h" -#else #include "radeon_context.h" #include "radeon_ioctl.h" #include "radeon_state.h" -#include "radeon_tex.h" -#endif #include "radeon_span.h" +#include "radeon_tex.h" #include "drirenderbuffer.h" -- cgit v1.2.3 From 64b03f33eeb2f57f1c7a528d011137c6f2612fb0 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 23:13:08 +0000 Subject: r300: Added insert_at_tail to the ALLOC_STATE macro. --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 102 ++++---------------------------- 1 file changed, 11 insertions(+), 91 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 1aacf69a0aa..4bb9e32c474 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -270,6 +270,7 @@ CHECK(always, atom->cmd_size) r300->hw.ATOM.check = check_##CHK; \ r300->hw.ATOM.dirty = GL_FALSE; \ r300->hw.max_state_size += (SZ); \ + insert_at_tail(&r300->hw.atomlist, &r300->hw.ATOM); \ } while (0) /** * Allocate memory for the command buffer and initialize the state atom @@ -290,6 +291,10 @@ void r300InitCmdBuf(r300ContextPtr r300) fprintf(stderr, "Using %d maximum texture units..\n", mtu); } + /* Setup the atom linked list */ + make_empty_list(&r300->hw.atomlist); + r300->hw.atomlist.name = "atom-list"; + /* Initialize state atoms */ ALLOC_STATE(vpt, always, R300_VPT_CMDSIZE, "vpt", 0); r300->hw.vpt.cmd[R300_VPT_CMD_0] = cmdpacket0(R300_SE_VPORT_XSCALE, 6); @@ -301,10 +306,10 @@ void r300InitCmdBuf(r300ContextPtr r300) r300->hw.unk2134.cmd[0] = cmdpacket0(0x2134, 2); ALLOC_STATE(vap_cntl_status, always, 2, "vap_cntl_status", 0); r300->hw.vap_cntl_status.cmd[0] = cmdpacket0(R300_VAP_CNTL_STATUS, 1); - ALLOC_STATE(vir[0], variable, R300_VIR_CMDSIZE, "vir/0", 0); + ALLOC_STATE(vir[0], variable, R300_VIR_CMDSIZE, "vir[0]", 0); r300->hw.vir[0].cmd[R300_VIR_CMD_0] = cmdpacket0(R300_VAP_INPUT_ROUTE_0_0, 1); - ALLOC_STATE(vir[1], variable, R300_VIR_CMDSIZE, "vir/1", 1); + ALLOC_STATE(vir[1], variable, R300_VIR_CMDSIZE, "vir[1]", 1); r300->hw.vir[1].cmd[R300_VIR_CMD_0] = cmdpacket0(R300_VAP_INPUT_ROUTE_1_0, 1); ALLOC_STATE(vic, always, R300_VIC_CMDSIZE, "vic", 0); @@ -379,13 +384,13 @@ void r300InitCmdBuf(r300ContextPtr r300) r300->hw.fpt.cmd[R300_FPT_CMD_0] = cmdpacket0(R300_PFS_TEXI_0, 0); ALLOC_STATE(unk46A4, always, 6, "unk46A4", 0); r300->hw.unk46A4.cmd[0] = cmdpacket0(0x46A4, 5); - ALLOC_STATE(fpi[0], variable, R300_FPI_CMDSIZE, "fpi/0", 0); + ALLOC_STATE(fpi[0], variable, R300_FPI_CMDSIZE, "fpi[0]", 0); r300->hw.fpi[0].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR0_0, 1); - ALLOC_STATE(fpi[1], variable, R300_FPI_CMDSIZE, "fpi/1", 1); + ALLOC_STATE(fpi[1], variable, R300_FPI_CMDSIZE, "fpi[1]", 1); r300->hw.fpi[1].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR1_0, 1); - ALLOC_STATE(fpi[2], variable, R300_FPI_CMDSIZE, "fpi/2", 2); + ALLOC_STATE(fpi[2], variable, R300_FPI_CMDSIZE, "fpi[2]", 2); r300->hw.fpi[2].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR2_0, 1); - ALLOC_STATE(fpi[3], variable, R300_FPI_CMDSIZE, "fpi/3", 3); + ALLOC_STATE(fpi[3], variable, R300_FPI_CMDSIZE, "fpi[3]", 3); r300->hw.fpi[3].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR3_0, 1); ALLOC_STATE(fogs, always, R300_FOGS_CMDSIZE, "fogs", 0); r300->hw.fogs.cmd[R300_FOGS_CMD_0] = cmdpacket0(R300_RE_FOG_STATE, 1); @@ -475,91 +480,6 @@ void r300InitCmdBuf(r300ContextPtr r300) r300->hw.tex.border_color.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_BORDER_COLOR_0, 0); - /* Setup the atom linked list */ - make_empty_list(&r300->hw.atomlist); - r300->hw.atomlist.name = "atom-list"; - - insert_at_tail(&r300->hw.atomlist, &r300->hw.vpt); - insert_at_tail(&r300->hw.atomlist, &r300->hw.vap_cntl); - insert_at_tail(&r300->hw.atomlist, &r300->hw.vte); - insert_at_tail(&r300->hw.atomlist, &r300->hw.unk2134); - insert_at_tail(&r300->hw.atomlist, &r300->hw.vap_cntl_status); - insert_at_tail(&r300->hw.atomlist, &r300->hw.vir[0]); - insert_at_tail(&r300->hw.atomlist, &r300->hw.vir[1]); - insert_at_tail(&r300->hw.atomlist, &r300->hw.vic); - insert_at_tail(&r300->hw.atomlist, &r300->hw.unk21DC); - insert_at_tail(&r300->hw.atomlist, &r300->hw.unk221C); - insert_at_tail(&r300->hw.atomlist, &r300->hw.unk2220); - insert_at_tail(&r300->hw.atomlist, &r300->hw.unk2288); - insert_at_tail(&r300->hw.atomlist, &r300->hw.vof); - - if (has_tcl) - insert_at_tail(&r300->hw.atomlist, &r300->hw.pvs); - insert_at_tail(&r300->hw.atomlist, &r300->hw.gb_enable); - insert_at_tail(&r300->hw.atomlist, &r300->hw.gb_misc); - insert_at_tail(&r300->hw.atomlist, &r300->hw.txe); - insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4200); - insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4214); - insert_at_tail(&r300->hw.atomlist, &r300->hw.ps); - insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4230); - insert_at_tail(&r300->hw.atomlist, &r300->hw.lcntl); - insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4260); - insert_at_tail(&r300->hw.atomlist, &r300->hw.shade); - insert_at_tail(&r300->hw.atomlist, &r300->hw.polygon_mode); - insert_at_tail(&r300->hw.atomlist, &r300->hw.fogp); - insert_at_tail(&r300->hw.atomlist, &r300->hw.zbias_cntl); - insert_at_tail(&r300->hw.atomlist, &r300->hw.zbs); - insert_at_tail(&r300->hw.atomlist, &r300->hw.occlusion_cntl); - insert_at_tail(&r300->hw.atomlist, &r300->hw.cul); - insert_at_tail(&r300->hw.atomlist, &r300->hw.unk42C0); - insert_at_tail(&r300->hw.atomlist, &r300->hw.rc); - insert_at_tail(&r300->hw.atomlist, &r300->hw.ri); - insert_at_tail(&r300->hw.atomlist, &r300->hw.rr); - insert_at_tail(&r300->hw.atomlist, &r300->hw.unk43A4); - insert_at_tail(&r300->hw.atomlist, &r300->hw.unk43E8); - insert_at_tail(&r300->hw.atomlist, &r300->hw.fp); - insert_at_tail(&r300->hw.atomlist, &r300->hw.fpt); - insert_at_tail(&r300->hw.atomlist, &r300->hw.unk46A4); - insert_at_tail(&r300->hw.atomlist, &r300->hw.fpi[0]); - insert_at_tail(&r300->hw.atomlist, &r300->hw.fpi[1]); - insert_at_tail(&r300->hw.atomlist, &r300->hw.fpi[2]); - insert_at_tail(&r300->hw.atomlist, &r300->hw.fpi[3]); - insert_at_tail(&r300->hw.atomlist, &r300->hw.fogs); - insert_at_tail(&r300->hw.atomlist, &r300->hw.fogc); - insert_at_tail(&r300->hw.atomlist, &r300->hw.at); - insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4BD8); - insert_at_tail(&r300->hw.atomlist, &r300->hw.fpp); - insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4E00); - insert_at_tail(&r300->hw.atomlist, &r300->hw.bld); - insert_at_tail(&r300->hw.atomlist, &r300->hw.cmk); - insert_at_tail(&r300->hw.atomlist, &r300->hw.blend_color); - insert_at_tail(&r300->hw.atomlist, &r300->hw.cb); - insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4E50); - insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4E88); - insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4EA0); - insert_at_tail(&r300->hw.atomlist, &r300->hw.zs); - insert_at_tail(&r300->hw.atomlist, &r300->hw.zstencil_format); - insert_at_tail(&r300->hw.atomlist, &r300->hw.zb); - insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4F28); - insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4F30); - insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4F44); - insert_at_tail(&r300->hw.atomlist, &r300->hw.unk4F54); - - if (has_tcl) { - insert_at_tail(&r300->hw.atomlist, &r300->hw.vpi); - insert_at_tail(&r300->hw.atomlist, &r300->hw.vpp); - insert_at_tail(&r300->hw.atomlist, &r300->hw.vps); - } - - insert_at_tail(&r300->hw.atomlist, &r300->hw.tex.filter); - insert_at_tail(&r300->hw.atomlist, &r300->hw.tex.filter_1); - insert_at_tail(&r300->hw.atomlist, &r300->hw.tex.size); - insert_at_tail(&r300->hw.atomlist, &r300->hw.tex.format); - insert_at_tail(&r300->hw.atomlist, &r300->hw.tex.pitch); - insert_at_tail(&r300->hw.atomlist, &r300->hw.tex.offset); - insert_at_tail(&r300->hw.atomlist, &r300->hw.tex.chroma_key); - insert_at_tail(&r300->hw.atomlist, &r300->hw.tex.border_color); - r300->hw.is_dirty = GL_TRUE; r300->hw.all_dirty = GL_TRUE; -- cgit v1.2.3 From dac5303692726582d2fac2d9e9b620e3105ff8c3 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 23:32:03 +0000 Subject: r300: Moved r300PackFloat24 near r300PackFloat32. --- src/mesa/drivers/dri/r300/r300_context.h | 31 +++++++++++++++++++++++++++++++ src/mesa/drivers/dri/r300/r300_state.c | 31 ------------------------------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index c287871b370..2408497c483 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -102,6 +102,37 @@ static __inline__ uint32_t r300PackFloat32(float fl) return u.u; } +/* This is probably wrong for some values, I need to test this + * some more. Range checking would be a good idea also.. + * + * 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) +{ + float mantissa; + int exponent; + uint32_t float24 = 0; + + if (f == 0.0) + return 0; + + mantissa = frexpf(f, &exponent); + + /* Handle -ve */ + if (mantissa < 0) { + float24 |= (1 << 23); + mantissa = mantissa * -1.0; + } + /* Handle exponent, bias of 63 */ + exponent += 62; + float24 |= (exponent << 16); + /* Kill 7 LSB of mantissa */ + float24 |= (r300PackFloat32(mantissa) & 0x7FFFFF) >> 7; + + return float24; +} + /************ DMA BUFFERS **************/ /* Need refcounting on dma buffers: diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 625797b4b9f..c45c571d7b3 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1873,37 +1873,6 @@ void r300UpdateShaderStates(r300ContextPtr rmesa) r300SetupRSUnit(ctx); } -/* This is probably wrong for some values, I need to test this - * some more. Range checking would be a good idea also.. - * - * But it works for most things. I'll fix it later if someone - * else with a better clue doesn't - */ -static unsigned int r300PackFloat24(float f) -{ - float mantissa; - int exponent; - unsigned int float24 = 0; - - if (f == 0.0) - return 0; - - mantissa = frexpf(f, &exponent); - - /* Handle -ve */ - if (mantissa < 0) { - float24 |= (1 << 23); - mantissa = mantissa * -1.0; - } - /* Handle exponent, bias of 63 */ - exponent += 62; - float24 |= (exponent << 16); - /* Kill 7 LSB of mantissa */ - float24 |= (r300PackFloat32(mantissa) & 0x7FFFFF) >> 7; - - return float24; -} - void r300SetupPixelShader(r300ContextPtr rmesa) { GLcontext *ctx = rmesa->radeon.glCtx; -- cgit v1.2.3 From 3aad47679e14cf55b07fba5293b102d7ee6abc27 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 23:33:47 +0000 Subject: r300: Removed the unused CPT macro. --- src/mesa/drivers/dri/r300/r300_context.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 2408497c483..5e81ffaad3f 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -63,13 +63,10 @@ typedef struct r300_context *r300ContextPtr; #include "radeon_lock.h" #include "mm.h" -/* Checkpoint.. for convenience */ -#define CPT { fprintf(stderr, "%s:%s line %d\n", __FILE__, __FUNCTION__, __LINE__); } /* From http://gcc.gnu.org/onlinedocs/gcc-3.2.3/gcc/Variadic-Macros.html . I suppose we could inline this and use macro to fetch out __LINE__ and stuff in case we run into trouble with other compilers ... GLUE! */ -#if 1 #define WARN_ONCE(a, ...) { \ static int warn##__LINE__=1; \ if(warn##__LINE__){ \ @@ -81,9 +78,6 @@ typedef struct r300_context *r300ContextPtr; warn##__LINE__=0;\ } \ } -#else -#define WARN_ONCE(a, ...) {} -#endif #include "r300_vertprog.h" #include "r300_fragprog.h" -- cgit v1.2.3 From 56b99ace19cbe36df3e3995a299f28f99ba613fe Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 23:35:37 +0000 Subject: r300: Removed unused FORCE_32BITS_ELTS define. --- src/mesa/drivers/dri/r300/r300_context.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 5e81ffaad3f..07c3e37927e 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -49,11 +49,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define USER_BUFFERS -/* We don't handle 16 bits elts swapping yet */ -#ifdef MESA_BIG_ENDIAN -#define FORCE_32BITS_ELTS -#endif - //#define OPTIMIZE_ELTS struct r300_context; -- cgit v1.2.3 From 93881edb46fc95e1cfb4ded4e8a5db92612d3e4d Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sat, 12 May 2007 00:14:33 +0000 Subject: r300: Perform the locking closer to the DRM texture upload call. This might help if with attaching GDB if the driver gets into a -EAGAIN loop. --- src/mesa/drivers/dri/r300/r300_texmem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_texmem.c b/src/mesa/drivers/dri/r300/r300_texmem.c index eef5ff186f4..30f3886542f 100644 --- a/src/mesa/drivers/dri/r300/r300_texmem.c +++ b/src/mesa/drivers/dri/r300/r300_texmem.c @@ -469,12 +469,14 @@ static void r300UploadSubImage(r300ContextPtr rmesa, r300TexObjPtr t, } } - LOCK_HARDWARE(&rmesa->radeon); do { + LOCK_HARDWARE(&rmesa->radeon); ret = drmCommandWriteRead(rmesa->radeon.dri.fd, DRM_RADEON_TEXTURE, &tex, sizeof(drm_radeon_texture_t)); + UNLOCK_HARDWARE(&rmesa->radeon); + if (ret) { if (RADEON_DEBUG & DEBUG_IOCTL) fprintf(stderr, @@ -483,8 +485,6 @@ static void r300UploadSubImage(r300ContextPtr rmesa, r300TexObjPtr t, } } while (ret == -EAGAIN); - UNLOCK_HARDWARE(&rmesa->radeon); - if (ret) { fprintf(stderr, "DRM_RADEON_TEXTURE: return = %d\n", ret); fprintf(stderr, " offset=0x%08x\n", offset); -- cgit v1.2.3 From 5f1f1f5704d1336e7376e7e47a9a92868356b88d Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sat, 12 May 2007 01:13:54 +0000 Subject: r300: Renamed r300DoEmitState to r300EmitAtoms. --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 4bb9e32c474..b4c94de9778 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -148,7 +148,7 @@ void r300PrintStateAtom(r300ContextPtr r300, struct r300_state_atom *state) * The caller must have ensured that there is enough space in the command * buffer. */ -static __inline__ void r300DoEmitState(r300ContextPtr r300, GLboolean dirty) +static __inline__ void r300EmitAtoms(r300ContextPtr r300, GLboolean dirty) { struct r300_state_atom *atom; uint32_t *dest; @@ -230,14 +230,14 @@ void r300EmitState(r300ContextPtr r300) if (RADEON_DEBUG & DEBUG_STATE) fprintf(stderr, "Begin reemit state\n"); - r300DoEmitState(r300, GL_FALSE); + r300EmitAtoms(r300, GL_FALSE); r300->cmdbuf.count_reemit = r300->cmdbuf.count_used; } if (RADEON_DEBUG & DEBUG_STATE) fprintf(stderr, "Begin dirty state\n"); - r300DoEmitState(r300, GL_TRUE); + r300EmitAtoms(r300, GL_TRUE); assert(r300->cmdbuf.count_used < r300->cmdbuf.size); -- cgit v1.2.3 From 6bae7d40f725be24df0be196fbb6bdcfd2aaa581 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sat, 12 May 2007 01:53:56 +0000 Subject: r300: Removed the name argument to ALLOC_STATE; do the name via the macro. --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 152 ++++++++++++++++---------------- 1 file changed, 76 insertions(+), 76 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index b4c94de9778..f271d5819bb 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -261,11 +261,11 @@ CHECK(always, atom->cmd_size) CHECK(vpu, vpu_count(atom->cmd) ? (1 + vpu_count(atom->cmd) * 4) : 0) #undef packet0_count #undef vpu_count -#define ALLOC_STATE( ATOM, CHK, SZ, NM, IDX ) \ +#define ALLOC_STATE( ATOM, CHK, SZ, IDX ) \ do { \ r300->hw.ATOM.cmd_size = (SZ); \ r300->hw.ATOM.cmd = (uint32_t*)CALLOC((SZ) * sizeof(uint32_t)); \ - r300->hw.ATOM.name = (NM); \ + r300->hw.ATOM.name = #ATOM; \ r300->hw.ATOM.idx = (IDX); \ r300->hw.ATOM.check = check_##CHK; \ r300->hw.ATOM.dirty = GL_FALSE; \ @@ -296,187 +296,187 @@ void r300InitCmdBuf(r300ContextPtr r300) r300->hw.atomlist.name = "atom-list"; /* Initialize state atoms */ - ALLOC_STATE(vpt, always, R300_VPT_CMDSIZE, "vpt", 0); + ALLOC_STATE(vpt, always, R300_VPT_CMDSIZE, 0); r300->hw.vpt.cmd[R300_VPT_CMD_0] = cmdpacket0(R300_SE_VPORT_XSCALE, 6); - ALLOC_STATE(vap_cntl, always, 2, "vap_cntl", 0); + ALLOC_STATE(vap_cntl, always, 2, 0); r300->hw.vap_cntl.cmd[0] = cmdpacket0(R300_VAP_CNTL, 1); - ALLOC_STATE(vte, always, 3, "vte", 0); + ALLOC_STATE(vte, always, 3, 0); r300->hw.vte.cmd[0] = cmdpacket0(R300_SE_VTE_CNTL, 2); - ALLOC_STATE(unk2134, always, 3, "unk2134", 0); + ALLOC_STATE(unk2134, always, 3, 0); r300->hw.unk2134.cmd[0] = cmdpacket0(0x2134, 2); - ALLOC_STATE(vap_cntl_status, always, 2, "vap_cntl_status", 0); + ALLOC_STATE(vap_cntl_status, always, 2, 0); r300->hw.vap_cntl_status.cmd[0] = cmdpacket0(R300_VAP_CNTL_STATUS, 1); - ALLOC_STATE(vir[0], variable, R300_VIR_CMDSIZE, "vir[0]", 0); + ALLOC_STATE(vir[0], variable, R300_VIR_CMDSIZE, 0); r300->hw.vir[0].cmd[R300_VIR_CMD_0] = cmdpacket0(R300_VAP_INPUT_ROUTE_0_0, 1); - ALLOC_STATE(vir[1], variable, R300_VIR_CMDSIZE, "vir[1]", 1); + ALLOC_STATE(vir[1], variable, R300_VIR_CMDSIZE, 1); r300->hw.vir[1].cmd[R300_VIR_CMD_0] = cmdpacket0(R300_VAP_INPUT_ROUTE_1_0, 1); - ALLOC_STATE(vic, always, R300_VIC_CMDSIZE, "vic", 0); + ALLOC_STATE(vic, always, R300_VIC_CMDSIZE, 0); r300->hw.vic.cmd[R300_VIC_CMD_0] = cmdpacket0(R300_VAP_INPUT_CNTL_0, 2); - ALLOC_STATE(unk21DC, always, 2, "unk21DC", 0); + ALLOC_STATE(unk21DC, always, 2, 0); r300->hw.unk21DC.cmd[0] = cmdpacket0(0x21DC, 1); - ALLOC_STATE(unk221C, always, 2, "unk221C", 0); + ALLOC_STATE(unk221C, always, 2, 0); r300->hw.unk221C.cmd[0] = cmdpacket0(R300_VAP_UNKNOWN_221C, 1); - ALLOC_STATE(unk2220, always, 5, "unk2220", 0); + ALLOC_STATE(unk2220, always, 5, 0); r300->hw.unk2220.cmd[0] = cmdpacket0(0x2220, 4); - ALLOC_STATE(unk2288, always, 2, "unk2288", 0); + ALLOC_STATE(unk2288, always, 2, 0); r300->hw.unk2288.cmd[0] = cmdpacket0(R300_VAP_UNKNOWN_2288, 1); - ALLOC_STATE(vof, always, R300_VOF_CMDSIZE, "vof", 0); + ALLOC_STATE(vof, always, R300_VOF_CMDSIZE, 0); r300->hw.vof.cmd[R300_VOF_CMD_0] = cmdpacket0(R300_VAP_OUTPUT_VTX_FMT_0, 2); if (has_tcl) { - ALLOC_STATE(pvs, always, R300_PVS_CMDSIZE, "pvs", 0); + ALLOC_STATE(pvs, always, R300_PVS_CMDSIZE, 0); r300->hw.pvs.cmd[R300_PVS_CMD_0] = cmdpacket0(R300_VAP_PVS_CNTL_1, 3); } - ALLOC_STATE(gb_enable, always, 2, "gb_enable", 0); + ALLOC_STATE(gb_enable, always, 2, 0); r300->hw.gb_enable.cmd[0] = cmdpacket0(R300_GB_ENABLE, 1); - ALLOC_STATE(gb_misc, always, R300_GB_MISC_CMDSIZE, "gb_misc", 0); + ALLOC_STATE(gb_misc, always, R300_GB_MISC_CMDSIZE, 0); r300->hw.gb_misc.cmd[0] = cmdpacket0(R300_GB_MSPOS0, 5); - ALLOC_STATE(txe, always, R300_TXE_CMDSIZE, "txe", 0); + ALLOC_STATE(txe, always, R300_TXE_CMDSIZE, 0); r300->hw.txe.cmd[R300_TXE_CMD_0] = cmdpacket0(R300_TX_ENABLE, 1); - ALLOC_STATE(unk4200, always, 5, "unk4200", 0); + ALLOC_STATE(unk4200, always, 5, 0); r300->hw.unk4200.cmd[0] = cmdpacket0(0x4200, 4); - ALLOC_STATE(unk4214, always, 2, "unk4214", 0); + ALLOC_STATE(unk4214, always, 2, 0); r300->hw.unk4214.cmd[0] = cmdpacket0(0x4214, 1); - ALLOC_STATE(ps, always, R300_PS_CMDSIZE, "ps", 0); + ALLOC_STATE(ps, always, R300_PS_CMDSIZE, 0); r300->hw.ps.cmd[0] = cmdpacket0(R300_RE_POINTSIZE, 1); - ALLOC_STATE(unk4230, always, 4, "unk4230", 0); + ALLOC_STATE(unk4230, always, 4, 0); r300->hw.unk4230.cmd[0] = cmdpacket0(0x4230, 3); - ALLOC_STATE(lcntl, always, 2, "lcntl", 0); + ALLOC_STATE(lcntl, always, 2, 0); r300->hw.lcntl.cmd[0] = cmdpacket0(R300_RE_LINE_CNT, 1); - ALLOC_STATE(unk4260, always, 4, "unk4260", 0); + ALLOC_STATE(unk4260, always, 4, 0); r300->hw.unk4260.cmd[0] = cmdpacket0(0x4260, 3); - ALLOC_STATE(shade, always, 5, "shade", 0); + ALLOC_STATE(shade, always, 5, 0); r300->hw.shade.cmd[0] = cmdpacket0(R300_RE_SHADE, 4); - ALLOC_STATE(polygon_mode, always, 4, "polygon_mode", 0); + ALLOC_STATE(polygon_mode, always, 4, 0); r300->hw.polygon_mode.cmd[0] = cmdpacket0(R300_RE_POLYGON_MODE, 3); - ALLOC_STATE(fogp, always, 3, "fogp", 0); + ALLOC_STATE(fogp, always, 3, 0); r300->hw.fogp.cmd[0] = cmdpacket0(R300_RE_FOG_SCALE, 2); - ALLOC_STATE(zbias_cntl, always, 2, "zbias_cntl", 0); + ALLOC_STATE(zbias_cntl, always, 2, 0); r300->hw.zbias_cntl.cmd[0] = cmdpacket0(R300_RE_ZBIAS_CNTL, 1); - ALLOC_STATE(zbs, always, R300_ZBS_CMDSIZE, "zbs", 0); + ALLOC_STATE(zbs, always, R300_ZBS_CMDSIZE, 0); r300->hw.zbs.cmd[R300_ZBS_CMD_0] = cmdpacket0(R300_RE_ZBIAS_T_FACTOR, 4); - ALLOC_STATE(occlusion_cntl, always, 2, "occlusion_cntl", 0); + ALLOC_STATE(occlusion_cntl, always, 2, 0); r300->hw.occlusion_cntl.cmd[0] = cmdpacket0(R300_RE_OCCLUSION_CNTL, 1); - ALLOC_STATE(cul, always, R300_CUL_CMDSIZE, "cul", 0); + ALLOC_STATE(cul, always, R300_CUL_CMDSIZE, 0); r300->hw.cul.cmd[R300_CUL_CMD_0] = cmdpacket0(R300_RE_CULL_CNTL, 1); - ALLOC_STATE(unk42C0, always, 3, "unk42C0", 0); + ALLOC_STATE(unk42C0, always, 3, 0); r300->hw.unk42C0.cmd[0] = cmdpacket0(0x42C0, 2); - ALLOC_STATE(rc, always, R300_RC_CMDSIZE, "rc", 0); + ALLOC_STATE(rc, always, R300_RC_CMDSIZE, 0); r300->hw.rc.cmd[R300_RC_CMD_0] = cmdpacket0(R300_RS_CNTL_0, 2); - ALLOC_STATE(ri, always, R300_RI_CMDSIZE, "ri", 0); + ALLOC_STATE(ri, always, R300_RI_CMDSIZE, 0); r300->hw.ri.cmd[R300_RI_CMD_0] = cmdpacket0(R300_RS_INTERP_0, 8); - ALLOC_STATE(rr, variable, R300_RR_CMDSIZE, "rr", 0); + ALLOC_STATE(rr, variable, R300_RR_CMDSIZE, 0); r300->hw.rr.cmd[R300_RR_CMD_0] = cmdpacket0(R300_RS_ROUTE_0, 1); - ALLOC_STATE(unk43A4, always, 3, "unk43A4", 0); + ALLOC_STATE(unk43A4, always, 3, 0); r300->hw.unk43A4.cmd[0] = cmdpacket0(0x43A4, 2); - ALLOC_STATE(unk43E8, always, 2, "unk43E8", 0); + ALLOC_STATE(unk43E8, always, 2, 0); r300->hw.unk43E8.cmd[0] = cmdpacket0(0x43E8, 1); - ALLOC_STATE(fp, always, R300_FP_CMDSIZE, "fp", 0); + ALLOC_STATE(fp, always, R300_FP_CMDSIZE, 0); r300->hw.fp.cmd[R300_FP_CMD_0] = cmdpacket0(R300_PFS_CNTL_0, 3); r300->hw.fp.cmd[R300_FP_CMD_1] = cmdpacket0(R300_PFS_NODE_0, 4); - ALLOC_STATE(fpt, variable, R300_FPT_CMDSIZE, "fpt", 0); + ALLOC_STATE(fpt, variable, R300_FPT_CMDSIZE, 0); r300->hw.fpt.cmd[R300_FPT_CMD_0] = cmdpacket0(R300_PFS_TEXI_0, 0); - ALLOC_STATE(unk46A4, always, 6, "unk46A4", 0); + ALLOC_STATE(unk46A4, always, 6, 0); r300->hw.unk46A4.cmd[0] = cmdpacket0(0x46A4, 5); - ALLOC_STATE(fpi[0], variable, R300_FPI_CMDSIZE, "fpi[0]", 0); + ALLOC_STATE(fpi[0], variable, R300_FPI_CMDSIZE, 0); r300->hw.fpi[0].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR0_0, 1); - ALLOC_STATE(fpi[1], variable, R300_FPI_CMDSIZE, "fpi[1]", 1); + ALLOC_STATE(fpi[1], variable, R300_FPI_CMDSIZE, 1); r300->hw.fpi[1].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR1_0, 1); - ALLOC_STATE(fpi[2], variable, R300_FPI_CMDSIZE, "fpi[2]", 2); + ALLOC_STATE(fpi[2], variable, R300_FPI_CMDSIZE, 2); r300->hw.fpi[2].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR2_0, 1); - ALLOC_STATE(fpi[3], variable, R300_FPI_CMDSIZE, "fpi[3]", 3); + ALLOC_STATE(fpi[3], variable, R300_FPI_CMDSIZE, 3); r300->hw.fpi[3].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR3_0, 1); - ALLOC_STATE(fogs, always, R300_FOGS_CMDSIZE, "fogs", 0); + ALLOC_STATE(fogs, always, R300_FOGS_CMDSIZE, 0); r300->hw.fogs.cmd[R300_FOGS_CMD_0] = cmdpacket0(R300_RE_FOG_STATE, 1); - ALLOC_STATE(fogc, always, R300_FOGC_CMDSIZE, "fogc", 0); + ALLOC_STATE(fogc, always, R300_FOGC_CMDSIZE, 0); r300->hw.fogc.cmd[R300_FOGC_CMD_0] = cmdpacket0(R300_FOG_COLOR_R, 3); - ALLOC_STATE(at, always, R300_AT_CMDSIZE, "at", 0); + ALLOC_STATE(at, always, R300_AT_CMDSIZE, 0); r300->hw.at.cmd[R300_AT_CMD_0] = cmdpacket0(R300_PP_ALPHA_TEST, 2); - ALLOC_STATE(unk4BD8, always, 2, "unk4BD8", 0); + ALLOC_STATE(unk4BD8, always, 2, 0); r300->hw.unk4BD8.cmd[0] = cmdpacket0(0x4BD8, 1); - ALLOC_STATE(fpp, variable, R300_FPP_CMDSIZE, "fpp", 0); + ALLOC_STATE(fpp, variable, R300_FPP_CMDSIZE, 0); r300->hw.fpp.cmd[R300_FPP_CMD_0] = cmdpacket0(R300_PFS_PARAM_0_X, 0); - ALLOC_STATE(unk4E00, always, 2, "unk4E00", 0); + ALLOC_STATE(unk4E00, always, 2, 0); r300->hw.unk4E00.cmd[0] = cmdpacket0(0x4E00, 1); - ALLOC_STATE(bld, always, R300_BLD_CMDSIZE, "bld", 0); + ALLOC_STATE(bld, always, R300_BLD_CMDSIZE, 0); r300->hw.bld.cmd[R300_BLD_CMD_0] = cmdpacket0(R300_RB3D_CBLEND, 2); - ALLOC_STATE(cmk, always, R300_CMK_CMDSIZE, "cmk", 0); + ALLOC_STATE(cmk, always, R300_CMK_CMDSIZE, 0); r300->hw.cmk.cmd[R300_CMK_CMD_0] = cmdpacket0(R300_RB3D_COLORMASK, 1); - ALLOC_STATE(blend_color, always, 4, "blend_color", 0); + ALLOC_STATE(blend_color, always, 4, 0); r300->hw.blend_color.cmd[0] = cmdpacket0(R300_RB3D_BLEND_COLOR, 3); - ALLOC_STATE(cb, always, R300_CB_CMDSIZE, "cb", 0); + ALLOC_STATE(cb, always, R300_CB_CMDSIZE, 0); r300->hw.cb.cmd[R300_CB_CMD_0] = cmdpacket0(R300_RB3D_COLOROFFSET0, 1); r300->hw.cb.cmd[R300_CB_CMD_1] = cmdpacket0(R300_RB3D_COLORPITCH0, 1); - ALLOC_STATE(unk4E50, always, 10, "unk4E50", 0); + ALLOC_STATE(unk4E50, always, 10, 0); r300->hw.unk4E50.cmd[0] = cmdpacket0(0x4E50, 9); - ALLOC_STATE(unk4E88, always, 2, "unk4E88", 0); + ALLOC_STATE(unk4E88, always, 2, 0); r300->hw.unk4E88.cmd[0] = cmdpacket0(0x4E88, 1); - ALLOC_STATE(unk4EA0, always, 3, "unk4EA0 R350 only", 0); + ALLOC_STATE(unk4EA0, always, 3, 0); r300->hw.unk4EA0.cmd[0] = cmdpacket0(0x4EA0, 2); - ALLOC_STATE(zs, always, R300_ZS_CMDSIZE, "zstencil", 0); + ALLOC_STATE(zs, always, R300_ZS_CMDSIZE, 0); r300->hw.zs.cmd[R300_ZS_CMD_0] = cmdpacket0(R300_RB3D_ZSTENCIL_CNTL_0, 3); - ALLOC_STATE(zstencil_format, always, 5, "zstencil_format", 0); + ALLOC_STATE(zstencil_format, always, 5, 0); r300->hw.zstencil_format.cmd[0] = cmdpacket0(R300_RB3D_ZSTENCIL_FORMAT, 4); - ALLOC_STATE(zb, always, R300_ZB_CMDSIZE, "zb", 0); + ALLOC_STATE(zb, always, R300_ZB_CMDSIZE, 0); r300->hw.zb.cmd[R300_ZB_CMD_0] = cmdpacket0(R300_RB3D_DEPTHOFFSET, 2); - ALLOC_STATE(unk4F28, always, 2, "unk4F28", 0); + ALLOC_STATE(unk4F28, always, 2, 0); r300->hw.unk4F28.cmd[0] = cmdpacket0(0x4F28, 1); - ALLOC_STATE(unk4F30, always, 3, "unk4F30", 0); + ALLOC_STATE(unk4F30, always, 3, 0); r300->hw.unk4F30.cmd[0] = cmdpacket0(0x4F30, 2); - ALLOC_STATE(unk4F44, always, 2, "unk4F44", 0); + ALLOC_STATE(unk4F44, always, 2, 0); r300->hw.unk4F44.cmd[0] = cmdpacket0(0x4F44, 1); - ALLOC_STATE(unk4F54, always, 2, "unk4F54", 0); + ALLOC_STATE(unk4F54, always, 2, 0); r300->hw.unk4F54.cmd[0] = cmdpacket0(0x4F54, 1); /* VPU only on TCL */ if (has_tcl) { - ALLOC_STATE(vpi, vpu, R300_VPI_CMDSIZE, "vpi", 0); + ALLOC_STATE(vpi, vpu, R300_VPI_CMDSIZE, 0); r300->hw.vpi.cmd[R300_VPI_CMD_0] = cmdvpu(R300_PVS_UPLOAD_PROGRAM, 0); - ALLOC_STATE(vpp, vpu, R300_VPP_CMDSIZE, "vpp", 0); + ALLOC_STATE(vpp, vpu, R300_VPP_CMDSIZE, 0); r300->hw.vpp.cmd[R300_VPP_CMD_0] = cmdvpu(R300_PVS_UPLOAD_PARAMETERS, 0); - ALLOC_STATE(vps, vpu, R300_VPS_CMDSIZE, "vps", 0); + ALLOC_STATE(vps, vpu, R300_VPS_CMDSIZE, 0); r300->hw.vps.cmd[R300_VPS_CMD_0] = cmdvpu(R300_PVS_UPLOAD_POINTSIZE, 1); } /* Textures */ - ALLOC_STATE(tex.filter, variable, mtu + 1, "tex_filter", 0); + ALLOC_STATE(tex.filter, variable, mtu + 1, 0); r300->hw.tex.filter.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_FILTER_0, 0); - ALLOC_STATE(tex.filter_1, variable, mtu + 1, "tex_filter_1", 0); + ALLOC_STATE(tex.filter_1, variable, mtu + 1, 0); r300->hw.tex.filter_1.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_FILTER1_0, 0); - ALLOC_STATE(tex.size, variable, mtu + 1, "tex_size", 0); + ALLOC_STATE(tex.size, variable, mtu + 1, 0); r300->hw.tex.size.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_SIZE_0, 0); - ALLOC_STATE(tex.format, variable, mtu + 1, "tex_format", 0); + ALLOC_STATE(tex.format, variable, mtu + 1, 0); r300->hw.tex.format.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_FORMAT_0, 0); - ALLOC_STATE(tex.pitch, variable, mtu + 1, "tex_pitch", 0); + ALLOC_STATE(tex.pitch, variable, mtu + 1, 0); r300->hw.tex.pitch.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_PITCH_0, 0); - ALLOC_STATE(tex.offset, variable, mtu + 1, "tex_offset", 0); + ALLOC_STATE(tex.offset, variable, mtu + 1, 0); r300->hw.tex.offset.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_OFFSET_0, 0); - ALLOC_STATE(tex.chroma_key, variable, mtu + 1, "tex_chroma_key", 0); + ALLOC_STATE(tex.chroma_key, variable, mtu + 1, 0); r300->hw.tex.chroma_key.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_CHROMA_KEY_0, 0); - ALLOC_STATE(tex.border_color, variable, mtu + 1, "tex_border_color", 0); + ALLOC_STATE(tex.border_color, variable, mtu + 1, 0); r300->hw.tex.border_color.cmd[R300_TEX_CMD_0] = cmdpacket0(R300_TX_BORDER_COLOR_0, 0); -- cgit v1.2.3 From b78aec576735c663342da8367dccd3de71e70c34 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Sat, 12 May 2007 11:20:24 +0200 Subject: bring over recent radeonMakeCurrent fixes for r300 to radeon/r200 --- src/mesa/drivers/dri/r200/r200_context.c | 1 - src/mesa/drivers/dri/radeon/radeon_context.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 0507eb86e69..786a298cc3b 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -679,7 +679,6 @@ r200MakeCurrent( __DRIcontextPrivate *driContextPriv, newCtx->dri.drawable = driDrawPriv; r200SetCliprects(newCtx); - r200UpdateWindow( newCtx->glCtx ); r200UpdateViewportOffset( newCtx->glCtx ); } diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index d7c2d1407d6..9451ec4aa5b 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -604,7 +604,6 @@ radeonMakeCurrent( __DRIcontextPrivate *driContextPriv, newCtx->dri.drawable = driDrawPriv; radeonSetCliprects(newCtx); - radeonUpdateWindow( newCtx->glCtx ); radeonUpdateViewportOffset( newCtx->glCtx ); } @@ -612,6 +611,7 @@ radeonMakeCurrent( __DRIcontextPrivate *driContextPriv, (GLframebuffer *) driDrawPriv->driverPrivate, (GLframebuffer *) driReadPriv->driverPrivate ); + _mesa_update_state( newCtx->glCtx ); } else { if (RADEON_DEBUG & DEBUG_DRI) fprintf(stderr, "%s ctx is null\n", __FUNCTION__); -- cgit v1.2.3 From 65fae193831e9fd4b2fc5a1b8170215cc77427dd Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sat, 12 May 2007 17:16:56 +0000 Subject: Revert "r300: Perform the locking closer to the DRM texture upload call." This reverts commit 93881edb46fc95e1cfb4ded4e8a5db92612d3e4d. --- src/mesa/drivers/dri/r300/r300_texmem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_texmem.c b/src/mesa/drivers/dri/r300/r300_texmem.c index 30f3886542f..eef5ff186f4 100644 --- a/src/mesa/drivers/dri/r300/r300_texmem.c +++ b/src/mesa/drivers/dri/r300/r300_texmem.c @@ -469,14 +469,12 @@ static void r300UploadSubImage(r300ContextPtr rmesa, r300TexObjPtr t, } } + LOCK_HARDWARE(&rmesa->radeon); do { - LOCK_HARDWARE(&rmesa->radeon); ret = drmCommandWriteRead(rmesa->radeon.dri.fd, DRM_RADEON_TEXTURE, &tex, sizeof(drm_radeon_texture_t)); - UNLOCK_HARDWARE(&rmesa->radeon); - if (ret) { if (RADEON_DEBUG & DEBUG_IOCTL) fprintf(stderr, @@ -485,6 +483,8 @@ static void r300UploadSubImage(r300ContextPtr rmesa, r300TexObjPtr t, } } while (ret == -EAGAIN); + UNLOCK_HARDWARE(&rmesa->radeon); + if (ret) { fprintf(stderr, "DRM_RADEON_TEXTURE: return = %d\n", ret); fprintf(stderr, " offset=0x%08x\n", offset); -- cgit v1.2.3 From 6f56e68ee305ab60569e449e53442e93d5a938a1 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 13 May 2007 06:39:24 +0000 Subject: r300: Use the defined values when writing to R300_VAP_INPUT_CNTL_[01]. You can verify this is correct with the following code. assert (0x00000001 == R300_INPUT_CNTL_0_COLOR); assert (0x00000405 == (R300_INPUT_CNTL_POS | R300_INPUT_CNTL_COLOR | R300_INPUT_CNTL_TC0)); --- src/mesa/drivers/dri/r300/r300_ioctl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index d2cc97d213e..9e741b3ecd4 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -210,10 +210,12 @@ static void r300EmitClearState(GLcontext * ctx) reg_start(R300_VAP_INPUT_ROUTE_1_0, 0); e32(0xF688F688); + /* R300_VAP_INPUT_CNTL_0, R300_VAP_INPUT_CNTL_1 */ R300_STATECHANGE(r300, vic); reg_start(R300_VAP_INPUT_CNTL_0, 1); - e32(0x00000001); - e32(0x00000405); + 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); -- cgit v1.2.3 From 73449270bb1bae1a4d12ff6c4187e73d9969c174 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 13 May 2007 07:44:20 +0000 Subject: r300: Use the defined values for the interpolater (interp_magic) magic values. --- src/mesa/drivers/dri/r300/r300_state.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index c45c571d7b3..cb34b8a7221 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1445,9 +1445,9 @@ void r300SetupRSUnit(GLcontext * ctx) /* I'm still unsure if these are needed */ GLuint interp_magic[8] = { 0x00, - 0x40, - 0x80, - 0xC0, + R300_RS_INTERP_1_UNKNOWN, + R300_RS_INTERP_2_UNKNOWN, + R300_RS_INTERP_3_UNKNOWN, 0x00, 0x00, 0x00, -- cgit v1.2.3 From c66fd808ac2a2013d8a305e917c8ddeb9e16048d Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 13 May 2007 07:51:41 +0000 Subject: r300: A few very minor indenting corrections. --- src/mesa/drivers/dri/r300/r300_ioctl.c | 1 - src/mesa/drivers/dri/r300/r300_mem.h | 2 +- src/mesa/drivers/dri/r300/r300_reg.h | 8 ++++---- src/mesa/drivers/dri/r300/r300_render.c | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index 9e741b3ecd4..4bdd35bb24a 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -216,7 +216,6 @@ 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 */ diff --git a/src/mesa/drivers/dri/r300/r300_mem.h b/src/mesa/drivers/dri/r300/r300_mem.h index d2932380ec6..625a7f6d8d5 100644 --- a/src/mesa/drivers/dri/r300/r300_mem.h +++ b/src/mesa/drivers/dri/r300/r300_mem.h @@ -20,7 +20,7 @@ struct r300_memory_manager { int mapped; } *u_list; int u_head, u_size, u_last; - + }; extern void r300_mem_init(r300ContextPtr rmesa); diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h index e309a48c423..8ff362b9d21 100644 --- a/src/mesa/drivers/dri/r300/r300_reg.h +++ b/src/mesa/drivers/dri/r300/r300_reg.h @@ -23,11 +23,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ +/* *INDENT-OFF* */ + #ifndef _R300_REG_H #define _R300_REG_H -/* *INDENT-OFF* */ - #define R300_MC_INIT_MISC_LAT_TIMER 0x180 # define R300_MC_MISC__MC_CPR_INIT_LAT_SHIFT 0 # define R300_MC_MISC__MC_VF_INIT_LAT_SHIFT 4 @@ -1606,6 +1606,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. */ #define R300_CP_CMD_BITBLT_MULTI 0xC0009B00 -/* *INDENT-ON* */ - #endif /* _R300_REG_H */ + +/* *INDENT-ON* */ diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index d967c69c427..cc13e9a5304 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -110,7 +110,7 @@ static int r300PrimitiveType(r300ContextPtr rmesa, GLcontext * ctx, int prim) return R300_VAP_VF_CNTL__PRIM_POLYGON; break; default: - assert (0); + assert(0); return -1; break; } @@ -160,7 +160,7 @@ static int r300NumVerts(r300ContextPtr rmesa, int num_verts, int prim) verts_off = num_verts; break; default: - assert (0); + assert(0); return -1; break; } -- cgit v1.2.3 From d93642251e3e984d91b3821349e38f68dc582e3d Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 13 May 2007 08:21:50 +0000 Subject: r300: Removed a couple of obsolete/commented out includes. --- src/mesa/drivers/dri/r300/r300_tex.c | 1 - src/mesa/drivers/dri/r300/r300_texmem.c | 3 --- 2 files changed, 4 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c index a8be0f6ff74..e7b14a0d171 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.c +++ b/src/mesa/drivers/dri/r300/r300_tex.c @@ -48,7 +48,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_context.h" #include "r300_state.h" #include "r300_ioctl.h" -//#include "r300_swtcl.h" #include "r300_tex.h" #include "xmlpool.h" diff --git a/src/mesa/drivers/dri/r300/r300_texmem.c b/src/mesa/drivers/dri/r300/r300_texmem.c index eef5ff186f4..60e7dc967b1 100644 --- a/src/mesa/drivers/dri/r300/r300_texmem.c +++ b/src/mesa/drivers/dri/r300/r300_texmem.c @@ -49,9 +49,6 @@ SOFTWARE. #include "r300_state.h" #include "r300_cmdbuf.h" #include "radeon_ioctl.h" -/* -#include "r300_swtcl.h" -*/ #include "r300_tex.h" #include "r300_ioctl.h" #include /* for usleep() */ -- cgit v1.2.3 From b5990cec902be0c599ec4962f0d69d6db2e5ec04 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 13 May 2007 08:28:51 +0000 Subject: r300: Use #if 0 for disabled code, rather than commenting it out. --- src/mesa/drivers/dri/r300/r300_tex.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c index e7b14a0d171..2a21c611629 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.c +++ b/src/mesa/drivers/dri/r300/r300_tex.c @@ -800,16 +800,20 @@ static void r300CompressedTexImage2D(GLcontext * ctx, GLenum target, } texImage->IsClientData = GL_FALSE; -/* can't call this, different parameters. Would never evaluate to true anyway currently - if (r300ValidateClientStorage( ctx, target, - internalFormat, - width, height, - format, type, pixels, - packing, texObj, texImage)) { - if (RADEON_DEBUG & DEBUG_TEXTURE) - fprintf(stderr, "%s: Using client storage\n", __FUNCTION__); - } - else */ { + + /* can't call this, different parameters. Would never evaluate to true anyway currently */ +#if 0 + if (r300ValidateClientStorage(ctx, target, + internalFormat, + width, height, + format, type, pixels, + packing, texObj, texImage)) { + if (RADEON_DEBUG & DEBUG_TEXTURE) + fprintf(stderr, "%s: Using client storage\n", + __FUNCTION__); + } else +#endif + { if (RADEON_DEBUG & DEBUG_TEXTURE) fprintf(stderr, "%s: Using normal storage\n", __FUNCTION__); -- cgit v1.2.3 From e4b8481f396d0347f10eb51486c7fe5b01252457 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 13 May 2007 08:43:30 +0000 Subject: r300: Removed the unused r300_aos_rec (replaced by r300_dma_region) structure. --- src/mesa/drivers/dri/r300/r300_context.h | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 07c3e37927e..cc065bb04d2 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -812,19 +812,6 @@ struct radeon_vertex_buffer { int lock_uptodate; }; -struct r300_aos_rec { - GLuint offset; - int element_size; /* in dwords */ - int stride; /* distance between elements, in dwords */ - - int format; - - int ncomponents; /* number of components - between 1 and 4, inclusive */ - - int reg; /* which register they are assigned to. */ - -}; - struct r300_state { struct r300_depthbuffer_state depth; struct r300_texture_state texture; -- cgit v1.2.3 From 82de92c0fb329b464fe19d6cc45080174e019795 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 13 May 2007 08:59:54 +0000 Subject: r300: Changed a couple of functions in r300_state.c to static functions. --- src/mesa/drivers/dri/r300/r300_state.c | 34 +++++++++++++++++----------------- src/mesa/drivers/dri/r300/r300_state.h | 1 - 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index cb34b8a7221..f7296ebb123 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1439,7 +1439,7 @@ union r300_outputs_written { ((hw_tcl_on) ? (ow).vp_outputs & (1 << (vp_result)) : \ RENDERINPUTS_TEST( (ow.index_bitset), (tnl_attrib) )) -void r300SetupRSUnit(GLcontext * ctx) +static void r300SetupRSUnit(GLcontext * ctx) { r300ContextPtr r300 = R300_CONTEXT(ctx); /* I'm still unsure if these are needed */ @@ -1858,22 +1858,7 @@ void r300UpdateShaders(r300ContextPtr rmesa) } -void r300UpdateShaderStates(r300ContextPtr rmesa) -{ - GLcontext *ctx; - ctx = rmesa->radeon.glCtx; - - r300UpdateTextureState(ctx); - - r300SetupPixelShader(rmesa); - r300SetupTextures(ctx); - - if ((rmesa->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) - r300SetupVertexShader(rmesa); - r300SetupRSUnit(ctx); -} - -void r300SetupPixelShader(r300ContextPtr rmesa) +static void r300SetupPixelShader(r300ContextPtr rmesa) { GLcontext *ctx = rmesa->radeon.glCtx; struct r300_fragment_program *fp = (struct r300_fragment_program *) @@ -1947,6 +1932,21 @@ void r300SetupPixelShader(r300ContextPtr rmesa) cmdpacket0(R300_PFS_PARAM_0_X, fp->const_nr * 4); } +void r300UpdateShaderStates(r300ContextPtr rmesa) +{ + GLcontext *ctx; + ctx = rmesa->radeon.glCtx; + + r300UpdateTextureState(ctx); + + r300SetupPixelShader(rmesa); + r300SetupTextures(ctx); + + if ((rmesa->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) + r300SetupVertexShader(rmesa); + r300SetupRSUnit(ctx); +} + /** * Called by Mesa after an internal state update. */ diff --git a/src/mesa/drivers/dri/r300/r300_state.h b/src/mesa/drivers/dri/r300/r300_state.h index 3b9d8e74041..311e97daa8c 100644 --- a/src/mesa/drivers/dri/r300/r300_state.h +++ b/src/mesa/drivers/dri/r300/r300_state.h @@ -67,7 +67,6 @@ extern void r300UpdateViewportOffset(GLcontext * ctx); extern void r300UpdateWindow(GLcontext * ctx); extern void r300UpdateDrawBuffer(GLcontext * ctx); extern void r300SetupVertexShader(r300ContextPtr rmesa); -extern void r300SetupPixelShader(r300ContextPtr rmesa); extern void r300UpdateShaders(r300ContextPtr rmesa); extern void r300UpdateShaderStates(r300ContextPtr rmesa); -- cgit v1.2.3 From 13c0abd8a76ad4e14ad6b7737cdaaf8ff22c5cf2 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 13 May 2007 09:09:30 +0000 Subject: r300: Changed some more functions to static functions. This required reordering some of the functions which is why the diff is a little larger. --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 2 +- src/mesa/drivers/dri/r300/r300_ioctl.c | 21 -- src/mesa/drivers/dri/r300/r300_ioctl.h | 3 - src/mesa/drivers/dri/r300/r300_state.c | 413 ++++++++++++++++---------------- src/mesa/drivers/dri/r300/r300_state.h | 7 - 5 files changed, 207 insertions(+), 239 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index f271d5819bb..d13649ddc0d 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -128,7 +128,7 @@ int r300FlushCmdBuf(r300ContextPtr r300, const char *caller) return ret; } -void r300PrintStateAtom(r300ContextPtr r300, struct r300_state_atom *state) +static void r300PrintStateAtom(r300ContextPtr r300, struct r300_state_atom *state) { int i; int dwords = (*state->check) (r300, state); diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index 4bdd35bb24a..76712b0b198 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -668,27 +668,6 @@ void r300AllocDmaRegion(r300ContextPtr rmesa, #endif -/* Called via glXGetMemoryOffsetMESA() */ -GLuint r300GetMemoryOffsetMESA(__DRInativeDisplay * dpy, int scrn, - const GLvoid * pointer) -{ - GET_CURRENT_CONTEXT(ctx); - r300ContextPtr rmesa; - GLuint card_offset; - - if (!ctx || !(rmesa = R300_CONTEXT(ctx))) { - fprintf(stderr, "%s: no context\n", __FUNCTION__); - return ~0; - } - - if (!r300IsGartMemory(rmesa, pointer, 0)) - return ~0; - - card_offset = r300GartOffsetFromVirtual(rmesa, pointer); - - return card_offset - rmesa->radeon.radeonScreen->gart_base; -} - GLboolean r300IsGartMemory(r300ContextPtr rmesa, const GLvoid * pointer, GLint size) { diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.h b/src/mesa/drivers/dri/r300/r300_ioctl.h index cebd22fabed..7a19a2cf3f9 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.h +++ b/src/mesa/drivers/dri/r300/r300_ioctl.h @@ -39,9 +39,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_context.h" #include "radeon_drm.h" -extern GLuint r300GetMemoryOffsetMESA(__DRInativeDisplay * dpy, int scrn, - const GLvoid * pointer); - extern GLboolean r300IsGartMemory(r300ContextPtr rmesa, const GLvoid * pointer, GLint size); diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index f7296ebb123..e8d67f9aec1 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -976,7 +976,7 @@ static void r300ClearStencil(GLcontext * ctx, GLint s) #define SUBPIXEL_X 0.125 #define SUBPIXEL_Y 0.125 -void r300UpdateWindow(GLcontext * ctx) +static void r300UpdateWindow(GLcontext * ctx) { r300ContextPtr rmesa = R300_CONTEXT(ctx); __DRIdrawablePrivate *dPriv = rmesa->radeon.dri.drawable; @@ -1642,8 +1642,6 @@ void static inline setup_vertex_shader_fragment(r300ContextPtr r300, int dest, s } } -void r300SetupVertexProgram(r300ContextPtr rmesa); - /* just a skeleton for now.. */ /* Generate a vertex shader that simply transforms vertex and texture coordinates, @@ -1699,66 +1697,7 @@ static void r300GenerateSimpleVertexShader(r300ContextPtr r300) } -void r300SetupVertexShader(r300ContextPtr rmesa) -{ - GLcontext *ctx = rmesa->radeon.glCtx; - - /* Reset state, in case we don't use something */ - ((drm_r300_cmd_header_t *) rmesa->hw.vpp.cmd)->vpu.count = 0; - ((drm_r300_cmd_header_t *) rmesa->hw.vpi.cmd)->vpu.count = 0; - ((drm_r300_cmd_header_t *) rmesa->hw.vps.cmd)->vpu.count = 0; - - /* Not sure why this doesnt work... - 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) { - r300SetupVertexProgram(rmesa); - return; - } - - /* 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. - 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->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); - - /* 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 -} - -void r300SetupVertexProgram(r300ContextPtr rmesa) +static void r300SetupVertexProgram(r300ContextPtr rmesa) { GLcontext *ctx = rmesa->radeon.glCtx; int inst_count; @@ -1813,166 +1752,69 @@ void r300SetupVertexProgram(r300ContextPtr rmesa) #endif } -extern void _tnl_UpdateFixedFunctionProgram(GLcontext * ctx); - -extern int future_hw_tcl_on; -void r300UpdateShaders(r300ContextPtr rmesa) -{ - GLcontext *ctx; - struct r300_vertex_program *vp; - int i; - - ctx = rmesa->radeon.glCtx; - - if (rmesa->NewGLState && hw_tcl_on) { - rmesa->NewGLState = 0; - - for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) { - rmesa->temp_attrib[i] = - TNL_CONTEXT(ctx)->vb.AttribPtr[i]; - TNL_CONTEXT(ctx)->vb.AttribPtr[i] = - &rmesa->dummy_attrib[i]; - } - - _tnl_UpdateFixedFunctionProgram(ctx); - - for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) { - TNL_CONTEXT(ctx)->vb.AttribPtr[i] = - rmesa->temp_attrib[i]; - } - - r300SelectVertexShader(rmesa); - vp = (struct r300_vertex_program *) - CURRENT_VERTEX_SHADER(ctx); - /*if (vp->translated == GL_FALSE) - r300TranslateVertexShader(vp); */ - if (vp->translated == GL_FALSE) { - fprintf(stderr, "Failing back to sw-tcl\n"); - hw_tcl_on = future_hw_tcl_on = 0; - r300ResetHwState(rmesa); - - return; - } - r300UpdateStateParameters(ctx, _NEW_PROGRAM); - } - -} - -static void r300SetupPixelShader(r300ContextPtr rmesa) +static void r300SetupVertexShader(r300ContextPtr rmesa) { GLcontext *ctx = rmesa->radeon.glCtx; - struct r300_fragment_program *fp = (struct r300_fragment_program *) - (char *)ctx->FragmentProgram._Current; - int i, k; - if (!fp) /* should only happenen once, just after context is created */ - return; + /* Reset state, in case we don't use something */ + ((drm_r300_cmd_header_t *) rmesa->hw.vpp.cmd)->vpu.count = 0; + ((drm_r300_cmd_header_t *) rmesa->hw.vpi.cmd)->vpu.count = 0; + ((drm_r300_cmd_header_t *) rmesa->hw.vps.cmd)->vpu.count = 0; - r300TranslateFragmentShader(rmesa, fp); - if (!fp->translated) { - fprintf(stderr, "%s: No valid fragment shader, exiting\n", - __FUNCTION__); + /* Not sure why this doesnt work... + 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) { + r300SetupVertexProgram(rmesa); 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, fp); - /* 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; /* ( (k==3) ? R300_PFS_NODE_LAST_NODE : 0); */ - } 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); - 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_CMD_0] = - cmdpacket0(R300_PFS_PARAM_0_X, fp->const_nr * 4); -} - -void r300UpdateShaderStates(r300ContextPtr rmesa) -{ - GLcontext *ctx; - ctx = rmesa->radeon.glCtx; - - r300UpdateTextureState(ctx); - - r300SetupPixelShader(rmesa); - r300SetupTextures(ctx); - - if ((rmesa->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) - r300SetupVertexShader(rmesa); - r300SetupRSUnit(ctx); -} - -/** - * Called by Mesa after an internal state update. - */ -static void r300InvalidateState(GLcontext * ctx, GLuint new_state) -{ - r300ContextPtr r300 = R300_CONTEXT(ctx); + /* This needs to be replaced by vertex shader generation code */ + r300GenerateSimpleVertexShader(rmesa); - _swrast_InvalidateState(ctx, new_state); - _swsetup_InvalidateState(ctx, new_state); - _vbo_InvalidateState(ctx, new_state); - _tnl_InvalidateState(ctx, new_state); - _ae_invalidate_state(ctx, new_state); + setup_vertex_shader_fragment(rmesa, VSF_DEST_PROGRAM, + &(rmesa->state.vertex_shader.program)); - if (new_state & (_NEW_BUFFERS | _NEW_COLOR | _NEW_PIXEL)) { - r300UpdateDrawBuffer(ctx); - } +#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 - r300UpdateStateParameters(ctx, new_state); + 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->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); - r300->NewGLState |= new_state; + /* 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 } /** * Completely recalculates hardware state based on the Mesa state. */ -void r300ResetHwState(r300ContextPtr r300) +static void r300ResetHwState(r300ContextPtr r300) { GLcontext *ctx = r300->radeon.glCtx; int has_tcl = 1; @@ -2232,6 +2074,163 @@ 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; + struct r300_vertex_program *vp; + int i; + + ctx = rmesa->radeon.glCtx; + + if (rmesa->NewGLState && hw_tcl_on) { + rmesa->NewGLState = 0; + + for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) { + rmesa->temp_attrib[i] = + TNL_CONTEXT(ctx)->vb.AttribPtr[i]; + TNL_CONTEXT(ctx)->vb.AttribPtr[i] = + &rmesa->dummy_attrib[i]; + } + + _tnl_UpdateFixedFunctionProgram(ctx); + + for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) { + TNL_CONTEXT(ctx)->vb.AttribPtr[i] = + rmesa->temp_attrib[i]; + } + + r300SelectVertexShader(rmesa); + vp = (struct r300_vertex_program *) + CURRENT_VERTEX_SHADER(ctx); + /*if (vp->translated == GL_FALSE) + r300TranslateVertexShader(vp); */ + if (vp->translated == GL_FALSE) { + fprintf(stderr, "Failing back to sw-tcl\n"); + hw_tcl_on = future_hw_tcl_on = 0; + r300ResetHwState(rmesa); + + return; + } + r300UpdateStateParameters(ctx, _NEW_PROGRAM); + } + +} + +static void r300SetupPixelShader(r300ContextPtr rmesa) +{ + GLcontext *ctx = rmesa->radeon.glCtx; + struct r300_fragment_program *fp = (struct r300_fragment_program *) + (char *)ctx->FragmentProgram._Current; + int i, k; + + if (!fp) /* should only happenen once, just after context is created */ + return; + + r300TranslateFragmentShader(rmesa, fp); + if (!fp->translated) { + fprintf(stderr, "%s: No valid fragment shader, exiting\n", + __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, fp); + /* 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; /* ( (k==3) ? R300_PFS_NODE_LAST_NODE : 0); */ + } 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); + 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_CMD_0] = + cmdpacket0(R300_PFS_PARAM_0_X, fp->const_nr * 4); +} + +void r300UpdateShaderStates(r300ContextPtr rmesa) +{ + GLcontext *ctx; + ctx = rmesa->radeon.glCtx; + + r300UpdateTextureState(ctx); + + r300SetupPixelShader(rmesa); + r300SetupTextures(ctx); + + if ((rmesa->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) + r300SetupVertexShader(rmesa); + r300SetupRSUnit(ctx); +} + +/** + * Called by Mesa after an internal state update. + */ +static void r300InvalidateState(GLcontext * ctx, GLuint new_state) +{ + r300ContextPtr r300 = R300_CONTEXT(ctx); + + _swrast_InvalidateState(ctx, new_state); + _swsetup_InvalidateState(ctx, new_state); + _vbo_InvalidateState(ctx, new_state); + _tnl_InvalidateState(ctx, new_state); + _ae_invalidate_state(ctx, new_state); + + if (new_state & (_NEW_BUFFERS | _NEW_COLOR | _NEW_PIXEL)) { + r300UpdateDrawBuffer(ctx); + } + + r300UpdateStateParameters(ctx, new_state); + + r300->NewGLState |= new_state; +} + /** * Calculate initial hardware state and register state functions. * Assumes that the command buffer and state atoms have been diff --git a/src/mesa/drivers/dri/r300/r300_state.h b/src/mesa/drivers/dri/r300/r300_state.h index 311e97daa8c..21a49b7f361 100644 --- a/src/mesa/drivers/dri/r300/r300_state.h +++ b/src/mesa/drivers/dri/r300/r300_state.h @@ -58,20 +58,13 @@ do { \ \ } while (0) -extern void r300ResetHwState(r300ContextPtr r300); - extern void r300UpdateStateParameters(GLcontext * ctx, GLuint new_state); extern void r300InitState(r300ContextPtr r300); extern void r300InitStateFuncs(struct dd_function_table *functions); extern void r300UpdateViewportOffset(GLcontext * ctx); -extern void r300UpdateWindow(GLcontext * ctx); extern void r300UpdateDrawBuffer(GLcontext * ctx); -extern void r300SetupVertexShader(r300ContextPtr rmesa); extern void r300UpdateShaders(r300ContextPtr rmesa); extern void r300UpdateShaderStates(r300ContextPtr rmesa); -extern void r300PrintStateAtom(r300ContextPtr r300, - struct r300_state_atom *state); - #endif /* __R300_STATE_H__ */ -- cgit v1.2.3 From 33a73466ae1df4350cc26470056090c91a6edfe9 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 13 May 2007 12:36:27 +0000 Subject: r300: Added a TODO comment for the R300_VAP_INPUT_ROUTE_[01]_0 values. --- src/mesa/drivers/dri/r300/r300_ioctl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index 76712b0b198..1adbc2c854b 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -194,6 +194,14 @@ static void r300EmitClearState(GLcontext * ctx) if (!(r300->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL)) has_tcl = 0; + /* FIXME: the values written to R300_VAP_INPUT_ROUTE_0_0 and + * R300_VAP_INPUT_ROUTE_0_1 are in fact known, however, the values are + * quite complex; see the functions in r300_emit.c. + * + * I believe it would be a good idea to extend the functions in + * r300_emit.c so that they can be used to setup the default values for + * these registers, as well as the actual values used for rendering. + */ R300_STATECHANGE(r300, vir[0]); reg_start(R300_VAP_INPUT_ROUTE_0_0, 0); if (!has_tcl) -- cgit v1.2.3 From 2189ff5e510689f74063b77a03881802ecd482c7 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 13 May 2007 12:43:40 +0000 Subject: r300: Use the defined values when writing to R300_SE_VTE_CNTL. You can verify this is correct with the following code. assert (0x043f == (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)); --- src/mesa/drivers/dri/r300/r300_ioctl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index 1adbc2c854b..9d828286a6d 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -228,7 +228,10 @@ static void r300EmitClearState(GLcontext * ctx) R300_STATECHANGE(r300, vte); /* comes from fglrx startup of clear */ reg_start(R300_SE_VTE_CNTL, 1); - e32(0x043f); + 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); -- cgit v1.2.3 From 4e641bf3e938361a0c46304f29d040e9f5bc169e Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 13 May 2007 12:56:59 +0000 Subject: r300: Use the defined values when writing to R300_RS_ROUTE_0. --- src/mesa/drivers/dri/r300/r300_ioctl.c | 2 +- src/mesa/drivers/dri/r300/r300_reg.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index 9d828286a6d..09968bf239b 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -289,7 +289,7 @@ static void r300EmitClearState(GLcontext * ctx) R300_STATECHANGE(r300, rr); reg_start(R300_RS_ROUTE_0, 0); - e32(0x00004000); + e32(R300_RS_ROUTE_0_COLOR); R300_STATECHANGE(r300, fp); reg_start(R300_PFS_CNTL_0, 2); diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h index 8ff362b9d21..0a31f0b9785 100644 --- a/src/mesa/drivers/dri/r300/r300_reg.h +++ b/src/mesa/drivers/dri/r300/r300_reg.h @@ -673,6 +673,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. /* Special handling for color: When the fragment program uses color, * the ROUTE_0_COLOR bit is set and ROUTE_0_COLOR_DEST contains the * color register index. + * + * Apperently you may set the R300_RS_ROUTE_0_COLOR bit, but not provide any + * R300_RS_ROUTE_0_COLOR_DEST value; this setup is used for clearing the state. + * See r300_ioctl.c:r300EmitClearState. I'm not sure if this setup is strictly + * correct or not. - Oliver. */ # define R300_RS_ROUTE_0_COLOR (1 << 14) # define R300_RS_ROUTE_0_COLOR_DEST_SHIFT 17 -- cgit v1.2.3 From 0e7e2110550824ab12b04fb0d1aa9651b6719917 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 13 May 2007 12:59:41 +0000 Subject: r300: Use e32(0x0) rather than e32(0); makes greping for hex values easier. --- src/mesa/drivers/dri/r300/r300_ioctl.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index 09968bf239b..416ea7f231d 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -114,7 +114,7 @@ static void r300ClearBuffer(r300ContextPtr r300, int flags, int buffer) (ctx->Color.ColorMask[RCOMP] ? R300_COLORMASK0_R : 0) | (ctx->Color.ColorMask[ACOMP] ? R300_COLORMASK0_A : 0)); } else { - e32(0); + e32(0x0); } R300_STATECHANGE(r300, zs); @@ -242,11 +242,11 @@ static void r300EmitClearState(GLcontext * ctx) 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(0); /* no textures */ + e32(0x0); /* no textures */ R300_STATECHANGE(r300, txe); reg_start(R300_TX_ENABLE, 0); - e32(0); + e32(0x0); R300_STATECHANGE(r300, vpt); reg_start(R300_SE_VPORT_XSCALE, 5); @@ -259,12 +259,12 @@ static void r300EmitClearState(GLcontext * ctx) R300_STATECHANGE(r300, at); reg_start(R300_PP_ALPHA_TEST, 0); - e32(0); + e32(0x0); R300_STATECHANGE(r300, bld); reg_start(R300_RB3D_CBLEND, 1); - e32(0); - e32(0); + e32(0x0); + e32(0x0); R300_STATECHANGE(r300, unk221C); reg_start(R300_VAP_UNKNOWN_221C, 0); @@ -285,7 +285,7 @@ static void r300EmitClearState(GLcontext * ctx) /* The second constant is needed to get glxgears display anything .. */ reg_start(R300_RS_CNTL_0, 1); e32((1 << R300_RS_CNTL_CI_CNT_SHIFT) | R300_RS_CNTL_0_UNKNOWN_18); - e32(0); + e32(0x0); R300_STATECHANGE(r300, rr); reg_start(R300_RS_ROUTE_0, 0); @@ -293,13 +293,13 @@ static void r300EmitClearState(GLcontext * ctx) R300_STATECHANGE(r300, fp); reg_start(R300_PFS_CNTL_0, 2); - e32(0); - e32(0); - e32(0); + e32(0x0); + e32(0x0); + e32(0x0); reg_start(R300_PFS_NODE_0, 3); - e32(0); - e32(0); - e32(0); + e32(0x0); + e32(0x0); + e32(0x0); e32(R300_PFS_NODE_OUTPUT_COLOR); R300_STATECHANGE(r300, fpi[0]); @@ -325,7 +325,7 @@ static void r300EmitClearState(GLcontext * ctx) e32((0 << R300_PVS_CNTL_1_PROGRAM_START_SHIFT) | (0 << R300_PVS_CNTL_1_POS_END_SHIFT) | (1 << R300_PVS_CNTL_1_PROGRAM_END_SHIFT)); - e32(0); + e32(0x0); e32(1 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT); R300_STATECHANGE(r300, vpi); @@ -333,12 +333,12 @@ static void r300EmitClearState(GLcontext * ctx) e32(VP_OUT(ADD, OUT, 0, XYZW)); e32(VP_IN(IN, 0)); e32(VP_ZERO()); - e32(0); + e32(0x0); e32(VP_OUT(ADD, OUT, 1, XYZW)); e32(VP_IN(IN, 1)); e32(VP_ZERO()); - e32(0); + e32(0x0); } } -- cgit v1.2.3 From 524c3336c494be4d556c1685951bf8200e5f5047 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 13 May 2007 13:38:38 +0000 Subject: r300: Enable the non-user-buffers code to compile. --- src/mesa/drivers/dri/r300/r300_context.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index cc065bb04d2..13b943f75fc 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -872,9 +872,10 @@ struct r300_context { #ifdef USER_BUFFERS struct r300_memory_manager *rmm; +#endif + GLvector4f dummy_attrib[_TNL_ATTRIB_MAX]; GLvector4f *temp_attrib[_TNL_ATTRIB_MAX]; -#endif GLboolean disable_lowimpact_fallback; }; -- cgit v1.2.3 From 6a587c01242b6227658ea1160efa34a221d52368 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 11 May 2007 15:50:33 -0600 Subject: comment about fixing uniform structs --- src/mesa/shader/slang/slang_codegen.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 60ffc48f54b..02260d3422e 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -2866,6 +2866,19 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var, if (datatype == GL_NONE) { if (var->type.specifier.type == SLANG_SPEC_STRUCT) { _mesa_problem(NULL, "user-declared uniform structs not supported yet"); + /* XXX what we need to do is unroll the struct into its + * basic types, creating a uniform variable for each. + * For example: + * struct foo { + * vec3 a; + * vec4 b; + * }; + * uniform foo f; + * + * Should produce uniforms: + * "f.a" (GL_FLOAT_VEC3) + * "f.b" (GL_FLOAT_VEC4) + */ } else { slang_info_log_error(A->log, -- cgit v1.2.3 From 6efdf648f51fd1ae27043b2c59e9965467fb1ddb Mon Sep 17 00:00:00 2001 From: Bruce Merry Date: Mon, 14 May 2007 09:37:48 -0600 Subject: in __glXGetArrayType() return type, not enabled (bug 10938) --- src/glx/x11/indirect_vertex_array.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glx/x11/indirect_vertex_array.c b/src/glx/x11/indirect_vertex_array.c index 1855547dced..90ec277c41b 100644 --- a/src/glx/x11/indirect_vertex_array.c +++ b/src/glx/x11/indirect_vertex_array.c @@ -1667,7 +1667,7 @@ __glXGetArrayType( const __GLXattribute * const state, key, index ); if ( a != NULL ) { - *dest = (GLintptr) a->enabled; + *dest = (GLintptr) a->data_type; } return (a != NULL); -- cgit v1.2.3 From c128c3ce8c05549b92607a890c3d10171910f4ba Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 14 May 2007 14:30:36 -0600 Subject: master/trunk is now for Mesa 7.1 devel: bump versions --- Makefile | 8 ++++---- configs/default | 2 +- src/mesa/main/version.h | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 4984e4dceb7..ea86787cebe 100644 --- a/Makefile +++ b/Makefile @@ -162,10 +162,10 @@ ultrix-gcc: # Rules for making release tarballs -DIRECTORY = Mesa-7.0pre -LIB_NAME = MesaLib-7.0pre -DEMO_NAME = MesaDemos-7.0pre -GLUT_NAME = MesaGLUT-7.0pre +DIRECTORY = Mesa-7.1pre +LIB_NAME = MesaLib-7.1pre +DEMO_NAME = MesaDemos-7.1pre +GLUT_NAME = MesaGLUT-7.1pre MAIN_FILES = \ $(DIRECTORY)/Makefile* \ diff --git a/configs/default b/configs/default index b6a051e2b38..a7de3f813d6 100644 --- a/configs/default +++ b/configs/default @@ -9,7 +9,7 @@ CONFIG_NAME = default # Version info MESA_MAJOR=7 -MESA_MINOR=0 +MESA_MINOR=1 MESA_TINY=0 # external projects. This should be useless now that we use libdrm. diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index afc0bc2ec91..9229077f42c 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 7.0 + * Version: 7.1 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * @@ -29,9 +29,9 @@ /* Mesa version */ #define MESA_MAJOR 7 -#define MESA_MINOR 0 +#define MESA_MINOR 1 #define MESA_PATCH 0 -#define MESA_VERSION_STRING "7.0" +#define MESA_VERSION_STRING "7.1" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -- cgit v1.2.3 From 347bb541f5a89f59e502888a5ae486bc52abfb66 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 14 May 2007 14:40:59 -0600 Subject: Skeleton file for 7.1 release notes. --- docs/relnotes-7.1.html | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++ docs/relnotes.html | 1 + 2 files changed, 68 insertions(+) create mode 100644 docs/relnotes-7.1.html diff --git a/docs/relnotes-7.1.html b/docs/relnotes-7.1.html new file mode 100644 index 00000000000..974b3096eaa --- /dev/null +++ b/docs/relnotes-7.1.html @@ -0,0 +1,67 @@ + + +Mesa Release Notes + + + + + + + +

      Mesa 7.1 Release Notes / (in progress)

      + +

      +Mesa 7.1 is a new development release. +

      + + +

      MD5 checksums

      +
      +TBD
      +
      + + +

      New features

      +
        +
      + + +

      Bug fixes

      +
        +
      + + +

      Internal code changes

      +
        +
      + + +

      To Do (someday) items

      +
        +
      • Switch to freeglut +
      • Fix linux-glide target/driver. +
      • Improved lambda and derivative calculation for frag progs. +
      + + +

      Driver Status

      + +
      +Driver			Status
      +----------------------	----------------------
      +DRI drivers		varies with the driver
      +XMesa/GLX (on Xlib)	implements OpenGL 2.1
      +OSMesa (off-screen)	implements OpenGL 2.1
      +Windows/Win32		implements OpenGL 2.1
      +Glide (3dfx Voodoo1/2)	implements OpenGL 1.3
      +SVGA			unsupported
      +Wind River UGL		unsupported
      +DJGPP			unsupported
      +GGI			unsupported
      +BeOS			unsupported
      +Allegro			unsupported
      +D3D			unsupported
      +
      + + + diff --git a/docs/relnotes.html b/docs/relnotes.html index c698dfe1312..73bae8590f8 100644 --- a/docs/relnotes.html +++ b/docs/relnotes.html @@ -20,6 +20,7 @@ The release notes summarize what's new or changed in each Mesa release.

        +
      • 7.1 release notes
      • 7.0 release notes
      • 6.5.3 release notes
      • 6.5.2 release notes -- cgit v1.2.3 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(-) 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 78bd2912f86a53b53d3fb5362edae2c6455239b0 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 16 May 2007 14:45:52 -0700 Subject: Add enums and functions for GL_{MESA,EXT}_texture_array. --- include/GL/gl.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/include/GL/gl.h b/include/GL/gl.h index 78a00aeb8b3..6e92481a536 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2209,6 +2209,34 @@ GLAPI void GLAPIENTRY glGetProgramRegisterfvMESA(GLenum target, GLsizei len, con #endif /* GL_MESA_program_debug */ +#ifndef GL_MESA_texture_array +#define GL_MESA_texture_array 1 + +/* GL_MESA_texture_array uses the same enum values as GL_EXT_texture_array. + */ +#ifndef GL_EXT_texture_array + +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFramebufferTextureLayerEXT(GLenum target, + GLenum attachment, GLuint texture, GLint level, GLint layer); +#endif /* GL_GLEXT_PROTOTYPES */ + +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, + GLenum attachment, GLuint texture, GLint level, GLint layer); + +#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 +#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D +#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +#endif + +#endif + + #ifndef GL_ATI_blend_equation_separate #define GL_ATI_blend_equation_separate 1 -- cgit v1.2.3 From 2f61cbd30cdf0534da5e8281bc27886edb834b06 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 16 May 2007 14:46:13 -0700 Subject: Add simple program to test GL_MESA_texture_array. --- progs/tests/Makefile | 7 + progs/tests/arraytexture.c | 337 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 344 insertions(+) create mode 100644 progs/tests/arraytexture.c diff --git a/progs/tests/Makefile b/progs/tests/Makefile index 9edef74fb2c..b506db3e7bf 100644 --- a/progs/tests/Makefile +++ b/progs/tests/Makefile @@ -23,6 +23,7 @@ SOURCES = \ arbvptest3.c \ arbvptorus.c \ arbvpwarpmesh.c \ + arraytexture.c \ blendminmax.c \ blendsquare.c \ bufferobj.c \ @@ -117,6 +118,12 @@ getprocaddress: getprocaddress.c getproclist.h getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress.py python getprocaddress.py > getproclist.h +arraytexture: arraytexture.o readtex.o + $(CC) $(CFLAGS) arraytexture.o readtex.o $(LIBS) -o $@ + +arraytexture.o: arraytexture.c readtex.h + $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + afsmultiarb: afsmultiarb.o readtex.o $(CC) $(CFLAGS) afsmultiarb.o readtex.o $(LIBS) -o $@ diff --git a/progs/tests/arraytexture.c b/progs/tests/arraytexture.c new file mode 100644 index 00000000000..48c622be302 --- /dev/null +++ b/progs/tests/arraytexture.c @@ -0,0 +1,337 @@ +/* + * (C) Copyright IBM Corporation 2007 + * 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 + * IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/** + * \file arraytexture.c + * + * + * \author Ian Romanick + */ + +#include +#include +#include +#include +#include +#include +#include + +#if !defined(GL_EXT_texture_array) && !defined(GL_MESA_texture_array) +# error "This demo requires enums for either GL_EXT_texture_array or GL_MESA_texture_array to build." +#endif + +#include "readtex.h" + +#define GL_CHECK_ERROR() \ + do { \ + GLenum err = glGetError(); \ + if (err) { \ + printf("%s:%u: %s (0x%04x)\n", __FILE__, __LINE__, \ + gluErrorString(err), err); \ + } \ + } while (0) + +static const char *const textures[] = { + "../images/girl.rgb", + "../images/girl2.rgb", + "../images/arch.rgb", + "../images/s128.rgb", + + "../images/tree3.rgb", + "../images/bw.rgb", + "../images/reflect.rgb", + "../images/wrs_logo.rgb", + NULL +}; + +static const char frag_prog[] = + "!!ARBfp1.0\n" + "OPTION MESA_texture_array;\n" + "TEX result.color, fragment.texcoord[0], texture[0], ARRAY2D;\n" + "END\n"; + +static GLfloat Xrot = 0, Yrot = -30, Zrot = 0; +static GLfloat texZ = 0.0; +static GLfloat texZ_dir = 0.01; +static GLint num_layers; + +static PFNGLBINDPROGRAMARBPROC bind_program; +static PFNGLPROGRAMSTRINGARBPROC program_string; +static PFNGLGENPROGRAMSARBPROC gen_programs; + + +static void +PrintString(const char *s) +{ + while (*s) { + glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s); + s++; + } +} + + +static void Idle(void) +{ + static int lastTime = 0; + int t = glutGet(GLUT_ELAPSED_TIME); + + if (lastTime == 0) + lastTime = t; + else if (t - lastTime < 10) + return; + + lastTime = t; + + texZ += texZ_dir; + if ((texZ < 0.0) || ((GLint) texZ > num_layers)) { + texZ_dir = -texZ_dir; + } + + glutPostRedisplay(); +} + + +static void Display(void) +{ + char str[100]; + + glClear(GL_COLOR_BUFFER_BIT); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(-1, 1, -1, 1, -1, 1); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + (*bind_program)(GL_FRAGMENT_PROGRAM_ARB, 0); + glColor3f(1,1,1); + glRasterPos3f(-0.9, -0.9, 0.0); + sprintf(str, "Texture Z coordinate = %4.1f", texZ); + PrintString(str); + + (*bind_program)(GL_FRAGMENT_PROGRAM_ARB, 1); + GL_CHECK_ERROR(); + glEnable(GL_TEXTURE_2D_ARRAY_EXT); + GL_CHECK_ERROR(); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef(0.0, 0.0, -8.0); + + glPushMatrix(); + glRotatef(Xrot, 1, 0, 0); + glRotatef(Yrot, 0, 1, 0); + glRotatef(Zrot, 0, 0, 1); + + glBegin(GL_QUADS); + glTexCoord3f(0.0, 0.0, texZ); glVertex2f(-1.0, -1.0); + glTexCoord3f(2.0, 0.0, texZ); glVertex2f(1.0, -1.0); + glTexCoord3f(2.0, 2.0, texZ); glVertex2f(1.0, 1.0); + glTexCoord3f(0.0, 2.0, texZ); glVertex2f(-1.0, 1.0); + glEnd(); + + glPopMatrix(); + + glDisable(GL_TEXTURE_2D_ARRAY_EXT); + GL_CHECK_ERROR(); + (*bind_program)(GL_FRAGMENT_PROGRAM_ARB, 0); + GL_CHECK_ERROR(); + + glutSwapBuffers(); +} + + +static void Reshape(int width, int height) +{ + glViewport(0, 0, width, height); +} + + +static void Key(unsigned char key, int x, int y) +{ + (void) x; + (void) y; + switch (key) { + case 27: + exit(0); + break; + } + glutPostRedisplay(); +} + + +static void SpecialKey(int key, int x, int y) +{ + const GLfloat step = 3.0; + (void) x; + (void) y; + switch (key) { + case GLUT_KEY_UP: + Xrot -= step; + break; + case GLUT_KEY_DOWN: + Xrot += step; + break; + case GLUT_KEY_LEFT: + Yrot -= step; + break; + case GLUT_KEY_RIGHT: + Yrot += step; + break; + } + glutPostRedisplay(); +} + + +static int FindLine(const char *program, int position) +{ + int i, line = 1; + for (i = 0; i < position; i++) { + if (program[i] == '\n') + line++; + } + return line; +} + + +static void +compile_fragment_program(GLuint id, const char *prog) +{ + int errorPos; + int err; + + err = glGetError(); + (*bind_program)(GL_FRAGMENT_PROGRAM_ARB, id); + (*program_string)(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, + strlen(prog), (const GLubyte *) prog); + + glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorPos); + err = glGetError(); + if (err != GL_NO_ERROR || errorPos != -1) { + int l = FindLine(prog, errorPos); + + printf("Fragment Program Error (err=%d, pos=%d line=%d): %s\n", + err, errorPos, l, + (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); + exit(0); + } +} + + +static void require_extension(const char *ext) +{ + if (!glutExtensionSupported(ext)) { + printf("Sorry, %s not supported by this renderer.\n", ext); + exit(1); + } +} + + +static void Init(void) +{ + const char *const ver_string = (const char *const) glGetString(GL_VERSION); + unsigned i; + + printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); + printf("GL_VERSION = %s\n", ver_string); + + require_extension("GL_ARB_fragment_program"); + require_extension("GL_MESA_texture_array"); + require_extension("GL_SGIS_generate_mipmap"); + + bind_program = glutGetProcAddress("glBindProgramARB"); + program_string = glutGetProcAddress("glProgramStringARB"); + gen_programs = glutGetProcAddress("glGenProgramsARB"); + + + for (num_layers = 0; textures[num_layers] != NULL; num_layers++) + /* empty */ ; + + glBindTexture(GL_TEXTURE_2D_ARRAY_EXT, 1); + glTexImage3D(GL_TEXTURE_2D_ARRAY_EXT, 0, GL_RGB8, + 256, 256, num_layers, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); + GL_CHECK_ERROR(); + + glTexParameteri(GL_TEXTURE_2D_ARRAY_EXT, GL_GENERATE_MIPMAP_SGIS, + GL_TRUE); + + for (i = 0; textures[i] != NULL; i++) { + GLint width, height; + GLenum format; + + GLubyte *image = LoadRGBImage(textures[i], &width, &height, &format); + if (!image) { + printf("Error: could not load texture image %s\n", textures[i]); + exit(1); + } + + /* resize to 256 x 256 */ + if (width != 256 || height != 256) { + GLubyte *newImage = malloc(256 * 256 * 4); + gluScaleImage(format, width, height, GL_UNSIGNED_BYTE, image, + 256, 256, GL_UNSIGNED_BYTE, newImage); + free(image); + image = newImage; + } + + glTexSubImage3D(GL_TEXTURE_2D_ARRAY_EXT, 0, + 0, 0, i, 256, 256, 1, + format, GL_UNSIGNED_BYTE, image); + free(image); + } + GL_CHECK_ERROR(); + + glTexParameteri(GL_TEXTURE_2D_ARRAY_EXT, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D_ARRAY_EXT, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D_ARRAY_EXT, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); + + glTexParameteri(GL_TEXTURE_2D_ARRAY_EXT, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); + GL_CHECK_ERROR(); + glTexParameteri(GL_TEXTURE_2D_ARRAY_EXT, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + GL_CHECK_ERROR(); + + compile_fragment_program(1, frag_prog); + GL_CHECK_ERROR(); +} + + +int main(int argc, char *argv[]) +{ + glutInit(&argc, argv); + glutInitWindowPosition(0, 0); + glutInitWindowSize(350, 350); + glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE); + glutCreateWindow("Array texture test"); + glutReshapeFunc(Reshape); + glutKeyboardFunc(Key); + glutSpecialFunc(SpecialKey); + glutDisplayFunc(Display); + glutIdleFunc(Idle); + Init(); + glutMainLoop(); + return 0; +} -- cgit v1.2.3 From 9ebffb86a699e49fd683ed9afbf6d5b2ac244ae0 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 16 May 2007 15:33:36 -0700 Subject: Initial version of MESA_texture_array spec. --- docs/MESA_texture_array.spec | 805 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 805 insertions(+) create mode 100644 docs/MESA_texture_array.spec diff --git a/docs/MESA_texture_array.spec b/docs/MESA_texture_array.spec new file mode 100644 index 00000000000..d3b77521151 --- /dev/null +++ b/docs/MESA_texture_array.spec @@ -0,0 +1,805 @@ +Name + + MESA_texture_array + +Name Strings + + GL_MESA_texture_array + +Contact + + Ian Romanick, IBM (idr 'at' us.ibm.com) + +IP Status + + No known IP issues. + +Status + + Shipping in Mesa 7.1 + +Version + + $Date: 2007/05/16$ $Revision: 0.4$ + +Number + + TBD + +Dependencies + + OpenGL 1.2 or GL_EXT_texture3D is required. + + Support for ARB_fragment_program is assumed, but not required. + + Support for ARB_fragment_program_shadow is assumed, but not required. + + Support for EXT_framebuffer_object is assumed, but not required. + + Written based on the wording of the OpenGL 2.0 specification and + ARB_fragment_program_shadow but not dependent on them. + +Overview + + There are a number of circumstances where an application may wish to + blend two textures out of a larger set of textures. Moreover, in some + cases the selected textures may vary on a per-fragment basis within + a polygon. Several examples include: + + 1. High dynamic range textures. The application stores several + different "exposures" of an image as different textures. On a + per-fragment basis, the application selects which exposures are + used. + + 2. A terrain engine where the altitude of a point determines the + texture applied to it. If the transition is from beach sand to + grass to rocks to snow, the application will store each texture + in a different texture map, and dynamically select which two + textures to blend at run-time. + + 3. Storing short video clips in textures. Each depth slice is a + single frame of video. + + Several solutions to this problem have been proposed, but they either + involve using a separate texture unit for each texture map or using 3D + textures without mipmaps. Both of these options have major drawbacks. + + This extension provides a third alternative that eliminates the major + drawbacks of both previous methods. A new texture target, + TEXTURE_2D_ARRAY, is added that functions identically to TEXTURE_3D in + all aspects except the sizes of the non-base level images. In + traditional 3D texturing, the size of the N+1 LOD is half the size + of the N LOD in all three dimensions. For the TEXTURE_2D_ARRAY target, + the height and width of the N+1 LOD is halved, but the depth is the + same for all levels of detail. The texture then becomes an array of + 2D textures. The per-fragment texel is selected by the R texture + coordinate. + + References: + + http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=get_topic;f=3;t=011557 + http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=get_topic;f=3;t=000516 + http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=get_topic;f=3;t=011903 + http://www.delphi3d.net/articles/viewarticle.php?article=terraintex.htm + +New Procedures and Functions + + All functions come directly from EXT_texture_array. + + void FramebufferTextureLayerEXT(enum target, enum attachment, + uint texture, int level, int layer); + +New Tokens + + All token names and values come directly from EXT_texture_array. + + Accepted by the parameter of Enable, Disable, and IsEnabled, by + the parameter of GetBooleanv, GetIntegerv, GetFloatv, and + GetDoublev, and by the parameter of TexImage3D, GetTexImage, + GetTexLevelParameteriv, GetTexLevelParameterfv, GetTexParameteriv, and + GetTexParameterfv: + + TEXTURE_1D_ARRAY_EXT 0x8C18 + TEXTURE_2D_ARRAY_EXT 0x8C1A + + Accepted by the parameter of TexImage2D, TexSubImage2D, + CopyTexImage2D, CopyTexSubImage2D, CompressedTexImage2D, + CompressedTexSubImage2D, GetTexLevelParameteriv, and + GetTexLevelParameterfv: + + TEXTURE_1D_ARRAY_EXT + PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 + + Accepted by the parameter of TexImage3D, TexSubImage3D, + CopyTexSubImage3D, CompressedTexImage3D, CompressedTexSubImage3D, + GetTexLevelParameteriv, and GetTexLevelParameterfv: + + TEXTURE_2D_ARRAY_EXT + PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B + + Accepted by the parameter of GetBooleanv, GetIntegerv, + GetFloatv, and GetDoublev + + TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C + TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D + MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF + + Accepted by the parameter of TexParameterf, TexParameteri, + TexParameterfv, and TexParameteriv when the parameter is + TEXTURE_COMPARE_MODE_ARB: + + COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E + + (Note: COMPARE_REF_DEPTH_TO_TEXTURE_EXT is simply an alias for the + existing COMPARE_R_TO_TEXTURE token in OpenGL 2.0; the alternate name + reflects the fact that the R coordinate is not always used.) + + Accepted by the parameter of TexImage3D and + CompressedTexImage3D, and by the parameter of + CompressedTexSubImage3D: + + COMPRESSED_RGB_S3TC_DXT1_EXT + COMPRESSED_RGBA_S3TC_DXT1_EXT + COMPRESSED_RGBA_S3TC_DXT3_EXT + COMPRESSED_RGBA_S3TC_DXT5_EXT + + Accepted by the parameter of + GetFramebufferAttachmentParameterivEXT: + + FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 + + (Note: FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER is simply an alias for the + FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT token provided in + EXT_framebuffer_object. This extension generalizes the notion of + "" to include layers of an array texture.) + +Additions to Chapter 2 of the OpenGL 2.0 Specification (OpenGL Operation) + + None + +Additions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization) + + -- Section 3.8.1 "Texture Image Specification" + + Change the first paragraph (page 150) to say (spec changes identical to + EXT_texture_array): + + "The command + + void TexImage3D(enum target, int level, int internalformat, + sizei width, sizei height, sizei depth, int border, + enum format, enum type, void *data); + + is used to specify a three-dimensional texture image. target must be one + one of TEXTURE_3D for a three-dimensional texture or + TEXTURE_2D_ARRAY_EXT for an two-dimensional array texture. + Additionally, target may be either PROXY_TEXTURE_3D for a + three-dimensional proxy texture, or PROXY_TEXTURE_2D_ARRAY_EXT for a + two-dimensional proxy array texture." + + Change the fourth paragraph on page 151 to say (spec changes identical + to EXT_texture_array): + + "Textures with a base internal format of DEPTH_COMPONENT are supported + by texture image specification commands only if target is TEXTURE_1D, + TEXTURE_2D, TEXTURE_1D_ARRAY_EXT, TEXTURE_2D_ARRAY_EXT, + PROXY_TEXTURE_1D, PROXY_TEXTURE_2D, PROXY_TEXTURE_1D_ARRAY_EXT, or + PROXY_TEXTURE_2D_ARRAY_EXT. Using this format in conjunction with any + other target will result in an INVALID_OPERATION error." + + + Change the fourth paragraph on page 156 to say (spec changes identical + to EXT_texture_array): + + "The command + + void TexImage2D(enum target, int level, + int internalformat, sizei width, sizei height, + int border, enum format, enum type, void *data); + + is used to specify a two-dimensional texture image. target must be one + of TEXTURE_2D for a two-dimensional texture, TEXTURE_1D_ARRAY_EXT for a + one-dimensional array texture, or one of TEXTURE_CUBE_MAP_POSITIVE_X, + TEXTURE_CUBE_MAP_NEGATIVE_X, TEXTURE_CUBE_MAP_POSITIVE_Y, + TEXTURE_CUBE_MAP_NEGATIVE_Y, TEXTURE_CUBE_MAP_POSITIVE_Z, or + TEXTURE_CUBE_MAP_NEGATIVE_Z for a cube map texture. Additionally, + target may be either PROXY_TEXTURE_2D for a two-dimensional proxy + texture, PROXY_TEXTURE_1D_ARRAY_EXT for a one-dimensional proxy array + texture, or PROXY TEXTURE_CUBE_MAP for a cube map proxy texture in the + special case discussed in section 3.8.11. The other parameters match + the corresponding parameters of TexImage3D. + + For the purposes of decoding the texture image, TexImage2D is + equivalent to calling TexImage3D with corresponding arguments and depth + of 1, except that + + * The border depth, d_b, is zero, and the depth of the image is + always 1 regardless of the value of border. + + * The border height, h_b, is zero if is + TEXTURE_1D_ARRAY_EXT, and otherwise. + + * Convolution will be performed on the image (possibly changing its + width and height) if SEPARABLE 2D or CONVOLUTION 2D is enabled. + + * UNPACK SKIP IMAGES is ignored." + + -- Section 3.8.2 "Alternate Texture Image Specification Commands" + + Change the second paragraph (page 159) (spec changes identical + to EXT_texture_array): + + "The command + + void CopyTexImage2D(enum target, int level, + enum internalformat, int x, int y, sizei width, + sizei height, int border); + + defines a two-dimensional texture image in exactly the manner of + TexImage2D, except that the image data are taken from the framebuffer + rather than from client memory. Currently, target must be one of + TEXTURE_2D, TEXTURE_1D_ARRAY_EXT, TEXTURE_CUBE_MAP_POSITIVE_X, + TEXTURE_CUBE_MAP_NEGATIVE_X, TEXTURE_CUBE MAP_POSITIVE_Y, + TEXTURE_CUBE_MAP_NEGATIVE_Y, TEXTURE_CUBE_MAP_POSITIVE_Z, or + TEXTURE_CUBE_MAP_NEGATIVE_Z. + + + Change the last paragraph on page 160 to say (spec changes identical + to EXT_texture_array): + + "Currently the target arguments of TexSubImage1D and CopyTexSubImage1D + must be TEXTURE_1D, the target arguments of TexSubImage2D and + CopyTexSubImage2D must be one of TEXTURE_2D, TEXTURE_1D_ARRAY_EXT, + TEXTURE_CUBE_MAP_POSITIVE_X, TEXTURE_CUBE_MAP_NEGATIVE_X, + TEXTURE_CUBE_MAP_POSITIVE_Y, TEXTURE_CUBE_MAP_NEGATIVE_Y, + TEXTURE_CUBE_MAP_POSITIVE_Z, or TEXTURE_CUBE_MAP_NEGATIVE_Z, and the + target arguments of TexSubImage3D and CopyTexSubImage3D must be + TEXTURE_3D or TEXTURE_2D_ARRAY_EXT. ..." + + + -- Section 3.8.4 "Texture Parameters" + + Change the first paragraph (page 166) to say: + + "Various parameters control how the texel array is treated when + specified or changed, and when applied to a fragment. Each parameter is + set by calling + + void TexParameter{if}(enum target, enum pname, T param); + void TexParameter{if}v(enum target, enum pname, T params); + + target is the target, either TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, + TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, or TEXTURE_2D_ARRAY_EXT." + + + -- Section 3.8.8 "Texture Minification" in the section "Scale Factor and Level of Detail" + + Change the first paragraph (page 172) to say: + + "Let s(x,y) be the function that associates an s texture coordinate + with each set of window coordinates (x,y) that lie within a primitive; + define t(x,y) and r(x,y) analogously. Let u(x,y) = w_t * s(x,y), + v(x,y) = h_t * t(x,y), and w(x,y) = d_t * r(x,y), where w_t, h_t, + and d_t are as defined by equations 3.15, 3.16, and 3.17 with + w_s, h_s, and d_s equal to the width, height, and depth of the + image array whose level is level_base. For a one-dimensional + texture or a one-dimensional array texture, define v(x,y) = 0 and + w(x,y) = 0; for a two-dimensional texture or a two-dimensional array + texture, define w(x,y) = 0..." + + -- Section 3.8.8 "Texture Minification" in the section "Mipmapping" + + Change the third paragraph (page 174) to say: + + "For a two-dimensional texture, two-dimensional array texture, or + cube map texture," + + Change the fourth paragraph (page 174) to say: + + "And for a one-dimensional texture or a one-dimensional array texture," + + After the first paragraph (page 175) add: + + "For one-dimensional array textures, h_b and d_b are treated as 1, + regardless of the actual values, when performing mipmap calculations. + For two-dimensional array textures, d_b is always treated as one, + regardless of the actual value, when performing mipmap calculations." + + -- Section 3.8.8 "Automatic Mipmap Generation" in the section "Mipmapping" + + Change the third paragraph (page 176) to say (spec changes identical + to EXT_texture_array): + + "The contents of the derived arrays are computed by repeated, filtered + reduction of the level_base array. For one- and two-dimensional array + textures, each layer is filtered independently. ..." + + -- Section 3.8.8 "Manual Mipmap Generation" in the section "Mipmapping" + + Change first paragraph to say (spec changes identical to + EXT_texture_array): + + "Mipmaps can be generated manually with the command + + void GenerateMipmapEXT(enum target); + + where is one of TEXTURE_1D, TEXTURE_2D, TEXTURE_CUBE_MAP, + TEXTURE_3D, TEXTURE_1D_ARRAY, or TEXTURE_2D_ARRAY. Mipmap generation + affects the texture image attached to . ..." + + -- Section 3.8.10 "Texture Completeness" + + Change the second paragaph (page 177) to say (spec changes identical + to EXT_texture_array): + + "For one-, two-, or three-dimensional textures and one- or + two-dimensional array textures, a texture is complete if the following + conditions all hold true:" + + -- Section 3.8.11 "Texture State and Proxy State" + + Change the second and third paragraphs (page 179) to say (spec changes + identical to EXT_texture_array): + + "In addition to image arrays for one-, two-, and three-dimensional + textures, one- and two-dimensional array textures, and the six image + arrays for the cube map texture, partially instantiated image arrays + are maintained for one-, two-, and three-dimensional textures and one- + and two-dimensional array textures. Additionally, a single proxy image + array is maintained for the cube map texture. Each proxy image array + includes width, height, depth, border width, and internal format state + values, as well as state for the red, green, blue, alpha, luminance, + and intensity component resolutions. Proxy image arrays do not include + image data, nor do they include texture properties. When TexImage3D is + executed with target specified as PROXY_TEXTURE_3D, the + three-dimensional proxy state values of the specified level-of-detail + are recomputed and updated. If the image array would not be supported + by TexImage3D called with target set to TEXTURE 3D, no error is + generated, but the proxy width, height, depth, border width, and + component resolutions are set to zero. If the image array would be + supported by such a call to TexImage3D, the proxy state values are set + exactly as though the actual image array were being specified. No pixel + data are transferred or processed in either case. + + Proxy arrays for one- and two-dimensional textures and one- and + two-dimensional array textures are operated on in the same way when + TexImage1D is executed with target specified as PROXY_TEXTURE_1D, + TexImage2D is executed with target specified as PROXY_TEXTURE_2D or + PROXY_TEXTURE_1D_ARRAY_EXT, or TexImage3D is executed with target + specified as PROXY_TETXURE_2D_ARRAY_EXT." + + -- Section 3.8.12 "Texture Objects" + + Change section (page 180) to say (spec changes identical to + EXT_texture_array): + + "In addition to the default textures TEXTURE_1D, TEXTURE_2D, + TEXTURE_3D, TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, and TEXTURE_2D_EXT, + named one-, two-, and three-dimensional, cube map, and one- and + two-dimensional array texture objects can be created and operated upon. + The name space for texture objects is the unsigned integers, with zero + reserved by the GL. + + A texture object is created by binding an unused name to TEXTURE_1D, + TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, or + TEXTURE_2D_ARRAY_EXT. The binding is effected by calling + + void BindTexture(enum target, uint texture); + + with set to the desired texture target and set to + the unused name. The resulting texture object is a new state vector, + comprising all the state values listed in section 3.8.11, set to the + same initial values. If the new texture object is bound to TEXTURE_1D, + TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, or + TEXTURE_2D_ARRAY_EXT, it is and remains a one-, two-, + three-dimensional, cube map, one- or two-dimensional array texture + respectively until it is deleted. + + BindTexture may also be used to bind an existing texture object to + either TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, + TEXTURE_1D_ARRAY_EXT, or TEXTURE_2D_ARRAY_EXT. The error + INVALID_OPERATION is generated if an attempt is made to bind a texture + object of different dimensionality than the specified target. If the + bind is successful no change is made to the state of the bound texture + object, and any previous binding to target is broken. + + While a texture object is bound, GL operations on the target to which + it is bound affect the bound object, and queries of the target to which + it is bound return state from the bound object. If texture mapping of + the dimensionality of the target to which a texture object is bound is + enabled, the state of the bound texture object directs the texturing + operation. + + In the initial state, TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, + TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, and TEXTURE_2D_ARRAY_EXT have + one-, two-, three-dimensional, cube map, and one- and two-dimensional + array texture state vectors respectively associated with them. In order + that access to these initial textures not be lost, they are treated as + texture objects all of whose names are 0. The initial one-, two-, + three-dimensional, cube map, one- and two-dimensional array textures + are therefore operated upon, queried, and applied as TEXTURE_1D, + TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, and + TEXTURE_2D_ARRAY_EXT respectively while 0 is bound to the corresponding + targets. + + Change second paragraph on page 181 to say (spec changes identical to + EXT_texture_array): + + "... If a texture that is currently bound to one of the targets + TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, + TEXTURE_1D_ARRAY_EXT, or TEXTURE_2D_ARRAY_EXT is deleted, it is as + though BindTexture had been executed with the same target and texture + zero. ..." + + Change second paragraph on page 182 to say (spec changes identical to + EXT_texture_array): + + "The texture object name space, including the initial one-, two-, and + three dimensional, cube map, and one- and two-dimensional array texture + objects, is shared among all texture units. ..." + + + -- Section 3.8.14 "Depth Texture Comparison Modes" in "Texture Comparison Modes" + + Change second through fourth paragraphs (page 188) to say: + + "Let D_t be the depth texture value, in the range [0, 1]. For + texture lookups from one- and two-dimesional, rectangle, and + one-dimensional array targets, let R be the interpolated + texture coordinate, clamped to the range [0, 1]. For texture lookups + from two-dimesional array texture targets, let R be the interpolated + texture coordinate, clamped to the range [0, 1]. Then the + effective texture value L_t, I_t, or A_t is computed as follows: + + If the value of TEXTURE_COMPARE_MODE is NONE, then + + r = Dt + + If the value of TEXTURE_COMPARE_MODE is + COMPARE_REF_DEPTH_TO_TEXTURE_EXT), then r depends on the texture + comparison function as shown in table 3.27." + + -- Section 3.8.15 "Texture Application" + + Change the first paragraph (page 189) to say: + + "Texturing is enabled or disabled using the generic Enable and Disable + commands, respectively, with the symbolic constants TEXTURE_1D, + TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, or + TEXTURE_2D_ARRAY_EXT to enable one-, two-, three-dimensional, cube + map, one-dimensional array, or two-dimensional array texture, + respectively. If both two- and one-dimensional textures are enabled, + the two-dimensional texture is used. If the three-dimensional and + either of the two- or one-dimensional textures is enabled, the + three-dimensional texture is used. If the cube map texture and any of + the three-, two-, or one-dimensional textures is enabled, then cube map + texturing is used. If one-dimensional array texture is enabled and any + of cube map, three-, two-, or one-dimensional textures is enabled, + one-dimensional array texturing is used. If two-dimensional array + texture is enabled and any of cube map, three-, two-, one-dimensional + textures or one-dimensional array texture is enabled, two-dimensional + array texturing is used..." + + -- Section 3.11.2 of ARB_fragment_program (Fragment Program Grammar and Restrictions): + + (mostly add to existing grammar rules) + + ::= "MESA_texture_array" + + ::= "1D" + | "2D" + | "3D" + | "CUBE" + | "RECT" + | (if program option is present) + | (if program option is present) + + ::= "ARRAY1D" + | "ARRAY2D" + + ::= "SHADOW1D" + | "SHADOW2D" + | "SHADOWRECT" + | (if program option is present) + + ::= "SHADOWARRAY1D" + | "SHADOWARRAY2D" + + + -- Add Section 3.11.4.5.4 "Texture Stack Option" + + "If a fragment program specifies the "MESA_texture_array" program + option, the rule is modified to add the texture targets + ARRAY1D and ARRAY2D (See Section 3.11.2)." + + -- Section 3.11.6 "Fragment Program Texture Instruction Set" + + (replace 1st and 2nd paragraphs with the following paragraphs) + + "The first three texture instructions described below specify the + mapping of 4-tuple input vectors to 4-tuple output vectors. + The sampling of the texture works as described in section 3.8, + except that texture environments and texture functions are not + applicable, and the texture enables hierarchy is replaced by explicit + references to the desired texture target (i.e., 1D, 2D, 3D, cube map, + rectangle, ARRAY1D, ARRAY2D). These texture instructions specify + how the 4-tuple is mapped into the coordinates used for sampling. The + following function is used to describe the texture sampling in the + descriptions below: + + vec4 TextureSample(vec4 coord, float lodBias, int texImageUnit, + enum texTarget); + + Note that not all four components of the texture coordinates + are used by all texture targets. Component usage for each + is defined in table X. + + coordinates used + texTarget Texture Type s t r layer shadow + ---------------- --------------------- ----- ----- ------ + 1D TEXTURE_1D x - - - - + 2D TEXTURE_2D x y - - - + 3D TEXTURE_3D x y z - - + CUBE TEXTURE_CUBE_MAP x y z - - + RECT TEXTURE_RECTANGLE_ARB x y - - - + ARRAY1D TEXTURE_1D_ARRAY_EXT x - - y - + ARRAY2D TEXTURE_2D_ARRAY_EXT x y - z - + SHADOW1D TEXTURE_1D x - - - z + SHADOW2D TEXTURE_2D x y - - z + SHADOWRECT TEXTURE_RECTANGLE_ARB x y - - z + SHADOWARRAY1D TEXTURE_1D_ARRAY_EXT x - - y z + SHADOWARRAY2D TEXTURE_2D_ARRAY_EXT x y - z w + + Table X: Texture types accessed for each of the , and + coordinate mappings. The "coordinates used" column indicate the + input values used for each coordinate of the texture lookup, the + layer selector for array textures, and the reference value for + texture comparisons." + + -- Section 3.11.6.2 "TXP: Project coordinate and map to color" + + Add to the end of the section: + + "A program will fail to load if the TXP instruction is used in + conjunction with the SHADOWARRAY2D target." + +Additions to Chapter 4 of the OpenGL 2.0 Specification (Per-Fragment Operations) + + -- Section 4.4.2.3 "Attaching Texture Images to a Framebuffer" + + Add to the end of the section (spec changes identical to + EXT_texture_array): + + "The command + + void FramebufferTextureLayerEXT(enum target, enum attachment, + uint texture, int level, int layer); + + operates identically to FramebufferTexture3DEXT, except that it + attaches a single layer of a three-dimensional texture or a one- or + two-dimensional array texture. is an integer indicating the + layer number, and is treated identically to the parameter in + FramebufferTexture3DEXT. The error INVALID_VALUE is generated if + is negative. The error INVALID_OPERATION is generated if + is non-zero and is not the name of a three dimensional + texture or one- or two-dimensional array texture. Unlike + FramebufferTexture3D, no parameter is accepted. + + If is non-zero and the command does not result in an error, + the framebuffer attachment state corresponding to is + updated as in the other FramebufferTexture commands, except that + FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT is set to ." + + -- Section 4.4.4.1 "Framebuffer Attachment Completeness" + + Add to the end of the list of completeness rules (spec changes + identical to EXT_texture_array): + + "* If FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT is TEXTURE and + FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT names a one- or + two-dimensional array texture, then + FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT must be smaller than the + number of layers in the texture." + +Additions to Chapter 5 of the OpenGL 2.0 Specification (Special Functions) + + -- Section 5.4 "Display Lists" + + Change the first paragraphi on page 242 to say (spec changes + identical to EXT_texture_array): + + "TexImage3D, TexImage2D, TexImage1D, Histogram, and ColorTable are + executed immediately when called with the corresponding proxy arguments + PROXY_TEXTURE_3D or PROXY_TEXTURE_2D_ARRAY_EXT; PROXY_TEXTURE_2D, + PROXY_TEXTURE_CUBE_MAP, or PROXY_TEXTURE_1D_ARRAY_EXT; + PROXY_TEXTURE_1D; PROXY_HISTOGRAM; and PROXY_COLOR_TABLE, + PROXY_POST_CONVOLUTION_COLOR_TABLE, or + PROXY_POST_COLOR_MATRIX_COLOR_TABLE." + +Additions to Chapter 6 of the OpenGL 2.0 Specification (State and State Requests) + + -- Section 6.1.3 "Enumerated Queries" + + Add after the line beginning "If the value of + FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT is TEXTURE" (spec changes + identical to EXT_texture_array): + + "If is FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT and the + texture object named FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT is a + three-dimensional texture or a one- or two-dimensional array texture, + then will contain the number of texture layer attached to the + attachment point. Otherwise, will contain the value zero." + + -- Section 6.1.4 "Texture Queries" + + Change the first three paragraphs (page 248) to say (spec changes + identical to EXT_texture_array): + + "The command + + void GetTexImage(enum tex, int lod, enum format, + enum type, void *img); + + is used to obtain texture images. It is somewhat different from the + other get commands; tex is a symbolic value indicating which texture + (or texture face in the case of a cube map texture target name) is to + be obtained. TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_1D_ARRAY_EXT, + and TEXTURE_2D_ARRAY_EXT indicate a one-, two-, or three-dimensional + texture, or one- or two-dimensional array texture, respectively. + TEXTURE_CUBE_MAP_POSITIVE_X, ... + + GetTexImage obtains... from the first image to the last for + three-dimensional textures. One- and two-dimensional array textures + are treated as two- and three-dimensional images, respectively, where + the layers are treated as rows or images. These groups are then... + + For three-dimensional and two-dimensional array textures, pixel storage + operations are applied as if the image were two-dimensional, except + that the additional pixel storage state values PACK_IMAGE_HEIGHT and + PACK_SKIP_IMAGES are applied. ..." + +Additions to Appendix A of the OpenGL 2.0 Specification (Invariance) + + None + +Additions to the AGL/GLX/WGL Specifications + + None + +GLX Protocol + + None + +Dependencies on ARB_fragment_program + + If ARB_fragment_program is not supported, the changes to section 3.11 + should be ignored. + +Dependencies on EXT_framebuffer_object + + If EXT_framebuffer_object is not supported, the changes to section + 3.8.8 ("Manual Mipmap Generation"), 4.4.2.3, and 6.1.3 should be ignored. + +Dependencies on EXT_texture_compression_s3tc and NV_texture_compression_vtc + + (Identical dependency as EXT_texture_array.) + + S3TC texture compression is supported for two-dimensional array textures. + When is TEXTURE_2D_ARRAY_EXT, each layer is stored independently + as a compressed two-dimensional textures. When specifying or querying + compressed images using one of the S3TC formats, the images are provided + and/or returned as a series of two-dimensional textures stored + consecutively in memory, with the layer closest to zero specified first. + For array textures, images are not arranged in 4x4x4 or 4x4x2 blocks as in + the three-dimensional compression format provided in the + EXT_texture_compression_vtc extension. Pixel store parameters, including + those specific to three-dimensional images, are ignored when compressed + image data are provided or returned, as in the + EXT_texture_compression_s3tc extension. + + S3TC compression is not supported for one-dimensional texture targets in + EXT_texture_compression_s3tc, and is not supported for one-dimensional + array textures in this extension. If compressed one-dimensional arrays + are needed, use a two-dimensional texture with a height of one. + + This extension allows the use of the four S3TC internal format types in + TexImage3D, CompressedTexImage3D, and CompressedTexSubImage3D calls. + +Errors + + None + +New State + + (add to table 6.15, p. 276) + + Initial + Get Value Type Get Command Value Description Sec. Attribute + ---------------------------- ----- ----------- ----- -------------------- ------ --------- + TEXTURE_BINDING_1D_ARRAY_EXT 2*xZ+ GetIntegerv 0 texture object bound 3.8.12 texture + to TEXTURE_1D_ARRAY + TEXTURE_BINDING_2D_ARRAY_EXT 2*xZ+ GetIntegerv 0 texture object bound 3.8.12 texture + to TEXTURE_2D_ARRAY + + +New Implementation Dependent State + + (add to Table 6.32, p. 293) + + Minimum + Get Value Type Get Command Value Description Sec. Attribute + ---------------------------- ---- ----------- ------- ------------------ ----- --------- + MAX_TEXTURE_ARRAY_LAYERS_EXT Z+ GetIntegerv 64 maximum number of 3.8.1 - + layers for texture + arrays + +Issues + + (1) Is "texture stack" a good name for this functionality? + + NO. The name is changed to "array texture" to match the + nomenclature used by GL_EXT_texture_array. + + (2) Should the R texture coordinate be treated as normalized or + un-normalized? If it were un-normalized, floor(R) could be thought + of as a direct index into the array texture. This may be more + convenient for applications. + + RESOLVED. All texture coordinates are normalized. The issue of + un-normalized texture coordinates has been discussed in the ARB + before and should be left for a layered extension. + + RE-RESOLVED. The R coordinate is un-normalized. Accessing an array + using [0, layers-1] coordinates is much more natural. + + (3) How does LOD selection work for stacked textures? + + RESOLVED. For 2D array textures the R coordinate is ignored, and + the LOD selection equations for 2D textures are used. For 1D + array textures the T coordinate is ignored, and the LOD selection + equations for 1D textures are used. The expected usage is in a + fragment program with an explicit LOD selection. + + (4) What is the maximum size of a 2D array texture? Is it the same + as for a 3D texture, or should a new query be added? How about for 1D + array textures? + + RESOLVED. A new query is added. + + (5) How are array textures exposed in GLSL? + + RESOLVED. Use GL_EXT_texture_array. + + (6) Should a 1D array texture also be exposed? + + RESOLVED. For orthogonality, yes. + + (7) How are stacked textures attached to framebuffer objects? + + RESOLVED. Layers of both one- and two-dimensional array textures + are attached using FreambufferTextureLayerEXT. Once attached, the + array texture layer behaves exactly as either a one- or + two-dimensional texture. + + (8) How is this extension related to GL_EXT_texture_array? + + This extension adapats GL_MESAX_texture_stack to the notation, + indexing, and FBO access of GL_EXT_texture_array. This extension + replaces the GLSL support of GL_EXT_texture_array with + GL_ARB_fragment_program support. + + Assembly program support is also provided by GL_NV_gpu_program4. + GL_NV_gpu_program4 also adds support for other features that are + specific to Nvidia hardware, while this extension adds only support + for array textures. + + Much of text of this extension that has changed since + GL_MESAX_texture_stack comes directly from either + GL_EXT_texture_array or GL_NV_gpu_program4. + +Revision History + + ||2005/11/15||0.1||idr||Initial draft MESAX version.|| + ||2005/12/07||0.2||idr||Added framebuffer object interactions.|| + ||2005/12/12||0.3||idr||Updated fragment program interactions.|| + ||2007/05/16||0.4||idr||Converted to MESA_texture_array. Brought in line with EXT_texture_array and NV_gpu_program4.|| -- 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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 7fcf231c57b3f24bc5b4bedc345f43ac6c00cf84 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 17 May 2007 15:25:26 -0600 Subject: In DestroyPbuffer(), use GetReq() intead of GetReqExtra(). See bug 10983. --- src/glx/x11/glx_pbuffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glx/x11/glx_pbuffer.c b/src/glx/x11/glx_pbuffer.c index 472045e93d8..d13830e4e49 100644 --- a/src/glx/x11/glx_pbuffer.c +++ b/src/glx/x11/glx_pbuffer.c @@ -150,7 +150,7 @@ DestroyPbuffer( Display * dpy, GLXDrawable drawable ) if ( (priv->majorVersion > 1) || (priv->minorVersion >= 3) ) { xGLXDestroyPbufferReq * req; - GetReqExtra( GLXDestroyPbuffer, 4, req ); + GetReq( GLXDestroyPbuffer, req ); req->reqType = opcode; req->glxCode = X_GLXDestroyPbuffer; req->pbuffer = (GLXPbuffer) drawable; -- cgit v1.2.3 From 57ca033885b0474fff02903d13d6ad6333dc4810 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 17 May 2007 15:28:20 -0600 Subject: get rid of needless static function declarations at top of file --- src/glx/x11/glx_pbuffer.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/glx/x11/glx_pbuffer.c b/src/glx/x11/glx_pbuffer.c index d13830e4e49..1df2d0f342a 100644 --- a/src/glx/x11/glx_pbuffer.c +++ b/src/glx/x11/glx_pbuffer.c @@ -40,18 +40,6 @@ #include "glcontextmodes.h" #include "glheader.h" -static void ChangeDrawableAttribute( Display * dpy, GLXDrawable drawable, - const CARD32 * attribs, size_t num_attribs ); - -static void DestroyPbuffer( Display * dpy, GLXDrawable drawable ); - -static GLXDrawable CreatePbuffer( Display *dpy, - const __GLcontextModes * fbconfig, unsigned int width, unsigned int height, - const int *attrib_list, GLboolean size_in_attribs ); - -static int GetDrawableAttribute( Display *dpy, GLXDrawable drawable, - int attribute, unsigned int *value ); - /** * Change a drawable's attribute. -- 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(-) 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(-) 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(-) 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(-) 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