platform/upstream/mesa.git
2 years agonir: intel/compiler: Lower TXD on array surfaces on DG2+
Ian Romanick [Wed, 30 Mar 2022 23:36:06 +0000 (16:36 -0700)]
nir: intel/compiler: Lower TXD on array surfaces on DG2+

DG2 can only do sample_d and sample_d_c on 1D and 2D surfaces.  Cube
maps and 3D surfaces were already handled, but 1D array and 2D array
surfaces were not.

Fixes the following Vulkan CTS failures on DG2:

    dEQP-VK.glsl.texture_functions.texturegradclamp.isampler1darray_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.isampler2darray_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.sampler1darray_fixed_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.sampler1darray_float_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.sampler2darray_fixed_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.sampler2darray_float_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.usampler1darray_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.usampler2darray_fragment

The Fixes: tag below is a bit misleading. This commit adds another
lowering, similar to the one in the Fixes: commit, that probably should
have been added at the same time.  I just want to make sure this commit
gets applied everywhere that commit was also applied.

Fixes: 635ed58e527 ("intel/compiler: Lower txd for 3D samplers on XeHP.")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15681>

2 years agointel/tools: Fix build without drivers
Chad Versace [Mon, 28 Mar 2022 19:51:03 +0000 (12:51 -0700)]
intel/tools: Fix build without drivers

If Meson was configured with -Dtools=intel but all Intel drivers were
disabled, then Meson silently refused to build the tools.

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

2 years agovulkan: Move common format function to vulkan/util/vk_format.h
Rajnesh Kanwal [Wed, 30 Mar 2022 18:42:20 +0000 (19:42 +0100)]
vulkan: Move common format function to vulkan/util/vk_format.h

Moving duplicate vk_format helper functions to common
vulkan/util/vk_format.h and also renaming
vk_format_get_component_size_in_bits to match how amd and
freedreno name the same function. Not moving this function
to common code as freedreno's implementation is a bit different.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15696>

2 years agoamd: Use common u_format.h implementation for vk_format_get_component_bits.
Rajnesh Kanwal [Thu, 31 Mar 2022 14:16:48 +0000 (15:16 +0100)]
amd: Use common u_format.h implementation for vk_format_get_component_bits.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15696>

2 years agopvr: Fix seg fault in vkAllocateDescriptorSets().
Karmjit Mahil [Fri, 25 Feb 2022 09:29:57 +0000 (09:29 +0000)]
pvr: Fix seg fault in vkAllocateDescriptorSets().

In cases when no immutable samplers were present but sampler
descriptor set layout bindings were, a seg fault was being caused
by an attempt to get the immutable sampler from within the
immutable sampler array while the array was not allocated.

This commit also remove the binding type check since only those
specific types can have immutable samplers. The check is covered
by the descriptor set layout creation and assignment of
has_immutable_samplers.

This commit also makes the immutable samplers const, since they're
meant to be immutable.

This commit also adds has_immutable_samplers field to descriptor
set layout. Previously to check whether immutable
samplers were present or not you'd check for the layout binding's
descriptor count to be 0 and the immutable sampler offset to be 0.
This doesn't tell you everything. If you have a descriptor of the
appropriate type (VK_DESCRIPTOR_TYPE_{COMBINED_,}IMAGE_SAMPLER).
So descriptor count of >1. The offset can be 0 if you don't have
immutable sampler, or have them at the beginning of the immutable
samplers array. So you can't determine if you really have immutable
samplers or not. One could attempt to perform a NULL check on the
array but this would not work in cases where you have following set
layout bindings with immutable samplers as the array stores the
whole layout's immutable samplers.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15688>

2 years agopvr: fix clang unused function warning
Frank Binns [Wed, 30 Mar 2022 08:06:38 +0000 (09:06 +0100)]
pvr: fix clang unused function warning

