Mesa (master): svga: move svga_texture() casts/calls in svga_surface_copy()

Brian Paul brianp at kemper.freedesktop.org
Thu Jan 19 23:28:18 UTC 2012


Module: Mesa
Branch: master
Commit: 7f2e12812a2208330ef8704e7c4721ececd2aab3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7f2e12812a2208330ef8704e7c4721ececd2aab3

Author: Brian Paul <brianp at 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 at vmware.com>

---

 src/gallium/drivers/svga/svga_pipe_blit.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

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,
       return;
    }
 
+   stex = svga_texture(src_tex);
+   dtex = svga_texture(dst_tex);
+
 #if 0
    srcsurf = screen->get_tex_surface(screen, src_tex,
                                      src_level, src_box->z, src_box->z,




More information about the mesa-commit mailing list