Compare commits

...

3402 Commits

Author SHA1 Message Date
Dylan Baker
7a3414c4bd VERSION: update to 22.1.7 2022-08-17 09:53:25 -07:00
Dylan Baker
7e0bd9d293 docs: add release notes for 22.1.7 2022-08-17 09:53:25 -07:00
Qiang Yu
ed362ae264 nir/lower_gs_intrinsics: fix primitive count for points
When primitive is points, EndPrimitive can't be used to count
primitive. Need to use vertex count instead. And it's also not
needed to do vertex per primitive count and overwrite incomplete
primitive work for points.

Fixes: 2be99012e9 ("nir: Add ability to count emitted GS primitives.")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17805>
(cherry picked from commit 84956286a8)
2022-08-16 10:08:21 -07:00
Eric Engestrom
881c4d4654 vk/device-select-layer: fix .sType of VkPhysicalDeviceGroupProperties
The validation layers complained:
> Validation Error: [ VUID-VkPhysicalDeviceGroupProperties-sType-sType ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xc9edee8b | vkEnumeratePhysicalDeviceGroups: parameter pPhysicalDeviceGroupProperties[0].sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES The Vulkan spec states: sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkPhysicalDeviceGroupProperties-sType-sType)

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Fixes: c196ffaca6 ("vk-device-select: add device group support")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18037>
(cherry picked from commit 4588453815)
2022-08-16 10:08:19 -07:00
Pavel Ondračka
9ae5b4aff3 r300: fix variables detection for paired ALU and TEX instructions in different branches
TEX instrutions can't write xyz and w to separate registers so we
need to create variables from them first, otherwise we can create
two variables from ALU writing the same register xyz and w in other
branch (this usually works when TEX is not present as the xyz and
w can read/write from different registers).

This fixes regalloc because the variables are later used as a
graph nodes.

The variable order should not matter but it slightly does (leading
to approx 0.3% shader-db temps increase as compared to previous
state), so just sort the variables list afterwards to be as close
to the previous behavior as possible and prevent the regression.

CC: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6936
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17987>
(cherry picked from commit 88fd397c74)
2022-08-16 10:08:19 -07:00
Axel Davy
e6be63857b frontend/nine: Fix ff position_t fallback when w = 0
For post-transformed vertices, w = 0 is similar to
w = 1. Replace the value to fix rcp(w).

It is common for apps to pass w = 0 for
position_t.

cc: mesa-stable

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18021>
(cherry picked from commit b5df20568a)
2022-08-16 10:08:18 -07:00
Axel Davy
d1a556a5f0 frontend/nine: Fix shader multi-use crash
Due to the driver live shader cache, it's possible
two different d3d9 shaders get the same cso.

As it's disallowed to destroy a shader cso being
bound, nine checks for this scenario. However it
was not taking into account the cso might be from
a different shader.

cc: mesa-stable

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18021>
(cherry picked from commit 93da6e9f34)
2022-08-16 10:08:17 -07:00
Axel Davy
acd904f01b frontend/nine: Fix cso restore bug
Invalidating all state groups is not sufficient, as
some states check for actual changes.
The correct way is to invalidate the
commit mask.

Found with a wine test.

cc: mesa-stable

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18021>
(cherry picked from commit 4c65ccab6d)
2022-08-16 10:08:16 -07:00
Axel Davy
d6659eb5e3 frontend/nine: Fix ATOC handling
The previous code was incorrectly checking the previous
value of alphatestenable.
In addition, remove an optimization that cannot hit (as we
filter out redundant state settings).

cc: mesa-stable

Fixes: 1272640d5 ("st/nine: Fix alpha to coverage states")
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18021>
(cherry picked from commit 4f953ad512)
2022-08-16 10:08:16 -07:00
Axel Davy
ef8b0f095a frontend/nine: Fix buffer tracking out of bounds
Fixes a crash in a ffxi trace, which draws out of bounds.
This was previously resulting in trying to fill a buffer
resource not big enough.

cc: mesa-stable
Fixes: 380c2bf ("st/nine: Optimize dynamic systemmem buffers")

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18021>
(cherry picked from commit e5124e83ba)
2022-08-16 10:08:15 -07:00
Axel Davy
d16669e227 frontend/nine: Skip invalid swvp calls
Without this it may crash running wine tests.
According to the test themselves, the correct
behaviour is a bit more complicated, but
that's a first step.

cc: mesa-stable

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18021>
(cherry picked from commit b74febffe6)
2022-08-16 10:08:14 -07:00
Dylan Baker
b400c2cd2a .pick_status.json: Mark 11ab608779 as denominated 2022-08-16 10:08:13 -07:00
pal1000
fee07a3937 meson: Microsoft / maybe Intel CLC need the all-targets workaround
just like clover

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5666
Fixes: 1506ea2ecb ("Move a bunch of the CLC stuff from src/microsoft to common code")

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17682>
(cherry picked from commit b5b855149c)
2022-08-16 10:08:09 -07:00
Dylan Baker
6cf728541b .pick_status.json: Update to 74fc367127 2022-08-16 10:08:01 -07:00
sjfricke
72e146087c isl: fix bug where sb.MOCS is not being set
Currently the sb.MOCS is being reset to zero after struct init.

Signed-off-by: sjfricke <spencerfricke@gmail.com>
Fixes: c27fcb1d3b ("isl: Fill in MOCS for NULL depth, stencil, and HiZ buffers.")
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17985>
(cherry picked from commit 861167f41d)
2022-08-12 09:45:36 -07:00
Marek Olšák
6868236216 glthread: call _mesa_glthread_DeleteBuffers unconditionally
Deleted buffers were not unbound in glthread.

Fixes: 4fa24747b9 - glthread: call _mesa_glthread_BindBuffer unconditionally

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17976>
(cherry picked from commit 28e351673e)
2022-08-12 09:45:35 -07:00
Marek Olšák
acbef69cf0 glthread: unbind framebuffers in glDeleteFramebuffers
Tests:
    dEQP-GLES2.functional.lifetime.delete_bound.framebuffer
    dEQP-GLES2.functional.state_query.integers.framebuffer_binding_getinteger

Fixes: e48f676835 - glthread: don't sync for more glGetIntegerv enums for glretrace

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17976>
(cherry picked from commit eb4036ea5b)
2022-08-12 09:45:34 -07:00
Charmaine Lee
a8a4f91d09 mesa/st: fix reference to nir->info after nir_to_tgsi
The nir shader memory is freed in nir_to_tgsi(), but the already
freed shader info is referenced later when create compute state.
To avoid referencing the freed memory, copy the shader info first before
calling nir_to_tgsi.

Fixes vmx crash running aztec on SVGA driver.
Fixes: 580f1ac473 ("nir: Extract shader_info->cs.shared_size out of union")

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17999>
(cherry picked from commit 4393be8291)
2022-08-12 09:45:33 -07:00
Dylan Baker
6520ce7140 .pick_status.json: Update to 24b9ad7cd5 2022-08-12 09:44:32 -07:00
Lionel Landwerlin
67ec24c4c8 anv: don't return incorrect error code for vkCreateDescriptorPool
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7013
Cc: mesa-stable
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17945>
(cherry picked from commit 56bb29cb93)
2022-08-11 10:33:05 -07:00
Jesse Natalie
19325d15de egl/wgl: Fix some awkward sizeof formatting
Fixes: 3415bf02 ("egl: Add a basic Windows driver")
Suggested-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Sidney Just <justsid@x-plane.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12964>
(cherry picked from commit 17eda68df3)
2022-08-11 10:33:04 -07:00
Jesse Natalie
960c0d2663 egl/wgl: Delete unused variables/code
Fixes: 3415bf02 ("egl: Add a basic Windows driver")
Suggested-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Sidney Just <justsid@x-plane.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Tested-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12964>
(cherry picked from commit efd2ae6c0c)
2022-08-11 10:33:04 -07:00
Mike Blumenkrantz
5d45ed80f9 nir/validate: clamp unsized tex dests to 32bit
this is the "default" size that's expected

cc: mesa-stable

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17874>
(cherry picked from commit b7eda568a4)
2022-08-11 10:33:03 -07:00
Dylan Baker
619ec6c879 .pick_status.json: Update to a3bf0da1cb 2022-08-11 10:32:57 -07:00
Erik Faye-Lund
a71b24c64a zink: do not use VK_FORMAT_D32_SFLOAT_S8_UINT without checking
Without this, we might end up trying to use VK_FORMAT_D32_SFLOAT_S8_UINT
even when it's not supported...

Cc: mesa-stable
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17953>
(cherry picked from commit 3340dea194)
2022-08-11 10:30:38 -07:00
Erik Faye-Lund
627cd2a447 zink: add have_D32_SFLOAT_S8_UINT boolean
This will be reused in the following commit.

Cc: mesa-stable
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17953>
(cherry picked from commit 71c1ca3c67)
2022-08-11 10:30:38 -07:00
Emma Anholt
ac1cb14899 zink: Make sure that we keep the existing ici pNext chain on inserts.
For external image imports, we'd lose the mutable image format list,
causing turnip to get angry that we try to do UBWC despite not having a
UBWC-compatible format list.

Cc: mesa-stable
Fixes: 28ee911ad6 ("zink: handle mutable swapchain images with dmabuf")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17900>
(cherry picked from commit 8dda0a01bb)
2022-08-11 10:30:38 -07:00
Pierre-Eric Pelloux-Prayer
e0e7ad1180 amdgpu/bo: update uses_secure_bos when importing buffers
Fixes: 90b98c0649 ("amd/tmz: move uses_secure_bos to radeon_winsys")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11449>
(cherry picked from commit a693fbf64b)
2022-08-11 10:30:38 -07:00
Erik Faye-Lund
4e39b6f4db docs: fixup link to virgl docs
Fixes: 6897266ce0 ("docs: import virgl docs")
Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17881>
(cherry picked from commit 1a3b086b06)
2022-08-11 10:30:38 -07:00
Connor Abbott
5796cff61a tu: Fix sysmem depth attachment clear flushing
We can't invalidate CCU if there is any dirty data that hasn't been
flushed yet. In the case where we clear depth, we know that the depth
attachment itself isn't dirty but there may be dirty data from other
renderpasses. Therefore we need to flush before invalidating depth.

Fixes: 487aa80 ("tu: Rewrite flushing to use barriers")
Closes: #6987
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17940>
(cherry picked from commit a7e64ab63c)
2022-08-11 10:30:38 -07:00
Rhys Perry
71703783c2 aco: fix LdsBranchVmemWARHazard with 2+ branch chains
For example, "DS -> branch -> VMEM -> branch -> DS".

fossil-db (navi10):
Totals from 639 (0.40% of 161220) affected shaders:
Instrs: 629090 -> 628254 (-0.13%); split: -0.19%, +0.06%
CodeSize: 3410164 -> 3406748 (-0.10%); split: -0.14%, +0.04%
Latency: 7834755 -> 7821011 (-0.18%); split: -0.70%, +0.52%
InvThroughput: 1369698 -> 1374495 (+0.35%); split: -0.12%, +0.47%

A lot of the fossil-db changes are noise.
threekingdoms.8db138826c386a62.1.foz/0b222ed175eebad0 is an example of a
shader that actually has this issue.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Fixes: c037ba1bb7 ("aco/gfx10: Mitigate LdsBranchVmemWARHazard.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17697>
(cherry picked from commit b17e59a03b)
2022-08-11 10:30:38 -07:00
Alyssa Rosenzweig
e63f5e6eb4 agx: Fix packing of samplers in texture instrs
Typo in the handwritten packing code, oof!

Fixes incorrectly repeated shadows in Neverball (among many other bugs,
I assume). Huge thanks to Lina for the idea that this was the
bug -- fixing it was a breeze from there :-)

Fixes: 9f55538834 ("agx: Pack texture ops")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Suggested-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17198>
(cherry picked from commit 47a3f1226c)
2022-08-11 10:30:38 -07:00
Dmitry Osipenko
7dadb0a81a virgl: Fix unmapping of blob resources
OpenGL API calls like glClearBufferData() result in mapping/unmapping
of a given buffer by Mesa and unmapping of a host blob fails in
virglrenderer because VirGL driver uses command that is intended for
unmapping of a guest buffer. In particular this causes problem for the
"Total War: Warhammer" game that gets GL_OUT_OF_MEMORY error due to the
failed unmapping command. Fix this by setting the mapping usage flag in
accordance to the resource flags, allowing virgl_buffer_transfer_unmap()
to differentiate host buffer from guest.

Fixes: 3b54e5837a ("virgl: support PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT")
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17914>
(cherry picked from commit 46396e97be)
2022-08-11 10:30:38 -07:00
Rob Clark
a544df2afc freedreno/drm: Fix potential bo cache vs export crash
Keep the list head valid (empty) after allocation from bo cache.  Avoids
a potential later crash in lookup_bo in the following sequence:

1. alloc, bo cache hit
2. export
3. re-import

Cc: mesa-stable
Fixes: f3cc0d2747 ("freedreno: import libdrm_freedreno + redesign submit")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6988
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17888>
(cherry picked from commit 8b3f2a9e5d)
2022-08-11 10:30:37 -07:00
Marek Olšák
ff01821f7e radeonsi: don't assume that TC_ACTION_ENA invalidates L1 cache on gfx9
Just got into a midnight discussion with a hw guy.
TC_ACTION_ENA apparently doesn't invalidate L1, so don't clear
the INV_VCACHE flag.

Fixes: 4056e953fe - radeonsi: move emit_cache_flush functions into si_gfx_cs.c

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17902>
(cherry picked from commit 279315fd73)
2022-08-11 10:30:37 -07:00
Lionel Landwerlin
5c847c684c anv: fixup PIPE_CONTROL restriction on gfx8
We're missing a condition that is currently papered over by having
ANV_PIPE_HDC_PIPELINE_FLUSH_BIT in the invalidate bits.

v2: rework with simplication (Caio)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16905>
(cherry picked from commit 5e21f47428)
2022-08-11 10:30:37 -07:00
Dave Airlie
dce1f58b20 draw: don't touch info values that aren't valid.
These shouldn't be accessed, and shows up as an uninit access in
valgrind with piglit rasterpos

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10641>
(cherry picked from commit 5449e6d14c)
2022-08-11 10:30:37 -07:00
Mike Blumenkrantz
b6d9d1c9ed zink: add all format modifiers when adding for dmabuf export
adding LINEAR before was a good starter step, but LINEAR
might not actually be supported (e.g., nvidia)

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17775>
(cherry picked from commit 247b8f2924)
2022-08-11 10:30:37 -07:00
Mike Blumenkrantz
c098943120 zink: don't add modifiers if EXT_image_drm_format_modifier isn't present
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17775>
(cherry picked from commit 5e8ec87b68)
2022-08-11 10:30:37 -07:00
Mike Blumenkrantz
ab46774ae5 zink: use modifier_aspect to check for modifier plane in zink_resource_get_param
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17775>
(cherry picked from commit c824a53f35)
2022-08-11 10:30:37 -07:00
Mike Blumenkrantz
bab4564993 zink: demote dmabuf tiling to linear if modifiers aren't supported
this is effectively the same as LINEAR, and it still allows dmabuf creation

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17775>
(cherry picked from commit b59eb9c8b7)
2022-08-11 10:30:37 -07:00
Mike Blumenkrantz
eee80bc312 nine: check return on resource_get_handle
this has a return code, and if it return false, this is probably an
exit condition

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17775>
(cherry picked from commit 188721d6d3)
2022-08-11 10:30:37 -07:00
Mike Blumenkrantz
65c10ac61d zink: drop mode_changed check from linewidth/depthbias draw updates
this doesn't need to be updated on primtype change since it's always
set

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17775>
(cherry picked from commit a912952c3e)
2022-08-11 10:30:37 -07:00
Mike Blumenkrantz
03ea182f4f zink: init cache_put program fence on program creation
re-initializing here might overwrite an existing cache_put job

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17225>
(cherry picked from commit 3d58642984)
2022-08-11 10:30:37 -07:00
Eric Engestrom
1e95cc9fbe bin/gen_release_notes.py: bump advertised vulkan version to 1.3
Fixes: df8ac77af8 ("anv: Advertise Vulkan 1.3")
Fixes: 08c6f437cf ("radv: advertise Vulkan 1.3")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17759>
(cherry picked from commit 446d2039cb)
2022-08-11 10:30:37 -07:00
Mike Blumenkrantz
a3c0f0f181 zink: handle mutable swapchain images with dmabuf
if a non-kopper swapchain image supports srgb, add a VkImageFormatListCreateInfo
to permit srgb mutability and avoid violating spec

cc: mesa-stable

Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17773>
(cherry picked from commit 28ee911ad6)
2022-08-11 09:51:42 -07:00
Nanley Chery
2a653b2f6f iris: Make the D16 reg mode single-sampled
Wa_14010455700 is dependent on the format and sample count, but our
code to track whether or not it had been applied was only dependent on
the format.

As a result, we failed to enable the workaround when an app used a D16
2xMSAA buffer, then a D16 1xMSAA buffer right afterwards.

Make the workaround tracking code sample-dependent to fix this.

Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17859>
(cherry picked from commit a75cd15b94)
2022-08-11 09:51:41 -07:00
Nanley Chery
687324893d anv: Make the D16 reg mode single-sampled
Wa_14010455700 is dependent on the format and sample count, but our
code to track whether or not it had been applied was only dependent on
the format.

As a result, we failed to enable the workaround when an app used a D16
2xMSAA buffer, then a D16 1xMSAA buffer right afterwards.

Make the workaround tracking code sample-dependent to fix this.

Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17859>
(cherry picked from commit e7419c11ae)
2022-08-11 09:51:41 -07:00
Mike Blumenkrantz
5029afc750 zink: don't flag lazy push constant set dirty on batch change
this has its own flag

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17866>
(cherry picked from commit 7450990558)
2022-08-10 14:16:10 -07:00
Mike Blumenkrantz
bbcb6f8e06 zink: fix gfx program cache pruning with generated tcs
if the tcs was generated, then the prgram was added to the non-tcs cache,
which means deleting it from the tcs+tes cache will fail and then
context_destroy will explode

Fixes: 4123ee3c71 ("zink: invoke descriptor_program_deinit for programs on context destroy")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17866>
(cherry picked from commit c7ef4f9735)
2022-08-10 14:16:10 -07:00
Marek Olšák
6be4fee6a6 glthread: don't ignore glPushAttrib/glPopAttrib when tracking GL_CULL_FACE
Fixes: f4348ef60d - glthread: don't sync for glIsEnabled with a few enums

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17781>
(cherry picked from commit a4ee818b18)
2022-08-10 14:16:09 -07:00
Alyssa Rosenzweig
8e1135cf39 pan/decode: Fix overrun decoding planes
We need to calculate the # of descriptors like we do on Midgard.

Fixes: ae9316f812 ("pan/decode: Decode Valhall surface descriptor")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17842>
(cherry picked from commit 07e9543270)
2022-08-10 14:16:08 -07:00
Filip Gawin
2dae420bca r300: don't read from output transform_r300_vertex_SEQ/SNE
Native rewrite in current form doesn't check
type of register and may use output as a
temp.

Helps with 218 deqp-gles2 tests.

Cc: mesa-stable

Reviewed-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17736>
(cherry picked from commit 875ee25e98)
2022-08-10 14:16:07 -07:00
Mykhailo Skorokhodov
f82c5b0532 anv: Move Wa_1806527549 and enable by default
Move Wa_1806527549 into `init_render_queue_state` and
set HIZ_CHICKEN (7018h) bit = 1 by default.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6717
Signed-off-by: Mykhailo Skorokhodov <mykhailo.skorokhodov@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17778>
(cherry picked from commit 8b13acd715)
2022-08-10 14:16:06 -07:00
Mykhailo Skorokhodov
bd4726de73 iris: Move Wa_1806527549 and enable by default
Move Wa_1806527549 into `iris_init_render_context` and
set HIZ_CHICKEN (7018h) bit = 1 by default for TGL.

Cc: mesa-stable
Signed-off-by: Mykhailo Skorokhodov <mykhailo.skorokhodov@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17778>
(cherry picked from commit 6498328210)
2022-08-10 14:16:05 -07:00
Marcin Ślusarz
a8788b2392 intel/compiler: insert URB fence before task/mesh termination
Bspec 53421 says:
"A URB fence memory is typically performed prior the thread
exit message, so that the next thread dispatch that reads
that URB memory will see it."

Cc: 22.1 <mesa-stable>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16665>
(cherry picked from commit 7ebae85955)
2022-08-10 14:16:02 -07:00
Marcin Ślusarz
acca789234 intel/compiler: there are 4 types of fences on gfx >= 12.5
Found by code inspection.

There's an assert later checking that we haven't overflown
this array, so this change probably doesn't matter for any
workload.

Cc: 22.1 <mesa-stable>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16665>
(cherry picked from commit 30c0f2bfbb)
2022-08-10 14:16:02 -07:00
Marcin Ślusarz
141a588d10 intel/compiler: emit URB fences for TASK/MESH
Cc: 22.1 <mesa-stable>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16665>
(cherry picked from commit 2bd148c990)
2022-08-10 14:16:01 -07:00
Gert Wollny
b36f4e30de virgl: honor host caps in shader cash sha evaluation
This is needed because when we switch between GLES and GL on the host,
we have to lower atomics to ssbo, and with that the shaders  can't be
pulled from the cache anymore. Likewise when we move the disk image with
a shader cache to a different host, other features might change that
will need lowering. To avoid using stale shaders in this case, merge the
caps into into the shader cache sha.

Fixes: d6db4d2e08
    virgl: Add simple disk cache

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17798>
(cherry picked from commit f9703ac34d)
2022-08-10 14:15:57 -07:00
Mike Blumenkrantz
6457c85279 nine: set view_mask=0
nine doesn't use viewids, and this breaks drivers that support it

cc: mesa-stable

Reviewed-by: Axel Davy <davyaxel0@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17792>
(cherry picked from commit e5c50ed2d4)
2022-08-10 14:15:56 -07:00
Mike Blumenkrantz
fba2ff504c d3dadapter: fix sw pipe loading
this needs to check the env var in order to work correctly

cc: mesa-stable

Reviewed-by: Axel Davy <davyaxel0@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17792>
(cherry picked from commit 079857720b)
2022-08-10 14:15:56 -07:00
Eric Engestrom
bdee4ad4d9 docs/features.txt: mark VK_ANDROID_native_buffer as supported on v3dv
Fixes: 2686c5419d ("v3dv: add Android support")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17767>
(cherry picked from commit d6986e95d7)
2022-08-10 14:15:50 -07:00
Eric Engestrom
efb4ef9837 docs/features.txt: mark VK_ANDROID_native_buffer as supported on turnip
Fixes: 5789505ab3 ("turnip: Make Android platform build")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17767>
(cherry picked from commit bb75e353e6)
2022-08-10 14:15:49 -07:00
Marek Olšák
cd4f94898b util/u_threaded: fix a CPU storage crash due to an invalid codepath taken
Fixes: 3df9d8ed80 - gallium/u_threaded: implement pipelined partial buffer uploads using CPU storage

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6837
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6594
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6613

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17556>
(cherry picked from commit 83d820973c)
2022-08-10 14:15:45 -07:00
Connor Abbott
f2ef103863 tu: Treat CP_WAIT_FOR_ME as a cache invalidate
The workaround for draws that need a CP_WAIT_FOR_ME didn't work if the
barrier before the draw is in a separate command buffer from the draw.
The barrier would add a pending CP_WAIT_FOR_ME, but it would get dropped
on the floor at the end of the command buffer and the draw wouldn't have
a pending CP_WAIT_FOR_ME so it wouldn't emit one. We don't know in the
barrier if the destination is a draw with the workaround, so we have two
options:

- Emit any pending CP_WAIT_FOR_ME at the end of the command buffer (and
  before secondaries) in case there is a workaround draw later. This
  will emit an extra CP_WAIT_FOR_ME at the end of the command buffer in
  case there is an indirect command barrier.
- Always assume at the beginning of the command buffer that there is a
  pending CP_WAIT_FOR_ME. This will emit an extra CP_WAIT_FOR_ME before
  the first workaround-requiring draw in the command buffer, in case
  there was a barrier earlier.

The only draws requiring a workaround are currently
vkCmdDraw*IndirectCount(), which we assume are rarer than indirect
command barriers, so we implement the second option. This entails
treating it as a cache invalidate.

This fixes some upcoming dynamic rendering CTS tests that do
vkCmdDrawIndirectCount() in a secondary but put the barrier for it in
the primary.

Fixes: 37939e9c54 ("turnip: Fix the lack of WFM before indirect draws")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
(cherry picked from commit c5be444500)
2022-08-10 14:15:44 -07:00
Georg Lehmann
a6232e603a aco/ir: Fix swapped nle.
Cc: mesa-stable

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17763>
(cherry picked from commit 369b8c031a)
2022-08-10 14:15:42 -07:00
Mike Blumenkrantz
020991c60f util/blitter: respect PIPE_TEXTURE_RECT
if this isn't supported, don't use rect-related sampling

cc: mesa-stable

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17714>
(cherry picked from commit 62044403a9)

 Conflicts:
	src/gallium/drivers/zink/ci/zink-lvp-fails.txt
2022-08-10 14:15:31 -07:00
Mike Blumenkrantz
27b00f6e54 lavapipe: fix stencil clears
this uses the value from the stencil attachment

Fixes: 8068c68b1f ("lavapipe: Delete render passes")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17705>
(cherry picked from commit 6064d838e7)
2022-08-10 13:31:24 -07:00
Erik Faye-Lund
e743e03cc2 gallium/hud: do not use texture-rect for font
RECT textures used to be required to be supported by drivers. But since
the state-tracker learned how to lower these to 2D textures, some
drivers no longer support them.

While we have lowering in place for this, lowering it involves some
needless overhead. So let's just use a 2D texture instead of a RECT
texture.

Because having two versions and switching between them is more
complicated than it needs to be, let's just always use a 2D texture.
Similarly, let's just always multiply the reciprocal here, so we don't
have to test for PIPE_CAP_TGSI_DIV first.

Cc: mesa-stable
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17707>
(cherry picked from commit ba2146f93f)
2022-08-10 13:31:23 -07:00
Dylan Baker
4e23339f8d .pick_status.json: Update to 56f3319519 2022-08-10 13:26:54 -07:00
Dylan Baker
65fbedd8c4 VERSION: update to 22.1.6 2022-08-10 11:48:52 -07:00
Dylan Baker
898d3ec35d docs: add release notes for 22.1.6 2022-08-10 11:48:52 -07:00
Eric Engestrom
c69f1dba5c Revert "pan/bi: Require ATEST coverage mask input in R60"
This reverts commit 7ead256891.

See https://gitlab.freedesktop.org/mesa/mesa/-/issues/7025 for the
details, but the short version is that this was causing a segfault.
2022-08-10 17:26:40 +01:00
Dave Airlie
39c9a3c7fa llvmpipe: keep context list and use to track resource usage.
Just check across all contexts if a resource is referenced.

Fixes: 6bbbe15a78 ("Reinstate: llvmpipe: allow vertex processing and fragment processing in parallel")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17899>
2022-08-05 19:11:23 +00:00
Dave Airlie
a59e00173e llvmpipe: make last_fence a screen/rast object not a context one.
When a flush happens the per-context setup is used to hold the fence
for the last scene sent to the rasterizer. However when multiple
contexts are in use, this fence won't get returned to be blocked on.

Instead move the last fence to the rasterizer object, and return
that instead as it should be valid across contexts.

Fixes gtk4 bugs on llvmpipe since overlapping vertex/fragment.

Fixes: 6bbbe15a78 ("Reinstate: llvmpipe: allow vertex processing and fragment processing in parallel")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17899>
2022-08-05 19:11:23 +00:00
Mark Janes
bd1c04e187 intel/dev: drop warning for unhandled hwconfig keys
The hwconfig api may change unexpectedly prior to public release of
new platforms.  Also, public documentation of the hwconfig api
sometimes lags the release.

For these reasons, warnings about unhandled hwconfig keys are noisy,
likely to occur, and unhelpful to most users.  This commit drops those
warnings, in favor of a separate internal process for tracking
hwconfig api changes.

Suggested-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by:  Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit 6401d768b9)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17862>
2022-08-05 18:59:37 +00:00
Mykhailo Skorokhodov
cbc81bdbf5 anv: Use sampleLocationsEnable for sample locations
The spec says: "sampleLocationsEnable controls whether custom sample
locations are used. If sampleLocationsEnable is VK_FALSE, the default
sample locations are used and the values specified in
sampleLocationsInfo are ignored."

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6675
Signed-off-by: Mykhailo Skorokhodov <mykhailo.skorokhodov@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 50b21fb6e4)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17160>
2022-08-05 18:46:29 +00:00
Dylan Baker
b7df7f8145 docs: Add sha256 sum for 22.1.4 2022-08-04 10:28:49 -07:00
Dylan Baker
fa4b29bcac docs: Add sha256 sum for 22.1.5 2022-08-03 14:44:59 -07:00
Dylan Baker
f94151ee80 VERSION: update to 22.1.5 2022-08-03 14:13:26 -07:00
Dylan Baker
faf316b969 docs: add release notes for 22.1.5 2022-08-03 14:13:26 -07:00
Erik Faye-Lund
8ddf455f13 zink: fix EXT_color_write_enable check
Checking for the extension isn't enough, we also need to check for the
feature-bit.

Fixes: 49a20e0981 ("zink: start a unified driver workarounds struct")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17709>
(cherry picked from commit 747913377f)
2022-07-28 13:41:44 -07:00
Dave Airlie
7ee792cb9b crocus: fix leak in query code.
Fixes: f3630548f1 ("crocus: initial gallium driver for Intel gfx 4-7")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17731>
(cherry picked from commit 878784dbec)
2022-07-28 13:41:43 -07:00
Mike Blumenkrantz
256c0b91f2 zink: avoid crashing when bindless texture updates aren't used
some apps trigger the texture update path far in advance of when the
texture will be used, so don't crash and wait to do the update

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17665>
(cherry picked from commit a2f97bd88a)
2022-07-28 13:41:42 -07:00
Mike Blumenkrantz
0df74bb3ec zink: only flag fbfetch as rp update if fbfetch wasn't already configured
otherwise this is probably just a swapchain acquire which needs to update
the descriptor during begin_renderpass

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17665>
(cherry picked from commit c24c5972a8)
2022-07-28 13:41:42 -07:00
Pierre-Eric Pelloux-Prayer
46beee7493 radeonsi: check last_dirty_buf_counter and dirty_tex_counter
Check both counters in draw and compute, otherwise compute dispatches may
miss buffers invalidation.
This fixes the test case from https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/702
(both with and without GALLIUM_THREAD=0).

cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17394>
(cherry picked from commit af7c2ff842)
2022-07-28 13:41:41 -07:00
Icecream95
2560692681 panfrost: Don't unbind recently bound streamout targets
When unbinding extra targets, start after the last new target.

Fixes: 5ff7973560 ("panfrost: Import streamout data structures")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17447>
(cherry picked from commit a0851f1cc4)
2022-07-28 13:41:40 -07:00
Icecream95
235dd6c04f panfrost: Only emit images when they are present
nr_images is the trigger for allocating double the number of buffers
for attributes. When there are no images, there is not always enough
space for ALIGN_POT(k, 2) to not move k out of bounds, so don't
execute the line in that case.

Fixes: dc85f65e05 ("panfrost: emit shader image attribute descriptors")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17447>
(cherry picked from commit fe613a8de9)
2022-07-28 11:28:48 -07:00
Nanley Chery
76ddaeb32a iris: Don't leak compressed resources in iris_create_surface
Before this patch, we were leaking compressed resources in iris_create_surface.
Specifically, when we failed to create an uncompressed ISL surface and view for
a compressed resource, we didn't unreference the resource pointer we referenced
into the pipe_surface.

Fix this by delaying the pipe_surface initialization code to after attempting
to create the uncompressed surface and view.

Cc: 22.1 <mesa-stable>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17598>
(cherry picked from commit 6c65e990b6)
2022-07-28 10:15:28 -07:00
Nanley Chery
c276051682 iris: Don't leak surface states for compressed resources
Before this patch, we were leaking surface states in iris_create_surface.
Specifically, when we failed to create an uncompressed ISL surface and view for
a compressed resource, we didn't free surface states we allocated for it.

Fix this by attempting to create the uncompressed surface and view before we
allocate the surface states.

Cc: 22.1 <mesa-stable>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17598>
(cherry picked from commit bca601ffe9)
2022-07-28 10:15:28 -07:00
Daniel Schürmann
f8a04c8b6c radv/rt: fix nir_builder cursor in lower_rt_instructions()
Fixes: 207ce6d658 ('radv: Add helper to inline shaders into the main shader.')
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17301>
(cherry picked from commit f7c318901d)
2022-07-28 10:15:27 -07:00
Timur Kristóf
b4ce0d7113 ac/llvm: Add LLVM bug workaround to ac_build_mbcnt_add.
LLVM always believes that this instruction's upper bound is the wave
size, regardless of ac_set_range_metadata and regardless of whether
the add source is used.

As a workaround, emit an extra add instruction.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17706>
(cherry picked from commit 1e2663b62c)
2022-07-28 10:15:24 -07:00
Dave Airlie
624c6f9468 llvmpipe: fix aniso cube map arrays.
There was a coordinate missing when you have cube map arrays,
and aniso sampling.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fixes: ce2b711c0a ("gallivm: add support for anisotropic sampling.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17704>
(cherry picked from commit 21dd305694)
2022-07-28 10:15:24 -07:00
Jason Ekstrand
5a9ef84f10 vulkan/nir: Don't remove dead XFB outputs
Fixes: 21b405fbbc ("vulkan: Add a vk_shader_module_to_nir() helper")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17644>
(cherry picked from commit bd93d6f693)
2022-07-28 10:15:23 -07:00
Mike Blumenkrantz
b946850b19 zink: invoke descriptor_program_deinit for programs on context destroy
this should make multi-context shutdown more stable

affects:
glx@glx-visuals-depth -pixmap
glx@glx-visuals-stencil

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17658>
(cherry picked from commit 4123ee3c71)
2022-07-28 10:15:22 -07:00
Mike Blumenkrantz
dc5fcc2da0 zink: fix viewport count tracking
the number of viewports in use is based on the outputs of the last vertex
stage, not the viewports passed by the state tracker

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17639>
(cherry picked from commit 268011e8c6)
2022-07-28 09:39:23 -07:00
Mike Blumenkrantz
9ef9b9321c zink: call bind_last_vertex_stage() when binding vs
ensure all the necessary updates are flagged

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17639>
(cherry picked from commit eaf11d3cd9)
2022-07-28 09:39:22 -07:00
Mike Blumenkrantz
54a8bb32b7 zink: handle null samplerview in get_imageview_for_binding()
this is legal

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17639>
(cherry picked from commit 19eddeb226)
2022-07-28 09:39:12 -07:00
Mike Blumenkrantz
955729649a zink: handle max_vertices=0 in geometry shader
this is a weird corner case where glsl permits a zero value, so clamp to 1
and then don't emit any vertices to avoid driver hangs

affects:
dEQP-GL45-ES31.functional.geometry_shading.emit.points_emit_0_end_0

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17639>
(cherry picked from commit 5b58f8df53)
2022-07-28 09:39:11 -07:00
Dave Airlie
e5ce737b89 lavapipe: state latest conformance tests passed
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Cc: mesa-stable "22.1"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17643>
(cherry picked from commit bfebf51571)

Conflicts:
	src/gallium/frontends/lavapipe/lvp_device.c
2022-07-28 09:39:09 -07:00
Dave Airlie
f0a8da0819 crocus: fail query begin if upload allocation fails.
This is the only place I think I can see this crashing.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17615>
(cherry picked from commit e14022c052)
2022-07-28 09:36:38 -07:00
SoroushIMG
fa900881f6 Zink: Fix clear being missed when using emulated draws in zink_blit
zink_kopper_acquire_readback will flush any outstanding clears, this means that
the current clears need to be applied first before calling zink_kopper_acquire_readback.
This was already done for native_blit and native_resolve, also do this for the emulated draw path.
Seen as intermittent failures in cts case GTF-GL33.gtf21.GL2FixedTests.buffer_clear.buffer_clear.

Cc: mesa-stable
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17631>
(cherry picked from commit 2159a377c0)
2022-07-28 09:36:36 -07:00
SoroushIMG
bb9054a85a zink: Fix spirv stream 0 vertex emit for multistream shaders
Spirv spec does not allow the use of OpEmitVertex or OpEndPrimitive when there are multiple streams.
Instead emit the multi-stream version of these with stream set to 0.
This issue was seen when testing cts case KHR-GL46.transform_feedback.draw_xfb_stream_test

Fixes: 35e346f428 ("zink: handle vertex streams")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17513>
(cherry picked from commit 3dfd8e4d7d)
2022-07-28 09:36:35 -07:00
Rhys Perry
ca887b3175 radv: fix vbo_bound_mask indexing
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6812
Fixes: 1b8bdecf6e ("radv: add a mask of bound descriptor buffers for dynamic vertex input")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17521>
(cherry picked from commit 1d019d2ab7)

Conflicts:
	src/amd/vulkan/radv_cmd_buffer.c
2022-07-28 09:36:28 -07:00
Daniel Schürmann
5b86d21334 aco: fix assertion in insert_exec_mask
The exec mask might also be of type mask_type_loop.

Fixes: d068eb53e8 ('aco/insert_exec_mask: optimize top-level transition to exact before demote')
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17402>
(cherry picked from commit ac39e7bf23)
2022-07-27 15:59:35 -07:00
Iago Toral Quiroga
5e481bb5b8 v3dv: stop tracking push constant buffer references
Since we allocate this ourselves we can immediately add it to the
job at the time we allocate it.

This also fixes a bug we introduced when we implemented inline
uniforms because since that commit, if we had an inline uniform
buffer at index 1 which happend to have indirect access we would
track it in slot 0 instead of slot 1, potentially overwriting
the push constant buffer reference.

Fixes: ea3223e7a4 ('v3dv: implement VK_EXT_inline_uniform_block')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17536>
(cherry picked from commit e451c612df)
2022-07-27 15:59:34 -07:00
Lionel Landwerlin
d42978b1ea anv: fix primitive topology dynamic state emission on gfx7
This dynamic state uses the pipeline information so it needs to be
reemitted whenever the pipeline changes.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17601>
(cherry picked from commit a9abf1dd93)
2022-07-27 15:59:33 -07:00
Lionel Landwerlin
1be1029edf intel/fs: Set NonPerspectiveBarycentricEnable when the interpolator needs it.
[anholt: changed to make all drivers do the right thing by moving the
payload barycentric check into the compiler]

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17381>
(cherry picked from commit 2d1f021e16)
2022-07-27 15:59:32 -07:00
Dave Airlie
9ab162bf59 kms/dri: add mutex lock around map/unmap
this can get called from multiple threads with the recent llvmpipe
overlapping rendering changes, so make sure to lock around the
map/unmapping so they can't race.

This should fixes some crashes seen with kwin.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tested-by: Adam Williamson (Fedora)
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17531>
(cherry picked from commit 50e3303b3d)
2022-07-27 15:59:31 -07:00
Qiang Yu
1b4e99e929 ac/nir/ngg: add a barrier before prim id export
When culling enabled, it will use LDS space, which overlap with
the prim id export.

Fixes: e97f0463a8 ("ac/nir: Implement NGG deferred attribute culling in NIR.")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17593>
(cherry picked from commit eeaf0b1888)

 Conflicts:
	src/amd/common/ac_nir_lower_ngg.c
2022-07-27 15:59:30 -07:00
Qiang Yu
a9c354cd14 ac/nir/ngg: fix nogs culling scratch size
Should be in bytes not dwords.

Fixes: e97f0463a8 ("ac/nir: Implement NGG deferred attribute culling in NIR.")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17593>
(cherry picked from commit 0b7ef846b3)
2022-07-27 15:57:56 -07:00
Mike Blumenkrantz
0a4b59e1d2 zink: use right glsl length getter for ntv partial stores
why does glsl_get_length exist if it returns 0 for the most common cases?

Fixes: 31ba19ff68 ("zink: fix ntv partial stores")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17404>
(cherry picked from commit c189b7f585)
2022-07-27 15:08:08 -07:00
Bas Nieuwenhuizen
1aa9acc68b radv: Skip setting empty index buffers to avoid hang
In the direct path we already skipped draws, but in DGC I noticed
that just emitting these packets can cause issues ...

Cc: mesa-stable
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17269>
(cherry picked from commit 82c2e99102)
2022-07-27 15:08:07 -07:00
Mike Blumenkrantz
df24a47e1a zink: always use 32bit sample ops
while some (tg4) sample ops can use different bit sizes in spirv, most
cannot, and all the shader variables are always emitted as 32bit, so
ensure the 32bit type is always what's being used for sampling

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17427>
(cherry picked from commit 49d5fa12f2)
2022-07-27 15:08:07 -07:00
Mike Blumenkrantz
0f7b5c52de zink: allow multiple tex components for depth tg4
this returns a vec4, so don't break the return type by clamping 1 component

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17427>
(cherry picked from commit 35a4b8989f)
2022-07-27 15:08:06 -07:00
Lionel Landwerlin
595de71655 anv: ensure tile flush before streamout writes
Streamout is not L3 coherent so previous writes to the same address
might be pending and overwrite the SO writes later when they get
flushed from L3, even though the SO write happened later in the batch.

v2: Use the right flag (not COUNTER)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6680
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17503>
(cherry picked from commit 2cac3b3817)

 Conflicts:
	src/gallium/drivers/zink/ci/zink-anv-tgl-fails.txt

deleted ci file not present in 22.1
2022-07-27 15:07:26 -07:00
Lionel Landwerlin
79ddf69224 spirv: switch to uint64 for rayquery internal type
Fixes dEQP-VK.ray_query.advanced.using_wrapper_function.comp.*

An empty struct is causing problems because when passing it as
argument the spirv parser will just drop the argument, considering it
does not hold any data.

v2: update radv CI

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 4c703686db ("spirv: handle ray query intrinsics")
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17420>
(cherry picked from commit a41e8dc588)

Conflicts:
	src/amd/ci/radv-navi21-aco-fails.txt
	src/amd/ci/radv-navi22-aco-fails.txt
	src/amd/ci/radv-vangogh-aco-fails.txt

navi tests are removed as they don't exist in 22.1
2022-07-27 15:06:14 -07:00
Dylan Baker
47315c07b9 .pick_status.json: Update to 9b844d7c42 2022-07-27 13:18:31 -07:00
Lionel Landwerlin
94924e98da anv: deal with isl format swizzles for buffer views
For some formats like VK_FORMAT_B5G6R5_UNORM_PACK16, we have no direct
matching HW format. We can support it by swizzling.

We already apply those swizzles for image views. We just forgot to
deal with buffer views.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6235
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17385>
(cherry picked from commit 57a8efa222)

Conflicts:
	src/intel/vulkan/anv_image.c

stable:
    - replace vk_buffer_range with anv_get_buffer_range, as the shared
      vulkan buffer work isn't in 22.1
2022-07-27 11:02:10 -07:00
Lionel Landwerlin
a84f27ea3e anv: track if images can be fast clear with non-zero color
Because clear colors are stored as 4 32bit component values, there is
an issue if you try to format instance :

   - clearing in R16G16_UNORM
   - draw in R32_UINT

Clear will use 2 components of the clear color in dword0 & dword1.

While draw will use only one component of dword0.

This change uses the mutable format information to track whether clear
colors can be non-zero for fast clears.

With :

   - non mutable formats, we can fast clear with any color on Gfx > 8
   - mutable formats with incompatible component sizes, we can only
     fast clear with 0 color

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5930
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17329>
(cherry picked from commit 682383e5b3)

Conflicts:
	src/intel/vulkan/anv_image.c
2022-07-27 10:15:13 -07:00
Brian Paul
8c18efea50 llvmpipe: don't allow texture/resource swizzles on linear path
This fixes another VMware test (dx9-stretch-formats-copy-a8r8g8b8-x8r8g8b8).

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
(cherry picked from commit dfb2ea3531)
2022-07-26 15:40:48 -07:00
Brian Paul
fb59b58ee0 lavapipe: fix logicop, independent blend enable/disable
The logicop_enable and independent_blend_enable vars need to always
be assigned, otherwise, once turned on, they could never be disabled.

This fixes a number of failures in VMware's test suite.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
(cherry picked from commit 2b14a7658a)
2022-07-26 15:40:47 -07:00
Brian Paul
afd5c7e27c gallivm: increase LP_MAX_TGSI_SHADER_IMAGES from 16 to 32
This allows a VMware test to pass.  The comments in lp_bld_limits.h
mention SM 3.0 requirements, but we're in the SM 5.0 era...

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
(cherry picked from commit 98593360c4)
2022-07-26 15:40:46 -07:00
Brian Paul
efd1e177d9 llvmpipe: add missing tex_info->texture_unit assignment
The texture_unit field needs to be set like the sampler_unit field.

Also, add a swizzle initialization and some comments.

Signed-off-by: Brian Paul <brianp@vmare.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
(cherry picked from commit 3743f74d30)
2022-07-26 15:40:42 -07:00
Brian Paul
3d7fe94c6a util/bitset: add BITSET_SIZE()
To get the size (in bits) of a bitset.
And minor clean-up in __bitset_ffs().

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
(cherry picked from commit 8bd6feaca5)
2022-07-26 14:55:17 -07:00
Jesse Natalie
9f601b6a54 u_atomic: Fix MSVC p_atomic_add_return
InterlockedExchangeAdd returns the *old* value, not the new one

Cc: mesa-stable
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17529>
(cherry picked from commit 81bbfab5df)
2022-07-26 14:55:13 -07:00
Mike Blumenkrantz
cbe9489987 lavapipe: support inlined shader spirv for compute
no testing, full send

Fixes: d4d5a7abba ("lavapipe: implement EXT_graphics_pipeline_library")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17365>
(cherry picked from commit 05552b4688)
2022-07-26 14:55:11 -07:00
Alyssa Rosenzweig
5f78f52a4a panfrost: Add decoupled early-ZS helpers
Bifrost (and Valhall) separate early-ZS configuration into two fields: when does
the depth/stencil buffer update happen? and when are pixels killed by the
depth/stencil tests? The driver separately configures these to occur early
(before the shader executes) or late (after the ATEST instruction executes at
the end of the shader). Early tests are generally more efficient, but various
combinations of API state and fragment shader properties can require late
updates and/or late kills for correctness. Determining how to configure these
fields is nontrivial.

Our current implementation (on Bifrost) configures these fields at fragment
shader compile time and bakes the settings into the RSD. This is both wrong
(using early testing when late testing is required) and suboptimal (using late
testing when early testing would suffice). We need to defer this configuration
until draw time, when we know rasterizer and Z/S state.

Reclassifying at draw time (as we currently do on Valhall) would be expensive,
especially with the extra terms added in here. To cope, decouple the shader
classification from the draw-time configuration. Since there are only a few bits
of draw state involved, this implementation just calculates all possible states.
Then the draw time classification is just indexing into a lookup table.

The actual algorithm used to classify is written with correctness and clarity in
mind. Unlike the current classification algorithm (which tries to match what the
DDK does, poorly), this algorithm embeds its proofs of correctness.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17428>
(cherry picked from commit e96292bc07)
2022-07-26 14:55:05 -07:00
Alyssa Rosenzweig
7ead256891 pan/bi: Require ATEST coverage mask input in R60
In theory, ATEST can take any combination of registers for inputs.
Experimentally, however, ATEST requires the coverage mask in R60. This avoids
regressing the following dEQP tests, which write their coverage mask with
pixel-frequency-shading but without writing to the depth/stencil buffer.

dEQP-GLES31.functional.shaders.sample_variables.sample_mask.discard_half_per_pixel.*

This issue is known to affect both Mali-G52 (v7) and Mali-G57 (v9). I am unsure
if this is a silicon bug or just an obscure implementation detail.

No shader-db changes.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17428>
(cherry picked from commit db2bdc1dc3)
2022-07-26 14:55:02 -07:00
newbluemoon
2e7de0bfaa nine: replace ulimit with sysconf call
__UL_GETOPENMAX seems to be glibc specific and not portable.
In glibc’s sysdeps/posix/ulimit.c it is assigned the return
value of sysconf(_SC_OPEN_MAX). So use the latter in the first place.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5176
CC: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17471>
(cherry picked from commit 6a4fc6f6ca)
2022-07-26 14:54:57 -07:00
Chuansheng Liu
4d8ef8b21b iris,anv: correct the max thread number for DG2+
Correct the max thread number for DG2+ platforms according
to below bspec.

Ref: Bspec: 47202

Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chuansheng Liu <chuansheng.liu@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17506>
(cherry picked from commit 39f8c61f32)
2022-07-26 14:54:56 -07:00
Lionel Landwerlin
a15b4f3bda intel: protect against empty invalidate ranges
It's legal for an application to call vkInvalidateMappedMemoryRanges()
/ vkFlushMappedMemoryRanges() with zero sized ranges.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: b91971c240 ("anv: use the right helper to invalidate memory")
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6852
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17481>
(cherry picked from commit 1aeb11cde1)
2022-07-26 14:54:55 -07:00
Dylan Baker
f0c5c8fc6e .pick_status.json: Update to 4cfa777e39 2022-07-26 14:54:38 -07:00
Dylan Baker
b6b790720c VERSION: update to 22.1.4 2022-07-15 10:42:47 -07:00
Dylan Baker
1e5311ab1d docs: add release notes for 22.1.4 2022-07-15 10:42:47 -07:00
Jason Ekstrand
cc8a8ebfe9 anv: Stop compacting surface state tables
Instead of trying to compact the surface state table to get rid of any
unused render targets, emit MAX(1, colorAttachmentCount) surface states
always.  This ensures that secondaries will always match with primaries
when we go to do the copy since there's no rule requiring the secondary
to have VK_FORMAT_UNDEFINED when the primary has a NULL image view.

Fixes: 3501a3f9ed ("anv: Convert to 100% dynamic rendering")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17013>
2022-07-14 10:09:50 -05:00
Jason Ekstrand
2dfe188468 anv: Inheritance info cannot be NULL
The NULL path is dead because it can't actually be NULL.  This cleans
things up a bit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17013>
2022-07-14 10:09:50 -05:00
Emma Anholt
6ddbd56174 zink: Do the timestamp-to-ns math in a double to have better precision.
Fixes arb_timer_query-timestamp-get on my radv system, where the GPU has
been on for many days and the timestamp would only increment every once in
a while.

Part of fixing #6808

Fixes: 7a40b734ee ("zink: handle timestamp queries")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17477>
(cherry picked from commit 0feedec9e6)
2022-07-12 10:16:37 -07:00
Mike Blumenkrantz
cf26e274c7 lavapipe: don't crash on null xfb buffer pointer
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17469>
(cherry picked from commit fb917a606c)
2022-07-12 10:16:36 -07:00
Mike Blumenkrantz
3f76b2a272 lavapipe: don't overwrite entire VkFormatProperties3 struct
this clobbers pNext and breaks tooling, as found by Panagiotis Apostolou

Fixes: f72d5a930b ("lavapipe: KHR_format_feature_flags2")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17462>
(cherry picked from commit 276557b9c6)
2022-07-12 10:16:35 -07:00
Lionel Landwerlin
56b7c79ccf isl: add new helper for format component compatibility
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17329>
(cherry picked from commit ab4beaf3fb)
2022-07-12 10:16:32 -07:00
Daniel Schürmann
9276b2f2f3 aco: fix packed 16bit fneg/fsat optimization
Make sure that the Operand is '1.0.xx'.

Fixes: b03be30e07 ('aco: optimize packed fneg')
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17395>
(cherry picked from commit 66d46a23fb)
2022-07-12 10:16:31 -07:00
Daniel Schürmann
8a44563486 radv/shader_info: fix load_frag_coord and load_sample_pos read masks
Fixes: a8c471f962 ('radv: gather more information about PS in the shader info pass')
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17417>
(cherry picked from commit 676700d660)
2022-07-12 10:16:31 -07:00
Pavel Ondračka
a18fe93570 r300: Keep rc_rename_regs() from overflowing RC_REGISTER_MAX_INDEX
This pass tries to move register usage closer to SSA, and for large
shaders this means we can overflow the register index, which only has
RC_REGISTER_INDEX_BITS size. This creates invalid code and leads to
crash at a later stage. Limit the pool of available registers to
RC_REGISTER_MAX_INDEX, currently is was two times the number of
shader instructions.

This means we'll fail the compile right away if we wanted more than
RC_REGISTER_MAX_INDEX temps, but when we've got that many we're
already well past how many instructions we can support anyway.

CC: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6017
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/17393>
(cherry picked from commit 42a3d22f16)
2022-07-12 10:16:30 -07:00
Mike Blumenkrantz
1678100c3c mesa: fix SignalSemaphoreEXT behavior
the EXT_external_object spec originally was underspecified with regards
to this function, leaving room for synchronization errors where:
* app calls SignalSemaphoreEXT to signal a semaphore
* mesa defers pipe_context::fence_server_signal with threaded context
* driver defers gpu submission
* SignalSemaphoreEXT has long since returned, app submits vk cmdbuf waiting on semaphore
* spec violation / device lost

to prevent this, the spec is being changed to:
1) require an implicit flush when calling SignalSemaphoreEXT
2) require that this implicit flush also forces GPU submission before SignalSemaphoreEXT returns

all affected drivers have been updated

fixes #6568

cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17376>
(cherry picked from commit 21b3a23404)
2022-07-12 10:16:29 -07:00
Marek Olšák
4514fdff78 radeonsi: fix random PS wave size
Fixes: b3b2f97f2e "radeonsi: add Wave32 heuristics and shader profiles"

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17410>
(cherry picked from commit 3b36700162)
2022-07-12 10:16:28 -07:00
Lionel Landwerlin
6da016cded nir/serialize: restore ray query variables
The ray query status of a variable is tracked in the
nir_variable::data. We need to store it in the serialization otherwise
restoring NIR from a cache will drop the annotation.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 5a9cdab170 ("nir: track variables representing ray queries")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16059>
(cherry picked from commit a4c5521ea9)
2022-07-12 10:16:28 -07:00
Tatsuyuki Ishi
95d522f475 radv: Fix vkCmdCopyQueryResults -> vkCmdResetPool hazard.
The Vulkan specification states:

> Query commands, for the same query and submitted to the same queue,
> execute in their entirety in submission order, relative to each other. In
> effect there is an implicit execution dependency from each such query
> command to all query commands previously submitted to the same queue.

Fixes dEQP-VK.query_pool.statistics_query.reset_after_copy.*

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17400>
(cherry picked from commit 768cd5715d)
2022-07-12 10:16:25 -07:00
Alyssa Rosenzweig
09588251ff panfrost: Clear with a quad to avoid flushing
Flushing the batch midframe (splitting a renderpass) is expensive on a tiler, as
it requires the GPU to flush the framebuffer contents to main memory and read
them back. Clearing the framebuffer should not trigger a flush. Apps expect
clears to be (almost) free, flushing for a clear is at the very least unexpected
behaviour.

The only reason we previously flushed is to ensure we could always use a "fast"
clear. But a slow clear is a heck of a lot faster than a flush ;-) Instead of
flushing, we should clear with a draw (via u_blitter) in case a fast clear isn't
possible.

This fixes pathological performance for applications that rely on partial clears
within a frame. This issue was identified with Inochi2D, which repeatedly clears
the stencil buffer midframe, in order to implement masking efficiently with the
stencil buffer. In total, the all-important workload of rendering Asahi Lina is
improved from 17fps to 29fps on a panfrost device.

Fixes: c138ca80d2 ("panfrost: Make sure a clear does not re-use a pre-existing batch")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17112>
(cherry picked from commit 638b22354e)
2022-07-12 10:16:23 -07:00
Lionel Landwerlin
0869e0aac5 intel/fs: ray query fix for global address
With stages dispatching with a mask, we can run into situations where
we don't have the global address in all lanes. The existing code
always assumed we had the addres in at least lane0.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: bb40e999d1 ("intel/nir: use a single intel intrinsic to deal with ray traversal")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17330>
(cherry picked from commit 9680e0e4a2)
2022-07-12 10:16:22 -07:00
Jason Ekstrand
fcb327dd37 vulkan/wsi/x11: Don't leak shm_reply if we don't have dri3 or present
Fixes: b5c390c113 ("vulkan/wsi: add support for detecting mit-shm pixmaps.")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17388>
(cherry picked from commit 5abc05f1df)
2022-07-12 10:16:19 -07:00
Jason Ekstrand
2b157e92d7 vulkan/wsi: Pass the size to MapMemory in the SW path
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17388>
(cherry picked from commit ca6bd57e76)
2022-07-12 10:16:18 -07:00
Iago Toral Quiroga
eb1fb9305d nir: fix documentation for uadd_carry and usub_borry opcodes
These opcodes where fixed to return an integer instead of a boolean
value some time ago but the documentation for them was not updated
and still talked about a boolean result.

Fixes: b0d4ee520 ('nir/opcodes: Fix up uadd_carry and usub_borrow')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17372>
(cherry picked from commit 84a0dca9df)
2022-07-12 10:16:17 -07:00
Dylan Baker
0fec632102 .pick_status.json: Update to 0feedec9e6 2022-07-12 10:15:57 -07:00
Lionel Landwerlin
562c1d93b3 anv: use the right helper to invalidate memory
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17001>
(cherry picked from commit b91971c240)
2022-07-06 10:01:19 -07:00
Alyssa Rosenzweig
122e31b5ea ttn: Set nir->info.separate_shader
TGSI has no legitimate[1] notion of linked shaders, which means tgsi_to_nir
should conservatively assume everything all shaders are separable. This requires
setting nir->info.separate_shader to warn drivers that shader CSOs might be
mixed and matched. Otherwise, the driver might enable optimizations that
are invalid for separate shaders, causing issues when the shaders are
later treated as separable.

This will fix varying linking with u_blitter's shaders on Panfrost (Bifrost and
older), when util_blitter_clear is used with Panfrost.

[1] There was a TGSI property added recently to forward
nir->info.separate_shader up to virglrenderer, but it's not actually used for
anything in virglrenderer and I am still struggling to understand what the use
case would be. My gut says we should revert b634030542 ("tgsi: Add
SEPARABLE_PROGRAM property"), but I'm not interested in fighting that yak right
now. Notably, the u_blitter and hud shaders are separable but are not marked
with this property.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17282>
(cherry picked from commit 151aa19c21)
2022-07-06 10:01:19 -07:00
Daniel Schürmann
af9b753318 nir/opt_shrink_vectors: fix re-using of components for vecN
Cc: mesa-stable
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17276>
(cherry picked from commit 862f1eacb2)
2022-07-06 10:00:57 -07:00
Iago Toral Quiroga
e1cf74f53b v3dv: fix pool descriptor count for inline uniform buffers
Fixes VK_ERROR_OUT_OF_POOL_MEMORY in the inlineuniformblocks
sample from Sascha Willems.

Fixes: ea3223e7a4 ('v3dv: implement VK_EXT_inline_uniform_block')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17311>
(cherry picked from commit 7b91b39ba5)
2022-07-06 10:00:56 -07:00
Mike Blumenkrantz
040658cd26 zink: enforce viewport depth clamping
VUID-VkViewport-minDepth-01234 specifies that depth must be in the range [0.0, 1.0],
so the viewport must always be clamped to this range

this affects texture clears using u_blitter, as this expects to be able
to use the GL range of [-1.0, 1.0], so pass the depth value as though it's
been de-converted back to a GL z coordinate to account for viewport transform

cc: mesa-stable

fixes #6757

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17319>
(cherry picked from commit 90c5eea22b)
2022-07-06 10:00:55 -07:00
Rhys Perry
a9b3df51e0 aco/ra: update register file when updating phi definition
update_renames() fills in the wrong temp id.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 302cb5c900 ("aco/ra: remove some redundant code")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17295>
(cherry picked from commit 84f04fd080)
2022-07-06 10:00:53 -07:00
Dylan Baker
a80fe86c5c .pick_status.json: Update to 9dbfc21ab9 2022-07-06 10:00:44 -07:00
Mike Blumenkrantz
a066287f1b nir/types: fix glsl_matrix_type_is_row_major() assert
interface blocks can have row_major set

cc: mesa-stable

affects (zink):
dEQP-GLES2.functional.shaders*

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17238>
(cherry picked from commit 0e7863c3b0)
2022-06-30 08:58:47 -07:00
Dylan Baker
7d4d33e858 .pick_status.json: Update to 8ab1e9826d 2022-06-30 08:58:34 -07:00
Dylan Baker
4f6fdddf38 .pick_status.json: Mark 4480e577a4 as denominated 2022-06-29 15:36:48 -07:00
Lionel Landwerlin
2a453ba93f anv: disable non uniform indexing of UBOs
The feature we wanted to enable in 710393b3aa was
descriptorBindingUniformBufferUpdateAfterBind.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 710393b3aa ("anv: enable UBO indexing")
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17200>
(cherry picked from commit 3e247cd05f)
2022-06-29 15:34:16 -07:00
Dylan Baker
05d8bc7f81 .pick_status.json: Update to c017dfec62 2022-06-29 15:34:11 -07:00
Dylan Baker
ceb5c0f559 docs: add sah256sum for mesa 22.1.3 2022-06-29 11:14:07 -07:00
Dylan Baker
f0cda4094d VERSION: bump to 21.1.3 2022-06-29 09:40:05 -07:00
Dylan Baker
d1f0630a16 docs: add release notes for 22.1.3 2022-06-29 09:38:49 -07:00
Boris Brezillon
7aabd41655 nir/serialize: Support texop >= 16
Extend the packed_instr struct to support texops above
nir_texop_fragment_fetch_amd.

Fixes: 603e6ba972 ("nir: add two new texture ops for multisample fragment color/mask fetches")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17186>
(cherry picked from commit 370ca07482)
2022-06-28 15:53:29 -07:00
Iago Toral Quiroga
d11aac3443 broadcom/compiler: don't predicate postponed spills
The postponed spill is predicated using the condition from the
last write, but this is only correct if the register was only
written once in the TMU sequence, or if it is always written with
the same predication.

While we could try to track whether this is the case or not, it
would make the postponed spill path even more complex than it
already is, so let's just avoid predicating these. We are already
discouraging TMU spilling of registers in the middle of TMU
sequences, so this should not be a very common case.

Cc: mesa-stable
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17201>
(cherry picked from commit cfccd93efc)
2022-06-28 15:53:28 -07:00
Iago Toral Quiroga
63ac4309e1 broadcom/compiler: fix postponed TMU spills with multiple writes
If we are spilling a register that is used in the middle of a TMU
sequence, we postpone the spill until the TMU sequence finishes,
at which point we inject the spill and rewrite the original
instruction to write to the new temp.

However, this doesn't work if the register is written multiple
times during the TMU sequence. In that scenario, we need to ensure
that all writes are rewritten to use the new temp, not just the last
one.

Cc: mesa-stable
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17201>
(cherry picked from commit 98420408d0)
2022-06-28 15:53:28 -07:00
Iago Toral Quiroga
c2cbbefe49 v3dv: fix leak
Cc: mesa-stable
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17201>
(cherry picked from commit 0bc65b1d81)
2022-06-28 15:53:27 -07:00
Mike Blumenkrantz
bc26f1c4ee zink: fix kopper_acquire return value
this should be a VkResult

Fixes: ab1941fc0e ("zink: handle zombie swapchains")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17149>
(cherry picked from commit c1ce1889db)
2022-06-28 15:53:27 -07:00
Alyssa Rosenzweig
93561a98b1 lima,panfrost: Do not ralloc contexts against the screen
ralloc is not thread-safe. While a given context can only be accessed from a
single thread at once, multiple contexts can be created against the same screen
at once. The ralloc allocations against the shared screens will race. Depending
on the result of the race, the same block of memory can be returned as the two
new contexts in two different threads, causing a use-after-free when the context
is freed later.

We free the context explicitly when it's destroyed anyway. If screens are
getting destroyed without the contexts getting destroyed first, that's a state
tracker bug, not a Panfrost one.

This matches what Iris does.

Fixes crash in test_integer_ops.int_math on Panfrost.

Fixes: 0fcf73bc2d ("panfrost: Move to use ralloc for some allocations")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17234>
(cherry picked from commit f18492faa9)
2022-06-28 15:53:26 -07:00
Dylan Baker
1aebab2a16 .pick_status.json: Update to 58313f3257 2022-06-28 15:53:16 -07:00
Dylan Baker
75d3e33f3b lima/ci: mark some tests as pass
I don't know why they're suddenly passing, but not gonna complain
2022-06-28 15:52:11 -07:00
Marcin Ślusarz
a21cba54ca intel/compiler: adjust task payload offsets as late as possible
Otherwise passes which expect offsets to be in bytes (like
brw_nir_lower_mem_access_bit_sizes, called from brw_postprocess_nir)
may produce incorrect results.

Fixes 64-bit load/stores in task/mesh shaders.

Fixes: c36ae42e4c ("intel/compiler: Use nir_var_mem_task_payload")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16196>
(cherry picked from commit 42b551fe7f)
2022-06-27 09:18:27 -07:00
Marcin Ślusarz
02923d7685 intel/common: allocate space for at least one task urb
Fixes: c93cbc77f7 ("intel/common: Add helper for URB allocation in Mesh pipeline")
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16196>
(cherry picked from commit 3dc6a98d78)
2022-06-27 09:18:26 -07:00
Sviatoslav Peleshko
c7dce6945d intel/blorp: Dirty depth bounds dynamic state bits after blorp
Blorp emits its own 3DSTATE_DEPTH_BOUNDS, so we'll have to re-emit the
expected state after that.

Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Fixes: 56ef501e3a ("blorp: disable depth bounds")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17205>
(cherry picked from commit 3f6edbc725)
2022-06-27 09:18:26 -07:00
Boris Brezillon
ba1d27bdee nir/serialize: Put dest last in packed_instr::tex
packed_instr::tex::dest must be last to match the packed_instr::any::dest
position.

Fixes: 35655865cb ("nir/serialize: pack instructions better")
Cc: stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17212>
(cherry picked from commit ee536ea633)
2022-06-27 09:18:25 -07:00
Dylan Baker
a836e218bd .pick_status.json: Update to 9d7d1c0637 2022-06-27 09:18:16 -07:00
Mike Blumenkrantz
c426ecb276 zink: fix image bind counting
these must only be incremented if the image descriptor has changed

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17192>
(cherry picked from commit 74dd6e69b4)
2022-06-24 10:11:47 -07:00
Sviatoslav Peleshko
78a64e862f intel/blorp/gen6: Set BLEND_STATEChange only if emitting the blend state
This change is pretty straightforward: if set this field when we don't emit
the blend state, then the garbage at offset=0 will be set as a blend state,
and this will cause artifacts until the proper blend state will be given.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6544
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6232

Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17132>
(cherry picked from commit 318473eaf1)
2022-06-24 10:11:44 -07:00
Timothy Arceri
179ad03f5d util: use force_gl_map_buffer_synchronized workaround with RAGE
CC: 22.1 22.0 <mesa-stable>

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/1326
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17199>
(cherry picked from commit e060d98aac)
2022-06-24 10:11:40 -07:00
Timothy Arceri
d36439c235 util: add dri config option to disable GL_MAP_UNSYNCHRONIZED_BIT
GL_MAP_UNSYNCHRONIZED_BIT depends on the app having its threading
handled correctly. This allows us to force disable the bit when
they get it wrong.

CC: 22.1 22.0 <mesa-stable>

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17199>
(cherry picked from commit 5f686bfc85)
2022-06-24 10:11:40 -07:00
Mike Blumenkrantz
a15841aa8d lavapipe: skip post-copy pNext checking during pipeline creation for composites
these values should have all been set during pipeline compositing above,
so reapplying the values is at best, redundant, and at worst, broken

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17219>
(cherry picked from commit b74d3e71be)
2022-06-24 10:11:39 -07:00
Mike Blumenkrantz
ddaadc3da0 lavapipe: fix renderpass info handling during pipeline creation
only the viewMask parameter of VkPipelineRenderingCreateInfoKHR can
be accessed in the fragment stage, so for pipeline libraries it should
be assumed that zs attachments exist for the purpose of copying dynamic
state values, and then these dynamic states will naturally be pruned
during final pipeline construction if the attachments turn out to not
be present

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17219>
(cherry picked from commit 2a69aeb9c1)
2022-06-24 10:11:38 -07:00
Mike Blumenkrantz
d5bcbab926 lavapipe: copy more pNexts for pipeline creation
also add some unreachable() handlers for unknown types

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17219>
(cherry picked from commit 7018b630ed)
2022-06-24 10:11:38 -07:00
Sebastian Keller
50cd036871 egl/wayland: Don't try to access modifiers u_vector as dynarray
The modifiers are u_vectors, but the code was trying to access them
as dynarrays. This resulted in a wrong number of modifiers, which then
later on would also lead to invalid reads used as modifiers.

In the case of the iris driver, a wrongly read number of modifiers > 0
would also trigger an error message.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6643
Fixes: b5848b2dac ("egl/wayland: use surface dma-buf feedback to allocate surface buffers")
Reviewed-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17180>
(cherry picked from commit f50fe9b0b6)
2022-06-24 10:11:37 -07:00
Dylan Baker
800651daf3 .pick_status.json: Update to 9527fbe596 2022-06-24 10:11:30 -07:00
Renato Pereyra
1c5552a3a7 Revert "wsi/x11: Avoid using xcb_wait_for_special_event in FIFO modes"
This reverts commit 44a20baeb8.

Signed-off-by: Renato Pereyra <renatopereyra@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17118>
2022-06-23 17:26:52 +00:00
Renato Pereyra
566409ed12 Revert "wsi/x11: Don't leak xcb_get_geometry_reply_t."
This reverts commit 24049b8771.

Signed-off-by: Renato Pereyra <renatopereyra@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17118>
2022-06-23 17:26:52 +00:00
Dylan Baker
a0b9336cd7 .pick_status.json: Mark 420270cb4f as backported 2022-06-23 09:18:24 -07:00
Lionel Landwerlin
755fe3ee27 anv: limit RT writes to number of color outputs
Not doing so crates skews occlusion queries. Fixes Zink's piglit
occlusion_query tests.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: a4f502de32 ("anv: fix VK_DYNAMIC_STATE_COLOR_WRITE_ENABLE_EXT state")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6205
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15740>
(cherry picked from commit 5d05ffa465)
2022-06-23 09:18:24 -07:00
Ian Romanick
ac10f5a3ab nir/algebraic: Fix NaN-unsafe fcsel patterns
For example, the proof for this pattern

    (('bcsel', ('flt', 'a@32', 0), 'b@32', 'c@32'), ('fcsel_ge', a, c, b)),

would be

    bcsel(a < 0, b, c)
    bcsel(!(a < 0), c, b)
    bcsel(a >= 0, c, b)
    fcsel_ge(a, c, b)

However, !(a < 0) => (a >= 0) is well known to produce different
results if `a` is NaN.

Instead of that replacement, use this replacement:

    bcsel(a < 0, b, c)
    bcsel(-0 < -a, b, c)
    bcsel(0 < -a, b, c)
    fcsel_gt(-a, b, c)

This is NaN-safe and exact.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Fixes: 0f5b3c37c5 ("nir: Add opcodes for fused comp + csel and optimizations")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17048>
(cherry picked from commit a2a2fbc510)
2022-06-23 09:18:24 -07:00
Ian Romanick
ccad18ff9e nir: i32csel opcodes should compare with integer zero
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Noticed-by: Georg Lehmann <dadschoorse@gmail.com>
Fixes: 0f5b3c37c5 ("nir: Add opcodes for fused comp + csel and optimizations")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17048>
(cherry picked from commit ccd18ec4f3)
2022-06-23 09:18:24 -07:00
Connor Abbott
4fbc8fb28e tu: Fix linemode for tessellation with isolines
Fixes: 542211676c ("turnip: enable VK_EXT_line_rasterization")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17190>
(cherry picked from commit d455838081)

Conflicts:
	src/gallium/drivers/zink/ci/zink-tu-a630-fails.txt

CI file doesn't exist in 22.1, and has been deleted
2022-06-23 09:18:24 -07:00
Emma Anholt
e43617904a vc4: Propagate txf_ms's dest_type to the lowered txf.
This was missing, and the added validation caught it.

Fixes: 708c47e663 ("nir: Validate nir_tex_instr::dest_type bitsize")
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17172>
(cherry picked from commit 4309e09d6f)
2022-06-23 09:18:24 -07:00
Mike Blumenkrantz
3f0815a333 nir/lower_point_size: apply point size clamping
point size min/max values are provided through the state vars, so ensure
these are always applied in order to respect ARB_point_parameters

cc: mesa-stable

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17145>
(cherry picked from commit 4830cc77cb)
2022-06-23 09:18:24 -07:00
Italo Nicola
d4f41e6b8c virgl: overpropagate precise flags
As it turns out, MOVs weren't the only instructions that blocked precise
flags propagation in the transition to nir-to-tgsi.
This commit fixes some rendering regressions caused by a4a34cd3.

Fixes: a4a34cd3

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collanora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17144>
(cherry picked from commit 42a1264951)
2022-06-23 09:18:24 -07:00
Dave Airlie
5614528304 wsi/x11: add xcb_put_image support for larger transfers.
This was noticed as a problem in the EGL code, just fixup wsi.

Cc: mesa-stable
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17155>
(cherry picked from commit d3e723fb77)
2022-06-23 09:18:24 -07:00
Dave Airlie
37c256c0de egl/x11: add missing put_image cookie cleanups
These might not be required but be consistent with the wsi code.

Cc: mesa-stable
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17155>
(cherry picked from commit c5dbb1139c)
2022-06-23 09:18:24 -07:00
Dave Airlie
350afae947 egl/x11: split large put image requests to avoid server destroy
wezterm in fullscreen 4k was exceeding the xcb max request size
on the put image with llvmpipe. This fixes it to send sub-images,
the Xlib put image used in glx does this internally, but not
the xcb one, so just do it in sections here.

Cc: mesa-stable
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17155>
(cherry picked from commit e6082ac62e)
2022-06-23 09:18:24 -07:00
Mike Blumenkrantz
c49c481ca6 zink: fix dual_src_blend driconf workaround
not sure when this broke but it broke

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17156>
(cherry picked from commit e8fc5cca90)
2022-06-23 09:18:24 -07:00
Mike Blumenkrantz
58a830d9c4 glx/drisw: invalidate drawables upon binding context if flush extension exists
this forces surface resize as expected

cc: mesa-stable

fixes #6706

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17147>
(cherry picked from commit ea005c9e04)
2022-06-23 09:18:24 -07:00
Mike Blumenkrantz
9b1b760ffa glx/drisw: store the flush extension to the screen
cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17147>
(cherry picked from commit 23b63e536e)
2022-06-23 09:18:24 -07:00
Alyssa Rosenzweig
b5d711a9b2 pan/bi: Fix LD_BUFFER.i16 definition
This was missing the message, breaking UBO-to-push and who-knows-what-else, when
enabling fp16 const buffers.

Fixes: 3dc2095b07 ("pan/bi: Model LD_BUFFER instructions")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17101>
(cherry picked from commit 5ee1179c94)
2022-06-23 09:18:24 -07:00
Lionel Landwerlin
940cb75c93 vulkan/wsi: fix crash with debug names on swapchain
If you set a name of on a swapchain object, because the base object
struct has not been initialized with a VkDevice,
vk_object_base_finish() will segfault when trying to free the object
name.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: cb1e0db23e ("vulkan/wsi: Make wsi_swapchain inherit from vk_object_base")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17165>
(cherry picked from commit efc398c722)
2022-06-23 09:18:24 -07:00
Timur Kristóf
839cd82865 gallium/u_blitter: Fix depth.
Fix the transform to make sure it doesn't disturb the depth range
of the blitted image. Set the Z coordinates of the vertices
by hand instead of relying on the transform to do it.

This is a pre-requisite to Zink always enabling depth clamping.

Fixes: 26c6640835
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16929>
(cherry picked from commit 810135fb42)

Conflicts:
	src/gallium/drivers/lima/ci/lima-fails.txt
2022-06-23 09:18:24 -07:00
Erik Faye-Lund
86811cc178 docs: set language to english
It seems recent versions of Sphinx has started issuing a warning when
language isn't set to a recognized value. Since we're building with
warnings as errors on CI, this causes issues for people.

We're writing English docs, so we should set this to English. I probably
confused this setting with the highlight_language setting or something
when I set this up initially.

Fixes: 00cd1346bf ("docs: use sphinx")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6711
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17159>
(cherry picked from commit ee9c3d2625)
2022-06-23 09:18:23 -07:00
Filip Gawin
d3050e790f r300: prefer old not native swizzle in constant folding
r300 and r400 have strict rules with swizzles, so we
will need to convert swizzle back.

Operating on 0, 1, H in this case unnecessarily makes
rest of r300 overly complicated.
(also it's not currently able to handle this)

helps with:
deqp-gles2@functional@shaders@random@exponential@fragment@24

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17117>
(cherry picked from commit 6cbb19110b)
2022-06-23 09:18:23 -07:00
Samuel Pitoiset
683d224329 aco: fix validation of SOP1 instructions without definitions
Like s_setpc_b64.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17082>
(cherry picked from commit 5485bf7b1b)
2022-06-23 09:18:23 -07:00
Jason Ekstrand
404838a333 anv: Properly clamp attachment layer counts
Vulkan requires that the acutal layer count come from
VkRenderingInfo::layerCount or VkFramebufferCreateInfo::layers rather
than from the image view itself.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17060>
(cherry picked from commit 7a8ec23c9d)
2022-06-23 09:15:28 -07:00
Icecream95
cb13e00f72 panfrost: Remove sync arguments from panfrost_batch_submit
Whether a sync object is used cannot depend on where the batch is
submitted from, remove the in_sync and out_sync fields from
panfrost_batch_submit.

Always use an output syncobj, this is required for glFinish to work
correctly. This could be skipped for batches which another batch
depends on, but because of the existence of empty batches which emit
no job, doing so is not trivial.

Never use an input syncobj. There appears to be no point to this, the
kernel driver does implicit sync anyway.

Fixes "seconds per frame" rendering with Neverball; previously, every
batch was submitted with out_sync=0, so DRI's frame throttling could
do nothing. New jobs would keep getting submitted until more than a
thousand were queued in the kernel, which increased rendering latency
for the compositor far beyond acceptable levels.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16966>
(cherry picked from commit d8803c724b)
2022-06-23 09:15:28 -07:00
Ian Romanick
0acb0f4a63 intel/fs: Add missing synchronization for WaW dependency
v2: Do the synchronization in the correct place.  Noticed by Curro.

Fixes: b5fa43952a ("intel/fs: Better handle constant sources of FS_OPCODE_PACK_HALF_2x16_SPLIT")
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Tested-by: Felix DeGrood <felix.j.degrood@intel.com> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17037>
(cherry picked from commit 676acfe956)
2022-06-23 09:15:28 -07:00
Dylan Baker
ff1ffa4f03 .pick_status.json: Update to 8ce7faab47 2022-06-23 09:15:25 -07:00
Mike Blumenkrantz
77e02243c7 zink: cap driver inlining using ssa allocation limit
usually inlining is optimal for cpu drivers since the majority of
time is spent in the shaders, and any amount of reduction to shader code
will be optimal

if, however, the shaders are still really big after inlining, this improvement
will be negated by the insane amount of time spent doing stupid llvm optimizer
passes, so check post-inline size to see whether it exceeds a size threshold

lavapipe release build - 1700% improvement
* spec@arb_tessellation_shader@execution@variable-indexing@tcs-output-array-vec4-index-rd-after-barrier

before: 142.15s user 0.42s system 99% cpu 2:23.14 total

after: 8.60s user 0.07s system 99% cpu 8.677 total

fixes #6647

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16977>
2022-06-19 21:13:58 -04:00
Mike Blumenkrantz
6e8bbed87a zink: relax zink_resource_buffer_needs_barrier checks
this now matches zink_resource_image_needs_barrier

cc: mesa-stable

Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-By: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17111>
2022-06-19 21:13:06 -04:00
Mike Blumenkrantz
7ef27bec10 zink: don't short-circuit gfx stage finding during barrier generation
according to spec, all stages must be specified, not just the first one

Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-By: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17111>
2022-06-19 21:13:06 -04:00
Mike Blumenkrantz
33b01ebfab zink: collect gfx stages for all bindings during barrier generation
it's important to get the full mask in order to accurately provide
dependency info

Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-By: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17111>
2022-06-19 21:13:06 -04:00
Mike Blumenkrantz
f851c180df zink: add a #define for vk shader bits
Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-By: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17111>
2022-06-19 21:13:06 -04:00
Mike Blumenkrantz
566aaed094 zink: track image binds
track all the things

Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-By: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17111>
2022-06-19 21:13:05 -04:00
Mike Blumenkrantz
f5e59958a9 zink: rework buffer barrier generation
by passing through the draw buffers, more accurate barriers can be generated
to ensure synchronization for both the draw buffer scopes and
descriptor binding scopes

ref #6597

Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-By: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17111>
2022-06-19 21:13:05 -04:00
Mike Blumenkrantz
538e62d674 zink: track vertex buffer bind counts on resources
Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-By: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17111>
2022-06-19 21:13:05 -04:00
Mike Blumenkrantz
5267efa259 zink: move draw-time barrier generation down a little
ensure that this occurs after potential rebind handling

Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-By: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17111>
2022-06-19 21:13:05 -04:00
Mike Blumenkrantz
dfea92f429 zink: clamp renderpass layers better
this needs to be the minimum layer, not the maximum

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17061>
(cherry picked from commit bd859e1f96)
2022-06-17 13:33:26 -07:00
Mike Blumenkrantz
0c283ca156 zink: add a function for getting the minimum framebuffer layers
this clamps the layer count to the smallest number of layers rather
than the largest

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17061>
(cherry picked from commit f74df6205d)

Conflicts:
	src/gallium/drivers/zink/zink_framebuffer.h
2022-06-17 13:33:25 -07:00
Mike Blumenkrantz
494b4d0c41 zink: be a little selective about BAR fallback memory type
some resources MUST be host-visible, so use the appropriate heap for them

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17093>
(cherry picked from commit be4f120476)
2022-06-17 09:03:19 -07:00
Mike Blumenkrantz
4dbda2ee30 zink: move BAR allocation demotion up the stack
having this so far down in the BO allocation path meant that slabs were
getting demoted to device-local and then stored as BAR in the pb cache,
which broke the cache pretty badly

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17093>
(cherry picked from commit 5750050432)
2022-06-17 09:03:19 -07:00
Mike Blumenkrantz
e94120e794 zink: store and reuse memory heap flags for buffer placement
the flags in vk_domain_from_heap() are the MINIMUM required flags for
the heap, but there may be other flags present, so ensure those are picked
up as expected

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17093>
(cherry picked from commit d63e04e583)
2022-06-17 09:03:18 -07:00
Mike Blumenkrantz
d7b5c1f998 zink: fix buffer transfer flushes with offsets
the src and dst ofsets need to be adjusted by the base map offset
in order to flush the correct region

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17095>
(cherry picked from commit ce5aa07db1)
2022-06-17 09:03:17 -07:00
Mike Blumenkrantz
c549cb7aa1 zink: use only the extents for buffer unmap flushes
flush_region is relative to the map, so passing in the offsets again
breaks the flush (if the flush hook is implemented correctly)

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17095>
(cherry picked from commit 28d23c9e26)
2022-06-17 09:03:17 -07:00
Mike Blumenkrantz
c92f4bfffd zink: unify actual map calls in buffer mapping
make this a bit easier to debug by moving the calls to one place

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17095>
(cherry picked from commit 2645430b06)
2022-06-17 09:03:16 -07:00
Mike Blumenkrantz
689cad731d zink: rename a variable
make this a little clearer to read

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17095>
(cherry picked from commit dd5d215c62)
2022-06-17 09:03:16 -07:00
Dave Airlie
c6a569f242 llvmpipe: disable alpha test branch if multisample is enabled.
If multisample is enabled and alpha testing happens, the
branch can jump out of the fragment shader before the other
samples are generated. Just don't take the branch optimisation
post alpha test if multisample is enabled.

This should fix some rendering bugs in kicad with multisample
enabled.

Cc: mesa-stable
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17049>
(cherry picked from commit 6e5d126a65)
2022-06-17 09:03:15 -07:00
Yiwei Zhang
0e3d908eb2 venus: fix the queue init failure path
The prior behavior can ignore certain failure result, and might also
clean up queues that are never initialized.

Fixes: ddd7533055 ("venus: initial support for queue/fence/semaphore")

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16731>
(cherry picked from commit cb8dfa4966)
2022-06-17 09:03:14 -07:00
Yiwei Zhang
e4c8e591cc venus: fix a bug on buffer cache init failure path
The failure path was never hit though, and will not either.

Fixes: 65abd1d4ae ("venus: implement vn_buffer_cache_entries_create")

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16731>
(cherry picked from commit 01a0bfc3f9)
2022-06-17 09:03:14 -07:00
Iván Briano
2fcda40ea4 anv: do not get rid of empty/useless fragment shaders
This was an optimization done a while ago that doesn't seem to be having
much of an impact anymore, and on the other hand, causes all sorts of
breakage with queries, as many of our HW counters don't get incremented
when rasterization is disabled.

This fixes a bunch of issues Zink has with ANV, but more importantly, it
fixes upcoming CTS tests:
dEQP-VK.transform_feedback.primitives_generated_query.*.empty_frag.*
dEQP-VK.transform_feedback.primitives_generated_query.*.no_attachment.*
dEQP-VK.transform_feedback.primitives_generated_query.*.color_write_disable_*

Cc: mesa-stable

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17038>
(cherry picked from commit 4666ef720e)

Conflicts:
	src/gallium/drivers/zink/ci/zink-anv-tgl-fails.txt

CI file was deleted as it doesn't exist on 22.1
2022-06-17 09:03:13 -07:00
Dylan Baker
da478e6afa .pick_status.json: Update to 2866ae32da 2022-06-17 09:02:37 -07:00
Connor Abbott
5df89bf7bc tu: Save/restore *_BIN_CONTROL in 3d GMEM store path
These are normally only set once because it's constant across the entire
renderpass, but they're trashed by the 3d store path because it needs to
store to CCU instead of GMEM. Therefore we need to save/restore them. Do
it in a way compatible with #5181.

Fixes: b157a5d ("tu: Implement non-aligned multisample GMEM STORE_OP_STORE")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17058>
(cherry picked from commit cba6da2b21)
2022-06-16 16:03:19 -07:00
Connor Abbott
74f9873950 tu: Add missing WFI to the 3d GMEM store path
Similar to the 2d path.

Fixes: b157a5d ("tu: Implement non-aligned multisample GMEM STORE_OP_STORE")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17058>
(cherry picked from commit a9d7b47613)
2022-06-16 16:03:18 -07:00
Connor Abbott
3984eb3479 tu: Fix 3d GMEM store swizzle in texture descriptor
Even though image views for attachments must use the identity swizzle,
there are cases where we have to add in our own swizzle, in particular
for D24S8 when the view is depth-only/stencil-only. Therefore we have to
reset it to the identity, similar to what we do with input attachments.

Fixes: b157a5d ("tu: Implement non-aligned multisample GMEM STORE_OP_STORE")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17058>
(cherry picked from commit 705c0d0373)

Conflicts:
	src/freedreno/ci/freedreno-a630-fails.txt
2022-06-16 16:03:17 -07:00
Boris Brezillon
aa0a47d14a d3d12: Keep access masks up-to-date when removing vars in d3d12_disable_multisampling()
Fixes: e5cf19fced ("d3d12: Modify shaders when MSAA is disabled")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17039>
(cherry picked from commit c9b2c79d16)
2022-06-16 15:18:02 -07:00
Christian Gmeiner
191034cd6a nir: Fix unused-variable compile warnings
Fixes: 8492e78f9d ("nir/deref: Handle SSBO array bindings specially")

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17021>
(cherry picked from commit 15f394cc7a)
2022-06-16 14:17:59 -07:00
Jason Ekstrand
fa4d248595 nir/deref: Handle RESTRICT for SSBO deref bindings
Tested-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16894>
(cherry picked from commit 4655ff1f5b)
2022-06-16 14:16:27 -07:00
Jason Ekstrand
c1c7c02aa4 nir/deref: Handle SSBO array bindings specially
Instead of just checking for the variables to match, check that the
entire deref up to the interface type matches.

Tested-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16894>
(cherry picked from commit 8492e78f9d)
2022-06-16 14:16:27 -07:00
Jason Ekstrand
cbcedb35a5 nir/vars_tests: Use nir_var_mem_global instead of ssbo
We're about to add a bunch of SSBO special cases which will depend on
SSBOs always being either structs or arrays of structs.  All those
little vector SSBOs we're creating will no longer be valid.  Switch to
nir_var_mem_global to avoid this.

Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16894>
(cherry picked from commit a5b1274275)
2022-06-16 14:16:26 -07:00
Jason Ekstrand
8745ab574c nir: Increase nir_variable_data::mode to 16 bits
This is required if we want to have variables with nir_var_mem_global
which we will for CL eventually.  Also, they're useful in unit tests
because they're the most generic thing imaginable and can't get
eliminated by normal means.

Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16894>
(cherry picked from commit 2d221c64e7)
2022-06-16 14:16:26 -07:00
Jason Ekstrand
981fd93224 nir/deref: Re-arrange variable checks in compare_deref_paths
Instead of having a bunch of mode checks as special cases, assert that
the modes equal and then switch on the mode.  This should make the
special cases a bit easier to understand.  Handling of `a_var == b_var`
looks redundant now but it won't be in the next patch.

Tested-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16894>
(cherry picked from commit 0ad2dfe942)
2022-06-16 14:16:25 -07:00
Jason Ekstrand
81f7c1cfd9 nir/deref: Make compare_deref_paths take a stop callback
This will let us use it to compare only the first part of a pair of
deref paths and continue the comparison later.

Tested-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16894>
(cherry picked from commit 130d9d80db)
2022-06-16 14:16:25 -07:00
Jason Ekstrand
c3e42dec17 nir/deref: Use an index in compare_deref_paths
Instead of incrementing pointers, use an integer index.  This makes it
clear that we always increment them together.  It'll also make the next
change a bit easier.  We use a pointer to an integer because the next
patch is going to let us abort the walk and we want to be able to
continue where we left off.

Tested-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16894>
(cherry picked from commit 7ebcdada00)
2022-06-16 14:16:24 -07:00
Jason Ekstrand
b07f1eb240 nir/deref: Break out a helper for compare_deref_paths
Tested-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16894>
(cherry picked from commit 4d80b3217e)
2022-06-16 14:16:24 -07:00
Rhys Perry
ee6630d206 nir/deref: stop assuming coherent accesses of different SSBOs may alias
Whether it's coherent should be irrelevant and the ACCESS_RESTRICT check
above should consider all cases aliasing unless NIR makes it clear they're
not.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Tested-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16894>
(cherry picked from commit cb5c1bcb7c)
2022-06-16 13:31:08 -07:00
Dylan Baker
1f8bcd16cc .pick_status.json: Update to 09a7304d5a 2022-06-16 13:30:36 -07:00
Dylan Baker
2a104d5794 docs: add sha256sum to 22.1.2 notes 2022-06-16 09:55:22 -07:00
Dylan Baker
a037d8e199 Bump version to 22.1.2 2022-06-16 09:17:53 -07:00
Dylan Baker
cea8116d2e docs: add release notes for 22.1.2 2022-06-16 09:17:14 -07:00
Mike Blumenkrantz
7711164baf zink: fix 32bit bo rewriting
this was correct for 64bit loads and manually converted 32bit loads (e.g., bindless),
but it was broken for the case where 64bit was not supported, as the offset wasn't
being correctly adjusted

break out the offset division to hopefully make this a little clearer

Fixes: 150d6ee97e ("zink: move all 64-32bit shader load rewriting to nir pass")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16669>
(cherry picked from commit bbe5136658)

Conflicts:
	src/gallium/drivers/zink/ci/zink-tu-a630-fails.txt

CI file removed as it doesn't exist in 22.1
2022-06-15 16:13:00 -07:00
Mike Blumenkrantz
d2dd99d5f4 zink: flag optimization pass after inlining uniforms
this probably generated some pretty gnarly code

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16669>
(cherry picked from commit 02a3a5ff31)

Conflicts:
	src/gallium/drivers/zink/zink_compiler.c
2022-06-15 16:13:00 -07:00
Pierre-Eric Pelloux-Prayer
ebda38196a radeonsi: add helper to use si_screen::aux_context
This context needs to be locked before usage, and flushed after.
If it's forgotten, radeonsi may crash (eg #6666).

To avoid this kind of error, introduce 2 helpers.

cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17032>
(cherry picked from commit bda1c081bd)
2022-06-15 16:13:00 -07:00
Boris Brezillon
9f199d0e02 microsoft/compiler: Images are no longer reprensented by uniform vars
emit_barrier_impl() was still checking the nir_var_uniform flag to
detect images, which is no longer correct.

Fixes: cfdc7ee066 ("spirv: Use nir_var_mem_image")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16926>
(cherry picked from commit 303175cfec)
2022-06-15 16:13:00 -07:00
Boris Brezillon
d5a5bcbd54 vulkan/util: Fill VkPhysicalDeviceIDProperties::deviceNodeMask
This field copy was missing in
vk_get_physical_device_core_1_1_property_ext().

Fixes: 19ff5019b7 ("vulkan: Add helpers for filling exts for core features and properties.")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16926>
(cherry picked from commit b78d3ebe72)
2022-06-15 16:13:00 -07:00
Mike Blumenkrantz
dfd2cd3ebc zink: fix cubemap lowering bit size
this isn't always 32

Fixes: 2d745904ca ("zink: add a gently mangled version of the d3d12 cubemap -> array compiler pass")

fixes:
dEQP-GL45-ES31.functional.program_uniform.by_pointer.render.struct_in_array.sampler2D_samplerCube_*

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17008>
(cherry picked from commit 87c7e75721)
2022-06-15 16:13:00 -07:00
Mike Blumenkrantz
3fb2d7b7a8 zink: fix cubemap lowering for array samplers
each sampler is 1 driver location, so use the base variable

Fixes: 2d745904ca ("zink: add a gently mangled version of the d3d12 cubemap -> array compiler pass")

fixes:
dEQP-GL45-ES31.functional.shaders.opaque_type_indexing.sampler.const_expression.*.samplercubearray

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17008>
(cherry picked from commit de6af39534)
2022-06-15 16:13:00 -07:00
Mike Blumenkrantz
245ef2b49d zink: don't print VK_EXT_shader_atomic_float warning for nir_intrinsic_image_deref_atomic_exchange
this is covered by base spec and doesn't require the extension

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17010>
(cherry picked from commit 03d7f31054)
2022-06-15 16:13:00 -07:00
Mike Blumenkrantz
914ff0ab42 zink: avoid uninit values in renderpass state
cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17010>
(cherry picked from commit d8877437d6)
2022-06-15 16:13:00 -07:00
Mike Blumenkrantz
d9a67ee393 zink: fix generated tcs deletion
deleting the generated shader on the first loop iteration like this was
broken if the shader was used in multiple programs, so delete at the end

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17010>
(cherry picked from commit 44cf6f7564)
2022-06-15 16:13:00 -07:00
Mike Blumenkrantz
d8fa501ca4 zink: unset generated tcs pointer from tes on deletion
otherwise this will free the generated tcs multiple times if the tes
is used by multiple programs

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17010>
(cherry picked from commit cf34d3fe05)
2022-06-15 16:12:59 -07:00
Mike Blumenkrantz
96574ecba3 zink: fix generated tcs update path
is_generated is in a union with the generated tcs pointer for tes shaders,
so check the shader stage too

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17010>
(cherry picked from commit 338d986439)
2022-06-15 16:12:59 -07:00
Erik Faye-Lund
6d41869f1e gallium: remove stale comment
This hasn't been true for a long time, let's remove the comment.

Fixes: 0d4898ae80 ("include,gallium: Remove pre-MSVC 2013 compatibility.")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16908>
(cherry picked from commit d791184b46)
2022-06-15 16:12:59 -07:00
Iago Toral Quiroga
7302d43677 broadcom/compiler: disable flags optimization for loop conditions
This is not safe because it may skip regenerating the flags for the
loop condition in the loop continue block and these flags may be
stomped in the loop body by other conditionals.

Fixes: 9909fe6ba ('broadcom/compiler: Skip bool_to_cond where possible')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17020>
(cherry picked from commit a97f78eb14)
2022-06-15 16:12:59 -07:00
Erik Faye-Lund
2bd2df1aec dzn: handle stencil-attachment-optimal layout
We missed this one, whoops.

Fixes: a012b21964 ("microsoft: Initial vulkan-on-12 driver")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16997>
(cherry picked from commit 4ab49e2530)
2022-06-15 16:12:59 -07:00
Marek Olšák
29dac89446 gallium/u_threaded: fix buffer busyness tracking
The order of calls was incorrect.

Fixes: e9c41b3214 - gallium/u_threaded: add buffer lists - tracking of buffers referenced by tc
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5327

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-By: Jonathan Strobl <jonathan.strobl@gmx.de>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16989>
(cherry picked from commit 4c5f7b86ec)
2022-06-15 16:12:59 -07:00
Mike Blumenkrantz
c1f7b8edd7 zink: fix up KILL to a more sensible log message
cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17009>
(cherry picked from commit 399104f049)
2022-06-15 16:12:59 -07:00
Mike Blumenkrantz
61cf43cea1 zink: unset res->swapchain upon killing a swapchain
this otherwise causes the driver to make bad assumptions about
how the resource should be handled

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17009>
(cherry picked from commit 23892bff6b)
2022-06-15 16:12:59 -07:00
Mike Blumenkrantz
4108785f13 zink: add implicit sync workaround for non-mesa drivers
implicit sync is hard, and many drivers get it wrong, so assume that
anyone who isn't mesa might need some hand-holding

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17009>
(cherry picked from commit ea9e30f9d2)
2022-06-15 16:12:59 -07:00
Dylan Baker
d0d37c1f9e .pick_status.json: Update to ea33e44ce4 2022-06-15 16:12:59 -07:00
Mike Blumenkrantz
1fb2d9ba5c zink: only update layout when doing mixed zs attachment renderpass check
avoid doing any sort of extra work here and avoid multi-context weirdness

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16900>
2022-06-15 16:12:59 -07:00
Mike Blumenkrantz
32f640dc05 zink: fix framebuffer attachment usage asserts for dummy attachments
dummy attachments never overwrite existing attachments,
so they must be explicitly compared like this to avoid
erroneous crashing

Fixes: 3892c13381 ("zink: add an alternate path for EXT_color_write_enable usage")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16848>
2022-06-15 16:12:59 -07:00
Pierre-Eric Pelloux-Prayer
0080232e6c radeonsi: prevent recursion in si_decompress_dcc
This avoids u_blitter recursion:

 #0  util_blitter_set_running_flag
 #1  util_blitter_custom_color
 #2  si_blit_decompress_color
 #3  si_decompress_dcc
 #4  si_texture_disable_dcc
 #5  si_update_ps_colorbuf0_slot
 #6  si_bind_ps_shader
 #7  util_blitter_restore_fragment_states
 #8  util_blitter_custom_color
 #9  si_blit_decompress_color
 #10 si_decompress_dcc
 #11 si_sdma_copy_image
 #12 si_blit

cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16962>
(cherry picked from commit 3d37291e1c)

Conflicts:
	src/gallium/drivers/radeonsi/si_blit.c
2022-06-15 16:12:59 -07:00
Jesse Natalie
791969df97 d3d12: Properly set HS input control point count
Looks like some hardware needs this info in the shader to match the
topology. Since there's no spot in the shader info for it, we're
currently using the array size of the TCS input vars to store it.

Cc: mesa-stable
Reviewed-by: Paul Dodzweit <paul.dodzweit@amd.com>
Tested-by: Paul Dodzweit <paul.dodzweit@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16920>
(cherry picked from commit cc805aef69)

Conflicts:
	src/microsoft/compiler/dxil_nir.h
2022-06-15 16:12:59 -07:00
Mike Blumenkrantz
f11d7948be zink: defer old swapchain destruction
ensure that swapchains that are about to be presented asynchronously
cannot be destroyed

Fixes: 8ade5588e3 ("zink: add kopper api")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16932>
(cherry picked from commit 4bee678df3)
2022-06-15 16:12:59 -07:00
Mike Blumenkrantz
a86a20ed99 zink: keep a count of async presents occuring for a given swapchain
this provides info about whether a swapchain is in use in another thread

Fixes: 8ade5588e3 ("zink: add kopper api")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16932>
(cherry picked from commit 1dfa19c541)
2022-06-15 16:12:59 -07:00
Mike Blumenkrantz
302c13dc8d zink: use separate pointer for swapchain presents
this ensures that the same pointer is being accessed from the present
thread as was intended when the present was queued

Fixes: 8ade5588e3 ("zink: add kopper api")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16932>
(cherry picked from commit 892f42271f)
2022-06-15 16:12:59 -07:00
Alyssa Rosenzweig
7597df42b8 panfrost: Disable CRC at <16x16 tile sizes
The hardware writes one CRC per (effective) tile, the tile size of the CRC
buffer is the same as the configured effective tile size. However, all our CRC
infrastructure assumes 16x16 tiles. In case CRC is used with smaller tiles,
buffer overflows and incorrect rendering are all possible. Don't use CRC at
smaller tile sizes. Note disabling CRC correctly invalidates any bound CRC
buffers.

Fixes: 2e97d7c835 ("panfrost: Transaction elimination support")
Closes: #6332
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16983>
(cherry picked from commit 44223e5f28)
2022-06-15 16:12:59 -07:00
Alyssa Rosenzweig
d331e4edcd panfrost: Inline pan_fbd_has_zs_crc_ext
It has a single user -- in a section of code that only runs for MFBD GPUs and
that has already decided whether to use CRCs -- so inlining it simplifies its
definition greatly and may avoid redeciding the CRC setting.

[Note for mesa-stable maintainers: This is not a bug fix but is marked for
backport so the next patch applies cleanly.]

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16983>
(cherry picked from commit cac0578ee5)
2022-06-15 16:12:58 -07:00
Erik Faye-Lund
e4da9d8254 ci/windows: add back build-error detection
This was accidentally broken while refactoring the script.

Fixes: bf3c772e5e ("ci: Improve vs2019 mesa_build.ps1 for remove the need of cmd.exe")
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16965>
(cherry picked from commit 003d052810)
2022-06-15 16:12:58 -07:00
Boris Brezillon
c4f770308f nir: Fix flat new_var assignment in create_new_io_vars()
If the type is not an array, glsl_get_length() returns 0 and we don't
update the new_vars[]/flat_vars[] entries.

Fixes: bcd14756ee ("nir/lower_io_to_vector: add flat mode")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16960>
(cherry picked from commit d9ec7df2f4)
2022-06-15 16:12:58 -07:00
Mike Blumenkrantz
594dc7af9a zink: scalarize when rewriting explicit 64bit io
all of ntv requires scalarized io since the offsets are now array indices
instead of byte offsets, so enforce scalarization here to avoid breaking
the universe

Fixes: 150d6ee97e ("zink: move all 64-32bit shader load rewriting to nir pass")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16669>
(cherry picked from commit cdaa601de3)
2022-06-15 16:12:58 -07:00
Mike Blumenkrantz
692375bf9d zink: fix variable locations in manual xfb emission
the last output isn't always only consuming 1 slot, so ensure that the
xfb outputs begin at the appropriate place

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16669>
(cherry picked from commit e9d28cbe3f)
2022-06-15 16:12:58 -07:00
Mike Blumenkrantz
274fcc2783 zink: fix ntv partial stores
the previous conditional here was stupid and wrong: it should be comparing
to see whether the writemask is the full mask of the type's size

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16669>
(cherry picked from commit 31ba19ff68)
2022-06-15 16:12:58 -07:00
Ian Romanick
9ff1f30d45 anv: Remove FS executables when applying the null FS optimization
If the executables are still hanging out,
anv_GetPipelineExecutableStatisticsKHR will try to dereference NULL
pointers in pipeline->shaders[MESA_SHADER_FRAGMENT].

At least in terms of fossil-db output, this matches the behavior from
before 73b3efcd59.

Fixes: 73b3efcd59 ("anv: Handle the null FS optimization after compiling shaders")
Closes: #6590
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16898>
(cherry picked from commit 65d6708bc3)
2022-06-15 16:12:58 -07:00
Jason Ekstrand
c9981574c1 compiler/types: Don't place members in the previous substruct's end padding
With the following structures :

  struct StructA
  {
     uint64_t value0;
     uint8_t  value1;
  };

  struct TopStruct
  {
     struct StructA a;
     uint8_t value3;
  };

Currently offsetof(struct TopStruct, value3) = 9. While the same code
on the CPU gives offsetof(struct TopStruct, value3) = 16.

This is impacting OpenCL kernels we're trying to use to build
acceleration structures.

v2: Add comment/link to some description of the alignment/size
    computation

Cc: mesa-stable
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16940>
(cherry picked from commit 133620196d)
2022-06-15 16:12:58 -07:00
Mike Blumenkrantz
47a52576da zink: always create descriptor templates
the 'notemplates' debug mode is somewhat misleading since there's no
uncached+notemplates mechanism, meaning that if the descriptor cache
explodes it'll still use templates for updating in the fallback path

Fixes: 4e3768914d ("zink: add ZINK_DESCRIPTORS env var to explicitly set a mode")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16927>
(cherry picked from commit ee1a0a0772)
2022-06-15 16:12:58 -07:00
Dylan Baker
f2f9aa5e8d .pick_status.json: Update to 2ef6b0aab1 2022-06-13 13:19:49 -07:00
Marek Olšák
2a835a2da3 ac/gpu_info: always retile DCC on gfx10 and newer chips
Unaligned DCC doesn't work there.

Fixes: f8cf5ea982 - amd: add support for gfx1036 and gfx1037 chips

Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16726>
2022-06-08 10:58:17 -07:00
Jesse Natalie
dc28a8fd88 nir: Consider PNTC to be a varying
Fixes: 3528dcdf ("nir: add nir_io_semantics::no_varying, no_sysval_output, and helpers")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6091
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16761>
(cherry picked from commit f812cc0fe6)

Conflicts:
	src/gallium/drivers/d3d12/ci/d3d12-quick_gl.txt
2022-06-08 09:14:54 -07:00
Alyssa Rosenzweig
364767c445 panfrost: Fix inverted indirect dispatch condition
Inverted condition -- indirect dispatch gets disabled when WLS is in use, not
the other way around. Not sure how this worked before...

Fixes: fd7b44882c ("panfrost: Use direct dispatch with shared memory")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16916>
(cherry picked from commit 3c5f1595b8)
2022-06-08 09:11:17 -07:00
Pierre-Eric Pelloux-Prayer
6022ed0079 va/surface: set the correct size in vaExportSurfaceHandle
The size must be the size of the total object, not the size
of the resource.
For instance, when using a single object for a multi-plane
format, the size of each plane should be equal to the size
of the underlying object to match libva's documentation:

        /** Total size of this object (may include regions which are
         *  not part of the surface). */
        uint32_t size;

Fixes: 13b79266e4 ("frontend/va: Setting the size of VADRMPRIMESurfaceDescriptor")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16813>
(cherry picked from commit bce227611d)
2022-06-08 09:11:17 -07:00
Pierre-Eric Pelloux-Prayer
d4c1b9a5e6 gallium: add size attribute to winsys_handle
This is needed at least for the VA-API frontend where the exporter
needs to know the total size of the object.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16813>
(cherry picked from commit 8c07d7cbdd)
2022-06-08 09:11:17 -07:00
Dylan Baker
5df18fdb77 .pick_status.json: Update to 35dd4ac886 2022-06-08 08:58:37 -07:00
Alyssa Rosenzweig
30a9514258 pan/mdg: Remove uppercase write masks
These do not convey any additional information, and fail to account for
shrinking. In particular, a 64-bit writemask with .keephi would fail to
disassemble and instead trip the assertion, since that would be the ZW
components. Just delete the broken code.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16798>
(cherry picked from commit 8c11f4809b)
2022-06-07 13:17:39 -07:00
Alyssa Rosenzweig
01eba9dcb2 pan/mdg: Scalarize with 64-bit sources
Otherwise, we can get vec3 with u2u32 with 64-bit sources which we need lowered.
Since our current approach is "scalarize all 64-bit ops", we need to check for
conversions too.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16798>
(cherry picked from commit 9e4b457958)

Conflicts:
	src/panfrost/ci/panfrost-t860-fails.txt
2022-06-07 13:17:39 -07:00
Emma Anholt
4da856eaac nouveau/nv30: Make sure fsat is lowered in the VS.
GLSL lowers fsat to clamps based on PIPE_CAP_VERTEX_SHADER_SATURATE
(EmitNoSat), but nir is happy to optimize that back to fsat unless you
tell it not to.

Noticed by inspection while looking at deleting EmitNoSat.

Fixes: ca1ec72726 ("nv30/40: Switch to using NIR-to-TGSI by default.")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16823>
(cherry picked from commit 7a8e3c80fd)
2022-06-07 13:17:39 -07:00
Nagappa Koppad, Basanagouda
7026ff1857 iris:Duplicate DRM fd internally instead of reuse.
Scenario we want to avoid is double close of DRM fd in iris driver.

Signed-off-by: Nagappa Koppad, Basanagouda <basanagouda.nagappa.koppad@intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6620
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16886>
(cherry picked from commit a99e85db9e)
2022-06-07 13:17:38 -07:00
Qiang Yu
8c6c80b0a0 mesa/program: fix nir output reg overflow
outputs_written is uint64_t, should count max reg number
by util_last_bit64(). Otherwise the following access will
overflow the allocated array with a smaller size.

cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15765>
(cherry picked from commit feea8fed44)
2022-06-07 13:17:38 -07:00
Rhys Perry
0b37f7dabc aco: fix SMEM load_global with VGPR address and non-zero offset
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Fixes: 3e9517c757 ("aco: implement _amd global access intrinsics")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16775>
(cherry picked from commit f4c02d9116)
2022-06-07 13:17:38 -07:00
Rhys Perry
b223bf759d aco: fix SMEM load_global_amd with non-zero offset
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Fixes: 3e9517c757 ("aco: implement _amd global access intrinsics")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16775>
(cherry picked from commit 4d9f3fcf9c)
2022-06-07 13:17:38 -07:00
Juan A. Suarez Romero
379aab1a64 v3d: save only required states in blitter
Some blitter operations, like clear, doesn't require to save all the
states.

This is particular important because, besides saving time, the blitter
operation restores the state required for the operation, and if we saved
more states than those, these ones won't be restored and will be leak.

So this also fixes some leaks when running CTS tests.

CC: mesa-stable
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16837>
(cherry picked from commit 695f66cecd)
2022-06-07 13:17:38 -07:00
Mike Blumenkrantz
e01d543c76 format_utils: properly parenthesize macro params
this otherwise breaks evaluation of the parameters on arm64

cc: mesa-stable

fixes #6496

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16860>
(cherry picked from commit ba09a00a5c)
2022-06-07 13:17:38 -07:00
Georg Lehmann
c2f4b1acfb zink: Use VK_USE_64_BIT_PTR_DEFINES to check for 64bit platforms.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6605

Cc: mesa-stable

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16853>
(cherry picked from commit f3c3b8cf2a)
2022-06-07 13:17:38 -07:00
Mike Blumenkrantz
e0f34e6baf zink: fix dmabuf plane layout struct scoping
this struct needs to exist for all the scopes it's used in

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16822>
(cherry picked from commit c57fa8b390)
2022-06-07 13:17:38 -07:00
Mike Blumenkrantz
39ca39d4f3 kopper: use get_drawable_info path for non-x11 drawables
wayland surfaces need to take this path to get resizing right

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16814>
(cherry picked from commit b6a8014217)
2022-06-07 13:17:38 -07:00
Mike Blumenkrantz
b3b4b2d563 egl/wayland: skip buffer creation on zink
this happens through wsi, so don't create resources that aren't used

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16814>
(cherry picked from commit 20ba759694)
2022-06-07 13:17:38 -07:00
Mike Blumenkrantz
575da2866f egl/wayland: manually swap backbuffer when using zink
this would usually occur through dri2_wl_swrast_commit_backbuffer(),
but zink triggers this functionality using vulkan wsi, which fails to
perform these updates as expected

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16814>
(cherry picked from commit f67bd8adfa)
2022-06-07 13:17:38 -07:00
Pierre-Eric Pelloux-Prayer
e58cd4a6f9 st/mesa: use mutex in st_get_texture_sampler_view_from_stobj
st_texture_release_all_sampler_views uses the validate_mutex,
but st_get_texture_sampler_view_from_stobj didn't.

Since they both modify stObj->view we could have threadA in
st_get_texture_sampler_view_from_stobj with a non-NULL sv,
so expecting sv->view to be non-NULL, while threadB was in
st_texture_release_all_sampler_views clearing sv->view.

It's also needed to protect st_sampler_view::private_refcount,
which is supposed to be used from the owning context thread,
but can also be used by any context in st_texture_release_all_sampler_views.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6088
Fixes: ef5d427413 ("st/mesa: add a mechanism to bypass atomics when binding sampler views")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16779>
(cherry picked from commit b51e40ebde)
2022-06-07 13:17:38 -07:00
Boris Brezillon
e6ad3c0fd7 microsoft/spirv_to_dxil: Fix the push_constant UBO size calculation
Right now, we just consider the size of the accessed portion of the
push constant array, but it doesn't necessarily reflect the size
of the UBO we should declare.

Fixes: de1e941c59 ("microsoft/spirv_to_dxil: Lower push constant loads to UBO loads")
Reviewed-by: Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16703>
(cherry picked from commit 2feef505c1)
2022-06-07 13:17:38 -07:00
Boris Brezillon
211d980d29 microsoft/spirv_to_dxil: Fix push_constants type declaration
We're not declaring an array of bytes but an array of uint32. Let's
fix the element_count we pass to glsl_array_type().

Fixes: de1e941c59 ("microsoft/spirv_to_dxil: Lower push constant loads to UBO loads")
Reviewed-by: Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16703>
(cherry picked from commit 6783a88455)
2022-06-07 13:17:38 -07:00
Samuel Pitoiset
551396ed7b radv: enable radv_zero_vram for Hammerting
This native Vulkan game is broken, it has TON of Vulkan validation
errors and hangs without RADV_DEBUG=zerovram. Also tested with PRO
and AMDVLK.

The application name is also not really descriptive but the executable
name 'boot.exe' is worst.

https://github.com/ValveSoftware/Proton/issues/4347#issuecomment-1141415515

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16832>
(cherry picked from commit fe9f1d064a)
2022-06-07 13:17:38 -07:00
Dave Airlie
dc7c2df02b llvmpipe: handle timespec overflow on fence waits.
on 32-bit systems VK CTS was failing due to an overflow here,
detect the overflow and just do a normal wait.

Fixes: 5b284fe6bc ("llvmpipe: add lp_fence_timedwait() helper")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16847>
(cherry picked from commit b62dd20dea)
2022-06-07 13:17:38 -07:00
Mike Blumenkrantz
9097462c37 zink: force queries to start/end out of renderpass
spec requires queries to either start and end in the same renderpass
or start and end outside of renderpass, so do the latter since it's
easier to track

cc: mesa-stable

fixes #6579

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16844>
(cherry picked from commit d9ab27944d)
2022-06-07 13:17:38 -07:00
Alyssa Rosenzweig
5baf33795a pan/bi: Fix clper_xor on Mali-G31
Mali-G31 has the old CLPER instruction, not the new one, which means we don't
get to specify a custom lane op. But the clper_xor helper incorrectly checked
the arch, not the implementation quirk.

Fixes: c00e7b729f ("pan/bi: Optimize abs(derivative)")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Icecream95 <ixn@disroot.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16846>
(cherry picked from commit 7535362204)
2022-06-07 13:17:38 -07:00
Kenneth Graunke
d962bdcdd3 intel/compiler: Fix uncompaction of signed word immediates on Tigerlake
This expression accidentally performs a 32-bit sign-extension when
processing the second half of the expression (the low 16 bits).

Consider -7W, which is represented as 0xfff9fff9 in our encoding (the
16-bit word is replicated to both halves of the 32-bit dword).

Tigerlake's compaction stores the low 11-bits of an immediate as-is,
and replicates the 12th bit.  So here, compacted_imm will be 0xff9.

   (  (int)(0xff9 << 20) >> 4) |
   ((short)(0xff9 <<  4) >> 4))

   0xfff90000 | (0xff90 >> 4)
   0xfff90000 | 0xfffffff9 ...oops...
   0xfffffff9

By casting the second line of the expression to unsigned short, we
prevent the sign-extension when it combines both parts, so we get:

   0xfff90000 | 0x0000fff9
   0xfff9fff9

Fixes: 12d3b11908 ("intel/compiler: Add instruction compaction support on Gen12")
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16833>
(cherry picked from commit 26bb81f3f6)
2022-06-07 13:17:38 -07:00
Dylan Baker
03847428d8 .pick_status.json: Update to 4923458577 2022-06-07 13:17:38 -07:00
Mike Blumenkrantz
9b77caa70f lavapipe: fix dynamic patchControlPoints
the dynamic state value is independent of whether tesselation is used

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16824>
(cherry picked from commit fc5a3e1e37)
2022-06-07 13:17:38 -07:00
Erik Faye-Lund
c9d10441f0 intel: remove stale makefile
When this landed, the Autotools build system was already removed. Why
was this file added in the first place? Probably a rebase-mistake...

Fixes: 134e750e16 ("i965: extract performance query metrics")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16790>
(cherry picked from commit a8605db504)
2022-06-07 13:17:38 -07:00
Erik Faye-Lund
85d1edec9b freedreno: remove stale makefile
We don't use this makefile, so there's no point in keeping it in the
repo. It's also a generated one, so it contains a lot of... mess.

Fixes: 536f43cb96 ("freedreno: slurp in afuc")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16790>
(cherry picked from commit 9bcd538643)
2022-06-07 13:17:38 -07:00
Alyssa Rosenzweig
e320dce31a panfrost: Fix XML for AFBC header on v9
Misnamed field due to copy/paste fail from Bifrost.

Fixes: c011ea6c26 ("panfrost: Shuffle render target AFBC for Valhall")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16800>
(cherry picked from commit 2cc2f217d4)
2022-06-07 13:17:38 -07:00
Dylan Baker
ae07db983d .pick_status.json: Update to ad5c84999b 2022-06-07 13:17:38 -07:00
Kyle Russell
6195ecc599 etnaviv: don't halve max_instructions for GC400
This allows glamor to successfully compile its shaders on the GC400.

When running glamor using the GC400, Xorg reports that the compiled
shaders exceed the maximum allowed instructions because the value
reported from the kernel is halved.

Xserver[314]: etna_draw_vbo:318: compiled shaders are not okay

$ cat /sys/kernel/debug/dri/128/gpu | grep instruction_count
         instruction_count: 256

However, the spec for the Unified vertex-fragment shader explicitly
lists 256 as the maximum number of instructions for each shader
("256 for vertex shaders; 256 for fragment shaders").

Signed-off-by: Kyle Russell <bkylerussell@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
(cherry picked from commit aa29e0d858)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16661>
2022-06-03 17:28:18 +00:00
Dylan Baker
53c72db5d3 .pick_status.json: Update to 1c63a0beaf 2022-06-01 14:50:23 -07:00
Mike Blumenkrantz
c4beb72bc7 zink: remove first_frame stalling
this is fixed by kopper

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16796>
2022-06-01 14:50:23 -07:00
Mike Blumenkrantz
38b59a9e15 st/pbo_compute: fix z coords for compute pbos
without manually taking the value from the global_id vec, this will
end up being offset.y again, which breaks z-indexing

Fixes: e7b9561959 ("gallium: implement compute pbo download")

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16728>
2022-06-01 14:50:23 -07:00
Mike Blumenkrantz
d05f81668b st/pbo_compute: make compute download conditional in shader slightly more readable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16728>
2022-06-01 14:49:21 -07:00
Erik Faye-Lund
2e27144bed nir: introduce and use nir_component_mask
The BITFIELD_MASK() macro is intended for using with actual bitfields,
not with nir_component_mask_t. This means we do some extra work to
handle values that are invalid for nir_component_mask_t in the first
place.

This eliminates some warnings on Clang, where the compiler complains
about casting UINT32_MAX to UINT16_MAX.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15547>
2022-06-01 14:49:21 -07:00
Jason Ekstrand
87e49ea977 nir/builder: Add a nir_trim_vector helper
This pattern pops up a bunch and the semantics of nir_channels() aren't
very convenient much of the time.  Let's add a nir_trim_vector() which
matches nir_pad_vector().

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16309>
2022-06-01 14:49:21 -07:00
Dylan Baker
23bcaaeaaa docs: Add sh256sums for 22.1.1 2022-06-01 14:48:35 -07:00
Dylan Baker
a730b834b0 VERSION: bump for 22.1.1 release 2022-06-01 14:10:29 -07:00
Dylan Baker
9f09db4ed7 docs: add release notes for 22.1.1 2022-06-01 14:10:29 -07:00
Jason Ekstrand
1d0badd2f3 nir: Mark negative re-distribution on fadd as imprecise
Otherwise, it would mutate `fneg(fadd(-0, 0))` into `fadd(0, -0)` which
isn't correct since -0 + (+0) = +0 + (-0) = +0.

This fixes the OpenCL contraction tests on Iris.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16041>
(cherry picked from commit df1876f615)
2022-06-01 14:10:29 -07:00
Mike Blumenkrantz
89b80e6587 zink: drop largePoints requirement
this is not required by any version of GL, so don't pretend it's needed

cc: mesa-stable

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16758>
(cherry picked from commit 4b5bb21318)
2022-06-01 14:10:29 -07:00
Mike Blumenkrantz
419920ebd5 zink: drop wideLines requirement
this is not a requirement for any version of GL, so don't pretend it's
a requirement

cc: mesa-stable

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16758>
(cherry picked from commit 63a9e0a986)
2022-06-01 14:10:29 -07:00
Daniel Schürmann
1a390ad8a3 aco: fix spilling of phis without temp operands
These were spilled unconditionally.

Cc: mesa-stable
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16708>
(cherry picked from commit 8e41c66639)
2022-06-01 14:10:29 -07:00
Erik Faye-Lund
842ed4b396 editorconfig: remove pl-rule
Fixes: 721b880e4c ("script: drop get_reviewer.pl")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16786>
(cherry picked from commit 61a5034950)
2022-06-01 14:10:29 -07:00
Erik Faye-Lund
392d008895 editorconfig: remove m4-rule
Fixes: 95aefc94a9 ("Delete autotools")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16786>
(cherry picked from commit 799bf3d686)
2022-06-01 14:10:29 -07:00
Erik Faye-Lund
63ec50e6dc editorconfig: remove html-rule
Fixes: 44a4e34d52 ("docs: remove doxygen support")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16786>
(cherry picked from commit 12aa3b82dc)
2022-06-01 14:10:29 -07:00
Erik Faye-Lund
10a59a392a editorconfig: remove scons-ism
Fixes: 6e6cd7d93c ("scons: Remove.")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16786>
(cherry picked from commit 7a088d3583)
2022-06-01 14:10:29 -07:00
Mike Blumenkrantz
f1dd0af4cd zink: make swapchain kill message more descriptive
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16776>
(cherry picked from commit 9f7029169b)
2022-06-01 14:10:29 -07:00
Jason Ekstrand
87a3240d57 glsl/nir: Stop leaking varyings_info
Fixes: 34b3b92bbe ("nir/xfb: move varyings info out of nir_xfb_info")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16750>
(cherry picked from commit 36d8a2f1d7)
2022-06-01 14:10:29 -07:00
Mike Blumenkrantz
af16f82e15 st/pbo_compute: use different calc for non-3d compute buffer sizing
this avoids looking at irrelevant 3d pixelstore params like
GL_PACK_IMAGE_HEIGHT when they don't apply, which will cause the storage
buffer to be incorrectly sized and break the operation

Fixes: e7b9561959 ("gallium: implement compute pbo download")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16728>
(cherry picked from commit 70fb3a4700)
2022-06-01 14:10:29 -07:00
Mike Blumenkrantz
43f90a3640 zink: emit spirv cap for subgroup vote ops
cc: mesa-stable

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16757>
(cherry picked from commit aaf0d4490e)
2022-06-01 14:10:29 -07:00
Mike Blumenkrantz
0f7f057434 zink: require draw params ext/cap in ntv if drawid is used
cc: mesa-stable

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16757>
(cherry picked from commit 591da8cf5d)
2022-06-01 14:10:29 -07:00
Jason Ekstrand
a4f81cf2c0 nir: Handle register sources in lower_phis_to_regs_block
During certain control-flow manipulation passes, we go out-of-SSA
temporarily in certain areas of the code to make control-flow
manipulation easier.  This can result in registers being in phi sources
temporarily.  If two sub-passes run before we get a chance to do
clean-up, we can end up doing some out-of-SSA and then a bit more
out-of-SSA and trigger this case.  It's easy enough to handle.

Fixes: a620f66872 ("nir: Add a couple quick-and-dirty out-of-SSA helpers")
Fixes: 79a987ad2a ("nir/opt_if: also merge break statements with ones after the branch")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6370
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16111>
(cherry picked from commit 4a4d6cdc80)
2022-06-01 14:10:29 -07:00
Matt Turner
7ba0db7afd mesa: Drop dead #include "sparc/sparc.h"
sparc.h was removed in when the classic drivers were removed. It only
contained a prototype for _mesa_init_all_sparc_transform_asm() which
wasn't even called by context.c. Remove the #include to fix the build on
sparc.

Fixes: e030d5ba8a ("mesa: Delete libmesa_classic")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6425
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16765>
(cherry picked from commit 27f3fb5699)
2022-06-01 14:10:29 -07:00
Rhys Perry
c5c3143de4 aco/ra: fix usage of invalidated iterator
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 58bd9a379e ("aco/ra: fix live-range splits of phi definitions")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16454>
(cherry picked from commit cd2b4c319a)
2022-06-01 14:10:29 -07:00
Konstantin Seurer
7c337f851c radv: Fix handling of primitiveOffset
VkAccelerationStructureBuildRangeInfoKHR spec:
If the geometry uses indices, primitiveCount × 3 indices are consumed from VkAccelerationStructureGeometryTrianglesDataKHR::indexData, starting at an offset of primitiveOffset. The value of firstVertex is added to the index values before fetching vertices.

If the geometry does not use indices, primitiveCount × 3 vertices are consumed from VkAccelerationStructureGeometryTrianglesDataKHR::vertexData, starting at an offset of primitiveOffset + VkAccelerationStructureGeometryTrianglesDataKHR::vertexStride × firstVertex.

Meaning: We always add firstVertex * vertexStride
to the vertex address and add primitiveOffset
either to the vertex address or the index address,
depending on wether indices are used.

Also add missing handling with instances.

Fixes: 0dad88b ("radv: Implement device-side BVH building.")
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16719>
(cherry picked from commit 9be00573c4)

Conflicts:
	src/amd/vulkan/radv_acceleration_structure.c
2022-06-01 14:10:28 -07:00
Jason Ekstrand
901d5b8617 anv: Don't disable the fragment shader if XFB is enabled
It turns out that we need a fragment shader for streamout.  Whh?  From
Lionel's reading of simulator sources, it seems the streamout unit is
looking at enabled next stages.  It'll generate output to the clipper in
the following cases :

 - 3DSTATE_STREAMOUT::ForceRendering = ON
 - PS enabled
 - Stencil test enabled
 - depth test enabled
 - depth write enabled
 - some other depth/hiz clear condition

Forcing rendering without a PS seems like a recipe for hangs so it's
probably better to just enable the PS in this case.

Fixes: 36ee2fd61c ("anv: Implement the basic form of VK_EXT_transform_feedback")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16506>
(cherry picked from commit 0d28de212a)
2022-06-01 14:10:28 -07:00
Jason Ekstrand
365b1a2daa anv: Handle the null FS optimization after compiling shaders
Actually compile and cache the no-op fragment shader but remove it from
the pipeline if we determine it's a no-op.  This way we always have it
even if it's not strictly needed.

Fixes: 36ee2fd61c ("anv: Implement the basic form of VK_EXT_transform_feedback")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16506>
(cherry picked from commit 73b3efcd59)
2022-06-01 14:10:28 -07:00
Jason Ekstrand
84c1da77de anv: Drop alpha_to_coverage from the NULL FS optimization
Starting with Ivy Bridge, we implement alpha-to-coverage by writting
gl_SampleMask with a pattern based on alpha.  This will show up in
wm_prog_data::uses_omask so we don't need to look at the key.

Fixes: 36ee2fd61c ("anv: Implement the basic form of VK_EXT_transform_feedback")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16506>
(cherry picked from commit 9fe6caf4e7)
2022-06-01 14:10:28 -07:00
Jason Ekstrand
3cceae1986 intel/fs: Copy color_outputs_valid into wm_prog_data
Fixes: 36ee2fd61c ("anv: Implement the basic form of VK_EXT_transform_feedback")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16506>
(cherry picked from commit 1b9248e761)
2022-06-01 14:10:28 -07:00
Yogesh Mohan Marimuthu
0e521b2f13 vulkan/wsi: fix extra free if buffer_blit_queue
In wsi_destroy_image(), if buffer_blit_queue then
do not call extra free. This will fix assert in
debug release and accessing out of allocated memory.

Fixes:
  7bd5aa111c
  ("vulkan/wsi: add a private transfer pool to exec the DRI_PRIME blit")

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset's avatarSamuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16649>
(cherry picked from commit 1a8b03732f)
2022-06-01 14:10:28 -07:00
Mike Blumenkrantz
67509f57a3 zink: only warn once for SRGB fb without KHR_swapchain_mutable_format
Fixes: 4bb45bcd16 ("zink: add error logging for SRGB framebuffer without KHR_swapchain_mutable_format")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16642>
(cherry picked from commit c97aee426e)

Conflicts:
	src/gallium/drivers/zink/zink_context.c
2022-06-01 14:10:28 -07:00
Dylan Baker
cf3abbaa58 .pick_status.json: Update to 5067a26f44 2022-06-01 14:10:28 -07:00
Mike Blumenkrantz
c06e0e1998 zink: add renderpass bits for color/depth r/w
these are different renderpasses according to compatibility rules

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16621>
(cherry picked from commit 8fef8ed1b0)
2022-06-01 14:10:28 -07:00
Mike Blumenkrantz
b348e4f0e0 zink: use a zink_render_pass_pipeline_state bit for fbfetch
improve compatibility detection

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16621>
(cherry picked from commit f4aa727e44)
2022-06-01 14:10:28 -07:00
Samuel Pitoiset
d83ac7b2a6 radv: fix writing buffer markers with non-zero memory offset
Found by insepction.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16698>
(cherry picked from commit 1046c2a1c0)
2022-06-01 14:10:28 -07:00
Dave Airlie
6480e58a78 llvmpipe: flush resources for kms swrast path.
The kms_swrast path calls this callback via the dri2 paths,
not flushing caused artifacts when running inside a VM or on hw
in weston/gnome-shell.

Fixes: 6bbbe15a78 ("Reinstate: llvmpipe: allow vertex processing and fragment processing in parallel")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16715>
(cherry picked from commit c219ca3fb7)
2022-06-01 14:10:28 -07:00
Timur Kristóf
b75c1b047f radv: Disable predication for supass clear and image clears.
According to the Vulkan spec 21.4 "Conditional Rendering",
only clearing attachments with vkCmdClearAttachments is subject to
conditional rendering.

Subpass clear and vkCmdClearColorImage / vkCmdClearDepthStencilImage
should always be executed even if it happens in a
conditional rendering block.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16654>
(cherry picked from commit 55466ca506)
2022-06-01 14:10:28 -07:00
Pierre-Eric Pelloux-Prayer
d62bc76174 radeonsi: don't use sel->nir in si_check_blend_dst_sampler_noop
We don't want to modify sel->nir so force the use of the serialized
version of the shader.
Waiting on sel->ready guarantees that sel->nir will be NULL and that
si_get_nir_shader will use sel->nir_binary.

Fixes: b78a38bd02 ("radeonsi: use si_nir_is_output_const_if_tex_is_const")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6415
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16587>
(cherry picked from commit ef950d370a)
2022-06-01 14:10:28 -07:00
Timur Kristóf
1153547b86 radv: Implement conditional rendering for async compute queue.
MEC (the compute queue firmware) does not support real
predication, so we have to emulate that using COND_EXEC
packets before each dispatch.

Additionally, COND_EXEC doesn't have an inverted mode, so
in order to support inverted mode conditional rendering, we
allocate a new piece of memory in which we invert the condition.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6533
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16653>
(cherry picked from commit 85a4c5b351)
2022-06-01 14:10:28 -07:00
Dave Airlie
96a45c87ca lavapipe: fix depth bias offset flag enables.
When vulkan enables depth bias, enable it for all 3 prim types
in gallium.

This fixes:
dEQP-VK.draw.renderpass.depth_bias.depth_bias_*
and
one zink test in CI

Cc: mesa-stable
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16701>
(cherry picked from commit 4896e136b6)
2022-06-01 14:10:28 -07:00
Michael Skorokhodov
b7b727f561 anv: Update line range
This commit increases the maximum line width to 8.0 for SLK+
and to 7.9921875 for BDW and earlier.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6234
Fixes: fce0027d ("anv: Unbreak wide lines on HSW/BDW")
Signed-off-by: Mykhailo Skorokhodov <mykhailo.skorokhodov@globallogic.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15879>
(cherry picked from commit 10b6d9230c)
2022-06-01 14:10:28 -07:00
Icecream95
a6e9df189d panfrost: Only write depth / stencil once if MRT is used
We can't assume that RT0 will be written, so this has to be based on
whether a combined store has already been emitted, not the location of
the store.

Emit a non-special combined_store intrinsic that only writes colour
for the other RTs, as reordering stores breaks the Midgard compiler.

Fixes: d37e901e35 ("pan/mdg: Add new depth store lowering")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6527
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16685>
(cherry picked from commit a4323b0979)
2022-06-01 14:10:28 -07:00
Icecream95
0155e7a136 pan/mdg: Read base for combined stores
Fixes depth/stencil writes with MRT.

Fixes: b3d7272753 ("pan/mdg: Don't read base for combined stores")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16685>
(cherry picked from commit 0a53ebabcd)
2022-06-01 14:10:28 -07:00
Icecream95
dc5ec1899f pan/bi: Read base for combined stores
Fixes depth/stencil writes with MRT.

Fixes: 996645e479 ("pan/bi: Don't read base for combined stores")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16685>
(cherry picked from commit f1a226dd24)
2022-06-01 14:10:28 -07:00
Icecream95
78cc3737f3 nir: Add store_combined_output_pan BASE back
It's meaningful for this intrinsic and so does not add noise to the
lowering pass.

(Although dual-source writes must be to RT 0, depth and stencil
writes, which store_combined_output_pan is also used for, can still be
done with MRT enabled.)

Fixes: 5c168f09eb ("nir: Eliminate store_combined_output_pan BASE")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16685>
(cherry picked from commit 9f9ed959bd)
2022-06-01 14:10:28 -07:00
Dylan Baker
95d0746446 .pick_status.json: Update to 9773ed1dc7 2022-06-01 14:10:28 -07:00
Rhys Perry
f981ffc2be aco: fix p_constaddr with a non-zero offset
Seems this broke a while ago and we never noticed.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 0af7ff49fd ("aco: lower p_constaddr into separate instructions earlier")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16460>
(cherry picked from commit bd8f8dda8c)
2022-06-01 14:10:28 -07:00
Boris Brezillon
8d54a44028 dzn: Use the vk_sync_binary abstraction
D3D12 fences are capable of handling binary operations, but the
current dzn_sync implementation doesn't match vk_sync expectations
when sync objects are used to back semaphores. In that case, the wait
operation is supposed to set the sync object back to an unsignaled
state after the wait succeeded, but there's no way of knowing what
the sync object is used for, and this implicit-reset behavior is not
expected on fence objects, which also use the sync primitive.
That means we currently have a semaphore implementation that works
only once, and, as soon as the semaphore object has been signaled it
stays in a signaled state until it's destroyed.

We could extend the sync framework to pass an
implicit-reset-after-wait flag, but, given no one else seems to
need that, it's probably simpler to drop the binary sync
capability and rely on the binary-on-top-of-timeline emulation provided
by the core.

Fixes: a012b21964 ("microsoft: Initial vulkan-on-12 driver")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16629>
(cherry picked from commit 1eaba553e2)
2022-06-01 14:10:28 -07:00
Mike Blumenkrantz
a15759a568 turnip: fix assert for max xfb outputs
this is a counter, not an index, so use <=

cc: mesa-stable

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16620>
(cherry picked from commit aa32b96c51)
2022-06-01 14:10:28 -07:00
Icecream95
8e85e7d7e9 panfrost: Copy blend constant into variant even when reusing it
Otherwise future lookups will match searches for the old constant.

Fixes: bbff09b952 ("panfrost: Move the blend shader cache at the device level")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6355
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16343>
(cherry picked from commit 80404c8b64)
2022-06-01 14:10:28 -07:00
Dylan Baker
fcdd2a536b .pick_status.json: Update to ee2278de65 2022-06-01 14:10:28 -07:00
Hans-Kristian Arntzen
3b37f92298 radv: Fix RTPSO hashing of pGroups.
There are padding bytes here. Only hash relevant members.

Fixes: ca2d96db51 ("radv: Add caching for RT pipelines.")
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16582>
(cherry picked from commit 04459c8287)
2022-06-01 14:10:28 -07:00
Jason Ekstrand
ea4c0adb6a radv: Add a sqtt entrypoint for CmdBindVertexBuffers2
Fixes: b262284300 ("radv: add support for dynamic vertex input binding stride")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16611>
(cherry picked from commit 50a00f889c)
2022-06-01 14:10:28 -07:00
Qiang Yu
23499ac279 radeonsi: lower nir_intrinsic_sparse_residency_code_and
This is required by lower_tg4_offsets which split one
sparseTextureGatherOffsetsARB call to four sparseTextureGatherOffsetARB
calls and merge their resisident results into one.

Fixes: ee040a6b63 ("radeonsi: enable ARB_sparse_texture2")

Reviewed-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/16599>
(cherry picked from commit cc4d5b1666)
2022-06-01 14:10:28 -07:00
Alyssa Rosenzweig
c93d320845 pan/bi: Fix mov and pack_32_2x16
Move can take in a vector and write a scalar, depending on the swizzle. We need
to handle this case. Split out mov and pack_32_2x16 so we can specify correct
behaviour for both. Also drop unused 1-bit boolean stuff which obscured the fix.

Fixes: 76cea8e27b ("panfrost: Fix pack_32_2x16 implementation")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16585>
(cherry picked from commit 9924e6f291)
2022-06-01 14:10:28 -07:00
Dylan Baker
9bd36923b3 .pick_status.json: Update to 95d4e5435b 2022-06-01 14:10:28 -07:00
Filip Gawin
927bdfc4bb r300: keep negation if w is an inline constant
(in dataflow swizzles pass)

helps with:
dEQP-GLES2.functional.shaders.random.conditionals.combined.73
on r300 and r400

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16559>
(cherry picked from commit fb2426db7a)
2022-06-01 14:10:28 -07:00
Dylan Baker
6eba93cc57 .pick_status.json: Update to 8b13ee75ba 2022-06-01 14:10:28 -07:00
Charmaine Lee
8504bc1563 gallium/util: Increase the debug_flush map depth to 64
Piglit tests fbo-generatemipmap-3d RGB9_E5 and
fbo-generatemipmap-cubemap array RGB9_E5 hit assert when debug_flush
is active. Increase the debug map depth to 64.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
(cherry picked from commit c63346eb69)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16564>
2022-06-01 14:10:28 -07:00
Zack Rusin
321cf6e65d svga: Add support for SVGAv3
SVGAv3 changes the PCI id due to differences in how PCI configuration
is handled - removal of VRAM and FIFO PCI resources, switch to MMIO
registers and MSI/MSI-X IRQ support but the 3D commands remain largely
the same.

This enables 3D/graphics acceleration support on SVGAv3.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
(cherry picked from commit 16019ff7cc)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16564>
2022-06-01 14:10:27 -07:00
Zack Rusin
768c1a9512 svga: Use direct maps when GB objects are present
SVGA device always supports direct maps which are preferable in all cases
because they avoid temporary surfaces and extra transfers. Furthermore
DMA transfers on devices with GB objects have undefined timing semantics.

Also the DMA transfers can not work on SVGAv3 because the device lacks
VRAM to be able to perform them.

Fix the last paths still using DMA transfers to make sure they're never
used on GB enabled configs. This fixes gnome-shell startup on SVGAv3.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Martin Krastev <krastevm@vmware.com>
Reviewed-by: Michael Banack <banackm@vmware.com>
(cherry picked from commit e5306d190a)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16564>
2022-06-01 14:10:27 -07:00
Zack Rusin
991e904e95 svga: finish readbacks before mapping resources
Flushing the command queue before mapping a resource is not enough
to guaruantee that the mapped content is not stale. We have to finish
to make sure that the gb readback actually updated the guest surface.

This fixes races in direct maps (map reads raced with gb readbacks)

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
(cherry picked from commit c7b0309723)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16564>
2022-06-01 14:10:27 -07:00
Zack Rusin
6ec3f71e05 svga: Don't try to build x86/x64 assembly on different arch's
svga used to use vmx backdoor directly to send logs to the host.
This functionality has been implemented in vmwgfx 2.17, but
to make sure we still work with old kernels the functionality
to use the backdoor directly has been kept.

There's no reason to port that code to arm since vmwgfx
implements it and arm64 (or other new platforms) would
depend on vmwgfx versions a lot newer than 2.17, so everywhere
but on x86/x64 it's fine to assume vmwgfx always support the host
logging ioctls.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Reviewed-by: Neha Bhende <bhenden@vmware.com>
Reviewed-by: Martin Krastev <krastevm@vmware.com>
(cherry picked from commit 71a749bc7b)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16564>
2022-06-01 14:10:27 -07:00
Dylan Baker
492034e0e2 relnotes: Add sha256sum and fix minor formatting issues 2022-05-18 13:31:26 -07:00
Dylan Baker
01113c2eaa VERSION: bump for 22.1.0 final 2022-05-18 12:30:40 -07:00
Dylan Baker
1d60c87010 docs: add release notes for 22.1.0 2022-05-18 12:30:26 -07:00
Jonathan Gray
f1b085cd69 intel/dev: add RPL-S pci ids from drm-intel-next
from Tejas Upadhyay 'drm/i915: Add RPL-S PCI IDs' in drm-intel-next

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
(cherry picked from commit 0cfc01fe83)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16337>
2022-05-18 19:00:09 +00:00
Jonathan Gray
39636a083e intel/dev: sync ADL-S pci ids with linux
sync ADL-S pci ids with linux
c79b846f892d ("drm/i915/adl_s: Update ADL-S PCI IDs")

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
(cherry picked from commit 3cc1efee6f)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16337>
2022-05-18 19:00:09 +00:00
Tomeu Vizoso
8894522f41 ci: Disable jobs to the Collabora lab
In anticipation of infrastructure work.

This commit is to be reverted later in the day.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16576>
(cherry picked from commit 224544dc33)
2022-05-18 11:05:48 -07:00
Kenneth Graunke
b8be90b8b4 Revert "st/mesa: Transcode ASTC to BC7 (BPTC) where possible"
This reverts commit 68ef895674.

When trying out transcode_astc=true with BPTC on Asphalt 9, we observed
very poor image quality - to the point that basic UI icons were blocky,
and buttons with a black border had smeared pixels on the edges.  Using
DXT5 had no such issues.

I originally suspected there was a bug in the BPTC encoder, but I now
believe the issue is deeper than that.  The commit that introduced the
encoder, 17cde55c53, says:

   "The compressor is written from scratch and takes a very simple
    approach.  It always uses a single mode of the BPTC format (4 for
    unorm and 3 for half-floats) and picks the two endpoints by dividing
    the texels into those which have more or less than the average
    luminance of the block and then calculating an average color of the
    texels within each division.

    It's probably not really sensible to try to use BPTC compression at
    runtime because for example with the Nvidia offline compression tool
    it can take in the order of an hour to compress a full-screen image.
    With that in mind I don't think it's worth having a proper compressor
    in Mesa and this approach gives reasonable results for a usage that
    is basically a corner case."

In other words, the reason our BPTC compressor was so fast is that it
only implements one of the modes and does a low quality approximation.
This honestly should probably be improved somewhat, but the original
use case was for online-compression, the uncommon but mandatory OpenGL
feature where you can supply uncompressed data and trust the driver to
compress it for you (at unknown and uncontrolled quality and speed).

Unfortunately, the compressor as it stands is simply not usable for
transcoding ASTC data where we want to preserve the underlying image
quality as much as possible.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16566>
(cherry picked from commit c54555c496)
2022-05-18 11:04:53 -07:00
Dylan Baker
e42164124f .pick_status.json: Mark b18448e7ac as backported 2022-05-18 11:04:51 -07:00
Dylan Baker
f743f0b451 .pick_status.json: Mark 5e4009fe6c as backported 2022-05-18 11:04:49 -07:00
Dylan Baker
84b62db7ed .pick_status.json: Mark 7aee9f12b9 as backported 2022-05-18 11:04:46 -07:00
Dylan Baker
3388defe64 .pick_status.json: Mark 9924fecee6 as backported 2022-05-18 11:04:43 -07:00
Dylan Baker
cb2fed99ad .pick_status.json: Mark 7057a36359 as backported 2022-05-18 11:04:42 -07:00
Dylan Baker
059a8627f3 .pick_status.json: Mark b6eec12327 as backported 2022-05-18 11:04:39 -07:00
Dylan Baker
f4201c1049 .pick_status.json: Mark 1c17502ab3 as backported 2022-05-18 11:04:36 -07:00
Dylan Baker
9ecbe45f37 .pick_status.json: Mark 07efe6f129 as backported 2022-05-18 11:04:31 -07:00
Kenneth Graunke
f8ca2e102e iris: Add FLUSH_HDC to PIPE_CONTROL_CACHE_FLUSH_BITS
This is considered a bottom-of-pipe flush bit.

Fixes: a969ad1ddf ("iris: Demote DC flush to HDC flush in cache tracker")
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16565>
(cherry picked from commit b8799a499e)
2022-05-18 11:04:28 -07:00
Dave Airlie
1c53c943f0 meson: add build-id to pipe libraries
Without this the cache setup was crashing with CL and the dynamic
pipe libraries.

Reported and debugged on irc by consolers

Cc: mesa-stable
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16341>
(cherry picked from commit 74976640b3)
2022-05-18 11:04:11 -07:00
Dylan Baker
45219933d0 .pick_status.json: Update to 29a8f1f03b 2022-05-18 11:04:08 -07:00
Mike Blumenkrantz
ea55add405 zink: fix non-dynamic vertex stride update flagging
without dynamic vertex input, pipeline vertex state must be recalculated
if buffer strides change or the enabled buffer mask changes in order
to accurately handle dynamic state stride VUs

cc: mesa-stable

fixes:
spec@!opengl 1.1@array-stride

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16563>
2022-05-17 22:45:37 -04:00
Mike Blumenkrantz
b7d48604c3 zink: handle PIPE_BUFFER sparse texture queries
this is legal but was never handled

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16563>
2022-05-17 22:45:36 -04:00
Mike Blumenkrantz
15c79f91c0 zink: clamp 1D_ARRAY sparse textures to 2D as needed
forgot to handle this case

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16563>
2022-05-17 22:45:36 -04:00
Mike Blumenkrantz
e3fb25dacb zink: force render target usage for sampler-only resources
these might hit u_blitter later, which will require rt usage
to handle texture views, so add rt usage now to avoid failing later

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16563>
2022-05-17 22:45:36 -04:00
Mike Blumenkrantz
d3642a5dc6 zink: fix surface/bufferview cache comparisons
these caches ignore pNext from the create info since the pNext cannot
affect the eventual object that is created, so comparing it will break
the hash table

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16563>
2022-05-17 22:45:36 -04:00
Mike Blumenkrantz
6c790f145d zink: add extended usage and retry if resource creation fails
this is one of those cases where some bizarro format is being created
for sampling only, but gallium blasts out all the bind flags at once

trust that we're not going to do anything too crazy and let surface
usage pruning handle the rest

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16563>
2022-05-17 22:45:36 -04:00
Mike Blumenkrantz
5bc14505a5 zink: remove input attachment usage when pruning surface usage
if the format doesn't support color attachment, it doesn't need to
be an input attachment

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16563>
2022-05-17 22:45:36 -04:00
Mike Blumenkrantz
73c79f3cc1 zink: add extra validation for resource creation
check image params against driver's returned limits to avoid
failing later

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16563>
2022-05-17 22:45:36 -04:00
Mike Blumenkrantz
4d27ca6402 zink: add separate error message for push descriptor set alloc fail
PRO triggers this if input attachments are used

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16563>
2022-05-17 22:45:36 -04:00
Mike Blumenkrantz
fcfbcd0053 zink: only reject non-blittable resource creation if it has no other binds
the idea here is that if a resource is intended to be used solely as a rendertarget
and can't be blitted to or drawn to, then resource creation should fail

but if the resource might be e.g., a texture, then it can probably hit the subdata
path and be fine

Fixes: 37ac8647fc ("zink: reject resource creation if format features don't match attachment")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16563>
2022-05-17 22:45:35 -04:00
xperia64
c3c6c221c7 wgl: Add driver_zink as a dependency of the wgl frontend
Fixes: 01ed71f945 ("wgl: support kopper")

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16569>
2022-05-17 22:45:35 -04:00
Mike Blumenkrantz
fa325e1527 zink: never create a sw context unless sw is requested
this otherwise makes it impossible to accurately do hardware driver
fallback, as zink will create a sw context instead of failing, superceding
the actual sw driver priorities

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16572>
2022-05-17 22:45:35 -04:00
Pierre-Eric Pelloux-Prayer
717d494d31 glx: set max values for pbuffer width / height
Without this change the values are always 0. This breaks
Maya which uses this value to create a pbuffer (and then
fails).

This commit is based on b91e1e38e8 which does the same
for EGL.

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16496>
(cherry picked from commit 8779a5b84c)
2022-05-17 10:27:32 -07:00
Mike Blumenkrantz
529c1c2b26 spirv: fix barrier scope assert
glslang generates barriers with QueueFamily, so this is totally legal

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16462>
(cherry picked from commit 8c8e6e953f)
2022-05-17 10:27:31 -07:00
Mike Blumenkrantz
9671505fe5 lavapipe: fix pipeline handling for dynamic render zs state with pipeline library
this is slightly more nuanced: if this is ONLY a fragment state,
pDepthStencilState must exist, but if it's BOTH fragment and output,
then pDepthStencilState must only exist if zs attachment is used

Fixes: d4d5a7abba ("lavapipe: implement EXT_graphics_pipeline_library")

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16457>
(cherry picked from commit 5f83571f92)
2022-05-17 10:27:30 -07:00
Mike Blumenkrantz
4776f076ec lavapipe: ignore depth/stencil states if attachment is not present
depth and stencil states should only be set if the corresponding attachment
is present, otherwise they should be ignored. this is different from
ignoring the entire VkPipelineDepthStencilStateCreateInfo struct, as
it's possible that only depth or only stencil may be present

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16457>
(cherry picked from commit 0b2d383316)
2022-05-17 10:27:30 -07:00
Dylan Baker
6319554a28 .pick_status.json: Update to 07eba9a15a 2022-05-17 10:27:26 -07:00
Marek Olšák
d6009c3fe9 radeonsi: fix a crash when failing to create a context
When shader_query_buffers is NULL, the code treated as as non-empty.

Fixes: 792a638b03 "radeonsi/gfx10: implement streamout-related queries"

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16466>
(cherry picked from commit 6515b3b2dc)
2022-05-16 10:05:17 -07:00
Mike Blumenkrantz
3642934612 zink: directly reuse surface ivci when rebinding
this is simpler and also fixes rebinding samplerviews which use
a levelCount > 1

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16508>
(cherry picked from commit ca915c871f)
2022-05-16 10:05:16 -07:00
Mike Blumenkrantz
8ddded8051 zink: fix 3d shader image miplevel calc for depth
without adjusting for miplevel here, the shader image might erroneously
be created as a 2d view and/or assert

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16508>
(cherry picked from commit fa3d51892a)
2022-05-16 10:05:16 -07:00
Mike Blumenkrantz
83c680e980 zink: stop leaking shader image surfaces
the code here was fine for checking the base resource unbinds and whatever,
but it never actually destroyed the surfaces/bufferviews created,
which meant they were always being leaked

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16508>
(cherry picked from commit 1526df283c)
2022-05-16 10:05:15 -07:00
Mike Blumenkrantz
16a9904e63 zink: copy incoming shader image struct after doing updates
no functional changes

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16508>
(cherry picked from commit 2df1c06168)
2022-05-16 10:05:14 -07:00
Mike Blumenkrantz
3b927d3e41 zink: read shader image r/w usage from incoming data struct
no functional changes

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16508>
(cherry picked from commit 32a77b1e25)
2022-05-16 10:05:14 -07:00
Mike Blumenkrantz
308af4a479 zink: simplify dumb update flagging in set_shader_images
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16508>
(cherry picked from commit a3dff53487)
2022-05-16 10:05:13 -07:00
Mike Blumenkrantz
78feb8286f zink: reuse local res pointer in set_shader_images
no functional changes

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16508>
(cherry picked from commit 22954b4860)
2022-05-16 10:05:12 -07:00
Mike Blumenkrantz
ca4352581b zink: remove refs from shader images
these have implicit refs from the surface/bufferview that gets created,
so adding a ref here is redundant and less performant

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16508>
(cherry picked from commit d0df488970)
2022-05-16 10:05:11 -07:00
Jason Ekstrand
f77526a3b8 nir: Preserve metadata if remove_dead_derefs makes no progress
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16482>
(cherry picked from commit c23b20d43a)
2022-05-16 10:05:11 -07:00
Dylan Baker
e8887c849d .pick_status.json: Update to 5c90eb1c53 2022-05-16 10:05:09 -07:00
Victor Hermann Chiletto
28264dd5c9 radv: always check entry count in descriptor pool when allocating
Previously this check was skipped for pools with
VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT unset, but after
96a240e1 we need to check this otherwise we risk overflowing
radv_descriptor_pool::entries into the host memory base

This fixes a crash to desktop when launching Dota 2, which overallocates
descriptor sets and expects an error to allocate another descriptor pool

Fixes: 96a240e176 ("radv: fix memory leak of descriptor set layout")

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16490>
(cherry picked from commit 580046e49f)
2022-05-13 10:06:04 -07:00
Marcin Ślusarz
2cca7dce1e anv: disable streamout before emitting mesh shading state
Fixes tests which use secondary command buffers.

Fixes: ef04caea9b ("anv: Implement Mesh Shading pipeline")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16493>
(cherry picked from commit aa1c128b54)
2022-05-13 10:06:04 -07:00
Marcin Ślusarz
d7ef4f99da anv: update task/mesh distribution with the recommended values
Fixes: ef04caea9b ("anv: Implement Mesh Shading pipeline")

Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16493>
(cherry picked from commit f083df8710)
2022-05-13 10:06:03 -07:00
Mike Blumenkrantz
aa9b7d349c zink: remove implicit query resets
this existed in order to reset query pools in advance so they
would never overflow. now the pools are reset every time the query
is started, so this behavior is no longer necessary

fixes #6475

Fixes: 57dd05616f ("zink/query: rewrite the query handling code to pass validation.")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16484>
(cherry picked from commit 1c62c6bafd)
2022-05-13 10:06:02 -07:00
Kenneth Graunke
a21fe41535 anv: Fix INTEL_DEBUG=bat on XeHP
We no longer emit STATE_BASE_ADDRESS in every batch on XeHP, so the
decoder might not know what the various base addresses are if it's only
looking at a single batch.  Fortunately, they also never change, so we
can just emit them once here.

On earlier platforms, initializing them here should be harmless.  We'll
emit STATE_BASE_ADDRESS if we change them, which will update these.

Thanks to Iván Briano for catching this.

Fixes: 8831cb38aa ("anv: Stop updating STATE_BASE_ADDRESS on XeHP")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16287>
(cherry picked from commit ad537edc7c)
2022-05-13 10:06:02 -07:00
Danylo Piliaiev
cdc27459bf tu: Fix indices of drm_msm_gem_submit_cmd when filling them
For some reason CTS doesn't trigger the issue...
When submit entry is not filled - kernel says:
 [drm:msm_ioctl_gem_submit] *ERROR* invalid type: 00000000

Fixes: dbae9fa7d8
("tu: implement sysmem vs gmem autotuner")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16474>
(cherry picked from commit 9a11ad7efd)
2022-05-13 10:06:01 -07:00
Samuel Pitoiset
87c98bed29 radv: disable DCC for Senra Kagura Shinovi Versus
To workaround an issue with feedback loops in D3D9 with DCC in GENERAL,
until we can fix it properly with a new extension.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6469
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16452>
(cherry picked from commit b5b2bcab54)
2022-05-13 10:06:01 -07:00
Jordan Justen
9c84a34361 intel/dev: Enable first set of DG2 PCI IDs
Mostly Matt Roper's kernel patch commit message:

The IDs added here are the subset reserved for 'motherboard down'
designs of DG2. We have all the necessary support upstream to enable
these now.

The remaining DG2 IDs for add-in cards will be enabled in a future
patch once some additional required functionality has fully landed.

Ref: https://patchwork.freedesktop.org/patch/msgid/20220425211251.77154-3-matthew.d.roper@intel.com
Cc: 22.1 <mesa-stable>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16449>
(cherry picked from commit ad565f6b70)
2022-05-13 10:06:00 -07:00
Jordan Justen
bb91ddce0b intel/dev: Add DG2 G12 PCI IDs
Ref: https://patchwork.freedesktop.org/patch/483381/?series=103098&rev=1
Ref: https://patchwork.freedesktop.org/patch/msgid/20220425211251.77154-3-matthew.d.roper@intel.com
Cc: 22.1 <mesa-stable>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16449>
(cherry picked from commit 99354efe31)
2022-05-13 10:05:59 -07:00
Jordan Justen
24626dca6b intel/dev: Add INTEL_PLATFORM_DG2_G12
Cc: 22.1 <mesa-stable>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16449>
(cherry picked from commit 4456209ce5)
2022-05-13 10:05:59 -07:00
Pierre-Eric Pelloux-Prayer
96eb5bbbb7 amd: fix ac_build_mbcnt_add in wave32 mode
add_src was ignored and i32_0 was always used.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Fixes: 1e49018ced ("amd: Add extra source to the mbcnt_amd NIR intrinsic.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16427>
(cherry picked from commit db2fd0ca83)
2022-05-13 10:05:58 -07:00
Pierre-Eric Pelloux-Prayer
caf526716b radeonsi: don't use wave32 for GE on gfx10 if culling is used
This is a workaround for issue #6457: it fixes the rendering and
prevent the hang but I can't explain why.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6457
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16427>
(cherry picked from commit 1f31564607)
2022-05-13 10:05:58 -07:00
Mike Blumenkrantz
9546233703 zink: fix sparse texture depth calcs for arrayed textures
use the array, not the depth

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16456>
(cherry picked from commit 1126f42781)
2022-05-13 10:05:57 -07:00
Mike Blumenkrantz
b03a2c10e4 zink: set sparse flag in cubemap lowering
Fixes: 2d745904ca ("zink: add a gently mangled version of the d3d12 cubemap -> array compiler pass")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16456>
(cherry picked from commit 56979182dd)
2022-05-13 10:05:56 -07:00
Mike Blumenkrantz
c85d45c884 zink: fix sparse binding for arrayed textures
this needs to set the arrayLayer, not the z offset

big thanks to Piers Daniell for catching this

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16456>
(cherry picked from commit 377f5e7af9)
2022-05-13 10:05:56 -07:00
Mike Blumenkrantz
41967c9107 zink: clamp out min_lod operands for explicit lod ops
this is illegal (and nonsensical)

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16456>
(cherry picked from commit 63dc39ac90)
2022-05-13 10:05:42 -07:00
Mike Blumenkrantz
2649b2c631 zink: fix up sparse texture sampling for shadow samplers
the problem here is that this returns a vec2 instead of a vec5, which
throws all the existing calculations off

given that the shader is (still) expecting a vec2 return from this,
and there's no way to sanely rewrite with nir to be valid for both
sampler types as well as spirv translation, just pad out to a vec2
here and be done with it

Fixes: 73ef54e342 ("zink: handle residency return value from sparse texture instructions")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16456>
(cherry picked from commit 88912b3111)
2022-05-13 10:05:37 -07:00
Danylo Piliaiev
1b28c52e44 pps: Open writable renderer node in DrmDevice::create
DrmDevice::create_all correctly opened the node with O_RDWR, while
DrmDevice::create was not, causing failure to create writable buffer.

Fixes pps-config on Freedreno.

Fixes: 1cc72b2aef
("pps: Gfx-pps v0.3.0")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16406>
(cherry picked from commit 6bf4ae002a)
2022-05-13 10:05:22 -07:00
Danylo Piliaiev
8a560a87b4 tu: Do not flush ccu in clear/blits during renderpass
For clear/blits ccu flush not only worse for perf, but also messes up
flush_bits when executed in a conditional set of commands.

We already don't flush for 3d blits.

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

Fixes: 487aa807bd
("tu: Rewrite flushing to use barriers")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16352>
(cherry picked from commit 187d3df52c)
2022-05-13 10:05:21 -07:00
Dylan Baker
60fa35a4df .pick_status.json: Mark 5a3aee78cb as denominated 2022-05-13 10:05:20 -07:00
Dylan Baker
b2cc7c5b43 .pick_status.json: Update to 57293dee2b 2022-05-13 10:05:18 -07:00
Dylan Baker
6fade22da9 VERSION: bump for 22.1.0-rc5 2022-05-10 22:03:46 -07:00
Dylan Baker
d25f388853 .pick_status.json: Mark 8c1d9c7b74 as denominated 2022-05-10 21:23:14 -07:00
Benjamin Cheng
b7366e6acb radv: fix memory leak of descriptor set layout
We need to be able to track the descriptor sets explicity to unref the
descriptor sets, otherwise these descriptor sets will not unref the
descriptor set layout it holds.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6222
Fixes: 66f7289d56
("radv: add reference counting for descriptor set layouts")

Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15741>
(cherry picked from commit 96a240e176)
2022-05-10 21:23:14 -07:00
Iván Briano
03d5e496d9 anv: re-alloc push constants after secondary command buffers
If the secondary command buffer executed used push constants on a
different set of stages than the primary is using, we may end up not
reallocating them for the primary, getting misrender artifacts at best,
or a nice GPU hang at worst.

Fixes the tests from a CTS from the future:
dEQP-VK.dynamic_rendering.random.*

Cc: mesa-stable

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16439>
(cherry picked from commit 2e46f38902)
2022-05-10 21:23:14 -07:00
Mike Blumenkrantz
0b90d3dc58 gallivm: fix oob txf swizzling
this wasn't taking into account the format swizzle, returning broken
alpha values in most cases

Fixes: 0b6554ba6f ("gallivm,llvmpipe: handle TXF (texelFetch) instruction, including offsets")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16137>
(cherry picked from commit f5caaf2d75)
2022-05-10 21:23:14 -07:00
Mike Blumenkrantz
8e84d6fded llvmpipe: always set ssbo data pointers for draw
skipping these would lead to reading the previously-set data if
a null buffer was set after a valid buffer

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16137>
(cherry picked from commit 6a219f318a)
2022-05-10 21:23:14 -07:00
Mike Blumenkrantz
c6e7e2977f gallivm/draw: fix oob ubo reads
the first case in gallivm did no checking, so this was always going to be
broken, so instead just copy the now-correct ssbo logic

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16137>
(cherry picked from commit f1d1371e51)
2022-05-10 21:23:14 -07:00
Mike Blumenkrantz
0c50ee124a st/draw_feedback: set constant buffer stride
these shaders all do float-based reads, so using vec4 for robustness
checks breaks gallivm

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16137>
(cherry picked from commit a51e83b74e)
2022-05-10 21:23:14 -07:00
Mike Blumenkrantz
f9cc403ebe lavapipe: fix CmdPushDescriptorSetWithTemplateKHR with refcounting
this is a cmdbuf function, which means it gets enqueued, which means
the template can't be destroyed until the cmdbuf has finished using it

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16137>
(cherry picked from commit 49df9eeb9d)
2022-05-10 21:23:14 -07:00
Mike Blumenkrantz
659e41fe79 gallivm: fix ssbo oob reads
this was checking (offset < size) when really it needs to be
(offset < size && extent < size && offset >= 0)

Fixes: 591899eedd ("gallivm/nir: Add a short circuit uniform-offset mode for load_ssbo/load_shared.")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16137>
(cherry picked from commit aa98a90265)
2022-05-10 21:23:14 -07:00
Georg Lehmann
e2c69cd976 nir/opt_algebraic: Fix mask in shift by constant combining.
The comment above is correct, but the code to calculate the mask was broken.

No Foz-db changes outside of noise.

Fixes: 0e6581b87d ("nir/algebraic: Reassociate shift-by-constant of shift-by-constant")
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15990>
(cherry picked from commit 66e917fff6)
2022-05-10 21:23:14 -07:00
Jason Ekstrand
3830fb9769 gallium/u_threaded_context: Use PIPE_MAX_SHADER_SAMPLER_VIEWS for sampler_buffers
Sampler views and samplers may not be the same limit; in fact one is 32
while the other is 128.  The sampler_buffers field is tracking sampler
views (yes, naming is confusing) so we should use the right limit.

Fixes: e9c41b3214 ("gallium/u_threaded: add buffer lists - tracking of buffers referenced by tc")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15988>
(cherry picked from commit 620c5e9dd0)
2022-05-10 21:23:14 -07:00
Icecream95
5b82328bbd pan/mdg: Fix multiple spilt writes in the same bundle
If two instructions in a single bundle both write to a spilt
destination, then we need to reuse the fill and spill instructions,
otherwise the value will be overwritten.

This and the rest of this set of Midgard bug fixes were found from a
vertex shader in Firefox WebRender that is used when a video is
clipped, for example by setting the border-radius CSS property.

CC: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16382>
(cherry picked from commit c65afe541b)
2022-05-10 21:23:14 -07:00
Icecream95
7c24f4fbc9 pan/mdg: Return the instruction from mir_insert_instruction_*_scheduled
We can't return a pointer to the bundle itself because it might move
about in memory.

CC: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16382>
(cherry picked from commit 7b9c976c2d)
2022-05-10 21:23:14 -07:00
Icecream95
7feaf6c548 pan/mdg: Fix mask usage when filling before a spill
Check the bytemask against 0xFFFF rather than 0xF so that the fill is
skipped for a .xyzw write rather than a .x write.

Set the mask on the store to 0xF when doing a read so that all
components are written back.

Fixes: 31d26ebf1b ("pan/mdg: Fill from TLS before spilling non-SSA nodes")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16382>
(cherry picked from commit c750ab8a38)
2022-05-10 21:23:14 -07:00
Icecream95
cf289ff969 pan/mdg: Use MAX2 to set min_alignment
If a value is written in a vector CSEL but then written again by other
instructions, it still needs full alignment, so set min_alignment
using MAX2 to avoid ever reducing it.

Fixes: 1798f6bfc3 ("pan/midgard: Fix masks/alignment for 64-bit loads")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16382>
(cherry picked from commit b281843974)
2022-05-10 21:23:14 -07:00
Icecream95
38ac16dbff pan/mdg: Keep min_bound at 16 when alignment requires it
Otherwise LCRA will try to divide by zero when calculating m_max.

Fixes: 553c2cf16b ("pan/mdg: Set RA bounds for fp16")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16382>
(cherry picked from commit b1ecb90941)
2022-05-10 21:23:14 -07:00
Lionel Landwerlin
9adf6d9d7e nir/lower_shader_calls: put inserted instructions into a dummy block
When moving code into the main block or loop blocks, put the code into
its own :

    if(true) { ... }

block so that we avoid break/continue/return issues.

v2: Also take care of the main block with return instructions

v3: Make deletion more obvious with dummy if blocks (Jason)

v4: Fixup assert for loops (Lionel)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 8dfb240b1f ("nir: Add raytracing shader call lowering pass.")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16036>
(cherry picked from commit 35d82ecf1e)
2022-05-10 20:30:36 -07:00
Lionel Landwerlin
34261b1084 nir/lower_shader_calls: don't insert code after break/continue
When moving code from below to the insertion cursor point, if the
cursor points to a jump instruction, don't bother inserting the code.
It would break the break/continue assumptions of NIR and would not be
executed anyway.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 8dfb240b1f ("nir: Add raytracing shader call lowering pass.")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16036>
(cherry picked from commit 9cf986dcff)
2022-05-10 20:30:36 -07:00
Lionel Landwerlin
a4189af168 nir/lower_shader_calls: don't use nop instructions as cursors
Stop using nop instructions which are causing issues with
break/continue, instead use a nir_cursor (which brings its share of
pain).

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 8dfb240b1f ("nir: Add raytracing shader call lowering pass.")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16036>
(cherry picked from commit 51dea59eb4)
2022-05-10 20:30:35 -07:00
Jason Ekstrand
29b1c19e6c nir/cf: Return a cursor from nir_cf_extract as well
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16036>
(cherry picked from commit 25661ea028)
2022-05-10 20:30:35 -07:00
Lionel Landwerlin
540fa4ecd7 nir/cf: return cursor after insertion of cf_list
This will be useful to cut code from one location and paste it at
another place and later keep pasting after the previous insertions.

v2: update comment (Jason)
    deal with stiching 2 empty blocks (Jason)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16036>
(cherry picked from commit d65cf403f3)
2022-05-10 20:30:35 -07:00
Thomas Debesse
7b8c243ae5 gallium/clover: pass -no-opaque-pointers to Clang
Clang opaque pointers have been enabled by default
but the Clover code currently expects them to be disabled.

Signed-off-by: Thomas Debesse <dev@illwieckz.net>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6342
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16129>
(cherry picked from commit 06e9607478)
2022-05-10 20:08:49 -07:00
Bas Nieuwenhuizen
287a776bed vulkan/wsi/x11: Ensure we have the required number of images for acquire.
For games that needs >1 at the same time the existing check wasn't enough.

Cc: mesa-stable
Reviewed-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15132>
(cherry picked from commit a7f44b6269)
2022-05-10 20:08:49 -07:00
Icecream95
f5707aae3c nir/lower_tex: Copy more fields in lower_tex_to_txd and friends
Fixes NIR validation errors for OpenMW on Panfrost.

Fixes: 1f97819fbe ("panfrost: Emulate GL_CLAMP on Bifrost")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15939>
(cherry picked from commit ad864a7c15)
2022-05-10 20:08:48 -07:00
Chia-I Wu
a068671262 anv: advertise rectangularLines only for Gen10+
We use the non-strict algorithm (with parallelograms) prior to Gen10 for
wide lines.  We can not advertise rectangularLines.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Fixes: f6e7de41d7 ("anv: Implement VK_EXT_line_rasterization")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15432>
(cherry picked from commit b2b810ebff)
2022-05-10 20:08:47 -07:00
Mike Blumenkrantz
07a7306d81 util/blitter: fix sampler restore with 0 saved samplers
in a sequence where a driver saves 0 sampler/views before calling
u_blitter, the previous state of having 0 sampler/views bound would
not be restored as expected, resulting in stale sampler/views which
could affect behavior before new sampler/views were bound

cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16178>
(cherry picked from commit 38ab178c4a)
2022-05-10 20:08:47 -07:00
Dylan Baker
9d05943813 .pick_status.json: Mark 8daf8ff730 as backported 2022-05-10 20:08:36 -07:00
Dylan Baker
32c596ef90 .pick_status.json: Mark 8b28d1751c as backported 2022-05-10 20:08:35 -07:00
Dylan Baker
215b28f5df .pick_status.json: Mark ae369e9f6d as backported 2022-05-10 20:08:33 -07:00
Dylan Baker
aef2c5cb70 .pick_status.json: Mark 0e49ef5c9f as backported 2022-05-10 20:08:31 -07:00
Dylan Baker
da84a8ffe7 .pick_status.json: Mark 9a412c10b7 as backported 2022-05-10 20:08:29 -07:00
Dylan Baker
4b6b9e1889 .pick_status.json: Mark 5ff3fa5912 as backported 2022-05-10 20:08:26 -07:00
Dylan Baker
7533fc00df .pick_status.json: Mark 6317f88b04 as backported 2022-05-10 20:08:26 -07:00
Dylan Baker
00e217bf2e .pick_status.json: Update to 14b1ed1ce1 2022-05-10 20:07:24 -07:00
Mike Blumenkrantz
be08a23dc0 zink: ci regressions 2022-05-10 22:12:31 -04:00
Mike Blumenkrantz
0be76e7ec1 zink: semi-handle 1D sparse texture rewrites for drivers that don't support them
nvidia can't do this, but also nothing uses it, so I've gone ahead and
done the bare minimum here to make cts pass

I think the work to do the shader rewrites should be easy, but without a test
case, I see no point in spending the time for it

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16100>
2022-05-10 21:45:27 -04:00
Mike Blumenkrantz
2493985aae zink: bump number of image binds that can be batched to 50
this is big enough to batch all the cts binds into a single submit

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16100>
2022-05-10 21:45:27 -04:00
Mike Blumenkrantz
7e0055e4a0 zink: fix multisample conditional in sparse image query
you stare at the code for so long without truly seeing it

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16100>
2022-05-10 21:45:27 -04:00
Mike Blumenkrantz
d26843de8b zink: set all usage flags when querying sparse features
they're allocated through TexStorage, so they can do everything

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16100>
2022-05-10 21:45:27 -04:00
Mike Blumenkrantz
e40dd33d1a zink: pass sparse bind bo offset through for texture binds
should fix partial binding with textures

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16100>
2022-05-10 21:45:27 -04:00
Mike Blumenkrantz
a0771d809e zink: pass sparse backing page offset to binding function
this is the offset of the memory block being bound

cc: mesa-stable

fixes:
KHR-GL46.sparse_buffer_tests.BufferStorageTest

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16100>
2022-05-10 21:45:27 -04:00
Mike Blumenkrantz
7b0d367735 zink: create images with modifiers any time there is an import handle
there's no way to pass in a plane offset otherwise, so this is necessary
in order to handle yuv imports

Reviewed-by: Dave Airlie <airlied@redhat.com>
2022-05-10 21:45:27 -04:00
Mike Blumenkrantz
1ed9c24fb9 zink: rebind resources for export as needed
exporting all resources breaks suballocation, so instead just use the
existing heuristics and then forcibly rebind resources as needed
for this functionality

Reviewed-by: Dave Airlie <airlied@redhat.com>
2022-05-10 21:45:27 -04:00
Mike Blumenkrantz
77127ce4ae zink: add a LINEAR drm modifier if rebinding to add dmabuf export
this needs to have some kind of modifier, so be conservative here

Reviewed-by: Dave Airlie <airlied@redhat.com>
2022-05-10 21:45:27 -04:00
Mike Blumenkrantz
0c9f8d3d05 zink: force memory exports if dmabuf bind is specified
Reviewed-by: Dave Airlie <airlied@redhat.com>
2022-05-10 21:45:27 -04:00
Mike Blumenkrantz
93d28694ce zink: fix conditional for modifier usage
the shared check here was inaccurate; if the resource has dmabuf
export, then use modifiers

Reviewed-by: Dave Airlie <airlied@redhat.com>
2022-05-10 21:45:27 -04:00
Mike Blumenkrantz
c425166bc9 zink: add a bind flag to indicate a resource is exported as a dmabuf
Reviewed-by: Dave Airlie <airlied@redhat.com>
2022-05-10 21:45:27 -04:00
Mike Blumenkrantz
3d82b71516 zink: unset pipe_resource::next pointers when creating resource copies
this otherwise walks the chain and destroys all the resources

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
2022-05-10 21:45:27 -04:00
Mike Blumenkrantz
1e2b6e131e zink: always check for fb rebinds when starting renderpass
ensure the right image is being used

Reviewed-by: Dave Airlie <airlied@redhat.com>
2022-05-10 21:45:27 -04:00
Mike Blumenkrantz
d3095f5cf0 Revert "zink: export fd info for all 2d images"
This reverts commit fda7371b4cfc5a15f2207f5165f3a8e14442a522.

this breaks suballocation

Reviewed-by: Dave Airlie <airlied@redhat.com>
2022-05-10 21:45:27 -04:00
Mike Blumenkrantz
2c529a9ab9 zink: create a copy context for the screen on init
Reviewed-by: Dave Airlie <airlied@redhat.com>
2022-05-10 21:45:27 -04:00
Mike Blumenkrantz
89d94335e4 zink: introduce copy contexts
this is for creating a context which is only used for copying images

Reviewed-by: Dave Airlie <airlied@redhat.com>
2022-05-10 21:45:27 -04:00
Mike Blumenkrantz
907c1bab60 zink: break out resource bind-adding into separate function for reuse
Reviewed-by: Dave Airlie <airlied@redhat.com>
2022-05-10 21:45:27 -04:00
Mike Blumenkrantz
2920e0d843 zink: add a flag to indicate whether a resource is exportable
Reviewed-by: Dave Airlie <airlied@redhat.com>
2022-05-10 21:45:27 -04:00
Mike Blumenkrantz
d39eafe93d zink: outdent some code
Reviewed-by: Dave Airlie <airlied@redhat.com>
2022-05-10 21:45:27 -04:00
Mike Blumenkrantz
5068d98157 zink: remove unused headers/struct members/linkage
Reviewed-by: Dave Airlie <airlied@redhat.com>
2022-05-10 21:45:27 -04:00
Mike Blumenkrantz
6f0a7ae37b kopper: remove unused zink include
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16441>
2022-05-10 21:45:27 -04:00
Mike Blumenkrantz
ca9c3ece53 zink: use descriptor surfaces for notemplates ref updating
basically the same codepath as samplerviews now, and fixes
some issues with invalid mem access

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16167>
2022-05-10 21:45:19 -04:00
Mike Blumenkrantz
efc5ecee9c zink: add more image usage for null surfaces
without null descriptor features, these can be used for all sorts of things

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16167>
2022-05-10 21:21:04 -04:00
Mike Blumenkrantz
f8fc9d4c09 zink: fix null buffer/surface formats
4-component formats are needed here in order to return the correct
alpha value in invalid load scenarios

cc: mesa-stable

fixes:
spec@arb_shader_image_load_store@invalid

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16167>
2022-05-10 21:21:04 -04:00
Mike Blumenkrantz
0ffaf1002d lavapipe: enqueue pipeline destruction
this avoids races in llvmpipe related to modification of per-context shader
variant lists, which causes massive amounts of flakiness in ci

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16331>
2022-05-10 21:20:57 -04:00
Mike Blumenkrantz
331bc00d77 llvmpipe: never infer early zs tests when fbfetch is active
this breaks zs fbfetch

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16346>
2022-05-10 21:20:51 -04:00
Mike Blumenkrantz
76ca02ff7b nir/gather_info: flag fbfetch on subpass image loads
might not be able to determine which output is being read, but these
are definitely fbfetch uses (from lavapipe)

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16346>
2022-05-10 21:20:51 -04:00
Mike Blumenkrantz
8b806828ad kopper: pass the current context to dri_flush
passing the drawable's context leads to desync and crashing if the app
is using multiple threads and multiple contexts

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16351>
2022-05-09 14:19:37 -04:00
Mike Blumenkrantz
ef86acd25c kopper: invalidate drawables when resizing textures in place
this guarantees that swapchains shared between contexts will stay
in sync

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16351>
2022-05-09 14:19:37 -04:00
Georg Lehmann
b78272daa5 wsi/x11: Don't leak xcb_get_geometry_reply_t.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6443
Fixes: 44a20baeb8 ("wsi/x11: Avoid using xcb_wait_for_special_event in FIFO modes")
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16384>
2022-05-09 14:18:47 -04:00
Samuel Pitoiset
45cbab0442 radv: disable instance packing to fix pipeline query stats
RDNA2 is affected by a hardware bug when instance packing is enabled
for adjacent primitive topologies and instance_count > 1, pipeline
stats generated by GE are incorrect. It needs to be applied for
indexed and non-indexed draws.

This is based on PAL waDisableInstancePacking.

This fixes KHR-GL46.pipeline_statistics_query_tests_ARB.* with Zink.

Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6257
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15877>
(cherry picked from commit 9348620946)
2022-05-05 11:13:09 -07:00
Dylan Baker
718a8223ff .pick_status.json: Update to 17c98393f9 2022-05-05 11:13:08 -07:00
Mike Blumenkrantz
b929e21fbe lavapipe: lower quad_broadcast intrinsics
not supported by gallivm

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16301>
2022-05-05 14:05:37 -04:00
Adam Jackson
b312721d87 egl/kopper: Hook up eglSwapInterval
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15800>
2022-05-05 14:05:37 -04:00
Adam Jackson
cbc697d2d6 glx/kopper: Enable GLX_EXT_swap_control etc.
This requires newly tracking the max swap interval since kopper can't do
abs(interval) > 1 yet.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15800>
2022-05-05 14:05:37 -04:00
Adam Jackson
533117777f kopper: Grow a swap interval API
We take a slight liberty here by allowing 0 to mean either MAILBOX or
IMMEDIATE, since Wayland (at least) doesn't have a true IMMEDIATE mode
at least MAILBOX won't throttle to vblank.

This only correctly handles intervals of 0 or 1 at the moment.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15800>
2022-05-05 14:05:37 -04:00
Mike Blumenkrantz
f96b0d640b zink: add supported present modes to kopper displaytarget
for use later

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16193>
2022-05-05 14:05:36 -04:00
Adam Jackson
f857eed827 wsi/x11: Avoid using xcb_wait_for_special_event in FIFO modes
If the window is destroyed from underneath us while we happen to be in
xcb_wait_for_special_event, there's no recovery. The special event will
never match because the XID is no longer valid, and Present doesn't have
an in-band DestroyNotify. We're going to work around this by using the
poll API instead. If we get an event we short-circuit back to the top of
the "wait for available image" loop, so we drain the whole special event
queue before any other logic. Which means if we run out of special
events (and the connection and swapchain are still valid) that we
_don't_ have enough images available, so to hurry along any events that
the X server hasn't flushed out yet we call GetGeometry on the
swapchain's window. As a side effect this verifies that the window is
still alive.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15800>
2022-05-05 13:56:43 -04:00
Jason Ekstrand
aab9d6df50 vulkan/wsi: Set the right stage flags for semaphore waits
This is currently technically broken for compute.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16333>
(cherry picked from commit 233be8ee59)
2022-05-04 16:05:57 -07:00
Lionel Landwerlin
ca8af9c529 anv: remove static_state_mask
This is now unnecessary. Either an instruction is never dynamic and
it's emitted in genX_pipeline.c or it can be and it's emitted in
genX_cmd_buffer.c/gfx8_cmd_buffer/gfx7_cmd_buffer.c

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16220>
(cherry picked from commit 797a8850b9)
2022-05-04 16:05:53 -07:00
Lionel Landwerlin
5346b6aac4 anv: don't emit 3DSTATE_VF_TOPOLOGY in pipeline batch
v2: drop primitive_topology = 0xffffffff (Tapani)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16220>
(cherry picked from commit 74a27a6ccb)
2022-05-04 16:05:46 -07:00
Lionel Landwerlin
1cd83f0311 anv: don't emit 3DSTATE_DEPTH_BOUNDS in pipeline batch
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16220>
(cherry picked from commit 48229d11ba)
2022-05-04 16:05:38 -07:00
Lionel Landwerlin
0dcd1ac226 anv: don't emit 3DSTATE_BLEND_STATE_POINTERS in pipeline batch
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16220>
(cherry picked from commit 76e735d09c)
2022-05-04 16:05:31 -07:00
Lionel Landwerlin
265351f03f anv: don't emit 3DSTATE_WM in pipeline batch
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16220>
(cherry picked from commit e9d000a831)
2022-05-04 16:05:23 -07:00
Lionel Landwerlin
5eadf0d634 anv: don't emit 3DSTATE_STREAMOUT in pipeline batch
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16220>
(cherry picked from commit 065242d623)
2022-05-04 16:05:15 -07:00
Lionel Landwerlin
579a90e3c4 anv: never emit 3DSTATE_CPS in the pipeline batch
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16220>
(cherry picked from commit ce8bb29342)
2022-05-04 16:05:03 -07:00
Lionel Landwerlin
c4fac8fbbe anv: rework sample location
On Gfx7 we can only give the sample location for a given multisample
number. This means everytime the multisampling value changes, we have
to re-emit the locations. It's fine because it's also where
(3DSTATE_MULTISAMPLE) the number of samples is stored.

On Gfx8+ though, 3DSTATE_MULTISAMPLE only holds the number of samples
and all the sample locations for all number of samples are located in
3DSTATE_SAMPLE_PATTERN. So to be more effecient there, we need to
track the locations for all sample numbers and compare new values with
the relevant sample count when touching the dynamic state.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16220>
(cherry picked from commit 168b13364f)
2022-05-04 16:04:51 -07:00
Lionel Landwerlin
218b619ab2 Revert "anv: fix dynamic state emission"
This reverts commit f348103fce. The
change was causing performance regressions.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16220>
(cherry picked from commit 810518fda7)
2022-05-04 16:04:41 -07:00
Lionel Landwerlin
ebb13496c4 anv: add missing logic op set in pipeline dyn state
v2: add ANV_CMD_DIRTY_DYNAMIC_LOGIC_OP check (Tapani)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 75ad0e4b08 ("anv: support blending logic op dynamic state")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16220>
(cherry picked from commit 69e6417e19)
2022-05-04 16:04:36 -07:00
Lionel Landwerlin
96202a0fab anv: reset all dynamic state after secondary execution
We don't know in what state the secondary buffer will leave the HW
when it ends. It's easier to consider everything needs to be reemitted
for now.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16220>
(cherry picked from commit 5048f15737)
2022-05-04 16:04:36 -07:00
Samuel Pitoiset
e5225e485d radv: re-emit dynamic line stipple state if the primitive topology changed
The dynamic primitive topology could change from LINE_LIST to
LINE_STRIP for example and the stipple state depends on this.

Found by inspection.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16295>
(cherry picked from commit f5cffbb8df)
2022-05-04 16:04:09 -07:00
Rhys Perry
aaba210881 aco/ra: fix vgpr_limit
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Fixes: b98a4d4dd7 ("aco: refactor GPR limit calculation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16297>
(cherry picked from commit 1b639a0ce5)
2022-05-04 16:04:09 -07:00
Alyssa Rosenzweig
b465069b74 nir: Don't set writes_memory for reading XFB
That's a read, not a write. Fixes optimizations getting disabled for fragment
shaders when linked with a shader producing transform feedback varyings.

Fixes: 85a723975b ("nir: add and gather shader_info::writes_memory")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16285>
(cherry picked from commit ca280b2283)
2022-05-04 16:04:09 -07:00
Marek Olšák
ae44b3365f ac/llvm: set the correct cache policy for sparse buffer loads
The DLC bit was missing on gfx10.

Fixes: 6d5e26752c "ac/nir: implement sparse image/texture loads"
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16215>
(cherry picked from commit 0cd59c7cb0)
2022-05-04 16:04:01 -07:00
Dylan Baker
f936ff8631 .pick_status.json: Update to 7f91e8fad9 2022-05-04 16:03:58 -07:00
Dylan Baker
fffad80496 VERSION: bump for 22.1.0-rc4 release 2022-05-04 10:05:06 -07:00
Mike Blumenkrantz
9c0b009335 wgl: don't auto-load zink before software drivers
as in glx/egl, zink+lavapipe should only load if explicitly selected

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16311>
2022-05-04 08:37:10 -04:00
Mike Blumenkrantz
df09d2a0ba wgl: always set alpha on kopper windows
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16153>
2022-05-04 08:36:15 -04:00
Autumn on Tape
6447169dee gallivm: use VPERMPS (x86/AVX2) for 32-bit 8-element shuffles
Signed-off-by: Autumn on Tape <autumn@cyfox.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13671>
2022-05-04 08:35:29 -04:00
Autumn on Tape
a5e133250f gallivm: use shufflevector for shuffles when index is constant data
This checks if index is a ConstantAggregateZero, ConstantDataSequential,
or UndefValue and emits a single shufflevector instead of a loop if so.

Signed-off-by: Autumn on Tape <autumn@cyfox.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13671>
2022-05-04 08:35:29 -04:00
Autumn on Tape
fdb6bb31af lavapipe: enable subgroup shuffle operations
Bits flipped in VkPhysicalDeviceSubgroupProperties.supportedOperations:
  * SUBGROUP_FEATURE_SHUFFLE_BIT
  * SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT

Signed-off-by: Autumn on Tape <autumn@cyfox.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13671>
2022-05-04 08:35:29 -04:00
Autumn on Tape
2613cd4b8d gallivm: add subgroup shuffle support
Signed-off-by: Autumn on Tape <autumn@cyfox.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13671>
2022-05-04 08:35:28 -04:00
Lionel Landwerlin
381ec467db anv: fix invalid utrace memcpy l3 config on gfx < 11
device->l3_config is only valid on Gfx11+

This only fixes using GPU_TRACE=1

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 02a4d622ed ("anv: expose a couple of emit helper to build utrace buffer copies")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16291>
(cherry picked from commit 4efc997472)
2022-05-03 09:41:32 -07:00
Mike Blumenkrantz
9b60b2ecdc llvmpipe: disable compute statistics queries if queries are disabled
cc: mesa-stable

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16278>
(cherry picked from commit 4a4adb65ce)
2022-05-03 09:41:32 -07:00
Mike Blumenkrantz
d9219c0ee6 llvmpipe: disable statistic queries during draw if queries are disabled
cc: mesa-stable

fixes (zink):
spec@ext_transform_feedback@generatemipmap prims_generated

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16278>
(cherry picked from commit a36c3f6f6a)
2022-05-03 09:41:32 -07:00
Daniel Schürmann
965bdf7db2 aco/ra: fix live-range splits of phi definitions
It could happen that at the time of a live-range split,
a phi was not yet placed in the new instruction vector,
and thus, instead of renamed, a new phi was created.

Fixes: dEQP-VK.subgroups.ballot_broadcast.compute.subgroupbroadcast_i8vec2
Cc: mesa-stable

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16248>
(cherry picked from commit 58bd9a379e)
2022-05-03 09:41:32 -07:00
Konstantin Seurer
bedc452f8b ac/nir: Do not set cursor in try_extract_additions
Fixes: 61ac5ac ("radv,ac/nir: lower global access to _amd global access intrinsics")
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16270>
(cherry picked from commit d639608b8b)
2022-05-03 09:41:32 -07:00
Timothy Arceri
a9d2d3b0b7 nir: fix sorting before assigning varying driver locations
We need to make sure we also properly sort varyings sharing a single
slot otherwise we can end up assigning earlier components to the next
slot if we have already processed later components.

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

Fixes: 1e93b0caa1 ("mesa/st: add support for NIR as possible driver IR")

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16208>
(cherry picked from commit 180398f785)
2022-05-03 09:41:32 -07:00
Chia-I Wu
9febc11af9 util: Keep quiet NaNs quiet when converting to half float.
We don't want to be throwing exceptions and changing float values later by
emitting a signaling binary16 nan.

If we don't do this, then when we convert back to f32 in NIR constant
expression evaluation, the signaling NaN can end up giving NaN for
fmax(NaN, 0.0), instead of 0.0.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5933
Cc: mesa-stable
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16233>
(cherry picked from commit 27e33d5c96)
2022-05-03 09:41:32 -07:00
Lionel Landwerlin
d29fe64c7e iris: use new kernel uAPI to compute video memory
v2: Use os_get_available_system_memory() when kernel memory region
    uAPI is not available (Lionel)

Cc: 22.1 <mesa-stable>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16210>
(cherry picked from commit acf6bf88c0)
2022-05-03 09:41:32 -07:00
Iván Briano
d9083cff8e vulkan/wsi/wayland: Fix double free on error condition
If wsi_configure_native_image() fails, it will call
wsi_destroy_image_info() itself, so let's try to not call it again from
wsi_wl_swapchain_destroy().

Fixes the CTS tests:
dEQP-VK.wsi.wayland.swapchain.simulate_oom.*

Fixes: b626a5be43 ("vulkan/wsi/wayland: Split image creation")

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16257>
(cherry picked from commit bf04be17f7)
2022-05-03 09:41:32 -07:00
Dylan Baker
52ab0ca9b0 .pick_status.json: Update to 575068a165 2022-05-03 09:41:32 -07:00
Jordan Justen
ae7c0db4b3 intel_dev_info: Add --hwconfig command line parameter
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
(cherry picked from commit de99a11172)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16231>
2022-05-02 11:35:31 -07:00
Jordan Justen
b29e15e515 intel/dev: Read hwconfig from i915
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
(cherry picked from commit d9ff9ea9c3)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16231>
2022-05-02 11:35:31 -07:00
Dave Airlie
5949ead315 llvmpipe: add user memory resources to the debug global list.
Otherwise things will crash on destruction.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fixes: 9a57dceeb7 ("llvmpipe: add support for user memory pointers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16207>
(cherry picked from commit b4bbf9d1ac)
Signed-off-by: Dylan Baker <dylan.c.baker@intel.com>

Staging changes (Dylan)
  - port back from u_list to simple_list for the stable branch
2022-05-02 10:55:06 -07:00
Icecream95
4046230c13 pan/bi: Use texture index instead of sampler for message preloading
The VAR_TEX definition in ISA.xml only has a field for texture_index,
so trying to read sampler_index will return zero; read from
texture_index instead, and rename other fields for consistency.

The texture and sampler indices must be equal for VAR_TEX to be used,
so either name could be used for the field.

Fixes the wrong textures being used in Thief.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6219
Fixes: eb1479bda2 ("pan/bi: Support message preloading")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16255>
(cherry picked from commit 2864094f69)
2022-05-02 10:46:41 -07:00
Gert Wollny
01345ad5e9 r600: Allow eight bit, three channel formats for vertex buffers
While using three component texture formats results in CTs failures,
three component vertex attributes are fine, and not allowing them
results in significant performance regressisons.

Fixes: e41958e344
   r600: Disable eight bit three channel formats

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

v2: rename function to is_buffer_format_supported (Emma)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16267>
(cherry picked from commit 4a2ff9eb86)
2022-05-02 10:46:40 -07:00
Lionel Landwerlin
9fdb834853 anv: fix clflush usage on utrace copy batch
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: cc5843a573 ("anv: implement u_trace support")
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15780>
(cherry picked from commit 44e93b4c6f)
2022-05-02 10:46:40 -07:00
Francisco Jerez
2f286bfef5 intel/dev: Compute pixel pipe information based on geometry topology DRM query.
This changes the intel_device_info calculation to call an additional
DRM query requesting the geometry topology from the kernel, which may
differ from the result of the current topology query on XeHP+
platforms with compute-only and 3D-only DSSes.  This seems more
reliable than the current guesswork done in intel_device_info.c trying
to figure out which DSSes are available for the render CS.

Cc: 22.1 <mesa-stable>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14143>
(cherry picked from commit 14cad38b19)
2022-05-02 10:46:39 -07:00
Emma Anholt
d6accbe040 nouveau/nir: Move FS output stores to the end of the last block.
The nir_move/sink caused instructions to sink interleaved into the output
stores at the end of the shader.  nouveau's RA doesn't track liveness of
FS outputs in registers after the export instruction, so they could end up
overwritten.  To work around it, after normal NIR move/sink, move the
output stores back to the end of the shader.

Fixes: b1fa2068b8 ("nouveau/nir: Enable nir_opt_move/sink.")

Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15949>
(cherry picked from commit 3ddc505400)
2022-05-02 10:46:38 -07:00
Erik Faye-Lund
9b6b1445f7 mesa: add missing error-path
The ARB_shader_objects spec says the following:

> The error INVALID_VALUE is generated by any command that takes one or
> more handles as input, and one or more of these handles are not an
> object handle generated by OpenGL.

And a long, long time ago, we used do to just that for
glDeleteObjectARB... Until 9ac9605de1, all the way back in February 2006,
where the error condition was removed without explanation.

Let's restore it, because it should really be there.

This was noticed by running the tests that are in the mesa-demos
repository, that actually tested this condition.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16211>
(cherry picked from commit ba9c917149)
2022-05-02 10:46:38 -07:00
Erik Faye-Lund
85065859a2 gallium/xlib: fix stale comment
We haven't been doing what the comment says for about a decade, it's
about time to update the comment!

Fixes: 5f60a00743 ("st/glx: remove STENCIL_BITS, DEFAULT_SOFTWARE_DEPTH_BITS")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16213>
(cherry picked from commit 82b681db99)
2022-05-02 10:46:37 -07:00
Erik Faye-Lund
5d41d82a6f meson: remove unused defines
These defines are no longer used since we removed libmesa_classic.

Fixes: e030d5ba8a ("mesa: Delete libmesa_classic")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16213>
(cherry picked from commit 36250e839b)
2022-05-02 10:46:37 -07:00
Jordan Justen
33c3034765 iris: Fix assertion meant to only target the clear-color stride
Fixes: 2bc8c61fd0 ("iris: Return a 64B stride for clear color plane")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6398
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16241>
(cherry picked from commit 33456ae5a4)
2022-05-02 10:46:36 -07:00
Jesse Natalie
ebc9a11318 microsoft/compiler: Unload DXIL validator library *after* calling Release()
Otherwise, the code to actually run Release() might not be loaded or
callable anymore.

Fixes: 193cf76c ("microsoft/compiler: add common dxil-validator API")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16225>
(cherry picked from commit ab9d649ac3)
2022-05-02 10:46:35 -07:00
Juan A. Suarez Romero
40867789ec mesa: unref syncobj after wait_sync
Before returning the wait_sync() function, the sync object must be
unreferenced.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6377
Fixes: 0af7c1e385 ("mesa/st: merge the syncobj code from st into mesa")
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16242>
(cherry picked from commit a47375d4da)
2022-05-02 10:46:35 -07:00
Gert Wollny
421e4d445a virgl: don't move input gl_SampleMaskIn to a temp
The input is an array so moving it to a single temporary value doesn't
seem to make much sense. I also don't see any piglit regressions when
not moving the value to a temporary.

Fixes: bc912bace1
  virgl: Add workarounds for virglrenderer input/sv signedness bugs.

v2: remove unused enum for SAMPLEMASK (Emma)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15997>
(cherry picked from commit 89bba41d90)
2022-05-02 10:46:34 -07:00
Dave Airlie
238b018789 vulkan/wsi: keep allocate queue families in image, just don't fill them
This changes the code so that it only looks at the passed in families
when concurrent, otherwise it always allocates one.

Fixes: 48b3ef625e ("vulkan/wsi: handle queue families properly for non-concurrent sharing mode.")
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Tested-by: Mike Lothian <mike@fireburn.co.uk>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15331>
(cherry picked from commit 85a94be0fe)
2022-05-02 10:46:34 -07:00
Nanley Chery
d45ccc05f1 isl,iris: Add DG2 CCS modifier support for XeHP
Cc: 22.1 <mesa-stable>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14521>
(cherry picked from commit b023f18bad)
2022-05-02 10:46:33 -07:00
Nanley Chery
21753f734e intel/isl: Add a score for I915_FORMAT_MOD_4_TILED
Enables the modifier in anv.

Cc: 22.1 <mesa-stable>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14521>
(cherry picked from commit a53abeb7fb)
2022-05-02 10:46:32 -07:00
Anuj Phogat
2385ca720b isl,iris: Add I915_FORMAT_MOD_4_TILED support for XeHP
This patch adds Tile 4 modifier support to Mesa and allows Mesa to
use Tile 4 on gen12-hp with GBM.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: 22.1 <mesa-stable>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14521>
(cherry picked from commit ac441d0953)
2022-05-02 10:46:32 -07:00
Anuj Phogat
fa4ad4f679 include/uapi: Update drm_fourcc.h from kernel
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>

v2. Pull in the header from drm-next at commit
    9035039e1ed691cd893777a42e048003a2f349d6

Cc: 22.1 <mesa-stable>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14521>
(cherry picked from commit acba3efe69)
2022-05-02 10:46:31 -07:00
Nanley Chery
51ddb36a2d iris: Return a 64B stride for clear color plane
Although modifiers which use a clear color plane specify that the
plane's pitch should be ignored, some kernels have been found to require
64-byte alignment.

Cc: mesa-stable
Fixes: db475c81b7 ("iris: Return non-zero stride for clear color plane")
Reported-by: Dongwon Kim <dongwon.kim@intel.com>
Suggested-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14521>
(cherry picked from commit 2bc8c61fd0)
2022-05-02 10:46:30 -07:00
Dylan Baker
d630f852b9 .pick_status.json: Mark c025cb9ee9 as backported 2022-05-02 10:46:29 -07:00
Dylan Baker
0542f4ab03 .pick_status.json: Update to 2505afc430 2022-05-02 10:44:30 -07:00
Mike Blumenkrantz
1d33c5a2fc zink: remove drm_fd
no longer used

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16226>
2022-04-28 21:53:00 -04:00
Mike Blumenkrantz
69c861ad58 zink: ignore KMS handle types
who could've guessed that such a thing was possible

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16226>
2022-04-28 21:53:00 -04:00
Mike Blumenkrantz
e45737c9eb zink: export fd info for all 2d images
there's no way to add this later, so here we go

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16226>
2022-04-28 21:53:00 -04:00
Mike Blumenkrantz
9f02b52ba2 zink: fix dmabuf plane returns
use the actual drm format plane count, not the resource format

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16226>
2022-04-28 21:53:00 -04:00
Mike Blumenkrantz
f2d04b4fe9 kopper: implement texture-from-pixmap for software (non-dmabuf)
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16190>
2022-04-28 21:53:00 -04:00
Mike Blumenkrantz
e0bf9a7ea8 kopper: rename a confusing variable
is_pixmap is defined in kopper_allocate_textures() as being (!window && x11),
which is very different from this check, which determines whether the drawable
is a window

so rename it to keep things consistent

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16190>
2022-04-28 21:53:00 -04:00
Mike Blumenkrantz
6993615047 kopper: check whether zink is using sw
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16190>
2022-04-28 21:53:00 -04:00
Mike Blumenkrantz
8fb66e77e2 zink/kopper: add a function for determining if running on software
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16190>
2022-04-28 21:53:00 -04:00
Mike Blumenkrantz
9b872cc3a5 kopper: check for modifiers to use modifier functionality
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16190>
2022-04-28 21:53:00 -04:00
Mike Blumenkrantz
721f054bae kopper: add some error logging for pixmap->texture failure
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16190>
2022-04-28 21:53:00 -04:00
Adam Jackson
e8d1650625 glx/kopper: Wire up a way for SwapBuffers to fail
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16038>
2022-04-28 21:53:00 -04:00
Mike Blumenkrantz
c9f29c22b8 zink/kopper: add a mechanism for checking swapchain status
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16038>
2022-04-28 21:52:59 -04:00
Mike Blumenkrantz
0d4b79d111 zink: flag swapchain resources as swapchains
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16038>
2022-04-28 21:52:59 -04:00
Mike Blumenkrantz
2096db8aad zink: handle swapchain acquire failures more directly
if acquire fails, the pending operation cannot be completed, so just
drop it

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16038>
2022-04-28 21:52:59 -04:00
Mike Blumenkrantz
7decf4056e zink: fix return for zink_kopper_acquire
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16038>
2022-04-28 21:52:59 -04:00
Mike Blumenkrantz
8ac563d157 zink: rework swapchain object check for acquires
this is more accurate

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16038>
2022-04-28 21:52:59 -04:00
Mike Blumenkrantz
8ab5ac0870 zink: unset image layout when killing swapchain
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16038>
2022-04-28 21:52:59 -04:00
Mike Blumenkrantz
5694c04cdd zink: handle dead swapchains in acquire
this is a no-op failure

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16038>
2022-04-28 21:52:59 -04:00
Mike Blumenkrantz
8bae419dfe zink: flag swapchains when updating fails
these are dead, they just don't know it yet

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16038>
2022-04-28 21:52:59 -04:00
Mike Blumenkrantz
e1706c29c6 zink: add a util function for finding swapchain resource
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16038>
2022-04-28 21:52:59 -04:00
Jordan Justen
ccdebfb26a drm-uapi/i915_drm.h: Update from drm-next (2022-04-28)
git://anongit.freedesktop.org/drm/drm 9bda072a7bec278c424ad660373e69d8e4a3385d

Among other changes, this provides DRM_I915_QUERY_HWCONFIG_BLOB and
DRM_I915_QUERY_GEOMETRY_SUBSLICES, which are needed for DG2 support.

Cc: 22.1 <mesa-stable>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16174>
(cherry picked from commit 3477dbd34f)
2022-04-28 21:52:59 -04:00
Tapani Pälli
b39d53761c isl: disable mcs (and mcs+ccs) for color msaa on DG2
Fixes lots of various test failures in:
   dEQP-VK.pipeline.multisample.min_sample_shading_disabled.*
   dEQP-GLES3.functional*multisample.*
   KHR-GL*sample_variables.*

Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13991>
(cherry picked from commit d3ef3657b2)
2022-04-28 21:52:59 -04:00
Jordan Justen
b674942ecc vulkan/wsi/x11: Use atomic_int with sent_image_count
Without this being atomically incremented and decremented, I observed
this assert triggering in debug builds:

  src/vulkan/wsi/wsi_common_x11.c:x11_present_to_x11_dri3():

  assert(chain->sent_image_count <= chain->base.image_count);

I think this was happening since,

  src/vulkan/wsi/wsi_common_x11.c:x11_handle_dri3_present_event()

which decrements chain->sent_image_count may be run in a separate
thread.

Fixes: d0bc1ad377 ("vulkan/wsi/x11: add sent image counter")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15908>
(cherry picked from commit 212fb25b26)
2022-04-28 21:52:59 -04:00
Dylan Baker
2e84b75047 .pick_status.json: Update to 1dc697942a 2022-04-28 10:05:42 -07:00
Icecream95
431f07fcd9 panfrost: Fix pack_32_2x16 implementation
Fixes: 6f0eff548c ("pan/bi: Implement packing ops between 32-bit vec1 and 16-bit vec2")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16181>
(cherry picked from commit 76cea8e27b)

Conflicts:
	src/panfrost/bifrost/bifrost_compile.c
2022-04-27 12:30:28 -07:00
Samuel Pitoiset
46c9e8b811 radv: enable radv_disable_sinking_load_input_fs for Grid Autosport
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4228
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/16165>
(cherry picked from commit e6bcdc763c)
2022-04-27 12:30:28 -07:00
Samuel Pitoiset
0783dd7f7e radv: allow to disable sinking of load inputs for FS via drirc
To workaround game bugs where partial derivatives are used in
non-uniform control flow. A proper solution needs to be implemented,
but as a quick fix disabling nir_opt_sink() works.

Cc: mesa-stable
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/16165>
(cherry picked from commit 1dbfd2be4b)
2022-04-27 12:30:28 -07:00
Samuel Pitoiset
2eba273314 radv: fix handling divisor == 0 with dynamic vertex input state
When the divisor is 0, the compiler should generate a different VS
prolog instead of re-using a previous prolog that uses nontrivial
divisors. This is because divisor == 0 and divisor > 1 should use
a different path to guarantee that the index is correctly computed.

Cc: mesa-stable
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/16009>
(cherry picked from commit f525706e77)
2022-04-27 11:19:10 -07:00
Mike Blumenkrantz
7fb345d84a drisw: remove dead code
this was from a very early version of kopper, but it can no longer
be reached

Fixes: d760a9151b ("gallium: Learn about kopper")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16152>
(cherry picked from commit 6a9def8c9f)
2022-04-27 11:19:09 -07:00
Yevhenii Kolesnikov
07a0e16324 nir: Remove single-source phis before opt_if_loop_last_continue
We might have some single-source phis leftover after prior optimizations. We
want to get rid of them before merging the blocks.

Fixes: 5921a19d4b ("nir: add if opt opt_if_loop_last_continue()")

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

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16095>
(cherry picked from commit 65caf46b3b)
2022-04-27 11:19:09 -07:00
Jason Ekstrand
a5191667d3 spirv: Handle Op*MulExtended for non-32-bit types
Fixes: 58bcebd987 ("spirv: Allow [i/u]mulExtended to use new nir opcode")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6306
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16060>
(cherry picked from commit ef9d97ec1f)
2022-04-27 11:19:08 -07:00
Dylan Baker
dea703ff2b .pick_status.json: Update to f17d3a1251 2022-04-27 11:19:07 -07:00
Dylan Baker
53fe3ea095 VERSION: bump for 22.1.0-rc3 2022-04-27 10:23:21 -07:00
Mike Blumenkrantz
276d23b4bc zink: ci update
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16179>
2022-04-27 03:54:29 +00:00
Mike Blumenkrantz
8cd82ee256 zink: fix up swapchain depth buffer geometry during fb update
due to desync between the frontend and the driver, the size that the
depth buffer was created with may not match the size of the swapchain if
the window is being resized very quickly, so just go ahead and clobber
the existing depth buffer with a series of very illegal internal object
replacements to make everything match up

do not try at home.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16179>
2022-04-27 03:54:29 +00:00
Mike Blumenkrantz
939a0cf876 zink: fix/improve swapchain surface info updating
if the swapchain is updated, the base surface info needs to be updated
so that the surface info used for the framebuffer is updated

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16179>
2022-04-27 03:54:29 +00:00
Mike Blumenkrantz
c074592f3d kopper: add DISPLAY_TARGET bind for depth buffer
this doesn't affect functionality and is only used for validation
in the driver

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16179>
2022-04-27 03:54:29 +00:00
Mike Blumenkrantz
63d75ac797 kopper: copy a bunch of code for texture_from_pixmap
seems to work?

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16179>
2022-04-27 03:54:29 +00:00
Mike Blumenkrantz
5e3b01c515 kopper: store whether screen has dmabuf support
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16179>
2022-04-27 03:54:29 +00:00
Mike Blumenkrantz
c7830bf873 kopper: move drawable geometry updating up in function
no functional changes

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16179>
2022-04-27 03:54:29 +00:00
Mike Blumenkrantz
e34284b7dc kopper: always fetch and store drawable info
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16179>
2022-04-27 03:54:29 +00:00
Sidney Just
bad73e0959 wgl: support kopper
this is semi transposed from the dri version of kopper and mostly ignores
what wgl tries to do in order to let zink drive everything

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16087>
2022-04-27 02:20:06 +00:00
Sidney Just
888b4de9d4 zink: support win32 wsi
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16087>
2022-04-27 02:20:06 +00:00
Sidney Just
5a1b1a0729 kopper: add win32 loader interface
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16087>
2022-04-27 02:20:06 +00:00
Sidney Just
88b07e972b zink: support VK_KHR_win32_surface
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16087>
2022-04-27 02:20:06 +00:00
Sidney Just
38fd735a72 wgl: add zink to the list of auto-loaded drivers
it's a legitimate driver!

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16087>
2022-04-27 02:20:06 +00:00
Sidney Just
3ae788a937 wgl: add a flag to determine if running on zink
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16087>
2022-04-27 02:20:06 +00:00
Daniel Stone
68998c0c9a ci: Also disable Windows container builds when down
Unlike all the other test configurations, we also want to drop the
Windows container build when our Windows machines aren't available.
Missed in !16055.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16185>
2022-04-26 21:43:55 -04:00
Daniel Stone
8a53885999 CI: Disable Windows jobs
We are underprovisioned for Windows, almost certainly not running wide
enough on the insufficient number of slots we do have, and there are
also indications that the machine itself is having physical issues.

Disable it until it's fixed.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16185>
2022-04-26 21:43:52 -04:00
Boris Brezillon
c7fe963150 ci/windows: Add a variable to globally disable jobs using windows runners
Suggested-by: Daniel Stone <daniels@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16185>
2022-04-26 21:43:51 -04:00
Jason Ekstrand
f6c77aa558 vulkan: Set signals[i].stageMask = ALL_COMMANDS for QueueSubmit2 wrapping
My understanding of the signal masks is that they control what stages
must complete before the semaphore is signaled.  Using 0 theoretically
means the semaphore could be signaled immediately without waiting on
anything.  Use ~0 instead to say it depends on everything.

Fixes: 97f0a4494b ("vulkan: implement legacy entrypoints on top of VK_KHR_synchronization2")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16145>
(cherry picked from commit 02fea6c179)
2022-04-26 09:06:13 -07:00
Sviatoslav Peleshko
fe83982fa6 anv: workaround apps that assume full subgroups without specifying it
Without this we might choose 8 or 16 width, while the app assumes 32.
With subgroup operations it may cause wrong calculations and thus bugs.

Examples of such games are Aperture Desk Job and DOOM Eternal.

v2: Make it a driconf option instead of applying unconditionally, move
    from brw_required_dispatch_width to brw_compile_cs
v3: Rename allow_assuming_full_subgroups -> assume_full_subgroups.
    Include assume_full_subgroups value in anv_pipeline_hash_compute().
v4: Move actual workaround code from brw_fs.c -> anv_pipeline.c.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6171
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15708>
(cherry picked from commit 28ca5636f6)
2022-04-26 09:06:12 -07:00
Rhys Perry
8939224350 radv: fix clearing of TRUNC_COORD with tg4 and immutable samplers
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 15640e58d9 ("radv,aco: lower texture descriptor loads in NIR")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16148>
(cherry picked from commit f97d82c52b)
2022-04-26 09:06:12 -07:00
Jason Ekstrand
3dd54edd12 nir: Lower all bit sizes of usub_borrow
It's not clear why this is restricted to 32-bit besides that being the
only bit size where GLSL has an intrinsic for this.  All drivers that
set this probably want it lowered for all bit sizes as far as I can
tell.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6353
Fixes: 8a3e344180 ("nir/opt_algebraic: Fix some expressions with ambiguous bit sizes")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16146>
(cherry picked from commit 1755730362)
2022-04-26 09:06:11 -07:00
Mike Blumenkrantz
7358faab52 vulkan: bump layer api versions to current vk header version
should probably try to keep these in sync? maybe?

cc: mesa-stable

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16138>
(cherry picked from commit f5bc062ffd)
2022-04-26 09:06:11 -07:00
Pavel Ondračka
100360a307 r300: set PIPE_BIND_CONSTANT_BUFFER for const_uploader
Fixes constant uploads with nine.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5966
CC: mesa-stable
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16125>
(cherry picked from commit e01f86c67b)
2022-04-26 09:06:10 -07:00
Marek Olšák
5634be6cb8 winsys/amdgpu: fix a mutex deadlock when we fail to create pipe_screen
Fixes: 2eb067db0f - winsys/amdgpu: add a new winsys for the new kernel driver

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16112>
(cherry picked from commit 4a982aa542)
2022-04-26 09:06:09 -07:00
Lionel Landwerlin
1e1b7661e2 anv: skip acceleration structure in binding table emission
With mutable descriptor types, we can end up in a situation where a
binding can be, for instance, both a UBO and an acceleration
structure.

While we can promote the UBO to a binding table entry and the shader
can use it, this isn't true of acceleration structures that have no
surface state. In that case just skip the entry. The shader is already
compiled to use the descriptor entry.

In the non mutable case, the entry will not be created by
anv_nir_apply_pipeline_layout.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 63e91148b7 ("anv: Enable VK_VALVE_mutable_descriptor_type")
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15969>
(cherry picked from commit fe413962b4)
2022-04-26 09:06:09 -07:00
Mike Blumenkrantz
f11afdbf9c zink: fix group memory barrier emission
same as glslang

cc: mesa-stable

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16108>
(cherry picked from commit ce02eeecf4)
2022-04-26 09:06:08 -07:00
Konstantin Seurer
ed6d83f01b radv: Fix lowering ignore_ray_intersection
Fixes dEQP-VK.ray_tracing_pipeline.misc.report_intersection_result

Fixes: c3d82a9 ("radv: Add pass to lower anyhit shader into an intersection shader.")
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16056>
(cherry picked from commit 4080f18163)
2022-04-26 09:06:08 -07:00
Lionel Landwerlin
12eb1548bd anv: fix acceleration structure descriptor template writes
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: d258b0bf0e ("anv: Add support for binding acceleration structures")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16058>
(cherry picked from commit b7828f56ba)
2022-04-26 09:06:07 -07:00
Lionel Landwerlin
4a434c77fc intel: fixup number of threads per EU on XeHP
Computations for indexing in-memory data structures for ray queries
depend on this.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 4f9141607f ("intel: Add device info for DG2")
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15925>
(cherry picked from commit 107acf5a4a)
2022-04-26 09:06:07 -07:00
Samuel Pitoiset
c203721116 nir: mark XFB varyings as unmoveable to prevent them to be remapped
XFB varyings are considered as always active IO to prevent them to
be removed or compacted. Though, if the NIR linker doesn't mark XFB
varyings as unmoveable it still possible to remap other varyings to
the same location/component.

Fixes KHR-Single-GL46.enhanced_layouts.xfb_override_qualifiers_with_api
with Zink and a bunch of other dEQP XFB tests.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6301
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri  <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16092>
(cherry picked from commit 4ebb5391ac)

Conflicts:
	src/gallium/drivers/zink/ci/zink-radv-fails.txt
2022-04-26 09:06:06 -07:00
Samuel Pitoiset
add1e87c4e nir: fix marking XFB varyings as always active IO
Components need to be handled, otherwise if a shader has two XFB
varyings at the same location, only one will be marked as always active.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri  <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16092>
(cherry picked from commit 26f74f17d9)
2022-04-26 09:05:09 -07:00
Samuel Pitoiset
2379bc19a8 aco: fix load_barycentric_at_{sample,offset} on GFX6-7
The computation was wrong.

Fixes dEQP-GLES31.functional.shaders.multisample_interpolation.interpolate_at_offset.*
with Zink on GFX6 (Pitcairn).

Cc: mesa-stable
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/16099>
(cherry picked from commit 6873da0e42)
2022-04-26 09:05:08 -07:00
Dylan Baker
99ce005b93 .pick_status.json: Update to f329f67243 2022-04-26 09:05:07 -07:00
Mike Blumenkrantz
d71e9fcb15 glsl/nir: set new_style_shadow for sparse tex ops as necessary
this needs the sparse result type, which is not the ir type

Fixes: f4a972b748 ("glsl/nir: convert sparse ir_texture to nir")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16097>
(cherry picked from commit a6a4bf0f1e)
2022-04-24 21:04:55 -07:00
Mike Blumenkrantz
5d8a4ce3c4 mesa/st: clamp GL_RENDERBUFFER to GL_TEXTURE_2D for sparse queries
this is a legal query that cts uses, so don't just abort

Fixes: b1c32a6c8c ("mesa: add ARB_sparse_texture query in glGetInternalformativ")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16097>
(cherry picked from commit 272f6ede0d)
2022-04-24 21:04:55 -07:00
Boris Brezillon
e07d4a02fe dzn: Fix the STATIC_ASSERT() in dzn_meta_blits_get_context()
We care about the object key size, not the size of a pointer.

Fixes: a012b21964 ("microsoft: Initial vulkan-on-12 driver")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16109>
(cherry picked from commit 1999e927b0)
2022-04-24 21:04:54 -07:00
Boris Brezillon
ff7e8aec04 dzn: Pass the dzn_event pointer to _mesa_hash_table_insert()
The key is supposed to be the dzn_event pointer, not the VkEvent
object, even if they do match in practice on 64bit builds.

Fixes: a012b21964 ("microsoft: Initial vulkan-on-12 driver")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16109>
(cherry picked from commit 3328f6be06)
2022-04-24 21:04:54 -07:00
Boris Brezillon
001a5c73cc dzn: Add missing VKAPI_{ATTR,CALL} specifiers to BeginCommandBuffer()
Fixes: a012b21964 ("microsoft: Initial vulkan-on-12 driver")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16109>
(cherry picked from commit cb9ad71d75)
2022-04-24 21:04:53 -07:00
Jason Ekstrand
a1c167da48 util/set: Respect found in search_or_add_pre_hashed
Fixes: 491e7decad "util/set: add the found param to search_or_add"
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13184>
(cherry picked from commit 21a7b0f1ab)
2022-04-24 21:04:53 -07:00
Marek Olšák
acc3752a10 ac/surface: fix an addrlib race condition on gfx9
Addrlib calls GetMetaEquation, which generates and saves address equations
in a global table that is not thread safe.

Fixes: df2cbdd2e3 - amd/addrlib: expose DCC address equations to drivers
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6361

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16091>
(cherry picked from commit c4ca059dee)
2022-04-24 21:04:52 -07:00
Marek Olšák
1fddd2dbeb nir: fix an uninitialized variable valgrind warning in nir_group_loads
pass_flags is only initialized for grouped loads, so change the order

Fixes: 33b4eb149e - nir: add new SSA instruction scheduler grouping loads into indirection groups

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16090>
(cherry picked from commit f7a77ff900)
2022-04-24 21:04:52 -07:00
Pierre-Eric Pelloux-Prayer
e8ba43c8f8 ac/surface: adjust gfx9.pitch[*] based on surf->blk_w
This is the same as 8275dc1ed5, but since gfx9.pitch[...] is
used for linear surfaces since 86262b6eac we need to update
it as well.

Fixes: 86262b6eac ("radeonsi,radv: fix usages of surf_pitch")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16053>
(cherry picked from commit fcc499d5e1)
2022-04-24 21:04:52 -07:00
Dylan Baker
f53d45cbb5 .pick_status.json: Update to a6a4bf0f1e 2022-04-24 21:04:51 -07:00
Mike Blumenkrantz
cfc3827890 zink: add synchronization for buffer clears
cc: mesa-stable

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16098>
(cherry picked from commit fbece25a45)
2022-04-22 09:00:47 -07:00
Samuel Pitoiset
ae85860679 radv: only apply enable_mrt_output_nan_fixup for 32-bit float MRTs
This is incorrect for 32-bit integer MRTs which are clamped to the
maximum value of the format, and returning 0 can break some shaders.

This fixes a rendering issue with RAGE2.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4329
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16080>
(cherry picked from commit 5121e6dd7e)
2022-04-22 09:00:46 -07:00
Mike Blumenkrantz
0776767b15 zink: fix semantics mask for compute control barriers
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15959>
(cherry picked from commit 5e931cd0e1)
2022-04-22 09:00:45 -07:00
Mike Blumenkrantz
5286bd22d8 zink: fix tcs control barriers for use without vk memory model
these are translated into memory+control barriers in nir, and only
the control barrier needs to be handled

these semantics match what glslang does, so they must be right

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15959>
(cherry picked from commit 55baf0c676)
2022-04-22 09:00:44 -07:00
Paulo Zanoni
de0c61c03b iris: fix race condition during busy tracking
The Iris code that deals with implicit tracking is protected by
bufmgr->bo_deps_lock. Before this patch, we hold this lock during
update_batch_syncobjs() but don't keep it held until we actually
submit the batch in the execbuf ioctl. This can lead to the following
race condition:

  - Context C1 generates a batch B1 that signals syncobj S1.
  - Context C2 generates a batch B2 that depends on something that B1
    from C1 is using, so we mark B2 as having to wait syncobj S1.
  - C2 calls submit_batch() before C1 does it.
  - The Kernel detects it was told to wait on syncobj S1 that was
    never even submitted, so it returns EINVAL to the execbuf ioctl.
  - We run abort() at the end of _iris_batch_flush().
    - If DEBUG is defined, we also print:
      iris: Failed to submit batchbuffer: Invalid argument

I couldn't figure out a way to reproduce this issue with real
workloads, but I was able to write a small reproducer to trigger this.
Basically it's a little GL program that has lots of contexts running
in different threads submitting compute shaders that keep using the
same SSBOs. I'll submit this as a piglit test. Edit: Tapani found a
dEQP test case which fails intermintently without this fix, so I'm not
sure a new Piglit is worth it now.

The solution itself is quite simple: just keep bo_deps_lock held all
the way from update_batch_syncobjs() until ioctl(). In order to make
that easier we just call update_batch_syncobjs() a little later. We
have to drop the lock as soon as the ioctl returns because removing
the references on the buffers would trigger other functions to try to
grab the lock again, leading to deadlocks.

Thanks to Kenneth Graunke for pointing out this issue.

This has also been confirmed to fix a dEQP test that was giving
intermittent failures:
  dEQP-EGL.functional.sharing.gles2.multithread.random.images.copyteximage2d.12

v2: Move decode_batch() out, just to be safe (Jason).
v3: Do it all after assembling validation_list (Ken).

Cc: mesa-stable
Fixes: 89a34cb845 ("iris: switch to explicit busy tracking")
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14964>
(cherry picked from commit 3532c374de)
2022-04-22 09:00:44 -07:00
Mike Blumenkrantz
cbee0572ed wgl: support GL 4.6
somehow we never supported anything above 4.5?

cc: mesa-stable

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16085>
(cherry picked from commit f8f5b5455a)
2022-04-22 09:00:43 -07:00
Mike Blumenkrantz
c5f6ff9d3e zink: move the kopper present fence to the displaytarget object
this is otherwise broken when front/back buffers share the same dt

Fixes: 8ade5588e3 ("zink: add kopper api")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16070>
(cherry picked from commit 64d5f71bbc)
2022-04-22 09:00:43 -07:00
Dylan Baker
a9a6fb2cf2 .pick_status.json: Update to fbece25a45 2022-04-22 09:00:41 -07:00
Lionel Landwerlin
2324083fe9 nir/divergence: handle load_global_block_intel
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: dd39e311b3 ("nir: Add nir_intrinsic_{load,store}_deref_block_intel")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16075>
(cherry picked from commit 9f44a26462)
2022-04-21 11:20:22 -07:00
Filip Gawin
08e22fff13 r300: Print warning when stubbing derivatives
Fixes: e1c640c3a4
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14669>
(cherry picked from commit d48c10fab3)
2022-04-21 11:20:22 -07:00
Martin Roukala (né Peres)
af570d37a7 ci/b2c: fix the generation of the IMAGE_UNDER_TEST variable
The `IMAGE_UNDER_TEST` variable set in `.b2c-test` got broken with
the merge of 7d474c1 (ci: Move most stuff out of root .gitlab-ci.yml).

During the shuffling, the `MESA_BASE_TAG` and `MESA_IMAGE_TAG`
variables were dropped, leading to `IMAGE_UNDER_TEST` being an
unexisting container.

To make this issue less likely to happen in the future, this patch
drops the code duplication that led to `IMAGE_UNDER_TEST` to be
the same as `MESA_IMAGE` and instead re-uses .use-debian/x86_test-vk
to generate `MESA_IMAGE`, which we then use verbatim in
`IMAGE_UNDER_TEST`.

The renaming is `MESA_IMAGE` into `IMAGE_UNDER_TEST` there to make the
distinction clear between the image run by gitlab-runner (what is
usually called `MESA_IMAGE` but we instead hardcode to valve-infra's
trigger container), and the image we are running on the test machines.

Fixes: 7d474c1 (ci: Move most stuff out of root .gitlab-ci.yml)
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Reviewed-by: Charlie Turner <cturner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15555>
(cherry picked from commit c672464844)
2022-04-21 11:20:21 -07:00
Alexey Bozhenko
a427a88f40 spirv: fix OpBranchConditional when both branches are the same
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6246

Signed-off-by: Bozhenko Alexey <oleksii.bozhenko@globallogic.com>

Fixes: 64cb143b92 ("spirv: Fix handling of OpBranchConditional with same THEN and ELSE")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15929>
(cherry picked from commit 25acf1d869)
2022-04-21 11:20:21 -07:00
Dave Airlie
f8dc7e0d37 util/stencil: fix stencil fallback blit shader texture types.
src/gallium/auxiliary/tgsi/tgsi_scan.c:287: scan_src_operand: Assertion `info->sampler_targets[index] == target' failed.
assert was being triggered by
GTF-GL46.gtf30.GL3Tests.framebuffer_blit.framebuffer_blit_functionality_multisampled_to_singlesampled_blit
using the stencil fallback with zink.

Fixes: f05dfddeb1 ("u_blitter: fix stencil blit fallback for crocus.")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16069>
(cherry picked from commit 4b7ba3869b)
2022-04-21 11:20:20 -07:00
Dave Airlie
55d9bd1b64 u_blitter/stencil: take dstbox x/y into accounts for dst fb width
When setting the dst framebuffer width height, it might be silly
to constrain this beyond the dst resource, but at least constrain
it correctly to take account of x/y offsets.

This fixes some uses of this as a fallback for zink with
GTF-GL46.gtf30.GL3Tests.framebuffer_blit.framebuffer_blit_functionality_stencil_blit

Fixes: b4c07a8a87 ("gallium/util: allow scaling blits for stencil-fallback")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16069>
(cherry picked from commit dbc264f504)
2022-04-21 11:20:20 -07:00
Vadym Shovkoplias
692d9bce64 anv: Fix geometry flickering issue when compute and 3D passes are combined
Call flush_pipeline_select_3d in CmdBeginRendering() to emit a dummy MEDIA_VFE_STATE
before switching from GPGPU to 3D.

Original commit with the fix:
bc612536 ("anv: Emit a dummy MEDIA_VFE_STATE before switching from GPGPU to 3D")

Fixes: 3501a3f9ed ("anv: Convert to 100% dynamic rendering")
Signed-off-by: Vadym Shovkoplias <vadym.shovkoplias@globallogic.com>
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6201
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15954>
(cherry picked from commit 785b6579ae)
2022-04-21 11:20:20 -07:00
Jordan Justen
503440f0dc intel/dev: Add device info for RPL-P
Cc: mesa-stable
Ref: https://patchwork.freedesktop.org/series/102701/
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16054>
(cherry picked from commit d257494ec4)
2022-04-21 11:20:19 -07:00
Michael Olbrich
2af5c609be crocus: export GEM handle with RDWR access rights
Without this, it is impossible to export gem handles with write access.

This was fixed the same way for
i965 (https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10850) and
iris (https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10851).

Cc: mesa-stable
Reviewed-by: Dave Airlie <airlied@redhat.com>`
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16057>
(cherry picked from commit 5c4906dc0f)
2022-04-21 11:20:19 -07:00
Mike Blumenkrantz
f335548405 util/draw: fix indirect draw count readback
if there is an indirect count, always use it

Fixes: 3eb9932317 ("aux/draw: add a util function for reading back indirect draw params")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15963>
(cherry picked from commit ec12491620)
2022-04-21 11:20:18 -07:00
Mike Blumenkrantz
9d020c5b52 util/draw: handle draw_count=0 when reading indirect parameters
Fixes: 3eb9932317 ("aux/draw: add a util function for reading back indirect draw params")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15963>
(cherry picked from commit 07437fa3bd)
2022-04-21 11:20:18 -07:00
Mike Blumenkrantz
936c5278de util/draw: fix map size of indirect buffer in util_draw_indirect_read
this was incorrectly calculating too small of a map region if
the stride was less than the size of the struct

Fixes: 3eb9932317 ("aux/draw: add a util function for reading back indirect draw params")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15963>
(cherry picked from commit efca37d415)
2022-04-21 11:20:17 -07:00
Mike Blumenkrantz
1eda70fb31 zink: handle device-local unsynchronized maps
this is only possible when tc determines the buffer is not in use
and decides to return a pointer immediately, so just give back a staging
buffer

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15979>
(cherry picked from commit d7256043b3)
2022-04-21 11:20:17 -07:00
Dylan Baker
3bd963d88b .pick_status.json: Update to 9f44a26462 2022-04-21 11:20:15 -07:00
Dylan Baker
7c75d83842 VERSION: bump for 22.1.0-rc2 2022-04-20 21:44:50 -07:00
Mike Blumenkrantz
b7e08dbc06 zink: remove xfb_barrier flag
this was an attempt to minimize the number of xfb barriers being emitted,
but really xfb barriers need to always be emitted in order for xfb to work

cc: mesa-stable

fixes (nv):
KHR-GL46.texture_view.reference_counting
KHR-GL46.transform_feedback_overflow_query_ARB.multiple-streams-multiple-buffers-per-stream
KHR-GL46.transform_feedback_overflow_query_ARB.multiple-streams-one-buffer-per-stream

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16065>
(cherry picked from commit e509598470)

Conflicts:
	src/gallium/drivers/zink/ci/zink-nv-fails.txt
2022-04-20 21:44:50 -07:00
Mike Blumenkrantz
f00600e1a3 zink: fix xfb counter buffer barriers
a read barrier is needed for resume, yes, but the counter buffer
is always being written to, so write access must always be set

cc: mesa-stable

fixes (nv):
KHR-GL46.transform_feedback.draw_xfb_test

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16065>
(cherry picked from commit fc5edf9b68)

Conflicts:
	src/gallium/drivers/zink/ci/zink-nv-fails.txt
2022-04-20 21:44:50 -07:00
Mike Blumenkrantz
68b25a57c1 zink: fix synchronization when drawing from streamout
this was well-documented, but ultimately wrong: the synchronization
being used was for binding streamout buffers (not counter buffers) as
vertex buffers, which was already handled just fine in the normal
vertex buffer binding

drawing from streamout ONLY uses the counter buffer, which means
the counter buffer needs to be synchronized for reading

cc: mesa-stable

fixes (nv):
KHR-GL46.transform_feedback.draw_xfb_feedbackk_test
KHR-GL46.transform_feedback.draw_xfb_instanced_test
KHR-GL46.transform_feedback.draw_xfb_stream_instanced_test

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16065>
(cherry picked from commit a056cbc691)

Conflicts:
	src/gallium/drivers/zink/ci/zink-nv-fails.txt
2022-04-20 21:44:50 -07:00
Mike Blumenkrantz
6a69784335 zink: set VK_QUERY_RESULT_WAIT_BIT when copying to qbo
according to spec, this ensures that drivers will accurately
return results relative to when the query was ended

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16049>
(cherry picked from commit 373c8001d6)
2022-04-20 21:44:50 -07:00
Emma Anholt
3987237220 nouveau/nir: Fix the inverted sense of usesSampleMaskIn.
Fixes: 9f3d5e99ea ("compiler: Use util/bitset.h for system_values_read")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16063>
(cherry picked from commit af718674ab)
2022-04-20 21:44:50 -07:00
Konstantin Seurer
a6c2047ea0 radv: Enable rt primitive culling for spirv2nir
Fixes: c8fe408fcc ("radv: Advertise ray primitive culling")
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16028>
(cherry picked from commit 324b2ae5f2)
2022-04-20 21:44:50 -07:00
Boris Brezillon
8efeb7e3bf dzn: Pass the right type to CreateCommandList() in the reset path
The Command allocator and command list type must match, but we
are forcing it to D3D12_COMMAND_LIST_TYPE_DIRECT in the reset path.

Fixes: a012b21964 ("microsoft: Initial vulkan-on-12 driver")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16023>
(cherry picked from commit 9fd02d49b8)
2022-04-20 21:44:50 -07:00
Marcin Ślusarz
9a28aea2a2 intel/compiler: invalidate metadata in brw_nir_initialize_mue
New "if" blocks may have been inserted.

Fixes: bc4f8c073a ("intel/compiler: inject MUE initialization")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15924>
(cherry picked from commit 5dace41c10)
2022-04-20 21:44:50 -07:00
Marcin Ślusarz
30a980fb94 intel/compiler: invalidate all metadata in brw_nir_lower_intersection_shader
New "if" blocks were inserted.

Fixes: 303378e1dd ("intel/rt: Add lowering for combined intersection/any-hit shaders")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15924>
(cherry picked from commit 4fddef33d5)
2022-04-20 21:44:50 -07:00
Marcin Ślusarz
4f031f35fe anv: invalidate all metadata in anv_nir_lower_ubo_loads
lower_ubo_load_instr may insert "if" blocks.

Fixes: 61749b5a15 ("anv: Add a pass for lowering A64 UBO access")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15924>
(cherry picked from commit 5bd3ba5b67)
2022-04-20 21:44:50 -07:00
Lionel Landwerlin
df6dc532d2 anv: allow getting the address of the beginning of the batch
There is no reason not to be able to get it.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 34a0ce58c7 ("anv: add a new execution mode for secondary command buffers")
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15968>
(cherry picked from commit 184084e21c)
2022-04-20 21:44:50 -07:00
Erik Faye-Lund
c849ae36e0 vulkan: explicitly cast object-type enum
VkObjectType and VkDebugReportObjectTypeEXT has the same enum-values.
Why the Vulkan WG thought this was a good idea, beats me. But it's what
we have to live with now.

Anyway, instead of having a statement that implicitly casts two
different values from the former to the latter, let's fully relsove the
type as the former, and cast the value when using it instead.

Fixes: 41318a5819 ("vulkan: Use vk_object_base::type for debug_report")
Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15547>
(cherry picked from commit b27a2ba4fc)
2022-04-20 21:44:50 -07:00
Mike Blumenkrantz
b7fe949ab9 zink: rework zink_kopper_update() assert
the dt might have been killed, so just assert that it's a display target

fixes #6317

Fixes: 8ade5588e3 ("zink: add kopper api")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16017>
(cherry picked from commit 3d97367a60)
2022-04-20 21:44:50 -07:00
Mike Blumenkrantz
445892367a zink: make a kopper debug print into an error
Fixes: 8ade5588e3 ("zink: add kopper api")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16017>
(cherry picked from commit 9ecdc2e985)
2022-04-20 21:44:50 -07:00
Mike Blumenkrantz
81b10bd0dd zink: fix extended restart prim types without dynamic state2
these are all allowed with the ext

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15978>
(cherry picked from commit 8806f444a5)
2022-04-20 21:44:50 -07:00
Mike Blumenkrantz
24d6489d0d zink: support restart with PIPE_PRIM_LINES_ADJACENCY if ext is available
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15978>
(cherry picked from commit cd9424d93f)
2022-04-20 21:44:50 -07:00
Mike Blumenkrantz
b27d409cfd zink: unconditionally set line width on rasterizer state change
the pipe cap is used for gating wideline support, so this will always
be 1.0 when not supported

furthermore, the previous code wasn't accurately checking line width
for tess shaders, breaking tests

cc: mesa-stable

fixes (nv):
KHR-GL46.tessellation_shader.tessellation_control_to_tessellation_evaluation.gl_PatchVerticesIn

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15960>
(cherry picked from commit d8b66fcbf9)
2022-04-20 21:44:50 -07:00
Mike Blumenkrantz
df84664032 zink: use mixed zs renderpass for depth read/write
this is triggered by u_blitter when doing src==dst blits

Fixes: 7781a75229 ("zink: add a renderpass flag for mixed zs layout")

affects:
GTF-GL46.gtf30.GL3Tests.framebuffer_blit.framebuffer_blit_functionality*

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15960>
(cherry picked from commit 9409756ee3)
2022-04-20 21:44:50 -07:00
Mike Blumenkrantz
357e3130ad zink: reject resource creation if format features don't match attachment
if a rendertarget-specified image can't be a rendertarget or a blit dst
then it can't be used for the designated functionality and must be rejected

cc: mesa-stable

fixes hangs on various nv driver versions:
dEQP-GLES2.functional.texture.mipmap.2d.generate.rgba5551_fastest

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15960>
(cherry picked from commit 37ac8647fc)
2022-04-20 21:44:50 -07:00
Mike Blumenkrantz
247ecdcc05 zink: remove tcs patch slot map
this is illegal, and we'll just have to eat some piglit fails
until indirects are handled

Fixes: f7ade1f188 ("zink: simplify shader i/o assignment")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15976>
(cherry picked from commit 12cf9a1544)

Conflicts:
	src/gallium/drivers/zink/ci/zink-lvp-fails.txt
2022-04-20 21:44:50 -07:00
Sviatoslav Peleshko
72cc88d205 mesa: flush bitmap caches when changing scissors or window rects state
If we change the sate without flushing the bitmap cache, the cache might be
rendered with the new scissor, which excludes some parts that should've
been rendered with the old state, and vice versa.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6233

Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15881>
(cherry picked from commit dd7278aa10)
2022-04-20 21:44:50 -07:00
Timothy Arceri
a27af70c1b nir: fix setting varying from uniform as flat
Here we just make sure we match the interpolation type on both
sides of the shader interface. Drivers like d3d12 are expecting
this.

Fixes: 9401990e6f ("nir/linker: set varying from uniform as flat")

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16003>
(cherry picked from commit 4b4bb46af4)
2022-04-20 21:44:50 -07:00
Samuel Pitoiset
424c960492 radv: fix initializing pipeline_key::topology for GFX9 and older
This is used to determine the geometry shader info on GFX9, and it
looks like it was broken for topologies that use adjacency.

This is also used to remove PSIZ from shaders that don't need it.

Found by inspection.

fossils-db (Polaris10):
Totals from 140 (0.10% of 135960) affected shaders:
SGPRs: 10448 -> 9696 (-7.20%)
VGPRs: 4376 -> 4264 (-2.56%)
CodeSize: 164316 -> 161028 (-2.00%)
Instrs: 26449 -> 25767 (-2.58%)
Latency: 184448 -> 180468 (-2.16%)
InvThroughput: 80772 -> 79092 (-2.08%)
VClause: 337 -> 328 (-2.67%); split: -2.97%, +0.30%
SClause: 859 -> 813 (-5.36%); split: -5.70%, +0.35%
Copies: 1027 -> 790 (-23.08%)
PreSGPRs: 2751 -> 2331 (-15.27%)
PreVGPRs: 3887 -> 3836 (-1.31%)

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/15948>
(cherry picked from commit ed7d831525)
2022-04-20 21:44:50 -07:00
Lionel Landwerlin
db3e06f76c intel: fix URB programming for GT1s
We're missing a programming restriction.

Hopefully fixing
dEQP-VK.spirv_assembly.instruction.graphics.float16.arithmetic_1.* on
Gfx9atoms

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6216
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>.
Tested-by: Mark Janes <markjanes@swizzler.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15596>
(cherry picked from commit b07c215c35)
2022-04-20 21:44:49 -07:00
Gert Wollny
353330c094 r600/sfn: Fix store_shared_r600 write masks
The error was caught by the new nir_validation code.

Fixes: 73ef225fc2
    nir: validate write_mask for all intrinsics that have it

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15994>
(cherry picked from commit ef75752ef8)
2022-04-20 21:44:49 -07:00
Emma Anholt
f1168c53ae nir: Add lowering for fround_even on r300.
When we put NIR in the compiler stack for r300, indirect addressing broke
for gallium nine.  DX's array indirects round the float value, so the DX
shader gets mapped to a TGSI "ARR ADDR[0] src.x" instruction.  Translating
that to NIR maps to r0[f2i32(fround(src.x))].  While we might hope that in
translation back using nir-to-tgsi after optimization we would recognize
the construct and emit ARR again, that's going to be error prone (think
"what if src.x is in a NIR register?") so we need a fallback plan.  r300
will be able to handle this lowering, so get it in place first to fix the
regression.

Fixes: #6297
Fixes: 7d2ea9b0ed ("r300: Request NIR shaders from mesa/st and use NIR-to-TGSI.")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15870>
(cherry picked from commit 6947016b46)
2022-04-20 21:44:49 -07:00
Icecream95
62b00f70fd panfrost: Stop overallocating compressed textures
The line stride uses the number of bytes in the entire block, so both
the width and height need to be reduced for compressed textures so
that the surface stride is calculated correctly.

Fixes: 051d62cf04 ("panfrost: Add a pan_image_layout_init() helper")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6286
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15989>
(cherry picked from commit f267000240)
2022-04-20 21:44:49 -07:00
Michel Zou
ff76add805 gallium: fix unused symbols warnings
fixes: d760a915

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15840>
(cherry picked from commit 4c1cb62999)
2022-04-20 21:44:49 -07:00
Jason Ekstrand
f48a3cffe7 nir/opcodes: fisfinite32 should return bool32
Otherwise constant-folding will fold it to 0/1 instead of 0/~0.

Fixes: 330e28155f ("nir: add 32-bit bool of fisfinite")
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15984>
(cherry picked from commit 5c9e4d400a)
2022-04-20 21:44:49 -07:00
Rhys Perry
a80f8a5ed0 ac/nir: properly handle large global access constant offsets
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Fixes: 61ac5acca3 ("radv,ac/nir: lower global access to _amd global access intrinsics")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6321
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15951>
(cherry picked from commit 8fe8c5dfd0)
2022-04-20 21:44:49 -07:00
Mike Blumenkrantz
5f5c562f00 mesa/st: set normalized coords for RECT samplers if rects are unsupported
the shaders will never see these, so set the expected value for 2D

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15895>
(cherry picked from commit 2058ae7b43)
2022-04-20 21:44:49 -07:00
Mike Blumenkrantz
653b560413 nir/lower_tex: fix rect queries with lower_rect set
queries still need the sampler_dim changed

Fixes: 682e14d3ea ("nir: lower_tex: Don't normalize coordinates for TXF with RECT")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15895>
(cherry picked from commit 5b0634d735)
2022-04-20 21:44:49 -07:00
Emma Anholt
9a1ca294a8 Revert "ci: Disable Google's lab"
This reverts commit 8506c2b7ee.  Network
admins say the fixed things, and we see the runners phoning home again.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15936>
(cherry picked from commit eb78378345)
2022-04-20 21:44:49 -07:00
Dylan Baker
252a858bc5 .pick_status.json: Update to e509598470 2022-04-20 21:44:49 -07:00
Dylan Baker
c519c37784 VESRION: bump for 22.1.0-rc1 release 2022-04-14 09:47:46 -07:00
Rhys Perry
2036a2c5c5 radv: use load_shared2_amd/store_shared2_amd
fossil-db (Sienna Cichlid):
Totals from 376 (0.23% of 162293) affected shaders:
MaxWaves: 9620 -> 9596 (-0.25%); split: +0.08%, -0.33%
Instrs: 207533 -> 203901 (-1.75%); split: -1.76%, +0.01%
CodeSize: 1130904 -> 1106420 (-2.16%); split: -2.17%, +0.01%
VGPRs: 14016 -> 14120 (+0.74%); split: -0.34%, +1.08%
Latency: 2143281 -> 2132212 (-0.52%); split: -0.56%, +0.05%
InvThroughput: 389116 -> 387990 (-0.29%); split: -0.34%, +0.05%
VClause: 4483 -> 4485 (+0.04%); split: -0.11%, +0.16%
SClause: 5780 -> 5778 (-0.03%); split: -0.17%, +0.14%
Copies: 15319 -> 15331 (+0.08%); split: -0.53%, +0.61%
Branches: 5561 -> 5563 (+0.04%)
PreSGPRs: 11776 -> 11775 (-0.01%)
PreVGPRs: 11393 -> 11497 (+0.91%); split: -0.13%, +1.04%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13778>
2022-04-13 23:08:07 +00:00
Rhys Perry
67fc0e3655 ac/llvm: implement load_shared2_amd/store_shared2_amd
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13778>
2022-04-13 23:08:07 +00:00
Rhys Perry
c883abda76 aco: implement load_shared2_amd/store_shared2_amd
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13778>
2022-04-13 23:08:07 +00:00
Rhys Perry
5aa5af7776 aco: handle read2st64/write2st64 in optimizer
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13778>
2022-04-13 23:08:07 +00:00
Rhys Perry
2135c88d9c aco: fix signedness of DS_instruction::offset0/1
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13778>
2022-04-13 23:08:07 +00:00
Rhys Perry
778fc176b1 nir/opt_load_store_vectorize: create load_shared2_amd/store_shared2_amd
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13778>
2022-04-13 23:08:07 +00:00
Rhys Perry
dc835626b3 nir/opt_load_store_vectorize: fix broken indentation
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13778>
2022-04-13 23:08:07 +00:00
Rhys Perry
8ff122f8b8 nir: add load_shared2_amd and store_shared2_amd
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13778>
2022-04-13 23:08:07 +00:00
Konstantin Seurer
bbdf22ce13 radv: Fix barriers with cp dma
We need to wait for cp dma if VK_PIPELINE_STAGE_2_ALL_TRANSFER_BIT or
VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT are set.

Closes: #5911
Fixes: 4b9bc4791b ("radv: only sync CP DMA for transfer operations or bottom pipe")

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15933>
2022-04-13 22:16:43 +00:00
Daniel Schürmann
d703a0e808 aco: remove register hints entirely
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15408>
2022-04-13 21:52:43 +00:00
Daniel Schürmann
2fe005a3fe aco: remove occurences of VCC hint
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15408>
2022-04-13 21:52:43 +00:00
Daniel Schürmann
b10c4d7dee aco: make program->needs_vcc independent of VCC hints
Totals from 5 (0.00% of 135048) affected shaders: (GFX9)
SGPRs: 208 -> 160 (-23.08%)
CodeSize: 2700 -> 2692 (-0.30%)
Instrs: 533 -> 531 (-0.38%)
Latency: 41688 -> 41680 (-0.02%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15408>
2022-04-13 21:52:43 +00:00
Daniel Schürmann
415a3820fc aco/ra: omit VCC affinity on VOPC_SDWA for GFX9+
VOPC_SDWA can also use arbitrary SGPR pairs on GFX9+.

Totals from 5607 (4.16% of 134913) affected shaders: (GFX10.3)
CodeSize: 42470760 -> 42452988 (-0.04%)
Instrs: 7943174 -> 7942883 (-0.00%)
Latency: 102887029 -> 102886305 (-0.00%); split: -0.00%, +0.00%
InvThroughput: 20454456 -> 20454338 (-0.00%); split: -0.00%, +0.00%
Copies: 376818 -> 376865 (+0.01%); split: -0.00%, +0.01%

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15408>
2022-04-13 21:52:43 +00:00
Daniel Schürmann
6ebc61d71b aco/ra: create VCC-affinities during RA
instead of using register hints.

Totals from 88367 (65.50% of 134913) affected shaders: (GFX10.3)
CodeSize: 322492184 -> 322252912 (-0.07%); split: -0.08%, +0.01%
Instrs: 60615809 -> 60541260 (-0.12%); split: -0.12%, +0.00%
Latency: 557067980 -> 557009210 (-0.01%); split: -0.01%, +0.00%
InvThroughput: 109676757 -> 109674804 (-0.00%); split: -0.00%, +0.00%
SClause: 1939703 -> 1939924 (+0.01%); split: -0.01%, +0.02%
Copies: 4557567 -> 4487530 (-1.54%); split: -1.54%, +0.00%
Branches: 1941123 -> 1937453 (-0.19%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15408>
2022-04-13 21:52:43 +00:00
Daniel Schürmann
44fb9ba84a aco/ra: only use VCC if program->needs_vcc == true
A future commit will make VCC register assignment independent
from register hints. Up to GFX9, VCC can alternatively be used
as regular SGPR, so prevent overlap.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15408>
2022-04-13 21:52:43 +00:00
Lionel Landwerlin
08f3950d6b anv: stop using old entrypoint/struct/enum names for 1.3
v2: More replacements

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com> (v1)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15920>
2022-04-13 21:13:56 +00:00
Emma Anholt
5fad6bca72 nir_to_tgsi: Do the required cleanup for nir_opt_find_array_copies().
If we made a copy deref, then we need to do dead-write elimination for the
pervious writes or we'll just emit the same copy deref again next time
around.  And, at the end of the opt loop, we need to lower copy derefs
because later passes (locals_to_regs, notably) depend on it.

Fixes infinite opt loop on fs-function-inout-array with virgl on NTT.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15899>
2022-04-13 19:44:39 +00:00
Jason Ekstrand
c8df09ebd4 iris: More gracefully fail in resource_from_user_memory
rusticl (and clover) would like to get a graceful fail here so they can
fall back to a shadow copy instead of us asserting.  We also start
rejecting arrayed surface because isl doesn't allow selecting a QPitch
yet.  Even if it did, QPitch is horribly restrictive, even for linear
surfaces, that it likely wouldn't be that useful.

Fixes: e81f3edf76 ("iris: Allow userptr on 1D and 2D images")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15903>
2022-04-13 19:18:54 +00:00
Mike Blumenkrantz
8501661332 zink: set optimal tiling on swapchain images
this otherwise breaks kopper

fixes #6294

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15928>
2022-04-13 19:01:29 +00:00
Louis-Francis Ratté-Boulianne
3017522e74 dzn: Add CI target for vulkan driver
A custom branch of `deqp` is used to have proper results when
crashing. See:

https://github.com/KhronosGroup/VK-GL-CTS/issues/311

A custom branch of `deqp-runner` with Windows support is also
used until the changes are merged into the main repository.

The `api`, `info`, `draw`, `query-pool` and `memory` test cases are
executed for now.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15742>
2022-04-13 18:05:44 +00:00
Louis-Francis Ratté-Boulianne
fb24f34fc3 dzn: Add a debug flag to enable D3D12 debug layer
Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-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/15742>
2022-04-13 18:05:44 +00:00
Karmjit Mahil
f7ddd584ab pvr: Implement vkCreateQueryPool() and vkDestroyQueryPool().
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15880>
2022-04-13 17:58:03 +00:00
Karmjit Mahil
1250e30929 pvr: Add pvrsrvkm visibility test heap.
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15880>
2022-04-13 17:58:03 +00:00
Karmjit Mahil
76ee1671f6 pvr: Add core count info and pvr_device_runtime_info.
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15880>
2022-04-13 17:58:03 +00:00
Jason Ekstrand
93fbaae7d5 v3dv: Add emulated timeline semaphore support
This is trivial thanks to the emulated timelines provided in common
code.  "Real" timeline semaphores which can be shared across processes
will require kernel support.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15704>
2022-04-13 17:22:14 +00:00
Jason Ekstrand
1cc917bc68 v3dv: Use the core version property helpers
vulkaninfo is the same before and after.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15704>
2022-04-13 17:22:14 +00:00
Jason Ekstrand
1973b2da9d v3dv: Use the core version feature helpers
vulkaninfo is the same before and after.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15704>
2022-04-13 17:22:14 +00:00
Jason Ekstrand
316728a55b v3dv: Switch to the common submit framework
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15704>
2022-04-13 17:22:14 +00:00
Jason Ekstrand
321f0b85f2 v3dv: Always wait on last_job_syncs if job->serialize
Even if we're the first job on some queue, there may be no wait
semaphores but we still need to ensure things happen in-order.  (See
the "Implicit Synchronization Guarantees" section of the Vulkan spec.)
The client can submit back-to-back command buffers with no semaphores
between them and it needs to adt the same as if there were a semaphore.
If job->serialize is set because of a barrier or something, we still
need to synchronize across HW queues by waiting on last_job_syncs.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15704>
2022-04-13 17:22:14 +00:00
Jason Ekstrand
00b84fae2d v3dv: Add a condition variable for queries
In order to properly wait for a query to be complete, we need to first
wait for the end query job to flush through on the queue.  Since query
end is always handled on the CPU, we can do this with a condition
variable.  The 2s timeout is taken from ANV.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15704>
2022-04-13 17:22:14 +00:00
Jason Ekstrand
e5a0e2122f v3dv: Use util/os_time helpers
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15704>
2022-04-13 17:22:14 +00:00
Jason Ekstrand
8bd7bd9577 v3dv: Switch to the common device lost tracking
Vulkan requires that, once the device has been lost, you keep returning
VK_ERROR_DEVICE_LOST.  We've got tracking for this in common code; it
just needs to be wired up.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15704>
2022-04-13 17:22:14 +00:00
Jason Ekstrand
32527f3ccc v3dv: Destroy the device mutex on the teardown path
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15704>
2022-04-13 17:22:14 +00:00
Jason Ekstrand
30191fd9df v3dv: Don't use pthread functions on c11 mutexes
This only works because c11/threads.h is typedeffing the c11 stuff to
ptrheads.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15704>
2022-04-13 17:22:14 +00:00
Jason Ekstrand
25441b5e5c v3dv: Put indirect compute CSD jobs in the job list
Instead of having the CPU job execute the CSD job, put both jobs on the
list with the CPU job first which modifies the GPU job which gets kicked
off next.  This gives the queue code more visibility into what types of
jobs are actually in the list.  In particular, if an indirect compute
job is the last job in a batch buffer, it currently appears as if the
batch ends with CPU work which isn't true because it kicks off GPU work.
In that case, the last job on the list is now a GPU job, which better
matches reality.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15704>
2022-04-13 17:22:14 +00:00
Jason Ekstrand
0208bb2d58 v3dv: Stop directly setting vk_device::alloc
vk_device_init() will do this.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15704>
2022-04-13 17:22:14 +00:00
Jason Ekstrand
b284c512e6 vulkan/drm_syncobj: Implement WAIT_PENDING with a sync_file lookup
The v3dv kernel driver doesn't support timelines yet but we want
threaded submit and that requires WAIT_PENDING.  Fortunately, it should
never sit in this loop for long in practice.  The primary use-case is
sorting out dependencies and these checks will always trivially succeed
for non-shared semaphores because v3dv only has a single queue.

Acked-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15704>
2022-04-13 17:22:14 +00:00
Rhys Perry
7478b00c7c aco: remove old global access intrinsics
No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14124>
2022-04-13 16:23:35 +00:00
Rhys Perry
61ac5acca3 radv,ac/nir: lower global access to _amd global access intrinsics
fossil-db (Sienna Cichlid):
Totals from 400 (0.30% of 134621) affected shaders:
VGPRs: 18696 -> 18688 (-0.04%)
CodeSize: 2031348 -> 1946640 (-4.17%)
Instrs: 374703 -> 360226 (-3.86%)
Latency: 4200727 -> 4108628 (-2.19%); split: -2.20%, +0.01%
InvThroughput: 1059935 -> 1029441 (-2.88%); split: -2.88%, +0.00%
VClause: 5777 -> 5771 (-0.10%)
SClause: 11890 -> 10891 (-8.40%); split: -8.57%, +0.17%
Copies: 34035 -> 33259 (-2.28%); split: -2.98%, +0.70%
Branches: 11108 -> 11100 (-0.07%); split: -0.08%, +0.01%
PreSGPRs: 15999 -> 15942 (-0.36%); split: -0.44%, +0.08%
PreVGPRs: 16994 -> 16970 (-0.14%)

fossil-db (Polaris10):
Totals from 400 (0.29% of 135668) affected shaders:
SGPRs: 23799 -> 22919 (-3.70%); split: -4.30%, +0.61%
VGPRs: 18480 -> 18472 (-0.04%)
CodeSize: 2090316 -> 2041592 (-2.33%)
Instrs: 395461 -> 385747 (-2.46%); split: -2.46%, +0.00%
Latency: 5045768 -> 5020196 (-0.51%); split: -0.53%, +0.02%
InvThroughput: 2694320 -> 2689886 (-0.16%); split: -0.23%, +0.07%
VClause: 5982 -> 5968 (-0.23%)
SClause: 12064 -> 10823 (-10.29%); split: -10.33%, +0.04%
Copies: 48233 -> 48322 (+0.18%); split: -0.47%, +0.65%
PreSGPRs: 16409 -> 16358 (-0.31%); split: -0.39%, +0.08%

fossil-db (Pitcairn):
Totals from 400 (0.29% of 135668) affected shaders:
SGPRs: 22431 -> 22215 (-0.96%); split: -2.60%, +1.64%
VGPRs: 18776 -> 18560 (-1.15%); split: -1.21%, +0.06%
CodeSize: 2104440 -> 2017708 (-4.12%)
MaxWaves: 2363 -> 2367 (+0.17%)
Instrs: 413099 -> 397446 (-3.79%)
Latency: 5507707 -> 5450251 (-1.04%); split: -1.12%, +0.07%
InvThroughput: 2838867 -> 2786903 (-1.83%); split: -1.83%, +0.00%
VClause: 10334 -> 10097 (-2.29%)
SClause: 12346 -> 11005 (-10.86%); split: -10.89%, +0.02%
Copies: 54034 -> 52065 (-3.64%); split: -3.99%, +0.35%
PreSGPRs: 17916 -> 17857 (-0.33%); split: -0.40%, +0.07%
PreVGPRs: 16917 -> 16893 (-0.14%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14124>
2022-04-13 16:23:35 +00:00
Rhys Perry
9d1bab3615 aco: increase global_load_params.max_const_offset_plus_one
The callback now supports this. This shouldn't have any effect yet except
on GFX6 with 12 byte loads.

fossil-db (Pitcairn):
Totals from 246 (0.18% of 135668) affected shaders:
VGPRs: 14684 -> 14768 (+0.57%); split: -0.44%, +1.01%
CodeSize: 1765792 -> 1738040 (-1.57%)
Instrs: 344605 -> 340055 (-1.32%)
Latency: 4892904 -> 4861942 (-0.63%)
InvThroughput: 2479599 -> 2446070 (-1.35%)
VClause: 8782 -> 8735 (-0.54%)
SClause: 9854 -> 9853 (-0.01%)
Copies: 47327 -> 45401 (-4.07%); split: -4.08%, +0.01%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14124>
2022-04-13 16:23:35 +00:00
Rhys Perry
3e9517c757 aco: implement _amd global access intrinsics
fossil-db (Sienna Cichlid):
Totals from 7 (0.01% of 134621) affected shaders:
VGPRs: 760 -> 776 (+2.11%)
CodeSize: 222000 -> 222044 (+0.02%); split: -0.01%, +0.03%
Instrs: 40959 -> 40987 (+0.07%); split: -0.01%, +0.08%
Latency: 874811 -> 886609 (+1.35%); split: -0.00%, +1.35%
InvThroughput: 437405 -> 443303 (+1.35%); split: -0.00%, +1.35%
VClause: 1242 -> 1240 (-0.16%)
SClause: 1050 -> 1049 (-0.10%); split: -0.19%, +0.10%
Copies: 4953 -> 4973 (+0.40%); split: -0.04%, +0.44%
Branches: 1947 -> 1957 (+0.51%); split: -0.05%, +0.56%
PreVGPRs: 741 -> 747 (+0.81%)

fossil-db changes seem to be noise.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14124>
2022-04-13 16:23:35 +00:00
Rhys Perry
eeefe31014 ac/llvm: implement _amd global access intrinsics
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14124>
2022-04-13 16:23:35 +00:00
Rhys Perry
5c038b3f02 nir: add _amd global access intrinsics
These are the same as the normal ones, but they take an unsigned 32-bit
offset in BASE and another unsigned 32-bit offset in the last source.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14124>
2022-04-13 16:23:35 +00:00
Rhys Perry
391bf3ea30 aco: don't expand smem/mubuf global loads
For example, dwordx3->dwordx4 or ubyte3->dwordx2.

Global loads don't have the bounds checking that buffer loads have that
makes this safe.

The alignment checks are added to global_load_callback() in case
byte_align_loads=false, align=1 and bytes_needed=3. Without them, the
callback will create a dword load.

fossil-db (Sienna Cichlid):
Totals from 267 (0.20% of 134621) affected shaders:
CodeSize: 1603352 -> 1606568 (+0.20%)
Instrs: 294946 -> 295482 (+0.18%); split: -0.00%, +0.18%
Latency: 2997003 -> 2997052 (+0.00%); split: -0.02%, +0.02%
InvThroughput: 526645 -> 526659 (+0.00%)
SClause: 9179 -> 9185 (+0.07%); split: -0.02%, +0.09%
Copies: 25363 -> 25375 (+0.05%); split: -0.08%, +0.13%
Branches: 8298 -> 8299 (+0.01%)

fossil-db (Polaris10):
Totals from 267 (0.20% of 135668) affected shaders:
CodeSize: 1636672 -> 1638756 (+0.13%); split: -0.00%, +0.13%
Instrs: 308484 -> 308733 (+0.08%); split: -0.01%, +0.09%
Latency: 3446045 -> 3446904 (+0.02%); split: -0.00%, +0.03%
InvThroughput: 1206722 -> 1206828 (+0.01%); split: -0.00%, +0.01%
SClause: 9308 -> 9311 (+0.03%); split: -0.08%, +0.11%
Copies: 36933 -> 36921 (-0.03%); split: -0.08%, +0.05%

fossil-db (Pitcairn):
Totals from 275 (0.20% of 135668) affected shaders:
SGPRs: 17616 -> 17520 (-0.54%); split: -0.64%, +0.09%
VGPRs: 15428 -> 15540 (+0.73%); split: -0.23%, +0.96%
CodeSize: 1885792 -> 1929120 (+2.30%); split: -0.00%, +2.30%
MaxWaves: 1284 -> 1285 (+0.08%)
Instrs: 368963 -> 376095 (+1.93%); split: -0.00%, +1.94%
Latency: 5122922 -> 5168398 (+0.89%); split: -0.01%, +0.90%
InvThroughput: 2562866 -> 2604279 (+1.62%)
VClause: 9268 -> 9296 (+0.30%); split: -0.13%, +0.43%
SClause: 10702 -> 10705 (+0.03%); split: -0.05%, +0.07%
Copies: 48620 -> 50629 (+4.13%); split: -0.08%, +4.21%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14124>
2022-04-13 16:23:35 +00:00
Rhys Perry
6baad09711 aco: use saddr for global access with sgpr address
fossil-db (Sienna Cichlid):
Totals from 38 (0.03% of 134621) affected shaders:
CodeSize: 237196 -> 237060 (-0.06%); split: -0.09%, +0.03%
Instrs: 43895 -> 43894 (-0.00%); split: -0.02%, +0.01%
Latency: 914633 -> 916263 (+0.18%); split: -0.01%, +0.19%
InvThroughput: 468215 -> 468971 (+0.16%); split: -0.02%, +0.18%
SClause: 1239 -> 1242 (+0.24%)
PreSGPRs: 997 -> 1003 (+0.60%)
PreVGPRs: 936 -> 923 (-1.39%); split: -1.50%, +0.11%

Regression seems to be RA noise, creating a waitcnt.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14124>
2022-04-13 16:23:35 +00:00
Rhys Perry
d957730b9b aco: use vcc for 64-bit vgpr addition
fossil-db (Sienna Cichlid):
Totals from 229 (0.17% of 134621) affected shaders:
CodeSize: 1520192 -> 1517644 (-0.17%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14124>
2022-04-13 16:23:35 +00:00
Rhys Perry
0360e12ebf radv: don't require robust vectorization for nir_var_mem_global
Robust vectorization is to prevent vectorization of loads using the near
maximum offset with loads of offset 0. Global loads can't read from offset
0 (NULL) anyways, so this isn't necessary.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14124>
2022-04-13 16:23:35 +00:00
Jason Ekstrand
6ca328988f iris: Don't leak scratch BOs
Fixes: 4d219b0eb3 ("iris: implement scratch space!")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15897>
2022-04-13 15:56:50 +00:00
Timur Kristóf
394b93bfeb radv: Only use TES vertex offset 2 for triangles and quads.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15837>
2022-04-13 15:04:26 +00:00
Timur Kristóf
e02c71d6c5 radv: Fix gs_vgpr_comp_cnt for NGG VS without passthrough mode.
When not in passthrough mode, the NGG shader needs to calculate the
primitive export value from the input primitive's vertex indices.

So, GS vertex offset 2 is needed when NGG has triangles
and isn't in passthrough mode.

Fixes: 7ad69e2f7e "radv: stop loading invocation ID for NGG vertex shaders"
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15837>
2022-04-13 15:04:26 +00:00
Timur Kristóf
a7147ef1e8 nir: Handle out of bounds access in nir_vectorize_tess_levels.
Replace out of bounds loads with undef.
Then, delete instructions with out of bounds access.

Fixes: f5adf27fb9 "nir,radv: add and use nir_vectorize_tess_levels()"
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6264
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15775>
2022-04-13 13:25:10 +00:00
Timur Kristóf
b874a2ed61 aco: Fix VOP2 instruction format in visit_tex.
There was a v_or_b32 that accidentally used SOP2.
It should use VOP2.

Issue found by looking at a gfxreconstruct trace posted by a user
in this bug: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5838

Cc: mesa-stable
Fixes: 93c8ebfa78 "aco: Initial commit of independent AMD compiler"

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15923>
2022-04-13 13:06:49 +00:00
Rohan Garg
581035b3a9 iris: set a default EDSC flag
anv sets the default EDSC flag, do the same for iris too

Fixes: 5ae278da18 ("iris: use vtbl to avoid multiple symbols, fix state base address")

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15905>
2022-04-13 12:36:01 +00:00
Lionel Landwerlin
e11bedb9f5 intel/fs: add a note on possible optimization of root node address
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15910>
2022-04-13 11:24:49 +00:00
Lionel Landwerlin
9c0805ef91 intel/fs: fix metadata preserve on trace_ray intrinsic
c78be5da30 ("intel/fs: lower ray query intrinsics") introduced a
helper function using nir_(push|pop)_if which invalidated dominance &
block_index for the replacement of nir_intrinsic_rt_trace_ray.

We can still keep dominance/block_index metadata for the lowering of
nir_intrinsic_rt_execute_callable though.

This change uses 2 different lowering function with correct metadata
preservation.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c78be5da30 ("intel/fs: lower ray query intrinsics")
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15910>
2022-04-13 11:24:49 +00:00
Mike Blumenkrantz
fcd6b2a47a zink: avoid creating ssbo variable types with multiple runtime arrays
this is illegal

affects:
KHR-GL46.shader_storage_buffer_object.advanced-unsizedArrayLength-cs-packed-matC

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15894>
2022-04-13 10:50:22 +00:00
Mike Blumenkrantz
ff4dcb76d9 zink: use the calculated last struct member idx for ssbo size in ntv
this may or may not be 1

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15894>
2022-04-13 10:50:22 +00:00
Gert Wollny
a30ff90561 virgl: Fix relocating the re-writing the transformation code
The transformation must come before the code emission.

Fixes: 6a264e7024

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15919>
2022-04-13 12:02:17 +02:00
Kenneth Graunke
b7111f89e8 iris: Add VF_CACHE_INVALIDATE to IRIS_DOMAIN_OTHER_WRITE flush bits
Suggested by Francisco Jerez.

Although including VF invalidation in the flush bits is strange, we
believe this is the only way to guarantee that stream output has
finished.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15275>
2022-04-13 09:07:35 +00:00
Kenneth Graunke
a969ad1ddf iris: Demote DC flush to HDC flush in cache tracker
FLUSH_HDC is sufficient to flush things out to L3, so we'd rather
use that where possible.  It's also emulated via DATA_CACHE_FLUSH
on platforms where it isn't supported, so we can use it unconditionally.

We still use DATA_CACHE_FLUSH for invalidating the data cache, and to
flush the DC-tagged cachelines in L3 to be globally-observable.

Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15275>
2022-04-13 09:07:35 +00:00
Kenneth Graunke
1c8b4940eb iris: Emit flushes for push constant source buffers
Push constant loading is not coherent with L3 according to the document
that describes the hardware change for the vertex buffer L3 Bypass
Disable field.

If we've updated a push constant buffer with say, a blorp_buffer_copy,
we may need to flush both the render cache and the tile cache.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15275>
2022-04-13 09:07:35 +00:00
Kenneth Graunke
bbd5714a7e iris: Use cache-tracker for draw count flushing
We should be using the cache tracker for this.  We can consider
this access IRIS_DOMAIN_OTHER_READ now that it's the catch-all
non-L3-coherent read-only access domain.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15275>
2022-04-13 09:07:35 +00:00
Kenneth Graunke
9c8874b9ab iris: Add pre-draw flushing for stream output targets
When stream output is active, we need to let the cache tracker know
about any SO buffers, which we access via IRIS_DOMAIN_OTHER_WRITE.

In particular, we may have written to those buffers via another
mechanism, such as BLORP buffer copies.  In that case, previous writes
happened via IRIS_DOMAIN_RENDER_WRITE, in which case we'd need to flush
both the render cache and the tile cache to make that data globally-
observable before we begin writing via streamout, which is incoherent
with the earlier mechanism.

Fixes misrendering in Ryujinx.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6085
Fixes: d8cb76211c ("iris: Fix MOCS for buffer copies")
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15275>
2022-04-13 09:07:35 +00:00
Kenneth Graunke
43e3747eea iris: Extend the cache tracker to handle L3 flushes and invalidates
Most clients are L3-coherent these days.  However, there are some
notable exceptions, such as push constants, stream output, and command
streamer memory reads and writes.

With the advent of the tile cache, flushing the render or depth caches
alone are no longer sufficient for memory to become globally-observable.
For those, we need to flush the tile cache as well.  However, we'd like
to avoid that for L3-coherent clients, as it shouldn't be necessary,
and is expensive.

Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15275>
2022-04-13 09:07:35 +00:00
Kenneth Graunke
8cd7e94eca iris: Add a separate PIPE_CONTROL_L3_READ_ONLY_CACHE_INVALIDATE bit
This will let us use it without performing a VF cache invalidation,
should we want to do that.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15275>
2022-04-13 09:07:35 +00:00
Kenneth Graunke
b92cd58508 iris: Add an iris_is_domain_l3_coherent helper.
The render, depth, sampler, and data (HDC) caches are all coherent
with L3.  We consider OTHER_READ and OTHER_WRITE to be non-coherent,
as they're kitchen-sink domains which include non-L3-clients.

Starting with Tigerlake, the VF cache is coherent with L3 (because we
set the L3BypassDisable bit in the vertex/index buffer packets).

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15275>
2022-04-13 09:07:35 +00:00
Kenneth Graunke
536eee31d0 iris: Fix UBO cache tracking for the !indirect_ubos_use_sampler case
On Tigerlake, we use the data cache for reading indirect UBOs instead
of the sampler.  But we still use the constant cache for direct UBO
access, so unfortunately we may access it through two different domains.

To work around this, we add a new domain for pull constants (UBOs),
which will be either constant+texture or constant+data.

Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15275>
2022-04-13 09:07:35 +00:00
Kenneth Graunke
d39bd7ba70 iris: Split out an IRIS_DOMAIN_SAMPLER_READ domain from OTHER_READ
The bulk of IRIS_DOMAIN_OTHER_READ domain usage was the 3D sampler, but
there were also a few oddball cases like command streamer reads, blitter
access, and so on.  The sampler is definitely L3 coherent, but some off
the more esoteric reads may not be, so I'd like to separate them, so
that OTHER_READ can become a non-L3-coherent kitchen-sink domain.

The sampler cases only need TEXTURE_CACHE_INVALIDATE, and can skip the
CONSTANT_CACHE_INVALIDATE we had on IRIS_DOMAIN_OTHER_READ.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15275>
2022-04-13 09:07:35 +00:00
Kenneth Graunke
8e0ff0275d iris: Use IRIS_DOMAIN_DEPTH_WRITE for read only depth/stencil.
We were using IRIS_DOMAIN_OTHER_READ for read-only depth/stencil access
in an attempt to avoid unnecessary flushing; IRIS_DOMAIN_DEPTH_WRITE
could indicate read-write access.

However, IRIS_DOMAIN_OTHER_READ is clearly the wrong domain.  Depth and
stencil data is read via the depth cache, while IRIS_DOMAIN_OTHER_READ
currently corresponds to the sampler cache and constant cache together
(although this will change in future patches).

It's unclear whether this hack was useful.  For now, just drop it and
use the correct depth cache domain, even if it's marked as read-write.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15275>
2022-04-13 09:07:35 +00:00
Gert Wollny
6a264e7024 virgl: Apply integer op fix only for ALU ops and clear modifiers
For texture fetches and buffer load the fix is not needed,
and the override creates faulty TGSI.

In addition remove all modifiers from the src in the additional mov
instruction.

Fixes: d1c7a7b131
  virgl: Add an extra mov for int outputs from constant and immediate inputs

v2: Move workaround after the use of
    virgl_tgsi_rewrite_src_for_input_temp (Emma)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15896>
2022-04-13 08:56:47 +00:00
Gert Wollny
29564031cf r600: Assign shader type when creating a new CS state
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15898>
2022-04-13 08:48:13 +00:00
Kenneth Graunke
68ef895674 st/mesa: Transcode ASTC to BC7 (BPTC) where possible
This patch adds support for transcoding ASTC to BC7 (BPTC) and prefers
it over BC3 (DXT5) when hardware supports that format.

BC7 is a much newer format (~2009 vs. ~1999) and offers higher quality
than the older BC3 format.  Furthermore, our encoder seems to be faster.

Tapani put together a small benchmark for transcoding a 1024x1024 ASTC
texture, and switching from BC3 to BC7 improves performance of that
microbenchmark by 25% on my Tigerlake NUC (with hardware ASTC disabled
so we can test this path).  Presumably, this isn't fundamental to the
formats, but rather reflects the speed of our in-tree compressors.

So, we should use BC7 where possible.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15875>
2022-04-13 07:58:11 +00:00
Kenneth Graunke
d4521a2515 st/mesa: Make transcode_astc also check for non-SRGB format support
This is probably unnecessary in that all drivers which support the sRGB
format likely also support the non-sRGB format.  But we may as well
check both the formats we use, for documentation if nothing else.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15875>
2022-04-13 07:58:11 +00:00
Tomeu Vizoso
7d474c100e ci: Move most stuff out of root .gitlab-ci.yml
This file was getting a bit hard to navigate. Split container, build and
test jobs to their own files.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15891>
2022-04-13 07:34:36 +00:00
Tomeu Vizoso
2a578c6505 ci: Allow local installations to build additional stuff into the rootfs
This can make it more convenient for other projects to reuse these
scripts.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15891>
2022-04-13 07:34:36 +00:00
Tomeu Vizoso
e81693a1b4 ci: Add env var to add packages to install in debian/arm_build image
This can make it more convenient for other projects to reuse these
scripts.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15891>
2022-04-13 07:34:36 +00:00
Tomeu Vizoso
79aef41881 ci: Add env var to add packages to install in rootfs
This can make it more convenient for other projects to reuse these
scripts.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15891>
2022-04-13 07:34:36 +00:00
Tomeu Vizoso
b46000f076 ci: Allow specifying a different kernel in LAVA jobs
To make it possible to use a kernel different from that built along with
the rootfs.

This can make it more convenient for other projects to reuse these
scripts.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15891>
2022-04-13 07:34:36 +00:00
Tomeu Vizoso
f7713b0af0 ci: Use CI_PROJECT_NAME instead of hardcoding 'mesa'
This can make it more convenient for other projects to reuse these
scripts.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15891>
2022-04-13 07:34:36 +00:00
Lionel Landwerlin
3394680368 nir/lower_shader_calls: name resume shaders
Helpful when lost in a sea of NIR :)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15887>
2022-04-13 06:59:29 +00:00
Tomeu Vizoso
8506c2b7ee ci: Disable Google's lab
The runner is down and pipelines are being stuck.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15909>
2022-04-13 08:11:07 +02:00
Mike Blumenkrantz
c3ad1331be zink: rework choose_pdev to (finally) be competent
now zink will init using a priority system if multiple devices are available

multiple devices will ONLY be available if:
* the user does not specify VK_ICD_FILENAMES as they should
* the user does not specify LIBGL_ALWAYS_SOFTWARE
* multiple drivers exist

I've prioritized the virtualized gpu here with the assumption that if
such a thing is detected, the environment is most likely virtualized

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15857>
2022-04-13 00:14:57 +00:00
Mike Blumenkrantz
0c0ff57c61 aux/trace: clean up some zink+lavapipe tracing awfulness
now that it's easier to determine whether zink is being used (mostly),
this whole thing can be simplified

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15857>
2022-04-13 00:14:57 +00:00
Mike Blumenkrantz
d5ff82df38 zink: ZINK_USE_LAVAPIPE -> LIBGL_ALWAYS_SOFTWARE
this is a documented variable, so reuse it

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15857>
2022-04-13 00:14:57 +00:00
Mike Blumenkrantz
42ff02de14 egl: don't make LIBGL_ALWAYS_SOFTWARE and MESA_LOADER_DRIVER_OVERRIDE=zink exclusive
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15857>
2022-04-13 00:14:57 +00:00
Indrajit Kumar Das
3abc66dc9f ac/gpu_info: disallow displayable DCC for Navi12 and Navi14
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15813>
2022-04-12 23:52:24 +00:00
Jason Ekstrand
69b5424ea4 intel/nir: Lower 8 and 16-bit bitwise unops
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15829>
2022-04-12 23:19:38 +00:00
Jason Ekstrand
a482877c70 intel/fs: Implement 16-bit [ui]mul_high
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15829>
2022-04-12 23:19:38 +00:00
Jason Ekstrand
d0ace28790 nir/lower_int64: Fix [iu]mul_high handling
e551040c60, which added a new mechanism for 64-bit imul which is more
efficient on BDW and later Intel hardware also introduced a bug where we
weren't properly walking both X and Y.  No idea how testing didn't find
this.

Fixes: e551040c60 ("nir/glsl: Add another way of doing lower_imul64 for gen8+"
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6306
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15829>
2022-04-12 23:19:38 +00:00
Mike Blumenkrantz
48ae404b42 kopper: print better error message if loader not detected
silently failing on release builds is annoying

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15851>
2022-04-12 21:34:30 +00:00
Erico Nunes
cf1390e1b8 lima: fix vector const src referenced multiple times
It can happen that a single vector constant is referenced multiple times
by the same node, with different swizzles.
This needs to be taken into account by checking and updating the
swizzles for all the srcs of a target node when inserting the const
node to the same instruction.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15726>
2022-04-12 20:07:32 +00:00
Mike Blumenkrantz
19a22ae110 features: mark off ARB_seamless_cubemap_per_texture for zink
forgot to do this with the MR

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15902>
2022-04-12 19:12:57 +00:00
Gert Wollny
c3096e562d ntt: translate nir_intrinsic_shader_clock
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15889>
2022-04-12 18:47:08 +00:00
Mike Blumenkrantz
dea65ae590 zink: finish up radv piglit baseline updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15900>
2022-04-12 14:00:47 -04:00
Konstantin Seurer
521492e8b1 radv: Refactor ray tracing support checks
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15860>
2022-04-12 16:13:38 +00:00
Konstantin Seurer
a9fce44dd6 radv: Refactor radv_tex_aniso_filter
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15860>
2022-04-12 16:13:38 +00:00
Mike Blumenkrantz
6b65d4234c radv: set read/write without format flags for supported texel buffers
if the storage case is supported, this should be supported too

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15826>
2022-04-12 15:52:03 +00:00
Samuel Pitoiset
2b688942c1 Revert "radv: Disable NGG for GS with suboptimal output vertex count."
It breaks too many things and shouldn't have been merged. The fix isn't
trivial and it will probably not be backported because it's intrusive.

It will be re-applied later when everything will work.

This reverts commit 94706601fa.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15882>
2022-04-12 12:26:32 +00:00
Gert Wollny
e466d73368 r600: make r600_load_ar available to driver code
This is needed for the new NIR assembler

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15714>
2022-04-12 12:10:19 +00:00
Gert Wollny
050e05db22 r600: Set the last bit if an alu group is split by kcache allocation
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15714>
2022-04-12 12:10:19 +00:00
Gert Wollny
d920200ad6 r600: Force last instruction of group when starting a new CF
When emitting the AR forces splitting an ALU group, and at the same time
a new CF instruction is started, then the last instrcution in the finished
CF block might not have the "last" bit set, which results in an invalid
shader that might hang, or crash SB.
So when a new CF is started, force the last bit in the last ALU instruction.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15714>
2022-04-12 12:10:19 +00:00
Gert Wollny
04fd9a6488 r600: don't reschedule INTERP_LOAD_P0
With the NIR code, we have instructions groups that use
INTERP_LOAD_P0 that don't fill all slots. Just make sure
the backend scheduler doesn't fill in INTERP_LOAD_P0
instructions with a different LDS location.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15714>
2022-04-12 12:10:19 +00:00
Gert Wollny
3c4644afb0 r600: ignore dest sel for non-write targets when counting registers
Since the value is not written, there is no need to allocate
a register for it, so don't take it into account.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15714>
2022-04-12 12:10:19 +00:00
Gert Wollny
67d145d9ab r600: Don't limit scheduling of PARAM_SRC values
ALU_SRC_PARAM_BASE is an inline constant that defines the
address for pulling data from LDS memory for interpolation
and not a value from the kcache, so there is no need to
take these values into account when allocating kcache
load slots.

v2: Fix the constant range check to not exclude the translated
    ranges for kcache banks 2 and 3.
v3: limit range check to only include kcache values and and
    rename relevant function (Emma).

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15714>
2022-04-12 12:10:19 +00:00
Rhys Perry
f6262804af radv: increase inline push constant limit if we can inline all constants
fossil-db (Sienna Cichlid):
Totals from 665 (0.49% of 134627) affected shaders:
CodeSize: 4519620 -> 4491724 (-0.62%); split: -0.62%, +0.01%
Instrs: 842745 -> 837313 (-0.64%); split: -0.66%, +0.01%
Latency: 7289925 -> 7279661 (-0.14%); split: -0.30%, +0.16%
InvThroughput: 1240770 -> 1240639 (-0.01%); split: -0.01%, +0.00%
VClause: 15799 -> 15772 (-0.17%)
SClause: 33773 -> 32604 (-3.46%); split: -3.66%, +0.20%
Copies: 67695 -> 64992 (-3.99%); split: -4.49%, +0.50%
PreSGPRs: 38597 -> 38640 (+0.11%); split: -0.14%, +0.25%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12145>
2022-04-12 11:44:30 +00:00
Rhys Perry
773c7cbcbc radv,aco: implement 64-bit inline push constants
fossil-db (Sienna Cichlid):
Totals from 21 (0.02% of 134621) affected shaders:
CodeSize: 1932 -> 1560 (-19.25%)
Instrs: 357 -> 303 (-15.13%)
Latency: 6576 -> 5883 (-10.54%)
InvThroughput: 26304 -> 23532 (-10.54%)
SClause: 42 -> 24 (-42.86%)
Copies: 90 -> 105 (+16.67%); split: -10.00%, +26.67%
PreSGPRs: 144 -> 201 (+39.58%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12145>
2022-04-12 11:44:30 +00:00
Rhys Perry
7f6262bb85 radv: allow holes in inline push constants
Use a dword mask instead of a range to track which push constants to
inline.

fossil-db (Sienna Cichlid):
Totals from 5724 (4.25% of 134621) affected shaders:
CodeSize: 20894044 -> 20815748 (-0.37%); split: -0.39%, +0.02%
Instrs: 4002568 -> 3988385 (-0.35%); split: -0.38%, +0.02%
Latency: 29285060 -> 29224414 (-0.21%); split: -0.22%, +0.01%
InvThroughput: 5529700 -> 5526893 (-0.05%); split: -0.05%, +0.00%
VClause: 78093 -> 78240 (+0.19%); split: -0.23%, +0.41%
SClause: 135495 -> 131027 (-3.30%); split: -3.30%, +0.00%
Copies: 330856 -> 324552 (-1.91%); split: -2.37%, +0.46%
PreSGPRs: 226031 -> 224778 (-0.55%); split: -0.61%, +0.05%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12145>
2022-04-12 11:44:30 +00:00
Rhys Perry
72cf6cca91 radv: allow inline push constants in more situations
We don't need to disable this path if there are indirect or 8/16/64-bit
push constant loads. We can just use the default path for them.

fossil-db (Sienna Cichlid):
Totals from 21 (0.02% of 134621) affected shaders:
CodeSize: 2028 -> 1884 (-7.10%)
Instrs: 366 -> 363 (-0.82%); split: -2.46%, +1.64%
Latency: 6630 -> 6579 (-0.77%)
InvThroughput: 26520 -> 26316 (-0.77%)
Copies: 84 -> 102 (+21.43%)
PreSGPRs: 141 -> 222 (+57.45%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12145>
2022-04-12 11:44:30 +00:00
Mykhailo Skorokhodov
9c7e750ffe intel/fs: Enable b2f(inot(a)) and b2i(inot(a)) optimization for Gfx12+
The commit enables the optimization for Intel Gfx12+ graphics.

Tigerlake
```
total instructions in shared programs: 1289326 -> 1289015 (-0.02%)
instructions in affected programs: 37841 -> 37530 (-0.82%)
helped: 78
HURT: 9
helped stats (abs) min: 1 max: 26 x̄: 4.69 x̃: 3
helped stats (rel) min: 0.10% max: 12.50% x̄: 2.07% x̃: 1.21%
HURT stats (abs)   min: 1 max: 18 x̄: 6.11 x̃: 4
HURT stats (rel)   min: 0.16% max: 1.95% x̄: 0.94% x̃: 0.61%
95% mean confidence interval for instructions value: -4.95 -2.20
95% mean confidence interval for instructions %-change: -2.34% -1.18%
Instructions are helped.

total cycles in shared programs: 105606388 -> 105606442 (<.01%)
cycles in affected programs: 620119 -> 620173 (<.01%)
helped: 49
HURT: 28
helped stats (abs) min: 2 max: 3618 x̄: 228.63 x̃: 12
helped stats (rel) min: 0.02% max: 23.31% x̄: 4.60% x̃: 1.11%
HURT stats (abs)   min: 1 max: 2142 x̄: 402.04 x̃: 29
HURT stats (rel)   min: 0.01% max: 36.42% x̄: 5.01% x̃: 0.46%
95% mean confidence interval for cycles value: -151.80 153.20
95% mean confidence interval for cycles %-change: -3.00% 0.79%
Inconclusive result (value mean confidence interval includes 0).
```

Related-to: 7725d60938
Signed-off-by: Mykhailo Skorokhodov <mykhailo.skorokhodov@globallogic.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14017>
2022-04-12 10:55:05 +00:00
Gert Wollny
d1c7a7b131 virgl: Add an extra mov for int outputs from constant and immediate inputs
virglrenderer doesn't properly emit the conversion code when the source
is a integer value and the output is also integer.

Fixes on NTT:
  dEQP-GLES31.functional.shaders.sample_variables.sample_mask.inverse_per_*

v2: fix typo (Emma)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15836>
2022-04-12 10:44:17 +00:00
Gert Wollny
a083ae818a virgl: Always make some extra temps available for transformations
The host driver will optimize unused variables away, and checking thoroughly whether we
may need an extra temp is just uselessly costly.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15836>
2022-04-12 10:44:17 +00:00
Gert Wollny
a4a34cd323 virgl: Propagate precice flag through moves
NIR doesn't propagate precise through moves, and with NTT the
last output is usually preceded by a move, so that we no longer
see that the evaluation of some value is supposed to be exact,
and, hence we can't decorate the outputs accordingly.

Fixes with NTT:
 dEQP-GLES31.functional.tessellation.common_edge.
     triangles_equal_spacing_precise
     triangles_fractional_odd_spacing_precise
     triangles_fractional_even_spacing_precise
     quads_equal_spacing_precise
     quads_fractional_odd_spacing_precise
     quads_fractional_even_spacing_precise

v2: Don't clear the precise flag when we hit a mov, because we may
    hit a if/else construct like below and we don't track branches

    IF X
       TEMP[0] = OP_PRECICE ...
    ELSE
       TEMP[0] = MOV CONST[]
    ENDIF

    Thanks Emma for pointing out the problem.

v2: allocate precise handling flags to transform_prolog (Emma)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15836>
2022-04-12 10:44:17 +00:00
Juan A. Suarez Romero
0439f0e9fc ci: add Broadcom CI maintainer
Include in the CODEOWNERS file who to ping in case of issues with the
Broadcom (V3D/V3DV/VC4) CI.

v2:
 - Add Chema (Chema)

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Acked-by: Alejandro Piñeiro <apinheiro@igalia.com>
Acked-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15858>
2022-04-12 10:42:31 +00:00
Juan A. Suarez Romero
18c4ad6e3b CODEOWNERS: add Broadcom maintainers
v2:
 - Add more maintainers (Iago)

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Acked-by: Alejandro Piñeiro <apinheiro@igalia.com>
Acked-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15858>
2022-04-12 10:42:31 +00:00
Gert Wollny
c63424b2eb r600: Only emit the NOP group triggered by dest.rel after a full group
In addition really fill all slots, because otherwise the alu-group merger
might move a read from the indirectly written register into the 't' slot.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15848>
2022-04-12 10:33:58 +00:00
Icecream95
fc6f141304 drm-shim: Implement a shim function for close
Remove the fd from the fd_map, so that if the fd is later reused for
another file then mmap won't be intercepted.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12203>
2022-04-12 10:01:39 +00:00
Icecream95
c9eec12be7 drm-shim: Explicitly use off64_t for the offset to drm_shim_mmap
drm_shim.c undefines the _FILE_OFFSET_BITS macro, so plain off_t might
be 32 bits, while it's 64 bits in device.c. To avoid this mismatch,
use off64_t which will always be 64 bits in both source files.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12203>
2022-04-12 10:01:39 +00:00
Icecream95
11ab86d581 drm-shim: Return fake render nodes in /dev/dri first
loader_open_render_node returns the first device in /dev/dri that it
can use. To make sure the drm-shim device always gets chosen, return
the fake entries in readdir before returning the real ones.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12203>
2022-04-12 10:01:39 +00:00
Icecream95
dfd30035b9 drm-shim: Add a function for mmap64 rather than using an alias
Fixes build on 32-bit systems.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12203>
2022-04-12 10:01:39 +00:00
Marcin Ślusarz
9b23aaf3cf nir: remove gl_PrimitiveID output from MS when it's not used in FS
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15340>
2022-04-12 09:35:26 +00:00
Marcin Ślusarz
65600a34c2 anv: initialize 3DMESH_1D.ExtendedParameter0 when ExtendedParameter0Present
When IndirectParameterEnable==true it's not actually used by the hardware,
but if it's not initialized and INTEL_DEBUG=bat is set, then Valgrind complains.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15850>
2022-04-12 09:10:31 +00:00
Marcin Ślusarz
f844ce66c8 anv: fix push constant lowering for task/mesh
Fixes: a6031cd9bd ("anv: fix push constant lowering with bindless shaders")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15850>
2022-04-12 09:10:31 +00:00
Timothy Arceri
20ab7046c0 glsl/st: use nir pass to lower indirect rather than GLSL IR
Will allow us to drop more GLSL IR code in future once we switch
all drivers to NIR. Also stops the need for all drivers to call
this pass to remove indirect temps that may have been added during
the NIR varying linking lowering/optimisations.

This patch fixes some tests on i915, d3d12, lima and vc4.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15871>
2022-04-12 06:51:20 +00:00
Samuel Pitoiset
619e6d44eb radv: add few helpers to deal with pipeline layout
With VK_EXT_graphics_pipeline_library, we will have to support
independent sets and also to merge sets from different libraries.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15849>
2022-04-12 06:31:33 +00:00
Samuel Pitoiset
c338bd2957 radv: remove unused radv_pipeline_layout::size field
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15849>
2022-04-12 06:31:33 +00:00
Samuel Pitoiset
dca28a6355 radv: drop the remaining uses of shader modules
With VK_EXT_graphics_pipeline_library, shader modules can be NULL and
be passed via the pNext of VkPipelineShaderStageCreateInfo. To prepare
for this, just store everything we need to radv_pipeline_stage.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15847>
2022-04-12 06:13:24 +00:00
Samuel Pitoiset
b48231cb90 radv: store the shader sha1 to radv_pipeline_stage
To remove use of shader modules completely in the next commit.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15847>
2022-04-12 06:13:24 +00:00
Samuel Pitoiset
c1b9c1269d radv: replace convert_rt_stage() by vk_to_mesa_shader_stage()
Mesa shader stages are correctly sorted.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15847>
2022-04-12 06:13:24 +00:00
Pavel Ondračka
f1202a92cf nine: check hardware support before using vertex texture
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15864>
2022-04-12 07:38:47 +02:00
Mike Blumenkrantz
d637eee212 zink: create pipeline layout if only bindless descriptor set is used
bindless descriptors are descriptors too.

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15853>
2022-04-12 04:49:17 +00:00
Mike Blumenkrantz
23c758807e zink: handle 0 ubos and 0 ssbos in pipeline layout
this is the number of types needed, and it can be zero

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15853>
2022-04-12 04:49:17 +00:00
Mike Blumenkrantz
c7ae22e4b8 zink: prune unused st-injected pointsize exports
only the last vertex stage needs to keep these, so prune any that aren't
being weirdly passed through

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15853>
2022-04-12 04:49:17 +00:00
Mike Blumenkrantz
cf3f3791e3 zink: try copy region first for non-resolve blits
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15853>
2022-04-12 04:49:17 +00:00
Mike Blumenkrantz
327ca3e5ef zink: refactor copy_region path in zink_blit to util function
no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15853>
2022-04-12 04:49:17 +00:00
Dave Airlie
60c61d7b68 draw: handle tess eval shader when getting num outputs
This tripped up some pointsize/prim id interactions with zink.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15872>
2022-04-12 14:21:41 +10:00
Emma Anholt
835704e669 turnip: Move autotune buffers to suballoc.
Now the ANGLE trex_200 trace replay does a single BO allocation at startup
for autotune results instead of one per frame (~350 for the whole replay).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15038>
2022-04-12 01:01:56 +00:00
Emma Anholt
7c636acd53 turnip: Get autotune off of ralloc destructors.
We've wanted to remove destructors from ralloc's API for a long time (it's
an extra storage cost per ralloc for a rarely-used feature), and for the
suballoc change we'd need to spend more storage on storing the tu_device
pointer per result since destructors don't get anything else but the
pointer passed into them.

Fixes use-after-frees:

=================================================================
==2383==ERROR: AddressSanitizer: heap-use-after-free on address 0xffff88fe1940 at pc 0xffff934f427c bp 0xfffff5481e90 sp 0xfffff5481ea8
WRITE of size 8 at 0xffff88fe1940 thread T0
    #0 0xffff934f4278 in list_del ../src/util/list.h:108
    #1 0xffff934f4278 in result_destructor ../src/freedreno/vulkan/tu_autotune.c:237
    #2 0xffff9377793c in unsafe_free ../src/util/ralloc.c:300
    #3 0xffff9377793c in ralloc_free ../src/util/ralloc.c:265
    #4 0xffff934f4368 in history_destructor ../src/freedreno/vulkan/tu_autotune.c:229
    #5 0xffff9377793c in unsafe_free ../src/util/ralloc.c:300
    #6 0xffff9377793c in ralloc_free ../src/util/ralloc.c:265
    #7 0xffff934f5990 in tu_autotune_on_submit ../src/freedreno/vulkan/tu_autotune.c:442
[...]

0xffff88fe1940 is located 80 bytes inside of 112-byte region [0xffff88fe18f0,0xffff88fe1960)
freed by thread T0 here:
    #0 0xffff9c1c90d8 in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:127
    #1 0xffff934f4368 in history_destructor ../src/freedreno/vulkan/tu_autotune.c:229
    #2 0xffff9377793c in unsafe_free ../src/util/ralloc.c:300
    #3 0xffff9377793c in ralloc_free ../src/util/ralloc.c:265
    #4 0xffff934f5990 in tu_autotune_on_submit ../src/freedreno/vulkan/tu_autotune.c:442
    #5 0xffff935cf2ac in tu_queue_submit_locked ../src/freedreno/vulkan/tu_drm.c:997
[...]

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15038>
2022-04-12 01:01:56 +00:00
Emma Anholt
435d4f08b2 turnip: Reduce the pipeline's CS allocation a bit.
We don't return unused space to the suballocator, so it's a little useful
to limit how much we overallocate to reduce memory footprint.  I took a
look through the tu_cs_emit_array() calls and accounted for a couple of
them in the variant-specific space calculation, then dropped the base
allocation by factors of 2 until we started throwing asserts.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15038>
2022-04-12 01:01:56 +00:00
Emma Anholt
58f6331eec turnip: Skip telling the kernel the BO list when we don't need any.
In fencing, we sometimes do a dummy submit with no nr_cmds.  If we don't
have commands to execute, we don't need to pin or fence any BOs either.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15038>
2022-04-12 01:01:56 +00:00
Emma Anholt
dc3203b087 turnip: Sub-allocate pipelines out of a device-global BO pool.
Allocating a BO for each pipeline meant that for apps with many pipelines
(such as Asphalt9 under ANGLE), we would end up spending too much time in
the kernel tracking the BO references.

Looking at CS:Source on zink, before we had 85 BOs for the pipelines for a
total of 1036 kb, and now we have 7 BOs for a total of 896 kb.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15038>
2022-04-12 01:01:56 +00:00
Emma Anholt
e0fbdd3eda turnip: Stop allocating unused pvtmem space in the pipeline CS.
The pvtmem was split off to a separate read/write BO.

Fixes: 931ad19a18 ("turnip: make cmdstream bo's read-only to GPU")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15038>
2022-04-12 01:01:56 +00:00
Emma Anholt
80c44a6626 turnip: Track refcounts on BOs in kgsl as well.
I'm going to be using the BO refcount for the pipeline and autotune buffer
suballocation.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15038>
2022-04-12 01:01:56 +00:00
Francisco Jerez
e858da39e5 intel/perf: Fix OA report accumulation on Gfx12+.
The intel_perf_query path used for performance queries on GL was
passing a bogus "end" pointer to intel_perf_query_result_accumulate(),
causing it to accumulate garbage values.  This was causing the values
of many performance counters to be corrupted.

The "end" pointer was incorrect because the current code was assuming
that different OA reports were located TOTAL_QUERY_DATA_SIZE bytes
apart, which is a hard-coded preprocessor define.  However recent
(Gfx12+) hardware generations use a variable query size determined by
the query layout.  Use the size derived from it instead, and remove
the stale define.

Fixes: 3c51325025 ("intel/perf: switch query code to use query layout")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15783>
2022-04-12 00:11:47 +00:00
Dave Airlie
6f98dc535a zink/query: refactor out vk queries and allow sharing them
gallium queries have to be mapped onto multiple vulkan queries,
this can happen for two reasons.

1. primitives generated and overflow any don't map directly, and
multiple vulkan queries are needs per iteration. These are stored
inside the "starts" as zink_vk_query ptrs.

2. suspending/resuming queries uses multiple queries, these are
the "starts". Every suspend/resume cycle adds a new start.

Vulkan also requires that multiple queries of the same time don't
execute at once, which affects the overflow any vs xfb normal
queries, so vk_query structs are refcounted and can be shared
between starts. Due to this when the draw state changes, it's
simple to just suspend/resume all queries so the shared vulkan
queries get handled properly.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15785>
2022-04-12 00:01:23 +00:00
Pavel Ondračka
ef2b8f56b1 r300: move pointer dereference after a NULL check
Vs state can be NULL by the time r300_set_constant_buffer is called.
We don't hit this with OpenGL though, so this is why I didn't spot
this in my testing, but nine hits this codepath. Restore the original
behavior here.

Fixes: 882811b1ff
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15842>
2022-04-11 20:48:11 +00:00
Mike Blumenkrantz
2149f12c1e zink: add issue notes for remaining radv fails
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15867>
2022-04-11 20:18:09 +00:00
Jocelyn Falempe
744cf02fbc llvmpipe: remove unused array
chans variable doesn't need to be an array.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6204
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15556>
2022-04-11 19:56:31 +00:00
Jocelyn Falempe
fbe392d16b llvmpipe: fix color rendering on big endian.
Some colors were missing/inverted on big endian machine(s390x).
because blend_type.length > src_fmt->nr_channels.
In my case, blend_type has 4 channels (rgba) but src_fmt has only 3.

So the from_lsb was wrong by 1, and channels got messed up.
(blue was always 255, green -> red, and blue -> green).

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6204
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15556>
2022-04-11 19:56:31 +00:00
Mike Blumenkrantz
960119008b zink: update radv piglit baseline
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15865>
2022-04-11 19:44:44 +00:00
Kenneth Graunke
b05ac36f01 intel/genxml: Add SAMPLER_MODE bits for enabling Small PL on Icelake
This enables a lower power mode in the sampler hardware in certain
common scenarios.  On Tigerlake, SAMPLER_MODE is not programmable by
userspace but the kernel already sets this bit for us.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15628>
2022-04-11 19:17:07 +00:00
Kenneth Graunke
e3defe7ae7 intel/genxml: Delete SAMPLER_MODE register definition on Gfx12+
While this register still exists, it's no longer a per-context register.
Instead, on Gfx12+, SAMPLER_MODE exists per dual-subslice and is
accessed as a "multicast" register, where you write control which
version is accessed by the "steering control register".

At any rate, userspace cannot write it any longer, and so there's not
much point to it existing in our genxml (which was missing most of the
fields anyway).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15628>
2022-04-11 19:17:07 +00:00
Kenneth Graunke
8092704705 intel/genxml: Add new "Low Quality Filter" field on Gfx12+.
This allows the sampler to perform faster filtering of 8-bit UNORM
textures by filtering them at a different precision.  The filtering
is intended to still be OpenGL and DirectX spec compliant.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15628>
2022-04-11 19:17:07 +00:00
Kenneth Graunke
9a70385e2b intel/genxml: Add SAMPLER_STATE::Allow Low Quality LOD Calculation field
This allows the hardware to perform a faster LOD calculation in many
simple cases.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15628>
2022-04-11 19:17:07 +00:00
Juan A. Suarez Romero
3ac7383843 ci: enable v3dv arm64 jobs
This reverts commit f567a832ee.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15856>
2022-04-11 15:26:58 +00:00
Mike Blumenkrantz
809dc31223 zink: reorganize radv ci baseline
categorize known fails and move remainder to top of file for better
visibility

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15855>
2022-04-11 09:15:11 -04:00
Mike Blumenkrantz
5abd95434e zink: update radv ci baseline
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15855>
2022-04-11 09:12:08 -04:00
Boris Brezillon
bc58b34087 dzn: Fix loop condition in dzn_descriptor_set_copy()
We need to make sure we still have descriptors to copy in the
while() condition. While at it, drop the assert() checking that
the number of descriptors already copied is less than the
requested number.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15828>
2022-04-11 07:04:24 +00:00
Mike Blumenkrantz
7744a477e8 zink: only do swapchain update during fb setup if swapchain is active
otherwise this explodes blitter operations

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15809>
2022-04-11 04:03:33 +00:00
Yonggang Luo
6d263ff5a3 util: Convert util/u_printf.cpp to util/u_printf.c
By doing this to remove the need of C++ runtime when not using llvmpipe

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15659>
2022-04-11 03:31:40 +00:00
Yonggang Luo
1dca31cda6 util: Add tests for u_printf.h
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15659>
2022-04-11 03:31:40 +00:00
Mike Blumenkrantz
bcf5d2d8f4 zink: force texture barriers when performing in-renderpass clears
according to spec, a barrier is required any time the pixels of the
framebuffer are changed. since zink defers clears and runs them at
a later time, it must also be responsible for handling the required
synchronization for such operations

fixes (radv):
KHR-GL46.blend_equation_advanced.blend_all*

fixes #5572

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15831>
2022-04-11 01:11:07 +00:00
Mike Blumenkrantz
4f6f34456a zink: rework texture_barrier hook
according to spec, for fbfetch this should match the subpass self-dependency of
* stage   FRAGMENT_STAGE -> FRAGMENT_STAGE
* access  0 -> INPUT_ATTACHMENT_READ

zs fbfetch doesn't seem to be a thing, so that code is left for historical
and/or future purposes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15831>
2022-04-11 01:11:07 +00:00
Mike Blumenkrantz
aced1ac2d3 zink: add a self-dependency for fbfetch renderpasses
it's necessary to have a self-dependency here so that texture barriers
can be emitted during the renderpass to enable fbfetch

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15831>
2022-04-11 01:11:07 +00:00
Mike Blumenkrantz
42bb760c8d zink: remove compiled conditional for lavapipe usage
this is super annoying since it means that a build of zink cannot
be mix-and-matched with an existing build of lavapipe, e.g., for faster
bisecting

the env var should be sufficient to handle this, and if someone sets it
and doesn't have swrast enabled then they can deal with it

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15844>
2022-04-11 00:59:15 +00:00
Dave Airlie
dd078d13cb zink: fix tessellation shader key matching.
I happened to run heaven with tess enabled on zink and was seeing 6fps,
and lots of shader recompiles, turns out the tess shader key was
never getting matched properly.

Fixes: 62b8daa889 ("zink: set shader key size to 0 for non-generated tcs")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15843>
2022-04-11 00:16:26 +00:00
Mike Blumenkrantz
ec05155c30 zink only use zs-specific layout for zs attachments
otherwise this is illegal

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15833>
2022-04-11 00:05:02 +00:00
Mike Blumenkrantz
97d5ebc93e zink: clamp cube size queries to 2 return components
more validation spam eliminated

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15833>
2022-04-11 00:05:02 +00:00
Icecream95
ab3ee60282 util/hash_table: Remove Unicode byte order mark
The mark can confuse utilities which do not support Unicode, and no
other file has the character.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15728>
2022-04-10 23:28:47 +00:00
Mike Blumenkrantz
ee2741e451 zink: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15821>
2022-04-10 16:45:15 +00:00
Mike Blumenkrantz
ee29db0270 mesa/st: handle adding pointsize when gl_Position is never written
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15821>
2022-04-10 16:45:15 +00:00
Mike Blumenkrantz
9c212e117d nir/lower_point_size_mov: handle case where gl_Position isn't written
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15821>
2022-04-10 16:45:15 +00:00
Mike Blumenkrantz
cfca760d6e mesa/st: handle copy_deref cases for adding pointsize
these may not have been lowered yet

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15821>
2022-04-10 16:45:15 +00:00
Mike Blumenkrantz
a2823747bb mesa/st: fix pointsize adding check
* components is already multiplied by 4
* also verify base maxcomponents for gs

fixes #6282

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15821>
2022-04-10 16:45:15 +00:00
Mike Blumenkrantz
6357ce2b8e mesa: set PointSizeIsOne on context creation
forgot to add this when inverting the flag's meaning previously

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15821>
2022-04-10 16:45:15 +00:00
Mike Blumenkrantz
f567a832ee ci: disable v3dv arm64 jobs
these have been broken for almost 48 hours

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15841>
2022-04-10 12:25:39 -04:00
Icecream95
5da8c280b7 panfrost: Remove BO mapping from import
BOs will be mapped when needed, so there is no need to mmap BOs when
importing them.

Fixes crashes when exporting a non-AFBC resource and importing it back
in the same context.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15818>
2022-04-10 01:51:04 +00:00
Mihai Preda
279eea5bda amd/llvm: Transition to LLVM "opaque pointers"
For context, see LLVM opaque pointers:
https://llvm.org/docs/OpaquePointers.html
https://llvm.org/devmtg/2015-10/slides/Blaikie-OpaquePointerTypes.pdf

This fixes the deprecation warnings in src/amd/llvm only.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15572>
2022-04-09 05:20:29 +00:00
Emma Anholt
6c0150c389 ci/zink: Mark a new GLX flake that hit an innocent MR.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15834>
2022-04-09 00:30:34 +00:00
Yiwei Zhang
a263da69ec venus: prepare and feed renderer protocol info into cs
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15495>
2022-04-09 00:19:05 +00:00
Yiwei Zhang
440705d78f venus: update protocol for mask helper and ignore renderer unknown pNext
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15495>
2022-04-09 00:19:05 +00:00
Yiwei Zhang
0de968f71c venus: add cs helper stubs to be used by protocol
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15495>
2022-04-09 00:19:05 +00:00
Yiwei Zhang
2223f13b26 venus: store extension mask in renderer info
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15495>
2022-04-09 00:19:05 +00:00
Emma Anholt
be713e15ab ci/softpipe: Mark some flakes that have appeared across a few MRs.
This MR got hit by one, so I checked the logs for the recent NEW flakes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15540>
2022-04-08 23:56:11 +00:00
Emma Anholt
00e9c4f3c9 st/glsl-to-tgsi: Fix handling of csel(bool, vec, vec).
We were throwing an assertion failure across shader-db on nv92.  I'm
guessing this is a regression from !14573.

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15540>
2022-04-08 23:56:11 +00:00
Emma Anholt
9b02587c5b ci/crocus: Disable pixmark-piano trace testing.
It hangchecked for me on hsw recently, too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15832>
2022-04-08 23:32:11 +00:00
Emma Anholt
8238658a81 ci/iris: Disable pixmark-piano trace testing.
It gave me a spurious hangcheck on
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/20946403, and this trace
causes trouble for a lot of drivers so just disable it on all iris.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15832>
2022-04-08 23:32:11 +00:00
Emma Anholt
5a1d19e945 tgsi/transform: Drop a stale comment.
This method returns void.

Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15782>
2022-04-08 21:31:44 +00:00
Emma Anholt
ef9f2e8829 tgsi/transform: Make tgsi_transform_shader() manage token allocation.
Previously, the caller allocated storage and tgsi_transform_shader() would
emit into that, returning how many tokens it emitted.  All the callers had
to guess at how much storage was necessary, trying not to over-allocate
but also getting enough that you wouldn't (effectively) silently run out
of space.

Instead, make tgsi_transform_shader() do the allocation for you, taking
just a hint of how much space you think you need, and internally double
size when necessary.  Fixes failures on virgl with fp64 since we've added
more fp64 virglrenderer workarounds and its old "XXX: is this enough?"
allocation wasn't any more.

Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15782>
2022-04-08 21:31:44 +00:00
Emma Anholt
e15154a735 nir_to_tgsi: Fix the address reg mapping for images and SSBOs to match G-T-T.
I missed these in the previous fix to mimic GLSL-to-TGSI address reg
behavior, which r600 relies on.

Fixes: 4bb9c0a28a ("nir_to_tgsi: Use the same address reg mappings as GLSL-to-TGSI did.")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15824>
2022-04-08 21:01:42 +00:00
Emma Anholt
664f69a4d5 nir_to_tgsi: Extract const components of atomic counter offsets into Index.
virglrenderer maps atomic accesses to atomic counter declarations using
the .Index field.  We were previously emitting a .Index of 0 for array
accesses, so virglrenderer would emit
atomicIncrement(first_counter[counter_offset+array_index]).  This would
mostly work because hardware doesn't care about the bounds of counter
declarations, but if the first counter was a non-array, then the [] GLSL
emit gets dropped (can't array access a scalar!) and you'd access the
non-array first_counter instead.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15824>
2022-04-08 21:01:42 +00:00
Emma Anholt
8dcf7646ce r600: Add a helper function for rat_index_mode, with documentation and assert.
We have some special requirements on the address regs of our incoming
TGSI, which nir_to_tgsi violated.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15824>
2022-04-08 21:01:42 +00:00
Emma Anholt
9674d96820 r600: Stop using ArrayID to look up atomic counters.
Even if you find a matching array ID, you still need to offset by Index
compared to .start, so the ArrayID lookup didn't help.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15824>
2022-04-08 21:01:42 +00:00
Mike Blumenkrantz
0bfb3b0436 zink/kopper: don't use generated include in kopper interface
this causes build race conditions

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15830>
2022-04-08 16:33:05 -04:00
Mike Blumenkrantz
b6ddf8f0a4 zink: don't generate VK_ACCESS_SHADER_READ_BIT barrier for vertex inputs
this is both redundant and illegal

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15827>
2022-04-08 20:05:24 +00:00
Mike Blumenkrantz
3bd9fcfa3d zink: don't rely on implicit access for generated barriers
compute shaders will get this wrong, so calculate access manually
using binding info

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15827>
2022-04-08 20:05:24 +00:00
Mike Blumenkrantz
a72f05ff96 zink: add handling for !sync2 in renderpass dependencies
src/dst stage can't be zero without sync2

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15827>
2022-04-08 20:05:24 +00:00
Mike Blumenkrantz
b7e05c56a4 zink: hook up sync2 extension
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15827>
2022-04-08 20:05:24 +00:00
Mike Blumenkrantz
46bbf49607 zink: bitcast InterpolateAtOffset offset to fvec
required by spec

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15827>
2022-04-08 20:05:24 +00:00
Mike Blumenkrantz
ac8337041c zink: clamp out partial texels when creating bufferviews
this is an illegal alignment, so clamp the range to the nearest
texel offset since the shader should be hitting the robustness
case for the partial texel

affects:
dEQP-GLES31.functional.texture.texture_buffer.modify.mapbuffer_readwrite.range_size_65537

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15827>
2022-04-08 20:05:24 +00:00
Mike Blumenkrantz
b3ee943050 zink: only get swapchain present semaphore on batch flush if not presented
otherwise this has already been present-waited and can just be used whenever

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15820>
2022-04-08 19:54:08 +00:00
Mike Blumenkrantz
21496dea9c zink: only get swapchain present semaphore on batch flush after acquire
otherwise this was a no-op flush from the frontend that should be ignored

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15820>
2022-04-08 19:54:08 +00:00
Mike Blumenkrantz
00e846ba88 zink: unset deferred present barrier on flush
don't need to flush this every frame

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15820>
2022-04-08 19:54:08 +00:00
Mike Blumenkrantz
f0a3a4d2f1 zink: only trigger deferred present barrier if swapchain has acquired
otherwise this was just pointlessly flushed by the frontend and
can be ignored

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15820>
2022-04-08 19:54:08 +00:00
Dave Airlie
165b016bbe radv: use flush vgt streamout like PAL does.
This uses WRITE_DATA on the ME engine to reset the register, to match what
PAL does on GFX9+.

This fixes
KHR-GL45.transform_feedback_overflow_query_ARB.multiple-streams-one-buffer-per-stream
on zink/radv.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15812>
2022-04-08 18:59:15 +00:00
Vitalii.Lomaka
1407a4db69 intel/batch-decoder: Fix uninitialized scalar variables
CID: 1498516
CID: 1498560

Signed-off-by: Vitalii Lomaka <vitalii.lomaka@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15685>
2022-04-08 18:35:34 +00:00
Mike Blumenkrantz
387f6e0173 zink: don't emit SpvCapabilityStorageImageMultisample for fbfetch
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15823>
2022-04-08 18:24:30 +00:00
Mike Blumenkrantz
538472e279 zink: handle multisampled fbfetch
this uses a shader key to flag the fbfetch as per-sample

it doesn't work, but at least it doesn't error anymore?

Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15823>
2022-04-08 18:24:30 +00:00
Mike Blumenkrantz
1dd89cc09c zink: handle SUBPASS_MS in ntv
for completeness but also maybe fbfetch

Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15823>
2022-04-08 18:24:30 +00:00
Jordan Justen
4862010141 intel/dev: Add ATS-M pci-ids
Ref: Bspec 44477
Ref: https://patchwork.freedesktop.org/series/101907/
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15814>
2022-04-08 17:48:13 +00:00
Emma Anholt
949bc15ea5 nir_to_tgsi: Fix emitting the sample number for non-array MSAA image access.
It's always in .w, rather than being the next component after the
x/y/array index.

Fixes: c6d3fd8c21 ("gallium/ntt: Emit sample index when necessary for image load/store.")

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15825>
2022-04-08 17:17:16 +00:00
Emma Anholt
b18374002e virgl: Disable nir_op_ffloor to avoid sending DFLR to virglrenderer.
This means that we send ffract+fsub in place of a normal FLR, but
hopefully virglrenderer can be fixed (or doubles support removed).

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15825>
2022-04-08 17:17:16 +00:00
Samuel Pitoiset
a652c1653a radv: introduce new radv_pipeline_stage structure
This is used to store everything for a pipeline stage like the module,
the NIR, the shader arguments etc. This is inspired from ANV.

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/15794>
2022-04-08 16:38:30 +00:00
Samuel Pitoiset
86b1a1d5f2 radv: add missing multi inclusion define to radv_shader_args.h
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/15794>
2022-04-08 16:38:30 +00:00
Samuel Pitoiset
000e9ac874 radv: rework pipeline and shaders creation feedback
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/15794>
2022-04-08 16:38:30 +00:00
Samuel Pitoiset
1387593fbf radv: re-order shader stages directly in radv_create_shaders()
We will have to access pStages::pNext for modules and this will also
allow to rework feedback creation.

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/15794>
2022-04-08 16:38:30 +00:00
Rajnesh Kanwal
748c1fdf1b pvr: Remove logic to set vk_device::alloc.
The field is being already set by vk_device_init().

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15768>
2022-04-08 15:12:04 +00:00
Iago Toral Quiroga
40f0c616e8 v3dv: fix bogus VkDrmFormatModifierProperties2EXT usage
The array is allocated for VkDrmFormatModifierPropertiesEXT, so
writring entried with type VkDrmFormatModifierProperties2EXT is
bogus.

It seems this was a mistake added with a change intended to get
rid of VK_OUTARRAY_MAKE, that changed the type of the write by
mistake.

Fixes: 56a2ccf058 ('v3dv: Stop using VK_OUTARRAY_MAKE()')

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15819>
2022-04-08 14:43:25 +00:00
Tomeu Vizoso
30be6788cc ci: Disable Link Power Management with RTL8153
There are reliability problems with the RTL8153 ethernet driver under
certain network loads, related to incompatibility of the device with
Link Power Management.

Add usbcore.quirks=0bda:8153:k to the kernel command line to enable the
USB_QUIRK_NO_LPM option.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15791>
2022-04-08 14:07:31 +00:00
Tomeu Vizoso
9d5fa59322 Revert "ci/freedreno: Disable a618 jobs"
This reverts commit 96e17287b4.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15791>
2022-04-08 14:07:31 +00:00
Juan A. Suarez Romero
36066702ad v3d: do not leak BO on query begin
This happens when we have a sequence of multiple beginQuery / endQuery
with the same target and query identifier.

As a BO is created on beginQuery but not free on endQuery (we need to
wait until either explicitly deleting the query or querying the
results), in the above sequence we are basically leaking the BO.

This ensures that any BO created before is unreference before creating
the new one.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15796>
2022-04-08 13:51:25 +00:00
Erik Faye-Lund
82ca8a707e wgl: do not disable error-dialogs by default
We don't know if an application developer wants error-dialog by default
or not, even when using a Mesa OpenGL driver.

So let's not assume this is a good thing, and instead make an option for
this behavior that we can enable for CI testing.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15485>
2022-04-08 13:15:12 +00:00
Erik Faye-Lund
ae73a26355 util: limit error-dialogs to win32
These dialogs only exist on Windows, so let's not even expose a util
function for this on other platforms.

The code is only ever called from Windows specific code anyway.

While we're at it, clean up the name a bit as well.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15485>
2022-04-08 13:15:12 +00:00
Erik Faye-Lund
116553b554 wgl: rename force-msaa env-var
This env-var is not specific to the SVGA driver, so we should rename it
for consistency.

While we're at it, let's document the feature.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15485>
2022-04-08 13:15:12 +00:00
Timur Kristóf
94706601fa radv: Disable NGG for GS with suboptimal output vertex count.
When GS has a lot of output vertices: In this case,
the occupancy of NGG GS is very low because API GS invocations
can't even occupy a single Wave32 wave.
Therefore the legacy pipeline performs better here.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6260
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15767>
2022-04-08 12:35:05 +00:00
Boris Brezillon
53e83b7031 dzn: Support independent depth/stencil access
Needed for VK_KHR_maintenance2. While at it, fix various places where
we were only issuing resource state transition on the first sub-resource
instead of doing it per-layer/aspect.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:44 +00:00
Boris Brezillon
69e8a6042f dzn: Fix 2D <-> 3D blits
layer_count == 1 doesn't imply image_is_3d. So let's add explicit
is_3d checks where appropriate.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:44 +00:00
Boris Brezillon
451a43ae1e dzn: Lower partial copy of multisample resources to blits
Unfortunately that won't work on transfer queues, but we don't have a
better option right now.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:44 +00:00
Boris Brezillon
f0667be8b5 vulkan/util: Make STACK_ARRAY() C++-friendly
C++ doesn't like the {0} initializer pattern when the first
field is not an integer, let's use the {} when __cplusplus is
defined.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:44 +00:00
Boris Brezillon
8d30204ca4 dzn: Drop extra blank line in dzn_CmdCopyImage2()
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon
653c362ca6 dzn: Check image view usage instead of image usage when creating an image view
So we take VkImageViewUsageCreateInfo extension instead of ignoring it.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon
7ecc22ccaa dzn: Force sampleCounts to 1 for bgra4 images
Those are not expected to be used as render-target, and Vulkan mandates
that such formats get their sampleCounts set to VK_SAMPLE_COUNT_1_BIT.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon
84ad923482 dzn: Get rid of dzn_GetPhysicalDeviceProperties()
Rely on the vk_common_ wrapper.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon
9a804b6390 dzn: Get rid of dzn_GetPhysicalDeviceFeatures()
And rely on the vk_common_ wrapper to get it implemented.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon
e9c69fe39a dzn: 3D array images don't exist
Let's force maxArrayLayers to one in that case.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon
ad0ac592be dzn: Set bufferFeatures to zero on depth/stencil formats
Those are not supposed to advertise buffer features.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon
8dfab9b382 dzn: Make sure the properties are all zero when the format is not supported
Move one of the is_supported() check before we start filling the
structure so we don't end up with a partially filled object when
we return VK_ERROR_FORMAT_NOT_SUPPORTED (which deqp doesn't seem to like,
so it's probably coming from a spec requirement).

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon
dc3dd9690b dzn: Return a valid imageFormatProperties.maxMipLevels
maxMipLevels is encoding the maximum number of MIP levels, but
dzn_physical_device_get_max_mip_levels() return the maximum MIP level.
Let's rename the function and add one to the returned value to fix
the problem.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon
cfd3dfc074 dzn: Fix 3D <-> 2D image copies
We just need to treat layers as slices when manipulating 3D resources
whose slices are coming from/going to 2D array layers.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon
94923021d7 dzn: Support 2Darray views on 3D images for color attachments
Those are declared as 3D RTVs in D3D12, and layers are treated as
slices.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon
3684cae58c dzn: Fix dzn_image_get_rtv_desc() for 3D views
VK_REMAINING_ARRAY_LAYERS maps to -1 in the D3D12 world. Let's make sure
we set WSize to -1 in that case, because the layer_count calculated by
dzn_get_layer_count() won't work for 3D images which never have more
than one layer (in case of 3D images, we treat slices as layers).

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon
9f5831bbec dzn: Replace C++ references by pointers
Let's keep as much as we can in plain C.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon
1401f62069 dzn: Align the default case in dzn_image_view_prepare_dsv_desc()
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon
1692d8f0f6 dzn: Don't crash when EndCommandBuffer() returns an error
Leftover from a debug session.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon
c937152756 dzn: Fix dzn_translate_viewport() when height < 0
Since negative height is not a thing in D3D12, we need to adjust the
TopLeftY accordingly.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon
05b6c1ed84 dzn: Fix pipeline creation when rasterization is disabled
We use some of the VkGraphicsPipelineCreateInfo fields that should
be ignored when rasterization in disabled, assuming those who be set
to NULL by the caller in that case, which is not mandated by the
Vulkan specification.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Corentin Noël
c59fc44114 virgl/ci: Uprev virglrenderer and crosvm
Use a patch file for crosvm instead of relying on private repositories for faster
uprevs.
Use latest virglrenderer to keep the tests in-sync.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15772>
2022-04-08 11:28:27 +00:00
Corentin Noël
9a88231458 ci: Only apply patches with the build-skqp prefix
Allows to ship patches for other components too.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15772>
2022-04-08 11:28:27 +00:00
Samuel Pitoiset
8db9b175a5 radv: stop relying on shader modules after SPIRV->NIR
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15766>
2022-04-08 09:50:31 +02:00
Samuel Pitoiset
b2568be1de radv: stop passing the module to the compiler debug callback
After SPIRV->NIR, the driver shouldn't rely on the module. This will
still report messages via VK_EXT_debug_report but the object will be
NULL.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15766>
2022-04-08 09:50:29 +02:00
Samuel Pitoiset
0835065260 radv: drop the module reference for enable_mrt_output_nan_fixup
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15766>
2022-04-08 09:50:26 +02:00
Samuel Pitoiset
0411bb1297 radv: drop the module reference in radv_can_dump_shader_stats()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15766>
2022-04-08 09:50:25 +02:00
Samuel Pitoiset
a434097453 radv: drop the module reference in radv_can_dump_shader()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15766>
2022-04-08 09:50:22 +02:00
Samuel Pitoiset
e11712a0a3 radv: copy the spirv module for debugging after compilation
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15766>
2022-04-08 09:50:20 +02:00
Samuel Pitoiset
115fd6dd8e radv: remove more references to the pipeline layout during compilation
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/15749>
2022-04-08 07:00:34 +00:00
Samuel Pitoiset
2c97e79473 radv: lower ycbcr textures just before applying the pipeline layout
This shouldn't change anything.

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/15749>
2022-04-08 07:00:34 +00:00
Samuel Pitoiset
ace073eb0b radv: assert that the arg is declared when used in get_scalar_arg()
Help debugging.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15789>
2022-04-08 06:40:52 +00:00
Samuel Pitoiset
a0f3839ce8 radv: add radv_is_vrs_enabled()
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/15792>
2022-04-08 06:21:22 +00:00
Samuel Pitoiset
59466d40a3 radv: add a new helper to initialize various type of pipelines
This is common to graphics, compute and library pipelines.

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/15792>
2022-04-08 06:21:22 +00:00
Samuel Pitoiset
6117612189 radv: add radv_generate_pipeline_key() for common graphics/compute keys
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/15792>
2022-04-08 06:21:22 +00:00
Samuel Pitoiset
e74217d5a7 radv: remove unused parameters in radv_get_{wave,ballot_bit}_size()
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/15792>
2022-04-08 06:21:22 +00:00
Samuel Pitoiset
465b530a15 radv: use radv_pipeline_has_ds_attachments() more
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/15792>
2022-04-08 06:21:22 +00:00
Samuel Pitoiset
ac6dbb8c7b radv: do not check if VkPipelineRenderingCreateInfo is NULL
The driver converts legacy render pass to dynamic rendering, so this
structure should always be in pNext.

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/15792>
2022-04-08 06:21:22 +00:00
Iago Toral Quiroga
cf4b3cb563 broadcom/compiler: prefer reconstruction over TMU spills when possible
We have been reconstructing/rematerializing uniforms for a while, but we
can do this in more scenarios, namely instructions which result is
immutable along the execution of a shader across all channels.

By doing this we gain the capacity to eliminate TMU spills which not
only are slower, but can also make us drop to a fallback compilation
strategy.

Shader-db results show a small increase in instruction counts caused
by us now being able to choose preferential compiler strategies that
are intended to reduce TMU latency. In some cases, we are now also
able to avoid dropping thread counts:

total instructions in shared programs: 12658092 -> 12659245 (<.01%)
instructions in affected programs: 75812 -> 76965 (1.52%)
helped: 55
HURT: 107

total threads in shared programs: 416286 -> 416412 (0.03%)
threads in affected programs: 126 -> 252 (100.00%)
helped: 63
HURT: 0

total uniforms in shared programs: 3716916 -> 3716396 (-0.01%)
uniforms in affected programs: 19327 -> 18807 (-2.69%)
helped: 94
HURT: 50

total max-temps in shared programs: 2161796 -> 2161578 (-0.01%)
max-temps in affected programs: 3961 -> 3743 (-5.50%)
helped: 80
HURT: 24

total spills in shared programs: 3274 -> 3266 (-0.24%)
spills in affected programs: 98 -> 90 (-8.16%)
helped: 6
HURT: 0

total fills in shared programs: 4657 -> 4642 (-0.32%)
fills in affected programs: 130 -> 115 (-11.54%)
helped: 6
HURT: 0

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15710>
2022-04-08 05:37:28 +00:00
Connor Abbott
32af90d96f freedreno/a6xx: Fix SP_DS_CTRL_REG0 definition
Bit 20 isn't actually MERGEDREGS, the mode for the entire geometry
pipeline is controlled by SP_VS_CTRL_REG0::MERGEDREGS and it appears to
be something preamble-related instead since writing any register in the
preamble hangs if it's set. This fixes those hangs on freedreno and
turnip since we no longer set it.

Fixes: fccc35c2de ("ir3: Add preamble optimization pass")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15801>
2022-04-08 04:40:17 +00:00
Mike Blumenkrantz
80683943d1 mesa/st: simplify st_can_add_pointsize_to_program iterator
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15699>
2022-04-07 21:56:10 -04:00
Mike Blumenkrantz
16f08ad469 mesa/st: don't precompile the pointsize upload variant anymore
this is no longer likely to be used, so precompile the base variant now

also delete some now-unused code

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15699>
2022-04-07 21:56:10 -04:00
Mike Blumenkrantz
4f027fbff2 mesa/st: only flag pointsize constant uploads if they're needed
now that shaders are guaranteed to have a pointsize export, the only time
the variant using the uploaded constant is needed is when pointsize != 1.0

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15699>
2022-04-07 21:56:10 -04:00
Mike Blumenkrantz
f964881fcc mesa/st: only use constant upload pointsize variants if pointsize != 1.0
it's not that common for apps to need varying pointsize, so now that shaders
are guaranteed to have the export in the shader, the constant version is almost
never used

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15699>
2022-04-07 21:56:10 -04:00
Mike Blumenkrantz
2b626af110 mesa/st: also add pointsize to fixedfunction vertex shaders as needed
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15699>
2022-04-07 21:56:10 -04:00
Mike Blumenkrantz
d773055d92 mesa/st: always inject a 1.0 pointsize for vertex stages
since 1.0 is used in nearly every case, drivers requiring this exporting
can avoid potential shader variants by adding a 1.0 export to the base
shader variant and the only using the ubo upload when pointsize is explicitly
set for wide point functionality

drivers can then be responsible for removing unused pointsize exports
as needed (or desired)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15699>
2022-04-07 21:56:09 -04:00
Mike Blumenkrantz
3aa449ff72 mesa/st: declare added pointsize var as hidden
ensure this isn't counted as part of the shader and ignored for e.g.,
glGetProgramInterfaceiv

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15699>
2022-04-07 21:56:09 -04:00
Mike Blumenkrantz
310903d096 nir/lower_point_size_mov: fix check for overwriting existing pointsize
this should match the comment and allow overwriting injected pointsize
variables regardless of whether xfb is flagged

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15699>
2022-04-07 21:56:09 -04:00
Mike Blumenkrantz
02b573e03e mesa: add a bool indicating when pointsize == 1.0
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15699>
2022-04-07 21:56:09 -04:00
Emma Anholt
75a4e3f0e8 Revert "ci/freedreno: Reduce concurrency when replaying traces on a630"
This reverts commit d948f32365.

I think that fixing the timeout will have resolved this problem.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15805>
2022-04-08 00:24:20 +00:00
Emma Anholt
d51aea7f57 freedreno: Fix the cpu-prep wait to be "infinite".
We don't need to restrict our timeout to 5 seconds, because the kernel's
hangcheck will ensure that the wait completes in finite time if the GPU
gets wedged.  If the GPU is making progress, we don't want to time out
early and have pipe_transfer_map() return an error, causing glReadPixels()
to throw a confusing GL_OOM even though we're not out memory.

The INFINITE arg to this function isn't actually infinite, it's limited to
an hour.  But an hour of GPU processing to wait on is probably plenty.

This 5s timeout has caused problems with the CTS on freedreno at high
parallelism, and I suspect is the cause of recent issues in the closed
traces replay jobs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15805>
2022-04-08 00:24:20 +00:00
Timothy Arceri
7d216f296a glsl: fix needs_lowering() call in varying packing pass
Here we remove the outer arrays on geom and tess shaders where
needed. Without this the pass can sometimes attempt to pack a
varying on only one side of the shader interface where it is not
actually needed. The result can be mismatching varying types.

Fixes: d6b9202873 ("glsl: disable varying packing when its not safe")

Tested-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15761>
2022-04-07 23:57:40 +00:00
Mike Blumenkrantz
b3abd3db33 docs: update features for lavapipe
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15808>
2022-04-07 23:06:05 +00:00
Mike Blumenkrantz
3030e5baaf zink: ci updates
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15808>
2022-04-07 23:06:05 +00:00
Mike Blumenkrantz
4bb45bcd16 zink: add error logging for SRGB framebuffer without KHR_swapchain_mutable_format
this is going to explode, so at least print an error explaining why

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15808>
2022-04-07 23:06:05 +00:00
Mike Blumenkrantz
bbede22850 lavapipe: KHR_swapchain_mutable_format
it Just Works(tm)

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15808>
2022-04-07 23:06:05 +00:00
Mike Blumenkrantz
fde2c1db88 zink: adds refs to user index buffers when tc is not active
there are no ref tricks to abuse in this case, so add our own ref

fixes #6273

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15807>
2022-04-07 22:10:35 +00:00
Mike Blumenkrantz
9187af41b8 zink: allow lod for RECT sampler types
the RECT is a lie, so this is fine

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15804>
2022-04-07 21:37:58 +00:00
Mike Blumenkrantz
6cfcf891c1 nir/lower_tex: avoid adding invalid LOD to RECT textures
this is illegal

Fixes: 74ec2b12be ("nir/lower_tex: Rework invalid implicit LOD lowering")

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15804>
2022-04-07 21:37:58 +00:00
Mike Blumenkrantz
dff8813246 zink: set nir_shader_compiler_options::has_txs
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15804>
2022-04-07 21:37:58 +00:00
Jason Ekstrand
4cd260590c nir: Dont set coord_components on txs
Fixes: e1fc23265f ("nir: Add a pass for lowering CL-style image ops to texture ops")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15758>
2022-04-07 21:13:35 +00:00
Mike Blumenkrantz
d09ee469f0 kopper: add a dmabuf-free image interface for use with sw drivers
sw drivers don't support modifiers or dmabufs or any of that, so separate
interfaces are needed to avoid advertising extensions that will only lead
to crashes

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15802>
2022-04-07 20:08:10 +00:00
Erik Faye-Lund
31824d4213 dzn: add missing space
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15790>
2022-04-07 19:53:03 +00:00
Erik Faye-Lund
08e4b28a05 dzn: drop unused include
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15790>
2022-04-07 19:53:03 +00:00
Erik Faye-Lund
4ae6c34a5a dzn: drop incorrect return statement
We're returning nothing here. Let's not do that.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15790>
2022-04-07 19:53:03 +00:00
Erik Faye-Lund
600d99650b dzn: drop unused header
Reviewed-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/15790>
2022-04-07 19:53:03 +00:00
Erik Faye-Lund
76b0023c06 dzn: remove unused variable
Reviewed-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/15790>
2022-04-07 19:53:03 +00:00
Erik Faye-Lund
96bbcb1e48 dzn: fixup indent
Reviewed-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/15790>
2022-04-07 19:53:03 +00:00
Erik Faye-Lund
f3ce7d8561 dzn: add D3D12_IGNORE_SDK_LAYERS define
Reviewed-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/15790>
2022-04-07 19:53:03 +00:00
Erik Faye-Lund
659e26285a dzn: drop needless includes
These include either dzn_nir.h or dzn_internal.h which already includes
this header.

Reviewed-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/15790>
2022-04-07 19:53:03 +00:00
Erik Faye-Lund
bda5852846 dzn: remove unused struct
Reviewed-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/15790>
2022-04-07 19:53:03 +00:00
Erik Faye-Lund
f7b0cfe04a dzn: remove needless using
Reviewed-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/15790>
2022-04-07 19:53:03 +00:00
Mike Blumenkrantz
1e3b96913c zink: handle swapchain readbacks when a present is pending
if a present semaphore is pending, don't try to create another one

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15784>
2022-04-07 19:22:14 +00:00
Mike Blumenkrantz
ed07721d09 zink: only apply swapchain behavior in flush_resource for swapchain images
these could otherwise be pixmaps or dmabufs

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15784>
2022-04-07 19:22:14 +00:00
Mike Blumenkrantz
127d7aeb6c zink: handle deferred swapchain resource flushing
if the swapchain image hasn't been acquired yet, flag it as a deferred
present so it can be picked up on flush

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15784>
2022-04-07 19:22:14 +00:00
Mike Blumenkrantz
3c4be122cc egl: implement more hooks for swrast
these just need to use swapbuffers instead of flush

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15784>
2022-04-07 19:22:14 +00:00
Benjamin Cheng
0666b7fecc anv: drop from_wsi bit from anv_image
It was originally introduced in ca791f5c but it was never actually set
anywhere. It doesn't serve any purpose other than some sanity checking
so let's clean it up for now.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15799>
2022-04-07 18:46:50 +00:00
Ian Romanick
b5fa43952a intel/fs: Better handle constant sources of FS_OPCODE_PACK_HALF_2x16_SPLIT
I noticed that a *LOT* of fragment shaders in Shadow of the Tomb Raider,
for instance, end up with a sequence of NIR like:

    vec1 32 ssa_2 = load_const (0x00000000 = 0.000000)
    ...
    vec1 32 ssa_191 = pack_half_2x16_split ssa_188, ssa_2
    vec1 32 ssa_192 = pack_half_2x16_split ssa_189, ssa_2
    vec1 32 ssa_193 = pack_half_2x16_split ssa_190, ssa_2

This results in an assembly sequence like:

    mov(8)          g28<1>UD        0x00000000UD
    mov(8)          g21<2>HF        g28<8,8,1>F
    shl(8)          g21<1>UD        g21<8,8,1>UD    0x00000010UD
    mov(8)          g21<2>HF        g25<8,8,1>F
    mov(8)          g19<2>HF        g28<8,8,1>F
    shl(8)          g19<1>UD        g19<8,8,1>UD    0x00000010UD
    mov(8)          g19<2>HF        g23<8,8,1>F
    mov(8)          g20<2>HF        g28<8,8,1>F
    shl(8)          g20<1>UD        g20<8,8,1>UD    0x00000010UD
    mov(8)          g20<2>HF        g24<8,8,1>F

After this commit, the generated assembly is:

    mov(8)          g21<1>UD        0x00000000UD
    mov(8)          g21<2>HF        g23<8,8,1>F
    mov(8)          g19<1>UD        0x00000000UD
    mov(8)          g19<2>HF        g17<8,8,1>F
    mov(8)          g20<1>UD        0x00000000UD
    mov(8)          g20<2>HF        g18<8,8,1>F

Tiger Lake, Ice Lake, Skylake, and Haswell had similar results. (Ice Lake shown)
total instructions in shared programs: 20119086 -> 20119034 (<.01%)
instructions in affected programs: 9056 -> 9004 (-0.57%)
helped: 8
HURT: 0
helped stats (abs) min: 2 max: 16 x̄: 6.50 x̃: 4
helped stats (rel) min: 0.29% max: 1.75% x̄: 1.00% x̃: 0.98%
95% mean confidence interval for instructions value: -11.01 -1.99
95% mean confidence interval for instructions %-change: -1.56% -0.44%
Instructions are helped.

total cycles in shared programs: 861019414 -> 861021044 (<.01%)
cycles in affected programs: 279862 -> 281492 (0.58%)
helped: 4
HURT: 2
helped stats (abs) min: 6 max: 936 x̄: 239.00 x̃: 7
helped stats (rel) min: 0.03% max: 8.13% x̄: 2.09% x̃: 0.09%
HURT stats (abs)   min: 18 max: 2568 x̄: 1293.00 x̃: 1293
HURT stats (rel)   min: 0.36% max: 1.14% x̄: 0.75% x̃: 0.75%
95% mean confidence interval for cycles value: -972.56 1515.89
95% mean confidence interval for cycles %-change: -4.77% 2.49%
Inconclusive result (value mean confidence interval includes 0).

Broadwell
total instructions in shared programs: 17812327 -> 17812263 (<.01%)
instructions in affected programs: 9867 -> 9803 (-0.65%)
helped: 8
HURT: 0
helped stats (abs) min: 2 max: 28 x̄: 8.00 x̃: 4
helped stats (rel) min: 0.32% max: 1.80% x̄: 1.00% x̃: 0.95%
95% mean confidence interval for instructions value: -15.46 -0.54
95% mean confidence interval for instructions %-change: -1.54% -0.47%
Instructions are helped.

total cycles in shared programs: 904768620 -> 904773291 (<.01%)
cycles in affected programs: 454799 -> 459470 (1.03%)
helped: 4
HURT: 4
helped stats (abs) min: 36 max: 586 x̄: 344.50 x̃: 378
helped stats (rel) min: 0.47% max: 4.04% x̄: 2.01% x̃: 1.77%
HURT stats (abs)   min: 1 max: 5572 x̄: 1512.25 x̃: 238
HURT stats (rel)   min: <.01% max: 2.77% x̄: 1.46% x̃: 1.53%
95% mean confidence interval for cycles value: -1122.40 2290.15
95% mean confidence interval for cycles %-change: -2.26% 1.71%
Inconclusive result (value mean confidence interval includes 0).

total spills in shared programs: 18581 -> 18579 (-0.01%)
spills in affected programs: 323 -> 321 (-0.62%)
helped: 1
HURT: 0

total fills in shared programs: 24985 -> 24981 (-0.02%)
fills in affected programs: 1348 -> 1344 (-0.30%)
helped: 1
HURT: 0

Tiger Lake, Ice Lake, and Skylake had similar results. (Ice Lake shown)
Instructions in all programs: 143585431 -> 143513657 (-0.0%)
Instructions helped: 14403

Cycles in all programs: 8439312778 -> 8439371578 (+0.0%)
Cycles helped: 10570
Cycles hurt: 3290

Gained: 146
Lost: 74

All of the lost and gained fossil-db shaders are SIMD32 fragment
shaders.  14,247 of the affected shaders are from Shadow of the Tomb
Raider.  154 are from Batman Arkham Origins, and the remaining two are
from Octopath Traveler.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15089>
2022-04-07 18:26:23 +00:00
Alyssa Rosenzweig
1fb4427a7a pan/bi: Imply round mode most of the time
Much less noisy, and provides a path to further improvements. There is a slight
behaviour change: int-to-float conversions now use RTE instead of RTZ. For
32-bit opcodes, this affects conversions of integers with magnitude greater than
2^23 by at most 1 ulp. As this behaviour is unspecified in GLSL, this change is
believed to be acceptable.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15187>
2022-04-07 18:03:57 +00:00
Alyssa Rosenzweig
a747708b9d pan/bi: Use should_skip in bi_builder generation
To avoid further code duplication.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15187>
2022-04-07 18:03:57 +00:00
Alyssa Rosenzweig
de37f75554 pan/bi: Mark some opcodes as default round-to-zero
Conversions to integer have different rounding rules.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15187>
2022-04-07 18:03:57 +00:00
Alyssa Rosenzweig
24d072fd6a pan/bi: Don't use funny round modes in tests
To prepare for defeaturing round modes, replace uses of round-to-positive with
round-to-even in our unit tests. This doesn't meaningfully impact test coverage;
there is no way to generate that round mode.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15187>
2022-04-07 18:03:57 +00:00
Alyssa Rosenzweig
b5026c3d7c panfrost: Use track_image_access on Bifrost
Equivalent logic, as previously extracted.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15797>
2022-04-07 17:43:38 +00:00
Alyssa Rosenzweig
8689a88d10 panfrost: Add helpers to emit Valhall data structures
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15797>
2022-04-07 17:43:38 +00:00
Alyssa Rosenzweig
0d48a57452 panfrost: Adapt viewport/scissor to Valhall
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15797>
2022-04-07 17:43:38 +00:00
Alyssa Rosenzweig
e4edb1a53f panfrost: Hide some Bifrost-specific functions
Pertains to data structures removed in Valhall.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15797>
2022-04-07 17:43:38 +00:00
Alyssa Rosenzweig
58934dd666 panfrost: Add valhall_has_blend_shader field
Required in a hot path for silly historical reasons, so add a field to save a
pre-computed value thereof.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15797>
2022-04-07 17:43:38 +00:00
Alyssa Rosenzweig
fed04de481 panfrost: Add Valhall fields to panfrost_batch
There are new data structures that we need to (dirty) track. Add the
corresponding fields so we can proceed as with Bifrost dirty tracking.

Trivial increase in memory usage, but that should not matter as batches are
few.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15797>
2022-04-07 17:43:38 +00:00
Alyssa Rosenzweig
270e3e02f2 panfrost: Split out allow_fpk helper
For sharing between Bifrost's renderer state descriptor and Valhall's draw call
descriptor, which require the same logic in different places.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15797>
2022-04-07 17:43:38 +00:00
Alyssa Rosenzweig
ba395fc94c panfrost: Split out panfrost_get_blend_shaders
The same logic is useful on Valhall.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15797>
2022-04-07 17:43:38 +00:00
Alyssa Rosenzweig
c408f7551c panfrost: Specialize vertex state for Valhall
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15797>
2022-04-07 17:43:37 +00:00
Alyssa Rosenzweig
0795f3d7e4 panfrost: Add a pool to sampler_view
So we can allocate temporary sampler views for writeable images on Valhall.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15797>
2022-04-07 17:43:37 +00:00
Alyssa Rosenzweig
0299565f72 panfrost: Adapt panfrost_rasterizer for v9
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15797>
2022-04-07 17:43:37 +00:00
Alyssa Rosenzweig
9a521433ae panfrost: Don't set a default for blend count
Unnecessary.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15797>
2022-04-07 17:43:37 +00:00
Alyssa Rosenzweig
7d1d7cdf57 panfrost: Don't check alpha test in fs_required on Bifrost+
Alpha testing is only native on Midgard. Saves a few instructions.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15797>
2022-04-07 17:43:37 +00:00
Ian Romanick
c08302670b intel/compiler: Fix sample_d messages on DG2
DG2 can only do sample_d and sample_d_c on 1D and 2D surfaces.  The
maximum number of gradient components and coordinate components should
be 2.  In spite of this limitation, the Bspec lists a mysterious R
component before the min_lod, so the maximum coordinate components is 3.

Fixes the following Vulkan CTS failures on DG2:

    dEQP-VK.glsl.texture_functions.texturegradclamp.isampler1d_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.isampler2d_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.sampler1d_fixed_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.sampler1d_float_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.sampler2d_fixed_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.sampler2d_float_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.usampler1d_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.usampler2d_fragment

The Fixes: tag below is a bit misleading. This commit fixes some test
cases similar to ones fixed by the Fixes: commit.  I just want to make
sure this commit gets applied everywhere that commit was also applied.

Fixes: 635ed58e52 ("intel/compiler: Lower txd for 3D samplers on XeHP.")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15781>
2022-04-07 17:09:28 +00:00
Boris Brezillon
07af51da9d dzn: Pass a NULL ralloc context to dxil_create_validator()
instance is not allocated with ralloc, we can't pass it as a ralloc
context to dxil_create_validator().

Fixes: 09c2016d6b ("dzn: use dxil_validator")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15787>
2022-04-07 16:55:02 +00:00
Jason Ekstrand
5d198782a0 vulkan,docs: Add documentation for Vulkan dispatch
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15472>
2022-04-07 16:32:21 +00:00
Jason Ekstrand
dd340ce1a1 vulkan,docs: Document vk_device
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15472>
2022-04-07 16:32:21 +00:00
Jason Ekstrand
6073610d7a vulkan,docs: Document vk_physical_device
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15472>
2022-04-07 16:32:21 +00:00
Jason Ekstrand
f6d4641433 vulkan,docs: Document vk_instance
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15472>
2022-04-07 16:32:21 +00:00
Jason Ekstrand
f06fa8f7e0 vulkan,docs: Document vk_object_base
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15472>
2022-04-07 16:32:21 +00:00
Jason Ekstrand
0ca8b95824 vulkan: vk_object_base_init/finish have no unused parameters
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15472>
2022-04-07 16:32:21 +00:00
Jason Ekstrand
13fc698cef anv/formats: Relax usage checks if EXTENDED_USAGE_BIT is set
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14153>
2022-04-07 15:56:33 +00:00
Roman Stratiienko
9b28b76e85 android: Set max platform-sdk-version to 10000
platform-sdk-version::max require updating every time new Android releases.
It makes sense to set this value to some unreachable maximum value to avoid
such patches. Such approach will allow to use stable mesa3d without any
changes with newest Android as well.

As was suggested by Yiwei Zhang we can use value 10000 that corresponds to
CUR_DEVELOPMENT [1] definition which may be used by AOSP/master in between
of Android major releases.

[1]: https://developer.android.com/reference/android/os/Build.VERSION_CODES#CUR_DEVELOPMENT

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15747>
2022-04-07 15:33:48 +00:00
Alyssa Rosenzweig
0510e2373e panfrost: Split out image access tracking
This logic is not device-specific. It is pulled from our existing Bifrost image
implementation and will be reused for Valhall.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15795>
2022-04-07 15:11:05 +00:00
Alyssa Rosenzweig
5d187e9cad panfrost: Add helpers to set batch masks
This logic is not device specific and will be used for both Bifrost and Valhall.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15795>
2022-04-07 15:11:04 +00:00
Alyssa Rosenzweig
30c14f54cf panfrost: Disable PIPE_CAP_PRIMITIVE_RESTART on v9
Valhall removed the ability to set an explicit primitive restart index as
required by desktop OpenGL, in favour of fixed primitive restart indices only as
required by OpenGL ES.

Set the CAPs accordingly so that mesa/st lowers unusual primitive restart
indices at draw call time.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15795>
2022-04-07 15:11:04 +00:00
Alyssa Rosenzweig
dd735bcb69 panfrost: Make alpha=0 NOP / 1 store Bifrost only
These fields were removed in Valhall in favour of a simpler overdraw mechanism.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15795>
2022-04-07 15:11:04 +00:00
Alyssa Rosenzweig
bb8a9038ff panfrost: Move assign_vertex_buffer to pan_helpers
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15795>
2022-04-07 15:11:04 +00:00
Alyssa Rosenzweig
e39f9aa883 panfrost: Hide AFBC on Valhall
The relevant data structures have been shuffled a bit. We need to wire up AFBC
for Valhall; however, that's out of scope for the initial bring up. Just hide it
so we can build.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15795>
2022-04-07 15:11:04 +00:00
Alyssa Rosenzweig
76e0a7c49e panfrost: Adapt pan_shader.h for Valhall
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15795>
2022-04-07 15:11:04 +00:00
Alyssa Rosenzweig
4d04437a3b panfrost: Add shader_stage helper
For Valhall, which specifies these in the shader program descriptor.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15795>
2022-04-07 15:11:04 +00:00
Alyssa Rosenzweig
783d27645c panfrost: Add panfrost_make_resource_table helper
For Valhall drivers.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15795>
2022-04-07 15:11:04 +00:00
Alyssa Rosenzweig
3baceb0ca4 panfrost: Hide parts of pan_encoder.h for Valhall
These pertain to data structures that no longer exist.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15795>
2022-04-07 15:11:04 +00:00
Alyssa Rosenzweig
d11351c616 panfrost: Control tiler memory usage
Ensure we don't hit OOM when rendering at 8192x8192 on Valhall by disabling
the smallest bin size of the hierarchy mask.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15795>
2022-04-07 15:11:04 +00:00
Alyssa Rosenzweig
586c3b9e35 panfrost: Handle stencil texturing on Valhall
Use a Bifrost compatible path. It's not clear this is optimal but it passes the
tests and is no worse than what we do on Bifrost.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15795>
2022-04-07 15:11:04 +00:00
Alyssa Rosenzweig
db20152c8a panfrost: Handle Valhall texturing
Surface descriptors have been replaced by plane descriptors, which facilitate
the intermediate layout of textures. This allows for more sophisticated handling
of texture compressions, of particular to interest to copy_image. However, it
requires a considerable amount of new logic to handle.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15795>
2022-04-07 15:11:04 +00:00
Krunal Patel
f21d6e18bc frontend/va: Create decoder once the max_references is updated
Issue: When a video is decoded where the max_references is updated the
decoder keeps using same old value. This results into green patches and
decoding is not proper.

Root Cause: The max_references is updated only once when the instance is
created for the first time.

Fix: Added a check along with the context->decoder to check if the
context->templat.max_references has changed. If yes, then we go ahead
and create the decoder again.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Krunal Patel <krunalkumarmukeshkumar.patel@amd.corp-partner.google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15750>
2022-04-07 14:48:37 +00:00
Mike Blumenkrantz
2f8d11463f zink: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15536>
2022-04-07 14:36:25 +00:00
Mike Blumenkrantz
527deb91ff zink: export PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15536>
2022-04-07 14:36:25 +00:00
Mike Blumenkrantz
dac830b5ad zink: run the cubemap -> array compiler pass if the shader key is set
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15536>
2022-04-07 14:36:25 +00:00
Mike Blumenkrantz
f97014c3da zink: handle nonseamless cube sampler binding
now when a cube is sampled with a nonseamless sampler, the relevant shader
stage is flagged for a variant update, the

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15536>
2022-04-07 14:36:25 +00:00
Mike Blumenkrantz
be6d4b8583 zink: create an array view for all cube samplerviews
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15536>
2022-04-07 14:36:25 +00:00
Mike Blumenkrantz
55f90c5fa4 zink: set nonseamless hint for sampler states
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15536>
2022-04-07 14:36:25 +00:00
Mike Blumenkrantz
5b2d0cca17 zink: handle shader key variants that have nonseamless cubemaps
this is just the program-based handling, which means finding the right
variant and/or creating new ones based on matching a 32bit mask indicating
which textures must be rewritten

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15536>
2022-04-07 14:36:25 +00:00
Mike Blumenkrantz
a06b0e0d21 zink: specify struct member name when copying inline uniforms for gfx variants
avoid memory mismatch if inline uniform values aren't first member of struct

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15536>
2022-04-07 14:36:25 +00:00
Mike Blumenkrantz
be1b36d631 zink: support nir_op_imod
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15536>
2022-04-07 14:36:25 +00:00
Mike Blumenkrantz
2d745904ca zink: add a gently mangled version of the d3d12 cubemap -> array compiler pass
this differs in that it doesn't handle images and also doesn't filter
based on sampler type, instead using a 32bit mask for determining which
samplers to rewrite

also zink doesn't use sampler derefs

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15536>
2022-04-07 14:36:25 +00:00
Mike Blumenkrantz
dc3f62e0c2 zink: rename a variable
no functional changes

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15536>
2022-04-07 14:36:25 +00:00
Alyssa Rosenzweig
813d355e9e pan/va: Add LD_TILE.v3.f16 packing test
This tests the staging register behaviour.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15793>
2022-04-07 14:20:45 +00:00
Alyssa Rosenzweig
2b57303eaf pan/bi: Consider flow control in DCE
We don't want to remove instructions like `NOP.wait` on Valhall; this would be
tantamount to deleting barriers.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15793>
2022-04-07 14:20:45 +00:00
Alyssa Rosenzweig
6e69c3369c pan/bi: Don't lower vertex_id for malloc IDVS
Based on hardware behaviour, it appears vertex_id is zero-based with the legacy
geometry flow but not with the new malloc IDVS flow. Since the geometry flow is
per-shader (not per-machine), there's not a good way to communicate this to NIR.
Rather than trying to shoehorn this obscure detail into NIR, just do the
lowering ourselves instead of in NIR. It's not much more code anyway.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15793>
2022-04-07 14:20:45 +00:00
Alyssa Rosenzweig
ccdec68aee pan/bi: Report whether workgroups can be merged
This flag gates a Valhall hardware optimization for compute shaders.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15793>
2022-04-07 14:20:45 +00:00
Alyssa Rosenzweig
170d5a012e pan/bi: Avoid masked writes for now
Our swizzle lowering optimizations depend on replication of scalar fp16. This
holds on Bifrost (at least for now), but not on Valhall which has proper support
for write masks. For now, enforce Bifrost-compatible behaviour as we do not make
use of the write masks on Valhall yet.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15793>
2022-04-07 14:20:45 +00:00
Alyssa Rosenzweig
ba5b63f642 pan/bi: Generate LD_BUFFER on Valhall
Replace LOAD.ubo with LD_BUFFER since the .ubo segment doesn't exist on Valhall.
We could do this with a lowering pass instead but this is probably fine.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15793>
2022-04-07 14:20:45 +00:00
Alyssa Rosenzweig
f487c09045 pan/bi: Make psiz variants
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15793>
2022-04-07 14:20:45 +00:00
Alyssa Rosenzweig
9497a6a3c9 pan/bi: Lower gl_PointSize to FP16 on Valhall
It is unclear if FP32 point sizes are supported on Valhall -- I can't get the
DDK to use them at any rate. Always lower them to FP16 and store them as FP16
for hardware use.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15793>
2022-04-07 14:20:45 +00:00
Alyssa Rosenzweig
8e6f97b5fc pan/bi: Force psiz to mediump
To match driver behaviour.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15793>
2022-04-07 14:20:45 +00:00
Alyssa Rosenzweig
90d3f55aff pan/bi: Set table for Valhall LD_ATTR
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15793>
2022-04-07 14:20:45 +00:00
Alyssa Rosenzweig
f79e33f82f pan/bi: Emit Valhall-style varying stores
Varying stores was changed in Valhall. Rather than using attribute descriptors
like on Bifrost and Midgard, on Valhall we store to memory directly with
hardware-allocated buffers. This requires a new implementation of store_output,
with special provisions for writing gl_PointSize from a position shader.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15793>
2022-04-07 14:20:45 +00:00
Alyssa Rosenzweig
14e7796d4c pan/bi: Emit Valhall-style varying loads
Memory-allocated IDVS requires special varying load instructions that take an
offset into the hardware-allocated varying buffer, as opposed to a varying slot.
Emit these instructions.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15793>
2022-04-07 14:20:45 +00:00
Alyssa Rosenzweig
a1d5bf0a7a pan/bi: Track whether the malloc IDVS flow is used
This affects what instructions the fragment shader uses. Will be used for the
legacy geometry flow in blit shaders. Whether that is a good idea remains to be
seen, admittedly.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15793>
2022-04-07 14:20:45 +00:00
Alyssa Rosenzweig
9758555481 pan/bi: Handle Valhall texturing in helper analysis
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15793>
2022-04-07 14:20:45 +00:00
Alyssa Rosenzweig
ae79f6765a pan/bi: Emit Valhall texture instructions
Valhall uses an updated version fo the TEXC path. To avoid disrupting the
existing Bifrost code, add a new Valhall-specific texture path that generates
the new-style texture instructions.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15793>
2022-04-07 14:20:45 +00:00
Alyssa Rosenzweig
9091b6261b pan/bi: Specialize BLEND emit for Valhall
Fewer arguments compared to Bifrost; the corresponding information is encoded in
a Valhall-specific blend shader prologue instead.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15793>
2022-04-07 14:20:45 +00:00
Alyssa Rosenzweig
a8afe6f7fb pan/bi: Waits before tilebuffer access on Valhall
On Bifrost, this is handled in the scheduler. Until we grow a Valhall scheduler,
add a NOP with the appropriate flow control. This is correct but carries a small
performance cost.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15793>
2022-04-07 14:20:45 +00:00
Alyssa Rosenzweig
fe9cf1d0a4 pan/bi: Fix spilling on Valhall
We need a slightly different idiom on Valhall, since the segment modifiers no
longer exist but we now have an immediate offset.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15793>
2022-04-07 14:20:45 +00:00
Alyssa Rosenzweig
a2916aa934 pan/bi: Mark LD_TILE as w=format
This tracks register usage more precisely for LD_TILE, which is an encoding
difference on Valhall.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15793>
2022-04-07 14:20:44 +00:00
Alyssa Rosenzweig
b371e509da panfrost: Add a table for images
For the default Valhall ABI.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15793>
2022-04-07 14:20:44 +00:00
Mike Blumenkrantz
736f3fdadd radv: improve failure logging for amdgpu on init
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15771>
2022-04-07 13:48:34 +00:00
Alyssa Rosenzweig
0864b15047 pan/va: Allow small constants in register pairs
They are zero extended 32->64-bit. Allow this. Noticed debugging spilling on
Valhall.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15756>
2022-04-07 09:28:43 -04:00
Alyssa Rosenzweig
862a19aa4b pan/va: Add flow control lowering pass
Something an instruction has two logic flow controls, namely wait + reconverge.
These are orthogonal -- we need to insert a NOP to handle this. Add a lowering
pass that works out flow control to replace the ad hoc previous va_pack_flow.

Fixes dEQP-GLES31.functional.ssbo.layout.single_basic_type.shared.lowp_vec3.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15756>
2022-04-07 09:27:32 -04:00
Alyssa Rosenzweig
4f5e0e1874 pan/va: Don't truncate slots
Causes BARRIER not to work.

Fixes: f45654af59 ("pan/va: Add packing routines")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15756>
2022-04-07 09:27:32 -04:00
Alyssa Rosenzweig
9b727944a0 pan/va: Model image load instructions
These use the attribute pipe, the new versions of LD_ATTR_TEX, but reading
texture descriptors instead of attribute descriptors unlike their Bifrost
predecessors.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15756>
2022-04-07 09:27:32 -04:00
Alyssa Rosenzweig
12da32c31f pan/va: Pack LEA_TEX_IMM
Mostly automatic.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15756>
2022-04-07 09:27:32 -04:00
Alyssa Rosenzweig
1f4cb6d99f pan/va: Add indirect LEA_{ATTR, TEX}
For parity with Bifrost. We might need these for images.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15756>
2022-04-07 09:27:32 -04:00
Alyssa Rosenzweig
c6fdafe5ea pan/bi: Model Valhall image loads
Like LD_ATTR_TEX.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15756>
2022-04-07 09:27:32 -04:00
Lionel Landwerlin
b5031bd6f7 intel/nir: don't report progress on rayqueries if no queries
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c78be5da30 ("intel/fs: lower ray query intrinsics")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15769>
2022-04-07 08:24:19 +00:00
Danylo Piliaiev
dde1623ed2 turnip: Implement VK_EXT_primitives_generated_query
Similar to pipeline statistics but done for a single counter.

We use REG_A6XX_RBBM_PRIMCTR_7 to get generated primitives
and not PRIMCTR_8 because PRIMCTR_7 counts pre-clipped prims
while PRIMCTR_8 counts them after clipping.

OpenGL spec for GL_PRIMITIVES_GENERATED says:
 "Subsequent rendering will increment the counter once for every
  vertex that is emitted from the geometry shader, or from the
  vertex shader if no geometry shader is present."

Passes tests:
 dEQP-VK.transform_feedback.primitives_generated_query.*

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15746>
2022-04-07 08:01:59 +00:00
Samuel Pitoiset
5ac8f10ec3 radv: mark all states declared dynamic at pipeline creation
It will be easier to merge dynamic states from libraries this way.

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/15764>
2022-04-07 06:16:20 +00:00
Samuel Pitoiset
c7ae87d7af radv: add a new helper to determine if rasterization is enabled
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/15764>
2022-04-07 06:16:20 +00:00
Samuel Pitoiset
3724e09609 radv: fix dynamic raster discard with VK_EXT_depth_clip_control
Fixes: 43e83949dc ("radv: implement VK_EXT_depth_clip_control")
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/15764>
2022-04-07 06:16:20 +00:00
Mike Blumenkrantz
fddb294cdf zink: update ci list
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Mike Blumenkrantz
df700317ab zink: ci fixup
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Mike Blumenkrantz
ab1941fc0e zink: handle zombie swapchains
inject a dummy, matching image that can be used until the frontend
catches up and rescues us from whatever is happening

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Mike Blumenkrantz
d32a897f4e driconf: add override for Xwayland
zink needs this to avoid deadlocking on startup

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Mike Blumenkrantz
48d63705d9 zink: export PIPE_CAP_DEVICE_RESET_STATUS_QUERY
this can work now

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Mike Blumenkrantz
7f56fd9655 zink: it's kopperin' time
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Mike Blumenkrantz
8ade5588e3 zink: add kopper api
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Mike Blumenkrantz
a2711e47af zink: check whether clear is enabled before applying in unbind
this is implicit, but make it explicit

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Mike Blumenkrantz
4deba8cc96 zink: move variable decl up in unbind_fb_surface
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Mike Blumenkrantz
ed343b415e zink: pass index to unbind_fb_surface
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Mike Blumenkrantz
513fcc37d9 zink: move drirc handling up
this can modify instance creation

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Mike Blumenkrantz
820077acdb zink: split surface creation more to allow disabling caching
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Mike Blumenkrantz
e37f33cc8d zink: add fail logging for drmPrimeFDToHandle
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Mike Blumenkrantz
6998dbb778 zink: add VK_KHR_swapchain_mutable_format
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Mike Blumenkrantz
1a029d38d8 zink: use two submits for every queue submit
first one empty for now

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Mike Blumenkrantz
4772543956 zink: change early returns in zink_blit to gotos
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Mike Blumenkrantz
e2abf7d28d zink: move blit src/dst decls up in function
no changes

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Mike Blumenkrantz
9811c39994 zink: move update_framebuffer_state() higher up in file
no changes

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Mike Blumenkrantz
7e0ff34010 zink: put screen param into flush queue global data
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Mike Blumenkrantz
43f197acd7 zink: move flush queue init down a little further
no functional changes

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Adam Jackson
d760a9151b gallium: Learn about kopper
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Adam Jackson
bab8d97ea9 glx: Learn about kopper
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Adam Jackson
e1e2de800e egl: Learn about kopper
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Adam Jackson
93aa5399f1 kopper: Define the driver interface
The loader extension provides upcalls to get surface state (native
resource and size) into the driver. The driver extension is called by a
kopper-aware loader in preference to __DRI_SWRAST's createNewDrawable.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Adam Jackson
25c42abac8 meson: Define a HAVE_XXXX macro for every gallium driver we build
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Mike Blumenkrantz
3883ca5ea7 st/manager: update framebuffer size if texture has been resized
zink/kopper can and does expect this when resizing swapchains,
so don't ignore it

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Erik Faye-Lund
0998621496 clc/tests: use dxil_validator
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15751>
2022-04-07 00:00:45 +00:00
Erik Faye-Lund
09c2016d6b dzn: use dxil_validator
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15751>
2022-04-07 00:00:45 +00:00
Erik Faye-Lund
0c5d772b71 microsoft/spirv_to_dxil: use dxil_validator
This has one negative side-effect; we're no longer able to print
validation errors without dxcompiler.dll. I doubt that's a real problem,
but if it is, we should add this ability to dxil_validator instead of
having a second implementation here.

The reasons I didn't try adding this in the first place is:

1. This code seems a bit janky; it doesn't consult the "known"-variable
   to figure out if the encoding is OK, and it's lacking a fallback path
   in that case.
2. It seems unlikely that the compiler varies the encoding of the output
   in the first place; one of the two code-paths in here is probably
   untested.
3. Since dxil_validator leaves reporting to the call-site, we'd need to
   either add and output-encoding to the API (yuck), or re-encode the
   string to UTF-8 using WinAPI.

Right now, it seems questionable if fixing all of the above is worth it.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15751>
2022-04-07 00:00:45 +00:00
Erik Faye-Lund
1e570962ef d3d12: use dxil_validator
Now that we have a shiny, new dxil validator interface, let's start
using it in the D3D12 gallium driver.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15751>
2022-04-07 00:00:44 +00:00
Erik Faye-Lund
193cf76c09 microsoft/compiler: add common dxil-validator API
This API is only available on Windows, which is the only OS where DXIL
validation is a requirement, and where DXIL.dll (and dxcompiler.dll) are
available.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15751>
2022-04-07 00:00:44 +00:00
Jason Ekstrand
e81f3edf76 iris: Allow userptr on 1D and 2D images
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15779>
2022-04-06 23:18:21 +00:00
Jason Ekstrand
5fd2f462fb iris: Allow non-page-aligned userptr
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15779>
2022-04-06 23:18:21 +00:00
Jason Ekstrand
27697ac20c iris: Take offsets into account when mapping resources
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15779>
2022-04-06 23:18:21 +00:00
Mike Blumenkrantz
f7ade1f188 zink: simplify shader i/o assignment
by utilizing a separate slot map for patch variables, the entire i/o
assignment mechanism can be simplified to accurately manage i/o for all
types of variables and avoid location conflicts

affects:
KHR-Single-GL46.enhanced_layouts*

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15770>
2022-04-06 23:05:36 +00:00
Mike Blumenkrantz
beb7a9cec5 zink: use local variable in consumer shader i/o assign to match producer usage
no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15770>
2022-04-06 23:05:36 +00:00
Mike Blumenkrantz
91e0b919f4 zink: use local variable more consistently in producer shader i/o assign
no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15770>
2022-04-06 23:05:36 +00:00
Mike Blumenkrantz
7d7d3b5f26 zink: prune shader i/o more aggressively
fixes some radv validation spam on:
KHR-Single-GL46.enhanced_layouts*

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15770>
2022-04-06 23:05:36 +00:00
Mike Blumenkrantz
8269445ce5 zink: run shader optimize loop during initial create
this is important for removing dead variables

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15770>
2022-04-06 23:05:36 +00:00
Mike Blumenkrantz
e96342c531 zink: rework missing feature warnings
the previous methodology triggered warnings any time a rasterizer state
was created with unsupported features without determining whether those
features would actually be used

a more optimal process is to check for missing features at pipeline creation,
as all the necessary info is now available, and spurious warnings can be avoided

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15778>
2022-04-06 22:52:12 +00:00
Mike Blumenkrantz
da80beafb2 zink: fix warning text in missing feature macro
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15778>
2022-04-06 22:52:12 +00:00
Mike Blumenkrantz
a489b1d936 zink: add a param to warn_missing_feature() macro
this lets the macro be used more programmatically since the variable
is defined externally

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15778>
2022-04-06 22:52:12 +00:00
Mike Blumenkrantz
b6f99cf378 zink: switch warn_missing_feature to mesa_logw
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15778>
2022-04-06 22:52:12 +00:00
Emma Anholt
3cf28d16f6 ci: Uprev deqp-runner and piglit.
deqp-runner uprevved to reduce memory usage on HW runners, let us
experiment with shader cache on tmpfs, and hopefully provide a tool for
virgl to be able to plausibly run piglit under crosvm instead of vtest.

piglit uprevved to avoid a flake in softpipe in glx-multithread-texture,
and improve performance of the test, too.  This also brings in the
fbo-blending-format-quirks fix to properly initialize the buffers, fixing
some fails/flakes.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15419>
2022-04-06 20:43:53 +00:00
Emma Anholt
cd39523c53 ci/turnip: Drop xfails for create_list_modifiers.
These were fixed in 5ce06f8474 ("turnip: Use correct type for OUTARRAY
in FormatProperties2"), but they aren't included in the pre-merge CI run.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15419>
2022-04-06 20:43:52 +00:00
Jason Ekstrand
cde1be0b84 iris: Handle range tracking for global bindings
The moment something is bound globally, the whole thing is valid.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15777>
2022-04-06 20:16:55 +00:00
Jason Ekstrand
187923c2eb iris: Account for BO offsets in iris_set_global_binding()
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15777>
2022-04-06 20:16:55 +00:00
Danylo Piliaiev
25202b5861 ci/freedreno: Add fractional test of forced unaligned gmem store
Unaligned gmem store is a mostly untested path since most
of the times faster path is chosen. We have to force unaligned
store to really test it.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15773>
2022-04-06 19:53:27 +00:00
Lionel Landwerlin
56ef501e3a blorp: disable depth bounds
Otherwise the driver setting interacts with it.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 939ddccb7a ("anv: Add support for depth bounds testing.")
Fixes: 1df871f8ff ("iris: Add support for depth bounds testing.")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15763>
2022-04-06 19:00:50 +00:00
Lionel Landwerlin
3069337144 anv: remove unused 3DSTATE_DEPTH_BOUNDS fields
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15763>
2022-04-06 19:00:50 +00:00
Jason Ekstrand
dbfb0b4989 lavapipe: Go back to manually signaling in lvp_AcquireNextImage2()
When porting lavapipe to the common sync framework, I stole the dummy
sync signal_for_memory idea from RADV but didn't actually do it
correctly.  Unless you set wsi_device::signal_semaphore_with_memory and
wsi_device::signal_fence_with_memory, it doesn't actually signal
anything.  If you do set those, it works but also results in dummy
syncs being created for present fences which we see as signals.  We
could choose to just skip those like RADV does but that's too magic.
Instead, have our own AcquireNextImage2() again which sets dummy syncs.

Fixes: 3b547a9b58 ("lavapipe: Switch to the common sync framework")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15774>
2022-04-06 18:30:51 +00:00
Danylo Piliaiev
a5a97f0b77 turnip: Fix subpassLoad from CUBE input attachments
Cube descriptors require a different sampling instruction in shader,
however we don't know whether image is a cube or not until the start
of a renderpass. We have to patch the descriptor to make it compatible
with how it is sampled in shader.

For the reference subpassLoad is currently translated into isaml.a

Blob v615 also doesn't handle this case correctly.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15734>
2022-04-06 19:42:30 +03:00
Erik Faye-Lund
837f781c9a d3d12: fix return-code without dxcompiler.dll
When we don't have a good dxcompiler.dll that we can load IDxcLibrary
from to help with diagnostics, we currently return true for validation
even if the validation actually failed.

Let's fix that, and also add a debug-message explaining what went wrong
for those who are debugging and wondering what's up.

Fixes: 2ea15cd661 ("d3d12: introduce d3d12 gallium driver")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15744>
2022-04-06 14:56:39 +00:00
Cristian Ciocaltea
0e14b674f1 ci: Lock Intel GPU frequency for performance tests
In order to ensure consistent results when running performance tests,
lock the frequency for Intel GPUs to ~70% of the maximum allowed by
hardware.

This seems to offer a good balance between execution speed and results
consistency.

An increase of the frequency will also increase the rate of throttling
events, with a negative impact on consistency. Such events are logged,
as in the following example:

  GPU throttling detected: act=200 min=850 cur=850 RPn=100

This shows the actual GPU frequency (200 MHz) dropped below the minimum
requested (850 MHz).

For more details about the various frequency information sources, please
see the script header comments in ".gitlab-ci/common/intel-gpu-freq.sh".

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Acked-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15662>
2022-04-06 13:11:05 +00:00
Cristian Ciocaltea
a3dfbf1ec7 ci: Provide intel-gpu-freq.sh in LAVA and bare-metal rootfs
The script will be used for tuning Intel GPU frequency to maximize
performance tests execution, while also trying to reduce throttling,
which has a negative impact on results consistency.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Acked-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15662>
2022-04-06 13:11:05 +00:00
Cristian Ciocaltea
5d5af8bffb ci: Add Intel GPU frequency utility
Add script to manage Intel GPU frequencies.

It can be used for debugging performance problems or to lock a stable
frequency while executing benchmark tests.

Typical use cases:

- Get all available GPU frequency information
$ ./intel-gpu-freq.sh -g all

* Hardware capabilities
   RP0: 1350 MHz
   RPn:  100 MHz
   RP1:  400 MHz

* Enforcements
   max: 1350 MHz
   min:  100 MHz
 boost: 1350 MHz

* Actual
   act:  100 MHz
   cur:  400 MHz

- Lock frequency to 80% of the maximum allowed by hardware and enable
  throttling detection
$ ./intel-gpu-freq.sh -s 80% -d

GPU throttling detected: act=1050 min=1350 cur=1350 RPn=100
GPU throttling detected: act=1100 min=1350 cur=1350 RPn=100

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Acked-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15662>
2022-04-06 13:11:05 +00:00
Lionel Landwerlin
88f77aa811 anv: disable preemption on 3DPRIMITIVE on gfx12
To workaround a push constant corruption issue.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5963
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5662
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15753>
2022-04-06 12:51:15 +00:00
Vadym Shovkoplias
04a6693871 anv: fix EXT_depth_clip_control
This fixes arb_clip_control-clip-control and depth_clamp piglit
tests on zink.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6186
Signed-off-by: Vadym Shovkoplias <vadym.shovkoplias@globallogic.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15561>
2022-04-06 13:26:52 +03:00
Danylo Piliaiev
6c18602164 turnip: Add "unaligned_store" debug option to better test gmem stores
Unaligned store is incredibly rare in CTS, we have to force it to
actually test it.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15532>
2022-04-06 08:44:28 +00:00
Danylo Piliaiev
e255305e84 turnip: Ignore aspectMask for D32S8 framebuffer attachment
Vulkan spec says:

 "When an image view of a depth/stencil image is used as a depth/stencil
  framebuffer attachment, the aspectMask is ignored and both depth and
  stencil image subresources are used."

Since we use two planes for D32S8 format we have to add a special
case for depth in addition to already existing case for stencil.

Fixes hang in CTS:
 dEQP-VK.renderpass.depth_stencil_write_conditions.stencil_kill_write_d32sf_s8ui

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15532>
2022-04-06 08:44:28 +00:00
Danylo Piliaiev
72716993b2 turnip: Correctly store separate stencil in gmem store
- When resolving d32s8 to s8 we stored stencil with a wrong format.
- For unaligned multi-sample store we used wrong gmem offset for stencil.

If unaligined store is forced this change fixes a hang in:
 dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d32_sfloat_s8_uint_separate_layouts.compatibility_depth_zero_stencil_zero_testing_stencil

Fixes: b157a5d0d6
("tu: Implement non-aligned multisample GMEM STORE_OP_STORE")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15532>
2022-04-06 08:44:28 +00:00
Samuel Pitoiset
045c96d896 radv: enable VK_KHR_pipeline_library
This has been initially implemented for raytracing but
VK_EXT_graphics_pipeline_library requires it.

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/15737>
2022-04-06 06:35:56 +00:00
Mike Blumenkrantz
eb8cde0d93 zink: use GENERAL layout for mixed zs fb attachments
this interaction requires read-only sampler access from
depth component with writes to the stencil component, which can only
be done in the GENERAL layout

affects:
GTF-GL46.gtf30.GL3Tests.framebuffer_blit.framebuffer_blit_functionality_color_and_stencil_blit

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15716>
2022-04-06 04:49:00 +00:00
Mike Blumenkrantz
fb2a08bb01 zink: update samplerview layouts for zs attachments during renderpass prep
this interaction might require layout changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15716>
2022-04-06 04:49:00 +00:00
Mike Blumenkrantz
c132a28745 zink: use store op NONE when necessary for depth usage
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15716>
2022-04-06 04:49:00 +00:00
Mike Blumenkrantz
eee8db250d zink: delete some code in get_layout_for_binding()
should be no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15716>
2022-04-06 04:49:00 +00:00
Mike Blumenkrantz
ef99ceaec2 zink: add a ctx param to zink_descriptor_util_image_layout_eval
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15716>
2022-04-06 04:49:00 +00:00
Mike Blumenkrantz
7781a75229 zink: add a renderpass flag for mixed zs layout
this indicates that the layout requires reading from the depth aspect
and writing to the stencil aspect

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15716>
2022-04-06 04:49:00 +00:00
Mike Blumenkrantz
f24b966d27 zink: further simplify zs case for zink_descriptor_util_image_layout_eval
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15716>
2022-04-06 04:49:00 +00:00
Mike Blumenkrantz
fd9a5fed16 zink: remove commented code
probably never actually going to do this since it serves no purpose

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15716>
2022-04-06 04:49:00 +00:00
Mike Blumenkrantz
a57b3bb82a zink: refactor zink_descriptor_util_image_layout_eval
slightly more readable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15716>
2022-04-06 04:49:00 +00:00
Mike Blumenkrantz
72a63649c2 zink: use EXT_image_2d_view_of_3d
fixes #4562

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15716>
2022-04-06 04:49:00 +00:00
Mike Blumenkrantz
f05d0f1238 zink: unset resource layout+access when doing storage setup
the previous access info is transferred to the staging resource for the copy,
and the new image has no access info

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15716>
2022-04-06 04:49:00 +00:00
Mike Blumenkrantz
65394fcaef zink: prune shader i/o
to avoid validation spam when variables are declared but never used,
eliminate persisting i/o variables which are never used

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15716>
2022-04-06 04:49:00 +00:00
Mike Blumenkrantz
c5f44e51fb zink: fix max geometry input component advertising
forgot to divide by 4 somehow

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15716>
2022-04-06 04:49:00 +00:00
Mike Blumenkrantz
5ca6b28c58 zink: convert all 64bit vertex attribs to 32bit
this applies not only to dvec3/dvec4, but to any type of 64bit input
since that's what gallium gives us

fixes #6211

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15716>
2022-04-06 04:49:00 +00:00
Mike Blumenkrantz
7cf7e113ba zink: apply fb attachment layout to dummy attachments
this doesn't actually matter but it still triggers validation spam

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15716>
2022-04-06 04:49:00 +00:00
Mike Blumenkrantz
e72ca7e7ac zink: clamp min viewport width to 1
fixes validation spam

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15716>
2022-04-06 04:49:00 +00:00
Mike Blumenkrantz
d4e91d0baa zink: handle 1bit xor as OpLogicalNotEqual
fixes more validation spam

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15716>
2022-04-06 04:49:00 +00:00
Mike Blumenkrantz
d1f52d300d zink: set Geometry capability for fs if geometry inputs are read
super legal.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15716>
2022-04-06 04:48:59 +00:00
Mike Blumenkrantz
3f918bbd23 zink: always set stencil dynamic states before draw
these are dynamic states set on the pipeline, so they must always
be set on a cmdbuf before draw

fixes some validation spam

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15716>
2022-04-06 04:48:59 +00:00
Mike Blumenkrantz
2ccb24757a zink: merge stencil test case for draw-time dynamic state
these cases were identical but using different conditionals

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15716>
2022-04-06 04:48:59 +00:00
Mike Blumenkrantz
b76ad3efa0 zink: only uncommit sparse pages that have been committed
avoid spamming drivers unnecessary with submits since this is expensive

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15716>
2022-04-06 04:48:59 +00:00
Mike Blumenkrantz
3dcb80da9d zink: fix barrier generation for ssbo descriptors
ssbo binds are always at least readable, so without deeper shader
inspection, never assume that write binds mean no read access

this is different than image descriptors which can explicitly get
write-only access set

cc: mesa-stable

fixes #6231

THANKS TO @daniel-schuermann FOR SOLVING THIS WITH HIS INCREDIBLE TALENT AND WIT

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15697>
2022-04-05 22:47:39 -04:00
Renato Pereyra
5ec4995305 Revert "venus: Increase the base sleep of vn_relax"
This reverts commit 737937f45e.

Testing has revealed sizable performance drops arising out of this change.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15760>
2022-04-06 01:46:10 +00:00
Jason Ekstrand
cc78a3a820 panvk: Enable VK_EXT_debug_report and VK_EXT_debug_utils
They're both implemented in common code as long as you use
vk_command_buffer.

Acked-by: Emma Anholt <emma@anholt.net>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15560>
2022-04-06 01:18:23 +00:00
Jason Ekstrand
29b8097408 anv: Enable VK_EXT_debug_utils
It's implemented in common code as long as you use vk_command_buffer.

Acked-by: Emma Anholt <emma@anholt.net>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15560>
2022-04-06 01:18:23 +00:00
Jason Ekstrand
77ffa61a14 lavapipe: Enable VK_EXT_debug_utils
It's implemented in common code as long as you use vk_command_buffer.

Acked-by: Emma Anholt <emma@anholt.net>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15560>
2022-04-06 01:18:23 +00:00
Jason Ekstrand
bdf52654ac turnip: Enable VK_EXT_debug_utils
It's implemented in common code as long as you use vk_command_buffer.

Acked-by: Emma Anholt <emma@anholt.net>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15560>
2022-04-06 01:18:23 +00:00
Jason Ekstrand
292ceb297c v3dv: Enable VK_EXT_debug_utils
It's implemented in common code as long as you use vk_command_buffer.

Acked-by: Emma Anholt <emma@anholt.net>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15560>
2022-04-06 01:18:23 +00:00
Jason Ekstrand
3b547a9b58 lavapipe: Switch to the common sync framework
The common Vulkan sync framework will do most of the queueing for us.
It will even sort out timeline semaphore dependencies and ensure
everything executes in-order.  All we have to do is make sure our
vk_sync type implements VK_SYNC_FEATURE_WAIT_PENDING.  This lets us get
rid of a big pile of code.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15651>
2022-04-06 00:38:22 +00:00
Jason Ekstrand
2f6bca6a74 vulkan: Use timespec_add_nsec in vk_sync_timeline
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15651>
2022-04-06 00:38:22 +00:00
Jason Ekstrand
0ba22b203d util/timespec: Return overflow from timespec_add_[mn]sec()
To avoid altering any currently existing callers, we continue on with
the calculation regardless of overflow.  This also matches the behavior
of GCC's __builtin_add_overflow().

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15651>
2022-04-06 00:38:22 +00:00
Emma Anholt
591899eedd gallivm/nir: Add a short circuit uniform-offset mode for load_ssbo/load_shared.
dEQP-VK.binding_model.buffer_device_address.set3.depth3.basessbo.convertuvec2.nostore.multi.scalar.vert
runtime -24.4002% +/- 1.94375% (n=7).  The win (I think) is in LLVM not
having to chew through handling the extra loops on every constant-offset
SSBO load, not in actual rendering time.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14999>
2022-04-06 00:04:14 +00:00
Emma Anholt
181f25aff4 gallivm/nir: Add a short circuit uniform-offset mode for load_global.
If we know the offset is constant, we don't have ask LLVM to loop over the
elements pulling the same value out over and over.

This doesn't seem to have produced a win in the testcase I was looking at,
but it was an easier entrypoint to figuring out how to do scalar memory
access than load_memory, and will probably affect some workload.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14999>
2022-04-06 00:04:14 +00:00
Emma Anholt
d74606d440 gallivm/nir: Refactor out some repeated code to generate 0 values.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14999>
2022-04-06 00:04:14 +00:00
Emma Anholt
4fad4c1d79 gallivm/nir: Refactor out some repeated logic for SSBO/shared access.
I needed to be able to get these pointers/limits from another location,
and missing some of the repeated steps was giving me bugs.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14999>
2022-04-06 00:04:14 +00:00
Emma Anholt
21b3db7d17 gallivm/nir: Pull some repeated exec_mask computation out of loops.
If the exec mask hasn't changed, don't hassle LLVM to set it up

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14999>
2022-04-06 00:04:14 +00:00
Emma Anholt
9ab4ecb1ae gallivm/nir: Don't do uniform-and-broadcast access on inactive invocations.
In a fragment shader or inside of control flow, invocation 0 might be
inactive, and so our use-first-invocation-and-broadcast optimizations
would be invalid, and the loop logic of an emit_read_invocation would
defeat the point of these optimized paths.

For load_kernel_input, I didn't guard the uniform path with the check
because some CL tests that are currently passing are doing the
load_kernel_input under (presumably) uniform control flow.  Instead, I
dropped in a once warning for the next person to be debugging CL.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14999>
2022-04-06 00:04:14 +00:00
Emma Anholt
04cdd41fdc util/log: Add support for logging once.
These are not data-race safe (like many other once patterns in Mesa), so
they might not log exactly once, but it should be good enough for not
spamming the console.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14999>
2022-04-06 00:04:14 +00:00
Emma Anholt
ad0fcaf1ee ci/lava: Simplify passthrough of the request to upload results/ to minio.
We already have a way to pass env vars around, just use that instead of
packing/unpacking it on the kernel command line.

Cleans up HW runner job log output some more.

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15332>
2022-04-05 21:37:46 +00:00
Emma Anholt
34278e8f2e ci/deqp: Move the set +e just before the deqp-runner invocation.
You don't want to proceed to running deqp-runner if you failed at the
vtest or runner options environment setup.

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15332>
2022-04-05 21:37:46 +00:00
Emma Anholt
82cd8614e6 ci/deqp: Add gitlab-ci sections to deqp-runner.sh.
This should help highlight the actual test results, as opposed to the setup
and teardown.

Also tuned the "set -x"es a little bit so we get less surrounding noise in
the echo process.

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15332>
2022-04-05 21:37:46 +00:00
Emma Anholt
03549f3bf3 spirv: Silence "Decoration not allowed on struct members: SpvDecorationRestrict"
VK-GL-CTS causes tons of these due to a bug in glslang, to the point where
it's hard to find actual issues in test logs.  Disable the warning for
now, with a link to the issue we're waiting on being resolved.

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15332>
2022-04-05 21:37:46 +00:00
Emma Anholt
0ee0d54985 util/log: Don't print an extra \n if the format string had one.
You're not supposed to include a '\n' in mesa_log*() messages because
android logging will log what you provide on its own line anyway, so each
mesa_log() should be the body of a log line.  But also, getting everyone
to consistently not do that is hopeless because we're all so trained by
printf().  So, just detect an existing \n and don't add a new one.

Cleans up deqp-vk debug output a bunch from turnip.

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15332>
2022-04-05 21:37:46 +00:00
Mike Blumenkrantz
e0b431da33 docs: update features for VK_EXT_image_2d_view_of_3d
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15757>
2022-04-05 17:08:02 -04:00
Mike Blumenkrantz
6fd344ff98 anv: expose VK_EXT_image_2d_view_of_3d
sampling only available on gen9+

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15754>
2022-04-05 20:30:31 +00:00
Mike Blumenkrantz
8b5c9e7c81 lavapipe: expose VK_EXT_image_2d_view_of_3d
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15754>
2022-04-05 20:30:31 +00:00
Mike Blumenkrantz
9a6ea51388 vulkan: check 3D image type for VK_IMAGE_CREATE_2D_VIEW_COMPATIBLE_BIT_EXT
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15754>
2022-04-05 20:30:31 +00:00
Connor Abbott
b91b90c256 tu: Expose VK_KHR_maintenance4
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15488>
2022-04-05 17:46:35 +00:00
Connor Abbott
5eb63d825f tu: Remove tu_pipeline::layout
This makes it more obvious that the layout is never used after creating
the pipeline, which is required by VK_KHR_maintenance4.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15488>
2022-04-05 17:46:35 +00:00
Connor Abbott
7455a7a44c tu: Fill out maxBufferSize
It seems this is really a workaround for silly issues in
GetBufferMemoryRequirements when you ask for a really large buffer. Just
expose the maximum possible size ATM.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15488>
2022-04-05 17:46:35 +00:00
Connor Abbott
d1762b7df0 tu: Implement GetDevice*MemoryRequirements()
Based mostly on anv, which is a bit more optimized than radv - we at
allocate the image on the stack.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15488>
2022-04-05 17:46:35 +00:00
Erik Faye-Lund
c42da6dd60 ci: do not specify c_std and cpp_std for windows-build
When parts of the tree needs later c and c++ versions, they should ask
for it in the build-system itself, not expect the user to ask for it on
the command-line instead. So let's not paper over things by specifying
them here.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15706>
2022-04-05 16:58:56 +00:00
Erik Faye-Lund
f607db2689 dozen: require c++20 for designated initializers
We do require C++20 still, because designated initializers is part of
that standard. This is almost a revert, but conditionally selecting
between c++latest or c++20 when available, as that's what we really want.

Fixes: 55ca1c8db3 ("vulkan/microsoft: Remove `override_options: ['cpp_std=c++latest']` option for visual studio")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15706>
2022-04-05 16:58:56 +00:00
Erik Faye-Lund
ed399a179e nir/tests: do not use designated initializers in c++ code
Designated initializers require C++20, which is a bit easier said than
done to support well across meson versions. Let's avoid using them
for now instead.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15706>
2022-04-05 16:58:56 +00:00
Erik Faye-Lund
28dbabec8e aco: do not use designated initializers
Designated initializers are a C++20 feature, but we don't use C++20. In
fact, enabling C++20 for ACO triggers new compiler errors due to some
equality semantics details.

So let's instead stop using designated initializers here.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15706>
2022-04-05 16:58:56 +00:00
Thong Thai
dcd81d2d80 frontends/va: fix decode issues introduced by efc change
Fixes: 9602526568 ("frontends/va: add encoder format conversion (EFC) support")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6153
Signed-off-by: Thong Thai <thong.thai@amd.com>
Tested-by: Andrew Falcon <bluestang2006@gmail.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15717>
2022-04-05 16:40:08 +00:00
Konstantin Seurer
dacd78fd5a radv: Remove radv_util.c
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15725>
2022-04-05 15:53:46 +00:00
Mike Blumenkrantz
b591409b6c vulkan: spec update to 1.3.211
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15752>
2022-04-05 12:55:21 +00:00
Roman Stratiienko
61f94fff0d panfrost: Don't crash on panfrost_bo_create() with size==0 invocation
1. Clamp bucket_index from both ends to avoid returning negative index.
2. Return NULL in case BO allocation/fetching failure to prevent invalid
   bo mapping.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6247
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15748>
2022-04-05 13:08:51 +03:00
Samuel Pitoiset
576833507b radv: only declare dynamic states that are used by internal operations
Initialize some default static PSO states instead.

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/15729>
2022-04-05 07:54:52 +00:00
Samuel Pitoiset
edc09beccc radv: use radv_dynamic_state for saving/restoring meta operations
Instead of duplicating every fields.

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/15729>
2022-04-05 07:54:52 +00:00
Samuel Pitoiset
3fa3d81172 radv: save/restore more dynamic states during internal driver operations
This doesn't fix anything known but it could happen in theory.

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/15729>
2022-04-05 07:54:52 +00:00
Samuel Pitoiset
ebf4f66c6a radv/ci: update CI lists against CTS 1.3.1.1
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15745>
2022-04-05 09:13:41 +02:00
Igor Torrente
cc8e271813 venus: add VK_EXT_{conditional_rendering,index_type_uint8} extensions
Implements all the necessary code in the device initialization
and extensions functions.

Signed-off-by: Igor Torrente <igor.torrente@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15652>
2022-04-05 05:10:26 +00:00
Igor Torrente
bfab83ab4b venus: Update venus-protocol to add two new extensions
These are the changes automatically generated from the venus-protocol
repository.

Update the file to add `VK_EXT_index_type_uint8` and
`VK_EXT_conditional_rendering`

Signed-off-by: Igor Torrente <igor.torrente@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15652>
2022-04-05 05:10:26 +00:00
Yiwei Zhang
801cdd83f1 venus: workaround an ANGLE assumption on FORMAT_IMPLEMENTATION_DEFINED
ANGLE expects VK_FORMAT_UNDEFINED to be returned for such AHB prop
query.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15721>
2022-04-05 05:03:39 +00:00
Omar Akkila
4208895175 ci: bump VK-GL-CTS to 1.3.1.1
Signed-off-by: Omar Akkila <omar.akkila@collabora.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15668>
2022-04-04 23:04:33 +00:00
Jason Ekstrand
94ce812497 anv: Advertise two more formats
These both require swizzling so border colors won't work.  However,
they're conveniently in the list of formats for which custom border
colors require you to specify a format in the sampler.  That list
constists of:

    - VK_FORMAT_B4G4R4A4_UNORM_PACK16
    - VK_FORMAT_B5G6R5_UNORM_PACK16
    - VK_FORMAT_B5G5R5A1_UNORM_PACK16

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6226
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15624>
2022-04-04 21:42:23 +00:00
Jason Ekstrand
e32b9e5c3f anv: Generalize border color swizzles
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15624>
2022-04-04 21:42:23 +00:00
Jason Ekstrand
54509d27d9 anv: Disallow blending on swizzled formats
Fixes: c20f78dc5d ("anv: Support swizzled formats.")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15624>
2022-04-04 21:42:23 +00:00
Jason Ekstrand
257a20f40d intel/isl: Add a helper for swizzling color values
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15624>
2022-04-04 21:42:23 +00:00
Benjamin Cheng
4489933842 vulkan/queue: Destroy wait temps if they are skipped
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6223
Fixes: 8a11d2a31b ("vulkan: Add a dummy sync type")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15727>
2022-04-04 20:52:46 +00:00
Rhys Perry
5b4e41e4db aco: don't use v_mad_mix on GFX9 if 16-bit denormals must be preserved
This probably effectively disables the v_mad_mix optimization on GFX9.

fossil-db (Vega):
Totals from 11545 (7.15% of 161366) affected shaders:
MaxWaves: 43025 -> 42780 (-0.57%); split: +0.06%, -0.63%
Instrs: 18571635 -> 18734201 (+0.88%); split: -0.00%, +0.88%
CodeSize: 96483568 -> 96611012 (+0.13%); split: -0.11%, +0.24%
SGPRs: 1079056 -> 1077616 (-0.13%); split: -0.14%, +0.01%
VGPRs: 819248 -> 821868 (+0.32%); split: -0.04%, +0.36%
SpillSGPRs: 13313 -> 12464 (-6.38%)
Latency: 293804093 -> 295046122 (+0.42%); split: -0.09%, +0.51%
InvThroughput: 110002239 -> 110994978 (+0.90%); split: -0.03%, +0.93%
VClause: 342458 -> 342596 (+0.04%); split: -0.12%, +0.16%
SClause: 648566 -> 648046 (-0.08%); split: -0.12%, +0.04%
Copies: 1728225 -> 1726679 (-0.09%); split: -0.66%, +0.57%
Branches: 552973 -> 552963 (-0.00%); split: -0.02%, +0.02%
PreSGPRs: 862360 -> 856820 (-0.64%); split: -0.69%, +0.05%
PreVGPRs: 773689 -> 776818 (+0.40%); split: -0.02%, +0.42%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6178
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15718>
2022-04-04 19:27:12 +00:00
Francisco Jerez
03cf788891 iris: Replace unconditional QBO flush with iris_dirty_for_history().
We can now use the same cache tracking mechanism for synchronizing QBO
writes instead of the unconditional PIPE_CONTROL performed currently,
which is unable to invalidate any incoherent caches which may contain
stale data for the buffer object.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15738>
2022-04-04 10:32:31 -07:00
Francisco Jerez
6cc09699cd iris: Remove remaining history flushes.
This removes a couple of remaining history flushes which were
open-coded instead of using the iris_flush_and_dirty_for_history()
helper.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15738>
2022-04-04 10:32:31 -07:00
Francisco Jerez
bbb103be0e iris: Demote all callers of iris_flush_and_dirty_for_history() to iris_dirty_for_history().
The unconditional flushing performed by
iris_flush_and_dirty_for_history() is now redundant with the memory
barriers introduced previously in this series, which should be in a
better position to determine from which domain the buffer will
actually be used in the future, and whether an additional flush or
invalidation is required or redundant with other PIPE_CONTROL commands
emitted elsewhere.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15738>
2022-04-04 10:32:31 -07:00
Mike Blumenkrantz
bbe15d99e2 aux/trace: dump format in set_shader_images
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15323>
2022-04-04 13:16:16 +00:00
Tomeu Vizoso
d948f32365 ci/freedreno: Reduce concurrency when replaying traces on a630
We are running out of memory when replaying traces sometimes, reduce the
number of concurrent retrace processes.

   Mesa: User error: GL_OUT_OF_MEMORY in glReadPixels
   warning: GL_OUT_OF_MEMORY while getting snapshot
   1074335: warning: failed to get snapshot

https://gitlab.freedesktop.org/mesa/mesa/-/jobs/20519522

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15682>
2022-04-04 12:48:40 +00:00
Juan A. Suarez Romero
689f9d2a5b v3d: fix some leaks in cache
Fix a couple of leaks introduced when adding support for on-disk shader
cache.

Fixes: 4468db20f7 ("v3d: add support for on-disk shader cache")
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15733>
2022-04-04 10:49:59 +00:00
Iago Toral Quiroga
827ef5fba9 v3dv: fix limits for inline uniform blocks
We don't support 'Update After Bind', however, the limits for this
model also include the ones without it. See the with or without remark
in the spec below:

"maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks is similar to
 maxPerStageDescriptorInlineUniformBlocks but counts descriptor bindings
 from descriptor sets created with or without the
 VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set."

Fixes:
dEQP-VK.api.info.vulkan1p2_limits_validation.ext_inline_uniform_block

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15732>
2022-04-04 09:28:55 +00:00
Tomeu Vizoso
51ab4ef4be Revert "ci/panfrost: Disable some jobs due to a lab failure"
Machines are back.

This reverts commit b5fd1fddd9.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15730>
2022-04-04 08:59:38 +02:00
Samuel Pitoiset
c439735a91 radv: save/restore the stencil reference during internal driver operations
I think I should improve this to be more robust.

Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6243
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/15700>
2022-04-04 06:31:11 +00:00
Samuel Pitoiset
41ece97afb radv: fix cleaning the image view for CmdCopyImageToBuffer()
Fixes: f07e67272e ("radv: fix vk_object_base_init/finish for internal image views")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15707>
2022-04-04 06:12:12 +00:00
Karmjit Mahil
e5439bf4aa pvr: Add stricter type checking in pvr_csb_pack().
Since the packing functions generated by csbgen use a void pointer
for the buffer in which to pack, it's possible to easily write out
of bounds. This commits attempts to reduce the chances by
having the pack macro check that the pointer passed points to an
element sized equally to the state word being packed. Catching
these errors earlier.

As can be seen in this commit, there already was a case of this:
"pds_ctrl". The word size is meant to be 64 bits but the pointer
was pointing to a 32 bit field.

Although it's fine for the word size to be smaller than the
storage pointed to by the pointer, this is not allowed just to
be extra careful.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15687>
2022-04-04 03:40:48 +00:00
Konstantin Seurer
c4650cbdb0 radv: Replace magic constants with enum values
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15722>
2022-04-03 12:43:00 +00:00
Konstantin Seurer
c8fe408fcc radv: Advertise ray primitive culling
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15722>
2022-04-03 12:43:00 +00:00
Konstantin Seurer
9f55888996 radv: Fully implement ray primitive culling
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15722>
2022-04-03 12:43:00 +00:00
Emma Anholt
e1de9b0de5 turnip: Allow image access on swapped formats.
This is apparently something that gamescope would like to have, and the
CTS's test coverage is happy with it.

Fixes: #6011 (we hope)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15293>
2022-04-02 19:55:40 +00:00
Emma Anholt
4cd51efedb turnip: Disable tiling on 1D images.
If we know the height is 1, then it would be a waste to align each
miplevel to tile height.  For non-mipmapped textures, it doesn't save us
memory (since you still align to 4 on the last miplevel), but it should be
better cache locality by not loading those unused lines.

Incidentally, this gets us some more coverage of swap != WZYX cases in CTS
tests, which often use optimal tiling without also testing linear.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15293>
2022-04-02 19:55:40 +00:00
Emma Anholt
71fcb751eb freedreno/a6xx: Set the color_swap field for storage descriptors.
This field does appear to work as expected: with 1D/1DArray turnip storage
images switched to be always linear, it fixes the dEQP-VK.image.*store*
tests using a color swapped format (once we allow color swap).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15293>
2022-04-02 19:55:40 +00:00
Emma Anholt
51b04a7dfb turnip: Add support for VK_KHR_format_feature_flags2.
This reports all of our storage formats as supporting read/write without
format, since we don't have any in-shader format conversions.  Similarly,
shadow comparisons were already supported on all the depth formats.

This extension is required for VK 1.3.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15293>
2022-04-02 19:55:40 +00:00
Emma Anholt
44aff2beec nir_to_tgsi: Add support for nir_intrinsic_image_samples.
Found in 1 piglit test on r600.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15627>
2022-04-02 15:17:01 +00:00
Erico Nunes
a570e6c243 lima/ci: enable piglit in lima CI
There are spare boards for it and the results appear stable.
Dividing the load in 2 parallel runs results in a run time
of around 10 minutes each.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15598>
2022-04-02 14:40:06 +00:00
Erico Nunes
148f8bc67f lima/ci: enable CI again
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15598>
2022-04-02 14:40:06 +00:00
Erico Nunes
6f6fd1cf75 lima/ci: update deqp results
Unfortunately some regressions sneaked in while CI was down.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15598>
2022-04-02 14:40:06 +00:00
Danylo Piliaiev
5ce06f8474 turnip: Use correct type for OUTARRAY in FormatProperties2
Fixes: 799a9db24c
("turnip: Stop using VK_OUTARRAY_MAKE()")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15694>
2022-04-02 09:51:45 +00:00
Vinod Koul
28ae397be1 freedreno/registers: update dsi registers to support dsc
Display Stream compression (DSC) compresses the display stream in
host which is later decoded by panel. This requires addition of 3 new
DSI registers to support DSC over DSI.

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14967>
2022-04-01 21:56:40 +00:00
Pavel Ondračka
b672814fe5 r300: don't assume position is always OUT[0] in rc_copy_output
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15677>
2022-04-01 21:18:42 +00:00
Pavel Ondračka
fb233ac411 r300: set PVS_XYZW_VALID_INST properly to last position write
This is a potential performance optimization, from the docs:
The PVS Instruction which updates the clip coordinatea position for
the last time. This value is used to lower the processing priority
while trivial clip and back-face culling decisions are made. This
field must be set to valid instruction.

Right now it is set at the last instruction. However, there is no
measurable performance effect in either Unigine Sanctuary, Lightsmark
or GLmark.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6045
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/15677>
2022-04-01 21:18:42 +00:00
Bas Nieuwenhuizen
51757d2249 radv: Add more BVH vertex formats.
AFAIU this is needed for DXR 1.1 with vkd3d-proton.

Reviewed-by: Samuel Pitoiset<samuel.pitoiset@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15475>
2022-04-01 21:00:20 +00:00
Corentin Noël
23f5e2edbd nir_to_tgsi: Handle blocks defined as arrays of arrays
Make sure to take all the array sizes into account when generating the TGSI.

Makes the `piglit.spec@arb_arrays_of_arrays@execution@ubo@fs-const-explicit-binding`
test pass

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/15713>
2022-04-01 15:41:36 +00:00
Tomeu Vizoso
b5fd1fddd9 ci/panfrost: Disable some jobs due to a lab failure
A dispatcher has had a hard disk failure and these devices are offline
now.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15711>
2022-04-01 14:37:03 +00:00
Daniel Schürmann
6d383159d4 aco/optimizer: check recursively if we can eliminate s_and exec
Totals from 2860 (2.12% of 134913) affected shaders: (GFX10.3)
CodeSize: 5990728 -> 5979164 (-0.19%); split: -0.20%, +0.01%
Instrs: 1094562 -> 1091653 (-0.27%); split: -0.28%, +0.01%
Latency: 8689841 -> 8684523 (-0.06%); split: -0.07%, +0.00%
InvThroughput: 1840533 -> 1840527 (-0.00%); split: -0.00%, +0.00%
SClause: 51437 -> 51439 (+0.00%)
Copies: 82461 -> 82472 (+0.01%)
PreSGPRs: 83136 -> 83172 (+0.04%)

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15675>
2022-04-01 15:35:26 +02:00
Gert Wollny
492401c054 virgl: Don't support QUADS natively
Using quads leads to a rather expensive buffer readback when quads
are stored in display lists, so avoid them altogether.

Closes: #5825

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15683>
2022-04-01 11:02:12 +00:00
Iago Toral Quiroga
597560e27c broadcom/compiler: always enable per-quad on spill operations
This ensures that any channels used for helper invocations are
also spilled/filled correctly.

Alternatively, we could recursively track all temps that get
involved in computing values that are then used in explicit
(dfdx,dfdy) or implicit (texture coordinates for mipmap or
anisotropic filtering, etc) derivatives, and only enable
per-quad on these (or disable spilling of any of these
values).

Fixes:
dEQP-VK.graphicsfuzz.cov-dfdx-dfdy-after-nested-loops

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15705>
2022-04-01 08:53:50 +00:00
Samuel Pitoiset
e6d7a6a3b7 radv: enable VK_EXT_separate_stencil_usage
This extension has been promoted to Vulkan 1.2 which means it has been
silently enabled when we implemented Vulkan 1.2.

Enable it explicitely to make mesamatrix happy and also for consistency.
This extension was designed for potential performance improvements of
MSAA depth/stencil images but it's currently a no-op in RADV.

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/15665>
2022-04-01 07:02:28 +00:00
Samuel Pitoiset
7c14671535 radv: use the common vk_framebuffer
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15612>
2022-04-01 08:21:59 +02:00
Samuel Pitoiset
8396a0d1fd radv: remove now unused radv_cmd_buffer_{begin,end}_render_pass()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15612>
2022-04-01 08:21:59 +02:00
Samuel Pitoiset
be28b566b0 radv: convert the meta clear path to dynamic rendering
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15612>
2022-04-01 08:21:59 +02:00
Samuel Pitoiset
67c2a6adc6 radv: convert the meta blit path to dynamic rendering
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15612>
2022-04-01 08:21:59 +02:00
Samuel Pitoiset
e6fac090e6 radv: convert the meta resolve HW path to dynamic rendering
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15612>
2022-04-01 08:21:53 +02:00
Samuel Pitoiset
b18afccb61 radv: convert the meta resolve depth/stencil FS path to dynamic rendering
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15612>
2022-04-01 08:21:53 +02:00
Samuel Pitoiset
518c6d808e radv: convert the meta resolve color FS path to dynamic rendering
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15612>
2022-04-01 08:21:53 +02:00
Samuel Pitoiset
42db590006 radv: convert the meta blit 2d path to dynamic rendering
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15612>
2022-04-01 08:21:53 +02:00
Samuel Pitoiset
fc3125ed6c radv: convert the meta fast clear flush path to dynamic rendering
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15612>
2022-04-01 08:21:52 +02:00
Samuel Pitoiset
70e663aa21 radv: convert the meta depth decompression path to dynamic rendering
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15612>
2022-04-01 08:21:52 +02:00
Samuel Pitoiset
9309c3d887 radv: rework the workaround that disables DCC for incompatible copies
Rely on the image view to avoid using an extra structure for the
render pass. This will allow to convert the meta operations to
dynamic rendering.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15612>
2022-04-01 08:21:52 +02:00
Yonggang Luo
be1b30393b util: Getting u_debug.h not depends on pipe/*
Move pipe_debug_type into u_debug.h
Move pipe_debug_callback into u_debug.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15657>
2022-04-01 01:52:43 +00:00
Yonggang Luo
b2ece67f11 util: Rename PIPE_DEBUG_TYPE to UTIL_DEBUG_TYPE
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15657>
2022-04-01 01:52:43 +00:00
Yonggang Luo
ab225a1e36 util: Rename pipe_debug_type to util_debug_type
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15657>
2022-04-01 01:52:43 +00:00
Yonggang Luo
dca7ea4a12 pipe: place struct util_debug_callback at the proper place in p_context.h
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15657>
2022-04-01 01:52:43 +00:00
Yonggang Luo
2ca6ef22f7 util: Rename pipe_debug_callback to util_debug_callback
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15657>
2022-04-01 01:52:43 +00:00
Yonggang Luo
523675e995 util: Rename pipe_debug_message to util_debug_message
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15657>
2022-04-01 01:52:43 +00:00
Mike Blumenkrantz
240cd8088c lavapipe: set LVP_POISON_MEMORY for ci
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15620>
2022-04-01 01:14:03 +00:00
Mike Blumenkrantz
2d8d7c0638 zink: set LVP_POISON_MEMORY for ci
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15620>
2022-04-01 01:14:03 +00:00
Mike Blumenkrantz
0be484ece4 lavapipe: add an env var to enable poisoning memory allocations
it's not random, but it's definitely not zero or any other expected
value, which means it's going to break anything that was passing due to lucky
uninitialized values

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15620>
2022-04-01 01:14:03 +00:00
Dave Airlie
dcadeb9a47 llvmpipe: fix nr_sampler_view in key creation.
This was doing MAX2() but nr_sampler_views hasn't been initialised
yet.

Fixes: 690cc3bb80 ("llvmpipe: overhaul fs/cs variant keys to be simpler.")

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15603>
2022-04-01 09:52:43 +10:00
Dave Airlie
57dd05616f zink/query: rewrite the query handling code to pass validation.
The current code was allowing multiple query pools of the same type to be
active on the same commmand buffer which creates validation warnings.

Restructure the query handling, so the query pools are allocated on the
context on first use, then have queries allocate query_id from those pools.

This approach creates a new start dynamic array that contains each time a
vulkan query is started for a gallium query, and holds the flags for it rather
than storing them in a massive array.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15702>
2022-03-31 23:42:03 +00:00
Dave Airlie
b96ddc37bc zink/query: only reset the range of queries in use.
This reduces the amount of resetting needed.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15702>
2022-03-31 23:42:03 +00:00
Dave Airlie
7f3a959d2f zink/query: refactor get_query_result to map upfront.
This maps upfront and processes the results in a clearer way.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15702>
2022-03-31 23:42:03 +00:00
Dave Airlie
f090cac54a zink/query: use a single query pool for XFB queries.
There is no need to use a separate pool for each AFAIK.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15702>
2022-03-31 23:42:03 +00:00
Dave Airlie
0d14c491de zink: refactor out number of vk queries per gallium query helper
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15702>
2022-03-31 23:42:03 +00:00
Dave Airlie
ce28974d06 zink/query: collapse the xfb_query_pool array into the normal one.
This makes things a bit easier to follow.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15702>
2022-03-31 23:42:03 +00:00
Dave Airlie
7303ba3a67 zink/query: consolidate xfb_buffers into one array.
This makes the code more complex than needed, just use on buffers
array.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15702>
2022-03-31 23:42:03 +00:00
Dave Airlie
6bbbe15a78 Reinstate: llvmpipe: allow vertex processing and fragment processing in parallel
This reinstates patch: ec8104c6b2
 llvmpipe: allow vertex processing and fragment processing in parallel

For now unknown reasons bisecting an error had lead to this patch, but
the actual bug was in virglrendrerer and the accoring feature was now only
enabled with https://gitlab.freedesktop.org/mesa/mesa/-/issues/6130

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

Original patch was

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15684>
2022-03-31 23:24:56 +00:00
Georg Lehmann
80a7ed273a radv: Enable global bo list if 1.2 features are used.
These features require the global bo list and the existing code only checked
if the extensions which were promoted to 1.2 are enabled.

Found by inspection.

Cc: mesa-stable
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15701>
2022-03-31 20:35:57 +00:00
Ian Romanick
7fd1955412 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: 635ed58e52 ("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>
2022-03-31 12:59:18 -07:00
Chad Versace
3f8224baee 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>
2022-03-31 18:20:01 +00:00
Rajnesh Kanwal
d5405c1608 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>
2022-03-31 17:18:22 +00:00
Rajnesh Kanwal
9f6571e80a 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>
2022-03-31 17:18:22 +00:00
Karmjit Mahil
0d25db406b 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>
2022-03-31 17:12:21 +00:00
Frank Binns
93ee0c7911 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>
2022-03-31 17:05:44 +00:00
Mike Blumenkrantz
33c800bf91 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>
2022-03-31 15:15:10 +00:00
Bas Nieuwenhuizen
9632e6eefa 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>
2022-03-31 14:43:10 +00:00
Adam Jackson
d43e6a9a49 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>
2022-03-31 09:58:49 -04:00
Adam Jackson
97554218f4 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>
2022-03-31 09:58:47 -04:00
Adam Jackson
b6f7a4836a 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>
2022-03-31 09:58:43 -04:00
Adam Jackson
c1dc98ceec 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>
2022-03-31 09:58:40 -04:00
Adam Jackson
9c772de270 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>
2022-03-31 09:58:32 -04:00
Boris Brezillon
23bd889541 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>
2022-03-31 12:21:35 +00:00
Boris Brezillon
f16a7aa9d6 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>
2022-03-31 12:21:35 +00:00
Samuel Pitoiset
738a6760e3 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>
2022-03-31 11:47:22 +00:00
Erik Faye-Lund
83ed40cdcd 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: dcbf2423d2 ("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>
2022-03-31 13:21:13 +02:00
Samuel Pitoiset
b784910ac7 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>
2022-03-31 10:40:51 +00:00
Pierre-Eric Pelloux-Prayer
d58105fdd4 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>
2022-03-31 10:15:19 +00:00
Pierre-Eric Pelloux-Prayer
7d7c56e61a 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>
2022-03-31 10:15:19 +00:00
Pierre-Eric Pelloux-Prayer
47152875c7 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>
2022-03-31 10:15:19 +00:00
Pierre-Eric Pelloux-Prayer
9c2605ae42 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>
2022-03-31 10:15:19 +00:00
Boris Brezillon
329f16fffc 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>
2022-03-31 09:46:36 +00:00
Boris Brezillon
4194c89ed8 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>
2022-03-31 09:46:36 +00:00
Boris Brezillon
b402cff591 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>
2022-03-31 09:46:36 +00:00
Yonggang Luo
bf3c772e5e 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>
2022-03-31 09:16:27 +00:00
Yonggang Luo
55ca1c8db3 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>
2022-03-31 09:16:27 +00:00
Daniel Schürmann
db8c401f71 aco/ra: fix stride check on subdword parallelcopies for create_vector
On GFX6/7, info.rc is in full dwords.

Fixes: 9476986e6f ('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>
2022-03-31 08:55:07 +00:00
Samuel Pitoiset
d32656bc65 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>
2022-03-31 07:34:21 +00:00
Samuel Pitoiset
2b18234e61 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>
2022-03-31 07:13:17 +00:00
Yiwei Zhang
e8a63cf61e 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>
2022-03-31 00:00:01 +00:00
Jason Ekstrand
51077e821a 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>
2022-03-30 23:17:56 +00:00
Jason Ekstrand
08512aea09 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>
2022-03-30 23:17:56 +00:00
Jason Ekstrand
8e51778acf 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>
2022-03-30 23:17:56 +00:00
Jason Ekstrand
e0ffdc8ce0 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>
2022-03-30 23:17:56 +00:00
Jason Ekstrand
9ddab162b7 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>
2022-03-30 23:17:56 +00:00
Emma Anholt
97f17d4b38 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>
2022-03-30 22:26:15 +00:00
Emma Anholt
761eb7e539 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>
2022-03-30 22:26:15 +00:00
Jason Ekstrand
dc2c9bae25 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>
2022-03-30 20:43:12 +00:00
Mike Blumenkrantz
38064566c6 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>
2022-03-30 17:50:35 +00:00
Alyssa Rosenzweig
0c1fde956b 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>
2022-03-30 17:29:12 +00:00
Alyssa Rosenzweig
42b9295fa6 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>
2022-03-30 17:29:12 +00:00
Alyssa Rosenzweig
ac51142bab 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>
2022-03-30 17:29:12 +00:00
Alyssa Rosenzweig
ee9b63a7bb 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>
2022-03-30 17:29:12 +00:00
Alyssa Rosenzweig
5b056971a3 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>
2022-03-30 17:29:12 +00:00
Alyssa Rosenzweig
913a7ed41a 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>
2022-03-30 17:29:12 +00:00
Alyssa Rosenzweig
3e08672369 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>
2022-03-30 17:29:12 +00:00
Alyssa Rosenzweig
5e76467d5d 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>
2022-03-30 17:29:12 +00:00
Alyssa Rosenzweig
fc81415f47 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>
2022-03-30 17:29:12 +00:00
Alyssa Rosenzweig
ac5eb4934b pan/bi: Fix write_mask size
We really need to stop tying the IR to Bifrost...

Fixes: 3c817ed511 ("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>
2022-03-30 17:29:12 +00:00
Alyssa Rosenzweig
12edaae64a 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>
2022-03-30 17:29:12 +00:00
Rajnesh Kanwal
860e3f6ff9 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>
2022-03-30 14:26:07 +00:00
Rohan Garg
d876abeaa8 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>
2022-03-30 15:19:47 +02:00
Omar Akkila
4e4b411378 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>
2022-03-30 08:23:18 +00:00
Omar Akkila
803705425e 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>
2022-03-30 08:23:18 +00:00
Omar Akkila
f2fa850888 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>
2022-03-30 08:23:18 +00:00
Lionel Landwerlin
684a4ea30c intel/clc: fix missing pointer write
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 346a7f14fb ("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>
2022-03-30 07:56:25 +00:00
Samuel Pitoiset
03888bf09c 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: 87b65af43e ("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>
2022-03-30 07:00:57 +00:00
Corentin Noël
f86bc873ff 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: 74c02d99b2

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>
2022-03-30 04:19:14 +00:00
Mike Blumenkrantz
6cfde0abe9 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>
2022-03-30 03:49:36 +00:00
Mike Blumenkrantz
2b22485702 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>
2022-03-30 03:49:36 +00:00
Mike Blumenkrantz
0108323996 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>
2022-03-30 03:49:36 +00:00
Mike Blumenkrantz
452d4d00df 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>
2022-03-30 03:49:36 +00:00
Mike Blumenkrantz
206d2f3127 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>
2022-03-30 03:36:33 +00:00
Mike Blumenkrantz
fe7c3eba33 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>
2022-03-30 03:18:52 +00:00
Mike Blumenkrantz
d415c28e64 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>
2022-03-30 03:04:47 +00:00
Mike Blumenkrantz
5461a1cbaa 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>
2022-03-30 02:47:45 +00:00
Mike Blumenkrantz
7aed40e4ab 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>
2022-03-30 02:47:45 +00:00
Mike Blumenkrantz
4eca6e3e5d 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>
2022-03-30 02:31:56 +00:00
Dave Airlie
63d0440034 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>
2022-03-30 02:16:18 +00:00
Mike Blumenkrantz
8e2555234b 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>
2022-03-30 02:16:18 +00:00
Yonggang Luo
c91e3c6a42 util: Should not use ASSERTED in util_thread_get_time_nano
The parameter is not ASSERTED
Fixes: 0f1b3fc17f ("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>
2022-03-29 23:33:21 +00:00
Mike Blumenkrantz
4525d7ed85 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>
2022-03-29 22:43:52 +00:00
Mike Blumenkrantz
e219351457 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>
2022-03-29 22:12:30 +00:00
Mike Blumenkrantz
4ec71a3429 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>
2022-03-29 22:12:30 +00:00
Mike Blumenkrantz
65ec846f77 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>
2022-03-29 21:44:51 +00:00
Pavel Ondračka
806dcf9db7 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>
2022-03-29 21:37:24 +00:00
Pavel Ondračka
8c90a5fab7 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>
2022-03-29 21:37:24 +00:00
Pavel Ondračka
882811b1ff 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>
2022-03-29 21:37:24 +00:00
Pavel Ondračka
d9449c5201 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>
2022-03-29 21:37:24 +00:00
Pavel Ondračka
5dcef1e7b8 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>
2022-03-29 21:37:24 +00:00
Mike Blumenkrantz
8cf10ae144 zink: add in radv passes to baseline
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15654>
2022-03-29 21:24:01 +00:00
Mike Blumenkrantz
f3fa085fc6 zink: more radv fails
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15654>
2022-03-29 21:24:01 +00:00
Mike Blumenkrantz
4e6f1c1478 zink: update radv baseline
it doesn't look like these ever passed?

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15654>
2022-03-29 21:24:01 +00:00
Kenneth Graunke
8831cb38aa 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>
2022-03-29 20:45:59 +00:00
Kenneth Graunke
1967fd3b10 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: a920979d4f ("intel/fs: Use split sends for surface writes on gen9+")
Fixes: 4f86a70599 ("intel/fs: Lower DW untyped r/w messages to LSC when available")
Fixes: d372abe397 ("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>
2022-03-29 13:06:17 -07:00
Dylan Baker
356f6bb8a5 docs: update calendar and link releases notes for 22.0.1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15653>
2022-03-29 13:01:17 -07:00
Dylan Baker
215ae6b270 docs: add sah256 sum for mesa 22.0.1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15653>
2022-03-29 13:01:12 -07:00
Dylan Baker
d85cdcad5d docs: add release notes for 22.0.1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15653>
2022-03-29 13:01:10 -07:00
Filip Gawin
5a459b8f6b 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>
2022-03-29 19:49:17 +00:00
Dylan Baker
85ae6598fa docs: Add calendar entries for 22.1 release candidates.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15650>
2022-03-29 19:29:48 +00:00
Mike Blumenkrantz
01f3504e2f 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>
2022-03-29 19:17:10 +00:00
Mike Blumenkrantz
408f114830 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>
2022-03-29 19:01:01 +00:00
Yonggang Luo
a1814067cd 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>
2022-03-30 00:45:11 +08:00
Yonggang Luo
153cb830c4 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>
2022-03-30 00:45:08 +08:00
Yonggang Luo
887d74dd2f 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>
2022-03-30 00:45:03 +08:00
Mike Blumenkrantz
0bef8bc054 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>
2022-03-29 15:48:27 +00:00
Jason Ekstrand
4a08ee7ecf 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>
2022-03-29 15:02:07 +00:00
Jason Ekstrand
688d478045 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: ff8586c345 ("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>
2022-03-29 14:38:41 +00:00
Mike Blumenkrantz
d001150d0c doc: update extensions for lavapipe
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15636>
2022-03-29 12:41:51 +00:00
Mike Blumenkrantz
aed49c89a5 lavapipe: display EXT_graphics_pipeline_library
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15636>
2022-03-29 12:41:51 +00:00
Mike Blumenkrantz
d4d5a7abba lavapipe: implement EXT_graphics_pipeline_library
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15636>
2022-03-29 12:41:51 +00:00
Mike Blumenkrantz
22fd70ca81 lavapipe: support KHR_pipeline_library
this is basically a no-op since raytracing isn't supported

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15636>
2022-03-29 12:41:51 +00:00
Mike Blumenkrantz
0918095b9a lavapipe: EXT_primitives_generated_query
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15636>
2022-03-29 12:41:51 +00:00
Mike Blumenkrantz
8c3b4dd996 vulkan: update spec to 1.3.210
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15635>
2022-03-29 07:59:23 -04:00
Iago Toral Quiroga
7f6ecb8667 v3dv: add reference counting for descriptor set layouts
The spec states that descriptor set layouts can be destroyed almost
at any time:

   "VkDescriptorSetLayout objects may be accessed by commands that
    operate on descriptor sets allocated using that layout, and those
    descriptor sets must not be updated with vkUpdateDescriptorSets
    after the descriptor set layout has been destroyed. Otherwise,
    descriptor set layouts can be destroyed any time they are not in
    use by an API command."

Based on a similar fix for RADV.

Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5893
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15634>
2022-03-29 11:28:39 +00:00
Iago Toral Quiroga
ca861bd6f4 v3dv: drop unnecessary memset
We are already zeroing when we allocate the descriptor set layout
memory with vk_object_zalloc.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15634>
2022-03-29 11:28:39 +00:00
Iago Toral Quiroga
591eed30b2 v3dv: fix sampler array addressing in v3dv_descriptor_set_layout
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15634>
2022-03-29 11:28:39 +00:00
Samuel Pitoiset
00cc52b282 radv: remove now unused radv_nir_compiler_options::layout
Descriptors are lowered in NIR and the layout is no longer used in the
backend compilers.

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/15630>
2022-03-29 10:39:07 +00:00
Kenneth Graunke
50467aa558 iris: Properly tell the decoder about inherited binder addresses
iris may rely on 3DSTATE_BINDING_TABLE_POOL_ALLOC's address being
inherited from a previous batch.  So, we need to tell the decoder
about the address in case it sees binding tables to decode before
it encounters such a command in the batch.

We used to update surface_base, now we update bt_pool_base instead.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15625>
2022-03-29 02:35:54 -07:00
Kenneth Graunke
9bc97e4fc1 intel/decoder: Fix decoder handling of binding table pool alloc on XeHP
3DSTATE_BINDING_TABLE_POOL_ALLOC no longer has a "Binding Table Pool
Enable" bit.  It is always enabled.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15625>
2022-03-29 02:35:54 -07:00
Mihai Preda
08f74e7185 radeonsi: merge the copy_image shader generators
Use a unified si_create_copy_image_cs() to generate both the 1D and 2D
copy shaders; the shaders themselves remain separate.

Also:
- add a helper deref_ssa() for nir deref
- add a helper set_work_size() for setting workgroup and grid sizes
- pass si_context (instead of pipe_context) to the copy_image generator

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15268>
2022-03-29 09:06:57 +00:00
Mihai Preda
c0ef40bbce radeonsi: convert copy_image_1d_array shader to NIR
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15268>
2022-03-29 09:06:57 +00:00
Mihai Preda
18722af9d2 radeonsi: convert copy_image shader to NIR
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15268>
2022-03-29 09:06:57 +00:00
Vinson Lee
79ba1962ac pvr: Remove duplicate variable queue_create.
Fix defect reported by Coverity Scan.

Evaluation order violation (EVALUATION_ORDER)
write_write_typo: In queue_create = queue_create = &pCreateInfo->pQueueCreateInfos[0], queue_create is written twice with the same value.

Fixes: 8991e64641 ("pvr: Add a Vulkan driver for Imagination Technologies PowerVR Rogue GPUs")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15604>
2022-03-29 08:56:27 +00:00
Danylo Piliaiev
10734fb748 turnip: enable has_ccu_flush_bug workaround for a660
It seems that a660 has the same bug. Without the workaround there
are a lot of flakes with depth-stencil tests, e.g. in:
 dEQP-VK.pipeline.extended_dynamic_state.*
 dEQP-VK.renderpass.depth_stencil_write_conditions.*
 dEQP-VK.pipeline.stencil.format.d24_unorm_s8_uint.states.*

Or guaranteed failures like of:
 dEQP-VK.pipeline.render_to_image.core.2d.huge.width.r8g8b8a8_unorm_d32_sfloat_s8_uint

Enabling the workaround fixes all of them.

cc: mesa-stable

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15548>
2022-03-29 08:34:18 +00:00
Tales Lelo da Aparecida
fe66cff411 zink: validate and log errors on vulkan calls
This commit also replaces debug_printf with mesa_loge

Signed-off-by: Tales Lelo da Aparecida <tales.aparecida@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15601>
2022-03-28 21:46:59 -03:00
Mihai Preda
1f92c30170 radeonsi/tests: update baseline and flakes on vega20
The piglit suite was run on vega20, 10 times, on a 'debugoptimized' mesa build
at commit 582e7f15 . The inconsistent failures were added to the flakes file.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15487>
2022-03-28 22:48:16 +00:00
Mihai Preda
a6d7c5aa31 radeonsi/tests: add flakes option to radeonsi-run-tests.py
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15487>
2022-03-28 22:48:16 +00:00
Mihai Preda
88c14ed1da radeonsi/tests: fix file left open in radeonsi-run-tests.py
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15487>
2022-03-28 22:48:16 +00:00
Mike Blumenkrantz
e54fb81151 zink: run piglit's gpu profile
increase coverage

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15606>
2022-03-28 22:35:32 +00:00
Konstantin Seurer
a8c7e8fef8 venus: Use trivial common entrypoints
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15613>
2022-03-28 22:15:45 +00:00
Konstantin Seurer
87b65af43e radv: Use common GetPhysicalDeviceMemoryProperties
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15613>
2022-03-28 22:15:45 +00:00
Mike Blumenkrantz
3b39e4d913 lavapipe: run optimize loop before krangling pipeline layout
in scenarios like:

vec1 32 ssa_151 = deref_var &shadow_map (uniform sampler2D)
vec1 32 ssa_152 = deref_var &shadow_map (uniform sampler2D)
vec2 32 ssa_153 = vec2 ssa_151, ssa_152
vec1 32 ssa_154 = deref_var &param@4 (function_temp uvec2)
intrinsic store_deref (ssa_154, ssa_153) (wrmask=xy /*3*/, access=0)
vec1 32 ssa_160 = deref_var &param@4 (function_temp uvec2)
vec2 32 ssa_164 = intrinsic load_deref (ssa_160) (access=0)
vec1 32 ssa_167 = mov ssa_164.x
vec1 32 ssa_168 = deref_cast (texture2D *)ssa_167 (uniform texture2D)  /* ptr_stride=0, align_mul=0, align_offset=0 */
vec1 32 ssa_169 = mov ssa_164.y
vec1 32 ssa_170 = deref_cast (sampler *)ssa_169 (uniform sampler)  /* ptr_stride=0, align_mul=0, align_offset=0 */
vec1 32 ssa_172 = (float32)tex ssa_168 (texture_deref), ssa_170 (sampler_deref), ssa_171 (coord), ssa_166 (comparator)

the real variable is stored to a function_temp and then loaded back again,
which means it isn't a direct deref and lower_vri_instr_tex_deref() will
crash because the variable can't be found

BUT running only the passes needed to eliminate derefs will break other tests,
so just run the whole optimize loop again here to avoid such issues

for #5945

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15511>
2022-03-28 22:01:49 +00:00
Mike Blumenkrantz
6158e9448a zink: add a couple flakes
unsure what caused these but they started a week ago and were first seen
in https://gitlab.freedesktop.org/mesa/mesa/-/jobs/19950494

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15621>
2022-03-28 21:50:04 +00:00
Yiwei Zhang
6d1cc0e47d venus: let vn_android use vn_BindImageMemory2 and directly use reqs
v2: remove an unused variable

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com> (v1)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15619>
2022-03-28 21:39:05 +00:00
Timur Kristóf
2132d4278d radv: Use correct buffer offset for conditional rendering.
Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15615>
2022-03-28 20:32:34 +00:00
Georg Lehmann
141ca78634 radv, aco: Packed iadd_sat/uadd_sat.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15421>
2022-03-28 20:02:52 +00:00
Georg Lehmann
6b662a4f0c radv: Lower 64bit iadd_sat.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15421>
2022-03-28 20:02:52 +00:00
Georg Lehmann
50f585254c aco: Implement scalar iadd_sat.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15421>
2022-03-28 20:02:52 +00:00
Georg Lehmann
989f2b1785 aco: Implement 64bit uadd_sat.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15421>
2022-03-28 20:02:52 +00:00
Georg Lehmann
16be909936 nir: Add an option to lower 64bit iadd_sat.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15421>
2022-03-28 20:02:52 +00:00
Georg Lehmann
922916bf64 nir: Move lower_usub_sat64 to nir_lower_int64_options.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15421>
2022-03-28 20:02:52 +00:00
Georg Lehmann
01fad6aa72 aco: Remove 0 data components from image stores.
Image stores always write a full texel.
The hardware writes zero for components not included in dmask.

Totals from 387 (0.29% of 134913) affected shaders: (GFX10.3)
VGPRs: 17216 -> 17136 (-0.46%)
CodeSize: 1987652 -> 1981504 (-0.31%)
MaxWaves: 9054 -> 9058 (+0.04%)
Instrs: 361883 -> 361115 (-0.21%); split: -0.21%, +0.00%
Latency: 5383187 -> 5381227 (-0.04%); split: -0.04%, +0.00%
InvThroughput: 1373830 -> 1372097 (-0.13%)
VClause: 9031 -> 9038 (+0.08%); split: -0.04%, +0.12%
Copies: 25923 -> 25153 (-2.97%); split: -2.98%, +0.01%
PreVGPRs: 14643 -> 14555 (-0.60%)

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14986>
2022-03-28 19:43:18 +00:00
Alejandro Piñeiro
81039feda4 broadcom: update language on V3D_DEBUG options
Some typos, and bad grammar.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15593>
2022-03-28 19:21:48 +00:00
Alejandro Piñeiro
2f33c52daf docs: document v3d/v3dv envvars
As we are here we also update VC4_DEBUG option, in order to rely on
VC4_DEBUG=help

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15593>
2022-03-28 19:21:48 +00:00
Emma Anholt
b8324a7387 r600: Implement memoryBarrier() in the non-SFN path.
Previously we were just doing a group barrier for both membar and barrier.
This sometimes worked out, because atomics and reads waited for ack
already, but writes were not waiting for ack.  Use the need_wait_ack
pattern that scratch writes used, with a little refactoring for
reusability.

The refactor also incidentally fixes the atomics waiting for outstanding
acks to be > 1 instead of > 0.

Cc: mesa-stable
Fixes: #6028
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14429>
2022-03-28 10:54:46 -07:00
Emma Anholt
991a95a352 r600: Disable SB when INTERP_SAMPLE is used.
Avoids an assertion failure in the SB scheduler.

Cc: mesa-stable
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14429>
2022-03-28 10:54:46 -07:00
Emma Anholt
f315ea9eff r600: Disable SB in the presence of indirection on temp arrays.
Prevents several regressions when NIR-to-TGSI is enabled where it was
allocating arrays on top of each other.

Fixes vec3 fails on RV770,
dEQP-GLES3.functional.shaders.metamorphic.bubblesort_flag.variant_1 and 2
in general, and fixes another piglit but breaks two others.  Still, this
seems to be a win.

Cc: mesa-stable
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14429>
2022-03-28 10:54:46 -07:00
Emma Anholt
955883cf0a r600: Add a workaround and explanation for shadowcubearray TG4.
With the NIR-to-TGSI transition, we had fewer other immediates and would
end up dereffing past the end of the literals array.

Cc: mesa-stable
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14429>
2022-03-28 10:54:46 -07:00
Emma Anholt
ef151d24ab r600: Fix ordering of SSBO loads versus texturing.
The two types of instructions get added to the same CF list, but not the
same instr list within the CF list.  So, if you SSBO fetched your
texcoord, the emission of the SSBO fetch would come *after* the texcoord
fetch.

Avoids regressions when NIR-to-TGSI starts optimizing more.

Cc: mesa-stable
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14429>
2022-03-28 10:54:46 -07:00
Emma Anholt
6d6043e628 r600: Drop unused debug options from the fork off of radeonsi.
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14429>
2022-03-28 10:54:46 -07:00
Emma Anholt
357c9d0603 r600: Drop unused sbcl debug option.
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14429>
2022-03-28 10:54:46 -07:00
Emma Anholt
626ab112f6 r600: Add shader-compiler debug knobs to the shader cache key.
Otherwise, you'll get cached results from the previous debug knob state.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14429>
2022-03-28 10:54:46 -07:00
Emma Anholt
9acb622c44 ci/r600: Check in some expectation files for rv770 and Turks.
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14429>
2022-03-28 10:54:46 -07:00
Pavel Ondračka
f82a0d10cd r300: respect output_semantic_index when writing colors
Right now we don't explicitly check it and we expect that the
output_semantic_index array is always ordered. Unfortunately,
this is not the case since 74c02d99b2

Fixes corruption in Amnesia: the Dark Descent.

cc: mesa-stable

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6179
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15523>
2022-03-28 17:46:32 +00:00
Emma Anholt
28d6a5af25 r600: Add shader precompile and shader-db support.
This should reduce draw-time jank, and was useful for me in evaluating
NIR-to-TGSI's impact for r600.

Acked-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14427>
2022-03-28 17:39:02 +00:00
Emma Anholt
f07b8a0cac r600: Update the PS state when MSAA-ness changes, too.
Avoids a regression when enabling shader precompilation, where the
precompile would happen with MSAA disabled (so no sample mask export) but
we'd never catch up to the shader being rendered with MSAA.

Doesn't fix any current testcases, though.

Acked-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14427>
2022-03-28 17:39:02 +00:00
Emma Anholt
e0429d9fef r600: Update the PS state before checking for cb_misc update.
The update_ps_state updates ps_shader->current->ps_color_export_mask, so
we could miss statechanges.

Cc: mesa-stable
Acked-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14427>
2022-03-28 17:39:02 +00:00
Emma Anholt
a9a5b83b0a r600: Drop nr_ps_max_color_exports
Prior to b652180107 ("r600g: don't snoop context state while building
shaders"), it fed into the shader key, but nothing does any more.

Acked-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14427>
2022-03-28 17:39:02 +00:00
Connor Abbott
0b0b9274b6 freedreno/ci: Fix skip comment
This test was never supposed to be skipped, and the referenced commit
just exposed a bug in turnip fixed by the previous commit. It was
hanging due to a CTS bug making the submit take way too long, which will
be fixed once the CTS change lands.

Also, add it to the a630 skips.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15563>
2022-03-28 17:16:54 +00:00
Connor Abbott
9d081d7561 tu: Correctly handle VK_IMAGE_CREATE_EXTENDED_USAGE_BIT
In this case we should relax checks based on the format, since the user
will be responsible for them when creating an image view.

This gets dEQP-VK.image.sample_texture.*_bit_compressed_format_* not
skipping again after VK-GL-CTS 736eec57dc0c ("Fix checkSupport in
compressed texture sampling tests").

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15563>
2022-03-28 17:16:54 +00:00
Samuel Pitoiset
1b2ccea63f radv: advertise VK_EXT_depth_clip_control
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6070
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/15192>
2022-03-28 16:50:12 +00:00
Samuel Pitoiset
43e83949dc radv: implement VK_EXT_depth_clip_control
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/15192>
2022-03-28 16:50:12 +00:00
Danylo Piliaiev
37939e9c54 turnip: Fix the lack of WFM before indirect draws
We have to add WFM to pending bits when we are flushing into CP
for indirect draw to know when they should apply WFM workaround.

Fixes CTS tests:
dEQP-VK.draw.renderpass.indirect_draw.*_data_from_compute.indirect_draw_count*

Fixes: abf0ae014a
("tu: Properly handle waiting on an earlier pipeline stage")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15577>
2022-03-28 16:09:07 +00:00
Gert Wollny
1994f1404e virgl: re-enable PIPE_CAP_TGSI_TEXCOORD with new host versions
Also upreaf the virglrenderer version used in the CI.

v2: Update checksums of trace result images (0 pixels were different)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com> (v1)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15446>
2022-03-28 15:21:58 +00:00
Samuel Pitoiset
4cfb5332d6 radv: lower adjusting gl_FragCoord.z for VRS in NIR
fossils-db (Sienna Cichlid):
Totals from 4432 (3.29% of 134913) affected shaders:
VGPRs: 231232 -> 231880 (+0.28%)
CodeSize: 24738224 -> 24718008 (-0.08%); split: -0.08%, +0.00%
MaxWaves: 93120 -> 93000 (-0.13%)
Instrs: 4540970 -> 4541062 (+0.00%); split: -0.01%, +0.01%
Latency: 49658353 -> 49641444 (-0.03%); split: -0.05%, +0.01%
InvThroughput: 9604328 -> 9603041 (-0.01%); split: -0.02%, +0.01%
VClause: 66497 -> 66498 (+0.00%)
SClause: 209530 -> 209532 (+0.00%); split: -0.01%, +0.01%
Copies: 276135 -> 276249 (+0.04%); split: -0.14%, +0.18%
PreSGPRs: 189409 -> 189415 (+0.00%)
PreVGPRs: 207368 -> 207458 (+0.04%)

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/15450>
2022-03-28 16:17:37 +02:00
Samuel Pitoiset
a42b6a4d39 radv: lower load_sample_mask_in in NIR
No fossils-db changes.

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/15450>
2022-03-28 16:17:34 +02:00
Mike Blumenkrantz
e23f881311 radv: fix CmdSetColorWriteEnableEXT(attachmentCount==MAX_RTS)
cc: mesa-stable

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15508>
2022-03-28 12:59:28 +00:00
Samuel Pitoiset
8c51874af4 radv,aco: lower color exports in NIR
fossils-db (Sienna Cichlid):
Totals from 27108 (20.09% of 134913) affected shaders:
VGPRs: 1260608 -> 1261424 (+0.06%); split: -0.00%, +0.07%
CodeSize: 112795868 -> 112785892 (-0.01%); split: -0.05%, +0.04%
MaxWaves: 628608 -> 628448 (-0.03%); split: +0.00%, -0.03%
Instrs: 20750003 -> 20749314 (-0.00%); split: -0.01%, +0.00%
Latency: 288088081 -> 288015865 (-0.03%); split: -0.06%, +0.04%
InvThroughput: 53944847 -> 53961693 (+0.03%); split: -0.01%, +0.04%
VClause: 396463 -> 396467 (+0.00%); split: -0.02%, +0.02%
SClause: 842088 -> 842150 (+0.01%); split: -0.03%, +0.04%
Copies: 1244982 -> 1259026 (+1.13%); split: -0.01%, +1.14%
PreSGPRs: 1251949 -> 1251909 (-0.00%)
PreVGPRs: 1099647 -> 1100879 (+0.11%); split: -0.03%, +0.14%

fossils-db (Polaris10):
Totals from 23928 (17.60% of 135960) affected shaders:
SGPRs: 1751792 -> 1751024 (-0.04%); split: -0.05%, +0.01%
VGPRs: 1098964 -> 1098556 (-0.04%); split: -0.13%, +0.09%
CodeSize: 99893472 -> 99837940 (-0.06%); split: -0.06%, +0.00%
MaxWaves: 138322 -> 138306 (-0.01%); split: +0.03%, -0.04%
Instrs: 19213995 -> 19211980 (-0.01%); split: -0.02%, +0.01%
Latency: 273026926 -> 273109402 (+0.03%); split: -0.01%, +0.04%
InvThroughput: 111160907 -> 111195187 (+0.03%); split: -0.04%, +0.07%
VClause: 343058 -> 343097 (+0.01%); split: -0.02%, +0.03%
SClause: 802756 -> 802884 (+0.02%); split: -0.04%, +0.06%
Copies: 1729387 -> 1739208 (+0.57%); split: -0.04%, +0.61%
PreSGPRs: 1090264 -> 1090303 (+0.00%); split: -0.00%, +0.01%
PreVGPRs: 959490 -> 960600 (+0.12%); split: -0.04%, +0.15%

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/15263>
2022-03-28 11:47:35 +00:00
Jakob Bornecrantz
9e31991c6e vulkan-device-select: Don't leak xcb_query_extension_reply_t
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15600>
2022-03-28 11:06:11 +00:00
Iago Toral Quiroga
ce849032a4 broadcom/compiler: allow ldunifa with indirect uniform loads
We handle uniforms by copying them into the uniform stream to be
consumed with ldunif when they have a constant offset. Otherwise
we fallback to general TMU access, which has more latency.

However, just like we did for UBOs and read-only SSBOs, we can
also try to use the unifa mechanism to handle indirect accesses
in certain cases instead of the TMU fallback.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15575>
2022-03-28 10:44:13 +00:00
Iago Toral Quiroga
ea3223e7a4 v3dv: implement VK_EXT_inline_uniform_block
Inline uniform blocks store their contents in pool memory rather
than a separate buffer, and are intended to provide a way in which
some platforms may provide more efficient access to the uniform
data, similar to push constants but with more flexible size
constraints.

We implement these in a similar way as push constants: for constant
access we copy the data in the uniform stream (using the new
QUNIFORM_UNIFORM_UBO_*) enums to identify the inline buffer from
which we need to copy and for indirect access we fallback to
regular UBO access.

Because at NIR level there is no distinction between inline and
regular UBOs and the compiler isn't aware of Vulkan descriptor
sets, we use the UBO index on UBO load intrinsics to identify
inline UBOs, just like we do for push constants. Particularly,
we reserve indices 1..MAX_INLINE_UNIFORM_BUFFERS for this,
however, unlike push constants, inline buffers are accessed
through descriptor sets, and therefore we need to make sure
they are located in the first slots of the UBO descriptor map.
This means we store them in the first MAX_INLINE_UNIFORM_BUFFERS
slots of the map, with regular UBOs always coming after these
slots.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15575>
2022-03-28 10:44:13 +00:00
Georg Lehmann
37c0f68500 radv: Add more RT pipeline stubs.
Entry points have to be provided even if the features are not supported.

Helps Doom Eternal.

Fixes: f1095260a4 ("radv: Experimentally enable RT extensions.")
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15573>
2022-03-28 10:25:42 +00:00
Georg Lehmann
b8c8e3d975 radv: Add a vkCmdBuildAccelerationStructuresIndirectKHR stub.
Since this entry point is provided by VK_KHR_acceleration_structure, radv has
to implement it even if it doesn't support the indirect build feature.

Helps Doom Eternal.

Fixes: 82de184c3a ("radv: Enable VK_KHR_acceleration_structure with RADV_PERFTEST=rt.")
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15573>
2022-03-28 10:25:42 +00:00
Rhys Perry
1ead285d92 aco: fix RA validation of 16-bit fma_mix operands
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15562>
2022-03-28 11:05:25 +01:00
Pierre-Eric Pelloux-Prayer
2bc933f7d5 glsl/nir/linker: fix shader_storage_blocks_write_access
shader_storage_blocks_write_access was computed using the buffer indices
in the program but ShaderStorageBlocksWriteAccess is used with the shader
buffers.

So if a VS had 3 SSBOs and a FS had 4, the mask for VS was 0x3 (correct) but
the mask for the FS was 0x78 instead of 0x15.

Fix this by substracting the index of the first shader buffer in the program's
buffers.

Fixes: 79127f8d5b ("glsl: set ShaderStorageBlocksWriteAccess in the nir linker")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6184
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15552>
2022-03-28 11:06:31 +02:00
Pierre-Eric Pelloux-Prayer
61ee560bc5 glsl/nir/linker: update shader_storage_blocks_write_access for SPIR-V
Most of the code inside the "!prog->data->spirv" blocks shouldn't be
executed for SPIR-V except the part updating the writable mask.

See https://gitlab.freedesktop.org/mesa/mesa/-/issues/6184

Cc: mesa-stable
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15552>
2022-03-28 10:37:45 +02:00
Daniel Schürmann
007cb02db9 aco: use branch definition as scratch register for SSA lowering
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15505>
2022-03-28 07:36:46 +00:00
Mike Blumenkrantz
ae710f3329 zink: use z24_in_z32f support and radv ci updates
This uses the new transfer helper codepath in zink and fixes a bunch of fail on radv.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15516>
2022-03-26 01:22:16 +00:00
Dave Airlie
24a6693ece u_transfer_helper: add a new option for handling z24 stored in z32
It might be possible to combine this with the other merge to avoid
the overheads of making a temp copy.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15516>
2022-03-26 01:22:15 +00:00
Dave Airlie
90a6947632 u_transfer: refactor out code to check interleave/deinterleave path.
The checks were reproduced making adding another one not so fun.

rework the deinterleave path code to match the interleave path code.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15516>
2022-03-26 01:22:15 +00:00
Dave Airlie
783cab811d util/format: add new z24/s8 packing helper to pack z32/s8.
If zink runs on top of a vulkan impl with no 24-bit float support
it needs support to pack into 24-bit for GL.

To avoid having to make a temp copy, add a new helper to convert
and pack.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15516>
2022-03-26 01:22:15 +00:00
Kenneth Graunke
823745dc27 intel/compiler: Use nir_opt_uniform_atomics()
In general, an atomic intrinsic may perform separate atomics for every
enabled SIMD channel, as each channel may operate on different memory.

However, an extremely common case is for all channels to access the same
memory location.  In this case, we can simply perform a reduction/scan
across the subgroup, and perform one atomic for the whole subgroup,
rather than one per channel.  For example, if an intrinsic says to take
the minimum value of the existing memory and the value in each channel,
we can do a thread-local minimum of all enabled channels, then do a
single atomic to take the minimum of that and the existing memory.

Our hardware doesn't optimize the case where multiple channels ask for
atomics on the same memory location; it assumes the compiler will do so.

nir_opt_uniform_atomics() uses divergence analysis to detect this case,
adds the necessary subgroup operations, and moves the atomic inside a
conditional that disables all but a single invocation.  It even detects
cases where the shader code already performs this kind of optimization,
and avoids doing it a second time.

This may not be the optimal solution for us.  In the backend, we could
detect this case and emit send(1) instructions with NoMask, rather than
generating if...send(16)...endif, and a lot of unnecessary ALU ops.  But
it's simple to do, reuses the same path as ACO, and still provides most
of the benefit by cutting up to 16x atomics down to a single atomic,
which is more merciful to the memory bus.

Improves performance of Shadow of the Tomb Raider by 5.5% on XeHP.

Improves performance of a customer-internal benchmark on XeHP at
3840x2160 and low settings by approximately 30%.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15484>
2022-03-26 00:28:19 +00:00
Kenneth Graunke
49ef23f4a6 intel/compiler: Convert to LCSSA and use divergence analysis.
We'll use this more shortly.  For now, enable it to separately in case
anything bisects to this.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15484>
2022-03-26 00:28:19 +00:00
Kenneth Graunke
b3942beecf intel/compiler: Set divergence analysis options
Although we don't use divergence analysis yet, we've had several
work-in-progress series that make use of it.  We may as well set
our options so that those series can assume they're in place.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15484>
2022-03-26 00:28:19 +00:00
Kenneth Graunke
6fa66ac228 intel/compiler: Implement nir_intrinsic_last_invocation
We haven't exposed this intrinsic as it doesn't directly correspond to
anything in SPIR-V.  However, it's used internally by some NIR passes,
namely nir_opt_uniform_atomics().

We reuse most of the infrastructure in brw_find_live_channel, but with
LZD/ADD instead of FBL.  A new SHADER_OPCODE_FIND_LAST_LIVE_CHANNEL is
like SHADER_OPCODE_FIND_LIVE_CHANNEL but from the other side.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15484>
2022-03-26 00:28:19 +00:00
Kenneth Graunke
af529b545a nir: Teach nir_divergence_analysis about Intel-specific intrinsics
- load_reloc_const is just an immediate constant load, it's convergent.

- nir_intrinsic_load_global_const_block_intel should be convergent,
  it says the address must be uniform, and we uniformize the predicate

- Lowered image intrinsics: image_deref_load_param_intel just reads
  information about an image, as long as the image variable is
  convergent it should be too.  load_raw_intel...if the address we
  come up with is convergent, it ought to be as well.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15484>
2022-03-26 00:28:19 +00:00
Mike Blumenkrantz
3e9bd67f23 zink: add another radv flake
literally no idea

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15589>
2022-03-26 00:06:47 +00:00
Caio Oliveira
c32d386ce2 intel/compiler: Inline TUE map computation into TUE Input lowering
Refactor since the TUE compute function is simpler now and the
comments make sense being near the lowering.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15022>
2022-03-25 23:29:19 +00:00
Caio Oliveira
c36ae42e4c intel/compiler: Use nir_var_mem_task_payload
Instead of reusing the in/out slot mechanism, use a separated NIR
variable mode.  This will make easier later to implement staging the
output in shared memory (and storing all at the end to the URB).

Note to get 64-bit type support we currently rely on the
brw_nir_lower_mem_access_bit_sizes() pass.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15022>
2022-03-25 23:29:19 +00:00
Daniel Schürmann
2d1e6b756e aco: remove 'high' parameter from can_use_opsel()
No fossil-db changes.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15551>
2022-03-25 22:02:50 +00:00
Daniel Schürmann
b98a9dcc36 aco/optimizer: fix call to can_use_opsel() in apply_insert()
The definition index is -1.

Fixes: 54292e99c7 ('aco: optimize 32-bit extracts and inserts using SDWA ')
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15551>
2022-03-25 22:02:50 +00:00
Adam Jackson
8006179cfd wsi/x11: xcb_wait_for_special_event failure is an error
The only ways that function can return NULL are:

- the xcb connection was closed
- the window for the swapchain was destroyed
- the special event listener was unregistered from another thread
- malloc failure

All of these are permanent errors, the swapchain is no longer in a
usable state, so we should treat this as VK_ERROR_SURFACE_LOST_KHR.

Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15558>
2022-03-25 19:31:13 +00:00
Alyssa Rosenzweig
f31208f778 pan/va: Lower BLEND to call blend shaders
Do this as late as possible.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
cb76cc1f1d pan/va: Add packing unit tests
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
18bf478f1e pan/va: Add shader-db support
Reports the common subset from Bifrost, as well as Mali offline compiler
style normalized cycle counts.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
8bc268f2d5 pan/va: Implement the cycle model
Will feed into shader-db reporting, and maybe other things eventually.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
8a258a685c pan/va: Test instruction selection lowerings
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
1745c89312 pan/va: Lower branch offsets
Logic is lifted from bi_layout.c, adapted to work on instructions (not
clauses) and for Valhall's off-by-one semantic which is annoyingly
different than Bifrost. (But the same as Midgard -- Bifrost was
annoyingly different than Midgard!)

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
9a9b20e652 pan/va: Add instruction selection lowering pass
Valhall removes certain instructions from Bifrost, requiring a canonical
lowering.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
b796d32564 pan/va: Add constant lowering pass
Valhall has a lookup table for common constants. Add a pass to take
advantage of it, lowering away immediate indices.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
b8f912e547 pan/va: Validate FAU before packing
These are pre-conditions required for packing.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
fd1906afea pan/va: Add FAU validation
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
676d9c9441 pan/va: Add unit tests for ADD_IMM optimizations
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
13d7ca1300 pan/va: Optimize add with imm to ADD_IMM
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
f45654af59 pan/va: Add packing routines
Mostly manual since Valhall is regular.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
edf284215d pan/va: Add helpers for swapping bitwise sources
Annoyingly different from Bifrost.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
619566dea1 pan/va: Generate header containing enums
We already collect enums in the ISA description XML. Export them for use in the
compiler backend, particularly the packing code.

Usually we'd use Mako for templating. In this case, the script is so trivial a
template engine didn't seem worth it. (The obvious version with Mako was about
10 lines longer than just prints and f-strings used here.)

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Suggested-by: Icecream95 <ixn@disroot.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
7ad98ae96e pan/va: Build opcode info structures
Filled out the new structures from XML.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
40ed485e32 pan/va: Permit encoding more flags
Missed the first time around.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
76487c7eb4 pan/va: Unify flow control
Group together dependency waits and flow control into a single enum. This
simplifies the code, clarifies some detail, and ensures consistency moving
forward.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
cf6d1a81f6 pan/va: Add Bifrost-style LD_VAR instructions
For use in the legacy non-MALLOC_IDVS flow. Especially useful in blit shaders.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
295b802f64 pan/va: Add LD_VAR_BUF instructions
Like LD_VAR_BUF_IMM but indirect.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
e8590e0d04 pan/va: Add ST_TILE instruction
Encoded like LD_TILE, required for some MSAA blend shaders.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
fa841273d4 pan/bi: Rename I->action to I->flow
For consistency with the Valhall ISA.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
f5585700be pan/bi: Model LD_VAR_BUF instructions
These are indirect versions of LD_VAR_BUF_IMM, taking their index in bytes. Used
for indirect varying loads (the NIR lowering is inefficient).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
97a13d6424 pan/bi: Augment ST_TILE with register format
To model its Valhall incarnation.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
c7f6b973b2 pan/bi: Check return addresses in blend shaders
Required on Valhall, where jumping to 0x0 doesn't automatically terminate the
program. Luckily the check is free there too.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
1b7d7ebbab pan/bi: Allow branch_offset on BLEND
Required to model BLEND accurately on Valhall, where it encodes a special
relative branch... Midgard style!

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
cfde0275e4 pan/bi: Model Valhall-style A(CMP)XCHG
Handled consistently with computational atomics.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
90867e8204 pan/bi: Add ATOM_RETURN pseudo-instruction
Allows modeling Valhall's atomics better.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
7983a0d0dc pan/bi: Rename PATOM_C to ATOM
This is basically what's native on Valhall. Use the Valhall naming for the
pseudo-instruction on Bifrost for consistency.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
b70a7c97bb pan/bi: Gate late DCE/CSE on "optimize"
Otherwise we can end up with unlowered ATOM.i32 on Valhall.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Alyssa Rosenzweig
3485b8dc78 pan/bi: Use consistent modifier lists in packing
If there are modifiers only used by pseudo instructions, not the real
instructions, bi_packer can get out-of-sync with bi_opcodes, causing
hard-to-debug issues. Do the stupid-simple thing to ensure this doesn't happen.

This may be a temporary issue, depending whether ISA.xml and the IR get split
out for better Valhall support.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
2022-03-25 19:00:13 +00:00
Emma Anholt
b1fa2068b8 nouveau/nir: Enable nir_opt_move/sink.
NIR load_consts/inputs tend to happen together at the top of the program.
In the TGSI backend the loads got emitted at use time, while the NIR
backend was emitting the loads at load intrinsic time.  By sinking the
intrinsics, we can greatly reduce register pressure.

nv92 NIR results:

total local in shared programs: 2024 -> 2020 (-0.20%)
local in affected programs: 4 -> 0
total gpr in shared programs: 790424 -> 735455 (-6.95%)
gpr in affected programs: 215968 -> 160999 (-25.45%)
total instructions in shared programs: 6058339 -> 6051208 (-0.12%)
instructions in affected programs: 410795 -> 403664 (-1.74%)
total bytes in shared programs: 41820104 -> 41660304 (-0.38%)
bytes in affected programs: 7147296 -> 6987496 (-2.24%)

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15542>
2022-03-25 18:34:39 +00:00
Rajnesh Kanwal
df1c7ca0e5 pvr: Use vk_common_GetDeviceQueue API.
Removes pvr_GetDeviceQueue implementation. As we are now
using the common vk_queue structure as a base for pvr_queue,
we can use vk_common_GetDeviceQueue implementation instead.

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/15574>
2022-03-25 18:07:08 +00:00
Boris Brezillon
a3bdad314e dzn: Compile-test the driver
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14766>
2022-03-25 16:21:45 +00:00
Erik Faye-Lund
a012b21964 microsoft: Initial vulkan-on-12 driver
This is Dozen, the Vulkan on DirectX 12 driver. Not to be confused with
DirectEggs.

This is an early prototype, and not meant to be upstreamed as-is.

Co-Authored-by: Boris Brezillon <boris.brezillon@collabora.com>
Co-Authored-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Co-Authored-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Co-Authored-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14766>
2022-03-25 16:21:45 +00:00
Enrico Galli
6635d011cb microsoft/spirv_to_dxil: Add missing ralloc_free
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14766>
2022-03-25 16:21:45 +00:00
Boris Brezillon
7e0ab29cfd vulkan/util: Make STACK_ARRAY() work for arrays of pointers
And add an explicit cast on the pointer returned by malloc() to
make C++ happy.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14766>
2022-03-25 16:21:45 +00:00
Boris Brezillon
bb1fb07ecd vulkan/image: Make MSVC C++ compiler happy
Fix 'error C4576: a parenthesized type followed by an initializer
list is a non-standard explicit type conversion syntax' errors by
declaring an actual variable and returning it in
vk_image_view_subresource_range().

All those MSVC/c++ related-constraints are quite annoying to be honest,
but it looks like the D3D12 headers have been updated to plain C
recently, which will allow us to write the driver in C, and hopefully
get all this sort of issues behind us.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14766>
2022-03-25 16:21:45 +00:00
Mike Blumenkrantz
0312ca0175 zink: add anv cts skips from waiver
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15578>
2022-03-25 10:42:52 -04:00
Mike Blumenkrantz
9cbe5ac82a zink: update radv fails
this should be the exact current baseline

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15576>
2022-03-25 08:58:15 -04:00
Rajnesh Kanwal
eacf944e52 pvr: Implement vkCreateSampler and vkDestroySampler APIs.
Implements vkCreateSampler and vkDestroySampler APIs.

Also fixes maxSamplerLodBias value from 15.0f to 16.0f
as it's the max supported by our hardware.

Also changing maxSamplerAnisotropy from 16.0f to 1.0f to
temporarily disable anisotropy as we are missing software
support for it.

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/15557>
2022-03-25 12:12:08 +00:00
Boris Brezillon
b000abbe7f vulkan/util: Get rid of VK_OUTARRAY_MAKE()
Get rid of VK_OUTARRAY_MAKE() so people don't get tempted to
use it and produce code that doesn't compile with MSVC, which
doesn't support typeof().

Suggested-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15522>
2022-03-25 11:00:03 +00:00
Boris Brezillon
5f309da5e4 vulkan/wsi: Stop using VK_OUTARRAY_MAKE()
We're trying to replace VK_OUTARRAY_MAKE() by VK_OUTARRAY_MAKE_TYPED()
so people don't get tempted to use it and make things incompatible with
MSVC (which doesn't support typeof()).

Suggested-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15522>
2022-03-25 11:00:03 +00:00
Boris Brezillon
52a2aa44f3 vulkan/device_select: Stop using VK_OUTARRAY_MAKE()
We're trying to replace VK_OUTARRAY_MAKE() by VK_OUTARRAY_MAKE_TYPED()
so people don't get tempted to use it and make things incompatible with
MSVC (which doesn't support typeof()).

Suggested-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15522>
2022-03-25 11:00:03 +00:00
Boris Brezillon
13efbdf830 venus: Stop using VK_OUTARRAY_MAKE()
We're trying to replace VK_OUTARRAY_MAKE() by VK_OUTARRAY_MAKE_TYPED()
so people don't get tempted to use it and make things incompatible with
MSVC (which doesn't support typeof()).

Suggested-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15522>
2022-03-25 11:00:03 +00:00
Boris Brezillon
face6f6ddc panvk: Stop using VK_OUTARRAY_MAKE()
We're trying to replace VK_OUTARRAY_MAKE() by VK_OUTARRAY_MAKE_TYPED()
so people don't get tempted to use it and make things incompatible with
MSVC (which doesn't support typeof()).

Suggested-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15522>
2022-03-25 11:00:03 +00:00
Boris Brezillon
49c8b93288 anv: Stop using VK_OUTARRAY_MAKE()
We're trying to replace VK_OUTARRAY_MAKE() by VK_OUTARRAY_MAKE_TYPED()
so people don't get tempted to use it and make things incompatible with
MSVC (which doesn't support typeof()).

Suggested-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15522>
2022-03-25 11:00:03 +00:00
Boris Brezillon
81ba3ab5d9 pvr: Stop using VK_OUTARRAY_MAKE()
We're trying to replace VK_OUTARRAY_MAKE() by VK_OUTARRAY_MAKE_TYPED()
so people don't get tempted to use it and make things incompatible with
MSVC (which doesn't support typeof()).

Suggested-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15522>
2022-03-25 11:00:02 +00:00
Boris Brezillon
799a9db24c turnip: Stop using VK_OUTARRAY_MAKE()
We're trying to replace VK_OUTARRAY_MAKE() by VK_OUTARRAY_MAKE_TYPED()
so people don't get tempted to use it and make things incompatible with
MSVC (which doesn't support typeof()).

Suggested-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15522>
2022-03-25 11:00:02 +00:00
Boris Brezillon
56a2ccf058 v3dv: Stop using VK_OUTARRAY_MAKE()
We're trying to replace VK_OUTARRAY_MAKE() by VK_OUTARRAY_MAKE_TYPED()
so people don't get tempted to use it and make things incompatible with
MSVC (which doesn't support typeof()).

Suggested-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15522>
2022-03-25 11:00:02 +00:00
Caio Oliveira
f82731d0d7 intel/fs: Fix IsHelperInvocation for the case no discard/demote are used
Use emit_predicate_on_sample_mask() helper that does check where to
get the correct mask depending on whether discard/demote was used or
not.

Fixes: 45f5db5a84 ("intel/fs: Implement "demote to helper invocation"")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15400>
2022-03-25 08:20:27 +00:00
Caio Oliveira
bb311c22df intel/fs: Initialize the sample mask in flags register when using demote
Without this change, a check for "is helper invocation" could read
uninitialized values.

Fixes: 45f5db5a84 ("intel/fs: Implement "demote to helper invocation"")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15400>
2022-03-25 08:20:27 +00:00
Christian Gmeiner
2648ccb341 nir: Use const for nir_shader_get_entrypoint(..)
nir_shader_get_entrypoint(..) should not modify the passed nir_shader
object. Enforce this by marking shader paramenter as const.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15362>
2022-03-25 07:25:37 +00:00
Mike Blumenkrantz
eaf3c72a83 mesa/st: add special casing for pointsize constant updating during validate
the previous method of using affected_states to trigger constant updates
was ineffectual in the scenario where a ubo pointsize was needed on
the first time a non-precompiled shader was used after being the not-last
vertex stage:

* have vs+gs -> gs precompiles with pointsize lowering -> gs constants get updated
* remove gs -> vs was precompiled without pointsize lowering -> vs constants broken

now just do a quick check as in st_atom_shader.c and set the flag manually to
ensure the update is done correctly every time

cc: mesa-stable

fixes #6207

fixes (radv):
KHR-GL46.texture_cube_map_array.image_op_fragment_sh
KHR-GL46.texture_cube_map_array.sampling
KHR-GL46.texture_cube_map_array.texture_size_fragment_sh
KHR-GL46.constant_expressions*

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15570>
2022-03-25 04:03:23 +00:00
Mike Blumenkrantz
6fb0bf51a3 zink: update anv icl ci list
praise be to dynamic state fixes!

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15569>
2022-03-25 03:31:42 +00:00
Mike Blumenkrantz
6980eb4be2 zink: flush clears before toggling color write
ensure these sync up onto the expected buffers

Fixes: 3892c13381 ("zink: add an alternate path for EXT_color_write_enable usage")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15568>
2022-03-25 03:09:26 +00:00
Mike Blumenkrantz
4c6931fca9 zink: fix up color_write_enable workaround
this needs to only swizzle to dummy surfaces if it's the workaround,
not just if color_write_enable is active

Fixes: 3892c13381 ("zink: add an alternate path for EXT_color_write_enable usage")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15568>
2022-03-25 03:09:26 +00:00
Rob Clark
c0f52f08a1 freedreno/ci: Update a306 expectations
These have started to flakey UnexpectedPass somewhere along the way.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14900>
2022-03-25 02:03:30 +00:00
Rob Clark
03a70f554a pipe-loader: Try loading freedreno for virtgpu device
Freedreno will check if the virtgpu supports the pass-thru context, and
if not will bail, falling back to virgl.

TODO this requires that virgl is also enabled in the mesa build, even if
it is not needed.. maybe there is a better way to handle this?

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14900>
2022-03-25 02:03:30 +00:00
Rob Clark
802f4da5ee freedreno/drm: Add virtio backend
Add a new backend to enable using native driver in a VM guest, via a new
virtgpu context type which (indirectly) makes host kernel interface
available in guest and handles the details of mapping buffers to guest,
etc.

Note that fence-fd's are currently a bit awkward, in that they get
signaled by the guest kernel driver (drm/virtio) once virglrenderer in
the host has processed the execbuf, not when host kernel has signaled
the submit fence.  For passing buffers to the host (virtio-wl) the egl
context in virglrenderer is used to create a fence on the host side.
But use of out-fence-fd's in guest could have slightly unexpected
results.  For this reason we limit all submitqueues to default priority
(so they cannot be preepmted by host egl context).  AFAICT virgl and
venus have a similar problem, which will eventually be solveable once we
have RESOURCE_CREATE_SYNC.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14900>
2022-03-25 02:03:30 +00:00
Rob Clark
2200d674e4 freedreno/drm: Reorder device destroy
Call backend specific cleanup fxn earlier.  This is needed if the
backend has things like bo's to delete, otherwise the handle_table
will already be destroyed causing problems in bo_del()

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14900>
2022-03-25 02:03:30 +00:00
Rob Clark
ea339137b0 freedreno/drm: Extract out "softpin" submit/ringbuffer base class
We are going to want basically the identical thing, other than
flush_submit_list, for virtio backend.  Now that we've moved various
other dependencies into the base classes, extract out an abstract base
class for submit/ringbuffer.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14900>
2022-03-25 02:03:30 +00:00
Rob Clark
72a427244f freedreno/drm: Move ring_pool slab parent to base
Prep to move most of sp submit/ringbuffer to something that can be
re-used by virtio backend.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14900>
2022-03-25 02:03:30 +00:00
Rob Clark
877f9049c3 freedreno/drm: Move bo idx to base
The virtio backend will want this too, and it will make it easier to
share most of the submit/ringbuffer implementation with the virtio
backend.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14900>
2022-03-25 02:03:30 +00:00
Rob Clark
2ac9b23f78 freedreno/drm: Move submit_queue to base
The virtio backend will want this too.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14900>
2022-03-25 02:03:30 +00:00
Rob Clark
88a10c6216 freedreno/drm: Avoid CPU_PREP ioctl if bo is idle
With userspace fences, if we know definitely that the buffer is idle
(which implies that it is not shared with other processes, etc), then
skip the ioctl.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14900>
2022-03-25 02:03:30 +00:00
Rob Clark
9bcc983256 freedreno/drm: Add fd_bo_upload()
There are some buffers that we mmap just to write to them a single time.
Add the possibility of the drm backend to provide an alternate upload
path to avoid these mmap's.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14900>
2022-03-25 02:03:30 +00:00
Rob Clark
115518ec35 freedreno/drm: Add FD_BO_SHARED hint
With the virtio backend we will need to pass an extra flag when
allocating buffers that will be shared cross-device (such as with
virtio-wl for passing between host and guest)

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14900>
2022-03-25 02:03:30 +00:00
Rob Clark
f846181fe5 freedreno/drm: Add FD_BO_NOMAP hint
Add a hint for buffers that we won't need to mmap.  With the virtio
backend, virglrenderer needs to create a dmabuf fd for mapping into
the host, which we want to avoid when possible.

Low hanging fruit is to use this hint for anything tiled/ubwc.  There
are probably more bo's that can be flagged as such.

TODO add fd_bo_upload() for memcpy to bo.. this would be useful for
uploads, for example, shaders which we just write once and never touch
again.. for virtio this could be implemented with a TRANSFER_TO_HOST
ioctl.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14900>
2022-03-25 02:03:30 +00:00
Rob Clark
598405c91f freedreno/drm: Rework bo creation path
Decoupling handle and fd_bo creation simplifies things for "normal" drm
drivers, avoiding duplication for the create vs import paths.  But this
is awkward for the virtio backend when wants to do multiple things in
the same guest<->host round trip.

So instead, split the paths in the interface backend and move the code
sharing for the two different paths into the msm backend itself.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14900>
2022-03-25 02:03:30 +00:00
Rob Clark
9ea36968d3 freedreno/drm: Add fd_device_open() helper
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14900>
2022-03-25 02:03:30 +00:00
Rob Clark
2bc815878c freedreno/drm: Split msm backend into subdir
Let's keep things a bit better organized when we add a new backend.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14900>
2022-03-25 02:03:30 +00:00
Mike Blumenkrantz
5a58493baa zink: update radv ci
bunch of these I just removed by mistake

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15567>
2022-03-24 21:05:35 -04:00
Yiwei Zhang
e542981727 venus: update protocol to remove redundant decoders
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15537>
2022-03-25 00:33:56 +00:00
Renato Pereyra
737937f45e venus: Increase the base sleep of vn_relax
Based on profiling, these 10us sleeps are behaving closer to ~60us
and causing higher-than-necessary CPU overhead. 120us seems like a
good balance between latency management and overhead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15565>
2022-03-25 00:16:39 +00:00
Jason Ekstrand
8068c68b1f lavapipe: Delete render passes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15431>
2022-03-24 18:37:14 -05:00
Yonggang Luo
a315039917 c11: 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/15553>
2022-03-24 21:56:48 +00:00
Yonggang Luo
0f1b3fc17f util: Fixes unused parameter warnings
The compiler warning:
```
../src/mesa/util/u_thread.h: In function 'util_thread_get_time_nano':
../src/mesa/util/u_thread.h:239:34: warning: unused parameter 'thread' [-Wunused-parameter]
  239 | util_thread_get_time_nano(thrd_t thread)
      |                           ~~~~~~~^~~~~~
```

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/15553>
2022-03-24 21:56:48 +00:00
Dave Airlie
81afd1e118 zink: update resource layout in copy_scanout
This transitions the resource to TRANSFER_SRC_OPTIMAL, but
never updates the res->layout field, so subsequent transitions
are wrong and throw validation errors.

UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout(ERROR / SPEC): msgNum: 1303270965 - Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout ] Object 0: handle = 0x6660f60, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x4dae5635 | vkQueueSubmit(): pSubmits[0].pCommandBuffers[0] command buffer VkCommandBuffer 0x6660f60[] expects VkImage 0x2f000000002f[] (subresource: aspectMask 0x1 array layer 0, mip level 0) to be in layout VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL--instead, current layout is VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15545>
2022-03-24 21:42:43 +00:00
Jason Ekstrand
6646624fb9 lavapipe: Use vk_image_subresource_layer/level_count
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15535>
2022-03-24 21:21:10 +00:00
Jason Ekstrand
8c1bd1f9a2 lavapipe: Use vk_image_view
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15535>
2022-03-24 21:21:10 +00:00
Jason Ekstrand
e500faebc2 vulkan: Add a vk_image_view_subresource_range helper
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15535>
2022-03-24 21:21:10 +00:00
Boris Brezillon
5b12a498f5 vulkan/runtime: Add vk_cmd_queue.h to idep_vulkan_runtime_headers
If we don't do that, meson might start compiling source files
including vk_command_buffer.h which in turn includes vk_cmd_queue.h
before this file is even generated, and we end up with errors like
that https://gitlab.freedesktop.org/mesa/mesa/-/jobs/20157936#L1119.

Fixes: 6bd8a3c7e4 ("vulkan/runtime: Add a vk_cmd_queue object to vk_command_buffer")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15546>
2022-03-24 19:43:02 +00:00
Igor Torrente
5d33068cd9 venus: add VK_EXT_extended_dynamic_state2 extension
Implements all the necessary code in the device initialization
and extension functions.

Signed-off-by: Igor Torrente <igor.torrente@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15428>
2022-03-24 17:35:43 +00:00
Matt Coster
c80fa97d18 pvr: ci: Initial freedesktop CI integration
This patch adds the PowerVR driver to the following shared builds:

 * debian-arm64
 * debian-clang
 * debian-release
 * debian-vulkan
 * fedora-release

It also adds the associated "tools" to these builds:

 * debian-arm64-build-test
 * debian-release (already uses -Dtools=all)
 * fedora-release

And removes them from these builds by expanding -Dtools=all:

 * debian-gallium

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15284>
2022-03-24 11:39:40 +00:00
Matt Coster
97c4ce44e9 pvr: Gate offline compiler build behind -Dtools=imagination
This matches the behavior of e.g. panfrost's bifrost_compiler target.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15284>
2022-03-24 11:39:39 +00:00
Erik Faye-Lund
3b6ceea3e6 pvr: do not use fallthrough for unreachable code
unreachable() doesn't lead to executing the code that follows it,
neither in debug nor release builds. So falling through doesn't make any
sense.

This fixes a compile-error on clang.

Let's move the default-block to the end to make it clearer that there's
no intended fallthrough.

Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15531>
2022-03-24 11:25:45 +00:00
Erik Faye-Lund
54c7a245ca pvr: do not use fallthrough for unreachable code
unreachable() doesn't lead to executing the code that follows it,
neither in debug nor release builds. So falling through doesn't make any
sense.

This fixes a compile-error on clang.

Let's move the default-block to the end to make it clearer that there's
no intended fallthrough.

Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15531>
2022-03-24 11:25:45 +00:00
Lionel Landwerlin
8cdd5647c6 anv: don't store sample location sample count
This information should match the current pipeline sample count.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15310>
2022-03-24 10:49:07 +00:00
Lionel Landwerlin
6f5f817c0f anv: fix dynamic sample locations on Gen7/7.5
3DSTATE_MULTISAMPLE should be baked into the pipeline if not dynamic.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 27ee40f4c9 ("anv: Add support for sample locations")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15310>
2022-03-24 10:49:07 +00:00
Lionel Landwerlin
8ad78671b3 anv: use local dynamic pointer more
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15310>
2022-03-24 10:49:07 +00:00
Lionel Landwerlin
1d250b7b95 anv: fix color write enable interaction with color mask
Color writes & color masks occupy the same fields in the BLEND_STATE
structure. So we need to store color mask (which are not dynamic) on
the pipeline to merge that information with color writes.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: b15bfe92f7 ("anv: implement VK_EXT_color_write_enable")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6111
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15310>
2022-03-24 10:49:07 +00:00
Lionel Landwerlin
a4f502de32 anv: fix VK_DYNAMIC_STATE_COLOR_WRITE_ENABLE_EXT state
First, there is a problem if you do the following

 vkCmdSetColorWriteEnableEXT(attachmentCount = 8)
 vkCmdBindPipeline(GFX, with attachmentCount = 4)
 vkCmdDraw()
 vkCmdBindPipeline(GFX, with attachmentCount = 8)
 vkCmdDraw()

Because in the dynamic state emission code we rely on the first
pipeline to figure the number of BLEND_STATE entries to prepare. This
is wrong, we should fill all entries so that the dynamic state works
regardless of the number of attachments in the pipeline. With regard
to the dynamic values, we should retain enable/disable values that do
not concern the current pipeline.

Second, 3DSTATE_WM was not always reemitted when the pipeline changed.
But since it is not emitted as part of the pipeline, this results in
inconsistent state being programmed.

Third, we end up disabling the fragment stage completely in some
cases. And that is programming the pipeline inconsistently and
triggering a hang on TGL.

v2: Fix comment (Tapani)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: b15bfe92f7 ("anv: implement VK_EXT_color_write_enable")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15310>
2022-03-24 10:49:07 +00:00
Lionel Landwerlin
f348103fce anv: fix dynamic state emission
The problem is that we missed looking at pipeline changes. Pipelines
hold bits of dynamic states and when it changes we might need to
reemit a packet.

v2: fix comment (Tapani)
    Add missing anv_cmd_buffer_needs_dynamic_state() use (Tapani)

Cc: mesa-stable
Fixes: 505d176a8e ("anv: disable baked in pipeline bits from dynamic emission path")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15310>
2022-03-24 10:49:07 +00:00
Lionel Landwerlin
1cd7d6ce37 anv: allow baking of 3DSTATE_DEPTH_BOUNDS in pipeline batch
If it's not dynamic.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15310>
2022-03-24 10:49:07 +00:00
Erik Faye-Lund
85c59cafd8 docs: add a minimal docs page for radv
RADV is the last driver in Mesa that doesn't have a webpage somewhere
that we can link to from mesa3d.org. So let's make a minimal docs article
for it where we link to relevant information elsewhere.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15494>
2022-03-24 10:08:45 +00:00
Corentin Noël
2aa8e56e52 virgl: Update virgl_protocol and use the provided constants
Allow for better readability of the code.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14473>
2022-03-24 10:50:21 +01:00
Boris Brezillon
04d812b2d0 Revert "ci: Disable windows-vs2019"
This reverts commit 04b80489d5.

Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15518>
2022-03-24 09:11:13 +00:00
Boris Brezillon
aa0c543533 lavapipe: Don't use VK_OUTARRAY_MAKE()/vk_outarray_append()
MSVC doesn't support typeof(). If we want to keep compiling radv on
windows we need to use the typed variants of those macros.

Fixes: dc8fdab71e ("lavapipe: Use VK_OUTARRAY for GetPhysicalDeviceQueueFamilyProperties[2]")
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15518>
2022-03-24 09:11:13 +00:00
Boris Brezillon
eb1d009a3e radv: Don't use VK_OUTARRAY_MAKE()/vk_outarray_append()
MSVC doesn't support typeof(). If we want to keep compiling radv on
windows we need to use the typed variants of those macros.

Fixes: 10d69d5f0b ("radv: fix returning empty drmFormatModifierTilingFeatures")
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15518>
2022-03-24 09:11:13 +00:00
Boris Brezillon
2daae1fab4 amd: Fix ac_gpu_info.c compilation on windows
Fixes: 75a783ea73 ("ac: Query the amdgpu MEC firmware version.")
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15518>
2022-03-24 09:11:13 +00:00
Boris Brezillon
de039537da aco: Fix an MSVC warning
'warning C4804: '<<': unsafe use of type 'bool' in operation'

Fixes: 9934c86761 ("aco: use v_fma_mix to combine mul/add/fma input conversions")
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15518>
2022-03-24 09:11:13 +00:00
Cristian Ciocaltea
f392960331 virgl/ci: Add support for dEQP GL vtest-ing
Provide the 'virpipe-on-gl' job for running dEQP GL tests on
virpipe/vtest.

The rationale is to help reducing the regressions in Virglrenderer CI
due to sharing the Mesa CI infrastructure.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Acked-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15490>
2022-03-24 08:39:06 +00:00
Tomeu Vizoso
9f43dac0ca ci/freedreno: Increase console timeout for perf jobs
Piglit is very sparse in its status output and downloads of big traces
can take a while.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15527>
2022-03-24 05:33:54 +00:00
Tomeu Vizoso
22d45f99ff ci/iris: Increase console timeout for perf jobs
Piglit is very sparse in its status output and downloads of big traces
can take a while.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15527>
2022-03-24 05:33:54 +00:00
Lionel Landwerlin
a55cc061fd iris: don't synchronize BO for batch decoding
We don't need to go to the kernel to synchronize the BO we want to
decode with INTEL_DEBUG=bat, mostly because we'll decode what was
written by the driver in the batch.

This also works around an issue in the simulation environment.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 9ac81f1890 ("iris: decoder fixes")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15517>
2022-03-24 04:59:44 +00:00
Jason Ekstrand
729f95a110 i915: Use the sin/cos lowering in nir_opt_algebraic.py
It's nearly identical.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15539>
2022-03-24 00:59:21 +00:00
Tomeu Vizoso
d0e99e566f ci/freedreno: Update checksum for GolfWithYourFriends trace
The MR below changed the rendering slightly and the checksum isn't valid
any more:

"ir3, turnip, freedreno: Shader preambles"

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

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15526>
2022-03-24 00:04:20 +00:00
Mike Blumenkrantz
1e45254b97 zink: lower txp for array textures
this is also illegal according to spirv spec

fixes #6177

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15510>
2022-03-23 23:18:48 +00:00
Mike Blumenkrantz
7143a5a147 zink: lower txp for cube and ms textures
this is illegal according to spirv spec

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15510>
2022-03-23 23:18:48 +00:00
Mike Blumenkrantz
4e35ed8c67 nir/lower_tex: add txp lowering option for arrays
this is illegal in vulkan, so zink needs to be able to lower these

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15510>
2022-03-23 23:18:47 +00:00
Yonggang Luo
821c141f9d gallium: Remove unused macro PIPE_ARCH_SSSE3
After removal inline function `_mm_shuffle_epi8`, the
macro `PIPE_ARCH_SSSE3` have no need anymore, remove it too.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14077>
2022-03-23 21:44:04 +00:00
Yonggang Luo
55a5635fb2 llvmpipe: Revise u_sse.h to remove unused _mm_shuffle_epi8 inline function
error log:
```
[2/43] Compiling C object src/gallium/drivers/llvmpipe/libllvmpipe.a.p/lp_setup_tri.c.obj
FAILED: src/gallium/drivers/llvmpipe/libllvmpipe.a.p/lp_setup_tri.c.obj
"cc" "-Isrc/gallium/drivers/llvmpipe/libllvmpipe.a.p" "-Isrc/gallium/drivers/llvmpipe" "-I../../src/gallium/drivers/llvmpipe" "-I../../src/gallium/include" "-Isrc/gallium/auxiliary" "-I../../src/gallium/auxiliary" "-Iinclude" "-I../../include" "-Isrc" "-I../../src" "-Isrc/compiler/nir" "-I../../src/compiler/nir" "-Isrc/util" "-I../../src/util" "-IC:/CI-Tools/msys64/clang64/include" "-fvisibility=hidden" "-fcolor-diagnostics" "-Wall" "-Winvalid-pch" "-std=c11" "-O0" "-g" "-DPACKAGE_VERSION=\"22.0.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" "-DDEBUG" "-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_STRTOK_R" "-DHAVE_QSORT_S" "-DHAVE_ZLIB" "-DHAVE_ZSTD" "-DHAVE_COMPRESSION" "-DLLVM_AVAILABLE" "-DMESA_LLVM_VERSION_STRING=\"13.0.0\"" "-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" "-D_FILE_OFFSET_BITS=64" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-Werror=pointer-arith" "-Werror=gnu-empty-initializer" -MD -MQ src/gallium/drivers/llvmpipe/libllvmpipe.a.p/lp_setup_tri.c.obj -MF "src/gallium/drivers/llvmpipe/libllvmpipe.a.p/lp_setup_tri.c.obj.d" -o src/gallium/drivers/llvmpipe/libllvmpipe.a.p/lp_setup_tri.c.obj "-c" ../../src/gallium/drivers/llvmpipe/lp_setup_tri.c
In file included from ../../src/gallium/drivers/llvmpipe/lp_setup_tri.c:37:
In file included from ../../src/gallium/drivers/llvmpipe/lp_setup_context.h:38:
In file included from ../../src/gallium/drivers/llvmpipe/lp_setup.h:31:
In file included from ../../src/gallium/drivers/llvmpipe/lp_jit.h:40:
In file included from ../../src/gallium/auxiliary/gallivm/lp_bld_limits.h:37:
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:
In file included from ../../include/c11/threads_win32.h:58:
In file included from C:/CI-Tools/msys64/clang64/x86_64-w64-mingw32/include/windows.h:69:
In file included from C:/CI-Tools/msys64/clang64/x86_64-w64-mingw32/include/windef.h:9:
In file included from C:/CI-Tools/msys64/clang64/x86_64-w64-mingw32/include/minwindef.h:163:
In file included from C:/CI-Tools/msys64/clang64/x86_64-w64-mingw32/include/winnt.h:1555:
In file included from C:/CI-Tools/msys64/clang64/lib/clang/13.0.0/include/x86intrin.h:15:
In file included from C:/CI-Tools/msys64/clang64/lib/clang/13.0.0/include/immintrin.h:37:
C:/CI-Tools/msys64/clang64/lib/clang/13.0.0/include/tmmintrin.h:582:1: error: redefinition of '_mm_shuffle_epi8'
_mm_shuffle_epi8(__m128i __a, __m128i __b)
^
../../src/gallium/auxiliary/util/u_sse.h:159:1: note: previous definition is here
_mm_shuffle_epi8(__m128i a, __m128i mask)
^
1 error generated.

```

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14077>
2022-03-23 21:44:04 +00:00
Georg Lehmann
81b2008af9 nir/legalize_16bit_sampler_srcs: Don't guess source type.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14895>
2022-03-23 20:55:39 +00:00
Georg Lehmann
b5fe1187ec nir/fold_16bit_sampler_conversions: Fix src type mismatches.
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5996
Fixes: fb29cef8 ("nir: add many passes that lower and optimize 16-bit input/outputs and samplers")
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14895>
2022-03-23 20:55:39 +00:00
Georg Lehmann
88ec73e5e8 nir/fold_16bit_sampler_conversions: Fix dest type mismatches.
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5996
Fixes: fb29cef8dd ("nir: add many passes that lower and optimize 16-bit input/outputs and samplers")
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14895>
2022-03-23 20:55:39 +00:00
Georg Lehmann
798e47be51 nir/fold_16bit_sampler_conversions: Don't fold dest upcasts.
This is not a valid optimization.

Fixes: fb29cef8dd ("nir: add many passes that lower and optimize 16-bit input/outputs and samplers")
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14895>
2022-03-23 20:55:39 +00:00
Cristian Ciocaltea
18111c3787 Revert "ci: Convert generate-env.sh to a POSIX compliant script"
This reverts commit 9904ea2c76 since it is
not able to properly escape all special characters (i.e. [']).

The POSIX conversion is not needed anymore, as we have made 'bash'
available in LAVA rootfs.

Reported-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15524>
2022-03-23 20:31:06 +00:00
Cristian Ciocaltea
315842e27c ci: Make bash available in LAVA rootfs
Ensure 'bash' shell interpreter is available in LAVA rootfs since it is
going to be a dependency requirement from several scripts, e.g.
generate-env.sh.

Suggested-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15524>
2022-03-23 20:31:06 +00:00
Kai Wasserbäch
a5884df949 fix(clover): FTBFS: Added missing include for ConstantInt for LLVM 15
With LLVM 15 the include of llvm/IR/Constants.h is required for
ConstantInt.

This commit fixes an FTBFS.

Cc: mesa-stable
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15232>
2022-03-23 20:08:13 +00:00
Erik Faye-Lund
36d38b4386 docs: fixup breakage in release-calendar
Seems the branch was accidentally changed to no longer match the
release. Let's fix that.

Fixes: 9ba636cdc7 ("docs: update calendar and link releases notes for 21.3.8")
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15528>
2022-03-23 20:01:44 +00:00
Mark Janes
85e314db5d Revert "intel/fs: handle interpolation modes for at_sample and at_offset too"
This reverts commit 5afbb0e730.

Closes: #6198
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15534>
2022-03-23 11:03:47 -07:00
Erik Faye-Lund
80a2974826 pvr: zero-initialize variable
Because of incomplete codepaths further down in this function, we end up
trying to use this variable without initialization. Let's initialize it
to zero, just to keep the compiler happy.

This avoids a compile-time warning, which would get treated as an error
on CI.

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15525>
2022-03-23 16:49:14 +00:00
Erik Faye-Lund
fd7203ce80 pvr: use a helper to translate stencil-ops
This gives us a single place to handle the conversion, and fixes a
compilation warning by adding an explicit cast.

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15525>
2022-03-23 16:49:14 +00:00
Erik Faye-Lund
cc171840ff pvr: use a helper to translate compare-ops
This gives us a single place to handle the conversion, and fixes a
compilation warning by adding an explicit cast.

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15525>
2022-03-23 16:49:14 +00:00
Erik Faye-Lund
f7e92c8869 microsoft/compiler: remove phi-value limit
There's no guarantee that we don't have more than 128 PHI values either,
so let's stop asuming so.

We do this by changing dxil_phi_set_incoming to dxil_phi_add_incoming,
which lets us add more incoming phi-values to the current one instead of
setting a new set of them.

This also lets us reduce these stack-arrays a bit, down to something
much more reasonable.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15519>
2022-03-23 16:33:21 +00:00
Erik Faye-Lund
d752c4bc7c microsoft/compiler: ralloc incoming phi-values
Reserving 127 incoming values for every phi instruction is neither
robust nor memory efficient.

Let's ralloc this array instead when filling it. This way, we only pay
for what we use here.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15519>
2022-03-23 16:33:21 +00:00
Alyssa Rosenzweig
d8b5d45dc1 pan/va: Add atomic instructions
Equivalent to their Bifrost counterparts, with a much more sensible encoding.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15515>
2022-03-23 15:50:41 +00:00
Alyssa Rosenzweig
0ac9841809 pan/va: Allow omitting staging registers
It's not usually valid, but sr_count == 0 is encodable and used for the
non-RETURN variant of ATOM1. Allow dis/assembling this syntax.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15515>
2022-03-23 15:50:41 +00:00
Alyssa Rosenzweig
e6ca668d45 pan/va: Allow forcing staging flags to read-write
Required for the correct encoding of atomics.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15515>
2022-03-23 15:50:41 +00:00
Daniel Schürmann
832d67e99d nir: rename nir_src_is_dynamically_uniform to nir_src_is_always_uniform
As this function doesn't check for any control-flow
dependence, it only returns true for statically
(or globally) uniform values.
The same holds true for is_binding_dynamically_uniform()
in nir_opt_gcm().
Rename to better reflect that property.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14994>
2022-03-23 14:02:08 +00:00
Erik Faye-Lund
a9eddf9edc pvr: fixup typos when allocating object
These objects should have been allocated with
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT as the last argument, not the specific
object type.

Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15521>
2022-03-23 14:17:34 +01:00
Erik Faye-Lund
abf995b1da pvr: use zloadformat instead of zstoreformat
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15521>
2022-03-23 14:17:34 +01:00
Thomas H.P. Andersen
8138086889 pvr: fix overlapping comparison
The comparison here will always be true. This changes it so
height is only set if the type is not a 1D.

Fixes a warning with clang

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15514>
2022-03-23 13:04:38 +00:00
Lionel Landwerlin
df059c6781 intel/clc: deal with SPIRV-Tools linker new behavior
We're now required to provide all modules to link at the same SPIRV
version.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15486>
2022-03-23 10:24:31 +00:00
Lionel Landwerlin
21aa1d3de1 intel/clc: fixup shared memory offsets
We're running the io lowering twice so need to reset some fields so
the offset don't go over what is really needed.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15486>
2022-03-23 10:24:31 +00:00
Lionel Landwerlin
de9c2312ea intel/clc: compile fix
Fixes: c15bf88f01 ("intel: Add a little OpenCL C compiler binary")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15486>
2022-03-23 10:24:31 +00:00
Lionel Landwerlin
a7f264f33a intel/clc: add option to printout kernel prog_data
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15486>
2022-03-23 10:24:31 +00:00
Lionel Landwerlin
451f907d16 intel/kernel: enable linkage cap
Linkage should have happened before this in intel_clc. This just
silence a parser warning.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15486>
2022-03-23 10:24:31 +00:00
Lionel Landwerlin
bb4ff3e6e2 intel/kernel: enable groups caps
This is roughly the same as SpvCapabilityGroupNonUniform
(subgroup_basic).

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15486>
2022-03-23 10:24:31 +00:00
Lionel Landwerlin
218db59b25 intel/dev: default to B stepping on DG2 for offline compiler
Most people won't have A0 stepping now.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15486>
2022-03-23 10:24:31 +00:00
Jason Ekstrand
4b2c78c08a spirv: Implement the function portion of the Linkage capability
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15486>
2022-03-23 10:24:31 +00:00
Jason Ekstrand
80a076382d nir: Allow nir_var_mem_global variables
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15486>
2022-03-23 10:24:31 +00:00
Lionel Landwerlin
dc8c77cc8f anv: implement EXT_tooling_info
This is required by 1.3. Fixes CTS with newer loader :

   dEQP-VK.api.tooling_info.validate_getter

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: df8ac77af8 ("anv: Advertise Vulkan 1.3")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15491>
2022-03-23 09:51:57 +00:00
Lionel Landwerlin
3889dda1f1 vulkan: move EXT_tooling_info implementation to runtime
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15491>
2022-03-23 09:51:57 +00:00
Erik Faye-Lund
d5ed8d4126 gallium: rename image atomic inc-wrap cap
This cap is no longer TGSI specific, so let's rename it to reflect
reality.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15448>
2022-03-23 08:54:06 +00:00
Erik Faye-Lund
880d848b7d gallium: rename image atomic float-add cap
This cap is no longer TGSI specific, so let's rename it to reflect
reality.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15448>
2022-03-23 08:54:06 +00:00
Erik Faye-Lund
ab26020017 gallium: rename window-space position cap
This cap is no longer TGSI specific, so let's rename it to reflect
reality.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15448>
2022-03-23 08:54:06 +00:00
Mike Blumenkrantz
36373e8e1e draw: fix nonzero stream primitives generated queries
the fastpath here can only be taken if there is exactly one stream active,
as this will otherwise break nonzero stream primitives generated queries

in truth, this num_vertex_streams thing should be a bitmask so that the case
of num_streams=1,stream_id!=0 could also be fastpathed, but the complexity
probably isn't worth it given the infrequency of use

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15506>
2022-03-23 04:08:14 +00:00
Mike Blumenkrantz
32f117f5f8 draw: fix gs vertex stream counting
this can't be determined from pipe_shader_state::stream_output,
as this only contains xfb info, which is not the same as the vertex
stream info, and may break primitives generated queries

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15506>
2022-03-23 04:08:14 +00:00
Brian Paul
03d342e4b2 vulkan/wsi/x11: add null pointer check for the has_dri3_v1_2 test
This fixes a crash (ver_reply is NULL) when DISPLAY points to
a remote display.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6040
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15469>
2022-03-23 03:19:40 +00:00
Kai Wasserbäch
948ad5ac23 fix(FTBFS): clover: work around removal of PointerType::getElementType()
`PointerType::getElementType()` was deprected and is gone now [0]. The
*temporary* workaround is using `Type::getPointerElementType()`,
longterm this needs to use [1].

This commit fixes an FTBFS.

[0] <d593cf7945>
[1] <https://llvm.org/docs/OpaquePointers.html>

Closes: #6042
Cc: mesa-stable
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15091>
2022-03-23 00:50:27 +00:00
Dave Airlie
3bbd404457 gallivm/sample: detect if rho is inf or nan and flush to zero.
When using cubemaps and the u/v values are 0, then this point
can be arrived at with rho = nan, and if rho is NaN, then lod
calculations end up at the max lod, whereas the spec suggests
they should end up at the most negative lod.

This fixes
dEQP-VK.glsl.texture_functions.query.texturequerylod.samplercube_float_zero_uv_width_fragment

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15335>
2022-03-23 10:21:12 +10:00
Chia-I Wu
ce84b1c30f venus: update venus-protocol headers
This requires vn_extension_get_spec_version to be updated as well.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15498>
2022-03-22 21:10:56 +00:00
Chia-I Wu
5d188274ee venus: add vn_extension_get_spec_version
It is a wraper for vn_info_extension_get

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15498>
2022-03-22 21:10:56 +00:00
wingdeans
0819869ca8 r600: Fix small leak in SfnLog
stderr_streambuf used to not get destroyed with SfnLog

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15412>
2022-03-22 20:24:21 +00:00
Mike Blumenkrantz
23f38553c8 zink: add RADV to list of broken drivers for EXT_color_write_enable
ref #6185

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15509>
2022-03-22 20:08:35 +00:00
Alyssa Rosenzweig
d2fb6879a2 panfrost: Process scissor state earlier
Otherwise, if batch->scissor_culls_everything is set for a single draw,
every draw after it in the batch will be skipped because the new
scissor/viewport state will never be processed. Process scissor state
early in draw_vbo to fix this interaction.

We do need to be careful: setting something on the batch can only happen when
we've decided on a batch. If we have to select a fresh batch due to too many
draws, that must happen first. This is pretty clear in the code but worth noting
for the diff.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Icecream95 <ixn@disroot.org>
Reviewed-by: Icecream95 <ixn@disroot.org>
Fixes: 79356b2e ("panfrost: Skip rasterizer discard draws without side effects")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5839
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6136
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15365>
2022-03-22 19:44:40 +00:00
Iván Briano
5afbb0e730 intel/fs: handle interpolation modes for at_sample and at_offset too
Cc: mesa-stable

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15424>
2022-03-22 19:05:05 +00:00
Cristian Ciocaltea
c2d29e940d virgl/ci: Add jobs for running trace tests on LAVA
Provide new jobs virgl-lava-traces and virgl-lava-traces-performance to
run piglit trace tests on Intel based LAVA runners.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15208>
2022-03-22 17:01:09 +00:00
Cristian Ciocaltea
8726ea34d3 ci: Dynamically adjust LIBGL_ALWAYS_SOFTWARE for crosvm
For an increased flexibility in operation, do not set
'CROSVM_LIBGL_ALWAYS_SOFTWARE=true' when *not* using llvmpipe
Gallium driver.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15208>
2022-03-22 17:01:09 +00:00
Cristian Ciocaltea
356c9c25c3 ci: Allow specifying any shell command via HWCI_TEST_SCRIPT
Interpret the value of HWCI_TEST_SCRIPT environment variable as a shell
command. This allows, for example, to provide additional environment
variables: HWCI_TEST_SCRIPT="VAR1=VAL1 VAR2=VAL2 /path/to/script"

Additionally, add the missing execute permission flags to
gtest-runner.sh script.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15208>
2022-03-22 17:01:09 +00:00
Cristian Ciocaltea
fb2ffc2f67 ci: Provide consistent results location in LAVA
There is an out-of-sync approach regarding the location of the results
folder: some scripts refer to it via $CI_PROJECT_DIR/results, while
others just assume it is located in the current working directory.

Usually $PWD points to $CI_PROJECT_DIR, but in some cases this is not
the case, hence let's ensure the 'results' folder can always be found
in the current working directory.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15208>
2022-03-22 17:01:09 +00:00
Cristian Ciocaltea
3e01cea1bd ci: Remove obsolete CROSVM_TEST_SCRIPT env var
This was used in the past for passing the path to a script to be
executed inside a crosvm instance. Currently, setting this variable
has no effect, hence remove it from generate-env.sh.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15208>
2022-03-22 17:01:09 +00:00
Cristian Ciocaltea
040fb521b3 ci: Add PIGLIT_REPLAY_LOOP_TIMES to generate-env.sh
PIGLIT_REPLAY_LOOP_TIMES is currently used to override the default
configuration when running virgl trace performance tests in LAVA.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15208>
2022-03-22 17:01:09 +00:00
Cristian Ciocaltea
f4cea722a6 ci: Use script relative paths in crosvm-runner
For an increased portability, do not rely on 'CI_PROJECT_DIR' to
reference script relative resources and, instead, compute their
paths based on the crosvm-runner.sh invocation file path as
indicated by $0.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15208>
2022-03-22 17:01:09 +00:00
Cristian Ciocaltea
fdc55725a0 ci: Make kernel image available in LAVA for KVM use cases
In order to run a VM (e.g. crosvm) through HWCI_TEST_SCRIPT on a LAVA
target, it's necessary to download a kernel image on the target device.

When HWCI_KVM is set to 'true', we can safely assume HWCI_TEST_SCRIPT
contains a command or the path to a script which expects the kernel
image to be available under /lava-files/${KERNEL_IMAGE_NAME}.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15208>
2022-03-22 17:01:09 +00:00
Cristian Ciocaltea
86ce26f1fc ci: Load KVM kernel module for LAVA runners
If 'HWCI_KVM' enviroment variable is set, load the KVM kernel module
specific to the detected CPU virtualisation extensions: vmx for Intel
VT and svm for AMD-V.

As an additional optimization, handle HWCI_KERNEL_MODULES probing in the
main shell process instead of creating an unnecessary subshell.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15208>
2022-03-22 17:01:09 +00:00
Cristian Ciocaltea
03bceca92f ci: Enable KVM_AMD and KVM_INTEL kernel modules
Build and deploy KVM kernel modules in rootfs image to be used for
running crossvm in LAVA environment.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15208>
2022-03-22 17:01:09 +00:00
Cristian Ciocaltea
295243751f ci: Add crosvm runtime dependencies for LAVA
Provide the required packages in the rootfs image in order to allow
running crosvm inside LAVA environment.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15208>
2022-03-22 17:01:09 +00:00
Cristian Ciocaltea
c30c7ba834 ci: Build crosvm for LAVA runners
This is the first step to add support for running crosvm inside LAVA.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15208>
2022-03-22 17:01:09 +00:00
Cristian Ciocaltea
e6252dec9e ci: Set CI_JOB_JWT_FILE to a fixed path outside /tmp
Having CI_JOB_JWT_FILE pointing to path on /tmp makes it difficult to be
managed in VM contexts (e.g. crosvm) because the /tmp mountpoint usually
refers to a local filesystem rather than the host one.

Additionally, there is another restriction for 'piglit-traces-test' job
to have the file available on the root filesystem.

To avoid amending all the jobs that might be affected, let's just set
the variable to a fixed path '/minio_jwt'. Note we also need to do this
in the 'variables:' section instead of 'before_script:' in order to be
able to reference it in CI job variables, e.g. PIGLIT_REPLAY_EXTRA_ARGS

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15208>
2022-03-22 17:01:09 +00:00
Cristian Ciocaltea
9904ea2c76 ci: Convert generate-env.sh to a POSIX compliant script
This shell script will be used in environments (e.g. LAVA) where bash
is not available, hence let's make sure it is POSIX compliant in order
to be able to execute on any modern shell interpreter.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15208>
2022-03-22 17:01:09 +00:00
Cristian Ciocaltea
e7ab2ba94e ci: Avoid altering EXTRA_CARGO_ARGS environment variable
Use a dedicated DEQP_RUNNER_CARGO_ARGS variable instead of
EXTRA_CARGO_ARGS in build-deqp-runner.sh to pass custom arguments when
invoking 'cargo install'.

This is to avoid modifications of EXTRA_CARGO_ARGS which might have
negative side-effects in the scripts which rely on this variable and
import build-deqp-runner.sh instead of executing it in a subshell.

Fixes: 8729c6e981 ("ci: Support building and installing deqp-runner from source")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15208>
2022-03-22 17:01:09 +00:00
Rhys Perry
543a5487cf radv,aco: lower image descriptor loads in NIR
fossil-db (Sienna Cichlid):
Totals from 2926 (1.80% of 162293) affected shaders:
Instrs: 2315110 -> 2306644 (-0.37%); split: -0.37%, +0.00%
CodeSize: 12581592 -> 12546588 (-0.28%); split: -0.28%, +0.00%
VGPRs: 130216 -> 130208 (-0.01%)
SpillSGPRs: 477 -> 474 (-0.63%); split: -5.03%, +4.40%
Latency: 29686188 -> 29678804 (-0.02%); split: -0.05%, +0.02%
InvThroughput: 6926545 -> 6926286 (-0.00%); split: -0.02%, +0.02%
SClause: 73761 -> 72996 (-1.04%); split: -1.16%, +0.12%
Copies: 144068 -> 137279 (-4.71%); split: -4.78%, +0.07%
Branches: 47466 -> 47483 (+0.04%); split: -0.01%, +0.04%
PreSGPRs: 118042 -> 117377 (-0.56%); split: -1.34%, +0.77%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12773>
2022-03-22 16:33:27 +00:00
Rhys Perry
15640e58d9 radv,aco: lower texture descriptor loads in NIR
fossil-db (Sienna Cichlid):
Totals from 39445 (24.30% of 162293) affected shaders:
MaxWaves: 875988 -> 875972 (-0.00%)
Instrs: 35372561 -> 35234909 (-0.39%); split: -0.41%, +0.03%
CodeSize: 190237480 -> 189379240 (-0.45%); split: -0.47%, +0.02%
VGPRs: 1889856 -> 1889928 (+0.00%); split: -0.00%, +0.01%
SpillSGPRs: 10764 -> 10857 (+0.86%); split: -2.04%, +2.91%
SpillVGPRs: 1891 -> 1907 (+0.85%); split: -0.32%, +1.16%
Scratch: 260096 -> 261120 (+0.39%)
Latency: 477701150 -> 477578466 (-0.03%); split: -0.06%, +0.03%
InvThroughput: 87819847 -> 87830346 (+0.01%); split: -0.03%, +0.04%
VClause: 673353 -> 673829 (+0.07%); split: -0.04%, +0.11%
SClause: 1385396 -> 1366478 (-1.37%); split: -1.65%, +0.29%
Copies: 2327965 -> 2229134 (-4.25%); split: -4.58%, +0.34%
Branches: 906707 -> 906434 (-0.03%); split: -0.13%, +0.10%
PreSGPRs: 1874153 -> 1862698 (-0.61%); split: -1.34%, +0.73%
PreVGPRs: 1691382 -> 1691383 (+0.00%); split: -0.00%, +0.00%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12773>
2022-03-22 16:33:27 +00:00
Rhys Perry
52f850238a radv,aco: lower buffer descriptor loads in NIR
fossil-db (Sienna Cichlid):
Totals from 75420 (46.47% of 162293) affected shaders:
MaxWaves: 1878200 -> 1879228 (+0.05%); split: +0.06%, -0.00%
Instrs: 54021103 -> 54141370 (+0.22%); split: -0.04%, +0.26%
CodeSize: 287813520 -> 288293352 (+0.17%); split: -0.04%, +0.21%
VGPRs: 3267576 -> 3266296 (-0.04%); split: -0.04%, +0.00%
SpillSGPRs: 10445 -> 10904 (+4.39%); split: -0.31%, +4.70%
SpillVGPRs: 1818 -> 1811 (-0.39%); split: -1.05%, +0.66%
Scratch: 955392 -> 954368 (-0.11%)
Latency: 563477854 -> 562131282 (-0.24%); split: -0.31%, +0.08%
InvThroughput: 111860104 -> 111553968 (-0.27%); split: -0.30%, +0.02%
VClause: 958432 -> 961415 (+0.31%); split: -0.34%, +0.65%
SClause: 1917415 -> 1926952 (+0.50%); split: -0.69%, +1.19%
Copies: 3812945 -> 3916758 (+2.72%); split: -0.27%, +2.99%
Branches: 1611235 -> 1612022 (+0.05%); split: -0.04%, +0.08%
PreSGPRs: 3095505 -> 3126580 (+1.00%); split: -0.06%, +1.07%
PreVGPRs: 2773011 -> 2773013 (+0.00%)

Most regressions seem to be because ACO's convert_pointer_to_64_bit()
can't be CSE'd with radv_nir_apply_pipeline_layout()'s
convert_pointer_to_64_bit(). This should be improved by later commits.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12773>
2022-03-22 16:33:27 +00:00
Rhys Perry
22050fcf9d radv,aco: lower vulkan_resource_index in NIR
fossil-db (Sienna Cichlid):
Totals from 31338 (19.31% of 162293) affected shaders:
MaxWaves: 758634 -> 758616 (-0.00%)
Instrs: 26398289 -> 26378282 (-0.08%); split: -0.09%, +0.01%
CodeSize: 141048208 -> 140971060 (-0.05%); split: -0.07%, +0.01%
VGPRs: 1373656 -> 1373736 (+0.01%)
SpillSGPRs: 9944 -> 9924 (-0.20%); split: -0.24%, +0.04%
SpillVGPRs: 1892 -> 1898 (+0.32%); split: -0.95%, +1.27%
Latency: 308570144 -> 308528462 (-0.01%); split: -0.03%, +0.02%
InvThroughput: 57698072 -> 57684901 (-0.02%); split: -0.07%, +0.04%
VClause: 440357 -> 440602 (+0.06%); split: -0.02%, +0.08%
SClause: 974724 -> 973315 (-0.14%); split: -0.18%, +0.04%
Copies: 1944925 -> 1945103 (+0.01%); split: -0.11%, +0.12%
Branches: 799444 -> 799461 (+0.00%); split: -0.00%, +0.00%
PreSGPRs: 1619860 -> 1619233 (-0.04%); split: -0.05%, +0.02%
PreVGPRs: 1252813 -> 1252863 (+0.00%); split: -0.00%, +0.00%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12773>
2022-03-22 16:33:27 +00:00
Rhys Perry
3d52d3cd9b ac/llvm: implement nir_tex_src_{texture,sampler}_handle
nir_tex_src_{texture,sampler}_handle is either the actual descriptor as a
vec4/vec8 or a pointer passed to load_sampler_desc.

The sample index isn't adjusted using FMASK when these are used.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12773>
2022-03-22 16:33:27 +00:00
Rhys Perry
53ccb2a9a7 ac/llvm: remove deref chasing for tg4 integer workaround
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12773>
2022-03-22 16:33:27 +00:00
Rhys Perry
dc4df0ce8b ac/llvm: implement nir_intrinsic_bindless_image_sparse_load
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12773>
2022-03-22 16:33:27 +00:00
Rhys Perry
238915fdd1 ac/llvm: remove deref requirement for image fmask loads
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12773>
2022-03-22 16:33:27 +00:00
Rhys Perry
e82aba88dc nir: allow bindless image/texture/sampler handles to be vectors
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12773>
2022-03-22 16:33:27 +00:00
Rhys Perry
e6672f6fd1 radv: move radv_declare_shader_args() out of shader_variant_compile()
Declaring them earlier will allow us to access them in NIR.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12773>
2022-03-22 16:33:27 +00:00
Rhys Perry
a56bb2d545 ac/llvm: implement implement load_{scalar,vector}_arg_amd and load_smem_amd
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12773>
2022-03-22 16:33:27 +00:00
Rhys Perry
53996cf979 aco: implement load_{scalar,vector}_arg_amd and load_smem_amd
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12773>
2022-03-22 16:33:27 +00:00
Rhys Perry
ff52a724d4 nir: add load_{scalar,vector}_arg_amd and load_smem_amd intrinsics
load_smem_gcn is similar to load_global/load_global_constant, but it's
guaranteed to use SMEM and it's much easier to utilize the format's 32-bit
offset source.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12773>
2022-03-22 16:33:27 +00:00
Frank Binns
8991e64641 pvr: Add a Vulkan driver for Imagination Technologies PowerVR Rogue GPUs
Co-authored-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Co-authored-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Co-authored-by: Simon Perretta <simon.perretta@imgtec.com>
Co-authored-by: Alexander Wasey <Alexander.Wasey@imgtec.com>
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Signed-off-by: Alexander Wasey <Alexander.Wasey@imgtec.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15243>
2022-03-22 15:04:55 +00:00
Danylo Piliaiev
5d151ddfba turnip: Disallow non-linear tiling when casting R8G8 to other fmts
R8G8 have a different block width/height and height alignment from other
formats that would normally be compatible (like R16), and so if we are
trying to, for example, sample R16 as R8G8 we need to demote to linear.

Follows the fix in Freedreno: b97e3bb2e1

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15465>
2022-03-22 13:47:21 +00:00
Danylo Piliaiev
a70b197741 turnip: Force linear mode for non-ubwc R8G8 formats
Non-UBWC tiled R8G8 is probably buggy since media formats are always
either linear or UBWC. There is no simple test to reproduce the bug.
However it was observed in the wild leading to an unrecoverable hang
on a650/a660.

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

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15465>
2022-03-22 13:47:21 +00:00
shansheng.wang
1bd8ef0c89 frontends/va: fix coredump as creating surface with VAConfigAttrib
As creating surface with VAConfigAttrib, checking if modifier from attrib list is null

Signed-off-by: shanshengwang <shansheng.wang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15483>
2022-03-22 13:07:56 +00:00
Mike Blumenkrantz
f9390dac23 zink: use the current compute shader, not the base one
this is the current variant and the one that should be used

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15501>
2022-03-22 12:54:43 +00:00
Mike Blumenkrantz
d8d7ba8b5d zink: create compute pipeline after updating shader variants
it turns out shader variants don't work if you generate them after you
determine which variant to use

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15501>
2022-03-22 12:54:43 +00:00
Ganesh Belgur Ramachandra
582e7f1599 radeonsi: NIR equivalent of si_create_clear_buffer_rmw_cs()
Replaced the existing internal TGSI compute shader, which clears
a read-modify-write buffer, with its NIR equivalent. The disassembly
shader generated by the new NIR variant is identical to the previous
implementation. These changes remove the additional conversion step
from TGSI to NIR for the shader at runtime. Tested on a Navi 23 card.

Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15356>
2022-03-22 12:35:41 +00:00
Mihai Preda
ff2b2bc568 amd/ac_gpu_info: fix warning on fread unused result
fixes this warning:
ignoring return value of 'fread' declared with attribute 'warn_unused_result' [-Wunused-result]

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15502>
2022-03-22 11:50:37 +00:00
Kenneth Graunke
49dd707ca2 intel: Add INTEL_DEBUG=noccs alias for INTEL_DEBUG=norbc
When CCS compression first came out on Skylake, we referred to it as
"renderbuffer compression", or RBC for short.  However, that name has
long since fallen out of favor, and we refer to it as CCS nearly
everywhere.

This patch renames DEBUG_NO_RBC to DEBUG_NO_CCS inside the codebase
for clarity, and adds INTEL_DEBUG=noccs.  The legacy INTEL_DEBUG=norbc
name continues to work, because it's one line of code and having both
names makes our lives easier in the interim.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15447>
2022-03-22 06:23:10 +00:00
Kenneth Graunke
85d30846db nir: Print divergence status of SSA values if analysis was ever run.
After running divergence analysis, we include "div" or "con" for each
SSA def's divergence/convergence status:

	vec1 32 div ssa_35 = fddy ssa_34
	vec1 32 con ssa_36 = fddy ssa_6.x

We omit this before the first time divergence analysis has been run.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15445>
2022-03-21 22:46:34 -07:00
Mike Blumenkrantz
09a37ad046 zink: ci updates
these should be properly disabled now

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15500>
2022-03-21 23:13:21 -04:00
Mike Blumenkrantz
2139ef8951 zink: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15392>
2022-03-21 23:00:56 -04:00
Mike Blumenkrantz
5b77a17472 zink: use the right query type for primitives generated
this should've always been clipping invocations, but I got scared because
then tests with rasterization_discard=1 fail and I didn't handle that instead

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15392>
2022-03-21 23:00:40 -04:00
Mike Blumenkrantz
9153fb7fbe zink: use EXT_color_write_enable to mask out primgen+rasterizer_discard output
by disabling color and depth write, the side effects of force-disabling discard can
be mitigated

fixes:
KHR-GL46.tessellation_shader.single.isolines_tessellation
KHR-GL46.tessellation_shader.tessellation_control_to_tessellation_evaluation.data_pass_through
KHR-GL46.tessellation_shader.tessellation_invariance.invariance_rule3
KHR-GL46.tessellation_shader.tessellation_shader_point_mode.points_verification
KHR-GL46.tessellation_shader.tessellation_shader_quads_tessellation.degenerate_case
KHR-GL46.tessellation_shader.tessellation_shader_quads_tessellation.inner_tessellation_level_rounding
KHR-GL46.tessellation_shader.tessellation_shader_tessellation.gl_InvocationID_PatchVerticesIn_PrimitiveID
KHR-GL46.tessellation_shader.vertex.vertex_spacing

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15392>
2022-03-21 23:00:28 -04:00
Mike Blumenkrantz
3892c13381 zink: add an alternate path for EXT_color_write_enable usage
for drivers where this is broken/missing, the same effect can be achieved
by feeding the renderpass a framebuffer with null/dummy attachments

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15392>
2022-03-21 22:58:12 -04:00
Mike Blumenkrantz
447099629e zink: use EXT_color_write_enable when possible
this should only verify that drivers aren't completely broken by
enabling it and have no other changes

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15392>
2022-03-21 22:58:12 -04:00
Mike Blumenkrantz
ecca2564c1 zink: disable color_write_enable on ANV
this breaks the driver

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15392>
2022-03-21 22:58:12 -04:00
Mike Blumenkrantz
49a20e0981 zink: start a unified driver workarounds struct
eventually anything that checks driverID should be moved here for ease of
reference/updating

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15392>
2022-03-21 22:58:11 -04:00
Mike Blumenkrantz
0a80f94de0 zink: force disable rasterization discard if primgen query is active
this query requires rasterization to pass the clipping invocations stage,
which means discard is impossible

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15392>
2022-03-21 22:58:11 -04:00
Mike Blumenkrantz
795925e0ff zink: hook up EXT_color_write_enable
no functional changes

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15392>
2022-03-21 22:58:11 -04:00
Qiang Yu
9401990e6f nir/linker: set varying from uniform as flat
Flat varying can save some rasterization compute cost
and register needed by shader.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-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/15341>
2022-03-22 01:33:23 +00:00
Qiang Yu
aaf951c47f lima: enable nir lower_varying_from_uniform
Mali GPU pass varying by memory, so enable this optimization.

Reviewed-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/15341>
2022-03-22 01:33:23 +00:00
Qiang Yu
2617e6c028 nir/linker: disable varying from uniform lowering by default
This fixes performance regression for Specviewperf/Energy
on AMD GPU. Other GPUs passing varying by memory may choose
to re-enable it as need.

Fixes: 2604625043 ("nir/linker: support uniform when optimizing varying")
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-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/15341>
2022-03-22 01:33:23 +00:00
Alyssa Rosenzweig
b219e9a96e asahi: Port driver to macOS 12.x ABI
There's lots of reshuffling required. Nothing "interesting", though.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15482>
2022-03-22 00:19:30 +00:00
Alyssa Rosenzweig
1c6e77bd04 asahi: Don't clobber clear colours
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15482>
2022-03-22 00:19:30 +00:00
Alyssa Rosenzweig
b3be6d5263 asahi: Handle flushes of depth-only rendering
Not totally right but this should be a start.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15482>
2022-03-22 00:19:30 +00:00
Alyssa Rosenzweig
a0197c16bc asahi: Wire in u_transfer_helper
We need it for emulating packed depth/stencil as separate depth/stencil
resources, populating separate_stencil for us as required.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15482>
2022-03-22 00:19:30 +00:00
Alyssa Rosenzweig
3cd2833549 asahi: Generate IOGPU attachments dynamically
Take a pipe_framebuffer_state and go from there. We need some care to
handle separate stencil, but the logic is largely routine.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15482>
2022-03-22 00:19:30 +00:00
Alyssa Rosenzweig
5d58d5caaf asahi: Add separate_stencil, internal_format fields
Currently unused, but will be set when u_transfer_helper is integrated
for emulating packed depth/stencil.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15482>
2022-03-22 00:19:30 +00:00
Alyssa Rosenzweig
2c23bb49ef asahi: Add size field to slices
Needed to size attachments for the kernel... for some reason. We already
compute this; just save it.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15482>
2022-03-22 00:19:29 +00:00
Alyssa Rosenzweig
f5ae88d36f asahi: Identify IOGPU_MISC data structure
This will be elaborated upon soon.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15482>
2022-03-22 00:19:29 +00:00
Alyssa Rosenzweig
d5ee1eacf1 asahi: Add stencil buffer attachment type
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15482>
2022-03-22 00:19:29 +00:00
Alyssa Rosenzweig
50f9b4ceba asahi: Identify IOGPU Internal Pipelines structure
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15482>
2022-03-22 00:19:29 +00:00
Alyssa Rosenzweig
eb9da583d7 asahi: Identify aux framebuffer data structure
Total guess at the name.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15482>
2022-03-22 00:19:29 +00:00
Alyssa Rosenzweig
535f1c1166 asahi: Identify IOGPU Clear Z/S structure
Not sure on the details yet but identify and dump the data structure to start.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15482>
2022-03-22 00:19:29 +00:00
Yonggang Luo
d9c3601e29 util: trim trailing space for files src/util/**/*
Using the following bash script doing that
```
cd src/util
find . -type f -print0 | xargs -0 -n1 sed -i 's/[ \t]*$//'
```

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15093>
2022-03-21 17:57:15 +00:00
Nanley Chery
da82358a52 ci/anv: Changes from enabling 8/16bpp CCS more
- Fixes in dEQP-VK.dynamic_rendering.suballocation.multisample_resolve.*
- Fails in dEQP-VK.drm_format_modifiers.export_import.*

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15420>
2022-03-21 17:36:10 +00:00
Nanley Chery
e2f0c859c2 Revert "anv: Disable CCS_E for some 8/16bpp copies on TGL+"
This reverts commit d68b2db89c.

With this change, no regressions have been observed with the
dEQP-VK.synchronization* test group. There are regressions with
dEQP-VK.drm_format_modifiers.export_import.*, but those have been
root-caused to be test issues (see 3575).

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6125
Fixes: 57445adc89 ("anv: Re-enable CCS_E on TGL+")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15420>
2022-03-21 17:36:10 +00:00
Dylan Baker
fe65c5671b gallium/opencl: set OCL_ICD_FILENAMES with devenv
So that `meson devenv` also sets up OpenCL.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15471>
2022-03-21 16:58:14 +00:00
Pavel Ondračka
19db6b760a r300: set PVS_LAST_VTX_SRC_INST properly to last input read
From docs:
The PVS Instruction which uses the Input Vertex Memory for the last
time. This value is used to free up the Input Vertex Slots ASAP.
This field must be set to a valid instruction.

Right now it is set to the last instruction. When the last read is
inside a loop, set it on the outhermost ENDLOOP. This could in theory
help performance, but none of my usual benchmarks including GLmark,
Unigine Sanctuary or Lightsmark show any measurable performance difference.

Suggested in: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6045

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/15252>
2022-03-21 16:37:11 +00:00
Karol Herbst
43c3f4386b nir: fix nir_sweep for printf
I hit a memory corruption trying to implement printf for Rusticl

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15474>
2022-03-21 13:23:04 +00:00
Lionel Landwerlin
44555e7f2c ci: enable intel-clc on some platforms
We'll have to figure out the cross compiling strategy, in particular
for Android. But as it stands we can't have the target & host llvm
packages installed at the same time so we can't really compile it.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13171>
2022-03-21 11:26:44 +00:00
Lionel Landwerlin
beadd0cb24 ci: enable llvm on debian-release build
Needed for intel-clc.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13171>
2022-03-21 11:26:44 +00:00
Lionel Landwerlin
57dd9c66bd ci: add clang/spirv-tools/llvm-spirv packages to fedora container
Needed for intel-clc.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13171>
2022-03-21 11:26:44 +00:00
Lionel Landwerlin
9ca29c687b intel/clc: disable tool prior to Gfx12.5 platforms
This tool is currently only aimed at Gfx version 12.5+ with
COMPUTE_WALKER. We could make it work on earlier platforms but they
require pushing gl_SubgroupInvocation and the CLC code is missing the
back-end compiler set-up bits for that.

v2: Commit description by Jason

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13171>
2022-03-21 11:26:44 +00:00
Lionel Landwerlin
c735c4ca85 intel/clc: specify supported extensions
Having everything ever known to man is confusing our SPIRV parser.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13171>
2022-03-21 11:26:44 +00:00
Lionel Landwerlin
a29b1d5716 intel/clc: allow producing SPIRV files
Useful to debug the parser.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13171>
2022-03-21 11:26:44 +00:00
Lionel Landwerlin
77e929a527 intel/clc: allow multiple CL files to be compiled together
v2: use util_dynarray_append() (Jason)
    identation fixes (Jason)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13171>
2022-03-21 11:26:44 +00:00
Jason Ekstrand
c15bf88f01 intel: Add a little OpenCL C compiler binary
v2: Fix up indentation (Marcin)
    s/gen/gfx/ (Marcin)
    Deal with fd closing in success/fail cases (Marin)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13171>
2022-03-21 11:26:44 +00:00
Lionel Landwerlin
b1e7ce84cc meson: try to find clang-cpp before going through each module
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13171>
2022-03-21 11:26:44 +00:00
Lionel Landwerlin
ec6e247a40 intel/fs: handle inline data on OpenCL style kernels
This is for Gfx12.5 with the COMPUTE_WALKER::Inline Data payload. We
do this in a similar way to the compute kernels.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13171>
2022-03-21 11:26:44 +00:00
Jason Ekstrand
4d8e788663 intel/kernel: Implement some Intel built-in functions
v2: Document mangled function names (Marcin)
    Fixup progress & metadata (Marcin)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13171>
2022-03-21 11:26:44 +00:00
Jason Ekstrand
346a7f14fb intel/compiler: Add code for compiling CL-style SPIR-V kernels
v2: simplify INTEL_DEBUG expressions (Marcin)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13171>
2022-03-21 11:26:44 +00:00
Jason Ekstrand
8c11912582 intel/debug: Dump KERNEL source when INTEL_DEBUG=cs
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13171>
2022-03-21 11:26:44 +00:00
Jason Ekstrand
d1bddfba6b intel/nir: Add optimizations to help OpenCL-style kernels
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13171>
2022-03-21 11:26:44 +00:00
Lionel Landwerlin
4ec5da7270 intel/nir/fs: replace COMPUTE || KERNEL by gl_shader_stage_is_compute()
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13171>
2022-03-21 11:26:44 +00:00
Jason Ekstrand
e9ff6f4f06 nir/print: Add support for generic pointers
The way they're handled is that deref->modes is treated as a bitfield of
possible modes.  Variables are required to have a specific mode and
derefs with deref_type_var are as well.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13171>
2022-03-21 11:26:44 +00:00
Yonggang Luo
24bc6c51e1 glx/egl: improve dri null screen related error messages.
Convert from `failed to create dri screen` to more exact error message
for easier debugging

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15480>
2022-03-21 09:31:31 +00:00
Pierre-Eric Pelloux-Prayer
5b14a0e390 crocus: replace opencoded slab_zalloc
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15277>
2022-03-21 09:47:58 +01:00
Pierre-Eric Pelloux-Prayer
b83bbd6f7f d3d12: replace opencoded slab_zalloc
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15277>
2022-03-21 09:47:58 +01:00
Pierre-Eric Pelloux-Prayer
42fe3c5815 etnaviv: replace opencoded slab_zalloc
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15277>
2022-03-21 09:47:58 +01:00
Pierre-Eric Pelloux-Prayer
f8cbbaff5f freedreno: replace opencoded slab_zalloc
Reviewed-by: Rob Clark <robdclark@chromium.org>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15277>
2022-03-21 09:47:58 +01:00
Pierre-Eric Pelloux-Prayer
06b72f1e1a lima: replace opencoded slab_zalloc
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15277>
2022-03-21 09:47:58 +01:00
Pierre-Eric Pelloux-Prayer
38aad273aa iris: replace opencoded slab_zalloc
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15277>
2022-03-21 09:47:58 +01:00
Pierre-Eric Pelloux-Prayer
4e29299e2b v3d: replace opencoded slab_zalloc
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15277>
2022-03-21 09:47:58 +01:00
Pierre-Eric Pelloux-Prayer
af7117df71 vc4: replace opencoded slab_zalloc
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15277>
2022-03-21 09:47:58 +01:00
Pierre-Eric Pelloux-Prayer
ff1744ee27 virgl: replace opencoded slab_zalloc
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15277>
2022-03-21 09:47:58 +01:00
Pierre-Eric Pelloux-Prayer
6fb52ba30e zink: replace opencoded slab_zalloc
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15277>
2022-03-21 09:47:58 +01:00
Pierre-Eric Pelloux-Prayer
3dc6236b3c r600: replace opencoded slab_zalloc
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15277>
2022-03-21 09:47:58 +01:00
Pierre-Eric Pelloux-Prayer
4b559f791c radeonsi: replace opencoded slab_zalloc
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15277>
2022-03-21 09:47:57 +01:00
Mike Blumenkrantz
bd06680b61 lavapipe: KHR_synchronization2
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15413>
2022-03-21 04:55:37 +00:00
Mike Blumenkrantz
6d62c671ab lavapipe: add QueueSubmit2 implementation
this converts the existing code to use VkSubmitInfo2 structs and adds
a new QueueSubmit wrapper which generates these structs from VkSubmitInfo

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15413>
2022-03-21 04:55:37 +00:00
Mike Blumenkrantz
00a6676506 lavapipe: add sync2 cmdbuf method implementations
nothing special here

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15413>
2022-03-21 04:55:37 +00:00
Mike Blumenkrantz
256e4d7949 lavapipe: fix typo in set_event execution
Fixes: eb7eccc76f ("lavapipe: Use generated command queue code")

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15413>
2022-03-21 04:55:37 +00:00
Mike Blumenkrantz
01d597a3a5 docs: update lavapipe features and relnotes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15463>
2022-03-21 04:39:56 +00:00
Mike Blumenkrantz
a364f8c532 lavapipe 1.3
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15463>
2022-03-21 04:39:56 +00:00
Mike Blumenkrantz
0b8ecb5406 lavapipe: add a GetPhysicalDeviceToolPropertiesEXT stub
when no tools are loaded, this will otherwise crash

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15463>
2022-03-21 04:39:56 +00:00
Mike Blumenkrantz
741be76963 lavapipe: EXT_subgroup_size_control
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15354>
2022-03-21 04:09:48 +00:00
Mike Blumenkrantz
f150bff04f llvmpipe: fix variable naming insanity in cs generator
in the top part of this function, the x/y/z size variables are used to
represent the loop iterator limits

in the bottom part, they change to represent the loop iterator values

my brain.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15354>
2022-03-21 04:09:48 +00:00
Mike Blumenkrantz
102f6ebc57 llvmpipe: fix subgroup id construction
the coroutine idx is based on the number of x loops, but the subgroup id
is based on the coroutine's total loops

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15354>
2022-03-21 04:09:48 +00:00
Mike Blumenkrantz
f33399aa9e llvmpipe: fix gl_NumSubgroups
this is (x * y * z) / subgroup_size, not num_x_loops

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15354>
2022-03-21 04:09:48 +00:00
Mike Blumenkrantz
7f1050f207 lavapipe: EXT_inline_uniform_block
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15457>
2022-03-21 03:58:14 +00:00
Mike Blumenkrantz
1ba1ee9e7c lavapipe: implement EXT_inline_uniform_block
this is a lot of machinery to propagate the block sizes down from the
descriptor layout to the pipeline layout to the rendering_state

block data is appended to ubo0 immediately following push constant
data (if it exists), which requires that a new buffer be created and
filled any time either type of data changes

shader handling is done by propagating the offset of each block relative
to the start of its descriptor set, then accumulating the sizes of
every uniform block in each preceding descriptor set into the offset,
then adding on the push constant size, and finally adding that on to
the existing load_ubo deref offset

update-after-bind is no longer an issue since each instance of pc+block
data is its own immutable buffer that can never be modified

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15457>
2022-03-21 03:58:14 +00:00
Mike Blumenkrantz
249fe9673a lavapipe: remove unused struct member
this was used at some point I think?

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15457>
2022-03-21 03:58:14 +00:00
Mike Blumenkrantz
5bbb39a652 lavapipe: use stream uploader for push constant upload
now instead of having static per-stage buffer regions and letting llvmpipe
do the upload, lavapipe creates a new pipe_resource and chucks it away
with take_ownership=true to allow it to be destroyed once it's no longer
in use

this also alters ubo0 mechanics such that the buffer is now sized exactly to
the size of the push constants in the pipeline and push constants are only
updated when the appropriate shader stage is flagged

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15457>
2022-03-21 03:58:14 +00:00
Mike Blumenkrantz
c264b1b6ab lavapipe: save pipeline stages that push constants are active on
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15457>
2022-03-21 03:58:14 +00:00
Mike Blumenkrantz
526e898dfc lavapipe: add a stream uploader to rendering_state and queue objects
not currently used

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15457>
2022-03-21 03:58:14 +00:00
Mike Blumenkrantz
de01a47b1c lavapipe: zalloc pipeline layout structs
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15457>
2022-03-21 03:58:14 +00:00
Mike Blumenkrantz
08732eca5d lavapipe: don't emit compute states during draw
there's a separate function for this

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15457>
2022-03-21 03:58:14 +00:00
Mike Blumenkrantz
40607f5088 lavapipe: KHR_shader_terminate_invocation
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15402>
2022-03-21 03:20:33 +00:00
Mike Blumenkrantz
68fd0668eb lavapipe: extend demote->discard pass to handle terminate
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15402>
2022-03-21 03:20:33 +00:00
Mike Blumenkrantz
82d3e7515e lavapipe: EXT_shader_demote_to_helper_invocation
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15402>
2022-03-21 03:20:33 +00:00
Mike Blumenkrantz
3e28ce374e lavapipe: run some shader passes for demote handling
pipe internals already support discard, so as long as everything is
rewritten to use discard, we don't need any further changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15402>
2022-03-21 03:20:33 +00:00
Mike Blumenkrantz
cdcfcb7916 nir/lower_is_helper_invocation: create load_helper_invocation instr with bitsize=1
the specification stipulates that this is a bool value, so don't load it as an int
or else nir_validate explodes

Fixes: f17b41ab4f ("nir: add lowering pass for helperInvocationEXT()")

Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15402>
2022-03-21 03:20:33 +00:00
Mike Blumenkrantz
fe33835091 zink: handle conversion for vertices statistics query with LINE_LOOP draws
the converted number of vertices is 2x that of the "real" number of vertices,
so divide the results by 2

this works nicely since zink performs cpu readback for all queries, and shader
aggregation should be simple in the future as well

fixes:
KHR-GL46.pipeline_statistics_query_tests_ARB.functional_primitives_vertices_submitted_and_clipping_input_output_primitives

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15401>
2022-03-21 02:55:37 +00:00
Mike Blumenkrantz
d25437d54f zink: store vertices statistics query to context
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15401>
2022-03-21 02:55:37 +00:00
M Henning
c36f3f2db8 nouveau: Fix out-of-bounds access in AlgebraicOpt
for cases where we calculate the absolute value of the result
of a unary operation

We can remove this problematic check since it's redundant with
the one several lines down.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15476>
2022-03-20 05:35:06 +00:00
M Henning
d12e16fc3b nouveau: Handle unaligned tlsBase during spills
Without this, 128-bit or 64-bit register spills can generate unaligned
loads and stores if tlsBase is unaligned.

Fixes glsl-1.50/execution/variable-indexing/gs-input-array-vec3-index-rd
with NV50_PROG_USE_NIR=1 on kepler

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13693>
2022-03-20 05:24:51 +00:00
Kenneth Graunke
4de13d53fe iris: Fix MOCS for copy regions
These were, unfortunately, backwards.  The source is the texture.
The destination is the render target.

Fixes: d8cb76211c ("iris: Fix MOCS for buffer copies")
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15473>
2022-03-19 01:56:35 -07:00
Andrey Konovalov
ed2f496ce4 ir3: set local_size for shaders of MESA_SHADER_KERNEL type
ir3_compile_shader_nir() should set local_size[] and local_size_variable
fields not only for compute shaders, but for the OpenCL kernels too.

v2: use gl_shader_stage_is_compute() instead of explicit comparison with
    MESA_SHADER_[COMPUTE,KERNEL].

Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14863>
2022-03-18 23:20:25 +00:00
Emma Anholt
44c52e94e9 ci/traces: Make sure we have no pre-existing traces-db before starting.
bare-metal can reboot boards into an existing rootfs on intermittent
device failure, but traces-db doesn't do any sanity-checking of the local
downloads of traces and would proceed to just trying to replay them.

Nuke any existing trace db so that it re-downloads every time, same as
LAVA or docker container tests do.

Fixes: #5585
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15440>
2022-03-18 22:54:41 +00:00
Michel Zou
49e2d39c66 lavapipe: fix i686 mingw build
Fixes: 987e8a5a
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15464>
2022-03-18 22:42:51 +00:00
Mike Blumenkrantz
47209e80db lavapipe: zalloc lvp_image_view structs
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15462>
2022-03-18 22:27:25 +00:00
Mike Blumenkrantz
4a13b11f4a lavapipe: break out resolves into separate functions
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15462>
2022-03-18 22:27:25 +00:00
Mike Blumenkrantz
441c553ef7 lavapipe: store number of immutable samplers to pipeline layout
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15462>
2022-03-18 22:27:25 +00:00
Jason Ekstrand
7030d14e0d spirv: Properly mangle generic pointers
Fixes: a8e53a772f ("spirv: Add generic pointer support")
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15470>
2022-03-18 21:52:05 +00:00
Eric Engestrom
9ba636cdc7 docs: update calendar and link releases notes for 21.3.8
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15466>
2022-03-18 21:07:14 +00:00
Eric Engestrom
daf6ee08d6 docs: add release notes for 21.3.8
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15466>
2022-03-18 21:07:14 +00:00
Emma Anholt
f831ba238f ci/turnip: Increase the hangcheck timer to 2 seconds.
We get a lot of useful coverage from running graphicsfuzz with spilling
enabled, but it's also pretty slow and can cause intermittent hangcheck
failures.  I thought I'd categorized them when merging !14839 (device loss
on reset), but it looks like not all of them and we're now more likely to
have flakes take out the whole test run when a single flake makes the rest
of the caselist a flake.

This is a little unfortunate in that it means our test environment is not
the same as a stock system you would want to run deqp on to submit
conformance, but I think it's an improvement in the test maintenance work
vs needing to fix things up later.

We have some other tests besides turnip that can trigger hangchecks which
we might also like this increase for (some disabled traces, for example).
However, freedreno GL has a 5-second timeout waiting for idle when
mapping, and a couple of 2-second timeouts in a row can result in spurious
failures in other tests!

Fixes: #6163
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15435>
2022-03-18 19:07:24 +00:00
Alyssa Rosenzweig
0cbe4dd4c4 pan/bi: Use bi_dontcare for ZS_EMIT
This is more portable and avoids special casing.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:06 +00:00
Alyssa Rosenzweig
1b934d5962 pan/bi: Emit arch-specific code for bi_dontcare
We use bi_dontcare() to specify any encoding where we don't care about
the value, with a preference for power-efficient encodings. On Bifrost,
a (possibly nonexistant) FAU read is the best encoding. On Valhall, that
encoding doesn't exist so just use a zero. That should be good enough in
practice.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:06 +00:00
Alyssa Rosenzweig
222d17fc67 pan/bi: Model Valhall action on bi_instr
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:06 +00:00
Alyssa Rosenzweig
38625af010 pan/bi: Add Valhall-specific zero builder
When emitting code during or after register allocation, we need to be able to
emit constants without running the constant->{LUT, move, uniform} pass running
after. In particular, we need to access the constant 0 to implement spill code.
Add a Valhall-specific zero for this purpose.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:06 +00:00
Alyssa Rosenzweig
666b714a37 pan/bi: Don't analyze helper reqs in !frag shaders
Waste of time, and possibly invalid too.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:06 +00:00
Alyssa Rosenzweig
a16163a9fd pan/bi: Print Valhall-specific FAU indices
We'll emit these shortly, prepare the printer.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:06 +00:00
Alyssa Rosenzweig
32ca920023 pan/bi: Use vertex/instance ID helpers
Enables portability to Valhall.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig
1e37113ede pan/bi: Add helpers to get vertex/instance ID
These are preloaded in different places across Bifrost and Valhall. Abstract
that away so code using the builder isn't littered with "is Valhall?" checks.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig
76a09b8cd3 pan/va: Fix ST_CVT definitions
They are basicallly just STORE with an extra source and the memory access
modifier in a different place.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig
9b7a45e3dc pan/va: Align error messages in disassembler tests
Makes it easier to spot the difference, less eye scanning.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig
3a4b864197 pan/va: Add missing .auto32 register format
Clipped to .auto for consistency with Bifrost (and the existing IR).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig
263c5ef194 pan/va: Add LEA_ATTR_IMM instruction
Encoded like LEA_TEX_IMM.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig
459c6ac23f pan/va: Model LEA_TEX_IMM more accurately
The unknown field is a descriptor type, which we model as an opcode2 since it's
a fixed constant. This allows us to disambiguate LEA_TEX_IMM from LEA_ATTR_IMM.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig
17caccd15d pan/va: Correct definition of ZS_EMIT
It's a message instruction, not an ALU one... duh.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig
508335c927 panfrost: Add Tiler Job to v9 XML
Legacy tiling job, semantics are the same as on Midgard. Useful for blits and
transform feedback.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig
e635dc9ea5 panfrost: Refactor XML to permit non-IDVS jobs
Tiler jobs look similar, but don't have the Allocations fields. Refactor to make
this possible to express.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig
53f1fa9219 panfrost: Fix definition of DCD on v9
The position and varying shader environment descriptors are additional sections
of the job, rather than part of the (fragment only) DCD. This distinction
matters for non-IDVS jobs.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig
6d51c1b898 panfrost: Fix primitive restart with 32-bit indices
There's an overflow here if index_size = 4. Caught when bringing up Valhall, not
sure why this was never caught before. Yikes.

Fixes: 7a6a5f3fe1 ("panfrost: Handle explicit primitive restart")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig
02f519601a panfrost: Correct ASTC decode mode XML
The narrow/wide bit was backwards.

Fixes: bfba7533c7 ("panfrost: Add Valhall Plane Descriptor XML")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig
fd87135852 pan/decode: Unify tiler job handling
Instead of adding a third Valhall path, let's use GenXML to unify our paths.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Alyssa Rosenzweig
a9ca751a8f pan/decode: Handle blend arrays on Valhall
Required for MRT.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>
2022-03-18 18:52:05 +00:00
Connor Abbott
fc381fa1e3 tu: Actually expose VK_EXT_texel_buffer_alignment
Oops...

Fixes: 3d04c435 ("tu: Trivially implement VK_EXT_texel_buffer_alignment")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15451>
2022-03-18 18:30:20 +00:00
Omar Akkila
f18429340e lavapipe: Lift fence check into dedicated function
Signed-off-by: Omar Akkila <omar.akkila@collabora.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15443>
2022-03-18 18:15:39 +00:00
Georg Lehmann
4f6c7a6025 radv: Don't hash ycbcr sampler base object.
Stops gamescope from recompiling pipelines on every start.

Cc: mesa-stable

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15454>
2022-03-18 17:56:15 +00:00
Jason Ekstrand
012bfde7f3 panvk: Hook up emulated secondary command buffers
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14406>
2022-03-18 17:29:16 +00:00
Boris Brezillon
18fced0226 panvk: Refcount the descriptor set and pipeline layouts
Lifetime of descriptor sets and pipeline layouts are odd. Let's refcount
them so we don't end up with use-after-free patterns.

That means we can't use custom allocators for those objects.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14406>
2022-03-18 17:29:16 +00:00
Jason Ekstrand
df92f56d8d vulkan/runtime: Add emulated secondary command buffer support
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14406>
2022-03-18 17:29:16 +00:00
Boris Brezillon
25542f12d7 vulkan/cmd_queue: Fix the allocation scope
VK_SYSTEM_ALLOCATION_SCOPE_COMMAND is used for transient allocations that
are not expected to live outside the vkXxx(). Use
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT for cmd_entry allocations.

v2 (Jason Ekstrand):
 - Also fix the manually typed entrypoints in vk_cmd_enqueue.c

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14406>
2022-03-18 17:29:16 +00:00
Boris Brezillon
1437ee749b vulkan/cmd_queue: Track allocation errors in vk_cmd_queue
Needed to report allocation failures when vkEndCommandBuffer() is
called.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14406>
2022-03-18 17:29:16 +00:00
Jason Ekstrand
6cb95877b5 vulkan/cmd_queue: Auto-generate more vk_cmd_enqueue_unless_primary_Cmd*
Instead of one MANUAL_COMMANDS, we now have two deny-lists:
MANUAL_COMMANDS and NO_ENQUEUE_COMMANDS.  The former is for things which
have a manually typed implementation in vk_cmd_enqueue.c and the later
is for things we want to ignore entirely.  This lets us auto-generate
vk_cmd_enqueue_unless_primary_Cmd* entrypoints for the manually typed
vk_cmd_enqueue_Cmd* entrypoints.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14406>
2022-03-18 17:29:16 +00:00
Jason Ekstrand
3cffffc441 vulkan/cmd_queue: Generate enqueue_if_not_primary entrypoints
These check the command buffer level and enqueue the command if it's not
a primary but uses vk_device::command_dispatch_table for primaries.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14406>
2022-03-18 17:29:16 +00:00
Jason Ekstrand
8f29c833da vulkan/cmd_queue: Add a vk_cmd_queue_execute() helper
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14406>
2022-03-18 17:29:16 +00:00
Mike Blumenkrantz
e0910f5ef8 Revert "features: fix some vk extension listings"
This reverts commit a3e9388953.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15460>
2022-03-18 17:24:23 +00:00
Jason Ekstrand
68fe847a26 lavapipe: Drop GetPhysicalDeviceQueueFamilyProperties
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15459>
2022-03-18 11:19:15 -05:00
Jason Ekstrand
dc8fdab71e lavapipe: Use VK_OUTARRAY for GetPhysicalDeviceQueueFamilyProperties[2]
This fixes bugs with lavapipe's hand-rolled pCount handling.  The driver
is supposed to set *pCount to the number of queues actually written in
the case where it's initialized to a value that's too large.  It's also
supposed to handle *pCount being too small.

Fixes: b38879f8c5 ("vallium: initial import of the vulkan frontend")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15459>
2022-03-18 11:19:15 -05:00
Jason Ekstrand
91cb714dc1 panvk: Drop GetPhysicalDeviceQueueFamilyProperties
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15459>
2022-03-18 11:19:15 -05:00
Jason Ekstrand
19f56e3fc4 v3dv: Drop GetPhysicalDeviceQueueFamilyProperties
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15459>
2022-03-18 11:19:14 -05:00
Jason Ekstrand
2a779f98dc turnip: Drop tu_legacy.c
The remaining three helpers all have helpers in the common code.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15459>
2022-03-18 11:19:08 -05:00
Jason Ekstrand
205bf5d9cb radv: Drop GetPhysicalDeviceQueueFamilyProperties
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15459>
2022-03-18 10:22:59 -05:00
Jason Ekstrand
8d7cbe026e anv: Drop GetPhysicalDeviceQueueFamilyProperties
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15459>
2022-03-18 10:10:37 -05:00
Jason Ekstrand
25664c6194 vulkan: Add a 2 wrapper for vkGetPhysicalDeviceQueueFamilyProperties
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15459>
2022-03-18 10:10:33 -05:00
Mike Blumenkrantz
a3e9388953 features: fix some vk extension listings
memory model is 1.3 and descriptor indexing isn't required by anything

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15458>
2022-03-18 14:49:40 +00:00
Jason Ekstrand
cdaa3a899c anv: Use layerCount for clears and transitions in BeginRendering
The Vulkan spec was recently clerified to say that transitions only
happen to the bound layers:

    "Automatic layout transitions apply to the entire image subresource
    attached to the framebuffer. If multiview is not enabled and the
    attachment is a view of a 1D or 2D image, the automatic layout
    transitions apply to the number of layers specified by
    VkFramebufferCreateInfo::layers. If multiview is enabled and the
    attachment is a view of a 1D or 2D image, the automatic layout
    transitions apply to the layers corresponding to views which are
    used by some subpass in the render pass, even if that subpass does
    not reference the given attachment."

This is in the context of render passes but it applies to dynamic
rendering because the implicit layout transition stuff is a Mesa pseudo-
extension and inherits those rules.

For clears, the Vulkan spec says:

    "renderArea is the render area that is affected by the render pass
    instance. The effects of attachment load, store and multisample
    resolve operations are restricted to the pixels whose x and y
    coordinates fall within the render area on all attachments. The
    render area extends to all layers of framebuffer."

Again, this is in the context of render passes but the same principals
apply to dynamic rendering where the layerCount and renderArea are
specified as part of the vkCmdBeginRendering() call.

Fixes: 3501a3f9ed ("anv: Convert to 100% dynamic rendering")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15441>
2022-03-18 09:27:15 -05:00
Iago Toral Quiroga
4f284254e4 v3dv: support importing external semaphores
This was waiting for multisync support in our kernel interface so
we can wait on the actual imported payload of a semaphore rather
than the last job we submitted.

Reviewed-by: Melissa Wen <mwen@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15342>
2022-03-18 13:17:58 +00:00
Iago Toral Quiroga
fa1b10f36d v3dv: lock around noop job submits
Any thread we create may end up creating/submitting at least a
noop job, which is a shared object. Before multisync, this was
an issue only for the creation of the job itself, but with
multisync we can also modify parameters of the noop job
every time it is used (for signaling and serialization
configuration).

This change adds a noop mutex that all threads (main, wait and
master) take before submitting a noop job to ensure concurrent
access is not an issue.

Fixes flakyness observed with multisync with the following test:
dEQP-VK.api.command_buffers.secondary_execute_twice

Reviewed-by: Melissa Wen <mwen@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15342>
2022-03-18 13:17:58 +00:00
Iago Toral Quiroga
daa865fb2c v3dv: fix semaphore wait from CPU job
If a CPU job comes first in a command buffer with a semaphore wait operation
we need to wait on the CPU for the semaphore to be signaled before we process
the job.

We have been doing this with a WaitForIdle operation, but that only works
if the semaphore has been submitted for signaling from the same instance
of the driver. If we have an imported payload from another instance in our
semaphore however, waitForIdle may return too early since the submission
to signal the semaphore may have been submitted by a different instance
of the driver as well, and our wait for idle checks only know about this
instance submissions.

To fix this, we always submit a noop job from our instance that waits on
the semaphores on the GPU and follow up with WaitForIdle to wait for that
to complete.

Fixes test failures and/or assert crashes in:
dEQP-VK.synchronization.cross_instance.*
(when enabling support for semaphore imports)

Reviewed-by: Melissa Wen <mwen@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15342>
2022-03-18 13:17:58 +00:00
Iago Toral Quiroga
3b8ab8a9ce v3dv: don't signal semaphores/fences from a wait thread
When we have a wait thread we can't ensure that the last job in the last
command buffer will be the one to signal semaphores because in this case
there is no gurantee that jobs from command buffers in the batch will be
submitted to the GPU in order, as those put in a wait thread will be
submitted later when the event wait operation is completed.

Instead, we need to wait for all outstanding wait threads to complete
and only then we should signal any semaphores or fences.

This also fixes a bug where the wait for events was the last job in
the command buffer. In this case, once the event wait is completed
we have no additional jobs to submit and thus would never try to
signal semaphores or fences.

Reviewed-by: Melissa Wen <mwen@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15342>
2022-03-18 13:17:58 +00:00
Iago Toral Quiroga
03840bfcd1 v3dv: fix temporary imports of semaphores and fences with multisync
This is preparatory work to expose support for importing semaphores, which
was waiting on kernel multisync support.

When we implemented user-space multisync support we didn't handle
temporary fence/semaphore payload imports at all, so we fix that here.

Also, we add a has_temp boolean flag to identify the case where we have
a temporary payload in a fence/sempahore instead of just checking if
temp_sync is not 0. This is necessary to support semaphore imports
(for which we are not exposing support yet) because these need to drop
the temporary payload when they are used as wait semaphores in a submit,
but we can't destroy the underlying temp_sync at that point because it
needs to survive at least until the submit is finished, so instead
we use a flag to tell if we have an active temporary payload or not,
and we simply destroy any temp_sync on a semaphore destroy or any new
import on the same semaphore. We only strictly need this flag for
semaphores because fences drop the temporary payload when they are
reset, which happens in the CPU and can only be done if the GPU is not
using the fence, but we add the same flag for the fence for consistency.

Reviewed-by: Melissa Wen <mwen@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15342>
2022-03-18 13:17:58 +00:00
Iago Toral Quiroga
5a11a2fb6c v3dv: don't expose image load/store features for linear images
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15342>
2022-03-18 13:17:58 +00:00
Iago Toral Quiroga
0590ce1362 v3dv: return early on image to buffer blit copies if image is linear
This path uses a shader blit to implement the copy which is only
supported for tiled images (except 1D). While blit_shader() already
checks for this, this path does a lot of heavy lifting to prepare for
the blit_shader call so we rather avoid that if possible when we know
blit_shader won't be able to implement the blit.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15342>
2022-03-18 13:17:58 +00:00
Iago Toral Quiroga
397f4963ed v3dv: TFU destination must be UIF
We had some code that considered the possibility that the destination
might be linear when configuring TFU jobs, but we never actually allow
for this to happen since we avoid hitting these paths in that case, as
the TFU always produces UIF results. Instead, add an assert when
producing the TFU packet to ensure we are expecting a UIF result.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15342>
2022-03-18 13:17:58 +00:00
Mike Blumenkrantz
9e20d68785 zink: add some nice docs for batch usage and tracking
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15429>
2022-03-18 12:42:31 +00:00
Mike Blumenkrantz
3472fed4da zink: set vbo resource usage on bind
this is how other descriptor binds work, and it makes repeated draws
with the same vbo binds faster since this was a redundant operation

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15429>
2022-03-18 12:42:31 +00:00
Mike Blumenkrantz
8294d45424 zink: only update usage on buffer rebind if rebinds occurred
this is a harmless case, but it's still wrong

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15429>
2022-03-18 12:42:31 +00:00
Mike Blumenkrantz
7da211e24f zink: force-add usage when adding last-ref tracking
this fixes desync+crash when:
1. usage is added for bs A
2. tracking is added for bs B
3. tracking is removed for bs B
4. context is destroyed
5. usage A is now dangling and will crash if accessed

as seen in glmark2

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15429>
2022-03-18 12:42:31 +00:00
Alejandro Piñeiro
e3d905ec39 v3dv/pipeline: use new helper vk_shader_module_to_nir
In addition to use the helper, we also remove some of the lowering we
had at preprocess_nir, as they are called now by the helper.

As we are here we also move the call to nir_lower_sysvals_to_varyings,
that for some reason we were calling it before preprocess_nir.

It is worth to note that with this change we lose the ability to debug
the NIR just after spirv_to_nir using V3D_DEBUG, as now this is done
on vk_spirv_to_nir, and as mentioned that includes several lowerings
now. The workaround to that is to use NIR_DEBUG.

We also needed to change how to check the entrypoint on the broadcom
compiler, checking just if it is an entrypoint, instead of assuming
that the name will be "main".

v2: tweak comment, squash v3dv and compiler change (Iago)

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15449>
2022-03-18 11:05:11 +00:00
Lionel Landwerlin
8b71118aa0 anv: flush tile cache with query copy command
This fixes the test_resolve_non_issued_query_data vkd3d-proton test.

This change is required on TGL+ (maybe ICL?) because on all platforms
3D pipeline writes are not coherent with CS. On previous platform we
fixed this by flushing the render cache to make sure data is visble to
CS before it writes to memory. But on more recently platforms,
flushing the render cache leaves the data in the tile cache which is
still not coherent with CS, so we need to flush that one too.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14552>
2022-03-18 10:02:33 +00:00
Lionel Landwerlin
4e30da7874 anv: emit timestamp & availability using the same part of CS
We've run into issues before where PIPE_CONTROL races MI_STORE_*
commands. So make sure we emit the availability using the same type of
CS so that memory writes are properly ordered.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14552>
2022-03-18 10:02:33 +00:00
Juan A. Suarez Romero
730a294b90 v3dv: implement VK_EXT_line_rasterization
Allow to choose the line rasterization algorithm. It supports
rectangular and Bresenham-style line rasterization.

v2 (Iago):
 - Update documentation.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15407>
2022-03-18 09:38:38 +00:00
Juan A. Suarez Romero
22759e9174 v3dv: add subpixel precision definition
Move number of bits for subpixel precision in rasterizer to a define.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15407>
2022-03-18 09:38:38 +00:00
Juan A. Suarez Romero
b53dda6da8 broadcom: add line rasterization mode to packet definition
Add the supported line rasterization modes as enums in the XML packet
definition.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15407>
2022-03-18 09:38:38 +00:00
Juan A. Suarez Romero
102ae4bdc8 broadcom: add on-disk cache debug option
Add support for`V3D_DEBUG=cache`, which prints on-disk cache events.

v2:
 - Use same debug format for v3d and v3dv (Alejandro)

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15380>
2022-03-18 08:58:01 +00:00
Juan A. Suarez Romero
4468db20f7 v3d: add support for on-disk shader cache
It stores the compiled shaders on disk so further executions will load
them from disk instead of compiling, improving the overall performance.

This is noticeable in games where they suddenly get stuck for a while
because they start to compile one or more shaders.

v2:
 - Remove comment (Alejandro)
 - Use malloc() + helper to simplify code (Alejandro)

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15380>
2022-03-18 08:58:01 +00:00
Jason Ekstrand
a929bafc77 panvk: Only implement Get*MemoryRequirements2
The runtime code will provide the 1.0 entrypoints for us.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15436>
2022-03-18 08:15:50 +00:00
Jason Ekstrand
bc8b30ba55 panvk: Drop QueueBindSparse
Now that we've switched to the common sync/submit framework, this is
implemented in runtime/vk_queue.c.  We don't need to provide the stub.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15436>
2022-03-18 08:15:50 +00:00
Jason Ekstrand
2fc2ec17db panvk: Drop BindImage/BufferMemory
We already provide the 2 versions and the Vulkan runtime will map the
1.0 entrypoints to the 2 versions for us.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15436>
2022-03-18 08:15:50 +00:00
Jason Ekstrand
f9b773a417 panvk: Implement VK_KHR_copy_commands2
This is just 2 versions of all the copy/blit entrypoings.  The common
Vulkan runtime code will implement the 1.0 versions in terms of the 2
versions.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15436>
2022-03-18 08:15:50 +00:00
Jason Ekstrand
b573b22628 panvk: Implement VK_KHR_synchronization2
It's easier to switch to sync2 before CmdPipelineBarrier gets any more
complicated.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15436>
2022-03-18 08:15:50 +00:00
Jason Ekstrand
39c395d1d2 panvk: Move core properties into their respective core structs
Currently, we only support a few features from 1.1.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15436>
2022-03-18 08:15:50 +00:00
Jason Ekstrand
ff30dd11a7 panvk: Re-arrange GetPhysicalDeviceProperties2
Put the 1.0 properties and limits first.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15436>
2022-03-18 08:15:50 +00:00
Jason Ekstrand
34139d9f51 panvk: Add a 1.3 features struct
The only thing that gets pulled into this is private data.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15436>
2022-03-18 08:15:50 +00:00
Jason Ekstrand
dd03dba7fd panvk: Re-arrange GetPhysicalDeviceFeatures2
Put the 1.0 features at top followed by 1.1 and then 1.2.  For filling
out the actual 1.1 and 1.2 structs, use the helpers.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15436>
2022-03-18 08:15:50 +00:00
Iago Toral Quiroga
5c1302f47c v3dv: expose VK_EXT_image_drm_format_modifier
This has been implemented for a while but we could not expose it on
Vulkan 1.0 because the extension declares a dependency on
VK_KHR_sampler_ycbcr_conversion, which we don't implement, and
CTS would complain.

On Vulkan 1.1 however, VK_KHR_sampler_ycbcr_conversion was promoted
to core as an optional feature, and this is enough for the the
dependency to be satisfied, even if the feature is not supported,
meaning that we can now expose the extension.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15426>
2022-03-18 06:42:06 +00:00
Dave Airlie
cdd1b86591 lavapipe: add EXT_texel_buffer_alignment support.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15442>
2022-03-18 04:45:32 +00:00
Mike Blumenkrantz
efa724133f zink: flag sample locations for re-set on batch flush
this needs to be re-set any time the cmdbuf changes

cc: mesa-stable

Tested-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15397>
2022-03-18 04:31:49 +00:00
Ian Romanick
19330eeb1d intel/fs: Force destination types on DP4A instructions
Most of the time, this doesn't matter.  On the versions with _sat, if
the destination type is incorrect, the clamping will not happen
correctly.

Fixes the following CTS tests:

dEQP-VK.spirv_assembly.instruction.compute.opudotaccsatkhr.all_packed_ss_v4i8_out32
dEQP-VK.spirv_assembly.instruction.compute.opudotaccsatkhr.all_packed_su_v4i8_out32
dEQP-VK.spirv_assembly.instruction.compute.opudotaccsatkhr.all_packed_us_v4i8_out32
dEQP-VK.spirv_assembly.instruction.compute.opudotaccsatkhr.all_packed_uu_v4i8_out32
dEQP-VK.spirv_assembly.instruction.compute.opudotaccsatkhr.all_ss_v4i8_out32
dEQP-VK.spirv_assembly.instruction.compute.opudotaccsatkhr.all_su_v4i8_out32
dEQP-VK.spirv_assembly.instruction.compute.opudotaccsatkhr.all_us_v4i8_out32
dEQP-VK.spirv_assembly.instruction.compute.opudotaccsatkhr.all_uu_v4i8_out32
dEQP-VK.spirv_assembly.instruction.compute.opudotaccsatkhr.limits_packed_ss_v4i8_out32
dEQP-VK.spirv_assembly.instruction.compute.opudotaccsatkhr.limits_packed_su_v4i8_out32
dEQP-VK.spirv_assembly.instruction.compute.opudotaccsatkhr.limits_packed_us_v4i8_out32
dEQP-VK.spirv_assembly.instruction.compute.opudotaccsatkhr.limits_packed_uu_v4i8_out32
dEQP-VK.spirv_assembly.instruction.compute.opudotaccsatkhr.limits_ss_v4i8_out32
dEQP-VK.spirv_assembly.instruction.compute.opudotaccsatkhr.limits_su_v4i8_out32
dEQP-VK.spirv_assembly.instruction.compute.opudotaccsatkhr.limits_us_v4i8_out32
dEQP-VK.spirv_assembly.instruction.compute.opudotaccsatkhr.limits_uu_v4i8_out32
dEQP-VK.spirv_assembly.instruction.compute.opudotaccsatkhr.small_packed_ss_v4i8_out32
dEQP-VK.spirv_assembly.instruction.compute.opudotaccsatkhr.small_packed_su_v4i8_out32
dEQP-VK.spirv_assembly.instruction.compute.opudotaccsatkhr.small_packed_us_v4i8_out32
dEQP-VK.spirv_assembly.instruction.compute.opudotaccsatkhr.small_packed_uu_v4i8_out32
dEQP-VK.spirv_assembly.instruction.compute.opudotaccsatkhr.small_ss_v4i8_out32
dEQP-VK.spirv_assembly.instruction.compute.opudotaccsatkhr.small_su_v4i8_out32
dEQP-VK.spirv_assembly.instruction.compute.opudotaccsatkhr.small_us_v4i8_out32
dEQP-VK.spirv_assembly.instruction.compute.opudotaccsatkhr.small_uu_v4i8_out32

v2: Update anv-tgl-fails.txt.

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Fixes: 0f809dbf40 ("intel/compiler: Basic support for DP4A instruction")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15417>
2022-03-17 22:39:04 +00:00
Felix DeGrood
3bd9b25060 intel: change INTEL_MEASURE output to microseconds
Change time event durations from ns -> us. Microseconds are easier
to work with.

Reviewed-by: Mark Janes <markjanes@swizzler.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15348>
2022-03-17 22:14:42 +00:00
Felix DeGrood
2e6d14cc7b intel: increase INTEL_MEASURE batch/buffer sizes
Increase default batch_size and buffer_size from 16 -> 64. These
are sized to be big enough to service most games. As games have
become more demanding, larger sizes become necessary.

Reviewed-by: Mark Janes <markjanes@swizzler.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15348>
2022-03-17 22:14:42 +00:00
Felix DeGrood
e0c9032db8 anv: add indirect draw to INTEL_MEASURE
Reviewed-by: Mark Janes <markjanes@swizzler.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15348>
2022-03-17 22:14:42 +00:00
Dave Airlie
f452317849 clover/nir: respect lower to scalar options.
This just calls the lower alu to scalar pass like mesa/st

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15433>
2022-03-17 22:00:49 +00:00
Dave Airlie
f34260bbf7 vulkan: update vk video headers for new vulkan headers.
These got out of sync update to the latest video headers.

Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15434>
2022-03-17 21:14:28 +00:00
Connor Abbott
3d04c43576 tu: Trivially implement VK_EXT_texel_buffer_alignment
The previous alignment of 64 bytes, which we got from the blob,
indicates that single-texel alignment isn't supported. So just do a
trivial no-op implementation that returns the same alignment as before.
This matches what newer blobs that expose this extension do.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15427>
2022-03-17 20:45:19 +00:00
Rhys Perry
177b54ebe9 aco/tests: add v_fma_mix tests
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14769>
2022-03-17 19:04:17 +00:00
Rhys Perry
1092f37805 aco: use v_fma_mix to combine mul/add/fma output conversions
fossil-db (Sienna Cichlid):
Totals from 42 (0.03% of 134913) affected shaders:
CodeSize: 596904 -> 596332 (-0.10%); split: -0.10%, +0.00%
Instrs: 110194 -> 109902 (-0.26%)
Latency: 1205239 -> 1204915 (-0.03%); split: -0.03%, +0.00%
InvThroughput: 189697 -> 189375 (-0.17%)
VClause: 1365 -> 1366 (+0.07%)
Copies: 5429 -> 5414 (-0.28%); split: -0.33%, +0.06%
Branches: 4034 -> 4026 (-0.20%)

fossil-db (Navi):
Totals from 42 (0.03% of 134913) affected shaders:
CodeSize: 596044 -> 595488 (-0.09%); split: -0.10%, +0.00%
Instrs: 110845 -> 110540 (-0.28%)
Latency: 1206131 -> 1205747 (-0.03%)
InvThroughput: 190178 -> 189809 (-0.19%)
VClause: 1372 -> 1370 (-0.15%); split: -0.29%, +0.15%
Copies: 5671 -> 5641 (-0.53%); split: -0.56%, +0.04%
Branches: 4033 -> 4025 (-0.20%)

fossil-db (Vega):
Totals from 42 (0.03% of 135048) affected shaders:
CodeSize: 605824 -> 605352 (-0.08%); split: -0.08%, +0.00%
Instrs: 115975 -> 115706 (-0.23%)
Latency: 1399845 -> 1398912 (-0.07%)
InvThroughput: 489901 -> 489442 (-0.09%)
VClause: 1314 -> 1311 (-0.23%); split: -0.38%, +0.15%
Copies: 9673 -> 9666 (-0.07%); split: -0.12%, +0.05%
Branches: 4025 -> 4024 (-0.02%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14769>
2022-03-17 19:04:17 +00:00
Rhys Perry
21304b772c aco: apply clamp to v_fma_mix
fossil-db (Sienna Cichlid):
Totals from 2536 (1.88% of 134913) affected shaders:
CodeSize: 17314568 -> 17282960 (-0.18%)
Instrs: 3191438 -> 3187487 (-0.12%)
Latency: 59465090 -> 59407885 (-0.10%)
InvThroughput: 10271466 -> 10260512 (-0.11%)

fossil-db (Navi):
Totals from 2512 (1.86% of 134913) affected shaders:
CodeSize: 17194700 -> 17173396 (-0.12%)
Instrs: 3215093 -> 3212430 (-0.08%)
Latency: 60174315 -> 60142593 (-0.05%)
InvThroughput: 9491103 -> 9483979 (-0.08%)

fossil-db (Vega):
Totals from 2512 (1.86% of 135048) affected shaders:
CodeSize: 17186776 -> 17165472 (-0.12%)
Instrs: 3311166 -> 3308503 (-0.08%)
Latency: 65737409 -> 65716096 (-0.03%)
InvThroughput: 21735857 -> 21719792 (-0.07%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14769>
2022-03-17 19:04:17 +00:00
Rhys Perry
35196b6d89 aco: combine add/mul as v_fma_mix into fma
fossil-db (Sienna Cichlid):
Totals from 7345 (5.44% of 134913) affected shaders:
CodeSize: 73840060 -> 73768936 (-0.10%); split: -0.10%, +0.00%
Instrs: 13701603 -> 13684183 (-0.13%); split: -0.13%, +0.00%
Latency: 185389373 -> 185306538 (-0.04%); split: -0.04%, +0.00%
InvThroughput: 33785020 -> 33757593 (-0.08%); split: -0.08%, +0.00%
VClause: 237337 -> 237338 (+0.00%)
SClause: 485728 -> 485720 (-0.00%)
Copies: 935900 -> 935279 (-0.07%); split: -0.07%, +0.00%
Branches: 480721 -> 480722 (+0.00%)

fossil-db (Navi):
Totals from 10649 (7.89% of 134913) affected shaders:
VGPRs: 756624 -> 756516 (-0.01%); split: -0.02%, +0.01%
CodeSize: 92156580 -> 91707900 (-0.49%); split: -0.49%, +0.00%
MaxWaves: 159402 -> 159476 (+0.05%); split: +0.07%, -0.02%
Instrs: 17155827 -> 17070449 (-0.50%); split: -0.50%, +0.00%
Latency: 246296456 -> 245487120 (-0.33%); split: -0.33%, +0.00%
InvThroughput: 41438159 -> 41117424 (-0.77%); split: -0.77%, +0.00%
VClause: 323790 -> 323867 (+0.02%); split: -0.00%, +0.03%
SClause: 612077 -> 612034 (-0.01%); split: -0.01%, +0.00%
Copies: 1103012 -> 1102775 (-0.02%); split: -0.03%, +0.01%
Branches: 555893 -> 555896 (+0.00%); split: -0.00%, +0.00%
PreSGPRs: 824372 -> 824378 (+0.00%)
PreVGPRs: 740390 -> 740363 (-0.00%); split: -0.01%, +0.01%

fossil-db (Vega):
Totals from 10950 (8.11% of 135048) affected shaders:
SGPRs: 1034528 -> 1034560 (+0.00%)
VGPRs: 794092 -> 794104 (+0.00%); split: -0.01%, +0.01%
CodeSize: 94409768 -> 93955568 (-0.48%); split: -0.48%, +0.00%
MaxWaves: 38950 -> 38939 (-0.03%); split: +0.00%, -0.03%
Instrs: 18162637 -> 18070934 (-0.50%); split: -0.51%, +0.00%
Latency: 291718455 -> 290772451 (-0.32%); split: -0.32%, +0.00%
InvThroughput: 109114674 -> 108489767 (-0.57%); split: -0.57%, +0.00%
VClause: 334498 -> 334579 (+0.02%); split: -0.01%, +0.03%
SClause: 628871 -> 628825 (-0.01%); split: -0.01%, +0.00%
Copies: 1674477 -> 1674850 (+0.02%); split: -0.02%, +0.04%
PreSGPRs: 834800 -> 834802 (+0.00%)
PreVGPRs: 750460 -> 750415 (-0.01%); split: -0.01%, +0.01%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14769>
2022-03-17 19:04:17 +00:00
Rhys Perry
9934c86761 aco: use v_fma_mix to combine mul/add/fma input conversions
fossil-db (Sienna Cichlid):
Totals from 11558 (8.57% of 134913) affected shaders:
VGPRs: 829392 -> 825200 (-0.51%); split: -0.52%, +0.02%
SpillSGPRs: 7845 -> 8399 (+7.06%)
CodeSize: 101822704 -> 101677172 (-0.14%); split: -0.25%, +0.11%
MaxWaves: 172216 -> 173182 (+0.56%); split: +0.59%, -0.03%
Instrs: 19061343 -> 18883450 (-0.93%); split: -0.93%, +0.00%
Latency: 256011590 -> 255177378 (-0.33%); split: -0.39%, +0.06%
InvThroughput: 46104438 -> 45604059 (-1.09%); split: -1.12%, +0.04%
VClause: 352211 -> 351948 (-0.07%); split: -0.21%, +0.13%
SClause: 676506 -> 676961 (+0.07%); split: -0.04%, +0.11%
Copies: 1246571 -> 1237745 (-0.71%); split: -0.97%, +0.26%
Branches: 626229 -> 626241 (+0.00%); split: -0.02%, +0.03%
PreSGPRs: 882176 -> 888853 (+0.76%); split: -0.00%, +0.76%
PreVGPRs: 796705 -> 792304 (-0.55%); split: -0.56%, +0.00%

fossil-db (Navi):
Totals from 11558 (8.57% of 134913) affected shaders:
VGPRs: 803900 -> 798660 (-0.65%); split: -0.73%, +0.08%
SpillSGPRs: 7894 -> 8492 (+7.58%); split: -0.10%, +7.68%
CodeSize: 96892596 -> 97134716 (+0.25%); split: -0.05%, +0.29%
MaxWaves: 181454 -> 183014 (+0.86%); split: +0.94%, -0.08%
Instrs: 18186813 -> 18093994 (-0.51%); split: -0.56%, +0.05%
Latency: 253385909 -> 253325528 (-0.02%); split: -0.15%, +0.12%
InvThroughput: 43315355 -> 42805541 (-1.18%); split: -1.33%, +0.15%
VClause: 338755 -> 338535 (-0.06%); split: -0.16%, +0.10%
SClause: 656561 -> 656829 (+0.04%); split: -0.07%, +0.11%
Copies: 1162235 -> 1153558 (-0.75%); split: -1.07%, +0.32%
Branches: 588536 -> 588542 (+0.00%); split: -0.03%, +0.03%
PreSGPRs: 854849 -> 861640 (+0.79%); split: -0.00%, +0.80%
PreVGPRs: 783401 -> 779031 (-0.56%); split: -0.56%, +0.00%

fossil-db (Vega):
Totals from 11516 (8.53% of 135048) affected shaders:
SGPRs: 1072128 -> 1076288 (+0.39%); split: -0.01%, +0.40%
VGPRs: 821312 -> 818124 (-0.39%); split: -0.43%, +0.04%
SpillSGPRs: 11952 -> 12677 (+6.07%)
CodeSize: 96378496 -> 96707596 (+0.34%); split: -0.04%, +0.38%
MaxWaves: 42614 -> 42883 (+0.63%); split: +0.68%, -0.04%
Instrs: 18672844 -> 18600274 (-0.39%); split: -0.44%, +0.05%
Latency: 296658786 -> 296338296 (-0.11%); split: -0.21%, +0.10%
InvThroughput: 111665547 -> 111283559 (-0.34%); split: -0.40%, +0.06%
VClause: 343001 -> 342826 (-0.05%); split: -0.14%, +0.09%
SClause: 646684 -> 646657 (-0.00%); split: -0.05%, +0.04%
Copies: 1715316 -> 1712895 (-0.14%); split: -0.53%, +0.39%
PreSGPRs: 850737 -> 856543 (+0.68%); split: -0.04%, +0.72%
PreVGPRs: 775293 -> 772215 (-0.40%); split: -0.41%, +0.02%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14769>
2022-03-17 19:04:17 +00:00
Rhys Perry
eeef1bbe65 aco: refactor selection of mad/fma
In the future, whether we need to use fma will depend on which
multiplication is chosen.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14769>
2022-03-17 19:04:17 +00:00
Rhys Perry
e12bee3cb7 aco: improve support for v_fma_mix
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14769>
2022-03-17 19:04:17 +00:00
Rhys Perry
79c8740c6e aco: fix fp16 opcode definitions
The v_fma_mix optimizations assume v_cvt_f16_f32 and v_mul_f16 use a v2b
definition.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14769>
2022-03-17 19:04:17 +00:00
Dylan Baker
6d4eb4a72e mesa/main: replace use of simple_list with util/list
Because really, do we want simple_list?

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14983>
2022-03-17 18:25:55 +00:00
Dylan Baker
4b10a4aaaa util/list.h: Add docstrings for list_add and list_addtail
Which have easily confused parameters: the first argument is the item to
be added, the second is the list to add to; but this could easily be the
other way around.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14983>
2022-03-17 18:25:55 +00:00
Alyssa Rosenzweig
b0faf422b7 pan/va: Use XML for special FAU page 0
Now all special FAU handling is unified, which makes both assembler and
disassembler considerably nicer. This adds some more special FAU indices from
page 0 that were previously missing, allowing them to be assembled and
disasembled.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15364>
2022-03-17 18:06:17 +00:00
Alyssa Rosenzweig
31a171d92d pan/va: Use boring names for FAU special pages 1/3
There's no magic underlying interpretation, be.. uniform.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15364>
2022-03-17 18:06:17 +00:00
Alyssa Rosenzweig
76159ee379 pan/va: Remove immediate modes from XML/asm
Now replaced by inference in the assembler, as they should be.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15364>
2022-03-17 18:06:17 +00:00
Alyssa Rosenzweig
81498f1538 pan/va: Use 64-bit special FAU for pages 1 and 3
This aligns with how the hardware actually sees special FAU.

Also fix the names while we're at it.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15364>
2022-03-17 18:06:17 +00:00
Alyssa Rosenzweig
139867cb43 pan/va: Rename imm_mode -> fau_page
In accordance with new information on the hardware.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15364>
2022-03-17 18:06:17 +00:00
Alyssa Rosenzweig
3bd1401075 pan/va: Handle uniforms from page 1
Like Bifrost, Valhall can access 2x as many fast acess uniforms as previously
thought. However, on Valhall this requires using the pagination mechanism.
Support this in the dis/assembler.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15364>
2022-03-17 18:06:17 +00:00
Alyssa Rosenzweig
cf43a1cc58 pan/va: Rewrite FAU handling in dis/assembler
FAU pages do not need to be specified explicitly in the assembly. Rather, they
should be inferred by the assembler by the instructions used. Rewrite the code
handling this in alignment with new information about the hardware.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15364>
2022-03-17 18:06:17 +00:00
Alyssa Rosenzweig
95b7908d2d pan/va: Fix BLEND instruction
There's only one staging register, the other register is just offset due to the
Msg64 source.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15364>
2022-03-17 18:06:17 +00:00
Alyssa Rosenzweig
c7e8e8b319 pan/va: Handle 64-bit sources in message instrs
These take up two slots, reading an aligned register pair, even though they are
in a 32-bit instruction. Required to correctly model BLEND.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15364>
2022-03-17 18:06:17 +00:00
Alyssa Rosenzweig
9878469833 pan/va: Add start property to source
The bit position of sources is more complicated than (8 * index). Make it a part
of the Valhall reflection information.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15364>
2022-03-17 18:06:17 +00:00
Alyssa Rosenzweig
5a759140b0 pan/va: Fix typo in BLEND text
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15364>
2022-03-17 18:06:17 +00:00
Tomeu Vizoso
96e17287b4 ci/freedreno: Disable a618 jobs
Some of these machines are experiencing networking problems currently.
Disable for now so people aren't blocked.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15430>
2022-03-17 17:43:06 +00:00
Erik Faye-Lund
115298b71e gallium: rename ballot cap
This cap is no longer TGSI specific, so let's rename it to reflect
reality.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15316>
2022-03-17 16:44:42 +00:00
Erik Faye-Lund
b3ce733da9 gallium: rename clock cap
This cap is no longer TGSI specific, so let's rename it to reflect
reality.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15316>
2022-03-17 16:44:42 +00:00
Erik Faye-Lund
7984c5884c gallium: rename group-vote cap
This cap is no longer TGSI specific, so let's rename it to reflect
reality.

Because the name got a bit vague when removing the TGSI-bits, let's add
some more details to the name.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15316>
2022-03-17 16:44:42 +00:00
Erik Faye-Lund
a6d7ead686 gallium: rename texture query samples cap
This isn't specific to TGSI, so let's update the name to reflect
reality.

Because the name of the opcode was TGSI specific, let's pick a new one,
based on the naming of the PIPE_CAP_TEXTURE_QUERY_LOD cap.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15316>
2022-03-17 16:44:42 +00:00
Erik Faye-Lund
930b38e7cd gallium: rename read-outputs cap
This cap is no longer TGSI-specific, so let's update the name to reflect
reality.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15316>
2022-03-17 16:44:42 +00:00
Erik Faye-Lund
2dff9bea4f gallium: rename array-components cap
This cap is no longer TGSI specific, so let's update the name to reflect
reality.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15316>
2022-03-17 16:44:42 +00:00
Erik Faye-Lund
350329feb1 gallium: rename sysval caps
These aren't spiecic to TGSI any more, so let's rename them to reflect
reality.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15316>
2022-03-17 16:44:42 +00:00
Erik Faye-Lund
df40de91d9 gallium: rename fine derivative cap
This is no longer TGSI specific, so let's rename it to reflect the
reality.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15316>
2022-03-17 16:44:42 +00:00
Erik Faye-Lund
2a8e11e101 gallium: rename pixel-coord caps
These aren't specific to TGSI, so let's rename them to reflect the
reality.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15316>
2022-03-17 16:44:42 +00:00
Erik Faye-Lund
89797fac56 gallium: rename layer-viewport caps
Similar to the previous commits, these aren't TGSI specific, so let's
drop TGSI from their name.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15316>
2022-03-17 16:44:41 +00:00
Erik Faye-Lund
8ac7dc9cf6 gallium: rename vs instance id cap
This cap is no longer specific to TGSI, so let's rename it and update
the documentation to reflect that.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15316>
2022-03-17 16:44:41 +00:00
Erik Faye-Lund
f8809fbdb8 gallium: rename pack half-float cap
This cap no longer has anything to do with TGSI, as the lowering happens
on GLSL IR, and applies just as much to NIR drivers. So let's rename
this cap and update the docs to reflect the current situation.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15316>
2022-03-17 16:44:41 +00:00
Jason Ekstrand
0f048c5782 panvk: Convert to the common sync/submit framework
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15296>
2022-03-17 16:22:10 +00:00
Lionel Landwerlin
d68b9f0e6b anv: zero-out anv_batch_bo
anv_batch_bo has a length field that we use to flush cachelines. Not
having that field initialized properly leads us to access out of bound
memory.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15425>
2022-03-17 15:56:14 +00:00
Lionel Landwerlin
78acae3865 anv: fix variable shadowing
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 83fee30e85 ("anv: allow multiple command buffers in anv_queue_submit")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15425>
2022-03-17 15:56:14 +00:00
Samuel Pitoiset
174d086e8c radv: enable radv_disable_aniso_single_level for DXVK/vkd3d
It seems the default D3D behavior and it's complicated to emulate this
in DXVK/vkd3d. Enable it by default to prevent rendering issues in
other games not listed here.

Cc: 22.0 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15368>
2022-03-17 15:10:06 +00:00
Samuel Pitoiset
590eb9d640 radv: do not compute the cache UUID for LLVM if it's not used
If the LLVM version (even minor) isn't the same on the OS that
precompiles shaders vs the OS that runs them, the cache UUID would
be different, even if only ACO is used.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15406>
2022-03-17 14:49:35 +00:00
Sagar Ghuge
2e336c602d intel/fs: Add Wa_14014435656
For any fence greater than local scope, always set flush type to at
least invalidate so that fence goes on properly.

v2: Fixup condition to trigger workaround (Lionel)

v3: Simplify workaround (Curro)

v4: Don't drop the existing WA (Curro)

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: 22.0 <mesa-stable>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14947>
2022-03-17 14:18:02 +00:00
Sagar Ghuge
6031ad4bf6 intel/fs: Add Wa_22013689345
v2: Use a simpler framework (Lionel)

v3: Rebase, add task/mesh (Lionel)

v4: Fixup fence exec size (SIMDX -> SIMD1)

v5: Fix invalidate_analysis, add finishme comment (Curro)

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: 22.0 <mesa-stable>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14947>
2022-03-17 14:18:02 +00:00
Anuj Phogat
5cc4075f95 anv, iris: Add Wa_16011411144 for DG2
v2: Use CS_STALL instead of FLUSH_ENABLE in Iris (Lionel)
    Add missing CS_STALL after SO_BUFFER change in Anv (Lionel)

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> (v1)
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: 22.0 <mesa-stable>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14947>
2022-03-17 14:18:02 +00:00
Juan A. Suarez Romero
c432bfe74b broadcom/ci: Update flake list
Some of the tests marked as flake didn't show up as flakes for a long
time (more than 3 months). So likely they are already fixed.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15411>
2022-03-17 13:56:41 +00:00
Connor Abbott
072fdcabcd tu: Enable UniformBufferUpdateAfterBind
UBOs are now read at run-time via the preamble so this can be enabled.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13148>
2022-03-17 12:15:45 +00:00
Connor Abbott
9932ca8a3f ir3, turnip: Use ldc.k to push UBOs
This reuses the same UBO analysis to do the pushing in the shader
preamble via the ldc.k instruction instead of in the driver via
CP_LOAD_STATE6. The const_data UBO is exempted as it uses a different
codepath that isn't as critical.

Don't do this on gallium because there are some regressions. Aztec Ruins
in particular regresses a bit, and nothing I've benchmarked benefits.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13148>
2022-03-17 12:15:45 +00:00
Connor Abbott
221a912b8c ir3: Refactor ir3_compiler_create() to take an options struct
This will let us add more options without creating too much churn.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13148>
2022-03-17 12:15:45 +00:00
Connor Abbott
acba08b58f ir3: Implement and document ldc.k
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13148>
2022-03-17 12:15:45 +00:00
Connor Abbott
fccc35c2de ir3: Add preamble optimization pass
Now that everything is plumbed through, we can tie it together.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13148>
2022-03-17 12:15:45 +00:00
Connor Abbott
986f7adfee ir3: Don't include preamble instructions in stats
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13148>
2022-03-17 12:15:45 +00:00
Connor Abbott
42e21c751b ir3: Insert frag coord code after preamble
To match the pre-preamble behavior, and so that we can better schedule
it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13148>
2022-03-17 12:15:45 +00:00
Connor Abbott
b6fe69d855 ir3: Support prefetching with preambles
Since the NIR pass runs very late, it needs to be aware of preambles,
and when creating the instruction we need to move it to the start block
so that RA doesn't overwrite it in the preamble.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13148>
2022-03-17 12:15:45 +00:00
Connor Abbott
00d7ad334a ir3/legalize: Handle inserting (ei) with preamble
Make sure that shaders with a preamble are still considered
early-release so that we don't regress them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13148>
2022-03-17 12:15:45 +00:00
Connor Abbott
ccc64b7e00 ir3: Plumb through store_uniform_ir3 intrinsic
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13148>
2022-03-17 12:15:45 +00:00
Connor Abbott
944f4e6f8a ir3: Better assemble/disassemble stc
Add in the type, even though it turns out to not be that useful. Add
in support for assembling it. Add some notes based on computerator
experiments. And add support for the indirect a1.x mode that's needed
for storing c64.x and later.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13148>
2022-03-17 12:15:45 +00:00
Connor Abbott
3244e659e0 ir3: Implement basic shader preamble intrinsics
These will be used to implement the ir3-specific shader preamble
lowering in NIR. shps is conceptually similar to getone (although it
technically can't be duplicated) and shpe is similar to other barriers,
since it has to happen after any stores to the constant file in the
preamble. Add NIR intrinsics and plumbs them through ir3.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13148>
2022-03-17 12:15:45 +00:00
Connor Abbott
7ad57d9af1 ir3: Don't count reserved user consts in ubo_state::size
Previously we included the reserved user consts (for Vulkan push
constants) as part of the pushed UBO contents, but that led to a problem
because when calculating the worst-case space for UBOs we didn't factor
in the reserved user consts. We'll have the same problem when doing the
same thing in the preamble optimization pass. Stop including the
reserved size in ubo_state::size, and have ir3_setup_consts() add it in
instead, so we won't forget to add it anywhere.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13148>
2022-03-17 12:15:45 +00:00
Connor Abbott
e274354204 ir3: Fix scan.macro valid flags
Right now we don't support any. We could probably support const, but
that's not worth it because we could optimize a reduce of a const better
anyway.

Fixes: 1a78604d20 ("ir3: Add support for subgroup arithmetic")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13148>
2022-03-17 12:15:45 +00:00
Connor Abbott
3b96ad70ee nir: Add a preamble optimization pass
This pass tries to move computations that are uniform for the entire
draw to the preamble. There's also an API for backends to insert their
own instructions into the preamble, for porting existing UBO pushing
passes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13148>
2022-03-17 12:15:45 +00:00
Connor Abbott
31221ee556 nir: Add a "deep" instruction clone
For the shader preamble, we need to add support for cloning one
instruction at a time into the preamble, but we also need to rewrite
sources.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13148>
2022-03-17 12:15:45 +00:00
Connor Abbott
d1b017d479 nir: Add preamble functions
These are functions that run before the entrypoint at least once per
draw and write their results via store_preamble, and then are loaded in
the rest of the shader via load_preamble.

We will add users in the following commits.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13148>
2022-03-17 12:15:45 +00:00
Juan A. Suarez Romero
dfb6438392 v3dv: change MESA_GLSL_CACHE envvar reference
This was renamed to MESA_SHADER_CACHE.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15390>
2022-03-17 11:16:45 +01:00
Juan A. Suarez Romero
1350e7b607 radv: change MESA_GLSL_CACHE envvar reference
This was renamed to MESA_SHADER_CACHE.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15390>
2022-03-17 11:16:45 +01:00
Juan A. Suarez Romero
fb856c9501 ci: use MESA_SHADER_CACHE envvar
This was renamed from MESA_GLSL_CACHE.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15390>
2022-03-17 11:15:53 +01:00
Juan A. Suarez Romero
54d0a2cfad util/disk_cache: rename MESA_GLSL_CACHE envvar
Rename MESA_GLSL_CACHE to MESA_SHADER_CACHE, as the on-disk cache can
store not only GLSL but also SPIR-V shaders.

v2:
 - Keep old envvar as deprecated (Mike)

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15390>
2022-03-17 11:15:53 +01:00
Igor Torrente
6d7f04e5de venus: add VK_EXT_calibrated_timestamps extension
Implements all the necessary code in the device initialization
and extension functions.

Signed-off-by: Igor Torrente <igor.torrente@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15389>
2022-03-17 00:02:21 +00:00
Igor Torrente
88638ceb2d venus: move vkGetCalibratedTimestamps to vn_protocol_driver_device.h
Update venus-protocol files to move vkGetCalibratedTimestamps function
from vn_protocol_driver_transport.h to vn_protocol_driver_device.h.

Signed-off-by: Igor Torrente <igor.torrente@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15389>
2022-03-17 00:02:21 +00:00
Emma Anholt
da834a12cf vulkan: Make sure we've loaded our connectors when querying plane props.
If you hadn't already called wsi_GetPhysicalDeviceDisplayProperties2KHR or
wsi_GetDrmDisplayEXT before calling
GetPhysicalDeviceDisplayPlaneProperties2KHR, then the connectors list
wouldn't be populated and you'd get no plane properties.  Fixes failure of
dEQP-VK.wsi.display.get_display_plane_capabilities when run on its own.

Fixes: #4575
Cc: mesa-stable
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15353>
2022-03-16 21:43:46 +00:00
Gurchetan Singh
83de19c900 zink: emulate some more memory
If ZINK_HEAP_DEVICE_LOCAL_VISIBLE isn't available natively, then
fallback to device local memory without asserting.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15202>
2022-03-16 21:03:16 +00:00
Emma Anholt
9e9a366cad ci/turnip: Drop alpha_to-coverage flake note on a618.
It's only ever been seen on a630.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14839>
2022-03-16 19:28:04 +00:00
Emma Anholt
2f25d16653 turnip: Use the DRM or KGSL GPU reset status ioctls to report device loss.
ANGLE-on-venus-on-turnip and zink-on-turnip want real data here for EGL's
reset tests.

This required moving the remaining GPU-reset-causing tests from flakes or
xfails to skips.  Otherwise, the rest of the caselist associated with them
ends up being marked as fails as well.  The alternative would be to put
these tests in their own test groups with tests_per_group = 1, but that
didn't seem worth the effort.  Or, we could finally do something with
https://gitlab.freedesktop.org/anholt/deqp-runner/-/issues/14.

Fixes: #5955
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14839>
2022-03-16 19:28:04 +00:00
Emma Anholt
add2121969 ci/freedreno: Remove some xfails for tests that now skip.
The last CTS uprev correctly turned them into NotSupported.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14839>
2022-03-16 19:28:04 +00:00
Emma Anholt
ffa9438183 ci/freedreno: Drop the skips of spirv_ids_abuse in pre-merge.
The crash was fixed in 62a7acee93, and
runtime of the tests locally is 5-17s each with a hot shader cache, 11-25s
without.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14839>
2022-03-16 19:28:04 +00:00
Emma Anholt
46b30a5589 ci/lvp: Stop skipping spv-stable-maze-flatten-copy-composite
The runtime was fixed in VK-GL-CTS
1751124d2870840bada579c236a66d38b48c039b, now it's just 1 second.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14839>
2022-03-16 19:28:04 +00:00
Emma Anholt
5dd74533b2 ci: Drop skips of spv-stable-pillars-volatile-nontemporal-store
The runtime was fixed in VK-GL-CTS
7cc65f6c02276767407233e74c7174d88dab7919.  Now it's .6s on lvp, 20ms on
turnip a618.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14839>
2022-03-16 19:28:04 +00:00
Jason Ekstrand
893fa30afe anv: Include scissors in viewport calculations
It's tricky to always get the render area to the viewport code.  In
particular, it's not provided to secondary command buffers as part of
the inheritance info so we have to bend over backwards and look for a
framebuffer.  With VK_KHR_dynamic_rendering, there is no framebuffer and
this approach won't work and we'll need something better if we want
competent guardbands in secondary command buffers.

The good news is that any client that's sloppily rendering and trusting
the clipper to keep things inside the render area will set a scissor and
that's something they have to set inside the secondary.  We can dig
through the scissor state and also include the corresponding scissor (if
any) and use that for our render area.  This should give us the same
secondary command buffer performance with VK_KHR_dynamic_rendering.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14961>
2022-03-16 13:13:45 -05:00
Jason Ekstrand
b4e38e174f anv: Move viewport/scissor emit to genX_cmd_buffer.c
There's never been a particularly good reason to stick these in gfx7/8.
We mostly did it to deduplicate the binary a bit but this shouldn't emit
all that much code.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14961>
2022-03-16 13:13:45 -05:00
Jason Ekstrand
2c04373c45 anv: Calculate the real guardband based on render area
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14961>
2022-03-16 13:13:45 -05:00
Jason Ekstrand
12d815bcac intel/guardband: Take min/max instead of total size
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14961>
2022-03-16 13:13:45 -05:00
Jason Ekstrand
d89d6c7a4d docs: Add high-level documentation for Vulkan render passes
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14961>
2022-03-16 13:13:45 -05:00
Jason Ekstrand
7521b5db18 docs: Add the start of Vulkan runtime docs
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14961>
2022-03-16 13:13:45 -05:00
Jason Ekstrand
3501a3f9ed anv: Convert to 100% dynamic rendering
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14961>
2022-03-16 13:13:36 -05:00
Jason Ekstrand
8112e6d601 anv: Drop pipeline pass/subpass in favor of rendering_info
This is about the only "small" change we can make in the process of
converting from render-pass-based to dynamic-rendering-based.  Make
everything in pipeline creation work in terms of dynamic rendering and
create the dynamic rendering structs from the render pass as-needed.

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14961>
2022-03-16 12:51:16 -05:00
Jason Ekstrand
ee9c068043 anv/pipeline: Stop pretending we're the validator
This was ill-conceived at best.  Yes, it checks for a few error
conditions but it doesn't check much and what checks it has are very far
away from the code that relies on those invariants.  If we care about
these invariants, we should add asserts near the code that makes those
assumptions rather than pretending to be the validation layers.

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14961>
2022-03-16 12:51:16 -05:00
Jason Ekstrand
2da152b5e6 anv: Stop treating color input attachments specially
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14961>
2022-03-16 12:51:15 -05:00
Jason Ekstrand
1ad0f1b004 anv/pass: Make unused color attachments VK_ATTACHMENT_UNUSED
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14961>
2022-03-16 12:51:15 -05:00
Jason Ekstrand
9bbecbed7a anv: Better null surface state size for dynamic rendering
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14961>
2022-03-16 12:51:15 -05:00
Jason Ekstrand
fff3f8bfe5 anv: Fix handling of null depth/stencil attachments with dynamic rendering
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14961>
2022-03-16 12:51:15 -05:00
Jason Ekstrand
030b231ba9 vulkan/framebuffer: Add a flags field
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14961>
2022-03-16 12:51:15 -05:00
Jason Ekstrand
c3d8ca9300 vulkan/render_pass: Add an optimization for UNDEFINED+LOAD_OP_CLEAR
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14961>
2022-03-16 12:51:15 -05:00
Jason Ekstrand
17395d395a vulkan/render_pass: Support fragment shading rate
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14961>
2022-03-16 12:51:15 -05:00
Jason Ekstrand
6b61953684 vulkan/render_pass: Provide self-dependeny information
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14961>
2022-03-16 12:51:15 -05:00
Jason Ekstrand
ca5ad9cbee vulkan: Add helpers for getting rendering info from a renderpass
These helpers are used by vkCreateGraphicsPipelines to get the
VkPipelineRenderingCreateInfo and in vkCmdBeginCommandBuffer to get the
VkCommandBufferInheritanceRenderingInfo.  This is required because the
Vulkan runtime code can't yet hook and modify calls made to driver-
provided functions.  Instead, we just provide a helper to be used in leu
of vk_find_struct_const().  The structs themselves are stored in the
render pass so we can pass back a pointer and there's no need to
construct one on the stack or stuff it in the pipeline.

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14961>
2022-03-16 12:51:15 -05:00
Jason Ekstrand
1d726940d2 vulkan: Add a common CmdBegin/EndRederPass implementation
This implements vkCmdBeginRenderPass, vkCmdEndRenderPass, and
vkCmdNextSubpass in terms of the new vkCmdBegin/EndRendering included in
VK_KHR_dynamic_rendering and Vulkan 1.3.  All subpass dependencies and
implicit layout transitions are turned into actual barriers.  It does
require VK_KHR_synchronization2 because it always uses the 64-bit
version of the pipeline stage and access bitfields.

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14961>
2022-03-16 12:51:15 -05:00
Jason Ekstrand
874aeb8743 vulkan: Add a common vk_render_pass struct
This basically contains everything in pCreateInfo plus one or two extra
bits that might be useful.

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14961>
2022-03-16 12:51:15 -05:00
Jason Ekstrand
83101429bf anv: Convert to vk_framebuffer
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14961>
2022-03-16 12:51:15 -05:00
Jason Ekstrand
d84e6b8f22 vulkan: Add a common vk_framebuffer struct
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14961>
2022-03-16 12:51:15 -05:00
Jason Ekstrand
acbb0d86f7 panvk: Implement VK_EXT_vertex_attribute_divisor
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15295>
2022-03-16 09:58:55 -05:00
Boris Brezillon
58587c32cb panvk: Implement indexed rendering
Since we can do 8-bit index buffers, also advertise VK_EXT_type_uint8.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15295>
2022-03-16 09:58:46 -05:00
Boris Brezillon
a08b695386 panvk: Fix per-instance attribute handling
We were assuming per-vertex attributes so far. Let's extend the logic
to support per-instance attributes with or without custom instance
divisors.  Now that we've got it all hooked up, we can enable
VK_EXT_vertex_attribute_divisor.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15295>
2022-03-16 09:57:51 -05:00
Boris Brezillon
417cf3d35e panvk: No-op zero-vertex draws
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15295>
2022-03-16 09:57:51 -05:00
Gert Wollny
3244100557 Revert "virgl: Enable PIPE_CAP_TGSI_TEXCOORD when the host supports it"
This reverts commit 2fbb4e85f7.

With this CAP enabled the host doesn't correctly handle the passing
the invariant flag between stages, and using surfaceless in the
client seems to trigger this error

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15409>
2022-03-16 14:33:54 +01:00
Samuel Pitoiset
60517948af radv: fix missing destruction of the inotify thread
The notifier state must be destroyed when a device is destroyed. Oops.
This fixes crashes at launch with The Witcher 3.

Fixes: c50557d961 ("radv: allow applications to dynamically change RADV_FORCE_VRS")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15405>
2022-03-16 11:57:41 +00:00
Vadym Shovkoplias
550f48a826 anv: implement EXT_depth_clip_control
A new extension allowing the application to use the OpenGL depth
range in NDC, i.e. with depth in range [-1, 1], as opposed to
Vulkan’s default of [0, 1].

v2:
- call gfx8_cmd_buffer_emit_viewport on ANV_CMD_DIRTY_PIPELINE (Jason)
- remove redundant !! operator since negativeOneToOne must be true or
  false (Tapani)
- coding style changes (Lionel)

Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6070
Signed-off-by: Vadym Shovkoplias <vadym.shovkoplias@globallogic.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15304>
2022-03-16 11:22:24 +00:00
Charlie Turner
61ad60dc00 ci, radv: Update flake expectations
dEQP-VK.api.object_management.multithreaded_shared_resources.image_2d
is flakey crashing on RENOIR and VEGA10.

Thanks Rhys Perry for pointing out the flake.

Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15386>
2022-03-16 09:45:42 +00:00
Charlie Turner
a815d4001a ci, valve: Bump the trigger container
This contains some fixes in the executor client related to multipart
HTTP uploads. It will hopefully improve the stability of jobs!

Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15386>
2022-03-16 09:45:39 +00:00
Charlie Turner
729537438e ci, valve: Show real kernel addresses in KFENCE reports.
Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15386>
2022-03-16 09:45:31 +00:00
Samuel Pitoiset
737c86da62 radv: only clear VRAM for app and descriptor BOs when set via drirc
We don't have to clear other internal BOs when it's set for eg. vkd3d.
This should reduce the number of SDMA clears.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15156>
2022-03-16 07:19:15 +00:00
Samuel Pitoiset
45b909a5a0 radv/winsys: remove old comment about zerovram
RADV requires Linux 4.15+.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15156>
2022-03-16 07:19:15 +00:00
Mike Blumenkrantz
acb300a3f0 lavapipe: EXT_image_robustness
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15388>
2022-03-16 04:58:41 +00:00
Mike Blumenkrantz
6345575f8a gallivm: fix oob image detection for cube/1dArray/2dArray/cubeArray
these all need to check for z coord oob to avoid crashing

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15388>
2022-03-16 04:58:41 +00:00
Mike Blumenkrantz
b7fbaf924d lavapipe: EXT_pipeline_creation_cache_control
again, technically passing is still passing

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15379>
2022-03-16 04:46:06 +00:00
Mike Blumenkrantz
9bce878490 lavapipe: EXT_pipeline_creation_feedback
cts passes with mostly quality warnings, but it does pass

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15379>
2022-03-16 04:46:06 +00:00
Mike Blumenkrantz
dffe8141bd lavapipe: KHR_zero_initialize_workgroup_memory
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15403>
2022-03-16 04:05:14 +00:00
Mike Blumenkrantz
e106c1294b llvmpipe: add handling for zeroing cs shared memory
since this is just allocated by the cpu, it needs to be zeroed if the
shader expects that behavior

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15403>
2022-03-16 04:05:14 +00:00
Mike Blumenkrantz
f72d5a930b lavapipe: KHR_format_feature_flags2
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15395>
2022-03-16 02:12:05 +00:00
Mike Blumenkrantz
90e091b072 lavapipe: use VkFormatFeatureFlags2 in format detection
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15395>
2022-03-16 02:12:05 +00:00
Mike Blumenkrantz
65bf1cbc26 gallium: add flag to draw info to indicate converted draws
this draw mode in particular requires driver-specific conversions
for queries (e.g., number of vertices), so pass that info through

the only limitation is that it doesn't work for dlists,
but I have yet to see a real use case of a statistics query being used with dlists

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15326>
2022-03-16 01:45:48 +00:00
Jason Ekstrand
864f3c0ee0 panvk: Fix SSBO buffer offsets
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15398>
2022-03-16 01:27:28 +00:00
Jason Ekstrand
6214cce382 panvk: Require 16B alignment for UBOs
This is required by MALI_UNIFORM_BUFFER.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15398>
2022-03-16 01:27:28 +00:00
Lionel Landwerlin
a54f5e8e00 anv: silence compiler warnings
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6146
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15387>
2022-03-16 01:02:05 +00:00
Daniel Stone
2221e3d487 ci: Add new Panfrost G52 skip
This started failing for some reason, has been seen in
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/19776551 and others.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Suggested-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15396>
2022-03-16 00:41:46 +00:00
Stefan Dirsch
c287ed4f39 meson: restore private requires to libdrm in dri.pc file
Due to a typo the private requires to libdrm were lost in dri.pc.
Fixed another typo: Infastructure --> Infrastructure

Fixes: 3ae3569d82 ("meson: restore dri.pc file")
Signed-off-by: Stefan Dirsch <sndirsch@suse.com>
Tested-by: Stefan Dirsch <sndirsch@suse.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15375>
2022-03-15 23:59:46 +00:00
Emma Anholt
3b90d3997a turnip: use vk_shader_module_to_nir().
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15305>
2022-03-15 23:13:16 +00:00
Jason Ekstrand
5a0e081e00 panvk: Use vk_shader_module_to_nir()
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15305>
2022-03-15 23:13:16 +00:00
Jason Ekstrand
0c871d89ae panvk: Use vk_shader_module
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15305>
2022-03-15 23:13:16 +00:00
Jason Ekstrand
0b4a80b4c4 anv: Use vk_shader_module_to_nir()
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15305>
2022-03-15 23:13:16 +00:00
Jason Ekstrand
21b405fbbc vulkan: Add a vk_shader_module_to_nir() helper
This encapsulates all the little bits needed to turn a shader module
into some mostly reasonable NIR.  It handles inlining functions,
lowering variable initializers, handling per-member structs and other
trickiness that is needed for consuming the output of spirv_to_nir.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15305>
2022-03-15 23:13:16 +00:00
Mike Blumenkrantz
40fcd8ef83 lavapipe: enable KHR_memory_model support
lavapipe's memory is always coherent, so this is already supported

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15377>
2022-03-15 22:17:43 +00:00
Mike Blumenkrantz
13d900de0d llvmpipe: set nir_shader_compiler_options::use_scoped_barrier
required for vk memory model

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15377>
2022-03-15 22:17:43 +00:00
Mike Blumenkrantz
e3e3186855 lavapipe: strip unneeded scoped barriers
most of these do nothing and can't be emitted without breaking shaders

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15377>
2022-03-15 22:17:43 +00:00
Connor Abbott
a83ea0253f ir3: Use isam for bindless readonly ssbo loads
Since this isn't hooked up in gallium, only do it for bindless for now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15288>
2022-03-15 21:36:38 +00:00
Connor Abbott
625ebb977f ir3: Actually use wrmask in emit_sam
I noticed that isam emitted for SSBO loads was writing all 4 components,
which this fixes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15288>
2022-03-15 21:36:38 +00:00
Connor Abbott
5f020bcc8d ir3/lower_spill: Fix corner case with oob offsets
If the base register is killed, it may be reused as the destination of a
ldp. In that case we should just skip resetting it afterwards.

Fixes regressions in dEQP-VK.ssbo.layout.random.scalar.38 later.

Fixes: 9912c61362 ("ir3/spill: Support larger spill slot offset")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15288>
2022-03-15 21:36:38 +00:00
Connor Abbott
6304c7cb82 ir3/parser: Don't use right recursion
This fixes memory exhaustion errors when doing shader replacement with
very large shaders.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15288>
2022-03-15 21:36:38 +00:00
Connor Abbott
f9d9c0172a tu: Add an extra storage descriptor for isam
Based on a workaround the blob does.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15288>
2022-03-15 21:36:38 +00:00
Connor Abbott
1ec3d39407 tu: Handle UBO/SSBO descriptors with different sizes
We reuse the otherwise-unused offset channel to represent the array
stride, so that reindexing works properly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15288>
2022-03-15 21:36:38 +00:00
Connor Abbott
5ba3ea1eb3 tu: Rewrite dynamic descriptor handling
We need to prepare for storage buffers having different sizes from
uniform buffers. This switches dynamic_offset_offset to have units of
bytes, the same as offset, and as a nice bonus we can more easily
combine the dynamic and non-dynamic paths in various different places.
This also entails rewriting the code that patches dynamic descriptors,
since we can no longer assume a linear mapping between indices in
dynamicOffsets and descriptor locations which the previous approach
heavily relied on.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15288>
2022-03-15 21:36:38 +00:00
Mike Blumenkrantz
6f7f6df287 zink: export indirect io pipe caps
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15327>
2022-03-15 21:25:05 +00:00
Mike Blumenkrantz
02569428a8 zink: fix unreachable() location in ntv streamout info
super annoying to debug otherwise

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15327>
2022-03-15 21:25:05 +00:00
Mike Blumenkrantz
b53ee02192 zink: add DOUBLE glsl type for streamout export
not used yet but someday

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15327>
2022-03-15 21:25:05 +00:00
Mike Blumenkrantz
68267aeab8 zink: add nir_var_function_temp support to ntv
I said I'd never do this, but here we are

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15327>
2022-03-15 21:25:05 +00:00
Emma Anholt
eb9b092001 turnip: Enable VK_EXT_display_control using the common code.
It's all implemented now, so we can turn it back on.  Passes 15/16 tests
when X11 isn't running, and 1/16 when it is, with no failures in either
mode.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15351>
2022-03-15 20:08:58 +00:00
Samuel Pitoiset
10d69d5f0b radv: fix returning empty drmFormatModifierTilingFeatures
From the Vulkan spec:
    "drmFormatModifierTilingFeatures is a bitmask of
     VkFormatFeatureFlagBits that are supported by any image created
     with format and drmFormatModifier. The returned
     drmFormatModifierTilingFeatures must contain at least one bit."

This fixes recent CTS dEQP-VK.drm_format_modifiers.*.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15383>
2022-03-15 19:43:48 +00:00
Samuel Pitoiset
dc247e5d43 radv: remove VK_AMD_shader_info support
This extension is quite old and useless now.
VK_KHR_pipeline_executable_properties should be used instead.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15299>
2022-03-15 19:23:53 +00:00
Bas Nieuwenhuizen
a0ccc46969 radv: Expose VK_VALVE_descriptor_set_host_mapping for vkd3d only.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15363>
2022-03-15 18:52:41 +00:00
Hans-Kristian Arntzen
86a7b5e276 radv: Implement VK_VALVE_descriptor_set_host_mapping.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15363>
2022-03-15 18:52:41 +00:00
Bas Nieuwenhuizen
6c0bc7eb07 vk: Update xml and headers to 1.3.207.
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15363>
2022-03-15 18:52:41 +00:00
Dave Airlie
c6ac3e017d llvmpipe/fs: add missing depth_clamp key printing
Helps debugging shaders better.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15385>
2022-03-15 18:35:20 +00:00
Mike Blumenkrantz
1b2c4d7196 lavapipe: KHR_shader_integer_dot_product
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15384>
2022-03-15 18:07:47 +00:00
Mike Blumenkrantz
4cf9e24039 gallivm: implement nir_op_pack_32_4x8_split
just reusing existing helpers and llvm can optimize it for us

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15384>
2022-03-15 18:07:47 +00:00
Mike Blumenkrantz
a33a07bd06 lavapipe: maintenance4
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15378>
2022-03-14 21:30:13 -04:00
Mike Blumenkrantz
b2f69a8bb8 lavapipe: set maxBufferSize for maintenance4
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15378>
2022-03-14 21:30:13 -04:00
Mike Blumenkrantz
987e8a5a0c lavapipe: implement vkGetDevice*MemoryRequirements
for maint4

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15378>
2022-03-14 21:30:13 -04:00
Mike Blumenkrantz
49cac7b33d lavapipe: ref/unref pipeline layouts for pipeline creation
required by maintenance4

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15378>
2022-03-14 21:30:13 -04:00
Mike Blumenkrantz
2f9976debc lavapipe: always clone shader nir for shader states
these become owned and freed by llvmpipe, so ensure that freeing
them there won't cause crashes

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15281>
2022-03-15 00:58:22 +00:00
Jason Ekstrand
2170c3ac63 panvk: Use the correct integer border colors
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15382>
2022-03-14 23:04:09 +00:00
Jason Ekstrand
8dd917b9f0 panvk: Rework texture, sampler, and image binding index calculation
This adds a new get_resource_deref_binding helper which decodes a
resource deref into set, binding, and index.  To make texture
instructions nicer, the index can optionally be split into immediate
and SSA parts.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15382>
2022-03-14 23:04:09 +00:00
Jason Ekstrand
17e79b044e panvk: Skip ZS setup if there is no depth/stencil attachment
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15382>
2022-03-14 23:04:09 +00:00
Jason Ekstrand
4f843db0a1 panvk: Make panvk_image_view derive from vk_image_view
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15382>
2022-03-14 23:04:09 +00:00
Jason Ekstrand
1865b7a93e panvk: Make panvk_image derive from vk_image
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15382>
2022-03-14 23:04:09 +00:00
Eric Engestrom
5dbbc0f0a8 Revert "glx: Fix build errors with --enable-mangling (v2)"
This reverts commit a27f2d991b.

As of a0829cf23b ("GL: drop symbols mangling support"), this
extra complexity isn't needed anymore.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2298>
2022-03-14 22:14:25 +00:00
Igor Torrente
f30334b6c4 Venus: add VN_CMD_ENQUEUE to vn_cmd_encode_memory_barriers
Signed-off-by: Igor Torrente <igor.torrente@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15344>
2022-03-14 21:47:19 +00:00
Igor Torrente
a65d2ef1c1 Venus: Adjust VN_CMD_ENQUEUE to set VN_COMMAND_BUFFER_STATE_INVALID
This improves the issue of a return inside the macro.

Signed-off-by: Igor Torrente <igor.torrente@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15344>
2022-03-14 21:47:19 +00:00
Igor Torrente
6cdbc0299a Venus: Add VN_CMD_ENQUEUE macro with vkCmd* common code
Several `vn_Cmd` share the same code to enqueue the command to the
command stream.

This adds a macro with this common code.

Signed-off-by: Igor Torrente <igor.torrente@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15344>
2022-03-14 21:47:19 +00:00
Samuel Pitoiset
1dfee91fdf radv: export the pipeline hash via VK_KHR_pipeline_executable_properties
This will help to match RGP<->Fossilize pipelines.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15279>
2022-03-14 20:20:40 +00:00
Rhys Perry
c4cf92cad7 radv,aco,ac/llvm: fix indirect dispatches on the compute queue on GFX7-10
Since neither PKT3_LOAD_SH_REG_INDEX nor PKT3_COPY_DATA work with compute
queues on GFX7-10, we have to load the dispatch size from memory in the
shader.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15064>
2022-03-14 19:54:36 +00:00
Rhys Perry
973967c49d aco: split and recombine unaligned sgpr inputs
An example is the num_work_groups argument. Fixes invalid assembly with
func.compute.num-workgroups.basic.q0

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15064>
2022-03-14 19:54:36 +00:00
Juan A. Suarez Romero
000b935c50 v3dv/ci: add test to skip list
Add test that it is a timeout in the CI, but otherwise it passes.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15374>
2022-03-14 18:55:13 +00:00
Boris Brezillon
ff8aa15fa0 panvk: Add support for texel buffers
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15334>
2022-03-14 18:06:01 +00:00
Boris Brezillon
9dc8382de8 panvk: Add a dummy sampler for NIR tex operations that don't take one
In the NIR domain, some texture operations don't require a sampler, but
Bifrost/Midgard always want one. Let's add a dummy sampler to handle
that case.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15334>
2022-03-14 18:06:01 +00:00
Jason Ekstrand
a35e721162 panvk: Stop advertising Vulkan 1.1
We're nowhere close to even having Vulkan 1.0 working yet, there's no
reason to get too excited about 1.1.  It just means piles more test
crashes for features we're claiming to support but don't.  If we want to
enable more tests, we can turn on the extensions for those features once
we actually have them working.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15334>
2022-03-14 18:06:01 +00:00
Erik Faye-Lund
dd9b8881e0 Revert "ci: downgrade sphinx to v3.x"
The readthedocs theme now supports Sphinx 4.x, so there's no longer any
reason to stick with 3.x.

This reverts commit a545b6eda0.

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15212>
2022-03-14 17:21:57 +00:00
Icecream95
d5870c45ae panfrost: Optimise recalculation of max sampler view
Previously we always searched through 128 sampler views for set
sampler views, now we never look above the maximum updated view.

Fixes: 304851422a ("panfrost: Fix set_sampler_views for big GL")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15366>
2022-03-14 16:33:40 +00:00
Icecream95
3e405afeb9 panfrost: Don't initialise the trampolines array
PIPE_MAX_SHADER_SAMPLER_VIEWS is 128, so we just end up initialising a
kilobyte of memory for no reason, when usually only a couple of
sampler views are used.

Fixes: 53ef20f08d ("panfrost: Handle NULL sampler views")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15366>
2022-03-14 16:33:40 +00:00
Samuel Pitoiset
b003a101ee radv: stop zeroing radv_sample_locations_state in barriers
This is useless because all fields should be correctly filled if the
pNext struct is found.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15164>
2022-03-14 12:45:29 +00:00
Samuel Pitoiset
612a12a42c radv: move waiting for events to CmdWaitEvents2KHR()
CmdPipelineBarrier doesn't have events.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15164>
2022-03-14 12:45:29 +00:00
Samuel Pitoiset
c6d776f092 radv: remove unnecessary check in FreeCommandBuffers()
cmd_buffer->pool should never be NULL. Even if AllocateCommandBuffers()
fails, the successfully created cmdbuffers would have it set correctly.

From the Vulkan spec:

    "VUID-vkFreeCommandBuffers-pCommandBuffers-parent
     Each element of pCommandBuffers that is a valid handle must have
     been created, allocated, or retrieved from commandPool."

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15164>
2022-03-14 12:45:29 +00:00
Samuel Pitoiset
01ec899083 radv: remove unnecessary NULL check in TrimCommandPool()
This function seems rarely used or maybe never but I noticed this.

From the Vulkan spec:

    "VUID-vkTrimCommandPool-commandPool-parameter
     commandPool must be a valid VkCommandPool handle".

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15164>
2022-03-14 12:45:29 +00:00
Samuel Pitoiset
269b1232ee radv: remove useless check in radv_cmd_buffer_upload_data()
ptr shouldn't be NULL.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15164>
2022-03-14 12:45:29 +00:00
Samuel Pitoiset
0eaf9dbce3 radv: fix compatibility with VK_IMAGE_CREATE_EXTENDED_USAGE_BIT
Some formats can be accepted if a compatible format is also supported
and VK_IMAGE_CREATE_EXTENDED_USAGE_BIT used.

Fixes new CTS dEQP-VK.image.extended_usage_bit_compatibility.*.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6046
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15063>
2022-03-14 11:16:33 +00:00
Samuel Pitoiset
42f84a5886 radv: update inputs_read when lowering the view index
Otherwise inputs_read doesn't contain the information. This shouldn't
fix anything in practice because radv_shader_info gathers this from
the variable.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15337>
2022-03-14 10:26:41 +00:00
Ernst Sjöstrand
e5f3689cff intel/compiler: Fix non-trivial designated initializer
Not supported by GCC 7.

src/compiler/nir/nir_builder_opcodes.h:14156:118:
sorry, unimplemented: non-trivial designated initializers not supported
src/intel/compiler/brw_mesh.cpp:515:7:
note: in expansion of macro ‘nir_store_per_primitive_output’

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Fixes: bc4f8c073a ("intel/compiler: inject MUE initialization")
Signed-off-by: Ernst Sjöstrand <ernstp@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15360>
2022-03-14 09:56:04 +00:00
Samuel Pitoiset
d7514c5f04 radv: stop waiting for DMA to be idle for all transfer operations
Only copy operations actually use CP DMA.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15194>
2022-03-14 09:36:28 +00:00
Gert Wollny
1b354ab913 Revert "llvmpipe: allow vertex processing and fragment processing in parallel"
This reverts commit ec8104c6b2.
  llvmpipe: allow vertex processing and fragment processing in parallel

The commit breaks the the virglrenderer vtest environment used in the
virglrednerer CI and running wayland in virtualized environments.

Related: #6130
Related: #6110

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Acked-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15338>
2022-03-14 09:22:22 +00:00
Samuel Pitoiset
5f3d3be24a radv: fix indirect dispatches on the compute queue on GFX10.3+
For weird reasons, the COPY_DATA packet doesn't seem to copy anything
while on the compute queue. Instead, use PKT3_LOAD_SH_REG_INDEX which
seems to work as expected.

Note that LOAD_SH_REG_INDEX on the compute queue is only supported by
the CP on GFX10.3, so we need to implement a different solution (load
from the indirect BO in the shader) for older generations.

This should fix the Control RT GPU hang.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15053>
2022-03-14 08:54:23 +00:00
Samuel Pitoiset
53ccfbb996 amd: add PKT3_LOAD_SH_REG_INDEX
It seems only available on GFX8+.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15053>
2022-03-14 08:54:23 +00:00
Daniel Schürmann
70aea6b41a aco/ra: refactor collect_vars() to return a sorted vector
The vector of IDs is sorted with decreasing sizes,
and by increasing assigned registers.
This decouples register assingment from ssa IDs.

Totals from 12694 (9.41% of 134913) affected shaders: (GFX10.3)
VGPRs: 757864 -> 757848 (-0.00%); split: -0.00%, +0.00%
CodeSize: 72350540 -> 72348688 (-0.00%); split: -0.02%, +0.02%
MaxWaves: 237018 -> 237020 (+0.00%); split: +0.00%, -0.00%
Instrs: 13545494 -> 13544699 (-0.01%); split: -0.03%, +0.02%
Latency: 148539203 -> 148533292 (-0.00%); split: -0.01%, +0.00%
InvThroughput: 30319086 -> 30320382 (+0.00%); split: -0.01%, +0.01%
VClause: 326875 -> 327028 (+0.05%); split: -0.05%, +0.09%
SClause: 479833 -> 479837 (+0.00%); split: -0.00%, +0.00%
Copies: 862152 -> 860914 (-0.14%); split: -0.43%, +0.28%
Branches: 317775 -> 317777 (+0.00%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11526>
2022-03-14 08:32:10 +00:00
Daniel Schürmann
61c36b6dc0 aco/ra: refactor find_vars() to return a vector
instead of std::set<>

No fossil-db changes.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11526>
2022-03-14 08:32:10 +00:00
Daniel Schürmann
9476986e6f aco/ra: special-case get_reg_for_create_vector_copy()
This function implements separate handling for
p_create_vector during get_regs_for_copies().
This simplifies some code and lets more precisely select
swap instructions if possible.

Totals from 876 (0.65% of 134913) affected shaders: (GFX10.3)
VGPRs: 53312 -> 53336 (+0.05%)
CodeSize: 3792936 -> 3788160 (-0.13%); split: -0.15%, +0.03%
MaxWaves: 16084 -> 16078 (-0.04%)
Instrs: 707449 -> 706385 (-0.15%); split: -0.19%, +0.04%
Latency: 6288293 -> 6286677 (-0.03%); split: -0.03%, +0.01%
InvThroughput: 4264450 -> 4263671 (-0.02%); split: -0.02%, +0.00%
VClause: 18655 -> 18679 (+0.13%); split: -0.20%, +0.33%
Copies: 55397 -> 54353 (-1.88%); split: -2.45%, +0.57%
Branches: 12426 -> 12415 (-0.09%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11526>
2022-03-14 08:32:10 +00:00
Daniel Schürmann
9181e8ceba aco/ra: count constant moves in get_reg_create_vector()
Also implements a correct_pos_mask to keep track which
operands are already at the right target position.
To mitigate some regressions, call get_reg_impl() less often.

Totals from 1229 (0.91% of 134913) affected shaders: (GFX10.3)
VGPRs: 60216 -> 59848 (-0.61%)
CodeSize: 3716496 -> 3711268 (-0.14%); split: -0.19%, +0.05%
MaxWaves: 27952 -> 28004 (+0.19%)
Instrs: 685983 -> 685035 (-0.14%); split: -0.20%, +0.06%
Latency: 6727587 -> 6725340 (-0.03%); split: -0.06%, +0.02%
InvThroughput: 9289043 -> 9289866 (+0.01%); split: -0.02%, +0.03%
VClause: 17730 -> 17740 (+0.06%); split: -0.25%, +0.30%
Copies: 54352 -> 53420 (-1.71%); split: -2.46%, +0.75%
Branches: 12122 -> 12121 (-0.01%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11526>
2022-03-14 08:32:10 +00:00
Samuel Pitoiset
7ad1eb4e8c radv: rework the CS regalloc hang workaround
Move it to the pipeline creation to reduce computations in the hot path.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15162>
2022-03-14 08:05:32 +01:00
Samuel Pitoiset
d532da6e96 radv: fix the CS regalloc hang workaround on GFX6 and few GFX7 chips
RadeonSI uses a different terminology and info->blocks is actually the
number of threads, not the number of blocks (ie. info->grid).

Found by inspection.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15162>
2022-03-14 08:05:28 +01:00
Mike Blumenkrantz
952679b944 zink: use dynamic rasterizer_discard state when possible
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15328>
2022-03-14 04:08:29 +00:00
Mike Blumenkrantz
ae4bdea73e zink: move dynamic state2 pipeline state to substruct in pipeline state
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15328>
2022-03-14 04:08:29 +00:00
Mike Blumenkrantz
d1f12b1924 zink: assert that the dynamic state array size is big enough
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15328>
2022-03-14 04:08:29 +00:00
Dave Airlie
6cc4cdaa6f radv/winsys: add support for queues without user fences.
The video queues don't have user fence support.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15257>
2022-03-14 10:41:04 +10:00
Dave Airlie
c6755e85e3 radv/winsys: add a ring level detection for ib bo usage.
The video rings can't use IB bos

v2: add use_ib flag to avoid a bunch of checks.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15257>
2022-03-14 10:41:01 +10:00
Dave Airlie
31b82afe6e radv/winsys: add nop packets for uvd and vcn dec.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15257>
2022-03-14 10:40:52 +10:00
Dave Airlie
5819b4c1d3 radv/winsys: complete ring/ip translations.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15257>
2022-03-14 10:40:23 +10:00
Mihai Preda
816ad5ede8 radeonsi/tests: update piglit baseline on vega20
current as of commit: 6731460194

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15273>
2022-03-13 20:11:47 +00:00
Konstantin Seurer
16cb957e8b radv: Enable KHR_ray_query
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14565>
2022-03-13 12:02:05 +01:00
Konstantin Seurer
78c84f11a5 radv: Lower ray queries
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14565>
2022-03-13 12:02:05 +01:00
Konstantin Seurer
357bd1829f nir,spirv: Preserve ray_query_value
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14565>
2022-03-13 12:02:05 +01:00
Konstantin Seurer
6d2e95db7b radv: Move common code to seperate file
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14565>
2022-03-13 12:02:05 +01:00
Dave Airlie
177805cc03 radv: try and fix internal transfer queue mapping
The WSI code wants to remain generic and try and use vulkan APIs,
even though these queues aren't exposed through the API.

Add the transfer queue to the end of the queues.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tested-by: Mike Lothian <mike@fireburn.co.uk>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15357>
2022-03-13 02:37:19 +00:00
Mike Blumenkrantz
57ddfcaa2d zink: anv ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15361>
2022-03-13 00:16:56 +00:00
Alyssa Rosenzweig
8c6cb15200 panfrost: Handle txs of cube arrays
We need to divide the array length by 6 to match what OpenGL expects.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15254>
2022-03-12 17:34:01 +00:00
Alyssa Rosenzweig
53f1e57ee7 pan/bi: Handle non-2D arrays
Handle arrays generically by using the last component of the coordinate source
as the array index. That works for both 2D arrays and cube arrays, fixing cube
arrays. Cube arrays were already handled correctly in core Panfrost code.

This code path is not tested in dEQP-GLES31 without exposing OES_cube_map_array,
which depends on OES_geometry_shader, which we don't have. Yet we do expose
PIPE_CAP_CUBE_ARRAY, so ARB_cube_map_array is exposed.

Disabling PIPE_CAP_CUBE_ARRAY would be an easy band-aid fix, but it's easy
enough to handle correctly.

dEQP-GLES31 passes with a hack enabling OES_cube_map_array [without geometry
shaders].

Also fixes 1D arrays on Bifrost for the same reasons.

Fixes: 70d6c5675d ("pan/bi: Emit TEXC with builder")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15254>
2022-03-12 17:34:01 +00:00
Alyssa Rosenzweig
1f97819fbe panfrost: Emulate GL_CLAMP on Bifrost
Hardware support was removed with Midgard. Use mesa/st to emulate GL_CLAMP with
nir_lower_tex automatically (the Zink lowering), and disable GL_MIRROR_CLAMP
which isn't lowered correctly.

Fixes *texwrap* Piglit tests on G52.

Fixes: f9ceab7b23 ("panfrost: Fix CLAMP wrap mode")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15253>
2022-03-12 17:16:00 +00:00
Rob Clark
05d6877235 freedreno/ir3: Don't try re-swapping cat3 srcs
This can lead us to endless loops of "progress".. Note fixes commit
commit really just exposed an existing problem.

Fixes: 9c9e8c3349 ("nir: Reorder ffma and fsub combining")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6133
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15336>
2022-03-12 16:42:00 +00:00
Rob Clark
fa59556e1a freedreno/ir3: Remove unused define
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15336>
2022-03-12 16:42:00 +00:00
Rob Clark
5f6dce05c3 mesa: Easier shader capture for android
I've typed this patch a few times already.. lets just add some debug
code which can be easily switched on so I don't have to type it again.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15336>
2022-03-12 16:41:59 +00:00
Dave Airlie
cd00247db5 crocus: force ignore_sample_mask_out on gen4/5 for precompile
on gen4/5 this won't ever be anything else, avoids some recompiles.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15315>
2022-03-12 08:12:41 +00:00
Dave Airlie
7edda218fd intel: add some missing debug recompile info.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15315>
2022-03-12 08:12:41 +00:00
Jason Ekstrand
65db6b0e7c bifrost: Constant fold after lower_explicit_io
nir_lower_explicit_io generates mul+add chains even for constants.  One
round of constant folding should get rid of these.  This fixes all of
the dEQP-VK.glsl.conversions.* tests on panvk.

GoGoGoGo'd-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15349>
2022-03-12 03:51:54 +00:00
Alyssa Rosenzweig
e0b6493c49 mesa: Remove unused framebuffer validation
Probably unused since we deleted classic.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15255>
2022-03-11 22:02:23 -05:00
Jason Ekstrand
1aa120b10f bifrost: Handle nir_op_frexp* and nir_op_ldexp
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15352>
2022-03-12 02:27:02 +00:00
Jason Ekstrand
d2a09f3dd3 bifrost: Implement fine and coarse derivatives
We leave the undecorated ops as fine so we don't disturb panfrost.  For
coarse derivatives, we use a lane ID of 0 for the first lane and 1 or 2
for the second depending on axis.  This ensures that coarse derivatives
are quad-uniform.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15352>
2022-03-12 02:27:02 +00:00
Jason Ekstrand
83010c57a6 bifrost: Simplify derivatives a bit
Instead of two magic ternary operations, define a new `axis` temporary
which is 1 for X and 2 for Y.  Then define everything else in terms of
this variable.  In particular, the mask operation we do on LANE_ID is a
mask so it makes more sense to use ~axis than 1/2 but in the other
order.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15352>
2022-03-12 02:27:02 +00:00
Jason Ekstrand
c043e93ca5 bifrost: Lower usub_borrow
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15352>
2022-03-12 02:27:02 +00:00
Jonathan Gray
e50eb1ce7a util: fix msvc build
Fix msvc build regression after 0536b69133
reported by Prodea Alexandru-Liviu.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6137
Fixes: 0536b69133 ("util: fix build with clang 10 on mips64")
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15355>
2022-03-12 11:38:27 +11:00
Jason Ekstrand
d65dbe8018 anv: Allow MSAA resolve with different numbers of planes
The Vulkan spec for VK_KHR_depth_stencil_resolve allows a format
mismatch between the primary attachment and the resolve attachment
within certain limits.  In particular,

    VUID-VkSubpassDescriptionDepthStencilResolve-pDepthStencilResolveAttachment-03181

    If pDepthStencilResolveAttachment is not NULL and does not have the
    value VK_ATTACHMENT_UNUSED and VkFormat of
    pDepthStencilResolveAttachment has a depth component, then the
    VkFormat of pDepthStencilAttachment must have a depth component with
    the same number of bits and numerical type

    VUID-VkSubpassDescriptionDepthStencilResolve-pDepthStencilResolveAttachment-03182

    If pDepthStencilResolveAttachment is not NULL and does not have the
    value VK_ATTACHMENT_UNUSED, and VkFormat of
    pDepthStencilResolveAttachment has a stencil component, then the
    VkFormat of pDepthStencilAttachment must have a stencil component
    with the same number of bits and numerical type

So you can resolve from a depth/stencil format to a depth-only or
stencil-only format so long as the number of bits matches.
Unfortunately, this has never been tested because the CTS tests which
purport to test this are broken and actually test with a destination
combined depth/stencil format.

Fixes: 5e4f9ea363 ("anv: Implement VK_KHR_depth_stencil_resolve")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15333>
2022-03-11 22:25:42 +00:00
Mike Blumenkrantz
ffd67b39e7 zink: remove flake
this had already been resolved by the time the flake was added

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15350>
2022-03-11 14:46:41 -05:00
Jason Ekstrand
95a44a5b09 lavapipe: Use the auto-generated vk_enqueue_BeginRendering
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15325>
2022-03-11 11:40:41 -06:00
Jason Ekstrand
f76621f719 vulkan/cmd_queue: Properly support non-array pointer members
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5440
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15325>
2022-03-11 11:36:53 -06:00
Thong Thai
027f1302fc radeonsi: add option to disable EFC
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15196>
2022-03-11 14:10:08 +00:00
Thong Thai
23e5b910c5 radeon: add EFC support to only VCN2.0 devices
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5228
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15196>
2022-03-11 14:10:08 +00:00
Thong Thai
9fa6ab962a frontends/va: zero-copy efc
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15196>
2022-03-11 14:10:08 +00:00
Thong Thai
9602526568 frontends/va: add encoder format conversion (EFC) support
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15196>
2022-03-11 14:10:08 +00:00
Thong Thai
73153746d5 gallium: add parameters for encoder format conversion (EFC) support
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15196>
2022-03-11 14:10:08 +00:00
Tapani Pälli
adea096029 ci: update various ci result files
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12936>
2022-03-11 09:58:28 +00:00
Tapani Pälli
2a14baab85 mesa: check for valid internalformat with glTex[Sub]Image
This changes our error handling to be compatible with upcoming
specification change that unifies glTex[Sub]Image error handling
between OpenGL ES 2.0 vs ES 3.0+ specifications, see:

https://gitlab.khronos.org/opengl/API/-/issues/147

OpenGL ES 2.0.25 spec states:

   "Specifying a value for internalformat that is not one of
    the above values generates the error INVALID_VALUE. If
    internalformat does not match format, the error
    INVALID_OPERATION is generated."

This fixes following new tests:

    KHR-GLES31.core.compressed_format.*
    KHR-GLES32.core.compressed_format.*

v2: GL_INVALID_OPERATION -> GL_INVALID_VALUE in extension
    checks, remove (now overlapping) extension checks from
    _mesa_gles_error_check_format_and_type (Eric Anholt)

v3: take GLES version in to account in internalformat checks

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12936>
2022-03-11 09:58:28 +00:00
Lionel Landwerlin
6cea8a43fa anv: silence compiler warning
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15241>
2022-03-11 08:47:15 +00:00
Lionel Landwerlin
90000aea9b anv: make a couple of descriptor function private
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15241>
2022-03-11 08:47:15 +00:00
Lionel Landwerlin
e12698724e anv: rename host only descriptor internal flag
We add an assert to verify that those are not bound.

v2: Drop != 0 (Tapani)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15241>
2022-03-11 08:47:15 +00:00
Lionel Landwerlin
87f59b18cf anv: don't lazy allocate surface states in descriptor sets
In 4001d9ce1a we started lazily allocating surface states in the
descriptor sets rather than upfront in the descriptor pool. This was
to workaround vkd3d-proton allocating more than we could handle at the
HW level.

The issue introduced in that change is that we didn't protect the
descriptor pool free list as well as the anv_state_stream which are
now potentially used from different threads through the descriptor set
write functions.

This reverts the lazy allocation part of that change. Host only
descriptor sets changes remain.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 4001d9ce1a ("anv: Handle VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE for descriptor sets")
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15241>
2022-03-11 08:47:15 +00:00
Lionel Landwerlin
71cd6a7b84 anv: fix acceleration structure descriptor copies
We're not supposed to have a
VkWriteDescriptorSetAccelerationStructureKHR when doing a copy. We
should instead get the acceleration structure object from the source
descriptor.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 03e1e19246 ("anv: Refactor descriptor copy")
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15241>
2022-03-11 08:47:15 +00:00
Pierre-Eric Pelloux-Prayer
968d68125c radeonsi: don't clear framebuffer.state before dcc decomp
This causes inconsistencies between sctx->framebuffer.state and other
sctx->framebuffer properties (like compressed_cb_mask).

The point of this code was to fix an issue with vi_separate_dcc_stop_query,
which was removed by 804e292440 we can safely drop it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6099
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15261>
2022-03-11 08:31:36 +00:00
Kenneth Graunke
01442cf4d4 iris: Restore flagging of dirty bindings in binder_realloc
When I switched iris over to use 3DSTATE_BINDING_TABLE_POOL_ALLOC, I
stopped flagging things dirty when allocating a new binder, because
the contents of the binding table were still valid, thanks to us not
having to subtract Surface State Base Address anymore.

This unfortunately missed the point that the old binding table is in the
old buffer, which is no longer what the binder pool base address points
to.  So we'd either need to copy it over, or just flag it dirty and
re-emit it on the next draw.

Fixes misrendering in Ryujinx.

Fixes: 8b9045e7a4 ("intel: Use 3DSTATE_BINDING_TABLE_POOL_ALLOC exclusively on Gfx11+")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15314>
2022-03-11 07:59:18 +00:00
Samuel Pitoiset
b366fef091 radv: optimize the number of loaded components for VS inputs in NIR
fossils-db (Sienna Cichlid):
Totals from 3691 (2.74% of 134913) affected shaders:
VGPRs: 121368 -> 121584 (+0.18%); split: -0.36%, +0.54%
CodeSize: 7597912 -> 7561140 (-0.48%); split: -0.66%, +0.18%
MaxWaves: 104706 -> 104772 (+0.06%)
Instrs: 1441229 -> 1437652 (-0.25%); split: -0.53%, +0.28%
Latency: 5500766 -> 5482101 (-0.34%); split: -0.45%, +0.11%
InvThroughput: 804401 -> 797178 (-0.90%); split: -1.09%, +0.20%
VClause: 25185 -> 25143 (-0.17%); split: -0.50%, +0.33%
SClause: 27486 -> 27445 (-0.15%); split: -0.57%, +0.42%
Copies: 143816 -> 147900 (+2.84%); split: -0.54%, +3.38%
PreSGPRs: 109584 -> 110396 (+0.74%); split: -0.04%, +0.79%
PreVGPRs: 95541 -> 94583 (-1.00%); split: -1.12%, +0.12%

fossils-db (Polaris10):
Totals from 1773 (1.30% of 135960) affected shaders:
SGPRs: 80848 -> 80864 (+0.02%); split: -0.14%, +0.16%
VGPRs: 56424 -> 55600 (-1.46%); split: -1.47%, +0.01%
CodeSize: 1732588 -> 1696840 (-2.06%); split: -2.07%, +0.01%
MaxWaves: 12103 -> 12106 (+0.02%)
Instrs: 347684 -> 341597 (-1.75%); split: -1.76%, +0.01%
Latency: 2542840 -> 2523946 (-0.74%); split: -0.95%, +0.21%
InvThroughput: 924601 -> 905102 (-2.11%); split: -2.13%, +0.02%
VClause: 9565 -> 9545 (-0.21%); split: -0.51%, +0.30%
SClause: 10587 -> 10333 (-2.40%); split: -2.82%, +0.43%
Copies: 19321 -> 20307 (+5.10%); split: -0.78%, +5.88%
PreSGPRs: 30879 -> 30875 (-0.01%); split: -0.20%, +0.18%
PreVGPRs: 41211 -> 41270 (+0.14%); split: -0.73%, +0.87%

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/15317>
2022-03-11 07:40:10 +00:00
Dave Airlie
1ec4e568de radv: abstract queue family away from queue family index.
If we introduce another queue type (video decode) we can have a
disconnect between the RADV_QUEUE_ enum and the API queue_family_index.

currently the driver has
GENERAL, COMPUTE, TRANSFER which would end up at QFI 0, 1, <nothing>
since we don't create transfer.

Now if I add VDEC we get
GENERAL, COMPUTE, TRANSFER, VDEC at QFI 0, 1, <nothing>, 2
or if you do nocompute
GENERAL, COMPUTE, TRANSFER, VDEC at QFI 0, <nothing>, <nothing>, 1

This means we have to add a remapping table between the API qfi
and the internal qf.

This patches tries to do that, in theory right now it just adds
overhead, but I'd like to exercise these paths.

v2: add radv_queue_ring abstraction, and pass physical device in,
as it makes adding uvd later easier.
v3: rename, and drop one direction as unneeded now, drop queue_family_index
from cmd_buffers.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13687>
2022-03-11 04:38:55 +00:00
Mike Blumenkrantz
afb4cced5c lavapipe: more descriptor validation
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14656>
2022-03-11 04:26:28 +00:00
Mike Blumenkrantz
0c130d64d3 lavapipe: validate per-stage descriptor limits when creating pipeline layouts
this is super annoying to track down later, so just crash early if it's seen

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14656>
2022-03-11 04:26:28 +00:00
Mike Blumenkrantz
21abb01fb9 lavapipe: make device limits a physical device struct
it's useful to have this info around and a bit simpler to gather
info on init

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14656>
2022-03-11 04:26:28 +00:00
Mike Blumenkrantz
5ab0e3f0bb anv: fix some dynamic rasterization discard cases in pipeline construction
cc: mesa-stable

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15280>
2022-03-11 04:02:02 +00:00
Mike Blumenkrantz
1e3e7b3a4d anv: fix CmdSetColorWriteEnableEXT for maximum rts
Fixes: b15bfe92f7 ("anv: implement VK_EXT_color_write_enable")

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15280>
2022-03-11 04:02:02 +00:00
Mike Blumenkrantz
52f6978484 anv: fix xfb usage with rasterizer discard
in the initial implementation, a stream like:

* CmdBeginTransformFeedbackEXT
* CmdSetRasterizerDiscardEnableEXT
* CmdDraw
* CmdEndTransformFeedbackEXT
* CmdBeginTransformFeedbackEXT
* CmdDraw
* CmdEndTransformFeedbackEXT

would never enable transform feedback, as it only checked for the change
in rasterizer_discard state

Fixes: 4d531c67df ("anv: support rasterizer discard dynamic state")

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15269>
2022-03-11 03:37:17 +00:00
Dave Airlie
e8c3be0eb8 crocus: don't map scanout buffers as write-back
This essentially ports 6440523077
Author: Keith Packard <keithp@keithp.com>
Date:   Fri Aug 6 16:11:18 2021 -0700

    iris: Map scanout buffers WC instead of WB [v2]

to crocus.

Fixes: f3630548f1 ("crocus: initial gallium driver for Intel gfx 4-7")

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15313>
2022-03-11 03:26:41 +00:00
Mike Blumenkrantz
42e78ba125 llvmpipe: fix occlusion queries with early depth test
for genuine early depth tests, the samplecount must be updated after depth
test but before samplemask is applied

for inferred-early or regular depth tests, the samplemask can be applied
before the depth test

Fixes: d9276ae965 ("llvmpipe: handle gl_SampleMask writing.")

fixes:
dEQP-VK.fragment_operations.early_fragment.sample_count_early_fragment_tests_depth_samples_4

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15319>
2022-03-11 00:45:05 +00:00
Jason Ekstrand
f7175bf416 lavapipe: Use the common vk_enqueue_CmdBindDescriptorSets
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15329>
2022-03-10 21:08:36 +00:00
Jason Ekstrand
ac58e93633 lavapipe: Reference count pipeline layouts
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15329>
2022-03-10 21:08:36 +00:00
Jason Ekstrand
48a10c5dd3 lavapipe: Allocate descriptor set layouts with DEVICE scope
Because they can come and go at any time, we can't use OBJECT scope
because that might confuse the client allocator.  Instead, use DEVICE
scope and always allocate off the device allocator.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15329>
2022-03-10 21:08:36 +00:00
Jason Ekstrand
94ea3b9c03 vulkan/cmd_queue: Add a common vk_cmd_enqueue_CmdBindDescriptorSets
In order for this to work, the driver must reference-count pipeline
layouts so we can take a reference while the command is in the queue.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15329>
2022-03-10 21:08:36 +00:00
Jason Ekstrand
c1070556a0 vulkan/cmd_queue: Add a driver_free_cb hook
If a driver sets driver_data but not driver_free_cb, driver_data will
get freed along with the command.  If a driver sets driver_free_cb,
driver_data will not get automatically freed but the callback will get
called before the rest of the data structure is freed.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15329>
2022-03-10 21:08:36 +00:00
Mike Blumenkrantz
2106c3bab6 lavapipe: ci updates
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15322>
2022-03-10 20:40:56 +00:00
Mike Blumenkrantz
cf5c32a4b2 lavapipe: run nir_opt_copy_prop_vars during optimization loop
this enables better elimination of operations

fixes:
dEQP-VK.graphicsfuzz.spv-stable-mergesort-flatten-selection-dead-continues

fixes #5458

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15322>
2022-03-10 20:40:56 +00:00
Mike Blumenkrantz
c94c8a7029 lavapipe: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15320>
2022-03-10 20:24:01 +00:00
Mike Blumenkrantz
6a4c7ef728 lavapipe: skip format checks for EXTENDED_USAGE
we can effectively skip any kind of checks here and just assume that one
of two scenarios is in effect:
* the user is about to attempt some incredibly illegal behavior that VVL will catch
* the user is about to attempt a pro gamer move and we'll be fine

in either case, it's EXTENDED_USAGE, so hopefully we're about to make a texture
view from a compatible and supported format

cc: mesa-stable

fixes:
dEQP-VK.image.extended_usage_bit_compatibility.image_format_properties*

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15320>
2022-03-10 20:24:01 +00:00
Mike Blumenkrantz
c40dc39b5a lavapipe: use the correct value for dynamic render resolve attachment indexing
subpass->color_count is (obviously) not set yet, so this would just clobber
the color attachments any time resolves were used

Fixes: 8a6160a354 ("lavapipe: VK_KHR_dynamic_rendering")

fixes:
dEQP-VK.draw.dynamic_rendering.multiple_interpolation.structured.with_sample_decoration.4_samples

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15330>
2022-03-10 19:48:59 +00:00
Dave Airlie
938488f439 lavapipe: remove broken workaround for zink depth texturing.
Cc: mesa-stable
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15297>
2022-03-11 04:58:34 +10:00
Dave Airlie
30cb63bead zink: workaround depth texture mode alpha.
Since spir-v only has single channel depth sampling, it breaks
with the old school GL_ALPHA depth mode swizzle, so just detect
that case and smash all the channels.

Cc: mesa-stable
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15297>
2022-03-11 04:58:01 +10:00
Connor Abbott
cdee38a57b tu: Expose subgroup arithmetic
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14107>
2022-03-10 17:15:29 +00:00
Connor Abbott
1a78604d20 ir3: Add support for subgroup arithmetic
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14107>
2022-03-10 17:15:29 +00:00
Connor Abbott
a433db60c1 ir3: Track physical edges when inserting (ss) for shared regs
Normally this wouldn't matter, but it will matter for the upcoming scan
macro because the running tally is communicated through a shared
register across a physical edge. It may also matter if a live-range
split occurs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14107>
2022-03-10 17:15:29 +00:00
Connor Abbott
410e746198 util/bitset: Fix off-by-one in __bitset_set_range
Fixes: b3b03e33c9 ("util/bitset: add BITSET_SET_RANGE(..)")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14107>
2022-03-10 17:15:29 +00:00
Connor Abbott
72b32d83fb ir3/spill: Mark reload destination as early-clobber
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14107>
2022-03-10 17:15:29 +00:00
Connor Abbott
2ff5826f09 ir3/ra: Add IR3_REG_EARLY_CLOBBER
We'll need this to model the subgroup reduction macros.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14107>
2022-03-10 17:15:29 +00:00
Connor Abbott
34803d15ab ir3/ra: Add proper support for multiple destinations
We weren't considering the other destinations when allocating a
destination, so we could allocate overlapping destinations. This wasn't
done before because we never had a need for it, but the subgroup
reduction macros will need it.

The trickiest part of this is that we have to rewrite the
compress_regs_left fallback, because we may have to move around the
other already-allocated destinations. We now have a list of destinations
to (re)allocate in addition to the popped live intervals. For the rest
of the destination handling, we can just bail out if the proposed spot
for something overlaps another destination, but for the fallback we have
to handle all the cases gracefully. I also added support for odd
combinations of multiple destinations where some of them are tied, which
we'll use in the next commit to handle early-clobber destinations and
which will actually be used because one of the destinations of the
subgroup reduction macro will be early-clobber. The result is that the
order of intervals to allocate is now a lot more complicated.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14107>
2022-03-10 17:15:29 +00:00
Connor Abbott
ab0ed4ff3f ir3/ra: Sanitize parallel copy flags better
For pcopies we only care about the register's type, i.e. whether its a
half-register and whether it's an array (plus its size). Copying over
other flags like IR3_REG_RELATIV just leads to sadness and validator
assertions.

Fixes: 0ffcb19b9d ("ir3: Rewrite register allocation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14107>
2022-03-10 17:15:29 +00:00
Connor Abbott
0135660dfc ir3/ra: Fix ra_foreach_dst_n
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14107>
2022-03-10 17:15:29 +00:00
Connor Abbott
077d07a983 ir3/ra: Fix tied destination handling with multiple destinations
Before, we were careful to

1. Get the source physreg.
2. Allocate the destination.
3. Insert a copy with the source being the physreg from step 1.

and this guaranteed that if the tied source were moved in step 2 we'd
still insert a copy from the correct place. However this won't work with
multiple destinations because an earlier destination could've already
moved the tied source around. Instead flip steps 2 and 3 (we'll insert
the copy before we allocate the interval, but that's ok) and run the
first two steps in a separate loop before any destinations are
allocated.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14107>
2022-03-10 17:15:29 +00:00
Connor Abbott
9cc42242d5 ir3/sched: Support multiple destinations
Note: this is a behavior change for arrays, because it will count the
entire array instead of just the components written in the register
pressure calculation. However this is more accurate since this matches
how RA works.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14107>
2022-03-10 17:15:29 +00:00
Connor Abbott
a6be8fd0ea ir3/dce: Support multiple destinations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14107>
2022-03-10 17:15:29 +00:00
Connor Abbott
89217f636c ir3/cp_postsched: Support multiple destinations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14107>
2022-03-10 17:15:29 +00:00
Jason Ekstrand
cc4f0e804e vulkan,lavapipe: Move some enqueue helpers to common code
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15311>
2022-03-10 15:52:10 +00:00
Boris Brezillon
b98cfe9cb4 lavapipe: Re-use auto-generated vk_cmd_enqueue entrypoints
Re-use auto-generated vk_cmd_enqueue entrypoints instead of generating
our own version doing the same thing.  In order to effectively do this,
we also add an allow-list of which entrypoints lavapipe actually handles
to avoid issues where the autogenerated one stomps a vkCmdFoo2 wrapper.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15311>
2022-03-10 15:52:10 +00:00
Jason Ekstrand
66cb64c8ad lavapipe: Reset the free_cmd_buffers list in TrimCommandPool
We delete all the command buffers but they're still in the list so
future allocations may try to re-use them post-free and another trim
will re-delete them.

Fixes: b38879f8c5 ("vallium: initial import of the vulkan frontend")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15311>
2022-03-10 15:52:10 +00:00
Jason Ekstrand
719b949575 vulkan/cmd_queue: Generate enqueue entrypoints
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15311>
2022-03-10 15:52:10 +00:00
Boris Brezillon
47fc0b39c7 vulkan/cmd_queue: Properly deconstify array of pointers
When manipulating an array of pointers, what we want to desconstify is
the array, not the entry type.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15311>
2022-03-10 15:52:10 +00:00
Jason Ekstrand
0d5dc6ef6a vulkan/cmd_queue: Stop generating enqueue helpers for INTEL perf queries
They don't return void and they're not used by anyone except the Intel
drivers so there's no point in supporting them.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15311>
2022-03-10 15:52:10 +00:00
Jason Ekstrand
cf8cf8a827 vulkan/cmd_queue: Re-flow MANUAL_COMMANDS
This just makes it all a bit easier to read.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15311>
2022-03-10 15:52:10 +00:00
Boris Brezillon
290e33ab20 vulkan/cmd_queue: Remove duplicate entries in MANUAL_COMMANDS
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15311>
2022-03-10 15:52:10 +00:00
Louis-Francis Ratté-Boulianne
6bd8a3c7e4 vulkan/runtime: Add a vk_cmd_queue object to vk_command_buffer
This is paving the road for generic secondary command buffer support,
where commands are simply recorded in a software queue and replayed
on the primary command buffer when vkCmdExecuteCommands() is called.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15311>
2022-03-10 15:52:10 +00:00
Louis-Francis Ratté-Boulianne
ad4d2da90a vulkan/cmd_queue: Add an initializer for the vk_cmd_queue object
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15311>
2022-03-10 15:52:10 +00:00
Boris Brezillon
dd0f6cb45b vulkan/cmd_queue: Constify vk_cmd_queue.alloc
The implementation shouldn't modify the allocator.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15311>
2022-03-10 15:52:10 +00:00
Mike Blumenkrantz
a3d096f4ba lavapipe: add the full list of cts fails
easier to keep track this way

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15294>
2022-03-10 10:03:16 -05:00
Akihiko Odaki
b70f14188d virgl: Check texture multisample compatibility
v2: Support VIRGL_FORMAT_NONE (Gert Wollny)

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Suggested-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15115>
2022-03-10 10:34:12 +00:00
Akihiko Odaki
571c5e8fdc virgl/ci: Uprev virglrenderer
Suggested-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15115>
2022-03-10 10:34:12 +00:00
Danylo Piliaiev
c4703cd846 tu: Implement VK_EXT_depth_clip_control
Since negativeOneToOne is a static property of the pipeline and
viewport state could be dynamic, we have to defer viewport state
emission until negativeOneToOne value is known.

See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6070

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14363>
2022-03-10 11:08:50 +02:00
Iago Toral Quiroga
49b5431197 broadcom/compiler: remove unused functions
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15302>
2022-03-10 07:25:37 +00:00
Dylan Baker
45770ac286 docs: add release notes for 22.0.0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15312>
2022-03-09 22:47:56 +00:00
Dylan Baker
8474817253 docs: Add calendar entries for 22.0 release.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15312>
2022-03-09 22:47:56 +00:00
Dylan Baker
b7e1df14f0 docs: update calendar and link releases notes for 22.0.0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15312>
2022-03-09 22:47:56 +00:00
Timur Kristóf
75a783ea73 ac: Query the amdgpu MEC firmware version.
MEC (Micro Engine Compute) is the firmware which is responsible for
the compute-only queues on AMD GPUs. It is present on GFX7 and newer.
This patch will query the version of this firmware and print it
among the others.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15283>
2022-03-09 21:31:48 +00:00
Rob Clark
f4ec900953 mesa: Fix discard_framebuffer for fbo vs winsys
GL is annoying when it comes to having different enums for winsys vs
fbo.

Note that the issue this closes was only accidentially exposed by a
change the resulted in sysmem vs GMEM path taken.

Fixes: db2ae51121 ("mesa: Skip partial InvalidateFramebuffer of packed depth/stencil.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6103
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15308>
2022-03-09 20:40:53 +00:00
Emma Anholt
d5d8519cb5 docs/ci: Add docs for using a POE switch to control boards, like nouveau.
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15201>
2022-03-09 19:47:04 +00:00
Emma Anholt
e8da28d5e8 docs/ci: Update some bare-metal CI docs.
We haven't been using initramfs in a long time, don't point people that
direction.  Do point people at existing instances of these CI variants,
though.

Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15201>
2022-03-09 19:47:04 +00:00
Emma Anholt
5497d60639 ci/nouveau: Add a manual run for the Jetson Nano (GM20B).
The test suite is full of flakes around transform feedback, atomics, and
tess.  But, I hope it can be useful for regression testing core Mesa
reworks.

This required updating the kernel to 5.16.12 to get a more stable boot
process.  That kernel rebuild caused an update of the container with
piglit which that was missed in a previous MR, so we got new xfails in x86
swrast.

Acked-by: Ilia Mirkin <imirkin@alum.mit.edu> (nouveau)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15201>
2022-03-09 19:47:04 +00:00
Emma Anholt
1b374f8c91 ci/nouveau: Add nouveau support to the rootfs.
This required updating the kernel to 5.16.12 to get a more stable boot
process.  That kernel rebuild caused an update of the container with
piglit which that was missed in a previous MR, so we got new xfails in x86
swrast.  Also, including modules on arm64 exposed a bug in v3d's
poe-powered.sh rsyncing of modules.

Acked-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15201>
2022-03-09 19:47:04 +00:00
Emma Anholt
a9e67738d6 ci: Stop xz-compressing firmware for ramdisks.
This ends up breaking nouveau because the renames break symlinks in the
firmware directory structure.  We don't need it any more since we stopped
doing ramdisks.

Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15201>
2022-03-09 19:47:04 +00:00
Emma Anholt
9b918c4df2 ci/bare-metal: Increase maximum retry count for POE boots.
The manual jetson CI job I'm introducing has serious boot reliability
trouble, but also we've seen frequent intermittent failures on bcm where
at least 2 boots don't seem to be enough (#6041).

Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15201>
2022-03-09 19:47:04 +00:00
Emma Anholt
45b7648cb1 ci/bare-metal: Drop the BM_POE_USERNAME/PASSWORD env var checks.
They're unused since the transition to SNMP in the rpi test farm.

Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15201>
2022-03-09 19:47:04 +00:00
Mike Blumenkrantz
c24bca2d3a zink: lower dmod on AMD hardware
this hardware won't return the correct value from dmod instructions,
so lower it to ensure that cts passes

nobody else will ever hit this, so perf isn't an issue and regular fmod
can be left alone

fixes (amd):
KHR-GL46.gpu_shader_fp64.builtin.mod_d*

Fixes: 5fae35fb17 ('zink: fix 64bit float shader ops ')

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15306>
2022-03-09 19:13:02 +00:00
Mike Blumenkrantz
1845957a31 zink: add another radv fail
it looks like this one was erroneously excluded

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15307>
2022-03-09 14:00:06 -05:00
Mike Blumenkrantz
e70b6be117 zink: update radv fails
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15307>
2022-03-09 14:00:06 -05:00
Chia-I Wu
889d050739 venus: add VK_EXT_vertex_attribute_divisor
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15265>
2022-03-09 17:24:49 +00:00
Chia-I Wu
4752429e36 venus: add VK_EXT_shader_stencil_export
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15265>
2022-03-09 17:24:49 +00:00
Chia-I Wu
1ecd481bd7 venus: add VK_EXT_robustness2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15265>
2022-03-09 17:24:49 +00:00
Chia-I Wu
25795308ef venus: add VK_EXT_depth_clip_enable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15265>
2022-03-09 17:24:49 +00:00
Chia-I Wu
bebe5e3925 venus: add VK_EXT_conservative_rasterization
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15265>
2022-03-09 17:24:49 +00:00
Chia-I Wu
f0e0daf46b venus: add VK_EXT_shader_demote_to_helper_invocation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15265>
2022-03-09 17:24:49 +00:00
Chia-I Wu
99473f610a venus: update venus-protocol headers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15265>
2022-03-09 17:24:49 +00:00
Marcin Ślusarz
823cffbe1c anv: include Primitive Header in mesh shader per-primitive output
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15303>
2022-03-09 16:52:59 +00:00
Marcin Ślusarz
f410c1142f anv: set number of viewports in clip state (mesh)
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15303>
2022-03-09 16:52:59 +00:00
Marcin Ślusarz
81df66bfff intel/compiler: mark some variables as per-primitive in FS if they come from MS
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15303>
2022-03-09 16:52:59 +00:00
Marcin Ślusarz
8c16ce53a9 intel/compiler: handle ViewportIndex, PrimitiveID and Layer in MUE setup
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15303>
2022-03-09 16:52:59 +00:00
Marcin Ślusarz
bc4f8c073a intel/compiler: inject MUE initialization
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15303>
2022-03-09 16:52:59 +00:00
Marcin Ślusarz
333a490e32 intel/compiler: shift mesh urb read/write window when offset is too large
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15303>
2022-03-09 16:52:59 +00:00
Samuel Pitoiset
6c1c9067d9 aco: always emit vk_cvt_pkrtz_f16_f32 for nir_op_pack_half_2x16_split
From the VK_KHR_shader_float_controls extension:

    "5) Do any of the “Pack” GLSL.std.450 instructions count as
     conversion instructions and have the rounding mode applied?"

    "RESOLVED: No, only instructions listed in “section 3.32.11.
     Conversion Instructions” of the SPIR-V specification count as
     conversion instructions."

This is also the same logic as the LLVM backend.

No fossils-db changes on Sienna Cichlid.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15301>
2022-03-09 16:24:20 +00:00
Erik Faye-Lund
fa41bd0687 docs: improve language in zink article
Turns out, this was not proper use of language!

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15300>
2022-03-09 16:19:16 +00:00
Erik Faye-Lund
e666134975 docs: fixup zink gl 4.3 requirements
The multiViewport feature isn't required for GL 4.3, it's required for
GL 4.1. Technically speaking, we could have just dropped it because we
already list the maxViewports requirement. But it seems better to be
very clear here to me.

Fixes: 29f8f21bff ("docs: document zink GL 4.3 requirements")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15300>
2022-03-09 16:19:16 +00:00
Iago Toral Quiroga
44feff93c2 broadcom/compiler: don't always assign r5 if available
Instead, only favor assigning r5 if we have first decided to
assign an accumulator. This helps with assining r5 to short
lived uniforms, favoring accumulator rotation to facilitate
QPU merges.

total instructions in shared programs: 12656164 -> 12628339 (-0.22%)
instructions in affected programs: 5368373 -> 5340548 (-0.52%)
helped: 17420
HURT: 9996

total uniforms in shared programs: 3704776 -> 3704863 (<.01%)
uniforms in affected programs: 12247 -> 12334 (0.71%)
helped: 23
HURT: 78

total max-temps in shared programs: 2153505 -> 2152684 (-0.04%)
max-temps in affected programs: 26468 -> 25647 (-3.10%)
helped: 569
HURT: 328

total fills in shared programs: 4656 -> 4657 (0.02%)
fills in affected programs: 43 -> 44 (2.33%)
helped: 0
HURT: 1

total sfu-stalls in shared programs: 34728 -> 34403 (-0.94%)
sfu-stalls in affected programs: 3411 -> 3086 (-9.53%)
helped: 842
HURT: 534

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15276>
2022-03-09 15:53:04 +00:00
Iago Toral Quiroga
77f58b46d9 broadcom/compiler: add comment on why we don't use r5 with ldunifa
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15276>
2022-03-09 15:53:04 +00:00
Iago Toral Quiroga
5b140428b0 broadcom/compiler: adjust register threshold for 2-thread compiles
We have twice the registers in this case so it makes sense to double
this as well. While this causes slight regressions in shader-db
stats (due to additional register pressure), it helps us hide latency
of memory reads better on 2-thread compiles, where the thread switch
mechanism will be less effective. This shows a ~3% performance
improvement on the UE4 SunTemple demo.

total instructions in shared programs: 12642413 -> 12656164 (0.11%)
instructions in affected programs: 2272652 -> 2286403 (0.61%)
helped: 2924
HURT: 3389

total uniforms in shared programs: 3703861 -> 3704776 (0.02%)
uniforms in affected programs: 213729 -> 214644 (0.43%)
helped: 823
HURT: 1272

total max-temps in shared programs: 2150686 -> 2153505 (0.13%)
max-temps in affected programs: 191332 -> 194151 (1.47%)
helped: 1900
HURT: 1891

total spills in shared programs: 3255 -> 3274 (0.58%)
spills in affected programs: 166 -> 185 (11.45%)
helped: 3
HURT: 6

total fills in shared programs: 4630 -> 4656 (0.56%)
fills in affected programs: 367 -> 393 (7.08%)
helped: 7
HURT: 15

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15276>
2022-03-09 15:53:04 +00:00
Iago Toral Quiroga
a35b47a0b1 broadcom/compiler: add a strategy to disable scheduling of general TMU reads
This can add quite a bit of register pressure so it makes sense to disable it
to prevent us from dropping to 2 threads or increase spills:

total instructions in shared programs: 12672813 -> 12642413 (-0.24%)
instructions in affected programs: 256721 -> 226321 (-11.84%)
helped: 719
HURT: 77

total threads in shared programs: 415534 -> 416322 (0.19%)
threads in affected programs: 788 -> 1576 (100.00%)
helped: 394
HURT: 0

total uniforms in shared programs: 3711370 -> 3703861 (-0.20%)
uniforms in affected programs: 28859 -> 21350 (-26.02%)
helped: 204
HURT: 455

total max-temps in shared programs: 2159439 -> 2150686 (-0.41%)
max-temps in affected programs: 32945 -> 24192 (-26.57%)
helped: 585
HURT: 47

total spills in shared programs: 5966 -> 3255 (-45.44%)
spills in affected programs: 2933 -> 222 (-92.43%)
helped: 192
HURT: 4

total fills in shared programs: 9328 -> 4630 (-50.36%)
fills in affected programs: 5184 -> 486 (-90.62%)
helped: 196
HURT: 0

Compared to the stats before adding scheduling of non-filtered
memory reads we see we that we have now gotten back all that was
lost and then some:

total instructions in shared programs: 12663186 -> 12642413 (-0.16%)
instructions in affected programs: 2051803 -> 2031030 (-1.01%)
helped: 4885
HURT: 3338

total threads in shared programs: 415870 -> 416322 (0.11%)
threads in affected programs: 896 -> 1348 (50.45%)
helped: 300
HURT: 74

total uniforms in shared programs: 3711629 -> 3703861 (-0.21%)
uniforms in affected programs: 158766 -> 150998 (-4.89%)
helped: 1973
HURT: 499

total max-temps in shared programs: 2138857 -> 2150686 (0.55%)
max-temps in affected programs: 177920 -> 189749 (6.65%)
helped: 2666
HURT: 2035

total spills in shared programs: 3860 -> 3255 (-15.67%)
spills in affected programs: 2653 -> 2048 (-22.80%)
helped: 77
HURT: 21

total fills in shared programs: 5573 -> 4630 (-16.92%)
fills in affected programs: 3839 -> 2896 (-24.56%)
helped: 81
HURT: 15

total sfu-stalls in shared programs: 39583 -> 38154 (-3.61%)
sfu-stalls in affected programs: 8993 -> 7564 (-15.89%)
helped: 1808
HURT: 1038

total nops in shared programs: 324894 -> 323685 (-0.37%)
nops in affected programs: 30362 -> 29153 (-3.98%)
helped: 2513
HURT: 2077

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15276>
2022-03-09 15:53:04 +00:00
Iago Toral Quiroga
f783bd0d2a broadcom/compiler: define v3d-specific delays for NIR instructions
We do a few changes over NIR's defaults:

1. Lower delay for texture reads. Empirically, we don't observe any
   benefits with delays over 50 and since this delay value is still
   used by the scheduler in the "favor register pressure" case it is
   benefitial to avoid overestimating it too much.

2. Adjust delay for non-filtered TMU reads to the delay selected for
   texture reads.

3. In our case, UBO reads from dynamically uniform addresses don't
   use the TMU and have a latency of 1 instruction in the best case
   scenario or 4 at worse, so we go with 1 so we don't try to move
   this early.

This helps us get back some of what we lost when updating the
default scheduler configuration to add a delay for non-filtered
memory reads:

total instructions in shared programs: 13126587 -> 12671765 (-3.46%)
instructions in affected programs: 3764097 -> 3309275 (-12.08%)
helped: 14664
HURT: 4244

total threads in shared programs: 407208 -> 415522 (2.04%)
threads in affected programs: 8716 -> 17030 (95.39%)
helped: 4224
HURT: 67

total uniforms in shared programs: 3812698 -> 3711224 (-2.66%)
uniforms in affected programs: 335170 -> 233696 (-30.28%)
helped: 2816
HURT: 3551

total max-temps in shared programs: 2318430 -> 2159345 (-6.86%)
max-temps in affected programs: 539991 -> 380906 (-29.46%)
helped: 13173
HURT: 1440

total spills in shared programs: 49086 -> 5966 (-87.85%)
spills in affected programs: 48306 -> 5186 (-89.26%)
helped: 1655
HURT: 28

total fills in shared programs: 55810 -> 9328 (-83.29%)
fills in affected programs: 54821 -> 8339 (-84.79%)
helped: 1659
HURT: 22

LOST:   0
GAINED: 3

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15276>
2022-03-09 15:53:04 +00:00
Iago Toral Quiroga
fed51585c4 nir/schedule: allow drivers to decide about instruction latency
On V3D reading UBOs from uniform addresses uses a more efficient
mechanism with lower latency. On other platforms there may be
simular scenarios.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15276>
2022-03-09 15:53:04 +00:00
Iago Toral Quiroga
e7a4e97076 nir/schedule: use larger delay for non-filtered memory reads
This has been pending for a long time. It is not very consistent to
add a significant delay for textures and not do it for UBOs, etc
The reason we have not been doing this so far is the accumulated effect
on register pressure for V3D as shown by shader-db results below, but
from the point of view of a generic scheduler it makes sense to do this.

Later patches will address V3D specific issues with register pressure
derived from this by letting the driver control its instruction delay
settings.

total instructions in shared programs: 12662138 -> 13126587 (3.67%)
instructions in affected programs: 1813091 -> 2277540 (25.62%)
helped: 2410
HURT: 10499

total threads in shared programs: 415858 -> 407208 (-2.08%)
threads in affected programs: 17348 -> 8698 (-49.86%)
helped: 8
HURT: 4333

total uniforms in shared programs: 3711483 -> 3812698 (2.73%)
uniforms in affected programs: 128012 -> 229227 (79.07%)
helped: 3474
HURT: 2143

total max-temps in shared programs: 2138763 -> 2318430 (8.40%)
max-temps in affected programs: 318780 -> 498447 (56.36%)
helped: 588
HURT: 11997

total spills in shared programs: 3860 -> 49086 (1171.66%)
spills in affected programs: 709 -> 45935 (6378.84%)
helped: 23
HURT: 1595

total fills in shared programs: 5573 -> 55810 (901.44%)
fills in affected programs: 1067 -> 51304 (4708.25%)
helped: 23
HURT: 1595

LOST:   3
GAINED: 0

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15276>
2022-03-09 15:53:04 +00:00
Iago Toral Quiroga
3bd041e2fb nir/schedule: handle nir_intrinsic_group_memory_barrier
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15276>
2022-03-09 15:53:04 +00:00
Iago Toral Quiroga
46e330c07e nir/schedule: fix handling of generic memory barrier
We can get a generic nir_intrinsic_memory_barrier to represent a
barrier involving multiple semantics (instead of getting individual
specific barriers for each semantic). This means that we need to
consider these as potentially affecting shared memory access as well.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15276>
2022-03-09 15:53:04 +00:00
Iago Toral Quiroga
9ef499b315 broadcom/compiler: stop moving UBO loads before NIR scheduling
This doesn't have any significant impact shader-db stats and would
reduce our capacity to hide latency from the loads, so it is probably
undesirable:

total instructions in shared programs: 12663189 -> 12663186 (<.01%)
instructions in affected programs: 4222 -> 4219 (-0.07%)
helped: 9
HURT: 4

total uniforms in shared programs: 3711624 -> 3711629 (<.01%)
uniforms in affected programs: 186 -> 191 (2.69%)
helped: 0
HURT: 2

total max-temps in shared programs: 2138822 -> 2138857 (<.01%)
max-temps in affected programs: 569 -> 604 (6.15%)
helped: 1
HURT: 9

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15276>
2022-03-09 15:53:03 +00:00
Michel Zou
bf7777a5d4 lavapipe: set non-zero device/driver uuid
Closes #5875

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15230>
2022-03-09 15:10:45 +00:00
Danylo Piliaiev
2e878293f4 turnip: Make autotuner work with reusable command buffers
To achieve it each command buffer now has its own GPU memory.

However the BOs usage by autotuner is not optimal, the ideal
pattern would be to use some memory pool to suballocate small
GPU memory chunks, since most command buffers have only a few
renderpasses.

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

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14996>
2022-03-09 12:56:31 +00:00
Gert Wollny
d9e400b9b6 virgl: Add a few more formats to the format table
These formats are used by the piglit

   arb_texture_buffer_object-formats fs arb

Adding them here keeps the piglit from crashing, but most of the related
tests don't pass.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13645>
2022-03-09 09:59:53 +00:00
Kenneth Graunke
8b9045e7a4 intel: Use 3DSTATE_BINDING_TABLE_POOL_ALLOC exclusively on Gfx11+
On Icelake and later, we can use a new 3DSTATE_BINDING_TABLE_POOL_ALLOC
command to update the location of the binder (buffer containing binding
table entries), rather than having to move Surface State Base Address
via a STATE_BASE_ADDRESS command.  This has less stalling and also means
our surface addresses can remain relative to a fixed 4GB address range,
meaning we don't have to re-stream them any time the binder changes.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14507>
2022-03-09 09:18:59 +00:00
Kenneth Graunke
e3a0e97300 intel: Limit Wa_1607854226 to Gfx12.0 only
This workaround is needed on all Gfx12.0 parts, but doesn't appear to be
necessary on XeHP.  The other drivers do not appear to be applying this
workaround on those parts.  As further evidence, we accidentally added
the 3DSTATE_BINDING_TABLE_POOL_ALLOC commands after switching back to
GPGPU mode, which would be an incorrect way to implement the workaround,
and things seem to be working.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14507>
2022-03-09 09:18:59 +00:00
Kenneth Graunke
ab47cad4fb iris: Rename surface_base_address to binder_address in a few places
On Gfx11+, we're going to stop changing Surface State Base Address
and instead start changing the Binding Table Pool address instead.

So, rename a few things to track the last binder address, which is
what we're actually changing, regardless of how we program it.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14507>
2022-03-09 09:18:59 +00:00
Kenneth Graunke
db34c71513 iris: Use more efficient binding table pointer formats on Icelake+.
Skylake and older use a 15:5 binding table pointer format, which means
our binder can be at most 64kB in size.  Each binding table within the
binder must be aligned to 32B.

XeHP uses a new 20:5 binding table format, which allows us to increase
the binder size to 1MB while retaining the nice 32B alignment.  Larger
binders mean fewer stalls as we update the base address for the binder.

Icelake and Tigerlake can either use the 15:5 format or an 18:8 format.
18:8 mode requires the base of each binding table to be aligned to 256B
instead of 32B, but it gives us a maximum binder size of 512kB.

We can store 64 binding table entries in a 256B chunk (256B / 4B = 64),
but only 8 entries in a 32B chunk (32B / 4B = 8).  Assuming that most
binding tables have fewer than 64 entries, this means that with the 18:8
format, we're likely to be able to fit 2048 (512KB / 256B) tables into a
a buffer before needing to allocate a new one and stall.

Technically, the old format could also store 2048 binding tables per
buffer as well (64KB / 32B = 2048).  However, tables that needed more
than 8 entries would need multiple 32B chunks.  A single table would
take multiple aligned chunks, while with the larger 256B format, it
could fit in a single one.

This cuts binder resets by 6.3% on a Shadow of Mordor benchmark trace.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14507>
2022-03-09 09:18:59 +00:00
Jason Ekstrand
a83c91a261 blorp: Add a binding_table_offset_to_pointer helper
On Gen11+, we have a feature that requires us to shift binding table
offsets by 3.  This adds a helper which gives the driver a hook to do
this if it so chooses.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14507>
2022-03-09 09:18:59 +00:00
Pierre-Eric Pelloux-Prayer
3c3a8f853d gallium/tc: zero alloc transfers
Otherwise this causes trouble with unitialized memory, eg with:
   struct si_transfer {
      struct threaded_transfer b;
      struct si_resource *staging;
   };
'staging' will not be initialized and this causes #6109.

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

Cc: mesa-stable
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15298>
2022-03-09 08:48:59 +00:00
Pierre-Eric Pelloux-Prayer
caeec6262d util/slab: add slab_zalloc
A a variant that clears the allocated object to 0.

Cc: mesa-stable

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15298>
2022-03-09 08:48:59 +00:00
Danylo Piliaiev
2cd30266f1 tu: Refactor VS DECODE/DEST to be emitted in two pkt4
Refactor to emit VFD_DECODE and VFD_DEST_CNTL in two packets
regardless of attribute count.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14584>
2022-03-09 08:21:40 +00:00
Mike Blumenkrantz
fa323cb93a mesa/st: make export_point_size shader key clobber existing psiz
this is necessary to upload the API value using the uniform constant

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15228>
2022-03-09 05:10:21 +00:00
Mike Blumenkrantz
9ae0cdc453 mesa/st: check max output components for adding pointsize during precompile
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15228>
2022-03-09 05:10:21 +00:00
Mike Blumenkrantz
070a7b506d mesa/st: count FF shaders as needing psiz export for precompile
this is consistent with logic for regular compiles

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15228>
2022-03-09 05:10:21 +00:00
Mike Blumenkrantz
1183988d74 mesa/st: precompile with API pointsize only if the shader doesn't have pointsize
this is a more accurate hint, and maintains the existing behavior given
subsequent changes to this area

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15228>
2022-03-09 05:10:21 +00:00
Mike Blumenkrantz
96098d7c25 mesa/st: simplify pointsize precompile conditional
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15228>
2022-03-09 05:10:21 +00:00
Mike Blumenkrantz
882abacde3 mesa/st: simplify pointsize shader update conditional
ES contexts have no API toggle for this, so it will never be flagged

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15228>
2022-03-09 05:10:21 +00:00
Mike Blumenkrantz
b73663c51e mesa: always set PointSizeEnabled for API_OPENGLES2
this is implicit, so make it explicit

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15228>
2022-03-09 05:10:21 +00:00
Mike Blumenkrantz
9d98bc238e mesa/st: only add pointsize output if it doesn't exceed max component limit
fixes (zink-nvidia):
dEQP-GLES31.functional.geometry_shading.basic*

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15228>
2022-03-09 05:10:21 +00:00
Mike Blumenkrantz
0d80aed363 nir/gather_info: check copy_deref instrs for writing outputs
this is a valid way to write an output even though it usually gets rewritten
to some other instruction later on

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15228>
2022-03-09 05:10:21 +00:00
Mike Blumenkrantz
fdee7240ff mesa/st: conditionally add pointsize outputs to ES tess/geom shaders
if the driver requires this value to be set, add it if the shader doesn't
use the ext to allow exporting it

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15228>
2022-03-09 05:10:21 +00:00
Mike Blumenkrantz
597bd11b7b mesa/st: add a gl_program struct flag to skip psiz exports for xfb
if this output did not exist in the original shader,
then it must not be exported in xfb

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15228>
2022-03-09 05:10:21 +00:00
Mike Blumenkrantz
53cbba83eb glsl: store OES/EXT point_size extension enablement to shader struct
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15228>
2022-03-09 05:10:21 +00:00
Boris Brezillon
02906baba7 panvk: Implement vkCmdDispatch()
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15248>
2022-03-09 04:50:41 +00:00
Boris Brezillon
1056b3e39e panvk: Add support for storage image
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15248>
2022-03-09 04:50:41 +00:00
Boris Brezillon
eca0a0e29e panvk: Move dummy attribute buffer emission out of emit_{attribute,varying}_bufs
So we can easily add entries after the standard varyings/attributes
(like image descriptors in the attribute array).

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15248>
2022-03-09 04:50:41 +00:00
Boris Brezillon
0e7e1b64fc panvk: Add support for storage/uniform buffers with dynamic offsets
The idea of storing offsets in a separate UBO and lowering accesses to
UBOs/SSBOs with a dynamic offset was not great. Let's apply the offset
at UBO/SSBO emission time instead.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15248>
2022-03-09 04:50:41 +00:00
Boris Brezillon
13378e4129 panvk: Support creation of compute pipelines
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15248>
2022-03-09 04:50:41 +00:00
Boris Brezillon
b05ffc9fec panvk: Add support for storage buffers
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15248>
2022-03-09 04:50:41 +00:00
Boris Brezillon
9a20467cf2 panvk: Add support for push constants
Push constants are stored in a separate UBO.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15248>
2022-03-09 04:50:41 +00:00
Mike Blumenkrantz
3634063b08 zink: handle spirv xfb insanity
this comes in two flavors:
* streamout of array<struct/block>
* partial streamout of array/struct/block

for the former:
* arrays of structs can just be blasted out in the initial var declaration (easy)
* arrays of blocks must be output to separate xfb buffers for each array block,
  which requires skipping initial xfb blast-off and instead propagating the values
  using tmp variables at a later point

for the latter:
* the optimal way to do this is to unwrap the struct first to figure out what's being
  emitted, at which point the value can be extracted and exported

fixes the rest of spec@arb_gl_spirv@execution@xfb
...except spec@arb_gl_spirv@execution@xfb@vs_block_array, which I'm suspecting is broken
due to vtn bugs

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15224>
2022-03-09 04:39:52 +00:00
Mike Blumenkrantz
dfbb7c1f73 zink: store shader to ntv_context
it's insane the gymnastics that have to be done because this wasn't stored

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15224>
2022-03-09 04:39:52 +00:00
Mike Blumenkrantz
76fe6f7235 zink: handle remaining xfb corner cases during analysis
this now handles inlining of stupid types (dvec3, dmatX) and complex
types (goku) as seen in cts

fixes:
KHR-Single-GL46.enhanced_layouts.xfb_explicit_location
KHR-Single-GL46.enhanced_layouts.xfb_struct_explicit_location

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15224>
2022-03-09 04:39:52 +00:00
Mike Blumenkrantz
3f7da0c584 zink: fix xfb analysis variable finding for arrays
this fixes clipdistance exports

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15224>
2022-03-09 04:39:52 +00:00
Mike Blumenkrantz
4ed7329236 zink: correctly set xfb packed output offsets
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15224>
2022-03-09 04:39:52 +00:00
Mike Blumenkrantz
432700fc61 zink: store the correct number of components for xfb packing outputs
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15224>
2022-03-09 04:39:52 +00:00
Mike Blumenkrantz
a5c7d34fdf zink: use 64bit mask for xfb analysis
I don't know how this worked before since all the values are oob?

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15224>
2022-03-09 04:39:52 +00:00
Mike Blumenkrantz
a0feafbcc8 ci: more stoney flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14854>
2022-03-09 03:54:37 +00:00
Mike Blumenkrantz
ddfa9e7cc9 ci: add another stoney flake
from #6109

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14854>
2022-03-09 03:54:37 +00:00
Mike Blumenkrantz
6ab720f1f4 aux/cso: stop tracing during cso_unbind()
this unnecessarily bloats lavapipe traces

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14854>
2022-03-09 03:54:37 +00:00
Mike Blumenkrantz
0e51c47816 aux/trace: dump more rasterizer state members
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14854>
2022-03-09 03:54:37 +00:00
Mike Blumenkrantz
ec45b7ed32 aux/trace: dump clear_texture colors
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14854>
2022-03-09 03:54:37 +00:00
Mike Blumenkrantz
296e26eec8 aux/trace: dump clear colors as uints
dumping as float is nice if the clear color is a float, but if it isn't
then the value is useless

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14854>
2022-03-09 03:54:37 +00:00
Mike Blumenkrantz
8142fc5a45 aux/trace: rzalloc the context struct
this has problems if pointers are garbage

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14854>
2022-03-09 03:54:37 +00:00
Mike Blumenkrantz
f1cdaf36df aux/trace: more screen methods
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14854>
2022-03-09 03:54:37 +00:00
Mike Blumenkrantz
204ea77b06 lavapipe: fix pipeline creation for blend and zs states
these values are read based on the specified subpass containing the
required attachments, not on the overall renderpass

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15282>
2022-03-09 01:13:42 +00:00
Mike Blumenkrantz
7114490115 lavapipe: update multisample state after blend state
null blend pipeline state will zero the blend struct, which would cause
values set here to be overwritten

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15282>
2022-03-09 01:13:42 +00:00
Rob Clark
711f0d1df4 turnip: Don't call getenv() directly
I noticed it was using getenv directly when I tried to use 'setprop
mesa.tu.debug ..' on android.  Use os_get_option() instead so we get
sysprop fallback on android.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15289>
2022-03-09 00:22:36 +00:00
Gert Wollny
c9d99b7eec virgl: Fix texture transfers by using a staging resource
This commit fixes the following flaws in the implementation:

* when a resource was re-allocated, the guest side storage
  was also allocated
* when a source needs a readback before being written to, then
  the call would go through vws->transfer_get, thereby bypassing the
  staging resource, and this would fail on the host, because no
  the allocated IOV was too small (just one byte)
* if the texture write would need neither flush nor readback, the
  old code path would be used expecting that guest side backing stogage
  for the texture.

v2: - actually do a readback to the stageing resource when it is required
    - fix typo (Lepton)

v3: Don't use stageing transfers if the host can't read back the data
    by rendering to an FBO or calling getTexImage, because in this case
    we rely on the IOV to hold the date.

v4: Also don't use staging transfers if the format is no readback
    format. Otherwise we have to deal with the resolve blit, and
    this is currently not working correctly.

v5: add a new flag that indicates whether non-renderable textures can
    be read back (either via glGetTexImage or GBM)

v6: Restrict the use of staging texture transfers to textures that can
    be read back, and on GLES also if the they are bound to scanout and
    the host uses minigbm to allocate such textures.
    For that replace the flag indicating the capability to read back
    non-renderable textures with a cap that indicates whether scanout
    textures can be read back.

v7: update virglrenderer version in the CI

v8: update use of stageing (Chia-I)

v9: remove superflous check and assignment (Chia-I)

v10: disable stageing textures for arrays with stencil format. This is a
     workaround for failures of the CI.

Fixes: cdc480585c
    virgl/drm: New optimization for uploading textures

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14495>
2022-03-08 23:39:27 +01:00
Mike Blumenkrantz
165a880f1a llvmpipe: clamp surface clear geometry
avoid oob writes to avoid crashing

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14655>
2022-03-08 22:03:28 +00:00
Mike Blumenkrantz
2d1b506acf lavapipe: clamp clear attachments rects
there is at least one unnamed game which has problems with this, so try
to avoid crashing

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14655>
2022-03-08 22:03:28 +00:00
Mike Blumenkrantz
4c76a19ca3 llvmpipe: fix debug print iterating in set_framebuffer_state
this would potentially access garbage memory by checking the existing
state using the incoming state's iterator values

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14857>
2022-03-08 21:42:02 +00:00
Mike Blumenkrantz
3ef093f697 zink: ci updates
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15274>
2022-03-08 21:30:29 +00:00
Mike Blumenkrantz
5fae35fb17 zink: fix 64bit float shader ops
this was being set from back before zink actually supported 64bit
natively and only 32bit was functional, but it breaks 64bit support

cc: mesa-stable

fixes (lavapipe):
KHR-GL46.gpu_shader_fp64.builtin.mod_dvec2
KHR-GL46.gpu_shader_fp64.builtin.mod_dvec3
KHR-GL46.gpu_shader_fp64.builtin.mod_dvec4

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15274>
2022-03-08 21:30:29 +00:00
Mike Blumenkrantz
9579df6a7f zink: run nir_lower_phis_to_scalar in optimization loop
fixes (lavapipe):
dEQP-GLES3.functional.shaders.switch.switch_in_do_while_loop_dynamic*

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15274>
2022-03-08 21:30:29 +00:00
Samuel Pitoiset
342e6f8332 radv,aco,llvm: lower post shuffle vertex in NIR
fossils-db (Sienna Cichlid):
Totals from 774 (0.57% of 134913) affected shaders:
VGPRs: 26496 -> 26312 (-0.69%)
CodeSize: 1825936 -> 1828812 (+0.16%); split: -0.04%, +0.20%
MaxWaves: 22046 -> 22062 (+0.07%)
Instrs: 347634 -> 347975 (+0.10%); split: -0.05%, +0.15%
Latency: 1363949 -> 1356426 (-0.55%); split: -0.59%, +0.04%
InvThroughput: 221529 -> 221380 (-0.07%); split: -0.10%, +0.04%
VClause: 5682 -> 5676 (-0.11%); split: -1.46%, +1.36%
SClause: 7485 -> 7411 (-0.99%); split: -1.48%, +0.49%
Copies: 30481 -> 30420 (-0.20%); split: -0.51%, +0.31%
PreVGPRs: 19717 -> 19656 (-0.31%)

fossil-db (Polaris10):
Totals from 896 (0.66% of 135960) affected shaders:
SGPRs: 49824 -> 49648 (-0.35%); split: -0.39%, +0.03%
VGPRs: 31040 -> 29948 (-3.52%); split: -3.62%, +0.10%
CodeSize: 875960 -> 875920 (-0.00%); split: -0.06%, +0.05%
MaxWaves: 6380 -> 6429 (+0.77%)
Instrs: 171522 -> 171482 (-0.02%); split: -0.07%, +0.05%
Latency: 1356082 -> 1334386 (-1.60%); split: -1.61%, +0.01%
InvThroughput: 553389 -> 552957 (-0.08%); split: -0.08%, +0.00%
VClause: 4317 -> 4244 (-1.69%); split: -2.41%, +0.72%
SClause: 6157 -> 6139 (-0.29%); split: -0.45%, +0.16%
Copies: 9340 -> 9235 (-1.12%); split: -1.24%, +0.12%
PreVGPRs: 22366 -> 22116 (-1.12%)

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/15113>
2022-03-08 19:18:01 +00:00
Timur Kristóf
4b99b528f5 nir: Introduce workgroup_index and ability to lower workgroup_id to it.
The workgroup_index is intended for situations when a 3 dimensional
workgroup_id is not available on the HW, but a 1 dimensional index is.
In this case, we can use lower the 3D ID to use this.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15103>
2022-03-08 17:36:31 +00:00
Timur Kristóf
6a4c01f3ef nir: Extract lower_id_to_index into a separate function.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15103>
2022-03-08 17:36:31 +00:00
Timur Kristóf
64acec0ef9 nir: Fix lowering terminology of compute system values: "from"->"to".
This is to match other NIR terminology.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15103>
2022-03-08 17:36:31 +00:00
Jason Ekstrand
541f08cd4c panvk: Non-destructively stub GetRenderAreaGranularity
Don't crash.  Just print a warning and return 1x1.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15285>
2022-03-08 17:03:47 +00:00
Jason Ekstrand
afe2ef9afc panvk: Advertise zero sparse format properties
This is the correct implementation when you don't support sparse and
fixes piles of CTS crashes.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15285>
2022-03-08 17:03:47 +00:00
Jason Ekstrand
8feed1f114 panvk: Advertise VK_KHR_get_physical_device_properties2
All the entrypooints are already implemented and a bunch of Vulkan CTS
tests assume this extension exists.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15285>
2022-03-08 17:03:47 +00:00
Rob Clark
3937c47c48 gallium/dri: Add missing in_fence_fd initialization
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6108
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Tested-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15272>
2022-03-08 16:38:00 +00:00
Yogesh Mohan Marimuthu
3332fcd9c0 vulkan/device_select: add has_vulkan11 flag with has_pci_bus flag
In EnumeratePhysicalDevices(), pci bus info is available only in
vulkan version >= 1.1. hence adding has_vulkan11 flag in places
where has_pci_bus is used in EnumeratePhysicalDevices() code flow.

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14535>
2022-03-08 14:23:41 +00:00
Yogesh Mohan Marimuthu
1cc549949d vulkan/device_select: for vulkan 1.0 use vid/did for boot_vga
In device select layer EnumeratePhysicalDevices() function pci
bus information is available only in case of vulkan >= 1.1.
Hence use vid/did to match boot_vga device in case of vulkan 1.0.

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14535>
2022-03-08 14:23:41 +00:00
Timur Kristóf
5b9bf3434f nir: Fix handling of NV_mesh_shader PRIMITIVE_INDICES output.
PRIMITIVE_INDICES is a flat array in NV_mesh_shader,
not a proper arrayed output, as opposed to D3D-style
mesh shaders where it's addressed by the primitive index.

Prevent assigning several slots to primitive indices,
to avoid issues.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15160>
2022-03-08 13:44:10 +00:00
Rhys Perry
d068eb53e8 aco/insert_exec_mask: optimize top-level transition to exact before demote
fossil-db (Sienna Cichlid):
Totals from 5767 (3.55% of 162293) affected shaders:
Instrs: 3264949 -> 3257527 (-0.23%); split: -0.23%, +0.00%
CodeSize: 17835692 -> 17806004 (-0.17%); split: -0.17%, +0.00%
Latency: 45990060 -> 45987924 (-0.00%); split: -0.00%, +0.00%
InvThroughput: 7643850 -> 7643835 (-0.00%); split: -0.00%, +0.00%
Copies: 193641 -> 186219 (-3.83%); split: -3.84%, +0.01%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15244>
2022-03-08 12:49:59 +00:00
Rhys Perry
42a5be975a aco/insert_exec_mask: use get_exec_op
No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15244>
2022-03-08 12:49:59 +00:00
Rhys Perry
aa55ecc296 aco/insert_exec_mask: fix top-level to-exact with non-global exact mask
After transitioning to exact after a discard, the exec stack might be:
[exact|global, wqm, exact]

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15244>
2022-03-08 12:49:59 +00:00
Cristian Ciocaltea
ded789fcaf radeonsi/ci: Mark a bunch of flaky tests on stoney
radeonsi-stoney-gl:amd64 job fails due to random crashes of some
'dEQP-GLES3.functional.buffer.map.write.explicit_flush.*' tests.

Fix the pipeline by adding them to 'radeonsi-stoney-flakes.txt'.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15238>
2022-03-08 12:52:54 +02:00
Cristian Ciocaltea
090f6f1b33 ci/zink: Report flake test
Mark 'KHR-GL46.shader_image_load_store.advanced-sso-subroutine' as
flake since it failed several times while attempting to merge this MR.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15238>
2022-03-08 12:52:54 +02:00
Cristian Ciocaltea
e8882f0ef8 ci: Improve interrupt signal handling in crosvm-runner.sh
Run crosvm as a background process in order to allow intercepting
interrupt signals (INT, TERM) and properly release/cleanup any allocated
resources.

This is particularly helpful when one or more crosvm tasks hang, which
will eventually prevent subsequent instances to be started - currently
we can handle up to 128 concurrent crosvm instances per runner.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15238>
2022-03-08 12:52:54 +02:00
Cristian Ciocaltea
1f0a0839eb ci: Increase limit of concurrent crosvm instances per runner
Ensure we can handle up to 128 concurrent crosvm instances per runner
with the current CID generator. This is a safety margin for the new
64-core runners.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15238>
2022-03-08 12:52:54 +02:00
Dave Airlie
8346983775 gallivm/nir: extract a valid texture index according to exec_mask.
When using indirect textures, some lanes may not be active,
particularly in a loop, so as with some other areas, extracting
the correct lane is needed here. This extracts the last valid one.

KHR-GL45.texture_barrier.* on zink.

Fixes: e168d148d7 ("gallivm/nir: handle non-uniform texture offsets")

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15259>
2022-03-08 08:42:06 +00:00
Samuel Pitoiset
e449acac9d radv/ci: remove unused files
These files are no longer used.

Fixes: cc327a0fe4 ("amd, ci: Remove unused runners.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Charlie Turner <cturner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15264>
2022-03-08 08:25:34 +01:00
Ilia Mirkin
4e45847d0a freedreno: add a420 deqp-runner files
This doesn't actually get run in CI, but this helps track outstanding
issues / expectations. This is from a run on my IFC6540 with A420.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15251>
2022-03-08 01:23:05 +00:00
Ilia Mirkin
08db7f456a freedreno/a4xx: expose shaders and images, as well as ES 3.1
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15251>
2022-03-08 01:23:05 +00:00
Ilia Mirkin
0277f491ae freedreno/ir3: disable conversion folding on a4xx
Experiments suggest that e.g.

add.u r0.y, hr0.x, hr0.y

will result in the summed value in both the high and low words of r0.y.
This only happens with odd registers, not even ones (r0.x works fine).

Seen in the bit_count lowering (which turns out to be unnecessary, but
this is still a larger problem).

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15251>
2022-03-08 01:23:05 +00:00
Ilia Mirkin
4684425150 freedreno/ir3: no need to count bits 16b at a time for a4xx
This also works out nicely since a4xx has some sort of problem with the
16b-based lowering.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15251>
2022-03-08 01:23:05 +00:00
Ilia Mirkin
f628fd30de freedreno/a4xx: improve condition for disabling early z
This helps some subtests in the early-z piglit test, but leaves one
occlusion-based test still failing.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15251>
2022-03-08 01:23:05 +00:00
Ilia Mirkin
d11543ec52 freedreno/a4xx: extend astc and tg4 workarounds to compute shaders
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15251>
2022-03-08 01:23:05 +00:00
Mike Blumenkrantz
4a03619d81 Revert "lavapipe: accurately set image/ssbo access based on shader usage"
This reverts commit 821a49981f.

still flaky

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15271>
2022-03-07 18:00:42 -05:00
Matt Turner
8860ff3310 intel/perf: Destination array calculation into function
Cuts 119 KiB from iris_dri.so and libvulkan_intel.so.

   text    data     bss     dec     hex filename
 917511       0       0  917511   e0007 meson-generated_.._intel_perf_metrics.c.o (before)
 796986       0       0  796986   c293a meson-generated_.._intel_perf_metrics.c.o (after)

   text    data     bss     dec     hex filename
14130948 365708  210004 14706660 e067e4 iris_dri.so (before)
14009332 365708  210004 14585044 de8cd4 iris_dri.so (after)

   text    data     bss     dec     hex filename
8124225  214264   22820 8361309  7f955d libvulkan_intel.so (before)
8002609  214264   22820 8239693  7dba4d libvulkan_intel.so (after)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15237>
2022-03-07 21:09:54 +00:00
Matt Turner
d80d3c6760 intel/perf: Fix mistake in description string
Along with fixing the grammar, this allows it to be deduplicated since
the properly worded description exists in later generations' XMLs.

Cuts 96 B from iris_dri.so and libvulkan_intel.so.

   text	   data	    bss	    dec	    hex	filename
 917613	      0	      0	 917613	  e006d	meson-generated_.._intel_perf_metrics.c.o (before)
 917511	      0	      0	 917511	  e0007	meson-generated_.._intel_perf_metrics.c.o (after)

   text	   data	    bss	    dec	    hex	filename
14131044 365708	 210004	14706756 e06844	iris_dri.so (before)
14130948 365708	 210004	14706660 e067e4	iris_dri.so (after)

   text	   data	    bss	    dec	    hex	filename
8124321	 214264	  22820	8361405	 7f95bd	libvulkan_intel.so (before)
8124225	 214264	  22820	8361309	 7f955d	libvulkan_intel.so (after)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15237>
2022-03-07 21:09:54 +00:00
Matt Turner
7024b8e0eb intel/perf: Mark intel_perf_counter_* enums as PACKED
Reduces their sizes from 4 bytes to 1. Cuts 6 KiB from iris_dri.so and
libvulkan_intel.so.

   text    data     bss     dec     hex filename
 924401       0       0  924401   e1af1 meson-generated_.._intel_perf_metrics.c.o (before)
 917613       0       0  917613   e006d meson-generated_.._intel_perf_metrics.c.o (after)

   text    data     bss     dec     hex filename
14137732 365708  210004 14713444 e08264 iris_dri.so (before)
14131044 365708  210004 14706756 e06844 iris_dri.so (after)

   text    data     bss     dec     hex filename
8131009  214264   22820 8368093  7fafdd libvulkan_intel.so (before)
8124321  214264   22820 8361405  7f95bd libvulkan_intel.so (after)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15237>
2022-03-07 21:09:54 +00:00
Matt Turner
6c0246dcf4 intel/perf: Store indices to strings rather than pointers
The compiler does a good job of deduplicating strings already, but we
can eliminate the pointers to each string by combining the strings into
a single char array and storing only an index into that array.

The longest of the char arrays is the descriptions array, which is a
little over 45 KiB, so still under MSVC's 64 KiB string literal limit
[0]. Because the string length is under 64 KiB we can use uint16_t as
the index type, which roughly doubles our savings as compared to an int.

This cuts 77 KiB from iris_dri.so (0.5%) and libvulkan_intel.so (0.9%).

   text    data     bss     dec     hex filename
 926811   25920       0  952731   e899b meson-generated_.._intel_perf_metrics.c.o (before)
 924401       0       0  924401   e1af1 meson-generated_.._intel_perf_metrics.c.o (after)

   text    data     bss     dec     hex filename
14190852 391628  210004 14792484 e1b724 iris_dri.so (before)
14137732 365708  210004 14713444 e08264 iris_dri.so (after)

   text    data     bss     dec     hex filename
8184097  240184   22820 8447101  80e47d libvulkan_intel.so (before)
8131009  214264   22820 8368093  7fafdd libvulkan_intel.so (after)

relinfo:
iris_dri.so (before): 17765 relocations, 17545 relative (98%), 452 PLT entries, 1 for local syms (0%), 0 users
iris_dri.so (after) : 15605 relocations, 15385 relative (98%), 452 PLT entries, 1 for local syms (0%), 0 users

libvulkan_intel.so (before): 10720 relocations, 6989 relative (65%), 355 PLT entries, 1 for local syms (0%), 0 users
libvulkan_intel.so (after) :  8560 relocations, 4829 relative (56%), 355 PLT entries, 1 for local syms (0%), 0 users

[0] https://docs.microsoft.com/en-us/cpp/cpp/string-and-character-literals-cpp?view=msvc-170&viewFallbackFrom=vs-2019

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15237>
2022-03-07 21:09:54 +00:00
Matt Turner
df5e743c80 intel/perf: Use slimmer intel_perf_query_counter_data struct
intel_perf_query_counter contains fields for things we can't or don't
want to store in our static data (like runtime-determined max values) or
oa_read_counter function pointers which are dependent on the GPU gen and
would make deduplication very ineffective.

Cuts 16 KiB from iris_dri.so and libvulkan_intel.so.

   text    data     bss     dec     hex filename
 926811   43200       0  970011   ecd1b meson-generated_.._intel_perf_metrics.c.o (before)
 926811   25920       0  952731   e899b meson-generated_.._intel_perf_metrics.c.o (after)

   text    data     bss     dec     hex filename
14190852 408908  210004 14809764 e1faa4 iris_dri.so (before)
14190852 391628  210004 14792484 e1b724 iris_dri.so (after)

   text    data     bss     dec     hex filename
8184097  257464   22820 8464381  8127fd libvulkan_intel.so (before)
8184097  240184   22820 8447101  80e47d libvulkan_intel.so (after)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15237>
2022-03-07 21:09:54 +00:00
Matt Turner
bbbbb0325b intel/perf: Use a function to initialize perf counters
And specifically mark it with ATTRIBUTE_NOINLINE. Otherwise it will be
inlined and actually slightly increase code size.

Cuts 505 KiB from iris_dri.so and libvulkan_intel.so.

   text    data     bss     dec     hex filename
1538720       0       0 1538720  177aa0 meson-generated_.._intel_perf_metrics.c.o (before)
 926811   43200       0  970011   ecd1b meson-generated_.._intel_perf_metrics.c.o (after)

   text    data     bss     dec     hex filename
14751700 365708  210004 15327412 e9e0b4 iris_dri.so (before)
14190852 408908  210004 14809764 e1faa4 iris_dri.so (after)

   text    data     bss     dec     hex filename
8744913  214264   22820 8981997  890ded libvulkan_intel.so (before)
8184097  257464   22820 8464381  8127fd libvulkan_intel.so (after)

Relocations increase because the counter initializations are moved from
code (in .text) to pointers (in .text) to .rodata, which require
relocations.

relinfo:
iris_dri.so (before): 15605 relocations, 15385 relative (98%), 452 PLT entries, 1 for local syms (0%), 0 users
iris_dri.so (after) : 17765 relocations, 17545 relative (98%), 452 PLT entries, 1 for local syms (0%), 0 users

libvulkan_intel.so (before):  8560 relocations, 4829 relative (56%), 355 PLT entries, 1 for local syms (0%), 0 users
libvulkan_intel.so (after) : 10720 relocations, 6989 relative (65%), 355 PLT entries, 1 for local syms (0%), 0 users

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15237>
2022-03-07 21:09:54 +00:00
Matt Turner
5e6c7a572e intel/perf: Deduplicate perf counters
No changes in resulting code (yes, seriously!). GCC constant propagates
the static const arrays into the code, yielding bit for bit identical
results. This will however enable further cleanups.

Before this patch, we emit 11916 different initializations of
intel_perf_query_counter. With this patch we emit an array of 539 and
initialize the intel_perf_query_counters in terms of those.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15237>
2022-03-07 21:09:54 +00:00
Matt Turner
3172b5bbb8 intel/perf: Don't print leading space from desc_units()
Just an annoyance I noticed when I needed to generate the description
string in two different places.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15237>
2022-03-07 21:09:54 +00:00
Emma Anholt
12e065ddec intel/perf: Move some static blocks of C code out of the python script.
Now my editor can help me format code as I type.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15237>
2022-03-07 21:09:54 +00:00
Chia-I Wu
c795ae8b88 venus: fix properties of unsupported external fences/semaphores
compatibleHandleTypes should be cleared.

Fixed dEQP-VK.api.external.semaphore.sync_fd.info_timeline.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15266>
2022-03-07 20:43:50 +00:00
Ian Romanick
63d399b3fb iris/ci: Mark amd_performance_monitor tests as flakes.
On one attempt to merge !15210 failed because
spec@amd_performance_monitor@measure,UnexpectedPass.  In that same
report, the other two tests were listed under "some flakes."

Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Nanley Chery <nanley.g.chery@intel.com>
Acked-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15220>
2022-03-07 10:54:04 -08:00
Danylo Piliaiev
e2fc99b188 turnip: Add "rast_order" debug option to force rast order access
Enables rasterization order attachment access for all pipelines,
see VK_ARM_rasterization_order_attachment_access for details.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15262>
2022-03-07 17:07:18 +00:00
Pierre-Eric Pelloux-Prayer
52ceb9dcb6 gallium/tc: warn if an app is incompatible with cpu_storage
Instead of silently ignoring unmap calls.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15074>
2022-03-07 14:51:16 +01:00
Pierre-Eric Pelloux-Prayer
a5a8e19741 radeonsi: enable tc cpu_storage by default
Enable for all applications for all small buffers.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15074>
2022-03-07 14:51:15 +01:00
Pierre-Eric Pelloux-Prayer
cd0ef9b3f4 gallium/u_threaded: late alloc cpu_storage
Instead of allocating cpu_storage in threaded_resource_init, defer the
allocation to first use (in tc_buffer_map).
This avoids needless memory allocation if tc_buffer_disable_cpu_storage is
called before tc_buffer_map.

map_buffer_alignment is stored and serves as a "can cpu_storage be used" flag.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15074>
2022-03-07 14:51:15 +01:00
Pierre-Eric Pelloux-Prayer
7070178dfd radeonsi: use 1 shader compilation thread if NIR_PRINT is used
This avoids getting multiple shaders NIR code being printed at the
same time making the log unusable.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15074>
2022-03-07 14:51:15 +01:00
Georg Lehmann
6731460194 nir: Fix source type for fragment_fetch_amd.
Like txf_ms, these take integers not floats.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15242>
2022-03-07 12:21:12 +00:00
Pierre-Eric Pelloux-Prayer
50be692253 radeonsi/tests: always add the --gpu argument
To get the same argument in multi and single gpu situation.

Fixes: 21b0153833 ("radeonsi/tests: print PCI-id of GPU device under test")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15240>
2022-03-07 11:53:14 +01:00
Pierre-Eric Pelloux-Prayer
9c49550163 radeonsi: change rounding mode to round to even
Use ROUND_TO_EVEN instead of TRUNCATE; this matches what pal and radv do.

This fixes the spec@ext_framebuffer_multisample@turn-on-off tests.

Cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15240>
2022-03-07 11:53:14 +01:00
José Expósito
4c3f8d3af8 egl/wayland: fix crash in dri2_initialize_wayland_swrast
When "dri2_wl_formats_init" fails in "dri2_initialize_wayland_swrast",
the "dri2_display_destroy" function is called for clean up. However, the
"dri2_egl_display" was not associated with the display in its
"DriverData" field yet.

The following cast in "dri2_display_destroy":

  struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);

Expands to:

  _EGL_DRIVER_TYPECAST(drvname ## _display, _EGLDisplay, obj->DriverData)

Crashing.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13972>
2022-03-07 08:26:01 +00:00
José Expósito
43258dc802 egl/wayland: fix crash in dri2_initialize_wayland_drm
When "dri2_wl_formats_init" fails in "dri2_initialize_wayland_drm", the
"dri2_display_destroy" function is called for clean up. However, the
"dri2_egl_display" was not associated with the display in its
"DriverData" field yet.

The following cast in "dri2_display_destroy":

  struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);

Expands to:

  _EGL_DRIVER_TYPECAST(drvname ## _display, _EGLDisplay, obj->DriverData)

Crashing.

Addresses-Coverity-ID: 1494541 ("Resource leak")
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13972>
2022-03-07 08:26:01 +00:00
Mike Blumenkrantz
a0bfd65d0f zink: hide descriptor debug behind #ifdef
I've gotten a feel for this, but it's annoying to always see it spamming away

Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15226>
2022-03-07 04:07:58 +00:00
Mike Blumenkrantz
e0030bc39f zink: invalidate non-punted recycled descriptor sets that are not valid
these sets may contain refs from the descriptors which need to be removed
to avoid invalid memory access if the ref is leaked

cc: mesa-stable

Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15226>
2022-03-07 04:07:58 +00:00
Mike Blumenkrantz
d63f3c31b7 zink: stop leaking descriptor sets
when migrating a recycled set here, the set was previously invalid and
in the recycled table, meaning it can be reused directly so long as
it's first invalidated

the previous code would instead pop a different set off the allocation array,
leaking this one

cc: mesa-stable

Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15226>
2022-03-07 04:07:58 +00:00
Mike Blumenkrantz
9a91a520de zink: mark fbfetch push sets as non-cached
these can't be cached, so ensure the value isn't uninitialized

Test case 'KHR-GL46.blend_equation_advanced.blend_all.GL_HARDLIGHT_KHR_all_qualifier'..
==1193311== Conditional jump or move depends on uninitialised value(s)
==1193311==    at 0x634EF05: update_push_ubo_descriptors (zink_descriptors.c:1230)
==1193311==    by 0x634FCC5: zink_descriptors_update (zink_descriptors.c:1412)
==1193311==    by 0x63A5EA1: void zink_draw<(zink_multidraw)1, (zink_dynamic_state)3, true, false>(pipe_context*, pipe_draw_info const*, unsigned int, pipe_draw_indirect_info const*, pipe_draw_start_count_bias const*, unsigned int, pipe_vertex_state*, unsigned int) (zink_draw.cpp:788)
==1193311==    by 0x635A0AF: void zink_draw_vbo<(zink_multidraw)1, (zink_dynamic_state)3, true>(pipe_context*, pipe_draw_info const*, unsigned int, pipe_draw_indirect_info const*, pipe_draw_start_count_bias const*, unsigned int) (zink_draw.cpp:907)
==1193311==    by 0x6174397: tc_call_draw_single (u_threaded_context.c:3150)
==1193311==    by 0x616C403: tc_batch_execute (u_threaded_context.c:211)
==1193311==    by 0x616CA44: _tc_sync (u_threaded_context.c:362)
==1193311==    by 0x61725E9: tc_texture_map (u_threaded_context.c:2274)
==1193311==    by 0x5A9DAE9: pipe_texture_map_3d (u_inlines.h:572)
==1193311==    by 0x5A9EB80: st_ReadPixels (st_cb_readpixels.c:530)
==1193311==    by 0x5A0647A: read_pixels (readpix.c:1178)
==1193311==    by 0x5A0647A: _mesa_ReadnPixelsARB (readpix.c:1195)
==1193311==    by 0x5A06517: _mesa_ReadPixels (readpix.c:1210)

cc: mesa-stable

Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15226>
2022-03-07 04:07:58 +00:00
Mike Blumenkrantz
ab3725f533 zink: fix descriptor cache pointer array allocation
this got mixed up during some refactor and started indexing based on the
number of bindings instead of the number of descriptors, which means
that array descriptor bindings would have overlapping array memory

cc: mesa-stable

Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15226>
2022-03-07 04:07:58 +00:00
Mike Blumenkrantz
c5f585f45a zink: wait on program cache fences before destroying programs
if these still have outstanding cache jobs, deleting the object now
will cause a crash

maybe fixes some cts flakiness?

cc: mesa-stable

Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15226>
2022-03-07 04:07:58 +00:00
Mike Blumenkrantz
382798ddbd zink: use a fence for pipeline cache update jobs
otherwise there's nothing to wait on

cc: mesa-stable

Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15226>
2022-03-07 04:07:58 +00:00
Mike Blumenkrantz
cbd9a91f64 zink: add function for refcounting zink_program structs
step one in maybe cleaning up and deduplicating some program code

Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15226>
2022-03-07 04:07:58 +00:00
Mike Blumenkrantz
9a6c58b2f7 zink: always update shader variants when rebinding a gfx program
the variant data may have changed in the meanwhile, so do a pass to
ensure that the correct variant is used

cc: mesa-stable

fixes caselist:
dEQP-GLES31.functional.shaders.sample_variables.sample_mask.discard_half_per_two_samples.multisample_texture_4
dEQP-GLES31.functional.shaders.sample_variables.sample_mask.discard_half_per_two_samples.singlesample_rbo

Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15226>
2022-03-07 04:07:58 +00:00
Mike Blumenkrantz
821a49981f lavapipe: accurately set image/ssbo access based on shader usage
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15233>
2022-03-07 03:56:46 +00:00
Mike Blumenkrantz
bfae16ca34 lavapipe: scan shaders for image/ssbo access and generate per-stage masks
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15233>
2022-03-07 03:56:46 +00:00
Mike Blumenkrantz
fcf58e75d0 lavapipe: heap-allocate rendering_state struct
this thing is like 28k now, which is just way too big to have on the stack

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15233>
2022-03-07 03:56:46 +00:00
Mike Blumenkrantz
c82dcdf598 gallivm: avoid division by zero when computing cube face
this is illegal and produces NaNs which blow up the sample instr

cc: mesa-stable

fixes (llvmpipe and zink):
KHR-GL45.incomplete_texture_access.sampler
dEQP-GLES31.functional.program_uniform.by_pointer.render.array_in_struct.sampler2D_samplerCube_both
dEQP-GLES31.functional.program_uniform.by_pointer.render.array_in_struct.sampler2D_samplerCube_fragment
dEQP-GLES31.functional.program_uniform.by_pointer.render.array_in_struct.sampler2D_samplerCube_vertex
dEQP-GLES31.functional.program_uniform.by_pointer.render.basic.samplerCube_both
dEQP-GLES31.functional.program_uniform.by_pointer.render.basic.samplerCube_fragment
dEQP-GLES31.functional.program_uniform.by_pointer.render.basic.samplerCube_vertex
dEQP-GLES31.functional.program_uniform.by_pointer.render.basic_struct.sampler2D_samplerCube_both
dEQP-GLES31.functional.program_uniform.by_pointer.render.basic_struct.sampler2D_samplerCube_fragment
dEQP-GLES31.functional.program_uniform.by_pointer.render.nested_structs_arrays.sampler2D_samplerCube_both
dEQP-GLES31.functional.program_uniform.by_pointer.render.nested_structs_arrays.sampler2D_samplerCube_fragment
dEQP-GLES31.functional.program_uniform.by_pointer.render.nested_structs_arrays.sampler2D_samplerCube_vertex
dEQP-GLES31.functional.program_uniform.by_pointer.render.struct_in_array.sampler2D_samplerCube_both
dEQP-GLES31.functional.program_uniform.by_pointer.render.struct_in_array.sampler2D_samplerCube_fragment
dEQP-GLES31.functional.program_uniform.by_pointer.render.struct_in_array.sampler2D_samplerCube_vertex
dEQP-GLES31.functional.program_uniform.by_value.render.array_in_struct.sampler2D_samplerCube_both
dEQP-GLES31.functional.program_uniform.by_value.render.array_in_struct.sampler2D_samplerCube_fragment
dEQP-GLES31.functional.program_uniform.by_value.render.array_in_struct.sampler2D_samplerCube_vertex
dEQP-GLES31.functional.program_uniform.by_value.render.basic.samplerCube_both
dEQP-GLES31.functional.program_uniform.by_value.render.basic.samplerCube_fragment
dEQP-GLES31.functional.program_uniform.by_value.render.basic.samplerCube_vertex
dEQP-GLES31.functional.program_uniform.by_value.render.basic_struct.sampler2D_samplerCube_both
dEQP-GLES31.functional.program_uniform.by_value.render.basic_struct.sampler2D_samplerCube_fragment
dEQP-GLES31.functional.program_uniform.by_value.render.nested_structs_arrays.sampler2D_samplerCube_both
dEQP-GLES31.functional.program_uniform.by_value.render.nested_structs_arrays.sampler2D_samplerCube_fragment
dEQP-GLES31.functional.program_uniform.by_value.render.nested_structs_arrays.sampler2D_samplerCube_vertex
dEQP-GLES31.functional.program_uniform.by_value.render.struct_in_array.sampler2D_samplerCube_both
dEQP-GLES31.functional.program_uniform.by_value.render.struct_in_array.sampler2D_samplerCube_fragment
dEQP-GLES31.functional.program_uniform.by_value.render.struct_in_array.sampler2D_samplerCube_vertex

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15246>
2022-03-06 02:44:17 +00:00
Mike Blumenkrantz
cf9454bb2a gallivm: fix debug prints for halfs
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15246>
2022-03-06 02:44:17 +00:00
Icecream95
ba18799ca1 pan/bi: Don't assign slots for the blend second source
Another instruction might write to the second source, and then an
INSTR_INVALID_ENC fault will be raised because the tuple will write to
and read from the register at the same time.

Fixes: 795638767d ("pan/bi: Use fused dual source blending")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15250>
2022-03-05 14:55:00 -05:00
Icecream95
66a604efb5 pan/bi: Skip psuedo sources in ISA.xml
The second staging register source for the +BLEND instruction should
not be packed nor disassembled, so skip it when include_pseudo is not
set.

Fixes: 795638767d ("pan/bi: Use fused dual source blending")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15250>
2022-03-05 14:55:00 -05:00
Icecream95
9d4441c71a panfrost: Fix ubo_mask calculation
BITSET_MASK returns ~0 when given an input of zero, when we need it to
return 0 instead.

Fixes shaders with only sysvals but no UBOs when push constants are
disabled.

This breaks when 31 or 32 UBOs are used, but PAN_MAX_CONST_BUFFERS is
currently set to 16.

Fixes: c246af0dd8 ("panfrost: Only upload UBOs when needed")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15250>
2022-03-05 14:55:00 -05:00
Icecream95
0b232b8659 panfrost: Improve comment for emit_fragment_job
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15250>
2022-03-05 14:55:00 -05:00
Icecream95
24101d944b pan/bi: Add documentation for bifrost_nir_lower_store_component
Taken from the commit that introduced the function,
95458c4033 ("pan/bi: Lower stores with component != 0").

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15250>
2022-03-05 14:55:00 -05:00
Icecream95
42caddcf6b pan/bi: Make disassembler build reproducibly
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15250>
2022-03-05 14:55:00 -05:00
Icecream95
d6c431c2e3 panfrost: Re-emit descriptors after resource shadowing
This could be made slightly more efficient by only setting the dirty
state that is needed, but eventually you reach a point where it's
cheaper to re-emit everything than work out what can or can't be kept.

Fixes rendering issues in Duckstation.

Fixes: cd2c1ef9da ("panfrost: Dirty track textures/samplers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15250>
2022-03-05 14:54:58 -05:00
Icecream95
b164ee0d7b panfrost: Set dirty state in set_shader_buffers
Otherwise the pointer (which is uploaded as a sysval) won't be updated
when a new SSBO is bound.

Fixes: c34b760b9f ("panfrost: Dirty track constant buffers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15250>
2022-03-05 14:50:09 -05:00
Icecream95
cb8c47b15e pan/bi: Check dependencies of both destinations of instructions
TEXC can have two destinations; the value for neither of them can be
used in the same bundle, so extend the code to check for this to
iterate over both destinations.

Fixes artefacts in the game "LIMBO".

Fixes: a303076c1a ("pan/bi: Add bi_instr_schedulable predicate")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15250>
2022-03-05 14:50:09 -05:00
Icecream95
9e714f7455 pan/bi: Add interference between destinations
Trying to write to overlapping register ranges from a single
instruction is undefined behaviour, so add interference between the
nodes to avoid this.

Hit in a dual-texture instruction in LIMBO.

Fixes: 9146bafbb4 ("pan/bi: Add dual texture fusing pass")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15250>
2022-03-05 14:50:09 -05:00
Icecream95
198cb4a77a panfrost: Disable point size upper limit clamping
The hardware already clamps this, there is no need to do it in the
shader.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15250>
2022-03-05 14:50:09 -05:00
Icecream95
66684339d5 panfrost: Update point size limits to match hardware behaviour
Found while reverse-engineering the tiler heap format.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15250>
2022-03-05 14:50:09 -05:00
Icecream95
d54efebf04 panfrost: Set PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION
Fixes arb-provoking-vertex-render Piglit test.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15250>
2022-03-05 14:47:24 -05:00
Icecream95
948300da27 pan/mdg: Use util_logbase2 instead of C99 log2
log2 operates on double, we only need the integer util/ function.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15250>
2022-03-05 14:27:44 -05:00
Ilia Mirkin
e42a8a5b92 a4xx: add emission of compute state, and compute dispatch
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14794>
2022-03-05 03:21:05 -05:00
Ilia Mirkin
63bba1dc6c a4xx: add logic to emit image/ssbo state
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14794>
2022-03-05 03:21:05 -05:00
Ilia Mirkin
aac7028b58 freedreno/ir3: support a4xx compute differences
Mainly the workgroup id comes injected via consts by the hardware (or
CP), and we must make room for it, otherwise the driver won't know where
to put it.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14794>
2022-03-05 03:21:05 -05:00
Ilia Mirkin
6fb5e64ead freedreno/ir3: support a4xx in load/store buffer/image emission
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14794>
2022-03-05 03:21:05 -05:00
Rob Clark
e9cd4fba6f freedreno/perfetto+fdperf: Set SYSPROF param
No need to check error return and deal with older kernels.  Older
kernels won't have this param but their default behavior allows for
systemwide perfcntr collection.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15236>
2022-03-04 16:06:34 -08:00
Rob Clark
af4b7f74b2 freedreno/drm: Add SYSPROF param
Add new param for putting kernel in system-profiling mode and add
corresponding fd_pipe_set_param() mechanism.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15236>
2022-03-04 16:06:34 -08:00
Rob Clark
f925794b16 freedreno: Update uapi header
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15236>
2022-03-04 16:05:10 -08:00
Rob Clark
d2e498b6a5 egl+libsync: Add helper to complain about invalid fence fd's
Debugging fd lifetime issues can be hard.  Add a helper for debug builds
to print out an error if an fd is not a fence fd, and sprinkle it around

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15094>
2022-03-04 22:16:20 +00:00
Rob Clark
1e25f3b282 android: Push in-fence-fd down to driver
Rather than immediately stall on the CPU in SwapBuffers() if the
in-fence for the dequeued buffer is not yet signaled, push it down
to the driver.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6048
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15094>
2022-03-04 22:16:20 +00:00
Rob Clark
dfac374220 gallium/dri: Extend image extension to support in-fence
Extend dri so that an in-fence-fd can be plumbed through to driver.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15094>
2022-03-04 22:16:20 +00:00
Samuel Pitoiset
af2951dde8 radv/ci: update list of expected failures
Add dEQP-VK.glsl.builtin.precision_double.determinant.compute.mat3
which fails on all generations.

It looks like CTS should relax tolerance slightly.

Co-authored-by: Charlie Turner <cturner@igalia.com>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15234>
2022-03-04 18:43:18 +01:00
Samuel Pitoiset
51c6fdf708 radv/ci: skip dEQP-VK.renderpass2.depth_stencil_resolve.*_samplemask
They randomly hang on Navi10 and randomly fail on Sienna Cichlid.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15234>
2022-03-04 18:43:16 +01:00
Juan A. Suarez Romero
7ffee7f1ab v3d: rebind sampler view if resource changed the BO
When discarding the whole resource to create a new one, if this resource
is used by a sampler view, a rebind must be done to use the new
resource.

But this must be done when setting the sampler views, because we don't
have access to those samplers before.

v2:
 - Pack shader state on setting sampler views (Iago)
 - Use a serial ID to know when to rebind sampler views (Juan)

v3:
 - Move check to caller (Iago)
 - Keep rebind sampler view on BO change (Iago)

v4:
 - Rename "serial_bo" to "serial_id" (Iago)
 - Add comments (Iago)

Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6027
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15171>
2022-03-04 17:20:28 +00:00
Alyssa Rosenzweig
7bda838c56 panfrost: Push twice as many uniforms
The limit for Bifrost is twice as high as previously thought -- the limit is 64
*slots* of FAU, not 64 words. Each slot is 2 words. We can push twice as much,
saving a considerable number of cycles in some cases.

total instructions in shared programs: 2454260 -> 2431502 (-0.93%)
instructions in affected programs: 845176 -> 822418 (-2.69%)
helped: 3376
HURT: 304
helped stats (abs) min: 1.0 max: 60.0 x̄: 7.92 x̃: 6
helped stats (rel) min: 0.13% max: 45.45% x̄: 4.60% x̃: 4.11%
HURT stats (abs)   min: 1.0 max: 60.0 x̄: 13.06 x̃: 8
HURT stats (rel)   min: 0.16% max: 35.09% x̄: 7.58% x̃: 6.52%
95% mean confidence interval for instructions value: -6.50 -5.87
95% mean confidence interval for instructions %-change: -3.75% -3.43%
Instructions are helped.

total tuples in shared programs: 1963383 -> 1951560 (-0.60%)
tuples in affected programs: 638622 -> 626799 (-1.85%)
helped: 2959
HURT: 573
helped stats (abs) min: 1.0 max: 54.0 x̄: 5.61 x̃: 4
helped stats (rel) min: 0.15% max: 28.57% x̄: 3.61% x̃: 3.12%
HURT stats (abs)   min: 1.0 max: 50.0 x̄: 8.35 x̃: 6
HURT stats (rel)   min: 0.25% max: 27.34% x̄: 6.24% x̃: 4.92%
95% mean confidence interval for tuples value: -3.61 -3.08
95% mean confidence interval for tuples %-change: -2.18% -1.85%
Tuples are helped.

total clauses in shared programs: 387817 -> 365111 (-5.85%)
clauses in affected programs: 135527 -> 112821 (-16.75%)
helped: 3489
HURT: 25
helped stats (abs) min: 1.0 max: 43.0 x̄: 6.52 x̃: 5
helped stats (rel) min: 0.82% max: 58.33% x̄: 17.48% x̃: 15.87%
HURT stats (abs)   min: 1.0 max: 3.0 x̄: 1.56 x̃: 1
HURT stats (rel)   min: 2.94% max: 11.11% x̄: 6.87% x̃: 6.67%
95% mean confidence interval for clauses value: -6.67 -6.26
95% mean confidence interval for clauses %-change: -17.65% -16.96%
Clauses are helped.

total cycles in shared programs: 201842.21 -> 168754.04 (-16.39%)
cycles in affected programs: 84035.50 -> 50947.33 (-39.37%)
helped: 3547
HURT: 136
helped stats (abs) min: 0.041665999999999315 max: 54.0 x̄: 9.33 x̃: 8
helped stats (rel) min: 0.17% max: 80.77% x̄: 36.10% x̃: 36.84%
HURT stats (abs)   min: 0.041665999999999315 max: 1.0 x̄: 0.12 x̃: 0
HURT stats (rel)   min: 0.18% max: 12.24% x̄: 1.18% x̃: 0.61%
95% mean confidence interval for cycles value: -9.26 -8.71
95% mean confidence interval for cycles %-change: -35.34% -34.11%
Cycles are helped.

total arith in shared programs: 74918.46 -> 75022.62 (0.14%)
arith in affected programs: 22471.04 -> 22575.21 (0.46%)
helped: 1571
HURT: 1492
helped stats (abs) min: 0.041665999999999315 max: 1.125 x̄: 0.17 x̃: 0
helped stats (rel) min: 0.17% max: 40.00% x̄: 2.50% x̃: 1.96%
HURT stats (abs)   min: 0.041665999999999315 max: 2.375 x̄: 0.25 x̃: 0
HURT stats (rel)   min: 0.16% max: 100.00% x̄: 5.35% x̃: 2.37%
95% mean confidence interval for arith value: 0.02 0.05
95% mean confidence interval for arith %-change: 1.08% 1.56%
Arith are HURT.

total ldst in shared programs: 174812 -> 137889 (-21.12%)
ldst in affected programs: 81319 -> 44396 (-45.41%)
helped: 3722
HURT: 0
helped stats (abs) min: 1.0 max: 62.0 x̄: 9.92 x̃: 8
helped stats (rel) min: 1.82% max: 100.00% x̄: 47.18% x̃: 43.75%
95% mean confidence interval for ldst value: -10.20 -9.64
95% mean confidence interval for ldst %-change: -47.97% -46.39%
Ldst are helped.

total quadwords in shared programs: 1757124 -> 1714130 (-2.45%)
quadwords in affected programs: 584065 -> 541071 (-7.36%)
helped: 3474
HURT: 173
helped stats (abs) min: 1.0 max: 90.0 x̄: 12.66 x̃: 9
helped stats (rel) min: 0.26% max: 34.18% x̄: 8.78% x̃: 8.33%
HURT stats (abs)   min: 1.0 max: 26.0 x̄: 5.76 x̃: 4
HURT stats (rel)   min: 0.45% max: 20.66% x̄: 4.48% x̃: 2.63%
95% mean confidence interval for quadwords value: -12.21 -11.37
95% mean confidence interval for quadwords %-change: -8.36% -7.95%
Quadwords are helped.

total threads in shared programs: 52898 -> 53142 (0.46%)
threads in affected programs: 262 -> 506 (93.13%)
helped: 250
HURT: 6
helped stats (abs) min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
helped stats (rel) min: 100.00% max: 100.00% x̄: 100.00% x̃: 100.00%
HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 50.00% max: 50.00% x̄: 50.00% x̃: 50.00%
95% mean confidence interval for threads value: 0.92 0.99
95% mean confidence interval for threads %-change: 93.69% 99.28%
Threads are helped.

total spills in shared programs: 161 -> 107 (-33.54%)
spills in affected programs: 54 -> 0
helped: 27
HURT: 0

total fills in shared programs: 1386 -> 796 (-42.57%)
fills in affected programs: 590 -> 0
helped: 27
HURT: 0

Fixes: d4dccea0ba ("panfrost: Add UBO push data structure")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15239>
2022-03-04 15:22:04 +00:00
Alyssa Rosenzweig
e7cfe18099 pan/bi: Run CSE after lowering FAU
Lowering FAU can add moves from uniforms. If a uniform is moved out to a
register mulitple times in a basic block, these moves can be CSE'd, saving
instructions at the cost of register pressure.

854 shaders in my shader-db are helped on cycle count (average 2.94% reduction
in cycles). Only 9 shaders have hurt thread count, and there is no change in
spills or fills. Overall, this seems to be a win.

Prevents instruction count regressions from the next commit.

total instructions in shared programs: 2454423 -> 2444690 (-0.40%)
instructions in affected programs: 386274 -> 376541 (-2.52%)
helped: 2105
HURT: 0
helped stats (abs) min: 1.0 max: 116.0 x̄: 4.62 x̃: 2
helped stats (rel) min: 0.04% max: 27.27% x̄: 3.64% x̃: 1.92%
95% mean confidence interval for instructions value: -4.91 -4.33
95% mean confidence interval for instructions %-change: -3.83% -3.45%
Instructions are helped.

total tuples in shared programs: 1963534 -> 1957106 (-0.33%)
tuples in affected programs: 233562 -> 227134 (-2.75%)
helped: 1491
HURT: 117
helped stats (abs) min: 1.0 max: 63.0 x̄: 4.44 x̃: 2
helped stats (rel) min: 0.04% max: 24.53% x̄: 4.39% x̃: 2.59%
HURT stats (abs)   min: 1.0 max: 5.0 x̄: 1.61 x̃: 1
HURT stats (rel)   min: 0.18% max: 8.33% x̄: 1.44% x̃: 1.05%
95% mean confidence interval for tuples value: -4.28 -3.71
95% mean confidence interval for tuples %-change: -4.20% -3.73%
Tuples are helped.

total clauses in shared programs: 387848 -> 387079 (-0.20%)
clauses in affected programs: 13718 -> 12949 (-5.61%)
helped: 583
HURT: 60
helped stats (abs) min: 1.0 max: 16.0 x̄: 1.42 x̃: 1
helped stats (rel) min: 1.11% max: 25.00% x̄: 8.28% x̃: 6.67%
HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 0.86% max: 20.00% x̄: 4.58% x̃: 4.00%
95% mean confidence interval for clauses value: -1.29 -1.10
95% mean confidence interval for clauses %-change: -7.57% -6.58%
Clauses are helped.

total cycles in shared programs: 201866.21 -> 201682.92 (-0.09%)
cycles in affected programs: 6241.79 -> 6058.50 (-2.94%)
helped: 952
HURT: 98
helped stats (abs) min: 0.04166399999999726 max: 2.625 x̄: 0.20 x̃: 0
helped stats (rel) min: 0.12% max: 26.00% x̄: 4.05% x̃: 2.38%
HURT stats (abs)   min: 0.041665999999999315 max: 0.16666700000000034 x̄: 0.07 x̃: 0
HURT stats (rel)   min: 0.18% max: 8.70% x̄: 1.60% x̃: 1.43%
95% mean confidence interval for cycles value: -0.19 -0.16
95% mean confidence interval for cycles %-change: -3.80% -3.24%
Cycles are helped.

total arith in shared programs: 74924.00 -> 74660.12 (-0.35%)
arith in affected programs: 9303.67 -> 9039.79 (-2.84%)
helped: 1513
HURT: 118
helped stats (abs) min: 0.04166399999999726 max: 2.625 x̄: 0.18 x̃: 0
helped stats (rel) min: 0.07% max: 33.33% x̄: 4.68% x̃: 2.67%
HURT stats (abs)   min: 0.041665999999999315 max: 0.16666800000000137 x̄: 0.07 x̃: 0
HURT stats (rel)   min: 0.18% max: 8.70% x̄: 1.55% x̃: 1.37%
95% mean confidence interval for arith value: -0.17 -0.15
95% mean confidence interval for arith %-change: -4.48% -3.98%
Arith are helped.

total quadwords in shared programs: 1757254 -> 1751978 (-0.30%)
quadwords in affected programs: 197399 -> 192123 (-2.67%)
helped: 1464
HURT: 110
helped stats (abs) min: 1.0 max: 51.0 x̄: 3.73 x̃: 2
helped stats (rel) min: 0.04% max: 21.95% x̄: 4.16% x̃: 2.52%
HURT stats (abs)   min: 1.0 max: 7.0 x̄: 1.71 x̃: 1
HURT stats (rel)   min: 0.21% max: 13.04% x̄: 1.65% x̃: 0.93%
95% mean confidence interval for quadwords value: -3.58 -3.13
95% mean confidence interval for quadwords %-change: -3.97% -3.53%
Quadwords are helped.

total threads in shared programs: 52899 -> 52890 (-0.02%)
threads in affected programs: 18 -> 9 (-50.00%)
helped: 0
HURT: 9
HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 50.00% max: 50.00% x̄: 50.00% x̃: 50.00%
95% mean confidence interval for threads value: -1.00 -1.00
95% mean confidence interval for threads %-change: -50.00% -50.00%
Threads are HURT.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15239>
2022-03-04 15:22:04 +00:00
Henry Goffin
c8f644ec44 frontends/va: ignore incoming frame_num from VA picture parameters
The Gallium pipe video "frame_num" variable is internally used as a
counter of elapsed reference frames since the last IDR. The incoming
frame_num field from VA picture parameters is not equivalent; the VA
value may wrap to zero prematurely, as it is a 16-bit struct field with
a documented max value of 2^(log2_max_frame_num_minus4 + 4)-1.

This change improves "infinite GOP" single-client live streaming, where
it is reasonable for the server to desire an endless series of P-frames
without IDR. Without this change, it is difficult/impossible for an
application to encode a P- or B-frame after the VA frame_num field wraps
around to zero, depending on the backend encoder implementation.

This change has no effect on existing applications that always signal an
IDR frame and reset the VA frame_num to zero before it wraps around. For
example, the FFmpeg vaapi encoder ignores the VA documentation and sends
an un-wrapped VA frame_num, which results in identical computation of
the internal frame_num (as long as each GOP is less than 65536 frames).

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

Reviewed-by: Thong Thai <thong.thai@amd.com>

patch revision 3: correctly avoid incrementing frame_num when the encoded
frame is not a reference, per h264 spec and ffmpeg behavior

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14332>
2022-03-04 14:17:20 +00:00
Rhys Perry
d28b6b6856 aco: rework removal of jumps over branches
Only allow this in situations where we know it's safe. In particular, this
stops removal of unconditional branches like with
block_kind_continue_or_break.

Fixes dEQP-VK.graphicsfuzz.fragcoord-control-flow hang.

fossil-db (Sienna Cichlid):
Totals from 34 (0.02% of 162293) affected shaders:
Instrs: 84115 -> 84178 (+0.07%); split: -0.00%, +0.08%
CodeSize: 463372 -> 463624 (+0.05%); split: -0.00%, +0.06%
Latency: 3467316 -> 3467652 (+0.01%)
InvThroughput: 3085493 -> 3085578 (+0.00%)
Branches: 3221 -> 3284 (+1.96%); split: -0.03%, +1.99%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: f030b75b7d ("aco: relax condition to remove branches in case of few instructions")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15214>
2022-03-04 12:32:36 +00:00
Samuel Pitoiset
059f870d74 ac/nir: implement nir_op_pack_{uint,sint}_2x16
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/15231>
2022-03-04 08:06:56 +00:00
Samuel Pitoiset
9b113f1b6c aco: implement nir_op_pack_{uint,sint}_2x16
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/15231>
2022-03-04 08:06:56 +00:00
Samuel Pitoiset
6532307555 nir: introduce nir_pack_{sint,uint}_2x16 instructions
These instructions have AMD hardware equivalent and they will be used
to lower fragment shader outputs in NIR.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15231>
2022-03-04 08:06:56 +00:00
Xiaohui Gu
4d81c60e11 iris: Mark a dirty update when vs_needs_sgvs_element value changed
Add vs_needs_sgvs_element value check when updating vertex
element dirty state in iris_update_compiled_vs to solve
render error of Android game "Genshin Impact".

Signed-off-by: Xiaohui Gu <xiaohui.gu@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15142>
2022-03-04 05:41:38 +00:00
Yiwei Zhang
aaa25cda0b venus: add VK_EXT_image_robustness support
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15205>
2022-03-04 01:04:13 +00:00
Yiwei Zhang
ba212bf888 venus: add VK_EXT_provoking_vertex support
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15205>
2022-03-04 01:04:13 +00:00
Yiwei Zhang
33ba61b059 venus: add VK_EXT_line_rasterization support
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15205>
2022-03-04 01:04:13 +00:00
Yiwei Zhang
58182eb096 venus: update to latest venus protocol
Added the below extension support:
- VK_EXT_line_rasterization
- VK_EXT_provoking_vertex

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15205>
2022-03-04 01:04:13 +00:00
Yiwei Zhang
20efd9eff3 venus: group extensions promoted to 1.3
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15205>
2022-03-04 01:04:13 +00:00
Yiwei Zhang
fe3815b7fa venus: clean up physical device features and properties
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15205>
2022-03-04 01:04:13 +00:00
Daniel Schürmann
ca4595e01a nir/opt_shrink_vectors: update docstring
in order to reflect the various recent improvements.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12468>
2022-03-04 00:18:58 +00:00
Daniel Schürmann
405829cd85 nir/opt_shrink_vectors: remove duplicate components from vecN
vecN instructions which are only used by other ALU
will now get duplicate channels removed.

i915g:
total instructions in shared programs: 396309 -> 396294 (<.01%)
instructions in affected programs: 186 -> 171 (-8.06%)

r300:
total instructions in shared programs: 1165059 -> 1164354 (-0.06%)
instructions in affected programs: 35884 -> 35179 (-1.96%)
total temps in shared programs: 165497 -> 165326 (-0.10%)
temps in affected programs: 2990 -> 2819 (-5.72%)

softpipe:
total instructions in shared programs: 2860028 -> 2859084 (-0.03%)
instructions in affected programs: 55539 -> 54595 (-1.70%)
total temps in shared programs: 516939 -> 516546 (-0.08%)
temps in affected programs: 6623 -> 6230 (-5.93%)

Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12468>
2022-03-04 00:18:58 +00:00
Daniel Schürmann
e5963478c2 nir/opt_shrink_vectors: shrink load_const properly
This patch enables removal of arbitrary channels in
load_const instructions, if they are either unused or
duplicates of other channels and only used by ALU.

Totals from 692 (0.51% of 134913) affected shaders: (GFX10.3)
VGPRs: 21832 -> 21544 (-1.32%)
CodeSize: 1322016 -> 1313080 (-0.68%); split: -0.68%, +0.01%
Instrs: 243635 -> 242231 (-0.58%); split: -0.58%, +0.00%
Latency: 1856138 -> 1857237 (+0.06%); split: -0.09%, +0.15%
InvThroughput: 424298 -> 421671 (-0.62%); split: -0.62%, +0.01%
VClause: 4580 -> 4583 (+0.07%); split: -0.02%, +0.09%
SClause: 14336 -> 14354 (+0.13%); split: -0.04%, +0.17%
Copies: 8897 -> 8859 (-0.43%); split: -0.45%, +0.02%
PreSGPRs: 20439 -> 20437 (-0.01%)
PreVGPRs: 16011 -> 15907 (-0.65%); split: -0.97%, +0.32%

i915g:
total instructions in shared programs: 396471 -> 396309 (-0.04%)
instructions in affected programs: 6408 -> 6246 (-2.53%)
total const in shared programs: 56458 -> 56422 (-0.06%)
const in affected programs: 407 -> 371 (-8.85%)
LOST:   shaders/closed/steam/trine-2/fp-3.shader_test FS

r300:
total instructions in shared programs: 1164421 -> 1165059 (0.05%)
instructions in affected programs: 143981 -> 144619 (0.44%)
total temps in shared programs: 165488 -> 165497 (<.01%)
temps in affected programs: 318 -> 327 (2.83%)
total consts in shared programs: 922140 -> 921952 (-0.02%)
consts in affected programs: 12438 -> 12250 (-1.51%)

softpipe:
total instructions in shared programs: 2859978 -> 2860028 (<.01%)
instructions in affected programs: 183355 -> 183405 (0.03%)
total temps in shared programs: 517071 -> 516939 (-0.03%)
temps in affected programs: 1416 -> 1284 (-9.32%)
total imm in shared programs: 103601 -> 102767 (-0.81%)
imm in affected programs: 3928 -> 3094 (-21.23%)

Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12468>
2022-03-04 00:18:58 +00:00
Dave Airlie
a10b5d7086 crocus: change the line width workaround for gfx4/5
This fixes piglit line-flat-clip-color and the hud fps counter.

Fixes: 6b7a68b7c2 ("crocus: add missing line smooth bits.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15229>
2022-03-04 00:06:28 +00:00
Chia-I Wu
bbbbf39559 venus: abort when stuck
This gives

  MESA-VIRTIO: debug: stuck in ring seqno wait with iter at 4096
  MESA-VIRTIO: debug: stuck in ring seqno wait with iter at 8192
  MESA-VIRTIO: debug: stuck in ring seqno wait with iter at 12288
  MESA-VIRTIO: debug: stuck in ring seqno wait with iter at 16384
  MESA-VIRTIO: debug: aborting
  Aborted

which should be more friendly than printing the messages forever.

On my i7-7820HQ, this aborts after roughly 4+8+16+32=60 seconds

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15200>
2022-03-03 21:48:13 +00:00
Daniel Schürmann
ccf4bcd162 aco/ra: don't immediately assign a register for p_branch
These get now assigned after handling phis.

Totals from 564 (0.42% of 134913) affected shaders: (GFX10.3)
CodeSize: 5519744 -> 5515308 (-0.08%)
Instrs: 1063045 -> 1061936 (-0.10%)
Latency: 11880452 -> 11875904 (-0.04%)
InvThroughput: 2259933 -> 2259581 (-0.02%); split: -0.02%, +0.00%
Copies: 86908 -> 85799 (-1.28%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13432>
2022-03-03 20:21:08 +00:00
Rhys Perry
c3070773f8 aco/tests: add test for branch definition RA
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13432>
2022-03-03 20:21:08 +00:00
Rhys Perry
32d0bae8ec aco: fix branch definition validation
Like how they have to be register allocated differently, branch
definitions at merge block predecessors need to be validated differently.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13432>
2022-03-03 20:21:08 +00:00
Rhys Perry
bed5a31005 aco: add validate_instr_defs()
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13432>
2022-03-03 20:21:08 +00:00
Rhys Perry
d5349a99c2 aco/ra: fix register allocation of branch definitions
fossil-db (Sienna Cichlid):
Totals from 704 (0.52% of 134913) affected shaders:
CodeSize: 7177288 -> 7182072 (+0.07%); split: -0.00%, +0.07%
Instrs: 1371781 -> 1372977 (+0.09%); split: -0.00%, +0.09%
Latency: 17993572 -> 18001344 (+0.04%); split: -0.00%, +0.04%
InvThroughput: 4198996 -> 4199569 (+0.01%); split: -0.00%, +0.01%
Copies: 122456 -> 123516 (+0.87%); split: -0.01%, +0.88%
Branches: 43815 -> 43818 (+0.01%); split: -0.02%, +0.03%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13432>
2022-03-03 20:21:08 +00:00
Rhys Perry
608d48b787 aco/ra: add get_reg_phi() helper
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13432>
2022-03-03 20:21:08 +00:00
Rhys Perry
ceca5e68c4 aco: remove vcc hint from branch definitions
This doesn't seem to have much benefit anymore.

fossil-db (Sienna Cichlid):
Totals from 198 (0.15% of 134913) affected shaders:
CodeSize: 2610536 -> 2610872 (+0.01%); split: -0.01%, +0.02%
Instrs: 479001 -> 479085 (+0.02%); split: -0.01%, +0.03%
Latency: 7310684 -> 7300735 (-0.14%); split: -0.16%, +0.02%
InvThroughput: 2439084 -> 2437446 (-0.07%); split: -0.07%, +0.00%
SClause: 14760 -> 14722 (-0.26%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13432>
2022-03-03 20:21:08 +00:00
Pavel Ondračka
558f632967 r300: schedule TEX instructions before OUT instructions
NIR-to-TGSI produces partial output writes contrary to the old paths
that always wrote the full outputs. Therefore if there is now a partial
output write ready to be scheduled and nothing else besides a tex
is ready, we would schedule the output write first. This was not a
problem before as usually at last some component of the full output write
depended on the tex result.

This is not optimal from the performance point of view and resulted in
~20% slowdown in the Unigine demos. The docs say:

The first OUTPUT instruction will reserve space in the output register
fifo. This space is limited, therefore issuing an OUTPUT earlier than
necessary may cause threads to stall earlier than necessary. You
should not set an ALU instruction as type OUTPUT unless it is actually
writing to an output register, or it is the last instruction of
the program.

Fix it by explicitly prefering a TEX before OUT and restore the
performance: 9.66 -> 12.12 fps (as compared to 11.83 with the old
glsl-to-TGSI path) in Unigine Sanctuary. No change in Lightsmark or
GLmark.

This is also a win from the intructions point of view as we are usually
able to schedule the partial output writes in a single pair at the end.

total instructions in shared programs: 106009 -> 105891 (-0.11%)
instructions in affected programs: 10153 -> 10035 (-1.16%)
helped: 118
HURT: 0

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5840
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/15165>
2022-03-03 20:05:32 +00:00
Pavel Ondračka
aff1a85c09 r300: remove some dead logic in tex pair scheduling
The max_score == -1 condition is already before so this
will never trigger. Its unclear what was the intention anyway. Now we
emit either:
- if we have accumulated enough tex intructions for a full block
- if we have nothing else to emit
- or if we can emit all remaining tex instructions already.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15165>
2022-03-03 20:05:32 +00:00
Igor Torrente
688b23885b Venus: Add vn_physical_device_{features, properties} for better organization
New extensions properties/feature are being put in the `vn_physical_device`
which is not ideal from an organization point of view.

Here the `vn_physical_device_{features,properties}` are two new struct to
help the `vn_physical_device` organzation.

Signed-off-by: Igor Torrente <igor.torrente@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15170>
2022-03-03 19:43:52 +00:00
Ilia Mirkin
539fae796a freedreno/a4xx: fix integer tg4
Something is slightly off in the integer values returned. It passes many
tests without the fixup, but the dEQP-GLES31 tests complain. The blob
ends up doing 3x gathers, and selects between them based on getinfo
results. Since we already have a per-sampler key with some spare bits,
just stick the bit-size info in there. And we can derive signedness from
the associated type info.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14670>
2022-03-03 18:26:43 +00:00
Ilia Mirkin
96211adf77 freedreno/a4xx: add swizzles to shader keys for tg4 workaround
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14670>
2022-03-03 18:26:43 +00:00
Ilia Mirkin
68a2d25d0d freedreno/a4xx: move tex_type to header
This will be used in several places. Factor it out for common use.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14670>
2022-03-03 18:26:43 +00:00
Ilia Mirkin
8ed07c0da9 nir: remove bogus logic to allow cube + offset to work
This was done for an a4xx hack which is now removed. No API allows cube
texturing to have offsets.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14670>
2022-03-03 18:26:43 +00:00
Ilia Mirkin
37306ba3f1 freedreno/ir3: remove bogus tg4 -> tex lowering pass
It can't be done. This just provides bad results. The blob had a
comparable approach where they fixed up coordinates, but that also can't
work with a separate texture definition with nearest filtering. By then,
might as well provide a unswizzled variant instead, and using native
functionality.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14670>
2022-03-03 18:26:43 +00:00
Alex Xu (Hello71)
80bf9c7b97 r300/compiler/tests: print regoff_t as size_t
fixes compilation on musl

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13949>
2022-03-03 17:48:17 +00:00
Samuel Pitoiset
516aee64cc radv,aco: do not lower nir_op_pack_{unorm,snorm}_2x16
v_cvt_pknorm_{u16,i16}_f32 can be emitted instead, it's supported on
all generations.

No fossils-db changes.

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/15215>
2022-03-03 14:54:12 +01:00
Michel Zou
f1f1b3d7f8 vulkan/wsi: drop unused wsi_create_win32_image
fixes: ed391d2a

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15088>
2022-03-03 06:13:07 +00:00
Andrii Simiklit
ddf2778269 glsl: add member's location layout qualifier rules for arrayed in/out blocks
From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:

     "For some blocks declared as arrays, the location can only be applied
     at the block level: When a block is declared as an array where
     additional locations are needed for each member for each block array
     element, it is a compile-time error to specify locations on the block
     members. That is, when locations would be under specified by applying
     them on block members, they are not allowed on block members. For
     arrayed interfaces (those generally having an extra level of
     arrayness due to interface expansion), the outer array is stripped
     before applying this rule"

From Section 1.2.1 (Changes from Revision 6 of GLSL Version) of the GLSL 4.50 spec:

     "Private Bug 15678: Don’t allow location = on block members where
      the block needs an array of locations"

From Section 4.4.1 (Input Layout Qualifiers) of the GLSL ES 3.20 spec

     "If an input is declared as an array of blocks, excluding per-vertex-arrays
      as required for tessellation, it is an error to declare a member of
      the block with a location qualifier"

From Section 1.1.3 (Changes from GLSL ES 3.2 revision 3) of the GLSL ES 3.20 spec:

     "Arrayed blocks cannot have layout location qualifiers on members"

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11522>
2022-03-03 05:42:45 +00:00
Mike Blumenkrantz
0313110c92 zink: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15227>
2022-03-03 05:21:40 +00:00
Mike Blumenkrantz
712ce86bd1 zink: split primitives generated queries if xfb/gs states change
if one of these states change then it affects which result needs to be
used for that query, so split it up over multiple query ids to make sure
the correct result is obtained

fixes (lavapipe):
GTF-GL46.gtf40.GL3Tests.transform_feedback2.transform_feedback2_pause_resume
GTF-GL46.gtf40.GL3Tests.transform_feedback2.transform_feedback2_states

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15227>
2022-03-03 05:21:40 +00:00
Mike Blumenkrantz
0cb3ae949c zink: split out query suspending into util function
no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15227>
2022-03-03 05:21:40 +00:00
Mike Blumenkrantz
5aecec48ee zink: update query states before starting renderpass during draw
this gives some leeway for doing transfer ops without crashing the renderpass

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15227>
2022-03-03 05:21:40 +00:00
Ilia Mirkin
965ab44c50 nvc0: disable EXT_texture_sRGB_RG8
Looks like the green component doesn't get srgb-decoding, and no obvious
way to force it. It works fine on nv50 though.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15211>
2022-03-03 04:37:12 +00:00
Ilia Mirkin
897a7fbbf1 mesa: enable GL_EXT_texture_sRGB_RG8 on desktop
Looks like an extension number was assigned in late 2020. This makes it
possible to hook up this format to teximage-colors without teaching it
about ES.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15211>
2022-03-03 04:37:12 +00:00
Mike Blumenkrantz
af5f49f663 zink: remove loop from generated tcs
this is already using per-vertex io, no need to add conditionals to verify

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15225>
2022-03-03 02:58:43 +00:00
Rob Clark
7e63fa2bb1 freedreno/registers: Add a couple regs we need for kernel
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15221>
2022-03-03 02:19:47 +00:00
Dave Airlie
34379a937f gallivm/llvmpipe: add support for NIR to the linear/aos paths.
When the AOS/linear code was added it only worked with TGSI which
meant nothing in mesa upstream was really using it.

This adds support to analyse NIR shaders, and adds aos support
to the backend.

AOS support is limited to mov,vec,fmul,tex sampling in order to
accelerate mostly compositing operations. I've tested weston uses
the fast path. gnome-shell can't use it yet as we can't optimise
the depth test paths.

Acked-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15140>
2022-03-03 01:39:39 +00:00
Dave Airlie
6efd489ac9 gallivm/nir: split load_const out into backend helper.
This just makes adding aos support easier.

Acked-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15140>
2022-03-03 01:39:39 +00:00
Dave Airlie
65c7ca617f llvmpipe/linear: fix disk caching.
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15140>
2022-03-03 01:39:39 +00:00
Mike Blumenkrantz
503362f008 zink: switch to u_foreach_bit for ntv image access decorations
no functional changes

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15217>
2022-03-03 01:28:13 +00:00
Mike Blumenkrantz
fcdcfd9967 zink: emit Aliased decorations for any image that isn't explicitly marked restrict
these might be aliased

fixes:
arb_shader_image_load_store-restrict

fixes #6090

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15217>
2022-03-03 01:28:13 +00:00
Mike Blumenkrantz
351378ae80 zink: remove a bunch of flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15219>
2022-03-03 01:14:20 +00:00
Dave Airlie
e1e9a44a69 lavapipe: always set read/write on ssbo/images.
This fixes a regressions with overlap in llvmpipe, this is pessimistic
we should write code to make it work properly.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15219>
2022-03-03 01:14:20 +00:00
Alyssa Rosenzweig
b48236ea3e pan/bi: Add arithmetic flag to RSHIFT ops
Models ops like ARSHIFT_OR.i32 on Valhall without adding piles of new
instructions to the IR.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15216>
2022-03-03 00:41:44 +00:00
Alyssa Rosenzweig
0b0e74ae82 pan/bi: Extend LD_TILE with a register format
Required for Valhall. NIR has the information anyway, pass it along.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15216>
2022-03-03 00:41:44 +00:00
Alyssa Rosenzweig
74107abfc6 pan/bi: Add BRANCHZI instruction
Technically this is just JUMP on Valhall, but the semantic is an indirect branch
based on comparing with zero. It can also be used as a conservative branch (like
BRANCHC), but this isn't modeled.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15216>
2022-03-03 00:41:44 +00:00
Alyssa Rosenzweig
3dc2095b07 pan/bi: Model LD_BUFFER instructions
We'll use these to read from UBOs on Valhall.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15216>
2022-03-03 00:41:44 +00:00
Alyssa Rosenzweig
5796777889 pan/bi: Model offset for LOAD/STORE
Needed to model the immediate offset on Valhall.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15216>
2022-03-03 00:41:43 +00:00
Alyssa Rosenzweig
039bb4e68c pan/bi: Model pos/vary segments in STORE instructions
For Bifrost, we model load/store segments, for example for thread local storage.
We need something similar on Valhall -- access modifiers. There are four access
modifiers on Valhall, controlling memory subsystem optimizations for the access:

none: Nothing may be assumed. Corresponds to "global".

istream: Internally streaming within the GPU. Corresponds to "pos", as it's
used for position stores.

estream: Externally streaming outside the GPU. Corresponds to "vary", as it's
used for varying stores.

force: Force access in discarded threads. Corresponds to "tl", as it's required
for correct behaviour of helper invocations that use the stack.

If these access modifiers end up being useful outside these fixed purposes, we
may need to rework this part of the IR. For now, this should suffice.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15216>
2022-03-03 00:41:43 +00:00
Alyssa Rosenzweig
aaa39f0e60 pan/bi: Model LEA_BUF_IMM in the IR
Required for varying stores in malloced IDVS jobs on Valhall.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15216>
2022-03-03 00:41:43 +00:00
Alyssa Rosenzweig
eba9ef4c25 pan/bi: Add LD_VAR_BUF_IMM.f16/f32 instructions
For use on Valhall with memory-allocated IDVS jobs.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15216>
2022-03-03 00:41:43 +00:00
Alyssa Rosenzweig
48a398bf5b pan/bi: Generalize I->table for Valhall
Can be reused for resource tables in a natural way.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15216>
2022-03-03 00:41:43 +00:00
Alyssa Rosenzweig
20891e75c2 pan/bi: Extend BLEND to take a register format
Needed on Valhall.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15216>
2022-03-03 00:41:43 +00:00
Alyssa Rosenzweig
3c817ed511 pan/bi: Model Valhall texture instructions
These act like a TEXC+immediate.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15216>
2022-03-03 00:41:43 +00:00
Alyssa Rosenzweig
234d3efb9b pan/va: Add memory access modifier to LOADs
Might be required for correct spilling in some circumstances.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15216>
2022-03-03 00:41:43 +00:00
Alyssa Rosenzweig
79aa4af078 pan/va: Remap "store segment" to "memory access"
For now, the difference does not matter. However it's better to model the actual
hardware behaviour, rather than isomorphic driver behaviour, when we can do so.
So fix the names.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15216>
2022-03-03 00:41:43 +00:00
Alyssa Rosenzweig
254a641290 pan/va: Fix LEA_BUF_IMM definition
Technically the table is folded, too; the 0xD refers to table 61. But this
instruction is more general than previously thought.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15216>
2022-03-03 00:41:43 +00:00
Alyssa Rosenzweig
7c798fbb9f pan/va: Fix definitions of LD_VAR_BUF_IMM
So close! However, LD_VAR_IMM is something else -- Bifrost-style varying
interpolation, without a hardware buffer. For ES3, we'll need to support both.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15216>
2022-03-03 00:41:43 +00:00
Alyssa Rosenzweig
c62836661e pan/va: Add TEX_GATHER instruction
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15216>
2022-03-03 00:41:43 +00:00
Alyssa Rosenzweig
65cb3af38a pan/va: Add TEX_DUAL instruction
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15216>
2022-03-03 00:41:43 +00:00
Alyssa Rosenzweig
47b70ca584 pan/va: Add modifiers required for gathers
Mostly isomorphic to Bifrost-style gathers.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15216>
2022-03-03 00:41:43 +00:00
Alyssa Rosenzweig
431e7e54a6 pan/va: Handle force_enum differing from name
Needed for secondary register width, for dual texturing.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15216>
2022-03-03 00:41:43 +00:00
Ian Romanick
0a6c6dcb00 i915g: Emit better code for SEQ(x, 0) and SNE(x, 0)
total instructions in shared programs: 789000 -> 788481 (-0.07%)
instructions in affected programs: 16179 -> 15660 (-3.21%)
helped: 157
HURT: 0
helped stats (abs) min: 3 max: 12 x̄: 3.31 x̃: 3
helped stats (rel) min: 1.56% max: 14.29% x̄: 4.24% x̃: 2.56%
95% mean confidence interval for instructions value: -3.51 -3.10
95% mean confidence interval for instructions %-change: -4.70% -3.78%
Instructions are helped.

LOST:   0
GAINED: 3

v2: Drop setting src1 to zero.  Suggested by Emma.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15210>
2022-03-03 00:07:58 +00:00
Ian Romanick
374da6fc41 i915g: Handle constants composed exclusively of 0 or ±1 specially
This can avoid some cases where a constant has to be loaded into a
temporary register.

v2: Update i915-g33-fails.txt.

total instructions in shared programs: 788625 -> 782376 (-0.79%)
instructions in affected programs: 166269 -> 160020 (-3.76%)
helped: 1578
HURT: 0
helped stats (abs) min: 3 max: 21 x̄: 3.96 x̃: 3
helped stats (rel) min: 1.56% max: 33.33% x̄: 4.82% x̃: 3.45%
95% mean confidence interval for instructions value: -4.06 -3.86
95% mean confidence interval for instructions %-change: -5.00% -4.64%
Instructions are helped.

LOST:   0
GAINED: 35

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15210>
2022-03-03 00:07:58 +00:00
Ian Romanick
06eb9fb125 nir/algebraic: Optimize some cases of (sXX(a, b) != 0.0)
I noticed the SGE case while looking at the output of
shaders/closed/steam/trine-2/fp-3.shader_test on i915g.  These are
especially bad on i915 that needs two instructions to implement SNE.

An alternative would be to duplicate the sne(sXX(a, b), 0.0) rules in an
algebraic pass that occurs after bool_to_float.  Doing the work earlier
seems preferable.

i915
total instructions in shared programs: 788274 -> 788223 (<.01%)
instructions in affected programs: 666 -> 615 (-7.66%)
helped: 5
HURT: 0
helped stats (abs) min: 9 max: 12 x̄: 10.20 x̃: 9
helped stats (rel) min: 5.00% max: 11.11% x̄: 8.12% x̃: 8.16%
95% mean confidence interval for instructions value: -12.24 -8.16
95% mean confidence interval for instructions %-change: -10.81% -5.43%
Instructions are helped.

LOST:   0
GAINED: 2

The two gained shaders are assembly fragment programs in Euro Truck
Simulator 2.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15210>
2022-03-03 00:07:58 +00:00
Ian Romanick
7d055c93e0 i915g/ci: update piglit fails
I believe these were fixed by !14573.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15210>
2022-03-03 00:07:58 +00:00
Emma Anholt
d506d910e4 nir: Switch to using nir_vec_scalars() for things that used nir_channel().
This should reduce follow-on optimization work to copy-propagate and
dead-code away the movs generated in construction of vectors.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14865>
2022-03-02 22:28:58 +00:00
Emma Anholt
16c064dfaf nir: Add a helper for setting up a nir_ssa_scalar struct.
Trivial, but will help users avoid some struct constructions that can be
awkward in C.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14865>
2022-03-02 22:28:58 +00:00
Emma Anholt
d95f9d189a nir: Introduce a nir_vec_scalars() helper using nir_ssa_scalar.
Many users of nir_vec() do so by nir_channel()-ing a new ssa defs as movs
from other vectors to put the new vector together, which then just have to
get copy-propagated into the ALU srcs and DCEed away the temporary movs.
If they instead take nir_ssa_scalar, we can avoid that extra work.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14865>
2022-03-02 22:28:58 +00:00
Dave Airlie
48b3ef625e vulkan/wsi: handle queue families properly for non-concurrent sharing mode.
"queueFamilyIndexCount is the number of queue families having access to the image(s) of the
swapchain when imageSharingMode is VK_SHARING_MODE_CONCURRENT.
pQueueFamilyIndices is a pointer to an array of queue family indices having access to the
images(s) of the swapchain when imageSharingMode is VK_SHARING_MODE_CONCURRENT."

If the type isn't concurrent, don't attempt to access the arrays.

dEQP-VK.wsi.xlib.swapchain.create.exclusive_nonzero_queues on lavapipe.

Fixes: 5b13d74583 ("vulkan/wsi/drm: Break create_native_image in pieces")
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15101>
2022-03-02 20:47:16 +00:00
Emma Anholt
221ce1b35a ci/freedreno: Consolidate some information about an a630 flake.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15197>
2022-03-02 19:53:26 +00:00
Emma Anholt
a64408dcd5 ir3: Don't assert on not finding the VS output for an FS input.
It should return undefined data, not terminate the program.  Fixes some
piglit tests poking at the UB handling.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15197>
2022-03-02 19:53:26 +00:00
Rhys Perry
feb7e30e2d radv: include disable_aniso_single_level and adjust_frag_coord_z in key
Fixes potential pipeline caching bug.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15175>
2022-03-02 19:05:28 +00:00
Emma Anholt
2de15273d5 freedreno: Improve robustness behavior for VBs with offset > size.
We were just emitting the bad reloc (either an assert fail on a debug
build or for a release build likely a GPU hang from the resulting fault).
Given that the GLES 3.2 spec's robust context requirement says we should
return undefined data but not terminate for element indices outside of the
VB, ignoring the offset in this case seems like a better behavior to have
in all cases.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15198>
2022-03-02 17:31:49 +00:00
Emma Anholt
92945825f5 freedreno: Fix start_slot handling in set_vertex_buffers.
mesa/st only ever provides a 0 for this value, but let's be ready if it
ever does something else.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15198>
2022-03-02 17:31:49 +00:00
Emma Anholt
35ddb65ea6 freedreno: Use the resource size rather than BO size for VFD_FETCH[].SIZE.
We should be using the API size to clamp, rather than what we allocated
the BO into.

Fixes: #13
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15198>
2022-03-02 17:31:49 +00:00
Erik Faye-Lund
b21e7e1ef7 docs: match build-flags markup with meson docs
In meson.rst, we document build-flags with double backticks, which puts
it inside a code-tag in the rendered HTML instead of a cite-tag like we
currently do.

Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15213>
2022-03-02 14:36:42 +00:00
Erik Faye-Lund
23d3fb6da2 docs: fix a broken link
Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15213>
2022-03-02 14:36:42 +00:00
Lionel Landwerlin
96c8880900 intel/fs: fix total_scratch computation
We only have a single prog_data::total_scratch for all shader variants
(SIMD 8, 16, 32). Therefore we should always max the total_scratch on
top of existing variant.

We probably haven't run into that issue before because we compile by
increasing SIMD size and higher SIMD size is more likely to spill. But
for bindless shaders with return shaders, if the last return part
doesn't spill, we completely ignore the previous parts' scratch
computation.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15193>
2022-03-02 13:13:03 +00:00
Juan A. Suarez Romero
5b43075888 v3d: enable texture filtering anisotropic
Seems we already had implemented this feature (see commit 521e1d0275
"broadcom/vc5: Add support for anisotropic filtering"), but we didn't
enable the proper capability.

Also update the maximum level of anistropy supported.

Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4201
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15180>
2022-03-02 12:55:17 +00:00
Caio Oliveira
dc77542ed2 intel/compiler: Use pass helper in brw_nir_adjust_offset_for_arrayed_indices
Also change the code to preserve certain metadata: control flow is not changed
so both block indices and dominance information is preserved.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15206>
2022-03-02 10:46:23 +00:00
Iago Toral Quiroga
f761f8fd9e broadcom/compiler: simplify node/temp translation during register allocation
Now that we don't sort our nodes we can arrange them so we can
easily translate between nodes and temps without a mapping table,
just applying an offset.

To do this we have a single array of nodes where twe put first the nodes
for accumulators and then the nodes for temps. With this setup we can
ensure that for any given temp T, its node is always T + ACC_COUNT.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15168>
2022-03-02 08:09:11 +00:00
Iago Toral Quiroga
871b0a7f6a broadcom/compiler: don't sort nodes for register allocation
Nodes are allocated in order to registers so initially sorting
was used to ensure that nodes with smaller life ranges would
be assigned first and therefore be more likely to get
accumulators.

However, since d81a6e5f1d now we don't rely on order to make
decisions about accumulators and instead we make policy decisions
based on actual liveness, so sorting is no longer strictly
relevant to this decision.

Furthermore, we are not re-sorting nodes after each spill either,
since that would probably require that we rebuild the interference
graph after each spill (the graph identifies nodes by their index).

Shader-db results show a significant improvement in instruction
counts, due to more optimal accumulator assignments. The reason for
this is that we use a round-robin policy for choosing the next
accumulator to assign. The idea behind this is preventing nearby
temps to be assigned to the same accumulator so that QPU scheduling
is more flexible, but if we  sort our nodes, we are basically not
assigning temps in program order any more and the round-robin policy
becomes less effective:

total instructions in shared programs: 13000420 -> 12663189 (-2.59%)
instructions in affected programs: 11791267 -> 11454036 (-2.86%)
helped: 62890
HURT: 19987

total threads in shared programs: 415874 -> 415870 (<.01%)
threads in affected programs: 20 -> 16 (-20.00%)
helped: 2
HURT: 4

total uniforms in shared programs: 3711652 -> 3711624 (<.01%)
uniforms in affected programs: 43430 -> 43402 (-0.06%)
helped: 134
HURT: 173

total max-temps in shared programs: 2144876 -> 2138822 (-0.28%)
max-temps in affected programs: 123334 -> 117280 (-4.91%)
helped: 4112
HURT: 1195

total spills in shared programs: 3870 -> 3860 (-0.26%)
spills in affected programs: 1013 -> 1003 (-0.99%)
helped: 14
HURT: 12

total fills in shared programs: 5560 -> 5573 (0.23%)
fills in affected programs: 1765 -> 1778 (0.74%)
helped: 14
HURT: 17

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15168>
2022-03-02 08:09:11 +00:00
Iago Toral Quiroga
4483cd24af broadcom/compiler: sink uniform loads
total instructions in shared programs: 13014428 -> 13000420 (-0.11%)
instructions in affected programs: 743624 -> 729616 (-1.88%)
helped: 1392
HURT: 611

total threads in shared programs: 415858 -> 415874 (<.01%)
threads in affected programs: 16 -> 32 (100.00%)
helped: 8
HURT: 0

total uniforms in shared programs: 3720410 -> 3711652 (-0.24%)
uniforms in affected programs: 113442 -> 104684 (-7.72%)
helped: 635
HURT: 29

total max-temps in shared programs: 2154268 -> 2144876 (-0.44%)
max-temps in affected programs: 61279 -> 51887 (-15.33%)
helped: 1124
HURT: 187

total spills in shared programs: 4002 -> 3870 (-3.30%)
spills in affected programs: 265 -> 133 (-49.81%)
helped: 6
HURT: 0

total fills in shared programs: 5788 -> 5560 (-3.94%)
fills in affected programs: 603 -> 375 (-37.81%)
helped: 6
HURT: 0

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15168>
2022-03-02 08:09:11 +00:00
Iago Toral Quiroga
e228642cf5 broadcom/compiler: move constants before their first user
For us they are basically uniforms too so we want to make their
lifespans short to facilitate allocating them to accumulators.

total instructions in shared programs: 13043585 -> 13015385 (-0.22%)
instructions in affected programs: 8326040 -> 8297840 (-0.34%)
helped: 24939
HURT: 19894

total threads in shared programs: 415860 -> 415858 (<.01%)
threads in affected programs: 4 -> 2 (-50.00%)
helped: 0
HURT: 1

total uniforms in shared programs: 3721953 -> 3720451 (-0.04%)
uniforms in affected programs: 96134 -> 94632 (-1.56%)
helped: 744
HURT: 435

total max-temps in shared programs: 2173431 -> 2154260 (-0.88%)
max-temps in affected programs: 264598 -> 245427 (-7.25%)
helped: 10858
HURT: 841

total spills in shared programs: 4005 -> 4010 (0.12%)
spills in affected programs: 700 -> 705 (0.71%)
helped: 5
HURT: 10

total fills in shared programs: 5801 -> 5817 (0.28%)
fills in affected programs: 1346 -> 1362 (1.19%)
helped: 6
HURT: 11

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15168>
2022-03-02 08:09:11 +00:00
Iago Toral Quiroga
a1998a9f43 broadcom/compiler: disallow TMU spills if max tmu spills is 0
If we are compiling with a strategy that does not allow TMU spills
we should not allow spilling anything that is not a uniform.
Otherwise the RA cost/benefit algorithm may choose to spill a
temp that is not uniform and that will cause us to immediately
fail the strategy and fallback to the next one, even if we
could've instead chosen to spill more uniforms to compile the
program successfully with that strategy.

Some relevant shader-db stats:

total instructions in shared programs: 13040711 -> 13043585 (0.02%)
instructions in affected programs: 234238 -> 237112 (1.23%)
helped: 73
HURT: 172

total threads in shared programs: 415664 -> 415860 (0.05%)
threads in affected programs: 196 -> 392 (100.00%)
helped: 98
HURT: 0

total uniforms in shared programs: 3717266 -> 3721953 (0.13%)
uniforms in affected programs: 12831 -> 17518 (36.53%)
helped: 6
HURT: 100

total max-temps in shared programs: 2174177 -> 2173431 (-0.03%)
max-temps in affected programs: 4597 -> 3851 (-16.23%)
helped: 79
HURT: 21

total spills in shared programs: 4010 -> 4005 (-0.12%)
spills in affected programs: 55 -> 50 (-9.09%)
helped: 5
HURT: 0

total fills in shared programs: 5820 -> 5801 (-0.33%)
fills in affected programs: 186 -> 167 (-10.22%)
helped: 5
HURT: 0

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15168>
2022-03-02 08:09:11 +00:00
Iago Toral Quiroga
cbb4d0dded broadcom/compiler: increase cost of TMU spills to 10
Our cost was 5 which matches the number of instructions we have to
add for a TMU spill (a fill is 4 instructions).

Uniform spills on the other hand add an extra instruction for each
fill and remove one instruction for the spill itself. These have
a cost of 1.

Therefore, if we have a single spill+fill, we end up with +9
instructions if it is a TMU spill and +0 instructions with a uniform
spill, so making the former only 5 times more costly is probably
not a good idea, and this is without even considering the added
latency of the TMU accesses.

Relevant shader-db changes show this causes as a marginal instruction
count increase in a few shaders but better thread counts and lower
TMU spilling overall:

total instructions in shared programs: 13037315 -> 13040711 (0.03%)
instructions in affected programs: 370106 -> 373502 (0.92%)
helped: 187
HURT: 321

total threads in shared programs: 415090 -> 415664 (0.14%)
threads in affected programs: 574 -> 1148 (100.00%)
helped: 287
HURT: 0

total uniforms in shared programs: 3706674 -> 3717266 (0.29%)
uniforms in affected programs: 63075 -> 73667 (16.79%)
helped: 40
HURT: 395

total max-temps in shared programs: 2176080 -> 2174177 (-0.09%)
max-temps in affected programs: 15838 -> 13935 (-12.02%)
helped: 316
HURT: 34

total spills in shared programs: 4247 -> 4010 (-5.58%)
spills in affected programs: 2599 -> 2362 (-9.12%)
helped: 107
HURT: 14

total fills in shared programs: 6121 -> 5820 (-4.92%)
fills in affected programs: 3622 -> 3321 (-8.31%)
helped: 108
HURT: 13

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15168>
2022-03-02 08:09:11 +00:00
Marek Olšák
a02dd17cb3 radeonsi: fix an assertion failure with register shadowing
The problem is that dirty_states must be 0 for any state that is NULL
in "queued". This code was flagging dirty_states for such states because
it was only looking at "emitted". It should have been looking at "queued".

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15209>
2022-03-01 22:30:24 +00:00
Marek Olšák
0f96948dfa radeonsi: fix register shadowing after the pm4 state size was decreased
Fixes: 946bd90a09 "radeonsi: decrease the size of si_pm4_state::pm4 except for cs_preamble_state"

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15209>
2022-03-01 22:30:24 +00:00
Marek Olšák
66e20d2bf7 ac: add an environment variable that parses IBs in files
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15209>
2022-03-01 22:30:24 +00:00
Marek Olšák
3394f0ae14 ac: define PKT3_ATOMIC_MEM
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15209>
2022-03-01 22:30:24 +00:00
Marek Olšák
ff9e4409c1 ac: parse SET_SH_REG_INDEX packet
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15209>
2022-03-01 22:30:24 +00:00
Marek Olšák
0cae7a59c0 ac/llvm: update LLVM processor names for gfx10.3
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15209>
2022-03-01 22:30:24 +00:00
Marek Olšák
87d83f4103 ci: add point coord failures to d3d12
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14388>
2022-03-01 21:59:56 +00:00
Marek Olšák
5ca7c20cf7 st/mesa: do nir_lower_io() for inputs & outputs with transform feedback info
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14388>
2022-03-01 21:59:56 +00:00
Marek Olšák
ee4c5b1699 gallium/aux: add helper nir_gather_stream_output_info
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14388>
2022-03-01 21:59:55 +00:00
Marek Olšák
2a708efec3 gallium/util: add util_dump_stream_output_info
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14388>
2022-03-01 21:59:55 +00:00
Marek Olšák
1dcd1eac6a nir: pass nir_shader into nir_recompute_io_bases instead of func_impl
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14388>
2022-03-01 21:59:55 +00:00
Marek Olšák
606811bded nir: add nir_print_xfb_info
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14388>
2022-03-01 21:59:55 +00:00
Marek Olšák
ad68a1ee5a nir: add nir_gather_xfb_info_from_intrinsics for lowered IO
Drivers will use this.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14388>
2022-03-01 21:59:55 +00:00
Marek Olšák
d4c051b047 nir: add nir_lower_io_passes() with new transform feedback
moved from radeonsi without the vectorization, which won't be needed for
now. We will lower IO in st/mesa instead of radeonsi to get the transform
feedback info into store instructions.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14388>
2022-03-01 21:59:55 +00:00
Marek Olšák
3528dcdfa1 nir: add nir_io_semantics::no_varying, no_sysval_output, and helpers
This is for drivers that have separate store instructions for varyings,
system value outputs (such as clip distances), and transform feedback.
The flags tell the driver not to store the output to those locations.

This will be used by radeonsi initially, and then maybe by a new linker.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14388>
2022-03-01 21:59:55 +00:00
Marek Olšák
548b2d47b2 nir: scalarize transform feedback info in nir_lower_io_to_scalar
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14388>
2022-03-01 21:59:55 +00:00
Marek Olšák
cc5505088b nir: add shader_info::xfb_strides
NIR now fully contains pipe_stream_output_info in shader_info and IO
intrinsics if lower_io_variables is true. radeonsi will not use
pipe_stream_output_info after this, and other drivers are free to follow
that.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14388>
2022-03-01 21:59:55 +00:00
Marek Olšák
4636fa7f38 nir: add transform feedback info into nir_intrinsic_store_output
This will allow compaction of transform feedback varyings because they
are no longer tied to varying slots with this information.
It will also make transform feedback info available to all NIR passes
after IO is lowered. It's meant to replace pipe_stream_output_info.

Other intrinsics are not used with transform feedback.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14388>
2022-03-01 21:59:55 +00:00
Marek Olšák
2c6e41bfe1 nir: fix nir_io_semantics::gs_streams in nir_lower_io_to_scalar
gs_streams is relative to the component. Also clear the high bits.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14388>
2022-03-01 21:59:55 +00:00
Marek Olšák
73ef225fc2 nir: validate write_mask for all intrinsics that have it
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14388>
2022-03-01 21:59:55 +00:00
Marek Olšák
dd733fa52e radeonsi: fix broken VK-GL buffer interop
Fixes: ad9b5ac0a1 - radeonsi: more fixes for si_buffer_from_winsys_buffer for GL-VK interop
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6063

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Tested-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15124>
2022-03-01 20:51:04 +00:00
Nanley Chery
c1a7d520f3 anv: Disable aux if the explicit modifier lacks it
For dmabuf imports, configure the primary surface without support for
compression if the modifier doesn't specify it. This helps to create VkImages
with memory requirements that are compatible with the buffers apps provide.

Suggested-by: Philip Langdale <philipl@overt.org>
Cc: 22.0 <mesa-stable>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5940
Tested-by: Philip Langdale <philipl@overt.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15181>
2022-03-01 20:05:50 +00:00
Nanley Chery
cada519482 anv: Refactor anv_image_init_from_create_info
Use a variable to store the anv_image_create_info struct. We'll modify it for a
bug fix in the next patch.

Cc: 22.0 <mesa-stable>
Tested-by: Philip Langdale <philipl@overt.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15181>
2022-03-01 20:05:50 +00:00
Nanley Chery
8d2b7e558b anv: Change a parameter of the implicit layout fn
Replace the create_info parameter with isl_extra_usage_flags to more closely
match the parameters of explicit layout function.

Tested-by: Philip Langdale <philipl@overt.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15181>
2022-03-01 20:05:50 +00:00
Alyssa Rosenzweig
c3eee6327c pan/va: Add missing copyright notice
Minor.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>
2022-03-01 19:43:23 +00:00
Alyssa Rosenzweig
eda00fd39d pan/bi: Extract INSTRUCTION_CASE macro
Useful across multiple optimization tests.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>
2022-03-01 19:43:23 +00:00
Alyssa Rosenzweig
ffde1f359b pan/bi: Adapt bi_lower_branch for Valhall
Disable the Bifrost optimization; it's not portable.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>
2022-03-01 19:43:23 +00:00
Alyssa Rosenzweig
f3937d9874 pan/bi: Trade off registers/threads on Valhall
It's only v6 that's missing this feature.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>
2022-03-01 19:43:23 +00:00
Alyssa Rosenzweig
7637502c8d pan/bi: Add BI_SUBGROUP_SUBGROUP16 option
Valhall uses 16-wide warps.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>
2022-03-01 19:43:22 +00:00
Alyssa Rosenzweig
ec9c1f8fa6 pan/bi: Wire Valhall disassembler into compiler
Useful when we grow Valhall support (soon!)

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>
2022-03-01 19:43:22 +00:00
Alyssa Rosenzweig
31e991d801 pan/bi: Support standalone Valhall disassembly
$ bifrost_compiler disasm --gpu=G78 foo.bin

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>
2022-03-01 19:43:22 +00:00
Alyssa Rosenzweig
600f689a98 pan/bi: Allow CSE of preloaded registers
Needed to CSE `LEA_VARY` in varying shaders on Valhall.

No shader-db changes on Bifrost.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>
2022-03-01 19:43:22 +00:00
Alyssa Rosenzweig
3154df232b pan/bi: Use a progress loop for constant folding
Needed to fold the dependent patterns produced by texture instructions
during NIR->Valhall.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>
2022-03-01 19:43:22 +00:00
Alyssa Rosenzweig
e5582710f3 pan/bi: Mark NOP as having no destinations
More accurate and more convenient.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>
2022-03-01 19:43:22 +00:00
Alyssa Rosenzweig
2604c65174 panfrost: Unify barrier+helper handling
These are unified in the hardware, so let's unify them in pan_shader_info.
Hoisting this logic to pan_shader.c avoids the need to duplicate this logic for
Midgard/Bifrost (RSD packing) and Valhall (SPD packing).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>
2022-03-01 19:43:22 +00:00
Alyssa Rosenzweig
30d0c2e390 panfrost: Set texel_interleave on Valhall
Instead of specifying the tiling on the texture descriptor, Valhall specifies it
on the plane descriptor. There is a new flag on the texture descriptor
specifying only whether the planes are interleaved or not.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>
2022-03-01 19:43:22 +00:00
Alyssa Rosenzweig
407bda4d8c panfrost: Adapt estimate_texture_payload_size to Valhall
The plane descriptor is larger than earlier surface descriptors, so we need to
be somewhat careful here. This removes a memory micro-optimization in the
interest of simplifying the code.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>
2022-03-01 19:43:22 +00:00
Alyssa Rosenzweig
469a36d071 panfrost: Don't emit compression tags on Valhall
Unnecessary. To avoid even more #if/#endif soup, merge the v4, v5-v8, and v9
paths together -- by returning 0 as the compression tag on v4 or v9.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>
2022-03-01 19:43:22 +00:00
Alyssa Rosenzweig
087b63cb07 panfrost: Allow uploading fragment SPDs
SPDs don't have the state dependence that fragment RSDs do.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>
2022-03-01 19:43:22 +00:00
Alyssa Rosenzweig
e42b0c68f4 panfrost: Don't pack blend constants with blend shaders
It's probably harmless, but it is logically meaningless. The DDK doesn't do it,
I don't see a reason for us to, either. In theory this should be a small
overhead win.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>
2022-03-01 19:43:22 +00:00
Alyssa Rosenzweig
111f5af303 panfrost: Generalize some is_bifrost users
Valhall would want these too. Regretting the is_bifrost check at all..

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>
2022-03-01 19:43:22 +00:00
Alyssa Rosenzweig
36a2b8d039 panfrost: Add PAN_MESA_DEBUG=dump option
To dump all graphics memory via the new pandecode_dump_mappings function(),
since for Valhall I have to do this often enough to warrant a dynamic flag.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>
2022-03-01 19:43:22 +00:00
Alyssa Rosenzweig
28743a5556 panfrost: Rename prepare_rsd->prepare_shader
This hook will be repurposed on Valhall to prepare the Shader Program
Descriptor, which takes the role of the RSD. Rename to avoid confusion.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>
2022-03-01 19:43:22 +00:00
Alyssa Rosenzweig
631c01fc42 panfrost: Add an enum for Valhall resource tables
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>
2022-03-01 19:43:22 +00:00
Alyssa Rosenzweig
f3c971e0fe panfrost: Make Divisor E an integer on v9
For consistency with previous architecture's XML files. Logically this is an
1-bit unsigned integer, not a boolean.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>
2022-03-01 19:43:22 +00:00
Alyssa Rosenzweig
b19afaf307 panfrost: Clarify contains descriptor? bit
Influences cache prefetching. I don't see a good reason to put anything other
than descriptors inside shader resources, meaning always setting this bit is
appropriate (at least for GLES).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>
2022-03-01 19:43:22 +00:00
Alyssa Rosenzweig
1df6b0d7e2 panfrost: Remove Invalidate Cache from Valhall job header
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>
2022-03-01 19:43:22 +00:00
Alyssa Rosenzweig
217e038289 panfrost: Add Tile Render Order enum to fragment jobs
Not sure what this is needed for yet.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>
2022-03-01 19:43:22 +00:00
Alyssa Rosenzweig
52ccd21e6b panfrost: Extend SPD size
There is software-defined state at the end we don't need. Model in the XML for
correct behaviour.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>
2022-03-01 19:43:22 +00:00
Thong Thai
0136545d16 radeonsi: add check for graphics to si_try_normal_clear
Cc: mesa-stable
Signed-off-by: Thong Thai <thong.thai@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15177>
2022-03-01 19:05:06 +00:00
Lionel Landwerlin
214092da87 anv: fix fast clear type value with external images
Disable fast clear if not supported by the external modifier.

v2: Set fast_clear value to NONE in case of import/export from/to external

v3: Move logic next to existing acquire/release checks (Nanley)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6056
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15096>
2022-03-01 17:37:13 +00:00
Oleksandr Gabrylchuk
02fab4cf9e venus: Implement guest vram blob type.
Add support of GUEST_VRAM type of blob. These are dedicated heap memory
allocations required for vk support on hypervisors that don't support
runtime injections of host memory into guest physical address space.

The flow of usage:
1) Host VM reserves dedicated heap memory
2) Device get info about memory reservations and report it to guest
using mmio registers
3) Guest virtio-gpu driver on starts checks mmio registers for
physical address and length of reserved region. Then it reserves it
in guest.
4) On each call of vkAllocateMemory() guest driver gets chunk of
required memory and send it to host using sg list. It uses one sg
entry for 1 blob call. Heap is managed on guest using drm memory
manager (drm_mm).

Signed-off-by: Oleksandr.Gabrylchuk <Oleksandr.Gabrylchuk@opensynergy.com>
Signed-off-by: Andrii Pauk <Andrii.Pauk@opensynergy.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14536>
2022-03-01 17:25:56 +00:00
Marek Olšák
fd3451babd amd: update addrlib
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Tested-by: Yifan Zhang <yifan1.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15155>
2022-03-01 17:03:00 +00:00
Marek Olšák
f8cf5ea982 amd: add support for gfx1036 and gfx1037 chips
Both are identified as GFX1036 for simplicity.

Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Tested-by: Yifan Zhang <yifan1.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15155>
2022-03-01 17:03:00 +00:00
Marek Olšák
48046d5bd8 ac: set correct cache size per TCC for Yellow Carp
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Tested-by: Yifan Zhang <yifan1.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15155>
2022-03-01 17:03:00 +00:00
Samuel Pitoiset
4380916b76 radv: disable DCC for Fable Anniversary, Dragons Dogma, GTA IV and more
Also Starcraft 2 and The Force Unleashed II.

These games are known to be affected by the feedback loop issue. We will
fix this properly soon but as a hotfix disabling DCC should be enough.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4424
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15203>
2022-03-01 16:33:18 +00:00
Vadym Shovkoplias
dc921f7377 iris: Do not apply SCANOUT allocation flags for SHARED-only requests
It provides similar solution as in [1].

This was workaround for the users of gbm_bo_create_with_modifiers(),
which were unable to specify the buffer usage (GPU / GPU+DISPLAY).

But after the commit [2] this become possible. And forcing usage to
GBM_BO_USE_SCANOUT migrated directly into gbm_bo_create_with_modifiers
[3], allowing us to remove such workarounds from the drivers.

[1]: ef3b31c9 ("v3d: Don't force SCANOUT for PIPE_BIND_SHARED requests")
[2]: 268e12c6 ("gbm: add gbm_{bo,surface}_create_with_modifiers2")
[3]: ad50b47a ("gbm: assume USE_SCANOUT in create_with_modifiers")

Suggested-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
Signed-off-by: Vadym Shovkoplias <vadym.shovkoplias@globallogic.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5642
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14264>
2022-03-01 16:04:44 +00:00
Timur Kristóf
93087f71e6 ac/nir: Extract final mesh shader output counts to a separate function.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15199>
2022-03-01 15:37:12 +00:00
Timur Kristóf
11957d3863 aco: Remove superfluous code for mesh shader workgroup ID.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15199>
2022-03-01 15:37:12 +00:00
Timur Kristóf
2d5aae032b ac/nir: Properly invalidate mesh shader metadata.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15199>
2022-03-01 15:37:12 +00:00
Timur Kristóf
3a3bd9cff1 ac/nir: Fix workgroup ID in mesh shader waves other than the first.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15199>
2022-03-01 15:37:12 +00:00
Timur Kristóf
57775dd76a ac/nir: Store mesh shader API and HW workgroup size in lowering state.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15199>
2022-03-01 15:37:12 +00:00
Timur Kristóf
d0f45c7c49 ac/nir: Reuse existing nir_builder for emit_ms_finale.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15199>
2022-03-01 15:37:12 +00:00
Timur Kristóf
74f1e7965e ac/nir: Use vertex count minus 1 to determine max index in mesh shaders.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15199>
2022-03-01 15:37:12 +00:00
Charlie Turner
16b417b8d6 ci, valve: Add the dEQP runners for Valve CI
v2.

  - Build the runner image as part of the CI for the boot2container
  project, rather than as a manually step using the build instructions
  in valve-trigger.dockerfile.

  - Depend on a non-default kernel build hosted in the valve-infra
  package repository. This does reduce the current caching feature of
  local artifacts, but makes it easier to chop and change kernels on a
  per-project or even per-test basis.

v3.

  - Depend on a kernel built and stored in the valve-infra generic
  package repo.

  - Build the runner container using ci-templates as part of the CI in
  valve-infra.

  - Now that the runner container is built in the valve-infra CI, I
  dropped the source import of client.py and message.py. They are
  built in the runner container.

Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14660>
2022-03-01 13:04:14 +00:00
Charlie Turner
f0aee991bf amd, ci: Categorize the sections of the CI file.
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14660>
2022-03-01 13:04:14 +00:00
Charlie Turner
58186df32c amd, ci: Drop log level in SPIRV -> NIR code generator.
See 786fa3435c for the rationale of this variable, but the point is to
avoid many error reports for conformance conformance issues within the
VK-CTS shaders.

Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14660>
2022-03-01 13:04:14 +00:00
Charlie Turner
cc327a0fe4 amd, ci: Remove unused runners.
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14660>
2022-03-01 13:04:14 +00:00
Charlie Turner
befe3a9e48 ci, valve: Add support scripts for the Valve bare-metal farm.
- Add the scripts to the prepared Mesa artifacts for use in later
runner stages.

- Add a template generator (generate_b2c.py) which reads and
validates (very lightly for now) the Gitlab job environment and then
spits out a YAML file describing the necessary test workload to be
sent to a Valve CI gateway.

Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14660>
2022-03-01 13:04:14 +00:00
Samuel Pitoiset
1e010348ee radv: remove color exports in presence of holes
If there is holes, eg. if only MRT0 and MRT2 are exported, we have to
set MRT1 to SPI_SHADER_32_R to avoid a GPU hang but the export can
still be removed from the fragment shader.

fossils-db (Sienna Cichlid):
Totals from 565 (0.42% of 134913) affected shaders:
VGPRs: 13328 -> 11456 (-14.05%)
CodeSize: 613232 -> 548224 (-10.60%); split: -11.13%, +0.53%
LDS: 284672 -> 296960 (+4.32%)
MaxWaves: 17624 -> 17684 (+0.34%)
Instrs: 113056 -> 100445 (-11.15%); split: -11.68%, +0.53%
Latency: 684327 -> 639348 (-6.57%); split: -7.17%, +0.60%
InvThroughput: 122877 -> 104382 (-15.05%); split: -15.18%, +0.13%
VClause: 2601 -> 2323 (-10.69%); split: -10.77%, +0.08%
SClause: 5629 -> 5443 (-3.30%); split: -3.91%, +0.60%
Copies: 9393 -> 8720 (-7.16%); split: -8.22%, +1.05%
PreSGPRs: 14623 -> 13666 (-6.54%); split: -6.76%, +0.22%
PreVGPRs: 9847 -> 8503 (-13.65%)

fossils-db (Polaris10):
Totals from 565 (0.42% of 135960) affected shaders:
SGPRs: 28064 -> 27104 (-3.42%)
VGPRs: 12516 -> 10544 (-15.76%); split: -15.79%, +0.03%
CodeSize: 516920 -> 456536 (-11.68%); split: -11.68%, +0.00%
MaxWaves: 4369 -> 4418 (+1.12%)
Instrs: 97771 -> 85903 (-12.14%); split: -12.14%, +0.00%
Latency: 767482 -> 708545 (-7.68%); split: -7.97%, +0.29%
InvThroughput: 280017 -> 235744 (-15.81%)
VClause: 2270 -> 2090 (-7.93%); split: -8.50%, +0.57%
SClause: 5185 -> 5012 (-3.34%); split: -3.86%, +0.52%
Copies: 8328 -> 7555 (-9.28%); split: -9.35%, +0.07%
Branches: 1143 -> 1113 (-2.62%)
PreSGPRs: 13816 -> 12725 (-7.90%); split: -7.92%, +0.02%
PreVGPRs: 9707 -> 8270 (-14.80%)

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/15108>
2022-03-01 12:28:47 +01:00
Rhys Perry
f800af2231 ac/nir: remove TCS nir_var_shader_out memory barrier
nir_var_shader_out writes are only used for later TES invocations, so I
don't think there's any need for the TCS workgroup to wait for them.

fossil-db (Sienna Cichlid):
Totals from 1691 (1.04% of 162293) affected shaders:
Instrs: 710699 -> 709008 (-0.24%)
CodeSize: 3830168 -> 3823404 (-0.18%)
Latency: 3396997 -> 3007934 (-11.45%)
InvThroughput: 1212094 -> 1082823 (-10.67%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15195>
2022-03-01 11:02:43 +00:00
Caio Oliveira
7460199a2f intel/compiler: Lower Task/Mesh I/O before SIMD specific lowering
These are the same for all variants, so just lower it before cloning
the nir_shader for each of them.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15019>
2022-03-01 07:35:13 +00:00
Danylo Piliaiev
549e861dc1 turnip: Implement VK_EXT_physical_device_drm
Copied from ANV and V3DV.

v1. Fix a build error for clang "unannotated fall-through between switch labels"
( Hyunjun Ko <zzoon.ko@igalia.com> )

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

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14971>
2022-03-01 07:10:40 +00:00
Pierre-Eric Pelloux-Prayer
bb6ba8f21f radeonsi/drirc: use force_gl_vendor for Maya
Otherwise OpenCL initialization fails with "unknown vendor id 0".

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15151>
2022-03-01 07:43:26 +01:00
Ilia Mirkin
d3196bac51 nouveau: add dEQP/GLCTS run failure info for GF108/GT215
I happened to have these plugged in. Ran them against mesa 21.3 and
recent VK-GL-CTS tree (shortly after vulkan-cts-1.2.8).

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14797>
2022-02-28 22:36:31 -05:00
Nanley Chery
dc05615ec1 Revert "anv: Require the local heap for CCS on XeHP"
This reverts commit 382f6ccda8.

The spec requires that all color images created with the same tiling
(and a few other properties) support the same memoryTypeBits. So this
wasn't a valid change. It also wasn't necessary - we already have a
mechanism in anv_BindImageMemory2 for disabling compression if the BO
doesn't support it.

With this, XeHP passes the tests in
dEQP-VK.memory.requirements.*tiling_optimal

Fixes: 382f6ccd ("anv: Require the local heap for CCS on XeHP")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15068>
2022-03-01 00:02:51 +00:00
Nanley Chery
203c8be09f anv: Add a perf warning in anv_BindImageMemory2
It reports: "BO lacks implicit CCS. Disabling the CCS aux usage."

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15068>
2022-03-01 00:02:51 +00:00
Nanley Chery
74e446b45b anv: Fall back to HiZ when disabling CCS on HiZ+CCS
When an image configured for HIZ_CCS/HIZ_CCS_WT is bound to a BO lacking
implicit CCS, we disable any compression it may have had. Such images
are still compatible with ISL_AUX_USAGE_HIZ however. Fall back to that
aux usage to retain the performance benefit.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15068>
2022-03-01 00:02:51 +00:00
Nanley Chery
ffbde42b93 anv: Don't disable HiZ/MCS in anv_BindImageMemory2
When an image is bound to a BO lacking implicit CCS, we disable any
compression it may have had. This is unnecessary in the cases where the
compression type doesn't depend on the BO having implicit CCS support.
Avoid this disabling for ISL_AUX_USAGE_MCS and ISL_AUX_USAGE_HIZ.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15068>
2022-03-01 00:02:51 +00:00
Connor Abbott
ed9a0d48a9 ir3: Use isam for bindless images
In the bindless case, we don't have to keep any shadow descriptors and
can just reuse the IBO descriptor as a texture descriptor. Now that
we're emitting the swizzle we can just flip this on.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15114>
2022-02-28 23:33:22 +00:00
Connor Abbott
06485f7d3d tu: Call nir_opt_access
This adds some small optimizations, and enables lowering to isam in more
cases where the app didn't specify readonly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15114>
2022-02-28 23:33:22 +00:00
Connor Abbott
58d72f45e5 ir3/nir: Fix 1d array readonly images
ncoords includes the array index, and the NIR source has the array index
as its last component, so we have to insert the extra y coordinate in
the middle in this case.

Fixes: 0bb0cac ("freedreno/ir3: handle image buffer")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15114>
2022-02-28 23:33:22 +00:00
Connor Abbott
21ac044c3e ir3: Don't always set bindless_tex with readonly images
Fixes: 274f381 ("ir3: Plumb through bindless support")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15114>
2022-02-28 23:33:22 +00:00
Connor Abbott
bb1e0eba08 freedreno/fdl: Set swizzle on storage descriptor
It appears to be unused by ldib/stib, but it will let us use isam on IBO
descriptors for bindless images.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15114>
2022-02-28 23:33:22 +00:00
Connor Abbott
00be8c4619 freedreno: Replace A6XX_IBO with A6XX_TEX_CONST
Since these were reverse-engineered, it's become clear that IBO
descriptors are just a subset of texture descriptors, and bindless reads
of readonly images actually use isam on the IBO descriptor, further
confirming that the two are always compatible, even if not all of the
texture fields exist for IBOs. It's pointless to have a separate type
for IBOs, and just leads to things getting out-of-sync unnecessarily
which has already happened. Just remove it and use TEX_CONST insted.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15114>
2022-02-28 23:33:22 +00:00
Connor Abbott
e1c4c2ac60 ir3: Use CAN_REORDER instead of NON_WRITEABLE
CAN_REORDER takes volatile into account, and is closer to what we
actually require to use texture instructions, which is that we can
arbitrarily reorder loads.

Fixes: aa93896 ("freedreno/ir3: adjust condition for when to use ldib")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15114>
2022-02-28 23:33:22 +00:00
Danylo Piliaiev
95fabff8de turnip: Set drmFormatModifierTilingFeatures
From Vulkan spec for VkDrmFormatModifierProperties2EXT:

 "drmFormatModifierTilingFeatures is a bitmask of VkFormatFeatureFlagBits
  that are supported by any image created with format and drmFormatModifier."

 "The returned drmFormatModifierTilingFeatures must contain at least one bit."

 "Therefore, if the returned drmFormatModifier is DRM_FORMAT_MOD_LINEAR,
  then drmFormatModifierPlaneCount must equal the format planecount, and
  drmFormatModifierTilingFeatures must be identical to the
  VkFormatProperties2::linearTilingFeatures returned in the same pNext chain."

Relevant tests: dEQP-VK.drm_format_modifiers.*

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15032>
2022-02-28 22:53:40 +00:00
Mike Blumenkrantz
473f488639 zink: add layer asserts for 3d imageview creation
make sure there's no other mishaps here in the future

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15172>
2022-02-28 17:42:58 +00:00
Mike Blumenkrantz
8e67928862 zink: more accurately clamp 3d fb surfaces to corresponding 2d target
if more than 1 layer is being bound, this is an array, otherwise it's just
regular 2d

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15172>
2022-02-28 17:42:58 +00:00
Mike Blumenkrantz
59b0105e65 zink: clamp 3d/array shader images to lower dimensionality using layer counts
this creates the view type expected by the shader instead of doing weird stuff
like trying to create a 3D imageview with layers > 1

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15172>
2022-02-28 17:42:58 +00:00
Mike Blumenkrantz
26d05e5a38 zink: directly create surfaces for shader images
avoid the implicit clamping of fb surfaces in zink_create_surface()
in order to provide more granularity

no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15172>
2022-02-28 17:42:58 +00:00
Mike Blumenkrantz
69ec429c00 zink: restrict clear flushing on sampler/image bind to compute binds
this is otherwise going to be handled on the next renderpass start

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15172>
2022-02-28 17:42:58 +00:00
Mike Blumenkrantz
b7b494299d zink: use VK_EXT_depth_clip_control when available
this saves a few ALUs in vertex stages

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15174>
2022-02-28 17:21:29 +00:00
Mike Blumenkrantz
95708c13ee glx/drisw: handle GL_RESET_NOTIFICATION_STRATEGY
fixes (llvmpipe):
KHR-NoContext.gl45.robustness.lose_context_on_reset

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15061>
2022-02-28 16:10:00 +00:00
Mike Blumenkrantz
fba13486df zink: update psiz handling to fix xfb output
now when gl_PointSize and gl_PointSizeMESA are both present, the former
will be used for xfb with a new location and the latter will be
exported by the shader

fixes (zink):
GTF-GL46.gtf30.GL3Tests.transform_feedback.transform_feedback_builtins

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15184>
2022-02-28 15:42:20 +00:00
Mike Blumenkrantz
b28cff9f4a nir/lower_psiz_mov: stop clobbering existing exports
for this pass to work with xfb, the original value in the shader must be
preserved when xfb is active, and the driver must export only the newly
created output

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15184>
2022-02-28 15:42:19 +00:00
Mike Blumenkrantz
3267417c22 nir/lower_psiz: create the store instruction more accurately
creating this at the start of the shader means it will get optimized out
when the pass is used to overwrite existing psiz values, and creating it
at the end means it will get optimized out in geometry shaders, so instead
just walk the instructions and create another store right after the existing one

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15184>
2022-02-28 15:42:19 +00:00
Jonathan Gray
6250a3bc18 util: use correct type in sysctl argument
Fixes build on OpenBSD/macppc powerpc

error: incompatible pointer types passing 'int *' to parameter of type 'size_t *'
    (aka 'unsigned long *') [-Werror,-Wincompatible-pointer-types]

Fixes: 01bd21eef8 ("gallium: Import Dennis Smit cpu detection code.")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6511>
2022-02-28 14:28:23 +00:00
Jonathan Gray
0536b69133 util: fix build with clang 10 on mips64
On mips64, the compiler does not allow use of non-zero argument with
__builtin_frame_address(). However, the returned frame address is only
used when PIPE_ARCH_X86 is defined. The compile error can be avoided
by making #ifdef PIPE_ARCH_X86 cover the getting of frame address too.

The argument checking of __builtin_frame_address() has been present
as a debug assert in clang 8. In clang 10, there is a proper runtime
check for the argument. This is why the build has not failed before.

Fixes: dc94a0506f ("gallium: Do not add -Wframe-address option for gcc <= 4.4.")
from Visa Hankala

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6511>
2022-02-28 14:28:23 +00:00
Jonathan Gray
f12c107b03 util/u_atomic: fix build on clang archs without 64-bit atomics
Make this build on clang architectures that don't have 64-bit atomic
instructions.  Clang doesn't allow redeclaration (and therefore
redefinition) of the __sync_* builtins.  Use #pragma redefine_extname
to work around that restriction.  Clang also turns __sync_add_and_fetch
into __sync_fetch_and_add (and __sync_sub_and_fetch into
__sync_fetch_and_sub) in certain cases, so provide these functions as
well.

Fixes: a6a38a038b ("util/u_atomic: provide 64bit atomics where they're missing")
patch from Mark Kettenis

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6511>
2022-02-28 14:28:23 +00:00
Daniel Stone
d07df90bf4 Revert "CI: Disable Panfrost T720 jobs"
This reverts commit 35209b94a6.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15191>
2022-02-28 14:08:34 +00:00
Daniel Stone
bd55458304 Revert "CI: Disable panfrost-t760"
This reverts commit b9b444e0b8.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15191>
2022-02-28 14:08:34 +00:00
Adrián Larumbe
6d0824abcc panfrost: fix segfault in pandecode
The structure wrapped around the rb tree node was being freed, but not the node
itself, which caused a segmentation fault when accessing its parent node.

Add rb tree node remove call to fix it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15188>
2022-02-28 12:40:32 +00:00
Daniel Stone
af0f9a31b3 CI: Disable Panfrost T720 jobs
Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15189>
2022-02-28 07:08:38 +00:00
Daniel Stone
114e48e923 CI: Disable panfrost-t760
The DUTs are extremely tempremental for some reason.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15186>
2022-02-27 20:26:17 +00:00
Erik Faye-Lund
f2dee2ea55 docs: update irc channel
According to the virglrenderer README.rst[1] file, #virgil3d has moved
from FreeNode to OFTC. Let's update our link as well.

While we're at it, use a proper link as well.

[1]: https://gitlab.freedesktop.org/virgl/virglrenderer/-/blob/master/README.rst

Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13836>
2022-02-27 11:09:41 +00:00
Erik Faye-Lund
5558f7de59 docs: mark virgl gles2 renderer as done
Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13836>
2022-02-27 11:09:41 +00:00
Erik Faye-Lund
5cce0d1d9d docs: update virgl description
Since this text was written, VirGL has become a shipping, production
quality solution. It's no longer a research project. Let's update the
text to reflect that.

While we're at it, let's drop the project from the page title, as this
is no longer the docs for the entire project.

Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13836>
2022-02-27 11:09:41 +00:00
Erik Faye-Lund
ca4ad9c2cb docs: link to gitlab instead of cgit
While we're at it, let's update the releasing article as well.

Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13836>
2022-02-27 11:09:41 +00:00
Erik Faye-Lund
32de503b02 docs: master -> main
Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13836>
2022-02-27 11:09:41 +00:00
Erik Faye-Lund
76ee3eeae9 docs: Virgl -> VirGL
The name used for this project is usually stylized as VirGL instead of
"Virgil" or "Virgil 3D" these days. Let's be consistent.

Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13836>
2022-02-27 11:09:41 +00:00
Erik Faye-Lund
4ebd3b041b docs: qemu -> QEMU
This is the official syling of the name, let's use that instead of
lower-case for consistensy.

Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13836>
2022-02-27 11:09:41 +00:00
Erik Faye-Lund
5494b68694 docs: add missing get
This sentence doesn't make sense without a 'get' or something similar
here.

Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13836>
2022-02-27 11:09:40 +00:00
Erik Faye-Lund
2015d458b6 docs: remove a few repeated words
It doesn't make sense to repeat these, let's fix that.

Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13836>
2022-02-27 11:09:40 +00:00
Erik Faye-Lund
6897266ce0 docs: import virgl docs
The docuentation has been imported verbatim from
https://virgil3d.github.io/.

Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13836>
2022-02-27 11:09:40 +00:00
Mike Blumenkrantz
e1964e1dde zink: don't free non-fbfetch dsl structs when switching to fbfetch
this triggers invalid access when recycling in-flight non-fbfetch sets

cc: mesa-stable

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15173>
2022-02-26 15:26:08 +00:00
Mike Blumenkrantz
03a80490a4 zink: free push descriptor pools on deinit
these are owned by the context, so destroy them when the context
requests destruction

cc: mesa-stable

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15173>
2022-02-26 15:26:08 +00:00
Mike Blumenkrantz
698ae34844 zink: fix cached descriptor set invalidation for array bindings
need to iterate over the descriptors in the binding to invalidate the whole
thing here

=================================================================
==546534==ERROR: AddressSanitizer: heap-use-after-free on address 0x61a0000ae6c0 at pc 0x7fe20e26fd9d bp 0x7ffd92be6bc0 sp 0x7ffd92be6bb8
READ of size 8 at 0x61a0000ae6c0 thread T0
    #0 0x7fe20e26fd9c in zink_descriptor_set_refs_clear ../src/gallium/drivers/zink/zink_descriptors.c:950
    #1 0x7fe20e401304 in zink_destroy_surface ../src/gallium/drivers/zink/zink_surface.c:340
    #2 0x7fe20e21311b in zink_surface_reference ../src/gallium/drivers/zink/zink_surface.h:106
    #3 0x7fe20e21a5b9 in zink_sampler_view_destroy ../src/gallium/drivers/zink/zink_context.c:835
    #4 0x7fe20c41d35f in tc_sampler_view_destroy ../src/gallium/auxiliary/util/u_threaded_context.c:1848
    #5 0x7fe20e210ff7 in pipe_sampler_view_reference ../src/gallium/auxiliary/util/u_inlines.h:216
    #6 0x7fe20e22d592 in zink_set_sampler_views ../src/gallium/drivers/zink/zink_context.c:1532
    #7 0x7fe20c41a3d8 in tc_call_set_sampler_views ../src/gallium/auxiliary/util/u_threaded_context.c:1393
    #8 0x7fe20c411706 in tc_batch_execute ../src/gallium/auxiliary/util/u_threaded_context.c:211
    #9 0x7fe20c4124ba in _tc_sync ../src/gallium/auxiliary/util/u_threaded_context.c:362
    #10 0x7fe20c42b728 in tc_destroy ../src/gallium/auxiliary/util/u_threaded_context.c:4250
    #11 0x7fe20b65176a in st_destroy_context_priv ../src/mesa/state_tracker/st_context.c:387
    #12 0x7fe20b65669f in st_destroy_context ../src/mesa/state_tracker/st_context.c:1009
    #13 0x7fe20b7055ab in st_context_destroy ../src/mesa/state_tracker/st_manager.c:944
    #14 0x7fe20a9c75bd in dri_destroy_context ../src/gallium/frontends/dri/dri_context.c:256
    #15 0x7fe20a9d4bef in driDestroyContext ../src/gallium/frontends/dri/dri_util.c:534
    #16 0x7fe22361f25c in drisw_destroy_context ../src/glx/drisw_glx.c:429
    #17 0x7fe223625d95 in glXDestroyContext ../src/glx/glxcmds.c:523
    #18 0x7fe22636aaeb in glXDestroyContext /home/zmike/src/libglvnd-v1.3.2/src/GLX/libglx.c:332
    #19 0x7fe2269d9e7d in glXDestroyContext /home/zmike/src/libglvnd-v1.3.2/src/GL/g_libglglxwrapper.c:384
    #20 0x41b88a in tcu::lnx::x11::glx::GlxRenderContext::~GlxRenderContext() /home/zmike/src/VK-GL-CTS/framework/platform/lnx/X11/tcuLnxX11GlxPlatform.cpp:734
    #21 0x41b8e9 in tcu::lnx::x11::glx::GlxRenderContext::~GlxRenderContext() /home/zmike/src/VK-GL-CTS/framework/platform/lnx/X11/tcuLnxX11GlxPlatform.cpp:735
    #22 0x2323aa7 in deqp::gles31::Context::destroyRenderContext() /home/zmike/src/VK-GL-CTS/modules/gles31/tes31Context.cpp:77
    #23 0x2323969 in deqp::gles31::Context::~Context() /home/zmike/src/VK-GL-CTS/modules/gles31/tes31Context.cpp:55
    #24 0x232278e in deqp::gles31::TestPackage::deinit() /home/zmike/src/VK-GL-CTS/modules/gles31/tes31TestPackage.cpp:102
    #25 0x2c866c2 in tcu::DefaultHierarchyInflater::leaveTestPackage(tcu::TestPackage*) /home/zmike/src/VK-GL-CTS/framework/common/tcuTestHierarchyIterator.cpp:75
    #26 0x2c87058 in tcu::TestHierarchyIterator::next() /home/zmike/src/VK-GL-CTS/framework/common/tcuTestHierarchyIterator.cpp:252
    #27 0x2c365da in tcu::TestSessionExecutor::iterate() /home/zmike/src/VK-GL-CTS/framework/common/tcuTestSessionExecutor.cpp:122
    #28 0x2c00b0c in tcu::App::iterate() /home/zmike/src/VK-GL-CTS/framework/common/tcuApp.cpp:221
    #29 0x4141b7 in main /home/zmike/src/VK-GL-CTS/framework/platform/tcuMain.cpp:58
    #30 0x7fe2263e155f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f)
    #31 0x7fe2263e160b in __libc_start_main_impl (/lib64/libc.so.6+0x2d60b)
    #32 0x413fa4 in _start (/home/zmike/src/VK-GL-CTS/build/external/openglcts/modules/glcts+0x413fa4)

0x61a0000ae6c0 is located 64 bytes inside of 1328-byte region [0x61a0000ae680,0x61a0000aebb0)
freed by thread T0 here:
    #0 0x7fe226cb6627 in free (/usr/lib64/libasan.so.6+0xae627)
    #1 0x7fe20aab1751 in unsafe_free ../src/util/ralloc.c:302
    #2 0x7fe20aab16c8 in unsafe_free ../src/util/ralloc.c:295
    #3 0x7fe20aab13c3 in ralloc_free ../src/util/ralloc.c:265
    #4 0x7fe20e269234 in descriptor_pool_free ../src/gallium/drivers/zink/zink_descriptors.c:286
    #5 0x7fe20e26937d in descriptor_pool_delete ../src/gallium/drivers/zink/zink_descriptors.c:296
    #6 0x7fe20e26ff53 in zink_descriptor_pool_reference ../src/gallium/drivers/zink/zink_descriptors.c:967
    #7 0x7fe20e270db2 in zink_descriptor_program_deinit ../src/gallium/drivers/zink/zink_descriptors.c:1071
    #8 0x7fe20e3b6536 in zink_destroy_gfx_program ../src/gallium/drivers/zink/zink_program.c:695
    #9 0x7fe20e1eaaf9 in zink_gfx_program_reference ../src/gallium/drivers/zink/zink_program.h:242
    #10 0x7fe20e20d386 in zink_shader_free ../src/gallium/drivers/zink/zink_compiler.c:2099
    #11 0x7fe20e3b9f0b in zink_delete_shader_state ../src/gallium/drivers/zink/zink_program.c:1074
    #12 0x7fe20c3e29ad in util_shader_reference ../src/gallium/auxiliary/util/u_live_shader_cache.c:188
    #13 0x7fe20e3ba11e in zink_delete_cached_shader_state ../src/gallium/drivers/zink/zink_program.c:1093
    #14 0x7fe20c41709e in tc_call_delete_fs_state ../src/gallium/auxiliary/util/u_threaded_context.c:998
    #15 0x7fe20c411706 in tc_batch_execute ../src/gallium/auxiliary/util/u_threaded_context.c:211
    #16 0x7fe20c4124ba in _tc_sync ../src/gallium/auxiliary/util/u_threaded_context.c:362
    #17 0x7fe20c423683 in tc_flush ../src/gallium/auxiliary/util/u_threaded_context.c:3003
    #18 0x7fe20b62d996 in st_flush ../src/mesa/state_tracker/st_cb_flush.c:60
    #19 0x7fe20b62dbe3 in st_glFlush ../src/mesa/state_tracker/st_cb_flush.c:94
    #20 0x7fe20ae4bded in _mesa_make_current ../src/mesa/main/context.c:1493
    #21 0x7fe20ae49702 in _mesa_free_context_data ../src/mesa/main/context.c:1187
    #22 0x7fe20b65668b in st_destroy_context ../src/mesa/state_tracker/st_context.c:1005
    #23 0x7fe20b7055ab in st_context_destroy ../src/mesa/state_tracker/st_manager.c:944
    #24 0x7fe20a9c75bd in dri_destroy_context ../src/gallium/frontends/dri/dri_context.c:256
    #25 0x7fe20a9d4bef in driDestroyContext ../src/gallium/frontends/dri/dri_util.c:534
    #26 0x7fe22361f25c in drisw_destroy_context ../src/glx/drisw_glx.c:429
    #27 0x7fe223625d95 in glXDestroyContext ../src/glx/glxcmds.c:523
    #28 0x7fe22636aaeb in glXDestroyContext /home/zmike/src/libglvnd-v1.3.2/src/GLX/libglx.c:332
    #29 0x7fe2269d9e7d in glXDestroyContext /home/zmike/src/libglvnd-v1.3.2/src/GL/g_libglglxwrapper.c:384

previously allocated by thread T0 here:
    #0 0x7fe226cb691f in __interceptor_malloc (/usr/lib64/libasan.so.6+0xae91f)
    #1 0x7fe20aab0c81 in ralloc_size ../src/util/ralloc.c:120
    #2 0x7fe20aab0e33 in rzalloc_size ../src/util/ralloc.c:153
    #3 0x7fe20aab12c8 in rzalloc_array_size ../src/util/ralloc.c:233
    #4 0x7fe20e26c76d in allocate_desc_set ../src/gallium/drivers/zink/zink_descriptors.c:657
    #5 0x7fe20e26e9cb in zink_descriptor_set_get ../src/gallium/drivers/zink/zink_descriptors.c:840
    #6 0x7fe20e2747aa in zink_descriptors_update ../src/gallium/drivers/zink/zink_descriptors.c:1424
    #7 0x7fe20e36fc48 in void zink_draw<(zink_multidraw)1, (zink_dynamic_state)2, true, false>(pipe_context*, pipe_draw_info const*, unsigned int, pipe_draw_indirect_info const*, pipe_draw_start_count_bias const*, unsigned int, pipe_vertex_state*, unsigned int) ../src/gallium/drivers/zink/zink_draw.cpp:788
    #8 0x7fe20e29166d in zink_draw_vbo<(zink_multidraw)1, (zink_dynamic_state)2, true> ../src/gallium/drivers/zink/zink_draw.cpp:907
    #9 0x7fe20c424982 in tc_call_draw_single ../src/gallium/auxiliary/util/u_threaded_context.c:3155
    #10 0x7fe20c411706 in tc_batch_execute ../src/gallium/auxiliary/util/u_threaded_context.c:211
    #11 0x7fe20c4124ba in _tc_sync ../src/gallium/auxiliary/util/u_threaded_context.c:362
    #12 0x7fe20c41f7a9 in tc_texture_map ../src/gallium/auxiliary/util/u_threaded_context.c:2279
    #13 0x7fe20b630757 in pipe_texture_map_3d ../src/gallium/auxiliary/util/u_inlines.h:572
    #14 0x7fe20b6341f6 in st_ReadPixels ../src/mesa/state_tracker/st_cb_readpixels.c:546
    #15 0x7fe20b42fea7 in read_pixels ../src/mesa/main/readpix.c:1178
    #16 0x7fe20b42fea7 in _mesa_ReadnPixelsARB ../src/mesa/main/readpix.c:1195
    #17 0x7fe20b42ffc0 in _mesa_ReadPixels ../src/mesa/main/readpix.c:1210
    #18 0x2a6d094 in glu::readPixels(glu::RenderContext const&, int, int, tcu::PixelBufferAccess const&) /home/zmike/src/VK-GL-CTS/framework/opengl/gluPixelTransfer.cpp:61
    #19 0x29eaa06 in deqp::gls::ShaderExecUtil::FragmentOutExecutor::execute(int, void const* const*, void* const*) /home/zmike/src/VK-GL-CTS/modules/glshared/glsShaderExecUtil.cpp:677
    #20 0x25a600b in iterate /home/zmike/src/VK-GL-CTS/modules/gles31/functional/es31fOpaqueTypeIndexingTests.cpp:585
    #21 0x2322b53 in deqp::gles31::TestCaseWrapper<deqp::gles31::TestPackage>::iterate(tcu::TestCase*) /home/zmike/src/VK-GL-CTS/modules/gles31/tes31TestCaseWrapper.hpp:86
    #22 0x2c376fd in tcu::TestSessionExecutor::iterateTestCase(tcu::TestCase*) /home/zmike/src/VK-GL-CTS/framework/common/tcuTestSessionExecutor.cpp:302
    #23 0x2c366e3 in tcu::TestSessionExecutor::iterate() /home/zmike/src/VK-GL-CTS/framework/common/tcuTestSessionExecutor.cpp:139
    #24 0x2c00b0c in tcu::App::iterate() /home/zmike/src/VK-GL-CTS/framework/common/tcuApp.cpp:221
    #25 0x4141b7 in main /home/zmike/src/VK-GL-CTS/framework/platform/tcuMain.cpp:58
    #26 0x7fe2263e155f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f)

cc: mesa-stable

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15173>
2022-02-26 15:26:08 +00:00
Mike Blumenkrantz
62b8daa889 zink: set shader key size to 0 for non-generated tcs
Test case 'dEQP-GLES31.functional.shaders.builtin_functions.common.modf.vec2_mediump_tess_control'..
=================================================================
==539161==ERROR: AddressSanitizer: unknown-crash on address 0x60400008cfef at pc 0x7fffdb47b2d6 bp 0x7fffffffa490 sp 0x7fffffffa488
READ of size 4 at 0x60400008cfef thread T0
    #0 0x7fffdb47b2d5 in XXH_read32 ../src/util/xxhash.h:531
    #1 0x7fffdb47bfbf in XXH_readLE32 ../src/util/xxhash.h:608
    #2 0x7fffdb47bfbf in XXH_readLE32_align ../src/util/xxhash.h:620
    #3 0x7fffdb47bfbf in XXH32_endian_align ../src/util/xxhash.h:797
    #4 0x7fffdb47bfbf in XXH32 ../src/util/xxhash.h:831
    #5 0x7fffdb480b49 in _mesa_hash_data ../src/util/hash_table.c:631
    #6 0x7fffded8c10a in shader_module_hash ../src/gallium/drivers/zink/zink_program.c:82
    #7 0x7fffded8cad8 in get_shader_module_for_stage ../src/gallium/drivers/zink/zink_program.c:144
    #8 0x7fffded8cf64 in update_gfx_shader_modules ../src/gallium/drivers/zink/zink_program.c:182
    #9 0x7fffded8dcc2 in zink_update_gfx_program ../src/gallium/drivers/zink/zink_program.c:257
    #10 0x7fffdec63463 in update_gfx_program ../src/gallium/drivers/zink/zink_draw.cpp:223
    #11 0x7fffded7aab9 in update_gfx_pipeline<true> ../src/gallium/drivers/zink/zink_draw.cpp:445
    #12 0x7fffded4a88b in void zink_draw<(zink_multidraw)1, (zink_dynamic_state)2, true, false>(pipe_context*, pipe_draw_info const*, unsigned int, pipe_draw_indirect_info const*, pipe_draw_start_count_bias const*, unsigned int, pipe_vertex_state*, unsigned int) ../src/gallium/drivers/zink/zink_draw.cpp:777
    #13 0x7fffdec6c5b2 in zink_draw_vbo<(zink_multidraw)1, (zink_dynamic_state)2, true> ../src/gallium/drivers/zink/zink_draw.cpp:907
    #14 0x7fffdcdff982 in tc_call_draw_single ../src/gallium/auxiliary/util/u_threaded_context.c:3155
    #15 0x7fffdcdec706 in tc_batch_execute ../src/gallium/auxiliary/util/u_threaded_context.c:211
    #16 0x7fffdcded4ba in _tc_sync ../src/gallium/auxiliary/util/u_threaded_context.c:362
    #17 0x7fffdcdfa492 in tc_buffer_map ../src/gallium/auxiliary/util/u_threaded_context.c:2251
    #18 0x7fffdb7f2439 in pipe_buffer_map_range ../src/gallium/auxiliary/util/u_inlines.h:393
    #19 0x7fffdb7f56c2 in _mesa_bufferobj_map_range ../src/mesa/main/bufferobj.c:488
    #20 0x7fffdb803300 in map_buffer_range ../src/mesa/main/bufferobj.c:3734
    #21 0x7fffdb8036e7 in _mesa_MapBufferRange ../src/mesa/main/bufferobj.c:3817
    #22 0x29ecb02 in deqp::gls::ShaderExecUtil::BufferIoExecutor::readOutputBuffer(void* const*, int) /home/zmike/src/VK-GL-CTS/modules/glshared/glsShaderExecUtil.cpp:1069
    #23 0x29ee499 in deqp::gls::ShaderExecUtil::TessControlExecutor::execute(int, void const* const*, void* const*) /home/zmike/src/VK-GL-CTS/modules/glshared/glsShaderExecUtil.cpp:1390
    #24 0x246264c in deqp::gles31::Functional::CommonFunctionCase::iterate() /home/zmike/src/VK-GL-CTS/modules/gles31/functional/es31fShaderCommonFunctionTests.cpp:400
    #25 0x2322b53 in deqp::gles31::TestCaseWrapper<deqp::gles31::TestPackage>::iterate(tcu::TestCase*) /home/zmike/src/VK-GL-CTS/modules/gles31/tes31TestCaseWrapper.hpp:86
    #26 0x2c376fd in tcu::TestSessionExecutor::iterateTestCase(tcu::TestCase*) /home/zmike/src/VK-GL-CTS/framework/common/tcuTestSessionExecutor.cpp:302
    #27 0x2c366e3 in tcu::TestSessionExecutor::iterate() /home/zmike/src/VK-GL-CTS/framework/common/tcuTestSessionExecutor.cpp:139
    #28 0x2c00b0c in tcu::App::iterate() /home/zmike/src/VK-GL-CTS/framework/common/tcuApp.cpp:221
    #29 0x4141b7 in main /home/zmike/src/VK-GL-CTS/framework/platform/tcuMain.cpp:58
    #30 0x7ffff6dbc55f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f)
    #31 0x7ffff6dbc60b in __libc_start_main_impl (/lib64/libc.so.6+0x2d60b)
    #32 0x413fa4 in _start (/home/zmike/src/VK-GL-CTS/build/external/openglcts/modules/glcts+0x413fa4)

0x60400008cff1 is located 0 bytes to the right of 33-byte region [0x60400008cfd0,0x60400008cff1)
allocated by thread T0 here:
    #0 0x7ffff769191f in __interceptor_malloc (/usr/lib64/libasan.so.6+0xae91f)
    #1 0x7fffded8c608 in get_shader_module_for_stage ../src/gallium/drivers/zink/zink_program.c:115
    #2 0x7fffded8cf64 in update_gfx_shader_modules ../src/gallium/drivers/zink/zink_program.c:182
    #3 0x7fffded8dcc2 in zink_update_gfx_program ../src/gallium/drivers/zink/zink_program.c:257
    #4 0x7fffdec63463 in update_gfx_program ../src/gallium/drivers/zink/zink_draw.cpp:223
    #5 0x7fffded7aab9 in update_gfx_pipeline<true> ../src/gallium/drivers/zink/zink_draw.cpp:445
    #6 0x7fffded4a88b in void zink_draw<(zink_multidraw)1, (zink_dynamic_state)2, true, false>(pipe_context*, pipe_draw_info const*, unsigned int, pipe_draw_indirect_info const*, pipe_draw_start_count_bias const*, unsigned int, pipe_vertex_state*, unsigned int) ../src/gallium/drivers/zink/zink_draw.cpp:777
    #7 0x7fffdec6c5b2 in zink_draw_vbo<(zink_multidraw)1, (zink_dynamic_state)2, true> ../src/gallium/drivers/zink/zink_draw.cpp:907
    #8 0x7fffdcdff982 in tc_call_draw_single ../src/gallium/auxiliary/util/u_threaded_context.c:3155
    #9 0x7fffdcdec706 in tc_batch_execute ../src/gallium/auxiliary/util/u_threaded_context.c:211
    #10 0x7fffdcded4ba in _tc_sync ../src/gallium/auxiliary/util/u_threaded_context.c:362
    #11 0x7fffdcdfa492 in tc_buffer_map ../src/gallium/auxiliary/util/u_threaded_context.c:2251
    #12 0x7fffdb7f2439 in pipe_buffer_map_range ../src/gallium/auxiliary/util/u_inlines.h:393
    #13 0x7fffdb7f56c2 in _mesa_bufferobj_map_range ../src/mesa/main/bufferobj.c:488
    #14 0x7fffdb803300 in map_buffer_range ../src/mesa/main/bufferobj.c:3734
    #15 0x7fffdb8036e7 in _mesa_MapBufferRange ../src/mesa/main/bufferobj.c:3817
    #16 0x29ecb02 in deqp::gls::ShaderExecUtil::BufferIoExecutor::readOutputBuffer(void* const*, int) /home/zmike/src/VK-GL-CTS/modules/glshared/glsShaderExecUtil.cpp:1069
    #17 0x29ee499 in deqp::gls::ShaderExecUtil::TessControlExecutor::execute(int, void const* const*, void* const*) /home/zmike/src/VK-GL-CTS/modules/glshared/glsShaderExecUtil.cpp:1390
    #18 0x246264c in deqp::gles31::Functional::CommonFunctionCase::iterate() /home/zmike/src/VK-GL-CTS/modules/gles31/functional/es31fShaderCommonFunctionTests.cpp:400
    #19 0x2322b53 in deqp::gles31::TestCaseWrapper<deqp::gles31::TestPackage>::iterate(tcu::TestCase*) /home/zmike/src/VK-GL-CTS/modules/gles31/tes31TestCaseWrapper.hpp:86
    #20 0x2c376fd in tcu::TestSessionExecutor::iterateTestCase(tcu::TestCase*) /home/zmike/src/VK-GL-CTS/framework/common/tcuTestSessionExecutor.cpp:302
    #21 0x2c366e3 in tcu::TestSessionExecutor::iterate() /home/zmike/src/VK-GL-CTS/framework/common/tcuTestSessionExecutor.cpp:139
    #22 0x2c00b0c in tcu::App::iterate() /home/zmike/src/VK-GL-CTS/framework/common/tcuApp.cpp:221
    #23 0x4141b7 in main /home/zmike/src/VK-GL-CTS/framework/platform/tcuMain.cpp:58
    #24 0x7ffff6dbc55f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f)

cc: mesa-stable

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15173>
2022-02-26 15:26:08 +00:00
Mike Blumenkrantz
861fc10bfc zink: skip extra descriptor lookups for images during barrier updates
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15173>
2022-02-26 15:26:08 +00:00
Mike Blumenkrantz
cd7ea80e70 zink: add layout to sampler descriptor hash
this can have more than one value, so avoid stale cache entries

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15173>
2022-02-26 15:26:08 +00:00
Mike Blumenkrantz
7431c30999 zink: fix typo for image descriptor rebinds
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15173>
2022-02-26 15:26:08 +00:00
Mike Blumenkrantz
a179977b8e zink: update descriptor refs after starting renderpass
this ensures that swapchain images will have been acquired before potentially
accessing swapchain images bound as descriptors

fixes caselist like:
dEQP-GLES31.functional.fbo.color.texcubearray.r8ui
dEQP-GLES31.functional.primitive_bounding_box.blit_fbo.blit_default_to_fbo

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15173>
2022-02-26 15:26:08 +00:00
Jonathan Gray
f0398180a5 radv: use MAJOR_IN_SYSMACROS for sysmacros.h include
fixes build on OpenBSD
../src/amd/vulkan/radv_device.c:35:10: fatal error: 'sys/sysmacros.h' file not found

Fixes: 7aaa54feb5 ("radv: implement VK_EXT_physical_device_drm")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13448>
2022-02-26 01:00:29 +00:00
Jonathan Gray
afece589dc util: fix util_cpu_detect_once() build on OpenBSD
Correct type for sysctl argument to fix the build.

../src/util/u_cpu_detect.c:631:29: error: incompatible pointer types passing 'int *' to parameter of type 'size_t *' (aka 'unsigned long *') [-Werror,-Wincompatible-pointer-types]
      sysctl(mib, 2, &ncpu, &len, NULL, 0);
                            ^~~~

Fixes: 5623c75e40 ("util: Fix setting nr_cpus on some BSD variants")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13448>
2022-02-26 01:00:29 +00:00
Jonathan Gray
623ff4ec42 util: fix u_print.cpp build on OpenBSD
move include so va_list will be picked up via stdarg.h

In file included from ../src/util/u_printf.cpp:24:
../src/util/u_printf.h:43:41: error: unknown type name 'va_list'; did you mean '__va_list'?
size_t u_printf_length(const char *fmt, va_list untouched_args);
                                        ^~~~~~~
                                        __va_list
/usr/include/machine/_types.h:126:27: note: '__va_list' declared here
typedef __builtin_va_list       __va_list;
                                ^

and add includes to u_printf.h as suggested by Ilia Mirkin
stdarg.h for va_list and stddef.h for size_t

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13448>
2022-02-26 01:00:29 +00:00
Jonathan Gray
7d609431d4 util: unbreak non-linux mips64 build
Put linux specific path inside an ifdef.  Unbreaks mips64 build on
OpenBSD and likely other systems without Elf64_auxv_t.

Fixes: 88b234d7a7 ("gallivm: add basic mips64 support and set mcpu to mips64r5 on ls3a4000")
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15166>
2022-02-26 10:47:43 +11:00
Marcin Ślusarz
e5c39bc427 intel/compiler: optimize flat inputs mask calculation
Don't bother looking at urb if variable is not flat.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15169>
2022-02-25 22:34:22 +00:00
Marcin Ślusarz
e2cb562dd1 intel/compiler: ignore per-primitive attrs when calculating flat input mask
If we say that per-primitive attributes are flat (which is communicated by
3DSTATE_SBE.ConstantInterpolationEnable), GPU freaks out and applies it
to other (non-flat) attributes.

Fixes: be89ea3231 ("intel/compiler: Handle per-primitive inputs in FS")

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15169>
2022-02-25 22:34:22 +00:00
Alyssa Rosenzweig
216da26b3f pan/va: Add TEX_FETCH assembler case
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15182>
2022-02-25 21:53:03 +00:00
Alyssa Rosenzweig
794836daf0 pan/va: Handle sr_write_count in the disassembler
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15182>
2022-02-25 21:53:02 +00:00
Alyssa Rosenzweig
eee6dad0c9 pan/va: Fix definitions of TEX_SINGLE and TEX_FETCH
Fix the definitions of the basic texturing instructions. In particular, a
register format and a write mask were previously missing, as well as incorrect
handling of staging registers.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15182>
2022-02-25 21:53:02 +00:00
Alyssa Rosenzweig
a58807fa95 pan/va: Don't use staging index as a sideband
It would cause us to get incorrect disassembly when the syntax is flipped.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15182>
2022-02-25 21:53:02 +00:00
Alyssa Rosenzweig
49a4cc6af8 pan/va: Handle extended staging counts in assembler
Needed for texturing.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15182>
2022-02-25 21:53:02 +00:00
Alyssa Rosenzweig
142ba9fea6 pan/va: Allow forcing enums for 1-bit modifiers
Ocassionally the 0 value has a meaningful value that's not meaningfully default,
so we want an enum to encode both possible states.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15182>
2022-02-25 21:53:02 +00:00
Alyssa Rosenzweig
20fce28dfd pan/va: Add MUX.v2i16 and MUX.v4i8 opcodes
Basically identical to MUX.i32, slight differences in opcode and swizzling only.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15182>
2022-02-25 21:53:02 +00:00
Alyssa Rosenzweig
97f8fad37b pan/va: Remove incorrect TEX test cases
Not close enough to salvage; TEX is going to be redefined.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15182>
2022-02-25 21:53:02 +00:00
Emma Anholt
b1f349dff4 nir: Allow the _replicates opcodes to have num_components != 4.
This required relaxing a core NIR assertion which I don't think is doing
any important validation.

The shader-db effects here are small, but they're important for avoiding a
regression when we start doing per-component DCE in opt_shrink_vectors
(https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12468)

softpipe shader-db:
total instructions in shared programs: 2859777 -> 2859454 (-0.01%)
instructions in affected programs: 18881 -> 18558 (-1.71%)
total temps in shared programs: 293994 -> 293914 (-0.03%)
temps in affected programs: 418 -> 338 (-19.14%)

i915g:
total instructions in shared programs: 407562 -> 407544 (<.01%)
instructions in affected programs: 570 -> 552 (-3.16%)

r300:
total instructions in shared programs: 1414450 -> 1414459 (<.01%)
instructions in affected programs: 44494 -> 44503 (0.02%)
total vinst in shared programs: 473782 -> 473727 (-0.01%)
vinst in affected programs: 1102 -> 1047 (-4.99%)
total sinst in shared programs: 231224 -> 231216 (<.01%)
sinst in affected programs: 432 -> 424 (-1.85%)
total temps in shared programs: 197605 -> 197607 (<.01%)
temps in affected programs: 103 -> 105 (1.94%)

crocus hsw:
total instructions in shared programs: 8158185 -> 8158134 (<.01%)
instructions in affected programs: 10927 -> 10876 (-0.47%)

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15178>
2022-02-25 12:31:48 -08:00
Daniel Schürmann
f030b75b7d aco: relax condition to remove branches in case of few instructions
This patch relaxes the conditions under which
we remove branch instructions.

Totals from 27246 (20.20% of 134913) affected shaders: (GFX10.3)
CodeSize: 193413312 -> 192924928 (-0.25%)
Instrs: 36146788 -> 36024692 (-0.34%)
Latency: 528374112 -> 528469044 (+0.02%); split: -0.01%, +0.02%
InvThroughput: 106198759 -> 106216583 (+0.02%); split: -0.00%, +0.02%
Branches: 1040640 -> 918543 (-11.73%)

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8647>
2022-02-25 15:38:08 +00:00
Samuel Pitoiset
53ca85ac2a radv,drirc: move RADV workarounds to 00-radv-defaults.conf
Because we have to maintain two different packages of Mesa, one
specific to RADV and another one for RadeonSI and such, it's a bit
annoying to have to synchronize the drirc entries. Currently, only our
Mesa package installs 00-mesa-defaults.conf which means we have to
backport the drirc RADV changes.

This splits 00-mesa-defaults.conf in two to move the drirc RADV entries
to src/amd/vulkan/00-radv-defaults.conf. Meson will install the file
only if RADV is built.

There is still a caveat for common drirc workarounds like for WSI but
they are rare enough and we could still duplicate them if needed.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15152>
2022-02-25 15:05:56 +01:00
Timur Kristóf
1ca6b2f216 aco: Support memory modes properly with load/store_buffer_amd.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15161>
2022-02-25 14:08:39 +01:00
Timur Kristóf
ba4b48e787 aco: Support task_payload with barriers, refactor allowed storage class.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15161>
2022-02-25 14:08:36 +01:00
Timur Kristóf
cd0dd5d6b7 aco: Add storage class for Task Shader payload.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15161>
2022-02-25 13:20:08 +01:00
Timur Kristóf
962b2fe214 spirv: Use task_payload mode for generic task outputs and mesh inputs.
This new mode will be only used for the actual payload variables and
not the number of launched mesh shader workgroups, which will still
be treated as an output.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14930>
2022-02-25 06:52:07 +00:00
Timur Kristóf
f629fbd778 nir: Add new variable mode for task/mesh payload.
Task shader outputs work differently than other shaders, so they
need special consideration. Essentially, they have two kinds of
outputs:

1. Number of mesh shader workgroups to launch.
Will be still represented by a shader output.

2. Optional payload of up to (at least) 16K bytes.
These payload variables behave similarly to shared memory, but
the spec doesn't actually define them as shared memory (also, they
may be implemented differently by each backend), so we need to add
a new NIR variable mode for them.

These payload variables can't be represented by shader outputs
because the 16K bytes don't fit the 32x vec4 model that NIR uses
for its output variables.

This patch adds a new NIR variable mode: nir_var_mem_task_payload
and corresponding explicit I/O intrinsics, as well as support for
this new mode in nir_lower_io.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14930>
2022-02-25 06:52:07 +00:00
Timur Kristóf
d2d6eca081 radv: Refactor mesh shader draws and add num_workgroups.
Several of the new draw packets need this argument
including all of the taskmesh commands, so it's
best to always declare it.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15034>
2022-02-25 06:31:33 +00:00
Timur Kristóf
bf519a7d47 ac/nir: Refactor mesh shader output code to smaller functions.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15034>
2022-02-25 06:31:33 +00:00
Timur Kristóf
a84789f795 ac/nir: Make sure to exclude special outputs from arrayed output masks.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15034>
2022-02-25 06:31:33 +00:00
Timur Kristóf
3956c03b05 ac/nir: Sanitize mesh shader primitive indices using umin.
This makes our implementation friendlier to potentially buggy shaders,
meaning that it will less likely to hang the GPU.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15034>
2022-02-25 06:31:33 +00:00
Timur Kristóf
0746b98f4a ac/nir: Properly handle when mesh API workgroup size is smaller than HW.
The problem is that the real workgroup launched on NGG HW
can be larger than the size specified by the API, and the
extra waves need to keep up with barriers in the API waves.

There are 2 different cases:

1. The whole API workgroup fits in a single wave.
   We can shrink the barriers to subgroup scope and
   don't need to insert any extra ones.

2. The API workgroup occupies multiple waves, but not
   all. In this case, we emit code that consumes every
   barrier on the extra waves.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15034>
2022-02-25 06:31:33 +00:00
Timur Kristóf
d88516a23f ac/nir: Move LDS area for primitive count to the beginning.
This makes it impossible for out of bounds vertex and primitive
attribute stores and indices stores to overwrite this.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15034>
2022-02-25 06:31:33 +00:00
Timur Kristóf
9cc9cf77a8 aco: Fix multiview view index for mesh shaders.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15034>
2022-02-25 06:31:33 +00:00
Timur Kristóf
082b691141 aco: Fix workgroup_id.y and .z for NV_mesh_shader.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15034>
2022-02-25 06:31:33 +00:00
Timur Kristóf
10ebfb3bf2 aco: Allow 1-byte loads and stores with load/store_buffer_amd
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15034>
2022-02-25 06:31:33 +00:00
Timur Kristóf
1ee3d49e3e radv: Better exclude special MS outputs from driver location assignment.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15034>
2022-02-25 06:31:33 +00:00
Guilherme Gallo
d1c6185b5a ci: skqp: Add Vulkan support for a630_skqp job
This commit adds support for Vulkan backend on a630_skqp job.

= Needed changes
- Needed to install libvulkan-dev package on system
- Refactored the way the available skqp reports are printed
  tested in development builds with skia tools

Piglit expectations had to be updated in various drivers due to !14750 not
having bumped the tags when it tried to uprev.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14686>
2022-02-25 05:50:06 +00:00
Guilherme Gallo
8bfef8bf6b ci: skqp: Build skqp from android-cts-10.0_r11 tag with Clang
The Android CTS 10 version is relative old when compared with skia main
branch, which was being used before. Some modifications in the skqp
build/runner scripts were needed to make it run on CI.

- skqp versions from android-cts have already all assets inside
  platform_tools folder.
  - along with the assets, are the render and unit files which are
    expected to pass in the Android CTS execution.
  - removed custom test files from the a630 folder, to make it comply
    with the CTS expectations.
- include new patches to remove Python2 dependencies and avoid the
  installation of it in rootfs.
- strip binariesthe built binaries `skqp` and `list_gpu_unit_tests`, as
  `is_debug = false` gn argument did not work, maybe it is not well
      tested in development builds with skia tools
- use Clang instead of GCC. The GCC support is not so graceful as it is
  in the skia main branch, some NEON instructions needs to be turned off
  in the GCC compilation, causing different tests result. This change
  does not imply a bigger rootfs, since the built skqp binary uses GCC
  libc++ and other library runtimes. So clang is just a build
  dependency.

= Changes in skqp results =

Some errors were found for GL backend and unit tests. GLES and VK tests are green.
All the failed tests were classified as expected to fail in the render and unit tests list.

```
gl_blur2rectsnonninepatch
gl_bug339297_as_clip
gl_bug6083
gl_dashtextcaps
```

```
SRGBReadWritePixels (../../tests/SRGBReadWritePixelsTest.cpp:214	Could not create sRGB surface context. [OpenGL])
```

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14686>
2022-02-25 05:50:06 +00:00
Mike Blumenkrantz
5ffed2a299 features: VK_EXT_depth_clip_control for lavapipe
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15126>
2022-02-25 05:27:27 +00:00
Mike Blumenkrantz
07c0801e60 lavapipe: EXT_depth_clip_control
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15126>
2022-02-25 05:27:27 +00:00
Emma Anholt
f458c7f200 ci/zink: Add testing of dEQP GLES3.1/3.2.
I think this has been kind of just an oversight.  Increases runtime by a
minute, to 5:30.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15159>
2022-02-24 16:16:57 -08:00
Emma Anholt
b4132bd026 ci/zink: Move testing to shared 64-core runners at Google.
Now the main deqp and piglit run takes about 4:30 of runner time in a
single job.

Added a couple of flakes that hit this MR, but which I think predate it
(probably due to not having #zink-ci until recently).

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15159>
2022-02-24 16:15:56 -08:00
Erik Faye-Lund
834db3aa8d docs: remove incorrect drivers from extension
This extension isn't wired up in Gallium, so there's just no way a
Gallium driver like Panfrost exposes it.

While there were support in i965 for this for the cancelled Broxton GPU,
thre's no such support in the Iris driver. And since Broxton has been
cancelled, it's unlikely to be wired up any time soon.

Fixes: da23a31726 ("docs/features: Update ASTC entries for Panfrost")
Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15145>
2022-02-24 23:25:56 +00:00
Alyssa Rosenzweig
988d5aae74 panfrost: Flush resources when shadowing
When we shadow a resource, the backing BO is changed; as such,
existing references to the resource become invalid. So batches accessing the
resource need to be flushed (or otherwise have their references invalidated).

The wrong behaviour change (not flushing) was introduced when we started
tracking resources instead of BOs. The issue manifested as a severe performance
regression in glmark2's -bbuffer test, particular the subdata subtest. The issue
is magnified on slow CPUs; without the fix, the test becomes completely CPU
bound

Relevant glmark2 -bbuffer test from 43fps to 84fps.

Apparently, this causes functional issues too -- this performance-minded change
also fixes a few piglits.

Fixes: cecb889481 ("panfrost: Do tracking of resources, not BOs")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Chris Healy <cphealy@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13502>
2022-02-24 23:11:20 +00:00
Alyssa Rosenzweig
5536852d60 panfrost: Handle NULL samplers
Fixes a NULL dereference in Piglit fp-fragment-position, getting the
test to pass.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13203>
2022-02-24 22:48:30 +00:00
Alyssa Rosenzweig
53ef20f08d panfrost: Handle NULL sampler views
Fixes a NULL dereference in Piglit fp-fragment-position.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13203>
2022-02-24 22:48:30 +00:00
Alyssa Rosenzweig
304851422a panfrost: Fix set_sampler_views for big GL
Roughly use the freedreno logic to handle all the extra things that will
come up in our Piglit sooner than later.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13203>
2022-02-24 22:48:30 +00:00
Alyssa Rosenzweig
4b2769493e panfrost/ci: Update xfails list
These tests seem to be passing now.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13203>
2022-02-24 22:48:30 +00:00
Kenneth Graunke
97f18d2929 blorp: Add blorp_measure hooks to the blitter codepaths
I had missed these when hooking up the original support.

Fixes: 31eeb72e45 ("blorp: Add support for blorp_copy via XY_BLOCK_COPY_BLT")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15157>
2022-02-24 21:42:16 +00:00
Kenneth Graunke
e6b7e74308 iris: Set MI_FLUSH_DW::PostSyncOperation correctly
The MI_FLUSH_DW post-sync operation uses the same encoding as the
PIPE_CONTROL one so we can use the same helper.  Write PS Depth Count
is not supported, of course, as the blitter has no depth pipeline.

This means that we can write the timestamp register from the blitter.

Fixes: 604d97671b ("iris: Add support for flushing the blitter (hackily)")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15157>
2022-02-24 21:42:16 +00:00
Pavel Ondračka
c393753daa r300: add predicate instructions to statistics of vertex shaders
All of IF, ELSE, ENDIF, BREAK and CONTINUE were already translated
to the predication instructions in rc_vert_fc so all the flow control
we count at the moment is just BGNLOOP and ENDLOOP.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15077>
2022-02-24 21:31:03 +00:00
Pavel Ondračka
8eb9bffdfc r300: report number of loops in shader statistics
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15077>
2022-02-24 21:31:03 +00:00
Pavel Ondračka
517b37a08c r300: use %u specifiers when printing unsigned stats values
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6019
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15077>
2022-02-24 21:31:03 +00:00
Pavel Ondračka
e7978412c3 r300: only print shader statistics when compilation succeeds
This allows to disregard the huge shaders that won't run anyway
and hopefully make catching shader regressions that result in a
compile failure easier.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15077>
2022-02-24 21:31:03 +00:00
Mike Blumenkrantz
b124f83bc2 zink: add a flake channel
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15129>
2022-02-24 20:13:53 +00:00
Alyssa Rosenzweig
cd2a4cc47c pan/bi: Unit test message preloading optimization
To make sure it is applied in the cases we expect it to be, to avoid code
generation regressions. Functional regressions are expected to be caught by
integration-testing, so that is not focused on here.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9438>
2022-02-24 14:13:21 -05:00
Alyssa Rosenzweig
eb1479bda2 pan/bi: Support message preloading
Preload LD_VAR_IMM or VAR_TEX instructions in the first block of fragment
shaders on v7. Preloaded messages write to fixed registers; when replacing
instructions we insert moves from the registers at the start of the program and
hope coalescing goes to town. (Admittedly we don't do any coalescing yet...)
The extra moves hurts instruction count in some cases; the win for cycle count
should cancel this out. When we get smarter copy prop or RA, those moves should
go away anyway.

This optimization may hurt register pressure by extending the lifetime of up to
eight registers written in the first block. This is expected to be acceptable:
on a large shader-db, there are no additional spills/fills, and only two shaders
are hurt on thread count.

This optimization only applies to v7, as the hardware was not introduced on v6
and was removed for Valhall.

total instructions in shared programs: 2451624 -> 2454286 (0.11%)
instructions in affected programs: 909046 -> 911708 (0.29%)
helped: 4719
HURT: 3341
helped stats (abs) min: 1.0 max: 10.0 x̄: 1.49 x̃: 1
helped stats (rel) min: 0.08% max: 33.33% x̄: 6.79% x̃: 3.92%
HURT stats (abs)   min: 1.0 max: 50.0 x̄: 2.90 x̃: 2
HURT stats (rel)   min: 0.12% max: 66.67% x̄: 6.39% x̃: 3.45%
95% mean confidence interval for instructions value: 0.27 0.39
95% mean confidence interval for instructions %-change: -1.55% -1.11%
Inconclusive result (value mean confidence interval and %-change mean confidence interval disagree).

total tuples in shared programs: 1969529 -> 1963429 (-0.31%)
tuples in affected programs: 601327 -> 595227 (-1.01%)
helped: 5907
HURT: 1297
helped stats (abs) min: 1.0 max: 8.0 x̄: 1.41 x̃: 1
helped stats (rel) min: 0.07% max: 33.33% x̄: 7.25% x̃: 5.26%
HURT stats (abs)   min: 1.0 max: 40.0 x̄: 1.73 x̃: 1
HURT stats (rel)   min: 0.16% max: 31.75% x̄: 3.38% x̃: 2.02%
95% mean confidence interval for tuples value: -0.88 -0.81
95% mean confidence interval for tuples %-change: -5.52% -5.15%
Tuples are helped.

total clauses in shared programs: 401689 -> 387830 (-3.45%)
clauses in affected programs: 136944 -> 123085 (-10.12%)
helped: 8427
HURT: 4
helped stats (abs) min: 1.0 max: 4.0 x̄: 1.65 x̃: 2
helped stats (rel) min: 0.49% max: 50.00% x̄: 19.88% x̃: 18.18%
HURT stats (abs)   min: 1.0 max: 4.0 x̄: 2.50 x̃: 2
HURT stats (rel)   min: 1.96% max: 19.05% x̄: 14.18% x̃: 17.86%
95% mean confidence interval for clauses value: -1.66 -1.63
95% mean confidence interval for clauses %-change: -20.15% -19.58%
Clauses are helped.

total cycles in shared programs: 202735.83 -> 201862.21 (-0.43%)
cycles in affected programs: 16295.46 -> 15421.83 (-5.36%)
helped: 3349
HURT: 1962
helped stats (abs) min: 0.041665999999999315 max: 1.0 x̄: 0.32 x̃: 0
helped stats (rel) min: 0.24% max: 100.00% x̄: 40.77% x̃: 33.33%
HURT stats (abs)   min: 0.041665999999999315 max: 1.5833329999999997 x̄: 0.10 x̃: 0
HURT stats (rel)   min: 0.09% max: 31.40% x̄: 2.95% x̃: 1.94%
95% mean confidence interval for cycles value: -0.17 -0.16
95% mean confidence interval for cycles %-change: -25.48% -23.76%
Cycles are helped.

total arith in shared programs: 74665.50 -> 74920.00 (0.34%)
arith in affected programs: 16059.92 -> 16314.42 (1.58%)
helped: 860
HURT: 3409
helped stats (abs) min: 0.041665999999999315 max: 0.25 x̄: 0.06 x̃: 0
helped stats (rel) min: 0.24% max: 37.50% x̄: 4.73% x̃: 2.56%
HURT stats (abs)   min: 0.041665999999999315 max: 1.5833329999999997 x̄: 0.09 x̃: 0
HURT stats (rel)   min: 0.09% max: 100.00% x̄: 8.99% x̃: 4.21%
95% mean confidence interval for arith value: 0.06 0.06
95% mean confidence interval for arith %-change: 5.83% 6.62%
Arith are HURT.

total texture in shared programs: 13083.50 -> 11877 (-9.22%)
texture in affected programs: 1663 -> 456.50 (-72.55%)
helped: 2377
HURT: 3
helped stats (abs) min: 0.5 max: 1.0 x̄: 0.51 x̃: 0
helped stats (rel) min: 6.25% max: 100.00% x̄: 87.12% x̃: 100.00%
HURT stats (abs)   min: 0.5 max: 0.5 x̄: 0.50 x̃: 0
HURT stats (rel)   min: 0.00% max: 25.00% x̄: 16.67% x̃: 25.00%
95% mean confidence interval for texture value: -0.51 -0.50
95% mean confidence interval for texture %-change: -87.98% -86.00%
Texture are helped.

total vary in shared programs: 10220.62 -> 4183.88 (-59.06%)
vary in affected programs: 10126.50 -> 4089.75 (-59.61%)
helped: 8538
HURT: 0
helped stats (abs) min: 0.125 max: 1.0 x̄: 0.71 x̃: 0
helped stats (rel) min: 7.14% max: 100.00% x̄: 74.74% x̃: 87.50%
95% mean confidence interval for vary value: -0.71 -0.70
95% mean confidence interval for vary %-change: -75.32% -74.16%
Vary are helped.

total quadwords in shared programs: 1766717 -> 1757161 (-0.54%)
quadwords in affected programs: 553801 -> 544245 (-1.73%)
helped: 6760
HURT: 711
helped stats (abs) min: 1.0 max: 11.0 x̄: 1.58 x̃: 1
helped stats (rel) min: 0.09% max: 29.41% x̄: 5.31% x̃: 4.84%
HURT stats (abs)   min: 1.0 max: 33.0 x̄: 1.54 x̃: 1
HURT stats (rel)   min: 0.10% max: 31.13% x̄: 2.53% x̃: 1.61%
95% mean confidence interval for quadwords value: -1.31 -1.25
95% mean confidence interval for quadwords %-change: -4.67% -4.46%
Quadwords are helped.

total threads in shared programs: 52899 -> 52897 (<.01%)
threads in affected programs: 4 -> 2 (-50.00%)
helped: 0
HURT: 2

total preloads in shared programs: 0 -> 116492
preloads in affected programs: 0 -> 116492
helped: 0
HURT: 8604
HURT stats (abs)   min: 2.0 max: 24.0 x̄: 13.54 x̃: 14
HURT stats (rel)   min: 0.00% max: 0.00% x̄: 0.00% x̃: 0.00%
95% mean confidence interval for preloads value: 13.45 13.63
95% mean confidence interval for preloads %-change: 0.00% 0.00%
Preloads are HURT.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9438>
2022-02-24 14:09:14 -05:00
Alyssa Rosenzweig
c8437cd415 pan/bi: Account for message preloading in shaderdb
If a message-passing instruction like LD_VAR is preloaded, it will no longer be
counted in the shader cycle counts. Add a special message preload counter that
approximates the cost of preloading, so this information doesn't get a lost.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9438>
2022-02-24 12:51:04 -05:00
Alyssa Rosenzweig
19541dc8c8 pan/bi: Add bi_before_nonempty_block helper
To be used in the message preloading pass.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9438>
2022-02-24 12:51:04 -05:00
Alyssa Rosenzweig
6618697e0e panfrost: Pack message preloads from compiler
Include full message preload descriptors in the RSD on v7, and do the obvious
packing for fragment shader message preloads.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9438>
2022-02-24 12:51:04 -05:00
Alyssa Rosenzweig
bd06a26662 panfrost: Add an unpacked message preload struct
The compiler will soon produce preloaded messages, but it should not pack them
itself, as this would require depending on GenXML or handcoding bitfields / bit
packs in the compiler. Instead, add a struct encoding the unpacked form of the
message, used as ABI between the compiler and the common driver.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9438>
2022-02-24 12:51:04 -05:00
Alyssa Rosenzweig
2d0c4973dc panfrost: Remove Message Preload Descriptor from v6.xml
It is an anachronism, as this descriptor was added in v7 and, seemingly, removed
immediately after. Good work.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9438>
2022-02-24 12:50:58 -05:00
Igor Torrente
b130f8f4cf venus: add macros to help with future extensions
Currently we have to add almost the same code to the
`vn_physical_device_init_{features, properties}` to add
the extension to the `physical_dev->{features, properties}`
list.

These macros improves the code reusage.

Signed-off-by: Igor Torrente <igor.torrente@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15059>
2022-02-24 15:55:57 +00:00
Alyssa Rosenzweig
43bbe367ea panfrost/ci: Move T860 flake to skip
Actually an xfail but occassionally passes and gives us no new information, only
noise.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Suggested-and-acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15154>
2022-02-24 14:51:31 +00:00
Alyssa Rosenzweig
5c07f7c427 panfrost/ci: Move T720 flakes to skips
Doesn't seem like these will be resolved anytime soon..

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Suggested-and-acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15154>
2022-02-24 14:51:31 +00:00
Tomeu Vizoso
eecc62ccbd Revert "ci: Disable jobs to the Collabora lab"
This reverts commit f692bda484.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15153>
2022-02-24 13:44:09 +01:00
Iago Toral Quiroga
cf99584f51 broadcom/compiler: move uniforms right before their first use after scheduling
On V3D the quality of the code we generate is significantly affected by
how we decide to assign accumulators during register allocation, which
is determined by liveness, favoring short-lived temps.

There are many shaders that end up doing a whole lot of uniform loads
first, and using them later, which is very inconvenient for our register
allocation process because this increases uniform liveness and causes
us to use accumulators less efficientely, leading to significant churn.

To fix this, we move uniforms right before their first use in the same
block, but we need to do this after NIR scheduling, which means we are
doing it in non-SSA form, since the scheduler has a tendency to undo
this optimization and it is not easy to modify it to avoid it, since it
works in more abstract terms, using instruction dependencies, estimated
register pressure and instruction delay information to do its work,
which are very different concepts.

total instructions in shared programs: 13316738 -> 13033613 (-2.13%)
instructions in affected programs: 10389172 -> 10106047 (-2.73%)
helped: 55442
HURT: 16144

total threads in shared programs: 413722 -> 415048 (0.32%)
threads in affected programs: 1428 -> 2754 (92.86%)
helped: 680
HURT: 17

total loops in shared programs: 1716 -> 1690 (-1.52%)
loops in affected programs: 26 -> 0
helped: 26
HURT: 0

total uniforms in shared programs: 3704313 -> 3705181 (0.02%)
uniforms in affected programs: 687730 -> 688598 (0.13%)
helped: 2920
HURT: 7384

total max-temps in shared programs: 2364785 -> 2175190 (-8.02%)
max-temps in affected programs: 1215387 -> 1025792 (-15.60%)
helped: 49667
HURT: 1556

total spills in shared programs: 4241 -> 4248 (0.17%)
spills in affected programs: 642 -> 649 (1.09%)
helped: 11
HURT: 19

total fills in shared programs: 6115 -> 6125 (0.16%)
fills in affected programs: 1276 -> 1286 (0.78%)
helped: 11
HURT: 21

total sfu-stalls in shared programs: 34381 -> 36578 (6.39%)
sfu-stalls in affected programs: 16055 -> 18252 (13.68%)
helped: 3647
HURT: 5206

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15056>
2022-02-24 11:36:00 +00:00
Iago Toral Quiroga
f1d20ec67c nir/nir_opt_move: handle non-SSA defs
We just skip register defs and avoid moving register reads across them.
This allows us to run this pass in non-SSA form.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15056>
2022-02-24 11:36:00 +00:00
Iago Toral Quiroga
fe2249eac5 nir: add a nir_instr_def_is_register helper
This returns true if the instruction has a dest that is not an SSA value.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15056>
2022-02-24 11:36:00 +00:00
Iago Toral Quiroga
0a04468704 nir/nir_opt_move: allow to move uniform loads
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15056>
2022-02-24 11:36:00 +00:00
Tomeu Vizoso
f692bda484 ci: Disable jobs to the Collabora lab
In anticipation of infrastructure work.

This commit is to be reverted later in the day.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15150>
2022-02-24 07:34:14 +01:00
Tomeu Vizoso
c0695bb473 ci: Allow disabling the whole of the Collabora farm
Add a global-level variable that allows disabling all jobs that would
have gone to the Collabora lab, to be used in case of outages.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15150>
2022-02-24 07:33:45 +01:00
Emma Anholt
a5fa7e04d7 ci/lvp: Update the asan fails list.
Many tests had been fixed but weren't being run due to test reshuffles
from uprevs.  Add some explanations for what remains.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15133>
2022-02-24 02:09:02 +00:00
Alyssa Rosenzweig
6b2eda6b72 pan/bi: Reorder pushed uniforms to avoid moves
On Bifrost and Valhall, push uniforms are loaded into Fast Access Uniform
Random Access Memory (FAU-RAM). FAU-RAM is organized as an array of 64-bit
slots. A given tuple (Bifrost) or instruction (Valhall) may access at most a
single 64-bit slot. If an instruction requires uniforms from multiple 64-bit
slots, a uniform-to-register move must be inserted to avoid the hazard. However,
if an instruction requires a pair of 32-bit uniforms from the same 64-bit slot,
no move is required.

To reduce the number of moves we emit, this commit adds an optimization pass
that reorders pushed uniforms, trying to group uniforms used by the same
instruction. The pass works by creating a graph of pushed uniforms, where edges
denote the "both 32-bit uniforms required by the same instruction" relationship.
We perform depth-first search on this graph to find the connected components,
where each connected component is a cluster of uniforms that are used together.
We then select pairs of uniforms from each connected component. The remaining
unpaired uniforms (from components of odd sizes) are paired together
arbitrarily.

In principle, we should weight the graph by number of occurences and choose
pairs that maximize the total selected edge weight. This is left for
future work, as it is nontrivial -- selecting these edges optimally appears to
be NP-hard at first blush.

Implementation note: As position and varying shaders share FAU on Bifrost, extra
care is taken with a `push_offset` shader stage info parameter that ensures
varying shaders do not reorder uniforms selected by the previous position
shader.

total instructions in shared programs: 2503343 -> 2451758 (-2.06%)
instructions in affected programs: 1553309 -> 1501724 (-3.32%)
helped: 14256
HURT: 8
helped stats (abs) min: 1.0 max: 80.0 x̄: 3.62 x̃: 3
helped stats (rel) min: 0.06% max: 36.36% x̄: 7.31% x̃: 6.67%
HURT stats (abs)   min: 1.0 max: 2.0 x̄: 1.38 x̃: 1
HURT stats (rel)   min: 1.30% max: 12.50% x̄: 4.99% x̃: 3.85%
95% mean confidence interval for instructions value: -3.66 -3.58
95% mean confidence interval for instructions %-change: -7.41% -7.20%
Instructions are helped.

total tuples in shared programs: 2008399 -> 1969627 (-1.93%)
tuples in affected programs: 1146344 -> 1107572 (-3.38%)
helped: 12867
HURT: 147
helped stats (abs) min: 1.0 max: 61.0 x̄: 3.03 x̃: 2
helped stats (rel) min: 0.17% max: 42.86% x̄: 6.79% x̃: 4.65%
HURT stats (abs)   min: 1.0 max: 3.0 x̄: 1.20 x̃: 1
HURT stats (rel)   min: 0.29% max: 20.00% x̄: 2.12% x̃: 1.19%
95% mean confidence interval for tuples value: -3.03 -2.93
95% mean confidence interval for tuples %-change: -6.82% -6.57%
Tuples are helped.

total clauses in shared programs: 408005 -> 401708 (-1.54%)
clauses in affected programs: 90760 -> 84463 (-6.94%)
helped: 6006
HURT: 164
helped stats (abs) min: 1.0 max: 9.0 x̄: 1.08 x̃: 1
helped stats (rel) min: 0.45% max: 33.33% x̄: 12.44% x̃: 14.29%
HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 1.64% max: 25.00% x̄: 9.81% x̃: 5.26%
95% mean confidence interval for clauses value: -1.03 -1.01
95% mean confidence interval for clauses %-change: -12.03% -11.66%
Clauses are helped.

total cycles in shared programs: 203308.37 -> 202737.83 (-0.28%)
cycles in affected programs: 19264.71 -> 18694.17 (-2.96%)
helped: 3024
HURT: 41
helped stats (abs) min: 0.041665999999999315 max: 2.5416680000000014 x̄: 0.19 x̃: 0
helped stats (rel) min: 0.17% max: 33.33% x̄: 3.83% x̃: 2.83%
HURT stats (abs)   min: 0.041665999999999315 max: 0.125 x̄: 0.06 x̃: 0
HURT stats (rel)   min: 0.30% max: 5.88% x̄: 1.41% x̃: 0.93%
95% mean confidence interval for cycles value: -0.19 -0.18
95% mean confidence interval for cycles %-change: -3.89% -3.64%
Cycles are helped.

total arith in shared programs: 76265.67 -> 74669.25 (-2.09%)
arith in affected programs: 45001.50 -> 43405.08 (-3.55%)
helped: 12945
HURT: 97
helped stats (abs) min: 0.041665999999999315 max: 2.5416680000000014 x̄: 0.12 x̃: 0
helped stats (rel) min: 0.17% max: 50.00% x̄: 8.06% x̃: 4.88%
HURT stats (abs)   min: 0.041665999999999315 max: 0.125 x̄: 0.05 x̃: 0
HURT stats (rel)   min: 0.21% max: 33.33% x̄: 2.16% x̃: 0.96%
95% mean confidence interval for arith value: -0.12 -0.12
95% mean confidence interval for arith %-change: -8.16% -7.81%
Arith are helped.

total quadwords in shared programs: 1796563 -> 1766803 (-1.66%)
quadwords in affected programs: 948830 -> 919070 (-3.14%)
helped: 12078
HURT: 219
helped stats (abs) min: 1.0 max: 42.0 x̄: 2.49 x̃: 2
helped stats (rel) min: 0.10% max: 33.33% x̄: 5.57% x̃: 5.26%
HURT stats (abs)   min: 1.0 max: 4.0 x̄: 1.21 x̃: 1
HURT stats (rel)   min: 0.33% max: 6.67% x̄: 2.00% x̃: 1.14%
95% mean confidence interval for quadwords value: -2.46 -2.38
95% mean confidence interval for quadwords %-change: -5.52% -5.36%
Quadwords are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14163>
2022-02-24 01:35:33 +00:00
Timothy Arceri
6eec8fcbfa glsl/nir: free GLSL IR right after we convert to NIR
Gives us memory back faster which is useful for pathalogical CTS
tests.

The GLSL IR was previously used after converting to NIR for things
like building the GL resource list but we have had a NIR version
for this for some time and I don't believe there are any other
use cases left for keeping the old IR hanging around this long.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15127>
2022-02-24 01:10:49 +00:00
Emma Anholt
0fda2ac4f0 ci/virgl: Drop the bvec4_from_mat4x2_vs xfail.
The fix has landed in VK-GL-CTS 1.3.1.0, we were just not noticing it
because this is also in the flakes list.

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14962>
2022-02-23 23:09:20 +00:00
Emma Anholt
9e710af830 ci/softpipe: Move most of testing to shared 64-core runners at Google.
The single job takes about 3:30 of runner time.  I don't have a good
explanation for the crash->fail test changes.

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14962>
2022-02-23 23:09:20 +00:00
Emma Anholt
73b37f9ff0 ci/lavapipe: Test 1/3 of lavapipe on the shared 64-core google runners.
Now we can get through 1/3 of the testsuite in about 3:30, while
previously we did 1/10th.

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14962>
2022-02-23 23:09:20 +00:00
Emma Anholt
0f64f4bdb5 ci/llvmpipe: Move most of testing to shared 64-core runners at Google.
These runners are configured to have a single job take up the whole
runner, which means we get to use threads to our hearts content.  The pile
of cores means we don't need to spawn separate jobs to try to load-balance
across fdo's shared runner capacity.  Having dedicated runners means we
won't get our MRs blocked as much waiting on non-Mesa testing happening on
fd.o.

We manage to complete all of this llvmpipe testing in about 6:15.

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14962>
2022-02-23 23:09:20 +00:00
Emma Anholt
6859b614a2 ci: Stash the ldd and ccache stats output under collapsed sections.
You rarely need to look at these, they're just nice to have sometimes.

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14962>
2022-02-23 23:09:20 +00:00
Samuel Pitoiset
a2c1fa9137 radv: initialize extra state for internal pipelines at one place
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14650>
2022-02-23 22:29:55 +00:00
Samuel Pitoiset
959e8586aa radv: remove useless radv_blend_state::single_cb_enable field
This was only used for meta operations. DCC/FMASK/FCE pipelines
only declare one color attachment and the color writemask of the
second color attachment is 0 for the HW CB resolve.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14650>
2022-02-23 22:29:55 +00:00
Samuel Pitoiset
8347d3dfd7 radv: initialize VGT_GS_OUT_PRIM_TYPE earlier
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14650>
2022-02-23 22:29:55 +00:00
Samuel Pitoiset
9fb0831ca1 radv: initialize more depth/stencil states earlier
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14650>
2022-02-23 22:29:55 +00:00
Dmitry Baryshkov
b4bef890ee freedreno/regs: remove 5nm DSI PHY regs
5nm PHY is a variation of 7nm PHY, they use the same register
definitions. To remove duplication, drop 5nm defs.

Cc: Robert Foss <robert.foss@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15051>
2022-02-23 21:25:22 +00:00
Eric Engestrom
c9e6d3ba73 docs: update calendar and link releases notes for 21.3.7
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15149>
2022-02-23 21:20:34 +00:00
Eric Engestrom
9bb16991b8 docs: add release notes for 21.3.7
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15149>
2022-02-23 21:20:34 +00:00
Dave Airlie
b77ef4dd60 draw/so: don't use pre clip pos if we have a tes either.
This check for geom shader needed to be expanded for tess support.

dEQP-VK.transform_feedback.simple.depth_clip_control_tese with lvp

Fixes: dacf8f5f5c ("draw: hook up final bits of tessellation")

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15128>
2022-02-23 20:56:42 +00:00
Alyssa Rosenzweig
31b7ebcbc7 pan/mdg: Fix overflow in intra-bundle interference
There are up to 4 instructions in the latter stage (if a branch is included),
not 3. Bump the limit to fix memory corruption.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Icecream95 <ixn@disroot.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15147>
2022-02-23 20:42:33 +00:00
Jordan Justen
0fffaa9fca anv: Align state pools to 2MiB on XeHP
Suggested-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Fixes: c17e2216dd ("anv: Align buffer VMA to 2MiB for XeHP")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15054>
2022-02-23 20:15:24 +00:00
Jordan Justen
5a28d2482f anv: Align GENERAL_STATE_POOL_MIN_ADDRESS to 2MiB
Fixes: c17e2216dd ("anv: Align buffer VMA to 2MiB for XeHP")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15054>
2022-02-23 20:15:24 +00:00
Alyssa Rosenzweig
d986731da9 iris,crocus,i915g: Don't stub flush_frontbuffer
This callback is only intended for software rasterizers, layered drivers, and
other special drivers that go through the software winsys path. Remove the
unimplemented stubs from the Intel drivers.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Dave Airlie <airlied@redhat.com> [crocus]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15118>
2022-02-23 19:49:54 +00:00
Alyssa Rosenzweig
51689a2b80 panfrost: Simplify panfrost_resource_get_handle
Unify the exit paths to clean up the logic. There are logically three modes we
support (KMS without renderonly, KMS with renderonly, and FD); these each
correspond to a leg of a small if statement. Outside of the small if's,
everything else should be identical.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: James Jones <jajones@nvidia.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15120>
2022-02-23 18:31:55 +00:00
Alyssa Rosenzweig
b5734cc1c4 panfrost: Fix FD resource_get_handle
When handle->type is WINSYS_HANDLE_TYPE_FD, the caller wants a file descriptor
for the BO backing the resource. We previously had two paths for this:

1. If rsrc->scanout is available, we prime the GEM handle from the KMS device
   (rsrc->scanout->handle) to a file descriptor via the KMS device.

2. If rsrc->scanout is not available, we prime the GEM handle from the GPU
   (bo->gem_handle) to a file descriptor via the GPU device.

In both cases, the caller passes in a resource (with BO) and expects out a file
descriptor. There are no direct GEM handles in the function signature; the
caller doesn't care which GEM handle we prime to get the file descriptor. In
principle, both paths produce the same file descriptor for the same BO, since
both GEM handles represent the same underlying resource (viewed from different
devices).

On grounds of redundancy alone, it makes sense to remove the rsrc->scanout path.
Why have a path that only works sometimes, when we have another path that works
always?

In fact, the issues with the rsrc->scanout path are deeper. rsrc->scanout is
populated by renderonly_create_gpu_import_for_resource, which does the
following:

1. Get a file descriptor for the resource by resource_get_handle with
   WINSYS_HANDLE_TYPE_FD
2. Prime the file descriptor to a GEM handle via the KMS device.

Here comes strike number 2: in order to get a file descriptor via the KMS
device, we had to /already/ get a file descriptor via the GPU device. If we go
down the KMS device path, we effectively round trip:

   GPU handle -> fd -> KMS handle -> fd

There is no good reason to do this; if everything works, the fd is the same in
each case. If everything works. If.

The lifetimes of the GPU handle and the KMS handle are not necessarily bound. In
principle, a resource can be created with scanout (constructing a KMS handle).
Then the KMS view can be destroyed (invalidating the GEM handle for the KMS
device), even though the underlying resource is still valid. Notice the GPU
handle is still valid; its lifetime is tied to the resource itself. Then a
caller can ask for the FD for the resource; as the resource is still valid, this
is sensible. Under the scanout path, we try to get the FD by priming the GEM
handle on the KMS device... but that GEM handle is no longer valid, causing the
PRIME ioctl to fail with ENOENT. On the other hand, if we primed the GPU GEM
handle, everything works as expected.

These edge cases are not theoretical; recent versions of Xwayland trigger this
ENOENT, causing issue #5758 on all Panfrost devices. As far as I can tell, no
other kmsro driver has this 'special' kmsro path; the only part of
resource_get_handle that needs special handling for kmsro is getting a KMS
handle.

Let's remove the broken, useless path, fix Xwayland, bring us in line with other
drivers, and delete some code.

Thank you for coming to my ted talk.

Closes: #5758
Fixes: 7da251fc72 ("panfrost: Check in sources for command stream")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-and-tested-by: Jan Palus <jpalus@fastmail.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: James Jones <jajones@nvidia.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Tested-by: Dan Johansen <strit@manjaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15120>
2022-02-23 18:31:55 +00:00
Dmitry Baryshkov
22efeec399 freedreno/registers: add new register for 7nm DSI PHY v4.3 (sm8450)
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15052>
2022-02-23 17:28:17 +00:00
Alyssa Rosenzweig
04b80489d5 ci: Disable windows-vs2019
Currently down.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15148>
2022-02-23 15:12:41 +00:00
Rhys Perry
ded9cb904f anv: Enable nir_opt_access
This commit will enable pass for searching readonly / writeonly
access when it's missing.

We don't support shaderStorageImageReadWithoutFormat
and the optimization pass causes those shaders to
take the write-only path which does support formatless.

Following games are affected with positive result:
 - Wolfenstein: Youngblood
 - Wolfenstein II: The New Colossus https://gitlab.freedesktop.org/mesa/mesa/-/issues/3138
 - Rage 2 https://gitlab.freedesktop.org/mesa/mesa/-/issues/5791
 - The Surge 2 https://gitlab.freedesktop.org/mesa/mesa/-/issues/5805
 - Metro Exodus https://gitlab.freedesktop.org/mesa/mesa/-/issues/4703
 - DOOM Eternal https://gitlab.freedesktop.org/mesa/mesa/-/issues/4273

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3138,https://gitlab.freedesktop.org/mesa/mesa/-/issues/5791,https://gitlab.freedesktop.org/mesa/mesa/-/issues/4273
Signed-off-by: Mykhailo Skorokhodov <mykhailo.skorokhodov@globallogic.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15082>
2022-02-23 13:11:12 +00:00
Alyssa Rosenzweig
abb7f04674 panfrost: Inline pan_emit_sfbd_tiler
Easier to read, the common code was already common.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15123>
2022-02-23 12:56:30 +00:00
Alyssa Rosenzweig
910d4f8245 panfrost: Remove pan_emit_fbd thunking
Use a common interface.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15123>
2022-02-23 12:56:30 +00:00
Alyssa Rosenzweig
8dc7757754 panfrost: Remove unrelated comment
Not sure what this was supposed to describe, but it's not the code here.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15123>
2022-02-23 12:56:30 +00:00
Alyssa Rosenzweig
099d61c95d panfrost: Use txl instead of tex in the blitter
We always blit from a particular level, so it's a waste to compute the LOD.
This corresponds to a simple texture instruction with implement 0 LOD, which is
the optimal texturing path on Bifrost -- it maps to TEXS_2D but does not require
helper invocations.

Functional change on Bifrost: Blit shaders no longer set .computed_lod or
shader_contains_barrier.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15123>
2022-02-23 12:56:30 +00:00
Alyssa Rosenzweig
5b1a00c565 panfrost: Inline pan_blit_emit_dcd
Easier to follow the logic without having a million arguments passed around.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15123>
2022-02-23 12:56:30 +00:00
Alyssa Rosenzweig
c9784c9512 panfrost: Decouple tiler job and DCD emit
We can share the "emit quad" logic, even though the DCDs differ.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15123>
2022-02-23 12:56:30 +00:00
Alyssa Rosenzweig
a13d87c484 panfrost: Annotate slow clears as such
We should realistically be using the clear shaders from PanVK once they're moved
to common.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15123>
2022-02-23 12:56:30 +00:00
Alyssa Rosenzweig
1eb3dbafdb panfrost: Set defaults for deprecated DCD fields
There are always set to true. Don't pollute the driver code with them, make
their existence a local detail to pre-Valhall XML and that's it.

Functional change: "four components per vertex" is now set on vertex job DCDs.
This should be a no-op.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15123>
2022-02-23 12:56:30 +00:00
Alyssa Rosenzweig
bd3d7e33b6 panfrost: Use pan_shader_prepare_rsd in blitter
This reduces code duplication and will ease Valhall porting. Functional changes
on v7:

* Shader contains barrier is now set (perf loss, fixed later in series)
* Shader register allocation is now set (perf win)
* Point sprite inverted, no-op for blit shaders

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15123>
2022-02-23 12:56:30 +00:00
Alyssa Rosenzweig
6fc81f163e pan/mdg: Fix partial execution mode names
cont -> skip, last -> kill, and fix the special case handling. It's just an
enum. Makes the disassembly easier to read and closer to Bifrost.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15123>
2022-02-23 12:56:30 +00:00
Danylo Piliaiev
7e703e4428 turnip: Always use GMEM for feedback loops in autotuner
For ordinary feedback loops GMEM is a lot faster than sysmem since
we don't set SINGLE_PRIM mode.

For feedback loops with ordered rasterization GMEM should also be
faster.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15106>
2022-02-23 11:31:59 +00:00
Danylo Piliaiev
ebc23ac963 turnip: Implement VK_ARM_rasterization_order_attachment_access
Trivially implemented by using A6XX_GRAS_SC_CNTL_SINGLE_PRIM_MODE.

This extension is useful for emulators e.g. AetherSX2 PS2 emulator and
could drastically improve performance when blending is emulated.

Relevant tests:
dEQP-VK.rasterization.rasterization_order_attachment_access.*

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15106>
2022-02-23 11:31:59 +00:00
Danylo Piliaiev
d6c89e1e4a turnip: Merge LRZ and DEPTH_PLANE draw states
They were emitted at the same time. Frees 1 draw state for us to use.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15106>
2022-02-23 11:31:59 +00:00
Danylo Piliaiev
dab34bd5c8 turnip: Use LATE_Z when there might be depth/stencil feedback loop
Otherwise a shader invocation would read the value which should have
been set AFTER this shader invocation.

Fixes tests:
 dEQP-VK.rasterization.rasterization_order_attachment_access.depth.samples_1.multi_draw_barriers
 dEQP-VK.rasterization.rasterization_order_attachment_access.stencil.samples_1.multi_draw_barriers

Fixes: 71595a189a
("tu: Fix feedback loops in sysmem mode")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15106>
2022-02-23 11:31:59 +00:00
Paulo Zanoni
d10fd5b7c9 iris: fix register spilling on compute shaders on XeHP
XeHP scratch space is handled differently. Commit ae18e1e707
implemented support for it, but handled it differently between render
and compute shaders: it calculates scratch_addr differently and
doesn't pin the buffer on compute. Make it work on compute shaders by
calling pin_scratch_space() from iris_compute_walker(), which fixes
both the address and the pinning.

This commit can be verified by the two-year-old-but-still-unreviewed
Piglit MR 234. You can also verify this by running a very simple
compute shader with INTEL_DEBUG=spill_fs.

References: https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/234
Fixes: ae18e1e707 ("iris: Add support for scratch on XeHP")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15070>
2022-02-22 22:16:57 +00:00
Kenneth Graunke
c46d3acf0e anv: Raise vertex input bindings and attributes limits slightly
This raises our vertex input bindings limit from 28 to 31, and our
vertex input attribute limit from 28 to 29.  We could theoretically
go higher, but it will take additional work.

The 3DSTATE_VERTEX_BUFFERS and 3DSTATE_VERTEX_ELEMENTS limits are 33
vertex buffers, and 34 vertex elements.  But we need up to two vertex
elements for system values (FirstVertex, BaseVertex, BaseInstance,
DrawID), and we currently use two vertex bindings for those.

There is another hidden limit: our compiler backend only supports the
push model for VS inputs currently.  3DSTATE_VS only allows URB Read
Lengths between [0, 15], which is measured in pairs of inputs, which
means we can theoretically push no more than 32 vertex elements.  This
is no artifical limit either, as a vec4 element takes up 4 registers
in the payload, and 32 * 4 = 128, the entire size of our register file.
Plus, the VS Thread payload needs at least g0 and g1 for other things,
so we can really only push 31.

We can theoretically support one additional binding, by combining our
two SGV bindings into a single upload.  In order to support additional
vertex elements, we would need to add support to the backend compiler
for the pull model for VS inputs.

References: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5917
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14991>
2022-02-22 21:31:06 +00:00
Mike Blumenkrantz
dabba7d726 zink: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15067>
2022-02-22 21:16:55 +00:00
Mike Blumenkrantz
3029000389 zink: remove zink_descriptor_util_init_null_set()
no longer used

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15067>
2022-02-22 21:16:55 +00:00
Mike Blumenkrantz
7266182be0 zink: allow null descriptor set layouts
I got confused while writing this somehow because of the null descriptor
feature, which enables drivers to consume a null descriptor, which has no
relation to a descriptor layout containing no descriptors

failing to accurately use zero descriptors can put layouts over the maximum
per-stage limits, which causes tests to crash

fixes (lavapipe):
KHR-GL46.shading_language_420pack.binding_uniform_block_array
KHR-GL46.multi_bind.dispatch_bind_buffers_base

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15067>
2022-02-22 21:16:55 +00:00
Timur Kristóf
3759a16d8a ac/nir/ngg: Fix mixed up primitive ID after culling.
When NGG culling is enabled, make sure that the correct
primitive ID is exported by each lane.

Fixes: e97f0463a8 "ac/nir: Implement NGG deferred attribute culling in NIR."
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6050
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15055>
2022-02-22 18:15:24 +00:00
Mike Blumenkrantz
c063d8ff64 zink: prune ci lists
I don't know why I thought running GL3.2 and GL4.6 was a good idea,
but it wasn't

Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15065>
2022-02-22 18:02:00 +00:00
Emma Anholt
59bc17d57a turnip: Request no implicit sync when we have no implicit-sync WSI BOs.
I chose to implement this as a global flag in the device, because
otherwise we would end up with extra draw overhead trying to avoid it in
the implicit-sync WSI case, and you're probably going to end up needing
implicit sync anyway because you used one of the BOs in any of the
submitted cmdbufs.  To do better than this, we would probably want a
skip-implicit-sync flag on the BOs in the BO list, rather than global on
the submit.

Reports about venus on turnip say that this flag reduces worst-case
QueueSubmit time in a game workload from ~10ms to ~4ms.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14838>
2022-02-22 17:36:05 +00:00
Samuel Pitoiset
83ee08f6d1 radv: fix build on BSD
Just disable inotify for BDS systems.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6060
Fixes: c50557d961 ("radv: allow applications to dynamically change RADV_FORCE_VRS")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15105>
2022-02-22 17:16:21 +00:00
Alyssa Rosenzweig
2e86767370 pan/bi: Add BIFROST_MESA_DEBUG=nosb option
To disable the new scoreboarding optimizations when debugging.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14298>
2022-02-22 16:57:30 +00:00
Alyssa Rosenzweig
c81c022e66 pan/bi: Implement basic scoreboarding pass
Extend our existing bi_scoreboard infrastructure with a simple data flow
analysis pass that calculates which dependency slots need waiting. We
still lack a heuristic for selecting dependency slots.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14298>
2022-02-22 16:57:30 +00:00
Alyssa Rosenzweig
8f25d88d90 pan/bi: Print scoreboarding state
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14298>
2022-02-22 16:57:30 +00:00
Alyssa Rosenzweig
6ad9a7f650 pan/bi: Add scoreboard state to IR
To a limited degree, scoreboarding must be global, so add the data
structures for tracking this to the IR.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14298>
2022-02-22 16:57:30 +00:00
Alyssa Rosenzweig
91c02893d8 pan/bi: Clean up nits in liveness analysis
Fix minor silly things.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14298>
2022-02-22 16:57:30 +00:00
Alyssa Rosenzweig
734a8bdc5d pan/bi: Use bi_exit_block
The "generic" one is a vestige of Midgard.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14298>
2022-02-22 16:57:30 +00:00
Alyssa Rosenzweig
75406a561f pan/bi: Add bi_{start, exit}_block helpers
Useful for data flow analysis.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14298>
2022-02-22 16:57:30 +00:00
Alyssa Rosenzweig
e5423bb129 pan/bi: Do not cull post-RA staging writes
Bifrost post-RA dead code elimination can cull the destinations of
regular ALU instructions, by weakening from a register write to a
temporary write. However, there is no way to suppress staging writes, so
culling the destinations will result in invalid code generation.

Fixes a regression in
dEQP-GLES3.functional.shaders.switch.switch_in_for_loop_static_vertex
with scoreboarding. The root cause there is the backend dead code
elimination not being sufficiently aggressive in the presence of control
flow. Usually this does not matter, since the backend optimizations are
intended to be local with global optimizations happening in NIR.
Unfortunately, our implementation of IDVS hits this hard. That will need
to be optimized (probably by specializing IDVS shaders in NIR instead of
the backend). In the mean time, let's fix the actual bug affecting
scoreboarding.

No shader-db changes.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14298>
2022-02-22 16:57:30 +00:00
Alyssa Rosenzweig
87d46f40c8 pan/bi: Cull DTSEL_IMM dests in post-RA DCE
They are useless (given the semantics of DTSEL_IMM) and complicate
scoreboarding. Just remove them in the pass that removes all the other silly
register destinations.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14298>
2022-02-22 16:57:30 +00:00
Alyssa Rosenzweig
956b969616 pan/bi: Clarify requirement for barriers
Barriers need to wait on all outstanding messages. This is more of an API
requirement than a hardware requirement, but it's still an invariant the
scoreboarding pass must respect.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14298>
2022-02-22 16:57:30 +00:00
Erik Faye-Lund
9a14ddc22d docs: add license to the redirects script
I always intended this to be covered by the MIT license like with the
rest of my contributions, but somehow forgot to add it.

Let's add that license to make things clear.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14751>
2022-02-22 16:15:47 +00:00
Adam Jackson
2eb644e470 mesa: Enable GL_NV_pack_subimage
This just legalizes a few of the pixelstore pack parameters in GLES2
that are already legal in desktop and GLES3. glamor takes advantage of
this in the GetImage and software-fallback paths.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14977>
2022-02-22 10:45:28 -05:00
Alyssa Rosenzweig
606ac8d61e pan/bi: Enable nir_opt_shrink_vectors
total instructions in shared programs: 1939513 -> 1935815 (-0.19%)
instructions in affected programs: 809066 -> 805368 (-0.46%)
helped: 3195
HURT: 865
helped stats (abs) min: 1.0 max: 15.0 x̄: 1.99 x̃: 1
helped stats (rel) min: 0.10% max: 25.00% x̄: 2.26% x̃: 1.28%
HURT stats (abs)   min: 1.0 max: 22.0 x̄: 3.09 x̃: 2
HURT stats (rel)   min: 0.10% max: 83.33% x̄: 2.67% x̃: 1.39%
95% mean confidence interval for instructions value: -1.00 -0.82
95% mean confidence interval for instructions %-change: -1.34% -1.08%
Instructions are helped.

total tuples in shared programs: 1523194 -> 1521789 (-0.09%)
tuples in affected programs: 745526 -> 744121 (-0.19%)
helped: 2947
HURT: 1844
helped stats (abs) min: 1.0 max: 18.0 x̄: 2.06 x̃: 1
helped stats (rel) min: 0.15% max: 25.00% x̄: 2.65% x̃: 1.59%
HURT stats (abs)   min: 1.0 max: 29.0 x̄: 2.54 x̃: 1
HURT stats (rel)   min: 0.09% max: 40.00% x̄: 2.32% x̃: 1.52%
95% mean confidence interval for tuples value: -0.39 -0.20
95% mean confidence interval for tuples %-change: -0.85% -0.62%
Tuples are helped.

total clauses in shared programs: 329158 -> 325350 (-1.16%)
clauses in affected programs: 111654 -> 107846 (-3.41%)
helped: 2787
HURT: 498
helped stats (abs) min: 1.0 max: 17.0 x̄: 1.57 x̃: 1
helped stats (rel) min: 0.76% max: 40.00% x̄: 6.92% x̃: 5.26%
HURT stats (abs)   min: 1.0 max: 3.0 x̄: 1.14 x̃: 1
HURT stats (rel)   min: 0.87% max: 50.00% x̄: 4.73% x̃: 3.77%
95% mean confidence interval for clauses value: -1.21 -1.10
95% mean confidence interval for clauses %-change: -5.39% -4.93%
Clauses are helped.

total cycles in shared programs: 172084.50 -> 166827.62 (-3.05%)
cycles in affected programs: 74698.83 -> 69441.96 (-7.04%)
helped: 3706
HURT: 568
helped stats (abs) min: 0.041665999999999315 max: 19.0 x̄: 1.44 x̃: 1
helped stats (rel) min: 0.24% max: 75.00% x̄: 9.48% x̃: 6.90%
HURT stats (abs)   min: 0.041665999999999315 max: 1.0 x̄: 0.15 x̃: 0
HURT stats (rel)   min: 0.25% max: 50.00% x̄: 2.21% x̃: 1.42%
95% mean confidence interval for cycles value: -1.28 -1.18
95% mean confidence interval for cycles %-change: -8.18% -7.67%
Cycles are helped.

total arith in shared programs: 57145.04 -> 57211.37 (0.12%)
arith in affected programs: 27595.12 -> 27661.46 (0.24%)
helped: 1933
HURT: 2259
helped stats (abs) min: 0.041665999999999315 max: 0.75 x̄: 0.09 x̃: 0
helped stats (rel) min: 0.16% max: 33.33% x̄: 2.74% x̃: 1.52%
HURT stats (abs)   min: 0.04166399999999726 max: 1.3333329999999997 x̄: 0.11 x̃: 0
HURT stats (rel)   min: 0.10% max: 100.00% x̄: 2.79% x̃: 1.62%
95% mean confidence interval for arith value: 0.01 0.02
95% mean confidence interval for arith %-change: 0.07% 0.40%
Arith are HURT.

total texture in shared programs: 12857 -> 12857 (0.00%)
texture in affected programs: 0 -> 0
helped: 0
HURT: 0

total vary in shared programs: 11157.75 -> 10222 (-8.39%)
vary in affected programs: 5643 -> 4707.25 (-16.58%)
helped: 3196
HURT: 0
helped stats (abs) min: 0.125 max: 1.875 x̄: 0.29 x̃: 0
helped stats (rel) min: 2.78% max: 75.00% x̄: 18.49% x̃: 15.00%
95% mean confidence interval for vary value: -0.30 -0.29
95% mean confidence interval for vary %-change: -18.88% -18.11%
Vary are helped.

total ldst in shared programs: 146420 -> 140270 (-4.20%)
ldst in affected programs: 66027 -> 59877 (-9.31%)
helped: 2942
HURT: 10
helped stats (abs) min: 1.0 max: 19.0 x̄: 2.09 x̃: 2
helped stats (rel) min: 0.90% max: 100.00% x̄: 16.81% x̃: 8.33%
HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 2.22% max: 50.00% x̄: 13.03% x̃: 3.33%
95% mean confidence interval for ldst value: -2.15 -2.02
95% mean confidence interval for ldst %-change: -17.53% -15.89%
Ldst are helped.

total quadwords in shared programs: 1398329 -> 1392117 (-0.44%)
quadwords in affected programs: 704641 -> 698429 (-0.88%)
helped: 3677
HURT: 1299
helped stats (abs) min: 1.0 max: 26.0 x̄: 2.51 x̃: 1
helped stats (rel) min: 0.10% max: 26.92% x̄: 2.64% x̃: 1.89%
HURT stats (abs)   min: 1.0 max: 20.0 x̄: 2.31 x̃: 1
HURT stats (rel)   min: 0.11% max: 44.44% x̄: 2.34% x̃: 1.55%
95% mean confidence interval for quadwords value: -1.34 -1.16
95% mean confidence interval for quadwords %-change: -1.44% -1.25%
Quadwords are helped.

total threads in shared programs: 35234 -> 35311 (0.22%)
threads in affected programs: 119 -> 196 (64.71%)
helped: 91
HURT: 14
helped stats (abs) min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
helped stats (rel) min: 100.00% max: 100.00% x̄: 100.00% x̃: 100.00%
HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 50.00% max: 50.00% x̄: 50.00% x̃: 50.00%
95% mean confidence interval for threads value: 0.60 0.87
95% mean confidence interval for threads %-change: 70.08% 89.92%
Threads are helped.

total loops in shared programs: 125 -> 125 (0.00%)
loops in affected programs: 0 -> 0
helped: 0
HURT: 0

total spills in shared programs: 149 -> 144 (-3.36%)
spills in affected programs: 22 -> 17 (-22.73%)
helped: 1
HURT: 0

total fills in shared programs: 966 -> 956 (-1.04%)
fills in affected programs: 44 -> 34 (-22.73%)
helped: 1
HURT: 0

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15090>
2022-02-22 15:21:09 +00:00
Alyssa Rosenzweig
e0e63c2a8e pan/bi: Specialize IDVS in NIR
It's a bit more code, but it's needed to chew through control flow since we
don't have a backend version of dead_cf. Results are really good, meaning I
really screwed this up the first time around (hence the cc mesa-stable).

total instructions in shared programs: 1963576 -> 1939513 (-1.23%)
instructions in affected programs: 671053 -> 646990 (-3.59%)
helped: 4436
HURT: 729
helped stats (abs) min: 1.0 max: 43.0 x̄: 5.75 x̃: 6
helped stats (rel) min: 0.21% max: 100.00% x̄: 6.47% x̃: 5.17%
HURT stats (abs)   min: 1.0 max: 22.0 x̄: 2.01 x̃: 1
HURT stats (rel)   min: 0.50% max: 50.00% x̄: 10.45% x̃: 9.09%
95% mean confidence interval for instructions value: -4.77 -4.55
95% mean confidence interval for instructions %-change: -4.36% -3.80%
Instructions are helped.

total tuples in shared programs: 1533335 -> 1523194 (-0.66%)
tuples in affected programs: 483167 -> 473026 (-2.10%)
helped: 3414
HURT: 1288
helped stats (abs) min: 1.0 max: 20.0 x̄: 3.73 x̃: 2
helped stats (rel) min: 0.27% max: 100.00% x̄: 4.87% x̃: 3.03%
HURT stats (abs)   min: 1.0 max: 19.0 x̄: 2.02 x̃: 1
HURT stats (rel)   min: 0.24% max: 38.10% x̄: 8.10% x̃: 5.88%
95% mean confidence interval for tuples value: -2.28 -2.03
95% mean confidence interval for tuples %-change: -1.62% -1.02%
Tuples are helped.

total clauses in shared programs: 351432 -> 329158 (-6.34%)
clauses in affected programs: 142237 -> 119963 (-15.66%)
helped: 5328
HURT: 3
helped stats (abs) min: 1.0 max: 43.0 x̄: 4.18 x̃: 4
helped stats (rel) min: 0.74% max: 100.00% x̄: 19.44% x̃: 17.24%
HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 9.09% max: 12.50% x̄: 10.90% x̃: 11.11%
95% mean confidence interval for clauses value: -4.25 -4.11
95% mean confidence interval for clauses %-change: -19.72% -19.12%
Clauses are helped.

total cycles in shared programs: 202830.92 -> 172084.50 (-15.16%)
cycles in affected programs: 117078.42 -> 86332 (-26.26%)
helped: 5450
HURT: 1
helped stats (abs) min: 0.083333 max: 49.0 x̄: 5.64 x̃: 5
helped stats (rel) min: 1.42% max: 100.00% x̄: 27.94% x̃: 25.64%
HURT stats (abs)   min: 0.25 max: 0.25 x̄: 0.25 x̃: 0
HURT stats (rel)   min: 2.46% max: 2.46% x̄: 2.46% x̃: 2.46%
95% mean confidence interval for cycles value: -5.74 -5.54
95% mean confidence interval for cycles %-change: -28.30% -27.58%
Cycles are helped.

total arith in shared programs: 57274.29 -> 57145.04 (-0.23%)
arith in affected programs: 16418.33 -> 16289.08 (-0.79%)
helped: 2442
HURT: 1784
helped stats (abs) min: 0.041665999999999315 max: 0.75 x̄: 0.14 x̃: 0
helped stats (rel) min: 0.23% max: 100.00% x̄: 5.51% x̃: 2.87%
HURT stats (abs)   min: 0.041665999999999315 max: 0.9166670000000003 x̄: 0.12 x̃: 0
HURT stats (rel)   min: 0.00% max: 100.00% x̄: 25.13% x̃: 9.09%
95% mean confidence interval for arith value: -0.04 -0.03
95% mean confidence interval for arith %-change: 6.61% 8.24%
Inconclusive result (value mean confidence interval and %-change mean confidence interval disagree).

total texture in shared programs: 12857 -> 12857 (0.00%)
texture in affected programs: 0 -> 0
helped: 0
HURT: 0

total vary in shared programs: 11157.75 -> 11157.75 (0.00%)
vary in affected programs: 0 -> 0
helped: 0
HURT: 0

total ldst in shared programs: 177208 -> 146420 (-17.37%)
ldst in affected programs: 117098 -> 86310 (-26.29%)
helped: 5447
HURT: 0
helped stats (abs) min: 1.0 max: 49.0 x̄: 5.65 x̃: 5
helped stats (rel) min: 1.92% max: 100.00% x̄: 27.91% x̃: 25.64%
95% mean confidence interval for ldst value: -5.75 -5.55
95% mean confidence interval for ldst %-change: -28.27% -27.56%
Ldst are helped.

total quadwords in shared programs: 1436507 -> 1398329 (-2.66%)
quadwords in affected programs: 515101 -> 476923 (-7.41%)
helped: 5150
HURT: 111
helped stats (abs) min: 1.0 max: 39.0 x̄: 7.46 x̃: 6
helped stats (rel) min: 0.17% max: 100.00% x̄: 10.02% x̃: 8.24%
HURT stats (abs)   min: 1.0 max: 9.0 x̄: 2.01 x̃: 1
HURT stats (rel)   min: 0.43% max: 21.62% x̄: 3.57% x̃: 1.94%
95% mean confidence interval for quadwords value: -7.41 -7.11
95% mean confidence interval for quadwords %-change: -9.98% -9.49%
Quadwords are helped.

total threads in shared programs: 35025 -> 35228 (0.58%)
threads in affected programs: 218 -> 421 (93.12%)
helped: 208
HURT: 5
helped stats (abs) min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
helped stats (rel) min: 100.00% max: 100.00% x̄: 100.00% x̃: 100.00%
HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 50.00% max: 50.00% x̄: 50.00% x̃: 50.00%
95% mean confidence interval for threads value: 0.91 0.99
95% mean confidence interval for threads %-change: 93.40% 99.55%
Threads are helped.

total loops in shared programs: 128 -> 125 (-2.34%)
loops in affected programs: 3 -> 0
helped: 3
HURT: 0
helped stats (abs) min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
helped stats (rel) min: 100.00% max: 100.00% x̄: 100.00% x̃: 100.00%

total spills in shared programs: 158 -> 149 (-5.70%)
spills in affected programs: 15 -> 6 (-60.00%)
helped: 9
HURT: 0

total fills in shared programs: 1133 -> 966 (-14.74%)
fills in affected programs: 197 -> 30 (-84.77%)
helped: 9
HURT: 0

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15090>
2022-02-22 15:21:09 +00:00
Alyssa Rosenzweig
3c1021cd1e panvk: Use more reliable assert for UBO pushing
The important thing isn't the number of words pushed, it's that there are no
UBOs required for us to upload. Check that instead.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15090>
2022-02-22 15:21:09 +00:00
Georg Lehmann
d223b7f096 radv, aco: Add u_foreach_bit to .clang-format.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15083>
2022-02-22 14:57:29 +00:00
Xaver Hugl
a6be12fdad gbm: improve documentation about the lifetime of resources
Signed-off-by: Xaver Hugl <xaver.hugl@gmail.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10906>
2022-02-22 14:42:52 +01:00
Marek Olšák
62074cb4ac ac: update shadowed registers
based on PAL

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
e74929bfef radeonsi: move Arcturus code outside the gfx9 branch
preparation for a future commit

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
c740fd18ba ac/llvm: replace structured by vindex != NULL in ac_build_buffer_store_common
"raw" (IDXEN=0) and "structured" (IDXEN=1) do bounds checking differently.
From `si_make_buffer_descriptor`:
    * - For VMEM and inst.IDXEN == 0 or STRIDE == 0, it's in byte units.
    * - For VMEM and inst.IDXEN == 1 and STRIDE != 0, it's in units of STRIDE.

so there is a difference between setting vindex = i32_0 and vindex = NULL.
Instead of having the `structured` flag, we can just check if vindex is NULL.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
1038382baf ac/llvm: replace structured by vindex != NULL in ac_build_tbuffer_store
"raw" (IDXEN=0) and "structured" (IDXEN=1) do bounds checking differently.
From `si_make_buffer_descriptor`:
    * - For VMEM and inst.IDXEN == 0 or STRIDE == 0, it's in byte units.
    * - For VMEM and inst.IDXEN == 1 and STRIDE != 0, it's in units of STRIDE.

so there is a difference between setting vindex = i32_0 and vindex = NULL.
Instead of having the `structured` flag, we can just check if vindex is NULL.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
c8e2c6faf6 radeonsi: use SET_SH_REG_INDEX with index=3 for registers containing CU_EN
This matches PAL and RADV behavior. It's for preemption.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
79a7ab642a ac/surface: add more elements to meta equations because HTILE can use them
according to gfx10SwizzlePattern.h

Fixes: 9fabbf2150 - ac/surface: copy the HTILE equations to the surface

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
9a28f79f7b ac/surface/tests: fix missing NUM_PKRS extraction in test_modifier
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
12e00be09b radeonsi: apply the LLVM discard bug workaround to LLVM 13 only
It was fixed in LLVM 14.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
21f169b2fb ac,radeonsi: rework and optimize how TMPRING_SIZE is set
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Yogesh Mohan Marimuthu
3c7df183a3 radeonsi: prepare clamp, alpha test before mrtz prepare
Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Yogesh Mohan Marimuthu
c268dafae5 radeonsi: move clamp, alpha test from si_export_mrt_color() to new function
Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
1485f683e3 radeonsi: fix the unaligned clear_buffer fallback with TC
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
4e49a05e37 radeonsi: increase the tesselation factor ring size
based on PAL

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
37c26a72a4 radeonsi: remove bit gaps in SI_RESOURCE_FLAG_*
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
f865631b1b radeonsi: replace SI_RESOURCE_FLAG_UNMAPPABLE with PIPE_RESOURCE_FLAG_UNMAPPABLE
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
790362c10e radeonsi: don't map buffers that VK made unmappable
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
ad9b5ac0a1 radeonsi: more fixes for si_buffer_from_winsys_buffer for GL-VK interop
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
jiadozhu
c9097d8939 radeonsi: fix crash in flush_resource when used with buffers
glWaitSemaphoreEXT triggers si_flush_resource callback
on pipe buffer resources, which may cause segmentation fault.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
f968cb921d radeonsi: reduce the max TBO/SSBO binding size to 512 MB to help 32-bit builds
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
1585b4584d radeonsi: document an unexpected behavior of PS_DONE
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
cc5fd00c5c radeonsi: change ACCUM_ISOLINE to 12
based on PAL

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
9c5b4fa097 radeonsi: program SQ_THREAD_TRACE_CTRL.AUTO_FLUSH_MODE on gfx10.3
discovered internally

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
18a1af4929 radeonsi: always set FLUSH_ON_BINNING_TRANSITION
The hardware does the right thing automatically.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
a87ab82f25 radeonsi: add assertions to check if buffer_map/texture_map calls are valid
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
f23e07525f winsys/amdgpu: fix a warning of defining radeon_screen_create_t twice
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
bf7d25cd1b ac/llvm: remove unused function dpp_row_sl
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
cfaaa0892f ac/surface: don't set the display flag for 1D textures
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
2f2fca24d2 ac/gpu_info: print units for some radeon_info fields
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
53f683ff67 ac: add a gfx9 workaround for high priority compute
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
197467c238 amd: add a workaround for an SQ perf counter bug
Cc: mesa-stable@lists.freedesktop.org
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
95af3cc2f8 amd: remove the _UMD suffix from register definitions
It was mistakenly added to indicate it's for a User-Mode Driver,
but all defined registers in Mesa are.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:04 +00:00
Marek Olšák
707a94f3c5 winsys/radeon: fix a hang due to introducing spi_cu_en
Fixes: 5406ad93 "radeonsi: set COMPUTE_DESTINATION_EN_SEn to spi_cu_en"
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5989

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
2022-02-22 11:41:03 +00:00
Iago Toral Quiroga
c4a78a2d2a broadcom/compiler: fix register class patching for postponed spills
If we have a postponed spill, the temp we create at ip is no longer
the spilled temp and therefore is affected by the thrsw injection.

Fixes corruption in the additive blending animation demo from
Three.js.

Fixes: f3c3228522 ('broadcom/compiler: do not rebuild the interference graph after each spill')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15112>
2022-02-22 11:17:10 +00:00
Tapani Pälli
09b86b4061 iris: setup internal_format for memory object resources
We need to setup internal_format for resource in case main surface was
not configured (iris_resource_configure_main) which is the case with
vertex buffer objects, otherwise transfer helper will make wrong
decisions when copying such a resource.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14925>
2022-02-22 10:56:21 +00:00
Erik Faye-Lund
5c5243adb7 vulkan/wsi: use buffer-image code-path on Windows
This means we no longer map optimal-tiling images in order to display
them on screen, but instead copy via a buffer, which is guaranteed to
linearize.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12210>
2022-02-22 10:04:34 +00:00
Erik Faye-Lund
2e8c119531 vulkan/wsi: add transition to/from transfer-src state
Without these barriers, we'll try to blit from the image when it's in
the incorrect layout, which is illegal.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12210>
2022-02-22 10:04:34 +00:00
Erik Faye-Lund
25a37fabb7 vulkan/wsi: untangle buffer-images from prime
Not all Vulkan implementations allows rendering to linear images, so in
order to support scanning out from these on Windows we might have to copy
through a buffer like we do in the PRIME path.

To avoid reimplementing the same, let's instead generalize the code a
bit so it doesn't have to specfy any PRIME-specific details.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12210>
2022-02-22 10:04:34 +00:00
Boris Brezillon
32c2db1b25 vulkan/wsi: Don't open-code vk_format_get_blocksize()
We already have a standard helper to retrieve the texel block size from
a VkFormat, let's use it instead of adding a new helper.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Suggested-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12210>
2022-02-22 10:04:34 +00:00
Boris Brezillon
7c1c6606d0 vulkan/wsi: Use ALIGN_POT() instead of open-coding it
align_u32() and ALIGN_POT() are doing the same thing.
Replace align_u32() calls by ALIGN_POT() ones and get rid
of align_u32().

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Suggested-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12210>
2022-02-22 10:04:34 +00:00
Erik Faye-Lund
83938a1bb3 vulkan/wsi: pass win32-swapchain directly
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12210>
2022-02-22 10:04:34 +00:00
Marcin Ślusarz
fddab17e54 anv: cleanup begin_subpass & end_subpass
Share values of some expressions instead of duplicating the same logic.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15079>
2022-02-22 09:09:05 +00:00
Marcin Ślusarz
f91bfc80ba intel/compiler: remove redundant code from fs_visitor::run_*
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15079>
2022-02-22 09:09:05 +00:00
Gert Wollny
2fbb4e85f7 virgl: Enable PIPE_CAP_TGSI_TEXCOORD when the host supports it
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15025>
2022-02-22 08:46:54 +00:00
Juan A. Suarez Romero
db8a202b41 vc4: remove redundant initialization
These assignments are not required.

Partially fixes https://gitlab.freedesktop.org/mesa/mesa/-/issues/3966

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15080>
2022-02-22 08:29:51 +00:00
Samuel Pitoiset
369b8cffea radv,aco,llvm: lower adjusting vertex alpha in NIR
Instead of duplicating the same lowering in both compiler backends.
This pass will be used to do more VS input lowering.

fossils-db (Polaris10):
Totals from 48 (0.04% of 135960) affected shaders:
VGPRs: 1692 -> 1684 (-0.47%)
CodeSize: 54016 -> 53964 (-0.10%); split: -0.11%, +0.01%
MaxWaves: 339 -> 341 (+0.59%)
Instrs: 11260 -> 11247 (-0.12%); split: -0.13%, +0.02%
Latency: 88165 -> 88113 (-0.06%); split: -0.07%, +0.01%
InvThroughput: 36153 -> 36093 (-0.17%)
Copies: 583 -> 568 (-2.57%)

fossils-db (Pitcairn):
Totals from 43 (0.03% of 135960) affected shaders:
VGPRs: 1548 -> 1552 (+0.26%)
CodeSize: 47900 -> 47820 (-0.17%)
Instrs: 10751 -> 10731 (-0.19%)
Latency: 83029 -> 82873 (-0.19%)
VClause: 168 -> 164 (-2.38%)
SClause: 393 -> 391 (-0.51%)
Copies: 705 -> 685 (-2.84%)

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/15076>
2022-02-22 08:08:42 +00:00
Qiang Yu
100c80392a util/util_vertex_state_cache: remove error check when deinit
Application may exit without freeing created display list, this
may leave the cache not empty.

This is triggered by Abaqus which just close X11 display without
calling any of GLX cleanup functions like glXDestroyContext. But
GLX hook to X11 display close function to free GLX screen resource.
So display list as a context resource has not been freed, but
cache as a screen resource is freed.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-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/14926>
2022-02-22 07:10:40 +00:00
Qiang Yu
f1650bd39b driconf: add Abaqus configs
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14926>
2022-02-22 07:10:40 +00:00
Qiang Yu
1dac5454ea glx: keep native window glx drawable by driconf option
DRI3 window back buffer is a client resource, so it's destroyed
when context switch drawable for native window.

But some application like Abaqus may leave a dirty back buffer
and reuse it when switch back. So add a driconf option for these
kind of app to keep the entire GLX drawable for native window.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14926>
2022-02-22 07:10:40 +00:00
Qiang Yu
4a420c50f2 glx: merge drawable release to the same function
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14926>
2022-02-22 07:10:40 +00:00
Qiang Yu
bf09c08e31 glx: fix pbuffer refcount init
glXMakeCurrent* may miss release pbuffer if pbuffer is created
with refcount=0. This won't happen when pbuffer had different
GLX id and X pixmap id.

cc: mesa-stable

Fixes: bc8a51a79a ("glx: no need to create extra pixmap for pbuffer")

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14926>
2022-02-22 07:10:40 +00:00
Iago Toral Quiroga
a4b164b57b broadcom/compiler: only patch temps that existed before the current spill
When we spill we add new temps. We should be careful not to access
liveness for these until we have re-computed it after all spills and
fill for that the spilled temp have been processed so as to avoid
out-of-bounds accesses to the c->temp_start and c->temp_end arrays.

This fixes a crash in a Three.js demo when we try to patch register
classes after a TMU spill that was caused because we would incorrectly
try to patch the same temps we had just added for the spill itself,
which is not only unnecessary but also incorrect since we these temps
would not have liveness information available yet and thus would
cause out of bounds accesses.

Fixes: f3c3228522 ('broadcom/compiler: do not rebuild the interference graph after each spill')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15107>
2022-02-22 06:41:51 +00:00
Marek Olšák
7ec8a3205e gallivm: fix build with LLVM 15
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15095>
2022-02-22 01:28:11 +00:00
Marek Olšák
7893192613 ci: bump piglit version
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14750>
2022-02-21 21:42:04 +00:00
Marek Olšák
eb4bd06ef4 gallium: add PIPE_RESOURCE_FLAG_UNMAPPABLE for shared unmappable buffers
We need to handle this in u_threaded_context for GL-VK interop.

Drivers should set this when importing buffers if needed.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14750>
2022-02-21 21:42:04 +00:00
Jiadong Zhu
10e4bad803 st/mesa: set GL_DYNAMIC_STORAGE_BIT for GL-VK interop buffers
GL_DYNAMIC_STORAGE_BIT needs to be set to make glBufferSubData work.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14750>
2022-02-21 21:42:04 +00:00
Erik Faye-Lund
2cd0779f83 nir/spirv: guard macros in case of redefinition
On some systems, these macros are already defined, and being defined
slightly differently causes them to emit redefinition-warnings.

Let's wrap them in ifdefs to avoid the warnings.

Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15084>
2022-02-21 19:47:17 +00:00
Alyssa Rosenzweig
694fe73976 asahi: Fix use-after-free in shader key
We need to take ownership of shader keys before we can insert them into
the hash table. Caught by ASan.

==6343==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x00016bc51410 at pc 0x00010498d6cc bp 0x00016bc50240 sp 0x00016bc4f9d0
READ of size 592 at 0x00016bc51410 thread T0
    #0 0x10498d6c8 in MemcmpInterceptorCommon(void*, int (*)(void const*, void const*, unsigned long), void const*, void const*, unsigned long)+0x208 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x196c8)
    #1 0x10498da08 in wrap_memcmp+0x98 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x19a08)
    #2 0x10b7f3f18 in asahi_shader_key_equal agx_state.c:867
    #3 0x10a482e7c in hash_table_search hash_table.c:325
    #4 0x10b7f4e94 in agx_update_shader agx_state.c:899
    #5 0x10b7f0dc4 in agx_draw_vbo agx_state.c:1590
    #6 0x10a7c28c4 in u_vbuf_draw_vbo u_vbuf.c:1498
    #7 0x10a5db03c in cso_multi_draw cso_context.c:1639
    #8 0x10aed03d0 in _mesa_validated_drawrangeelements draw.c:1812
    #9 0x10aed08d4 in _mesa_DrawElements draw.c:1945

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15109>
2022-02-21 11:53:32 -05:00
Michel Dänzer
ed246aa29b ci: Remove unused is-for-marge YAML anchor
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14225>
2022-02-21 14:41:01 +00:00
Michel Dänzer
40addce70e ci: Use $CI_PIPELINE_SOURCE
Instead of $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME. Shorter and clearer.

Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14225>
2022-02-21 14:41:01 +00:00
Michel Dänzer
c642eed38c ci: Use $CI_COMMIT_BRANCH
This was recently added to indicate pipelines for branches.

v2:
* Modify .gitlab-ci/test-source-dep.yml as well.

Acked-by: Emma Anholt <emma@anholt.net> # v1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14225>
2022-02-21 14:41:01 +00:00
Rhys Perry
a9ac270c5f nir/validate: don't add instrs not present in shader to shader_gc_list
This makes the set smaller and GC list validation faster.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13547>
2022-02-21 11:57:22 +00:00
Rhys Perry
925c5f817d nir/validate: don't validate the GC list by default
This seems really slow.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13547>
2022-02-21 11:57:18 +00:00
Samuel Pitoiset
e6853de6b0 radv: set profile_peak when capturing with SQTT
Using new CTX OP to set/get stable pstates.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14038>
2022-02-21 11:16:11 +00:00
Samuel Pitoiset
5cf4f0cc91 radv/winsys: add support for new CTX OP to set/get stable pstates
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14038>
2022-02-21 11:16:11 +00:00
Samuel Pitoiset
cdf9a1a911 ac: add ac_gpu_info::has_stable_pstate
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14038>
2022-02-21 11:16:11 +00:00
Samuel Pitoiset
595c81166b include/drm-uapi: update amdgpu_drm.h for new CTX OP to set/get stable pstates
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14038>
2022-02-21 11:16:11 +00:00
Samuel Pitoiset
0e060e7a08 meson: bump libdrm_amdgpu version to 2.4.110
For the new AMDGPU CTX OP stable pstates.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14038>
2022-02-21 11:16:11 +00:00
Samuel Pitoiset
4d38890c9e ci: upgrade to libdrm 2.4.110
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14038>
2022-02-21 11:16:11 +00:00
Mihai Preda
665474b278 radeonsi/tests: update glcts baseline on vega20
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15075>
2022-02-21 10:56:59 +00:00
Mihai Preda
49183c113d radeonsi/tests: update piglit baseline on vega20
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15075>
2022-02-21 10:56:59 +00:00
Mihai Preda
21b0153833 radeonsi/tests: print PCI-id of GPU device under test
Allows to identify GPUs in a system with multiple devices of the same model.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15044>
2022-02-21 09:43:40 +00:00
Marcin Ślusarz
037e98a10c anv: don't set color state when input state was requested
Fixes: 814dc66935 ("anv: Allocate surface states per-subpass")

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15081>
2022-02-21 08:45:05 +00:00
Dave Airlie
c108a68954 ci/lavapipe: fixup results after proper reference counting.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
2022-02-21 03:52:02 +00:00
Dave Airlie
ec8104c6b2 llvmpipe: allow vertex processing and fragment processing in parallel
This removes the block at the end of fragment processing and allow
multiple scenes to be queued to the rasterizer up to MAX_SCENES.

Running heaven with this shows up to 39 scenes been allocated in the
first few renders, but it also removes all stalls in rendering until
the present stalls for completion. It reduces frame rendering times
(not enough to make it > 1 fps) but looks to be about 10% increase.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
2022-02-21 03:52:02 +00:00
Dave Airlie
0dccec8e89 llvmpipe: add support for fence_server_sync.
This fixes multi-context flushes with async fs processing.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
2022-02-21 03:52:02 +00:00
Dave Airlie
1318cb4c5a lavapipe: pass partial results flags through.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
2022-02-21 03:52:02 +00:00
Dave Airlie
7ae32fdb9a llvmpipe/query: add support for partial query waits.
Without overlap, the fence should always be signalled so this
won't be hit, but once overlap is enabled, then cases will start
to fail due to missing this.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
2022-02-21 03:52:02 +00:00
Dave Airlie
2b658dea03 gallium: add partial bit to the query flags.
This is to match the vulkan partial bit so lavapipe can work
with new llvmpipe changes.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
2022-02-21 03:52:02 +00:00
Dave Airlie
d807226d37 llvmpipe: check framebuffer resources for all scenes for references.
Some inflight scenes might be using the framebuffers as a dest,
make sure to get flushing correct.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
2022-02-21 03:52:02 +00:00
Dave Airlie
fae5188de7 llvmpipe: add images to the scene resource tracker.
This adds all the images to the scene resource tracker.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
2022-02-21 03:52:02 +00:00
Dave Airlie
eff32fa591 llvmpipe: add ssbo to resources reference by scenes.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
2022-02-21 03:52:02 +00:00
Dave Airlie
ef34719459 llvmpipe: pass ssbo write mask down into setup.
this will be used to keep track of ssbo buffer references.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
2022-02-21 03:52:02 +00:00
Dave Airlie
403f9aea0e llvmpipe: add writeable resource tracking to the scene.
The scene tracks resource, but only currently tracks textures,
in order for scene overlap to work properly, it needs to track
fb, ssbo and image resources as well.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
2022-02-21 03:52:02 +00:00
Dave Airlie
486dada6bc llvmpipe: size initial allocation and free scenes
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
2022-02-21 03:52:02 +00:00
Dave Airlie
4649a941e3 llvmpipe: handle dynamically creating scenes when needed
This will create scenes from the slab allocator up the to max

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
2022-02-21 03:52:02 +00:00
Dave Airlie
8bdc40088b llvmpipe: base the scene queue size of the max number of scenes.
If the max scenes increases then the queue will get resized.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
2022-02-21 03:52:02 +00:00
Dave Airlie
d269634fcd llvmpipe/scene: move to slab allocated objects for scenes.
Currently we only allocate one scene, but I'd like to increase that
so move it to a slab allocator.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
2022-02-21 03:52:02 +00:00
Dave Airlie
d89f91d54c llvmpipe/flush: always finish whether for cpu/gpu access.
Subsequent GPU access to resources for reading in the vertex
shader may rely on previous fragment shaders being flushed out.

Always finish here.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
2022-02-21 03:52:02 +00:00
Dave Airlie
ccdee8aade llvmpipe: convert texture barrier to a finish.
Need to flush the rasterizer and wait for everything to finish,
with new overlap flush isn't enough.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
2022-02-21 03:52:02 +00:00
Dave Airlie
604ed15e56 lavapipe: handle non-timeline semaphores wait/signal.
When llvmpipe is allowed execute fragment shaders overlapping
with other stuff, we have to start using the pipe fences.

With presentation, the acquire path needs to signal a semaphore
that can be waited on by the user, so add support for passing
signal/wait semaphores for non-timeline in, and just put a
fence pointer in the semaphore for that case.

This fixes rendering once we allow overlapping rasterization.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
2022-02-21 03:52:02 +00:00
Dave Airlie
70dfa8b32f lavapipe: don't flush on transfer operations.
The pipeline barrier/wait event code should handle this.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
2022-02-21 03:52:02 +00:00
Dave Airlie
20696aa170 lavapipe: execute a finish in pipeline barrier and event waiting.
Refactor out the code for finishing a fence and used it in
pipeline barrier and event waiting.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
2022-02-21 03:52:02 +00:00
Dave Airlie
1f1e62c15d lavapipe: handle endless fence timeout properly.
If the users ask for an infinte timeout, just pass it through
to gallium.

When llvmpipe ends up allowing async fragment shaders, it's important
to get this right for lots of CTS tests.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
2022-02-21 03:52:02 +00:00
Dave Airlie
7a1426db66 lavapipe: fix pipeline statistic query results with availability.
The availability is meant to be the last integer value written,
but for pipeline stats this was being done wrong. calculate
the availability position properly.

With the old non-overlapping execution model queries never
were unavailable.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
2022-02-21 03:52:02 +00:00
Dave Airlie
aeed07f604 drisw: fence drawing to the swap/copy buffers.
Currently neither llvmpipe or softpipe ever leave any drawing in
the pipeline, but I'd like to change that for llvmpipe.

This makes drisw block for completed rendering before sending
data to the X server.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
2022-02-21 03:52:02 +00:00
Ilia Mirkin
65c4b6a4c6 freedreno/ir3: document GETINFO's x/y results
The zw were already known, but throw them in here too. I'm not extremely
happy with the description of "y", feels like there's a simpler
explanation there, but I couldn't find it.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14672>
2022-02-21 02:09:19 +00:00
Qiang Yu
80974a5f1e radeonsi: fix depth stencil multi sample texture blit
This causes the flushed_depth_texture is allocated without
multi sample. So the blit will cause VM fault.

cc: mesa-stable

Reviewed-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/14990>
2022-02-21 01:47:23 +00:00
Dave Airlie
0f989a840e crocus: fix leak on gen4/5 stencil fallback blit path.
Noticed by Ilia.

Fixes: f3630548f1 ("crocus: initial gallium driver for Intel gfx 4-7")

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15100>
2022-02-21 10:21:56 +10:00
Ilia Mirkin
357dae424f freedreno/a4xx: make luminance formats renderable, add missing L8A8_SNORM
If the luminance formats aren't renderable, they back out to R*
formats, but those will end up with a 1 in alpha rather than 0 when
textured. So instead make them explicitly renderable, which will cause
the correct texture format swizzle to be applied.

Fixes query-rgba-signed-components and probably others.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15097>
2022-02-20 16:58:03 +00:00
Ilia Mirkin
56b1bd086f freedreno/a4xx: use correct macro for color
Doesn't actually matter since all the colors are encoded the same. But
for consistency...

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15097>
2022-02-20 16:58:03 +00:00
Danylo Piliaiev
a814a4f9db turnip: Add a refcount mechanism to BOs
Until now we have lived without a refcount mechanism in the driver
because in Vulkan the user is responsible for handling the life
span of memory allocations for all Vulkan objects, however,
imported BOs are tricky because the kernel doesn't refcount
so user-space needs to make sure that:

1. When importing a BO into the same device used to create it
   (self-importing) it does not double free the same BO.
2. Frees imported BOs that were not allocated through the same
   device.

Our initial implementation always freed BOs when requested,
so we handled 2) correctly but not 1) on drm and we would
double-free self-imported BOs because kernel doesn't return
a unique gem_handle on each import.

Beside this the submit ioctl checks for duplicates in the
BO list and returns an error if there is one.

This fixes the problem for good by adding refcounts to BOs
so that self-imported BOs have a refcnt > 1 and are only freed
when all references are freed.

KGSL on the other hand does not have the same problems,
at least not with ION buffers which are used for exportable
BOs on pre 5.10 android kernels.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5936
Fixes CTS tests: dEQP-VK.drm_format_modifiers.export_import.*

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15031>
2022-02-19 15:16:55 +00:00
Lionel Landwerlin
2763a8af5a anv/genxml/intel/fs: fix binding shader record entry
Bit is flipped compared to all the other packets.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 705395344d ("intel/fs: Add support for compiling bindless shaders with resume shaders")
Fixes: c3ac9afca3 ("anv: Create and return ray-tracing pipeline SBT handles")
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15078>
2022-02-19 13:50:56 +00:00
Chia-I Wu
5f3e50b27c venus: trace vn_ring_wait_space
It is good to know that we run out of ring space and have to wait.  This
happens easily with fossilize-replay because encoding a
vkCreateGraphicsPipeline takes microseconds while executing it can take
milliseconds, >100ms sometimes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14966>
2022-02-19 03:57:30 +00:00
Chia-I Wu
7cb2e9a8f0 venus: cache VkFormatProperties
This is for fossilize-replay which keeps querying for the same formats.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14966>
2022-02-19 03:57:30 +00:00
Alyssa Rosenzweig
e392dd8237 pan/bi: Promote MUX to CSEL in the scheduler
Helps scheduling, and makes scheduling more predictable when deciding between
MUX and CSEL.

total tuples in shared programs: 1523328 -> 1516256 (-0.46%)
tuples in affected programs: 509800 -> 502728 (-1.39%)
helped: 1977
HURT: 181
helped stats (abs) min: 1.0 max: 48.0 x̄: 3.71 x̃: 2
helped stats (rel) min: 0.04% max: 14.29% x̄: 1.98% x̃: 1.28%
HURT stats (abs)   min: 1.0 max: 5.0 x̄: 1.43 x̃: 1
HURT stats (rel)   min: 0.14% max: 7.69% x̄: 1.40% x̃: 0.70%
95% mean confidence interval for tuples value: -3.47 -3.08
95% mean confidence interval for tuples %-change: -1.79% -1.60%
Tuples are helped.

total clauses in shared programs: 350552 -> 349906 (-0.18%)
clauses in affected programs: 34839 -> 34193 (-1.85%)
helped: 570
HURT: 49
helped stats (abs) min: 1.0 max: 16.0 x̄: 1.22 x̃: 1
helped stats (rel) min: 0.67% max: 20.00% x̄: 3.26% x̃: 2.22%
HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 0.92% max: 16.67% x̄: 4.31% x̃: 4.17%
95% mean confidence interval for clauses value: -1.13 -0.96
95% mean confidence interval for clauses %-change: -2.95% -2.38%
Clauses are helped.

total cycles in shared programs: 202589.37 -> 202512.25 (-0.04%)
cycles in affected programs: 7644.46 -> 7567.33 (-1.01%)
helped: 771
HURT: 147
helped stats (abs) min: 0.041665999999999315 max: 1.8333360000000027 x̄: 0.11 x̃: 0
helped stats (rel) min: 0.16% max: 14.29% x̄: 2.10% x̃: 1.35%
HURT stats (abs)   min: 0.041665999999999315 max: 0.3333340000000007 x̄: 0.07 x̃: 0
HURT stats (rel)   min: 0.24% max: 7.41% x̄: 1.49% x̃: 1.11%
95% mean confidence interval for cycles value: -0.09 -0.07
95% mean confidence interval for cycles %-change: -1.69% -1.36%
Cycles are helped.

total arith in shared programs: 56755.96 -> 56585.50 (-0.30%)
arith in affected programs: 18746.29 -> 18575.83 (-0.91%)
helped: 1605
HURT: 352
helped stats (abs) min: 0.04166399999999726 max: 1.8333360000000027 x̄: 0.12 x̃: 0
helped stats (rel) min: 0.07% max: 20.00% x̄: 1.92% x̃: 1.12%
HURT stats (abs)   min: 0.041665999999999315 max: 0.3333340000000007 x̄: 0.06 x̃: 0
HURT stats (rel)   min: 0.17% max: 33.33% x̄: 2.09% x̃: 1.08%
95% mean confidence interval for arith value: -0.09 -0.08
95% mean confidence interval for arith %-change: -1.34% -1.07%
Arith are helped.

total quadwords in shared programs: 1429737 -> 1424670 (-0.35%)
quadwords in affected programs: 418175 -> 413108 (-1.21%)
helped: 1682
HURT: 198
helped stats (abs) min: 1.0 max: 35.0 x̄: 3.17 x̃: 2
helped stats (rel) min: 0.04% max: 13.33% x̄: 1.72% x̃: 1.29%
HURT stats (abs)   min: 1.0 max: 5.0 x̄: 1.38 x̃: 1
HURT stats (rel)   min: 0.15% max: 7.41% x̄: 1.30% x̃: 0.92%
95% mean confidence interval for quadwords value: -2.86 -2.53
95% mean confidence interval for quadwords %-change: -1.48% -1.32%
Quadwords are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14576>
2022-02-19 03:02:10 +00:00
Alyssa Rosenzweig
a8418abd74 pan/bi: Revert "Fix load_const of 1-bit booleans"
This reverts commit 29d319c767.

Now that we use nir_lower_bool_to_bitsize, we don't see 1-bit booleans
anymore, so the issue this fixed doesn't apply. Actually, that issue was
(in part) why I started looking into boolean handling in the first
place.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14576>
2022-02-19 03:02:10 +00:00
Alyssa Rosenzweig
21bdee7bcc pan/bi: Switch to lower_bool_to_bitsize
Instead of ingesting 1-bit booleans and trying to force everything to be
16-bit, except when it isn't, and creating a mess in the backend... just
use the NIR pass designed to select bitsize for booleans. Yes, this
means we need to handle more NIR instructions, but the handling is
easier and the conversion is more obvious (except for some edge cases
like 16-bit vectorized b32csel). This generates noticeably better code,
and the generated code will be easier to optimize.

total instructions in shared programs: 90257 -> 88941 (-1.46%)
instructions in affected programs: 49145 -> 47829 (-2.68%)
helped: 201
HURT: 2
helped stats (abs) min: 1.0 max: 40.0 x̄: 6.57 x̃: 3
helped stats (rel) min: 0.29% max: 13.89% x̄: 2.57% x̃: 1.90%
HURT stats (abs)   min: 2.0 max: 2.0 x̄: 2.00 x̃: 2
HURT stats (rel)   min: 2.15% max: 2.74% x̄: 2.45% x̃: 2.45%
95% mean confidence interval for instructions value: -7.71 -5.26
95% mean confidence interval for instructions %-change: -2.84% -2.20%
Instructions are helped.

total tuples in shared programs: 73740 -> 72922 (-1.11%)
tuples in affected programs: 36564 -> 35746 (-2.24%)
helped: 184
HURT: 7
helped stats (abs) min: 1.0 max: 74.0 x̄: 4.49 x̃: 2
helped stats (rel) min: 0.30% max: 16.67% x̄: 2.86% x̃: 1.89%
HURT stats (abs)   min: 1.0 max: 2.0 x̄: 1.29 x̃: 1
HURT stats (rel)   min: 0.12% max: 12.50% x̄: 4.26% x̃: 3.33%
95% mean confidence interval for tuples value: -5.29 -3.28
95% mean confidence interval for tuples %-change: -3.06% -2.13%
Tuples are helped.

total clauses in shared programs: 15993 -> 15928 (-0.41%)
clauses in affected programs: 2464 -> 2399 (-2.64%)
helped: 35
HURT: 16
helped stats (abs) min: 1.0 max: 27.0 x̄: 2.31 x̃: 1
helped stats (rel) min: 0.49% max: 18.88% x̄: 7.63% x̃: 5.88%
HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 0.79% max: 6.25% x̄: 1.91% x̃: 1.01%
95% mean confidence interval for clauses value: -2.46 -0.09
95% mean confidence interval for clauses %-change: -6.38% -2.90%
Clauses are helped.

total cycles in shared programs: 7622.13 -> 7594.75 (-0.36%)
cycles in affected programs: 1078.67 -> 1051.29 (-2.54%)
helped: 103
HURT: 4
helped stats (abs) min: 0.041665999999999315 max: 3.0833319999999986 x̄: 0.27 x̃: 0
helped stats (rel) min: 0.32% max: 21.05% x̄: 3.62% x̃: 2.44%
HURT stats (abs)   min: 0.0416669999999999 max: 0.0833330000000001 x̄: 0.05 x̃: 0
HURT stats (rel)   min: 0.13% max: 7.14% x̄: 2.94% x̃: 2.25%
95% mean confidence interval for cycles value: -0.33 -0.19
95% mean confidence interval for cycles %-change: -4.14% -2.61%
Cycles are helped.

total arith in shared programs: 2762.46 -> 2728.08 (-1.24%)
arith in affected programs: 1550.12 -> 1515.75 (-2.22%)
helped: 197
HURT: 6
helped stats (abs) min: 0.041665999999999315 max: 3.0833319999999986 x̄: 0.18 x̃: 0
helped stats (rel) min: 0.32% max: 21.05% x̄: 2.93% x̃: 1.61%
HURT stats (abs)   min: 0.0416669999999999 max: 0.0833330000000001 x̄: 0.06 x̃: 0
HURT stats (rel)   min: 0.13% max: 20.00% x̄: 5.78% x̃: 3.37%
95% mean confidence interval for arith value: -0.21 -0.13
95% mean confidence interval for arith %-change: -3.20% -2.15%
Arith are helped.

total quadwords in shared programs: 68155 -> 67555 (-0.88%)
quadwords in affected programs: 27944 -> 27344 (-2.15%)
helped: 151
HURT: 9
helped stats (abs) min: 1.0 max: 52.0 x̄: 4.09 x̃: 3
helped stats (rel) min: 0.23% max: 12.35% x̄: 2.87% x̃: 2.17%
HURT stats (abs)   min: 1.0 max: 5.0 x̄: 1.89 x̃: 1
HURT stats (rel)   min: 0.20% max: 6.76% x̄: 1.91% x̃: 1.13%
95% mean confidence interval for quadwords value: -4.67 -2.83
95% mean confidence interval for quadwords %-change: -2.99% -2.21%
Quadwords are helped.

total threads in shared programs: 2232 -> 2233 (0.04%)
threads in affected programs: 1 -> 2 (100.00%)
helped: 1
HURT: 0

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14576>
2022-02-19 03:02:10 +00:00
Alyssa Rosenzweig
a64534754d pan/bi: Handle vectorized u2f16/i2f16
Will be useful when we enable int16, I guess...

No shader-db changes.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14576>
2022-02-19 03:02:10 +00:00
Alyssa Rosenzweig
6a05852f5b pan/bi: Handle trivial i2i32
lower_bool_to_bitsize can generate i2i32 from a 32-bit source, which is
trivial but needs to be handled explicitly to avoid going down the 8-bit
conversion path.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14576>
2022-02-19 03:02:10 +00:00
Alyssa Rosenzweig
f7d44a46cd pan/bi: Optimize replication
Bifrost's 16-bit support comes in the form of vectorized instructions,
so when we manipulate scalars, we usually replicate to both bottom and
top halves of 32-bit registers. Add an analysis pass that detects
replication. Then, use that replication pass to optimize out useless
swizzle instructions (by changing them to plain moves, which can be
copypropped).

This optimization is a slight shader-db win on its own, and allows us to
transition to lower_bool_to_bitsize without regressing shader-db.

total instructions in shared programs: 90323 -> 90257 (-0.07%)
instructions in affected programs: 2513 -> 2447 (-2.63%)
helped: 20
HURT: 0
helped stats (abs) min: 1.0 max: 16.0 x̄: 3.30 x̃: 2
helped stats (rel) min: 1.25% max: 11.11% x̄: 4.80% x̃: 4.29%
95% mean confidence interval for instructions value: -5.05 -1.55
95% mean confidence interval for instructions %-change: -6.06% -3.54%
Instructions are helped.

total tuples in shared programs: 73769 -> 73740 (-0.04%)
tuples in affected programs: 1611 -> 1582 (-1.80%)
helped: 17
HURT: 0
helped stats (abs) min: 1.0 max: 9.0 x̄: 1.71 x̃: 1
helped stats (rel) min: 0.58% max: 16.67% x̄: 4.80% x̃: 3.33%
95% mean confidence interval for tuples value: -2.70 -0.71
95% mean confidence interval for tuples %-change: -7.06% -2.54%
Tuples are helped.

total clauses in shared programs: 15997 -> 15993 (-0.03%)
clauses in affected programs: 27 -> 23 (-14.81%)
helped: 4
HURT: 0
helped stats (abs) min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
helped stats (rel) min: 7.69% max: 25.00% x̄: 18.17% x̃: 20.00%
95% mean confidence interval for clauses value: -1.00 -1.00
95% mean confidence interval for clauses %-change: -29.91% -6.44%
Clauses are helped.

total cycles in shared programs: 7623.13 -> 7622.13 (-0.01%)
cycles in affected programs: 64.83 -> 63.83 (-1.54%)
helped: 13
HURT: 0
helped stats (abs) min: 0.0416660000000002 max: 0.375 x̄: 0.08 x̃: 0
helped stats (rel) min: 1.02% max: 5.56% x̄: 2.82% x̃: 2.50%
95% mean confidence interval for cycles value: -0.13 -0.02
95% mean confidence interval for cycles %-change: -3.79% -1.85%
Cycles are helped.

total arith in shared programs: 2763.75 -> 2762.46 (-0.05%)
arith in affected programs: 67.17 -> 65.88 (-1.92%)
helped: 18
HURT: 0
helped stats (abs) min: 0.0416660000000002 max: 0.375 x̄: 0.07 x̃: 0
helped stats (rel) min: 1.02% max: 22.22% x̄: 5.68% x̃: 3.16%
95% mean confidence interval for arith value: -0.11 -0.03
95% mean confidence interval for arith %-change: -8.56% -2.80%
Arith are helped.

total quadwords in shared programs: 68173 -> 68155 (-0.03%)
quadwords in affected programs: 1258 -> 1240 (-1.43%)
helped: 14
HURT: 0
helped stats (abs) min: 1.0 max: 3.0 x̄: 1.29 x̃: 1
helped stats (rel) min: 0.42% max: 8.70% x̄: 3.88% x̃: 3.67%
95% mean confidence interval for quadwords value: -1.64 -0.93
95% mean confidence interval for quadwords %-change: -5.27% -2.49%
Quadwords are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14576>
2022-02-19 03:02:10 +00:00
Alyssa Rosenzweig
35ff537814 pan/bi: Constant fold swizzles on constants
This lets us avoid generating SWZ instructions. Those instructions could
be constant folded but that complicates the replication analysis
introduced in the next commit.

Almost no shader-db changes.

quadwords HURT:   shaders/glmark/1-22.shader_test MESA_SHADER_FRAGMENT: 718 -> 722 (0.56%)

total quadwords in shared programs: 68169 -> 68173 (<.01%)
quadwords in affected programs: 718 -> 722 (0.56%)
helped: 0
HURT: 1

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14576>
2022-02-19 03:02:10 +00:00
Alyssa Rosenzweig
62533a6e64 pan/bi: Lower swizzles on MUX.v2i16
We'll generate this in a moment.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14576>
2022-02-19 03:02:10 +00:00
Alyssa Rosenzweig
8bd4976d98 pan/bi: Lower swizzles on CSEL.i32/MUX.i32
This is counter-intuitive, but required for correct operation when
CSEL.i32 takes a 1-bit (stored 16-bit) boolean argument. The impedance
mismatch ultimately is between CSEL.b32 (nir's bcsel, nonexistant in the
hardware) and the lowering CSEL.i32. However, a similar problem exists
even with MUX.i32 which lacks a good way of zero/sign-extending
booleans.

Cherry-picked from my Valhall branch though the issue also affects
Bifrost. Fixes piglit shaders@glsl-vs-if-bool on Bifrost.

Unfortunately, shader-db is quite unhappy :-(

The proper fix is to use lower_bool_to_bitsize, but that can't be
backported to mesa-stable.

total instructions in shared programs: 157539 -> 158953 (0.90%)
instructions in affected programs: 55621 -> 57035 (2.54%)
helped: 2
HURT: 259
helped stats (abs) min: 2.0 max: 2.0 x̄: 2.00 x̃: 2
helped stats (rel) min: 2.11% max: 2.67% x̄: 2.39% x̃: 2.39%
HURT stats (abs)   min: 1.0 max: 40.0 x̄: 5.47 x̃: 2
HURT stats (rel)   min: 0.36% max: 16.13% x̄: 2.55% x̃: 1.59%
95% mean confidence interval for instructions value: 4.44 6.40
95% mean confidence interval for instructions %-change: 2.21% 2.82%
Instructions are HURT.

total tuples in shared programs: 132322 -> 132907 (0.44%)
tuples in affected programs: 31806 -> 32391 (1.84%)
helped: 5
HURT: 152
helped stats (abs) min: 1.0 max: 2.0 x̄: 1.40 x̃: 1
helped stats (rel) min: 0.39% max: 3.03% x̄: 1.70% x̃: 1.61%
HURT stats (abs)   min: 1.0 max: 42.0 x̄: 3.89 x̃: 2
HURT stats (rel)   min: 0.29% max: 18.18% x̄: 2.50% x̃: 1.79%
95% mean confidence interval for tuples value: 2.88 4.58
95% mean confidence interval for tuples %-change: 1.87% 2.85%
Tuples are HURT.

total clauses in shared programs: 28672 -> 28698 (0.09%)
clauses in affected programs: 869 -> 895 (2.99%)
helped: 1
HURT: 24
helped stats (abs) min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
helped stats (rel) min: 5.88% max: 5.88% x̄: 5.88% x̃: 5.88%
HURT stats (abs)   min: 1.0 max: 2.0 x̄: 1.12 x̃: 1
HURT stats (rel)   min: 0.49% max: 33.33% x̄: 8.46% x̃: 3.59%
95% mean confidence interval for clauses value: 0.82 1.26
95% mean confidence interval for clauses %-change: 3.84% 11.93%
Clauses are HURT.

total cycles in shared programs: 15119.04 -> 15137.88 (0.12%)
cycles in affected programs: 922.87 -> 941.71 (2.04%)
helped: 4
HURT: 79
helped stats (abs) min: 0.0416669999999999 max: 0.0833330000000001 x̄: 0.05 x̃: 0
helped stats (rel) min: 0.40% max: 3.17% x̄: 1.57% x̃: 1.35%
HURT stats (abs)   min: 0.041665999999999315 max: 1.75 x̄: 0.24 x̃: 0
HURT stats (rel)   min: 0.30% max: 20.00% x̄: 2.83% x̃: 2.12%
95% mean confidence interval for cycles value: 0.17 0.29
95% mean confidence interval for cycles %-change: 1.86% 3.37%
Cycles are HURT.

total arith in shared programs: 4922.71 -> 4947.71 (0.51%)
arith in affected programs: 1423.79 -> 1448.79 (1.76%)
helped: 5
HURT: 177
helped stats (abs) min: 0.0416669999999999 max: 0.0833330000000001 x̄: 0.06 x̃: 0
helped stats (rel) min: 0.40% max: 3.17% x̄: 1.82% x̃: 1.67%
HURT stats (abs)   min: 0.041665999999999315 max: 1.75 x̄: 0.14 x̃: 0
HURT stats (rel)   min: 0.30% max: 22.22% x̄: 2.50% x̃: 1.52%
95% mean confidence interval for arith value: 0.11 0.17
95% mean confidence interval for arith %-change: 1.86% 2.90%
Arith are HURT.

total quadwords in shared programs: 120605 -> 120956 (0.29%)
quadwords in affected programs: 26535 -> 26886 (1.32%)
helped: 6
HURT: 143
helped stats (abs) min: 1.0 max: 7.0 x̄: 2.83 x̃: 1
helped stats (rel) min: 0.93% max: 6.33% x̄: 2.29% x̃: 1.71%
HURT stats (abs)   min: 1.0 max: 21.0 x̄: 2.57 x̃: 2
HURT stats (rel)   min: 0.34% max: 13.79% x̄: 2.02% x̃: 1.22%
95% mean confidence interval for quadwords value: 1.86 2.86
95% mean confidence interval for quadwords %-change: 1.45% 2.24%
Quadwords are HURT.

total threads in shared programs: 4670 -> 4669 (-0.02%)
threads in affected programs: 2 -> 1 (-50.00%)
helped: 0
HURT: 1

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14576>
2022-02-19 03:02:10 +00:00
Emma Anholt
a2b7d9b9cd ci/freedreno: Add a known spilling hangcheck flake.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15085>
2022-02-19 02:37:13 +00:00
Emma Anholt
b39d5e9705 ci/freedreno: Cut down pre-merge a630 VK coverage.
We've got lots of VK coverage on 618, so take some of the load off (but
leave a little bit of testing just to make sure we don't totally break
630).  This should help with our Marge times since we've added some other
coverage to 630 that's started overloading the runners.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15085>
2022-02-19 02:37:13 +00:00
Emma Anholt
04790ec8bb ci/freedreno: Move a 60s timeout test to skips instead of flakes.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15085>
2022-02-19 02:37:13 +00:00
Connor Abbott
7e8d885919 spirv: Rewrite determinant calculation
The old calculation for mat3 was clever, but it turns out that a
straightforward application of subdeterminants similar to how mat4 is
handled is more efficient: on a scalar architecture with some sort of
combined multiply+add instruction with a negate modifier (both fairly
common), the new determinant is 9 instructions vs. 15 for the old one,
and without the multiply-add it's 14 instructions vs. 18 for the old
one.  When used as a routine for inverse() the savings are compounded,
because we now use the same method as used to compute the adjucate
matrix and so CSE can combine most of the calculations with the adjucate
matrix ones.

Once mat3 and mat4 use the same method for computing determinants, we
can combine them into a single recursive function. I also pulled up the
mat_subdet() function because it was doing basically what we need, so
it's now shared between determinant and inverse. This shrinks the
implementation significantly, as can be seen from the diffstat.

The real reason I want to change this, though, is that it fixes
dEQP-VK.glsl.builtin.precision_fp16_storage16b.inverse.compute.mat3 with
turnip. Qualcomm uses round-to-zero for 16-bit frcp, which combined with
some inaccuracy in the old method of calculating the determinant led us
to fail. Qualcomm's driver uses something like the new method to
calculate the determinant in the inverse. We could argue that Mesa's
method should be allowed, because round-to-zero for floating-point
division is within spec and there are no precision guarantees given for
determinant() or inverse(). However we might as well use the more
efficient method.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14652>
2022-02-19 02:03:25 +00:00
Connor Abbott
c21065c87a util/blob: Clarify rules on blob::data
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15028>
2022-02-19 01:25:46 +00:00
Connor Abbott
6761550357 nir/serialize: Don't access blob->data directly
It won't work if the blob is fixed-size and we overrun the size, which
will be the case with the Vulkan pipeline cache.

This gets a bit tricky for the repeated-header optimization, because we
can't read the header from the blob. Instead we have to store the header
itself.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15028>
2022-02-19 01:25:46 +00:00
Alyssa Rosenzweig
9168dcbbc1 pan/bi: Disambiguate IDVS variants in shader-db
Label IDVS variants as being MESA_SHADER_{POSITION, VARYING} stages;
reserve the MESA_SHADER_VERTEX label for non-IDVS shaders. This reduces
confusion where a single shader compiles to two MESA_SHADER_VERTEX
shaders with different stats.

While we're at it, de-vendor the blend shader stage name; these stats
are internal anyway.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15086>
2022-02-19 00:01:07 +00:00
Alyssa Rosenzweig
01d1bf6228 asahi: Wire in pure integer texture formats
Passes dEQP-GLES3.functional.texture.format.sized.2d.r*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:33 +00:00
Alyssa Rosenzweig
fded99b1c5 asahi: Support LOD clamps
Passes:

   dEQP-GLES3.functional.texture.mipmap.2d.min_lod.*
   dEQP-GLES3.functional.texture.mipmap.2d.max_lod.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:33 +00:00
Alyssa Rosenzweig
cc3e98e201 asahi: Identify minimum/maximum LOD fields
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:33 +00:00
Alyssa Rosenzweig
6554790dfb asahi: Add LOD clamp packing unit tests
With GTest.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
e3a5c1b478 asahi: Add LOD type
Automatically packs and unpacks float <==> clamped 4:6 fixed point, used
for min/max LOD fields on the Sampler descriptor.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
db93090ffc asahi: Allow GenXML to be used in C++
C++ requires explicit casts from integers to enums. Fixes errors like
the following when trying to use Asahi GenXML from a GTest unit test.

src/asahi/lib/agx_pack.h:554:23: error: assigning to 'enum agx_channels' from incompatible type 'uint64_t' (aka 'unsigned long long')
   values->channels = __gen_unpack_uint(cl, 0, 6);

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
055c5a59f8 agx: Round and clamp array indices
Conforming with the GLSL spec. Fixes:

dEQP-GLES3.functional.shaders.texture_functions.texture.sampler2darray_fixed_fragment

(and probably others)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
a822b7b6cc agx: Naturally align uniform pushes
Required to pack correctly, e.g if we push a 16-bit value then a 64-bit
value.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
0c2bbb470a agx: Add agx_size_align_16 helper
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
9aeb5156bc agx: Add typed move helper
Useful for u2u16 in lowering code.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
830d16e9f0 asahi: Add AGX_PUSH_ARRAY_SIZE_MINUS_1
Required to clamp array indices against the array sizes per the GLSL
spec. Metal also does this, implying it's required by the hardware for
correct operation.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
7b4ea2fd38 asahi: Implement texturing with non-zero start level
Unsure if this comes up anywhere.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
11072cfd21 asahi: Handle reloads of specific cube/mipfaces
The texture descriptor we construct for reloading needs to respect the
surface's texture/layer selection. Fix exactly the same bug as
b8c31ac06d ("lima: fix glCopyTexSubImage2D").

Fixes:

    dEQP-GLES2.functional.texture.specification.basic_copytexsubimage2d.2d_rgb
    dEQP-GLES2.functional.texture.specification.basic_copytexsubimage2d.2d_rgba
    dEQP-GLES2.functional.texture.specification.basic_copytexsubimage2d.cube_rgb
    dEQP-GLES2.functional.texture.specification.basic_copytexsubimage2d.cube_rgba

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
062ca49ca7 asahi: Add agx_map_texture_{cpu,gpu} helpers
Streamline access to particular layer/levels. These patterns show up
across the driver and are easy to screw up, so add a helper.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
a8bf729f8a asahi: Support 2D array and 3D textures
As far as I can tell, these *must* be tiled. Other than that, the
implementation is completely routine. Passes

dEQP-GLES3.functional.texture.format.unsized.*2d_array*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
204e2ffe1b asahi: Track mipmap state explicitly
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
e714fae263 asahi: Pass correct tile shift to tiling routines
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
5f10ffd6e2 asahi: Handle page alignment of miptrees
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
2c490cd4e3 asahi: Align linear texture's strides to 64 bytes
Required to pack the stride, and should improve cache performance.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
5d957011ff asahi: Align allocations to effective tile size
May be smaller than 64x64.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
25f48996a6 asahi: Rename bpp to blocksize
Will matter for block compressed formats.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
856f64de24 asahi: Allow tiling of all bpps
Use the usual macro trick via Panfrost. Fixes textures with formats with
non-32-bit bpp, including:

dEQP-GLES2.functional.texture.specification.basic_teximage2d.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
2028873ef6 asahi: Dynamically configure tile size
We need to shrink the tile size when using small images (including
due to mipmapping) or when using large block sizes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
d103d64df6 asahi: Add some notes to XML about mipmapping
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
aea6d7f17f asahi: Handle tiling of 2D arrays and 3D
Nothing special required, just need to respect the Z coordinate.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
06b2d97666 asahi: Add 2D Array and 3D texture dimensions
Add to XML and translate in the driver.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
266382d252 asahi: Respect mip level when rendering
Use hardware mip level field.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
1a3e21a4de asahi: Identify Level field of render target descriptor
Hardware support for rendering into nonzero mip levels.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
65368d2f9a asahi: Don't redefine MIN2/MAX2
The tiling function was written before the Mesa driver...

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
570004175f asahi: Streamline modifier selection
We can only use linear for 2D images, not even 2D arrays. Even for 2D
images, we only want to use linear if:

* We are required to use linear due to window system requirements.
* The texture is streaming.

Otherwise, we want to use tiled textures. (Or better, compressed, but we
don't support that yet.)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
2022-02-18 23:48:32 +00:00
Alyssa Rosenzweig
2d6233d04f nir: Check all sizes in nir_alu_instr_is_comparison
nir_alu_instr_is_comparison needs to consider all comparison opcodes regardless
of size. Otherwise, they will be missed by nir_opt_move/sink.

Without this change, lowering booleans to integers regresses register
pressure (and spills/fills) significantly in certain shaders on Panfrost,
like android/com.miHoYo.GenshinImpact/1420.shader_test.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15073>
2022-02-18 19:22:01 +00:00
Alyssa Rosenzweig
8f4b3c749e pan/bi: Test avoiding FADD.v2f16 hazards in scheduler
There are many of them, and integration testing of the scheduler won't hit every
case. Add targeted unit tests for the various scheduling hazards of this funny
instruction.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15072>
2022-02-18 16:15:04 +00:00
Alyssa Rosenzweig
9d95561c93 pan/bi: Test avoiding *FADD.v2f16 hazard in optimizer
This hazard exists but is obscure enough to be missed on our existing test
coverage (e.g the conformance tests). Add piles of unit tests for it.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15072>
2022-02-18 16:15:04 +00:00
Alyssa Rosenzweig
24d2bdb1e0 pan/bi: Avoid *FADD.v2f16 hazard in scheduler
Obscure encoding restriction. Fixes crash (assertion fail when instruction
packing) in asphalt9/2659.shader_test on Bifrost.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15072>
2022-02-18 16:15:04 +00:00
Alyssa Rosenzweig
8e0eb592d5 pan/bi: Avoid *FADD.v2f16 hazard in optimizer
This is a very obscure encoding restriction in the Bifrost ISA. Unknown if any
real apps or tests hit this, but we still need to get it right sadly.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15072>
2022-02-18 16:15:04 +00:00
Alyssa Rosenzweig
c2178d09d0 pan/va: Identify LEA_TEX_IMM table
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15069>
2022-02-18 15:51:46 +00:00
Alyssa Rosenzweig
839f15259a pan/va: Fix conservative branch handling
Mixed up lanes and conservative branch combine. Fix that.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15069>
2022-02-18 15:51:46 +00:00
Alyssa Rosenzweig
81a9c857c8 pan/va: Make subgroup 4-bits
Future proofing.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15069>
2022-02-18 15:51:46 +00:00
Alyssa Rosenzweig
9e851e75de pan/va: Fix some units
Remove the todos.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15069>
2022-02-18 15:51:46 +00:00
Alyssa Rosenzweig
47733ad1e1 pan/va: Parse units from the XML
We need this information for cycle counting in Valhall.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15069>
2022-02-18 15:51:46 +00:00
Alyssa Rosenzweig
239d59ecdd panvk: Don't use UBOs for meta_clear
It must always be pushed, so constructing a uniform remap table is
useless.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14913>
2022-02-18 15:29:48 +00:00
Alyssa Rosenzweig
030dadb5f4 pan/mdg: Remove todo we'll probably never get to
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14888>
2022-02-18 15:04:48 +00:00
Alyssa Rosenzweig
0e726d918f pan/mdg: Assert that we don't see unknown jumps
I still don't understand why we don't see continues. But in case we do, scream
loudly so it can't be fixed.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14888>
2022-02-18 15:04:48 +00:00
Alyssa Rosenzweig
8b70e7491a pan/mdg: Delete dedicated fdot2 lowering
It's just lower_alu_to_scalar

total instructions in shared programs: 72542 -> 72528 (-0.02%)
instructions in affected programs: 673 -> 659 (-2.08%)
helped: 4
HURT: 1
helped stats (abs) min: 1.0 max: 11.0 x̄: 3.75 x̃: 1
helped stats (rel) min: 0.28% max: 6.79% x̄: 3.07% x̃: 2.60%
HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 3.03% max: 3.03% x̄: 3.03% x̃: 3.03%
95% mean confidence interval for instructions value: -8.65 3.05
95% mean confidence interval for instructions %-change: -6.32% 2.62%
Inconclusive result (value mean confidence interval includes 0).

total bundles in shared programs: 32051 -> 32036 (-0.05%)
bundles in affected programs: 207 -> 192 (-7.25%)
helped: 3
HURT: 0
helped stats (abs) min: 1.0 max: 10.0 x̄: 5.00 x̃: 4
helped stats (rel) min: 3.28% max: 13.89% x̄: 8.29% x̃: 7.69%

total quadwords in shared programs: 56496 -> 56487 (-0.02%)
quadwords in affected programs: 422 -> 413 (-2.13%)
helped: 2
HURT: 0

total registers in shared programs: 5106 -> 5104 (-0.04%)
registers in affected programs: 8 -> 6 (-25.00%)
helped: 1
HURT: 0

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14888>
2022-02-18 15:04:47 +00:00
Alyssa Rosenzweig
28cd2c9cca pan/mdg: Delete stray comment
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14888>
2022-02-18 15:04:47 +00:00
Alyssa Rosenzweig
eb0ef85cb6 pan/mdg: Clarify some ISA unknowns
Nothing usefully new here, just trying to improve signal:noise ratio on the
disassembly.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14888>
2022-02-18 15:04:47 +00:00
Alyssa Rosenzweig
3a53e46fcd pan/mdg: Handle 8/16-bit UBO loads
These will be seen by the compiler when we enable fp16 constant buffers.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14888>
2022-02-18 15:04:47 +00:00
Alyssa Rosenzweig
8d949ecd3a pan/mdg: Model zero/sign extension for 8/16-bit loads
The destinations are packed as if 32-bit even for 8/16-bit loads, so the mask
needs to be constructed accordingly.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14888>
2022-02-18 15:04:47 +00:00
Alyssa Rosenzweig
ff970767a3 pan/mdg: Print optimized and scheduled shader
To help identify problems across the compiler, print more forms of the shader
with MIDGARD_MESA_DEBUG=shaders. Roughly matches the Bifrost compiler.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14888>
2022-02-18 15:04:47 +00:00
Alyssa Rosenzweig
b707dabbac pan/mdg: Pull out skip_internal boolean
Aligns with Bifrost.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14888>
2022-02-18 15:04:47 +00:00
Jose Maria Casanova Crespo
90f966e05f v3dv/v3d: Fix copyright holder to Raspberry Pi Ltd
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15057>
2022-02-18 11:50:07 +01:00
Kenneth Graunke
4ed9fd62c9 anv: Lower bufferImageGranularity to 1 from 64
The Vulkan 1.3 spec says:

   "The implementation-dependent limit bufferImageGranularity specifies
    a page-like granularity at which linear and non-linear resources
    must be placed in adjacent memory locations to avoid aliasing.  Two
    resources which do not satisfy this granularity requirement are said
    to alias. bufferImageGranularity is specified in bytes, and must be
    a power of two.  Implementations which do not impose a granularity
    restriction may report a bufferImageGranularity value of one.

    Note: Despite its name, bufferImageGranularity is really a
    granularity between "linear" and "non-linear" resources."

We set this limit to 64 bytes (a cacheline) at the dawn of time, without
any real rationale attached.  There shouldn't be any restrictions here.
Our tile sizes are typically 4K, and tiled resource addresses are
aligned to the tile size, and the extent is also a multiple of the tile
sized.  So if a linear resource occurs before a tiled one, there will
naturally be some space due to the alignment of the tiled resource's
starting address.  If a linear resource occurs after a tiled one, the
tiled resource's ending address is already 4K aligned, which is already
guaranteeing that they won't share a cacheline.

So I think it should be fine to reduce this to 1.  The other Vulkan
driver for our hardware seems to advertise 1 here as well.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15066>
2022-02-18 09:52:00 +00:00
Juan A. Suarez Romero
bfdb1064c5 vc4/ci: make piglit test mandatory
Make piglit test jobs to run always, as piglit testsuite offers more
coverage for the VC4 driver.

On the other hand, make the EGL testing manually, as we don't have
enough devices to execute all the tests fast enough.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15045>
2022-02-18 09:02:55 +00:00
Iago Toral Quiroga
750eeecf4e broadcom/compiler: document that spill_base is used for spills and scratch
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15041>
2022-02-18 08:38:19 +00:00
Iago Toral Quiroga
8883975209 broadcom/compiler: drop spill_count and add spilling boolean
We added spill_count to handle uniform batch spills, which we no longer do.
What we want now is a way to know if we are spilling registers.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15041>
2022-02-18 08:38:19 +00:00
Iago Toral Quiroga
f3c3228522 broadcom/compiler: do not rebuild the interference graph after each spill
Instead, we only recompute liveness and we add new nodes and
interferences to the graph manually (we also need to patch
register classes in some cases).

To assist in this process, we also add an ip counter to our
instructions that we also recompute after each spill, which we use
to identify registers that cross thrsw boundries introduced with
TMU spills and fills and adjust their register classes accordingly
(removing their capacity to use accumulators).

This significantly reduces the CPU cost of spills. Using
shaders/closed/gputest/piano/7.shader_test as reference:

Compile time up to the first successful compile strategy in main is
~24s and with this change it is ~11s. With this speed up, we can now
try all 2-thread compile strategies (including the fallback scheduler)
in only ~15s.

A full shader-db run results in:
Total CPU time (seconds): 9904.67 -> 9087.98 (-8.25%)

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15041>
2022-02-18 08:38:19 +00:00
Iago Toral Quiroga
59caaa7fb3 broadcom/compiler: reset spill/fill counts after lowering thread count.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15041>
2022-02-18 08:38:19 +00:00
Iago Toral Quiroga
92d819aaa0 broadcom/compiler: fix end of TMU sequence check
We may be pipelining TMU writes and reads, in which case we can
see both TMUWT and LDTMU at the end of a TMU sequence, so we should
not assume that a TMUWT always terminates a sequence.

Also, we had a bug where we were using inst instead of scan_inst
to check if we find another TMUWT after the curent instruction.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15041>
2022-02-18 08:38:19 +00:00
Iago Toral Quiroga
40e091267d broadcom/compiler: define max number of tmu spills for compile strategies
Instead of whether they are allowed to spill or not. This is more flexible.
Also, while we are not currently enabling spilling on any 4-thread strategies,
should we do that in the future, always prefer a 4-thread compile.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15041>
2022-02-18 08:38:19 +00:00
Iago Toral Quiroga
919aedbfec broadcom/compiler: choose compile strategy with lowest spilling
Until now we would only allow spilling as a last resort in the
last 2 strategies, however, it is possible that in some cases
earlier strategies may produce less spills if we allowed spilling
on them.

Likewise, the fallback scheduler can sometimes produce less spills
than 2 threads with optimizations disabled.

With this change, we start allowing all our 2-thread strategies to
spill, and instead of choosing the first strategy that is successful,
we choose the one that doesn't spill or the one with the least amount
of spilling.

It should be noted that this may incur in a significant increase
of compile times. We will address this in a follow-up patch.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15041>
2022-02-18 08:38:19 +00:00
Alyssa Rosenzweig
294a357b33 panfrost,asahi,radv: Don't set internal=true manually
nir_builder_init_simple_shader does this automatically now.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14936>
2022-02-17 23:30:46 +00:00
Alyssa Rosenzweig
7ec1d96e5e nir: Set internal=true in nir_builder_init_simple_shader
Matches the expected use by callers. We do need to fix up a few callers which
use this call for external shaders.

v2: Fix up a radv call site (Rhys).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net> [v1]
Acked-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14936>
2022-02-17 23:30:46 +00:00
Ian Romanick
a01b262990 nir: Add missing dependency on nir_opcodes.py
Commit 38800b38 changed nir_opcodes.py, but that doesn't seem to have
triggered nir_opt_algebraic.py.  The change in 75ef5991 depends on
opt_algebraic lowering 16-bit versions of slt, but if opt_algebraic is
not rebuilt, this may not happen.  This resulted in some people seeing
assertion failures in, for example,
dEQP-VK.spirv_assembly.instruction.compute.float16.arithmetic_3.step,
due to the backend seeing nir_op_slt that it didn't know how to handle.

v2: Add nir_opcodes.py to nir_algebraic_py so that all the per-driver
algebraic passes pick up the dependency too.  Rename it to
nir_algebraic_depends.  Suggested by Emma.

Closes: #6047
Fixes: d1992255bb ("meson: Add build Intel "anv" vulkan driver")
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15050>
2022-02-17 22:57:33 +00:00
Lionel Landwerlin
7a52286215 anv: add a custom AcquireNextImage2KHR func
So that we can plug our intel_measure framework.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14998>
2022-02-17 22:15:23 +00:00
Felix DeGrood
6e939ca865 anv/measure: Fix INTEL_MEASURE for ANV
INTEL_MEASURE broke while implementing the common sync and submit
framework. Re-adding missing INTEL_MEASURE entry point for
command buffer submit.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14998>
2022-02-17 22:15:23 +00:00
Igor Torrente
aa2652958a venus: add VK_EXT_custom_border_color extension
Implements all the necessary code in the device initialization
and feature/property query functions.

Signed-off-by: Igor Torrente <igor.torrente@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15026>
2022-02-17 21:02:37 +00:00
Igor Torrente
5252c6c009 venus: venus-protocol groundwork to VK_EXT_custom_border_color
These are the changes automatically generated from the venus-protocol
repository.

Signed-off-by: Igor Torrente <igor.torrente@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15026>
2022-02-17 21:02:37 +00:00
Lionel Landwerlin
768930a73a nir: fix lower_memcpy
memcpy is divided into chunks that are vec4 sized max. The problem
here happens with a structure of 24 bytes :

  struct {
    float3 a;
    float3 b;
  }

If you memcpy that struct, the lowering will emit 2 load/store, one of
sized 8, next one sized 16. But both end up located at offset 0, so we
effectively drop 2 floats.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: a3177cca99 ("nir: Add a lowering pass to lower memcpy")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15049>
2022-02-17 15:12:45 +00:00
Mike Blumenkrantz
bc63802596 zink: radv ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15060>
2022-02-17 14:56:51 +00:00
Lionel Landwerlin
d4b1d8bfc4 intel/dev: provide some default values for no_hw
v2: Move into return (Tapani)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15027>
2022-02-17 07:49:08 +00:00
Cristian Ciocaltea
9ef8af357d virgl/ci: Setup virtio-vsock based IPC
The mechanism currently used to pass data from the dEQP child process
executed in a crosvm guest environment towards the deqp-runner wrapper
script that starts the crosvm instance is based on creating, writing
and reading regular files.

In addition to the main drawback of using the storage, this approach
is potentially unreliable because the data cannot be transferred in
real-time and there is no control on ending the transmission. It also
requires a forced sleep for syncing the content, while the minimum
amount of time necessary to wait cannot be easily and safely
determined.

Replace this with an IPC based on the virtio transport for virtual
sockets (virtio-vsock).

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14995>
2022-02-17 06:32:30 +00:00
Cristian Ciocaltea
fcce90a095 ci: Enable kernel virtio transport for Virtual Sockets
Enable support for Virtual Sockets over virtio in kernel configuration
to optimize the data transfer between crosvm and host system.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14995>
2022-02-17 06:32:30 +00:00
Cristian Ciocaltea
5b9788c3c9 ci: Add socat utility
Provide the 'socat' utility in 'debian/x86_test-gl' container to be used
later for improving the inter-process communication with crosvm guest
tasks based on the virtio transport for Virtual Sockets (virtio-vsock).

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14995>
2022-02-17 06:32:30 +00:00
Cristian Ciocaltea
4745638f18 ci: Ensure Mesa Shader Cache resides on tmpfs
Having the Mesa Shader Cache stored on a tmpfs mount point reduces the
tests execution duration by 2-3 %, while preventing several hundreds of
megabytes to be written on the storage media.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14995>
2022-02-17 06:32:30 +00:00
Yiwei Zhang
8e138b8bd1 venus: add necessary format list for ahb image creation
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15017>
2022-02-17 01:45:45 +00:00
Yiwei Zhang
7c9f6c9964 venus: pass necessary format list at ahb image format query
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15017>
2022-02-17 01:45:45 +00:00
Yiwei Zhang
c144df0fa8 venus: clean up android wsi and ahb image builder
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15017>
2022-02-17 01:45:45 +00:00
Yiwei Zhang
31904d082d venus: deep copy format list info for deferred image creation
The img->deferred_info will out-live vn_CreateImage, so we need a deep
copy of the VkImageFormatListCreateInfo struct.

This change also avoids tracking VkImageFormatListCreateInfo struct with
a zero viewFormatCount.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15017>
2022-02-17 01:45:44 +00:00
Dave Airlie
b805d3e6ab lavapipe: reference gallium fences correctly.
Make sure to take references in all the correct places to get
right lifetimes for these objects and avoid leaks.

Fixes: 94a4982805 ("lavapipe: implement timeline semaphores")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15046>
2022-02-17 00:01:39 +00:00
Guilherme Gallo
794009c9ee ci: Add unit tests for lava_job_submitter
These tests will explore some scenarios involving LAVA delays to submit
the job to the device, some device delays outputting data to LAVA
logs, and sensitive data protection.

For example, the subtests from test_retriable_follow_job, "timed out
more times than retry attempts" and "very long silence" caught a bug
where a job retried until the limited attempts and the CI job still
succeeded. https://gitlab.freedesktop.org/mesa/mesa/-/jobs/18325174

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14876>
2022-02-16 23:32:39 +00:00
Guilherme Gallo
694005343b ci: Install pytest and freezegun plugin
lava_job_submitter.py unit tests are written in pytest and uses
freezegun in order to simulate timeouts in some tests scenarios. So,
this commit adds the packages `python3-pytest` and `python3-freezegun`
to fulfill this dependencies.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14876>
2022-02-16 23:32:39 +00:00
Guilherme Gallo
addac10443 ci: Make LAVA jobs fail CI job when retry is exhausted
When the lava_job_submitter.py retry loop finishes normally (without
falling through break-loop) it means that the submitter has exceeded the
retry count limit. However, when it happens the script
finishes normally. This patch adds a treatment to this case, warning the
user what happened and forcing the job to fail.

Moreover, this commit will make retry configurations configurable by
CI job, as it can take the default value from the following variables:

- LAVA_DEVICE_HANGING_TIMEOUT_SEC
- LAVA_WAIT_FOR_DEVICE_POLLING_TIME_SEC
- LAVA_LOG_POLLING_TIME_SEC
- LAVA_NUMBER_OF_RETRIES_TIMEOUT_DETECTION

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14876>
2022-02-16 23:32:39 +00:00
Jason Ekstrand
df0e2a1565 anv: Don't assume depth/stencil attachments have depth
If a secondary command buffer is used and the client provides a
framebuffer and that framebuffer has a stencil-only attchment, we would
try to get the aux usage for the depth component of that attachment and
crash.  Check the aspects of the image before looking at aux usage.
This fixes at least the following SkQP tests on my Tigerlake:

 - vk_circular-clips
 - vk_filterfastbounds
 - vk_innershapes_bw
 - vk_lineclosepath
 - vk_multipicturedraw_rrectclip_simple
 - vk_pathinvfill
 - vk_quadclosepath
 - vk_rrect_clip_bw
 - vk_windowrectangles

Fixes: 0d8b9c529c ("anv: Allow PMA optimization to be enabled in secondary command buffers")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Tested-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15048>
2022-02-16 23:02:09 +00:00
Alyssa Rosenzweig
3697907231 panfrost: Fix Malloc Vertex definition
A few missing things and a few wrong things, nothing major.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15047>
2022-02-16 22:05:55 +00:00
Alyssa Rosenzweig
1ca2358d6b panfrost: Flesh out compute jobs
Valhall has a new twist on Mali's task splitting voodoo, plus compute offset
support.

On Bifrost + Vulkan, compute offsets needed lowering on Bifrost (gl_GlobalID).
Valhall saves a few instructions here.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15047>
2022-02-16 22:05:55 +00:00
Alyssa Rosenzweig
6d5ddf69e2 panfrost: Update Shader Environment descriptor
Disambiguate the name, add a missing field, shorten a field, remove a dated
comment.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15047>
2022-02-16 22:05:55 +00:00
Alyssa Rosenzweig
cf95a1c308 panfrost: Add Valhall fields to tiler descriptor
Mostly to support layered rendering.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15047>
2022-02-16 22:05:55 +00:00
Alyssa Rosenzweig
c011ea6c26 panfrost: Shuffle render target AFBC for Valhall
I'm not sure why this is different, although it adds support for new AFBC
modifiers.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15047>
2022-02-16 22:05:55 +00:00
Alyssa Rosenzweig
1ee09eaca8 panfrost: Add Valhall additions to the framebuffer
There are a few minor changes. Nothing fundamanetal.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15047>
2022-02-16 22:05:55 +00:00
Iván Briano
81f97905c3 intel/compiler: make CLUSTER_BROADCAST always deal with integers
This way we don't run afoul of regioning restrictions around floating
point types.

Cc: 22.0 <mesa-stable>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15039>
2022-02-16 21:36:42 +00:00
Iván Briano
11544435ad anv: only advertise 64b atomic floats if 64b floats are supported
Cc: 22.0 <mesa-stable>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15039>
2022-02-16 21:36:42 +00:00
Samuel Pitoiset
377884c9c8 radv: do not enable per-vertex VRS if the FS uses gl_FragCoord
It breaks postprocessing in some games like Ghostrunner, Deathloop,
Street Fighter V.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15042>
2022-02-16 21:09:12 +00:00
Samuel Pitoiset
3cc53c047a radv: allow to force per-vertex VRS in the tessellation stage
It's more useful than I thought.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15042>
2022-02-16 21:09:12 +00:00
Dave Airlie
eebe298a87 llvmpipe: fix linear rast samples check.
The checks didn't work for the samples == 0 case, just fix it
to use the helper.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15040>
2022-02-16 20:48:52 +00:00
Emma Anholt
3f4bfecee6 nir: Add some notes about const/uniform array access rules in GL.
I was doing some RE on freedreno and we had some questions about when the
hardware might need non-uniform or non-constant array access for various
descriptor types, so let's leave some notes for the next person.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13621>
2022-02-16 20:06:21 +00:00
Emma Anholt
ca1ec72726 nv30/40: Switch to using NIR-to-TGSI by default.
shader-db results (note that we expect many more loops unrolled, so instr
count is probably understating the win):

nv30:
total instructions in shared programs: 16535069 -> 14299105 (-13.52%)
instructions in affected programs: 16377286 -> 14141322 (-13.65%)
total gpr in shared programs: 81255 -> 67268 (-17.21%)
gpr in affected programs: 56714 -> 42727 (-24.66%)
LOST:   0
GAINED: 824

nv40:
total instructions in shared programs: 20907673 -> 18428749 (-11.86%)
instructions in affected programs: 20755510 -> 18276586 (-11.94%)
total gpr in shared programs: 104200 -> 82831 (-20.51%)
gpr in affected programs: 80278 -> 58909 (-26.62%)

14130

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14130>
2022-02-16 17:22:40 +00:00
Samuel Pitoiset
80716b6f7e radv: enable radv_disable_aniso_single_level for The Evil Within 1&2
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6033
Fixes: 5ce4017a2b ("radv,aco: do not disable anisotropy filtering for non-mipmap images")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15011>
2022-02-16 17:28:46 +01:00
Thierry Reding
108e6eaa83 tegra: Use private reference count for resources
With the recent addition of the shortcuts aiming to avoid atomic
operations, the reference count on resources can become unbalanced
in the Tegra driver since they are wrapped and then proxied to the
Nouveau driver.

Fix this by keeping a private reference count.

Fixes: 7688b8ae98 ("st/mesa: eliminate all atomic ops when setting vertex buffers")
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Tested-by: Karol Herbst <kherbst@redhat.com>
2022-02-16 16:20:48 +01:00
Thierry Reding
e8ce0a3357 tegra: Use private reference count for sampler views
With the recent addition of the shortcuts aiming to avoid atomic
operations, the reference count on sampler views can become unbalanced
in the Tegra driver since they are wrapped and then proxied to the
Nouveau driver.

Fix this by keeping a private reference count.

Fixes: ef5d427413 ("st/mesa: add a mechanism to bypass atomics when binding sampler views")
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Tested-by: Karol Herbst <kherbst@redhat.com>
2022-02-16 16:20:40 +01:00
Matti Hamalainen
4e252cbc7d aux/trace: fix dumping of pipe_texture_target
I had missed a int -> enum conversion in one recently added function and
it's probably nice to also dump the target value also in
trace_dump_resource_template() so let's do just that.

Signed-off-by: Matti Hamalainen <ccr@tnsp.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14980>
2022-02-16 14:06:16 +00:00
Timur Kristóf
1912503224 radv: Don't disturb dynamic primitive topology with mesh shading.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14653>
2022-02-16 13:42:39 +00:00
Timur Kristóf
da719792ad radv: Disable IB2 on compute queues.
The "IB2" indirect buffer command is not supported on compute queues
according to PAL, and it indeed causes GPU hangs when task shaders are
used together with vkCmdExecuteCommands.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15006>
2022-02-16 13:09:20 +00:00
Pierre-Eric Pelloux-Prayer
3fad6325cd radeonsi: use SI_PROFILE_CLAMP_DIV_BY_ZERO for viewperf
Only one shader from the Creo subtests needs this.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14931>
2022-02-16 11:13:25 +00:00
Pierre-Eric Pelloux-Prayer
9685b5785b radeonsi: add SI_PROFILE_CLAMP_DIV_BY_ZERO
To enable divide by zero clamping per shader, instead of per app.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14931>
2022-02-16 11:13:25 +00:00
Corentin Noël
1367424501 ci: Uprev virglrenderer and crosvm
Ensure that we are using a recent virglrenderer to catch potential regressions
early.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15023>
2022-02-16 10:21:26 +00:00
Connor Abbott
3ef858a6f6 ir3/spill: Fix simplify_phi_nodes with multiple loop nesting
Once we simplified a phi node, we never updated the definition it points
to, which meant that it could become out of date if that definition were
also simplified, and we didn't check that when rewriting sources. That
could happen when there are multiple nested loops with phi nodes at the
header.

Fix it by updating the phi's pointer. Since we always update sources
after visiting the definition it points to, when we go to rewrite a
source, if that source points to a simplified phi, the phi's pointer
can't be pointing to a simplified phi because we already visited the phi
earlier in the pass and updated it, or else it's been simplified in the
meantime and this isn't the last pass. This way we don't need to
keep recursing when rewriting sources.

Fixes: 613eaac7b5 ("ir3: Initial support for spilling non-shared registers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15035>
2022-02-16 09:55:39 +00:00
Tapani Pälli
d3b4202b63 mesa/st: always use DXT5 when transcoding ASTC format
This fixes artifacts seen in games when using ASTC transcoding,
we need to use DXT5 for proper alpha channel support.

Number of components is a block specific property, there is no easy
way to see if we will require >1bit alpha support or not, so simply
use DXT5 to have support in place.

Fixes: 91cbe8d855 ("gallium: Add a transcode_astc driconf option")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15029>
2022-02-16 08:50:28 +00:00
Samuel Pitoiset
103699677b radv: allow to force per-vertex VRS if the config file is present
This is needed to add the primitive shading rate output to the vertex
or geometry shaders, even if the default value is 1x1.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14713>
2022-02-16 08:11:29 +01:00
Samuel Pitoiset
c50557d961 radv: allow applications to dynamically change RADV_FORCE_VRS
This introduces inotify support in RADV to handle changes from the
RADV_FORCE_VRS_CONFIG_FILE. This is similar to MangoHUD. I'm personally
not sure it's the best solution but let's try this way and change it
later if we have issues (or if we have a lightweight solution).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14713>
2022-02-16 08:11:29 +01:00
Samuel Pitoiset
5e2d9202e2 radv: add RADV_FORCE_VRS_CONFIG_FILE to configure per-vertex VRS
Similar to RADV_FORCE_VRS but from a file. If present, this is used
instead of RADV_FORCE_VRS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14713>
2022-02-16 08:11:29 +01:00
Samuel Pitoiset
a862e15ee7 radv: rename RADV_FORCE_VRS_NONE to RADV_FORCE_VRS_1x1 and accept 1x1
It's the default value.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14713>
2022-02-16 08:11:27 +01:00
Samuel Pitoiset
b4f526cc19 radv: only re-emit the per-vertex VRS rates if necessary
This reduces the overhead slightly when the VRS rates don't change.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14713>
2022-02-16 08:11:23 +01:00
Samuel Pitoiset
99d7c13051 radv: rework RADV_FORCE_VRS to make it more dynamic
The VRS rates are now emitted from the command buffer via an user SGPR
which will allow to change the rates dynamically in later changes.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14713>
2022-02-16 08:11:21 +01:00
Samuel Pitoiset
cbd5724a6d aco: implement nir_intrinsic_load_vrs_rates_amd
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14713>
2022-02-16 08:11:19 +01:00
Samuel Pitoiset
772aeff2c4 ac/llvm: implement nir_intrinsic_load_vrs_rates_amd
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14713>
2022-02-16 08:11:17 +01:00
Samuel Pitoiset
85436896c4 radv: declare a new shader argument for loading the VRS rates
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14713>
2022-02-16 08:11:15 +01:00
Samuel Pitoiset
74b932f8d3 nir: add nir_intrinsic_load_vrs_rates_amd
This intrinsic specific to RADV will be used to load VRS rates from
an user SGPR when RADV_FORCE_VRS is enabled by the application.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14713>
2022-02-16 08:11:12 +01:00
Jason Ekstrand
9cbcdfb514 anv: use vk_image_view::format for creating dynamic renderpasses
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15007>
2022-02-16 00:14:50 +00:00
Jason Ekstrand
818c5dedf4 vulkan: Add back vk_image_view::format
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15007>
2022-02-16 00:14:50 +00:00
Jason Ekstrand
05e9e7767d vulkan: Rename vk_image_view::format to view_format
When I originally added vk_image_view, I was overly clever when it came
to the format field.  I decided to make it only contain the bits of the
format contained in the selected aspects.  However, this is confusing
(not generally a good thing) and it's also not always what you want.
The Vulkan 1.3.204 spec says:

    "When using an image view of a depth/stencil image to populate a
    descriptor set (e.g. for sampling in the shader, or for use as an
    input attachment), the aspectMask must only include one bit, which
    selects whether the image view is used for depth reads (i.e. using a
    floating-point sampler or input attachment in the shader) or stencil
    reads (i.e. using an unsigned integer sampler or input attachment in
    the shader). When an image view of a depth/stencil image is used as
    a depth/stencil framebuffer attachment, the aspectMask is ignored
    and both depth and stencil image subresources are used."

So, while the restricted format makes sense for texturing, it doesn't
for when the image is being used as an attachment.  What we probably
actually want is both versions of the format.  We'll call the one given
by the VkImageViewCreateInfo vk_image_view::format and the restricted
one vk_image_view::view_format.

This is just the first commit which switches format to view_format so
the compiler will make sure we get them all.  The next commit will
re-add vk_image_view::format but this time unmodified.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15007>
2022-02-16 00:14:50 +00:00
Yiwei Zhang
9dd15295e3 venus: properly destroy deferred ahb image before real image creation
Fixes: 19b7b09885 ("venus: prepare image creation helpers for AHB")

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15037>
2022-02-15 21:32:02 +00:00
Emma Anholt
3652ff2fa1 draw: Don't look at .nir if !IR_NIR.
I suspect this double-check and comment was due to originally using ir.nir
as the condition, which might be uninitialized if !IR_NIR.  You could only
take the branch if IR_NIR was set, and you should always not take if it
!IR_NIR, so it worked out in the end, but it would cause spurious valgrind
warnings if you hadn't zeroed out your TGSI shader's struct.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14896>
2022-02-15 18:15:29 +00:00
Emma Anholt
780949c62b i915g: Initialize the rest of the "from_nir" temporary VS struct.
draw looked at the uninitialized XFB state, which should just be zeroed
out since i915 doesn't have XFB.

Fixes: 2b3fc26da8 ("i915g: Switch to using nir-to-tgsi.")
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14896>
2022-02-15 18:15:29 +00:00
Emma Anholt
a6a651b96a r300: Delete the loop unrolling.
There were two paths in this code: One was transform_loops, which would
try to detect loops with an iteration count it understood and unroll that
many times.  The other was emulate_loops, which would just figure out how
many instructions the program could have and still compile (hopefully),
and unroll this loop however many times would fit in that.

The transform_loops had no analysis as good as GLSL or NIR loop unrolling
have, so it shouldn't be missed -- any opportunity it found would only be
due to bugs in the unrolling code.

The emulate_loops path had an issue with computing the number of times it
should try to unroll -- if you had more instrs than ALUs available
already, you'd overflow and unroll approximately infinitely many times,
OOMing the system.  But, also, it's better to throw a compiler error about
unsupported loops than to run the loop an incorrect number of times and
call it a success.

Fixes: #5883, #6018
Reviewed-by: Filip Gawin <filip.gawin@zoho.com>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15004>
2022-02-15 17:27:17 +00:00
Mike Blumenkrantz
4f3f245b78 zink: radv ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15033>
2022-02-15 11:22:44 -05:00
Simon Ser
ffdac8bfa7 vulkan/wsi/wayland: ensure added formats have flags
A format needs to be either alpha or opaque, but can't be neither.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14874>
2022-02-15 09:13:21 +00:00
Simon Ser
5617d5c885 vulkan/wsi/wayland: de-duplicate wsi_wl_display_add_wl_shm_format
Re-use wsi_wl_display_add_drm_format_modifier from
wsi_wl_display_add_wl_shm_format instead of maintaining two
separate switches for DRM and shm formats.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14874>
2022-02-15 09:13:21 +00:00
Simon Ser
1bdf350197 vulkan/wsi/wayland: introduce wsi_wl_display_add_vk_format_modifier
This is a helper to avoid repetitive code in
wsi_wl_display_add_drm_format_modifier.

No functional changes, just refactoring.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14874>
2022-02-15 09:13:21 +00:00
Simon Ser
8ac42a3b1b vulkan/wsi/wayland: switch from alpha/opaque bools to bitfield
This makes the numerous wsi_wl_display_add_vk_format calls easier
to follow: "ALPHA" is easier to decode than "true, false".

No functional changes, just refactoring.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14874>
2022-02-15 09:13:21 +00:00
Juan A. Suarez Romero
801d33b2d9 vc4/ci: update failing piglit tests
See https://gitlab.freedesktop.org/mesa/mesa/-/issues/6038.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15012>
2022-02-15 09:21:23 +01:00
Tapani Pälli
ecc0041030 iris: fix a leak on surface states
Cc: mesa-stable
Closes:https://gitlab.freedesktop.org/mesa/mesa/-/issues/6013

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15010>
2022-02-15 07:06:50 +02:00
Dave Airlie
cb296047f2 gallivm: fix missing cast in 4-bit blending paths.
This got noticed on an llvm debug build.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14987>
2022-02-15 04:09:33 +00:00
Mike Blumenkrantz
b7f1f5c77d zink: ci updates
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15020>
2022-02-15 03:33:31 +00:00
Mike Blumenkrantz
e8ba9cee27 zink: always invalidate streamout counter buffer if not resuming
this otherwise treates begin/end/begin the same as begin/pause/resume

cc: mesa-stable

fixes:
KHR-GL46.texture_view.view_classes
KHR-GL46.transform_feedback.capture_geometry_separate_test
KHR-GL46.transform_feedback.capture_vertex_separate_test
KHR-GL46.transform_feedback.query_geometry_separate_test
KHR-GL46.transform_feedback.query_vertex_separate_test

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15020>
2022-02-15 03:33:31 +00:00
Mike Blumenkrantz
5e7f4e66cc zink: export PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15020>
2022-02-15 03:33:31 +00:00
Mike Blumenkrantz
c99bd08921 zink: map R8G8B8X8_SRGB -> R8G8B8A8_SRGB
this fixes a weird texstore bug that seems specific to this format

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15020>
2022-02-15 03:33:31 +00:00
Mike Blumenkrantz
89477baf95 zink: ci updates
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15018>
2022-02-14 20:57:51 -05:00
Mike Blumenkrantz
b054a233df zink: activate conditional render for compute dispatch when necessary
fixes:
KHR-GL46.compute_shader.conditional-dispatching

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15018>
2022-02-14 20:56:55 -05:00
Mike Blumenkrantz
ef4ab90d04 zink: restart conditional render when crossing batch boundary
this will only happen when conditional render was being used outside
of a renderpass

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15018>
2022-02-14 20:56:55 -05:00
Mike Blumenkrantz
2cc309dd39 zink: always terminate conditional render when flushing a batch
we might not know whether conditional render is active,
so forcibly disable when necessary

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15018>
2022-02-14 20:56:55 -05:00
Mike Blumenkrantz
082b42fbda zink: track internal conditional render state
this allows no-oping redundant calls

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15018>
2022-02-14 20:56:55 -05:00
Iván Briano
db48dcb4f3 intel/compiler: remove what looks like a bad rebase
This bit in the compiler looks like it was added by accident on one of
the latest versions of the original commit, but it clearly doesn't
belong there.

Fixes: 03e1e19246 ("anv: Refactor descriptor copy")

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15016>
2022-02-15 01:04:47 +00:00
Dave Airlie
127bcbed18 gallivm/st/lvp: add flags arg to get_query_result_resource api.
Currently this just has wait, but in order to get the right answer
for vulkan partial, lavapipe/llvmpipe need to pass a partial flag
through here in the future.

This just changes the API so that's possible.

v2: use an enum (zmike)

Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15009>
2022-02-15 10:12:01 +10:00
Emma Anholt
b995a8eba4 nir_to_tgsi: Add support for FBFETCH.
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15014>
2022-02-14 22:06:37 +00:00
Emma Anholt
eaf6e3d3af nir_to_tgsi: Don't vectorize 64-bit instructions, to keep virgl happy.
virglrenderer makes invalid shaders when faced with vector 64-bit
instructions, which GLSL-to-TGSI never produced.  While this doesn't fix
everything, it does get more tests running, and virgl probably the primary
consumer of 64-bit TGSI.  virgl may be deprecating its host 64-bit
support, at which point we can drop this workaround.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15014>
2022-02-14 22:06:37 +00:00
Emma Anholt
036d7172c2 virgl: Move double operands to a temp to avoid double-swizzling bugs.
virglrenderer applies the swizzle when packing doubles.  Since we use scan
now, we can just use the file count for texture detection.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15014>
2022-02-14 22:06:37 +00:00
Emma Anholt
e643cb40a3 virgl: Move tex immediate operands to a temp to avoid virglrenderer bug.
Prior to the noted MR, virglrenderer encoded the tex operands in a
limited-size temp buffer which we could easily overflow with TGSI
immediates.  GLSL-to-TGSI always emitted an extra MOV, so keep that
behavior when nir-to-tgsi feeds us more optimized TGSI.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15014>
2022-02-14 22:06:37 +00:00
Emma Anholt
bc912bace1 virgl: Add workarounds for virglrenderer input/sv signedness bugs.
GLSL-to-TGSI would emit some MOVs that made things OK, but NTT
successfully copy-propagates the inputs and sysvals more, triggering bugs
in virglrenderer when the signedness of the input is different from that
of the ALU op.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15014>
2022-02-14 22:06:37 +00:00
Emma Anholt
f25ccac374 virgl: Apply TGSI transforms to compute shaders, too.
We need to do this for the upcoming virglrenderer workarounds.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15014>
2022-02-14 22:06:37 +00:00
Emma Anholt
c491afaeab virgl: Add a workaround for virglrenderer output writemask bugs.
Various workaround paths in virglrenderer assume that outputs are written
with a full writemask, which is not required by TGSI.  To work around
that, store affected outputs in a temp and do a full write after each
writemasked write.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15014>
2022-02-14 22:06:37 +00:00
Emma Anholt
2fd9e072ce virgl: Work around old virglrenderer's BARRIER counting bug.
One less regression from doing nir-to-tgsi on CI's virglrenderer.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15014>
2022-02-14 22:06:37 +00:00
Emma Anholt
af19774dd4 tgsi_translate: Make the procType public when translating.
This means that tgsi_translate users can check the PIPE_SHADER stage
without having to separately tgsi_scan().

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15014>
2022-02-14 22:06:37 +00:00
Igor Torrente
e5405e6400 venus: Exposes VK_EXT_4444_formats extension
Allows venus to passthrough the VK_EXT_4444_formats extension to
the vulkan client.

And add code to the device initialization and feature query
functions.

Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Signed-off-by: Igor Torrente <igor.torrente@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14954>
2022-02-14 21:56:22 +00:00
Yiwei Zhang
2a87a741ae turnip: advertise VK_EXT_queue_family_foreign
Both Venus and Android AHB requires this extension.

Turnip ignores VK_SHARING_MODE_EXCLUSIVE so this is a no-op.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Rob Clark <robdclark@chromium.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14836>
2022-02-14 21:27:35 +00:00
Danylo Piliaiev
0b2da9d795 ir3: Limit the maximum imm offset in nir_opt_offset for shared vars
STL/LDL have 13 bits to store imm offset.

Fixes crash in CS compilation in Monster Hunter World.

Fixes: b024102d7c
("freedreno/ir3: Use nir_opt_offset for removing constant adds for shared vars.")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14968>
2022-02-14 20:56:46 +00:00
Marcin Ślusarz
b6557b80a5 intel/compiler: fix array & struct IO lowering in mesh shaders
We really need offsets to be in dwords, not in vec4s.

The bug manifests as random failure of func.mesh.clipdistance.5 crucible
test, where stores to gl_MeshVerticesNV[x].gl_ClipDistance[4+n] actually write to
gl_MeshVerticesNV[x].gl_ClipDistance[1+n].

Fixes: 1f438eb033 ("intel/compiler: Implement Mesh Output")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14997>
2022-02-14 19:18:23 +00:00
Timur Kristóf
e6cfd1ed64 spirv: Create PRIMITIVE_INDICES for NV_mesh_shader on-demand.
The shader can have SpvOpWritePackedPrimitiveIndices4x8NV while the
output variable may not exist. This seems to be a defect in the
NV_mesh_shader SPIR-V spec, let's work around it by creating the
variable on-demand.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15005>
2022-02-14 11:13:45 +01:00
Timur Kristóf
0445802ab2 compiler: Extract num_mesh_vertices_per_primitive function.
Prevent code duplication.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15005>
2022-02-14 11:13:42 +01:00
Samuel Pitoiset
32155851f1 radv: remove set but unused radv_buffer::shareable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14937>
2022-02-14 09:28:17 +00:00
Samuel Pitoiset
af420833f0 radv: remove useless NULL checks in vkBind{Buffer,Image}Memory2()
The memory object must be a valid vkDeviceMemory handle.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14937>
2022-02-14 09:28:17 +00:00
Samuel Pitoiset
2dcd12f38b radv: fix finding shaders by PC
Shaders are allocated contiguously in memory for a pipeline and
the freelist.next pointer is a pointer to the pipeline now.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14950>
2022-02-14 08:31:14 +01:00
Samuel Pitoiset
306e153c18 radv: make the trap handler shader BO resident
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14950>
2022-02-14 08:31:12 +01:00
Samuel Pitoiset
a224b7a057 radv: fix allocating/uploading the trap handler shader
Since shaders are allocated per pipeline, the trap handler shader
was not uploaded at all.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14950>
2022-02-14 08:31:10 +01:00
Shmerl
da8c2f5ed3 docs/features: Mark VK_KHR_ray_query in progress
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15000>
2022-02-12 19:18:13 -05:00
Ilia Mirkin
3d41414d26 freedreno/ir3: split up load/store/atomic by generation
Some bits are slightly different on a4xx. Use the encodings that work.
Perhaps these can be combined at some point if we get a proper
understanding of what they mean.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14789>
2022-02-12 13:46:11 -05:00
Ilia Mirkin
b91b036322 isaspec: add gen-based leaf bitset separation
This is necessary for some ops which have slightly different encoding on
a4xx/a5xx, but are otherwise identical. This helps keeping the compiler
from having to worry about these details and creating separate ops.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14789>
2022-02-12 13:46:07 -05:00
Ilia Mirkin
40468430a4 isaspec: fix gen_max to be 2^32-1
The minus sign has higher preference than shift:

>>> 1 << 32 - 1
2147483648
>>> (1 << 32) - 1
4294967295

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14789>
2022-02-12 13:45:57 -05:00
Alyssa Rosenzweig
9dc30f99ae panfrost: Flesh out the Shader Program Descriptor
Only breaking change since Bifrost is that the shader contains barrier? flag is
now fragment-only, meaning it is just a spawn helper threads flag. This affects
compute shaders slightly.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15003>
2022-02-12 09:32:55 -05:00
Alyssa Rosenzweig
60b37424d9 panfrost: Simplify Valhall preload descriptor
Honestly, we could stand to do the same to Bifrost...

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15003>
2022-02-12 09:32:55 -05:00
Alyssa Rosenzweig
1e9a35648a panfrost: Clarify unknowns in z/stencil descriptor
Depth culling and clamping.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15003>
2022-02-12 09:32:55 -05:00
Alyssa Rosenzweig
733d5f061d panfrost: Add more fields to Attribute Descriptor
More XML

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15003>
2022-02-12 09:32:35 -05:00
Alyssa Rosenzweig
b31f6a821d panfrost: Update primitive descriptor for Valhall
Contains stuff needed for layered rendering. Unfortunately, there's no more
provoking vertex per draw -- ugh! That's fine for Vulkan (just don't set
provokingVertexModePerPipeline), but requires inserting extra flushes on desktop
OpenGL.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15003>
2022-02-12 09:32:18 -05:00
Bas Nieuwenhuizen
d8d32cf773 radv: Only wait on CS/PS to finish if we wait on a semaphore.
I think plain submission doesn't need it.

Reviewed-By: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14574>
2022-02-11 23:45:24 +00:00
Bas Nieuwenhuizen
79131b6ee6 radv: Fix preamble argument order.
Used the wrong cmdbuffer in the wrong situation. Oops.

Fixes: 915e9178fa ("radv: Split out commandbuffer submission.")
Reviewed-By: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14574>
2022-02-11 23:45:24 +00:00
Bas Nieuwenhuizen
7adb3c0f7f radv: Use larger arena sizes.
For some games that take like 400 MiB of shader binaries, the
number of shader arenas ends up going >1500. Cut that down a bit
by using larger arenas.

8 MiB should still be decent with small BAR and should still cut
things down from ~1500 to ~50 buffers.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14591>
2022-02-11 23:20:21 +00:00
Erico Nunes
0f9756f480 lima/ppir: refactor bitcopy to use unsigned char
This code does not work as expected when built with clang and
-fstrict-aliasing.
Redefine it in unsigned char operations so that it does not
violate strict aliasing rules.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Cc: 22.0 <mesa-stable>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14894>
2022-02-11 21:55:10 +00:00
Erico Nunes
7297f931f0 lima/ppir: initialize slots array for dummy/undef
Some functions in ppir iterate the ppir_op_info slots arrays looking
for the PPIR_INSTR_SLOT_END token. The dummy/undef internal ops may
appear in the scheduling code and their slots arrays did not contain
that token, which could result in invalid array reads.
Reported by gcc -fsanitize=address.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Cc: 22.0 <mesa-stable>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14894>
2022-02-11 21:55:10 +00:00
Erico Nunes
5b15849366 lima/gpir: avoid invalid write in regalloc
Reported by gcc -fsanitize=address, sometimes gpir regalloc attempts to
handle an uninitialized node->value_reg (containing the value -1), which
results in an invalid array access.
Avoid it for now to prevent crashes, but more investigation may be
required later on.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Cc: 22.0 <mesa-stable>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14894>
2022-02-11 21:55:10 +00:00
Erico Nunes
58c619c3d6 lima: remove an unneeded lima_job_get assignment
Reported by scan-build.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14894>
2022-02-11 21:55:10 +00:00
Erico Nunes
116f01c853 lima: add some checks for potential null pointer dereference
scan-build complains about a potential null pointer dereference in
some places around the lima code.
None of those seem to be a real issue as of now, but let's add some
asserts to cover for that and clean up the warning list.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14894>
2022-02-11 21:55:10 +00:00
Erico Nunes
60888c95bd lima: fix warning of garbage value access
scan-build complains that an access of reg[j+1] in this code might
return garbage.
Let's take the chance to clean this open coded sorting code up and
just use qsort.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14894>
2022-02-11 21:55:10 +00:00
Erico Nunes
2d807979c9 lima/ppir: initialize spill_costs array in regalloc
Static analysis complains that spill_costs might be accessed in
non-initialized positions.
It does not seem to be an issue with the current code which initializes
it for every relevant register index, but we can also just initialize it
to not have to worry about that.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14894>
2022-02-11 21:55:10 +00:00
Erico Nunes
8a8f34c320 lima/ppir: avoid ppir_codegen_outmod implicit conversion
Fix some clang -Wenum-conversion warnings like:

  warning: implicit conversion from enumeration type 'ppir_outmod' to
  different enumeration type 'ppir_codegen_outmod' [-Wenum-conversion]

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14894>
2022-02-11 21:55:10 +00:00
Erico Nunes
3d77950b8b lima/ppir: clean up override-init warnings
Define ppir_op_unsupported as 0 so that we don't have to do the
initialization to -1.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14894>
2022-02-11 21:55:10 +00:00
Erico Nunes
823be63216 lima/gpir: clean up override-init warnings
Define gpir_op_unsupported as 0 so that we don't have to do the
initialization to -1.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14894>
2022-02-11 21:55:10 +00:00
Chia-I Wu
8a30b1541c venus: use 64KB alignment for suballocations
TGL CCS surface addresses must be aligned to 64KB.

Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15001>
2022-02-11 21:26:45 +00:00
Yiwei Zhang
05a2cea14c venus: no roundtrip needed for shmem backed by BLOB_MEM_HOST3D
A successful DRM_IOCTL_VIRTGPU_MAP on BLOB_MEM_HOST3D implies a
roundtrip.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14658>
2022-02-11 21:16:42 +00:00
Yiwei Zhang
a76d1e0e74 venus: init renderer_info at renderer creation (part 2)
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14658>
2022-02-11 21:16:42 +00:00
Yiwei Zhang
ddba7337c7 venus: init renderer_info at renderer creation (part 1)
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14658>
2022-02-11 21:16:42 +00:00
Daniel Schürmann
1bbbabedb7 aco/insert_exec_mask: refactor and remove some unnecessary WQM handling code
Some cases cannot happen and don't need to be handled anymore.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14951>
2022-02-11 19:05:30 +00:00
Daniel Schürmann
d7d7b9974a aco/insert_exec_mask: refactor and simplify get_block_needs()
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14951>
2022-02-11 19:05:30 +00:00
Daniel Schürmann
fcc5dec8d6 aco/insert_exec_mask: remove ever_again_needs and Exact_Branch
This information is not required anymore.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14951>
2022-02-11 19:05:30 +00:00
Daniel Schürmann
cbb1b095ca aco/insert_exec_mask: remove some unnecessary WQM loop handling code
These workarounds are were necessary to prevent infinite loops
with helper lane registers containing wrong data.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14951>
2022-02-11 19:05:30 +00:00
Daniel Schürmann
580a63b4ac aco/insert_exec_mask: remove Preserve_WQM flag
If WQM is needed anywhere after discard_if(), it will also
be flagged as WQM. We can rely on that to preserve the WQM mask.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14951>
2022-02-11 19:05:30 +00:00
Daniel Schürmann
a5a40beefa aco: don't emit WQM for bool_to_scalar_condition
This was only necessary to ensure that the source is computed in WQM
if the current exec mask is in WQM.

Totals from 23170 (17.17% of 134913) affected shaders: (GFX10.3)
VGPRs: 1384464 -> 1383400 (-0.08%); split: -0.08%, +0.01%
SpillSGPRs: 7575 -> 7574 (-0.01%)
CodeSize: 146444752 -> 146317104 (-0.09%); split: -0.13%, +0.04%
MaxWaves: 429870 -> 429868 (-0.00%)
Instrs: 27202586 -> 27170316 (-0.12%); split: -0.17%, +0.05%
Latency: 379488313 -> 379335412 (-0.04%); split: -0.07%, +0.03%
InvThroughput: 69500561 -> 69487704 (-0.02%); split: -0.03%, +0.01%
VClause: 473080 -> 473038 (-0.01%); split: -0.02%, +0.01%
SClause: 1080576 -> 1080571 (-0.00%); split: -0.06%, +0.06%
Copies: 1492865 -> 1504604 (+0.79%); split: -0.40%, +1.19%
Branches: 711295 -> 716849 (+0.78%); split: -0.01%, +0.79%
PreSGPRs: 1331362 -> 1328402 (-0.22%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14951>
2022-02-11 19:05:30 +00:00
Daniel Schürmann
f816dd1be7 aco: don't propagate WQM for p_as_uniform
This was needed, so that in case of active helper lanes,
these contain the correct value. It is now handled implicitly.

Totals from 1004 (0.74% of 134913) affected shaders: (GFX10.3)
CodeSize: 7581020 -> 7580892 (-0.00%); split: -0.00%, +0.00%
Instrs: 1454940 -> 1454908 (-0.00%); split: -0.00%, +0.00%
Latency: 12984953 -> 12984894 (-0.00%); split: -0.00%, +0.00%
InvThroughput: 3173037 -> 3173049 (+0.00%); split: -0.00%, +0.00%
PreSGPRs: 47498 -> 47273 (-0.47%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14951>
2022-02-11 19:05:30 +00:00
Daniel Schürmann
825cd696dc aco/insert_exec_mask: stay in WQM while helper lanes are still needed
This patch flags all instructions WQM which don't require
Exact mode, but depend on the exec mask as long as WQM
is needed on any control flow path afterwards.
This will mostly prevent accidental copies of WQM values
within Exact mode, and also makes a lot of other workarounds
unnecessary.

Totals from 17374 (12.88% of 134913) affected shaders: (GFX10.3)
VGPRs: 526952 -> 527384 (+0.08%); split: -0.01%, +0.09%
CodeSize: 33740512 -> 33766636 (+0.08%); split: -0.06%, +0.14%
MaxWaves: 488166 -> 488108 (-0.01%); split: +0.00%, -0.02%
Instrs: 6254240 -> 6260557 (+0.10%); split: -0.08%, +0.18%
Latency: 66497580 -> 66463472 (-0.05%); split: -0.15%, +0.10%
InvThroughput: 13265741 -> 13264036 (-0.01%); split: -0.03%, +0.01%
VClause: 122962 -> 122975 (+0.01%); split: -0.01%, +0.02%
SClause: 334805 -> 334405 (-0.12%); split: -0.51%, +0.39%
Copies: 275728 -> 282341 (+2.40%); split: -0.91%, +3.31%
Branches: 92546 -> 90990 (-1.68%); split: -1.68%, +0.00%
PreSGPRs: 504119 -> 504352 (+0.05%); split: -0.00%, +0.05%

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14951>
2022-02-11 19:05:30 +00:00
Ian Romanick
59889eb3ae Re-indentation after the previous commit
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14573>
2022-02-11 17:25:34 +00:00
Ian Romanick
912299cb39 glsl: Eliminate ir_assignment::condition
Reformatting is left for the next commit.

v2: Remove assignments from the contructors. :face_palm:

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14573>
2022-02-11 17:25:33 +00:00
Ian Romanick
fb630cd783 glsl: Make ir_assignment::condition private
And add get_condition().

This proof that nothing remains that could possibly set ::condition to
anything other than NULL.

v2: Fix bad rebase.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14573>
2022-02-11 17:25:33 +00:00
Ian Romanick
5208c116f2 glsl: Don't visit rvalues in the condition of an assignment
At this point, this should always be NULL.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14573>
2022-02-11 17:25:33 +00:00
Ian Romanick
1c22f06970 glsl: Don't lower vector indexing in the condition of an assignment
At this point, this should always be NULL.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14573>
2022-02-11 17:25:33 +00:00
Ian Romanick
2652b9a83d glsl: Don't split structures in the condition of an assignment
At this point, this should always be NULL.

v2: Fix bad rebase.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14573>
2022-02-11 17:25:33 +00:00
Ian Romanick
d07551ad4e glsl: Don't split arrays in the condition of an assignment
At this point, this should always be NULL.

v2: Fix bad rebase.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14573>
2022-02-11 17:25:33 +00:00
Ian Romanick
41f6b42b08 glsl: Don't tree graft in the condition of an assignment
At this point, this should always be NULL.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14573>
2022-02-11 17:25:33 +00:00
Ian Romanick
97ffca80a8 glsl: Don't dead-built-in varying eliminate in the condition of an assignment
At this point, this should always be NULL.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14573>
2022-02-11 17:25:33 +00:00
Ian Romanick
231459ad26 glsl: Remove unused condition parameter from ir_assignment constructor
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14573>
2022-02-11 17:25:33 +00:00
Ian Romanick
ec5c9649ba glsl: Don't constant-fold the condition of an assignment
At this point, this should always be NULL.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14573>
2022-02-11 17:25:33 +00:00
Ian Romanick
697a460e49 glsl: Don't clone assignment conditions
At this point, this should always be NULL.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14573>
2022-02-11 17:25:33 +00:00
Ian Romanick
d27e3c6adc glsl: Eliminate unused conditional assignment constructor
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14573>
2022-02-11 17:25:33 +00:00
Ian Romanick
50a0d0d875 glsl: Remove the ability to read text IR with conditional assignments
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14573>
2022-02-11 17:25:33 +00:00
Ian Romanick
710adf2e60 glsl: Add ir_assignment constructor that takes just a write mask
The other constructor that takes a write mask and a condition will be
removed shortly.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14573>
2022-02-11 17:25:33 +00:00
Ian Romanick
afee5dc63f glsl: Lower if to conditional select instead of conditional assignment
Platforms that don't have flow control also don't have anything that
could be written that has a side effect.  It should be safe to implement
these condition writes as

    foo = csel(condition, bar, foo);

This should eliminate the last thing in the GLSL compiler that can
create new conditions on assignments.  Everything else that can store
something in ir_assignment::condition derives it from a pre-existing
condition.

v2: Fix bad rebase.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14573>
2022-02-11 17:25:33 +00:00
Ian Romanick
c3626e1580 glsl/ir_builder: Eliminate unused conditional assignment builders
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14573>
2022-02-11 17:25:33 +00:00
Ian Romanick
46a9df6aac glsl: Don't try to emit the "linear sequence" in lower_variable_index_to_cond_assign
When there are four or fewer elements left in the array partition, the
strategy changes from a binary search of nested flow control to sequence
of conditional assignments like

    (assign, dest, src[constant_i+0], index == constant_i+0)
    (assign, dest, src[constant_i+1], index == constant_i+1)
    (assign, dest, src[constant_i+2], index == constant_i+2)
    (assign, dest, src[constant_i+3], index == constant_i+3)

or

    (assign, dest[constant_i+0], src, index == constant_i+0)
    (assign, dest[constant_i+1], src, index == constant_i+1)
    (assign, dest[constant_i+2], src, index == constant_i+2)
    (assign, dest[constant_i+3], src, index == constant_i+3)

Realistically, the first case should use ir_triop_csel instead.

The second case will either get turned back into flow control like

    if (index == constant_i+0)
        (assign, dest[constant_i+0], src)

    if (index == constant_i+1)
        (assign, dest[constant_i+1], src)

    if (index == constant_i+2)
        (assign, dest[constant_i+2], src)

    if (index == constant_i+3)
        (assign, dest[constant_i+3], src)

or a sequence of conditional selects like

    (assign, dest[constant_i+0], (csel, index == constant_i+0, src, dest[constant_i+0]))
    (assign, dest[constant_i+1], (csel, index == constant_i+1, src, dest[constant_i+1]))
    (assign, dest[constant_i+2], (csel, index == constant_i+2, src, dest[constant_i+2]))
    (assign, dest[constant_i+3], (csel, index == constant_i+3, src, dest[constant_i+3]))

The former case should continue to use the binary search.  The later
case could be generated from the binary search by other lowering passes.

At the end of the day, conditional assignments don't really help
anything here, so stop using them.

Radeon R430
total instructions in shared programs: 2398683 -> 2398419 (-0.01%)
instructions in affected programs: 5143 -> 4879 (-5.13%)
helped: 9
HURT: 8

total vinst in shared programs: 616292 -> 616010 (-0.05%)
vinst in affected programs: 4467 -> 4185 (-6.31%)
helped: 9
HURT: 8

total sinst in shared programs: 315417 -> 315667 (0.08%)
sinst in affected programs: 2568 -> 2818 (9.74%)
helped: 2
HURT: 15

total flowcontrol in shared programs: 1049 -> 1048 (-0.10%)
flowcontrol in affected programs: 7 -> 6 (-14.29%)
helped: 1
HURT: 0

total presub in shared programs: 47027 -> 47027 (0.00%)
presub in affected programs: 127 -> 127 (0.00%)
helped: 1
HURT: 1

total omod in shared programs: 3618 -> 3615 (-0.08%)
omod in affected programs: 8 -> 5 (-37.50%)
helped: 3
HURT: 0

total temps in shared programs: 450757 -> 451312 (0.12%)
temps in affected programs: 837 -> 1392 (66.31%)
helped: 8
HURT: 6

total consts in shared programs: 1031928 -> 1031920 (<.01%)
consts in affected programs: 1211 -> 1203 (-0.66%)
helped: 6
HURT: 7

The shaders that were hurt for temps... are all lies.  None of those
shaders should have compiled as all 6 had more than 32 temps to begin
with.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14573>
2022-02-11 17:25:33 +00:00
Ian Romanick
05703a49f9 glsl: Use csel in do_vec_index_to_cond_assign
This matches what NIR does.  See nir_vector_extract.

This improves code generation for several reasons.  First, it only
requires 3 comparisons instead of 4 (vec3(i > 0, i > 1, i > 2) vs
vec4(i == 0, i == 1, i == 2, i == 3)).

Secondly, it shortens the liverange of some values, possibly quite
dramatically.  Consider a loop in the old version (after lowering
if-statements to selects):

    loop {
        ...
	x = csel(i == 0, a[0], x);
	x = csel(i == 1, a[1], x);
	x = csel(i == 2, a[2], x);
	x = csel(i == 3, a[3], x);
        ...
    }

x is live for the whole loop across iterations.  In the new version, x
is only live while its value is needed:

    loop {
        ...
	t0 = csel(i > 0 , a[1], a[0]);
	t1 = csel(i > 2 , a[3], a[2]);
	x = csel(i > 1, t1, t0);
        ...
    }

Outside a loop, this also means more values of the array may have their
liveness reduced sooner (by consuming two values at once).

All Intel platforms had similar results. (Tigerlake shown)
total instructions in shared programs: 21171336 -> 21163615 (-0.04%)
instructions in affected programs: 89680 -> 81959 (-8.61%)
helped: 40
HURT: 4
helped stats (abs) min: 1 max: 450 x̄: 193.68 x̃: 196
helped stats (rel) min: 0.41% max: 13.32% x̄: 6.01% x̃: 6.22%
HURT stats (abs)   min: 1 max: 12 x̄: 6.50 x̃: 6
HURT stats (rel)   min: 0.50% max: 0.66% x̄: 0.58% x̃: 0.58%
95% mean confidence interval for instructions value: -229.68 -121.28
95% mean confidence interval for instructions %-change: -6.93% -3.89%
Instructions are helped.

total cycles in shared programs: 832879641 -> 829513122 (-0.40%)
cycles in affected programs: 44738430 -> 41371911 (-7.52%)
helped: 35
HURT: 2
helped stats (abs) min: 2 max: 189948 x̄: 96186.49 x̃: 116154
helped stats (rel) min: 0.37% max: 11.08% x̄: 5.88% x̃: 6.47%
HURT stats (abs)   min: 4 max: 4 x̄: 4.00 x̃: 4
HURT stats (rel)   min: 0.69% max: 0.69% x̄: 0.69% x̃: 0.69%
95% mean confidence interval for cycles value: -112881.94 -69092.06
95% mean confidence interval for cycles %-change: -6.77% -4.27%
Cycles are helped.

total spills in shared programs: 8061 -> 7338 (-8.97%)
spills in affected programs: 873 -> 150 (-82.82%)
helped: 24
HURT: 0

total fills in shared programs: 7501 -> 6388 (-14.84%)
fills in affected programs: 1389 -> 276 (-80.13%)
helped: 24
HURT: 0

Radeon R430
total instructions in shared programs: 2449852 -> 2449136 (-0.03%)
instructions in affected programs: 6285 -> 5569 (-11.39%)
helped: 64
HURT: 0
helped stats (abs) min: 4 max: 12 x̄: 11.19 x̃: 12
helped stats (rel) min: 8.16% max: 21.62% x̄: 12.09% x̃: 10.91%

total consts in shared programs: 1032517 -> 1032482 (<.01%)
consts in affected programs: 966 -> 931 (-3.62%)
helped: 35
HURT: 0
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 2.94% max: 10.00% x̄: 4.26% x̃: 3.57%

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14573>
2022-02-11 17:25:33 +00:00
Ian Romanick
ed66d7c385 glsl/lower_vector_derefs: Don't emit conditional assignments
Use if-statements instead.  Any hardware that supports this sort of
tessellation has flow control, so it will probably emit the conditional
assignment using an if-statement anyway.  This is definitely what
st_glsl_to_nir does.

v2: Fix copy-and-paste bug in the ir_type_swizzle handling.  This bug
caused segfaults in tests/spec/arb_tessellation_shader/execution/variable-indexing/tcs-patch-vec4-swiz-index-wr.shader_test.

Reviewed-by: Matt Turner <mattst88@gmail.com> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14573>
2022-02-11 17:25:33 +00:00
Pavel Ondračka
a04aa4bc08 r300: transform fs sin and cos input to [0,1) range in NIR
shader-db stats with RV530 (together with the vs commit):
total instructions in shared programs: 65194 -> 64721 (-0.73%)
instructions in affected programs: 6718 -> 6245 (-7.04%)
total consts in shared programs: 45363 -> 45353 (-0.02%)
consts in affected programs: 466 -> 456 (-2.15%)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5982
Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14957>
2022-02-11 16:09:45 +00:00
Pavel Ondračka
3f97306b95 r300: transform vs sin and cos input to [-PI,PI] range in NIR
The python generator is mostly copy-pasted from lima.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14957>
2022-02-11 16:09:45 +00:00
Pavel Ondračka
1109381e0e r300: use nir lowering for sin and cos on R300 and R400
The nir approximation is a bit more precise so there is one more
instruction for the scalar version but if the shader actually uses
vector one or some other stuff like sin(x) followed by cos(x) we
save more.

This nir approximation importantly seems to have better precision
so this should also fix some piglits/dEQPs.

With my shader-db and faked R300:
total instructions in shared programs: 67751 -> 65978 (-2.62%)
instructions in affected programs: 8637 -> 6864 (-20.53%)
total temps in shared programs: 9191 -> 9137 (-0.59%)
temps in affected programs: 486 -> 432 (-11.11%)
total consts in shared programs: 45427 -> 45412 (-0.03%)
consts in affected programs: 856 -> 841 (-1.75%)
total lits in shared programs: 2317 -> 2346 (1.25%)
lits in affected programs: 69 -> 98 (42.03%)

Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14957>
2022-02-11 16:09:45 +00:00
Samuel Pitoiset
aa3405e812 radv/winsys: fix initializing debug/perftest options if multiple instances
Since the winsys uses refcount, options like RADV_DEBUG_ZERO_VRAM might
have not been initialized if the first instance wasn't created with
application info.

This fixes missing zerovram for vkd3d-proton.

Cc: 21.3 22.0 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14978>
2022-02-11 16:12:47 +01:00
Rohan Garg
4001d9ce1a anv: Handle VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE for descriptor sets
Ensure that surface state does not get created for
VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE and we don't bind to the
binding table for descriptor sets created with this pool.

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/14683>
2022-02-11 12:03:42 +00:00
Daniel Schürmann
af4b26c53a radv: move nir_opt_shrink_stores from radv_optimize_nir()
No need to call this pass in a loop.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14480>
2022-02-11 11:50:52 +01:00
Daniel Schürmann
2a92452a0e nir/opt_shrink_vectors: Remove shrinking of store intrinsics data source
This is done via nir_opt_shrink_stores.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14480>
2022-02-11 11:50:47 +01:00
Daniel Schürmann
2dba7e6056 nir: split nir_opt_shrink_stores from nir_opt_shrink_vectors
This patch moves the shrinking of store sources into
a separate pass.
The reasoning behind this is that this pass usually only
needs to be called once while nir_shrink_vectors might
better be called several times. This allows to move
the pass(es) out of the optimization loops.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14480>
2022-02-11 11:34:01 +01:00
Christian Gmeiner
b07372312d Revert "nir: make tgsi_varying_semantic_to_slot(..) public"
This reverts commit edbdd97723.

As etnaviv's TGSI compiler is gone we make that function
private again.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12889>
2022-02-11 08:48:10 +00:00
Christian Gmeiner
367b6c553d etnaviv: drop TGSI based backend compiler
I think it is time to switch to NIR per default and forget
about the past. There might be stuff that will explode in
different ways now but thats all fixable.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12889>
2022-02-11 08:48:10 +00:00
Jason Ekstrand
29393a40ee v3dv: Use the common command pool implementation
The only interesting information stored in v3dv_cmd_pool is the list of
command buffers and that's already tracked by vk_command_pool.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14917>
2022-02-11 08:06:25 +00:00
Jason Ekstrand
fcad979b72 v3dv: Don't use vk_alloc/free2 for command buffers
The pool will always have a valid allocator.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14917>
2022-02-11 08:06:25 +00:00
Jason Ekstrand
09b5f0f3ac anv: Use the common vk_command_pool
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14917>
2022-02-11 08:06:25 +00:00
Jason Ekstrand
3007f8e95f anv: Don't call DestroyCommandBuffers in AllocateCommandBuffers
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14917>
2022-02-11 08:06:25 +00:00
Jason Ekstrand
5a15c3eff7 anv: Drop anv_cmd_buffer::pool
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14917>
2022-02-11 08:06:25 +00:00
Jason Ekstrand
2170ec2845 anv: Don't use vk_alloc/free2 for command buffers
The pool will always have a valid allocator.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14917>
2022-02-11 08:06:25 +00:00
Jason Ekstrand
37f3da90dd vulkan: Implement of a bunch of VkCommandPool functions
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14917>
2022-02-11 08:06:25 +00:00
Jason Ekstrand
f424d1e9ab vulkan/queue: Assert command buffers have the right queue family
We've got enough information in common code to track this now so we may
as well throw in a helpful assert.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14917>
2022-02-11 08:06:25 +00:00
Jason Ekstrand
bda4c4f6b6 vulkan: Take a vk_command_pool in vk_command_buffer_init()
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14917>
2022-02-11 08:06:25 +00:00
Jason Ekstrand
d59caf5d11 turnip: Use vk_command_pool
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14917>
2022-02-11 08:06:24 +00:00
Jason Ekstrand
6fb9e4e7ff v3dv: Use vk_command_pool
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14917>
2022-02-11 08:06:24 +00:00
Jason Ekstrand
2746be68f1 lavapipe: Use vk_command_pool
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14917>
2022-02-11 08:06:24 +00:00
Jason Ekstrand
2a5ae138b4 panvk: Use vk_command_pool
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14917>
2022-02-11 08:06:24 +00:00
Jason Ekstrand
29a164b088 radv: Use vk_command_pool
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14917>
2022-02-11 08:06:24 +00:00
Jason Ekstrand
c5b8ee8810 anv: Use vk_command_pool
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14917>
2022-02-11 08:06:24 +00:00
Jason Ekstrand
a10b6d1c6f vulkan: Add a common vk_command_pool base struct
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14917>
2022-02-11 08:06:24 +00:00
Louis-Francis Ratté-Boulianne
5e263cc324 vulkan/runtime: Add a level field to vk_command_buffer
Looks like 3 implementations already have that field in their private
command_buffer struct, and having it at the vk_command_buffer opens the
door for generic (but suboptimal) secondary command buffer support.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14917>
2022-02-11 08:06:24 +00:00
Jason Ekstrand
7b0e306854 anv: Call vk_command_buffer_finish if create fails
This wasn't much of a problem before because vk_command_buffer_finish()
doesn't do much on an empty command buffer.  However, it's about to be
responsible for managing the pool's list of command buffers so it will
be critical to get this right.

Fixes: c9189f4813 ("anv: Use a common vk_command_buffer structure")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14917>
2022-02-11 08:06:24 +00:00
Paulo Zanoni
cb50e4ac4d iris: use the same VM for every context
Now that we have no overlapping memory addresses for different
contexts we can go ahead and also share the same VM for every context.
This should make VM binding much easier to implement once we have
Kernel support for it.

v2: We now have engines_ctx, set it there too.
v3: Fix indenting (Ken).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12028>
2022-02-11 01:42:45 +00:00
Paulo Zanoni
782efa29e6 iris: have a single border color pool per bufmgr
Have a single border color pool per bufmgr instead of per context.

We want to have a single VM shared among every context and the border
color pool is the last feature preventing us from having that.

Previously we had 1024 colors per context but once the buffer was full
we just waited for the buffer to be unused and restarted it. After
this patch we have 4096 colors for every single context and we can't
just flush buffers if they are full, so we simply return black.

There are many strategies we could try to implement to help alleviate
this new 4096 limit, none of which are implemented by this patch:

 - We could just expand the buffer to the full 16MB we can use,
   allowing 262144 colors.
 - We could use multiple buffers and make the contexts refcount them,
   so eventually older buffers would reach zero references and be
   recycled, moving us to a working set maximum from a lifetime
   maximum.
 - We could also make the border color pool be a standard memzone and
   then give smaller buffers to each context when they need, so the
   limit would be in the number of contexts that can use border color
   pools. This was my first implementation but Ken suggested I switch
   to the one provided by this patch, which is simpler.

Keep it like this since border colors don't seem to be used very much
and other Mesa drivers such as radeonsi also seem to employ the
"return black once we reach the limit" strategy.

As a last note, we could also move the contents of iris_border_color.c
to iris_bufmgr.c in order to avoid breaking some abstractions we have
in Iris, like we do with iris_bufmgr_get_border_color_pool(). I can do
this in case we want it.

v2: Switch from standard memzone to a per-screen thing (see above).
v3: Actually make it per bufmgr. Just making it per screen is not
    enough, since screens can share the same VM, an example being the
    gputest benchmark suite.
v4: Rebase.
v5: Remove dead code, lock around hash table lookup (Ken).
v6: Simple rebase.
v7: Another rebase (for_each_batch).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12028>
2022-02-11 01:42:45 +00:00
Paulo Zanoni
70dcffde4e iris: handle IRIS_MEMZONE_BINDER with a real vma_heap like the others
We're moving towards a path where all contexts share the same virtual
memory - because this will make implementing vm_bind much easier - ,
and to achieve that we need to rework the binder memzone. As it is,
different contexts will choose overlapping addresses. So in this patch
we adjust the Binder to be 1GB - per Ken's suggestion - and use a real
vma_heap for it. As a bonus the code gets simpler since it just reuses
the same pattern we already have for the other memzones.

Credits to Kenneth Granunke for helping me with this change.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12028>
2022-02-11 01:42:45 +00:00
Mike Blumenkrantz
79b946a9d2 zink: ci updates
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14976>
2022-02-11 01:29:39 +00:00
Mike Blumenkrantz
68b099b8eb zink: implement generated tcs variants using spirv shortcut
this codepath needs to update literally one spirv word to get the right shader
(why can't this be a spec constant?)
so just update that word instead of running all the nir passes and doing a
full recompile

fixes:
KHR-GL46.tessellation_shader.tessellation_control_to_tessellation_evaluation.gl_MaxPatchVertices_Position_PointSize
KHR-GL46.tessellation_shader.tessellation_control_to_tessellation_evaluation.gl_PatchVerticesIn

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14976>
2022-02-11 01:29:39 +00:00
Mike Blumenkrantz
e1ef00aed7 zink: move pipeline tcs patch_vertices value to tcs shader key
making this available for shader update use

no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14976>
2022-02-11 01:29:39 +00:00
Mike Blumenkrantz
63236f9ea9 zink: add a tcs shader key
only applies for generated tcs

no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14976>
2022-02-11 01:29:39 +00:00
Mike Blumenkrantz
a9d2b86c2c zink: store the spirv_shader to the zink_shader struct for generated tcs
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14976>
2022-02-11 01:29:39 +00:00
Mike Blumenkrantz
6c0740c129 zink: split off CreateShaderModule into util function
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14976>
2022-02-11 01:29:39 +00:00
Mike Blumenkrantz
cd9b099038 zink: store the tcs_vertices_out spirv word to the spirv_shader struct
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14976>
2022-02-11 01:29:39 +00:00
Mike Blumenkrantz
f2baa0638b zink: store the tcs_vertices_out spirv word
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14976>
2022-02-11 01:29:39 +00:00
Mike Blumenkrantz
64f1960915 zink: make spirv_builder_emit_exec_mode_literal() return the word for the param
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14976>
2022-02-11 01:29:39 +00:00
Mike Blumenkrantz
25d6651324 zink: make spirv_buffer_emit_word() return the word that was written
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14976>
2022-02-11 01:29:39 +00:00
Mike Blumenkrantz
5663fac5ca zink: break out spirv shader dumping into separate function
debugging++

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14976>
2022-02-11 01:29:39 +00:00
Mike Blumenkrantz
ff92d2f188 zink: ci updates
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14974>
2022-02-11 01:17:28 +00:00
Mike Blumenkrantz
8ff96efcfd zink: always set VkPipelineMultisampleStateCreateInfo::pSampleMask
by initializing this on context creation, we can ensure that the correct
value is always here

cc: mesa-stable

fixes:
dEQP-GLES31.functional.texture.multisample.samples_1.sample_mask_and_alpha_to_coverage
dEQP-GLES31.functional.texture.multisample.samples_1.sample_mask_and_sample_coverage
dEQP-GLES31.functional.texture.multisample.samples_1.sample_mask_and_sample_coverage_and_alpha_to_coverage
dEQP-GLES31.functional.texture.multisample.samples_1.sample_mask_only
dEQP-GLES31.functional.texture.multisample.samples_2.sample_mask_and_alpha_to_coverage
dEQP-GLES31.functional.texture.multisample.samples_2.sample_mask_and_sample_coverage
dEQP-GLES31.functional.texture.multisample.samples_2.sample_mask_and_sample_coverage_and_alpha_to_coverage
dEQP-GLES31.functional.texture.multisample.samples_2.sample_mask_only
dEQP-GLES31.functional.texture.multisample.samples_3.sample_mask_and_alpha_to_coverage
dEQP-GLES31.functional.texture.multisample.samples_3.sample_mask_and_sample_coverage
dEQP-GLES31.functional.texture.multisample.samples_3.sample_mask_and_sample_coverage_and_alpha_to_coverage
dEQP-GLES31.functional.texture.multisample.samples_3.sample_mask_only
dEQP-GLES31.functional.texture.multisample.samples_4.sample_mask_and_alpha_to_coverage
dEQP-GLES31.functional.texture.multisample.samples_4.sample_mask_and_sample_coverage
dEQP-GLES31.functional.texture.multisample.samples_4.sample_mask_and_sample_coverage_and_alpha_to_coverage
dEQP-GLES31.functional.texture.multisample.samples_4.sample_mask_only

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14974>
2022-02-11 01:17:28 +00:00
Dave Airlie
da0e00e0b9 gallivm: add coroutine attribute that llvm requires.
Running llvm in debug mode asserts on this being missing.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14963>
2022-02-11 00:32:21 +00:00
Jesse Natalie
31e2c3f550 microsoft/compiler: Fill interpolation for sysval inputs to non-vertex shader
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5483
Reviewed-by: Michael Tang <tangm@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14984>
2022-02-11 00:19:17 +00:00
Jesse Natalie
9dba60f397 d3d12: Only force point sampling for emulated shadow samplers
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14981>
2022-02-10 23:33:35 +00:00
Iván Briano
e2a5e2d5a0 anv: make the pointer valid before we assign stuff into it
Fixes: 665ffd4bf9 ("anv: Update VK_KHR_fragment_shading_rate for newer HW")

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14982>
2022-02-10 23:06:13 +00:00
Caio Oliveira
12b4aad803 anv: Enable requiredSubgroupSize for Task/Mesh
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14979>
2022-02-10 22:37:03 +00:00
Kenneth Graunke
577d131bcf anv: Increase maxBoundDescriptorSets to 32
We recently had a request to support a larger maxBoundDescriptorSets,
specifically 32, and there doesn't appear to be a reason we need to
restrict this to 8.  According to vulkan.gpuinfo.org reports, most
Vulkan drivers appear to support 32.

Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14952>
2022-02-10 13:56:46 -08:00
Jesse Natalie
a84265938b driconf: Add Heaven entries for Windows .exe
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14965>
2022-02-10 20:19:00 +00:00
Jesse Natalie
2360c25d63 d3d12: Don't add a second dual-source output for Heaven
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14965>
2022-02-10 20:19:00 +00:00
Jesse Natalie
22fc534930 d3d12: Default newly-created resources to not-resident
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14959>
2022-02-10 20:06:15 +00:00
Jesse Natalie
e3a2cb4b67 d3d12: Implement residency management algorithm
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14959>
2022-02-10 20:06:15 +00:00
Jesse Natalie
40dafd0094 d3d12: Add a budget/usage callback to the screen
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14959>
2022-02-10 20:06:15 +00:00
Jesse Natalie
671deb541e d3d12: Add residency info to d3d12_bo
This is all currently immutable, but will be used to manage the
residency of the underlying D3D objects in a future commit.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14959>
2022-02-10 20:06:15 +00:00
Jesse Natalie
f4c74f74f8 d3d12: Add sampler's textures to batch bo tracking
This will be important for residency in a future change, but also
is necessary for synchronize() to work correctly for TBOs.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14959>
2022-02-10 20:06:15 +00:00
Jesse Natalie
34e53d4c9c d3d12: Move ID3D12Fence from context to screen
There's already a single command queue for the screen, meaning that
all commands are being serialized implicitly into that queue. There's
no need to have separate fences for parallel contexts when those
fences would all share the same underlying timeline.

This adds an explicit lock to expand the scope of the implicit screen
command queue ordering to include fence signals.

Each context still gets its own submit sequence, which is used for 1
purpose right now: A uniqueness check in the state manager to see
if states are coming from separate command lists, to apply promotion
and decay logic.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14959>
2022-02-10 20:06:15 +00:00
Jesse Natalie
7ce2d5aece d3d12: Forward wait condition from query -> result buffer
The no-wait condition was wrong before. If the query was used in the
current batch (query->fence_value == context->fence_value), we'd
continue on with the operation instead of returning false. Then the
buffer map would see that the bo is referenced in the current batch,
and would flush and wait, even though we were asked not to wait.

This fixes the condition by simply using the (correct) buffer map
logic.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14959>
2022-02-10 20:06:15 +00:00
Jesse Natalie
5cbd7093af d3d12: When mapping a resource used in the current batch without blocking, at least flush
Also, resource_is_busy needs to opportunistically retire batches, so apps can
spin on non-blocking resource maps and eventually succeed.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14959>
2022-02-10 20:06:15 +00:00
Ian Romanick
1cb3d1a6ae nir: Produce correct results for atan with NaN
Properly handling NaN adversely affects several hundred shaders in
shader-db (lots of Skia and a few others from various synthetic
benchmarks) and fossil-db (mostly Talos and some Doom 2016).  Only apply
the NaN handling work-around when the shader demands it.

v2: Add comment explaining the 1.0*y_over_x.  Suggested by Caio.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Fixes: 2098ae16c8 ("nir/builder: Move nir_atan and nir_atan2 from SPIR-V translator")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13999>
2022-02-10 18:15:39 +00:00
Ian Romanick
7d0d9b9fbc nir: Properly handle various exceptional values in frexp
frexp_sig of ±0, ±Inf, or NaN should just return the input unmodified.

frexp_exp of ±Inf or NaN is undefined, and frexp_exp of ±0 should return
the input unmodified.  This seems to already work.

No shader-db or fossil-db changes on any Intel platform.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Fixes: 23d30f4099 ("spirv,nir: lower frexp_exp/frexp_sig inside a new NIR pass")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13999>
2022-02-10 18:15:39 +00:00
Ian Romanick
93ed87af28 spirv: Produce correct result for GLSLstd450Tanh with NaN
No shader-db or fossil-db changes on any Intel platform.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Fixes: 9f9432d56c ("Revert "spirv: Use a simpler and more correct implementaiton of tanh()"")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13999>
2022-02-10 18:15:39 +00:00
Ian Romanick
e442b9d792 spirv: Produce correct result for GLSLstd450Modf with Inf
GLSLstd450ModfStruct too.

No shader-db or fossil-db changes on any Intel platform.

v2: Fix handling 16-bit (and presumably 64-bit) values.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Fixes: f92a35d831 ("vtn: Fix Modf.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13999>
2022-02-10 18:15:39 +00:00
Ian Romanick
75ef5991f5 spriv: Produce correct result for GLSLstd450Step with NaN
NOTE: This commit needs "nir: All set-on-comparison opcodes can take all
float types" or regressions will occur in other Vulkan SPIR-V tests.

No shader-db changes on any Intel platform.

NOTE: This commit depends on "nir: All set-on-comparison opcodes can
take all float types".

v2: Fix handling 16-bit (and presumably 64-bit) values.

About 280 shaders in Talos are hurt by a few instructions, and a couple
shaders in Doom 2016 are hurt by a few instructions.

Tiger Lake
Instructions in all programs: 159893290 -> 159895026 (+0.0%)
SENDs in all programs: 6936431 -> 6936431 (+0.0%)
Loops in all programs: 38385 -> 38385 (+0.0%)
Cycles in all programs: 7019260087 -> 7019254134 (-0.0%)
Spills in all programs: 101389 -> 101389 (+0.0%)
Fills in all programs: 131532 -> 131532 (+0.0%)

Ice Lake
Instructions in all programs: 143624235 -> 143625691 (+0.0%)
SENDs in all programs: 6980289 -> 6980289 (+0.0%)
Loops in all programs: 38383 -> 38383 (+0.0%)
Cycles in all programs: 8440083238 -> 8440090702 (+0.0%)
Spills in all programs: 102246 -> 102246 (+0.0%)
Fills in all programs: 131908 -> 131908 (+0.0%)

Skylake
Instructions in all programs: 134185495 -> 134186618 (+0.0%)
SENDs in all programs: 6938790 -> 6938790 (+0.0%)
Loops in all programs: 38356 -> 38356 (+0.0%)
Cycles in all programs: 8222366923 -> 8222365826 (-0.0%)
Spills in all programs: 98821 -> 98821 (+0.0%)
Fills in all programs: 125218 -> 125218 (+0.0%)

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Fixes: 1feeee9cf4 ("nir/spirv: Add initial support for GLSL 4.50 builtins")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13999>
2022-02-10 18:15:39 +00:00
Ian Romanick
38a94c82e6 intel/fs: Don't optimize out 1.0*x and -1.0*x
This (sort of) matches the behavior of nir_opt_algebraic.  This ensures
that subnormal values are properly flushed to zero.

With the aid of "nir/search: Float sources of texture instructions are
float users" and "nir/search: Transitively apply is_only_used_as_float",
there would have been no shader-db regressions on Intel platforms.
However, those caused a significant increase in compile time.  Since the
instruction regressions were so small, I just dropped those commits
rather than improve them.

All Haswell and newer platforms had similar results. (Ice Lake shown)
total instructions in shared programs: 20125042 -> 20125094 (<.01%)
instructions in affected programs: 7184 -> 7236 (0.72%)
helped: 0
HURT: 32
HURT stats (abs)   min: 1 max: 4 x̄: 1.62 x̃: 2
HURT stats (rel)   min: 0.11% max: 1.49% x̄: 0.85% x̃: 0.78%
95% mean confidence interval for instructions value: 1.39 1.86
95% mean confidence interval for instructions %-change: 0.74% 0.96%
Instructions are HURT.

total cycles in shared programs: 862745586 -> 862746551 (<.01%)
cycles in affected programs: 109872 -> 110837 (0.88%)
helped: 12
HURT: 23
helped stats (abs) min: 2 max: 774 x̄: 90.83 x̃: 19
helped stats (rel) min: 0.07% max: 25.23% x̄: 3.06% x̃: 0.40%
HURT stats (abs)   min: 2 max: 1106 x̄: 89.35 x̃: 12
HURT stats (rel)   min: 0.08% max: 45.40% x̄: 3.01% x̃: 0.47%
95% mean confidence interval for cycles value: -60.09 115.23
95% mean confidence interval for cycles %-change: -2.21% 4.07%
Inconclusive result (value mean confidence interval includes 0).

All of the shaders hurt are in either UE4 shooter-game or shooter_demo.

Tiger Lake
Instructions in all programs: 159893213 -> 159893290 (+0.0%)
SENDs in all programs: 6936431 -> 6936431 (+0.0%)
Loops in all programs: 38385 -> 38385 (+0.0%)
Cycles in all programs: 7019259514 -> 7019260087 (+0.0%)
Spills in all programs: 101389 -> 101389 (+0.0%)
Fills in all programs: 131532 -> 131532 (+0.0%)

Ice Lake
Instructions in all programs: 143624164 -> 143624235 (+0.0%)
SENDs in all programs: 6980289 -> 6980289 (+0.0%)
Loops in all programs: 38383 -> 38383 (+0.0%)
Cycles in all programs: 8440082767 -> 8440083238 (+0.0%)
Spills in all programs: 102246 -> 102246 (+0.0%)
Fills in all programs: 131908 -> 131908 (+0.0%)

Skylake
Instructions in all programs: 134185424 -> 134185495 (+0.0%)
SENDs in all programs: 6938790 -> 6938790 (+0.0%)
Loops in all programs: 38356 -> 38356 (+0.0%)
Cycles in all programs: 8222366529 -> 8222366923 (+0.0%)
Spills in all programs: 98821 -> 98821 (+0.0%)
Fills in all programs: 125218 -> 125218 (+0.0%)

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Fixes: f5dd6dfe01 ("anv: enable VK_KHR_shader_float_controls and SPV_KHR_float_controls")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13999>
2022-02-10 18:15:39 +00:00
Ian Romanick
38800b385c nir: All set-on-comparison opcodes can take all float types
Extend 4195a9450b so that the next poor fool doesn't come along and
say, "sge does the right thing for 16-bit sources, but slt gives a NIR
validation failure. What the deuce?"

NOTE: This commit is necessary to prevent regressions in GLSLstd450Step
tests of 16-bit sources at "spriv: Produce correct result for
GLSLstd450Step with NaN".

Fixes: 4195a9450b ("nir: sge operation is defined for floating-point types")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13999>
2022-02-10 18:15:39 +00:00
Ian Romanick
97ce3a56bd nir/search: Constify instr parameter to nir_search_expression::cond
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13999>
2022-02-10 18:15:39 +00:00
Ian Romanick
4dd4135551 nir: Constify def parameter to nir_ssa_def_bits_used
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13999>
2022-02-10 18:15:39 +00:00
Otavio Pontes
510d248299 nir: Use proper macro to set bits of variable correctly
When slots is 64 only the first bit was being set, instead of setting
all 64 bits of the variable, so for that case the function
get_variable_io_mask() always returned 0.

This behaviour caused variables that are being used both on producer and
consumer to be considered unused and thus being removed on
nir_remove_unused_io_vars().

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14955>
2022-02-10 17:19:54 +00:00
Daniel Stone
7a0ace7d4e Revert "ci: Disable Windows for now"
This reverts commit be385ab5bc.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14975>
2022-02-10 16:44:16 +00:00
Georg Lehmann
c2168f845e nir/lower_mediump: Treat u2u16 like i2i16.
There is a comment in nir_fold_16bit_sampler_conversions saying that these
are the same, but the code only checks for i2i16.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14893>
2022-02-10 16:13:54 +00:00
Mike Blumenkrantz
532665c73c zink: anv (icl) ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14973>
2022-02-10 16:01:04 +00:00
Danylo Piliaiev
b84f059680 freedreno/pps: Expose same counters as blob
Expose most of the counters exposed by blob. By faking the value of
counters returned from kgsl I found the exact underlying counters and
constant coefficients being used.

Note, coefficients for counters that depend on time are NOT verified.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14323>
2022-02-10 15:15:33 +00:00
Samuel Pitoiset
03ab9d895e radv/ci: update CI lists for CTS 1.3.1.0
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14946>
2022-02-10 14:52:42 +00:00
Daniel Schürmann
fce6ca0f3a radv: remove exports without color attachment or writemask
This lets us make use of NIR's more advanced DCE.
This includes removing of CF constructs, PS inputs and VS outputs.

Totals from 1959 (1.45% of 134913) affected shaders: (GFX10.3)
VGPRs: 73464 -> 71944 (-2.07%); split: -3.79%, +1.72%
SpillSGPRs: 6 -> 0 (-inf%)
CodeSize: 4860324 -> 4675248 (-3.81%); split: -4.92%, +1.11%
LDS: 2619904 -> 2781696 (+6.18%); split: -0.37%, +6.55%
MaxWaves: 50614 -> 50852 (+0.47%); split: +1.63%, -1.16%
Instrs: 924233 -> 887836 (-3.94%); split: -5.01%, +1.07%
Latency: 5635532 -> 5418083 (-3.86%); split: -4.53%, +0.67%
InvThroughput: 1107764 -> 1077542 (-2.73%); split: -3.44%, +0.71%
VClause: 17361 -> 16163 (-6.90%); split: -8.38%, +1.47%
SClause: 31886 -> 29323 (-8.04%); split: -8.52%, +0.48%
Copies: 53529 -> 52127 (-2.62%); split: -5.30%, +2.68%
Branches: 22993 -> 22802 (-0.83%); split: -3.44%, +2.61%
PreSGPRs: 53123 -> 51395 (-3.25%); split: -3.60%, +0.35%
PreVGPRs: 59699 -> 57424 (-3.81%); split: -5.13%, +1.32%

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14771>
2022-02-10 14:23:26 +00:00
Daniel Stone
be385ab5bc ci: Disable Windows for now
Docker on Windows is broken for some reason, so just disable it for now.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14970>
2022-02-10 12:51:06 +00:00
Lionel Landwerlin
137e170bcb anv: update limit for maxVertexInputBindingStride
Before:
	maxVertexInputBindingStride                     = 2048 (gen7+)

After:
	maxVertexInputBindingStride                     = 2048 (gen7/gen8)
	maxVertexInputBindingStride                     = 4095 (gen9+)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14958>
2022-02-10 10:06:22 +00:00
Chia-I Wu
f93059b19f venus: fix two VN_TRACE_SCOPE's in the same scope
Make sure __LINE__ is expanded.

Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14960>
2022-02-10 05:11:46 +00:00
Nanley Chery
987bc44954 iris: Drop the iris_resource aux usage bit fields
A big reason we had these fields was to help create a set of surface
states for a resource. That's largely being handled through other means
now.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14806>
2022-02-10 04:47:14 +00:00
Nanley Chery
ae763940e8 iris: Compute aux.possible_usages from aux.usage
We're going to remove res->aux.possible_usages. This will simplify the
commit in which we do so.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14806>
2022-02-10 04:47:14 +00:00
Nanley Chery
d905018a2c iris: Use iris_sample_with_depth_aux more often
We're going to remove res->aux.sampler_usages. This will simplify the
commit in which we do so.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14806>
2022-02-10 04:47:14 +00:00
Nanley Chery
85a7fb1e19 intel/isl: Add format assertions for surfaces using CCS
This caught some invalid CCS surface states created by iris.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14806>
2022-02-10 04:47:14 +00:00
Nanley Chery
05b8b08ef4 iris: Avoid making some invalid CCS surface states
Although a resource may support CCS with its original format, a texture
view of that resource may have a format that doesn't support
compression. Don't create CCS surface states for such texture views.

This change affects iris' behavior when running piglit's
arb_texture_view-rendering-formats_gles3 test on SKL.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14806>
2022-02-10 04:47:14 +00:00
Nanley Chery
a9beb87dce iris: Inline some surface_state.cpu references
Now that we're using fill_surface_states, these aren't needed anymore.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14806>
2022-02-10 04:47:14 +00:00
Nanley Chery
d705faad6c iris: Add and use fill_surface_states
This helper simplifies some repeated logic.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14806>
2022-02-10 04:47:14 +00:00
Nanley Chery
eb51fd0414 iris: Add and use use_surface_state
This helper simplifies some repeated logic.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14806>
2022-02-10 04:47:14 +00:00
Nanley Chery
89ebdd67c4 iris: Add and use iris_surface_state::aux_usages
An iris_surface_state can have a different set of possible aux usages
than its iris_resource.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14806>
2022-02-10 04:47:14 +00:00
Nanley Chery
b60af618a0 iris: Drop res param from surf_state_offset_for_aux
This has been unused since commit 117a0368b0.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14806>
2022-02-10 04:47:14 +00:00
Nanley Chery
ce37e176f1 iris: Drop format param from fast_clear_color
It's unused.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14806>
2022-02-10 04:47:14 +00:00
Nanley Chery
6778b3a379 iris: Don't fast clear with the view format
Fast clear with the resource format instead. This is safe to do because
can_fast_clear_color ensures that the clear color generates the same
pixel with either the view format or the resource format.

On SKL, this prevents us from using an invalid surface state. This platform
doesn't support CCS_E with sRGB formats, but prior to this patch we allowed
fast-clearing with this combination. Piglit's fcc-write-after-clear test
can trigger this.

Fixes: 230952c210 ("iris: Don't support sRGB + Y_TILED_CCS on gen9")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14806>
2022-02-10 04:47:14 +00:00
Mike Blumenkrantz
68c1b50e48 aux/draw: fix llvm tcs lane vec generation
the idx param for LLVMBuildInsertElement is zero-indexed based on the
value of 'vector_length' (always 4), and the vector length is (obviously)
sized to 'vector_length', so this should be the member of the vec that is being
inserted, not the invocation index

cc: mesa-stable

fixes (zink, but only on my one machine):
KHR-GL46.tessellation_shader.single.max_patch_vertices
KHR-GL46.tessellation_shader.tessellation_shader_tc_barriers.barrier_guarded_read_write_calls
dEQP-GLES31.functional.tessellation.shader_input_output.barrier
dEQP-GLES31.functional.tessellation.shader_input_output.patch_vertices_5_in_10_out
dEQP-GLES31.functional.tessellation_geometry_interaction.feedback.tessellation_output_isolines_geometry_output_points
dEQP-GLES31.functional.tessellation_geometry_interaction.feedback.tessellation_output_isolines_point_mode_geometry_output_triangles
dEQP-GLES31.functional.tessellation_geometry_interaction.feedback.tessellation_output_quads_geometry_output_points
dEQP-GLES31.functional.tessellation_geometry_interaction.feedback.tessellation_output_quads_point_mode_geometry_output_lines
dEQP-GLES31.functional.tessellation_geometry_interaction.feedback.tessellation_output_triangles_geometry_output_points
dEQP-GLES31.functional.tessellation_geometry_interaction.feedback.tessellation_output_triangles_point_mode_geometry_output_lines

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14949>
2022-02-10 04:14:28 +00:00
Bas Nieuwenhuizen
8d5be0a2b3 radv: Add submit locking with trace bo.
Otherwise cmdbuffers from different queues can override the trace id
from each other, making for a very confusing hang report.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14868>
2022-02-10 03:49:02 +00:00
Ian Romanick
e3cbc328e0 gallivm/nir: Call nir_lower_bool_to_int32 after nir_opt_algebraic_late
All of the opcodes in nir_opt_algebraic_late are the unsized (1-bit)
versions.  If the lowering to int32 happens first, many of the
optimizations and lowerings won't happen.

Of particular importance is the lowering of fisfinite.  If a shader
happens to contain fisfinite of an fp16 value, it will assert later
during compliation.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Fixes: 78b4e417d4 ("gallivm: handle fisfinite/fisnormal")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14942>
2022-02-10 03:12:46 +00:00
Emma Anholt
d633eace3f ci/freedreno: Try to detect a wedged MMU that's happened recently.
Possibly since the VK-GL-CTS 1.3.1.0 uprev.  It doesn't seem to recover,
like it says.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14945>
2022-02-10 01:13:31 +00:00
Emma Anholt
b7278b2281 ci/lvp: Add a flake that's shown up a couple of times since VKCTS 1.3.1.
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14945>
2022-02-10 01:13:31 +00:00
Emma Anholt
2d15f9e3c2 ci/r300: Drop xfails that were fixed with the VK-GL-CTS 1.3.1.0 uprev.
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14404>
2022-02-10 00:36:57 +00:00
Emma Anholt
20469009c7 nir: Delete the per-instr SSA liveness impl.
It was introduced for nir-to-tgsi, and I found that it was the wrong
approach.  There's a reason nobody else does RA this way.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14404>
2022-02-10 00:36:57 +00:00
Emma Anholt
74c02d99b2 nir_to_tgsi: Replace the NIR SSA liveness with TGSI reg-level liveness.
Allocating NIR registers ends up being required for drivers like r600 and
nv30, which don't do their own allocation (except in some cases on r600
where sb is used).

Rather than add a NIR register liveness impl
(https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14158), switch
from NIR-based liveness to just doing the same channel-based liveness
logic that the NIR registers needed at the TGSI level.  The actual
liveness code here basically comes straight out of
brw_vec4_live_variables.cpp.

Since we do the liveness in TGSI now, it also means we don't need to be
careful about not reading SSA values from later TGSI instructions (which
may be useful for doing some greedy instruction selection in generating
TGSI instructions).

i915g:
total instructions in shared programs: 400719 -> 380730 (-4.99%)
instructions in affected programs: 284760 -> 264771 (-7.02%)
total tex_indirect in shared programs: 12289 -> 12290 (<.01%)
tex_indirect in affected programs: 4 -> 5 (25.00%)
total temps in shared programs: 32172 -> 22086 (-31.35%)
temps in affected programs: 30647 -> 20561 (-32.91%)
LOST:   0
GAINED: 148

r300:
total instructions in shared programs: 1472463 -> 1459286 (-0.89%)
instructions in affected programs: 507009 -> 493832 (-2.60%)
total temps in shared programs: 212143 -> 201678 (-4.93%)
temps in affected programs: 78007 -> 67542 (-13.42%)

softpipe:
total temps in shared programs: 517071 -> 294387 (-43.07%)
temps in affected programs: 509324 -> 286640 (-43.72%)

Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14404>
2022-02-10 00:36:57 +00:00
Emma Anholt
f4ce3178d9 nir_to_tgsi: Track our TGSI insns in blocks before emitting tokens.
To do register allocation well, we want to have a point before
ureg_insn_emit() to look at the liveness of the values and allocate them
to TGSI temporaries.  In order to do that, we have to switch from
ureg_OPCODE() emitting TGSI tokens directly to a new ntt_OPCODE() that
stores the ureg args in a block structure.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14404>
2022-02-10 00:36:57 +00:00
Emma Anholt
3f84c67af8 tgsi: Refactor out a tgsi_util_get_src_usage_mask().
The function operated on a tgsi_full_instruction, but for code generation
in NIR-to-TGSI I want to reuse this logic using pieces of tgsi_ureg
structs.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14404>
2022-02-10 00:36:57 +00:00
Emma Anholt
e92209f299 i915g: Report the temps usage
This is another important metric for this driver, and we don't do our own
RA so ours is just what TGSI uses.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14404>
2022-02-10 00:36:57 +00:00
Eric Engestrom
bfcc7c20c8 docs: update calendar and link releases notes for 21.3.6
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14956>
2022-02-10 00:28:37 +00:00
Eric Engestrom
d66a22a02b docs: add release notes for 21.3.6
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14956>
2022-02-10 00:28:37 +00:00
Dylan Baker
aabc7034d7 docs: update calendar for 22.0.0-rc2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14953>
2022-02-09 20:42:46 +00:00
Danylo Piliaiev
97c90c514f turnip: Depth/stencil formats should not expose any bufferFeatures
From the Vulkan 1.3.205 spec, section 19.3 "43.3. Required Format Support":

   Mandatory format support: depth/stencil with VkImageType
   VK_IMAGE_TYPE_2D
   [...]
   bufferFeatures must not support any features for these formats

See https://gitlab.khronos.org/vulkan/vulkan/-/merge_requests/4849

Fixes CTS tests: dEQP-VK.api.buffer.invalid_buffer_features.*

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14927>
2022-02-09 20:11:22 +00:00
Samuel Pitoiset
53dc5f774d radv: only emit the per-vertex VRS state if the pipeline forced it
If the primitive shading rate is not written by the last VGT stage
(like if no FS), it's useless to emit the VRS state.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14907>
2022-02-09 17:40:37 +01:00
Samuel Pitoiset
d0171dffe1 radv: do not force per-vertex VRS if there is no pixel shader
This has no effect.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14907>
2022-02-09 17:40:37 +01:00
Samuel Pitoiset
2451290bc4 radv: rewrite RADV_FORCE_VRS directly in NIR
This introduces a small NIR pass that exports
VARYING_SLOT_PRIMITIVE_SHADING_RATE if RADV_FORCE_VRS is used,
instead of doing this in both backend compilers.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14907>
2022-02-09 17:40:34 +01:00
Juan A. Suarez Romero
7955df28a6 v3dv/ci: Update failure list
Add more failing tests to the expected failures.

These are obtained after executing the full Vulkan CTS.

v2:
 - Add comments in the tests (Alejandro)

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14948>
2022-02-09 15:46:23 +00:00
Mike Blumenkrantz
5d7bae5ab3 zink: ci updates
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14852>
2022-02-09 09:13:37 -05:00
Mike Blumenkrantz
63fa2ab978 zink: add Sample decorations to fragment shader inputs with sample shading
PIPE_CAP_FORCE_PERSAMPLE_INTERP is broken for the no-attachment case, so
this is the only option

fixes (lavapipe):
KHR-GL46.sample_shading.render*
dEQP-GLES31.functional.sample_shading.min_sample_shading*

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14852>
2022-02-09 09:13:37 -05:00
Tomeu Vizoso
0cb5333a14 iris/ci: Enable Whiskey Lake boards by default
The boards should be stable now.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14822>
2022-02-09 13:16:25 +00:00
Qiang Yu
fe560aeb12 radeonsi: workaround Specviewperf13 Catia hang on GFX9
The root cause is unknown but PAL always update IA_MULTI_VGT_PARAM
whenever primitive type change.

cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Singed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14944>
2022-02-09 12:51:38 +00:00
Jordan Justen
e2cd0c3a3c intel/fs: Assert that old pull-const code is not used if devinfo->has_lsc
Jason changed this to use LSC in:

f5876dfdb9 ("intel/fs: Lower uniform pull constant load message to LSC dataport")

Cc: 22.0 <mesa-stable>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14384>
2022-02-09 10:39:17 +00:00
Tapani Pälli
562f7eef5b iris: invalidate L3 read only cache when VF cache is invalidated
When enabling the caching of index,vertex data in the L3 RO Cache
(L3BypassDisable), we need to use L3ReadOnlyCacheInvalidationEnable
to invalidate cache when buffer is modified by CPU/GPU.

Ref: bspec 46314
Fixes: ed8f2c4cbe ("iris: Cache VB/IB in L3$ for Gen12")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14815>
2022-02-09 10:05:10 +00:00
Tapani Pälli
7a6ea04795 anv: invalidate L3 read only cache when VF cache is invalidated
When enabling the caching of index,vertex data in the L3 RO Cache
(L3BypassDisable), we need to use L3ReadOnlyCacheInvalidationEnable
to invalidate cache when buffer is modified by CPU/GPU.

Ref: bspec 46314
Fixes: 6c345ddbe4 ("anv: Cache VB/IB in L3$ for Gfx12")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5941
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14815>
2022-02-09 10:05:10 +00:00
Tapani Pälli
442628b702 intel/genxml: add PIPE_CONTROL field for L3 read only cache invalidation
Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14815>
2022-02-09 10:05:10 +00:00
Rohan Garg
03e1e19246 anv: Refactor descriptor copy
Refactor descriptor copies to use the existing helper functions instead
of rolling our own. In order to facilitate this, we need to store the
appropriate buffer views for the relevant descriptors internally and
reuse them in the helpers.

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/14909>
2022-02-09 09:24:37 +00:00
Samuel Pitoiset
6fba52cfd2 radv: allow RADV_FORCE_VRS with pipeline VRS declared as dynamic
This is for vkd3d which needs to always declare the VRS dynamic state
because it's fully dynamic in DX12. Ignoring the VRS dynamic state
when it's a no-op seems the best way to handle this, although it's
definitely not perfect.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14910>
2022-02-09 08:17:17 +00:00
Kenneth Graunke
413ea503ba iris: Disable PIPE_CAP_PREFER_BACK_BUFFER_REUSE
This cap bit only affects DRI_PRIME setups.  Since iris now uses the
blitter to perform dGPU -> iGPU copies asynchronously, it's better to
always use at least two backbuffers so the 3D engine can start rendering
the next frame during the copy.

See commit d17e752857 where this change
was made for radeonsi.

Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13877>
2022-02-09 07:45:43 +00:00
Kenneth Graunke
e3cb620b55 iris: Use the hardware blitter for DRI PRIME blits
In a hybrid graphics setup, Mesa allocates two buffers for the window
surface.  The first is what the discrete card renders to; it lives in
VRAM and is usually tiled and possibly compressed.  The second is a
shadow copy that lives in system memory (readable by the integrated
card with the displays); it's usually linear and uncompressed.

Mesa's window system code schedules blits to update the shadow copy
when needed, typically at the end of a frame.  These can be fairly
costly when running a full-screen application at high resolutions.

We'd like to use the blitter for these copies, as it lets us perform
the copy asynchronously, letting the 3D engine race ahead and start
rendering the next frame.  If we used the 3D engine, the next frame
could not start rendering until the PRIME blit finishes, giving us
less time to draw the frame.  Fortunately, Tigerlake introduced new
blitter commands which can operate at full memory bandwidth.

DRI PRIME blits happen via the Gallium blit() hook.  We can detect that
case by looking for the PIPE_BIND_PRIME_BLIT_DST flag on the destination
resource.  This patch detects that case and calls iris_copy_region() on
IRIS_BATCH_BLITTER to handle it.  We know a priori that the blitter can
handle this operation (it's not a scaled blit, the formats match and
should not be 96bpp, there's no combined depth stencil, or other weird
edge cases).  blorp_copy() will also assert that edge cases don't occur.

Together with the next patch, this improves performance on DG1 Hybrid
scenarios by about 5-6%.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13877>
2022-02-09 07:45:43 +00:00
Kenneth Graunke
f9eba6e2b5 iris: Allow IRIS_BATCH_BLITTER in iris_copy_region()
This updates iris_copy_region() to support using the blitter batch.
(Future patches will actually do so; for now, we keep using render.)

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13877>
2022-02-09 07:45:43 +00:00
Melissa Wen
70a219d4a3 broadcom/simulator: enable multisync in the simulator
Use drmSyncobjSignal to signal out_syncobjs when a GPU job submission
ends in the simulator. With this, we can enable multisync support in the
simulator and keep the multisync approach to process fence by submitting
a serialized no-op job that adds the fence to the array of out syncobjs,
i.e.  syncobjs to be signaled in the kernel when a job completes (job
post deps).

Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14768>
2022-02-09 07:22:42 +00:00
Ilia Mirkin
5200e1c212 translate: improve sse2 32-bit unsigned -> float conversion
The existing logic would drop the low bit. Instead, let's drop the high
bit, do the conversion, and then add the fixed constant back in if the
value had the high bit set originally.

Fixes KHR-GL45.direct_state_access.vertex_arrays_attribute_format on
drivers that use this module to handle the format conversion.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Emma Anholt <emma@anholt.net>
Tested-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14922>
2022-02-09 06:04:25 +00:00
Ilia Mirkin
0b69f7b15d rtasm: add pcmpgtd operation
This will be used shortly by the translate code. Available in SSE2.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Emma Anholt <emma@anholt.net>
Tested-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14922>
2022-02-09 06:04:25 +00:00
Ilia Mirkin
55b735c51a rtasm: fix printf specifier for ptrdiff_t
In practice it's a small number, but new gcc versions complain.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Emma Anholt <emma@anholt.net>
Tested-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14922>
2022-02-09 06:04:25 +00:00
Mike Blumenkrantz
7d1727079c zink: ci updates
hooray

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14932>
2022-02-09 05:11:40 +00:00
Erik Faye-Lund
883017b67e zink: do not copy colors through floats
Copying per compoents might flush NaN values, leading to changes in the
values, so it'd be safer to copy as unsigned integers here. But in one
of the cases here we can do even better, and just copy the whole damn
union instead.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14932>
2022-02-09 05:11:40 +00:00
Jason Ekstrand
745fc95659 zink: Re-interpret formats when using vkCmdClearColorImage()
vkCmdClearColorImage() doesn't take a view format so it always uses the
underlying format of the image.  If there's texture views going on, we
need to manually mangle the colors into the image format.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14932>
2022-02-09 05:11:40 +00:00
Ilia Mirkin
86eaff29c0 st/mesa: only enable ARB_enhanced_layouts if there are xfb buffers
It really doesn't make sense without any xfb support. One could limp
along, but our validation does not work as-is. Doesn't seem important to
support this use-case.

This disables GL_ARB_enhanced_layouts on crocus with gen4/5.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14869>
2022-02-09 03:31:16 +00:00
Ilia Mirkin
13c6f401cc glsl: only validate xfb_buffer values when we have enhanced layouts
XFB might not be supported, and the shader wouldn't be setting this
flag. But validation would still fail, since the number of xfb buffers
would be 0. So only validate if an xfb_buffer is set in the qualifiers.

See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5415
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14869>
2022-02-09 03:31:16 +00:00
Ilia Mirkin
c17a3392c4 glsl: simplify conditions for setting various allowed flags
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14869>
2022-02-09 03:31:16 +00:00
Emma Anholt
2883e8f33d nir_to_tgsi: Add a flag for lowering fabs, and use it in r300/i915.
Saves instructions if the same fabs value is used multiple times.

i915g:
total instructions in shared programs: 397005 -> 396525 (-0.12%)
instructions in affected programs: 11061 -> 10581 (-4.34%)
LOST:   0
GAINED: 22

r300 (not r500):
total instructions in shared programs: 180286 -> 179767 (-0.29%)
instructions in affected programs: 27102 -> 26583 (-1.91%)
total temps in shared programs: 29692 -> 29638 (-0.18%)
temps in affected programs: 356 -> 302 (-15.17%)

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14938>
2022-02-08 18:50:01 -08:00
Emma Anholt
f4ee7146f9 nir: Split the flag for lowering of fabs and fneg to source modifiers.
i915 and r300 have fneg source modifier but not fabs, and doing it in NIR
can save us some backend pain.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14938>
2022-02-08 18:50:01 -08:00
Emma Anholt
bd24f418c3 r300: Throw a compile error instead of an assert in r300 swizzle rewrites.
I hit this on shader-db, but I really just want to get stats for unrelated
changes.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14938>
2022-02-08 18:50:01 -08:00
Emma Anholt
4968f8c066 r300: Demote a compiler assert(0) to a compile failure.
This triggers in shader-db and doesn't have an obvious fix.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14938>
2022-02-08 18:50:01 -08:00
Jesse Natalie
97d13b2deb d3d12: Fix take_ownership semantic for constant buffers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14941>
2022-02-09 02:14:34 +00:00
Emma Anholt
d52d500f17 r300: Request that nir-to-tgsi avoid generating TGSI_OPCODE_CMP.
Given that our fcsels are on float-bools, we can emit the LRP directly and
save the backend having to emit a SLT to turn the CMP src[0] into a bool.

This required passing a codegen flags struct for nir-to-tgsi.  I think
this is a good way forward for it, as the alternative I think has mostly
been adding flags to nir_shader_compiler_options (since adding
PIPE_SHADER_CAPs is an unreasonable amount of pain).

r300 shader-db:
total instructions in shared programs: 1484320 -> 1472463 (-0.80%)
instructions in affected programs: 243588 -> 231731 (-4.87%)
total temps in shared programs: 212485 -> 212143 (-0.16%)
temps in affected programs: 3845 -> 3503 (-8.89%)

Acked-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14886>
2022-02-09 01:19:13 +00:00
Dave Airlie
4a1ba7914a ci/lavapipe: update lvp asan results after leak fixes.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14939>
2022-02-09 09:55:50 +10:00
Dave Airlie
2f9089f6de lavapipe: fix sampler + sampler view leaks.
The compute sampler views are using a different method
of generation so have to be deleted explicitly.

Fixes: e94fd4cc65 ("lavapipe: rename vallium to lavapipe")

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14939>
2022-02-09 09:54:21 +10:00
Pavel Ondračka
1f5330de3a r300: fix transformation of abs modifiers with negate
It is being overwritten by the memset. Just set the only remaining
member RelAddr explicitly.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip.gawin@zoho.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14915>
2022-02-08 22:54:02 +00:00
Emma Anholt
ef112db311 ci: Bump VK-GL-CTS to 1.3.1.0.
The main thing is VK 1.3 testing, but also includes test bugfixes.  The
1.3 CTS required an uprev of deqp-runner to handle a new style of test
output, and that deqp-runner brings in some neat new features, too (piglit
in your deqp-runner suite, and extension list checking).

A bunch of VK tests got renamed, so I replaced panvk's custom test list
with simple include filters on the main test list.

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> (panvk)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14920>
2022-02-08 22:16:36 +00:00
Emma Anholt
3f34251495 ci/broadcom: Remove unused v3dv xfails file.
It's actually in broadcom-rpi4-fails.txt.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14920>
2022-02-08 22:16:35 +00:00
Emma Anholt
648dd03e32 ci/panfrost: Add a flake a few of us have run into in the last couple days.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14920>
2022-02-08 22:16:35 +00:00
Jesse Natalie
60775780ae d3d12: Allow 8bit index buffer conversions by vbuf
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>
2022-02-08 20:36:29 +00:00
Jesse Natalie
52766e020f d3d12: Use CPU storage in TC for buffers
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>
2022-02-08 20:36:29 +00:00
Jesse Natalie
96d68cb300 d3d12: Add a buffer busy callback to the bufmgr
Not all cached buffers can be mapped, so using map with do-not-wait
is a terrible heuristic. Use an explicit buffer busy callback which
is always false, since buffers are only put into the cache once they're
free.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>
2022-02-08 20:36:29 +00:00
Jesse Natalie
9d6febad5d d3d12: Actually suballocate and cache buffers
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>
2022-02-08 20:36:29 +00:00
Jesse Natalie
d0f4f8efae d3d12: Fix offset for buf/image copies with suballocated buffers
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>
2022-02-08 20:36:29 +00:00
Jesse Natalie
fb08bc8d76 d3d12: Don't suballocate TBO buffers
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>
2022-02-08 20:36:29 +00:00
Jesse Natalie
58a9a63d9e d3d12: Fix TBOs from suballocated buffers
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>
2022-02-08 20:36:29 +00:00
Jesse Natalie
c35f77aa84 d3d12: Delete make_resource_writeable
This never did anything useful AFAICT since we didn't actually
suballocate buffers, and when this ended up being invoked it breaks
the ability to read back XFB data.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>
2022-02-08 20:36:29 +00:00
Jesse Natalie
caae9b0e1f d3d12: Always respect offsets when mapping a bo, not just when there's a range
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>
2022-02-08 20:36:29 +00:00
Jesse Natalie
b48aea0ec8 d3d12: Fix range calculation for suballocated buffers in d3d12_bo_unmap
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>
2022-02-08 20:36:29 +00:00
Jesse Natalie
2659098d6d d3d12: Fix set constant buffers
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>
2022-02-08 20:36:29 +00:00
Jesse Natalie
7ec0e2b893 tc: CPU storage needs to be freed with align_free
Cc: mesa-stable
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>
2022-02-08 20:36:29 +00:00
Alyssa Rosenzweig
12446491c1 panfrost: Fix Depth Source enum
As I suspected... sigh.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14935>
2022-02-08 20:27:09 +00:00
Alyssa Rosenzweig
32e58c2dd4 panfrost: Remove unused layout enums
Folded into Valhall-specific plane descriptor enums.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14935>
2022-02-08 20:27:09 +00:00
Alyssa Rosenzweig
d27d46a266 panfrost: Remove some indexed formats on Valhall
Block compressed formats like ETC2 are now indicated in the plane descriptor,
rather than the pixel format descriptor. Various other minor formats were
removed in Valhall; remove them from the XML so we don't accidentally try to use
them.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14935>
2022-02-08 20:27:09 +00:00
Alyssa Rosenzweig
8c51b54bd1 panfrost: Update supported job types
Remove a few that no longer exist, and rename IDVS helper to Malloc Vertex. The
distinction between Malloc Vertex jobs and regular Indexed Vertex jobs is that
the hardware allocates varying buffers dynamically for Malloc Vertex jobs.
Regular IDVS and even legacy tiler jobs are also supported where desired.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14935>
2022-02-08 20:27:09 +00:00
Alyssa Rosenzweig
d70a48a706 panfrost: Flesh out tiler heap descriptor
Merged with the Buffer descriptor, hence why it shares a type nibble. However,
Bifrost uses a dedicated tiler heap descriptor, and I see no benefit to merging.
So pretending it's a dedicated descriptor on Valhall too allows us to reuse the
Bifrost code with no modifications.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14935>
2022-02-08 20:27:09 +00:00
Alyssa Rosenzweig
62173fa532 panfrost: Strip % in GenXML names
A new Valhall enum will represent percentages, so allow that.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14935>
2022-02-08 20:27:09 +00:00
Alyssa Rosenzweig
e514f4c0b1 panfrost: Flesh out Buffer descriptor
Add fields required for structured buffers.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14935>
2022-02-08 20:27:09 +00:00
Jason Ekstrand
4c61c8a0b8 vulkan,lavapipe: Simplify command recording code-gen
The Entrypoint class already has utilities for gettingt he parameter
list as either declarations or as comma-separated argument names for a
call.  Use that instead of hand-rolling it.  The only modification we
need to make is to add the ability to start the list somewhere other
than at the beginning.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14919>
2022-02-08 19:50:57 +00:00
Mike Blumenkrantz
cb781fc350 lavapipe: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14911>
2022-02-08 18:38:20 +00:00
Mike Blumenkrantz
1532556eb0 zink: ci updates
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14911>
2022-02-08 18:38:20 +00:00
Mike Blumenkrantz
08c2b9d7cb lavapipe: use util_pack_color_union() for generating clear colors
this enables clamping for packed formats (e.g., RGB10_A2UI) where color
values may exceed the width of the component

cc: mesa-stable

fixes (zink):
KHR-GL45.direct_state_access.renderbuffers_storage*

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14911>
2022-02-08 18:38:20 +00:00
Emma Anholt
6faaeca584 ci/freedreno: Add another unsizedArrayLength flake.
Started appearing on Feb 1, but given that the rest of this test group
flakes, I assume it's similar.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14934>
2022-02-08 18:04:37 +00:00
Andrii Pauk
cf4de7d8ff venus: Allow usage of virtio-mmio based device
Libdrm reports bustype as DRM_BUS_PLATFORM for virtio-mmio
based device. DRM_BUS_PCI is reported only for virtio-pci based
devices. Add possibility to use devices with DRM_BUS_PLATFORM.

Signed-off-by: Andrii Pauk <Andrii.Pauk@opensynergy.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14531>
2022-02-08 17:53:21 +00:00
Daniel Schürmann
5e9df85b1a aco: optimize discard_if when WQM is not needed afterwards
Totals from 11560 (8.57% of 134913) affected shaders: (GFX10.3)
CodeSize: 12092560 -> 11997652 (-0.78%)
Instrs: 2205325 -> 2181598 (-1.08%)
Latency: 15376048 -> 15356958 (-0.12%); split: -0.12%, +0.00%
InvThroughput: 3526105 -> 3525120 (-0.03%); split: -0.03%, +0.00%
Copies: 98543 -> 87601 (-11.10%)
Branches: 16919 -> 16873 (-0.27%)
PreSGPRs: 291584 -> 291532 (-0.02%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14805>
2022-02-08 16:16:07 +00:00
Daniel Schürmann
13c3137960 aco: merge block_kind_uses_[demote|discard_if]
These serve the same purpose. The new name is
block_kind_uses_discard.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14805>
2022-02-08 16:16:07 +00:00
Daniel Schürmann
e7d1c8cc5e aco: make Preserve_WQM independent from block_kind_uses_discard_if
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14805>
2022-02-08 16:16:07 +00:00
Daniel Schürmann
08b8500dfb aco: remove block_kind_discard
This case doesn't seem to happen in practice.
No need to micro-optimize it.

This patch merges instruction selection for discard/discard_if.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14805>
2022-02-08 16:16:07 +00:00
Daniel Schürmann
b67092e685 aco: emit nir_intrinsic_discard() as p_discard_if()
This simplifies the code and emits a slightly better
sequence in some cases.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14805>
2022-02-08 16:16:07 +00:00
Charles Baker
1895e17591 mesa: align constant/uniform uploads to driver expected alignment
This fixed a problem for Zink where uniform buffer alignment varies by
GPU, e.g. 64 bytes for an RTX 2070 SUPER but 256 bytes for a GTX 1070
Ti.

Tested running Superposition on Windows 10 with Nvidia 1070 Ti with
496.13 driver.  Without the fix Superposition soft locks on its splash
screen.  With the fix Superposition runs through its benchmark.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14674>
2022-02-08 15:08:21 +00:00
Charles Baker
418c77640b zink: Fix MSVC RTC in zink_get_framebuffer_imageless()
The bit fields in zink_framebuffer_state cause a false positive with
MSVC's run-time checks enabled.  setting state.num_attachments in
zink_get_framebuffer_imageless().  Writing some bits of num_attachments
involves reading bits from layers and samples that haven't been
initialized.

Fixed by assigning to num_attachments earlier in the function.  Not
quite sure why that makes a difference but at a guess there's a
heuristic that considers assignment close to declaration as
initialization.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14566>
2022-02-08 14:43:00 +00:00
Mike Blumenkrantz
86cb664cd8 zink: export PIPE_CAP_CULL_DISTANCE_NOCOMBINE
fixes:
KHR-GL46.cull_distance.functional

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14878>
2022-02-08 14:03:09 +00:00
Mike Blumenkrantz
7e9481eaac gallium: add PIPE_CAP_CULL_DISTANCE_NOCOMBINE
for drivers where separate cull distance variables are required, this
lets them avoid having to write yet another pass to undo gallium's mangling
of shader info

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14878>
2022-02-08 14:03:09 +00:00
Lionel Landwerlin
93a90fc85d anv: fix conditional render for vkCmdDrawIndirectByteCountEXT
We just forgot about conditional render for this entry point.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 2be89cbd82 ("anv: Implement vkCmdDrawIndirectByteCountEXT")
Tested-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14891>
2022-02-08 13:33:38 +00:00
Lionel Landwerlin
5d3e419378 anv: enable ray queries
Only on platforms that support it.

v3: Split out code setting up ray query shadow buffer (Caio)
    Don't forget to setup ray query globals even when no shadow buffer
    is used (Lionel)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13719>
2022-02-08 12:55:25 +00:00
Lionel Landwerlin
c78be5da30 intel/fs: lower ray query intrinsics
v2: Add helper for acceleration->root_node computation (Caio)

v3: Update comment on "done" bit (Caio)
    Remove progress bool value for impl function (Caio)
    Don't use nir_shader_instructions_pass to search the shader (Caio)

v4: Rename variable for if/else block (Caio)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13719>
2022-02-08 12:55:25 +00:00
Lionel Landwerlin
712d8fb043 intel/nir: document RT builder
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13719>
2022-02-08 12:55:25 +00:00
Lionel Landwerlin
e06f9d49bc nir/lower_shader_calls: consider relocated constants as rematerializable
After all they're constants.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13719>
2022-02-08 12:55:25 +00:00
Lionel Landwerlin
0465714790 intel/nir/rt: add more helpers for ray queries
v2: Split stack_id helper in sync/async version (Caio)
    Fixup a few bit field mistake (Caio)
    Simplify some bitfield manipulations (Caio)

v3: Remove duplicated helper (Caio)
    Simplify brw_nir_rt_set_dword_bit_at (Caio)
    Comment brw_nir_rt_query_mark_init (Lionel)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13719>
2022-02-08 12:55:25 +00:00
Lionel Landwerlin
d5b994ec8a intel/nir/rt: make RT manipulation helpers helper invocations ready
Since we need to be able to perform ray queries in helper invocations,
we need to have all the helpers properly tag their load/store
operations so that they operate in helper lanes.

v2: Switch from macros to inline functions (Caio)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13719>
2022-02-08 12:55:25 +00:00
Lionel Landwerlin
fb69fed65b intel/nir: document committed argument
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13719>
2022-02-08 12:55:25 +00:00
Lionel Landwerlin
b0624e414f intel/fs: make trivial shader complete tracing operations with missing shaders
v2: Apply workaround only on < DG2-512-C0 & < DG2-128-B0

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13719>
2022-02-08 12:55:25 +00:00
Lionel Landwerlin
35bd19f53d intel/nir/rt: load bvh_level value off mem_hit structure
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13719>
2022-02-08 12:55:25 +00:00
Lionel Landwerlin
6d9ae6ec1e intel: add a new intrinsic to get the shader stage from bindless shaders
We'll use this to apply ray tracing operations in our trivial return
shader based on the stage we're in.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13719>
2022-02-08 12:55:25 +00:00
Lionel Landwerlin
b8f087b0e6 nir/builder: add nir_ior_imm() helper
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13719>
2022-02-08 12:55:25 +00:00
Lionel Landwerlin
bb40e999d1 intel/nir: use a single intel intrinsic to deal with ray traversal
In the future we'll want to reuse this intrinsic to deal with ray
queries. Ray queries will use a different global pointer and
programmatically change the control/level arguments of the trace send
instruction.

v2: Comment on barrier after sync trace instruction (Caio)
    Generalize lsc helper (Caio)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13719>
2022-02-08 12:55:25 +00:00
Lionel Landwerlin
39f6cd5d79 intel/nir: fix shader call lowering
We're replacing a generic instruction by an intel specific one, we
need to remove the previous instruction.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c5a42e4010 ("intel/fs: fix shader call lowering pass")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13719>
2022-02-08 12:55:25 +00:00
Lionel Landwerlin
2665595244 intel/fs: limit FS dispatch to SIMD16 when using ray queries
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13719>
2022-02-08 12:55:25 +00:00
Lionel Landwerlin
57eed6698b intel/compiler: tracker number of ray queries in prog_data
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13719>
2022-02-08 12:55:25 +00:00
Lionel Landwerlin
9b366243ed intel/fs: load more fields from BVH instance leafs
v2: Fixup mask (Caio)
    Drop old comment (Caio)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13719>
2022-02-08 12:55:24 +00:00
Lionel Landwerlin
c89024e446 intel/fs: don't set allow_sample_mask for CS intrinsics
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 77486db867 ("intel/fs: Disable sample mask predication for scratch stores")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13719>
2022-02-08 12:55:24 +00:00
Lionel Landwerlin
9d22f8ed23 intel/fs: add support for ACCESS_ENABLE_HELPER
v2: Factor out fragment shader masking on send messages (Caio)
    Update comments (Caio)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13719>
2022-02-08 12:55:24 +00:00
Lionel Landwerlin
c199f44d17 intel/fs: name sources for A64 opcodes
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13719>
2022-02-08 12:55:24 +00:00
Lionel Landwerlin
23ce94ff7e intel/nir/rt: add a new number of SIMD lanes per DSS helper
v2: Add prefix brw_nir_rt (Caio)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13719>
2022-02-08 12:55:24 +00:00
Lionel Landwerlin
61c9b7a82e intel/fs: add support for Eu/Thread/Lane id
This index will be used for accessing ray query data in memory.

v2: Drop a MOV (Caio)

v3: Rework back code emission (Caio)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13719>
2022-02-08 12:55:24 +00:00
Lionel Landwerlin
3dabe93257 intel/fs: rework dss_id opcode into generic opcode
We'll want different types of IDs based on topology. Let's make this
more flexible and also move the bit shifting code a layer above where
it's easier to do bitshifting operations, especially if you need to
stash things into temporary registers.

v2: Keep previous comment.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13719>
2022-02-08 12:55:24 +00:00
Lionel Landwerlin
4deb8e86df nir: change intel dss_id intrinsic to topology_id
This will allow to reuse the same intrinsic for various topology based
ID.

v2: fix intrinsic comment (Caio)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13719>
2022-02-08 12:55:24 +00:00
Lionel Landwerlin
fdb74a77d2 intel/ds: fix compilation with perfetto
Forgot to test with perfetto...

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 9da3d714b8 ("anv: add dynamic rendering traces")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5992
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Tested-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14914>
2022-02-08 12:29:21 +00:00
Dylan Baker
a52e4871fe meson: add radv to meson devenv
I either rebased this out of the original PR, just failed to commit it
and then reset it.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14879>
2022-02-07 21:22:12 -08:00
Mike Blumenkrantz
8335fdfeaf vk/sync: add asserts for timeline semaphore count matching
spec requires that the number of timeline waits/signals matches the
base number of waits/signals if there are any timeline semaphores
being processed by the submit, so asserting here is in line with what
validation will yield

failure to match these will also hang every driver I've tested, so asserting
here potentially saves some people their desktop session

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14741>
2022-02-08 04:09:13 +00:00
Mike Blumenkrantz
388f23eabe zink: min/max blit region in coverage functions
these regions might not have the coords in the correct order, which will
cause them to fail intersection tests, resulting in clears that are never
applied

cc: mesa-stable

fixes:
GTF-GL46.gtf30.GL3Tests.framebuffer_blit.framebuffer_blit_functionality_all_buffer_blit
GTF-GL46.gtf30.GL3Tests.framebuffer_blit.framebuffer_blit_functionality_color_and_depth_blit
GTF-GL46.gtf30.GL3Tests.framebuffer_blit.framebuffer_blit_functionality_color_and_stencil_blit
GTF-GL46.gtf30.GL3Tests.framebuffer_blit.framebuffer_blit_functionality_linear_filter_color_blit
GTF-GL46.gtf30.GL3Tests.framebuffer_blit.framebuffer_blit_functionality_magnifying_blit
GTF-GL46.gtf30.GL3Tests.framebuffer_blit.framebuffer_blit_functionality_minifying_blit
GTF-GL46.gtf30.GL3Tests.framebuffer_blit.framebuffer_blit_functionality_missing_buffers_blit
GTF-GL46.gtf30.GL3Tests.framebuffer_blit.framebuffer_blit_functionality_nearest_filter_color_blit
GTF-GL46.gtf30.GL3Tests.framebuffer_blit.framebuffer_blit_functionality_negative_dimensions_blit
GTF-GL46.gtf30.GL3Tests.framebuffer_blit.framebuffer_blit_functionality_negative_height_blit
GTF-GL46.gtf30.GL3Tests.framebuffer_blit.framebuffer_blit_functionality_negative_width_blit
GTF-GL46.gtf30.GL3Tests.framebuffer_blit.framebuffer_blit_functionality_scissor_blit

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14867>
2022-02-08 03:42:01 +00:00
Mike Blumenkrantz
b656ab75a6 zink: reject invalid draws
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14859>
2022-02-08 03:29:45 +00:00
Mike Blumenkrantz
e38c13830f zink: fix PIPE_CAP_TGSI_BALLOT export conditional
this requires VK_EXT_shader_subgroup_ballot

cc: mesa-stable

fixes (lavapipe):
KHR-GL46.shader_ballot_tests.ShaderBallotAvailability
KHR-GL46.shader_ballot_tests.ShaderBallotFunctionRead

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14858>
2022-02-08 03:16:06 +00:00
Mike Blumenkrantz
8907964dcd zink: export PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED
this is supported and has been for a while

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14858>
2022-02-08 03:16:06 +00:00
Pierre-Eric Pelloux-Prayer
413bf889e7 radeonsi/blit: relax conditions to use sdma copy for prime buffers
We don't need to check if it's imported: PIPE_BIND_DRI_PRIME is enough.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14615>
2022-02-08 00:13:07 +00:00
Pierre-Eric Pelloux-Prayer
3b27ad1504 radeonsi: create prime buffers as uncached
8791e831b1 marked imported prime buffers as uncached (useful when prime
buffer is allocated by the display GPU), but they should also be created
as uncached (useful when allocated by the render GPU).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14615>
2022-02-08 00:13:07 +00:00
Pierre-Eric Pelloux-Prayer
18c38bf78f gallium: rename PIPE_BIND_DRI_PRIME
The new name PIPE_BIND_PRIME_BLIT_DST is more precise.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14615>
2022-02-08 00:13:07 +00:00
Pierre-Eric Pelloux-Prayer
42c149e36b gallium/dri: add missing PIPE_BIND_DRI_PRIME handling
e9c3dbd046 added PIPE_BIND_DRI_PRIME but it was only set when
importing a prime buffer.

This commit adds handling of this flag in the other codepath = the
one where the prime buffer is allocated by the render GPU.

With this change PIPE_BIND_DRI_PRIME is still only set for the
render GPU - the display GPU will never see this flag; a future
commit will rename it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14615>
2022-02-08 00:13:07 +00:00
Kenneth Graunke
3926be368e ci/iris: Mark qbo tests as flakes
These appear to have some kind of race condition and usually fail,
but sometimes pass.  We had already attempted to mark them as flakes
on amly, but need to mark them as flakes on KBL+ too.

See https://gitlab.freedesktop.org/mesa/mesa/-/jobs/18522605 and
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/18527737 where these
unexpectedly passed on KBL, and also where the top-level test not
being caught by the regex led to failures.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14916>
2022-02-07 14:30:52 -08:00
Zoltán Böszörményi
df1751a2bb crocus: Enable compat profile the same way as core profile
Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11756>
2022-02-07 19:41:44 +00:00
Kenneth Graunke
604d97671b iris: Add support for flushing the blitter (hackily)
To flush the blitter, we need to use MI_FLUSH_DW rather than the usual
PIPE_CONTROL we use on the 3D engine.  Most of our code is set up to
suggest flushes via PIPE_CONTROL commands, however, so we hackily just
emit MI_FLUSH_DW when they ask for any kind of PIPE_CONTROL flush.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14912>
2022-02-07 09:50:01 -08:00
Kenneth Graunke
9c5dc4985b blorp: Assert that blorp_copy() on the blitter can handle it
Safeguards against callers that don't guarantee the necessary things.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14912>
2022-02-07 09:50:01 -08:00
Kenneth Graunke
d2646e147b intel/genxml: Add missing MI_FLUSH_DW::Flush CCS field
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14912>
2022-02-07 09:50:01 -08:00
Rhys Perry
7ddad1b93a radv: fix R_02881C_PA_CL_VS_OUT_CNTL with mixed cull/clip distances
Matches radeonsi.

Seems Vulkan CTS doesn't really test cull distances. Removing
VARYING_SLOT_CULL_DIST0/VARYING_SLOT_CULL_DIST1 variables doesn't break
any of dEQP-VK.clipping.*, except for tests which read the variables in
the fragment shader.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5984
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14882>
2022-02-07 12:36:38 +00:00
Danylo Piliaiev
44bdac9849 tu: Implement VK_AMD_buffer_marker to support Graphics Flight Recorder
Graphics Flight Recorder is:
 "The Graphics Flight Recorder (GFR) is a Vulkan layer to help
  trackdown and identify the cause of GPU hangs and crashes.
  It works by instrumenting command buffers with completion tags."

This is a nice little tool which could help quickly identify the call
which hanged. Or if command buffer is executed for too long.

The tiling nature of our GPU shouldn't be a big issue aside from
lower performance.

For non-segfault case, if:
- Hang happens at the same place in cmdbuf and draw/dispatch is not
  finished at that point - it is likely that there is an infinite
  loop in some of the shaders in this draw.
- Hang happens always in different place - likely there is nothing
  wrong and command buffer just takes too long to execute and you
  should try increasing hangcheck_period_ms. If it doesn't help
  it is likely a synchronization issue.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13553>
2022-02-07 12:53:34 +02:00
Daniel Stone
b561946497 egl/wayland: Don't replace existing backbuffer in get_buffers
If the surface already has a current backbuffer - say through a
buffer_age query - we do not want to replace it in get_buffers, because
it means the result we'd previously returned them is stale.

If we already have a backbuffer set on the surface, keep it locked in no
matter what until we hit SwapBuffers.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14873>
2022-02-07 09:57:41 +00:00
Daniel Stone
3da8300562 egl/wayland: Reset buffer age when destroying buffers
A buffer age of 0 means that the buffer is uninitialised or has unknown
content. We rely on the buffer age initially being 0 through zalloc when
the surface is first created; when they are first used for a swap, we
set their age to 1, and then we increment the age of every buffer in the
chain with a non-zero age when we swap.

Now that we can release buffers, both through dmabuf-feedback as well as
detecting when we're using a deeper swapchain than the compositor needs,
make sure to reset their age as they are released. Without doing this,
the age will stay as it was before it was released and be incremented,
returning the wrong age to the user the first time a previously-released
buffer slot has been reused.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5977
Fixes: 22d796feb8 ("egl/wayland: break double/tripple buffering feedback loops")
Fixes: b5848b2dac ("egl/wayland: use surface dma-buf feedback to allocate surface buffers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14873>
2022-02-07 09:57:41 +00:00
Emma Anholt
fa4390f7bf ci/iris: Add skips and flakes notes for recent #intel-ci logs.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14904>
2022-02-07 09:33:59 +00:00
Emma Anholt
0cf32b5079 ci/crocus: Add recent flakes from #intel-ci
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14904>
2022-02-07 09:33:59 +00:00
Emma Anholt
6423045957 ci/softpipe,llvmpipe: Disable Xvfb server reset on piglit runs.
The resets take time that we don't need to spend.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14904>
2022-02-07 09:33:59 +00:00
Samuel Pitoiset
9ea4029f9f Revert "radv: re-apply "Do not access set layout during vkCmdBindDescriptorSets.""
The most famous RADV revert over the past months. This was an issue
in RADV and not an use-after-free (descriptor set layouts can be
destroyed almost at any time).

This reverts commit b775aaff1e.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14621>
2022-02-07 08:24:36 +01:00
Samuel Pitoiset
66f7289d56 radv: add reference counting for descriptor set layouts
The spec states that descriptor set layouts can be destroyed almost
at any time:

   "VkDescriptorSetLayout objects may be accessed by commands that
    operate on descriptor sets allocated using that layout, and those
    descriptor sets must not be updated with vkUpdateDescriptorSets
    after the descriptor set layout has been destroyed. Otherwise,
    descriptor set layouts can be destroyed any time they are not in
    use by an API command."

Based on ANV.

Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5893
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14621>
2022-02-07 08:24:36 +01:00
Dave Airlie
37c3be6947 crocus: find correct relocation target for the bo.
If we have batch a + b, and writing to batch b, causes batch a
to flush, all the bo->index get reset, and we try to submit a -1
to the kernel.

Look the bo index up when creating relocations.

Fixes crash seen in KHR-GL46.compute_shader.pipeline-post-fs
and a trace from Wasteland 3

Fixes: f3630548f1 ("crocus: initial gallium driver for Intel gfx 4-7")

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14905>
2022-02-07 18:01:36 +10:00
Zoltán Böszörményi
d774059a0c crocus: enable GL46 tests for HSW in ci
Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14889>
2022-02-06 23:46:28 +00:00
Alyssa Rosenzweig
0299600efb asahi: Fix memory unsafety in delete_sampler_state
The type is wrong, masked by a void*, meaning the free is completely
wrong. ASan is rightfully unhappy. Fixes crashes destroying the context.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14901>
2022-02-06 15:46:55 -05:00
Alyssa Rosenzweig
786871c87e agx: Don't kill helper threads in ld_var
Apparently this is yet another .kill bit. Fixes:

dEQP-GLES3.functional.shaders.derivate.dfdx.linear.*
dEQP-GLES3.functional.shaders.derivate.dfdy.linear.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14899>
2022-02-06 15:02:39 +00:00
Alyssa Rosenzweig
367d93bcd4 agx: Handle texture array indices
These need to be converted to integers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14899>
2022-02-06 15:02:39 +00:00
Alyssa Rosenzweig
b459473bb9 agx: Implement nir_op_txb
Like explicit LODs, biases must be 16-bit, so add a lowering rule for
this. With the LOD mode selection updated for txb, we can then ingest
biases like explicit LODs and allowlist txb. Passes:

dEQP-GLES2.functional.shaders.texture_functions.fragment.texture2d_bias
dEQP-GLES2.functional.texture.mipmap.2d.bias.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14899>
2022-02-06 15:02:39 +00:00
Alyssa Rosenzweig
e2903f66ec agx: Translate LOD modes more generically
Now includes support for auto_load_bias mode.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14899>
2022-02-06 15:02:39 +00:00
Alyssa Rosenzweig
d5b7d629d7 agx: Add AUTO_LOD_BIAS mode
Automatic load with a bias.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14899>
2022-02-06 15:02:39 +00:00
Alyssa Rosenzweig
93f2ae1205 asahi: Correctly set IOGPU_ATTACHMENT::size
Not sure what this is used for, but let's not lie to the kernel.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14898>
2022-02-06 09:48:34 -05:00
Alyssa Rosenzweig
daab41b80b asahi: Identify IOGPU_ATTACHMENT::size
Oops.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14898>
2022-02-06 09:48:34 -05:00
Charmaine Lee
945a1e0b8c mesa: fix misaligned pointer returned by dlist_alloc
In cases where the to-be-allocated node size with padding exceeds BLOCK_SIZE
but without padding doesn't, a new block is not created and no padding is done
to the previous instruction, causing a misaligned pointer to be returned.

v2: Per Ilia Mirkin's suggestion, remove the extra condition in the first
    if statement, let it unconditionally pad the last instruction if needed.
    The updated currentPos will then be taken into account in the
    block size checking.

This fixes crash seen with lightsmark and Optuma apitraces

Fixes:  05605d7f53 (' mesa: remove display list OPCODE_NOP')

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Tested-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14871>
2022-02-05 22:45:01 +00:00
Neha Bhende
9230b28533 svga: store shared_mem_size in svga_compute_shader instead of svga_context
When new context was created, shared_mem_size was getting overwritten.
This fixes glretrace failure seen with manhattan, aztec and BASS2_intro
apitraces

Fixes: 247c61f2d0 ('svga: Add support for compute shader, shader buffers and image views')

Tested with glretrace, piglit

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
(cherry picked from commit dd6793ec9218782b1b716a87582d7219bae4e75f)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14870>
2022-02-05 22:17:32 +00:00
Kenneth Graunke
c7a357787f anv: Increase maxUniformBufferRange to 2^30 when not using the sampler
The limit here is from the RENDER_SURFACE_STATE height/width/depth
fields - it's 2^30 for ISL_FORMAT_RAW buffers, and 2^27 otherwise.

anv_isl_format_for_descriptor_type() uses ISL_FORMAT_R32G32B32A32_FLOAT
for uniform buffers when compiler->indirect_ubos_use_sampler is set
(Icelake and earlier), but ISL_FORMAT_RAW when it isn't (Tigerlake+).

So we can increase the limit on Tigerlake and later.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14892>
2022-02-05 11:23:16 -08:00
Pavel Ondračka
49f4f1ec22 r300: fix deadcode elimination in loops with breaks
We are updating the deadcode state while walking the program backwards.
When encountering ENDLOOP, we scan the loop, mark everything in the loop
as used and than continue as usuall. We were previously trying to be
smart with the breaks. This was however not working as expected.

Instead, save the most pesimistic deadcode state from the ENDLOOP and
just restore it anytime we see a break.

This keeps the code simple and more importantly does not touch the flat
and IF(-ELSE)-ENDIF paths at all so reduces the chances of regression.
No changes with my shader-db.

Fixes piglits on RV530:
    shaders/ssa/fs-if-def-else-break.shader_test
    spec/glsl-1.10/execution/vs-loop-array-index-unroll.shader_test

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5832
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14661>
2022-02-05 15:39:26 +01:00
Lionel Landwerlin
9da3d714b8 anv: add dynamic rendering traces
v2: Get rid of subpass_count

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14798>
2022-02-04 23:43:48 +00:00
Lionel Landwerlin
d0811ca046 anv: flush utrace before at device destroy
Ensuring any remaining traces are displayed.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14798>
2022-02-04 23:43:48 +00:00
Mike Blumenkrantz
960e72417f zink: use scanout obj when returning resource param info
embarrassing typo since the base obj has no modifier data available

cc: mesa-stable

fixes #5980

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14875>
2022-02-04 23:25:36 +00:00
Boris Brezillon
a8fbfcfbd3 pan/midg: Support 8/16 bit load/store
Needed for panvk copy shaders to support 8 or 16bit formats.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14885>
2022-02-04 17:12:35 -05:00
Boris Brezillon
59ea6e2e27 pan/midg: Add a pass to lower non-logbase2 global/shared loads
Compute shaders might do vec3(Xbits) loads which are translated
to LD.<next_pow2(3 * X)> by the midgard compiler. This might cause
out-of-bound accesses potentially leading to pagefaults if the
access is at the end of a BO. One solution to avoid that (maybe not
the best) is to split non-log2 loads to make sure we only read what's
requested.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14885>
2022-02-04 17:12:35 -05:00
Boris Brezillon
3f9bce08e1 pan/midg: Fix swizzle packing on 64bit instructions with src-expansion + dst-shrinking
In that case, the mask is specified on 32bit lanes, so we need to shift
it if it's > 0x3. The expand modifier will take care of selecting the
right side of the 32bit vector.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14885>
2022-02-04 17:12:35 -05:00
Boris Brezillon
da474d5d14 pan/midg: Fix the upper/lower limit on 8bit vectors
If I'm correct, the lower/upper split on 8bit vectors is 8, not 4.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14885>
2022-02-04 17:12:35 -05:00
Boris Brezillon
b58c262144 pan/midg: Fix 64-bit swizzle printer
Swizzling happens in 2 steps on Midgard:

1. Vector expansion/shuffling
2. Swizzling at the instruction-size granularity, but defined using
   the source size. Those size are different if the source is expanded.

So, when we print 64 bit swizzles on an expanded source, we first need
to apply an offset if the high part of the 32bit vector was selected,
and then divide the result by 2 to account for vector expansion.

To sum-up, swizzling on midgard is complicated, and I'm not sure I got
it right, but it seems to print what I expect on the few compute
shaders using 64bit arithmetic I debugged.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14885>
2022-02-04 17:12:35 -05:00
Boris Brezillon
39e4b7279d pan/midg: Fix swizzling on 8-bit sources
Even though 8-bit ALUs are not supported, we can have [un]pack_32_4x8
instructions which translate to IMOVs, and those operate on 8-bit
vectors. The problem is, the swizzling granularity is 16 bit, which
means we don't support

      MOV.i8 R0.xyzw, TMP0.xxxx, R1.zyxw

and the compiler doesn't even complain, it just applies 8 bit
swizzling directly, which obviously doesn't work.

This is probably not the right way to fix that, but I thought I'd
raised the issue with a hack to fix, so we can get the discussion
started.

(Found while debugging FB store lowering on Midgard).

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14885>
2022-02-04 17:12:35 -05:00
Boris Brezillon
65209b1adb pan/midg: Prefix scalar immediates with '#' instead of '<'
We already do that for scalar instructions, so let's do it for
vector instructions with a single component too.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14885>
2022-02-04 17:12:35 -05:00
Boris Brezillon
36bb1ac453 pan/midg: Remove spurious printf() in print_vector_constants()
Also tried to replace that one by an fprintf(fp, ...), but it pollutes
the dump too.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14885>
2022-02-04 17:12:35 -05:00
Boris Brezillon
967eb4988e pan/midg: Add intra-bundle interferences
The register allocator assumes instructions are executed sequentially
and allows one instruction to overwrite a portion of a register written
by a previous instruction if this portion is never used. But scalar and
vector ALUs might be executed in parallel if they are part of the same
bundle, and when such instructions write to the same portion of the
register file, the result is undefined.

Let's add intra-bundle interferences to avoid this situation.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14885>
2022-02-04 17:12:34 -05:00
Danylo Piliaiev
183bc15bdb turnip: Unconditionaly remove descriptor set from pool's list on free
We didn't remove desc set from the pool's list if pool was
host_memory_base. On the other hand in there is no point in removing
desc set from the list in DestroyDescriptorPool/ResetDescriptorPool.

Fixes: da7a4751
("turnip: Drop references to layout of all sets on pool reset/destruction")

Fixes cts tests:
 dEQP-VK.api.buffer_marker.graphics.default_mem.bottom_of_pipe.memory_dep.draw
 dEQP-VK.api.buffer_marker.graphics.default_mem.bottom_of_pipe.memory_dep.dispatch

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14855>
2022-02-04 21:07:30 +00:00
Jesse Natalie
81061ed645 docs: Update d3d12 features
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>
2022-02-04 20:49:23 +00:00
Jesse Natalie
444e18beaa d3d12: GL4.2
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>
2022-02-04 20:49:23 +00:00
Jesse Natalie
126d992097 d3d12: Allow RGB VS inputs without an alpha channel
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>
2022-02-04 20:49:23 +00:00
Jesse Natalie
a3a3599a08 d3d12: When adding new output varyings, write 0s
This avoids undefined behavior in some cases, and in the case
where the new output varying is actually a sysval like viewport
index, the DXIL validator will require it to be written.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>
2022-02-04 20:49:23 +00:00
Jesse Natalie
ccaa79a1ba d3d12: Don't add arrayed VS outputs when next stage uses per-vertex inputs
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>
2022-02-04 20:49:23 +00:00
Jesse Natalie
1b11113efa d3d12: Don't force a GS to be added for 'flat' sysvals
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>
2022-02-04 20:49:23 +00:00
Jesse Natalie
3feae7ec5d d3d12: Update nir varying bitmasks when linking stages
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>
2022-02-04 20:49:23 +00:00
Jesse Natalie
27deedc104 d3d12: Fix location compares in MSAA disable
Locations can only be compared against SYSTEM_VALUE_* if the var
mode is system_value.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>
2022-02-04 20:49:23 +00:00
Jesse Natalie
a26f647caa d3d12: Update depth invert to deal with multi-viewport
Turn the context state and shader key into a bitmask. When lowering
the depth invert into the shader, scan for writes to viewport index.
If found, move position to the end of the function (or current vertex)
and check if the current viewport needs the depth invert before applying.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>
2022-02-04 20:49:23 +00:00
Jesse Natalie
52b3e6be5f d3d12: Fix linkage for viewport index
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>
2022-02-04 20:49:23 +00:00
Jesse Natalie
bafa0e0369 d3d12: Bind 16 scissor rects when scissor disabled
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>
2022-02-04 20:49:23 +00:00
Jesse Natalie
929985893a d3d12: Enable BPTC (BC6/BC7)
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>
2022-02-04 20:49:23 +00:00
Jesse Natalie
918647000f microsoft/compiler: Set flag for VP/RT array index from VS/DS
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>
2022-02-04 20:49:23 +00:00
Jesse Natalie
5954c8e524 microsoft/compiler: Handle SV_ViewportArrayIndex
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>
2022-02-04 20:49:23 +00:00
Chia-I Wu
47f4cb2405 zink: set needs_mesa_flush_wsi for venus
venus relies on wsi_image_create_info and wsi_memory_signal_submit_info.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14872>
2022-02-04 19:58:40 +00:00
Chia-I Wu
737d94a545 zink: always chain wsi_image_create_info for scanout images
Chaining wsi_image_create_info tells the drivers that the image can use
VK_IMAGE_LAYOUT_PRESENT_SRC_KHR layout.  We still use
wsi_image_create_info::scanout to indicate whether this is legacy
scanout or uses modifiers.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14872>
2022-02-04 19:58:40 +00:00
Chia-I Wu
66e6e8afe6 zink: set dma-buf bit for shared resources
Set the dma-buf bit when supported.  This is done because
zink_resource_get_handle exports dma-bufs when WINSYS_HANDLE_TYPE_FD is
requested.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14872>
2022-02-04 19:58:40 +00:00
Alyssa Rosenzweig
f8feaee0dd agx: Call nir_lower_discard_if
We still need to implement discard itself, but this means we don't need
to worry about discard_if. This compiles down to the same idiom as
the vendor compiler (Metal) generates

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14217>
2022-02-04 19:09:23 +00:00
Alyssa Rosenzweig
aaf00a1b4d nir,zink: Make lower_discard_if a common pass
This pass (lowering discard_if to control flow and unconditional
discard) was originally written for Zink, but is useful for hardware
that lacks conditional discard instructions like AGX. In theory AGX
could implement a conditional discard with CSEL, but the vendor
compiler uses a lowering like this one. Since I like not writing code,
I'd like to use the pass that's already in tree.

v2: Don't preserve dominance (Jason). Assert we don't see demotes or
terminates (Jason). Add Mike's ack.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14217>
2022-02-04 19:09:23 +00:00
Adam Jackson
538356e3e6 glx: Use the new no-error driver interface
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12474>
2022-02-04 18:36:24 +00:00
Adam Jackson
b1d585ca36 egl: Use the new no-error driver interface
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12474>
2022-02-04 18:36:24 +00:00
Adam Jackson
3e3d75d16a dri: Epoch how no-error context creation works
The bug here is that the DRI context "flags" are intended to alias the
GLX context flag values, and they don't, DRI's no-error flag is GLX's
reset-isolation flag. GLX (and EGL!) treat no-error as a context
attribute, and reset isolation predates Mesa's no-error implementation
by several years. The GL_KHR_no_error spec does describe it as a
"context flag", though, so maybe that's why we do it as a (DRI) context
flag.

In order to unalias these we need a new contract with the loader. We
remove the old __DRI_NO_ERROR extension, and add a new
__DRI_RENDERER_HAS_CONTEXT_NO_ERROR value to query. Loaders can key on
that to know to pass no-error-ness through as a context attribute,
matching the GLX/EGL calling convention. We go ahead and define
__DRI_CTX_FLAG_RESET_ISOLATION as well, and update the drivers to refuse
it since we don't support it yet.

This means mismatched drivers/loaders will not be able to create
no-error contexts. Too bad. If you want performance that badly you can
build both things at once.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12474>
2022-02-04 18:36:24 +00:00
Dylan Baker
5e994c5d98 meson: add LIBGL_DRIVERS_PATH to the devenv
This allows using built dri OpenGL drivers with the `meson devenv`
command

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14826>
2022-02-04 09:08:52 -08:00
Dylan Baker
2f916f2be6 meson: add support for meson devenv with vulkan
Meson devenv is a feature added in meson 0.58 (thus the features is
version guarded) that allows creating a shell environment with
environment variables automatically setup for running the project inside
the build dir. Some variables (such as LD_LIBRARY_PATH and PATH) are set
automatically, others must be added by the project.

For vulkan is is relativley simple, we create a new, uninstalled, icd
file for each driver and set the VK_ICD_FILENAMES variable
appropriately. This can be used with:

```sh
meson devenv -C $builddir
```

then, vulkan applications will automatically use the uninstall vulkan
driver, no need to install.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14826>
2022-02-04 09:08:47 -08:00
Erik Faye-Lund
3abe9ccbd4 vulkan/util: simplify multialloc init
The syntax we're using doesn't work when included into C++ sources. So
let's make it C++ compabible.

It turns out, nobody needs this extra definition which is what's causing
issues. Let's just make the initializer trivial without casting the
struct.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14850>
2022-02-04 10:16:42 +00:00
Erik Faye-Lund
0d0ecbd987 vulkan/util: Add explicit casts to make c++ happy
We're about to need including this header from a C++ source, so let's
add some explicit casts for C++ compatibility.

In one case we can make things a bit cleaner by moving the
char-pointer-ism to the place that needs it, so let's clean that up
while we're at it.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14850>
2022-02-04 10:16:42 +00:00
Erik Faye-Lund
676c65d8d5 vulkan/util: Add extern "C" to allow inclusion from c++
We're about to need including this header from a C++ source, so let's
wrap the whole thing in extern "C".

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14850>
2022-02-04 10:16:42 +00:00
Danylo Piliaiev
fded7a95c5 turnip: Expose VK_KHR_shader_non_semantic_info
This is entirely implemented in the SPIR-V frontend.

Relevant CTS tests:
dEQP-VK.spirv_assembly.instruction.compute.non_semantic_info.*

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14829>
2022-02-04 09:24:06 +00:00
Danylo Piliaiev
ff059605aa turnip: Implement VK_KHR_zero_initialize_workgroup_memory
Moved nir_lower_compute_system_values to lower
load_local_invocation_index which could be emitted by
nir_zero_initialize_shared_memory.

Relevant CTS tests:
dEQP-VK.compute.zero_initialize_workgroup_memory.*

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14829>
2022-02-04 09:24:06 +00:00
Danylo Piliaiev
c6d1cac6e5 turnip: Expose VK_EXT_image_robustness
VK_EXT_image_robustness is a strict subset of VK_EXT_robustness2
so we could just expose it.

Relevant CTS tests: dEQP-VK.robustness.image_robustness.*

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14829>
2022-02-04 09:24:06 +00:00
Danylo Piliaiev
03f9deecb8 turnip: Use the shared helpers to expose 1.3 core extensions/limits
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14829>
2022-02-04 09:24:06 +00:00
Danylo Piliaiev
679713d5f9 turnip/doc: Update turnip extension list
We were missing VK_EXT_subgroup_size_control and
VK_EXT_extended_dynamic_state2.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14829>
2022-02-04 09:24:06 +00:00
Kenneth Graunke
fd0e4aedeb iris: Make an iris_foreach_batch macro that skips unsupported batches
IRIS_BATCH_BLITTER isn't supported prior to Tigerlake; in general,
batches may not be supported on all hardware.  In most cases, querying
them is harmless (if useless): they reference nothing, have no commands
to flush, and so on.  However, the fence code does need to know that
certain batches don't exist, so it can avoid adding inter-batch fences
involving them.

This patch introduces a new iris_foreach_batch() iterator macro that
walks over all batches that are actually supported on the platform,
while skipping the others.  It provides a central place to update should
we add or reorder more batches in the future.

Fixes various tests in the piglit.spec.ext_external_objects.* category.

Thanks to Tapani Pälli for catching this.

Fixes: a90a1f15 ("iris: Create an IRIS_BATCH_BLITTER for using the BLT command streamer")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14834>
2022-02-04 08:06:12 +00:00
Dave Airlie
c4b400285a llvmpipe/triangle: don't store area in fixed_position.
It doesn't get used again, just extract the sign and move on.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14846>
2022-02-04 06:31:15 +00:00
Dave Airlie
cd4d2e920c llvmpipe: just move opaque alpha lookup closer to use.
Saves looking this up before checking the variant.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14846>
2022-02-04 06:31:15 +00:00
Dave Airlie
a448695eee llvmpipe: refactor lp_rast_shader_inputs.
viewport_index won't be >= 16
layer should be < 2048
view_index should be < 2048

this leaves the last 64-bits as padding, which something
expects, but not having to write to it means we have to write
less memory every triangle.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14846>
2022-02-04 06:31:15 +00:00
Dave Airlie
fb17da6c50 llvmpipe/setup: remove opaque from setup triangle
This isn't used in the rast side of things, so just pass it out here.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14846>
2022-02-04 06:31:15 +00:00
Dave Airlie
66188e8693 llvmpipe: inline retry_triangle_ccw
This reduces some of the overheads in the callstack here.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14846>
2022-02-04 06:31:15 +00:00
Dave Airlie
086a9b7869 llvmpipe: optimise triangle setup a bit.
the bboxpos = bbox copy was visible overhead on perf traces,
but we don't need to really do it.

Extract all the things from bbox needed early, then don't copy
it just overwrite it.

use boolean to fix power build.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14846>
2022-02-04 06:31:15 +00:00
Danylo Piliaiev
5e4bf6d100 turnip: Do not use hw binning if tiles per pipe are over the limit
Otherwise GPU would hang.

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

Freedreno commit as a reference:
39d00722b2

Fixes VK cts tests on a618 if their memory limit is raised to 1024 MB:
 dEQP-VK.pipeline.render_to_image.core.2d_array.huge.width_height.r8g8b8a8_unorm_d16_unorm
 dEQP-VK.pipeline.render_to_image.core.2d_array.huge.width_height.r8g8b8a8_unorm_s8_uint
 dEQP-VK.pipeline.render_to_image.core.2d_array.huge.width_height.r8g8b8a8_unorm_d24_unorm_s8_uint
 dEQP-VK.pipeline.render_to_image.core.2d_array.huge.width_height.r8g8b8a8_unorm_d32_sfloat_s8_uint
 dEQP-VK.pipeline.render_to_image.core.cube.huge.width_height.r8g8b8a8_unorm
 dEQP-VK.pipeline.render_to_image.core.cube.huge.width_height.r8g8b8a8_unorm_d16_unorm
 dEQP-VK.pipeline.render_to_image.core.cube.huge.width_height.r8g8b8a8_unorm_s8_uint
 dEQP-VK.pipeline.render_to_image.core.cube.huge.width_height.r8g8b8a8_unorm_d24_unorm_s8_uint
 dEQP-VK.pipeline.render_to_image.core.cube_array.huge.width_height.r8g8b8a8_unorm
 dEQP-VK.pipeline.render_to_image.core.cube_array.huge.width_height.r8g8b8a8_unorm_d24_unorm_s8_uint

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Tested-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14849>
2022-02-04 06:01:41 +00:00
Danylo Piliaiev
c6e8198f1b turnip: Add TU_GMEM envvar to test different gmem sizes
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14849>
2022-02-04 06:01:41 +00:00
Omar Akkila
dac3e6f372 venus: Advertise VK_EXT_extended_dynamic_state support
Signed-off-by: Omar Akkila <omar.akkila@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14866>
2022-02-04 04:23:18 +00:00
Omar Akkila
19e313e1c8 venus: Implement VK_EXT_extended_dynamic_state commands
This implements hooks for the following commands:

- vkCmdBindVertexBuffers2
- vkCmdSetCullMode
- vkCmdSetDepthBoundsTestEnable
- vkCmdSetDepthCompareOp
- vkCmdSetDepthTestEnable
- vkCmdSetDepthWriteEnable
- vkCmdSetFrontFace
- vkCmdSetPrimitiveTopology
- vkCmdSetScissorWithCount
- vkCmdSetStencilOp
- vkCmdSetStencilTestEnable
- vkCmdSetViewportWithCount

Signed-off-by: Omar Akkila <omar.akkila@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14866>
2022-02-04 04:23:18 +00:00
Jesse Natalie
3affb69eaa docs: Update d3d12 features
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
7430742b16 d3d12: ARB_gpu_shader_fp64
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
b8ecb8be79 d3d12: Handle structs in TCS variants
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
c448931d23 d3d12: Handle structs in GS variants
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
252a89a2c9 d3d12: Set lower full fp64 compiler options flag when needed
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
204102099a d3d12: Lower [de]construction of doubles via math ops into pack/unpack ops
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
4daa3eac2c d3d12: Add int64 support
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
397e117e96 d3d12: Get OPTIONS1
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
0144e7b18d d3d12: Add a driver version to the screen to be used for workarounds
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
944832d3d7 d3d12: Cache a modifyable copy of the nir options in d3d12_screen
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
2529a0df89 d3d12: Use the right constant for GS varying limits
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
d6daa1cc7a d3d12: Use a constant define for max anisotropy
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
bcfac68ce9 d3d12: Update max input, output, and varying caps
The simple-varyings piglit test attempts to use GL_MAX_VARYING_FLOATS
varyings, PLUS one additional vector for position (which is not used
as input to the PS). "Reserve" that additional position vector by
removing it from the max varyings and max PS inputs.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
0044e80b82 microsoft/compiler: Handle structs in I/O signatures
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
eb0cefae6d microsoft/compiler: Map I/O base locations to input IDs
When dealing with a vertex input that takes multiple rows, the value of
nir_intrinsic_base points to a driver-location-based index, but we need
to emit a location-based index (or more specifically, an index that
increments once per input, not once per register). Add a mapping to
the module of base -> ID.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
efe5c2d6f3 microsoft/compiler: Process signatures before the shader code
This lets us set up some metadata based on I/O vars without having
to do multiple passes over them.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
c154d403d3 microsoft/compiler: Handle I/O vars larger than a vec4
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
cdc49fb605 microsoft/compiler: Lower 64bit I/O to 32 and then run lower_pack
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
b24cfd0d40 microsoft/compiler: Handle b2f64
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
4d17393ba0 microsoft/compiler: Set dx11_1_double_extensions flag for dfma/ddiv
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
4c8935d325 microsoft/compiler: Fix dxil_nir_lower_double_math_instr pass for vectors
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
c8bd830dfb microsoft/compiler: Fix make_double and split_double to respect swizzles
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
92191349e9 microsoft/compiler: Fix splitdouble struct name
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
dde3b04d44 microsoft/compiler: It's possible to have doubles without int64
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
3b9483e89d microsoft/compiler: Add never-supported double ops to lower_doubles bitmask
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
ce6dbbabf9 microsoft/compiler: Only treat tess level location as special if it's a patch constant
Fixes: a550c059 ("microsoft/compiler: For load_input from DS, use loadPatchConstant")
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
0c711dc823 microsoft/compiler: Only prep phis for the current function
Fixes: 41af9620 ("microsoft/compiler: Emit all NIR functions into the DXIL module")
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie
87d22c2465 microsoft/compiler: Lower mul_2x32_64
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Emma Anholt
a177f0de8f ci: Uprev vulkan-cts to 1.2.8.0
This brings in some interesting new vulkan tests and fixes for the
spurious KHR-GL TF failures.  Also, reduces the runtime of
dEQP-GLES31.functional.ssbo.layout.random.all_shared_buffer.36 so that it
should stop timing out.

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13779>
2022-02-03 22:41:23 +00:00
Emma Anholt
3ce19d2db2 llvmpipe: Disable an assertion that may not be quite right.
It triggered on uprevving VK-GL-CTS, and @airlied says it's tripped
apparently spuriously before.  There seems to be some interesting logic
behind it, so leave the big comment for whoever can revisit the issue some
day.

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13779>
2022-02-03 22:41:23 +00:00
Emma Anholt
6c2f6cd86f ci/i915: Update rendering hash for plot3d trace.
Its rendering changed slightly at some point, but it's fine.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13779>
2022-02-03 22:41:23 +00:00
Emma Anholt
940b9ff6c9 ci/freedreno: Reduce concurrency for a618 vk_full.
This ran into OOM-kills with the CTS uprev.  Looking at caselists at the
time of fail, some had 500MB of system memory used by the CTS (mostly
spirv string codegen), plus whatever BOs were allocated, and the lazors
are only 4GB it looks like.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13779>
2022-02-03 22:41:23 +00:00
Emma Anholt
5039fc3dc7 ci/turnip: Extend the full-vk-run job timeouts.
Between adding features and increased test coverage, we're hitting the
1-hour job limit.  !13441 tried to increase the full run timeout for LAVA,
but by having not bumped the gitlab-ci timeout value it ended up just
letting the job keep running in LAVA after gitlab had given up on it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13779>
2022-02-03 22:41:23 +00:00
Emma Anholt
47d0e63c59 ci/freereno: Reduce run-by-default a630-vk coverage.
In the autotune merge, we added another 1/15th run of a configuration
knob, thinking that was small enough to be in the noise.  But actually the
main run is only 1/9th, so another 1/15th took us from nearly hitting the
job runtime target, to totally missing it.  Crank things back down to keep
MRs flowing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13779>
2022-02-03 22:41:23 +00:00
Emma Anholt
4f22f4ca1a r300: Simplify DCE by assuming all output writes are used.
No change on shader-db.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14847>
2022-02-03 14:28:46 -08:00
Emma Anholt
17cea74b8c r300: Set up shadow sampler lowering in precompiles.
Otherwise you end up lowering all shadow samples to a MOV dst
temp[0].0000, which is pretty silly.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14847>
2022-02-03 14:28:44 -08:00
Emma Anholt
5f55e7b845 r300: Fix missing \n in an error message.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14847>
2022-02-03 14:28:41 -08:00
Mike Blumenkrantz
41ed470f6f zink: add synchronization for conditional render buffer
doesn't seem to do anything on any drivers I've tested, but maybe it's
needed somewhere

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14853>
2022-02-03 19:15:26 +00:00
Mike Blumenkrantz
1e96542390 zink: add VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT for query binds
required by spec

cc: mesa-stable

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14853>
2022-02-03 19:15:26 +00:00
Rhys Perry
0447a2303f aco: don't encode src2 for v_writelane_b32_e64
Encoding src2 doesn't cause issues for print_asm() because we have a
workaround there, but it does for RGP and it seems the developers are not
interested in fixing it.

https://github.com/GPUOpen-Tools/radeon_gpu_profiler/issues/61

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Tested-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14832>
2022-02-03 16:52:00 +00:00
Rhys Perry
5e3b8eeac4 aco: add test for optimizations with casts
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14810>
2022-02-03 16:02:04 +00:00
Rhys Perry
6b1dfa7eac aco: fix neg(mul)/abs(mul) optimization with different bit-size
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14810>
2022-02-03 16:02:04 +00:00
Rhys Perry
13bbc7c882 aco: don't combine add/mul of different bit-size
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14810>
2022-02-03 16:02:04 +00:00
Rhys Perry
3d8a8c6fc1 aco: don't apply omod/clamp of different bit-size
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14810>
2022-02-03 16:02:04 +00:00
Rhys Perry
7e30f99b0a aco: don't combine fneg/fabs of different bit-size
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14810>
2022-02-03 16:02:04 +00:00
Rhys Perry
27f1f5537d aco/tests: implement sub-dword program inputs
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14810>
2022-02-03 16:02:04 +00:00
Rhys Perry
e86b88f85b aco/tests: add a bunch more building helpers
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14810>
2022-02-03 16:02:04 +00:00
Alyssa Rosenzweig
1410d150e7 panfrost: Fix texel interleave flag on Valhall
Interleave mode specified per-plane on Valhall. The texture descriptor proper
merely has a flag specifying whether planes are somehow interleaved
(u-interleaved, AFBC, or block compressed formats) or whether they are all
linear (and uncompressed).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14851>
2022-02-03 15:43:27 +00:00
Alyssa Rosenzweig
3bf34a1494 panfrost: Add remaining ZS/CRC XML
Flesh out the ZS/CRC XML, adding fields required for AFBC. Valhall allows AFBC
compressing stencil buffers independent of depth buffers, which is a new feature
since Bifrost. That results in a shuffling of the descriptor.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14851>
2022-02-03 15:43:27 +00:00
Alyssa Rosenzweig
bfba7533c7 panfrost: Add Valhall Plane Descriptor XML
This looks superficially like the Bifrost "Surface" descriptor, but it
additionally specifies the in-memory representation of blocks (clumps). If I
understand correctly, decompression is controlled by the plane descriptor,
rather than the texture descriptor level. This is a bit more flexible than
Bifrost.

Once the new fields here are wired up to Mesa, my
dEQP-GLES2.functional.texture.* failures should go away... I hope!

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14851>
2022-02-03 15:43:27 +00:00
Alyssa Rosenzweig
c34381d8e8 panfrost: Fix alignments on Valhall
Otherwise we get DATA_INVALID_FAULT trying to run even trivial null jobs. For
each descriptor, set the correct alignment.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14851>
2022-02-03 15:43:27 +00:00
Alyssa Rosenzweig
a98f0e280e panfrost: Remove blend shader return value on v9
Removed since there's a new ABI for blend shaders. Even if we always write 0,
it's better not to pack this at all, and to denoise the dumps.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14851>
2022-02-03 15:43:27 +00:00
Alejandro Piñeiro
5d8c659678 v3d/drm-shim: remove drm-shim driver
After starting to use a new version of the simulator, it got
outdated.

We made some initial effort to update it, but it was not
working. Taking into account that no one is using it, it is better to
just remove it.

We keep the noop drm drivers, as they could have some value for
developers that doesn't have access to the v3dv3 simulator.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14682>
2022-02-03 09:53:29 +00:00
Shirish S
6f17d8acc9 radeonsi: allocate protected buffer only if required
protected buffer allocations need to be made if the context is secure

Signed-off-by: Shirish S <shirish.s@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14848>
2022-02-03 10:34:12 +01:00
Pierre-Eric Pelloux-Prayer
eaa87b1a46 radeonsi: limit loop unrolling for LLVM < 13
Without this change LLVM 12 hits this error:

"""
LLVM ERROR: Error while trying to spill SGPR0_SGPR1 from class SReg_64:
Cannot scavenge register without an emergency spill slot!
"""

when running glcts KHR-GL46.arrays_of_arrays_gl.AtomicUsage test.

Fixes: 9ff086052a ("radeonsi: unroll loops of up to 128 iterations")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14848>
2022-02-03 10:34:12 +01:00
Samuel Pitoiset
52c850445e radv: stop setting streamout state when a new pipeline is bound
It's required to have a valid graphics bound pipeline with XFB when
vkCmdBeginTransformFeedbackKHR() is called. This removes extra work
when binding a pipeline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14610>
2022-02-03 07:57:07 +00:00
Iago Toral Quiroga
7561ea8fa1 broadcom/compiler: allow ldunifa with read-only SSBOs
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14830>
2022-02-03 07:35:07 +00:00
Iago Toral Quiroga
0a8449b07c broadcom/compiler: fix offset alignment for ldunifa when skipping
The intention was to align the address to 4 bytes (32-bit), not
16 bytes.

Fixes: bdb6201ea1 ("broadcom/compiler: use ldunifa with unaligned constant offset")

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14830>
2022-02-03 07:35:07 +00:00
Dylan Baker
04f6e91de0 docs: update calendar for 22.0.0-rc1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14845>
2022-02-02 23:54:10 +00:00
Dylan Baker
647df89664 docs: reset new_features.txt
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14843>
2022-02-02 23:46:15 +00:00
Mike Blumenkrantz
f8a9010410 llvmpipe: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14835>
2022-02-02 23:03:40 +00:00
Mike Blumenkrantz
9a75392cd8 llvmpipe: disable PIPE_SHADER_CAP_FP16_CONST_BUFFERS
this cap is broken

cc: mesa-stable

fixes:
GTF-GL46.gtf21.GL2Tests.glGetUniform.glGetUnifor

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14835>
2022-02-02 23:03:40 +00:00
Mike Blumenkrantz
9a38dab2d1 zink: disable PIPE_SHADER_CAP_FP16_CONST_BUFFERS
this cap is broken

cc: mesa-stable

fixes:
GTF-GL46.gtf21.GL2Tests.glGetUniform.glGetUniform

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14835>
2022-02-02 23:03:40 +00:00
Dylan Baker
366d83a30e VERSION: bump version for 22.0 release
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14840>
2022-02-02 22:49:09 +00:00
1997 changed files with 270801 additions and 164564 deletions

View File

@@ -16,26 +16,14 @@ max_line_length = 78
[{Makefile*,*.mk}]
indent_style = tab
[{*.py,SCons*}]
[*.py]
indent_style = space
indent_size = 4
[*.pl]
indent_style = space
indent_size = 4
[*.m4]
indent_style = space
indent_size = 2
[*.yml]
indent_style = space
indent_size = 2
[*.html]
indent_style = space
indent_size = 2
[*.rst]
indent_style = space
indent_size = 3

File diff suppressed because it is too large Load Diff

View File

@@ -6,9 +6,6 @@
# reliable to be run in parallel with other tests due to CPU-side timing.
dEQP-GLES[0-9]*.functional.flush_finish.*
# https://gitlab.freedesktop.org/mesa/mesa/-/issues/4575
dEQP-VK.wsi.display.get_display_plane_capabilities
# piglit: WGL is Windows-only
wgl@.*

View File

@@ -0,0 +1,17 @@
#!/bin/bash
if [ -z "$BM_POE_INTERFACE" ]; then
echo "Must supply the PoE Interface to power down"
exit 1
fi
if [ -z "$BM_POE_ADDRESS" ]; then
echo "Must supply the PoE Switch host"
exit 1
fi
SNMP_KEY="1.3.6.1.4.1.9.9.402.1.2.1.1.1.$BM_POE_INTERFACE"
SNMP_ON="i 1"
SNMP_OFF="i 4"
snmpset -v2c -r 3 -t 30 -cmesaci $BM_POE_ADDRESS $SNMP_KEY $SNMP_OFF

View File

@@ -0,0 +1,21 @@
#!/bin/bash
if [ -z "$BM_POE_INTERFACE" ]; then
echo "Must supply the PoE Interface to power up"
exit 1
fi
if [ -z "$BM_POE_ADDRESS" ]; then
echo "Must supply the PoE Switch host"
exit 1
fi
set -ex
SNMP_KEY="1.3.6.1.4.1.9.9.402.1.2.1.1.1.$BM_POE_INTERFACE"
SNMP_ON="i 1"
SNMP_OFF="i 4"
snmpset -v2c -r 3 -t 10 -cmesaci $BM_POE_ADDRESS $SNMP_KEY $SNMP_OFF
sleep 3s
snmpset -v2c -r 3 -t 10 -cmesaci $BM_POE_ADDRESS $SNMP_KEY $SNMP_ON

View File

@@ -156,6 +156,10 @@ class CrosServoRun:
"Detected spontaneous reboot, restarting run...")
return 2
if re.search("arm-smmu 5040000.iommu: TLB sync timed out -- SMMU may be deadlocked", line):
self.print_error("Detected cheza MMU fail, restarting run...")
return 2
result = re.search("hwci: mesa: (\S*)", line)
if result:
if result.group(1) == "pass":

View File

@@ -20,18 +20,6 @@ if [ -z "$BM_POE_ADDRESS" ]; then
exit 1
fi
if [ -z "$BM_POE_USERNAME" ]; then
echo "Must set BM_POE_USERNAME in your gitlab-runner config.toml [[runners]] environment"
echo "This is the PoE switch username."
exit 1
fi
if [ -z "$BM_POE_PASSWORD" ]; then
echo "Must set BM_POE_PASSWORD in your gitlab-runner config.toml [[runners]] environment"
echo "This is the PoE switch password."
exit 1
fi
if [ -z "$BM_POE_INTERFACE" ]; then
echo "Must set BM_POE_INTERFACE in your gitlab-runner config.toml [[runners]] environment"
echo "This is the PoE switch interface where the device is connected."
@@ -107,11 +95,25 @@ fi
# Install kernel modules (it could be either in /lib/modules or
# /usr/lib/modules, but we want to install in the latter)
[ -d $BM_BOOTFS/usr/lib/modules ] && rsync -a --delete $BM_BOOTFS/usr/lib/modules/ /nfs/usr/lib/modules/
[ -d $BM_BOOTFS/lib/modules ] && rsync -a --delete $BM_BOOTFS/lib/modules/ /nfs/usr/lib/modules/
[ -d $BM_BOOTFS/usr/lib/modules ] && rsync -a $BM_BOOTFS/usr/lib/modules/ /nfs/usr/lib/modules/
[ -d $BM_BOOTFS/lib/modules ] && rsync -a $BM_BOOTFS/lib/modules/ /nfs/lib/modules/
# Install kernel image + bootloader files
rsync -a --delete $BM_BOOTFS/boot/ /tftp/
rsync -aL --delete $BM_BOOTFS/boot/ /tftp/
# Set up the pxelinux config for Jetson Nano
mkdir -p /tftp/pxelinux.cfg
cat <<EOF >/tftp/pxelinux.cfg/default-arm-tegra210-p3450-0000
PROMPT 0
TIMEOUT 30
DEFAULT primary
MENU TITLE jetson nano boot options
LABEL primary
MENU LABEL CI kernel on TFTP
LINUX Image
FDT tegra210-p3450-0000.dtb
APPEND \${cbootargs} $BM_CMDLINE
EOF
# Create the rootfs in the NFS directory
mkdir -p /nfs/results
@@ -123,7 +125,7 @@ echo "$BM_CMDLINE" > /tftp/cmdline.txt
printf "$BM_BOOTCONFIG" >> /tftp/config.txt
set +e
ATTEMPTS=2
ATTEMPTS=10
while [ $((ATTEMPTS--)) -gt 0 ]; do
python3 $BM/poe_run.py \
--dev="$BM_SERIAL" \

View File

@@ -66,6 +66,10 @@ class PoERun:
self.print_error("Memory overflow in the binner; GPU hang")
return 1
if re.search("nouveau 57000000.gpu: bus: MMIO read of 00000000 FAULT at 137000", line):
self.print_error("nouveau jetson boot bug, retrying.")
return 2
result = re.search("hwci: mesa: (\S*)", line)
if result:
if result.group(1) == "pass":

View File

@@ -13,6 +13,7 @@ cp $CI_COMMON/init*.sh $rootfs_dst/
cp "${CI_JOB_JWT_FILE}" "${rootfs_dst}${CI_JOB_JWT_FILE}"
cp $CI_COMMON/capture-devcoredump.sh $rootfs_dst/
cp $CI_COMMON/intel-gpu-freq.sh $rootfs_dst/
set +x

View File

@@ -0,0 +1,525 @@
# Shared between windows and Linux
.build-common:
extends: .ci-run-policy
# Cancel job if a newer commit is pushed to the same branch
interruptible: true
artifacts:
name: "mesa_${CI_JOB_NAME}"
when: always
paths:
- _build/meson-logs/*.txt
- _build/meson-logs/strace
- shader-db
# Just Linux
.build-linux:
extends: .build-common
variables:
CCACHE_COMPILERCHECK: "content"
CCACHE_COMPRESS: "true"
CCACHE_DIR: /cache/mesa/ccache
# Use ccache transparently, and print stats before/after
before_script:
- !reference [default, before_script]
- export PATH="/usr/lib/ccache:$PATH"
- export CCACHE_BASEDIR="$PWD"
- echo -e "\e[0Ksection_start:$(date +%s):ccache_before[collapsed=true]\r\e[0Kccache stats before build"
- ccache --show-stats
- echo -e "\e[0Ksection_end:$(date +%s):ccache_before\r\e[0K"
after_script:
- echo -e "\e[0Ksection_start:$(date +%s):ccache_after[collapsed=true]\r\e[0Kccache stats after build"
- ccache --show-stats
- echo -e "\e[0Ksection_end:$(date +%s):ccache_after\r\e[0K"
- !reference [default, after_script]
.build-windows:
extends: .build-common
tags:
- windows
- docker
- "1809"
- mesa
cache:
key: ${CI_JOB_NAME}
paths:
- subprojects/packagecache
.meson-build:
extends:
- .build-linux
- .use-debian/x86_build
stage: build-x86_64
variables:
LLVM_VERSION: 11
script:
- .gitlab-ci/meson/build.sh
debian-testing:
extends:
- .meson-build
- .ci-deqp-artifacts
variables:
UNWIND: "enabled"
DRI_LOADERS: >
-D glx=dri
-D gbm=enabled
-D egl=enabled
-D platforms=x11
GALLIUM_ST: >
-D dri3=enabled
-D gallium-va=enabled
GALLIUM_DRIVERS: "swrast,virgl,radeonsi,zink,crocus,iris,i915"
VULKAN_DRIVERS: "swrast,amd,intel"
BUILDTYPE: "debugoptimized"
EXTRA_OPTION: >
-D valgrind=false
MINIO_ARTIFACT_NAME: mesa-amd64
script:
- .gitlab-ci/lava/lava-pytest.sh
- .gitlab-ci/meson/build.sh
- .gitlab-ci/prepare-artifacts.sh
artifacts:
reports:
junit: artifacts/ci_scripts_report.xml
debian-testing-asan:
extends:
- debian-testing
variables:
C_ARGS: >
-Wno-error=stringop-truncation
EXTRA_OPTION: >
-D b_sanitize=address
-D valgrind=false
-D tools=dlclose-skip
MINIO_ARTIFACT_NAME: ""
ARTIFACTS_DEBUG_SYMBOLS: 1
debian-testing-msan:
extends:
- debian-clang
variables:
# l_undef is incompatible with msan
EXTRA_OPTION:
-D b_sanitize=memory
-D b_lundef=false
MINIO_ARTIFACT_NAME: ""
ARTIFACTS_DEBUG_SYMBOLS: 1
# Don't run all the tests yet:
# GLSL has some issues in sexpression reading.
# gtest has issues in its test initialization.
MESON_TEST_ARGS: "--suite glcpp --suite gallium --suite format"
# Freedreno dropped because freedreno tools fail at msan.
GALLIUM_DRIVERS: "iris,nouveau,kmsro,r300,r600,swrast,svga,v3d,vc4,virgl,etnaviv,panfrost,lima,zink,radeonsi,tegra,d3d12,crocus"
VULKAN_DRIVERS: intel,amd,broadcom,virtio-experimental
debian-clover-testing:
extends:
- .meson-build
- .ci-deqp-artifacts
variables:
UNWIND: "enabled"
DRI_LOADERS: >
-D glx=disabled
-D egl=disabled
-D gbm=disabled
GALLIUM_ST: >
-D gallium-opencl=icd
-D opencl-spirv=true
GALLIUM_DRIVERS: "swrast"
BUILDTYPE: "debugoptimized"
EXTRA_OPTION: >
-D valgrind=false
script:
- .gitlab-ci/meson/build.sh
- .gitlab-ci/prepare-artifacts.sh
debian-gallium:
extends: .meson-build
variables:
UNWIND: "enabled"
DRI_LOADERS: >
-D glx=dri
-D gbm=enabled
-D egl=enabled
-D platforms=x11,wayland
GALLIUM_ST: >
-D dri3=enabled
-D gallium-extra-hud=true
-D gallium-vdpau=enabled
-D gallium-xvmc=enabled
-D gallium-omx=bellagio
-D gallium-va=enabled
-D gallium-xa=enabled
-D gallium-nine=true
-D gallium-opencl=disabled
GALLIUM_DRIVERS: "iris,nouveau,kmsro,r300,r600,freedreno,swrast,svga,v3d,vc4,virgl,etnaviv,panfrost,lima,zink,d3d12,asahi,crocus"
VULKAN_DRIVERS: swrast
EXTRA_OPTION: >
-D osmesa=true
-D tools=drm-shim,etnaviv,freedreno,glsl,intel,intel-ui,nir,nouveau,xvmc,lima,panfrost,asahi
script:
- .gitlab-ci/meson/build.sh
- .gitlab-ci/run-shader-db.sh
# Test a release build with -Werror so new warnings don't sneak in.
debian-release:
extends: .meson-build
variables:
UNWIND: "enabled"
DRI_LOADERS: >
-D glx=dri
-D gbm=enabled
-D egl=enabled
-D platforms=x11,wayland
GALLIUM_ST: >
-D dri3=enabled
-D gallium-extra-hud=true
-D gallium-vdpau=enabled
-D gallium-xvmc=disabled
-D gallium-omx=disabled
-D gallium-va=enabled
-D gallium-xa=enabled
-D gallium-nine=false
-D gallium-opencl=disabled
-D llvm=enabled
GALLIUM_DRIVERS: "i915,iris,nouveau,kmsro,freedreno,r300,svga,swrast,v3d,vc4,virgl,etnaviv,panfrost,lima,zink,d3d12,crocus"
VULKAN_DRIVERS: "amd,imagination-experimental"
BUILDTYPE: "release"
EXTRA_OPTION: >
-D osmesa=true
-D tools=all
-D intel-clc=enabled
-D imagination-srv=true
script:
- .gitlab-ci/meson/build.sh
fedora-release:
extends:
- .meson-build
- .use-fedora/x86_build
variables:
BUILDTYPE: "release"
C_ARGS: >
-Wno-error=array-bounds
-Wno-error=maybe-uninitialized
-Wno-error=stringop-overread
-Wno-error=uninitialized
CPP_ARGS: >
-Wno-error=array-bounds
DRI_LOADERS: >
-D glx=dri
-D gbm=enabled
-D egl=enabled
-D glvnd=true
-D platforms=x11,wayland
EXTRA_OPTION: >
-D osmesa=true
-D selinux=true
-D tools=drm-shim,etnaviv,freedreno,glsl,intel,nir,nouveau,lima,panfrost,imagination
-D intel-clc=enabled
-D imagination-srv=true
GALLIUM_DRIVERS: "crocus,etnaviv,freedreno,iris,kmsro,lima,nouveau,panfrost,r300,r600,radeonsi,svga,swrast,tegra,v3d,vc4,virgl,zink"
GALLIUM_ST: >
-D dri3=enabled
-D gallium-extra-hud=true
-D gallium-vdpau=enabled
-D gallium-xvmc=disabled
-D gallium-omx=disabled
-D gallium-va=enabled
-D gallium-xa=enabled
-D gallium-nine=false
-D gallium-opencl=icd
-D gles1=disabled
-D gles2=enabled
-D llvm=enabled
-D microsoft-clc=disabled
-D shared-llvm=enabled
-D vulkan-device-select-layer=true
LLVM_VERSION: ""
UNWIND: "disabled"
VULKAN_DRIVERS: "amd,broadcom,freedreno,intel,imagination-experimental"
script:
- .gitlab-ci/meson/build.sh
debian-android:
extends:
- .meson-cross
- .use-debian/android_build
variables:
UNWIND: "disabled"
C_ARGS: >
-Wno-error=asm-operand-widths
-Wno-error=constant-conversion
-Wno-error=enum-conversion
-Wno-error=initializer-overrides
-Wno-error=missing-braces
-Wno-error=sometimes-uninitialized
-Wno-error=unused-function
CPP_ARGS: >
-Wno-error=deprecated-declarations
DRI_LOADERS: >
-D glx=disabled
-D gbm=disabled
-D egl=enabled
-D platforms=android
EXTRA_OPTION: >
-D android-stub=true
-D llvm=disabled
-D platform-sdk-version=29
-D valgrind=false
GALLIUM_ST: >
-D dri3=disabled
-D gallium-vdpau=disabled
-D gallium-xvmc=disabled
-D gallium-omx=disabled
-D gallium-va=disabled
-D gallium-xa=disabled
-D gallium-nine=false
-D gallium-opencl=disabled
LLVM_VERSION: ""
PKG_CONFIG_LIBDIR: "/disable/non/android/system/pc/files"
script:
- PKG_CONFIG_PATH=/usr/local/lib/aarch64-linux-android/pkgconfig/:/android-ndk-r21d/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/pkgconfig/ CROSS=aarch64-linux-android GALLIUM_DRIVERS=etnaviv,freedreno,lima,panfrost,vc4,v3d VULKAN_DRIVERS=freedreno,broadcom,virtio-experimental .gitlab-ci/meson/build.sh
# x86_64 build:
# Can't do Intel because gen_decoder.c currently requires libexpat, which
# is not a dependency that AOSP wants to accept. Can't do Radeon Gallium
# drivers because they requires LLVM, which we don't have an Android build
# of.
- PKG_CONFIG_PATH=/usr/local/lib/x86_64-linux-android/pkgconfig/:/android-ndk-r21d/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/pkgconfig/ CROSS=x86_64-linux-android GALLIUM_DRIVERS=iris VULKAN_DRIVERS=amd,intel .gitlab-ci/meson/build.sh
.meson-cross:
extends:
- .meson-build
stage: build-misc
variables:
UNWIND: "disabled"
DRI_LOADERS: >
-D glx=dri
-D gbm=enabled
-D egl=enabled
-D platforms=x11
-D osmesa=false
GALLIUM_ST: >
-D dri3=enabled
-D gallium-vdpau=disabled
-D gallium-xvmc=disabled
-D gallium-omx=disabled
-D gallium-va=disabled
-D gallium-xa=disabled
-D gallium-nine=false
.meson-arm:
extends:
- .meson-cross
- .use-debian/arm_build
needs:
- debian/arm_build
variables:
VULKAN_DRIVERS: freedreno,broadcom
GALLIUM_DRIVERS: "etnaviv,freedreno,kmsro,lima,nouveau,panfrost,swrast,tegra,v3d,vc4"
BUILDTYPE: "debugoptimized"
tags:
- aarch64
debian-armhf:
extends:
- .meson-arm
- .ci-deqp-artifacts
variables:
CROSS: armhf
EXTRA_OPTION: >
-D llvm=disabled
-D valgrind=false
MINIO_ARTIFACT_NAME: mesa-armhf
script:
- .gitlab-ci/meson/build.sh
- .gitlab-ci/prepare-artifacts.sh
debian-arm64:
extends:
- .meson-arm
- .ci-deqp-artifacts
variables:
VULKAN_DRIVERS: "freedreno,broadcom,panfrost,imagination-experimental"
EXTRA_OPTION: >
-D llvm=disabled
-D valgrind=false
-D imagination-srv=true
MINIO_ARTIFACT_NAME: mesa-arm64
script:
- .gitlab-ci/meson/build.sh
- .gitlab-ci/prepare-artifacts.sh
debian-arm64-asan:
extends:
- debian-arm64
variables:
C_ARGS: >
-Wno-error=stringop-truncation
EXTRA_OPTION: >
-D llvm=disabled
-D b_sanitize=address
-D valgrind=false
-D tools=dlclose-skip
ARTIFACTS_DEBUG_SYMBOLS: 1
MINIO_ARTIFACT_NAME: mesa-arm64-asan
MESON_TEST_ARGS: "--no-suite mesa:compiler"
debian-arm64-build-test:
extends:
- .meson-arm
- .ci-deqp-artifacts
variables:
VULKAN_DRIVERS: "amd"
EXTRA_OPTION: >
-Dtools=panfrost,imagination
script:
- .gitlab-ci/meson/build.sh
debian-clang:
extends: .meson-build
variables:
UNWIND: "enabled"
C_ARGS: >
-Wno-error=constant-conversion
-Wno-error=enum-conversion
-Wno-error=implicit-const-int-float-conversion
-Wno-error=initializer-overrides
-Wno-error=sometimes-uninitialized
-Wno-error=unused-function
CPP_ARGS: >
-Wno-error=c99-designator
-Wno-error=deprecated-declarations
-Wno-error=implicit-const-int-float-conversion
-Wno-error=missing-braces
-Wno-error=overloaded-virtual
-Wno-error=tautological-constant-out-of-range-compare
-Wno-error=unused-const-variable
-Wno-error=unused-private-field
DRI_LOADERS: >
-D glvnd=true
GALLIUM_DRIVERS: "iris,nouveau,kmsro,r300,r600,freedreno,swrast,svga,v3d,vc4,virgl,etnaviv,panfrost,lima,zink,radeonsi,tegra,d3d12,crocus,i915,asahi"
VULKAN_DRIVERS: intel,amd,freedreno,broadcom,virtio-experimental,swrast,panfrost,imagination-experimental
EXTRA_OPTIONS:
-D imagination-srv=true
CC: clang
CXX: clang++
windows-vs2019:
extends:
- .build-windows
- .use-windows_build_vs2019
- .windows-build-rules
stage: build-misc
script:
- . .\.gitlab-ci\windows\mesa_build.ps1
artifacts:
paths:
- _build/meson-logs/*.txt
- _install/
debian-clover:
extends: .meson-build
variables:
UNWIND: "enabled"
DRI_LOADERS: >
-D glx=disabled
-D egl=disabled
-D gbm=disabled
GALLIUM_DRIVERS: "r600,radeonsi"
GALLIUM_ST: >
-D dri3=disabled
-D gallium-vdpau=disabled
-D gallium-xvmc=disabled
-D gallium-omx=disabled
-D gallium-va=disabled
-D gallium-xa=disabled
-D gallium-nine=false
-D gallium-opencl=icd
EXTRA_OPTION: >
-D valgrind=false
script:
- LLVM_VERSION=9 GALLIUM_DRIVERS=r600,swrast .gitlab-ci/meson/build.sh
- .gitlab-ci/meson/build.sh
debian-vulkan:
extends: .meson-build
variables:
UNWIND: "disabled"
DRI_LOADERS: >
-D glx=disabled
-D gbm=disabled
-D egl=disabled
-D platforms=x11,wayland
-D osmesa=false
GALLIUM_ST: >
-D dri3=enabled
-D gallium-vdpau=disabled
-D gallium-xvmc=disabled
-D gallium-omx=disabled
-D gallium-va=disabled
-D gallium-xa=disabled
-D gallium-nine=false
-D gallium-opencl=disabled
-D b_sanitize=undefined
-D c_args=-fno-sanitize-recover=all
-D cpp_args=-fno-sanitize-recover=all
UBSAN_OPTIONS: "print_stacktrace=1"
VULKAN_DRIVERS: intel,amd,freedreno,broadcom,virtio-experimental,imagination-experimental
EXTRA_OPTION: >
-D vulkan-layers=device-select,overlay
-D build-aco-tests=true
-D intel-clc=enabled
-D imagination-srv=true
debian-i386:
extends:
- .meson-cross
- .use-debian/i386_build
variables:
CROSS: i386
VULKAN_DRIVERS: intel,amd,swrast,virtio-experimental
GALLIUM_DRIVERS: "iris,nouveau,r300,r600,radeonsi,swrast,virgl,zink,crocus"
EXTRA_OPTION: >
-D vulkan-layers=device-select,overlay
debian-s390x:
extends:
- debian-ppc64el
- .use-debian/s390x_build
- .s390x-rules
tags:
- kvm
variables:
CROSS: s390x
GALLIUM_DRIVERS: "swrast,zink"
# The lp_test_blend test times out with LLVM 11
LLVM_VERSION: 9
VULKAN_DRIVERS: "swrast"
debian-ppc64el:
extends:
- .meson-cross
- .use-debian/ppc64el_build
- .ppc64el-rules
variables:
CROSS: ppc64el
GALLIUM_DRIVERS: "nouveau,radeonsi,swrast,virgl,zink"
VULKAN_DRIVERS: "amd,swrast"
debian-mingw32-x86_64:
extends: .meson-build
stage: build-misc
variables:
UNWIND: "disabled"
C_ARGS: >
-Wno-error=format
-Wno-error=format-extra-args
CPP_ARGS: $C_ARGS
GALLIUM_DRIVERS: "swrast"
EXTRA_OPTION: >
-Dllvm=disabled
-Dzlib=disabled
-Dosmesa=true
--cross-file=.gitlab-ci/x86_64-w64-mingw32

View File

@@ -26,7 +26,6 @@ for var in \
CI_SERVER_URL \
CROSVM_GALLIUM_DRIVER \
CROSVM_GPU_ARGS \
CROSVM_TEST_SCRIPT \
DEQP_BIN_DIR \
DEQP_CASELIST_FILTER \
DEQP_CASELIST_INV_FILTER \
@@ -49,6 +48,7 @@ for var in \
FDO_UPSTREAM_REPO \
FD_MESA_DEBUG \
FLAKES_CHANNEL \
FREEDRENO_HANGCHECK_MS \
GALLIUM_DRIVER \
GALLIVM_PERF \
GPU_VERSION \
@@ -60,12 +60,15 @@ for var in \
GTEST_SKIPS \
HWCI_FREQ_MAX \
HWCI_KERNEL_MODULES \
HWCI_KVM \
HWCI_START_XORG \
HWCI_TEST_SCRIPT \
IR3_SHADER_DEBUG \
JOB_ARTIFACTS_BASE \
JOB_RESULTS_PATH \
JOB_ROOTFS_OVERLAY_PATH \
KERNEL_IMAGE_BASE_URL \
KERNEL_IMAGE_NAME \
LD_LIBRARY_PATH \
LP_NUM_THREADS \
MESA_BASE_TAG \
@@ -79,7 +82,9 @@ for var in \
MESA_IMAGE_TAG \
MESA_TEMPLATES_COMMIT \
MESA_VK_IGNORE_CONFORMANCE_WARNING \
MESA_SPIRV_LOG_LEVEL \
MINIO_HOST \
MINIO_RESULTS_UPLOAD \
NIR_DEBUG \
PAN_I_WANT_A_BROKEN_VULKAN_DRIVER \
PAN_MESA_DEBUG \
@@ -92,6 +97,7 @@ for var in \
PIGLIT_REPLAY_DESCRIPTION_FILE \
PIGLIT_REPLAY_DEVICE_NAME \
PIGLIT_REPLAY_EXTRA_ARGS \
PIGLIT_REPLAY_LOOP_TIMES \
PIGLIT_REPLAY_REFERENCE_IMAGES_BASE \
PIGLIT_REPLAY_SUBCOMMAND \
PIGLIT_RESULTS \

View File

@@ -9,6 +9,7 @@ cd /
mount -t proc none /proc
mount -t sysfs none /sys
mount -t debugfs none /sys/kernel/debug
mount -t devtmpfs none /dev || echo possibly already mounted
mkdir -p /dev/pts
mount -t devpts devpts /dev/pts

View File

@@ -8,7 +8,31 @@
set -ex
# Set up any devices required by the jobs
[ -z "$HWCI_KERNEL_MODULES" ] || (echo -n $HWCI_KERNEL_MODULES | xargs -d, -n1 /usr/sbin/modprobe)
[ -z "$HWCI_KERNEL_MODULES" ] || {
echo -n $HWCI_KERNEL_MODULES | xargs -d, -n1 /usr/sbin/modprobe
}
#
# Load the KVM module specific to the detected CPU virtualization extensions:
# - vmx for Intel VT
# - svm for AMD-V
#
# Additionally, download the kernel image to boot the VM via HWCI_TEST_SCRIPT.
#
if [ "$HWCI_KVM" = "true" ]; then
unset KVM_KERNEL_MODULE
grep -qs '\bvmx\b' /proc/cpuinfo && KVM_KERNEL_MODULE=kvm_intel || {
grep -qs '\bsvm\b' /proc/cpuinfo && KVM_KERNEL_MODULE=kvm_amd
}
[ -z "${KVM_KERNEL_MODULE}" ] && \
echo "WARNING: Failed to detect CPU virtualization extensions" || \
modprobe ${KVM_KERNEL_MODULE}
mkdir -p /lava-files
wget -S --progress=dot:giga -O /lava-files/${KERNEL_IMAGE_NAME} \
"${KERNEL_IMAGE_BASE_URL}/${KERNEL_IMAGE_NAME}"
fi
# Fix prefix confusion: the build installs to $CI_PROJECT_DIR, but we expect
# it in /install
@@ -36,6 +60,16 @@ if [ "$HWCI_FREQ_MAX" = "true" ]; then
# Disable GPU runtime power management
GPU_AUTOSUSPEND=`find /sys/devices -name autosuspend_delay_ms | grep gpu | head -1`
test -z "$GPU_AUTOSUSPEND" || echo -1 > $GPU_AUTOSUSPEND || true
# Lock Intel GPU frequency to 70% of the maximum allowed by hardware
# and enable throttling detection & reporting.
./intel-gpu-freq.sh -s 70% -g all -d
fi
# Increase freedreno hangcheck timer because it's right at the edge of the
# spilling tests timing out (and some traces, too)
if [ -n "$FREEDRENO_HANGCHECK_MS" ]; then
echo $FREEDRENO_HANGCHECK_MS | tee -a /sys/kernel/debug/dri/128/hangcheck_period_ms
fi
# Start a little daemon to capture the first devcoredump we encounter. (They
@@ -61,18 +95,18 @@ if [ -n "$HWCI_START_XORG" ]; then
export DISPLAY=:0
fi
RESULT=fail
if sh $HWCI_TEST_SCRIPT; then
RESULT=pass
rm -rf results/trace/$PIGLIT_REPLAY_DEVICE_NAME
fi
sh -c "$HWCI_TEST_SCRIPT" && RESULT=pass || RESULT=fail
# Let's make sure the results are always stored in current working directory
mv -f ${CI_PROJECT_DIR}/results ./ 2>/dev/null || true
[ "${RESULT}" = "fail" ] || rm -rf results/trace/$PIGLIT_REPLAY_DEVICE_NAME
# upload artifacts
MINIO=$(cat /proc/cmdline | tr ' ' '\n' | grep minio_results | cut -d '=' -f 2 || true)
if [ -n "$MINIO" ]; then
if [ -n "$MINIO_RESULTS_UPLOAD" ]; then
tar -czf results.tar.gz results/;
ci-fairy minio login --token-file "${CI_JOB_JWT_FILE}";
ci-fairy minio cp results.tar.gz minio://"$MINIO"/results.tar.gz;
ci-fairy minio cp results.tar.gz minio://"$MINIO_RESULTS_UPLOAD"/results.tar.gz;
fi
echo "hwci: mesa: $RESULT"

View File

@@ -0,0 +1,567 @@
#!/bin/sh
#
# The Intel i915 GPU driver allows to change the minimum, maximum and boost
# frequencies in steps of 50 MHz via /sys/class/drm/card<n>/<freq_info>,
# where <n> is the DRM card index and <freq_info> one of the following:
#
# - gt_max_freq_mhz (enforced maximum freq)
# - gt_min_freq_mhz (enforced minimum freq)
# - gt_boost_freq_mhz (enforced boost freq)
#
# The hardware capabilities can be accessed via:
#
# - gt_RP0_freq_mhz (supported maximum freq)
# - gt_RPn_freq_mhz (supported minimum freq)
# - gt_RP1_freq_mhz (most efficient freq)
#
# The current frequency can be read from:
# - gt_act_freq_mhz (the actual GPU freq)
# - gt_cur_freq_mhz (the last requested freq)
#
# Copyright (C) 2022 Collabora Ltd.
# Author: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
#
# SPDX-License-Identifier: MIT
#
#
# Constants
#
DRM_FREQ_SYSFS_PATTERN="/sys/class/drm/card%d/gt_%s_freq_mhz"
ENF_FREQ_INFO="max min boost"
CAP_FREQ_INFO="RP0 RPn RP1"
ACT_FREQ_INFO="act cur"
THROTT_DETECT_SLEEP_SEC=2
THROTT_DETECT_PID_FILE_PATH=/tmp/thrott-detect.pid
#
# Global variables.
#
unset INTEL_DRM_CARD_INDEX
unset GET_ACT_FREQ GET_ENF_FREQ GET_CAP_FREQ
unset SET_MIN_FREQ SET_MAX_FREQ
unset MONITOR_FREQ
unset DETECT_THROTT
unset DRY_RUN
#
# Simple printf based stderr logger.
#
log() {
local msg_type=$1
shift
printf "%s: %s: " "${msg_type}" "${0##*/}" >&2
printf "$@" >&2
printf "\n" >&2
}
#
# Helper to print sysfs path for the given card index and freq info.
#
# arg1: Frequency info sysfs name, one of *_FREQ_INFO constants above
# arg2: Video card index, defaults to INTEL_DRM_CARD_INDEX
#
print_freq_sysfs_path() {
printf ${DRM_FREQ_SYSFS_PATTERN} "${2:-${INTEL_DRM_CARD_INDEX}}" "$1"
}
#
# Helper to set INTEL_DRM_CARD_INDEX for the first identified Intel video card.
#
identify_intel_gpu() {
local i=0 vendor path
while [ ${i} -lt 16 ]; do
[ -c "/dev/dri/card$i" ] || {
i=$((i + 1))
continue
}
path=$(print_freq_sysfs_path "" ${i})
path=${path%/*}/device/vendor
[ -r "${path}" ] && read vendor < "${path}" && \
[ "${vendor}" = "0x8086" ] && INTEL_DRM_CARD_INDEX=$i && return 0
i=$((i + 1))
done
return 1
}
#
# Read the specified freq info from sysfs.
#
# arg1: Flag (y/n) to also enable printing the freq info.
# arg2...: Frequency info sysfs name(s), see *_FREQ_INFO constants above
# return: Global variable(s) FREQ_${arg} containing the requested information
#
read_freq_info() {
local var val path print=0 ret=0
[ "$1" = "y" ] && print=1
shift
while [ $# -gt 0 ]; do
var=FREQ_$1
path=$(print_freq_sysfs_path "$1")
[ -r ${path} ] && read ${var} < ${path} || {
log ERROR "Failed to read freq info from: %s" "${path}"
ret=1
continue
}
[ -n "${var}" ] || {
log ERROR "Got empty freq info from: %s" "${path}"
ret=1
continue
}
[ ${print} -eq 1 ] && {
eval val=\$${var}
printf "%6s: %4s MHz\n" "$1" "${val}"
}
shift
done
return ${ret}
}
#
# Display requested info.
#
print_freq_info() {
local req_freq
[ -n "${GET_CAP_FREQ}" ] && {
printf "* Hardware capabilities\n"
read_freq_info y ${CAP_FREQ_INFO}
printf "\n"
}
[ -n "${GET_ENF_FREQ}" ] && {
printf "* Enforcements\n"
read_freq_info y ${ENF_FREQ_INFO}
printf "\n"
}
[ -n "${GET_ACT_FREQ}" ] && {
printf "* Actual\n"
read_freq_info y ${ACT_FREQ_INFO}
printf "\n"
}
}
#
# Helper to print frequency value as requested by user via '-s, --set' option.
# arg1: user requested freq value
#
compute_freq_set() {
local val
case "$1" in
+)
val=${FREQ_RP0}
;;
-)
val=${FREQ_RPn}
;;
*%)
val=$((${1%?} * ${FREQ_RP0} / 100))
# Adjust freq to comply with 50 MHz increments
val=$((val / 50 * 50))
;;
*[!0-9]*)
log ERROR "Cannot set freq to invalid value: %s" "$1"
return 1
;;
"")
log ERROR "Cannot set freq to unspecified value"
return 1
;;
*)
# Adjust freq to comply with 50 MHz increments
val=$(($1 / 50 * 50))
;;
esac
printf "%s" "${val}"
}
#
# Helper for set_freq().
#
set_freq_max() {
log INFO "Setting GPU max freq to %s MHz" "${SET_MAX_FREQ}"
read_freq_info n min || return $?
[ ${SET_MAX_FREQ} -gt ${FREQ_RP0} ] && {
log ERROR "Cannot set GPU max freq (%s) to be greater than hw max freq (%s)" \
"${SET_MAX_FREQ}" "${FREQ_RP0}"
return 1
}
[ ${SET_MAX_FREQ} -lt ${FREQ_RPn} ] && {
log ERROR "Cannot set GPU max freq (%s) to be less than hw min freq (%s)" \
"${SET_MIN_FREQ}" "${FREQ_RPn}"
return 1
}
[ ${SET_MAX_FREQ} -lt ${FREQ_min} ] && {
log ERROR "Cannot set GPU max freq (%s) to be less than min freq (%s)" \
"${SET_MAX_FREQ}" "${FREQ_min}"
return 1
}
[ -z "${DRY_RUN}" ] || return 0
printf "%s" ${SET_MAX_FREQ} | tee $(print_freq_sysfs_path max) \
$(print_freq_sysfs_path boost) > /dev/null
[ $? -eq 0 ] || {
log ERROR "Failed to set GPU max frequency"
return 1
}
}
#
# Helper for set_freq().
#
set_freq_min() {
log INFO "Setting GPU min freq to %s MHz" "${SET_MIN_FREQ}"
read_freq_info n max || return $?
[ ${SET_MIN_FREQ} -gt ${FREQ_max} ] && {
log ERROR "Cannot set GPU min freq (%s) to be greater than max freq (%s)" \
"${SET_MIN_FREQ}" "${FREQ_max}"
return 1
}
[ ${SET_MIN_FREQ} -lt ${FREQ_RPn} ] && {
log ERROR "Cannot set GPU min freq (%s) to be less than hw min freq (%s)" \
"${SET_MIN_FREQ}" "${FREQ_RPn}"
return 1
}
[ -z "${DRY_RUN}" ] || return 0
printf "%s" ${SET_MIN_FREQ} > $(print_freq_sysfs_path min)
[ $? -eq 0 ] || {
log ERROR "Failed to set GPU min frequency"
return 1
}
}
#
# Set min or max or both GPU frequencies to the user indicated values.
#
set_freq() {
# Get hw max & min frequencies
read_freq_info n RP0 RPn || return $?
[ -z "${SET_MAX_FREQ}" ] || {
SET_MAX_FREQ=$(compute_freq_set "${SET_MAX_FREQ}")
[ -z "${SET_MAX_FREQ}" ] && return 1
}
[ -z "${SET_MIN_FREQ}" ] || {
SET_MIN_FREQ=$(compute_freq_set "${SET_MIN_FREQ}")
[ -z "${SET_MIN_FREQ}" ] && return 1
}
#
# Ensure correct operation order, to avoid setting min freq
# to a value which is larger than max freq.
#
# E.g.:
# crt_min=crt_max=600; new_min=new_max=700
# > operation order: max=700; min=700
#
# crt_min=crt_max=600; new_min=new_max=500
# > operation order: min=500; max=500
#
if [ -n "${SET_MAX_FREQ}" ] && [ -n "${SET_MIN_FREQ}" ]; then
[ ${SET_MAX_FREQ} -lt ${SET_MIN_FREQ} ] && {
log ERROR "Cannot set GPU max freq to be less than min freq"
return 1
}
read_freq_info n min || return $?
if [ ${SET_MAX_FREQ} -lt ${FREQ_min} ]; then
set_freq_min || return $?
set_freq_max
else
set_freq_max || return $?
set_freq_min
fi
elif [ -n "${SET_MAX_FREQ}" ]; then
set_freq_max
elif [ -n "${SET_MIN_FREQ}" ]; then
set_freq_min
else
log "Unexpected call to set_freq()"
return 1
fi
}
#
# Helper for detect_throttling().
#
get_thrott_detect_pid() {
[ -e ${THROTT_DETECT_PID_FILE_PATH} ] || return 0
local pid
read pid < ${THROTT_DETECT_PID_FILE_PATH} || {
log ERROR "Failed to read pid from: %s" "${THROTT_DETECT_PID_FILE_PATH}"
return 1
}
local proc_path=/proc/${pid:-invalid}/cmdline
[ -r ${proc_path} ] && grep -qs "${0##*/}" ${proc_path} && {
printf "%s" "${pid}"
return 0
}
# Remove orphaned PID file
rm -rf ${THROTT_DETECT_PID_FILE_PATH}
return 1
}
#
# Control detection and reporting of GPU throttling events.
# arg1: start - run throttle detector in background
# stop - stop throttle detector process, if any
# status - verify if throttle detector is running
#
detect_throttling() {
local pid
pid=$(get_thrott_detect_pid)
case "$1" in
status)
printf "Throttling detector is "
[ -z "${pid}" ] && printf "not running\n" && return 0
printf "running (pid=%s)\n" ${pid}
;;
stop)
[ -z "${pid}" ] && return 0
log INFO "Stopping throttling detector (pid=%s)" "${pid}"
kill ${pid}; sleep 1; kill -0 ${pid} 2>/dev/null && kill -9 ${pid}
rm -rf ${THROTT_DETECT_PID_FILE_PATH}
;;
start)
[ -n "${pid}" ] && {
log WARN "Throttling detector is already running (pid=%s)" ${pid}
return 0
}
(
read_freq_info n RPn || exit $?
while true; do
sleep ${THROTT_DETECT_SLEEP_SEC}
read_freq_info n act min cur || exit $?
#
# The throttling seems to occur when act freq goes below min.
# However, it's necessary to exclude the idle states, where
# act freq normally reaches RPn and cur goes below min.
#
[ ${FREQ_act} -lt ${FREQ_min} ] && \
[ ${FREQ_act} -gt ${FREQ_RPn} ] && \
[ ${FREQ_cur} -ge ${FREQ_min} ] && \
printf "GPU throttling detected: act=%s min=%s cur=%s RPn=%s\n" \
${FREQ_act} ${FREQ_min} ${FREQ_cur} ${FREQ_RPn}
done
) &
pid=$!
log INFO "Started GPU throttling detector (pid=%s)" ${pid}
printf "%s\n" ${pid} > ${THROTT_DETECT_PID_FILE_PATH} || \
log WARN "Failed to write throttle detector PID file"
;;
esac
}
#
# Show help message.
#
print_usage() {
cat <<EOF
Usage: ${0##*/} [OPTION]...
A script to manage Intel GPU frequencies. Can be used for debugging performance
problems or trying to obtain a stable frequency while benchmarking.
Note Intel GPUs only accept specific frequencies, usually multiples of 50 MHz.
Options:
-g, --get [act|enf|cap|all]
Get frequency information: active (default), enforced,
hardware capabilities or all of them.
-s, --set [{min|max}=]{FREQUENCY[%]|+|-}
Set min or max frequency to the given value (MHz).
Append '%' to interpret FREQUENCY as % of hw max.
Use '+' or '-' to set frequency to hardware max or min.
Omit min/max prefix to set both frequencies.
-r, --reset Reset frequencies to hardware defaults.
-m, --monitor [act|enf|cap|all]
Monitor the indicated frequencies via 'watch' utility.
See '-g, --get' option for more details.
-d|--detect-thrott [start|stop|status]
Start (default operation) the throttling detector
as a background process. Use 'stop' or 'status' to
terminate the detector process or verify its status.
--dry-run See what the script will do without applying any
frequency changes.
-h, --help Display this help text and exit.
EOF
}
#
# Parse user input for '-g, --get' option.
# Returns 0 if a value has been provided, otherwise 1.
#
parse_option_get() {
local ret=0
case "$1" in
act) GET_ACT_FREQ=1;;
enf) GET_ENF_FREQ=1;;
cap) GET_CAP_FREQ=1;;
all) GET_ACT_FREQ=1; GET_ENF_FREQ=1; GET_CAP_FREQ=1;;
-*|"")
# No value provided, using default.
GET_ACT_FREQ=1
ret=1
;;
*)
print_usage
exit 1
;;
esac
return ${ret}
}
#
# Validate user input for '-s, --set' option.
#
validate_option_set() {
case "$1" in
+|-|[0-9]%|[0-9][0-9]%)
return 0
;;
*[!0-9]*|"")
print_usage
exit 1
;;
esac
}
#
# Parse script arguments.
#
[ $# -eq 0 ] && { print_usage; exit 1; }
while [ $# -gt 0 ]; do
case "$1" in
-g|--get)
parse_option_get "$2" && shift
;;
-s|--set)
shift
case "$1" in
min=*)
SET_MIN_FREQ=${1#min=}
validate_option_set "${SET_MIN_FREQ}"
;;
max=*)
SET_MAX_FREQ=${1#max=}
validate_option_set "${SET_MAX_FREQ}"
;;
*)
SET_MIN_FREQ=$1
validate_option_set "${SET_MIN_FREQ}"
SET_MAX_FREQ=${SET_MIN_FREQ}
;;
esac
;;
-r|--reset)
RESET_FREQ=1
SET_MIN_FREQ="-"
SET_MAX_FREQ="+"
;;
-m|--monitor)
MONITOR_FREQ=act
parse_option_get "$2" && MONITOR_FREQ=$2 && shift
;;
-d|--detect-thrott)
DETECT_THROTT=start
case "$2" in
start|stop|status)
DETECT_THROTT=$2
shift
;;
esac
;;
--dry-run)
DRY_RUN=1
;;
-h|--help)
print_usage
exit 0
;;
*)
print_usage
exit 1
;;
esac
shift
done
#
# Main
#
RET=0
identify_intel_gpu || {
log INFO "No Intel GPU detected"
exit 0
}
[ -n "${SET_MIN_FREQ}${SET_MAX_FREQ}" ] && { set_freq || RET=$?; }
print_freq_info
[ -n "${DETECT_THROTT}" ] && detect_throttling ${DETECT_THROTT}
[ -n "${MONITOR_FREQ}" ] && {
log INFO "Entering frequency monitoring mode"
sleep 2
exec watch -d -n 1 "$0" -g "${MONITOR_FREQ}"
}
exit ${RET}

View File

@@ -157,3 +157,16 @@ CONFIG_HW_RANDOM_MTK=y
CONFIG_MTK_DEVAPC=y
CONFIG_PWM_MTK_DISP=y
CONFIG_MTK_CMDQ=y
# For nouveau. Note that DRM must be a module so that it's loaded after NFS is up to provide the firmware.
CONFIG_ARCH_TEGRA=y
CONFIG_DRM_NOUVEAU=m
CONFIG_DRM_TEGRA=m
CONFIG_R8169=y
CONFIG_STAGING=y
CONFIG_DRM_TEGRA_STAGING=y
CONFIG_TEGRA_HOST1X=y
CONFIG_ARM_TEGRA_DEVFREQ=y
CONFIG_TEGRA_SOCTHERM=y
CONFIG_DRM_TEGRA_DEBUG=y
CONFIG_PWM_TEGRA=y

View File

@@ -25,7 +25,10 @@ if [[ $arch == "arm64" ]]; then
wget ${ARTIFACTS_URL}/Image.gz
wget ${ARTIFACTS_URL}/cheza-kernel
DEVICE_TREES="apq8016-sbc.dtb apq8096-db820c.dtb"
DEVICE_TREES=""
DEVICE_TREES="$DEVICE_TREES apq8016-sbc.dtb"
DEVICE_TREES="$DEVICE_TREES apq8096-db820c.dtb"
DEVICE_TREES="$DEVICE_TREES tegra210-p3450-0000.dtb"
for DTB in $DEVICE_TREES; do
wget ${ARTIFACTS_URL}/$DTB

View File

@@ -2,13 +2,20 @@
set -ex
CROSVM_VERSION=d2b6a64dd31c92a284a905c0f2483d0b222b1220
git clone --single-branch -b for-mesa-ci --no-checkout https://gitlab.freedesktop.org/tomeu/crosvm.git /platform/crosvm
SCRIPT_DIR="$(pwd)"
CROSVM_VERSION=c7cd0e0114c8363b884ba56d8e12adee718dcc93
git clone --single-branch -b main --no-checkout https://chromium.googlesource.com/chromiumos/platform/crosvm /platform/crosvm
pushd /platform/crosvm
git checkout "$CROSVM_VERSION"
git submodule update --init
# Apply all crosvm patches for Mesa CI
cat "$SCRIPT_DIR"/.gitlab-ci/container/build-crosvm_*.patch |
patch -p1
VIRGLRENDERER_VERSION=2a5fb800c6b0ce15ad37c2c698635e3e2d27b37c
VIRGLRENDERER_VERSION=0564c9a0c2f584e004a7d4864aee3b8ec9692105
rm -rf third_party/virglrenderer
git clone --single-branch -b master --no-checkout https://gitlab.freedesktop.org/virgl/virglrenderer.git third_party/virglrenderer
pushd third_party/virglrenderer
git checkout "$VIRGLRENDERER_VERSION"
meson build/ $EXTRA_MESON_ARGS
@@ -31,4 +38,4 @@ RUSTFLAGS='-L native=/usr/local/lib' cargo install \
popd
rm -rf $PLATFORM2_ROOT $AOSP_EXTERNAL_ROOT/minijail $THIRD_PARTY_ROOT/adhd $THIRD_PARTY_ROOT/rust-vmm /platform/crosvm
rm -rf /platform/crosvm

View File

@@ -0,0 +1,43 @@
From 3c57ec558bccc67fd53363c23deea20646be5c47 Mon Sep 17 00:00:00 2001
From: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Date: Wed, 17 Nov 2021 10:18:04 +0100
Subject: [PATCH] Hack syslog out
It's causing stability problems when running several Crosvm instances in
parallel.
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
---
base/src/unix/linux/syslog.rs | 2 +-
common/sys_util/src/linux/syslog.rs | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/base/src/unix/linux/syslog.rs b/base/src/unix/linux/syslog.rs
index 05972a3a..f0db3781 100644
--- a/base/src/unix/linux/syslog.rs
+++ b/base/src/unix/linux/syslog.rs
@@ -35,7 +35,7 @@ pub struct PlatformSyslog {
impl Syslog for PlatformSyslog {
fn new() -> Result<Self, Error> {
Ok(Self {
- socket: Some(openlog_and_get_socket()?),
+ socket: None,
})
}
diff --git a/common/sys_util/src/linux/syslog.rs b/common/sys_util/src/linux/syslog.rs
index 05972a3a..f0db3781 100644
--- a/common/sys_util/src/linux/syslog.rs
+++ b/common/sys_util/src/linux/syslog.rs
@@ -35,7 +35,7 @@ pub struct PlatformSyslog {
impl Syslog for PlatformSyslog {
fn new() -> Result<Self, Error> {
Ok(Self {
- socket: Some(openlog_and_get_socket()?),
+ socket: None,
})
}
--
2.25.1

View File

@@ -4,19 +4,21 @@ set -ex
if [ -n "${DEQP_RUNNER_GIT_TAG}${DEQP_RUNNER_GIT_REV}" ]; then
# Build and install from source
EXTRA_CARGO_ARGS="--git ${DEQP_RUNNER_GIT_URL:-https://gitlab.freedesktop.org/anholt/deqp-runner.git} ${EXTRA_CARGO_ARGS}"
DEQP_RUNNER_CARGO_ARGS="--git ${DEQP_RUNNER_GIT_URL:-https://gitlab.freedesktop.org/anholt/deqp-runner.git}"
if [ -n "${DEQP_RUNNER_GIT_TAG}" ]; then
EXTRA_CARGO_ARGS="--tag ${DEQP_RUNNER_GIT_TAG} ${EXTRA_CARGO_ARGS}"
DEQP_RUNNER_CARGO_ARGS="--tag ${DEQP_RUNNER_GIT_TAG} ${DEQP_RUNNER_CARGO_ARGS}"
else
EXTRA_CARGO_ARGS="--rev ${DEQP_RUNNER_GIT_REV} ${EXTRA_CARGO_ARGS}"
DEQP_RUNNER_CARGO_ARGS="--rev ${DEQP_RUNNER_GIT_REV} ${DEQP_RUNNER_CARGO_ARGS}"
fi
DEQP_RUNNER_CARGO_ARGS="${DEQP_RUNNER_CARGO_ARGS} ${EXTRA_CARGO_ARGS}"
else
# Install from package registry
EXTRA_CARGO_ARGS="--version 0.11.0 ${EXTRA_CARGO_ARGS} -- deqp-runner"
DEQP_RUNNER_CARGO_ARGS="--version 0.13.1 ${EXTRA_CARGO_ARGS} -- deqp-runner"
fi
cargo install --locked \
-j ${FDO_CI_CONCURRENT:-4} \
--root /usr/local \
${EXTRA_CARGO_ARGS}
${DEQP_RUNNER_CARGO_ARGS}

View File

@@ -6,11 +6,15 @@ git config --global user.email "mesa@example.com"
git config --global user.name "Mesa CI"
git clone \
https://github.com/KhronosGroup/VK-GL-CTS.git \
-b vulkan-cts-1.2.7.2 \
-b vulkan-cts-1.3.1.1 \
--depth 1 \
/VK-GL-CTS
pushd /VK-GL-CTS
# Cherry-pick fix for zlib dependency
git fetch origin main
git cherry-pick -x ec1804831b654ac55bd2a7a5dd27a556afe05030
# --insecure is due to SSL cert failures hitting sourceforge for zlib and
# libpng (sigh). The archives get their checksums checked anyway, and git
# always goes through ssh or https.

View File

@@ -4,7 +4,7 @@ set -ex
git clone https://github.com/ValveSoftware/Fossilize.git
cd Fossilize
git checkout 72088685d90bc814d14aad5505354ffa8a642789
git checkout 16fba1b8b5d9310126bb02323d7bae3227338461
git submodule update --init
mkdir build
cd build

View File

@@ -28,7 +28,7 @@ if [[ -n ${DEVICE_TREES} ]]; then
cp ${DEVICE_TREES} /lava-files/.
fi
if [[ ${DEBIAN_ARCH} = "amd64" ]]; then
if [[ ${DEBIAN_ARCH} = "amd64" || ${DEBIAN_ARCH} = "arm64" ]]; then
make modules
INSTALL_MOD_PATH=/lava-files/rootfs-${DEBIAN_ARCH}/ make modules_install
fi

View File

@@ -2,7 +2,7 @@
set -ex
export LIBDRM_VERSION=libdrm-2.4.109
export LIBDRM_VERSION=libdrm-2.4.110
wget https://dri.freedesktop.org/libdrm/$LIBDRM_VERSION.tar.xz
tar -xvf $LIBDRM_VERSION.tar.xz && rm $LIBDRM_VERSION.tar.xz

View File

@@ -4,7 +4,7 @@ set -ex
git clone https://gitlab.freedesktop.org/mesa/piglit.git --single-branch --no-checkout /piglit
pushd /piglit
git checkout af1785f31f65622d9b1ca1c08c75cf140bc7ed22
git checkout 445711587d461539a4d8f9d35a7fe996a86d3c8d
patch -p1 <$OLDPWD/.gitlab-ci/piglit/disable-vs_in.diff
cmake -S . -B . -G Ninja -DCMAKE_BUILD_TYPE=Release $PIGLIT_OPTS $EXTRA_CMAKE_ARGS
ninja $PIGLIT_BUILD_TARGETS

View File

@@ -1,61 +1,76 @@
#!/bin/bash
#
# Copyright (C) 2022 Collabora Limited
# Author: Guilherme Gallo <guilherme.gallo@collabora.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
create_gn_args() {
# gn can be configured to cross-compile skia and its tools
# It is important to set the target_cpu to guarantee the intended target
# machine
cp "${BASE_ARGS_GN_FILE}" "${SKQP_OUT_DIR}"/args.gn
echo "target_cpu = \"${SKQP_ARCH}\"" >> "${SKQP_OUT_DIR}"/args.gn
}
download_skqp_models() (
# The download_model.py script needs a checksum file to know what models
# version to download.
# This is the most recent commit available in the skia repository with a
# valid files.checksum
SKIA_LAST_SKQP_CUT_COMMIT_SHA=ccf5f0d75b6a6b54756f2c62d57e3730eed8aa45
git fetch origin "${SKIA_LAST_SKQP_CUT_COMMIT_SHA}:refs/remotes/origin/${SKIA_LAST_SKQP_CUT_COMMIT_SHA}"
git checkout "${SKIA_LAST_SKQP_CUT_COMMIT_SHA}" -- \
platform_tools/android/apps/skqp/src/main/assets/files.checksum
download_skia_source() {
if [ -z ${SKIA_DIR+x} ]
then
return 1
fi
# The following patch transforms download_model.py from python2 to python3.
git apply "${DOWNLOAD_MODEL_PATCH_FILE}"
python3 tools/skqp/download_model.py
# Skia cloned from https://android.googlesource.com/platform/external/skqp
# has all needed assets tracked on git-fs
SKQP_REPO=https://android.googlesource.com/platform/external/skqp
SKQP_BRANCH=android-cts-10.0_r11
# Copy resources from skia to skqp directory
python3 tools/skqp/setup_resources
)
git clone --branch "${SKQP_BRANCH}" --depth 1 "${SKQP_REPO}" "${SKIA_DIR}"
}
set -ex
SCRIPT_DIR=$(realpath "$(dirname "$0")")
FETCH_GN_PATCH_FILE="${SCRIPT_DIR}/build-skqp_fetch-gn.patch"
SKQP_PATCH_DIR="${SCRIPT_DIR}"
BASE_ARGS_GN_FILE="${SCRIPT_DIR}/build-skqp_base.gn"
DOWNLOAD_MODEL_PATCH_FILE="${SCRIPT_DIR}/build-skqp_download_model.patch"
SKQP_ARCH=${SKQP_ARCH:-x64}
SKIA_DIR=${SKIA_DIR:-$(mktemp -d)}
SKQP_DIR=${SKQP_DIR:-$(mktemp -d)}
SKQP_OUT_DIR=${SKIA_DIR}/out/${SKQP_ARCH}
SKQP_INSTALL_DIR=/skqp
SKQP_ASSETS_DIR="${SKQP_INSTALL_DIR}/assets"
# Build list_gpu_unit_tests to update the unittests.txt file properly to the
# target hardware.
SKQP_BINARIES=(skqp list_gpu_unit_tests)
SKQP_BINARIES=(skqp)
# Using a recent release version to mitigate instability during test phase
SKIA_COMMIT_SHA="canvaskit/0.32.0"
git clone 'https://skia.googlesource.com/skia/' \
--single-branch \
-b "${SKIA_COMMIT_SHA}" \
"${SKIA_DIR}"
download_skia_source
pushd "${SKIA_DIR}"
git apply "${FETCH_GN_PATCH_FILE}"
# Fetch some needed build tools needed to build skia/skqp
# Basically, it clones repositories with commits SHAs from
# ${SKIA_DIR}/DEPS directory
python3 tools/git-sync-deps
# Apply all skqp patches for Mesa CI
cat "${SKQP_PATCH_DIR}"/build-skqp_*.patch |
patch -p1
# Fetch some needed build tools needed to build skia/skqp.
# Basically, it clones repositories with commits SHAs from ${SKIA_DIR}/DEPS
# directory.
python tools/git-sync-deps
mkdir -p "${SKQP_OUT_DIR}"
mkdir -p "${SKQP_INSTALL_DIR}"
@@ -68,15 +83,15 @@ bin/gn gen "${SKQP_OUT_DIR}"
for BINARY in "${SKQP_BINARIES[@]}"
do
/usr/bin/ninja -C "${SKQP_OUT_DIR}" "${BINARY}"
# Strip binary, since gn is not stripping it even when `is_debug == false`
${STRIP_CMD:-strip} "${SKQP_OUT_DIR}/${BINARY}"
install -m 0755 "${SKQP_OUT_DIR}/${BINARY}" "${SKQP_INSTALL_DIR}"
done
# Acquire assets and move them to the target directory.
download_skqp_models
# Move assets to the target directory, which will reside in rootfs.
mv platform_tools/android/apps/skqp/src/main/assets/ "${SKQP_ASSETS_DIR}"
popd
rm -Rf "${SKQP_DIR}"
rm -Rf "${SKIA_DIR}"
set +ex

View File

@@ -0,0 +1,13 @@
diff --git a/BUILD.gn b/BUILD.gn
index d2b1407..7b60c90 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -144,7 +144,7 @@ config("skia_public") {
# Skia internal APIs, used by Skia itself and a few test tools.
config("skia_private") {
- visibility = [ ":*" ]
+ visibility = [ "*" ]
include_dirs = [
"include/private",

View File

@@ -1,8 +1,30 @@
cc = "gcc"
cxx = "g++"
cc = "clang"
cxx = "clang++"
extra_cflags = [ "-DSK_ENABLE_DUMP_GPU", "-DSK_BUILD_FOR_SKQP" ]
extra_cflags_cc = [ "-static", "-Wno-error", "-Wno-macro-redefined", "-Wno-suggest-destructor-override", "-Wno-suggest-override" ]
extra_cflags_cc = [
"-Wno-error",
# skqp build process produces a lot of compilation warnings, silencing
# most of them to remove clutter and avoid the CI job log to exceed the
# maximum size
# GCC flags
"-Wno-redundant-move",
"-Wno-suggest-override",
"-Wno-class-memaccess",
"-Wno-deprecated-copy",
"-Wno-uninitialized",
# Clang flags
"-Wno-macro-redefined",
"-Wno-anon-enum-enum-conversion",
"-Wno-suggest-destructor-override",
"-Wno-return-std-move-in-c++11",
"-Wno-extra-semi-stmt",
]
cc_wrapper = "ccache"
is_debug = false

View File

@@ -1,22 +0,0 @@
diff --git a/tools/skqp/download_model.py b/tools/skqp/download_model.py
index fb0020e481..a5d8a03754 100755
--- a/tools/skqp/download_model.py
+++ b/tools/skqp/download_model.py
@@ -10,7 +10,7 @@ import os
import shutil
import sys
import tempfile
-import urllib2
+import urllib.request, urllib.error, urllib.parse
def checksum(path):
if not os.path.exists(path):
@@ -33,7 +33,7 @@ def download(md5, path):
pass # ignore race condition
url = 'https://storage.googleapis.com/skia-skqp-assets/' + md5
with open(path, 'wb') as o:
- shutil.copyfileobj(urllib2.urlopen(url), o)
+ shutil.copyfileobj(urllib.request.urlopen(url), o)
def tmp(prefix):
fd, path = tempfile.mkstemp(prefix=prefix)

View File

@@ -1,13 +0,0 @@
diff --git a/bin/fetch-gn b/bin/fetch-gn
index b4bb14c630..59c4591a30 100755
--- a/bin/fetch-gn
+++ b/bin/fetch-gn
@@ -23,7 +23,7 @@ os.chdir(os.path.join(os.path.dirname(__file__), os.pardir))
gnzip = os.path.join(tempfile.mkdtemp(), 'gn.zip')
with open(gnzip, 'wb') as f:
OS = {'darwin': 'mac', 'linux': 'linux', 'linux2': 'linux', 'win32': 'windows'}[sys.platform]
- cpu = {'amd64': 'amd64', 'arm64': 'arm64', 'x86_64': 'amd64'}[platform.machine().lower()]
+ cpu = {'amd64': 'amd64', 'arm64': 'arm64', 'x86_64': 'amd64', 'aarch64': 'arm64'}[platform.machine().lower()]
rev = 'd62642c920e6a0d1756316d225a90fd6faa9e21e'
url = 'https://chrome-infra-packages.appspot.com/dl/gn/gn/{}-{}/+/git_revision:{}'.format(

View File

@@ -0,0 +1,68 @@
diff --git a/bin/fetch-gn b/bin/fetch-gn
index d5e94a2..59c4591 100755
--- a/bin/fetch-gn
+++ b/bin/fetch-gn
@@ -5,39 +5,44 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import hashlib
import os
+import platform
import shutil
import stat
import sys
-import urllib2
+import tempfile
+import zipfile
+
+if sys.version_info[0] < 3:
+ from urllib2 import urlopen
+else:
+ from urllib.request import urlopen
os.chdir(os.path.join(os.path.dirname(__file__), os.pardir))
-dst = 'bin/gn.exe' if 'win32' in sys.platform else 'bin/gn'
+gnzip = os.path.join(tempfile.mkdtemp(), 'gn.zip')
+with open(gnzip, 'wb') as f:
+ OS = {'darwin': 'mac', 'linux': 'linux', 'linux2': 'linux', 'win32': 'windows'}[sys.platform]
+ cpu = {'amd64': 'amd64', 'arm64': 'arm64', 'x86_64': 'amd64', 'aarch64': 'arm64'}[platform.machine().lower()]
-sha1 = '2f27ff0b6118e5886df976da5effa6003d19d1ce' if 'linux' in sys.platform else \
- '9be792dd9010ce303a9c3a497a67bcc5ac8c7666' if 'darwin' in sys.platform else \
- 'eb69be2d984b4df60a8c21f598135991f0ad1742' # Windows
+ rev = 'd62642c920e6a0d1756316d225a90fd6faa9e21e'
+ url = 'https://chrome-infra-packages.appspot.com/dl/gn/gn/{}-{}/+/git_revision:{}'.format(
+ OS,cpu,rev)
+ f.write(urlopen(url).read())
-def sha1_of_file(path):
- h = hashlib.sha1()
- if os.path.isfile(path):
- with open(path, 'rb') as f:
- h.update(f.read())
- return h.hexdigest()
+gn = 'gn.exe' if 'win32' in sys.platform else 'gn'
+with zipfile.ZipFile(gnzip, 'r') as f:
+ f.extract(gn, 'bin')
-if sha1_of_file(dst) != sha1:
- with open(dst, 'wb') as f:
- f.write(urllib2.urlopen('https://chromium-gn.storage-download.googleapis.com/' + sha1).read())
+gn = os.path.join('bin', gn)
- os.chmod(dst, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR |
- stat.S_IRGRP | stat.S_IXGRP |
- stat.S_IROTH | stat.S_IXOTH )
+os.chmod(gn, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR |
+ stat.S_IRGRP | stat.S_IXGRP |
+ stat.S_IROTH | stat.S_IXOTH )
# We'll also copy to a path that depot_tools' GN wrapper will expect to find the binary.
copy_path = 'buildtools/linux64/gn' if 'linux' in sys.platform else \
'buildtools/mac/gn' if 'darwin' in sys.platform else \
'buildtools/win/gn.exe'
if os.path.isdir(os.path.dirname(copy_path)):
- shutil.copy(dst, copy_path)
+ shutil.copy(gn, copy_path)

View File

@@ -0,0 +1,142 @@
Patch based from diff with skia repository from commit
013397884c73959dc07cb0a26ee742b1cdfbda8a
Adds support for Python3, but removes the constraint of only SHA based refs in
DEPS
diff --git a/tools/git-sync-deps b/tools/git-sync-deps
index c7379c0b5c..f63d4d9ccf 100755
--- a/tools/git-sync-deps
+++ b/tools/git-sync-deps
@@ -43,7 +43,7 @@ def git_executable():
A string suitable for passing to subprocess functions, or None.
"""
envgit = os.environ.get('GIT_EXECUTABLE')
- searchlist = ['git']
+ searchlist = ['git', 'git.bat']
if envgit:
searchlist.insert(0, envgit)
with open(os.devnull, 'w') as devnull:
@@ -94,21 +94,25 @@ def is_git_toplevel(git, directory):
try:
toplevel = subprocess.check_output(
[git, 'rev-parse', '--show-toplevel'], cwd=directory).strip()
- return os.path.realpath(directory) == os.path.realpath(toplevel)
+ return os.path.realpath(directory) == os.path.realpath(toplevel.decode())
except subprocess.CalledProcessError:
return False
-def status(directory, checkoutable):
- def truncate(s, length):
+def status(directory, commithash, change):
+ def truncate_beginning(s, length):
+ return s if len(s) <= length else '...' + s[-(length-3):]
+ def truncate_end(s, length):
return s if len(s) <= length else s[:(length - 3)] + '...'
+
dlen = 36
- directory = truncate(directory, dlen)
- checkoutable = truncate(checkoutable, 40)
- sys.stdout.write('%-*s @ %s\n' % (dlen, directory, checkoutable))
+ directory = truncate_beginning(directory, dlen)
+ commithash = truncate_end(commithash, 40)
+ symbol = '>' if change else '@'
+ sys.stdout.write('%-*s %s %s\n' % (dlen, directory, symbol, commithash))
-def git_checkout_to_directory(git, repo, checkoutable, directory, verbose):
+def git_checkout_to_directory(git, repo, commithash, directory, verbose):
"""Checkout (and clone if needed) a Git repository.
Args:
@@ -117,8 +121,7 @@ def git_checkout_to_directory(git, repo, checkoutable, directory, verbose):
repo (string) the location of the repository, suitable
for passing to `git clone`.
- checkoutable (string) a tag, branch, or commit, suitable for
- passing to `git checkout`
+ commithash (string) a commit, suitable for passing to `git checkout`
directory (string) the path into which the repository
should be checked out.
@@ -129,7 +132,12 @@ def git_checkout_to_directory(git, repo, checkoutable, directory, verbose):
"""
if not os.path.isdir(directory):
subprocess.check_call(
- [git, 'clone', '--quiet', repo, directory])
+ [git, 'clone', '--quiet', '--no-checkout', repo, directory])
+ subprocess.check_call([git, 'checkout', '--quiet', commithash],
+ cwd=directory)
+ if verbose:
+ status(directory, commithash, True)
+ return
if not is_git_toplevel(git, directory):
# if the directory exists, but isn't a git repo, you will modify
@@ -145,11 +153,11 @@ def git_checkout_to_directory(git, repo, checkoutable, directory, verbose):
with open(os.devnull, 'w') as devnull:
# If this fails, we will fetch before trying again. Don't spam user
# with error infomation.
- if 0 == subprocess.call([git, 'checkout', '--quiet', checkoutable],
+ if 0 == subprocess.call([git, 'checkout', '--quiet', commithash],
cwd=directory, stderr=devnull):
# if this succeeds, skip slow `git fetch`.
if verbose:
- status(directory, checkoutable) # Success.
+ status(directory, commithash, False) # Success.
return
# If the repo has changed, always force use of the correct repo.
@@ -159,18 +167,24 @@ def git_checkout_to_directory(git, repo, checkoutable, directory, verbose):
subprocess.check_call([git, 'fetch', '--quiet'], cwd=directory)
- subprocess.check_call([git, 'checkout', '--quiet', checkoutable], cwd=directory)
+ subprocess.check_call([git, 'checkout', '--quiet', commithash], cwd=directory)
if verbose:
- status(directory, checkoutable) # Success.
+ status(directory, commithash, True) # Success.
def parse_file_to_dict(path):
dictionary = {}
- execfile(path, dictionary)
+ with open(path) as f:
+ exec('def Var(x): return vars[x]\n' + f.read(), dictionary)
return dictionary
+def is_sha1_sum(s):
+ """SHA1 sums are 160 bits, encoded as lowercase hexadecimal."""
+ return len(s) == 40 and all(c in '0123456789abcdef' for c in s)
+
+
def git_sync_deps(deps_file_path, command_line_os_requests, verbose):
"""Grab dependencies, with optional platform support.
@@ -204,19 +218,19 @@ def git_sync_deps(deps_file_path, command_line_os_requests, verbose):
raise Exception('%r is parent of %r' % (other_dir, directory))
list_of_arg_lists = []
for directory in sorted(dependencies):
- if not isinstance(dependencies[directory], basestring):
+ if not isinstance(dependencies[directory], str):
if verbose:
- print 'Skipping "%s".' % directory
+ sys.stdout.write( 'Skipping "%s".\n' % directory)
continue
if '@' in dependencies[directory]:
- repo, checkoutable = dependencies[directory].split('@', 1)
+ repo, commithash = dependencies[directory].split('@', 1)
else:
- raise Exception("please specify commit or tag")
+ raise Exception("please specify commit")
relative_directory = os.path.join(deps_file_directory, directory)
list_of_arg_lists.append(
- (git, repo, checkoutable, relative_directory, verbose))
+ (git, repo, commithash, relative_directory, verbose))
multithread(git_checkout_to_directory, list_of_arg_lists)

View File

@@ -0,0 +1,13 @@
diff --git a/gn/BUILDCONFIG.gn b/gn/BUILDCONFIG.gn
index 454334a..1797594 100644
--- a/gn/BUILDCONFIG.gn
+++ b/gn/BUILDCONFIG.gn
@@ -80,7 +80,7 @@ if (current_cpu == "") {
is_clang = is_android || is_ios || is_mac ||
(cc == "clang" && cxx == "clang++") || clang_win != ""
if (!is_clang && !is_win) {
- is_clang = exec_script("gn/is_clang.py",
+ is_clang = exec_script("//gn/is_clang.py",
[
cc,
cxx,

View File

@@ -2,8 +2,8 @@
set -ex
VKD3D_PROTON_VERSION="2.3.1"
VKD3D_PROTON_COMMIT="3ed3526332f53d7d35cf1b685fa8096b01f26ff0"
VKD3D_PROTON_VERSION="2.6"
VKD3D_PROTON_COMMIT="3e5aab6fb3e18f81a71b339be4cb5cdf55140980"
VKD3D_PROTON_DST_DIR="/vkd3d-proton-tests"
VKD3D_PROTON_SRC_DIR="/vkd3d-proton-src"

View File

@@ -10,7 +10,7 @@ fi
export CCACHE_COMPILERCHECK=content
export CCACHE_COMPRESS=true
export CCACHE_DIR=/cache/mesa/ccache
export CCACHE_DIR=/cache/$CI_PROJECT_NAME/ccache
export PATH=$CCACHE_PATH:$PATH
# CMake ignores $PATH, so we have to force CC/GCC to the ccache versions.

View File

@@ -4,16 +4,25 @@ set -ex
if [ $DEBIAN_ARCH = arm64 ]; then
ARCH_PACKAGES="firmware-qcom-media
firmware-linux-nonfree
libfontconfig1
libgl1
libglu1-mesa
libvulkan-dev
"
elif [ $DEBIAN_ARCH = amd64 ]; then
ARCH_PACKAGES="firmware-amd-graphics
inetutils-syslogd
iptables
libcap2
libelf1
libfdt1
libllvm11
libva2
libva-drm2
socat
spirv-tools
sysvinit-core
"
fi
@@ -27,6 +36,8 @@ INSTALL_CI_FAIRY_PACKAGES="git
apt-get -y install --no-install-recommends \
$ARCH_PACKAGES \
$INSTALL_CI_FAIRY_PACKAGES \
$EXTRA_LOCAL_PACKAGES \
bash \
ca-certificates \
firmware-realtek \
initramfs-tools \
@@ -70,8 +81,7 @@ apt-get -y install --no-install-recommends \
waffle-utils \
wget \
xinit \
xserver-xorg-core \
xz-utils
xserver-xorg-core
# Needed for ci-fairy, this revision is able to upload files to
# MinIO and doesn't depend on git
@@ -94,10 +104,6 @@ chmod +x /init
# Strip the image to a small minimal system without removing the debian
# toolchain.
# xz compress firmware so it doesn't waste RAM at runtime on ramdisk systems
find /lib/firmware -type f -print0 | \
xargs -0r -P4 -n4 xz -T1 -C crc32
# Copy timezone file and remove tzdata package
rm -rf /etc/localtime
cp /usr/share/zoneinfo/Etc/UTC /etc/localtime
@@ -166,9 +172,7 @@ UNNEEDED_PACKAGES="apt libapt-pkg6.0 "\
"insserv "\
"udev "\
"init-system-helpers "\
"bash "\
"cpio "\
"xz-utils "\
"passwd "\
"libsemanage1 libsemanage-common "\
"libsepol1 "\
@@ -213,7 +217,7 @@ rm -rf var/* opt srv share
# ca-certificates are in /etc drop the source
rm -rf usr/share/ca-certificates
# No bash, no need for completions
# No need for completions
rm -rf usr/share/bash-completion
# No zsh, no need for comletions

View File

@@ -30,7 +30,7 @@ sh .gitlab-ci/container/create-android-cross-file.sh /$ndk arm-linux-androideabi
# Not using build-libdrm.sh because we don't want its cleanup after building
# each arch. Fetch and extract now.
export LIBDRM_VERSION=libdrm-2.4.109
export LIBDRM_VERSION=libdrm-2.4.110
wget https://dri.freedesktop.org/libdrm/$LIBDRM_VERSION.tar.xz
tar -xf $LIBDRM_VERSION.tar.xz && rm $LIBDRM_VERSION.tar.xz

View File

@@ -9,6 +9,7 @@ echo 'deb https://deb.debian.org/debian buster main' >/etc/apt/sources.list.d/bu
apt-get update
apt-get -y install \
${EXTRA_LOCAL_PACKAGES} \
abootimg \
autoconf \
automake \

View File

@@ -31,3 +31,9 @@ arch=armhf . .gitlab-ci/container/baremetal_build.sh
# This firmware file from Debian bullseye causes hangs
wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/qcom/a530_pfp.fw?id=d5f9eea5a251d43412b07f5295d03e97b89ac4a5 \
-O /rootfs-arm64/lib/firmware/qcom/a530_pfp.fw
mkdir -p /baremetal-files/jetson-nano/boot/
ln -s \
/baremetal-files/Image \
/baremetal-files/tegra210-p3450-0000.dtb \
/baremetal-files/jetson-nano/boot/

View File

@@ -44,6 +44,8 @@ apt-get install -y --no-remove \
llvm-11-dev \
llvm-9-dev \
ocl-icd-opencl-dev \
python3-freezegun \
python3-pytest \
procps \
spirv-tools \
strace \

View File

@@ -64,6 +64,7 @@ apt-get install -y --no-remove \
python3-lxml \
python3-renderdoc \
python3-simplejson \
socat \
spirv-tools \
sysvinit-core \
wget

View File

@@ -27,6 +27,7 @@ dnf install -y --setopt=install_weak_deps=False \
gettext \
kernel-headers \
llvm-devel \
clang-devel \
meson \
"pkgconfig(dri2proto)" \
"pkgconfig(expat)" \
@@ -63,6 +64,8 @@ dnf install -y --setopt=install_weak_deps=False \
python3-devel \
python3-mako \
vulkan-headers \
spirv-tools-devel \
spirv-llvm-translator-devel \
$EPHEMERAL

View File

@@ -0,0 +1,420 @@
# Docker image tag helper templates
.incorporate-templates-commit:
variables:
FDO_DISTRIBUTION_TAG: "${MESA_IMAGE_TAG}--${MESA_TEMPLATES_COMMIT}"
.incorporate-base-tag+templates-commit:
variables:
FDO_BASE_IMAGE: "${CI_REGISTRY_IMAGE}/${MESA_BASE_IMAGE}:${MESA_BASE_TAG}--${MESA_TEMPLATES_COMMIT}"
FDO_DISTRIBUTION_TAG: "${MESA_IMAGE_TAG}--${MESA_BASE_TAG}--${MESA_TEMPLATES_COMMIT}"
.set-image:
extends:
- .incorporate-templates-commit
variables:
MESA_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${FDO_DISTRIBUTION_TAG}"
image: "$MESA_IMAGE"
.set-image-base-tag:
extends:
- .set-image
- .incorporate-base-tag+templates-commit
variables:
MESA_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${FDO_DISTRIBUTION_TAG}"
# Build the CI docker images.
#
# MESA_IMAGE_TAG is the tag of the docker image used by later stage jobs. If the
# image doesn't exist yet, the container stage job generates it.
#
# In order to generate a new image, one should generally change the tag.
# While removing the image from the registry would also work, that's not
# recommended except for ephemeral images during development: Replacing
# an image after a significant amount of time might pull in newer
# versions of gcc/clang or other packages, which might break the build
# with older commits using the same tag.
#
# After merging a change resulting in generating a new image to the
# main repository, it's recommended to remove the image from the source
# repository's container registry, so that the image from the main
# repository's registry will be used there as well.
.container:
stage: container
extends:
- .container-rules
- .incorporate-templates-commit
variables:
FDO_DISTRIBUTION_VERSION: bullseye-slim
FDO_REPO_SUFFIX: $CI_JOB_NAME
FDO_DISTRIBUTION_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/container/${CI_JOB_NAME}.sh'
# no need to pull the whole repo to build the container image
GIT_STRATEGY: none
.use-base-image:
extends:
- .container
- .incorporate-base-tag+templates-commit
# Don't want the .container rules
- .ci-run-policy
# Debian 11 based x86 build image base
debian/x86_build-base:
extends:
- .fdo.container-build@debian
- .container
variables:
MESA_IMAGE_TAG: &debian-x86_build-base ${DEBIAN_BASE_TAG}
.use-debian/x86_build-base:
extends:
- .fdo.container-build@debian
- .use-base-image
variables:
MESA_BASE_IMAGE: ${DEBIAN_X86_BUILD_BASE_IMAGE}
MESA_BASE_TAG: *debian-x86_build-base
MESA_ARTIFACTS_BASE_TAG: *debian-x86_build-base
needs:
- debian/x86_build-base
# Debian 11 based x86 main build image
debian/x86_build:
extends:
- .use-debian/x86_build-base
variables:
MESA_IMAGE_TAG: &debian-x86_build ${DEBIAN_BUILD_TAG}
.use-debian/x86_build:
extends:
- .set-image-base-tag
variables:
MESA_BASE_TAG: *debian-x86_build-base
MESA_IMAGE_PATH: ${DEBIAN_X86_BUILD_IMAGE_PATH}
MESA_IMAGE_TAG: *debian-x86_build
needs:
- debian/x86_build
# Debian 11 based i386 cross-build image
debian/i386_build:
extends:
- .use-debian/x86_build-base
variables:
MESA_IMAGE_TAG: &debian-i386_build ${DEBIAN_BUILD_TAG}
.use-debian/i386_build:
extends:
- .set-image-base-tag
variables:
MESA_BASE_TAG: *debian-x86_build-base
MESA_IMAGE_PATH: "debian/i386_build"
MESA_IMAGE_TAG: *debian-i386_build
needs:
- debian/i386_build
# Debian 11 based ppc64el cross-build image
debian/ppc64el_build:
extends:
- .use-debian/x86_build-base
variables:
MESA_IMAGE_TAG: &debian-ppc64el_build ${DEBIAN_BUILD_TAG}
.use-debian/ppc64el_build:
extends:
- .set-image-base-tag
variables:
MESA_BASE_TAG: *debian-x86_build-base
MESA_IMAGE_PATH: "debian/ppc64el_build"
MESA_IMAGE_TAG: *debian-ppc64el_build
needs:
- debian/ppc64el_build
# Debian 11 based s390x cross-build image
debian/s390x_build:
extends:
- .use-debian/x86_build-base
variables:
MESA_IMAGE_TAG: &debian-s390x_build ${DEBIAN_BUILD_TAG}
.use-debian/s390x_build:
extends:
- .set-image-base-tag
variables:
MESA_BASE_TAG: *debian-x86_build-base
MESA_IMAGE_PATH: "debian/s390x_build"
MESA_IMAGE_TAG: *debian-s390x_build
needs:
- debian/s390x_build
# Android NDK cross-build image
debian/android_build:
extends:
- .use-debian/x86_build-base
variables:
MESA_IMAGE_TAG: &debian-android_build ${DEBIAN_BUILD_TAG}
.use-debian/android_build:
extends:
- .set-image-base-tag
variables:
MESA_BASE_TAG: *debian-x86_build-base
MESA_IMAGE_PATH: "debian/android_build"
MESA_IMAGE_TAG: *debian-android_build
needs:
- debian/android_build
# Debian 11 based x86 test image base
debian/x86_test-base:
extends: debian/x86_build-base
variables:
MESA_IMAGE_TAG: &debian-x86_test-base ${DEBIAN_BASE_TAG}
.use-debian/x86_test-base:
extends:
- .fdo.container-build@debian
- .use-base-image
variables:
MESA_BASE_IMAGE: ${DEBIAN_X86_TEST_BASE_IMAGE}
MESA_BASE_TAG: *debian-x86_test-base
needs:
- debian/x86_test-base
# Debian 11 based x86 test image for GL
debian/x86_test-gl:
extends: .use-debian/x86_test-base
variables:
FDO_DISTRIBUTION_EXEC: 'env KERNEL_URL=${KERNEL_URL} FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/container/${CI_JOB_NAME}.sh'
KERNEL_URL: &kernel-rootfs-url "https://gitlab.freedesktop.org/gfx-ci/linux/-/archive/v5.16-for-mesa-ci-991fec6622591/linux-v5.16-for-mesa-ci-991fec6622591.tar.bz2"
MESA_IMAGE_TAG: &debian-x86_test-gl ${DEBIAN_X86_TEST_GL_TAG}
.use-debian/x86_test-gl:
extends:
- .set-image-base-tag
variables:
MESA_BASE_TAG: *debian-x86_test-base
MESA_IMAGE_PATH: ${DEBIAN_X86_TEST_IMAGE_PATH}
MESA_IMAGE_TAG: *debian-x86_test-gl
needs:
- debian/x86_test-gl
# Debian 11 based x86 test image for VK
debian/x86_test-vk:
extends: .use-debian/x86_test-base
variables:
MESA_IMAGE_TAG: &debian-x86_test-vk ${DEBIAN_X86_TEST_VK_TAG}
.use-debian/x86_test-vk:
extends:
- .set-image-base-tag
variables:
MESA_BASE_TAG: *debian-x86_test-base
MESA_IMAGE_PATH: "debian/x86_test-vk"
MESA_IMAGE_TAG: *debian-x86_test-vk
needs:
- debian/x86_test-vk
# Debian 11 based ARM build image
debian/arm_build:
extends:
- .fdo.container-build@debian
- .container
tags:
- aarch64
variables:
MESA_IMAGE_TAG: &debian-arm_build ${DEBIAN_BASE_TAG}
.use-debian/arm_build:
extends:
- .set-image
variables:
MESA_IMAGE_PATH: "debian/arm_build"
MESA_IMAGE_TAG: *debian-arm_build
MESA_ARTIFACTS_TAG: *debian-arm_build
needs:
- debian/arm_build
# Fedora 34 based x86 build image
fedora/x86_build:
extends:
- .fdo.container-build@fedora
- .container
variables:
FDO_DISTRIBUTION_VERSION: 34
MESA_IMAGE_TAG: &fedora-x86_build ${FEDORA_X86_BUILD_TAG}
.use-fedora/x86_build:
extends:
- .set-image
variables:
MESA_IMAGE_PATH: "fedora/x86_build"
MESA_IMAGE_TAG: *fedora-x86_build
needs:
- fedora/x86_build
.kernel+rootfs:
extends:
- .ci-run-policy
stage: container
variables:
GIT_STRATEGY: fetch
KERNEL_URL: *kernel-rootfs-url
MESA_ROOTFS_TAG: &kernel-rootfs ${KERNEL_ROOTFS_TAG}
DISTRIBUTION_TAG: &distribution-tag-arm "${MESA_ROOTFS_TAG}--${MESA_ARTIFACTS_TAG}--${MESA_TEMPLATES_COMMIT}"
script:
- .gitlab-ci/container/lava_build.sh
kernel+rootfs_amd64:
extends:
- .use-debian/x86_build-base
- .kernel+rootfs
image: "$FDO_BASE_IMAGE"
variables:
DEBIAN_ARCH: "amd64"
DISTRIBUTION_TAG: &distribution-tag-amd64 "${MESA_ROOTFS_TAG}--${MESA_ARTIFACTS_BASE_TAG}--${MESA_TEMPLATES_COMMIT}"
kernel+rootfs_arm64:
extends:
- .use-debian/arm_build
- .kernel+rootfs
tags:
- aarch64
variables:
DEBIAN_ARCH: "arm64"
kernel+rootfs_armhf:
extends:
- kernel+rootfs_arm64
variables:
DEBIAN_ARCH: "armhf"
# Cannot use anchors defined here from included files, so use extends: instead
.use-kernel+rootfs-arm:
variables:
DISTRIBUTION_TAG: *distribution-tag-arm
MESA_ROOTFS_TAG: *kernel-rootfs
.use-kernel+rootfs-amd64:
variables:
DISTRIBUTION_TAG: *distribution-tag-amd64
MESA_ROOTFS_TAG: *kernel-rootfs
# x86 image with ARM64 & armhf kernel & rootfs for baremetal testing
debian/arm_test:
extends:
- .fdo.container-build@debian
- .container
# Don't want the .container rules
- .ci-run-policy
needs:
- kernel+rootfs_arm64
- kernel+rootfs_armhf
variables:
FDO_DISTRIBUTION_EXEC: 'env ARTIFACTS_PREFIX=https://${MINIO_HOST}/mesa-lava ARTIFACTS_SUFFIX=${MESA_ROOTFS_TAG}--${MESA_ARM_BUILD_TAG}--${MESA_TEMPLATES_COMMIT} CI_PROJECT_PATH=${CI_PROJECT_PATH} FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} FDO_UPSTREAM_REPO=${FDO_UPSTREAM_REPO} bash .gitlab-ci/container/${CI_JOB_NAME}.sh'
FDO_DISTRIBUTION_TAG: "${MESA_IMAGE_TAG}--${MESA_ROOTFS_TAG}--${MESA_ARM_BUILD_TAG}--${MESA_TEMPLATES_COMMIT}"
MESA_ARM_BUILD_TAG: *debian-arm_build
MESA_IMAGE_TAG: &debian-arm_test ${DEBIAN_BASE_TAG}
MESA_ROOTFS_TAG: *kernel-rootfs
.use-debian/arm_test:
image: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${MESA_IMAGE_TAG}--${MESA_ROOTFS_TAG}--${MESA_ARM_BUILD_TAG}--${MESA_TEMPLATES_COMMIT}"
variables:
MESA_ARM_BUILD_TAG: *debian-arm_build
MESA_IMAGE_PATH: "debian/arm_test"
MESA_IMAGE_TAG: *debian-arm_test
MESA_ROOTFS_TAG: *kernel-rootfs
needs:
- debian/arm_test
# Native Windows docker builds
#
# Unlike the above Linux-based builds - including MinGW builds which
# cross-compile for Windows - which use the freedesktop ci-templates, we
# cannot use the same scheme here. As Windows lacks support for
# Docker-in-Docker, and Podman does not run natively on Windows, we have
# to open-code much of the same ourselves.
#
# This is achieved by first running in a native Windows shell instance
# (host PowerShell) in the container stage to build and push the image,
# then in the build stage by executing inside Docker.
.windows-docker-vs2019:
variables:
MESA_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${MESA_IMAGE_TAG}"
MESA_UPSTREAM_IMAGE: "$CI_REGISTRY/$FDO_UPSTREAM_REPO/$MESA_IMAGE_PATH:${MESA_IMAGE_TAG}"
.windows_container_build:
inherit:
default: false
extends:
- .container
- .windows-docker-vs2019
rules:
- if: '$MICROSOFT_FARM == "offline"'
when: never
- !reference [.container-rules, rules]
variables:
GIT_STRATEGY: fetch # we do actually need the full repository though
MESA_BASE_IMAGE: None
tags:
- windows
- shell
- "1809"
- mesa
script:
- .\.gitlab-ci\windows\mesa_container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $MESA_IMAGE $MESA_UPSTREAM_IMAGE ${DOCKERFILE} ${MESA_BASE_IMAGE}
windows_build_vs2019:
inherit:
default: false
extends:
- .windows_container_build
variables:
MESA_IMAGE_PATH: &windows_build_image_path ${WINDOWS_X64_BUILD_PATH}
MESA_IMAGE_TAG: &windows_build_image_tag ${WINDOWS_X64_BUILD_TAG}
DOCKERFILE: Dockerfile_build
timeout: 2h 30m # LLVM takes ages
windows_test_vs2019:
inherit:
default: false
extends:
- .windows_container_build
rules:
- if: '$MICROSOFT_FARM == "offline"'
when: never
- !reference [.ci-run-policy, rules]
variables:
MESA_IMAGE_PATH: &windows_test_image_path ${WINDOWS_X64_TEST_PATH}
MESA_IMAGE_TAG: &windows_test_image_tag ${WINDOWS_X64_BUILD_TAG}--${WINDOWS_X64_TEST_TAG}
DOCKERFILE: Dockerfile_test
# Right now this only needs the VS install to get DXIL.dll. Maybe see about decoupling this at some point
MESA_BASE_IMAGE_PATH: *windows_build_image_path
MESA_BASE_IMAGE_TAG: *windows_build_image_tag
MESA_BASE_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_BASE_IMAGE_PATH}:${MESA_BASE_IMAGE_TAG}"
script:
- .\.gitlab-ci\windows\mesa_container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $MESA_IMAGE $MESA_UPSTREAM_IMAGE Dockerfile_test ${MESA_BASE_IMAGE}
needs:
- windows_build_vs2019
.use-windows_build_vs2019:
inherit:
default: false
extends: .windows-docker-vs2019
image: "$MESA_IMAGE"
variables:
MESA_IMAGE_PATH: *windows_build_image_path
MESA_IMAGE_TAG: *windows_build_image_tag
needs:
- windows_build_vs2019
.use-windows_test_vs2019:
inherit:
default: false
extends: .windows-docker-vs2019
image: "$MESA_IMAGE"
variables:
MESA_IMAGE_PATH: *windows_test_image_path
MESA_IMAGE_TAG: *windows_test_image_tag

View File

@@ -34,6 +34,7 @@ if [[ "$DEBIAN_ARCH" = "arm64" ]]; then
DEVICE_TREES+=" arch/arm64/boot/dts/qcom/apq8096-db820c.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/amlogic/meson-g12b-a311d-khadas-vim3.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-juniper-sku16.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor-limozeen-nots.dtb"
KERNEL_IMAGE_NAME="Image"
elif [[ "$DEBIAN_ARCH" = "armhf" ]]; then
@@ -51,7 +52,7 @@ else
DEFCONFIG="arch/x86/configs/x86_64_defconfig"
DEVICE_TREES=""
KERNEL_IMAGE_NAME="bzImage"
ARCH_PACKAGES="libva-dev"
ARCH_PACKAGES="libasound2-dev libcap-dev libfdt-dev libva-dev wayland-protocols"
fi
# Determine if we're in a cross build.
@@ -76,12 +77,14 @@ apt-get install -y --no-remove \
${ARCH_PACKAGES} \
automake \
bc \
clang \
cmake \
debootstrap \
git \
glslang-tools \
libdrm-dev \
libegl1-mesa-dev \
libxext-dev \
libfontconfig-dev \
libgbm-dev \
libgl-dev \
@@ -126,7 +129,7 @@ fi
############### Building
STRIP_CMD="${GCC_ARCH}-strip"
mkdir -p /lava-files/rootfs-${DEBIAN_ARCH}
mkdir -p /lava-files/rootfs-${DEBIAN_ARCH}/usr/lib/$GCC_ARCH
############### Build apitrace
@@ -165,10 +168,26 @@ if [[ "$DEBIAN_ARCH" = "amd64" ]]; then
mv /va/bin/* /lava-files/rootfs-${DEBIAN_ARCH}/usr/bin/
fi
############### Build Crosvm
if [[ ${DEBIAN_ARCH} = "amd64" ]]; then
. .gitlab-ci/container/build-crosvm.sh
mv /usr/local/bin/crosvm /lava-files/rootfs-${DEBIAN_ARCH}/usr/bin/
mv /usr/local/lib/$GCC_ARCH/libvirglrenderer.* /lava-files/rootfs-${DEBIAN_ARCH}/usr/lib/$GCC_ARCH/
fi
############### Build libdrm
EXTRA_MESON_ARGS+=" -D prefix=/libdrm"
. .gitlab-ci/container/build-libdrm.sh
############### Build local stuff for use by igt and kernel testing, which
############### will reuse most of our container build process from a specific
############### hash of the Mesa tree.
if [[ -e ".gitlab-ci/local/build-rootfs.sh" ]]; then
. .gitlab-ci/local/build-rootfs.sh
fi
############### Build kernel
. .gitlab-ci/container/build-kernel.sh
@@ -199,7 +218,6 @@ rm /lava-files/rootfs-${DEBIAN_ARCH}/create-rootfs.sh
# Dependencies pulled during the creation of the rootfs may overwrite
# the built libdrm. Hence, we add it after the rootfs has been already
# created.
mkdir -p /lava-files/rootfs-${DEBIAN_ARCH}/usr/lib/$GCC_ARCH
find /libdrm/ -name lib\*\.so\* | xargs cp -t /lava-files/rootfs-${DEBIAN_ARCH}/usr/lib/$GCC_ARCH/.
mkdir -p /lava-files/rootfs-${DEBIAN_ARCH}/libdrm/
cp -Rp /libdrm/share /lava-files/rootfs-${DEBIAN_ARCH}/libdrm/share

View File

@@ -72,9 +72,11 @@ CONFIG_PARPORT_PC=y
CONFIG_PARPORT_SERIAL=y
CONFIG_SERIAL_8250_DW=y
CONFIG_CHROME_PLATFORMS=y
CONFIG_KVM_AMD=m
#options for Intel devices
CONFIG_MFD_INTEL_LPSS_PCI=y
CONFIG_KVM_INTEL=m
#options for KVM guests
CONFIG_FUSE_FS=y
@@ -98,3 +100,6 @@ CONFIG_CRYPTO_DEV_VIRTIO=y
CONFIG_HW_RANDOM_VIRTIO=y
CONFIG_BLK_MQ_VIRTIO=y
CONFIG_TUN=y
CONFIG_VSOCKETS=y
CONFIG_VIRTIO_VSOCKETS=y
CONFIG_VHOST_VSOCK=m

View File

@@ -2,7 +2,9 @@
set -e
export DEQP_TEMP_DIR="$1"
VSOCK_STDOUT=$1
VSOCK_STDERR=$2
VSOCK_TEMP_DIR=$3
mount -t proc none /proc
mount -t sysfs none /sys
@@ -10,29 +12,31 @@ mkdir -p /dev/pts
mount -t devpts devpts /dev/pts
mount -t tmpfs tmpfs /tmp
. $DEQP_TEMP_DIR/crosvm-env.sh
. ${VSOCK_TEMP_DIR}/crosvm-env.sh
# .gitlab-ci.yml script variable is using relative paths to install directory,
# so change to that dir before running `crosvm-script`
cd "${CI_PROJECT_DIR}"
# The exception is the dEQP binary, since it needs to run from the directory
# it's in
if [ -d "${DEQP_BIN_DIR}" ]
then
cd "${DEQP_BIN_DIR}"
fi
# The exception is the dEQP binary, as it needs to run from its own directory
[ -z "${DEQP_BIN_DIR}" ] || cd "${DEQP_BIN_DIR}"
dmesg --level crit,err,warn -w >> $DEQP_TEMP_DIR/stderr &
# Use a FIFO to collect relevant error messages
STDERR_FIFO=/tmp/crosvm-stderr.fifo
mkfifo -m 600 ${STDERR_FIFO}
set +e
stdbuf -oL sh $DEQP_TEMP_DIR/crosvm-script.sh 2>> $DEQP_TEMP_DIR/stderr >> $DEQP_TEMP_DIR/stdout
echo $? > $DEQP_TEMP_DIR/exit_code
set -e
dmesg --level crit,err,warn -w > ${STDERR_FIFO} &
DMESG_PID=$!
# Transfer the errors and crosvm-script output via a pair of virtio-vsocks
socat -d -u pipe:${STDERR_FIFO} vsock-listen:${VSOCK_STDERR} &
socat -d -U vsock-listen:${VSOCK_STDOUT} \
system:"stdbuf -eL sh ${VSOCK_TEMP_DIR}/crosvm-script.sh 2> ${STDERR_FIFO}; echo \$? > ${VSOCK_TEMP_DIR}/exit_code",nofork
kill ${DMESG_PID}
wait
sync
sleep 1
poweroff -d -n -f || true
sleep 1 # Just in case init would exit before the kernel shuts down the VM

View File

@@ -1,58 +1,125 @@
#!/bin/sh
set -ex
set -e
# This script can be called concurrently, pass arguments and env in a
# per-instance tmp dir
DEQP_TEMP_DIR=$(mktemp -d /tmp.XXXXXXXXXX)
export DEQP_TEMP_DIR
#
# Helper to generate CIDs for virtio-vsock based communication with processes
# running inside crosvm guests.
#
# A CID is a 32-bit Context Identifier to be assigned to a crosvm instance
# and must be unique across the host system. For this purpose, let's take
# the least significant 25 bits from CI_JOB_ID as a base and generate a 7-bit
# prefix number to handle up to 128 concurrent crosvm instances per job runner.
#
# As a result, the following variables are set:
# - VSOCK_CID: the crosvm unique CID to be passed as a run argument
#
# - VSOCK_STDOUT, VSOCK_STDERR: the port numbers the guest should accept
# vsock connections on in order to transfer output messages
#
# - VSOCK_TEMP_DIR: the temporary directory path used to pass additional
# context data towards the guest
#
set_vsock_context() {
[ -n "${CI_JOB_ID}" ] || {
echo "Missing or unset CI_JOB_ID env variable" >&2
exit 1
}
local dir_prefix="/tmp-vsock."
local cid_prefix=0
unset VSOCK_TEMP_DIR
while [ ${cid_prefix} -lt 128 ]; do
VSOCK_TEMP_DIR=${dir_prefix}${cid_prefix}
mkdir "${VSOCK_TEMP_DIR}" >/dev/null 2>&1 && break || unset VSOCK_TEMP_DIR
cid_prefix=$((cid_prefix + 1))
done
[ -n "${VSOCK_TEMP_DIR}" ] || return 1
VSOCK_CID=$(((CI_JOB_ID & 0x1ffffff) | ((cid_prefix & 0x7f) << 25)))
VSOCK_STDOUT=5001
VSOCK_STDERR=5002
return 0
}
# The dEQP binary needs to run from the directory it's in
if [ -n "${1##*.sh}" ] && [ -z "${1##*"deqp"*}" ]; then
DEQP_BIN_DIR=$(dirname "$1")
export DEQP_BIN_DIR
DEQP_BIN_DIR=$(dirname "$1")
export DEQP_BIN_DIR
fi
set_vsock_context || { echo "Could not generate crosvm vsock CID" >&2; exit 1; }
# Ensure cleanup on script exit
trap 'exit ${exit_code}' INT TERM
trap 'exit_code=$?; [ -z "${CROSVM_PID}${SOCAT_PIDS}" ] || kill ${CROSVM_PID} ${SOCAT_PIDS} >/dev/null 2>&1 || true; rm -rf ${VSOCK_TEMP_DIR}' EXIT
# Securely pass the current variables to the crosvm environment
CI_COMMON="$CI_PROJECT_DIR"/install/common
echo "Variables passed through:"
"${CI_COMMON}"/generate-env.sh | tee ${DEQP_TEMP_DIR}/crosvm-env.sh
SCRIPT_DIR=$(readlink -en "${0%/*}")
${SCRIPT_DIR}/common/generate-env.sh | tee ${VSOCK_TEMP_DIR}/crosvm-env.sh
CROSVM_KERNEL_ARGS="quiet console=null root=my_root rw rootfstype=virtiofs init=$CI_PROJECT_DIR/install/crosvm-init.sh ip=192.168.30.2::192.168.30.1:255.255.255.0:crosvm:eth0 -- $DEQP_TEMP_DIR"
# Set the crosvm-script as the arguments of the current script.
echo "$@" > $DEQP_TEMP_DIR/crosvm-script.sh
unset DISPLAY
unset XDG_RUNTIME_DIR
# Set the crosvm-script as the arguments of the current script
echo "$@" > ${VSOCK_TEMP_DIR}/crosvm-script.sh
# Setup networking
/usr/sbin/iptables-legacy -w -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
# Send output from guest to host
touch $DEQP_TEMP_DIR/stderr $DEQP_TEMP_DIR/stdout
tail -f $DEQP_TEMP_DIR/stderr >> /dev/stderr &
ERR_TAIL_PID=$!
tail -f $DEQP_TEMP_DIR/stdout >> /dev/stdout &
OUT_TAIL_PID=$!
# Start background processes to receive output from guest
socat -u vsock-connect:${VSOCK_CID}:${VSOCK_STDERR},retry=200,interval=0.1 stderr &
SOCAT_PIDS=$!
socat -u vsock-connect:${VSOCK_CID}:${VSOCK_STDOUT},retry=200,interval=0.1 stdout &
SOCAT_PIDS="${SOCAT_PIDS} $!"
trap "exit \$exit_code" INT TERM
trap "exit_code=\$?; kill $ERR_TAIL_PID $OUT_TAIL_PID; rm -rf $DEQP_TEMP_DIR" EXIT
# Prepare to start crosvm
unset DISPLAY
unset XDG_RUNTIME_DIR
# We aren't testing LLVMPipe here, so we don't need to validate NIR on the host
NIR_DEBUG="novalidate" LIBGL_ALWAYS_SOFTWARE="true" GALLIUM_DRIVER="$CROSVM_GALLIUM_DRIVER" crosvm run \
--gpu "$CROSVM_GPU_ARGS" \
-m 4096 \
-c 2 \
--disable-sandbox \
--shared-dir /:my_root:type=fs:writeback=true:timeout=60:cache=always \
--host_ip=192.168.30.1 --netmask=255.255.255.0 --mac "AA:BB:CC:00:00:12" \
-p "$CROSVM_KERNEL_ARGS" \
/lava-files/bzImage > $DEQP_TEMP_DIR/crosvm 2>&1
CROSVM_KERN_ARGS="quiet console=null root=my_root rw rootfstype=virtiofs ip=192.168.30.2::192.168.30.1:255.255.255.0:crosvm:eth0"
CROSVM_KERN_ARGS="${CROSVM_KERN_ARGS} init=${SCRIPT_DIR}/crosvm-init.sh -- ${VSOCK_STDOUT} ${VSOCK_STDERR} ${VSOCK_TEMP_DIR}"
RET=$(cat $DEQP_TEMP_DIR/exit_code || true)
[ "${CROSVM_GALLIUM_DRIVER}" = "llvmpipe" ] && \
CROSVM_LIBGL_ALWAYS_SOFTWARE=true || CROSVM_LIBGL_ALWAYS_SOFTWARE=false
# Got no exit code from the script, show crosvm output to help with debugging
[ -n "$RET" ] || cat $DEQP_TEMP_DIR/crosvm || true
set +e -x
exit ${RET:-1}
# We aren't testing the host driver here, so we don't need to validate NIR on the host
NIR_DEBUG="novalidate" \
LIBGL_ALWAYS_SOFTWARE=${CROSVM_LIBGL_ALWAYS_SOFTWARE} \
GALLIUM_DRIVER=${CROSVM_GALLIUM_DRIVER} \
crosvm run \
--gpu "${CROSVM_GPU_ARGS}" -m 4096 -c 2 --disable-sandbox \
--shared-dir /:my_root:type=fs:writeback=true:timeout=60:cache=always \
--host_ip "192.168.30.1" --netmask "255.255.255.0" --mac "AA:BB:CC:00:00:12" \
--cid ${VSOCK_CID} -p "${CROSVM_KERN_ARGS}" \
/lava-files/${KERNEL_IMAGE_NAME:-bzImage} > ${VSOCK_TEMP_DIR}/crosvm 2>&1 &
# Wait for crosvm process to terminate
CROSVM_PID=$!
wait ${CROSVM_PID}
CROSVM_RET=$?
unset CROSVM_PID
[ ${CROSVM_RET} -eq 0 ] && {
# socat background processes terminate gracefully on remote peers exit
wait
unset SOCAT_PIDS
# The actual return code is the crosvm guest script's exit code
CROSVM_RET=$(cat ${VSOCK_TEMP_DIR}/exit_code 2>/dev/null)
# Force error when the guest script's exit code is not available
CROSVM_RET=${CROSVM_RET:-1}
}
# Show crosvm output on error to help with debugging
[ ${CROSVM_RET} -eq 0 ] || {
set +x
echo "Dumping crosvm output.." >&2
cat ${VSOCK_TEMP_DIR}/crosvm >&2
set -x
}
exit ${CROSVM_RET}

View File

@@ -1,5 +1,7 @@
#!/bin/sh
echo -e "\e[0Ksection_start:$(date +%s):test_setup[collapsed=true]\r\e[0Kpreparing test setup"
set -ex
# Needed so configuration files can contain paths to files in /install
@@ -20,6 +22,15 @@ export VK_ICD_FILENAMES=`pwd`/install/share/vulkan/icd.d/"$VK_DRIVER"_icd.${VK_C
RESULTS=`pwd`/${DEQP_RESULTS_DIR:-results}
mkdir -p $RESULTS
# Ensure Mesa Shader Cache resides on tmpfs.
SHADER_CACHE_HOME=${XDG_CACHE_HOME:-${HOME}/.cache}
SHADER_CACHE_DIR=${MESA_SHADER_CACHE_DIR:-${SHADER_CACHE_HOME}/mesa_shader_cache}
findmnt -n tmpfs ${SHADER_CACHE_HOME} || findmnt -n tmpfs ${SHADER_CACHE_DIR} || {
mkdir -p ${SHADER_CACHE_DIR}
mount -t tmpfs -o nosuid,nodev,size=2G,mode=1755 tmpfs ${SHADER_CACHE_DIR}
}
HANG_DETECTION_CMD=""
if [ -z "$DEQP_SUITE" ]; then
@@ -112,8 +123,6 @@ if [ -e "$INSTALL/$GPU_VERSION-skips.txt" ]; then
DEQP_SKIPS="$DEQP_SKIPS $INSTALL/$GPU_VERSION-skips.txt"
fi
set +e
report_load() {
echo "System load: $(cut -d' ' -f1-3 < /proc/loadavg)"
echo "# of CPU cores: $(cat /proc/cpuinfo | grep processor | wc -l)"
@@ -148,7 +157,16 @@ if [ -z "$DEQP_SUITE" ]; then
if [ $DEQP_VER != vk -a $DEQP_VER != egl ]; then
export DEQP_RUNNER_OPTIONS="$DEQP_RUNNER_OPTIONS --version-check `cat $INSTALL/VERSION | sed 's/[() ]/./g'`"
fi
fi
set +x
echo -e "\e[0Ksection_end:$(date +%s):test_setup\r\e[0K"
echo -e "\e[0Ksection_start:$(date +%s):deqp[collapsed=false]\r\e[0Kdeqp-runner"
set -x
set +e
if [ -z "$DEQP_SUITE" ]; then
deqp-runner \
run \
--deqp $DEQP \
@@ -170,14 +188,20 @@ else
--flakes $INSTALL/$GPU_VERSION-flakes.txt \
--testlog-to-xml /deqp/executor/testlog-to-xml \
--fraction-start $CI_NODE_INDEX \
--fraction $CI_NODE_TOTAL \
--fraction `expr $CI_NODE_TOTAL \* ${DEQP_FRACTION:-1}` \
--jobs ${FDO_CI_CONCURRENT:-4} \
$DEQP_RUNNER_OPTIONS
fi
DEQP_EXITCODE=$?
quiet report_load
set +x
echo -e "\e[0Ksection_end:$(date +%s):deqp\r\e[0K"
report_load
echo -e "\e[0Ksection_start:$(date +%s):test_post_process[collapsed=true]\r\e[0Kpost-processing test results"
set -x
# Remove all but the first 50 individual XML files uploaded as artifacts, to
# save fd.o space when you break everything.
@@ -213,4 +237,6 @@ if [ -n "$FLAKES_CHANNEL" ]; then
--branch-title "${CI_MERGE_REQUEST_TITLE:-$CI_COMMIT_TITLE}"
fi
echo -e "\e[0Ksection_end:$(date +%s):test_post_process\r\e[0K"
exit $DEQP_EXITCODE

View File

@@ -5,7 +5,7 @@ set -o xtrace
# if we run this script outside of gitlab-ci for testing, ensure
# we got meaningful variables
CI_PROJECT_DIR=${CI_PROJECT_DIR:-$(mktemp -d)/mesa}
CI_PROJECT_DIR=${CI_PROJECT_DIR:-$(mktemp -d)/$CI_PROJECT_NAME}
if [[ -e $CI_PROJECT_DIR/.git ]]
then
@@ -16,8 +16,8 @@ fi
TMP_DIR=$(mktemp -d)
echo "Downloading archived master..."
/usr/bin/wget -O $TMP_DIR/mesa.tar.gz \
https://${MINIO_HOST}/git-cache/${FDO_UPSTREAM_REPO}/mesa.tar.gz
/usr/bin/wget -O $TMP_DIR/$CI_PROJECT_NAME.tar.gz \
https://${MINIO_HOST}/git-cache/${FDO_UPSTREAM_REPO}/$CI_PROJECT_NAME.tar.gz
# check wget error code
if [[ $? -ne 0 ]]
@@ -31,6 +31,6 @@ set -e
rm -rf "$CI_PROJECT_DIR"
echo "Extracting tarball into '$CI_PROJECT_DIR'..."
mkdir -p "$CI_PROJECT_DIR"
tar xzf "$TMP_DIR/mesa.tar.gz" -C "$CI_PROJECT_DIR"
tar xzf "$TMP_DIR/$CI_PROJECT_NAME.tar.gz" -C "$CI_PROJECT_DIR"
rm -rf "$TMP_DIR"
chmod a+w "$CI_PROJECT_DIR"

0
.gitlab-ci/gtest-runner.sh Normal file → Executable file
View File

View File

@@ -1,21 +1,21 @@
variables:
DEBIAN_X86_BUILD_BASE_IMAGE: "debian/x86_build-base"
DEBIAN_BASE_TAG: "2022-01-02-deqp-runner"
DEBIAN_BASE_TAG: "2022-02-21-libdrm"
DEBIAN_X86_BUILD_IMAGE_PATH: "debian/x86_build"
DEBIAN_BUILD_TAG: "2021-12-31-keep-cmake"
DEBIAN_BUILD_TAG: "2022-02-21-libdrm"
DEBIAN_X86_TEST_BASE_IMAGE: "debian/x86_test-base"
DEBIAN_X86_TEST_IMAGE_PATH: "debian/x86_test-gl"
DEBIAN_X86_TEST_GL_TAG: "2022-01-18-kernel"
DEBIAN_X86_TEST_VK_TAG: "2022-01-02-deqp-runner"
DEBIAN_X86_TEST_GL_TAG: "2022-04-07-virgl-crosvm"
DEBIAN_X86_TEST_VK_TAG: "2022-04-05-deqp-runner"
FEDORA_X86_BUILD_TAG: "2021-12-31-refactor"
KERNEL_ROOTFS_TAG: "2022-01-18-kernel"
FEDORA_X86_BUILD_TAG: "2022-03-18-spirv-tools-5"
KERNEL_ROOTFS_TAG: "2022-04-07-prefix-skqp"
WINDOWS_X64_BUILD_PATH: "windows/x64_build"
WINDOWS_X64_BUILD_TAG: "2022-20-02-base_split"
WINDOWS_X64_TEST_PATH: "windows/x64_test"
WINDOWS_X64_TEST_TAG: "2022-20-02-base_split"
WINDOWS_X64_TEST_TAG: "2022-04-13-dozen_ci"

View File

@@ -14,20 +14,23 @@
BASE_SYSTEM_MAINLINE_HOST_PATH: "${BASE_SYSTEM_HOST_PREFIX}/${FDO_UPSTREAM_REPO}/${DISTRIBUTION_TAG}/${ARCH}"
BASE_SYSTEM_FORK_HOST_PATH: "${BASE_SYSTEM_HOST_PREFIX}/${CI_PROJECT_PATH}/${DISTRIBUTION_TAG}/${ARCH}"
# per-job build artifacts
MESA_BUILD_PATH: "${PIPELINE_ARTIFACTS_BASE}/mesa-${ARCH}.tar.gz"
BUILD_PATH: "${PIPELINE_ARTIFACTS_BASE}/${CI_PROJECT_NAME}-${ARCH}.tar.gz"
JOB_ROOTFS_OVERLAY_PATH: "${JOB_ARTIFACTS_BASE}/job-rootfs-overlay.tar.gz"
JOB_RESULTS_PATH: "${JOB_ARTIFACTS_BASE}/results.tar.gz"
MINIO_RESULTS_UPLOAD: "${JOB_ARTIFACTS_BASE}"
PIGLIT_NO_WINDOW: 1
VISIBILITY_GROUP: "Collabora+fdo"
script:
- ./artifacts/lava/lava-submit.sh
artifacts:
name: "mesa_${CI_JOB_NAME}"
name: "${CI_PROJECT_NAME}_${CI_JOB_NAME}"
when: always
paths:
- results/
exclude:
- results/*.shader_cache
tags:
- $RUNNER_TAG
after_script:
- wget -q "https://${JOB_RESULTS_PATH}" -O- | tar -xz

34
.gitlab-ci/lava/lava-pytest.sh Executable file
View File

@@ -0,0 +1,34 @@
#!/bin/sh
#
# Copyright (C) 2022 Collabora Limited
# Author: Guilherme Gallo <guilherme.gallo@collabora.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# This script runs unit/integration tests related with LAVA CI tools
set -ex
TEST_DIR=${CI_PROJECT_DIR}/.gitlab-ci/tests
PYTHONPATH="${TEST_DIR}:${PYTHONPATH}" python3 -m \
pytest "${TEST_DIR}" \
-W ignore::DeprecationWarning \
--junitxml=artifacts/ci_scripts_report.xml

View File

@@ -16,7 +16,11 @@ mkdir -p results/job-rootfs-overlay/
cp artifacts/ci-common/capture-devcoredump.sh results/job-rootfs-overlay/
cp artifacts/ci-common/init-*.sh results/job-rootfs-overlay/
artifacts/ci-common/generate-env.sh > results/job-rootfs-overlay/set-job-env-vars.sh
cp artifacts/ci-common/intel-gpu-freq.sh results/job-rootfs-overlay/
# Prepare env vars for upload.
KERNEL_IMAGE_BASE_URL="https://${BASE_SYSTEM_HOST_PATH}" \
artifacts/ci-common/generate-env.sh > results/job-rootfs-overlay/set-job-env-vars.sh
tar zcf job-rootfs-overlay.tar.gz -C results/job-rootfs-overlay/ .
ci-fairy minio login --token-file "${CI_JOB_JWT_FILE}"
@@ -27,10 +31,10 @@ tail -f results/lava.log &
artifacts/lava/lava_job_submitter.py \
--dump-yaml \
--pipeline-info "$CI_JOB_NAME: $CI_PIPELINE_URL on $CI_COMMIT_REF_NAME ${CI_NODE_INDEX}/${CI_NODE_TOTAL}" \
--base-system-url-prefix "https://${BASE_SYSTEM_HOST_PATH}" \
--mesa-build-url "${FDO_HTTP_CACHE_URI:-}https://${MESA_BUILD_PATH}" \
--rootfs-url-prefix "https://${BASE_SYSTEM_HOST_PATH}" \
--kernel-url-prefix "https://${BASE_SYSTEM_HOST_PATH}" \
--build-url "${FDO_HTTP_CACHE_URI:-}https://${BUILD_PATH}" \
--job-rootfs-overlay-url "${FDO_HTTP_CACHE_URI:-}https://${JOB_ROOTFS_OVERLAY_PATH}" \
--job-artifacts-base ${JOB_ARTIFACTS_BASE} \
--job-timeout ${JOB_TIMEOUT:-30} \
--first-stage-init artifacts/ci-common/init-stage1.sh \
--ci-project-dir ${CI_PROJECT_DIR} \

View File

@@ -31,25 +31,27 @@ import time
import traceback
import urllib.parse
import xmlrpc
from datetime import datetime, timedelta
from os import getenv
import lavacli
import yaml
from lavacli.utils import loader
# Timeout in minutes to decide if the device from the dispatched LAVA job has
# Timeout in seconds to decide if the device from the dispatched LAVA job has
# hung or not due to the lack of new log output.
DEVICE_HANGING_TIMEOUT_MIN = 5
DEVICE_HANGING_TIMEOUT_SEC = int(getenv("LAVA_DEVICE_HANGING_TIMEOUT_SEC", 5*60))
# How many seconds the script should wait before try a new polling iteration to
# check if the dispatched LAVA job is running or waiting in the job queue.
WAIT_FOR_DEVICE_POLLING_TIME_SEC = 10
WAIT_FOR_DEVICE_POLLING_TIME_SEC = int(getenv("LAVA_WAIT_FOR_DEVICE_POLLING_TIME_SEC", 10))
# How many seconds to wait between log output LAVA RPC calls.
LOG_POLLING_TIME_SEC = 5
LOG_POLLING_TIME_SEC = int(getenv("LAVA_LOG_POLLING_TIME_SEC", 5))
# How many retries should be made when a timeout happen.
NUMBER_OF_RETRIES_TIMEOUT_DETECTION = 2
NUMBER_OF_RETRIES_TIMEOUT_DETECTION = int(getenv("LAVA_NUMBER_OF_RETRIES_TIMEOUT_DETECTION", 2))
def print_log(msg):
@@ -61,14 +63,7 @@ def fatal_err(msg):
def hide_sensitive_data(yaml_data, hide_tag="HIDEME"):
out_data = ""
for line in yaml_data.splitlines(True):
if hide_tag in line:
continue
out_data += line
return out_data
return "".join(line for line in yaml_data.splitlines(True) if hide_tag not in line)
def generate_lava_yaml(args):
@@ -79,7 +74,7 @@ def generate_lava_yaml(args):
'visibility': { 'group': [ args.visibility_group ] },
'priority': 75,
'context': {
'extra_nfsroot_args': ' init=/init rootwait minio_results={}'.format(args.job_artifacts_base)
'extra_nfsroot_args': ' init=/init rootwait usbcore.quirks=0bda:8153:k'
},
'timeouts': {
'job': {
@@ -98,10 +93,10 @@ def generate_lava_yaml(args):
'to': 'tftp',
'os': 'oe',
'kernel': {
'url': '{}/{}'.format(args.base_system_url_prefix, args.kernel_image_name),
'url': '{}/{}'.format(args.kernel_url_prefix, args.kernel_image_name),
},
'nfsrootfs': {
'url': '{}/lava-rootfs.tgz'.format(args.base_system_url_prefix),
'url': '{}/lava-rootfs.tgz'.format(args.rootfs_url_prefix),
'compression': 'gz',
}
}
@@ -109,7 +104,7 @@ def generate_lava_yaml(args):
deploy['kernel']['type'] = args.kernel_image_type
if args.dtb:
deploy['dtb'] = {
'url': '{}/{}.dtb'.format(args.base_system_url_prefix, args.dtb)
'url': '{}/{}.dtb'.format(args.kernel_url_prefix, args.dtb)
}
# always boot over NFS
@@ -165,7 +160,7 @@ def generate_lava_yaml(args):
init_lines += [
'mkdir -p {}'.format(args.ci_project_dir),
'wget -S --progress=dot:giga -O- {} | tar -xz -C {}'.format(args.mesa_build_url, args.ci_project_dir),
'wget -S --progress=dot:giga -O- {} | tar -xz -C {}'.format(args.build_url, args.ci_project_dir),
'wget -S --progress=dot:giga -O- {} | tar -xz -C /'.format(args.job_rootfs_overlay_url),
f'echo "export CI_JOB_JWT_FILE={args.jwt_file}" >> /set-job-env-vars.sh',
'exec /init-stage2.sh',
@@ -211,7 +206,6 @@ def _call_proxy(fn, *args):
fatal_err("A protocol error occurred (Err {} {})".format(err.errcode, err.errmsg))
else:
time.sleep(15)
pass
except xmlrpc.client.Fault as err:
traceback.print_exc()
fatal_err("FATAL: Fault: {} (code: {})".format(err.faultString, err.faultCode))
@@ -222,8 +216,8 @@ def get_job_results(proxy, job_id, test_suite, test_case):
results_yaml = _call_proxy(proxy.results.get_testjob_results_yaml, job_id)
results = yaml.load(results_yaml, Loader=loader(False))
for res in results:
metadata = res['metadata']
if not 'result' in metadata or metadata['result'] != 'fail':
metadata = res["metadata"]
if "result" not in metadata or metadata["result"] != "fail":
continue
if 'error_type' in metadata and metadata['error_type'] == "Infrastructure":
print_log("LAVA job {} failed with Infrastructure Error. Retry.".format(job_id))
@@ -260,8 +254,7 @@ def follow_job_execution(proxy, job_id):
last_time_logs = datetime.now()
while not finished:
(finished, data) = _call_proxy(proxy.scheduler.jobs.logs, job_id, line_count)
logs = yaml.load(str(data), Loader=loader(False))
if logs:
if logs := yaml.load(str(data), Loader=loader(False)):
# Reset the timeout
last_time_logs = datetime.now()
for line in logs:
@@ -270,7 +263,7 @@ def follow_job_execution(proxy, job_id):
line_count += len(logs)
else:
time_limit = timedelta(minutes=DEVICE_HANGING_TIMEOUT_MIN)
time_limit = timedelta(seconds=DEVICE_HANGING_TIMEOUT_SEC)
if datetime.now() - last_time_logs > time_limit:
print_log("LAVA job {} doesn't advance (machine got hung?). Retry.".format(job_id))
return False
@@ -298,21 +291,7 @@ def submit_job(proxy, job_file):
return _call_proxy(proxy.scheduler.jobs.submit, job_file)
def main(args):
proxy = setup_lava_proxy()
yaml_file = generate_lava_yaml(args)
if args.dump_yaml:
print(hide_sensitive_data(generate_lava_yaml(args)))
if args.validate_only:
ret = validate_job(proxy, yaml_file)
if not ret:
fatal_err("Error in LAVA job definition")
print("LAVA job definition validated successfully")
return
def retriable_follow_job(proxy, yaml_file):
retry_count = NUMBER_OF_RETRIES_TIMEOUT_DETECTION
while retry_count >= 0:
@@ -332,17 +311,45 @@ def main(args):
show_job_data(proxy, job_id)
if get_job_results(proxy, job_id, "0_mesa", "mesa") == True:
break
if get_job_results(proxy, job_id, "0_mesa", "mesa") == True:
break
else:
# The script attempted all the retries. The job seemed to fail.
return False
return True
def main(args):
proxy = setup_lava_proxy()
yaml_file = generate_lava_yaml(args)
if args.dump_yaml:
print(hide_sensitive_data(generate_lava_yaml(args)))
if args.validate_only:
ret = validate_job(proxy, yaml_file)
if not ret:
fatal_err("Error in LAVA job definition")
print("LAVA job definition validated successfully")
return
if not retriable_follow_job(proxy, yaml_file):
fatal_err(
"Job failed after it exceeded the number of"
f"{NUMBER_OF_RETRIES_TIMEOUT_DETECTION} retries."
)
def create_parser():
parser = argparse.ArgumentParser("LAVA job submitter")
parser.add_argument("--pipeline-info")
parser.add_argument("--base-system-url-prefix")
parser.add_argument("--mesa-build-url")
parser.add_argument("--rootfs-url-prefix")
parser.add_argument("--kernel-url-prefix")
parser.add_argument("--build-url")
parser.add_argument("--job-rootfs-overlay-url")
parser.add_argument("--job-artifacts-base")
parser.add_argument("--job-timeout", type=int)
parser.add_argument("--first-stage-init")
parser.add_argument("--ci-project-dir")

View File

@@ -17,6 +17,15 @@ export VK_ICD_FILENAMES=`pwd`/install/share/vulkan/icd.d/"$VK_DRIVER"_icd.${VK_C
RESULTS=`pwd`/${PIGLIT_RESULTS_DIR:-results}
mkdir -p $RESULTS
# Ensure Mesa Shader Cache resides on tmpfs.
SHADER_CACHE_HOME=${XDG_CACHE_HOME:-${HOME}/.cache}
SHADER_CACHE_DIR=${MESA_SHADER_CACHE_DIR:-${SHADER_CACHE_HOME}/mesa_shader_cache}
findmnt -n tmpfs ${SHADER_CACHE_HOME} || findmnt -n tmpfs ${SHADER_CACHE_DIR} || {
mkdir -p ${SHADER_CACHE_DIR}
mount -t tmpfs -o nosuid,nodev,size=2G,mode=1755 tmpfs ${SHADER_CACHE_DIR}
}
if [ "$GALLIUM_DRIVER" = "virpipe" ]; then
# deqp is to use virpipe, and virgl_test_server llvmpipe
export GALLIUM_DRIVER="$GALLIUM_DRIVER"

View File

@@ -188,6 +188,13 @@ fi
ci-fairy minio login $MINIO_ARGS --token-file "${CI_JOB_JWT_FILE}"
# The replayer doesn't do any size or checksum verification for the traces in
# the replayer db, so if we had to restart the system due to intermittent device
# errors (or tried to cache replayer-db between runs, which would be nice to
# have), you could get a corrupted local trace that would spuriously fail the
# run.
rm -rf replayer-db
eval $RUN_CMD
if [ $? -ne 0 ]; then

View File

@@ -47,6 +47,7 @@ mkdir -p artifacts/
tar -cf artifacts/install.tar install
cp -Rp .gitlab-ci/common artifacts/ci-common
cp -Rp .gitlab-ci/lava artifacts/
cp -Rp .gitlab-ci/valve artifacts/
if [ -n "$MINIO_ARTIFACT_NAME" ]; then
# Pass needed files to the test stage

View File

@@ -1,12 +1,40 @@
#!/bin/sh
#
# Copyright (C) 2022 Collabora Limited
# Author: Guilherme Gallo <guilherme.gallo@collabora.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
copy_tests_files() (
# Copy either unit test or render test files from a specific driver given by
# GPU VERSION variable.
# If there is no test file at the expected location, this function will
# return error_code 1
SKQP_BACKEND="${1}"
SKQP_FILE_PREFIX="${INSTALL}/${GPU_VERSION}-skqp"
if echo "${SKQP_BACKEND}" | grep -qE 'gl(es)?'
if echo "${SKQP_BACKEND}" | grep -qE 'vk|gl(es)?'
then
SKQP_RENDER_TESTS_FILE="${SKQP_FILE_PREFIX}-${SKQP_BACKEND}_rendertests.txt"
[ -f "${SKQP_RENDER_TESTS_FILE}" ] || return 1
cp "${SKQP_RENDER_TESTS_FILE}" "${SKQP_ASSETS_DIR}"/skqp/rendertests.txt
return 0
fi
@@ -15,37 +43,75 @@ copy_tests_files() (
# that is why it needs to be a special case.
if echo "${SKQP_BACKEND}" | grep -qE "unitTest"
then
cp "${SKQP_FILE_PREFIX}_unittests.txt" "${SKQP_ASSETS_DIR}"/skqp/unittests.txt
SKQP_UNIT_TESTS_FILE="${SKQP_FILE_PREFIX}_unittests.txt"
[ -f "${SKQP_UNIT_TESTS_FILE}" ] || return 1
cp "${SKQP_UNIT_TESTS_FILE}" "${SKQP_ASSETS_DIR}"/skqp/unittests.txt
fi
)
test_vk_backend() {
if echo "${SKQP_BACKENDS}" | grep -qE 'vk'
then
if [ -n "$VK_DRIVER" ]; then
return 0
fi
echo "VK_DRIVER environment variable is missing."
VK_DRIVERS=$(ls "$INSTALL"/share/vulkan/icd.d/ | cut -f 1 -d '_')
if [ -n "${VK_DRIVERS}" ]
then
echo "Please set VK_DRIVER to the correct driver from the list:"
echo "${VK_DRIVERS}"
fi
echo "No Vulkan tests will be executed, but it was requested in SKQP_BACKENDS variable. Exiting."
exit 2
fi
# Vulkan environment is not configured, but it was not requested by the job
return 1
}
setup_backends() {
if test_vk_backend
then
export VK_ICD_FILENAMES="$INSTALL"/share/vulkan/icd.d/"$VK_DRIVER"_icd."${VK_CPU:-$(uname -m)}".json
fi
}
set -ex
# Needed so configuration files can contain paths to files in /install
ln -sf "$CI_PROJECT_DIR"/install /install
INSTALL=${PWD}/install
if [ -z "$GPU_VERSION" ]; then
echo 'GPU_VERSION must be set to something like "llvmpipe" or "freedreno-a630" (the name used in .gitlab-ci/gpu-version-*.txt)'
exit 1
echo 'GPU_VERSION must be set to something like "llvmpipe" or
"freedreno-a630" (it will serve as a component to find the path for files
residing in src/**/ci/*.txt)'
exit 1
fi
SKQP_ASSETS_DIR=/skqp/assets
SKQP_RESULTS_DIR="${SKQP_RESULTS_DIR:-results}"
LD_LIBRARY_PATH=$INSTALL:$LD_LIBRARY_PATH
setup_backends
mkdir "${SKQP_ASSETS_DIR}"/skqp
SKQP_ASSETS_DIR=/skqp/assets
SKQP_RESULTS_DIR="${SKQP_RESULTS_DIR:-$PWD/results}"
mkdir -p "${SKQP_ASSETS_DIR}"/skqp
SKQP_EXITCODE=0
for SKQP_BACKEND in ${SKQP_BACKENDS}
do
set -e
copy_tests_files "${SKQP_BACKEND}"
if ! copy_tests_files "${SKQP_BACKEND}"
then
echo "No override test file found for ${SKQP_BACKEND}. Using the default one."
fi
set +e
SKQP_BACKEND_RESULTS_DIR="${SKQP_RESULTS_DIR}"/"${SKQP_BACKEND}"
mkdir -p "${SKQP_BACKEND_RESULTS_DIR}"
/skqp/skqp "${SKQP_ASSETS_DIR}" '' "${SKQP_BACKEND_RESULTS_DIR}" "${SKQP_BACKEND}_"
/skqp/skqp "${SKQP_ASSETS_DIR}" "${SKQP_BACKEND_RESULTS_DIR}" "${SKQP_BACKEND}_"
BACKEND_EXITCODE=$?
if [ ! $BACKEND_EXITCODE -eq 0 ]
@@ -69,15 +135,17 @@ then
echo "https://$CI_PROJECT_ROOT_NAMESPACE.pages.freedesktop.org/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/${SKQP_RESULTS_DIR}/unitTest/unit_tests.txt"
fi
for REPORT in "${SKQP_RESULTS_DIR}"/**/report.html
REPORT_FILES=$(mktemp)
find "${SKQP_RESULTS_DIR}"/**/report.html -type f > "${REPORT_FILES}"
while read -r REPORT
do
BACKEND_NAME=$(echo "${REPORT}" | sed 's@.*/\([^/]*\)/report.html@\1@')
echo "See skqp ${BACKEND_NAME} render tests report at:"
echo "https://$CI_PROJECT_ROOT_NAMESPACE.pages.freedesktop.org/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/${REPORT}"
done
done < "${REPORT_FILES}"
# If there is no report available, tell the user that something is wrong.
if [ ! -f "${REPORT}" ]
if [ ! -s "${REPORT_FILES}" ]
then
echo "No skqp report available. Probably some fatal error has occured during the skqp execution."
fi

View File

@@ -150,6 +150,8 @@
rules:
- if: '$FD_FARM == "offline"'
when: never
- if: '$COLLABORA_FARM == "offline" && $RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
when: never
- *ignore_scheduled_pipelines
- changes:
*mesa_core_file_list
@@ -177,9 +179,11 @@
rules:
- if: '$FD_FARM == "offline"'
when: never
- if: '$COLLABORA_FARM == "offline" && $RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
when: never
# If the triggerer has access to the restricted traces and if it is pre-merge
- if: '($GITLAB_USER_LOGIN !~ "/^(robclark|anholt|flto|cwabbott0|Danil|tomeu)$/") &&
($GITLAB_USER_LOGIN != "marge-bot" || $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $CI_COMMIT_REF_NAME)'
($GITLAB_USER_LOGIN != "marge-bot" || $CI_COMMIT_BRANCH)'
when: never
- *ignore_scheduled_pipelines
- changes:
@@ -203,9 +207,11 @@
rules:
- if: '$FD_FARM == "offline"'
when: never
- if: '$COLLABORA_FARM == "offline" && $RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
when: never
- *ignore_scheduled_pipelines
# Run only on pre-merge pipelines from Marge
- if: '$GITLAB_USER_LOGIN != "marge-bot" || $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $CI_COMMIT_REF_NAME'
- if: '$GITLAB_USER_LOGIN != "marge-bot" || $CI_COMMIT_BRANCH'
when: never
- changes:
*mesa_core_file_list
@@ -221,10 +227,30 @@
when: manual
- when: never
.nouveau-rules:
stage: nouveau
rules:
- *ignore_scheduled_pipelines
- changes:
*mesa_core_file_list
when: on_success
- changes:
*gallium_core_file_list
when: on_success
- changes:
- src/nouveau/**/*
- src/gallium/drivers/nouveau/**/*
- src/gallium/winsys/kmsro/**/*
- src/gallium/winsys/nouveau/**/*
when: on_success
- when: never
.panfrost-midgard-rules:
stage: arm
rules:
- *ignore_scheduled_pipelines
- if: '$COLLABORA_FARM == "offline" && $RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
when: never
- changes:
*mesa_core_file_list
when: on_success
@@ -251,6 +277,8 @@
stage: arm
rules:
- *ignore_scheduled_pipelines
- if: '$COLLABORA_FARM == "offline" && $RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
when: never
- changes:
*mesa_core_file_list
when: on_success
@@ -346,6 +374,8 @@
stage: amd
rules:
- *ignore_scheduled_pipelines
- if: '$COLLABORA_FARM == "offline" && $RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
when: never
- changes:
*mesa_core_file_list
when: on_success
@@ -374,10 +404,37 @@
when: on_success
- when: never
# Unfortunately YAML doesn't let us concatenate arrays, so we have to do the
# rules duplication manually
.virgl-lava-rules-performance:
stage: layered-backends
rules:
- *ignore_scheduled_pipelines
- if: '$COLLABORA_FARM == "offline" && $RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
when: never
# Run only on pre-merge pipelines from Marge
- if: '$GITLAB_USER_LOGIN != "marge-bot" || $CI_COMMIT_BRANCH'
when: never
- changes:
*mesa_core_file_list
when: manual
- changes:
*gallium_core_file_list
when: manual
- changes:
*llvmpipe_file_list
when: manual
- changes:
*virgl_file_list
when: manual
- when: never
.radeonsi-rules:
stage: amd
rules:
- *ignore_scheduled_pipelines
- if: '$COLLABORA_FARM == "offline" && $RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
when: never
- changes:
*mesa_core_file_list
when: on_success
@@ -399,6 +456,8 @@
stage: amd
rules:
- *ignore_scheduled_pipelines
- if: '$COLLABORA_FARM == "offline" && $RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
when: never
- changes:
*mesa_core_file_list
when: on_success
@@ -452,6 +511,8 @@
stage: intel
rules:
- *ignore_scheduled_pipelines
- if: '$COLLABORA_FARM == "offline" && $RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
when: never
- changes:
*mesa_core_file_list
when: on_success
@@ -471,8 +532,10 @@
stage: intel
rules:
- *ignore_scheduled_pipelines
- if: '$COLLABORA_FARM == "offline" && $RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
when: never
# Run only on pre-merge pipelines from Marge
- if: '$GITLAB_USER_LOGIN != "marge-bot" || $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $CI_COMMIT_REF_NAME'
- if: '$GITLAB_USER_LOGIN != "marge-bot" || $CI_COMMIT_BRANCH'
when: never
- changes:
*mesa_core_file_list
@@ -489,6 +552,8 @@
stage: intel
rules:
- *ignore_scheduled_pipelines
- if: '$COLLABORA_FARM == "offline" && $RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
when: never
- changes:
*mesa_core_file_list
when: on_success
@@ -522,6 +587,8 @@
# rules duplication manually
.windows-build-rules:
rules:
- if: '$MICROSOFT_FARM == "offline"'
when: never
- *ignore_scheduled_pipelines
- changes:
*mesa_core_file_list
@@ -556,6 +623,8 @@
.windows-test-rules:
rules:
- if: '$MICROSOFT_FARM == "offline"'
when: never
- *ignore_scheduled_pipelines
- changes:
*mesa_core_file_list

View File

@@ -0,0 +1,314 @@
.test:
extends:
- .ci-run-policy
# Cancel job if a newer commit is pushed to the same branch
interruptible: true
variables:
GIT_STRATEGY: none # testing doesn't build anything from source
before_script:
- !reference [default, before_script]
# Note: Build dir (and thus install) may be dirty due to GIT_STRATEGY
- rm -rf install
- tar -xf artifacts/install.tar
- echo -e "\e[0Ksection_start:$(date +%s):ldd_section[collapsed=true]\r\e[0KChecking ldd on driver build"
- LD_LIBRARY_PATH=install/lib find install/lib -name "*.so" -print -exec ldd {} \;
- echo -e "\e[0Ksection_end:$(date +%s):ldd_section\r\e[0K"
artifacts:
when: always
name: "mesa_${CI_JOB_NAME}"
paths:
- results/
.test-gl:
extends:
- .test
- .use-debian/x86_test-gl
needs:
- debian/x86_test-gl
- debian-testing
.test-vk:
extends:
- .test
- .use-debian/x86_test-vk
needs:
- debian-testing
- debian/x86_test-vk
.test-cl:
extends:
- .test
- .use-debian/x86_test-gl
needs:
- debian/x86_test-gl
- debian-clover-testing
.vkd3d-proton-test:
artifacts:
when: on_failure
name: "mesa_${CI_JOB_NAME}"
paths:
- results/vkd3d-proton.log
script:
- ./install/vkd3d-proton/run.sh
.piglit-test:
artifacts:
name: "mesa_${CI_JOB_NAME}"
paths:
- results
reports:
junit: results/junit.xml
variables:
PIGLIT_NO_WINDOW: 1
HWCI_TEST_SCRIPT: "/install/piglit/piglit-runner.sh"
script:
- install/piglit/piglit-runner.sh
.piglit-traces-test:
extends:
- .piglit-test
cache:
key: ${CI_JOB_NAME}
paths:
- replayer-db/
artifacts:
when: on_failure
name: "mesa_${CI_JOB_NAME}"
reports:
junit: results/junit.xml
paths:
- results/summary/
- results/*.txt
variables:
PIGLIT_REPLAY_EXTRA_ARGS: --keep-image --db-path ${CI_PROJECT_DIR}/replayer-db/ --minio_host=minio-packet.freedesktop.org --minio_bucket=mesa-tracie-public --role-session-name=${CI_PROJECT_PATH}:${CI_JOB_ID} --jwt-file=${CI_JOB_JWT_FILE}
script:
- install/piglit/piglit-traces.sh
.deqp-test:
script:
- ./install/deqp-runner.sh
artifacts:
exclude:
- results/*.shader_cache
reports:
junit: results/junit.xml
.deqp-test-vk:
extends:
- .deqp-test
variables:
DEQP_VER: vk
.fossilize-test:
script:
- ./install/fossilize-runner.sh
artifacts:
when: on_failure
name: "mesa_${CI_JOB_NAME}"
paths:
- results/
.baremetal-test:
extends:
- .ci-run-policy
- .test
# Cancel job if a newer commit is pushed to the same branch
interruptible: true
stage: test
before_script:
- !reference [default, before_script]
# Use this instead of gitlab's artifacts download because it hits packet.net
# instead of fd.o. Set FDO_HTTP_CACHE_URI to an http cache for your test lab to
# improve it even more (see https://docs.mesa3d.org/ci/bare-metal.html for
# setup).
- wget ${FDO_HTTP_CACHE_URI:-}https://${PIPELINE_ARTIFACTS_BASE}/${MINIO_ARTIFACT_NAME}.tar.gz -S --progress=dot:giga -O- | tar -xz
artifacts:
when: always
name: "mesa_${CI_JOB_NAME}"
paths:
- results/
- serial*.txt
exclude:
- results/*.shader_cache
reports:
junit: results/junit.xml
.baremetal-test-armhf:
extends:
- .baremetal-test
variables:
BM_ROOTFS: /rootfs-armhf
MINIO_ARTIFACT_NAME: mesa-armhf
.baremetal-test-arm64:
extends:
- .baremetal-test
variables:
BM_ROOTFS: /rootfs-arm64
MINIO_ARTIFACT_NAME: mesa-arm64
.baremetal-arm64-asan-test:
variables:
DEQP_RUNNER_OPTIONS: "--env LD_PRELOAD=libasan.so.6:/install/lib/libdlclose-skip.so"
MINIO_ARTIFACT_NAME: mesa-arm64-asan
needs:
- debian/arm_test
- job: debian-arm64-asan
artifacts: false
.baremetal-deqp-test:
variables:
HWCI_TEST_SCRIPT: "/install/deqp-runner.sh"
FDO_CI_CONCURRENT: 0 # Default to number of CPUs
.baremetal-skqp-test:
variables:
HWCI_START_XORG: 1
HWCI_TEST_SCRIPT: "/install/skqp-runner.sh"
# For Valve's bare-metal testing farm jobs.
.b2c-test:
# It would be nice to use ci-templates within Mesa CI for this job's
# image:, but the integration is not possible for the current
# use-case. Within this job, two containers are managed. 1) the
# gitlab runner container from which the job is submitted to the
# DUT, and 2) the test container (e.g. debian/x86_test-vk) within
# which the test cases will run on the DUT. Since ci-templates and
# the associated image setting macros in this file rely on variables
# like FDO_DISTRIBUTION_TAG for *the* image, there is no way to
# depend on more than one image per job. So, the job container is
# built as part of the CI in the boot2container project.
image: registry.freedesktop.org/mupuf/valve-infra/mesa-trigger:2022-03-03.2
extends:
- .use-debian/x86_test-vk
variables:
# No need by default to pull the whole repo
GIT_STRATEGY: none
# boot2container initrd configuration parameters.
B2C_KERNEL_URL: 'https://gitlab.freedesktop.org/mupuf/valve-infra/-/package_files/117/download' # 5.16-for-mesa-ci
B2C_INITRAMFS_URL: 'https://gitlab.freedesktop.org/mupuf/boot2container/-/releases/v0.9.4/downloads/initramfs.linux_amd64.cpio.xz'
B2C_JOB_SUCCESS_REGEX: '\[.*\]: Execution is over, pipeline status: 0\r$'
B2C_JOB_WARN_REGEX: 'null'
B2C_LOG_LEVEL: 6
B2C_POWEROFF_DELAY: 15
B2C_SESSION_END_REGEX: '^.*It''s now safe to turn off your computer\r$'
B2C_SESSION_REBOOT_REGEX: 'GPU hang detected!'
B2C_TIMEOUT_BOOT_MINUTES: 240
B2C_TIMEOUT_BOOT_RETRIES: 2
B2C_TIMEOUT_FIRST_MINUTES: 5
B2C_TIMEOUT_FIRST_RETRIES: 3
B2C_TIMEOUT_MINUTES: 2
B2C_TIMEOUT_OVERALL_MINUTES: 240
B2C_TIMEOUT_RETRIES: 0
# As noted in the top description, we make a distinction between the
# container used by gitlab-runner to queue the work, and the container
# used by the DUTs/test machines. To make this distinction quite clear,
# we rename the MESA_IMAGE variable into IMAGE_UNDER_TEST.
IMAGE_UNDER_TEST: "$MESA_IMAGE"
INSTALL_TARBALL: "./artifacts/install.tar"
CI_VALVE_ARTIFACTS: "./artifacts/valve"
CI_COMMON_SCRIPTS: "./artifacts/ci-common"
GENERATE_ENV_SCRIPT: "${CI_COMMON_SCRIPTS}/generate-env.sh"
B2C_JOB_TEMPLATE: "${CI_VALVE_ARTIFACTS}/b2c.yml.jinja2.jinja2"
JOB_FOLDER: "job_folder"
before_script:
# We don't want the tarball unpacking of .test, but will take the JWT bits.
- !reference [default, before_script]
- |
set -x
# Useful as a hook point for runner admins. You may edit the
# config.toml for the Gitlab runner and use a bind-mount to
# populate the hook script with some executable commands. This
# allows quicker feedback than resubmitting pipelines and
# potentially having to wait for a debug build of Mesa to
# complete.
if [ -x /runner-before-script.sh ]; then
echo "Executing runner before-script hook..."
sh /runner-before-script.sh
if [ $? -ne 0 ]; then
echo "Runner hook failed, goodbye"
exit $?
fi
fi
[ -s "$INSTALL_TARBALL" ] || exit 1
[ -d "$CI_VALVE_ARTIFACTS" ] || exit 1
[ -d "$CI_COMMON_SCRIPTS" ] || exit 1
B2C_TEST_SCRIPT="bash -c 'source ./set-job-env-vars.sh ; ${B2C_TEST_SCRIPT}'"
# The Valve CI gateway receives jobs in a YAML format. Create a
# job description from the CI environment.
python3 "$CI_VALVE_ARTIFACTS"/generate_b2c.py \
--ci-job-id "${CI_JOB_ID}" \
--container-cmd "${B2C_TEST_SCRIPT}" \
--initramfs-url "${B2C_INITRAMFS_URL}" \
--job-success-regex "${B2C_JOB_SUCCESS_REGEX}" \
--job-warn-regex "${B2C_JOB_WARN_REGEX}" \
--kernel-url "${B2C_KERNEL_URL}" \
--log-level "${B2C_LOG_LEVEL}" \
--poweroff-delay "${B2C_POWEROFF_DELAY}" \
--session-end-regex "${B2C_SESSION_END_REGEX}" \
--session-reboot-regex "${B2C_SESSION_REBOOT_REGEX}" \
--tags "${CI_RUNNER_TAGS}" \
--template "${B2C_JOB_TEMPLATE}" \
--timeout-boot-minutes "${B2C_TIMEOUT_BOOT_MINUTES}" \
--timeout-boot-retries "${B2C_TIMEOUT_BOOT_RETRIES}" \
--timeout-first-minutes "${B2C_TIMEOUT_FIRST_MINUTES}" \
--timeout-first-retries "${B2C_TIMEOUT_FIRST_RETRIES}" \
--timeout-minutes "${B2C_TIMEOUT_MINUTES}" \
--timeout-overall-minutes "${B2C_TIMEOUT_OVERALL_MINUTES}" \
--timeout-retries "${B2C_TIMEOUT_RETRIES}" \
--job-volume-exclusions "${B2C_JOB_VOLUME_EXCLUSIONS}" \
--local-container "${IMAGE_UNDER_TEST}" \
${B2C_EXTRA_VOLUME_ARGS} \
--working-dir "$CI_PROJECT_DIR"
cat b2c.yml.jinja2
rm -rf ${JOB_FOLDER} || true
mkdir -v ${JOB_FOLDER}
# Create a script to regenerate the CI environment when this job
# begins running on the remote DUT.
set +x
"$CI_COMMON_SCRIPTS"/generate-env.sh > ${JOB_FOLDER}/set-job-env-vars.sh
chmod +x ${JOB_FOLDER}/set-job-env-vars.sh
echo "Variables passed through:"
cat ${JOB_FOLDER}/set-job-env-vars.sh
echo "export CI_JOB_JWT=${CI_JOB_JWT}" >> ${JOB_FOLDER}/set-job-env-vars.sh
set -x
# Extract the Mesa distribution into the location expected by
# the Mesa CI deqp-runner scripts.
tar x -C ${JOB_FOLDER} -f $INSTALL_TARBALL
script: |
slugify () {
echo "$1" | sed -r s/[~\^]+//g | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr A-Z a-z
}
# Submit the job to Valve's CI gateway service with the CI
# provisioned job_folder.
env PYTHONUNBUFFERED=1 executorctl \
run -w b2c.yml.jinja2 -j $(slugify "$CI_JOB_NAME") -s ${JOB_FOLDER}
ls -l
# Anything our job places in results/ will be collected by the
# Gitlab coordinator for status presentation. results/junit.xml
# will be parsed by the UI for more detailed explanations of
# test execution.
needs:
- debian/x86_test-vk
- debian-testing
artifacts:
when: always
name: "mesa_${CI_JOB_NAME}"
paths:
- ${JOB_FOLDER}/results
reports:
junit: ${JOB_FOLDER}/results/junit.xml

View File

View File

@@ -0,0 +1,250 @@
#!/usr/bin/env python3
#
# Copyright (C) 2022 Collabora Limited
# Author: Guilherme Gallo <guilherme.gallo@collabora.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import xmlrpc.client
from contextlib import nullcontext as does_not_raise
from datetime import datetime
from itertools import repeat
from typing import Tuple
from unittest.mock import MagicMock, patch
import pytest
import yaml
from freezegun import freeze_time
from lava.lava_job_submitter import (
DEVICE_HANGING_TIMEOUT_SEC,
follow_job_execution,
hide_sensitive_data,
retriable_follow_job,
)
def jobs_logs_response(finished=False, msg=None) -> Tuple[bool, str]:
timed_msg = {"dt": str(datetime.now()), "msg": "New message"}
logs = [timed_msg] if msg is None else msg
return finished, yaml.safe_dump(logs)
def result_get_testjob_results_response() -> str:
result = {"result": "test"}
results = [{"metadata": result}]
return yaml.safe_dump(results)
def result_get_testcase_results_response() -> str:
result = {"result": "pass"}
test_cases = [result]
return yaml.safe_dump(test_cases)
@pytest.fixture
def mock_proxy():
def create_proxy_mock(**kwargs):
proxy_mock = MagicMock()
proxy_submit_mock = proxy_mock.scheduler.jobs.submit
proxy_submit_mock.return_value = "1234"
proxy_results_mock = proxy_mock.results.get_testjob_results_yaml
proxy_results_mock.return_value = result_get_testjob_results_response()
proxy_test_cases_mock = proxy_mock.results.get_testcase_results_yaml
proxy_test_cases_mock.return_value = result_get_testcase_results_response()
proxy_logs_mock = proxy_mock.scheduler.jobs.logs
proxy_logs_mock.return_value = jobs_logs_response()
for key, value in kwargs.items():
setattr(proxy_logs_mock, key, value)
return proxy_mock
yield create_proxy_mock
@pytest.fixture
def mock_proxy_waiting_time(mock_proxy):
def update_mock_proxy(frozen_time, **kwargs):
wait_time = kwargs.pop("wait_time", 0)
proxy_mock = mock_proxy(**kwargs)
proxy_job_state = proxy_mock.scheduler.job_state
proxy_job_state.return_value = {"job_state": "Running"}
proxy_job_state.side_effect = frozen_time.tick(wait_time)
return proxy_mock
return update_mock_proxy
@pytest.fixture
def mock_sleep():
"""Mock time.sleep to make test faster"""
with patch("time.sleep", return_value=None):
yield
@pytest.fixture
def frozen_time(mock_sleep):
with freeze_time() as frozen_time:
yield frozen_time
@pytest.mark.parametrize("exception", [RuntimeError, SystemError, KeyError])
def test_submit_and_follow_respects_exceptions(mock_sleep, mock_proxy, exception):
with pytest.raises(exception):
follow_job_execution(mock_proxy(side_effect=exception), "")
def generate_n_logs(n=1, tick_sec=1):
"""Simulate a log partitionated in n components"""
with freeze_time(datetime.now()) as time_travel:
while True:
# Simulate a scenario where the target job is waiting for being started
for _ in range(n - 1):
time_travel.tick(tick_sec)
yield jobs_logs_response(finished=False, msg=[])
time_travel.tick(tick_sec)
yield jobs_logs_response(finished=True)
NETWORK_EXCEPTION = xmlrpc.client.ProtocolError("", 0, "test", {})
XMLRPC_FAULT = xmlrpc.client.Fault(0, "test")
PROXY_SCENARIOS = {
"finish case": (generate_n_logs(1), does_not_raise(), True),
"works at last retry": (
generate_n_logs(n=3, tick_sec=DEVICE_HANGING_TIMEOUT_SEC + 1),
does_not_raise(),
True,
),
"timed out more times than retry attempts": (
generate_n_logs(n=4, tick_sec=DEVICE_HANGING_TIMEOUT_SEC + 1),
does_not_raise(),
False,
),
"long log case, no silence": (
generate_n_logs(n=1000, tick_sec=0),
does_not_raise(),
True,
),
"very long silence": (
generate_n_logs(n=4, tick_sec=100000),
does_not_raise(),
False,
),
# If a protocol error happens, _call_proxy will retry without affecting timeouts
"unstable connection, ProtocolError followed by final message": (
(NETWORK_EXCEPTION, jobs_logs_response(finished=True)),
does_not_raise(),
True,
),
# After an arbitrary number of retries, _call_proxy should call sys.exit
"unreachable case, subsequent ProtocolErrors": (
repeat(NETWORK_EXCEPTION),
pytest.raises(SystemExit),
False,
),
"XMLRPC Fault": ([XMLRPC_FAULT], pytest.raises(SystemExit, match="1"), False),
}
@patch("time.sleep", return_value=None) # mock sleep to make test faster
@pytest.mark.parametrize(
"side_effect, expectation, has_finished",
PROXY_SCENARIOS.values(),
ids=PROXY_SCENARIOS.keys(),
)
def test_retriable_follow_job(
mock_sleep, side_effect, expectation, has_finished, mock_proxy
):
with expectation:
result = retriable_follow_job(mock_proxy(side_effect=side_effect), "")
assert has_finished == result
WAIT_FOR_JOB_SCENARIOS = {
"one log run taking (sec):": (generate_n_logs(1), True),
}
@pytest.mark.parametrize("wait_time", (0, DEVICE_HANGING_TIMEOUT_SEC * 2))
@pytest.mark.parametrize(
"side_effect, has_finished",
WAIT_FOR_JOB_SCENARIOS.values(),
ids=WAIT_FOR_JOB_SCENARIOS.keys(),
)
def test_simulate_a_long_wait_to_start_a_job(
frozen_time,
wait_time,
side_effect,
has_finished,
mock_proxy_waiting_time,
):
start_time = datetime.now()
result = retriable_follow_job(
mock_proxy_waiting_time(
frozen_time, side_effect=side_effect, wait_time=wait_time
),
"",
)
end_time = datetime.now()
delta_time = end_time - start_time
assert has_finished == result
assert delta_time.total_seconds() >= wait_time
SENSITIVE_DATA_SCENARIOS = {
"no sensitive data tagged": (
["bla bla", "mytoken: asdkfjsde1341=="],
["bla bla", "mytoken: asdkfjsde1341=="],
"HIDEME",
),
"sensitive data tagged": (
["bla bla", "mytoken: asdkfjsde1341== # HIDEME"],
["bla bla"],
"HIDEME",
),
"sensitive data tagged with custom word": (
["bla bla", "mytoken: asdkfjsde1341== # DELETETHISLINE", "third line"],
["bla bla", "third line"],
"DELETETHISLINE",
),
}
@pytest.mark.parametrize(
"input, expectation, tag",
SENSITIVE_DATA_SCENARIOS.values(),
ids=SENSITIVE_DATA_SCENARIOS.keys(),
)
def test_hide_sensitive_data(input, expectation, tag):
yaml_data = yaml.safe_dump(input)
yaml_result = hide_sensitive_data(yaml_data, tag)
result = yaml.safe_load(yaml_result)
assert result == expectation

View File

@@ -0,0 +1,63 @@
version: 1
# Rules to match for a machine to qualify
target:
{% if tags %}
{% set b2ctags = tags.split(',') %}
tags:
{% for tag in b2ctags %}
- '{{ tag | trim }}'
{% endfor %}
{% endif %}
timeouts:
first_console_activity: # This limits the time it can take to receive the first console log
minutes: {{ timeout_first_minutes }}
retries: {{ timeout_first_retries }}
console_activity: # Reset every time we receive a message from the logs
minutes: {{ timeout_minutes }}
retries: {{ timeout_retries }}
boot_cycle:
minutes: {{ timeout_boot_minutes }}
retries: {{ timeout_boot_retries }}
overall: # Maximum time the job can take, not overrideable by the "continue" deployment
minutes: {{ timeout_overall_minutes }}
retries: 0
# no retries possible here
console_patterns:
session_end:
regex: >-
{{ session_end_regex }}
session_reboot:
regex: >-
{{ session_reboot_regex }}
job_success:
regex: >-
{{ job_success_regex }}
# Environment to deploy
deployment:
# Initial boot
start:
kernel:
url: '{{ kernel_url }}'
cmdline: >
SALAD.machine_id={{ '{{' }} machine_id }}
console={{ '{{' }} local_tty_device }},115200 earlyprintk=vga,keep
loglevel={{ log_level }} amdgpu.gpu_recovery=0 no_hash_pointers
b2c.container="-ti --tls-verify=false docker://{{ '{{' }} fdo_proxy_registry }}/mupuf/valve-infra/machine_registration:latest check"
b2c.ntp_peer=10.42.0.1 b2c.pipefail b2c.cache_device=auto b2c.poweroff_delay={{ poweroff_delay }}
b2c.minio="gateway,{{ '{{' }} minio_url }},{{ '{{' }} job_bucket_access_key }},{{ '{{' }} job_bucket_secret_key }}"
b2c.volume="{{ '{{' }} job_bucket }}-results,mirror=gateway/{{ '{{' }} job_bucket }},pull_on=pipeline_start,push_on=changes,overwrite{% for excl in job_volume_exclusions %},exclude={{ excl }}{% endfor %},expiration=pipeline_end,preserve"
{% for volume in volumes %}
b2c.volume={{ volume }}
{% endfor %}
b2c.container="-v {{ '{{' }} job_bucket }}-results:{{ working_dir }} -w {{ working_dir }} {% for mount_volume in mount_volumes %} -v {{ mount_volume }}{% endfor %} --tls-verify=false docker://{{ local_container }} {{ container_cmd }}"
{% if cmdline_extras is defined %}
{{ cmdline_extras }}
{% endif %}
initramfs:
url: '{{ initramfs_url }}'

101
.gitlab-ci/valve/generate_b2c.py Executable file
View File

@@ -0,0 +1,101 @@
#!/usr/bin/env python3
# Copyright © 2022 Valve Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
from jinja2 import Environment, FileSystemLoader
from argparse import ArgumentParser
from os import environ, path
parser = ArgumentParser()
parser.add_argument('--ci-job-id')
parser.add_argument('--container-cmd')
parser.add_argument('--initramfs-url')
parser.add_argument('--job-success-regex')
parser.add_argument('--job-warn-regex')
parser.add_argument('--kernel-url')
parser.add_argument('--log-level', type=int)
parser.add_argument('--poweroff-delay', type=int)
parser.add_argument('--session-end-regex')
parser.add_argument('--session-reboot-regex')
parser.add_argument('--tags', nargs='?', default='')
parser.add_argument('--template', default='b2c.yml.jinja2.jinja2')
parser.add_argument('--timeout-boot-minutes', type=int)
parser.add_argument('--timeout-boot-retries', type=int)
parser.add_argument('--timeout-first-minutes', type=int)
parser.add_argument('--timeout-first-retries', type=int)
parser.add_argument('--timeout-minutes', type=int)
parser.add_argument('--timeout-overall-minutes', type=int)
parser.add_argument('--timeout-retries', type=int)
parser.add_argument('--job-volume-exclusions', nargs='?', default='')
parser.add_argument('--volume', action='append')
parser.add_argument('--mount-volume', action='append')
parser.add_argument('--local-container', default=environ.get('B2C_LOCAL_CONTAINER', 'alpine:latest'))
parser.add_argument('--working-dir')
args = parser.parse_args()
env = Environment(loader=FileSystemLoader(path.dirname(args.template)),
trim_blocks=True, lstrip_blocks=True)
template = env.get_template(path.basename(args.template))
values = {}
values['ci_job_id'] = args.ci_job_id
values['container_cmd'] = args.container_cmd
values['initramfs_url'] = args.initramfs_url
values['job_success_regex'] = args.job_success_regex
values['job_warn_regex'] = args.job_warn_regex
values['kernel_url'] = args.kernel_url
values['log_level'] = args.log_level
values['poweroff_delay'] = args.poweroff_delay
values['session_end_regex'] = args.session_end_regex
values['session_reboot_regex'] = args.session_reboot_regex
values['tags'] = args.tags
values['template'] = args.template
values['timeout_boot_minutes'] = args.timeout_boot_minutes
values['timeout_boot_retries'] = args.timeout_boot_retries
values['timeout_first_minutes'] = args.timeout_first_minutes
values['timeout_first_retries'] = args.timeout_first_retries
values['timeout_minutes'] = args.timeout_minutes
values['timeout_overall_minutes'] = args.timeout_overall_minutes
values['timeout_retries'] = args.timeout_retries
if len(args.job_volume_exclusions) > 0:
exclusions = args.job_volume_exclusions.split(",")
values['job_volume_exclusions'] = [excl for excl in exclusions if len(excl) > 0]
if args.volume is not None:
values['volumes'] = args.volume
if args.mount_volume is not None:
values['mount_volumes'] = args.mount_volume
values['working_dir'] = args.working_dir
assert(len(args.local_container) > 0)
values['local_container'] = args.local_container.replace(
# Use the gateway's pull-through registry cache to reduce load on fd.o.
'registry.freedesktop.org', '{{ fdo_proxy_registry }}'
)
if 'B2C_KERNEL_CMDLINE_EXTRAS' in environ:
values['cmdline_extras'] = environ['B2C_KERNEL_CMDLINE_EXTRAS']
f = open(path.splitext(path.basename(args.template))[0], "w")
f.write(template.render(values))
f.close()

View File

@@ -0,0 +1,31 @@
$dxil_dll = cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 -no_logo && where dxil.dll" 2>&1
if ($dxil_dll -notmatch "dxil.dll$") {
Write-Output "Couldn't get path to dxil.dll"
exit 1
}
$env:Path = "$(Split-Path $dxil_dll);$env:Path"
# VK_ICD_FILENAMES environment variable is not used when running with
# elevated privileges. Add a key to the registry instead.
$hkey_path = "HKLM:\SOFTWARE\Khronos\Vulkan\Drivers\"
$hkey_name = Join-Path -Path $pwd -ChildPath "_install\share\vulkan\icd.d\dzn_icd.x86_64.json"
New-Item -Path $hkey_path -force
New-ItemProperty -Path $hkey_path -Name $hkey_name -Value 0 -PropertyType DWORD
$results = New-Item -ItemType Directory results
$deqp_options = @("--deqp-surface-width", 256, "--deqp-surface-height", 256, "--deqp-surface-type", "pbuffer", "--deqp-gl-config-name", "rgba8888d24s8ms0", "--deqp-visibility", "hidden")
$deqp_module = "C:\deqp\external\vulkancts\modules\vulkan\deqp-vk.exe"
$caselist = "C:\deqp\mustpass\vk-master.txt"
$baseline = ".\_install\warp-fails.txt"
$includes = @("-t", "dEQP-VK.api.*", "-t", "dEQP-VK.info.*", "-t", "dEQP-VK.draw.*", "-t", "dEQP-VK.query_pool.*", "-t", "dEQP-VK.memory.*")
$env:DZN_DEBUG = "warp"
deqp-runner run --deqp $($deqp_module) --output $($results) --caselist $($caselist) --baseline $($baseline) $($includes) --testlog-to-xml C:\deqp\executor\testlog-to-xml.exe --jobs 4 -- $($deqp_options)
$deqpstatus = $?
$template = "See https://$($env:CI_PROJECT_ROOT_NAMESPACE).pages.freedesktop.org/-/$($env:CI_PROJECT_NAME)/-/jobs/$($env:CI_JOB_ID)/artifacts/results/{{testcase}}.xml"
deqp-runner junit --testsuite dEQP --results "$($results)/failures.csv" --output "$($results)/junit.xml" --limit 50 --template $template
if (!$deqpstatus) {
Exit 1
}

View File

@@ -6,10 +6,48 @@ $env:PYTHONUTF8=1
Get-Date
Write-Host "Compiling Mesa"
$builddir = New-Item -ItemType Directory -Name "_build"
$installdir = New-Item -ItemType Directory -Name "_install"
Push-Location $builddir.FullName
cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 && meson --default-library=shared -Dzlib:default_library=static --buildtype=release -Db_ndebug=false -Dc_std=c17 -Dcpp_std=vc++latest -Db_vscrt=mt --cmake-prefix-path=`"C:\llvm-10`" --pkg-config-path=`"C:\llvm-10\lib\pkgconfig;C:\llvm-10\share\pkgconfig;C:\spirv-tools\lib\pkgconfig`" --prefix=`"$installdir`" -Dllvm=enabled -Dshared-llvm=disabled -Dvulkan-drivers=swrast,amd -Dgallium-drivers=swrast,d3d12,zink -Dshared-glapi=enabled -Dgles2=enabled -Dmicrosoft-clc=enabled -Dstatic-libclc=all -Dspirv-to-dxil=true -Dbuild-tests=true -Dwerror=true -Dwarning_level=2 -Dzlib:warning_level=1 -Dlibelf:warning_level=1 && ninja -j32 install && meson test --num-processes 32"
$builddir = New-Item -Force -ItemType Directory -Name "_build"
$installdir = New-Item -Force -ItemType Directory -Name "_install"
$builddir=$builddir.FullName
$installdir=$installdir.FullName
$sourcedir=$PWD
Remove-Item -Recurse -Force $builddir
Remove-Item -Recurse -Force $installdir
New-Item -ItemType Directory -Path $builddir
New-Item -ItemType Directory -Path $installdir
Write-Output builddir:$builddir
Write-Output installdir:$installdir
Write-Output sourcedir:$sourcedir
$installPath=& "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -version 16.0 -property installationpath
Write-Output "vswhere.exe installPath: $installPath"
$installPath="C:\BuildTools"
Write-Output "Final installPath: $installPath"
Import-Module (Join-Path $installPath "Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
Enter-VsDevShell -VsInstallPath $installPath -SkipAutomaticLocation -DevCmdArguments '-arch=x64 -no_logo -host_arch=amd64'
Push-Location $builddir
meson --default-library=shared -Dzlib:default_library=static --buildtype=release -Db_ndebug=false `
-Db_vscrt=mt --cmake-prefix-path="C:\llvm-10" `
--pkg-config-path="C:\llvm-10\lib\pkgconfig;C:\llvm-10\share\pkgconfig;C:\spirv-tools\lib\pkgconfig" `
--prefix="$installdir" `
-Dllvm=enabled -Dshared-llvm=disabled `
"-Dvulkan-drivers=swrast,amd,microsoft-experimental" "-Dgallium-drivers=swrast,d3d12,zink" `
-Dshared-glapi=enabled -Dgles2=enabled -Dmicrosoft-clc=enabled -Dstatic-libclc=all -Dspirv-to-dxil=true `
-Dbuild-tests=true -Dwerror=true -Dwarning_level=2 -Dzlib:warning_level=1 -Dlibelf:warning_level=1 `
$sourcedir
if ($?) {
ninja install -j32
}
if ($?) {
meson test --num-processes 32
}
$buildstatus = $?
Pop-Location
@@ -25,4 +63,6 @@ Copy-Item ".\.gitlab-ci\windows\piglit_run.ps1" -Destination $installdir
Copy-Item ".\.gitlab-ci\windows\spirv2dxil_check.ps1" -Destination $installdir
Copy-Item ".\.gitlab-ci\windows\spirv2dxil_run.ps1" -Destination $installdir
Copy-Item ".\.gitlab-ci\windows\deqp_runner_run.ps1" -Destination $installdir
Get-ChildItem -Recurse -Filter "ci" | Get-ChildItem -Filter "*.txt" | Copy-Item -Destination $installdir

View File

@@ -66,5 +66,59 @@ Push-Location -Path C:\spirv-samples\
git checkout 7ac0ad5a7fe0ec884faba1dc2916028d0268eeef
Pop-Location
Get-Date
Write-Host "Cloning Vulkan and GL Conformance Tests"
$deqp_source = "C:\src\VK-GL-CTS\"
git clone --no-progress --single-branch https://github.com/lfrb/VK-GL-CTS.git -b windows-flush $deqp_source
if (!$?) {
Write-Host "Failed to clone deqp repository"
Exit 1
}
Push-Location -Path $deqp_source
# --insecure is due to SSL cert failures hitting sourceforge for zlib and
# libpng (sigh). The archives get their checksums checked anyway, and git
# always goes through ssh or https.
py .\external\fetch_sources.py --insecure
Pop-Location
Get-Date
$deqp_build = New-Item -ItemType Directory -Path "C:\deqp"
Push-Location -Path $deqp_build.FullName
Write-Host "Compiling deqp"
cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 && cmake -S $($deqp_source) -B . -GNinja -DCMAKE_BUILD_TYPE=Release -DDEQP_TARGET=default && ninja -j32"
$buildstatus = $?
Pop-Location
if (!$buildstatus -Or !$installstatus) {
Write-Host "Failed to compile or install deqp"
Exit 1
}
# Copy test result templates
Copy-Item -Path "$($deqp_source)\doc\testlog-stylesheet\testlog.css" -Destination $deqp_build
Copy-Item -Path "$($deqp_source)\doc\testlog-stylesheet\testlog.xsl" -Destination $deqp_build
# Copy Vulkan must-pass list
$deqp_mustpass = New-Item -ItemType Directory -Path $deqp_build -Name "mustpass"
$root_mustpass = Join-Path -Path $deqp_source -ChildPath "external\vulkancts\mustpass\master"
$files = Get-Content "$($root_mustpass)\vk-default.txt"
foreach($file in $files) {
Get-Content "$($root_mustpass)\$($file)" | Add-Content -Path "$($deqp_mustpass)\vk-master.txt"
}
Remove-Item -Force -Recurse $deqp_source
Get-Date
$url = 'https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe';
Write-Host ('Downloading {0} ...' -f $url);
Invoke-WebRequest -Uri $url -OutFile 'rustup-init.exe';
Write-Host "Installing rust toolchain"
C:\rustup-init.exe -y;
Remove-Item C:\rustup-init.exe;
Get-Date
Write-Host "Installing deqp-runner"
$env:Path += ";$($env:USERPROFILE)\.cargo\bin"
cargo install --git https://gitlab.freedesktop.org/anholt/deqp-runner.git
Get-Date
Write-Host "Complete"

51734
.pick_status.json Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -98,6 +98,14 @@ meson.build @dbaker @eric
/src/*/vulkan/*_wsi_display.c @keithp
######
# CI #
######
# Broadcom
/src/broadcom/ci/ @jasuarez @chema
###########
# Drivers #
###########
@@ -106,9 +114,19 @@ meson.build @dbaker @eric
/src/asahi/ @alyssa
/src/gallium/drivers/asahi/ @alyssa
# Broadcom
/src/broadcom/ @itoral @apinheiro
/src/gallium/drivers/v3d/ @itoral @chema @jasuarez
/src/gallium/drivers/vc4/ @itoral @chema @jasuarez
# Freedreno
/src/gallium/drivers/freedreno/ @robclark
# Imagination
/include/drm-uapi/pvr_drm.h @CreativeCylon @frankbinns @rajnesh-kanwal
/src/imagination/ @CreativeCylon @frankbinns @rajnesh-kanwal
/src/imagination/rogue/ @simon-perretta-img
# Intel
/include/drm-uapi/i915_drm.h @kwg @llandwerlin @jekstrand @idr
/include/pci_ids/i*_pci_ids.h @kwg @llandwerlin @jekstrand @idr

View File

@@ -1 +1 @@
22.0.0-devel
22.1.7

View File

@@ -40,7 +40,7 @@ import docutils.utils
import docutils.parsers.rst.states as states
CURRENT_GL_VERSION = '4.6'
CURRENT_VK_VERSION = '1.2'
CURRENT_VK_VERSION = '1.3'
TEMPLATE = Template(textwrap.dedent("""\
${header}

View File

@@ -1,3 +1,23 @@
# Copyright © 2020-2021 Collabora Ltd
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import os
import pathlib
from urllib.parse import urlparse

View File

@@ -3,7 +3,7 @@ Bare-metal CI
The bare-metal scripts run on a system with gitlab-runner and Docker,
connected to potentially multiple bare-metal boards that run tests of
Mesa. Currently only "fastboot" and "ChromeOS Servo" devices are
Mesa. Currently "fastboot", "ChromeOS Servo", and POE-powered devices are
supported.
In comparison with LAVA, this doesn't involve maintaining a separate
@@ -25,11 +25,17 @@ should probably have the console on a serial connection, so that you
can see bootloader progress.
The boards need to be able to have a kernel/initramfs supplied by the
gitlab-runner system, since the initramfs is what contains the Mesa
testing payload.
gitlab-runner system, since Mesa often needs to update the kernel either for new
DRM functionality, or to fix kernel bugs.
The boards should have networking, so that we can extract the dEQP .xml
results to artifacts on GitLab.
The boards must have networking, so that we can extract the dEQP .xml results to
artifacts on GitLab, and so that we can download traces (too large for an
initramfs) for trace replay testing. Given that we need networking already, and
our deqp/piglit/etc. payload is large, we use nfs from the x86 runner system
rather than initramfs.
See `src/freedreno/ci/gitlab-ci.yml` for an example of fastboot on DB410c and
DB820c (freedreno-a306 and freereno-a530).
Requirements (servo)
--------------------
@@ -68,6 +74,64 @@ call "servo"::
dhcp-option=tag:cheza1,option:root-path,/srv/nfs/cheza1
dhcp-option=tag:cheza2,option:root-path,/srv/nfs/cheza2
See `src/freedreno/ci/gitlab-ci.yml` for an example of servo on cheza. Note
that other servo boards in CI are managed using LAVA.
Requirements (POE)
------------------
For boards with 30W or less power consumption, POE can be used for the power
control. The parts list ends up looking something like (for example):
- x86-64 gitlab-runner machine with a mid-range CPU, and 3+ GB of SSD storage
per board. This can host at least 15 boards in our experience.
- Cisco 2960S gigabit ethernet switch with POE. (Cisco 3750G, 3560G, or 2960G
were also recommended as reasonable-priced HW, but make sure the name ends in
G, X, or S)
- POE splitters to power the boards (you can find ones that go to micro USB,
USBC, and 5V barrel jacks at least)
- USB serial cables (Adafruit sells pretty reliable ones)
- A large powered USB hub for all the serial cables
- A pile of ethernet cables
You'll talk to the Cisco for configuration using its USB port, which provides a
serial terminal at 9600 baud. You need to enable SNMP control, which we'll do
using a "mesaci" community name that the gitlab runner can access as its
authentication (no password) to configure. To talk to the SNMP on the router,
you need to put an ip address on the default vlan (vlan 1).
Setting that up looks something like:
.. code-block: console
Switch>
Password:
Switch#configure terminal
Switch(config)#interface Vlan 1
Switch(config-if)#ip address 10.42.0.2 255.255.0.0
Switch(config-if)#end
Switch(config)#snmp-server community mesaci RW
Switch(config)#end
Switch#copy running-config startup-config
With that set up, you should be able to power on/off a port with something like:
.. code-block: console
% snmpset -v2c -r 3 -t 30 -cmesaci 10.42.0.2 1.3.6.1.4.1.9.9.402.1.2.1.1.1.1 i 1
% snmpset -v2c -r 3 -t 30 -cmesaci 10.42.0.2 1.3.6.1.4.1.9.9.402.1.2.1.1.1.1 i 4
Note that the "1.3.6..." SNMP OID changes between switches. The last digit
above is the interface id (port number). You can probably find the right OID by
google, that was easier than figuring it out from finding the switch's MIB
database. You can query the POE status from the switch serial using the `show
power inline` command.
Other than that, find the dnsmasq/tftp/nfs setup for your boards "servo" above.
See `src/broadcom/ci/gitlab-ci.yml` and `src/nouveau/ci/gitlab-ci.yml` for an
examples of POE for Raspberry Pi 3/4, and Jetson Nano.
Setup
-----

View File

@@ -74,7 +74,7 @@ release = 'latest'
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.

View File

@@ -31,6 +31,7 @@ import tempfile
INPUT_PATHS = [
'src/compiler/nir/nir.h',
'src/intel/isl',
'src/vulkan/runtime',
]
TEMPLATE_DOXYFILE = Template("""
@@ -57,6 +58,7 @@ EXPAND_ONLY_PREDEF = YES
# Defines required to keep doxygen from tripping on our attribute macros
PREDEFINED = PACKED=
PREDEFINED += ATTRIBUTE_CONST=
PREDEFINED += MUST_CHECK=
""")
def run_doxygen(output_path, input_paths=[]):

23
docs/drivers/radv.rst Normal file
View File

@@ -0,0 +1,23 @@
RADV
====
RADV is a Vulkan driver for AMD GCN/RDNA GPUs.
Debugging
---------
For a list of environment variables to debug RADV, please see
:ref:`radv env-vars` for a list.
Hardware Documentation
----------------------
You can find a list of documentation for the various generations of
AMD hardware on the `X.Org wiki
<https://www.x.org/wiki/RadeonFeature/#documentation>`_.
ACO
---
ACO is the shader-compiler used in RADV. You read its documentation
`here <https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/amd/compiler/README.md>`_.

86
docs/drivers/virgl.rst Normal file
View File

@@ -0,0 +1,86 @@
VirGL
=====
What is VirGL?
--------------
VirGL is a virtual 3D GPU for use inside QEMU virtual machines, that
allows the guest operating system to use the capabilities of the host GPU
to accelerate 3D rendering. The plan is to have a guest GPU that is fully
independent of the host GPU.
What exactly does it entail?
----------------------------
The project entails creating a virtual 3D capable graphics card for
virtual machines running inside QEMU. The design of this card is based
around the concepts of Gallium3D to make writing Mesa and (eventually)
Direct3D drivers for it easy. The card natively uses the Gallium TGSI
intermediate representation for its shaders. The implementation of
rendering for the card is done in the host system as part of QEMU and is
implemented purely on OpenGL so you can get accelerated rendering on any
sufficiently capable card/driver combination.
The project also consists of a complete Linux guest stack, composed of a
Linux kernel KMS driver, X.org 2D DDX driver and Mesa 3D driver.
Current status
--------------
* Many pieces are now upstreamed in various projects.
* Kernel Linux 4.2 contains the modesetting only drivers. Linux 4.4
contains the 3D supported pieces.
* Mesa main contains the virgl 3D driver.
* QEMU 2.4 contained the initial virtio-gpu with no acceleration
support. QEMU 2.5 contains 3D support only with the GTK3 frontend with
GL enabled.
* The virglrenderer library seems mostly API stable.
* Limited environment renderer (GLES2)
So what can it do now?
^^^^^^^^^^^^^^^^^^^^^^
Run a desktop and most 3D games I've thrown at it.
Scope
-----
The project is currently investigating the desktop virtualisation use case
only. This use case is where the viewer, host and guest are all running on
the same machine (i.e. workstation or laptop). Some areas are in scope for
future investigation but not being looked at, at this time.
Future scope
^^^^^^^^^^^^
* Remoting rendering using a codec solution.
* Windows guest, Direct3D drivers.
* Other architectures
Out of scope
^^^^^^^^^^^^
* Passing through GPUs or subsets of GPU capabilities.
Repos
-----
All upstream parts are being developed upstream.
virglrenderer: the GL renderer https://gitlab.freedesktop.org/virgl/virglrenderer
Authors and Contributors
------------------------
VirGL is a project undertaken by Dave Airlie at Red Hat. It builds on lots
of open source work in a number of projects, primarily the Gallium 3D code
from the Mesa project.
Support or Contact
------------------
mailing list: virglrenderer-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/virglrenderer-devel
irc: `#virgil3d on OFTC <irc://irc.oftc.net/virgil3d>`__.

View File

@@ -29,8 +29,6 @@ Here's a list of those requirements:
* ``logicOp``
* ``fillModeNonSolid``
* ``wideLines``
* ``largePoints``
* ``alphaToOne``
* ``shaderClipDistance``
@@ -58,7 +56,7 @@ OpenGL 3.0
^^^^^^^^^^
For OpenGL 3.0 support, the following additional requirements needs to be
For OpenGL 3.0 support, the following additional requirements must be
supported:
* ``VkPhysicalDeviceFeatures``:
@@ -93,7 +91,7 @@ verified:
OpenGL 3.3
^^^^^^^^^^
For OpenGL 3.3 support, the following additional requirements needs to be
For OpenGL 3.3 support, the following additional requirements must be
supported, although some of these might not actually get verified:
* ``VkPhysicalDeviceFeatures``:
@@ -107,7 +105,7 @@ supported, although some of these might not actually get verified:
OpenGL 4.0
^^^^^^^^^^
For OpenGL 4.0 support, the following additional requirements needs to be
For OpenGL 4.0 support, the following additional requirements must be
supported:
* ``VkPhysicalDeviceFeatures``:
@@ -129,16 +127,22 @@ supported:
OpenGL 4.1
^^^^^^^^^^
For OpenGL 4.1 support, the following additional ``VkPhysicalDeviceLimits``
are required:
For OpenGL 4.1 support, the following additional requirements must be
supported:
* ``maxImageDimension2D`` ≥ 16384
* ``maxViewports`` ≥ 16
* ``VkPhysicalDeviceFeatures``:
* ``multiViewport``
* ``VkPhysicalDeviceLimits``
* ``maxImageDimension2D`` ≥ 16384
* ``maxViewports`` ≥ 16
OpenGL 4.2
^^^^^^^^^^
For OpenGL 4.2 support, the following additional requirements needs to be
For OpenGL 4.2 support, the following additional requirements must be
supported:
* ``VkPhysicalDeviceLimits``:
@@ -171,13 +175,12 @@ supported:
OpenGL 4.3
^^^^^^^^^^
For OpenGL 4.3 support, the following additional requirements needs to be
For OpenGL 4.3 support, the following additional requirements must be
supported:
* ``VkPhysicalDeviceFeatures``:
* ``robustBufferAccess``
* ``multiViewport``
* Formats requiring ``VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT``:
@@ -192,7 +195,7 @@ supported:
OpenGL 4.4
^^^^^^^^^^
For OpenGL 4.4 support, the following additional requirements needs to be
For OpenGL 4.4 support, the following additional requirements must be
supported:
* Formats requiring ``VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT``:

View File

@@ -136,13 +136,13 @@ Core Mesa environment variables
integers, such as ``130``. Mesa will not really implement all the
features of the given language version if it's higher than what's
normally reported. (for developers only)
:envvar:`MESA_GLSL_CACHE_DISABLE`
if set to ``true``, disables the GLSL shader cache. If set to
``false``, enables the GLSL shader cache when it is disabled by
:envvar:`MESA_SHADER_CACHE_DISABLE`
if set to ``true``, disables the on-disk shader cache. If set to
``false``, enables the on-disk shader cache when it is disabled by
default.
:envvar:`MESA_GLSL_CACHE_MAX_SIZE`
:envvar:`MESA_SHADER_CACHE_MAX_SIZE`
if set, determines the maximum size of the on-disk cache of compiled
GLSL programs. Should be set to a number optionally followed by
shader programs. Should be set to a number optionally followed by
``K``, ``M``, or ``G`` to specify a size in kilobytes, megabytes, or
gigabytes. By default, gigabytes will be assumed. And if unset, a
maximum size of 1GB will be used.
@@ -154,9 +154,9 @@ Core Mesa environment variables
you may end up with a 1GB cache for x86_64 and another 1GB cache for
i386.
:envvar:`MESA_GLSL_CACHE_DIR`
:envvar:`MESA_SHADER_CACHE_DIR`
if set, determines the directory to be used for the on-disk cache of
compiled GLSL programs. If this variable is not set, then the cache
compiled shader programs. If this variable is not set, then the cache
will be stored in ``$XDG_CACHE_HOME/mesa_shader_cache`` (if that
variable is set), or else within ``.cache/mesa_shader_cache`` within
the user's home directory.
@@ -226,6 +226,19 @@ the :doc:`Xlib software driver page <xlibdriver>` for details.
:envvar:`MESA_GLX_ALPHA_BITS`
specifies default number of bits for alpha channel.
Mesa WGL driver environment variables
-------------------------------------
The following are only applicable to the Mesa WGL driver, which is in use
on Windows.
:envvar:`WGL_FORCE_MSAA`
if set to a positive value, specifies the number of MSAA samples to
force when choosing the display configuration.
:envvar:`WGL_DISABLE_ERROR_DIALOGS`
if set to 1, true or yes, disables Win32 error dialogs. Useful for
automated test-runs.
Intel driver environment variables
----------------------------------------------------
@@ -287,8 +300,8 @@ Intel driver environment variables
suppress generation of dual-object geometry shader code
``nofc``
disable fast clears
``norbc``
disable single sampled render buffer compression
``noccs``
disable lossless color compression
``optimizer``
dump shader assembly to files at each optimization pass and
iteration that make progress
@@ -575,30 +588,19 @@ VC4 driver environment variables
--------------------------------
:envvar:`VC4_DEBUG`
a comma-separated list of named flags, which do various things:
a comma-separated list of named flags, which do various things. Use
`VC4_DEBUG=help` to print a list of available options.
``cl``
dump command list during creation
``qpu``
dump generated QPU instructions
``qir``
dump QPU IR during program compile
``nir``
dump NIR during program compile
``tgsi``
dump TGSI during program compile
``shaderdb``
dump program compile information for shader-db analysis
``perf``
print during performance-related events
``norast``
skip actual hardware execution of commands
``always_flush``
flush after each draw call
``always_sync``
wait for finish after each flush
``dump``
write a GPU command stream trace file (VC4 simulator only)
V3D/V3DV driver environment variables
-------------------------------------
:envvar:`V3D_DEBUG`
a comma-separated list of debug options. Use `V3D_DEBUG=help` to
print a list of available options.
.. _radv env-vars:
RADV driver environment variables
---------------------------------
@@ -689,7 +691,11 @@ RADV driver environment variables
:envvar:`RADV_FORCE_VRS`
allow to force per-pipeline vertex VRS rates on GFX10.3+. This is only
forced for pipelines that don't explicitely use VRS or flat shading.
The supported values are 2x2, 1x2 and 2x1. Only for testing purposes.
The supported values are 2x2, 1x2, 2x1 and 1x1. Only for testing purposes.
:envvar:`RADV_FORCE_VRS_CONFIG_FILE`
similar to `RADV_FORCE_VRS` but allow to configure from a file. If present,
this supersedes `RADV_FORCE_VRS`.
:envvar:`RADV_PERFTEST`
a comma-separated list of named flags, which do various things:
@@ -770,13 +776,24 @@ RADV driver environment variables
radeonsi driver environment variables
-------------------------------------
:envvar:`radeonsi_no_infinite_interp`
Kill PS with infinite interp coeff (might fix hangs)
:envvar:`radeonsi_clamp_div_by_zero`
Clamp div by zero (x / 0 becomes FLT_MAX instead of NaN) (might fix rendering corruptions)
:envvar:`radeonsi_zerovram`
Clear all allocated memory to 0 before usage (might fix rendering corruptions)
:envvar:`AMD_DEBUG`
a comma-separated list of named flags, which do various things:
``nodcc``
Disable DCC.
``nodccclear``
Disable DCC fast clear.
Disable DCC fast clear
``nodisplaydcc``
disable Delta Color Compression (DCC) on displayable images
``nodccmsaa``
Disable DCC for MSAA
``nodpbb``
@@ -819,8 +836,6 @@ radeonsi driver environment variables
Don't print disassembled shaders
``preoptir``
Print the LLVM IR before initial optimizations
``gisel``
Enable LLVM global instruction selector.
``w32ge``
Use Wave32 for vertex, tessellation, and geometry shaders.
``w32ps``

View File

@@ -111,11 +111,11 @@ GL 3.3, GLSL 3.30 --- all DONE: freedreno, i965, nv50, nvc0, r600, radeonsi, llv
GL_ARB_vertex_type_2_10_10_10_rev DONE (v3d, panfrost)
GL 4.0, GLSL 4.00 --- all DONE: i965/gen7+, nvc0, r600, radeonsi, llvmpipe, virgl, zink
GL 4.0, GLSL 4.00 --- all DONE: i965/gen7+, nvc0, r600, radeonsi, llvmpipe, virgl, zink, d3d12
GL_ARB_draw_buffers_blend DONE (freedreno, i965/gen6+, nv50, softpipe, panfrost, d3d12)
GL_ARB_draw_indirect DONE (freedreno, i965/gen7+, softpipe, v3d, d3d12)
GL_ARB_gpu_shader5 DONE (i965/gen7+, d3d12)
GL_ARB_draw_buffers_blend DONE (freedreno, i965/gen6+, nv50, softpipe, panfrost)
GL_ARB_draw_indirect DONE (freedreno, i965/gen7+, softpipe, v3d)
GL_ARB_gpu_shader5 DONE (i965/gen7+)
- 'precise' qualifier DONE (softpipe)
- Dynamically uniform sampler array indices DONE (softpipe)
- Dynamically uniform UBO array indices DONE (freedreno, softpipe)
@@ -129,20 +129,20 @@ GL 4.0, GLSL 4.00 --- all DONE: i965/gen7+, nvc0, r600, radeonsi, llvmpipe, virg
- Interpolation functions DONE (softpipe)
- New overload resolution rules DONE (softpipe)
GL_ARB_gpu_shader_fp64 DONE (i965/gen7+, softpipe, )
GL_ARB_sample_shading DONE (freedreno/a6xx, i965/gen6+, nv50, panfrost, d3d12)
GL_ARB_shader_subroutine DONE (freedreno, i965/gen6+, nv50, softpipe, d3d12)
GL_ARB_sample_shading DONE (freedreno/a6xx, i965/gen6+, nv50, panfrost)
GL_ARB_shader_subroutine DONE (freedreno, i965/gen6+, nv50, softpipe)
GL_ARB_tessellation_shader DONE (freedreno/a6xx, i965/gen7+, )
GL_ARB_texture_buffer_object_rgb32 DONE (freedreno, i965/gen6+, softpipe, d3d12, panfrost)
GL_ARB_texture_cube_map_array DONE (freedreno/a4xx+, i965/gen6+, nv50, softpipe, d3d12)
GL_ARB_texture_gather DONE (freedreno, i965/gen6+, nv50, softpipe, v3d, panfrost, d3d12)
GL_ARB_texture_query_lod DONE (freedreno, i965, nv50, softpipe, v3d, panfrost, d3d12)
GL_ARB_texture_buffer_object_rgb32 DONE (freedreno, i965/gen6+, softpipe, panfrost)
GL_ARB_texture_cube_map_array DONE (freedreno/a4xx+, i965/gen6+, nv50, softpipe)
GL_ARB_texture_gather DONE (freedreno, i965/gen6+, nv50, softpipe, v3d, panfrost)
GL_ARB_texture_query_lod DONE (freedreno, i965, nv50, softpipe, v3d, panfrost)
GL_ARB_transform_feedback2 DONE (freedreno/a3xx+, i965/gen6+, nv50, softpipe, v3d, panfrost)
GL_ARB_transform_feedback3 DONE (freedreno/a3xx+, i965/gen7+, softpipe, )
GL 4.1, GLSL 4.10 --- all DONE: i965/gen7+, nvc0, r600, radeonsi, llvmpipe, virgl, zink
GL 4.1, GLSL 4.10 --- all DONE: i965/gen7+, nvc0, r600, radeonsi, llvmpipe, virgl, zink, d3d12
GL_ARB_ES2_compatibility DONE (freedreno, i965, nv50, softpipe, v3d, vc4, panfrost, d3d12, lima)
GL_ARB_ES2_compatibility DONE (freedreno, i965, nv50, softpipe, v3d, vc4, panfrost, lima)
GL_ARB_get_program_binary DONE (freedreno, 0 or 1 binary formats)
GL_ARB_separate_shader_objects DONE (all drivers)
GL_ARB_shader_precision DONE (i965/gen7+, all drivers that support GLSL 4.10)
@@ -150,19 +150,19 @@ GL 4.1, GLSL 4.10 --- all DONE: i965/gen7+, nvc0, r600, radeonsi, llvmpipe, virg
GL_ARB_viewport_array DONE (i965, nv50, softpipe, )
GL 4.2, GLSL 4.20 -- all DONE: i965/gen7+, nvc0, r600, radeonsi, llvmpipe, virgl, zink
GL 4.2, GLSL 4.20 -- all DONE: i965/gen7+, nvc0, r600, radeonsi, llvmpipe, virgl, zink, d3d12
GL_ARB_texture_compression_bptc DONE (freedreno, i965, softpipe, panfrost/if SoC supports)
GL_ARB_compressed_texture_pixel_storage DONE (all drivers)
GL_ARB_shader_atomic_counters DONE (freedreno/a5xx+, i965, softpipe, v3d, panfrost, d3d12)
GL_ARB_shader_atomic_counters DONE (freedreno/a5xx+, i965, softpipe, v3d, panfrost)
GL_ARB_texture_storage DONE (all drivers)
GL_ARB_transform_feedback_instanced DONE (freedreno, i965, nv50, softpipe, v3d)
GL_ARB_base_instance DONE (freedreno, i965, nv50, softpipe, v3d, d3d12)
GL_ARB_shader_image_load_store DONE (freedreno/a5xx+, i965, softpipe, panfrost, d3d12)
GL_ARB_base_instance DONE (freedreno, i965, nv50, softpipe, v3d)
GL_ARB_shader_image_load_store DONE (freedreno/a5xx+, i965, softpipe, panfrost)
GL_ARB_conservative_depth DONE (all drivers that support GLSL 1.30)
GL_ARB_shading_language_420pack DONE (all drivers that support GLSL 1.30)
GL_ARB_shading_language_packing DONE (all drivers)
GL_ARB_internalformat_query DONE (freedreno, i965, nv50, softpipe, v3d, vc4, panfrost, d3d12, lima)
GL_ARB_internalformat_query DONE (freedreno, i965, nv50, softpipe, v3d, vc4, panfrost, lima)
GL_ARB_map_buffer_alignment DONE (all drivers)
@@ -175,7 +175,7 @@ GL 4.3, GLSL 4.30 -- all DONE: i965/gen8+, nvc0, r600, radeonsi, llvmpipe, virgl
GL_ARB_copy_image DONE (i965, nv50, softpipe, )
GL_KHR_debug DONE (all drivers)
GL_ARB_explicit_uniform_location DONE (all drivers that support GLSL)
GL_ARB_fragment_layer_viewport DONE (i965, nv50, softpipe, )
GL_ARB_fragment_layer_viewport DONE (i965, nv50, softpipe, d3d12)
GL_ARB_framebuffer_no_attachments DONE (freedreno, i965, softpipe, v3d, d3d12)
GL_ARB_internalformat_query2 DONE (all drivers)
GL_ARB_invalidate_subdata DONE (all drivers)
@@ -300,12 +300,12 @@ Khronos, ARB, and OES extensions that are not part of any OpenGL or OpenGL ES ve
GL_ARB_compute_variable_group_size DONE (i965/gen7+, nvc0, radeonsi, zink)
GL_ARB_ES3_2_compatibility DONE (i965/gen8+, radeonsi, virgl, zink)
GL_ARB_fragment_shader_interlock DONE (i965, zink)
GL_ARB_gpu_shader_int64 DONE (i965/gen8+, nvc0, radeonsi, softpipe, llvmpipe, zink)
GL_ARB_gpu_shader_int64 DONE (i965/gen8+, nvc0, radeonsi, softpipe, llvmpipe, zink, d3d12)
GL_ARB_parallel_shader_compile DONE (freedreno, iris, radeonsi)
GL_ARB_post_depth_coverage DONE (i965, nvc0, radeonsi, llvmpipe, zink)
GL_ARB_robustness_isolation not started
GL_ARB_sample_locations DONE (nvc0, zink)
GL_ARB_seamless_cubemap_per_texture DONE (etnaviv/SEAMLESS_CUBE_MAP, freedreno, i965, nvc0, r600, radeonsi, softpipe, virgl)
GL_ARB_seamless_cubemap_per_texture DONE (etnaviv/SEAMLESS_CUBE_MAP, freedreno, i965, nvc0, r600, radeonsi, softpipe, virgl, zink)
GL_ARB_shader_ballot DONE (i965/gen8+, nvc0, radeonsi, zink)
GL_ARB_shader_clock DONE (i965/gen7+, nv50, nvc0, r600, radeonsi, virgl, zink)
GL_ARB_shader_stencil_export DONE (i965/gen9+, r600, radeonsi, softpipe, llvmpipe, virgl, panfrost, zink)
@@ -331,7 +331,7 @@ Khronos, ARB, and OES extensions that are not part of any OpenGL or OpenGL ES ve
GL_EXT_texture_norm16 DONE (freedreno, i965, r600, radeonsi, nvc0i, softpipe, zink)
GL_EXT_texture_sRGB_R8 DONE (all drivers that support GLES 3.0+)
GL_KHR_blend_equation_advanced_coherent DONE (i965/gen9+, panfrost)
GL_KHR_texture_compression_astc_hdr DONE (i965/bxt, panfrost)
GL_KHR_texture_compression_astc_hdr DONE (core only)
GL_KHR_texture_compression_astc_sliced_3d DONE (i965/gen9+, r600, radeonsi, panfrost, softpipe, zink, lima)
GL_OES_depth_texture_cube_map DONE (all drivers that support GLSL 1.30+)
GL_OES_EGL_image DONE (all drivers)
@@ -462,35 +462,35 @@ Vulkan 1.2 -- all DONE: anv, vn
VK_KHR_spirv_1_4 DONE (anv, lvp, radv, tu, vn)
VK_KHR_timeline_semaphore DONE (anv, lvp, radv, tu, vn)
VK_KHR_uniform_buffer_standard_layout DONE (anv, lvp, radv, tu, v3dv, vn)
VK_KHR_vulkan_memory_model DONE (anv, radv, tu, vn)
VK_KHR_vulkan_memory_model DONE (anv, lvp, radv, tu, vn)
VK_EXT_descriptor_indexing DONE (anv/gen9+, radv, tu, vn)
VK_EXT_host_query_reset DONE (anv, lvp, radv, tu, v3dv, vn)
VK_EXT_sampler_filter_minmax DONE (anv/gen9+, lvp, radv, tu, vn)
VK_EXT_scalar_block_layout DONE (anv, lvp, radv/gfx7+, tu, vn)
VK_EXT_separate_stencil_usage DONE (anv, lvp, tu, vn)
VK_EXT_separate_stencil_usage DONE (anv, lvp, radv, tu, vn)
VK_EXT_shader_viewport_index_layer DONE (anv, lvp, radv, tu, vn)
Vulkan 1.3 -- all DONE: anv, radv
Vulkan 1.3 -- all DONE: anv, radv, lvp
VK_KHR_copy_commands2 DONE (anv, lvp, radv, tu, v3dv)
VK_KHR_dynamic_rendering DONE (anv, lvp, radv)
VK_KHR_format_feature_flags2 DONE (anv, radv)
VK_KHR_maintenance4 DONE (anv, radv)
VK_KHR_shader_non_semantic_info DONE (anv, radv)
VK_KHR_format_feature_flags2 DONE (anv, radv, tu)
VK_KHR_maintenance4 DONE (anv, radv, tu)
VK_KHR_shader_non_semantic_info DONE (anv, radv, tu, v3dv)
VK_KHR_shader_terminate_invocation DONE (anv, radv, tu)
VK_KHR_synchronization2 DONE (anv, radv)
VK_KHR_zero_initialize_workgroup_memory DONE (anv, radv)
VK_KHR_zero_initialize_workgroup_memory DONE (anv, radv, tu)
VK_EXT_4444_formats DONE (anv, lvp, radv, tu, v3dv)
VK_EXT_extended_dynamic_state DONE (anv, lvp, radv, tu)
VK_EXT_extended_dynamic_state2 DONE (anv, lvp, radv)
VK_EXT_inline_uniform_block DONE (anv, radv)
VK_EXT_extended_dynamic_state2 DONE (anv, lvp, radv, tu)
VK_EXT_inline_uniform_block DONE (anv, radv, v3dv)
VK_EXT_pipeline_creation_cache_control DONE (anv, radv, v3dv)
VK_EXT_pipeline_creation_feedback DONE (anv, radv, v3dv)
VK_EXT_private_data DONE (anv, lvp, radv, tu, v3dv)
VK_EXT_image_robustness DONE (anv, radv)
VK_EXT_image_robustness DONE (anv, radv, tu)
VK_EXT_shader_demote_to_helper_invocation DONE (anv, radv, tu)
VK_EXT_subgroup_size_control DONE (anv, radv)
VK_EXT_texel_buffer_alignment DONE (anv, radv)
VK_EXT_subgroup_size_control DONE (anv, radv, tu)
VK_EXT_texel_buffer_alignment DONE (anv, radv, tu)
Khronos extensions that are not part of any Vulkan version:
@@ -511,9 +511,9 @@ Khronos extensions that are not part of any Vulkan version:
VK_KHR_incremental_present DONE (anv, lvp, radv, tu, v3dv, vn)
VK_KHR_performance_query DONE (anv/gen8+, tu)
VK_KHR_pipeline_executable_properties DONE (anv, radv, tu)
VK_KHR_pipeline_library in progress
VK_KHR_pipeline_library DONE (lvp, radv)
VK_KHR_push_descriptor DONE (anv, lvp, radv, tu)
VK_KHR_ray_query not started
VK_KHR_ray_query in progress
VK_KHR_ray_tracing_pipeline in progress
VK_KHR_shader_clock DONE (anv, radv)
VK_KHR_shader_integer_dot_product DONE (anv, radv, tu)
@@ -522,7 +522,7 @@ Khronos extensions that are not part of any Vulkan version:
VK_KHR_surface DONE (anv, lvp, radv, tu, v3dv, vn)
VK_KHR_surface_protected_capabilities DONE (anv, lvp, radv, v3dv, vn)
VK_KHR_swapchain DONE (anv, lvp, radv, tu, v3dv, vn)
VK_KHR_swapchain_mutable_format DONE (anv, radv, v3dv, vn)
VK_KHR_swapchain_mutable_format DONE (anv, lvp, radv, v3dv, vn)
VK_KHR_wayland_surface DONE (anv, lvp, radv, tu, v3dv, vn)
VK_KHR_workgroup_memory_explicit_layout DONE (anv, radv)
VK_KHR_win32_keyed_mutex not started
@@ -537,6 +537,7 @@ Khronos extensions that are not part of any Vulkan version:
VK_EXT_custom_border_color DONE (anv, lvp, radv, tu, v3dv)
VK_EXT_debug_marker DONE (radv)
VK_EXT_depth_clip_enable DONE (anv, lvp, radv, tu)
VK_EXT_depth_clip_control DONE (lvp, radv, tu)
VK_EXT_depth_range_unrestricted DONE (radv)
VK_EXT_discard_rectangles DONE (radv)
VK_EXT_display_control DONE (anv, tu)
@@ -546,17 +547,20 @@ Khronos extensions that are not part of any Vulkan version:
VK_EXT_fragment_shader_interlock DONE (anv/gen9+)
VK_EXT_global_priority DONE (anv, radv)
VK_EXT_global_priority_query DONE (radv)
VK_EXT_image_drm_format_modifier DONE (anv, radv/gfx9+, tu, vn)
VK_EXT_graphics_pipeline_library DONE (lvp)
VK_EXT_image_2d_view_of_3d DONE (anv, lvp)
VK_EXT_image_drm_format_modifier DONE (anv, radv/gfx9+, tu, v3dv, vn)
VK_EXT_image_view_min_lod DONE (radv)
VK_EXT_index_type_uint8 DONE (anv, lvp, radv/gfx8+, v3dv, tu)
VK_EXT_line_rasterization DONE (anv, lvp, radv, tu)
VK_EXT_line_rasterization DONE (anv, lvp, radv, tu, v3dv)
VK_EXT_memory_budget DONE (anv, radv, tu)
VK_EXT_memory_priority DONE (radv)
VK_EXT_multi_draw DONE (anv, lvp, radv)
VK_EXT_pci_bus_info DONE (anv, radv)
VK_EXT_physical_device_drm DONE (anv, radv, v3dv)
VK_EXT_physical_device_drm DONE (anv, radv, tu, v3dv)
VK_EXT_post_depth_coverage DONE (anv/gfx10+, lvp, radv/gfx10+)
VK_EXT_primitive_topology_list_restart DONE (anv, lvp, radv, tu)
VK_EXT_primitives_generated_query DONE (lvp, tu)
VK_EXT_provoking_vertex DONE (anv, lvp, radv, tu, v3dv)
VK_EXT_queue_family_foreign DONE (anv, radv, vn)
VK_EXT_robustness2 DONE (anv, radv, tu)
@@ -572,7 +576,7 @@ Khronos extensions that are not part of any Vulkan version:
VK_EXT_vertex_input_dynamic_state DONE (lvp, radv)
VK_EXT_ycbcr_image_arrays DONE (anv, radv)
VK_ANDROID_external_memory_android_hardware_buffer DONE (anv, radv, vn)
VK_ANDROID_native_buffer DONE (anv, radv, vn)
VK_ANDROID_native_buffer DONE (anv, radv, tu, v3dv, vn)
VK_GOOGLE_decorate_string DONE (anv, lvp, radv)
VK_GOOGLE_hlsl_functionality1 DONE (anv, lvp, radv)
VK_GOOGLE_user_type DONE (anv, radv)
@@ -580,7 +584,7 @@ Khronos extensions that are not part of any Vulkan version:
VK_NV_compute_shader_derivatives DONE (anv, radv)
VK_EXT_acquire_drm_display DONE (radv, anv)
VK_VALVE_mutable_descriptor_type DONE (anv, radv, tu)
VK_AMD_buffer_marker DONE (radv)
VK_AMD_buffer_marker DONE (radv, tu)
VK_AMD_device_coherent_memory DONE (radv)
VK_AMD_draw_indirect_count DONE (radv)
VK_AMD_gcn_shader DONE (radv)
@@ -595,9 +599,9 @@ Khronos extensions that are not part of any Vulkan version:
VK_AMD_shader_explicit_vertex_parameter DONE (radv)
VK_AMD_shader_fragment_mask DONE (radv)
VK_AMD_shader_image_load_store_lod DONE (radv)
VK_AMD_shader_info DONE (radv)
VK_AMD_shader_trinary_minmax DONE (radv)
VK_AMD_texture_gather_bias_lod DONE (radv)
VK_ARM_rasterization_order_attachment_access DONE (tu)
OpenCL 1.0 -- all DONE:

View File

@@ -403,7 +403,7 @@ Buffer mapping conclusions
* Buffer valid range tracking doesn't need to be fancy, "number of bytes
valid starting from 0" is sufficient for all examples found.
* Use the ``pipe_debug_callback`` to report stalls on buffer mapping to ease
* Use the ``util_debug_callback`` to report stalls on buffer mapping to ease
debug.
* Buffer binding points are not useful for tuning buffer placement (See all the

View File

@@ -64,14 +64,14 @@ The integer capabilities:
* ``PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS``: The maximum number of texture array
layers supported. If 0, the array textures are not supported at all and
the ARRAY texture targets are invalid.
* ``PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT``: Whether the TGSI property
FS_COORD_ORIGIN with value UPPER_LEFT is supported.
* ``PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT``: Whether the TGSI property
FS_COORD_ORIGIN with value LOWER_LEFT is supported.
* ``PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER``: Whether the TGSI
property FS_COORD_PIXEL_CENTER with value HALF_INTEGER is supported.
* ``PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER``: Whether the TGSI
property FS_COORD_PIXEL_CENTER with value INTEGER is supported.
* ``PIPE_CAP_FS_COORD_ORIGIN_UPPER_LEFT``: Whether the upper-left origin
fragment convention is supported.
* ``PIPE_CAP_FS_COORD_ORIGIN_LOWER_LEFT``: Whether the lower-left origin
fragment convention is supported.
* ``PIPE_CAP_FS_COORD_PIXEL_CENTER_HALF_INTEGER``: Whether the half-integer
pixel-center fragment convention is supported.
* ``PIPE_CAP_FS_COORD_PIXEL_CENTER_INTEGER``: Whether the integer
pixel-center fragment convention is supported.
* ``PIPE_CAP_DEPTH_CLIP_DISABLE``: Whether the driver is capable of disabling
depth clipping (through pipe_rasterizer_state).
* ``PIPE_CAP_DEPTH_CLIP_DISABLE_SEPARATE``: Whether the driver is capable of
@@ -83,8 +83,8 @@ The integer capabilities:
clipping. If not, depth_clamp will be the inverse of depth_clip_far.
* ``PIPE_CAP_SHADER_STENCIL_EXPORT``: Whether a stencil reference value can be
written from a fragment shader.
* ``PIPE_CAP_TGSI_INSTANCEID``: Whether TGSI_SEMANTIC_INSTANCEID is supported
in the vertex shader.
* ``PIPE_CAP_VS_INSTANCEID``: Whether ``SYSTEM_VALUE_INSTANCE_ID`` is
supported in the vertex shader.
* ``PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR``: Whether the driver supports
per-instance vertex attribs.
* ``PIPE_CAP_FRAGMENT_COLOR_CLAMPED``: Whether fragment color clamping is
@@ -206,10 +206,9 @@ The integer capabilities:
* ``PIPE_CAP_MIXED_FRAMEBUFFER_SIZES``: Whether it is allowed to have
different sizes for fb color/zs attachments. This controls whether
ARB_framebuffer_object is provided.
* ``PIPE_CAP_TGSI_VS_LAYER_VIEWPORT``: Whether ``TGSI_SEMANTIC_LAYER`` and
``TGSI_SEMANTIC_VIEWPORT_INDEX`` are supported as vertex shader
outputs. Note that the viewport will only be used if multiple viewports are
exposed.
* ``PIPE_CAP_VS_LAYER_VIEWPORT``: Whether ``VARYING_SLOT_LAYER`` and
``VARYING_SLOT_VIEWPORT`` are supported as vertex shader outputs. Note that
the viewport will only be used if multiple viewports are exposed.
* ``PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES``: The maximum number of vertices
output by a single invocation of a geometry shader.
* ``PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS``: The maximum number of
@@ -236,9 +235,8 @@ The integer capabilities:
implemented.
* ``PIPE_CAP_TEXTURE_GATHER_OFFSETS``: Whether the ``TG4`` instruction can
accept 4 offsets.
* ``PIPE_CAP_TGSI_VS_WINDOW_SPACE_POSITION``: Whether
TGSI_PROPERTY_VS_WINDOW_SPACE_POSITION is supported, which disables clipping
and viewport transformation.
* ``PIPE_CAP_VS_WINDOW_SPACE_POSITION``: Whether window-space position is
supported, which disables clipping and viewport transformation.
* ``PIPE_CAP_MAX_VERTEX_STREAMS``: The maximum number of vertex streams
supported by the geometry shader. If stream-out is supported, this should be
at least 1. If stream-out is not supported, this should be 0.
@@ -250,7 +248,7 @@ The integer capabilities:
* ``PIPE_CAP_MULTI_DRAW_INDIRECT_PARAMS``: Whether the driver supports
taking the number of indirect draws from a separate parameter
buffer, see pipe_draw_indirect_info::indirect_draw_count.
* ``PIPE_CAP_TGSI_FS_FINE_DERIVATIVE``: Whether the fragment shader supports
* ``PIPE_CAP_FS_FINE_DERIVATIVE``: Whether the fragment shader supports
the FINE versions of DDX/DDY.
* ``PIPE_CAP_VENDOR_ID``: The vendor ID of the underlying hardware. If it's
not available one should return 0xFFFFFFFF.
@@ -306,7 +304,7 @@ The integer capabilities:
* ``PIPE_CAP_DEPTH_BOUNDS_TEST``: Whether bounds_test, bounds_min, and
bounds_max states of pipe_depth_stencil_alpha_state behave according
to the GL_EXT_depth_bounds_test specification.
* ``PIPE_CAP_TGSI_TXQS``: Whether the `TXQS` opcode is supported
* ``PIPE_CAP_TEXTURE_QUERY_SAMPLES``: Whether the `TXQS` opcode is supported
* ``PIPE_CAP_FORCE_PERSAMPLE_INTERP``: If the driver can force per-sample
interpolation for all fragment shader inputs if
pipe_rasterizer_state::force_persample_interp is set. This is only used
@@ -328,13 +326,13 @@ The integer capabilities:
* ``PIPE_CAP_DRAW_PARAMETERS``: Whether ``TGSI_SEMANTIC_BASEVERTEX``,
``TGSI_SEMANTIC_BASEINSTANCE``, and ``TGSI_SEMANTIC_DRAWID`` are
supported in vertex shaders.
* ``PIPE_CAP_TGSI_PACK_HALF_FLOAT``: Whether the ``UP2H`` and ``PK2H``
TGSI opcodes are supported.
* ``PIPE_CAP_TGSI_FS_POSITION_IS_SYSVAL``: If gallium frontends should use
a system value for the POSITION fragment shader input.
* ``PIPE_CAP_TGSI_FS_POINT_IS_SYSVAL``: If gallium frontends should use
a system value for the POINT fragment shader input.
* ``PIPE_CAP_TGSI_FS_FACE_IS_INTEGER_SYSVAL``: If gallium frontends should use
* ``PIPE_CAP_SHADER_PACK_HALF_FLOAT``: Whether packed 16-bit float
packing/unpacking opcodes are supported.
* ``PIPE_CAP_FS_POSITION_IS_SYSVAL``: If gallium frontends should use a
system value for the POSITION fragment shader input.
* ``PIPE_CAP_FS_POINT_IS_SYSVAL``: If gallium frontends should use a system
value for the POINT fragment shader input.
* ``PIPE_CAP_FS_FACE_IS_INTEGER_SYSVAL``: If gallium frontends should use
a system value for the FACE fragment shader input.
Also, the FACE system value is integer, not float.
* ``PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT``: Describes the required
@@ -374,9 +372,13 @@ The integer capabilities:
and accesses to unbound resources.
* ``PIPE_CAP_CULL_DISTANCE``: Whether the driver supports the arb_cull_distance
extension and thus implements proper support for culling planes.
* ``PIPE_CAP_CULL_DISTANCE_NOCOMBINE``: Whether the driver wants to skip
running the `nir_lower_clip_cull_distance_arrays` pass in order to get
VARYING_SLOT_CULL_DIST0 slot variables.
* ``PIPE_CAP_PRIMITIVE_RESTART_FOR_PATCHES``: Whether primitive restart is
supported for patch primitives.
* ``PIPE_CAP_TGSI_VOTE``: Whether the ``VOTE_*`` ops can be used in shaders.
* ``PIPE_CAP_SHADER_GROUP_VOTE``: Whether the ``VOTE_*`` ops can be used in
shaders.
* ``PIPE_CAP_MAX_WINDOW_RECTANGLES``: The maxium number of window rectangles
supported in ``set_window_rectangles``.
* ``PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED``: If true, the driver implements support
@@ -391,7 +393,7 @@ The integer capabilities:
32-bit. If set to off, that means that a B5G6R5 + Z24 or RGBA8 + Z16
combination will require a driver fallback, and should not be
advertised in the GLX/EGL config list.
* ``PIPE_CAP_TGSI_ARRAY_COMPONENTS``: If true, the driver interprets the
* ``PIPE_CAP_SHADER_ARRAY_COMPONENTS``: If true, the driver interprets the
UsageMask of input and output declarations and allows declaring arrays
in overlapping ranges. The components must be a contiguous range, e.g. a
UsageMask of xy or yzw is allowed, but xz or yw isn't. Declarations with
@@ -406,7 +408,7 @@ The integer capabilities:
* ``PIPE_CAP_STREAM_OUTPUT_INTERLEAVE_BUFFERS``: Whether interleaved stream
output mode is able to interleave across buffers. This is required for
ARB_transform_feedback3.
* ``PIPE_CAP_TGSI_CAN_READ_OUTPUTS``: Whether every TGSI shader stage can read
* ``PIPE_CAP_SHADER_CAN_READ_OUTPUTS``: Whether every TGSI shader stage can read
from the output file.
* ``PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY``: Tell the GLSL compiler to use
the minimum amount of optimizations just to be able to do all the linking
@@ -426,7 +428,7 @@ The integer capabilities:
operations are supported.
* ``PIPE_CAP_TGSI_TEX_TXF_LZ``: Whether TEX_LZ and TXF_LZ opcodes are
supported.
* ``PIPE_CAP_TGSI_CLOCK``: Whether the CLOCK opcode is supported.
* ``PIPE_CAP_SHADER_CLOCK``: Whether the CLOCK opcode is supported.
* ``PIPE_CAP_POLYGON_MODE_FILL_RECTANGLE``: Whether the
PIPE_POLYGON_MODE_FILL_RECTANGLE mode is supported for
``pipe_rasterizer_state::fill_front`` and
@@ -434,10 +436,10 @@ The integer capabilities:
* ``PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE``: The page size of sparse buffers in
bytes, or 0 if sparse buffers are not supported. The page size must be at
most 64KB.
* ``PIPE_CAP_TGSI_BALLOT``: Whether the BALLOT and READ_* opcodes as well as
* ``PIPE_CAP_SHADER_BALLOT``: Whether the BALLOT and READ_* opcodes as well as
the SUBGROUP_* semantics are supported.
* ``PIPE_CAP_TGSI_TES_LAYER_VIEWPORT``: Whether ``TGSI_SEMANTIC_LAYER`` and
``TGSI_SEMANTIC_VIEWPORT_INDEX`` are supported as tessellation evaluation
* ``PIPE_CAP_TES_LAYER_VIEWPORT``: Whether ``VARYING_SLOT_LAYER`` and
``VARYING_SLOT_VIEWPORT`` are supported as tessellation evaluation
shader outputs.
* ``PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX``: Whether a buffer with just
PIPE_BIND_CONSTANT_BUFFER can be legally passed to set_vertex_buffers.
@@ -533,8 +535,8 @@ The integer capabilities:
* ``PIPE_CAP_SURFACE_SAMPLE_COUNT``: Whether the driver
supports pipe_surface overrides of resource nr_samples. If set, will
enable EXT_multisampled_render_to_texture.
* ``PIPE_CAP_TGSI_ATOMFADD``: Atomic floating point adds are supported on
images, buffers, and shared memory.
* ``PIPE_CAP_IMAGE_ATOMIC_FLOAT_ADD``: Atomic floating point adds are
supported on images, buffers, and shared memory.
* ``PIPE_CAP_RGB_OVERRIDE_DST_ALPHA_BLEND``: True if the driver needs blend state to use zero/one instead of destination alpha for RGB/XRGB formats.
* ``PIPE_CAP_GLSL_TESS_LEVELS_AS_INPUTS``: True if the driver wants TESSINNER and TESSOUTER to be inputs (rather than system values) for tessellation evaluation shaders.
* ``PIPE_CAP_DEST_SURFACE_SRGB_CONTROL``: Indicates whether the drivers
@@ -577,7 +579,8 @@ The integer capabilities:
* ``PIPE_CAP_TEXTURE_SHADOW_LOD``: True if the driver supports shadow sampler
types with texture functions having interaction with LOD of texture lookup.
* ``PIPE_CAP_SHADER_SAMPLES_IDENTICAL``: True if the driver supports a shader query to tell whether all samples of a multisampled surface are definitely identical.
* ``PIPE_CAP_TGSI_ATOMINC_WRAP``: Atomic increment/decrement + wrap around are supported.
* ``PIPE_CAP_IMAGE_ATOMIC_INC_WRAP``: Atomic increment/decrement + wrap around
are supported.
* ``PIPE_CAP_PREFER_IMM_ARRAYS_AS_CONSTBUF``: True if gallium frontends should
turn arrays whose contents can be deduced at compile time into constant
buffer loads, or false if the driver can handle such arrays itself in a more

View File

@@ -377,7 +377,7 @@ This instruction replicates its result.
.. opcode:: DDX, DDX_FINE - Derivative Relative To X
The fine variant is only used when ``PIPE_CAP_TGSI_FS_FINE_DERIVATIVE`` is
The fine variant is only used when ``PIPE_CAP_FS_FINE_DERIVATIVE`` is
advertised. When it is, the fine version guarantees one derivative per row
while DDX is allowed to be the same for the entire 2x2 quad.
@@ -394,7 +394,7 @@ while DDX is allowed to be the same for the entire 2x2 quad.
.. opcode:: DDY, DDY_FINE - Derivative Relative To Y
The fine variant is only used when ``PIPE_CAP_TGSI_FS_FINE_DERIVATIVE`` is
The fine variant is only used when ``PIPE_CAP_FS_FINE_DERIVATIVE`` is
advertised. When it is, the fine version guarantees one derivative per column
while DDY is allowed to be the same for the entire 2x2 quad.
@@ -3249,7 +3249,7 @@ For geometry shaders, this semantic label indicates that an output
contains the index of the viewport (and scissor) to use.
This is an integer value, and only the X component is used.
If PIPE_CAP_TGSI_VS_LAYER_VIEWPORT or PIPE_CAP_TGSI_TES_LAYER_VIEWPORT is
If PIPE_CAP_VS_LAYER_VIEWPORT or PIPE_CAP_TES_LAYER_VIEWPORT is
supported, then this semantic label can also be used in vertex or
tessellation evaluation shaders, respectively. Only the value written in the
last vertex processing stage is used.
@@ -3263,7 +3263,7 @@ contains the layer value to use for the color and depth/stencil surfaces.
This is an integer value, and only the X component is used.
(Also known as rendertarget array index.)
If PIPE_CAP_TGSI_VS_LAYER_VIEWPORT or PIPE_CAP_TGSI_TES_LAYER_VIEWPORT is
If PIPE_CAP_VS_LAYER_VIEWPORT or PIPE_CAP_TES_LAYER_VIEWPORT is
supported, then this semantic label can also be used in vertex or
tessellation evaluation shaders, respectively. Only the value written in the
last vertex processing stage is used.

View File

@@ -89,10 +89,12 @@ Linux, FreeBSD, and other operating systems.
drivers/lima
drivers/llvmpipe
drivers/panfrost
drivers/radv
drivers/svga3d
drivers/v3d
drivers/vc4
drivers/venus
drivers/virgl
drivers/zink
.. toctree::
@@ -111,6 +113,7 @@ Linux, FreeBSD, and other operating systems.
release-calendar
dispatch
gallium/index
vulkan/index
nir/index
isl/index
android

View File

@@ -5,7 +5,7 @@ Mesa builds on macOS without modifications. However, there are some details to
be aware of.
- Mesa has a number of build-time dependencies. Most dependencies, including
Meson itself, are available in `homebrew <https://brew.sh>`, which has a
Meson itself, are available in `homebrew <https://brew.sh>`_, which has a
Mesa package for reference. The exception seems to be Mako, a Python module
used for templating, which you can install as `pip3 install mako`.
- macOS is picky about its build-time environment. Type `brew sh` before
@@ -16,7 +16,7 @@ hardware-accelerated system OpenGL framework, to provide hardware acceleration
to X11 applications on macOS running via XQuartz.
Mesa's software rasterizers also work on macOS. To build, set the build options
`-Dosmesa=true -Dglx=xlib` and select an appropriate Gallium software
``-Dosmesa=true -Dglx=xlib`` and select an appropriate Gallium software
rasterizer.
For native hardware, stay tuned for updates here!

View File

@@ -1,7 +1,6 @@
21.3,2022-02-09,21.3.6,Eric Engestrom,
,2022-02-23,21.3.7,Eric Engestrom,
,2022-03-09,21.3.8,Eric Engestrom,Last planned 21.3.x release.
22.0,2022-02-02,22.0.0-rc1,Dylan Baker
,2022-02-09,22.0.0-rc2,Dylan Baker
,2022-02-16,22.0.0-rc3,Dylan Baker
,2022-02-22,22.0.0-rc4,Dylan Baker,Or 22.0.0 final.
22.0,2022-04-06,22.0.2,Dylan Baker
,2022-04-20,22.0.3,Dylan Baker,This is the last planned release of the 22.0.x series.
22.1,2022-04-13,22.1.0-rc1,Dylan Baker
,2022-04-20,22.1.0-rc2,Dylan Baker
,2022-04-27,22.1.0-rc3,Dylan Baker
,2022-05-04,22.1.0-rc4,Dylan Baker,Or 22.1.0 final.
1 21.3,2022-02-09,21.3.6,Eric Engestrom, 22.0,2022-04-06,22.0.2,Dylan Baker
2 ,2022-02-23,21.3.7,Eric Engestrom, ,2022-04-20,22.0.3,Dylan Baker,This is the last planned release of the 22.0.x series.
3 ,2022-03-09,21.3.8,Eric Engestrom,Last planned 21.3.x release. 22.1,2022-04-13,22.1.0-rc1,Dylan Baker
4 22.0,2022-02-02,22.0.0-rc1,Dylan Baker ,2022-04-20,22.1.0-rc2,Dylan Baker
5 ,2022-02-09,22.0.0-rc2,Dylan Baker ,2022-04-27,22.1.0-rc3,Dylan Baker
6 ,2022-02-16,22.0.0-rc3,Dylan Baker ,2022-05-04,22.1.0-rc4,Dylan Baker,Or 22.1.0 final.
,2022-02-22,22.0.0-rc4,Dylan Baker,Or 22.0.0 final.

View File

@@ -275,8 +275,8 @@ Increment the version contained in the file ``VERSION`` at Mesa's top-level,
then commit this change and **push the branch** (if you forget to do
this, ``release.sh`` below will fail).
Use the release.sh script from xorg `util-modular <https://cgit.freedesktop.org/xorg/util/modular/>`__
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the release.sh script from xorg `util-modular <https://gitlab.freedesktop.org/xorg/util/modular>`__
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Start the release process.

View File

@@ -3,6 +3,11 @@ Release Notes
The release notes summarize what's new or changed in each Mesa release.
- :doc:`22.0.1 release notes <relnotes/22.0.1>`
- :doc:`21.3.8 release notes <relnotes/21.3.8>`
- :doc:`22.0.0 release notes <relnotes/22.0.0>`
- :doc:`21.3.7 release notes <relnotes/21.3.7>`
- :doc:`21.3.6 release notes <relnotes/21.3.6>`
- :doc:`21.3.5 release notes <relnotes/21.3.5>`
- :doc:`21.3.4 release notes <relnotes/21.3.4>`
- :doc:`21.3.3 release notes <relnotes/21.3.3>`
@@ -354,6 +359,11 @@ release notes, or in the `old docs`_.
:maxdepth: 1
:hidden:
relnotes/22.0.1
relnotes/21.3.8
relnotes/22.0.0
relnotes/21.3.7
relnotes/21.3.6
relnotes/21.3.5
relnotes/21.3.4
relnotes/21.3.3

149
docs/relnotes/21.3.6.rst Normal file
View File

@@ -0,0 +1,149 @@
Mesa 21.3.6 Release Notes / 2022-02-09
======================================
Mesa 21.3.6 is a bug fix release which fixes bugs found since the 21.3.5 release.
Mesa 21.3.6 implements the OpenGL 4.6 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 4.6. OpenGL
4.6 is **only** available if requested at context creation.
Compatibility contexts may report a lower version depending on each driver.
Mesa 21.3.6 implements the Vulkan 1.2 API, but the version reported by
the apiVersion property of the VkPhysicalDeviceProperties struct
depends on the particular driver being used.
SHA256 checksum
---------------
::
96bb761fd546e9aa41d025fcc025225c5668443839dae21e3731959beb096736 mesa-21.3.6.tar.xz
New features
------------
- None
Bug fixes
---------
- radv: CullDistance fail
- i965: Segmentation fault during glinfo context destruction, regression in 21.3.x
- Vulkan Wayland WSI returns empty surface formats
- [REGRESSION][BISECTED] iris: Qutebrowser/QtWebEngine sporadically flashes the window in white
- Flickering Intel Uhd 620 Graphics
- Broken Terraria & Glitches in Forza Horizon 4
Changes
-------
Bas Nieuwenhuizen (1):
- Revert "nir/algebraic: distribute fmul(fadd(a, b), c) when b and c are constants"
Caio Oliveira (1):
- anv: Fix subgroupSupportedStages physical property
Charles Baker (1):
- Revert "zink: handle vertex buffer offset overflows"
Connor Abbott (2):
- ir3: Fix copy-paste mistakes in ir3_block_remove_physical_predecessor()
- ir3/cp: ir3: Prevent propagating shared regs out of loops harder
Danylo Piliaiev (1):
- ir3: opt_deref in opt loop to remove unnecessary tex casts
Dave Airlie (1):
- crocus: find correct relocation target for the bo.
Emma Anholt (1):
- vulkan: Fix leak of error messages
Eric Engestrom (3):
- .pick_status.json: Update to cb781fc350108584116280fc597c695d2f476c68
- .pick_status.json: Mark 15e77504461a30038a054c87cc53a694171c9cf4 as denominated
- .pick_status.json: Mark 960e72417f3e8885699cf384f690853e14ba44da as denominated
Francisco Jerez (1):
- intel/fs: Take into account region strides during SIMD lowering decision of SHUFFLE.
Georg Lehmann (4):
- vulkan/wsi/wayland: Fix add_wl_shm_format alpha/opaqueness.
- vulkan/wsi/wayland: Convert missing vulkan formats to shm formats.
- vulkan/wsi/wayland: Add modifiers for RGB formats.
- vulkan/wsi/wayland: Fix add_drm_format_modifier aplha/opaqueness.
Jason Ekstrand (2):
- anv/pass: Don't set first_subpass_layout for stencil-only attachments
- vulkan/wsi: Set MUTABLE_FORMAT_BIT in the prime path
Kenneth Graunke (1):
- i965: Avoid NULL drawbuffer in brw_flush_front
Lionel Landwerlin (2):
- intel/fs: don't set allow_sample_mask for CS intrinsics
- intel/nir: fix shader call lowering
Manas Chaudhary (1):
- panvk: Fix pointer corruption in panvk_add_wait_event_syncobjs
Mike Blumenkrantz (15):
- zink: never use SpvOpImageQuerySizeLod for texel buffers
- zink: reorder fbfetch flag-setting to avoid null deref
- zink: fix vertex buffer mask computation for null buffers
- zink: clamp tbo creation to maxTexelBufferElements
- zink: add vertex shader pipeline bit for generated barrier construction
- zink: fix waiting on current batch id
- zink: cast image atomic op params/results based on image type
- zink: use SpvScopeDevice over SpvScopeWorkgroup for atomic shader ops
- zink: disable PIPE_SHADER_CAP_FP16_CONST_BUFFERS
- llvmpipe: disable PIPE_SHADER_CAP_FP16_CONST_BUFFERS
- llvmpipe: ci updates
- zink: add VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT for query binds
- zink: fix PIPE_CAP_TGSI_BALLOT export conditional
- zink: reject invalid draws
- zink: min/max blit region in coverage functions
Nanley Chery (3):
- anv: Disable CCS_E for some 8/16bpp copies on TGL+
- anv: Use ANV_FAST_CLEAR_DEFAULT_VALUE for CCS on TGL+
- anv: Re-enable CCS_E on TGL+
Paulo Zanoni (1):
- iris: implement inter-context busy-tracking
Rhys Perry (3):
- aco: fix neg(abs(mul(a, b))) if the mul is not VOP3
- aco: don't encode src2 for v_writelane_b32_e64
- radv: fix R_02881C_PA_CL_VS_OUT_CNTL with mixed cull/clip distances
Samuel Pitoiset (1):
- radv/winsys: fix missing buffer_make_resident() for the null winsys
Yiwei Zhang (1):
- tu: VkExternalImageFormatProperties is optional

148
docs/relnotes/21.3.7.rst Normal file
View File

@@ -0,0 +1,148 @@
Mesa 21.3.7 Release Notes / 2022-02-23
======================================
Mesa 21.3.7 is a bug fix release which fixes bugs found since the 21.3.6 release.
Mesa 21.3.7 implements the OpenGL 4.6 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 4.6. OpenGL
4.6 is **only** available if requested at context creation.
Compatibility contexts may report a lower version depending on each driver.
Mesa 21.3.7 implements the Vulkan 1.2 API, but the version reported by
the apiVersion property of the VkPhysicalDeviceProperties struct
depends on the particular driver being used.
SHA256 checksum
---------------
::
b4fa9db7aa61bf209ef0b40bef83080999d86ad98df8b8b4fada7c128a1efc3d mesa-21.3.7.tar.xz
New features
------------
- None
Bug fixes
---------
- lavapipe: dEQP-VK.spirv_assembly.instruction.compute.float16.arithmetic_3.step fails
- ANV: Bad output from TransformFeedback . Regression from Mesa 21. Something to do with VB+XFB -> VB+XFB dependency?
Changes
-------
Alyssa Rosenzweig (4):
- pan/bi: Avoid \*FADD.v2f16 hazard in optimizer
- pan/bi: Avoid \*FADD.v2f16 hazard in scheduler
- pan/bi: Lower swizzles on CSEL.i32/MUX.i32
- panvk: Use more reliable assert for UBO pushing
Bas Nieuwenhuizen (1):
- radv: Fix preamble argument order.
Connor Abbott (1):
- ir3/spill: Fix simplify_phi_nodes with multiple loop nesting
Dave Airlie (3):
- lavapipe: fix sampler + sampler view leaks.
- lavapipe: reference gallium fences correctly.
- crocus: fix leak on gen4/5 stencil fallback blit path.
Emma Anholt (1):
- i915g: Initialize the rest of the "from_nir" temporary VS struct.
Eric Engestrom (2):
- .pick_status.json: Update to dabba7d7263be6ffb6f3676465e92c65952fa824
- .pick_status.json: Mark b07372312d7053f2ef5c858ceb1fbf9ade5e7c52 as denominated
Ian Romanick (9):
- gallivm/nir: Call nir_lower_bool_to_int32 after nir_opt_algebraic_late
- nir: All set-on-comparison opcodes can take all float types
- intel/fs: Don't optimize out 1.0*x and -1.0*x
- spriv: Produce correct result for GLSLstd450Step with NaN
- spirv: Produce correct result for GLSLstd450Modf with Inf
- spirv: Produce correct result for GLSLstd450Tanh with NaN
- nir: Properly handle various exceptional values in frexp
- nir: Produce correct results for atan with NaN
- nir: Add missing dependency on nir_opcodes.py
Jason Ekstrand (1):
- anv: Call vk_command_buffer_finish if create fails
Jonathan Gray (1):
- dri: avoid NULL deref of DrawBuffer on flush
Lionel Landwerlin (2):
- nir: fix lower_memcpy
- anv/genxml/intel/fs: fix binding shader record entry
Marcin Ślusarz (1):
- anv: don't set color state when input state was requested
Marek Olšák (1):
- ac/surface: add more elements to meta equations because HTILE can use them
Mike Blumenkrantz (4):
- lavapipe: use util_pack_color_union() for generating clear colors
- aux/draw: fix llvm tcs lane vec generation
- zink: always set VkPipelineMultisampleStateCreateInfo::pSampleMask
- zink: always invalidate streamout counter buffer if not resuming
Nanley Chery (1):
- iris: Don't fast clear with the view format
Pavel Ondračka (1):
- r300: fix transformation of abs modifiers with negate
Qiang Yu (3):
- radeonsi: workaround Specviewperf13 Catia hang on GFX9
- radeonsi: fix depth stencil multi sample texture blit
- glx: fix pbuffer refcount init
Samuel Pitoiset (1):
- radv/winsys: fix initializing debug/perftest options if multiple instances
Tapani Pälli (5):
- intel/genxml: add PIPE_CONTROL field for L3 read only cache invalidation
- anv: invalidate L3 read only cache when VF cache is invalidated
- iris: invalidate L3 read only cache when VF cache is invalidated
- iris: fix a leak on surface states
- mesa/st: always use DXT5 when transcoding ASTC format
Thierry Reding (2):
- tegra: Use private reference count for sampler views
- tegra: Use private reference count for resources
Timur Kristóf (1):
- radv: Disable IB2 on compute queues.
Yiwei Zhang (1):
- venus: properly destroy deferred ahb image before real image creation

183
docs/relnotes/21.3.8.rst Normal file
View File

@@ -0,0 +1,183 @@
Mesa 21.3.8 Release Notes / 2022-03-18
======================================
Mesa 21.3.8 is a bug fix release which fixes bugs found since the 21.3.7 release.
Mesa 21.3.8 implements the OpenGL 4.6 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 4.6. OpenGL
4.6 is **only** available if requested at context creation.
Compatibility contexts may report a lower version depending on each driver.
Mesa 21.3.8 implements the Vulkan 1.2 API, but the version reported by
the apiVersion property of the VkPhysicalDeviceProperties struct
depends on the particular driver being used.
SHA256 checksum
---------------
::
e70d273bdc53a4e931871bb5550ba3900e6a3deab2fff64184107c33e92d9da7 mesa-21.3.8.tar.xz
New features
------------
- None
Bug fixes
---------
- freedreno: deqp cts fails
- radeonsi dEQP-GLES3.functional.buffer.map.write.explicit_flush.* flake crashes
- Square Artifacts Dragons Dogma
- radv: When using VS+PS only, primitive ID is mixed up after NGG culling
- Redraw freeze after upgrade to Xwayland 21.1.3
- anv doesn't always resolve aux buffers with private bindings on transition to external queue
- [ANV] Rendering corruption in DOOM Eternal
Changes
-------
Adam Jackson (1):
- meson: Add "amber" option for automatic LTS build configuration
Alyssa Rosenzweig (6):
- panfrost: Fix FD resource_get_handle
- panfrost: Handle NULL sampler views
- panfrost: Handle NULL samplers
- panfrost: Flush resources when shadowing
- panfrost: Push twice as many uniforms
- panfrost: Fix set_sampler_views for big GL
Connor Abbott (4):
- ir3: Don't always set bindless_tex with readonly images
- ir3/nir: Fix 1d array readonly images
- ir3/ra: Sanitize parallel copy flags better
- util/bitset: Fix off-by-one in __bitset_set_range
Danylo Piliaiev (1):
- turnip: Use LATE_Z when there might be depth/stencil feedback loop
Dave Airlie (5):
- draw/so: don't use pre clip pos if we have a tes either.
- crocus: change the line width workaround for gfx4/5
- gallivm/nir: extract a valid texture index according to exec_mask.
- zink: workaround depth texture mode alpha.
- lavapipe: remove broken workaround for zink depth texturing.
Eric Engestrom (14):
- .pick_status.json: Update to 2106c3bab6bdea736c468fb1866fd0f372cc0baa
- .pick_status.json: Mark 7ec0e2b89351e6e56cb112e00e6c68c6bbc6faea as denominated
- .pick_status.json: Mark 0136545d169adb75e4f9f6b4de38eef0817c1241 as denominated
- .pick_status.json: Mark 62b8daa889daefb2f191a63f370541bf2b807e88 as denominated
- .pick_status.json: Mark 698ae34844b7199b8acc3b4d74a9cad3b903bdef as denominated
- .pick_status.json: Mark 03a80490a47b0b616566c6f56581560694976b1a as denominated
- .pick_status.json: Mark e1964e1dde7bf44ceeaf3fa8b3869e791af4a369 as denominated
- .pick_status.json: Mark 3ef093f697ad9027ba514c7a4a6a10b7bd95bd47 as denominated
- .pick_status.json: Mark 2d1b506acfe55165511a2bb83acb013353e531ab as denominated
- .pick_status.json: Mark 204ea77b0674fb611155bd3ba2e6169cc8646b3f as denominated
- .pick_status.json: Mark a5c7d34fdf8403b0115d5eead7ca67027e93efc7 as denominated
- .pick_status.json: Mark 432700fc61a33e0c040d47d9b7bd8cfe970d35cc as denominated
- .pick_status.json: Mark 4ed7329236a576b6b6f615787bb722b960f32c6b as denominated
- .pick_status.json: Mark 3f7da0c58447979976eb2928625b1f93154f6c57 as denominated
Erik Faye-Lund (2):
- docs: remove incorrect drivers from extension
- docs: fixup zink gl 4.3 requirements
Icecream95 (6):
- panfrost: Set PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION
- pan/bi: Check dependencies of both destinations of instructions
- panfrost: Set dirty state in set_shader_buffers
- panfrost: Re-emit descriptors after resource shadowing
- pan/bi: Make disassembler build reproducibly
- panfrost: Fix ubo_mask calculation
Jason Ekstrand (2):
- anv: Don't assume depth/stencil attachments have depth
- lavapipe: Reset the free_cmd_buffers list in TrimCommandPool
Jonathan Gray (6):
- util: unbreak non-linux mips64 build
- util: fix util_cpu_detect_once() build on OpenBSD
- util/u_atomic: fix build on clang archs without 64-bit atomics
- util: fix build with clang 10 on mips64
- util: use correct type in sysctl argument
- radv: use MAJOR_IN_SYSMACROS for sysmacros.h include
Lionel Landwerlin (3):
- anv: fix conditional render for vkCmdDrawIndirectByteCountEXT
- anv: fix fast clear type value with external images
- intel/fs: fix total_scratch computation
Marek Olšák (2):
- amd: add a workaround for an SQ perf counter bug
- radeonsi: fix an assertion failure with register shadowing
Mike Blumenkrantz (16):
- gallivm: avoid division by zero when computing cube face
- zink: always update shader variants when rebinding a gfx program
- zink: use a fence for pipeline cache update jobs
- zink: wait on program cache fences before destroying programs
- zink: fix descriptor cache pointer array allocation
- zink: mark fbfetch push sets as non-cached
- zink: stop leaking descriptor sets
- zink: invalidate non-punted recycled descriptor sets that are not valid
- zink: fix 64bit float shader ops
- llvmpipe: fix debug print iterating in set_framebuffer_state
- llvmpipe: clamp surface clear geometry
- lavapipe: update multisample state after blend state
- aux/trace: rzalloc the context struct
- zink: lower dmod on AMD hardware
- lavapipe: skip format checks for EXTENDED_USAGE
- lavapipe: run nir_opt_copy_prop_vars during optimization loop
Paulo Zanoni (1):
- iris: fix register spilling on compute shaders on XeHP
Pierre-Eric Pelloux-Prayer (3):
- radeonsi: change rounding mode to round to even
- util/slab: add slab_zalloc
- gallium/tc: zero alloc transfers
Rhys Perry (2):
- anv: Enable nir_opt_access
- radv: include adjust_frag_coord_z in key
Rob Clark (1):
- mesa: Fix discard_framebuffer for fbo vs winsys
Samuel Pitoiset (2):
- radv,drirc: move RADV workarounds to 00-radv-defaults.conf
- radv: disable DCC for Fable Anniversary, Dragons Dogma, GTA IV and more
Timur Kristóf (1):
- ac/nir/ngg: Fix mixed up primitive ID after culling.
Xiaohui Gu (1):
- iris: Mark a dirty update when vs_needs_sgvs_element value changed

4381
docs/relnotes/22.0.0.rst Normal file

File diff suppressed because it is too large Load Diff

168
docs/relnotes/22.0.1.rst Normal file
View File

@@ -0,0 +1,168 @@
Mesa 22.0.1 Release Notes / 2022-03-29
======================================
Mesa 22.0.1 is a bug fix release which fixes bugs found since the 22.0.0 release.
Mesa 22.0.1 implements the OpenGL 4.6 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 4.6. OpenGL
4.6 is **only** available if requested at context creation.
Compatibility contexts may report a lower version depending on each driver.
Mesa 22.0.1 implements the Vulkan 1.2 API, but the version reported by
the apiVersion property of the VkPhysicalDeviceProperties struct
depends on the particular driver being used.
SHA256 checksum
---------------
::
c05f9682c54560b36e0afa70896233fc73f1ed715e10d1a028b0eb84fd04426f mesa-22.0.1.tar.xz
New features
------------
- None
Bug fixes
---------
- freedreno: crash in PUBG
- [regression][bisected] MSVC: Build failure in libmesa_util when targeting x86 32-bit
- A crash in radeonsi driver
- freedreno: deqp cts fails
Changes
-------
Alyssa Rosenzweig (4):
- panfrost: Emulate GL_CLAMP on Bifrost
- pan/bi: Handle non-2D arrays
- panfrost: Fix primitive restart with 32-bit indices
- pan/bi: Don't analyze helper reqs in !frag shaders
Anuj Phogat (1):
- anv, iris: Add Wa_16011411144 for DG2
Connor Abbott (3):
- ir3/ra: Sanitize parallel copy flags better
- util/bitset: Fix off-by-one in __bitset_set_range
- ir3/lower_spill: Fix corner case with oob offsets
Dave Airlie (3):
- zink: workaround depth texture mode alpha.
- lavapipe: remove broken workaround for zink depth texturing.
- crocus: don't map scanout buffers as write-back
Dylan Baker (17):
- docs: add release notes for 22.0.0
- .pick_status.json: Update to cc4f0e804e6feee17a657d052f4f2ee32ebe53d0
- ci: Fixup some lvp expected passes
- .pick_status.json: Update to d5870c45ae82c091e72f1258920aa54974e19a36
- .pick_status.json: Update to dc247e5d4319b644e373534495cc75f41bc7bcd2
- .pick_status.json: Mark dd9b8881e0ad84ab1e74d972a8233f5c03e7b37a as denominated
- .pick_status.json: Mark 5dbbc0f0a824e4addffeb115631a9c5bcb426c29 as denominated
- .pick_status.json: Update to acbb0d86f71c950e29df70e357ae08e5ca903a49
- .pick_status.json: Update
- pick/ui: Fix mypy issue
- pick/core: drop the main_sha field
- pick/core: Add proper type annotation for update_commits callback
- pick/core: Add a method for updating commits
- pick/core: Add a MANUAL_RESOLUTION resolution
- pick/ui: correctly handle MANUAL_RESOLUTION
- core: don't pass the ui back into commit.apply
- .pick_status.json: Update to 8991e646411b73c1e03278267c80758e921f2352
Erik Faye-Lund (1):
- docs: fixup zink gl 4.3 requirements
Gert Wollny (1):
- virgl: Fix texture transfers by using a staging resource
Icecream95 (1):
- panfrost: Don't initialise the trampolines array
Jason Ekstrand (3):
- lavapipe: Reset the free_cmd_buffers list in TrimCommandPool
- anv: Allow MSAA resolve with different numbers of planes
- spirv: Properly mangle generic pointers
Jonathan Gray (1):
- util: fix msvc build
Kenneth Graunke (1):
- iris: Fix MOCS for copy regions
Lionel Landwerlin (2):
- anv: emit timestamp & availability using the same part of CS
- anv: flush tile cache with query copy command
Marek Olšák (1):
- amd: add support for gfx1036 and gfx1037 chips
Mike Blumenkrantz (23):
- llvmpipe: fix debug print iterating in set_framebuffer_state
- lavapipe: clamp clear attachments rects
- llvmpipe: clamp surface clear geometry
- zink: map R8G8B8X8_SRGB -> R8G8B8A8_SRGB
- lavapipe: update multisample state after blend state
- lavapipe: fix pipeline creation for blend and zs states
- aux/trace: rzalloc the context struct
- zink: lower dmod on AMD hardware
- zink: use 64bit mask for xfb analysis
- zink: store the correct number of components for xfb packing outputs
- zink: correctly set xfb packed output offsets
- lavapipe: use the correct value for dynamic render resolve attachment indexing
- lavapipe: skip format checks for EXTENDED_USAGE
- lavapipe: run nir_opt_copy_prop_vars during optimization loop
- anv: fix xfb usage with rasterizer discard
- anv: fix CmdSetColorWriteEnableEXT for maximum rts
- anv: fix some dynamic rasterization discard cases in pipeline construction
- lavapipe: always clone shader nir for shader states
- gallivm: fix oob image detection for cube/1dArray/2dArray/cubeArray
- llvmpipe: fix occlusion queries with early depth test
- zink: force-add usage when adding last-ref tracking
- zink: only update usage on buffer rebind if rebinds occurred
- nir/lower_is_helper_invocation: create load_helper_invocation instr with bitsize=1
Pierre-Eric Pelloux-Prayer (2):
- util/slab: add slab_zalloc
- radeonsi: don't clear framebuffer.state before dcc decomp
Rob Clark (2):
- mesa: Fix discard_framebuffer for fbo vs winsys
- freedreno/ir3: Don't try re-swapping cat3 srcs
Sagar Ghuge (2):
- intel/fs: Add Wa_22013689345
- intel/fs: Add Wa_14014435656
Samuel Pitoiset (1):
- radv: add reference counting for descriptor set layouts
Stefan Dirsch (1):
- meson: restore private requires to libdrm in dri.pc file

3554
docs/relnotes/22.1.0.rst Normal file

File diff suppressed because it is too large Load Diff

168
docs/relnotes/22.1.1.rst Normal file
View File

@@ -0,0 +1,168 @@
Mesa 22.1.1 Release Notes / 2022-06-01
======================================
Mesa 22.1.1 is a bug fix release which fixes bugs found since the 22.1.0 release.
Mesa 22.1.1 implements the OpenGL 4.6 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 4.6. OpenGL
4.6 is **only** available if requested at context creation.
Compatibility contexts may report a lower version depending on each driver.
Mesa 22.1.1 implements the Vulkan 1.2 API, but the version reported by
the apiVersion property of the VkPhysicalDeviceProperties struct
depends on the particular driver being used.
SHA256 checksum
---------------
::
46940865ffe794db73ac2bc7ab7ff2570042a0b61a8ac43ca1688863e2bc0ef1 mesa-22.1.1.tar.xz
New features
------------
- None
Bug fixes
---------
- nir_lower_phis_to_regs_block: Assertion \`src->src.is_ssa' failed.
- Build failure on sparc
- Signal 6 (Aborted) when opening GTK3 applications
- radv: Conditional rendering on compute queue
- anv: line failure
- panfrost midgard - major issues with MelonDS emulator - not able to trace properly too
- Nheko misrendering on RK3399 (Mali T860)
Changes
-------
Alyssa Rosenzweig (1):
- pan/bi: Fix mov and pack_32_2x16
Boris Brezillon (1):
- dzn: Use the vk_sync_binary abstraction
Charmaine Lee (1):
- gallium/util: Increase the debug_flush map depth to 64
Daniel Schürmann (1):
- aco: fix spilling of phis without temp operands
Dave Airlie (2):
- lavapipe: fix depth bias offset flag enables.
- llvmpipe: flush resources for kms swrast path.
Dylan Baker (8):
- docs: add release notes for 22.1.0
- VERSION: bump for 22.1.0 final
- relnotes: Add sha256sum and fix minor formatting issues
- .pick_status.json: Update to 8b13ee75ba9f27ceac6b6180ca05d321caa13612
- .pick_status.json: Update to 95d4e5435bf63239105a50370ebbbbdeb7fed2f8
- .pick_status.json: Update to ee2278de654853f1d6107e6ef6fc8537a668866e
- .pick_status.json: Update to 9773ed1dc74b98019640d909cdc2b5d6cffae85a
- .pick_status.json: Update to 5067a26f4432ae5e9690e70ef2498ea24798593e
Erik Faye-Lund (4):
- editorconfig: remove scons-ism
- editorconfig: remove html-rule
- editorconfig: remove m4-rule
- editorconfig: remove pl-rule
Filip Gawin (1):
- r300: keep negation if w is an inline constant
Hans-Kristian Arntzen (1):
- radv: Fix RTPSO hashing of pGroups.
Icecream95 (5):
- panfrost: Copy blend constant into variant even when reusing it
- nir: Add store_combined_output_pan BASE back
- pan/bi: Read base for combined stores
- pan/mdg: Read base for combined stores
- panfrost: Only write depth / stencil once if MRT is used
Jason Ekstrand (8):
- radv: Add a sqtt entrypoint for CmdBindVertexBuffers2
- intel/fs: Copy color_outputs_valid into wm_prog_data
- anv: Drop alpha_to_coverage from the NULL FS optimization
- anv: Handle the null FS optimization after compiling shaders
- anv: Don't disable the fragment shader if XFB is enabled
- nir: Handle register sources in lower_phis_to_regs_block
- glsl/nir: Stop leaking varyings_info
- nir: Mark negative re-distribution on fadd as imprecise
Konstantin Seurer (1):
- radv: Fix handling of primitiveOffset
Matt Turner (1):
- mesa: Drop dead #include "sparc/sparc.h"
Michael Skorokhodov (1):
- anv: Update line range
Mike Blumenkrantz (10):
- turnip: fix assert for max xfb outputs
- zink: use a zink_render_pass_pipeline_state bit for fbfetch
- zink: add renderpass bits for color/depth r/w
- zink: only warn once for SRGB fb without KHR_swapchain_mutable_format
- zink: require draw params ext/cap in ntv if drawid is used
- zink: emit spirv cap for subgroup vote ops
- st/pbo_compute: use different calc for non-3d compute buffer sizing
- zink: make swapchain kill message more descriptive
- zink: drop wideLines requirement
- zink: drop largePoints requirement
Pierre-Eric Pelloux-Prayer (1):
- radeonsi: don't use sel->nir in si_check_blend_dst_sampler_noop
Qiang Yu (1):
- radeonsi: lower nir_intrinsic_sparse_residency_code_and
Rhys Perry (2):
- aco: fix p_constaddr with a non-zero offset
- aco/ra: fix usage of invalidated iterator
Samuel Pitoiset (1):
- radv: fix writing buffer markers with non-zero memory offset
Timur Kristóf (2):
- radv: Implement conditional rendering for async compute queue.
- radv: Disable predication for supass clear and image clears.
Yogesh Mohan Marimuthu (1):
- vulkan/wsi: fix extra free if buffer_blit_queue
Zack Rusin (4):
- svga: Don't try to build x86/x64 assembly on different arch's
- svga: finish readbacks before mapping resources
- svga: Use direct maps when GB objects are present
- svga: Add support for SVGAv3

187
docs/relnotes/22.1.2.rst Normal file
View File

@@ -0,0 +1,187 @@
Mesa 22.1.2 Release Notes / 2022-06-16
======================================
Mesa 22.1.2 is a bug fix release which fixes bugs found since the 22.1.1 release.
Mesa 22.1.2 implements the OpenGL 4.6 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 4.6. OpenGL
4.6 is **only** available if requested at context creation.
Compatibility contexts may report a lower version depending on each driver.
Mesa 22.1.2 implements the Vulkan 1.2 API, but the version reported by
the apiVersion property of the VkPhysicalDeviceProperties struct
depends on the particular driver being used.
SHA256 checksum
---------------
::
0971226b4a6a3d10cfc255736b33e4017e18c14c9db1e53863ac1f8ae0deb9ea mesa-22.1.2.tar.xz
New features
------------
- None
Bug fixes
---------
- Random texture flickering in Minecraft
- panfrost: Broken interaction between CRC and tile size
- [anv, bisected, regression] Pipeline statistics query segfaults
- d3d12: point coord regression due to NIR IO changes
- Gallium driver crashes due to fd double close in iris driver
- Mesa currently FTBFS on x32 architecture
- Runescape randomly crashes. malloc_consolidate(): unaligned fastbin chunk
Changes
-------
Alyssa Rosenzweig (7):
- panfrost: Fix XML for AFBC header on v9
- pan/bi: Fix clper_xor on Mali-G31
- pan/mdg: Scalarize with 64-bit sources
- pan/mdg: Remove uppercase write masks
- panfrost: Fix inverted indirect dispatch condition
- panfrost: Inline pan_fbd_has_zs_crc_ext
- panfrost: Disable CRC at <16x16 tile sizes
Boris Brezillon (5):
- microsoft/spirv_to_dxil: Fix push_constants type declaration
- microsoft/spirv_to_dxil: Fix the push_constant UBO size calculation
- nir: Fix flat new_var assignment in create_new_io_vars()
- vulkan/util: Fill VkPhysicalDeviceIDProperties::deviceNodeMask
- microsoft/compiler: Images are no longer reprensented by uniform vars
Dave Airlie (1):
- llvmpipe: handle timespec overflow on fence waits.
Dylan Baker (7):
- docs: Add sh256sums for 22.1.1
- .pick_status.json: Update to 1c63a0beafefccec599ddbe355ec5a8b61df6438
- .pick_status.json: Update to ad5c84999b9eb2522cdf78bb0890939450280cf3
- .pick_status.json: Update to 49234585772f49626435d3d9324ad144e27fc453
- .pick_status.json: Update to 35dd4ac886283444294238ae0be1a7edcc776c8a
- .pick_status.json: Update to 2ef6b0aab1c7b99b85f2d88ced44a63f28cfca6b
- .pick_status.json: Update to ea33e44ce4f95ce45729b75dee34be50df749f09
Emma Anholt (1):
- nouveau/nv30: Make sure fsat is lowered in the VS.
Erik Faye-Lund (6):
- nir: introduce and use nir_component_mask
- freedreno: remove stale makefile
- intel: remove stale makefile
- ci/windows: add back build-error detection
- dzn: handle stencil-attachment-optimal layout
- gallium: remove stale comment
Georg Lehmann (1):
- zink: Use VK_USE_64_BIT_PTR_DEFINES to check for 64bit platforms.
Iago Toral Quiroga (1):
- broadcom/compiler: disable flags optimization for loop conditions
Ian Romanick (1):
- anv: Remove FS executables when applying the null FS optimization
Jason Ekstrand (2):
- nir/builder: Add a nir_trim_vector helper
- compiler/types: Don't place members in the previous substruct's end padding
Jesse Natalie (2):
- nir: Consider PNTC to be a varying
- d3d12: Properly set HS input control point count
Juan A. Suarez Romero (1):
- v3d: save only required states in blitter
Kenneth Graunke (1):
- intel/compiler: Fix uncompaction of signed word immediates on Tigerlake
Kyle Russell (1):
- etnaviv: don't halve max_instructions for GC400
Marek Olšák (2):
- ac/gpu_info: always retile DCC on gfx10 and newer chips
- gallium/u_threaded: fix buffer busyness tracking
Mike Blumenkrantz (31):
- st/pbo_compute: make compute download conditional in shader slightly more readable
- st/pbo_compute: fix z coords for compute pbos
- zink: remove first_frame stalling
- lavapipe: fix dynamic patchControlPoints
- zink: force queries to start/end out of renderpass
- egl/wayland: manually swap backbuffer when using zink
- egl/wayland: skip buffer creation on zink
- kopper: use get_drawable_info path for non-x11 drawables
- zink: fix dmabuf plane layout struct scoping
- format_utils: properly parenthesize macro params
- zink: always create descriptor templates
- zink: fix ntv partial stores
- zink: fix variable locations in manual xfb emission
- zink: scalarize when rewriting explicit 64bit io
- zink: use separate pointer for swapchain presents
- zink: keep a count of async presents occuring for a given swapchain
- zink: defer old swapchain destruction
- zink: fix framebuffer attachment usage asserts for dummy attachments
- zink: only update layout when doing mixed zs attachment renderpass check
- zink: add implicit sync workaround for non-mesa drivers
- zink: unset res->swapchain upon killing a swapchain
- zink: fix up KILL to a more sensible log message
- zink: fix generated tcs update path
- zink: unset generated tcs pointer from tes on deletion
- zink: fix generated tcs deletion
- zink: avoid uninit values in renderpass state
- zink: don't print VK_EXT_shader_atomic_float warning for nir_intrinsic_image_deref_atomic_exchange
- zink: fix cubemap lowering for array samplers
- zink: fix cubemap lowering bit size
- zink: flag optimization pass after inlining uniforms
- zink: fix 32bit bo rewriting
Nagappa Koppad, Basanagouda (1):
- iris:Duplicate DRM fd internally instead of reuse.
Pierre-Eric Pelloux-Prayer (5):
- st/mesa: use mutex in st_get_texture_sampler_view_from_stobj
- gallium: add size attribute to winsys_handle
- va/surface: set the correct size in vaExportSurfaceHandle
- radeonsi: prevent recursion in si_decompress_dcc
- radeonsi: add helper to use si_screen::aux_context
Qiang Yu (1):
- mesa/program: fix nir output reg overflow
Rhys Perry (2):
- aco: fix SMEM load_global_amd with non-zero offset
- aco: fix SMEM load_global with VGPR address and non-zero offset
Samuel Pitoiset (1):
- radv: enable radv_zero_vram for Hammerting

208
docs/relnotes/22.1.3.rst Normal file
View File

@@ -0,0 +1,208 @@
Mesa 22.1.3 Release Notes / 2022-06-29
======================================
Mesa 22.1.3 is a bug fix release which fixes bugs found since the 22.1.2 release.
Mesa 22.1.3 implements the OpenGL 4.6 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 4.6. OpenGL
4.6 is **only** available if requested at context creation.
Compatibility contexts may report a lower version depending on each driver.
Mesa 22.1.3 implements the Vulkan 1.2 API, but the version reported by
the apiVersion property of the VkPhysicalDeviceProperties struct
depends on the particular driver being used.
SHA256 checksum
---------------
::
b98f32ba7aa2a1ff5725fb36eb999c693079f0ca16f70aa2f103e2b6c3f093e3 mesa-22.1.3.tar.xz
New features
------------
- None
Bug fixes
---------
- [Crocus] - Minecraft with Forge and JourneyMap - Graphical glitches
- intel - Minecraft char bar is broken after Mesa upgrade
- [wine] RAGE: texture problems
- "Unsupported modifier, resource creation failed." on stderr
- anv: query regressions
- ci: docs build fail
Changes
-------
Alyssa Rosenzweig (2):
- pan/bi: Fix LD_BUFFER.i16 definition
- lima,panfrost: Do not ralloc contexts against the screen
Boris Brezillon (3):
- d3d12: Keep access masks up-to-date when removing vars in d3d12_disable_multisampling()
- nir/serialize: Put dest last in packed_instr::tex
- nir/serialize: Support texop >= 16
Christian Gmeiner (1):
- nir: Fix unused-variable compile warnings
Connor Abbott (4):
- tu: Fix 3d GMEM store swizzle in texture descriptor
- tu: Add missing WFI to the 3d GMEM store path
- tu: Save/restore \*_BIN_CONTROL in 3d GMEM store path
- tu: Fix linemode for tessellation with isolines
Dave Airlie (4):
- llvmpipe: disable alpha test branch if multisample is enabled.
- egl/x11: split large put image requests to avoid server destroy
- egl/x11: add missing put_image cookie cleanups
- wsi/x11: add xcb_put_image support for larger transfers.
Dylan Baker (9):
- docs: add sha256sum to 22.1.2 notes
- .pick_status.json: Update to 09a7304d5abf5b847cf5feb2d97758bee1696566
- .pick_status.json: Update to 2866ae32da0348caf71ad2d11c353321df626ff4
- .pick_status.json: Update to 8ce7faab47a77377a6a1313a80580828b052f878
- .pick_status.json: Mark 420270cb4f73da6251d4caec976358681f05c45c as backported
- .pick_status.json: Update to 9527fbe596e2ace276c158f67a900c29aad6cdd0
- .pick_status.json: Update to 9d7d1c0637529301d3e319ec5f1c883c5f249783
- lima/ci: mark some tests as pass
- .pick_status.json: Update to 58313f3257b338928a8ae4ea375eedb50accf2bb
Emma Anholt (1):
- vc4: Propagate txf_ms's dest_type to the lowered txf.
Erik Faye-Lund (1):
- docs: set language to english
Filip Gawin (1):
- r300: prefer old not native swizzle in constant folding
Iago Toral Quiroga (3):
- v3dv: fix leak
- broadcom/compiler: fix postponed TMU spills with multiple writes
- broadcom/compiler: don't predicate postponed spills
Ian Romanick (3):
- intel/fs: Add missing synchronization for WaW dependency
- nir: i32csel opcodes should compare with integer zero
- nir/algebraic: Fix NaN-unsafe fcsel patterns
Icecream95 (1):
- panfrost: Remove sync arguments from panfrost_batch_submit
Italo Nicola (1):
- virgl: overpropagate precise flags
Iván Briano (1):
- anv: do not get rid of empty/useless fragment shaders
Jason Ekstrand (9):
- nir/deref: Break out a helper for compare_deref_paths
- nir/deref: Use an index in compare_deref_paths
- nir/deref: Make compare_deref_paths take a stop callback
- nir/deref: Re-arrange variable checks in compare_deref_paths
- nir: Increase nir_variable_data::mode to 16 bits
- nir/vars_tests: Use nir_var_mem_global instead of ssbo
- nir/deref: Handle SSBO array bindings specially
- nir/deref: Handle RESTRICT for SSBO deref bindings
- anv: Properly clamp attachment layer counts
Lionel Landwerlin (2):
- vulkan/wsi: fix crash with debug names on swapchain
- anv: limit RT writes to number of color outputs
Marcin Ślusarz (2):
- intel/common: allocate space for at least one task urb
- intel/compiler: adjust task payload offsets as late as possible
Mike Blumenkrantz (27):
- zink: rename a variable
- zink: unify actual map calls in buffer mapping
- zink: use only the extents for buffer unmap flushes
- zink: fix buffer transfer flushes with offsets
- zink: store and reuse memory heap flags for buffer placement
- zink: move BAR allocation demotion up the stack
- zink: be a little selective about BAR fallback memory type
- zink: add a function for getting the minimum framebuffer layers
- zink: clamp renderpass layers better
- zink: move draw-time barrier generation down a little
- zink: track vertex buffer bind counts on resources
- zink: rework buffer barrier generation
- zink: track image binds
- zink: add a #define for vk shader bits
- zink: collect gfx stages for all bindings during barrier generation
- zink: don't short-circuit gfx stage finding during barrier generation
- zink: relax zink_resource_buffer_needs_barrier checks
- zink: cap driver inlining using ssa allocation limit
- glx/drisw: store the flush extension to the screen
- glx/drisw: invalidate drawables upon binding context if flush extension exists
- zink: fix dual_src_blend driconf workaround
- nir/lower_point_size: apply point size clamping
- lavapipe: copy more pNexts for pipeline creation
- lavapipe: fix renderpass info handling during pipeline creation
- lavapipe: skip post-copy pNext checking during pipeline creation for composites
- zink: fix image bind counting
- zink: fix kopper_acquire return value
Renato Pereyra (2):
- Revert "wsi/x11: Don't leak xcb_get_geometry_reply_t."
- Revert "wsi/x11: Avoid using xcb_wait_for_special_event in FIFO modes"
Rhys Perry (1):
- nir/deref: stop assuming coherent accesses of different SSBOs may alias
Samuel Pitoiset (1):
- aco: fix validation of SOP1 instructions without definitions
Sebastian Keller (1):
- egl/wayland: Don't try to access modifiers u_vector as dynarray
Sviatoslav Peleshko (2):
- intel/blorp/gen6: Set BLEND_STATEChange only if emitting the blend state
- intel/blorp: Dirty depth bounds dynamic state bits after blorp
Timothy Arceri (2):
- util: add dri config option to disable GL_MAP_UNSYNCHRONIZED_BIT
- util: use force_gl_map_buffer_synchronized workaround with RAGE
Timur Kristóf (1):
- gallium/u_blitter: Fix depth.
Yiwei Zhang (2):
- venus: fix a bug on buffer cache init failure path
- venus: fix the queue init failure path

107
docs/relnotes/22.1.4.rst Normal file
View File

@@ -0,0 +1,107 @@
Mesa 22.1.4 Release Notes / 2022-07-15
======================================
Mesa 22.1.4 is a bug fix release which fixes bugs found since the 22.1.3 release.
Mesa 22.1.4 implements the OpenGL 4.6 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 4.6. OpenGL
4.6 is **only** available if requested at context creation.
Compatibility contexts may report a lower version depending on each driver.
Mesa 22.1.4 implements the Vulkan 1.2 API, but the version reported by
the apiVersion property of the VkPhysicalDeviceProperties struct
depends on the particular driver being used.
SHA256 checksum
---------------
::
670d8cbe8b72902a45ea2da68a9da4dc4a5d99c5953a926177adbce1b1640b76 mesa-22.1.4.tar.xz
New features
------------
- None
Bug fixes
---------
- r300: Segfault in shaders/closed/steam/kerbal-space-program/1017.shader_test
Changes
-------
Alyssa Rosenzweig (2):
- ttn: Set nir->info.separate_shader
- panfrost: Clear with a quad to avoid flushing
Daniel Schürmann (3):
- nir/opt_shrink_vectors: fix re-using of components for vecN
- radv/shader_info: fix load_frag_coord and load_sample_pos read masks
- aco: fix packed 16bit fneg/fsat optimization
Dylan Baker (6):
- docs: add sah256sum for mesa 22.1.3
- .pick_status.json: Update to c017dfec62e448fea9ad9d16c575086b0de19b3b
- .pick_status.json: Mark 4480e577a462d43f5c7701d2c1b70c601c626e18 as denominated
- .pick_status.json: Update to 8ab1e9826db5936ff287bef7b428ebee27ada507
- .pick_status.json: Update to 9dbfc21ab9ac99ebec56369d1e1ea9d7b615d5f5
- .pick_status.json: Update to 0feedec9e6b630f930605d9681911fe9e2b705ce
Emma Anholt (1):
- zink: Do the timestamp-to-ns math in a double to have better precision.
Iago Toral Quiroga (2):
- v3dv: fix pool descriptor count for inline uniform buffers
- nir: fix documentation for uadd_carry and usub_borry opcodes
Jason Ekstrand (4):
- vulkan/wsi: Pass the size to MapMemory in the SW path
- vulkan/wsi/x11: Don't leak shm_reply if we don't have dri3 or present
- anv: Inheritance info cannot be NULL
- anv: Stop compacting surface state tables
Lionel Landwerlin (5):
- anv: disable non uniform indexing of UBOs
- anv: use the right helper to invalidate memory
- intel/fs: ray query fix for global address
- nir/serialize: restore ray query variables
- isl: add new helper for format component compatibility
Marek Olšák (1):
- radeonsi: fix random PS wave size
Mike Blumenkrantz (5):
- nir/types: fix glsl_matrix_type_is_row_major() assert
- zink: enforce viewport depth clamping
- mesa: fix SignalSemaphoreEXT behavior
- lavapipe: don't overwrite entire VkFormatProperties3 struct
- lavapipe: don't crash on null xfb buffer pointer
Pavel Ondračka (1):
- r300: Keep rc_rename_regs() from overflowing RC_REGISTER_MAX_INDEX
Rhys Perry (1):
- aco/ra: update register file when updating phi definition
Tatsuyuki Ishi (1):
- radv: Fix vkCmdCopyQueryResults -> vkCmdResetPool hazard.

159
docs/relnotes/22.1.5.rst Normal file
View File

@@ -0,0 +1,159 @@
Mesa 22.1.5 Release Notes / 2022-08-03
======================================
Mesa 22.1.5 is a bug fix release which fixes bugs found since the 22.1.4 release.
Mesa 22.1.5 implements the OpenGL 4.6 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 4.6. OpenGL
4.6 is **only** available if requested at context creation.
Compatibility contexts may report a lower version depending on each driver.
Mesa 22.1.5 implements the Vulkan 1.2 API, but the version reported by
the apiVersion property of the VkPhysicalDeviceProperties struct
depends on the particular driver being used.
SHA256 checksum
---------------
::
6fd60d38efdd25317948c61494b5117e01d42da695278728b1faef9f5f9a47ba mesa-22.1.5.tar.xz
New features
------------
- None
Bug fixes
---------
- radv: dynamic vertex input failure
- anv: KHR-GL46.tessellation_shader.single.xfb_captures_data_from_correct_stage fails on TGL
- anv: GTF-GL46.gtf32.GL3Tests.packed_pixels.packed_pixels_pbo failure
- anv: ICL hiz issue
- Error compiling gallium-nine on i686 using musl libc
- [anv][regression][bisected][bsw,gen9atom] dEQP-VK.memory.mapping.dedicated_alloc failing on bsw and gen9atom
Changes
-------
Alyssa Rosenzweig (2):
- pan/bi: Require ATEST coverage mask input in R60
- panfrost: Add decoupled early-ZS helpers
Bas Nieuwenhuizen (1):
- radv: Skip setting empty index buffers to avoid hang
Brian Paul (5):
- util/bitset: add BITSET_SIZE()
- llvmpipe: add missing tex_info->texture_unit assignment
- gallivm: increase LP_MAX_TGSI_SHADER_IMAGES from 16 to 32
- lavapipe: fix logicop, independent blend enable/disable
- llvmpipe: don't allow texture/resource swizzles on linear path
Chuansheng Liu (1):
- iris,anv: correct the max thread number for DG2+
Daniel Schürmann (2):
- aco: fix assertion in insert_exec_mask
- radv/rt: fix nir_builder cursor in lower_rt_instructions()
Dave Airlie (5):
- kms/dri: add mutex lock around map/unmap
- crocus: fail query begin if upload allocation fails.
- lavapipe: state latest conformance tests passed
- llvmpipe: fix aniso cube map arrays.
- crocus: fix leak in query code.
Dylan Baker (2):
- .pick_status.json: Update to 4cfa777e393705b40cebd0a4cd76aa827ce8b194
- .pick_status.json: Update to 9b844d7c42129925525d613c19622b11aee16298
Erik Faye-Lund (1):
- zink: fix EXT_color_write_enable check
Iago Toral Quiroga (1):
- v3dv: stop tracking push constant buffer references
Icecream95 (2):
- panfrost: Only emit images when they are present
- panfrost: Don't unbind recently bound streamout targets
Jason Ekstrand (1):
- vulkan/nir: Don't remove dead XFB outputs
Jesse Natalie (1):
- u_atomic: Fix MSVC p_atomic_add_return
Lionel Landwerlin (7):
- intel: protect against empty invalidate ranges
- anv: track if images can be fast clear with non-zero color
- anv: deal with isl format swizzles for buffer views
- spirv: switch to uint64 for rayquery internal type
- anv: ensure tile flush before streamout writes
- intel/fs: Set NonPerspectiveBarycentricEnable when the interpolator needs it.
- anv: fix primitive topology dynamic state emission on gfx7
Mike Blumenkrantz (11):
- lavapipe: support inlined shader spirv for compute
- zink: allow multiple tex components for depth tg4
- zink: always use 32bit sample ops
- zink: use right glsl length getter for ntv partial stores
- zink: handle max_vertices=0 in geometry shader
- zink: handle null samplerview in get_imageview_for_binding()
- zink: call bind_last_vertex_stage() when binding vs
- zink: fix viewport count tracking
- zink: invoke descriptor_program_deinit for programs on context destroy
- zink: only flag fbfetch as rp update if fbfetch wasn't already configured
- zink: avoid crashing when bindless texture updates aren't used
Nanley Chery (2):
- iris: Don't leak surface states for compressed resources
- iris: Don't leak compressed resources in iris_create_surface
Pierre-Eric Pelloux-Prayer (1):
- radeonsi: check last_dirty_buf_counter and dirty_tex_counter
Qiang Yu (2):
- ac/nir/ngg: fix nogs culling scratch size
- ac/nir/ngg: add a barrier before prim id export
Rhys Perry (1):
- radv: fix vbo_bound_mask indexing
SoroushIMG (2):
- zink: Fix spirv stream 0 vertex emit for multistream shaders
- Zink: Fix clear being missed when using emulated draws in zink_blit
Timur Kristóf (1):
- ac/llvm: Add LLVM bug workaround to ac_build_mbcnt_add.
newbluemoon (1):
- nine: replace ulimit with sysconf call

0
docs/relnotes/22.1.6.rst Normal file
View File

Some files were not shown because too many files have changed in this diff Show More