r300/rv530: "Vertex texture fetch" feature wrongly present for D3D based apps in Wine
Description
Right at the beginning it should be noted that it is unclear if this here is really a Mesa bug. This could be effectively also a Wine related issue. However, my assumption is that Wine is getting somewhere a wrong information from Mesa.
Update: It turned out that this is effectively a problem in WineD3D and also Gallium Nine. So it has to be fixed there.
This topic targets a feature called Vertex texture fetch (VTF) which is currently exposed (and therefore available) for D3D applications under Wine. So far I understand this shouldn't be the case regarding a Radeon X1600 GPU.
It was clarified by @imirkin in bug #5813 (closed) that R500 based hardware simply doesn't supports that capability. This is true for all pre-DX10 class hardware from ATI/AMD.
Ergo, this feature shouldn't be present with R500 hardware and D3D applications. Tested Wine version was Wine 7.2 (in conjunction with Gallium Nine).
System information
test@iMac-4:~$ inxi -b
System: Host: iMac-4 Kernel: 5.13.0-28-generic x86_64 bits: 64 Desktop: KDE Plasma 5.18.8
Distro: Ubuntu 20.04.3 LTS (Focal Fossa)
Machine: Type: Desktop System: Apple product: iMac5,1 v: 1.0 serial: <superuser/root required>
Mobo: Apple model: Mac-F4228EC8 v: DVT serial: <superuser/root required> BIOS: Apple
v: IM51.88Z.0090.B09.0706270921 date: 06/27/07
CPU: Dual Core: Intel Core2 T7400 type: MCP speed: 1572 MHz min/max: 1000/2167 MHz
Graphics: Device-1: Advanced Micro Devices [AMD/ATI] RV530/M56-P [Mobility Radeon X1600] driver: radeon v: kernel
Display: x11 server: X.Org 1.20.13 driver: radeon FAILED: ati unloaded: fbdev,modesetting,vesa
resolution: 1680x1050~60Hz
OpenGL: renderer: ATI RV530 v: 2.1 Mesa 22.1.0-devel (git-9cbcdfb 2022-02-16 focal-oibaf-ppa)
Network: Device-1: Marvell 88E8053 PCI-E Gigabit Ethernet driver: sky2
Device-2: Broadcom and subsidiaries BCM4360 802.11ac Wireless Network Adapter driver: wl
Drives: Local Storage: total: 262.39 GiB used: 101.20 GiB (38.6%)
Info: Processes: 187 Uptime: 23h 24m Memory: 2.90 GiB used: 1.49 GiB (51.4%) Shell: bash inxi: 3.0.38
Describe the issue
When I start the benchmark Unigine Sanctuary (under Wine) it shows during the startup at the CLI the below listed D3D render details. Shortly after this the benchmark fails to load and simply freezes / halts. So it doesn't work. (Note, maybe there are even more features exposed which aren't effectively available on r500 hardware).
---- Render ----
Renderer: ATI R500 256Mb
Direct3D9 desc: ATI Radeon X1600 Series
Direct3D9 driver: atiumdag.dll
Found required D3DPTEXTURECAPS_CUBEMAP
Found required D3DPTEXTURECAPS_VOLUMEMAP
Found required D3DPTADDRESSCAPS_WRAP
Found required D3DPTADDRESSCAPS_CLAMP
Found required D3DCAPS2_CANAUTOGENMIPMAP
Found optional Vertex shader 3.0
Found optional Pixel shader 3.0
Found optional Vertex texture fetch
Found optional HDR blending
Found optional HDR filtering
Found optional NULL texture
Found optional RGB10A2 texture
Found optional DXT texture compression
Found optional ATI texture compression 1
Found optional ATI texture compression 2
Found optional ATI texture fetch 4
Found optional ATI hardware shadow
Found optional NVIDIA hardware shadow
Found ATI alpha to coverage
Found optional NVIDIA alpha to coverage
Maximum texture width: 4096
Maximum texture height: 4096
Maximum render targets: 4
When the native Linux build of Unigine Sanctuary is used the following OpenGL render features are available:
---- Render ----
GLRender::GLRender(): Unknown GPU
OpenGL vendor: X.Org R300 Project
OpenGL renderer: ATI RV530
OpenGL version: 2.1 Mesa 22.1.0-devel (git-9cbcdfb 2022-02-16 focal-oibaf-ppa)
Found required GL_ARB_map_buffer_range
Found required GL_ARB_vertex_array_object
Found required GL_ARB_vertex_buffer_object
Found required GL_ARB_half_float_vertex
Found required GL_ARB_half_float_pixel
Found required GL_ARB_occlusion_query
Found required GL_EXT_texture3D
Found required GL_EXT_texture_cube_map
Found required GL_EXT_texture_sRGB
Found required GL_EXT_texture_swizzle
Found required GL_ARB_shader_object
Found required GL_ARB_vertex_shader
Found required GL_ARB_fragment_shader
Found required GL_ARB_draw_buffers
Found required GL_ARB_framebuffer_object
Found required GL_EXT_framebuffer_blit
Found required GL_EXT_framebuffer_multisample
Found optional GL_ARB_draw_elements_base_vertex
Found optional GL_ARB_texture_rg
Found optional GL_ARB_texture_compression
Found optional GL_ARB_texture_compression_rgtc
Shading language: 1.20
Maximum texture size: 4096
Maximum texture units: 16
Maximum draw buffers: 4
Any extra information
The status of the Vertex texture fetch capability on R500 class hardware seems somewhat "unclear" although there exist some statements that it is not available.
For example the Khronos "Vertex texture fetch" OpenGL Wiki page notes:
ATI/AMD chose not to have VTF in their SM 3.0 GPUs. ... All of their standard X series. They said it would be too slow. It would be better to do Render_To_VertexBuffer (R2VB).