The game expects HLSL discard behavour
But it fails only on Zink because GLSL discard translates to
nir_intrinsic_discard (BRW_PREDICATE_ALIGN1_ANY4H in native Intel asm)
but Zink replaces it with OpTerminateInvocation SPIR-V and it translates to
nir_intrinsic_terminate (BRW_PREDICATE_NORMAL in native Intel asm)
Bisected commit in ZINK:
bd816084
On AMD it works because they enabled the
glsl_correct_derivatives_after_discard by default: !10522 (
17861aff)
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9205
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Illia Polishchuk <illia.a.polishchuk@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23694>
<option name="mesa_glthread_app_profile" value="0"/>
</application>
+ <application name="Borderlands 2 (Native, OpenGL, 32bit)" executable="Borderlands2">
+ <!-- https://gitlab.freedesktop.org/mesa/mesa/-/issues/9205 -->
+ <option name="glsl_correct_derivatives_after_discard" value="true" />
+ </application>
+
<!-- GL_POINT_SMOOTH is used in Quake II to render particles -->
<application name="Quake II" executable="quake2-engine">
<option name="zink_emulate_point_smooth" value="true"/>