lima: wire up MSAA 4x support
authorVasily Khoruzhick <anarsoul@gmail.com>
Fri, 26 Nov 2021 07:56:41 +0000 (23:56 -0800)
committerMarge Bot <emma+marge@anholt.net>
Tue, 28 Jun 2022 00:00:35 +0000 (00:00 +0000)
commit24be0119016f6181f5a39e6405f17ad199bd695c
tree44ce4ebee37f597f0d8326847b355de8ae99bd7f
parentf93bee19d9c9275c7dffa19fc9d4c795950b4359
lima: wire up MSAA 4x support

Utgard supports MSAA 4x, so wire it up.

RSW bits were already REd by Luc, the only remaining part was storing
non-resolved buffers, reloading them (including for depth/stencil) and
doing MSAA resolve.

To store non-resolved buffer we need to set mrt_pitch and mrt_bits
registers in WB, and to resolve non-resolved buffer we need to reload
it into individual samples and then write out with mrt_bits = 0, it's
now done by lima blitter.

We also need to do resolve on transfer_map() of multi-sampled buffers,
so utilize u_transfer_helper for that.

As a side fix, it turns out that our wb_reg definition wasn't correct,
'zero' isn't always zero, it's set if we need to swap channels, and
it goes before mrt_bits. mrt_bits actually enables multiple MRTs,
so this commit renames 'zero' to 'flags' and changes its position.

If mrt_bits == 0 and MSAA is enabled, GPU does resolve
in place, to expose this functionality we set PIPE_CAP_SURFACE_SAMPLE_COUNT.

Fixes dEQP-GLES2.functional.multisample.*

Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13963>
15 files changed:
docs/features.txt
src/gallium/drivers/lima/lima_blit.c
src/gallium/drivers/lima/lima_blit.h
src/gallium/drivers/lima/lima_context.c
src/gallium/drivers/lima/lima_context.h
src/gallium/drivers/lima/lima_draw.c
src/gallium/drivers/lima/lima_gpu.h
src/gallium/drivers/lima/lima_job.c
src/gallium/drivers/lima/lima_parser.c
src/gallium/drivers/lima/lima_resource.c
src/gallium/drivers/lima/lima_resource.h
src/gallium/drivers/lima/lima_screen.c
src/gallium/drivers/lima/lima_state.c
src/gallium/drivers/lima/lima_texture.c
src/gallium/drivers/lima/lima_texture.h