X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmesa%2Fstate_tracker%2Fst_atom_array.c;h=9b52f97798bc144a6834ad728420dbe41440b288;hb=136c437cea3ebc9541735bb40951128e1210f06b;hp=15f5d1c95ea6b549e71cf2fe5376e58621aea00f;hpb=0ebd0b78c6cf14fa9f9e3d19b1dbd141295814a1;p=mesa.git diff --git a/src/mesa/state_tracker/st_atom_array.c b/src/mesa/state_tracker/st_atom_array.c index 15f5d1c95ea..9b52f97798b 100644 --- a/src/mesa/state_tracker/st_atom_array.c +++ b/src/mesa/state_tracker/st_atom_array.c @@ -1,7 +1,7 @@ /************************************************************************** * - * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. + * Copyright 2007 VMware, Inc. * Copyright 2012 Marek Olšák * All Rights Reserved. * @@ -32,7 +32,7 @@ * Gallium vertex state and binds it. * * Authors: - * Keith Whitwell + * Keith Whitwell * Marek Olšák */ @@ -214,7 +214,8 @@ st_pipe_vertex_format(GLenum type, GLuint size, GLenum format, assert((type >= GL_BYTE && type <= GL_DOUBLE) || type == GL_FIXED || type == GL_HALF_FLOAT || type == GL_INT_2_10_10_10_REV || - type == GL_UNSIGNED_INT_2_10_10_10_REV); + type == GL_UNSIGNED_INT_2_10_10_10_REV || + type == GL_UNSIGNED_INT_10F_11F_11F_REV); assert(size >= 1); assert(size <= 4); assert(format == GL_RGBA || format == GL_BGRA); @@ -251,6 +252,14 @@ st_pipe_vertex_format(GLenum type, GLuint size, GLenum format, } } + if (type == GL_UNSIGNED_INT_10F_11F_11F_REV) { + assert(size == 3); + assert(!integer); + assert(format == GL_RGBA); + + return PIPE_FORMAT_R11G11B10_FLOAT; + } + if (format == GL_BGRA) { /* this is an odd-ball case */ assert(type == GL_UNSIGNED_BYTE); @@ -403,9 +412,9 @@ setup_interleaved_attribs(const struct st_vertex_program *vp, const GLuint mesaAttr = vp->index_to_input[attr]; const struct gl_client_array *array = arrays[mesaAttr]; unsigned src_offset = (unsigned) (array->Ptr - low_addr); - GLuint element_size = array->_ElementSize; - assert(element_size == array->Size * _mesa_sizeof_type(array->Type)); + assert(array->_ElementSize == + _mesa_bytes_per_vertex_attrib(array->Size, array->Type)); velements[attr].src_offset = src_offset; velements[attr].instance_divisor = array->InstanceDivisor; @@ -474,7 +483,8 @@ setup_non_interleaved_attribs(struct st_context *st, struct gl_buffer_object *bufobj = array->BufferObj; GLsizei stride = array->StrideB; - assert(array->_ElementSize == array->Size * _mesa_sizeof_type(array->Type)); + assert(array->_ElementSize == + _mesa_bytes_per_vertex_attrib(array->Size, array->Type)); if (_mesa_is_bufferobj(bufobj)) { /* Attribute data is in a VBO. @@ -588,7 +598,7 @@ static void update_array(struct st_context *st) const struct st_tracked_state st_update_array = { "st_update_array", /* name */ { /* dirty */ - _NEW_BUFFER_OBJECT, /* mesa */ + 0, /* mesa */ ST_NEW_VERTEX_ARRAYS | ST_NEW_VERTEX_PROGRAM, /* st */ }, update_array /* update */