Skip to content

gallium: Make pipe_viewport_state swizzle_x/y/z/w bit-fields 8 bits wide

Previously there were 20 padding bits after them, which would be preserved when writing to the swizzle members. This could result in two equal viewport states spuriously being considered different (because memcmp compared the padding bits as well).

Noticed while looking for something else with valgrind:

==801624== Conditional jump or move depends on uninitialised value(s)
==801624==    at 0x10B86259: cso_set_viewport (cso_context.c:739)
==801624==    by 0x10B862C7: cso_set_viewport_dims (cso_context.c:764)
==801624==    by 0x1057E3A1: clear_with_quad (st_cb_clear.c:335)
==801624==    by 0x1057E3A1: st_Clear (st_cb_clear.c:545)
==801624==    [...]
==801624==
==801624== Conditional jump or move depends on uninitialised value(s)
==801624==    at 0x10B885DE: cso_restore_viewport (cso_context.c:777)
==801624==    by 0x10B885DE: cso_restore_state (cso_context.c:1710)
==801624==    by 0x1057E4CB: clear_with_quad (st_cb_clear.c:364)
==801624==    by 0x1057E4CB: st_Clear (st_cb_clear.c:545)
==801624==    [...]

Merge request reports