summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo/vbo_exec_api.c
diff options
context:
space:
mode:
authorMathias Fröhlich <[email protected]>2018-11-17 07:13:11 +0100
committerMathias Fröhlich <[email protected]>2018-11-21 06:27:19 +0100
commit0a7020b4e60ef69e0e4b38aee31bfce385e594d8 (patch)
tree64e68add5e2e22579c6ef715707c1dd99c1ecde1 /src/mesa/vbo/vbo_exec_api.c
parent2da7b0a2fbf0dbc5e89f19622cf3bbfa346ed0f1 (diff)
mesa: Factor out struct gl_vertex_format.
Factor out struct gl_vertex_format from array attributes. The data type is supposed to describe the type of a vertex element. At this current stage the data type is only used with the VAO, but actually is useful in various other places. Due to the bitfields being used, special care needs to be taken for the glGet code paths. v2: Change unsigned char -> GLubyte. Use struct assignment for struct gl_vertex_format. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
Diffstat (limited to 'src/mesa/vbo/vbo_exec_api.c')
-rw-r--r--src/mesa/vbo/vbo_exec_api.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index e46922ef859..749a5ebe65a 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -195,7 +195,7 @@ vbo_exec_copy_to_current(struct vbo_exec_context *exec)
exec->vtx.attrtype[i]);
}
- if (exec->vtx.attrtype[i] != vbo->current[i].Type ||
+ if (exec->vtx.attrtype[i] != vbo->current[i].Format.Type ||
memcmp(current, tmp, 4 * sizeof(GLfloat) * dmul) != 0) {
memcpy(current, tmp, 4 * sizeof(GLfloat) * dmul);
@@ -205,14 +205,9 @@ vbo_exec_copy_to_current(struct vbo_exec_context *exec)
* directly.
*/
/* Size here is in components - not bytes */
- vbo->current[i].Size = exec->vtx.attrsz[i] / dmul;
- vbo->current[i]._ElementSize =
- vbo->current[i].Size * sizeof(GLfloat) * dmul;
- vbo->current[i].Type = exec->vtx.attrtype[i];
- vbo->current[i].Integer =
- vbo_attrtype_to_integer_flag(exec->vtx.attrtype[i]);
- vbo->current[i].Doubles =
- vbo_attrtype_to_double_flag(exec->vtx.attrtype[i]);
+ vbo_set_vertex_format(&vbo->current[i].Format,
+ exec->vtx.attrsz[i] / dmul,
+ exec->vtx.attrtype[i]);
/* This triggers rather too much recalculation of Mesa state
* that doesn't get used (eg light positions).