platform/upstream/mesa.git
21 months agozink: Add an assert for not seeing any more MSAA image-to-buffer copies.
Emma Anholt [Wed, 4 Jan 2023 17:13:39 +0000 (09:13 -0800)]
zink: Add an assert for not seeing any more MSAA image-to-buffer copies.

Now that transfer_map gets MSAA handled by the helper, we shouldn't have
to worry about this any more.

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

21 months agozink: Have u_transfer_helper resolve MSAA surfaces when mapping.
Emma Anholt [Wed, 4 Jan 2023 17:08:12 +0000 (09:08 -0800)]
zink: Have u_transfer_helper resolve MSAA surfaces when mapping.

This fixes all the dEQP winsys multisampling failures (like
dEQP-GLES3.functional.multisample.default_framebuffer.depth) I've found so
far.

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

21 months agou_transfer_helper: Merge in-place and split z/s interleaved map handling.
Emma Anholt [Wed, 4 Jan 2023 20:17:27 +0000 (12:17 -0800)]
u_transfer_helper: Merge in-place and split z/s interleaved map handling.

The paths were mostly the same, except that in-place was missing the
appropriate layering for MSAA helper re-mapping.  We can instead share
more code, making the differences between the interleave packing clear,
and have the MSAA resolve blit happen once before we do the split
mappings.

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

21 months agou_transfer_helper: Use common code for interleaved unmap.
Emma Anholt [Wed, 4 Jan 2023 19:52:19 +0000 (11:52 -0800)]
u_transfer_helper: Use common code for interleaved unmap.

The function was static and only used from this caller, and the only
difference was that the interleaved case didn't handle trans->ss (which
will always be unset for an interleaved mapping since interleaving splits
the underlying map of the MSAA resource into trans->trans and
trans->trans2).

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

21 months agou_transfer_helpre: Drop !interleave handling from the interleave code.
Emma Anholt [Wed, 4 Jan 2023 19:29:23 +0000 (11:29 -0800)]
u_transfer_helpre: Drop !interleave handling from the interleave code.

It's only called when need_interleave_path(), and they're static functions
in this file since !17959.

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

21 months agodocs/gallium: Explain that MSAA transfer_map must be supported.
Emma Anholt [Wed, 4 Jan 2023 17:11:19 +0000 (09:11 -0800)]
docs/gallium: Explain that MSAA transfer_map must be supported.

It's called this way in various drivers, and is an established part of the
transfer_map interface.

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

21 months agoci: Fix VK driver setup for HWCI_START_*.
Emma Anholt [Wed, 4 Jan 2023 22:53:48 +0000 (14:53 -0800)]
ci: Fix VK driver setup for HWCI_START_*.

Review feedback requested a change that was incorrect, causing Xorg to
start to fail, but I forgot to retest the manual -full jobs that relied on
it.

