[Mesa-dev] [PATCH 09/13] mesa: reduce the size of gl_viewport_attrib

Marek Olšák maraeo at gmail.com
Fri Feb 9 01:18:44 UTC 2018


From: Marek Olšák <marek.olsak at amd.com>

All drivers convert these to float, so there is no reason to use double.
The piglit test that expects double precision from glGet will be adjusted
not to require it (there is a piglit patch).

gl_context::ViewportArray: 512 -> 384 bytes
---
 src/mesa/drivers/common/meta.h | 2 +-
 src/mesa/main/mtypes.h         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/common/meta.h b/src/mesa/drivers/common/meta.h
index 1c35ea3..dbe8a9a 100644
--- a/src/mesa/drivers/common/meta.h
+++ b/src/mesa/drivers/common/meta.h
@@ -151,21 +151,21 @@ struct save_state
    /** mask of TEXTURE_2D_BIT, etc */
    GLbitfield TexEnabled[MAX_TEXTURE_UNITS];
    GLbitfield TexGenEnabled[MAX_TEXTURE_UNITS];
    GLuint EnvMode;  /* unit[0] only */
 
    /** MESA_META_VERTEX */
    struct gl_vertex_array_object *VAO;
 
    /** MESA_META_VIEWPORT */
    GLfloat ViewportX, ViewportY, ViewportW, ViewportH;
-   GLclampd DepthNear, DepthFar;
+   GLclampf DepthNear, DepthFar;
 
    /** MESA_META_CLAMP_FRAGMENT_COLOR */
    GLenum ClampFragmentColor;
 
    /** MESA_META_CLAMP_VERTEX_COLOR */
    GLenum ClampVertexColor;
 
    /** MESA_META_CONDITIONAL_RENDER */
    struct gl_query_object *CondRenderQuery;
    GLenum CondRenderMode;
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index d8cb8f8..a589bd4 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1400,21 +1400,21 @@ struct gl_transform_attrib
 };
 
 
 /**
  * Viewport attribute group (GL_VIEWPORT_BIT).
  */
 struct gl_viewport_attrib
 {
    GLfloat X, Y;		/**< position */
    GLfloat Width, Height;	/**< size */
-   GLdouble Near, Far;		/**< Depth buffer range */
+   GLfloat Near, Far;		/**< Depth buffer range */
 };
 
 
 typedef enum
 {
    MAP_USER,
    MAP_INTERNAL,
    MAP_COUNT
 } gl_map_buffer_index;
 
-- 
2.7.4



More information about the mesa-dev mailing list