panfrost: Don't saturate in Bifrost blend shaders
It's unnecessary since the hardware already does the conversion for us. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17841>
This commit is contained in:
committed by
Marge Bot
parent
b1c9c924c7
commit
08746d7b52
@@ -681,13 +681,18 @@ GENX(pan_blend_create_shader)(const struct panfrost_device *dev,
|
||||
|
||||
nir_ssa_def *s_src[] = {nir_load_var(&b, c_src), nir_load_var(&b, c_src1)};
|
||||
|
||||
/* Saturate integer conversions */
|
||||
/* On Midgard, the blend shader is responsible for format conversion.
|
||||
* As the OpenGL spec requires integer conversions to saturate, we must
|
||||
* saturate ourselves here. On Bifrost and later, the conversion
|
||||
* hardware handles this automatically.
|
||||
*/
|
||||
for (int i = 0; i < ARRAY_SIZE(s_src); ++i) {
|
||||
nir_alu_type T = nir_alu_type_get_base_type(nir_type);
|
||||
bool should_saturate = (PAN_ARCH <= 5) && (T != nir_type_float);
|
||||
s_src[i] = nir_convert_with_rounding(&b, s_src[i],
|
||||
src_types[i], nir_type,
|
||||
nir_rounding_mode_undef,
|
||||
T != nir_type_float);
|
||||
should_saturate);
|
||||
}
|
||||
|
||||
/* Build a trivial blend shader */
|
||||
|
||||
Reference in New Issue
Block a user