Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=44863
The bug has been fixed already by moving ddraw4 vertex buffers into
system memory. Changing this value makes the game create a smaller
buffer, which makes the game fast on video memory buffers. I think we
should stay close to what Windows drivers report even though we
mitigated the original issue in a different way.
--
v2: ddraw: Set dwMaxVertexCount to 2048.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5687
--
v2: d3dx9: Add support for mipmap generation to D3DXCreateVolumeTextureFromFileInMemoryEx().
d3dx9: Use d3dx_image structure inside of D3DXCreateVolumeTextureFromFileInMemoryEx().
d3dx9: Cleanup texture value argument handling in D3DXCreateVolumeTextureFromFileInMemoryEx().
d3dx9: Refactor texture creation and cleanup in D3DXCreateVolumeTextureFromFileInMemoryEx().
d3dx9/tests: Add more tests for D3DXCreateVolumeTextureFromFileInMemoryEx().
d3dx9: Use shared code in D3DXLoadVolumeFromFileInMemory().
https://gitlab.winehq.org/wine/wine/-/merge_requests/5881
Fix black screen issues for Active Trader Pro and Assetto Corsa. This reverts commit 4124478b.
For Active Trader Pro, the hack ends up clearing a context that was previously drawn to to black,
possibly because multiple OpenGL contexts are involved according to Henri's investigation.
Assetto Corsa creates a D3D device for a window but doesn't actually do any rendering with it. After
ceefcca7, having an OpenGL context for a window clears its OpenGL surface to black after its view
becomes visible. The OpenGL surface is on top of other layers for the window so the window becomes
black after that. The blackness is originally from glDrawBuffer(GL_FRONT_AND_BACK), which presumably
prepares a zero-initialized OpenGL front draw buffer. This also suggests that 4124478b is no longer
necessary. I could delay the clearToBlackIfNeeded() call so it uses the behavior before ceefcca7,
but now that it seems the hack is no longer necessary and might cause more errors. CrossOver has
disabled the hack for a while and it seems fine. I think it's time to remove the hack.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5929
As mentioned in https://gitlab.winehq.org/wine/wine/-/merge_requests/5264, the next step for OpenGL in the Wayland driver is support for WGL_ARB_pixel_format. It seems possible, at least in theory, to move a large part of the logic involved in this extension outside the drivers for common use by all of them (or ones that want to opt-in).
The goal of this RFC MR is, through experimentation and discussion/feedback, evaluate:
1. Whether making such functionality available outside the drivers (likely in an opt-in manner to begin with) is a productive way forward, or the complexity and platform specific decisions favor the current per-driver approach.
2. If we think that (1) is a worthy goal, what's the best mechanism to achieve it.
Note that the focus of this MR is currently on being a proof-of-concept, rather providing ready-for-detailed-review code (although I have done my best to keep the code decent). This MR currently (roughly in commit order):
* Introduces a new wgl driver callback to allow drivers to provide to opengl32/unix a list of formats and many details about them.
* Uses the information in that list to implement wglGetPixelFormatAttrib*.
* Uses the information in that list plus format sorting rules from WineX11 (effectively GLX rules plus tweaks) to implement wglChoosePixelFormatARB.
* Implements the get_pixel_formats callback for the Wayland driver.
* Hacks the get_pixel_formats callback for WineX11, and to allow me to run some experiments to compare the output of native WineX11 and get_pixel_formats-WineX11. In the admittedly not too many games I tried the sort order is the same, so at least that's encouraging.
My thoughts and notes so far:
* Using this approach for wglGetPixelFormatAttrib* works well, and we can also implement wglDescribePixelFormat in this way.
* It's not at all clear what the "right" sorting rules are for wglChoosePixelFormatARB.
* WineX11 uses GLX + tweaks (e.g., changes depth sorting). This means that larger formats tend to be preferred, at least according to the GLX spec. For example, asking for a r5, g6, b5 in the attributes is supposed to give back rgb888 (or even higher if available) as the top format in the list. Interestingly, and to confuse things even more, I haven't been able to make GLX return non-888(8) configs at all to actually test this more, so perhaps that's what saves it here? However, eglChooseConfig works similarly and there I was able to verify this behavior (e.g., got a nice surprise 10-bit format when asking for 5551 :)).
* Winemac has its own custom logic.
* Mesa's WGL implementation uses a different approach, closer to Wine's normal (wgl)ChoosePixelFormat, where proximity to the target format is strongly rewarded (so it seems asking for r5g6b5 is much more likely to actually get you that).
* Of course, the "gold standard" here would be to try to infer and use the rules used by some windows driver.
Looking forward to thoughts/feedback!
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5388
On the client side, frame aperture may be included or omitted. This can be used to include or drop the frame padding, and the VideoProcessor MFT supports it.
On GStreamer side, we can only use the unpadded frame size in the caps, because this is how decoders work, and padding needs to be added as a property of the input/output video buffers. Then, frame size needs to be adjusted to be consistent between input and output, and any difference considered as extra padding to be added on one side or the other.
--
v3: winegstreamer: Respect video format padding for input buffers too.
winegstreamer: Exclude padding from wg_format video frame size.
winegstreamer: Use video info stride in buffer meta rather than videoflip.
winegstreamer: Use a new wg_video_buffer_pool class to add buffer meta.
winegstreamer: Update the output_format when stream format changes.
winegstreamer: Pass optional GstVideoInfo to read_transform_output_data.
winegstreamer: Split read_transform_output_data in two helpers.
winegstreamer: Introduce a new sample_needs_copy_buffer helper.
winegstreamer: Introduce a new sample_set_flags_from_buffer helper.
mf/tests: Add more video processor tests with aperture.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5055
This MR adds a default implementation for `wglChoosePixelFormatARB` (in opengl32.dll) which will be used automatically if the driver populates the wgl_pixel_format ARB fields. Thus winex11 automatically uses this, and this MR removes the driver internal implementation.
The second part of this MR adds `WGL_ARB_pixel_format` support for winewayland (we can move this to a separate MR, but I wanted to have another implementation to better assess the behavior).
The `wglChoosePixelFormatARB` behavior is loosely modeled after the the AMD driver as discussed in https://gitlab.winehq.org/wine/wine/-/merge_requests/5388. I tried to keep things simple to begin with, and the results I am getting in various apps/games are sensible, but please try this out so we can refine further.
--
v2: winewayland: Support WGL_ARB_pixel_format_float.
winewayland: Support WGL_ARB_pixel_format.
winex11: Remove driver wglChoosePixelFormatARB implementation.
opengl32: Add default implementation for wglChoosePixelFormatARB.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5933