Summary: | [radeonsi] The Witcher 3 (GOG/1.31) [Wine] starting menu is distorted | ||
---|---|---|---|
Product: | Mesa | Reporter: | Shmerl <shtetldik> |
Component: | Drivers/Gallium/radeonsi | Assignee: | Default DRI bug account <dri-devel> |
Status: | RESOLVED NOTOURBUG | QA Contact: | Default DRI bug account <dri-devel> |
Severity: | normal | ||
Priority: | medium | CC: | joseph.kucia |
Version: | git | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
Witcher 3 main menu distortion (no CSMT)
R9 Fury / mesa de0b0a3a9c / llvm 292523 |
For the reference, to run the game in Wine, you need to set: [HKEY_CURRENT_USER\Software\Wine\Direct3D] "DirectDrawRenderer"="opengl" "UseGLSL"="enabled" "MaxVersionGL"=dword:00040005 And make sure you are using wine-staging 2.0rc5 or later, since older versions crash on startup because of the virtual heap limit. This appears to be Wine related and not caused by Mesa. See https://bugs.winehq.org/show_bug.cgi?id=39180 Closing. Reopening it, since it appears, that this still can be a radeonsi bug. See here: * https://bugs.winehq.org/show_bug.cgi?id=39180#c51 * https://bugs.winehq.org/show_bug.cgi?id=39180#c55 I replayed the trace which works well for other drivers, and I see distortions with radeonsi (this happens both with Mesa 13.0.2 and Mesa git). The trace can be found here: https://ufile.io/ed6ac (you can replay it with apitrace). Created attachment 129076 [details]
R9 Fury / mesa de0b0a3a9c / llvm 292523
The trace works correctly on Intel (Skylake and Haswell). On radeonsi, I can see the corruption, and there are lots of errors: 118231: message: major api error 2: GL_INVALID_ENUM in glActiveTexture(texture=GL_COMBINER0_NV) 118231 @0 glActiveTexture(texture = GL_COMBINER0_NV) They range from GL_COMBINER0_NV (0x8550) to 0x857f, so probably the trace was recorded on something supporting more texture units than radeonsi? Was the trace recorded on radeonsi (or AMD hardware at least)? (In reply to Grazvydas Ignotas from comment #5) > > They range from GL_COMBINER0_NV (0x8550) to 0x857f, so probably the trace > was recorded on something supporting more texture units than radeonsi? Was > the trace recorded on radeonsi (or AMD hardware at least)? I didn't record this trace, just reposted it here (I asked the author to clarify where exactly it was recoreded). Here is a trace on RX 480 and radeonsi: https://uploadfiles.io/caf8c Thanks for reporting the issue. I can reproduce it with mesa/llvm git on my rx 480. Needs investigation. Well, the trace is broken somehow, and it has been recorded using NVIDIA blob because it relies on NV_register_combiners. That explains the GL_COMBINER0_NV errors while replaying it. Could you try that game directly using RadeonSI? Presumably, it should work fine except if it still relies on NV_register_combiners. And that would be a game bug. (In reply to Samuel Pitoiset from comment #8) > Well, the trace is broken somehow, and it has been recorded using NVIDIA > blob because it relies on NV_register_combiners. That explains the > GL_COMBINER0_NV errors while replaying it. > > Could you try that game directly using RadeonSI? Presumably, it should work > fine except if it still relies on NV_register_combiners. And that would be a > game bug. The second trace I linked: https://uploadfiles.io/caf8c is recorded on AMD hardware (RX 480) with radeonsi. And the screenshot of the initial report shows how it looks on actual RX 480 as well. That's exactly how I run it (it's from the actual game run in Wine, not from trace). I'm not sure how the other trace ( https://ufile.io/ed6ac ) was recorded - the author never replied. And since the game isn't using GL natively, if anything is calling GL_NV_register_combiners in some situations, it must be Wine. I just replayed my trace (recorder on radeonsi / RX480), and I see this in the log: 120612: message: major api error 2: GL_INVALID_ENUM in glActiveTexture(texture=GL_COMBINER0_NV) 120612 @1 glActiveTexture(texture = GL_COMBINER0_NV) 120619: message: major api error 2: GL_INVALID_ENUM in glActiveTexture(texture=GL_COMBINER1_NV) 120619 @1 glActiveTexture(texture = GL_COMBINER1_NV) 120626: message: major api error 2: GL_INVALID_ENUM in glActiveTexture(texture=GL_COMBINER2_NV) 120626 @1 glActiveTexture(texture = GL_COMBINER2_NV) 120633: message: major api error 2: GL_INVALID_ENUM in glActiveTexture(texture=GL_COMBINER3_NV) 120633 @1 glActiveTexture(texture = GL_COMBINER3_NV) 120640: message: major api error 2: GL_INVALID_ENUM in glActiveTexture(texture=GL_COMBINER4_NV) 120640 @1 glActiveTexture(texture = GL_COMBINER4_NV) 120647: message: major api error 2: GL_INVALID_ENUM in glActiveTexture(texture=GL_COMBINER5_NV) 120647 @1 glActiveTexture(texture = GL_COMBINER5_NV) 120654: message: major api error 2: GL_INVALID_ENUM in glActiveTexture(texture=GL_COMBINER6_NV) 120654 @1 glActiveTexture(texture = GL_COMBINER6_NV) 120661: message: major api error 2: GL_INVALID_ENUM in glActiveTexture(texture=GL_COMBINER7_NV) 120661 @1 glActiveTexture(texture = GL_COMBINER7_NV) I can open a bug in Wine about it. Well yeah, it's definitely unrelated to Mesa/RadeonSI. The app should check if NV_register_combiners is supported before using it. I'm going to close the ticket. (In reply to Samuel Pitoiset from comment #12) > Well yeah, it's definitely unrelated to Mesa/RadeonSI. The app should check > if NV_register_combiners is supported before using it. I'm going to close > the ticket. Are you sure that NV_register_combiners are used? I haven't checked the trace myself but I doubt this is a case. (In reply to Shmerl from comment #11) > I just replayed my trace (recorder on radeonsi / RX480), and I see this in > the log: > > 120612: message: major api error 2: GL_INVALID_ENUM in > glActiveTexture(texture=GL_COMBINER0_NV) > 120612 @1 glActiveTexture(texture = GL_COMBINER0_NV) > 120619: message: major api error 2: GL_INVALID_ENUM in > glActiveTexture(texture=GL_COMBINER1_NV) > 120619 @1 glActiveTexture(texture = GL_COMBINER1_NV) > 120626: message: major api error 2: GL_INVALID_ENUM in > glActiveTexture(texture=GL_COMBINER2_NV) > 120626 @1 glActiveTexture(texture = GL_COMBINER2_NV) > 120633: message: major api error 2: GL_INVALID_ENUM in > glActiveTexture(texture=GL_COMBINER3_NV) > 120633 @1 glActiveTexture(texture = GL_COMBINER3_NV) > 120640: message: major api error 2: GL_INVALID_ENUM in > glActiveTexture(texture=GL_COMBINER4_NV) > 120640 @1 glActiveTexture(texture = GL_COMBINER4_NV) > 120647: message: major api error 2: GL_INVALID_ENUM in > glActiveTexture(texture=GL_COMBINER5_NV) > 120647 @1 glActiveTexture(texture = GL_COMBINER5_NV) > 120654: message: major api error 2: GL_INVALID_ENUM in > glActiveTexture(texture=GL_COMBINER6_NV) > 120654 @1 glActiveTexture(texture = GL_COMBINER6_NV) > 120661: message: major api error 2: GL_INVALID_ENUM in > glActiveTexture(texture=GL_COMBINER7_NV) > 120661 @1 glActiveTexture(texture = GL_COMBINER7_NV) This has nothing to do with NV_register_combiners. It just displayed like this in apitrace, because GL_COMBINERi_NV = GL_TEXTURE0 + x. Opened Wine bug: https://bugs.winehq.org/show_bug.cgi?id=42347 I hope between Mesa and Wine, it will be possible to figure out what's going wrong. (In reply to Józef Kucia from comment #13) > (In reply to Samuel Pitoiset from comment #12) > > Well yeah, it's definitely unrelated to Mesa/RadeonSI. The app should check > > if NV_register_combiners is supported before using it. I'm going to close > > the ticket. > > Are you sure that NV_register_combiners are used? I haven't checked the > trace myself but I doubt this is a case. > > (In reply to Shmerl from comment #11) > > I just replayed my trace (recorder on radeonsi / RX480), and I see this in > > the log: > > > > 120612: message: major api error 2: GL_INVALID_ENUM in > > glActiveTexture(texture=GL_COMBINER0_NV) > > 120612 @1 glActiveTexture(texture = GL_COMBINER0_NV) > > 120619: message: major api error 2: GL_INVALID_ENUM in > > glActiveTexture(texture=GL_COMBINER1_NV) > > 120619 @1 glActiveTexture(texture = GL_COMBINER1_NV) > > 120626: message: major api error 2: GL_INVALID_ENUM in > > glActiveTexture(texture=GL_COMBINER2_NV) > > 120626 @1 glActiveTexture(texture = GL_COMBINER2_NV) > > 120633: message: major api error 2: GL_INVALID_ENUM in > > glActiveTexture(texture=GL_COMBINER3_NV) > > 120633 @1 glActiveTexture(texture = GL_COMBINER3_NV) > > 120640: message: major api error 2: GL_INVALID_ENUM in > > glActiveTexture(texture=GL_COMBINER4_NV) > > 120640 @1 glActiveTexture(texture = GL_COMBINER4_NV) > > 120647: message: major api error 2: GL_INVALID_ENUM in > > glActiveTexture(texture=GL_COMBINER5_NV) > > 120647 @1 glActiveTexture(texture = GL_COMBINER5_NV) > > 120654: message: major api error 2: GL_INVALID_ENUM in > > glActiveTexture(texture=GL_COMBINER6_NV) > > 120654 @1 glActiveTexture(texture = GL_COMBINER6_NV) > > 120661: message: major api error 2: GL_INVALID_ENUM in > > glActiveTexture(texture=GL_COMBINER7_NV) > > 120661 @1 glActiveTexture(texture = GL_COMBINER7_NV) > > This has nothing to do with NV_register_combiners. It just displayed like > this in apitrace, because GL_COMBINERi_NV = GL_TEXTURE0 + x. You are right. The game wants 192 texture units but RadeonSI only exposes 144 (24 per stages), that explains at least, the glActiveTexture() errors in the trace. But according to the GL spec, the minimum number of texture units is 80. Does the following patch help? https://cgit.freedesktop.org/mesa/mesa/commit/?id=dfe111368d11aaffae7f8738c858c335cdec1e9d It actually fixes the glActiveTexture() errors but I still get rendering issues on my side using the trace. Can you confirm by running the game directly? Thanks! (In reply to Samuel Pitoiset from comment #16) > Does the following patch help? > > https://cgit.freedesktop.org/mesa/mesa/commit/ > ?id=dfe111368d11aaffae7f8738c858c335cdec1e9d > > It actually fixes the glActiveTexture() errors but I still get rendering > issues on my side using the trace. I think that the glActiveTexture() errors are unrelated to any rendering issues. These are generated by GL context initialization in Wine. It's not clear to me if they appear when the game is run directly. We bind dummy textures to GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB units, so we shouldn't exceed the limit reported by the driver. (In reply to Józef Kucia from comment #17) > (In reply to Samuel Pitoiset from comment #16) > > Does the following patch help? > > > > https://cgit.freedesktop.org/mesa/mesa/commit/ > > ?id=dfe111368d11aaffae7f8738c858c335cdec1e9d > > > > It actually fixes the glActiveTexture() errors but I still get rendering > > issues on my side using the trace. > > I think that the glActiveTexture() errors are unrelated to any rendering > issues. These are generated by GL context initialization in Wine. It's not > clear to me if they appear when the game is run directly. We bind dummy > textures to GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB units, so we shouldn't > exceed the limit reported by the driver. Yes, but according to the trace, 192 texture units were used and the limit was 144 before that commit. As I said, I still have rendering issues (other issue?). Anyway, it seems reasonable to expose 32 texture units per stage. (In reply to Samuel Pitoiset from comment #16) > Does the following patch help? > > https://cgit.freedesktop.org/mesa/mesa/commit/ > ?id=dfe111368d11aaffae7f8738c858c335cdec1e9d > > It actually fixes the glActiveTexture() errors but I still get rendering > issues on my side using the trace. > > Can you confirm by running the game directly? > Thanks! I built Mesa from source after that commit, and rendering issues in the menu are still present when game is run in Wine. FYI: I just tested it with wine-staging 2.1 with CSMT enabled (that version allows using it with DX11 already), and corruption in the start menu is gone. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.
Created attachment 129014 [details] Witcher 3 main menu distortion (no CSMT) I'm testing The Witcher 3 with recent Wine staging 2.0rc5 (CSMT disabled), using AMD RX 480 and latest Mesa devel: OpenGL renderer string: Gallium 0.4 on AMD POLARIS10 (DRM 3.3.0 / 4.8.0-2-amd64, LLVM 3.9.1) OpenGL core profile version string: 4.5 (Core Profile) Mesa 17.0.0-devel (git-aac562f112) Starting screen has distorted text in the menu (see attached screenshot). For the reference, the game is still unplayable beyond the starting screen and intro with broken graphics, but users of Nvidia blob report that they don't have this issue in the starting menu which appears correct to them, so menu distortion looks radenosi related.