-
Notifications
You must be signed in to change notification settings - Fork 277
FS hack fixes for Descent 3 #211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: proton_9.0
Are you sure you want to change the base?
FS hack fixes for Descent 3 #211
Conversation
@gofman Gentle ping |
Descent 3's OpenGL renderer will use a texture conflicting with the FS hack texture, and only a small rectangle in the bottom left corner will be rendered. Signed-off-by: John Brooks <[email protected]>
17c2f99
to
1373481
Compare
Some applications use depth testing but leave the image format depth component set to 0. OpenGL drivers always provide a depth buffer for framebuffers regardless of whether the image format specifies one, so the FS hack texture should too, otherwise such applications will render incorrectly. Signed-off-by: John Brooks <[email protected]>
Are you sure about that? There are certainly GLX visuals without depth buffers. Why do we get 0 GLX_DEPTH_SIZE then? I suspect that maybe something else is wrong, just e. g., the game does something which we do not handle in fshack or maybe wrong GL format is chosen at once. Does it work with Wine without fshack? Then, skipping |
Descent 3's OpenGL renderer will use a texture conflicting with the FS hack texture, and only a small rectangle in the bottom left corner will be rendered. Signed-off-by: John Brooks <[email protected]> #211 CW-Bug-Id: #23791
So I took a look at the second issue with depth buffer. On an AMD machine I could see rendering glitches related to Z testing in the first (Pilot Training) mission when moving left from initial position. That is not related to fshack, the game works with upstream Wine and shows the same. Indeed, the game calls ChoosePixelFormat() without explicitly requesting depth bits in PIXELFORMATDESCRIPTOR. That happens to have depth on one Nvidia machine with Wine / Proton here, but not on AMD. On the same AMD machine the same ChoosePixelFormat ends up with 32 / 8 depth / stencil on Windows 11. Frankly I am not sure that with every possible GPU and driver it will get a depth buffer (and the game warns about "buggy drivers" when selecting OpenGL option which suggests that it doesn't necessarily work very well on arbitrary instance). I suppose it is nothing wrong in matching current Windows / AMD behaviour here instead of depending on unspecified format order. But that should be done in opengl32/wglChoosePixelFormat, not by adding some depth buffers in fshack. So I pulled the first patch from this PR ("fshack: Use texture name hack for Descent 3 ") and made another patch for depth issue (also sent upstream: https://gitlab.winehq.org/wine/wine/-/merge_requests/5636 Those are in the just updated Proton Experimental ([bleeding-edge] branch): https://github.com/ValveSoftware/wine/commits/experimental-wine-bleeding-edge-9.0-96562-20240514-p230721-we36c29-d6259e8-vf6d390/ Does that fix the issues? |
Descent 3's OpenGL renderer will use a texture conflicting with the FS hack texture, and only a small rectangle in the bottom left corner will be rendered. Signed-off-by: John Brooks <[email protected]> #211 CW-Bug-Id: #23791
Descent 3's OpenGL renderer will use a texture conflicting with the FS hack texture, and only a small rectangle in the bottom left corner will be rendered. Signed-off-by: John Brooks <[email protected]> ValveSoftware/wine#211 CW-Bug-Id: #23791
Based on work by Zhiyi Zhang, includes work by Giovanni Mascellani, Rémi Bernon, Arkadiusz Hiler, Kai Krakow, Joshua Ashton, Zebediah Figura, and Matteo Bruni. fshack: winex11: Protect fshack framebuffer from glFramebufferTexture2D(). glFramebufferTexture2D() just fails with default framebuffer. But when we have substitued fshack framebuffer setting the texture destroys it instead. CW-Bug-Id: #20669 fshack: winex11: Clear fs hack depth / stencil attachment. fshack: winex11: Support adjusting gamma in the fshack CW-Bug-Id: 16421 fshack: winex11: Setup gamma shader only once per context. Fixes GL objects leak and avoids unneccessary shader recreation when the fs_hack_setup_context() is called due to switching GL drawable. For Star Wars - Knights of the Old Republic blank screen. CW-Bug-Id: #19002 fshack: winex11: Track if multisample resolve is needed in gl_drawable. As that changes per drawable and not per context. fshack: winex11: Destroy fshack GL objects only at GL context destroy. fshack: winex11: Set viewport in fs_hack_setup_context(). For Star Wars - Knights of the Old Republic blank screen. CW-Bug-Id: #19002 fshack: winex11: Also enable fshack for drawable due to gamma in create_gl_drawable(). For Star Wars - Knights of the Old Republic blank screen. CW-Bug-Id: #19002 fshack: winex11: Use window dimensions in GL if fshack is enabled for gamma only. For Star Wars - Knights of the Old Republic blank screen. CW-Bug-Id: #19002 fshack: winex11: Use window size for texture and framebuffers in fs_hack_setup_context(). For Star Wars - Knights of the Old Republic blank screen. CW-Bug-Id: #19002 fshack: winex11: Blit the contents of current framebuffer to the fshack's framebuffer in fs_hack_setup_context(). CW-Bug-Id: #20102 Some games might not clear the framebuffer on each frame and rely on the data in framebuffer to persist through glFlush(), glFinish() etc. That is currently not the case if the fshack is getting turned on after some drawing was performed already. fshack: winex11: Use specific names for textures for SWJKJA. CW-Bug-Id: #20102 fshack: winex11: Interpolate looked up colour in gamma shader. CW-Bug-Id: #20400 fshack: winex11: Enable specific names for textures for Quake III Arena. CW-Bug-Id: #21474 fshack: winex11: Enable specific names for textures for Quake III Team Arena. CW-Bug-Id: #21474 fshack: winex11: Use linear colour internal format for GL fshack buffer. CW-Bug-Id: #22260 fshack: winex11: Always blit fs_hack in wglFlush and wglFinish when drawing to front buffer. CW-Bug-Id: #22608 fshack: winex11: Resolve fbo for glCopyTexSubImage2D. Based on a patch by Illia Polishchuk <[email protected]> from ValveSoftware/wine#189 GL_INVALID_OPERATION is generated if: the effective value of GL_SAMPLE_BUFFERS for the read framebuffer is one. CW-Bug-Id: #22662 fshack: winex11: Resolve fbo for glCopyTexImage2D. CW-Bug-Id: #22662 fshack: winex11: Resolve fbo for glReadPixels. CW-Bug-Id: #22662 fshack: winex11: Save and restore GL_PIXEL_UNPACK_BUFFER_BINDING too. CW-Bug-Id: #23257 fshack: Use texture name hack for Descent 3 Descent 3's OpenGL renderer will use a texture conflicting with the FS hack texture, and only a small rectangle in the bottom left corner will be rendered. Signed-off-by: John Brooks <[email protected]> ValveSoftware/wine#211 CW-Bug-Id: #23791 fshack: winex11.drv: Enable GL fshack blitting to GL_FRONT for Arcanum (500810). CW-Bug-Id: #23916
A couple of fixes which allow Descent 3's OpenGL renderer to work with the fullscreen hack.