mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 06:20:09 +01:00
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 left uninitialized and 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== [...] Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6867>
This commit is contained in:
parent
291cfb1e41
commit
a3363c348d
1 changed files with 4 additions and 4 deletions
|
|
@ -213,10 +213,10 @@ struct pipe_viewport_state
|
|||
{
|
||||
float scale[3];
|
||||
float translate[3];
|
||||
enum pipe_viewport_swizzle swizzle_x:3;
|
||||
enum pipe_viewport_swizzle swizzle_y:3;
|
||||
enum pipe_viewport_swizzle swizzle_z:3;
|
||||
enum pipe_viewport_swizzle swizzle_w:3;
|
||||
enum pipe_viewport_swizzle swizzle_x:8;
|
||||
enum pipe_viewport_swizzle swizzle_y:8;
|
||||
enum pipe_viewport_swizzle swizzle_z:8;
|
||||
enum pipe_viewport_swizzle swizzle_w:8;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue