lavapipe: make OPT macro MSVC compatible

This macros is ugly, make it uglier but msvc compatible.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9120>
This commit is contained in:
Dave Airlie
2021-02-17 17:10:28 -08:00
committed by Marge Bot
parent 0bd707ba17
commit 368c804383

View File

@@ -437,13 +437,11 @@ shared_var_info(const struct glsl_type *type, unsigned *size, unsigned *align)
*align = comp_size; *align = comp_size;
} }
#define OPT(pass, ...) ({ \ #define OPT(pass, ...) do { \
bool this_progress = false; \ bool this_progress = false; \
NIR_PASS(this_progress, nir, pass, ##__VA_ARGS__); \ NIR_PASS(this_progress, nir, pass, ##__VA_ARGS__); \
if (this_progress) \ progress |= this_progress; \
progress = true; \ } while(0)
this_progress; \
})
static void static void
lvp_shader_compile_to_ir(struct lvp_pipeline *pipeline, lvp_shader_compile_to_ir(struct lvp_pipeline *pipeline,
@@ -587,11 +585,11 @@ lvp_shader_compile_to_ir(struct lvp_pipeline *pipeline,
do { do {
progress = false; progress = false;
progress |= OPT(nir_lower_flrp, 32|64, true); OPT(nir_lower_flrp, 32|64, true);
progress |= OPT(nir_split_array_vars, nir_var_function_temp); OPT(nir_split_array_vars, nir_var_function_temp);
progress |= OPT(nir_shrink_vec_array_vars, nir_var_function_temp); OPT(nir_shrink_vec_array_vars, nir_var_function_temp);
progress |= OPT(nir_opt_deref); OPT(nir_opt_deref);
progress |= OPT(nir_lower_vars_to_ssa); OPT(nir_lower_vars_to_ssa);
progress |= nir_copy_prop(nir); progress |= nir_copy_prop(nir);
progress |= nir_opt_dce(nir); progress |= nir_opt_dce(nir);