* @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"
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:
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: