docs/relnotes-7.6.1.html | 1 progs/demos/projtex.c | 1 progs/samples/rgbtoppm.c | 7 ++++- progs/tests/Makefile | 7 +++++ progs/tests/prog_parameter.c | 5 +++ progs/util/readtex.c | 7 ++++- src/gallium/auxiliary/draw/draw_pt.c | 3 +- src/gallium/auxiliary/rbug/rbug_connection.c | 1 src/gallium/drivers/i915simple/i915_debug.c | 1 src/gallium/drivers/i915simple/i915_screen.c | 1 src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c | 6 ++-- src/gallium/state_trackers/egl/egl_tracker.c | 2 - src/glx/x11/drisw_glx.c | 4 ++ src/mesa/drivers/dri/common/dri_util.c | 11 ++++---- src/mesa/drivers/dri/i915/i915_debug.c | 1 src/mesa/drivers/dri/r600/r700_assembler.c | 26 ++++++------------ src/mesa/drivers/dri/r600/r700_chip.c | 8 ++++- src/mesa/main/fog.c | 11 +++++--- src/mesa/main/light.c | 20 +++++++++++--- src/mesa/main/points.c | 11 +++++--- src/mesa/main/texgen.c | 6 ++-- src/mesa/main/texobj.c | 2 - src/mesa/main/texparam.c | 25 +++++++++++++----- src/mesa/main/version.h | 2 - src/mesa/shader/nvfragparse.c | 8 +++++ src/mesa/shader/prog_parameter.c | 2 - src/mesa/shader/program.c | 14 ++++++++-- src/mesa/shader/programopt.c | 14 +++------- src/mesa/shader/slang/slang_compile_operation.h | 1 src/mesa/shader/slang/slang_simplify.c | 9 +++--- src/mesa/sparc/xform.S | 2 - src/mesa/vbo/vbo_exec_eval.c | 33 +++++++++++++++--------- 32 files changed, 167 insertions(+), 85 deletions(-)
New commits: commit 7d41b4248bee1d926646ef5fdff07da4f9026589 Author: Brian Paul <bri...@vmware.com> Date: Fri Dec 11 09:41:34 2009 -0700 docs: updated 7.6.1 relnotes with GLSL fixes diff --git a/docs/relnotes-7.6.1.html b/docs/relnotes-7.6.1.html index 752f9ca..7160168 100644 --- a/docs/relnotes-7.6.1.html +++ b/docs/relnotes-7.6.1.html @@ -58,6 +58,7 @@ tbd <li>Endianness fixes for the DRI swrast driver (bug 22767).</li> <li>Point sprite fixes for i915/945 driver. <li>Fixed assorted memory leaks (usually on error paths) +<li>Fixed some GLSL compiler bugs (ex: 25579) </ul> <h2>Changes</h2> commit d8f8eca9efaf2f537cf9218e4dd1d742e19ffc76 Author: Brian Paul <bri...@vmware.com> Date: Fri Dec 11 09:40:33 2009 -0700 mesa: remove unnecessary loop in _mesa_remove_output_reads() diff --git a/src/mesa/shader/programopt.c b/src/mesa/shader/programopt.c index f70c75c..c5b821d 100644 --- a/src/mesa/shader/programopt.c +++ b/src/mesa/shader/programopt.c @@ -528,15 +528,11 @@ _mesa_remove_output_reads(struct gl_program *prog, gl_register_file type) /* look for instructions which write to the varying vars identified above */ for (i = 0; i < prog->NumInstructions; i++) { struct prog_instruction *inst = prog->Instructions + i; - const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode); - GLuint j; - for (j = 0; j < numSrc; j++) { - if (inst->DstReg.File == type && - outputMap[inst->DstReg.Index] >= 0) { - /* change inst to write to the temp reg, instead of the varying */ - inst->DstReg.File = PROGRAM_TEMPORARY; - inst->DstReg.Index = outputMap[inst->DstReg.Index]; - } + if (inst->DstReg.File == type && + outputMap[inst->DstReg.Index] >= 0) { + /* change inst to write to the temp reg, instead of the varying */ + inst->DstReg.File = PROGRAM_TEMPORARY; + inst->DstReg.Index = outputMap[inst->DstReg.Index]; } } commit 5076a4f53a2f34cc9116b45951037f639885c7a1 Author: Brian Paul <bri...@vmware.com> Date: Fri Dec 11 09:16:25 2009 -0700 mesa: check dst reg in _mesa_find_free_register() If a register was only being used as a destination (as will happen when generated condition-codes) we missed its use. So we'd errantly return a register index that was really in-use, not free. Fixes bug 25579. diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 2cd6eb8..18d4ef9 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -813,9 +813,17 @@ _mesa_find_free_register(const struct gl_program *prog, GLuint regFile) const struct prog_instruction *inst = prog->Instructions + i; const GLuint n = _mesa_num_inst_src_regs(inst->Opcode); - for (k = 0; k < n; k++) { - if (inst->SrcReg[k].File == regFile) { - used[inst->SrcReg[k].Index] = GL_TRUE; + /* check dst reg first */ + if (inst->DstReg.File == regFile) { + used[inst->DstReg.Index] = GL_TRUE; + } + else { + /* check src regs otherwise */ + for (k = 0; k < n; k++) { + if (inst->SrcReg[k].File == regFile) { + used[inst->SrcReg[k].Index] = GL_TRUE; + break; + } } } } commit f7f1211b9b0a8fa0e5f5427b74b4eee4dabf65af Author: Aurelien Jarno <aure...@debian.org> Date: Fri Dec 11 08:46:54 2009 -0700 sparc: additional preprocessor test for SPARC 64-bit diff --git a/src/mesa/sparc/xform.S b/src/mesa/sparc/xform.S index f2b9674..2a7cce4 100644 --- a/src/mesa/sparc/xform.S +++ b/src/mesa/sparc/xform.S @@ -17,7 +17,7 @@ #include "sparc_matrix.h" -#if defined(SVR4) || defined(__SVR4) || defined(__svr4__) +#if defined(SVR4) || defined(__SVR4) || defined(__svr4__) || defined(__arch64__) /* Solaris requires this for 64-bit. */ .register %g2, #scratch .register %g3, #scratch commit 94fba49be97008565c0225bc46894bfd9453bb5e Author: Vinson Lee <v...@vmware.com> Date: Thu Dec 10 18:51:51 2009 -0800 mesa: Initialize variable in MatchInstruction. diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 0fd5552..b739a6a 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -217,6 +217,12 @@ MatchInstruction(const GLubyte *token) const struct instruction_pattern *inst; struct instruction_pattern result; + result.name = NULL; + result.opcode = MAX_OPCODE; /* i.e. invalid instruction */ + result.inputs = 0; + result.outputs = 0; + result.suffixes = 0; + for (inst = Instructions; inst->name; inst++) { if (_mesa_strncmp((const char *) token, inst->name, 3) == 0) { /* matched! */ @@ -247,7 +253,7 @@ MatchInstruction(const GLubyte *token) return result; } } - result.opcode = MAX_OPCODE; /* i.e. invalid instruction */ + return result; } commit e31df54754e2305b7cc7072053bf5a4e0b477fd6 Author: Vinson Lee <v...@vmware.com> Date: Thu Dec 10 18:32:33 2009 -0800 mesa: Assign _mesa_lookup_parameter_index return value to GLint. diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index 2f029b0..f22492e 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -500,7 +500,7 @@ GLfloat * _mesa_lookup_parameter_value(const struct gl_program_parameter_list *paramList, GLsizei nameLen, const char *name) { - GLuint i = _mesa_lookup_parameter_index(paramList, nameLen, name); + GLint i = _mesa_lookup_parameter_index(paramList, nameLen, name); if (i < 0) return NULL; else commit cb1dcb55f9884431a5e2b90e9208b42558a95611 Author: Vinson Lee <v...@vmware.com> Date: Thu Dec 10 18:21:59 2009 -0800 i915: Add missing break statement in i915_debug_packet. diff --git a/src/mesa/drivers/dri/i915/i915_debug.c b/src/mesa/drivers/dri/i915/i915_debug.c index f7bb7ea..fecfac3 100644 --- a/src/mesa/drivers/dri/i915/i915_debug.c +++ b/src/mesa/drivers/dri/i915/i915_debug.c @@ -806,6 +806,7 @@ static GLboolean i915_debug_packet( struct debug_stream *stream ) default: return debug(stream, "", 0); } + break; default: assert(0); return 0; commit d38ffed5236adf3ee83c0bc5bdee0233ce566e01 Author: Vinson Lee <v...@vmware.com> Date: Thu Dec 10 17:50:35 2009 -0800 glsl: Increase size of array in_slang_lookup_constant from 4 to 16. For some cases, _mesa_GetIntegerv reads up to params[15]. diff --git a/src/mesa/shader/slang/slang_simplify.c b/src/mesa/shader/slang/slang_simplify.c index 539c6ff..13b9ca3 100644 --- a/src/mesa/shader/slang/slang_simplify.c +++ b/src/mesa/shader/slang/slang_simplify.c @@ -84,7 +84,7 @@ _slang_lookup_constant(const char *name) for (i = 0; info[i].Name; i++) { if (strcmp(info[i].Name, name) == 0) { /* found */ - GLint values[4]; + GLint values[16]; values[0] = -1; _mesa_GetIntegerv(info[i].Token, values); ASSERT(values[0] >= 0); /* sanity check that glGetFloatv worked */ commit 1cf60c981091d7a46cb404fd607f85553c427761 Author: Vinson Lee <v...@vmware.com> Date: Thu Dec 10 15:41:13 2009 -0800 progs/samples: Byte swap individual members of struct _rawImageRec. diff --git a/progs/samples/rgbtoppm.c b/progs/samples/rgbtoppm.c index 56ca5b0..dcb7422 100644 --- a/progs/samples/rgbtoppm.c +++ b/progs/samples/rgbtoppm.c @@ -93,7 +93,12 @@ static ImageRec *ImageOpen(char *fileName) fread(image, 1, 12, image->file); if (swapFlag) { - ConvertShort(&image->imagic, 6); + ConvertShort(&image->imagic, 1); + ConvertShort(&image->type, 1); + ConvertShort(&image->dim, 1); + ConvertShort(&image->xsize, 1); + ConvertShort(&image->ysize, 1); + ConvertShort(&image->zsize, 1); } image->tmp = (unsigned char *)malloc(image->xsize*256); commit bc0509bba8cc962a4ee2dafd684e153b3060262d Author: Vinson Lee <v...@vmware.com> Date: Thu Dec 10 13:24:15 2009 -0800 progs/util: Byte swap individual members of struct _rawImageRec. diff --git a/progs/util/readtex.c b/progs/util/readtex.c index 81cb626..d1c50a4 100644 --- a/progs/util/readtex.c +++ b/progs/util/readtex.c @@ -117,7 +117,12 @@ static rawImageRec *RawImageOpen(const char *fileName) fread(raw, 1, 12, raw->file); if (swapFlag) { - ConvertShort(&raw->imagic, 6); + ConvertShort(&raw->imagic, 1); + ConvertShort(&raw->type, 1); + ConvertShort(&raw->dim, 1); + ConvertShort(&raw->sizeX, 1); + ConvertShort(&raw->sizeY, 1); + ConvertShort(&raw->sizeZ, 1); } raw->tmp = (unsigned char *)malloc(raw->sizeX*256); commit 51f52edaf186a927a2c8c29ba9dba56d18928a7e Author: Vinson Lee <v...@vmware.com> Date: Thu Dec 10 12:37:10 2009 -0800 glsl: Fix array out-of-bounds access by _slang_lookup_constant. diff --git a/src/mesa/shader/slang/slang_simplify.c b/src/mesa/shader/slang/slang_simplify.c index b8a21f6..539c6ff 100644 --- a/src/mesa/shader/slang/slang_simplify.c +++ b/src/mesa/shader/slang/slang_simplify.c @@ -84,10 +84,11 @@ _slang_lookup_constant(const char *name) for (i = 0; info[i].Name; i++) { if (strcmp(info[i].Name, name) == 0) { /* found */ - GLint value = -1; - _mesa_GetIntegerv(info[i].Token, &value); - ASSERT(value >= 0); /* sanity check that glGetFloatv worked */ - return value; + GLint values[4]; + values[0] = -1; + _mesa_GetIntegerv(info[i].Token, values); + ASSERT(values[0] >= 0); /* sanity check that glGetFloatv worked */ + return values[0]; } } return -1; commit dcb4a37fc89924192d923ed6906d2922371b8cb1 Author: Vinson Lee <v...@vmware.com> Date: Thu Dec 10 12:11:09 2009 -0800 mesa: Fix array out-of-bounds access by _mesa_TexParameteriv. diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 1cec4b8..0f83d22 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -700,8 +700,10 @@ _mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params) case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: { /* convert int param to float */ - GLfloat fparam = (GLfloat) params[0]; - need_update = set_tex_parameterf(ctx, texObj, pname, &fparam); + GLfloat fparams[4]; + fparams[0] = (GLfloat) params[0]; + fparams[1] = fparams[2] = fparams[3] = 0.0F; + need_update = set_tex_parameterf(ctx, texObj, pname, fparams); } break; default: commit b82757880545f8bce471ba8f13c16998888cd4b5 Author: Vinson Lee <v...@vmware.com> Date: Wed Dec 9 17:59:23 2009 -0800 mesa: Fix array out-of-bounds access by _mesa_TexGend. _mesa_TexGend calls _mesa_TexGenfv, which uses the params argument as an array. diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c index d3ea7b9..f9d3821 100644 --- a/src/mesa/main/texgen.c +++ b/src/mesa/main/texgen.c @@ -181,8 +181,10 @@ _mesa_TexGeniv(GLenum coord, GLenum pname, const GLint *params ) void GLAPIENTRY _mesa_TexGend(GLenum coord, GLenum pname, GLdouble param ) { - GLfloat p = (GLfloat) param; - _mesa_TexGenfv( coord, pname, &p ); + GLfloat p[4]; + p[0] = (GLfloat) param; + p[1] = p[2] = p[3] = 0.0F; + _mesa_TexGenfv( coord, pname, p ); } commit 444d1f39108ab4419843f19f76c968cef3398bab Author: Vinson Lee <v...@vmware.com> Date: Wed Dec 9 17:34:50 2009 -0800 mesa: Fix array out-of-bounds access by _mesa_Lighti. _mesa_Lighti calls _mesa_Lightiv, which uses the params argument as an array. diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index d4f3bb9..5150926 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -288,7 +288,10 @@ _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params ) void GLAPIENTRY _mesa_Lighti( GLenum light, GLenum pname, GLint param ) { - _mesa_Lightiv( light, pname, ¶m ); + GLint iparam[4]; + iparam[0] = param; + iparam[1] = iparam[2] = iparam[3] = 0; + _mesa_Lightiv( light, pname, iparam ); } commit 34528a34c446afea4442f479713e7f926220f128 Author: Vinson Lee <v...@vmware.com> Date: Wed Dec 9 17:11:30 2009 -0800 mesa: Fix array out-of-bounds access by _mesa_Lightf. diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index c1d47de..d4f3bb9 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -206,7 +206,10 @@ _mesa_light(GLcontext *ctx, GLuint lnum, GLenum pname, const GLfloat *params) void GLAPIENTRY _mesa_Lightf( GLenum light, GLenum pname, GLfloat param ) { - _mesa_Lightfv( light, pname, ¶m ); + GLfloat fparam[4]; + fparam[0] = param; + fparam[1] = fparam[2] = fparam[3] = 0.0F; + _mesa_Lightfv( light, pname, fparam ); } commit 348883076bd213ec733a1ba2a4768788e4669c97 Author: Vinson Lee <v...@vmware.com> Date: Wed Dec 9 13:15:05 2009 -0800 mesa: Fix array out-of-bounds access by _mesa_PointParameteri. _mesa_PointParameteri calls _mesa_PointParameterfv, which uses the params argument as an array. diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c index 9ec21c9..dcaeccd 100644 --- a/src/mesa/main/points.c +++ b/src/mesa/main/points.c @@ -69,8 +69,10 @@ _mesa_PointSize( GLfloat size ) void GLAPIENTRY _mesa_PointParameteri( GLenum pname, GLint param ) { - const GLfloat value = (GLfloat) param; - _mesa_PointParameterfv(pname, &value); + GLfloat p[3]; + p[0] = (GLfloat) param; + p[1] = p[2] = 0.0F; + _mesa_PointParameterfv(pname, p); } commit 6f2d51b81ff907af9727e90153a46e79e246fc66 Author: Vinson Lee <v...@vmware.com> Date: Wed Dec 9 13:00:22 2009 -0800 mesa: Fix array out-of-bounds access by _mesa_PointParameterf. _mesa_PointParameterf calls _mesa_PointParameterfv, which uses the params argument as an array. diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c index b330544..9ec21c9 100644 --- a/src/mesa/main/points.c +++ b/src/mesa/main/points.c @@ -90,7 +90,10 @@ _mesa_PointParameteriv( GLenum pname, const GLint *params ) void GLAPIENTRY _mesa_PointParameterf( GLenum pname, GLfloat param) { - _mesa_PointParameterfv(pname, ¶m); + GLfloat p[3]; + p[0] = param; + p[1] = p[2] = 0.0F; + _mesa_PointParameterfv(pname, p); } commit 637970aefdcdd1ee50e3759de384b82e6109a45c Author: Vinson Lee <v...@vmware.com> Date: Wed Dec 9 12:43:28 2009 -0800 mesa: Fix array out-of-bounds access by _mesa_LightModelf. _mesa_LightModelf calls _mesa_LightModelfv, which uses the params argument as an array. diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index 5a8f916..c1d47de 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -547,7 +547,10 @@ _mesa_LightModeli( GLenum pname, GLint param ) void GLAPIENTRY _mesa_LightModelf( GLenum pname, GLfloat param ) { - _mesa_LightModelfv( pname, ¶m ); + GLfloat fparam[4]; + fparam[0] = param; + fparam[1] = fparam[2] = fparam[3] = 0.0F; + _mesa_LightModelfv( pname, fparam ); } commit a082d965de228d5035e59245df528af62761652a Author: Vinson Lee <v...@vmware.com> Date: Wed Dec 9 11:26:24 2009 -0800 glsl: Remove unused member x from struct slang_operation. diff --git a/src/mesa/shader/slang/slang_compile_operation.h b/src/mesa/shader/slang/slang_compile_operation.h index 58f1ede..1f15c19 100644 --- a/src/mesa/shader/slang/slang_compile_operation.h +++ b/src/mesa/shader/slang/slang_compile_operation.h @@ -127,7 +127,6 @@ typedef struct slang_operation_ * indicate such. num_children indicates number of elements. */ GLboolean array_constructor; - double x; } slang_operation; commit 3de8fff45d04fd7e702cd656ba97cafd348c3981 Author: Brian Paul <bri...@vmware.com> Date: Wed Dec 9 08:30:01 2009 -0700 mesa: fix baseLevel >= MAX_TEXTURE_LEVELS test This fixes invalid array indexing when baseLevel == MAX_TEXTURE_LEVELS. See bug 25528. diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index da55ac8..85f5f78 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -418,7 +418,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, /* Detect cases where the application set the base level to an invalid * value. */ - if ((baseLevel < 0) || (baseLevel > MAX_TEXTURE_LEVELS)) { + if ((baseLevel < 0) || (baseLevel >= MAX_TEXTURE_LEVELS)) { char s[100]; _mesa_sprintf(s, "base level = %d is invalid", baseLevel); incomplete(t, s); commit 33a120e4761a661736ea64a3efc2e3831ac5600a Author: Andre Maasikas <amaasi...@gmail.com> Date: Wed Dec 9 10:51:52 2009 +0200 r600: fix state size prediction after dc0777d3 diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index d8661b4..dacc2cc 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -1134,7 +1134,11 @@ static int check_blnd(GLcontext *ctx, struct radeon_state_atom *atom) count += 3; if (context->radeon.radeonScreen->chip_family > CHIP_FAMILY_R600) { - for (ui = 0; ui < R700_MAX_RENDER_TARGETS; ui++) { + /* targets are enabled in r700SetRenderTarget but state + size is calculated before that. Until MRT's are done + hardcode target0 as enabled. */ + count += 3; + for (ui = 1; ui < R700_MAX_RENDER_TARGETS; ui++) { if (r700->render_target[ui].enabled) count += 3; } commit af16c822a5af8ce0aa7582e8ea44315b62b7356b Author: Vinson Lee <v...@vmware.com> Date: Tue Dec 8 18:26:05 2009 -0800 mesa: Fix array out-of-bounds access by _mesa_LightModeli. _mesa_LightModeli calls _mesa_LightModeliv, which uses the params argument as an array. diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index 10c89f4..5a8f916 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -537,7 +537,10 @@ _mesa_LightModeliv( GLenum pname, const GLint *params ) void GLAPIENTRY _mesa_LightModeli( GLenum pname, GLint param ) { - _mesa_LightModeliv( pname, ¶m ); + GLint iparam[4]; + iparam[0] = param; + iparam[1] = iparam[2] = iparam[3] = 0; + _mesa_LightModeliv( pname, iparam ); } commit d33bf38d63d233f6a09115acfff230c464d3ee29 Author: Vinson Lee <v...@vmware.com> Date: Tue Dec 8 17:51:07 2009 -0800 mesa: Fix array out-of-bounds access by _mesa_Fogf. _mesa_Fogf calls _mesa_Fogfv, which uses the params argument as an array. diff --git a/src/mesa/main/fog.c b/src/mesa/main/fog.c index 99eb141..269ff3f 100644 --- a/src/mesa/main/fog.c +++ b/src/mesa/main/fog.c @@ -34,7 +34,10 @@ void GLAPIENTRY _mesa_Fogf(GLenum pname, GLfloat param) { - _mesa_Fogfv(pname, ¶m); + GLfloat fparam[4]; + fparam[0] = param; + fparam[1] = fparam[2] = fparam[3] = 0.0F; + _mesa_Fogfv(pname, fparam); } commit 3f7c2ac2798b385bed97b6931a1568a7e0223a0a Author: Vinson Lee <v...@vmware.com> Date: Tue Dec 8 17:25:05 2009 -0800 mesa: Fix array out-of-bounds access by _mesa_TexParameteri. _mesa_TexParameteri calls set_tex_parameteri, which uses the params argument as an array. diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 59c518c..1cec4b8 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -653,7 +653,12 @@ _mesa_TexParameteri(GLenum target, GLenum pname, GLint param) break; default: /* this will generate an error if pname is illegal */ - need_update = set_tex_parameteri(ctx, texObj, pname, ¶m); + { + GLint iparam[4]; + iparam[0] = param; + iparam[1] = iparam[2] = iparam[3] = 0; + need_update = set_tex_parameteri(ctx, texObj, pname, iparam); + } } if (ctx->Driver.TexParameter && need_update) { commit 7f146b38240e1c4efa6d8d0a4e5a0c8346706de5 Author: Vinson Lee <v...@vmware.com> Date: Tue Dec 8 16:04:33 2009 -0800 mesa: Fix array out-of-bounds access by _mesa_Fogi. _mesa_Fogi calls _mesa_Fogfv, which uses the params argument as an array. diff --git a/src/mesa/main/fog.c b/src/mesa/main/fog.c index 4323d3d..99eb141 100644 --- a/src/mesa/main/fog.c +++ b/src/mesa/main/fog.c @@ -41,8 +41,10 @@ _mesa_Fogf(GLenum pname, GLfloat param) void GLAPIENTRY _mesa_Fogi(GLenum pname, GLint param ) { - GLfloat fparam = (GLfloat) param; - _mesa_Fogfv(pname, &fparam); + GLfloat fparam[4]; + fparam[0] = (GLfloat) param; + fparam[1] = fparam[2] = fparam[3] = 0.0F; + _mesa_Fogfv(pname, fparam); } commit a1d46fbea0b40d7edc668ea5993ea4318f37c9f9 Author: Vinson Lee <v...@vmware.com> Date: Tue Dec 8 15:42:13 2009 -0800 mesa: Fix array out-of-bounds access by _mesa_TexParameteri. _mesa_TexParameteri calls set_tex_parameterf, which uses the params argument as an array. diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 4c1f690..59c518c 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -644,9 +644,11 @@ _mesa_TexParameteri(GLenum target, GLenum pname, GLint param) case GL_TEXTURE_LOD_BIAS: case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: { - GLfloat fparam = (GLfloat) param; + GLfloat fparam[4]; + fparam[0] = (GLfloat) param; + fparam[1] = fparam[2] = fparam[3] = 0.0F; /* convert int param to float */ - need_update = set_tex_parameterf(ctx, texObj, pname, &fparam); + need_update = set_tex_parameterf(ctx, texObj, pname, fparam); } break; default: commit d88f3b946804f9a3e8cad4f8896e6be488fec2b5 Author: Vinson Lee <v...@vmware.com> Date: Tue Dec 8 14:31:38 2009 -0800 mesa: Fix array out-of-bounds access by _mesa_TexParameterfv. _mesa_TexParameterfv calls set_tex_parameteri, which uses the params argument as an array. diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 4ce8c85..4c1f690 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -592,8 +592,10 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) case GL_DEPTH_TEXTURE_MODE_ARB: { /* convert float param to int */ - GLint p = (GLint) params[0]; - need_update = set_tex_parameteri(ctx, texObj, pname, &p); + GLint p[4]; + p[0] = (GLint) params[0]; + p[1] = p[2] = p[3] = 0; + need_update = set_tex_parameteri(ctx, texObj, pname, p); } break; commit 54b0ed8360019fc6e0234c2c3413be40fe4d3b59 Author: Brian Paul <bri...@vmware.com> Date: Tue Dec 8 15:03:15 2009 -0700 vbo: fix array index out of bounds error, and fix evaluator priorities Fixes bug 25525. Plus, the GL_NV_vertex_program evaluators alias and override the convential evaluator maps, so set their state after the conventional maps. diff --git a/src/mesa/vbo/vbo_exec_eval.c b/src/mesa/vbo/vbo_exec_eval.c index 0c691b3..a784621 100644 --- a/src/mesa/vbo/vbo_exec_eval.c +++ b/src/mesa/vbo/vbo_exec_eval.c @@ -35,17 +35,20 @@ static void clear_active_eval1( struct vbo_exec_context *exec, GLuint attr ) { + assert(attr < Elements(exec->eval.map1)); exec->eval.map1[attr].map = NULL; } static void clear_active_eval2( struct vbo_exec_context *exec, GLuint attr ) { + assert(attr < Elements(exec->eval.map2)); exec->eval.map2[attr].map = NULL; } static void set_active_eval1( struct vbo_exec_context *exec, GLuint attr, GLuint dim, struct gl_1d_map *map ) { + assert(attr < Elements(exec->eval.map1)); if (!exec->eval.map1[attr].map) { exec->eval.map1[attr].map = map; exec->eval.map1[attr].sz = dim; @@ -55,6 +58,7 @@ static void set_active_eval1( struct vbo_exec_context *exec, GLuint attr, GLuint static void set_active_eval2( struct vbo_exec_context *exec, GLuint attr, GLuint dim, struct gl_2d_map *map ) { + assert(attr < Elements(exec->eval.map2)); if (!exec->eval.map2[attr].map) { exec->eval.map2[attr].map = map; exec->eval.map2[attr].sz = dim; @@ -73,18 +77,6 @@ void vbo_exec_eval_update( struct vbo_exec_context *exec ) clear_active_eval2( exec, attr ); } - /* _NEW_PROGRAM */ - if (ctx->VertexProgram._Enabled) { - for (attr = 0; attr < VBO_ATTRIB_FIRST_MATERIAL; attr++) { - /* _NEW_EVAL */ - if (ctx->Eval.Map1Attrib[attr]) - set_active_eval1( exec, attr, 4, &ctx->EvalMap.Map1Attrib[attr] ); - - if (ctx->Eval.Map2Attrib[attr]) - set_active_eval2( exec, attr, 4, &ctx->EvalMap.Map2Attrib[attr] ); - } - } - if (ctx->Eval.Map1Color4) set_active_eval1( exec, VBO_ATTRIB_COLOR0, 4, &ctx->EvalMap.Map1Color4 ); @@ -125,6 +117,23 @@ void vbo_exec_eval_update( struct vbo_exec_context *exec ) else if (ctx->Eval.Map2Vertex3) set_active_eval2( exec, VBO_ATTRIB_POS, 3, &ctx->EvalMap.Map2Vertex3 ); + /* _NEW_PROGRAM */ + if (ctx->VertexProgram._Enabled) { + /* These are the 16 evaluators which GL_NV_vertex_program defines. + * They alias and override the conventional vertex attributs. + */ + for (attr = 0; attr < 16; attr++) { + /* _NEW_EVAL */ + assert(attr < Elements(ctx->Eval.Map1Attrib)); + if (ctx->Eval.Map1Attrib[attr]) + set_active_eval1( exec, attr, 4, &ctx->EvalMap.Map1Attrib[attr] ); + + assert(attr < Elements(ctx->Eval.Map2Attrib)); + if (ctx->Eval.Map2Attrib[attr]) + set_active_eval2( exec, attr, 4, &ctx->EvalMap.Map2Attrib[attr] ); + } + } + exec->eval.recalculate_maps = 0; } commit 1de1deffce9c7120a167af8553b606eec82e60a3 Author: Vinson Lee <v...@vmware.com> Date: Tue Dec 8 00:43:38 2009 -0800 i915g: Fix memory leak when pci id is unknown. diff --git a/src/gallium/drivers/i915simple/i915_screen.c b/src/gallium/drivers/i915simple/i915_screen.c index 9f017a1..9557c80 100644 --- a/src/gallium/drivers/i915simple/i915_screen.c +++ b/src/gallium/drivers/i915simple/i915_screen.c @@ -273,6 +273,7 @@ i915_create_screen(struct intel_winsys *iws, uint pci_id) default: debug_printf("%s: unknown pci id 0x%x, cannot create screen\n", __FUNCTION__, pci_id); + FREE(is); return NULL; } commit 7e93e06781d2f3e0c737c7654c3fb0d83e31e45a Author: Vinson Lee <v...@vmware.com> Date: Tue Dec 8 00:37:35 2009 -0800 i915g: Add missing break statement in i915_debug_packet. diff --git a/src/gallium/drivers/i915simple/i915_debug.c b/src/gallium/drivers/i915simple/i915_debug.c index ce92d1a..521b516 100644 --- a/src/gallium/drivers/i915simple/i915_debug.c +++ b/src/gallium/drivers/i915simple/i915_debug.c @@ -851,6 +851,7 @@ static boolean i915_debug_packet( struct debug_stream *stream ) default: return debug(stream, "", 0); } + break; default: assert(0); return 0; commit 7f8e22aa29b7340d51b1f2e16d55a035c0f9b851 Author: Vinson Lee <v...@vmware.com> Date: Tue Dec 8 00:26:37 2009 -0800 rbug: Initialize variable in rbug_get_message. Silences uninitialized variable warning. diff --git a/src/gallium/auxiliary/rbug/rbug_connection.c b/src/gallium/auxiliary/rbug/rbug_connection.c index 52acb70..ae4e27f 100644 --- a/src/gallium/auxiliary/rbug/rbug_connection.c +++ b/src/gallium/auxiliary/rbug/rbug_connection.c @@ -87,6 +87,7 @@ rbug_get_message(struct rbug_connection *c, uint32_t *serial) if (!data) { return NULL; } + data->opcode = 0; do { uint8_t *ptr = ((uint8_t*)data) + read; commit 369669ff9a7ff7636cadef8e2b13f2f28face98f Author: Andre Maasikas <amaasi...@gmail.com> Date: Thu Dec 3 12:26:44 2009 +0200 r600: add support for TXB instruction makes testing other things easier - does not hang the card TODO: enable TEX dependency tracking in vertex programs diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 6ff08e1..be875ae 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -3450,22 +3450,6 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) need_barrier = GL_TRUE; } - switch (pAsm->pILInst[pAsm->uiCurInst].Opcode) - { - case OPCODE_TEX: - break; - case OPCODE_TXB: - radeon_error("do not support TXB yet\n"); - return GL_FALSE; - break; - case OPCODE_TXP: - break; - default: - radeon_error("Internal error: bad texture op (not TEX)\n"); - return GL_FALSE; - break; - } - if (pAsm->pILInst[pAsm->uiCurInst].Opcode == OPCODE_TXP) { GLuint tmp = gethelpr(pAsm); @@ -3644,7 +3628,15 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) } - pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE; + if(pAsm->pILInst[pAsm->uiCurInst].Opcode == OPCODE_TXB) + { + pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE_L; + } + else + { + pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE; + } + pAsm->is_tex = GL_TRUE; if ( GL_TRUE == need_barrier ) { commit dc0777d3e3b760d7faa5fb99a189919bde07ca0b Author: Andre Maasikas <amaasi...@gmail.com> Date: Wed Nov 4 10:00:47 2009 +0200 r600: reorder state for render_target and blend First time around render targets are not enabled yet (done in r700SendRenderTargetState) so blend state is not emitted for any targets. Affects first glClear in some mesa tests. As a quick fix reorder state emit so that target is set first diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index 8707a76..d8661b4 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -1250,9 +1250,9 @@ void r600InitAtoms(context_t *context) ALLOC_STATE(poly, always, 10, r700SendPolyState); ALLOC_STATE(cb, cb, 18, r700SendCBState); ALLOC_STATE(clrcmp, always, 6, r700SendCBCLRCMPState); + ALLOC_STATE(cb_target, always, 25, r700SendRenderTargetState); ALLOC_STATE(blnd, blnd, (6 + (R700_MAX_RENDER_TARGETS * 3)), r700SendCBBlendState); ALLOC_STATE(blnd_clr, always, 6, r700SendCBBlendColorState); - ALLOC_STATE(cb_target, always, 25, r700SendRenderTargetState); ALLOC_STATE(sx, always, 9, r700SendSXState); ALLOC_STATE(vgt, always, 41, r700SendVGTState); ALLOC_STATE(spi, always, (59 + R700_MAX_SHADER_EXPORTS), r700SendSPIState); commit add6dfbba64260c9b314b4a95c8def084e05bd3b Author: Vinson Lee <v...@vmware.com> Date: Mon Dec 7 19:04:07 2009 -0800 llvmpipe: Initialize variables in emit_instruction. diff --git a/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c b/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c index d4d18fe..f588bde 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c @@ -496,9 +496,9 @@ emit_instruction( if (IS_DST0_CHANNEL_ENABLED( inst, CHAN_X ) || IS_DST0_CHANNEL_ENABLED( inst, CHAN_Y ) || IS_DST0_CHANNEL_ENABLED( inst, CHAN_Z )) { - LLVMValueRef *p_floor_log2; - LLVMValueRef *p_exp; - LLVMValueRef *p_log2; + LLVMValueRef *p_floor_log2 = NULL; + LLVMValueRef *p_exp = NULL; + LLVMValueRef *p_log2 = NULL; src0 = emit_fetch( bld, inst, 0, CHAN_X ); src0 = lp_build_abs( &bld->base, src0 ); commit 3e8b2fda215689b9a77c73020a1efc523995931e Author: Vinson Lee <v...@vmware.com> Date: Mon Dec 7 18:40:37 2009 -0800 progs/test: Initialize variable in prog_parameter. Silences uninitialized variable compiler warning. diff --git a/progs/tests/prog_parameter.c b/progs/tests/prog_parameter.c index 0241f3a..2de7e29 100644 --- a/progs/tests/prog_parameter.c +++ b/progs/tests/prog_parameter.c @@ -192,6 +192,7 @@ static void Init( void ) GLfloat * params; GLint max_program_env_parameters; GLint max_program_local_parameters; + int i; printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); @@ -238,6 +239,10 @@ static void Init( void ) params = malloc(max_program_env_parameters * 4 * sizeof(GLfloat)); + for (i = 0; i < max_program_env_parameters * 4; i++) { + params[i] = 0.0F; -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org