Fixes: 99a6f2a1864f ("ci: Set the path to the VK drivers during HWCI_START_XORG/WESTON.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20523>

21 months agoanv,hasvk: move the null check into the function call and drop null check copies
Rohan Garg [Wed, 7 Dec 2022 16:23:03 +0000 (17:23 +0100)]
anv,hasvk: move the null check into the function call and drop null check copies

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/20104>

21 months agoanv: Drop useless FIXME
Rohan Garg [Wed, 7 Dec 2022 12:25:03 +0000 (13:25 +0100)]
anv: Drop useless FIXME

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/20104>

21 months agoanv,hasvk: drop unused function
Rohan Garg [Fri, 2 Dec 2022 10:03:45 +0000 (15:33 +0530)]
anv,hasvk: drop unused function

align_i32 is not used anywhere

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/20104>

21 months agoanv,hasvk: migrate to ROUND_DOWN_TO from util
Rohan Garg [Fri, 2 Dec 2022 09:46:11 +0000 (15:16 +0530)]
anv,hasvk: migrate to ROUND_DOWN_TO from util

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/20104>

21 months agoanv,hasvk: migrate to u_minify from util
Rohan Garg [Fri, 2 Dec 2022 09:35:54 +0000 (15:05 +0530)]
anv,hasvk: migrate to u_minify from util

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/20104>

21 months agoanv: migrate anv_minify to use u_minify
Rohan Garg [Fri, 2 Dec 2022 09:26:59 +0000 (14:56 +0530)]
anv: migrate anv_minify to use u_minify

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/20104>

21 months agoanv,hasvk: migrate to align64 from util
Rohan Garg [Fri, 2 Dec 2022 09:07:31 +0000 (14:37 +0530)]
anv,hasvk: migrate to align64 from util

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/20104>

21 months agoanv,hasvk: migrate align32 to the right functions from util
Rohan Garg [Thu, 1 Dec 2022 19:14:57 +0000 (00:44 +0530)]
anv,hasvk: migrate align32 to the right functions from util

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/20104>

21 months agoanv,hasvk: Use the inbuilt macro from src/util for clamping int64_t
Rohan Garg [Thu, 1 Dec 2022 14:26:37 +0000 (19:56 +0530)]
anv,hasvk: Use the inbuilt macro from src/util for clamping int64_t

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/20104>

21 months agoanv: constify variables and use early returns
Rohan Garg [Wed, 14 Dec 2022 12:07:54 +0000 (13:07 +0100)]
anv: constify variables and use early returns

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/20104>

21 months agoci/linker: update mold to 1.9
David Heidelberg [Fri, 30 Dec 2022 12:37:59 +0000 (13:37 +0100)]
ci/linker: update mold to 1.9

Bump needed for s390x fix with `-gsplit-dwarf` and `--gdb-index`.
See the https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20435
for more details.

I also switched from make to cmake (make is unsupported now).

Additionally disabled build testing and enabled LTO build for Mold.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20546>

21 months agoaco/gfx11: update s_code_end padding
Rhys Perry [Thu, 5 Jan 2023 15:44:09 +0000 (15:44 +0000)]
aco/gfx11: update s_code_end padding

Match ac_rtld_open().

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Cc: 22.3 <mesa-stable>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20536>

21 months agomeson: add missing dependency
Eric Engestrom [Thu, 5 Jan 2023 10:56:24 +0000 (10:56 +0000)]
meson: add missing dependency

Now that renderonly.h includes util/simple_mtx.h, which itself includes
valgrind.h, dep_valgrind is required by any module that includes
renderonly.h.

    In file included from ../src/gallium/auxiliary/renderonly/renderonly.h:33,
                     from ../src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c:39:
    ../src/util/simple_mtx.h:34:12: fatal error: valgrind.h: No such file or directory
       34 | #  include <valgrind.h>
          |            ^~~~~~~~~~~~
    compilation terminated.

dep_valgrind is part of idep_mesautil, which should be used instead of
copying the list of deps for each util header included (which would
have to be updated every time a util header changes its own includes),
so let's add idep_mesautil everywhere that includes renderonly.h.

Fixes: ad4d7ca8332488be8a75 ("kmsro: Fix renderonly_scanout BO aliasing")
Tested-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20530>

21 months agoci: enable wayland platform in more debian builds
Erico Nunes [Tue, 27 Dec 2022 16:50:01 +0000 (17:50 +0100)]
ci: enable wayland platform in more debian builds

CI has recently gained coverage of wayland platform in EGL tests, but
some CI mesa builds such as arm builds currently don't enable the
wayland platform.
Enable it so test applications can properly initialize EGL with a
wayland platform.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20480>

21 months agoradv/ci: run Zink testing on VanGogh
Martin Roukala (né Peres) [Fri, 25 Nov 2022 13:37:23 +0000 (15:37 +0200)]
radv/ci: run Zink testing on VanGogh

Running zink testing on RDNA2 hardware has been on our TODO list for
a while. While we don't have enough NAVI21 to test everything, we could
make use of the VanGogh APUs to do our Zink testing.

We will enable that job for pre-merge after a week or so of testing.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20006>

21 months agozink/ci: rename zink-radv-* to zink-radv-navi10-*
Martin Roukala (né Peres) [Fri, 25 Nov 2022 13:25:23 +0000 (15:25 +0200)]
zink/ci: rename zink-radv-* to zink-radv-navi10-*

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20006>

21 months agoradv/ci: merge all the zink jobs into a single one
Martin Roukala (né Peres) [Fri, 25 Nov 2022 13:20:03 +0000 (15:20 +0200)]
radv/ci: merge all the zink jobs into a single one

Since GL CTS, GLES CTS, and Piglit executions are very fast compared
to the machine setup time, it makes sense to combine them into one
boot.

The execution will run until the first test suite fails, or we are
done with the execution.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20006>

21 months agoci/venus: disable for now
David Heidelberg [Fri, 6 Jan 2023 13:09:49 +0000 (14:09 +0100)]
ci/venus: disable for now

It flakes too much. Until it gets sorted out, we disable it.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20547>

21 months agovenus: Avoid to copy the descriptor sets when it is not required
Corentin Noël [Thu, 1 Dec 2022 10:25:41 +0000 (11:25 +0100)]
venus: Avoid to copy the descriptor sets when it is not required

Allows to reduce the amount of allocations when the VkWriteDescriptorSet is
already sanitized.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20095>

21 months agoradv: fix returning VK_PIPELINE_COMPILE_REQUIRED from library
Samuel Pitoiset [Thu, 5 Jan 2023 11:42:50 +0000 (12:42 +0100)]
radv: fix returning VK_PIPELINE_COMPILE_REQUIRED from library

When VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED is set by
the application, the driver should return VK_COMPILE_REQUIRED but this
was broken for GPL (it returned VK_SUCCESS instead). Also, objects
shouldn't be destroyed when creating the library failed because it's
already handled in radv_graphics_lib_pipeline_create().

Cc: 22.3 mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7512
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20532>

21 months agoradeonsi: Fix amdgpu-color-export with prologues
Michel Dänzer [Thu, 5 Jan 2023 10:13:28 +0000 (11:13 +0100)]
radeonsi: Fix amdgpu-color-export with prologues

Polygon stippling is handled in the prologue, amdgpu-color-export needs
to be set for that.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8010
Fixes: 1825ad134b17 ("radeonsi,radv/llvm: fix amdgpu-color/depth-export with epilogs")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20531>

21 months agoradv: stop dirtying INDEX_BUFFER for non-indexed draws
Samuel Pitoiset [Wed, 4 Jan 2023 15:10:14 +0000 (16:10 +0100)]
radv: stop dirtying INDEX_BUFFER for non-indexed draws

radv_emit_index_buffer() used to emit VGT_INDEX_TYPE but since I
implemented the DISABLE_INSTANCE_PACKING workaround, it's emitted
in radv_emit_draw_registers().

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

21 months agoradv: flush push descriptors at bind time
Samuel Pitoiset [Tue, 3 Jan 2023 16:36:50 +0000 (17:36 +0100)]
radv: flush push descriptors at bind time

This doesn't need to be flushed at draw time.

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

21 months agoradv: remove set but unused radv_cmd_state::index_{buffer,offset}
Samuel Pitoiset [Wed, 4 Jan 2023 14:58:54 +0000 (15:58 +0100)]
radv: remove set but unused radv_cmd_state::index_{buffer,offset}

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

21 months agoradv: remove unused pipeline parameter from radv_emit_binning_state()
Samuel Pitoiset [Tue, 3 Jan 2023 15:34:01 +0000 (16:34 +0100)]
radv: remove unused pipeline parameter from radv_emit_binning_state()

It's no longer needed because everything is dynamic.

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

21 months agoradv: remove enabling out-of-order rasterization internally
Samuel Pitoiset [Wed, 4 Jan 2023 11:21:50 +0000 (12:21 +0100)]
radv: remove enabling out-of-order rasterization internally

This was added ~4 years ago for very little performance improvements
(likely < 1%) and this is only supported on GFX8 and GFX9.

Since, the number of dynamic states increased and this is likely
disabled most of the time, and given the maintainability cost, it looks
like it's time to remove it completely.

Applications can still enable it with VK_AMD_rasterization_order.

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

21 months agoisaspec: Give decode.c/h more descriptive names
Jason Ekstrand [Wed, 4 Jan 2023 19:55:47 +0000 (13:55 -0600)]
isaspec: Give decode.c/h more descriptive names

Because these are being included across subdir boundaries, the name
"decode" is potentially pretty overloaded.  Instead, prefix them with
"isaspec_".  Also, since they're both weird includes now and not really
complete files in their own right, give them a descriptive suffix.

Acked-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20525>

21 months agoisaspec: Stop depending on glue headers and out-of-folder C files
Jason Ekstrand [Wed, 4 Jan 2023 19:47:54 +0000 (13:47 -0600)]
isaspec: Stop depending on glue headers and out-of-folder C files

The way the isaspec decoder used to work was that it would generate a
header and a C file, each with ISA-specific stuff in it. Then that would
get built together with a stand-alone decode.c file which lives in the
isaspec folder, not the driver's folder.  In order for decode.c to find
the ISA-specific headers, it would also generate a glue header which had
to be named isaspec-isa.h.  This effectively meant that you can't have
multiple isaspec definitions in the same folder.

To solve this, we make do it the other way around and make the generated
header and C files include the stand-alone files.  This is a bit awkward
because it means including a C file from another C file but it's better
for the build system.

Acked-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20525>

21 months agoisaspec: Use argparse
Jason Ekstrand [Wed, 4 Jan 2023 19:19:46 +0000 (13:19 -0600)]
isaspec: Use argparse

This also cleans up some of our python script execution conventions and
handles mako errors better. Copied a bit from vk_entrypoints_gen.py.

Acked-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20525>

21 months agoisaspec: Stop using s and xml from the global namespace
Jason Ekstrand [Wed, 4 Jan 2023 19:33:20 +0000 (13:33 -0600)]
isaspec: Stop using s and xml from the global namespace

We really shouldn't rely on these being global variables.  Pass them
along instead.

Acked-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20525>

21 months agoasahi: Advertise MRT and fbfetch
Alyssa Rosenzweig [Mon, 19 Dec 2022 19:26:35 +0000 (14:26 -0500)]
asahi: Advertise MRT and fbfetch

These should both work now.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoagx: Lower discard to zs_emit when zs_emit used
Alyssa Rosenzweig [Tue, 27 Dec 2022 20:09:24 +0000 (15:09 -0500)]
agx: Lower discard to zs_emit when zs_emit used

It is invalid to use both sample_mask and zs_emit in the same shader. We'll need
to do something similar for sample mask writes.

Fixes Dolphin ubershaders.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoagx: Fix discard with MRT
Alyssa Rosenzweig [Fri, 2 Dec 2022 18:46:34 +0000 (13:46 -0500)]
agx: Fix discard with MRT

The exact semantics of sample_mask aren't quite clear to me yet, but executing
multiple sample_mask instructions seems to raise a fault :|

Fixes SuperTuxKart's advanced renderer.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoagx: Introduce "no_varyings" instruction
Alyssa Rosenzweig [Thu, 22 Dec 2022 02:50:38 +0000 (21:50 -0500)]
agx: Introduce "no_varyings" instruction

Must be used at the end of a vertex shader that does NOT write any varyings, has
rasterizer discard enabled, and is run only for its side effects.

The encoding looks like st_var, but I don't know what this actually *does*. I
just know that the GPU faults if this is omitted.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoagx: Consider "stop" a control flow instruction
Alyssa Rosenzweig [Thu, 22 Dec 2022 02:50:04 +0000 (21:50 -0500)]
agx: Consider "stop" a control flow instruction

...and therefore it needs to be after a "logical end". This means that
"after_block_logical" will do the right thing for the last block.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoagx: Optimize waits locally
Alyssa Rosenzweig [Tue, 20 Dec 2022 16:12:24 +0000 (11:12 -0500)]
agx: Optimize waits locally

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoagx: Remove logical_end later
Alyssa Rosenzweig [Tue, 20 Dec 2022 19:52:20 +0000 (14:52 -0500)]
agx: Remove logical_end later

So we can use after_block_logical in the wait insertion pass.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoagx: Validate widths of vectors
Alyssa Rosenzweig [Tue, 20 Dec 2022 16:16:55 +0000 (11:16 -0500)]
agx: Validate widths of vectors

Check the invariant that the widths of vectors in the IR are consistent, by
checking that write registers and read registers match up between the writers
and readers respectively.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoagx: Add agx_read_registers helper
Alyssa Rosenzweig [Tue, 20 Dec 2022 16:12:01 +0000 (11:12 -0500)]
agx: Add agx_read_registers helper

To be used for inserting waits post-RA.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoagx: Compact st_tile argument per mask
Alyssa Rosenzweig [Tue, 20 Dec 2022 19:04:31 +0000 (14:04 -0500)]
agx: Compact st_tile argument per mask

Otherwise the number of read registers won't match the vector we input, which
will trigger validation errors.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoagx: Insert waits post-RA
Alyssa Rosenzweig [Tue, 20 Dec 2022 03:40:26 +0000 (22:40 -0500)]
agx: Insert waits post-RA

This is the first step towards reducing stalling.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoagx: Pack texture scoreboard slots
Alyssa Rosenzweig [Tue, 20 Dec 2022 03:39:53 +0000 (22:39 -0500)]
agx: Pack texture scoreboard slots

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoagx: Pack wait instructions
Alyssa Rosenzweig [Tue, 20 Dec 2022 03:39:37 +0000 (22:39 -0500)]
agx: Pack wait instructions

For different scoreboard slots.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoagx: Remove unused idiv const func
Alyssa Rosenzweig [Tue, 20 Dec 2022 19:42:38 +0000 (14:42 -0500)]
agx: Remove unused idiv const func

This was used for instancing, but has been unused since 8dcf7648f15 ("agx: Lower VBOs in NIR")

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoagx: Use metadata for VS varying linking
Alyssa Rosenzweig [Sun, 18 Dec 2022 17:01:15 +0000 (12:01 -0500)]
agx: Use metadata for VS varying linking

Rather than variables. This gets rid of all backend nir_variable use.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoagx: Don't use nir_variable when gathering flat varyings
Alyssa Rosenzweig [Sun, 18 Dec 2022 16:59:19 +0000 (11:59 -0500)]
agx: Don't use nir_variable when gathering flat varyings

Walk the IR instead. This happens when preprocessing so it doesn't really
matter, but it complicates the nir_variable audit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoagx: Hash agx_instr faster
Alyssa Rosenzweig [Sun, 18 Dec 2022 16:43:09 +0000 (11:43 -0500)]
agx: Hash agx_instr faster

Prior to this change, agx_opt_cse is our most expensive backend pass, due to the
time spent hashing instructions. hash_instr was calling into XXH32 a massive
number of times, often to hash only a single bit. It's much faster to hash
entire blocks of memory at a time. Optimize to do just that.

With this change, agx_opt_cse is now cheaper than instruction selection as
it should be.

No shader-db changes (except CPU time decrease).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoagx: Use texture write mask
Alyssa Rosenzweig [Tue, 20 Dec 2022 04:27:30 +0000 (23:27 -0500)]
agx: Use texture write mask

We do need to use undefs instead of zeroes in this internal collect. While this
vector gets copypropped out, it'd cause us to fail compilation if noopt is on.
Fix that.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoagx: Note that textures clobber even masked
Alyssa Rosenzweig [Tue, 20 Dec 2022 04:42:09 +0000 (23:42 -0500)]
agx: Note that textures clobber even masked

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoagx: Plumb in store instruction
Alyssa Rosenzweig [Sat, 3 Dec 2022 02:41:22 +0000 (21:41 -0500)]
agx: Plumb in store instruction

This will be used for compute kernels (and transform feedback) in the (near)
future. For now, let's get the opcode plumbed in the backend to reduce some of
the rebase pain.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoasahi/lower_tilebuffer: Avoid loading sample mask
Alyssa Rosenzweig [Sun, 18 Dec 2022 04:53:36 +0000 (23:53 -0500)]
asahi/lower_tilebuffer: Avoid loading sample mask

If a render target isn't written to, we don't use the sample mask. Avoid
generating the intermediate instructions, common with gl_FragColor. It will get
DCE'd, but this means less work for DCE, which should help for shader jank since
this pass gets called per-variant.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoasahi: Remove outdated comment
Alyssa Rosenzweig [Wed, 21 Dec 2022 17:30:15 +0000 (12:30 -0500)]
asahi: Remove outdated comment

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoasahi: Implement linear 2D array textures
Alyssa Rosenzweig [Wed, 21 Dec 2022 02:00:10 +0000 (21:00 -0500)]
asahi: Implement linear 2D array textures

These are useful for layered staging resources. Tested by forcing linear
textures and running dEQP-GLES3.functional.texture.format.sized.2d_array.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoasahi: Correct acceleration_buffer for layered images
Alyssa Rosenzweig [Wed, 21 Dec 2022 17:13:10 +0000 (12:13 -0500)]
asahi: Correct acceleration_buffer for layered images

The old calculation was wrong if layer != 0.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoasahi: Add XML for linear 2D arrays
Alyssa Rosenzweig [Wed, 21 Dec 2022 01:59:26 +0000 (20:59 -0500)]
asahi: Add XML for linear 2D arrays

These look a bit like compressed images, and elucidate one of the common fields.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoasahi: Add XML required for vertex shader side effects
Alyssa Rosenzweig [Thu, 22 Dec 2022 03:00:56 +0000 (22:00 -0500)]
asahi: Add XML required for vertex shader side effects

Basically for rasterizer discard. We'll use these in a moment to implement
transform feedback.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoasahi: Dump uniforms when decoding
Alyssa Rosenzweig [Tue, 20 Dec 2022 19:22:00 +0000 (14:22 -0500)]
asahi: Dump uniforms when decoding

These often have addresses in them.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoasahi: Check box implement NV_conditional_render
Alyssa Rosenzweig [Mon, 19 Dec 2022 19:41:36 +0000 (14:41 -0500)]
asahi: Check box implement NV_conditional_render

Use the freedreno lowering. It'll be slow but I don't know of any apps that
actually use this and it's required for GL 3.0.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoail: Add compression_layer_stride_B field
Alyssa Rosenzweig [Wed, 21 Dec 2022 17:12:47 +0000 (12:12 -0500)]
ail: Add compression_layer_stride_B field

So we can index into the compression buffer of layered images.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agoail: Support linear 2D arrays
Alyssa Rosenzweig [Wed, 21 Dec 2022 01:57:21 +0000 (20:57 -0500)]
ail: Support linear 2D arrays

These are straightforward.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agodocs/features: Add more missed asahi
Alyssa Rosenzweig [Mon, 19 Dec 2022 19:30:36 +0000 (14:30 -0500)]
docs/features: Add more missed asahi

Should already be there.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>

21 months agofreedreno/decode: Deal with suballocated buffers
Rob Clark [Tue, 3 Jan 2023 15:49:58 +0000 (07:49 -0800)]
freedreno/decode: Deal with suballocated buffers

We can end up logging both the buffer that the toplevel cmdstream is
allocated, as well as the sub-allocated part of that buffer.  Possibly
the kernel could do better about this, but to avoid undecodeable
cmdstream dumps and devcores, detect this case and deal with it.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20496>

21 months agofreedreno: Limit max draws per batch
Rob Clark [Mon, 2 Jan 2023 17:19:49 +0000 (09:19 -0800)]
freedreno: Limit max draws per batch

Mostly so that piglit drawoverhead doesn't OoM itself with absurd # of
draws.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20496>

21 months agofreedreno/drm: Add nr_suballoc_bos size check
Rob Clark [Mon, 2 Jan 2023 16:45:51 +0000 (08:45 -0800)]
freedreno/drm: Add nr_suballoc_bos size check

We also want to ensure we don't hit the limit of max suballoc BOs.
Piglit drawoverhead would manage to hit this.

Fixes: 48610676897 ("freedreno/drm: Add sub-allocator")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20496>

21 months agofreedreno: Fix FD_MESA_DEBUG=nohw
Rob Clark [Mon, 2 Jan 2023 16:35:44 +0000 (08:35 -0800)]
freedreno: Fix FD_MESA_DEBUG=nohw

We need to construct a dummy fence in this case.

Fixes: 48b5164356c ("freedreno/drm: Return fence from submit flush")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20496>

21 months agofreedreno/drm: Mark ring heap buffers for dumping
Rob Clark [Sun, 1 Jan 2023 20:17:41 +0000 (12:17 -0800)]
freedreno/drm: Mark ring heap buffers for dumping

Ensure that these get FD_RELOC_DUMP flag set so cmdstream dumps and
devcore's capture them.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20496>

21 months agoradv: Always compile accel structure shaders on demand.
Bas Nieuwenhuizen [Fri, 23 Dec 2022 13:31:40 +0000 (14:31 +0100)]
radv: Always compile accel structure shaders on demand.

Some CTS tests enable all extensions ... , which combined with having
no shader cache on some platforms results in some CTS tests timing
out (in particular tests recreating the device all the time).

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

21 months agoradv: Support on demand compilation of fmask shaders.
Bas Nieuwenhuizen [Fri, 23 Dec 2022 13:09:12 +0000 (14:09 +0100)]
radv: Support on demand compilation of fmask shaders.

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

21 months agor300: lower fsign in nir
Pavel Ondračka [Wed, 7 Dec 2022 15:19:30 +0000 (16:19 +0100)]
r300: lower fsign in nir

Nothing significant in shader-db on RV530:
total instructions in shared programs: 134963 -> 134957 (<.01%)
instructions in affected programs: 1108 -> 1102 (-0.54%)
helped: 7
HURT: 1
total temps in shared programs: 17153 -> 17154 (<.01%)
temps in affected programs: 38 -> 39 (2.63%)
helped: 2
HURT: 3

Just some fluctuations from pair scheduling due to different code order.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20208>

21 months agor300: move some ftrunc lowering to nir
Pavel Ondračka [Wed, 7 Dec 2022 15:14:12 +0000 (16:14 +0100)]
r300: move some ftrunc lowering to nir

There are still some ftruncs left as most of them originates in
nir_lower_int_to_float and that is currently called after nir_opt_algebraic
in ntt.

No change in shader-db.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20208>

21 months agor300: use nir lowering for ffloor
Pavel Ondračka [Wed, 7 Dec 2022 15:11:41 +0000 (16:11 +0100)]
r300: use nir lowering for ffloor

Negligible amount of instructions saved on RV530:
total instructions in shared programs: 134970 -> 134963 (<.01%)
instructions in affected programs: 2273 -> 2266 (-0.31%)
helped: 9
HURT: 1

The one hurt shader is when we fail to recognize the x - ffract(x)
pattern and skip the don't emit ftrunc optimization as implemented
in the previous patch due to some non-trivial swizzles going on.

Signed-off-by: Pavel Ondračka <pave.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20208>

21 months agonir: check for x - ffract(x) patterns when lowering f2i32
Pavel Ondračka [Wed, 7 Dec 2022 15:10:01 +0000 (16:10 +0100)]
nir: check for x - ffract(x) patterns when lowering f2i32

We already skip emitting ftrunc in nir_lower_int_to_float when there is
ffloor, fround or any other integer-making opcode preceding f2i32. However
if lower_ffloor is set for driver that doesn't support integers, the lowered
x - ffract(x) patterns would not be recognized and extra ftruct would be
emitted, doing unnecessary rounding.

This optimization only works if there is no non-trivial swizzling used for
the fadd, fneg and ffract involved, which seems to be 99% of the cases according
to my testing.

This is needed to enable nir ffloor lowering on r300 driver without regressions.

I'm not sure if this helps anybody else, the only hardware which sets
lower_ffloor and converts ints to floats (and can't do trunc) are some old
etnaviv cards, so maybe it will help there a bit.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20208>

21 months agoegl: handle NULL loaderPrivate in dri_is_thread_safe
Pierre-Eric Pelloux-Prayer [Mon, 2 Jan 2023 16:27:41 +0000 (17:27 +0100)]
egl: handle NULL loaderPrivate in dri_is_thread_safe

This can happen when a context is created from
loader_dri3_blit_context_get and glthread is enabled.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7949
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7960
Cc: mesa-stable
Acked-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20479>

21 months agoradv: use vk_dynamic_graphics_state for the color blend state
Samuel Pitoiset [Wed, 14 Dec 2022 12:43:47 +0000 (13:43 +0100)]
radv: use vk_dynamic_graphics_state for the color blend state

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

21 months agoradv: rework some color blend state fields for vk_dynamic_graphics_state
Samuel Pitoiset [Wed, 14 Dec 2022 09:31:53 +0000 (10:31 +0100)]
radv: rework some color blend state fields for vk_dynamic_graphics_state

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

21 months agoradv: use vk_dynamic_graphics_state for the multisample state
Samuel Pitoiset [Wed, 14 Dec 2022 11:00:52 +0000 (12:00 +0100)]
radv: use vk_dynamic_graphics_state for the multisample state

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

21 months agoradv: use vk_dynamic_graphics_state for the depth stencil state
Samuel Pitoiset [Wed, 14 Dec 2022 09:00:52 +0000 (10:00 +0100)]
radv: use vk_dynamic_graphics_state for the depth stencil state

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

21 months agoradv: use vk_dynamic_graphics_state for the rasterization state
Samuel Pitoiset [Wed, 14 Dec 2022 08:53:49 +0000 (09:53 +0100)]
radv: use vk_dynamic_graphics_state for the rasterization state

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

21 months agoradv: use vk_dynamic_graphics_state for the discard rectangles state
Samuel Pitoiset [Wed, 14 Dec 2022 08:23:09 +0000 (09:23 +0100)]
radv: use vk_dynamic_graphics_state for the discard rectangles state

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

21 months agoradv: use vk_dynamic_graphic_state for the viewport state
Samuel Pitoiset [Wed, 14 Dec 2022 08:18:08 +0000 (09:18 +0100)]
radv: use vk_dynamic_graphic_state for the viewport state

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

21 months agoradv: use vk_dynamic_graphics_state for the input assembly state
Samuel Pitoiset [Wed, 14 Dec 2022 07:57:09 +0000 (08:57 +0100)]
radv: use vk_dynamic_graphics_state for the input assembly state

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

21 months agoradv: use vk_dynamic_graphics_state for the tessellation state
Samuel Pitoiset [Wed, 14 Dec 2022 07:54:10 +0000 (08:54 +0100)]
radv: use vk_dynamic_graphics_state for the tessellation state

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

21 months agoradv: use vk_dynamic_graphics_state for the fragment shading rate state
Samuel Pitoiset [Wed, 14 Dec 2022 07:49:52 +0000 (08:49 +0100)]
radv: use vk_dynamic_graphics_state for the fragment shading rate state

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

21 months agoradv: move viewport pre-computed xform outside of radv_viewport_state
Samuel Pitoiset [Wed, 14 Dec 2022 08:09:04 +0000 (09:09 +0100)]
radv: move viewport pre-computed xform outside of radv_viewport_state

I think we should distinguish between dynamic states (applications) and
hardware states, and this will allow us to use vk_viewport_state
instead of our own structs.

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

21 months agovbo/save: avoid dangling_attr_ref situation
Pierre-Eric Pelloux-Prayer [Fri, 16 Dec 2022 15:16:45 +0000 (16:16 +0100)]
vbo/save: avoid dangling_attr_ref situation

dangling_attr_ref=true can be set when the following happens:

  glBegin(GL_TRIANGLES)
  glVertex(...)
  glVertex(...)
  glColor4(...)
  glVertex(...)

When glColor4 is hit, the first 2 vertices are copied to the vertex_store
by upgrade_vertex, but since this is done before glColor4 new values are
copied, we make a note to fixup these attribute laters using dangling_attr_ref.

This causes very slow rendering. What this commit does instead, is in this
situation, the new attribute value are backported to the vertex store for the
copied vertices after upgrade_vertex is done updating the layout.

This avoids the slow corner case.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7912

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20495>

21 months agovbo: simplify current_init since VBO_ATTRIB_POS is 0
Pierre-Eric Pelloux-Prayer [Fri, 16 Dec 2022 13:58:31 +0000 (14:58 +0100)]
vbo: simplify current_init since VBO_ATTRIB_POS is 0

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20495>

21 months agointel_noop_drm_shim: add ability to specify device id
Max Lee [Wed, 4 Jan 2023 22:52:40 +0000 (09:52 +1100)]
intel_noop_drm_shim: add ability to specify device id

Given a GPU platform, there are multiple device ids. This commit
adds ability to specify device id for the shim, instead of using
one of the hard-coded device ids per platform.

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

21 months agov3dv: initialize fd variable for proper error handling
Maíra Canal [Sat, 31 Dec 2022 13:44:18 +0000 (10:44 -0300)]
v3dv: initialize fd variable for proper error handling

Currently, process_singlesync_signals() checks if fd == -1 to handle
possible errors in the drmSyncobjExportSyncFile function. But, fd is not
initialized, which means that drmSyncobjExportSyncFile might fail and
the error will not be handled as fd might not be equal to -1.

Therefore, initialize the fd variable with value -1 to ensure proper
error handling.

cc: mesa-stable

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20475>

21 months agoci/b2c: start making use of the harbor.fd.o
Martin Roukala (né Peres) [Thu, 29 Dec 2022 07:16:53 +0000 (09:16 +0200)]
ci/b2c: start making use of the harbor.fd.o

A new container registry was added recently in the fd.o infrastructure.
It is located in a datacenter that does not charge for bandwidth usage,
and aims to become the canonical registry in the future. It is however
currently configured to be a partial mirror of registry.fd.o, where
only the most-downloaded container images can be found.

The address of the new registry is specified in mesa/mesa's CI
variables, which means forks will default to registry.fd.o. However,
Valve Infra DUTs do not have access to the internet, and instead use
another cache proxy hosted locally on the CI gateways. This forced
Benjamin to overwrite the registry URL from harbor.freedesktop.org to
registry.freedesktop.org in 0bd9a062e1ab ("CI: Overwrite valve infra's
registry").

After adding support for the new registry in valve infra, then
deploying the update, we are now able to make use of the new container
registry. This commit simply rewrites the URL harbor.freedesktop.org
into `{{ harbor_fdo_registry }}`. This variable is set in the valve
infra to point to the `host:ip` of the service, which means changes to
the way we deploy this service can be done on the valve-infra side
without needing to make changes to every project that makes use of our
machines.

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7913
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20450>

21 months agoac/nir: handle 16bit varying streamout for legacy vs and gs copy shader
Qiang Yu [Fri, 2 Dec 2022 03:53:22 +0000 (11:53 +0800)]
ac/nir: handle 16bit varying streamout for legacy vs and gs copy shader

This is for VARYING_SLOT_VARx_16BIT slots varying streamout.

OpenGL ES will store 16bit medium precision varying to these slots.
Vulkan is not allowed to streamout varying less than 32bit.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20157>

21 months agoac/nir,radv: use ac_nir_gs_output_info
Qiang Yu [Thu, 1 Dec 2022 08:48:16 +0000 (16:48 +0800)]
ac/nir,radv: use ac_nir_gs_output_info

We are also going to add more fields in it.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20157>

21 months agonir/xfb: save high_16bits output info
Qiang Yu [Mon, 21 Nov 2022 07:53:11 +0000 (15:53 +0800)]
nir/xfb: save high_16bits output info

It is combined with slot location to identify a varying
when using VARYING_SLOT_VARx_16BIT.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20157>

21 months agozink: Only expose PIPE_CAP_SHADER_ATOMIC_INT64 if we can do shared and ssbos.
Emma Anholt [Tue, 3 Jan 2023 22:33:44 +0000 (14:33 -0800)]
zink: Only expose PIPE_CAP_SHADER_ATOMIC_INT64 if we can do shared and ssbos.

Fixes: 3ac0706aa83b ("zink: export PIPE_CAP_SHADER_ATOMIC_INT64")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20506>