https://bugs.winehq.org/show_bug.cgi?id=54223
--- Comment #9 from CHECK_1234 CHECK_1234543212345@protonmail.com --- Update 5: Wine Staging 8.0-rc2 with DirectX11 to OpenGL performance regression vs Wine 8.0-rc2 with DirectX11 to OpenGL Performance Regression Fixed/Wine renderer=vulkan vs DXVK 2.0
To fix DirectX11 to OpenGL performance, I edited "dlls/wined3d/device.c" and I changed this code from:
-------------------------------------------------------------------------------
static bool use_buffer_chunk_suballocation(struct wined3d_device_gl *device_gl, const struct wined3d_gl_info *gl_info, GLenum binding) { switch (binding) { case GL_ARRAY_BUFFER: case GL_ATOMIC_COUNTER_BUFFER: case GL_DRAW_INDIRECT_BUFFER: case GL_PIXEL_UNPACK_BUFFER: case GL_UNIFORM_BUFFER: return true;
case GL_ELEMENT_ARRAY_BUFFER: /* There is no way to specify an element array buffer offset for * indirect draws in OpenGL. */ return device_gl->d.wined3d->flags & WINED3D_NO_DRAW_INDIRECT || !gl_info->supported[ARB_DRAW_INDIRECT];
case GL_TEXTURE_BUFFER: return gl_info->supported[ARB_TEXTURE_BUFFER_RANGE];
default: return false; } }
-------------------------------------------------------------------------------
to
-------------------------------------------------------------------------------
static bool use_buffer_chunk_suballocation(struct wined3d_device_gl *device_gl, const struct wined3d_gl_info *gl_info, GLenum binding) { switch (binding) { case GL_ARRAY_BUFFER: case GL_ATOMIC_COUNTER_BUFFER: case GL_DRAW_INDIRECT_BUFFER: case GL_PIXEL_UNPACK_BUFFER: case GL_UNIFORM_BUFFER: return false;
case GL_ELEMENT_ARRAY_BUFFER: /* There is no way to specify an element array buffer offset for * indirect draws in OpenGL. */ return false;
case GL_TEXTURE_BUFFER: return false;
default: return false; } }
-------------------------------------------------------------------------------
"case GL_UNIFORM_BUFFER:" was the main one causing this DirectX11 to OpenGL Performance regession.
⬤ Settings:
RX580 locked to 300Mhz core clock and 300Mhz memory clock (By using echo "low"
/sys/class/drm/card0/device/power_dpm_force_performance_level
Quality: Low Resolution: 1280x720 Fullscreen: Unchecked MAX CPU CLOCK SPEED: 2.5Ghz at 0.768V Color Depth: 24 (Was using color depth 16 on the comment #8, that was why performance was higher in comment #8, mesa needs to add support for color depth 16 to make vulkan work at color depth 16 because color depth 16 increases performance)
⬤ Unigine Heaven 4.0 Benchmark Results:
-------------------------------------------------------------------
Default Wine 8.0-rc2 OpenGL to OpenGL:
Scene 2: 92 FPS Scene 3: 105 FPS
Default Wine 8.0-rc2 DirectX11 to OpenGL:
Scene 2: 40 FPS Scene 3: 24 FPS
Default Wine 8.0-rc2 DirectX9 to OpenGL:
Scene 2: 90 FPS Scene 3: 97 FPS (FPS Changing fast, someimes reaching over 100FPS)
Default Wine 8.0-rc2 DirectX11 to Vulkan (winetricks renderer=vulkan):
Scene 2: 24 FPS Scene 3: 15 FPS
Default Wine 8.0-rc2 DirectX11 to Vulkan (DXVK 2.0) (./setup_dxvk.sh install)
Scene 2: 91 FPS Scene 3: 105 FPS
-------------------------------------------------------------------
Performance Regression Fixed Custom Wine 8.0-rc2 OpenGL to OpenGL:
Scene 2: 91 FPS Scene 3: 105 FPS
Performance Regression Fixed Custom Wine 8.0-rc2 DirectX11 to OpenGL:
Scene 2: Reaching over 90 FPS (FPS Changing too fast) Scene 3: 63 FPS
Performance Regression Fixed Custom Wine 8.0-rc2 DirectX9 to OpenGL:
Scene 2: Reaching over 90 FPS (FPS Changing too fast) Scene 3: 77 FPS
Performance Regression Fixed Custom Wine 8.0-rc2 DirectX11 to Vulkan (winetricks renderer=vulkan):
Error box when click "RUN" button, maybe because of the way I compiled the wine.
Performance Regression Fixed Custom Wine 8.0-rc2 to Vulkan (DXVK 2.0) (./setup_dxvk.sh install):
Error box when click "RUN" button, maybe because of the way I compiled the wine.
-------------------------------------------------------------------
⬤ Conclusion:
Hopefully this patch can be applied to the official wine repository fixing DirectX11 to OpenGL performance caused by commit 86f0ae8efb17ce688986971d24c3e25840a2beef located at https://gitlab.winehq.org/wine/wine/-/commit/86f0ae8efb17ce688986971d24c3e25...