From 617fdb8818dc3a479e0473c1251c6f631c405ef7 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Tue, 17 Jan 2023 13:33:32 -0800 Subject: [PATCH] zink: Fix validation failure for maxLod < minLod. GL lets you set a silly state, so do something plausible instead of undefined. Cc: mesa-stable Part-of: (cherry picked from commit adf81044d4cb929733ca64ed1fd30725577b0c66) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_context.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index f164b9f8340..6f5cc02adcb 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -805,7 +805,7 @@ "description": "zink: Fix validation failure for maxLod < minLod.", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 650717c374c..0cbb0ccadba 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -369,7 +369,7 @@ zink_create_sampler_state(struct pipe_context *pctx, } else if (state->min_mip_filter != PIPE_TEX_MIPFILTER_NONE) { sci.mipmapMode = sampler_mipmap_mode(state->min_mip_filter); sci.minLod = state->min_lod; - sci.maxLod = state->max_lod; + sci.maxLod = MAX2(state->max_lod, state->min_lod); } else { sci.mipmapMode = VK_SAMPLER_MIPMAP_MODE_NEAREST; sci.minLod = 0;