-
Notifications
You must be signed in to change notification settings - Fork 903
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
Video playback in Age of Empires II HD (2013) breaks d3d9 rendering #1726
Comments
Needed for #1726 otherwise it will upload dump that upload garbage in a YUV2 texture.
So it uses the format YV12 in the WineD3D trace, however we don't support that so it tries to use YUY2 in the DXVK trace. It seems the YUY2 data that gets uploaded is garbage, same with how it is when replaying the trace on native for me. Anyway, I've implemented YV12. Please let me know if this works on your end. |
Needed for #1726 otherwise it will upload dump that upload garbage in a YUV2 texture.
@aeikum Is there anything special I need to do to get the video to play? I tried in proton_5.0-next and it just skipped over the video and went straight to the main menu (which worked) for me. |
So, the main menu worked before the video thing worked. The problem is you're creating multiple swapchains/surfaces for a window, this is a big no-no in Vulkan, but it should be possible to fix. |
Hm, perhaps not. This is happening on another d3d9 instance and another d3d9 device. The primary vulkan swapchain from the game still thinks everything is okay and it can present and even returns VK_SUCCESS. I'm not super sure what to do about that given I have 0 information... :-/ Anyway, I fixed the YV12 rendering at least. I'll need to have a think about the swapchain dilemma, I'm not sure if this is something I can work around, or if I can work around it in Wine or maybe the driver is wrong for thinking everything is okay. |
Needed for #1726 otherwise it will upload dump that upload garbage in a YUV2 texture.
Needed for #1726 otherwise it will upload dump that upload garbage in a YUV2 texture.
Just curious, any further thoughts on this? Do we know where the problem is? |
I have tested this on Windows with DXVK and it works fine there. On Windows in D3D9, you can have multiple swapchains on the same window. The problem is that technically this is illegal in the Vulkan spec -- but it seems to just work on Windows too? __ Whoever creates a swapchain for a window last should be the "owner". We should eventually write a VALVE extension that we enable all the time to make things spec-positive here. I can take that part once we know this works. |
Another game that needs YUY2 in d3d9 path is Mary Skelter: Nightmares. It's using mediafoundation for intro video, with EVR renderer, that goes through dxva2. YUY2 is a main planar format there as I understand, at least for software devices. Winegstreamer is already able to output in YUY2, but that needs a hack to trigger + some smaller patches that are waiting to be included for mainline wine. Let me know if there is interest to test this, I can provide more info then. |
As we're getting more videos online, we're running into this problem more often. Any hope of a workaround? |
Rémi actually had some fixes for this in one of his trees. We've backported his work to 6.3 and it fixes AOE2 and some other affected games. It works by allowing multiple surfaces & swapchains per window, and rendering offscreen if multiple surfaces are active. I've pushed this to my repo and it'll be in Experimental soon: aeikum/wine@08db7c2 |
Fixes games failing to render after displaying a video, e.g. Age of Empires II (2013). doitsujin/dxvk#1726
Fixes games failing to render after displaying a video, e.g. Age of Empires II (2013). doitsujin/dxvk#1726
Fixes games failing to render after displaying a video, e.g. Age of Empires II (2013). doitsujin/dxvk#1726
Fixes games failing to render after displaying a video, e.g. Age of Empires II (2013). doitsujin/dxvk#1726
Fixes games failing to render after displaying a video, e.g. Age of Empires II (2013). doitsujin/dxvk#1726
Fixes games failing to render after displaying a video, e.g. Age of Empires II (2013). doitsujin/dxvk#1726
Fixes games failing to render after displaying a video, e.g. Age of Empires II (2013). doitsujin/dxvk#1726
This has been working for some time now. |
Fixes games failing to render after displaying a video, e.g. Age of Empires II (2013). doitsujin/dxvk#1726
In AOE2:HD, if you have functional video playback, then DXVK's d3d9 rendering is broken. In v1.7, the video blinks rapidly. In v1.7.1, the video appears stretched and corrupted. In both cases, the main menu of the game doesn't render (i.e. the DXVK HUD FPS counter is blank; no rendering). With wined3d, the video and game render just fine. Wine's quartz implementation is using d3d9 to render, see
dlls/quartz/vmr9.c
.Since I know getting video playback set up is a pain, I'm including as much info here as I can. I'm happy to provide more info or test patches, etc.
Software information
Age of Empires II HD (2013) (steam game id 221380)
System information
Apitrace file(s)
wined3d (correct) apitrace: https://smokingonabike.com/AoK%20HD%20wined3d.trace.xz
dxvk (incorrect) apitrace: https://smokingonabike.com/AoK%20HD%20dxvk.trace.xz
Log files
The text was updated successfully, but these errors were encountered: