diff options
author | Charmaine Lee <charmainel@vmware.com> | 2017-08-30 14:26:41 -0700 |
---|---|---|
committer | Andres Gomez <agomez@igalia.com> | 2017-09-06 18:05:10 +0300 |
commit | 018e602dc629dfbda52b5c7711b5867d72ce33c8 (patch) | |
tree | 7007215bf2add90e81517f3464457654e5016a8b | |
parent | 82061efd48c7302c892cd9236b6f4abae54239ce (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: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 2d93b462b4d978b0da417b35a7470e336bc4e783)
[Andres Gomez: resolve trivial conflicts]
Signed-off-by: Andres Gomez <agomez@igalia.com>
Conflicts:
src/mesa/vbo/vbo_minmax_index.c
Squashed with:
vbo: fix build errors on android
incompatible pointer to integer conversion assigning to 'GLintptr' (aka 'int')
from 'const char *' [-Werror,-Wint-conversion]
offset = indices;
^ ~~~~~~~
Fixes: 2d93b462b4d ("vbo: fix offset in minmax cache key")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 0986f686328216fa201769c630372fd4b6f8877a)
-rw-r--r-- | src/mesa/vbo/vbo_minmax_index.c | 8 |
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 0f75a87f3f3..36c573cac0e 100644 --- a/src/mesa/vbo/vbo_minmax_index.c +++ b/src/mesa/vbo/vbo_minmax_index.c @@ -244,6 +244,7 @@ vbo_get_minmax_index(struct gl_context *ctx, const int index_size = vbo_sizeof_ib_type(ib->type); const char *indices; GLuint i; + GLintptr offset = 0; indices = (char *) ib->ptr + prim->start * index_size; if (_mesa_is_bufferobj(ib->obj)) { @@ -253,7 +254,8 @@ vbo_get_minmax_index(struct gl_context *ctx, min_index, max_index)) return; - indices = ctx->Driver.MapBufferRange(ctx, (GLintptr) indices, size, + offset = (GLintptr) indices; + indices = ctx->Driver.MapBufferRange(ctx, offset, size, GL_MAP_READ_BIT, ib->obj, MAP_INTERNAL); } @@ -336,8 +338,8 @@ vbo_get_minmax_index(struct gl_context *ctx, } if (_mesa_is_bufferobj(ib->obj)) { - vbo_minmax_cache_store(ctx, ib->obj, ib->type, prim->start, count, - *min_index, *max_index); + vbo_minmax_cache_store(ctx, ib->obj, ib->type, offset, + count, *min_index, *max_index); ctx->Driver.UnmapBuffer(ctx, ib->obj, MAP_INTERNAL); } } |