spirv: Workaround for RelaxedPrecision on OpLogical* in 3DMark

Per spec RelaxedPrecision cannot be applied to bool types, however
3DMark Wild Life does it:

OpDecorate %171 RelaxedPrecision
...
%171 = OpLogicalAnd %bool %169 %170

Fixes crash in 3DMark Wild Life on Android.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16746>
This commit is contained in:
Danylo Piliaiev 2022-05-27 15:11:52 +03:00 committed by Marge Bot
parent c21dfe3348
commit eb5f4c2f6b
1 changed files with 5 additions and 0 deletions

View File

@ -165,6 +165,11 @@ vtn_mediump_downconvert(struct vtn_builder *b, enum glsl_base_type base_type, ni
case GLSL_TYPE_INT:
case GLSL_TYPE_UINT:
return nir_i2imp(&b->nb, def);
/* Workaround for 3DMark Wild Life which has RelaxedPrecision on
* OpLogical* operations (which is forbidden by spec).
*/
case GLSL_TYPE_BOOL:
return def;
default:
unreachable("bad relaxed precision input type");
}