Gallium Nine fixes for 19.1

Closed Axel Davy requested to merge axeldavy/mesa:submit_mesa191 into master


I'd like to get several gallium nine fixes and improvements for the next mesa release.

Among the games fixed are Rayman (Legends and Origins), Halo, Dark Messiah of Might and Magic and Max: The Curse of Brotherhood.

New features:

  • Better performance for GPUs with limited CPU<->GPU bandwidth. We now compact the shader constants indexes for shaders that don't use consecutive constants with index starting from 0. Thus holes in the shader constants slots are filled and fewer constants are uploaded to the GPU.
  • new drirc env var dynamic_texture_workaround (defaults to false). If set, we use an intermediate ram buffer for dynamic texture uploads. Most games don't use dynamic textures. Among those who do, some expect a particular texture stride, and the driver doesn't enable us to get the expected stride. The workaround is to use an intermediate ram buffer for which we can control stride. The env var is set by default for Rayman Legends, but it could be used for other games if they have texture issues.
  • new drirc env var shader_inline_constants (defaults to false). Integer and boolean constants are used for control flow in d3d9. Inlining them enables the compiler to remove dead code and unroll loops, which could give slightly better performance in some cases. However that also means stuttering if a new integer/boolean constant combination is used, thus the default to false. The long term plan is to compile in another thread these shaders and use the normal shader until they are ready to avoid stutter.
  • Update the GPU name table. We have been stuck at "AMD Radeon R9 290" for some time. Now more recent GPUs should display the correct name (users might see their games resetting the graphic configuration as some games detect gpu string changes).
  • Better performance for d3d8to9

Most of the patches (especially the first ones) are fixes independent of other patches.

However several patches are interdependent:

  • "st/nine: Optimize surface upload with conversion" to "st/nine: Support internal compressed format for volumes" are refactoring and improvements for "st/nine: Add drirc option to use data_internal for dynamic textures"
  • "st/nine: Recompile optimized shaders based on b/i consts" to "st/nine: Enable computing const_ranges" do changes to the same parts of the code, and thus are order dependent. Most of theses patches are refactoring.

I don't expect to have reviews for all these patches for 19.1 (and I usually don't have for this types of series which is ok). Hopefully there shouldn't be regressions (these patches - except some recent - land first on our github ixit Mesa-3D branch and thus have been tested by several users), but if you have suggestions, remarks, or anything else, don't hesitate.

Merge request reports