mesa: Changes to 'debian-experimental'
ChangeLog | 301 +++++++++++++++
debian/changelog | 7
docs/relnotes-7.7.1.html | 1
src/gallium/drivers/llvmpipe/lp_bld_arit.c | 11
src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c | 2
src/gallium/drivers/llvmpipe/lp_debug.h | 71 +++
src/gallium/drivers/llvmpipe/lp_draw_arrays.c | 8
src/gallium/drivers/llvmpipe/lp_jit.c | 2
src/gallium/drivers/llvmpipe/lp_screen.c | 80 +++
src/gallium/drivers/llvmpipe/lp_state_blend.c | 18
src/gallium/drivers/llvmpipe/lp_state_fs.c | 156 ++++---
src/gallium/drivers/llvmpipe/lp_state_rasterizer.c | 9
src/gallium/drivers/llvmpipe/lp_state_surface.c | 2
src/gallium/drivers/llvmpipe/lp_state_vs.c | 13
src/gallium/drivers/softpipe/sp_state_blend.c | 5
src/gallium/drivers/softpipe/sp_state_fs.c | 11
src/gallium/drivers/softpipe/sp_state_rasterizer.c | 9
src/gallium/drivers/softpipe/sp_state_surface.c | 2
src/gallium/drivers/svga/svga_context.c | 1
src/gallium/drivers/svga/svga_context.h | 4
src/gallium/drivers/svga/svga_pipe_blend.c | 7
src/gallium/drivers/svga/svga_pipe_draw.c | 3
src/gallium/drivers/svga/svga_screen_buffer.c | 62 ++-
src/gallium/drivers/svga/svga_screen_texture.c | 4
src/gallium/drivers/svga/svga_state_fs.c | 126 +-----
src/gallium/drivers/svga/svga_tgsi.h | 1
src/gallium/drivers/svga/svga_tgsi_decl_sm30.c | 15
src/gallium/drivers/svga/svga_tgsi_insn.c | 34 +
src/gallium/state_trackers/python/retrace/interpreter.py | 2
src/gallium/state_trackers/xorg/xorg_crtc.c | 4
src/gallium/state_trackers/xorg/xorg_driver.c | 4
src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h | 43 --
src/glx/x11/dri2_glx.c | 13
src/mesa/drivers/dri/r600/r600_context.c | 16
src/mesa/drivers/dri/r600/r600_tex.h | 2
src/mesa/drivers/dri/r600/r700_assembler.c | 15
src/mesa/drivers/windows/gdi/mesa.def | 4
src/mesa/drivers/windows/gdi/wmesa.c | 12
src/mesa/main/api_validate.c | 9
src/mesa/main/context.c | 4
src/mesa/shader/slang/slang_preprocess.c | 32 +
src/mesa/state_tracker/st_draw.c | 3
src/mesa/tnl/t_draw.c | 3
src/mesa/vbo/vbo_exec_array.c | 32 -
windows/VC8/mesa/gdi/gdi.vcproj | 8
windows/VC8/mesa/mesa/mesa.vcproj | 12
46 files changed, 852 insertions(+), 331 deletions(-)
New commits:
commit eef7b39a3618ca77dfb77111b4daad2acf2c1824
Author: Brice Goglin <bgoglin@debian.org>
Date: Mon Feb 1 22:55:49 2010 +0100
Prepare changelog for upload
diff --git a/debian/changelog b/debian/changelog
index 0e7ebec..4a441c0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,9 @@
-mesa (7.7-3) UNRELEASED; urgency=low
+mesa (7.7-3) experimental; urgency=low
* Pull from upstream mesa_7_7_branch up to commit f5145a6e.
+ * Build against libdrm-radeon1 2.4.17 to get DRI2 support.
- -- Brice Goglin <bgoglin@debian.org> Mon, 01 Feb 2010 22:37:33 +0100
+ -- Brice Goglin <bgoglin@debian.org> Mon, 01 Feb 2010 22:55:36 +0100
mesa (7.7-2) experimental; urgency=low
commit 04f4a8921b917b428bb63fe152f5b69c314075d0
Author: Brice Goglin <bgoglin@debian.org>
Date: Mon Feb 1 22:38:35 2010 +0100
New upstream snapshot
diff --git a/ChangeLog b/ChangeLog
index 1206f32..cef81d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,304 @@
+commit f5145a6ec3e9086988ab8ec004276f845fecc3d9
+Author: Jakob Bornecrantz <jakob@vmware.com>
+Date: Fri Jan 29 17:11:36 2010 +0100
+
+ vmware/core: Remove old ioctl structs not used
+
+ Leftover that was never used in this driver
+
+commit ddedfe12d41808c3caa77649e3a9a6c4c6253d69
+Author: José Fonseca <jfonseca@vmware.com>
+Date: Thu Jan 28 20:51:52 2010 +0000
+
+ svga: Actually call fence_reference in texture downloads.
+
+commit cb5447f79ca03d29407e8db84166f5bddd8d4c59
+Author: Brian Paul <brianp@vmware.com>
+Date: Fri Jan 29 08:26:23 2010 -0700
+
+ glsl: fix preprocessor bug involving //-style comments in macro definitions
+
+ See comments for details.
+
+commit 9fd3c74724e557bc6ecc851d8552615ab3becfe2
+Author: Brian Paul <brianp@vmware.com>
+Date: Thu Jan 28 13:05:36 2010 -0700
+
+ tnl: check that state is validated before drawing
+
+commit 4d1234e22242529c8d85f5ef0cf826af41a91570
+Author: Brian Paul <brianp@vmware.com>
+Date: Thu Jan 28 13:05:23 2010 -0700
+
+ st/mesa: check that state is validated before drawing
+
+commit 3cba779e16935f7c3a0bfd8af48bd5e015068e96
+Author: Brian Paul <brianp@vmware.com>
+Date: Thu Jan 28 13:04:16 2010 -0700
+
+ vbo: fix missing state validation bugs
+
+ Commit 2708ddfb06a36d8568e2aa130bf1f7d551fcd309 caused a few regressions.
+ We need to check/validate state after calling bind_arrays() because
+ it might set the _NEW_ARRAYS flag if the varying VP inputs change.
+
+ The symptom of this problem was some attribute arrays being ignored
+ (or interpreted as constant-valued) in glDrawRangeElements or
+ glMultiDrawElements.
+
+ A follow-on patch will add some additional asserts to try to catch
+ this kind of thing in the future.
+
+commit 23eda89ec89e2bd5bc26077bd56e8d6b5d4040d4
+Author: Brian Paul <brianp@vmware.com>
+Date: Thu Jan 28 13:02:40 2010 -0700
+
+ mesa: do state validation in _mesa_valid_to_render()
+
+ ...rather than checking/validating before all the calls to
+ _mesa_valid_to_render() and valid_to_render().
+
+ The next patch will actually fix some bugs...
+
+commit 6e68898b05dc957dc6cb92d2ff060589e5936650
+Author: José Fonseca <jfonseca@vmware.com>
+Date: Sat Dec 26 21:05:31 2009 +0000
+
+ softpipe: Flush draw module when fragment pipeline state changes.
+
+commit 1befcd5a2ae8588f8d17d2ecea19dd4daccddb00
+Author: José Fonseca <jfonseca@vmware.com>
+Date: Sat Dec 26 11:01:05 2009 +0000
+
+ softpipe: Flush draw module before switching framebuffer.
+
+ Otherwise geometry might end up in the wrong rendertarget.
+
+commit 12ba3559785fa276b3b4b6fa06cfe551b87aecc3
+Author: José Fonseca <jfonseca@vmware.com>
+Date: Mon Nov 23 11:21:11 2009 +0000
+
+ llvmpipe: Use assert instead of abort. Only verify functions on debug builds.
+
+commit a0907a645f7d832e7c53d14c2ed88080b456a1a5
+Author: José Fonseca <jfonseca@vmware.com>
+Date: Sun Nov 15 06:46:48 2009 -0800
+
+ llvmpipe: Fix memory leak.
+
+commit 1acf7a09e762e6d8a26c8f0d919f5efa6df6e71f
+Author: José Fonseca <jfonseca@vmware.com>
+Date: Tue Nov 10 17:52:53 2009 -0800
+
+ llvmpipe: Use the generic conversion routine for depths.
+
+ This allows for z32f depth format to work correctly.
+
+commit 14dc02a1b2c52cf02b7f89885b61f42575834958
+Author: José Fonseca <jfonseca@vmware.com>
+Date: Tue Nov 10 17:51:06 2009 -0800
+
+ llvmpipe: Be more conservative with the supported formats.
+
+ We'll likely support much more formats, but doing this allows to run
+ more testsuites without immediately hit assertion failures.
+
+commit 88cf87bd5633c0e8155e4226fc49ab36f1abc335
+Author: José Fonseca <jfonseca@vmware.com>
+Date: Mon Dec 28 22:52:41 2009 +0000
+
+ llvmpipe: Unmapping vertex/index buffers does NOT flush draw module anymore.
+
+ Not since 6094e79f4e3350d123c7532b1c73faa60834a62d.
+
+ Drivers now need to flush draw module explicitely (which explains why
+ all those previous commits adding draw_flushes calls were necessary).
+
+ This is a good thing, but it's tricky to get this right in face of user buffers
+ (it's not even clear who has the responsibility to flush when a user buffer
+ is seen -- statetracker or pipe driver), so just force flush (temporarily)
+ since it's not a bottleneck now.
+
+commit 31b3420688dbf7fc2282f0d1fe13e51fe9e1f9b6
+Author: José Fonseca <jfonseca@vmware.com>
+Date: Sat Dec 26 15:21:16 2009 +0000
+
+ llvmpipe: Treat state changes systematically.
+
+ That is:
+ - check for no op
+ - update/flush draw module
+ - update bound state and mark it as dirty
+
+ In particular flushing the draw module is important since it may contain
+ unflushed primitives which would otherwise be draw with wrong state.
+
+commit 4e95983fa832cf0808ccab64e9fbfb0fcdde8049
+Author: José Fonseca <jfonseca@vmware.com>
+Date: Sat Dec 26 11:00:42 2009 +0000
+
+ llvmpipe: Flush draw module before switching framebuffer.
+
+ Otherwise geometry will end up in the wrong rendertarget.
+
+commit 4e506eac8f11a23249a46265b796c4764d9d045e
+Author: José Fonseca <jfonseca@vmware.com>
+Date: Wed Dec 16 15:06:02 2009 +0000
+
+ llvmpipe: add LP_DEBUG env var
+
+ Cherry-picked from dec35d04aeb398eef159aaf8cde5e0d04622b811.
+
+commit 46167149ceac96cf91f2031d2c58346b80f0834d
+Author: Brian Paul <brianp@vmware.com>
+Date: Mon Dec 14 15:27:35 2009 -0700
+
+ llvmpipe: fix broken TGSI_OPCODE_FRC codegen
+
+commit 96ec4eb755d0296c807ca5c89383a3b9f9fc1dbe
+Author: Brian Paul <brianp@vmware.com>
+Date: Mon Dec 14 15:24:31 2009 -0700
+
+ llvmpipe: fix broken lp_build_abs()
+
+commit e20547042c03e22234c9580f005286552bd4ae18
+Author: José Fonseca <jfonseca@vmware.com>
+Date: Tue Dec 15 14:46:43 2009 +0000
+
+ llvmpipe: Fix yet another copynpaste typo in lp_build_log2_approx.
+
+ Now fslight looks perfect.
+
+commit 0451d0fd01bdd4ee6a2497a3a1c749446739602e
+Author: José Fonseca <jfonseca@vmware.com>
+Date: Tue Dec 15 14:15:52 2009 +0000
+
+ llvmpipe: Fix lp_build_polynomial comment.
+
+commit aa8b23e077f8c4f4c517e58533a72db0fb861091
+Author: José Fonseca <jfonseca@vmware.com>
+Date: Tue Dec 15 13:58:53 2009 +0000
+
+ llvmpipe: Fix typo in lp_build_log constant.
+
+commit 4eb48a3af78beda4ee1628d0ecd6a437a0721a72
+Author: José Fonseca <jfonseca@vmware.com>
+Date: Tue Dec 15 12:13:43 2009 +0000
+
+ llvmpipe: Fix bad SI -> FP conversion into lp_build_log2_approx.
+
+ It should be a bitcast as the integer value is actually an encoded FP
+ already.
+
+commit 8db8adfd01a1ff1e2a160ae3b0199bd3daa4191a
+Author: Jakob Bornecrantz <jakob@vmware.com>
+Date: Thu Jan 28 17:59:26 2010 +0100
+
+ st/xorg: Update to new libkms interface but be backwards compatible
+
+commit 8e240d7e0eb640cc954f6d81119136e2d546d618
+Author: Keith Whitwell <keithw@vmware.com>
+Date: Mon Aug 10 18:45:07 2009 +0100
+
+ svga: remove sleep in DEBUG_FLUSH path
+
+commit 40298bf272c7fbb289b442b4424c2c17402ae322
+Author: José Fonseca <jfonseca@vmware.com>
+Date: Thu Jan 28 17:11:02 2010 +0000
+
+ python/retrace: Dump all vertices for verbosity level 3.
+
+commit a0518e66b2960d3bab386985e24ccbc9c51abf97
+Author: Brian Paul <brianp@vmware.com>
+Date: Wed Jan 27 17:08:03 2010 -0700
+
+ docs: Fixed Windows build for 7.7.1
+
+commit 82c76cd16f35f4d903f49761af7eb28a755ad299
+Author: Brian Paul <brianp@vmware.com>
+Date: Wed Jan 27 16:25:59 2010 -0700
+
+ windows: assorted build fixes
+
+ These changes were originally submitted by Karl Schultz for Mesa 7.7-rc2
+ but weren't applied.
+
+commit 50e890bc51cfc278378f25cb70be79f1bad0b6b6
+Author: Rodolfo Ribeiro Gomes <rodolforg@gmail.com>
+Date: Tue Jan 26 14:20:06 2010 -0700
+
+ glx: fix possible memory leaks in dri2CreateScreen()
+
+ Original patch fixed up by Brian Paul.
+
+commit bba95570196dad29880426152a1b7fb77619296d
+Author: Alex Deucher <alexdeucher@gmail.com>
+Date: Wed Jan 27 12:18:02 2010 -0500
+
+ r600: fix warning
+
+commit 2041d3e4b76009687bb2a7752c3ee94e5c160357
+Author: Alex Deucher <alexdeucher@gmail.com>
+Date: Wed Jan 27 12:16:50 2010 -0500
+
+ r600: rv670 support 8 tex instructions just like other r6xx
+
+ also clarify some other const values.
+
+commit 77b7b3a1ab36f1dafa905dbe709d0d72dbc9d54d
+Author: Andre Maasikas <amaasikas@gmail.com>
+Date: Wed Jan 27 11:22:56 2010 +0200
+
+ r600: increase max texture units to 16
+
+commit 0dab80fbfb5703bfbeed691051c353aeca3aaa7a
+Author: Andre Maasikas <amaasikas@gmail.com>
+Date: Wed Jan 27 10:20:15 2010 +0200
+
+ r600: fix XPD with writemask
+
+ same variable used for 2 different temp registers
+ fixes e.g. glsl/bump
+
+commit e3257912e006120f6ab611e77005eed1a464030a
+Author: José Fonseca <jfonseca@vmware.com>
+Date: Wed Jan 27 16:25:31 2010 +0000
+
+ mesa: Warn when indices are out of bounds, but do not skip the draw in debug builds.
+
+ The driver (or preferably the hardware) should handle out of bounds
+ indices.
+
+ If there are problems then it's better to detect those in the debug
+ builds.
+
+commit 15fe4918223f04fa89d523220609abea0cac34e2
+Author: José Fonseca <jfonseca@vmware.com>
+Date: Wed Jan 27 15:41:25 2010 +0000
+
+ svga: Prevent buffer overflow in buffer ranges.
+
+ Do this by extending the nearest range to cover the new range.
+
+ This fixes an access fault in Call of Duty which was doing many disjoint
+ glBufferSubData calls.
+
+commit ac597f5acc8886a0c44aaa4f2484f9d569ae5d6d
+Author: José Fonseca <jfonseca@vmware.com>
+Date: Wed Jan 27 14:45:56 2010 +0000
+
+ svga: Fix PIPE_LOGICOP_INVERT.
+
+ Actually the current XOR implementation is an INVERT.
+
+ This fixes rectangle selection in Maya.
+
+commit 5cb255f0d7ab048355b454d69e44ab9735c8921e
+Author: Keith Whitwell <keithw@vmware.com>
+Date: Wed Jan 27 13:48:21 2010 +0000
+
+ svga: better path for generating white pixels for xor logicop workaround
+
commit 2f28ca0a27cb0c539affb22c487c4bb44b6d54b4
Author: Dave Airlie <airlied@redhat.com>
Date: Wed Jan 27 11:46:26 2010 +1000
diff --git a/debian/changelog b/debian/changelog
index 656e050..0e7ebec 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+mesa (7.7-3) UNRELEASED; urgency=low
+
+ * Pull from upstream mesa_7_7_branch up to commit f5145a6e.
+
+ -- Brice Goglin <bgoglin@debian.org> Mon, 01 Feb 2010 22:37:33 +0100
+
mesa (7.7-2) experimental; urgency=low
[ Julien Cristau ]
commit f5145a6ec3e9086988ab8ec004276f845fecc3d9
Author: Jakob Bornecrantz <jakob@vmware.com>
Date: Fri Jan 29 17:11:36 2010 +0100
vmware/core: Remove old ioctl structs not used
Leftover that was never used in this driver
diff --git a/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h b/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h
index 2be7e12..681d6b5 100644
--- a/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h
+++ b/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h
@@ -87,49 +87,6 @@ struct drm_vmw_getparam_arg {
/*************************************************************************/
/**
- * DRM_VMW_EXTENSION - Query device extensions.
- */
-
-/**
- * struct drm_vmw_extension_rep
- *
- * @exists: The queried extension exists.
- * @driver_ioctl_offset: Ioctl number of the first ioctl in the extension.
- * @driver_sarea_offset: Offset to any space in the DRI SAREA
- * used by the extension.
- * @major: Major version number of the extension.
- * @minor: Minor version number of the extension.
- * @pl: Patch level version number of the extension.
- *
- * Output argument to the DRM_VMW_EXTENSION Ioctl.
- */
-
-struct drm_vmw_extension_rep {
- int32_t exists;
- uint32_t driver_ioctl_offset;
- uint32_t driver_sarea_offset;
- uint32_t major;
- uint32_t minor;
- uint32_t pl;
- uint32_t pad64;
-};
-
-/**
- * union drm_vmw_extension_arg
- *
- * @extension - Ascii name of the extension to be queried. //In
- * @rep - Reply as defined above. //Out
- *
- * Argument to the DRM_VMW_EXTENSION Ioctl.
- */
-
-union drm_vmw_extension_arg {
- char extension[DRM_VMW_EXT_NAME_LEN];
- struct drm_vmw_extension_rep rep;
-};
-
-/*************************************************************************/
-/**
* DRM_VMW_CREATE_CONTEXT - Create a host context.
*
* Allocates a device unique context id, and queues a create context command
commit ddedfe12d41808c3caa77649e3a9a6c4c6253d69
Author: José Fonseca <jfonseca@vmware.com>
Date: Thu Jan 28 20:51:52 2010 +0000
svga: Actually call fence_reference in texture downloads.
diff --git a/src/gallium/drivers/svga/svga_screen_texture.c b/src/gallium/drivers/svga/svga_screen_texture.c
index 9ad4eda..c381988 100644
--- a/src/gallium/drivers/svga/svga_screen_texture.c
+++ b/src/gallium/drivers/svga/svga_screen_texture.c
@@ -203,7 +203,7 @@ svga_transfer_dma(struct svga_transfer *st,
if(transfer == SVGA3D_READ_HOST_VRAM) {
svga_screen_flush(screen, &fence);
sws->fence_finish(sws, fence, 0);
- //sws->fence_reference(sws, &fence, NULL);
+ sws->fence_reference(sws, &fence, NULL);
}
}
else {
@@ -232,7 +232,7 @@ svga_transfer_dma(struct svga_transfer *st,
if(y) {
svga_screen_flush(screen, &fence);
sws->fence_finish(sws, fence, 0);
- //sws->fence_reference(sws, &fence, NULL);
+ sws->fence_reference(sws, &fence, NULL);
}
hw = sws->buffer_map(sws, st->hwbuf, PIPE_BUFFER_USAGE_CPU_WRITE);
commit cb5447f79ca03d29407e8db84166f5bddd8d4c59
Author: Brian Paul <brianp@vmware.com>
Date: Fri Jan 29 08:26:23 2010 -0700
glsl: fix preprocessor bug involving //-style comments in macro definitions
See comments for details.
diff --git a/src/mesa/shader/slang/slang_preprocess.c b/src/mesa/shader/slang/slang_preprocess.c
index e9a24cc..ba40bad 100644
--- a/src/mesa/shader/slang/slang_preprocess.c
+++ b/src/mesa/shader/slang/slang_preprocess.c
@@ -914,6 +914,35 @@ parse_if (slang_string *output, const byte *prod, GLuint *pi, GLint *result, pp_
#define PRAGMA_PARAM 1
+/**
+ * Return the length of the given string, stopping at any C++-style comments.
+ * This step fixes bugs with macro definitions such as:
+ * #define PI 3.14159 // this is pi
+ * The preprocessor includes the comment in the definition of PI so
+ * when we plug in PI somewhere, we get the comment too.
+ * This function effectively strips of the // comment from the given string.
+ * It might also be possible to fix this in the preprocessor grammar.
+ * This bug is not present in the new Mesa 7.8 preprocessor.
+ */
+static int
+strlen_without_comments(const char *s)
+{
+ char pred = 0;
+ int len = 0;
+ while (*s) {
+ if (*s == '/' && pred == '/') {
+ return len - 1;
+ }
+ pred = *s;
+ s++;
+ len++;
+ }
+ return len;
+}
+
+
+
+
static GLboolean
preprocess_source (slang_string *output, const char *source,
grammar pid, grammar eid,
@@ -1055,11 +1084,12 @@ preprocess_source (slang_string *output, const char *source,
if (state.cond.top->effective) {
slang_string replacement;
expand_state es;
+ int idlen2 = strlen_without_comments((char*)id);
pp_annotate (output, ") %s", id);
slang_string_init(&replacement);
- slang_string_pushs(&replacement, id, idlen);
+ slang_string_pushs(&replacement, id, idlen2);
/* Expand macro replacement. */
es.output = &symbol->replacement;
commit 9fd3c74724e557bc6ecc851d8552615ab3becfe2
Author: Brian Paul <brianp@vmware.com>
Date: Thu Jan 28 13:05:36 2010 -0700
tnl: check that state is validated before drawing
diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c
index 9a888ce..b0e31c0 100644
--- a/src/mesa/tnl/t_draw.c
+++ b/src/mesa/tnl/t_draw.c
@@ -394,6 +394,9 @@ void _tnl_draw_prims( GLcontext *ctx,
GLuint max_basevertex = prim->basevertex;
GLuint i;
+ /* Mesa core state should have been validated already */
+ assert(ctx->NewState == 0x0);
+
for (i = 1; i < nr_prims; i++)
max_basevertex = MAX2(max_basevertex, prim[i].basevertex);
commit 4d1234e22242529c8d85f5ef0cf826af41a91570
Author: Brian Paul <brianp@vmware.com>
Date: Thu Jan 28 13:05:23 2010 -0700
st/mesa: check that state is validated before drawing
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index 5c6af11..d3b22db 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -569,6 +569,9 @@ st_draw_vbo(GLcontext *ctx,
/* sanity check for pointer arithmetic below */
assert(sizeof(arrays[0]->Ptr[0]) == 1);
+ /* Mesa core state should have been validated already */
+ assert(ctx->NewState == 0x0);
+
st_validate_state(ctx->st);
/* must get these after state validation! */
commit 3cba779e16935f7c3a0bfd8af48bd5e015068e96
Author: Brian Paul <brianp@vmware.com>
Date: Thu Jan 28 13:04:16 2010 -0700
vbo: fix missing state validation bugs
Commit 2708ddfb06a36d8568e2aa130bf1f7d551fcd309 caused a few regressions.
We need to check/validate state after calling bind_arrays() because
it might set the _NEW_ARRAYS flag if the varying VP inputs change.
The symptom of this problem was some attribute arrays being ignored
(or interpreted as constant-valued) in glDrawRangeElements or
glMultiDrawElements.
A follow-on patch will add some additional asserts to try to catch
this kind of thing in the future.
diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index fdd6b02..d08976c 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -443,6 +443,13 @@ recalculate_input_bindings(GLcontext *ctx)
}
+/**
+ * Examine the enabled vertex arrays to set the exec->array.inputs[] values.
+ * These will point to the arrays to actually use for drawing. Some will
+ * be user-provided arrays, other will be zero-stride const-valued arrays.
+ * Note that this might set the _NEW_ARRAY dirty flag so state validation
+ * must be done after this call.
+ */
static void
bind_arrays(GLcontext *ctx)
{
@@ -484,9 +491,6 @@ vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count)
FLUSH_CURRENT( ctx, 0 );
- if (ctx->NewState)
- _mesa_update_state( ctx );
-
if (!_mesa_valid_to_render(ctx, "glDrawArrays")) {
return;
}
@@ -600,18 +604,16 @@ vbo_validated_drawrangeelements(GLcontext *ctx, GLenum mode,
FLUSH_CURRENT( ctx, 0 );
- if (ctx->NewState)
- _mesa_update_state( ctx );
-
if (!_mesa_valid_to_render(ctx, "glDraw[Range]Elements")) {
return;
}
+ bind_arrays( ctx );
+
+ /* check for dirty state again */
if (ctx->NewState)
_mesa_update_state( ctx );
- bind_arrays( ctx );
-
ib.count = count;
ib.type = type;
ib.obj = ctx->Array.ElementArrayBufferObj;
@@ -848,16 +850,10 @@ vbo_validated_multidrawelements(GLcontext *ctx, GLenum mode,
FLUSH_CURRENT( ctx, 0 );
- if (ctx->NewState)
- _mesa_update_state( ctx );
-
if (!_mesa_valid_to_render(ctx, "glMultiDrawElements")) {
return;
}
- if (ctx->NewState)
- _mesa_update_state( ctx );
-
prim = _mesa_calloc(primcount * sizeof(*prim));
if (prim == NULL) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glMultiDrawElements");
@@ -869,6 +865,10 @@ vbo_validated_multidrawelements(GLcontext *ctx, GLenum mode,
*/
bind_arrays( ctx );
+ /* check for dirty state again */
+ if (ctx->NewState)
+ _mesa_update_state( ctx );
+
switch (type) {
case GL_UNSIGNED_INT:
index_type_size = 4;
commit 23eda89ec89e2bd5bc26077bd56e8d6b5d4040d4
Author: Brian Paul <brianp@vmware.com>
Date: Thu Jan 28 13:02:40 2010 -0700
mesa: do state validation in _mesa_valid_to_render()
...rather than checking/validating before all the calls to
_mesa_valid_to_render() and valid_to_render().
The next patch will actually fix some bugs...
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index e71e5a6..013048b 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -190,9 +190,6 @@ _mesa_validate_DrawElements(GLcontext *ctx,
return GL_FALSE;
}
- if (ctx->NewState)
- _mesa_update_state(ctx);
-
if (!check_valid_to_render(ctx, "glDrawElements"))
return GL_FALSE;
@@ -254,9 +251,6 @@ _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode,
return GL_FALSE;
}
- if (ctx->NewState)
- _mesa_update_state(ctx);
-
if (!check_valid_to_render(ctx, "glDrawRangeElements"))
return GL_FALSE;
@@ -304,9 +298,6 @@ _mesa_validate_DrawArrays(GLcontext *ctx,
return GL_FALSE;
}
- if (ctx->NewState)
- _mesa_update_state(ctx);
-
if (!check_valid_to_render(ctx, "glDrawArrays"))
return GL_FALSE;
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 87eae96..f5d9a30 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1580,6 +1580,10 @@ _mesa_set_mvp_with_dp4( GLcontext *ctx,
GLboolean
_mesa_valid_to_render(GLcontext *ctx, const char *where)
{
+ /* This depends on having up to date derived state (shaders) */
+ if (ctx->NewState)
+ _mesa_update_state(ctx);
+
if (ctx->Shader.CurrentProgram) {
/* using shaders */
if (!ctx->Shader.CurrentProgram->LinkStatus) {
commit 6e68898b05dc957dc6cb92d2ff060589e5936650
Author: José Fonseca <jfonseca@vmware.com>
Date: Sat Dec 26 21:05:31 2009 +0000
softpipe: Flush draw module when fragment pipeline state changes.
diff --git a/src/gallium/drivers/softpipe/sp_state_blend.c b/src/gallium/drivers/softpipe/sp_state_blend.c
index efed082..95ab323 100644
--- a/src/gallium/drivers/softpipe/sp_state_blend.c
+++ b/src/gallium/drivers/softpipe/sp_state_blend.c
@@ -29,6 +29,7 @@
*/
#include "util/u_memory.h"
+#include "draw/draw_context.h"
#include "sp_context.h"
#include "sp_state.h"
@@ -45,6 +46,8 @@ void softpipe_bind_blend_state( struct pipe_context *pipe,
{
struct softpipe_context *softpipe = softpipe_context(pipe);
+ draw_flush(softpipe->draw);
+
softpipe->blend = (struct pipe_blend_state *)blend;
softpipe->dirty |= SP_NEW_BLEND;
@@ -62,6 +65,8 @@ void softpipe_set_blend_color( struct pipe_context *pipe,
{
struct softpipe_context *softpipe = softpipe_context(pipe);
+ draw_flush(softpipe->draw);
+
softpipe->blend_color = *blend_color;
softpipe->dirty |= SP_NEW_BLEND;
diff --git a/src/gallium/drivers/softpipe/sp_state_fs.c b/src/gallium/drivers/softpipe/sp_state_fs.c
index b41f7e8..8ea48ed 100644
--- a/src/gallium/drivers/softpipe/sp_state_fs.c
+++ b/src/gallium/drivers/softpipe/sp_state_fs.c
@@ -69,7 +69,14 @@ softpipe_bind_fs_state(struct pipe_context *pipe, void *fs)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
- softpipe->fs = (struct sp_fragment_shader *) fs;
+ draw_flush(softpipe->draw);
+
+ if (softpipe->fs == fs)
+ return;
+
+ draw_flush(softpipe->draw);
+
+ softpipe->fs = fs;
softpipe->dirty |= SP_NEW_FS;
}
@@ -159,6 +166,8 @@ softpipe_set_constant_buffer(struct pipe_context *pipe,
assert(shader < PIPE_SHADER_TYPES);
assert(index == 0);
+ draw_flush(softpipe->draw);
+
/* note: reference counting */
pipe_buffer_reference(&softpipe->constants[shader].buffer,
buf ? buf->buffer : NULL);
diff --git a/src/gallium/drivers/softpipe/sp_state_rasterizer.c b/src/gallium/drivers/softpipe/sp_state_rasterizer.c
index 87b7219..a5b0033 100644
--- a/src/gallium/drivers/softpipe/sp_state_rasterizer.c
+++ b/src/gallium/drivers/softpipe/sp_state_rasterizer.c
@@ -41,14 +41,17 @@ softpipe_create_rasterizer_state(struct pipe_context *pipe,
}
void softpipe_bind_rasterizer_state(struct pipe_context *pipe,
- void *setup)
+ void *rasterizer)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
+ if (softpipe->rasterizer == rasterizer)
+ return;
+
/* pass-through to draw module */
- draw_set_rasterizer_state(softpipe->draw, setup);
+ draw_set_rasterizer_state(softpipe->draw, rasterizer);
- softpipe->rasterizer = (struct pipe_rasterizer_state *)setup;
+ softpipe->rasterizer = rasterizer;
softpipe->dirty |= SP_NEW_RASTERIZER;
}
commit 1befcd5a2ae8588f8d17d2ecea19dd4daccddb00
Author: José Fonseca <jfonseca@vmware.com>
Date: Sat Dec 26 11:01:05 2009 +0000
softpipe: Flush draw module before switching framebuffer.
Otherwise geometry might end up in the wrong rendertarget.
diff --git a/src/gallium/drivers/softpipe/sp_state_surface.c b/src/gallium/drivers/softpipe/sp_state_surface.c
index 794a922..d29b6ae 100644
--- a/src/gallium/drivers/softpipe/sp_state_surface.c
+++ b/src/gallium/drivers/softpipe/sp_state_surface.c
@@ -48,6 +48,8 @@ softpipe_set_framebuffer_state(struct pipe_context *pipe,
struct softpipe_context *sp = softpipe_context(pipe);
uint i;
+ draw_flush(sp->draw);
+
for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
/* check if changing cbuf */
if (sp->framebuffer.cbufs[i] != fb->cbufs[i]) {
commit 12ba3559785fa276b3b4b6fa06cfe551b87aecc3
Author: José Fonseca <jfonseca@vmware.com>
Date: Mon Nov 23 11:21:11 2009 +0000
llvmpipe: Use assert instead of abort. Only verify functions on debug builds.
diff --git a/src/gallium/drivers/llvmpipe/lp_jit.c b/src/gallium/drivers/llvmpipe/lp_jit.c
index b5aa7d6..7e019d4 100644
--- a/src/gallium/drivers/llvmpipe/lp_jit.c
+++ b/src/gallium/drivers/llvmpipe/lp_jit.c
@@ -166,7 +166,7 @@ lp_jit_screen_init(struct llvmpipe_screen *screen)
if (LLVMCreateJITCompiler(&screen->engine, screen->provider, 1, &error)) {
_debug_printf("%s\n", error);
LLVMDisposeMessage(error);
- abort();
+ assert(0);
}
screen->target = LLVMGetExecutionEngineTargetData(screen->engine);
diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index 48ec5e1..2b6965d 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -620,10 +620,12 @@ generate_fragment(struct llvmpipe_context *lp,
* Translate the LLVM IR into machine code.
*/
+#ifdef DEBUG
if(LLVMVerifyFunction(variant->function, LLVMPrintMessageAction)) {
LLVMDumpValue(variant->function);
- abort();
+ assert(0);
}
+#endif
LLVMRunFunctionPassManager(screen->pass, variant->function);
commit a0907a645f7d832e7c53d14c2ed88080b456a1a5
Author: José Fonseca <jfonseca@vmware.com>
Date: Sun Nov 15 06:46:48 2009 -0800
llvmpipe: Fix memory leak.
diff --git a/src/gallium/drivers/llvmpipe/lp_state_vs.c b/src/gallium/drivers/llvmpipe/lp_state_vs.c
index 0e9bc1d..884e387 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_vs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_vs.c
@@ -96,5 +96,6 @@ llvmpipe_delete_vs_state(struct pipe_context *pipe, void *vs)
(struct lp_vertex_shader *)vs;
draw_delete_vertex_shader(llvmpipe->draw, state->draw_data);
+ FREE( (void *)state->shader.tokens );
FREE( state );
}
commit 1acf7a09e762e6d8a26c8f0d919f5efa6df6e71f
Author: José Fonseca <jfonseca@vmware.com>
Date: Tue Nov 10 17:52:53 2009 -0800
llvmpipe: Use the generic conversion routine for depths.
This allows for z32f depth format to work correctly.
diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index 696657e..48ec5e1 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -147,6 +147,20 @@ generate_depth(LLVMBuilderRef builder,
format_desc = util_format_description(key->zsbuf_format);
assert(format_desc);
+ /*
+ * Depths are expected to be between 0 and 1, even if they are stored in
+ * floats. Setting these bits here will ensure that the lp_build_conv() call
+ * below won't try to unnecessarily clamp the incoming values.
+ */
+ if(src_type.floating) {
+ src_type.sign = FALSE;
+ src_type.norm = TRUE;
+ }
+ else {
+ assert(!src_type.sign);
+ assert(src_type.norm);
+ }
+
/* Pick the depth type. */
dst_type = lp_depth_type(format_desc, src_type.width*src_type.length);
@@ -154,14 +168,11 @@ generate_depth(LLVMBuilderRef builder,
assert(dst_type.width == src_type.width);
assert(dst_type.length == src_type.length);
-#if 1
- src = lp_build_clamped_float_to_unsigned_norm(builder,
- src_type,
- dst_type.width,
- src);
-#else
lp_build_conv(builder, src_type, dst_type, &src, 1, &src, 1);
-#endif
+
+ dst_ptr = LLVMBuildBitCast(builder,
+ dst_ptr,
+ LLVMPointerType(lp_build_vec_type(dst_type), 0), "");
lp_build_depth_test(builder,
&key->depth,
commit 14dc02a1b2c52cf02b7f89885b61f42575834958
Author: José Fonseca <jfonseca@vmware.com>
Date: Tue Nov 10 17:51:06 2009 -0800
llvmpipe: Be more conservative with the supported formats.
We'll likely support much more formats, but doing this allows to run
more testsuites without immediately hit assertion failures.
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
index 87fddbd..190dad0 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -27,6 +27,7 @@
#include "util/u_memory.h"
+#include "util/u_format.h"
#include "pipe/p_defines.h"
#include "pipe/p_screen.h"
@@ -149,17 +150,17 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen,
Reply to: