[Mesa-dev] [PATCH] etnaviv: Reset indexed rendering information when not rendering indexed

Wladimir J. van der Laan laanwj at gmail.com
Fri Jul 14 11:26:24 UTC 2017


A dangling bo object would result in memory corruption while
loading a level in ioquake3_opengl2.

Fixes a problem introduced in 330d0607ed60fd3edca192e54b4246310f06652f.
Fix suggested by Lucas Stach.

Signed-off-by: Wladimir J. van der Laan <laanwj at gmail.com>
---
 src/gallium/drivers/etnaviv/etnaviv_context.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/gallium/drivers/etnaviv/etnaviv_context.c b/src/gallium/drivers/etnaviv/etnaviv_context.c
index e759095..3437906 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_context.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_context.c
@@ -198,6 +198,12 @@ etna_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
          BUG("Unsupported or no index buffer");
          return;
       }
+   } else {
+      ctx->index_buffer.FE_INDEX_STREAM_BASE_ADDR.bo = 0;
+      ctx->index_buffer.FE_INDEX_STREAM_BASE_ADDR.offset = 0;
+      ctx->index_buffer.FE_INDEX_STREAM_BASE_ADDR.flags = 0;
+      ctx->index_buffer.FE_INDEX_STREAM_CONTROL = 0;
+      ctx->dirty |= ETNA_DIRTY_INDEX_BUFFER;
    }
 
    struct etna_shader_key key = {};
-- 
2.7.4



More information about the mesa-dev mailing list