../src/imagination/vulkan/pds/pvr_pds.c:230:31: warning: unused function 'pvr_pds_encode_doutv' [-Wunused-function]
static ALWAYS_INLINE uint32_t pvr_pds_encode_doutv(uint32_t cc,
                              ^

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15689>

2 years agozink: remove radv cwrite driver workaround
Mike Blumenkrantz [Thu, 31 Mar 2022 13:42:24 +0000 (09:42 -0400)]
zink: remove radv cwrite driver workaround

seems good

fixes #6185

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15695>

2 years agoradv: Fix vk_queue_to_radv for radv_image_queue_family_mask.
Bas Nieuwenhuizen [Thu, 17 Mar 2022 02:34:23 +0000 (03:34 +0100)]
radv: Fix vk_queue_to_radv for radv_image_queue_family_mask.

radv_image_queue_family_mask was still using queue family index values
for the special cases, while being passes a radv_queue_family enum.

This adds the bits to the enum and vk_queue_to_radv so we can implement
radv_image_queue_family_mask completely in terms of the enum.

Fixes: 1ec4e568 ("radv: abstract queue family away from queue family index.")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15423>

2 years agodri: Remove the megadriver compat stub
Adam Jackson [Wed, 30 Mar 2022 14:24:25 +0000 (10:24 -0400)]
dri: Remove the megadriver compat stub

This is for compatibility with loaders that don't know about
__DRI_DRIVER_GET_EXTENSIONS. xserver has supported that since 1.15.0,
which is almost nine years old now.

While we're about it, fix a comment in meson.build that used to be about
megadrivers to reflect reality.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15649>

2 years agodri: Remove the globalDriverAPI hacks
Adam Jackson [Wed, 30 Mar 2022 14:19:56 +0000 (10:19 -0400)]
dri: Remove the globalDriverAPI hacks

We now know that we always have access to the appropriate driver
extensions, so we can get the right __DriverAPIRec from the vtable.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15649>

2 years agodri: Fill in the driver extensions for the legacy createNewScreen paths
Adam Jackson [Wed, 30 Mar 2022 14:11:04 +0000 (10:11 -0400)]
dri: Fill in the driver extensions for the legacy createNewScreen paths

The inner routine is going to want access to the driver extensions, but
the legacy paths only give you the loader extensions.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15649>

2 years agodri: Implement __DRI_DRIVER_VTABLE
Adam Jackson [Tue, 29 Mar 2022 21:07:34 +0000 (17:07 -0400)]
dri: Implement __DRI_DRIVER_VTABLE

We're going to switch to using this instead of doing all these weird
globalDriverAPI hacks, which are fragile and weird.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15649>

2 years agodri: Fold away some unused indirection in __DriverAPIRec
Adam Jackson [Tue, 29 Mar 2022 17:36:37 +0000 (13:36 -0400)]
dri: Fold away some unused indirection in __DriverAPIRec

The context-related API doesn't vary between dri2 and drisw.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15649>

2 years agodzn: Properly support static blend constants
Boris Brezillon [Mon, 28 Mar 2022 07:39:20 +0000 (09:39 +0200)]
dzn: Properly support static blend constants

The current code was assuming blend constants to be passed dynamically,
which is wrong. Let's handle both the dynamic and static cases.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15608>

2 years agodzn: Fix alpha blend factor translation
Boris Brezillon [Mon, 28 Mar 2022 07:36:29 +0000 (09:36 +0200)]
dzn: Fix alpha blend factor translation

When VK_BLEND_FACTOR_xxx_COLOR is passed to an alpha equation what we
really want is the alpha component replicated on the RGBA channels,
which has dedicated enums in D3D12. Let's make sure we use the right
definition depending on the equation we're translating.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15608>

2 years agoradv: suspend/resume queries during internal driver operations
Samuel Pitoiset [Tue, 29 Mar 2022 16:48:34 +0000 (18:48 +0200)]
radv: suspend/resume queries during internal driver operations

Pipeline statistics and occlusion queries shouldn't be enabled for
internal driver operations like clears. Transform feedback queries
don't have to be suspended because the driver doesn't use streamout.

This fixes a bunch of Zink failures.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15660>

2 years agovbo/dlist: do not try to pad an empty draw
Erik Faye-Lund [Tue, 29 Mar 2022 10:38:46 +0000 (12:38 +0200)]
vbo/dlist: do not try to pad an empty draw

In the case where u_index_generator returns zero new vertices, we never
filled tmp_indices before trying to duplicate the last veretx. This
causes us to read unitialized memory.

This fixes a Valgrind issue triggering in glxgears on Zink:

---8<---
==296461== Invalid read of size 2
==296461==    at 0x570F335: compile_vertex_list (vbo_save_api.c:733)
==296461==    by 0x570FEFB: wrap_buffers (vbo_save_api.c:1021)
==296461==    by 0x571050A: upgrade_vertex (vbo_save_api.c:1134)
==296461==    by 0x571050A: fixup_vertex (vbo_save_api.c:1251)
==296461==    by 0x57114D1: _save_Normal3f (vbo_attrib_tmp.h:315)
==296461==    by 0x10B750: ??? (in /usr/bin/glxgears)
==296461==    by 0x10A2CC: ??? (in /usr/bin/glxgears)
==296461==    by 0x4B3F30F: (below main) (in /usr/lib/libc.so.6)
==296461==  Address 0x11ca23de is 2 bytes before a block of size 1,968 alloc'd
==296461==    at 0x4845899: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==296461==    by 0x570E647: compile_vertex_list (vbo_save_api.c:604)
==296461==    by 0x570FEFB: wrap_buffers (vbo_save_api.c:1021)
==296461==    by 0x571050A: upgrade_vertex (vbo_save_api.c:1134)
==296461==    by 0x571050A: fixup_vertex (vbo_save_api.c:1251)
==296461==    by 0x57114D1: _save_Normal3f (vbo_attrib_tmp.h:315)
==296461==    by 0x10B750: ??? (in /usr/bin/glxgears)
==296461==    by 0x10A2CC: ??? (in /usr/bin/glxgears)
==296461==    by 0x4B3F30F: (below main) (in /usr/lib/libc.so.6)
---8<---

Fixes: dcbf2423d28 ("vbo/dlist: add vertices to incomplete primitives")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15633>

2 years agoradv: save/restore the stencil write mask during internal driver operations
Samuel Pitoiset [Wed, 30 Mar 2022 12:31:35 +0000 (14:31 +0200)]
radv: save/restore the stencil write mask during internal driver operations

The slow depth/stencil clear path would overwrite the stencil write
mask otherwise.

This fixes few Zink failures.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15667>

2 years agoac: remove LLVM 4.0 workaround
Pierre-Eric Pelloux-Prayer [Mon, 28 Mar 2022 09:17:58 +0000 (11:17 +0200)]
ac: remove LLVM 4.0 workaround

This was added to fix https://bugs.freedesktop.org/show_bug.cgi?id=97988 but
has been fixed in LLVM since.

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

2 years agoradeonsi: drop LLVM global instruction selector
Pierre-Eric Pelloux-Prayer [Thu, 24 Mar 2022 16:17:17 +0000 (17:17 +0100)]
radeonsi: drop LLVM global instruction selector

I'm not sure if this is really used by anyone?

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

2 years agodocs: document useful radeonsi env variables
Pierre-Eric Pelloux-Prayer [Thu, 24 Mar 2022 16:16:49 +0000 (17:16 +0100)]
docs: document useful radeonsi env variables

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

2 years agodrirc: enable radeonsi_zerovram for Black Geyser
Pierre-Eric Pelloux-Prayer [Thu, 24 Mar 2022 16:06:36 +0000 (17:06 +0100)]
drirc: enable radeonsi_zerovram for Black Geyser

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6180
Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15559>

2 years agodzn: Make a bunch of functions private
Boris Brezillon [Mon, 28 Mar 2022 07:41:17 +0000 (09:41 +0200)]
dzn: Make a bunch of functions private

Looks like some functions that should have been marked static when
transitioning from C++ methods to plain C where forgotten. Let's fix that
now.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15607>

2 years agodzn: Remove the dzn_cmd_exec_functions file
Boris Brezillon [Mon, 28 Mar 2022 07:46:54 +0000 (09:46 +0200)]
dzn: Remove the dzn_cmd_exec_functions file

That's a leftover from a previous version of the secondary command
buffer implementation.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15607>

2 years agodzn: Add Missing return type to dzn_translate_sampler_filter()
Boris Brezillon [Mon, 28 Mar 2022 08:05:22 +0000 (10:05 +0200)]
dzn: Add Missing return type to dzn_translate_sampler_filter()

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15607>

2 years agoci: Improve vs2019 mesa_build.ps1 for remove the need of cmd.exe
Yonggang Luo [Sat, 26 Mar 2022 02:31:50 +0000 (10:31 +0800)]
ci: Improve vs2019 mesa_build.ps1 for remove the need of cmd.exe

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15595>

2 years agovulkan/microsoft: Remove `override_options: ['cpp_std=c++latest']` option for visual...
Yonggang Luo [Sun, 27 Mar 2022 02:55:18 +0000 (10:55 +0800)]
vulkan/microsoft: Remove `override_options: ['cpp_std=c++latest']` option for visual studio

The project no longer uses c++20 features

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15595>

2 years agoaco/ra: fix stride check on subdword parallelcopies for create_vector
Daniel Schürmann [Mon, 14 Mar 2022 12:56:12 +0000 (13:56 +0100)]
aco/ra: fix stride check on subdword parallelcopies for create_vector

On GFX6/7, info.rc is in full dwords.

Fixes: 9476986e6f6fe49ef8bc511f4ebeca4232263888 ('aco/ra: special-case get_reg_for_create_vector_copy()')
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15393>

2 years agoradv: lower has_multiview_view_index in NIR
Samuel Pitoiset [Fri, 18 Mar 2022 12:49:44 +0000 (13:49 +0100)]
radv: lower has_multiview_view_index in NIR

This lowering is done in a new NIR pass where the layer is written
before emit_vertex_with_counter for geometry shaders and after the
position for other vertex stages.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15456>

2 years agoradv: drop EXT or KHR suffixes for stuff promoted in Vulkan 1.3
Samuel Pitoiset [Wed, 30 Mar 2022 08:28:56 +0000 (10:28 +0200)]
radv: drop EXT or KHR suffixes for stuff promoted in Vulkan 1.3

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15663>

2 years agovirgl: fake modifier plane count query support
Yiwei Zhang [Wed, 30 Mar 2022 01:10:05 +0000 (01:10 +0000)]
virgl: fake modifier plane count query support

dri2_create_image_from_fd might pass host modifier. Before virgl
consumes modifier info from the guest side, fake the support so that the
image creation can still proceed instead of bailing.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15658>

2 years agovulkan: Allow the driver to manually enable threaded submit
Jason Ekstrand [Thu, 24 Mar 2022 23:17:16 +0000 (18:17 -0500)]
vulkan: Allow the driver to manually enable threaded submit

This is useful for drivers that wish to be able to block inside their
vk_queue::driver_submit hook.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15566>

2 years agovulkan: Replace various uses of device->timeline_mode
Jason Ekstrand [Thu, 24 Mar 2022 22:49:19 +0000 (17:49 -0500)]
vulkan: Replace various uses of device->timeline_mode

What we really care about is if we're DEFERRED so we need to do a flush
and if there can be any other threads we might race against.  We don't
really care about the timeline mode itself.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15566>

2 years agovulkan/queue: Rework vk_queue_submit()
Jason Ekstrand [Thu, 24 Mar 2022 22:46:11 +0000 (17:46 -0500)]
vulkan/queue: Rework vk_queue_submit()

Instead of basing everything on the timeline mode, base it on the submit
mode of the queue.  This makes a lot more sense since it's what we
really care about anyway.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15566>

2 years agovulkan/queue: Rework submit thread enabling
Jason Ekstrand [Thu, 24 Mar 2022 22:33:57 +0000 (17:33 -0500)]
vulkan/queue: Rework submit thread enabling

Now that we have a threading mode in the device, we can set that based
on the environment variable instead of delaying it to submit time.  This
allows us to avoid the static variable trickery we use to avoid reading
environment variables over and over again.  We also move the enabling of
the submit thread up a level or two and give it a bit more obvious
condition.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15566>

2 years agovulkan/queue: Add a submit mode enum
Jason Ekstrand [Thu, 24 Mar 2022 22:05:08 +0000 (17:05 -0500)]
vulkan/queue: Add a submit mode enum

This encapsulates all three possible submit modes: immediate, deferred,
and threaded.  It's more clear than the has_thread boolean combined with
device-level checks.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15566>

2 years agoglsl: Delete dont_lower_swz path of lower_quadop_vector.
Emma Anholt [Mon, 28 Mar 2022 23:04:57 +0000 (16:04 -0700)]
glsl: Delete dont_lower_swz path of lower_quadop_vector.

This was last used with Mesa classic, in _mesa_ir_link_shader().

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15623>

2 years agoglsl: Delete unused EmitNoPow path.
Emma Anholt [Mon, 28 Mar 2022 22:57:32 +0000 (15:57 -0700)]
glsl: Delete unused EmitNoPow path.

This was last used with i915c, now lower_fpow covers this class of
lowering.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15623>

2 years agovulkan: Add more VU comments to justify framebuffer asserts
Jason Ekstrand [Wed, 30 Mar 2022 16:49:41 +0000 (11:49 -0500)]
vulkan: Add more VU comments to justify framebuffer asserts

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15674>

2 years agozink: update radv ci baseline
Mike Blumenkrantz [Wed, 30 Mar 2022 15:56:50 +0000 (11:56 -0400)]
zink: update radv ci baseline

just rebased cts locally and this is what popped out

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

2 years agopanfrost: Add Valhall compressed formats
Alyssa Rosenzweig [Sun, 13 Mar 2022 21:27:28 +0000 (17:27 -0400)]
panfrost: Add Valhall compressed formats

We need to map to the interchange format, since there is no longer a pixel
format for the memory layout. Use this new format table on v9.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15586>

2 years agopanfrost: Restrict Z/S formats for Valhall
Alyssa Rosenzweig [Thu, 3 Feb 2022 16:08:16 +0000 (11:08 -0500)]
panfrost: Restrict Z/S formats for Valhall

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15586>

2 years agopanfrost: Handle Valhall IDVS in job_uses_tiling
Alyssa Rosenzweig [Fri, 21 Jan 2022 17:48:53 +0000 (12:48 -0500)]
panfrost: Handle Valhall IDVS in job_uses_tiling

Valhall-style IDVS uses a distinct job type which has to be handled separately.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15586>

2 years agopanfrost: Disable AFBC on Valhall
Alyssa Rosenzweig [Sun, 9 Jan 2022 21:17:49 +0000 (16:17 -0500)]
panfrost: Disable AFBC on Valhall

Doesn't work yet. Kick the can down the road; I'd like to get textures
and FBOs working at all before worrying about compressing them.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15586>

2 years agopan/bi: Preload r60/r61 for MSAA + blend shader
Alyssa Rosenzweig [Wed, 23 Mar 2022 21:19:36 +0000 (17:19 -0400)]
pan/bi: Preload r60/r61 for MSAA + blend shader

This is the sort of leakiness I hate about blend shaders. MSAA + blend shader is
somewhat obscure but gets hit in the CTS.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15586>

2 years agopan/bi: Use ID accessors for LEA_ATTR
Alyssa Rosenzweig [Wed, 23 Mar 2022 15:31:43 +0000 (11:31 -0400)]
pan/bi: Use ID accessors for LEA_ATTR

This is more portable.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15586>

2 years agopan/bi: Split out load/store to thread storage
Alyssa Rosenzweig [Tue, 21 Dec 2021 22:06:05 +0000 (17:06 -0500)]
pan/bi: Split out load/store to thread storage

We need a slightly different idiom on Valhall, so let's first split the
helpers for encapsulation.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15586>

2 years agopan/bi: Use nir_tex_instr_has_implicit_derivative
Alyssa Rosenzweig [Wed, 23 Mar 2022 16:04:41 +0000 (12:04 -0400)]
pan/bi: Use nir_tex_instr_has_implicit_derivative

Rather tracking it ourselves. Slightly shorter.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15586>

2 years agopan/bi: Call Valhall backend passes on v9
Alyssa Rosenzweig [Tue, 27 Jul 2021 18:18:53 +0000 (14:18 -0400)]
pan/bi: Call Valhall backend passes on v9

These are required to lower the IR into something suitable for Valhall
packing.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15586>

2 years agopan/bi: Fix write_mask size
Alyssa Rosenzweig [Sat, 5 Mar 2022 01:19:23 +0000 (20:19 -0500)]
pan/bi: Fix write_mask size

We really need to stop tying the IR to Bifrost...

Fixes: 3c817ed511c ("pan/bi: Model Valhall texture instructions")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15586>

2 years agopan/bi: Add .shadow modifier to TEX_GATHER
Alyssa Rosenzweig [Fri, 18 Mar 2022 17:39:02 +0000 (13:39 -0400)]
pan/bi: Add .shadow modifier to TEX_GATHER

Although TEX_GATHER looks like TEX_FETCH, it does support shadow comparators
like TEX_SINGLE. Model this in the IR so we can use it.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15586>

2 years agopvr: Check if the buffer/image was bound before unbinding.
Rajnesh Kanwal [Tue, 22 Mar 2022 15:33:46 +0000 (15:33 +0000)]
pvr: Check if the buffer/image was bound before unbinding.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15641>

2 years agoanv: Drop dead code in anv_UpdateDescriptorSets
Rohan Garg [Wed, 30 Mar 2022 12:39:10 +0000 (14:39 +0200)]
anv: Drop dead code in anv_UpdateDescriptorSets

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15666>

2 years agoci: cherry-pick deqp fix for zlib dependency
Omar Akkila [Tue, 29 Mar 2022 02:23:23 +0000 (22:23 -0400)]
ci: cherry-pick deqp fix for zlib dependency

Zlib was bumped to 1.2.12 breaking links to the previous 1.2.11.
Unfortunately, no tag currently carries the fix so cherry-pick it for
now.

Signed-off-by: Omar Akkila <omar.akkila@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15626>

2 years agoci: uprev vkd3d-proton to v2.6
Omar Akkila [Tue, 29 Mar 2022 02:59:11 +0000 (22:59 -0400)]
ci: uprev vkd3d-proton to v2.6

GitHub has deprecated the git:// protocol and no longer
accepts them. One of them vkd3d-proton's dependencies 'dxil-spirv'
was still using git:// for its submodules up until v2.6 where it
now uses https:// instead.

Signed-off-by: Omar Akkila <omar.akkila@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15626>

2 years agoci: uprev Fossilize
Omar Akkila [Tue, 29 Mar 2022 01:40:35 +0000 (21:40 -0400)]
ci: uprev Fossilize

Fossilize used the git:// protocol for fetching submodules
but as of January 11, 2022, GitHub has tempirarily disabled
acceptance of the Git protocol until March 15, 2022 whereby
it will be permanantly disabled.

This patch uprevs to the Fossilize commit that switches
submodule URLs to https:// instead. Otherwise, we would get
an error stating that "The unauthenticated git protocol on
port 9418 is no longer supported." when trying to clone
submodules.

See https://github.blog/2021-09-01-improving-git-protocol-security-github
for more info.

Signed-off-by: Omar Akkila <omar.akkila@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15626>

2 years agointel/clc: fix missing pointer write
Lionel Landwerlin [Mon, 28 Mar 2022 14:17:57 +0000 (17:17 +0300)]
intel/clc: fix missing pointer write

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 346a7f14fba0 ("intel/compiler: Add code for compiling CL-style SPIR-V kernels")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15611>

2 years agoradv: fix mismatch between radv_GetPhysicalDeviceMemoryProperties*()
Samuel Pitoiset [Tue, 29 Mar 2022 06:48:33 +0000 (08:48 +0200)]
radv: fix mismatch between radv_GetPhysicalDeviceMemoryProperties*()

This fixes a regression with
dEQP-VK.api.info.get_physical_device_properties2.memory_properties.
This test expects the unused array elements to be untouched.

Fixes: 87b65af43e2 ("radv: Use common GetPhysicalDeviceMemoryProperties")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15629>

2 years agonir_to_tgsi: Require the block index to always be populated
Corentin Noël [Tue, 29 Mar 2022 13:50:08 +0000 (15:50 +0200)]
nir_to_tgsi: Require the block index to always be populated

In some cases like when using `NIR_DEBUG=serialize`, impl->num_blocks is 0
which leads to assertions error in the blocklist. Make sure to require the
num_blocks to be populated.

Fixes: 74c02d99b224fbc02132b54bf23e6ac1e117d805

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15640>

2 years agomesa/st: don't add pointsize to ES programs if it already exists
Mike Blumenkrantz [Wed, 9 Mar 2022 17:10:09 +0000 (12:10 -0500)]
mesa/st: don't add pointsize to ES programs if it already exists

an obvious missed case from the previous series, but there's no need
to-readd an output if it already exists here

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

2 years agomesa/st: rework pointsize constant uploads
Mike Blumenkrantz [Fri, 25 Mar 2022 22:14:14 +0000 (18:14 -0400)]
mesa/st: rework pointsize constant uploads

this now has a flag that is toggled when the last vertex stage changes,
and this will trigger the appropriate updates during state validation

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

2 years agomesa/st: always flag last vertex stage constants for upload on pointsize change
Mike Blumenkrantz [Mon, 28 Mar 2022 21:10:11 +0000 (17:10 -0400)]
mesa/st: always flag last vertex stage constants for upload on pointsize change

if the driver requires pointsize uploads, the pointsize has to actually be uploaded
whenever the pointsize changes

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

2 years agomesa/st: rework atom flagging when pointsize changes
Mike Blumenkrantz [Mon, 28 Mar 2022 21:08:30 +0000 (17:08 -0400)]
mesa/st: rework atom flagging when pointsize changes

if the driver requires pointsize uploads, only flag the last vertex
stage for updates, not all vertex stages

this should be functionally equivalent but without the unnecessary overhead
of also scanning the other stages

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

2 years agozink: add driver workaround for broken EXT_depth_clip_control
Mike Blumenkrantz [Tue, 22 Mar 2022 22:05:35 +0000 (18:05 -0400)]
zink: add driver workaround for broken EXT_depth_clip_control

for #6186

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15513>

2 years agollvmpipe: handle sampling from 2d views of 3d images
Mike Blumenkrantz [Thu, 24 Mar 2022 13:04:14 +0000 (09:04 -0400)]
llvmpipe: handle sampling from 2d views of 3d images

this is seldom used but is required by KHR_gl_texture_3D_image

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15583>

2 years agozink: force push descriptors cache update if hashing detects changes
Mike Blumenkrantz [Fri, 25 Mar 2022 22:11:54 +0000 (18:11 -0400)]
zink: force push descriptors cache update if hashing detects changes

this was previously only forced if the program pointer changed,
but programs can be freed and reused, and these are definite cases
where the last set cannot be reused, so jam it in

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15591>

2 years agolavapipe: enforce monotonic timeline incrementing
Mike Blumenkrantz [Tue, 22 Mar 2022 20:25:11 +0000 (16:25 -0400)]
lavapipe: enforce monotonic timeline incrementing

maybe just being overly paranoid, but make sure that the timeline id
gets compared while the lock is held in every scenario

cc: mesa-stable

Reviewed-by: Omar Akkila <omar.akkila@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15453>

2 years agolavapipe: allow timeline progress in GetSemaphoreCounterValue
Mike Blumenkrantz [Fri, 18 Mar 2022 12:48:39 +0000 (08:48 -0400)]
lavapipe: allow timeline progress in GetSemaphoreCounterValue

the vulkan spec doesn't explicitly state whether this function progresses
a given semaphore's timeline, and apparently there are some cases where
it's assumed that progress occurs if this function is called in a loop
instead of WaitSemaphores, so check the current fence for completion

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15453>

2 years agolavapipe: fix xfb availability query copying
Mike Blumenkrantz [Tue, 29 Mar 2022 16:02:25 +0000 (12:02 -0400)]
lavapipe: fix xfb availability query copying

xfb queries have 2 results

cc: mesa-stable

fixes (zink):
spec@arb_query_buffer_object@qbo

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15644>

2 years agolavapipe: add loop unrolling.
Dave Airlie [Tue, 8 Mar 2022 08:31:13 +0000 (18:31 +1000)]
lavapipe: add loop unrolling.

zink was giving us rolled spir-v and nothing was unrolling it,
start unrolling the NIR in the frontend.

unrolling would leave a texture with a constant texture_offset,
translate it to a texture index.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15287>

2 years agolavapipe: fix shader indexing of sampler arrays with const array index
Mike Blumenkrantz [Tue, 29 Mar 2022 20:48:49 +0000 (16:48 -0400)]
lavapipe: fix shader indexing of sampler arrays with const array index

if it's a constant, then just return that bit, not the full bitmask

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15287>

2 years agoutil: Should not use ASSERTED in util_thread_get_time_nano
Yonggang Luo [Tue, 29 Mar 2022 20:24:42 +0000 (04:24 +0800)]
util: Should not use ASSERTED in util_thread_get_time_nano

The parameter is not ASSERTED
Fixes: 0f1b3fc17f0 ("util: Fixes unused parameter warnings")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15655>

2 years agovulkan: update more headers to 1.3.210
Mike Blumenkrantz [Tue, 29 Mar 2022 16:21:09 +0000 (12:21 -0400)]
vulkan: update more headers to 1.3.210

Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15645>

2 years agoiris: assert that samplerview base_array_layer is zero for hw < skl
Mike Blumenkrantz [Mon, 28 Mar 2022 13:48:31 +0000 (09:48 -0400)]
iris: assert that samplerview base_array_layer is zero for hw < skl

this codepath is broken for older hardware

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15610>

2 years agocrocus: assert that 3d samplerview base_array_layer is zero
Mike Blumenkrantz [Mon, 28 Mar 2022 13:47:57 +0000 (09:47 -0400)]
crocus: assert that 3d samplerview base_array_layer is zero

this codepath will not work on crocus

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15610>

2 years agointel/isl: fix 2d view of 3d textures
Mike Blumenkrantz [Fri, 25 Mar 2022 19:19:20 +0000 (15:19 -0400)]
intel/isl: fix 2d view of 3d textures

according to KHR_gl_texture_3D_image:

    If <target> is EGL_GL_TEXTURE_3D_KHR, <buffer> must be the name of a
    complete, nonzero, GL_TEXTURE_3D (or equivalent in GL extensions) target
    texture object, cast
    into the type EGLClientBuffer.  <attr_list> should specify the mipmap
    level (EGL_GL_TEXTURE_LEVEL_KHR) and z-offset (EGL_GL_TEXTURE_ZOFFSET_KHR)
    which will be used as the EGLImage source; the specified mipmap level must
    be part of <buffer>, and the specified z-offset must be smaller than the
    depth of the specified mipmap level.

thus a 2d view of a 3d surface is not only legal, it's part of the spec and
must be supported when available

cc: mesa-stable

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15584>

2 years agor300: only output wpos in vertex shaders when needed
Pavel Ondračka [Sat, 19 Mar 2022 20:34:07 +0000 (21:34 +0100)]
r300: only output wpos in vertex shaders when needed

Right now we always copy pos to wpos regardless of if the fragment
shader needs it or not. Instead just do it only for the shaders
that really need it.

Shader-db is not able to measure preciselly the effect as we
build only the non-wpos variants, but given that majority of fragment
shaders don't needs the wpos, the real effect should be close:

total instructions in shared programs: 105427 -> 104313 (-1.06%)
instructions in affected programs: 53098 -> 51984 (-2.10%)
total temps in shared programs: 13991 -> 13958 (-0.24%)
temps in affected programs: 114 -> 81 (-28.95%)

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15321>

2 years agor300: move r300_init_vs_outputs to r300_translate_vertex_shader
Pavel Ondračka [Fri, 25 Mar 2022 06:58:11 +0000 (07:58 +0100)]
r300: move r300_init_vs_outputs to r300_translate_vertex_shader

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15321>

2 years agor300: restructure r300_vertex_shader
Pavel Ondračka [Sat, 19 Mar 2022 18:13:00 +0000 (19:13 +0100)]
r300: restructure r300_vertex_shader

Make the r300_vertex_shader structure resemble the r300_framgment_shader
in order to allow support for shader variants. There is no functional
change, but it will be used in the next commit to only output wpos
when needed from vertex shaders.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15321>

2 years agor300: optimize single write scenarios in rc_copy_output
Pavel Ondračka [Wed, 9 Mar 2022 21:41:23 +0000 (22:41 +0100)]
r300: optimize single write scenarios in rc_copy_output

Right now we always write to a temp and than emit movs to both
POS and WPOS.

When the result is trivial, like:

MOV temp[0], in[0]
MOV output[0], temp[0]
MOV output[1], temp[0]

the dataflow analysis passes can take care of it, this is however
one of the last optimizations we need the pass for. Additionally
it fails even for some still trivial cases like:

 MAD temp[2], const[3], temp[0].wwww, temp[1];
 MOV output[0], temp[2];
 MOV output[2], temp[2];

This patch will just duplicate the output instuction when there
is only a single output write.

The long-term plan would be to just trust NIR, do as little in
the backend as possible and optimize the remaining backend passes
to not need any additional cleanups.

total instructions in shared programs: 105862 -> 105427 (-0.41%)
instructions in affected programs: 20527 -> 20092 (-2.12%)
total temps in shared programs: 14029 -> 13991 (-0.27%)
temps in affected programs: 152 -> 114 (-25.00%)

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip.gawin@zoho.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15321>

2 years agor300: don't move position output to the end when duplicating it for WPOS
Pavel Ondračka [Mon, 7 Mar 2022 12:41:55 +0000 (13:41 +0100)]
r300: don't move position output to the end when duplicating it for WPOS

Instead just emit both outputs as soon as possible.

If the last write is inside a loop or a branch, emit it after
the ENDLOOP or ENDIF. This saves some temps and also allows us
to potentially benefit from R300_PVS_XYZW_VALID_INST as right
now the position output write is always penultimate with the
WPOS output being the last.

total temps in shared programs: 14101 -> 14029 (-0.51%)
temps in affected programs: 435 -> 363 (-16.55%)
helped: 72
HURT: 0

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip.gawin@zoho.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15321>

2 years agozink: add in radv passes to baseline
Mike Blumenkrantz [Tue, 29 Mar 2022 20:16:54 +0000 (16:16 -0400)]
zink: add in radv passes to baseline

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

2 years agozink: more radv fails
Mike Blumenkrantz [Tue, 29 Mar 2022 20:15:48 +0000 (16:15 -0400)]
zink: more radv fails

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

2 years agozink: update radv baseline
Mike Blumenkrantz [Tue, 29 Mar 2022 19:37:38 +0000 (15:37 -0400)]
zink: update radv baseline

it doesn't look like these ever passed?

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

2 years agoanv: Stop updating STATE_BASE_ADDRESS on XeHP
Kenneth Graunke [Fri, 25 Mar 2022 18:53:56 +0000 (11:53 -0700)]
anv: Stop updating STATE_BASE_ADDRESS on XeHP

Now that we're using 3DSTATE_BINDING_TABLE_POOL_ALLOC to set the base
address for the binding table pool separately from surface states, we
don't actually need to update surface state base address anymore.

Instead, we can just set STATE_BASE_ADDRESS once at context creation,
and never bother updating it again, saving some heavyweight flushes
and freeing us from the need for address offsetting trickery.

This patch was originally written by Jason Ekstrand, with fixes from
Lionel Landwerlin, but was targeting Icelake.  Doing it there requires
additional changes (15:5 -> 18:8 binding table pointer formats) which
also involve some trade-offs, whereas the XeHP change is purely a win,
so we'll do it here first.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15616>

2 years agointel/compiler: Call inst->resize_sources before setting the sources
Kenneth Graunke [Tue, 29 Mar 2022 09:42:41 +0000 (02:42 -0700)]
intel/compiler: Call inst->resize_sources before setting the sources

You should probably resize the sources array before accessing entries
that might be out of bounds.  inst->resize_sources() always allocates
enough space for at least 3 sources, so this is really only an issue
when there are 4+ sources.

Fixes: a920979d4f3 ("intel/fs: Use split sends for surface writes on gen9+")
Fixes: 4f86a70599a ("intel/fs: Lower DW untyped r/w messages to LSC when available")
Fixes: d372abe3973 ("intel/fs: Add surface OWORD BLOCK opcodes")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15632>

2 years agodocs: update calendar and link releases notes for 22.0.1
Dylan Baker [Tue, 29 Mar 2022 20:01:17 +0000 (13:01 -0700)]
docs: update calendar and link releases notes for 22.0.1

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

2 years agodocs: add sah256 sum for mesa 22.0.1
Dylan Baker [Tue, 29 Mar 2022 19:56:25 +0000 (12:56 -0700)]
docs: add sah256 sum for mesa 22.0.1

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

2 years agodocs: add release notes for 22.0.1
Dylan Baker [Tue, 29 Mar 2022 19:21:45 +0000 (12:21 -0700)]
docs: add release notes for 22.0.1

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

2 years agor300: fix swizzle handling in transformation of abs
Filip Gawin [Thu, 3 Mar 2022 01:39:00 +0000 (02:39 +0100)]
r300: fix swizzle handling in transformation of abs

Helps with scalar opcodes like pow.
(which are propagating first used channel)

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

2 years agodocs: Add calendar entries for 22.1 release candidates.
Dylan Baker [Tue, 29 Mar 2022 19:26:26 +0000 (12:26 -0700)]
docs: Add calendar entries for 22.1 release candidates.

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

2 years agozink: remove anv workaround for broken color writes
Mike Blumenkrantz [Thu, 24 Mar 2022 20:06:10 +0000 (16:06 -0400)]
zink: remove anv workaround for broken color writes

it's healed!

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15564>

2 years agozink: break out CmdSetColorWriteEnableEXT to util function
Mike Blumenkrantz [Mon, 28 Mar 2022 12:59:37 +0000 (08:59 -0400)]
zink: break out CmdSetColorWriteEnableEXT to util function

this will otherwise become a no-op, and it's only intended that this
be called if cwrite is actually being used

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15609>

2 years agonir: Move the define of snprintf to header nir.h
Yonggang Luo [Thu, 2 Dec 2021 16:01:34 +0000 (00:01 +0800)]
nir: Move the define of snprintf to header nir.h

The define of snprintf in nir_lower_atomics_to_ssbo.c is duplicated,
so remove it from this file

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14014>

2 years agovtn: Fixes compiling error for mingw/ucrt by using setjmp/longjmp function instead...
Yonggang Luo [Mon, 6 Dec 2021 16:08:24 +0000 (00:08 +0800)]
vtn: Fixes compiling error for mingw/ucrt by using setjmp/longjmp function instead compiler builtin

The compiling error are:
```
[369/1463] Compiling C object src/compiler/nir/libnir.a.p/.._spirv_gl_spirv.c.obj
FAILED: src/compiler/nir/libnir.a.p/.._spirv_gl_spirv.c.obj
"cc" "-Isrc/compiler/nir/libnir.a.p" "-Isrc/compiler/nir" "-I../../src/compiler/nir" "-Iinclude" "-I../../include" "-Isrc" "-I../../src" "-Isrc/mapi" "-I../../src/mapi" "-Isrc/mesa" "-I../../src/mesa" "-I../../src/gallium/include" "-Isrc/gallium/auxiliary" "-I../../src/gallium/auxiliary" "-Isrc/compiler"
"-I../../src/compiler" "-Isrc/compiler/spirv" "-I../../src/compiler/spirv" "-fvisibility=hidden" "-fcolor-diagnostics" "-D_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-std=c11" "-O2" "-g" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DPACKAGE_VERSION=\"22.1.0-devel\"" "-DPACKAGE_BUGREPORT=\"https://gitlab.freedesktop.org/mesa/mesa/-/issues\"" "-DHAVE_WINDOWS_PLATFORM" "-DHAVE_SURFACELESS_PLATFORM" "-DUSE_ELF_TLS" "-DUSE_TLS_BEHIND_FUNCTIONS" "-DENABLE_ST_OMX_BELLAGIO=0" "-DENABLE_ST_OMX_TIZONIA=0" "-DEGL_NO_X11" "-DHAVE___BUILTIN_BSWAP32" "-DHAVE___BUILTIN_BSWAP64" "-DHAVE___BUILTIN_CLZ" "-DHAVE___BUILTIN_CLZLL" "-DHAVE___BUILTIN_CTZ" "-DHAVE___BUILTIN_EXPECT" "-DHAVE___BUILTIN_FFS" "-DHAVE___BUILTIN_FFSLL" "-DHAVE___BUILTIN_POPCOUNT" "-DHAVE___BUILTIN_POPCOUNTLL" "-DHAVE___BUILTIN_UNREACHABLE" "-DHAVE___BUILTIN_TYPES_COMPATIBLE_P" "-DHAVE_FUNC_ATTRIBUTE_CONST" "-DHAVE_FUNC_ATTRIBUTE_FLATTEN" "-DHAVE_FUNC_ATTRIBUTE_MALLOC" "-DHAVE_FUNC_ATTRIBUTE_PURE" "-DHAVE_FUNC_ATTRIBUTE_UNUSED" "-DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT" "-DHAVE_FUNC_ATTRIBUTE_WEAK" "-DHAVE_FUNC_ATTRIBUTE_FORMAT" "-DHAVE_FUNC_ATTRIBUTE_PACKED" "-DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL" "-DHAVE_FUNC_ATTRIBUTE_ALIAS" "-DHAVE_FUNC_ATTRIBUTE_NORETURN" "-DHAVE_FUNC_ATTRIBUTE_VISIBILITY" "-DHAVE_UINT128" "-D_WINDOWS" "-D_WIN32_WINNT=0x0A00" "-DWINVER=0x0A00" "-DPIPE_SUBSYSTEM_WINDOWS_USER" "-D_USE_MATH_DEFINES" "-DUSE_SSE41" "-DUSE_GCC_ATOMIC_BUILTINS" "-DHAS_SCHED_H" "-DHAVE_CET_H" "-DHAVE_STRTOF" "-DHAVE_TIMESPEC_GET" "-DHAVE_STRTOK_R" "-DHAVE_QSORT_S" "-DHAVE_ZLIB" "-DHAVE_ZSTD" "-DHAVE_COMPRESSION" "-DLLVM_AVAILABLE" "-DMESA_LLVM_VERSION_STRING=\"13.0.1\"" "-DLLVM_IS_SHARED=1" "-DDRAW_LLVM_AVAILABLE" "-DMESA_EXECMEM" "-DVK_USE_PLATFORM_WIN32_KHR" "-Werror=implicit-function-declaration" "-Werror=missing-prototypes" "-Werror=return-type" "-Werror=empty-body" "-Werror=incompatible-pointer-types" "-Werror=int-conversion" "-Wimplicit-fallthrough" "-Wno-missing-field-initializers" "-fno-math-errno" "-fno-trapping-math" "-Qunused-arguments" "-fno-common" "-Wno-microsoft-enum-value" "-Werror=format" "-Wformat-security" "-Werror=thread-safety" "-ffunction-sections" "-fdata-sections" "-Werror=pointer-arith" "-Werror=gnu-empty-initializer" "-Wno-override-init" "-Wno-initializer-overrides" -MD -MQ src/compiler/nir/libnir.a.p/.._spirv_gl_spirv.c.obj -MF "src/compiler/nir/libnir.a.p/.._spirv_gl_spirv.c.obj.d" -o src/compiler/nir/libnir.a.p/.._spirv_gl_spirv.c.obj "-c" ../../src/compiler/spirv/gl_spirv.c
../../src/compiler/spirv/gl_spirv.c:241:19: error: incompatible pointer types passing 'jmp_buf' (aka '_JBTYPE [16]') to parameter of type 'void **' [-Werror,-Wincompatible-pointer-types]
   if (vtn_setjmp(b->fail_jump)) {
                  ^~~~~~~~~~~~
1 error generated.
[376/1463] Compiling C object src/compiler/nir/libnir.a.p/.._spirv_spirv_to_nir.c.obj
FAILED: src/compiler/nir/libnir.a.p/.._spirv_spirv_to_nir.c.obj
"cc" "-Isrc/compiler/nir/libnir.a.p" "-Isrc/compiler/nir" "-I../../src/compiler/nir" "-Iinclude" "-I../../include" "-Isrc" "-I../../src" "-Isrc/mapi" "-I../../src/mapi" "-Isrc/mesa" "-I../../src/mesa" "-I../../src/gallium/include" "-Isrc/gallium/auxiliary" "-I../../src/gallium/auxiliary" "-Isrc/compiler"
"-I../../src/compiler" "-Isrc/compiler/spirv" "-I../../src/compiler/spirv" "-fvisibility=hidden" "-fcolor-diagnostics" "-D_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-std=c11" "-O2" "-g" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DPACKAGE_VERSION=\"22.1.0-devel\"" "-DPACKAGE_BUGREPORT=\"https://gitlab.freedesktop.org/mesa/mesa/-/issues\"" "-DHAVE_WINDOWS_PLATFORM" "-DHAVE_SURFACELESS_PLATFORM" "-DUSE_ELF_TLS" "-DUSE_TLS_BEHIND_FUNCTIONS" "-DENABLE_ST_OMX_BELLAGIO=0" "-DENABLE_ST_OMX_TIZONIA=0" "-DEGL_NO_X11" "-DHAVE___BUILTIN_BSWAP32" "-DHAVE___BUILTIN_BSWAP64" "-DHAVE___BUILTIN_CLZ" "-DHAVE___BUILTIN_CLZLL" "-DHAVE___BUILTIN_CTZ" "-DHAVE___BUILTIN_EXPECT" "-DHAVE___BUILTIN_FFS" "-DHAVE___BUILTIN_FFSLL" "-DHAVE___BUILTIN_POPCOUNT" "-DHAVE___BUILTIN_POPCOUNTLL" "-DHAVE___BUILTIN_UNREACHABLE" "-DHAVE___BUILTIN_TYPES_COMPATIBLE_P" "-DHAVE_FUNC_ATTRIBUTE_CONST" "-DHAVE_FUNC_ATTRIBUTE_FLATTEN" "-DHAVE_FUNC_ATTRIBUTE_MALLOC" "-DHAVE_FUNC_ATTRIBUTE_PURE" "-DHAVE_FUNC_ATTRIBUTE_UNUSED" "-DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT" "-DHAVE_FUNC_ATTRIBUTE_WEAK" "-DHAVE_FUNC_ATTRIBUTE_FORMAT" "-DHAVE_FUNC_ATTRIBUTE_PACKED" "-DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL" "-DHAVE_FUNC_ATTRIBUTE_ALIAS" "-DHAVE_FUNC_ATTRIBUTE_NORETURN" "-DHAVE_FUNC_ATTRIBUTE_VISIBILITY" "-DHAVE_UINT128" "-D_WINDOWS" "-D_WIN32_WINNT=0x0A00" "-DWINVER=0x0A00" "-DPIPE_SUBSYSTEM_WINDOWS_USER" "-D_USE_MATH_DEFINES" "-DUSE_SSE41" "-DUSE_GCC_ATOMIC_BUILTINS" "-DHAS_SCHED_H" "-DHAVE_CET_H" "-DHAVE_STRTOF" "-DHAVE_TIMESPEC_GET" "-DHAVE_STRTOK_R" "-DHAVE_QSORT_S" "-DHAVE_ZLIB" "-DHAVE_ZSTD" "-DHAVE_COMPRESSION" "-DLLVM_AVAILABLE" "-DMESA_LLVM_VERSION_STRING=\"13.0.1\"" "-DLLVM_IS_SHARED=1" "-DDRAW_LLVM_AVAILABLE" "-DMESA_EXECMEM" "-DVK_USE_PLATFORM_WIN32_KHR" "-Werror=implicit-function-declaration" "-Werror=missing-prototypes" "-Werror=return-type" "-Werror=empty-body" "-Werror=incompatible-pointer-types" "-Werror=int-conversion" "-Wimplicit-fallthrough" "-Wno-missing-field-initializers" "-fno-math-errno" "-fno-trapping-math" "-Qunused-arguments" "-fno-common" "-Wno-microsoft-enum-value" "-Werror=format" "-Wformat-security" "-Werror=thread-safety" "-ffunction-sections" "-fdata-sections" "-Werror=pointer-arith" "-Werror=gnu-empty-initializer" "-Wno-override-init" "-Wno-initializer-overrides" -MD -MQ src/compiler/nir/libnir.a.p/.._spirv_spirv_to_nir.c.obj -MF "src/compiler/nir/libnir.a.p/.._spirv_spirv_to_nir.c.obj.d" -o
src/compiler/nir/libnir.a.p/.._spirv_spirv_to_nir.c.obj "-c" ../../src/compiler/spirv/spirv_to_nir.c
../../src/compiler/spirv/spirv_to_nir.c:196:16: error: incompatible pointer types passing 'jmp_buf' (aka '_JBTYPE [16]') to parameter of type 'void **' [-Werror,-Wincompatible-pointer-types]
   vtn_longjmp(b->fail_jump, 1);
               ^~~~~~~~~~~~
```

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14014>

2 years agomeson: Add predefined macro -D__MSVCRT_VERSION__=0x0700 only in mingw environment...
Yonggang Luo [Mon, 6 Dec 2021 16:10:00 +0000 (00:10 +0800)]
meson: Add predefined macro -D__MSVCRT_VERSION__=0x0700 only in mingw environment without _UCRT

Fixed the following error:
```

1 error generated.
[18/1468] Compiling C object src/util/libmesa_util.a.p/half_float.c.obj
FAILED: src/util/libmesa_util.a.p/half_float.c.obj
"cc" "-Isrc/util/libmesa_util.a.p" "-Isrc/util" "-I../../src/util" "-Iinclude" "-I../../include" "-Isrc" "-I../../src" "-Isrc/mapi" "-I../../src/mapi" "-Isrc/mesa" "-I../../src/mesa" "-I../../src/gallium/include" "-Isrc/gallium/auxiliary" "-I../../src/gallium/auxiliary" "-IC:/CI-Tools/msys64/clang64/include" "-fvisibility=hidden" "-fcolor-diagnostics" "-D_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-std=c11" "-O2" "-g" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DPACKAGE_VERSION=\"22.1.0-devel\"" "-DPACKAGE_BUGREPORT=\"https://gitlab.freedesktop.org/mesa/mesa/-/issues\"" "-DHAVE_WINDOWS_PLATFORM" "-DHAVE_SURFACELESS_PLATFORM" "-DUSE_ELF_TLS" "-DUSE_TLS_BEHIND_FUNCTIONS" "-DENABLE_ST_OMX_BELLAGIO=0" "-DENABLE_ST_OMX_TIZONIA=0" "-DEGL_NO_X11" "-DHAVE___BUILTIN_BSWAP32" "-DHAVE___BUILTIN_BSWAP64" "-DHAVE___BUILTIN_CLZ" "-DHAVE___BUILTIN_CLZLL" "-DHAVE___BUILTIN_CTZ" "-DHAVE___BUILTIN_EXPECT" "-DHAVE___BUILTIN_FFS" "-DHAVE___BUILTIN_FFSLL" "-DHAVE___BUILTIN_POPCOUNT" "-DHAVE___BUILTIN_POPCOUNTLL" "-DHAVE___BUILTIN_UNREACHABLE" "-DHAVE___BUILTIN_TYPES_COMPATIBLE_P" "-DHAVE_FUNC_ATTRIBUTE_CONST" "-DHAVE_FUNC_ATTRIBUTE_FLATTEN" "-DHAVE_FUNC_ATTRIBUTE_MALLOC" "-DHAVE_FUNC_ATTRIBUTE_PURE" "-DHAVE_FUNC_ATTRIBUTE_UNUSED" "-DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT" "-DHAVE_FUNC_ATTRIBUTE_WEAK" "-DHAVE_FUNC_ATTRIBUTE_FORMAT" "-DHAVE_FUNC_ATTRIBUTE_PACKED" "-DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL" "-DHAVE_FUNC_ATTRIBUTE_ALIAS" "-DHAVE_FUNC_ATTRIBUTE_NORETURN" "-DHAVE_FUNC_ATTRIBUTE_VISIBILITY" "-DHAVE_UINT128" "-D_WINDOWS" "-D_WIN32_WINNT=0x0A00" "-DWINVER=0x0A00" "-DPIPE_SUBSYSTEM_WINDOWS_USER" "-D_USE_MATH_DEFINES" "-D__MSVCRT_VERSION__=0x0700" "-DUSE_SSE41" "-DUSE_GCC_ATOMIC_BUILTINS" "-DHAS_SCHED_H" "-DHAVE_CET_H" "-DHAVE_STRTOF" "-DHAVE_TIMESPEC_GET" "-DHAVE_STRTOK_R" "-DHAVE_QSORT_S" "-DHAVE_ZLIB" "-DHAVE_ZSTD" "-DHAVE_COMPRESSION" "-DLLVM_AVAILABLE" "-DMESA_LLVM_VERSION_STRING=\"13.0.1\"" "-DLLVM_IS_SHARED=1" "-DDRAW_LLVM_AVAILABLE" "-DMESA_EXECMEM" "-DVK_USE_PLATFORM_WIN32_KHR"
"-Werror=implicit-function-declaration" "-Werror=missing-prototypes" "-Werror=return-type" "-Werror=empty-body" "-Werror=incompatible-pointer-types" "-Werror=int-conversion" "-Wimplicit-fallthrough" "-Wno-missing-field-initializers" "-fno-math-errno" "-fno-trapping-math" "-Qunused-arguments" "-fno-common" "-Wno-microsoft-enum-value" "-Werror=format" "-Wformat-security" "-Werror=thread-safety" "-ffunction-sections" "-fdata-sections" "-pthread" "-Werror=pointer-arith" "-Werror=gnu-empty-initializer" -MD -MQ src/util/libmesa_util.a.p/half_float.c.obj -MF "src/util/libmesa_util.a.p/half_float.c.obj.d" -o src/util/libmesa_util.a.p/half_float.c.obj "-c" ../../src/util/half_float.c
In file included from ../../src/util/half_float.c:30:
In file included from ../../src/util/half_float.h:32:
In file included from ../../src/util/u_cpu_detect.h:41:
In file included from ../../src/util/u_thread.h:35:
In file included from ../../include/c11/threads.h:64:
../../include/c11/threads_win32.h:136:5: error: implicit declaration of function 'timespec_get' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    timespec_get(&now, TIME_UTC);
    ^
```

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14014>

2 years agozink: fix error logging for 2d z/s checking
Mike Blumenkrantz [Tue, 29 Mar 2022 14:54:47 +0000 (10:54 -0400)]
zink: fix error logging for 2d z/s checking

this is expected to fail and so is not an error

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15643>

2 years agospirv/libclc: Add generic versions of arithmetic functions
Jason Ekstrand [Mon, 28 Mar 2022 22:08:17 +0000 (17:08 -0500)]
spirv/libclc: Add generic versions of arithmetic functions

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15622>

2 years agov3dv/queue: Rework multisync_free
Jason Ekstrand [Tue, 22 Mar 2022 21:20:10 +0000 (16:20 -0500)]
v3dv/queue: Rework multisync_free

Thix fixes two bugs.  First, we stop leaking in/out fences with
multisync.  Because the in_syncs and out_syncs parameters to
set_multisync were arrays and not pointers to arrays, the caller's
in_syncs and out_syncs pointers never got set and remained NULL so
multisync_free() always sees to NULL pointers and does nothing, leaking
both arrays.  Not sure how this isn't showing up in the dEQP leak check
tests.

Second, the struct drm_v3d_multi_sync was in the scope of the then
clause of the `if (device->pdevice->caps.multisync)` so it goes out of
scope before the ioctl.  This is, effectively, a use-after-free and,
depending on stack allocation details, may result in the multisync
extension struct getting stompped before the ioctl.

Fixes: ff8586c34524 ("v3dv: enable multiple semaphores on cl submission")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15512>

2 years agodoc: update extensions for lavapipe
Mike Blumenkrantz [Tue, 29 Mar 2022 12:04:14 +0000 (08:04 -0400)]
doc: update extensions for lavapipe

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15636>