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

Author: Marek Olšák <[email protected]>
Date:   Thu Oct 29 23:48:59 2009 +0100

r300g: fix crash in r300_is_texture_referenced

Also, a subtle fix in emitting a texture state

---

 src/gallium/drivers/r300/r300_context.c |    2 +-
 src/gallium/drivers/r300/r300_emit.c    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_context.c 
b/src/gallium/drivers/r300/r300_context.c
index e45564b..02f201b 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -80,7 +80,7 @@ r300_is_texture_referenced(struct pipe_context *pipe,
                            struct pipe_texture *texture,
                            unsigned face, unsigned level)
 {
-    struct pipe_buffer* buf;
+    struct pipe_buffer* buf = 0;
 
     r300_get_texture_buffer(texture, &buf, NULL);
 
diff --git a/src/gallium/drivers/r300/r300_emit.c 
b/src/gallium/drivers/r300/r300_emit.c
index 2a8e4a9..3b0b41e 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -540,7 +540,7 @@ void r300_emit_texture(struct r300_context* r300,
     CS_LOCALS(r300);
 
     /* to emulate 1D textures through 2D ones correctly */
-    if (tex->tex.height[0] == 1) {
+    if (tex->tex.target == PIPE_TEXTURE_1D) {
         filter0 &= ~R300_TX_WRAP_T_MASK;
         filter0 |= R300_TX_WRAP_T(R300_TX_CLAMP_TO_EDGE);
     }

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to