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
Wolfenstein: The Old Blood tracing broken due to abuse of GL_MAP_PERSISTENT_BIT mappings #900
Comments
It's impossible to say what could be going on. Are there any apitrace warnings when tracing/replaying? |
Sorry, I was working on getting a trace uploaded but I got distracted. Here's a trace. When replaying I get a ton of errors like
|
VAOs are per context objects, however VAO 2 is never created on the context used by thread
|
Indeed it renders okay in the game. |
I think I know the rendering is not correct. WINE (or the app, if it uses GL API directly?) is using
One would normally expect a few fake Apitrace has code to trap writes to persistent memory, but IIUC, the problem here is that apitrace only does that with https://registry.khronos.org/OpenGL-Refpages/gl4/html/glMapBufferRange.xhtml states:
It's true that Apitrace actually doesn't handle the Therefore this is a WINE bug. It should be setting You should be able to hack Apitrace source to treat WINE (or the app) might also have settings to avoid persistent/coherent mappings? |
Interesting analysis. According to pcgamingwiki the game is natively using GL, so this would be an application bug. I'll test and report back. |
Yeah, from what I can tell from WINE's source code, it always uses You can try to modify the application source code to treat But this is illegal/incorrect use of OpenGL API, and might cause certain drivers which treat coherent memory differently to misrender. |
I can't modify the application since it's a proprietary game, but I can hack up apitrace for testing. There's a lot of references to |
This is a 8 year old game. Perhaps ID's engine has been fixed since (or abandon GL altogether?) Search for
You want to replace every instance of |
Oh okay, I misunderstood. |
Yep, that fixed it! |
Cool. Glad to hear it. If this happens again with another app I might make Apitrace's default behavior to treat |
I'm guessing this will also happen with Wolfenstein: The New Order since it's using the same engine. Installing now to test. |
Nope, TNO seems to run fine without those changes. Will test DOOM2016 next since that had a similar sort of issue. |
Oh ho ho it fixes DOOM2016 too! |
@jrfonseca What's going to be the resolution here? |
To summarize, so far the apps affected are:
Right? I'm not sure it's worth doing changing default behavior just for two apps. 3264525 is the best that can be done for now. If you want, we could also control the behavior via env var as opposed to source code modification. If it's worth it, we could even automatically detect based on the process name... Once you verify that replacing |
It's indeed just those two apps (that I've found so far). I agree that changing default behavior may be overkill. I think automatically detecting it by process name would be great if it isn't too challenging. I can get the app names when I test your patch. |
I can confirm that 3264525 with the
|
When replaying, the intro move plays fine, the title/menu screen is black, and gameplay looks like this:
The text was updated successfully, but these errors were encountered: