diff options
author | Dave Airlie <[email protected]> | 2018-06-28 12:40:20 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2018-06-30 08:38:33 +1000 |
commit | 98d02104a7e7b6d57a42b7d648649c5148955a68 (patch) | |
tree | 8fd213778278b53d682be28e26b0a39e51d26301 /src/mesa/vbo/vbo_save_draw.c | |
parent | d2caa377416de12964b5763ad333f21622d11360 (diff) |
vbo_save: add support for doubles to display list code
Required for ARB_vertex_attrib_64bit compat profile support.
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/vbo/vbo_save_draw.c')
-rw-r--r-- | src/mesa/vbo/vbo_save_draw.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c index 71620e9a3cd..409a353b520 100644 --- a/src/mesa/vbo/vbo_save_draw.c +++ b/src/mesa/vbo/vbo_save_draw.c @@ -54,16 +54,24 @@ copy_vao(struct gl_context *ctx, const struct gl_vertex_array_object *vao, struct gl_array_attributes *currval = &vbo->current[shift + i]; const GLubyte size = attrib->Size; const GLenum16 type = attrib->Type; - fi_type tmp[4]; + fi_type tmp[8]; + int dmul = 1; - COPY_CLEAN_4V_TYPE_AS_UNION(tmp, size, *data, type); + if (type == GL_DOUBLE || + type == GL_UNSIGNED_INT64_ARB) + dmul = 2; + + if (dmul == 2) + memcpy(tmp, *data, size * dmul * sizeof(GLfloat)); + else + COPY_CLEAN_4V_TYPE_AS_UNION(tmp, size, *data, type); if (type != currval->Type || - memcmp(currval->Ptr, tmp, 4 * sizeof(GLfloat)) != 0) { - memcpy((fi_type*)currval->Ptr, tmp, 4 * sizeof(GLfloat)); + memcmp(currval->Ptr, tmp, 4 * sizeof(GLfloat) * dmul) != 0) { + memcpy((fi_type*)currval->Ptr, tmp, 4 * sizeof(GLfloat) * dmul); currval->Size = size; - currval->_ElementSize = size * sizeof(GLfloat); + currval->_ElementSize = size * sizeof(GLfloat) * dmul; currval->Type = type; currval->Integer = vbo_attrtype_to_integer_flag(type); currval->Doubles = vbo_attrtype_to_double_flag(type); |