[Mesa-dev] [PATCH 12/13] mesa: reduce the size of gl_texture_image
Marek Olšák
maraeo at gmail.com
Fri Feb 9 15:51:05 UTC 2018
On Fri, Feb 9, 2018 at 2:56 AM, Brian Paul <brian.e.paul at gmail.com> wrote:
> On Thu, Feb 8, 2018 at 6:18 PM, Marek Olšák <maraeo at gmail.com> wrote:
>>
>> From: Marek Olšák <marek.olsak at amd.com>
>>
>> 80 -> 40 bytes.
>> ---
>> src/mesa/main/mtypes.h | 47
>> ++++++++++++++++++++++++-----------------------
>> 1 file changed, 24 insertions(+), 23 deletions(-)
>>
>> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
>> index a589bd4..b619d5c 100644
>> --- a/src/mesa/main/mtypes.h
>> +++ b/src/mesa/main/mtypes.h
>> @@ -958,49 +958,50 @@ typedef enum
>> #define TEXTURE_1D_BIT (1 << TEXTURE_1D_INDEX)
>> /*@}*/
>>
>>
>> /**
>> * Texture image state. Drivers will typically create a subclass of this
>> * with extra fields for memory buffers, etc.
>> */
>> struct gl_texture_image
>> {
>> - GLint InternalFormat; /**< Internal format as given by the user
>> */
>> + struct gl_texture_object *TexObject; /**< Pointer back to parent
>> object */
>> +
>> + GLenum16 InternalFormat; /**< Internal format as given by the user
>> */
>> GLenum16 _BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_ALPHA,
>> - * GL_LUMINANCE, GL_LUMINANCE_ALPHA,
>> - * GL_INTENSITY, GL_DEPTH_COMPONENT or
>> - * GL_DEPTH_STENCIL_EXT only. Used for
>> - * choosing TexEnv arithmetic.
>> - */
>> - mesa_format TexFormat; /**< The actual texture memory format
>> */
>> -
>> - GLuint Border; /**< 0 or 1 */
>> - GLuint Width; /**< = 2^WidthLog2 + 2*Border */
>> - GLuint Height; /**< = 2^HeightLog2 + 2*Border */
>> - GLuint Depth; /**< = 2^DepthLog2 + 2*Border */
>> - GLuint Width2; /**< = Width - 2*Border */
>> - GLuint Height2; /**< = Height - 2*Border */
>> - GLuint Depth2; /**< = Depth - 2*Border */
>> - GLuint WidthLog2; /**< = log2(Width2) */
>> - GLuint HeightLog2; /**< = log2(Height2) */
>> - GLuint DepthLog2; /**< = log2(Depth2) */
>> - GLuint MaxNumLevels; /**< = maximum possible number of
>> mipmap
>> + * GL_LUMINANCE, GL_LUMINANCE_ALPHA,
>> + * GL_INTENSITY, GL_DEPTH_COMPONENT or
>> + * GL_DEPTH_STENCIL_EXT only. Used for
>> + * choosing TexEnv arithmetic.
>> + */
>> + mesa_format TexFormat:16; /**< The actual texture memory format */
>> +
>> + GLushort Width; /**< = 2^WidthLog2 + 2*Border */
>
>
> I don't have time to look right now, but as with pipe_resource::width0, does
> this have to stay GLuint for buffer objects?
Buffer objects don't use gl_texture_image.
There is gl_texture_object::BufferSize.
Marek
More information about the mesa-dev
mailing list