https://bugs.winehq.org/show_bug.cgi?id=43708
Stefan Dösinger stefan@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |stefan@codeweavers.com
--- Comment #16 from Stefan Dösinger stefan@codeweavers.com --- Created attachment 70590 --> https://bugs.winehq.org/attachment.cgi?id=70590 Hack away index buffer map details
Does the attached hack help?
Spore locks an index buffer which contains 16 bit indices. Unfortunately it passes the wrong lock size. When it tries to write e.g. 123 indices it tells d3d9 that it wants to write 123 bytes instead of the correct 246 bytes.
Wined3d forwards this information to opengl as some drivers need it to handle data transfers efficiently. Sadly, because it is wrong data, only half the buffer has defined contents. That causes the game to draw random triangles on its heightmap, leading to the broken map.
Vulkan did away with map ranges. A game can only map the entire buffer. Vulkan drivers are supposed to handle this efficiently by mmap'ing video memory into the client address space, so that the write goes directly to the GPU and doesn't need to be copied after unmap, or by keeping the buffer in sysmem/GART and uploading data as needed when drawing. Therefore dxvk has to ignore the broken game data and things work. Some GL drivers do the same (e.g. the radeon mesa driver) and the game works too. On MacOS on the same hardware it is broken.
An unrelated problem with Spore, that leads to similar, but milder, symptoms, is rasterizing precision when the heightmap is drawn. Some triangles are close to the pixel centers. Depending on whether they produce a fragment or not weird straight hills or gaps can be seen on the map, even on Windows. They aren't as high/deep as the terrain in this bug, so they don't break gameplay.