zink: add a param to warn_missing_feature() macro

this lets the macro be used more programmatically since the variable
is defined externally

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15778>
This commit is contained in:
Mike Blumenkrantz 2022-04-06 14:30:49 -04:00 committed by Marge Bot
parent b6f99cf378
commit a489b1d936
2 changed files with 5 additions and 4 deletions

View file

@ -128,8 +128,10 @@ zink_create_gfx_pipeline(struct zink_screen *screen,
ms_state.rasterizationSamples = state->rast_samples + 1;
if (state->blend_state) {
ms_state.alphaToCoverageEnable = state->blend_state->alpha_to_coverage;
if (state->blend_state->alpha_to_one && !screen->info.feats.features.alphaToOne)
warn_missing_feature("alphaToOne");
if (state->blend_state->alpha_to_one && !screen->info.feats.features.alphaToOne) {
static bool warned = false;
warn_missing_feature(warned, "alphaToOne");
}
ms_state.alphaToOneEnable = state->blend_state->alpha_to_one;
}
/* "If pSampleMask is NULL, it is treated as if the mask has all bits set to 1."

View file

@ -282,9 +282,8 @@ zink_screen_init_descriptor_funcs(struct zink_screen *screen, bool fallback);
void
zink_stub_function_not_loaded(void);
#define warn_missing_feature(feat) \
#define warn_missing_feature(warned, feat) \
do { \
static bool warned = false; \
if (!warned) { \
mesa_logw("WARNING: Incorrect rendering will happen, " \
"because the Vulkan device doesn't support " \