r300g: fix crash in r300_is_texture_referenced
authorMarek Olšák <maraeo@gmail.com>
Thu, 29 Oct 2009 22:48:59 +0000 (23:48 +0100)
committerJoakim Sindholt <opensource@zhasha.com>
Sat, 31 Oct 2009 06:30:47 +0000 (07:30 +0100)
Also, a subtle fix in emitting a texture state

src/gallium/drivers/r300/r300_context.c
src/gallium/drivers/r300/r300_emit.c

index e45564b54e89456bfdf61bbb007615cceb4d5141..02f201b49adfe33f1ef613650057a627b40a2a96 100644 (file)
@@ -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);
 
index 2a8e4a9f410d03ddfdca470aee12fa26ebb19182..3b0b41e486f94070c1bff00d1c8b4936cb4a6687 100644 (file)
@@ -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);
     }