panfrost: Use nir_foreach_variable_with_modes in pan_compile
[mesa.git] / src / gallium / drivers / svga / svgadump / svga_shader_dump.c
index 705ca29e8f501b34d1ba48bd95f2bc00f4f6d27d..55bcdb8e253b92211b08a44c1a102e13cce4a4f5 100644 (file)
@@ -30,6 +30,9 @@
  * @author Michal Krol <michal@vmware.com>
  */
 
+#include <assert.h>
+#include <string.h>
+
 #include "svga_shader.h"
 #include "svga_shader_dump.h"
 #include "svga_shader_op.h"
@@ -284,6 +287,9 @@ dump_sampleinfo(struct sh_sampleinfo sampleinfo)
    case SVGA3DSAMP_2D:
       _debug_printf( "_2d" );
       break;
+   case SVGA3DSAMP_2D_SHADOW:
+      _debug_printf( "_2dshadow" );
+      break;
    case SVGA3DSAMP_CUBE:
       _debug_printf( "_cube" );
       break;
@@ -360,7 +366,9 @@ dump_dstreg(struct sh_dstreg dstreg,
    union {
       struct sh_reg reg;
       struct sh_dstreg dstreg;
-   } u = { { 0 } };
+   } u;
+
+   memset(&u, 0, sizeof(u));
 
    assert( (dstreg.modifier & (SVGA3DDSTMOD_SATURATE | SVGA3DDSTMOD_PARTIALPRECISION)) == dstreg.modifier );
 
@@ -411,6 +419,11 @@ dump_dstreg(struct sh_dstreg dstreg,
 
 static void dump_srcreg( struct sh_srcreg srcreg, struct sh_srcreg *indreg, const struct dump_info *di )
 {
+   struct sh_reg srcreg_sh = {0};
+   /* bit-fields carefully aligned, ensure they stay that way. */
+   STATIC_ASSERT(sizeof(struct sh_reg) == sizeof(struct sh_srcreg));
+   memcpy(&srcreg_sh, &srcreg, sizeof(srcreg_sh));
+
    switch (srcreg.modifier) {
    case SVGA3DSRCMOD_NEG:
    case SVGA3DSRCMOD_BIASNEG:
@@ -425,7 +438,7 @@ static void dump_srcreg( struct sh_srcreg srcreg, struct sh_srcreg *indreg, cons
    case SVGA3DSRCMOD_NOT:
       _debug_printf( "!" );
    }
-   dump_reg( *(struct sh_reg *) &srcreg, indreg, di );
+   dump_reg(srcreg_sh, indreg, di );
    switch (srcreg.modifier) {
    case SVGA3DSRCMOD_NONE:
    case SVGA3DSRCMOD_NEG: