r300/rv530: "Black rendering" of Baldur's Gate Dark Alliance in Xbox emulator CXBX-R under wine with Gallium Nine and RADEON_DEBUG=use_tgsi
Description:
This is a "spin-off" of bug #5497 (closed). That topic here should be 100% Gallium Nine only and targets a black rendering of D3D based content in the Xbox emulator CXBX-R.
It turns out that there exist an almost identical issue in conjunction with WineD3D, see bug #357 (closed). But that is a different problem and should not be mixed up with that one here. I have established a separate bug report #5967 (closed) about that WineD3D black rendering problem with current Mesa versions.
The OS is Kubuntu 20.04 LTS. Originally used kernel was 5.11.0-37-generic with Wine 6.19, at the time of writing kernel 5.13.0-27-generic and Wine 7.1 were installed.
Resolution & Explanation of the underlying problem:
Originally Gallium Nine was not coded with all DX9.0c optimizations so the resulting shaders exceeds slightly the DX9.0c SM3.0 hw limits. However, the functionality to support fully the DX9.0c SM3.0 specification is as of 2021 present in Gallium Nine but it is not programmed accordingly.
More information can be found at the following comment of Axel Davy in my old bug report: #5497 (comment 1187761)
Long story short, it is still unclear if the "black rendering" issue mentioned here is really related to the "Gallium Nine design limitation" on DX9.0c SM3.0 class hardware. This may be after all a problem in Mesa. Update: This was after all a problem of the r300 driver.
Most likely affected and currently by Mesa supported DX9.0c SM3.0 hardware is:
- ATI/AMD Radeon X1000 series, R500 based, supported by the r300 driver
Nvidia GeForce 6 & 7 series, NV40 based, supported by the nv30 driverIntel GMA X3000 iGPU, supported by the crocus driver
All newer DX10+ SM4.0+ class hardware is not affected by this bug because it has more hardware resource available.
Only r300 driver related ATI hardware was ultimately affected by this "black rendering" bug.
Mesa driver information:
name of display: :0
display: :0 screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
Vendor: X.Org R300 Project (0x1002)
Device: ATI RV530 (0x71c5)
Version: 22.1.0
Accelerated: yes
Video memory: 256MB
Unified memory: no
Preferred profile: compat (0x2)
Max core profile version: 0.0
Max compat profile version: 2.1
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 2.0
OpenGL vendor string: X.Org R300 Project
OpenGL renderer string: ATI RV530
OpenGL version string: 2.1 Mesa 22.1.0-devel (git-04f6e91 2022-02-03 focal-oibaf-ppa)
OpenGL shading language version string: 1.20
OpenGL ES profile version string: OpenGL ES 2.0 Mesa 22.1.0-devel (git-04f6e91 2022-02-03 focal-oibaf-ppa)
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16
Examples:
When I start the Game Baldur's Gate Dark Alliance or Crash Tag Team Racing (or any other Xbox game) in the Xbox emulator CXBX-R the program window stays black. The game doesn't crash directly, it seems to run, so I can hear the intro music but otherwise nothing else. I have made two apitrace:
Baldur's Gate Dark Alliance:
https://drive.google.com/file/d/1SqROaFvt7nkLus8EzTCj497K4ruaa4s2/view?usp=sharing
Crash Tag Team Racing:
https://drive.google.com/file/d/1_DLIXcngcuEKtknG4d7b7JpEuLhZ5Aaw/view?usp=sharing
Crash Tag Team Racing (Mesa 22.1.0-devel git-9cbcdfb5 2022-02-16 focal-oibaf-ppa):
https://drive.google.com/file/d/15kV40TwRNwlAjhPdk_I2pGuIIgZ2MasL/view?usp=sharing
It should be noted that I can replay these apitraces without any errors at an "newer" iMac which contains an AMD Radeon HD 6770M in conjunction with the r600 driver. So the problem described here is only reproducible with r500 hardware (like rv530) and the r300 driver. These apitraces should in principle work on any DX10+ SM4.0+ class hardware properly (while they should fail on any lower hardware than that).