[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

mesa: Changes to 'debian-unstable'



 Makefile                                        |    2 
 configs/default                                 |    2 
 debian/changelog                                |    6 
 docs/relnotes-8.0.3.html                        |    4 
 docs/relnotes-8.0.4.html                        |  202 +++++++++++++++++++++
 docs/relnotes.html                              |    2 
 src/gallium/auxiliary/draw/draw_llvm.c          |    5 
 src/gallium/auxiliary/draw/draw_pipe_pstipple.c |    5 
 src/gallium/auxiliary/draw/draw_pt.c            |    9 
 src/gallium/drivers/i915/i915_flush.c           |    5 
 src/gallium/drivers/i915/i915_screen.c          |    4 
 src/gallium/drivers/nv50/nv50_pc_emit.c         |    4 
 src/gallium/drivers/r600/r600_shader.c          |    8 
 src/gallium/drivers/svga/svga_pipe_blit.c       |    6 
 src/gallium/drivers/svga/svga_pipe_draw.c       |   11 +
 src/gallium/drivers/svga/svga_pipe_sampler.c    |    4 
 src/gallium/drivers/svga/svga_screen.c          |    2 
 src/gallium/drivers/svga/svga_state_tss.c       |   10 -
 src/gallium/drivers/svga/svga_surface.c         |    5 
 src/gallium/state_trackers/vega/vg_translate.c  |    4 
 src/gallium/targets/Makefile.xorg               |    2 
 src/glsl/ast_to_hir.cpp                         |    3 
 src/glsl/builtins/ir/acos.ir                    |    8 
 src/glsl/builtins/tools/texture_builtins.py     |    6 
 src/glsl/ir.h                                   |    4 
 src/glsl/loop_analysis.cpp                      |   28 +++
 src/glsl/loop_analysis.h                        |   23 ++
 src/glsl/ralloc.c                               |    2 
 src/glu/sgi/libnurbs/internals/mapdesc.cc       |    2 
 src/glu/sgi/libnurbs/internals/nurbstess.cc     |    2 
 src/glx/glxext.c                                |    3 
 src/mesa/drivers/common/meta.c                  |   76 +++++++-
 src/mesa/drivers/dri/i915/i830_state.c          |    2 
 src/mesa/drivers/dri/i965/brw_eu.c              |    8 
 src/mesa/drivers/dri/i965/brw_fs.h              |    1 
 src/mesa/drivers/dri/i965/brw_fs_visitor.cpp    |   50 +++--
 src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp  |   26 ++
 src/mesa/main/attrib.c                          |    8 
 src/mesa/main/bufferobj.c                       |   27 ++
 src/mesa/main/fbobject.c                        |   16 +
 src/mesa/main/format_unpack.c                   |    4 
 src/mesa/main/image.c                           |  221 +++++++++++++++++-------
 src/mesa/main/image.h                           |    6 
 src/mesa/main/readpix.c                         |    9 
 src/mesa/main/shaderobj.c                       |    3 
 src/mesa/main/texformat.c                       |   10 -
 src/mesa/main/texgetimage.c                     |   16 -
 src/mesa/main/teximage.c                        |   39 ++--
 src/mesa/main/transformfeedback.c               |   21 +-
 src/mesa/main/version.c                         |    2 
 src/mesa/main/version.h                         |    4 
 src/mesa/state_tracker/st_cb_drawpixels.c       |   13 +
 src/mesa/state_tracker/st_cb_fbo.c              |    8 
 src/mesa/state_tracker/st_cb_texture.c          |   27 ++
 src/mesa/state_tracker/st_draw.c                |   20 +-
 src/mesa/state_tracker/st_format.c              |   34 ++-
 src/mesa/state_tracker/st_gen_mipmap.c          |   18 +
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp      |   10 -
 src/mesa/state_tracker/st_texture.c             |    3 
 tests/glx/Makefile.am                           |    4 
 tests/glx/fake_glx_screen.h                     |    2 
 61 files changed, 866 insertions(+), 205 deletions(-)

New commits:
commit 54b6c74ff0af79012f0890e11f9e0447e366aef0
Author: Sven Joachim <svenjoac@gmx.de>
Date:   Thu Jul 26 18:47:19 2012 +0200

    Bump changelog

diff --git a/debian/changelog b/debian/changelog
index 0eb66a1..9f439c3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+mesa (8.0.4-1) UNRELEASED; urgency=low
+
+  * New upstream stable release (Closes: #682703).
+
+ -- Sven Joachim <svenjoac@gmx.de>  Thu, 26 Jul 2012 18:46:22 +0200
+
 mesa (8.0.3-1) unstable; urgency=low
 
   [ Robert Hooker ]

commit c1f4867c89adb1a6b19d66ec8ad146115909f0a7
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Tue Jul 10 08:30:11 2012 -0700

    docs: Add 8.0.4 release notes
    
    Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>

diff --git a/docs/relnotes-8.0.4.html b/docs/relnotes-8.0.4.html
new file mode 100644
index 0000000..d5792aa
--- /dev/null
+++ b/docs/relnotes-8.0.4.html
@@ -0,0 +1,202 @@
+<HTML>
+
+<head>
+<TITLE>Mesa Release Notes</TITLE>
+<link rel="stylesheet" type="text/css" href="mesa.css">
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+</head>
+
+<BODY>
+
+<body bgcolor="#eeeeee">
+
+<H1>Mesa 8.0.4 Release Notes / July 10, 2012</H1>
+
+<p>
+Mesa 8.0.4 is a bug fix release which fixes bugs found since the 8.0.2 release.
+</p>
+<p>
+Mesa 8.0.4 implements the OpenGL 3.0 API, but the version reported by
+glGetString(GL_VERSION) depends on the particular driver being used.
+Some drivers don't support all the features required in OpenGL 3.0.
+</p>
+<p>
+See the <a href="install.html">Compiling/Installing page</a> for prerequisites
+for DRI hardware acceleration.
+</p>
+
+
+<h2>MD5 checksums</h2>
+<pre>
+TBD
+</pre>
+
+<h2>New features</h2>
+<p>None.</p>
+
+<h2>Bug fixes</h2>
+
+<p>This list is likely incomplete.</p>
+
+<ul>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=45967";>Bug 45967</a> - piglit getteximage-invalid-format-for-packed-type regression</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=47742";>Bug 47742</a> - [softpipe] piglit fbo-generatemipmap-array regression</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=48141";>Bug 48141</a> - [vmwgfx] src/gallium/auxiliary/util/u_inlines.h:256:pipe_buffer_map_range: Assertion `offset + length &lt;= buffer-&gt;width0' failed.</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=48472";>Bug 48472</a> - GPU Lockup while running demo (rzr - the scene is dead) in wine</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50033";>Bug 50033</a> - src/mesa/state_tracker/st_cb_fbo.c:379:st_render_texture: Assertion `strb-&gt;rtt_level &lt;= strb-&gt;texture-&gt;last_level' failed.</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50621";>Bug 50621</a> - Mesa fails its test suite with a buffer overflow.</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50298";>Bug 50298</a> - [ILK IVB bisected]Ogles2conform GL/sin/sin_float_vert_xvary.test regressed</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=51574";>Bug 51574</a> - ir_loop_jump constructor assigns member variable to itself</li>
+
+<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=";>Bug </a> - </li> -->
+
+</ul>
+
+
+<h2>Changes</h2>
+<p>The full set of changes can be viewed by using the following GIT command:</p>
+
+<pre>
+  git log mesa-8.0.3..mesa-8.0.4
+</pre>
+
+<p>Andreas Betz (1):
+<ul>
+  <li>vega: fix 565 color unpacking bug</li>
+</ul></p>
+
+<p>Antoine Labour (2):
+<ul>
+  <li>meta: Cleanup the resources we allocate.</li>
+  <li>mesa: Free uniforms correclty.</li>
+</ul></p>
+
+<p>Brian Paul (22):
+<ul>
+  <li>docs: add link to 8.0.3 release notes</li>
+  <li>mesa: fix Z32_FLOAT -&gt; uint conversion functions</li>
+  <li>draw: fix primitive restart bug by using the index buffer offset</li>
+  <li>st/mesa: fix glDrawPixels(GL_DEPTH_COMPONENT) color output</li>
+  <li>svga: fix synchronization bug between sampler views and surfaces</li>
+  <li>mesa: new _mesa_error_check_format_and_type() function</li>
+  <li>mesa: add missing GL_UNSIGNED_INT_10F_11F_11F_REV case</li>
+  <li>mesa: fix missing return value in getteximage_error_check()</li>
+  <li>st/mesa: pass GL_MAP_INVALIDATE_RANGE_BIT to gallium drivers</li>
+  <li>svga: add 0.5 in float-&gt;int conversion of sample min/max lod</li>
+  <li>svga: fix min/max lod clamping</li>
+  <li>svga: change PIPE_CAPF_MAX_TEXTURE_LOD_BIAS from 16.0 to 15.0</li>
+  <li>st/mesa: add fallback pipe formats for (compressed) R, RG formats</li>
+  <li>st/mesa: copy num_immediates field when copying the immediates array</li>
+  <li>svga: move svga_texture() casts/calls in svga_surface_copy()</li>
+  <li>svga: reset vertex buffer offset in svga_release_user_upl_buffers()</li>
+  <li>st/mesa: don't set PIPE_BIND_DISPLAY_TARGET for user-created renderbuffers</li>
+  <li>st/mesa: use private pipe_sampler_view in decompress_with_blit()</li>
+  <li>st/mesa: add null pointer check in st_texture_image_map()</li>
+  <li>st/mesa: fix mipmap image size computation w.r.t. texture arrays</li>
+  <li>draw: fix missing immediates bug in polygon stipple code</li>
+  <li>st/mesa: fix max_offset computation for base vertex</li>
+</ul></p>
+
+<p>Christoph Bumiller (1):
+<ul>
+  <li>nv50: handle NEG,ABS modifiers for short RCP encoding</li>
+</ul></p>
+
+<p>Dylan Noblesmith (1):
+<ul>
+  <li>mesa: require GL_MAX_SAMPLES &gt;= 4 for GL 3.0</li>
+</ul></p>
+
+<p>Eric Anholt (1):
+<ul>
+  <li>i965/vs: Fix texelFetchOffset()</li>
+</ul></p>
+
+<p>Ian Romanick (5):
+<ul>
+  <li>docs: Add 8.0.3 release md5sums</li>
+  <li>glx/tests: Fix off-by-one error in allocating extension string buffer</li>
+  <li>glsl: Remove spurious printf messages</li>
+  <li>glsl: Fix pi/2 constant in acos built-in function</li>
+  <li>mesa: Bump version number to 8.0.4</li>
+</ul></p>
+
+<p>José Fonseca (2):
+<ul>
+  <li>mesa: Avoid void acinclude.m4 Android.common.mk Android.mk autogen.sh bin common.py configs configure.ac docs doxygen include Makefile scons SConstruct src tests arithmetic.</li>
+  <li>draw: Ensure that prepare is always run after LLVM garbagge collection.</li>
+</ul></p>
+
+<p>Kenneth Graunke (15):
+<ul>
+  <li>mesa: Check for a negative "size" parameter in glCopyBufferSubData().</li>
+  <li>i965: Fix brw_swap_cmod() for LE/GE comparisons.</li>
+  <li>glsl: Remove unused ir_loop_jump::loop pointer.</li>
+  <li>ralloc: Fix ralloc_parent() of memory allocated out of the NULL context.</li>
+  <li>mesa: Restore depth texture state on glPopAttrib(GL_TEXTURE_BIT).</li>
+  <li>glsl/builtins: Fix textureGrad() for Array samplers.</li>
+  <li>mesa: Unbind ARB_copy_buffer and transform feedback buffers on delete.</li>
+  <li>mesa: Support BindBuffer{Base,Offset,Range} with a buffer of 0.</li>
+  <li>mesa: Unbind ARB_transform_feedback2 binding points on Delete too.</li>
+  <li>meta: Fix GL_RENDERBUFFER binding in decompress_texture_image().</li>
+  <li>i965/fs: Fix texelFetchOffset() on pre-Gen7.</li>
+  <li>i965/vs: Fix texelFetchOffset() on pre-Gen7.</li>
+  <li>i965/fs: Fix user-defined FS outputs with less than four components.</li>
+  <li>glsl: Hook up loop_variable_state destructor to plug a memory leak.</li>
+  <li>glsl: Don't trust loop analysis in the presence of function calls.</li>
+</ul></p>
+
+<p>Kurt Roeckx (1):
+<ul>
+  <li>i830: Fix crash for GL_STENCIL_TEST in i830Enable()</li>
+</ul></p>
+
+<p>Lukas Rössler (1):
+<ul>
+  <li>glu: fix two Clang warnings</li>
+</ul></p>
+
+<p>Marek Olšák (2):
+<ul>
+  <li>mesa: allow exposing GL3 without EXT_texture_integer</li>
+  <li>st/mesa: don't do srgb-&gt;linear conversion in decompress_with_blit</li>
+</ul></p>
+
+<p>Paul Seidler (1):
+<ul>
+  <li>tests: include mesa headers</li>
+</ul></p>
+
+<p>Stéphane Marchesin (3):
+<ul>
+  <li>glx: Handle a null reply in QueryVersion.</li>
+  <li>i915g: Don't invert signalled/unsignalled fences</li>
+  <li>i915g: Don't avoid flushing when we have a pending fence.</li>
+</ul></p>
+
+<p>Thomas Gstädtner (1):
+<ul>
+  <li>gallium/targets: pass ldflags parameter to MKLIB</li>
+</ul></p>
+
+<p>Vadim Girlin (2):
+<ul>
+  <li>st/mesa: set stObj-&gt;lastLevel in guess_and_alloc_texture</li>
+  <li>r600g: check gpr count limit</li>
+</ul></p>
+
+<p>Vinson Lee (1):
+<ul>
+  <li>st/mesa: Fix uninitialized members in glsl_to_tgsi_visitor constructor.</li>
+</ul></p>
+
+</body>
+</html>
diff --git a/docs/relnotes.html b/docs/relnotes.html
index 1bc889a..ce9f775 100644
--- a/docs/relnotes.html
+++ b/docs/relnotes.html
@@ -13,6 +13,7 @@ The release notes summarize what's new or changed in each Mesa release.
 </p>
 
 <UL>
+<LI><A HREF="relnotes-8.0.4.html">8.0.4 release notes</A>
 <LI><A HREF="relnotes-8.0.3.html">8.0.3 release notes</A>
 <LI><A HREF="relnotes-8.0.2.html">8.0.2 release notes</A>
 <LI><A HREF="relnotes-8.0.1.html">8.0.1 release notes</A>

commit 7c2225b026162beedf3302a3515eaea2f6f7e4f8
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Tue Jul 10 08:28:32 2012 -0700

    mesa: Bump version number to 8.0.4
    
    Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>

diff --git a/Makefile b/Makefile
index be73f10..61f4af6 100644
--- a/Makefile
+++ b/Makefile
@@ -184,7 +184,7 @@ ultrix-gcc:
 
 # Rules for making release tarballs
 
-PACKAGE_VERSION=8.0.3
+PACKAGE_VERSION=8.0.4
 PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
 PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
 
diff --git a/configs/default b/configs/default
index 5e703e2..289aa0e 100644
--- a/configs/default
+++ b/configs/default
@@ -10,7 +10,7 @@ CONFIG_NAME = default
 # Version info
 MESA_MAJOR=8
 MESA_MINOR=0
-MESA_TINY=3
+MESA_TINY=4
 MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
 
 # 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 d9ef3d0..6afeff4 100644
--- a/src/mesa/main/version.h
+++ b/src/mesa/main/version.h
@@ -34,8 +34,8 @@ struct gl_context;
 /* Mesa version */
 #define MESA_MAJOR 8
 #define MESA_MINOR 0
-#define MESA_PATCH 3
-#define MESA_VERSION_STRING "8.0.3"
+#define MESA_PATCH 4
+#define MESA_VERSION_STRING "8.0.4"
 
 /* To make version comparison easy */
 #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))

commit 827c99e1a025c588f1ab5b42bf49a681047d8136
Author: Marek Olšák <maraeo@gmail.com>
Date:   Fri Jun 15 05:13:02 2012 +0200

    st/mesa: don't do srgb->linear conversion in decompress_with_blit
    
    This fixes piglit/getteximage-formats on r600g.
    
    NOTE: This is a candidate for stable branches.
    
    Reviewed-by: Brian Paul <brianp@vmware.com>
    (cherry picked from commit 5e7e7d96b341e937d3b795e94ac4a863c357f724)

diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index f5bf018..a8e0240 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -639,6 +639,7 @@ decompress_with_blit(struct gl_context * ctx,
 
       u_sampler_view_default_template(&sv_temp, stObj->pt, stObj->pt->format);
 
+      sv_temp.format = util_format_linear(sv_temp.format);
       sv_temp.u.tex.first_level =
       sv_temp.u.tex.last_level = texImage->Level;
 

commit 0d384680988cc3a9a7b69793f5f46971bbd5210a
Author: Thomas Gstädtner <thomas@gstaedtner.net>
Date:   Wed May 23 18:55:51 2012 +0200

    gallium/targets: pass ldflags parameter to MKLIB
    
    Without passing the -ldflags parameter before $(LDFLAGS) in some cases
    flags will be passed to MKLIB which it does not understand.
    This might be -m64, -m32 or similar.
    
    NOTE: This is a candidate for the 8.0 branch.
    
    Signed-off-by: Thomas Gstädtner <thomas@gstaedtner.net>
    Signed-off-by: Brian Paul <brianp@vmware.com>
    (cherry picked from commit 93594f38be75227879b835a2037b7466adbd70ef)

diff --git a/src/gallium/targets/Makefile.xorg b/src/gallium/targets/Makefile.xorg
index 481e3d6..21bf237 100644
--- a/src/gallium/targets/Makefile.xorg
+++ b/src/gallium/targets/Makefile.xorg
@@ -46,7 +46,7 @@ endif
 default: depend $(TOP)/$(LIB_DIR)/gallium $(LIBNAME) $(LIBNAME_STAGING)
 
 $(LIBNAME): $(OBJECTS) Makefile ../Makefile.xorg $(LIBS) $(DRIVER_PIPES) $(GALLIUM_AUXILIARIES)
-	$(MKLIB) -linker '$(LD)' -noprefix -o $@ $(LDFLAGS) $(OBJECTS) $(DRIVER_PIPES) $(GALLIUM_AUXILIARIES) $(DRIVER_LINKS)
+	$(MKLIB) -linker '$(LD)' -noprefix -o $@ -ldflags '$(LDFLAGS)' $(OBJECTS) $(DRIVER_PIPES) $(GALLIUM_AUXILIARIES) $(DRIVER_LINKS)
 
 depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(SYMLINKS) $(GENERATED_SOURCES)
 	rm -f depend

commit fc3d2c46239af5c57f90643408586345b5561360
Author: Vinson Lee <vlee@freedesktop.org>
Date:   Sun Apr 8 22:28:34 2012 -0700

    st/mesa: Fix uninitialized members in glsl_to_tgsi_visitor constructor.
    
    Fixes uninitialized member defects reported by Coverity.
    
    NOTE: This is a candidate for the 8.0 branch.
    
    Signed-off-by: Vinson Lee <vlee@freedesktop.org>
    Reviewed-by: Brian Paul <brianp@vmware.com>
    (cherry picked from commit 70d038e46eb877ffa922003c78630eb7eb76c0f3)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index e50f55c..7871651 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -2815,6 +2815,10 @@ glsl_to_tgsi_visitor::glsl_to_tgsi_visitor()
    indirect_addr_temps = false;
    indirect_addr_consts = false;
    mem_ctx = ralloc_context(NULL);
+   ctx = NULL;
+   prog = NULL;
+   shader_program = NULL;
+   options = NULL;
 }
 
 glsl_to_tgsi_visitor::~glsl_to_tgsi_visitor()

commit fe5541f64c11ccd38ccf56c71e95a597ae5e509f
Author: Vadim Girlin <vadimgirlin@gmail.com>
Date:   Tue Apr 10 00:44:52 2012 +0400

    r600g: check gpr count limit
    
    This should help to prevent gpu lockups.
    See https://bugs.freedesktop.org/show_bug.cgi?id=48472
    
    NOTE: This is a candidate for the stable branches.
    
    Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 783e4da72aa203a645737dec81b001341951a942)

diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index 45d491b..d63309e 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -1277,6 +1277,14 @@ static int r600_shader_from_tgsi(struct r600_pipe_context * rctx, struct r600_pi
 	if (ctx.bc->chip_class == CAYMAN)
 		cm_bytecode_add_cf_end(ctx.bc);
 
+	/* check GPR limit - we have 124 = 128 - 4
+	 * (4 are reserved as alu clause temporary registers) */
+	if (ctx.bc->ngpr > 124) {
+		R600_ERR("GPR limit exceeded - shader requires %d registers\n", ctx.bc->ngpr);
+		r = -ENOMEM;
+		goto out_err;
+	}
+
 	free(ctx.literals);
 	tgsi_parse_free(&ctx.parse);
 	return 0;

commit 1ce1a4526f3af818ef6a3934a0ff0d192f818376
Author: Brian Paul <brianp@vmware.com>
Date:   Mon Apr 2 20:05:16 2012 +0200

    st/mesa: fix max_offset computation for base vertex
    
    Add the maximum base vertex offset to max_index for computing the
    buffer size.  Fixes a failed assertion in the u_upload_mgr.c code with
    the VMware svga driver.
    
    Fixes https://bugs.freedesktop.org/show_bug.cgi?id=48141
    
    v2: incorporate Marek's suggestions.
    
    NOTE: This is a candidate for the 8.0 branch.
    
    Reviewed-by: Marek Olšák <maraeo@gmail.com>
    (cherry picked from commit 299c9052e832712654865af8dbd0ed4bf055d124)

diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index 6d6fc85..fb2b6f9 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -979,6 +979,7 @@ st_draw_vbo(struct gl_context *ctx,
    struct pipe_index_buffer ibuffer;
    struct pipe_draw_info info;
    unsigned i, num_instances = 1;
+   unsigned max_index_plus_base;
    GLboolean new_array =
       st->dirty.st &&
       (st->dirty.mesa & (_NEW_ARRAY | _NEW_PROGRAM | _NEW_BUFFER_OBJECT)) != 0;
@@ -987,6 +988,8 @@ st_draw_vbo(struct gl_context *ctx,
    assert(ctx->NewState == 0x0);
 
    if (ib) {
+      int max_base_vertex = 0;
+
       /* Gallium probably doesn't want this in some cases. */
       if (!index_bounds_valid)
          if (!all_varyings_in_vbos(arrays))
@@ -994,7 +997,16 @@ st_draw_vbo(struct gl_context *ctx,
 
       for (i = 0; i < nr_prims; i++) {
          num_instances = MAX2(num_instances, prims[i].num_instances);
+         max_base_vertex = MAX2(max_base_vertex, prims[i].basevertex);
       }
+
+      /* Compute the sum of max_index and max_base_vertex.  That's the value
+       * we need to use when creating buffers.
+       */
+      if (max_index == ~0)
+         max_index_plus_base = max_index;
+      else
+         max_index_plus_base = max_index + max_base_vertex;
    }
    else {
       /* Get min/max index for non-indexed drawing. */
@@ -1006,6 +1018,9 @@ st_draw_vbo(struct gl_context *ctx,
          max_index = MAX2(max_index, prims[i].start + prims[i].count - 1);
          num_instances = MAX2(num_instances, prims[i].num_instances);
       }
+
+      /* The base vertex offset only applies to indexed drawing */
+      max_index_plus_base = max_index;
    }
 
    /* Validate state. */
@@ -1025,7 +1040,8 @@ st_draw_vbo(struct gl_context *ctx,
       st_validate_state(st);
 
       if (new_array) {
-         if (!st_validate_varrays(ctx, arrays, max_index, num_instances)) {
+         if (!st_validate_varrays(ctx, arrays, max_index_plus_base,
+                                  num_instances)) {
             /* probably out of memory, no-op the draw call */
             return;
          }
@@ -1049,7 +1065,7 @@ st_draw_vbo(struct gl_context *ctx,
             unsigned element_size = st->user_attrib[i].element_size;
             unsigned stride = st->user_attrib[i].stride;
             unsigned min_offset = min_index * stride;
-            unsigned max_offset = max_index * stride + element_size;
+            unsigned max_offset = max_index_plus_base * stride + element_size;
 
             assert(max_offset > min_offset);
 

commit e0e1ca353b9b77f328d1afa2480ccbffbbea7143
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Wed Mar 28 14:00:42 2012 -0700

    glsl: Don't trust loop analysis in the presence of function calls.
    
    Function calls may have side effects that alter variables used inside
    the loop.  In the fragment shader, they may even terminate the shader.
    This means our analysis about loop-constant or induction variables may
    be completely wrong.
    
    In general it's impossible to determine whether they actually do or not
    (due to the halting problem), so we'd need to perform conservative
    static analysis.  For now, it's not worth the complexity: most functions
    will be inlined, at which point we can unroll them successfully.
    
    Fixes Piglit tests:
    - shaders/glsl-fs-unroll-out-param
    - shaders/glsl-fs-unroll-side-effect
    
    NOTE: This is a candidate for release branches.
    
    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
    (cherry picked from commit 0405bd08ca0e01ebc68891ee1ff47d320983f775)

diff --git a/src/glsl/loop_analysis.cpp b/src/glsl/loop_analysis.cpp
index 9bba6a9..6a0e4da 100644
--- a/src/glsl/loop_analysis.cpp
+++ b/src/glsl/loop_analysis.cpp
@@ -110,6 +110,8 @@ public:
    virtual ir_visitor_status visit(ir_loop_jump *);
    virtual ir_visitor_status visit(ir_dereference_variable *);
 
+   virtual ir_visitor_status visit_enter(ir_call *);
+
    virtual ir_visitor_status visit_enter(ir_loop *);
    virtual ir_visitor_status visit_leave(ir_loop *);
    virtual ir_visitor_status visit_enter(ir_assignment *);
@@ -153,6 +155,21 @@ loop_analysis::visit(ir_loop_jump *ir)
 
 
 ir_visitor_status
+loop_analysis::visit_enter(ir_call *ir)
+{
+   /* If we're not somewhere inside a loop, there's nothing to do. */
+   if (this->state.is_empty())
+      return visit_continue;
+
+   loop_variable_state *const ls =
+      (loop_variable_state *) this->state.get_head();
+
+   ls->contains_calls = true;
+   return visit_continue_with_parent;
+}
+
+
+ir_visitor_status
 loop_analysis::visit(ir_dereference_variable *ir)
 {
    /* If we're not somewhere inside a loop, there's nothing to do.
@@ -209,6 +226,17 @@ loop_analysis::visit_leave(ir_loop *ir)
    loop_variable_state *const ls =
       (loop_variable_state *) this->state.pop_head();
 
+   /* Function calls may contain side effects.  These could alter any of our
+    * variables in ways that cannot be known, and may even terminate shader
+    * execution (say, calling discard in the fragment shader).  So we can't
+    * rely on any of our analysis about assignments to variables.
+    *
+    * We could perform some conservative analysis (prove there's no statically
+    * possible assignment, etc.) but it isn't worth it for now; function
+    * inlining will allow us to unroll loops anyway.
+    */
+   if (ls->contains_calls)
+      return visit_continue;
 
    foreach_list(node, &ir->body_instructions) {
       /* Skip over declarations at the start of a loop.
diff --git a/src/glsl/loop_analysis.h b/src/glsl/loop_analysis.h
index d47b969..05c982f 100644
--- a/src/glsl/loop_analysis.h
+++ b/src/glsl/loop_analysis.h
@@ -122,10 +122,16 @@ public:
     */
    unsigned num_loop_jumps;
 
+   /**
+    * Whether this loop contains any function calls.
+    */
+   bool contains_calls;
+
    loop_variable_state()
    {
       this->max_iterations = -1;
       this->num_loop_jumps = 0;
+      this->contains_calls = false;
       this->var_hash = hash_table_ctor(0, hash_table_pointer_hash,
 				       hash_table_pointer_compare);
    }

commit 04f7c32f789de49338bc1a69d66bb49374f8b09c
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Mar 23 14:53:48 2012 -0600

    draw: fix missing immediates bug in polygon stipple code
    
    The function that counts the number of TGSI immediates also needs to
    emit the immediates.  This fixes assorted failures when using polygon
    stipple with fragment shaders that have their own immediates.
    
    NOTE: This is a candidate for the 8.0 branch.
    (cherry picked from commit 7f16246acef4089570abca76a59580691ec6cf68)

diff --git a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
index 0401a45..9ed425d 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
@@ -165,11 +165,16 @@ pstip_transform_decl(struct tgsi_transform_context *ctx,
 }
 
 
+/**
+ * TGSI immediate declaration transform callback.
+ * We're just counting the number of immediates here.
+ */
 static void
 pstip_transform_immed(struct tgsi_transform_context *ctx,
                       struct tgsi_full_immediate *immed)
 {
    struct pstip_transform_context *pctx = (struct pstip_transform_context *) ctx;
+   ctx->emit_immediate(ctx, immed); /* emit to output shader */
    pctx->numImmed++;
 }
 

commit da8d65fde46ac324d03ea667124d60db93047870
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Mar 23 08:16:58 2012 -0600

    st/mesa: fix mipmap image size computation w.r.t. texture arrays
    
    The image height or depth is the array_size for array textures.
    Fixes https://bugs.freedesktop.org/show_bug.cgi?id=47742
    
    NOTE: This is a candidate for the 8.0 branch.
    
    Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
    (cherry picked from commit 318669f196ca922337da02af9d72773e76e70b45)

diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c
index d817a9c..750d66a 100644
--- a/src/mesa/state_tracker/st_gen_mipmap.c
+++ b/src/mesa/state_tracker/st_gen_mipmap.c
@@ -229,10 +229,22 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target,
          = _mesa_get_tex_image(ctx, texObj, target, srcLevel);
       struct gl_texture_image *dstImage;
       struct st_texture_image *stImage;
-      uint dstWidth = u_minify(pt->width0, dstLevel);
-      uint dstHeight = u_minify(pt->height0, dstLevel);
-      uint dstDepth = u_minify(pt->depth0, dstLevel); 
       uint border = srcImage->Border;
+      uint dstWidth, dstHeight, dstDepth;
+
+      dstWidth = u_minify(pt->width0, dstLevel);
+      if (texObj->Target == GL_TEXTURE_1D_ARRAY) {
+         dstHeight = pt->array_size;
+      }
+      else {
+         dstHeight = u_minify(pt->height0, dstLevel);
+      }
+      if (texObj->Target == GL_TEXTURE_2D_ARRAY) {
+         dstDepth = pt->array_size;
+      }
+      else {
+         dstDepth = u_minify(pt->depth0, dstLevel);
+      }
 
       dstImage = _mesa_get_tex_image(ctx, texObj, target, dstLevel);
       if (!dstImage) {

commit 57a273d89b76c6fefc21438ed688a8b73d862cb4
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Mar 16 09:31:13 2012 -0600

    st/mesa: add null pointer check in st_texture_image_map()
    
    If we failed to allocate a memory resource for the texture we'd crash
    when we tried to map it.  Now we propogate the NULL back up to the
    texstore code and generate GL_OUT_OF_MEMORY.
    
    Fixes a crash with the upcoming piglit max-texture-size test.
    
    NOTE: This is a candidate for the 8.0 branch.
    
    Reviewed-by: José Fonseca <jfonseca@vmware.com>
    (cherry picked from commit 03f8a97d718502f60d16000aead251d88a751149)

diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c
index 132d7a8..9627a61 100644
--- a/src/mesa/state_tracker/st_texture.c
+++ b/src/mesa/state_tracker/st_texture.c
@@ -222,6 +222,9 @@ st_texture_image_map(struct st_context *st, struct st_texture_image *stImage,
 
    DBG("%s \n", __FUNCTION__);
 
+   if (!stImage->pt)
+      return NULL;
+
    if (stObj->pt != stImage->pt)
       level = 0;
    else

commit 099bc3aaea93313c774a554a5dee56706ac4b674
Author: Brian Paul <brianp@vmware.com>
Date:   Mon Feb 13 14:48:36 2012 -0700

    st/mesa: use private pipe_sampler_view in decompress_with_blit()
    
    Similar to the previous commit.  Also fix incorrect setting of the
    sampler view's state after it's created.  We need to specify the
    first/last_level fields in the template instead.
    
    NOTE: This is a candidate for the 8.0 branch.
    
    Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
    (cherry picked from commit 0315cb9f8f3ec38fa9594860754fb53a67cf4c23)

diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index a19120a..f5bf018 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -611,8 +611,7 @@ decompress_with_blit(struct gl_context * ctx,
    struct pipe_context *pipe = st->pipe;
    struct st_texture_image *stImage = st_texture_image(texImage);
    struct st_texture_object *stObj = st_texture_object(texImage->TexObject);
-   struct pipe_sampler_view *src_view =
-      st_get_texture_sampler_view(stObj, pipe);
+   struct pipe_sampler_view *src_view;
    const GLuint width = texImage->Width;
    const GLuint height = texImage->Height;
    struct pipe_surface *dst_surface;
@@ -634,8 +633,21 @@ decompress_with_blit(struct gl_context * ctx,
       pipe->render_condition(pipe, NULL, 0);
    }
 
-   /* Choose the source mipmap level */
-   src_view->u.tex.first_level = src_view->u.tex.last_level = texImage->Level;
+   /* Create sampler view that limits fetches to the source mipmap level */
+   {
+      struct pipe_sampler_view sv_temp;
+
+      u_sampler_view_default_template(&sv_temp, stObj->pt, stObj->pt->format);
+
+      sv_temp.u.tex.first_level =
+      sv_temp.u.tex.last_level = texImage->Level;
+
+      src_view = pipe->create_sampler_view(pipe, stObj->pt, &sv_temp);
+      if (!src_view) {
+         _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGetTexImage");
+         return;
+      }
+   }
 
    /* blit/render/decompress */
    util_blit_pixels_tex(st->blit,
@@ -704,6 +716,8 @@ decompress_with_blit(struct gl_context * ctx,
 
    /* destroy the temp / dest surface */
    util_destroy_rgba_surface(dst_texture, dst_surface);
+
+   pipe_sampler_view_reference(&src_view, NULL);
 }
 
 

commit 3539914e49118a5048e7c0f87d5014c088988195
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Feb 10 18:57:15 2012 -0700

    st/mesa: don't set PIPE_BIND_DISPLAY_TARGET for user-created renderbuffers
    
    The st_renderbuffer_alloc_storage() function is used to allocate both
    window-system buffers and user-created renderbuffers.  The later kind
    are never directly displayed so don't set PIPE_BIND_DISPLAY_TARGET for
    those surfaces.
    
    NOTE: This is a candidate for the 8.0 branch.
    
    Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
    (cherry picked from commit 5a70e12fc0897a3178c73b20d99fc0f11b180374)

diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index fefd93a..215e919 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -142,7 +142,12 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx,
       if (util_format_is_depth_or_stencil(format)) {
          template.bind = PIPE_BIND_DEPTH_STENCIL;
       }
+      else if (strb->Base.Name != 0) {
+         /* this is a user-created renderbuffer */
+         template.bind = PIPE_BIND_RENDER_TARGET;
+      }
       else {
+         /* this is a window-system buffer */
          template.bind = (PIPE_BIND_DISPLAY_TARGET |
                           PIPE_BIND_RENDER_TARGET);
       }
@@ -203,6 +208,7 @@ st_new_renderbuffer(struct gl_context *ctx, GLuint name)
 {
    struct st_renderbuffer *strb = ST_CALLOC_STRUCT(st_renderbuffer);
    if (strb) {
+      assert(name != 0);
       _mesa_init_renderbuffer(&strb->Base, name);
       strb->Base.Delete = st_renderbuffer_delete;
       strb->Base.AllocStorage = st_renderbuffer_alloc_storage;

commit de8bb6a59b09821d66f7ff38e35cce20c3cfa86f
Author: José Fonseca <jfonseca@vmware.com>
Date:   Fri Jan 27 14:40:06 2012 +0000

    draw: Ensure that prepare is always run after LLVM garbagge collection.
    
    Should avoid dangling pointer derreference with
    
      glean --run results --overwrite --quick --tests texSwizzle
    
    NOTE: This is a candidate for the 8.0 branch.
    
    Reviewed-by: Brian Paul <brianp@vmware.com>
    (cherry picked from commit 07635a4799b15a7575e1feb8859ecc7734850deb)

diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c
index e71c802..b81c725 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_llvm.c
@@ -65,8 +65,13 @@ static void
 draw_llvm_garbage_collect_callback(void *cb_data)
 {
    struct draw_llvm *llvm = (struct draw_llvm *) cb_data;
+   struct draw_context *draw = llvm->draw;
    struct draw_llvm_variant_list_item *li;
 
+   /* Ensure prepare will be run and shaders recompiled */
+   assert(!draw->suspend_flushing);
+   draw_do_flush(draw, DRAW_FLUSH_STATE_CHANGE);
+
    /* free all shader variants */
    li = first_elem(&llvm->vs_variants_list);
    while (!at_end(&llvm->vs_variants_list, li)) {

commit 646ac024624ebc74ec540992507060968c3d9a4e
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Jan 26 11:32:01 2012 -0700

    svga: reset vertex buffer offset in svga_release_user_upl_buffers()
    
    This function releases the buffer that contains user-space vertex data.
    The buffer_offset field points into that buffer.  So reset the
    buffer_offset to zero when we release the buffer so that subsequent
    draws don't inadvertantly get a bad offset.
    
    Fixes error messages / failed assertions (in the draw module's bounds/size
    checking code) when running piglit's polygon-mode test.
    
    NOTE: This is a candidate for the 8.0 branch.
    
    Reviewed-by: José Fonseca <jfonseca@vmware.com>
    (cherry picked from commit 04341e51cea32d6e54d99019dd00ec56e77e27f9)

diff --git a/src/gallium/drivers/svga/svga_pipe_draw.c b/src/gallium/drivers/svga/svga_pipe_draw.c
index 541a234..cc0df71 100644
--- a/src/gallium/drivers/svga/svga_pipe_draw.c
+++ b/src/gallium/drivers/svga/svga_pipe_draw.c
@@ -201,6 +201,17 @@ svga_release_user_upl_buffers(struct svga_context *svga)
       if (vb->buffer && svga_buffer_is_user_buffer(vb->buffer)) {
          struct svga_buffer *buffer = svga_buffer(vb->buffer);
 
+         /* The buffer_offset is relative to the uploaded buffer.
+          * Since we're discarding that buffer we need to reset this offset
+          * so it's not inadvertantly applied to a subsequent draw.
+          *
+          * XXX a root problem here is that the svga->curr.vb[] information
+          * is getting set both by gallium API calls and by code in
+          * svga_upload_user_buffers().  We should instead have two copies
+          * of the vertex buffer information and choose between as needed.
+          */
+         vb->buffer_offset = 0;
+
          buffer->uploaded.start = ~0;
          buffer->uploaded.end = 0;
          if (buffer->uploaded.buffer)

commit dad7547b98dc4da4899ee883fa5c3c4f5698101a
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Jan 19 11:37:00 2012 -0700

    svga: move svga_texture() casts/calls in svga_surface_copy()
    
    To fix failed assertions when calling glCopyBufferSubData().
    
    svga_texture() asserts that the resource is a texture.  Simply move the
    calls to svga_texture() after the code that handles non-texture copies
    so that we don't call it with non-texture resources.
    
    Fixes glean bufferObject failure.
    
    NOTE: This is a candidate for the 8.0 branch.
    
    Reviewed-by: José Fonseca <jfonseca@vmware.com>
    (cherry picked from commit 7f2e12812a2208330ef8704e7c4721ececd2aab3)

diff --git a/src/gallium/drivers/svga/svga_pipe_blit.c b/src/gallium/drivers/svga/svga_pipe_blit.c
index c4f122f..8e114d3 100644
--- a/src/gallium/drivers/svga/svga_pipe_blit.c
+++ b/src/gallium/drivers/svga/svga_pipe_blit.c
@@ -44,8 +44,7 @@ static void svga_surface_copy(struct pipe_context *pipe,
                               const struct pipe_box *src_box)
  {
    struct svga_context *svga = svga_context(pipe);
-   struct svga_texture *stex = svga_texture(src_tex);
-   struct svga_texture *dtex = svga_texture(dst_tex);
+   struct svga_texture *stex, *dtex;
 /*   struct pipe_screen *screen = pipe->screen;
    SVGA3dCopyBox *box;
    enum pipe_error ret;
@@ -63,6 +62,9 @@ static void svga_surface_copy(struct pipe_context *pipe,


Reply to: