platform/upstream/mesa.git
3 years agoaco: Set block_kind_export_end in create_vs/fs_exports.
Timur Kristóf [Thu, 8 Apr 2021 13:42:17 +0000 (15:42 +0200)]
aco: Set block_kind_export_end in create_vs/fs_exports.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10106>

3 years agoaco: Extract ngg_nogs_export_prim_id to a separate function.
Timur Kristóf [Thu, 8 Apr 2021 13:39:39 +0000 (15:39 +0200)]
aco: Extract ngg_nogs_export_prim_id to a separate function.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10106>

3 years agoaco: Use s_setprio 3 at the beginning of every VS and TES.
Timur Kristóf [Thu, 8 Apr 2021 11:38:13 +0000 (13:38 +0200)]
aco: Use s_setprio 3 at the beginning of every VS and TES.

The user-set priority of shaders matters very little, but we hope
this might still help speed up VS input loads especially.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10106>

3 years agoaco: Remove useless s_setprio near gs_alloc_req.
Timur Kristóf [Thu, 8 Apr 2021 11:32:01 +0000 (13:32 +0200)]
aco: Remove useless s_setprio near gs_alloc_req.

We learned that the gs_alloc_req is not actually when the export
space allocation happens. So it makes no sense to prioritize it.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10106>

3 years agozink: fall back from cached to non-cached memory
Erik Faye-Lund [Wed, 14 Apr 2021 11:35:34 +0000 (13:35 +0200)]
zink: fall back from cached to non-cached memory

This fixes basic rendering on top of V3DV, which doesn't seem to expose
the cached memory we expect and love.

Fixes: 598dc3dca41 ("zink: use cached memory for all resources when possible")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10230>

3 years agoaco: Align NGG scratch size to 16 so a single ds_read can always read it.
Timur Kristóf [Sat, 10 Apr 2021 12:51:56 +0000 (14:51 +0200)]
aco: Align NGG scratch size to 16 so a single ds_read can always read it.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10155>

3 years agoaco: Optimize workgroup exclusive scan to better avoid bank conflicts.
Timur Kristóf [Sat, 10 Apr 2021 12:52:55 +0000 (14:52 +0200)]
aco: Optimize workgroup exclusive scan to better avoid bank conflicts.

Previously, every wave had multiple active lanes read the LDS, and
the data was processed by VALU DPP instructions.

Now, only the first lane reads the LDS in order to avoid bank
conflicts, and the results are processed by SALU.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10155>

3 years agopanfrost: Fix pan_blitter_get_blit_shader()
Boris Brezillon [Wed, 14 Apr 2021 12:11:19 +0000 (14:11 +0200)]
panfrost: Fix pan_blitter_get_blit_shader()

The key passed to _mesa_hash_table_search() is wrong, fix it.

Fixes: 8ba2f9f69858 ("panfrost: Create a blitter library to replace the existing preload helpers")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10232>

3 years agozink: do not clear on cpu
Erik Faye-Lund [Tue, 13 Apr 2021 12:27:39 +0000 (14:27 +0200)]
zink: do not clear on cpu

This seems to simply be a mixup of what utility function to use.
util_clear_render_target clears on the CPU, whereas
util_blitter_clear_render_target clears on the GPU. Because we do the
zink_blit_begin dance, it seems reasonable to assume the latter was
intended.

Fixes: 622f8f6ed57 ("zink: add a pipe_context::clear_texture hook")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10211>

3 years agoci: Update to latest ci-templates
Michel Dänzer [Thu, 1 Apr 2021 09:56:17 +0000 (11:56 +0200)]
ci: Update to latest ci-templates

This is possible again thanks to
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9955 , and
this MR requires rebuilding all templates based docker images anyway,
so we can pull in the latest templates for free.

