mesa/draw: Make sure all the unused fields are initialized to zero
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 19 Feb 2020 00:41:03 +0000 (16:41 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 19 Feb 2020 18:07:47 +0000 (10:07 -0800)
commitd46a5cfe781a1f51a1338d994fb8097d9d579d2e
tree92fd9755aa872e1a597f7629706c44ee9375b6a9
parent6edbb3c6d07a395c3cd0b1b5290ecac3943c4286
mesa/draw: Make sure all the unused fields are initialized to zero

Not initializing prim.indexed caused a few thousand failures on Intel
drivers.

I also compared the generated assembly with this change and before
a6d31589097.  The code is still somewhat improved, which I am assuming
was the original goal. _mesa_DrawArrays, for example, appears to drop an
instruction or two... though the body of the function is only one byte
shorter.

MR !3591 will eventually delete the uninitialized fields.  However, I
believe that explicitly initializing the whole thing is more future
proof.  This ensures that if someone adds fields in the future, they
will also be initialized.  Once the extra fields are removed, the two
implementations should generate idential code.

Fixes: a6d31589097 ("mesa: don't use memset in glDrawArrays")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3870>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3870>
src/mesa/main/draw.c