Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7644>
const struct tgsi_opcode_info *
tgsi_get_opcode_info(enum tgsi_opcode opcode)
{
- static boolean firsttime = 1;
-
ASSERT_BITFIELD_SIZE(struct tgsi_opcode_info, opcode, TGSI_OPCODE_LAST - 1);
ASSERT_BITFIELD_SIZE(struct tgsi_opcode_info, output_mode,
TGSI_OUTPUT_OTHER);
- if (firsttime) {
+ do_once {
unsigned i;
- firsttime = 0;
for (i = 0; i < ARRAY_SIZE(opcode_info); i++)
assert(opcode_info[i].opcode == i);
}