Skip to content

nine: Various fixes and improvements

Axel Davy requested to merge axeldavy/mesa:nine_fixes_and_improvements into master

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

The first part of this series concerns fixes of issues I found with -fsanitize=address and wine tests, and also compiling mesa with clang.

Then I fix a few games, and improve the implementation of the Ex interface. CS-GO should work again.

I have some virtual memory reduction patches (Use PIPE_MAP_ONCE such that the persistent buffers get unmapped, not loading llvmpipe by default anymore).

Finally I improve a bit thread_submit=true.

In addition I introduce new drirc configuration options / env vars to tune behaviour or change the defaults:

New vars:
. force_sw_rendering_on_cpu (default to false). Setting to true, will make gallium nine use llvmpipe again for the REF rendering device and ProcessVertices(). Else the gpu device will be used for these features. Most games don't use either features, and there's just a minor interest in using llvmpipe for them. As loading llvmpipe seems to use non-negligible virtual memory (especially on many core systems), it's better for now to not use it anymore.
. override_vram_size (default to no override). This can be used to advertise lower than available vram memory. It can be useful for games which don't support more than 2GB of VRAM, or games which take a long time to load because they measure available memory by allocating until memory is full.

Default changes:
. tearfree_discard (new default: true). Native D3D9 does tear when vsync is off. This ensures lowest input lag, but most users would likely prefer no tearing. The new default removes the tearing.
. thread_submit (new default: true). On desktop, apps typically send to the display server buffers not finished rendering (GL does that, vulkan too). Another way is to wait the buffer is finished rendering in a separate thread before submitting it. This is what this env var enables for nine. The advantage is that pageflips cannot miss (they can miss if the buffer is not finished being rendered in time). The disadvantage is that input lag can be very slightly increased in some corner cases (as the time window to register for pageflipping ends a bit earlier than the limit to being finished rendering). My view is that missing a pageflip is very bad (it basically means you could render > 60 fps and not have 60 fps on screen). The reason I didn't make this option default sooner is that in some scenarios it was not performing as good as without it. It should be fixed hopefully in this patch series.
. texture_memory_limit (new default: 128MB). This new option introduced with the memfd patch series defaulted to 512MB. I think it is a bit too ambitious, and I'd rather set a low default and have users increase it for games that would benefit from it (games with high res texture patches. Increasing will reduce loading times of the high res textures).
. csmt_force (unchanged default). Now csmt_force=false disables more features which can reduce a bit virtual memory usage. This could be useful in contended scenarios.

Merge request reports