[Mesa-dev] [PATCH 11/20] mesa: reduce the size of gl_vertex_array_object

Marek Olšák maraeo at gmail.com
Mon Dec 11 17:18:39 UTC 2017


On Wed, Nov 22, 2017 at 11:10 PM, Ian Romanick <idr at freedesktop.org> wrote:
> On 11/21/2017 10:01 AM, Marek Olšák wrote:
>> From: Marek Olšák <marek.olsak at amd.com>
>>
>> RelativeOffset should actually be uint, not intptr,
>> according to ARB_vertex_attrib_binding.
>>
>> gl_vertex_array_object: 3632 -> 3112 bytes
>> ---
>>  src/mesa/main/mtypes.h | 17 ++++++++---------
>>  1 file changed, 8 insertions(+), 9 deletions(-)
>>
>> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
>> index 6ddef05..773fa57 100644
>> --- a/src/mesa/main/mtypes.h
>> +++ b/src/mesa/main/mtypes.h
>> @@ -1492,32 +1492,33 @@ struct gl_vertex_array
>>   *
>>   * Note that the Stride field corresponds to VERTEX_ATTRIB_ARRAY_STRIDE
>>   * and is only present for backwards compatibility reasons.
>>   * Rendering always uses VERTEX_BINDING_STRIDE.
>>   * The gl*Pointer() functions will set VERTEX_ATTRIB_ARRAY_STRIDE
>>   * and VERTEX_BINDING_STRIDE to the same value, while
>>   * glBindVertexBuffer() will only set VERTEX_BINDING_STRIDE.
>>   */
>>  struct gl_array_attributes
>>  {
>> -   GLint Size;              /**< Components per element (1,2,3,4) */
>> +   GLuint RelativeOffset; /**< Offset of the first element relative to the binding offset */
>                             ^
> More spaces before the comment.
>
>>     GLenum16 Type;           /**< Datatype: GL_FLOAT, GL_INT, etc */
>>     GLenum16 Format;         /**< Default: GL_RGBA, but may be GL_BGRA */
>> -   GLsizei Stride;          /**< Stride as specified with gl*Pointer() */
>> -   const GLubyte *Ptr;      /**< Points to client array data. Not used when a VBO is bound */
>> -   GLintptr RelativeOffset; /**< Offset of the first element relative to the binding offset */
>> +   GLshort Stride;          /**< Stride as specified with gl*Pointer() */
>> +   GLubyte Size;            /**< Components per element (1,2,3,4) */
>>     GLboolean Enabled;       /**< Whether the array is enabled */
>>     GLboolean Normalized;    /**< Fixed-point values are normalized when converted to floats */
>>     GLboolean Integer;       /**< Fixed-point values are not converted to floats */
>>     GLboolean Doubles;       /**< double precision values are not converted to floats */
>>     GLuint _ElementSize;     /**< Size of each element in bytes */
>>     GLuint BufferBindingIndex;    /**< Vertex buffer binding */
>
> Do these two fields need to be 32-bits?

No. I'll change them to GLubyte.

Marek


More information about the mesa-dev mailing list