radeonsi: use #pragma pack to pack si_shader_key
[mesa.git] / src / gallium / drivers / radeonsi / si_shader.h
index 185bb8d62519be99d24e23f55fa8de87562d414c..64321265cf9181c58d41fd95aa829b7ff1804156 100644 (file)
@@ -378,6 +378,11 @@ struct si_shader_selector {
  * -> = merged with the next stage
  */
 
+/* Use the byte alignment for all following structure members for optimal
+ * shader key memory footprint.
+ */
+#pragma pack(push, 1)
+
 /* Common VS bits between the shader key and the prolog key. */
 struct si_vs_prolog_bits {
        unsigned        instance_divisors[SI_MAX_ATTRIBS];
@@ -514,6 +519,9 @@ struct si_shader_key {
        } opt;
 };
 
+/* Restore the pack alignment to default. */
+#pragma pack(pop)
+
 struct si_shader_config {
        unsigned                        num_sgprs;
        unsigned                        num_vgprs;