aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/vbo
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2015-02-22 21:39:56 +0100
committermarha <marha@users.sourceforge.net>2015-02-22 21:39:56 +0100
commit462f18c7b25fe3e467f837647d07ab0a78aa8d2b (patch)
treefc8013c0a1bac05a1945846c1697e973f4c35013 /mesalib/src/mesa/vbo
parent36f711ee12b6dd5184198abed3aa551efb585587 (diff)
downloadvcxsrv-462f18c7b25fe3e467f837647d07ab0a78aa8d2b.tar.gz
vcxsrv-462f18c7b25fe3e467f837647d07ab0a78aa8d2b.tar.bz2
vcxsrv-462f18c7b25fe3e467f837647d07ab0a78aa8d2b.zip
Merged origin/release (checked in because wanted to merge new stuff)
Diffstat (limited to 'mesalib/src/mesa/vbo')
-rw-r--r--mesalib/src/mesa/vbo/vbo_attrib_tmp.h1
-rw-r--r--mesalib/src/mesa/vbo/vbo_exec_array.c29
-rw-r--r--mesalib/src/mesa/vbo/vbo_save_api.c17
3 files changed, 28 insertions, 19 deletions
diff --git a/mesalib/src/mesa/vbo/vbo_attrib_tmp.h b/mesalib/src/mesa/vbo/vbo_attrib_tmp.h
index ec66934fc..0c44540fc 100644
--- a/mesalib/src/mesa/vbo/vbo_attrib_tmp.h
+++ b/mesalib/src/mesa/vbo/vbo_attrib_tmp.h
@@ -210,6 +210,7 @@ static inline float conv_i2_to_norm_float(const struct gl_context *ctx, int i2)
} \
} else if ((type) == GL_UNSIGNED_INT_10F_11F_11F_REV) { \
float res[4]; \
+ res[3] = 1; \
r11g11b10f_to_float3((arg), res); \
ATTR##val##FV((attr), res); \
} else \
diff --git a/mesalib/src/mesa/vbo/vbo_exec_array.c b/mesalib/src/mesa/vbo/vbo_exec_array.c
index e623b361a..c16fe77ee 100644
--- a/mesalib/src/mesa/vbo/vbo_exec_array.c
+++ b/mesalib/src/mesa/vbo/vbo_exec_array.c
@@ -300,7 +300,8 @@ check_draw_elements_data(struct gl_context *ctx, GLsizei count, GLenum elemType,
{
struct gl_vertex_array_object *vao = ctx->Array.VAO;
const void *elemMap;
- GLint i, k;
+ GLint i;
+ GLuint k;
if (_mesa_is_bufferobj(ctx->Array.VAO->IndexBufferObj)) {
elemMap = ctx->Driver.MapBufferRange(ctx, 0,
@@ -596,7 +597,8 @@ vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start,
prim[0].is_indirect = 0;
/* Implement the primitive restart index */
- if (ctx->Array.PrimitiveRestart && ctx->Array.RestartIndex < count) {
+ if (ctx->Array.PrimitiveRestart && !ctx->Array.PrimitiveRestartFixedIndex &&
+ ctx->Array.RestartIndex < count) {
GLuint primCount = 0;
if (ctx->Array.RestartIndex == start) {
@@ -786,7 +788,7 @@ vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count)
_mesa_debug(ctx, "glDrawArrays(%s, %d, %d)\n",
_mesa_lookup_enum_by_nr(mode), start, count);
- if (!_mesa_validate_DrawArrays( ctx, mode, start, count ))
+ if (!_mesa_validate_DrawArrays(ctx, mode, count))
return;
if (0)
@@ -1022,8 +1024,8 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode,
_mesa_lookup_enum_by_nr(mode), start, end, count,
_mesa_lookup_enum_by_nr(type), indices, basevertex);
- if (!_mesa_validate_DrawRangeElements( ctx, mode, start, end, count,
- type, indices, basevertex ))
+ if (!_mesa_validate_DrawRangeElements(ctx, mode, start, end, count,
+ type, indices))
return;
if ((int) end + basevertex < 0 ||
@@ -1120,7 +1122,7 @@ vbo_exec_DrawElements(GLenum mode, GLsizei count, GLenum type,
_mesa_lookup_enum_by_nr(mode), count,
_mesa_lookup_enum_by_nr(type), indices);
- if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices, 0 ))
+ if (!_mesa_validate_DrawElements(ctx, mode, count, type, indices))
return;
vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0,
@@ -1142,8 +1144,7 @@ vbo_exec_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
_mesa_lookup_enum_by_nr(mode), count,
_mesa_lookup_enum_by_nr(type), indices, basevertex);
- if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices,
- basevertex ))
+ if (!_mesa_validate_DrawElements(ctx, mode, count, type, indices))
return;
vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0,
@@ -1166,7 +1167,7 @@ vbo_exec_DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type,
_mesa_lookup_enum_by_nr(type), indices, numInstances);
if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type, indices,
- numInstances, 0))
+ numInstances))
return;
vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0,
@@ -1191,7 +1192,7 @@ vbo_exec_DrawElementsInstancedBaseVertex(GLenum mode, GLsizei count, GLenum type
numInstances, basevertex);
if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type, indices,
- numInstances, basevertex))
+ numInstances))
return;
vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0,
@@ -1216,7 +1217,7 @@ vbo_exec_DrawElementsInstancedBaseInstance(GLenum mode, GLsizei count, GLenum ty
numInstances, baseInstance);
if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type, indices,
- numInstances, 0))
+ numInstances))
return;
vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0,
@@ -1242,7 +1243,7 @@ vbo_exec_DrawElementsInstancedBaseVertexBaseInstance(GLenum mode, GLsizei count,
numInstances, basevertex, baseInstance);
if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type, indices,
- numInstances, basevertex))
+ numInstances))
return;
vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0,
@@ -1399,7 +1400,7 @@ vbo_exec_MultiDrawElements(GLenum mode,
GET_CURRENT_CONTEXT(ctx);
if (!_mesa_validate_MultiDrawElements(ctx, mode, count, type, indices,
- primcount, NULL))
+ primcount))
return;
vbo_validated_multidrawelements(ctx, mode, count, type, indices, primcount,
@@ -1417,7 +1418,7 @@ vbo_exec_MultiDrawElementsBaseVertex(GLenum mode,
GET_CURRENT_CONTEXT(ctx);
if (!_mesa_validate_MultiDrawElements(ctx, mode, count, type, indices,
- primcount, basevertex))
+ primcount))
return;
vbo_validated_multidrawelements(ctx, mode, count, type, indices, primcount,
diff --git a/mesalib/src/mesa/vbo/vbo_save_api.c b/mesalib/src/mesa/vbo/vbo_save_api.c
index 848eedaa4..beef342be 100644
--- a/mesalib/src/mesa/vbo/vbo_save_api.c
+++ b/mesalib/src/mesa/vbo/vbo_save_api.c
@@ -375,11 +375,14 @@ _save_compile_vertex_list(struct gl_context *ctx)
* being compiled.
*/
node = (struct vbo_save_vertex_list *)
- _mesa_dlist_alloc(ctx, save->opcode_vertex_list, sizeof(*node));
+ _mesa_dlist_alloc_aligned(ctx, save->opcode_vertex_list, sizeof(*node));
if (!node)
return;
+ /* Make sure the pointer is aligned to the size of a pointer */
+ assert((GLintptr) node % sizeof(void *) == 0);
+
/* Duplicate our template, increment refcounts to the storage structs:
*/
memcpy(node->attrsz, save->attrsz, sizeof(node->attrsz));
@@ -1523,18 +1526,22 @@ vbo_destroy_vertex_list(struct gl_context *ctx, void *data)
static void
-vbo_print_vertex_list(struct gl_context *ctx, void *data)
+vbo_print_vertex_list(struct gl_context *ctx, void *data, FILE *f)
{
struct vbo_save_vertex_list *node = (struct vbo_save_vertex_list *) data;
GLuint i;
+ struct gl_buffer_object *buffer = node->vertex_store ?
+ node->vertex_store->bufferobj : NULL;
(void) ctx;
- printf("VBO-VERTEX-LIST, %u vertices %d primitives, %d vertsize\n",
- node->count, node->prim_count, node->vertex_size);
+ fprintf(f, "VBO-VERTEX-LIST, %u vertices %d primitives, %d vertsize "
+ "buffer %p\n",
+ node->count, node->prim_count, node->vertex_size,
+ buffer);
for (i = 0; i < node->prim_count; i++) {
struct _mesa_prim *prim = &node->prim[i];
- printf(" prim %d: %s%s %d..%d %s %s\n",
+ fprintf(f, " prim %d: %s%s %d..%d %s %s\n",
i,
_mesa_lookup_prim_by_nr(prim->mode),
prim->weak ? " (weak)" : "",