We need to exclude /dev/* when unpacking rootfs tarballs for the
arm_test image, since x86 container build jobs do not allow mknod
anymore with current templates. The baremetal test jobs have another
filesystem mounted on /dev anyway.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9833>

3 years agoci: Do not append ci-templates commit hash to Windows docker image tag
Michel Dänzer [Wed, 14 Apr 2021 12:34:16 +0000 (14:34 +0200)]
ci: Do not append ci-templates commit hash to Windows docker image tag

We're not using the templates for the Windows image.

Fixes needless rebuild of the Windows image when the ci-templates
commit is changed.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9833>

3 years agoci: Install Rust & cargo from Debian for x86_test* images
Michel Dänzer [Mon, 22 Mar 2021 16:02:50 +0000 (17:02 +0100)]
ci: Install Rust & cargo from Debian for x86_test* images

Also build deqp-runner once in x86_test-base instead of separately in
x86_test-{gl,vk}.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9833>

3 years agoci: Install GLVND from Debian bullseye
Michel Dänzer [Mon, 22 Mar 2021 15:45:54 +0000 (16:45 +0100)]
ci: Install GLVND from Debian bullseye

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9833>

3 years agoci: Install llvm-spirv from Debian bullseye
Michel Dänzer [Mon, 22 Mar 2021 15:43:02 +0000 (16:43 +0100)]
ci: Install llvm-spirv from Debian bullseye

While we're at it, use a tag instead of whatever happens to be the
current main branch for building libclc.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9833>

3 years agoci: Install spirv-tools from Debian bullseye
Michel Dänzer [Mon, 22 Mar 2021 15:31:48 +0000 (16:31 +0100)]
ci: Install spirv-tools from Debian bullseye

v2:
* Drop local build from x86_test-gl image as well (Eric Anholt)

Reviewed-by: Eric Anholt <eric@anholt.net> # v1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9833>

3 years agoci: Install librenderdoc from Debian bullseye
Michel Dänzer [Sat, 20 Mar 2021 10:00:05 +0000 (11:00 +0100)]
ci: Install librenderdoc from Debian bullseye

Debian bullseye has a separate command-line-only renderdoc package, so
no need to install Qt packages and build renderdoc anymore.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3125
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9833>

3 years agoci: Move docker images from Debian buster to bullseye
Michel Dänzer [Fri, 19 Mar 2021 11:52:35 +0000 (12:52 +0100)]
ci: Move docker images from Debian buster to bullseye

Among other things, this gets us GCC 10 (was 6).

Requires some changes to third party components we use:

* Install apitrace (& waffle) from Debian; was hitting issues with the
  local build, and it's the same version 9.0 anyway.
* Update Fossilize to a newer commit which builds with GCC 10.
* apt.llvm.org repositories are no longer needed.
* Use an SPIRV-LLVM-Translator commit which builds with LLVM 11.0.1.
* Install XCB packages from Debian, 1.13 fails to build with Python 3.9.
* Install wayland-protocols from Debian, 1.12 is too old for
  libgtk-3-dev in bullseye.

LLVM 7/8 packages are no longer available.

Also adapt expected test results to Xvfb now exposing multi-samle
GLXFBConfigs.

v2:
* Install clang instead of clang-11.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3124
Reviewed-by: Eric Anholt <eric@anholt.net> # v1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9833>

3 years agoci: Bump LLVM/clang from 10 to 11
Michel Dänzer [Fri, 19 Mar 2021 11:25:54 +0000 (12:25 +0100)]
ci: Bump LLVM/clang from 10 to 11

Preparation for moving to Debian bullseye, which has packages for LLVM
9 & 11, but not 10.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9833>

3 years agoci: Do not install armhf LLVM packages
Michel Dänzer [Mon, 22 Mar 2021 11:15:04 +0000 (12:15 +0100)]
ci: Do not install armhf LLVM packages

LLVM support has been disabled in the meson-armhf job for some time, so
they were unused.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9833>

3 years agointel/blorp: Initialize texture_data[0]
Michel Dänzer [Thu, 1 Apr 2021 13:16:35 +0000 (15:16 +0200)]
intel/blorp: Initialize texture_data[0]

Avoids warning with GCC 10:

../src/intel/blorp/blorp_blit.c: In function 'blorp_nir_combine_samples':
../src/intel/blorp/blorp_blit.c:702:25: error: 'texture_data[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  702 |       texture_data[0] = nir_fmul(b, texture_data[0],
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  703 |                                  nir_imm_float(b, 1.0 / tex_samples));
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9833>

3 years agor600/sb: Use assignments for resetting struct r600_sb::literal
Pierre-Eric Pelloux-Prayer [Tue, 23 Mar 2021 09:40:43 +0000 (10:40 +0100)]
r600/sb: Use assignments for resetting struct r600_sb::literal

Avoids warning with newer GCC:

../src/gallium/drivers/r600/sb/sb_sched.cpp: In member function 'void r600_sb::literal_tracker::reset()':
../src/gallium/drivers/r600/sb/sb_sched.cpp:1953:26: error: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct r600_sb::literal'; use assignment or value-initialization instead [-Werror=class-memaccess]
 1953 |  memset(lt, 0, sizeof(lt));
      |                          ^
In file included from ../src/gallium/drivers/r600/sb/sb_sched.cpp:35:
../src/gallium/drivers/r600/sb/sb_bc.h:409:8: note: 'struct r600_sb::literal' declared here
  409 | struct literal {
      |        ^~~~~~~

[ Michel Dänzer:
* Expanded commit log
v2:
* Clear all 4 members of lt[4] (Eric Anholt)
]

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9833>

3 years agoci: Fix HTML summary path for piglit OpenCL job artifacts
Michel Dänzer [Tue, 23 Mar 2021 14:27:17 +0000 (15:27 +0100)]
ci: Fix HTML summary path for piglit OpenCL job artifacts

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9833>

3 years agoci/v3dv: skip Vulkan waiver tests
Juan A. Suarez Romero [Wed, 14 Apr 2021 11:36:25 +0000 (13:36 +0200)]
ci/v3dv: skip Vulkan waiver tests

Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10231>

3 years agoradv: fix conditions for running nir_opt_vectorize
Rhys Perry [Wed, 14 Apr 2021 09:18:17 +0000 (10:18 +0100)]
radv: fix conditions for running nir_opt_vectorize

No fossil-db changes, probably because all fp16 shaders have at least one
16-bit mov or vec2 somehwere.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10227>

3 years agotu: Expose VK_KHR_relaxed_block_layout
Connor Abbott [Fri, 4 Dec 2020 16:26:31 +0000 (17:26 +0100)]
tu: Expose VK_KHR_relaxed_block_layout

This was absorbed into Vulkan 1.1, but we forgot to expose it
separately. It's a subset of what's allowed by
VK_EXT_scalar_block_layout.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8695>

3 years agotu: Expose VK_KHR_spirv_1_4 and VK_EXT_scalar_block_layout
Connor Abbott [Thu, 3 Dec 2020 10:46:48 +0000 (11:46 +0100)]
tu: Expose VK_KHR_spirv_1_4 and VK_EXT_scalar_block_layout

VK_KHR_spirv_1_4 is trivial because vtn already supports all the added
SPIR-V features that aren't gated behind Vulkan extensions. I've
observed some robustness2 CTS tests requiring this. However there are
a few tests currently failing due to lacking spilling.

VK_EXT_scalar_block_layout should also be trivial, since support for
"straddling" UBO loads was added recently for other reasons. This is
used by every robustness2 CTS test.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8695>

3 years agov3d: do not emit attribute if has no resource
Juan A. Suarez Romero [Tue, 2 Feb 2021 12:38:49 +0000 (13:38 +0100)]
v3d: do not emit attribute if has no resource

When emitting the GL shader state, verify the attribute has a resource
bound; otherwise just skip it

v2 (chema):
 - Move comment
 - Set num_elements_to_emit = 1 if it is 0

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4205
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8826>

3 years agov3dv/pipeline: reduce descriptor_map size
Alejandro Piñeiro [Tue, 13 Apr 2021 21:19:23 +0000 (23:19 +0200)]
v3dv/pipeline: reduce descriptor_map size

64 was a temporary and conservative "big enough" value, but we can do
better.

Note that as mentioned on the FIXME, we could be even more detailed,
adding a descriptor map allocate method based on the descriptor
type. That would mean more individual allocations, and slightly more
complexity.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10207>

3 years agov3dv/device: fix and cleanup v3dv limits
Alejandro Piñeiro [Tue, 13 Apr 2021 21:18:37 +0000 (23:18 +0200)]
v3dv/device: fix and cleanup v3dv limits

We had some cases were we have defined a value on v3dv_limits but
using other when setting it at GetPhysicalDeviceProperties (like
dynamic storage buffers).

Also we do a cleanup. So far we were adding on v3dv_limits only the
limits that were used on more that one place. But then we had the
definition of several limits on different places. It is clearer to
have a common place for those, even if it is used on just one place.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10207>

3 years agov3dv/device: do not compute per-pipeline limits multiplying per-stage
Alejandro Piñeiro [Tue, 13 Apr 2021 21:14:43 +0000 (23:14 +0200)]
v3dv/device: do not compute per-pipeline limits multiplying per-stage

There were two problems here:

   * We were multiplying by 6, when for graphics pipelines, we only
     support 2.

   * Right now we are tracking descriptors through the descriptor
     maps, and we have one per pipeline. So in practice there is no
     difference between per-stage and per-pipeline limits. So far this
     was not a problem, we could revisit in the future.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10207>

3 years agoradv: advertise attachmentFragmentShadingRate on GFX10.3
Samuel Pitoiset [Tue, 15 Dec 2020 10:54:31 +0000 (11:54 +0100)]
radv: advertise attachmentFragmentShadingRate on GFX10.3

Layered VRS attachments is for later.
The CTS failures are similar to the existing ones, I will investigate
soon.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10187>

3 years agoradv: configure the VRS combiners when an attachment is used
Samuel Pitoiset [Fri, 9 Apr 2021 11:58:53 +0000 (13:58 +0200)]
radv: configure the VRS combiners when an attachment is used

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10187>

3 years agoradv: copy VRS rates to HTILE when beginning a subpass
Samuel Pitoiset [Thu, 8 Apr 2021 17:10:00 +0000 (19:10 +0200)]
radv: copy VRS rates to HTILE when beginning a subpass

The global VRS image is created on-demand to avoid wasting space.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10187>

3 years agoradv: add support for copying VRS rates into HTILE
Samuel Pitoiset [Tue, 8 Dec 2020 14:36:22 +0000 (15:36 +0100)]
radv: add support for copying VRS rates into HTILE

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10187>

3 years agoradv: bind our internal depth buffer when not provided by the app
Samuel Pitoiset [Thu, 8 Apr 2021 09:43:00 +0000 (11:43 +0200)]
radv: bind our internal depth buffer when not provided by the app

When a subpass uses a VRS attachment without binding a depth/stencil
attachment (yes, this is allowed by the Vulkan spec), we have to bind
our internal depth buffer that contains the VRS data.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10187>

3 years agoradv: handle the VRS attachment subpass
Samuel Pitoiset [Fri, 9 Apr 2021 11:57:21 +0000 (13:57 +0200)]
radv: handle the VRS attachment subpass

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10187>

3 years agoradv: create an image for VRS if no depth/stencil attachment is bound
Samuel Pitoiset [Wed, 7 Apr 2021 15:55:00 +0000 (17:55 +0200)]
radv: create an image for VRS if no depth/stencil attachment is bound

The Vulkan spec doesn't require the application to always binds
a depth/stencil attachment when a VRS attachment is used inside the
same subpass.

To handle this situation, the driver creates a global 4096x4096
VRS image that will be bind at draw-time if needed. This isn't
super ideal but we have to do that unfortunately.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10187>

3 years agoradv: allow HTILE for very small images if VRS attachment is used
Samuel Pitoiset [Mon, 12 Apr 2021 13:01:24 +0000 (15:01 +0200)]
radv: allow HTILE for very small images if VRS attachment is used

We need a HTILE buffer to store the VRS rates.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10187>

3 years agoradv: update the HTILE clear word when VRS is used
Samuel Pitoiset [Mon, 22 Mar 2021 17:15:26 +0000 (18:15 +0100)]
radv: update the HTILE clear word when VRS is used

SR1 is the VRS x-rate.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10187>

3 years agoradv: do not use the whole HTILE buffer for depth when VRS is used
Samuel Pitoiset [Fri, 9 Apr 2021 11:26:30 +0000 (13:26 +0200)]
radv: do not use the whole HTILE buffer for depth when VRS is used

The stencil data needs to be included for storing the VRS rates
into the HTILE buffer.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10187>

3 years agoradv: configure the VRS HTILE encoding size
Samuel Pitoiset [Fri, 9 Apr 2021 11:30:01 +0000 (13:30 +0200)]
radv: configure the VRS HTILE encoding size

Any depth buffer can potentially use VRS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10187>

3 years agoradv: determine if attachment VRS is enabled
Samuel Pitoiset [Mon, 22 Mar 2021 16:55:40 +0000 (17:55 +0100)]
radv: determine if attachment VRS is enabled

When VRS attachment, any depth buffer can potentially be used for VRS.
We also have to create a global depth buffer if the app doesn't
provide one.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10187>

3 years agoradv: do not enable DCC for fragment shading rate attachments
Samuel Pitoiset [Mon, 22 Mar 2021 16:49:24 +0000 (17:49 +0100)]
radv: do not enable DCC for fragment shading rate attachments

That's unnecessary.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10187>

3 years agoradv: do not allow MSAA with fragment shading rate attachments
Samuel Pitoiset [Wed, 7 Apr 2021 14:48:59 +0000 (16:48 +0200)]
radv: do not allow MSAA with fragment shading rate attachments

The Vulkan spec requires the implementation to only supports
VK_SAMPLE_COUNT_1_BIT with fragment shading rate attachments.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10187>

3 years agoradv: expose R8_UINT as the only supported format for VRS attachments
Samuel Pitoiset [Fri, 9 Apr 2021 11:58:15 +0000 (13:58 +0200)]
radv: expose R8_UINT as the only supported format for VRS attachments

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10187>

3 years agoac/surface: store the HTILE pitch to the surface
Samuel Pitoiset [Wed, 7 Apr 2021 13:41:05 +0000 (15:41 +0200)]
ac/surface: store the HTILE pitch to the surface

This will be used to copy VRS rates to the HTILE buffer.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10187>

3 years agoac/surface: implement HtileAddrFromCoord in NIR
Samuel Pitoiset [Wed, 7 Apr 2021 11:34:51 +0000 (13:34 +0200)]
ac/surface: implement HtileAddrFromCoord in NIR

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10187>

3 years agoac/surface: copy the HTILE equations to the surface
Samuel Pitoiset [Wed, 7 Apr 2021 13:59:24 +0000 (15:59 +0200)]
ac/surface: copy the HTILE equations to the surface

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10187>

3 years agoac/surface: increase gfx9_meta_equation::gfx10_bits by 4 elements
Samuel Pitoiset [Tue, 13 Apr 2021 11:38:08 +0000 (13:38 +0200)]
ac/surface: increase gfx9_meta_equation::gfx10_bits by 4 elements

For the HTILE equation.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10187>

3 years agoac/surface: rename gfx9_dcc_equation to gfx9_meta_equation
Samuel Pitoiset [Tue, 13 Apr 2021 11:32:44 +0000 (13:32 +0200)]
ac/surface: rename gfx9_dcc_equation to gfx9_meta_equation

gfx9_meta_equation will be used to store the HTILE equation.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10187>

3 years agoac/surface: add a test of HtileAddrFromCoord prototype outside of addrlib
Samuel Pitoiset [Tue, 6 Apr 2021 08:48:41 +0000 (10:48 +0200)]
ac/surface: add a test of HtileAddrFromCoord prototype outside of addrlib

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10187>

3 years agoac/surface: rename ac_surface_dcc_address_test.c
Samuel Pitoiset [Tue, 13 Apr 2021 11:53:09 +0000 (13:53 +0200)]
ac/surface: rename ac_surface_dcc_address_test.c

This file will also contain HTILE equation tests.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10187>

3 years agoamd/addrlib: expose HTILE address equations to drivers on GFX10+
Samuel Pitoiset [Mon, 5 Apr 2021 14:13:34 +0000 (16:13 +0200)]
amd/addrlib: expose HTILE address equations to drivers on GFX10+

Similar to the DCC address equations. Only GFX10+ because this
is for copying VRS rates to the HTILE buffer.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10187>

3 years agolavapipe: ask pipe-driver for int16 support
Erik Faye-Lund [Fri, 9 Apr 2021 08:47:27 +0000 (10:47 +0200)]
lavapipe: ask pipe-driver for int16 support

We shouldn't assume the driver can deal with int16 unless it reports
that it can.

... And LLVMpipe isn't quite there yet, see this MR for details:

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10185

Fixes: b38879f8c5f ("vallium: initial import of the vulkan frontend")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10189>

3 years agolavapipe: check all graphics stages
Erik Faye-Lund [Mon, 12 Apr 2021 15:56:34 +0000 (17:56 +0200)]
lavapipe: check all graphics stages

For these caps, we need to check all stages to be sure we've got things
right.

Again, this is probably benign, because LLVMpipe should support the same
value for all stages.

Fixes: b38879f8c5f ("vallium: initial import of the vulkan frontend")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10189>

3 years agolavapipe: check all vertex-stages
Erik Faye-Lund [Mon, 12 Apr 2021 15:16:12 +0000 (17:16 +0200)]
lavapipe: check all vertex-stages

We should really check for the minimum of all supported vertex-stages
here, not just the vertex-shader.

This shouldn't make any real-world difference, because we really only
support LLVMpipe here, and that driver has the same limits for all
stages. But it seems better to actually check all stages instead of just
assuming.

Fixes: b38879f8c5f ("vallium: initial import of the vulkan frontend")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10189>

3 years agolavapipe: do not subtract 8 from enum
Erik Faye-Lund [Mon, 12 Apr 2021 15:47:25 +0000 (17:47 +0200)]
lavapipe: do not subtract 8 from enum

This seems arbitrary, and makes us check for PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS
instead of PIPE_SHADER_CAP_MAX_SHADER_IMAGES, which isn't what we want.

The end result is that we accidentally exposed 128 shader images,
instead of 16. This can lead to us writing outside of the array of
shader images in llvmpipe_set_shader_images, among other bad things.

Fixes: b38879f8c5f ("vallium: initial import of the vulkan frontend")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10189>

3 years agost/nine: Default tearfree_discard to true
Axel Davy [Sat, 10 Apr 2021 21:53:07 +0000 (23:53 +0200)]
st/nine: Default tearfree_discard to true

With tearfree_discard=false, we tear when rendering
fullscreen apps with vsync off.

This is a feature in the sense it's the same as the native
implementation. This also means lower input lag.

However I think most users will prefer to have no tearing,
and don't care about sub refresh-rate input lag.

Thus it's better to default tearfree_discard to true.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Default thread_submit to true
Axel Davy [Sat, 10 Apr 2021 21:40:20 +0000 (23:40 +0200)]
st/nine: Default thread_submit to true

When rendering fullscreen with vsync on at
a rate close to the refresh rate, you can
miss pageflips by submitting buffers for pageflip
that end up not finished being rendered when the pageflip is due.

With Nine in this situation you could get half the refresh
rate fps before this patch.

Due to the way the presentation backend is implemented,
it's not possible to easily detect the situation and adapt (use
one more backbuffer, but only in this scenario to not increase input
lap when the issue is not present).

thread_submit doesn't have this issue.

Let's default thread_submit to true.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Improve performance with thread_submit
Axel Davy [Fri, 12 Mar 2021 20:28:39 +0000 (21:28 +0100)]
st/nine: Improve performance with thread_submit

Use the Async flush flag to return faster during
Present() when thread_submit is used.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Bump num of backbuffers for tearfree thread_submit
Axel Davy [Mon, 8 Mar 2021 17:44:32 +0000 (18:44 +0100)]
st/nine: Bump num of backbuffers for tearfree thread_submit

Running some high fps benchmarks, thread_submit gets
subpar fps with the option tearfree_discard.
Increasing the number of backbuffers fixes it.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Lower texture_memory_limit default
Axel Davy [Sat, 10 Apr 2021 21:01:16 +0000 (23:01 +0200)]
st/nine: Lower texture_memory_limit default

512 MB is too ambitious as default value.
128 MB seems safer, and users can increase the limit
manually for the few games that would benefit from it.

Also fixes a typo in the description

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Make it optional to use a sw renderer
Axel Davy [Sat, 10 Apr 2021 20:52:47 +0000 (22:52 +0200)]
st/nine: Make it optional to use a sw renderer

Until the problem described in
https://gitlab.freedesktop.org/mesa/mesa/-/issues/4489
is fixed, the advantages of using a sw renderer for the
sw rendering in nine are too small compared to the
disadvantages.

Add an option to control whether we use a sw renderer,
and make it so by default we don't.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Allow to override the vram size
Axel Davy [Mon, 15 Mar 2021 21:35:26 +0000 (22:35 +0100)]
st/nine: Allow to override the vram size

This can be useful for debugging, or for some apps
not supporting >= 4GB of vram.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Disable buffer_upload when csmt is off
Axel Davy [Mon, 8 Mar 2021 17:48:23 +0000 (18:48 +0100)]
st/nine: Disable buffer_upload when csmt is off

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Use PIPE_MAP_ONCE for persistent buffers
Axel Davy [Sat, 13 Mar 2021 21:39:28 +0000 (22:39 +0100)]
st/nine: Use PIPE_MAP_ONCE for persistent buffers

This enables radeonsi to really unmap on release,
which reduces virtual memory usage.

Do it only on 32 bits, as it can reduce performance if the
allocation is reused.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Add fallback for YUV formats
Axel Davy [Sat, 10 Apr 2021 19:58:59 +0000 (21:58 +0200)]
st/nine: Add fallback for YUV formats

Adds alternative format to store YUV textures/surfaces.

These will be converted on upload to the alternative format.
Fixes: https://github.com/iXit/wine-nine-standalone/issues/39

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Do not memset buffers twice
Axel Davy [Sat, 10 Apr 2021 21:22:06 +0000 (23:22 +0200)]
st/nine: Do not memset buffers twice

No need to apply memset on an allocation
from align_calloc.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Have NOOVERWRITE win over DISCARD
Axel Davy [Sat, 27 Mar 2021 21:33:06 +0000 (22:33 +0100)]
st/nine: Have NOOVERWRITE win over DISCARD

I held for a long time the belief DISCARD wins
over NOOVERWRITE, backed by experiments.

But probably both behaviours are ok.
For perf it is better to have NOOVERWRITE win.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Add logging to Ex function
Axel Davy [Mon, 15 Mar 2021 22:42:47 +0000 (23:42 +0100)]
st/nine: Add logging to Ex function

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Complete *Ex stubs
Axel Davy [Mon, 15 Mar 2021 21:22:05 +0000 (22:22 +0100)]
st/nine: Complete *Ex stubs

Returning D3D_OK instead of an error when it
makes sense.
Return the value passed previously (or the default)
when it makes sense.
Add (void)variable for unused input variables.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Pseudo implement Create*Ex functions
Axel Davy [Mon, 15 Mar 2021 21:02:37 +0000 (22:02 +0100)]
st/nine: Pseudo implement Create*Ex functions

It seems some apps use them.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Improve Reset on Ex devices
Axel Davy [Fri, 12 Mar 2021 14:07:06 +0000 (15:07 +0100)]
st/nine: Improve Reset on Ex devices

Found with wine tests

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Pseudo implement set/getClipstatus
Axel Davy [Wed, 10 Mar 2021 21:38:14 +0000 (22:38 +0100)]
st/nine: Pseudo implement set/getClipstatus

Not sure why any app would use this in production,
it seems like a debugging feature. Still some do make
the calls.

Fixes: https://github.com/iXit/wine-nine-standalone/issues/99

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Catch redundant scissor and viewport settings
Axel Davy [Fri, 12 Mar 2021 14:57:13 +0000 (15:57 +0100)]
st/nine: Catch redundant scissor and viewport settings

The redundancy check is done in the nine_context function,
rather than the device function, in order to also filter
calls from SetRenderTarget and Reset*.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Fix ff has_aNrm computation
Axel Davy [Sat, 27 Mar 2021 12:45:17 +0000 (13:45 +0100)]
st/nine: Fix ff has_aNrm computation

In some cases the wrong computation led the
normal to be zero instead of the correct value,
which led to artifacts.

Fixes: https://github.com/iXit/wine-nine-standalone/issues/105

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Fix ps ff BLENDTEXTUREALPHA
Axel Davy [Sat, 27 Mar 2021 11:36:34 +0000 (12:36 +0100)]
st/nine: Fix ps ff BLENDTEXTUREALPHA

This ff ps operation has the texture alpha as input.
Thus we need to sample the texture.

Fixes: https://github.com/iXit/wine-nine-standalone/issues/105

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Refuse depth buffers as rendertargets
Axel Davy [Sat, 20 Mar 2021 12:50:45 +0000 (13:50 +0100)]
st/nine: Refuse depth buffers as rendertargets

If we allow them, some apps try to use them
as rendertargets.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Clamp max_anisotropy
Axel Davy [Thu, 18 Mar 2021 22:36:28 +0000 (23:36 +0100)]
st/nine: Clamp max_anisotropy

GL does the same.

Fixes the low texture quality issue of
https://github.com/iXit/wine-nine-standalone/issues/21

The are some indications it might not be the native
behaviour (which makes sense, the native filtering
of states seems more to not update internal states
when the passed value is invalid).
However it's better visually to have anisotropic filtering
enabled in these buggy cases.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Ignore swizzle on samplers
Axel Davy [Thu, 11 Mar 2021 17:33:24 +0000 (18:33 +0100)]
st/nine: Ignore swizzle on samplers

Prevents a crash running wine tests

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Increase number of constants of vs1_sw
Axel Davy [Fri, 12 Mar 2021 12:38:59 +0000 (13:38 +0100)]
st/nine: Increase number of constants of vs1_sw

Wine tests seem to indicate more the 256 should
be supported for this case, but I couldn't find the
doc for how much it should be. Use the vs >= 2
settings for now.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Remove errors on unsupported lock flags
Axel Davy [Fri, 12 Mar 2021 20:28:57 +0000 (21:28 +0100)]
st/nine: Remove errors on unsupported lock flags

Some applications seem to pass undefined flags...
And we shouldn't return an error.

Found investigating:
https://github.com/iXit/wine-nine-standalone/issues/100

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Handle D3DFMT_NULL multisampling
Axel Davy [Thu, 11 Mar 2021 19:55:48 +0000 (20:55 +0100)]
st/nine: Handle D3DFMT_NULL multisampling

When D3DFMT_NULL is set as render target,
we must take the multisampling state
from the depth buffer.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Enable multisampling also without depth buffer
Axel Davy [Thu, 11 Mar 2021 19:45:39 +0000 (20:45 +0100)]
st/nine: Enable multisampling also without depth buffer

Found with wine tests.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Fix alpha to coverage states
Axel Davy [Thu, 11 Mar 2021 19:43:04 +0000 (20:43 +0100)]
st/nine: Fix alpha to coverage states

The sequence of states to disable NVidia alpha
to coverage was disabling AMD alpha to coverage.
This patch fixes it.

Found with wine tests.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Improve Surface GetContainer
Axel Davy [Fri, 12 Mar 2021 14:07:45 +0000 (15:07 +0100)]
st/nine: Improve Surface GetContainer

Prevents a crash in wine tests. Not sure
this behaviour is the correct one, but at
least it'll check the IID passed is the device
before returning it.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Prevent negative reference count
Axel Davy [Sat, 27 Mar 2021 19:55:58 +0000 (20:55 +0100)]
st/nine: Prevent negative reference count

Apparently this is a thing, according to wine tests

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Fix value of pipe_draw_info's max_index vertex
Axel Davy [Sat, 6 Mar 2021 13:40:35 +0000 (14:40 +0100)]
st/nine: Fix value of pipe_draw_info's max_index vertex

max_index didn't include draw.start

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Fix read outside bounds for some textures
Axel Davy [Sun, 28 Mar 2021 16:32:15 +0000 (18:32 +0200)]
st/nine: Fix read outside bounds for some textures

According to wine tests, some apps can allocate very
small ATI1/ATI2 textures levels.

The issue is that the CPU versions of these textures are stored
in buffers which size is the same as if the format was uncompressed.

Thus the content filled cannot possibly be correct for these levels.

The tests seems to hint when rendering with these levels the output
is bad, but at least it the runtime shouldn't crash when using them.

Previously nine would read outside bounds (found with asan) in this
scenario, as the gallium helper copies a full compressed block.

Instead do not copy anything for these levels.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Fix compilation warnings
Axel Davy [Sun, 28 Mar 2021 16:31:57 +0000 (18:31 +0200)]
st/nine: Fix compilation warnings

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Fix reading invalid pointer
Axel Davy [Sun, 28 Mar 2021 16:30:40 +0000 (18:30 +0200)]
st/nine: Fix reading invalid pointer

Apparently it is incorrect to use the pointer in
LIST_FOR_EACH_ENTRY like I used to.
Found with asan.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Prevent use after free on dtor
Axel Davy [Sun, 28 Mar 2021 10:26:48 +0000 (12:26 +0200)]
st/nine: Prevent use after free on dtor

Found with asan.
This->device was accessed after This was destroyed.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Fix invalid NULL check
Axel Davy [Sat, 10 Apr 2021 21:19:10 +0000 (23:19 +0200)]
st/nine: Fix invalid NULL check

Found with clang warnings.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Add missing breaks
Axel Davy [Sat, 10 Apr 2021 21:18:20 +0000 (23:18 +0200)]
st/nine: Add missing breaks

This makes clang warnings happier.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Fix cubetexture early destruction
Axel Davy [Fri, 12 Mar 2021 12:47:09 +0000 (13:47 +0100)]
st/nine: Fix cubetexture early destruction

When the surface creation fails, the dtor
can face NULL pointers for the surfaces.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Fix crash on texture creation failure
Axel Davy [Fri, 12 Mar 2021 12:16:13 +0000 (13:16 +0100)]
st/nine: Fix crash on texture creation failure

Fixes regression introduced by:
a179ea2e "st/nine: Use the texture memory helper"

The device is used on texture/surface dtor since this commit.
We need to early fill the device field in case of error.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agost/nine: Disable fpu exceptions during init
Axel Davy [Fri, 12 Mar 2021 12:03:01 +0000 (13:03 +0100)]
st/nine: Disable fpu exceptions during init

Prevents a crash in wine tests. The crash
seems to happen in llvmpipe.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>

3 years agoci: Update VK-GL-CTS to 1.2.6.0
Juan A. Suarez Romero [Mon, 12 Apr 2021 15:23:06 +0000 (17:23 +0200)]
ci: Update VK-GL-CTS to 1.2.6.0

v2:
 - Bump up MESA_ROOTFS_TAG instead of arm_build (Michel)

Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10136>

3 years agovirgl: Add simple disk cache
Stéphane Marchesin [Tue, 13 Apr 2021 04:26:26 +0000 (06:26 +0200)]
virgl: Add simple disk cache

Since virgl has no backend compilation, this is just a disk cache for the
frontend. As such it is very simple and only implements enough for
get_disk_shader_cache() to work.

With portal2 apitrace:
Before: 100.65 fps
After: 129.051 fps

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10200>

3 years agoradeonsi: avoid querying gpu state if possible
Pierre-Eric Pelloux-Prayer [Mon, 12 Apr 2021 06:28:46 +0000 (08:28 +0200)]
radeonsi: avoid querying gpu state if possible

No-op dispatch should only be setup for full reset, not soft-recovery resets.

The same trick cannot be used in si_get_reset_status because EGL expects
us to return GL_***_CONTEXT_RESET even if it has been fixed by a soft
recovery.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10179>