mesa/st: add PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_FREEDRENO

this is for drivers (like freedreno) which need the format in the sampler
state in order to accurately handle border colors

when set, drivers MAY receive a format in the sampler state if the frontend
supports it (e.g., nine does not), and the cso sampler cache will include
the format member of the struct

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17189>
This commit is contained in:
Mike Blumenkrantz
2022-06-22 09:14:51 -04:00
committed by Marge Bot
parent ad0ee7ad42
commit c4e18cd4dd
8 changed files with 57 additions and 19 deletions

View File

@@ -128,6 +128,9 @@ st_convert_sampler(const struct st_context *st,
} else {
st_translate_color(&sampler->border_color,
texBaseFormat, is_integer);
if (st->use_format_with_border_color)
sampler->border_color_format = st_get_sampler_view_format(st, texobj,
msamp->Attrib.sRGBDecode == GL_SKIP_DECODE_EXT);
}
sampler->border_color_is_integer = is_integer;
}