summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCharmaine Lee <[email protected]>2017-08-30 14:26:41 -0700
committerCharmaine Lee <[email protected]>2017-08-30 23:12:21 -0700
commit2d93b462b4d978b0da417b35a7470e336bc4e783 (patch)
tree63f87a06c3f3b788068cac6a29b3404e6d0f71dc /src
parent15b61dec94ceccd66bcbeb8c22c7f2019de7f173 (diff)
vbo: fix offset in minmax cache key
Instead of saving primitive offset in the minmax cache key, save the actual buffer offset which is used in the cache lookup. Fixes rendering artifact seen with GoogleEarth when run with VMware driver. v2: Per Brian's comment, initialize offset to avoid compiler warning. Cc: [email protected] Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/vbo/vbo_minmax_index.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/vbo/vbo_minmax_index.c b/src/mesa/vbo/vbo_minmax_index.c
index 4c17a086628..58a2af49aca 100644
--- a/src/mesa/vbo/vbo_minmax_index.c
+++ b/src/mesa/vbo/vbo_minmax_index.c
@@ -245,6 +245,7 @@ vbo_get_minmax_index(struct gl_context *ctx,
_mesa_primitive_restart_index(ctx, ib->index_size);
const char *indices;
GLuint i;
+ GLintptr offset = 0;
indices = (char *) ib->ptr + prim->start * ib->index_size;
if (_mesa_is_bufferobj(ib->obj)) {
@@ -254,7 +255,8 @@ vbo_get_minmax_index(struct gl_context *ctx,
count, min_index, max_index))
return;
- indices = ctx->Driver.MapBufferRange(ctx, (GLintptr) indices, size,
+ offset = indices;
+ indices = ctx->Driver.MapBufferRange(ctx, offset, size,
GL_MAP_READ_BIT, ib->obj,
MAP_INTERNAL);
}
@@ -337,8 +339,8 @@ vbo_get_minmax_index(struct gl_context *ctx,
}
if (_mesa_is_bufferobj(ib->obj)) {
- vbo_minmax_cache_store(ctx, ib->obj, ib->index_size, prim->start, count,
- *min_index, *max_index);
+ vbo_minmax_cache_store(ctx, ib->obj, ib->index_size, offset,
+ count, *min_index, *max_index);
ctx->Driver.UnmapBuffer(ctx, ib->obj, MAP_INTERNAL);
}
}