[Bug 59608] New: wined3d: D3DRS_ALPHATESTENABLE has no effect on GLES-derived GL drivers (Panfrost) in compat profile — alpha-tested geometry renders opaque
http://bugs.winehq.org/show_bug.cgi?id=59608 Bug ID: 59608 Summary: wined3d: D3DRS_ALPHATESTENABLE has no effect on GLES-derived GL drivers (Panfrost) in compat profile — alpha-tested geometry renders opaque Product: Wine Version: 11.4 Hardware: aarch64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: d3d Assignee: wine-bugs@list.winehq.org Reporter: siordache94@gmail.com Distribution: --- When running a Direct3D 9 application on a GLES-derived OpenGL driver (Mesa Panfrost, Mali-G52) with MESA_GL_VERSION_OVERRIDE=3.1COMPAT, D3DRS_ALPHATESTENABLE render state changes have no visible effect. Alpha-tested geometry (e.g. billboard tree cards using DXT3 textures with alpha) renders as fully opaque solid rectangles instead of having transparent pixels discarded. ### Environment - Wine 11.4 (ARM64, WoW64/Hangover) - Mesa 24.x Panfrost driver (Mali-G52 MP2, RK3566 SoC) - MESA_GL_VERSION_OVERRIDE=3.1COMPAT - UseGLSL=enabled, CSMT=1 - Game: FlatOut (2004, GOG), Direct3D 9 fixed-function + shader ### Expected behavior Pixels with alpha < reference value should be discarded (not drawn), producing cutout shapes for vegetation, fences, etc. ### Actual behavior All pixels render regardless of alpha value. The full billboard quad is visible as a solid black rectangle. The texture data IS loaded correctly (color channels render fine), only the alpha test/discard is missing. ### Root cause analysis Panfrost is a GLES-derived GL driver. It advertises GL 3.1 COMPAT but does NOT implement the fixed-function GL_ALPHA_TEST pipeline in hardware. The glEnable(GL_ALPHA_TEST) + glAlphaFunc() calls silently do nothing. wined3d's GLSL backend has code to emit "discard" in fragment shaders for alpha test, but in compat profile contexts it appears to rely on the driver's fixed-function GL_ALPHA_TEST instead of always using shader-based discard. On desktop GPUs (NVIDIA, AMD, Intel) this works because they implement GL_ALPHA_TEST in hardware. On GLES-derived drivers (Panfrost, Lima, freedreno, v3d, Zink-on-GLES) it silently fails. ### Workaround Embedding explicit ps_2_0 pixel shaders with texkill instructions in the game's .sha effect files forces Wine to compile the discard into the GLSL fragment shader at shader creation time, bypassing the runtime render state path. This confirms the GLSL discard mechanism itself works — the issue is that wined3d doesn't activate it for compat profile contexts. ### Proposed fix wined3d should always use shader-based alpha test (uniform-gated discard) regardless of GL profile, or probe whether GL_ALPHA_TEST actually functions at init time. This would fix alpha test for all GLES-derived Mesa drivers on ARM (Panfrost, Lima, freedreno, v3d) and potentially Zink. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59608 Zeb Figura <z.figura12@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |z.figura12@gmail.com --- Comment #1 from Zeb Figura <z.figura12@gmail.com> --- We can add a quirk for this, but I'd prefer to see this actually fixed upstream. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59608 --- Comment #2 from Zeb Figura <z.figura12@gmail.com> --- Also, I'm not sure it's worth adding a quirk for a non-default configuration? Why are you forcing compatibility mode? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla