[Mesa-dev] [PATCH 54/56] i965: pad out brw_stage_prog_data pointers to 64bits

Timothy Arceri timothy.arceri at collabora.com
Tue Nov 29 03:58:53 UTC 2016


In order for this struct to have the same size on 64bit and 32bit
platforms we uses unions to make sure the pointers always take up
at least 64bits. This is useful for making sure we always write
the same size data to disk in the shader cache.
---
 src/mesa/drivers/dri/i965/brw_compiler.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_compiler.h b/src/mesa/drivers/dri/i965/brw_compiler.h
index 6e234bf..002aaeb 100644
--- a/src/mesa/drivers/dri/i965/brw_compiler.h
+++ b/src/mesa/drivers/dri/i965/brw_compiler.h
@@ -363,11 +363,11 @@ struct brw_stage_prog_data {
    /* Pointers to tracked values (only valid once
     * _mesa_load_state_parameters has been called at runtime).
     */
-   const union gl_constant_value **param;
-   const union gl_constant_value **pull_param;
+   union { const union gl_constant_value **param; uint64_t pv; };
+   union { const union gl_constant_value **pull_param; uint64_t ppv; };
 
    /** Image metadata passed to the shader as uniforms. */
-   struct brw_image_param *image_param;
+   union { struct brw_image_param *image_param; uint64_t ipv; };
 };
 
 /* Data about a particular attempt to compile a program.  Note that
-- 
2.7.4



More information about the mesa-dev mailing list