Compare commits

...

7462 Commits

Author SHA1 Message Date
Qiang Yu
45826e42c5 ac,aco: move gfx10 ngg prim count zero workaround to nir
To simplify both llvm and aco backend and remove unnecessary
workaround code where prim count is known to be not zero.

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/22381>
2023-04-13 08:12:03 +00:00
Tapani Pälli
b967cbba57 intel/compiler: use intel_needs_workaround for Wa_14012437816
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/22437>
2023-04-13 07:33:50 +00:00
Tapani Pälli
ccf16693e1 intel/fs: use intel_needs_workaround for Wa_22013689345
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/22437>
2023-04-13 07:33:50 +00:00
Eric Engestrom
1a9727a81e ci/rustfmt: make sure to only check each file once
rustfmt has some magic that follows files (I'm guessing), making files get
checked multiple times with `*.rs`, so let's limit ourselves to `lib.rs`.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22321>
2023-04-13 05:56:53 +00:00
Tatsuyuki Ishi
36fd2bbd98 ci/android: Make armv8's arch aarch64 instead of arm.
Per [1], arm is for 32-bit.

For an upcoming change, we need to detect AArch64 specifically.
Specifying arm in the cross file will result in the wrong build script
behavior.

[1]: https://mesonbuild.com/Reference-tables.html#cpu-families

Reviewed-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22418>
2023-04-13 04:28:29 +00:00
Mike Blumenkrantz
1a63ccc9aa zink: remove a fixed validation error for ci
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22453>
2023-04-13 04:10:32 +00:00
Karol Herbst
55c9356d29 rusticl/program: rework source code tracking
For the CL spec it really matters how a program object was created. We
never really cared all that much, but it didn't support the corner case of
having an empty string as the OpenCL C source code.

Enums feel like the more Rust way to do this kind of stuff anyway.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22280>
2023-04-13 02:54:21 +00:00
Karol Herbst
6d7b705125 rusticl/program: extract common code of compile and build
The code wasn't all the same, but the build version was wrong, e.g. the
compile flags specified need to be stored even on error.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22280>
2023-04-13 02:54:21 +00:00
Karol Herbst
d7e9b4ef5b rusticl/program: validate the SPIR-V when created from IL
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8771
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22280>
2023-04-13 02:54:21 +00:00
Karol Herbst
8fcfc51dad clc: add clc_validate_spirv
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22280>
2023-04-13 02:54:21 +00:00
Karol Herbst
ab032f4bfd rusticl/program: make IL programs look closer to CLC ones
We want to validate the actual passed in SPIR-V, but we can only report
errors back on build/compile time. So instead of storing the initial IL
in the devices `ProgramBuild` objects, just store it on the Program
instead. This also simplifies setting spec constants as this is only valid
on program directly created from IL and not e.g. linked ones.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22280>
2023-04-13 02:54:21 +00:00
Karol Herbst
ca1e9917a9 rusticl/program: allow dumping compilation logs through RUSTICL_DEBUG
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22280>
2023-04-13 02:54:21 +00:00
Karol Herbst
22808d542b rusticl/platform: move device initialization to the platform
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22280>
2023-04-13 02:54:21 +00:00
Karol Herbst
53025688bb rusticl/platform: move getter into the type
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22280>
2023-04-13 02:54:21 +00:00
Karol Herbst
3e59a2860e rusticl/platform: rename _cl_platform_id to Platform
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22280>
2023-04-13 02:54:21 +00:00
Karol Herbst
11250d7a9e rusticl: split platform into core and api parts
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22280>
2023-04-13 02:54:20 +00:00
Samuel Pitoiset
3320eee877 radv: cleanup after splitting radv_pipeline.c
I moved to many things to radv_pipeline_graphics.c without checking.

Fixes: 7783b7f697 ("radv: split radv_pipeline.c into radv_pipeline_{compute,graphics}.c")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22441>
2023-04-13 02:21:44 +00:00
Vitaliy Triang3l Kuzmin
30d141ba63 r600: Alpha to coverage dithering on Evergreen+
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22384>
2023-04-13 02:07:52 +00:00
Alyssa Rosenzweig
7a7d374ac3 pan/decode: Print compute job payloads
Noticed while debugging OpenCL. I think this was fallout from the CSF decode
rework?

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22228>
2023-04-13 01:49:33 +00:00
Alyssa Rosenzweig
de01ae120d panfrost: Allocate shared memory in OpenCL
In OpenCL, we can have no shader-defined shared memory but some dispatch-time
variable memory. This is not reflected in ss->info.wls_size, so check the right
variable instead so we allocate the appropriate memory.

Fixes page faults accessing shared memory with Rusticl, e.g. in the vstore_local
test.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22228>
2023-04-13 01:49:33 +00:00
Alyssa Rosenzweig
2f2738dc90 pan/bi: Use nir_lower_mem_access_bit_sizes
OpenCL can generate large loads and stores that we can't support, so we need to
lower. We can load/store up to 128-bits in a single go. We currently only handle
up to 32-bit components in the load and no more than vec4, so we split up
accordingly.

It's not clear to me what the requirements are for alignment on Valhall, so we
conservatively generate aligned access, at worst there's a performance penalty
in those cases. I think unaligned access is suppoerted, but likely with a
performance penalty of its own? So in the absence of hard data otherwise, let's
just use natural alignment.

Oddly, this shaves off a tiny bit of ALU in a few compute shaders on Valhall,
all in gfxbench. Seems to just be noise from the RA lottery.

total instructions in shared programs: 2686768 -> 2686756 (<.01%)
instructions in affected programs: 584 -> 572 (-2.05%)
helped: 6
HURT: 0
Instructions are helped.

total cvt in shared programs: 14644.33 -> 14644.14 (<.01%)
cvt in affected programs: 5.77 -> 5.58 (-3.25%)
helped: 6
HURT: 0

total quadwords in shared programs: 1455320 -> 1455312 (<.01%)
quadwords in affected programs: 56 -> 48 (-14.29%)
helped: 1
HURT: 0

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22228>
2023-04-13 01:49:33 +00:00
Alyssa Rosenzweig
934b0f1add pan/bi: Respect swizzles for more vector ops
We need to respect the ALU swizzle, this takes a vector. Fixes incorrect
pack_64_2x32 translation hit when wiring up lower_mem_access_bit_sizes for
OpenCL.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22228>
2023-04-13 01:49:33 +00:00
Alyssa Rosenzweig
d00d2ae701 pan/bi: Lower swizzles for 8-bit CSEL
With OpenCL we can generate stuff like CSEL.u32.eq r0.b0000, we need to handle
it when lowering swizzles.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22228>
2023-04-13 01:49:33 +00:00
Lionel Landwerlin
66edd030ab anv: add utrace tracking of frame boundaries
Based on vkQueuePresentKHR calls. It just helps spotting the beginning
end of a frame in perfetto when apps are using 3/4 command buffers per
frame.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22276>
2023-04-13 01:14:38 +00:00
Lionel Landwerlin
da6842007f intel/ds: add a new timeline row for frames
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22276>
2023-04-13 01:14:38 +00:00
Lionel Landwerlin
68bba1539f anv: exclude performance queries from blorp clears
The query buffer contains a batch to implement the multi pass
replay/accumulation of results. So we can't clear it with a memset.

An optimization for later would be to move the batches to the very end
of the query buffer so we can clear the query data without touching
the batches.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 4dc7256bf9 ("anv: reset query pools using blorp")
Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22421>
2023-04-13 00:44:29 +00:00
Timur Kristóf
7036d1a155 ac/nir/ngg: Don't store primitive IDs from culled primitives.
Primitive export used the gs_accepted variable after culling,
so we overwrote this variable after vertex compaction to make
sure not to hang the GPU.

This had an unintended side effect when storing the primitive ID
to LDS on GS threads: the LDS store was done even on threads whose
triangle was culled; potentially causing issues.

As a fix, create a separate boolean variable that remembers
which invocations need to export a primitive; and don't store
the primitive ID to LDS when gs_accepted is false.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8805
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/22424>
2023-04-12 23:55:37 +00:00
Ruijing Dong
31c4087cb3 frontends/va: disable skip_frame_enable in vaapi interface.
skip_frame_enable is for preventing overshooting in some cases,
however the tests in FW were broken, and the output result shows
the functionality has not completed yet, which is the reason
this should be disabled at the moment until it has been fully
verified.

Cc: mesa-stable
Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8178

Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22428>
2023-04-12 23:40:23 +00:00
Oleksii Bozhenko
8976d8280f wsi: remove get_sorted_vk_formats duplication
Fixes: 37a8b2d12e
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8727

Signed-off-by: Oleksii Bozhenko oleksii.bozhenko@globallogic.com

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22337>
2023-04-12 22:07:32 +00:00
Oleksii Bozhenko
53106c3a4f wsi: add rgb_component_bits_are_equal
Signed-off-by: Oleksii Bozhenko oleksii.bozhenko@globallogic.com

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22337>
2023-04-12 22:07:32 +00:00
Mike Blumenkrantz
7704773619 zink: handle swapchain handoffs around makecurrent
when a new resource is created for an extant swapchain, the existing
acquire (if any) should be transferred to the resource to ensure
expected behavior

this should be enough to fix piglit's glx-make-current

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22431>
2023-04-12 21:43:35 +00:00
Mike Blumenkrantz
5db5218044 zink: track per-image swapchain layouts
this is important for handing off the swapchain between resources
on makecurrent since a context that is made not-current will have its
swapchain resources destroyed while the swapchain persists

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22431>
2023-04-12 21:43:35 +00:00
Bas Nieuwenhuizen
ba73a41a2b radv: Reserve space for fast clear related writes.
Fixes: 9ee67467c9 ("radv: predicate cmask eliminate when using DCC.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22392>
2023-04-12 20:31:47 +00:00
Bas Nieuwenhuizen
1b5bd0f1c0 radv: Reserve space for updating DCC metadata.
Fixes: 9ee67467c9 ("radv: predicate cmask eliminate when using DCC.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22392>
2023-04-12 20:31:47 +00:00
Bas Nieuwenhuizen
771c0f0e65 radv: Reserve space in si_cs_emit_cache_flush.
Fixes: 4c6f83006d ("radv: Synchronization for task shaders.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22392>
2023-04-12 20:31:47 +00:00
Bas Nieuwenhuizen
1de978b873 radv: Reserve space in conditional rendering functions.
Fixes: e45ba51ea4 ("radv: add support for VK_EXT_conditional_rendering")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22392>
2023-04-12 20:31:47 +00:00
Bas Nieuwenhuizen
7f47d764e1 radv: Reserve space in various streamout functions.
Fixes: b4eb029062 ("radv: implement VK_EXT_transform_feedback")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22392>
2023-04-12 20:31:47 +00:00
Bas Nieuwenhuizen
4879f309a6 radv: Reserve space in framebuffer emission.
In the execute secondary scenario nothing else does it for us.

Fixes: 203f60ebf2 ("radv: emit framebuffer state from primary if secondary doesn't inherit it")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22392>
2023-04-12 20:31:47 +00:00
Georg Lehmann
0c8394908c aco/tests: add missing dependency on generated header
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8820
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22442>
2023-04-12 20:00:09 +00:00
Emma Anholt
f8a8b7708e etnaviv: Fix regression from if_uses change.
Flipped the condition in the conversion.

Fixes: 7f6491b76d ("nir: Combine if_uses with instruction uses")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22430>
2023-04-12 18:21:40 +00:00
Timur Kristóf
bd3191dbfe aco, radv: Remove redundant enable_mrt_output_nan_fixup from PS epilog info.
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/21935>
2023-04-12 17:30:02 +00:00
Timur Kristóf
af768afcbf aco, radv: Remove "key" from aco_compiler_options.
aco_compiler_options::key is a leftover from when aco used
the radv_pipeline_key struct, but aco_compiler_options::key was
never actually used as a cache key.

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/21935>
2023-04-12 17:30:02 +00:00
Timur Kristóf
80d8e8d828 aco: Remove setup_*_variables and add setup_lds_size instead.
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/21935>
2023-04-12 17:30:02 +00:00
Timur Kristóf
facecd87e1 radv: Don't hardcode LDS granularity in gfx9_get_gs_info.
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/21935>
2023-04-12 17:30:02 +00:00
Timur Kristóf
4ae46840cd ac, aco, radv: Clarify LDS size on GFX6, and NGG shaders.
This information was wrong in some places, let's fix it now.

GFX6:
The GPU has 64KB LDS, but only 32KB is usable by a workgroup.

NGG:
There was some misinformation about NGG only being able to
address 32 KB LDS, it turns out this is actually not true
and it can address the full 64K.

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/21935>
2023-04-12 17:30:02 +00:00
Mike Blumenkrantz
edf30b1c6d zink: eliminate implicit feedback loops on rp begin
in a scenario like:
* bind fb
* clear
* bind fb attachment as sampler
* begin rp
* draw
* end rp
* flush
* bind new fs
* begin rp
* draw

the first draw will have an implicit feedback loop, but the second one will not
need a feedback loop. since no samplers or attachments are changed between
draws, however, the feedback loop will remain active for successive renderpasses,
which is problematic since the shader part of the driver (zink_update_barriers)
attempts to eliminate these same feedback loops, leading to layout desync

instead, add handling to attachment prep here to eliminate feedback loops
in the event that an attachment can be switched from a write layout to a read layout

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22423>
2023-04-12 15:43:01 +00:00
Mike Blumenkrantz
60d045e0b2 zink: pre-convert attachment id to attachment idx
this is a little simpler and allows reuse

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22423>
2023-04-12 15:43:01 +00:00
Mike Blumenkrantz
d649368009 zink: break out feedback loop pipeline state flagging for reuse
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22423>
2023-04-12 15:43:01 +00:00
Mike Blumenkrantz
aec938b1f8 zink: remove redundant 'blitting' check in zink_prep_fb_attachment()
this is a return conditional 2 lines above

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22423>
2023-04-12 15:43:01 +00:00
Samuel Pitoiset
4f3ddf31e0 radv: fix pipeline creation feedback with imported graphics libs
Stages imported from graphics pipeline libraries are defined as
additional entries in the order they were imported. This is similar
to raytracing libraries.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22288>
2023-04-12 15:03:42 +00:00
Erik Faye-Lund
d689a72bc5 zink: do not use sampled-image for buffers
In SPIR-V 1.6, sampled images with buffer dimensionality was disallowed.

The sampler that GLSL provides for buffer-textures is useless, and can
simply be ignored. So let's not treat them as samplers any more.

Fixes: bd816084c6 ("zink: enable spir-v 1.6 for vulkan 1.3")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8808
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22407>
2023-04-12 12:47:13 +00:00
Samuel Pitoiset
7783b7f697 radv: split radv_pipeline.c into radv_pipeline_{compute,graphics}.c
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21811>
2023-04-12 11:18:45 +00:00
José Roberto de Souza
02de31f6bb loader: Add Xe KMD support
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22425>
2023-04-12 10:41:21 +00:00
José Roberto de Souza
156464b67e iris: Handle Xe syncronization with syncobjs
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
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/22425>
2023-04-12 10:41:21 +00:00
José Roberto de Souza
910e659e31 iris: Add function to close gem bos
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
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/22425>
2023-04-12 10:41:21 +00:00
José Roberto de Souza
b1299f42ff anv: Fix vm bind of imported buffers
Imported buffers may be created in a device with different
memory alignment and this can cause vm bind to fail because bo
size can be smaller than the calculated vm bind range using the
importer device memory alignment.

So here adding actual_size to anv_bo, this will be set with the actual
size of the bo allocated by kmd for bos allocate in the current device.
For other bo the lseek or the Vulkan API size will be used.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22219>
2023-04-12 10:05:32 +00:00
Rob Clark
87978c3933 freedreno/a6xx: Allow z24s8 format casts
Allow UBWC format casts between z24s8/x24s8/z24x8.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8816
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22427>
2023-04-12 09:26:22 +00:00
Dmitry Baryshkov
fc5dd4035a freedreno/a5xx: add SP clock control register
Add GPMU_GPMU_SP_CLOCK_CONTROL register. Duplicated GPGMU is not a typo,
vendor kernel names it A5XX_GPMU_GPMU_SP_CLOCK_CONTROL.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22429>
2023-04-12 08:48:27 +00:00
Dmitry Baryshkov
05c22bdea1 freedreno/a5xx: reorder GPMU registers
Severeal GPMU registers were places out of the order. Move them to be
ordered proprely.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22429>
2023-04-12 08:48:27 +00:00
Collabora's Gfx CI Team
be5db62f88 Uprev Piglit to 355ad6bcb2cb3d9e030b7c6eef2b076b0dfb4d63
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22325>
2023-04-12 08:04:55 +00:00
Samuel Pitoiset
8f76a6a26e radv/ci: remove one RT test from the expected failures on RDNA3
It does pass.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22413>
2023-04-12 07:33:31 +00:00
Jesse Natalie
117ace3b14 dzn: Handle mismatches in bound descriptor set vs pipeline layout
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22420>
2023-04-12 04:14:46 +00:00
Kenneth Graunke
a4e13063ed iris: Hack around gbm_gralloc stride restrictions
gbm_bo_map returns a stride for the mapping, which may differ from the
stride of the underlying BO.  Drivers may implement mappings via staging
blits, returning a map of a temporary resource instead.  That temporary
may have fewer stride restrictions (i.e. it isn't used for display), and
thus be more tightly packed, saving memory.

However, gbm_gralloc has a design flaw where after calling gbm_bo_map,
it asserts that the stride exactly matches the original BO's stride:

   assert(stride == gbm_bo_get_stride(bo));

This is a bad assumption, as the GBM API returns a stride explicitly
precisely because it -can- differ.  But, this would require significant
changes to gbm_gralloc to fix.  So, to work around it, we add a driver
hack for Android-only that forces staging maps of any external BO to use
the original resource's stride.

This should fix issues with mapping cursor planes and SW media codec
uploads on Android-x86.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7974
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22156>
2023-04-11 23:45:04 +00:00
Kenneth Graunke
1452b60f35 iris: Extend resource creation helpers to allow for explicit strides
We'll want to create temporary staging images with explicit strides
in the next commit.  This extends iris_resource_create_with_modifiers
to have an explicit row_pitch_B parameter (0 continues to mean "let
ISL pick one").

Because resource_create_with_modifiers() is a driver hook, we can't
just add a parameter, so unfortunately we gain another wrapper layer.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22156>
2023-04-11 23:45:04 +00:00
Mike Blumenkrantz
59bb2f1aac zink: fix GPL lib leaking
this was improperly added into the conditional for removing a prog from the
ctx hash when it had no relation to that code, leading to refcount
leaks that ended up leaking the whole thing

Fixes: 487ac6dbd6 ("zink: implement cross-program pipeline library sharing")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22397>
2023-04-11 22:22:12 +00:00
Mike Blumenkrantz
a81a101159 zink: free GPL input/output libs on context destroy to avoid leaking
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22397>
2023-04-11 22:22:11 +00:00
Jesse Natalie
187efd4e97 d3d12: Fix buffer reference leak for SO count staging buffer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22417>
2023-04-11 22:08:11 +00:00
Karol Herbst
3b958f65ca rusticl: enable radeonsi
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19232>
2023-04-11 20:44:36 +00:00
Karol Herbst
c9ab7d7525 radeonsi: use default float mode for CL
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19232>
2023-04-11 20:44:36 +00:00
Karol Herbst
e5ef95e31f radeonsi: implement get_compute_state_info
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19232>
2023-04-11 20:44:36 +00:00
Mike Blumenkrantz
0c730f98c5 zink: unroll array loop when copying vars for passthrough shaders
wildcard derefs aren't supported in ntv

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22376>
2023-04-11 20:26:22 +00:00
Sil Vilerino
26f767d524 d3d12: Video processor to only promote resources to permanent residency when there is work to be flushed
This fixes some cases where flush is called from the app without work being scheduled before, causing d3d12_promote_to_permanent_residency
to be called with garbage pointers/arguments.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22415>
2023-04-11 20:09:19 +00:00
Danylo Piliaiev
17df75d47d vulkan: Sanitize pSampleMask in CmdSetSampleMaskEXT
ms.sample_mask is only 16b, while VkSampleMask is 32b and it is allowed
to have all of them set even if maximum 16 samples are supported.

E.g. happens with Zink running supertuxkart:
 supertuxkart: ../../../source/mesa/src/vulkan/runtime/vk_graphics_state.c:2346: vk_common_CmdSetSampleMaskEXT: Assertion `(dyn)->ms.sample_mask == (*pSampleMask)' failed.

  vk_common_CmdSetSampleMaskEXT (commandBuffer=0x5556e903f0, samples=VK_SAMPLE_COUNT_1_BIT, pSampleMask=0x5556819ccc) at vk_graphics_state.c:2346
  zink_draw<(zink_multidraw)1, (zink_dynamic_state)5, true, false> (...) at zink_draw.cpp:639
  zink_draw_vbo<(zink_multidraw)1, (zink_dynamic_state)5, true> (...) at zink_draw.cpp:922

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22360>
2023-04-11 19:20:50 +00:00
Mike Blumenkrantz
89aa363593 zink: block oom flushes during unordered blits
this is broken beyond space and time

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22412>
2023-04-11 18:59:13 +00:00
Timur Kristóf
b51e858d68 radv/amdgpu: Place secondary CS without IB2 in non-WC GTT.
When using a secondary CS without IB2, we have to memcpy the
contents into the primary CS. Use these flags to improve perf
by preventing memcpy from VRAM.

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/22354>
2023-04-11 17:05:03 +00:00
Timur Kristóf
7c5bf91350 radv/amdgpu: Extract radv_amdgpu_cs_bo_create function.
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/22354>
2023-04-11 17:05:03 +00:00
Timur Kristóf
0c1d4130ca radv/amdgpu: Add bool is_secondary argument to cs_create function.
Also save is_secondary to the CS object.

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/22354>
2023-04-11 17:05:03 +00:00
Timur Kristóf
c0fe6bbef1 radv: Allow task/mesh shaders with RADV_DEBUG=noibs.
The new submit code path should now be able to handle gang submit
even when chaining is not enabled.

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/22354>
2023-04-11 17:05:03 +00:00
Timur Kristóf
dc59a6b2ee radv/amdgpu: Respect maximum number of submitted IBs per IP type.
In a gang submit, the maximum number of IBs is per IP type,
and is different for each queue. Let's respect that.

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/22354>
2023-04-11 17:05:03 +00:00
Timur Kristóf
e4a37547a5 radv/amdgpu: Clean up submission functions.
Remove a useless extra function call, and rename fallback to
internal because it is the only code path left.

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/22354>
2023-04-11 17:05:03 +00:00
Timur Kristóf
50e6b16855 radv/amdgpu: Use fallback submit for queues that can't use IBs.
This commit consolidates the queue submit code paths into one.

Now we always allocate BOs for every CS, but when IBs aren't
allowed, we simply submit every BO to the kernel.

A microbenchmark done by Bas indicated that submitting more IBs to
the kernel only adds a negligible overhead. Additionally, this
allows us to stop copying the command buffer contents in system
memory and get rid of a lot of legacy code.

In order to be able to submit every BO, we make sure to add the
last BO to the old_ib_buffers array on cs_finalize. This also
necessitates some changes in cs_execute_secondary and other
functions.

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/22354>
2023-04-11 17:05:03 +00:00
Timur Kristóf
958ea2ec2a radv: Split submission in winsys instead of radv_queue.
This will still make it so that RADV_DEBUG=hang will only submit
one command buffer at a time, but otherwise let's pass all CS
objects into one submission and let the winsys split them if
necessary.

The winsys can do a better job at splitting them because
radv_queue has no knowledge of IBs and ignores chaining in the
splitting logic.

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/22354>
2023-04-11 17:05:03 +00:00
Timur Kristóf
41a9bced31 radv: Fill continue preambles and postambles properly.
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/22354>
2023-04-11 17:05:03 +00:00
Timur Kristóf
1bdc1bd36c radv/amdgpu: Split gang submissions correctly when not chained.
In a gang submit, the follower (typically ACE) and leader
(typically GFX) can have synchronization between each other.
We must ensure that these end up in the same submission,
otherwise we can deadlock the GPU.

We rely on radv_queue here to order follower before the leader
in the submitted CS array.

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/22354>
2023-04-11 17:05:03 +00:00
Timur Kristóf
813885f682 radv/amdgpu: Add ability to submit non-chained CS to fallback.
When submitting a CS whose IP type doesn't support chaining,
let's submit all the IBs that this CS allocated.

This is going to be better than the sysmem code path because it
doesn't require the winsys to memcpy the contents of the command
buffers.

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/22354>
2023-04-11 17:05:03 +00:00
Timur Kristóf
e4dd6a8eb3 radv/amdgpu: Add postambles to fallback submit.
Some new features, such as perf counters and gang submit use
postambles. Implement these properly.

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/22354>
2023-04-11 17:05:02 +00:00
Timur Kristóf
103ebe96c0 radv/amdgpu: Add continue preambles to fallback submit.
When splitting a larger submission into several smaller ones,
the flushing at the beginning of the initial preambles is not
really necessary, so it'll be better to use the continue
preambles for this purpose.

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/22354>
2023-04-11 17:05:02 +00:00
Timur Kristóf
6844506c3d radv/amdgpu: Allow multiple continue preambles.
For feature parity with initial preambles.
Previously, continue preambles were for GFX6 only, but this is
about to change in the next commits.

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/22354>
2023-04-11 17:05:02 +00:00
Timur Kristóf
8cea452bda radv/amdgpu: Rewrite fallback code path so it can split submissions.
Currently, radv_queue already splits submissions but we want to
change this and be able to split them in the winsys code as well.
Necessary because we want to split based on number of actual
IBs not number of command buffers, but radv_queue is not
aware of IBs.

Note that this commit does not actually take this new split into
use yet, that will be done in a following commit when it is ready,
this is why we set the max IB count higher than radv_queue here.

This commit is the first step in making "fallback" the default and
only submission code path.

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/22354>
2023-04-11 17:05:02 +00:00
Timur Kristóf
df90102a15 radv/amdgpu: Remove hw_can_chain in favour of use_ib.
They have the same meaning, but use_ib makes more sense because it
also takes the gfx_level into account.

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/22354>
2023-04-11 17:05:02 +00:00
Timur Kristóf
ccb4b78840 radv/amdgpu: Add a few assertions during submit.
These are useful when debugging the submission code.

- Ensure correct IB alignment
- Ensure we don't submit empty IBs

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/22354>
2023-04-11 17:05:02 +00:00
Timur Kristóf
e5201987b1 radv/amdgpu: Extract radv_amdgpu_cs_add_old_ib_buffer.
This function will be used elsewhere in a following commit.

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/22354>
2023-04-11 17:05:02 +00:00
Timur Kristóf
44de40fb5f radv/amdgpu: Use correct alignment when creating CS BOs.
Shouldn't matter in practice because the kernel will likely
give us a page-aligned BO, but better to specify it just
in case.

Cc: mesa-stable
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/22354>
2023-04-11 17:05:02 +00:00
Timur Kristóf
e214059120 radv/amdgpu: Only allow IB BOs on graphics and compute queues.
This disallows IB BOs on eg. SDMA queues which was previously
mistakenly left out.

Cc: mesa-stable
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/22354>
2023-04-11 17:05:02 +00:00
Timur Kristóf
a7080fe4ef radv/amdgpu: Fix mismatching return type of radv_amdgpu_cs_submit.
Fixes a warning that is reported by GCC 13.

Cc: mesa-stable
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/22354>
2023-04-11 17:05:02 +00:00
Timur Kristóf
daeb409559 ac: Add maximum number of submitted IBs.
The number of IBs per submit isn't infinite, it depends on the IP type
(ie. some initial setup needed for a submit) and the packet size.
It can be calculated according to the kernel source code as:
(ring->max_dw - emit_frame_size) / emit_ib_size

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/22354>
2023-04-11 17:05:02 +00:00
Timur Kristóf
87d22933ae radv: Create continue preamble on GFX6 even when no shader rings are used.
Skipping the continue preamble can allow other processes to mess
up some	registers set by the current process.

Originally, we could omit generating the continue preamble when
no shader rings were used, because the register initialization
happened at the beginning of every main cmdbuf. However, this
isn't the case anymore.

Cc: mesa-stable
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/22354>
2023-04-11 17:05:02 +00:00
xurui
0bba139767 zink: bs->dd.push_pool[1].pool should be freed
cc: mesa-stable

Signed-off-by: xurui <xurui@kylinos.cn>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22389>
2023-04-11 16:16:05 +00:00
Patrick Lerda
f9401a515a egl: fix memory leak related to _eglRefreshDeviceList()
Indeed, the unnecessary drmDevice objects were not freed.

For instance, this issue could be triggered with: "piglit/bin/egl_ext_platform_device -auto -fbo":
SUMMARY: AddressSanitizer: 2796 byte(s) leaked in 12 allocation(s).

Fixes: e39d72aec2 ("egl: only take render nodes into account when listing DRM devices")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22408>
2023-04-11 15:48:26 +00:00
David Heidelberg
1fa1c285fc ci/amd: add draw.dynamic_rendering flake
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22411>
2023-04-11 15:10:37 +00:00
Eric Engestrom
4b182dbcf2 v3dv/ci: mark known dEQP-VK.wsi.xlib.surface.query_formats failure
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22410>
2023-04-11 13:39:31 +00:00
Bas Nieuwenhuizen
a8cb837703 radv: Align atomic values.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22121>
2023-04-11 12:57:15 +00:00
Bas Nieuwenhuizen
02c46fa1e8 util/disk_cache: Align atomic size.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22121>
2023-04-11 12:57:15 +00:00
Bas Nieuwenhuizen
1c2d90f17a util: Add aligned int64_t types for x86(non 64).
To avoid split locks.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22121>
2023-04-11 12:57:15 +00:00
Samuel Pitoiset
9ccaf5583f radv: fix re-emitting vertex user SGPRs when binding a graphics pipeline
The base SGPR and the number of SGPRs can be equal but it was incorrect
because one VS can have draw_id and one can have base_instance. Fix
this by invalidating the vertex user SGPRs unconditionally.

Though they should also be invalidated after executing secondaries,
otherwise nothing is invalidated if the same pipeline is bind to the
primary again.

This fixes dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed*.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21652>
2023-04-11 12:12:05 +00:00
Daniel Schürmann
35805d172a radv/ci: add 2 more Flakes for Navi21
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22030>
2023-04-11 11:38:15 +00:00
Daniel Schürmann
dcfca69e67 radv: clean up pipeline-cache interface
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22030>
2023-04-11 11:38:15 +00:00
Daniel Schürmann
c2b9279227 radv: use vk_pipeline_cache
Replaces the RADV pipeline cache with an implementation
based on the common vk_pipeline_cache.

We use a dual-layer approach with two types of cache entries.

  1. radv_shader:
    - serialized as radv_shader_binary
    - uses SHA1 of the binary as key
  2. radv_pipeline_cache_object:
    - contains pointers to associated radv_shaders
    - serialized as list of SHA1
    - uses the pipeline hash as key

In combination with single-file disk-cache, this reduces the cache size by ~60%.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22030>
2023-04-11 11:38:15 +00:00
Daniel Schürmann
9b3679aff2 radv: implement radv_shader_create_cached()
This function takes a radv_shader_binary and writes it to the
disk cache before creating and returning a radv_shader cache entry.
The key of the cache entry is the full SHA1 hash of the binary.
This way, we will be able to deduplicate identical shaders.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22030>
2023-04-11 11:38:15 +00:00
Daniel Schürmann
55cc2fb088 radv: add struct radv_pipeline_cache_object
This patch implements a per pipeline cache-entry which contains
pointers to the associated shaders.
The serialized format contains the binary hashes of the shaders.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22030>
2023-04-11 11:38:15 +00:00
Daniel Schürmann
577d76f60f radv: add radv_shader_serialize() and radv_shader_deserialize() functions
These functions convert between radv_shader and radv_shader_binary.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22030>
2023-04-11 11:38:15 +00:00
Daniel Schürmann
efbf0e70eb radv: unconditionally store the binary code in radv_shader
We will (temporarily) use it to serialize shader binaries
with the common vk_pipeline_cache.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22030>
2023-04-11 11:38:15 +00:00
Daniel Schürmann
5303a57964 radv: derive struct radv_shader from vk_pipeline_cache_object
We will use radv_shader directly as cache entries.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22030>
2023-04-11 11:38:15 +00:00
Lionel Landwerlin
daa8003e45 intel/fs: use nomask for setting cr0 for float controls
The instructions manipulation cr0 use the default mask on lane0. So if
for some reason that lane is disabled in some of the dispatchs, we can
end up not executing the instructions.

Fixes flakyness in dEQP-VK.spirv_assembly.instruction.graphics.16bit_storage.uniform_float_32_to_16.uniform_matrix_float_rtz_frag

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: 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/22314>
2023-04-11 11:01:31 +00:00
Corentin Noël
45a682650c mesa: Add EXT_instanced_arrays support
The support for ARB_instanced_arrays already exists for big GL, reuse the same
PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR for this extension.

The OES_draw_elements_base_vertex and EXT_draw_elements_base_vertex both define
the DrawElementsInstancedBaseVertex method when EXT_instanced_arrays is defined.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22167>
2023-04-11 10:22:35 +00:00
Corentin Noël
8aa4d37b83 glapi: Make EXT_draw_instanced functions available for GLES 2.0
The EXT suffixed functions should be available in the GLES 2.0 context.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22167>
2023-04-11 10:22:35 +00:00
Corentin Noël
b3793dc442 mesa: OpenGL ES 3.0 requires EXT_instanced_arrays
Add it to the list of the required extensions.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22167>
2023-04-11 10:22:35 +00:00
Lionel Landwerlin
cff71ae8ff anv: fixup streamout write barriers
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8796
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22336>
2023-04-11 09:53:10 +00:00
Konstantin Seurer
2bf9ae78c5 radv: Remove radv_bvh_aabb_node::aabb
It was only read by RRA which can infer it from the parenbt internal
node.

Change in average build time (Control):
84.69471 ms -> 84.25319 ms

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22400>
2023-04-11 07:57:34 +00:00
Konstantin Seurer
1ce50f0774 radv/bvh: Remove calculate_node_bounds
It is unused and will prevent removing the aabb field from
radv_bvh_aabb_node.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22400>
2023-04-11 07:57:34 +00:00
Konstantin Seurer
f791cd9e43 radv: Pack and encode geometry id and flags on the CPU
There is no need to do it on the GPU.

Change in average build time (Control):
84.80691 ms -> 84.69471 ms

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22400>
2023-04-11 07:57:34 +00:00
Konstantin Seurer
8391639b5f radv: Remove has_previous_stage
MESA_SHADER_NONE implies that has_previous_stage is false.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22382>
2023-04-11 06:24:17 +00:00
Konstantin Seurer
b4bae8a2c0 aco: Remove is_gs_copy_shader
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22382>
2023-04-11 06:24:17 +00:00
Konstantin Seurer
58ab783153 radv: Remove some dead radv_shader_args setup
radv_declare_shader_args already sets them up.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22382>
2023-04-11 06:24:17 +00:00
Konstantin Seurer
6f9bb453ef radv: Add radv_shader_type to fix gs_copy and trap handler handling
is_gs_copy_shader and is_trap_handler_shader were cleared in
radv_init_shader_args. This restores the original behaviour.

Fixes: 67635bb ("radv: zero-initialize radv_shader_args right before declaring them")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22382>
2023-04-11 06:24:17 +00:00
Alyssa Rosenzweig
c66be7521f nir/lower_blend: Enable per-sample shading
Loading output require per-sample blending, so enable per-sample execution of
the shader as a whole so the right sample values are blended. Affects:

dEQP-GLES31.functional.multisample.default_framebuffer.sample_mask_sum_of_inverses

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22385>
2023-04-11 04:16:32 +00:00
Alyssa Rosenzweig
a74c2ac403 nir/lower_blend: Set uses_fbfetch_output conservatively
Only insert a load_output if we're going to use it, don't rely on it getting
DCE'd since that will mess up the shader info. This does require a bit of logic
to figure out whether we do need it.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22385>
2023-04-11 04:16:32 +00:00
Alyssa Rosenzweig
d998217e17 mesa/st: Set uses_sample_shading when forcing per-sample
In addition to requiring per-sample interpolation, sample shading
changes the behaviour of gl_SampleMaskIn, so we need per-sample shading
even if there are no shader-in variables at all. In that case,
uses_sample_shading won't be set by glsl_to_nir. We need to do so here.

Affected dEQP test on asahi:

   dEQP-GLES31.functional.shaders.sample_variables.sample_mask_in.bits_unique_per_two_samples.multisample_texture_4

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22402>
2023-04-11 03:32:41 +00:00
Jesse Natalie
52ba7e967b d3d12: Support creating PSOs with no attachments with MSAA without TIR
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22402>
2023-04-11 03:32:41 +00:00
Yiwei Zhang
1fda55ba09 venus: forward ARM driverVersion for ANGLE workarounds
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22242>
2023-04-11 03:17:56 +00:00
David Heidelberg
590959057c ci/amd: raven is currently downgraded to 2 machines only, adapt
Revert when all 5 machines are back online.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22403>
2023-04-11 02:33:52 +00:00
David Heidelberg
d9ba47e8d4 ci/amd: update device status
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22403>
2023-04-11 02:33:52 +00:00
David Heidelberg
fe96bb8dcc Revert "mesa: Enable NV_texture_barrier in GLES2+"
Fixes failing skqp GLES test:
 - gles_lcdblendmodes

This reverts commit c7da969f8f.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22403>
2023-04-11 02:33:52 +00:00
Friedrich Vock
900d622d8e radv: Add RT stages to radv_mesa_to_rgp_shader_stages
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22367>
2023-04-11 02:00:15 +00:00
Mike Blumenkrantz
de70c0cf88 lavapipe: implement inline variant caching
inlining is great, but it's less great if a new variant must be created
for every draw

to avoid this, cache inlined variants for reuse

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22363>
2023-04-11 01:37:05 +00:00
Mike Blumenkrantz
9f5bb8992f lavapipe: don't double-inline ubo0
this was already handled above and causes negative indexing

cc: mesa-stable

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22363>
2023-04-11 01:37:05 +00:00
Alyssa Rosenzweig
7582752233 ci: Run clang-format on panfrost
So we don't regress formatting in the future. This should never really trigger
if people configure their editors correctly, but it can help avoid regressing
the formatting from drive-by patches.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22372>
2023-04-10 21:56:04 +00:00
Alyssa Rosenzweig
c7bf3b69eb panvk: Clang-format
We're going to enforce clang-format in CI, so get with the program! This doesn't
change a *ton* all considered, because panvk was already aiming for the style we
have in the panfrost clang-format file.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22372>
2023-04-10 21:56:04 +00:00
Alyssa Rosenzweig
4ccf174009 panfrost: Re-run clang-format
We've regressed the clang-formatting in a few places, since we're not enforcing
formatting in CI yet and I think at one point my editor wasn't quite right.
Reapply so we can get to clang-format-clean.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22372>
2023-04-10 21:56:04 +00:00
Alyssa Rosenzweig
0a67386b40 pan/decode: Move comment out of designated initializer
clang-format chokes on this.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22372>
2023-04-10 21:56:04 +00:00
Alyssa Rosenzweig
c90f036516 panfrost/winsys: Clang-format
This was missed in the original clang-format commit because I touch this code so
infrequently, lol.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22372>
2023-04-10 21:56:04 +00:00
Alyssa Rosenzweig
edb5b03cde panfrost/winsys: Add .clang-format for winsys folder
Last place where Panfrost code hides.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22372>
2023-04-10 21:56:04 +00:00
Alyssa Rosenzweig
74a31491ed panfrost: Symlink gallium .clang-format to common
So we only have one .clang-format file to worry about.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22372>
2023-04-10 21:56:04 +00:00
Alyssa Rosenzweig
e3105f93bd mailmap: Update my e-mail
https://rosenzweig.io/blog/passing-reins-panfrost.html

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22399>
2023-04-10 21:54:05 +00:00
Mike Blumenkrantz
d87756923d lavapipe: refactor/consolidate GPL shader copying
this is easier to read/modify

also add asserts for members that should be null

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22352>
2023-04-10 21:35:57 +00:00
Mike Blumenkrantz
e33fda3732 lavapipe: copy fragment shader when merging GPL pipelines
this otherwise loses access data and causes flakiness with atomic ops

Fixes: 6e5fe71599 ("lavapipe: split out shader struct members into their own struct")

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22352>
2023-04-10 21:35:57 +00:00
Timur Kristóf
14be6b084e radv: Don't include nir.h in radv_shader.h
Avoid recompiling some RADV files when something changes in NIR.
Also clean up a few other includes.

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/22241>
2023-04-10 20:01:28 +00:00
Timur Kristóf
2ff1267959 aco: Only include nir.h in instruction selection.
Don't recompile entire ACO when something changes in NIR.
Instead, only use some headers which are actually needed,
include these in ACO files instead of relying on nir.h to
include them.

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/22241>
2023-04-10 20:01:28 +00:00
Timur Kristóf
8e9d269da6 aco: Don't use nir_selection_control in aco_ir.
We don't want to rely on any NIR structures in ACO, because
we would like to avoid the need to include nir.h in aco_ir.

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/22241>
2023-04-10 20:01:28 +00:00
Timur Kristóf
cff02468c6 aco: Fix optimization of v_cmp with subgroup invocation.
There was a typo in this optimization which went unnoticed.

Fixes: 2c40215ab9
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22393>
2023-04-10 19:15:27 +00:00
Yiwei Zhang
57afa79933 venus: move exp feature init back to ring and remove unused function
This mostly undos 476c771e34 and removes
the unused vn_renderer_submit_simple_sync.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22323>
2023-04-10 18:59:40 +00:00
Yiwei Zhang
b285083cad venus: requires ringMonitoring
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22323>
2023-04-10 18:59:40 +00:00
Yiwei Zhang
5fcb2830e6 venus: requires asyncRoundtrip
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22323>
2023-04-10 18:59:40 +00:00
Jesse Natalie
3cbd4fb61b dzn: Don't enable bindless by default
There's bad interactions with dynamic buffers at this point:
* Perf issues due to allocating and freeing the buffer to store indices/offsets
* Large dynamic uniform buffer offsets (above 65K) cause out-of-bounds reads

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22371>
2023-04-10 18:43:12 +00:00
Jesse Natalie
4d142ec594 dzn: Never set STATE_RENDER_TARGET on a compute command list
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22371>
2023-04-10 18:43:12 +00:00
Jesse Natalie
5aca593262 dzn: Ignore unnormalized sampling flag if driver doesn't support it
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22371>
2023-04-10 18:43:12 +00:00
Jesse Natalie
51c96cb745 dzn: Use a linear allocator for upload data on command buffers
Significantly improves performance for apps that heavily use
dynamic descriptors.

Still needs caching so they can be re-used after command buffer reset.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22371>
2023-04-10 18:43:12 +00:00
Jesse Natalie
0c2848f44a dzn: Changes to descriptor set dirty flag handling
The scenario of:
* App binds multiple descriptor sets
* App binds a pipeline that uses a subset of them
* App binds a pipeline that uses more of them

was broken. We were only copying the descriptors for the accessible
subset before, but then clearing all dirty bits, so simply changing
the pipeline wouldn't result in more descriptors being copied.

When running not-bindless, the right thing to do is to copy *all*
descriptors if we're copying any. When running bindless, each parameter
is set separately, and more importantly, *can't* be set on the command
list if the root signature can't access them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22371>
2023-04-10 18:43:12 +00:00
Jesse Natalie
01ccba0d8e microsoft/compiler: Don't split loads/stores that will be split by lower_explicit_io
Otherwise we can end up splitting push constant loads, which currently require
an unbroken (no-cast) deref chain up to the variable.

Fixes: 4c527f4f ("spirv2dxil: Lower unaligned loads and stores")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22371>
2023-04-10 18:43:12 +00:00
Samuel Pitoiset
642a88df3d docs: add more release notes for RADV
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22390>
2023-04-10 18:37:26 +00:00
Rhys Perry
bb653b0acb nir: make nir_fisnan helper exact
Floating point ALU assume no NaNs unless
FLOAT_CONTROLS_SIGNED_ZERO_INF_NAN_PRESERVE_FPn or (for some opcodes)
exact=true.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes: bf9c1699cd ("nir: add nir_fisnan helper function")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22206>
2023-04-10 17:42:24 +00:00
Vitaliy Triang3l Kuzmin
a6ab0cff08 radv: Set DB_Z_INFO.NUM_SAMPLES to MSAA_EXPOSED_SAMPLES without Z/S
This case is a new addition in GFX11, and according to PAL, when no
depth/stencil attachment is bound, it must be set to the number of coverage
samples (the number of SampleMask bits - which is MSAA_EXPOSED_SAMPLES):

4640888b57/src/core/hw/gfxip/gfx9/gfx9UniversalCmdBuffer.cpp (L6978)

Without this change, the maximum of depth/stencil and color sample counts
is used, and if there are no depth/stencil or color attachments (target-
independent rasterization), the Depth Block assumes 1 coverage sample, and
thus Primitive Ordered Pixel Shading doesn't work correctly (and fails 4xAA
fragment shader interlock CTS tests), and occlusion queries don't count the
correct number of samples (according to the "Sample Counting" section of
the Vulkan specification, "the occlusion query sample counter increments by
one for each sample with a coverage value of 1...")

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22375>
2023-04-10 15:07:30 +00:00
Mike Blumenkrantz
75a7dcf35f zink: try to prune resources from barrier jit on fb unbind
if a resource has no binds remaining then it should not remain in
the queue for barrier updates on the next draw

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22398>
2023-04-10 14:44:13 +00:00
André Almeida
871aa64e53 winsys/amdgpu: Fix amdgpu_cs_query_reset_state2 error log
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: André Almeida <andrealmeid@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22253>
2023-04-10 13:50:36 +00:00
André Almeida
ad4a72c11e radv: Implement vk.check_status
Implement check_status function so the driver can check if the GPU has
been reset by the application, and thus if it's still available.

AMDGPU_CTX_QUERY ioctls work by asking amdgpu if this context was the
cause of a previous GPU reset.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: André Almeida <andrealmeid@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22253>
2023-04-10 13:50:36 +00:00
Samuel Pitoiset
c8949db0cc radv/ci: update expected failures with BONAIRE
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22391>
2023-04-10 11:47:15 +00:00
Samuel Pitoiset
18ea108038 radv/ci: remove no longer existing tests for PITCAIRN
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22366>
2023-04-10 10:53:47 +00:00
Samuel Pitoiset
d3e5a1f638 radv/ci: update expected failures for PITCAIRN
These have been recently fixed.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22366>
2023-04-10 10:53:47 +00:00
Samuel Pitoiset
6476abd821 radv: enable VK_EXT_graphics_pipeline_library by default
You won't get your money back!

It's been a very long time but everything should be working great now.

This replaces RADV_PERFTEST=gpl by RADV_DEBUG=nogpl to disable the
extension for debugging purposes.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22362>
2023-04-10 10:02:32 +00:00
Daniel Schürmann
719a0e269e vulkan/pipeline_cache: move vk_log on failed deserialization to vk_pipeline_cache_load()
Partially evicted or corrupted disk cache entries should not create
application cache log entries.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21967>
2023-04-10 09:14:30 +00:00
Daniel Schürmann
53eb3ad375 vulkan/pipeline_cache: add cache parameter to deserialize() function
This allows for secondary cache lookups during deserialization.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21967>
2023-04-10 09:14:30 +00:00
Daniel Schürmann
a6360a3203 vulkan/pipeline_cache: use vk_pipeline_cache_create_and_insert_object() during vk_pipeline_cache_load()
This avoids an extra serialize() step for disk-cache insertion.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21967>
2023-04-10 09:14:30 +00:00
Daniel Schürmann
f524f91d6f vulkan/pipeline_cache: implement vk_pipeline_cache_create_and_insert_object()
This function directly inserts the serialized data into the disk cache
before calling deserialize() and inserting into the pipeline cache.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21967>
2023-04-10 09:14:30 +00:00
Daniel Schürmann
84fa7b1745 vulkan/pipeline_cache: Don't re-insert disk-cache hits into disk-cache
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21967>
2023-04-10 09:14:30 +00:00
Daniel Schürmann
5daff41e27 vulkan/pipeline_cache: remove vk_device from vk_pipeline_cache_object
It is not necessary to store the extra pointer.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21967>
2023-04-10 09:14:30 +00:00
David Heidelberg
4ac56e3e5a ci/v3d: add flaking spec@ext_framebuffer_blit@fbo-sys-blit
Flakes on both RPI 3 and RPI 4.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22377>
2023-04-08 22:24:47 +02:00
Timur Kristóf
ba537ac25a ac/llvm: Cover runtime 0 in GFX10 gs_alloc_req workaround.
Previously, the workaround only covered compile-time zero, but
this is insufficient and can cause GPU hangs in RadeonSI when
NGG culling is enabled.

Fix this by handling runtime zero in the workaround.

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/22370>
2023-04-08 13:54:06 +00:00
Adam Jackson
c7da969f8f mesa: Enable NV_texture_barrier in GLES2+
The spec text is written against 3.2 but only requires framebuffer
objects and ES2.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19234>
2023-04-08 06:10:44 +00:00
Kenneth Graunke
98bcf650f1 intel/compiler: Use nir_dest_bit_size() for ballot bit size check
There's no guarantee that this is a SSA value.  Use the helper to handle
both SSA values and register correctly.  Otherwise we read trash when we
encounter a register and make bad decisions on types, possibly leading
to our destination being UQ typed when the VGRF is only 32-bit.

Fixes compilation with -Dintel-clc=enabled since 7f6491b76d
(nir: Combine if_uses with instruction uses) but the bug is much older
than that, circa 2017.  We were just getting lucky before.

Fixes: 069bf7c907 ("i965/fs: Match destination type to size for ballot")
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22374>
2023-04-07 19:28:56 -07:00
Alyssa Rosenzweig
f5471ca965 nir/validate: Only walk uses once
Ostensibly faster.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
Alyssa Rosenzweig
9a35079074 nir/repair_ssa: Refactor some use handling
We can mostly unify the instr-use and if-use handling, which is a lot more
concise.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
Alyssa Rosenzweig
dcb59a7672 nir: Remove nir_if_rewrite_condition_ssa
Now unused.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
Alyssa Rosenzweig
ed85a49727 dxil: Use nir_src_rewrite_ssa
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
Alyssa Rosenzweig
e25c182993 nir: Use nir_src_rewrite_ssa
Where sensible.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
Alyssa Rosenzweig
e9e0956d62 nir: Factor out nir_src_rewrite_ssa helper
Like nir_instr_rewrite_ssa but without the asserted extra argument. Works on ifs
too, now that we have a unified use list.

We do need to assert that the source has actually been inserted and has valid
use/def chains. Previously, asserting on the parent instruction accomplished
that indirectly. For the more general helper, we instead directly assert that
there exists a non-null parent, whatever it is.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
Alyssa Rosenzweig
2285b5daae nir: Reduce indirection
A source used by an if is necessarily the condition of that if.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
Alyssa Rosenzweig
373bd37b85 dxil: Avoid list_length
Do O(1) check instead.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
Alyssa Rosenzweig
c4a91c12dc nir/validate: Don't treat if-uses specially
We don't use the tag anywhere, so don't bother with it.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Suggested-by: Faith Ekstrand <faith@gfxstrand.net>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
Alyssa Rosenzweig
f3b420692b nir: Remove 2nd argument from nir_before_src
We can now determine whether a nir_src is for an if without a sideband, so
simplify the function signature.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Suggested-by: Faith Ekstrand <faith@gfxstrand.net>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
Alyssa Rosenzweig
8505f0bd84 nir/opt_loop_unroll: Avoid list_length
It is O(N) but can often be replaced with something O(1).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
Alyssa Rosenzweig
7356f3eee7 nir/opt_ray_queries: Don't use list_length
Expensive.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
Alyssa Rosenzweig
7f6491b76d nir: Combine if_uses with instruction uses
Every nir_ssa_def is part of a chain of uses, implemented with doubly linked
lists.  That means each requires 2 * 64-bit = 16 bytes per def, which is
memory intensive. Together they require 32 bytes per def. Not cool.

To cut that memory use in half, we can combine the two linked lists into a
single use list that contains both regular instruction uses and if-uses. To do
this, we augment the nir_src with a boolean "is_if", and reimplement the
abstract if-uses operations on top of that list. That boolean should fit into
the padding already in nir_src so should not actually affect memory use, and in
the future we sneak it into the bottom bit of a pointer.

However, this creates a new inefficiency: now iterating over regular uses
separate from if-uses is (nominally) more expensive. It turns out virtually
every caller of nir_foreach_if_use(_safe) also calls nir_foreach_use(_safe)
immediately before, so we rewrite most of the callers to instead call a new
single `nir_foreach_use_including_if(_safe)` which predicates the logic based on
`src->is_if`. This should mitigate the performance difference.

There's a bit of churn, but this is largely a mechanical set of changes.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
Alyssa Rosenzweig
fd9c69218a tu: Use vk_features2_to_features
Sanitizes properties returned through GetPhysicalDeviceFormatProperties2.

Bit-31 is not valid to return in the original
vkGetPhysicalDeviceFormatProperties{2,}. Sanitize the bit returned from the
internal to ensure invalid bits aren't return to the application.

Falls in line with the other vulkan drivers.

Based on original commit by Ryan Houdek.

Closes: #8733
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22217>
2023-04-07 18:16:43 -04:00
Alyssa Rosenzweig
4fa2924610 anv,hasvk: Use vk_features2_to_features
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22217>
2023-04-07 18:16:40 -04:00
Alyssa Rosenzweig
672a06a1b6 pvr: Use vk_features2_to_features
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22217>
2023-04-07 18:16:40 -04:00
Alyssa Rosenzweig
c517d45341 lavapipe: Use vk_features2_to_features
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22217>
2023-04-07 18:16:40 -04:00
Alyssa Rosenzweig
b222b02d3d v3dv: Use vk_features2_to_features
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22217>
2023-04-07 18:16:40 -04:00
Alyssa Rosenzweig
a7389f6894 radv: Use vk_features2_to_features
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22217>
2023-04-07 18:16:40 -04:00
Alyssa Rosenzweig
657e82a72f vulkan: Add common features2_to_features
Needed to correctly implement GetPhysicalDeviceFormatProperties2.

Cc stable so the turnip patch can get backported cleanly.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22217>
2023-04-07 18:16:27 -04:00
Mike Blumenkrantz
6894548d6c Revert "zink: don't trigger shader variants on pcp change if driver supports dynamic pcp"
This reverts commit 472fcf74e2.

this is sort of right but then also sort of broken, going to rework a little

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22368>
2023-04-07 20:22:11 +00:00
Samuel Pitoiset
79655e2ea8 radv: copy stages instead of serializing NIR for GPL with the RETAIN flag
When the driver gets a cache hit for the binary, we still have to
retain shaders because we can't know if the LTO pipeline will be a
cache hit as well.

Though, serializing the NIR is too costly and most of the libraries
took more than 10ms to be created, which isn't acceptable. To fix this,
keep track of the shaders stage info for libs with the RETAIN flag.

This might be replaced by NIR caching later if it's worth a try.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22327>
2023-04-07 19:43:05 +00:00
Samuel Pitoiset
edb198e0b1 radv: create a helper for copying VkPipelineShaderStageCreateInfo
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22327>
2023-04-07 19:43:05 +00:00
Samuel Pitoiset
6181ba11d5 radv/rt: stop storing unused hashes/identifiers
This is never used.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22327>
2023-04-07 19:43:05 +00:00
antonino
a782393b1a zink: fix sampler array collision in nir_to_spirv
`nir_to_spirv` has flat arrays to map driver_location to sampler
variables.

Now when bindless textures are used together with non binless textures
the sampler vars are in different descriptor sets and the binding can be
the same between different descriptor sets, this causes a collision in
arrays.

This patches chamges `nir_to_spirv` to also index the array by whether
the texture is bindless.

Fixes: bc202553e9 ("zink: implement bindless textures")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22358>
2023-04-07 19:25:08 +00:00
antonino
4579fe5fad zink: add descriptor_bindless_id to zink_shader_info
This field stores the id of the descriptor set used for bindless
textures.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22358>
2023-04-07 19:25:08 +00:00
Jesse Natalie
c0c16d1ae2 dzn: Remove xfail for test that passes (if run)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22346>
2023-04-07 19:11:11 +00:00
Jesse Natalie
e4da9c2dfc dzn: Support >2K samplers with bindless
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22346>
2023-04-07 19:11:11 +00:00
Jesse Natalie
b269c206c1 dzn: Remove skips now that WARP is faster
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22346>
2023-04-07 19:11:11 +00:00
Jesse Natalie
16e70708ba dzn: Don't leave deleted physical devices in the instance pdev list
Fixes: cfa260cd ("dzn: Use common physical device list/enumeration helpers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22346>
2023-04-07 19:11:11 +00:00
Jesse Natalie
71dbb3120a dzn: Use GetResourceAllocationInfo3 for castable formats
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22346>
2023-04-07 19:11:11 +00:00
Jesse Natalie
4fad8931f5 dzn: Clean up ABI helpers now that we require DirectX-Headers 606
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22346>
2023-04-07 19:11:11 +00:00
Jesse Natalie
33051f1eb4 dzn: Early-out on no-op barriers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22346>
2023-04-07 19:11:11 +00:00
Mike Blumenkrantz
472fcf74e2 zink: don't trigger shader variants on pcp change if driver supports dynamic pcp
this otherwise pointlessly creates and binds shader variants that do nothing

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22365>
2023-04-07 18:32:34 +00:00
Mike Blumenkrantz
172054e305 zink: reuse copy_vars for generated tcs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22364>
2023-04-07 17:44:29 +00:00
Mike Blumenkrantz
762a29279b zink: reuse d3d12 variable copying to make passthrough gs more robust
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22364>
2023-04-07 17:44:29 +00:00
Felix DeGrood
4dc7256bf9 anv: reset query pools using blorp
Previously we used PC to set query data to 0 during
CmdResetQueryPool. This was slow when clearing large query pools.
Switching to blorp to clear pools is faster for large query pools.

Red Dead Redemption 2: +1.5% speedup

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22178>
2023-04-07 15:51:20 +00:00
Lionel Landwerlin
bb49610973 anv: replace query flush before gpu copy by semaphore wait
All the flushes should already have happened, we just need CS to wait
for the operations to complete. Just use a MI_SEMAPHORE_WAIT to check
the availability bit is set.

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/22178>
2023-04-07 15:51:20 +00:00
Lionel Landwerlin
abc4111d19 anv: pass steam output as argument for anv_dump_pipe_bits
Just if you need to change it at some point ;)

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/22178>
2023-04-07 15:51:20 +00:00
Felix DeGrood
2415d57a99 anv/blorp: add flush reasons to RT flushes
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22178>
2023-04-07 15:51:20 +00:00
Felix DeGrood
43f93f5043 anv/blorp: implement anv_cmd_buffer_fill_area
Implemented function to fill an area at an address.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22178>
2023-04-07 15:51:20 +00:00
Felix DeGrood
0130a4f667 anv/blorp: support surf generation for addresses
Already have support for anv_buff. Extended to support addresses.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22178>
2023-04-07 15:51:20 +00:00
Raun
9d38c9ca2f dzn: Enable VK_KHR_get_memory_requirements2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22349>
2023-04-07 15:35:10 +00:00
Raun
a9a0dc3cca dzn: Enable VK_KHR_bind_memory2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22349>
2023-04-07 15:35:10 +00:00
Samuel Pitoiset
bcd33d2937 radv: import retained NIR shaders later in the compilation process
This allows us to remove the intermediate NIR shader pointer.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22356>
2023-04-07 14:38:46 +00:00
Samuel Pitoiset
e909764930 radv: do not retain noop FS for libs when a cache hit happened
Determine if the graphics pipeline needs a noop FS later instead of
retaining it. This was also suboptimal.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22356>
2023-04-07 14:38:46 +00:00
Samuel Pitoiset
34fa60e138 radv: simplify a check when retaining NIR shaders
The RETAIN flag is only allowed with graphics libs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22356>
2023-04-07 14:38:46 +00:00
Samuel Pitoiset
3b5ea90f1d radv: move the serialized NIR to radv_graphics_lib_pipeline
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22356>
2023-04-07 14:38:46 +00:00
Samuel Pitoiset
4672c6c43b radv: add a helper for retaining NIR shaders
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22356>
2023-04-07 14:38:46 +00:00
Mike Blumenkrantz
dc18570c0a zink: don't access non_fs part of zink_shader from fs
Fixes: a6de15eff5 ("zink: add flags to `zink_gfx_program` and `zink_context`")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22347>
2023-04-07 13:10:03 +00:00
Mike Blumenkrantz
215beee16d zink: more explicitly track/check rp optimizing per-context
if tc creation fails for whatever reason, rp optimizing must be
marked as disabled for that context to avoid erroneous assumptions
about rp operation

fixes #8787

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22319>
2023-04-07 12:29:56 +00:00
Qiang Yu
2c78cbbfe1 ac/llvm: remove some unused code replaced by nir
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/22304>
2023-04-07 03:42:25 +00:00
Qiang Yu
a2cecbbc44 ac/nir/ngg: fix store shared alignment
For stream!=0, this align_mul=4 is not true. Not observe any
problem yet, just for correctness.

Fixes: 60ac5dda82 ("ac: Add NIR lowering for NGG GS.")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
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/22304>
2023-04-07 03:42:25 +00:00
Qiang Yu
c082cdacae ac/nir/ngg: fix gs culling vertex liveness check for odd vertices
If vertex does not complete a primitive, it should not set the odd
flag which miss lead liveness check when culling is enabled.

For example, if odd flag is set regardless of complete flag, when
culling is enabled, 3 vertices of a triangle's init prim flag:
  [0x00 0x04 0x01]

then after culling, this triangle has been culled, their prim flag:
  [0x00 0x04 0x00]

the second vertex is miss treat as live because its odd flag (code
check prim_flag!=0 for liveness).

Fixes: 1bdeb961bd ("ac/nir/ngg: add gs culling")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8725
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/22304>
2023-04-07 03:42:25 +00:00
Qiang Yu
fc3d8e1125 radeonsi: fix max scrach lds size calculation when ngg
Fixes: 028d0590f8 ("radeonsi: replace llvm ngg vs/tes with nir lowering")
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/22304>
2023-04-07 03:42:25 +00:00
Asahi Lina
9fcadd0c8d asahi: Allow explicit non-LINEAR modifiers for scanout
The compositor is responsible for picking the right supported modifiers
for scanout. If we get no modifiers, we have to assume linear, but if we
do, just roll with it and don't attempt to force things.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina
534a04d557 asahi: Flip kmsro around to allocate on the GPU
Our display controller can handle arbitrary GPU imports, so there is no
reason to use dumb KMS buffers. Allocate everything on the GPU instead.

This also allows us to be lazy about mapping things to the KMS side, so
only clients that really want a KMS handle actually do that, which stops
us from ending up with a bunch of junk mapped to DCP (e.g. X11 clients
always request SCANOUT even under XWayland).

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina
9db36376a6 asahi: Fix compressed ZS support
Depth/stencil formats are "not renderable" but do support compression.

I swear I already fixed this at some point and the commit must've fallen
through the cracks...

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina
2296f69629 asahi: Print reasons why compression is disabled
For resource debug. Found a regression in compressed depth this way.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina
888d443f29 asahi: Add resource debugging
I keep re-implementing this every time I look at resource-related
issues. Let's just make it official so we can turn it on with a flag
instead of having to add printfs every time ^^

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina
0a132b0640 asahi: Add a helper macro for debug/error messages
This includes the program short name in the message, which is useful
when running entire desktop sessions with a single log to figure out who
is doing what.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina
883ba4b161 asahi: Make BO import path failures more robust
These operations can fail for complex reasons through no fault of mesa,
so we should have proper runtime checks for them even in release builds.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina
fcf594d00b asahi: Implement valid buffer range tracking
A common pattern is to allocate a vertex/etc buffer and write to it in
subsets. Some games interleave this with draw calls using the buffer.
This causes very expensive flushing for every draw call.

Fix this by tracking which range of a buffer has been written to, and
elide syncs when the range was previously uninitialized.

Fixes Source engine game performance and probably helps a bunch of
others.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina
00064ba4e3 asahi: Fix style nits
Found with a grep abomination which is probably too broken/silly to
actually implement in CI... but hey, at least it found some.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina
a88b9c5540 asahi: Locate low VA BOs correctly
These need the shader_base added to them.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina
030b2306a4 asahi: Enable glthread
This helps a lot with FEX, since the GPU driver runs emulated (and only
64bit supports thunking).

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina
4a5115c47b asahi: Make agx_alloc_staging() take a screen instead of a context
This makes it clear that it is thread-safe.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina
75e3212809 Revert "asahi: Advertise dual-source blending"
This reverts commit f4e2b22646.

This is broken until GL3 is enabled, possibly due to a core Mesa bug,
but it's a corner case not worth fixing.

Fixes Chromium.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Alyssa Rosenzweig
8a6d74d15b agx: Make signal_pix instructions explicit
Rather than implicitly packing them with the sample_mask. Again, this is just
changing where they're emitted, no functional changes yet. Bug for bug
compatibility with the old behaviour.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Alyssa Rosenzweig
bb530760a2 agx: Rename writeout to wait_pix
This is the name applegpu is currently using, to capture the semantics of a
pixel fence. I'm not sure what Apple calls this but wait_pix is closer than
writeout for sure.

This commit just does the rename. It doesn't fix the broken semantics we've had,
this is to ease review and bisection.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Alyssa Rosenzweig
2028e7b88b agx: Tease apart some sample_mask packing magic
There's a second instruction here, and a second source in the first instruction.
applegpu has known about the encodings for a while but I never updated the
packing code. We will need to stop hardcoding this for multisampling support, as
preparation tease apart the magic pieces.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Alyssa Rosenzweig
13b3da822b asahi: Clamp texture buffer sizes
Per the spec / freedreno. Fixes
arb_texture_buffer_object-texture-buffer-size-clamp

Fixes: 6b22a02f90 ("asahi,agx: Implement buffer textures with gnarly NIR")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Alyssa Rosenzweig
c4175c5fc8 asahi: Dirty track depth bias uploads
Reduces how much we upload in SuperTuxKart.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Alyssa Rosenzweig
23880daa8d asahi: Lower 1D to 2D
Khronos APIs require that we support mipmapping even for 1D textures. However,
it isn't clear if this is supported in the hardware, and how it would work even
if it is. But 1D textures are pretty useless, so we just lower 1D textures to 2D
textures instead of worrying about that.

Fixes piles of Piglits relating to 1D textures.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
098295f1a0 asahi: Implement null textures
Use the same silly workaround that Metal does, to fill in texture descriptors
when there's nothing bound in the interest of robust behaviour.

Fixes null pointer dereference in
arb_shading_language_420pack-active-sampler-conflict.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
1fb4e34020 asahi: Honour sampler count
It may not be equal to the texture count. Prevents a regression from the next
commit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
203c9c12e2 agx: Don't overallocate registers
We need to account for the full vector lengths. Especially important once we
start restricting the reg file.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
42c5d6140b agx: Coalesce more collects
Try harder to coalesce collects, by trying to allocate collects only to regions
of the register file where we actually have a full vector worth of registers
free. If we already know that the vector will be blocked later, it's not a good
base register to pick since we'd be force to shuffle later. So, this tweak to
the collect coalescing heuristic lets us eliminate a pile of pointless copying.

shader-db results are excellent. Note that, although we use more registers,
none of the shaders tested had their thread count affected, likely because the
max HURT isn't too high and most of the scary % here is from using a few more
registers when the register pressure is already low. In the near future, that
property will become guaranteed thanks to live range splitting, too.

total instructions in shared programs: 1507337 -> 1500562 (-0.45%)
instructions in affected programs: 428137 -> 421362 (-1.58%)
helped: 2658
HURT: 167
helped stats (abs) min: 1.0 max: 34.0 x̄: 2.63 x̃: 2
helped stats (rel) min: 0.10% max: 25.00% x̄: 3.04% x̃: 2.14%
HURT stats (abs)   min: 1.0 max: 10.0 x̄: 1.24 x̃: 1
HURT stats (rel)   min: 0.20% max: 23.81% x̄: 3.90% x̃: 3.57%
95% mean confidence interval for instructions value: -2.49 -2.31
95% mean confidence interval for instructions %-change: -2.76% -2.51%
Instructions are helped.

total bytes in shared programs: 10333670 -> 10293172 (-0.39%)
bytes in affected programs: 2996682 -> 2956184 (-1.35%)
helped: 2660
HURT: 175
helped stats (abs) min: 2.0 max: 204.0 x̄: 15.70 x̃: 12
helped stats (rel) min: 0.08% max: 23.08% x̄: 2.64% x̃: 1.83%
HURT stats (abs)   min: 2.0 max: 60.0 x̄: 7.26 x̃: 6
HURT stats (rel)   min: 0.12% max: 22.39% x̄: 3.19% x̃: 2.78%
95% mean confidence interval for bytes value: -14.81 -13.76
95% mean confidence interval for bytes %-change: -2.39% -2.18%
Bytes are helped.

total halfregs in shared programs: 417284 -> 427363 (2.42%)
halfregs in affected programs: 49814 -> 59893 (20.23%)
helped: 95
HURT: 3018
helped stats (abs) min: 1.0 max: 8.0 x̄: 2.29 x̃: 2
helped stats (rel) min: 2.44% max: 28.57% x̄: 9.20% x̃: 6.06%
HURT stats (abs)   min: 1.0 max: 14.0 x̄: 3.41 x̃: 4
HURT stats (rel)   min: 2.08% max: 150.00% x̄: 36.54% x̃: 27.27%
95% mean confidence interval for halfregs value: 3.17 3.31
95% mean confidence interval for halfregs %-change: 34.05% 36.23%
Halfregs are HURT.

total threads in shared programs: 16465280 -> 16465280 (0.00%)
threads in affected programs: 0 -> 0
helped: 0
HURT: 0

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
43b221cd59 asahi: Set PIPE_CAP_LOAD_CONSTBUF
The CAP is a bit of a misnomer, what it really does is relax the alignment
requirements for UBO packing. It should work fine and save us some memory.
Noticed while debugging piglit fails.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
8e501b758a asahi/decode: Print VDM barriers
Instead of just decoding silently.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
0bbd8b502a asahi/decode: Remove agxdecode_dump_bo
Now that we have proper parsing this is more of a nuissance than not.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
e713983875 agx: Add helper for calculating occupancy
Add information about the relationship between program register usage and
program occupancy (the maximum number of threads that may execute concurrently
on a single shader core). This table is derived from studying the
maxTotalThreadsPerThreadgroup property in Metal while varying the register
usage, something I blogged about a few years back. It's probably not 100%
accurate and it hasn't been tested against hardware, but it matters "only" for
performance (not correctness) so I'm not super stressed about the details.

In the (near) future, RA will be able to make use of this information to know
exactly when it can use more registers without hurting performance. In the
present, it's just used for better shader-db statistics.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
05e614cc31 agx: Set loads_varying accurately
Instead of just always mashing to true. Should be better for depth-only passes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
80adaa47e5 asahi: Add perf debug for shader variants
Compiling this can cause jank. This is still an issue in Quake3. There is a way
to solve it but it's rather involved and certainly not this weekend's project.
Better perf debugging on the other hand apparently is ^_^

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
3a4920e928 asahi: Add perf debug for generate_mipmap
The current implementation leaves a lot of perf on the table, so call it out on
ASAHI_MESA_DEBUG=perf to help debugging perf problems, especially if this
ever happens in a real application (i.e. not a benchmark).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
3a87d2cfbd agx: Don't destroy usub_sat with constant
Fixes KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-cs-std430-vec-pad

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
8ec91ee16f agx: Don't allow uniform source to local_atomic
Fixes KHR-GLES31.core.compute_shader.atomic-case3

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
c643f42dc6 agx: Constify agx_{read,write}_registers
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
da9c8a4627 agx: Assert that we don't overflow registers
This will become particularly important when we bound to smaller register files.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
7c7b95ba2a agx: DCE even with noopt
To simplify live range splitting, RA will soon assume that DCE has run (removing
extraneous vectors). So run DCE even when otherwise disabling backend
optimizations. AGX_MESA_DEBUG=noopt is still useful for disabling instruction
combining, which is the more-likely-to-be-buggy pass anyway.

This also fixes IR not being printed with noopt.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
75b858e904 asahi: Support more renderable formats
Fixes KHR-GLES3.copy_tex_image_conversions.forbidden.*

Arguably working around a mesa/st issue but more format support is good for
compatibility and performance anyway.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Janne Grunau <j@jannau.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Yiwei Zhang
fc22380c32 venus/docs: sync to latest venus supported extensions
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22243>
2023-04-07 03:05:02 +00:00
Yiwei Zhang
bb7424b4b4 venus: add VK_EXT_rasterization_order_attachment_access support
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22243>
2023-04-07 03:05:02 +00:00
Yiwei Zhang
9c19d426cd venus: add VK_EXT_load_store_op_none support
There's no feature/properties structs associated with this extension.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22243>
2023-04-07 03:05:02 +00:00
Yiwei Zhang
303a2136a4 venus: sync latest protocol for layering extensions
- VK_EXT_load_store_op_none
- VK_EXT_rasterization_order_attachment_access

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22243>
2023-04-07 03:05:02 +00:00
Sajeesh Sidharthan
ab3507691a radeonsi/vcn: optimize bitstream buffer resize logic
bitstream buffer is unmapped, resized and mapped again if new size
is greater than the current bitstream buffer size. This will be done
for each input buffer. This patch will avoid that and do resize
only once irrespective of number of input buffers. With the new logic,
total size is calculated first and call unmap, resize and map only once.

Signed-off-by: Sajeesh Sidharthan <sajeesh.sidharthan@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Reviewed-by: Veerabadhran Gopalakrishnan <Veerabadhran.Gopalakrishnan@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22308>
2023-04-07 02:31:24 +00:00
Alyssa Rosenzweig
d1b569d26f nir/print: Don't print sampler_index for txf
NIR's docs for sampler_index say

    The following operations do not require a sampler and, as such, this
    field should be ignored:
       - nir_texop_txf
       - nir_texop_txf_ms
       - nir_texop_txs
       - nir_texop_query_levels
       - nir_texop_texture_samples
       - nir_texop_samples_identical

Contrary to this documentation, we were still printing the sampler_index anyway,
even though the value is formally undefined. This was helpful for
PIPE_CAP_TEXTURE_BUFFER_SAMPLER drivers that (despite the NIR docs) respected the
sampler_index anyway. There are no longer any such drivers, so we should stop
printing sampler_index for txf to avoid confusion (and noise).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22223>
2023-04-07 01:15:41 +00:00
Alyssa Rosenzweig
a9f9953928 docs/gallium: Note samplers are not used for txf
Now that PIPE_CAP_TEXTURE_BUFFER_SAMPLER is gone, txf does not require samplers
for any texture on any Gallium driver. NIR already requires drivers to ignore
sampler_index for non-sampler operation (mainly txf), and nowadays all Gallium
drivers ingest NIR. So, document that samplers aren't bound for txf (etc) as
part of the Gallium frontend-driver contract.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Suggested-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22223>
2023-04-07 01:15:41 +00:00
Alyssa Rosenzweig
6ba29d37c8 gallium: Remove PIPE_CAP_TEXTURE_BUFFER_SAMPLER
No more users. It was already not respected by rusticl so you couldn't set it if
you wanted OpenCL support. I regret introducing the CAP in the first place, and
no more drivers should use it.

Reverts d5d3f77e4a ("gallium: Add new cap PIPE_CAP_TEXTURE_BUFFER_SAMPLER").

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22223>
2023-04-07 01:15:41 +00:00
Alyssa Rosenzweig
e406e74aa4 panfrost: Unset TEXTURE_BUFFER_SAMPLERS
We no longer need this CAP, as we can easily synthesize our own internal sampler
for this case. Gallium doesn't need to know about this quirk of our hardware.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22223>
2023-04-07 01:15:41 +00:00
Alyssa Rosenzweig
b9cc2b2a98 pan/{mdg,bi}: Always use sampler 0 for txf
Now that we upload workaround samplers for txf, sampler 0 is guaranteed to be
valid but other samplers are not. So ignore whatever the current sampler_index
value is (it's formally undefined in NIR) and use 0, which we know is valid. We
already do this on Valhall for OpenCL, just need to generalize for Midgard and
Bifrost.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22223>
2023-04-07 01:15:41 +00:00
Alyssa Rosenzweig
e15603bdf1 panfrost: Always upload a workaround sampler
The hardware requires a valid sampler even for texelFetch (txf), even though its
contents are ignored. We'd rather not pass on this requirement to the frontends,
so we should handle it by uploading our own workaround sampler in the case when
no sampler is already present. We already do this on Valhall (for rusticl), so
we just need to port the same workaround back to Midgard/Bifrost.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22223>
2023-04-07 01:15:40 +00:00
Mike Blumenkrantz
06bfe07212 zink: don't try copying multiple results for conditional render copy
conditional render is only a single result, so multiple results need
to first be aggregated

fixes #8798

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22345>
2023-04-07 00:52:27 +00:00
Ian Romanick
72a9d12c96 nir/tests: Port almost all loop_analyze tests to new macro-based infastructure
The one test that remains would have an automatically generated name
that would conflict with another test. This test is also a little
special (per the comment in the test), so it's probably best to leave it
separate anyway.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3445>
2023-04-06 23:50:27 +00:00
Yevhenii Kolesnikov
9427aaeab7 nir/loop_analyze: Determine iteration counts for more kinds of loops
If loop iterator is incremented with something other than regular
addition, it would be more error prone to calculate the number of
iterations theoretically. What we can do instead, is try to emulate the
loop, and determine the number of iterations empirically.

These operations are covered:
 - imul
 - fmul
 - ishl
 - ishr
 - ushr

Also add unit tests for loop unrollment.

Improves performance of Aztec Ruins (sixonix
gfxbench5.aztec_ruins_vk_high) by -1.28042% +/- 0.498555% (N=5) on Intel
Arc A770.

v2 (idr): Rebase on 3 years. :( Use nir_phi_instr_add_src in the test
cases.

v3 (idr): Use try_eval_const_alu in to evaluate loop termination
condition in get_iteration_empirical. Also restructure the loop
slightly. This fixed off by one iteration errors in "inverted" loop
tests (e.g., nir_loop_analyze_test.ushr_ieq_known_count_invert_31).

v4 (idr): Use try_eval_const_alu in to evaluate induction variable
update in get_iteration_empirical. This fixes non-commutative update
operations (e.g., shifts) when the induction varible is not the first
source. This fixes the unit test
nir_loop_analyze_test.ishl_rev_ieq_infinite_loop_unknown_count.

v5 (idr): Fix _type parameter for fadd and fadd_rev loop unroll
tests. Hopefully that fixes the failure on s390x. Temporarily disable
fmul. This works-around the revealed problem in
glsl-fs-loop-unroll-mul-fp64, and there were no shader-db or fossil-db
changes.

v6 (idr): Plumb max_unroll_iterations into get_iteration_empirical. I
was going to do this, but I forgot. Suggested by Tim.

v7 (idr): Disable fadd tests on s390x. They fail because S390 is weird.

Almost all of the shaders affected (OpenGL or Vulkan) are from gfxbench
or geekbench. A couple shaders in Deus Ex (OpenGL), Dirt Rally (OpenGL),
Octopath Traveler (Vulkan), and Rise of the Tomb Raider (Vulkan) are
helped.

The lost / gained shaders in OpenGL are an Aztec Ruins shader that goes
from SIMD16 to SIMD8. The spills / fills affected are in a single Aztec
Ruins (Vulkan) compute shader.

shader-db results:

Skylake, Ice Lake, and Tiger Lake had similar results. (Tiger Lake shown)
total loops in shared programs: 5514 -> 5470 (-0.80%)
loops in affected programs: 62 -> 18 (-70.97%)
helped: 37 / HURT: 0

LOST:   2
GAINED: 2

Haswell and Broadwell had similar results. (Broadwell shown)
total loops in shared programs: 5346 -> 5298 (-0.90%)
loops in affected programs: 66 -> 18 (-72.73%)
helped: 39 / HURT: 0

fossil-db results:

Skylake, Ice Lake, and Tiger Lake had similar results. (Tiger Lake shown)
Instructions in all programs: 157374679 -> 157397421 (+0.0%)
Instructions hurt: 28

SENDs in all programs: 7463800 -> 7467639 (+0.1%)
SENDs hurt: 28

Loops in all programs: 38980 -> 38950 (-0.1%)
Loops helped: 28

Cycles in all programs: 7559486451 -> 7557455384 (-0.0%)
Cycles helped: 28

Spills in all programs: 11405 -> 11403 (-0.0%)
Spills helped: 1

Fills in all programs: 19578 -> 19588 (+0.1%)
Fills hurt: 1

Lost: 1

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3445>
2023-04-06 23:50:27 +00:00
Yevhenii Kolesnikov
f051967f19 nir/loop_analyze: Track induction variables incremented by more operations
These operations are covered:

 - imul
 - fmul
 - ishl
 - ishr
 - ushr

The only cases that can be currently affected are those where the
calculated loop-trip count would be zero.

v2 (idr): Split out from original commit. Rebase on lots of other work.

v3 (idr): Move operand size assertion. This code only cares that the
operands have the same size for the iadd and fadd cases. In other
cases, such as shifts, the sizes may not match. Fixes assertion
failures in
tests/spec/arb_gpu_shader_int64/glsl-fs-loop-unroll-ishl-int64.shader_test.

No shader-db or fossil-db changes on any Intel platform.

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3445>
2023-04-06 23:50:27 +00:00
Ian Romanick
bc170e895f nir/loop_analyze: Use try_eval_const_alu and induction variable basis info
This dramatically simplifies will_break_on_first_iteration, and, much
more importantly, makes it significantly more flexible. It is now
possible to handle loops with more complex exit condition and other
kinds of increment operations.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3445>
2023-04-06 23:50:27 +00:00
Ian Romanick
99a7a6648d nir/loop_analyze: Change invert_cond instead of changing the condition
This ensures that scenarios like
nir_loop_analyze_test.iadd_inot_ilt_rev_known_count_5 don't regress in
the next commit. It also means we don't change float comparisons. These
are probably fine... but it still made me a little uneasy.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3445>
2023-04-06 23:50:27 +00:00
Ian Romanick
aeb8af1141 nir/loop_analyze: Track induction variable basis information
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3445>
2023-04-06 23:50:27 +00:00
Ian Romanick
30879a760c nir/loop_analyze: Add a function to evaluate an ALU as constant
...with a substitution. This function is largely a copy-and-paste of
try_fold_alu (nir_opt_constant_folding.c), and an argument could be made
that this function belongs in that file.

v2: Some changes were mistakenly squashed in to "nir/loop_analyze: Use
try_eval_const_alu and induction variable basis info" that should have
been here.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3445>
2023-04-06 23:50:27 +00:00
Ian Romanick
2e942909c8 nir/tests: Add many loop analysis tests for induction variables modified by imul
Loop analysis doesn't currently treat values updated by multiplication
as induction variables. Future patches will change this.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3445>
2023-04-06 23:50:27 +00:00
Ian Romanick
a210fcd9c7 nir/tests: Add more loop analysis tests for induction vars updated by shifts
These reverse the order of the comparison (e.g., -2 >= i vs i >= -2). I
split this into a separate commit because the previous commit was so
large.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3445>
2023-04-06 23:50:27 +00:00
Ian Romanick
45518d2eba nir/tests: Add many loop analysis tests for induction vars updated by shifts
Loop analysis doesn't currently treat values updated by shifts as
induction variables. Future patches will change this.

v2: Don't use the contradiction ilt(x, INT_MIN).

v3: Delete some errant code in UNKNOWN_COUNT_TEST. Noticed by Tim.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3445>
2023-04-06 23:50:27 +00:00
Sajeesh Sidharthan
4f1646d73f radeonsi/vcn: set bitstream buffer size to encoded bitstream size
initial bitstream size was set to width * height * 2 which is
larger than yuv size. set initial bitstream size to encoded
bitstream size approximately to optimize memory consumption.
This is just an initial size setting, it will get resized later
if it's not big enough. As a result of this change, we don't need to
allocate super big size at the every beginning. Only allocate
big size when needed in order to save some memory

Signed-off-by: Sajeesh Sidharthan <sajeesh.sidharthan@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Acked-by: Veerabadhran Gopalakrishnan <Veerabadhran.Gopalakrishnan@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21918>
2023-04-06 22:55:59 +00:00
Jesse Natalie
a3e5e6ceaa dzn: Fix bindless descriptor sets with multiple dynamic buffers that need custom descriptors
Fixes: 5d2b4ee4 ("dzn: Allocate descriptor sets in buffers for bindless mode")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
04fa6c715b dzn: Batch command lists together
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
e16b55d861 dzn: Don't do initial-layout barriers for simultaneous-access resources
Fixes: 4daeac01 ("dzn: Enhanced barriers fixes/workarounds")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
023f7b26dc dzn: Attempt to force depth write states for depth access in LAYOUT_GENERIC
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
c914d53d13 dzn: Ensure buffer offsets are aligned
If the app passes us unaligned buffer offsets, we need to align them
down to the nearest aligned offset, and then put the difference into
the descriptor set buffer.

Fixes: 8bd5fbf8 ("dzn: Bind buffers for bindless descriptor sets")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
eaa8c8097c dzn: Don't use write-combine memory for cache-coherent UMA
Cache coherent UMA implies that the GPU is reading data through the
CPU caches. Using write-combined CPU pages for such a system would
be bad, since the GPU would then be reading uncached data. One
example of such a system is WARP. This significantly improves WARP's
performance for some apps (including the CTS).

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
3db019a816 dzn: Ensure pipeline variants are used for dynamic stencil masks
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
460ee81913 dzn: Align descriptor sets in the bindless buffer
Fixes: 5d2b4ee4 ("dzn: Allocate descriptor sets in buffers for bindless mode")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
84c0f40490 dzn: Report some more caps correctly that are supported
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
a348b49901 dzn: Raise max number of descriptor sets to 8
DOOM Eternal just assumes you support at least 5, which caused corruption
due to overrunning arrays. We can just bump this up. 8 should work with
and without bindless.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
f2a5a03d3b dzn: Fix SRV barrier state on compute command lists
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
fb5abb956d dzn: Add a driconf option for enabling subgroup ops in VS/GS
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
89879d8fe2 dzn: Add a driconf entry for enabling 8bit loads and stores
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
e28328ca2c spirv2dxil: Add some more supported caps
8-bit loads and stores work via lowering, but they do work

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
6d5ff875d2 microsoft/compiler: Fix large shifts
Unlike DXBC, DXIL's shift instructions don't have the implicit behavior
that they only take the 5 bits. This is observable if you try to have
DXC do a shift of a dynamic value, e.g. a constant buffer value, where
the compiler inserts the appropriate 'and' op. We need to do the same.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
4f56cede6d microsoft/compiler: Assign 1D wave IDs based on local thread ID
Fixes corruption/flickering seen in DOOM Eternal's decals/lighting.
It seems the shader has an implicit assumption about this property.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
eeb67362da microsoft/compiler: Fix barrier for wave ID computation
Fixes: 2f8a8b59 ("microsoft/compiler: Add lowering passes for basic subgroup vars")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
477332a347 microsoft/compiler: Fix 8-bit loads and stores when supporting 16-bit DXIL
Shifts should always use 32bit shift values, and when lowering to
masked, we need to use 32-bit atomics. That means that we should also
treat 24bit stores as a single masked op rather than one 16bit unmasked
and one 8bit masked.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Adam Jackson
e89e1f5049 glx: Fix error handling yet again in CreateContextAttribs
Unlike the legacy CreateContext path, we would try to send the
GLXCreateContextAttribs request regardless of whether we'd successfully
created the client context state. And there's not a lot on the server
side to go wrong besides BadAlloc, so if the request succeeded but
the client side didn't we'd need to destroy the server context and
synthesize an X error. Since that itself involves more X protocol it's
tricky to get the request number right in the error, and tests and apps
can notice when you get it wrong.

Since we have now fixed client-side validation to generate the right
errors at the right times, this patch does something simpler, we match
CreateContext and fail early if the client-side setup fails. Now there's
no question of what request number to use, because we haven't sent any
protocol, the error is for the request as if it'd been sent.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4763
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12006>
2023-04-06 21:29:54 +00:00
Adam Jackson
86fd72448c glx: Disable the indirect fallback in CreateContextAttribs
If your app cares enough to use CreateContextAttribs it's probably not
going to be happy with the pre-GL-1.5 indirect experience.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12006>
2023-04-06 21:29:54 +00:00
Adam Jackson
5dba6726f7 glx/dri: Fix error generation for invalid GLX_RENDER_TYPE
This needs to throw BadValue.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12006>
2023-04-06 21:29:54 +00:00
Adam Jackson
dd67c079a0 dri: Validate more of the context version in validate_context_version
There's two kinds of "bad version" you might encounter here, either the
combination does not name a defined version (like 1.7) or it names
something the driver can't do (like asking r300 to do 4.0). EGL does not
distinguish these cases, but GLX calls them BadMatch and GLXBadFBConfig
respectively.

Since api_mask is the set of driver supported APIs, and we can only
support defined APIs, don't check it early in driCreateContextAttribs,
just let it fall out from validate_context_version.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12006>
2023-04-06 21:29:54 +00:00
Adam Jackson
9c76682d80 glx/dri: Use X/GLX error codes for our create_context_attribs
This has no functional change because everyone calling this is
discarding the error code, because we're relying on the server to
generate the right thing for us. But we create the direct context first
and the server isn't going to enforce everything we want it to
(supported GL versions for example). Convert out from DRI error codes to
X/GLX error codes so we can fail the right way on the client side. We're
still throwing the error away in all of the callers but that'll change
shortly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12006>
2023-04-06 21:29:54 +00:00
Ian Romanick
12e11fa3e4 intel/fs: White space fixes
Trivial

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22299>
2023-04-06 19:07:50 +00:00
Ian Romanick
6dfb7061e0 intel/fs: Preserve meta data more often in brw_nir_move_interpolation_to_top
This pass rarely makes any changes, so work a little harder to preserve
more meta data.

On my Ice Lake laptop (using a locked CPU speed and other measures to
prevent thermal throttling, etc.) using a debugoptimized build, improves
performance of Vulkan CTS "deqp-vk --deqp-case='dEQP-VK.*spir*'" by
-0.2% ± 0.1% (n = 5, pooled s = 0.431885).

v2: Add some parenthesis. Suggested by Lionel.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22299>
2023-04-06 19:07:50 +00:00
Ian Romanick
3037603b70 intel/fs: Linked list micro optimizations in brw_nir_move_interpolation_to_top
Two linked list management changes:

- Use the list head sentinel as the initial cursor. It is, after all, a
  proper node in the list.

- Iterate the list of blocks starting with the second block instead of
  skipping the first block in the loop.

On my Ice Lake laptop (using a locked CPU speed and other measures to
prevent thermal throttling, etc.) using a release build, improves
performance of compiling shaders from batman_arkham_city_goty.foz by
-0.24% ± 0.09% (n = 5, pooled s = 0.324106).

v2: Use nir_cursor instead of direct list manipultion. Suggested by
Lionel.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22299>
2023-04-06 19:07:50 +00:00
Ian Romanick
78ee74de4a intel/compiler: Micro optimize regions_overlap
On my Ice Lake laptop (using a locked CPU speed and other measures to
prevent thermal throttling, etc.) using a release build, improves
performance of compiling shaders from batman_arkham_city_goty.foz by
-1.09% ± 0.084% (n = 5, pooled s = 0.354471)

Reduces the size of a release build by 26k.

   text	   data	    bss	    dec	    hex	filename
23163641 400720	 231360	23795721	16b1809	before/lib64/dri/iris_dri.so
23137264 400720	 231360	23769344	16ab100	after/lib64/dri/iris_dri.so

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22299>
2023-04-06 19:07:50 +00:00
Ian Romanick
7873edee6e intel/fs: Use specialized version of regions_overlap in opt_copy_propagation
Since one of the register must always be either VGRF or FIXED_GRF, much
of regions_overlap and reg_offset can be elided.

On my Ice Lake laptop (using a locked CPU speed and other measures to
prevent thermal throttling, etc.) using a debugoptimized build, improves
performance of Vulkan CTS "deqp-vk --deqp-case='dEQP-VK.*spir*'" by
-0.29% ± 0.097% (n = 5, pooled s = 0.361697).

Using a release build, improves performance of compiling shaders from
batman_arkham_city_goty.foz by -3.3% ± 0.04% (n = 5, pooled s =
0.178312).

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22299>
2023-04-06 19:07:50 +00:00
Ian Romanick
43cb42df7c intel/compiler: Micro optimize inst_is_in_block
This function only exists in builds with assertions, so it only matters
there.

On my Ice Lake laptop (using a locked CPU speed and other measures to
prevent thermal throttling, etc.) using a debugoptimized build, improves
performance of Vulkan CTS "deqp-vk --deqp-case='dEQP-VK.*spir*'" by
-5.2% ± 0.16% (n = 5, pooled s = 0.657887).

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22299>
2023-04-06 19:07:50 +00:00
Ian Romanick
d47f521ee4 intel/compiler: Use NIR_PASS instead of NIR_PASS_V
Reduce debug log spam by only logging the shader if a pass made some
changes. This can also elide some nir_validate calls in debug builds.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22299>
2023-04-06 19:07:50 +00:00
Ian Romanick
fb950a9edf intel/compiler: Remove one overload of backend_instruction::insert_before
The version that takes a list of instructions is not used. I did not do
any archaeology to find out when the last user was removed.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22299>
2023-04-06 19:07:50 +00:00
Tomeu Vizoso
179a694232 etnaviv: don't read too much from uniform arrays
Fixes: 77af1ca690 ("etnaviv: add disk cache")
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22210>
2023-04-06 16:51:36 +00:00
Italo Nicola
c45ce64ea0 etnaviv: implement nir_op_uclz and lower find_{msb,lsb} to uclz
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22210>
2023-04-06 16:51:36 +00:00
Italo Nicola
9dc4ee9121 etnaviv: lower (un)pack_{2x16,2x32}_split and extract_{byte,word}
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22210>
2023-04-06 16:51:36 +00:00
Tomeu Vizoso
70bb190279 etnaviv: print writemask of store operations
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22210>
2023-04-06 16:51:36 +00:00
Tomeu Vizoso
194327c136 etnaviv: handle missing alu conversion opcodes
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22210>
2023-04-06 16:51:36 +00:00
Italo Nicola
2a111d520e etnaviv: add default clear_buffer and clear_texture APIS
These are required to support rusticl.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22210>
2023-04-06 16:51:35 +00:00
Italo Nicola
201a141798 etnaviv: use stderr for compiler error logging
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22210>
2023-04-06 16:51:35 +00:00
Italo Nicola
3b7d35bb99 etnaviv: abort() instead of assert(0) on compiler error
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22210>
2023-04-06 16:51:35 +00:00
Marek Olšák
debc543904 amd/registers: use gfx9 packet definitions for gfx940
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:54 +00:00
Marek Olšák
ba74d10950 amd/registers: update gfx940.json
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:54 +00:00
Marek Olšák
e3bc800d5d amd/registers: fix the parser to include CP_COHER registers for gfx940
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:54 +00:00
Marek Olšák
e917db3b42 amd/registers: simplify integer division by 0x1000 in the parser
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:54 +00:00
Marek Olšák
81a6601979 radeonsi: don't set registers that don't exist on gfx940
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Sathishkumar S
69397180f6 radeonsi/vcn: enable RGBA/ARGB formats on gfx940 jpeg
enable RGBA/ARGB format on gfx940 to aid RGBA/ARGB conversion after decode

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Sathishkumar S
6d675feff7 frontends/va: support crop region in jpeg decode
propogate region of interest co-ordinates for crop region decode

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Sathishkumar S
4b0d4d5ca6 radeonsi/vcn: reset to default value when ROI/FC is not used
when decoding without ROI/FC feature reset the registers to default value.

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Sonny Jiang
74bf0cdc9d radeonsi/vcn: Add decode support for gfx940
Add VCN decode for gfx940

Signed-off-by: Sonny Jiang <sonny.jiang@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Sonny Jiang
73ba47e87b radeonsi/vcn: Add video capabilities support for gfx940
Add VCN codec caps support for gfx940

Signed-off-by: Sonny Jiang <sonny.jiang@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Sonny Jiang
5639b23644 amd/common: Add gfx940 codec query support
Add support for GFX940 VCN query

Signed-off-by: Sonny Jiang <sonny.jiang@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Sathishkumar S
b4efb1ef35 radeonsi/vcn: set jpeg reg version for gfx940
select appropriate jpeg register version for gfx940

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Sathishkumar S
334919b8ed radeonsi/vcn: support ARGB/RGBA conversion on JPEG 4.0.3
enable ARGB/RGBA conversion feature on JPEG 4.0.3

v2: fix regression caused due to uninitialized variable

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Sathishkumar S
d0477cbd07 radeonsi/vcn: add support for picture crop on JPEG 4.0.3
set the crop region and enable the feature if requested

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Sathishkumar S
74572084d8 radeonsi/vcn: use register versions for jpeg
update the register version and select appropriate registers during decoder create

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Sathishkumar S
9422627074 radeonsi/vcn: add register definitions for JPEG 4.0.3
Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Ganesh Belgur Ramachandra
d75f0d6c26 ac/nir: fix CDNA image lowering for array textures
The x,y coordinates were not added.

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/22158>
2023-04-06 15:00:53 +00:00
Marek Olšák
eaf98b1422 ac/nir: implement image opcode emulation for CDNA, enable it in radeonsi
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Marek Olšák
e3c6ed0685 radeonsi: add an emulated image descriptor for gfx940
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Marek Olšák
96913bbf3e ac/surface: force linear image layout for chips not supporting image opcodes
Image opcodes will be emulated.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Marek Olšák
8277e6fda3 radeonsi: always use ffma32 on gfx940
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Marek Olšák
72354667cb radeonsi: use COMPUTE_DISPATCH_SCRATCH_BASE on gfx940
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Marek Olšák
d3b03fedd8 amd: add initial code for gfx940
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Marek Olšák
46639eb056 amd: add gfx940 register definitions
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Eric Engestrom
91a6c9cccf Revert "broadcom/ci: run gl jobs on arm64, just like vk"
This reverts commit ba4eeaf435.

Looks like we have a lot of memory issues on arm64; revert the pre-merge
CI to armhf until we've been able to figure out the problem and fix it.

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

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22335>
2023-04-06 14:34:06 +00:00
Alyssa Rosenzweig
2242bb703e nv50,nvc0: Use u_pipe_screen_get_param_defaults
Other than nouveau, every single Gallium driver relies on
u_pipe_screen_get_param_defaults to get the default values of CAPs.

For the driver, this is much more concise. Unsupported new features -- or
supported features that virtually all Gallium drivers support -- do not need to
written out explicitly. Their absence (or presence) is implied as the default.
If there's any doubt over whether the CAP is exposed, it's easy to check in
u_pipe_screen_get_param_defaults.

For the Gallium tree in general, this brings a number of benefits:

* Unused CAPs are easy to delete, because there is only a single place
  (u_pipe_screen_get_param_defaults) where they are referenced and need to be
  deleted from.

* New CAPs are easy to introduce, for the same reason.

* It's straightforward to audit which drivers support (or don't support) a given
  CAP by grepping for the name (for example, when determining whether a CAP is
  unused and can be garbage collected, or a CAP is so widely supported that it
  can be made default.). You still need to check the source code in case it's
  conditionally exposed (common for layered drivers) but the search space is
  limited to drivers that reference the CAP by name.

Unfortunately, all of these benefits rely on all Gallium drivers cooperating.
The status quo is much less nice:

* Unused CAPs need to be deleted both from common code, and also specially from
  nouveau. Why is nouveau special?

* New CAPs need to be added both to common code, and also specially to nouveau.
  Again, why is nouveau special?

* When grepping for CAPs, nouveau (only) needs to be ignored, since it's
  spurious.  Unless sometimes it's not, in which case you need to open nouveau
  source code anyway to check.

Compounding on the fun, you have to do the special nouveau step twice, once for
nvc0 and once for nv50.

Why might it be benefical to list CAPs explicitly instead of relying on the
defaults?

* Maybe easier auditing nouveau driver for CAP correctness? In practice this has
  not been an issue for any of the drivers I've worked on, especially because
  the defaults are quite reasonable.

* Maybe forcing people adding CAPs to think about nouveau specially? This isn't
  fair to the tree in general, why should nouveau get this special
  treatment? Instead, CAPs are generally added to gate functionality that may
  not be supported on all drivers, and the default is disabling the new
  functionality until a developer for a given driver can wire it up. There's
  already no expectation that the person adding CAPs needs to also add the
  functionality to nouveau (if that's even possible) -- unless the CAP is being
  added for the particular nouveau's benefit of course -- so this isn't helpful.

* Maybe forcing people removing CAPs to think about nouveau specially? Similar
  issues apply here, and it's not clear how this would even work.

* Maybe keeping novueau developers aware of CAP churn? Again nouveau should not
  be special here and it isn't sustainable to do this for every driver. So, if
  this is something that nouveau developers want to do -- and they choose not to
  follow Gallium-tagged merge requests -- then the git log of
  src/gallium/include/pipe/p_defines.h or indeed
  src/gallium/auxiliary/util/u_screen.c may be consulted.

So, without an excellent reason why nouveau should be treated specially, and
with several reasons why it should not, let's bring nouveau in line with the
rest of Gallium and rely on the defaults.

I've left in CAPs with attached comments even when they are returning the
default value to preserve information from before the commit. Otherwise, this
commit aims to remove explicit cases that match the default value, as other
drivers generally aim to do.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22245>
2023-04-06 14:13:00 +00:00
Guilherme Gallo
fe60fa898e Revert "ci: disable Collabora's LAVA lab for maintance"
This reverts commit 86ad0356b6.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22329>
2023-04-06 08:49:23 -03:00
Tapani Pälli
44053c0947 intel/common: limit the amount of SLM with Wa_14017341140
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/22307>
2023-04-06 10:54:47 +00:00
Rohan Garg
e21cca78ea anv,blorp,iris: Set PreferredSLMAllocationSize on gfx125+
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-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/22307>
2023-04-06 10:54:47 +00:00
Rohan Garg
3b6dbf8902 intel/genxml: Add the preferred slm size enum for gen125
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-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/22307>
2023-04-06 10:54:46 +00:00
Anuj Phogat
606a39f9d1 intel/genxml/125: Add preferred SLM allocation size field
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-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/22307>
2023-04-06 10:54:46 +00:00
Jesse Natalie
767c5425da CI/windows: Increase timeout for build container job
These jobs can take upwards of 40 minutes just to upload
the built container images...

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22320>
2023-04-06 09:14:22 +00:00
Jesse Natalie
24fce05f3f CI/windows: Update headers and Agility redist to 1.710.0-preview
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22320>
2023-04-06 09:14:22 +00:00
Timothy Arceri
5a29af262c glsl: move some GL ES checks to the NIR linker
Eventually we should aim to remove the GLSL IR linker.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22305>
2023-04-06 08:07:35 +00:00
Timothy Arceri
bf8f11a2de mesa: add _mesa_is_api_gles2() helper
The glsl compiler has been reworked to avoid passing gl_context around
so that we can avoid expensive recompiles across the code base for
minor changes. This helper will help us avoid passing gl_context around
where its otherwise unrequired.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22305>
2023-04-06 08:07:35 +00:00
Sergi Blanch Torne
86ad0356b6 ci: disable Collabora's LAVA lab for maintance
This is to inform you of some planned downtime in the LAVA lab as follows:

    Start: 2023-04-06 07:30 GMT
    End: 2023-04-06 09:00 GMT

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22185>
2023-04-06 06:04:57 +00:00
Chia-I Wu
a38de4c011 radv: disable tc_compatible_cmask on GFX9 in some cases
There seems to be issues when sample count > 2 on GFX9.  More precisely,
CTS has issues when sample count > 2.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21615>
2023-04-06 05:27:01 +00:00
Chia-I Wu
bd5fb29db6 radv: add RADV_FMASK_COMPRESSION_PARTIAL
RADV_FMASK_COMPRESSION_PARTIAL means the fmask is decompressed but not
expanded.  It is desired for sampling when the cmask is not
TC-compatible.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21615>
2023-04-06 05:27:01 +00:00
Chia-I Wu
3cf7ac4e9c radv: rework radv_layout_fmask_compressed
Rename radv_layout_fmask_compressed and make it return an enum.  We will
add partial compression (fmask decompressed and not expanded) in a
following commit.

Drop the check for VK_IMAGE_USAGE_STORAGE_BIT and
VK_IMAGE_USAGE_TRANSFER_DST_BIT.  When transitioning to
VK_IMAGE_LAYOUT_GENERAL, we should decompress and expand FMASK even when
those usage bits are not set.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21615>
2023-04-06 05:27:01 +00:00
Emma Anholt
8e84a23697 ci/zink: Disable a630 portal-2-v2 due to kernel OOMs.
It's been popular for flakes due to oomkilling or kernel kmalloc failure
recently.  Is it ultimately the source of running out of memory?  Who
knows, but hopefully it's at least a big part of the problem.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
ffa867b535 tgsi: Drop TGSI_OPCODE_DFRACEXP.
This is no longer emitted by nir_to_tgsi, so let's drop it.  This unlocks
some more TGSI DCE, since now all instructions have a single dest, but
that's a project for another day.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
ba5bc2677f glsl: Drop PIPE_SHADER_CAP_DFRACEXP_DLDEXP_SUPPORTED.
All drivers should now be using the appropriate NIR lowering, so we can
drop this pile of code.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
7325f699db glsl: Drop frontend lowering of 32-bit frexp.
All the users should now be calling the appropriate NIR lowering function.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
fca4857091 nir_to_tgsi: Always lower frexp_exp/sig.
The GLSL frontend was already lowering 32-bit frexp, so only 64-bit frexp
is possible as an op in the incoming NIR.  However, svga and nouveau don't
set PIPE_SHADER_CAP_DFRACEXP_DLDEXP_SUPPORTED, leaving just r600's
non-default TGSI mode potentially using it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
3f2328c629 panfrost/midgard: Enable nir_lower_frexp.
Needed for dropping the GLSL frontend lowering.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
094b5a71d7 agx: Enable nir_lower_frexp.
Needed for Vulkan, and for dropping GLSL frontend lowering for the deqp
coverage override case.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
862235ecaa v3d: Lower frexp in the GL compiler like we do in Vulkan.
Needed for dropping GLSL's frontend lowering.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
04c31c6ada zink: Enable nir_lower_frexp.
This will enable GLSL to drop its frexp lowering in the frontend.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
7c57061b77 nouveau: Enable frexp lowering in the backend.
This would be desired for NVK using this backend, but also for getting
lowering out of the GLSL frontend.

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/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
3a336a8ffd nouveau: Add missing nir_opt_algebraic_late.
This was needed for nir_lower_frexp, but it's a win anyway.  shader-db
results:

total gpr in shared programs: 1143621 -> 1143502 (-0.01%)
gpr in affected programs: 33918 -> 33799 (-0.35%)

total instructions in shared programs: 7829415 -> 7820124 (-0.12%)
instructions in affected programs: 1204967 -> 1195676 (-0.77%)

total bytes in shared programs: 71802760 -> 71717352 (-0.12%)
bytes in affected programs: 11031888 -> 10946480 (-0.77%)

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/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
f2228902ed ir3: Move turnip's nir_lower_frexp to the shared compiler.
We had NIR lowering for Vulkan, and rely on GLSL's lowering in the
frontend, but this will let us drop the GLSL lowering.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
f1ea6c1b40 intel: Always call nir_lower_frexp.
We have NIR lowering for Vulkan, and rely on GLSL's lowering in the
frontend, but this will let us drop the GLSL lowering.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
fb60edf4e9 state_tracker: Lower frexp before lowering doubles.
We don't have softfp64 for frexp, it has been lowered in GLSL up until
now.  I didn't bother splitting out 32 from 64 because it's not worth any
effort.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
261c1f9ee1 glsl/softfp64: Add fisfinite lowering.
This is generated by nir_lower_frexp, and if we leave fisfinite in place
then the late algebraic pass lowering it to this pattern will cause an
un-lowered fabs64 to be emitted.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
7ff899dd6e glsl/softfp64: GC the temp vars after we lower them to SSA.
They don't serve any purpose other than taking up memory and cluttering
your compiler output at this point.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:00 +00:00
Emma Anholt
2a33ea95d6 glsl: Retire ldexp lowering in favor of the nir lowering flag.
Compilers need to set the nir flag anyway for vulkan, so just pass ldexp
through to NIR and let that handle it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:00 +00:00
Emma Anholt
675f4ff596 zink: Add mapping for nir_op_ldexp, but disable it for 64-bit's sake.
We previously had GLSL do ldexp lowering to bitops, but NIR can do it
instead.  It's tempting to just pass the NIR op through to the host Vulkan
driver, but to do that we'd need to split up NIR's flag between 32 and
64-bit support, and that's not worth anyone's time for an op we've never
seen used.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:00 +00:00
Emma Anholt
46bf687882 glsl: Move ForceGLSLAbsSqrt handling to glsl-to-nir.
Cutting more GLSL lowering pass in favor of nir builder.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:00 +00:00
Mike Blumenkrantz
a73c28fdce radv: fix leak of nir from retained shaders
if shaders are found in the app cache above, execution will goto done:
and the nir must still be freed

Fixes: 03d2bd6042 ("radv: ensure to retain NIR shaders for GPL libs found in the cache")

fixes #8786

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22317>
2023-04-06 01:53:28 +00:00
Eric Engestrom
e6c84b8a00 panfrost: assign the correct create_for_resource from the start
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22322>
2023-04-05 23:15:35 +00:00
Rob Clark
66d4dbd960 util/disk_cache: Move blob_put_cb to the async queue
Move deflate and put to the queue for the blob cache case.  This moves
the overhead out of the app thread when storing new shaders.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22248>
2023-04-05 20:25:04 +00:00
Rob Clark
dab1bd5a77 util/disk_cache: Use queue state to skip put
If we move the blob-cache path into the async queue, then
path_init_failed is no longer a good way to check if puts
should be a no-op.  But fortunately checking if the queue
is initialized is, and is a more obvious check because
what it is guarding is a util_queue_add_job().

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22248>
2023-04-05 20:25:04 +00:00
Rob Clark
213627e94b util/disk_cache: Add NONE type
Add an explicit enum for the DISK_CACHE_NONE type so that we don't
confuse with the MULTI_FILE case on android when the blob-cache is
used.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22248>
2023-04-05 20:25:04 +00:00
Rob Clark
afb350906e util/disk_cache: Split out queue initialization
Split out a helper to initialize the queue, as we'll want to re-use this
for the blob-cache case.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22248>
2023-04-05 20:25:04 +00:00
Jordan Justen
eef7a117a1 intel/compiler: Support fmul_fsign opt for fp64 when int64 isn't supported
MTL support fp64, but not int64. The fsign(double(x))*FOO optimization
would try to use a 64-bit int xor operation to conditionally toggle
the sign bit off the result.

Since this only affects high bit of the result, we can do a 32-bit
move of the low dword, and a 32-bit xor on the high dword.

Fixes dEQP-VK.spirv_assembly.instruction.compute.float_controls.fp64.input_args.modf_denorm_flush_to_zero
on MTL.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22259>
2023-04-05 18:48:21 +00:00
Timur Kristóf
7abd8c499b radv/amdgpu: Remove can_patch and chained submit code path.
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/22220>
2023-04-05 17:10:25 +00:00
Timur Kristóf
6aa518ea86 radv: Chain cmd buffers in queue code when possible, not in winsys.
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/22220>
2023-04-05 17:10:25 +00:00
Timur Kristóf
c876e99aa4 radv/amdgpu: Unchain CS array in queue code not in winsys.
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/22220>
2023-04-05 17:10:25 +00:00
Timur Kristóf
44f7e42665 radv/amdgpu: Walk chained CS objects for BO list.
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/22220>
2023-04-05 17:10:25 +00:00
Timur Kristóf
d7fc114788 radv/amdgpu: Remember which CS the current one is chained to.
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/22220>
2023-04-05 17:10:25 +00:00
Timur Kristóf
ba87ade6d0 radv/amdgpu: Extract radv_amdgpu_add_cs_to_bo_list function.
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/22220>
2023-04-05 17:10:25 +00:00
Timur Kristóf
9d22125f05 radv/amdgpu: Expose CS chain and unchain on the winsys.
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/22220>
2023-04-05 17:10:25 +00:00
Timur Kristóf
aa9558698e radv/amdgpu: Extract CS chain and unchain functions.
Also add a comment that explains what chaining means
and add a check to make sure the HW IP type supports it.

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/22220>
2023-04-05 17:10:25 +00:00
David Heidelberg
e261e46c09 ci: implement sections for cuttlefish
Reviewed-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22005>
2023-04-05 16:26:20 +00:00
Samuel Pitoiset
981f512037 radv: emit the PS epilog after the graphics pipeline
Otherwise, SPI_SHADER_PGM_RSRC1_PS is overwritten when the graphics
pipeline is emitted.

Fixes: 5c362cde33 ("radv: update PS num_vgprs in case of epilogs rather than overallocating VGPRs")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22310>
2023-04-05 14:48:00 +00:00
Eric Engestrom
368a6f2330 vc4/ci: add another sync flake
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/39377396

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22312>
2023-04-05 14:15:25 +00:00
Mike Blumenkrantz
a17317d2a0 glthread: use id 0 for internal buffer objects
-1 is an invalid buffer index which breaks app expectations, specifically
apitrace, which checks for return value of 0 from checking buffer bindings
to determine whether to inject user vertex buffer bindings and create functional
traces

this should fix capturing traces with drivers using glthread

fixes #8383

cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22293>
2023-04-05 13:28:44 +00:00
Lionel Landwerlin
e25aee8e34 intel/fs: also allow vec8+ vectorization of load_global_const_block_intel
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/21853>
2023-04-05 12:32:56 +00:00
Lionel Landwerlin
a358b97c58 intel/fs: optimize uniform SSBO & shared loads
Using divergence analysis, figure out when SSBO & shared memory loads
are uniform and carry the data only once in register space.

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/21853>
2023-04-05 12:32:56 +00:00
Lionel Landwerlin
2cf93f7632 nir: add 2 new intel intrinsics for uniform ssbo/shared loads
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/21853>
2023-04-05 12:32:56 +00:00
Lionel Landwerlin
2259e1e932 nir: reuse nir_component_mask() where it makes sense
Avoiding local bit field manipulations.

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/21853>
2023-04-05 12:32:56 +00:00
Lionel Landwerlin
275ad509c1 intel/fs: factor out lsc surface descriptor settings
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/21853>
2023-04-05 12:32:56 +00:00
Lionel Landwerlin
76698f3abd intel/fs: copy instruction sources in logical send lowering
Having references to inst->src[X] when you're also modifying
inst->src[X] is a receipe for disaster. Making changes to the lowering
code I've been bitten quite a few times by this take copies of all
sources to do the lowering.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21853>
2023-04-05 12:32:56 +00:00
Lionel Landwerlin
adb8c30436 intel/fs: UNDEF fixup_nomask_control_flow temp register
Ensure that the register's liveness is not expanded to loops.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21853>
2023-04-05 12:32:56 +00:00
Lionel Landwerlin
362a07db3a intel/fs: don't consider fixup_nomask_control_flow SENDs predicate
Those SENDs are still doing a full register write. We just inserted
some predication for a workaround.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21853>
2023-04-05 12:32:56 +00:00
Lionel Landwerlin
34d8bfe65f intel/fs: run VGRF compaction just before max live register accounting
There are a number of instances of the dead code elimination pass that
could reduce the count. For some reason this also seems to affect
register allocation itself.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21853>
2023-04-05 12:32:56 +00:00
Marcin Ślusarz
554b28d0b1 anv: ignore structure types handled in vk_device_memory_create
Without that we get warning from anv_debug_ignored_stype, called in
the default case.

Fixes: 4b0b75c27a ("anv: Use the new vk_device_memory base struct")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22295>
2023-04-05 11:53:29 +00:00
Eric Engestrom
ba4eeaf435 broadcom/ci: run gl jobs on arm64, just like vk
These were running on armhf because that's the default in the custom
distro that Raspberry Pi provides, but arm64 is ~20% faster, and we
already run weekly tests on both arm64 & armhf, so let's keep only the
faster one in the pre-merge path.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22272>
2023-04-05 09:35:34 +01:00
Gert Wollny
0cb6437f4f r600/sfn: fix container allocators
This fixes leaks in TexInstr and in Shader.

Thanks to Patrick Lerda for pointing out the bug.

Fixes: 79ca456b48
    r600/sfn: rewrite NIR backend

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22300>
2023-04-05 07:50:34 +00:00
Samuel Pitoiset
9085c9d43e radv: fix VS prologs with GPL and static binding stride
When a graphics pipeline library is created with only the vertex input
state, the driver binds this state at pipeline bind time. Though the
vertex binding stride is not necessarily dynamic, in this case the
pipeline stride should be used.

This fixes GPU hangs with recent
dEQP-VK.pipeline.fast_linked_library.vertex_input.*.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22285>
2023-04-05 07:18:37 +00:00
Iago Toral Quiroga
9217c565b2 v3d,v3dv: stop trying to force 16-bit TMU output for shadow comparisons
In V3D we were doing this incorrectly by peeking into the sampler state
unconditionally, which is not correct if the TMU operations don't use
sampler state at all (like PBOs). This was causing us to fail the second
test in this sequence when both tests run back back to back in the same
process:

dEQP-GLES3.functional.texture.shadow.2d.linear.greater_or_equal_depth_component32f
dEQP-GLES3.functional.texture.specification.teximage2d_pbo.rg32f_cube

Here, the first test would setup sampler state for shadow comparisons and
the second test would setup a PBO upload, which would incorrectly pick
up the sampler state to decide about the TMU output size for the PBO
operation.

In V3DV we were doing this right looking through each texture/sampler
instruction and checking if they all involved shadow comparisons or had
relaxed precission, defaulting to 32-bit otherwise.

This special-casing for shadow comparisons also leaks from drivers
into the compiler where we are forced to emit some pieces of sampler
state for 32-bit outputs, so we had to special-case shadow instructions
there as well and we also had a fix for CS textures not having correct
sampler state representing shadow operations too. Finally,
we also had  at least a couple of bugs where forcing 32-bit TMU output
through V3D_DEBUG wasn't correctly forcing shadow comparisons to actually
be 32-bit in all the right places, leading to visual bugs with the
option enabled (Sponza being one example of this). This change eliminates
all of these issues.

Finally, the performance improvement observed from special casing shadow
comparison is negligible, and in specific scenarios it can even be
detrimental to performance due to increased register pressure (Sponza with
PCF filtering set to 4 is an example of this again).

Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8684
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22284>
2023-04-05 06:52:51 +00:00
Iago Toral Quiroga
1bbbdbe666 vulkan/wsi/display: set pDisplay to NULL on error
the spec for vkGetDrmDisplayEXT says:

  "If there is no VkDisplayKHR corresponding to the connectorId on the
   physicalDevice, the returning display must be set to VK_NULL_HANDLE.
   The provided drmFd must correspond to the one owned by the physicalDevice.
   If not, the error code VK_ERROR_UNKNOWN must be returned. (...)
   The given connectorId must be a resource owned by the provided drmFd.
   If not, the error code VK_ERROR_UNKNOWN must be returned"

We were only setting the display pointer to VK_NULL_HANDLE if the provided
drmFd was valid, however, there are CTS tests checking that it is also set
to NULL when it is not.

Fixes the following test on all drivers exposing EXT_acquire_drm_display
(tested with Intel and V3DV):
dEQP-VK.wsi.acquire_drm_display.acquire_drm_display_invalid_fd

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22283>
2023-04-05 06:21:26 +00:00
Iago Toral Quiroga
d28cf0dbd5 v3dv: always acquire display device before checking if we can present
Usually, we postpone acquisition until a swapchain is created, but there are
some cases with display extensions (at least with EXT_acquire_drm_display)
where we need to acquire before a swapchain is ever created.

Fixes various tests in:
dEQP-VK.wsi.acquire_drm_display.*

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22283>
2023-04-05 06:21:26 +00:00
Iago Toral Quiroga
74d0886475 v3dv: drop unused parameter
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22283>
2023-04-05 06:21:25 +00:00
Brian Paul
6eaf2e7c16 llvmpipe: clean-up llvmpipe_get_query_result()
Get rid of the uint64 result pointer which was used by some query
types.  Handle each switch case with self-contained code.  Remove
unneeded casts.  Use MIN2/MAX2 macros.

Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22281>
2023-04-05 03:49:16 +00:00
Brian Paul
58fbd75de2 llvmpipe: s/unsigned/enum pipe_query_type/
Note we should do the same for pipe_context::create_query()'s
query_type parameter.  That would touch quite a few files.

Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22281>
2023-04-05 03:49:16 +00:00
Brian Paul
76605c1cb9 llvmpipe: s/tabs/spaces/
Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22281>
2023-04-05 03:49:16 +00:00
Brian Paul
3658fd6823 llvmpipe: rename some vars related to occlusion query and ps invocations
More consistent naming.

Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22281>
2023-04-05 03:49:16 +00:00
Brian Paul
43773fdda7 llvmpipe: fix ps invocations query bug
We were not initializing the PS invocation count to zero before
computing the sum of the per-thread results.

This fixes an issue where querying the result of the query more
than once would cause the result to grow larger each time.

Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22281>
2023-04-05 03:49:16 +00:00
Felix DeGrood
840e98f19e iris: report draw count for perfetto
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22296>
2023-04-05 02:13:49 +00:00
Erik Faye-Lund
72cd7e0079 ci: remove unused rules
These are no longer used.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22263>
2023-04-04 23:49:53 +00:00
Erik Faye-Lund
1b7a4029d0 virgl/ci: clean up manual rules for virgl
In f6c06ef2f6 ("ci: Add manual rules variations to disable irrelevant
driver jobs."), we fixed this for *most* driver. This fixes up the last
driver, hopefully removing an annoying needless button in the UI for
some MRs.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22263>
2023-04-04 23:49:53 +00:00
Erik Faye-Lund
67750f138b ci: move virgl-rules after intel-rules
We're about to add a dependency on stuff from the intel-rules, and
moving virgl down here allows us to depend on them without having to
move the definition out of the intel-section.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22263>
2023-04-04 23:49:53 +00:00
Mike Blumenkrantz
61451af5a2 zink: rework choose_pdev (again)
there are two cases to be handled here:
* normal
* software

the latter case requires env vars based on the frontend, and if a sw
device isn't found then init should fail

the former case should (in theory) just yolo the first device and assume
that's what the user wanted based on whatever env vars and layers are
in use

fixes #7508, #7132

maybe also affects #8152

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22184>
2023-04-04 23:32:46 +00:00
Pedro J. Estébanez
32e3c77a11 Revert "microsoft/compiler: Use SRVs for read-only images"
This reverts commit 54c32aeba6.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22289>
2023-04-04 22:50:05 +00:00
Pedro J. Estébanez
88acbcadbb spirv: Assume input attachments are read-only
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22289>
2023-04-04 22:50:05 +00:00
Pedro J. Estébanez
e59fdcb93c spirv2dxil: Split read-only image as SRV logic into declared and inferred
Fixes: e0a090ad ("spirv2dxil: Only lower readonly images to SRVs when the option is set")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22289>
2023-04-04 22:50:05 +00:00
Jesse Natalie
9663546cf4 dzn: Claim fillModeNonSolid
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22277>
2023-04-04 21:48:19 +00:00
Jesse Natalie
69a9a3ea3c dzn: Handle polygon point mode
Note: The meaning of clockwise vs counter-clockwise changes after the
yz flip, therefore the determination of winding needs to be done before
the yz flip logic. Therefore the yz flip is moved to the GS and applied
as a lowering on top of the base GS.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22277>
2023-04-04 21:48:19 +00:00
Jesse Natalie
bcf50b7532 dzn: Add a helper to generate triangle->point GS
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22277>
2023-04-04 21:48:19 +00:00
Jesse Natalie
83fd7e9460 spirv2dxil: Expose yz flip pass to external callers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22277>
2023-04-04 21:48:19 +00:00
Jesse Natalie
b723962418 d3d12: Move forward-front-face pass to common DXIL code
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22277>
2023-04-04 21:48:19 +00:00
Patrick Lerda
e0ed2b29f4 r600: fix typo that could lead to a possible crash
For instance, with "piglit/bin/arb_shader_image_load_store-host-mem-barrier --quick -auto -fbo":
==18549==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61200000a059 at pc 0x7f65d8937b80 bp 0x7fff6ed19a00 sp 0x7fff6ed199f8
READ of size 1 at 0x61200000a059 thread T0
    #0 0x7f65d8937b7f in evergreen_set_shader_images ../src/gallium/drivers/r600/evergreen_state.c:4277
    #1 0x7f65d6b471b8 in st_bind_images ../src/mesa/state_tracker/st_atom_image.c:172
    #2 0x7f65d6b76b26 in st_validate_state ../src/mesa/state_tracker/st_util.h:129
    #3 0x7f65d6b76b26 in prepare_draw ../src/mesa/state_tracker/st_draw.c:88
    #4 0x7f65d6b77c8a in st_draw_gallium ../src/mesa/state_tracker/st_draw.c:141
    #5 0x7f65d72698a2 in _mesa_draw_arrays ../src/mesa/main/draw.c:1202

Fixes: a6b3792843 ("r600: add core pieces of image support.")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22273>
2023-04-04 21:35:05 +00:00
Eric Engestrom
db0c4a8965 vc4/ci: add arm64 failure to flakes as it works on armhf
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22297>
2023-04-04 21:00:06 +00:00
Sonny Jiang
7360aa020c gallium/pipe: change PIPE_DEFAULT_DECODER_FEEDBACK_TIMEOUT_NS to 1 second
Fixes: 5e1bd07a ("radeonsi: vcn: implement the get_decoder_fence vfunc")
The commit [5e1bd07a] puts a timeout on fence_wait which causes a 8k AV1
decoding regression on gfx940. By adding DECODER_FEEDBACK_TIMEOUT to
add fence wait time.

Signed-off-by: Sonny Jiang <sonny.jiang@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22268>
2023-04-04 20:05:26 +00:00
Emma Anholt
3ede37f8a6 docs: Claim less functionality for glsl_compiler.
It doesn't generate GPU code, just GLSL IR code.  Also, clarify where to
find the built tool, and what the options do.

Closes: #8674
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22271>
2023-04-04 20:00:17 +00:00
Emma Anholt
c346413d9c ci: Add missing dependency on doxygen sources for docs-generation jobs.
!22191 broke docs generation and marge didn't notice because of missing
 deps.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22271>
2023-04-04 20:00:17 +00:00
Emma Anholt
6fc9540176 docs: Update Vulkan renderpass docs for !22191
Fixes: 6ad5f885af ("vulkan: Drop VkRenderingSelfDependencyInfoMESA")
Closes: #8773
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22271>
2023-04-04 20:00:17 +00:00
Ryan Neph
59a5340f74 i915: hook new get_fd proc for drm winsys
Fixes: 853b4801f2 ("i915: Add support for `get_screen_fd`")
Signed-off-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22294>
2023-04-04 19:39:02 +00:00
Ryan Neph
94b3a7e3ff virgl: hook new get_fd proc for drm winsys
Fixes: 2ade6917da ("virgl: Add support for `get_screen_fd`")
Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22292>
2023-04-04 19:21:59 +00:00
Daniel Schürmann
5c362cde33 radv: update PS num_vgprs in case of epilogs rather than overallocating VGPRs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22267>
2023-04-04 18:35:43 +00:00
Daniel Schürmann
4c7a5b1e51 aco: don't use shared VGPRs for shaders consisting of multiple binaries
When using multiple binaries, we don't know the required number of VGPRs beforehand,
which means we either have to over-allocate VGPRs or avoid shared VGPRs.
As bpermute is the only instructions needing shared VGPRs, we decide for the latter.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22267>
2023-04-04 18:35:43 +00:00
Daniel Schürmann
37df8edf34 aco/ra: adjust_max_used_regs() for fixed Operands
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22267>
2023-04-04 18:35:43 +00:00
Daniel Schürmann
8c68aba678 aco: split ps_epilog args before exporting them
This avoids some unnecessary copies from extracting from the input vectors.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22267>
2023-04-04 18:35:42 +00:00
Sagar Ghuge
10fc12fd17 anv: Drop dead code that sets the L3BypassDisable field
These helper functions will only get invoked for GFX < 11 and the
L3BypassDisable field is present starting from GFX12+.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22275>
2023-04-04 17:39:20 +00:00
Sagar Ghuge
e3b172d75d anv: Drop unused param from add_surface_reloc
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22275>
2023-04-04 17:39:20 +00:00
Emma Anholt
a1277b89a1 ci/zink: Disable godot-tps-gles3 on a630.
This trace used too much memory to be run in parallel with our other
traces.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22279>
2023-04-04 15:37:14 +00:00
Collabora's Gfx CI Team
91b06ea8b2 Uprev Piglit to 2391a83d1639a7ab7bbea02853b922878687b0e5
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22279>
2023-04-04 15:37:14 +00:00
Samuel Pitoiset
c5b7efa293 radv: enable shaders cache for libraries with GPL
This was the last missing feature for GPL. The main problem is that
the on-disk shaders cache size will increase a lot because we don't
deduplicate shaders but there is on-going work to improve that.

We also can't use the shaders cache for libraries created with the
RETAIN_LINK_TIME_OPTIMIZATION flag and module identifiers because we
don't know the SPIR-V and thus can't retain NIR shaders for linking.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22264>
2023-04-04 14:47:39 +00:00
Samuel Pitoiset
03d2bd6042 radv: ensure to retain NIR shaders for GPL libs found in the cache
Even if we are able to get the assembly from the shaders cache for
graphics pipeline libraries, we still need to retain NIR shaders in
case the LTO pipelines won't be find in the cache.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22264>
2023-04-04 14:47:39 +00:00
Samuel Pitoiset
5e62d8d1bd radv: add VkGraphicsPipelineLibraryFlag to the graphics pipeline key
This is to generate a different key for a library created with
FRAGMENT_SHADER_BIT and no FS (ie. it would generate a noop FS) and
a library created with FRAGMENT_OUTPUT_INTERFACE with no CB attachments.

Otherwise, the same key would be generated and this would corrupt
the cache.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22264>
2023-04-04 14:47:39 +00:00
Samuel Pitoiset
47c0820dc7 radv: remove dead code in radv_pipeline_get_nir()
We either import the NIR or the assembly, so this was never reached.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22264>
2023-04-04 14:47:39 +00:00
Samuel Pitoiset
a9529d9644 radv: allow to create/insert PS epilogs from/to the cache for libs
To cache PS epilogs compiled inside graphics pipeline libraries.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22264>
2023-04-04 14:47:39 +00:00
Samuel Pitoiset
ba967e1a28 radv: rely on non-NULL binaries when inserting shaders to the cache
With GPL, a stage can be imported from a library which means that the
binary is NULL (it's freed right after compilation) but the shader is
non-NULL. To avoid crashing, rely on non-NULL binaries because this
implies that the shader is non-NULL as well.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22264>
2023-04-04 14:47:39 +00:00
Samuel Pitoiset
1239fcab4d radv: only copy non-NULL shaders when loaded from the cache
With GPL, we don't necessarily load all stages from the same cache
entry and other stages might have been imported from libraries, so
don't overwrite them.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22264>
2023-04-04 14:47:39 +00:00
Connor Abbott
0977925c53 nir, spirv: Add support for VK_EXT_fragment_density_map
This involves two new system values.

Reviewed-by: Faith Ekstrand <faith@gfxstrand.net>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20303>
2023-04-04 13:14:35 +00:00
Emma Anholt
6c0a8a7f06 ci/zink: Drop validation exception for leaks at device destroy.
Between the recent glthread and zink fixes, we should be good to go.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22237>
2023-04-04 11:50:58 +00:00
Pierre-Eric Pelloux-Prayer
4c3e1f6529 radeonsi: update test results
This test was fixed by bf910c94e0 ("glsl: fix gl_CullDistance lowering
from float[8] to vec4[2]").

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22237>
2023-04-04 11:50:58 +00:00
Pierre-Eric Pelloux-Prayer
c1368685c3 util/vbuf: fix index_bo leak
When indices are unrolled we still have to release the index_bo
references passed to us.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8272
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22237>
2023-04-04 11:50:58 +00:00
Pierre-Eric Pelloux-Prayer
c19a3a6ddf util/vbuf: clarify indirect draws handling
It wasn't obvious from the u_vbuf code alone that num_draws
is guaranteed to be 1 in the indirect case.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22237>
2023-04-04 11:50:58 +00:00
Pierre-Eric Pelloux-Prayer
2b717f01f7 mesa: fix invalid index_bo refcounting
If take_index_buffer_ownership is true, then we should reserve
enough references of index_bo or we'll get an underflow later.

Fixes: 819627041e ("mesa: set pipe_draw_info::index::resource directly and remove gl_bo")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8747
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22237>
2023-04-04 11:50:58 +00:00
Mike Blumenkrantz
09320705f0 zink: be explicit about separate shader dsl indexing during creation
this fixes a minor issue where a fs without a vs dsl would have the wrong
index

Fixes: e3b746e3a3 ("zink: use GPL to handle (simple) separate shader objects")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22269>
2023-04-04 11:29:01 +00:00
Tapani Pälli
b0cdd5a1d2 anv: check for MESA_SHADER_TESS_CTRL with get_tcs_prog_data
Fixes: 86d931724d ("anv: Implement Wa_14015297576")
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/22282>
2023-04-04 10:42:12 +03:00
Tapani Pälli
98c6db3fc8 anv: take primitive ID override to account Wa_14015297576
Commit ca4ec49b0e took primitive ID override fields in to use, this
has to be checked as part of Wa_14015297576.

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/22282>
2023-04-04 10:41:58 +03:00
Mike Blumenkrantz
e84cf80fe1 zink: always store nir serialized
this saves a ton of memory and has minimal, if any cpu impact

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:41 +00:00
Mike Blumenkrantz
4e1668384d zink: store num_inlinable_uniforms separately for cs programs
compute is a special case because the zink_shader itself is created
in a thread, which means it cannot be accessed directly at bind time
since it may not have finished creating itself yet

to avoid prematurely waiting on an async fence, the one value needed
at bind time can instead be stored separately

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:41 +00:00
Mike Blumenkrantz
517146f540 zink: move nir cloning out to callers of zink_shader_compile
this will make more sense with future changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:41 +00:00
Mike Blumenkrantz
dfa8c15164 zink: break out nir blob deserializing
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:41 +00:00
Mike Blumenkrantz
0563499db0 zink: simplify assign_io() further
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:41 +00:00
Mike Blumenkrantz
fd2714b5a9 zink: store nir as serialized on zink_shader structs
nir_shader objects are hefty, and they really add up when there's a lot
of them. there's also not much use in keeping them around, as any time
they'll be used, they're always cloned first, and deserializing isn't
likely to be any slower than a clone

cuts driver memory usage by ~40% for tomb raider

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:41 +00:00
Mike Blumenkrantz
e40134aea8 zink: streamline nir cloning for assign_io
more relics from the time of pipe_shader_type

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:41 +00:00
Mike Blumenkrantz
2e1ad9f817 zink: directly return nir from zink_shader_tcs_create
not currently used but will be

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:41 +00:00
Mike Blumenkrantz
d3c9112404 zink: swap nir pointers when compiling compute shaders
these are the same pointer, just use a different one

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:41 +00:00
Mike Blumenkrantz
fdb9c91922 zink: pass nir directly to zink_shader_tcs_create()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:41 +00:00
Mike Blumenkrantz
6524b9285f zink: simplify fbfetch output detection from fs
this should be identical to the previous code, except it also
handles depth/stencil (not yet supported)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:41 +00:00
Mike Blumenkrantz
edc804e50f zink: use zink_shader::info instead of zink_shader::nir::info
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:40 +00:00
Mike Blumenkrantz
b33d5d1a98 zink: generate flat_flags during shader creation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:40 +00:00
Mike Blumenkrantz
f26526ff33 zink: pass nir_shader to update_so_info()
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:40 +00:00
Mike Blumenkrantz
f7b76d681b zink: add and populate a shader_info struct to zink_shader
this avoids the need to use the nir pointer to access shader info

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:40 +00:00
Mike Blumenkrantz
eb30744562 zink: delete shader reordering in assign_io()
this is a relic of when pipe_shader_type was different than gl_shader_stage

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:40 +00:00
Alejandro Piñeiro
bbd124fd00 v3dv/pipeline: use pipeline depth bias enabled to fill up CFG packet
Even if the VkPipelineRasterizationStateCreateInfo sets
depthBiasEnable, internally we comput if it is really makes sense, and
use that to decide for example if we emit the Depth Offset packet.

But we were not using this to enable Depth Bias through the depth
offset enable field on the CFG packet.

So in some tests we were enabling depth bias, but not emitting the
packet to configure it, that seemed somewhat inconsistent.

This didn't cause any issue so far, but let's be conservative.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22252>
2023-04-04 00:06:38 +00:00
Lionel Landwerlin
a88aedbfa5 intel/perf: fix OA format selection on MTL
Anything Gfx12.5+ has a different format.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 90c86fe63e ("intel: add MTL performance metrics")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22257>
2023-04-03 23:34:17 +00:00
Lionel Landwerlin
c61101f151 intel/dev: set a default valid kmd_type
src/intel/perf/intel_perf_query_layout.c needs a valid kmd type to
look at the metrics

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 757e2dd692 ("intel/perf: Disable it for Xe KMD")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22257>
2023-04-03 23:34:17 +00:00
Ian Romanick
2016d9f46c intel/fs: Rework the loop of opt_combine_constants that collects constants
This is a bit more wordy, but it will greatly simplify some future
changes.

v2: Rebase on ADD3 changes.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Tested-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22274>
2023-04-03 21:50:06 +00:00
Ian Romanick
9e4bb4bfcf intel/fs: Refactor part of opt_combine_constants to a separate function
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Tested-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22274>
2023-04-03 21:50:06 +00:00
Ian Romanick
593cde0432 intel/fs: Output opt_combine_constants debug to stderr
It's a lot more useful to have it in the same stream with the
INTEL_DEBUG=fs output.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Tested-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22274>
2023-04-03 21:50:06 +00:00
Iván Briano
eadc64ab24 vulkan/wsi/display: do not dereference a NULL pointer
Fixes dEQP-VK.wsi.direct_drm.swapchain.simulate_oom.*

Cc: mesa-stable

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/19025>
2023-04-03 20:21:17 +00:00
Faith Ekstrand
6ad5f885af vulkan: Drop VkRenderingSelfDependencyInfoMESA
It's no longer needed as VK_EXT_attachment_feedback_loop_layout provides
everything we need.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22191>
2023-04-03 18:13:01 +00:00
Faith Ekstrand
b4c18b9b76 vulkan: Drop vk_render_pass_state::*self_dependenc*
ANV was the only driver using them and now it's on feedback loop flags.
Other drivers should convert instead of depending on the old version.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22191>
2023-04-03 18:13:01 +00:00
Faith Ekstrand
6d4e605378 hasvk/pipeline: Use feedback loop flags for self-dependencies
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22191>
2023-04-03 18:13:01 +00:00
Faith Ekstrand
8df8a3c19b anv/pipeline: Use feedback loop flags for self-dependencies
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22191>
2023-04-03 18:13:01 +00:00
Faith Ekstrand
f3876db1ee vulkan: Plumb rendering flags through vk_graphics_pipeline_state
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22191>
2023-04-03 18:13:01 +00:00
Connor Abbott
f4b534d50f vk/render_pass: Support VK_EXT_fragment_density_map
Support emulating "classic" FDM with dynamic rendering.

Reviewed-by: Faith Ekstrand <faith@gfxstrand.net>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22191>
2023-04-03 18:13:01 +00:00
Connor Abbott
df9694e98e tu: Use vk_pipeline_get_renderpass_flags()
With this we can remove usage of VkSelfDependencyInfoMESA.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22191>
2023-04-03 18:13:01 +00:00
Jason Ekstrand
bd26ae0086 vulkan: Record pipeline flags in the render pass
This records any rendering pipeline flags in the render pass.  This
provides much-needed information for the VK_KHR_fragment_shading_rate
and VK_EXT_fragment_density_map extensions as well as provides an
alternative to VkRenderingSelfDependencyInfoMESA which is based on
VK_EXT_attachment_feedback_loop_layout.

v2 (Connor): Name something more general
v3 (Faith): Also add the FSR flag

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22191>
2023-04-03 18:13:01 +00:00
Samuel Pitoiset
9582c1e52a radv/ci: add one more flake
This one is randomly failing.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22258>
2023-04-03 17:20:13 +00:00
Samuel Pitoiset
d74790a865 zink/ci: remove primitive-id-no-gs-quads from the NAVI10 fail list
It has been fixed too.

Fixes: 5fb8ba0eb8 ("zink/ci: remove `primitive-id-no-gs-quads` from radv-vangogh-fails")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22258>
2023-04-03 17:20:13 +00:00
Rhys Perry
f92994bb83 radv/gfx11: improve RT scratch allocation
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22232>
2023-04-03 16:35:17 +00:00
Timur Kristóf
50e9a8f7c2 radv: Use linear_dispatch info in GFX11 task/mesh draw packet.
This helps the CP (command processor) optimize mesh shader
dispatch when Y = Z = 1.

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/22222>
2023-04-03 15:36:02 +00:00
Timur Kristóf
e42d2bd534 nir: Gather compile time constant task->mesh dispatch size.
Some GPUs such as AMD RDNA3 can use this information
to optimize mesh shader dispatches.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.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/22222>
2023-04-03 15:36:02 +00:00
Timur Kristóf
836204da25 aco: Better phi lowering for merge block when else-side is const.
Add a new special case for binary merge blocks to boolean
phi lowerig. This special case benefits shaders that
have divergent branches with an empty else block,
for example all NGG culling shaders.

Fossil DB stats on Rembrandt (NGG culling enabled):

Totals from 61778 (45.79% of 134913) affected shaders:
SpillVGPRs: 2268 -> 2284 (+0.71%); split: -1.10%, +1.81%
CodeSize: 164317952 -> 162962772 (-0.82%); split: -0.83%, +0.00%
Instrs: 31249824 -> 30910686 (-1.09%); split: -1.09%, +0.00%
Latency: 154948555 -> 154781097 (-0.11%); split: -0.12%, +0.02%
InvThroughput: 30397664 -> 30370872 (-0.09%); split: -0.13%, +0.04%
VClause: 529239 -> 529229 (-0.00%); split: -0.00%, +0.00%
SClause: 783417 -> 783430 (+0.00%)
Copies: 2627570 -> 2595161 (-1.23%); split: -1.25%, +0.02%
Branches: 976506 -> 976508 (+0.00%); split: -0.00%, +0.00%

Fossil DB stats on GFX11 (NGG culling disabled):

Totals from 895 (0.66% of 134913) affected shaders:
SpillVGPRs: 2258 -> 2322 (+2.83%); split: -0.44%, +3.28%
CodeSize: 6229152 -> 6215880 (-0.21%); split: -0.37%, +0.16%
Scratch: 216576 -> 215808 (-0.35%); split: -0.47%, +0.12%
Instrs: 1202077 -> 1198396 (-0.31%); split: -0.43%, +0.13%
Latency: 15921336 -> 16000561 (+0.50%); split: -0.74%, +1.24%
InvThroughput: 7425765 -> 7474891 (+0.66%); split: -0.67%, +1.33%
VClause: 22976 -> 23008 (+0.14%); split: -0.03%, +0.17%
SClause: 38269 -> 38271 (+0.01%)
Copies: 123244 -> 123896 (+0.53%); split: -0.30%, +0.83%
Branches: 47570 -> 47574 (+0.01%); split: -0.00%, +0.01%

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/21493>
2023-04-03 14:36:07 +00:00
Timur Kristóf
81b4806d64 aco: Call dominator_tree before lower_phis.
This just makes it possible to use the dominator
tree information during phi lowering.

No Fossil DB changes on GFX11.

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/21493>
2023-04-03 14:36:07 +00:00
Timur Kristóf
0eb7c49c7f aco: Pop branch operands when targets are same in SSA elimination.
The branch instruction is no longer conditional when the targets are the
same, so the operand is not necessary and can be removed.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21493>
2023-04-03 14:36:07 +00:00
Timur Kristóf
739bd03c37 aco: Don't verify branch exec read when eliminating exec writes.
Verifying that the branch instruction reads exec is not actually
necessary because the pattern that we look for already implies that.

This prepares for the next commit which will remove the exec operand
from branches that have the same target. These branches will no
longer read exec, but they should still get the same optimization.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21493>
2023-04-03 14:36:07 +00:00
Timur Kristóf
9eb04d8f96 aco: Simplify get_phi_operand using Operand::c32_or_c64.
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/21493>
2023-04-03 14:36:07 +00:00
Timur Kristóf
0211e66f65 aco: Don't remove exec writes that also write other registers.
Don't eliminate an instruction that writes registers other than exec and scc.
It is possible that this is eg. an s_and_saveexec and the saved value is
used by a later branch.

Fixes: bc13049747
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21493>
2023-04-03 14:36:07 +00:00
Timur Kristóf
54da863956 aco: Consider p_cbranch_nz as divergent branch too.
A p_cbranch_nz instruction that reads exec is divergent too.

Fixes: f030b75b7d
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21493>
2023-04-03 14:36:07 +00:00
David Heidelberg
78644c9bb0 ci: disable lima farm, currently out-of-space, needs to be fixed
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22265>
2023-04-03 14:41:15 +02:00
Tatsuyuki Ishi
7fe469d6c8 radv: Pre-compute descriptor set layout hash.
While analyzing cache loading performance, hashing the pipeline layout was
surprisingly consuming around 4% of time, sometimes close to the cost of
hashing shader modules.

Turns out we were hashing the pipeline layout on every pipeline creation.
Considering that pipeline layouts are usually deduplicated by the
application, this was amplifying the hashing cost by a big margin.

With Graphics Pipeline Library, we do need to rebuild the pipeline layout
by combining those from each library, but we can memoize the hash of the
descriptor set layout. The cost of re-hashing hashes is negligible since
each descriptor set layout can amount to 1–2KB in size.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22254>
2023-04-03 08:46:08 +00:00
Nataraj Deshpande
71fe9dfe07 anv: Bump VkDeviceMemory objects limit to 4GB
Android CTS 13_r4 tests dEQP-VK.memory.allocation.random* fail
with VK_ERROR_OUT_OF_DEVICE_MEMORY on ADL boards with 32GB memory
as memory allocation requests from DEQP are much larger(~2.9GB+)
based on device heap size/8.

Increase the limit to unsigned 32bit max(~4GB) which helps to
fix the dEQP-VK.memory.allocation.random* tests.

v1: Bound allocation by the largest memory heap size (Lionel Landwerlin)

v2: Clean up comments to reflect the code change (Ivan Briano)
    Update the value of MAX_MEMORY_ALLOCATION_SIZE (Lionel Landwerlin)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22066>
2023-04-03 06:18:52 +00:00
Lionel Landwerlin
b7e5b3e318 isl: update max buffer size for SKL+
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22066>
2023-04-03 06:18:52 +00:00
Lionel Landwerlin
00fc927e52 anv: take care of maxStorageBufferRange being uint32_t
Not fixing anything, but required for another fix.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22066>
2023-04-03 06:18:52 +00:00
Qiang Yu
7be81a680b ac/llvm: remove ac_build_opencoded_load_format
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/22045>
2023-04-03 01:35:06 +00:00
Qiang Yu
1165758b8b ac/llvm,radeonsi: remove abi->load_inputs implementation
No nir_load_input in VS now.

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/22045>
2023-04-03 01:35:06 +00:00
Qiang Yu
894d92995c radeonsi: monolithic VS emit prolog in nir directly
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/22045>
2023-04-03 01:35:06 +00:00
Qiang Yu
531acf548a ac/llvm: move ac_fixup_ls_hs_input_vgprs to amd common
To be shared with radeonsi.

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/22045>
2023-04-03 01:35:06 +00:00
Qiang Yu
297f97a42b ac/llvm: vs_rel_patch_id can also be fixed up
It's currently used when LS store output to LDS.
The LS/HS bug fix seems does not affect this case.
But we'd better treat it as other fixed args.

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/22045>
2023-04-03 01:35:06 +00:00
Qiang Yu
7ab7eccddd radeonsi: add si_nir_lower_vs_inputs
Ported from llvm:
* si_load_vs_input
* ac_build_opencoded_load_format
* ac_ufN_to_float
* get_vertex_index
* ac_build_fast_udiv_nuw

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/22045>
2023-04-03 01:35:06 +00:00
Qiang Yu
003d84b660 ac/nir: add ac_nir_load_arg_at_offset
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/22045>
2023-04-03 01:35:06 +00:00
Qiang Yu
e6f69853be radeonsi: expose si_nir_load_internal_binding
PS polygon stippling is going to use it too.

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/22045>
2023-04-03 01:35:06 +00:00
Mauro Rossi
b40e7dcf82 hasvk: include "vk_android.h" header in anv_android.c
Fixes the following building errors:

../src/intel/vulkan_hasvk/anv_android.c:387:34: error: implicit declaration of function 'vk_alloc_ahardware_buffer' is invalid in C99 [-Werror,-
Wimplicit-function-declaration]
   struct AHardwareBuffer *ahw = vk_alloc_ahardware_buffer(pAllocateInfo);
                                 ^
../src/intel/vulkan_hasvk/anv_android.c:387:28: error: incompatible integer to pointer conversion initializing 'struct AHardwareBuffer *' with an expression of type 'int' [-Werror,-Wint-conversion]
   struct AHardwareBuffer *ahw = vk_alloc_ahardware_buffer(pAllocateInfo);
                           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.

Fixes: b16cfe23 ("vulkan,anv,hasvk,radv: Unify Android hardware buffer creation")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22251>
2023-04-02 23:30:42 +02:00
Timur Kristóf
4de9a4b2b8 ac/nir: When task->mesh dispatch Y or Z are 0, also set X to 0.
AMD recommends doing this to speed up the CP when it processes
the draw ring entries. LLPC also does 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/22211>
2023-04-01 14:46:50 +00:00
Timur Kristóf
4683b21399 ac/nir: Store only lowest 8 bits for task draw ring DWORD3.
When writing the draw ready bit, don't write the high 24 bits
of DWORD3, because that is used by the HW for something else
according to LLPC.

Cc: mesa-stable
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/22211>
2023-04-01 14:46:50 +00:00
Rhys Perry
6974e5479c aco: fix nir_var_shader_out barriers for task shaders
These will be used in a future commit.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22211>
2023-04-01 14:46:50 +00:00
Rob Clark
d698bf0523 freedreno: Support the disable_throttling=true driconf option
At this point, mostly just to make it easier to disable throttling for
performance debugging.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22224>
2023-04-01 13:53:31 +00:00
Rob Clark
77a5778836 freedreno: Move driconf settings into sub-struct
Organize all one of them in a single place before adding more.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22224>
2023-04-01 13:53:31 +00:00
Rob Clark
8620b64930 freedreno: Avoid looping shader stages if nothing dirty
We have corresponding global dirty bits for each of the per-stage dirty
bits.  We can use this to skip iterating over shader stages when there
is no per-stage dirty state to handle.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22224>
2023-04-01 13:53:31 +00:00
Rob Clark
0a62a874fc freedreno: Re-work dirty-resource tracking
If a resource is dirty but already tracked by the current batch, no need
to process it at draw time.

Note that the batch could change (ie. new fb state bound, etc) after the
check if we need resource dirty tracking, but in these cases all the
dirty-resource state is marked dirty.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22224>
2023-04-01 13:53:31 +00:00
Rob Clark
4c0fdef42c freedreno: Inline single-use helpers
bind_sampler_states() / set_sampler_views() have just a single caller.
So inline them.  Needed for next commit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22224>
2023-04-01 13:53:31 +00:00
Rob Clark
7099f628c5 freedreno: Extract out a helper
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22224>
2023-04-01 13:53:31 +00:00
Rob Clark
0408ddcda9 freedreno: Hoist dirty vars
Prep to re-work how we track dirty-resource.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22224>
2023-04-01 13:53:31 +00:00
Rob Clark
19a138adcf freedreno: Stop being too clever by half
This wasn't taking into account a change in corresponding bit in
writeable_bitmask, causing problem if an SSBO was first bound for
read, and then rebound for write, we wouldn't update the buffers
valid range.  Instead just drop the premature optimization.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22224>
2023-04-01 13:53:31 +00:00
Connor Abbott
b123ee707d freedreno: Fix or/and'ing two BitmaskEnums
Previously when there was an & or | with two BitmaskEnums, the compiler
would try to cast the RHS and find a matching overload, but there were
many different casts (to the enum itself, to an integer, to a boolean,
etc.) each with a matching overload which meant that it couldn't pick
one and errored out due to an ambiguous overload. Fix this by
explicitly providing an overload that takes a BitmaskEnum on the RHS.
It has to also provide a BitmaskEnum output, so that subsequent
operators with the result on the LHS (e.g. when or'ing together three
BitmaskEnums without any parentheses tricks) also get the right
overload.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22224>
2023-04-01 13:53:31 +00:00
Pavel Ondračka
5825f9dd68 nine: use separate register for aL emulation
NIR loop unrolling is only working if the loop counter is a scalar.
So keep the loop counter separate and move the aL emulation and
the aL increment to a new register.

This allows loop unrolling with vec4 backends where unconditional
scalarizing of phi nodes is undesirable, like for example r300.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Axel Davy <davyaxel0@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7222
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21243>
2023-04-01 11:12:55 +00:00
Karol Herbst
ac993ae828 rusticl/kernel: make use of cso info
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>
2023-03-31 20:29:00 +00:00
Karol Herbst
c7dd3677dc panfrost: implement get_compute_state_info
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>
2023-03-31 20:29:00 +00:00
Karol Herbst
87aeea20ac panfrost: move max_thread_count and take reg_count into account
We'll need it to report proper thread counts for OpenCL.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>
2023-03-31 20:29:00 +00:00
Karol Herbst
3212ac4658 nvc0: implement get_compute_state_info
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>
2023-03-31 20:29:00 +00:00
Karol Herbst
52f03f63e7 nv50: implement get_compute_state_info
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>
2023-03-31 20:29:00 +00:00
Karol Herbst
c1c0362d34 iris: implement get_compute_state_info
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>
2023-03-31 20:29:00 +00:00
Karol Herbst
5fa297dadd lp: implement get_compute_state_info
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>
2023-03-31 20:29:00 +00:00
Karol Herbst
6305d1cb1c gallium: add get_compute_state_info
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>
2023-03-31 20:29:00 +00:00
Karol Herbst
87147e2b09 rusticl/kernel: set has_variable_shared_mem on the nir
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>
2023-03-31 20:29:00 +00:00
Karol Herbst
0e5722cd22 nir: track existence of variable shared memory
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>
2023-03-31 20:29:00 +00:00
Sil Vilerino
1995762d68 Revert "d3d12: Honor suggested driver profile/level for H264/HEVC encode"
This reverts commit 37652da616.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22239>
2023-03-31 20:13:20 +00:00
Rhys Perry
0f60c18f29 aco: don't optimize s_or_b64(v_cmp_u_f32(a, b), cmp(a, a))
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22214>
2023-03-31 19:41:54 +00:00
Charlie Birks
46e7a127d9 docs: add a few vulkan extensions supported by multiple drivers
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11445>
2023-03-31 19:35:36 +00:00
Konstantin Seurer
7b837531e8 radv/ci: Update ray tracing pipeline fail/skip lists
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22018>
2023-03-31 19:05:17 +00:00
Samuel Pitoiset
e98aded527 radv: fix binding raytracing/compute pipelines
If a compute pipeline is bound after a raytracing pipeline, the
computes shader slot (aka RT prolog) will be overwritten.

To fix this, move the RT prolog outside of the compute shader slot.

Fixes: d109362a3d ("radv: copy bound shaders to the cmdbuf state")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22235>
2023-03-31 18:29:05 +00:00
Samuel Pitoiset
56493a5f8a radv: add the raygen shader BO to the cmdbuf list
Found by inspection.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22235>
2023-03-31 18:29:05 +00:00
Timur Kristóf
115958b6f0 ac/nir/ngg: Slightly improve attribute ring offset calculation.
Inspired by Nicolai Hähnle's commit in LLPC.
Instead of using a SALU instruction to add to the scalar
offset, rely on the buffer swizzling and use constant offset.

Fossil DB stats on GFX1100:

Totals from 47910 (35.51% of 134913) affected shaders:
CodeSize: 87927612 -> 86968136 (-1.09%)
Instrs: 17584007 -> 17440094 (-0.82%)
Latency: 97232173 -> 97126311 (-0.11%)
InvThroughput: 9904586 -> 9905288 (+0.01%); split: -0.02%, +0.02%
VClause: 544430 -> 542566 (-0.34%)

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22227>
2023-03-31 17:02:17 +00:00
Timur Kristóf
61003e3600 radv: Use radv_get_shader to get vertex shader when binding pipeline.
The shaders[MESA_SHADER_VERTEX] can be NULL for merged shaders.

Fixes: b2ac40e734
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8749
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/22229>
2023-03-31 16:42:39 +00:00
Samuel Pitoiset
f8558d1fb5 radv: configure PA_SC_MODE_CNTL_1 during cmdbuf recording
Two graphics pipeline parameters need to be copied to the cmdbuf
state.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22218>
2023-03-31 16:07:11 +00:00
Samuel Pitoiset
66da73e863 radv: set PS_ITER_SAMPLE(1) for sample shading during cmdbuf recording
This shouldn't be configured in the pipeline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22218>
2023-03-31 16:07:11 +00:00
Samuel Pitoiset
b750fe4c6a radv: copy db_render_control to the cmdbuf state
This register is only used for meta operations.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22218>
2023-03-31 16:07:11 +00:00
José Roberto de Souza
e6c9b6eddc iris: Implement Xe version of bo_madvise() and bo_set_caching()
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22060>
2023-03-31 15:40:27 +00:00
Maarten Lankhorst
c10ff19704 iris: Place scanout buffers only into lmem for discrete GPUs
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22060>
2023-03-31 15:40:27 +00:00
José Roberto de Souza
d72705ce43 iris: Handle allocation of scanout buffers in Xe
Bos that will be scanout in display need to be allocated with
flags = XE_GEM_CREATE_FLAG_SCANOUT in Xe and that implies to different
caching rules for this buffer.

So here not allowing to get scanout buffer from cache or allow it
to be placed in a cache bucket for reuse.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22060>
2023-03-31 15:40:27 +00:00
José Roberto de Souza
ccffcec03e iris: Handle allocation of exported buffers in Xe kmd
Bos that will be exported need to be allocated with vm_id = 0 in Xe,
so don't try to get a bo from cache that was allocated with a
valid vm_id.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22060>
2023-03-31 15:40:27 +00:00
José Roberto de Souza
41ddecc8b2 iris: Add BO_ALLOC_SHARED
Xe KMD requires special handling for exported buffers during creation.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22060>
2023-03-31 15:40:27 +00:00
Faith Ekstrand
4b0b75c27a anv: Use the new vk_device_memory base struct
Reviewed-by: Lina Versace <lina@kiwitree.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22038>
2023-03-31 14:57:03 +00:00
Faith Ekstrand
c0cc508cd0 vulkan: Add a vk_device_memory base struct
This lets us provide a vk_device_memory_range helper similar to what's
provided for buffers for dealing with VK_WHOLE_SIZE.  We can also handle
flags and some annoyance around Android hardware buffer import.

Reviewed-by: Lina Versace <lina@kiwitree.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22038>
2023-03-31 14:57:03 +00:00
Faith Ekstrand
b16cfe23ef vulkan,anv,hasvk,radv: Unify Android hardware buffer creation
Reviewed-by: Lina Versace <lina@kiwitree.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22038>
2023-03-31 14:57:03 +00:00
Faith Ekstrand
d75f797246 radv: Set vk_image.ahardware_buffer_format
Reviewed-by: Lina Versace <lina@kiwitree.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22038>
2023-03-31 14:57:03 +00:00
Faith Ekstrand
0a86df21d0 anv,hasvk: Set vk_image.ahardware_buffer_format
This effectively just modifies it for YCbCr images where the common code
doesn't have a useable format mapping.

Reviewed-by: Lina Versace <lina@kiwitree.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22038>
2023-03-31 14:57:03 +00:00
Faith Ekstrand
906944b210 vulkan: Add an ahardware_buffer_format field to vk_image
Reviewed-by: Lina Versace <lina@kiwitree.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22038>
2023-03-31 14:57:03 +00:00
Faith Ekstrand
dc0749adab vulkan/android: Fix hardware buffer usage flags
We now add the correct usage flags for input attachments, storage
images, and depth/stencil attachments.

Reviewed-by: Lina Versace <lina@kiwitree.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22038>
2023-03-31 14:57:03 +00:00
Faith Ekstrand
41f88be282 vulkan,anv,hasvk,radv: Add a common vk_image_usage_to_ahb_usage helper
Reviewed-by: Lina Versace <lina@kiwitree.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22038>
2023-03-31 14:57:03 +00:00
Felix DeGrood
49f34675f3 anv: set CFE_STATE.OverDispatchControl to default
BSpec specifies default value for CFE_STATE.OverDispatchControl
is 2, or 50% overdispatch. No observed performance impact.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22179>
2023-03-31 14:18:59 +00:00
Felix DeGrood
ecb709c853 anv: only emit CFE_STATE when scratch space increases
On Gen12.5+, we only need to emit CFE_STATE when scratch space
has changed, not on every pipeline binding. Also, only grow the
scratch space, never shrink it. Need to reset after secondary buf.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22179>
2023-03-31 14:18:58 +00:00
Lionel Landwerlin
c88de6c18c anv: move queue check helpers to anv_private
Also fix missing trace point stuff in command buffer begin/end

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/22179>
2023-03-31 14:18:58 +00:00
Lionel Landwerlin
546a6752ac anv: compute the largest GRL kernel scratch size
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/22179>
2023-03-31 14:18:58 +00:00
Felix DeGrood
97e64aef60 anv: cs_stall during compute state flush on < gen12.5
The CS Stall in cmd_buffer_flush_compute_state is only required
on HW that uses MEDIA_VFE_STATE, gen12 and previous.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22179>
2023-03-31 14:18:58 +00:00
Lucas Fryzek
cffa67af01 gallium: Modify default path for DMABUF to use DRM
Modify the code path taken in `u_pipe_screen_get_param_defaults`
to call DRM to check if `PIPE_CAP_DMABUF` is supported. This is
required for overriding the behavior in `dri2_init_screen_extensions`
to support importing DMA bufs on drivers that don't support DRM, by
simply changing how `PIPE_CAP_DMABUF` is handled in their driver.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21654>
2023-03-31 13:39:07 +00:00
Lucas Fryzek
59efea9f63 d3d12/llvmpipe/softpipe: Add support for get_screen_fd
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21654>
2023-03-31 13:39:07 +00:00
Lucas Fryzek
0c0e7d5c1a r300/r600/radeon_si: Add support for get_screen_fd
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21654>
2023-03-31 13:39:07 +00:00
Lucas Fryzek
2ade6917da virgl: Add support for get_screen_fd
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21654>
2023-03-31 13:39:06 +00:00
Lucas Fryzek
cf1c3c96ab svga: Add support for get_screen_fd
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21654>
2023-03-31 13:39:06 +00:00
Lucas Fryzek
853b4801f2 i915: Add support for get_screen_fd
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21654>
2023-03-31 13:39:06 +00:00
Lucas Fryzek
0f5fdd9ca4 iris: Add support for get_screen_fd
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21654>
2023-03-31 13:39:06 +00:00
Lucas Fryzek
29a7bc6172 zink: Add support for get_screen_fd
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21654>
2023-03-31 13:39:06 +00:00
Lucas Fryzek
28275598df nouveau: Add support for get_screen_fd
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21654>
2023-03-31 13:39:06 +00:00
Lucas Fryzek
70a8292b17 tegra: Add support for get_screen_fd
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21654>
2023-03-31 13:39:05 +00:00
Lucas Fryzek
b18f259177 crocus: Add support for get_screen_fd
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21654>
2023-03-31 13:39:05 +00:00
Mike Blumenkrantz
4faa0c2f10 lavapipe: advertise EXT_shader_object
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22233>
2023-03-31 13:19:27 +00:00
Mike Blumenkrantz
8b3022c918 lavapipe: implement EXT_shader_object
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22233>
2023-03-31 13:19:27 +00:00
Mike Blumenkrantz
469a1d8c11 lavapipe: break out pipeline layout creation for reuse
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22233>
2023-03-31 13:19:27 +00:00
Corentin Noël
1eaea97f3a venus/ci: Only run one crosvm instance
As venus now has separate render server processes it is better to use a single
crosvm instance to run all the tests.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21693>
2023-03-31 12:39:49 +00:00
Corentin Noël
c08c2a0963 ci: Uprev crosvm and virglrenderer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21693>
2023-03-31 12:39:49 +00:00
Samuel Pitoiset
df3536cd4a vulkan: Update XML and headers to 1.3.246
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22231>
2023-03-31 11:43:20 +00:00
antonino
c682de95fb zink: update requirements now that pv mode can be emulated
Zink can now emulate provoking vertex mode when the extention is
missing, update requirements to reflect this.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22162>
2023-03-31 11:03:48 +00:00
antonino
302302a8a1 zink: always advertize provoking vertex mode support
Require VK_EXT_provoking_vertex for optimal_keys and always advertize
PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION since it can now be
emulated

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22162>
2023-03-31 11:03:48 +00:00
antonino
5a4083349f zink: add provoking vertex mode lowering
Can be used as fallback for when VK_EXT_provoking_vertex is missing

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22162>
2023-03-31 11:03:48 +00:00
antonino
9466a6e2f8 zink: add field to 'zink_gs_key' and enum
Add enum for pv emulation primitives and `lower_pv_mode`
to `zink_gs_key`

The enum contains the possible values of the lower_pv_mode key

This key will be non 0 whenever provoking vertex mode needs to be
emulated and it's exact value encodes relevant information about the
primitive that needs to be emulated

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22162>
2023-03-31 11:03:48 +00:00
antonino
34faab07da zink: simplify logic to call zink_set_primitive_emulation_keys
The logic had grown to check every primitive indivdually, instead just
check wehether `rast_prim` has changed

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22162>
2023-03-31 11:03:48 +00:00
antonino
15b3d77b40 nir: only handle flat interpolation when needed in nir_create_passthrough_gs
When turning primitives into line strips this function needs to move
attributes around, but this is not needed in other cases.

Fixes: 1a5bdca2dd ("zink: implement flat shading using inlined uniforms")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22162>
2023-03-31 11:03:48 +00:00
xurui
744cdf4262 panfrost: Check the return value of drmGetVersion
Signed-off-by: xurui <xurui@kylinos.cn>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22203>
2023-03-31 09:45:19 +00:00
Erik Faye-Lund
1aa09f3346 docs: make code-block indents consistent
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22052>
2023-03-31 09:39:17 +00:00
Erik Faye-Lund
eec6564258 docs: format code-block as toml
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22052>
2023-03-31 09:39:17 +00:00
Erik Faye-Lund
e7f00ee2c8 docs: format code-block as ini
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22052>
2023-03-31 09:39:17 +00:00
Friedrich Vock
b8ee90188b radv: Work around use-after-free compiler errors
Fixes: 4dafb69d ("radv/rt: defer library_pipeline allocation")
Tested-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21981>
2023-03-31 08:52:16 +00:00
Samuel Pitoiset
56b98bb36d radv: add dynamic support for rectangles enable/mode
This is in VK_EXT_discard_rectangles version 2.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21360>
2023-03-31 07:59:18 +00:00
Samuel Pitoiset
1577906d9f vulkan: add dynamic support for rectangles enable/mode
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21360>
2023-03-31 07:59:18 +00:00
Samuel Pitoiset
552f877b2d radv: fix sample shading when a new fragment shader is bound
Sample shading can be enabled from the pipeline and from the fragment
shader, in that case we need to re-emit some states.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22215>
2023-03-31 07:09:15 +00:00
Sagar Ghuge
a064e8ff29 intel/decoder: Bump the binding table guess value to 32
Let's bump the binding table value guess to 32 instead of 8 and also stop
decoding the binding table entries as soon as we hit the zero
initialized value in the map.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22221>
2023-03-31 01:01:53 +00:00
Alyssa Rosenzweig
4d2c8bf859 docs: Remove docs about macOS hardware drivers
We dropped support for hardware macOS drivers in afe134a49c ("asahi: Drop macOS
backend"), so drop the corresponding documentation. Layered and software drivers
are still supported on macOS for better or worse, so the main "Notes on macOS"
page can stay I think.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22213>
2023-03-31 00:55:44 +00:00
Jesse Natalie
31778ac869 microsoft/clc: Add shader model / validator to compiler API
Shader model 6.2 was the upper bounds of what *could* be generated
before, but not all devices support it. And other devices support
even more. So, let's pass in the shader model / validator that will
be used by the API caller.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21178>
2023-03-31 00:37:19 +00:00
Alyssa Rosenzweig
cd03392c7e panfrost: Choose hierarchy masks by vertex count
Currently, we always use a hierarchy mask with all levels enabled. While this is
efficient for geometry-heavy workloads like 3D games, it is wasteful for 2D
applications that draw very few vertices. For drawing just a few textured quads,
the overhead of small bin sizes outweighs any performance advantages, so it's a
bit slower. More problematically, small bin sizes require tremendous amounts of
memory for the polygon lists, leading to significant memory consumption (~10MB)
for the polygon list for even the simplest of 2D blits.

To reduce our memory footprint, we need to choose our hierarchy masks more
carefully. In general, we want to allow small bin sizes for geometry-heavy
workloads but not for geometry-light workloads. We estimate vertex count in the
driver as a proxy for this, and use a simple heuristic to select a bin size
based on the estimated vertex count. None of this is an exact science, and the
heuristic could probably be tuned. Nevertheless, the heuristic used (comparing
framebuffer size to vertex count) works well in practice, significantly reducing
the memory footprint of 2D applications like Firefox without hurting the
performance of 3D applications.

I originally wrote this patch while diagnosing high memory footprints on my
Midgard laptop, which is why only Midgard is in scope here. On Bifrost and
Valhall, we have a similar hiearchy mask selection problem. It seems likely that
the same heuristic would work there too, but it's a different code path that I
have not integrated or tested. I'll leave that for the adventurous reader, to
get the memory footprint win there too.

(It's also possible the win is smaller on newer Malis than on Midgard, since Arm
claims they optimized the tiler data structures on the newer parts. There's
probably still some merit to the idea.)

On Mali-T860, glmark2 -bdesktop frametime decreased by 1.35% +/- 0.91% at 95%
confidence, showing a slight win for 2D workloads No statistically significant
difference for glmark2 -bshading:shading=phong, since 3D workloads continue to
use the same hierarchy masks.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19482>
2023-03-31 00:19:18 +00:00
Alyssa Rosenzweig
1887b26845 panfrost: Estimate vertex count for hier mask
In the next commit, we will refine our algorithm to select hierarchy masks based
on the vertex count. In preparation, augment the driver to track rough estimates
of the vertex count so we have a "geometry complexity" input for the heuristic.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19482>
2023-03-31 00:19:18 +00:00
Alyssa Rosenzweig
cabed30111 panfrost: Clean up tiler calculations
We're about to do some work on this file. Clean it up first.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19482>
2023-03-31 00:19:18 +00:00
Danylo Piliaiev
9f43bc73da freedreno/computerator: Add support for a7xx
Not everything works correctly, e.g. stib seems flakey while stg
seems alright.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22148>
2023-03-30 23:40:48 +00:00
Danylo Piliaiev
f32eb48095 freedreno/computerator: Templatize a6xx backend
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22148>
2023-03-30 23:40:48 +00:00
Danylo Piliaiev
8558d07014 freedreno: Add dummy a730/a740 definition
Needed for assembly/disassembly.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22148>
2023-03-30 23:40:48 +00:00
Danylo Piliaiev
3389c3b84c freedreno: Move fd6_pack.h to common code accessible by computerator
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22148>
2023-03-30 23:40:48 +00:00
Danylo Piliaiev
48ad485d1c freedreno/computerator: Convert to C++
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22148>
2023-03-30 23:40:48 +00:00
Danylo Piliaiev
1ae595873f freedreno: C++ fixes for computerator to compile
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22148>
2023-03-30 23:40:48 +00:00
Danylo Piliaiev
6826a0ab14 freedreno/computerator: C++ proofing
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22148>
2023-03-30 23:40:48 +00:00
Danylo Piliaiev
5d2ddce99f freedreno/registers: More a7xx regs
Based on 011c54b0 from Jonathan Marek.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22148>
2023-03-30 23:40:48 +00:00
Danylo Piliaiev
899d142336 freedreno/registers: Document new CP_EVENT_WRITE::SEQNO
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22148>
2023-03-30 23:40:48 +00:00
Alyssa Rosenzweig
1e67f71324 panfrost: Add a v9 fast path for no images
The usual case.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21848>
2023-03-30 23:21:59 +00:00
Alyssa Rosenzweig
e6529d6dcc panfrost: Don't update access with a single batch
drawoverhead test 25 from 462->492

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21848>
2023-03-30 23:21:59 +00:00
Alyssa Rosenzweig
c224bc6f70 panfrost: Mark packs as ALWAYS_INLINE
As Intel does. These functions are written with the expectation that they will
be inlined away, allowing gcc's copy-prop and constant folding to eliminate the
template struct and any unused fields.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21848>
2023-03-30 23:21:59 +00:00
Alyssa Rosenzweig
f8b29f47a0 panfrost: Don't redundantly call emit_const_buf
On Valhall, we were calling emit_const_buf in two places:

1. The main "handle dirty flags" code shared with Bifrost
2. A Valhall-specific shader environment emitter

The latter was not dirty tracked, and the former was not used. That meant we
were calling emit_const_buf way too much. It's not a cheap routine, either.

Instead, use the results from the dirty tracked function in the shader
environment emitter, to avoid the redundant call and get the expected dirty
tracking.

In a Dolphin trace I'm looking at, fps increases 27->33.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21848>
2023-03-30 23:21:59 +00:00
Alyssa Rosenzweig
6ba62be633 panfrost: Print perf debug on seqnum overflow
Another unexpected source of flushes.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21830>
2023-03-30 22:53:16 +00:00
Alyssa Rosenzweig
9d3e01ddef panfrost: Print perf debug when flushing everything
..Even if the only batch is the one that's currently bound.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21830>
2023-03-30 22:53:16 +00:00
Mike Blumenkrantz
70b7c24206 zink: stop caching vertex states
I tried to be too clever and ended up wasting cpu cycles. it's
much, much, much, much faster to just generate this one struct array
every time than it is to do set lookups with thousands of members

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22116>
2023-03-30 22:28:38 +00:00
Mike Blumenkrantz
91ddfe55b5 zink: use fast popcnt for vstate draws
also delete some unused stubs for no dynamic vertex input since I'm never
gonna implement that path

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22116>
2023-03-30 22:28:38 +00:00
Mike Blumenkrantz
11a61ab424 zink: don't swizzle velems state for vstate draws
this isn't ever used, so don't touch it

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22116>
2023-03-30 22:28:38 +00:00
Mike Blumenkrantz
f676704fca zink: explicitly pass null velems when creating pipelines with dynamic vinput
this may or may not be a usable pointer, and it's not being read, so
don't pass it at all

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22116>
2023-03-30 22:28:38 +00:00
Mike Blumenkrantz
1ead8f7375 zink: add another vstate draw template for popcnt presence
matching radeonsi

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22116>
2023-03-30 22:28:38 +00:00
Mike Blumenkrantz
41983630c4 zink: bind vertex state directly from draw hook
this is more streamlined and readable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22116>
2023-03-30 22:28:38 +00:00
Mike Blumenkrantz
837168db20 zink: use search_or_add for masking vstate
this should be a significant perf boost instead of multiple lookups

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22116>
2023-03-30 22:28:38 +00:00
Mike Blumenkrantz
4be5caba67 zink: flag vertex buffers for rebind after vstate draws
vstate draws bind their own vertex buffers unrelated to the bound
gallium buffers, so any draw occurring after a vstate draw must
rebind vertex buffers to ensure the correct ones are bound

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22116>
2023-03-30 22:28:38 +00:00
Mike Blumenkrantz
6c3b5921b2 zink: omit VkPipelineVertexInputStateCreateInfo with dynamic vinput
this should never be used/needed

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22116>
2023-03-30 22:28:38 +00:00
Konstantin Seurer
f6147051e2 radv: Stop counting user SGPRS separately
Renames radv_declare_shader_args to declare_shader_args and runs it
twice to first gather the user SGPR count without push constants and
descriptor sets.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22119>
2023-03-30 21:52:03 +00:00
Konstantin Seurer
0c915ba501 radv: Set user SGPR locations when declaring args
Merge shader arg declaration with setting up the user data locations.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22119>
2023-03-30 21:52:03 +00:00
Harri Nieminen
fd767a4517 bin: Fix typos
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22189>
2023-03-30 21:37:00 +00:00
Mike Blumenkrantz
db582e5e7d zink: block resolves where src extents > dst extents
vulkan resolves only provide "extents" instead of src and dst regions like
GL, which means vk resolves can't be used to downscale images, as such
operations will instead just crop the image

fixes #8655

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22195>
2023-03-30 21:13:40 +00:00
Samuel Pitoiset
373c6346f5 radv: add push constant state to the cmdbuf state
Push constants are handled per bind point internally. Using a separate
structure in the cmdbuf state would allow us to update it easily
without relying on bound pipelines.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22209>
2023-03-30 20:41:23 +00:00
Samuel Pitoiset
a0baefa033 radv: copy need_indirect_descriptor_sets to radv_cmd_state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22209>
2023-03-30 20:41:23 +00:00
Samuel Pitoiset
eeefe18f05 radv: add a helper to convert a VkPipelineBindPoint
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22209>
2023-03-30 20:41:23 +00:00
Rob Clark
88f3676019 freedreno: Optimize repeated finishes
Sometimes apps (glances at stk) spin on a syncobj with very short
timeouts.  But ensuring the fence is flushed all the way through to
the kernel (including handling TC unflushed fences) only needs to
be done once.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22098>
2023-03-30 19:42:01 +00:00
Rob Clark
8416bc1c60 freedreno/drm: Disable threaded-submit for msm
We've had drm/sched support on the kernel side for more than a year and
a half.  This makes submit ioctl async by handling fence waits from the
sched's kthread, which is what threaded submit was originally working
around.  For now, threaded submit is only used for virtgpu, which does
not (yet?) have drm/sched support.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22098>
2023-03-30 19:42:01 +00:00
Rob Clark
a16533c43e freedreno/drm: Make threaded-submit optional
We've had gpu-sched support in the kernel for a while now, so our fence
waits are not synchronous in the ioctl path.  The only reason this path
still exists is that virtgpu does not have gpu-sched.  So lets disable
it on msm.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22098>
2023-03-30 19:42:01 +00:00
Rob Clark
cacbbfd6a8 mesa: Add a few more function traces
Sprinkle around a few more traces that were useful in locating fence
waits.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22098>
2023-03-30 19:42:01 +00:00
Rob Clark
c2194552e7 freedreno/drm: Stop cleanup at first active BO
Buffers are added to the deferred freelist at the tail.  And frequently
the last reference is dropped immediately after the submit.  So almost
always, once we see a still-busy BO, the remaining in the list will also
still be busy.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22098>
2023-03-30 19:42:01 +00:00
Rob Clark
712c26e2b6 freedreno/drm: Fast path for idle check
If already idle, no need to cleanup_fences() (and take related lock).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22098>
2023-03-30 19:42:00 +00:00
Mike Blumenkrantz
77c7198d76 zink: fix quads emulation gs with array variables
this was broken for e.g., gl_ClipDistance, which uses explicit array
types and therefore cannot be directly read/written

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22208>
2023-03-30 19:21:52 +00:00
Rob Clark
f9a074dd55 dri2/android: Bypass throttling
The android window system (SurfaceFlinger, et al) already does it's own
throttling.  Trying to do this also in mesa's egl is counterproductive.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22197>
2023-03-30 18:46:04 +00:00
Konstantin Seurer
816f434efc radv/rq: Rematerialize inv_dir before proceed
Helps with register pressure.

Quake II RTX:
Totals from 7 (14.29% of 49) affected shaders:

VGPRs: 688 -> 672 (-2.33%)
CodeSize: 167496 -> 167560 (+0.04%); split: -0.01%, +0.05%
MaxWaves: 70 -> 72 (+2.86%)
Instrs: 31716 -> 31760 (+0.14%); split: -0.02%, +0.16%
Latency: 385343 -> 386040 (+0.18%); split: -0.01%, +0.19%
InvThroughput: 78878 -> 78045 (-1.06%); split: -1.22%, +0.17%
VClause: 596 -> 600 (+0.67%)
Copies: 4774 -> 4747 (-0.57%); split: -0.98%, +0.42%
PreVGPRs: 617 -> 592 (-4.05%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20469>
2023-03-30 18:15:11 +00:00
Mike Blumenkrantz
9c73312248 zink: set src access when rebinding buffers, unset unordered_*
this ensures that the buffer is marked active and prevents promotion
in cases where reordering would break rendering

unordered_read prohibits write reordering for buffers, so setting
this flag must be done when the buffer is actually used, ideally as
late as possible

setting it at the time of (re)bind catches all the buffer rebind cases
which might otherwise erroneously permit reordering

fixes #8381

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22205>
2023-03-30 17:54:11 +00:00
Danylo Piliaiev
2cc9364c20 tu/drm: Support cached non-coherent memory
Requires some hand rolled assembly:
- DC CVAC / DC CIVAC for aarch64
- DCCMVAC / DCCIMVAC for arm32, unfortunately it seems that it is
  illegal to call them from userspace.
- clflush for x86-64

We handle x86-64 case because Turnip may run in x86-64 guest
e.g. in FEX-Emu or Box64.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20550>
2023-03-30 15:50:47 +00:00
Danylo Piliaiev
5a59410962 turnip: add cached and cached-coherent memory types
vkd3d requires cached memory type.

MSM backend doesn't have a special ioctl for memory
flushing/invalidation, we'd have to use cvac and civac
arm assembly instructions (would be done in following commit).

KGSL has an the ioctl for this, which is used in this commit.

Note, CTS tests doesn't seem good at testing flushing and
invalidating, the ones I found passed on KGSL with both
functions being no-op.

Based on the old patch from Jonathan Marek.

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

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20550>
2023-03-30 15:50:47 +00:00
Erik Faye-Lund
bd816084c6 zink: enable spir-v 1.6 for vulkan 1.3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18274>
2023-03-30 14:06:54 +00:00
Erik Faye-Lund
99bd1eaf3d zink: use spir-v 1.6 local-size when needed
The WorkgroupSize built-in is deprecated in SPIR-V 1.6, so let's switch
to using LocalSizeId instead, like the spec recommends.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18274>
2023-03-30 14:06:54 +00:00
Erik Faye-Lund
da895596da zink: use demote from spir-v 1.6 when possible
With SPIR-V 1.6, we don't need to enable the extension for demote any
more.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18274>
2023-03-30 14:06:54 +00:00
Erik Faye-Lund
636bfc6358 zink: emit terminate for spir-v 1.6
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18274>
2023-03-30 14:06:54 +00:00
Mike Blumenkrantz
67462ed014 zink: add spirv builder function for terminate
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18274>
2023-03-30 14:06:54 +00:00
Mike Blumenkrantz
db1371cce1 llvmpipe: fix handling of unused color attachments
if an attachment doesn't have blending or color output from the shader,
nothing should touch the attachment

this is consistent with vulkan spec and needed for upcoming cts coverage

cc: mesa-stable

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22135>
2023-03-30 12:04:22 +00:00
Mike Blumenkrantz
6a5dcd2776 llvmpipe: fix linear fs analysis with nonzero fs outputs
linear fs only works with output 0

cc: mesa-stable

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22135>
2023-03-30 12:04:22 +00:00
Samuel Pitoiset
15f1d5cc8f radv: copy ia_multi_vgt_param to the cmdbuf state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22194>
2023-03-30 11:43:06 +00:00
Samuel Pitoiset
0daffade14 radv: copy uses_{drawid,baseinstance} to the cmdbuf state
As well as the vertex user sgpr info. This also needs to be copied
for merged shaders (ie. VS+TCS).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22194>
2023-03-30 11:43:06 +00:00
Samuel Pitoiset
8fd915098d radv: copy rast_prim to the cmdbuf state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22194>
2023-03-30 11:43:06 +00:00
Samuel Pitoiset
6ee8d33ef4 radv: add a helper that returns the current rasterized primitive
For tess/geom/mesh the rasterized primitive is part of the shader
info and primitive topology should be ignored.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22194>
2023-03-30 11:43:06 +00:00
Samuel Pitoiset
b0a007583d radv: copy custom blend mode to the cmdbuf state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22194>
2023-03-30 11:43:06 +00:00
Samuel Pitoiset
bc39fa9500 radv: rework emitting inner coverage when a fragment shader is bound
To stop relying on the pipeline. The state is now flagged when a new
fragment shader with a different inner coverage setting is bound.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22194>
2023-03-30 11:43:06 +00:00
Samuel Pitoiset
5231643900 radv: remove radv_graphics_pipeline::vb_desc_alloc_size
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22192>
2023-03-30 11:21:19 +00:00
Samuel Pitoiset
b2ac40e734 radv: remove radv_graphics_pipeline::vb_desc_usage_mask
Use the VS shader info instead.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22192>
2023-03-30 11:21:19 +00:00
Samuel Pitoiset
2b1a0c0a29 radv: adjust vb_desc_usage_mask for dynamic VS inputs in the info pass
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22192>
2023-03-30 11:21:19 +00:00
Samuel Pitoiset
d87c813da1 aco: remove unused aco_shader_info::vb_desc_usage_mask
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22192>
2023-03-30 11:21:19 +00:00
Samuel Pitoiset
c7784f1409 radv: remove radv_graphics_pipeline::can_use_simple_input
Use the VS shader info instead.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22192>
2023-03-30 11:21:19 +00:00
Samuel Pitoiset
53b2b30d0b radv: remove radv_graphics_pipeline::next_vertex_stage
Use the active stages bitfield instead.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22192>
2023-03-30 11:21:18 +00:00
Samuel Pitoiset
f224e9f1a5 radv: remove radv_graphics_pipeline::last_vertex_attrib_bit
Use the VS shader info instead.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22192>
2023-03-30 11:21:18 +00:00
Samuel Pitoiset
99bca4cb50 radv: remove radv_graphics_pipeline::use_per_attribute_vb_descs
Use the VS shader info instead.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22192>
2023-03-30 11:21:18 +00:00
Patrick Lerda
5d85966805 intel: fix memory leak related to brw_nir_create_passthrough_tcs()
Indeed, the parameter "mem_ctx" was not processed.

For instance, this issue is triggered with the crocus driver and
"piglit/bin/shader_runner tests/spec/arb_tessellation_shader/execution/compatibility/tes-clip-vertex-different-from-position.shader_test -auto -fbo":
SUMMARY: AddressSanitizer: 235216 byte(s) leaked in 48 allocation(s).

Fixes: 96ba0344db ("intel: Use common helpers for TCS passthrough shaders")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22173>
2023-03-30 10:52:07 +00:00
Pierre-Eric Pelloux-Prayer
9c90deefb2 radeonsi: don't use alignment_log2 of imported buffers
This value isn't passed to the importer by the kernel
so we can't check it.

Fixes: f7a4051b83 ("radeonsi: Check pitch and offset for validity.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8431
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22170>
2023-03-30 10:14:31 +00:00
Erik Faye-Lund
ba6336ce3e docs: use version-number as toctree-title for relnotes
Using the full titles makes most of these take up two lines in the
toctree. The version number is really the only thing we should care
about, though.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21956>
2023-03-30 10:09:01 +00:00
Erik Faye-Lund
b09e1ecef0 docs: move old relnotes to _extra directory
These aren't built, so they won't get copied out into the public folder
unless we put is inside the _extra folder.

This has been broken all since the conversion to Sphinx, whoops!

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21956>
2023-03-30 10:09:01 +00:00
Lina Versace
655150918b venus: Enable VK_EXT_memory_budget
Tested dEQP-VK.info.device_memory_budget on Intel with vtest.  When the
test is ran at approximately the same time on the native driver and on
vtest, the qpa result files each report approximately the same memory
budget.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22099>
2023-03-30 09:55:40 +00:00
Lina Versace
85007a5caf venus: Refactor vn_physical_device_init_memory_properties
Improve readability.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22099>
2023-03-30 09:55:40 +00:00
Lina Versace
436a0d2609 venus: Delete vn_renderer_info::has_cache_management
It has been false since commit 247232d596, when Venus was merged
upstream in April 2021.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22099>
2023-03-30 09:55:39 +00:00
Lina Versace
e58352930e venus: Update protocol for VK_EXT_memory_budget
Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22099>
2023-03-30 09:55:39 +00:00
Karol Herbst
72b7e20bf7 nvc0: enable fp helper invocation memory loads on Turing+
Starting with GSP this will be the only way of doing so, for older gens
we'll just fix it up on the kernel side.

Cc: mesa-stable
Acked-by: M Henning <drawoc@darkrefraction.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21989>
2023-03-30 09:40:22 +00:00
Samuel Pitoiset
d147cf5a56 radv: use serialized NIR for graphics libs with the RETAIN flag
Cloning NIR shaders consumes too much RAM and this can easily explode
in memory for games that create a ton of graphics libraries. Using
serialized NIR shaders help considerably.

This reduces RAM usage in dota2 with GPL from 3GiB to 400MiB.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22143>
2023-03-30 09:02:20 +00:00
Eric Engestrom
5e413f4919 ci/broadcom: slightly increase coverage of vk tests
The previous commit has freed up a couple of runners, so let's repurpose
them to make vk test jobs take less time; with that spare time, let's
increase the coverage a little bit.

Most jobs now take 10-12 minutes, just like they used to.

Stress-tested over 40+ runs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21902>
2023-03-30 08:21:23 +00:00
Eric Engestrom
a96e51382c ci/broadcom: consolidate v3d-rpi4* jobs into a single v3d-rpi4-gl:armhf
Using now 12 instead of 14 runners, most jobs take 11-13 minutes, which
is about the same as when they were all running separately (10-13 min).

Stress-tested over 8 runs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21902>
2023-03-30 08:21:23 +00:00
Eric Engestrom
8e09be4616 ci/broadcom: consolidate vc4-rpi3* jobs into a single vc4-rpi3-gl:armhf
Without reducing the coverage and using 4 runners instead of 9, most
runs take 10-13 minutes instead of 12-13 minutes for the egl job, 9-11
minutes for the piglit job, and 6-8 minutes for the deqp job.

Stress-tested over 40+ runs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21902>
2023-03-30 08:21:23 +00:00
Rob Clark
f277d3c651 Revert "CI: Disable freedreno"
This reverts commit 6a16ed8d79.

The proxy has been rebooted

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22168>
2023-03-30 06:44:53 +00:00
Timur Kristóf
c0692dbfab radv: Move I/O lowering functions into a new file.
Also ran clang-format on the affected code.

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/21971>
2023-03-30 05:59:13 +00:00
Timur Kristóf
93e4382438 radv, ac/nir: Move sin/cos lowering to a common pass.
Also ran clang-format on the affected code.

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/21971>
2023-03-30 05:59:13 +00:00
Timur Kristóf
90bf9ed759 radv: Move radv_nir_export_multiview to new file.
Also ran clang-format on the affected code.

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/21971>
2023-03-30 05:59:13 +00:00
Timur Kristóf
685dcecb57 radv: Move radv_nir_lower_viewport_to_zero to new file.
Also ran clang-format on the affected code.

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/21971>
2023-03-30 05:59:13 +00:00
Timur Kristóf
67de4b54fe radv: Move radv_nir_lower_view_index to new file.
Also ran clang-format on the affected code.

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/21971>
2023-03-30 05:59:13 +00:00
Timur Kristóf
1e2a5858f4 radv: Move radv_nir_lower_intrinsics_early to new file.
Also ran clang-format on the affected code.

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/21971>
2023-03-30 05:59:13 +00:00
Timur Kristóf
87e7dfb5f8 radv: Move radv_nir_lower_fs_intrinsics to new file.
Also ran clang-format on the affected code.

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/21971>
2023-03-30 05:59:12 +00:00
Timur Kristóf
838defc5eb radv: Move radv_nir_lower_primitive_shading_rate to new file.
Also ran clang-format on the affected code.

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/21971>
2023-03-30 05:59:12 +00:00
Timur Kristóf
1978eaf5b2 radv: Move radv_nir_* to a new folder.
Also ran clang-format on the affected code.

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/21971>
2023-03-30 05:59:12 +00:00
Mike Blumenkrantz
dd8d52cabc kopper: apply ancillary invalidation through glthread on swapbuffers
this fixes invalidations with tc's renderpass parsing so they get picked
up before the renderpass ends

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21910>
2023-03-30 05:06:47 +00:00
Mike Blumenkrantz
bd74da9d2a glthread: add _mesa_glthread_invalidate_zsbuf()
this allows frontends to trigger ancillary invalidation before syncing

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21910>
2023-03-30 05:06:47 +00:00
Mike Blumenkrantz
0c7994bb2d mapi: add InternalInvalidateFramebufferAncillaryMESA
this allows glthread to handle ancillary buffer invalidation

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21910>
2023-03-30 05:06:47 +00:00
Mike Blumenkrantz
aa9d823318 lavapipe: move default rasterizer state values to rendering_state init
these should always be set

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
38e3132dfa lavapipe: avoid uniformly unsetting gs_output_lines
instead fix the conditional now that it's possible to tell whether
a gs is bound

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
ddf8917b2d lavapipe: only unset tess_states pointers on tes bind
this is otherwise irrelevant

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
5feeb2535b lavapipe: only update shader access for bind/unbind stages
also squash a loop

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
770d162318 lavapipe: split out gfx stage unbinding
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
42ebb995c5 lavapipe: don't double unbind gfx stages on pipeline bind
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
d97d921634 lavapipe: dynamically bind noop fs at draw time when needed
this is simpler than special casing it everywhere

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
3366b4a9b9 lavapipe: unify lvp_pipeline_nir creation
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
5880fc00c2 lavapipe: add a ref for the tess_ccw nir on creation
not sure if it matters but good to be consistent

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
d127c134eb lavapipe: refactor pipeline destroy a bit
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
30db1800e9 lavapipe: delete unused struct member
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
25a47e3cc6 lavapipe: break out all the important parts of gfx pipeline setting for reuse
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
ac1f843b28 lavapipe: pull out dynamic tess origin check in gfx pipeline bind
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
295141b39b lavapipe: don't access pipeline shader structs as much during bind
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
062bf6f455 lavapipe: PIPE_SHADER_ -> MESA_SHADER_
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
ef4df9bc01 lavapipe: merge some loops in handle_graphics_pipeline()
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
8aa59f57a0 lavapipe: refactor compute shader binding
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
39bb7785e6 lavapipe: stop using rendering_state::pipeline
access shaders directly now

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
d5857240bb lavapipe: add a device member to rendering_state
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:35 +00:00
Mike Blumenkrantz
b7197451d0 lavapipe: track bound shader stages on rendering_state
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:35 +00:00
Mike Blumenkrantz
771e0e14a8 lavapipe: refactor shader compile functions to not take pipeline params
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:35 +00:00
Mike Blumenkrantz
f986f85fdc lavapipe: don't memcpy tess_ccw when copying pipeline library shaders
this gets handled later

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:35 +00:00
Mike Blumenkrantz
9193fb2efd lavapipe: always copy streamout info when creating shaders
llvmpipe should be smart enough to figure this out internally

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:35 +00:00
Daniel Stone
80bde78084 ci/radeonsi: Skip really slow tests on stoney
These allocate way more memory than is reasonable, a bunch of times. I'd
guess they pushed the machine pretty deep into memory pressure which is
why it was all taking like 3 minutes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22193>
2023-03-30 04:16:50 +00:00
Daniel Stone
7d425b5a9b ci/radeonsi: sort and dedup stoney skips
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22193>
2023-03-30 04:16:50 +00:00
Georg Lehmann
dae13f3dc1 aco: add tests for neg(mul) with opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:35 +00:00
Georg Lehmann
02b94037f6 aco/tests: run optimize.mad_mix.input_conv.modifiers on gfx11
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:35 +00:00
Georg Lehmann
728146b2fc aco: add test for min/max combining with opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:35 +00:00
Georg Lehmann
9499f202e8 aco: add tests for cmp ordering with opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:35 +00:00
Georg Lehmann
22903bcded aco: add tests for swap operand with opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:35 +00:00
Georg Lehmann
0b29dc5c06 aco: add tests for dpp with opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
f7bb794dda aco: add tests for fma with opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
bb7c2b70c1 aco/optimizer: remove to_SDWA
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
e699a4181c aco: keep label_mul/usedef/minmax in apply_extract
16bit int mad/fma/minmax combining can work with opsel set.

All other optimizations should already check if the instruction uses sdwa,
because we don't check this when applying the label initially.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
7014145ab2 aco/optimizer: use opsel for VOP12C
Foz-DB GFX1100:
Totals from 11759 (8.72% of 134864) affected shaders:
VGPRs: 848288 -> 844556 (-0.44%); split: -0.44%, +0.00%
SpillSGPRs: 8527 -> 8543 (+0.19%)
SpillVGPRs: 1411 -> 1423 (+0.85%); split: -0.21%, +1.06%
CodeSize: 114337120 -> 113882472 (-0.40%); split: -0.40%, +0.01%
Scratch: 128768 -> 129024 (+0.20%); split: -0.20%, +0.40%
MaxWaves: 250962 -> 252014 (+0.42%)
Instrs: 22187426 -> 22062378 (-0.56%); split: -0.57%, +0.00%
Latency: 232655375 -> 232376977 (-0.12%); split: -0.20%, +0.08%
InvThroughput: 28292530 -> 28217699 (-0.26%); split: -0.45%, +0.18%
VClause: 352463 -> 352364 (-0.03%); split: -0.12%, +0.10%
SClause: 659282 -> 659354 (+0.01%); split: -0.02%, +0.04%
Copies: 1371369 -> 1342340 (-2.12%); split: -2.30%, +0.19%
Branches: 495903 -> 495941 (+0.01%); split: -0.00%, +0.01%
PreSGPRs: 867295 -> 863664 (-0.42%)
PreVGPRs: 793480 -> 790549 (-0.37%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
9650724370 aco/gfx11: allow opsel for VOP12C
Foz-DB GFX1100:
Totals from 515 (0.38% of 134864) affected shaders:
CodeSize: 2768228 -> 2761076 (-0.26%)
Instrs: 520301 -> 518523 (-0.34%)
Latency: 5190860 -> 5187254 (-0.07%)
InvThroughput: 2120844 -> 2119447 (-0.07%)
Copies: 57238 -> 56101 (-1.99%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
3907c54443 aco: don't label mul with opsel as abs/neg
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
ace017bba8 aco/ir: copy opsel when converting to DPP
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
a60b9313d3 aco: swap opsel when swapping VOP2/C operands
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
fc1bf9c3b4 aco: return true in usesModifiers for VOP12C with opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
82f7b3acfa aco: support neg(mul)/abs(mul) optimization in more cases
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
9d841507e1 aco: support v_cvt_f32_f16 with opsel in combine_mad_mix
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
9d6e223a7a aco: update match_op3_for_vop3 for VOP12C opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
0896ecec9a aco: handle opsel in combine_constant_comparison_ordering
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
d8f07a0ddc aco: handle opsel in combine_ordering_test
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
4db43415e5 aco: handle opsel in combine_comparison_ordering
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
8e6d79d10d aco/optimizer: preserve opsel when fusing fma
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
32d7a11acf aco/ra: prepare for VOP12C opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
8ee1519cee aco/to_hw_instr: use VOP1 opsel for v_mov_b16
Foz-DB GFX1100:
Totals from 4661 (3.46% of 134864) affected shaders:
CodeSize: 36500568 -> 36391704 (-0.30%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
066cee0896 aco: validate VOP12C opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
2c49b7babf aco/assembler: support VOP12C opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
9b4ea9ff90 aco/vn: hash opsel for VOP12C
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
c62e5ef82e aco/ra: don't reallocate VOP3 instruction for non-vcc lane mask
This would need to copy opsel soon but we can just reuse the old instruction.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Friedrich Vock
424825c6e5 aco: Un-swap addressable VGPRs/SGPRs in RT prolog
Fixes: 6446b79168 ("aco: implement select_rt_prolog()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22188>
2023-03-30 02:55:54 +00:00
Friedrich Vock
83a38987b1 radv/rt: Also adjust the SGPR count in postprocess_rt_config
Fixes: bea022d1f6 ("radv/rt: Add shader config combination/postprocessing utils")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22188>
2023-03-30 02:55:53 +00:00
Emma Anholt
c443503e07 perfetto: Move intel's cmdbuf/queue annotation code to the shared util.
This will let other drivers use the same way of presenting annotations
without duplicating the whole hash table thing.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22157>
2023-03-30 02:19:35 +00:00
Emma Anholt
9c364a346f perfetto: Deduplicate clock sync packet emit from renderstage sources.
This is way more horrifying than I hoped -- I can't figure out a way to
have the method be on TraceContext, so it's a static method of the
datasource, but then you have to name the templated types over and over.
You have to pass in a TraceContext because intel emits the clock sync
packet within a Trace(), and perfetto just silently corrupts the trace if
you Trace() in a Trace().

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22157>
2023-03-30 02:19:35 +00:00
Emma Anholt
3fd825d3e2 perfetto: Make a MesaRenderpassDataSource with common setup/start/stop.
Deduplicates some code from intel/tu/freedreno, and will be a common place
to put other shared code.

The downside I can see is this logging:

[013.129]      tu_perfetto.cc:122 Tracing started
[013.129]  intel_driver_ds.cc:133 Tracing started

("oh, huh, apparently data sources for both drivers are registered?  wild")

becomes:

[142.906] erfetto_renderpass.h:50 Tracing started
[142.907] erfetto_renderpass.h:50 Tracing started

("huh, why is my driver's data source being started twice?").
Unfortunately we can't easily get a string for the data source type due to
not having rtti.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22157>
2023-03-30 02:19:34 +00:00
Emma Anholt
42f1df1ec5 intel/perfetto: Drop unused "pipelined" field.
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22157>
2023-03-30 02:19:34 +00:00
Emma Anholt
da78d5d729 perfetto: Add a .clang-format for the directory.
I was frustrated trying to write code and not be able to just mash ^K^F to
format what I'd written.  This .clang-format is just cargo-cult of turnip
with a few tweaks to reduce the diff to the current directory contents.
The remaining deltas in the reformat look decent to me, and mostly bring
things closer to mesa-vague-consensus style.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22157>
2023-03-30 02:19:34 +00:00
José Roberto de Souza
66a8f7dcdb anv: Add assert in functions not supported by Xe kmd
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22171>
2023-03-30 01:57:44 +00:00
José Roberto de Souza
74ff665bd0 anv: Disable anv_bo_sync_type for Xe kmd
anv_bo_sync_type is only supported with i915, if necessary it will be
implemented for Xe kmd.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22171>
2023-03-30 01:57:44 +00:00
José Roberto de Souza
fdea48df5e anv: Implement Xe version of anv_queue_exec_locked() and queue_exec_trace()
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22171>
2023-03-30 01:57:44 +00:00
José Roberto de Souza
91ee00a741 anv: Move to a function code to clflush batch buffers
This also need to be executed in Xe kmd, so moving it to a function.
No changes in behavior intended here.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22171>
2023-03-30 01:57:44 +00:00
Juston Li
88d074cb8f util/disk_cache: use posix_fallocate() for index files
ftruncate() allocates disk space lazily. If the disk is full and it is
unable to allocate disk space when accesed via mmap(), it will crash
with a SIGBUS.

Switch to posix_fallocate(), which ensures disk space is allocated
otherwise it fails if there isn't enough disk space. The disk cache
won't be enabled in this case.

For normal cases, a small increase in disk usage as the 1.3MB index
file will be fully allocated when initialized now.

fallback to ftruncate() if posix_fallocate() isn't found.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22097>
2023-03-30 01:09:10 +00:00
Lionel Landwerlin
ba670f0cdf anv: hash immutable sampler conversion data not pointers
The conversion pointer has a vk_object_base containing pointers.

Previous commits had a similar issue, storing an internal pointer to
the array of formats in anv_format.c

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22160>
2023-03-30 00:31:20 +00:00
Ian Romanick
71e5530c07 nir/algebraic: Undistribute fsat from fmax
To be helpful, the thing inside the fsat has to be used with and without
the fsat. Otherwise it just moves a saturate destination modifier
around. To not be harmful, the fsat has to only be used by the bcsel.

All Broadwell and newer Intel platforms had similar results. (Ice Lake shown)
total instructions in shared programs: 20174475 -> 20174449 (<.01%)
instructions in affected programs: 3913 -> 3887 (-0.66%)
helped: 13 / HURT: 0

total cycles in shared programs: 866844832 -> 866844719 (<.01%)
cycles in affected programs: 46037 -> 45924 (-0.25%)
helped: 10 / HURT: 1

All Intel platforms had similar results. (Ice Lake shown)
Instructions in all programs: 161491468 -> 161491372 (-0.0%)
helped: 31 / HURT: 8

Cycles in all programs: 10933090736 -> 10933024716 (-0.0%)
helped: 32 / HURT: 18

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22169>
2023-03-29 23:48:19 +00:00
Ian Romanick
782de1932c intel/fs: Don't copy propagate from saturate to sel
There are already NIR algebraic optimizations (see also ac6646129f
("nir: Move fsat outside of fmin/fmax if second arg is 0 to 1.") that
will try to remove the saturate from things like

    fmax(0.5, fsat(x))

This basically reverts 40aeb558ce ("i965/fs: Allow propagation of
instructions with saturate flag to sel"). That commit message had no
shader-db information, so it's unclear whether this actually helped
anything ever.

No shader-db changes on any Intel platform.

One shader in Far Cry New Dawn was affected.

Cycles in all programs: 10933090738 -> 10933090736 (-0.0%)
Cycles helped: 1

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22169>
2023-03-29 23:48:19 +00:00
Rhys Perry
125ecd7e2d radv: fix setting radv_shader_info::user_data_0 with rt
Fixes raytracing pipelines.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 0e81ec98ce ("radv: move user_data_0 to the shader info pass")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22187>
2023-03-29 22:18:33 +00:00
Guilherme Gallo
47774d2414 ci/zink: Reduce zink-tu-a618-traces parallelism
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22155>
2023-03-29 21:30:19 +00:00
Guilherme Gallo
a5de0174af ci/zink: Fix zink-tu-a618-traces perf job rules
The pipeline should create this job only when it is under performance
enabled workflow, represented by the presence of
MESA_CI_PERFORMANCE_ENABLED variable.

For example:
The following pipeline
https://gitlab.freedesktop.org/gallo/mesa/-/pipelines/840525 has
`zink-tu-a618-traces-performance` job, even if it was not triggered by
marge-bot, which means that performance jobs should be disabled.

This job should appear in pipelines with performance jobs enabled
https://gitlab.freedesktop.org/gallo/mesa/-/pipelines/840529

Fixes: 93e3d37b47
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22155>
2023-03-29 21:30:19 +00:00
Marek Olšák
43dc19f44d radeonsi: simplify binning settings to work around GPU hangs
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22084>
2023-03-29 20:36:10 +00:00
Marek Olšák
281126f1d6 radeonsi/gfx11: reduce MSAA samples to 8 for no-attachment framebuffer
EQAA is unsupported

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22084>
2023-03-29 20:36:09 +00:00
Marek Olšák
e0d449dd40 amd: set the correct LLVM processor name for gfx1036
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22084>
2023-03-29 20:36:09 +00:00
Marek Olšák
0b6a7cba0b amd: rename GFX1036 -> RAPHAEL_MENDOCINO
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22084>
2023-03-29 20:36:09 +00:00
Marek Olšák
52b6886992 amd: update addrlib
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22084>
2023-03-29 20:36:09 +00:00
antonino
5fb8ba0eb8 zink/ci: remove primitive-id-no-gs-quads from radv-vangogh-fails
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
1c3a4ab896 zink: unbind generated gs in bind_last_vertex_stage
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
303e06b19d zink: improve generated gs unbinding
Avoid looping by using the new `parent` field to check if a generaetd gs
is bound and use `bind_gs_state` insted of `bind_gfx_stage` so that
`bind_last_vertex_stage` is automatically called

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
431795b9b9 zink: zink: add parent to zink_shader::non_fs
For a generated gs this field will store a pointer to the shader that
"owns" it.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
d80a35a7f7 zink: unified zink_set_primitive_emulation_keys and zink_create_primitive_emulation_gs
Those two functions shared most of the code

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
d786f52f1f zink: prevent crash when freeing
If the same vertex shader is used for more than one pipeline where for some a gs
is generated but not for others then the logic to free pipeline
libraries might use the incorrect stage_mask and try to free a non
existing gs.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
2748301a09 zink: advertise support for the quad primitive
Zink now exposes the `PIPE_PRIM_QUADS` among supported primitives and
handles them with geometry shaders.

Previously, while not exposing this capability, gallium would internally
generate an index buffer to draw them with triangles.

However the information necessary to avoid drawing the diagonal line
when using the line primitive was not preserved.

fails are added for wireframe xfb quads tests

xfb is expected to output tessellatated quads while showing a quad
without a diagonal, however there is no sane way of achieving this.

As part of the test quads will be rendered with and without xfb and the
results compared.

Now to avoid breaking xfb zink has to always split quads into triangles
when xfb is enabled. This means that the test will fail.

Previously the diagonal was always present so the test passed

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
49329b8904 zink: keep xfb properties in quad emulation gs
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
2bd72a4101 nir: keep xfb properties in nir_create_passthrough_gs
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
1c7d846bcc zink: handle provoking vertex mode for filled quads
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
0b65514775 nir/zink: handle provoking vertex mode in nir_create_passthrough_gs
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
1a5bdca2dd zink: implement flat shading using inlined uniforms
Zink will now handle flat interpolation correctly when line loops
are generated from primitives.

The flat shading information is passed to the emulation gs using constant
uniforms which get inlined.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
009ba806c9 zink: add needs_inlining to zink_shader
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
a6de15eff5 zink: add flags to zink_gfx_program and zink_context
Adds `optimal_keys` and `needs_inlining` to `zink_gfx_program` and
`is_generated_gs_bound` to `zink_context`

Those will be needed for shaders that rely on some uniforms to be
inlined

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
027ba4ccef zink: fix flat shading on filled quads
Quads emulated by zink will now have the correct provoking vertex.

Also outputs of the previous shader stage that would normally
not be passed down to the FS (when no GS is bound) will now be skipped.

Different provoking vertex modes are not handled yet.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
7eab64f1c6 zink: handle quads
Zink can now handle the quad primitive by emulating it in a gs

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
f48b699654 zink: add zink_rast_prim enum
Adds an enum with primitives that are natively by vulkan

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
e2220ee55e zink: filled quad emulation gs generation function
This change adds a function to generate a geometry shader that will take a quad
as an input (passed as a line strip with adjacency because quads are not
available as an input primitives for GS) and generate a triangle strip.

This can be used to emulate the quad primitive.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
0cb81ac38c zink: force line strip out when emulating stipple
Fixes a bug where, whenever a primtiive that has more than 2 vertices is rendered
with line stipple, the edge between the first and last vertex will have
stretched out stipple.

This happens because interpolation will occur between two non consecutive
stipple counters for the last edge
(which is between the last and first vertices).

Forcing `nir_create_passthrough_gs` to generate a line strip avoids
this because the last vertex will be duplicated and will have
the correct stipple counter for each edge.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
3b5fb8b060 nir: allow to force line strip out in nir_create_passthrough_gs
`nir_create_passthrough_gs` now allows the user to force the generated GS
to always output a line strip from the primitive
regardless of whether edgeflags are present.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
90a8525d70 zink: handle edgeflags
Vulkan has no support for edgeflags.

If the user has a geometry shader bound nothing needs to be done as edgeflags
don't work with them, otherwise a geometry shader that emulates them
is generated.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
a93685ef55 zink: add has_edgeflags flag to zink_shader and zink_gfx_program
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
24535ffb3d nir: handle edge flags in nir_create_passthrough_gs
`nir_create_passthrough_gs` will now take a boolean argument to decide
whether it needs to handle edgeflags.

When true is passed it will output a line strip where edges that
shouldn't be visible are not emitted.

This is usefull because geometry shaders will generally throw away
edgeflags so for a passthrough GS to act transparently it needs to emulate them.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
a0751e8088 nir: calculate number of vertices in nir_create_passthrough_gs
`nir_create_passthrough_gs` has been changed to take the type of primitive
as opposed to the number of vertices as an argument.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
edecb66b01 nir: avoid generating conflicting output variables
Because not all vertex outputs can have corresponding fragment inputs
(eg. edgeflags) some logic is needed to correctly generate variables in
a passthough gs.

Before this change some output variables ened up with the same location.

Fixes: d0342e28b3 ("nir: Add helper to create passthrough GS shader")

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:39 +00:00
antonino
ea14579f3d nir: handle primitives with adjacency
`nir_create_passthrough_gs` can now handle primitives with adjacency where some
vertices need to be skipped.

Fixes: d0342e28b3 ("nir: Add helper to create passthrough GS shader")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:39 +00:00
antonino
eedbf9046e zink: handle switching between primitives
Zink will generate geometry shaders to emulate certain features, however there
might be different variants of those depending on the primitive type.

This commits adds the logic to generate or bind the correct emulation GS
in the case where nothing changes except the primitive type.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:39 +00:00
Marcin Ślusarz
32107d8b5a intel/compiler: compactify locations of mesh outputs
Needed in support of anv code for Wa_14015590813.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17622>
2023-03-29 18:35:55 +00:00
Marcin Ślusarz
1f41198772 anv: work around for per-prim attributes corruption
Wa_14015590813 for gfx 12.5

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17622>
2023-03-29 18:35:55 +00:00
Eric Anholt
f113b55e25 ci/broadcom: Skip another texelfetch case.
This one has also flaked a pipeline recently with a timeout.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22177>
2023-03-29 17:36:53 +00:00
Eric Anholt
ae0aae797f ci/freedreno: Flake KHR-GL45.shader_image_load_store.basic-allTargets-store
It has UnexpectedPassed a couple of times recently.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22177>
2023-03-29 17:36:53 +00:00
Sil Vilerino
0d0221a574 nir: Fix use of alloca() without #include c99_alloca.h
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22150>
2023-03-29 16:56:42 +00:00
Emma Anholt
d3bbbc4c6c glsl: Drop dead prototype.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21940>
2023-03-29 16:06:03 +00:00
Emma Anholt
d2a3fa7569 glsl: Remove the TessLevel lowering special case from xfb.
The NIR vectorized tess level pass applies later, and it leaves the name
as-is, so we don't need to mess around with
gl_TessLevelInnerMesa/OuterMesa.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21940>
2023-03-29 16:06:03 +00:00
Emma Anholt
84006587d7 glsl: Delete the lower_tess_level pass.
NIR i/o lowering and sysval lowering can handle the compact var fine at
this point.

Affects: nouveau, virgl, svga, radeonsi, r600, llvmpipe.  Does not affect
PIPE_CAP_NIR_COMPACT_ARRAYS drivers like crocus, iris, d3d12, freedreno,
zink.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21940>
2023-03-29 16:06:03 +00:00
Emma Anholt
c2a9dd693b nir_to_tgsi: Handle stores to compact outputs.
We had been relying on glsl lowering to a vec4 output, but we can just do
a tiny override here to support compact variables and drop the lowering
pass.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21940>
2023-03-29 16:06:03 +00:00
Emma Anholt
ceef2b9982 nir/lower_sysvals: Add support for un-lowered tess_level_inner/outer.
GLSL has been responsible for doing this, but we can just extract the
array index here.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21940>
2023-03-29 16:06:03 +00:00
Emma Anholt
6ee4cd239d gallivm: Skip loads/stores that are definitely outside of compact vars.
As I reduce GLSL lowering code, OOB TessLevel accesses can end up making
it to the backend.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21940>
2023-03-29 16:06:03 +00:00
Ryan Neph
ac9d36a42a venus: re-use VN_DEBUG_NO_ABORT to disable ring monitoring abort()
Useful to keep the hung guest process alive while debugging the renderer
process.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22176>
2023-03-29 15:48:38 +00:00
Timur Kristóf
b688a6d227 nir: Remove IB address and stride intrinsics.
RADV used these to emulate firstTask for NV_mesh_shader.
They are no longer needed.

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/22139>
2023-03-29 15:08:55 +00:00
Timur Kristóf
b0cae2fafe ac/nir: Remove ac_nir_apply_first_task_to_task_shader.
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/22139>
2023-03-29 15:08:55 +00:00
Timur Kristóf
3093622f35 ac/nir/ngg: Remove NV_mesh_shader support.
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/22139>
2023-03-29 15:08:55 +00:00
Timur Kristóf
a677fc5999 radv: Clean up emitting zero mesh shader draw id.
When task shaders are also used,
the draw id is undefined in mesh 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/22139>
2023-03-29 15:08:55 +00:00
Timur Kristóf
8a426be553 radv: Remove first_task and ib_addr/ib_stride.
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/22139>
2023-03-29 15:08:55 +00:00
Timur Kristóf
945384b504 radv: Remove NV_mesh_shader API entrypoints.
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/22139>
2023-03-29 15:08:55 +00:00
Timur Kristóf
faf8375fc3 radv: Don't expose NV_mesh_shader and don't use it in CI.
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/22139>
2023-03-29 15:08:55 +00:00
Lionel Landwerlin
937924f2a5 iris: implement recommended flush/wait of AUX-TT invalidation
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22183>
2023-03-29 13:18:49 +00:00
Lionel Landwerlin
763854f7e3 anv: implement recommended flush/wait of AUX-TT invalidation
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22183>
2023-03-29 13:18:49 +00:00
Jarred Davies
d1b5b2901f pvr: Mark all normalized formats as supporting with_packed_usc_channel
Avoids assert seen in dEQP-VK.api.smoke.triangle

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22174>
2023-03-29 13:00:37 +00:00
Erik Faye-Lund
c825303a0f docs: drop reference to modindex
We don't render such a page, so there's no point in linking to it.

Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22022>
2023-03-29 12:53:26 +00:00
Samuel Pitoiset
a19fd0f634 radv: replace pipeline->force_vrs_per_vertex during cmdbuf recording
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22128>
2023-03-29 10:18:24 +00:00
Samuel Pitoiset
09f81e024c radv: replace pipeline->is_ngg occurrences during cmdbuf recording
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22128>
2023-03-29 10:18:24 +00:00
Samuel Pitoiset
0e81ec98ce radv: move user_data_0 to the shader info pass
Using the next stage is enough to determine the base reg.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22128>
2023-03-29 10:18:24 +00:00
Samuel Pitoiset
dd855c7772 radv: determine and store the next graphics stage to radv_shader_info
This will be useful in many cases.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22128>
2023-03-29 10:18:24 +00:00
Samuel Pitoiset
d109362a3d radv: copy bound shaders to the cmdbuf state
To stop relying on the pipeline everywhere.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22128>
2023-03-29 10:18:24 +00:00
Samuel Pitoiset
16bd3664da radv: move dirtying flags for mesh shading to radv_bind_pre_rast_shader()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22128>
2023-03-29 10:18:24 +00:00
Samuel Pitoiset
0fbe0c4d1b radv: stop using last_vgt_api_stage_{locs} during cmdbuf recording
Use the last VGT shader instead.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22128>
2023-03-29 10:18:24 +00:00
Samuel Pitoiset
2dfe49a948 radv: determine the last VGT shader at pipeline bind time
And replace streamout_shader by last_vgt_shader which is similar.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22128>
2023-03-29 10:18:24 +00:00
Samuel Pitoiset
19c329f4f9 radv: keep track of active stages as part of the cmdbuf state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22128>
2023-03-29 10:18:24 +00:00
Samuel Pitoiset
6caa180dc7 radv: add an assertion about shader stage to radv_bind_pre_rast_shader()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22128>
2023-03-29 10:18:24 +00:00
Samuel Pitoiset
1f878334c0 radv: add radv_bind_shader() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22128>
2023-03-29 10:18:24 +00:00
Samuel Pitoiset
59a2a4f87f radv: pass a shaders array to radv_get_shader()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22128>
2023-03-29 10:18:24 +00:00
Samuel Pitoiset
52fa8e1f61 radv: pass shader/base_reg to radv_emit_view_index_per_stage
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22128>
2023-03-29 10:18:24 +00:00
Eric Engestrom
1f552f1bf3 kmsro: sort drivers alphabetically
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22144>
2023-03-29 09:34:30 +00:00
Eric Engestrom
5cf91a6406 kmsro: uniformize renderonly creation
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22144>
2023-03-29 09:34:30 +00:00
Eric Engestrom
c7723da5be vc4: change create_renderonly signature to uniformize it
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22144>
2023-03-29 09:34:30 +00:00
Eric Engestrom
ed12e071ab v3d: change create_renderonly signature to uniformize it
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22144>
2023-03-29 09:34:30 +00:00
Eric Engestrom
6caa166ffe panfrost: change create_renderonly signature to uniformize it
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22144>
2023-03-29 09:34:29 +00:00
Eric Engestrom
b5082223be lima: change create_renderonly signature to uniformize it
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22144>
2023-03-29 09:34:29 +00:00
Eric Engestrom
d0c845ecb0 freedreno: change create_renderonly signature to uniformize it
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22144>
2023-03-29 09:34:29 +00:00
Eric Engestrom
09f42948ad etnaviv: change create_renderonly signature to uniformize it
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22144>
2023-03-29 09:34:29 +00:00
Eric Engestrom
49996def65 asahi: change create_renderonly signature to uniformize it
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22144>
2023-03-29 09:34:29 +00:00
Mike Blumenkrantz
66fe427ebc zink: stop leaking separate shader nir
this is a huge memleak

Fixes: e3b746e3a3 ("zink: use GPL to handle (simple) separate shader objects")

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22175>
2023-03-29 08:14:01 +00:00
Emma Anholt
ba48753b5f ci/zink: Update the tgl manual run xfails.
These have been consistent for 3 runs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22146>
2023-03-29 07:52:45 +00:00
Emma Anholt
4219a3c049 ci/etnaviv: Polish the gc2000 xfails a bit.
These were consistent in the last 3 CI runs.  The rest of the failures in
those runs were flakes spread all around the general shader tests, which
are correlated with GPU hangs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22146>
2023-03-29 07:52:45 +00:00
Emma Anholt
04d1c71e4d ci/crocus: Fix 1.3.5.0 xfails.
Whoops, copy and pasted the wrong lines from another board, this GPU is
GL4.6 not 4.5.

Fixes: ecca3b9655 ("ci/crocus: Update expectations from VK CTS 1.3.5.0.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22146>
2023-03-29 07:52:45 +00:00
Sai Teja Pottumuttu
11d32fb44f anv: Fix stride mismatch in mesa and minigbm
It is observed that in display resolutions where width is not equal to
stride, vulkan rendering is being distorted. This is happening due to
stride calculation mismatch between minigbm and mesa.

This fix makes sure that the stride calculated in minigbm is passed to
anv and isl.

The issue was found while debugging the following android cts tests and
thus fixes them as well.
android.graphics.cts.VulkanPreTransformTest#testVulkanPreTransformNotSetToMatchCurrentTransform
android.graphics.cts.VulkanPreTransformTest#testVulkanPreTransformSetToMatchCurrentTransform

Signed-off-by: Sai Teja Pottumuttu <sai.teja.pottumuttu@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22163>
2023-03-29 07:09:28 +00:00
Tapani Pälli
ca4ec49b0e anv: use primitive ID override when shader does not supply it
Patch moves over this fix from iris driver.

Fixes following test on DG2:
   dEQP-VK.rasterization.culling.primitive_id

Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com> [v1]
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22130>
2023-03-29 02:43:57 +00:00
Samuel Pitoiset
84faaca38a radv: stop using the pipeline for emitting shaders
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22095>
2023-03-29 02:20:50 +00:00
Samuel Pitoiset
8f9b0088ab radv: pass the ES shader to radv_pipeline_emit_hw_ngg()
This allows to remove the radv_pipeline dependency.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22095>
2023-03-29 02:20:50 +00:00
Samuel Pitoiset
69da185793 radv: use the ES type to apply a workaround for NGG on GFX10
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22095>
2023-03-29 02:20:50 +00:00
Samuel Pitoiset
73ac2a22ec radv: use the shader info stage to simplify emitting NGG shaders
Instead of relying on the pipeline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22095>
2023-03-29 02:20:50 +00:00
Samuel Pitoiset
09d713ee53 radv: stop using the pipeline for emitting PS inputs
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22095>
2023-03-29 02:20:50 +00:00
Samuel Pitoiset
168f282908 radv: add radv_get_last_vgt_shader() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22095>
2023-03-29 02:20:50 +00:00
Samuel Pitoiset
5c3c80be45 radv: emit the GS copy shader outside of radv_pipeline_emit_hw_gs()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22095>
2023-03-29 02:20:50 +00:00
Samuel Pitoiset
d071e36851 radv: stop using get_vs_output_info() when emitting VS/NGG shaders
It's always the current shader outinfo struct.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22095>
2023-03-29 02:20:50 +00:00
Luigi Santivetti
71fd9c2be0 pvr: fix segfault in dEQP-VK.ycbcr.query.*
Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22061>
2023-03-29 00:17:40 +00:00
Georg Lehmann
fd3ea4ffc2 aco: clean up to_mad_mix
These instructions are 32bit, so they don't support opsel anyway.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22103>
2023-03-28 23:30:08 +00:00
Samuel Pitoiset
51237a6508 radv/ci: update CI lists for Polaris10 and Pitcairn
Recent ac/surface changes fixed those.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22127>
2023-03-28 22:56:15 +00:00
Mike Blumenkrantz
4147dbdb7e zink: use c++ template to deduplicate image barrier functions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22057>
2023-03-28 22:28:59 +00:00
Mike Blumenkrantz
46d324e9a7 zink: minor tweaks for image barriers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22057>
2023-03-28 22:28:59 +00:00
Mike Blumenkrantz
60af511fc6 zink: use c++ template to deduplicate all the buffer barrier code
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22057>
2023-03-28 22:28:59 +00:00
Mike Blumenkrantz
bf0af0f8ed zink: move all barrier-related functions to c++
this will enable a lot of deduplication

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22057>
2023-03-28 22:28:59 +00:00
Mike Blumenkrantz
f5fe8d4f5c zink: break out a src region barrier check for reuse
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22057>
2023-03-28 22:28:59 +00:00
Mike Blumenkrantz
d8f3f6613a zink: fix some type mismatches for c++ compilation
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22057>
2023-03-28 22:28:59 +00:00
Alyssa Rosenzweig
145295e517 asahi: Don't lie about seamless cube maps
Now that mesa/st is setting seamless_cube_map properly we don't need to play any
games here. Remove the hack workaround.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21978>
2023-03-28 21:30:12 +00:00
Alyssa Rosenzweig
bf3027c391 mesa/st: Normalize wrap modes for seamless cubes
The OpenGL specification requires that seamless cube maps ignore the wrap mode,
but some hardware may try to respect the wrap mode even for seamless cubes
contrary to the spec. Since OpenGL maps samplers 1:1 to textures (at least
without bindless texture support...), it's easy to override the wrap mode for
seamless cubes to something that works for the hardware.

I'm not sure if there is value in gating this behaviour behind a CAP. On one
hand, there is a tiny bit of extra CPU overhead added to change samplers. On the
other hand, normalizing wrap modes might improve CSO caching, and normalizing to
a non-BORDER mode avoids the expensive border colour code later in the function.

We will need a different workaround in our Vulkan driver. Potentially, we'll
have to duplicate *every* sampler to have a cubemap version and a non-cubemap
version, selecting a sampler in the shader based on the texture opcode. That
sucks and implementing it would depend on subtle details of how we implement
descriptor sets, so it's not like we would share that code with the GL driver
anyway. In the mean time, let's get this right for GL without the performance
hit of duplication.

Fixes dEQP-GLES3.functional.texture.filtering.cube.* on Asahi, as well as a
smattering of dEQP-GLES31.functional.texture.filtering.cube_array.* fails on
softpipe.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21978>
2023-03-28 21:30:12 +00:00
Alyssa Rosenzweig
f2506780c8 mesa/st: Only set seamless for GLES3
6148e3aae7 ("mesa: Fix ctx->Texture.CubeMapSeamless") introduced a hack, where
seamless cube maps would be requested even for GLES2 contexts despite the spec,
on the assumption that GLES2 gallium drivers would ignore the bit. But that
requires Gallium drivers to know what GLES version they advertise, which is a
horrible layering violation. When the commit was written 8 years ago, there were
classic drivers to contend with so it made sense as a fix to get GLES 3.0 up and
running. With classic drivers gone, it's time to sunset the hack and restore the
intended behaviour by setting ctx->Texture.CubeMapSeamless only once we know the
version.

In addition to fixing a semantic issue in the Gallium contract and preventing a
regression from the next commit, this fixes cube maps on Mali-T720 under
Panfrost. In general, Panfrost supports GLES3 (and honours the seamless flag
everywhere) but on T720 we only advertise GLES2 due to missing MRT support on
older Midgard devices, so we need the flag set properly to distinguish these
cases.

Cc: mesa-stable
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21978>
2023-03-28 21:30:12 +00:00
Paul Gofman
1646f7d977 driconf: add a workaround for Kaiju-A-Gogo
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22152>
2023-03-28 20:35:11 +00:00
Qiang Yu
aa314c746f radeonsi: monolithic PS emit epilog in nir directly
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/21552>
2023-03-28 19:57:11 +00:00
Qiang Yu
c182154456 ac/nir: add ac_nir_lower_ps
Lower ps output to nir_export_amd.

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/21552>
2023-03-28 19:57:11 +00:00
Qiang Yu
bf9c1699cd nir: add nir_fisnan helper function
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/21552>
2023-03-28 19:57:11 +00:00
Qiang Yu
c9d60547ef nir,radeonsi: add and implement nir_load_alpha_reference_amd
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/21552>
2023-03-28 19:57:11 +00:00
Qiang Yu
67f295f1e2 aco: implement float16 nir_op_pack_(s|u)norm_2x16
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21552>
2023-03-28 19:57:11 +00:00
Qiang Yu
3df1c4455e ac/llvm: implement float16 nir_op_pack_(s|u)norm_2x16
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/21552>
2023-03-28 19:57:11 +00:00
Qiang Yu
6848e05f9c nir: pack_(s|u)norm_2x16 support float16 as input
For AMD GPU which has instruction to normalize and pack two float16
inputs, and used when fragment shader export color output.

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/21552>
2023-03-28 19:57:11 +00:00
José Roberto de Souza
c30194e9ec intel: Allocate mesh shader URB space before task shader
A future platform requires that mesh shader URB space be allocated
before task shader URB space.

If task shader is enabled, it will align the mesh shader URB size to
8Kb and give the remaning back to task shader. Otherwise, no aligment
is needed, and mesh shader will have all the URB space.

BSpec: 56229, 56230
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21603>
2023-03-28 19:25:34 +00:00
Konstantin Seurer
b69ec8bde3 radv/rt: Refactor rq_load lowering
This just gets rid of all the bcsel emissions.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21455>
2023-03-28 16:55:30 +00:00
Mike Blumenkrantz
83929f9955 aux/trace: fix GALLIUM_TRACE_NIR handling
this now correctly doesn't dump nir when the counter is zero

Fixes: f99eab23ad ("aux/trace: delete GALLIUM_TRACE_NIR log message")

Reviewed-by: Matti Hämäläinen <ccr@tnsp.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22164>
2023-03-28 16:17:39 +00:00
Mike Blumenkrantz
62789086e4 aux/trace: dump blend states with enums
this is more readable

Reviewed-by: Matti Hämäläinen <ccr@tnsp.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22164>
2023-03-28 16:17:39 +00:00
Pierre-Eric Pelloux-Prayer
c1050b5330 radv: add RADV_DEBUG=extra_md
This enables the use of UMD metadata v2. This allows tools (eg umr)
import buffers.

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/21984>
2023-03-28 15:17:28 +00:00
Pierre-Eric Pelloux-Prayer
f315774727 radeonsi: don't use si_decompress_dcc if the blitter is running
Otherwise this will cause a blitter recursion which will crash at
some point.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21984>
2023-03-28 15:17:28 +00:00
Pierre-Eric Pelloux-Prayer
46d2655a18 radeonsi: add AMD_DEBUG=extra_md
When this debug flag is set, the driver sets the umd metadata for
all color textures and enables the use of extended metadata.

Extended metadata allows umr to import textures and setting these
on all color texture allows to import non-exported textures
(eg: dGPU draw surface when DRI_PRIME=1 is used).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21984>
2023-03-28 15:17:28 +00:00
Pierre-Eric Pelloux-Prayer
7f94b80001 ac/surface: introduce umd metadata v2
Update the metadata format. For gfx8- chips nothing change.

For gfx9 chips:
* for textures without a valid modifier a dw is added at index=10
  containing the stride
* for textures with a valid modifier the modifier is stored at
  index 10 and 11. Then the number of planes is stored at 12.
  Then for each plane the offset and the stride are stored.

The goal here is to be able to create textures from dmabuf from
umr - without these changes this is impossible because these
values can't be guessed.

The new layout is compatible with version=1 so old/new UMD can
be used together without issues and isn't used by default.
For radeonsi, it will be possible to use it with a AMD_DEBUG=...
option.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21984>
2023-03-28 15:17:28 +00:00
Pierre-Eric Pelloux-Prayer
4abb911bd2 amd/surface: rename metadata functions
Use more specific verbs to avoid confusion:
   set -> apply
   get -> compute

Reviewed-by: Marek Olšák <marek.olsak@amd.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/21984>
2023-03-28 15:17:28 +00:00
Pierre-Eric Pelloux-Prayer
e272e59e40 mesa: fix CopyImageSubDataOES with GL_TEXTURE_EXTERNAL_OES
GL_TEXTURE_EXTERNAL_OES is allowed on GLES (any version) and glCopyImageSubDataOES
is implemented as an alias of CopyImageSubData.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21984>
2023-03-28 15:17:28 +00:00
Marcin Ślusarz
0c76e088f2 anv: call nir_shader_gather_info early
Shader info is needed for mesh in linking (in nir_lower_io_to_scalar_early,
see commit 5e144454) and will be needed once MR !17622 (anv: work around
for per-prim attributes corruption) lands.

We still need to call nir_shader_gather_info in anv_pipeline_lower_nir,
because the information got stale between anv_graphics_pipeline_load_nir
and anv_pipeline_lower_nir. Some examples:
- some FS inputs were marked as per-primitive during linking
  (brw_nir_link_shaders) affecting per_primitive_inputs mask
- some inputs and outputs were removed, because they are not used
  (nir_remove_unused_varyings) affecting outputs_written and inputs_read

This fixes func.mesh.ext.outputs.per_primitive.unused crucible test on DG2.
(I didn't know this test wasn't fixed by 5e144454, because I was testing
with !17622 merged-in, which added its own nir_shader_gather_info before
nir_lower_io_to_scalar_early).

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21787>
2023-03-28 14:41:54 +00:00
Daniel Stone
6a16ed8d79 CI: Disable freedreno
The proxy has been broken ever since the network went down.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22161>
2023-03-28 13:09:08 +00:00
Georg Lehmann
16c03fd756 aco/util: override default assignment operator for bitfield helpers
Otherwise, the default assignment operator copies the whole uint,
not just few bits we are interested in.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Fixes: e7559da757 ("aco: add bitfield array helper classes")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22154>
2023-03-28 10:49:07 +00:00
Georg Lehmann
ed03696ed9 aco/ir: fix copy paste bug in convert_to_SDWA
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Fixes: 60cd3ba39f ("aco: copy abs/neg with assignment")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22154>
2023-03-28 10:49:07 +00:00
Friedrich Vock
1979e551a8 aco: Swap operands for v_and_b32 in RT prolog
The second operand must be a VGPR, only the first can be a literal.
With a literal, this code was wrongly assembled and resulted in artifacts on GFX11.

Fixes: 6446b79168 ("aco: implement select_rt_prolog()")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8642
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22142>
2023-03-28 09:16:56 +00:00
Timur Kristóf
fd1e27a8f8 radv: Fix swizzled VS input loads when some components are unused.
Fix how out-of-bounds loads are decided.
It was incorrect because it mismatched the swizzle.
The decision is now made using the loaded num_components.

Fixes: 27c8131978
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8712
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22124>
2023-03-28 08:37:28 +00:00
Samuel Pitoiset
5bf6f6fed1 radv/rt: bind the pipeline stack when it's not dynamic
This overwrites the rt_stack_size cmdbuf state when a new rt pipeline
with a static stack size is bound.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22126>
2023-03-28 06:56:14 +00:00
Alyssa Rosenzweig
0f974d1f90 asahi: Convert to SPDX headers
Also drop my email address in the copyright lines and fix some "Copyright 208
Alyssa Rosenzweig" lines, I'm not *that* old. Together this drops a lot of
boilerplate without losing any meaningful licensing information. SPDX is already
in use for the MIT-licensed code in turnip, venus, and a few other scattered
parts of the tree, so this should be ok from a Mesa licensing standpoint.

This reduces friction to create new files, by parsing the copy/paste boilerplate
and being short enough you can easily type it out if you want.  It makes new
files seem less daunting: 20 lines of header for 30 lines of code is
discouraging, but 2 lines of header for 30 lines of code is reasonable for a
simple compiler pass. This has technical effects, as lowering the barrier to
making new files should encourage people to split code into more modular files
with (hopefully positive) effects on project compile time.

This helps with consistency between files. Across the tree we have at least a
half dozen variants of the MIT license text (probably more), plus code that uses
SPDX headers instead. I've already been using SPDX headers in Asahi manually, so
you can tell old vs new code based on the headers.

Finally, it means less for reviewers to scroll through adding files. Minimal
actual cognitive burden for reviewers thanks to banner blindness, but the big
headers still bloat diffs that add/delete files.

I originally proposed this in December (for much more of the tree) but someone
requested I wait until January to discuss. I've been trying to get in touch with
them since then. It is now almost April and, with still no response, I'd like to
press forward with this. So with a joint sign-off from the major authors of the
code in question, let's do this.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Emma Anholt <emma@anholt.net>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Rose Hudson <rose@krx.sh>
Acked-by: Lyude Paul [over IRC: "yes I'm fine with that"]
Meh'd-by: Rob Clark <robdclark@chromium.org>

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22062>
2023-03-28 05:14:00 +00:00
Lina Versace
ede5fed450 mailmap: Add Lina's new google.com address
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22153>
2023-03-28 03:37:43 +00:00
Harri Nieminen
ecf7a7da1b docs/svga3d: Fix typo
Found by codespell

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22149>
2023-03-28 02:31:05 +00:00
Harri Nieminen
1ffd591562 docs/panfrost: Fix typo
Found by codespell

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22149>
2023-03-28 02:31:05 +00:00
Harri Nieminen
eff5d950ea docs/freedreno: Fix typos
Found by codespell

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22149>
2023-03-28 02:31:05 +00:00
Harri Nieminen
c9378106ed docs/gallium: Fix typos
Found by codespell

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22149>
2023-03-28 02:31:05 +00:00
Harri Nieminen
8ebc01ee0b docs/specs: Fix typos
Found by codespell

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22149>
2023-03-28 02:31:05 +00:00
Filip Gawin
fa6ecd0032 crocus: don't quantize the clear value
Helps with:
spec@!opengl 1.0@depth-clear-precision-check@depth32f_stencil8,UnexpectedPass
spec@!opengl 3.0@clearbuffer-bug,UnexpectedPass

Cc: mesa-stable

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22137>
2023-03-27 23:15:41 +00:00
Marek Olšák
5d8f0c570e amd/llvm: remove no-op code for vec3 loads in ac_build_tbuffer_load
Formatted loads always support vec3, so this code didn't do anything.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22117>
2023-03-27 22:38:07 +00:00
Marek Olšák
03c97b212e amd/llvm: fix handling of unsupported vec3 loads on gfx6
VMEM loads promoted from vec3 to vec4 didn't trim the vector, thus
returning vec4 on gfx6 and vec3 on later generations, which callers
don't expect.

SMEM loads were adding an extra component on gfx6, causing same issues.

Fixes: 82919e2d - amd: lower subdword UBO loads in NIR
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8693

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22117>
2023-03-27 22:38:07 +00:00
Georg Lehmann
dde7c5506c aco: make .clang-format usable with tests
Code between BEGIN_TEST and END_TEST should be indented,
and comments used by the test itself should not be reformatted.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22122>
2023-03-27 20:43:22 +00:00
Iago Toral Quiroga
40a00fc065 v3dv: fix format swizzle for buffer views
Fixes:
dEQP-VK.api.buffer_view.access.uniform_texel_buffer.b8g8r8a8_unorm

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22131>
2023-03-27 20:16:04 +00:00
Iago Toral Quiroga
3647b05ae9 v3dv: pause occlusion queries during vkCmdClearAttachments
We implement this by emitting a draw call, which should not be registered
during occlusion query counting.

Fixes:
dEQP-VK.query_pool.occlusion_query*clear*

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22131>
2023-03-27 20:16:04 +00:00
Samuel Pitoiset
e61d68ac8a radv: move {esgs,gsvs}_ring_size to radv_legacy_gs_info
To update the ring info when a geometry shader is bound.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22134>
2023-03-27 18:54:50 +00:00
Samuel Pitoiset
c1c8aa49c8 radv: rename gfx9_gs_info to radv_legacy_gs_info
This was misleading because it's also needed on GFX6-8.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22134>
2023-03-27 18:54:50 +00:00
Jarred Davies
bc6f95c53e pvr: Add robustness buffer support
The robustness buffer is used when no vertex attribute can be loaded and
robustBufferAccess is enabled.

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21579>
2023-03-27 18:36:32 +00:00
Jarred Davies
5fdfcc9913 pvr: Rename pvr_xgl_pds.c to pvr_pipeline_pds.c
Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21579>
2023-03-27 18:36:32 +00:00
Jarred Davies
bb8d47b09b pvr: Always mark robustBufferAccess as supported
As per the Vulkan spec, this is a required feature for graphics implementations.

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21579>
2023-03-27 18:36:32 +00:00
Ilya K
679c84142f intel/vk/grl: don't install libgrl.a
It isn't used by anything at runtime and shouldn't be installed.
Saves about 3MB of space on the final artifacts on x86_64-linux.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8711
Fixes: 63966505 ("anv/grl: Build OpenCL kernels")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22133>
2023-03-27 18:00:48 +00:00
Samuel Pitoiset
cb9f94f84c radv: stop checking dynamic states when emitting the guardband state
If the primitive topology is part of the PSO, it's copied at pipeline
bind time to the dynamic state, so this checks is unnecessary.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22105>
2023-03-27 17:29:03 +00:00
Samuel Pitoiset
66fec16238 radv: add DI_PT_RECTLIST to si_conv_prim_to_gs_out()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22105>
2023-03-27 17:29:02 +00:00
Georg Lehmann
5e9ea15484 aco: fix p_interp_gfx11 comment
It no longer uses a tmp exec and scc.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22107>
2023-03-27 15:09:21 +00:00
Georg Lehmann
b1668aedaf aco: don't check usesModifiers for pseudo instructions
This can't happen.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22106>
2023-03-27 14:22:07 +00:00
Lucas Stach
9df5a2bd62 etnaviv: fix texture barrier implementation
The current implementation has a number of issues:
- it doesn't flush the depth cache, even though this can also be changed
  due to fragment shader operations and thus is included in the definition
  of glTextureBarrier
- it doesn't flush the vertex sampler cache
- it doesn't stall the pipeline until the flushes are done

Fix those issues and drop the comment, as it's pretty clear from the
code what is being done.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22104>
2023-03-27 14:03:53 +00:00
Lucas Stach
77ab87e5a7 etnaviv: flush VS texture cache when texture data is changed
If a sampler resource is changed the vertex texture caches also need to
be flushed, as those are separate from the fragment texture caches.

It seems that some cores need the VS sampler cache flush to be in a
separate state. I have seen no adverse effects of merging the TEXTUREVS
flush into a single flush state emission on GC3000 and up, but the blob
always emits the vertex sampler cache flush as a separate state, so do
the same here to avoid nasty surprises.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22104>
2023-03-27 14:03:53 +00:00
Erik Faye-Lund
e7ee11f89a docs/freedreno: fix turnip-heading level
Having two top-level headings in an article confuses Sphinx, and makes
both appear as separate articles in the toc-tree.

It doesn't seem like there's a good reason why the following headings
should be nested under the "Turnip"-heading anyway, so let's just make
it a sibling to the "Hardware architecture" heading.

Acked-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21948>
2023-03-27 10:01:23 +00:00
Samuel Pitoiset
8f6998ad8a radv: separate the sample shading state between FS and graphics pipeline
Sample shading can be enabled inside the fragment shader and also
per-pipeline. Separate both cases to be able to enable sample shading
by only binding a FS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22110>
2023-03-27 09:29:12 +00:00
Samuel Pitoiset
774e055823 radv: move uses_user_sample_locations to radv_multisample_state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22110>
2023-03-27 09:29:11 +00:00
Samuel Pitoiset
609edd6e96 radv: copy the multisample state to radv_cmd_state
To avoid relying on the pipeline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22110>
2023-03-27 09:29:11 +00:00
Tatsuyuki Ishi
f5e8944dd6 amd: Add radv_foreach_stage to ForEachMacros.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22092>
2023-03-27 08:29:35 +00:00
Marcin Ślusarz
698135fd3e anv,hasvk: remove stale comments
Added in 060a6434ec.
The field it described was removed in c1f4343807.

Fixes: c1f4343807 ("anv: Set up memory types and heaps during physical device init")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22113>
2023-03-27 07:48:17 +00:00
Samuel Pitoiset
4dc40c3b64 radv: move radv_meta_* to a new folder
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22046>
2023-03-27 06:27:49 +00:00
David Heidelberg
5e0c8a6555 ci/broadcom: test occasionally fails, but typically passes
Flake still present.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22125>
2023-03-27 02:10:43 +02:00
Erik Faye-Lund
04bfb71fa1 docs: prefer http-links over ftp
None of the major browsers supports FTP links. While it's fine to have
FTP links as alternatives, let's change these links into HTTP links
instead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22033>
2023-03-26 19:46:48 +00:00
Faith Ekstrand
5b5fd8d437 CODEOWNERS: s/jekstrand/gfxstrand
My gitlab handle changed, update to the right one.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22120>
2023-03-26 00:16:26 +00:00
Faith Ekstrand
877473b4a0 util: Update some copyright tags
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22120>
2023-03-26 00:16:26 +00:00
Faith Ekstrand
9d1c1379e7 vulkan: vk_android.c should be copyright Intel
That's where I copied+pasted it from.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22120>
2023-03-26 00:16:26 +00:00
Faith Ekstrand
e001995dc5 util,mesa,panfrost: Drop some author tags
This is what git blame is for

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22120>
2023-03-26 00:16:25 +00:00
Faith Ekstrand
789992b7c9 intel: Drop some author comments and update Faith's name
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22120>
2023-03-26 00:16:25 +00:00
Faith Ekstrand
cf1da3ef40 spirv: Drop a bunch of Authors tags
This is what git blame is for

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22120>
2023-03-26 00:16:25 +00:00
Faith Ekstrand
01275a1a95 nir: Drop a bunch of Authors tags
This is what git blame is for.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22120>
2023-03-26 00:16:25 +00:00
Faith Ekstrand
329398b99a docs: Fix Faith's name in relnotes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22120>
2023-03-26 00:16:25 +00:00
Faith Ekstrand
a02ed15067 intel/blorp: Drop the TODO file
Most of this stuff is done.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22120>
2023-03-26 00:16:25 +00:00
Bas Nieuwenhuizen
0f045d43d6 ac/surface,radv: Opt out of stencil adjust.
We never implemented it, and having broken mipmaps works out better
for applications and CTS. Actually implementing stencil adjust is
going to be a major pain due to stuff like the GENERAL layout.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21869>
2023-03-25 18:15:08 +00:00
Bas Nieuwenhuizen
3bfa0d44fb ac/surface: Only allow stencil pitch adjustment for mipmaps.
Otherwise we can just have addrlib do the depth pitch adjustment
and have no copies.

v2: update CI expectations (olv)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21869>
2023-03-25 18:15:08 +00:00
Bas Nieuwenhuizen
71a50bdaad ac/surface,radv: Avoid pitch weirdness if image not used for rendertarget.
Literally no point to it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21869>
2023-03-25 18:15:08 +00:00
Rob Clark
102445d2c3 freedreno/registers: Add control reg for zap fw base
The zap shader knows the offset of the embedded shader within the zap
sqe instructions, but uses this control reg to get it's own address in
memory, in order to calculate the address of the compute shader part of
the zap shader.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21748>
2023-03-25 16:21:28 +00:00
Rob Clark
c3ed8d0e7b freedreno/afuc: Add raw mode for disasm
Add a mode which doesn't try to find/process a jmptable.  Useful for
looking at zap shaders.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21748>
2023-03-25 16:21:28 +00:00
Mike Blumenkrantz
e5dae7d945 driconf: make glthread=true default for source games
this yields a sizable gain for source-based games, so it shouldn't be
limited to radeonsi

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20611>
2023-03-25 01:44:27 +00:00
Sagar Ghuge
cece2aa2c1 intel/compiler: Add Wa_14014063774 for slm_fence
Before SLM fence compiler needs to insert SYNC.ALLWR in order to avoid
the SLM data race.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22050>
2023-03-25 00:45:04 +00:00
Ryan Neph
4a4b05869a venus: check and configure new ringMonitoring feature
At ring creation, if supported by renderer, we can request
ringMonitoring. During driver ring waits, the ring's new ALIVE status
bit will be checked periodically at the configured rate. If the bit is
not set, the renderer must have crashed and the driver should do the
same to signal a problem to the app/user.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22036>
2023-03-24 23:27:53 +00:00
Ryan Neph
c4c09464ce venus: update to latest protocol for ringMonitoring
Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22036>
2023-03-24 23:27:53 +00:00
Ryan Neph
476c771e34 venus: init exp features before ring init again
This reverts commit dda85cf94b ("venus:
move exp features init back to use ring submit"), and additionally adds
per stream shmem caching to determine when vkSetReplyCommandStreamMESA
is needed.

Checking renderer features before setting up ring means that the bound
shmem for replies on the ring will no longer be implicitly set on first
shmem creation (it was set for the renderer stream instead). So the
test for when another vkSetReplyCommandStreamMESA is needed must
independently consider the last stream set on renderer/ring(s)

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22036>
2023-03-24 23:27:53 +00:00
Ryan Neph
3812a946d2 venus: set/check ring status bits independently
prepare for manipulation of the new VK_RING_STATUS_ALIVE_BIT_MESA during
ring monitoring.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22036>
2023-03-24 23:27:53 +00:00
Ryan Neph
bb4c10f85e venus: add vn_relax_init/_fini()
Use a new calling contract so we can do pre/post-work around every ring-waiting
iteration. All looping uses of `vn_relax()` must now call `vn_relax_init()` and
`vn_relax_fini()` before/after their loop bodies.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22036>
2023-03-24 23:27:52 +00:00
Sagar Ghuge
0f14724039 iris: Implement Wa_14015297576
Disable tessellation distribution when primitive id is enabled.

v2: some changes squashed from Tapani:
   - leave mode initially as TEDMODE_OFF (0) so we can merge
   - take fs primitive ID overrides in to account

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21982>
2023-03-24 22:37:09 +00:00
Sagar Ghuge
86d931724d anv: Implement Wa_14015297576
Disable tessellation distribution when primitive id is enabled.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21982>
2023-03-24 22:37:09 +00:00
Guilherme Gallo
7f04fa7364 ci/zink: Add zink-tu-a618-traces-performance job
It will be needed to compare the performance of zink+turnip against
turnip only jobs.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22065>
2023-03-24 21:58:22 +00:00
Guilherme Gallo
38074e8d6d ci/zink: Add zink-turnip-manual-rules
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22065>
2023-03-24 21:58:22 +00:00
Guilherme Gallo
2bb917282a ci/zink: Add zink-a618 trace jobs
May be used as replacement for zink-a630-traces job, since a618 is similar
to a630.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22065>
2023-03-24 21:58:22 +00:00
Guilherme Gallo
bbfc9b517d ci/freedreno: create a618-traces and perf jobs
Performance jobs should work better if we fix the device under test to
be the same in every test, instead of using any device from a group of
devices of the same type.

We can do it quickly in LAVA, but it seems more
complicated on Google's farm. So, let's replace the a630 (in Google
farm) with a fixed a618 device to test freedreno traces performance.

Add a618-traces job as well, as we need to confirm that a618 is
generating stable traces with good results before proceeding to track
its performance

Co-authored-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22065>
2023-03-24 21:58:22 +00:00
Guilherme Gallo
93e3d37b47 ci: Add piglit traces hidden jobs
To better organize traces and traces-performance jobs that uses piglit
to replay traces.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22065>
2023-03-24 21:58:22 +00:00
David Heidelberg
cadceac2a7 ci/freedreno: Make traces work on LAVA caching proxy
Explicitily define the caching proxy via piglit
`--download-caching-proxy-url` argument.
We have different URLs for caching proxy for LAVA and freedreno farms.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22065>
2023-03-24 21:58:22 +00:00
David Heidelberg
a114bf1cd2 ci/freedreno: define Google farm specific includes
This should prevent mixing them with LAVA freedreno devices.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22065>
2023-03-24 21:58:22 +00:00
David Heidelberg
748c02f86c ci/freedreno: split deqp from other jobs
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22065>
2023-03-24 21:58:22 +00:00
David Heidelberg
4286e559cc ci: remove deqp from lava piglit and traces runs
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22065>
2023-03-24 21:58:22 +00:00
David Heidelberg
bc5a48d48b ci: create lava-test without deqp HWCI_TEST_SCRIPT
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22065>
2023-03-24 21:58:22 +00:00
David Heidelberg
2314a0d59b ci: rename .lava-test to .lava-test-deqp to describe it correctly
.lava-test hidden job was setting the HWCI_TEST_SCRIPT variable to deqp
runner. But that is not always the case. When we run piglit traces jobs,
we use piglit-traces.sh instead, for example.

Splitting into:
- .lava-test-deqp (deqp-runner + deqp)
- .lava-traces (deqp-runner + piglit)
- .lava-piglit (piglit-runner + piglit)

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Co-authored-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22065>
2023-03-24 21:58:22 +00:00
Guilherme Gallo
8e5c33f8a2 ci: Fix freedreno-rules-performance
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22065>
2023-03-24 21:58:22 +00:00
Guilherme Gallo
2112d8b1f2 ci: Improve piglit-traces "no-perf" filter
We filter out traces that work only in standard replay mode but not
profile one via yq (jq for YAML) manipulation.

The previous query needed to be fixed in some scenarios, such as traces
labeled with only `["no-perf"]`, which was being ignored by the query.

This commit updates the yq query with newer syntax to cover all current
cases (at least for freedreno).

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22065>
2023-03-24 21:58:22 +00:00
José Roberto de Souza
f868c1727d anv: Fetch max_context_priority from drm_xe_query_config
A new property was added to drm_xe_query_config with the max engine
priority for running process, so we can use it directly on
anv_xe_physical_device_get_parameters() and nuke
anv_xe_physical_device_max_priority_update().

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22112>
2023-03-24 21:28:47 +00:00
José Roberto de Souza
972d2a89d9 anv: Partialy import drm-uapi/gpu_scheduler.h and use it
To replace the hard-coded values.
Not fully importing gpu_scheduler.h because it includes several Linux
specific headers that will make the life of anyone porting Xe to
other Unix harder.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22112>
2023-03-24 21:28:47 +00:00
José Roberto de Souza
073fc34e4b intel: Sync xe_drm.h
Based on commit f6e26dff8fa3 ("drm/xe: Add max engine priority to xe query")

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22112>
2023-03-24 21:28:47 +00:00
Nicolas F
fed462a011 driconf: remove the adaptive sync special case for mpv
mpv didn't ask to be on this list, was never consulted about being
on this list and to the best of my knowledge has no problem with
adaptive sync. If there is an issue exposed by mpv having adaptive
sync enabled, then it should be reported to mpv, so that it can be
fixed in mpv.

The only problem I could remotely imagine with mpv and VRR is that
its display-resample mode tries to do something similar, and the
two mechanisms will likely race each other to the bottom, but the
display-resample mode is not the default and this is already a
known issue on Windows so users wouldn't expect this to behave any
differently on Linux.

In short, please don't try to make a list of all applications that
are not video games, it is not conducive to having a good time on
the computer.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20701>
2023-03-24 20:10:25 +00:00
Daniel Schürmann
56b6ca411f radv/rt: Fix VK_KHR_pipeline_executable_properties
We don't provide executable properties for the prolog shader.

Fixes: f123d65e9f ('radv/rt: use prolog for raytracing shaders')
Fixes: dEQP-VK.pipeline.monolithic.shader_module_identifier.pipeline_from_id.ray_tracing_libs.*
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22111>
2023-03-24 19:50:46 +00:00
Daniel Schürmann
2cf6813c19 radv: fix radv_shader_binary member fields to 32 bit.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22029>
2023-03-24 19:03:29 +00:00
Daniel Schürmann
3806cd83f2 radv: skip pipeline caching with RADV_DEBUG=shaders
in order to create reproducible cache entries.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22029>
2023-03-24 19:03:29 +00:00
Daniel Schürmann
493d93f26c radv: refactor shader_compile()
- change the return type to radv_shader_binary *
- setup options at the caller side

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22029>
2023-03-24 19:03:29 +00:00
Daniel Schürmann
5051980ff8 radv: remove radv_create_gs_copy_shader()
We can replace the call with radv_shader_nir_to_asm().

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22029>
2023-03-24 19:03:29 +00:00
Daniel Schürmann
55caea6453 radv: move gl_shader_stage from radv_binary to radv_shader_info
This way, both radv_shader and radv_shader_binary, provide the stage.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22029>
2023-03-24 19:03:29 +00:00
Daniel Schürmann
2c8d101c71 radv: separate radv_capture_shader_executable_info() from radv_shader_create()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22029>
2023-03-24 19:03:29 +00:00
Daniel Schürmann
43ad3d3917 radv: inline radv_postprocess_config()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22029>
2023-03-24 19:03:29 +00:00
Daniel Schürmann
13c55a8e86 radv: remove unnecessary copy of binary->config
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22029>
2023-03-24 19:03:29 +00:00
Daniel Schürmann
fe716c2428 radv: separate radv_postprocess_binary_config() from radv_shader_create()
The goal is to make radv_shader_create() a function that creates a shader
from a binary without any additional information.
Postprocessing the config is only needed after compilation.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22029>
2023-03-24 19:03:29 +00:00
Daniel Schürmann
0fec7819f4 radv: remove unused parameter from radv_open_rtld_binary()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22029>
2023-03-24 19:03:29 +00:00
Patrick Lerda
68babdd227 r600: fix refcnt imbalance related to shader
Indeed, gs_copy_shader was not freed.

Fixes: commit 1371d65a7f
    r600g: initial support for geometry shaders on evergreen (v2)

For instance, with "piglit/bin/shader_runner generated_tests/spec/arb_gpu_shader_int64/execution/built-in-functions/gs-abs-i64vec2.shader_test -auto -fbo"
while setting GALLIUM_REFCNT_LOG=refcnt.log.

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22087>
2023-03-24 17:21:06 +00:00
José Roberto de Souza
8ec0cb120c iris: Ajust gem buffer allocation size in Xe kmd
gem buffer size must also be aligned to mem_alignment otherwise
vm binds can fail when Xe kmd checks if vm bind range is bigger than
gem buffer size.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22059>
2023-03-24 16:47:18 +00:00
José Roberto de Souza
a25ef68f68 iris: Implement gem_vm_bind() and gem_vm_unbind() in Xe kmd backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22059>
2023-03-24 16:47:18 +00:00
José Roberto de Souza
c83a76339f iris: Add vm bind and unbind to kmd backend
At this time this is a nop for i915 but in future we will have a
Xe implementation.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22059>
2023-03-24 16:47:18 +00:00
José Roberto de Souza
db781f01d4 iris: Prepare iris_bufmgr functions for vm bind error paths
vm bind and unbind can fail, so error paths will be needed.
Here I'm just preparing the code paths for that.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22059>
2023-03-24 16:47:18 +00:00
Samuel Pitoiset
879ddf9720 radv: rework binding shaders to cmdbuf by introducing new helpers
For future work.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22101>
2023-03-24 16:21:49 +00:00
Danylo Piliaiev
b30f2bf790 tu: Generate entrypoints for each gen
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:26 +00:00
Danylo Piliaiev
3db70be04b freedreno/regs: Include assert.h in generated headers
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:26 +00:00
Danylo Piliaiev
7e833713d8 vk/entry_points: Add option to generate template entrypoints
As a C++ alternative to genX macros.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:26 +00:00
Danylo Piliaiev
c82ddf4f98 tu: compile as C++
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:26 +00:00
Danylo Piliaiev
8baa7acd82 freedreno/msm: Rename drm_msm_gem_submit_reloc::or in C++ code
Clashes with C++ `or` keyword

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
ae47b4e937 tu: C++-proofing: misc fixes
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
903072ea03 tu: C++-proofing: cast result when extracting field from reg value
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
28a703ea43 tu: C++-proofing: prevent taking address from rvalue
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
aec1e9ecf7 tu: C++-proofing: ease access to global bo struct
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
40b7e5c48a tu: C++-proofing: fix casting from void * fpermissive warnings
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
c618e2a2d4 tu: C++-proofing: Initialize tu_reg_value in-order by pack funcs
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
685dbce850 tu: C++-proofing: fix extension table initialization
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
e02e51df5b tu: C++-proofing: fix designator initializer order
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
a8dc6fbf83 tu: C++-proof: do not goto over variables initialization
That is not permitted by C++

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
af3e075f05 tu: C++-proofing: various enum fixes
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
5430d10d06 tu: C++-proofing: fix struct initializers
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
8a0f1a6d70 tu: C++-proofing: fix offsetof with dynamic array index
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
1510b97c70 ir3: C++-proofing
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
485bdae420 freedreno/common: C++-proof freedreno_uuid.h
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
1600b310bc vk/util: Generate defines to help casting structs with vk_find_struct
C++ doesn't like implicit casts from void *.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
de5c3900ca vk/util: remove (void *) casts from vk_foreach_multi_draw macros
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
4d79703b91 vk/wsi: C++-proof wsi_common_drm.h
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
815960d88f vk/vk_extension_gen: Make table struct initializable in C++ on older gcc
Before GCC 11.2 initializing anonymous struct with extensions gave:

 error: too many initializers for 'vk_device_extension_table'

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
330b64d1d1 spirv: sort spirv_supported_capabilities
Makes easier for c++ driver to keep initializer in order.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
d60b551b90 util/format: Make format_table compatible with C++
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
24fca432ab util/perf: C++-proof util/perf
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Konstantin Seurer
200e551cbb nir/lower_shader_calls: Remat derefs before lowering resumes
Closes: #7923
cc: mesa-stable

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20399>
2023-03-24 14:55:37 +00:00
Samuel Pitoiset
af1bc7f4ce radv: remove radv_pipeline::device completely
This is unecessary and this prevents using a ton of functions without
a radv_pipeline object.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22090>
2023-03-24 13:48:40 +00:00
antonino
8e9262fefd gallium: decompose quad strips into quads if supported
This changes gallium to decompose quad strips into quads instead of triangles
when the driver advertises support for them.

This should result in a more correct result when those are drawn
with the line raster primitve (avoids showing the diagonal line).

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21987>
2023-03-24 13:11:12 +00:00
antonino
d4a6c97779 mesa: correctly allocate space for converted primtives
Previosuly it was assumed that primitives where always converted to
triangles if the driver did not support all primitives, however that's
not true for a driver that supports quads but not quad strips.

Fixes piglit spec@!opengl 1.1@dlist-fdo3129-01 on Panfrost

Fixes: dcbf2423d2 ("vbo/dlist: add vertices to incomplete primitives")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21987>
2023-03-24 13:11:12 +00:00
Samuel Pitoiset
d9e68f4e40 radv: pass a radv_shader to radv_emit_dispatch_packets()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22102>
2023-03-24 12:43:51 +00:00
Samuel Pitoiset
d07c81d87e radv: move cs_regalloc_hang_bug to radv_shader_info
This is more like a shader property.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22102>
2023-03-24 12:43:51 +00:00
Georg Lehmann
48ba17b823 amd: remove duplicate from .clang-format
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22077>
2023-03-24 10:56:31 +00:00
Georg Lehmann
687b756073 aco: remove duplicates from .clang-format
The latest clang-format doesn't support this anymore.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22077>
2023-03-24 10:56:31 +00:00
Lionel Landwerlin
9448c2628e anv: add utrace support for queue debug utils
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22006>
2023-03-24 09:38:20 +02:00
Lionel Landwerlin
b868f22b46 anv: rename anv_utrace_flush_copy in anv_utrace_submit
We want to use this for submission of traces outside command buffers,
so it won't just execute copies of timestamp buffers.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22006>
2023-03-24 09:38:17 +02:00
Lionel Landwerlin
becfbb2a19 anv: fixup locking for utrace submission increments
This is supposed to happen under the device lock.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: e760c5b37b ("anv: add perfetto source")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22006>
2023-03-24 09:38:13 +02:00
Lionel Landwerlin
87a1d6423c anv: fix incorrect utrace bo release
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c67c9688c3 ("anv/utrace: use a bo pool for utrace buffers")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22006>
2023-03-24 09:38:10 +02:00
Lionel Landwerlin
68bc4c56ff intel/ds: rename frame timeline row to queue
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22006>
2023-03-24 09:38:08 +02:00
Lionel Landwerlin
1c64952e65 vulkan/runtime: also copy strings on queue debug utils
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22006>
2023-03-24 09:38:06 +02:00
Lionel Landwerlin
d55d74bb72 util/u_trace: move needs_cs_param option to tracepoints
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22006>
2023-03-24 09:37:57 +02:00
Teng, Jin Chung
de8b14f8ea d3d12: AV1 Dec - Set anchor_frame_idx only when large_scale_tile equals 1
Signed-off-by: Teng, Jin Chung <jin.chung.teng@intel.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22048>
2023-03-24 01:51:07 +00:00
Teng, Jin Chung
2e4f2472cc frontend/va: Add large_scale_tile from VADecPictureParameterBufferAV1
Signed-off-by: Teng, Jin Chung <jin.chung.teng@intel.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22048>
2023-03-24 01:51:07 +00:00
Mike Blumenkrantz
14507927a6 zink: flag rp layout change if zsbuf usedness changes on dsa/fs state bind
this should (correctly) trigger the expected zsbuf elimination and
avoid hitting asserts

fixes #8679

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22086>
2023-03-24 00:32:56 +00:00
Alyssa Rosenzweig
822090e802 panfrost: Remove Midgard RSD fields from Bifrost
These were removed and replaced by new Bifrost RSD fields, don't print the wrong
values. Harmless but noises up the decoding.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
c358c6cd43 panvk: Lower blending late
Since 50b82ca818 ("nir/lower_blend,agx,panfrost: Use lowered I/O"),
nir_lower_blend needs to be called after lowering I/O rather than before.
Furthermore, after lowering blend, we need (in general) to lower the resulting
load_output intrinsics. Now that we have a proper preprocess_nir hook, there is
a natural place in panvk_vX_shader to do this.

Fixes dEQP-VK.pipeline.blend.*

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
ecd29fdf38 pan/bi: Call pan_nir_lower_zs_store late
This will give the driver [notably, PanVK] a chance to lower dual source
blending without having the dual stores turned into store_combined_output_pan.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
24693d8a7c pan/bi: Export bifrost_nir_lower_load_output
If new load_output are created after preprocessing NIR (namely, from blend
lowering in panvk), this lowering needs to be called to lower load_output to the
vendor intrinsic with conversion descriptor.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
f888994679 panfrost: Move panfrost_sysvals to GL driver
This shouldn't be used by anything else at this point.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
56288a7cfb panvk: Remove unused function
Erroneously referencing sysvals.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
3e64b13193 panfrost: Move sysvals to GL driver struct
Only the GL driver produces/consumes these, they shouldn't be in the common
shader_info.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
ffb9919c2f panfrost: Lower sysvals in GL
Drop the backend compiler sysval handling in favour of the pass in the GL
driver, bringing us into compliance with Ekstrand's rule.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
455a76f10a panfrost: Add NIR-based sysval lowering pass
Add a NIR pass to lower all the sysvals seen in the GL driver to load_ubo
intrinsics. These load_ubo intrinsics will be pushed to uniforms by the backend
compiler as usual. This will let us remove all sysval handling from the backend
compilers.

This is a direct NIR port of the existing pan_sysvals.c infrastructure and the
consumers in the Midgard/Bifrost compilers. It aims to be bug-for-bug compatible
to ease bisection.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
3ec9b18332 panvk: Inline blend constants as syvals
Blend constants are sysvals, it's just that they can sometimes be inlined
depending on the pipeline state. The old "inline blend constant" pass is a
special case of the new "lower all sysvals" pass in panvk.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
819313ff99 panvk: Don't use vec4 for vertex_instance_offsets
Not needed with the new lowering.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
5b3870d858 panvk: Lower sysvals in NIR
Per Ekstrand's Rule. This avoids the "fixed sysval" hack that Faith introduced
to get this behaviour with the GL sysval handling.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
f79697123e panfrost: Remove stale TODO
While the text here is still nominally accurate, we should be seeing so few
shader variants at this point that the locking contention isn't a big deal.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
c65a9be421 panfrost: Preprocess shaders at CSO create time
Now the only passes that depend on the shader key can run late, so we can
preprocess ahead-of-time once and throw away the original shader. This reduces
the cost of shader variants, as well as deduplicates some lowering for
transform feedback shaders.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
683d1b6078 panfrost: Effectively lower gl_FragColor late
nir_lower_fragcolor takes the number of colour buffers as input, but it's an
early pass, so we don't want to use the key for it. Instead, we can overestimate
and then optimize out late with an easy pass.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
b722410544 panfrost: Lower texcoords late
Use the _late version of this lowering instead of the early one.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
21ad75d4b9 panfrost: Lower clip_fs late
This pass works both early and late, so this is an easy one to sink down.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
2745daa05a pan/lower_framebuffer: Lower MSAA blend shaders
Do it explicitly in NIR rather than implicitly in the Midgard compiler. This
avoids a nasty sideband input for the render target formats and sample count,
for blend shaders on midgard only.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
ca2042f359 panfrost: Preprocess shaders in the driver
This is a flag-day change to how we compile. We split preprocessing NIR into a
separate step from compiling, giving the driver a chance to apply its own
lowerings on the preprocessed NIR before the final optimization loop. During
that time, the different producers of NIR (panfrost, panvk, blend shaders, blit
shaders...) will be able to (differently) lower system values.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
2a356cefba pan/blit: Lower load_sampler_lod_parameters_pan
This will be needed to decouple the lowering in the Midgard compiler from the
specific sampler descriptors used in the blit code.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
bccd6d3880 pan/lower_framebuffer: Use nir_shader_instructions_pass
Removes a lot of indentation, and improves metadata handling.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
8059eb1577 pan/lower_framebuffer: Only call for FS
It doesn't make sense for shader stages other than fragment (and blend which is
fragment-like), assert this.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
ee2a5d6bc6 pan/mdg: Split out early preprocessing from late
To prepare for the new compile flow, where this will be called by the driver
instead of internally in the compiler.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
0cdd82a892 pan/bi: Split out early preprocessing from late
To prepare for the new compile flow, where this will be called by the driver
instead of internally in the compiler.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
924f68fe4b pan/mdg: Only lower once
Nothing in the optimization loop should remat the lowered instructions, so
there's no need to do it inside the loop.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
02f570e33d pan/bi: Only lower once
Nothing in the optimization loop should remat the lowered instructions, so
there's no need to do it inside the loop.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
c333c0ea57 panfrost: Remove unused inputs.nr_cbufs
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
da0815fb9b panfrost: Remove inputs->blend.rt
This sideband input is now unused, as the information is available locally
within the NIR as it should be.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:45 +00:00
Alyssa Rosenzweig
edf24f1887 pan/mdg: Use I/O semantics for MRT blend stores
This avoids the silly reliance on the sideband.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:45 +00:00
Alyssa Rosenzweig
f2b56c8dd8 pan/bi: Remove bi_load_sysval
It is unused and should stay unused, as any use is a violation of Ekstrand's
rule.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:45 +00:00
Alyssa Rosenzweig
91ffd10351 pan/bi: Lower gl_VertexID in NIR
This gets rid of the hidden gl_BaseVertex system value which violates Ekstrand's
rule.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:45 +00:00
Alyssa Rosenzweig
540d556a8f pan/bi: Allow specializing bifrost_nir_options by arch
We need different settings for Bifrost and Valhall. Keeping everything static
simplifies lifetimes.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:45 +00:00
Alyssa Rosenzweig
8db30010dc pan/bi: Lower load_output to make sysval explicit
See previous commits for justification. Later, we'll split up NIR processing in
a few steps to give the caller a chance to lower the sysval, at which point the
goofy inputs here will go away.

v2: Only lower in fragment shaders. Likely harmless to run elsewhere but still
wrong because the location enum is defined per-stage.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:45 +00:00
Alyssa Rosenzweig
5c9ffaad8f pan/bi: Lower sample mask writes in NIR
This uses the new NIR sysvals to avoid materializing magic sysvals in the
driver, getting us closer to the Ekstrand Rule.

v2: Only lower for fragment shaders. Lowering in vertex shaders should be a
no-op, except that FRAG_RESULT_SAMPLE_MASK shadows a VARYING_SLOT for fog
coords, causing v1 of this patch to regress fog. Caught by the G52 piglit job in
CI. Thank you, Marge.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:45 +00:00
Alyssa Rosenzweig
6f3a761e81 pan/bi: Don't duplicate texture op cases
These two switches are redundant.

Furthermore, bi_tex_op could previously assume its input was a supported texop,
so it returned undefined values for unsupported texops. Now, without the guard
in front of it, bi_tex_op should check for supported texops, so we need to drop
the unsupported texops from the switch.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:45 +00:00
Alyssa Rosenzweig
f247f57f52 panfrost: Use 0/~0 boolean for MSAA sysval
For consistency with NIR.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:45 +00:00
Alyssa Rosenzweig
47ed0b41be nir: Add Mali load_output taking converison
Mali's LD_TILE instruction (mapping to NIR's load_output) requires a "conversion
descriptor" specifying how to convert from the register foramt to the tilebuffer
format. To implement framebuffer fetch on OpenGL without shader variants, we
generate these descriptors in the driver and pass them in a uniform. However, to
comply with the Ekstrand Rule, we can't have magically materialized system
values -- they should come only from the NIR where the driver can lower as it
pleases (e.g. PanVK can lower to a constant because it knows the framebuffer
format at pipeline create time). Add intrinsics to model this.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:45 +00:00
Alyssa Rosenzweig
60bfc4deb9 nir: Add Panfrost intrinsics to lower sample mask
We want to lower this in NIR instead of the backend IR to give the driver a
chance to lower the "is multisampled?" system value, which makes more sense to
do in NIR. This gets rid of one of the magic compiler materialized sysvals.

Plus, this will let us constant fold away the lowering in Vulkan when we know
that the pipeline is single-sampled / multi-sampled.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:45 +00:00
Mark Janes
8eceff48cd intel/dev: use GFX_VERx10 to detect genX compilation
Depending on the ordering of includes, GFX_VER may not defined for
intel_device_info.h.  The failure mode of this case is silent:
BITSET_TEST will be called when it could be compiled out.

GFX_VERx10 should be used in place of GFX_VER.  GFX_VERx10 is defined
by a compiler flag, and is always present for genX compilation units.

Fixes: 3c9a8f7a6d ("intel/dev: generate helpers to identify platform workarounds")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21908>
2023-03-23 23:23:52 +00:00
Mark Janes
8c78dd6320 intel/dev: fix macro naming convention in gen_wa_helpers.py
intel_device_info.h tests macros in the form `INTEL_WA_{id}_GFX_VER`.
gen_wa_helpers.py produced macros in the form `INTEL_GFX_VER_WA_{id}`

Change the generated code to follow intel_device_info.h

Fixes: 3c9a8f7a6d ("intel/dev: generate helpers to identify platform workarounds")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21908>
2023-03-23 23:23:52 +00:00
Mark Janes
52c71cf959 intel/dev: fix macro string concatenation for INTEL_WA_{id}_GFX_VER
`INTEL_WA_##id_GFX_VER` evaluates to `INTEL_WA_id_GFX_VER`
instead of numbered identifiers like `INTEL_WA_220579888_GFX_VER`.

Fixes: 3c9a8f7a6d ("intel/dev: generate helpers to identify platform workarounds")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21908>
2023-03-23 23:23:52 +00:00
Jesse Natalie
4d48fc6fe5 dzn: Use mesa_loge for DXIL validation errors
This allows them to be printed to OutputDebugString

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
7750e23c7f dzn: Enable variable size bindings
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
19818ecc37 dzn: Support descriptor indexing via bindless
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
c93dda6bee dzn: Add a debug option for enabling bindless mode
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
ebc8a86df1 dzn: Apply bindless lowering when compiling pipelines
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
35a789dbb7 dzn: Only bind descriptor sets up to the used amount of the current layout
Prevents setting a root SRV into a slot that's not declared as an SRV
in the root signature if a set is bound into a higher slot from a previous
draw/dispatch op.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
a227ef2983 dzn: Ensure root signatures are re-bound after a meta op
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
7edff267cc dzn: When binding a bindless root signature, bind descriptor heaps first
The D3D spec says it must be so, and not doing this causes problems
on some hardware.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
8d52a480fe dzn: Add a binding classification in the pipeline layout remapping
This is needed so that we can handle two special cases:
* Dynamic buffer data is allocated out of a command-buffer-owned buffer,
  rather than a descriptor-set-owned buffer, so the remapping puts them
  in their own register space.
* Static samplers should be left alone and not converted to bindless.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
8bd5fbf8ed dzn: Bind buffers for bindless descriptor sets
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
5f61e66024 dzn: Use separate dirty bits for descriptor sets/dynamic buffers
We'll be able to take advantage of this granularity in bindless mode

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
1846426195 dzn: Don't dirty bindings if root signature doesn't change
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
5d2b4ee4f4 dzn: Allocate descriptor sets in buffers for bindless mode
Modify the root signature stored in the pipeline layout too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
a1881bc7ee dzn: Delete unused function
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
ac0b0731ea dzn: Remove defragmenting of descriptor pools
Rather than trying to perfectly defrag, let's just allow re-use.
When a set is allocated for the first time, it locks in its range of
the heap that it'll use. If the last set in the heap is used, then
those descriptors go back to being free, but if a set in the middle
of the heap is freed, those descriptors remain assigned to that set.
A later allocation attempt can reclaim them, as long as the new set
fits.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
079f3deafb dzn: When bindless, only allocate one descriptor per layout entry
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
4c4431b674 dzn: Add initial bindless infrastructure
When operating in "bindless" mode, the device will own 2 descriptor
heaps, one for views, and one for samplers. Every time a view is
created (image view, buffer view), a slot is allocated for it out
of the device view heap for each usage type (sampled vs storage).

Then, in a future change, descriptor sets will just contain view/
sampler indices instead of actual descriptors. Instead of copying
these to a cmdbuf-owned descriptor heap, we can directly bind the
descriptor set as a buffer. We'll also modify shaders to perform
an indirection and index into the device heap.

Buffers also get views set up on creation. In a perfect world, we
could just put addresses/sizes in the descriptor set, but DXIL
doesn't support loading from addresses, we need descriptors. When
robust buffer access is disabled *or* descriptor set buffer views
reference the remainder of the buffer, we can just re-use a view
from the buffer and use an offset.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
f977c10f3c dzn: Skip setting up UAVs for depth resources
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
60b3637e76 dzn: Set up SRV descs for 3D textures correctly
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
0bf1a43601 dzn: Don't use plane slice 1 for depth+stencil SRVs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
442d456b28 dzn: Consistently order depth formats before stencil
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
4c5100f94a dzn: Put UAVs first for storage images/buffers in descriptor tables
When running in a bindless mode, we won't ever be using SRVs for these.
Change terminology for determining descriptor offsets from "writable"
to "alt" to match naming already used elsewhere.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
8887852d20 dzn: Add some docs around descriptor sets and remove redundant/unused data
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
492d61cfbb dzn: Fix a leak in descriptor set layout creation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
3f2e13eaf8 dzn: Remove descriptor heap type from descriptor heap wrapper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
599abf5b1a dzn: Remove device pointers from descriptor heaps
A future change is going to add descriptor heaps *to* the dzn_device,
and having 3x ID3D12Device pointers in a single object just seems
wrong. All of the callers already had a device, so just pass it
along where needed.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
79ef6e4e8f spirv2dxil: Support descriptor indexing capabilities
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
e0a090adfd spirv2dxil: Only lower readonly images to SRVs when the option is set
This handles the case where readonly is explicitly marked in the shader,
rather than just inferred based on opt_access.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
b125575f95 spirv2dxil: Add a pass to lower deref tex/image and vulkan ubo/ssbo to bindless
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
4f31d1a7e0 microsoft/compiler: Update header docs for binding modes supported by compiler
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
4fc7d2480a microsoft/compiler: Use store_dest instead of store_dest_value more
The 16bit SSBO load support missed setting the 16bit shader flag.
Make it harder to miss that by only using store_dest_value for things
that don't have a type.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
ce004e6391 microsoft/compiler: Support descriptor heap indexing for UBO/SSBO
Treat load_vulkan_descriptor on an input that didn't come from
vulkan_resource_index as a descriptor heap index instead of a
binding index.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
88e4edeb2b microsoft/compiler: Handle "bindless" image/tex sources as heap indices
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
068f1ada9a microsoft/compiler: Split handle annotation into two parts
The first part gets the resource props struct, and the second
actually emits the annotate instruction. Later changes will
get the resource props struct from different sources.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
6220fb454f microsoft/compiler: Add helpers for getting res_props structs
Currently we can get one by looking up already-emitted resource
metadata, but in the future we'll want to be able to get this
info from a call site alone. Depending on the type of call site,
we'll have different sets of info, so add helpers for the
various different kinds of call sites we can support.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
abc2412ccc microsoft/compiler: Refactor type -> resource kind helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
a838f095ef microsoft/compiler: Only set typed UAV load feature bit for multi-comp loads
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
273a7cf0e2 microsoft/compiler: Fix setting bit 31 in feature flags
Fixes: a84208ee ("microsoft/compiler: Fill out and sort the shader/module flags")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Mark Janes
33d03e57ad intel/fs: use generated helpers for Wa_14013363432 / Wa_14012688258
Wa_14013363432 is a clone of Wa_14012688258.  It does not apply to all
gfx 12.5 platforms.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21745>
2023-03-23 19:13:09 +00:00
David Heidelberg
c029b1499f freedreno/decode: fix possible overflow
```
../src/freedreno/decode/rddecompiler.c:242:65: error: 'sscanf' may overflow; destination buffer in argument 3 has size 32, but the corresponding specifier may require size 33 [-Werror,-Wfortify-source]
         if (sscanf(info->name, "%32[A-Z0-6_][%32[x0-9]].%32s", reg_name,
                                                                ^
../src/freedreno/decode/rddecompiler.c:243:21: error: 'sscanf' may overflow; destination buffer in argument 4 has size 32, but the corresponding specifier may require size 33 [-Werror,-Wfortify-source]
                    reg_idx, field_name) != 3) {
                    ^
../src/freedreno/decode/rddecompiler.c:243:30: error: 'sscanf' may overflow; destination buffer in argument 5 has size 32, but the corresponding specifier may require size 33 [-Werror,-Wfortify-source]
                    reg_idx, field_name) != 3) {
                             ^
```

Reviewed-by: Rob Clark <robclark@freedesktop.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22015>
2023-03-23 18:56:34 +00:00
David Heidelberg
6c5888b890 ci/freedreno: do not build tools executables without explicitly enabling them
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22015>
2023-03-23 18:56:34 +00:00
Jesse Natalie
79725115c6 d3d12: Remove now-unused UAV format from shader info
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22093>
2023-03-23 18:34:52 +00:00
Jesse Natalie
4f56f2188c d3d12: Fix buffer SRV/UAV creation
Get the format right for UAVs (using the image view instead of
relying on the shader having a format specified) and limit the size
to the API-reported size.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22093>
2023-03-23 18:34:52 +00:00
Jesse Natalie
efe3f246b1 d3d12: Report correct texel buffer max size
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22093>
2023-03-23 18:34:52 +00:00
Jesse Natalie
78fc1197eb microsoft/compiler: Handle writable buffer UAV size queries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22093>
2023-03-23 18:34:52 +00:00
Sil Vilerino
0016b8c9ea d3d12: Encode - Only upload headers when written headers size is > 0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22091>
2023-03-23 18:15:44 +00:00
Sil Vilerino
cd575ff72b d3d12: Encode H264/HEVC - Do not write PPS unless different from active
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22091>
2023-03-23 18:15:44 +00:00
Sil Vilerino
4cb76bd280 d3d12: H264/HEVC Encode - Set both VBV InitialCapacity/Size in CBR Rate Control to same value when requested
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22091>
2023-03-23 18:15:44 +00:00
Rob Clark
75d029b717 freedreno/rnn: Fix reg names for regs with variants
Fixes reg names with headergen2, so that if we have separate a6xx and
a7xx variants for a register we get REG_A6XX_foo and REG_A7XX_foo
instead of both being REG_A6XX_foo.  Otherwise generated headers for the
kernel wouldn't compile.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22035>
2023-03-23 17:54:57 +00:00
Amber
8da3494d53 freedreno, nir, ir3: implement GL_EXT_shader_framebuffer_fetch
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21260>
2023-03-23 16:59:56 +00:00
Amber
ca92183845 nir: Add memory coherency information to shaders.
Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21260>
2023-03-23 16:59:56 +00:00
Amber
1462da2a70 nir: allow nir_lower_fb_read to support multiple render targets
Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21260>
2023-03-23 16:59:56 +00:00
Connor Abbott
c54b8dfe67 tu: Fix tile_align_h on a650
This matches what the blob on a650 does and fixes errors when
calculating the tile size due to tile_align_h not being a power of two.

Fixes: 60bc7c0e ("freedreno: Specify GMEM tile alignment per GPU")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22088>
2023-03-23 15:47:43 +00:00
Eric Engestrom
f5d325a8d0 v3d: add link to issue investigating failure
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22089>
2023-03-23 15:22:05 +00:00
Boyuan Zhang
2c1da7fbde frontends/va: check decoder in va surface call
Add a check to see if decoder is valid before using it. Currently we
only support decode and encode operations, return unsupported error
for all other entrypoints.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21905>
2023-03-23 10:14:14 -04:00
José Roberto de Souza
3f544150bb anv: Implement Xe version of execute_simple_batch()
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22058>
2023-03-23 13:27:39 +00:00
José Roberto de Souza
41cba37c4a anv: Handle Xe queue/engine priority
As Xe requires engine info, it is not possible to fetch max priority
from anv_physical_device_get_parameters() call chain, so here
anv_xe_physical_device_max_priority_update() was added.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22058>
2023-03-23 13:27:39 +00:00
José Roberto de Souza
45cb2819f6 anv: Implement Xe version of check_status()
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22058>
2023-03-23 13:27:39 +00:00
José Roberto de Souza
13874840bf anv: Create Xe engines
Xe engine is not equal to hardware engine, it is just a submission
queue that will be scheduled in the hardware engine during process
time slice of the GPU.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22058>
2023-03-23 13:27:39 +00:00
José Roberto de Souza
0818d18d48 anv: Replace I915_ENGINE_CLASS_VIDEO by INTEL_ENGINE_CLASS_VIDEO
Using the value that is not dependent on the KMD uapi.

Not marking as a fixes because both have the same value, so we
don't need a backport.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22058>
2023-03-23 13:27:39 +00:00
Timur Kristóf
e743ddbbb4 radv: Enable mesh shading on GFX11.
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/21409>
2023-03-23 11:49:35 +00:00
Timur Kristóf
59a4fb6af7 ac/nir/ngg: Store special MS outputs in attribute ring for PS to read.
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/21409>
2023-03-23 11:49:35 +00:00
Timur Kristóf
b2a71c56d9 ac/nir/ngg: Fix mesh shader layer on GFX11.
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/21409>
2023-03-23 11:49:35 +00:00
Timur Kristóf
9d2f5a4ada ac/nir/ngg: Split legacy workgroup index function.
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/21409>
2023-03-23 11:49:35 +00:00
Timur Kristóf
240e16fc8e ac/nir/ngg: Use attribute ring for mesh shader params.
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/21409>
2023-03-23 11:49:35 +00:00
Timur Kristóf
0af22af548 ac/nir/ngg: Clarify mesh shader scratch ring.
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/21409>
2023-03-23 11:49:35 +00:00
Timur Kristóf
36edbebe8b radv: Adjust mesh draw packets for GFX11.
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/21409>
2023-03-23 11:49:35 +00:00
Timur Kristóf
9c1571bc56 radv: Include per-prim params in NUM_INTERP on GFX11.
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/21409>
2023-03-23 11:49:35 +00:00
Timur Kristóf
500f3e0bde radv: Use PRIM_ATTR for PS inputs on GFX11.
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/21409>
2023-03-23 11:49:35 +00:00
Timur Kristóf
09b81c7570 radv: Add extra offset to per-prim params.
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/21409>
2023-03-23 11:49:35 +00:00
Timur Kristóf
552614e15a radv: Use per-prim params in has_param_exports.
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/21409>
2023-03-23 11:49:35 +00:00
Timur Kristóf
d0f25109f6 radv: Add per-prim attributes to ring_attr stride.
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/21409>
2023-03-23 11:49:35 +00:00
Timur Kristóf
7cc9a72913 radv: Use new mesh shading packet defines.
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/21409>
2023-03-23 11:49:35 +00:00
Timur Kristóf
da3eb6e6a5 ac: Add more defines for mesh shading packets.
Add some set macro defines for mesh shading packets.
The naming convention is:
S_(packet opcode)(dword index)_FIELD_NAME

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/21409>
2023-03-23 11:49:35 +00:00
David Heidelberg
781c088d92 ci: bump Alpine to 3.17 (again)
Now with fixed ccache 4.7.5.

`ccache` changelog:
Disabled the inode cache by default again since there have reports of ccache
processes hanging on futex calls related to the inode cache.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22037>
2023-03-23 11:19:56 +00:00
Juan A. Suarez Romero
2413cb2965 v3d: fix condition for EZ disabling when stencil on
When stencil is enabled and it isn't non-op, Early-Z must be disabled.

The condition that checks this for stencil[0] is correct, but the one
for stencil[1] is wrong: it uses an "and" instead of "or" condition.

This affects dEQP-GLES3.functional.fragment_ops.interaction.basic_shader.14

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/22081>
2023-03-23 08:51:10 +00:00
Lionel Landwerlin
7941db652e intel/dev: fold Gfx12 URB entries in Gfx12 HW info
Also add a non-zero URB size for intel_stub_gpu

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21949>
2023-03-23 08:08:49 +00:00
Lionel Landwerlin
25cb4805f5 intel/devinfo: initialize pci_device_id with from_pci_id()
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Suggested-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21949>
2023-03-23 08:08:49 +00:00
Lionel Landwerlin
19c9391a2c intel/devinfo: dedicated entries for XeHP
Also fixing the max URB entries for VS stage.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reported-by: Chuansheng Liu <chuansheng.liu@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21949>
2023-03-23 08:08:49 +00:00
Lionel Landwerlin
de5ee891f0 intel/dev: use generated WA helpers for Wa_22012575642
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mark Janes <markjanes@swizzler.org>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21949>
2023-03-23 08:08:49 +00:00
Lionel Landwerlin
9b1660c727 intel/devinfo: printout URB entries
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21949>
2023-03-23 08:08:49 +00:00
Lionel Landwerlin
a42a5bf87e intel/devinfo: add an option to pick platform to print
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21949>
2023-03-23 08:08:49 +00:00
Jesse Natalie
24d5bdbb6e ci/windows: Update warp to 1.0.5
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22034>
2023-03-23 07:07:29 +00:00
Qiang Yu
0cd89a27ed ac/llvm: add missing type convert for nir_load_buffer_amd
Fixes: afcbccb078 ("ac/llvm: implement ACCESS_USE_FORMAT_AMD as buffer_load/store_format")
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/22043>
2023-03-23 01:55:20 +00:00
Qiang Yu
5ddb46e963 ac/llvm: respect channel_type when ac_build_buffer_load
Mainly for nir_load_smem_buffer_amd which pass i32 for this parameter.

Fixes: 8030fbcf16 ("nir,ac/llvm: add nir_load_smem_buffer_amd")
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/22043>
2023-03-23 01:55:20 +00:00
Emma Anholt
772cacff32 glsl: Write a new test for GLSL and NIR mediump lowering.
The mediump lowering tests are important for poking at the lowering pass
behavior, since you can't really assert the behavior in any given driver,
given that the GLSL spec allows any mediump op to be done in highp.

But, in hacking on mediump lowering, I wanted several things that the old
test couldn't do:

- Be able to assert about the actual NIR code we expect to generate for a
  hypothetical driver (important if other compiler stages might do invalid
  transformations like eliminating highp temps, or if we were to move the
  lowering after GLSL IR)
- Run faster (gtest unit tests rather than python forking off the standalone
  glsl compiler per testcase).
- Express expectations with a lot less escaping of typical syntax.
- High-quality logs for displaying failures.

This new test does all of that, I think, though I haven't converted all of
the unit tests over yet.  In converting, I dropped some of the
combinatorial explosion for float/int variations, instead only doing so
when it gets at some different code path (default precision flags).  I've
also included some new tests I wrote in the process of writing my proposed
gl_nir mediump lowering.

Even if the conversion isn't complete, getting these tests to run faster
is probably a good idea on its own, for anyone iterating running Mesa's
unit tests (80 tests in 25ms, compared to 109 tests in 1.5s!).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21886>
2023-03-22 22:52:45 +00:00
Emma Anholt
41f51fe815 glsl/standalone: Make all standalone contexts have NewProgram set.
It was in the standalone compiler but not unit tests.  Only the standalone
compiler had done linking and needed it, so far.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21886>
2023-03-22 22:52:45 +00:00
Emma Anholt
9b5326bdc1 glsl/standalone: Pull out a helper function for adding GLSL source shaders.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21886>
2023-03-22 22:52:45 +00:00
Emma Anholt
1c47609888 glsl/standalone: Pull program create/destroy out to a public function.
For reuse with unit tests.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21886>
2023-03-22 22:52:45 +00:00
Rob Clark
79ac6197a9 freedreno/a6xx: Restore mode
We set the "mode" to 1 for CS because we want CP_SET_DRAW_STATE to
immediately execute the state groups.  But in the 3d path, we don't
restore the value in the sysmem path.  This was causing GPU faults
on 7c3 and presumably other a6xx gen4 things.  But somehow not on
a6xx gen1.

Let's just set it as part of initial state restore where we are
ensuring that the GPU is in a sane state.

Fixes: dec49ec50a ("freedreno/a6xx: Move CS state to PROG state group")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22080>
2023-03-22 20:53:17 +00:00
Eric Engestrom
8af8c5bd07 ci/docs: start documenting ci_run_n_monitor.py
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22079>
2023-03-22 20:48:14 +00:00
Tapani Pälli
6538c5bcd4 intel/fs: restore message layout changes for cube array
This reverts commit bc04e2daca that handled the change as a WA while
this is about a new feature, change done in message layout. Patch also
changes the original comment to not refer to Wa but bspec page.

Fixes: bc04e2daca ("intel/fs: use generated helpers for Wa_1209978020 / Wa_18012201914")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mark Janes <markjanes@swizzler.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22068>
2023-03-22 20:18:11 +00:00
Oleksii Bozhenko
3d2d4728aa Move combining clip and cull optimization before linking
As far gl_nir_link_glsl fills xfb data we should do it after lowering clip and cull in order to get correct locations.

Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7152
Signed-off-by: Oleksii Bozhenko <oleksii.bozhenko@globallogic.com>

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21625>
2023-03-22 19:01:40 +00:00
Marek Olšák
48e218b49d egl: don't expose swrast device if swrast is not built
This fixes piglit/egl_ext_device_base without swrast.

Reviewed-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20951>
2023-03-22 18:23:37 +00:00
Marek Olšák
5952715064 egl: reorder code in _eglQueryDevicesEXT, add *swrast variable
This is a preparation for the next commit. No change in behavior.

Reviewed-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20951>
2023-03-22 18:23:37 +00:00
Eric Engestrom
63f1b4531b ci: deduplicate compiler wrappers
Signed-off-by: Eric Engestrom <eric@igalia.com>
Suggested-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21997>
2023-03-22 17:28:07 +00:00
Eric Engestrom
16d5f65502 ci: always use the -Werror wrapper
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21997>
2023-03-22 17:28:07 +00:00
Eric Engestrom
dc53b39173 ci: add linker wrapper for clang
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21997>
2023-03-22 17:28:07 +00:00
Eric Engestrom
6a0f12ba5f ci: centralize detection of ccache in link-werror wrapper
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21997>
2023-03-22 17:28:07 +00:00
Martin Roukala (né Peres)
ab46f6974b zink/ci: add a test to the fails list
KHR-GL46.multi_bind.dispatch_bind_image_texture has been failing on
both Navi10 and VanGogh, so let's document that.

Zmike says he could not reproduce the fails on a newer version of
glcts, so the next release should address this issue.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22055>
2023-03-22 16:42:29 +00:00
Martin Roukala (né Peres)
09ea80466a radv/ci: update the navi10 expectations
As part of https://gitlab.freedesktop.org/tanty/mesa-valve-ci/-/jobs/38416444,
we saw the following flakes:

 - dEQP-VK.dynamic_rendering.primary_cmd_buff.basic.2_cmdbuffers_resuming
 - dEQP-VK.dynamic_rendering.primary_cmd_buff.basic.contents_secondary_2_primary_cmdbuffers_resuming
 - dEQP-VK.pipeline.fast_linked_library.extended_dynamic_state.two_draws_static.topology_line

And the following failure (seen 4/4 times in the run):

 - dEQP-VK.draw.dynamic_rendering.primary_cmd_buff.linear_interpolation.offset_min_2_samples,Fail

Samuel told me that these are usual flakes, so let's document all of them.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22055>
2023-03-22 16:42:29 +00:00
Rohan Garg
5e8866a35a anv,hasvk: cleanup unused enum
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22070>
2023-03-22 15:00:16 +00:00
Mike Blumenkrantz
3eea22039c zink: track whether zsbuf is unused
zink_is_zsbuf_used updates dynamically, so its return may not reflect
the actual state of the current renderpass

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22054>
2023-03-22 13:00:30 +00:00
Italo Nicola
2362e02f29 panfrost: fix strict-aliasing violations when packing fb ptrs
Compilers are free to make the assumption that pointers don't violate
strict aliasing. If that assumption is incorrect, as it is with the
framebuffer pointer packing code here, the job can fail.

This depends heavily on the compiler and optimization levels, so it's
hard to reproduce, but it did happen for at least two users running with
-O2 on gcc.

Fixes: 67cbbf9417 ("panfrost: Use framebuffer pointer XML")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8627
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21991>
2023-03-22 11:50:36 +00:00
Erico Nunes
b6d5cb0d39 lima/ci: restore swap buffers egl tests
With the weston idle-time issue fixed, these no longer timeout and
can be enabled again.

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/22012>
2023-03-22 11:12:18 +00:00
Rhys Perry
e99ba0b6d3 nir/range_analysis: use perform_analysis() in nir_analyze_range()
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21381>
2023-03-22 09:24:18 +00:00
Rhys Perry
2b03db39b3 nir/range_analysis: use perform_analysis() in nir_unsigned_upper_bound()
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21381>
2023-03-22 09:24:18 +00:00
Rhys Perry
29a38b09cf nir/range_analysis: add helpers for limiting stack usage
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21381>
2023-03-22 09:24:18 +00:00
Rhys Perry
2145cf3dd1 nir/range_analysis: add missing masking of shift amounts
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Fixes: 72ac3f6026 ("nir: add nir_unsigned_upper_bound and nir_addition_might_overflow")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21381>
2023-03-22 09:24:18 +00:00
Rhys Perry
63e8f77d8e util/dynarray: allow an initial stack allocation to be used
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21381>
2023-03-22 09:24:18 +00:00
Jason Ekstrand
87efb9c3b3 intel/isl: Support Yf/Ys/Tile-64 in isl_surf_get_image_offset_sa
All that's really needed here is to handle the array offsetting by using
an Z or array offset instead of the Y offset.

This patch originally changed get_image_offset_sa_gfx9_1d(), but since
we only use linear with the 1d case, it was dropped.

Rework:
 * Jordan: Include ISL_TILING_64 as well
 * Jordan: Drop change to get_image_offset_sa_gfx9_1d as
   recommended by Nanley

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21113>
2023-03-22 08:32:52 +00:00
Samuel Pitoiset
d4bce9508b radv: use common GetBufferMemoryRequirements2()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22047>
2023-03-22 07:50:04 +00:00
Eric Engestrom
099a537e51 v3d/ci: group dEQP-GLES3.functional.texture.specification.teximage2d_pbo.* flakes and add another one
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22063>
2023-03-22 07:24:28 +00:00
Alyssa Rosenzweig
52e28d6e6e ir3: Use umod_imm
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22010>
2023-03-22 06:18:18 +00:00
Alyssa Rosenzweig
968c5c6334 radv: Use umod_imm
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22010>
2023-03-22 06:18:18 +00:00
Alyssa Rosenzweig
7b0133b30f v3d,v3dv: Use udiv_imm/umod_imm
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22010>
2023-03-22 06:18:18 +00:00
Alyssa Rosenzweig
e80f209df9 blorp,anv,hasvk: Use umod_imm
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22010>
2023-03-22 06:18:18 +00:00
Alyssa Rosenzweig
2933af7576 nir/builder: Add nir_umod_imm helper
Like nir_udiv_imm, we can do a similar power-of-two trick. It's also really
convenient.

v2: Assert reasonable bounds on the modulus (Faith).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> [v1]
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> [v1]
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22010>
2023-03-22 06:18:18 +00:00
Georg Lehmann
cec04adcee nir: optimize i2f(f2i(fsign))
Foz-DB Navi10:
Totals from 3013 (2.23% of 134906) affected shaders:
VGPRs: 138068 -> 136964 (-0.80%); split: -0.80%, +0.00%
CodeSize: 10476416 -> 10391800 (-0.81%)
MaxWaves: 79118 -> 80088 (+1.23%)
Instrs: 1963227 -> 1945003 (-0.93%)
Latency: 24734883 -> 24649279 (-0.35%); split: -0.39%, +0.05%
InvThroughput: 6366777 -> 6334735 (-0.50%); split: -0.50%, +0.00%
VClause: 36845 -> 36882 (+0.10%); split: -0.26%, +0.36%
SClause: 59249 -> 59273 (+0.04%); split: -0.25%, +0.29%
Copies: 108570 -> 108501 (-0.06%); split: -0.19%, +0.13%
PreSGPRs: 105371 -> 105862 (+0.47%)
PreVGPRs: 117675 -> 116625 (-0.89%); split: -0.89%, +0.00%

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22003>
2023-03-22 05:34:55 +00:00
Jarred Davies
a7b34ad8f2 pvr: Don't allocate/upload 0 size coeff programs
Fixes assert seen in dEQP-Vk.api.smoke.triangle

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>

Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22051>
2023-03-22 04:15:57 +00:00
Frank Binns
49ed1e55d8 pvr: fix clang-format issue
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22056>
2023-03-22 03:58:19 +00:00
David Heidelberg
7dcd02bd32 aco: drop leftover variable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8652
Fixes: 44fdd2ebcb ("aco: end reduce tmp after control flow, when used within control flow")

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22011>
2023-03-22 03:39:56 +00:00
Emma Anholt
f39ffc6911 ci/etnaviv: Get the gc2000_piglit manual job mostly working.
It was timing out, and the xfails were rather stale.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22039>
2023-03-21 23:46:13 +00:00
Emma Anholt
dfec80aed1 ci/hasvk: Update some xfails from the 8-sample fast clear disable.
Fixes: e509afacf3 ("hasvk: Disable non-zero fast clears for 8xMSAA images")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22039>
2023-03-21 23:46:13 +00:00
Emma Anholt
ecca3b9655 ci/crocus: Update expectations from VK CTS 1.3.5.0.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22039>
2023-03-21 23:46:13 +00:00
Emma Anholt
f2c356a095 ci/iris: Update more manual job xfails from the Wayland build change.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22039>
2023-03-21 23:46:13 +00:00
Samuel Pitoiset
cb5701eed9 radv: implement VK_KHR_map_memory2
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22032>
2023-03-21 23:08:03 +00:00
Samuel Pitoiset
cd59db8c46 radv: pass radv_shader to radv_shader_need_indirect_descriptor_sets()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21878>
2023-03-21 20:36:13 +00:00
Samuel Pitoiset
0d95660a03 radv: pass radv_ray_tracing_pipeline to radv_rt_pipeline_compile()
The base.base is redundant but this will allow us to move the shaders
array out of radv_pipeline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21878>
2023-03-21 20:36:13 +00:00
Samuel Pitoiset
88137cd710 radv: rework dumping shaders when a GPU hang is reported
Preliminary work for moving the shaders array outside of radv_pipeline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21878>
2023-03-21 20:36:13 +00:00
Samuel Pitoiset
444c5887c2 radv: pass radv_shader to radv_dump_shader_stats()
Preliminary work for moving the shaders array outside of radv_pipeline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21878>
2023-03-21 20:36:13 +00:00
Samuel Pitoiset
0514c015e6 radv: use a separate compute path in radv_flush_constants()
radv_get_shader() will be a radv_graphics_pipeline only function.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21878>
2023-03-21 20:36:12 +00:00
Samuel Pitoiset
e7bbd610b8 radv: pass shader/base_reg to radv_emit_userdata_address()
Preliminary work for moving the shaders array outside of radv_pipeline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21878>
2023-03-21 20:36:12 +00:00
Samuel Pitoiset
1e3cac8d5e radv: pass shader/base_reg to radv_emit_inline_push_consts()
Preliminary work for moving the shaders array outside of radv_pipeline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21878>
2023-03-21 20:36:12 +00:00
Samuel Pitoiset
c2e71729af radv: pass shader/base_reg to radv_emit_descriptor_pointers()
Preliminary work for moving the shaders array outside of radv_pipeline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21878>
2023-03-21 20:36:12 +00:00
Samuel Pitoiset
d7c5b6fb94 radv: replace radv_lookup_user_sgpr() by radv_get_user_sgpr()
radv_get_user_sgpr() no longer relies on radv_pipeline which is
another step for moving the shaders array outside of it.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21878>
2023-03-21 20:36:12 +00:00
Samuel Pitoiset
4066e3a951 radv: stop using radv_get_shader_shader() for task shaders
radv_get_shader() should only be used for VS or TES, no need to add
another indirection for task shaders. While we are at it, rename
compute_shader to task_shader.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21878>
2023-03-21 20:36:12 +00:00
Alyssa Rosenzweig
9169025d06 gallium: Fix u_stream_outputs_for_vertices with QUADS
Per the spec. This helper is only used in nv50 and panfrost, the latter is known
to have a completely broken transform feedback implementation and I'd be
unsurprised if the same is true for nv50. So unsurprising that compatibility
profile interaction was missed.

This is part of the Piglit ext_transform_feedback-tessellation quads puzzle.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22013>
2023-03-21 18:33:42 +00:00
Erik Faye-Lund
69cbc2e7ee docs: remove old thanks-article
This article is so out of date it's of no real use any more, and
updating it seems quite pointless. Let's just move it to the graveyard,
and forward any readers to the version we have in the amber-release.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22028>
2023-03-21 16:39:28 +00:00
Erik Faye-Lund
1c69fbff47 docs: move developers article to main website
This isn't content that relates directly to a specific release of Mesa,
and it's also quite out-of-date. Let's move it to the main mesa website
instead, where we have an updated version.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22028>
2023-03-21 16:39:28 +00:00
Timur Kristóf
d044eeb658 ac/nir/ngg: Rename repacked variables to clarify their name.
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/21995>
2023-03-21 15:47:32 +00:00
Timur Kristóf
5b50b9631c ac/nir/ngg: Create separate variable for repacked rel_patch_id.
This should be handled separately from the other repacked
variables, because it doesn't use a dword.

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/21995>
2023-03-21 15:47:32 +00:00
Timur Kristóf
30ce47cc00 ac/nir/ngg: Remove some superfluous variables.
These mostly existed because of the long name of the state variable
and are not really necessary.

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/21995>
2023-03-21 15:47:32 +00:00
Timur Kristóf
c22f9442f6 ac/nir/ngg: Rename state variables to "s".
It was a bad idea to give them a long name, let's correct it.

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/21995>
2023-03-21 15:47:32 +00:00
Timur Kristóf
0068dbee96 ac/nir/ngg: Move divergence analysis call to analyze_shader_before_culling.
It actually belongs there.

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/21995>
2023-03-21 15:47:32 +00:00
Timur Kristóf
a0a341f644 ac/nir/ngg: Split some functions out of save_reusable_variables.
To make the function a little easier to read and understand.

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/21995>
2023-03-21 15:47:32 +00:00
Timur Kristóf
091dffdfc9 ac/nir/ngg: Rename saved_uniform to reusable_nondeferred_variable.
We are planning to reuse more than just uniforms later,
hence let's clarify the name of these.

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/21995>
2023-03-21 15:47:32 +00:00
Timur Kristóf
c904c7dbf1 ac/nir/ngg: Remove usused lds_es enum values.
These were meant to explain the LDS layout, but
the actual LDS usage is better explained by:
ngg_nogs_get_culling_pervertex_lds_size().
Also add some comments there.

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/21995>
2023-03-21 15:47:32 +00:00
Erik Faye-Lund
1ca29408f1 docs/zink: clean up requirements-language
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22053>
2023-03-21 15:42:50 +00:00
Erik Faye-Lund
adc7170d85 docs/zink: mention vk1.2 mirror-clamp feature option
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22053>
2023-03-21 15:42:50 +00:00
Pierre-Eric Pelloux-Prayer
3f272fd15e ac/llvm: fix build with LLVM 17
This builds with LLVM 12 -> 17 and a running a simple app seems to work.

I couldn't test LLVM 11 because meson fails with:

    Looking for a fallback subproject for the dependency llvm (modules:
    bitwriter, engine, mcdisassembler, mcjit, core, executionengine,
    scalaropts, transformutils, instcombine, amdgpu, bitreader, ipo, native)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8297
Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22021>
2023-03-21 15:05:25 +00:00
Constantine Shablya
4659a94cfe vulkan: depend idep_vulkan_runtime_headers on vk_physical_device_features.h
Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8643
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21958>
2023-03-21 14:25:40 +00:00
Constantine Shablya
46c9e84ead vulkan: fix building with python3.8
Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8640
Reviewed-by: Ricardo Garcia <rgarcia@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21958>
2023-03-21 14:25:40 +00:00
Samuel Pitoiset
5082b6b034 radv: add support for caching PS epilogs
For PS epilogs created at link time because libraries are still not
cached.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21897>
2023-03-21 13:53:59 +00:00
Samuel Pitoiset
228afe1a2f radv: make radv_shader_part_create() non-static
It will be used when creating shaders from the cache.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21897>
2023-03-21 13:53:59 +00:00
Samuel Pitoiset
83c20b95dd radv: allow to return the PS epilog binary to the pipeline
To add it to the shaders cache.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21897>
2023-03-21 13:53:59 +00:00
Samuel Pitoiset
eba315d2bf radv: upload prologs/epilogs as part of radv_shader_part_create()
Don't need to duplicate this code.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21897>
2023-03-21 13:53:59 +00:00
Samuel Pitoiset
aa15d64949 radv: store the total radv_shader_part_binary size
Similar to radv_shader. This will be used for the shaders cache.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21897>
2023-03-21 13:53:59 +00:00
Samuel Pitoiset
aec9fd394f radv: store spi_shader_col_format to radv_shader_part_binary
For PS epilogs in the cache.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21897>
2023-03-21 13:53:58 +00:00
Samuel Pitoiset
a455e0c99f radv: stop storing the binary as part of radv_shader_part
It's unnecessary to keep a pointer to the binary.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21897>
2023-03-21 13:53:58 +00:00
Samuel Pitoiset
2803b786f0 radv: remove set but never used num_preserved_sgprs
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21897>
2023-03-21 13:53:58 +00:00
Tapani Pälli
415b824bc6 iris: implement occlusion query related Wa_14017076903
Fixes artifacts on some games that relied on occlusion query
results when no PS or depth buffers are bound.

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/21721>
2023-03-21 12:56:51 +00:00
Tapani Pälli
c34916f841 anv: implement occlusion query related Wa_14017076903
Fixes artifacts on some games that relied on occlusion query
results when no PS or depth buffers are bound.

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/21721>
2023-03-21 12:56:51 +00:00
Juan A. Suarez Romero
c10a9372d6 v3d: implement NV_conditional_render extension
The hardware doesn't support native conditional rendering, so it is
implemented by software.

Code borrowed from Freedreno and Panfrost.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17373>
2023-03-21 12:31:24 +00:00
Juan A. Suarez Romero
94de8767aa v3d: include offset as part of streamout target
When dealing with multiple Transform Feedback buffers, each of them
needs to have their own offset, so when resuming from one to another we
know exactly were to continue adding primitives.

Fixes "spec@arb_transform_feedback2@change objects while paused (gles3)"
piglit test.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17373>
2023-03-21 12:31:24 +00:00
Juan A. Suarez Romero
6d21d563a1 v3d: cache pipe query results
As the BO storing the results is destroyed after getting the query
results, store the results in case requesting the results again.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17373>
2023-03-21 12:31:24 +00:00
Lionel Landwerlin
957186102f anv: report shader max dispatch width in pipeline props
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22014>
2023-03-21 11:53:04 +00:00
Lionel Landwerlin
2acc2f18ea intel/compiler: report max dispatch width statistic
Most tools looking at shader stats assume that there is only a single
resulting binary shader out of a single input. On Intel HW this is not
always the case. So having a statistic on each variant that reports
the maximum dispatch width helps showing improvement on a single
shader in terms of how large we manage to compile it.

For shaders that can be compiled in multiple SIMD width (like fragment
shaders), this will report the maximum dispatch width in the
statistics of each variants.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22014>
2023-03-21 11:53:04 +00:00
Iago Toral Quiroga
1e28f2a6f2 broadcom/compiler: track pending ldtmu count with each TMU lookup
And use this information when scheduling QPU to avoid merging
a new TMU request into a previous ldtmu instruction when doing
so may cause TMU output fifo overflow due to a stalling ldtmu.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22044>
2023-03-21 11:29:05 +00:00
Erik Faye-Lund
c09482b293 docs: fixup broken indentation
This extra indentation caused these to be inside <blockquote>-tags,
which obviously isn't what we want.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21927>
2023-03-21 11:24:13 +00:00
Erik Faye-Lund
46143ecc4c docs: escape a few more strings
This makes it more obvious that these are not just plain english words.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21896>
2023-03-21 11:19:41 +00:00
Erik Faye-Lund
331601abda docs: fixup broken envvar-role syntax
This needs a leading colon, otherwise it renders as "envvar:" followed
with environment variable using the c-expression role.

Fixes: 4c19426fd6 ("docs/envvars: add missing mesa disk cache envvars")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21896>
2023-03-21 11:19:41 +00:00
Samuel Pitoiset
f2aa0e80a0 radv: enable fullyCoveredFragmentShaderInputVariable on GFX9+
For vkd3d-proton Tier 3.

It's passing CTS and vkd3d-proton tests.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8311
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21497>
2023-03-21 08:44:09 +00:00
Samuel Pitoiset
8e84251cc7 radv: implement fullyCoveredFragmentShaderInputVariable
1 means INNER_COVERAGE.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21497>
2023-03-21 08:44:09 +00:00
Samuel Pitoiset
ebbb0d3f1b radv: enable SAMPLE_COVERAGE_ENA if the fully covered built-in is used
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21497>
2023-03-21 08:44:09 +00:00
Samuel Pitoiset
2a02f567aa radv: lower nir_intrinsic_load_fully_covered
The sample coverage VGPR input would be the inner coverage and 0 means
it's uncovered.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21497>
2023-03-21 08:44:09 +00:00
Samuel Pitoiset
bb7e0c4280 spirv,nir: add support for SpvBuiltInFullyCoveredEXT
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/21497>
2023-03-21 08:44:09 +00:00
Samuel Pitoiset
cf2bc83c60 spirv: add SpvCapabilityFragmentFullyCoveredEXT
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/21497>
2023-03-21 08:44:09 +00:00
Benjamin Cheng
e57caf9893 radv: initialize cmd_buffer upload list earlier
When cs allocation fails in radv_create_cmd_buffer,
radv_destroy_cmd_buffer is called before returning
VK_ERROR_OUT_OF_HOST_MEMORY. At that point, the upload list is not
initalized yet, so SIGSEGV will occur when trying to iterate through the
upload bo list. Initialize the upload list earlier to avoid this.

Signed-off-by: Benjamin Cheng <ben@bcheng.me>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22016>
2023-03-21 08:06:24 +00:00
Mike Blumenkrantz
270f9c0b06 zink: add ZINK_DEBUG=flushsync
this disables the submission thread

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22040>
2023-03-20 22:12:40 -04:00
Mike Blumenkrantz
6a45e0d991 zink: don't update fbfetch in db mode if inputAttachmentDescriptorSize==0
turnip gets away with this somehow, so silence harmless validation errors

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22040>
2023-03-20 22:12:22 -04:00
Mike Blumenkrantz
46212427f9 zink: rework handling of unordered->ordered write buffer barriers
this improves handling for barriers that originate from a write in the
unordered cmdbuf, adding tracking to resources to better determine access
in the unordered cmdbuf and then utilizing that to generate a single split
memory barrier added at the end of the unordered cmdbuf for all the buffers
written to on that cmdbuf

the next step will be to also merge the read access down onto the end-of-cmdbuf
barrier so that all stream upload-type functionality becomes a single barrier

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22027>
2023-03-21 01:39:39 +00:00
Mike Blumenkrantz
e83513832b zink: always set sampler layouts when unbinding fb images while rp optimizing
this may or may not always be accurate, but in the cases where it is, it should
avoid some renderpass splitting, and in the cases where it isn't, there may
already be issues

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22027>
2023-03-21 01:39:39 +00:00
Mike Blumenkrantz
c2b3c7b6be zink: only run post-fb-unbind layout stuff if the resource isn't being destroyed
if refcount==1, the resource won't be used any further, and all the code
in this block is only for resources that will be used as samplers,
so don't run any of it

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22027>
2023-03-21 01:39:39 +00:00
Mike Blumenkrantz
b442ea4700 zink: add an assert to ensure zsbuf invalidation doesn't break rendering
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22027>
2023-03-21 01:39:39 +00:00
Mike Blumenkrantz
ad9a5c252a zink: force unordered_write=false when binding image descriptors
there's no way to link up image layouts between the unordered cmdbuf
and the main one, so if an op is promoted to unordered after an image
is used as a descriptor, the layout will be broken

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22027>
2023-03-21 01:39:39 +00:00
Mike Blumenkrantz
eaeb1350be zink: fix unordered access for image descriptors
previously the unordered access flags would be set before the deferred
barrier was added, which would guarantee no descriptor barriers could
be deferred and thus terminate renderpasses any time a new descriptor
was bound that was both an image and needed a layout change

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22027>
2023-03-21 01:39:39 +00:00
Mike Blumenkrantz
5018bc1358 zink: add batch refs for framebuffer surfaces on bind and ref update
if this scenario occurs:

* bind fb on ctx A
* draw
* flush + change context to B
* read fb on ctx B
* delete ctx A

then a dead batch write will be left on the fb bo

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22027>
2023-03-21 01:39:39 +00:00
Mike Blumenkrantz
c2d2cb5e45 zink: flag some rp ends as unsafe
the only "safe" rp ends are:
* set_framebuffer_state (new rp)
* flush_resource (present)
* flush (end of rp)

any other rp end needs its rp info sanitized to avoid e.g., reapplying clears

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22027>
2023-03-21 01:39:39 +00:00
Mike Blumenkrantz
7ca5656c49 zink: never split a renderpass for a loadop change
not sure if this was possible, but make sure it's not

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22027>
2023-03-21 01:39:39 +00:00
Mike Blumenkrantz
61c236bc31 zink: delete unused barrier api
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22027>
2023-03-21 01:39:39 +00:00
Mike Blumenkrantz
30d59c469a zink: simplify resource_check_defer_buffer_barrier()
this is a remnant of when the function was used for both images
and buffers

no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22027>
2023-03-21 01:39:39 +00:00
Mike Blumenkrantz
ca43ecefa4 zink: handle swapchain creation failure less lazily
this is a real scenario

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22027>
2023-03-21 01:39:39 +00:00
Emma Anholt
5873dcb32f nir/lower_mediump: Fix assertion about copy_deref lowering matching.
Copy and paste typo.  We shouldn't have copy_derefs during this pass,
anyway, but caught a failure with my upcoming unit testing.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21666>
2023-03-21 00:51:24 +00:00
Emma Anholt
1fff562929 glsl/lower_precision: Add actual spec quotes for "check_parameters"
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21666>
2023-03-21 00:51:24 +00:00
Emma Anholt
4a51944639 glsl: Fix the precision of atomic counter builtin function args.
More special-casing dropped from GLSL lower_precision.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21666>
2023-03-21 00:51:24 +00:00
Emma Anholt
b251f94e15 glsl/lower_precision: Drop most special-casing of builtin arg precision.
bitCount is still special in that our lowering would try to demote its arg
based on the precision of its output, and it shouldn't do that.  But the
other special cases now have appropriate qualifiers on them at the IR
level.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21666>
2023-03-21 00:51:24 +00:00
Emma Anholt
18e096769c glsl: Set the precision of function return value temporaries.
The signature should dictate the precision of the temp we store into.
This ends up ignored by lower_precision for now, which always rewrites it
so as to handle custom lowering of builtin precision..

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21666>
2023-03-21 00:51:24 +00:00
Emma Anholt
b1d228e9d5 glsl: Handle highp promotion of builtin function args in the builtins.
It's what the spec says to do.  This will may help us avoid special-casing
these functions if we ever lower precision after builtin inlining.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21666>
2023-03-21 00:51:24 +00:00
Emma Anholt
be2731f445 glsl: Set the precisions of builtin function arguments and returns.
These have precision qualifiers defined in the spec, in which case we
should emit them them while generating builtin signatures and code.  We've
been special-casing them in GLSL lower_precision, but now we can just rely
on the precision qualifier of the builtin if non-NONE.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21666>
2023-03-21 00:51:24 +00:00
Emma Anholt
2e85c9a422 glsl/lower_precision: Add a cut-down testcase for #8124
This pattern is the core of the webgl conformance failure, I think.  And,
I think actually lower_precision was doing the right thing, just the
conformance test going through ANGLE was screwing up.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21666>
2023-03-21 00:51:24 +00:00
Emma Anholt
41be2caa6d glsl/lower_precision: Add a unit test that I thought we might fail at.
If you lowered precision too late, it would be easy to break this.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21666>
2023-03-21 00:51:24 +00:00
Emma Anholt
9a2d66f5a5 glsl: Simplify vector constructors from scalars.
No need to generate a temp in this case.  Cleanup I noticed while looking
at lower_precision behavior (and I've included a testcase to sanity check
that things work out).

This causes a tiny amount of scheduling change on freedreno:

total instructions in shared programs: 11010012 -> 11010012 (0.00%)
instructions in affected programs: 147 -> 147 (0.00%)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21666>
2023-03-21 00:51:24 +00:00
Faith Ekstrand
92ea49edcb anv: Implement VK_KHR_map_memory2
Reviewed-by: Iván Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22031>
2023-03-20 23:11:09 +00:00
Faith Ekstrand
f4a5b2d59e anv: Limit memory maps to the client-allocated size
No need to expose extra padding or CCS data to the client map.  Now that
we have the data, we can also make the BindBufferMemory asserts a bit
more accurate.

Reviewed-by: Iván Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22031>
2023-03-20 23:11:09 +00:00
Faith Ekstrand
b4497e54be vulkan: Provide wrappers for VK_EXT_map_memory2 functions
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Iván Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22031>
2023-03-20 23:11:09 +00:00
Faith Ekstrand
8af4fa3d4b vulkan: Update XML and headers to 1.3.244
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Iván Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22031>
2023-03-20 23:11:09 +00:00
Mike Blumenkrantz
efa6387a09 zink: convert luminance/alpha clear colors in dynamic texture clear
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22025>
2023-03-20 22:19:09 +00:00
Mike Blumenkrantz
600b8ba75c zink: split out luminance/alpha clear conversion code for reuse
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22025>
2023-03-20 22:19:08 +00:00
Patrick Lerda
84762bb1cf glx: fix memory leak related to __glXCloseDisplay()
Indeed, the unbind function is not called which could lead
to an unbalanced refcount state for the "drawable" object.

For instance, with "piglit/bin/glx-fbo-binding -auto"
while setting GALLIUM_REFCNT_LOG=refcnt.log.

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22024>
2023-03-20 21:12:54 +00:00
Lang Yu
19b89c8077 amd/common: fix a typo
Fixes: 35f053ba8c ("radv: Fix corrupted mipmap copies on GFX9+")

Signed-off-by: Lang Yu <lang.yu@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22000>
2023-03-20 20:30:32 +00:00
Konstantin Seurer
deb537de3c radv/rt: Handle load_constant instructions when inlining shaders
Fixes the following tests:
dEQP-VK.ray_query.builtin.rayqueryterminate.ahit.aabbs,Fail
dEQP-VK.ray_query.builtin.rayqueryterminate.ahit.triangles,Fail
dEQP-VK.ray_query.builtin.rayqueryterminate.call.aabbs,Fail
dEQP-VK.ray_query.builtin.rayqueryterminate.call.triangles,Fail
dEQP-VK.ray_query.builtin.rayqueryterminate.chit.aabbs,Fail
dEQP-VK.ray_query.builtin.rayqueryterminate.chit.triangles,Fail
dEQP-VK.ray_query.builtin.rayqueryterminate.miss.aabbs,Fail
dEQP-VK.ray_query.builtin.rayqueryterminate.miss.triangles,Fail
dEQP-VK.ray_query.builtin.rayqueryterminate.rgen.aabbs,Fail
dEQP-VK.ray_query.builtin.rayqueryterminate.rgen.triangles,Fail
dEQP-VK.ray_query.builtin.rayqueryterminate.sect.aabbs,Fail
dEQP-VK.ray_query.builtin.rayqueryterminate.sect.triangles,Fail

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8647
Fixes: fda262f ("radv/rt: move Ray Tracing shader creation into separate file")
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22002>
2023-03-20 19:04:34 +00:00
Mike Blumenkrantz
23cd81686c zink: further eliminate zs implicit feedback loops for read-only access
if all access is read-only then there is no feedback loop

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21988>
2023-03-20 18:24:07 +00:00
Mike Blumenkrantz
a702e5038c zink: explicitly eliminate feedback loops for unused zsbufs
this avoids a GENERAL/FEEDBACK_LOOP layout transition where possible

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21988>
2023-03-20 18:24:07 +00:00
Mike Blumenkrantz
618c3651ff zink: rename add_implicit_color_feedback_loop()
this is used for zs too

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21988>
2023-03-20 18:24:07 +00:00
Mike Blumenkrantz
2d099c46cc zink: allow zink_is_zsbuf_used() without tc / rp optimizing
this info should be up-to-date and usable now in all cases

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21988>
2023-03-20 18:24:07 +00:00
Mike Blumenkrantz
c900b9e35f zink: don't flag rp layout check on next draw when rp optimizing
this will always be a no-op, so save the cpu cycles

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21988>
2023-03-20 18:24:07 +00:00
Mike Blumenkrantz
d6e40b7d54 zink: improve no-oping of write -> readonly zsbuf layouts
if descriptor binds exist this will have to change layouts anyway,
so allow readonly since it might be a more compatible layout

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21988>
2023-03-20 18:24:07 +00:00
Mike Blumenkrantz
93d7bde9dc zink: add a fixup case for readonly zsbuf clears
this shouldn't currently be possible to hit, but in the future it may

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21988>
2023-03-20 18:24:07 +00:00
Mike Blumenkrantz
e2e079eef4 zink: track whether the fb zsbuf is readonly
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21988>
2023-03-20 18:24:07 +00:00
Mike Blumenkrantz
1b9e9a54ab zink: fix dsa state parsing for tc info
stencil test implies zs write

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21988>
2023-03-20 18:24:07 +00:00
Mike Blumenkrantz
d8bb8af4f5 zink: track zsbuf info even when rp optimizing is disabled
this should allow zsbuf elimination in some cases

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21988>
2023-03-20 18:24:07 +00:00
Samuel Pitoiset
d750ad19fd radv: fix NGG streamout with VS and GPL on GFX11
With GPL it's not possible to know the primitive topology when
compiling the pre-rasterization stages. For NGG, we use the maximum
number of vertices per prim and rely on the hardware to ignore the
extra bits for points/lines.

Though, this can't work for NGG streamout because the number of
vertices per prim is used to compute a streamout offset. The only
way to solve this is to pass the number of vertices per prim through
a new user SGPR.

This fixes a bunch of streamout tests with Zink/RADV on GFX11.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21833>
2023-03-20 17:47:03 +00:00
José Roberto de Souza
491887c9f2 intel: Add TODO about removal of 2Mb alignment in i915
Xe kmd don't suffer this yet because it still lacks MTL support.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21972>
2023-03-20 17:18:04 +00:00
José Roberto de Souza
96302900aa anv: Apply memory alignment requirements in Xe kmd
Without alignment vm bind will fail and during gem buffer creation
size also need to be aligned otherwise the range in vm bind can be
bigger than allocated size for smem.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21972>
2023-03-20 17:18:04 +00:00
José Roberto de Souza
7dc8474c3b intel: Set mem_alignment in Xe kmd
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21972>
2023-03-20 17:18:04 +00:00
José Roberto de Souza
bfc1782ad6 anv: Use intel_device_info memory alignment
It was also necessary to initialize mem_alignment in the tests
otherwise vma allocation would fail with stubs.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21972>
2023-03-20 17:18:04 +00:00
José Roberto de Souza
2ab3d5f436 intel: Move memory aligment information to intel_device_info
This same information is also used in ANV, so intel_device_info is
a better place to have it.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21972>
2023-03-20 17:18:03 +00:00
Eric Engestrom
12cf314dd8 v3d/ci: add another depthstencil-default_fb-drawpixels-* to the flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22026>
2023-03-20 16:51:18 +00:00
Erik Faye-Lund
859bcd605d ci: move docs-stuff out of root .gitlab-ci.yml
Unlike most other cases, we don't put the YAML-file in a ci-folder,
because we already have one for the CI-specific docs. So let's just
leave the YAML file directly in the docs-folder.

This should fix the problem that any docs-changes that touches the
CI-rules needs a full CI run just because of touching the root
.gitlab-ci.yml file. This causes needless friction and wastes CI
resources.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21953>
2023-03-20 15:27:37 +00:00
Jarred Davies
220356e083 pvr: Add initial support for VK_FORMAT_S8_UINT
Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>

Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21594>
2023-03-20 14:47:34 +00:00
Jarred Davies
317a3fe49b pvr: Select a single aspect format for the texture state of DS image views
This change also means the texture state words will be based off of the
image view's format instead of the image's format.

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>

Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21594>
2023-03-20 14:47:34 +00:00
Jarred Davies
26671b5d63 pvr: Add support for multiple emits from EOT program
Co-authored-by: Simon Perretta <simon.perretta@imgtec.com>

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21596>
2023-03-20 14:35:19 +00:00
Jarred Davies
4162c37d57 pvr: Generate dummy emit for renders without any emits
Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21596>
2023-03-20 14:35:19 +00:00
Jarred Davies
de5258ae2b pvr: Generate EOT program at runtime
Also removes hardcoded EOT program.

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21596>
2023-03-20 14:35:19 +00:00
Samuel Pitoiset
0badfd8b20 radv: add helpers for destroying various pipeline types
Much cleaner than having a single function for everything.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21894>
2023-03-20 13:56:32 +00:00
Samuel Pitoiset
abfdc06b01 radv: rename RADV_PIPELINE_LIBRARY to RADV_PIPELINE_RAY_TRACING_LIB
This seems more consistent with graphics pipeline libraries and it
avoids any confusion.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21894>
2023-03-20 13:56:32 +00:00
Collabora's Gfx CI Team
10622ccc73 Uprev Piglit to 60e7f0586bac0cfcfcb5871046e31ca2057a5117
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21640>
2023-03-20 12:17:20 +00:00
Eric Engestrom
20ba9b9faa v3dv: use vk_get_physical_device_features
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21959>
2023-03-20 12:00:10 +00:00
Eric Engestrom
d94625d110 v3dv: reorder features as 1.0, 1.1, 1.2, 1.3
Easier to follow than 1.0, 1.3, 1.2, 1.1 :)

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21959>
2023-03-20 12:00:09 +00:00
Eric Engestrom
a0be8597ac v3dv: use common GetPhysicalDeviceFeatures
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21959>
2023-03-20 12:00:09 +00:00
Samuel Iglesias Gonsálvez
4378906885 docs/developers: Add Igalia as Mesa consultancy
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22020>
2023-03-20 11:51:34 +00:00
Eric Engestrom
a7c051b5ac v3d: fix dirty bitset being too small to accept V3D_DIRTY_SSBO
Many of the `V3D_DIRTY_*` flags are above 32 bits, but for now the only
one used here is V3D_DIRTY_SSBO.

`shader->uniform_dirty_bits`, where `dirty` ends up, is already 64 bits.

Fixes: 45bb8f2957 ("broadcom: Add V3D 3.3 gallium driver called "vc5", for BCM7268.")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22019>
2023-03-20 09:29:40 +00:00
Timothy Arceri
29c71b8eb0 util/00-mesa-defaults: add Akka Arrh workaround
Cc: mesa-stable

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21979>
2023-03-20 07:18:41 +00:00
volodymyr.o
47e7b49c61 mesa ctx->API --> _mesa_is_foo(ctx)
replaces direct API checks with _mesa_is_...() checks

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

Signed-off-by: Volodymyr Obohzyn volodymyr.obozhyn@globallogic.com

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21556>
2023-03-20 06:39:57 +00:00
Brian Paul
5e039dbf8e gallium/xlib: call fence_finish() in XMesaSwapBuffers()
Before we can present the buffer we need to wait for the fence to
finish.  This fixes severe flickering of unfinished rendering in
many demos/tests.  This has been broken for a while, I think.

Note, this is for the non-DRI / Xlib-based GLX.

Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21993>
2023-03-20 06:05:47 +00:00
Oleksii Bozhenko
bbde684ca0 ci: Uprev Piglit
Signed-off-by: Oleksii Bozhenko <oleksii.bozhenko@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21810>
2023-03-20 04:19:23 +00:00
Oleksii Bozhenko
bf910c94e0 glsl: fix gl_CullDistance lowering from float[8] to vec4[2]
Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7152
Fixes: ad355652c2 ("glsl: Extend lowering pass for gl_ClipDistance to support other arrays")

Signed-off-by: Oleksii Bozhenko oleksii.bozhenko@globallogic.com

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21810>
2023-03-20 04:19:23 +00:00
Mike Blumenkrantz
ec31535ce0 zink: add debug markers for draws
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21962>
2023-03-20 03:57:32 +00:00
Mike Blumenkrantz
af9bffd07d zink: catch zs u_blitter ops for draw markers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21962>
2023-03-20 03:57:32 +00:00
Mike Blumenkrantz
c56b46638c zink: round geometry for u_blitter debug markers
this otherwise gets weird values

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21962>
2023-03-20 03:57:32 +00:00
Mike Blumenkrantz
3a9f7d7038 zink: implement unordered u_blitter calls
as long as a few bits of state are swapped around and none of the "main"
cmdbuf state is applied, it becomes possible to promote the entire
u_blitter operation to the unordered cmdbuf and execute it there as
a "transfer" operation that can continue to enable further reordering

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21906>
2023-03-20 02:26:20 +00:00
Mike Blumenkrantz
4593f335f6 zink: add zink_context::unordered_blitting to preserve unordered flags
not currently used but will be used to wrap u_blitter

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21906>
2023-03-20 02:26:20 +00:00
Mike Blumenkrantz
887f72990e zink: split out pipeline rp info update function
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21906>
2023-03-20 02:26:20 +00:00
Mike Blumenkrantz
9746e7253e zink: manually apply barriers whenever zink_context::blitting is set
this simplifies some codepaths at runtime by short-circuiting some
of the more complex operations since it's already known in advance
exactly which images will be used for which purpose

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21906>
2023-03-20 02:26:20 +00:00
Mike Blumenkrantz
07a5ede65a zink: reset fb clears using the clears_enabled mask
iterating was fine before, but it will become problematic to reset
all the clears once they start being stashed for unordered ops

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21906>
2023-03-20 02:26:20 +00:00
Mike Blumenkrantz
7411264ca6 zink: add a dynamic render version of clear_texture hook
this avoids the (sizable) overhead of going through the previous path
with set_frame_buffer state et al, instead just firing off a quick
begin+end rendering with a clear

it's also easily reorderable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21906>
2023-03-20 02:26:20 +00:00
Mike Blumenkrantz
e1621d3e6d zink: add a function for applying u_blitter barriers
this handles transitions for a sampler_view src -> framebuffer dst
operation

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21906>
2023-03-20 02:26:20 +00:00
Mike Blumenkrantz
22fb4578a0 zink: end rp earlier in set_framebuffer_state
this way any barriers occuring from unbinds won't have to do rp calc

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21906>
2023-03-20 02:26:20 +00:00
Mike Blumenkrantz
63f425c7d2 zink: double check layouts for possible feedback loop images
if a feedback loop hasn't yet been added for an image with both
descriptor and fb binds, queue a check for that to avoid mismatch

affects godot-tps-gles3-high.trace

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21906>
2023-03-20 02:26:19 +00:00
Mike Blumenkrantz
7812f3844b zink: add some asserts for zs layout in dynamic render
assert all the things

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21906>
2023-03-20 02:26:19 +00:00
David Heidelberg
dc34413f43 meson: implement quirk for the compilation under armv7 GCC with LTO
Until https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108163 gets fixed.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21554>
2023-03-19 15:21:22 +00:00
David Heidelberg
afb82e553b ci: disable weston session timeout for llvmpipe
Fixes: d57a4b57df ("ci: disable weston session timeout")

Cc: mesa-stable
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22004>
2023-03-19 15:39:31 +01:00
David Heidelberg
fb3632d24f ci: distribute XDG_RUNTIME_DIR with setup-test-env script
Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8615
Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8646

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22004>
2023-03-19 15:39:12 +01:00
Rob Clark
210c6c11cc freedreno+tu: Add a690 support
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21573>
2023-03-18 18:21:53 +00:00
Rob Clark
b012a4a9cd freedreno+tu: Big GMEM support
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21573>
2023-03-18 18:21:53 +00:00
Rob Clark
60bc7c0e22 freedreno: Specify GMEM tile alignment per GPU
They differ presumably based on # of CCU/SP and DDR bus topology.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21573>
2023-03-18 18:21:53 +00:00
Bas Nieuwenhuizen
ad4271439c Update my mailmap aliases
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21998>
2023-03-18 17:19:00 +00:00
Konstantin Seurer
0f18bb4076 radv: Fix inserting stack_size into the cache
Fixes: 3e03fe4 ("radv/rt: move stack_sizes into radv_ray_tracing_module")
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21969>
2023-03-18 14:57:51 +00:00
Konstantin Seurer
3887f64dc3 radv: Fix loading stack_size from the cache
Fixes: 3e03fe4 ("radv/rt: move stack_sizes into radv_ray_tracing_module")
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21969>
2023-03-18 14:57:51 +00:00
David Heidelberg
3823d4696a ci/intel: add dEQP-EGL.functional.wide_color.window_fp16_default_colorspace flake
Occasionally flake since Wayland got enabled.

Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21990>
2023-03-18 14:20:44 +01:00
David Heidelberg
161799d2c7 ci/traces: add two skips due to flakes
The unvanquished flaked time to time from beginning, minetest-v2 has
occasional 1 tiny change in the pixel.

Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21990>
2023-03-18 14:20:41 +01:00
David Heidelberg
9e6c88c96b ci/freedreno: add recent occasional flakes
Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21990>
2023-03-18 14:20:21 +01:00
Mike Blumenkrantz
9ed6487ba0 zink: expand ZINK_DEBUG=sync to cover copy ops
useful for debugging

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21999>
2023-03-18 11:44:38 +00:00
Mike Blumenkrantz
e1bfae1d4d zink: add tracing for copy ops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21999>
2023-03-18 11:44:38 +00:00
Iván Briano
4dd81b4e2f intel/fs: handle interpolation modes for at_sample and at_offset too
Fixes dEQP-VK.draw.*.linear_interpolation.*

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19647>
2023-03-18 10:18:15 +00:00
Tatsuyuki Ishi
22d6556a4b radv: Fix missing wait of GS copy shader upload for dmashaders.
Fixes: 0cde42a506 ("radv: Wait for shader uploads asynchronously.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21985>
2023-03-18 03:04:15 +00:00
Jesse Natalie
3ce2b71193 dzn: Claim the arithmetic subgroup bit
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21996>
2023-03-18 02:33:42 +00:00
Jesse Natalie
b4de74165d spirv2dxil: Handle arithmetic subgroup ops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21996>
2023-03-18 02:33:42 +00:00
Jesse Natalie
ccc9540dae microsoft/compiler: Add a lowering pass for scan ops that aren't supported
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21996>
2023-03-18 02:33:42 +00:00
Jesse Natalie
981fe2bf42 microsoft/compiler: Implement wave reduce/exclusive scan ops that are supported
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21996>
2023-03-18 02:33:42 +00:00
Marek Olšák
082368cd84 radeonsi: remove unused vs_output_param_mask
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21920>
2023-03-17 23:58:28 +00:00
Marek Olšák
6eddc6dd5a ac/nir: use plural correctly in the ac_nir_export_parameters name
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21920>
2023-03-17 23:58:28 +00:00
Marek Olšák
3626bc2daa ac/nir: don't emit duplicated parameter exports
Can you spot the problem?
    exp param0 v6, v5, v5, v5
    exp param1 v7, off, off, off
    exp param1 v7, off, off, off

radeonsi uses ac_nir_optimize_outputs to eliminate output stores with
identical SSA defs (i.e. duplicated), which then causes 2 outputs to
map to the same parameter export.

This is a regression. The old LLVM code was correctly emitting each
export only once. vs_output_param_mask was supposed to be used for
this instead of vs_output_param_offset.

Fixes: 80506be31b - ac/nir/ngg,radv,radeonsi: nogs use ac_nir_export_(position|parameter)

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21920>
2023-03-17 23:58:28 +00:00
José Roberto de Souza
c86d6c8af8 iris: Move to iris_i915_batch.c code to destroy i915 context
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21965>
2023-03-17 23:29:43 +00:00
José Roberto de Souza
cb40ff3ecb iris: Move to i915/iris_batch.c code to create and replace i915 context
Some helper functions in iris_bufmgr were also moved because the only
caller is in iris_i915_batch.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21965>
2023-03-17 23:29:43 +00:00
José Roberto de Souza
7a1d0b31a6 iris: Store iris_context's priority
This way when replacing a broken context we don't need to ask to
kernel what is the priority of the context being replaced.

Also this will be necessary for Xe kmd as it don't have any uapi to
query engine priority.

While doing that also taking the oportunity to move more code from
iris_bufmgr.c/h that only has one caller.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21965>
2023-03-17 23:29:43 +00:00
Brian Paul
75b9d0b3d8 llvmpipe: remove debug printf spam in lp_setup_wait_empty_scene()
Remove some stray debug code which spams the terminal.

Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21994>
2023-03-17 23:02:35 +00:00
Martin Roukala (né Peres)
a882cf09c3 ci/b2c: increase the console timeout to 4 minutes
When downloading new containers, we can often trip the 2 minutes
console activity timeout. This will be improved in the next b2c
version[1] but let's increase it until we address it.

[1] https://gitlab.freedesktop.org/mupuf/boot2container/-/issues/51

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21983>
2023-03-17 22:27:01 +00:00
Martin Roukala (né Peres)
d3c1cc9261 radv/ci: update VanGogh's expectations
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21983>
2023-03-17 22:27:01 +00:00
Eric Engestrom
8e6ac35658 asahi: fix a few typos
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21947>
2023-03-17 22:11:33 +00:00
Kenneth Graunke
b6878d456f st/mesa, iris: Add optional CPU-based ASTC void extent denorm flushing
Intel Gen9 GPUs have hardware ASTC support, but have a bug where they
don't handle denormalized values in void extent blocks correctly.  This
isn't that hard to work around - on upload, we can detect such blocks,
and flush any denorms to zero.  Because we're altering the data behind
the application's back, and applications can theoretically ask to
download the original unaltered image data, we unfortunately need to
maintain shadow copies of the data.

To make sure that we don't accidentally skip the void-extent flushing
via any fast-upload paths, and support download correctly, we plug this
into the st/mesa compressed texture format fallback paths, which store
a CPU copy of the original image data, and upload altered data.

This is unfortunately common code for what's likely to be a single
driver's issue (on a single generation), but it beats replicating an
entire framework we already have inside the driver.

Fixes dEQP-GLES3.functional.texture.compressed.astc.void_extent_ldr.*
using iris on Intel Gen9 GPUs.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4167
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21943>
2023-03-17 21:30:48 +00:00
Alyssa Rosenzweig
f534c36ca5 ci: Enforce clang-format for asahi
Some drivers use clang-format exclusively. We would like to lint for correct
formatting in CI to catch style issues before they land, because mixing
clang-format and not clang-format within a codebase is a recipe for conflicts.

We don't expect this lint to ever fail in "normal" usage, since we expect
developers on these drivers to setup automatic formatting in their editor.
However, it can be useful as a failsafe or for drive-by contributors who don't
know the style guide.

Enable the linting for Asahi. We'll enable for Panfrost shortly, but Panfrost
isn't clang-format clean quite yet.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20553>
2023-03-17 19:59:21 +00:00
Alyssa Rosenzweig
5c1b360eaa ci: Add clang-format to the amd64 container
We need clang-format available in order to check for formatting errors later.
Add it to the amd64 container only (this requires some shenigans to avoid
multi-arch conflicts).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20553>
2023-03-17 19:59:21 +00:00
José Roberto de Souza
d2621ef81d iris: Implement gem_mmap() in Xe kmd backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21937>
2023-03-17 19:31:56 +00:00
José Roberto de Souza
16dbf50ad9 iris: Implement gem_create() in Xe kmd backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21937>
2023-03-17 19:31:56 +00:00
José Roberto de Souza
c9fdfae334 iris: Implement the function to destroy VM in Xe
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21937>
2023-03-17 19:31:56 +00:00
José Roberto de Souza
60f4bd61b6 iris: Implement the Xe version of iris_bufmgr_init_global_vm()
As Xe KMD requires VM, iris_bufmgr_init_global_vm() now is returing
a boolean telling if bufmgr creationg should continue or not.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21937>
2023-03-17 19:31:56 +00:00
José Roberto de Souza
7f65b94451 iris: Only mark buffer as exported if drmPrimeHandleToFD() succeed
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21966>
2023-03-17 17:36:15 +00:00
Rhys Perry
596f2ef361 aco: set needs_flat_scr=true for RT
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Fixes: 39c828cb9f ("aco: remove aco::rt_stack variable")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21961>
2023-03-17 16:55:57 +00:00
Rhys Perry
184cf1cb79 aco/gfx11: fix RT prolog scratch initialization
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Fixes: 6446b79168 ("aco: implement select_rt_prolog()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21961>
2023-03-17 16:55:57 +00:00
Michel Dänzer
2ead574abe ci: Enable LTO for fedora-release job
Requires -Wno-error=... to be passed to the linking stage.

NOTE: This does not imply that it's safe to enable LTO for Fedora
package builds yet. It just helps prevent moving further away from that
long term goal.

v2:
* Keep passing -Wno-error=array-bounds & -Wno-error=stringop-overread.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>
2023-03-17 16:08:34 +00:00
Michel Dänzer
eb9cd45ef6 ci: Install procps-ng in Fedora image
For GCC LTO wrapper scripts.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>
2023-03-17 16:08:34 +00:00
Michel Dänzer
2b739ca31d ci: Drop ccache from Fedora image
It started hanging in F36 as well.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>
2023-03-17 16:08:34 +00:00
Michel Dänzer
bca2bcfec9 ci: Make ccache optional
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>
2023-03-17 16:08:34 +00:00
Michel Dänzer
fe53fa5117 ci: Allow passing c{,pp}_link_args to meson
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>
2023-03-17 16:08:34 +00:00
Michel Dänzer
b6e0bf8b76 ci: Pass -Werror to compiler linking stage for LTO
With LTO, some compiler warnings are generated only at the compiler's
linking stage. Therefore -Werror needs to be passed to the linking stage
as well for warnings to be turned into errors.

Meson should really do this when both werror and b_lto are enabled, but
meanwhile let's do it ourselves.

We can't just add -Werror to c{,pp}_link_args, because those are passed
for Meson's feature checks, some of which generate warnings, resulting
in false negatives. We use gcc/g++ wrapper scripts instead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>
2023-03-17 16:08:33 +00:00
Michel Dänzer
86c6634897 intel/vk/grl: Do not use no_override_init_args for C++
It's only valid for C code.

Avoids

cc1plus: error: command-line option '-Wno-override-init' is valid for C/ObjC but not for C++ [-Werror]

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>
2023-03-17 16:08:33 +00:00
Michel Dänzer
66e34fe914 ci: Split up -Werror workarounds for debian-mingw32-x86_64 job
Most of them are only needed for C++ code, one of them only for C.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>
2023-03-17 16:08:33 +00:00
Michel Dänzer
86496167ea ci: Remove some -Werror workarounds for debian-android job
No more corresponding warnings.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>
2023-03-17 16:08:33 +00:00
Michel Dänzer
2f3dc68948 iris: Use ralloc_free for memory allocated with rzalloc
Pointed out by GCC with LTO:

../src/gallium/drivers/iris/iris_context.c: In function 'iris_create_context':
../src/gallium/drivers/iris/iris_context.c:304:7: error: 'free' called on pointer 'block_180' with nonzero offset 48 [-Werror=free-nonheap-object]
  304 |       free(ctx);
      |       ^
[...]
../src/gallium/drivers/iris/iris_context.c:313:7: error: 'free' called on pointer 'block_180' with nonzero offset 48 [-Werror=free-nonheap-object]
  313 |       free(ctx);
      |       ^

v2:
* Use ice pointer instead of ctx. (Karol Herbst)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>
2023-03-17 16:08:33 +00:00
Michel Dänzer
c65948a34b crocus: Use ralloc_free for memory allocated with rzalloc
Pointed out by GCC with LTO:

../src/gallium/drivers/crocus/crocus_context.c: In function 'crocus_create_context':
../src/gallium/drivers/crocus/crocus_context.c:261:7: error: 'free' called on pointer 'block_174' with nonzero offset 48 [-Werror=free-nonheap-object]
  261 |       free(ctx);
      |       ^

v2:
* Use ice pointer instead of ctx. (Karol Herbst)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>
2023-03-17 16:08:33 +00:00
Michel Dänzer
c67633be62 r600: Use container_of instead of direct pointer cast
Fixes strict aliasing violation:

In function 'r600_init_resource_fields',
    inlined from 'r600_buffer_create' at ../src/gallium/drivers/r600/r600_buffer_common.c:578:2:
../src/gallium/drivers/r600/r600_buffer_common.c:139:48: warning: array subscript 'struct r600_texture[0]' is partly outside array bounds of 'unsigned char[264]' [-Warray-bounds]
  139 |         if ((res->b.b.target != PIPE_BUFFER && !rtex->surface.is_linear) ||
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/util/os_memory.h:37,
                 from ../src/util/u_memory.h:38,
                 from ../src/gallium/include/pipe/p_state.h:47,
                 from ../src/gallium/auxiliary/util/u_inlines.h:34,
                 from ../src/gallium/auxiliary/pipebuffer/pb_buffer.h:49,
                 from ../src/gallium/include/winsys/radeon_winsys.h:46,
                 from ../src/gallium/drivers/r600/r600_pipe_common.h:37,
                 from ../src/gallium/drivers/r600/r600_cs.h:33,
                 from ../src/gallium/drivers/r600/r600_buffer_common.c:27:
In function 'r600_alloc_buffer_struct',
    inlined from 'r600_buffer_create' at ../src/gallium/drivers/r600/r600_buffer_common.c:576:34:
../src/util/os_memory_stdc.h:41:27: note: object of size 264 allocated by 'malloc'
   41 | #define os_malloc(_size)  malloc(_size)
      |                           ^~~~~~~~~~~~~
../src/util/u_memory.h:46:24: note: in expansion of macro 'os_malloc'
   46 | #define MALLOC(_size)  os_malloc(_size)
      |                        ^~~~~~~~~
../src/util/u_memory.h:54:41: note: in expansion of macro 'MALLOC'
   54 | #define MALLOC_STRUCT(T)   (struct T *) MALLOC(sizeof(struct T))
      |                                         ^~~~~~
../src/gallium/drivers/r600/r600_buffer_common.c:554:19: note: in expansion of macro 'MALLOC_STRUCT'
  554 |         rbuffer = MALLOC_STRUCT(r600_resource);
      |                   ^~~~~~~~~~~~~

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>
2023-03-17 16:08:33 +00:00
Michel Dänzer
ff73392774 nouveau: Make getSize return unsigned int
This matches the type of the underlying size member, and is consistent
with other getSize methods.

Avoids compiler warning with LTO enabled:

In member function '__ct ',
    inlined from 'convertToSSA' at ../src/nouveau/codegen/nv50_ir_ssa.cpp:401:26,
    inlined from 'convertToSSA' at ../src/nouveau/codegen/nv50_ir_ssa.cpp:310:28,
    inlined from 'nv50_ir_generate_code' at ../src/nouveau/codegen/nv50_ir.cpp:1331:22:
../src/nouveau/codegen/nv50_ir_ssa.cpp:407:48: error: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=]
  407 |    stack = new Stack[func->allLValues.getSize()];
      |                                                ^
/usr/include/c++/12/new: In function 'nv50_ir_generate_code':
/usr/include/c++/12/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>
2023-03-17 16:08:33 +00:00
Alejandro Piñeiro
20a066e9ab v3dv/debug: add debug option to disable TFU codepaths
This can have two main uses:
  * If we suspect a problem with TFU copies, we can disable it and
    check if other codepaths gets a test/app working.
  * To test other codepaths, as in general, TFU is the preferred
    option for copies.

Note that for now this is only for v3dv, as for v3d, mipmap generation
uses TFU without an alternative codepath.

With this option we also adds an assert if we try to submit a TFU job,
just in case we keep adding other methods that use TFU, and forget to
include the debug option there.

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/21952>
2023-03-17 15:20:25 +00:00
Mike Blumenkrantz
46813ffecb zink: only flag rp info for updating on flush, don't actually update
this is more consistent with actual usage

also sanitize rp info on flush to ensure it isn't reused

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:38:00 +00:00
Mike Blumenkrantz
430db81071 aux/tc: rework inter-batch renderpass info handling
the tricky part of tracking renderpass info in tc is handling batch
flushing. there are a number of places that can trigger it, but
there are only two types of flushes:
* full flushes (all commands execute)
* partial flushes (more commands will execute after)

the latter case is the important one, as it effectively means that
the current renderpass info needs to "roll over" into the next one,
and it's really the next info that the driver will want to look at.
this is made trickier by there being no way (for the driver) to distinguish
when a rollover happens in order to delay beginning a renderpass for
further parsing

to solve this, add a member to renderpass info to chain the rolled-over info,
which tc can then process when the driver tries to wait. this works "most"
of the time, except when an app/test blows out the tc batch count, in which
case this pointer will be non-null, and it can be directly signaled as a less
optimized renderpass to avoid deadlocking

also sometimes a flush will trigger sub-flushes for buffer lists, so
add an assert to ensure nobody tries using this with driver_calls_flush_notify=true

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:38:00 +00:00
Mike Blumenkrantz
3d96049191 aux/tc: make some of the rp tracking api private
this enables some more under-the-hood changes without touching the header
that will force all of gallium to be recompiled

also update/clarify rules for using rp tracking; these haven't changed,
but the documentation was less clear before

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:38:00 +00:00
Mike Blumenkrantz
64a256c66a aux/tc: fix initial rp info allocation
this value is -1 by default, which means the initial allocation yields
9 info structs instead of 10 (though this has no bearing on functionality)

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:38:00 +00:00
Mike Blumenkrantz
1a9ba0aaa3 aux/tc: add a function to reset rp info
drivers should be maintaining a local copy of the rp info, and this
provides a consistent way to reset that info if a renderpass is ended
early

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:38:00 +00:00
Mike Blumenkrantz
4a5d3590d6 aux/tc: don't sync for get_sample_position
no drivers actually use the context for this, so a sync is pointless

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:38:00 +00:00
Mike Blumenkrantz
4f58507855 aux/tc: track the number of active queries
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:38:00 +00:00
Mike Blumenkrantz
0f4c3cb05c aux/tc: fix renderpass splitting on flush
it's expected that a driver won't immediately trigger a deferred flush
if a fence is present, so don't split the renderpass in this case since
that breaks everything

Fixes: 07017aa137 ("util/tc: implement renderpass tracking")

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:38:00 +00:00
Mike Blumenkrantz
454772c123 aux/tc: use a local 'deferred' variable in tc_flush()
no functional changes

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:38:00 +00:00
Mike Blumenkrantz
767ef6e02e aux/tc: flag late zs clears as partial clears
this ensures drivers can't optimize out a zs attachment that gets
a late clear

Fixes: 07017aa137 ("util/tc: implement renderpass tracking")

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:38:00 +00:00
Mike Blumenkrantz
4c359f785f zink: trigger oom flushes more aggressively from copy ops
this cuts down on needing to flush from set_fb or draw

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:38:00 +00:00
Mike Blumenkrantz
11b1ad9f3f zink: disable tc flush notify with rp optimizing
this is extremely broken and nonfunctional since it randomly flushes
mid-renderpass and triggers invalidations

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:38:00 +00:00
Mike Blumenkrantz
e3f0eaf5f9 zink: disable queries when flushing clears from set_fb
this otherwise has weird side effects, especially with rp optimizing enabled

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:38:00 +00:00
Mike Blumenkrantz
5d94887f08 zink: add and use a function for "safely" ending renderpasses
these are all points at which a renderpass should be split, so make sure
renderpass data isn't reset in any way here

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:37:59 +00:00
Mike Blumenkrantz
64b9cf5760 zink: reset tc fb info upon splitting a renderpass
not sure if this actually affects anything, but if a renderpass has
to be split for some reason, ensure subsequent renderpasses don't lose
data

also ensure that rp data isn't lost when triggering primgen clears and
delete a now-invalid assert

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:37:59 +00:00
Mike Blumenkrantz
73528dd3b7 zink: don't use/update tc rp info while blitting
this is illegal

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:37:59 +00:00
Mike Blumenkrantz
a858bcbb37 zink: add an assert to catch renderpass optimizing bugs
this should only trigger if tc has a bug

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:37:59 +00:00
Francisco Jerez
76b4255cd8 intel/fs: Fix register coalesce in presence of force_writemask_all copy source writes.
This fixes the behavior of register coalesce in cases where the source
of a copy is written elsewhere in the program by a force_writemask_all
instruction, which could cause the overwrite to be executed for an
inactive channel under non-uniform control flow, causing
can_coalesce_vars() to give incorrect results.  This has been reported
in cases like:

> while (true) {
>    x = imageSize(img);
>    if (non_uniform_condition()) {
>       y = x;
>       break;
>    }
> }
> use(y);

Currently the register coalesce pass would coalesce x and y in the
example above, which is invalid since in the example above imageSize()
is implemented as a force_writemask_all SEND message, whose result is
broadcast to all channels, so when a given channel executes 'y = x'
and breaks out of the loop, another divergent channel can execute a
subsequent iteration of the loop overwriting 'x' with a different
value, hence coalescing y and x into the same register changes the
behavior of the program.

Note that this is a regression introduced by commit a4b36cd3dd.  In
order to avoid the problem without reverting that patch, we prevent
register coalesce if there is an overwrite of the source with
force_writemask_all behavior inconsistent with the copy and this
occurs anywhere in the intersection of the live ranges of source and
destination, even if it occurs lexically before the copy, since it
might be physically executed after the copy under divergent loop
control flow.

Fixes: a4b36cd3dd ("intel/fs: Coalesce when the src live range is contained in the dst")
Reported-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21351>
2023-03-17 03:05:24 -07:00
Francisco Jerez
d4015bcb38 intel/fs: Fix copy propagation dataflow analysis in presence of force_writemask_all ACP overwrites.
This fixes the behavior of copy propagation in cases where either the
source or destination of an ACP is overwritten elsewhere in the
program by a force_writemask_all instruction, which could cause the
overwrite to be executed for an inactive channel under non-uniform
control flow, causing the current per-channel dataflow propagation to
give incorrect results.  This has been reported in cases like:

> while (true) {
>    x = imageSize(img);
>    if (non_uniform_condition()) {
>       y = x;
>       break;
>    }
> }
> use(y);

Currently the copy propagation pass would propagate copy 'y = x' into
'use(y)', which is invalid since in the example above imageSize() is
implemented as a force_writemask_all SEND message, whose result is
broadcast to all channels, so when a given channel executes 'y = x'
and breaks out of the loop, another divergent channel can execute a
subsequent iteration of the loop overwriting 'x' with a different
value, hence replacing 'y' with 'x' at 'use(y)' changes the behavior
of the program.

This patch extends the global dataflow analysis algorithm to determine
whether there is any control flow path from a given copy to an
overwrite of its source or destination which has force_writemask_all
behavior inconsistent with the copy, and in such case prevents copy
propagation for that ACP entry at any point of the program which can
be reached from the overwrite, even if the copy is statically
re-executed along all such control flow paths (as in the example
above), since the execution of the overwrite for a given channel i may
corrupt other channels j!=i inactive for the subsequently re-executed
copy.

Note that a simpler solution has been attempted which fully shuts down
copy propagation if such a force_writemask_all ACP overwrite is
present /anywhere/ in the program regardless of its location in the
control flow graph, however that led to large shader-db regressions in
some programs from shader-db (like a CS from Car Chase which would
emit 53% more instructions).  With this solution the only handful of
shaders that suffer instruction count regressions seem to be getting
misoptimized right now (e.g. some compute shaders from Deus Ex
Mankind).  This solution doesn't seem to affect the run-time of
shader-db significantly, it's less than 1% higher with the fix
applied.

Reported-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21351>
2023-03-17 03:05:20 -07:00
Francisco Jerez
1c1be23497 intel/fs: Track force_writemask_all behavior of copy propagation ACP entries.
force_writemask_all determines whether all channels of the copy are
actually valid, and may be required to be set for it to be propagated
safely in cases where the destination of the copy is used by another
force_writemask_all instruction, or when the copy occurs in a
divergent control flow block different from its use.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21351>
2023-03-17 03:05:18 -07:00
Kenneth Graunke
14f9f98dcb i965/vec4: Implement uclz in the vec4 backend
Commit 28311f9d02 moved ufind_msb lowering to NIR and started emitting
uclz.  Unfortunately, the vec4 backend never actually implemented uclz.

It's trivial to do.  Now it does.

Fixes: 28311f9d02 ("nir: intel/compiler: Move ufind_msb lowering to NIR")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21974>
2023-03-17 09:01:18 +00:00
Kenneth Graunke
e7ea2aa46c intel/fs: Make bld.F16TO32 actually emit F16TO32 not F32TO16
Ahem, "add builder helpers that work on Gfx7"...now might actually work.
Too much copy and paste...

Fixes: 966995d911 ("intel/fs: Add builder helpers for F32TO16/F16TO32 that work on Gfx7.x")
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21974>
2023-03-17 09:01:18 +00:00
Kenneth Graunke
84197bc0a4 intel/vec4: Retype texture/sampler indexes to UD
generate_tex() asserts that sampler_index.type == UD, but commit
83fd7a5ed1 removed the uint temporary, which caused us to see D at
some points.  Really, either should be fine, but let's just put the
UD retype back.  This fixes a ton of things in crocus.

Fixes: 83fd7a5ed1 ("intel: Use nir_lower_tex_options::lower_index_to_offset")
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21974>
2023-03-17 09:01:18 +00:00
Jesse Natalie
49885f87c3 nir: Propagate alignment when rematerializing cast derefs
Fixes: 878a8daca6 ("nir: Add alignment information to cast derefs")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21975>
2023-03-17 08:16:03 +00:00
Mike Blumenkrantz
9df68c633e zink: track tc fences better
tc fence lifetimes can exceed the lifetimes of their parent contexts,
which means they can be destroyed after mfence->fence has been destroyed

to avoid invalid memory access on a destroyed fence, store all the assigned
tc fences into an array on the real fence and then use that to unset fence
pointers on any outstanding tc fences

fixes flakiness in dEQP-EGL.functional.sharing.gles2.multithread.random_egl_sync.images.texsubimage2d.12

in caselist:
dEQP-EGL.functional.query_context.get_current_surface.rgba4444_pbuffer
dEQP-EGL.functional.create_surface.platform_window.rgba5551_depth_no_stencil
dEQP-EGL.functional.query_surface.simple.pbuffer.rgb888_depth_no_stencil
dEQP-EGL.functional.color_clears.multi_context.gles2.rgb888_pixmap
dEQP-EGL.functional.color_clears.multi_context.gles1_gles2.rgba8888_window
dEQP-EGL.functional.color_clears.multi_context.gles1_gles2_gles3.rgb888_window
dEQP-EGL.functional.render.multi_thread.gles2_gles3.rgba5551_pbuffer
dEQP-EGL.functional.sharing.gles2.multithread.random_egl_sync.buffers.buffersubdata.3
dEQP-EGL.functional.sharing.gles2.multithread.random_egl_sync.programs.link.6
dEQP-EGL.functional.sharing.gles2.multithread.random_egl_sync.images.texsubimage2d.12

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21843>
2023-03-17 07:58:10 +00:00
Giancarlo Devich
7edae456e2 d3d12: Track up to 16 contexts worth of batch references locally in bos
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21909>
2023-03-17 07:43:08 +00:00
Giancarlo Devich
70af7fd5e8 d3d12: Unroll shader variant selection loop
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21909>
2023-03-17 07:43:08 +00:00
Giancarlo Devich
777e6b43bc d3d12: Reduce gs variant key init cost; unnecessary validate gs calls
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21909>
2023-03-17 07:43:08 +00:00
Giancarlo Devich
9bbf5505f0 d3d12: Use short circuit in shader key compare; update key hash
Move common key compare to the final step; change to short circuit from
memcmp.

Update key hash to treat varying pointers as uint64.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21909>
2023-03-17 07:43:08 +00:00
Giancarlo Devich
32e058017d d3d12: Use context-level sampler_state array for filling shader keys
This significantly reduces the size of d3d12_shader_key

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21909>
2023-03-17 07:43:08 +00:00
Giancarlo Devich
7854f9283c d3d12: Don't unnecessarily recompute manual_depth_range
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21909>
2023-03-17 07:43:08 +00:00
Giancarlo Devich
8a3ac98524 d3d12: Track up to 16 contexts worth of pending barriers locally in bos
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21909>
2023-03-17 07:43:08 +00:00
Mike Blumenkrantz
d862d708e2 zink: use res->queue to auto-handle queue transitions back to gfx queue
much simpler

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21733>
2023-03-17 07:25:04 +00:00
Mike Blumenkrantz
d7b04c110b zink: remove redundant dmabuf_acquire setting
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21733>
2023-03-17 07:25:04 +00:00
Mike Blumenkrantz
2fd2133c9d zink: track current queue for resources
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21733>
2023-03-17 07:25:04 +00:00
David Heidelberg
f4a6993b1f ci/traces: disable nheko trace with zink since it flakes
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21976>
2023-03-17 05:51:07 +00:00
Sviatoslav Peleshko
1648e3b4b9 glsl: Fix codegen for constant ir_binop_{l,r}shift with mixed types
Fixes: 13106e10 ("glsl: Generate code for constant ir_binop_lshift and ir_binop_rshift expressions")

Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17787>
2023-03-17 05:00:22 +00:00
Mike Blumenkrantz
cf973fe299 zink: fix layer check for compressed format surface creation
this is a universal check, not a check based on mutable state

Fixes: 56108b411f ("zink: verify compressed format layer count when creating surfaces")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21881>
2023-03-17 01:25:32 +00:00
Timur Kristóf
a42c57dc01 aco: Always enable idxen for swizzled buffer access on GFX11.
This helps pass the mesh shader I/O tests.
Swizzled buffer addressing seems to be broken on GFX11
when the idxen bit is 0.

No Fossil DB changes on Rembrandt (GFX10.3).

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/21930>
2023-03-17 00:34:21 +00:00
Timur Kristóf
1f9e44c181 aco: Disable MUBUF/MTBUF offsets when they are zero.
Fossil DB stats on Rembrandt (GFX10.3):

Totals from 1264 (0.94% of 134920) affected shaders:
VGPRs: 69504 -> 69336 (-0.24%)
CodeSize: 6885468 -> 6886224 (+0.01%); split: -0.02%, +0.03%
MaxWaves: 24632 -> 24670 (+0.15%)
Instrs: 1287027 -> 1287209 (+0.01%); split: -0.04%, +0.05%
Latency: 6830411 -> 6831165 (+0.01%); split: -0.06%, +0.07%
InvThroughput: 1220643 -> 1220438 (-0.02%); split: -0.04%, +0.02%
VClause: 24737 -> 24751 (+0.06%); split: -0.25%, +0.30%
SClause: 42774 -> 42911 (+0.32%); split: -0.13%, +0.45%
Copies: 75408 -> 75600 (+0.25%); split: -0.62%, +0.88%
PreVGPRs: 60544 -> 59809 (-1.21%)

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/21930>
2023-03-17 00:34:21 +00:00
Timur Kristóf
40676da381 aco: Use zero for MUBUF/MTBUF when soffset is undefined.
No Fossil DB changes on Rembrandt (GFX10.3).

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/21930>
2023-03-17 00:34:21 +00:00
Timur Kristóf
b3933ffe60 aco: Don't add soffset to swizzled MUBUF base.
No Fossil DB changes on Rembrandt (GFX10.3).

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/21930>
2023-03-17 00:34:20 +00:00
Helen Koike
1d0cc57086 android/ci: raise error on script when not related to the tests
The cuttlefish-runner.sh script was failing before reaching the test
suite execution (which was not executing the complete test suite due to
the previous non-catched failures, and was erroneous passing) and we
were not catching that.
Add set -e so we can catch those.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21941>
2023-03-16 22:13:05 +00:00
Helen Koike
89432213ef android/ci: Fix call to adb
Call to adb should be made with ADB variable, following the pattern from
the script.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21941>
2023-03-16 22:13:05 +00:00
Helen Koike
cbe11f6f8d android/ci: fix removal of inexistent file
file libEGL_mesa.so doesn't exist and the rm command was failing,
replace by libGLES_mesa.so which exists.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21941>
2023-03-16 22:13:05 +00:00
Friedrich Vock
89590c1d84 radv: Add RT shader stage names for executable properties
Now that we use raygen shaders, we also need to support RT stages for
executable properties.

Fixes: f123d65e9f ("radv/rt: use prolog for raytracing shaders")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21960>
2023-03-16 21:28:03 +00:00
Yiwei Zhang
9678becbf9 Revert "zink/kopper: Add extra swapchain images for Venus"
This reverts commit 10f8240caf.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21963>
2023-03-16 20:56:53 +00:00
Asahi Lina
04387269dd asahi: Extend batch tracking for explicit sync
Now that we have stub sync support in the submission API, we can
implement the batch tracking changes required to support an explicit
sync world. This excludes the UAPI-specific bits (command decoding and
status parsing).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21620>
2023-03-16 20:42:01 +00:00
Asahi Lina
c41f10eb9e asahi: Make agx_flush_resource reallocate non-shareable resources
It's not legal to share a resource that isn't PIPE_BIND_SHARED, but
flush_resource needs to prepare a resource for potential sharing.
Let's allocate a new resource and blit it over when this happens.

See also:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13154

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21620>
2023-03-16 20:42:01 +00:00
Asahi Lina
e6b565699f asahi: Support importing sync objects on BO export
When a BO is exported, implicit sync convention requires that writers
signal a fence on the object when complete. We already do this for BOs
that are *already* exported, but it is possible for a BO to be written
to, then exported for the first time.

Add a field to agx_bo to keep track of the current writer syncobj
handle. On first export, we use this to import it into the DMA-BUF.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21620>
2023-03-16 20:42:01 +00:00
Alyssa Rosenzweig
c4aa7828b3 asahi: Use a dynarray for writers
We don't want a writer hash table with persistent pointers to resources, because
the resources could be freed without the hash table being updated (even though
the underlying BO will not be freed until it's ready). To avoid the reference
count hell, do away with the pointer hash table and instead use a flat dynarray
for mapping BO (handles) to writer (batch indices).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21620>
2023-03-16 20:42:01 +00:00
Tatsuyuki Ishi
0cde42a506 radv: Wait for shader uploads asynchronously.
This introduces tracking of the required semaphore values in pipelines,
which is then propagated to cmd_buffers on bind. Each queue also keeps
track the maximum count it has waited for, so that we can avoid the waiting
overhead once all the shaders are loaded and referenced.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16271>
2023-03-16 18:02:57 +00:00
Tatsuyuki Ishi
a8c5fd3b1b radv: Upload shaders to invisible VRAM on small BAR systems.
Following PAL's implementation, this patch avoids allocating shader code
buffers in BAR and use SDMA to upload them to invisible VRAM
directly.

For some games like HZD, shaders can take as much as 400MB, which exceeds
the non-resizable BAR size (256MB) and cause inconsistent spilling
behavior. The kernel will normally move these to invisible VRAM on its own,
but there are a few cases that it does not reliably happen. This patch does
the moving explicitly in the driver to ensure predictable results.

In this patch, we upload the shaders synchronously; so the shader will be
ready as soon as vkCreate*Pipeline returns. A following patch will make
this asynchronous and don't block until we see a use of the pipeline.

As a side effect, when SQTT is used we now store the shaders on a cacheable
buffer which would speed up writing the trace to the disk.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16271>
2023-03-16 18:02:57 +00:00
Tatsuyuki Ishi
3b258ae2d9 radv: Introduce sdma_copy_buffer for GFX7+.
Helper salvaged from radeonsi (before SDMA removal).

This will be used for driver internal submissions to DMA shaders from GTT
to invisible VRAM.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16271>
2023-03-16 18:02:56 +00:00
Tatsuyuki Ishi
d4fb3db748 radv: Use radeon_cmdbuf for sdma_copy_image.
For consistency with the sdma_copy_buffer helper that will be added next.

As a general justification, SDMA commands require little state tracking and
using radeon_cmdbuf makes it more suitable for driver internal use.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16271>
2023-03-16 18:02:56 +00:00
Jesse Natalie
25b1a11401 Revert "CI: Disable Windows runners"
This reverts commit 023d7e860e.

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21932>
2023-03-16 16:07:14 +00:00
Jesse Natalie
f8566533ea radv: Fix returning an expression from a void function
Fixes: d5de56bf ("radv: add RT shader args")
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21932>
2023-03-16 16:07:14 +00:00
Jesse Natalie
5c4c9fd454 vulkan/wsi: Fix Windows build
The headless path doesn't build for Windows (yet, anyway).

Fixes: d4a2c0fc ("vulkan/wsi: add a headless swapchain implementation/option")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21932>
2023-03-16 16:07:14 +00:00
Anuj Phogat
a455f80395 iris: implement TES distribution mode WA 22012785325
Set TEDMODE_RR_STRICT when TEEnable is set.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-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/21899>
2023-03-16 14:42:53 +00:00
Anuj Phogat
b4b43aa912 anv: implement TES distribution mode WA 22012785325
Set TEDMODE_RR_STRICT when TEEnable is set.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-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/21899>
2023-03-16 14:42:53 +00:00
Eric Engestrom
cb7e9a6cfb asahi: replace copies of .clang-format with symlinks
Avoid all the issues of having to keep them in sync, and few-enough
people (read: probably no-one ever) will be working on the asahi driver
from a Windows machine, so symlinks can be relied upon, especially for
something optional like automatic code formatting.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21951>
2023-03-16 14:28:20 +00:00
Tatsuyuki Ishi
9faaff4561 radv/rt: Don't upload the prolog twice.
radv_shader_create already calls radv_shader_binary_upload.

Fixes: 4b92a53285 ("radv: add radv_create_rt_prolog()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21945>
2023-03-16 12:27:21 +00:00
Eric Engestrom
8f6126e21a v3dv/ci: fix test name (,Fail is not part of the test name)
Fixes: a0bf0adade ("ci/broadcom: move rare failure to the flakes")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21954>
2023-03-16 12:03:14 +00:00
Martin Roukala (né Peres)
77c3df53ae zink/ci: update the radv expectations
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21873>
2023-03-16 11:31:04 +00:00
Martin Roukala (né Peres)
c69e2849a6 zink/ci: increase the parallelism of zink-radv-vangogh-valve
It current takes 17 minutes to run this job, which is above the 15
minutes target for Mesa CI. Let's increase the parallelism to reduce
exec time to closer to 13 minutes.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21873>
2023-03-16 11:31:04 +00:00
Martin Roukala (né Peres)
928aab57a3 radv/ci: reduce the parallelism for vkcts-vangogh
We are about to enable pre-merge testing for radv-zink on vangogh,
which would mean the steam decks would be used for the following jobs:

 * Mesa pre-merge CI:
  * zink: 3 (~12 minutes)
 * Mesa Post-merge CI:
   * vkcts: 4 (~30 minutes)
   * vkd3d: 1 (~5 minutes)
 * DXVK CI: 1 (takes ~4 hours)

This means we could have 9 jobs running at the same time on steam
decks, despite only having 6 available. By reducing the number of decks
allocated for VKCTS runs from 4 to 2, we get closer to the actual
availability, and since vkd3d is so short + DXVK CI runs so
infrequently, we should never have to wait for a deck for too long!

Unfortunately, with the change of parallelism, a known flake started
failing more consistently, so I added it to the flakes list.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21873>
2023-03-16 11:31:03 +00:00
Erik Faye-Lund
5c5c114fa2 meson: correct typo in comment
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21868>
2023-03-16 10:31:04 +00:00
Gert Wollny
3ddbf64e41 virgl: Lower binding start into buffer indices
This requires that we limit the number of max combinded SSBOs to 31,
otherwisewe shaders that use SSBO binding points with higher values
will break on the host.

Fixes CTS:
  KHR-GL43.shader_storage_buffer_object.basic-atomic-case1
  KHR-GL43.shader_storage_buffer_object.basic-atomic-case2
  KHR-GL43.shader_storage_buffer_object.advanced-indirectAddressing-case2
  KHR-GL43.shader_storage_buffer_object.advanced-usage-case1
  KHR-GL43.shader_storage_buffer_object.advanced-usage-sync
  KHR-GL43.shader_storage_buffer_object.advanced-matrix

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21586>
2023-03-16 09:30:00 +00:00
Gert Wollny
99416624e5 ntt: add option to lower SSBO bindings to buffer index
When a shader uses SSBOs in various shader stages, then we have to track
the binding locations in order to be able to properly bind these SSBOs.

Therefore add a flag that enables adding the start index of the bindings to
the SSBO index.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21586>
2023-03-16 09:30:00 +00:00
Gert Wollny
1247b23f28 virgl: Don't try to do re-alloc or readback by transfer for blob resources
Blob resources are mapped directly, no need to copy data around, and
in any case, neither the resource nor the transfer info will have an
IOV attached to it, so the transfer would result error out on the host
anyway.

In addition, blob resources should not use re-allocation.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21586>
2023-03-16 09:30:00 +00:00
Gert Wollny
831e7818aa virgl: Enable AMD_vertex_shader_(layer|viewport_index) when host supports it
This increase the number of cases when the texture upload from buffer
can use the PBO upload code path.

v2: Fix logic combination (Corentin)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21586>
2023-03-16 09:30:00 +00:00
Constantine Shablya
d53aba56db anv: use vk_get_physical_device_features
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21754>
2023-03-16 08:23:29 +00:00
Alyssa Rosenzweig
ded810ded5 panvk: Use vk_get_physical_device_features
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21754>
2023-03-16 08:23:28 +00:00
Constantine Shablya
723825f5c7 vulkan: use vk_features for vk_device::enabled_features
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21754>
2023-03-16 08:23:28 +00:00
Constantine Shablya
c7300a6a3b vulkan: add hepler for vkGetPhysicalDeviceFeatures2
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21754>
2023-03-16 08:23:28 +00:00
Constantine Shablya
efaf3fd5fc vulkan: delete trailing namespace
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21754>
2023-03-16 08:23:28 +00:00
Constantine Shablya
cd35ab9570 vulkan: tidy up vk_physical_device_features
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21754>
2023-03-16 08:23:28 +00:00
Constantine Shablya
b0b3b9e8b1 vulkan: relocate rmv to its correct home
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21754>
2023-03-16 08:23:28 +00:00
Qiang Yu
51e725df29 radeonsi: monolithic TCS emit tessfactor in nir directly
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/21437>
2023-03-16 04:33:31 +00:00
Qiang Yu
3f5d42a28a radeonsi: lower nir_load_ring_tess_factors_offset_amd
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/21437>
2023-03-16 04:33:30 +00:00
Qiang Yu
719366c2b2 ac/llvm,radeonsi: lower nir_load_ring_tess_factors_amd
No one implement this intrinsic in llvm, so remove the
llvm entry too.

This will be used in TCS nir tess factor write.

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/21437>
2023-03-16 04:33:30 +00:00
Qiang Yu
99828e0390 ac/nir: handle tess factor output missing case
tcs_tess_lvl_(in|out)_loc may be not set if user miss tess
factor output.

Acked-by: Marek Olšák <marek.olsak@amd.com>
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/21437>
2023-03-16 04:33:30 +00:00
Qiang Yu
700e24941c ac/nir: init tess factor location with IO remap
Radeonsi is going to use nir tess factor write, so need to
remap tess factor location.

RADV set tess factor driver location to be 0 and 1 in
get_linked_variable_location(). While radeonsi also set them
to be 0 and 1 in st->map_io aka. si_shader_io_get_unique_index_patch().

We could just set them to be 0 and 1 at the beginning of
ac_nir_lower_hs_outputs_to_mem(), but in order to keep the
location map at the same place, we still do this in
lower_hs_output_store().

Acked-by: Marek Olšák <marek.olsak@amd.com>
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/21437>
2023-03-16 04:33:30 +00:00
Qiang Yu
c06329eb3f ac/nir: tcs write tess factor support pass by reg
For radeonsi usage.

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/21437>
2023-03-16 04:33:30 +00:00
Qiang Yu
e070a9e8d0 ac/nir: move store_var_components to common place
It will be shared by other nir lowering too.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
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/21437>
2023-03-16 04:33:30 +00:00
Alyssa Rosenzweig
f2617944bf panfrost: Don't round up Midgard polygon list BOs
Rounding up the polygon list BO can waste large amounts of memory. In a common
case I observed, it rounded up 11MB to 16MB, wasting 5MB. That adds up quickly
across processes, especially on the 2GB machines.

This only applies to Midgard. On Bifrost and newer, the driver does not
explicitly allocate this data structure. Cc stable because this rounding is
incorrect and the increase in RAM usage can cause real problems (especially
given how slow the shrinker is).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21831>
2023-03-16 04:13:46 +00:00
Timothy Arceri
174d6e6a54 glsl: allow 64-bit integer on RHS of shift
Fixes: 9ba9a7f854 ("glsl: Add 64-bit integer support to some operations.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6862

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21919>
2023-03-16 02:26:30 +00:00
Daniel Schürmann
39c828cb9f aco: remove aco::rt_stack variable
Since we initialize scratch in the RT proglog,
there is no need for this variable anymore.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:30 +00:00
Daniel Schürmann
f123d65e9f radv/rt: use prolog for raytracing shaders
Co-authored-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:30 +00:00
Friedrich Vock
bea022d1f6 radv/rt: Add shader config combination/postprocessing utils
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:30 +00:00
Friedrich Vock
0569b350ed radv: Emit RT shader VA user SGPR
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:30 +00:00
Daniel Schürmann
a16df842a6 radv: compile rt_prolog
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:30 +00:00
Daniel Schürmann
4b92a53285 radv: add radv_create_rt_prolog()
Co-authored-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:30 +00:00
Daniel Schürmann
6446b79168 aco: implement select_rt_prolog()
Co-authored-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:30 +00:00
Daniel Schürmann
7d35bf24f6 aco: create hw_init_scratch() function for p_init_scratch lowering
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:30 +00:00
Daniel Schürmann
2fee99a36c aco: implement load_ray_launch_{id|size}
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:30 +00:00
Daniel Schürmann
c7c68e1193 aco: move rt_dynamic_callable_stack_base_amd to VGPR
In future, we will use a VGPR arg for that between RT stages.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:30 +00:00
Daniel Schürmann
1f01a86b36 aco: don't set private_segment_buffer/scratch_offset on GFX9+
It is unused. Also don't initialize scratch in raytracing stages as it gets
initialized in the prolog shader.

Co-authored-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:30 +00:00
Daniel Schürmann
a33b9d43d8 aco: add RT stage enums
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:29 +00:00
Daniel Schürmann
c38b8678c9 radv: add RT shader handling to radv_postprocess_config
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:29 +00:00
Daniel Schürmann
3f03eebf04 radv: add RT stages to radv_get_shader_name()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:29 +00:00
Daniel Schürmann
650f386bdd radv: handle RT stages in radv_nir_shader_info_pass()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:29 +00:00
Daniel Schürmann
d5de56bf59 radv: add RT shader args
Co-authored-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:29 +00:00
Daniel Schürmann
5ede3b1c6b mesa: add gl_shader_stage_is_rt()
to indicate raytracing shader stages.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:29 +00:00
Rob Clark
b78fc0ae48 driconf: Work around incorrect GI discard/invalidate
Genshin Impact does a depth+stencil invalidate (or discard, not sure
which entrypoint they are using) and then proceeds to do draws with
depth test enabled.  For IMRs (or freedreno in sysmem mode) this is no
problem.  But for tilers that use this as a hint that they can skip the
z/s tile load, it is.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Mike Blumenkrantz <michael.blumenkrantz@gmail.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21916>
2023-03-16 00:56:37 +00:00
Rob Clark
a66c62420e driconf: Add ignore_discard_framebuffer option
Some apps use glDiscardFramebuffer()/glInvalidateFramebuffer() when they
only kidding.  Add a knob to disable that.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Mike Blumenkrantz <michael.blumenkrantz@gmail.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21916>
2023-03-16 00:56:37 +00:00
Rob Clark
976d964a35 mesa: Rework discard_framebuffer()
Decouple the logic turning API attachment enums into gl_buffer_index.
This will make it easier to re-use discard_attachments() internally (See
!21910)

Signed-off-by: Rob Clark <robdclark@chromium.org>
Mike Blumenkrantz <michael.blumenkrantz@gmail.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21916>
2023-03-16 00:56:37 +00:00
Lynne
f5e5ec180c aco_validate: allow for wave32 in p_dual_src_export_gfx11
Fixes RADV_PERFTEST=pswave32

Fixes: bb90d29660 ("aco: add p_dual_src_export_gfx11 for dual source blending on GFX11")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21934>
2023-03-15 23:55:41 +00:00
Mark Janes
a2e5e7daa0 intel: use generated helpers for Wa_1409433168/Wa_16011107343
HSD 1306463417 is a hardware defect.  The originating software
workaround for the issue is Wa_1409433168.  Convert all references to
the software workaround number, and use generated helpers instead of
GFX comparisons.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21914>
2023-03-15 23:31:08 +00:00
Emma Anholt
4466098324 ci/turnip: Move some more of the 1.3.5 new xfails under links.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21915>
2023-03-15 23:07:21 +00:00
Emma Anholt
5e3d36199f ci/turnip: Disable dEQP-VK.image.queue_transfer.* for now.
We're waiting on the upstream CTS fix to land.  Until then, quiet the spam
in #freedreno-ci to see if we have any other flakes we need to be managing
right now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21915>
2023-03-15 23:07:21 +00:00
Emma Anholt
45dc05d455 ci/turnip: Clear out stale xfails.
These were all fixed in the CTS, but missed from removal due to fractional runs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21915>
2023-03-15 23:07:21 +00:00
Emma Anholt
78d4a82d30 turnip: Don't push inline uniform buffer contents outside constlen.
This would apparently lead to trying to load from this inline uniform
buffer in later submits.

Fixes: 37cde2c634 ("tu: Rewrite inline uniform implementation")
Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8219
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21915>
2023-03-15 23:07:21 +00:00
Mike Blumenkrantz
f99eab23ad aux/trace: delete GALLIUM_TRACE_NIR log message
this is not only annoying, it breaks trace xml output

cc: mesa-stable

Acked-by: Simon Zeni <simon@bl4ckb0ne.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21609>
2023-03-15 20:43:52 +00:00
José Roberto de Souza
eec5ddd0ed anv: Handle external objects allocation in Xe
External(imported or exported) objects needs to have vm_id set to 0.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21885>
2023-03-15 18:17:11 +00:00
José Roberto de Souza
b2d82c25fb anv: Properly alloc buffers that will be promoted to framebuffer in Xe KMD
Xe KMD does a special caching handling for buffers that will be
scanout to display, so that is why it needs a flag set during
allocation.

Checking if VK_STRUCTURE_TYPE_WSI_MEMORY_ALLOCATE_INFO_MESA
is available in AllocateMemory() and marking the buffer as scanout.

All WSI code paths but one sets
VK_STRUCTURE_TYPE_WSI_MEMORY_ALLOCATE_INFO_MESA.
The only one that doesn't requires that WSI is initialize with
wsi_device_options.sw_device = true to be executed, what is not the
case for ANV.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21885>
2023-03-15 18:17:11 +00:00
José Roberto de Souza
a311c031f6 anv: Implement Xe version of anv_physical_device_get_parameters()
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21885>
2023-03-15 18:17:11 +00:00
antonino
1538a28803 zink: fix final_hash update in zink_gfx_program_update
The logic that updates `ctx->gfx_pipeline_state.final_hash` assumed that
the program is replaced. It is supposed to xor `final_hash` with the
hash first and then with the new hash however when the program is
updated it end up xor-ing the new hash twice so it does nothing.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fixes: 15450d2c2e ("zink: incrementally hash all pipeline component hashes")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21925>
2023-03-15 18:00:20 +00:00
SoroushIMG
78198d634d zink: Add driver name and API version to renderer name
Having driver name in the renderer will be useful to differentiate
between open source and proprietary drivers as they can have different
feature sets/quirks.

Vulkan API version is also added to the name to match up with ANGLE.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21922>
2023-03-15 17:40:16 +00:00
Mike Blumenkrantz
81a4163375 zink: fix copy box merging adjacency
these cases need to increase the box size, not just adjust the offset

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21921>
2023-03-15 16:42:19 +00:00
Mike Blumenkrantz
32f74c4db5 zink: fix copy box iteration when adding
need to use the iterator, not the base pointer

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21921>
2023-03-15 16:42:19 +00:00
Timur Kristóf
6185e4f2ff aco, radv: Remove VS IO information from ACO.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16805>
2023-03-15 14:54:28 +00:00
Timur Kristóf
819ba6f7ae ac/llvm: Remove unused function ac_build_struct_tbuffer_load.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16805>
2023-03-15 14:54:28 +00:00
Timur Kristóf
2f78700f89 radv: Remove VS inputs code from LLVM backend.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16805>
2023-03-15 14:54:28 +00:00
Timur Kristóf
3b0394d063 aco: Rename visit_load_input to visit_load_fs_input.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16805>
2023-03-15 14:54:28 +00:00
Timur Kristóf
c602092033 aco: Remove VS inputs from visit_load_input.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16805>
2023-03-15 14:54:28 +00:00
Timur Kristóf
27c8131978 radv: Apply swizzle and alpha adjust in radv_nir_lower_vs_inputs.
Deal with VS input related things in a single pass instead of
having two different passes.

Fossil DB stats on Rembrandt (GFX10.3):

Totals from 174 (0.13% of 134913) affected shaders:
VGPRs: 7736 -> 7520 (-2.79%)
CodeSize: 354004 -> 353604 (-0.11%); split: -0.17%, +0.06%
MaxWaves: 4196 -> 4248 (+1.24%)
Instrs: 65228 -> 65139 (-0.14%); split: -0.19%, +0.06%
Latency: 265823 -> 265728 (-0.04%); split: -0.12%, +0.08%
InvThroughput: 84629 -> 84644 (+0.02%); split: -0.08%, +0.10%
VClause: 1618 -> 1606 (-0.74%); split: -0.93%, +0.19%
SClause: 1382 -> 1379 (-0.22%); split: -0.36%, +0.14%
Copies: 5586 -> 5566 (-0.36%); split: -0.55%, +0.20%
PreSGPRs: 4994 -> 5037 (+0.86%); split: -0.10%, +0.96%
PreVGPRs: 4948 -> 4955 (+0.14%); split: -0.04%, +0.18%

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16805>
2023-03-15 14:54:27 +00:00
Timur Kristóf
a46acdbc3f radv: Lower non-dynamic VS inputs in NIR.
Add a new RADV specific NIR pass which lowers VS input
loads to AMD specific buffer load instructions.
We do this because we want to remove the RADV specific
VS input handling from the shader compiler back-ends.

Fossil DB stats on Rembrandt (GFX10.3):

Totals from 32507 (24.09% of 134913) affected shaders:
VGPRs: 1245512 -> 1245344 (-0.01%); split: -0.35%, +0.34%
SpillSGPRs: 1068 -> 1102 (+3.18%)
CodeSize: 90333192 -> 90327232 (-0.01%); split: -0.07%, +0.06%
MaxWaves: 881816 -> 881388 (-0.05%); split: +0.23%, -0.28%
Instrs: 17264710 -> 17264562 (-0.00%); split: -0.09%, +0.09%
Latency: 87300501 -> 86586480 (-0.82%); split: -1.07%, +0.25%
InvThroughput: 13700046 -> 13685931 (-0.10%); split: -0.20%, +0.10%
VClause: 361520 -> 361301 (-0.06%); split: -1.32%, +1.26%
SClause: 441018 -> 441505 (+0.11%); split: -0.54%, +0.65%
Copies: 1371477 -> 1373838 (+0.17%); split: -0.57%, +0.75%
Branches: 496639 -> 496611 (-0.01%); split: -0.01%, +0.00%
PreSGPRs: 1122956 -> 1122663 (-0.03%); split: -0.09%, +0.06%
PreVGPRs: 976051 -> 995717 (+2.01%); split: -0.12%, +2.14%

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16805>
2023-03-15 14:54:27 +00:00
Timur Kristóf
22ca8c8561 ac/llvm: Implement typed buffer load intrinsic.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16805>
2023-03-15 14:54:27 +00:00
Timur Kristóf
477cb943f6 aco: Implement load_typed_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/16805>
2023-03-15 14:54:27 +00:00
Timur Kristóf
022e55557b nir: Add load_typed_buffer_amd intrinsic.
This new intrinsic maps to the MTBUF instruction format on AMD GPUs
and represents a typed buffer load in NIR.

Also add an unsigned upper bound for the new intrinsic.
Code for that ported from aco_instruction_selection_setup.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16805>
2023-03-15 14:54:27 +00:00
Timur Kristóf
7d63d8882a aco: Remove vtx_binding from MUBUF/MTBUF instructions.
We haven't measured any noteworthy perf improvement
from these, and they are difficult to port to NIR,
so remove them before the NIR based VS input lowering
in order to make it easier to bisect and analyze stats.

Fossil DB stats on Rembrandt (GFX10.3):

Totals from 21750 (16.12% of 134913) affected shaders:
VGPRs: 868512 -> 868664 (+0.02%); split: -0.00%, +0.02%
CodeSize: 64406804 -> 64397572 (-0.01%); split: -0.08%, +0.07%
MaxWaves: 567904 -> 567888 (-0.00%); split: +0.00%, -0.00%
Instrs: 12327212 -> 12324851 (-0.02%); split: -0.10%, +0.08%
Latency: 61367324 -> 61371204 (+0.01%); split: -0.04%, +0.05%
InvThroughput: 9687734 -> 9686000 (-0.02%); split: -0.03%, +0.01%
VClause: 248207 -> 303449 (+22.26%); split: -0.02%, +22.28%
SClause: 314942 -> 315564 (+0.20%); split: -0.09%, +0.29%
Copies: 921581 -> 921820 (+0.03%); split: -0.16%, +0.19%
Branches: 341964 -> 341967 (+0.00%); split: -0.00%, +0.00%

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/16805>
2023-03-15 14:54:27 +00:00
Marek Olšák
999b956ebc radeonsi: correct an assertion if we get a display list with no vertex buffers
It's possible to get a display list with no vertex buffers if the linker
eliminates all VS inputs or if the list was built with glArrayElement with
no enabled attribs.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21860>
2023-03-15 13:16:34 +00:00
Marek Olšák
9fad7ca659 radeonsi: don't use fp16_rtz for FP formats in the compute blit
It doesn't change the test results.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21860>
2023-03-15 13:16:34 +00:00
Marek Olšák
bcdde99675 radeonsi: don't convert to fp16 in the compute blit if not testing
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21860>
2023-03-15 13:16:34 +00:00
Marek Olšák
e7d7fc6740 radeonsi: fix AMD_TEST=computeblit being rejected on gfx < 11
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21860>
2023-03-15 13:16:34 +00:00
Marek Olšák
f67b41e53b radeonsi: don't print the base non-view texture format for AMD_TEST=computeblit
it's confusing in the output and it affects nothing

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21860>
2023-03-15 13:16:34 +00:00
Marek Olšák
f8070b3dc2 radeonsi: add AMD_DEBUG=nowcstream to enable caching for stream_uploader
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21860>
2023-03-15 13:16:34 +00:00
Marek Olšák
e32700c503 radeonsi: rework MSAA resolve averaging to exploit instruction-level parallelism
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21860>
2023-03-15 13:16:34 +00:00
Marek Olšák
1d978917a0 radeonsi: remove duplicated gfx11 check in si_msaa_resolve_blit_via_CB
The function really does that twice. You'll find the same code a few lines
above this change.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21860>
2023-03-15 13:16:34 +00:00
Marek Olšák
d76bb15c51 radeonsi: replace nonir,noir,noasm,preoptir options with new reworked options
New options depending on what you want to print:
- initnir  = initial NIR of shader CSOs
- nir      = final NIR of variants after all lowering
- initllvm = LLVM IR before optimizations
- llvm     = final LLVM IR
- asm      = asm

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21860>
2023-03-15 13:16:34 +00:00
Marek Olšák
c3df9973a3 radeonsi: dump shader stats only if dumping asm shaders
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21860>
2023-03-15 13:16:34 +00:00
Marek Olšák
c2f3339783 radeonsi: remove unused TCS/TES SGPR fields
We stopped using them when we switched to ac_nir_lower_hs_outputs_to_mem.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21860>
2023-03-15 13:16:34 +00:00
Yogesh Mohan Marimuthu
2b04d6cada radv: set RADEON_SURF_NO_TEXTURE flag in radv_get_surface_flags()
In vkCreateImage() if block comrpessed format and VK_IMAGE_TILING_LINEAR is
used, then the app crashes in vega gpu.

This is because addrlib does not support BC + linear as from function
ValidateSwModeParams(). From Marek Olšák the addrlib behaviour is correct.

In pal driver, flags.texture is not set in DetermineSurfaceFlags() function
if BC + linear. pal driver does it because it is expected that the
BC + linear image is only used as transfer resource.

This patch sets RADEON_SURF_NO_TEXTURE flag if usage is not
VK_IMAGE_USAGE_SAMPLED_BIT and and VK_IMAGE_USAGE_STORAGE_BIT.
flags.texture flag is not set if RADEON_SURF_NO_TEXTURE and this fixes
the crash.

v1: set NO_TEXTURE if not SAMPLED or STORAGE (Marek Olšák)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21422>
2023-03-15 12:25:33 +00:00
Yogesh Mohan Marimuthu
de0885cdb8 amd/surface: add RADEON_SURF_NO_TEXTURE flag
Block compressed + linear format is not supported in addrlib. But these
surface can be used as transfer resource. RADEON_SURF_NO_TEXTURE flag
indicates not to set flags.texture flag in gfx9_compute_surface().

This will help to fix the vkCreateImage() crash where block
compressed + linear format image is requested.

v2: combine RADEON_SURF_NO_TEXTURE to below line (Marek Olšák)
v1: add RADEON_SURF_NO_TEXTURE flag (Marek Olšák)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21422>
2023-03-15 12:25:33 +00:00
Rohan Garg
becc1c5615 anv: break out of the loop when the first color attachment is found
Fixes: 2bd304bc ("anv: Skip the RT flush when doing depth-only rendering")
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/21903>
2023-03-15 10:52:50 +00:00
Marek Olšák
3bc374ca93 vbo: fix current attribs not updating gallium vertex elements
An initial workaround that helped discover this was written by:
Illia Polishchuk illia.a.polishchuk@globallogic.com

Closes: #8440
Fixes: a18b9d07 ("st/mesa: optimize uploading zero-stride vertex attribs")

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21805>
2023-03-15 10:04:50 +00:00
Alyssa Rosenzweig
e6f9444567 asahi: Fix occlusion query lifetime
Theoretical lifetime issue, now easy to hit with the batch sync changes. Fixes
memory badness.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21857>
2023-03-15 08:46:09 +00:00
Emma Anholt
a74d2ef17d ci/iris: Add skips for slow tests on APL.
These get reported as flakes for timing out before passing when the shader
cache is hot.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21879>
2023-03-15 08:15:37 +00:00
Emma Anholt
e61b423074 ci/turnip: Extend a630 vk full timeout to 3 hours.
With the CTS coverage and tu featureset extending, these jobs have been
reliably timing out for a while.  I've updated the xfails based on a
single run, we'll see how that goes in the upcoming nightlies.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21879>
2023-03-15 08:15:37 +00:00
Emma Anholt
343426b95c ci/zink: Update TGL xfails/flakes based on the last nightly pipelines.
The 2f8073f87c fix changed some results, qbo
changed a week or so ago, and spec@ext_texture_array@compressed
texsubimage pbo has been crashing for a long time.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21879>
2023-03-15 08:15:36 +00:00
Patrick Lerda
aba16defa8 radeonsi: fix memory leak related to ureg_get_tokens()
Indeed, ureg_get_tokens() returns an allocated string that should be
freed using ureg_free_tokens().

For instance, with "piglit/bin/arb_shader_image_load_store-invalid -auto -fbo"
Direct leak of 768 byte(s) in 2 object(s) allocated from:
    #0 0x7fa819a78b48 in __interceptor_realloc (/usr/lib64/libasan.so.6+0xb1b48)
    #1 0x7fa80e189e04 in tokens_expand ../src/gallium/auxiliary/tgsi/tgsi_ureg.c:239
    #2 0x7fa80e189e04 in get_tokens ../src/gallium/auxiliary/tgsi/tgsi_ureg.c:262
    #3 0x7fa80e191f6e in copy_instructions ../src/gallium/auxiliary/tgsi/tgsi_ureg.c:2079
    #4 0x7fa80e191f6e in ureg_finalize ../src/gallium/auxiliary/tgsi/tgsi_ureg.c:2129
    #5 0x7fa80e19447b in ureg_get_tokens ../src/gallium/auxiliary/tgsi/tgsi_ureg.c:2206
    #6 0x7fa80ec68b91 in si_create_fmask_expand_cs ../src/gallium/drivers/radeonsi/si_shaderlib_tgsi.c:564

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21871>
2023-03-15 06:41:28 +00:00
Dave Airlie
040dc89b95 radv/trace: don't attempt to emit trace on non-graphics/compute queues
This will just break on video queues

Fixes: 9477f117f4 ("radv/video: add initial frameworking.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21671>
2023-03-15 05:08:49 +00:00
Dave Airlie
17d19a3c07 radv/video: fix h265 decoding sizes.
Fixes the misrendering/hangs on hevc content.

Fixes: 6c3c242361 ("radv/video: add h265 decode UVD support")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21671>
2023-03-15 05:08:49 +00:00
Dave Airlie
67a606c611 radv/video: fix used for reference flags.
These weren't getting programmed properly for interlaced videos

Fixes: 3e2c768aa8 ("radv/vcn: enable dynamic dpb tier 2 for h264/h265 on navi21+")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21671>
2023-03-15 05:08:49 +00:00
Dave Airlie
30ccf31aae radv/video: fix h264 frame heights when field images are in use
This was breaking MBAFF decoding.

Fixes: 8a29291dbe ("radv/video: add h264 support for uvd")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21671>
2023-03-15 05:08:49 +00:00
Emma Anholt
761bbb2c6f ci: Update trace expectations for GLSL constant prop removal.
Somewhere along the way there were minor pixel value changes.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21751>
2023-03-15 03:29:19 +00:00
Emma Anholt
e395e57f07 glsl: Delete constant-variables pass.
Now that we don't do GLSL IR constant propagation or constant folding, we
can leave constant variable detection and handling to NIR.  This also
avoids some OOB array access in GLSL IR in a piglit test!

Freedreno stats again look like noise:

total instructions in shared programs: 2718412 -> 2718746 (0.01%)
instructions in affected programs: 80497 -> 80831 (0.41%)
total last-baryf in shared programs: 110015 -> 110510 (0.45%)
last-baryf in affected programs: 35263 -> 35758 (1.40%)
total full in shared programs: 189486 -> 189480 (<.01%)
full in affected programs: 52 -> 46 (-11.54%)
total constlen in shared programs: 494540 -> 494496 (<.01%)
constlen in affected programs: 452 -> 408 (-9.73%)
total sstall in shared programs: 198297 -> 197928 (-0.19%)
sstall in affected programs: 3691 -> 3322 (-10.00%)
total systall in shared programs: 432150 -> 431799 (-0.08%)
systall in affected programs: 6070 -> 5719 (-5.78%)
total waves in shared programs: 435098 -> 435110 (<.01%)
waves in affected programs: 92 -> 104 (13.04%)

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21751>
2023-03-15 03:29:19 +00:00
Emma Anholt
329ab85a89 glsl: Delete constant folding pass.
NIR is happy to take care of constant folding for us, and it's easier to
do in SSA.

This required adjusting of lower_precision unit tests to have un-folded
constants.

freedreno results look like noise.  Some excerpts:

total instructions in shared programs: 2718343 -> 2718412 (<.01%)
instructions in affected programs: 6847 -> 6916 (1.01%)
total last-baryf in shared programs: 109992 -> 110015 (0.02%)
last-baryf in affected programs: 117 -> 140 (19.66%)
total sstall in shared programs: 198312 -> 198297 (<.01%)
sstall in affected programs: 148 -> 133 (-10.14%)
total systall in shared programs: 432163 -> 432150 (<.01%)
systall in affected programs: 1016 -> 1003 (-1.28%)

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21751>
2023-03-15 03:29:19 +00:00
Emma Anholt
7f39c9f24e glsl: Delete constant propagation pass.
freedreno results look like noise.  Excerpts:

total instructions in shared programs: 2718355 -> 2718343 (<.01%)
instructions in affected programs: 2001 -> 1989 (-0.60%)
total last-baryf in shared programs: 109960 -> 109992 (0.03%)
last-baryf in affected programs: 789 -> 821 (4.06%)
total sstall in shared programs: 198273 -> 198312 (0.02%)
sstall in affected programs: 140 -> 179 (27.86%)
total systall in shared programs: 432224 -> 432163 (-0.01%)
systall in affected programs: 241 -> 180 (-25.31%)

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21751>
2023-03-15 03:29:19 +00:00
Emma Anholt
470214cb82 glsl_to_nir: Use a variable's constant_value if it wasn't const-propped out.
glsl has been constant-propagating out references to ir->constant_value
(the value of a variable declared as const), but we can get rid of that
whole pass if we just have glsl-to-nir hand the constant propagating
problem off to NIR.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21751>
2023-03-15 03:29:19 +00:00
Emma Anholt
dccbecbef5 glsl/nir: Include early glsl-to-nir output in NIR_DEBUG=print.
These passes were missing the macros to handle debug output and extra
validation.  But also, for working on GLSL, it's nice to see the raw
output of glsl-to-nir before you move on.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21751>
2023-03-15 03:29:19 +00:00
José Roberto de Souza
a10388224d iris: Move iris_bufmgr_init_global_vm() to i915/iris_bufmgr.c and prepare for Xe KMD
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21887>
2023-03-15 02:05:58 +00:00
José Roberto de Souza
631756db56 iris: Drop usage of i915 EXEC_OBJECT_WRITE
The whole usage of this flag is to call iris_use_pinned_bo() with
writable argument, for that we don't need any i915_drm.h specific type.
IRIS_BLORP_RELOC_FLAGS_EXEC_OBJECT_WRITE could have any other value but
keeping the same as i915_drm.h.

With this we can drop 2 i915_drm.h imports from generic Iris code.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21887>
2023-03-15 02:05:58 +00:00
José Roberto de Souza
660877cf38 iris: Drop I915_EXEC_FENCE types
Those are i915_drm.h specific types and should not be in code paths
shared by i915 and Xe KMD.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21887>
2023-03-15 02:05:58 +00:00
Mike Blumenkrantz
747c3ddb9d glthread: align small buffer uploads to 4 bytes
some apps (e.g., supertuxkart) use a ton of 4 byte subdata calls, and
this halves their memory consumption

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21875>
2023-03-15 01:22:12 +00:00
Mohamed Ahmed
5ada09412f anv: remove GetBufferMemoryRequirements2()
Signed-off-by: Mohamed Ahmed <mohamedahmedegypt2001@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21898>
2023-03-15 00:30:35 +00:00
Mohamed Ahmed
2649ee0724 vulkan/runtime: implement vkGetBufferMemoryRequirements2()
Signed-off-by: Mohamed Ahmed <mohamedahmedegypt2001@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21898>
2023-03-15 00:30:35 +00:00
Mohamed Ahmed
10a4412966 vulkan/runtime: move common buffer related entrypoints to vk_buffer.c
Signed-off-by: Mohamed Ahmed <mohamedahmedegypt2001@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21898>
2023-03-15 00:30:35 +00:00
Corentin Noël
3b55d4a6b7 ci: Allow to use crosvm-runner before deqp-runner
Since the addition of unified sections, many scripts need to be aware of the content
of the setup-test-env.sh file. The use of bash is also mandatory to have exports of
function declarations.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21900>
2023-03-14 23:59:37 +00:00
Corentin Noël
ce43cc32e2 ci: Setup XDG_RUNTIME_DIR in crosvm-init
This environment variable has to be set to use the wayland platform.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21900>
2023-03-14 23:59:37 +00:00
Alyssa Rosenzweig
2bab56737c panfrost: Note glDrawRangeElements underflow
Hopefully this helps someone wiring up robustness later on.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>
2023-03-14 23:10:01 +00:00
Alyssa Rosenzweig
c832831a6f panfrost/ci: Remove fbo-mrt-new-bind fail+flake
Seems to pass reliably now.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>
2023-03-14 23:10:01 +00:00
Alyssa Rosenzweig
179ed2ff60 panfrost/ci: Add some Piglit skips
Skip heavyweight crashing tests that have the potential to take down not just
themselves but also other Piglit tests running concurrently via piglit-runner
(which would otherwise become piglit-runner level flakes).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>
2023-03-14 23:10:01 +00:00
Alyssa Rosenzweig
e060513533 panfrost/ci: Identify some Piglit flakes
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>
2023-03-14 23:10:01 +00:00
Alyssa Rosenzweig
6788d37a1f panfrost/ci: Skip draw_buffers_indexed.random.* on Midgard
These are (have always been) quite broken. Given that the whole section is
already in the flakes.txt, and there's no plan for improving this (I've tried
and fails), I'd rather just skip the section and reduce the noise in
the #panfrost-ci channel.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>
2023-03-14 23:10:01 +00:00
Alyssa Rosenzweig
a0e9f9278d panfrost: Handle null textures robustly
This is really dumb.

But this fixes arb_shader_language_420pack-active-sampler-conflict on v7 which
otherwise dereferences a null pointer trying to access the nonexistant texture
arrays, or DATA_INVALID_FAULTs if you give it a texture array filled with
zeroes. But it seems happy if you bind in null textures. This is dumb but less
faults in Piglit is good for reducing flakes.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>
2023-03-14 23:10:01 +00:00
Alyssa Rosenzweig
b8b6bb18f5 panfrost: Defeature 24-bit textures
mesa/st doesn't like to use 24-bit textures, preferring RGBX over true RGB even
for texture views where this isn't valid. Given how silly true RGB is in
practice, I'd rather drop support and fix texture views than go against the
grain and risk more issues down the line since nobody else in tree is testing
these paths and apps really shouldn't be caring.

Fixes page faults in arb_texture_view-rendering-formats_gles3 which tries to
sample an R8G8B8_UINT texture with a R8G8B8X8_UNORM view in one subcase. That
test is now passing reliably.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>
2023-03-14 23:10:01 +00:00
Alyssa Rosenzweig
7dda731a38 panfrost: Assert that we don't see unsupported vertex formats
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>
2023-03-14 23:10:00 +00:00
Alyssa Rosenzweig
589a0fe865 panfrost: Identify "Base vertex offset" signedness
This is signed, not unsigned. We were already passing negatives and silently
relying on 2's complement and C to do the right thing. But that's silly. We
should just, actually do the right thing.

Found while struggling to debug primitive-restart-draw-mode.

v2: Update the other architectures too, including a decode_csf.c change for the
v10 incarnation of this v4-era field.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net> [v1]
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>
2023-03-14 23:10:00 +00:00
Alyssa Rosenzweig
90e78f6008 pan/bi: Ignore signedness in vertex fetch
We just want a bit-exact transfer for integers. Using .auto32 accomplishes this
without any clamping shenanigans. Fixes gl-3.0-vertexattribipointer.

Note we can't use .auto32 unconditionally, since reading a uint vertex as float
is supposed to convert (or something like that, gl-2.0-vertexattribpointer tests
the bad case at any rate).

Fixes: 482cc273af ("pan/bi: Implement load attribute with the builder")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>
2023-03-14 23:10:00 +00:00
Alyssa Rosenzweig
62497d4860 util/prim_convert: Don't set index_bounds_valid
draw->index_bounds_valid tells drivers that the values of min_index/max_index
are set correctly and can be used e.g. to allocate memory for varyings. If set
incorrectly, the GL promises badness.

But, with primconvert, we go mucking with index buffers and then never update
the bounds. So it doesn't matter if the original index bounds were valid, we
can't promise the original bounds are *still* valid. If we were trying to
optimize CPU overhead, we could try to preserve the new min/max index but seeing
as only older Mali cares about this flag, and if you're using primconvert you're
already screwed, I'm not too inclined to go rework primconvert.

Fixes* page faults in primitive-restart-draw-mode on Mali-G52 for GL_QUAD_STRIPS
and GL_POLYGON, which hit the primconvert path. The full dmesg splat looks like:

[ 5438.811727] panfrost ffe40000.gpu: Unhandled Page fault in AS0 at VA 0x000000100A16BAC0
             Reason: TODO
             raw fault status: 0x25002C1
             decoded fault status: SLAVE FAULT
             exception type 0xC1: TRANSLATION_FAULT_1
             access type 0x2: READ
             source id 0x250

Notice that a high bit is randomly set in the address, this is trying to read
a varying from the actual varying buffer in the vicinity of 0xa16bac0. What's
actually happening is that we're trying to read index #0 despite promising the
driver a minimum index of 2, causing an integer underflow as we try to read
index -2, or as the hardware sees, 4294967294.

As long as we stop lying to panfrost about the bounds being correct, panfrost is
able to calculate the real (post-primconverted) bounds on its own, fixing the
test.

* Alternatively, maybe Panfrost should just ignore this bit, in which I don't
  know why we have it in Gallium, since it's probably not conformant to fault on
  out-of-range glDrawRangeElements.

Fixes: 72ff53098c ("gallium: add pipe_draw_info::index_bounds_valid")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>
2023-03-14 23:10:00 +00:00
Mike Blumenkrantz
2409ddb5db zink: fix copy box iteration
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21907>
2023-03-14 21:25:55 +00:00
Mike Blumenkrantz
7d41b8fe4e tu: don't set startup debug on debug builds
this is incredibly annoying on normal linux systems

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21809>
2023-03-14 19:48:24 +00:00
Jarred Davies
1115a29025 pvr: Fix segfaults when pDepthStencilAttachment is NULL
depth_stencil_attachment has been changed from a pointer to the attachment idx
to just the attachment idx, as this avoids the driver having to check for NULL
when comparing attachments indexes with depth_stencil_attachment.

Anyplace that relies on depth_stencil_attachment being a valid index must
already check that depth_stencil_attachment is not VK_ATTACHMENT_UNUSED, so
this change avoids having to check both the pointer and the index for the same
information.

Noticed when running dEQP-VK.api.smoke.triangle

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>

Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21690>
2023-03-14 19:27:27 +00:00
Eric Engestrom
7176e0c160 ci: group RESULT logic in a single place
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21884>
2023-03-14 18:53:51 +00:00
Eric Engestrom
755282accc ci/rustfmt: print which files are checked
And how long that took, in case it ever becomes a problem.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21884>
2023-03-14 18:53:51 +00:00
Eric Engestrom
6c2d177896 ci/rustfmt: simplify getting all the rust files
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21884>
2023-03-14 18:53:51 +00:00
Eric Engestrom
488d5c6fa6 ci: drop redundant .no_scheduled_pipelines-rules + .core-rules since the latter already includes it
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21884>
2023-03-14 18:53:50 +00:00
Eric Engestrom
a0bf0adade ci/broadcom: move rare failure to the flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21901>
2023-03-14 18:26:31 +00:00
Yiwei Zhang
179fadb332 venus: make external fence and semaphore export async
This also makes vn_QueueSignalReleaseImageANDROID async since it makes
use of a queue submit followed by an external fence export internally.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21716>
2023-03-14 18:07:38 +00:00
Yiwei Zhang
a37771b42a venus: refactor to add vn_sync_payload_external
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21716>
2023-03-14 18:07:38 +00:00
Yiwei Zhang
891af34bca venus: make common wsi bo submission async
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21716>
2023-03-14 18:07:38 +00:00
Yiwei Zhang
0a3f612ab3 venus: let vn_instance_submit_command track ring seqno
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21716>
2023-03-14 18:07:38 +00:00
Yiwei Zhang
1cb42a629f venus: make vn_instance_wait_roundtrip asynchronous
vn_instance_roundtrip does 2 things:
1. vn_instance_submit_roundtrip
   - before: encode a cmd to write vq seqno to ring extra field
   - after: encode a cmd to update vq seqno against a ring
   - submit the encoded cmd via vq
2. vn_instance_wait_roundtrip
   - before: wait until ring extra field has the vq seqno
   - after: let renderer ring thread wait for the vq seqno

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21716>
2023-03-14 18:07:38 +00:00
Yiwei Zhang
9b7a78cac6 venus: switch to use 64bit roundtrip seqno
This is to prepare for later async roundtrip waiting while seamlessly
compatible with legacy way.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21716>
2023-03-14 18:07:38 +00:00
Yiwei Zhang
932073d3e6 venus: sync to latest protocol for asyncRoundtrip
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21716>
2023-03-14 18:07:38 +00:00
Martin Roukala (né Peres)
82f0a01291 ci/valve-farm-rules: allow running jobs from outside the mesa namespace
This has been requested as it breaks the stress and uprev tools, so
the requirement was dropped in the Valve farms. This commit mirrors
the change in Mesa.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21872>
2023-03-14 17:22:07 +00:00
Martin Roukala (né Peres)
9dd4c03dd6 ci: bring back the valve farm online
All the farms have been updated, and the `out of files` error has been
fixed, and I also believe that the vast majority of the
`file could not be opened successfully` should also be fixed with this
update.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21872>
2023-03-14 17:22:07 +00:00
Martin Roukala (né Peres)
10e0c5fd46 ci/b2c: move away from the hand-rolled initscript
Up until now, we have been handrolling part of the init-stage2.sh in
the b2c command line. Let's stop doing that and instead use the same
script as every other HW farms.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21872>
2023-03-14 17:22:07 +00:00
Martin Roukala (né Peres)
a0d8ed757e ci/init-stage2: always set XDG_RUNTIME_DIR
This seems to be needed now that we compile mesa with wayland support.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21872>
2023-03-14 17:22:07 +00:00
Martin Roukala (né Peres)
226c247945 ci/init-stage2: allow sourcing the job env vars from the CWD
This will make it easier for the b2c jobs to use this script, as I
don't think I should extract the job folder to /.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21872>
2023-03-14 17:22:07 +00:00
SoroushIMG
4affc3b361 zink: rename shadow key to zs swizzle
No functional change.

The shadow shader swizzle pass has been extended to optionally
include all z/s textures.
Rename the structs/variables to reflect this now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21571>
2023-03-14 17:03:30 +00:00
SoroushIMG
24a2530ed8 zink: workaround undefined swizzle 1 for z/s textures
using swizzle 1 with z/s textures returns undefined data
on some Imagination hardware.
Work around this by using the same shader swizzling used for
shadow samplers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21571>
2023-03-14 17:03:30 +00:00
SoroushIMG
2cf117ee39 zink: add depth/stencil needs shader swizzle workaround field
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21571>
2023-03-14 17:03:30 +00:00
SoroushIMG
cc15dbc4f8 zink: extend shadow swizzle pass to all zs textures
if needs_zs_shader_swizzle is used, apply constant swizzles to all
depth/stencil textures and not just shadow samplers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21571>
2023-03-14 17:03:30 +00:00
SoroushIMG
79557c2747 zink: add needs_zs_shader_swizzle shader key
This will be used later, but for now it should always be disabled.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21571>
2023-03-14 17:03:30 +00:00
SoroushIMG
b707cdccf5 zink: minor formatting change
that line was becoming too long.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21571>
2023-03-14 17:03:30 +00:00
SoroushIMG
f7257b1c75 zink: track shadow swizzle for all shader stages
this will be used later on to enable the pass in all
shader stages.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21571>
2023-03-14 17:03:29 +00:00
SoroushIMG
a83e63437f zink: fix shadow mask change logic when binding sampler views
First make sure shadow mask change sets dirty state.
Second move shadow mask bit removal to unbind_samplerview which
is cleaner and correctly clears the shadow bit when binding buffer texture.

Fixes: 5193f4f712 ("zink: add a fs shader key member to indicate depth texturing mode")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21571>
2023-03-14 17:03:29 +00:00
SoroushIMG
5903868f99 zink: fix stale point sprite mode state
Fixes: cf8ca77be1 ("zink: handle point sprite")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21840>
2023-03-14 16:41:48 +00:00
Mike Blumenkrantz
4b4306fe10 zink: super reorder buffer copies
usually zink_get_cmdbuf() is enough for reordering operations, but
with new technology, it becomes possible to promote even the most stubborn
buffers to the unordered cmdbuf

first, check the src buffer to ensure that there's no pending writes in
the main cmdbuf that would prohibit reordering

second, apply a TRANSFER_DST to the dst buffer using the util function
to determine whether it can be reordered

if both the src and dst can be reordered for their respective regions
and read/write usage, then the entire op can be promoted regardless of
the unordered_read/unordered_write flags

this optimizes out patterns like
upload index buffer (offset=0)
draw
upload index buffer (offset=128)
draw
upload index buffer (offset=256)
draw
...

so that the uploads and draws can be separated and batched

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21802>
2023-03-14 16:23:06 +00:00
Mike Blumenkrantz
128d19da5e zink: rename zink_check_transfer_dst_barrier()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21802>
2023-03-14 16:23:06 +00:00
Mike Blumenkrantz
e0c53554ae zink: unify image TRANSFER_DST barrier checks
this should be consistent with buffers

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21802>
2023-03-14 16:23:06 +00:00
Mike Blumenkrantz
e55e9014b3 zink: return the unordered state from zink_resource_buffer_transfer_dst_barrier()
convenience usage

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21802>
2023-03-14 16:23:06 +00:00
Mike Blumenkrantz
fe6f0692ed zink: rework zink_resource::valid_buffer_range
this is now the valid buffer region for the "main" command buffer,
and all transfer ops store their regions in the copy boxes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21802>
2023-03-14 16:23:06 +00:00
Mike Blumenkrantz
8c51c8697a ci: fix LVP_POISON_MEMORY usage
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21847>
2023-03-14 14:52:25 +00:00
Mike Blumenkrantz
8b38c4f43c lavapipe: beef up LVP_POISON_MEMORY
this makes lavapipe behave more like a tiler and completely annihilate
any existing data for DONTCARE load/store ops

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21847>
2023-03-14 14:52:24 +00:00
Lionel Landwerlin
d4a2c0fcaa vulkan/wsi: add a headless swapchain implementation/option
I wanted to find slow pieces of code in our Anv driver using our
drm-shim stub.

The last bit of code still talking to the compositor was the WSI
swapchain code and failing because none of the submissions are taking
place (because of the stub).

This change introduces a new variable MESA_VK_WSI_HEADLESS_SWAPCHAIN
which when set turns every swapchain creation into a headless
swapchain. This swapchain does not present anything, allowing the
application to spin as many frames as possible. Thus helping to
identify slow spots in command buffer building path.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6156>
2023-03-14 14:03:31 +00:00
Dave Airlie
4e0d4aab48 anv: fix image height for field pictures.
Fixes: 98c58a16ef ("anv: add initial video decode support for h264.)
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21807>
2023-03-14 13:34:53 +00:00
Lionel Landwerlin
56474fae93 intel/fs: fix subgroup invocation read bounds checking
nir->info.subgroup_size can be set to an enum :
  SUBGROUP_SIZE_VARYING = 0
  SUBGROUP_SIZE_UNIFORM = 1
  SUBGROUP_SIZE_API_CONSTANT = 2
  SUBGROUP_SIZE_FULL_SUBGROUPS = 3

So compute the API subgroup size value and compare it to the dispatch
size to determine whether we need some bound checking.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 9ac192d79d ("intel/fs: bound subgroup invocation read to dispatch size")
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21856>
2023-03-14 12:15:48 +00:00
Daniel Schürmann
f6a36190a1 radv/rt: Fix any_hit scratch variables.
We have to make sure not to change call_data locations as well.

Fixes: 481f78ab93 ('radv/rt: place any-hit scratch vars after intersection scratch vars')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21876>
2023-03-14 11:57:02 +00:00
Emma Anholt
5bb9ab896c ci: Re-enable some swrast testing using fd.o's shared runners for now.
I'm not planning to stand mesa-swrast back up until we get Kata set up, so
turn the testing back on at a reduced fraction on so that
venus/llvmpipe/etc. dev can still get some coverage.

I haven't turned lavapipe back on, because it is now unstable in memory
model / atomics tests.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21880>
2023-03-14 11:31:34 +00:00
Lionel Landwerlin
bf59cfcee1 intel/fs: prevent large vector ops generated by peephole_ffma
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21782>
2023-03-14 10:38:50 +00:00
Lionel Landwerlin
bc08f43991 intel/fs: add MOV source count validation
Signed-off-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/21782>
2023-03-14 10:38:50 +00:00
Lionel Landwerlin
ed3c2f73db intel/fs: fixup sources number from opt_algebraic
Fixes issues with register_coalesce :

fossilize-replay: brw_fs_register_coalesce.cpp:297: bool fs_visitor::register_coalesce(): Assertion `mov[i]->sources == 1' failed.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21782>
2023-03-14 10:38:50 +00:00
Lionel Landwerlin
18bdc71459 intel/fs: fix nir_opt_peephole_ffma max vec assumption
There can be larger vec than vec4.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21782>
2023-03-14 10:38:50 +00:00
Lionel Landwerlin
efde1917c9 intel/fs: don't SEND messages as partial writes
For instance, to load uniform data with the LSC we usually rely on
tranpose messages which have to execute in SIMD1. Those end up being
considered as partial writes so within loops their life span spread to
the whole loop, increasing register pressure.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21867>
2023-03-14 10:10:32 +00:00
Lionel Landwerlin
adcdc38f3b anv: more formats for acceleration structure vertices
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21821>
2023-03-14 09:34:27 +00:00
Dave Airlie
cb24faf1a6 anv/video: disable picture id reampping.
This isn't needed at the hw level with vulkan

Fixes: 98c58a16ef ("anv: add initial video decode support for h264.")
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21433>
2023-03-14 07:32:00 +00:00
Dave Airlie
f85b2cbe33 anv/video: fix chroma qp to be a integer value.
This is just a cleanup to the genxml

Fixes: 98c58a16ef ("anv: add initial video decode support for h264.")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21433>
2023-03-14 07:32:00 +00:00
Mike Blumenkrantz
c28c995645 lavapipe: add command debugging
I keep adding this in locally. it's great for debugging

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21814>
2023-03-14 06:16:32 +00:00
Mike Blumenkrantz
e6e1d01be0 lavapipe: set render_condition_enabled=false for vkCmdClearDepthStencilImage
this command ignores conditional rendering

fixes:
dEQP-VK.conditional_rendering.conditional_ignore.clear_condition_host_memory_expect_noop
dEQP-VK.conditional_rendering.conditional_ignore.clear_condition_host_memory_secondary_buffer_expect_noop
dEQP-VK.conditional_rendering.conditional_ignore.clear_condition_host_memory_secondary_buffer_expect_noop_inverted
dEQP-VK.conditional_rendering.conditional_ignore.clear_condition_host_memory_secondary_buffer_inherited_expect_noop
dEQP-VK.conditional_rendering.conditional_ignore.clear_condition_local_memory_expect_noop_inverted
dEQP-VK.conditional_rendering.conditional_ignore.clear_condition_local_memory_secondary_buffer_expect_noop
dEQP-VK.conditional_rendering.conditional_ignore.clear_condition_local_memory_secondary_buffer_expect_noop_inverted
dEQP-VK.conditional_rendering.conditional_ignore.clear_condition_local_memory_secondary_buffer_inherited_expect_noop

Fixes: fe53c22294 ("lavapipe: fix only clearing depth or stencil paths.")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21814>
2023-03-14 06:16:32 +00:00
Mike Blumenkrantz
c9e757c61e lavapipe: fix dynamic depth clamping
on pipeline bind with dynamic state, depth_clip_near needs to either be set by
* applying the dynamic state
* using the pipeline state

the previous code always used the pipeline state

fixes:
dEQP-VK.pipeline.*.extended_dynamic_state.between_pipelines.depth_clamp_enable

Fixes: 650880105e ("vulkan,lavapipe: Use a tri-state enum for depth clip enable")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21814>
2023-03-14 06:16:31 +00:00
Corentin Noël
cd39a5ac8b ci: uprev virglrenderer and crosvm
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21794>
2023-03-14 05:22:21 +00:00
Lionel Landwerlin
f406a9efa9 docs: update Anv features support
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21870>
2023-03-14 02:08:01 +00:00
Lionel Landwerlin
d8013976c7 anv: export EXT_pipeline_library_group_handles only with RT
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21870>
2023-03-14 02:08:01 +00:00
Eric Engestrom
76b591d8f7 broadcom/ci: no need to skip the tests that swap buffers anymore
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21877>
2023-03-14 01:31:19 +00:00
Eric Engestrom
d57a4b57df ci: disable weston session timeout
-iN, --idle-time=N
           Set  the idle timeout to N seconds. The default timeout is
           300 seconds. When there has not been any user input for the idle
           timeout, Weston enters an inactive mode. The screen fades to black,
           monitors may switch off, and the shell may lock the session.
           A value of 0 effectively disables the timeout.

We don't want the session to get locked and monitors to switch off while tests
are running, as many of them depend on swapping buffers.

Cc: mesa-stable
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21877>
2023-03-14 01:31:19 +00:00
Mike Blumenkrantz
43facca195 aux/tc: use renderpass tracking to optimize texture_subdata calls
if it's known that a renderpass is active and the driver wants to do
renderpass optimizing, help out by not forcing a sync and instead doing
what the driver would do: create a staging buffer and copy it to the
image

this requires that the driver already handles buffer -> image copies
with resource_copy_region

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21801>
2023-03-14 00:53:28 +00:00
Konstantin Seurer
ecf29228d0 radv/sqtt: Skip dumping pipeline libraries
They don't have any shaders which can lead to crashes when dumping
them.

Fixes: 2e04aeb ("radv: capture RT pipelines from the SQTT layer")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21852>
2023-03-13 20:05:49 +00:00
Mark Collins
715adcb884 tu: fix tu_GetInstanceProcAddr not handling null instance
It is legal to pass in nullptr as an instance into
vkGetInstanceProcAddr when resolving any global addresses, this
wasn't handled correctly and an illegal access to a member of
a null struct was made.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21827>
2023-03-13 19:31:33 +00:00
Mark Collins
9c808043f3 tu: KGSL backend rewrite
This commit rewrites the KGSL backend to utilize vk common wherever
possible to bring the codebase in line with DRM while implicitly
fixing minor API bugs that may have occurred as a result of manually
implementing VK functions.

As a part of moving to vk common, KGSL sync is now implemented
atop vk common sync and vastly expanded in terms of functionality
such as:
* Import/Export of sync FDs - A required capability for properly
  supporting the Android WSI and as these functions were stubbed
  when a presentation operation used semaphores, it would cause a
  leak of FDs that were imported due to the expectation that the
  driver would close them. As well as causing UB around due to
  ignoring the imported FD or not exporting a valid FD.
* Supporting pre-signalled fences - Vulkan allows fences to be
  created in a signalled state which was stubbed prior and can
  lead to UB.
* Timeline semaphore support - As a result of utilizing vk common
  as the backbone for synchronization, its timeline semaphore
  emulation has been utilized to provide support for them without
  needing kernel support. (Note: On newer versions of KGSL,
  timeline semaphores can be implemented natively rather than
  using emulation as they support wait-before-signal)

Fixes freezes due to semaphore usage with presentation on:
* Genshin Impact
* Skyline Emulator

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21651>
2023-03-13 18:59:50 +00:00
Pierre-Eric Pelloux-Prayer
88989379b1 Revert "driconf: add a workaround for plasmashell freezing"
This reverts commit 41eb491fb6.

The underlying issue was fixed by the previous commit.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20887>
2023-03-13 18:28:15 +00:00
Pierre-Eric Pelloux-Prayer
a98e4195f5 yegl/wayland: fix glthread deadlocks
We need to make sure that glthread is idle before using wl_*
functions or they might be used from 2 threads at the same
time.

Thanks to @deltib for the investigation of this issue.

Fixes: 58f90fd03f ("egl/wayland: fix glthread crashes")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7624
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8136
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20887>
2023-03-13 18:28:15 +00:00
Daniel Stone
95e8be29a7 ci/panfrost: Add texturesize flake seen in the wild
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20887>
2023-03-13 18:28:15 +00:00
Rob Clark
ea3e9d541f freedreno/a6xx: Simplify iova emit
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:24 +00:00
Danylo Piliaiev
5ca3481b5d freedreno/register: Define chip enum values
Otherwise it cannot be used in templates

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:24 +00:00
Rob Clark
6b2c1b00ff freedreno/registers: Define rest of CP_REG_WRITE
Enough that we can use OUT_PKT() to emit it, which will be needed when
we use it to write regs that are different btwn a6xx and a7xx.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:24 +00:00
Rob Clark
6dd5b4ca5f freedreno/registers: Fix nameless fields
Originally if we had an anonymous field (ie. field declared as part of
the register definition itself) the name in the generated field struct
would include the gen prefix (ie. .a6xx_rb_stencil_buffer_pitch), but
this doesn't work for variants because the variant regs would have
different gen prefixes.  Fix this by using reg name instead of the
full_name.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:24 +00:00
Rob Clark
dc43237d1a freedreno/registers: Add c++ magic for register variants
For regs with multiple variants, generate a template'ized function to
pack the reg value.  If the template param is known at compile time
(which is the expected usage) this will optimize to the same thing as
the "traditional" reg packing.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:24 +00:00
Rob Clark
d58af7b5c7 freedreno/registers: Split out regpair builder helper
We are going to want to re-use this in the next commit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:24 +00:00
Rob Clark
d54edcfc72 freedreno/registers: Track varset
Track varset and assert that variants refer to a valid varset enum
value.  This adds a bit of extra sanity checking, but becomes more
useful in the next commit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:23 +00:00
Rob Clark
f011189642 freedreno/registers: Start adding stuff for a7xx
Start adding the bits needed for userspace.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:23 +00:00
Rob Clark
b90d4a0701 freedreno/decode: Start adding a7xx support
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:23 +00:00
Rob Clark
dd6e7041ab freedreno/registers: Start adding a7xx pipe/control regs
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:23 +00:00
Rob Clark
56f9371f7e freedreno/registers: Merge a6xx and a7xx regs
They have more similarities than differences, so merge them and use
"variant" attribute as needed to manage differences.

Note initially using "variant" conservatively when it comes to regs
known on a7xx but not a6xx.  It could be that they exist also on later
versions of a6xx as well, for example.  For ex, LPAC related regs/bits
likely existed on later a6xx (eg. a660 family) but BV stuff is not.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:23 +00:00
Rob Clark
684931166d freedreno/registers: Add prefix="variant"
To merge a7xx and a6xx regs, using variant property to manage the
differences, we'll want regs/etc to be named according to the first
generation it is use rather than the domain name.  Add a new prefix
type to accomplish this.  By default, if no variant property, things
will still be named based on domain (ie. REG_A6XX_...), and things
that have variant="A6XX" will also end up as they currently are
(since the chip enum matches domain name), but things that have
variant="A7XX" will end up as REG_A7XX_...

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:23 +00:00
Rob Clark
fadf76b938 freedreno/registers: Fix designator order
C++ is picky about order matching for some reason.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:23 +00:00
Rob Clark
4a528e8f5f freedreno/a6xx: Convert to c++
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:23 +00:00
Rob Clark
ce336097f1 freedreno/a6xx: Fix designator initializer order
Clang seems more relaxed about this, allowing C99 style initializers
without requiring ordering.  But unfortunately g++ is more picky :-/

TODO this doesn't completely fix everything with g++, namely sparse
array initialization.. for ir3 driver-params, I think we can convert
these to structs.  But there are still one or two others to deal with.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:23 +00:00
Rob Clark
96ca37b9af freedreno/a6xx: Add missing "inline"
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:22 +00:00
Rob Clark
af2f0c3d9b freedreno/a6xx: Rework texture_clear fallback
C++ is more picky about a goto jumping over variable initialization,
even if unused after the goto label (presumably because of destructors
that can be called after a variable goes out of scope).  Since there is
only a single fallback path, get rid of the goto.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:22 +00:00
Rob Clark
f921b7c09b freedreno: c++-proofing
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:22 +00:00
Rob Clark
05958fa6c9 freedreno: Un-inline buffer-mask enum
Also, fix obsolete comment.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:22 +00:00
Rob Clark
37a036500a freedreno/ir3: Add missing driver params
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:22 +00:00
Rob Clark
5eed59cc87 freedreno/ir3+tu: Calculate subgroup size in ir3
TBD if the size changes for a7xx, but at least let's have it in one
place instead of duplicating in turnip and gallium.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:22 +00:00
Rob Clark
c449e63809 freedreno/ir3: c++-proof the headers
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:22 +00:00
Rob Clark
bff0ff5ae3 freedreno/ir3: Don't use negative opc for meta instructions
Stricter compilers complain about this, ie:

  error: left operand of shift expression ‘(-1 << 7)’ is negative [-fpermissive]

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:22 +00:00
Rob Clark
7c7761574e freedreno/ir3: Un-inline enums
It seems to be a thing that c++ dislikes

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:22 +00:00
Rob Clark
69947b284e freedreno: Quiet c++ warning about designated initializers
And various other things that c++ is more strict about.  Perhaps we
re-instate a few of the more reasonable warnings over time.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:22 +00:00
Rob Clark
64e93ca9a1 freedreno/registers: Add regs for a690
New regs needed on kernel side.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:22 +00:00
Rob Clark
44d0365a4d freedreno/registers: Schema validation for gen_header.py
Lets catch issues at build time, and not relying on someone remembering
to run the unit tests.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:22 +00:00
Rob Clark
963729af2a freedreno: Nerf strict-aliasing warning for all of gcc
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:21 +00:00
Samuel Pitoiset
4d03bf0f9d radv: allow to cache optimized (LTO) pipelines with GPL
This should be working now, except PS epilogs that are still not
added to the cache.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21834>
2023-03-13 13:35:24 +00:00
Samuel Pitoiset
532d63993f radv: keep track of the retained NIR shaders sha1 for LTO pipelines
Otherwise the per pipeline cache key doesn't consider shaders at all
when they are imported from libs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21834>
2023-03-13 13:35:24 +00:00
Samuel Pitoiset
fbc7e8f3df radv: determine if a graphics pipeline needs a noop FS earlier
Also introduce a helper.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21834>
2023-03-13 13:35:24 +00:00
Samuel Pitoiset
86ab8c33ed radv: fix the error code when the driver fails to create a PS epilog
It would have been returned VK_SUCCESS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21834>
2023-03-13 13:35:24 +00:00
Daniel Schürmann
481f78ab93 radv/rt: place any-hit scratch vars after intersection scratch vars
If both, any-hit and intersection shader, use scratch vars,
it could happen that they end up in the same location and
overwrite each other.
Found by inspection.

Fixes: c3d82a9622 ('radv: Add pass to lower anyhit shader into an intersection shader.')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21863>
2023-03-13 11:45:26 +00:00
Jordan Justen
48ff68820e intel/dev: Enable MTL PCI ids
Ref: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/drm/i915_pciids.h?h=v6.0-rc4#n736
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
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/18481>
2023-03-13 10:17:51 +00:00
Mike Blumenkrantz
e28b982db8 radv: avoid a huge memset in radv_graphics_pipeline_compile()
this has a noticeable impact on pipeline creation

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20947>
2023-03-13 08:11:10 +01:00
Samuel Pitoiset
1c286db14e radv: zero-initialize radv_shader_info earlier for graphics pipeline
This should allow us to remove a big memset when compiling a
graphics pipeline. This is mostly for imported NIR stages which
don't go through radv_pipeline_stage_init().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20947>
2023-03-13 08:11:10 +01:00
Samuel Pitoiset
67635bb3e3 radv: zero-initialize radv_shader_args right before declaring them
This should allow us to remove a big memset when compiling a
graphics pipeline. This is mostly for imported NIR stages which
don't go through radv_pipeline_stage_init().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20947>
2023-03-13 08:11:10 +01:00
Mike Blumenkrantz
c505f892d4 radv: delete radv_graphics_pipeline_compile() asserts
validation should catch these by now

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20947>
2023-03-13 08:11:10 +01:00
Vinson Lee
29c6a09887 pps: Fix build errors.
In file included from ../src/tool/pps/pps_device.cc:10:
../src/tool/pps/pps_device.h:23:11: error: ‘uint32_t’ does not name a type
   23 |    static uint32_t device_count();
      |           ^~~~~~~~

In file included from ../src/tool/pps/pps_counter.cc:10:
../src/tool/pps/pps_counter.h:22:4: error: ‘uint32_t’ does not name a type
   22 |    uint32_t id;
      |    ^~~~~~~~

Fixes: 1cc72b2aef ("pps: Gfx-pps v0.3.0")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8186
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21714>
2023-03-13 01:22:46 +00:00
Marek Olšák
c455ea6144 glthread: qualify the *cmd unmarshal parameter with restrict
This seems like a logical thing to do. Clearly the memory can't be
accessed with any other pointer.

Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21777>
2023-03-12 17:56:18 -04:00
Marek Olšák
862b00b795 mesa: put dispatch table initialization into one place
We have 3 new/changed functions with this commit:
1. _mesa_alloc_dispatch_tables creates all dispatch tables that are not
   created on demand and sets them to nop. This operates on gl_dispatch,
   so it's reusable (e.g. glthread will want to use it)
2. _mesa_free_dispatch_tables frees everything
3. _mesa_initialize_dispatch_tables initializes gl_dispatch for GL
   (not glthread)

Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21777>
2023-03-12 17:56:16 -04:00
Marek Olšák
dae902e11e mesa: rename CurrentClientDispatch to GLApi
I like this more. The name self-documents itself. It's always equal
to the dispatch set in glapi.

GLAPI is a definition, so can't use that.

Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21777>
2023-03-12 17:56:15 -04:00
Marek Olšák
6b22642e21 mesa: move ctx->Table -> ctx->Dispatch.Table except Client & MarshalExec
There is a new struct gl_dispatch, which I'd like to reuse in glthread.
This allows building code around gl_dispatch that can be shared between
mesa and glthread. This is only refactoring.

Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21777>
2023-03-12 17:56:11 -04:00
Marek Olšák
ef0e327d9f glapi: inline the meson list files_mapi_util
so that people can easily tell where these files are used by searching
for the file names in the meson files.

Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21777>
2023-03-12 17:56:10 -04:00
Marek Olšák
eed145004b glapi: move files specific to shared-glapi into the shared-glapi subdirectory
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21777>
2023-03-12 17:56:03 -04:00
David Heidelberg
7cf7d497e7 ci/clover: disable the jobs
Prepare for Clover removal; don't waste resources on Clover anymore.

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21865>
2023-03-12 20:50:14 +01:00
Daniel Schürmann
3d4f6a00b8 aco/spill: allow for disconnected CFG
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20853>
2023-03-12 18:07:18 +00:00
Daniel Schürmann
caec48529b aco/insert_exec_mask: allow for disconnected CFG
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20853>
2023-03-12 18:07:18 +00:00
Daniel Schürmann
7f7a70778f aco/dead_code_analysis: don't add artificial uses to p_startpgm
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20853>
2023-03-12 18:07:18 +00:00
Daniel Schürmann
fb99bc5f30 aco/value_numbering: clear hashmap between disconnected CFGs
There is no dominance-relationship between two disconnected CFGs,
thus no CSE is possible.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20853>
2023-03-12 18:07:18 +00:00
Daniel Schürmann
678aef9f06 aco/dominance: set immediate dominator for any BB without predecessors
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20853>
2023-03-12 18:07:18 +00:00
Daniel Stone
8731721489 CI: Disable mingw job
mingw just hangs somewhere in Meson, with a totally unclear cause, when
trying to run winepath:

Program winepath found: YES (/usr/bin/winepath)
Running command: /usr/bin/winepath -w /builds/mesa/mesa/_build/src/util/process_test.exe
[... hangs forever ...]

root          27  0.0  0.0   4044  3232 ?        S    17:10   0:00 bash .gitlab-ci/meson/build.sh
root          35  0.0  0.0 2811920 55800 ?       Sl   17:10   0:00 Xvfb :0 -screen 0 1024x768x16
root          40  0.1  0.0  45484 40740 ?        S    17:10   0:00 /usr/bin/python3 /usr/local/bin/meson setup _build --native-file=native.file --wrap-mode=nofallback --force-fallback-for perfetto -D prefix=/builds/mesa/mesa/install -D libdir=lib -D buildtype=debug -D build-tests=true -D c_args=-Wno-error=format -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=sign-compare -Wno-error=narrowing -D cpp_args=-Wno-error=format -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=sign-compare -Wno-error=narrowing -D enable-glcpp-tests=false -D libunwind=disabled -D gallium-opencl=icd -D gallium-rusticl=false -D opencl-spirv=true -D microsoft-clc=enabled -D static-libclc=all -D llvm=enabled -D gallium-va=enabled -D video-codecs=h264dec,h264enc,h265dec,h265enc,vc1dec -D gallium-drivers=swrast,d3d12,zink -D vulkan-drivers=swrast,amd,microsoft-experimental -D video-codecs=h264dec,h264enc,h265dec,h265enc,vc1dec -D werror=true -D min-windows-version=7 -D spirv-to-dxil=true -D gles1=enabled -D gles2=enabled -D osmesa=true -D cpp_rtti=true -D shared-glapi=enabled -D zlib=enabled --cross-file=.gitlab-ci/x86_64-w64-mingw32
root        1366  0.0  0.0      0     0 ?        Z    17:10   0:00 [winepath.exe] <defunct>
root        1375  0.0  0.0   8544  7188 ?        Ss   17:10   0:00 /usr/lib/wine/wineserver64 -p0
root        1381  0.0  0.0 2018764 11080 ?       Ssl  17:10   0:00 C:\windows\system32\services.exe
root        1384  0.0  0.0 1821312 10044 ?       Sl   17:10   0:00 C:\windows\system32\plugplay.exe
root        1386  0.0  0.0 1856096 23016 ?       Sl   17:10   0:00 C:\windows\system32\explorer.exe /desktop
root        1393  0.0  0.0 1822712 11000 ?       Sl   17:10   0:00 C:\windows\system32\winedevice.exe
root        1402  0.0  0.0 1778832 21456 ?       S    17:10   0:00 winedbg --auto 26 80
root        1405  0.0  0.0 1891516 12192 ?       Sl   17:11   0:00 C:\windows\system32\winedevice.exe

Disable it until we can figure it out.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21864>
2023-03-12 17:25:12 +00:00
Daniel Stone
023d7e860e CI: Disable Windows runners
They are currently being rebuilt, with no firm ETA for their return.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21864>
2023-03-12 17:01:56 +00:00
Daniel Stone
5b697d1921 Revert "ci: Disable Collabora LAVA farm"
This reverts commit c1aa876747.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21864>
2023-03-12 17:01:44 +00:00
Kai Wasserbäch
bb2db56ffe fix: gallivm: fix LLVM #include of Host.h, moved to TargetParser
Upstream moved Host.h from Support to TargetParser in LLVM 17.

This shouldn't lead to a FTBFS, since there is a forwarding include left
behind. Sadly the added deprecation warning #pragma is invalid and thus
causes a build failure right away. But since we would have to follow the
move anyway in the future, just do it right away.

Reference: d768bf994f
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Closes: #8275
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21263>
2023-03-12 14:02:23 +00:00
Konstantin Seurer
e3aa058317 radv/rt: Properly handle pNext of pipeline library stages
Fixes
dEQP-VK.pipeline.pipeline_library.graphics_library.misc.non_graphics.shader_module_info_rt_lib.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21707>
2023-03-12 13:18:15 +00:00
Konstantin Seurer
ef5cba56a0 vulkan: Add vk_shader_module_init
This will be used for allocating shader modules using ralloc by RADV.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21707>
2023-03-12 13:18:15 +00:00
Konstantin Seurer
0fc8335ccb radv/rt: Use vk_pipeline_hash_shader_stage for RT stages
Fixes
dEQP-VK.pipeline.pipeline_library.graphics_library.misc.non_graphics.shader_module_info_rt.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21707>
2023-03-12 13:18:15 +00:00
David Heidelberg
2b00eaaedc ci/iris: update apl and glk expectations, after enabling Wayland support
After enabling the Wayland platform for x86_64,
multiple new tests were triggered, some of which timed out.

Also wayland-dEQP-EGL.functional.negative_api.create_pixmap_surface now pass.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21786>
2023-03-12 00:11:09 +00:00
David Heidelberg
2f8073f87c ci: build Wayland support for the amd64
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21786>
2023-03-12 00:11:09 +00:00
Alyssa Rosenzweig
45554a957a agx: Lower discard late
Fixes regression with Dolphin's ubershaders.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21855>
2023-03-11 23:34:56 +00:00
Mike Blumenkrantz
c04a7c9267 zink: ignore renderdoc if ZINK_RENDERDOC isn't in use
this otherwise has some weird side effects

Fixes: 48a0478126 ("zink: add renderdoc handling")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21816>
2023-03-11 22:10:38 +00:00
Alyssa Rosenzweig
7e908878c1 ail: Restructure generated tests
Currently, the generated tests consist of some boilerplate, generated
test cases, and at the very end the actual test. This is bad for readability,
because the actual code is all the way at the bottom. It's also bad for
clang-format linting: even though the test cases are /* clang-format off */,
they still take an exceptionally long time to parse when linting. I suspect this
is a clang-format bug, but it's easy enough to workaround.

To solve these issues, restructure so that the test cases are in separate files
(containing the actual data), but the manually written test functions are
consolidated into a new family of generated layout tests. This is probably
cleaner.

Parallel clang-format linting is now 10x faster on the M1, which means it's
now practical to lint in my "publish branch" hook.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21854>
2023-03-11 20:45:42 +00:00
José Roberto de Souza
43e21702f6 anv: Integrate gem vm bind and unbind kmd backend functions
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21698>
2023-03-11 17:56:01 +00:00
José Roberto de Souza
37fa2fa30e anv: Add gem VM bind and unbind to backend
Not using it yet, that will be done in the next patch.
Xe only supports submission using VM.
For i915 the backend functions are just a noop.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21698>
2023-03-11 17:56:01 +00:00
José Roberto de Souza
324d22d684 anv: Implement gem close and mmap for Xe backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21698>
2023-03-11 17:56:01 +00:00
José Roberto de Souza
149e945ad4 anv: Implement Xe functions to create and destroy VM
Also using the vm_id to create gem buffers.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21698>
2023-03-11 17:56:01 +00:00
José Roberto de Souza
d5f767edf9 anv: Implement gem_create for Xe backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21698>
2023-03-11 17:56:01 +00:00
Isabella Basso
59fea8af3a nir/algebraic: remove duplicate bool conversion lowerings
While [1] added some boolean conversion lowering patterns, those were
already dealt with on [2].

[1] - b86305bb ("nir/algebraic: collapse conversion opcodes (many patterns)")
[2] - d7e0d47b ("nir/algebraic: nir: Add a bunch of b2[if] optimizations")

Fixes: b86305bb ("nir/algebraic: collapse conversion opcodes (many patterns)")
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Isabella Basso <isabellabdoamaral@usp.br>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20965>
2023-03-11 17:21:38 +00:00
Isabella Basso
a553d3cd29 nir/algebraic: make patterns for float conversion lowerings imprecise
As noted on [1], lowering patterns of the form
floatS -> floatB -> floatS ==> floatS
cannot require precision since this may cause flush denorming.

[1] 3f779013 ("nir: Add an algebraic optimization for float->double->float")

Fixes: b86305bb ("nir/algebraic: collapse conversion opcodes (many patterns)")
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Isabella Basso <isabellabdoamaral@usp.br>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20965>
2023-03-11 17:21:37 +00:00
Isabella Basso
79c94ef52e nir/algebraic: extend lowering patterns for conversions on smaller bit sizes
Conversions on smaller bit sizes should also be collapsed when composed.

This also adds more patterns on the
intS -> intB -> floatB ==> intS -> floatB
lowering so as to deal with any int size C > B instead of a fixed intB.

Closes: #7776
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Isabella Basso <isabellabdoamaral@usp.br>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20965>
2023-03-11 17:21:37 +00:00
Isabella Basso
a27bcd63d0 nir/algebraic: extend mediump patterns
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Suggested-by: Italo Nicola <italonicola@collabora.com>
Signed-off-by: Isabella Basso <isabellabdoamaral@usp.br>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20965>
2023-03-11 17:21:37 +00:00
Isabella Basso
b3685f3ba7 nir/algebraic: insert patterns inside optimizations list
Some patterns were outside the list of optimizations.

Fixes: b86305bb ("nir/algebraic: collapse conversion opcodes (many patterns)")

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Isabella Basso <isabellabdoamaral@usp.br>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20965>
2023-03-11 17:21:37 +00:00
Alyssa Rosenzweig
2ba48eea88 nir/lower_point_size: Use shader_instructions_pass
Sleepy code deletion mood.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21750>
2023-03-11 16:42:36 +00:00
Alyssa Rosenzweig
933b5c76f6 agx: Switch to scoped_barrier
Rather than ingesting separate control and memory barriers, ingest only the
combined and optimized scoped_barrier intrinsic. For barriers originating from
GLSL, this makes it easier to ensure correctness. For barriers originating from
SPIR-V, this is required for translation at all, as spirv_to_nir knows only
scoped barriers. So this gets us closer to Vulkan and OpenCL.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21752>
2023-03-11 16:20:06 +00:00
David Heidelberg
84767a5160 ci/lava: every LAVA job doesn't want to run gles2 deqp, drop it
Very annoying when adding new job and not getting failure due to missing
`DEQP_VER: `

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21702>
2023-03-11 14:48:20 +00:00
David Heidelberg
8cdbb894ca ci/panfrost: correct the job name, as it runs on gles2
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21702>
2023-03-11 14:48:20 +00:00
David Heidelberg
e3660c2820 ci/amd: move skqp and va jobs on raven from XOrg to the XWayland
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21702>
2023-03-11 14:48:20 +00:00
David Heidelberg
1e262f129b ci: add and utilize dalboz devices
New 10 devices - asus-CM1400CXA-dalboz hosted on Collabora farm.

1x Move VA-API tests to the dalboz (more resources). One timeout dropped.
9x Run VKCTS on dalboz.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21702>
2023-03-11 14:48:20 +00:00
Sil Vilerino
3067bda0f3 d3d12: Fix video decode for interlaced streams with reference only textures required
Fixes: d8206f6286 ("d3d12: Add video decode implementation of pipe_video_codec")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21832>
2023-03-11 14:31:32 +00:00
Alyssa Rosenzweig
b768a254f7 agx: Use nir_lower_mem_access_bit_sizes
Lowers away 64-bit loads, which we'll create in the sysval lowering for
dynamically indexed UBOs/VBOs. The lowering generates pack_64_2x32 instructions,
so lower those too.

No shader-db changes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21674>
2023-03-11 14:15:50 +00:00
Alyssa Rosenzweig
8a53050d7d agx: Implement extract_[ui]16
Instead of lowering to bitwise ops. Yet another way of subdividing in NIR.
Probably insignificant but makes it easy to check that the pass ordering from the
previous pass is right. It does let us get much better codegen for
unpacksnorm2x16, whatever that's worth.

No shader-db changes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21674>
2023-03-11 14:15:50 +00:00
Alyssa Rosenzweig
706815488e agx: Fix subdivision coalescing
As intended. We can't CSE with partial null destinations in the way, so we
shouldn't eliminate dead destinations until after CSE has run. But we should
still eliminate dead instructions to ensure CSE doesn't move things around
needlessly, hurting register pressure.

Noticed while debugging live range splitting.

No GLES3.0 shader-db changes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21674>
2023-03-11 14:15:50 +00:00
Alyssa Rosenzweig
5ea9c2e634 agx: Make partial DCE optional
Our dead code elimination pass does two things:

1. delete instructions that are entirely unnecessary
2. delete unnecessary destinations of necessary instructions

To deal with pass ordering issues, we sometimes want to do #1 without #2.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21674>
2023-03-11 14:15:50 +00:00
Alyssa Rosenzweig
16f8bfb042 agx: Don't set lower_pack_split
We should handle nir_op_unpack_32_2x16_split_* natively, since we can generate
better code with agx_subdivide (coalescing the ops away) than the bitshift
lowering.

That said, we do need some extra instructions for the floating point
conversions.

No shader-db changes (which makes sense because we're targetting the GLES3.0
shader-db, which doesn't have the packing GLSL functions).

The real motivation of this change isn't optimizing some GLSL pack functions,
though, it's avoiding a code regression from using NIR's memory bit size
lowering in a future MR. That lowering will turn things like "load i16vec4" into
"load i32vec2 + unpack_32_2x16", so we need to be able to coalesce that unpack.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21674>
2023-03-11 14:15:50 +00:00
Daniel Stone
c1aa876747 ci: Disable Collabora LAVA farm
Looks like a power or network issue.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21851>
2023-03-11 11:59:31 +00:00
Eric Engestrom
9cf636834c ci: take valve farm offline
It seems to be experiencing networking issues

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21851>
2023-03-11 11:59:18 +00:00
Daniel Stone
50378f59a7 ci: Actually run Piglit on LAVA
At some point in a refactoring long ago, our 'Piglit' runs on arm64
started actually being dEQP-GLES2 runs. Oh dear.

Surprisingly, there are a number of expectation changes; added every
fail I saw from a long overnight stress test.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21851>
2023-03-11 11:58:30 +00:00
Alyssa Rosenzweig
b190d08a8a pan/mdg: Remove reference to removed macro
This will soon be more confusing than helpful.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20445>
2023-03-11 06:30:02 +00:00
Alyssa Rosenzweig
cc16e7322f panfrost: Remove MALI_POSITIVE macro
Now unused.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20445>
2023-03-11 06:30:02 +00:00
Alyssa Rosenzweig
131845eb84 panfrost: Inline the last MALI_POSITIVE use
Big shrug on this one.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20445>
2023-03-11 06:30:02 +00:00
Alyssa Rosenzweig
14eb964e59 panfrost: Remove FBD tag enum from XML
This was a hack to avoid modelling the full data structure.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20445>
2023-03-11 06:30:02 +00:00
Alyssa Rosenzweig
67cbbf9417 panfrost: Use framebuffer pointer XML
Rather than manipulating the raw pointers. This is cleaner.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20445>
2023-03-11 06:30:02 +00:00
Alyssa Rosenzweig
1a5546293c panfrost: Add XML for framebuffer pointers
We shouldn't have to open-code these. They are real data structures, model them
as such in the architecture XML files.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20445>
2023-03-11 06:30:02 +00:00
Alyssa Rosenzweig
35985be275 panfrost: Handle fixed-point packing in GenXML
Minimum/maximum LOD and LOD bias are unsigned and signed fixed point formats
respectively. They are not unsigned integers. Introduce fixed-point types into
our GenXML and use them in the XML, rather than packing in sidebands. This makes
the XML more correct and fixes pretty-printing of texture and sampler
descriptors.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20445>
2023-03-11 06:30:02 +00:00
Alyssa Rosenzweig
17c55e0d12 panfrost: Don't use DECODE_FIXED16 for sample position
Strictly this is a signed fixed-point, anyway.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20445>
2023-03-11 06:30:02 +00:00
Alyssa Rosenzweig
e0752673be docs/panfrost: Move description of instancing
Connor Abbott wrote a nice explanation of how instance divisors work on Mali.
Let's add it to the driver docs instead of letting it languish in a forgotten
header file.

This is mostly pasted from the existing header in tree, with a few local changes
applied.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20445>
2023-03-11 06:30:02 +00:00
Alyssa Rosenzweig
07b43d6231 panfrost: Remove some unused definitions
Nowadays, formats are defined with GenXML, not the old panfrost-job.h, so most
of the format #defines in panfrost-job.h are unused. That said, a few are still
in use as a backdoor for compressed format queries to avoid a GenXML dependency.
That's not great but cleaning that up isn't the subject of this MR.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20445>
2023-03-11 06:30:02 +00:00
Felix DeGrood
341f1011a6 intel/perf: Hide extended metrics by default
XE architecture enables many more metrics, perhaps too many for
the average user. Reduce reported metrics to smaller subset,
known as non-extended metrics, by default. Can re-enable extended
metrics with env var INTEL_EXTENDED_METRICS=1

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21841>
2023-03-11 05:05:06 +00:00
Alyssa Rosenzweig
6b22a02f90 asahi,agx: Implement buffer textures with gnarly NIR
Implement buffer textures in full generality.  There are a few issues here:

* OpenGL requires buffer textures support a minimum size of 65536 elements,
  however 1D textures in AGX are (at most) 8192 elements.

* OpenGL 4.0 (and OpenGL ES) require buffer textures to support the "RGB32"
  texture formats. These are 3 packed channels of 32-bits each. In general,
  non-power-of-two texel sizes are problematic. AGX does not support any such
  formats and we rely on the GL frontend to lower to a padded format (RGBX) if
  necessary. Such a lowering cannot work for buffer textures, however, so we
  need to find a way to implement RGB32 buffer textures.

We solve these issues in the follow way:

* Use 2D texture descriptors for buffer textures, with a large fixed
  power-of-two size along one axis. Then large texel indices may be accessed at
  a small vec2 texel coordinate, and since the fixed dimension is a
  power-of-two, that vector may be recovered by simply shifting and masking.
  This effectively avoids size restriction. We do need to clamp texel indices to
  the buffer size to avoid faulting on OOB reads, since we may read past the end
  of the buffer (if the app binds a non-page-aligned offset into the buffer).

* Use a general purpose memory load for RGB32 buffer textures. Lower the texture
  load instruction to a memory load from the buffer and some address arithmetic.
  There's no format conversion needed for RGB32, other than maybe filling in a
  format-appropriate alpha, so this is straightforward. Again, we need to clamp
  the texel index for robustness with OOB reads.

Each of these solutions brings its own problem.

* Using 2D textures instead of 1D requires physically rounding up the buffer
  size when packing the descriptor, so we can no longer implement textureSize()
  by reading off the texture descriptor like normal.

* We don't know at compile-time whether a given texture load will read from an
  RGB32 buffer texture or not, so we need to emit code for both. In Vulkan, we
  can't key the shader to this property, either, since it's descriptor set state
  and not pipeline state.

And each of these problems in turn brings its own solution:

* The texture descriptor is linear, so the "compression buffer address" field is
  ignored by the hardware. We stash the real buffer size there so that
  textureSize becomes a load from the texture descriptor like usual, without
  requiring a sideband (which would complicate bindless textures).

* If we determine a texture descriptor contains RGB32 data, then it will never
  be interpreted by the hardware and hence does not need to be a valid texture
  descriptor. So, we extend the hardware's format enum to contain a
  software-defined RGB32 format enum. Then, when lowering texture buffer loads,
  we either read it as a typed RGB32 memory load or as a texture load depending
  on the value of the format field in the texture descriptor.

All of this is accomplished with a big NIR pass generating a pile of strange
looking code. But it should be good enough in practice for this silly feature.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21672>
2023-03-11 02:26:31 +00:00
Alyssa Rosenzweig
826649ba19 asahi, agx: Implement dummy samplers
In NIR, texelFetch (txf) does not use a sampler, but in AGX, it does -- even
though the contents of the sampler are semantically irrelevant. Rather than
requiring the state tracker to bind a sampler anyway (indicated for texture
buffers with PIPE_CAP_TEXTURE_BUFFER_SAMPLER), just add a dummy sampler
ourselves if txf is used and there are otherwise no samplers. This is helpful
because PIPE_CAP_TEXTURE_BUFFER_SAMPLER isn't honoured by Rusticl or seemingly
mesa/st's PBO code, and after implementing this dummy sampler workaround in
Panfrost for Rusticl, I realized this CAP is silly and shouldn't exist in the
first place. (And I regret pushing for its reinclusion.)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21672>
2023-03-11 02:26:31 +00:00
Guilherme Gallo
bc178c044e ci/baremetal: Wrap artifact download curl with xtrace
Setting `set -x`can be useful to known via trace which URL baremetal
used to download artifacts.
Today its only printed the command with the environment variables.

Also, this commit fixes multiple `section_end` for the related Gitlab
sections.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21804>
2023-03-10 21:40:23 +00:00
Guilherme Gallo
256e7888fd ci: Fix release build use for performance jobs
This commit ensures that we are using mesa release builds in performance
jobs.

To achieve that, some modifications were made on top of
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21492.

- Append the `BUILDTYPE` variable into the S3 artifact name
  (MINIO_ARTIFACT_NAME environment variable) to allow for better
  artifact management.

- The ./artifacts directory has been added to the list of artifact
  directories for build-common. This ensures that the debian-release and
  debian-arm64-release jobs are the only ones necessary for running
  performance jobs. These jobs only produce artifacts via
  prepare-artifacts.sh when we are under performance workflow.

- Make lava-submit.sh behave similar to baremetal jobs regarding
  MINIO_ARTIFACT_NAME variable. For example, users can now easily
  differentiate between mesa-arm64.tar.zstd and
  mesa-arm64-release.tar.zstd by looking inside the `Downloading
  artifacts from s3` Gitlab section.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21804>
2023-03-10 21:40:23 +00:00
José Roberto de Souza
91a129b44a iris: Move i915 submit_batch() to i915 backend
No changes in behavior intented here.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21700>
2023-03-10 20:13:56 +00:00
José Roberto de Souza
21d5034edb iris: Add batch_check_for_reset() to kmd backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21700>
2023-03-10 20:13:56 +00:00
José Roberto de Souza
e0ce31d7cf iris: Add gem_mmap() to kmd backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21700>
2023-03-10 20:13:56 +00:00
José Roberto de Souza
c5888bf610 build: Block build of HASVK, Crocus and i915 in non-x86 architectures
HASVK, Crocus and i915 drivers only supports integrated GPUs.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21773>
2023-03-10 19:41:14 +00:00
José Roberto de Souza
757e2dd692 intel/perf: Disable it for Xe KMD
Xe still don't have support for performance metrics.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21773>
2023-03-10 19:41:14 +00:00
José Roberto de Souza
266d961fdc iris: Don't mark protected bo as reusable
The check in alloc_bo_from_cache() was skiping any try to get a bo
from cache but after use a protected bo was still being put in some
cache bucket and could be used for cases that don't require a
protected bo.

Using a protected bo in cases that don't require it can have
performance implications.

So here returning NULL when trying to get a cache bucket for a
protected bo, this will cause bo->real.reusable to be set to false
avoiding the bo to be reused.

Fixes: 9402ac8023 ("iris: handle protected BO creation")
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21824>
2023-03-10 18:59:59 +00:00
Alyssa Rosenzweig
e61d6540e6 asahi: Don't allow linear depth/stencil buffers
We don't have a way to tell the ZLS hardware to use linear buffers, so if a
buffer could be used for depth/stencil, we have to twiddle. This isn't a problem
in practice, since depth/stencil buffers can't be shared across processes or
mapped directly as linear.

Fixes faults in depthstencil-render-miplevels, which was picking linear for one
buffer because of a STAGING bind flag. But that won't work :-)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21753>
2023-03-10 18:29:52 +00:00
Daniel Stone
e61d022313 ci/android: Use a more aggressive timeout for the job
This job sometimes - very, very, rarely - fails to start Cuttlefish,
the Android VM environment. Given that we don't have any structural
monitoring and restarting (unlike LAVA/BM/B2C) for this, just stick a
more aggressive timeout on the job, so it'll be retried if it fails to
start.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21837>
2023-03-10 16:39:36 +00:00
Ian Romanick
0cadc3830f nir/lower_int64: Optionally lower ufind_msb using uadd_sat
v2: Fix inverted condition for applying the optimization. Noticed by
Ken.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19042>
2023-03-10 15:27:17 +00:00
Ian Romanick
831f9d3f61 nir/algebraic: Optimize some ifind_msb to ufind_msb
On Intel platforms, the uclz lowering if ufind_msb is either one
instruction better (Gfx7 and newer) or two instructions better (all
older platforms) than the ifind_msb implementations.

On platforms that use lower_find_msb_to_reverse, there should be no
difference.

All Haswell and newer Intel platforms had similar results. (Ice Lake shown)
total instructions in shared programs: 19938662 -> 19938634 (<.01%)
instructions in affected programs: 850 -> 822 (-3.29%)
helped: 2 / HURT: 0

total cycles in shared programs: 858467067 -> 858465538 (<.01%)
cycles in affected programs: 10080 -> 8551 (-15.17%)
helped: 2 / HURT: 0

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19042>
2023-03-10 15:27:17 +00:00
Ian Romanick
db6d1edc1b nir: Restrict ufind_msb and ufind_msb_rev to 32- or 64-bit sources
4d802df3aa loosened the type restrictions
on these opcodes to enable support for 64-bit ballot operations.  In
doing so, it enabled 8-bit and 16-bit sizes as well.

It's impossible to get these sizes through GLSL or SPIR-V.  None of the
lowering in nir_opt_algebraic can handle non-32-bit sizes.  Almost no
drivers can handle non-32-bit sizes.

It doesn't seem possible to enforce anything other than "one bit size"
or "all bit sizes" in nir_opcodes.py.  The only way it seems possible to
enforce this is in nir_validate.  This is not ideal, but it be what it
be.

v2: Remove restriction on find_lsb. It is acutally possible to get this
via GLSL by doing findLSB() on a lowp value. findMSB declares its
parameter as highp, so that path is still impossible.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19042>
2023-03-10 15:27:17 +00:00
Ian Romanick
2d6f48f6ef nir/algebraic: Do not generate 8- or 16-bit find_msb
The next commit will add validation to restrict this instruction (and
others) to only 32-bit or 64-bit sources.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19042>
2023-03-10 15:27:17 +00:00
Ian Romanick
2119ab7319 nir/builder: Do not generate 8- or 16-bit find_msb
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19042>
2023-03-10 15:27:17 +00:00
Ian Romanick
28311f9d02 nir: intel/compiler: Move ufind_msb lowering to NIR
Fossil-db results:

All Intel platforms had similar results. (Ice Lake shown)
Cycles in all programs: 9098346105 -> 9098333765 (-0.0%)
Cycles helped: 6

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19042>
2023-03-10 15:27:17 +00:00
Ian Romanick
a4052e70ea nir/algebraic: Only lower ufind_msb with 32-bit sources
The 31-ufind_msb_rev(x) lowering only produces the correct result for
32-bit sources. ufind_msb_rev can also have 64-bit sources, and most
platforms are expected to lower this to 32-bit instructions with extra
logic operations.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19042>
2023-03-10 15:27:17 +00:00
Ian Romanick
08ca862ef8 intel/compiler: Tighter src and dest size bounds checking for some opcodes
Enforce the sizes listed in the Skylake PRM:

BFREV:
    source types: *D
    destination types: *D

CBIT:
    source types: UB, UW, UD
    destination types: UD

FBH:
    source types: D, UD
    destination types: UD

FBL:
    source types: UD
    destination types: UD

LZD:
    source types: D, UD
    destination types: UD

v2: Update BFREV commit message documentation. Suggested by Ken.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19042>
2023-03-10 15:27:17 +00:00
Ian Romanick
0cc7bf63b7 nir: intel/compiler: Move ifind_msb lowering to NIR
Unlike ufind_msb, ifind_msb is only defined in NIR for 32-bit values, so
no @32 annotation is required.

No shader-db or fossil-db changes on any Intel platform.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19042>
2023-03-10 15:27:17 +00:00
Ian Romanick
15c6c859cf intel/compiler: Lower find_lsb in NIR
No shader-db or fossil-db changes on any Intel platform.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19042>
2023-03-10 15:27:17 +00:00
Ian Romanick
66840b98e4 nir: ifind_msb_rev can only have int32 sources
Just like ifind_msb.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19042>
2023-03-10 15:27:17 +00:00
antonino
29be4e9e9b zink: fix stipple pattern in oblique lines
Stipple lines now appear correctly when they are oblique.

Previously the number of steps of the stipple counter between two vertices
was calculated as the euclidian distance between them in screen space, however
the length occupied by pixel along a line is only `1` for lines that are either
vertical or horizontal and will be anywhere between `1` and `sqrt(2)`
for other cases.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21290>
2023-03-10 14:52:01 +00:00
Alyssa Rosenzweig
ee6785309e agx: Handle indirect texture/samplers
Get the texture/sampler index from the texture/sampler_offset source (which
is an offset from 0 thanks to the lower_index_to_offset lowering) and feed it in
as corresponding 16-bit texture instruction sources.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21704>
2023-03-10 14:14:42 +00:00
Alyssa Rosenzweig
e12bf97153 agx: Pack indirect texture/sampler handles
For indirect indexing into the binding table. Note this does not handle packing
the bindless forms, since that's a bit more involved.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21704>
2023-03-10 14:14:42 +00:00
Erik Faye-Lund
30b456021c docs/zink: fixup wording of the GL 4.6 requirements
Seems the copy-pasta was strong in this one. Whoops!

Fixes: 5deac5c156 ("docs: document zink GL 4.6 requirements")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21813>
2023-03-10 14:02:07 +00:00
Erik Faye-Lund
d6ce7bc020 docs/zink: remove some trailing spaces
These went unnoticed until now, let's fix them.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21813>
2023-03-10 14:02:07 +00:00
Erik Faye-Lund
33d7592489 docs/zink: use vk-feat role for features
This gives us links to the features, instead of just mentioning them.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21813>
2023-03-10 14:02:06 +00:00
Erik Faye-Lund
923a41ac99 docs: implement new vk-feat role
This makes it easy to link to a specific Vulkan feature from the docs.
Useful for the Zink docs.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21813>
2023-03-10 14:02:06 +00:00
Pino Toscano
9d42e31b54 symbols-check: support OSes based on GNU toolchain
Some of the symbols listed in PLATFORM_SYMBOLS are not only specific
to Linux, but rather specific to the GNU toolchain. Hence, use them
when inspecting ELF binaries produced by a GNU toolchain: this means
on Hurd ('GNU'), and on e.g. kFreeBSD ('GNU/kFreeBSD').

Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21825>
2023-03-10 13:25:48 +00:00
Mike Blumenkrantz
e5b29e6735 Revert "Revert "ci: disable mesa-swrast runner jobs""
This reverts commit 7ae0d9d2e8.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21836>
2023-03-10 12:37:56 +00:00
Eric Engestrom
e29772f134 v3dv: split out broadcom_shader_stage_to_gl() calls to improve readability
This is an inline function with a compile-constant switch, so I expect
the compiler wouldn't produce any better code like this, but for humans
it's easier to read when function calls are not embedded into other
function calls.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21835>
2023-03-10 10:38:43 +00:00
Eric Engestrom
f5d3d1e7ed meson: inline gtest_test_protocol now that it's always 'gtest'
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21485>
2023-03-10 07:20:29 +00:00
Eric Engestrom
a18f439f52 meson: allow feature options to take true/false to mean enabled/disabled
This reduces the pain of Meson having picked inconsistent value names.

See also https://github.com/mesonbuild/meson/pull/11279 where Meson devs
argue that allowing `foo=false` could be interpreted by users to mean
either `disabled` or `auto`, which I personally don't see.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21485>
2023-03-10 07:20:29 +00:00
Eric Engestrom
049086cd58 meson: bump minimum version to 0.60
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21485>
2023-03-10 07:20:29 +00:00
Sagar Ghuge
9a34b2ab0e intel/compiler: Add swsb_stall debug option
When enabled, on gfx12 plus, we will add the sync nop instruction after
each instruction to make sure that current instruction depends on the
previous instruction explicitly.

This option will help us to get a hint if something is missing or broken
in software scoreboard pass.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21797>
2023-03-10 06:55:39 +00:00
Alyssa Rosenzweig
cdf63e6dce agx: Fix clang-formatting
Not sure how this one slipped in.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21828>
2023-03-10 06:33:01 +00:00
Emma Anholt
7ae0d9d2e8 Revert "ci: disable mesa-swrast runner jobs"
This reverts commit aef0f3efdf.

We've got a new set of runners now (mesa-swrast-4, 5, and 7 because
counting is hard)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21826>
2023-03-10 04:04:59 +00:00
Lionel Landwerlin
5aec829f97 iris: trace frames with u_trace
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21648>
2023-03-10 00:36:41 +00:00
Lionel Landwerlin
2cc9791cd3 docs: fix invalid link
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21648>
2023-03-10 00:36:40 +00:00
Kenneth Graunke
dfe652fb03 intel/eu: Simplify brw_F32TO16 and brw_F16TO32
Now that we aren't using them on Gfx8+ we can drop a lot of cruft.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21783>
2023-03-09 23:26:17 +00:00
Kenneth Graunke
c590a3eadf intel/fs: Move packHalf2x16 handling to lower_pack()
This mainly lets the software scoreboarding pass correctly mark the
instructions, without needing to resort to fragile manual handling in
the generator.

We can also make small improvements.  On Gfx 8LP-12.0, we no longer have
the restrictions about DWord alignment, so we can simply write each half
into its intended location, rather than writing it to the low DWord and
then shifting it in place.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21783>
2023-03-09 23:26:17 +00:00
Kenneth Graunke
f5e5705c91 intel/fs: Use F32TO16/F16TO32 helpers in fquantize16 handling
I originally thought that we were intentionally emitting the legacy
opcodes here to make them opaque to the optimizer, so that it wouldn't
eliminate the explicit type conversions, as they're actually required
to do the quantization.  But...we don't actually optimize those away
currently anyway.  So...go ahead and use the helpers for consistency.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21783>
2023-03-09 23:26:17 +00:00
Kenneth Graunke
44c6ccb197 Revert "intel/fs: Fix inferred_sync_pipe for F16TO32 opcodes"
With the previous patch, we no longer need to special case this, as we
emit a MOV with an HF source, rather than F16TO32 with an UW source,
on all platforms that need scoreboarding.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21783>
2023-03-09 23:26:17 +00:00
Kenneth Graunke
309ec3725a intel/fs: Use new F16TO32 helpers for unpack_half_split_* opcodes
This gets us a MOV at the IR level on Gfx8+ which should be more
optimizable than F16TO32.  It also removes confusion about which
pipe which the instruction will run on.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21783>
2023-03-09 23:26:17 +00:00
Kenneth Graunke
78bf53904e intel/fs: Delete a TODO about using brw_F32TO16.
We can just use the new builder helpers to get the optimization
advantages of a MOV on Gfx8+ while also getting the necessary F32TO16
on Gfx7.x and yet not worry too hard about it.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21783>
2023-03-09 23:26:17 +00:00
Kenneth Graunke
966995d911 intel/fs: Add builder helpers for F32TO16/F16TO32 that work on Gfx7.x
These take care of emitting the F32TO16/F16TO32 instructions on Gfx7.x
but otherwise just emit a type converting MOV on Gfx8+.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21783>
2023-03-09 23:26:17 +00:00
Kenneth Graunke
3864049184 intel/fs: Fix inferred_sync_pipe for F16TO32 opcodes
For converting half-float to float, we currently emit BRW_OPCODE_F16TO32
with a UW source, to match legacy Gfx7 behavior.  In the generator, this
becomes a MOV with a HF source on Gfx8+.  Unfortunately, this UW source
confuses the scoreboarding pass into thinking it's an integer source,
leading to incorrect SWSB annotations on Alchemist.

We should ultimately fix the IR to stop being so...legacy...here, but
this is the simplest fix for stable branches.

Fixes misrendering in Elden Ring and likely Sekiro: Shadows Die Twice.

Cc: mesa-stable
Tested-by: Chuansheng Liu <chuansheng.liu@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
References: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8018
References: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8375
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21783>
2023-03-09 23:26:17 +00:00
Mark Janes
4978db6b9e intel: use generated workaround helpers for Wa_1409600907
Wa_1409600907 was enabled for gen12+.  It should not be applied for
platforms after gen12.0.  Use generated helpers to ensure application
to all relevant platforms.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21743>
2023-03-09 22:56:51 +00:00
Chia-I Wu
5691b10b0f radv: set RADEON_FLAG_GTT_WC for external mem on vram
We used to set RADEON_FLAG_GTT_WC when wsi_info is set.  This changes it
to set the flag for any external mem on vram, extending the logic for
apps using external memory directly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21803>
2023-03-09 22:21:09 +00:00
David Heidelberg
6a1be0fb95 ci/weston: add background PID
Needed for process tracking for LAVA.

Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21711>
2023-03-09 21:06:16 +00:00
David Heidelberg
5052185039 ci/weston: before testing, verify that XWayland is really running
When Xorg already running, Weston XWayland should pick DISPLAY=:1

Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21711>
2023-03-09 21:06:16 +00:00
David Heidelberg
675f757ffb ci/lava: implement the priority
Before: kernelci 38; Mesa3D 75

Priority now:
 - 38 ‒ kernelci
 - 40 ‒ after merge and performance
 - 50 ‒ user runs
 - 75 ‒ marge-bot (MUST be prioritized)

Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21812>
2023-03-09 20:28:07 +00:00
Daniel Stone
ae893089e9 ci/radv: Lower stoney CTS load
CTS runs on stoney are currently taking ~20min to complete, which seems
to have begun with the upgrade to CTS 1.3.5.0. This is a bit too long in
and of itself, but it means that - assuming zero contention - a job that
has to be retried because the machine hung can take 40 minutes.

Aim to drop this to 15min turnaround by lowering the overall fraction
from 1/8th of the CTS to 1/11th.

As the jobs we run have been reshuffled, this adds a lot more expected
fails. As most of them categorise easily into patterns, group the
failures together in the file. Non-strict wide lines has passed since we
last ran it; the other failures all group into existing classes seen
for a long time.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21791>
2023-03-09 19:34:58 +00:00
Daniel Stone
f07c69d8b6 ci/zink: Add flake seen in the wild
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21820>
2023-03-09 19:15:13 +00:00
David Heidelberg
aef0f3efdf ci: disable mesa-swrast runner jobs
Temporarily.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21815>
2023-03-09 18:01:09 +00:00
Daniel Stone
6f1aa8cfc1 ci/fdno: Add a618 Vulkan flakes
It looks like descriptors are generically a bit broken, which takes out
a massive number of tests periodically.

The pipeline-library tests also have some unknowable issues.

cf. #8219

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21740>
2023-03-09 14:47:57 +00:00
Georg Lehmann
13ff4a5f64 aco: use bitfield_array for temporary neg/abs/opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21766>
2023-03-09 14:15:14 +00:00
Georg Lehmann
d0eebb0e8b aco: access neg/abs as int in usesModifiers
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21766>
2023-03-09 14:15:14 +00:00
Georg Lehmann
828aff2a2d aco: use array indexing for opsel/opsel_lo/opsel_hi
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21766>
2023-03-09 14:15:13 +00:00
Georg Lehmann
a47c3f84fb aco: use integer access for neg_lo/neg_hi
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21766>
2023-03-09 14:15:13 +00:00
Georg Lehmann
60cd3ba39f aco: copy abs/neg with assignment
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21766>
2023-03-09 14:15:13 +00:00
Tapani Pälli
5fdbc4a23e intel/isl: disable TILE64 for YCRCB formats
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/21723>
2023-03-09 13:50:39 +00:00
Daniel Stone
fad9c69e42 ci/radv: Drop raven quick_shader load
It currently takes ~21 minutes to complete. That's not quick.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21793>
2023-03-09 09:56:31 +00:00
Eric Engestrom
a19739f1b0 v3dv/ci: add a test to the known failures
New test since the 1.3.5 update, and running it on older mesa it would
have always failed, so it's not a regression
-> let's just mark it as a known failure

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21792>
2023-03-09 09:19:21 +00:00
Emma Anholt
ec513270e3 zink: Pass the cmdbuf to the end of the marker, too.
Otherwise the end wanders off to some unrelated cmdbuf.

Fixes: 271ebdd735 ("zink: pass cmdbuf to debug marker begin")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21799>
2023-03-09 06:53:37 +00:00
David Heidelberg
11a4e10fe2 ci/zink: fixup the zink-lvp job
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8501
Fixes: 4cc0cec473 ("ci: implement unified sections")

Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21796>
2023-03-09 06:27:39 +00:00
antonino
27c8d6ca7b drirc: set zink_emulate_point_smooth for Quake II
Quake II uses GL_POINT_SMOOTH to render particles.
Zink currently requires `zink_emulate_point_smooth` to support that feature.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21731>
2023-03-09 04:38:24 +00:00
antonino
ffe36abf7c zink: handle point_smooth emulation
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21731>
2023-03-09 04:38:24 +00:00
antonino
3a59b2a670 nir: handle output beeing written to deref in nir_lower_point_smooth
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21731>
2023-03-09 04:38:24 +00:00
antonino
4b07182c8c zink/nir_to_spirv: add support for nir_intrinsic_load_point_coord
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21731>
2023-03-09 04:38:24 +00:00
antonino
e121b6d9eb zink: add lower_point_smooth to zink_fs_key
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21731>
2023-03-09 04:38:24 +00:00
antonino
c32a5b8d04 zink: add zink_emulate_point_smooth driconf
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21731>
2023-03-09 04:38:24 +00:00
antonino
e280d6a7c9 zink: fix line smooth lowering
Fixes: 80285db9ef ("zink: lower smooth-lines if not supported")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21731>
2023-03-09 04:38:24 +00:00
Eric Engestrom
5f5e30b5bb docs: update calendar for 22.3.7
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21795>
2023-03-09 03:31:23 +00:00
Eric Engestrom
1f61bca5fe docs/relnotes: add sha256sum for 22.3.7
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21795>
2023-03-09 03:31:23 +00:00
Eric Engestrom
2488afec11 docs: add release notes for 22.3.7
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21795>
2023-03-09 03:31:23 +00:00
Dylan Baker
b8b0a0d135 docs/relnotes: add 23.0.0 to relnotes.rst
I used an old version of the script to generate the notes, which didn't
generate this. It is being kept separate instead of being squashed so
that the commits on the 23.0 branch and those on main match

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21500>
2023-03-09 03:25:31 +00:00
Dylan Baker
b687a62566 docs: Add sha256 sum for 23.0.0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21500>
2023-03-09 03:25:31 +00:00
Dylan Baker
882c4ef59b docs: add release notes for 23.0.0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21500>
2023-03-09 03:25:31 +00:00
Dylan Baker
0ad320af12 docs: Add calendar entries for 23.0 release.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21500>
2023-03-09 03:25:31 +00:00
Eric Engestrom
c28f144c81 osmesa: add exported symbols check
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1308>
2023-03-09 02:55:49 +00:00
Emma Anholt
8b75b72613 anv+hasvk: Use driconf to disable 16-bit for zink.
The HW can technically execute 16-bit operations, but the restrictions on
16-bit ALU ops are so great that it ends up not being a win for
GLES-on-Vulkan to lower mediump to 16-bit operations, at least with the
current state of the Intel compiler.  This brings zink-on-anv in line with
iris and angle-on-anv for mediump behavior (ANGLE uses RelaxedPrecision,
which we ignore).

Perf on some angle traces on my brya (ADL) and i9-9900K (CFL):

ADL zink pubg_mobile_battle_royale:  +13.4574% +/- 5.2046% (n=5)
CFL zink pubg_mobile_battle_royale:  +29.5332% +/- 0.646585% (n=6)
ADL zink aztec_ruins_high:           +5.78027% +/- 4.80645% (n=4)
CFL zink aztec_ruins_high:           -1.10641% +/- 0.140562% (n=12)
ADL zink trex_200:                   +5.86956% +/- 2.09633% (n=10)
CFL zink trex_200:                   +9.72136% +/- 0.749261% (n=10)

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21775>
2023-03-09 02:27:01 +00:00
Daniel Stone
daa1468b54 intel/isl: Don't scream FINISHME into logs for 3D vs. CCS
This would probably be a nice optimisation to have, but it really does
make the CTS logs awful:
    https://gitlab.freedesktop.org/mesa/mesa/-/jobs/37692447

Just demote this isl_finishme() to a comment; given it's been unfinished
since 2019, we can probably live without it.

Fixes: 126c9562d9 ("isl: Redefine the CCS layout for Gen12")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21788>
2023-03-09 01:36:54 +00:00
Daniel Stone
df7b40d002 ci/anv: Temporarily halve TGL testing load
Our TGL machines are currently slightly oversubscribed (max. 17 jobs in
a pipeline on 15 DUTs). They're also currently suffering from
thermally-induced GPU throttling (being investigated), and a
thundering-herd network load effect: as all 15 jobs start at once, we
end up saturating one of our network links.

The combination of all three of these things means that TGL is often our
long pole in CI runs. Until we can ameliorate the two issues
constraining throughput (and a third where an unreliable hardware UART
sometimes kills jobs when it shouldn't), halve the workload so we at
least have some breathing room to absorb them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21790>
2023-03-09 01:07:36 +00:00
Lionel Landwerlin
b801724352 util: allow align64() to do alignments >= 4Gb
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21757>
2023-03-08 23:32:37 +00:00
Lionel Landwerlin
9a058f6b4c radv: use 1ull for alignment computations
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21757>
2023-03-08 23:32:37 +00:00
Lionel Landwerlin
11bc2bde83 anv: force MEDIA_INTERFACE_DESCRIPTOR_LOAD reemit after 3D->GPGPU switch
Seems to fix a hang in the following titles :
   - Age of Empire 4
   - Monster Hunter Rise

where the HW is hung on a PIPE_CONTROL after a GPGPU_WALKER but no
MEDIA_INTERFACE_DESCRIPTOR_LOAD was emitted since the switch from 3D
to GPGPU.

This would happen in the following case :

   vkCmdBindPipeline(COMPUTE, cs_pipeline);
   vkCmdDispatch(...);
   vkCmdBindPipeline(GRAPHICS, gfx_pipeline);
   vkCmdDraw(...);
   vkCmdDispatch(...);

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17247>
2023-03-08 23:09:36 +00:00
Konstantin Seurer
d17bf881ea radv/rt: Fix updating stack_size if the shader uses scratch
src_vars contains the stack_size of the shader that is about to get inlined.

Fixes: 7fadee9b70 ('radv/rt: only reserve stack_sizes after rt_case insertion')
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21768>
2023-03-08 22:17:00 +00:00
Daniel Stone
3af675dfc1 ci/radv: Skip vkCreateInstance memory-fail test
This has been failing a bit ever since CTS 1.3.5.0. Skip it for now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21789>
2023-03-08 21:35:27 +00:00
Georg Lehmann
0614c2e8bd aco: don't reallocate fma{mk,ak,_mix} instruction
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21762>
2023-03-08 18:42:21 +00:00
Georg Lehmann
a4873071e6 aco/optimizer: don't reallocate instruction when converting to VOP3
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21762>
2023-03-08 18:42:21 +00:00
Mike Blumenkrantz
7413ce7e0d lavapipe: break out main shader lowering into separate function
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21778>
2023-03-08 18:25:01 +00:00
Mike Blumenkrantz
f2765cd6d6 lavapipe: move uniform inline functions to shader struct
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21778>
2023-03-08 18:25:01 +00:00
Mike Blumenkrantz
7718d7f31a lavapipe: rename inline uniform function params
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21778>
2023-03-08 18:25:01 +00:00
Mike Blumenkrantz
990fa82c61 lavapipe: move xfb init to shader struct
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21778>
2023-03-08 18:25:01 +00:00
Mike Blumenkrantz
b221f6c128 lavapipe: more small shader struct usage tweaks
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21778>
2023-03-08 18:25:01 +00:00
Mike Blumenkrantz
a0c9609e59 lavapipe: pass shader struct and layout to scan_pipeline_info()
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21778>
2023-03-08 18:25:01 +00:00
Mike Blumenkrantz
6e5fe71599 lavapipe: split out shader struct members into their own struct
kinda gross but simplifies some code

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21778>
2023-03-08 18:25:01 +00:00
Mike Blumenkrantz
2af3476639 lavapipe: split out spirv compile of shaders
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21778>
2023-03-08 18:25:01 +00:00
Mike Blumenkrantz
bf1b4ed54e vulkan/wsi: fix crash in failed swapchain creation for wayland
this otherwise calls wsi_wl_swapchain_chain_free() before the wsi
pointer has been set

ref #6578

cc: mesa-stable

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21563>
2023-03-08 17:33:00 +00:00
Daniel Schürmann
41ae2d0725 radv/rt: use terminate() when returning from raygen shaders
Q2RTX stats:
Totals from 7 (0.01% of 134913) affected shaders:

CodeSize: 204712 -> 204744 (+0.02%); split: -0.06%, +0.07%
Instrs: 37526 -> 37522 (-0.01%); split: -0.07%, +0.06%
Latency: 950563 -> 956024 (+0.57%)
InvThroughput: 187915 -> 188977 (+0.57%)
Copies: 4829 -> 4763 (-1.37%)
Branches: 1570 -> 1583 (+0.83%)
PreSGPRs: 407 -> 400 (-1.72%)
PreVGPRs: 614 -> 617 (+0.49%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21736>
2023-03-08 16:59:41 +00:00
Daniel Schürmann
cd1e5b1858 aco: fix NIR infinite loops
The previous solution breaks potential loop header phis.
Move the dummy-break to the bottom of the loop.

Fixes: dEQP-VK.reconvergence.subgroup_uniform_control_flow_ballot.*
Fixes: a9c4a31d8d ('aco: handle NIR loops without breaks')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21736>
2023-03-08 16:59:41 +00:00
Daniel Schürmann
3073810397 nir/gather_info: allow terminate() in non-PS
RADV will use terminate() to end ray-tracing shaders.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21736>
2023-03-08 16:59:41 +00:00
Samuel Pitoiset
842b8f14f4 radv: move device memory related code to radv_device_memory.c
radv_device.c is getting too big.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21767>
2023-03-08 16:21:10 +00:00
Samuel Pitoiset
4316a64e27 radv: move buffer related code to radv_buffer.c
radv_device.c is getting too big and this follows the Vulkan common
runtime infrastructure.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21767>
2023-03-08 16:21:10 +00:00
Samuel Pitoiset
17c5a91028 radv: move event related code to radv_event.c
radv_device.c is getting too big.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21767>
2023-03-08 16:21:10 +00:00
Samuel Pitoiset
4de305cb8a radv: move sampler related code to radv_sampler.c
radv_device.c is getting too big and this follows the Vulkan common
runtime infrastructure.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21767>
2023-03-08 16:21:10 +00:00
Samuel Pitoiset
7a157b3a4c radv: move queue related code to radv_queue.c
radv_device.c is getting too big and this follows the Vulkan common
runtime infrastructure.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21767>
2023-03-08 16:21:10 +00:00
Samuel Pitoiset
4e5db63482 radv: move physical device related code to radv_physical_device.c
radv_device.c is getting too big and this follows the Vulkan common
runtime infrastructure.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21767>
2023-03-08 16:21:10 +00:00
Samuel Pitoiset
06fa90e14e radv: move instance related code to radv_instance.c
radv_device.c is getting too big and this follows the Vulkan common
runtime infrastructure.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21767>
2023-03-08 16:21:10 +00:00
Rhys Perry
98cb7e0108 nir: add nir_lower_alu_width_test.fdot_order
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/20812>
2023-03-08 14:38:26 +00:00
Rhys Perry
50f7e21481 nir: make fdph lowering match fdot
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/20812>
2023-03-08 14:38:26 +00:00
Rhys Perry
3668da7c83 nir: use xyzw order for precise fdot
Fixes flickering grass in Immortals Fenyx Rising.

fossil-db (gfx1100):
Totals from 13969 (10.38% of 134574) affected shaders:
MaxWaves: 442794 -> 442878 (+0.02%)
Instrs: 4861105 -> 4901408 (+0.83%); split: -0.02%, +0.85%
CodeSize: 24316100 -> 24396272 (+0.33%); split: -0.03%, +0.35%
VGPRs: 446256 -> 445572 (-0.15%); split: -0.20%, +0.05%
Latency: 28122456 -> 28162233 (+0.14%); split: -0.10%, +0.24%
InvThroughput: 2899673 -> 2904323 (+0.16%); split: -0.07%, +0.23%
VClause: 119599 -> 119631 (+0.03%); split: -0.07%, +0.09%
SClause: 186636 -> 186265 (-0.20%); split: -0.23%, +0.03%
Copies: 301370 -> 300386 (-0.33%); split: -0.75%, +0.42%
Branches: 85066 -> 85047 (-0.02%); split: -0.02%, +0.00%
PreSGPRs: 436167 -> 436137 (-0.01%)
PreVGPRs: 329715 -> 329809 (+0.03%); split: -0.01%, +0.04%

fossil-db (gfx1100, RADV_DEBUG=invariantgeom):
Totals from 43116 (32.04% of 134574) affected shaders:
MaxWaves: 1332938 -> 1333012 (+0.01%); split: +0.01%, -0.00%
Instrs: 16424513 -> 16658021 (+1.42%); split: -0.06%, +1.48%
CodeSize: 81258868 -> 81827860 (+0.70%); split: -0.07%, +0.77%
VGPRs: 1720368 -> 1719648 (-0.04%); split: -0.19%, +0.15%
SpillSGPRs: 1670 -> 1600 (-4.19%); split: -5.27%, +1.08%
Latency: 82063766 -> 82425418 (+0.44%); split: -0.23%, +0.67%
InvThroughput: 9665803 -> 9727810 (+0.64%); split: -0.09%, +0.73%
VClause: 449662 -> 451099 (+0.32%); split: -0.32%, +0.64%
SClause: 498841 -> 498639 (-0.04%); split: -0.24%, +0.20%
Copies: 1001020 -> 1000770 (-0.02%); split: -1.20%, +1.17%
Branches: 237580 -> 239637 (+0.87%); split: -0.01%, +0.88%
PreSGPRs: 1198167 -> 1198024 (-0.01%); split: -0.01%, +0.00%
PreVGPRs: 1225202 -> 1225035 (-0.01%); split: -0.06%, +0.05%

fossil-db (navi10):
Totals from 13969 (10.38% of 134563) affected shaders:
MaxWaves: 474386 -> 474508 (+0.03%); split: +0.05%, -0.03%
Instrs: 3740895 -> 3771566 (+0.82%); split: -0.00%, +0.82%
CodeSize: 19426592 -> 19459916 (+0.17%); split: -0.00%, +0.18%
VGPRs: 389916 -> 389852 (-0.02%); split: -0.09%, +0.07%
Latency: 25452927 -> 25502482 (+0.19%); split: -0.14%, +0.34%
InvThroughput: 3880807 -> 3923144 (+1.09%); split: -0.07%, +1.16%
VClause: 66835 -> 66712 (-0.18%); split: -0.38%, +0.20%
SClause: 178805 -> 178802 (-0.00%); split: -0.01%, +0.01%
Copies: 167601 -> 167625 (+0.01%); split: -0.54%, +0.56%
Branches: 83788 -> 83784 (-0.00%)
PreSGPRs: 388229 -> 388216 (-0.00%)
PreVGPRs: 342984 -> 343062 (+0.02%); split: -0.01%, +0.03%

fossil-db (navi10, RADV_DEBUG=invariantgeom):
Totals from 43116 (32.04% of 134563) affected shaders:
MaxWaves: 1260184 -> 1256414 (-0.30%); split: +0.10%, -0.40%
Instrs: 12804951 -> 12983628 (+1.40%); split: -0.01%, +1.41%
CodeSize: 65813224 -> 66137852 (+0.49%); split: -0.03%, +0.52%
VGPRs: 1556396 -> 1561340 (+0.32%); split: -0.09%, +0.41%
SpillSGPRs: 1377 -> 1395 (+1.31%)
Latency: 76095867 -> 76355111 (+0.34%); split: -0.32%, +0.66%
InvThroughput: 13546863 -> 13788789 (+1.79%); split: -0.05%, +1.84%
VClause: 310910 -> 311283 (+0.12%); split: -0.63%, +0.75%
SClause: 474878 -> 474941 (+0.01%); split: -0.09%, +0.10%
Copies: 639367 -> 637610 (-0.27%); split: -1.03%, +0.76%
Branches: 240178 -> 240185 (+0.00%); split: -0.00%, +0.00%
PreSGPRs: 1056594 -> 1056590 (-0.00%); split: -0.00%, +0.00%
PreVGPRs: 1247950 -> 1247798 (-0.01%); split: -0.05%, +0.04%

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/7920
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20812>
2023-03-08 14:38:26 +00:00
Mike Blumenkrantz
6ee5337d94 aux/tc: fix rp info resizing clobbering current info
the recording rp_info may be a pointer to a member of the array being
reallocated, so test for this and re-set it to avoid invalid memory
access

found with this caselist:
KHR-GL46.texture_gather.offset-gather-unorm-2darray
KHR-GL46.texture_view.view_sampling

cc: mesa-stable

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21729>
2023-03-08 14:10:01 +00:00
Lionel Landwerlin
10057d19f2 anv: report max register pressure in pipeline properties
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21756>
2023-03-08 13:37:07 +00:00
Lionel Landwerlin
09cdb77a92 intel/fs: report max register pressure in shader stats
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21756>
2023-03-08 13:37:07 +00:00
Lionel Landwerlin
8dd960e056 anv/iris: report counter symbols with debug option
v2: rename to INTEL_DEBUG=perf-symbol-names

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17672>
2023-03-08 12:45:43 +00:00
Samuel Pitoiset
e6735409ee radv: disable DCC with signedness reinterpretation on GFX11
All formats should be compatible on GFX11 but for some weird reasons
DCC with signedness reinterpretation doesn't work as expected, like
R8_UINT<->R8_SINT. Note that RadeonSI also has issues with this.

This might be a hardware bug on RDNA3.

This fixes DCC issues with Cyberpunk and A Plague Tale: Requiem.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8020
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8371
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21755>
2023-03-08 11:53:25 +00:00
Pierre-Eric Pelloux-Prayer
79ab787a8f radeonsi: fix fast depth_clear_value/stencil_clear_value
We need to update the when promoting from non-TC-compatible to
TC-compatible or we'll get incorrect values in the buffer.

Fixes: 9defe8aca9 ("radeonsi: implement fast Z/S clears using clear_buffer on HTILE")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8418
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21726>
2023-03-08 10:56:21 +00:00
Pierre-Eric Pelloux-Prayer
b75acbf88f radeonsi: don't use PKT3_SET_SH_REG_INDEX on gfx9 and older
Fixes: ccaaf8fe04 ("amd: massively simplify how info->spi_cu_en is applied")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8464
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21726>
2023-03-08 10:56:21 +00:00
Pierre-Eric Pelloux-Prayer
49913fa418 radeonsi/test: update test results
Depends on https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/779
to fix glx-make-current GLX errors.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21726>
2023-03-08 10:56:21 +00:00
Pierre-Eric Pelloux-Prayer
9eb05801ad radeonsi/test: use gbm-skips.txt
Use shared skips file to avoid running tests that can't pass on gbm.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21726>
2023-03-08 10:56:21 +00:00
Samuel Pitoiset
f88dbb27d4 radv: enable VK_KHR_fragment_shading_rate on GFX11
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20333>
2023-03-08 10:30:48 +00:00
Samuel Pitoiset
1fb8e0eff2 radv: advertise attachmentFragmentShadingRate on GFX11
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20333>
2023-03-08 10:30:48 +00:00
Samuel Pitoiset
d1e724b952 radv: do not emit PA_SC_VRS_OVERRIDE_CNTL from the pipeline on GFX11
PA_SC_VRS_OVERRIDE_CNTL is emitted when a framebuffer is bound because
it controls the VRS surface enable bit. Though, if a pipeline is bound
after the framebuffer is emitted, it can override the state. Remove it
completely since VRS for flat shading and RADV_FORCE_VRS are disabled.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20333>
2023-03-08 10:30:48 +00:00
Samuel Pitoiset
c186420b26 radv: add support for VRS attachment on GFX11
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20333>
2023-03-08 10:30:48 +00:00
Samuel Pitoiset
31d699106d ac/surface: add RADEON_SURF_VRS_RATE for selecting swizzle mode on GFX11
On GFX11, VRS rate images can't use linear tiling and the swizzle mode
must be either SW_Z or SW_R.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20333>
2023-03-08 10:30:48 +00:00
Samuel Pitoiset
ce4a1b1c3c radv: move disabling DCC for VRS rate images in radv_get_surface_flags()
On GFX11, the VRS rate image needs a specific swizzle mode and a new
flag will be added here.

gned-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20333>
2023-03-08 10:30:48 +00:00
Lionel Landwerlin
e8793f2a86 anv: enable VK_EXT_pipeline_library_group_handles
A noop for us.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20929>
2023-03-08 08:59:52 +00:00
Marek Olšák
461ccb00e1 radeonsi: increase NGG workgroup size to 256 for VS/TES with streamout and GS
NGG streamout performance is limited by the workgroup size, so make it as
large as possible.

Since this uses si_get_max_workgroup_size() to set the NGG workgroup size,
the side effect is that all GS is also getting an increase to 256, which
is OK.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21403>
2023-03-08 07:29:09 +00:00
Marek Olšák
43fd552872 radeonsi: allow using 64K LDS for NGG to allow larger workgroups
This should help with NGG streamout performance, which is limited by
the workgroup size (it should be as large as possible).

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21403>
2023-03-08 07:29:09 +00:00
Marek Olšák
e01d505291 radeonsi: other cosmetic changes in si_state_shaders.cpp
VS_W32_EN has no effect on Gfx11, but we better not set it.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21403>
2023-03-08 07:29:09 +00:00
Marek Olšák
ef965d5681 radeonsi: reorganize si_shader_ps
To make branching based on gfx_level nicer and the code in a logical order.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21403>
2023-03-08 07:29:09 +00:00
Marek Olšák
c9d297fc77 radeonsi: reorganize si_shader_ngg
To make branching based on gfx_level nicer and the code in a logical order.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21403>
2023-03-08 07:29:09 +00:00
Marek Olšák
1664aad43c radeonsi: reorganize si_shader_hs
To make branching based on gfx_level nicer and the code in a logical order.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21403>
2023-03-08 07:29:09 +00:00
Marek Olšák
b3459eae7a radeonsi: reindent si_shader_ls, si_shader_es, si_shader_gs, si_shader_vs
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21403>
2023-03-08 07:29:09 +00:00
Marek Olšák
7e0ed2c4f0 radeonsi: set pm4.atom.emit in si_get_shader_pm4_state
except gfx10_shader_ngg, which isn't as trivial

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21403>
2023-03-08 07:29:09 +00:00
Marek Olšák
4c1475fc1c radeonsi: lower nir_texop_sampler_descriptor_amd
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21403>
2023-03-08 07:29:09 +00:00
Marek Olšák
1417ced72c radeonsi: separate nir_texop_descriptor_amd lowering
This moves the code to a separate branch to make it less intertwined
with the rest to allow sampler descriptor lowering later.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21403>
2023-03-08 07:29:09 +00:00
Marek Olšák
54ebd90739 radeonsi: merge si_emit_initial_compute_regs with si_init_cs_preamble_state
It's better to set all immutable registers in one place.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21403>
2023-03-08 07:29:09 +00:00
Marek Olšák
ddded6fbb5 radeonsi: emulate VGT_ESGS_RING_ITEMSIZE in the shader on gfx9-11
The hardware uses the register to premultiply GS vertex indices
in input VGPRs.

This changes the behavior as follows:
- VGT_ESGS_RING_ITEMSIZE is always 1 on gfx9-11, set in the preamble.
- The value is passed to the shader via current_gs_state (vs_state_bits).
- The shader does the multiplication.

The reason is that VGT_ESGS_RING_ITEMSIZE will be removed in the future.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21403>
2023-03-08 07:29:09 +00:00
Timur Kristóf
fb819fdb13 ac/nir: clear nir_var_shader_out from TCS barriers
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21403>
2023-03-08 07:29:09 +00:00
Timur Kristóf
87de5b2b9e aco: Don't include headers from radv.
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/21696>
2023-03-08 04:39:18 +00:00
Timur Kristóf
a0141c6308 aco, radv: Don't use radv_shader_args in aco.
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/21696>
2023-03-08 04:39:18 +00:00
Timur Kristóf
e9793331db aco, radv: Move PS epilog and VS prolog args to their info structs.
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/21696>
2023-03-08 04:39:18 +00:00
Timur Kristóf
84a2cea596 aco, radv: Rename aco_*_key to aco_*_info.
The naming of aco_*_key didn't make sense because they
were never actually used as cache keys, only radv_*_key
are used as cache keys.

Rename the aco structs to aco_*_info instead.

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/21696>
2023-03-08 04:39:18 +00:00
Qiang Yu
91e68db0e1 aco, radv: Move is_trap_handler_shader to aco info.
v2 by Timur Kristóf:
- Rebase this patch on latest main.

Signed-off-by: Qiang Yu <yuq825@gmail.com>
Reviewed-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/21696>
2023-03-08 04:39:18 +00:00
Qiang Yu
978220c99a aco, radv: Add load_grid_size_from_user_sgpr to aco options.
v2 by Timur Kristóf:
- Rebase this patch.

Signed-off-by: Qiang Yu <yuq825@gmail.com>
Reviewed-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/21696>
2023-03-08 04:39:18 +00:00
Timur Kristóf
3058ab6090 aco: Generalize vs_inputs to args_pending_vmem.
Handle arguments that need a waitcnt without relying on
RADV specific VS input information.

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/21696>
2023-03-08 04:39:18 +00:00
Timur Kristóf
1583bea9da radv: Set pending_vmem on dynamic VS input args.
These are loaded from VMEM and need a waitcnt before use.

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/21696>
2023-03-08 04:39:18 +00:00
Timur Kristóf
1a7b5979df ac: Add pending_vmem field to args.
This is to indicate when an argument was loaded from VMEM
and needs a waitcnt before it can be used.

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/21696>
2023-03-08 04:39:18 +00:00
Rob Clark
d5376c3feb freedreno: Promote non-drawing batches to sysmem
Sometimes we can end up with a sequence where we need to flush a batch
with no clears and no draws (for ex, to get a fence).  Promote these to
sysmem.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21747>
2023-03-08 04:10:45 +00:00
Mike Blumenkrantz
aaed609e57 zink: hook up buffer TRANSFER_DST barrier optimizing
this should massively optimize e.g., incremental index buffer overwrites

ref #8358

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21779>
2023-03-08 03:50:33 +00:00
Mike Blumenkrantz
fe469a7618 zink: add a driver workaround to disable copy box optimizations
turnip is nonconformant regarding cache access (see noted issue),
meaning that any attempt to omit barriers breaks things

qcom proprietary may also be affected

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21779>
2023-03-08 03:50:33 +00:00
Mike Blumenkrantz
46f98da188 zink: add a mechanism to trigger copy box resets from batch state reset
the resource isn't available during batch state reset, so a new flag
is needed to force a reset the next time the copy boxes would be used

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21779>
2023-03-08 03:50:33 +00:00
Mike Blumenkrantz
aaca91eb79 zink: add a mechanism for managing TRANSFER_DST buffer barriers
this enables successive or unrelated transfer writes to avoid triggering
barriers, and ensuing reads of those writes should trigger their own
barriers

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21779>
2023-03-08 03:50:33 +00:00
Mike Blumenkrantz
54f3c589d5 zink: track the last write access for resources
this enables some optimization

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21779>
2023-03-08 03:50:33 +00:00
SureshGuttula
30a89323ad radeonsi: Add support for DPB resize
This patch will add support for dpb resize when low to high resolution
change/ svc use-cases.

With DPB tier1 type,vp9 svc decoder use cases are failed. This
Change will fix this[VCN1/VCN2].

Signed-off-by: SureshGuttula <suresh.guttula@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21548>
2023-03-08 02:19:58 +00:00
Rose Hudson
e54ec96f35 asahi: disable disk cache in debug runs
With debug flags enabled, shaders might get compiled differently and
running compilation might be desired e.g. for logging, so don't try to
cache them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21776>
2023-03-08 02:07:44 +00:00
Rose Hudson
5e9538c12e agx: isolate compiler debug flags
The gallium disk cache is about to depend on these, and I don't want to
create a dependency on agx_opcodes.h.py for that. So, make a new header
for them that doesn't have build dependencies.
Rename them to agx_compiler_* too, to avoid collisions with the other
driver debug flags.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21776>
2023-03-08 02:07:44 +00:00
Väinö Mäkelä
78d742290b intel/ci: Remove skipped float_controls tests from hasvk xfails
These tests are skipped now because preserving denorms isn't supported.

Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21719>
2023-03-08 01:46:00 +00:00
Väinö Mäkelä
840b4b856e intel/ci: Remove hasvk xfails missing from the CTS
These broken tests no longer exist in the CTS and all dynamic rendering
tests pass now.

Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21719>
2023-03-08 01:46:00 +00:00
Väinö Mäkelä
82a78b7e9f intel/ci: Remove outdated hasvk copy_and_blit xfails
These were fixed by commit e509afac.

Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21719>
2023-03-08 01:46:00 +00:00
Patrick Lerda
ff7446ba0c mesa/program: fix memory leak triggered by arb alias
The function _mesa_symbol_table_add_symbol() copies the string with strdup(),
the original string should be freed.

For instance, with "piglit/fp-fragment-position -auto -fbo":
Direct leak of 7 byte(s) in 1 object(s) allocated from:
    #0 0xffff99c59050 in __interceptor_strdup (/usr/lib64/libasan.so.6+0x59050)
    #1 0xffff8f53d24c in handle_ident ../src/mesa/program/program_lexer.l:129
    #2 0xffff8f53d24c in _mesa_program_lexer_lex ../src/mesa/program/program_lexer.l:312
    #3 0xffff8f529d10 in yylex ../src/mesa/program/program_parse.y:289
    #4 0xffff8f529d10 in yyparse src/mesa/program/program_parse.tab.c:2140
    #5 0xffff8f5341a4 in _mesa_parse_arb_program ../src/mesa/program/program_parse.y:2589
    #6 0xffff8f51e96c in _mesa_parse_arb_fragment_program ../src/mesa/program/arbprogparse.c:82
    #7 0xffff8f4d867c in set_program_string ../src/mesa/main/arbprogram.c:402

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21728>
2023-03-07 23:11:29 +00:00
Patrick Lerda
a692fe418e mesa/program: fix memory leak triggered by multiple targets used on one texture image unit
For instance, with "piglit-2000/bin/asmparsertest ARBfp1.0 tests/asmparsertest/shaders/ARBfp1.0/shadow-02.txt":
Direct leak of 192 byte(s) in 2 object(s) allocated from:
    #0 0x7f6e8378f987 in calloc (/usr/lib64/libasan.so.6+0xb1987)
    #1 0x7f6e7769d620 in asm_instruction_copy_ctor ../src/mesa/program/program_parse.y:2146
    #2 0x7f6e7769d620 in yyparse ../src/mesa/program/program_parse.y:439
    #3 0x7f6e776a6725 in _mesa_parse_arb_program ../src/mesa/program/program_parse.y:2590
    #4 0x7f6e77687f69 in _mesa_parse_arb_fragment_program ../src/mesa/program/arbprogparse.c:82
    #5 0x7f6e77630765 in set_program_string ../src/mesa/main/arbprogram.c:402
    #6 0x7f6e76ec3e8a in _mesa_unmarshal_ProgramStringARB src/mapi/glapi/gen/marshal_generated2.c:4152
    #7 0x7f6e76a0e585 in glthread_unmarshal_batch ../src/mesa/main/glthread.c:122
    #8 0x7f6e76a1031d in _mesa_glthread_finish ../src/mesa/main/glthread.c:383
    #9 0x7f6e76a1031d in _mesa_glthread_finish ../src/mesa/main/glthread.c:348
    #10 0x7f6e76e6a062 in _mesa_marshal_GetError src/mapi/glapi/gen/marshal_generated1.c:1809

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21728>
2023-03-07 23:11:29 +00:00
Patrick Lerda
444250a5e7 mesa/program: fix memory leak triggered by invalid extended swizzle selector
For instance, with "piglit/bin/asmparsertest ARBfp1.0 tests/asmparsertest/shaders/ARBfp1.0/swz-04.txt":
Direct leak of 18 byte(s) in 2 object(s) allocated from:
    #0 0x7f97e99050 in __interceptor_strdup (/usr/lib64/libasan.so.6+0x59050)
    #1 0x7f8d4160ac in handle_ident ../src/mesa/program/program_lexer.l:129
    #2 0x7f8d4160ac in _mesa_program_lexer_lex ../src/mesa/program/program_lexer.l:312
    #3 0x7f8d402b50 in yylex ../src/mesa/program/program_parse.y:289
    #4 0x7f8d402b50 in yyparse src/mesa/program/program_parse.tab.c:2140
    #5 0x7f8d40d01c in _mesa_parse_arb_program ../src/mesa/program/program_parse.y:2590
    #6 0x7f8d3f77ac in _mesa_parse_arb_fragment_program ../src/mesa/program/arbprogparse.c:82
    #7 0x7f8d3ad468 in set_program_string ../src/mesa/main/arbprogram.c:402

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21728>
2023-03-07 23:11:29 +00:00
Georg Lehmann
57557e8815 aco/assembler/gfx11: simplify 16bit VOP12C promotion to VOP3
With the shared struct for modifies, this is can be a lot cleaner now.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21761>
2023-03-07 22:38:39 +00:00
Marek Olšák
ae50b66251 radeonsi/gfx11: only allocate GDS OA for streamout, GDS memory is not needed
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21584>
2023-03-07 22:08:47 +00:00
Marek Olšák
61da19a262 amd/llvm,radeonsi/gfx11: switch to using GDS_STRMOUT registers
This is required by register shadowing (required by the new PAIRS packets),
preemption, user queues, and we only have to wait for VS after streamout,
not PS. This is how gfx11 streamout should have been done.

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21584>
2023-03-07 22:08:47 +00:00
Marek Olšák
f7076d129d amd: add nir_intrinsic_xfb_counter_sub_amd and fix overflowed streamout offsets
Fixes: 5ec79f9899 - ac/nir/ngg: nogs support streamout

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21584>
2023-03-07 22:08:47 +00:00
Mark Janes
08649e3673 intel/fs: use generated workaround helpers for Wa_14017989577
Wa_14017989577 is a clone of Wa_14015360517, which applies to several
platforms beyond INTEL_PLATFORM_DG2_G10.

Update references to Wa_14017989577, and use the generated workaround
helper to ensure application to the proper platforms.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21744>
2023-03-07 21:43:11 +00:00
Emma Anholt
5fd9abae90 ci/etnaviv: Drop the dEQP-GLES2.functional.uniform_api.random.94 xfail.
This has been consistently passing.  I think I just missed it in my
previous update.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21769>
2023-03-07 21:03:33 +00:00
Emma Anholt
d52cf80bcb ci: Add some xfail updates from VKCTS 1.3.5.0 for the manual jobs.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21769>
2023-03-07 21:03:33 +00:00
Mike Blumenkrantz
53da1534b5 llvmpipe: fix LP_PERF=no_depth to ignore depth format
cc: mesa-stable

Reviewed-by: Brian Paul brianp@vmware.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21582>
2023-03-07 20:42:43 +00:00
Juan A. Suarez Romero
baff509924 v3d/v3dv: define performance counters in common
Both OpenGL and Vulkan drivers share the same performance counters.

Let's move them to a common place instead of duplicating.

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/21420>
2023-03-07 18:57:41 +00:00
Antonio Gomes
161e3f29f4 iris: Add support for 2d images created from buffers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20378>
2023-03-07 18:24:56 +00:00
Antonio Gomes
4f096d0d88 llvmpipe: Add new caps PIPE_CAP_LINEAR_IMAGE_(PITCH_ALIGNMENT|BASE_ADDRESS_ALIGNMENT)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20378>
2023-03-07 18:24:56 +00:00
Antonio Gomes
06daa03c5c rusticl: Implement spec for cl_khr_image2d_from_buffer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20378>
2023-03-07 18:24:56 +00:00
Antonio Gomes
010c18c443 gallium: Add new caps PIPE_CAP_LINEAR_IMAGE_(PITCH_ALIGNMENT|BASE_ADDRESS_ALIGNMENT)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20378>
2023-03-07 18:24:56 +00:00
Antonio Gomes
7839341d8f lvmpipe/cs: Add support for 2d images created from buffers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20378>
2023-03-07 18:24:56 +00:00
Antonio Gomes
9cbdf3673b mesa/st, nine, nouveau: Fix uninitialized pipe_sampler_view structs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20378>
2023-03-07 18:24:56 +00:00
Antonio Gomes
cc36fd0f61 gallium, rusticl: Add tex2d_from_buf in image_view and sampler_view
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20378>
2023-03-07 18:24:56 +00:00
Antonio Gomes
07270ece45 rusticl: Enable mapImage for images created from buffers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20378>
2023-03-07 18:24:56 +00:00
Antonio Gomes
9dda1e4872 rusticl: Enable copy for images created from buffers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20378>
2023-03-07 18:24:56 +00:00
Antonio Gomes
3c51db3f21 rusticl: Enabling image fill for images created from buffers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20378>
2023-03-07 18:24:56 +00:00
Antonio Gomes
e40fd3bd60 rusticl: Enabling reading/writing for images created from buffers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20378>
2023-03-07 18:24:56 +00:00
Daniel Schürmann
26f430d6ce radv/rt: move radv_pipeline_key from rt_variables to traversal_data
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21764>
2023-03-07 17:00:50 +00:00
Daniel Schürmann
d87bbee0be radv: remove unused parameters from radv_compute_pipeline_compile()
Also make this function static.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21764>
2023-03-07 17:00:50 +00:00
Daniel Schürmann
d06aa7b71d radv/rt: introduce and use radv_rt_pipeline_compile()
This is essentially a code-duplication of radv_compute_pipeline_compile()
but will later be more specialized for the needs of RT pipelines.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21764>
2023-03-07 17:00:50 +00:00
Daniel Schürmann
f1565de4cc radv: expose radv_pipeline_capture_shaders()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21764>
2023-03-07 17:00:50 +00:00
Daniel Schürmann
2fbd495ce7 radv: expose radv_postprocess_nir()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21764>
2023-03-07 17:00:50 +00:00
Samuel Pitoiset
c87c34bbba radv: fix defining RADV_USE_WSI_PLATFORM
RADV_USE_WSI_PLATFORM was unused in radv_CreateImage().

Fixes: 2a5d7f4926 ("radv: fix missing implementation of creating images from swapchains")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21763>
2023-03-07 16:37:17 +00:00
José Roberto de Souza
a6dcd62f44 iris: Move iris_bo_wait_gem() to i915/iris_bufmgr.c
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21494>
2023-03-07 16:16:10 +00:00
José Roberto de Souza
97becc1b6f iris: Move iris_bo_busy_gem() to i915/iris_bufmgr.c
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21494>
2023-03-07 16:16:10 +00:00
José Roberto de Souza
7553d921f6 iris: Move bo_set_caching to kmd backend
For the platforms that call it, it a function in the hot path so
moving it to kmd backend.

After this patch i915/iris_bufmgr.c is empty but not removing it
as next patch will add functions to it.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21494>
2023-03-07 16:16:10 +00:00
José Roberto de Souza
bdfcc98001 iris: Move bo_madvise to kmd backend
bo_madvise() is on hot path, so moving it to kmd backend.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21494>
2023-03-07 16:16:10 +00:00
José Roberto de Souza
d636e772c0 intel/common: Implement the Xe functions for intel_gem
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21699>
2023-03-07 15:41:36 +00:00
José Roberto de Souza
19aa1fb851 intel/common: Implement the Xe functions for intel_engine
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21699>
2023-03-07 15:41:36 +00:00
Samuel Pitoiset
7b2086d741 radv: fix border color swizzle for stencil-only format on GFX9+
Swizzle of 8-bit stencil format is defined as _x__ but the hw expects
BC_SWIZZLE_XYZW.

Fixes dEQP-VK.pipeline.monolithic.sampler.border_swizzle.*s8_uint*.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21482>
2023-03-07 15:10:33 +00:00
Tapani Pälli
889c3ee6b8 anv: fix sends_count_expectation assert on simd32
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/21758>
2023-03-07 14:37:31 +00:00
Yogesh Mohan Marimuthu
347a5b79f9 ac/surface: only adjust pitch if surf_pitch was modified
Modifying pitch for all LINEAR surface isn't correct;
the original change that modified surf_pitch was only
intended for YUV textures.

This fixes vkGetImageSubresourceLayout rowPitch return value
for VK_FORMAT_BC3_UNORM_BLOCK + VK_IMAGE_TILING_LINEAR.

Fixes: fcc499d5 (ac/surface: adjust gfx9.pitch[*] based on surf->blk_w)

v2: add check for UYVY format (Pierre-Eric)
v3: move blk_w division to above if check (Pierre-Eric)

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/21595>
2023-03-07 13:50:31 +00:00
David Heidelberg
f72774f13f ci/lavapipe: fixes typo
Fixes: 5ee724e180 ("ci/lavapipe: add recent occasional flake")

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21759>
2023-03-07 13:26:52 +00:00
Georg Lehmann
de4805f25f aco: use bitfield array helpers for valu modifiers
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21023>
2023-03-07 11:53:23 +00:00
Georg Lehmann
e7559da757 aco: add bitfield array helper classes
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21023>
2023-03-07 11:53:23 +00:00
Georg Lehmann
097a97cc42 aco: remove VOP[123C]P? structs
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/21023>
2023-03-07 11:53:23 +00:00
Georg Lehmann
08542318e7 aco/optimizer: simplify using VALU instruction
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/21023>
2023-03-07 11:53:23 +00:00
Georg Lehmann
4591703e79 aco/print_ir: simplify using VALU instruction
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/21023>
2023-03-07 11:53:23 +00:00
Georg Lehmann
17ff2e8c52 aco: validate VALU modifiers
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/21023>
2023-03-07 11:53:23 +00:00
Georg Lehmann
fc193ab4db aco/ra: set opsel_hi to zero when converting to VOP2
Otherwise the new modifier validation will fail.

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/21023>
2023-03-07 11:53:23 +00:00
Georg Lehmann
366cf4efaa aco/ir: rework IR to have one common valu instruction struct
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/21023>
2023-03-07 11:53:23 +00:00
Georg Lehmann
77afe7d960 aco: treat VINTERP_INREG as VALU
It's just v_fma with fixed DPP8 and builtin s_waitcnt_expcnt, so it can mostly
be handled as a pure VALU instruction.

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/21023>
2023-03-07 11:53:23 +00:00
Samuel Pitoiset
c119b19f98 radv: fix incorrect stride for primitives generated query with GDS
When the query pool uses GDS (for NGG), the stride is 40.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8412
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21650>
2023-03-07 10:15:35 +01:00
Lionel Landwerlin
a278eeb719 nir: fix nir_ishl_imm
Both GLSL & SPIRV have undefined values for shift > bitsize. But SM5
says :

   "This instruction performs a component-wise shift of each 32-bit
    value in src0 left by an unsigned integer bit count provided by
    the LSB 5 bits (0-31 range) in src1, inserting 0."

Better to not hard code the wrong behavior in NIR.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: e227bb9fd5 ("nir/builder: add ishl_imm helper")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@colllabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21720>
2023-03-07 08:14:34 +00:00
Samuel Pitoiset
5ec80ab37c radv: do not add descriptor BOs on update when the global BO list is used
It's unnecessary and already checked elsewhere like in
vkCmdBindDescriptorSets(). This improves performance of vkoverhead
test #76 (descriptor_1image) by +18%. It's the same performance as
PRO on my Threadripper 1950X now. This should also slightly improve
texel and buffer descriptors.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20699>
2023-03-07 07:30:29 +00:00
Karol Herbst
1aca36815e gallivm: fix lp_vec_add_offset_ptr for 32 bit builds
The function assumed ptrs are always 64 bit sized.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8267
Fixes: 442d1fe5ad ("gallivm: use masked intrinsics for global and scratch access.")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21604>
2023-03-07 04:17:15 +00:00
Karol Herbst
4c24ff0a34 rusticl/kernel: Images arg sizes also have to match the host pointer size
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8267
Fixes: b0d698c532 ("rusticl: correctly check global argument size")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21604>
2023-03-07 04:17:15 +00:00
Alyssa Rosenzweig
66f806d01d agx: Assert that memory index is 32-bit reg
Semantics will be wrong otherwise (reading garbage).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21643>
2023-03-07 02:58:35 +00:00
Alyssa Rosenzweig
2a174f0019 agx/lower_address: Handle 16-bit offsets
These need to be upconverted for correctness.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21643>
2023-03-07 02:58:35 +00:00
Alyssa Rosenzweig
9f5a4a9604 agx/lower_address: Fix handling of 64-bit immediates
We can't add a 64-bit immediate with the hardware iadd, that won't work. What we
can do is add a 32-bit immediate, derived as the low 32-bits of a 64-bit
nir_ssa_def.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21643>
2023-03-07 02:58:35 +00:00
Alyssa Rosenzweig
4bd0e1d097 agx/lower_address: Handle 8-bit load/store
Should work ok with the implicit up-conversion that the backend does.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21643>
2023-03-07 02:58:35 +00:00
Alyssa Rosenzweig
5865e23a07 agx/lower_address: Handle large shifts
If we manage to fold in a left shift that's bigger than the hardware can do, we
should at least avoid generating a useless right shift to feed the hardware
rather bailing completely.

For motivation, this form of address arithmetic is encountered when indexing
into arrays with large power-of-two element sizes (array-of-structs).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21643>
2023-03-07 02:58:35 +00:00
Alyssa Rosenzweig
6203503196 agx/lower_address: Optimize "shift + constant"
Optimize address arithmetic of the form

   base + u2u64((index << shift) + const)

into hardware operands

   base, index << (shift - format_shift) + const'

which (if format_shift = shift) can be simply

   base, index + const'

rather than the current naive translation

   base, ((index << shift) + const) >> format_shift

This saves at least one pointless shift. We can't do this optimization with
nir_opt_algebraic, because explicitly optimizing "(a << #b) >> #b" to "a" isn't
sound due to overflow. But there's no overflow issue here, which is what this
whole pass is designed around.

For motivation, this address arithmetic implements "dynamically indexing into an
array inside of a C structure", where the const is the offset of the array
relative to the structure.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21643>
2023-03-07 02:58:35 +00:00
Alyssa Rosenzweig
dccf6f569b agx/lower_address: Break on match
Once we've matched a summand, commit to it. This avoids needlessly checking the
second source if the first matched, and removes some indentation/funny control
flow.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21643>
2023-03-07 02:58:35 +00:00
Sergi Blanch Torne
36f6eb88cb Revert "ci: disable Collabora's LAVA lab for maintance"
This reverts commit 6be7469df1

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21356>
2023-03-07 02:23:00 +00:00
Mike Blumenkrantz
b5fc941f2f zink: always set batch usage for descriptors after barrier
this otherwise breaks unordered promotion calc

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21739>
2023-03-07 01:57:41 +00:00
Mike Blumenkrantz
afb56bad1c zink: set dynamic pcp for unordered cmdbuf
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21739>
2023-03-07 01:57:41 +00:00
Mike Blumenkrantz
c5f901dbc6 zink: bind descriptor buffers to unordered cmdbuf
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21739>
2023-03-07 01:57:41 +00:00
Mike Blumenkrantz
20c9cfb30f zink: always set color writes on the unordered cmdbuf
this state has to be set, so ensure it is

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21739>
2023-03-07 01:57:41 +00:00
Mike Blumenkrantz
8e3ee9aad6 zink: explicitly flush src clears when u_blittering
this otherwise relies on set_framebuffer_state flushing them,
which may or may not be accurate/desired

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21739>
2023-03-07 01:57:41 +00:00
Mike Blumenkrantz
1aa62912b7 zink: don't unset existing access when adding resource binds
this breaks barrier calcs, but it was fine since there was a pre-barrier

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21739>
2023-03-07 01:57:41 +00:00
Mike Blumenkrantz
a0f3d171f6 zink: eliminate pre barrier for adding resource binds
this will automatically be handled by the copies below

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21739>
2023-03-07 01:57:41 +00:00
Mike Blumenkrantz
d133f95084 zink: check for layout updates when unbinding samplerviews
not sure if it's a bug, but it should be consistent with shader image
unbinding, so here it is

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21739>
2023-03-07 01:57:41 +00:00
Mike Blumenkrantz
a4b1ae1f03 zink: propagate valid_buffer_range when replacing buffer storage
this is otherwise unreliable

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21739>
2023-03-07 01:57:41 +00:00
Mike Blumenkrantz
7145ccfa05 zink: fix descriptor update flagging on null ssbo set
this could unset the update flag if the last ssbo was null, which would
be a bug if it could ever be triggered

found by inspection

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21739>
2023-03-07 01:57:41 +00:00
Mike Blumenkrantz
e0dfe058c4 zink: only add deferred barrier on fb unbind when layout needs to change
this otherwise may have been a surface that was never drawn to or
already had its layout corrected, in which case a deferred barrier
is not only unnecessary, it might be broken

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21739>
2023-03-07 01:57:41 +00:00
Mark Janes
bc04e2daca intel/fs: use generated helpers for Wa_1209978020 / Wa_18012201914
Wa_1209978020 is a clone of Wa_18012201914.  Update references to
refer to the originating bug, and use generated helpers to ensure it
is applied to future platforms as needed.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21741>
2023-03-07 01:41:53 +00:00
Caio Oliveira
c92d589597 intel/compiler: Drop non-scoped barrier handling
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21634>
2023-03-07 00:41:13 +00:00
Alyssa Rosenzweig
02eef8ca98 gallivm: Drop non-scoped barrier handling
Now unreachable.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21634>
2023-03-07 00:41:13 +00:00
Alyssa Rosenzweig
c8147e69d3 ir3: Drop non-scoped barrier handling
Now unreachable.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21634>
2023-03-07 00:41:13 +00:00
Alyssa Rosenzweig
fc93e8e537 pan/mdg: Drop control_barrier handling
Now unreachable.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21634>
2023-03-07 00:41:13 +00:00
Alyssa Rosenzweig
cb0f4b8146 pan/bi: Drop control_barrier handling
Now unreachable.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21634>
2023-03-07 00:41:13 +00:00
Alyssa Rosenzweig
f47ea3f992 glsl/nir: Use scoped_barrier for control barrier
Rather than control_barrier. This avoids the need to handle control_barrier at
all for backends that set use_scoped_barrier. This effectively matches what
spirv_to_nir emits, so Vulkan-capable compilers should be ok.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21634>
2023-03-07 00:41:13 +00:00
Caio Oliveira
07de034791 intel/compiler: Drop brw_nir_lower_scoped_barriers
Now that we handle scoped barriers with execution scope during
NIR -> Backend IR translation, this lowering is not needed anymore.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21634>
2023-03-07 00:41:13 +00:00
Caio Oliveira
dfc34b1a65 intel/vec4: Handle scoped barriers with execution scope
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21634>
2023-03-07 00:41:13 +00:00
Caio Oliveira
db0a09c9e2 intel/fs: Handle scoped barriers with execution scope
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21634>
2023-03-07 00:41:13 +00:00
Yiwei Zhang
ae6eb3229e venus: revert back the warn order
This reverts
- commit 4ae4e4362c
- commit f54aa49c14

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21542>
2023-03-07 00:25:07 +00:00
Yiwei Zhang
28bdf8db18 venus: vn_relax to abort on ring fatal status upon warn order
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21542>
2023-03-07 00:25:07 +00:00
Yiwei Zhang
adb51eeba5 venus: propagate vn_ring to vn_relax
This is to prepare for vn_relax to check ring status as well as pinging
renderer.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21542>
2023-03-07 00:25:07 +00:00
Yiwei Zhang
15a55198ec venus: abort ring submit when ring is in fatal status
This change also migrates to use the protocol defined status enums.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21542>
2023-03-07 00:25:07 +00:00
Yiwei Zhang
0b45893823 venus: sync to latest protocol for ring status enum
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21542>
2023-03-07 00:25:07 +00:00
Mark Janes
b96019f82b intel/fs: use generated workaround helpers for Wa_14010017096
This workaround does not apply beyond gen 12.0.

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21746>
2023-03-07 00:10:33 +00:00
Mark Collins
66d2ae0386 meson: forcefully disable libdrm when host doesn't have it
Signed-off-by: Mark Collins <mark@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21724>
2023-03-06 22:40:55 +00:00
Alyssa Rosenzweig
952bd63d6d nir/opt_barrier: Generalize to control barriers
For GLSL, we want to optimize code like

   memoryBarrierBuffer();
   controlBarrier();

into a single scoped_barrier intrinsic for the backend to consume. Now that
backends can get scoped_barriers everywhere, what's left is enabling backends to
combine these barriers together. We already have an Intel-specific pass for
combining memory barriers; it just needs a teensy bit of generalization to allow
combining all sorts of barriers together.

This avoids code quality regression on Asahi when switching to purely scoped
barriers. It's probably useful for other backends too.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21661>
2023-03-06 22:09:27 +00:00
Faith Ekstrand
83fd7a5ed1 intel: Use nir_lower_tex_options::lower_index_to_offset
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21546>
2023-03-06 21:38:32 +00:00
Alyssa Rosenzweig
4b6d98a40c ir3: Use lower_index_to_offset
Instead of doing the add ourselves.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21546>
2023-03-06 21:38:32 +00:00
Alyssa Rosenzweig
510d3ab93d pan/bi: Use lower_index_to_offset
Instead of doing the add ourselves.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21546>
2023-03-06 21:38:32 +00:00
Alyssa Rosenzweig
282aeb9b9c nir/lower_tex: Add lower_index_to_offset
Some backends can handle a constant texture index or a dynamic texture index but
not a constant texture index plus a dynamic texture offset. Add a nir_lower_tex
option to lower to one of these options.

v2: Use more straightforward code proposed by Faith.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21546>
2023-03-06 21:38:32 +00:00
Sam Edwards
9de997bde6 nouveau: Fix null dereference in nouveau_pushbuf_destroy
This may happen if the Nouveau device fails to initialize before
the pushbuf is set up; the abort logic will call this either way.

Signed-off-by: Sam Edwards <CFSworks@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21611>
2023-03-06 20:25:10 +00:00
Daniel Stone
34d45df8ff ci/fdno: Only run full tests on a limited subset of machines
Though not many people run full test runs, it occupies 2/7 a630 slots
for nearly 2 hours. If more than one person does this at a time, it can
be an effective DoS and make merges time out.

Limit full runs to a subset of the runners, such that at least some of
them will always be available for us.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21737>
2023-03-06 19:56:39 +00:00
Rob Clark
399012a911 freedreno/common: Replace or_mask() with BitsetEnum<T>
Use template and operator overloading to make dealing with bitmask enums
shared between C and C++ easier.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21535>
2023-03-06 19:27:19 +00:00
Eric Engestrom
30d469215b v3d/ci: add dEQP-GLES3.functional.texture.specification.teximage2d_pbo.*_cube flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21735>
2023-03-06 19:02:37 +00:00
Mike Blumenkrantz
62f1a8a3a6 zink: unbind fb on context destroy
this ensures that batch refs are added for fb surfaces on unbind, which
prevents stale batch tracking from persisting on resources
after the context is destroyed

fixes:
*EGL.functional.render.multi_context*

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21727>
2023-03-06 18:47:41 +00:00
Guilherme Gallo
7600e2cca2 ci: Handle carriage return characters in LAVA logs
This commit updates LogFollower class to handle carriage return
characters in LAVA logs. LAVA treats carriage return characters as a
line break, so each carriage return in an output console is mapped to a
console line in LAVA.

The updated LogFollower class now merges lines that end with a carriage
return character into a single line, making the Gitlab sections work
correctly. In addition, the `remove_trailing_whitespace` method has been
updated to remove trailing `\r\n` characters from log lines.

The `test_lava_log_merge_carriage_return_lines` test function has also
been updated to test for carriage returns at the end of the previous
line.

Closes: #8242

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21614>
2023-03-06 17:17:32 +00:00
Italo Nicola
3174cfcaf2 hud: add GALLIUM_HUD_OPACITY envvar
GALLIUM_HUD_OPACITY can be used with a % value from 0 to 100, to specify
the opacity of the gallium hud background.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Tested-by: Chris Healy <healych@amazon.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20339>
2023-03-06 16:50:27 +00:00
Italo Nicola
7ace1bab73 hud: use defines for default scale/rotation/visibility values
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20339>
2023-03-06 16:50:27 +00:00
Ruijing Dong
0f3370eede raseonsi/vcn: fix a h264 decoding issue
reason:
   some h264 streams have some strange pictures, from
   vaapi input these pictures don't have a reference frame,
   however, they are not intra only pictures, in MB layer
   these pictures are looking for some references, if they
   cannot find it. It could cause PF.

   when reference pictures exist, it will need to set used_for
   reference_flags, therefore if that is set, however the
   number of reference frames is zero, which is odd, it
   should be avoided.

solution:
   In the above case,  to scan the ref list so that it will
   make at least one reference available to avoid crash, since
   this is not accurate enough, it could cause some artifacts.
   And in that case, it will need to be checked individually
   for another solution.

closes: https://gitlab.freedesktop.org/drm/amd/-/issues/1462
closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8401
Cc: mesa-stable

Tested-by: llyyr <llyyr.public@gmail.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21732>
2023-03-06 16:38:19 +00:00
Mike Blumenkrantz
340f2d1a25 zink: add frame trace markers on the queue
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21655>
2023-03-06 16:23:21 +00:00
Sonny Jiang
bb796f70a1 radeonsi: Add NV12 support for AV1
8bit av1 decoding cannot use NV12 output, which is caused by missing NV12 RT format.
It's a regression caused by commit [0504a3b0].
Fixes: 0504a3b0  ("radeonsi: correctly declare YUV420_10 RT Format support for AV1")
Cc: mesa-stable

Signed-off-by: Sonny Jiang <sonny.jiang@amd.com>
Reviewed-by: David Wu <David.Wu3@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21697>
2023-03-06 16:10:40 +00:00
Samuel Pitoiset
0ed28d2715 wsi: move an assertion in wsi_xxx_surface_get_capabilities2()
Hit this with vulkaninfo on X11, probably a vulkaninfo bug. Though
moving the assertion doesn't hurt.

Fixes: be0dcbdfa2 ("wsi/x11: Implement EXT_swapchain_maintenance1.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21722>
2023-03-06 14:40:02 +00:00
Mike Blumenkrantz
c3cc8455d4 zink: when skipping a TRANSFER_DST image barrier, set access tracking
this otherwise breaks subsequent barriers if the first barrier of the batch
is a TRANSFER_DST on an image that can skip such a barrier

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
2023-03-06 14:22:01 +00:00
Mike Blumenkrantz
e650ff4ea0 zink: remove debug markers for u_blitter ops
these don't actually work; it creates the marker for the op, but
then the "end" of the marker is effectively determined to be the end
of the cmdbuf

instead, detect whether a draw is from u_blitter and add a marker there

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
2023-03-06 14:22:01 +00:00
Mike Blumenkrantz
271ebdd735 zink: pass cmdbuf to debug marker begin
this is otherwise broken with cmdbuf reordering

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
2023-03-06 14:22:01 +00:00
Mike Blumenkrantz
60496f6376 zink: reorder some blit debug markers
avoid capturing barrier and other ops in these

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
2023-03-06 14:22:01 +00:00
Mike Blumenkrantz
d677c00f6d zink: be more descriptive with perfetto buffer barriers
this should print some nice info in the graphs now

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
2023-03-06 14:22:01 +00:00
Mike Blumenkrantz
8c037193fb zink: determine whether debug markers are used on screen create
make this easier to reuse

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
2023-03-06 14:22:01 +00:00
Mike Blumenkrantz
8c226ba242 zink: skip buffer barriers if the buffer can be easily proved idle
this should have no pending write hazards, which means this barrier
can just be used for tracking

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
2023-03-06 14:22:01 +00:00
Mike Blumenkrantz
0a7092b285 zink: use split image barriers if the image can be easily proved idle
this should have no pending write hazards, which means this transition
has no dependencies and can occur immediately

also delete some old comments

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
2023-03-06 14:22:01 +00:00
Mike Blumenkrantz
5be506c16e zink: fix zink_resource_access_is_write()
this was accurately returning whether the access had only write flags,
but it was incorrectly returning false for READ|WRITE

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
2023-03-06 14:22:01 +00:00
Mike Blumenkrantz
772d92bfa6 zink: add functions for faster batch-usage completion checks
in cases where only a simple, non-definitive check is needed, these
can be used to eliminate some ioctl overhead

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
2023-03-06 14:22:01 +00:00
Mike Blumenkrantz
5b64d7267b zink: skip attachment barrier for redundant layout-setting if !valid
an invalidated image doesn't need synchronization, so this can be skipped

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
2023-03-06 14:22:01 +00:00
Mike Blumenkrantz
1694678294 zink: avoid unnecessary read-only layout changes for zs attachments
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
2023-03-06 14:22:01 +00:00
Mike Blumenkrantz
73df715c11 zink: add perfetto tracing for barriers
at least shows where they are

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
2023-03-06 14:22:01 +00:00
Daniel Schürmann
7fadee9b70 radv/rt: only reserve stack_sizes after rt_case insertion
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21667>
2023-03-06 13:58:54 +00:00
Daniel Schürmann
3e03fe44e7 radv/rt: move stack_sizes into radv_ray_tracing_module
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21667>
2023-03-06 13:58:54 +00:00
Daniel Schürmann
48edcd03c5 radv/rt: introduce struct radv_ray_tracing_module
This is preliminary work for separate shader functions.
The ray_tracing_module is eventually intended as self-contained
pipeline struct per RT group.

For now, these modules only contain the group handles.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21667>
2023-03-06 13:58:54 +00:00
Daniel Schürmann
4dafb69d61 radv/rt: defer library_pipeline allocation
We will need the number of groups at allocation time.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21667>
2023-03-06 13:58:54 +00:00
Daniel Schürmann
a62d699664 radv/rt: rename library_pipeline->groups to library_pipeline->group_infos
'groups' will later be used for ray_tracing_modules.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21667>
2023-03-06 13:58:54 +00:00
David Heidelberg
d79d62c638 ci: do not exit when an error happens inside the section
Let CI handle that case as it did before. The only thing which needs to be done by the error() function is to get out of the section.

Fixes the issue where a job is not saving artifacts after failure.
Fixes: 4cc0cec473 ("ci: implement unified sections")

Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21715>
2023-03-06 11:59:42 +00:00
Błażej Szczygieł
944a3af531 glx: Fix glXGetFBConfigFromVisualSGIX
Get list of configs returned by glXChooseFBConfig, return it's first
element, free memory.

Fixes: 4ccd253588 ("glx: Require GLX 1.3")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8273

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21607>
2023-03-06 11:16:48 +00:00
Sergi Blanch Torne
5d30d11ccc ci: include setup test environment script in the output artifacts
In mesa/mesa !20272, some bash functions introduce a standard wait to setup
gitlab ci sections, but the file collecting them needed to be included in the
artifacts exported by mesa. Other projects that use tests like deqp-runner
need to load these bash functions.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21680>
2023-03-06 09:47:16 +00:00
Erik Faye-Lund
c305f97257 nir: add a print_internal debug-flag
It can sometimes be useful to also print the shaders that are marked as
internal, so let's add a flag that lets us do that.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21681>
2023-03-06 09:13:52 +00:00
Samuel Pitoiset
7c1563aebe radv/ci: update CI lists for CTS 1.3.5.0 on GFX110/POLARIS10/PITCAIRN
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21689>
2023-03-06 08:53:31 +00:00
Samuel Pitoiset
81eaf7b9e4 radv/ci: stop skipping some graphics pipeline library tests
They are fixed in CTS 1.3.5.0.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21689>
2023-03-06 08:53:30 +00:00
Sergi Blanch Torne
9e919a9bd9 ci: disable Collabora's LAVA lab for maintance
This is to inform you of some planned downtime in the LAVA lab as follows:

    Start: 2023-03-06 08:00 GMT
    End: 2023-03-06 12:00 GMT

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21355>
2023-03-06 07:01:05 +00:00
Mike Blumenkrantz
0d8a54f913 zink: avoid ballooning of copy box tracking
* if the proposed box is smaller than an existing box then don't add it,
* if the proposed box is adjacent to an existing box, expand
* if the proposed box is larger than an existing box, replace

this reduces the chances of having a ton of copy boxes to iterate over

also add a perf warning in case a ton of copy boxes exist

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21665>
2023-03-06 03:47:06 +00:00
Mike Blumenkrantz
d2de2bb9c5 util/box: fix off-by-one calc error in intersection funcs
the "right-most" boundary needs the -1 since it isn't inclusive

oops

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21665>
2023-03-06 03:47:06 +00:00
Mike Blumenkrantz
3c0fad058a zink: eliminate internal qbo copy barrier
the values written here will never overlap, so no barrier is necessary

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21581>
2023-03-06 02:22:39 +00:00
Mike Blumenkrantz
b31c414e28 zink: set predicate_dirty on query creation
ensure this is set when it needs to be

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21581>
2023-03-06 02:22:39 +00:00
Mike Blumenkrantz
5374605ea9 zink: merge qbo update copies when possible
if a single query is being started and stopped frequently, update
the internal qbo with a single copy call instead of one copy per result

not actually that useful in practice because of how query pools are shared,
but could help somewhere in theory

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21581>
2023-03-06 02:22:39 +00:00
Mike Blumenkrantz
7f956435a0 zink: rework xfb queries for drivers with poor primgen support
for drivers lacking one of:
* EXT_color_write_enable
* primitivesGeneratedQueryWithRasterizerDiscard

terrible things must happen. specifically, dummy surfaces have to
be used in a framebuffer with rast-discard enabled for the duration
of the query

now that queries are only started/stopped in renderpasses, however,
there are new hurdles. with tc renderpass optimizing, queries can be
started outside the renderpass, which would trigger recursion when
trying to start a primgen query outside the renderpass if any clears
are enabled, as those must be flushed onto the real surfaces

to solve all of this:
* block tc renderpass optimizing if at least one of the above features is missing
* detect a pending primgen query start during renderpass start
* activate rast-discard and set dummy surfaces before beginning renderpass
  * this recurses and automatically flushes clears
* finally, start the real renderpass

BUT WAIT THERE'S MORE!

because there's also drivers that support EXT_color_write_enable and don't support
primitivesGeneratedQueryWithRasterizerDiscard, which means they do need rast-discard,
but they don't need dummy surfaces, and so the clears still have to be flushed,
so they need an explicit (recursive) renderpass start/stop in advance to
ensure the clears are applied as expected

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21628>
2023-03-06 02:00:06 +00:00
Mike Blumenkrantz
5144c8a858 zink: track whether a primgen query is suspended and needing color write hacks
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21628>
2023-03-06 02:00:06 +00:00
Mike Blumenkrantz
9bc871199c zink: only resume queries inside renderpasses from set_active_query_state
match new default query behavior

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21628>
2023-03-06 02:00:06 +00:00
Mike Blumenkrantz
81de7a1c25 zink: resume queries after conditional render and clears are processed
this should have no functional effect other than ensuring primgen queries
don't recurse when detecting clears

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21628>
2023-03-06 02:00:06 +00:00
Mike Blumenkrantz
f7d1fff23f zink: disable queries for clear_texture()
this otherwise can do weird things

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21628>
2023-03-06 02:00:06 +00:00
David Heidelberg
26dc5b3737 ci/ci_run_n_monitor: while we usually disable many jobs, print them inline
Saving scrolling time...

Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21713>
2023-03-06 01:51:59 +01:00
Friedrich Vock
f5061758be radv: Use LDS for closest-hit hit attributes
Q2RTX: 23.1ms -> 22.9ms

shader-db:
Totals from 19 (0.69% of 2764) affected shaders:

MaxWaves: 197 -> 208 (+5.58%)
Instrs: 87702 -> 87817 (+0.13%); split: -0.03%, +0.16%
CodeSize: 474320 -> 475128 (+0.17%)
VGPRs: 1840 -> 1728 (-6.09%)
Latency: 2771599 -> 2773173 (+0.06%); split: -0.13%, +0.18%
InvThroughput: 561281 -> 533010 (-5.04%); split: -5.16%, +0.12%
VClause: 2782 -> 2788 (+0.22%); split: -0.18%, +0.40%
Copies: 12115 -> 12136 (+0.17%); split: -0.45%, +0.63%
Branches: 4116 -> 4122 (+0.15%)
PreVGPRs: 1665 -> 1638 (-1.62%); split: -1.92%, +0.30%
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21635>
2023-03-05 21:53:34 +00:00
Friedrich Vock
c1651a1032 radv: Extend hit attribute lowering for LDS
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21635>
2023-03-05 21:53:34 +00:00
Alyssa Rosenzweig
61663859bc asahi: Wire up compute kernels
Now that we have multiple sysval tables, implementing compute kernels --
including with indirect dispatch and load_num_workgroups -- is straightforward.
This patch adds the straightforward launch_grid implementation.

As usual needs UAPI support patches to actually do anything, but the relevant
compute tests are passing downstream.

It's not possible to properly test compute shaders support right now (pending
support for images), so we don't update the CAPs or features.txt here. This is
more about flushing out the piles of downstream patches we have (and getting
reviewed!) in preparation for cutting a downstream release soon.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21703>
2023-03-05 19:40:43 +00:00
Alyssa Rosenzweig
c086f2770b asahi: Rework system value lowering
The previous lowering was insufficient in two areas:

* No support for indirection. This is required for dynamically indexing into
  UBOs, SSBOS, etc in OpenGL ES 3.2

* Only a single table supported. Multiple tables are required to implement
  indirect dispatch/draws efficiently, in order to bind the indirect buffer as
  uniforms.

The first problem is addressed here by reworking the lowering of
system values to happen in NIR, decoupled from the uniform register assignment
details, such that we can handle 1:n lowerings in a straightforward way.
Namely, indirect sysvals are lowered to indirect memory loads relative to the
base address of the sysval table, where the table address is itself pushed as a
(direct) sysval.

The second problem is addressed in this patch by generalizing to multiple
uniform tables.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21703>
2023-03-05 19:40:43 +00:00
Alyssa Rosenzweig
f92738eaaa agx: Handle fragment shader side effects
Fragment shaders with side effects need to be lowered to ensure they execute for
all shaded pixels but no helper threads. Add a lowering pass to handle this.

Fixes dEQP-GLES31.functional.shaders.opaque_type_indexing.atomic_counter.const_literal_fragment

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21712>
2023-03-05 19:12:35 +00:00
Alyssa Rosenzweig
290f3b76f3 agx: Disable tri merging with side effects
As Metal does.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21712>
2023-03-05 19:12:35 +00:00
David Heidelberg
b20c9adb4e crocus/meson: add dependency on libintel_dev also for versioned static libraries
Fixes: a0fa31bcdd ("intel/dev: create a helper dependency for libintel_dev")

Reviewed-by: Mark Janes <markjanes@swizzler.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21709>
2023-03-05 18:44:54 +00:00
Rob Clark
8e7511ea7f vk/runtime: Use libdrm shim
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21636>
2023-03-05 16:31:51 +00:00
Rob Clark
44f7ec40ef loader: Use libdrm shim
Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21636>
2023-03-05 16:31:51 +00:00
Rob Clark
5f5ccf4bec turnip: Use libdrm shim
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21636>
2023-03-05 16:31:51 +00:00
Rob Clark
e05abb1345 util: Add a simple no-op libdrm shim
Make it easier to deal with build configs that do not have libdrm.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21636>
2023-03-05 16:31:51 +00:00
David Heidelberg
b73b701579 ci/freedreno: rare flake KHR-GL45.sample_variables.mask.rgba8i.samples_4.mask_3
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21718>
2023-03-05 14:34:33 +00:00
David Heidelberg
5ee724e180 ci/lavapipe: add recent occasional flake
Issue: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8441

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21717>
2023-03-05 14:35:45 +01:00
Gert Wollny
9b09f244f0 r600/sfn: Fix atomic lowering
Fixes: 56dedf052f
  r600/sfn: add r600 specific lowering pass for atomics and use it

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21684>
2023-03-05 09:54:08 +00:00
Gert Wollny
3c3ecdab36 r600/sfn/tests: Add a test for the copy prop into a group
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21684>
2023-03-05 09:54:08 +00:00
Gert Wollny
244cc152d1 r600/sfn: redirect copy propagation to alu parent group
If an ALU instruction was emitted from the get-go as group, then
we have to make sure that replacing a source doesn't violate the
readport configuration in the group.

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

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21684>
2023-03-05 09:54:08 +00:00
Gert Wollny
2028465bd8 r600/sfn: Add print method to AluReadportValidation
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21684>
2023-03-05 09:54:08 +00:00
Gert Wollny
ee0010213f r600/sfn: Add method to AluGroup to replace sources
Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8374

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21684>
2023-03-05 09:54:08 +00:00
Gert Wollny
6180721005 r600/sfn: Split AluInstr replace_source into test and actual replace
Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8374

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21684>
2023-03-05 09:54:08 +00:00
Gert Wollny
afa545b926 r600/sfn: Add AluGroup method to update readport validation from scratch
Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8374

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21684>
2023-03-05 09:54:08 +00:00
Alyssa Rosenzweig
ed587ae6ac asahi/meta: Use lowered I/O
No point in creating a variable when we can just synthesize the store_output
directly.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21430>
2023-03-05 09:27:02 +00:00
Alyssa Rosenzweig
485eddcc85 asahi: Bump shader buffers
No reason to limit it, it's direct access anyway.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21430>
2023-03-05 09:27:02 +00:00
Alyssa Rosenzweig
c7b5f01461 agx: Only lower int64 late
This is required for address arithmetic to be lowered properly for compute
kernels, which may have u2u64 in the source NIR.

No shader-db changes (for GLES3.0).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21430>
2023-03-05 09:27:02 +00:00
Alyssa Rosenzweig
811f8b899d agx: Don't print pre-optimization shader
It's usually too noisy to be useful, especially before DCE. The optimized (but
pre-RA) shader is usually the useful bit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21430>
2023-03-05 09:27:02 +00:00
Alyssa Rosenzweig
ea37d7f81f agx: Use agx_emit_collect for st_tile
Instead of open coding.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21430>
2023-03-05 09:27:02 +00:00
Alyssa Rosenzweig
7bb8112fd1 agx: Refactor vector creation
agx_vec4 is unused, drop in, and split out the common logic since we'll use it
in a new helper.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21430>
2023-03-05 09:27:02 +00:00
Alyssa Rosenzweig
037609f1dc agx: Constify agx_print
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21430>
2023-03-05 09:27:02 +00:00
Alyssa Rosenzweig
a9c5956f2f agx: Inline 16-bit load/store offsets
Most integer immediates are only 8-bit, but load/store instructions allow their
immediate offsets to be 16-bit instead. Take advantage of this in the optimizer.
This eliminates 36% of the instructions in
dEQP-GLES31.functional.ssbo.layout.random.all_shared_buffer.36, a fitting
percentage.

Insignificant effect on dEQP-GLES31.functional.ssbo.* performance... Only a
small % of our compile-time pie is actually spent in the backend anyway (as
opposed to NIR passes or GLSL IR).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21430>
2023-03-05 09:27:02 +00:00
Alyssa Rosenzweig
c9728b41d5 agx: Factor out allows_16bit_immediate check
The optimizer needs this information to inline immediates effectively.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21430>
2023-03-05 09:27:02 +00:00
Alyssa Rosenzweig
445ca949cd agx: Clean up after lowering address arithmetic
This avoids creating silly preambles that don't actually do anything except push
a constant that we could've inlined for cheaper anyway, since nir_opt_preamble's
cost model is sensitive to e.g. constant folding.

This avoids a pointless preamble in split-hell.

As a nice bonus, this also improves compile-time on address-heavy shaders. With
a release build, CPU time in dEQP-GLES31.functional.ssbo.* reduces from 12.87s
to 10.77... a 16% improvement is nothing to sneeze at.

shader-db results are mostly noise.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21430>
2023-03-05 09:27:02 +00:00
Alyssa Rosenzweig
4b1f4b86ea agx: Add AGX_MESA_DEBUG=nopreamble option
Useful both for ruling out issues with shader preambles as well as (in some
cases) making for a nicer reading experience of the compiled assembly.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21430>
2023-03-05 09:27:02 +00:00
Alyssa Rosenzweig
c22a18c9af agx: Don't write sample mask from preambles
It doesn't make sense, they're basically little compute kernel environments.
Noticed while debugging dEQP-GLES31.functional.fbo.no_attachments.multisample.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21710>
2023-03-05 08:20:09 +00:00
Alyssa Rosenzweig
e9f7d14de6 asahi: Mark PIPE_FORMAT_NONE "supported"
Kinda silly but fixes
dEQP-GLES31.functional.state_query.integer.max_framebuffer_samples_* which
queries the number of samples of a NONE format, required for
ARB_framebuffer_no_attachments to make sense.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21710>
2023-03-05 08:20:09 +00:00
Alyssa Rosenzweig
8bb40ce4ad agx: Fix 2D MSAA array texture register allocation
Sample index and layer index are both 16-bits, even though they are zero
extended for compiler simplicity in some cases. In particular this means that 2D
MSAA arrays consume 6 half-regs for their coordinates, not 8. This is what the
IR translation (actually agx_nir_lower_texture) produces, we just need to fix
the calculation in agx_read_registers to agree.

Fixes validation failure in tests like
dEQP-GLES31.functional.texture.multisample.samples_4.use_texture_color_2d_array

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21708>
2023-03-05 08:06:43 +00:00
Alyssa Rosenzweig
3032e3ad23 agx: Mask shifts in the backend
This gives our shifts SM5 behaviour at the cost of a little extra ALU. That way,
we match NIR's shifts.

This fixes unsoundness of GLSL expressions like "a << (b & 31)", where the &
would mistakenly get optimized away.

Closes: #8181
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reported-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21673>
2023-03-05 07:52:22 +00:00
Alyssa Rosenzweig
f4e2b22646 asahi: Advertise dual-source blending
This is handled entirely in common code.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21545>
2023-03-05 07:38:36 +00:00
Yogesh Mohan Marimuthu
af953616a1 wsi/display: check alloc failure in wsi_display_alloc_connector()
vulkancts test dEQP-VK.wsi.direct_drm.surface.create_simulate_oom is failing
because in wsi_display_alloc_connector() function memory allocation for
connector is not checked for return NULL. create_simulate_oom test simulates
out of memory, hence memory allocation fails for connector and later when
tried to dereference connector program will segfault.

This patch fixes the dEQP-VK.wsi.direct_drm.surface.create_simulate_oom test
segfault issue by checking if connector is NULL afer memory allocation.

Cc: mesa-stable
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21701>
2023-03-04 21:20:54 +00:00
Rob Clark
82cc236458 freedreno/a6xx: Fix mirror x/y blits
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21706>
2023-03-04 19:13:40 +00:00
Rob Clark
ec9e03fb39 freedreno/a6xx: Convert blitter to OUT_REG()
We'll need this to add a7xx support, since some of the regs are
different btwn a6xx and a7xx and reg variants are not supported with
the legacy reg builders.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21706>
2023-03-04 19:13:40 +00:00
Rob Clark
149f2a2e81 freedreno/a6xx: Namespace reg/pkt packer vars
Otherwise they could conflict with parameters to the reg/pkt.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21706>
2023-03-04 19:13:40 +00:00
Alyssa Rosenzweig
1d2c1b8bd6 pan/mdg: Use nir_lower_helper_writes
It's now in common code, drop our (buggier) copy.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21413>
2023-03-04 13:31:05 -05:00
Alyssa Rosenzweig
586da7b329 nir: Add nir_lower_helper_writes pass
This NIR pass lowers stores in fragment shaders to:

   if (!gl_HelperInvocaton) {
      store();
   }

This implements the API requirement that helper invocations do not have visible
side effects, and the lowering is required on any hardware that cannot directly
mask helper invocation's side effects. The pass was originally written for
Midgard (which has this issue) but is also needed for Asahi. Let's share the
code, and fix it while we're at it.

Changes from the Midgard pass:

1. Add an option to only lower atomics.

   AGX hardware can mask helper invocations for "plain" stores but not for
   atomics.  Accordingly, the AGX compiler wants this lowering for atomics but
   not store_global. By contrast, Midgard cannot mask any stores and needs the
   lowering for all store intrinsics. Add an option to the common pass to
   accommodate both cases.

   This is an optimization for AGX. It is not required for correctness, this
   lowering is always legal.

2. Fix dominance issues.

   It's invalid to have NIR like

      if ... {
         ssa_1 = ...
      }

      foo ssa_1

   Instead we need to rewrite as

      if ... {
         ssa_1 = ...
      } else {
         ssa_2 = undef
      }
      ssa_3 = phi ssa_1, ssa_2

      foo ssa_3

   By default, neither nir_validate nor the backends check this, so this doesn't
   currently fix a (known) real bug. But it's still invalid and fails validation
   with NIR_DEBUG=validate_ssa_dominance.

   Fix this in lower_helper_writes for intrinsics that return data (atomics).

3. Assert that the pass is run only for fragment shaders. This encourages
   backends to be judicious about which passes they call instead of just
   throwing everything in a giant lower everything spaghetti.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21413>
2023-03-04 13:31:05 -05:00
Asahi Lina
1dd872ec17 asahi: Assert on TIB strides > 64
These just don't seem to work. macOS falls back to eMRT here...

dEQP-GLES3.functional.draw_buffers_indexed.random.max_implementation_draw_buffers.13
from Fail -> Crash. Proper solution will come when we implement eMRT later on.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21705>
2023-03-04 10:58:10 -05:00
Rhys Perry
aa32dc704f nir/range_analysis: fix vectorized phis and intrinsics
Found by inspection.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21288>
2023-03-04 12:58:38 +00:00
Eric Engestrom
a19a37e8d7 vk: be stricter about symbols check between android and other platforms
Don't allow HMI on non-Android, don't allow non-HMI on Android, and
don't allow missing HMI on Android.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21631>
2023-03-04 07:41:10 +00:00
Eric Engestrom
2a6fbc4bb2 android/vk: drop unnecessary symbols
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21631>
2023-03-04 07:41:10 +00:00
Eric Engestrom
4e1eb53b5e vn: add linker script to fix android symbols
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21631>
2023-03-04 07:41:10 +00:00
Eric Engestrom
2b1e9b0fd6 anv: add linker script to fix android symbols
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21631>
2023-03-04 07:41:10 +00:00
Eric Engestrom
6f654d532b tu: add linker script to fix android symbols
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21631>
2023-03-04 07:41:10 +00:00
Eric Engestrom
c4e2400461 v3dv: add linker script to fix android symbols
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21631>
2023-03-04 07:41:10 +00:00
Eric Engestrom
78578a6ddb vk: move radv's linker symbols scripts for use in all drivers
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21631>
2023-03-04 07:41:10 +00:00
Lionel Landwerlin
938f7a48b2 anv: VK_EXT_image_sliced_view_of_3d
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21376>
2023-03-04 06:12:46 +00:00
Faith Ekstrand
7e1b62ea5b isl: Set Depth to array len for 3D storage images
This is necessary for RESINFO to work properly.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21376>
2023-03-04 06:12:46 +00:00
Faith Ekstrand
74e6e207fe intel/blorp: Set array_len for 3D images properly
We need to minify the depth so we don't set a size that's out-of-bounds.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21376>
2023-03-04 06:12:46 +00:00
Lionel Landwerlin
4ee1908ab6 vulkan/runtime: only consider slice info with 3D image views
Because we can have 2D views of 3D images, we want to consider the
slice info only with 3D *image views*.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 66e3ccbcac ("vulkan/runtime: store parameters of VK_EXT_sliced_view_of_3d")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21376>
2023-03-04 06:12:46 +00:00
Faith Ekstrand
3384e4f768 vulkan/runtime: Rename and document storage image Z range
This makes it more clear that the fields specifically apply to the Z
range and aren't array slices.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21376>
2023-03-04 06:12:46 +00:00
Juston Li
464cae9497 venus: shader cache fossilize replay fix
venus utilizes the host side shader cache.

This is a WA to generate shader cache files containing headers with
a unique cache id that will change based on host driver identifiers.
This allows fossilize replay to detect if the host side shader cache
is no longer up to date.
The shader cache is destroyed after creating the necessary files and
not utilized by venus.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21664>
2023-03-04 05:56:04 +00:00
David Heidelberg
60ae5b106f ci/zink: add skip for the Single-GL46.enhanced_layouts.ssb_member_align_non_power_of_2
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21668>
2023-03-04 04:02:03 +00:00
David Heidelberg
5353fc94e5 ci: Retry, retry, retry... No one likes to trigger Marge more than once.
Sadly, have to decrease retry attempts from 2 to 1 for `runner_system_failure` since it's not doable while keeping one attempt for every other failure.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21668>
2023-03-04 04:02:03 +00:00
David Heidelberg
d73d383ed2 ci: deqp-runner: drop already unused function
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21668>
2023-03-04 04:02:03 +00:00
David Heidelberg
1fbdf57c48 ci: make meson build and test uncollapsed
Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8419

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21668>
2023-03-04 04:02:03 +00:00
Sil Vilerino
fb82371558 d3d12: VP9 Decode - Fix use_prev_in_find_mvs_refs calculation
Fixes: c8e8ce83 ("d3d12: Add VP9 Decode support")

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21694>
2023-03-04 03:22:48 +00:00
Sil Vilerino
6fea823dc0 frontend/va: Keep track of some VP9 previous frame data for current frame use_prev_in_find_mvs_refs
Fixes: c8e8ce83 ("d3d12: Add VP9 Decode support")

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21694>
2023-03-04 03:22:48 +00:00
Konstantin Seurer
f094e69469 radv/rt: Use ushr for extracting the cull mask
Fixes the following tests:
dEQP-VK.ray_tracing_pipeline.acceleration_structures.ray_cull_mask.gpu_built.ahit.4_bits
dEQP-VK.ray_tracing_pipeline.acceleration_structures.ray_cull_mask.gpu_built.ahit.16_bits
dEQP-VK.ray_tracing_pipeline.acceleration_structures.ray_cull_mask.gpu_built.chit.4_bits
dEQP-VK.ray_tracing_pipeline.acceleration_structures.ray_cull_mask.gpu_built.chit.16_bits
dEQP-VK.ray_tracing_pipeline.acceleration_structures.ray_cull_mask.gpu_built.isec.4_bits
dEQP-VK.ray_tracing_pipeline.acceleration_structures.ray_cull_mask.gpu_built.isec.16_bits

Fixes: 2d93ab7 ("radv/rt: Pre shift cull_mask")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21659>
2023-03-03 23:56:49 +00:00
Timur Kristóf
d89aea73e2 util: Add util_format_get_array.
This is a poor man's version of MESA_ARRAY_FORMAT.
Implemented based on a gigantic switch-case
with some help from the C preprocessor.
Thank you, preprocessor!

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21692>
2023-03-03 23:08:57 +00:00
Asahi Lina
26c51bb8d8 asahi: clang-format the world again
Some things were missed (like winsys) and there's still some bad include
orders lying around and some other randomness.

We should set up CI checks for this soon... ^^;;

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21687>
2023-03-03 22:55:59 +00:00
Jordan Justen
b02600cde1 intel/vk/grl: genX-ify grl_cl_kernel_name()
I don't see any code calling this, but with multiple gens, the symbol
name would conflict.

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/21670>
2023-03-03 21:37:19 +00:00
Jordan Justen
d68c9e0dcf intel/vk/grl: genX-ify genX_grl_uuid.cpp
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/21670>
2023-03-03 21:37:19 +00:00
Jordan Justen
14007a525b intel/vk/grl: Allow grl/grl_cl_kernel.h to be included by C++ files
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/21670>
2023-03-03 21:37:19 +00:00
Jordan Justen
4a7ddc4841 intel/vk/grl: Allow genX_grl.h to be included by C++ files
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/21670>
2023-03-03 21:37:19 +00:00
Jordan Justen
3251db1270 intel/vk/grl: Don't include anv_private.h in genX_grl.h
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/21670>
2023-03-03 21:37:19 +00:00
Eric Engestrom
a535f213d7 asahi/winsys: add .clang-format
Copied from src/asahi/.clang-format

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21691>
2023-03-03 21:23:03 +00:00
Asahi Lina
af8d97d096 asahi: Destroy the renderonly context on screen destroy
This fixes an fd leak due to leaving behind the dup'd renderonly fd.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21677>
2023-03-03 21:11:47 +00:00
Asahi Lina
0a5f3556a1 asahi: Fix device fd leak in agx_close_device
I'm not sure if this was always broken downstream or just got dropped at
some point, but it's definitely UAPI-agnostic and missing now that we
have all the non-UAPI bits upstream.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21677>
2023-03-03 21:11:47 +00:00
Alyssa Rosenzweig
f083e1807d asahi/decode: Handle VDM barriers
We emit these now (for transform feedback).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21675>
2023-03-03 20:54:18 +00:00
Alyssa Rosenzweig
2eb1efd181 docs/feature: Mark ARB_sync as done on Asahi
Strictly, this extension was already advertised, but it didn't seem nice to mark
it DONE when there was no sync support in the driver whatsoever. Mark it done
now that we do have proper explicit sync (well, in conjunction with the "add
Linux UAPI" patches that are blocked on getting the kernel driver upstream, but
that's needed for *any* of these extensions to be there!)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21676>
2023-03-03 20:47:40 +00:00
Timur Kristóf
05e6d945ad radv: Emulate VGT_ESGS_ITEMSIZE in shaders on GFX9+.
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/21434>
2023-03-03 20:15:10 +00:00
Rhys Perry
8aff7152a0 aco: make IDSet sparse
Improves compilation time of huge shaders.

A ray tracing pipeline of Hellblade: Senua's Sacrifice compiles in about
half the time, with this patch.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8179
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21022>
2023-03-03 17:45:14 +00:00
Asahi Lina
8e0c832c30 asahi: Fix scissor culling check when out of bounds for FB/viewport
Fixes a bunch of the `assert(maxx > minx && maxy > miny)` failures in
dEQP-EGL and probably others.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21678>
2023-03-03 16:42:18 +00:00
Asahi Lina
1313787c12 asahi: Do not overread user index buffers
We need to align the extent to 4 for the GPU, but we can't copy more
than the original size out of the user buffer. Always alloc the exact
size we need.

This does mean the GPU gets an IB extent that could include some other
stuff later in the pool, if not aligned. This is probably safe? Given
the base alignment, it should never cross a page boundary and fault or
anything like that.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21686>
2023-03-03 16:28:46 +00:00
José Roberto de Souza
1fecb26634 iris: Add iris_bo_set_caching()
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21688>
2023-03-03 16:02:46 +00:00
José Roberto de Souza
5dc0f18333 iris: Move iris_bo_madvise() to i915/iris_bufmgr.c
Start to split functions that are not in hot paths to specific i915
files.

Also making it static as iris_bo_madvise() is only called from
iris_bufmgr.c and adding a enum iris_madvice to be used among all
backends.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21688>
2023-03-03 16:02:46 +00:00
Rhys Perry
736d6643bb aco/tests: add tests for v_fma_f32 with 2 fp16 literals
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21633>
2023-03-03 14:20:55 +00:00
Lionel Landwerlin
afb0289d7c blorp: add dependency on idep_intel_dev
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 3c9a8f7a6d ("intel/dev: generate helpers to identify platform workarounds")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8421
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21679>
2023-03-03 13:04:23 +00:00
Marcin Ślusarz
75ce0bfd85 crocus/meson: add back dependency on libintel_dev
Fixes: a0fa31bcdd ("intel/dev: create a helper dependency for libintel_dev")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21679>
2023-03-03 13:04:23 +00:00
Lionel Landwerlin
1d9cf8f381 anv: add gfx9 generated draw support
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
3ac7d5f258 anv: remove unused item_count parameter
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
ec66054426 anv: use a list of generated shaders
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
b32303c369 anv: move common shader code into header
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
ac71719d4a anv: pack more data into generated draws input
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
200cec935d anv: use 64bit int support in generation shaders
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
a2026bf5f9 anv: rename generated draws for Gfx11
We'll need different shaders for Gfx9

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
caf2389bc5 anv: use a single generation shader for indirect draws
The indirect draw count shader can be used as a more generic case of
the indirect draw one. We'll never enter the last condition of the
shader (writing the MI_BATCH_BUFFER_START) with non count variants of
draws.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
897a92f576 anv: remove MI_NOOPs at the end of the generation batch
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
aa18d52728 anv: make sure mi_memcpy lands before push constant loads
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: e2dc32d755 ("anv: move functions around to plan for generated draws")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
e68615aeaa anv: fix indirect draws VF cache tracking of index buffer
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: e2dc32d755 ("anv: move functions around to plan for generated draws")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
1454b789b1 anv: fix 3DSTATE_PS emission in generation shaders
We have to use the helper and also were missing the vector mask
programming.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
8f16ca8741 anv: remove commented code
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
f5dc88910f anv: remove pre hasvk split assert
With softpin we should not always expect a BO in addresses.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
ae398284c9 anv: limit push constant dirtyness with generation shaders
We only use the fragment shader push constants.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
2ea106e758 anv: correctly program 3DSTATE_SF in generation shaders
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
e698040061 anv: remove BTI related flush in generation shaders
Earlier versions of the generation shaders were using the binding
table. We since switch to A64 messages. So the flush can be removed.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
1dcb536acd anv: remove copied code from generation shader
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
63fa6d9f49 anv: fix generated forward jump with more than 67M draws
The issue here is that for draw indirect count variants, we want to
jump after the last generated draw call to the next location where
commands are. But if we have more than 67M draws (8k * 8k chunks), we
only know the location once we've generated each of the 8k * 8k
chunks.

This change adds a CPU side pointer in the push constant struct so
that we can create a single linked list of chunks to edit and go
through to write the correct jump address after all the generated
space has been allocated.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
c1c680c08b anv: correctly reset generation address on command buffer reset
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
4246a519f3 anv: fix incorrect parameter
cmd_buffer_update_dirty_vbs_for_gfx8_vb_flush takes a value RANDOM/SEQUENTIAL. Not a boolean.
Fortunately this worked okay because true == RANDOM

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
234505f013 util/glsl2spirv: add support for include directive
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Eric Engestrom
eae5aa943a panfrost/ci: add EGL tests
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21504>
2023-03-03 10:14:29 +00:00
Lionel Landwerlin
6ee7a2ecfa anv: pull Wa_14016118574 out of some loop not changing state
The WA is meant to be here to apply some state that is not propagated
properly inside the HW. But if you have a loop like :

for ( ... ) {
  emit(3DPRIMITIVE, some param);
}

You're not really changing any state, just push more draws into the
pipeline.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: f2645229c2 ("anv: implement Wa_14016118574")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21660>
2023-03-03 09:34:16 +00:00
Lionel Landwerlin
d82e8e01c8 anv: fixup condition for Wa_14016118574
We don't want the WA to kick-in if it's not point/line topology.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: f2645229c2 ("anv: implement Wa_14016118574")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21660>
2023-03-03 09:34:16 +00:00
Samuel Pitoiset
3e4541bb56 radv/ci: adjust timeouts for Vega10 and Renoir
With latest CTS it takes much more time.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21390>
2023-03-03 08:23:22 +00:00
Samuel Pitoiset
f775873f81 ci: uprev CTS to 1.3.5.0
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21390>
2023-03-03 08:23:21 +00:00
Samuel Pitoiset
3b9937c85e radv: stop allocationg the attr ring BO for compute queues on GFX11
Only needed for graphics. This saves ~8Mib of 32-bit VRAM per compute
queue.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21632>
2023-03-03 07:27:21 +00:00
José Roberto de Souza
23f8b5b7a2 iris: Add initial skeleton of kmd backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21369>
2023-03-03 05:57:05 +00:00
José Roberto de Souza
cebffb404f iris: Use DRM_IOCTL_I915_GEM_CREATE_EXT in all supported kernels
As we start to refactor the iris code base to support Xe KMD here I'm
dropping DRM_IOCTL_I915_GEM_CREATE usage as much as possible and
unifying all graphics memory allocation calls to
DRM_IOCTL_I915_GEM_CREATE_EXT.

The kernel version that implemented DRM_I915_QUERY_MEMORY_REGIONS uAPI
also implemented DRM_IOCTL_I915_GEM_CREATE_EXT so we can use that
to safely call DRM_IOCTL_I915_GEM_CREATE_EXT.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21369>
2023-03-03 05:57:05 +00:00
José Roberto de Souza
65d129ec15 iris/bufmgr: Add i915_gem_set_domain()
Avoids code duplication.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21369>
2023-03-03 05:57:05 +00:00
José Roberto de Souza
d6754c1e04 iris: Convert drm_i915_gem_memory_class_instance to intel_memory_class_instance
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21369>
2023-03-03 05:57:05 +00:00
José Roberto de Souza
a24d93aa89 intel/dev: Query and compute hardware topology for Xe
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21368>
2023-03-03 05:25:35 +00:00
José Roberto de Souza
4b81a80f55 intel/dev: Implement Xe functions to handle hwconfig
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21368>
2023-03-03 05:25:35 +00:00
José Roberto de Souza
bc24091c52 intel/dev: Implement Xe functions to fill intel_device_info
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21368>
2023-03-03 05:25:35 +00:00
José Roberto de Souza
545d7e07ca intel/dev: Add INTEL_KMD_TYPE_XE
As mentioned in the previous patch, if intel-xe-kmd is disabled
it will fail to detected in run time but it will still compile all
Xe files.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21368>
2023-03-03 05:25:35 +00:00
José Roberto de Souza
7d34ec4691 intel: Add Meson parameter to enable Xe KMD support
The plan is to compile all the Xe files but in run time it will fail
to detect the KMD loaded and it will fall back to software
rendering(if build).

Compiling Xe files makes sure newer commits don't break Xe even if
developers don't have Xe enabled in their build folder.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21368>
2023-03-03 05:25:35 +00:00
José Roberto de Souza
ee510e2c50 intel: Pull in xe_drm.h
This is the uapi of the new Xe kernel driver.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21368>
2023-03-03 05:25:35 +00:00
Mark Janes
276f4a9d8c intel/dev: Print required workarounds with intel_dev_info
With the addition of workarounds, the output from this tool is more
verbose than some users will want.  Provide optional parameters for
enabling hwconfig and workaround details.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21639>
2023-03-03 04:55:08 +00:00
Hans-Kristian Arntzen
b7926303e6 radv: Expose VK_EXT_swapchain_maintenance1.
Passes dEQP-VK.wsi.*.maintenance1.*.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20235>
2023-03-03 03:59:13 +00:00
Hans-Kristian Arntzen
3d0258c679 wsi/win32: Implement VK_EXT_swapchain_maintenance1.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Jesse Natalie <jenatalie@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20235>
2023-03-03 03:59:13 +00:00
Hans-Kristian Arntzen
1b047ceac2 wsi/display: Implement EXT_swapchain_maintenance1.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20235>
2023-03-03 03:59:13 +00:00
Hans-Kristian Arntzen
07ac177c3f wsi/wayland: Implement EXT_swapchain_maintenance1.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20235>
2023-03-03 03:59:13 +00:00
Hans-Kristian Arntzen
ad71d584cf wsi/common: Add function to modify present mode.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20235>
2023-03-03 03:59:13 +00:00
Hans-Kristian Arntzen
d79fa8a03a wsi/common: Add comment about DEFERRED_ALLOCATION_BIT_EXT.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20235>
2023-03-03 03:59:13 +00:00
Hans-Kristian Arntzen
ae920c8420 wsi/common: Implement swapchain present fence.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20235>
2023-03-03 03:59:13 +00:00
Hans-Kristian Arntzen
be0dcbdfa2 wsi/x11: Implement EXT_swapchain_maintenance1.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20235>
2023-03-03 03:59:13 +00:00
Hans-Kristian Arntzen
8ece1ade5b wsi/common: Add common implementation of vkReleaseSwapchainImagesEXT.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20235>
2023-03-03 03:59:13 +00:00
Marek Olšák
c1fa7fe785 lavapipe/ci: add a new flake
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19399>
2023-03-03 03:27:40 +00:00
Marek Olšák
4f7e353237 amd: lower multi-component subdword SSBO loads in NIR
because the hw and LLVM only support subdword single-component SSBO loads,
and ac_nir_to_llvm splits multi-component loads because of that, which is
inefficient.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-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/19399>
2023-03-03 03:27:40 +00:00
Marek Olšák
82919e2dcb amd: lower subdword UBO loads in NIR
This fixes broken subdword UBO loads with LLVM.

It's only needed for LLVM, but it's done for both LLVM and ACO because
the pass can be fully validated only with ACO and the Vulkan CTS right now.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-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/19399>
2023-03-03 03:27:40 +00:00
Marek Olšák
1a424fee4a ac/llvm: implement nir_op_unpack_32_4x8
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-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/19399>
2023-03-03 03:27:40 +00:00
Marek Olšák
6aee999131 aco: implement nir_op_unpack_32_4x8
Reviewed-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/19399>
2023-03-03 03:27:40 +00:00
Marek Olšák
09005e6dfc ac/nir: add ac_nir_lower_subdword_loads to lower 8/16-bit loads to 32 bits
Reviewed-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/19399>
2023-03-03 03:27:40 +00:00
Marek Olšák
b80bd58265 nir: skip nir_op_unpack_32_4x8 in nir_lower_alu_width
The pass can't handle it just like the other unpack opcodes and generates
invalid NIR.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-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/19399>
2023-03-03 03:27:40 +00:00
Marek Olšák
ec38758e86 nir: return progress from nir_lower_io_to_scalar
oversight?

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-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/19399>
2023-03-03 03:27:40 +00:00
Faith Ekstrand
9a4641cf6b intel/nir: Limit unaligned loads to vec4
This probably doesn't affect Vulkan or GL because they can't have
anything bigger than a vec4 anyway unless it's a u64vec4 and those have
to be at least 8B aligned.  This may affect CL apps if they use
__attribute__((packed)) on something with big vectors, depending on how
LLVM decides to translate that.

Fixes: f8aa83f0c8 ("intel/nir: Use nir_lower_mem_access_bit_sizes()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21524>
2023-03-03 02:00:39 +00:00
Faith Ekstrand
c11ac5e446 nir: Handle wider unaligned loads in lower_mem_access_bit_size
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21524>
2023-03-03 02:00:39 +00:00
Faith Ekstrand
7e8a10be67 nir: Make chunk_align_offset const in lower_mem_load()
This should make things more clear than changing the value from earlier
in the loop.  Also, rename chunk_offset to load_offset so they match.

Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21524>
2023-03-03 02:00:39 +00:00
Faith Ekstrand
eb9a56b6ca nir: Rename nir_mem_access_size_align::align_mul to align
It's a simple alignment so calling it align_mul is a bit misleading.

Suggested-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21524>
2023-03-03 02:00:39 +00:00
Faith Ekstrand
802bf1d9a6 nir: Rename align to whole_align in lower_mem_load
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21524>
2023-03-03 02:00:39 +00:00
Faith Ekstrand
ca4d73ba36 nir: Add a combined alignment helper
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@colllabora.com>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21524>
2023-03-03 02:00:39 +00:00
Faith Ekstrand
e433a7c4fa nir: Add UBO support to nir_lower_mem_access_bit_sizes
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21524>
2023-03-03 02:00:39 +00:00
Faith Ekstrand
116a851264 nir: Add mode filtering to lower_mem_access_bit_sizes
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21524>
2023-03-03 02:00:39 +00:00
Faith Ekstrand
4b06b1a7c5 nir: Check against combined alignment in nir_lower_mem_access_bit_sizes
Checking against align_mul is insufficient if align_offset > 0.  We need
to check against the combined alignment instead.

Fixes: 2e2d7803c7 ("nir: Add a load/store bit size lowering pass")
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21524>
2023-03-03 02:00:39 +00:00
Patrick Lerda
352fee176c mesa/framebuffer: fix gl_framebuffer.resolve refcnt imbalance
Indeed, "resolve" is not freed at the gl_framebuffer destroy
stage.

For instance, this issue is triggered and detected with
"piglit/bin/fbo-depthstencil clear default_fb -samples=2 -auto"
while setting GALLIUM_REFCNT_LOG=refcnt.log.

Fixes: f5bde99cbd ("gallium: plumb resolve attachments through from frontends -> pipe_framebuffer_state")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21663>
2023-03-03 01:28:47 +00:00
Marek Olšák
73c91c4c8a radeonsi: assume shader is never NULL in si_emit_shader_*
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:49 +00:00
Marek Olšák
ab802a1f91 radeonsi: simplify encoding VGPRS and SGPRS
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:49 +00:00
Marek Olšák
63d5eb35f4 radeonsi: check the pm4.reg_va_low_idx assertion unconditionally
This is not a hot path. We can always do this.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:49 +00:00
Marek Olšák
51e4437eee radeonsi: add si_pm4_set_reg_va to simplify setting reg_va_low_idx for RGP
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:49 +00:00
Marek Olšák
8a564f72e5 radeonsi: reindent code in si_state_binning.c
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:49 +00:00
Marek Olšák
3a26d2b1a7 radeonsi: don't merge SET_* packets that have a different index in si_pm4_state
Oops.

Fixes: c8e2c6faf6 ("radeonsi: use SET_SH_REG_INDEX with index=3 for registers containing CU_EN")

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:49 +00:00
Marek Olšák
0d543d76d7 radeonsi: reorganize si_emit_framebuffer_state for better readability
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:49 +00:00
Marek Olšák
0669d7c29b radeonsi: remove Smart Access Memory because CPU access has large overhead
Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8176

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:49 +00:00
Marek Olšák
1862c8296c radeonsi/ci: update flakes and gfx8-polaris11 results
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:48 +00:00
Marek Olšák
3c9aa3e201 amd/rtld: allow 64K LDS for all shader stages except for gfx6
Gfx6 can only use 32K LDS per workgroup.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:48 +00:00
Marek Olšák
ccaaf8fe04 amd: massively simplify how info->spi_cu_en is applied
Instead of having ac_set_reg_cu_en that sets the register, replace it with
ac_apply_cu_en that only returns the modified register value,
which allows a large simplification in both drivers because a lot of code
becomes duplicated after it's switched to ac_apply_cu_en.

RADV also didn't apply it to a few registers. Fixed.

This removes 82 lines of code in total.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:48 +00:00
Marek Olšák
2b3f551ed8 ac/nir: don't use load_esgs_vertex_stride_amd on gfx6-8
An improvement for 9f1e6d8f70.

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/21641>
2023-03-03 00:41:48 +00:00
Marek Olšák
79732416fd amd: query cache sizes from the kernel
Also rename l1_cache_size -> tcp_cache_size. L1 means shader array cache.

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/21641>
2023-03-03 00:41:48 +00:00
Marek Olšák
6e2e89e6d8 amd,radeonsi: change enabled_rb_mask to 64 bits
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:48 +00:00
Marek Olšák
03ffb8d77c amd: update amdgpu_drm.h
From kernel commit 817714d9665e.

Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:48 +00:00
Asahi Lina
8e86ba3dd4 asahi: Pull device name from device struct
This isn't filled in yet, but will be once the UAPI init function is
added.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21662>
2023-03-03 00:28:48 +00:00
Asahi Lina
f1dac37b3d asahi: Add agx_bo_mmap() calls to transfer path
We have the prototype for this already.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21662>
2023-03-03 00:28:48 +00:00
Asahi Lina
3716f72413 asahi: Add result buffer to context/batches
The result buffer is where the kernel places statistics and fault
information after the GPU executes a command. Dummy structure pending
UAPI.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21662>
2023-03-03 00:28:48 +00:00
Asahi Lina
798fc2730b asahi: Add agx_debug_fault() helper
We expect to forward GPU fault information to userspace. Since Mesa can
get that information, we can look up the fault address to log what was
the containing or nearest BO. Add a helper for that, so it can be called
from the driver.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21662>
2023-03-03 00:28:48 +00:00
Asahi Lina
240e9dc5dc asahi: Add APIs for DMA-BUF sync file import/export
These are generic ioctls, so it is safe to add them now.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21662>
2023-03-03 00:28:48 +00:00
Asahi Lina
d610f40e17 asahi: Implement Linux driver scaffolding, sans UAPI
With macOS support out of the way, we can start implementing a lot of
the Linux driver interface and bookkeeping without actually adding the
UAPI proper. Let's do that to reduce the size of the UAPI patchset.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21662>
2023-03-03 00:28:48 +00:00
Asahi Lina
942d9cc17b asahi: Align device submission API with upcoming UAPI
Nothing implemented, but this lets us get the batch tracking bits in,
including explicit sync/DMA-BUF integration which uses generic ioctls.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21662>
2023-03-03 00:28:48 +00:00
Asahi Lina
7f2e24d2ef asahi: Add nocluster,sync,stats debug flags
These are only useful with the upcoming Linux UAPI, but there's no harm
in getting the debug scaffolding in now.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21662>
2023-03-03 00:28:48 +00:00
Asahi Lina
afe134a49c asahi: Drop macOS backend
This might be useful in the future, but it is best reimplemented in
terms of the upcoming Linux UAPI instead of having parallel codepaths.
Let's drop it.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21662>
2023-03-03 00:28:48 +00:00
Yiwei Zhang
b5e7a22c2e venus: ensure invariance of buffer memory requirement size
Need to align the size for the initial cache miss.

Fixes: ef255444c1 ("venus: switch to lazy VkBuffer cache")

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21644>
2023-03-03 00:07:23 +00:00
Marek Olšák
2e2605e297 mesa: initialize VertexProgram._VaryingInputs before the first use
Noticed by code inspection.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21438>
2023-03-02 23:38:12 +00:00
Marek Olšák
0a71957a9b mesa: remove a redundant call to _mesa_update_edgeflag_state_vao
It's called again a few lines later.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21438>
2023-03-02 23:38:12 +00:00
Marek Olšák
0293f8d8ce mesa: fix glPopClientAttrib with fixed-func VP and zero-stride varyings
This was missed.

Fixes: 3a294ff01f - mesa: move the _mesa_set_varying_vp_inputs call to where the state changes
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8246

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21438>
2023-03-02 23:38:12 +00:00
Alexandros Frantzis
689ce66a43 vulkan/wsi/wayland: Fix destruction of event queue with proxies still attached.
Destroy the surface dmabuf feedback proxy before destroying the event
queue that the proxy is attached to.

This silences a warning that libwayland 1.22 emits for programs that use
Vulkan/Wayland:

warning: queue 0x557a4efbcf70 destroyed while proxies still attached:
  zwp_linux_dmabuf_feedback_v1@18 still attached

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21647>
2023-03-02 19:09:29 +00:00
Alexandros Frantzis
ee5d2250fd egl/wayland: Fix destruction of event queue with proxies still attached.
Destroy the display wrapper proxy before destroying the event queue that
the proxy is attached to.

This silences a warning that libwayland 1.22 emits for programs that use
EGL/Wayland:

warning: queue 0x562a5ed2cd20 destroyed while proxies still attached:
  wl_display@1 still attached

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21646>
2023-03-02 18:32:02 +00:00
Lionel Landwerlin
f1e4d5c910 anv: fix scratch buffer reloc in 3DSTATE_HS
We need to have the scratch buffer added to the pipeline BO tracking
list, so it's added to the batch buffer and finally to the execbuffer
list. Otherwise we pagefault (or read the default scratch page on
i915).

Fixes
dEQP-VK.subgroups.ballot_broadcast.graphics.subgroupbroadcast_u16vec4
on CI (and probably other tests).

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 2028f1caa3 ("anv: emit 3DSTATE_HS in cmd_buffer_flush_gfx_state")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21653>
2023-03-02 17:51:41 +00:00
Väinö Mäkelä
e509afacf3 hasvk: Disable non-zero fast clears for 8xMSAA images
Using texelFetch to read samples from an 8xMSAA fast cleared image on
Haswell can read transparent black pixels around triangles from where
there should be none. This issue isn't present when using sample
shading, resolving the image using vkCmdResolveImage or in a copy the
image. The easiest way to fix this is by just disabling non-zero fast
clears for 8xMSAA images.

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

Cc: mesa-stable
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21444>
2023-03-02 17:26:09 +00:00
Rhys Perry
dc01f03d1b radv: remove is_internal pipeline creation parameter
Instead, check if the cache is the meta shader cache. This catches the
shaders created by radv_create_radix_sort_u64().

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/21606>
2023-03-02 16:48:09 +00:00
Karmjit Mahil
9905322df9 pvr: Advertise STORAGE_IMAGE_BIT for B10G11R11_UFLOAT_PACK32
For optimalTilingFeatures we should be advertising
STORAGE_IMAGE_BIT for B10G11R11_UFLOAT_PACK32 too.

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/21649>
2023-03-02 16:33:53 +00:00
Karmjit Mahil
225ae96357 pvr: Don't advertise currently unsupported features
This commit removes the advertising of features that are currently
unsupported by the driver and aren't strictly necessary for
Vulkan 1.0.

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/21649>
2023-03-02 16:33:53 +00:00
Samuel Pitoiset
4ec6850210 radv: fix DCC decompress on GFX11
The hardware requires one color output to be set by CB registers,
otherwise the DCC decompression does nothing.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8127
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8175
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8370
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21629>
2023-03-02 16:03:31 +00:00
Tatsuyuki Ishi
57ab623f0b radv: Use common helpers to translate format in SDMA copy.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21585>
2023-03-02 15:29:47 +00:00
Tatsuyuki Ishi
4f681d5e2c radv: Remove SDMA padding from copy helpers.
These are handled in winsys already; no need to duplicate and complicate
the code paths.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21585>
2023-03-02 15:29:47 +00:00
Tatsuyuki Ishi
e9a55b332a radv: SDMA v4 size field is size - 1
After cross-checking with kernel and the old buffer copy code, it seems
that the size field should be size - 1 instead.

Fixes: 7b5ab48c40 ("radv: partial sdma support")

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/21585>
2023-03-02 15:29:47 +00:00
Tatsuyuki Ishi
4f50497a96 radeonsi: SDMA v4 size field is size - 1
After cross-checking with kernel and the old buffer copy code, it seems
that the size field should be size - 1 instead.

Fixes: 46c95047bd ("radeonsi: implement si_sdma_copy_image for gfx7+")

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/21585>
2023-03-02 15:29:47 +00:00
Lionel Landwerlin
c914e70bce anv/hasvk: speed up null image/view descriptor writes
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reported-by: Chuansheng Liu <chuansheng.liu@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21642>
2023-03-02 15:03:25 +00:00
Kai-Heng Feng
646cff13bc Revert "iris: Avoid abort() if kernel can't allocate memory"
This reverts commit f9d8d9acbb.

Now ENOMEM is handled in submit_batch(), we don't need to check it for
resetting anymore.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20449>
2023-03-02 14:30:17 +00:00
Kai-Heng Feng
5aae8a0526 iris: Retry DRM_IOCTL_I915_GEM_EXECBUFFER2 on ENOMEM
We are seeing endless DRM_IOCTL_SYNCOBJ_WAIT ioctl when system memory is
under pressured.

Commit f9d8d9acbb ("iris: Avoid abort() if kernel can't allocate
memory") avoids the abort() on ENOMEM by resetting the batch. However,
when there's an ongoing OpenGL query, resetting the batch will make the
snapshots_landed never be flipped, so iris_get_query_result() gets stuck
in the while loop forever.

Since there's no guarantee that the next batch after resetting won't hit
ENOMEM, so instead of resetting the batch, be patient and wait until kernel has
enough memory. Once the batch is submiited and snapshots_landed gets
flipped, iris_get_query_result() can proceed normally.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6851
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20449>
2023-03-02 14:30:17 +00:00
Tapani Pälli
207eb94445 intel/compiler: add comment about workaround on simd width
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/21619>
2023-03-02 14:06:36 +00:00
Samuel Pitoiset
427fd83d27 radv: use new EVENT_WRITE_ZPASS packet3 on GFX11
Ported from RadeonSI.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21621>
2023-03-02 12:53:27 +00:00
Samuel Pitoiset
87444bb7ab radv: ignore alpha_is_on_msb on GFX11 because the hw ignores it
Ported from RadeonSI.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21621>
2023-03-02 12:53:27 +00:00
Georg Lehmann
0a3387a190 nir/lower_mediump: don't use fp16 for constants if the result is denormal
Image stores are not required to preserve denorms.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21622>
2023-03-02 11:42:10 +00:00
Georg Lehmann
ede0630f9e aco: use v_fma_mix_f32 for v_fma_f32 with 2 fp16 representable, different literals
We can pack two fp16 literals into one 32bit literal and use opsel to select
the correct value. Note that LLVM currently disassembles these instructions
incorrectly.

Foz-DB Navi21:
Totals from 13365 (9.91% of 134913) affected shaders:
VGPRs: 840880 -> 840016 (-0.10%); split: -0.11%, +0.01%
SpillSGPRs: 724 -> 722 (-0.28%)
CodeSize: 82439364 -> 82451336 (+0.01%); split: -0.06%, +0.08%
MaxWaves: 244858 -> 244980 (+0.05%)
Instrs: 15265976 -> 15247201 (-0.12%); split: -0.13%, +0.01%
Latency: 223316180 -> 223272495 (-0.02%); split: -0.03%, +0.02%
InvThroughput: 41981375 -> 41969917 (-0.03%); split: -0.04%, +0.01%
VClause: 266775 -> 266558 (-0.08%); split: -0.14%, +0.06%
SClause: 646602 -> 645996 (-0.09%); split: -0.16%, +0.07%
Copies: 794703 -> 776075 (-2.34%); split: -2.46%, +0.12%
Branches: 296317 -> 296316 (-0.00%)
PreSGPRs: 658796 -> 656479 (-0.35%); split: -0.35%, +0.00%
PreVGPRs: 744014 -> 743679 (-0.05%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20587>
2023-03-02 10:59:05 +00:00
Georg Lehmann
ed349951cb aco: mark mad definition as precise if the mul/add were precise
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20587>
2023-03-02 10:59:05 +00:00
Samuel Pitoiset
f19fccd9f8 amd,ac/rgp: fix SQTT memory types
This crashed on Steam Deck because the memory type is LPDDR5 and it
wasn't not handled in the switch. It seems the kernel changed the
memory type returned for VanGogh because it used to work.

Fixes: aef7ea868f ("ac/gpu_info: handle LPDDR4 and 5 in ac_memory_ops_per_clock")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@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/21627>
2023-03-02 07:54:35 +00:00
Emma Anholt
bb122202b6 gallivm: Add some notes about other invocation_0_must_be_active usages.
So that the next person trying to cut down LLVM compile times doesn't trip
over this.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21142>
2023-03-02 04:47:35 +00:00
Emma Anholt
66dff3d39c gallivm: Use first_active_invocation for scalar SSBO loads.
Again, this should reduce the complexity of the LLVM IR we emit in some
cases.  We don't use it for shared loads, due to the noted corner case.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21142>
2023-03-02 04:47:35 +00:00
Emma Anholt
a2b054c8f0 gallivm: Use first_active_invocation for ubo/kernel memory loads.
If we're just loading memory, we can take the scalar offset_is_uniform
paths even the first active invocation is nonzero, saving a bunch of
looping and bounds checking for per-element loads.  And, if we don't have
an active invocation, doing the load for element 0 (which is
bounds-checked to return 0 if element 0 had a bad value in it) before
throwing away the result is still better than doing bounds-checked loads
for each element before throwing away the result.

dEQP-VK.ubo.random.16bit.scalar.92 goes from 16.5 to 14.0 seconds.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21142>
2023-03-02 04:47:35 +00:00
Emma Anholt
1be626b618 gallivm: Return 0 for first active invocation when no invocations are active.
gallivm doesn't actuially jump across branches where no invocations are
active, so my previous assertion about the exec mask being nonzero was
incorrect.  This means that we'll always use a defined invocation for the
various LLVMBuildExtractElements using the result value, which is an
improvement over my even the code before my cttz change that would use
undefined values for the element to be extracted.

Fixes: 8c2493d041 ("gallivm: Use cttz instead of a loop for first_active_invocation().")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21142>
2023-03-02 04:47:35 +00:00
Chia-I Wu
e2c67ed63e ci/radv: remove dEQP-VK.image.sample_texture.* fails/flakes
They were fixed since commit 11b2a063bf ("vulkan: Unconditionally add
barriers for missing external subpass deps").

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21616>
2023-03-02 00:56:16 +00:00
Mark Janes
3c9a8f7a6d intel/dev: generate helpers to identify platform workarounds
Workarounds for defects in Intel silicon have been manually
implemented:

 - consult defect database for the current platform

 - add workaround code behind platform ifdef or devinfo->ver checks

Some bugs have occurred due to the manual process.  Typical failure
modes:

 - defect database is updated after a platform is enabled

 - version checks are overly broad (eg gfx11+) for defects that were
   fixed (eg in gfx12)

 - version checks are too narrow for defects that were extended to
   subsequent platforms.

 - missed workarounds

This commit automates workaround handling:

 - Internal automation queries the defect database to collate and
   summarize defect documentation in json.

 - mesa_defs.json describes all public defects and impacted platforms.
   Defects which are extended to subsequent platforms are listed under
   the original defect.

 - gen_wa_helpers.py generates workaround helpers to be called
   in place of version checks:

   - NEEDS_WORKAROUND_{ID} provides a compile time check suitable for
     use in genX routines.

   - intel_device_info_needs_wa() provides a more precise runtime
     check, differentiating platforms within a generation and
     platform steppings.

Internal automation will generate new mesa_defs.json as needed.
Workarounds enabled with these helpers will apply correctly based on
updated information in Intel's defect database.

Reviewed-by: Dylan Baker <dylan@pnwbakers>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20825>
2023-03-02 00:01:27 +00:00
Mark Janes
f11aab743b util: add macro to support gcc/clang poison
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20825>
2023-03-02 00:01:27 +00:00
Dylan Baker
a0fa31bcdd intel/dev: create a helper dependency for libintel_dev
This ensures that users of libintel_dev.a won't be compiled until
include files are generated, and that they are recompiled when the
header changes.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mark Janes <markjanes@swizzler.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20825>
2023-03-02 00:01:27 +00:00
Marek Olšák
98198a7782 glthread: fix a perf regression due to draw_always_async flag, fix DrawIndirect
Performance regressed by 31% in one VP2020/Creo subtest because
the draw_always_async flag wasn't implemented correctly. Remove it
instead of fixing it.

While removing it, I noticed that our DrawIndirect async conditions
were incorrect. I fixed them.

Fixes: 3b897719e6 - glthread: add ctx->GLThread.draw_always_async to simplify draw checking

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21566>
2023-03-01 23:18:10 +00:00
Illia Polishchuk
1eab7e69e2 glx: fix indirect initialization crash
Fixes: b090246a ("glx: Only compute client GL extensions for indirect contexts")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8393

Reviewed-by: Adam Jackson <ajax@redhat.com>

Signed-off-by: Illia Polishchuk <illia.a.polishchuk@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21591>
2023-03-01 19:54:00 +00:00
Giancarlo Devich
cc3c8c241e d3d12: Use memcmp for full tcs/gs variant keys
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21610>
2023-03-01 19:40:06 +00:00
Giancarlo Devich
f53188b7fa d3d12: Cache varying info to reduce compare/copy cost
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21610>
2023-03-01 19:40:06 +00:00
Giancarlo Devich
e4ba343ac9 d3d12: Compare shader key common parts with memcmp, instead of if's
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21610>
2023-03-01 19:40:06 +00:00
Giancarlo Devich
623a01827c d3d12: Compare shader keys with union-encompassing fields all at once
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21610>
2023-03-01 19:40:06 +00:00
Giancarlo Devich
ebd925e79c d3d12: Compare shader keys with a switch, instead of cascading if's
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21610>
2023-03-01 19:40:06 +00:00
Iván Briano
4887b88d22 anv: use the parameter passed to the macro
The two points calling this macro pass dyn->rs.provoking_vertex to it,
which is why it works, but it's cleaner to use the parameter instead.

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/21613>
2023-03-01 19:07:41 +00:00
Dylan Baker
a8691f916b intel/mi: use 64bit constant for bitshift
Coverity complains that we could end up rolling over on a 32bit
platform, which isn't really true because of the assertion, but there's
also no harm in ensuring that we have exactly the same behavior for both
32 bit and 64 bit platforms.

CID: 1515989
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21572>
2023-03-01 18:42:25 +00:00
Yiwei Zhang
054a83492d venus: fix VK_EXT_image_view_min_lod feature query
Fixes: 8b81098519 ("venus: enable VK_EXT_image_view_min_lod")

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21617>
2023-03-01 17:24:26 +00:00
Karmjit Mahil
1dfd535124 pvr: Setup SPM background object
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/21575>
2023-03-01 17:10:53 +00:00
Timothy Arceri
d75a36a9ee glsl: remove do_copy_propagation_elements() optimisation pass
Since 13b859de do_copy_propagation_elements() has a flaw where
the time it takes to complete grows exponentially slowers as the number
of nested loops increases. It can also hurt rather than help verses
just letting NIR optimise the code. So if the NIR linker is enabled we
let it handle it instead.

shader-db results Iris (BDW):

total instructions in shared programs: 11177181 -> 11199739 (0.20%)
instructions in affected programs: 119424 -> 141982 (18.89%)
helped: 109
HURT: 65
total cycles in shared programs: 368946819 -> 372277173 (0.90%)
cycles in affected programs: 116539428 -> 119869782 (2.86%)

total spills in shared programs: 3983 -> 8785 (120.56%)
spills in affected programs: 2072 -> 6874 (231.76%)
helped: 0
HURT: 6

total fills in shared programs: 2016 -> 6068 (200.99%)
fills in affected programs: 230 -> 4282 (1761.74%)
helped: 0
HURT: 6

LOST:   85
GAINED: 77

freedreno results:

total instructions in shared programs: 11011122 -> 11011620 (<.01%)
instructions in affected programs: 939829 -> 940327 (0.05%)
total full in shared programs: 762725 -> 762674 (<.01%)
full in affected programs: 1096 -> 1045 (-4.65%)
total constlen in shared programs: 1772092 -> 1771596 (-0.03%)
constlen in affected programs: 2780 -> 2284 (-17.84%)
total stp in shared programs: 4040 -> 4058 (0.45%)
stp in affected programs: 3656 -> 3674 (0.49%)
total ldp in shared programs: 2160 -> 2178 (0.83%)
ldp in affected programs: 1748 -> 1766 (1.03%)
stp HURT:   shaders/robclark-shaders/gfxbench5/gl_5_high_off/13.shader_test CL: 1231 -> 1234 (0.24%)
stp HURT:   shaders/robclark-shaders/gfxbench5/gl_5_normal_off/13.shader_test CL: 1231 -> 1234 (0.24%)
stp HURT:   shaders/robclark-shaders/gfxbench5/gl_5_high_off/15.shader_test CL: 453 -> 456 (0.66%)
stp HURT:   shaders/robclark-shaders/gfxbench5/gl_5_normal_off/15.shader_test CL: 453 -> 456 (0.66%)
stp HURT:   shaders/robclark-shaders/gfxbench5/gl_5_high_off/17.shader_test CL: 144 -> 147 (2.08%)
stp HURT:   shaders/robclark-shaders/gfxbench5/gl_5_normal_off/17.shader_test CL: 144 -> 147 (2.08%)

however, those stp counts are misleading -- gfxbench gl-5-normal actually
gets its scratch (ldp/stp) stored as 16 bits instead of 32 thanks to
better NIR copy prop, and the result is 2.64398% +/- 0.0991923% perf
improvement!

i915 results:

total instructions in shared programs: 510528 -> 510489 (<.01%)
instructions in affected programs: 3303 -> 3264 (-1.18%)
total tex_indirect in shared programs: 16708 -> 16717 (0.05%)
tex_indirect in affected programs: 134 -> 143 (6.72%)
total temps in shared programs: 30181 -> 30169 (-0.04%)
temps in affected programs: 1268 -> 1256 (-0.95%)
LOST:   0
GAINED: 1

i915 highlights:
instructions HURT:   shaders/closed/steam/legend-of-grimrock/47.shader_test FS: 141 -> 144 (2.13%)
instructions HURT:   shaders/closed/steam/steamworld-dig/22.shader_test FS: 84 -> 108 (28.57%)
temps HURT:   shaders/closed/steam/left-4-dead-2/medium/3682.shader_test FS: 7 -> 13 (85.71%)

r300 results:

total instructions in shared programs: 1340439 -> 1340845 (0.03%)
instructions in affected programs: 32354 -> 32760 (1.25%)
total temps in shared programs: 179394 -> 179329 (-0.04%)
temps in affected programs: 1505 -> 1440 (-4.32%)
total consts in shared programs: 1177742 -> 1177885 (0.01%)
consts in affected programs: 1107 -> 1250 (12.92%)
total lits in shared programs: 24992 -> 25019 (0.11%)
lits in affected programs: 138 -> 165 (19.57%)
instructions HURT:   shaders/closed/steam/legend-of-grimrock/26.shader_test FS: 47 -> 52 (10.64%)
instructions HURT:   shaders/closed/steam/sanctum-2/6072.shader_test FS: 43 -> 48 (11.63%)
instructions HURT:   shaders/closed/steam/champions-of-regnum/2378.shader_test VS: 35 -> 40 (14.29%)

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13288>
2023-03-01 16:09:25 +00:00
Emma Anholt
106019a5d8 nir/split_64bit_vec3_and_vec4: Handle 64-bit matrix types.
The offset handling should already work for flattening to our split vars,
just need to make sure we have enough (or any!) array elements.

Fixes: #7154
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13288>
2023-03-01 16:09:25 +00:00
Caio Oliveira
5f79e78911 spirv: Add skip_os_break_in_debug_build option to use in unit tests
When running in the CI environment, instead of crashing the test
binary, it is preferable to just fail gracefully (in this case return
a NULL shader) like is done in release mode, so other tests continue
to be executed.

For convenience add a variable break_on_failure to the test so the
breaking behavior can be re-enable in individual tests when debugging.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21512>
2023-03-01 13:47:57 +00:00
Caio Oliveira
8a91a33b7c spirv/tests: Add some basic control flow tests
The DISABLED test currently fails parsing.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21512>
2023-03-01 13:47:57 +00:00
Caio Oliveira
4e5b520286 spirv/tests: Parametrize stage in get_nir() helper
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21512>
2023-03-01 13:47:57 +00:00
Caio Oliveira
131f328a18 spirv/tests: Add script to generate C array from SPIR-V source
This is useful for generating the C code to embed the SPIR-V
when adding a new test.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21512>
2023-03-01 13:47:57 +00:00
Caio Oliveira
17e0c75441 spirv/tests: Subclass spirv_test helper to namespace the tests
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21512>
2023-03-01 13:47:57 +00:00
David Heidelberg
4cc0cec473 ci: implement unified sections
in after_script, variable $SCRIPTS_DIR is lost

Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20272>
2023-03-01 12:02:24 +00:00
David Heidelberg
5bfc17b2da ci: alpine: install bash and coreutils for date -d
bash is needed for consistency.
coreutils is needed for `date -d`.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20272>
2023-03-01 12:02:24 +00:00
David Heidelberg
6f0fcb0a0c ci/alpine: keep the curl inside the image
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20272>
2023-03-01 12:02:24 +00:00
Georg Lehmann
aeb68c29b4 nir/opt_algebraic: add patterns for iand/ior of feq/fneu with 0
Foz-DB Navi21:
Totals from 1245 (0.92% of 134913) affected shaders:
VGPRs: 66232 -> 66248 (+0.02%); split: -0.01%, +0.04%
CodeSize: 5874976 -> 5868168 (-0.12%); split: -0.17%, +0.05%
MaxWaves: 25278 -> 25274 (-0.02%); split: +0.01%, -0.02%
Instrs: 1087502 -> 1085267 (-0.21%); split: -0.21%, +0.00%
Latency: 6531489 -> 6531672 (+0.00%); split: -0.04%, +0.05%
InvThroughput: 1531774 -> 1532327 (+0.04%); split: -0.02%, +0.05%
VClause: 22218 -> 22202 (-0.07%); split: -0.08%, +0.00%
SClause: 45906 -> 45873 (-0.07%); split: -0.08%, +0.01%
Copies: 64004 -> 64102 (+0.15%); split: -0.24%, +0.39%
Branches: 21529 -> 21534 (+0.02%); split: -0.00%, +0.03%
PreSGPRs: 51936 -> 51850 (-0.17%)
PreVGPRs: 55393 -> 55398 (+0.01%); split: -0.02%, +0.03%

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21576>
2023-03-01 11:24:43 +00:00
Samuel Pitoiset
3ced4ae816 radv: only expose EXT_pipeline_library_group_handles if RT is enabled
VK_EXT_pipeline_library_group_handles requires
VK_KHR_ray_tracing_pipeline to be enabled.

Fixes dEQP-VK.info.device_extensions.

Fixes: ed76833705 ("radv: Implement & expose VK_EXT_pipeline_library_group_handles.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21618>
2023-03-01 10:55:00 +00:00
Caio Oliveira
863cbb3e02 spirv: Don't specify nir_var_uniform or nir_var_mem_ubo in barriers
These are constant read-only data and don't need to be synchronized.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21517>
2023-03-01 09:53:29 +00:00
Sai Teja Pottumuttu
530ae32c5d iris: Fix to release BO immediately if not busy
Currently the iris driver is adding the buffer objects to zombie list
without checking if it is busy or not. It checks for it after 1 second
which adds delay to buffer release.

This fix checks if the bo is busy or not before adding it to zombie list.

Without this fix, the applications expecting immediate buffer release would
fail.

The fix is identified while debugging below android cts tests:
android.graphics.cts.BitmapTest#testDrawingHardwareBitmapNotLeaking
android.graphics.cts.BitmapTest#testHardwareBitmapNotLeaking

Signed-off-by: Sai Teja Pottumuttu <sai.teja.pottumuttu@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21460>
2023-03-01 09:17:48 +00:00
Lionel Landwerlin
42e8a2c1d6 genxml: fix border color offset field on Gfx12+
I wonder if the docs are correct for Gfx11 because this is the
generation that gave us the Bindless Sampler Heap of 4Gb. So it would
make sense that the border colors can also be placed anywhere in that
4Gb heap.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21600>
2023-03-01 08:45:11 +00:00
Lionel Landwerlin
58b687d77b genxml: Fix STATE_BASE_ADDRESS::BindlessSurfaceStateSize field size
BSpec 44507

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21600>
2023-03-01 08:45:11 +00:00
Dave Airlie
24c09d4b16 radv: add video format support to format probing.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21457>
2023-03-01 07:16:47 +00:00
Tatsuyuki Ishi
bab235106e radv: Replace radv_trap_handler_shader with radv_shader.
Now that the upload memory is tied to the shader itself, the trap handler
shader no longer needs an additional wrapper.

This is a cleanup to ease introduction of a new shader uploading code path.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21541>
2023-03-01 05:12:10 +00:00
Dave Airlie
1f0fdcb619 anv: always pick graphics queue to execute prime blits on.
This will change when we get transfer queues but this should avoid
video queues being picked by accident.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21204>
2023-03-01 03:37:36 +00:00
Asahi Lina
494cb2e5ca asahi: Flush USC caches on the first draw
It seems that when batches are submitted back to back, the USC can
retain cache contents between them. This causes a problem when the CPU
updates a VBO between batches, since some of those updates might not be
visible to the USC.

Looks like the VDM barrier command with one magic bit set fixes this, so
let's try that.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21538>
2023-03-01 01:04:29 +00:00
Asahi Lina
70169c7488 asahi: Identify USC cache invalidate
Signed-off-by: Asahi Lina <lina@asahilina.net>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21538>
2023-03-01 01:04:29 +00:00
Asahi Lina
860ac5c149 asahi: Add readonly BO flag
Signed-off-by: Asahi Lina <lina@asahilina.net>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21538>
2023-03-01 01:04:29 +00:00
Asahi Lina
0498ad3e26 asahi: Add BO_SHAREABLE flag
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21538>
2023-03-01 01:04:29 +00:00
Lionel Landwerlin
672b2f9ad1 anv: remove more Gfx7 code
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21599>
2023-02-28 23:49:27 +00:00
Lionel Landwerlin
fc7680b7df iris: fix Wa_16011107343 for Gfx12
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: df9f71d795 ("iris: emit 3DSTATE_HS for each primitive on gfx12")
Acked-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21605>
2023-02-28 23:03:21 +00:00
Lionel Landwerlin
3cd72a2840 anv: fixup Wa_16011107343 for Gfx12 only
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 75968398f3 ("anv: emit 3DSTATE_HS for each primitive on gfx12")
Acked-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21605>
2023-02-28 23:03:21 +00:00
Guilherme Gallo
6cb0c8b6d7 ci: Reuse MESA_CI_PERFORMANCE_ENABLED in performance-rules
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21492>
2023-02-28 22:19:48 +00:00
Guilherme Gallo
5b9a610604 ci: Use workflow to make CI aware of performance jobs
With the workflow keyword, we can have more control over how pipelines
are created.

One of the features is to set a variable for the entire pipeline
depending on the rule. These variables would be available for all jobs
manifest and can be used inside job rules, for example.

We can use that to set a variable to enable performance jobs in the
pipeline, both at the YAML and script levels.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21492>
2023-02-28 22:19:48 +00:00
Guilherme Gallo
c91f4b2efb ci: Use release builds in perf jobs
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21492>
2023-02-28 22:19:48 +00:00
Guilherme Gallo
2fcd6df107 ci: Create debian-arm64-release job
To be able to upload the mesa's release build for arm64 to S3 and use it
in performance jobs.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21492>
2023-02-28 22:19:48 +00:00
Guilherme Gallo
c65eb88f0b ci: Upload debian-release artifact to S3
This will enable performance jobs to use release versions for
performance tracking, since they download the artifacts from S3.

We were using debugoptimized versions, which are not the most performant
ones.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21492>
2023-02-28 22:19:48 +00:00
Dave Airlie
53dda476a9 llvmpipe: fix compute address bits to return native pointer size.
On 32-bit systems llvm will only be dealing with 32-bit ptrs

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21601>
2023-02-28 21:55:09 +00:00
Jarred Davies
67904a36a6 pvr: Don't update fragment signal sync when fragment stage is disabled
Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21577>
2023-02-28 21:39:49 +00:00
Jarred Davies
4af1cf89ab pvr: Clear wait syncs after job submission
Avoids the fw having to process redundant waits.

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21577>
2023-02-28 21:39:49 +00:00
Jarred Davies
18fb8d3b55 pvr: Enable threaded submit when supported
Adds a winsys feature flag to enable threaded submit.

Currently pvrsrvkm can't support threaded submit as pvrsrvkm syncs don't
support VK_SYNC_FEATURE_WAIT_PENDING.

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21577>
2023-02-28 21:39:49 +00:00
Jarred Davies
5be2e44095 pvr: Add support for VK_KHR_timeline_semaphore
pvrsrvkm will run with VK_DEVICE_TIMELINE_MODE_EMULATED and
powervr will run with VK_DEVICE_TIMELINE_MODE_ASSISTED.

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21577>
2023-02-28 21:39:49 +00:00
Jarred Davies
80f864cd23 pvr: Use common queue submit implementation
A simplification of the synchronization code is also undertaken as part
of this commit to account for the implicit guarantee the FW gives the driver
that jobs submitted to the same context will be run in submission order.

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21577>
2023-02-28 21:39:49 +00:00
Konstantin Seurer
5ce99bc568 radv: Only init geometry infos if RRA is enabled
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21532>
2023-02-28 20:49:33 +00:00
Konstantin Seurer
7bd265bc86 radv: Move header and geometry info init into separate functions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21532>
2023-02-28 20:49:33 +00:00
Marcin Ślusarz
e74a3284f5 anv: halve the push constants space in mesh pipelines
It's only used by fragment shaders, so halving it matches the size
used in the most optimal primitive pipeline (VS + FS).

This change frees some URB space for mesh and task shaders and as
a result improves vk_meshlet_cadscene performance by up to 2%,
depending on the model.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21559>
2023-02-28 20:18:01 +00:00
Dylan Baker
814eb9e2ce iris: consider bufmgr creation to have failed if duping of the fd fails
Coverity points out that we can pass a negative value to `close()`,
which results in an unchecked error. While this is technically true, it
really isn't a problem as `close()` is speced to return -1 in that case
(which we ignore). However, what is true is that if we fail to dup the
fd (the only case where we could end up with a negative value), then
we're in an unrecoverable error state anyway, and should go to the error
cleanup code.

CID: 1521539
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21568>
2023-02-28 19:58:58 +00:00
David Heidelberg
0912b14b3a ci/freedreno: add flaking KHR-GL45.buffer_storage.map_persistent_flush
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21598>
2023-02-28 17:28:06 +00:00
David Heidelberg
baea3b328b intel/vulkan: add missing dependency on generated headers
Adding correct dependencies prevents occasional build flakes with parallel builds.

```
FAILED: src/intel/vulkan/libanv_common.a.p/anv_generated_indirect_draws.c.o
ccache cc -Isrc/intel/vulkan/libanv_common.a.p -Isrc/intel/vulkan -I../src/intel/vulkan -Iinclude -I../include -Isrc -I../src -Isrc/mapi -I../src/mapi -Isrc/mesa -I../src/mesa -I../src/gallium/include -Isrc/intel -I../src/intel -Isrc/compiler -I../src/compiler -Isrc/compiler/nir -I../src/compiler/nir -Isrc/vulkan/util -I../src/vulkan/util -Isrc/vulkan/runtime -I../src/vulkan/runtime -Isrc/vulkan/wsi -I../src/vulkan/wsi -Isrc/intel/genxml -Isrc/intel/vulkan/shaders -Isrc/intel/ds -I/usr/local/include -I/usr/local/include/libdrm -fvisibility=hidden -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -std=c11 -O2 -g -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '-DPACKAGE_VERSION="23.1.0-devel"' '-DPACKAGE_BUGREPORT="https://gitlab.freedesktop.org/mesa/mesa/-/issues"' -DHAVE_OPENGL=1 -DHAVE_OPENGL_ES_1=1 -DHAVE_OPENGL_ES_2=1 -DHAVE_SWRAST -DHAVE_VIRGL -DHAVE_RADEONSI -DHAVE_ZINK -DHAVE_CROCUS -DHAVE_IRIS -DHAVE_I915 -DVIDEO_CODEC_VC1DEC=1 -DVIDEO_CODEC_H264DEC=1 -DVIDEO_CODEC_H264ENC=1 -DVIDEO_CODEC_H265DEC=1 -DVIDEO_CODEC_H265ENC=1 -DHAVE_X11_PLATFORM -DHAVE_SURFACELESS_PLATFORM -DHAVE_DRM_PLATFORM -DHAVE_XCB_PLATFORM -DHAVE_ST_VDPAU -DENABLE_ST_OMX_BELLAGIO=0 -DENABLE_ST_OMX_TIZONIA=0 -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_DRM -DALLOW_KCMP -DENABLE_SHADER_CACHE -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 -DHAVE_REALLOCARRAY -D_GNU_SOURCE -DUSE_SSE41 -DUSE_GCC_ATOMIC_BUILTINS -DUSE_X86_64_ASM -DMAJOR_IN_SYSMACROS -DHAS_SCHED_H -DHAS_SCHED_GETAFFINITY -DHAVE_LINUX_FUTEX_H -DHAVE_ENDIAN_H -DHAVE_DLFCN_H -DHAVE_SYS_SHM_H -DHAVE_CET_H -DHAVE_SYS_INOTIFY_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_TIMESPEC_GET -DHAVE_MEMFD_CREATE -DHAVE_RANDOM_R -DHAVE_FLOCK -DHAVE_STRTOK_R -DHAVE_GETRANDOM -DHAVE_GNU_QSORT_R -DHAVE_STRUCT_TIMESPEC -DHAVE_PROGRAM_INVOCATION_NAME -DHAVE_ISSIGNALING -DHAVE_POSIX_MEMALIGN -DHAVE_DIRENT_D_TYPE -DHAVE_STRTOD_L -DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DSUPPORT_INTEL_INTEGRATED_GPUS -DHAVE_ZLIB -DHAVE_COMPRESSION -DHAVE_PTHREAD -DHAVE_PTHREAD_SETAFFINITY -DHAVE_LIBDRM -DLLVM_AVAILABLE '-DMESA_LLVM_VERSION_STRING="13.0.1"' -DLLVM_IS_SHARED=1 -DDRAW_LLVM_AVAILABLE -DUSE_LIBELF -DMESA_EXECMEM -DHAVE_LIBUNWIND -DHAVE_OPENMP -DHAVE_DRI -DHAVE_DRI2 -DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS -DHAVE_DRISW_KMS -DHAVE_PERFETTO -mtls-dialect=gnu2 -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=empty-body -Werror=incompatible-pointer-types -Werror=int-conversion -Wimplicit-fallthrough -Wmisleading-indentation -Wno-missing-field-initializers -Wno-format-truncation -Wno-nonnull-compare -fno-math-errno -fno-trapping-math -fno-common -Wno-unused-function -Werror=format -Wformat-security -ffunction-sections -fdata-sections -fPIC -DVK_USE_PLATFORM_XCB_KHR -DVK_USE_PLATFORM_XLIB_KHR -DVK_USE_PLATFORM_DISPLAY_KHR -DVK_USE_PLATFORM_XLIB_XRANDR_EXT -Wno-override-init -DANV_SUPPORT_RT=0 -MD -MQ src/intel/vulkan/libanv_common.a.p/anv_generated_indirect_draws.c.o -MF src/intel/vulkan/libanv_common.a.p/anv_generated_indirect_draws.c.o.d -o src/intel/vulkan/libanv_common.a.p/anv_generated_indirect_draws.c.o -c ../src/intel/vulkan/anv_generated_indirect_draws.c
../src/intel/vulkan/anv_generated_indirect_draws.c:34:10: fatal error: shaders/generated_draws_spv.h: No such file or directory
   34 | #include "shaders/generated_draws_spv.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
```

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21592>
2023-02-28 17:09:32 +01:00
Samuel Pitoiset
c356f1b4ed radv: fix draw calls with 0-sized index buffers and robustness on NAVI10
The correct workaround is to bind an internal index buffer to handle
robustness2 correctly.

Fixes dEQP-VK.robustness.index_access.* in CTS 1.3.5.0 on NAVI10.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21471>
2023-02-28 14:12:29 +00:00
Frank Binns
b1c19498c6 pvr: replace nop binary shader with run-time compiled shader
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21536>
2023-02-28 12:25:18 +00:00
Eric Engestrom
fa1cf83217 meson: allow checking for null pointers even if they're supposed to be non-null
../src/c11/impl/time.c: In function 'timespec_get':
    ../src/c11/impl/time.c:71:8: error: 'nonnull' argument 'ts' compared to NULL [-Werror=nonnull-compare]
       71 |     if (!ts)
          |        ^
    cc1: all warnings being treated as errors

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21558>
2023-02-28 11:46:20 +00:00
Mario Kleiner
bf5cfb6486 v3dv: Enable (leased) direct display extensions.
Enable support for the following extensions, which are already supported
by the driver and shared wsi code, and were just missing enables inside
v3dv_device:

VK_EXT_direct_mode_display, VK_EXT_acquire_drm_display,
VK_EXT_acquire_xlib_display.

Successfully tested on RPi 400, RaspberryPi OS 11, with X11 RandR output
leasing to lease a RandR output and use it for direct display mode.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21529>
2023-02-28 11:30:07 +00:00
Frank Binns
12f0daddfc pvr: initialise size for placeholder "zeroed" shaders
Fixes an assert() in pvr_gpu_upload_usc().

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/21537>
2023-02-28 10:59:13 +00:00
Eric Engestrom
c9f3ba987f glapi/meson: drop duplicate line in deps
Fixes: 0842bc879b ("meson: wire the new generator for es1 and es2")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21562>
2023-02-28 10:31:37 +00:00
Samuel Pitoiset
7c62f6fa01 radv: fix flushing non-coherent images in EndCommandBuffer()
The condition was inverted.

This doesn't fix anything known.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21549>
2023-02-28 09:35:07 +00:00
Samuel Pitoiset
6750a9094f radv: fix flushing non-coherent images inside secondaries on GFX9+
Fixes
dEQP-VK.draw.dynamic_rendering.complete_secondary_cmd_buff.multi_draw.mosaic.*
on VEGA10 (related to the use of HTILE).

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21549>
2023-02-28 09:35:07 +00:00
Eric Engestrom
78c95b2865 glsl: align definition of _mesa_problem with the one in main/error.h
The ctx pointer not used by that function anyway, so const'ing it makes
no difference.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21557>
2023-02-28 09:04:47 +00:00
Dylan Baker
ff494361be util: rzalloc and free hash_table_u64
Otherwise we're prone to leaking the table itself, since it's not freed
in the destroy function

CID: 1516552
fixes: 6649b840c3
       ("mesa/util: add a hash table wrapper which support 64-bit keys")

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21499>
2023-02-28 08:35:32 +00:00
Tapani Pälli
75968398f3 anv: emit 3DSTATE_HS for each primitive on gfx12
This is Wa_16011107343, same workaround as commit 880a3efe6c
but for gfx12.

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/21551>
2023-02-28 08:07:01 +00:00
Tapani Pälli
df9f71d795 iris: emit 3DSTATE_HS for each primitive on gfx12
This is Wa_16011107343, same workaround as commit a043ae8e24
but for gfx12.

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/21551>
2023-02-28 08:07:01 +00:00
Qiang Yu
4b3a22fcd4 aco: only ls and ps use store output now
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/21435>
2023-02-28 07:19:29 +00:00
Qiang Yu
e9616d1d2a ac/llvm: only init outputs when fragment shader for radv
LS pass output to TCS by reg is not enabled when LLVM.

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/21435>
2023-02-28 07:19:29 +00:00
Qiang Yu
ee9ccd7ac5 radeonsi: only init llvm output when needed.
These are the cases which still uses nir_store_output.

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/21435>
2023-02-28 07:19:29 +00:00
Emma Anholt
87ec94f6aa glsl: Move lower_vector_insert to GLSL-to-NIR.
We already have a nir_builder equivalent for generating this code, just
use that instead of doing it in GLSL.

No change on r300 shader-db.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21476>
2023-02-28 06:13:06 +00:00
Emma Anholt
f16a23aa9d panfrost/midgard: Drop redundant arg to emit_explicit_constant.
Every caller passed the same value twice.  Just reuse it?

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21476>
2023-02-28 06:13:05 +00:00
Emma Anholt
63aa5909b4 panfrost/midgard: Fix handling of csel with a vector constant condition.
If it's not all true or all false, then you'll have a csel with a vector
constant, and the backend failed to translate appropriately.  Expand the
constant to fix it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21476>
2023-02-28 06:13:05 +00:00
Yiwei Zhang
35c85c0ae6 venus: fix device memory export alloc info
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
23c350517a venus: fix external image creation
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
953ff3cf55 venus: simplify support for non-AHB external images
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
ca96f94aee venus: simplify ahb image creation
Those excessive asserts are only useful when bringing up Android.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
768017f72b venus: refactor image create info pnext tracking
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
4d616fb919 venus: remove redundant abstractions for wsi struct search
Doing that won't avoid linking wsi headers, and in fact we have already
included both android and common wsi headers. For swapchain info, it's
currently disabled by the swapchain spec version advertised on Android.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
21a0608395 venus: fix external buffer creation
Move buffer create info scrub into core venus.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
09f5033232 venus: distinguish external memory from mappable memory support
Mappable memory support is a must for Venus core, but the support of
such can be transparent to the driver. Thus the renderer external memory
type won't expose opaque fd type.

External memory over vtest can be exposed and the wsi support on top can
be made explicit as long as masking out the importable bit.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
19c3608672 venus: tighten up the sync fd requirements for Android wsi
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
657cd2e1d4 venus: refactor sync fd fence and sempahore features
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
05791b6ae0 venus: clean up globalFencing
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
344be4405c venus: clean up memoryResourceAllocationSize
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
6f8fe78e3b venus: start requiring all experimental features
This is to prepare for promoting exp features to core.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
9d76ed9638 venus: replace binary search with hardcode for max buffer size
Avoid the couple test buffer creations without maintenance4.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
417de28e43 venus: further disallow sparse resource
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Georg Lehmann
e1eabab6fe aco/optimizer_postRA: assume all registers are untrackable in loop headers
Register writes from the pre-header might not be correct for any but
the first loop iteration because they can be clobbered inside the loop.

Foz-DB Navi21:
Totals from 18 (0.01% of 134913) affected shaders:
CodeSize: 251384 -> 251508 (+0.05%)
Instrs: 47644 -> 47664 (+0.04%)
Latency: 801801 -> 801852 (+0.01%)
InvThroughput: 177579 -> 177593 (+0.01%)
Copies: 4752 -> 4771 (+0.40%)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8376
Fixes: d3b0f78110 ("aco/optimizer_postRA: Initialize loop header with preheader information")

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21540>
2023-02-28 04:27:05 +00:00
Mike Blumenkrantz
4c978d5445 zink: skip buffer barriers for ACCESS_NONE -> ACCESS_READ / ACCESS_WRITE
these do nothing and may cause unnecessary driver flushing

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21427>
2023-02-28 04:08:08 +00:00
Emma Anholt
fef6e6588b ci: Update traces expectations for gutting glsl opt_algebraic.
All look like harmless changes.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:09 +00:00
Emma Anholt
2f53188f18 glsl: Remove unused as_rvalue_to_saturate().
This is not where saturate recognition happens.  Dead code since
5598458e69 ("i965/vec4: Remove try_emit_saturate") in 2014!

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:09 +00:00
Emma Anholt
d76fb3b2b1 glsl/opt_algebraic: Drop the flrp recognizer.
No change to r300.

freedreno looks mixed but slightly positive in instructions:

total instructions in shared programs: 11012472 -> 11012453 (<.01%)
instructions in affected programs: 8250 -> 8231 (-0.23%)
helped: 16
HURT: 50

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:09 +00:00
Emma Anholt
579aca894f glsl/opt_algebraic: Drop the ftrunc pattern recognizer.
Now that it's in NIR, there's no change to r300 or freedreno shader-db
when we do.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:09 +00:00
Emma Anholt
6d52e6fd2c nir: Port a floor->truncate algebraic opt pattern from GLSL.
Prevents regression when dropping code from the GLSL optimizer.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:09 +00:00
Emma Anholt
6229d34b91 glsl/opt_algebraic: Drop some fmul simplifications.
Looks like mostly noise, trending slightly positively.

freedreno:

total instructions in shared programs: 11012781 -> 11012472 (<.01%)
instructions in affected programs: 114072 -> 113763 (-0.27%)
helped: 123
HURT: 153

r300:

total instructions in shared programs: 1338236 -> 1337897 (-0.03%)
instructions in affected programs: 3460 -> 3121 (-9.80%)
helped: 61
HURT: 11

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:09 +00:00
Emma Anholt
4bf65ce221 glsl/opt_algebraic: Drop the flrp/ffma simplifiers.
NIR seems to do a better job.  Freedreno:

total instructions in shared programs: 11013096 -> 11012781 (<.01%)
instructions in affected programs: 258358 -> 258043 (-0.12%)
helped: 470
HURT: 269

r300:

total instructions in shared programs: 1338237 -> 1338236 (<.01%)
instructions in affected programs: 161 -> 160 (-0.62%)
helped: 1
HURT: 0
total presub in shared programs: 45127 -> 44881 (-0.55%)
presub in affected programs: 1719 -> 1473 (-14.31%)
helped: 246
HURT: 0

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:09 +00:00
Emma Anholt
3f632ce764 glsl/opt_algebraic: Drop no-op pack/unpack optimization.
No change on freedreno shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
d589760f44 glsl/opt_algebraic: Drop the eq/neq add-removal optimization.
No change on freedreno or r300 shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
d352bd9737 glsl/opt_algebraic: Drop scalar all_eq/any_neq -> eq/neq opt.
No change in r300 or freedreno shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
62afead36f glsl/opt_algebraic: Drop fdot 0-channel optimizations.
No change on i915g shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
ef02581590 nir: Add optimization for fdot(x, 0) -> 0.
We had all these nice fdot opts to drop individual channels that were 0,
but nothing handling it being entirely 0!  Avoids r300g regression when
dropping them from GLSL.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
b328c97e11 glsl/opt_algebraic: Drop csel(true/false, x, y) optimization.
No change on freedreno shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
652ff42f14 glsl/opt_algebraic: Drop x + -x -> 0 optimization.
No change on freedreno shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
69b178ac90 glsl/opt_algebraic: Drop add/sub with 0 optimizations.
Looks like minor instruction selection noise in freedreno shader-db:

total instructions in shared programs: 11013100 -> 11013096 (<.01%)
instructions in affected programs: 2714 -> 2710 (-0.15%)
helped: 8
HURT: 6

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
c6908fc8ac glsl/opt_algebraic: Drop fdiv(1,x) -> frcp(x) and fdiv(x,1) -> x optimizations.
No change on freedreno shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
4fc9342fc6 glsl/opt_algebraic: Drop and/or/xor optimizations.
NIR has them, and if anything freedreno shader-db prefers that NIR sees them:

total instructions in shared programs: 11013112 -> 11013100 (<.01%)
instructions in affected programs: 26266 -> 26254 (-0.05%)
helped: 4
HURT: 0

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
ab7a9b4538 glsl/opt_algebraic: Drop rcp optimizations.
No change on freedreno shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
6b53d4b825 glsl/opt_algebraic: Drop pow optimizations.
These should all be covered by NIR.  Minor shader-db changes on freedreno,
which appear to be scheduling noise.

total instructions in shared programs: 11013132 -> 11013112 (<.01%)
instructions in affected programs: 3408 -> 3388 (-0.59%)

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
bb1b37e6c1 glsl/opt_algebraic: Drop shifts of 0 optimizations.
No change on freedreno shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
71c0c73f8e glsl/opt_algebraic: drop fsat(fadd(b2f(x), b2f(y))) -> b2f(ior(x, y)) opt.
No change on freedreno shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
144b61437a glsl/opt_algebraic: Drop f2i(trunc(x)) -> f2i(x) optimization.
No change on freedreno shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
47657b2ffe glsl/opt_algebraic: Drop -(-x) -> x optimization.
No change on freedreno shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
766f551cb5 glsl/opt_algebraic: Drop abs(-x) -> abs(x) and abs(abs(x)) -> abs(x).
NIR does this.  No change on freedreno shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
7a8a50106e glsl/opt_algebraic: Drop pow-recognizer.
NIR handles pow recognizing, too.  No change on freedreno shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
d79061dba1 glsl/opt_algebraic: Drop log(exp(x)) -> x and exp(log(x)) -> x optimisations.
No change on freedreno shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
2bd0343ba0 glsl/opt_algebraic: Drop ~~x == x transformation.
No change on freedreno shader-db.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Mike Blumenkrantz
36a916f3f4 zink: use tc renderpass optimizing to more optimally start queries
if tc has determined that no queries are ended inside a renderpass,
it becomes possible to start queries outside of a renderpass, which
is more performant on some hw

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
7c96e98975 zink: always start/stop/resume queries inside renderpasses
this avoids potentially splitting renderpasses by ensuring that
all (non-cs) query operations always occur inside renderpasses

zink_query_update_gs_states() now has to be called inside renderpass
to catch the active queries

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
cbbc7c98c4 zink: pull 'was_line_loop' into ctx for query updating
make this a bit more flexible

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
5492e927e7 zink: use more consistent check for deleting zink_query::stats_list links
the linkage of this may vary depending on the query's active state,
so avoid issues by just checking the linkage directly

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
b4deaf7b2c zink: break out query suspend functionality for reuse
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
53c9f60ce4 zink: track whether queries were started in a renderpass
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
e5d517f362 zink: rework query pool overflow
now when a query pool is full, a new query pool can be created and the
previous one can be dropped from reuse to be freed at a later time

this has the added benefit of avoiding yet another place where a renderpass
might get split

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
7da78ffb69 zink: create/use query pools dynamically
this fits the concept of "pools are shared between queries" a bit
better and leaves the pool ownership/destruction to their users

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
e56d4f9264 zink: rework find_or_allocate_qp()
this and its caller are now a bit more streamlined with regards to
functionality of the surrounding code

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
bf782503e1 zink: reorder some query code
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
8fdbf81ff0 zink: try updating qbos on query resume if !in_rp
this is another logical place to do the update since it won't split
a renderpass

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
49deb9cbe7 zink: only update qbo for TIME_ELAPSED on start if !in_rp
this otherwise splits the current renderpass for no reason

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
93a7187f34 zink: handle null query results for conditional render
this just needs to have a zero blasted into the buffer

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
cf60c7fbfa zink: handle null query results
it's possible that a query may have no results at all, so shortcut
everything and return zero as fast as possible for those cases

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
6bcf4721dc zink: only try doing qbo updates on query suspend if !in_rp
this otherwise creates infinite recursion trying to end a currently
ending renderpass

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
2440c98b3b zink: refuse to start cs invocation queries in renderpass
these can't produce data in renderpasses, so ensure they aren't accidentally
started inside a renderpass where they'll have to later be restarted outside
of one

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
74a65363ea zink: don't double suspend queries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
9d0c3d3fb1 zink: un-suspend queries if they end while suspended
ensure they don't accidentally resume themselves after suspend

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:41 +00:00
Mike Blumenkrantz
34e2d2ec58 zink: add zink_query::suspended to indicate suspended state of queries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:41 +00:00
Mike Blumenkrantz
74af46230c zink: don't auto-sync qbos on query end
these can now be synced later all at once

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:41 +00:00
Mike Blumenkrantz
c870c7c942 zink: handle multiple query starts in qbo update
this still isn't used due to how queries are started/stopped, but it should
be a bit more robust

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:41 +00:00
Mike Blumenkrantz
d60c864c45 zink: delete zink_query::last_start_idx
this was always zero

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:41 +00:00
Mike Blumenkrantz
c46d68235e zink: make zink_vk_query unref consistent
the no-check free seems suspicious

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:41 +00:00
Mike Blumenkrantz
eb5e0f5ab5 zink: fix possible query destroy leak
if the starts array has been reset, then the counter will be inaccurate,
and some of the members will leak, so this needs to iterate over the capacity
of the array instead of the contents

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:41 +00:00
Mike Blumenkrantz
10389698a0 zink: fix zink_query_start initialization
not sure if this was a bug, but it would have fully zeroed the struct
and prevented previous zink_vk_query members from being unrefed

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:41 +00:00
Mike Blumenkrantz
2a938c3e22 zink: rewrite zink_query_start struct
making the non-pool members easier to zero

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:41 +00:00
Mike Blumenkrantz
ed9909e3a0 zink: reset queries on the promoted cmdbuf when possible
this avoids splitting renderpasses just to reset queries

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:41 +00:00
Mike Blumenkrantz
96f7fe7191 zink: remove suspended queries from list before resuming
this avoids double-starting primgen queries from recursion when
needs_rast_discard_workaround is true

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:41 +00:00
Mike Blumenkrantz
4f53997574 zink: move zink_batch_no_rp call for query reset
this could otherwise pointlessly terminate a renderpass

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:41 +00:00
Patrick Lerda
7e613d2a32 mesa/shaderapi: fix path memory leak
For instance, with "piglit/arb_shading_language_include-api -auto -fbo" or
"piglit/shader_runner tests/spec/arb_shading_language_include/execution/replacement.shader_test -auto -fbo":
Direct leak of 66 byte(s) in 6 object(s) allocated from:
    #0 0x7fa4b59050 in __interceptor_strdup (/usr/lib64/libasan.so.6+0x59050)
    #1 0x7f9a098fe0 in validate_and_tokenise_sh_incl ../src/mesa/main/shaderapi.c:3383
    #2 0x7f9a0a43e8 in _mesa_NamedStringARB ../src/mesa/main/shaderapi.c:3547

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21553>
2023-02-28 01:17:35 +00:00
Giancarlo Devich
e7c5a8b3f8 d3d12: Don't loop in update_draw_indirect_with_sysvals
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21567>
2023-02-27 23:00:41 +00:00
Giancarlo Devich
bf6c214b25 d3d12: Create varying structures as necessary, reference them
This changes instances of d3d12_varying_info to d3d12_varying_info*,
significantly reducing the size of the d3d12_shader_key,
d3d12_gs_variant_key, and d3d12_tcs_variant_key.

Associated changes to key fill, compare, hashing, and gs and tcs variant
maps significantly reduce the amount of time spent clearing and
comparing memory.

The biggest win here is not having to re-zero _or_ re-fill varyings in
d3d12_fill_shader_key, validate_geometry_shader_variant, and
validate_tess_ctrl_shader_variant.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21527>
2023-02-27 22:05:34 +00:00
Giancarlo Devich
41d5e76f2c d3d12: Don't memcmp gs/tcs keys
This is unnecessary and incomplete. Not only is it covered by the hash
map lookup, but also does not consider the other key members.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21527>
2023-02-27 22:05:34 +00:00
Giancarlo Devich
30883c0145 d3d12: Don't unnecessarily zero out gs/tcs keys
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21527>
2023-02-27 22:05:34 +00:00
Giancarlo Devich
56d30bf591 d3d12: Track max varying slot, set and compare less bytes
Often, the full range of available slots don't need to participate in
the comparison or be zeroed out.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21527>
2023-02-27 22:05:34 +00:00
Giancarlo Devich
9a3820fe11 d3d12: Don't recompute has_flat_varyings or missing_dual_src_outputs
Per shader selection, these two flags can be expensive to compute.
Instead, recompute their values as neccessary, and save them in the
context.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21527>
2023-02-27 22:05:34 +00:00
Emma Anholt
d246948ce3 anv: Skip BTI RT flush if we're doing an op that doesn't use render targets.
rt_flushes emitted on zink sauer.trace --loop=500 -2.02118% +/- 1.15992% (n=8).

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21508>
2023-02-27 21:44:56 +00:00
Emma Anholt
2bd304bc8f anv: Skip the RT flush when doing depth-only rendering.
The spec citation says it's just for when the RT write message BTI might
point to a different RT, and if we don't have any color attachments then
we won't have one of those at all.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21508>
2023-02-27 21:44:56 +00:00
Mike Blumenkrantz
6992aa951d aux/tc: only call tc_parse_draw() when parsing renderpass info
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21533>
2023-02-27 21:04:56 +00:00
Mike Blumenkrantz
ad0d5a24aa aux/tc: track whether queries have been terminated in a renderpass
on tilers it's important to know whether a query is ended mid-renderpass
so that the query begin can occur inside/outside of the renderpass

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21533>
2023-02-27 21:04:56 +00:00
Caio Oliveira
91fa939763 panfrost: Use NIR scoped barriers instead of memory barriers
Now both GLSL and SPIR-V will produce the scoped barriers, so no
need to handle the old ones.

Control barriers are still present in some cases, so keep that
for now.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
2023-02-27 20:24:01 +00:00
Caio Oliveira
901bc6d53c pan/midgard: Handle nir_intrinsic_scoped_barrier in Midgard compiler
Behave the same as the existing more specific barrier intrinsics.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
2023-02-27 20:24:01 +00:00
Caio Oliveira
64a0266260 pan/compiler: Fix handling of nir_intrinsic_scoped_barrier
Only emit anything if this is a control barrier, i.e. contains an
execution scope.  Also change the assertion to look at that scope
instead of the memory scope.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
2023-02-27 20:24:01 +00:00
Caio Oliveira
c80268a20d intel/compiler: Mark various memory barriers intrinsics unreachable
Now that both SPIR-V and GLSL are using scoped barriers, we can stop
handling the specialized ones.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
2023-02-27 20:24:01 +00:00
Caio Oliveira
fe908ffefa glsl: Implement use_scoped_barrier option for lowering memory barriers
When the option is enabled, lower memory barriers to the
unified nir_intrinsic_scoped_barrier.

The translation of the following is based on
https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_gl_spirv.txt

- memoryBarrier()
- memoryBarrierBuffer()
- memoryBarrierImage()
- memoryBarrierShared()
- groupMemoryBarrier()

Also use scoped barrier for the memory counterparts of the GLSL
(control) barrier() when the option is enabled.  The execution
part of a (control) barrier() remains using the old intrinsic.

For memoryBarrierAtomicCounter() there's no corresponding
nir_var_atomic_counter mode. Since atomic counters are lowered
to SSBOs, use the nir_var_mem_ssbo mode in the scoped barrier
instead.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Acked-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
2023-02-27 20:24:01 +00:00
Caio Oliveira
2178a8da51 gallivm: Fix handling of nir_intrinsic_scoped_barrier
A scoped barrier only has a control barrier behavior if there's
an execution scope.

Fixes: 13d900de0d ("llvmpipe: set nir_shader_compiler_options::use_scoped_barrier")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
2023-02-27 20:24:01 +00:00
Caio Oliveira
e411e0afd3 microsoft/compiler: Handle scoped barrier in Tess splitting
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
2023-02-27 20:24:01 +00:00
Caio Oliveira
1db7e6a261 nir: Support use_scoped_barrier in nir_lower_atomics_to_ssbo
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Acked-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
2023-02-27 20:24:01 +00:00
Rob Clark
e45bbcf649 Revert "freedreno: Account for multi-draw in num_draws"
autotune already divides draw-cost by # of draws, but only increments
the draw-cost once per multi-draw.  We could either _also_ account for
draw-cost by multiply by # of draws for treat multi-draw as a single
draw.  The latter saves an integer multiply per draw.

Fixes a performance regression triggered by transition from GMEM to
sysmem rendering.

This reverts commit 6bfee9e669.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21543>
2023-02-27 18:30:09 +00:00
Emma Anholt
cc55a2e77d ci/crocus: Mark unvanquished as flaky.
It's started rendering something different again, with a similar sort of
bad rendering to what's linked in the bug report (though this time it's a
'P' that became a white square).  Commit range 65b62db0..964323fe has
nothing particularly likely in it, so I expect this is some sort of cache
flushing fail or something.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21565>
2023-02-27 18:16:07 +00:00
Emma Anholt
eac875a78e ci/crocus: Add new tess xfails and a link to the regression bug report.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21565>
2023-02-27 18:16:07 +00:00
Samuel Pitoiset
ca2d2ea60b zink/ci: skip one more test that timeout with RADV
It usually takes more than 60s to run.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21564>
2023-02-27 18:23:38 +01:00
Karol Herbst
4fb0adc43c ci/zink: move threading tests to flakes
We have some failed CI jobs where some of those tests randomly pass.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21561>
2023-02-27 17:05:20 +00:00
Mike Blumenkrantz
afd5a95d61 docs: add pipeline library support for tu
Acked-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21560>
2023-02-27 17:00:12 +00:00
Ryan Neph
03ffbcb29a Revert "venus: temporarily redirect VkDrmFormatModifierPropertiesListEXT to "2" variant"
No longer need to redirect, since the renderer should use the fixed
decoder for VkDrmFormatModifierPropertiesListEXT::drmFormatModifierCount
by now.

This reverts commit 525b8c582f.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21395>
2023-02-27 16:45:02 +00:00
Ryan Neph
1d12d7c33c venus: update venus-protocol headers to fix WA1
Follow-up to previous commit, this time to fix encoding/decoding for
VkDrmFormatModifierPropertiesListEXT::drmFormatModifierCount. Fixes a
workaround (WA1) in the venus-protocol.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21395>
2023-02-27 16:45:02 +00:00
Alyssa Rosenzweig
4eabd6586b nir/lower_blend: Don't dereference null
If a dual source blend colour is never written, src1 will be null and it will be
invalid to dereference it. src1 is dereferenced both for the f2fN instruction
but also if a dual blend factor is used... even if the latter isn't strictly
valid, segfaulting in the NIR pass seems a lot meaner than blending with zero.

The referenced commit hosed Asahi, causing anything that used blending to crash.
Panfrost is unaffected since it always supplies a dual colour due to our crude
construction of blend shaders.

Fixes: 8313016543 ("nir/lower_blend: Consume dual stores")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21544>
2023-02-27 15:47:33 +00:00
Rhys Perry
75d9a4a6ce aco: always update orig_names in get_reg_phi()
No idea why this wasn't done if pc.first was a renamed temporary.

Fixes navi10 RA validation error with
dEQP-VK.binding_model.descriptor_buffer.multiple.graphics_geom_buffers1_sets3_imm_samplers

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8349
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21501>
2023-02-27 15:10:22 +00:00
Eric Engestrom
735df516e9 radv: split linker script for android since it requires different symbols
Fixes: 4956f6d0bf ("radv: Add Android module info to linker script.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8338
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21518>
2023-02-27 14:34:16 +00:00
Yonggang Luo
669a68489d meson: Use sse2_arg and sse2_args to replace usage of c and c_sse2_args
And now c_sse2_arg and c_sse2_args are remvoed

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21375>
2023-02-27 13:50:11 +00:00
Yonggang Luo
ddf708a1ff meson: Split sse2_arg and sse2_args out of c_cpp_args
This is used to replace c_sse2_arg and c_sse2_args in latter commits

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21375>
2023-02-27 13:50:11 +00:00
Yonggang Luo
446630ab42 meson: When sse2 enabled, both c and cpp using sse2 options
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21375>
2023-02-27 13:50:11 +00:00
Mike Blumenkrantz
c1a62476ac vulkan/wsi/x11: make 4 image minimum for xwayland driver-specific
this avoids adding extra frames of latency to drivers that don't need
it

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21447>
2023-02-27 13:21:21 +00:00
Mike Blumenkrantz
7c8a5f6e37 vulkan/wsi: switch to using an options struct for last param
this makes adding values easier since the drivers won't need to be updated

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21447>
2023-02-27 13:21:21 +00:00
Georg Lehmann
1c5c2f77c3 aco: use and swizzle mask in dpp quad perm
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21412>
2023-02-27 11:09:42 +00:00
Georg Lehmann
8fabde3be4 aco/gfx11: use dpp_row_xmask and dpp_row_share
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21412>
2023-02-27 11:09:42 +00:00
Georg Lehmann
b7cd0eb439 aco: use v_permlane(x)16_b32 for masked swizzle
Should be cheaper than ds_swizzle.

Totals from 8 (0.01% of 134913) affected shaders:
CodeSize: 16316 -> 16388 (+0.44%)
Instrs: 3088 -> 3086 (-0.06%)
Latency: 49558 -> 49508 (-0.10%)
InvThroughput: 9180 -> 9198 (+0.20%)
Copies: 376 -> 384 (+2.13%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21412>
2023-02-27 11:09:42 +00:00
Georg Lehmann
9f155c21c3 amd: d16 uses rtz conversion for 32bit float
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21404>
2023-02-27 09:55:34 +00:00
Georg Lehmann
77252687fa amd: don't use d16 for integer loads
D16 saturates to min/max instead of just truncating.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21404>
2023-02-27 09:55:34 +00:00
Georg Lehmann
a00b50d820 nir: change 16bit image dest folding option to per type
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21404>
2023-02-27 09:55:34 +00:00
Samuel Pitoiset
a14d46fde2 radv: enable primitiveUnderestimation on GFX9+
It's passing dEQP-VK.rasterization.conservative.underestimate.* on
NAVI21.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21459>
2023-02-27 09:04:01 +00:00
Samuel Pitoiset
dba7a66429 radv: set MSAA_NUM_SAMPLES to 0 for underestimate rasterization
Based on PAL.

Fixes
dEQP-VK.rasterization.conservative.underestimate.samples_*.triangles.normal.test.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21459>
2023-02-27 09:04:01 +00:00
Samuel Pitoiset
0eae617826 radv: stop setting ENABLE_POSTZ_OVERRASTERIZATION to 1
According to PAL this isn't set.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21459>
2023-02-27 09:04:01 +00:00
Samuel Pitoiset
05732f4519 radv: cleanup radv_emit_{conservative,msaa}_state() functions
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21459>
2023-02-27 09:04:01 +00:00
Mike Blumenkrantz
34e7c17cfe lavapipe: EXT_image_sliced_view_of_3d
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21514>
2023-02-27 07:49:48 +00:00
Lionel Landwerlin
66e3ccbcac vulkan/runtime: store parameters of VK_EXT_sliced_view_of_3d
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21514>
2023-02-27 07:49:48 +00:00
Tatsuyuki Ishi
ed03821442 radv/sqtt: Use code buffer from radv_shader directly instead of copying.
The reference-counted radv_shader always outlives the pipeline, so we can
use this buffer directly when dumping code objects to the trace.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21513>
2023-02-27 07:16:48 +00:00
Tatsuyuki Ishi
ea070fb83a radv: Keep shader code ptr in a separately allocated buffer.
RGP traces need a dump of shader code in order to display ISA and
instruction trace. Previously, this was read back from GPU at trace
creation time. However, for future changes that implements upload shader
to invisible VRAM, the upload destination will be a temporary staging
buffer and will be only accessible during shader creation.

To allow dumping in such cases, copy the shader code to a separate buffer
at creation time, if thread tracing is enabled.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21513>
2023-02-27 07:16:48 +00:00
Mike Blumenkrantz
52f27cda05 zink: allow direct memory mapping for any COHERENT+CACHED buffer
some drivers may provide this in heaps that get used by non-staging resources,
so avoid extra copies in that case

unlike the previous attempt at this optimization, this utilizes the screen-based
context for thread-safe transfers, which should avoid races/crashes

fix #8171

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21452>
2023-02-27 03:50:14 +00:00
Mike Blumenkrantz
d78de2a962 zink: add locking for zink_screen::copy_context and defer creation
the copy context isn't always used, so this allows its creation to
be deferred and potentially save a bunch of memory

also add locking for multi-context thread safety

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21452>
2023-02-27 03:50:14 +00:00
Mike Blumenkrantz
a7b98dd4be zink: avoid adding ubo/ssbo bindings multiple times for different bitsizes
these are valid variables, but the descriptor binding needs to be unique

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21522>
2023-02-27 03:11:44 +00:00
Mike Blumenkrantz
db1af91f1b zink: simplify/rework image typing in ntv
the array approach was broken if a shader contained both bindless
and non-bindless resources, whereas a hash table is simpler and can
handle both images and samplers

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21522>
2023-02-27 03:11:44 +00:00
Mike Blumenkrantz
ac5f72a023 zink: delete unused emit_image param in ntv
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21522>
2023-02-27 03:11:44 +00:00
Mike Blumenkrantz
fb4fd03db9 zink: fix bindless texture barrier generation
whenever I redid barriers I forgot to handle bindless textures,
which meant they weren't getting barriers added

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21522>
2023-02-27 03:11:44 +00:00
Mike Blumenkrantz
75e9ba85de zink: rework descriptor unbind params to use is_compute directly
much simpler

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21522>
2023-02-27 03:11:44 +00:00
Mike Blumenkrantz
ddb116d755 zink: fix shader read access removal for barrier generation
barrier access is based on total binds per gfx/compute, not per stage

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21522>
2023-02-27 03:11:44 +00:00
Mike Blumenkrantz
00288d4f53 zink: delete dead uniform variables
this just obfuscate nir, so delete them now

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21522>
2023-02-27 03:11:44 +00:00
Alyssa Rosenzweig
760f367386 agx: Lower sampler LOD bias
G13 does not support sampler descriptor LOD biasing, so this needs to be lowered
to shader code for APIs that require this functionality. Add an option to do
this lowering while doing our other backend texture lowerings. This generates
lod_bias_agx texture instructions which the driver is expected to lower
according to its binding model.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21276>
2023-02-27 02:35:41 +00:00
Alyssa Rosenzweig
23f271833f asahi: Lower lod_bias_agx to uniform registers
Track the LOD bias of samplers and upload them at draw time to uniform
registers. This could be optimized in the future.

Vulkan will probably want to pull from a descriptor set instead.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21276>
2023-02-27 02:35:41 +00:00
Alyssa Rosenzweig
8058d31a25 nir: Add nir_texop_lod_bias_agx
Add a new texture opcode that returns the LOD bias of the sampler. This will be
used on AGX to lower sampler LOD bias to txb and friends. This needs to be a
texture op (and not a new intrinsic) to handle both bindless and bindful
samplers across GL and Vulkan in a uniform way.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21276>
2023-02-27 02:35:41 +00:00
Qiang Yu
822e756511 ac/llvm,radeonsi: lower fbfetch in abi
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/21436>
2023-02-27 09:43:53 +08:00
Qiang Yu
28c2527e42 radeonsi: add num_component param to load_internal_binding
Prepare for different component number, ie. 8 when image desc.

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/21436>
2023-02-27 09:39:41 +08:00
Qiang Yu
5c44404b5f ac/llvm,radeonsi: lower nir_load_barycentric_at_sample in abi
RADV already did this in radv_lower_fs_intrinsics().

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/21436>
2023-02-27 09:39:41 +08:00
Marek Olšák
0c8e7ad47e nir: lower to fragment_mask_fetch/load_amd with EQAA correctly
Fixes: 194add2c23 ("nir: lower image add lower_to_fragment_mask_load_amd option")
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21436>
2023-02-27 09:39:41 +08:00
Alyssa Rosenzweig
8313016543 nir/lower_blend: Consume dual stores
Now that we're working on lowered I/O, passing in the dual source blend colour
via a sideband doesn't make any sense. The primary source blend colours are
implicitly passed in as the sources of store_output intrinsics; likewise, we
should get dual source blend colours from their respective stores. And since
dual colours are only needed by blending, we can delete the stores as we go.
That means nir_lower_blend now provides an all-in-one software lowering of dual
source blending with no driver support needed! It even works for 8 dual-src
render targets, but I don't have a use case for that.

The only tricky bit here is making sure we are robust against different orders
of store_output within the exit block. In particular, if we naively lower

   x = ...
   primary color = x
   y = ...
   dual color = y

we end up emitting uses of y before it has been defined, something like

   x = ...
   primary color = blend(x, y)
   y = ...

Instead, we remove dual stores and sink blend stores to the bottom of the block,
so we end up with the correct

   x = ...
   y = ...
   primary color = blend(x, y)

lower_io_to_temporaries ensures that the stores will be in the same (exit)
block, so we don't need to sink further than that ourselves.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21426>
2023-02-26 17:35:08 -05:00
Alyssa Rosenzweig
44bdcb7214 panfrost: Use proper locations in blend shaders
Rather than always blending to FRAG_RESULT_DATA0. This removes silly special
cases in the compiler.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21426>
2023-02-26 17:35:07 -05:00
Francisco Jerez
4420251947 intel/rt: Fix L3 bank performance bottlenecks due to SW stack stride alignment.
Power-of-two SW stack sizes are prone to causing collisions in the
hashing function used by the L3 to map memory addresses to banks,
which can cause stack accesses from most DSSes to bottleneck on a
single L3 bank.  Fix it by padding the SW stack stride by a single
cacheline if it was a power of two.  This has been reported by Felix
DeGrood to improve Quake2 RTX performance by ~30% on DG2-512 in
combination with other RT patches Lionel Landwerlin has been working
on.

Many thanks to Felix DeGrood for doing much of the legwork and
providing several iterations of Q2RTX performance counter dumps which
eventually prompted me to consider the hash collision theory and
motivated this patch, and for providing additional performance counter
dumps confirming that there is no longer an appreciable imbalance in
traffic across L3 banks after this change.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21461>
2023-02-26 11:48:33 -08:00
Friedrich Vock
de4e3da4c4 docs: Fix formatting for RMV tracing docs
Fixes: e1cbff22 ("docs: Add short documentation about RMV tracing variables")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21502>
2023-02-26 19:15:44 +00:00
David Heidelberg
be2961de09 meson: print c_cpp_args
Acked-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21539>
2023-02-26 16:55:30 +01:00
Konstantin Seurer
2d93ab795b radv/rt: Pre shift cull_mask
This removes the need for masking the instance mask.

Totals from 14 (14.43% of 97) affected shaders:
CodeSize: 378696 -> 378308 (-0.10%); split: -0.12%, +0.02%
Instrs: 70854 -> 70855 (+0.00%); split: -0.02%, +0.02%
Latency: 1651235 -> 1651215 (-0.00%); split: -0.00%, +0.00%
InvThroughput: 336290 -> 336285 (-0.00%); split: -0.00%, +0.00%
Copies: 9915 -> 9923 (+0.08%); split: -0.03%, +0.11%
PreSGPRs: 890 -> 896 (+0.67%)

 PERCENTAGE DELTAS Shaders  CodeSize   Instrs   Latency  InvThroughput   Copies   PreSGPRs
 q2rtx-pipe        48        -0.02%    -0.02%    -0.00%      -0.00%      -0.03%      .
 q2rtx_1           49        -0.10%    +0.02%    +0.00%      +0.00%      +0.14%    +0.31%
 -------------------------------------------------------------------------------------------
 All affected      14        -0.10%    +0.00%    -0.00%      -0.00%      +0.08%    +0.67%
 -------------------------------------------------------------------------------------------
 Total             97        -0.06%    +0.00%    -0.00%      -0.00%      +0.06%    +0.16%

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21530>
2023-02-26 12:58:13 +00:00
Frank Binns
964323fe97 pvr: remove duplicate define
The same define appears a few lines above.

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/21495>
2023-02-25 22:58:25 +00:00
Frank Binns
cbfa4d52ed pvr: stop restricting the compiler to the Sascha Willems triangle demo
Do this by removing the compatibility table and only using hard coded shaders
when present. The hard coded shaders, along with the hard coding framework
itself, can be dropped once the compiler is capable of compiling the hard coded
shaders. In the meantime we don't want to risk regressing things that we know
work because we temporarily can't test them.

This restriction is being dropped now as the new compiler framework has been
merged and we want to make use of it so it can be developed further.

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/21495>
2023-02-25 22:58:25 +00:00
Giancarlo Devich
cb7403b909 d3d12: Track up to 16 active context resource states locally in d3d12_bo
After 16 entries, we fall back to the previous logic that used a hash
map to link the resource's state per context.

Preventing hash map churn by cheaply tracking up to 16 context's worth
of states per resource significantly reduces CPU cost in
find_or_create_state_entry

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21528>
2023-02-25 18:14:37 +00:00
Giancarlo Devich
2c00c069fe d3d12: Assign up to 16 simultaneously active contexts unique IDs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21528>
2023-02-25 18:14:37 +00:00
Giancarlo Devich
bd0e1b3d02 d3d12: Move d3d12_context_state_table_entry to d3d12_resource_state.h
Also renamed desired_resource_state to d3d12_desired_resource_state,
since it's also in the header now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21528>
2023-02-25 18:14:37 +00:00
Rob Clark
4c711460d4 tu/kgsl: Propagate tu_physical_device_init() errors
Should fix dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21394>
2023-02-25 17:02:34 +00:00
Rob Clark
6a28986eb4 tu+meson: Re-work KMD selection
Now that turnip can support multiple kernel-mode drivers in a single
build, re-work the meson option to have a single list of KMDs, rather
than special options to enable kgsl for turnip or virtio for gallium.

It is temporarily a bit awkward as gallium does not yet support kgsl
and turnip does not yet support virtio.  But both of those are planned
or in-progress, so long term a single list is the most sensible option.

TODO freedreno/drm support to build with only virtio support.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21394>
2023-02-25 17:02:34 +00:00
Rob Clark
407e4929de turnip: Refactor device loading
1) Allow the two different entrypoints for drm vs non-drm (kgsl) to
   coexist.
2) Split the generic drm related device initialization from the msm
   specifics.  This will simplify adding support for additional drm
   based kernel mode drivers (ie. virtgpu)

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21394>
2023-02-25 17:02:34 +00:00
Rob Clark
3b3882d4c5 turnip: Handle kgsl vs drm specifics at runtime
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21394>
2023-02-25 17:02:34 +00:00
Rob Clark
fc06e35a58 turnip: Move QueueWaitIdle entrypoint to kgsl
Handle in the same way as other kgsl specific entrypoints.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21394>
2023-02-25 17:02:34 +00:00
Rob Clark
1170efcf01 turnip: Allow knl backend specific entrypoints
Because kgsl sync primitives are not drm_syncobj, the kgsl kernel
support needs the ability to patch in it's own entrypoints related
to fences, etc.  The current entrypoint table magic using weak syms
won't work if we are building both kgsl and drm support into one
binary, so switch to runtime patching in the kgsl specific entry-
points.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21394>
2023-02-25 17:02:34 +00:00
Rob Clark
fd2b014a12 turnip: Split out vfuncs for kernel interface
To allow support for multiple KMD's to coexist, split out vfuncs.  This
doesn't quite *yet* let us have kgsl and msm coexist, because of the
different vk entrypoints needed by the kgsl backend.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21394>
2023-02-25 17:02:34 +00:00
Rob Clark
f84fce767d turnip: drm code-motion
Move a few functions around in prep for next commit.  Only code-motion.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21394>
2023-02-25 17:02:34 +00:00
Rob Clark
1cb702def4 turnip: Move things to prep for multi-kernel support
The end goal is a single build that supports kgsl (non-drm) as well
as msm and virtgpu (both drm).  First lets move around some files to
accomodate that.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21394>
2023-02-25 17:02:34 +00:00
Rob Clark
73dfcbf7e8 vk/runtime: Allow enumerate and try_create_for_drm to coexist
For drivers that can support both drm and non-drm kernel mode drivers it
is useful to be able to provide both entrypoints.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21394>
2023-02-25 17:02:34 +00:00
David Heidelberg
08ba87481b ci/freedreno: add flaking KHR-GL45.buffer_storage.map_persistent_dispatch
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21531>
2023-02-25 16:21:18 +00:00
Erik Faye-Lund
54f2074ebe docs: update link to intel optimization reference manual
Seems this document has moved since last we updated this link. But
instead of chasing the exact CDN link, let's link to the document on
Intel's website. There's both a download-link there, as well as the
ability to read the document online.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21448>
2023-02-25 15:47:18 +00:00
Erik Faye-Lund
8203618d45 ci: correct typo in name of linkcheck job
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21448>
2023-02-25 15:47:18 +00:00
David Heidelberg
b52917f9fc intel: use c_see2_arg instead of explicit -msse2
This allows us to also inherit `-mfpmath=sse` added in previous commit.

Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21371>
2023-02-25 15:34:33 +01:00
David Heidelberg
1851ca714b intel: enable -mfpmath=sse on x86
It's not enabled by default until `-msse2` and -ffast-math is passed.
We pass only the `-msse2`. Let's align it with main `meson.build`.

See: https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html (-mfpmath).

Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21371>
2023-02-25 15:34:00 +01:00
Gert Wollny
182066538f r600/sfn: Fix minimum required registers
Don't count the local registers, just the arrays, because local
registers might be renamed during register allocation.

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

Fixes: 9fd9f3cd10
   r600/sfn: Set minimum required registers based on array allocation

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21523>
2023-02-25 14:01:55 +00:00
Konstantin Seurer
13a9ce7f2f radv/rt: Merge cull_mask and flags
Since cull_mask is only one byte, we can trivially store it in the same
register as the flags. This leaves us with a 2% performance gain in
Quake II RTX:

Totals from 7 (14.00% of 50) affected shaders:
VGPRs: 720 -> 688 (-4.44%)
CodeSize: 213052 -> 212980 (-0.03%); split: -0.05%, +0.02%
MaxWaves: 67 -> 70 (+4.48%)
Instrs: 39429 -> 39394 (-0.09%); split: -0.15%, +0.06%
Latency: 1096258 -> 1096943 (+0.06%); split: -0.05%, +0.11%
InvThroughput: 230661 -> 222963 (-3.34%); split: -3.42%, +0.08%
VClause: 1208 -> 1206 (-0.17%); split: -0.25%, +0.08%
Copies: 5321 -> 5269 (-0.98%); split: -1.22%, +0.24%
Branches: 1903 -> 1902 (-0.05%)
PreVGPRs: 650 -> 645 (-0.77%)

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21470>
2023-02-25 12:07:46 +00:00
Konstantin Seurer
8ae5a42990 nir: Add cull_mask_and_flags_amd intrinsic
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21470>
2023-02-25 12:07:46 +00:00
Lionel Landwerlin
8441d565ec anv: remove assert typed write support when using NULL surface
A number of apps hit this assert in debug mode.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21382>
2023-02-25 09:20:01 +00:00
Ryan Neph
65b62db0fb ci: uprev virglrenderer
Update virglrenderer to bring in venus protocol fixes described in
https://gitlab.freedesktop.org/olv/venus-protocol/-/issues/4.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21496>
2023-02-25 02:10:10 +00:00
Philipp Zabel
297fda6cf1 zink: fix build with -Dvulkan-beta=true
Fix a build error with -Dvulkan-beta=true:

  ../src/gallium/drivers/zink/zink_screen.c: In function ‘zink_internal_create_screen’:
  ../src/gallium/drivers/zink/zink_screen.c:2764:20: error: ‘struct zink_device_info’ has no member named ‘have_KHR_portability_subset’
   2764 |    if (screen->info.have_KHR_portability_subset) {
        |                    ^
  ../src/gallium/drivers/zink/zink_screen.c:2765:60: error: ‘struct zink_device_info’ has no member named ‘portability_subset_feats’
   2765 |       screen->have_triangle_fans = (VK_TRUE == screen->info.portability_subset_feats.triangleFans);
        |                                                            ^

Fixes: e02cdb397e ("zink: prefer vulkan_core.h over vulkan.h")
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21491>
2023-02-25 00:23:56 +00:00
Mike Blumenkrantz
f1acdeba6b zink: fix slab allocator sizing
now that the mem type is passed directly to pb, there have to be enough
slabs to allocate all the mem types (not heaps), so create memoryTypeCount
slabs to allow this

fixes #8369

Fixes: f6d3a5755f ("zink: zink_heap isn't 1-to-1 with memoryTypeIndex"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21526>
2023-02-25 00:02:06 +00:00
Patrick Lerda
fe4271c42d vbo/save: fix possible crash related to fixup_vertex()
Indeed, buffer_in_ram could be reallocated by fixup_vertex()
which triggers this issue.

For instance, with "piglit/gl-1.0-dlist-materials -auto -fbo":
==28392==ERROR: AddressSanitizer: heap-use-after-free on address 0x607000010024 at pc 0x7f3f416fcf18 bp 0x7f3f33d12800 sp 0x7f3f33d127f8
WRITE of size 4 at 0x607000010024 thread T6
    #0 0x7f3f416fcf17 in _save_Materialfv ../src/mesa/vbo/vbo_save_api.c:1405
    #1 0x7f3f418199de in _mesa_unmarshal_Materialfv src/mapi/glapi/gen/marshal_generated0.c:5006
    #2 0x7f3f413c6863 in glthread_unmarshal_batch ../src/mesa/main/glthread.c:65
    #3 0x7f3f4124d368 in util_queue_thread_func ../src/util/u_queue.c:309
    #4 0x7f3f41391eba in impl_thrd_routine ../src/c11/impl/threads_posix.c:67
    #5 0x7f3f4c619c6b in start_thread glibc-2.35/nptl/pthread_create.c:442
    #6 0x7f3f4c69e1fb in __clone3 (/lib64/libc.so.6+0x10c1fb)

0x607000010024 is located 20 bytes inside of 80-byte region [0x607000010010,0x607000010060)
freed by thread T6 here:
    #0 0x7f3f4f093b48 in __interceptor_realloc (/usr/lib64/libasan.so.6+0xb1b48)
    #1 0x7f3f416e5b0c in grow_vertex_storage ../src/mesa/vbo/vbo_save_api.c:417
    #2 0x7f3f416e69bc in fixup_vertex ../src/mesa/vbo/vbo_save_api.c:1266
    #3 0x7f3f416fb13e in _save_Materialfv ../src/mesa/vbo/vbo_save_api.c:1405
    #4 0x7f3f418199de in _mesa_unmarshal_Materialfv src/mapi/glapi/gen/marshal_generated0.c:5006
    #5 0x7f3f413c6863 in glthread_unmarshal_batch ../src/mesa/main/glthread.c:65
    #6 0x7f3f4124d368 in util_queue_thread_func ../src/util/u_queue.c:309
    #7 0x7f3f41391eba in impl_thrd_routine ../src/c11/impl/threads_posix.c:67
    #8 0x7f3f4c619c6b in start_thread glibc-2.35/nptl/pthread_create.c:442

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21419>
2023-02-24 22:44:58 +00:00
Iván Briano
b71957635f anv: stop tracking color blend state in the pipeline
Now that all color blend bits are dynamic, emit_cb_state() is doing
almost nothing and half of that is wrong.

In the case that color write enable is dynamic, at the time the pipeline
state is emitted, it sees all the color attachments as having write
disabled and stores the WriteDisabled bit for each channel.
When all dynamic state is flushed, we have the right values already but
the values recorded into the command buffer get ORed with the ones
stored in the pipeline, and so WriteDisabled tag along when they
shouldn't.

Since all disabled color attachments are handled already when dynamic
state is flushed, there's no point in doing so at pipeline creation
time too. And since the only other thing done by emit_cb_state() is
writing three hardcoded values, they might as well be taken care of in
the same place as everything else.

Fixes CTS from the future:
dEQP-VK.pipeline.*.extended_dynamic_state.*.color_blend_equation_*dynamic*
dEQP-VK.pipeline.*.extended_dynamic_state.*.color_blend_all_*

Fixes: fc3fd7c69e (anv: dynamic color write mask)

Reviewed-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/21509>
2023-02-24 22:07:52 +00:00
Iván Briano
dd5c6446b4 anv: fix testing for dynamic color blend bits
Fixes: fc3fd7c69e (anv: dynamic color write mask)
Fixes: 9dc6bed9a1 (anv: dynamic state for logic op enable)

Reviewed-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/21509>
2023-02-24 22:07:52 +00:00
Iván Briano
6e60612d42 vulkan: track the right value on CmdSetColorWriteMasks
Fixes: 092be5a329 ("vulkan: Add more dynamic color blend states")

Reviewed-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/21509>
2023-02-24 22:07:52 +00:00
Marek Olšák
9f1e6d8f70 nir,amd: add and use nir_intrinsic_load_esgs_vertex_stride_amd
This will emulate VGT_ESGS_RING_ITEMSIZE, which does the multiplication
for us. It's beneficial to stop setting VGT_ESGS_RING_ITEMSIZE to reduce
context rolls, and also the register will be removed in the future.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
5e837f9594 amd/gpu_info: add a workaround for SI_FORCE_FAMILY=gfx1100
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
df6380ddc9 amd: implement conformant TRUNC_COORD behavior for gfx11
For testing, the conformant behavior can be enabled by setting
conformant_trunc_coord to true manually and running this to enable
the conformant behavior in hw:
    umr -w *.*.regTA_CNTL2 0x40000

The layer index rounding and TRUNC_COORD resetting workarounds can disabled
in the shader compiler.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
39fefeabee radeonsi/gfx11: change the default of COMPUTE_DISPATCH_INTERLEAVE to 256
This is an internal recommendation.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
3e8bd05020 radeonsi: don't set PACKET_TO_ONE_PA for line stippling
A hw guy told me this.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
4ca32bbc79 radeonsi: reorganize si_init_depth_surface for better readability
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
f5a98ba30c radeonsi: reorganize si_initialize_color_surface for better readability
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
236890608f radeonsi: reorganize emit_db_render_state and simplify VRS code
for better readability

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
be8c61b4f6 amd/registers: only define SPI and COMPUTE registers in the 0xB000 range
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
82926d93b4 radeonsi: don't clamp z_samples to fix Unreal Tournament 99
Fixes: a29218b5 - radeonsi/gfx11: always set MSAA_NUM_SAMPLES=0 for DCC_DECOMPRESS
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8261

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
80c0efa50f amd: query the per-SIMD VGPR counts from the kernel, don't hardcode them
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
26208698ae radeonsi: rename esgs_itemsize -> esgs_vertex_stride
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
32b8d0c19d radeonsi: correct and clean up obsolete vs_state_bits comments
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
23e7d44a88 radeonsi: always add 1 to lshs_vertex_stride now that LS_OUT_PATCH_SIZE is gone
LS_OUT_PATCH_SIZE limited the maximum value.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
b9c6ef7f51 radeonsi: remove unused VS_STATE_LS_OUT_PATCH_SIZE
This became unused when we switched to nir_lower_hs_inputs_to_mem.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
461b05c281 radeonsi: remove a gfx11 check in si_shader_gs (legacy GS)
Gfx11 doesn't support legacy GS.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
f6d8e776fd radeonsi: reformat emit_cb_render_state, create_blend_state, create_rs_state
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
8e9968e3a1 radeonsi: remove returns from si_emit_global_shader_pointers
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
98eee7dee3 amd: replace SI_BIG_ENDIAN with UTIL_ARCH_BIG_ENDIAN
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
e0c8b24e22 amd/registers: unify VRS combiner definition names between gfx103 and gfx11
use gfx11 names

Acked-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/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
091268944d amd,radeonsi: remove unused LLVM functions
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
d8b17b1752 radeonsi: disable Smart Access Memory because CPU access has large overhead
It will be remove completely in the next commit.

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8176

Cc: mesa-stable

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
d61cd39026 radeonsi: replace si_screen::has_out_of_order_rast with the radeon_info field
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
5b85fa6031 radeonsi/gfx11: ignore alpha_is_on_msb because the hw ignores it
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
52f5b7a970 radeonsi: set PA_SU_VTX_CNTL consecutively with PA_CL_GB_VERT_CLIP_ADJ
because they are all next to each other.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:23 +00:00
Marek Olšák
429f43f088 radeonsi: use SPI_SHADER_USER_DATA_HS_0 definition instead of LS_0
The value is the same, but LS_0 is for gfx9 only, and HS_0 is for everything
except gfx9.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:23 +00:00
Marek Olšák
6dcd60206a radeonsi: remove no-op setting of THDS_PER_SUBGRP
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:23 +00:00
Marek Olšák
742c9f411b radeonsi: change si_shader::ctx_reg to a nameless union for better readability
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:23 +00:00
Marek Olšák
3e9863f496 radeonsi: move a few DB_SHADER_CONTROL states into si_shader_ps
They can be set si_shader_ps.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:23 +00:00
Marek Olšák
ee83ba5771 radeonsi/gfx11: set CB_COLORi_INFO.MAX_COMP_FRAG on GFX1103_R2
Fixes: caa09f66ae - amd: add chip identification for gfx1100-1103

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:23 +00:00
Marek Olšák
c54635a033 radeonsi/gfx11: don't set non-existent VGT_STRMOUT_BUFFER_CONFIG
Fixes: 9fecac091f - radeonsi/gfx11: scattered register deltas

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:23 +00:00
Marek Olšák
31438fbab5 radeonsi/gfx11: fix the CU_EN clear mask for RSRC4_GS
Fixes: 9fecac091f - radeonsi/gfx11: scattered register deltas

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:23 +00:00
Marek Olšák
34c01cf718 amd: bump AMD_MAX_SE and change the CU mask type to 16 bits
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/21525>
2023-02-24 21:27:23 +00:00
Marek Olšák
63b21e3066 amd: add missing gfx11 register definitions
Fixes: caa09f66ae - amd: add chip identification for gfx1100-1103

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:23 +00:00
Marek Olšák
ac0e83375a amd: fix LOD_BIAS on gfx6-9 and adjust the lod bias CAP
Fixes: e673bb4ae4 - amd,util: fix how lod bias is converted to fixed-point

Acked-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/21525>
2023-02-24 21:27:23 +00:00
Marek Olšák
98328a71dc radeonsi: fix COMPAT_MODE on gfx8-9
It was set in the wrong dword.

Fixes: e673bb4ae4 ("amd,util: fix how lod bias is converted to fixed-point")

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:23 +00:00
Marek Olšák
fb70d8cf9c Revert "radeonsi/ci: Update stoney test expectations"
This reverts commit 53cc509288.

This MR fixes it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:23 +00:00
Faith Ekstrand
96c832c47e spirv: Always emit deref_buffer_array_length intrinsics
All the drivers have been converted to setting this option now except
imagination and they don't support SSBOs yet.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3993
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21446>
2023-02-24 20:37:10 +00:00
Faith Ekstrand
fbeb81d812 v3dv: Set spirv_options::use_deref_buffer_array_length
It'll get lowered to get_ssbo_size by nir_lower_explicit_io() so the
driver should never notice this change.

Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21446>
2023-02-24 20:37:10 +00:00
Faith Ekstrand
1386e1476a lavapipe: Set spirv_options::use_deref_buffer_array_length
It'll get lowered to get_ssbo_size by nir_lower_explicit_io() so the
driver should never notice this change.

Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21446>
2023-02-24 20:37:10 +00:00
Faith Ekstrand
85634a70ec turnip: Set spirv_options::use_deref_buffer_array_length
It'll get lowered to get_ssbo_size by nir_lower_explicit_io() so the
driver should never notice this change.

Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21446>
2023-02-24 20:37:10 +00:00
Faith Ekstrand
00218ab73f panvk: Drop our manual SSBO size handling
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21446>
2023-02-24 20:37:10 +00:00
Faith Ekstrand
7594a64ebe hasvk: Drop our manual SSBO size handling
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21446>
2023-02-24 20:37:10 +00:00
Faith Ekstrand
a1c82fa42f anv: Drop our manual SSBO size handling
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21446>
2023-02-24 20:37:10 +00:00
Faith Ekstrand
e41753cf17 nir/lower_io: Handle buffer_array_length for more address modes
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21446>
2023-02-24 20:37:10 +00:00
Sil Vilerino
ee129301a9 frontend/va: Remove duplicate code in format support checking/reporting.
In config.c there are multiple copies of the code checking for VA_FORMAT_RT_*, this can lead
to confusion and is hard to maintain without knowing to change the code in all the places.

This commit extracts out the duplicated code into a function that checks format support
for a given profile and entrypoint, then this function is called from several places that
had the copies of this code in vlVaCreateConfig/vlVaGetConfigAttributes.

Please also note that after this change, all entrypoints/profiles will be checked for all
formats in the pipe_screen: YUV420/YUV420_10/YUV422/RGB32/YUV400/YUV444

Acked-by: Ruijing Dong <ruijing.dong@amd.com>
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21466>
2023-02-24 13:46:38 -05:00
Sil Vilerino
1a6865eae3 frontend/va: Add format support checks for VA_RT_FORMAT_* in VaCreateConfig/VaGetConfigAttributes
Before this change some formats like YUV420, YUV422 and RGB32 are hardcoded as supported
in VaCreateConfig/VaGetConfigAttributes. This is not always the case, different gallium
drivers and hardware will support different formats. The frontend should delegate the support
check call by using the is_video_format_supported(...) function from pipe_screen.

Acked-by: Ruijing Dong <ruijing.dong@amd.com>
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21466>
2023-02-24 13:37:51 -05:00
Roland Scheidegger
a4fa489002 lavapipe, nir: Fix wrong array index scaling in nir_collect_src_uniforms
The scaling needs to be ubo * MAX_INLINABLE_UNIFORMS, not
ubo * PIPE_MAX_CONSTANT_BUFFERS, otherwise accesses beyond buffer size
will result for ubo >= 4 (and we'd also access the wrong values later
for other non-zero ubo indices).

Fixes: a7696a4d98 ("lavapipe: Fix bad array index scale factor in lvp_inline_uniforms pass")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21506>
2023-02-24 16:13:55 +00:00
Gert Wollny
b6303d33ec r600/sfn: Fix readport cylce map
This is currently of no consequence, because the bank swizzle
codes are only used to check legal ALU group configuration
and the bank swizzles are not yet allocated to the instruictions
here.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21516>
2023-02-24 15:59:03 +00:00
Gert Wollny
b5b7ca0ad3 r600/sfn: be more conservative with channel use in multi-slot ops
The current approach to check the bank swizzle doesn't allow to
re-evaluate bank-swizzle for instructions that where emitted
earlier, so we might end up with impossile constellations when we
allow three uses of the same channel

Fixes: edabd5cd84
  r600/sfn: check used channels when evaluating allowed mask

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

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21516>
2023-02-24 15:59:03 +00:00
Konstantin Seurer
e2fa9ba9c6 radv: Use indirect header filling for compact builds
Sets the accel struct size fields to the correct values which should
allow for more compaction.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20818>
2023-02-24 15:14:40 +00:00
Konstantin Seurer
40e9efa2de radv/bvh: Add a shader for filling the header
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20818>
2023-02-24 15:14:40 +00:00
Konstantin Seurer
c83ea20683 radv/bvh: Move the size header field up
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20818>
2023-02-24 15:14:40 +00:00
Konstantin Seurer
b0fd43f1f7 radv: Move the geometry infos before the BVH
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20818>
2023-02-24 15:14:40 +00:00
Konstantin Seurer
0800450cb9 radv: Use compact encoding
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20818>
2023-02-24 15:14:40 +00:00
Konstantin Seurer
07c1b23022 radv/bvh: Implement compact encoding
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20818>
2023-02-24 15:14:40 +00:00
Konstantin Seurer
71ccc8d600 radv: Add a build config for compact builds
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20818>
2023-02-24 15:14:40 +00:00
Konstantin Seurer
da4f498f6f radv/bvh/encoder: Move dst_node initialization into the loop
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20818>
2023-02-24 15:14:40 +00:00
Konstantin Seurer
2792d012d2 radv/bvh/encode: Introduce is_root_node
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20818>
2023-02-24 15:14:40 +00:00
Konstantin Seurer
2c0e158ae2 radv/bvh/encode: Move bvh_offset NULL check to the top of the loop
NULL nodes don't have to be encoded and they also don't carry over any
information to their children.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20818>
2023-02-24 15:14:40 +00:00
Konstantin Seurer
4e87a01b93 radv/bvh: Replace is_final_tree with bvh_offset
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20818>
2023-02-24 15:14:40 +00:00
Konstantin Seurer
688f598237 radv/bvh/encode: Use the node type for identifying internal nodes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20818>
2023-02-24 15:14:40 +00:00
Konrad Dybcio
6d93f4f867 freedreno: Add A2xx REG_A2XX_RBBM_PM_OVERRIDE2 bitfields
Required for good-looking kernel code

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21480>
2023-02-24 14:48:27 +00:00
Konrad Dybcio
891a8bfb2d freedreno: Add A2xx perf counter reg values
Required for good-looking kernel code

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
[rob: fixup CI expectations]

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21480>
2023-02-24 14:48:27 +00:00
Karmjit Mahil
9e2572903b pvr: Remove component_alignment
We don't support output register subdivision so no need to keep
track of how many bytes have been allocated within the output regs.

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/21386>
2023-02-24 14:36:36 +00:00
Karmjit Mahil
0244719a12 pvr: Remove unused msaa_mode field
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/21386>
2023-02-24 14:36:36 +00:00
Karmjit Mahil
ca04882117 pvr: Setup SPM EOT state
On entering SPM we need to store the tile data for the current
render into the scratch buffer so we need to setup an EOT program
to do so.

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/21386>
2023-02-24 14:36:36 +00:00
Karmjit Mahil
f59c6eef16 pvr: Move PBE START_POS into csb enum helpers header
This commit adds 'pvr_pbestate_source_pos()' and moves
`enum pvr_pbe_source_start_pos` into pvr_csb_enum_helpers.h .
The enum will be needed in other files in the commits following.

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/21386>
2023-02-24 14:36:36 +00:00
Samuel Pitoiset
d2ff8b673a radv: advertise VK_EXT_image_sliced_view_of_3d on GFX10+
Pass dEQP-VK.pipeline.monolithic.sliced_view_of_3d_image.* on NAVI21.

Looks like older generations can't support it.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21359>
2023-02-24 14:12:22 +00:00
Samuel Pitoiset
5520a40e05 radv: implement VK_EXT_image_sliced_view_of_3d on GFX10+
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21359>
2023-02-24 14:12:22 +00:00
Samuel Pitoiset
e82c11df66 ac/nir: add resinfo lowering for sliced storage 3D views
The first layer isn't necessarily 0 and depth shouldn't be minified.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21359>
2023-02-24 14:12:22 +00:00
Karmjit Mahil
806f146eea pvr: Add support for blend constants.
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/21388>
2023-02-24 13:59:01 +00:00
David Heidelberg
46091832d8 util/process_test: make the error variable static
Make the `error` variable static to prevent a clash with
the glibc error() function when LTO is used.

Fixes the LTO build.
Otherwise, it'll fail in the linking phase with a conflict:
```
[411/2321] Linking target src/util/process_test
FAILED: src/util/process_test
c++  -o src/util/process_test src/util/process_test.p/tests_process_test.c.o -flto -Wl,--as-needed -Wl,--no-undefined -Wl,--fatal-warnings -Wl,--start-group src/util/libmesa_util.a src/util/format/libmesa_format.a src/util/libmesa_util_sse41.a src/c11/impl/libmesa_util_c11.a subprojects/perfetto/libperfetto.a /usr/lib/x86_64-linux-gnu/libz.so -pthread -lm -ldl /usr/lib/x86_64-linux-gnu/libunwind.so -Wl,--end-group
mold: error: symbol type mismatch: error
>>> defined in /tmp/process_test.SLc9I6.ltrans0.ltrans.o as STT_OBJECT
>>> defined in /lib/x86_64-linux-gnu/libc.so.6 as STT_FUNC
```

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21511>
2023-02-24 13:30:09 +01:00
Simon Perretta
b4ab54976b pvr: Add encodings for index registers
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
6122dd5488 pvr: Amend definitions for ST and IDF
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
66500c28d2 pvr: Add late op lowering pass and conditional execution
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
8719f7cb8d pvr: Add support for MOVC
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
c38c119617 pvr: Add basic support for manual instruction grouping
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
b642e77cdd pvr: Add support for TST
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
de64dfe940 pvr: Add branch support
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
b1064e91f1 pvr: Add support for ST
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
c4b7128d84 pvr: Add support for IDF
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
73d07bbb52 pvr: Add support for generating NOP program
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
4ddcda8369 pvr: Add support for generating per-job EOT program
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
88e42e18d9 pvr: Fix descriptor set address calculation
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
5287edd6d2 pvr: Register allocation improvements
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
eb65c4be88 pvr: Add support for WOP
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
432fea181d pvr: Add support for emitpix
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
bdbd69edb8 pvr: Add support for validating modifier combos
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
8ef839374e pvr: Add support for sample instructions
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
1c11f1afbd pvr: Add support for fitr.pixel
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
0ce53b002f pvr: Amend subarray ownership code
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
af0685d05e pvr: Add NIR pass to lower vars to SSA
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Sviatoslav Peleshko
07b57deea2 anv: Move WA MEDIA_VFE_STATE after stalling PIPE_CONTROL
Fixes: bc612536 ("anv: Emit a dummy MEDIA_VFE_STATE before switching from GPGPU to 3D")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6172
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21472>
2023-02-24 10:08:43 +00:00
Friedrich Vock
c0c911d9ba mesa: Report GL_SHADER_BINARY_FORMAT_SPIR_V as supported
GL_ARB_gl_spirv introduced it, but its corresponding format was never listed in GL_SHADER_BINARY_FORMATS.

Fixes: 5bc03d25 ("mesa: implement SPIR-V loading in glShaderBinary")
Closes: #7644
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19559>
2023-02-24 09:39:17 +00:00
Pierre-Eric Pelloux-Prayer
2b655e267e radeonsi: fix incorrect vgpr indices in the ps_prolog
In monolithic PS shaders, we need to account for PERSP_PULL_MODEL even
if we don't use it; si_get_ps_prolog_key already does the same thing
to determine color_interp_vgpr_index.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8280
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21483>
2023-02-24 09:17:20 +00:00
Pavel Ondračka
a8e1e5b5c2 r300: simplify KILL transformation
We had some special cases before when we could actually get some IFs on
R300 with VDPAU. Now that VDPAU is gone and everything goes through
ntt, we don't have to worry anymore. Remove the complicated logic and
just always transform KILL into KIL none.-1

No shader-db change on RV530 or RV370.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21503>
2023-02-24 08:59:53 +00:00
Emma Anholt
fc0f694676 ci/zink: Add a glx flake on anv
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21366>
2023-02-24 07:31:36 +00:00
Emma Anholt
f2dc37454e ci: Fix stage of etnaviv manual runs.
Fixes: f6c06ef2f6 ("ci: Add manual rules variations to disable irrelevant driver jobs.")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21366>
2023-02-24 07:31:36 +00:00
Emma Anholt
ae0e1eb0af ci/hasvk: Add a synchronization flake.
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21366>
2023-02-24 07:31:36 +00:00
Emma Anholt
0b976dee49 ci/zink+turnip: Disable flaky minetest trace.
random 1-pixel changes sometimes.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21366>
2023-02-24 07:31:36 +00:00
Emma Anholt
2a7debd1ca ci/turnip: Drop the #8219 xfail.
It hasn't showed up in the last couple runs, the other test is no longer
showing up in the caselist so the fail isn't triggered.  Bug is still
there, though.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21366>
2023-02-24 07:31:36 +00:00
Emma Anholt
0cc34b7bb9 ci/freedreno: Drop a530 piglit_gl coverage.
It hasn't worked in a long time -- the board gets wedged 20 minutes in and
then we reboot it and try again until failure.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21366>
2023-02-24 07:31:36 +00:00
Emma Anholt
be32dba99c ci/etnaviv: Drop one more gc7000 xfail.
Looks like I missed it in the last full-run update.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21366>
2023-02-24 07:31:36 +00:00
Sviatoslav Peleshko
4bf38f5652 anv: Handle all fields in VkAccelerationStructureBuildRangeInfoKHR
Add handling of primitiveOffset and firstVertex.

Fixes: f3ddfd81 ("anv: Build BVHs on the GPU with GRL")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8296
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21342>
2023-02-24 07:08:05 +00:00
Caio Oliveira
070f042e10 spirv: Implement SPV_KHR_subgroup_rotate
Map SpvOpGroupNonUniformRotateKHR to nir_intrinsic_rotate.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19797>
2023-02-24 06:33:51 +00:00
Caio Oliveira
3328714295 nir/lower_subgroups: Add option lower_rotate_to_shuffle
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19797>
2023-02-24 06:33:51 +00:00
Caio Oliveira
e40b1df432 nir: Add nir_intrinsic_rotate
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19797>
2023-02-24 06:33:51 +00:00
Pavel Ondračka
a06ab9849d r300: drop VDPAU support
There is no UVD and the mpeg2 shader-based decoding is broken and doesn't
lead to CPU savings anyway. VDPAU output works, but there is no real
benefit so just disable VDPAU altogether so we can clean the backend a
bit and also open a way to potentially drop the mpeg2 deconding altogether
from the fronted.

Acked-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20524>
2023-02-24 06:04:32 +00:00
Mike Blumenkrantz
865e9311a2 zink: utilize copy box tracking to avoid barrier emission for buf2img copies
this should reduce synchronization during e.g., miplevel population

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21397>
2023-02-24 05:27:31 +00:00
Mike Blumenkrantz
4ad64552b8 zink: add a util function for optimizing TRANSFER_DST image barriers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21397>
2023-02-24 05:27:31 +00:00
Mike Blumenkrantz
fa6e6545b1 zink: add some tracking for copy box regions
this enables tracking per-miplevel pipe_boxes for copy operations that
can then be used to avoid emitting barriers for successive copy operations
without overlapping regions

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21397>
2023-02-24 05:27:31 +00:00
Mike Blumenkrantz
935184ca44 util/box: add intersection test functions for 1d/3d
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21397>
2023-02-24 05:27:31 +00:00
Caio Oliveira
8f3d0141de anv, hasvk: Align workaround address to 32B
Not necessary but, all things being equal, be consistent with Iris.

Now that intel_debug_write_identifiers() already add the padding,
there's no need to include extra "+ 8" to the offset.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21479>
2023-02-24 04:57:40 +00:00
Caio Oliveira
a4a0417263 iris, crocus: Align workaround address to 32B
The workaround address is used as a source for push constants when
there's no resource available, that address must be 32B aligned.

This fixes invalid address being used for buffers in
3DSTATE_CONSTANT_* packets.

Now that intel_debug_write_identifiers() already add the padding,
there's no need to include extra "+ 8" to the offset.

Thanks to Xiaoming Wang that contributed to find and fix this issue.

Fixes: 2a4c361b06 ("iris: add identifier BO")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21479>
2023-02-24 04:57:40 +00:00
Caio Oliveira
ea0ec8c562 intel: Add extra zeros at the end of debug identifiers
Add at least a full aligned uint64_t of zero padding at the end
to make the identifiers easier to spot.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21479>
2023-02-24 04:57:40 +00:00
David Heidelberg
387d131f96 ci/llvmpipe: add flake timeout for rusticl program@execute@builtin@builtin-float-sincos-1.0
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21510>
2023-02-24 04:37:49 +00:00
Sil Vilerino
9490633723 d3d12: Fix VP9 Decode - Checking 0xFF instead of 0x7F for invalid frame_ref[i].Index7Bits
Fixes: c8e8ce8359 ("d3d12: Add VP9 Decode support")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21507>
2023-02-24 01:49:28 +00:00
Caio Oliveira
fb2a6248d2 hasvk: Update driver name in debug information
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21481>
2023-02-24 00:41:09 +00:00
Bas Nieuwenhuizen
ed76833705 radv: Implement & expose VK_EXT_pipeline_library_group_handles.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21406>
2023-02-23 22:17:30 +00:00
Bas Nieuwenhuizen
d0f7587109 radv: Use group handles based on shader hashes.
Should be stable.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21406>
2023-02-23 22:17:30 +00:00
Bas Nieuwenhuizen
913de78731 radv: Use provided handles for switch cases in RT shaders.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21406>
2023-02-23 22:17:30 +00:00
Bas Nieuwenhuizen
430170702e radv: Hash group handles as part of RT pipeline key.
So that we can start varying them  to avoid collisions while keeping
handles stable.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21406>
2023-02-23 22:17:30 +00:00
Bas Nieuwenhuizen
9eb76ab638 radv: Add helper to hash stages.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21406>
2023-02-23 22:17:30 +00:00
Mike Blumenkrantz
211ed8745f zink: add debug marker tracing for qbo updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21425>
2023-02-23 21:47:20 +00:00
Mike Blumenkrantz
26aedae568 zink: add ZINK_DEBUG=map
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21425>
2023-02-23 21:47:20 +00:00
Mike Blumenkrantz
03610a5aab zink: actually hook up ZINK_DEBUG=norp
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21425>
2023-02-23 21:47:20 +00:00
Rob Clark
9e8450b65c freedreno/crashdec: Disable GALLIUM_DUMP_CPU
We don't want util_cpu to vomit cpu caps all over the test output.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Rob Clark
3f227957d6 freedreno/crashdec: Handle multi-IB prefetching
Add helper to scan the CP_INDIRECT_BUFFERs, and then work backwards
accounting for data buffered via ROQ prefetch to deduce the actual
SQE position at the time of the crash.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Rob Clark
ddc4e87438 freedreno/crashdec: Add another prefetch test
Constructed with an invalid packet (0xdeadd00d) so there is no ambiguity
in the crash location.

This is expected to fail until the next commit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Rob Clark
643ee85103 freedreno/crashdec: Refactor crashdec tests
Simplify the process of adding additional tests.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Connor Abbott
7417432a28 freedreno/crashdec: Add prefetch test
Add a crash where this was seen "in the wild" on a CTS test in
!17943 which requires handling multi-IB prefetching to correctly
location the crash location.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Rob Clark
9ececfc6e6 freedreno/cffdec: Fix hang location detection
We were previously checking only every 8 dwords within the packet.  We
should instead just check if the hang location comes within the packet.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Rob Clark
924f264081 freedreno/cffdec: Add helper to parse CP_INDIRECT_BUFFER
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Rob Clark
c01ac4b583 freedreno/cffdec: Add helper to find next pkt
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Rob Clark
cb13e24758 freedreno/cffdec: Fix unitialized count for pkt2
This was causing us to use the size of the previous packet.  Which just
happened to land on a valid packet because pkt2 only followed a
CP_INDIRECT_BUFFER.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Connor Abbott
4060cf5772 freedreno/crashdec: Fix apparent off-by-one with ROQ size
I have multiple examples where this register is too large by one
when comparing to the ROQ read/write pointers in CP_ROQ_*_STAT and the
ROQ data itself, as if it includes the dword most recently read too. I
have an example where it's off by 2 compared to the read pointer, but
the read pointer is also off by 1 itself judging by the SQE program
counter, so that may just be them not getting synchronized. This
off-by-one was getting in the way of figuring out exactly IB2 was being
processed in the next commit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Connor Abbott
ce7225c0f9 freedreno/a6xx: Fill in ROQ status registers
We had a bunch of registers only defined for some parts of ROQ but now
that we know the pattern for ROQ-related registers it's easy to fill in
the rest.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Connor Abbott
44054b1f3b freedreno/a6xx: Fix CP_ROQ_THRESHOLDS_1
Just by adding the ROQ_*_STAT registers following the previous pattern
it becomes obvious what these fields actually are.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Connor Abbott
aba8aea2be freedreno/a6xx: Add CP_ROQ_*_STAT
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Connor Abbott
8c6d741e26 freedreno/a6xx: Rename CP_CSQ_IB*_STAT
These don't correspond to the a3xx *_STAT registers, which we're about
to add so we need to rename them. The closest analogue is CP_CSQ_AVAIL,
although the sense is inverted (and we're not sure what the low 16 bits
are about). Also, the a3xx distinction between CSQ and STQ doesn't exist
anymore so don't use these outdated terms.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Tapani Pälli
880a3efe6c anv: implement emission of 3DSTATE_HS for Wa_1306463417
We need to emit 3DSTATE_HS for each primitive with tessellation.

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/21308>
2023-02-23 19:30:03 +00:00
Tapani Pälli
f8a1100ca1 anv: limit generated draws to pipelines without HS stage
This is done for gfx11 specific workaround.

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/21308>
2023-02-23 19:30:03 +00:00
Tapani Pälli
2028f1caa3 anv: emit 3DSTATE_HS in cmd_buffer_flush_gfx_state
Patch packs 3DSTATE_HS state during pipeline creation but it
gets emitted only before 3DPRIMITIVE. We will later need this
to implement a workaround.

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/21308>
2023-02-23 19:30:03 +00:00
Tapani Pälli
a043ae8e24 iris: implement emission of 3DSTATE_HS for Wa_1306463417
We need to emit 3DSTATE_HS for each primitive with tessellation.

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/21308>
2023-02-23 19:30:03 +00:00
Mark Collins
e4ebb541c5 meson: update flex/bison requirement to cover all usages
Meson silently drops outputs such as libvulkan-freedreno when
dependencies on flex/bison can't be satisfied rather than providing
an error which this commit fixes.

Signed-off-by: Mark Collins <mark@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21488>
2023-02-23 19:00:19 +00:00
Eric Engestrom
61f45a6f44 gbm: drop unnecessary vulkan dependency
gbm doesn't actually include vulkan headers

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21489>
2023-02-23 18:31:22 +00:00
Eric Engestrom
2bf24c84f3 glx: include directly the useful vulkan header, instead of including everything
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21489>
2023-02-23 18:31:22 +00:00
Eric Engestrom
c8d7e0c023 egl: include directly the useful vulkan header, instead of including everything
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21489>
2023-02-23 18:31:22 +00:00
Chia-I Wu
e97ed4fc89 anv: process utrace payloads on queue submission
anv_QueuePresentKHR is not called by apps that do not use WSI.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21456>
2023-02-23 18:06:16 +00:00
Karmjit Mahil
aa791961a8 pvr: Add support for dynamic buffers descriptors
This is based on the new approach of having a descriptor set
addresses table in memory. To handle dynamic offsets provided on
vkCmdBindDescriptorSets() we duplicate the set with dynamic
descriptors, apply the offsets, and write the new bo's address
into the table. There are better ways of handling dynamic
descriptors but this implementation won't require many/if any
changes in the compiler code.

The descriptor set itself doesn't allocate and reserve space for
the dynamic descriptors since they would all be collected together
when creating the pipeline layout. While copying the descriptor
set we allocate extra space at the end for the dynamic primaries
and secondaries to account for that.

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/21391>
2023-02-23 16:26:51 +00:00
Väinö Mäkelä
2bef26ed04 ci/intel: Update hasvk HSW xfails
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19876>
2023-02-23 16:02:14 +00:00
Väinö Mäkelä
d6d8edf9ae hasvk: Handle subpass self-dependencies for stencil shadow copies
Always copying when dstAccessMask includes texture operations is not
optimal, but it's good enough.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19876>
2023-02-23 16:02:13 +00:00
Väinö Mäkelä
d3162f97b5 hasvk: Mark VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL as stencil write optimal
VK_KHR_synchronization2 added VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL, which
was not previously recognized by vk_image_layout_stencil_write_optimal.

Would close https://gitlab.freedesktop.org/mesa/mesa/-/issues/5578 if it
wasn't already closed.

Fixes: b996fa8efa ("anv: implement VK_KHR_synchronization2")

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19876>
2023-02-23 16:02:13 +00:00
Väinö Mäkelä
79a58cb79b hasvk: Enable PixelShaderKillsPixel when omask is used
From the Haswell PRM Vol. 2b, 3DSTATE_WM::Pixel Shader Kill Pixel:
    "This bit is required to be ENABLED in the following situations:
     - The API pixel shader program contains "killpix" or "discard"
       instructions, or other code in the pixel shader kernel that can
       cause the final pixel mask to differ from the pixel mask received
       on dispatch.
     - A sampler with chroma key enabled with kill pixel mode is used by
       the pixel shader.
     - Any render target has Alpha Test Enable or AlphaToCoverage Enable
       enabled.
     - The pixel shader kernel generates and outputs oMask."

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19876>
2023-02-23 16:02:13 +00:00
Mike Blumenkrantz
15b302179a aux/tc: add a 'has_resolve' member to tc_renderpass_info
this indicates that the first color buffer gets resolved

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21365>
2023-02-23 15:33:47 +00:00
Lionel Landwerlin
ce68824bdf anv: fix invalid masking of 48bit address
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 4d05be49c2 ("anv: implement vkCmdTraceRaysIndirect2KHR")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21486>
2023-02-23 15:02:45 +00:00
José Roberto de Souza
af994570f0 intel/blorp: Allocate only necessary amount of VERTEX_BUFFER_STATE
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21031>
2023-02-23 14:27:30 +00:00
José Roberto de Souza
a364f23a6c intel: Make gen12 URB space reservation dependent on compute engine presence
Tigerlake PRM: Volume 2c: Command Reference: Registers Part 2 - Registers M through Z
RCU_MODE :: Compute Engine Enable

   This bit indicates if Compute Engine (a.k.a Dual Context or Multi
   Context) is enabled or not. This bit must be treated as global
   control for enabling and disabling of compute engine. Hardware
   allocates required resources for the compute engine based on this
   bit.
   ....
   HW reserves 4KB of URB space...

Right now no gen12 platform has Dual Context enabled in kernel side,
exposing a compute engine but that can change, so here adding
has_compute_engine to intel_device_info and only reserving URB space
if compute engine is available.

While at it also fixing the error path when pb_slabs_init() fails.

Bspec: 46034
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21031>
2023-02-23 14:27:30 +00:00
Karmjit Mahil
63278778c6 pvr: Add push consts support to descriptor program.
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21387>
2023-02-23 10:14:17 +00:00
Eric Engestrom
fbd644c59d meson: replace vk_wsi_args with dependencies to let meson take care of transitivity
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19497>
2023-02-23 09:42:46 +00:00
Eric Engestrom
f059213f5d meson: reuse vulkan_wsi_list for defining vk_wsi_args
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19497>
2023-02-23 09:42:46 +00:00
Eric Engestrom
22c1f4be8c docs: mention meson configure and drop broken workaround script
The script is broken, and nobody noticed so it wasn't used much.

Meson has had support for printing the options by pointing to the source
dir for a while (not sure the exact version though) so I think we can
just recommend users do that.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21469>
2023-02-23 08:50:40 +00:00
Eric Engestrom
e5cf283121 docs: mention the meson summary
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21469>
2023-02-23 08:50:40 +00:00
Marcin Ślusarz
512126b26d intel/compiler: remove unused field from fs_thread_payload
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20957>
2023-02-23 08:04:24 +00:00
Patrick Lerda
9b4eb73907 r600: fix shader blob memory leak
Fixes: 5b205ef413
   r600: Store nir shaders serialized to save memory

Direct leak of 4096 byte(s) in 1 object(s) allocated from:
    #0 0x7faf89c3bb48 in __interceptor_realloc (/usr/lib64/libasan.so.6+0xb1b48)
    #1 0x7faf7be5981d in grow_to_fit ../src/util/blob.c:67
    #2 0x7faf7be5a538 in grow_to_fit ../src/util/blob.c:49
    #3 0x7faf7be5a538 in blob_reserve_bytes ../src/util/blob.c:177
    #4 0x7faf7be5a538 in blob_reserve_uint32 ../src/util/blob.c:190
    #5 0x7faf7d248a8c in nir_serialize ../src/compiler/nir/nir_serialize.c:2109
    #6 0x7faf7df4fdbb in r600_pipe_shader_create ../src/gallium/drivers/r600/r600_shader.c:401

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21443>
2023-02-23 07:06:42 +00:00
Juston Li
cc3c97d8c9 venus: Add VkBuffer cache statistics for debug
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21324>
2023-02-23 03:38:10 +00:00
Juston Li
7d53d4d078 venus: add VN_DEBUG_CACHE flag
General debug flag for dumping statistics for various caching done by
venus.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21324>
2023-02-23 03:38:10 +00:00
Juston Li
ef255444c1 venus: switch to lazy VkBuffer cache
Instead of creating a static VkBuffer cache at init with hardcoded
CreateInfo's, lazily cache VkBuffers that the app requests.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21324>
2023-02-23 03:38:10 +00:00
Karol Herbst
56a9aad401 nir/deref: don't replace casts with deref_struct if we'd lose the stride
The result might be used in a deref_ptr_as_array, which requires a proper
stride within lower_explicit_io. If we'd lose that information or end up
with a different stride don't execute this optimization.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8289
Fixes: b779baa9bf ("nir/deref: fix struct wrapper casts. (v3)")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21458>
2023-02-23 01:44:25 +00:00
Sajeesh Sidharthan
fa9a8c85e2 radeonsi/vcn: disable fence for JPEG decoding
5e1bd07a is causing JPEG decoding regression issue.
Therefore, disable fence for JPEG decoding until fence issue is fixed.

Signed-off-by: Sajeesh Sidharthan <sajeesh.sidharthan@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21442>
2023-02-23 01:08:09 +00:00
Eric Engestrom
c392cdf750 v3d: update supertuxkart reference after 1c028a4d5b
The smoke effect now looks smoother instead of having hard steps, which
looks like a reasonable change given that 1c028a4d5b added
several float formats:
https://eric.pages.freedesktop.org/-/mesa/-/jobs/36691458/artifacts/results/summary/results/trace@broadcom-rpi4@supertuxkart@supertuxkart-mansion-egl-gles-v2.trace.html

Fixes: 1c028a4d5b ("v3d: support r{g,gba}16f formats for vertex buffers")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21462>
2023-02-22 23:08:21 +00:00
Sviatoslav Peleshko
4229d9324f iris: Avoid creating uncompressed view with unaligned tile offsets on BDW
Fixes: 60568d5d ("iris: Use isl_surf_get_uncompressed_surf")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7990
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21147>
2023-02-22 22:33:08 +00:00
Eric Engestrom
7ebdddf319 docs: update calendar for 22.3.6
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21477>
2023-02-22 22:27:27 +00:00
Eric Engestrom
2ad5927816 docs/relnotes: add sha256sum for 22.3.6
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21477>
2023-02-22 22:27:27 +00:00
Eric Engestrom
e581901132 docs: add release notes for 22.3.6
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21477>
2023-02-22 22:27:27 +00:00
Emma Anholt
ecabc824c2 glsl: Drop the (v.x + v.y + v.z + v.w) -> dot(v, 1.0) optimization.
It's not connected up to anything at the moment, and even if I do enable
it for crocus HSW it only shaves 3 instructions off of one particular VS
in an old synthetic benchmark, not affecting anything else in shader-db.
I don't think anyone will care to ever fix or port this to NIR, let's just
retire it.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21353>
2023-02-22 21:45:35 +00:00
Rob Clark
3c668513b9 freedreno/a6xx: Fix view_seqno in tex cache key
If the view's seqno increments, it needs to happen *before* the tex cache
key is constructed.  Normally this happens when the sampler views are
bound.  But if the texture backing a current sampler view is rebound we
need to handle this before the cache lookup.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21408>
2023-02-22 21:26:28 +00:00
Rob Clark
818b49932a freedreno/a6xx: Static-ify sampler_view_update()
It doesn't need to be visible elsewhere since commit a93d3f1498
("freedreno/a6xx: Move tex state building")

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21408>
2023-02-22 21:26:28 +00:00
Rob Clark
e9fa92d6fa freedreno/a6xx: Small cleanup
Move the rb allocation to the place where it is populated (ie. where we
know how large it must be).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21408>
2023-02-22 21:26:28 +00:00
Rob Clark
936f2ebb46 freedreno/a6xx: Remove needs_invalidate flag
Whether the rsc seqno has changed tells us whether we need to update.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21408>
2023-02-22 21:26:27 +00:00
Rob Clark
b6778995d7 freedreno/a6xx: Add a way to assert valid format
Layout transitions caused by access as a various format must happen at
state bind time, before batch_draw_tracking().  Add a helper to assert
this fact.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21408>
2023-02-22 21:26:27 +00:00
Rob Clark
ea9d1cfb20 freedreno/a6xx: Fix sampler view rsc_seqno for X32_S8X24
Elsewhere we are comparing it against the seqno for the "primary" z32
buffer, so be consistent.  Otherwise we'll think we need to re-validate
every time the sampler view is bound.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21408>
2023-02-22 21:26:27 +00:00
Rob Clark
b40e3c9e6c freedreno/a6xx: Drop unneed fd6_texture_state() arg
It is redundant with shader type (stage).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21408>
2023-02-22 21:26:27 +00:00
Rob Clark
29445505f6 freedreno/a6xx: Fix set_sampler_views(start != 0)
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21408>
2023-02-22 21:26:27 +00:00
Rob Clark
a3c73987ab freedreno/a6xx: Move rsc seqno out of tex cache key
Since we invalidate tex cache entries if an associated pipe_resource is
rebound, we don't rely on the rsc_seqno being part of the tex cache key.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21408>
2023-02-22 21:26:27 +00:00
Rhys Perry
94abccf3ce aco: fix pathological case in LdsDirectVALUHazard
Similar to bfd4ac4581.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Fixes: 296b4d95a3 ("aco/gfx11: workaround LdsDirectVALUHazard")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21423>
2023-02-22 20:46:12 +00:00
Georg Lehmann
ee47cc8256 amd,nir: remove byte_permute_amd intrinsic
It's unused and if we ever want to use it again we should make it an alu
opcode instead.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21445>
2023-02-22 20:13:52 +00:00
Eric Engestrom
e316416dd0 docs: include explicit setup in instructions
The implicit `meson builddir/` is deprecated, and while we have fixed
our scripts, we forgot to update the docs we give our users ^^'

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-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/21468>
2023-02-22 20:07:16 +00:00
Pierre-Eric Pelloux-Prayer
a502f4fc13 radeonsi/video: use specific PIPE_BIND_ value for video buffers
Since 13cb41f666 PIPE_BIND_SHARED was used to allocate driver internal
video buffers. These buffers are never shared, but the intent was to
get non-suballocated buffers and SHARED was used as an indirect flag.

This commit switches to PIPE_BIND_CUSTOM which isn't used anywhere else,
and is now translated as "no suballocation".

The main benefit here is that this allows these buffers to set
use_reusable_pool to true reducing the CPU overhead a lot.

For instance, running the following command on my system:

   ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi \
       -i tears_of_steel_1080p.mov -an -c:v h264_vaapi output.mp4

takes 35 sec with this commit vs 45 sec without.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21416>
2023-02-22 18:30:28 +00:00
Chia-I Wu
635d62ba99 mesa: use mesa_log from output_if_debug
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>
2023-02-22 17:55:40 +00:00
Chia-I Wu
f18f43338e mesa: add missing newlines for _mesa_debug/_mesa_log callers
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>
2023-02-22 17:55:40 +00:00
Chia-I Wu
40e45eaef0 util/log: add logger_windbg
Because output_if_debug has it.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>
2023-02-22 17:55:40 +00:00
Chia-I Wu
8f0a7e848f util/log: add support for MESA_LOG_FILE
It allows logger_file to log to any file.

v2: check "geteuid() == getuid()"

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>
2023-02-22 17:55:40 +00:00
Chia-I Wu
7d8d64426b util/log: add logger_syslog
This is useful when the app is a daemon.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>
2023-02-22 17:55:40 +00:00
Chia-I Wu
bbd19527c1 util/log: improve logger_android
Avoid __android_log_vprint which can truncate messages.  Also add
MESA_LOG=wait to lower the chance of logger_android dropping messages.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>
2023-02-22 17:55:40 +00:00
Chia-I Wu
7a18a1712a util/log: improve logger_file newline handling
Add logger_vasnprintf that will be used by other loggers.  For
logger_file, it improves newline handling for

  mesa_logd("%s", "hello\n");

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>
2023-02-22 17:55:40 +00:00
Chia-I Wu
63864d4dfc util/log: allow multiple loggers
It still logs to logcat on Android and stderr otherwise by default.
MESA_LOG is introduced to override the loggers.

v2: add va_copy

Reviewed-by: Emma Anholt <emma@anholt.net> (v1)
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>
2023-02-22 17:55:40 +00:00
Chia-I Wu
337d58f6fc util/log: refactor mesa_log
Add logger_file and logger_android.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>
2023-02-22 17:55:40 +00:00
Alejandro Piñeiro
dd3b67b974 v3dv: handle ASPECT_MEMORY_PLANE aspect flags when getting plane number
As we support VK_EXT_image_drm_format_modifier, we could receive
VK_IMAGE_ASPECT_MEMORY_PLANE_0/1/2_BIT_EXT flags.

Fixes several tests like this:
dEQP-VK.drm_format_modifiers.create_explicit_modifier.*

when using CTS 1.3.5.0

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21463>
2023-02-22 16:27:43 +00:00
Sebastian Wick
f4ce19063c loader: do not check the mesa DRI_Mesa version if it was not found
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
Fixes: 1026d29344 ("dri: Introduce internal Mesa DRI driver loader extension.")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21429>
2023-02-22 15:07:24 +00:00
Karol Herbst
6e666c6303 nir: Skip samplers and textures in lower_explicit_io
We have specialized lowering passes dealing with most of that already:
1. gl_nir_lower_samplers_as_deref
2. nir_lower_samplers
3. nir_lower_cl_images

If we need more than that, those passes can deal with following deref
chains as well.

We _might_ need to improve nir_lower_cl_images a bit for more complex
kernels, but CL also doesn't allow indirect images, so we are always able
to optimize the entire deref chain away.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20161>
2023-02-22 14:20:21 +00:00
Karol Herbst
186a22712f rusticl: allocate printf buffer as staging
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20161>
2023-02-22 14:20:21 +00:00
Karol Herbst
3abbeed74f rusticl: no compute only
This might be a good optimization, but we should figure first what drivers
should be able to disable and what not first.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20161>
2023-02-22 14:20:21 +00:00
Karol Herbst
ced9d5d635 rusticl/device: limit CL_DEVICE_MAX_CONSTANT_ARGS
At the moment we implement constant memory as normal global memory, but
we still should limit to the actual constant buffer cap once we properly
use UBOs for that.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20161>
2023-02-22 14:20:21 +00:00
Karol Herbst
bbea8761c2 rusticl/device: fix some device limits
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20161>
2023-02-22 14:20:21 +00:00
Karol Herbst
188c0d7c8f llvmpipe/ci: increase deqp-runner timeout
Some of the OpenCL tests are flaky, because they just take that long.
Builtins can generated really complex code and if we are unlucky they can
timeout.

Proper support for functions would also solve the issue, probably, but for
now increase the deqp-runner timeout so it's less of an annoyence.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20161>
2023-02-22 14:20:21 +00:00
Samuel Pitoiset
7f2775bc8a radv/ci: cleanup CI lists for dEQP-VK.memory.* tests that timeout
These tests usually take more than 30s to complete, so exclude them
completely instead. This should also make runs slightly faster.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21464>
2023-02-22 13:25:13 +00:00
Eric Engestrom
2809bb8499 broadcom/ci: re-enable egl on wayland
Swap them, as suggested by @enunes, to avoid a ton of timeouts in
wayland if the x11 tests ran first.

Needs to be investigated, but at least like this we can get the CI
coverage back.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21453>
2023-02-22 12:59:04 +00:00
Eric Engestrom
67b2f48645 broadcom/ci: add two known failures
The first one in a Pass on both the rpi and the simulator, while the second
one is skipped as NotSupported on both. No idea why it's failing on the
CI, but at least it's consistently failing...

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21453>
2023-02-22 12:59:04 +00:00
Eric Engestrom
50361c71f4 broadcom/ci: skip buffer_age.no_preserve and swap_buffers_with_damage on wayland
They hang the runner, but they all pass fine on my rpi.
Will need investigating, but for now skip them.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21453>
2023-02-22 12:59:04 +00:00
Eric Engestrom
d01fded429 broadcom/ci: drop create_pixmap_surface from the fails; it passes now
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21453>
2023-02-22 12:59:04 +00:00
Eric Engestrom
ccc61357d5 broadcom/ci: add x11- prefix to x11 EGL tests
Makes things more obvious now that we're enabling wayland as well.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21453>
2023-02-22 12:59:04 +00:00
Erik Faye-Lund
176add76ad zink: get rid of needless dependency
We haven't needed this header since 7f56fd9655 ("zink: it's kopperin'
time"), so let's get rid of it and the dependency that comes with it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21441>
2023-02-22 12:23:39 +00:00
Erik Faye-Lund
e02cdb397e zink: prefer vulkan_core.h over vulkan.h
There's just two places where we need any of the WSI specific vulkan
includes, the rest of Zink should do just fine with vulkan_core.h. So
let's include the win32-specific header explicitly in those two places,
and reduce the need for WSI specifics inside zink itself. Kopper
handles the rest of the WSI integration.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21441>
2023-02-22 12:23:39 +00:00
Konstantin Seurer
6242fe3923 anv: Use vk_acceleration_structure
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21047>
2023-02-22 11:58:57 +00:00
Konstantin Seurer
4d2a7ea146 radv: Use vk_acceleration_structure
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21047>
2023-02-22 11:58:57 +00:00
Konstantin Seurer
eb33a1adb0 vulkan: Add vk_acceleration_structure
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21047>
2023-02-22 11:58:57 +00:00
Sui Jingfeng
1ba3e83958 meson: add basic support for loongarch
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21182>
2023-02-22 09:09:43 +00:00
Samuel Pitoiset
1583b150d6 radv: set VS_OUT_MISC_SIDE_BUS_ENA for clip distances on GFX10.3+
On GFX10.3, all auxiliary position exports are optimized, so set it
for clip/cull distances. Both RadeonSI and llpc set it too.

Suggested by Marek.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21439>
2023-02-22 07:17:33 +00:00
Mike Blumenkrantz
50a65e2e2b driconf: add zink glthread disable for a game
ref #8333

fixes #8328

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21424>
2023-02-22 03:22:50 +00:00
Mike Blumenkrantz
e375fb0c5c zink: make ZINK_DESCRIPTOR_MODE=db the default
this has been getting beat up a lot lately by radv ci (and me),
so it should be ready to turn on by default for even more testing
in advance of the 23.1 release

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21398>
2023-02-22 02:58:19 +00:00
Mike Blumenkrantz
685bd95de9 zink: move db input attachment size check to screen init
it'd be weird to crash later on after allowing db mode to init

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21398>
2023-02-22 02:58:19 +00:00
Danylo Piliaiev
e6f5480180 ir3: Add cat7 sleep instruction
Has short and long variants, long seem to be ~20 times longer.
The exact difference between it and a bunch of nops is unknown.

The emission of this instruction were not observed in the wild.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14419>
2023-02-21 19:59:14 +00:00
Danylo Piliaiev
121e4ca87d ir3: Add cat5/cat7 cache related instructions
- tcinv - Likely Texture Cache Invalidate (unverified)
- icinv - Mostly sure that it is Instruction Cache Invalidate
- dccln - Data Cache Clean
- dcinv - Data Cache Invalidate
- dcflu - Data Cache Flush

The emission of these instructions were not observed in the wild.

TODO: find out the difference between .shr and .all modes of
      dccln, dcinv, dcflu.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14419>
2023-02-21 19:59:14 +00:00
Sviatoslav Peleshko
42dba8ebc5 driconf/anv: Apply limit_trig_input_range WA to Rise of the Tomb Raider
During its Ambient Occlusion calculations the game ends up calculating
sin/cos of some pretty big values, for which HW produces completely bogus
results (e.g. cos(3929491.25) ~= -0.011, while correct would be ~0.923).

Limit the arguments to the reasonable (-2*Pi; 2*Pi) range with the
limit_trig_input_range WA.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8292
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
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/21396>
2023-02-21 19:23:28 +00:00
Mike Blumenkrantz
b43d32b77d kopper: fix loop iterating for msaa texture creation
the pipe_resource template values need to always be initialized or
else texture creation fails and rendering is broken

fixes #8331

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21450>
2023-02-21 18:57:52 +00:00
Charmaine Lee
1b9b060f0e svga: use upload buffer if texture has pending changes
When establishing a texture transfer map, if there is any pending changes on the
texture, instead of trying direct map with DONTBLOCK first, just
use the upload buffer path.

Fixes piglit tests gen-teximages, arb_copy_images-formats

Cc: mesa-stable

Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21393>
2023-02-21 09:48:23 -08:00
Charmaine Lee
3a359385cb svga: fix compatible formats for shareable surfaces
Add typeless format to the compatible format lists for shareable surfaces.

Fixes webgl benchmark crash in eglCreateImage running from firefox on Fedora 37.

Cc: mesa-stable

Reviewed-by: Martin Krastev <krastevm@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21393>
2023-02-21 09:48:23 -08:00
Charmaine Lee
75b7296fc3 svga: fix resource_get_handle from resource created without SHARED bind flag
When an EGLImage is created from a 2D texture and used for texture sharing,
the texture surface might not have been created with the SHARED bind flag.
To allow these surfaces for sharing, this patch sets the USAGE SHARED bit
for surfaces that can be potentially used for sharing even when the SHARED
bind flag is not originally set. Instead of unconditionally enabling the
SHARED bind flag for all surfaces and unnecessarily bypass the surface cache
optimization, this patch only enables the USAGE SHARED bit for surfaces
that also have the RENDER TARGET bind flag.
When the surface handle is inquired and if the surface is currently
marked as cachable, we will need to unset the cachable bit so
the surface handle will not be recycled again.

This patch fixes an assertion in svga_resource_get_handle() when the
EGL_MESA_image_dma_buf_export extension is used in webgl benchamrk running
from firefox in Fedora 37.

Cc: mesa-stable

Reviewed-by: Martin Krastev <krastevm@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21393>
2023-02-21 09:48:23 -08:00
Roland Scheidegger
427ac51c10 llvmpipe: only use accurate_a0 hack if there are no textures bound
This hack caused problems with some dx9 tests before (due to mipgen
test using nearest filter sampling with tex coords exactly between two
texels hence being extremely sensitive to arithmetic inaccuracies),
and we can no longer distinguish this by using pixel_offset to not get
it enabled. But to pass other tests we don't really need the hack when
there's texture sampling involved anyway.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21407>
2023-02-21 17:15:34 +00:00
Eric Engestrom
9390766b83 broadcom/ci: use weston's xwayland instead of starting X as well
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21449>
2023-02-21 16:50:54 +00:00
Eric Engestrom
5425064c53 broadcom/ci: group x11 and wayland variant of the same test failing
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21449>
2023-02-21 16:50:54 +00:00
Konstantin Seurer
af19762935 radv/rt: Skip instances after loading the entire node
This avoids waiting for instance_data which can improve performance:

vk_ray_tracing_ao_KHR_app: 0.2% (The TLAS has 2 instances)
Quake II RTX: 1%
Control: 1%

We also have to shuffle around some code to avoid increasing VGPR usage.
That leaves us with the following stats:

Quake II RTX:
Totals from 7 (14.29% of 49) affected shaders:
CodeSize: 165612 -> 165716 (+0.06%)
Instrs: 31446 -> 31460 (+0.04%)
Latency: 596709 -> 554292 (-7.11%)
InvThroughput: 121998 -> 113327 (-7.11%)
VClause: 596 -> 587 (-1.51%)
Copies: 4664 -> 4646 (-0.39%)
PreVGPRs: 620 -> 639 (+3.06%)

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21421>
2023-02-21 15:51:14 +00:00
Rhys Perry
ab3184c0a2 aco: don't apply modifiers through DPP to unsupported instructions
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21201>
2023-02-21 14:59:38 +00:00
Georg Lehmann
3bd5b583f9 aco: combine a ^ ~b and ~(a ^ b) to v_xnor_b32
Foz-DB Navi21:
Totals from 13 (0.01% of 134913) affected shaders:
CodeSize: 225432 -> 225180 (-0.11%)
Instrs: 41973 -> 41908 (-0.15%)
Latency: 297464 -> 297326 (-0.05%)
InvThroughput: 82536 -> 82467 (-0.08%)
Copies: 2452 -> 2440 (-0.49%)

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21410>
2023-02-21 13:35:31 +00:00
Illia Abernikhin
dea36fce6a util: Extend vk_enum_to_str with bitmasks
vk_enum_to_str only generates literals for enums with type: @type="enum",
but many enums have type: @type="bitmask" and were not taken into account here.

Main changes:
Empty enums are now always skipped
For bitmasks skipped *MAX_ENUM value

Signed-off-by: Illia Abernikhin <illia.abernikhin@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8173
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21146>
2023-02-21 13:59:19 +02:00
Marcin Ślusarz
e29a964d02 intel/compiler/mesh: follow the type of offset variable
This allows copy propagation to kick in, decreasing the overall
number of generated instructions.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21098>
2023-02-21 11:10:24 +00:00
Marcin Ślusarz
15afb8dcc6 intel/compiler/mesh: apply URB payload mask once per program
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21098>
2023-02-21 11:10:23 +00:00
Daniel Schürmann
93a47bab04 nir: simplify nir_block_cf_tree_{next|prev}
Removes some case distinction by first checking if this is
the first/last block of a cf_node.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13962>
2023-02-21 10:41:11 +00:00
Daniel Schürmann
2e394b5cc1 nir/lower_continue_targets: only repair SSA when necessary
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13962>
2023-02-21 10:41:11 +00:00
Daniel Schürmann
7fba5abfd7 nir/lower_continue_constructs: special-case Continue Constructs with zero or one predecessors
If a loop has only a single continue, the control flow is already
converged and we can inline the continue construct.
If a loop has no continue statement at all, the Continue Construct
is unreachable and can simply be deleted.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13962>
2023-02-21 10:41:11 +00:00
Daniel Schürmann
f42eb71df9 spirv: use Loop Continue Construct to emit SPIR-V loops and lower after parsing
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13962>
2023-02-21 10:41:11 +00:00
Daniel Schürmann
c20751d61d nir: add lowering for Loop Continue Constructs
This pass lowers Loop Continue Constructs to the previous solution
by inserting it at the beginning of the loop:

loop {
   if (i != 0) {
      continue construct
   }
   loop body
}

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13962>
2023-02-21 10:41:11 +00:00
Daniel Schürmann
312510448f nir: create nir_push_continue() and related helpers
nir_control_flow.h:
  void nir_loop_add_continue_construct(nir_loop *loop);
  void nir_loop_remove_continue_construct(nir_loop *loop);

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13962>
2023-02-21 10:41:11 +00:00
Daniel Schürmann
2bb369dd8d nir: add assertions that loops don't have a Continue Construct
Hoping that I didn't miss any, this *should* add assertions
to all functions and passes which explicitly handle 'nir_loop'.

Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13962>
2023-02-21 10:41:11 +00:00
Daniel Schürmann
d4b97bf3fa nir: add Continue Construct to nir_loop
The added continue_list corresponds to the SPIR-V
Continue Construct and serves as a converged control-flow
construct and is executed after each continue statement
and before the next iteration of the loop body.

Also adds validation rules for loops with Continue Construct

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13962>
2023-02-21 10:41:11 +00:00
Caio Oliveira
e0c6ad1ce5 glsl: Account for unsized arrays in NIR linker
Follow the same approach as the pre-NIR linker.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5891
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21401>
2023-02-21 09:08:18 +00:00
Gert Wollny
10f8240caf zink/kopper: Add extra swapchain images for Venus
Together with the previous patch that corrects the number of
swapchain images on Xwayland this gives Zink/Venus a spead
boost in a number of work loads and close the gap or even
surpass VirGL when the benchmark is not GPU bound.
Some numbers:

 zink (Virtio-GPU Venus (Host: RADV RENOIR)) / VirGL

 Benchmark                   VirGL    baseline  Zink/Venus +1
                                                and Xwayland +1
    ==================================================================
    OpenArena (FPS)            63.8     60.1     148.5
    Unigine Sancuary (FPS)    129.1    121.4     164.7
    Unigine Tropics (FPS)     107.2     85.7     114.3
    Unigine Heaven (FPS)       48.5     48.0      51.5
    Unigine Valley (FPS)       48.0     45.6      47.4
    Xonotic (FPS)              90.5     59.4      89.2
    GpuTest/Volcano (Points)   2960     2966      3013

  zink (Virtio-GPU Venus (Host: Intel Xe TGL GT2)) / VirGL

 Benchmark                   VirGL    baseline  Zink/Venus +1
                                                and Xwayland +1
    ===========================================================
    OpenArena (FPS)          95.1       59.8        78.9
    Unigine Sancuary (FPS)   85.5       76.6        81.8
    Unigine Tropics (FPS)    66.0       59.8        62.7
    Unigine Heaven (FPS)     28.8       28.7        28.0
    Unigine Valley (FPS)     29.0       28.0        27.0
    Xonotic (FPS)            64.2       49.4        51.1
    GpuTest/Volcano (Points) 2855       2718        2747

v2: Fix limiting minImageCount (Mike)

Signed-off-by: Gert Wollny <gert.wollny@collabora.co.uk>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21136>
2023-02-21 08:43:30 +00:00
Gert Wollny
04d654a5d0 vulkan/wsi: Take Xwayland into account for x11_min_image_count
For wayland we report a minimum of four swapchain images, so for
Xwayland we should report the same.

v2: Fix typo (Eric)
v3: Make that four images on Xwayland (Daniel)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21136>
2023-02-21 08:43:30 +00:00
Alyssa Rosenzweig
23ec0d6bb2 asahi: Make shader-db work again
We need a nontrivial blend state otherwise the whole frag shader is optimized
out.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21432>
2023-02-21 08:24:58 +00:00
Alyssa Rosenzweig
029c686c6d asahi: Implement color masks with masked stores
Blend states can require masking colour. Currently, this is handled by
nir_lower_blend, which lowers masks to a read-modify-write operation as required
on Mali hardware. However, our "tilebuffer store" instruction supports a write
mask, allowing us to write only a subset of channels to the tilebuffer. It's
more efficient to use that than to emit pointless tilebuffer loads.

Note that even without tilebuffer loads, non-opaque masks don't work with opaque
pass types.  Here, we handle this with a translucent pass type, which gets HSR
to do the right thing and is consistent with the pass type used previously.
However, it's a bit heavy handed -- Apple manages to use an opaque pass type
with masking but with some unknown HSR fields twiddled. IMO reverse-engineering
those details shouldn't block this because this gets us closer to optimal (just
not all the way there) and is strictly better than what we had before.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21431>
2023-02-21 08:10:15 +00:00
Alyssa Rosenzweig
3084e6e689 agx: Add agx_internal_format_supports_mask helper
Not all formats can be masked, add a query to check which can be.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21431>
2023-02-21 08:10:15 +00:00
Alyssa Rosenzweig
5e031867fe agx: Handle ssa_undef as zero
Masked stores may result in undefs after optimization. Rather than call
lower_undef_to_zero late (but get no benefit), we may as well handle ourselves
to prepare for proper undef support down the line.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21431>
2023-02-21 08:10:15 +00:00
Alyssa Rosenzweig
eab4d6a96f agx: Add and use agx_nir_ssa_index helper
Common subexpression that we'll repeat once more in the next patch.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21431>
2023-02-21 08:10:15 +00:00
Samuel Pitoiset
ad459054ed radv: enable SQTT tracing on GFX11
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20338>
2023-02-21 07:28:49 +00:00
Samuel Pitoiset
dfa9b5d624 radv: disable SPM counters with RGP on GFX11
They are likely different and perfcounters aren't defined on GFX11 yet.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20338>
2023-02-21 07:28:49 +00:00
Samuel Pitoiset
5fe48baad6 radv: implement a workaround for SQTT on GFX11
Found in AMDVLK, see the comment below for an explanation.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20338>
2023-02-21 07:28:49 +00:00
Samuel Pitoiset
826ae89ba6 radv: make sure to wait for the trace buffer also on GFX11
Otherwise, we might get incomplete data.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20338>
2023-02-21 07:28:49 +00:00
Samuel Pitoiset
c2bc4aff54 radv: only enable SQTT for SE0 on GFX11
For weird reasons, the hardware doesn't return any data for other SEs.
RadeonSI is also affected by the same issue, enable only SE0 for now.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20338>
2023-02-21 07:28:49 +00:00
Samuel Pitoiset
ad4ad2ba84 radv: configure SQ_THREAD_TRACE_CTRL.REG_AT_HWM on GFX11
AMDVLK sets this to 2 when the always stall mode is enabled, which is
the default in RADV.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20338>
2023-02-21 07:28:49 +00:00
Jan Beich
8bc78e8eb9 util/u_process: implement util_get_command_line for BSDs
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21052>
2023-02-20 21:26:49 +00:00
Pierre-Eric Pelloux-Prayer
923758a5c2 winsys/amdgpu: use amdgpu_device_get_fd
If radv is initialized before radeonsi, doing:

   aws->fd = fd;

is incorrect because the device was initialized using the fd
passed by radv.

libdrm has a helper to query the fd used to create the device,
so use it.

We also need to init the kms_handles table in this case
because we're going to share BOs between radeonsi's fd and
the device fd.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3424
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20983>
2023-02-20 20:38:17 +00:00
Amber
919c5568bf freedreno: check for conditional rendering in launch_grid
fixes: KHR-GL45.compute_shader.conditional-dispatching

Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21428>
2023-02-20 19:03:25 +00:00
Alyssa Rosenzweig
e93a221024 agx: Handle group_memory_barrier
A combination of control_barrier + memory_barrier but it's always seen with
those. This would be safer with scoped barriers...

Fixes dEQP-GLES31.functional.synchronization.inter_invocation.ssbo

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>
2023-02-20 18:50:40 +00:00
Alyssa Rosenzweig
e9cec96633 agx: Implement b2b32
Shows up with store_shared.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>
2023-02-20 18:50:40 +00:00
Alyssa Rosenzweig
955797bb00 agx: Pack local atomics
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>
2023-02-20 18:50:39 +00:00
Alyssa Rosenzweig
14f546726e agx: Lower shared memory offsets to 16-bit
Per the hardware requirement. This simplifies instruction selection (it avoids
the need to constant fold u2u16 in the backend).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>
2023-02-20 18:50:39 +00:00
Alyssa Rosenzweig
a21f6f8cb0 agx: Translate load/store_shared
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>
2023-02-20 18:50:39 +00:00
Alyssa Rosenzweig
f8b9dfbbad agx: Translate NIR atomics
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>
2023-02-20 18:50:39 +00:00
Alyssa Rosenzweig
2a021b1818 agx: Pack local load/store instructions
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>
2023-02-20 18:50:39 +00:00
Alyssa Rosenzweig
96904f83b4 agx: Pack global atomics
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>
2023-02-20 18:50:39 +00:00
Alyssa Rosenzweig
eea3674f36 agx: Disallow immediate bases to device_load
Lina pointed this out in review.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>
2023-02-20 18:50:39 +00:00
Alyssa Rosenzweig
6b0ef2b462 agx: Model local loads/stores
Aka shared memory or threadgroup memory.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>
2023-02-20 18:50:39 +00:00
Alyssa Rosenzweig
0d07d27173 agx: Model atomic instructions
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>
2023-02-20 18:50:39 +00:00
José Roberto de Souza
ec7584130f iris: Export num_fences()
This function will be needed by i915 and Xe backends.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21389>
2023-02-20 18:29:47 +00:00
José Roberto de Souza
780dd291c5 iris: Export update_batch_syncobjs()
This function will be needed by i915 and Xe backends.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21389>
2023-02-20 18:29:47 +00:00
José Roberto de Souza
102e180d0f iris: Export batch debug functions
Those function will be called by different backends, so exporting it.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21389>
2023-02-20 18:29:47 +00:00
Alyssa Rosenzweig
9e67d3f237 asahi: Advertise ARB_texture_barrier
We already implement it.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21264>
2023-02-20 17:27:21 +00:00
Alyssa Rosenzweig
5f8a59ac89 asahi: Advertise ARB_derivative_control
Our native fddx instruction is already fine, so it's fine to use it for both
fddx_coarse and fddx_fine. We handle both of those cases already so the
extension is trivial.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21264>
2023-02-20 17:27:21 +00:00
Alyssa Rosenzweig
c6c61d052e docs/features: Sync Asahi with reality
A few features were either missed in the original patch or have since been
added, update features.txt to light up more green on the mesa matrix.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21264>
2023-02-20 17:27:21 +00:00
Alyssa Rosenzweig
cf96edff1c agx: Implement gathers (nir_texop_tg4)
Passes dEQP-GLES31.functional.texture.gather.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21264>
2023-02-20 17:27:21 +00:00
Alyssa Rosenzweig
978d3fefa8 agx: Model and pack gathers
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21264>
2023-02-20 17:27:21 +00:00
Alyssa Rosenzweig
8dc861dbb5 agx: Lower offsets in NIR
Rather than the backend. This way we can handle non-constant offsets as well as
constants with a single code path (with the constant offset code subsumed as a
special case via NIR's constant folding). This nets us dynamic offset support.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21264>
2023-02-20 17:27:21 +00:00
David Heidelberg
a5dfee1c22 ci: revert download of git cache to the wget
At this point of CI there is not curl available.

Fixes: 796686af1b ("ci: migrate from wget to curl")

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21414>
2023-02-20 13:48:32 +00:00
Simon Perretta
44f40ff941 pvr: Use descriptor/set/table offsets from driver
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Co-Authored-By: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Acked-by Frank Binns <frank.binns@imgtec.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21331>
2023-02-20 13:34:03 +00:00
Simon Perretta
e64288a0ba pvr: Split pvr_private.h
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by Frank Binns <frank.binns@imgtec.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21331>
2023-02-20 13:34:03 +00:00
Simon Perretta
5694755fa0 pvr: Load descriptors from memory
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by Frank Binns <frank.binns@imgtec.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21331>
2023-02-20 13:34:03 +00:00
Simon Perretta
3355749105 pvr: Support loading immediate values
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by Frank Binns <frank.binns@imgtec.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21331>
2023-02-20 13:34:03 +00:00
Simon Perretta
e0e58e9659 pvr: Additional register subarray support
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by Frank Binns <frank.binns@imgtec.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21331>
2023-02-20 13:34:03 +00:00
Simon Perretta
888e06b8cc pvr: Add bitwise instruction support
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by Frank Binns <frank.binns@imgtec.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21331>
2023-02-20 13:34:02 +00:00
Simon Perretta
93fa2f6265 pvr: Add memory load support
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by Frank Binns <frank.binns@imgtec.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21331>
2023-02-20 13:34:02 +00:00
Simon Perretta
81f86a559c pvr: Add ADD64 support
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by Frank Binns <frank.binns@imgtec.comr>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21331>
2023-02-20 13:34:02 +00:00
Karmjit Mahil
7386342a19 pvr: Add PVR_SELECT() helper macro
For pvr_setup_descriptor_mappings_new() there will be quite a few
variables of which the value depend on the stage so rather than
having all that selection in the `switch` at the beginning of the
function the helper macro provides a compact selection in the
desired scope.

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/21331>
2023-02-20 13:34:02 +00:00
Karmjit Mahil
ce67f5ac94 pvr: Write descriptor set addrs table dev addr into shareds
Previously UBOs and various buffers, as well as the native
descriptor sets were DMAed into the shared registers. This added
complexity in allocating the registers and various other places.
We also ended up being in situations were we wouldn't know the size
of a buffer by the time the shaders were being compiled. It would
be possible to determine the size by inspecting the shader but
that would introduce more complexity in the compiler.
To get things working sooner, avoid extra complexity for
now, a different approach was devised.

The driver will write the addresses of the currently bound
descriptor sets into a device buffer. The device buffer is referred
to as the descriptor set addrs table. The dev addr of the table is
written into a shared register. To access the buffers the shader
will first get the address of the descriptor set from the in memory
table. Then get the primary descriptor from the descriptor set. And
finally access the in memory buffer with the address it read from
the descriptor. Essentially there's three level of indirection and
all the buffers are in memory. The shader will know what offset the
primary descriptor is located based on the descriptor set layout.
The descriptor set address could have been written into the shareds
directly but that would require extra handling on the compiler side
so opted to just write the table address instead.

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/21331>
2023-02-20 13:34:02 +00:00
Karmjit Mahil
d67ed3eb24 pvr: Change last_DMA to last_dma
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/21331>
2023-02-20 13:34:02 +00:00
Karmjit Mahil
5405277b38 pvr: Put old descriptor set approach behind a hardcoding check
This commit sets up the infrastructure to introduce the new
descriptor set approach while keeping the old paths so the
hard coded apps are still operational. The old paths will be
removed once the compiler can compiler shaders for those apps
and the driver-compiler interface is fully flushed out.

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/21331>
2023-02-20 13:34:02 +00:00
Karmjit Mahil
b7f8a120bf pvr: Store enum pvr_stage_allocation instead of VkShaderStageFlags
This commit changes the pipeline layout, desc. set layout,
and desc. set layout binding to keep track of shader stage usage
with a mask of enum pvr_stage_allocation instead of
VkShaderStageFlags.

This commit also makes renames the relevant fields to
'shader_stage_mask' to make the naming uniform across stucts.

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/21331>
2023-02-20 13:34:02 +00:00
Samuel Pitoiset
15f1478eb9 radv/ci: move CI lists for external GPUs in separate folder
A bunch of CI lists are maintained by ourselves with GPUs outside of
Mesa CI. Move them to a separate folder to avoid confusion.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21417>
2023-02-20 13:05:50 +00:00
Samuel Pitoiset
f334704078 radv/ci: disable vkcts-kabini-valve
It's no longer reachable.

Suggested-by: Martin Roukala <martin.roukala@mupuf.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21417>
2023-02-20 13:05:50 +00:00
Alyssa Rosenzweig
dee4784e53 asahi: Fix rendering into mipmapped framebuffers
batch->key.width will be minified, but then the PBE::level field will
incorrectly minify again.

Fixes dEQP-GLES31.functional.shaders.framebuffer_fetch.basic.framebuffer_texture_level

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21400>
2023-02-20 11:47:56 +00:00
Alyssa Rosenzweig
0e0825013d agx: Do more work in agx_preprocess_nir
agx_preprocess_nir runs once per shader, whereas agx_optimize_nir runs once per
variant. That means we want to do as much work as possible in agx_preprocess_nir
to make shader variants as cheap as possible to compiler. So, move our standard
suite of lowering and optimizing to the preprocess loop, leaving just a single
(easy) trip through the optimizer for simple variant processing.

Plus, we can remove variables when preprocessing, since we no longer use
variables anywhere. We remove them to reduce the RAM and disk cache footprint of
shader variants.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21104>
2023-02-20 11:34:58 +00:00
Alyssa Rosenzweig
5b92bd99db agx: Don't treat clip distances specially
We've been using the clip lowering, but it's been broken upstream because of
this artefact from the (non-lowered implementation) sneaking in from downstream.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21104>
2023-02-20 11:34:58 +00:00
Asahi Lina
99a6afd1a6 asahi: Only apply FS lowerings to fragment shaders
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21104>
2023-02-20 11:34:58 +00:00
Alyssa Rosenzweig
2adea481f1 asahi: Move agx_preprocess_nir to CSO create
Now we preprocess shaders once at link time, rather than every time we spawn a
variant. This should reduce variant pain.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21104>
2023-02-20 11:34:58 +00:00
Alyssa Rosenzweig
4495f85b08 asahi: Lower clip distances late
This pass works either early or late, so run it late. It creates some
nir_variables as a side effect, which is weird, but it doesn't matter because
the AGX backend doesn't look at variables and the metadata and lowered I/O
intrinsics are all correct.

This is the last step to moving I/O lowering (and hence shader preprocessing) to
CSO create time.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21104>
2023-02-20 11:34:58 +00:00
Eric Engestrom
59c64d90e2 docs/release-calendar: drop the last 22.2.x, it won't happen
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21415>
2023-02-20 11:28:30 +00:00
Samuel Pitoiset
04c45b91a4 zink/ci: set RADV_PERFTEST=gpl for RADV jobs
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21329>
2023-02-20 11:05:26 +00:00
Samuel Pitoiset
6ec392ab4f zink/ci: skip KHR-GL46.texture_swizzle.functional with RADV
They usually timeout.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21329>
2023-02-20 11:05:26 +00:00
Samuel Pitoiset
cd1f1990a7 ci: uprev vkd3d-proton
This adds test coverage for VK_EXT_image_sliced_view_of_3d.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21384>
2023-02-20 09:17:25 +00:00
Iago Toral Quiroga
1c028a4d5b v3d: support r{g,gba}16f formats for vertex buffers
These are supported, and in fact we are exposing them through
Vulkan. Makes SuperTuxKart significantly faster in GL, I've
observed an FPS increase from ~100% to ~500% depending on the
track.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21361>
2023-02-20 07:45:58 +00:00
Yusuf Khan
689a0c4d4e gallium: create query_memory_info implementation for sw drivers
For ATI_meminfo or NVX_gpu_memory_info on llvmpipe and softpipe.

Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21373>
2023-02-20 04:26:28 +00:00
Kenneth Graunke
96ba0344db intel: Use common helpers for TCS passthrough shaders
Rob added these new helpers a while back, which freedreno and radeonsi
both share.  We should use them too.  The new helpers use variables and
system value intrinsics, so we can drop the explicit binding table
creation and just use the normal paths.

Because we have to rewrite the system value uploading anyway, we drop
the scrambling of the default tessellation levels on upload, and instead
let the compiler go ahead and remap components like any normal shader.
In theory, this results in more shuffling in the shader.  In practice,
we already do MOVs for message setup.  In the passthrough shaders I
looked at, this resulted in no extra instructions on Icelake (SIMD8
SINGLE_PATCH) and Tigerlake (8_PATCH).  On Haswell, one shader grew by
a single instruction for a pittance of cycles in a stage that isn't a
performance bottleneck anyway.  Avoiding remapping wasn't so much of an
optimization as just the way that I originally wrote it.  Not worth it.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20809>
2023-02-20 03:54:24 +00:00
Timothy Arceri
3a9edfc494 glsl: isolate object macro replacments
Here we use a leading space to isolate them from
the code they will be inserted into. For example:

    #define VALUE -1.0
    int a = -VALUE;

Should be evaluated to int a = - -1.0; not int a = --1.0;

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

Cc: mesa-stable
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21352>
2023-02-20 01:50:05 +00:00
Timothy Arceri
6e29dce291 glsl: add _token_list_prepend() helper to the parser
This will be used in the following patch.

Cc: mesa-stable
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21352>
2023-02-20 01:50:05 +00:00
Timur Kristóf
2c40215ab9 aco/optimizer: Change v_cmp with subgroup invocation to constant.
When a shader has a comparison with the subgroup invocation id,
we can use a constant instead, saving a VALU instruction.
When the constant can't be represented as a 64-bit literal,
use the s_bfm_b64 instruction to generate it instead, which
is still a win.

Fossil DB stats on GFX11:
Totals from 300 (0.22% of 134913) affected shaders:
CodeSize: 2223052 -> 2214336 (-0.39%); split: -0.43%, +0.04%
Instrs: 430216 -> 429882 (-0.08%); split: -0.14%, +0.06%
Latency: 5881180 -> 5878181 (-0.05%); split: -0.05%, +0.00%
InvThroughput: 731846 -> 729293 (-0.35%)
Copies: 31662 -> 31847 (+0.58%); split: -0.03%, +0.61%
Branches: 8241 -> 8100 (-1.71%)
PreVGPRs: 15788 -> 15786 (-0.01%)

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20843>
2023-02-18 21:16:58 +01:00
Marek Olšák
616d595d18 glthread: don't restore non-VBO vertex arrays after all draws
glthread takes care of all uploads, so it's OK to leave uploaded VBOs
bound. The only thing that will be wrong is the bound vertex buffer
returned by glGet, but the only case when that would be wrong is when
an app that doesn't use VBOs queries the current VBO. That never happens.

However, this adds code to unbind all internal VBOs for the case when
glthread is abruptly disabled (e.g. for GL_DEBUG_OUTPUT_SYNCHRONOUS).

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
201038a80d glthread: don't free glthread for GL_DEBUG_OUTPUT_SYNCHRONOUS, only disable it
and enable it when GL_DEBUG_OUTPUT_SYNCHRONOUS is disabled.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
068670a79a glthread: remove unnecessary debug code
_mesa_glthread_destroy won't be called for GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB,
so the "reason" parameter will be useless.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
cabc08a184 glthread: convert (Multi)DrawIndirect into direct if user buffers are present
so that user buffers are uploaded without syncing.

Now glthread fully handles non-VBO uploads, so that we can disable user
buffer codepaths in st/mesa.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
72b336dbdc glthread: add API to allow passing DrawID from glthread to mesa
This will be needed for lowering DrawIndirect in glthread, which is
needed if non-VBO vertex arrays are present.

This only adds the drawid parameter in glthread's draw_arrays and
draw_elements functions, and implements where needed.

New GL API functions are added because we want to use separate
DISPATCH_CMD_* enums for draws with DrawID, so that we don't increase
the memory footprint of draws in glthread batches if drawid == 0.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
aabca21c7e glthread: handle non-VBO uploads for glMultiModeDraw{Arrays,Elements}IBM
This was unimplemented, and this implementation matches exactly what we do
in main/draw.c.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
8510814528 glthread: don't execute Draw and BufferSubData calls if the context is lost
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
faf476ea4f glthread: inline draw functions that have only one use
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
21ab24acd0 glthread: remove goto statements and add unlikely() into draw functions
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
3b897719e6 glthread: add ctx->GLThread.draw_always_async to simplify draw checking
This just precomputes 3 terms of the condition to draw asynchronously.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
15aaef4d36 glthread: reorder draw code a little
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
50d791ca73 glthread: add a vertex upload path that unrolls indices for glDrawElements
u_vbuf does this too. This is the last big missing piece to stop using
u_vbuf.

If the vertex range to upload is much larger than the draw vertex count and
if all attribs are not in VBOs, convert glDrawElements to glBegin/End.

This is a path that makes the Cogs game go from 1 FPS to ~197 FPS. There is
no change in FPS because u_vbuf does this, but it will be disabled.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
28724de0d7 glthread: track vertex formats for all attributes
We'll need this for a special vertex upload fallback.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
e97d0b318b glthread: don't bind/unbind uploaded indexbuf, pass it to glMultiDraw directly
MultiDrawElementsUserBuf is changed to mean the same thing as
glMultiDrawElementsBaseVertex, but "gl_buffer_object *index_buffer" is
passed via a parameter instead of using the bound GL_ELEMENT_ARRAY_BUFFER.

This skips binding and unbinding the index buffer around every draw
where glthread uploads indices.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
a078374b10 glthread: don't bind/unbind uploaded indexbuf, pass it to glDraw directly
DrawElementsUserBuf is changed to mean the same thing as
glDrawElementsInstancedBaseVertexBaseInstance, but "gl_buffer_object *
index_buffer" is passed via a parameter instead of using the bound
GL_ELEMENT_ARRAY_BUFFER.

This skips binding and unbinding the index buffer around every draw
where glthread uploads indices.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
5c0c0dc5cd glthread: move some draw call parameters closer to their use
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
c2806a836b glthread: don't pass index bounds to the driver for async calls
They are never used with vertex uploads in glthread.
For example, glDrawRangeElements is converted to glDrawElements.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
38efb766d3 glthread: don't execute glDraw code if we're inside glBegin/End
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
07ef2652fe glthread: change glMultiDrawElements to execute draw_count < 0 asynchronously
also clean up the conditions.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
7aff69bcdd glthread: rewrite glMultiDrawArrays to never fail to upload vertices
The main goal is to never fail to upload non-VBO vertex arrays.
When glthread synchronized, it didn't upload vertices, expecting st/mesa
to do that. This keeps the required sync, and then upload vertices
in glthread.

Also, reorder the code and remove goto statements. This is pretty much
a rewrite.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
e6231a1320 Revert "ci/zink: Disable Amnesia trace until the linked issue gets fixed."
This reverts commit 2e807a028a.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21039>
2023-02-18 13:40:56 +00:00
Marek Olšák
efb531fcb5 glthread: ignore non-VBO vertex arrays with NULL data pointers
This can happen when an attrib is enabled, but the shader doesn't use it,
so it's ignored by mesa/state_tracker, and should be ignored here as well.

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

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21039>
2023-02-18 13:40:56 +00:00
Marek Olšák
3ed141e9d8 glthread: add a heuristic to stop locking global mutexes with multiple contexts
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4516
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8035

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21039>
2023-02-18 13:40:56 +00:00
Marek Olšák
78c61140f1 glthread: upload non-BO indices in the core profile to fix GStreamer
Only apply the core profile checking to non-VBO vertices.

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

Tested-by: Michel Dänzer <mdaenzer@redhat.com>
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21039>
2023-02-18 13:40:56 +00:00
Marek Olšák
2e0cb30bd5 glthread: initialize indices[i] for no-op MultiDrawElements
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21039>
2023-02-18 13:40:56 +00:00
Marek Olšák
e2ad086f48 mesa: ignore indices[i] if count[i] == 0 for MultiDrawElements
Cc: mesa-stable

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21039>
2023-02-18 13:40:56 +00:00
Marek Olšák
55682e958b glthread: track the current element array buffer in the Core profile too
This is a prerequisite for:
    "glthread: upload non-BO indices in the core profile to fix GStreamer"

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21039>
2023-02-18 13:40:56 +00:00
Emma Anholt
37b544e410 hasvk: Fix gfx8/9 VB range > 32bits workaround detection.
Since the dirty range started out as 0..0, you would have 0..VBend as the
new dirty range on the first draw, and if your VB was >32b then you'd
flush every time you used it.  Instead, if there's no existing dirty range
then just set it to our new VB's range.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21370>
2023-02-18 07:25:47 +00:00
Emma Anholt
4cd7976208 anv: Fix gfx8/9 VB range > 32bits workaround detection.
Since the dirty range started out as 0..0, you would have 0..VBend as the
new dirty range on the first draw, and if your VB was >32b then you'd
flush every time you used it.  Instead, if there's no existing dirty range
then just set it to our new VB's range.

Perf results with zink+anv on my CFL:

sauerbraten:       +24.8182% +/- 0.602077% (n=5)
portal-2-v2.trace: +4.64289% +/- 0.285285% (n=5)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21370>
2023-02-18 07:25:47 +00:00
Mike Blumenkrantz
4b5b5bb73c zink: enable renderpass optimizing on lavapipe
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21340>
2023-02-18 03:05:17 +00:00
Brian Paul
5f3f415770 llvmpipe: do additional checks in lp_state_fs_analysis.c for linear shaders
Check if the FS output color comes from an FS input.  If so, don't tag
the shader as linear.  See code comments for more details.

During testing I added extra counters to check the number of times
linear shaders were used to be sure we're not accidentally disallowing
too many shaders.  Things looked good with our in-house mksReplay test
suite.

This fixes some OpenGL CTS test failures with llvmpipe.

Signed-off-by: Brian Paul <brianp@vmware.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7489
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21340>
2023-02-18 03:05:17 +00:00
Eric Engestrom
3b853964c6 broadcom/ci: use deqp-runner to run piglit tests
This is what other jobs are standardizing to.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21297>
2023-02-18 02:33:59 +00:00
Eric Engestrom
9b58bb9d22 broadcom/ci: fold .vc4-rpi3-piglit:armhf into its only user
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21297>
2023-02-18 02:33:59 +00:00
Eric Engestrom
2eb8716be8 broadcom/ci: refactor a bit
Just moving things around, no functional change.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21297>
2023-02-18 02:33:59 +00:00
Eric Engestrom
84e5d50b89 meson: improve formatting of options file
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21321>
2023-02-18 01:48:16 +00:00
Eric Engestrom
1851c0e868 ci: stop watching for changes in removed script
Removed in a79e6457d8 ("meson: use builtin support for reading
version from a file").

Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21321>
2023-02-18 01:48:16 +00:00
X512
e60f379545 EGL: implement Haiku driver over Gallium
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21079>
2023-02-18 00:44:43 +00:00
X512
d55f66b483 haiku: fix build
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21079>
2023-02-18 00:44:43 +00:00
X512
da73bcac37 hgl: remove
Use EGL and glvnd instead on Haiku platform.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21079>
2023-02-18 00:44:43 +00:00
Eric Engestrom
adbe8b6c17 mesa: optimize out _mesa_is_desktop_gl*() and _mesa_is_gles*() calls when not built
This will in turn optimize out anything that's gated on those.

Suggested-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>
2023-02-17 23:53:30 +00:00
Eric Engestrom
b20a614e82 mesa: make more use of the new _mesa_is_gles2() helper
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>
2023-02-17 23:53:30 +00:00
Eric Engestrom
7a7c1e6519 mesa: make more use of the new _mesa_is_gles1() helper
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>
2023-02-17 23:53:30 +00:00
Eric Engestrom
6651f9808c mesa: add & use new _mesa_is_gles1() & _mesa_is_gles2() helpers
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>
2023-02-17 23:53:30 +00:00
Eric Engestrom
be391402ec mesa: make more use of the existing _mesa_is_gles* helpers
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>
2023-02-17 23:53:30 +00:00
Eric Engestrom
a5fa548a34 mesa: make use of the new _mesa_is_desktop_gl_core() helper
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>
2023-02-17 23:53:30 +00:00
Eric Engestrom
ae66411f26 mesa: make use of the new _mesa_is_desktop_gl_compat() helper
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>
2023-02-17 23:53:30 +00:00
Eric Engestrom
e8e17641c1 mesa: add _mesa_is_desktop_gl_compat() and _mesa_is_desktop_gl_core() helpers
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>
2023-02-17 23:53:30 +00:00
Eric Engestrom
8a4c18afff meson: allow building GLES without GL
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>
2023-02-17 23:53:30 +00:00
Eric Engestrom
da25d0b8e4 meson/windows: only build libgl-gdi for desktop gl
Suggested-by: Jesse Natalie <jenatali@microsoft.com>
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>
2023-02-17 23:53:30 +00:00
Eric Engestrom
8955340839 meson: make GLX require OpenGL
This isn't strictly true, but making that work isn't worth the effort;
see https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343#note_1774683

Suggested-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>
2023-02-17 23:53:30 +00:00
Alyssa Rosenzweig
50b82ca818 nir/lower_blend,agx,panfrost: Use lowered I/O
This is one step towards lowering I/O during shader preprocess rather than at
variant create time, which helps mitigate shader variant jank. It's also a lot
simpler.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> [v1]
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20836>
2023-02-17 23:09:19 +00:00
Alyssa Rosenzweig
acfda67b4f nir/lower_blend: Don't handle gl_FragColor
In OpenGL, FRAG_RESULT_COLOR implicitly broadcasts to every render target. Our
existing lower_blend code (somewhat arbitrarily) aliases to the the first render
target's format and blend settings. That said, I don't think that works if
different render targets have different settings -- or blend with their
different destinations -- though I don't have relevant spec text right now.

The actual reason this works is that all users of this pass either call
nir_lower_fragcolor first (panfrost, asahi) or don't have FRAG_RESULT_COLOR as
part of their API (panvk, soon agxv). Unless/until we actually have a use case
for nir_lower_blend with gl_FragColor, assert that gl_FragColor is lowered first
so we don't need to worry about this imaginary case.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20836>
2023-02-17 23:09:19 +00:00
Alyssa Rosenzweig
b3f229c510 nir/lower_blend: Don't touch store->dest
Stores don't have destinations, and if they did, it would be invalid to change
their ssa_def's num_components without also changing the SSA def. Remove the
nonsensical (but harmless) assignment.

This fixes 25249e8be2 ("nir/lower_blend: Expand or shrink output variables as
needed"), but as the bug is harmless in practice, it does not need to be
backported.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Suggested-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20836>
2023-02-17 23:09:19 +00:00
Alyssa Rosenzweig
63f30802eb pan/lower_framebuffer: Operate on lowered I/O
This turns the early pass into a late pass, which is important because it
depends on the shader key and therefore should be called by the driver instead
of the compiler preprocessing. It's also simpler this way.

The shader key work is waiting for review in another merge request. In the mean
time, this patch will let us run blend lowering early for blend shaders on
Midgard.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20836>
2023-02-17 23:09:19 +00:00
Alyssa Rosenzweig
1b6607fa13 nir: Augment raw_output_pan with IO_SEMANTICS+BASE
This is a form of lowered I/O, it needs I/O semantics so we can know the
location to store to instead of passing via a sideband.

Over in !20906, we will use the BASE to lower blend shader with multisampling in
NIR instead of passing the number of samples and framebuffer format along a
sideband to the Midgard compiler. That's not needed for this series (this patch
was cherry-picked to avoid regressions in the lower_blend changes) but it's good
to model the full form of the I/O lowered intrinsic here.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20836>
2023-02-17 23:09:19 +00:00
Ian Romanick
862b5b7d01 nir/loop_analyze: Simplify some logic in compute_induction_information
This part now looks more like it did before 0b9639c35d.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>
2023-02-17 22:12:05 +00:00
Ian Romanick
9461cc4424 nir/loop_analyze: Track induction variables with uniform initializer
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>
2023-02-17 22:12:05 +00:00
Ian Romanick
4edf1cdd3d nir/loop_analyze: Eliminate nir_basic_induction_var
No longer used. All of the information that was previously track here is
tracked directly in nir_loop_variable... and, technically speaking, has
been tracked there ever since 0b9639c35d.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>
2023-02-17 22:12:05 +00:00
Ian Romanick
e444ed9210 nir/loop_analyze: Use nir_loop_variable::init_src instead of nir_basic_induction_var::def_outside_loop
These track the same information in a slightly different way. Since
nir_loop_variable::init_src is visible outside this module, it cannot
be eliminated.

As an intentional side effect, induction variables with constant
initializers will now have their nir_loop_induction_variable::init_src
field point to the load_const source. Previously this pointer would be
NULL.

v2: Update unit tests and commit message. Remove the now unused ind_var
variable in find_trip_count.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>
2023-02-17 22:12:05 +00:00
Ian Romanick
72e763650c nir/loop_analyze: Use nir_loop_variable::update_src instead of nir_basic_induction_var::alu
These track the same information in a slightly different way. Since
nir_loop_variable::update_src is visible outside this module, it cannot
be eliminated.

This leads to some nice simplification in find_trip_count. Previously
this code only had access to the ALU instruction that performs the
increment. It had to "search" the parameters to determine which (if any)
was the constant. With this change, this code has access to the
nir_alu_src of the ALU instruction that performs the increment. It no
longer needs to search the parameters for the constant. It's either the
supplied nir_alu_src or nothing.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>
2023-02-17 22:12:05 +00:00
Ian Romanick
1bc43c0778 nir/loop_analyze: Track induction variables with uniform increments
As an intentional side effect, induction variables with constant
increments will now have their nir_loop_induction_variable::update_src
field point to the load_const source. Previously this pointer would be
NULL.

v2: Update unit tests and commit message.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>
2023-02-17 22:12:05 +00:00
Ian Romanick
c26d356dd5 nir/tests: Add tests for nir_loop_info::induction_vars tracking
Later commits in this MR will change the way some data is track, and
these tests will verify this behavior change.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>
2023-02-17 22:12:05 +00:00
Ian Romanick
168e54f7e3 nir/tests: Add tests for "inverted" loops
A couple basic tests for loops with the exit condition after the
increment. In compiler literature, the optimization that moves the exit
condition from the top to the bottom is called "loop inversion."

v2: Pass parameters to loop_builder_invert using a struct. Add a comment
describing the loop being constructed to loop_builder_invert. Both
suggested by Caio.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>
2023-02-17 22:12:05 +00:00
Ian Romanick
ffe0db099c nir/tests: Refactor creation of loops for loop_analyze test cases
Inspired heavily by the work by Yevhenii Kolesnikov in the original
versions of !3445.

v2: Pass parameters to loop_builder using a struct. Add a comment
describing the loop being constructed to loop_builder. Both suggested by
Caio.

v3: mscv C++ designated initializer lolz.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>
2023-02-17 22:12:05 +00:00
Ian Romanick
7384ea7978 nir/tests: Don't unconditionally log shaders from this one CF test
All of the other tests only log the shader when validation fails, so
having that shader scroll by in the output is very distracting.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>
2023-02-17 22:12:05 +00:00
Eric Engestrom
11a4791894 docs: add 23.1 branchpoint & rc dates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21322>
2023-02-17 22:06:13 +00:00
Lionel Landwerlin
3b037ac073 anv: fix vma heap memory leak
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: a5f9e59ce3 ("anv: Use vma_heap for descriptor pool host allocation")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21385>
2023-02-17 21:37:34 +00:00
Eric Engestrom
b772de9c78 ci: bump tags of deqp images
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21392>
2023-02-17 20:17:08 +00:00
Eric Engestrom
61c2ae3d09 ci: fix grouping of image tags
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21392>
2023-02-17 20:17:08 +00:00
Eric Engestrom
560ccdf05a ci: remove no-op sed
This is a duplicate from the first patch applied above.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21392>
2023-02-17 20:17:08 +00:00
Eric Engestrom
37a7f03ad8 ci: simplify adding & removing deqp patches
Instead of everyone having to copy the curl command from somewhere else
when a new deqp version needs new patches; now all they need to do is
paste the commit hash in the array.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21392>
2023-02-17 20:17:08 +00:00
Ryan Neph
525b8c582f venus: temporarily redirect VkDrmFormatModifierPropertiesListEXT to "2" variant
Temporarily remove driver-side uses of
VkDrmFormatModifierPropertiesListEXT so the encode/decode procedures can
be fixed asynchronously in a follow-up.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21367>
2023-02-17 19:55:15 +00:00
Alyssa Rosenzweig
e9bcfcf19c panfrost: Fix prim restart XML on Valhall
Harmless in practice (so no need to backport) but still very wrong. Noticed
looking at traces of Dolphin trying to debug acute misrendering.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20780>
2023-02-17 19:13:33 +00:00
Chia-I Wu
4459668b6e radv: add a size check in radv_create_buffer for Android
This is to make dEQP-VK.api.buffer.basic.size_max_uint64 pass on
android.

The test creates a buffer of size UINT64_MAX and makes sure the memory
requirement for the buffer is sane.  It fails because our memory
requirement is "align64(UINT64_MAX, 16)" which is 0 after overflow.

The test checks maintenance4's maxBufferSize and is skipped normally.
But the extension can be disabled on an android build.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21346>
2023-02-17 18:14:34 +00:00
Timur Kristóf
e13074d763 radv: Call nir_lower_array_deref_of_vec in radv_lower_io_to_scalar_early.
This fixes an issue when a vector component of an arrayed output has a deref.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8197
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21028>
2023-02-17 17:47:47 +00:00
Konstantin Seurer
c76060c253 radv: Advertise ray query support with LLVM
What could go wrong?

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21268>
2023-02-17 17:04:47 +00:00
Konstantin Seurer
3966fbdc51 radv: Pre-compile BVH build shaders if there is a cache
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21268>
2023-02-17 17:04:47 +00:00
Konstantin Seurer
40f246e3e9 radv: Force ACO for BVH build shaders
They hang with LLVM.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21268>
2023-02-17 17:04:47 +00:00
Konstantin Seurer
2ef5acedc2 radv: Make accel struct meta state initialization thread safe
Fixes: 0d5570b ("radv: Always compile accel structure shaders on demand.")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21268>
2023-02-17 17:04:47 +00:00
Konstantin Seurer
0f709510f4 ac/llvm: Implement bvh64_intersect_ray_amd
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21268>
2023-02-17 17:04:47 +00:00
Mike Blumenkrantz
a6d3d65c3c zink: handle semi-matching i/o for separate shaders
while separate shaders requires i/o blocks to match between stages,
there are two tricky cases:
* sparse location specification
* variables are required to match in type by location

the first item means user locations must increment if a slot is not used

the second item means that e.g., a mat3x2 can match three vec2 variables
in matching slots

fix both of these cases now

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21383>
2023-02-17 16:02:46 +00:00
Alyssa Rosenzweig
fc30fe5bc5 panfrost: Disable CRC by default
Known unsound code.

So far I'm not convinced transaction elimination is doing us much good. Even in
synthetic glmark style benchmarks this seems to be a few % hit at most. Given
that transaction elimination is unsound by design, and that panfrost's
implementation is buggy in several places and getting it right (up to the
unsoundness of the hardware feature itself) would take actual engineering
effort, and the priority is making glamor work... disabling is the obvious
choice here.

For now, we leave the code but gate it behind a env var
flag (PAN_MESA_DEBUG=crc) rather than defaulting to enabled unless
PAN_MESA_DEBUG=nocrc is set. This way, we can still experiment with it if we
need that data ("what performance could we gain if we had this feature,
unsoundness be damned?"). That said, I'm not really ok with having unsoundness
on my devices, y'know? Back of the napkin math suggests that it's not unlikely
that somebody has hit a transaction elimination collision in the wild with the
DDK.

Boils down to values.

Closes: #8113
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21258>
2023-02-17 14:36:01 +00:00
Lionel Landwerlin
18bf85468c anv: track vram only BOs to print things out on ENOMEM execbuf
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21380>
2023-02-17 13:45:00 +00:00
Lionel Landwerlin
0aa44b107a anv: move debug submit to helper and call it on execbuf failure
Helps telling when you've run out of local memory.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21380>
2023-02-17 13:45:00 +00:00
Samuel Pitoiset
c8495dbee3 radv: stop using a PS epilog when the FS doesn't write any color outputs
This is a small optimization for fragment shaders that only write
depth/stencil/sample mask without any color outputs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21341>
2023-02-17 13:19:54 +00:00
Samuel Pitoiset
78c0fae08c radv: only skip emitting the pipeline blend state if the FS uses an epilog
The blend state is emitted from the command buffer when the FS uses
an epilog (either compiled from a lib with GPL or compiled on-demand).

This shouldn't change anything but it will allow to disable using a
PS epilog when the fragment shader doesn't write any color outputs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21341>
2023-02-17 13:19:54 +00:00
Karmjit Mahil
5a5a131127 pvr: Handle VK_QUERY_RESULT_WAIT_BIT.
Not handling device loss currently. That needs to be done
throughout the code base so out of scope for this.

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/20091>
2023-02-17 13:06:51 +00:00
Tapani Pälli
d53613dbd7 anv: Wa_14016407139, add required pc when SBA programmed
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/21374>
2023-02-17 12:44:00 +00:00
Lionel Landwerlin
14266d3c2d intel/perf: also add the oa timestamp shift on MTL
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 90c86fe63e ("intel: add MTL performance metrics")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21378>
2023-02-17 12:10:05 +00:00
Samuel Pitoiset
6d73841d34 radv/amdgpu: only set a new pstate if the current one is different
AMDGPU pstate is per context but if there is multiple AMDGPU contexts
in flight, the kernel can return -EBUSY.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21222>
2023-02-17 11:36:06 +00:00
Samuel Pitoiset
663877e894 Revert "radv: acquire pstate on-demand when capturing with RGP"
This change is wrong for two reasons:
- it hangs most of the time maybe, because changing PSTATE when the
  application is running is broken somehow
- it increases the time between triggering and generating the capture
  considerably, because there is a delay for changing PSTATE

This restores previous logic where PSTATE is set to profile_peak at
logical device creation. Though, it also re-introduces an issue with
multiple logical devices (kernel returns -EBUSY) but this will be
fixed in the next commit.

This fixes GPU hangs when trying to record RGP captures on my NAVI21.
Note that profile_peak is only required for some RDNA2 chips (including
VanGogh).

Cc: mesa-stable
This reverts commit 923a864d94.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21222>
2023-02-17 11:36:06 +00:00
Erico Nunes
c426e5677f lima: don't use resource_from_handle while creating scanout
resource_from_handle implementations create an additional reference to
the scanout resource, which caused lima to leak those resources after
commit ad4d7ca833.

Do as the other drivers do and import the bo directly while creating
the scanount resource.

Cc: 22.3 mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8198
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/21330>
2023-02-17 10:36:46 +00:00
Karmjit Mahil
5277e45849 pvr: Add support to copy descriptors on vkUpdateDescriptorSets()
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/21332>
2023-02-17 10:10:11 +00:00
Karmjit Mahil
30b7263419 pvr: Move descriptor write into pvr_write_descriptor_set()
Moving descriptor write functionality from
pvr_UpdateDescriptorSets() into pvr_write_descriptor_set().

This is in preparation for adding descriptor copy support.

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/21332>
2023-02-17 10:10:11 +00:00
Boyuan Zhang
c660cef599 virgl: add more formats to conv table
Adding UYVY, YUYV, P010 to formats_conv_table.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21250>
2023-02-17 09:23:27 +00:00
Gert Wollny
20584e04e3 r600/sfn: Fix Cayman trans from string and add test for copy prop
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Gert Wollny
4152e38924 r600/sfn: Fix alu trans op flag setup
Fixes: commit 2df023a1f1
   r600/sfn: pre-evaluate allowed dest mask in Alu instructions

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Gert Wollny
f07a2715c6 r600/sfn: Fix handling of fetch through texture clause
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Gert Wollny
a99c08e181 r600: Don't start new CF for every fetch through tex clause
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Gert Wollny
c44a9c8765 r600/sfn: Forward setting the block ID and index
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Gert Wollny
08ed216a11 r600/sfn: address use in group only if instr can be added
Otherwise the group will signal an address use that may not
be relevant.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Gert Wollny
560731279f r600/sfn: rename texture coordinate offset for clarity
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Gert Wollny
869e4de6af r600/sfn: Stop try scheduling in t-slot with empty related v-slot
This requires adding a nop in the relates v-slot, and the readport
valiation seems to be broken for this case, so drop this for now.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Gert Wollny
b406cfd922 r600/sfn: Don't copy propagate indirect loads to more than one dest
Propagating the indirect load to more instructions would result
in more address load instructions. This would (a) remove the advantage
of eliminating one move, and (b) introduce more latency, because between
address load and use two cycles must pass.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Gert Wollny
d1f419b365 r600/sfn: Silence warnings about unused parameters
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Gert Wollny
c527293924 r600/sfn: Fix a typo
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Gert Wollny
b1df8b0393 r600/sfn: drop useless instr use count
This is handled with the dest registers

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Gert Wollny
ac6b95d40b r600/sfn: Work around dependency issue when splitting op to group
The instruction that is split may still be referenced as extra
dependency in other instructions, so add a handle to the instruction
that it can be set to be scheduled.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Gert Wollny
8b5d41cacb r600/sfn: Use range_base for atomics and images
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Tapani Pälli
ee7953ab97 mesa/st: support compute shader decoding of ASTC
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/19886>
2023-02-17 07:57:12 +00:00
Tapani Pälli
977bc760fa mesa: add astc decoder shader template (glsl es version)
This shader originates from Granite 3D engine and has been adapted
to be used with Open GL and some GLSL ES specifics.

GLSL ES adaptation:

- remove Vulkan specifics: EXT_samplerless_texture_functions usage,
  specialization constants, push constant usage
- inline bitextract.h
- always DECODE_8BIT and hardcode error color (for now)
- port to GLSL ES, required some type changes, explicit type
  conversions and setting up precisions for types

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/19886>
2023-02-17 07:57:12 +00:00
Tapani Pälli
179adf9d59 mesa/st: initialize resources for ASTC decoding
Generates required resources for ASTC texture decoding pass.

Partition table resources will be cached in to hash during runtime
as one is required for each block size.

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/19886>
2023-02-17 07:57:12 +00:00
Tapani Pälli
ad51f5bd13 mesa/st: add astc decoder lookup tables
Commit introduces ASTC decoding lookup tables from Granite 3D engine.

These lookup tables will be used during transcoding by a compute
shader in later commits when decoding ASTC textures.

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/19886>
2023-02-17 07:57:12 +00:00
Samuel Pitoiset
685f08f91d radv: add support for rectangularLines
dEQP-VK.*rectangular_line* pass on NAVI21.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21287>
2023-02-17 07:38:10 +00:00
Samuel Pitoiset
3368c0e6f2 radv: reduce maximum line width to 8.0
Using 8191.875 seems to big for the hardware to correctly render wide
rectangular lines. This can also be reproduced with AMDVLK by forcing
rectangularLines = True, and fixed by reducing the maximum size as well.

Other drivers seem to expose that value.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21287>
2023-02-17 07:38:10 +00:00
Mike Blumenkrantz
65469eeca5 zink: more accurately handle i/o for separate shaders
this can be simplified since i/o is required to match exactly between
stages, meaning that assigning in increasing order should always be correct

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21336>
2023-02-17 04:30:04 +00:00
Mike Blumenkrantz
e8d7f6a32c zink: delete some now-broken ntv dref sampling code
depth splatting should be handled now by the match_tex_dests() pass

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21336>
2023-02-17 04:30:04 +00:00
Faith Ekstrand
d87ab12893 vulkan: Update the XML and headers to 1.3.241
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:35 +00:00
Faith Ekstrand
8297d18952 vulkan/device-select-layer: Include vulkan.h
In the upcoming header update, vk_layer.h starts including vulkan_core.h
instead of vulkan.h.  This will break this layer as it needs a couple of
window-system extension #defines.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Faith Ekstrand
d6248b8133 vulkan/layers: Use PUBLIC instead of VK_LAYER_EXPORT
VK_LAYER_EXPORT is going away in the next Vulkan header update.  We
already have a PUBLIC macro in util/macros.h which does the same thing.
Unlike VK_LAYER_EXPORT, it should work in Windows too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Faith Ekstrand
f24f753c8a vulkan: Properly filter structs in vk_physical_device_features
This uses get_all_required to filter structs and also filters struct
members based on API.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Faith Ekstrand
5021344fa6 vulkan: Move the features generator to vulkan/util
This makes it easier to start depending on vk_extensions.py

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Faith Ekstrand
68cb42e52b vulkan: Filter out provisional extensions
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Faith Ekstrand
ef3e75d7f3 Vulkan: Properly filter structs in vk_cmd_queue_gen
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Faith Ekstrand
a9c4423ed3 vulkan: Properly filter by api in enum_to_str
This switches us to using get_all_required() for figuring out which
enum types we care about and then carefully filtering every value as
needed.  We also add a number field to Extension so we keep all the
extension XML parsing in one place.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Faith Ekstrand
4059c78633 vulkan: Properly filter entrypoints
We now use get_all_required() to get all required commands and use that
to filter instead of doing it manually.  Also, we can pull entrypoint
extension etc. information from the requirements struct.  Finally, we
also have to filter the actual commands themselves as well as arguments
per-API because there may be multiple versions or variants depending on
the API being used.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Faith Ekstrand
6910d1337a vulkan: Add a get_all_required() helper
This searches for the names of everything of a particular type: command,
enum, etc. and returns a Requirements struct with any core version and
extensions that require it.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Faith Ekstrand
edfef5d915 vulkan: Parse the platform in Extensions.from_xml()
This makes handling guards on entrypoints a bit easier.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Faith Ekstrand
ab5ab6ef9e vulkan: Improve extension parsing
This adds an Extension.from_xml() helper for doing the parsing so we can
re-use it in other code.  We also improve filtering of extensions.  The
Vulkan XML schema is changing to make the supported attribute a comma-
separated list.  This is to allow for vulkansc to also exist in the XML
schema.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Faith Ekstrand
3b686f3a2f vulkan: Remove unused fields from Extension and ApiVersion
These are a left-over from when these classes were used by ANV to define
extension enables in python.  They haven't been used since we added
extension table structs and move extension enables to C.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Faith Ekstrand
a47c903e51 Revert "vk/util: keep track of extension requirements"
This reverts commit ca98e4446b.  The way
extension requirements are specified is about to change significantly.
Since this is so new, it's easier to just revert for now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Faith Ekstrand
15e332073c Revert "vk/runtime: turn vk.xml extension requirements into asserts"
This reverts commit 6ac830ccb1.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Timothy Arceri
aa4b1d314e glsl: copy prop vars before scalarizing alus
This generally gives us better results and doing it here in nir will
also allow us to remove more glsl optimisation calls that do a similiar
thing for us.

(Updated shader-db results by idr.)

Tiger Lake, Ice Lake, and Skylake had similar results. (Ice Lake shown)
total instructions in shared programs: 20246333 -> 20240715 (-0.03%)
instructions in affected programs: 235253 -> 229635 (-2.39%)
helped: 425 / HURT: 114

total cycles in shared programs: 891730115 -> 891631113 (-0.01%)
cycles in affected programs: 37347925 -> 37248923 (-0.27%)
helped: 952 / HURT: 692

total spills in shared programs: 7072 -> 6716 (-5.03%)
spills in affected programs: 505 -> 149 (-70.50%)
helped: 7 / HURT: 0

total fills in shared programs: 9897 -> 8511 (-14.00%)
fills in affected programs: 1674 -> 288 (-82.80%)
helped: 7 / HURT: 0

total sends in shared programs: 1053685 -> 1053411 (-0.03%)
sends in affected programs: 2821 -> 2547 (-9.71%)
helped: 30
HURT: 2

LOST:   13
GAINED: 13

Broadwell and Haswell had similar results. (Broadwell shown)
total instructions in shared programs: 18149157 -> 18147271 (-0.01%)
instructions in affected programs: 204630 -> 202744 (-0.92%)
helped: 294 / HURT: 121

total cycles in shared programs: 939488196 -> 939508444 (<.01%)
cycles in affected programs: 36394777 -> 36415025 (0.06%)
helped: 718 / HURT: 620

total sends in shared programs: 1005426 -> 1005152 (-0.03%)
sends in affected programs: 2821 -> 2547 (-9.71%)
helped: 30 / HURT: 2

LOST:   2
GAINED: 2

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19715>
2023-02-17 03:16:31 +00:00
Italo Nicola
e787ddf298 panfrost: fix tiny sample_positions BO memory leak
Fixes a 4KB memory leak that happens once per-device creation.

Cc: mesa-stable
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Chris Healy healych@amazon.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21372>
2023-02-17 01:45:53 +00:00
Faith Ekstrand
f8aa83f0c8 intel/nir: Use nir_lower_mem_access_bit_sizes()
This drops the Intel-specific pass in favor of the new generic one.

No shader-db changes on Skylake or DG2.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21232>
2023-02-17 00:55:54 +00:00
Faith Ekstrand
2e2d7803c7 nir: Add a load/store bit size lowering pass
This is based on brw_nir_lower_mem_access_bit_sizes() but ended up being
substantially different.  While the core concepts are all the same, the
brw_* version made a lot of Intel-specific assumptions.  The new version
takes a callback which takes a number of bytes of data and an alignment
pair and returns a bit size and number of components to load/store.

Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21232>
2023-02-17 00:55:54 +00:00
Timothy Arceri
34e11963fa ci: enable dEQP-VK.ubo.random.all_shared_buffer.48
The previous commits fix the slow compile time, allowing us to
enable this test.

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

Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20381>
2023-02-16 23:31:59 +00:00
Timothy Arceri
cb58d75224 nir/nir_opt_copy_prop_vars: don't call memset when cloning
This makes the pass significantly faster cutting execution time
by around 30% in the cts test
dEQP-GLES31.functional.ubo.random.all_per_block_buffers.20

This 30% improvement is in addition to all the improvements from
the proceeding patches.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20381>
2023-02-16 23:31:59 +00:00
Timothy Arceri
d1a41d9c64 nir/nir_opt_copy_prop_vars: reorder clone calls
This helps with the reuse of dynamic arrays.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20381>
2023-02-16 23:31:59 +00:00
Timothy Arceri
2a2d85e254 nir/nir_opt_copy_prop_vars: reuse dynamic arrays
As per the previous commit if we don't reuse these dynamic arrays
we end up needlessly thrashing the memory handling functions.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20381>
2023-02-16 23:31:59 +00:00
Timothy Arceri
ffe0f3fda1 nir/nir_opt_copy_prop_vars: reuse hash tables
Due to how this pass works we can end up thrashing memory if we
do not reuse these hash tables rather than reusing them.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20381>
2023-02-16 23:31:59 +00:00
Timothy Arceri
731e9fd535 nir/nir_opt_copy_prop_vars: avoid comparison explosion
Previously the pass was comparing every deref to every load/store
causing the pass to slow down more the larger the shader is.

Here we use a hash table so we can simple store everything needed
for comparision of a var separately.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20381>
2023-02-16 23:31:59 +00:00
Timothy Arceri
8f6f5730f6 nir/nir_opt_copy_prop_vars: remove extra loop
The fix in 947f7b452a introduced an extra loop over the copies
array to find the correct entry in the case it had been moved.

The problem is these loops can be iterated over millions of times
so lets simply update the entry pointer in the case we change its
location in the array.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20381>
2023-02-16 23:31:59 +00:00
Faith Ekstrand
4e09d37f3b nir/from_ssa: Move the loop bounds check in resolve_parallel_copy
We loop, effectively, over two stacks: ready and to_do and finish only
when both are empty.  In the case where ready is empty, we pull one off
of to_do, add a copy to a temporary, and push it onto the ready stack.
Previously, we assumed that we would never get to the temporary copy
case if to_do has exactly one entry because that would imply that there
was only one copy left which means there can't possibly be a cycle to
break.  This was true until c7fc44f9eb ("nir/from_ssa: Respect and
populate divergence information") which changed things such that
temporary copies sometimes get added in the case where a convergent
value is copied both to convergent and divergent destinations.

This patch adjusts our loop iteration to always attempt to clear the
ready stack before checking if there's anything left on the to_do stack.
I also added an assert to make the exit condition more clear.

Fixes: c7fc44f9eb ("nir/from_ssa: Respect and populate divergence information")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8037
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21315>
2023-02-16 20:23:42 +00:00
Faith Ekstrand
5afba073c6 nir/from_ssa: Only re-locate values that are destinations
There is an optimization in the parallel copy algorithm where, after a
copy has been performed, we can treat the destination as the new source
for future copies of the same source.  In particular, consider the
following parallel copy: A -> B, C -> A, A -> C.  In this case, after we
have done the A -> B copy, we can make note that the value in A is now
in B and emit the sequence: A -> B, C -> A, B -> C.  This allows us to
resolve the swap cycle between A anc C without allocating a temporary
register because we know B is also a copy of A.

When one of the registers involved is convergent and the other is
divergent, this optimization is problematic because, while convergent to
divergent copies are fine, we can't re-use the divergent copy in later
copies if any of those copies are to a convergent variable.  We could,
but it would require a read_first_invocation which would get messy.  In
In c7fc44f9eb ("nir/from_ssa: Respect and populate divergence
information"), we attempted to deal with this by limiting the rename
optimization to the case where the divergence matched.

The problem is that we did the re-name part whenever the divergence
matched but only marked it as ready if the thing being copied was a
destination.  (We actually left two instances of loc[a] = b, one which
always happened and one which only happened if we also wanted to flag
the source as being ready to use as a destination.)  While this
technically doesn't cause any problems, it may result in more inter-mov
dependencies which hurts instruction scheduling.  For example, if we had
the parallel copy A -> B, A -> C, A -> D, we now end up emitting the
sequence A -> B, B -> C, C -> D which has many more data hazards between
instructions caused by the constant shuffling.

This commit restores the original logic in which we only perform the
rename optimization if the rename would free up a register we will later
use as a destination.  This isn't entirely optimal as it still doesn't
prove that there is a cycle involved first, but it should lead to a
reduction in unnecessary dependencies.

No shader-db changes on SKL or DG2

Fixes: c7fc44f9eb ("nir/from_ssa: Respect and populate divergence information")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21315>
2023-02-16 20:23:42 +00:00
Rob Clark
9673502b3b freedreno/drm: Optimize stateobj re-emit
For long-lived stateobjs, it is common to re-emit to the same submit
multiple times.  By giving each submit a unique sequence # we can detect
this case and skip the extra append_bo().

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
6747d30155 freedreno: Add seqno helper
It is a pretty common pattern to allocate a non-zero sequence # for
lightweight checking if an object is the same, changed, for use in cache
keys, etc.  (And also pretty common to forget to handle the rollover
zero case.)  Add a helper for this.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
8f2b22ba66 freedreno: Drop batch lock
Now that we are not tracking cross-context batch dependencies, there is
no scenario where one context could trigger flushing another context's
batch.  So we can drop the batch lock intended to protect against this.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
9a6de00e98 freedreno/batch: Stop tracking cross-context deps
The app is expected to provide suitable cross-context synchronization
(fences, etc), so don't try to do it's job for them.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
a4b949fe61 freedreno: Avoid taking screen lock
Avoid taking screen unlock for batch unref.  Instead just split the
destroy fxn into locked and unlocked variants.  That way we only end
up taking the screen lock on final unref but avoid it in the common
case.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
35fc1595b3 freedreno/a6xx: Pre-compute PROG related LRZ state
PROG state mostly just disables various LRZ related flags, which can
be handled as a simple mask.  The exception is ztest mode, which is
either overriden by PROG state, or we use the all 1's value (which
isn't valid from hw standpoint) to signal that it needs to be computed
at draw time, which fortunately fits in with the bitmask approach.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
c938101bb5 freedreno: Move FD_MESA_DEBUG cases out of draw_vbo
If the debug options are enabled, just plug in a debug version of
draw_vbo with the additional checks.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
8942f4b734 freedreno: Move blend out of dirty-rsc tracking
This was not doing any actual resource tracking, just updating
gmem_reason.  And furthermore, a6xx+ doesn't care about the bits
it was setting.  So move this to per-gen backend for the gens that
need it, and avoid setting FD_DIRTY_RESOURCE when FD_DIRTY_BLEND
is set.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
67d4bc7be4 freedreno/a6xx: Remove tex-state refcnting
Now that we use a flag to trigger the tex state invalidation coming from
other contexts, we can drop the refcnt'ing.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
cfd4721ee0 freedreno/drm: Make rb refcnt non-atomic
Now that the one special case where multiple threads could race to
ref/unref, we can go back to using non-atomic refcnts.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
f91bcd2455 freedreno/a6xx: Do tex-state invalidates in same ctx
If a resource invalidate is triggered by a different ctx (potentially on
a different thread) simply flag that the tex state needs invalidation,
but defer handling it to the ctx that owns the tex state.

This will let us remove atomic refcnt'ing on the tex state, and more
importantly atomic refcnt'ing on the fd_ringbuffer (as this was the one
special case where rb's could be accessed from multiple threads).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
e7993d68e2 freedreno/a6xx: Multi-draw support
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
cc31997f1b freedreno/a6xx: Split out flush_streamout() helper
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
911d67bdad freedreno/a6xx: Drop unused return
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
c4e2e821a2 freedreno: Push num_draws down to backend
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
6bfee9e669 freedreno: Account for multi-draw in num_draws
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Daniel Schürmann
f6251b21f9 radv/rt: don't hash maxPipelineRayRecursionDepth
The stack size has no effect on the generated shader anymore.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21159>
2023-02-16 19:37:25 +00:00
Daniel Schürmann
8e718c5b63 radv/rt: use dynamic_callable_stack_base also for static stack_sizes
This patch also removes rt_pipeline->dynamic_stack_size and replaces
it by checking for rt_pipeline->stack_size == -1u.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21159>
2023-02-16 19:37:25 +00:00
Daniel Schürmann
2649a1f272 radv/rt: introduce and set rt_pipeline->stack_size
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21159>
2023-02-16 19:37:25 +00:00
Daniel Schürmann
b338d59047 radv: unconditionally enable scratch for RT shaders
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21159>
2023-02-16 19:37:25 +00:00
Daniel Schürmann
aa362b4b6f radv: rename shader_info->cs.uses_sbt -> shader_info->cs.is_rt_shader
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21159>
2023-02-16 19:37:25 +00:00
Konstantin Seurer
72d9604db0 radv: Clean up dynamic RT stack allocation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21159>
2023-02-16 19:37:25 +00:00
Sidney Just
fc84c63e17 zink: Add missing features to the profile file
Fixes: 2ea481b2f0 ("Zink: add Zink profiles file")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20920>
2023-02-16 19:11:57 +00:00
Sidney Just
60e0322092 zink: add check for samplerMirrorClampToEdge Vulkan 1.2 feature
This adds a check to advertise PIPE_CAP_TEXTURE_MIRROR_CLAMP_TO_EDGE when either the extension is present or the Vulkan 1.2 feature is enabled.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20920>
2023-02-16 19:11:57 +00:00
Emma Anholt
ed62eec58b hasvk: Fix SPIR-V warning about TF unsupported on gen7.
It's supported now.

Fixes: d82826ad44 ("anv: Implement VK_EXT_transform_feedback on Gen7")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21228>
2023-02-16 18:11:44 +00:00
Emma Anholt
98455470ea hasvk: Silence conformance warning in CI.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21228>
2023-02-16 18:11:44 +00:00
Emma Anholt
570acf5655 ci: Add a manual full and 1/10th hasvk CTS runs.
These are manual since they're on a runner in my basement that sometimes
can go down, but it'll be nice to have this for throwing the rare hasvk MR
at.

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21228>
2023-02-16 18:11:44 +00:00
Danylo Piliaiev
be976e0aa6 ci/tu: Add 1/200 pass to test for stale reg usage
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21226>
2023-02-16 17:43:10 +00:00
Danylo Piliaiev
86f82d4224 docs/freedreno: Add info about stale reg stomper dbg option
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21226>
2023-02-16 17:43:10 +00:00
Danylo Piliaiev
a66d9c815d turnip: Add debug option to find usage of stale reg values
MESA_VK_ABORT_ON_DEVICE_LOSS=1 \
TU_DEBUG_STALE_REGS_RANGE=0x00000c00,0x0000be01 \
TU_DEBUG_STALE_REGS_FLAGS=cmdbuf,renderpass \
./app

To pinpoint the reg causing a failure reducing regs range could be
used for bisection. Some failures may be caused by multi-reg combination,
in such case set 'inverse' flag which would change the meaning of reg
range to "do not stomp these regs".

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21226>
2023-02-16 17:43:10 +00:00
Timur Kristóf
084d10a702 aco: Remove MTBUF zero operand.
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/21363>
2023-02-16 17:16:34 +00:00
Timur Kristóf
afdacf4dcc aco: Don't set scalar offset on buffer load instructions when it's zero.
This helps generate slightly more optimal instructions.

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/21363>
2023-02-16 17:16:34 +00:00
José Roberto de Souza
e050a00b9f intel/common: Move i915 files to i915 folder
Following the organization done in intel/dev and intel/vulkan.

Probably due to some rebase issue we had a duplicated copyright header
in intel_gem_i915.h that is being removed in here too.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21256>
2023-02-16 16:24:36 +00:00
Mike Blumenkrantz
41286f100e vl/dri3: avoid deadlocking when polling deleted windows for events
upcoming xserver releases will emit PresentConfigureNotify with this
flag set when a window is destroyed, ensuring drivers
don't poll infinitely and deadlock

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21339>
2023-02-16 15:55:47 +00:00
Mike Blumenkrantz
819cbf329a vulkan/wsi: avoid deadlocking dri3 when polling deleted windows for events
upcoming xserver releases will emit PresentConfigureNotify with this
flag set when a window is destroyed, ensuring drivers
don't poll infinitely and deadlock

fixes #6685

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21339>
2023-02-16 15:55:47 +00:00
Mike Blumenkrantz
91de576a7f dri3: avoid deadlocking when polling deleted windows for events
upcoming xserver releases will emit PresentConfigureNotify with this
flag set when a window is destroyed, ensuring drivers
don't poll infinitely and deadlock

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

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21339>
2023-02-16 15:55:47 +00:00
Timur Kristóf
4621ffdec1 aco: Get rid of redundant load_vmem_mubuf function.
Call emit_load directly from visit_load_buffer instead.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21358>
2023-02-16 15:29:37 +00:00
Timur Kristóf
74f1b77046 radv: Move VS input lowering to new file: radv_nir_lower_vs_inputs.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21358>
2023-02-16 15:29:37 +00:00
Timur Kristóf
450e173de0 ac/llvm: Change ac_build_tbuffer_load to take format and channel type.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21358>
2023-02-16 15:29:37 +00:00
Timur Kristóf
0ae778ca59 ac/llvm: Fix ac_build_buffer_load to work with more than 4 channels.
LLVM is unable to select instructions for num_channels > 4, so we
workaround that by manually splitting larger buffer loads.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21358>
2023-02-16 15:29:37 +00:00
Timur Kristóf
a2755fc203 ac/llvm: Fix buffer_load_amd with larger than 32-bit channel sizes.
LLVM is unable to select instructions for larger than 32-bit channel types.
Workaround by using i32 and casting to the correct type later.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21358>
2023-02-16 15:29:37 +00:00
Timur Kristóf
b5b0ded4c1 ac/llvm: Remove "structurized" argument and instead check vindex.
Change ac_build_buffer_load_common and ac_build_tbuffer_load so
the use structurized load when the vindex argument is not NULL.
Adjust callers to match the new behaviour.

This fixes the load_buffer_amd intrinsic with index source.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21358>
2023-02-16 15:29:37 +00:00
Timur Kristóf
881c52ba19 ac: Port ACO's get_fetch_format to ac_get_safe_fetch_size.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21358>
2023-02-16 15:29:36 +00:00
Timur Kristóf
2e9f5aadd0 nir: Clarify comment above load_buffer_amd.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21358>
2023-02-16 15:29:36 +00:00
Tapani Pälli
f815daa285 mesa/st: refactor st_destroy_texcompress_compute condition
What happened is that we did not call init but still called dtor, this
makes us do some unnecessary work.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21309>
2023-02-16 15:00:13 +00:00
Iago Toral Quiroga
93952916c6 v3dv: fix stencil view aspect selection of depth/stencil image
Instead of fixing the swizzle to X001, we should compose this
swizzle with the image view's own swizzle.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21354>
2023-02-16 14:47:39 +00:00
Guilherme Gallo
eba566c854 ci/lava: Fix LAVA logs issues for Collabora jobs
Since the Collabora LAVA update related to the downtime from
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21119, the
LAVA logs from Collabora continued to use the hack for older versions
which digested some control characters, such as carriage returns acting
as newlines, which made it necessary to recover from split lines to make
Gitlab sections work in job logs as expected.

Collabora's LAVA instance now gives a more raw log output. It is
necessary to pay attention to newlines at the end of each log message,
which may cause double newlines when printed with Python built-in
`print` function. I decided to remove the repeating `\n` from the
received log messages to make them transparent to LogFollower users.

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

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21325>
2023-02-16 13:08:41 +00:00
Guilherme Gallo
c85f3fbbb7 ci/lava: Add LavaFarm class to find LAVA farm from runner tag
LavaFarm is a class created to handle the different types of LAVA farms
and their tags in Mesa CI. Since specific jobs may require different
types of LAVA farms to run on, it is essential to determine which farm
the runner is running on to configure the job correctly.

LavaFarm provides an easy-to-use interface for checking the runner tag
and returning the corresponding LAVA farm, making it simple for Mesa CI
to configure jobs appropriately. By adding tests for LavaFarm, the team
can ensure that this class is functioning as expected, allowing for the
smooth execution of Mesa CI jobs on the correct LAVA farm.

The tests ensure that get_lava_farm returns the correct LavaFarm value
when given invalid or valid tags and that it returns LavaFarm.UNKNOWN
when no tag is provided. The tests use Hypothesis strategies to generate
various labels and farms for testing.

Example of use:
```
from lava.utils.lava_farm import LavaFarm, get_lava_farm

lava_farm = get_lava_farm()
if lava_farm == LavaFarm.DUMMY:
    # Configure the job for the DUMMY farm
    ...
elif lava_farm == LavaFarm.COLLABORA:
    # Configure the job for the COLLABORA farm
    ...
elif lava_farm == LavaFarm.KERNELCI:
    # Configure the job for the KERNELCI farm
    ...
else:
    # Handle the case where the LAVA farm is unknown
    ...
```

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21325>
2023-02-16 13:08:41 +00:00
Guilherme Gallo
ca110658b7 ci/lava: Move LAVA dependencies to pip
Use requirements.txt and requirements-test.txt to organize better Python
dependencies related to LAVA.

Now LAVA tooling can use recent and fixed library versions.
And test-related libs will not trigger container rebuilding anymore.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21325>
2023-02-16 13:08:41 +00:00
Konstantin Seurer
cf9e1b953c radv: Hash VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_* flags
Found by inspection.

Fixes: 687a82d ("radv/rt: Handle no-null shader flags")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21320>
2023-02-16 11:42:25 +00:00
Michel Dänzer
3e9c131482 frontend/dri: Initialize callbacks in dri_swrast_kms_init_screen
This was missed in the commit below.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8232
Fixes: 7d5b1cd02c ("frontend/dri: move callbacks from the VTable into dri_screen, dri_drawable")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21333>
2023-02-16 10:21:44 +00:00
GH Cao
f023548d2f gallium: Add MCJIT target triplet for Windows ARM64
MCJIT on Windows requires a special LLVM target triplet with ELF object
format, add one for Windows ARM64.

Tested locally on real hardware.

Signed-off-by: GH Cao <driver1998.ms@outlook.com>
Acked-by: Roland Scheidegger <sroland@vmware.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20675>
2023-02-16 09:04:40 +00:00
driver1998
982757082e gallium: Use DETECT_OS_WINDOWS instead of 'WIN32'
Signed-off-by: GH Cao <driver1998.ms@outlook.com>
Acked-by: Roland Scheidegger <sroland@vmware.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20675>
2023-02-16 09:04:40 +00:00
Tapani Pälli
0d1c759f4e radv: revert Metro Exodus workaround which was moved to common code
This reverts commit 4397c166c0.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21281>
2023-02-16 07:35:20 +00:00
Tapani Pälli
effee24951 spirv: add workaround for Metro Exodus in spirv_to_nir
This is commit 4397c166c0 for spirv_to_nir, otherwise we hit
the same assert with anv driver.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21281>
2023-02-16 07:35:20 +00:00
Alyssa Rosenzweig
888492ecd3 asahi: Vectorize background colour load
No point to scalarizing this, the background can handle the vector load fine
since bfa7ec0aa0 ("agx: Don't scalarize preambles in NIR").

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21327>
2023-02-16 06:36:49 +00:00
Pierre-Eric Pelloux-Prayer
affa8a9fb2 amd/surface: fix base_mip_width of subsampled formats
base_mip_width is used in si_compute_copy_image when the
SI_IMAGE_ACCESS_BLOCK_FORMAT_AS_UINT flag is used.

   width = tex->surface.u.gfx9.base_mip_width;

This will be incorrect if we don't adjust it. For instance,
with a 260x256 image, surf_pitch and base_mip_width are
320 before surf_pitch is updated to be 192.

Both need to match, or computing the width from base_mip_width
leads to incorrect result.

Cc: mesa-stable

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
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/21253>
2023-02-16 00:25:17 -05:00
Chia-I Wu
28d0ddead0 turnip: avoid FMT6_Z24_UNORM_S8_UINT_AS_R8G8B8A8 for event blits
We don't need it for event blits.  It also does not support fast clears
which makes it slower.

For event blits, blob has

  VK_FORMAT_D16_UNORM           -> FMT6_16_UNORM
  VK_FORMAT_X8_D24_UNORM_PACK32 -> FMT6_Z24_UNORM_S8_UINT
  VK_FORMAT_D32_SFLOAT          -> FMT6_32_FLOAT
  VK_FORMAT_S8_UINT             -> FMT6_8_UINT
  VK_FORMAT_D24_UNORM_S8_UINT   -> FMT6_Z24_UNORM_S8_UINT
  VK_FORMAT_D32_SFLOAT_S8_UINT  -> FMT6_32_FLOAT + FMT6_8_UINT

and always sets RB_BLIT_INFO:DEPTH.  It is unclear what
RB_BLIT_INFO:DEPTH is for but we set it anyway.

Improves "glmark2 -b refract" on angle by 15-20% on a618/a635.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8218
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21116>
2023-02-16 01:35:50 +00:00
Ryan Neph
dc1fab8b8c venus: update venus-protocol headers to partially fix WA1
Begin encoding/decoding
VkDrmFormatModifierPropertiesList2EXT::drmFormatModifierCount to fix a
workaround (WA1) in the venus-protocol.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21323>
2023-02-16 01:15:27 +00:00
Lionel Landwerlin
95d44a0773 hasvk: fix KHR_shader_float_controls reporting
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 13f68bcce1 ("hasvk: Tell spirv_to_nir float controls are always supported")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21349>
2023-02-15 23:55:39 +00:00
José Roberto de Souza
f331bab884 anv: Move execute_simple_batch() and queue_exec_locked() to kmd backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21255>
2023-02-15 23:30:58 +00:00
José Roberto de Souza
0c8d8ae13c anv: Add gem_mmap to kmd backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21255>
2023-02-15 23:30:58 +00:00
José Roberto de Souza
32a8250b46 anv: Add gem_close to kmd backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21255>
2023-02-15 23:30:58 +00:00
Asahi Lina
b39947ee0c asahi: Drop agx_device.memctx
No longer used.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21348>
2023-02-15 22:16:51 +00:00
Asahi Lina
6ad64387dd asahi: Do not use memctx for pools / meta cache
ralloc is not thread-safe, so we can't use dev->memctx for allocating
context-specific things without locking. On top of that, we always
need to explicitly clean up pools anyway since we need to unref the BOs,
so there is no point to using a memctx.

And since pools need to be explicitly cleaned up, the meta cache code
needs explicit cleanup, so add that and drop memctx from there too.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21348>
2023-02-15 22:16:51 +00:00
Asahi Lina
9daaa9e44e asahi: Fix shader key cloning overreads
We call agx_get_shader_variant through with casted inner shader key
types, so it has to make sure to only copy as much of the union as is
actually valid.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21348>
2023-02-15 22:16:51 +00:00
Chia-I Wu
bac6062d10 turnip: fix a null descriptor set dereference
Fixed
dEQP-VK.pipeline.pipeline_library.graphics_library.misc.other.null_descriptor_set_in_monolithic_pipeline.

Fixes: cb3872f2cd ("tu: Implement VK_EXT_descriptor_buffer")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21328>
2023-02-15 20:36:30 +00:00
Chia-I Wu
bce8e7f2ae turnip: fix a major leak with GPL LTO
This allows dEQP-VK.pipeline.pipeline_library.* to run to finish.

Fixes: e9f5de11d4 ("tu: Initial implementation of VK_EXT_graphics_pipeline_library")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21328>
2023-02-15 20:36:30 +00:00
Danylo Piliaiev
c7f18e4183 tu: Don't expose KHR_present_id,KHR_present_wait without KHR_swapchain
VK_KHR_present_id and VK_KHR_present_wait depend on VK_KHR_swapchain
being present, which is not present at least on Android/KGSL.

Fixes:
src/vulkan/util/vk_extensions.h:450: void assert_device_extensions_requirements(
 const struct vk_device_extension_table *, const struct vk_instance_extension_table *):
 assertion "!device_ext->KHR_present_id || device_ext->KHR_swapchain" failed

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21345>
2023-02-15 20:21:17 +00:00
Constantine Shablya
09501fe5a7 anv,hasvk: flush what UNIFORM_READ flushes on SHADER_READ
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8287
Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21310>
2023-02-15 19:53:41 +00:00
Emma Anholt
6de8b9a65b egl/kopper: Pass ancillary invalidate flush flags down to gallium.
We can just add the flags to the kopper interface, since it's private to
Mesa.  This gets us depth/stencil invalidation on swapbuffers, which is
critical for tiler performance.

glmark2-es2 -b texture (windowed) goes from 1650 to 1930 fps on
zink+turnip with ZINK_DEBUG=rp.

Part of #7321 (we're still a little behind freedreno's 2180 fps)

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21317>
2023-02-15 19:17:07 +00:00
Emma Anholt
53780b7a3a egl/kopper: Use the kopper private interface for swapBuffers.
I'm going to be introducing an extra flag to indicate EGL vs GLX behavior
in the private interface.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21317>
2023-02-15 19:17:07 +00:00
Emma Anholt
3e1b40be54 egl: Add a note explaining the swapBuffers badness in dri2_x11_copy_buffers().
I tried to drop the swapBuffers path, but it turns out it's being taken by
softpipe/llvmpipe, and the tests are passing.  The piglit egl-copy-buffers
test even passes on zink, but you end up with a bad display because of an
un-preserved back buffer.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21317>
2023-02-15 19:17:07 +00:00
Emma Anholt
a6b850e335 egl/kopper: Add assert for no kopper in dri2_copy_region.
This shouldn't be doing a swapBuffers, that's not what this function is
supposed to do.  But also, we shouldn't be doing this from zink, which the
swap was introduced for, because we don't implement the extension.  Cleans
up some strangeness from 3c4be122cc ("egl: implement more hooks for
swrast")

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21317>
2023-02-15 19:17:07 +00:00
Erik Faye-Lund
24a32b2cab Revert "meson: Fix Asahi build on macOS"
This reverts commit 4ca4a05627.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Asahi Lina <lina@asahilina.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21185>
2023-02-15 18:35:14 +00:00
Erik Faye-Lund
29ffc79410 meson: don't pass vk wsi args where they don't belong
Only code that cares about Vulkan WSI should get the corresponding
arguments passed. Otherwise, the Vulkan headers might end up including
other headers that we don't have the correct dependencies passed for.
So let's give those a dedicated variable, and only pass that where it's
actually needed.

Fixes: b39958a3a1 ("anv,nir: Move the ANV YCbCr lowering pass to common code")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8193
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21185>
2023-02-15 18:35:14 +00:00
Erik Faye-Lund
7ea85871fe vulkan: prefer vulkan_core.h over vulkan.h
If we include vulkan.h, we risk including the WSI bits as well, which we
don't need here. Only trouble can follow from including these where
they're not needed.

So let's include vulkan_core.h in these places instead.

Fixes: b39958a3a1 ("anv,nir: Move the ANV YCbCr lowering pass to common code")
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21185>
2023-02-15 18:35:14 +00:00
Mike Blumenkrantz
f5bde99cbd gallium: plumb resolve attachments through from frontends -> pipe_framebuffer_state
some drivers may find this useful

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18695>
2023-02-15 18:06:16 +00:00
Samuel Pitoiset
073cced868 radv/ci: add missing expected failures with RADV_PERFTEST=gpl on GFX1100
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21334>
2023-02-15 17:29:10 +00:00
Constantine Shablya
bd848ac92d hasvk: use Vulkan runtime's robust buffer access
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21338>
2023-02-15 16:46:59 +00:00
Constantine Shablya
5053527806 anv: use Vulkan runtime's robust buffer access
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21338>
2023-02-15 16:46:59 +00:00
David Rosca
9873ccb071 frontends/va: Map VAEncCodedBufferType buffer as PIPE_MAP_READ
VAEncCodedBufferType is used for reading back encoded data.
Mapping it for read instead of write speeds up reading
the data on CPU.

On radeonsi this will result in VRAM copy to staging buffer
in cached GTT, making the CPU read much faster.

Signed-off-by: David Rosca <nowrep@gmail.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20376>
2023-02-15 14:26:31 +00:00
Kai Wasserbäch
e832d6a1bb fix: clover/llvm: replace llvm::None with std::nullopt for LLVM 17+
llvm::None was deprecated and builds started failing with

  error: ‘None’ is not a member of ‘llvm’

Instead of using the temporarily available include in ADT which would
add a deprecation warning to the build, directly replace llvm::None with
the recommended std::nullopt

This change takes only effect with LLVM 17 or newer.

Reference: d4f38ef288/llvm/include/llvm/ADT/None.h
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21125>
2023-02-15 12:00:06 +00:00
Danylo Piliaiev
b7ab83d59f ir3: Consider dst type in ubo_vec4 to ldc lowering
The dst type could be either 16b or 32b.

Fixes validation failure in dEQP-VK.subgroups.* tests which deal with
16b types.

 validation fail: (type_size(instr->cat6.type) <= 16) == !!((instr->dsts[0])->flags & IR3_REG_HALF)
   -> for instruction: MESA: info: 0023:0000:000:        ldc.offset0.base0 hssa_23 (wrmask=0x3), ssa_1, ssa_22

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21316>
2023-02-15 09:49:39 +00:00
Karmjit Mahil
e089166776 pvr: Add support for VK_ATTACHMENT_LOAD_OP_LOAD.
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/21280>
2023-02-15 09:29:21 +00:00
Karmjit Mahil
c75c58e54c pvr: Upload spm load programs to device.
The programs are currently unused but will be needed for the spm
background object load op.

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/21279>
2023-02-15 09:16:03 +00:00
Karmjit Mahil
d6408e08df pvr: Add SPM load usc empty programs
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/21279>
2023-02-15 09:16:03 +00:00
Nanley Chery
5d24682aae iris: Drop iris_cache_flush_for_render
Before dropping this function, handle the two callers of this function:

* The call in iris_blorp.c is redundant. The required cache flushes are
  already handled by the callers of blorp functions. Delete this.

* The call in iris_resolve.c is still providing a benefit because it
  calls iris_emit_buffer_barrier_for internally. Inline the needed
  barrier.

Cc: 23.0 <mesa-stable>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21303>
2023-02-15 05:49:23 +00:00
Nanley Chery
7c367bef0d iris: Flush caches for aux-mode changes more often
Memory accesses can get corrupted when there's a disagreement between:
* the aux-mode of existing cache lines for a surface and
* the aux-usage in that surface's RENDER_SURFACE_STATE object

We have already prevented hardware from seeing this conflict for
rendering operations, but due to how the L3 is shared among multiple
clients in gfx12 (e.g., sampler engine, render engine, etc.), we need to
expand the scope of the existing solution. Now, before any access of a
compressible resource, we make sure to flush the prior aux-mode from the
caches.

The majority of changes here refactor things for use in a new function,
flush_previous_aux_mode. The remaining change calls that function from
within iris_resource_prepare_access.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6558
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7625
Cc: 23.0 <mesa-stable>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21303>
2023-02-15 05:49:23 +00:00
Nanley Chery
ad9c0b7a84 iris: Update comment in iris_cache_flush_for_render
Update the comment to reflect the fact that iris no longer switches
between CCS_E and CCS_D.

Cc: 23.0 <mesa-stable>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21303>
2023-02-15 05:49:23 +00:00
Yonggang Luo
9e934ee068 meson: Combine duplicated c_args and cpp_args
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19185>
2023-02-15 03:42:02 +00:00
Yonggang Luo
2626946490 meson: Split c_cpp_args from pre_args
pre_args should not include compiler options

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19185>
2023-02-15 03:42:02 +00:00
Eric Engestrom
4ff295e1d8 meson: drop TODO: opengl, it's done
Suggested-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19600>
2023-02-15 02:53:54 +00:00
Eric Engestrom
1fa68d91c6 meson: only build glsl when needed
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19600>
2023-02-15 02:53:54 +00:00
Eric Engestrom
e0adef2652 meson: only build libglsl_util when needed
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19600>
2023-02-15 02:53:54 +00:00
Eric Engestrom
0404918f61 meson: only build the loader when needed
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19600>
2023-02-15 02:53:54 +00:00
Eric Engestrom
ef564f9391 meson: only build mapi when needed
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19600>
2023-02-15 02:53:54 +00:00
Eric Engestrom
de90690aba meson: move float64_glsl_file one meson.build up
anv uses it.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19600>
2023-02-15 02:53:54 +00:00
Mike Blumenkrantz
0337acad15 lavapipe: enable linear filtering for depth formats
this seems to work according to cts

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20859>
2023-02-15 01:49:30 +00:00
Mark Janes
4b97e349cd intel: Implement Wa_16011448509
"Use 3DSTATE_CONST command for individual shaders instead of
3DSTATE_CONST_ALL COMMAND"

On gen 12.0 platforms, 3DSTATE_CONSTANT_ALL command is not processed
correctly in certain cases.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
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/21301>
2023-02-15 01:10:42 +00:00
Mike Blumenkrantz
f0e1512673 zink: block LINEAR filtered blits for zs formats
this is illegal, and the u_blitter path has to be taken to guarantee
enough accuracy that the strictest piglit tests pass

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21314>
2023-02-14 23:52:34 +00:00
Mike Blumenkrantz
120a506e70 Revert "zink: always use NEAREST for zs blits"
This reverts commit 067545eb9a.

this is good enough for CI but not enough for anholt's piglit tests

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21314>
2023-02-14 23:52:34 +00:00
Eric Engestrom
6ac830ccb1 vk/runtime: turn vk.xml extension requirements into asserts
More specifically, turn
  <extension name="VK_KHR_foo" requires="VK_KHR_bar">
into
  assert(!ext->KHR_foo || ext->KHR_bar);

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21261>
2023-02-14 23:28:29 +00:00
Eric Engestrom
a654a303f8 vk/runtime: keep track of supported instance extensions
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21261>
2023-02-14 23:28:29 +00:00
Eric Engestrom
ca98e4446b vk/util: keep track of extension requirements
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21261>
2023-02-14 23:28:29 +00:00
Jesse Natalie
87e83ce58e dzn: Enable KHR_storage_buffer_storage_class
It's required for VK1.1 and Mesa's SPIR-V parser handles it for us.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21261>
2023-02-14 23:28:29 +00:00
Lionel Landwerlin
9ac192d79d intel/fs: bound subgroup invocation read to dispatch size
This is to avoid out of bound register accesses (potentially leading
to hangs) when the dispatch size is smaller than when is reported in
the NIR subgroup_size.

v2: Implement bounding with a mask (since workgroup sizes are powers of 2) (Faith)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 530de844ef ("intel,anv,iris,crocus: Drop subgroup size from the shader key")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21282>
2023-02-14 21:29:42 +00:00
Mike Blumenkrantz
0d445cfb7e zink: enable renderpass optimizations by default for selected drivers
CI has been running this for months on turnip, so let's give it some
broader testing

also add a ZINK_DEBUG=norp for testing

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21296>
2023-02-14 20:06:16 +00:00
Georg Lehmann
4fbcd046ce aco: Don't use vcmpx with DPP.
V_CMPX+DPP returns 0 with reads from disabled lanes, unlike V_CMP+DPP (RDNA3 ISA doc, 7.7)

Fixes: baab6f18c9 ("aco: Optimize branching sequence during SSA elimination.")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20537>
2023-02-14 19:15:17 +00:00
Faith Ekstrand
41b0407d5c nir/from_ssa: Use more helpers in resolve_parallel_copies
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21299>
2023-02-14 17:54:12 +00:00
Kenneth Graunke
3e09a636db nir: Fix typos in the from-SSA pass comments
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21299>
2023-02-14 17:54:12 +00:00
Kenneth Graunke
b1ebd9978c nir: Fix merge_set_dump() to compile again
This #if 0'd debug code has been broken since -Werror=vla was added.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21299>
2023-02-14 17:54:11 +00:00
Kenneth Graunke
8343d7fd2a nir: Print divergence information for registers as well as SSA defs
This patch causes us to print "con" and "div" for registers as well as
SSA defs.  We print it on both register declarations, and destinations.
The latter isn't strictly necessary, but it is handy to be able to see
e.g. a convergent value being assigned to a divergent register without
having to constantly refer back to definitions that might be much
earlier in the program.  I originally printed it for sources as well,
but that got to be a bit wordy, so I dropped that.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21299>
2023-02-14 17:54:11 +00:00
Erik Faye-Lund
139dd4e772 meson: remove unused USE_FOO_ASM defines
The usage of these defines was removed, so let's remove the definitions
as well.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21212>
2023-02-14 17:22:14 +00:00
Rohan Garg
d64000dbb3 anv/blorp: use existing function to convert the op to a string
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21283>
2023-02-14 16:55:21 +00:00
Rohan Garg
80790f50db isl: fix some documentation
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21283>
2023-02-14 16:55:21 +00:00
Rohan Garg
4e61191065 anv: reuse the VK_IMAGE_ASPECT_PLANES_BITS_ANV macro
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21283>
2023-02-14 16:55:21 +00:00
Rohan Garg
5bb217a07a anv: drop unused headers
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21283>
2023-02-14 16:55:21 +00:00
Georg Lehmann
281a505ef0 aco: new 16bit VOP3 opcodes can use opsel
No Foz-DB changes on gfx11.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20705>
2023-02-14 16:14:55 +00:00
Corentin Noël
e8091a6593 ci/venus: Skip tests risking out of memory issues
These two dEQP tests:
 * dEQP-VK.api.object_management.max_concurrent.graphics_pipeline
 * dEQP-VK.api.object_management.max_concurrent.compute_pipeline

Require a lot of memory and might kill crosvm or the renderer server because of EOM
issues. Skip them for now.

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21306>
2023-02-14 15:56:20 +00:00
Samuel Pitoiset
fa66c8954e radv: ignore registering pipeline libaries with SQTT
They aren't executable pipelines and they might not contain all
shader stages.

This fixes a crash when generating RGP captures with GPL.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21235>
2023-02-14 15:03:45 +00:00
Erik Faye-Lund
b68f13bc90 zink: remove incorrect trailing comma
A trailing comma in a list is not valid JSON. Let's drop it.

Fixes: f7b2dbb2bd ("zink: relax bresenhamLines requirement for non-strictLine drivers")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21211>
2023-02-14 14:44:03 +00:00
Erik Faye-Lund
445d104dd9 zink: correct companies in requirements
These contributors don't work for Zink itself, but various companies
who's working on Zink. Add the correct ones.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21211>
2023-02-14 14:44:03 +00:00
Michel Dänzer
aaa407e3bd ci: Enable the hasvk Vulkan driver in the fedora-release job
To match the Fedora packaging.

While at it, sort the Vulkan drivers alphabetically.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21236>
2023-02-14 12:59:44 +00:00
Michel Dänzer
0511e6cf64 ci: Enable i915 Gallium driver in fedora-release job
To match the Fedora packaging.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21236>
2023-02-14 12:59:44 +00:00
Michel Dänzer
e4b7e68130 ci: Re-enable intel-clc in fedora-release job
Fedora 36 has new enough llvm-spirv-translator.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21236>
2023-02-14 12:59:44 +00:00
Michel Dänzer
1589d004f1 ci: Update Fedora image to 36
Fedora 34 is EOL.

With Fedora 37, ccache hangs in a futex syscall in CI for some reason,
so let's go with 36 for now.

v2:
* No need to add -Wno-error=stringop-overflow anymore.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21236>
2023-02-14 12:59:44 +00:00
Michel Dänzer
2a626f999a clover: Reserve vector memory in make_text_section
This isn't strictly required, but it works around
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100366 , and it might
avoid a memory reallocation.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21236>
2023-02-14 12:59:44 +00:00
Michel Dänzer
53ce756eeb anv/grl: Use union for reinterpreting integer as float
Fixes strict aliasing violations flagged by GCC 12:

../src/intel/vulkan/grl/include/GRLOCLCompatibility.h: In function ‘float as_float(uint32_t)’:
../src/intel/vulkan/grl/include/GRLOCLCompatibility.h:182:13: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  182 |     return *reinterpret_cast<float*>(&i);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/intel/vulkan/grl/include/GRLOCLCompatibility.h: In function ‘float3 as_float3(int3)’:
../src/intel/vulkan/grl/include/GRLOCLCompatibility.h:187:13: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  187 |     return *reinterpret_cast<float3*>(&i3);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/intel/vulkan/grl/include/GRLOCLCompatibility.h:187:13: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../src/intel/vulkan/grl/include/GRLOCLCompatibility.h: In function ‘float4 as_float4(int4)’:
../src/intel/vulkan/grl/include/GRLOCLCompatibility.h:192:13: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  192 |     return *reinterpret_cast<float4*>(&i4);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/intel/vulkan/grl/include/GRLOCLCompatibility.h:192:13: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

Fixes: 5f948503e4 ("anv: Import GRL")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21236>
2023-02-14 12:59:44 +00:00
Mike Blumenkrantz
a10529080b zink: set ZINK_DESCRIPTORS=db for radv jobs
there's no testing for this in ci, and radv has a unique heap/memory
setup which catches allocation regressions

Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20968>
2023-02-14 12:14:49 +00:00
Marcin Ślusarz
75e5d458a0 anv: enable task redistribution
Disabling is no longer needed after "intel/compiler/mesh: use
slice id of task urb handles in mesh shaders".

This reverts commit 4eaecd7965.

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

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21007>
2023-02-14 09:36:53 +00:00
Marcin Ślusarz
dd9bf86725 intel/compiler/mesh: use slice id of task urb handles in mesh shaders
When mesh shader is spawned on a different slice than the originating
task shader, then input task urb handle can come from a different
slice, so masking this information off will load data from the current
slice, instead of the one where real data are.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21007>
2023-02-14 09:36:53 +00:00
Lionel Landwerlin
9ddd296cd3 anv: implement VK_EXT_vertex_input_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/21026>
2023-02-14 09:05:35 +00:00
Lionel Landwerlin
95e3278285 anv: move 3DSTATE_VERTEX_ELEMENT emission to dynamic path
Prep work for VK_EXT_vertex_input_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/21026>
2023-02-14 09:05:35 +00:00
Lionel Landwerlin
46ecd56191 anv: remove copied information from runtime graphics 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/21026>
2023-02-14 09:05:35 +00:00
Marcin Ślusarz
b1bb44cf65 anv: fix how unset gl_Viewport & gl_Layer are handled in mesh case
See also: c6f69eea6a ("anv/pipeline: Properly handle unset gl_Layer and gl_ViewportIndex")

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17620>
2023-02-14 08:24:51 +00:00
Marcin Ślusarz
9d3e3c15f3 intel/compiler: replace gl_Layer & gl_ViewportIndex by 0 in fs if ms doesn't write it
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17620>
2023-02-14 08:24:51 +00:00
Samuel Pitoiset
5d41d8258a radv: disable DCC for mipmaps on GFX11
It seems broken but can't really figure out why and DCC levels aren't
interleaved on GFX11. Skipping DCC initialization for levels seems to
also fix it but seems safer to disable completely, as a hotfix.

Fixes DCC issues with Hi-Fi Rush, Sonic Frontiers, Hogwarts Legacy
and probably more.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8230
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21186>
2023-02-14 07:15:57 +00:00
Emma Anholt
6cbc90df48 ci/etnaviv: Update deqp xfails for gc2000.
More of a mixed bag here than gc7000, but at least the status is stable
in the last 3 nightly runs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21294>
2023-02-14 06:33:12 +00:00
Emma Anholt
fe9a00af34 ci/etnaviv: Drop stale xfails from gc7000.
These have passed in 3/3 of the last nightly runs.  Congrats, etnaviv!

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21294>
2023-02-14 06:33:11 +00:00
Emma Anholt
29ffdd72a1 ci/radv: Add a skip for navi21-llvm for a test that consistently timeouts.
I had seen this in my last round of work, but forgot to git add the skips
file.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21294>
2023-02-14 06:33:11 +00:00
Mike Blumenkrantz
56108b411f zink: verify compressed format layer count when creating surfaces
this is illegal for some cases, and mesa/st is equipped to handle
per-layer copying here

fixes #8283

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21292>
2023-02-14 01:50:14 +00:00
Mike Blumenkrantz
64708f9316 zink: don't handle mutable init on surface creation with tc enabled
using the cmdbuf during this call is illegal and causes desync, thus
the initialization has to be deferred until the surface is bound

fixes #7579

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21292>
2023-02-14 01:50:14 +00:00
Mike Blumenkrantz
44ce7ee6c1 zink: const-ify a surface param
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21292>
2023-02-14 01:50:14 +00:00
Mike Blumenkrantz
d05b7ef641 zink: break out pipe_surface init for new surface creation
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21292>
2023-02-14 01:50:14 +00:00
Mike Blumenkrantz
b288e5d0ce zink: account for null surface when trying to retain clears on fb bind
not currently possible but will be soon

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21292>
2023-02-14 01:50:14 +00:00
Mike Blumenkrantz
f770263ab6 zink: only try for a fb rebind if fb binds exist in rebind_image()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21292>
2023-02-14 01:50:14 +00:00
Mike Blumenkrantz
f11e9e3aa1 zink: fix indentation of rebind_image()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21292>
2023-02-14 01:50:14 +00:00
Dave Airlie
6d3c79fa4c crocus: switch gen4/5 tiling flags to follow suggestions.
Fixes: 6043f66dd3 ("crocus: disable Y tiling for render targets properly.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21300>
2023-02-14 01:31:46 +00:00
Eric Engestrom
723569d71e broadcom/ci: mark test as flaky
It passed once here: https://gitlab.freedesktop.org/gdevi/mesa/-/jobs/36317041

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21295>
2023-02-14 00:52:35 +00:00
Emma Anholt
5c246e21b7 Revert "freedreno/a5xx: Fix clip_mask"
This reverts commit 2dfebf3487.

It causes GPU hangs in piglit tests like
spec@glsl-1.20@execution@clipping@vs-clip-vertex-enables, for reasons I'm
totally unclear on.  The commit was not necessary, because the frontend
lowering already handles disabled clip planes by storing 0.0 to the
corresponding clipdist array element in that shader variant.  Add a note
to that effect.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21298>
2023-02-14 00:16:50 +00:00
Emma Anholt
509c1f9fea ci/freedreno: Update manual-run xfails for a530.
While I'm having a hard time stabilizing most of the test list on this HW
due to the clip-enable GPU hangs leaking into random other tests, these
have been consistent in the last 4 runs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21298>
2023-02-14 00:16:50 +00:00
Giancarlo Devich
11bec22647 d3d12: Don't clear d3d12_shader_key
The shader key structure is quite large and memsetting it to zero to be
able to create or often simply find an existing shader is responsible
for a large portion of CPU usage during benchmarks.

This change is more surgical about what, when, and how things get
cleared.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21247>
2023-02-13 22:57:03 +00:00
Giancarlo Devich
f9a827d61e nir: Check sampler_binding is valid when lowering tex shadow
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21247>
2023-02-13 22:57:03 +00:00
Giancarlo Devich
b2e5484171 d3d12: Add unions to encompass shader key stage vars, use in hashing
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21247>
2023-02-13 22:57:03 +00:00
Giancarlo Devich
806f100ad2 d3d12: Use varying comparison function for TESS stage key compare
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21247>
2023-02-13 22:57:03 +00:00
Alan Coopersmith
289eb50abf util/disk_cache: Handle OS'es without d_type in struct dirent
Needed to build on Solaris

Fixes: f58e6fee74 ("util/disk_cache: delete more cache items in one go when full")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21110>
2023-02-13 22:18:23 +00:00
Mike Blumenkrantz
067545eb9a zink: always use NEAREST for zs blits
LINEAR is illegal, and swapping filtering at this point still
seems to be conformant given questionable GL spec requirements for
LINEAR zs filtering

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21203>
2023-02-13 21:00:34 +00:00
Konstantin Seurer
77f59950fd radv/rra: Hide deferred accel struct data destruction behind an env var
Keeping around copies of the BVHs in CPU memory can cause issues with
Applications creating a large amount of acceleration structures (Control).
This commit adds back the old path of copying acceleration structures
while still keeping the deferred, possibly more accurate path around.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20700>
2023-02-13 20:39:30 +00:00
Konstantin Seurer
5093ea6d41 radv/rra: Find copy memory index when initializing the trace state
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20700>
2023-02-13 20:39:30 +00:00
Lionel Landwerlin
eb5d7056e0 anv/hasvk: handle a SAMPLED_READ/STORAGE_READ access flags
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21277>
2023-02-13 20:11:40 +00:00
SoroushIMG
96849363eb zink: free resource objects' views array during destruction
since the array is not ralloc managed, it has be explicitly freed.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21285>
2023-02-13 19:00:06 +00:00
SoroushIMG
da5137ef61 zink: stop creating pipeline library cache for non-optimal_key drivers
currently the nin-optimal codepath doesn't use this at all and this just
leaks memory due to not handling non-tcs generated shaders.

Fixes: 487ac6dbd6 ("zink: implement cross-program pipeline library sharing")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21285>
2023-02-13 19:00:06 +00:00
SoroushIMG
b3ed037ca8 zink: allocate program shader caches from the program's mem ctx
these will now be freed when the program itself is freed.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21285>
2023-02-13 19:00:06 +00:00
SoroushIMG
6af3a12e70 zink: fix compute shader leaks
Compute program owns the nir and zink shaders now and must free them
too when destroyed.

Fixes: 4cb4bb555e ("zink: create compute programs from compute shaders directly")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21285>
2023-02-13 19:00:06 +00:00
Michel Zou
742c77078c ci/mingw: drop useless -Wno-error flags
Will prevent merging incorrect code like in #8260

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21244>
2023-02-13 18:00:34 +00:00
Chia-I Wu
4e03cfa3c6 radv: fix a hang with binning on CHIP_RENOIR
Using (6, 16) for (context_states_per_bin, persistent_states_per_bin)
causes gpu hang in RDR2 benchmark on CHIP_RENOIR.  Follow radeonsi and
use (3, 8) instead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21254>
2023-02-13 17:23:53 +00:00
osy
1c72424770 virgl: enable timer queries only if host supports it
Timer queries is tied to GL_ARB_timer_query/GL_EXT_disjoint_timer_query
support on the host. We have a flag that detects this so lets use it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20380>
2023-02-13 16:07:12 +00:00
Alyssa Rosenzweig
f2740ac69c pan/decode: Add support for decoding CSF
Add support to pandecode for Mali architecture v10, featuring the new command
stream frontend (CSF). This replaces the "job chain" with a new Command
Execution Unit (CEU) that runs a domain-specific assembly language. That
requires us to refactor pandecode substantially, splitting out JM-only code from
shared JM/CSF common code, and adding new CSF-only decode routines to
disassemble and interpret CSF command streams and pretty-printing the
data structures hit.

This is of course impossible to do properly, since the CEU is pretty easily
Turing-complete and hence subject to the halting problem. But we implement some
simple heuristics to follow jumps that are just good enough for the simple
command streams emitting by both the DDK and Panfrost.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20837>
2023-02-13 15:24:10 +00:00
Alyssa Rosenzweig
102d4292d5 panfrost: Fix some fields in v10.xml
Correct some errors from the file's initial check in, as we're about to add
corresponding pandecode changes for the file.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20837>
2023-02-13 15:24:10 +00:00
Alyssa Rosenzweig
39774503b3 asahi: Implement indirect draws
Passes dEQP-GLES31.functional.draw_indirect.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21273>
2023-02-13 09:51:42 -05:00
Alyssa Rosenzweig
ad3375478c asahi: Refactor index buffer upload for indirect
We need to avoid the reference to draws->count when indirect draws are used, as
it is not available CPU side.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21273>
2023-02-13 09:51:42 -05:00
Alyssa Rosenzweig
e4731ec335 asahi: Remove default=true on index list values
These will cause issues with indirect draws.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21273>
2023-02-13 09:51:42 -05:00
Alyssa Rosenzweig
7968c474b8 panvk: Disable SNORM rendering
Driver isn't ready for this yet. 7f98a9ba2b ("panfrost: Implement
GL_EXT_render_snorm on Bifrost+") caused piles of tests to go from NotSupported
-> Fail, so let's functionally revert that.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21257>
2023-02-13 14:04:52 +00:00
Alyssa Rosenzweig
6142d50375 panvk: Fix varying linking
Since 2316b80d77 ("panfrost: Don't use nir_variable to link varyings"), we can
only get correct type information from the fragment shader inputs (not the
vertex shader output). Fixes piles of CTS regressions.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21257>
2023-02-13 14:04:52 +00:00
Alyssa Rosenzweig
1ba20868c4 panvk: Take lock when tracing
We're not supposed to call the GENX(pandecode_jc) routines (e.g.
pandecode_jc_v7), since it's an internal interface that expects the caller to
take a lock first. Instead we're supposed to call the non-GenXML pandecode_jc
entrypoint which does the locking properly. Fixes assertion failures when
tracing with recent pandecode:

deqp-vk: ../src/util/simple_mtx.h:142: simple_mtx_assert_locked: Assertion `mtx->val' failed.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21257>
2023-02-13 14:04:52 +00:00
Karol Herbst
13a4c49cb1 rusticl/program: enable spirv
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19008>
2023-02-13 12:45:07 +00:00
Karol Herbst
2a0b58434d rusticl/kernel: fix clGetKernelInfo CL_KERNEL_ATTRIBUTES for non source programs
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19008>
2023-02-13 12:45:07 +00:00
Marcin Ślusarz
771f7c1d91 anv: bump ANV_MAX_QUEUE_FAMILIES
Now it's possible to overflow anv_physical_device.queue.families
and anv_device.decoder.

CID: 1520852

Fixes: 056b0cb87f ("anv: add video engine support in various places")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21278>
2023-02-13 12:19:45 +00:00
Yusuf Khan
a157133380 nvc0/nv50: support and enable EXT_memory_object*
Passes the ext_external_objects-memory-object-api-errors piglit:

./bin/ext_external_objects-memory-object-api-errors
Mesa: User error: GL_INVALID_VALUE in glTexStorageMem1DEXT(memory=0)
PIGLIT: {"subtest": {"1D texture" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTexStorageMem2DEXT(memory=0)
PIGLIT: {"subtest": {"2D texture" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTexStorageMem3DEXT(memory=0)
PIGLIT: {"subtest": {"3D texture" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTextureStorageMem1DEXT(memory=0)
PIGLIT: {"subtest": {"1D texture direct state access" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTexureStorageMem2DEXT(memory=0)
PIGLIT: {"subtest": {"2D texture direct state access" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTextureStorageMem3DEXT(memory=0)
PIGLIT: {"subtest": {"3D texture direct state access" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTexStorageMem2DMultisampleEXT(memory=0)
PIGLIT: {"subtest": {"2D texture ms" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTexStorageMem3DMultisampleEXT(memory=0)
PIGLIT: {"subtest": {"3D texture ms" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTextureStorageMem2DMultisampleEXT(memory=0)
PIGLIT: {"subtest": {"2D texture ms direct state access" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTextureStorageMem3DMultisampleEXT(memory=0)
PIGLIT: {"subtest": {"3D texture ms direct state access" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glBufferStorageMemEXT(memory == 0)
PIGLIT: {"subtest": {"buffer storage" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glNamedBufferStorageMemEXT(memory == 0)
PIGLIT: {"subtest": {"buffer storage direct state access" : "pass"}}
Mesa: User error: GL_INVALID_ENUM in glGetUnsignedBytevEXT(pname=0xffffffff)
PIGLIT: {"subtest": {"unsigned-byte-v-bad-enum" : "pass"}}
Mesa: User error: GL_INVALID_ENUM in glGetUnsignedBytei_vEXT(pname=0xffffffff)
PIGLIT: {"subtest": {"unsigned-byte-i-v-bad-enum" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glGetUnsignedBytei_vEXT(pname=GL_DEVICE_UUID_EXT)
PIGLIT: {"subtest": {"unsigned-byte-i-v-bad-value" : "pass"}}

Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19405>
2023-02-13 12:03:13 +00:00
Alyssa Rosenzweig
8e1eee8b5e asahi: Add XML for VDM memory barriers
We'll use these in our implementation of transform feedback.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21272>
2023-02-13 11:45:03 +00:00
Alyssa Rosenzweig
8e0e68510f asahi: Add XML for indirect draws
Nice and simple.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21272>
2023-02-13 11:45:03 +00:00
Alyssa Rosenzweig
c3b8928b84 asahi: Add XML for indirect dispatch
This splits up the CDM commands into their subparts, after which
indirect dispatch is straightforward.

Also fix the pipeline bits.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21272>
2023-02-13 11:45:03 +00:00
Alyssa Rosenzweig
3da4838591 asahi: Submit batches that don't touch RTs
If there is any draw, we should submit in case there are active queries,
fragment shader side effects, etc. Together with previous commit fixes
no_attachment framebuffers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21267>
2023-02-13 11:28:07 +00:00
Alyssa Rosenzweig
2c2f189fe7 agx: Write sample mask even with no colour output
Needed for discard to work properly, which has visible side effects with
occlusion queries. Fixes no_attachment framebuffers together with the next
commit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21267>
2023-02-13 11:28:07 +00:00
Alyssa Rosenzweig
e785ae6125 agx: Implement load_helper_invocation
Passes dEQP-GLES31.functional.shaders.helper_invocation.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21265>
2023-02-13 11:12:05 +00:00
Alyssa Rosenzweig
6214c9921a agx: Remove bogus gl_Position assertion
It is reasonable not to write gl_Position in a transform feedback program.

Fixes rendering of the apitrace of Domekeeper in #7798.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21266>
2023-02-13 10:48:13 +00:00
Alyssa Rosenzweig
eeae9b93de agx: Fix AGX_MAX_CF_BINDINGS
Potentially could be larger with aliasing of component offsets, though that
would be silly.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21266>
2023-02-13 10:48:13 +00:00
Alyssa Rosenzweig
fbe8878dcb agx: Respect component in frag load_input
Fixes fails in dEQP-GLES31.functional.separate_shader.random.*.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21266>
2023-02-13 10:48:13 +00:00
Alyssa Rosenzweig
a5d478d17c agx: Remove unused AGX_MAX_VARYINGS
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21266>
2023-02-13 10:48:13 +00:00
Mike Blumenkrantz
b73fe8d52e zink: also replace hash_entry::key when replacing separable program
this otherwise still points to the separable program's shader array
and will access freed memory

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
b5029a90df zink: calloc separable program zink_gfx_library_key struct
this matches other zink_gfx_library_key allocations

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
4cda98c827 zink: implement a scaling descriptor buffer size
previously descriptor buffers were sized to allow for 25,000 descriptors

this is a great number.

but in some scenarios it's overkill, and it's theoretically possible that
it might be underkill in others (citation needed), so add some handling
for both cases to save small amounts of vram on average and not crash
in the distant future when hypercomputers try running drawoverhead

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
453701256d zink: store base descriptor size on the screen
useful to have this around for reuse

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
651f322091 zink: ensure db is bound before separate shader update
seems unlikely but who knows

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
bec6087699 zink: move db_bound to batch descriptor data
this is where descriptor stuff goes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
f57f28a348 zink: move zink_batch_state::db_bound reset to zink_batch_descriptor_reset()
descriptor code goes in descriptor file

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
5b31659650 zink: rename a struct member for clarity
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
27dec4a262 zink: add an io assignment pass for separate shaders
usually this is handled by zink_compiler_assign_io() for full pipelines,
where locations are compacted and variables are eliminated, but separate
shaders still need to have "correct" locations set, which can be achieved
by relying on 'location' instead of the (failed) attempt by the frontend
to set 'driver_location' with nir_assign_io_var_locations()

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
13c6ad0038 zink: use a single descriptor buffer for all non-bindless types
the descriptor count (buffer size) calculated for buffers was based
on drawoverhead throughput, which is the fastest descriptors can be changed
at the cpu level. these cases demonstrate the maximum speed that ANY
descriptor can be changed, which means that changing multiple types in
a given cmdbuf will, at best, be the same throughput

thus, instead of allocating a separate buffer for each type, only a single
buffer needs to be allocated, and all descriptors can be bound to this buffer

this should reduce descriptor vram usage by ~80%

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
facb1b7884 zink: rework separate shader descriptor iterating
using the shader struct members is a bit more natural here and
avoids some confusion when one of the stages has no descriptors

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
e6a55bfc16 zink: flag gfx programs as removed-from-cache by default
this fixes some desync where async programs are destroyed before being
added to the cache

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
f70b1732da zink: assert that the found program matches the expected one in shader_free
avoid bugs

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
66f2a1c526 zink: don't fetch/update pipeline cache for separate shader programs
this is illegal

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
ffd91ee7a8 zink: fix descriptor pool free iterating
these arrays are sparsely allocated, and using pop() on them will
fail to access some elements

Fixes: cf7c17a7af ("zink: rework descriptor pool overflow")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
16c019142b zink: sync LTO compiles for GPL pipelines on shader free
this avoids invalid access

affects:
KHR-Single-GL46.arrays_of_arrays_gl.InteractionStorageBuffers2

Fixes: 41ffb15de5 ("zink: implement async gfx precompile")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
e8b8279b61 zink: allocate all batch command buffers in one call
just simpler

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Lionel Landwerlin
295dd6f515 intel/dev: add a default urb value for intel_stub_gpu on dg2
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21249>
2023-02-13 09:38:06 +00:00
Samuel Pitoiset
214d6d05ed radv simplify compiling graphics shaders with a mask of active NIR stages
Instead of recomputing the same bitfield everywhere.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21237>
2023-02-13 09:15:37 +00:00
Samuel Pitoiset
8dd0b98786 radv: only initialize shader arguments for the active stages
Other stages don't need to be initialized.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21237>
2023-02-13 09:15:37 +00:00
Samuel Pitoiset
d05a02018b radv: use last_vgt_api_stage for determining the last stage with XFB
It's shorter and cleaner.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21237>
2023-02-13 09:15:37 +00:00
Mike Blumenkrantz
36d8443e5f zink: add a local is_compute var for set_shader_images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>
2023-02-13 08:42:36 +00:00
Mike Blumenkrantz
cff6e6e13b zink: pull out image descriptor updating in set_shader_images
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>
2023-02-13 08:42:36 +00:00
Mike Blumenkrantz
1c1f075627 zink: rework set_shader_images() hook
this makes the code more methodical, readable, and correct, fixing a
number of issues along the way:
* inaccurate write_bind_count incrementing
* inaccurate barrier_access write unsetting
* inefficient partial rebinds
* leaking texel buffers

also add some comments to make this clearer

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>
2023-02-13 08:42:36 +00:00
Mike Blumenkrantz
128192bffb zink: unref image buffer descriptors on unbind
Fixes: 7ab5c5d36d ("zink: use EXT_descriptor_buffer with ZINK_DESCRIPTORS=db")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>
2023-02-13 08:42:36 +00:00
Mike Blumenkrantz
e5666fe7cc zink: remove stale comment
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>
2023-02-13 08:42:36 +00:00
Mike Blumenkrantz
ee53b07c0a zink: unset gfx shader read when unbinding shader images
this otherwise will never be unset

Fixes: 50e764fa50 ("zink: track gfx/compute descriptor barrier info")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>
2023-02-13 08:42:36 +00:00
Mike Blumenkrantz
892eae9af0 zink: rename some variables in zink_set_shader_images()
this is more consistent with set_sampler_views

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>
2023-02-13 08:42:36 +00:00
Samuel Pitoiset
9f8c563e10 radv: fix importing retained NIR shaders when a lib uses the RETAIN bit
Fixes couple of GPL regressions with VKCTS, I thought this was test
bugs but it's valid behaviour as long as the libary uses
VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21245>
2023-02-13 08:17:05 +00:00
Alyssa Rosenzweig
edf78810a7 radv: Use common Get*OpaqueCaptureDescriptorDataEXT
Now stubbed by the Vulkan runtime for you, deduplicate.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by; Samuel Pitoiset <samuel.pitoiset@gmail.com>

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21230>
2023-02-13 07:43:11 +00:00
Alyssa Rosenzweig
2854dca898 tu,vulkan: Add common Get*OpaqueCaptureDescriptorDataEXT
In both tu and radv, these are all trivial. Move the trivial implementation from
tu to common code to deduplicate the boilerplate.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by; Samuel Pitoiset <samuel.pitoiset@gmail.com>

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21230>
2023-02-13 07:43:11 +00:00
Tapani Pälli
235e5806b3 iris: handle error in iris_resource_from_handle
In similar manner as fdab8fef7a we might fail creating resource,
let application handle the error. Application may have given wrong
input pitch when importing dmabuf.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8248
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21233>
2023-02-13 07:59:14 +02:00
Kai Wasserbäch
efcb63938c fix(FTBFS): clover: fix LLVM #include of Triple.h, moved to TargetParser
Upstream moved Triple.h from ADT to TargetParser in LLVM 17.

Reference: 62c7f035b4
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21262>
2023-02-12 18:36:07 +00:00
Kai Wasserbäch
7956b80bf8 fix(FTBFS): gallivm: fix LLVM #include of Triple.h, moved to TargetParser
Upstream moved Triple.h from ADT to TargetParser in LLVM 17.

Reference: 62c7f035b4
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21262>
2023-02-12 18:36:07 +00:00
Eric Engestrom
1e73fd4aa8 u_pipe_screen_lookup_or_create: avoid re-querying the fd to have a consistent hash key
In every current driver, the fd we get back from the screen is the fd we
gave to screen_create() three lines above (or a dup() thereof, which we
consider to be the same since we look inside it for the file description
instead).

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
2023-02-12 17:11:17 +00:00
Eric Engestrom
cd152ec930 asahi: use u_pipe_screen_lookup_or_create() to keep track of and reuse screens
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
2023-02-12 17:11:17 +00:00
Eric Engestrom
8193efec83 panfrost: use u_pipe_screen_lookup_or_create() to keep track of and reuse screens
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
2023-02-12 17:11:17 +00:00
Eric Engestrom
7b3ee9335f vc4: use u_pipe_screen_lookup_or_create() to keep track of and reuse screens
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
2023-02-12 17:11:16 +00:00
Eric Engestrom
769b511054 v3d: use u_pipe_screen_lookup_or_create() to keep track of and reuse screens
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
2023-02-12 17:11:16 +00:00
Eric Engestrom
759496cc45 lima: replace custom code with u_pipe_screen_lookup_or_create()
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
2023-02-12 17:11:16 +00:00
Eric Engestrom
e17c3af593 freedreno: replace custom code with u_pipe_screen_lookup_or_create()
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
2023-02-12 17:11:16 +00:00
Eric Engestrom
013f05872c gallium: move etnaviv screen_lookup_or_create function to common code
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
2023-02-12 17:11:16 +00:00
Eric Engestrom
1dea6aea20 etnaviv: use simple_mtx to avoid breaking windows in the next commit
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
2023-02-12 17:11:16 +00:00
Eric Engestrom
a72035f9c5 util: avoid calling kcmp on Android
On some combinations of Android version and kernel version, calling kcmp
results in seccomp killing the process.

As there doesn't seem to be a way to query for that in advance, skip
this check altogether on Android.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
2023-02-12 17:11:16 +00:00
Eric Engestrom
0d6c240fcc gallium/u_screen.h: add missing stdint.h include
For uint64_t.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
2023-02-12 17:11:16 +00:00
Hans-Kristian Arntzen
e40ed0f88b radv: Implement VK_ACCESS_2_DESCRIPTOR_BUFFER_READ_BIT_EXT.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Fixes: 46e0c77 ("radv: implement VK_EXT_descriptor_buffer")
Co-authored-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/21271>
2023-02-12 15:45:52 +00:00
Hans-Kristian Arntzen
7efabfbbe4 radv: Fix missing VK_ACCESS_2_SHADER_SAMPLED_READ_BIT.
Cannot be used for SSBO, so ignore SCACHE invalidation.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Fixes: 8df17163c7 ("radv: implement vkCmdWaitEvents2KHR")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21271>
2023-02-12 15:45:52 +00:00
Hans-Kristian Arntzen
97aa8d9547 radv: Fix invalid 64-bit shift.
For sync2 bits, overflow can happen.
Use BITFIELD64_BIT to align with ANV.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Fixes: 8df17163c7 ("radv: implement vkCmdWaitEvents2KHR")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21271>
2023-02-12 15:45:52 +00:00
Michel Dänzer
49a6bdde8e glsl/standalone: Do not pass memory allocated with ralloc_size to free
Pointed out by GCC:

In function ‘load_text_file’,
    inlined from ‘standalone_compile_shader’ at ../src/compiler/glsl/standalone.cpp:491:38,
    inlined from ‘main’ at ../src/compiler/glsl/main.cpp:98:45:
../src/compiler/glsl/standalone.cpp:358:17: error: ‘free’ called on pointer ‘block_195’ with nonzero offset 48 [-Werror=free-nonheap-object]
  358 |             free(text);
      |                 ^
In function ‘ralloc_size’,
    inlined from ‘load_text_file’ at ../src/compiler/glsl/standalone.cpp:352:31,
    inlined from ‘standalone_compile_shader’ at ../src/compiler/glsl/standalone.cpp:491:38,
    inlined from ‘main’ at ../src/compiler/glsl/main.cpp:98:45:
../src/util/ralloc.c:117:18: note: returned from ‘malloc’
  117 |    void *block = malloc(align64(size + sizeof(ralloc_header),
      |                  ^

Fixes: a9696e79fb ("main: Close memory leak of shader string from load_text_file.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21215>
2023-02-12 15:13:04 +00:00
Michel Dänzer
bf67f32d4b glsl/standalone: Fix up _mesa_reference_shader_program_data signature
Drop the unused ctx parameter, to match the main Mesa code.

Fixes ODR violation flagged by -Wodr with LTO enabled:

../src/mesa/main/shaderobj.h:74:1: error: ‘_mesa_reference_shader_program_data’ violates the C++ One Definition Rule [-Werror=odr]
   74 | _mesa_reference_shader_program_data(struct gl_shader_program_data **ptr,
      | ^
../src/compiler/glsl/standalone_scaffolding.cpp:76:1: note: type mismatch in parameter 1
   76 | _mesa_reference_shader_program_data(struct gl_context *ctx,
      | ^
../src/compiler/glsl/standalone_scaffolding.cpp:76:1: note: ‘_mesa_reference_shader_program_data’ was previously declared here
../src/compiler/glsl/standalone_scaffolding.cpp:76:1: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used

Fixes: 717a720e9c ("mesa: drop unused context parameter to shader program data reference.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21215>
2023-02-12 15:13:04 +00:00
Rob Clark
c0bc0ecf9e freedreno: Avoid screen lock when no rsc tracking needed
In case there is no dirty state that requires resource tracking we
can skip taking the screen lock.  Indirect draw and index buffer are
a special case, but we can inexpensively check if they are already
referenced by the batch.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21202>
2023-02-11 16:36:38 +00:00
Rob Clark
b70ea03302 freedreno: Add FD_DIRTY_QUERY
Replace update_active_queries, which was really just a dirty-bit in
disguise.  This also lets us associate it with FD_DIRTY_RESOURCE so
we can skip the associated resource tracking when it isn't dirty.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21202>
2023-02-11 16:36:37 +00:00
Rob Clark
3a98822cc7 freedreno: Remove impossible NULL check
All gens implement query support now.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21202>
2023-02-11 16:36:37 +00:00
Rob Clark
918caaad59 freedreno: Move num_vertices calc to backend
Only used by a2xx and a3xx backends, so move it there.

Also make it more clear that fd6_emit::draw is only used in the
driver-params case.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21202>
2023-02-11 16:36:37 +00:00
Rob Clark
b15aaea1d5 freedreno/a6xx: Move num_driver_params to program state
No need to re-calculate this at draw time.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21202>
2023-02-11 16:36:37 +00:00
Bas Nieuwenhuizen
0a17c3afc5 nir: Apply a maximum stack depth to avoid stack overflows.
A stackless (or at least using allocated memory for stack) version
might be nice but for now this works around some games compiling
large shaders and hitting stack overflows.

CC: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21231>
2023-02-11 15:01:42 +01:00
Jesse Natalie
7ead717393 dzn: Enable 16bit types when supported
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
d7f9e2db59 dzn: Get options4
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
08fc7315c5 dzn: Delete unused extensions table
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
cc906c0eed dzn: Enable get_surface_capabilities2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
a7d4309234 spirv2dxil: Support 16bit types
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
536ab16bc1 spirv2dxil: Move shader model into runtime conf struct
We'll want to use it to control the shape of the nir that we generate

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
4c527f4fc0 spirv2dxil: Lower unaligned loads and stores
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
9e2683c6f0 spirv2dxil: Set min UBO/SSBO alignments
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
58e7acb0e2 microsoft/compiler: Support lowering SSBO accesses to 16bit vectors
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
0f56fc09d9 microsoft/compiler: Support raw buffer load/store intrinsics with 16bit alignment
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
196dc72838 microsoft/compiler: Handle 48-bit stores to SSBO/shared
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
c994c8b3fd microsoft/compiler: Pass an alignment to constant buffer load lowering
This means we can stop doing conditionals and shifts if we know the
alignment of a load for a small amount of data.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
7fcb60be37 microsoft/compiler: Simplify bitpacking for load/store lowering with nir_extract_bits
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
7830901751 microsoft/compiler: Pass deref modes to unaligned pass and handle push const
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
facd2e4fdb microsoft/compiler: Move unaligned load/store pass from CL
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
f50843fcdb microsoft/compiler: Handle undef-rounding f2f16 as rtz
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
8782a0b8df microsoft/compiler: Ensure native_low_precision is set for 16-bit bitcasts/stores
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
4d76d46c13 microsoft/compiler: Handle frcp for float16/float64
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
ed13c2261c microsoft/compiler: Handle struct consts in DXIL module dumper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
25ee07373c nir_lower_fp16_casts: Allow opting out of lowering certain rounding modes
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
c0c2b60f1d nir: Add alignment to load_push_constant
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
42267588d7 ci/windows: Update LLVM to 15
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21168>
2023-02-11 05:24:08 +00:00
Jesse Natalie
e9ab33c9a1 microsoft/clc: Set features that are used by CL tests
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21168>
2023-02-11 05:24:08 +00:00
Jesse Natalie
b27d8ee2e9 clc: Include opencl-c-base.h with LLVM 15 (using builtins)
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21168>
2023-02-11 05:24:08 +00:00
Jonathan Marek
dda35e616b turnip: fix use of align() instead of util_align_npot() with tile_align_w
tile_align_w isn't always a power of two.

Fixes: aae679e221

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21251>
2023-02-11 04:56:52 +00:00
Karol Herbst
cb611b207d rusticl/icd: Make it work in case Rustc shuffles struct around
Nothing guarentees fields are in order or anything like that. So do proper offset math

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21242>
2023-02-11 04:13:57 +00:00
Karol Herbst
f6c5cd33b0 rusticl/util: extract offset_of macro
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21242>
2023-02-11 04:13:57 +00:00
Faith Ekstrand
af9212dd82 nir/deref: Preserve alignments in opt_remove_cast_cast()
This also removes the loop so opt_remove_cast_cast() will only optimize
cast(cast(x)) and not cast(cast(cast(x))).  However, since nir_opt_deref
walks instructions top-down, there will almost never be a tripple cast
because the parent cast will have opt_remove_cast_cast() run on it.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21252>
2023-02-10 23:08:19 +00:00
Sviatoslav Peleshko
9b2ddd2c5e anv: Handle VkAccelerationStructureBuildRangeInfoKHR::transformOffset
Previously it was not actually handled. This meant that all geometries
with the same transform buffer were using the same (first) transformation
matrix.

Fixes: f3ddfd81 ("anv: Build BVHs on the GPU with GRL")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7575
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21227>
2023-02-10 21:27:14 +00:00
Marcin Ślusarz
465c241266 intel/compiler/mesh: use U888X packed index format
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20910>
2023-02-10 21:03:33 +00:00
Danylo Piliaiev
2d20564a6a turnip: Disable draw states after dyn renderpass in all cases
Draw states were not disabled after a dynamic renderpass which
spans several command buffers, the next renderpass if started in
the same command buffer wouldn't emit the full draw state,
since TU_CMD_DIRTY_DRAW_STATE was not set by previous renderpass.

The issue could be observed when corrupting all regs at cmdbuf start in:
 dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed7_geometry

Fixes: cb0f414b2a
("tu: Add support for suspending and resuming renderpasses")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21148>
2023-02-10 20:29:40 +00:00
Danylo Piliaiev
855fa78866 turnip: Ensure that there is no renderpass rotation in binning
It appears that A6XX_GRAS_SC_CNTL::rotation applies to the binning,
so we should ensure there is no unexpected rotations and apply with
A6XX_GRAS_SC_CNTL during the binning pass.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21148>
2023-02-10 20:29:40 +00:00
Danylo Piliaiev
43ea1f2dfb freedreno: Document A6XX_GRAS_SC_CNTL::rotation field
Likely used for VK_QCOM_render_pass_transform.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21148>
2023-02-10 20:29:40 +00:00
Danylo Piliaiev
388e4ea733 tu: Prevent using stale value of GRAS_SC_CNTL in sysmem clear
cc: mesa-stable

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21148>
2023-02-10 20:29:40 +00:00
Danylo Piliaiev
981f1d88a1 tu: Prevent using stale value of RB_UNKNOWN_88D0 on BLIT
Fixes: def56b531c
("tu: Support GMEM with layered rendering and multiview")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21148>
2023-02-10 20:29:40 +00:00
Amber
99fb770c45 freedreno: use blendcoherent to set FLUSH_PER_OVERLAP
FLUSH_PER_OVERLAP is only necessary for gmem if coherent blending is
enabled.

Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21161>
2023-02-10 20:01:43 +00:00
Amber
527a74cb5d gallium: make BlendCoherent usable from gallium drivers
Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21161>
2023-02-10 20:01:43 +00:00
Amber
40bdd2bbf7 freedreno: use A6XX_GRAS_SC_CNTL_SINGLE_PRIM_MODE with fb readback
fixes:
dEQP-GLES31.functional.blend_equation_advanced.msaa.*

Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21161>
2023-02-10 20:01:43 +00:00
Mike Blumenkrantz
cd446b87e1 zink: add newlines to some debug printfs
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21239>
2023-02-10 19:42:53 +00:00
Väinö Mäkelä
13f68bcce1 hasvk: Tell spirv_to_nir float controls are always supported
This gets rid of the "Unsupported SPIR-V capability" warnings when
compiling shaders using float controls on gfx7.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20232>
2023-02-10 16:34:01 +00:00
Väinö Mäkelä
6f932276c3 hasvk: Don't claim shaderDenormPreserveFloat32 on gfx7
From the Haswell PRM Vol. 7, "IEEE Floating Point Mode":
     "Single precision (F, Float) denorms are flushed to sign-preserved
      zero on input and output of any floating-point mathematical
      operation."

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20232>
2023-02-10 16:34:01 +00:00
Väinö Mäkelä
56667002fd intel/vec4: Don't optimize multiply by 1.0 away
The SPIR-V compiler's implementation of tanh generates a multiply by 1.0
to flush denorms to zero.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20232>
2023-02-10 16:34:01 +00:00
Väinö Mäkelä
dcad4a2cd1 intel/vec4: Set the rounding mode
The rounding mode only needs to be set once, because 16-bit floats or
preserving denorms aren't supported for the platforms where vec4 is
used.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20232>
2023-02-10 16:34:00 +00:00
Eric Engestrom
5a2326f9b2 panfrost: drop no-longer-needed libglsl
Fixes: 551c2aadd4 ("pan/bi: Remove standalone compiler")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21240>
2023-02-10 14:09:37 +00:00
Samuel Pitoiset
bd30f3619d radv: implement graphics shaders relocation for a RGP workaround
RGP requires shaders to be uploaded consecutively inside the same
buffer object. Otherwise, either it makes the driver generating
huge traces (ie. in GiB) or it fails to load traces at all. Hopefully,
this will be improved soon when AMDGPU drivers will have GPL support.

To workaround this, the driver relocates graphics shaders in the same
buffer object when a pipeline is created. Then at draw time, it
overwrites SPI_SHADER_PGM_xxx registers to make sure SQTT can match
between emitted and exported shaders. It's a bit suboptimal because
graphics shaders are uploaded twice but it's the best solution I found.

This will allow to implement GPL caching without breaking capturing
shaders with RGP.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21078>
2023-02-10 13:42:14 +00:00
Samuel Pitoiset
69bd1c0c40 radv: restore uploading shaders individually instead of consecutively
The shaders were uploaded consecutively to fit a RGP constraint but
this was more like a workaround. This upload path doesn't work well for
graphics pipeline library and it was the main blocker for GPL caching.

This commit breaks capturing shaders with RGP if the offset between
shaders is too big. Next commit should fix it by using shaders reloc.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21078>
2023-02-10 13:42:14 +00:00
Georg Lehmann
533d0008c7 aco: remove stale TODOs about v_interp opsel
These are already handled correctly according to the ISA docs.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21096>
2023-02-10 12:01:56 +00:00
Philipp Zabel
f29f656530 vulkan/wsi/wayland: fix acquire_next_image to report timeouts properly
The Vulkan Specification states about possible return values from
vkAcquireNextImageKHR:

 * VK_NOT_READY is returned if timeout is zero and no image was
   available.
 * VK_TIMEOUT is returned if timeout is greater than zero and less than
   UINT64_MAX, and no image beae available within the time allowed.

That is, if info->timeout is larger than zero, the function must return
VK_TIMEOUT instead of VK_NOT_READY if no image became available before
the timeout elapsed.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21190>
2023-02-10 11:32:54 +00:00
Samuel Pitoiset
75ccf7c003 radv/ci: bump the number of runners to 3 for vkcts-navi21-valve
RADV_PERFTEST=gpl increased execution time, so let's try with a 3d
runner.

dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
seems reliably fixed now for some reasons.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21214>
2023-02-10 11:06:54 +01:00
Samuel Pitoiset
6533709d10 radv/ci: set RADV_PERFTEST=GPL for all VKCTS jobs
The Vulkan CTS version in Mesa CI is so old that a bunch of tests
are broken, but it's expected.

This runs +283939 tests and the overall VKCTS execution time increased
from ~23 minutes to ~26 minutes (+~13%) on my Threadripper 1950X.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21214>
2023-02-10 11:06:54 +01:00
Pavel Ondračka
94eff7ccd8 nir: shrink phi nodes in nir_opt_shrink_vectors
While this change helps with few shaders, the main benefit is
that it allows to unroll loops comming from nine+ttn on vec4
backends. D3D9 REP ... ENDREP type loops are unrolled now already,
LOOP ... ENDLOOP need some nine changes that will come later.

r300 RV530 shader-db:
total instructions in shared programs: 132481 -> 132344 (-0.10%)
instructions in affected programs: 3532 -> 3395 (-3.88%)
helped: 13
HURT: 0

total temps in shared programs: 16961 -> 16957 (-0.02%)
temps in affected programs: 88 -> 84 (-4.55%)
helped: 4
HURT: 0

Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Partial fix for: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8102
Partial fix for: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7222

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21038>
2023-02-10 09:06:25 +00:00
Samuel Pitoiset
2a008018c1 docs: stop reporting RADV_PERFTEST=gpl as experimental/suboptimal
The graphics pipeline library implementation in RADV has been
improved considerably lately.

There is still a bit of work for caching individual libraries
and optimized (LTO) pipelines but I think overall it seems good
enough to stop reporting it as experimental and suboptimal.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21213>
2023-02-10 07:59:12 +00:00
Yonggang Luo
09061e2fe9 vulkan: Use static_assert for check HWVULKAN_DISPATCH_MAGIC == ICD_LOADER_MAGIC
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21210>
2023-02-10 07:21:31 +00:00
Chia-I Wu
af7bcc0cdc freedreno: avoid conditional ib in fd6_emit_tile
CP_REG_TEST (or any command that reads registers) is slow on a618
(gen1).  Since SQE can early return, we don't necessarily need
emit_conditional_ib in fd6_emit_tile.

We still CP_REG_TEST twice for load and store when there is no clear.
Not sure if we can simply drop emit_conditional_ib instead?

glmark2 score goes from 943 to 1067.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21208>
2023-02-10 06:31:47 +00:00
Patrick Lerda
b2c340c106 mesa/st: fix possible crash related to arb invalid memory access
This invalid memory access is a consequence of wrong assumptions,
for instance:
"prog->sh.data is NULL if it's ARB_fragment_program"

This issue is triggered with piglit/fp-formats -auto -fbo:
==9747==ERROR: AddressSanitizer: heap-use-after-free on address 0x007f7c812d90 at pc 0x007f833c09f8 bp 0x007fd7eca750 sp 0x007fd7eca768
READ of size 4 at 0x007f7c812d90 thread T0
    #0 0x7f833c09f4 in st_get_sampler_views ../src/mesa/state_tracker/st_atom_texture.c:109
    #1 0x7f833c0b48 in update_textures ../src/mesa/state_tracker/st_atom_texture.c:266
    #2 0x7f82b2d120 in st_validate_state ../src/mesa/state_tracker/st_util.h:128
    #3 0x7f82b2d120 in prepare_draw ../src/mesa/state_tracker/st_draw.c:88
    #4 0x7f82b2de64 in st_draw_gallium ../src/mesa/state_tracker/st_draw.c:141
    #5 0x7f83105940 in _mesa_draw_arrays ../src/mesa/main/draw.c:1202
    #6 0x7f8d5fa5cc in piglit_draw_rect_from_arrays piglit/tests/util/piglit-util-gl.c:711
    #7 0x7f8d5fac34 in piglit_draw_rect_custom piglit/tests/util/piglit-util-gl.c:833
    #8 0x4019e0 in piglit_display piglit/tests/shaders/fp-formats.c:67
    #9 0x7f8d643fc4 in run_test piglit/tests/util/piglit-framework-gl/piglit_fbo_framework.c:52
    #10 0x401624 in main piglit/tests/shaders/fp-formats.c:39

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21175>
2023-02-10 04:45:29 +00:00
Chia-I Wu
620baf9c42 freedreno/registers: document more bits of CP_REG_TEST
On gen3+, there are 32 predicate bits instead of 1.

I set out to see why CP_REG_TEST (and others commands that read
registers) is slower on gen1 but could not find anything.  Since the
blob seems to use multiple predicate bits, let's keep them documented.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21206>
2023-02-10 04:12:08 +00:00
Chia-I Wu
0278462575 turnip: skip unnecessary CP_REG_TEST for cond load/store
When no attachment allows conditional load/store, skip the unnecessary
CP_REG_TEST.

This is done to avoid a performance trap on a618 (gen1).  CP_REG_TEST or
any command that reads a register is slow on a618.

glmark2 score goes from 830 to 1001.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8162
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21206>
2023-02-10 04:12:08 +00:00
Chia-I Wu
37f6714fe7 turnip: add a comment to tu_render_pass_cond_config
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21206>
2023-02-10 04:12:08 +00:00
Mike Blumenkrantz
487ac6dbd6 zink: implement cross-program pipeline library sharing
some games/apps (e.g., DOOM2016) compile+link shaders in one context
and then use them in another, expecting that the compiled shaders
will be reused. vulkan has pipeline (library) objects, which are not
specific to shaders but are in theory representing the shaders being used

thus, pipeline (library) objects need to be reusable for any case where
a shader can be reused

to handle this:
* extract pipeline library cache to a refcounted object
* store these objects on the screen
* make them owned by shaders

separable programs are slightly different since they'll use their own
fastpath, thus making their library caches owned by the programs to avoid
polluting the optimized caches

fixes #8264

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21223>
2023-02-10 03:53:46 +00:00
Mike Blumenkrantz
b282761839 zink: break out zink_gfx_program::libs into refcounted object
no functional changes yet, and these are still 1:1 with their programs

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21223>
2023-02-10 03:53:46 +00:00
Mike Blumenkrantz
6482cf12ca zink: store gfx_hash on zink_gfx_program
this avoids needing to reference ctx->gfx_hash in threads or recalc the hash

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21223>
2023-02-10 03:53:46 +00:00
Ian Romanick
18fc4daaf6 nir/inline_uniforms: Add inot condition support
From the 96c19d23c9 commit message:

    Ever since 4246c2869c and 7d85dc4f35 loop unrolling can no
    longer depend on inot being eliminated from the loop
    terminator condition so we need to be able to handle it.

Support these conditions here too.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21179>
2023-02-10 03:18:23 +00:00
Ian Romanick
682e83f012 nir/inline_uniforms: Make add_inlinable_uniforms public
This is step 5 in an attempt to unify a bunch of nir_inline_uniforms.c
and lvp_inline_uniforms.c code.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21179>
2023-02-10 03:18:23 +00:00
Ian Romanick
cdd23b1efa nir/inline_uniforms: Make src_only_uses_uniforms public, change name
While making the function public, rename it to
nir_collect_src_uniforms. The old name makes it sound like it's just a
query that doesn't have side effects. That is, however, not the case.

This is step 4 in an attempt to unify a bunch of nir_inline_uniforms.c
and lvp_inline_uniforms.c code.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21179>
2023-02-10 03:18:23 +00:00
Ian Romanick
edb89b71c5 nir/inline_uniforms: Allow possibility of uni_offsets and num_offsets being NULL
This is step 3 in an attempt to unify a bunch of nir_inline_uniforms.c
and lvp_inline_uniforms.c code.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21179>
2023-02-10 03:18:23 +00:00
Ian Romanick
0c0fb216dd nir/inline_uniforms: Allow possibility of more than one UBO
Only caller in this file still only passes 1.

This is step 2 in an attempt to unify a bunch of nir_inline_uniforms.c
and lvp_inline_uniforms.c code.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21179>
2023-02-10 03:18:23 +00:00
Ian Romanick
23b4266f9e nir/inline_uniforms: Pass max_num_bo and max_offset around as parameters
max_num_bo is currently limited to 1. That will change in the next
commit.

This is step 1 in an attempt to unify a bunch of nir_inline_uniforms.c
and lvp_inline_uniforms.c code.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21179>
2023-02-10 03:18:23 +00:00
Ian Romanick
1d5033823e nir/inline_uniforms: Change num_offsets type to uint8_t
This is step 0 in an attempt to unify a bunch of nir_inline_uniforms.c
and lvp_inline_uniforms.c code.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21179>
2023-02-10 03:18:23 +00:00
Emma Anholt
6b6f757e23 ci/crocus: Update HSW expectations.
2 good-looking trace updates, one new crash.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21205>
2023-02-10 02:53:09 +00:00
Emma Anholt
b01c3553f7 ci/radv: Update navi21 llvm xfails.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21205>
2023-02-10 02:53:09 +00:00
Emma Anholt
9adfe49563 ci/nouveau: Disable the gm20b jobs entirely.
The old (broken, hw failure) board isn't really hooked up right now, and
I'm waiting on buying some remaining bits to set up the 10 boards sitting
in the box here.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21205>
2023-02-10 02:53:09 +00:00
Emma Anholt
ba73aaa0da ci/freedreno: Update a3xx piglit_shader xfails.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21205>
2023-02-10 02:53:09 +00:00
Emma Anholt
e182970692 ci/freedreno: Add an xfail for a618 VK full run.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21205>
2023-02-10 02:53:09 +00:00
Emma Anholt
a8a6be1641 ci/freedreno: Update a530 manual-run xfails.
A lot of this looks like fractional run test list updates.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21205>
2023-02-10 02:53:09 +00:00
Emma Anholt
e267d72979 ci/freedreno: Disable the a306_piglit_gl job.
It's broken with recurring hangchecks.  Someone would need to restabilize
it, but turn it off for anyone to find until someone (me? :( ) cares.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21205>
2023-02-10 02:53:09 +00:00
Emma Anholt
238fcd30ed ci/zink: Update TGL full-run xfails.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21205>
2023-02-10 02:53:09 +00:00
Emma Anholt
1a862c74bc ci: Disable systems in my farm that haven't recovered.
We lost power in a storm, and these ones didn't come back afterwards.  I
suspect I need a new PSU.  And maybe some surge protection for the future.
:(

I've left the CI code in place for some day when I hopefully swap out the
power supplies.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21205>
2023-02-10 02:53:09 +00:00
Nanley Chery
2e13456bca mesa/st: Measure compressed fallback unmap paths
Add code to help find performance issues. The logging is disabled by
default.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19827>
2023-02-10 01:40:47 +00:00
Nanley Chery
fdabf886be mesa/st: Enable compute-based transcoding to DXT5
By enabling this path, we get a 56% decrease in upload time on a texture
upload microbenchmark. This was measured on an Ice Lake with an iris
driver that tries to use the compressed format fallback path.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19827>
2023-02-10 01:40:47 +00:00
Nanley Chery
6d57614fd0 mesa/st: Add st_texture_image_resource_level
Returns the level of the gl_texture_image with respect to the resource
it's allocated within. Example: returns 0 for non-finalized texture.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19827>
2023-02-10 01:40:47 +00:00
Nanley Chery
637ff22413 mesa/st: Add st_compute_transcode_astc_to_dxt5
Add a function to upload ASTC data, transcoding it to BC3/DXT5 in the
process.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19827>
2023-02-10 01:40:47 +00:00
Nanley Chery
1f8f1a0d9b mesa/st: Add and use create_bc1_endpoint_ssbo
Create and cache the SSBO used by the BC1 compute shader program.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19827>
2023-02-10 01:40:47 +00:00
Nanley Chery
bab950a4ac mesa/st: Add get_compute_program
Add a function to create and cache the compute programs that will be
used to transcode ASTC to DXT5.

Note that the error paths in st_create_context_priv may actually lead to
segfaults if hit. I've been able to work around them by 1) moving them
further down and 2) returning early from st_glFlush if st->pipe is NULL.
I don't know if that's the right solution however.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19827>
2023-02-10 01:40:47 +00:00
Nanley Chery
c4a6176d19 mesa: Create _mesa_CreateShaderProgramv_impl
Factor out the implementation of _mesa_CreateShaderProgramv so that we
can make programs that will encode DXT5.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19827>
2023-02-10 01:40:47 +00:00
Nanley Chery
cb296db853 glsl: Modify the #includes in the DXT5 shaders
1. Drop the commented out includes. Shader caching is disabled if those
   are found.

2. Replace the active includes with "%s". Later on, we'll construct the
   final strings with vasprintf. One downside to doing this is that the
   glsl file extensions are no longer true. These files are now
   templates.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19827>
2023-02-10 01:40:47 +00:00
Nanley Chery
96cb3ba424 glsl: Add compute shaders to encode DXT5/BC3
These compute shaders are from the MIT-licensed GPU compressor, Betsy.
I have included copyright headers, inlined the __sharedOnlyBarrier macro
definition from the "UavCrossPlatform_piece_all.glsl" header when
applicable, and made the following changes to support GLES:

   * Conditionally disable the const keyword in the BC3 shaders
   * Make the params uniform in the BC4 shader uint2
   * Avoid implicit data type conversions in the BC3 shaders
   * Use constructors for array initialization in the BC1 shader
   * Add precision qualifiers to the BC3 shaders
   * Output to an rgba16ui image for the BC1 and BC4 shaders
   * Set the version of the BC3 shaders to 310 es

Ref: https://github.com/darksylinc/betsy/tree/cc723dcae9
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19827>
2023-02-10 01:40:47 +00:00
Nanley Chery
0a5a54b81a docs: Document the implicit barriers around blits
We're going to use resource_copy_region to copy from a resource that has
been written to with imageStore. Make it clear that this is safe.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19827>
2023-02-10 01:40:47 +00:00
Dave Airlie
6043f66dd3 crocus: disable Y tiling for render targets properly.
The old code would disallow linear targets as well which would confuse
things with reimporting dma-bufs.

Fixes: 32728dc66e ("crocus: introduce main resource configuration helper.")
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21209>
2023-02-10 01:25:42 +00:00
Tapani Pälli
db6c374919 iris: disable preemption for 3DPRIMITIVE during streamout
This is required by Wa_16013994831.

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/19947>
2023-02-09 21:40:10 +02:00
Lionel Landwerlin
ebc4893947 intel/fs: fix mesh indirect movs
The size in src[2] is in byte and needs to cover any possible data
accessed in src[0] by the indirection. That way the register
allocation is aware of what cannot be spilled for the instruction to
execute on valid data.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 70ace2bbcd ("intel/compiler: Implement Task Output and Mesh Input")
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21188>
2023-02-09 15:35:55 +00:00
Mike Blumenkrantz
dc91f2c71b zink: set PIPE_CAP_SURFACE_REINTERPRET_BLOCKS
this fixes perf for CompressedTexSubImage and makes DOOM2016 run at full speed

ref #8223

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21218>
2023-02-09 09:54:27 -05:00
Mike Blumenkrantz
e3b746e3a3 zink: use GPL to handle (simple) separate shader objects
apps/games using separate shader objects end up passing the separable
shaders to the link_shader hook individually, which is still not ideal for
zink's usage since the more optimal path is to have all the shaders and create
a RAST+FS GPL stage that can run all the inter-stage io handlers

it IS technically possible to handle this for simple VS+FS pipelines using
GPL, however, but it's kinda gross. such shaders now use descriptor buffer
to create their own pipelines/layouts/descriptors async, and then a "separable"
variant of the gfx program can be created by fast-linking these together

the "separable" gfx program can't handle shader variants, but it can do basic
pipeline caching for PSO state changes, which makes it flexible enough to sorta
kinda maybe handle the most basic cases of separate shader objects

descriptor buffer is used because having to create and manage a separate architecture
for sets/pools/templates is too nightmarish even for me

this is, at best, a partial solution, but it's the best the vulkan api can
currently do

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21197>
2023-02-09 13:57:50 +00:00
Mike Blumenkrantz
60b26a6b1f zink: enable combining intermediate gpl libs from combine function
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21197>
2023-02-09 13:57:50 +00:00
Mike Blumenkrantz
ab69cba807 zink: move gpl input/output funcs to zink_pipeline.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21197>
2023-02-09 13:57:50 +00:00
Mike Blumenkrantz
4f8a548af1 zink: allow multiple gpl libraries in zink_create_gfx_pipeline_combined()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21197>
2023-02-09 13:57:50 +00:00
Mike Blumenkrantz
7efec7fb61 zink: add gpl flags for libraries based on shaders passed
no change to current operations

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21197>
2023-02-09 13:57:50 +00:00
Mike Blumenkrantz
983f30f8ba zink: split out gfx pipeline library creation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21197>
2023-02-09 13:57:50 +00:00
Mike Blumenkrantz
5ae973c7d3 zink: add flags param to zink_pipeline_layout_create()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21197>
2023-02-09 13:57:50 +00:00
Mike Blumenkrantz
bdb97b3f20 zink: split out VkShaderModule creation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21197>
2023-02-09 13:57:50 +00:00
Mike Blumenkrantz
36595e94c7 zink: avoid the descriptor set multiplier for bindless buffers
the bindless descriptor buffer is already correctly sized, so it needs
to avoid the huge set multiplier or it'll explode all available vram

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21216>
2023-02-09 08:08:22 -05:00
Mike Blumenkrantz
f14571e393 zink: flag bindless_init before calling zink_batch_bind_db() in init
this otherwise fails to bind the bindless buffer

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21216>
2023-02-09 07:49:22 -05:00
Samuel Pitoiset
1fdf6e140d docs: add missing RADV_PERFTEST=video_decode
Fixes: 9477f117f4 ("radv/video: add initial frameworking.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21158>
2023-02-09 12:05:26 +00:00
Tatsuyuki Ishi
9fdc145ad6 radv: Assert the hardware support rbplus when emitting rbplus state.
If someone forget to check for rbplus before setting dirty bits, it's going
to cause really mysterious bugs.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21189>
2023-02-09 08:32:20 +00:00
Tatsuyuki Ishi
a36efe3e19 radv: Fix missing rbplus_allowed check for dynamic PS epilogs.
This created really mysterious bugs on gfx10.

Fixes flickering in a bunch of DXVK games, most visibly Overwatch 2.

Fixes: eb07a11b8f ("radv: add support for compiling PS epilogs on-demand")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8258
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21189>
2023-02-09 08:32:20 +00:00
Samuel Pitoiset
46aee750c6 radv: stop skipping the cache for monolithic graphics pipelines with GPL
Only libraries and optimized (LTO) pipelines are still unsupported,
but there is no reason to skip the cache for monolithic pipelines.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21198>
2023-02-09 08:11:45 +00:00
Samuel Pitoiset
26896616c1 radv: stop skipping the cache for compute/raytracing pipelines with GPL
This was a hard solution somewhat.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21198>
2023-02-09 08:11:45 +00:00
Samuel Pitoiset
53cea404f7 radv: simplify creating a FS epilog from a library
It's now compiled in radv_graphics_pipeline_compile().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21140>
2023-02-09 07:48:03 +00:00
Samuel Pitoiset
06d17fccfb radv: make sure to disable MRT compaction when compiling a PS epilog with GPL
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21140>
2023-02-09 07:48:03 +00:00
Samuel Pitoiset
16e4dd3e37 radv: fix disabling MRT compaction for on-demand PS epilogs
Some dynamic states require to compile PS epilogs on-demand. In this
case, MRT compaction should be disabled because we don't know the CB
state when compiling the fragment shader.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21140>
2023-02-09 07:48:03 +00:00
Samuel Pitoiset
ea5c893289 radv: regroup PS epilog info when generating the graphics pipeline key
No logical change.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21140>
2023-02-09 07:48:03 +00:00
Samuel Pitoiset
84d006ef11 radv: simplify determining when the fragment shader needs an epilog
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21140>
2023-02-09 07:48:03 +00:00
Samuel Pitoiset
b41c6c3a50 radv: cleanup graphics pipeline library flags uses
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21140>
2023-02-09 07:48:03 +00:00
Samuel Pitoiset
7976316f3e radv: fix skipping graphics pipeline compilation when the FS is NULL
Fixes: 3eb97b9d33 ("radv: skip compilation when possible with GPL fast-linking")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21192>
2023-02-09 07:27:53 +00:00
Tapani Pälli
88cadf1454 intel/blorp: disable REP16 for gfx12+ with R10G10B10_FLOAT_A2
Cc: mesa-stable
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/21137>
2023-02-09 06:34:43 +00:00
Yonggang Luo
948f4e4d07 util: Fixes error: no previous prototype for 'mesa_cache_db_entry_remove'
Fixes: c92c99481f ("util/mesa-db: Support removal of cache entries")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21191>
2023-02-09 04:05:39 +00:00
Emma Anholt
a2fbd2fbd0 zink: Add tracing of blit operations.
I found this useful in lining up some perfetto traces between zink+anv and
iris, and understanding what was going on in them.  Also it's a demo of
being able to insert annotations for work in the command stream, which I
suspect we'll want more of.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20657>
2023-02-09 03:27:34 +00:00
Emma Anholt
4dc6390445 u_trace: Add an interface for checking trace enablement outside a context.
For zink, we want to know if we should pass command stream markers down to
the underlying driver, but we don't have our own trace context we're
recording trace events with.  We definitely want those markers if the
underlying driver is going to be doing perfetto tracing, or is requesting
marker tracing.  So, create an interface for querying those flags before
they get copied down to an actual u_trace_context.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20657>
2023-02-09 03:27:34 +00:00
José Roberto de Souza
fb6e65c72c hasvk: Remove remaining bits of anv_i915_query()
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20948>
2023-02-09 02:57:32 +00:00
José Roberto de Souza
5ecb8966b2 anv: Remove remaining bits of anv_i915_query()
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20948>
2023-02-09 02:57:32 +00:00
José Roberto de Souza
c8626a20bb anv: Start to move anv_gem_stubs.c to kmd backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20948>
2023-02-09 02:57:32 +00:00
José Roberto de Souza
de79cf0512 anv: Add basic KMD backend infrastructure
Functions that are in hot paths will have a different treatment to
support i915 and Xe KMD.

Each KMD will have an anv_kmd_backend that will have the hot path
functions set, this way we can avoid branch prediction misses.

Other functions will gradually be moved to anv_kmd_backend.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20948>
2023-02-09 02:57:32 +00:00
José Roberto de Souza
eaeda2107e anv: Use DRM_IOCTL_I915_GEM_CREATE_EXT in all supported kernels
As we continue to refactor the code base to support Xe KMD here I'm
dropping anv_gem_create() and unifying all graphics memory allocation
calls to anv_gem_create_regions().

anv_gem_create_regions() will call DRM_IOCTL_I915_GEM_CREATE_EXT
for integrated platforms too only leaving DRM_IOCTL_I915_GEM_CREATE
calls to kernel versions that do not support
DRM_IOCTL_I915_GEM_CREATE_EXT.
This can be detected by devinfo->mem.use_class_instance as
DRM_I915_QUERY_MEMORY_REGIONS uAPI landed in the same kernel version
as DRM_IOCTL_I915_GEM_CREATE_EXT.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20948>
2023-02-09 02:57:32 +00:00
José Roberto de Souza
099b9e5058 anv: Convert drm_i915_gem_memory_class_instance to intel_memory_class_instance
Also using pointers to intel_device_info struct instead of replicate
the same information.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20948>
2023-02-09 02:57:32 +00:00
José Roberto de Souza
9fc224631c intel: Add intel_memory_class_instance
This is a KMD independent struct to hold memory class and instance
values.

drm_i915_gem_memory_class_instance usage will be gradually replaced.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20948>
2023-02-09 02:57:32 +00:00
Emma Anholt
cc0b749890 ci/freedreno: Don't forget to report flakes on a618, too.
I just noticed that our flake reports are only coming from cheza, which is
a bummer because almost all the VK coverage is on a618 unless you're
kicking off a full run.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21092>
2023-02-09 02:13:39 +00:00
Amber
20d4c592c9 freedreno: make sure depth/stencil layouts are always tiled
Small depth/stencil textures were using linear tiling, but depth/stencil
attachments cannot use linear tiling for sysmem rendering.

Fixes:
 KHR-GL45.geometry_shader.layered_framebuffer.stencil_support
 KHR-GL45.geometry_shader.layered_framebuffer.depth_support

Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21046>
2023-02-08 22:55:52 +00:00
Eric Engestrom
885c315d10 docs: update calendar for 22.3.5
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21207>
2023-02-08 22:26:56 +00:00
Eric Engestrom
a0e1707b65 docs: add release notes for 22.3.5
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21207>
2023-02-08 22:26:56 +00:00
SoroushIMG
f7b2dbb2bd zink: relax bresenhamLines requirement for non-strictLine drivers
non-strictLine Vulkan drivers use either parallelogram or bresenham
rasterization for default line modes.
This method of rasterisation produces close enough results that it
in practice is GL/GLES spec compliant (at least cts wise).
Don't emit a feature missing warning for this case.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20985>
2023-02-08 22:00:43 +00:00
Rhys Perry
b4383821e7 aco: don't modify exec in p_interp_gfx11
The RDNA3 ISA docs say that lds_param_load write the entire quad
regardless of exec, so this isn't needed.

fossil-db (gfx1100):
Totals from 5291 (3.93% of 134574) affected shaders:
Instrs: 4891396 -> 4789628 (-2.08%)
CodeSize: 25519032 -> 25111960 (-1.60%)
Latency: 36122982 -> 36074300 (-0.13%); split: -0.14%, +0.00%
InvThroughput: 4162436 -> 4161424 (-0.02%); split: -0.02%, +0.00%
Copies: 263862 -> 263838 (-0.01%)
PreSGPRs: 225012 -> 224179 (-0.37%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-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/21171>
2023-02-08 19:35:54 +00:00
Georg Lehmann
6e4598f7b9 aco: support omod/imod for v_fmac_f16
Only matters for post-RA DPP16.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21174>
2023-02-08 18:52:28 +00:00
Georg Lehmann
2deda5c0be aco: don't list imod/omod support v_fmaak_f32/v_fmamk_f32
We can never use them anyway because these opcodes don't support VOP3/DPP16/SDWA

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21174>
2023-02-08 18:52:28 +00:00
Georg Lehmann
4c9ac73064 aco: allow output modifiers for ldexp_f16
It also supports imod for the first operand, but we cannot express that at
moment.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21174>
2023-02-08 18:52:28 +00:00
Georg Lehmann
b63aa2bb8e aco: don't allow output modifiers for v_cvt_pkrtz_f16_f32
Cc: mesa-stable
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21174>
2023-02-08 18:52:28 +00:00
Rob Clark
dc93033234 freedreno: Indent fixes
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21195>
2023-02-08 18:27:55 +00:00
Rob Clark
e9eee8781a freedreno/a2xx: Move pack_rgba()
It is only used in fd2_draw.c

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21195>
2023-02-08 18:27:55 +00:00
Rob Clark
e7f88c41c4 freedreno: Quiet unused variable warnings
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21195>
2023-02-08 18:27:55 +00:00
Rob Clark
eaf272aa93 ir3: Quiet unused variable warning
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21195>
2023-02-08 18:27:55 +00:00
Sil Vilerino
727afda21f d3d12: Video Encode - Fix ID3D12CommandAllocator leak
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21196>
2023-02-08 18:00:41 +00:00
Sil Vilerino
997b91fead d3d12: Video processing - Fix out of bounds array access
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21196>
2023-02-08 18:00:41 +00:00
Rob Clark
2c8c151591 freedreno/drm/virtio: Limit guest handles passed to virtgpu
We only need to have virtgpu in the loop for shared buffers when
implicit sync is in play.  The rest of the time we can rely on userspace
fence waits.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21143>
2023-02-08 17:36:23 +00:00
Rob Clark
53ba7d8867 freedreno/drm: Move sa_cpu_prep() to core
Now that we can do a blocking wait on an fd_fence (which the suballoc
heap already depended on) we can just move the fence wait into core
leaving the backend cpu_prep() implementation only needing to care
about implicit sync on shared buffers.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21143>
2023-02-08 17:36:23 +00:00
Rob Clark
dec49ec50a freedreno/a6xx: Move CS state to PROG state group
It is pretty easy to just cache the stateobj with the hwcso (since
unlike 3d, there is only a single shader state) and re-emit it by
pointer when it changes, now that the CS state doesn't depend on the
grid info.

This also moves immed consts into the PROG state, so they are only
updated when the PROG state is dirty.  And splits user consts and
driver param consts, so they are only re-emit when needed.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21127>
2023-02-08 16:59:40 +00:00
Matt Coster
7ea98091c1 pvr: Add firmware stream support for transfer submit
Move transfer jobs over to the new firmware stream interface. This had already
been done for render and compute jobs in 947e183ff5 ("pvr: Implement new
firmware stream interface").

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21163>
2023-02-08 16:33:35 +00:00
Sarah Walker
5a2618c73c pvr: Update FWIF transfer queue register structures
This matches changes made in FW 1.17.OS@6293467.

Signed-off-by: Sarah Walker <sarah.walker@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21163>
2023-02-08 16:33:35 +00:00
Michel Dänzer
0dd89dacf2 mesa/st: Handle all 10 bpc types in st_choose_format
Only GL_UNSIGNED_INT_2_10_10_10_REV was handled, add
GL_UNSIGNED_INT_10_10_10_2 & GL_UNSIGNED_INT_10_10_10_2_OES.

This makes sure that if the Gallium driver doesn't support the exact
corresponding format, another 10 bpc format is tried before an 8 bpc one
as a fallback.

Fixes the mutter test cogl-test-offscreen-texture-formats with iris.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21021>
2023-02-08 16:06:38 +00:00
Michel Dänzer
98526b7d48 mesa/st: Fix GL_EXT_texture_type_2_10_10_10_REV name in comment
Suggested by Adam Jackson in
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21021#note_1747761

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21021>
2023-02-08 16:06:37 +00:00
Lionel Landwerlin
6390953fa5 anv: put the video extension behind a variable
As initialized acked.

The WSI code is currently trying to blit on the video queue.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 633efa7af7 ("anv: enable video decode extensions.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21194>
2023-02-08 15:38:27 +00:00
Simon Perretta
81af999a75 pvr: Clarify unreachable text
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20430>
2023-02-08 15:15:17 +00:00
Simon Perretta
c13bed8bef pvr: Add block printing support during validation
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20430>
2023-02-08 15:15:17 +00:00
Simon Perretta
1bd84f4753 pvr: Validate instruction repeat and src/dst sizes
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20430>
2023-02-08 15:15:17 +00:00
Simon Perretta
8ac16c97cf pvr: Adjust instruction repeat offset
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20430>
2023-02-08 15:15:17 +00:00
Simon Perretta
d431adaecd pvr: Keep NIR SSA defs instead of registers
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20430>
2023-02-08 15:15:17 +00:00
Simon Perretta
d47d0ea101 pvr: Drop the ENUM_PACKED macro
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20430>
2023-02-08 15:15:17 +00:00
Simon Perretta
52bcb0e292 pvr: Commonise some instruction member defs
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20430>
2023-02-08 15:15:17 +00:00
Simon Perretta
e74aaa347b pvr: Support dual-destination ALU instructions
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20430>
2023-02-08 15:15:17 +00:00
Simon Perretta
6187f1fd8c pvr: Add support for optional instruction params
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20430>
2023-02-08 15:15:17 +00:00
Simon Perretta
d187418f63 pvr: Add new Rogue compiler framework
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20430>
2023-02-08 15:15:17 +00:00
Georg Lehmann
5038a049f1 aco: add mov/cndmask opcodes to does_fp_op_flush_denorms
For completeness sake also add v_mov_b32, even if we don't use imod for it
because it's only supported since gfx10.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21170>
2023-02-08 13:07:46 +00:00
Georg Lehmann
c8adf16278 aco: fix imod/omod for gfx11 VOP3 opcodes
Fixes: d8d99c3c4f ("aco: add GFX11 opcode numbers")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21170>
2023-02-08 13:07:46 +00:00
Mike Blumenkrantz
8f5a63ebfe util/vbuf: fix multidraw unrolling
* drawid needs to be incremented at end of loop
* rescope draw structs to initialize at top of loop

fix #8191

Fixes: 6b07893b31 ("util/vbuf: handle multidraws")

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Mark Janes <markjanes@swizzler.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21139>
2023-02-08 12:41:32 +00:00
Tatsuyuki Ishi
c6ebd2de71 radv: Fix noop FS not getting constructed for GPL pipelines.
The condition was inverted, causing compilation to be actually skipped when
a noop FS is used and straight emitting the pipeline from the default
initialized struct.

Fixes: 3eb97b9d33 ("radv: skip compilation when possible with GPL fast-linking")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21166>
2023-02-08 10:52:54 +00:00
Daniel Schürmann
e5600d5257 radv: CSE ray_launch_{size|id}
Stats for Q2RTX
Totals from 7 (0.01% of 134913) affected shaders: (GFX10.3)

VGPRs: 736 -> 704 (-4.35%)
CodeSize: 204424 -> 204400 (-0.01%); split: -0.03%, +0.02%
MaxWaves: 67 -> 69 (+2.99%)
Instrs: 37540 -> 37549 (+0.02%); split: -0.02%, +0.04%
Latency: 973556 -> 973267 (-0.03%)
InvThroughput: 209068 -> 200902 (-3.91%)
VClause: 920 -> 921 (+0.11%); split: -0.11%, +0.22%
SClause: 1045 -> 1043 (-0.19%)
Copies: 4853 -> 4865 (+0.25%); split: -0.08%, +0.33%
Branches: 1571 -> 1578 (+0.45%)
PreSGPRs: 421 -> 407 (-3.33%)
PreVGPRs: 638 -> 632 (-0.94%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21156>
2023-02-08 10:10:27 +00:00
Timur Kristóf
8ebb34ee57 radv: Refactor radv_emit_ngg_culling_state so it's based on dirty flags.
This significantly lowers the CPU overhead of this function.

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/20980>
2023-02-08 09:28:20 +00:00
Timur Kristóf
22947ef0cc radv: Remove NGG culling skip from command buffer.
This code used to runtime-disable NGG culling for small draw calls.
However, this had too much CPU overhead, let's remove it.
It will be solved by the shaders instead.

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/20980>
2023-02-08 09:28:19 +00:00
Timur Kristóf
88a4e17018 radv: Use shader code to skip NGG culling in small workgroups.
Extend RADV lowering of the load_cull_any_enabled_amd intrinsic to
take into account the number of primitives in the current workgroup.

Workgroups that have less than 16 triangles are considered "small"
and will disable shader culling. Note that LLPC does the same,
but it checks the number of vertices not primitives.

The primary intention of this change is to eliminate the need to
check the draw size in radv_cmd_buffer, but this is actually
beneficial to larger draw calls too, specifically this may improve
the performance of the last workgroup of larger draws too.

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/20980>
2023-02-08 09:28:19 +00:00
Timur Kristóf
def53a085c radv: Move checking primitive topology to radv_get_ngg_culling_settings.
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/20980>
2023-02-08 09:28:19 +00:00
Timur Kristóf
8457dfec47 radv: Don't change LDS_SIZE for NGG culling shaders.
There was no measurable perf benefit from this optimization,
and it made the code messy and difficult to refactor.

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/20980>
2023-02-08 09:28:19 +00:00
Sidney Just
ab87b19088 loader: Add missing brace to fix compile
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Fixes: 1a0ec8e8d3 ("loader,glx,egl,vl,d3d: loader_get_user_preferred_fd() function to return original_fd")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21115>
2023-02-08 08:49:57 +00:00
Dave Airlie
53283bc26d anv/video: fix video memory bindings.
A break snuck in here.

Fixes: 98c58a16ef ("anv: add initial video decode support for h264.")
Acked-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21184>
2023-02-08 06:42:09 +00:00
Chia-I Wu
d6fb4d8d7d freedreno/registers: correct WFM bit in CP_REG_TEST
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21151>
2023-02-08 06:17:12 +00:00
Yiwei Zhang
dda85cf94b venus: move exp features init back to use ring submit
Since largeRing has been enforced, there's no need to do renderer
submission to fill the exp features. So we move it back after ring has
been initialized. Meanwhile, vn_renderer_submit_simple_sync is
intentionally left there to be re-used soon for server ping purpose.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21153>
2023-02-08 05:34:13 +00:00
Yiwei Zhang
830c7a9f1a venus: render server enforces blob_id_0
Render server enforcement has guaranteed blob_id_0. Meanwhile, blob_id_0
has deprecated largeRing feature.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21153>
2023-02-08 05:34:13 +00:00
Yiwei Zhang
0938c1f7e2 venus: fix tracing init to include instance creation
The issue was hidden so far because:
- wsi_device_init does the perfetto tracing init
- Android atrace does lazy tracing init

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21153>
2023-02-08 05:34:13 +00:00
Yiwei Zhang
91b0ae93b2 venus: fix formating
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21153>
2023-02-08 05:34:13 +00:00
Patrick Lerda
66313732a7 mesa/program: fix memory leak triggered by parser errors
This change requires the %destructor directive which is supported
by bison or yacc, yacc needs to be compiled with the back-tracking
functionality.

This issue could be checked with the following piglit programs:
glsl-invalid-asm-01, glsl-invalid-asm-02 or vp-bad-program

Direct leak of 5 byte(s) in 1 object(s) allocated from:
    #0 0x7f8dc89050 in __interceptor_strdup (/usr/lib64/libasan.so.6+0x59050)
    #1 0x7f83791cbc in handle_ident ../src/mesa/program/program_lexer.l:129
    #2 0x7f83791cbc in _mesa_program_lexer_lex ../src/mesa/program/program_lexer.l:312
    #3 0x7f8377e8d8 in yylex ../src/mesa/program/program_parse.y:289
    #4 0x7f8377e8d8 in yyparse src/mesa/program/program_parse.tab.c:2124
    #5 0x7f83788c14 in _mesa_parse_arb_program ../src/mesa/program/program_parse.y:2584
    #6 0x7f8377371c in _mesa_parse_arb_fragment_program ../src/mesa/program/arbprogparse.c:82
    #7 0x7f8372d42c in set_program_string ../src/mesa/main/arbprogram.c:402

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21150>
2023-02-08 04:58:33 +00:00
Juston Li
3061ec366e venus: add SHADER_DEVICE_ADDRESS_BIT to buffer cache
VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT is being set by zink.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21177>
2023-02-08 04:14:42 +00:00
Chia-I Wu
4054b08f39 turnip: reorder tu6_format_*
This is cosmetic.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21117>
2023-02-08 03:26:05 +00:00
Chia-I Wu
6a76bd8d4c turnip: handle ubwc in blit_base_format
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21117>
2023-02-08 03:26:05 +00:00
Chia-I Wu
3c4eea2aab turnip: add blit_format_color and blit_base_format
Similar to blit_format_texture but for blit dst.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21117>
2023-02-08 03:26:05 +00:00
Chia-I Wu
75f601279b turnip: add blit_format_texture
The use of FMT6_8_8_8_8_UNORM for z24s8/z24x8 is for blit src.  Make
that clear by moving the logic from fd6_texture_format to the newly
added blit_format_texture.  Add a comment on why this is simpler than in
fdl6_view_init.

This should have no functional change in practice.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21117>
2023-02-08 03:26:04 +00:00
Chia-I Wu
659b2e56bd turnip: let tu6_format_vtx* take pipe format
For consistency with other tu6_format_* functions.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21117>
2023-02-08 03:26:04 +00:00
Chia-I Wu
41bf169a93 turnip: make tu6_format_*_supported static
They have no external user.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21117>
2023-02-08 03:26:04 +00:00
Chia-I Wu
f710911f2f turnip: remove tu_native_format::tile_mode
It is dead code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21117>
2023-02-08 03:26:04 +00:00
Chia-I Wu
de45fc8d80 turnip: move a comment about FMT6_Z24_UNORM_S8_UINT_AS_R8G8B8A8
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21117>
2023-02-08 03:26:04 +00:00
Chia-I Wu
273a01f43e turnip: add a comment to tu_format_for_aspect
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21117>
2023-02-08 03:26:04 +00:00
Dave Airlie
633efa7af7 anv: enable video decode extensions.
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20782>
2023-02-08 02:56:28 +00:00
Dave Airlie
76e8d015d8 anv/query: add query status report
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20782>
2023-02-08 02:56:28 +00:00
Dave Airlie
98c58a16ef anv: add initial video decode support for h264.
This just adds the files with the programming info, it doesn't
enable the extensions etc

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20782>
2023-02-08 02:56:28 +00:00
Dave Airlie
41caf3665c anv/image: allocate some memory for mv storage after video images.
these images need motion vector storage allocated with them

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20782>
2023-02-08 02:56:28 +00:00
Dave Airlie
bff627142d intel/genxml: add missing power well control bits
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20782>
2023-02-08 02:56:28 +00:00
Dave Airlie
cfc62802f8 intel/genxml: align some of the fields with the media driver
These values are taking from runtime interrogation of the media driver.

It would be nice to know if they are correct, but they work.

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20782>
2023-02-08 02:56:28 +00:00
Dave Airlie
3b110efccb anv/format: handle video extensions structs by ignoring them
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20782>
2023-02-08 02:56:28 +00:00
Dave Airlie
9361481780 anv: add video format features for the one supported video output format
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20782>
2023-02-08 02:56:28 +00:00
Dave Airlie
61618b0569 anv: set Y/4 tiling for video decode images
The video decode hw only works with Y/4 tiled images.

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20782>
2023-02-08 02:56:28 +00:00
Dave Airlie
056b0cb87f anv: add video engine support in various places
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20782>
2023-02-08 02:56:28 +00:00
Mike Blumenkrantz
faaf6f95cc zink: use screen indexing for bindless descriptor set in template bind
Fixes: 8636717270 ("zink: add a "compact" descriptor mode")

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:37 +00:00
Mike Blumenkrantz
7bd5122430 zink: use screen indexing for bindless descriptor set in db bind
Fixes: 99ba529fee ("zink: implement descriptor buffer handling of bindless texture")

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:37 +00:00
Mike Blumenkrantz
4cf54e2ed2 zink: fix gpl lib hashing
this was including the generated tcs bits, which was likely to be wrong
and thus break optimal key hashing, requiring more pipelines

it also wasn't setting the optimal key value correctly during precompile,
which meant the wrong hash value was used and the precompiled libs were never
actually accessible

cc: mesa-stable

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:37 +00:00
Mike Blumenkrantz
bbae237258 zink: set zs feedback loop bit from driver workaround on ctx create
this may otherwise not be set until the cache has been broken

Fixes: 56fb258064 ("zink: replace mixed_zs with zs feedback loops")

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:37 +00:00
Mike Blumenkrantz
0cb326cc74 zink: set gfx feedback loop bit in pipeline state for driver workaround
this needs to be set on context create or it may never get set

Fixes: 645f2da3fa ("zink: always set VK_PIPELINE_CREATE_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT sometimes")

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:37 +00:00
Mike Blumenkrantz
3ca3a26f9c zink: don't set blend_id with full_ds3
this no longer needs to be part of the pso hash

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
d584f320b8 zink: add VK_PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT for gpl libs
required by spec

Fixes: 7ab5c5d36d ("zink: use EXT_descriptor_buffer with ZINK_DESCRIPTORS=db")

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
7c021cc5f0 zink: add a define for testing that an optimal key is the default
tcs values here are ignored since they only matter for generated tcs

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
1f08a6dcdb zink: add a define for the "default" optimal key
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
9e0e6708ed zink: ralloc zink_shader structs
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
77d8cd9c07 zink: make last_vertex_stage the first bit in zink_vs_key_base
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
94d9d832f6 zink: delete zink_screen::framebuffer_cache
no longer used

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
115e0446dc zink: pass screen to descriptor_util_pool_key_get()
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
be8b7980e6 zink: store last pipeline directly for zink_gfx_program::last_pipeline
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
45ece56b75 zink: remove duplicated gpl output blend initializations
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
fa69db6e68 zink: move gpl usability checks to static inline for reuse
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
958c4d82d6 zink: const-ify a bunch of shader key inlines
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
5bba2eb13b zink: take screen param in init_db_template_entry()
ctx is no longer used

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
e132af9192 zink: move bindless_layout to screen and init on creation
this is more consistent with the actual usage

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
b9181c3218 zink: set PIPE_CAP_VALIDATE_ALL_DIRTY_STATES
failing to set this yields patterns like

* bind fs
* bind samplerviews
* draw
* bind fs2
* ~~unbind samplerviews~~ (eliminated)
* draw

the eliminated unbinding of samplerviews between draws also eliminates a descriptor update,
triggering various artifacts in certain corner cases (like DOOM2016 shadows)

it's possible to manage the updating during shader binding, but the detection is a bit more
complex, and the cpu overhead from maintaining the current codepath with an
extra pipe_context::set_sampler_views (et al) isn't high enough to warrant further investigation
at this time

fixes #8252

Fixes: 153af03b94 ("gallium: Add cap to request state validation for all dirty state")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21176>
2023-02-08 02:17:28 +00:00
Yiwei Zhang
dba8bb08ac venus: disable non AHB external memory bits on Android
We are allowed to enable them in theory. However, the non-AHB external
memory support in Venus is very broken at this moment.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21155>
2023-02-08 02:01:17 +00:00
Juston Li
5c7e60362c venus: enable timeline semaphore feedback
At vkQueueSubmit time, for each batch with timeline semaphores to
signal, append cmd_buffers with feedback cmds to update the counter
value in its respective feedback slot.

Since multiple signals on the same semaphore could be pending at the
same time across batches/vkQueueSubmits, src slots and commands are
allocated on demand. These src slots can be reused after they've been
signaled (if the current semaphore counter is greater/equal than the
src value) and are cleaned up on vkDestroySemaphore.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20500>
2023-02-08 00:09:18 +00:00
Juston Li
067cda659a venus: add timeline semaphore feedback cmds
Unlike fence feedback, commands to update timeline semaphore feedback
slots can't be fully pre-recorded because of the counter value input
for signaling timeline semaphores. To avoid fully recording commands
during vkQueueSubmit, pre-record commands that write a counter value
from a feedback "src" slot to the feedback "dst" slot. Then at
vkQueueSubmit, parse the signal semaphores and write the signal counter
value in the feedback src slot and append the command that writes from
that feedback src slot offset to the command buffer associated with the
signal semaphore.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20500>
2023-02-08 00:09:18 +00:00
Juston Li
56c6e4862a venus: add NO_TIMELINE_SEM_FEEDBACK perf option
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20500>
2023-02-08 00:09:18 +00:00
Juston Li
493a3b5cda venus: refactor batch submission fixup
Refactor into the following stages:
 - prepare: Does an initial pass setting vn_queue_submission fields
   and fixing up semaphores.
 - alloc_storage: based on fields (including counts) from prepare,
   calculate and allocate the amount of temporary storage needed.
 - setup_batches: perform any modifications on the submission
   batches using the allocated temporary storage.
 - cleanup: free any temporary storage used.

Currently, only fence feedback needs alloc_storage and setup_batches
to append fence feedback to the submission but this slow will also
be utilized by upcoming timeline semaphore feedback.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20500>
2023-02-08 00:09:18 +00:00
Juston Li
aaee0ad6bb venus: refactor semaphore helper functions
Change to inline functions using conditional operators

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20500>
2023-02-08 00:09:18 +00:00
Thong Thai
1fe5ffd60e gallium/auxiliary/vl: add crop to compute shader
Add a parameter for cropping, seperate from the translate
parameter, to the progressive compute shader.

Fixes: 4c46e4a5da ("gallium/auxiliary/vl: fix scale and translate parameters")
Fixes: 56eac722bd ("gallium/auxiliary/vl: compute shaders for progressive yuv")
Signed-off-by: Thong Thai <thong.thai@amd.com>
Tested-by: Veerabadhran Gopalakrishnan <veerabadhran.gopalakrishnan@amd.com>
Tested-by: Suresh Guttula <suresh.guttula@amd.com>
Acked-by: Veerabadhran Gopalakrishnan <veerabadhran.gopalakrishnan@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21165>
2023-02-07 23:19:32 +00:00
Francisco Jerez
f0b6348ad0 intel/eu/gfx8-9: Fix execution with all channels disabled due to HW bug #220160235.
This hardware bug is the result of a control flow optimization present
in Gfx8-9 meant to prevent the ELSE instruction from disabling all
channels and update the control flow stack only to have them
re-enabled at the ENDIF instruction executed immediately after it.
Instead, on Gfx8-9 an ELSE instruction that would normally have ended
up with all channels disabled would pop off the last element of the
stack and jump directly to JIP+1 instead of to the ENDIF at JIP,
skipping over the ENDIF instruction.  In simple cases this would work
okay (though it's actual performance benefit is questionable), but in
cases where a branch instruction within the IF block (e.g. BREAK or
CONTINUE) caused all active channels to jump outside the IF
conditional, the optimization would break the JIP chain of "join"
instructions by skipping the ENDIF, causing the block of instructions
immediately after the ENDIF to execute with all channels disabled
until execution reaches the reconvergence point.

This issue was observed on SKL in the
dEQP-VK.reconvergence.subgroup_uniform_control_flow_elect.compute.nesting4.0.38
test in combination with some Vulkan binding model changes Lionel is
working on.  In such cases the execution with all channels disabled
was leading to corruption of an indirect message descriptor, causing a
hang.

Unfortunately the hardware bug doesn't provide a recommended
workaround.  In order to fix the problem we point the JIP of an ELSE
instruction to the instruction immediately before the ENDIF -- However
that's not expected to work due to the restriction that JIP and UIP
must be equal if and only if BranchCtrl is disabled -- So this patch
also enables BranchCtrl, which is intended to support join
instructions within the "ELSE" block, which in turn disables the
optimization described above, which in turn causes us to execute the
instruction immediately *before* the ENDIF with all channels disabled
-- So in order to avoid further fallout from executing code with all
channels disabled we need to insert a NOP before ENDIF instructions
that have a matching ELSE instruction.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20921>
2023-02-07 21:37:12 +00:00
Ian Romanick
65db990b39 lavapipe: Only check NULL pointers in one place in src_only_uses_uniforms
It took me a minute to figure out why the last uni_offsets NULL check
didn't also need to check num_offsets. I think this makes the code
slightly easier to understand.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21144>
2023-02-07 11:15:16 -08:00
Ian Romanick
a7696a4d98 lavapipe: Fix bad array index scale factor in lvp_inline_uniforms pass
A few lines earlier uni_offsets is accessed with ubo scaled by
PIPE_MAX_CONSTANT_BUFFERS:

   if (uni_offsets[ubo * PIPE_MAX_CONSTANT_BUFFERS + i] == offset)

Found by inspection.

Looking at the before and after NIR code for
dEQP-VK.graphicsfuzz.cov-int-initialize-from-multiple-large-arrays,
using the correct indexing appears to enable the pass to inline an
additional uniform. My guess is that when a uniform is used more than
once, the first loop wouldn't find the offset recored in the table
because it was recorded at the wrong location.

Fixes: d23a9380dd ("lavapipe: implement extreme uniform inlining")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21144>
2023-02-07 11:15:16 -08:00
Boyuan Zhang
6d37f7f5ac virgl/video: disable decoder fence
Revert part of the commit 8187b35f to disable decoder fence for now
since it is causing regression for transcoding tests.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21145>
2023-02-07 18:37:23 +00:00
SoroushIMG
782f1e9e01 zink: fix pointcoord y inversion
Point sprite coordinates in general need to be inverted,
not just the texcoords converted to point sprite.

Move point coord y inversion out to its own pass.
Fixes GTF-GL46.gtf21.GL2FixedTests.point_sprites.point_sprites
with FBO dEQP surface.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21050>
2023-02-07 18:07:19 +00:00
Eric Engestrom
6ace3d6cf0 ci/android: add missing line terminator at the end of the file
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21157>
2023-02-07 16:28:35 +00:00
Eric Engestrom
61eba80974 ci/android: move virgl-specific so lib name to virgl-defined variables
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21157>
2023-02-07 16:28:35 +00:00
Eric Engestrom
720812f353 ci/android: move virgl-specific deqp suite to virgl-defined variables
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21157>
2023-02-07 16:28:35 +00:00
Eric Engestrom
b9cdcd2cbe ci/android: move virgl-specific fails/flakes/skips lists to virgl-defined variables
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21157>
2023-02-07 16:28:35 +00:00
Eric Engestrom
515ea48523 ci/android: move virgl-specific gpu_mode to virgl-defined variables
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21157>
2023-02-07 16:28:35 +00:00
Eric Engestrom
eb0f85dd8c ci/android: move common config to common job
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21157>
2023-02-07 16:28:35 +00:00
José Roberto de Souza
eb9ab4efeb intel/genxml/gen125: Tune 3DSTATE_WM Walker direction
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21105>
2023-02-07 07:34:44 -08:00
José Roberto de Souza
bea93f7058 intel/genxml/gen125: Add walker configuration fields to 3DSTATE_WM
Setting default expected values as default in the xml.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21105>
2023-02-07 07:34:35 -08:00
Rhys Perry
fad1f716dd aco: fix out-of-bounds access when moving s_mem(real)time across SMEM
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8224
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21138>
2023-02-07 14:50:43 +00:00
Mike Blumenkrantz
7d8e2db9f9 lavapipe: disable VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT for int formats
this is unsupported and undefined by the spec

cc: mesa-stable

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21099>
2023-02-07 14:23:01 +00:00
Iago Toral Quiroga
fec15a225f v3dv: ensure we apply binning syncs to secondary command buffers
Currently, we postpone binning syncs until we record draw calls
and can validate if any of them require accessing protected
resources in the binning stage, however, if the draw calls are
recorded in a secondary command buffer and the barriers have
been recorded in the primary command buffer, we won't apply the
binning sync in the secondary when we record the draw calls
and so we must apply it when we execute the secondary in the
primary.

Fixes flakyness in:
dEQP-VK.api.command_buffers.record_many_draws_secondary_2

cc: mesa-stable

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21162>
2023-02-07 14:07:19 +01:00
Iago Toral Quiroga
c2601f0690 v3dv: ensure at least V3D_CL_MAX_INSTR_SIZE bytes in last CL instruction
The CLE parser in the sim will read this many bytes for each instruction
in a CL, so we should ensure we have at least that many bytes available
in the BO when reading the last instruction, otherwise we can trigger
a GMP violation. It is not clear whether this behavior applies to real
hardware too.

cc: mesa-stable

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21162>
2023-02-07 14:06:57 +01:00
Frank Binns
079247e046 pvr: remove start/stop transfer flags
These are ignored by the pvrsrvkm KMD and don't exist in the new KMD.

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Luigi santivetti <luigi.santivetti@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21132>
2023-02-07 10:34:05 +00:00
pal1000
4347072443 meson: Ignore unused variables when assertions are disabled
Fixes: 46b099e3
("meson: Ignore unused variables in release builds")

46b099e3 has some issues:
- it doesn't enable unused variables warning on release builds
with assertions enabled;
- it doesn't disable unused variables warning on debug builds
with assertions disabled;
- it doesn't disable unused variables warning when building
with MSVC and assertions are disabled regardless of buildtype,
see #8147. 3/4 regressions reported there have this limitation
alone as root cause.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21154>
2023-02-07 08:44:14 +00:00
Qiang Yu
4888dd7391 radv: use amd common force_vrs option
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21010>
2023-02-07 08:09:39 +00:00
Qiang Yu
1e3198c766 radv: move radv_consider_force_vrs above radv_fill_shader_info
It will be used by radv_fill_shader_info, no function change.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21010>
2023-02-07 08:09:39 +00:00
Lionel Landwerlin
bee8e47048 anv: use malloc for host only descriptor sets
On integrated products this makes almost no difference but on discrete
it's pretty important.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Tested-by: Chuansheng Liu <chuansheng.liu@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21131>
2023-02-07 07:28:32 +00:00
Dave Airlie
3e2c768aa8 radv/vcn: enable dynamic dpb tier 2 for h264/h265 on navi21+
navi21 can do separate image support, using tier 2 DPB messages.

This enables support for doing that in the vulkan video driver.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20388>
2023-02-07 12:48:28 +10:00
Dave Airlie
6c3c242361 radv/video: add h265 decode UVD support
Add support for h265 decode on older UVD GPUs

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20388>
2023-02-07 12:48:26 +10:00
Dave Airlie
db62c38091 radv: add vcn h265 decode.
This adds support for HEVC decode in VCN

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20388>
2023-02-07 12:48:24 +10:00
Dave Airlie
8a29291dbe radv/video: add h264 support for uvd
This adds support for the older UVD h264 decoder.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20388>
2023-02-07 12:48:22 +10:00
Dave Airlie
1693c03a39 radv/video: add initial h264 decoder for VCN
This adds support for H264 decode on VCN hardware.

It uses the full DPB method, and relies on the application
to allocate an arrayed texture for the DPB to be stored into.

RADV_PERFTEST=video_decode is required to enable this.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20388>
2023-02-07 12:47:53 +10:00
Dave Airlie
9477f117f4 radv/video: add initial frameworking.
This just adds the basic commands and objects, and hooks up some
of the queues and extensions.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20388>
2023-02-07 12:47:50 +10:00
Dave Airlie
3253340916 radv: add video decoder register setup.
This just assigns the correct registers depending on the gpu family.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20388>
2023-02-07 12:47:48 +10:00
Dave Airlie
85eead4198 radv: adding video decode queue support
This adds the video queue interactions to radv and builds
on the winsys code previously added.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20388>
2023-02-07 12:47:46 +10:00
Dave Airlie
30b6e9797d ac: add name to codec info struct
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20388>
2023-02-07 12:47:43 +10:00
Dave Airlie
ee7837aae2 radv: add new upload alloc aligned api
The video buffers need to have objects aligned at certain ranges,
this enhances the uploader to allow an alignment to be specified.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20388>
2023-02-07 12:47:39 +10:00
Dave Airlie
855ad612e1 radv: remove the status query mark it unsupported.
The current firmware can't support the status query requirements.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20388>
2023-02-07 12:47:25 +10:00
Rob Clark
284547af55 freedreno+ir3: Move storage_16bit to compiler options
This isn't a thing in gl.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21152>
2023-02-07 01:26:45 +00:00
Kenneth Graunke
79caf8a44b anv: Make a batch decoder for each queue family
The decoder context needs to know what engine it's associated with.
Nowadays, we have render, compute, blitter, even video engines being
used from the same driver.  Rather than trying to have a single decoder
and thwacking the engine field back and forth between calls, we make
one per queue family, and stash a pointer in anv_queue for easy access.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21149>
2023-02-06 23:21:55 +00:00
Alejandro Piñeiro
1a1fa2393e v3d/v3dv: use shader_info->var_copies_lowered
Instead of passing allow_copies as a parameter for v3d_optimize_nir
(so manually doing that tracking).

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19338>
2023-02-06 22:11:34 +00:00
Alejandro Piñeiro
ba0bc7182d anv: use shader_info->var_copies_lowered
Instead of passing allow_copies as a parameter for brw_nir_optimize
(so manually doing that tracking).

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19338>
2023-02-06 22:11:34 +00:00
Alejandro Piñeiro
a12a71e6c0 radv: use shader_info->var_copies_lowered
Instead of passing allow_copies as a parameter for radv_optimize_nir
(so manually doing that tracking).

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19338>
2023-02-06 22:11:34 +00:00
Alejandro Piñeiro
3685528c1e nir: track if var copies lowering was called
In general we should only call it once, and then we should avoid to
call any lowering that introduce back copies. So far we were tracking
that manually out of the nir shader on several places.

Ideally we would like to add a nir_validate rule, but right now there
are some exceptions to this rule. For example right now the Intel
compiler calls nir_lower_io_to_temporaries as part of linking
tess_ctrl/mesh/task sahders.

One option would be to allow drivers to reset the value, but for now
let's not add that validation rule.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19338>
2023-02-06 22:11:34 +00:00
Yuxuan Shui
27a89a0903 loader: unregister special event in loader_dri3_drawable_fini
This was inadvertently removed in 98a6cfd395 and causes continuous
memory leaks as events are being received after the context has been
unbound.

Fixes: 3170b63314 ("loader: Add infrastructure for tracking active CRTC resources")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8238
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21128>
2023-02-06 20:45:32 +00:00
Pavel Ondračka
f56f277ba0 r300: set register file to none if swizzles are constant only
In constant folding when converting multiply by zero to mov.

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/21141>
2023-02-06 20:31:56 +00:00
Kai Wasserbäch
1d5d07e565 fix: gallivm: limit usage of LLVMContextSetOpaquePointers() to LLVM 15
LLVMContextSetOpaquePointers() was a temporary workaround offered to
allow transitioning to opaque pointers. Mesa is ready for this now with
recent versions of LLVM (16+). Therefore we limit the workaround of
using LLVMContextSetOpaquePointers() to LLVM 15 now, that this C
interface was removed in LLVM 17.

Reference: 1270879376
Suggested-by: Dave Airlie <airlied@redhat.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8183
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21124>
2023-02-06 19:50:35 +00:00
Konstantin Seurer
569517d7ad radv: Use common ycbcr conversion lowering
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20731>
2023-02-06 18:36:29 +00:00
Konstantin Seurer
9104dafb6f vulkan,nir: Refactor ycbcr conversion state into a struct
This will be useful for RADV since it hashes the state.

v3dv changes:
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20731>
2023-02-06 18:36:29 +00:00
Konstantin Seurer
dae893cb96 radv: Remove radv_indirect_unaligned_dispatch
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21071>
2023-02-06 17:50:53 +00:00
Konstantin Seurer
b9d7306edc radv: Use an ordered dispatch for BVH encoding
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21071>
2023-02-06 17:50:53 +00:00
Konstantin Seurer
22a028ea99 radv: Implement ordered compute dispatches
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21071>
2023-02-06 17:50:53 +00:00
Konstantin Seurer
77b0a4c025 radv: Make radv_compute_dispatch non-static
To avoid adding yet another radv_*_dispatch helper.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21071>
2023-02-06 17:50:53 +00:00
Guilherme Gallo
26754f658e Revert "ci: disable Collabora's LAVA lab for maintance"
This reverts commit 60d7e15a7e.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20903>
2023-02-06 17:22:11 +00:00
Guilherme Gallo
95b5cc3a53 radeonsi/ci: Skip slow traces on raven
Two traces timed out during Collabora's LAVA farm re-enablement.
Possibly, some commit made them slower during farm downtime.

- https://gitlab.freedesktop.org/mesa/mesa/-/jobs/35934124

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20903>
2023-02-06 17:22:11 +00:00
Guilherme Gallo
53cc509288 radeonsi/ci: Update stoney test expectations
Some jobs failed during the re-enablement of Collabora's LAVA farm.

The trace job radeonsi-stoney-traces:amd64 produced some traces with
almost unnoticeable lighting spread difference, so I updated all the
traces.

Now the test spec@ext_texture_lod_bias@lodbias is failing after running
a couple of times.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20903>
2023-02-06 17:22:11 +00:00
Jonathan Gray
f15f08c3de intel/dev: Add another EHL pci id
described as "32 Execution Unit (EU) Super SKU" in:
Intel Atom x6000E Series, and Intel Pentium and Celeron N and
J Series Processors for IoT Applications
Datasheet, Volume 1
Document Number: 636112-1.6

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21129>
2023-02-06 16:48:39 +00:00
Jonathan Gray
a23e04b673 intel/dev: remove invalid EHL pci id
removed in linux
0e8e272f1368 ("drm/i915/ehl: Remove invalid PCI ID")

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21129>
2023-02-06 16:48:39 +00:00
Mike Blumenkrantz
89cf0a3bdc zink: fix max acquired image count
according to spec, the maximum number of acquired images can be calculated with

swapchain_size - VkSurfaceCapabilitiesKHR::minImageCount + 1

the previous calculation was both wrong and occurring in the wrong place,
so this corrects both issues

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21095>
2023-02-06 16:35:48 +00:00
SoroushIMG
22e91af1a7 zink: clear null image surfaces to 0
GL Spec says that imageLoad from incomplete images must return 0.
This is not really spec compliant as for proper behavior nullDescriptor
and robustImageAccess2 is needed.
A workaround for lack of either of these requires a shader variant.
Clearing the null surface and hoping the app doesn't write to the image
is closer to spec, while avoiding a shader recompile.

KHR-GL46.shader_image_load_store.incomplete_textures tests this.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21135>
2023-02-06 15:55:57 +00:00
Samuel Pitoiset
2fe3cef367 radv: do not insert fast-linked libraries to the shaders cache
Similar to fast-linked pipelines that aren't added to the cache.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21133>
2023-02-06 15:01:30 +00:00
SoroushIMG
104040b5c7 zink: fix leak when rebinding same image surface
simple way to reproduce this is to run these 4 together:
KHR-GL46.gpu_shader5.images_array_indexing
KHR-GL46.shader_image_load_store.advanced-allMips
KHR-GL46.shader_image_load_store.advanced-sso-simple
KHR-GL46.shader_image_load_store.incomplete_textures

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21134>
2023-02-06 14:47:47 +00:00
SoroushIMG
4c647c9e25 zink: only save frag const buffers when used by blit
fixes upload manager constant buffer leak.
zink only needs to save the const buffer for stencil fallback blits.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21134>
2023-02-06 14:47:47 +00:00
Rhys Perry
c68f9ed020 radv/llvm: use the ring_offsets shader arg
Besides being nicer, this also fixes load_sample_positions_amd with LLVM.

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/19202>
2023-02-06 14:25:16 +00:00
Rhys Perry
be6f30a0db ac/llvm: let ring_offsets be accessed like a normal arg
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/19202>
2023-02-06 14:25:16 +00:00
Rhys Perry
24618721d3 ac: move ring_offsets to ac_shader_args
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/19202>
2023-02-06 14:25:15 +00:00
Rhys Perry
10a5035c83 radv: set state.vbo_misaligned_mask_invalid in radv_bind_vs_input_state
Found by inspection. Something probably hangs because of this, but I don't
know what.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: c199a5160a ("radv: bind the VS input state for prologs created with GPL")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20913>
2023-02-06 14:05:13 +00:00
Luigi Santivetti
21f0fc65b2 pvr: add padding bytes when allocating buffer memory
We need to pad VkBuffers to ensure we don't read beyond a page boundary.

An alternative to this approach would be to allocate an additional virtual
page when binding memory to the buffer, and to map this to the first
physical address, so both the first and last virtual page point to the same
physical location. This would be less expensive in terms of memory usage,
but more complex and invasive, hence the simpler approach has been taken
for now.

Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21101>
2023-02-06 11:18:38 +00:00
Karmjit Mahil
4e75e1bfec pvr: Set SPMSCRATCHBUFFER flag.
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/21102>
2023-02-06 10:47:38 +00:00
Karmjit Mahil
ad8c0878b4 pvr: Update comment about ZS and MSAA buffers for pvrsrvkm submission.
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/21102>
2023-02-06 10:47:38 +00:00
Karmjit Mahil
3457f8083a pvr: Acquire scratch buffer on framebuffer creation.
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/21102>
2023-02-06 10:47:38 +00:00
Karmjit Mahil
ad9c61c292 pvr: Add SPM scratch buffer infrastructure.
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/21102>
2023-02-06 10:47:38 +00:00
Lionel Landwerlin
e37f458207 intel/ds: track end of pipe bits
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/21094>
2023-02-06 09:12:18 +00:00
Lionel Landwerlin
a242500eb4 anv: rename a few internal functions to highlight gfx use
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/21094>
2023-02-06 09:12:18 +00:00
Lionel Landwerlin
6a23b18730 anv: rename RT pipeline function helper
Making it clear this is intended for RT pipelines only.

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/21094>
2023-02-06 09:12:18 +00:00
Lionel Landwerlin
fd7debc8bb intel/fs: make alpha_to_coverage a tristate
That way in some cases we can do this dynamically.

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/21094>
2023-02-06 09:12:18 +00:00
Jason Ekstrand
f3969e2413 intel/fs: Rework dynamic coarse handling
Use 2 flags for PI & RT messages.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:18 +00:00
Jason Ekstrand
964b878986 intel/fs: Break out yet another FB write helper
This new helper, do_emit_fb_writes() does the actual walk over all the
render targets to emit each of the different FB writes.  We want this in
a helper because we're about to go a bit crazy with coarse.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:18 +00:00
Jason Ekstrand
9c658b1fc8 intel/fs/validate: Assert SEND [extended] descriptors are uniform
This is required by code-gen since it generates a 1-wide OR and it'll
blow up if the register width > 1.  It's also way better than the "your
register is the wrong size" assert you get from the more generic
validation check.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:18 +00:00
Jason Ekstrand
949b42c4dc intel/compiler: Convert wm_prog_key::multisample_fbo to a tri-state
This allows us to communicate to the back-end that we don't actually
know if the framebuffer is multisampled or not.  No drivers set anything
but ALWAYS/NEVER and we still have a few ALWAYS/NEVER assumptions but
those should be asserted.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:18 +00:00
Jason Ekstrand
5644011f06 intel/compiler: Convert wm_prog_key::persample_interp to a tri-state
This allows for the possibility that we may not know at compile time if
sample shading is enabled through the API.  While we're here, also
document exactly what this bit means so we don't confuse ourselves.

v2: Fixup coarse pixel values (Lionel)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:18 +00:00
Jason Ekstrand
d8dfd153c5 intel/fs: Make per-sample and coarse dispatch tri-state
Whenever one of them is BRW_SOMETIMES, we depend on dynamic flag pushed
in as a push constant.  In this case, we have to often have to do the
calculation both ways and SEL the result.  It's a bit more code but
decouples MSAA from the shader key.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:18 +00:00
Jason Ekstrand
43ca7f4178 intel/compiler: Convert brw_wm_aa_enable to brw_sometimes
There are other cases where we want a tri-state logic like this.  May as
well have one enum for all the cases.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:17 +00:00
Jason Ekstrand
5d1c538449 intel/fs: Return early in a couple builtin setup helpers
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:17 +00:00
Jason Ekstrand
714a291673 intel/compiler: Use SHADER_OPCODE_SEND for PI messages
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:17 +00:00
Jason Ekstrand
9c62e0c77d nir: Remove nir_lower_io_force_sample_interpolation
It's no longer used.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:17 +00:00
Jason Ekstrand
d25e5310bc intel/nir: Lower barycentrics to per-sample in a dedicated pass
This is more similar to what we do for single-sample and it should be
more clear going forward once our lowering gets more complex.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:17 +00:00
Jason Ekstrand
991d546102 intel/compiler: Document wm_prog_key::persample_interp
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:17 +00:00
Marek Olšák
71a6b53192 amd: don't hardcode real VGPR allocation granularity on gfx10.3 and gfx11
That's how it really works.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20967>
2023-02-05 23:23:58 -05:00
Marek Olšák
e673bb4ae4 amd,util: fix how lod bias is converted to fixed-point
according to internal docs

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20967>
2023-02-05 23:23:45 -05:00
Marek Olšák
fb5d31c3dd amd/surface: clean up is_dcc_supported_by_L2
no functional change, though this removes "<=" for navi10, which was
never true in the "<" case

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20967>
2023-02-05 23:23:45 -05:00
Marek Olšák
70d228188a radeonsi: clean up si_set_mutable_tex_desc_fields
- sink code into existing branches
- remove unnecessary clearing of fields
- no functional change

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20967>
2023-02-05 23:23:45 -05:00
Marek Olšák
4f246f27b1 amd: define new SET_*_REG_PAIRS packets
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20967>
2023-02-05 23:23:45 -05:00
Marek Olšák
97f30fc65f radeonsi/gfx11: don't add alpha to mrt0 format for A2C if exporting via mrtz
If alpha-to-coverage is exported via mrtz, don't upgrade the mrt0 format
to one with an alpha channel.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20967>
2023-02-05 23:23:45 -05:00
Marek Olšák
0f81224e70 radeonsi/gfx11: don't add mrt0 export for alpha-to-coverage if mrtz is present
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20967>
2023-02-05 23:23:45 -05:00
Alyssa Rosenzweig
6b97f396e6 nir/lower_clip: Only emit 1 discard
If we have multiple clip planes, rather than emit multiple discards we can just
OR together the discard criteria. Then a nir_opt_algebraic rule kicks in to
optimize out the flt/.../flt/ior/.../ior into fmin/.../fmin/flt, generating
much less code at the end.

Written while debugging an unrelated issue with the clip lowering.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21103>
2023-02-06 02:50:20 +00:00
Mike Blumenkrantz
b481e3ae57 zink: conditionally enable PIPE_CAP_NULL_TEXTURES
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21072>
2023-02-05 13:32:02 +00:00
Mike Blumenkrantz
8b000ebbb5 radeonsi: set PIPE_CAP_NULL_TEXTURES
fixes #8163

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21072>
2023-02-05 13:32:02 +00:00
Mike Blumenkrantz
2127287d4d gallium: add PIPE_CAP_NULL_TEXTURES
this allows drivers to indicate that they support sampling from null
textures instead of using fallback textures

for now, this is only used for depth-based fallback textures

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21072>
2023-02-05 13:32:02 +00:00
Konstantin Seurer
7f98fcae52 radv: Scalarize global IO with LLVM enabled
Fixes the "atomic store operand must have integer, pointer, or floating point type!" error with RADV_DEBUG=llvm,checkir.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20840>
2023-02-05 12:40:25 +00:00
Konstantin Seurer
10ac51a52b ac/llvm: Fix validation error with global io
Fixes: afd645f057 ("ac/llvm: remove LLVMBuildGEP usages")
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/20521>
2023-02-05 12:16:05 +00:00
Konstantin Seurer
55175cd13c radv/llvm: Use the shader names as module name
This makes it easier to identify which (if any) shaders fail validation.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20521>
2023-02-05 12:16:05 +00:00
Konstantin Seurer
877e150ec8 radv/rq: Use 16 stack entries if there is only one ray query
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21120>
2023-02-05 11:51:42 +00:00
Asahi Lina
4ca4a05627 meson: Fix Asahi build on macOS
!19950 introduced a dependency between NIR and Vulkan headers, and the
Vulkan headers try to include X11 headers we cannot find on macOS.

Disable this (we have no plans for Vulkan on the macOS testing platform
anyway).

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21059>
2023-02-05 09:15:48 +00:00
Alyssa Rosenzweig
bfa7ec0aa0 agx: Don't scalarize preambles in NIR
Scalarizing preambles in NIR isn't really necessary, we can do it more
efficiently in the backend. This makes the final NIR a lot less annoying to
read; the backend IR was already nice to read thanks to all the scalarized moves
being copypropped. Plus, this is a lot simpler.

No shader-db changes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21122>
2023-02-05 08:53:29 +00:00
Alyssa Rosenzweig
7edd42cbc0 agx: Lower uniform sources with a dedicated pass
Move the decision of "can I copyprop this uniform?" from copyprop to a
standalone lowering pass. This is more straightforward and will enable the next
patch. This has the side effect of sinking load_preamble instructions, for a
nice reduction in register pressure. Instruction count increase is from
rematerializing some moves, which should be more than balanced out by the
reduced register pressure.

total instructions in shared programs: 1523285 -> 1523317 (<.01%)
instructions in affected programs: 1148 -> 1180 (2.79%)
helped: 0
HURT: 13
HURT stats (abs)   min: 1.0 max: 4.0 x̄: 2.46 x̃: 2
HURT stats (rel)   min: 0.69% max: 7.69% x̄: 3.65% x̃: 2.61%
95% mean confidence interval for instructions value: 1.78 3.14
95% mean confidence interval for instructions %-change: 2.16% 5.15%
Instructions are HURT.

total bytes in shared programs: 10444532 -> 10444724 (<.01%)
bytes in affected programs: 7386 -> 7578 (2.60%)
helped: 0
HURT: 13
HURT stats (abs)   min: 6.0 max: 24.0 x̄: 14.77 x̃: 12
HURT stats (rel)   min: 0.63% max: 7.14% x̄: 3.40% x̃: 2.48%
95% mean confidence interval for bytes value: 10.68 18.85
95% mean confidence interval for bytes %-change: 2.02% 4.78%
Bytes are HURT.

total halfregs in shared programs: 419444 -> 416434 (-0.72%)
halfregs in affected programs: 27080 -> 24070 (-11.12%)
helped: 634
HURT: 0
helped stats (abs) min: 1.0 max: 30.0 x̄: 4.75 x̃: 2
helped stats (rel) min: 2.90% max: 54.55% x̄: 13.13% x̃: 8.51%
95% mean confidence interval for halfregs value: -5.08 -4.41
95% mean confidence interval for halfregs %-change: -14.03% -12.23%
Halfregs are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21122>
2023-02-05 08:53:29 +00:00
Alyssa Rosenzweig
e44a53f5dc agx: Run DCE twice
Needed to combine fsat with vectors due to nir_lower_blend changes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21122>
2023-02-05 08:53:29 +00:00
Alyssa Rosenzweig
cd8b5427c7 agx: Allow uniform sources on phis
The parallel copy lowering has been able to handle uniform sources since 98f0ebf264 ("agx:
Pass agx_index to agx_copy"), and uniform sources work fine with phis. It's not
super common but there's no need to restrict them. This is a small instruction
count win and will greatly simplify the lowering later in this series.

total instructions in shared programs: 1523806 -> 1523285 (-0.03%)
instructions in affected programs: 17088 -> 16567 (-3.05%)
helped: 38
HURT: 1
helped stats (abs) min: 1.0 max: 44.0 x̄: 13.95 x̃: 7
helped stats (rel) min: 0.42% max: 18.64% x̄: 4.73% x̃: 1.26%
HURT stats (abs)   min: 9.0 max: 9.0 x̄: 9.00 x̃: 9
HURT stats (rel)   min: 8.57% max: 8.57% x̄: 8.57% x̃: 8.57%
95% mean confidence interval for instructions value: -17.95 -8.77
95% mean confidence interval for instructions %-change: -6.35% -2.43%
Instructions are helped.

total bytes in shared programs: 10447658 -> 10444532 (-0.03%)
bytes in affected programs: 118850 -> 115724 (-2.63%)
helped: 38
HURT: 1
helped stats (abs) min: 6.0 max: 264.0 x̄: 83.68 x̃: 45
helped stats (rel) min: 0.36% max: 16.51% x̄: 4.14% x̃: 1.09%
HURT stats (abs)   min: 54.0 max: 54.0 x̄: 54.00 x̃: 54
HURT stats (rel)   min: 7.30% max: 7.30% x̄: 7.30% x̃: 7.30%
95% mean confidence interval for bytes value: -107.68 -52.62
95% mean confidence interval for bytes %-change: -5.55% -2.13%
Bytes are helped.

total halfregs in shared programs: 419446 -> 419444 (<.01%)
halfregs in affected programs: 29 -> 27 (-6.90%)
helped: 1
HURT: 0

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21122>
2023-02-05 08:53:29 +00:00
Luc Ma
abe6d750e5 xlib: fix glXDestroyContext in Gallium frontends
when glx is built with -Dglx=xlib, the mishandle in
glXDestroyContext causes glmark2 to exit unexpectedly.

Error: Glmark2 needs OpenGL(ES) version >= 2.0 to run (but version string is: '(null)')!
Error: Failed to add vertex shader from file None:
Error:   Failed to create the new program
[build] <default>: Set up failed

Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3985

Signed-off-by: Luc Ma <luc@sietium.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21067>
2023-02-04 22:25:09 +00:00
SoroushIMG
8f928a95e1 zink: fix cap check for arb sparse texture2
arb_sparse_texture2 also enables multisampled sparse textures.
bring back the check for msaa support.

fixes #8229

Fixes: 4f8ba2b9aa ("zink: fix sparse residency query and minLOD feature checks")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21121>
2023-02-04 18:05:48 +00:00
Alyssa Rosenzweig
93db6094a1 nir/print: Pretty-print color0/1_interp
These are an enum. Furthermore, their 0 state is INTERP_MODE_NONE which we
shouldn't bother printing at all.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21091>
2023-02-04 17:26:30 +00:00
Alyssa Rosenzweig
b235be1fd4 nir/print: Pretty-print I/O semantic locations
Instead of printing the raw location number, which is pretty hard to interpret,
let's print the name of the location. Example output:

   vec4 16 ssa_2 = intrinsic load_interpolated_input (ssa_0, ssa_1) (base=0,
   component=0, dest_type=float16 /*144*/, io location=VARYING_SLOT_VAR0 slots=1
   mediump /*8388768*/)

One of the "regressions" from moving to purely lowered I/O with all variables
removed is a lack of debuggability, since otherwise these location strings don't
show up anywhere in the printed shader! By contrast this should make the lowered
I/O nice to read like the early I/O.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21091>
2023-02-04 17:26:30 +00:00
Alyssa Rosenzweig
435e7f5e6d nir/print: Extract get_location_str
Locations show up in two places: variables and lowered I/O semantics. We want to
reuse the logic in both places, so extract it out. The extracted logic is IMO
easier to read, too.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21091>
2023-02-04 17:26:30 +00:00
Alyssa Rosenzweig
f857795e83 agx: Implement barriers
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062>
2023-02-04 17:10:15 +00:00
Alyssa Rosenzweig
251f6fb224 agx: Implement compute ID intrinsics
These NIR intrinsics map to vectors of special registers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062>
2023-02-04 17:10:15 +00:00
Alyssa Rosenzweig
da91a78ab7 asahi: Identify more compute-related XML
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062>
2023-02-04 17:10:15 +00:00
Alyssa Rosenzweig
57e0dbe55b asahi: Implement load_ssbo_address/get_ssbo_size
More uniforms that get pushed.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062>
2023-02-04 17:10:15 +00:00
Alyssa Rosenzweig
78c9344a4d asahi: Add compute batches
Add a specialized agx_batch for compute commands (queued to the CDM instead of
the VDM for graphics). This uses a sentinel value for the width.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062>
2023-02-04 17:10:15 +00:00
Alyssa Rosenzweig
f54739396c asahi: Bump PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS
Seems arbitrary.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062>
2023-02-04 17:10:15 +00:00
Alyssa Rosenzweig
580ed13779 asahi: Stub out MSAA for dEQP
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062>
2023-02-04 17:10:15 +00:00
Alyssa Rosenzweig
5e7babfa1b asahi: Advertise seamless cube maps
These are already wired up.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062>
2023-02-04 17:10:15 +00:00
Alyssa Rosenzweig
32cbcbcb50 asahi: Fake more caps for dEQP-GLES31
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062>
2023-02-04 17:10:15 +00:00
Alyssa Rosenzweig
f4b553d55a asahi: Add hooks for SSBO and images
Copy paste from Panfrost. This should be close to what we need for Asahi, and
this lets us run dEQP-GLES31 without crashing immediately.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062>
2023-02-04 17:10:15 +00:00
Alyssa Rosenzweig
c1a6465644 asahi: Don't leak shader NIR
create_shader_state passes ownership of the NIR to the driver, so we need to
free it when we destroy the shader CSO later. Use ralloc to manage this in a
uniform way between graphics and compute. Strategy from Panfrost.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062>
2023-02-04 17:10:15 +00:00
Alyssa Rosenzweig
227d4f6d75 asahi: Add compute kernel scaffolding
This adds the basic scaffolding for compute kernels. There's a bit of churn to
make sure we don't need to hang onto the kernel NIR, since it's never used for
anything else except looking up the shader stage.

The compute kernels aren't actually wired up here, but they do get compiled.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062>
2023-02-04 17:10:15 +00:00
Alyssa Rosenzweig
60121e3a42 asahi: Fix delete_vs_state implementation
The generic free won't delete the shader variants, leaking them all!

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062>
2023-02-04 17:10:15 +00:00
Hampus Linander
b73b5cc71a agx: Optimize lower_resinfo for cube maps
We can avoid reading both width and height when the texture is a cube map, and
we do so more simply by relying on CSE+DCE (Alyssa).

Closes: #7541
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20628>
2023-02-04 11:13:37 -05:00
Hampus Linander
9ab1c0d83b agx: Use AGX extr for tex lowering
Replaces a number of bit operations by a single extr instruction,
optimizing the extraction of the width from the packed value.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20628>
2023-02-04 11:13:37 -05:00
Hampus Linander
f3d6524a2d agx: Add extr instruction to AGX backend
Encoding is similar to bfeil, in particular the immidiate has the
same encoding as BFI_MASK hence its reuse.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20628>
2023-02-04 11:13:37 -05:00
Hampus Linander
4ffc7c3ff4 nir: Add extr_agx opcode
The AGX extr instruction extracts a bitfield from two 32bit registers.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20628>
2023-02-04 11:13:24 -05:00
Alyssa Rosenzweig
e765ec21ec asahi: Implement custom border colours
Implement custom border colours, as required by OpenGL's CLAMP_TO_BORDER and
Vulkan with customBorderColor. This uses an extended sampler descriptor, which
has space for the custom border values. The trouble is that the border must be
packed into an internal interchange format that depends on the original format
in a complex way. That said, we're not solving NP-complete problems here, and it
passes the tests (dEQP-GLES31.functional.texture.border_clamp.* and piglit
texwrap).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20570>
2023-02-04 10:37:02 -05:00
Alyssa Rosenzweig
507ca71f3e agx/decode: Handle extended samplers
These include a border colour field.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20570>
2023-02-04 10:32:38 -05:00
Alyssa Rosenzweig
afce5be659 agx/decode: Add a data parameter to stateful
So we can handle extended samplers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20570>
2023-02-04 10:32:38 -05:00
Alyssa Rosenzweig
10eaa4a2ec asahi: Add XML for custom border colours
These use extended sampler descriptors.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20570>
2023-02-04 10:32:24 -05:00
Timur Kristóf
3a819bd22e ac/nir/ngg: Include culled primitives in query.
Vulkan spec 18.8. Primitives Generated Queries:

When a generated primitive query for a vertex stream is active,
the primitives-generated count is incremented every time a
primitive emitted to that stream reaches the transform feedback
stage, whether or not transform feedback is active.

We can see the order of stages in chapter 27 Fixed-Function
Vertex Post-Processing, which shows that the transform feedback
stage is before rasterization (and therefore culling).

Conclusion is that culled primitives should be included
in the primitives generated query.

This commit makes sure to emit the primitives generated query
code before culling and uses the input primitive count passed
to the current wave instead of the exec mask after culling.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21037>
2023-02-04 11:53:07 +01:00
Alyssa Rosenzweig
221311e1e9 agx: Handle constant-offset in address matching
Match iadd(x, #y). The format shift will get constant-folded away and, if y
is sufficiently small, the constant will be inlined by the AGX backend
optimizer. This gets rid of piles of 64-bit arithmetic from lowering UBOs. It
probably doesn't matter for perf since that's happening in preamble shaders but
it *is* noisy.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21108>
2023-02-04 08:41:37 +00:00
Alyssa Rosenzweig
c3f7abaaef agx: Fix storing to varying arrays
The offset is in vec4s, not words (unlike the component). This doesn't matter
right now since we get everything lowered (offset -> 0) but it will come up if
we implement clip distances natively (instead of lowering in FS).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21097>
2023-02-04 08:28:43 +00:00
Alyssa Rosenzweig
897c47aa1c docs/asahi: Document clip distance varyings
These implement gl_ClipDistance in hardware, avoiding the fragment shader
lowering. Unfortunately, they can't be disabled on a per-plane basis and they
can't be interpolated, so using them for OpenGL would still require a bunch of
extra lowering steps. Still, we should document the hardware and the caveats.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21097>
2023-02-04 08:28:43 +00:00
Alyssa Rosenzweig
13b25a6114 asahi: Don't use 16-bit inputs to 32-bit st_tile
The hardware doesn't extend in this case, we need to extend for it. This
fixes 32-bit render target formats with lower_mediump_io.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21082>
2023-02-04 08:14:32 +00:00
Alyssa Rosenzweig
6b0322d441 agx: Keep varyings forwarded to texture as fp32
This works around bugs in a LOT of applications, since fp16 texture coordinates
are almost never appropriate even though it's a valid implementation of the GLES
spec. It also doesn't seem to matter for perf.

Code from the Bifrost compiler which implements the same workaround for slightly
different reasons.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21082>
2023-02-04 08:14:32 +00:00
Alyssa Rosenzweig
5678fbe010 asahi: Merge fragment control XML
Same struct specified twice and merged in the hw.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21081>
2023-02-04 07:58:42 +00:00
Alyssa Rosenzweig
50e61e251b asahi: Remove redundant tri merge disable bit
Cargoculted from Metal.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21081>
2023-02-04 07:58:42 +00:00
Alyssa Rosenzweig
6ee38e2635 asahi: DRY dirty tracking conditions
Ella did this in agxv and it made a lot more sense than the copypasta I did.
Should get copypropped to similar code.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21081>
2023-02-04 07:58:42 +00:00
Alyssa Rosenzweig
98b2657b9e asahi: Implement nontrivial rasterizer discard
For vertex shaders with side effects, as seen with transform feedback.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21081>
2023-02-04 07:58:42 +00:00
Alyssa Rosenzweig
64ae63c41f asahi: Prefer blit-based texture transfer
This speeds up glReadPixels. Instead of reading from the write-combined
framebuffer and converting colours on the CPU, this blits on the GPU to a
writeback staging resource with the colour conversion for free, and memcpies
from the writeback staging resource on the CPU.

In general, due to textures being write combined and tiled/compressed by default
by staging resources being linear writeback, blit-based texture transfer should
win out (you were going to blit anyway), particularly when format conversion is
involved

33% reduction in wall clock time for grim at 4K. No change in deqp-gles2
runtime.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21063>
2023-02-04 07:45:12 +00:00
Alyssa Rosenzweig
0a5c3764c7 asahi: Make STAGING resources linear
As intended by the flag.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21063>
2023-02-04 07:45:12 +00:00
Alyssa Rosenzweig
e7b97899ac asahi: Use writeback when it looks beneficial
When playing the My Little Pony theme song at 1080p on T8103, with mpv's GPU
compositing but software decoding, CPU usage drops from 200% to 50% due to
proper caching of the staging resource.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21063>
2023-02-04 07:45:12 +00:00
Asahi Lina
a88aa3e835 asahi: Refuse to transfer out-of-bounds mip levels
Fixes ail asserts on a pile of dEQP3 tests.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21063>
2023-02-04 07:45:12 +00:00
Alyssa Rosenzweig
3706da1d1a agx: Support uniform registers as LODs
This will avoid regressing moves when we lower sampler LOD bias. Corresponding
disassembler change: https://github.com/dougallj/applegpu/pull/22

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20833>
2023-02-04 07:33:08 +00:00
Alyssa Rosenzweig
231561d53a asahi: Correct alignment for USC Uniform packets
We only need 4 byte alignment, not 8 bytes. This isn't a big difference in
practice, but it probably reduces padding in some cases. More importantly, it
corrects our XML to match what the hardware actually does, which is great.
(There is exactly enough room for a 40-bit address with 4 byte alignment.)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21118>
2023-02-04 07:19:29 +00:00
Alyssa Rosenzweig
e4cb64c0e2 asahi/nir_lower_sysvals: Split large ranges
It is our responsibility to ensure uniform ranges don't exceed 64 uniforms.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21118>
2023-02-04 07:19:29 +00:00
Alyssa Rosenzweig
b0f1964771 asahi: Strengthen agx_usc_uniform contract
Check the size explicitly, instead of just implicitly in the GenXML pack: it is
the responsibility of the caller to split up larger uploads. While this is
nominally more complicated, agx_usc_uniform is called in the draw hot path
whereas the actual splitting decision can usually be done at compile-time.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21118>
2023-02-04 07:19:29 +00:00
Alyssa Rosenzweig
ea38709345 asahi: Fix encoding of uniform size
Only 6-bits, with zero=64 like a groups() encoding.

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/21118>
2023-02-04 07:19:29 +00:00
Alyssa Rosenzweig
79a7c6e3bd asahi: Set layout->mipmapped_z for 3D textures
There's a corner case where 3D textures have extra padding compared to 2D
arrays. We need to communicate that to ail.

Fixes
dEQP-GLES3.functional.texture.specification.texstorage3d.size.3d_32x16x64_4_levels.
That test now uses the same layout as Metal.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21114>
2023-02-04 07:04:49 +00:00
Alyssa Rosenzweig
9b2dc92228 ail: Test 63x63 cube map
This has a subtle interaction with page-aligned layers. Written while debugging
dEQP-GLES3.functional.texture.filtering.cube.combinations.nearest_nearest_repeat_clamp

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21114>
2023-02-04 07:04:49 +00:00
Alyssa Rosenzweig
294351ff77 ail: Test mipmapped_z behaviour
The mipmapped_z = true case is checked against Metal, the false case is smoke
testing the old behaviour (which is still used for 2D arrays).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21114>
2023-02-04 07:04:49 +00:00
Alyssa Rosenzweig
c2bf66ab87 ail: Add layout->mipmapped_z input
For 3D images, the full miptree depends on the depth of the image, in contrast
to 2D arrays. We need to account for this to calculate the correct layer
strides.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21114>
2023-02-04 07:04:49 +00:00
Sergi Blanch Torne
60d7e15a7e ci: disable Collabora's LAVA lab for maintance
This is to inform you of some planned downtime in the LAVA lab as follows:

    Start: 2023-02-04 06:00 GMT
    End: 2023-02-06 12:00 GMT

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21119>
2023-02-04 00:21:05 -03:00
Ian Romanick
ea413e826b nir: Eliminate nir_op_f2b
Builds on the work of !15121.  This gets to delete even more code
because many drivers shared a lot of code for i2b and f2b.

No shader-db or fossil-db changes on any Intel platform.

v2: Rebase on 1a35acd8d9.

v3: Update a comment in nir_opcodes_c.py. Suggested by Konstantin.

v4: Another rebase. Remove f2b stuff from Midgard.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20509>
2023-02-03 22:39:57 +00:00
Ian Romanick
024122c069 nir/builder: Handle f2b conversions specially in nir_type_convert
No shader-db or fossil-db changes on any Intel platform.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20509>
2023-02-03 22:39:57 +00:00
Ian Romanick
b265020b82 nir/builder: Eliminate nir_f2b helper (and use of nir_f2b32 helper)
There were only two users. Replace each with nir_fneu instead.

This is now a squash of what was two separate commits.
nir_lower_pstipple_block is called after nir_lower_bool_to_int32, so
nir_fneu32 has to be used here or there will be regresssions in stipple
tests on llvmpipe.

v2: Rebase on !20869.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Suggested-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20509>
2023-02-03 22:39:57 +00:00
Mike Blumenkrantz
7b0d000342 zink: add back VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT for bindless
this was accidentally lost in refactor

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21100>
2023-02-03 21:59:07 +00:00
Mike Blumenkrantz
e67bdf47d4 zink: handle missing line rasterization modes with ds3
it's annoying to validate this at runtime since it has to happen during draw,
but storing the "usable" ds3 mode separately from the pipeline state should
be a reasonable enough compromise for perf here...hopefully

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21100>
2023-02-03 21:59:07 +00:00
Mike Blumenkrantz
813bb9e442 zink: cache and reuse dummy inputattachment for fbfetch
apparently an actual null descriptor is illegal here, and it's wasted cpu
anyway, so just cache the dummy surface on init and use that data when
fbfetch isn't active but the layout requires it

Fixes: 7ab5c5d36d ("zink: use EXT_descriptor_buffer with ZINK_DESCRIPTORS=db")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21100>
2023-02-03 21:59:07 +00:00
Mike Blumenkrantz
abf63b7c68 zink: fix more cases of heap/memtype suballocator mismatch
suballocation must happen based on the memtype, so also add some asserts to
ensure the slab bos are always what the caller expects

Fixes: f6d3a5755f ("zink: zink_heap isn't 1-to-1 with memoryTypeIndex")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21100>
2023-02-03 21:59:07 +00:00
Mike Blumenkrantz
e1e4ddcf10 zink: free descriptor buffer maps on batch state destroy
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21100>
2023-02-03 21:59:07 +00:00
SoroushIMG
4f8ba2b9aa zink: fix sparse residency query and minLOD feature checks
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21013>
2023-02-03 20:05:23 +00:00
Yiwei Zhang
86c6484fba venus: lazily query and cache gralloc front rendering usage
When skiavk is the default system ui renderer, venus icd gets preloaded
into Zygote. However, Zygote access to render node is normally denied by
selinux except for legacy bootanimation purpose. This change fixes venus
icd loading to avoid invoking cros gralloc driver loading by moving the
perform op outside, so that we still get the memory footprint win.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21107>
2023-02-03 19:33:18 +00:00
Emma Anholt
de5b67ef2c ci/llvmpipe: Drop skip of InteractionFunctionCalls2.
This one is down to <5 seconds here these days.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21084>
2023-02-03 19:01:59 +00:00
Emma Anholt
2eb07304e3 ci/swrast: Drop skips for tests whose perf had been fixed.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21084>
2023-02-03 19:01:59 +00:00
Emma Anholt
907b0a01b7 gallivm: Do the same codegen improvement for constant-index array loads.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21084>
2023-02-03 19:01:59 +00:00
Emma Anholt
cf47154300 gallivm: Fix codegen performance for constant-index register array stores.
Instead of generating num_components*simdwidth scattered stores, if
there's no indirect then we can just look up the pointer to the
base_offset and do a simd store there.

dEQP-VK.subgroups.ballot_broadcast.compute.subgroupbroadcast_i64vec4 goes
from 30s to ~2s.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21084>
2023-02-03 19:01:59 +00:00
Emma Anholt
833a74351c gallivm: Fix the type of array nir_registers.
This now matches how they get dereffed by get_soa_array_offsets() -- each
array element has num_components vecs inside of it, rather than each
components has an array in it.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21084>
2023-02-03 19:01:59 +00:00
Emma Anholt
a5d360550e gallivm: Enable GALLIVM_DEBUG (mostly) on non-DEBUG builds.
This is what let me do the performance work in my recent gallivm MRs.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21086>
2023-02-03 18:21:49 +00:00
Emma Anholt
947c60fa2f llvmpipe: Enable LP_DEBUG on normal builds.
I don't typically include DEBUG because it sometimes has expensive debug
code, but these options are not that.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21086>
2023-02-03 18:21:49 +00:00
Dylan Baker
fd9b50aa1c meson: combine checks for linker --gc-sections support
We first do an incomplete check for whether the linker supports
--gc-sections, then potentially add C and C++ arguments assuming that it
works, then later do a complete check to see if it actually works and
use --gc-sections. This means we can end up putting functions and data
in separate sections when we can't gc them.

Combine the checks, do less work, and be more accurate.

fixes: f51ce21e4e
       ("meson: Drop adding -Wl,--gc-sections to project c/cpp arguments.")

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21083>
2023-02-03 17:48:58 +00:00
Alyssa Rosenzweig
7f98a9ba2b panfrost: Implement GL_EXT_render_snorm on Bifrost+
It turns out it's really easy.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20684>
2023-02-03 17:21:34 +00:00
Emma Anholt
b6bd904019 ci/lvp: Drop the subgroupbroadcast skips.
These have the same runtime as the others in the group, and with these
optimizations they no longer time out.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21001>
2023-02-03 08:51:42 -08:00
Emma Anholt
70be21e7c6 gallivm: Use first active invocation in some image/ssbo accesses.
These should be looking at that rather than blindly using invocation 0
(which may be junk when in control flow).

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21001>
2023-02-03 08:51:40 -08:00
Emma Anholt
8c2493d041 gallivm: Use cttz instead of a loop for first_active_invocation().
This should be way faster to compile by not spamming so many loops at
LLVM, and faster to execute if LLVM didn't figure out what that loop
meant.

It looks vector reduce ops aren't really a thing, just a convenience in
the IR.  We should be able to do better by counting zeroes in the
exec_mask != 0 result.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21001>
2023-02-03 08:51:37 -08:00
Emma Anholt
c11fa55f6d gallivm: Return 0 first_active_invocation when we know that up front.
46 -> 30 seconds on
dEQP-VK.subgroups.ballot_broadcast.compute.subgroupbroadcast_i16vec4 by
not spamming LLVM with so many loops.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21001>
2023-02-03 08:51:35 -08:00
Emma Anholt
dc7c518abe gallivm: Refactor out a shared "get the first active invocation" loop.
Dynamic texture indices had a similar "find an active channel" loop,
though it happened to use the last active channel rather than the first.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21001>
2023-02-03 08:51:32 -08:00
Emma Anholt
0b0246706e gallivm: Optimize emit_read_invocation's first-invocation loop.
We don't need to deref invoc inside -- invoc is uniform in active
channels, so we can find our first active invocation in the loop, and then
dereference invocation once outside.

50 -> 46 seconds on
dEQP-VK.subgroups.ballot_broadcast.compute.subgroupbroadcast_i16vec4

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21001>
2023-02-03 08:51:12 -08:00
Alyssa Rosenzweig
d73f72120a asahi: Lower texcoords late
This uses the new pass to lower tex coordinates late, which gets us one step
closer to preprocessing NIR at CSO create time instead of variant create time.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21065>
2023-02-03 15:03:06 +00:00
Alyssa Rosenzweig
6908a0dece asahi: Run nir_lower_fragcolor during preprocessing
This pass needs to run early (because it depends on early I/O), but it doesn't
actually need the shader key. Why not? If we overestimate the number of render
targets, extra store_output intrinsics will be generated, but they will be
deleted by AGX tilebuffer lowering later.

Note we'll probably want something smarter than this for fragment epilogues in
the future to avoid piles of unnecessary moves.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21065>
2023-02-03 15:03:06 +00:00
Alyssa Rosenzweig
071ac59960 nir: Add a late texcoord replacement pass
Add a second NIR pass for lowering point/texture coordinate replacement (i.e.
point sprites). Why a second one? The current pass works on derefs/variables,
which is good for drivers that don't lower I/O at all (like Zink, where the pass
originates). However, it is problematic for hardware drivers: the inputs to this
pass depend on the shader key, so we want to run the pass as late as possible to
minimize the cost of building/compiling the associated shader variants. In
particular, we need to be able to lower point sprites after lowering I/O if we
would like to lower I/O when preprocessing NIR.

The logic for early lowering and late lowering is considerably different (the
late lowering is a lot simpler), so I've split this out into a second pass
rather than trying to weld them together into one.

This pass will be used on Asahi, which currently uses the early pass. It may be
useful for other drivers as well. (Actually, it's been shipping on Asahi for a
little while now, just hasn't been sent upstream yet.)

Tested with Neverball.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Asahi Lina <lina@asahilina.net>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21065>
2023-02-03 15:03:06 +00:00
Konstantin Seurer
4397c166c0 radv: Work around shader_call_data variables in raygen shaders
Closes: #5326
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20930>
2023-02-03 14:25:19 +00:00
David Heidelberg
002707ff09 ci/lavapipe: use dxvk for the traces
Since the job is manual, this stayed overlooked.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20875>
2023-02-03 13:48:51 +00:00
David Heidelberg
3bc1bf7eea ci: uprev piglit (etag md5 checksumming support)
Support for FDO etag http header.

Includes line-smooth-stipple test improvements.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20875>
2023-02-03 13:48:51 +00:00
Qiang Yu
ed419f46aa aco: remove early_rast wait insert
It's done in nir position export.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.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/20691>
2023-02-03 12:27:44 +00:00
Qiang Yu
f6b194b648 nir,ac/llvm,aco,radv,radeonsi: remove nir_export_vertex_amd
Reviewed-by: Timur Kristóf <timur.kristof@gmail.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/20691>
2023-02-03 12:27:44 +00:00
Qiang Yu
f44872c7b6 nir,ac/llvm,aco: remove nir_export_primitive_amd
Reviewed-by: Timur Kristóf <timur.kristof@gmail.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/20691>
2023-02-03 12:27:44 +00:00
Qiang Yu
aea109e25d ac/nir/ngg,radv: ms use ac_nir_export_(primitive|position|parameter)
Reviewed-by: Timur Kristóf <timur.kristof@gmail.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/20691>
2023-02-03 12:27:44 +00:00
Qiang Yu
80d928c20e ac/nir/ngg: gs use ac_nir_export_(position|parameter)
Reviewed-by: Timur Kristóf <timur.kristof@gmail.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/20691>
2023-02-03 12:27:44 +00:00
Qiang Yu
bae5a3157f ac/nir/ngg: prepare gather_vs_outputs to be used by gs
Reviewed-by: Timur Kristóf <timur.kristof@gmail.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/20691>
2023-02-03 12:27:44 +00:00
Qiang Yu
80506be31b ac/nir/ngg,radv,radeonsi: nogs use ac_nir_export_(position|parameter)
Reviewed-by: Timur Kristóf <timur.kristof@gmail.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/20691>
2023-02-03 12:27:44 +00:00
Qiang Yu
f084e9bbe8 ac/nir/ngg: change clipdist_neg_mask_var type to uint32
ACO does not support 8bit ALU ops.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.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/20691>
2023-02-03 12:27:44 +00:00
Qiang Yu
d798214c7b ac/nir/ngg: fix clip dist culling mask uninitialized
Fixes: f75452918b ("ac/nir/ngg: support clipdist culling")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.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/20691>
2023-02-03 12:27:44 +00:00
Qiang Yu
7c41cdb81f ac/nir,radv,radeonsi: gs copy shader use ac_nir_export_(position|parameter)
Reviewed-by: Timur Kristóf <timur.kristof@gmail.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/20691>
2023-02-03 12:27:44 +00:00
Qiang Yu
7308637bb4 ac/nir,radv,radeonsi: legacy vs use ac_nir_export_(position|parameter)
Reviewed-by: Timur Kristóf <timur.kristof@gmail.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/20691>
2023-02-03 12:27:44 +00:00
Qiang Yu
df8c93a9f3 radeonsi: set nr_pos_exports outside of llvm translation
This can save an abi interface when we share position export
code with RADV.

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/20691>
2023-02-03 12:27:43 +00:00
Qiang Yu
048d4de5e5 radeonsi: remove the extra handling for VS/TES primitive id
We have moved si_nir_assign_param_offsets before output lowering
pass, so there won't be primitive id store output when VS/TES here.

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/20691>
2023-02-03 12:27:43 +00:00
Qiang Yu
59135678cf radeonsi: update outputs written nir info
We may remove some outputs when si_nir_kill_outputs and
ac_nir_optimize_outputs, so update the outputs written
info for output lower pass to skip manipulating these
outputs.

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/20691>
2023-02-03 12:27:43 +00:00
Qiang Yu
dcccd94faf radeonsi: clamp vertex color in legacy gs instead of gs copy shader
gs copy shader is going to emit nir_export_amd directly so this vertex
color clamp pass which apply to nir_store_output will not work.

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/20691>
2023-02-03 12:27:43 +00:00
Qiang Yu
601ad9e0a9 amd,radeonsi: implement nir_load_force_vrs_rates_amd in driver abi
Reviewed-by: Timur Kristóf <timur.kristof@gmail.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/20691>
2023-02-03 12:27:43 +00:00
Qiang Yu
58988c3239 ac/nir: add force_vrs to ac_nir_export_position
Reviewed-by: Timur Kristóf <timur.kristof@gmail.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/20691>
2023-02-03 12:27:43 +00:00
Qiang Yu
daa12b1ab1 ac/nir: add ac_nir_export_parameter
For last VGT stage to export parameter outputs.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.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/20691>
2023-02-03 12:27:43 +00:00
Qiang Yu
f823581dd4 ac/nir: add ac_nir_export_position
Used by last VGT stage to export position related outputs.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.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/20691>
2023-02-03 12:27:43 +00:00
Qiang Yu
e9268b2c06 ac/nir: gs and nogs use ac_nir_export_primitive
Mesh shader primitive export is left unchanged because it needs
extra changes for per primitive output export when export
primitive.

Mesh shader will use second channel of primitive export.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.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/20691>
2023-02-03 12:27:43 +00:00
Qiang Yu
8331842258 aco: implement nir_export_amd
Reviewed-by: Timur Kristóf <timur.kristof@gmail.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/20691>
2023-02-03 12:27:43 +00:00
Qiang Yu
5fe4dd3d68 ac/llvm: implement nir_export_amd
Reviewed-by: Timur Kristóf <timur.kristof@gmail.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/20691>
2023-02-03 12:27:43 +00:00
Qiang Yu
5f24d58549 nir: add nir_export_amd intrinsic
Reviewed-by: Timur Kristóf <timur.kristof@gmail.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/20691>
2023-02-03 12:27:43 +00:00
Timur Kristóf
9af3a31744 ac/nir/cull: Alway remove zero-area triangles in face culling.
The face culling algorithm should have been disabled for
conservative overestimation because it already
(mistakenly) removed some close-to-zero area triangles.

Now that the driver disables it in that case,
let's always remove zero-area triangles.
This only costs +2 SALU instructions.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20987>
2023-02-03 09:39:54 +00:00
Timur Kristóf
3508597aa1 radv: Disable NGG culling when conservative overestimation is used.
Even when small primitive culling is disabled, the face culling algorithm
in ac_nir_cull can delete tiny triangles when their area is almost zero.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20987>
2023-02-03 09:39:54 +00:00
Constantine Shablya
9b3b7e5091 anv: handle ATTACHMENT_OPTIMAL layout
Closes: #8216
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21066>
2023-02-03 09:17:03 +00:00
Yonggang Luo
b1a33789b8 util: Implement util_iround with lrintf unconditionally
Because the place that called util_iround are always ensured
that INT_MIN <= f <= INT_MAX

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/19978>
2023-02-03 04:00:17 +00:00
Mike Blumenkrantz
e82369d06b zink: enable bindless texture with ZINK_DESCRIPTORS=db
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21085>
2023-02-03 02:12:33 +00:00
Mike Blumenkrantz
99ba529fee zink: implement descriptor buffer handling of bindless texture
pretty straightforward, just lazily allocating the context-based db
and then writing updates to it on-demand

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21085>
2023-02-03 02:12:33 +00:00
Mike Blumenkrantz
6b49dec675 zink: add a flag to indicate whether a descriptor buffer is bound
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21085>
2023-02-03 02:12:33 +00:00
Mike Blumenkrantz
f81a4e904c zink: break out descriptor binding into separate function
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21085>
2023-02-03 02:12:33 +00:00
Mike Blumenkrantz
362b8792e7 zink: set VK_PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT on compute pipelines
same as gfx

Fixes: 7ab5c5d36d ("zink: use EXT_descriptor_buffer with ZINK_DESCRIPTORS=db")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21085>
2023-02-03 02:12:33 +00:00
Mike Blumenkrantz
e471b4360d zink: skip updating descriptor buffer sets that aren't active
this is a no-op and illegal

Fixes: 7ab5c5d36d ("zink: use EXT_descriptor_buffer with ZINK_DESCRIPTORS=db")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21085>
2023-02-03 02:12:33 +00:00
Mike Blumenkrantz
933f1dc50b zink: fix bindless struct member comments
this was a bit confusing having the overall substruct comment which
was occasionally wrong

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21085>
2023-02-03 02:12:33 +00:00
Mike Blumenkrantz
f382922f08 zink: make bindless buffer_infos a union
prep for descriptor buffer handling

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21085>
2023-02-03 02:12:33 +00:00
Mike Blumenkrantz
dc60d373c9 zink: enable PIPE_CAP_ALLOW_GLTHREAD_BUFFER_SUBDATA_OPT
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21073>
2023-02-03 01:52:56 +00:00
Marek Olšák
b8f6758bae amd/ci: update sanctuary trace sha1
I guess it's because RB+ blending is now more precise.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
3ba1b18c90 radeonsi: set sampler COMPAT_MODE in the corresponding branch
no functional change

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
60a3f0667f radeonsi: call ac_init_llvm_once before any util_queue initialization
The winsys uses util_queue, which calls atexit, so do it before the winsys
is created.

Cc: stable

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
da7dfbe3b8 amd/llvm: fix LLVM 15 & 16 crashes in SelectionDAG.cpp
Cc: stable

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
0c0b978938 radeonsi: set NEVER as the depth compare func if depth compare is disabled
Fixes: 0c6e56c391 - mesa: (more) correctly handle incomplete depth textures

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
35a18134a3 amd/registers: remove confusing definitions from gfx10-rsrc.json
this will never be used and shouldn't have been added

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
1d8d223f08 amd: document OOB behavior on gfx11
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
76472c850b amd: fix typo in shadowed uconfig registers on gfx11
It used an invalid offset, which hung.

Fixes: f24f8665db - ac: implement register shadowing for gfx11

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
35fa57dfae amd: sort and re-indent packet definitions
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
8d9e18974f amd: update late_alloc_wave64 for gfx11
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
76e3437c1e amd: update the cache size for gfx1103_r1
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
2cdb6be86c amd: change pbb_max_alloc_count for gfx11
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/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
bfc37e7c63 amd: unify and tune the attribute ring size for gfx11
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
e25f08baf2 radeonsi: never set INTERPOLATE_COMP_Z
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/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
d087b3ec3c radeonsi: determine alpha_to_coverage robustly in si_update_framebuffer_blend_rasterizer
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
f2923168ba radeonsi: merge si_ps_key_update_framebuffer_blend & .._update_blend_rasterizer
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
a29218b557 radeonsi/gfx11: always set MSAA_NUM_SAMPLES=0 for DCC_DECOMPRESS
hw requirement

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
8532cb8e7e radeonsi: deduplicate VS/TES/GS update code
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
711c4bddb2 radeonsi/gfx11: use new packet EVENT_WRITE_ZPASS
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
4664b22f65 radeonsi/gfx11: move the PIXEL_PIPE_STAT_CONTROL event into the GFX preambles
Both the normal and shadowing preamable should do this.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
383269238d radeonsi/gfx11: fix blend->cb_target_mask dependency for shader keys
Shader keys only use cb_target_enabled_4bit. This may cause shaders to be
updated less often, but otherwise no change in behavior.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>š
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
d5ff270e0b radeonsi/gfx11: adjust ACCUM_* fields for tessellation
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/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
0b4b309fc6 radeonsi/gfx11: add a comment why we use PRIM_GRP_SIZE <= 252
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
d21850f753 radeonsi/gfx11: remove the INST_PREF_SIZE workaround
The hw does the right thing automatically. (i.e. enables or disables
the feature)

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
f6c30af00c radeonsi: implement RB+ depth-only rendering for better perf
The explanation is in the last change of this commit.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
2fc03e479b amd: improve RB+ blending precision
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
a9e9c4650d amd: update shadowed register tables for gfx11
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
b6f6465264 amd: update SX_BLEND_OPT_EPSILON.MRT0_EPSILON enum definitions
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
47f598a183 amd: fix tile_swizzle on gfx11 - should be shifted by 10 bits, not 8
This reverts the radv_adjust_tile_swizzle change to unify the code.

Fixes: 529eb739fc - radeonsi/gfx11: add CB deltas

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
84d59cdb59 amd: split GFX1103 into GFX1103_R1 and GFX1103_R2
Fixes: caa09f66ae - amd: add chip identification for gfx1100-1103

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
66d11391f7 radeonsi/gfx11: unset SAMPLE_MASK_TRACKER_WATERMARK to fix hangs
Same as PAL.

Fixes: 529eb739fc - radeonsi/gfx11: add CB deltas

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
8556b3db71 radeonsi: fix RB+ blending with sRGB formats
The epsilon for 8bpc is for the linear colorspace. There is no epsilon
for sRGB.

Fixes: 17021efc74 - radeonsi: adjust RB+ blend optimization settings

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
dacb111607 radeonsi/ci: add gfx1100 results
There are also a lot of flakes.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
6445d2eca9 radeonsi/ci: update gfx10.3 results
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Emma Anholt
fd28452631 turnip: Make the tiling-impossible case have an impossible tile layout.
This helped me catch inappropriate tiling work being done in this case.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21004>
2023-02-02 14:56:15 -08:00
Emma Anholt
3c3bd12af7 tu: Only emit the conditional gmem subpass resolves when gmem is possible.
No sense emitting this work when the subpass deps or attachment size
prevents gmem.  Noticed when I had uninit values in the tiling layout.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21004>
2023-02-02 14:56:15 -08:00
Emma Anholt
aae679e221 turnip: Optimize tile sizes to reduce the number of bins.
We were aiming for very square tiles, but it's actually better for us to
reduce the number of different bins so you take fewer trips through the
geometry and keep the caches hotter.  Example changes to aztec ruins on
angle:

    3x3 tiles of 352x352 to 4x2 tiles of 256x512
    4x5 tiles of 256x224 to 5x4 tiles of 224x256
    17x11 tiles of 160x128 to 14x11 tiles of 192x128
    12x7 tiles of 224x224 to 7x11 tiles of 384x128
    12x8 tiles of 224x192 to 7x11 tiles of 384x128
    11x6 tiles of 256x256 to 12x5 tiles of 224x288
    11x7 tiles of 256x224 to 7x9 tiles of 384x160
    8x4 tiles of 352x352 to 6x5 tiles of 448x288

and minecraft:

    3x3 tiles of 352x352 to 4x2 tiles of 256x512
    12x6 tiles of 256x256 to 3x23 tiles of 1024x64
    12x7 tiles of 256x224 to 8x9 tiles of 384x160

FPS changes:
VK aztec ruins normal: 1.12478% +/- 0.213393% (n=67)
ANGLE manhattan_31:    +1.42813% +/- 0.893332% (n=7).
ANGLE minecraft:       no change (n=21)
ANGLE google_maps:     +6.80618% +/- 2.40857% (n=4)
ANGLE trex_200:        no change (n=11)
ANGLE pubg:            no change (n=21)

Fixes: #8160
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21004>
2023-02-02 14:56:13 -08:00
Emma Anholt
e27f84c56e tu: Mark tiling impossible if we couldn't lay out gmem in the first place.
We were leaving the field undefined, which tripped me up later.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21004>
2023-02-02 14:55:59 -08:00
Sagar Ghuge
0ec3522163 nir: Handle other variants of image_samples properly while lowering
while lowering image_samples to one, we need to take
nir_intrinsic_image_deref_samples and
nir_intrinsic_bindless_image_samples intrinsic into account.

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

Fixes: ab4c2990ed ("intel/compiler: use lower_image_samples_to_one")
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21053>
2023-02-02 21:40:45 +00:00
Juston Li
6f4b375c94 anv: check initial cmd_buffer is chainable
Submitting a batch with the first command buffer with the simultaneous
bit set followed by a command buffer without the bit set gets past the
check and triggers this assert attempting to chain them:
../src/intel/vulkan/anv_batch_chain.c:1147: anv_cmd_buffer_chain_command_buffers: Assertion `num_cmd_buffers == 1' failed.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21056>
2023-02-02 21:17:33 +00:00
Jesse Natalie
9c5df90ae5 wsi/win32: We don't need a window DC for DXGI
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21049>
2023-02-02 19:48:00 +00:00
Jesse Natalie
192e7e0cef wsi/win32: Don't require buffer blits for software drivers
Lavapipe can directly render to a linear CPU image and then BitBlit
straight from there.

Fixes: 2f462105 ("vulkan/wsi: Hook-up DXGI swapchains and DComp")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8085
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21049>
2023-02-02 19:48:00 +00:00
Erik Faye-Lund
c8994256a6 anv, hasvk: remove stale TODO-files
This file hasn't really been updated since 2016, apart from a single
search-replace two years ago.

That's an eternity in ANV-land, so let's just remove these.

While we're at it, also remove the duplicate in hasvk.

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21044>
2023-02-02 19:25:15 +00:00
Lucas Stach
175732bb51 etnaviv: fix double scanout import of multiplanar resources
etna_resource_from_handle() is called for each plane of a multiplanar
resource, so there is no point in looping over all planes to do the
renderonly scanout import. In fact that will cause us to lose track
of the scanout imports from later planes when the earlier planes are
redoing the import, overwriting the pointer to the allocated
renderonly_scanout struct.

Drop the loop and just do the import for the current plane.

Fixes: 826f95778a ("etnaviv: always try to create KMS side handles for imported resources")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20993>
2023-02-02 19:08:29 +00:00
Emma Anholt
8839baee57 ci: Drop the itoral-gl-terrain demo from traces.
There's an app bug in the CSM rendering that causes undefined results.

Fixes: #8212
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21055>
2023-02-02 18:42:45 +00:00
Georg Lehmann
3c25edfdb7 aco: Improve wave64 cycle estimates.
Reviewed-By: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20507>
2023-02-02 17:59:23 +01:00
Mike Blumenkrantz
5a40190f04 Revert "zink: fix zink_mem_type_idx_from_bits()"
This reverts commit f7796997964bb462bcbfa6b9faca5dcf04b64e1b.

I was doing too much F2F and not enough thinking with this one

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21076>
2023-02-02 16:27:38 +00:00
Rose Hudson
0d4e375a58 asahi: wire up shader disk cache support
Note: I (Alyssa) have squashed in some minor changes squashed in pre merge. The
rest is Rose's work :-)

Closes: #8091
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20835>
2023-02-02 16:12:33 +00:00
Samuel Pitoiset
3ad9a6e7c2 radv: simplify an assertion after considering RADV_FORCE_VRS
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21068>
2023-02-02 15:06:07 +00:00
Samuel Pitoiset
3eb97b9d33 radv: skip compilation when possible with GPL fast-linking
When all shader stages have already been imported it's possible to
skip radv_graphics_pipeline_compile() entirely. This makes GPL
fast-linking VERY fast.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21068>
2023-02-02 15:06:07 +00:00
Samuel Pitoiset
6b513a9c6a radv: determine the last VGT API stage earlier
It can be computed right after the active stages are known. While we
are at it, simplify the code.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21068>
2023-02-02 15:06:07 +00:00
Samuel Pitoiset
031bbdfbe6 radv: stop using the graphics pipeline key after compilation
Only the blend state was relying on the graphics pipeline key. This
will allow us to skip generating it when there is no compilation at
all (for fast-linking with GPL).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21068>
2023-02-02 15:06:07 +00:00
Samuel Pitoiset
aebe65e88a radv: return a boolean value in radv_pipeline_needs_dynamic_ps_epilog()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21068>
2023-02-02 15:06:07 +00:00
Samuel Pitoiset
6ddf1fd9ad radv: pass the lib flags for generating the pipeline key
No functional change.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21068>
2023-02-02 15:06:07 +00:00
Eric Engestrom
04fefec70f v3dv: mark dEQP-VK.api.command_buffers.record_many_draws_secondary_2 as flaky
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21070>
2023-02-02 14:44:05 +00:00
Samuel Pitoiset
863bc08136 radv: remove one unused variable in radv_graphics_lib_pipeline_init()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21042>
2023-02-02 14:01:12 +00:00
Samuel Pitoiset
c9e032be7f radv: allow to create a noop FS in a library with GPL
Otherwise, a noop FS will be always compiled during linking if not
provided by the application and that is too slow for fast-linking.

This should be improved to use a global noop FS but it's really tricky
because NIR linking doesn't do anything when the next stage is unknown,
and hence doesn't remove unused varyings.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21042>
2023-02-02 14:01:12 +00:00
Mike Blumenkrantz
68e914a4ca zink: rework descriptor buffer templating to use offsets
compute programs can be reused across contexts, which means storing any
pointers directly like this is going to lead to desync and crash

instead, make this like regular descriptor templates and calculate the offset
from the current context to ensure that everything works as it should

fixes #8201

Fixes: 7ab5c5d36d ("zink: use EXT_descriptor_buffer with ZINK_DESCRIPTORS=db")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21020>
2023-02-02 12:59:15 +00:00
Asahi Lina
ed6edc07e4 asahi: Split off macOS support into its own file
All the ifdef __APPLE__ is getting really silly. Let's split off the
macOS UAPI abstraction into its own file, so we can have parallel
implementations.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21058>
2023-02-02 11:45:52 +00:00
Asahi Lina
2e51ccac82 asahi: Split off common BO code into its own file
In preparation for splitting off the macOS backend implementation into
its own file, pull out the shared BO code from agx_device.c into
agx_bo.c.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21058>
2023-02-02 11:45:52 +00:00
Alyssa Rosenzweig
ea285aea8d asahi: Use non-UAPI specific BO create flags
So we're not tied to the macOS or Linux UAPIs and are not translating awkwardly
from one to the other when creating BOs. They're not quite equivalent -- macOS
doesn't include writeback information in this flag field, and Linux doesn't have
a executable flag. (Maybe we should add one, though? Then we can enforce W^X.)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21058>
2023-02-02 11:45:52 +00:00
Martin Roukala (né Peres)
9e2365708b zink/ci: allow running manual jobs again on RADV
Fixes: f6c06ef2f6 ("ci: Add manual rules variations to disable.")
Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21036>
2023-02-02 12:18:33 +02:00
Martin Roukala (né Peres)
0c54f261ea ci/core-manual-rules: enclose the whole condition in quotes
Quoting a condition is apparently an effective way of working around
YAML parsing weirdness. However, the quotes need to surround the whole
expression, not just parts of it.

Fixes: f6c06ef2f6 ("ci: Add manual rules variations to disable.")
Suggested-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21036>
2023-02-02 12:18:33 +02:00
Alyssa Rosenzweig
5e14792200 agx: Centralize texture lowering
Lowering buffer textures will interact with multiple of our existing lowerings,
and it's convenient to have it all in one place. This also keeps the pass
ordering dependencies centralized.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21060>
2023-02-02 06:39:42 +00:00
Erico Nunes
7258f6bafd Revert "CI: Lima farm is offline"
This reverts commit 0733aafa22.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Acked-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21035>
2023-02-02 06:10:28 +00:00
Mike Blumenkrantz
d23b3a1394 zink: fix zink_mem_type_idx_from_bits()
at some point this used to work, but it no longer does what it's supposed
to do, which is return a memtype from a heap+flags

Fixes: d702a503ad ("zink: support multiple heaps per memory type")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21025>
2023-02-02 05:04:17 +00:00
Mike Blumenkrantz
ff5a761232 zink: only set VkPipelineColorBlendStateCreateInfo::attachmentCount without full ds3
this should be ignored by drivers/layers, but it isn't, and the crashing is immense

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21025>
2023-02-02 05:04:17 +00:00
Mike Blumenkrantz
fd0562693d lavapipe: try harder to reuse pipeline layouts during merge
the original code was quite conservative and always created a new layout,
but many times this is unnecessary, and the original layout can just be refcounted
since it doesn't need to be merged

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21051>
2023-02-02 04:49:42 +00:00
Mike Blumenkrantz
a1a859328b lavapipe: delete lvp_pipeline::mem_ctx
this is no longer used

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21051>
2023-02-02 04:49:42 +00:00
Mike Blumenkrantz
59af3b4ad4 lavapipe: delete unused pipelines immediately
deferring these can cause memory ballooning and oom

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21051>
2023-02-02 04:49:42 +00:00
Mike Blumenkrantz
408606af02 lavapipe: create gfx gallium csos at pipeline bind
this should minimize pipeline creation time and make fast-linking "fast"

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21051>
2023-02-02 04:49:42 +00:00
Mike Blumenkrantz
6f0303ba76 lavapipe: break out (and slightly refactor) gallium shader cso creation
there's also now a(n unused) flag to indicate that the csos have been created

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21051>
2023-02-02 04:49:42 +00:00
Mike Blumenkrantz
4031098b85 lavapipe: refcount nir shaders instead of cloning
this is just about ownership, not modification, so refcounting saves time

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21051>
2023-02-02 04:49:42 +00:00
Mike Blumenkrantz
3770eaab73 lavapipe: add refcounting for shader nir
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21051>
2023-02-02 04:49:42 +00:00
Mike Blumenkrantz
453f49ce6d lavapipe: move noop fs creation to device
this avoids creating a separate noop fs for every pipeline

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21051>
2023-02-02 04:49:42 +00:00
Chia-I Wu
dc7f6c5324 freedreno: support UBWC scanout
On sway+xwayland, both explicit and implicit modifiers are advertised.
While dri3proto says nothing about it, zwp_linux_dmabuf_v1 says

  A compositor that sends valid modifiers and DRM_FORMAT_MOD_INVALID for
  a given format supports both explicit modifiers and implicit
  modifiers.

"glmark2 -b build:model=bunny --fullscreen" goes from 468 to 598fps on
a618 @ 2160x1440.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20892>
2023-02-02 04:33:25 +00:00
Chia-I Wu
1cf28bd049 freedreno: add has_implicit_modifier helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20892>
2023-02-02 04:33:25 +00:00
Timur Kristóf
1244506c15 nir/opt_algebraic: Add optimization for ieq/ine and right-shift.
Fossil DB stats on GFX11:
Totals from 1343 (1.00% of 134913) affected shaders:
SpillSGPRs: 7145 -> 7137 (-0.11%)
CodeSize: 20737744 -> 20739148 (+0.01%); split: -0.02%, +0.03%
Instrs: 4010443 -> 4008449 (-0.05%); split: -0.05%, +0.00%
Latency: 50021520 -> 50021105 (-0.00%); split: -0.00%, +0.00%
InvThroughput: 6354371 -> 6354112 (-0.00%); split: -0.00%, +0.00%
VClause: 63035 -> 63038 (+0.00%); split: -0.01%, +0.01%
SClause: 121162 -> 121166 (+0.00%)
Copies: 251354 -> 251058 (-0.12%); split: -0.18%, +0.06%
PreSGPRs: 137283 -> 137299 (+0.01%)

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20936>
2023-02-02 03:08:19 +00:00
Kenneth Graunke
873dfb673b anv: Perform load_constant address math in 32-bit rather than 64-bit
We lower NIR's load_constant to load_global_constant, which uses A64
bindless messages.  As such, we do the following math to produce the
address for each load:

   base_lo@32 <- BRW_SHADER_RELOC_CONST_DATA_ADDR_LOW
   base_hi@32 <- BRW_SHADER_RELOC_CONST_DATA_ADDR_HIGH
   base@64 <- pack_64_2x32_split(base_lo, base_hi)
   addr@64 <- iadd(base@64, u2u64(offset@32))

On platforms that emulate 64-bit math, we have to emit additional code
for the 64-bit iadd to handle the possibility of a carry happening and
affecting the top bits.

However, NIR constant data is always uploaded adjacent to the shader
assembly, in the same buffer.  These buffers are required to live in a
4GB region of memory starting at Instruction State Base Address.  We
always place the base address at a 4GB address.  So the constant data
always lives in a buffer entirely contained within a 4GB region, which
means any offsets from the start of the buffer cannot possibly affect
the high bits.

So instead, we can simply do a 32-bit addition between the low bits of
the base and the offset, then pack that with the unchanged high bits.

On anv, INSTRUCTION_STATE_POOL_MIN_ADDRESS is 8GB, so the high bits are
always 0x2.  We don't even need to patch that portion of the address and
can just use an immediate value.  We do still need to pack, however.

fossil-db on Icelake indicates the following for affected shaders:

   Instrs: 10830023 -> 10750080 (-0.74%)
   Cycles: 1048521282 -> 1046770379 (-0.17%); split: -0.33%, +0.16%
   Subgroup size: 103104 -> 103112 (+0.01%)
   Send messages: 570886 -> 570760 (-0.02%)
   Loop count: 14428 -> 14429 (+0.01%)
   Spill count: 14246 -> 14244 (-0.01%); split: -0.06%, +0.04%
   Fill count: 22802 -> 22794 (-0.04%); split: -0.04%, +0.01%
   Scratch Memory Size: 654336 -> 662528 (+1.25%)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20999>
2023-02-02 02:45:04 +00:00
Kenneth Graunke
a0e7e7ff41 iris: Perform load_constant address math in 32-bit rather than 64-bit
We lower NIR's load_constant to load_global_constant, which uses A64
bindless messages.  As such, we do the following math to produce the
address for each load:

   base_lo@32 <- BRW_SHADER_RELOC_CONST_DATA_ADDR_LOW
   base_hi@32 <- BRW_SHADER_RELOC_CONST_DATA_ADDR_HIGH
   base@64 <- pack_64_2x32_split(base_lo, base_hi)
   addr@64 <- iadd(base@64, u2u64(offset@32))

On platforms that emulate 64-bit math, we have to emit additional code
for the 64-bit iadd to handle the possibility of a carry happening and
affecting the top bits.

However, NIR constant data is always uploaded adjacent to the shader
assembly, in the same buffer.  These buffers are required to live in a
4GB region of memory starting at Instruction State Base Address.  We
always place the base address at a 4GB address.  So the constant data
always lives in a buffer entirely contained within a 4GB region, which
means any offsets from the start of the buffer cannot possibly affect
the high bits.

So instead, we can simply do a 32-bit addition between the low bits of
the base and the offset, then pack that with the unchanged high bits.

On iris, IRIS_MEMZONE_SHADER is at [0, 4GB) so the high bits are always
zero.  We don't even need to patch that portion of the address and can
simply use u2u64 to promote the 32-bit add result to a 64-bit value
where the top bits are 0.

shader-db on Icelake indicates that this:
- Helps instructions: -1.13% in 135 affected programs
- Helps spills/fills: -4.08% / -4.18% in 4 affected programs
- Gains us 1 SIMD16 compute shader instead of SIMD8

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20999>
2023-02-02 02:45:04 +00:00
Timur Kristóf
95d06343c6 radv: Don't place CS in VRAM when bandwidth is too low.
People who use RADV on eGPU have reported poor performance by default.
They also noted that the "nosam" option helps.

This commit disables placing CS objects in VRAM when the bandwidth is
below that of PCIe 3.0 x8. Note that eGPUs are typically PCIe 3.0 x4.

Contributes-to: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7340
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/20842>
2023-02-02 02:13:10 +00:00
Timur Kristóf
ef668f3714 ac/gpu_info: Add has_pcie_bandwidth_info.
This is so that we can tell whether the current kernel
has the PCIe bandwidth info available or not.

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/20842>
2023-02-02 02:13:10 +00:00
Jesse Natalie
d7730fcf22 vulkan/wsi/win32: Support tearing (immediate) and VSync (FIFO) present modes
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20945>
2023-02-02 01:30:28 +00:00
Jesse Natalie
747604b17c vulkan/wsi: Add a wsi_device param to get_present_modes
The Win32 WSI will want to query capabilities of the device to
determine what's available.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20945>
2023-02-02 01:30:28 +00:00
Sagar Ghuge
0c083d29a5 intel/fs: Always stall between the fences on Gen11+
Be conservative in Gfx11+ and always stall in a fence.  Since there are
two different fences, and shader might want to synchronize between them.

This change also brings back the original code block for the stall
between the fence and comment from the commit
b390ff3517.

v2: (Caio)
 - Re-arrange code block.
 - Adjust comment.

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

Fixes: f7262462 ("intel/fs: Rework fence handling in brw_fs_nir.cpp")
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Tested-by: Mark Janes <markjanes@swizzler.org>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20996>
2023-02-02 00:21:21 +00:00
Emma Anholt
51ea81c0a1 ci: Fix perf job condition.
We were supposed to be checking that the job had "performance" in the
name, not that the user (which we already checked is marge) has
"performance" in their name.

Fixes: f6c06ef2f6 ("ci: Add manual rules variations to disable irrelevant driver jobs.")
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21002>
2023-02-01 23:53:26 +00:00
Emma Anholt
5d1c693893 ci: Fix perf jobs blocking Marge pipelines.
They got accidentally disabled entirely, so they didn't block merge, but
once they re-enable then they'll block us again.  The problem was that I
moved allow_failure to a .performance-rules section, but we only ever
inherit the rules from that location, not the rest of yml.

This is basically a revert of 67547a04b6 ("ci: Move the performance
jobs' allow_failure:true to the gl rules."), though I still keep the
allow_failure in a more common location with comments, since perf jobs are
a huge trap.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21002>
2023-02-01 23:53:26 +00:00
Samuel Pitoiset
aa68b98b87 radv: remove radv_pipeline_stage::spirv::sha1
This is no longer used.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21048>
2023-02-01 23:25:52 +00:00
Samuel Pitoiset
853f8eb930 radv: remove redundant zero initialization of pipeline layout
It's already zeroed in radv_pipeline_layout_init().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21048>
2023-02-01 23:25:52 +00:00
Samuel Pitoiset
1f67782eb2 radv: optimize radv_pipeline_layout_add_set() slightly
That value is already computed when a descriptor set layout is created.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21048>
2023-02-01 23:25:52 +00:00
Yiwei Zhang
a73a5915fb venus: log upon device creation
Log the deviceName and driverInfo gated behind VN_DEBUG=log_ctx_info

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21030>
2023-02-01 22:04:41 +00:00
Pavel Ondračka
7e6acfd587 nir: mark progress when removing trailing unused load_const channels
When the unused channels were at the end and so no reswizzling was
needed, we wouldn't correctly mark the progress.

Fixes: 3305c960
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21014>
2023-02-01 20:33:31 +00:00
Pavel Ondračka
fe56dd9c42 nir: mark progress when removing trailing unused alu channels
When the unused channels were at the end and so no reswizzling was
needed, we wouldn't correctly mark the progress.

Fixes: cb7f2012
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21014>
2023-02-01 20:33:31 +00:00
Pavel Ondračka
ef800da3f7 nir: nir opt_shrink_vectors whitespace fix
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21014>
2023-02-01 20:33:31 +00:00
Amber
ab4c2990ed intel/compiler: use lower_image_samples_to_one
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewer-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20813>
2023-02-01 19:52:49 +00:00
Amber
e8bfb71660 ir3: use lower_image_samples_to_one
This is necessary to properly support ARB_shader_texture_image_samples
fixes crash in KHR-GL45.shader_texture_image_samples_tests.image_functional_test

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Reviewer-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20813>
2023-02-01 19:52:49 +00:00
Amber
c384690ab7 nir: support lowering nir_intrinsic_image_samples to a constant load
This can be used by multiple drivers that do not support ms images

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Reviewer-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20813>
2023-02-01 19:52:49 +00:00
Konstantin Seurer
a568a5492f radv: Fix creating accel structs with unbound buffers
If the buffer hasn't been bound to memory yet, we will dereference a
NULL pointer in radv_CreateAccelerationStructureKHR.

cc: mesa-stable

Closes: #8199
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21019>
2023-02-01 19:31:43 +00:00
Sil Vilerino
37652da616 d3d12: Honor suggested driver profile/level for H264/HEVC encode
Fixes some H264 <-> HEVC transcode cases where the wrong level/profile was assigned to the output bitstream

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21043>
2023-02-01 19:17:21 +00:00
Rhys Perry
bfd4ac4581 aco: limit VALUPartialForwardingHazard search
Complicated CFG and lots of SALU can cause this to take an extremely long
time to finish.

Fixes
dEQP-VK.graphicsfuzz.cov-value-tracking-selection-dag-negation-clamp-loop
and Monster Hunter Rise demo compile times.

fossil-db (gfx1100):
Totals from 57 (0.04% of 134574) affected shaders:
Instrs: 170919 -> 171165 (+0.14%)
CodeSize: 860144 -> 861128 (+0.11%)
Latency: 961466 -> 961505 (+0.00%)
InvThroughput: 127598 -> 127608 (+0.01%)

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/8153
Fixes: 5806f0246f ("aco/gfx11: workaround VALUPartialForwardingHazard")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20941>
2023-02-01 18:52:40 +00:00
José Roberto de Souza
8092bc2158 intel/ds: Fix crash when allocating more intel_ds_queues than u_vector was initialized
u_vector_add() don't keep the returned pointers valid.
After the initial size allocated in u_vector_init() is reached it will
allocate a bigger buffer and copy data from older buffer to the new
one and free the old buffer, making all the previous pointers returned
by u_vector_add() invalid and crashing the application when trying to
access it.

This is reproduced when running
dEQP-VK.synchronization.signal_order.timeline_semaphore.* in DG2 SKUs
that has 4 CCS engines, INTEL_COMPUTE_CLASS=1 is set and of course
perfetto build is enabled.

To fix this issue here I'm moving the storage/allocation of
struct intel_ds_queue to struct anv_queue/iris_batch and using
struct list_head to maintain a chain of intel_ds_queue of the
intel_ds_device.
This allows us to append or remove queues dynamically in future if
necessary.

Fixes: e760c5b37b ("anv: add perfetto source")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20977>
2023-02-01 18:31:29 +00:00
Faith Ekstrand
1b3c746eec hasvk: Let spirv_to_nir() set UBO/SSBO base cast alignments
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21027>
2023-02-01 17:54:40 +00:00
Faith Ekstrand
85d44b0f97 anv: Let spirv_to_nir() set UBO/SSBO base cast alignments
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21027>
2023-02-01 17:54:40 +00:00
Faith Ekstrand
f78e4cec32 vtn: Set alignment on initial UBO/SSBO casts
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21027>
2023-02-01 17:54:40 +00:00
Rob Clark
e29001d0e7 freedreno/a6xx: Remove excess CS flushing
Also requires fixing where we emit barriers, and flushing pending
barriers at the end of the batch.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20975>
2023-02-01 17:28:41 +00:00
Rob Clark
9b22bdc956 freedreno/a6xx: Also FLUSH_CACHE on image barrier
For the same reason we need to on an UPDATE_BUFFER barrier.  Fixes
KHR-GLES31.core.compute_shader.pipeline-post-fs once the hard-coded
cache-flush is removed from launch_grid path.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20975>
2023-02-01 17:28:41 +00:00
Rob Clark
23e65c6084 freedreno/a6xx: Make shader state independent of grid info
Eventually we want to move this into a state group, so we can pre-bake
the cmdstream and re-emit it via CP_SET_DRAW_STATE when it is dirty.
But in order to do that it needs to not depend on grid info.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20975>
2023-02-01 17:28:41 +00:00
Rob Clark
1faf7133d4 freedreno: Don't open-code setting dirty CS state
There is actually no issue with setting FD_DIRTY_PROG, since all state
is marked dirty when we switch from compute to 3d.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20975>
2023-02-01 17:28:41 +00:00
Rob Clark
5a37cd8569 freedreno/a6xx: Don't double-write SP_CS_OBJ_START
Also SP_CS_INSTRLEN.  This is already done in fd6_emit_shader().

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20975>
2023-02-01 17:28:41 +00:00
Rob Clark
a063caa46a freedreno: Skip flush_resource with explicit sync
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20975>
2023-02-01 17:28:41 +00:00
Rob Clark
2503e22717 freedreno: nondraw-batch
Allow multiple compute grids to be combined into a single non-draw
batch.  This will allow us to optimize state emit and remove excess
flushing between compute jobs.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20975>
2023-02-01 17:28:41 +00:00
Rob Clark
0e3f2646dd freedreno/a6xx: Add CS instrlen workaround
Based on !19023.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20975>
2023-02-01 17:28:41 +00:00
Rob Clark
bfd7d9e22e freedreno/a6xx: Add missing CS_BINDLESS mapping
Fixes: e51975142c ("freedreno/a6xx: Add bindless state"
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20975>
2023-02-01 17:28:41 +00:00
Rob Clark
13fe9c3e63 freedreno/ir3: Scalarize load_ssbo
The benefits of turning it into isam (which needs to be scalar as the
SSBO is sampled as a single component R32 texture) outweigh the benefits
of vectorizing.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20975>
2023-02-01 17:28:41 +00:00
Rob Clark
951d963565 freedreno/a6xx: LRZ for MSAA
We don't need to fall off the LRZ path when we fall back to clearing
depth with a u_blitter draw, since u_blitter uses zsa state to achieve
the depth/stencil clear and this is entirely compabile with LRZ.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20975>
2023-02-01 17:28:41 +00:00
Rob Clark
5eb85ef756 freedreno/decode: Increase size of offsets table
The offsets table stores offsets of a buffer (such as cmdstream) that
we've already dumped.  The suballoc pool results in more suballocated
cmdstream allocated from a single backing buffer, meaning that we need
to increase the size of this table.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20975>
2023-02-01 17:28:41 +00:00
Georg Lehmann
2b264455b5 aco: use s_pack_ll_b32_b16 for constant copies
Totals from 2 (0.00% of 134913) affected shaders:
CodeSize: 28636 -> 28628 (-0.03%)

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20970>
2023-02-01 17:07:25 +00:00
Georg Lehmann
9ee9b0859b aco: use s_bfm_64 for constant copies
Foz-DB Navi21:
Totals from 1025 (0.76% of 134913) affected shaders:
CodeSize: 1436752 -> 1432412 (-0.30%)

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20970>
2023-02-01 17:07:25 +00:00
Rhys Perry
bbc5247bf7 aco/spill: always end spill vgpr after control flow
To fix a hypothetical issue:

v0 = start_linear_vgpr
if (...) {

} else {
   use_linear_vgpr(v0)
}
v0 = phi

We need a p_end_linear_vgpr to ensure that the phi does not use the same
VGPR as the linear VGPR.

This is also much simpler.

fossil-db (gfx1100):
Totals from 1195 (0.89% of 134574) affected shaders:
Instrs: 4123856 -> 4123826 (-0.00%); split: -0.00%, +0.00%
CodeSize: 21461256 -> 21461100 (-0.00%); split: -0.00%, +0.00%
Latency: 62816001 -> 62812999 (-0.00%); split: -0.00%, +0.00%
InvThroughput: 9339049 -> 9338564 (-0.01%); split: -0.01%, +0.00%
Copies: 304028 -> 304005 (-0.01%); split: -0.02%, +0.01%
PreVGPRs: 115761 -> 115762 (+0.00%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20621>
2023-02-01 15:45:22 +00:00
Rhys Perry
850d945baf aco/tests: add setup_reduce_temp.divergent_if_phi
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/20621>
2023-02-01 15:45:22 +00:00
Rhys Perry
44fdd2ebcb aco: end reduce tmp after control flow, when used within control flow
In the case of:

v0 = start_linear_vgpr
if (...) {

} else {
   use_linear_vgpr(v0)
}
v0 = phi

We need a p_end_linear_vgpr to ensure that the phi does not use the same
VGPR as the linear VGPR.

fossil-db (gfx1100):
Totals from 3763 (2.80% of 134574) affected shaders:
MaxWaves: 90296 -> 90164 (-0.15%)
Instrs: 6857726 -> 6856608 (-0.02%); split: -0.03%, +0.01%
CodeSize: 35382188 -> 35377688 (-0.01%); split: -0.02%, +0.01%
VGPRs: 234864 -> 235692 (+0.35%); split: -0.01%, +0.36%
Latency: 47471923 -> 47474965 (+0.01%); split: -0.03%, +0.04%
InvThroughput: 5640320 -> 5639736 (-0.01%); split: -0.04%, +0.03%
VClause: 93098 -> 93107 (+0.01%); split: -0.01%, +0.02%
SClause: 214137 -> 214130 (-0.00%); split: -0.00%, +0.00%
Copies: 369895 -> 369305 (-0.16%); split: -0.31%, +0.15%
Branches: 164996 -> 164504 (-0.30%); split: -0.30%, +0.00%
PreVGPRs: 210655 -> 211438 (+0.37%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20621>
2023-02-01 15:45:22 +00:00
Marek Olšák
e2d63c9a62 ac/gpu_info: add PCIe info
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20790>
2023-02-01 14:58:57 +00:00
Marek Olšák
e267b86d80 amd: update amdgpu_drm.h
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20790>
2023-02-01 14:58:57 +00:00
Samuel Pitoiset
cd6712e3a8 radv: pass pCreateInfo to radv_graphics_pipeline_compile()
This removes some duplicated code.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20990>
2023-02-01 14:20:47 +00:00
Samuel Pitoiset
6f17ce08fc radv: pass radv_compute_pipeline to radv_compute_pipeline_compile()
Similar to graphics.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20990>
2023-02-01 14:20:47 +00:00
Samuel Pitoiset
b4deb3aa32 radv: move retained shaders info to radv_graphics_pipeline
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20990>
2023-02-01 14:20:47 +00:00
Samuel Pitoiset
b982f8bbe4 radv: pass radv_graphics_pipeline to radv_graphics_pipeline_compile()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20990>
2023-02-01 14:20:47 +00:00
Samuel Pitoiset
d1b36b01a2 radv: add helpers for capturing shaders and statistics
Instead of duplicating the logic everywhere.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20990>
2023-02-01 14:20:47 +00:00
Samuel Pitoiset
e1bc8b0b21 radv: simplify pipeline_has_ngg during graphics shaders compilation
The is_ngg field is copied during shader info linking for GS, so
after radv_shader_fill_info() is performed, it's possible to use it.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20990>
2023-02-01 14:20:47 +00:00
Samuel Pitoiset
08e496c29d radv: remove useless check about CS in radv_lower_io()
This function is now called only for graphics pipeline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20990>
2023-02-01 14:20:47 +00:00
Lionel Landwerlin
6eb75dc74c anv: expose EXT_load_store_op_none
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21018>
2023-02-01 12:53:29 +00:00
Val Packett
9b0c688f51 mailmap: Remap name and email for Val Packett
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21032>
2023-02-01 11:30:12 +00:00
Tapani Pälli
6bdc29e2e6 intel: enable existing workaround for ICL platform
Patch changes comment to refer to the lineage 14014097488, this
workaround applies for ICL as well.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20952>
2023-02-01 11:09:19 +00:00
Konstantin Seurer
7e072cfba2 radv: Improve the BVH size estimation
The previous estimation was from before we had proper LBVH and PLOC.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20988>
2023-02-01 10:34:36 +00:00
Mike Blumenkrantz
03c2bdda60 zink: use VK_EXT_multisampled_render_to_single_sampled for EXT_multisample_render_to_texture
this extension was added for the purpose of emulating the GL ext,
and using it is reasonably straightforward

the only (somewhat) invasive part is modifying the renderpass/dynamic hashes
to have samplecounts in the key, but this is also not too much work

now only fbfetch requires real renderpasses, and everything else is dynamic

fixes #7559

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20883>
2023-02-01 10:08:57 +00:00
Mike Blumenkrantz
7888460257 zink: shrink zink_render_pass_state::msaa_expand_mask
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20883>
2023-02-01 10:08:57 +00:00
Mike Blumenkrantz
dc0a251e4e zink: hook up VK_EXT_multisampled_render_to_single_sampled
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20883>
2023-02-01 10:08:57 +00:00
Eric Engestrom
6291d4d339 meson: turn android-libbacktrace into a feature option
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20915>
2023-02-01 06:33:52 +00:00
Rob Clark
10992256dd freedreno/gmem: Fix for partial z/s fast-clear
If we have a combined depth+stencil buffer, but fast-clear just one of
the two channels, we need to mark the other as needing restore.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20998>
2023-02-01 05:19:38 +00:00
Illia Polishchuk
6962bf4e57 nir: Add sha1 hash for nir shaders converted from spir-v
The sha1 hash inside nir structure
makes it easier to find bad shader in games.

For example INTEL_DEBUG=fs will show not zero
source_sha1 field for shaders with vulkan applications

Signed-off-by: Illia Polishchuk <illia.a.polishchuk@globallogic.com>

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21012>
2023-02-01 04:19:04 +00:00
Nicolas Dufresne
dc2119bf3f util/format: Fix wrong colors when importing YUYV and UYVY
This changes the swizzling so that importation of YUYV dmabuf without
dedicated blitter HW can work.

v2: fix the other format too, update test results

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20815>
2023-02-01 03:24:23 +00:00
Dmitry Osipenko
4fe2247be5 util/disk_cache: Switch to multipart mesa-db cache
Replace single file mesa-db cache with multipart mesa-db cache.
Each part of the multipart cache essentially is a single file
mesa-db cache, aka database shard. Multipart cache brings much
more optimized cache eviction times in comparison to a single file
cache.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20256>
2023-02-01 02:47:30 +00:00
Dmitry Osipenko
fd9f7b748e util/mesa-db: Introduce multipart mesa-db cache
Whenever a single file mesa-db cache hits max size limit, a half of cache
is evicted and the cache file is defragmented. The downside of this eviction
strategy is that it causes high disk IO usage during eviction if mesa-db
cache file size is large.

In order to mitigate this downside, we will split mesa-db into multiple
part such that only one part will be evicted at a time. Each part will be
an individual single file mesa-db cache, like a DB shard. The new multipart
mesa-db cache will merge the parts into a single virtual cache.

This patch introduces two new environment variables:

1. MESA_DISK_CACHE_DATABASE_NUM_PARTS:
Controls number of mesa-db cache file parts. By default 50 parts will be
created. The old pre-multipart mesa-db cache files will be auto-removed
if they exist, i.e. Mesa will switch to the new DB version automatically.

2. MESA_DISK_CACHE_DATABASE_EVICTION_SCORE_2X_PERIOD:
Controls the eviction score doubling time period. The evicted DB part
selection is based on cache entries size weighted by 'last_access_time' of
the entries. By default the cache eviction score is doubled for each month
of cache entry age, i.e. for two equally sized entries where one entry is
older by one month than the other, the older entry will have x2 eviction
score than the other entry. Database part with a highest total eviction
score is selected for eviction.

This patch brings x40 performance improvement of cache eviction time using
multipart cache vs a single file cache due to a smaller eviction portions
and more optimized eviction algorithm.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20256>
2023-02-01 02:47:30 +00:00
Dmitry Osipenko
4964b98967 util/cache_test: Remove dummy cache entry added by cache_exists()
The cache_exists() function adds a dummy cache entry that may affect cache
eviction testing results. Remove this entry.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20256>
2023-02-01 02:47:30 +00:00
Dmitry Osipenko
c92c99481f util/mesa-db: Support removal of cache entries
Add support for removal of cache entries to mesa-db cache. This allows
to have a more predictable unit tests by removing dummy entries that
are added to cache when test-cache is created by unit-testing framework.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20256>
2023-02-01 02:47:30 +00:00
Dmitry Osipenko
f68db0da4c util/mesa-db: Don't account header size
In order to ease writing mesa-db eviction unit tests, stop accounting
mesa-db cache file header size during checking whether cache file reached
the size limit. This change ensures that older unit tests will keep working
whenever cache header version/size will change.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20256>
2023-02-01 02:47:30 +00:00
Dmitry Osipenko
51869405bc util/cache_test: Unset env vars left after Cache.List test
The environment variables are persistent and must be explicitly unset by
each cache test, otherwise next test will fail. Add the missing unsets to
the Cache.List test.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20256>
2023-02-01 02:47:30 +00:00
Lina Versace
a429d06878 mailmap: Lina is Chad's new name
If you can longer find chadversary or chadv on the interwebs, then
search for linyaa or versalinyaa.

Egg-crAcked-By: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Egg-Cracked-By: Faith Ekstrand <faith@gfxstrand.net>
Egg-Cracked-By: Lyude Paul <lyude@redhat.com>
Egg-Cracked-By: Wann
Egg-Cracked-By: Zach Lesher
Egg-Cracked-By: 初音ミク
Acked-by: Daniel Stone <daniels@collabora.com>
2023-01-31 18:12:42 -08:00
Lionel Landwerlin
13de23ea07 intel: add missing PS restriction on BDW+
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-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/20949>
2023-02-01 00:28:53 +00:00
Lionel Landwerlin
75159304b0 docs: list anv in EXT_extended_dynamic_state3 support
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21017>
2023-01-31 22:34:07 +00:00
Ryan Neph
65adf0c0af util/xmlconfig: add MESA_DRICONF_EXECUTABLE_OVERRIDE
Allow the loading process to affect driconf option matching without
changing the behavior throughout mesa common code or leaking the name of
the loading process to logs, artifact storage, or in sub-thread naming,
as can be the case with the broader MESA_PROCESS_NAME override.

This new MESA_DRICONF_EXECUTABLE_OVERRIDE takes higher precedence over
MESA_PROCESS_NAME in the case where both are set.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20779>
2023-01-31 22:02:58 +00:00
Ryan Neph
887ca5e1b2 util/u_process: remove util_get_process_name_may_override()
Also deprecate GALLIUM_PROCESSS_NAME in favor of MESA_PROCESS_NAME,
while maintaining existing functionality for use cases relying on
GALLIUM_PROCESSS_NAME.

GALLIUM_PROCESSS_NAME takes higher precedence over MESA_PROCESS_NAME in
the case where both are set.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20779>
2023-01-31 22:02:58 +00:00
Ryan Neph
c8fe878717 util/u_process: add MESA_PROCESS_NAME override to util_get_process_name()
Allow processes to set a custom process name before loading drivers.

Especially useful for virtualized workloads hidden behind a
generically-named host renderer process (e.g. Venus render_server) to
retain game-specific driconf option matching.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20779>
2023-01-31 22:02:58 +00:00
Ryan Neph
a2b296c75b ci: fix directory existence racing in parallel test execution
meson tests sharing a binary (and deviating in their env/args) will
produce temporary logs to the same directory, which is assumed to exist
only for the duration of a single test. This is problematic when running
tests in parallel, as one test may remove the directory before the
other(s) finish, causing a test flake.

This appends the each test's pid to the output directory to enforce
uniqueness and avoid the race.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20779>
2023-01-31 22:02:58 +00:00
Samuel Pitoiset
064141266f radv: skip shaders cache for fast-linked pipelines with GPL
Shader binaries that are imported during linking should already be in
the cache (not yet implemented though) and computing the per pipeline
cache hash is really expensive.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21009>
2023-01-31 20:27:50 +00:00
Thong Thai
2fe3ac2f88 radeonsi/vcn: use encoder/decoder caps reported by kernel
Rely on the kernel for video encoder/decode capabilities where possible,
since there might be special cases for some devices. Otherwise, fallback
to the older logic for older kernels.

v2: Made the macro lines shorter and added a comment to explain (David)
v3: Undo deleting some logic (Ruijing)

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20969>
2023-01-31 18:56:18 +00:00
Marcin Ślusarz
af9e2b8bf1 intel/compiler/mesh: remove dead code path supporting >4 dword writes
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20858>
2023-01-31 18:28:21 +00:00
Marcin Ślusarz
be82ed28f0 intel/compiler/mesh: support longer write messages
Allowing longer writes reduces the number of send messages needed
to support unaligned 4-component writes.

Note: nothing currently generates 8-component writes, so this change
makes "second_mask" code path in emit_urb_direct_writes and
emit_urb_indirect_writes_mod dead.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20858>
2023-01-31 18:28:21 +00:00
Alyssa Rosenzweig
0f087b56d0 agx: Bump preamble_storage_size to 512
nir_opt_preamble is now aware of the internal uniforms we insert, so it can use
the whole uniform file available to it. This lets us push more (all?) uniform
loads in Dolphin ubershaders to the preamble.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20562>
2023-01-31 17:02:34 +00:00
Alyssa Rosenzweig
02fe57b7e9 agx: Lower system values in NIR in the driver
To comply with The Ekstrand Rule.

AGX has a large number of "uniform registers" available. These may be loaded
with arbitrary ranges of GPU memory by the driver, or they can be written by the
preamble shader. Currently, the compiler runs nir_opt_preamble on the first half
of the uniform file, and then translates NIR sysvals to moves from the second
half of the uniform file, passing back a uniform->sysval map for the GL driver
to respect. This has (at least) two issues:

* Since nir_opt_preamble runs before gathering sysvals, it has to assume the
  maximum number of sysvals are pushed, which can prevent it from moving some
  computation to the preamble due to running out of partitioned uniform registers.
  This is a problem for Dolphin's ubershaders, though it's unclear how much it
  matters for Dolphin perf.

* This violates The Ekstrand Rule and apparently will be a problem for our
  Vulkan driver. I'm just a compiler+GL girl, so I wouldn't know.

To fix this, we invert the order of operations. At the end of this series, we
instead lower NIR system values to NIR load_preamble instructions in the GL
driver. The compiler just translates directly to uniform registers reads. The
Vulkan driver will need its own version of this code, but maybe it can do
something clever and descriptor set aware.

This means that there will already be some load_preamble instructions when
nir_opt_preamble runs, so I've made minor changes to nir_opt_preamble to handle
that gracefully. This is a bit lazy... The alternative is to introduce a
`load_uniform_agx` intrinsic which `load_preamble` gets lowered to trivially.
But that's another pass over the IR (and due to AGX's shader variant hell I'm
sensitive to backend compile time) and it would be more complicated than what's
implemented here.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Ella Stanforth <ella@iglunix.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20562>
2023-01-31 17:02:34 +00:00
Alyssa Rosenzweig
b0b5a71c74 nir/opt_preamble: Consider load_preamble as movable
It's kosher to get load_preamble intrinsics ahead of time if the driver is
pushing sysvals. Handle them like load_uniform.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by-(with-sparkles): Asahi Lina <lina@asahilina.net>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20562>
2023-01-31 17:02:34 +00:00
Alyssa Rosenzweig
05d3238692 nir/opt_preamble: Treat *size as an input
Some backends may wish to reserve early uniforms for internal system values, and
use the remaining space for preamble storage. In this case, it's convenient to
teach nir_opt_preamble about a reserved offset. It's logical to treat the output
*size instead of an in/out variable that nir_opt_preamble adds to. This requires
a slight change to the consumers to zero the input.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by-(with-sparkles): Asahi Lina <lina@asahilina.net>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20562>
2023-01-31 17:02:34 +00:00
Mike Blumenkrantz
d745e3b0ab zink: always unref old images when adding new binds
at some point this was correct, but refactoring has since occurred,
and this ends up leaking storage image objects

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20867>
2023-01-31 16:31:46 +00:00
Mike Blumenkrantz
dd733034aa zink: stop leaking push descriptor templates
templates[ZINK_DESCRIPTOR_TYPE_UNIFORMS] needs to be deleted, which
requires a larger iterator

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20867>
2023-01-31 16:31:46 +00:00
Mike Blumenkrantz
01d2e7afce zink: don't add dmabuf export type if dmabuf isn't supported
avoid trying to create dmabuf-exportable resources too

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20791>
2023-01-31 15:57:13 +00:00
Samuel Pitoiset
e07232acbb radv: fix GPL fast-linking with libs that have retained NIR shaders
Zink creates all libaries with CREATE_RETAIN_LINK_TIME_OPTIMIZATION,
then it first creates unoptimized pipelines and it enqueues optimized
pipelines in the background with CREATE_LINK_TIME_OPTIMIZATION.

If a pipeline is linked without CREATE_LINK_TIME_OPTIMIZATION, the
driver should import binaries instead of retained NIR shaders. This
was broken because RADV wasn't compiling binaries at all in presence
of CREATE_RETAIN_LINK_TIME_OPTIMIZATIONS. Now, it always compiles
binaries in libraries but can also retain NIR if requested.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8150
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21008>
2023-01-31 15:24:50 +00:00
Marcin Ślusarz
3131c2fc7a intel/compiler/mesh: optimize indirect writes
Our hardware requires that we write to URB using full vec4s at aligned
addresses. It gives us an ability to mask-off dwords within vec4 we don't
want to write, but we have to know their positions at compile time.

Let's assume that:
- V represents one dword we want to write
- ? is an unitinitialized value
- "|" is a vec4 boundary.

When we want to write 2-dword value at offset 0 we generate 1 write message:
| V1 V2 ? ? |
with mask:
| 1  1  0 0 |

When we want to write 4-dword value at offset 2 we generate 2 write messages:
| ? ? V1 V2 | V3 V4 ? ? |
with mask:
| 0 0 1  1  | 1  1  0 0 |

However if we don't know the offset within vec4 at *compile time* we
currently generate 4 write messages:
| V1 V1 V1 V1 |
| 0  0  1  0  |

| V2 V2 V2 V2 |
| 0  0  0  1  |

| V3 V3 V3 V3 |
| 1  0  0  0  |

| V4 V4 V4 V4 |
| 0  1  0  0  |

where masks are determined at *run time*.

This is quite wasteful and slow.

However, if we could determine the offset modulo 4 statically at compile time,
we could generate only 1 or 2 write messages (1 if modulo is 0) instead of 4.

This is what this patch does: it analyzes the addressing expression for
modulo 4 value and if it can determine it at compile time, we generate
1 or 2 writes, and if it can't we fallback to the old 4 writes method.

In mesh shader, the value of offset modulo 4 should be known for all outputs,
with an exception of primitive indices.

The modulo value should be known because of MUE layout restrictions, which
require that user per-primitive and per-vertex data start at address aligned
to 8 dwords and we should statically always know the offset from this base.

There can be some cases where the offset from the base is more dynamic
(e.g. indirect array access inside a per-vertex value), so we always do
the analysis.

Primitive indices are an exception, because they form vec3s (for triangles),
which means that the offset will not be easy to analyse.

When U888X index format lands, primitive indices will use only one dword
per triangle, which means that we'll always write them using one message.

Task shaders don't have any predetermined structure of output memory, so
always do the analysis.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20050>
2023-01-31 13:50:08 +00:00
Marcin Ślusarz
2255375c4d nir: add nir_mod_analysis & its tests
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20050>
2023-01-31 13:50:08 +00:00
Samuel Pitoiset
56158bd0c0 radv: adjust ACCUM tessellation fields on GFX11+
Based on RadeonSI/PAL.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20982>
2023-01-31 11:43:10 +00:00
Samuel Pitoiset
c8a575eb30 radv: fix RB+ for SRGB formats
This should be set for linear colorspace only.

Ported from RadeonSI.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20982>
2023-01-31 11:43:10 +00:00
Samuel Pitoiset
47852b9ff4 radv: stop setting INTERPOLATE_COMP_Z
Based on RadeonSI/PAL.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20982>
2023-01-31 11:43:10 +00:00
Hyunjun Ko
c489b3eadb vulkan/runtime: match the spec when taking pipeline subsets.
Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21006>
2023-01-31 11:21:22 +00:00
Simon Ser
6e359c2189 egl: fix fd_display_gpu on surfaceless and device platforms
The original commit missed these.

Signed-off-by: Simon Ser <contact@emersion.fr>
Fixes: 31013f3ce7 ("egl: remove is_different_gpu variable from struct dri2_egl_display")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8194

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20992>
2023-01-31 10:41:32 +00:00
David Rosca
09977d687d frontents/va: Use PIPE_USAGE_STAGING for coded buffer
Coded buffer will only be read on CPU, setting
PIPE_USAGE_STAGING instead of PIPE_USAGE_STREAM
makes the CPU reads much faster.

On 6700XT this reduces the CPU copy by around
3ms to 0.3 ms on average while under high GPU
load - real-time game streaming.

Signed-off-by: David Rosca <nowrep@gmail.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20989>
2023-01-31 10:22:05 +00:00
Samuel Pitoiset
2f93398047 radv: only initialize non-zero values for the default dynamic state
This avoids a big memcpy and cut the function time by 2x.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20960>
2023-01-31 09:01:48 +00:00
Samuel Pitoiset
912a19e630 radv: regroup dynamic states initialization
It should be possible to initialize these inside libraries at some
point.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20960>
2023-01-31 09:01:48 +00:00
Samuel Pitoiset
c08082e861 radv: ignore all CB dynamic states when there is no color attachments
This simplifies radv_init_dynamic_state() slightly.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20960>
2023-01-31 09:01:48 +00:00
Emma Anholt
5eade8fb9b ci: Run our manual jobs during the nightly scheduled run.
We have a common pain point with fractional CTS coverage, where the test
list changes on a CTS uprev or board load rebalancing, so you get a
different subset of tests run.  The dev updates the list of xfails (a
pain), but also we end up with xfails left behind that aren't tested any
more and don't reflect reality.

For some drivers (tu, freedreno, zink-anv) we have manual jobs available
for curious devs to look at the current state of the CTS, but without
anyone having to keep the full xfails updated during uprevs, you don't
necessarily know what to do with the results you get on your MR.

So, let's introduce nightly testing for the tests that aren't guaranteed
green by Marge.  With that, Someone (possibly me? sigh) can review the
nightly results and push up updates for full-run xfails so everyone can be
on the same page other than a day or so of delay.  We also have some hope
for automated tooling to do this thanks to what Collabora has been working
on for automated CI uprev MR generation.

Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20950>
2023-01-31 01:55:22 +00:00
Emma Anholt
610efb0866 ci/zink: Move the zink-anv-tgl manual full run to custom manual deps.
Follow-up to !17445, since this run had been added while that MR was
outstanding.  Now it shouldn't show up in unrelated pipelines.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20950>
2023-01-31 01:55:22 +00:00
Emma Anholt
2e807a028a ci/zink: Disable Amnesia trace until the linked issue gets fixed.
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20950>
2023-01-31 01:55:22 +00:00
Bas Nieuwenhuizen
b0a9772cc6 radv: Shift left the tile swizzle more on GFX11.
ac/surface puts the raw pip_bank_xor there, which needs the extra
shift for the actual tile_swizzle.

(I think long term we should refactor this in ac/surface but for
 now lets fix like radeonsi to avoid race conditions.)

CC: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20979>
2023-01-31 01:25:24 +00:00
Bas Nieuwenhuizen
d321bc1323 radv: Set FDCC_CONTROL SAMPLE_MASK_TRACKER_WATERMARK
Might cause hangs according to comments. Syncs with radeonsi/PAL.

Fixes: e210ffb4d0 ("radv: update framebuffer registers on GFX11")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20979>
2023-01-31 01:25:24 +00:00
Faith Ekstrand
03d1141e51 mailmap: Remap e-mail addresses for Faith Ekstrand
Acked-by: Lina Versace <lina@kiwitree.net>
Acked-by: Daniel Stone <daniels@collabora.com>
Lovingly-reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21000>
2023-01-31 01:17:07 +00:00
Alejandro Piñeiro
2901066980 broadcom/compiler: fix indentation at v3d_nir_lower_image_load_store
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20972>
2023-01-30 21:57:45 +00:00
Jesse Natalie
237e12c2df dzn, driconf: Add a driconf entry for NMS to claim wide line support
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20959>
2023-01-30 21:17:25 +00:00
Sagar Ghuge
df0054e523 iris: Stop marking context unconditionally as guilty
With this change, we would fetch the reset status and if the context
status is banned or in unknown state, we would just start with the fresh
context.

Also, use the fetched reset status to communicate back to the gallium
frontend.

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

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20928>
2023-01-30 20:48:09 +00:00
Jesse Natalie
0733aafa22 CI: Lima farm is offline
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20995>
2023-01-30 12:05:12 -08:00
Neha Bhende
3b5da9714f docs: Add GL 4.3 support info in mesa docs
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20964>
2023-01-30 18:57:17 +00:00
Boyuan Zhang
4eadb333a8 radeonsi/vcn: validate fence handle before using it
Check if picture fence handle pointer is valid before using.

Fixes: 843bdd22 ('radeonsi/vcn: check fence before destroying dpb')

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20986>
2023-01-30 17:50:52 +00:00
Jesse Natalie
0b9972953c wsi/win32: Use app-provided timeout instead of arbitrary hardcoded value
Prevents returning spurious timeouts when the app wanted to wait
infinitely. Fixes 3DMark Wild Lands which would otherwise attempt
to render/present a buffer it didn't successfully acquire.

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20963>
2023-01-30 17:27:47 +00:00
Jesse Natalie
202480a9ca wsi/win32: Always use non-SRGB formats for DXGI
The actual buffer is always created as non-SRGB, and then SRGB views
can be used to render into it. Fixes a crash trying to launch
3DMark Wild Lands

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20963>
2023-01-30 17:27:47 +00:00
Rob Clark
a192923f99 freedreno/drm: Restart import on zombie race
If we hit the race condition of looking up an already imported BO that
is in the process of being destroyed, the handle will be GEM_CLOSE'd,
meaning that the handle that we just got from the kernel is probably not
valid.  So in this case we should retry.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20961>
2023-01-30 15:48:41 +00:00
Rob Clark
bb438c8dc7 freedreno/drm/virtio: Flush before CREATE_BLOB
The RESOURCE_CREATE_BLOB ioctl can carry a ccmd payload, similarly to
EXECBUF.  But we need to preserve the order of buffered execbuf cmds
which haven't been flushed to the guest kernel yet, rather than let the
CREATE_BLOB payload jump to the head of the queue.  Otherwise, for ex,
the host could see the guest requesting an iova that has not yet been
(from it's perspective) released.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20961>
2023-01-30 15:48:41 +00:00
Samuel Pitoiset
df8243dadf radv: rename radv_create_shaders() to radv_graphics_pipeline_compile()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20943>
2023-01-30 09:37:52 +00:00
Samuel Pitoiset
21f53b9c48 radv: split radv_create_shaders() between graphics and compute shaders
This introduces radv_compute_pipeline_compile() which is used for
compute and ray tracing pipelines. I think it's better than having a
single function for compiling everything, and that will allow us to do
more cleanups.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20943>
2023-01-30 09:37:52 +00:00
Samuel Pitoiset
87e055a700 radv: pass the number of stages to radv_hash_shaders()
This will help for splitting radv_create_shaders().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20943>
2023-01-30 09:37:52 +00:00
Samuel Pitoiset
fc93e0453c radv: simplify VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED
The Vulkan spec says:
    "VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT specifies
     that pipeline creation will fail if a compile is required for
     creation of a valid VkPipeline object; VK_PIPELINE_COMPILE_REQUIRED
     will be returned by pipeline creation, and the VkPipeline will be
     set to VK_NULL_HANDLE."

Given the implementation is expected to set the pipeline to
VK_NULL_HANDLE, it's unecessary to handle pipeline feedback.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20943>
2023-01-30 09:37:52 +00:00
Karol Herbst
4b841cfec8 rusticl: fix build error with valgrind being enabled
This bumps the meson requierement to 1.0 because it requires
https://github.com/mesonbuild/meson/pull/11024

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7688
Fixes: 20c90fed5a ("rusticl: added")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19778>
2023-01-30 03:41:39 +01:00
Alyssa Rosenzweig
4a675f93b9 asahi: Omit extra call to clock_gettime
It's cheap but it isn't free.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20973>
2023-01-29 16:26:48 +00:00
Ian Romanick
2f467fb154 gallium/draw: Enable polygon stipple NIR helpers to generate bool1 or bool32 Booleans
It appears that only softpipe, llvmpipe, and d3d12 hit any of this
code. If some NIR-to-TGSI driver that doesn't have native integers
(e.g., i915 or r300) wants to use this path in the future, it should be
easy to add float32 support.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20869>
2023-01-28 20:42:32 -08:00
Ian Romanick
d3a95f0f71 gallium/draw: Enable aapoint NIR helpers to generate bool1, bool32, or float32 Booleans
Fixes arb_point_parameters-point-attenuation on G33. The crash in
point-line-no-cull is fixed, but the test still fails.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20869>
2023-01-28 20:42:13 -08:00
Amber
17b610771d ir3: support texture and sampler index with offsets
"If this texture instruction has a nir_tex_src_texture_offset source,
then the texture index is given by texture_index + texture_offset."

This fixes the failures for:
spec@arb_arrays_of_arrays@execution@sampler@fs-nested-struct-arrays-nonconst-nested-array
spec@arb_gl_spirv@execution@uniform@sampler2d-nonconst-nested-array

Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20954>
2023-01-28 18:00:31 +00:00
Lucas Stach
196882a147 etnaviv: drm: fix check if BO is on a deferred destroy list
list_is_linked() isn't the right function to use in order to check if
the BO is on a cache bucket or the zombie list, as this checks if the
next pointer of the list isn't NULL. This is always the case with the
BO list item as it's always initialized, so the next pointer points to
the list head itself when the BO isn't on any list.

Use list_is_empty() to check if the BO is actually linked into one
of the deferred destroy lists.

Fixes: 1b1f8592c0 ("etnaviv: drm: properly handle reviving BOs via a lookup")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20940>
2023-01-28 13:48:30 +00:00
Lucas Stach
c59369005b etnaviv: free pm queries dynarray on screen destroy
CC: mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20940>
2023-01-28 13:48:30 +00:00
Lucas Stach
3156b15f70 etnaviv: drm: fix BO array leaks
Free the both arrays tracking BOs when the etna_cmd_stream is destroyed.

CC: mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20940>
2023-01-28 13:48:30 +00:00
Lionel Landwerlin
0d7f8aa249 anv: fix null descriptors
When writing descriptor with a null buffer/image we expect that
writing 0 will point to the null surface. For that to work the null
surface has to be in the bindless surface heap.

This fixes some new failures in dEQP-VK.robustness.* tests once
rewritten from the NV_ray_tracing to KHR_ray_tracing extension.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 4ceaed7839 ("anv: split internal surface states from descriptors")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7762
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20953>
2023-01-27 21:38:32 +00:00
Chia-I Wu
d7ef1331b5 turnip: make debug_flags a global variable
Add tu_env as a global variable and add tu_env_init to initialize it.
Add TU_DEBUG macro to check debug flags.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20946>
2023-01-27 21:23:18 +00:00
Chia-I Wu
511c42ef4e turnip: replace TU_DEBUG_DONT_CARE_AS_LOAD by a bool
Instead of using TU_DEBUG=dontcare_as_load, it can still be overriden
using vk_dont_care_as_load=true.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20946>
2023-01-27 21:23:18 +00:00
Jesse Natalie
c0122b81a4 dzn: Consider linked shaders when computing DXIL hash
Fixes 3DMark Wild Lands. Otherwise, we'd end up loading a DXIL shader
that had invalid linkage with another shader in the pipeline. We can
only load a DXIL shader if it's being linked against the same before
and after as a previous compilation.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20962>
2023-01-27 20:56:01 +00:00
Karmjit Mahil
134c49072a pvr: Process wait event sub command.
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/20862>
2023-01-27 19:41:08 +00:00
Karmjit Mahil
6d7a076daa pvr: Process set and reset event sub commands.
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/20862>
2023-01-27 19:41:08 +00:00
Mike Blumenkrantz
ac339d9797 zink: set VK_PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT when using DB
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20912>
2023-01-27 19:23:29 +00:00
Mike Blumenkrantz
6f7b752fdd zink: disable bindless texture ext with descriptor buffer
it's illegal to mix-and-match DB and non-DB descriptor usage, so disable
this until I finish the implementation

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20912>
2023-01-27 19:23:29 +00:00
Mike Blumenkrantz
cc9fa060ee zink: always set RESOURCE usage for descriptor buffers
all types of descriptors may use buffer-type descriptors, even samplers

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20912>
2023-01-27 19:23:29 +00:00
Mike Blumenkrantz
59989d0462 zink: assert that buffer descriptor usage is populated before bind
this is illegal

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20912>
2023-01-27 19:23:29 +00:00
Mike Blumenkrantz
3c562cfc06 zink: set vkusage/vkflags for buffer resource objects
this needs to be populated for other places in the driver that need it

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20912>
2023-01-27 19:23:29 +00:00
Mike Blumenkrantz
c545300f30 zink: add VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT for buffers if ext is enabled
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20912>
2023-01-27 19:23:29 +00:00
Mike Blumenkrantz
ccde3e02ba zink: fix heap/memory type selection
the memory type index still needs to be used for suballocation over the
heap since that's the actual type of allocation being used

Fixes: f6d3a5755f ("zink: zink_heap isn't 1-to-1 with memoryTypeIndex")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20912>
2023-01-27 19:23:28 +00:00
Mike Blumenkrantz
07809c4527 Revert "zink: allow direct memory mapping for any COHERENT+CACHED buffer"
This reverts commit a3552048c7.

on some drivers this catches qbos, which then hits the below assert.
needs more investigation

Fixes: a3552048c7 ("zink: allow direct memory mapping for any COHERENT+CACHED buffer")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20912>
2023-01-27 19:23:28 +00:00
Paulo Zanoni
38a087c4ce anv: there's no need to set exec_obj offsets twice
The anv_execbuf_add_bo() function already sets the offsets for the
exec_objects. Since we're always using softpin and never using
relocations all these objects should have non-changing offsets, all
set during anv_bo creation and never changed. Not only we should not
change these offsets, we definitely don't change them between
anv_execbuf_add_bo() and this loop we're removing.

Previously, we'd have the offset set as -1 for BOs that had never been
submitted when we were not using softpin.

Notice that with games we can have several hundreds of BOs in this
array.

This loop was added by:
  c5f7e1f5b4 ("anv: Delete relocation support from batch submission")

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20885>
2023-01-27 18:53:11 +00:00
Tatsuyuki Ishi
5de60fbc3e radv: Loop over shader stages in flush_indirect_descriptor_sets.
Reduces boilerplate.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20935>
2023-01-27 18:31:58 +00:00
Tatsuyuki Ishi
0b2fad0426 radv: Fix emitting tess indirect descriptors twice.
This fixes a copy-paste error found by manual inspection.

TES may be merged into GS with certain HW stage mappings, which lead to
duplicate set-register commands to be emitted with the old code.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20935>
2023-01-27 18:31:58 +00:00
Matt Coster
9c5e47e66d pvr: Split render job submission for multi-layer framebuffers
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20932>
2023-01-27 18:17:52 +00:00
Matt Coster
8cc474cd87 pvr: Rename global_queue_job_count to global_cmd_buffer_submit_count
This makes the name more accurate, since submits which require multiple
job submissions behind the scenes do not additionally increment this
counter.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20932>
2023-01-27 18:17:52 +00:00
Matt Coster
187a95e617 pvr: Add pvr_csb_bake()
This is a simple helper for minimizing the storage requirements of
control streams. It discards all information required only while
building the control stream and returns just the status and the list of
BOs backing the control stream. The first BO in the list is the start
of the control stream.

Especially for small, deterministically sized control streams, there's
no sense in lugging around an entire builder structure once it's built.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20932>
2023-01-27 18:17:52 +00:00
Rhys Perry
695cf75266 aco: set has_color_exports with GPL
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 192486b7aa ("aco/gfx11: export mrtz in discard early exit for non-color shaders")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20937>
2023-01-27 16:51:56 +00:00
Samuel Pitoiset
1a93cd1556 radv: add a layer for fixing rendering issues with RAGE2
This game seems to incorrectly set the render area and since we switched
to full dynamic rendering, the framebuffer dimensions is no longer used.

Forcing the render area to be the framebuffer dimensions restore the
previous logic and it fixes rendering issues.

Fixes: c7d0d328d5 ("radv: Set the window scissor to the render area, not framebuffer")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20900>
2023-01-27 15:28:45 +00:00
Turo Lamminen
b2df787058 radv: Optimize emitting prefetches
Check the need for emitting prefetch before calling si_emit_cache_flush
to mask a possible cache miss delay and always inline radv_emit_prefetch_L2.
Either change alone is not significant but together they increase
drawcall throughput by 8% on i5-2500.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20877>
2023-01-27 15:05:03 +00:00
Turo Lamminen
bd78c8bbfa radv: Avoid redundant fetch of radv_device
0.6% gain in drawcall throughput on i5-2500.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20877>
2023-01-27 15:05:03 +00:00
Turo Lamminen
b5de1ee1f7 radv: Clean up variables in si_get_ia_multi_vgt_param
8% gain in drawcall throughput on i5-2500. This can significantly change
how compiler allocates registers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20877>
2023-01-27 15:05:03 +00:00
Turo Lamminen
4b8dfaae89 radv: Change radeon_cmdbuf counters to uint64_t to make alias analysis optimize radeon_emit better
1% gain in drawcall throughput on i5-2500. Depends quite heavily on
compiler and CPU.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20877>
2023-01-27 15:05:03 +00:00
Martin Roukala (né Peres)
d7f429ccc1 ci/debian/x86_test-vk: drop an outdated dependency
This was used by the tracing jobs, which we are not running on Mesa
anymore.

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20956>
2023-01-27 14:46:33 +02:00
Jose Fonseca
3ab1a06a15 trace: Don't use italic escape code.
It's not widely supported, and often emulated with invert highlight,
which is very distracting.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20934>
2023-01-27 12:05:17 +00:00
Jose Fonseca
77092ca8f4 llvmpipe: Honor zero sample_mask when multisample is disabled.
The JIT generated FS shader has logic to obey sample mask when:
multisample is enabled, or multisample is disabled but FS writes sample
mask and pipe_rasterizer_state::no_ms_sample_mask_out.

However it did not handle the case where multisample was disabled, FS
did not write sample_mask, and sample mask was zero.  Instead it relied
upon the setup to discard the primitives, but that went away with commit
da5840f3.

We could restore the discard on zero mask behavior, but we would again
blurring the semantics of rasterization discard.  Instead this change
adds logic to primitive setup to cull the primitives when sample mask is
zero.

Fixes: da5840f3 ("llvmpipe: Faithfully honour pipe_rasterizer_state::rasterizer_discard flag")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20934>
2023-01-27 12:05:17 +00:00
Erik Faye-Lund
b6a344f4ba meson: do not reconstruct ICD paths
Meson will already construct these paths for us, so let's reuse them
instead of throwing away the result and recontstructing them.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20907>
2023-01-27 11:35:50 +00:00
Erik Faye-Lund
fd72369b65 freedreno/meson: simplify script-path logic
When passing this to files(), there's no point in prepending
current_source_dir. Let's simplify this a bit.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20907>
2023-01-27 11:35:50 +00:00
Erik Faye-Lund
f00c9e85e5 meson: use files() instead of joining paths
The Meson docs points out that it's better to use the files() function
when referring to files in the source tree than manually constructing
paths like this. Let's follow that advice, and get some neat cleanups.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20907>
2023-01-27 11:35:50 +00:00
Erik Faye-Lund
d54c8a47c6 meson: avoid using deprecated build_root() method
The meson.build_root() method has been deprecated, so let's switch to
meson.project_build_root(), which usually means the same thing. The case
where it doesn't do the same thing is if Mesa is a subproject to some
other project, but in that case I believe we want the build root of Mesa,
not of the parent project anyway.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20907>
2023-01-27 11:35:50 +00:00
Frank Binns
b2d5a653f4 pvr: small cleanups
- remove unused PVR_IDF_WDF_IN_REGISTER_CONST_COUNT define
- remove unneeded pvr_compute_ctx forward declaration
- add render context section header to match compute and transfer

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20931>
2023-01-27 11:22:44 +00:00
Marcin Ślusarz
432e263284 intel/compiler: fine-grained control of dispatch widths
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> [v2]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20854>
2023-01-27 11:00:41 +00:00
Erik Faye-Lund
59625a68ff meson: remove deprecated dri-drivers option
This was deprecated in cdde031ac2 ("classic/i965: Remove driver"),
which is almost two years ago, and many major releases ago. Nobody
should be using this any more. Let's remove it.

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20905>
2023-01-27 10:29:26 +00:00
Erik Faye-Lund
47d19196c1 meson: remove deprecated osmesa-bits option
We've released several new major versions since this was deprecated in
202cab3d30 ("meson: deprecate specifying osmesa-bits"), so it's
probably about time to remove it.

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20905>
2023-01-27 10:29:26 +00:00
Erik Faye-Lund
713371c723 meson: remove dupliace add_devenv call
Looks like a bad merge-conflict resolution.

Fixes: 7bed7d9475 ("meson: use sections in summary()")
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Thomas Andersen <phomes@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20908>
2023-01-27 09:34:00 +00:00
Lepton Wu
47ed5836cc egl/dri2: Use primary device in EGL device platform for kms_swrast
For KMS only devices, there is no render node available. Also remove
unused _eglGetDRMDeviceRenderNode function.

Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20592>
2023-01-27 08:55:58 +00:00
Corentin Noël
74967249d2 ci: uprev virglrenderer
This change contains a memory unmap fix and makes the render server mandatory.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20938>
2023-01-27 07:56:06 +00:00
Kenneth Graunke
41d5f0ee09 egl: Rewrite eglGetMscRateANGLE to avoid probes and handle multi-monitor
RRGetScreenInfo re-probes connector status, which may result in an EDID
transfer for every output, which according to Adam Jackson can be on the
order of 100ms for a single EDID block.  So our previous implementation
of this eglGetMscRateANGLE was blocking for excessive periods of time
instead of being a quick query of the refresh rate like users expect.

This changes our eglGetMscRateANGLE implementation from using
RRGetScreenInfo to RRGetScreenResourcesCurrent and RRGetCrtcInfo.
This obtains the same monitor info without re-probing connectors.

Fixes a severe performance regression in Chromium WebGL performance.

While we're re-implementing the extension, we also implement proper
multi-monitor support: if there are multiple active CRTCs, we determine
which contains the largest portion of the surface, as specified in the
EGL_ANGLE_sync_control_rate extension.

We also now report fractional refresh rates correctly rather than
rounding to the nearest Hz.

Fixes: 4752655649 ("egl/x11: implement ANGLE_sync_control_rate")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6996
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7038
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20665>
2023-01-27 04:35:08 +00:00
Kenneth Graunke
3170b63314 loader: Add infrastructure for tracking active CRTC resources
This provides a cached view of the current screen resources, with the
coordinates and refresh rate for every active CRTC.  It's currently only
implemented for X11/XCB.

Fixes: 4752655649 ("egl/x11: implement ANGLE_sync_control_rate")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20665>
2023-01-27 04:35:08 +00:00
Mike Blumenkrantz
87a9018ff9 zink: reorder commands more aggressively
by starting resources in the unordered state in a given batch, they
gain more opportunities to be promoted to the barrier cmdbuf and avoid
breaking renderpasses

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20890>
2023-01-27 02:42:56 +00:00
Jesse Natalie
1a29f3dfdb CI/windows: Apply CI_FDO_CONCURRENT to piglit too
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20924>
2023-01-27 01:49:19 +00:00
Jesse Natalie
1c5a64296d CI/windows: Don't limit deqp-runner to 4 jobs
If FDO_CI_CONCURRENT is set, use that, otherwise let deqp-runner
choose concurrency based on system CPU cores.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20924>
2023-01-27 01:49:19 +00:00
Marek Olšák
2ae08c3e8f ac/llvm: remove llvm:: now that we use "using namespace llvm"
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20297>
2023-01-26 19:33:55 -05:00
Marek Olšák
a273f64f80 ac/llvm: run the IPSCCP pass
AMDVLK runs it and it seems useful.

https://en.wikipedia.org/wiki/Sparse_conditional_constant_propagation

58380 shaders in 35438 tests
Totals:
SGPRS: 2709080 -> 2709224 (0.01 %)
VGPRS: 1592972 -> 1592808 (-0.01 %)
Spilled SGPRs: 2420 -> 2420 (0.00 %)
Spilled VGPRs: 1077 -> 1077 (0.00 %)
Private memory VGPRs: 253 -> 253 (0.00 %)
Scratch size: 1232 -> 1232 (0.00 %) dwords per thread
Code Size: 61382088 -> 61356504 (-0.04 %) bytes
Max Waves: 849293 -> 849308 (0.00 %)
Outputs: 127090 -> 127090 (0.00 %)
Patch Outputs: 579 -> 579 (0.00 %)

Totals from affected shaders:
SGPRS: 5400 -> 5544 (2.67 %)
VGPRS: 6200 -> 6036 (-2.65 %)
Spilled SGPRs: 0 -> 0 (0.00 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 975824 -> 950240 (-2.62 %) bytes
Max Waves: 1214 -> 1229 (1.24 %)
Outputs: 232 -> 232 (0.00 %)
Patch Outputs: 0 -> 0 (0.00 %)

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20297>
2023-01-26 19:33:43 -05:00
Marek Olšák
d05c3811cd ac/llvm: run the LLVM sinking pass because LLVM will stop running it
shader-db was run with the sinking pass disabled in LLVM.

58380 shaders in 35438 tests
Totals:
SGPRS: 2730768 -> 2730768 (0.00 %)
VGPRS: 1592932 -> 1592928 (-0.00 %)
Spilled SGPRs: 2687 -> 2687 (0.00 %)
Spilled VGPRs: 551 -> 551 (0.00 %)
Private memory VGPRs: 253 -> 253 (0.00 %)
Scratch size: 700 -> 700 (0.00 %) dwords per thread
Code Size: 61238872 -> 61238868 (-0.00 %) bytes
Max Waves: 849209 -> 849209 (0.00 %)
Outputs: 127090 -> 127090 (0.00 %)
Patch Outputs: 579 -> 579 (0.00 %)

Totals from affected shaders:
SGPRS: 440 -> 440 (0.00 %)
VGPRS: 396 -> 392 (-1.01 %)
Spilled SGPRs: 0 -> 0 (0.00 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 49880 -> 49876 (-0.01 %) bytes
Max Waves: 105 -> 105 (0.00 %)
Outputs: 14 -> 14 (0.00 %)
Patch Outputs: 0 -> 0 (0.00 %)

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20297>
2023-01-26 19:33:17 -05:00
Brian Paul
fbd32a04da anv: add a third memory type for LLC configuration
Commit 582bf4d9 turned on write-combining for most (all?) memory
allocations.  This caused a fairly large performance drop in some of
our VMware tests (application traces, such as Windows Metro Paint).

This patch adds a third memory type configuration: DEVICE_LOCAL,
HOST_VISIBLE, HOST_COHERENT.  This is uncached.  Then, in
anv_AllocateMemory() we only use write-combining for this uncached
type.  This memory type is found in the Intel Windows Vulkan driver.
And according to
https://asawicki.info/news_1740_vulkan_memory_types_on_pc_and_how_to_use_them
uncached memory correlates to write-combined memory.

This fixes our performance regression (and actually produced the
fastest ever results for our test suite).

Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20770>
2023-01-26 22:45:49 +00:00
Rob Clark
15e19d04f0 freedreno/drm: Synchronize handle close and lookup
Handle lookup (for example PRIME_FD_TO_HANDLE) must be synchronized with
GEM_CLOSE, otherwise re-import can race with bo_del path, resulting in
the handle of the newly (re)imported BO getting closed.  Now that the
finalize step has been decoupled, fixing this is mostly just deleting
code.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20918>
2023-01-26 22:21:47 +00:00
Rob Clark
444db624df freedreno/drm: Split out bo->finalize()
The complexity around batching up handle closing is simply to allow the
virtgpu to back up ccmd's to the host (because virtio/virtgpu is pretty
inefficient when it comes to lots of small msgs to the host, and it is
common that when we are deleting BOs, we delete a lot of them at the
same time.  But that will make the locking fix in the next commit
impossible (without nested locks).  So let's flip this around and do the
step that virtgpu wants to batch up first, before we get into closing
GEM handles, etc.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20918>
2023-01-26 22:21:47 +00:00
Rob Clark
5a46e884ea freedreno/drm: Remove bo_del_or_recycle()
In prep for the next patch, where locking is swapped around to cover the
whole bo_del() path, decouple handling of the recycle-to-BO-cache path.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20918>
2023-01-26 22:21:47 +00:00
Rob Clark
160137ccae freedreno/drm: Detect zombie BOs
When importing from a GEM name or dmabuf fd, we can race with the final
unref of the same BO, in which case we can get a hit in the handle
table for an fd_bo that another thread is about to free().  Detect and
handle this case.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20918>
2023-01-26 22:21:47 +00:00
Rob Clark
547f50c244 freedreno/drm: Add some ref/unref debugging
Helpful to catch common refcnt issues, like resurrecting a zombie
object.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20918>
2023-01-26 22:21:47 +00:00
Emma Anholt
870beb2159 freedreno: Don't sync timestamps while perfetto isn't running.
This may help with the regression in trace perf testing since enabling
perfetto on the test drivers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20916>
2023-01-26 20:46:39 +00:00
Jesse Natalie
2010b91547 dzn: Report as a software device for non-Windows
Fixes: 5f1b8b3e6c ("dzn: Use DXGI swapchains")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20939>
2023-01-26 19:00:31 +00:00
Jesse Natalie
cdd1588d55 dzn: Don't recursively lock the physical device enum mutex
Fixes: cfa260cd27 ("dzn: Use common physical device list/enumeration helpers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20939>
2023-01-26 19:00:31 +00:00
Jesse Natalie
40a2b50599 dzn: Fix Windows WSI
This was a merge conflict from the Win32 WSI DXGI swapchain changes.
I missed moving a new line of code that was added when rearranging
things for using the common helpers.

Fixes: cfa260cd ("dzn: Use common physical device list/enumeration helpers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20944>
2023-01-26 18:03:50 +00:00
Eric Engestrom
633f2428f4 docs: update calendar for 22.3.4
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20942>
2023-01-26 17:37:59 +00:00
Eric Engestrom
c8a32d21cf docs/relnotes: add sha256sum for 22.3.4
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20942>
2023-01-26 17:37:55 +00:00
Eric Engestrom
cf58992a36 docs: add release notes for 22.3.4
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20942>
2023-01-26 17:37:44 +00:00
Konrad Dybcio
50dee85b68 freedreno/registers: Add RBBM_GPR0_CNTL for non-GMU operation
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20925>
2023-01-26 15:45:50 +00:00
Rob Clark
f9bcf19e52 freedreno/a6xx: Add a few kernel regs/etc
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20925>
2023-01-26 15:45:50 +00:00
Gert Wollny
4767ebeffc virgl: remove unused virgl_encoder_inline_write
The only user was removed with

be8eeb3b59
  virgl: remove unused virgl_transfer_inline_write

so drop this code too.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18543>
2023-01-26 15:26:40 +00:00
Amber
228d812a0c ir3, isaspec: add raw instruction to assembler/disassembler.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20789>
2023-01-26 14:26:11 +00:00
Ruijing Dong
f2a4ea5300 frontends/va: revert commit 0b02db30
revert commit 0b02db30 as it is not a
proper way to fix av1 decoding 10bit issue.

this is corresponding to the fix in
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20870

Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20911>
2023-01-26 14:11:10 +00:00
Corentin Noël
dd3730f8bd kopper: Do not free the given screen in initScreen implementation
The given screen is already freed by the caller in case a NULL-pointer is
returned by the implementation.

Cc: mesa-stable
Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20933>
2023-01-26 13:36:32 +00:00
Juston Li
4c03d4735e util/tests/cache_test: Skip Cache.List if not supported
FOZ_DB_UTIL_DYNAMIC_LIST depends on inotify support

Fixes: 3b69b67545 ("util/fossilize_db: add runtime RO foz db loading via FOZ_DBS_DYNAMIC_LIST")

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20865>
2023-01-26 13:06:27 +00:00
Juston Li
f18702250f util/fossilize_db: add ifdef for inotify header
FOZ_DB_UTIL_DYNAMIC_LIST is defined if the inotify header was
detected.

Fixes: 3b69b67545 ("util/fossilize_db: add runtime RO foz db loading via FOZ_DBS_DYNAMIC_LIST")

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20865>
2023-01-26 13:06:27 +00:00
Timur Kristóf
65a917cb6e nir: Add algebraic optimization for VKD3D-Proton fp32->fp16 conversion.
VKD3D-Proton DXBC f32 to f16 conversion implements a float conversion using PackHalf2x16.
Because the spec does not specify a rounding mode, it emits a sequence to ensure
D3D-like behaviour for infinity.

When we know the current backend has pack_half_2x16_rtz_split,
we can eliminate the extra sequence.

Fossil DB stats on GFX11:
Totals from 835 (0.62% of 134913) affected shaders:
VGPRs: 49368 -> 49224 (-0.29%)
CodeSize: 5341956 -> 5124564 (-4.07%)
Instrs: 1024062 -> 987041 (-3.62%)
Latency: 6530956 -> 6465120 (-1.01%); split: -1.01%, +0.00%
InvThroughput: 908189 -> 870253 (-4.18%)
VClause: 18704 -> 18702 (-0.01%); split: -0.02%, +0.01%
SClause: 33406 -> 33284 (-0.37%); split: -0.38%, +0.01%
Copies: 67440 -> 65992 (-2.15%); split: -2.15%, +0.00%
Branches: 18498 -> 18465 (-0.18%)
PreSGPRs: 38409 -> 38331 (-0.20%)
PreVGPRs: 44089 -> 43834 (-0.58%)

Note, some fossils are from before this pattern was added to VKD3D-Proton,
so the above may not reflect real-world impact.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15838>
2023-01-26 12:24:24 +00:00
Timur Kristóf
7985933a6d nir: Lower pack_half_2x16_split to RTZ if available.
Constant folding always uses RTNE for pack_half_2x16_split, but some
backends implement it with RTZ.

Lowering to RTZ when available ensures that the behaviour will be
consistent between constant folding and the backend.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15838>
2023-01-26 12:24:24 +00:00
Timur Kristóf
c644461b71 radv, aco, ac: Implement pack_half_2x16_rtz_split.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15838>
2023-01-26 12:24:24 +00:00
Timur Kristóf
12652cc549 nir: Add pack_half_2x16_rtz_split opcode.
Same as pack_half_2x16_rtz_split, but always uses RTZ mode.
Note that pack_half_2x16 rounding mode is unspecified.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15838>
2023-01-26 12:24:24 +00:00
Lionel Landwerlin
13cca48920 intel/fs: drop FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD_GFX7
We can lower FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD into other more
generic sends and drop this internal opcode.

The idea behind this change is to allow bindless surfaces to be used
for UBO pulls and why it's interesting to be able to reuse
setup_surface_descriptors(). But that will come in a later change.

No shader-db changes on TGL & DG2.

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/20416>
2023-01-26 11:26:53 +00:00
Erico Nunes
5bc91550d1 lima/ci: Add more piglit unsupported tests to skip
It is not an exhaustive list but it helps by reducing the bulk of
"Failed to create waffle_context for OpenGL [34].x" errors in the logs
by thousands of occurrences and those are probably not going to be
needed.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20909>
2023-01-26 10:48:47 +00:00
Jose Fonseca
9f51340b99 llvmpipe: Ensure floating point SSE state is reset regardless of the write mask.
The code emitted by lp_build_fpstate_set to reset the FP state could be
jumped over when the write mask was zero, leading to denormals not being
flushed to zero.

Spotted by Roland Scheidegger.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20901>
2023-01-26 08:55:21 +00:00
Samuel Pitoiset
b97fee432c radv: fix ignoring graphics shader stages that don't need to be imported
If a shader stage is already imported from a library it should be
properly ignored.

Fixes recent CTS dEQP-VK.pipeline.fast_linked_library.misc.unused_shader_stages*.

Fixes: c8765c5244 ("radv: ignore shader stages that don't need to be imported with GPL")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20899>
2023-01-26 08:34:36 +00:00
Samuel Pitoiset
6bec915919 radv: fix creating libraries with PS epilog and all CB states as dynamic
It's legal to create a library with FRAGMENT_OUTPUT_INTERFACE and with
all CB states as dynamic, in this case the PS epilog should be dynamic.

This fixes a bunch of regressions while running Zink/RADV CTS with
RADV_PERFTEST=gpl.

Zink is the final boss.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20882>
2023-01-26 08:14:39 +00:00
Iago Toral Quiroga
a3ed7f3ff2 v3dv: add a cl_advance_and_end helper
For the common case where we're emitting packet we don't need to
update the cl_out pointer and then store the result in cl->next,
we can directly update cl->next.

This shows a small improvement in vkoverhead's scores for basic
draw tests.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20897>
2023-01-26 06:21:33 +00:00
Jesse Natalie
a08d6d8b59 dzn: Support Vulkan 1.2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20919>
2023-01-26 03:16:50 +00:00
Jesse Natalie
9d89b7e4a8 dzn: Ensure we don't mix DSV+simultaneous-access
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20919>
2023-01-26 03:16:50 +00:00
Jesse Natalie
4daeac01c5 dzn: Enhanced barriers fixes/workarounds
Fix: Acquire/release should have one valid access/sync and one set
to none.

Workaround: D3D doesn't like simultaneous access resources leaving
COMMON layout, nor does it like setting UAV/RTV access bits for the
COMMON layout.
Use UNDEFINED -> UNDEFINED layout transitions, where the access bits
just aren't validated.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20919>
2023-01-26 03:16:50 +00:00
Jesse Natalie
c413c3dffc dzn: Always do clears with copies on non-graphics queues
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20919>
2023-01-26 03:16:50 +00:00
Jesse Natalie
948ff5b8e2 dzn: Support float control
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20919>
2023-01-26 03:16:50 +00:00
Jesse Natalie
f391c2db62 dzn: Cache GPUVA for buffers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20919>
2023-01-26 03:16:50 +00:00
Jesse Natalie
34f372c47c dzn: Handle separate stencil usage
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20919>
2023-01-26 03:16:50 +00:00
Jesse Natalie
789acc2ffb dzn: Fix dynamic rendering clear load op for non-multiview
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20919>
2023-01-26 03:16:50 +00:00
Jesse Natalie
e88070b1da microsoft/compiler: Support float controls
Float controls are emitted as function attributes on the entrypoint.
These function attributes are not the standard build-in LLVM kind, but
are strings, which the DXIL backend didn't know how to emit. So, this
change adds string attribute support and uses it for fp32 ftz/preserve.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20919>
2023-01-26 03:16:50 +00:00
Timur Kristóf
9fc5d8d211 aco: Remove dynamic VS input loads.
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/20733>
2023-01-26 02:43:11 +00:00
Timur Kristóf
15b689604e radv: Lower dynamic VS inputs in NIR.
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/20733>
2023-01-26 02:43:11 +00:00
Timur Kristóf
81620fc7b0 aco: Enable constant exec mask based optimization on compute shaders.
We know for sure exec is initially -1 when the shader always has full subgroups.

Fossil DB stats on GFX11:
Totals from 3884 (2.88% of 134913) affected shaders:
SpillSGPRs: 1673 -> 1697 (+1.43%); split: -1.67%, +3.11%
SpillVGPRs: 2316 -> 2310 (-0.26%); split: -0.65%, +0.39%
CodeSize: 19584436 -> 19567156 (-0.09%); split: -0.13%, +0.04%
Scratch: 217088 -> 216832 (-0.12%)
Instrs: 3784596 -> 3780303 (-0.11%); split: -0.15%, +0.03%
Latency: 39971204 -> 39794967 (-0.44%); split: -0.47%, +0.03%
InvThroughput: 7885552 -> 7801247 (-1.07%); split: -1.14%, +0.07%
VClause: 74654 -> 74611 (-0.06%); split: -0.07%, +0.01%
SClause: 103139 -> 103043 (-0.09%); split: -0.13%, +0.04%
Copies: 279864 -> 281995 (+0.76%); split: -0.72%, +1.48%
Branches: 92082 -> 92084 (+0.00%); split: -0.03%, +0.03%
PreSGPRs: 155637 -> 149491 (-3.95%)

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/20670>
2023-01-26 01:59:26 +00:00
Timur Kristóf
39448c8e9c radv, aco: Add uses_full_subgroups to compute shader info.
Allow the compiler to assume that the shader always has full subgroups,
meaning that the initial EXEC mask is -1 in all waves (all lanes enabled).
This assumption is incorrect for ray tracing and internal (meta) shaders
because they can use unaligned dispatch.

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/20670>
2023-01-26 01:59:26 +00:00
Timur Kristóf
22b350fa27 radv: Get rid of app_shaders_internal.
This will make sure the internal field is set to true for internal
shaders which are initialized outside of radv_device_init_meta.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20670>
2023-01-26 01:59:26 +00:00
Friedrich Vock
9419b4ee45 vulkan/rmv: Remove delta parameter from dump helpers
It was unused.

Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20820>
2023-01-26 01:17:26 +00:00
Friedrich Vock
5eb00a195e vulkan/rmv: Use the timestamp divisor instead of a hardcoded value
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20820>
2023-01-26 01:17:26 +00:00
Friedrich Vock
e07729e8de radv/rmv: Correct timestamp shifting
The shifting was off-by-one compared to how it is done in the kernel. Also, excess_length needs to be casted to uint64_t to prevent zeroing everything except the 5 LSBs.

Fixes: abf3bcd6 ("radv: Add RMV resource tracking")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20820>
2023-01-26 01:17:26 +00:00
Friedrich Vock
292d7b95fc radv/rmv: Log bo destruction before freeing it
Fixes: abf3bcd6 ("radv: Add RMV resource tracking")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20820>
2023-01-26 01:17:26 +00:00
Friedrich Vock
2d5d247203 radv/rmv: Avoid more CPU unmap deadlocks
Fixes: 8d0e6c02 ("radv: Add RMV tracing utilities")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20820>
2023-01-26 01:17:26 +00:00
Friedrich Vock
2dec10c297 radv/rmv: Also check the other pid field
Sometimes it seems like this field contains the correct pid instead.

Fixes: 8d0e6c02 ("radv: Add RMV tracing utilities")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20820>
2023-01-26 01:17:26 +00:00
Emma Anholt
f6c06ef2f6 ci: Add manual rules variations to disable irrelevant driver jobs.
If you're only affecting one or a couple of drivers, it would be nice if
your pipeline buttons on the web UI weren't full of manual run buttons for
all the other drivers.

This is a bunch of duplicated lines, but less than it could have been now
that we have !references.

In some of these cases (i915g, nouveau, etnaviv), we have no non-manual
jobs for those drivers, so I could have just rewritten the original
"driver-rules" to "driver-manual-rules".  I decided to keep things
consistent between drivers, though, because this is all esoteric enough to
readers already without making different drivers' rules look different.

Fixes: #4891
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17445>
2023-01-26 00:48:19 +00:00
Emma Anholt
67547a04b6 ci: Move the performance jobs' allow_failure:true to the gl rules.
This helps clarify what's going on with these magic manual jobs.

Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17445>
2023-01-26 00:48:19 +00:00
Lionel Landwerlin
e27d217fb1 vulkan/wsi/wayland: improve same gpu detection
Some compositor like KWin do not return the render node.

v2: Make sure we test if only drm_info.hasPrimary is true (Jason)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: db42ed1e04 ("vulkan/wsi/wl: correctly find whether the compositor uses the same GPU")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8139
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20914>
2023-01-26 00:22:10 +00:00
Adam Stylinski
56e758d9e9 mesa: fix out of bounds stack access on big endian
The texture format code relies on a python-generated atlas of structs
that describe a lookup table for texture swizzling. Many of these
texture formats contain the index "6" used for this lookup. The 6th
index just so happens to represent a "don't care" value, however the
out of bounds read is still best to be avoided. The address sanitizer
finds this issue pretty immediately but it only shows up on big endian
because the textures don't need this on little.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20846>
2023-01-25 23:27:10 +00:00
Sidney Just
6c80f7c555 zink: Fix non debug builds failing to compile on
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20917>
2023-01-25 22:58:07 +00:00
Francisco Jerez
7b5e933629 intel/fs: Fix src and dst types of LOAD_PAYLOAD ACP entries during copy propagation.
The ACP entries created by copy propagation to track the implied
copies of LOAD_PAYLOAD instructions don't model the behavior of
LOAD_PAYLOAD correctly, since (as of 41868bb682) header
moves are implicitly retyped to UD and the destination of non-header
copies implicitly uses the same type as the corresponding source, even
though the ACP entries created for such copies could incorrectly
represent a type conversion, which can lead to mis-optimization of the
program.

According to Marcin, this fixes the func.mesh.ext.workgroup_id.task.q0
crucible test.

Fixes: 41868bb682 ("i965/fs: Rework the fs_visitor LOAD_PAYLOAD instruction")
Reported-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Tested-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18980>
2023-01-25 22:22:12 +00:00
Chad Versace
51b8abe0ba docs: Lower Python requirement to 3.6
Issue 7716 bumped the Python requirement from 3.6 to 3.7 for two
reasons. They are now non-issues.

  - Usage of f-strings. But f-strings are a 3.6 feature.
  - Usage of `from __future__ import annotations`. But the previous
    commit removes that usage.

See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7716
See: 5cf862fbb9 ("docs: update Python requirement to 3.7")
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20237>
2023-01-25 21:21:17 +00:00
Chad Versace
bca22a6578 util/glsl2spirv: Fix build with Python 3.6
ChromeOS still uses Python 3.6, but the glsl2spirv script uses module
'__future__.annotations', introduced in Python 3.7. Fix the build by
removing module, but otherwise preserve the type annotations.

Fixes: 949c3b55db ("util/glsl2spirv: add type annotations")
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20237>
2023-01-25 21:21:17 +00:00
Mike Blumenkrantz
e5e64e5c51 zink: validation ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20891>
2023-01-25 15:04:54 -05:00
Mike Blumenkrantz
23d3783f58 zink: force GENERAL layout for all fb attachments with image binds
this is incredibly stupid, but KHR-GL46.texture_view.coherency does all
kinds of rasterization discard draws with fb attachments bound as images,
and there's no other sane way to catch it dynamically

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20891>
2023-01-25 15:04:12 -05:00
Mike Blumenkrantz
1b52e85ead zink: update sampler layout when detecting feedback loop for first time
ensure synchronization between descriptor layout and layout used here

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20891>
2023-01-25 15:04:12 -05:00
Mike Blumenkrantz
d791e9a77d zink: return false for implicit feedback loop check with image binds
this can only be GENERAL layout so it's not a feedback loop ever

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20891>
2023-01-25 15:04:12 -05:00
Mike Blumenkrantz
bdaded5a18 zink: don't skip repeated handling feedback loops
these can persist across multiple draws, so return true if it's still
a feedback loop

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20891>
2023-01-25 15:04:12 -05:00
Mike Blumenkrantz
fda5f83ced zink: move barrier jit to zink_context.c
this gives access to all the good descriptor functions and enshrinkens
the c++ file size

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20891>
2023-01-25 15:04:12 -05:00
Mike Blumenkrantz
06a125942b zink: fix VK_DYNAMIC_STATE_LINE_WIDTH usage
add a special tracker here to set the state only when necessary

Fixes: 659c39fafb ("zink: rework primitive rasterization type logic")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20886>
2023-01-25 19:46:56 +00:00
Samuel Pitoiset
a5bff81f47 radv/winsys: prefix all error messages with RADV
RadeonSI prints the exact same message and it can be confusing.
All other error messages in the winsys are prefixed now.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20904>
2023-01-25 18:47:52 +00:00
Mike Blumenkrantz
d5846bd1e5 radv: Move constant flushing check out to callers.
Approximately 10% improvement in CPU overhead score on 3900X.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20655>
2023-01-25 18:27:20 +00:00
José Roberto de Souza
5ccc2049fa intel/ds: Nuke intel_ds_queue::queue_id
queue_id is not used anywhere.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20888>
2023-01-25 17:43:57 +00:00
José Roberto de Souza
f2fdd14907 hasvk: Nuke anv_queue:index_in_family
This value is also stored in vk_queue, so we can nuke from anv_queue.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20888>
2023-01-25 17:43:57 +00:00
José Roberto de Souza
013e849a2c anv: Nuke anv_queue:index_in_family
This value is also stored in vk_queue, so we can nuke from anv_queue.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20888>
2023-01-25 17:43:57 +00:00
José Roberto de Souza
80dd6ed074 intel: Add kmd_type parameter to necessary intel_gem.h functions
Here adding kmd_type parameter to
intel_gem_read_render_timestamp(), intel_gem_can_render_on_fd() and
intel_gem_supports_protected_context().
Those 3 functions will have Xe implementations, the other functions
in intel_gem.h will not be called by Xe code paths so not adding
kernel_driver_type to it.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20773>
2023-01-25 09:17:15 -08:00
José Roberto de Souza
162695f0b8 intel: Add intel_kmd_type parameter to intel_engine_get_info()
This will be needed to execute proper function to fetch engines from
kernel mode driver.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20773>
2023-01-25 09:16:55 -08:00
José Roberto de Souza
2c42641994 intel/dev: Detect what is the kernel mode driver loaded
Intel GPUs will have a new kernel mode driver, support for some
platforms will overlap so we will need to detect in runtime what is
the kernel mode driver loaded for each device.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20773>
2023-01-25 09:16:55 -08:00
Philip Langdale
0504a3b079 radeonsi: correctly declare YUV420_10 RT Format support for AV1
This appears to have been an oversight. AV1 Main profile requires
support for both 8bit and 10bit, and so we should always declare
support for the YUV420_10 RT Format. This support then cascades
into supporting the appropriate surface formats and meets expectations
of vaapi clients (especially ffmpeg based) on how to detect support
for these formats.

Note that the commit [0b02db3007] was also made with the intention of
fixing this problem, but it does so in a non-idiomatic way. With that
change, there is still no declared YUV420_10 RT Format, and instead
the P010 surface format is reported under the YUV420 RT Format. This
is not going to work with all vaapi clients. I recommend that this
commit be reverted.

Signed-off-by: Philip Langdale <philipl@overt.org>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20870>
2023-01-25 16:15:25 +00:00
Konstantin Seurer
3eb646efd0 radv: Merge the leaf and internal converter
We have everything we need in the internal one already so we can just
encode leaf nodes there. Since this functionality isn't split anymore,
the shader was renamed to "encode".

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20768>
2023-01-25 15:54:03 +00:00
Rhys Perry
883f18f761 radv: skip creation of null TLAS for null winsys
This won't work because there are no memory types.

Fixes fossilize replay with NULL winsys.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Fixes: 31ca19589f ("radv: Create a null TLAS as meta state")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20878>
2023-01-25 14:16:54 +00:00
Martin Roukala (né Peres)
345d41155f ci/b2c: uprev to b2c v0.9.9
No functional change expected, just a minor reduction in size compared
to the previous version and updated components.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20806>
2023-01-25 12:37:57 +00:00
Helen Koike
7b51a583ed ci/android: add android to the ci
Add android to the ci, so we can test mesa on it.

Add debian/x86_test-android and test-android jobs.
One build the container to run tests, and the other execute the tests.

Android is executed on top of cuttlefish VM with virgl.
Mesa libs are replaced on the cuttlefish image, and deqp and deqp-runner
are used to execute tests.

Co-developed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>
2023-01-25 08:58:26 -03:00
Helen Koike
068dc91317 ci: export artifacts from debian-android
export mesa build from this job, so it can be picked up by an android
testing job.

Co-developed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>
2023-01-25 08:58:25 -03:00
Helen Koike
3cb7a8537b ci: debian-android compile virgl
compile virgl so we can test android on a vm.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>
2023-01-25 08:58:25 -03:00
Helen Koike
e42ef902de ci: compile deqp-runner for android
To allow testing mesa on android, we need deqp-runner compiled for it,
so we can add android on the ci.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>
2023-01-25 08:58:25 -03:00
Helen Koike
54a46c594e ci: compile deqp for android
To allow testing mesa on android, we need deqp compiled for it, so we
can add android on the ci.

Add patch that redirect logs to stdout instead of logcat.
Compile deqp to allow running it directly from command line instead of
Android activity.

Co-developed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>
2023-01-25 08:58:25 -03:00
Tomeu Vizoso
d024af8d00 ci: Use NDK 25b to build for the Android ABI level 33
25b is the currently supported NDK, as per the below:

https://github.com/android/ndk/wiki

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>
2023-01-25 08:58:25 -03:00
Helen Koike
d66cfe6a3e ci/android: move sdk version and ndk to a job variable
make it easier to update sdk version and ndk without the need to make
changes all over the code.

Suggested-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>
2023-01-25 08:58:25 -03:00
Tomeu Vizoso
bdcbf7dcf8 ci: Build for Android with libbacktrace=false
This is needed for using this build inside Android systems with VNDK
enabled, as in recent versions of it libbacktrace isn't available to
libraries in /vendor.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>
2023-01-25 08:58:25 -03:00
Tomeu Vizoso
a5c96cb705 android: Cleanup unneeded headers from the sync stub
These were probably copy pasted from the previous unified stub.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>
2023-01-25 08:58:25 -03:00
Tomeu Vizoso
b1bd6aa21a android: Make libbacktrace optional again
For the same reason why we used to have USE_LIBBACKTRACE with the old
Android makefiles, allow to build Mesa without linking to it.

In recent VNDK versions, libbacktrace isn't available.

When building without linking libbacktrace, for some reason some symbols
related to C++ exception handling are exposed. Allow them in the symbols
check script.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>
2023-01-25 08:58:25 -03:00
Helen Koike
0e286d0dbc android: allow system = 'android' on cross file
Allow building with system = 'android' on the cross file.
This avoids creating symlinks for the libs.

Suggested-by: Roman Stratiienko <r.stratiienko@gmail.com>
Suggested-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>
2023-01-25 08:58:25 -03:00
Helen Koike
87e6703b67 ci: move patches to patches directory
Group all patches in a directory.
Improve organization to organize the current and future patches.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>
2023-01-25 08:58:25 -03:00
Helen Koike
388b49d150 ci/debian-android: move pkgconfig paths to the cross file
Move pkgconfig paths out of the job script into the cross file.
Use pkg_config_libdir on the cross file instead.
Which makes more sense and cleaner code.

Suggested-by: David Heidelberg <david.heidelberg@collabora.com>
Suggested-by: Roman Stratiienko <r.stratiienko@gmail.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>
2023-01-25 08:58:25 -03:00
Italo Nicola
6c446377ff panfrost: fix off-by-one when exporting format modifiers
`count` should not be incremented before the check, because it causes
the modifiers array to be filled starting from position 1 instead of 0.

This bug causes one less format modifier to be available than would
otherwise be expected, which could then lead to a dmabuf query failing
in situations where a supported modifier wouldn't be advertised.

It also causes garbage data to be advertised as a modifier in position 0
of the array, although this is not very likely to cause issues.

Fixes: 2a1217513 ("panfrost: Implement panfrost_query_dmabuf_modifiers")
Cc: mesa-stable
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20879>
2023-01-25 09:24:50 +00:00
Samuel Pitoiset
7b76d46e38 radv: fix RADV_DEBUG=hang with multiple cmdbuffer per submission
With RADV_DEBUG=hang, there is only one cmdbuffer per submission and
this has been broken recently.

This fixes a segfault when generating GPU hang reports.

Fixes: 76deaa1b1a ("radv: Refactor command buffer handling in radv_queue_submit_normal.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20860>
2023-01-25 09:05:11 +00:00
Bas Nieuwenhuizen
75ae391375 radv: Reduce descriptor pool allocation for alignment.
Since we can now rely on this due to the stricter layout code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20847>
2023-01-25 08:45:50 +00:00
Bas Nieuwenhuizen
6a16d3b312 radv: Strictly limit alignment needed within a descriptor set.
By doing two passes we limit the number of times we need to have a gap
after a 16-byte descriptor to align for an image descriptor.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20847>
2023-01-25 08:45:50 +00:00
Pierre-Eric Pelloux-Prayer
f73cdda983 radeonsi/gfx11: fix ge_cntl programming
gfx11 renamed PRIM_GRP_SIZE to VERTS_PER_SUBGRP but another change was
was missed.

Update our code based on PAL's UniversalCmdBuffer::CalcGeCntl function
(especially useVgtOnchipCntlForTess being false for gfx11).

Fixes: 25a66477d0 ("radeonsi/gfx11: register changes")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20728>
2023-01-25 08:09:13 +00:00
Pierre-Eric Pelloux-Prayer
014a0bf0b6 radeonsi/gfx11: clamp PRIM_GRP_SIZE
Legal range of values is [1, 256].

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20728>
2023-01-25 08:09:13 +00:00
Pierre-Eric Pelloux-Prayer
f2ef663d08 winsys/amdgpu: use DMA_BUF_SET_NAME_B if available
Give a name to dma-buf. This name appears in /sys/kernel/debug/dma_buf/bufinfo
and could be useful to debug dma-buf:

Dma-buf Objects:
size    	flags   	mode    	count   	exp_name	ino     	name
00606208	00000002	00080007	00000003	drm	00192014	2321705-glxgears

The name is only added to non-shared buffer, to avoid overwriting
an existing name when exporting an imported buffer (otherwise all
dma-buf will pretend to be created by XWayland).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20728>
2023-01-25 08:09:13 +00:00
Pierre-Eric Pelloux-Prayer
3ed75027b7 drm-uapi/dma-buf.h: use __u32/__u64 types
Otherwise we might get build errors: https://gitlab.freedesktop.org/mesa/mesa/-/jobs/34886940

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20728>
2023-01-25 08:09:13 +00:00
Kenneth Graunke
bd8e8d204d iris: Add missing untyped data port flush on PIPELINE_SELECT
This is needed when switching away from GPGPU mode.  See the previous
commit for anv.  This is not likely to make a practical difference for
iris because it never switches back and forth between modes like anv.

Fixes: 172e0b0ebf ("iris: Update PIPELINE_CONTROL flush when switching pipeline mode in TGL+")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20774>
2023-01-25 07:08:55 +00:00
Kenneth Graunke
a8108f1d44 anv: Add missing untyped data port flush on PIPELINE_SELECT
See the comments in emit_apply_pipe_flushes().  Flushing HDC is not
sufficient in GPGPU mode, and we need to set the untyped data port flush
bit as well.

Fixes many dEQP-VK failures with INTEL_COMPUTE_CLASS=1 on Alchemist.

Fixes: 1067ec90a5 ("anv: Update PIPELINE_CONTROL flush when switching pipeline mode in TGL+")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20774>
2023-01-25 07:08:55 +00:00
Yogesh Mohan Marimuthu
bc07b1a0bf radeonsi: remove some shadow reg optimization for bf1 game
This patch removes below shadow reg optimization. This is done for
Vega64 battlefield 1 crash when shadow regs enabled.

  + reset only dirty states with buffers in si_pm4_reset_emitted()
  + various draw states in si_begin_new_gfx_cs()

v2: remove first_cs parameter from si_pm4_reset_emitted() (Marek Olšák)

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18301>
2023-01-25 04:53:34 +00:00
Yogesh Mohan Marimuthu
44f25792d5 radv: allow NULL initial_preamble_cs in radv_amdgpu_winsys_cs_submit_sysmem()
In case of mcbp, shadowed_regs is initialized early in radv_queue_init()
function by submitting the command buffer. The command buffer is submitted in
radv_init_shadowed_regs_buffer_state() function. When RADV_DEBUG=noibs is used
radv_amdgpu_winsys_cs_submit_sysmem() function is used to submit command buffer.
radv_amdgpu_winsys_cs_submit_sysmem() crashes here because initial_preamble_cs
is NULL. This patch fixes the radv_amdgpu_winsys_cs_submit_sysmem() function
to support NULL initial_preamble_cs.

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Acked-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/18301>
2023-01-25 04:53:34 +00:00
Yogesh Mohan Marimuthu
c6702e1530 radv: fence complete struct is 4 qw size
also libdrm function amdgpu_cs_chunk_fence_info_to_data() has qw multiplier
and hence need not do it in radv_amdgpu_cs_submit().

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-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/18301>
2023-01-25 04:53:34 +00:00
Yogesh Mohan Marimuthu
b11f49f069 radv: INDEX_TYPE and NUM_INSTANCES PKT3 are not shadowed
INDEX_TYPE and NUM_INSTANCES PKT3 should be always written
if shadowing is enabled since they are not shadowed.

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-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/18301>
2023-01-25 04:53:34 +00:00
Yogesh Mohan Marimuthu
2258090c73 radv: set preemp flag and pre_ena bit for shadowregs
Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-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/18301>
2023-01-25 04:53:34 +00:00
Yogesh Mohan Marimuthu
97b9b2cf40 radv: add support for register shadowing
Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-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/18301>
2023-01-25 04:53:34 +00:00
Yogesh Mohan Marimuthu
db61db7f67 radv: add shadowregs variable to RADV_DEBUG environment variable
Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-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/18301>
2023-01-25 04:53:34 +00:00
Yogesh Mohan Marimuthu
5f0fcc05c2 ac,radeonsi: move shadow regs create ib preamble function to amd common
The si_create_shadowing_ib_preamble() function can be reused from radv also.
Hence it is moved.

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18301>
2023-01-25 04:53:34 +00:00
Emma Anholt
ab5dd2467f ci/freedreno: Mark max-texture-size as a flake.
It's been a popular spurious fail in merges in the last week.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20894>
2023-01-25 01:06:00 +00:00
Jakub Kulík
677a3053ff mesa: Fix format transform on big endian platforms
Reviewed-by: Emma Anholt <emma@anholt.net>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6001
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19051>
2023-01-24 23:30:33 +00:00
Emma Anholt
5d5cc7525d ci/zink: Update radv xfails for the recent shadow fixes.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>
2023-01-24 20:56:13 +00:00
Emma Anholt
656f62a801 ci/zink: Update TGL full-run xfails.
arb_shader_texture_lod-texgradcube was a fail incorrectly removed in the
sahdow changes.  line-smooth-* is new piglit coverage.

Haven't pinpointed when the rest were fixed.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>
2023-01-24 20:56:13 +00:00
Emma Anholt
512f1c160a ci/zink: Add coverage using the vulkan validation layer on lvp.
Let's make sure we aren't introducing new validation failures as
development proceeds.  Basically, we record the current set of known
validation failures from the CTS, and for any validation failure we have
the layer log it and abort.

I had started encoding xfails from piglit, but it turns out that piglit
and the validation layer fight about the teardown process, producing
use-after-frees.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>
2023-01-24 20:56:13 +00:00
Emma Anholt
4286633eec zink: Re-emit the SpvBuiltInSampleMask access chain each load.
Otherwise, the access chain you emitted last time may not dominate the
current use.

Fixes the following validation failure in
dEQP-GLES31.functional.shaders.sample_variables.sample_mask_in.bits_unique_per_sample.multisample_texture_2:

  UNASSIGNED-CoreValidation-Shader-InconsistentSpirv(ERROR / SPEC):
  msgNum: 7060244 - Validation Error: [
  UNASSIGNED-CoreValidation-Shader-InconsistentSpirv ] Object 0: handle =
  0x55cf3cea2c60, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6bbb14 |
  SPIR-V module not valid: ID '67[%67]' defined in block '23[%23]' does
  not dominate its use in block '31[%31]'

Fixes: 8899f6a198 ("zink: fix gl_SampleMaskIn spirv generation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>
2023-01-24 20:56:13 +00:00
Emma Anholt
1e4deb3b89 zink: Fix up mismatches of memory model vs addressing model.
MemoryModelVulkan was left out for CSes using it.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>
2023-01-24 20:56:13 +00:00
Emma Anholt
adf81044d4 zink: Fix validation failure for maxLod < minLod.
GL lets you set a silly state, so do something plausible instead of
undefined.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>
2023-01-24 20:56:13 +00:00
Emma Anholt
2a33d509ca zink: Add missing Flat decorations on some inputs.
Fixes validation failures:

Test case 'dEQP-GLES31.functional.android_extension_pack.shaders.es32.extension_directive.oes_sample_variables'..
MESA: error: Validation Error: [
UNASSIGNED-CoreValidation-Shader-InconsistentSpirv ] Object 0: handle =
0x563a1838b790, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6bbb14 |
SPIR-V module not valid: [VUID-StandaloneSpirv-Flat-04744] Fragment
OpEntryPoint operand 31 with Input interfaces with integer or float type
must have a Flat decoration for Entry Point id 4.
%gl_SampleId = OpVariable %_ptr_Input_uint Input

Test case 'KHR-GL46.shader_ballot_tests.ShaderBallotAvailability'..
MESA: error: Validation Error: [ UNASSIGNED-CoreValidation-Shader-InconsistentSpirv ] Object 0: handle = 0x5558e12f17e0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6bbb14 | SPIR-V module not valid: [VUID-StandaloneSpirv-Flat-04744] Fragment OpEntryPoint operand 28 with Input interfaces with integer or float type must have a Flat decoration for Entry Point id 4.
  %gl_SubgroupLocalInvocationId = OpVariable %_ptr_Input_uint Input

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>
2023-01-24 20:56:13 +00:00
Emma Anholt
7b6a5e3e24 zink: Fatal error if requesting validation and we fail to load the layer.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>
2023-01-24 20:56:12 +00:00
Jesse Natalie
81b5f6a3fd dzn: Use core feature matching logic instead of rolling our own
This will print nice messages on unsupported features

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>
2023-01-24 11:00:05 -08:00
Jesse Natalie
db083070f0 dzn: Implement subgroup size control extension
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>
2023-01-24 11:00:05 -08:00
Jesse Natalie
a041cd48f4 dzn: Support more subgroup/quad ops
See the comment around supported shader stages - to avoid
introducing CTS failures, vertex/geometry support for
subgroups are turned off since they cannot support quads.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>
2023-01-24 11:00:05 -08:00
Jesse Natalie
9d26aa99d5 spirv2dxil: Support subgroup SPIR-V caps
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>
2023-01-24 11:00:05 -08:00
Jesse Natalie
a8329595fa spirv2dxil: Lower some wave op properties
DXIL has no concept of subgroup mask ops, relative
shuffle ops, and everything is scalar.

Most wave broadcast ops support i1 overloads, except
for quad swap operations. Go figure. Use lower_bit_size
to promote those to i32 instead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>
2023-01-24 11:00:05 -08:00
Jesse Natalie
f58d763363 microsoft/compiler: Support emitting the SM6.6 wave size tag
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>
2023-01-24 11:00:05 -08:00
Jesse Natalie
2c5d96bb58 microsoft/compiler: Implement more wave/quad ops
This handles ballot, vote, shuffle, broadcast, and quads

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>
2023-01-24 11:00:05 -08:00
Jesse Natalie
a318c101bb microsoft/compiler: Handle i1 overloads
Some wave ops can have bool/i1 overloads

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>
2023-01-24 11:00:05 -08:00
Jesse Natalie
e1b6e0748f microsoft/compiler: Handle i2i1 and u2u1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>
2023-01-24 11:00:05 -08:00
Jesse Natalie
1ef9ba9166 microsoft/compiler: Don't emit threadgroup barriers for graphics shaders
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>
2023-01-24 11:00:04 -08:00
Pedro J. Estébanez
e07e9a08cb spirv_to_dxil: Unify spirv_to_nir_options
Beyond the pure refactoring, this fixes spirv2dxil, which was using outdated values.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20884>
2023-01-24 18:07:18 +00:00
Jesse Natalie
12a471afac dzn: Enable Vulkan 1.1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
3f0bbb19de dzn: Fix independent blend check
Memcmp returns 0 on equal, so !memcmp means equal.

Fixes: c92729c3 ("dzn: Enable independent blending")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
602a54a083 dzn: Don't expose variable pointers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
ad7157c1e8 dzn: A single sampler descriptor set needs to support 1024 samplers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
884d870929 dzn: Descriptor limits are based on binding tier, not heap tier
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
9f13a4a10a dzn: Usage MULTISAMPLE_LOAD support instead of RT/DS support for MSAA
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
29a0bcdd84 dzn: Support EXTENDED_USAGE bit
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
c0d8838c30 dzn: Usage image view usage instead of image usage
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
1041e0d281 dzn: Use SHADER_LOAD to indicate SAMPLED_IMAGE support
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
cfc05566ab dzn: Move patched vertex buffer capability check up a level
Some of these patched formats are also needed as (trivial) image
formats, so we can't just report vertex buffer as the only supported
operation.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
ceb287a509 dzn: When rendering to 3D, don't treat layers as subresources for barriers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
232c598e79 dzn: Set dynamic rendering caps
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
c8b9f70fca dzn: Respect suspending/resuming flags to omit clears/resolves
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
cfa260cd27 dzn: Use common physical device list/enumeration helpers
Implements EnumeratePhysicalDeviceGroups for us for free

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
0bae7a307c dzn: Support vkCmdDispatchBase
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
296ad630db spirv2dxil: Support dispatches with base group indices
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
6bb765f3d1 microsoft/compiler: Lower device index to zero
Maybe we'll support actual device groups at some point, but today
is not that day.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
725948c6c9 microsoft/compiler: Fix atomic image umax
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Mike Blumenkrantz
97740401dc zink: fix implicit feedback loop detection
the code here was all expecting the VkPipelineStageFlags bitfield expansions,
but u_foreach_bit() gives the actual bit, so implicit feedback loops were never
actually being detected

instead, convert back to the bitfield at the top of the loop so the value works
as expected

Fixes: 9ba0657903 ("zink: make implicit feedback loop application stricter")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20863>
2023-01-24 16:48:48 +00:00
Samuel Pitoiset
49b7f0842e radv: print depth image size with RADV_DEBUG=img
This turned out to be useful when investigating a GPU hang.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20872>
2023-01-24 15:42:44 +00:00
Lionel Landwerlin
5b79745b04 intel/common: add a INTEL_DECODE variable to parameter decoder at runtime
Sometimes you want to diff 2 runs with INTEL_DEBUG=bat, but a tiny
allocation change can mess quite badly with offsets printed in the
decoding, making it hard to look at the diff with meld.

Fortunately our decoder can avoid printing offsets. We just need a
variable to specify that.

We still use the defaults specified by the driver but you can turn
things on/off with :

INTEL_DECODE=+color,-offsets,-floats INTEL_DEBUG=bat ./my_app

Signed-off-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/20874>
2023-01-24 15:15:17 +00:00
Lionel Landwerlin
31931754bc intel/decoder: print out compute push constants
Signed-off-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/20874>
2023-01-24 15:15:17 +00:00
Marcin Ślusarz
536a2acfc2 intel/compiler/mesh: handle const data in task & mesh programs
Started showing up when nir_opt_large_constants call was moved in 88756cee8d.
Fixes dEQP-VK.mesh_shader.ext.smoke.monolithic.fullscreen_gradient*

Suggested-by: Kenneth Graunke <kenneth@whitecape.org>
Fixes: 88756cee8d ("intel/compiler: Run nir_opt_large_constants before scalarizing consts")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20876>
2023-01-24 14:47:21 +00:00
Marcin Ślusarz
9bb18a4f9e intel/compiler: fix generation of vec8/vec16 alu instruction
I stumbled on this when I inserted some suboptimal lowering code after all
optimizations. Adding certain subset of optimizations after my lowering code
actually avoided this bug, so I think it's not possible to hit this on upstream.

Let's fix this for the next person generating suboptimal code...

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20857>
2023-01-24 13:15:58 +00:00
Yogesh Mohan Marimuthu
19b0bafe35 loader,glx,egl: remove is_different_gpu variable from loader
v2: fd number is different (Pierre-Eric)
v1: remove is_different_gpu (Pierre-Eric)

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/13422>
2023-01-24 12:51:35 +00:00
Yogesh Mohan Marimuthu
648cbd47a7 glx: remove is_different_gpu variable from struct dri_screen
v2: fd number is different (Pierre-Eric)
v1: remove is_different_gpu (Pierre-Eric)

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/13422>
2023-01-24 12:51:35 +00:00
Yogesh Mohan Marimuthu
31013f3ce7 egl: remove is_different_gpu variable from struct dri2_egl_display
v2: fd number is different (Pierre-Eric)
v1: remove is_different_gpu (Pierre-Eric)

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/13422>
2023-01-24 12:51:35 +00:00
Yogesh Mohan Marimuthu
1a0ec8e8d3 loader,glx,egl,vl,d3d: loader_get_user_preferred_fd() function to return original_fd
v1: return original_fd in loader_get_user_preferred_fd() (Pierre-Eric)
v2: fix *original_id crash for android, haiku... (Pierre-Eric)
    remove extra comment (Pierre-Eric)
v2: also return render fd in case of original_fd passed is NULL (Pierre-Eric)

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/13422>
2023-01-24 12:51:35 +00:00
Yogesh Mohan Marimuthu
1c5b61eefb loader,glx: add render_gpu tag psc->driScreen and psc->fd
v1: add render_gpu_tag (Pierre-Eric)

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/13422>
2023-01-24 12:51:35 +00:00
Yogesh Mohan Marimuthu
c712419c1a egl: add render_gpu tag to dri2_dpy->fd and dri2_dpy->dri_screen variable
v1: add render_gpu_tag (Pierre-Eric)

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/13422>
2023-01-24 12:51:35 +00:00
Yogesh Mohanmarimuthu
967b9ad084 egl/wayland: for prime, allocate linear_copy from display GPU VRAM
Allocates VRAM in display GPU in case of prime. Then the dma_buf is imported
into prime GPU.

v4: add image tag to __DRIimage (Marek Olšák)
v3: move display fd opening to separate commit (Pierre-Eric)
    image_format_to_fourcc() non-static to seperate commit (Pierre-Eric)
v2: close query fds after linear_copy buffer import (Marek Olšák)
    use image_format_to_fourcc() from loader_dri3_helper.c (Marek Olšák)

Signed-off-by: Yogesh Mohanmarimuthu <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/13422>
2023-01-24 12:51:35 +00:00
Yogesh Mohanmarimuthu
42a46f2c5f loader: make image_format_to_fourcc() non-static
the image_format_to_fourcc() function will be used from
egl/wayland hence make it non-static. Also move the function
into loader_dri_helper.c from loader_dri3_helper.c since
loader_dri3_helper library depends on xcb which will make
egl wayland depend on xcb indirectly.

v2: add loader tag to extern image_format_to_fourcc() (Marek Olšák)

V3: move image_format_to_fourcc to loader_dri_helper.c
Signed-off-by: Yogesh Mohanmarimuthu <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/13422>
2023-01-24 12:51:35 +00:00
Yogesh Mohanmarimuthu
57b22f99a9 egl/wayland: keep display fd open for prime
Keep the display fd open for creating DRI screen on display gpu in
case of prime.

Signed-off-by: Yogesh Mohanmarimuthu <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/13422>
2023-01-24 12:51:35 +00:00
Yogesh Mohanmarimuthu
94946251d0 loader,glx,egl/x11: init dri_screen_display_gpu in struct loader_dri3_drawable
Initialize dri_screendisplay_gpu variable in struct laoder_dri3_drawable.
Also make dri_screen_display_gpu variable as input parameter to function
loader_dri3_drawable_init() since dri_screen variable is initialized this way.
This also helps to avoid duplicate initializing dri_screen_display_gpu
in glx and egl code.

Signed-off-by: Yogesh Mohanmarimuthu <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/13422>
2023-01-24 12:51:35 +00:00
Yogesh Mohanmarimuthu
5519dd0bd1 egl: create DRI screen for display GPU in case of prime
The created DRI screen can be used to allocate VRAM memory from
display GPU in case of prime.

v2: remove extra whitespace (Marek Olšák)

Signed-off-by: Yogesh Mohanmarimuthu <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/13422>
2023-01-24 12:51:35 +00:00
Yogesh Mohanmarimuthu
b8da022da4 egl,egl/x11: keep display fd open for prime
Keep the display fd open for creating DRI screen on display gpu in
case of prime. Also close the fd opened in dri2_display_destroy()

Signed-off-by: Yogesh Mohanmarimuthu <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/13422>
2023-01-24 12:51:35 +00:00
Yogesh Mohanmarimuthu
4e6e30215d egl: add fd_display_gpu to struct dri2_egl_display
fd opened on display gpu is saved in fd_display_gpu. It is later used
to create dri screen on display gpu.

Signed-off-by: Yogesh Mohanmarimuthu <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/13422>
2023-01-24 12:51:35 +00:00
Tapani Pälli
0813c1a6fa intel/genxml: set unused 3DSTATE_PS_EXTRA field as mbz
Wa_14015360517 mentions situations where HW produces invalid
occlusion query results when "Pixel Shader Does not write to RT"
bit is set.

"When Pixel Shader Kills Pixel is set, SW must perform a dummy render
 target write from the shader and not set this bit, so that Occlusion
 Query is correct."

Another situation is when writing to UAV or to NULL render target.
Patch sets field as 'must be zero' to discourage possible use of it.

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/20849>
2023-01-24 10:28:15 +00:00
Tapani Pälli
205d40b8db mesa: move component bits queries as GL ES only
These enums have been removed/deprecated long time ago from desktop
GL. Here we remove them from modern GL while still allow for compat
contexts (~old apps). This change matches proprietary drivers and makes
our behaviour same within CTS with some tests.

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/20719>
2023-01-24 10:04:28 +00:00
Iago Toral Quiroga
a81063d2ca v3dv: ensure we allocate at least the requested space for a CL
While we are already ensuring we allocate at least 8192 bytes should
this not be the first allocation and our allocations are typically just
a few bytes, multilayered framebuffers with large numbers of layers may
require more space than that in a single allocation.

Fixes: 3325950648 ('v3dv: increase BO allocation size when growing CLs')
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20871>
2023-01-24 09:49:14 +00:00
Mike Blumenkrantz
0c6e56c391 mesa: (more) correctly handle incomplete depth textures
according to GL spec, incomplete shadow samplers should return 0

this is technically possible for drivers to do using a RGBA texture in
the sense that somehow it's been working, but it's broken at the gallium-level
for what drivers should be expecting to see in such circumstances given
that such scenarios have been binding a RGBA texture to use with shadow samplers

instead, we can give drivers a fallback Z32 texture to avoid format/sampler
mismatches and complying with expected behavior

see also KHR-GL46.incomplete_texture_access.sampler for driver-specific testing

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20817>
2023-01-24 09:13:48 +00:00
Mike Blumenkrantz
818cc30852 mesa: populate gl_program::ShadowSamplers mask from shader data
this data is already processed, it just isn't being propagated for whatever reason

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20817>
2023-01-24 09:13:48 +00:00
Mike Blumenkrantz
64140a73c1 mesa: remove dead parameter doc for _mesa_new_texture_object()
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20817>
2023-01-24 09:13:48 +00:00
Mike Blumenkrantz
ef3205ae57 zink: pass depth swizzle data block to shader compile
with everything now hooked up, this should fix all related test failures

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20598>
2023-01-24 08:30:09 +00:00
Mike Blumenkrantz
336d7630fd zink: remove old depth swizzle workaround
this is already handled in match_tex_dests(), so it does nothing here

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20598>
2023-01-24 08:30:09 +00:00
Mike Blumenkrantz
b6518f3ba5 zink: create another samplerview for shadow textures
when doing legacy depth texture mode sampling, it's necessary to keep
another view that has the right (R in component 0) swizzle so that depth
values can actually be returned in cases where it would otherwise be
a constant value due to swizzling

this also allows zink_sampler_view::shadow_needs_shader_swizzle to be removed

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20598>
2023-01-24 08:30:09 +00:00
Mike Blumenkrantz
c46fb43473 zink: plug in the program/module parts of shadow texture mode emulation
this is clunky because of how big the swizzle data block is,
but the gist of it is the data block is stored onto the shader module key
after all the other data, and then it gets manually hashed/compared in
relevant cases

it's gross, but so is this functionality

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20598>
2023-01-24 08:30:09 +00:00
Mike Blumenkrantz
ef233d43f4 zink: block pipeline fast-pathing for any programs using depth texture modes
the data for this is too big to compress into a shader key, so these pipelines
will always consume more cpu

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20598>
2023-01-24 08:30:09 +00:00
Mike Blumenkrantz
1b2bf99f05 zink: rework depth sampler splatting in shaders
this enables passing a zink_fs_shadow_key to the compiler to manually
apply a swizzle other than R/R/R/R to depth texture results

currently no data is passed, so the previous splatting behavior is preserved

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20598>
2023-01-24 08:30:09 +00:00
Mike Blumenkrantz
5193f4f712 zink: add a fs shader key member to indicate depth texturing mode
this does nothing now besides track the data

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20598>
2023-01-24 08:30:09 +00:00
Mike Blumenkrantz
f62ccaacb8 zink: track depth swizzle on samplerviews
this will provide info for shader rewrites

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20598>
2023-01-24 08:30:09 +00:00
Mike Blumenkrantz
c20c79f584 zink: add an extra_data param to zink_shader_compile
this is extra shader key data that can be used in various ways per stage
and is too large to fit into the shader key

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20598>
2023-01-24 08:30:09 +00:00
Mike Blumenkrantz
e9e4c6266e zink: break out tex dest rewriting into separate function
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20598>
2023-01-24 08:30:09 +00:00
Mike Blumenkrantz
368197923b zink: flag old-style shadow tex mask for fragment shaders
this will be useful for handling depth texturing modes

only 32 are tracked now for performance reasons

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20598>
2023-01-24 08:30:09 +00:00
Samuel Pitoiset
bf3c14b8a5 radv/winsys: fix incorrect PCIID for GFX11 in the null winsys
Fixes: bbad550f3d ("radv/winsys: fill real info for CHIP_GFX1100")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20850>
2023-01-24 08:00:57 +00:00
Lionel Landwerlin
a50d2fdb46 intel/fs: avoid cmod optimization on instruction with different write_mask
I've been running into failures with tests like :

dEQP-VK.robustness.robustness2.bind.notemplate.rgba32i.unroll.nonvolatile.uniform_buffer_dynamic.no_fmt_qual.len_4.samples_1.1d.frag

With the load_global_const_block_intel NIR intrinsic, you can load a
vec8/vec16 with a predicate. The predicate is correctly uniformized to
feed into the SEND instruction's flag register.

The problem is that a series of optimization first remove the
find_live_channel and then changes the broadcast into a simple MOV
instruction, on the assumption that the first channel is always active
if there is not control flow. This is correct.

But after that the cmod optimzation will remove this instruction :

   mov.nz.f0.0(16) null:D, vgrf16+0.0<0>:D NoMask

because it seems to be equivalent to :

   cmp.g.f0.0(16) vgrf16:D, vgrf12:D, 63d

In this case vgrf16 is the predicate to the load block SEND
instruction. Since the execution mask is different between both, some
of the channels of the SEND instruction end up not being loaded or
loaded with the wrong predication and we end up with incorrect UBO
data.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20852>
2023-01-24 07:35:42 +00:00
Emma Anholt
159edf710e ci/piglit: Exclude swapbuffers front-readback tests with PIGLIT_PLATFORM=gbm.
These are expected to fail by the design of gbm.  Don't make each driver
track them.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20798>
2023-01-24 00:13:03 +00:00
Emma Anholt
849af68dbd ci/piglit: Add some common piglit skips for Mesa CI's testing of glx.
Since our X servers don't have a compositor, and we run tests in parallel,
various swap and frontbuffer tests won't ever be stable.  Rather than
having every driver have to track those flakes, make a general X11 skips
list as a known issue of our CI rather than pointing fingers at drivers.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20798>
2023-01-24 00:13:02 +00:00
Emma Anholt
ac5b1df2b9 ci: Move PIGLIT_PLATFORM settings out of the .tomls.
I'm going to add some automatic platform-based skips lists shortly (like
all-skips but more targeted), and this avoids needing to add them to each
.toml.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20798>
2023-01-24 00:13:02 +00:00
Emma Anholt
83c2b26acf ci/freedreno: Switch the piglit job to using a deqp-runner suite.
This is one of the few remaining piglit-runner.sh users.

I think the notable change here is that we no longer set
EGL_PLATFORM=surfaceless like the piglit-runner.sh script did.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20798>
2023-01-24 00:13:02 +00:00
Emma Anholt
ccfacab100 ci/zink: Clear issue #7781 flakes.
These tests all had valgrind UAF complaints that got fixed with the MR
closing that bug.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20798>
2023-01-24 00:13:02 +00:00
Emma Anholt
8189fd30ed ci/zink: Drop glx-swap-copy xfails.
These now skip, since there are no preserved configs any more.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20798>
2023-01-24 00:13:02 +00:00
Emma Anholt
d01f83841a ci/zink: Drop xfail for copy-sub-buffer.
This is a skip these days, since the ext isn't supported in the kopper
world.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20798>
2023-01-24 00:13:02 +00:00
Emma Anholt
68135c12ed ci: Drop windowoverlap xfails, since it's always skipped.
e31d08d307 made it a skip, so no need to
track these any more.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20798>
2023-01-24 00:13:02 +00:00
Emma Anholt
a0d7ccccc0 ci/virgl: Disable iris traces for now while it's unstable.
4 spurious fails today it looks like with the same
"[drm:virtio_gpu_get_capsets] *ERROR* timed out waiting for cap set 0"
signature.  It had started by at least Jan 20.

https://gitlab.freedesktop.org/mesa/mesa/-/jobs/35240569#L2929 (today)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20868>
2023-01-23 23:56:07 +00:00
Mike Blumenkrantz
c26306f7d9 radv: stop using radv_pipeline_has_stage() in BindPipeline
this incurs a small amount of unnecessary cpu overhead as compared to just
checking bitflags

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20615>
2023-01-23 21:04:53 +00:00
Paulo Zanoni
5039acfd9d hasvk: check the return value of anv_execbuf_add_bo_bitset()
This is the Hasvk version of Anv's:
  3d37950fd9 ("anv: check the return value of anv_execbuf_add_bo_bitset()")

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/20800>
2023-01-23 20:43:36 +00:00
Paulo Zanoni
80196aaa5b hasvk: don't leave undefined values in exec->syncobj_values
This is the Hasvk version of Anv's:
  ad6a036a68 ("anv: don't leave undefined values in exec->syncobj_values")

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/20800>
2023-01-23 20:43:36 +00:00
Sergi Blanch Torne
cce1f1ea70 ci: Uprev kernel to 6.1.7
Once prepared the archive in gfx-ci/linux for kernel 6.1 pointing to 6.1.7 and
with the patches for mesa, update the link. Also, enable some kconfigs needed
for the Adreno and USB.

One job in AMD required an expectation file to be updated with one test. Also,
an mt8192 device tree has been included in the arm64 trees for lava build.

Co-developed-by: Daniel Stone <daniels@collabora.com>
Co-developed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Co-developed-by: Helen Koike <helen.koike@collabora.com>
Co-developed-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20855>
2023-01-23 19:13:13 +00:00
Juston Li
1709590439 util/fossilize_db: fix macOS inotify build error
require <sys/inotify.h> for fossilize_db

Fixes: 3b69b67545 ("util/fossilize_db: add runtime RO foz db loading via FOZ_DBS_DYNAMIC_LIST")

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20755>
2023-01-23 18:31:48 +00:00
Boyuan Zhang
357340953a radeonsi/vcn: check fence before destroying decoder
Add a fence_wait before destroying decoder to make sure destory message has
been processed by firmware.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Sajeesh Sidharthan <sajeesh.sidharthan@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20805>
2023-01-23 17:46:54 +00:00
Boyuan Zhang
843bdd2262 radeonsi/vcn: check fence before destroying dpb
Add a fence_wait before destroying dpb buffer in dpg_unref_list to make sure
previous decode job has been done. (for DPB_DYNAMIC_TIER_2)

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Sajeesh Sidharthan <sajeesh.sidharthan@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20805>
2023-01-23 17:46:54 +00:00
Georg Lehmann
e527f686ca Revert "aco: Combine v_cvt_u32_f32 with insert to v_cvt_pk_u8_f32."
This reverts commit 6d02054047.

v_cvt_pk_u8_f32 returns 0xff instead of v_cvt_u32_f32 & 0xff if the input is
larger than 255.

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

Cc: mesa-stable
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20829>
2023-01-23 16:22:55 +00:00
SoroushIMG
c007a6e727 zink: update gl43 profile to allow imageRobustAccess
Now that zink can use imageRobustAccess and handle txf with invalid LODs,
update the profile to require either VK_EXT_image_robustness or VK_EXT_robustness2.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20808>
2023-01-23 15:16:01 +00:00
SoroushIMG
f855e2fff6 zink: lower LOD-invalid txf when imageRobustAccess2 is missing
GL robust buffer access applies to texelFetch with out of bounds LODs.
imageRobustAccess2 guarantees this, but imageRobustAccess does not.
Therefore, the txf robustness lowering pass from earlier is used
to provide this guarantee and support ARB/KHR robust_buffer_access_behavior.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20808>
2023-01-23 15:16:01 +00:00
SoroushIMG
90d5e449ae zink: add robust_access field to shader key
Since shaders can be shared even between robust and non-robust
contexts, the robustness state needs to be tracked.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20808>
2023-01-23 15:16:01 +00:00
SoroushIMG
37d00c1a8e zink: add VK_EXT_image_robustness
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20808>
2023-01-23 15:16:01 +00:00
SoroushIMG
6f15646945 zink: add zink_cs_key
Also, add shader key handling to compute programs.
This will be used later on for the rb_image workaround.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20808>
2023-01-23 15:16:01 +00:00
SoroushIMG
c448c7c2e2 zink: add pass checking for lod overflow in txf
Will be used later to workaround missing robustImageAccess2 along
with robustImageAccess.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20808>
2023-01-23 15:16:01 +00:00
Mike Blumenkrantz
474ed4b877 zink: use actual swapchain object for surface comparison
the outer swapchain object is persistent, which means checking it
will never yield an update after the first check

fixes #8122

Fixes: b2739c9f00 ("zink: set surface->dt when updating swapchain"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20814>
2023-01-23 14:51:39 +00:00
Rhys Perry
26e4621fa2 aco/tests: update assembler tests for latest LLVM 16
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/20747>
2023-01-23 12:30:28 +00:00
Rhys Perry
b0fa106dc6 aco/tests: fix assembler.gfx11.vop12c_v128 with LLVM 15
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/8089
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20747>
2023-01-23 12:30:28 +00:00
Erik Faye-Lund
9f4f131f2e radeonsi: respect smoothing_enabled
When this was last changed, the smoothing_enabled flag seems to have
been forgotten about, breaking line-smoothing (and probably also polygon
smoothing).

Fixes: 4147add280 ("radeonsi: update db_eqaa even if msaa is disabled")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20810>
2023-01-23 08:41:04 +00:00
Iago Toral Quiroga
3325950648 v3dv: increase BO allocation size when growing CLs
This can significantly reduce the number of allocations required
to record large command buffers with thousands of draw calls and
it improves significantly vkoverhead's results.

fps_avg helped:   serious_sam_trace01_1280x720.gfxr:                17.96 -> 18.50 (3.01%)
fps_avg helped:   vehicle-game-2.gfxr:                              9.09 -> 9.33 (2.67%)
fps_avg helped:   ue4_shooter_game_high_quality.gfxr:               17.40 -> 17.66 (1.48%)
fps_avg helped:   ue4_shooter_game_low_quality.gfxr:                25.25 -> 25.61 (1.44%)
fps_avg helped:   ue4_sun_temple.gfxr:                              24.93 -> 25.15 (0.86%)
fps_avg helped:   vkQuake_capture_frames_1_through_1200.gfxr:       52.54 -> 52.95 (0.78%)
fps_avg helped:   rbdoom-3-bfg_capture.gfxr:                        13.87 -> 13.96 (0.69%)
fps_avg helped:   sponza_demo02_800x600.gfxr:                       19.59 -> 19.63 (0.21%)

fps_avg HURT:   ue4_shooter_game_shooting_high_quality.gfxr:      19.14 -> 18.95 (-0.98%)
fps_avg HURT:   sponza_demo01_800x600.gfxr:                       20.03 -> 20 (-0.09%)
fps_avg HURT:   quake3e_capture_frames_1_through_1800.gfxr:       57.34 -> 57.34 (-0.01%)
fps_avg HURT:   serious_sam_trace02_1280x720.gfxr:                38.27 -> 38.27 (-0.01%)

total fps_min in shared programs: 311.74 -> 313.91 (0.69%)
fps_min in affected programs: 311.74 -> 313.91 (0.69%)
helped: 10
HURT: 2

total fps_max in shared programs: 319.54 -> 320.24 (0.22%)
fps_max in affected programs: 319.54 -> 320.24 (0.22%)
helped: 6
HURT: 6

total fps_avg in shared programs: 315.41 -> 317.36 (0.62%)
fps_avg in affected programs: 315.41 -> 317.36 (0.62%)
helped: 8
HURT: 4

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20787>
2023-01-23 07:14:33 +00:00
Iago Toral Quiroga
01c6eeeba5 v3dv: drop unused field from v3dv_cmd_buffer
Not needed since we moved to the common sync framework.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20787>
2023-01-23 07:14:33 +00:00
Jonathan Gray
0594b3c143 egl/dri2: avoid undefined unlocks
unlocks were incorrectly added to paths using dri2_egl_display() as
well as those using dri2_egl_display_lock()

pthread_mutex_unlock() when unlocked is documented by posix as
being undefined behaviour.  On OpenBSD pthread_mutex_unlock() will call
abort(3) if this happens.

Fixes: f1efe037df ("egl/dri2: Add display lock")
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20712>
2023-01-23 00:20:46 +00:00
David Heidelberg
e82cf650e9 ci: bump Mold to the 1.10.0
mold 1.9.0 was up to 10% slower than 1.8.0 on some multicore machines. We fixed the performance regression and made it even faster than 1.8.0.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20819>
2023-01-22 23:25:24 +00:00
David Heidelberg
4c1544b38a ci: Sir trace has small invisible change in rendering
Unrelated to MR itself.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20819>
2023-01-22 23:25:24 +00:00
Mike Blumenkrantz
5bbeb8f507 radv: add an early out in radv_cmd_buffer_flush_dynamic_state()
no point checking all the states if they're known to be unset

Reviewed-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/20653>
2023-01-22 13:27:23 +01:00
Thomas H.P. Andersen
a8caf451cb v3dv: use common code for descriptor update template
Use the common code and structs for this. Depends on !14780

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18625>
2023-01-22 11:20:29 +00:00
Adam Stylinski
9ca5a81a6e glx: fix a macro being invoked with the wrong parameter name
Strangely, this was somehow compiling with GCC but my futile efforts to
build mesa with msan caused me to find clang refusing to compile because
of this. Unknown how many bugs this could fix or how GCC did manage to
find "config" in scope but it's fairly obvious that this is the correct
parameter that should be used.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20830>
2023-01-22 04:22:08 +00:00
Konstantin Seurer
d59683ab89 radv: Enable extended SAH for shallow BVHs
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20656>
2023-01-21 20:26:41 +00:00
Konstantin Seurer
da87c2883d radv: Wrap internal build type inside a build_config struct
This will be useful for finer control over build configurations.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20656>
2023-01-21 20:26:41 +00:00
Konstantin Seurer
c53eb2f3d4 radv: Add a shader variant for PLOC with extended SAH
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20656>
2023-01-21 20:26:41 +00:00
Konstantin Seurer
b1755c0b21 radv/bvh: Add a define for extended SAH
This will be used to only chose depth aware SAH when we know that it's
more optimal and doesn't increase build overhead too much.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20656>
2023-01-21 20:26:41 +00:00
Konstantin Seurer
13a8a4071a radv/bvh/meson: Add the option to set defines
This is useful for compiling different variants of the same shader.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20656>
2023-01-21 20:26:41 +00:00
Eric Engestrom
e4ccd74cbc ci: be explicit about the meson setup subcommand
The old way of doing things is deprecated.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20827>
2023-01-21 14:44:33 +00:00
Gert Wollny
4f50eba5a5 r600/sfn: Fix splitting of multislot alu ops
The old source must not incorporate the start slot as lookup
index.

Fixes: commit 573448f93c
  r600/sfn: prepare alu split for use of variable length dot

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

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20826>
2023-01-21 11:28:09 +01:00
Gert Wollny
ac30c40211 r600/sfn: Fix opcode and result dest slot mask for variable size dot
Fixes: commit 2df023a1f1
    r600/sfn: pre-evaluate allowed dest mask in Alu instructions

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8120

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20826>
2023-01-21 11:27:57 +01:00
Marek Olšák
797b839111 glthread: disallow glthread if buffer uploads are unsupported
to remove fail paths that defeat the purpose of glthread.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
aca09e4f71 glthread: do vertex uploads if an index buffer is present for MultiDrawElements
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
7921396c7b glthread: remove the vbo_upload_ratio_too_large fallback for glMultiDrawElements
This would be possible to implement, but we don't know of any app where
it would help.

Now glthread fully handles all non-VBO uploads except glDrawIndirect.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
98a0e8c908 glthread: make marshal functions for glBegin/End attribs non-static
for a future commit

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
e9abed5315 glthread: pack and name the type of glthread_vao::Attrib
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
02f1968696 mesa: move gl_vertex_format_user definition into glthread.h
glthread.h needs it and it can't include mtypes.h because mtypes.h
includes it.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
c00db0dbc8 glthread: do vertex uploads if an index buffer is present for glDrawElements
glthread didn't implement uploading non-VBO vertices if indices were
in a buffer. This implements that.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
ed7d3b33b0 glthread: change multi_draw_elements_async() to never fail due to large size
Some callers (not visible here) silently ignore the return value. Remove
the return value and handle the failure in multi_draw_elements_async.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
fc93c69701 glthread: execute glMultiDrawArrays(draw_count < 0) asynchronously
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
68a926a15b glthread: set GL_OUT_OF_MEMORY if we fail to upload vertices
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
e39b90311c glthread: set GL_OUT_OF_MEMORY if we fail to upload indices
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
777166cc66 glthread: handle GL_*_ARRAY in glEnable/Disable
Surprisingly, the GL compatibility profile allows these in both
glEnableClientState and glEnable.

Fixes: 0b1dd18591 - glthread: track which vertex array attribs are enabled

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
a4d813ba54 glapi: autogenerate function parameters with no space between * and variable
print "int *v" instead of "int * v".

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
721526227c mesa: allow GL_UNSIGNED_INT64_ARB as vertex format for ARB_bindless_texture
This wasn't implemented, but the spec requires it.

Fixes: 1fe7b1f972 - mesa: implement ARB_bindless_texture

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
4f6e785876 util: fix util_is_vbo_upload_ratio_too_large
It was wrong. For example, if the draw vertex count was 10 and the upload
vertex count was 150, u_vbuf wouldn't unroll the draw and would instead
memcpy 150 vertices. This fixes that case.

Fixes: 068a3bf0d7 - util: move and adjust the vertex upload heuristic equation from u_vbuf

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
4d4995b32b glthread: fix an upload buffer leak
Fixes: befbd54864 - glthread: don't use atomics for refcounting to decrease overhead on AMD Zen

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20804>
2023-01-21 01:38:27 +00:00
Lionel Landwerlin
6f02f9d108 anv: fix preemption enable emission in gpu_memcpy
This has to be before the MI_BATCH_BUFFER_END otherwise it has no
effect.

This also was messing around with you batch length alignment.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: b9aa66d5d0 ("anv: disable preemption for 3DPRIMITIVE during streamout")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20802>
2023-01-20 22:35:41 +02:00
Mike Blumenkrantz
b3fd72fd09 radv: remove redundant type sizing
this is already 8 bits

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20751>
2023-01-20 19:43:43 +00:00
Mike Blumenkrantz
46e2cc5d4c radv: add some graphics pipeline hints to optimize pipeline bind
this is a costly function, and we want to avoid loading random struct data
as much as possible

these struct members aren't accessed anywhere else in the function, so eliminating
access avoids some cpu overhead

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20751>
2023-01-20 19:43:43 +00:00
Mike Blumenkrantz
8fc5d93060 radv: simplify depth aspect check in radv_handle_image_transition()
this info is already available, so reduce cpu overhead

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20751>
2023-01-20 19:43:43 +00:00
Mike Blumenkrantz
f9ff2d9d07 radv: reorder dynamic state checks during bind
this avoids potential out-of-order reads from a struct that spans
18 CPU cachelines

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20751>
2023-01-20 19:43:43 +00:00
Mike Blumenkrantz
83c290ff84 radv: repack radv_graphics_pipeline struct
this reduces the number of cachelines used by the struct and allows for
improved memory access

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20751>
2023-01-20 19:43:43 +00:00
Jesse Natalie
bfd891fe66 dzn: Support basic subgroups
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20777>
2023-01-20 18:50:57 +00:00
Jesse Natalie
33f59578fa spirv2dxil: Support basic subgroups
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20777>
2023-01-20 18:50:57 +00:00
Jesse Natalie
8872d5d1dc spirv2dxil: Use 32-bit shared offsets
nir_build_deref_var assumes that you're going to do so, and
there's no reason to use 64-bit types for Vulkan compute.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20777>
2023-01-20 18:50:57 +00:00
Jesse Natalie
2f8a8b5949 microsoft/compiler: Add lowering passes for basic subgroup vars
DXIL doesn't have a "subgroup ID" or "num subgroups" construct,
so add lowering to construct them. Subgroup ID is done using
once-per-subgroup atomics on a workgroup-shared variable, and
then broadcasting that (using read_first_invocation) to the other
threads. Num subgroups is just a division with the workgroup size.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20777>
2023-01-20 18:50:57 +00:00
Jesse Natalie
a422df4b61 microsoft/compiler: Implement a few basic wave/subgroup intrinsics
These are the ones that map perfectly between SPIR-V and DXIL that
are in the "basic" extension group (except for read-lane-first,
but we'll use with some lowering shortly).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20777>
2023-01-20 18:50:57 +00:00
Jesse Natalie
142faf894b microsoft/compiler: Add an overload param to unary function helpers
Subgroup ops aren't i32, they use none.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20777>
2023-01-20 18:50:57 +00:00
Mike Blumenkrantz
5d44318566 zink: don't use ds3 blend states without color attachments
this is illegal and causes validation errors

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20799>
2023-01-20 18:33:07 +00:00
Mike Blumenkrantz
b4d18f2ad1 zink: delete need_blend_constants
this is an artifact of very old code before the dynamic state was set
for all graphics pipelines

now the checks only cause blend constants to not be updated, which triggers
bugs and validation failures

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20799>
2023-01-20 18:33:07 +00:00
José Roberto de Souza
c1d99283e6 intel/dev: Split hwconfig i915 specific code
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20437>
2023-01-20 17:26:08 +00:00
José Roberto de Souza
b3b769894e intel/dev: Move i915 code to i915/intel_device_info.c
No behavior changes here.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20437>
2023-01-20 17:26:08 +00:00
José Roberto de Souza
1332702cf4 intel/dev: Export functions that will be used by different kernel drivers
No behavior changes here.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20437>
2023-01-20 17:26:08 +00:00
Samuel Pitoiset
473732dfd1 radv: remove an old FIXME about a possible bug with TC-compat HTILE
I added this FIXME 2 years ago because it was unclear if it was
broken or not. Since, CTS coverage improved and the number of tests
with depth/stencil on the compute queue increased a lot. vkd3d-proton
also widely uses depth/stencil with GENERAL on GFX10+ and likely with
async compute as well. No issues so far.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4048
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20785>
2023-01-20 17:07:26 +00:00
Rob Clark
1c82981bbe freedreno: Add driconf to disable conservative LRZ
The problematic sequence of draws is pretty rare.  But there are a small
handful of games which do not exhibit the problematic sequence and for
which invalidating LRZ on draws with blend plus depthwrite enabled hurts
performance slightly.  This driconf option enables opting in to the
previous behavior.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20708>
2023-01-20 16:18:03 +00:00
Rob Clark
b392d57042 util/xmlconfig: Use os_get_option()
Enable the property_get() fallback on android.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20708>
2023-01-20 16:18:03 +00:00
Rob Clark
720c842c50 turnip: Invalidate LRZ on blend+depthwrite
See the previous commit for details.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20708>
2023-01-20 16:18:03 +00:00
Rob Clark
899f2218fe turnip: Rename lrz force_disable_mask
Prep to use it to communicate more than just force-disable cases.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20708>
2023-01-20 16:18:03 +00:00
Rob Clark
0e1bdd0057 freedreno/a6xx: Invalidate LRZ on blend+depthwrite
Writing depth with blend enabled means we need to invalidate LRZ,
because the written depth value could mean that a later draw with
depth enabled (where we would otherwise write LRZ) could have
fragments which don't pass the depth test due to this draw.  For
example, consider this sequence of draws, with depth mode GREATER:

  draw A:
    z=0.1, fragments pass
  draw B:
    z=0.4, fragments pass
    blend enabled (LRZ write disabled)
    depth write enabled
  draw C:
    z=0.2, fragments don't pass
    blend disabled
    depth write enabled

Normally looking at the state in draw C, we'd assume we could
enable LRZ write.  But this would cause early-z/lrz to discard
fragments from draw A which should be visible due to draw B.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8065
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20708>
2023-01-20 16:18:03 +00:00
Rob Clark
c1b1b3e6ab freedreno/a6xx: Add LRZ perf warn for ztest direction changes
Add a perf warning when LRZ invalidate happens due to depth test
direction reversal.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20708>
2023-01-20 16:18:03 +00:00
Rob Clark
65e5b8e413 gallium/util: Add util_writes_depth() helper
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20708>
2023-01-20 16:18:03 +00:00
Rose Hudson
e8a60633da radeonsi: report 0 block size for Polaris HEVC encoding
makes encoded videos resemble the input again :)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7992
Fixes: c4482a3c1a ("radeonsi/vcn: enable multi-slice encoding")
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20714>
2023-01-20 15:07:31 +00:00
Timur Kristóf
08f6d14b85 radv: Make NGG query emission a dirty flag.
Don't emit the NGG query user SGPR if its state doesn't change.
Based on original work by Mike Blumenkrantz.

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/18819>
2023-01-20 14:31:45 +00:00
Tapani Pälli
247c06d419 iris: add restrictions for 3DSTATE_RASTER::AntiAliasingEnable
Field must be disabled if any render targets have integer
format, additionally for Gfx12+ field must be disabled when
num multisamples > 1 or forced multisample count > 1.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7892
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
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/20671>
2023-01-20 12:50:04 +00:00
Tapani Pälli
58dd9d5134 hasvk: add restrictions for 3DSTATE_RASTER::AntiAliasingEnable
Field must be disabled if any render targets have integer format.

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/20671>
2023-01-20 12:50:04 +00:00
Tapani Pälli
9b37ef40f8 anv: add restrictions for 3DSTATE_RASTER::AntiAliasingEnable
Field must be disabled if any render targets have integer
format, additionally for Gfx12+ field must be disabled when
num multisamples > 1 or forced multisample count > 1.

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/20671>
2023-01-20 12:50:04 +00:00
Samuel Pitoiset
f42521f6c3 radv: advertise extendedDynamicState3ColorBlendEquation
This enables full ds3 support with Zink!

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20281>
2023-01-20 11:55:07 +00:00
Samuel Pitoiset
de1e2b65db radv: fix detecting that blend is enabled when all CB states are dynamic
It's allowed to be NULL.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20281>
2023-01-20 11:55:07 +00:00
Samuel Pitoiset
4041be0f6f radv: enable compiling PS epilogs on-demand for dynamic color blend equations
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20281>
2023-01-20 11:55:07 +00:00
Samuel Pitoiset
daa2aeaa0c radv: add support for dynamic blend equation
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20281>
2023-01-20 11:55:06 +00:00
Samuel Pitoiset
11382a6711 radv: add a new helper for normalizing blend factors
It will be also used when compiling PS epilogs on-demand.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20281>
2023-01-20 11:55:06 +00:00
Samuel Pitoiset
39dcac4f79 radv: move some color blend helpers to radv_private.h
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20281>
2023-01-20 11:55:06 +00:00
Martin Roukala (né Peres)
f7dd9e5806 zink/ci: add spec@!opengl 1.1@line-smooth-stipple to the fails list
Fixes: a8d2b288ee ("ci/piglit: 2023-01-19 uprev")
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20807>
2023-01-20 11:29:03 +00:00
Rohan Garg
ec6ad8c7dc iris: Don't flush the render cache for a compute batch
Make sure we comply with BSpec and ensure that certain flush flags
are not set for compute batches

Signed-off-by: Rohan Garg's avatarRohan Garg <rohan.garg@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15664>
2023-01-20 11:09:24 +00:00
Danylo Piliaiev
926f626b95 tu/kgsl: do not use kgsl_command_object::offset
offset field in kgsl_command_object is NOT used by KGSL, so
we should offset directly to iova.

Fixes weird hangs on KGSL. E.g. fixes the hang in:
 dEQP-VK.memory.pipeline_barrier.transfer_dst_storage_texel_buffer.1024

cc: mesa-stable

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20795>
2023-01-20 10:50:20 +00:00
Iván Briano
58ababdee6 anv: uncompressed views of compressed 3d images are now valid
There was a VUID-VkImageViewCreateInfo-image-04739 in the Vulkan 1.3
spec that said:

    If image was created with the
    VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag and format is a
    non-compressed format, viewType must not be VK_IMAGE_VIEW_TYPE_3D

That VUID has since been removed, and when a view of a 3D image is
created, with put the depth into the array_len, so it won't be always 1.

Reviewed-by: Mark Janes <markjanes@swizzler.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20803>
2023-01-20 08:41:59 +00:00
Tatsuyuki Ishi
1617dac6c3 radv: Fix depth-only-with-discard when epilogs are used.
For a depth-only-with-discard pipeline, spi_shader_col_format needs to be
fixed up to a single channel export, or otherwise discard will not work.

Since col_format can change depending on the dynamic state, precompute the
need for this workaround on pipeline creation and apply it when emitting
prolog states.

Fixes: eb07a11b8f ("radv: add support for compiling PS epilogs on-demand")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20704>
2023-01-20 08:17:50 +00:00
Thomas H.P. Andersen
7bed7d9475 meson: use sections in summary()
Makes the list easier to read

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12161>
2023-01-20 04:22:40 +00:00
Thomas H.P. Andersen
6c0dc0b2a7 meson: use summary()
Make use of mesons summary() to create and align the configuration
summary.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12161>
2023-01-20 04:22:39 +00:00
Jesse Natalie
e8c8a94c2e dzn: Rework meta blit VS
Some D3D12 drivers, like my PC's AMD driver, don't like using a
dynamic index to load from a constant buffer that's bound via
root constants. Instead, just go ahead and load the full set of
vertex data and just bcsel which one to use.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20778>
2023-01-20 00:35:59 +00:00
Jesse Natalie
8de0c23ac9 dzn: Delete an unnecessary assert
As far as I can tell, having multiple levels in the view for a
color target just means to target the first one.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20778>
2023-01-20 00:35:59 +00:00
Jesse Natalie
c92729c3ce dzn: Enable independent blending
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20778>
2023-01-20 00:35:59 +00:00
David Heidelberg
613feb39c4 ci: bump ci-fairy with session support (robust downloads)
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20788>
2023-01-19 23:46:44 +00:00
David Heidelberg
a8d2b288ee ci/piglit: 2023-01-19 uprev
Emergency uprev to get robustness against http 50x errors for traces.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20788>
2023-01-19 23:46:44 +00:00
David Heidelberg
796686af1b ci: migrate from wget to curl
Better error handling is more reliable.

Options:
 -L, follow location
 --retry, number of retries
 --retry-all-errors, does not fail on ALL errors, that's why there is -f
 -f, fail fast with no output at all on server errors
 --retry-delay, make curl sleep this amount of time before each retry

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20788>
2023-01-19 23:46:44 +00:00
David Heidelberg
1abd3a3051 ci/piglit: explicitely define we want GLX tests
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20788>
2023-01-19 23:46:44 +00:00
Dylan Baker
bab3e2fbd9 meson: use the same workaround for setting 'lib' on windows
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20752>
2023-01-19 23:06:07 +00:00
Dylan Baker
7aca37fc28 meson: use [] instead of 'lib for !windows name_prefix
This is a poorly documented value that uses the default value, but
doesn't emit a warning. In the future Meson will fix this.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20752>
2023-01-19 23:06:07 +00:00
Dylan Baker
a79e6457d8 meson: use builtin support for reading version from a file
In meson 0.57 support was added for reading a version from a file to
meson natively, so we don't need this workaround anymore.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20752>
2023-01-19 23:06:07 +00:00
Dylan Baker
c31629ee78 meson: remove version checks for < 0.59
Which is now required, so these are useless

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20752>
2023-01-19 23:06:07 +00:00
Jesse Natalie
8c0531cf91 dzn: Enable multiview
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650>
2023-01-19 21:14:50 +00:00
Jesse Natalie
ebf2604562 dzn: Implement multiview queries
This is a weird way to do queries, but in multiview, each query
takes up N slots, where N is the number of views. D3D doesn't do
it that way, and only has one result, which fortunately is a valid
way to do Vulkan queries. We just need to take care to zero out
the other view results, and make sure they get "signaled" when
the cmdbuf is submitted.

Note that it is invalid in D3D to use ResolveQueryData on query
slots that have never actually been begun/ended, so we zero out
the data by copying zeroes into the buffer. This probably could
be optimized but oh well.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650>
2023-01-19 21:14:50 +00:00
Jesse Natalie
4586b308d8 dzn: Handle draws and clears for multiview rendering
For draws, when we're emulating multiview, we need to loop them
and set up the right sysval. For clears, we always need to loop.
When not emulating, we also need to set up the right view instance
mask.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650>
2023-01-19 21:14:50 +00:00
Jesse Natalie
6fca32cb38 dzn: Handle multiview pipeline creation
This handles both native and emulated pipeline creation

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650>
2023-01-19 21:14:50 +00:00
Jesse Natalie
ea9d092655 dzn: Put nir compilation options in a struct
The function signatures are getting unwieldly...

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650>
2023-01-19 21:14:50 +00:00
Jesse Natalie
3299ab04cb spirv2dxil: Claim multiview support
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650>
2023-01-19 21:14:50 +00:00
Jesse Natalie
95a90b359a spirv2dxil: Implement lowering for multiview
D3D's view instancing is an optional feature, and even when it's
supported, it only goes up to 4 views, where Vulkan requires a
minimum of 6 supported views. So, we need to have a path for handling
the cases where we can't use the native feature.

In this mode, pass the view ID as a runtime var. The caller is then
responsible for looping the draw calls and filling out the constant
buffer value correctly for each draw. When we get to the last pre-rast
stage, we'll additionally want to write out gl_Layer to select the
right RTV array slice. Lastly, for the fragment shader, if there's
any input attachments, those get loaded using the RTV slice instead
of the view ID. RTV slice input into the PS is done with a signature
entry (which must be output from the previous stage) rather than a
system value.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650>
2023-01-19 21:14:50 +00:00
Jesse Natalie
2d56b3214d spirv2dxil: Pass runtime conf struct to lower_shader_system_values
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650>
2023-01-19 21:14:50 +00:00
Jesse Natalie
58488b9d85 microsoft/compiler: Support view instancing
This adds support for D3D12-native view instancing to the compiler.
Essentially, it's just the ability to load SV_ViewID (dx.op.viewID),
set the right capability, and fill out some more PSV data. Note that
the PSV data is currently garbage. Ideally, we'd fill out a proper
input -> output and viewID -> output dependency table, but AFAIK
this is only used to enforce D3D API validation, and drivers ignore
it, so it's less critical to get it right.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650>
2023-01-19 21:14:50 +00:00
Jesse Natalie
4a440889a8 microsoft/compiler: Delete stale TODO comment
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650>
2023-01-19 21:14:50 +00:00
Jesse Natalie
e0024a844c microsoft/compiler: Subpass textures are supposed to be arrays
When doing multiview subpass rendering, they get loaded with the
view/layer index.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650>
2023-01-19 21:14:50 +00:00
Jesse Natalie
8924fe9fc3 microsoft/compiler: Delete incorrect implementation for load_layer_id
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650>
2023-01-19 21:14:50 +00:00
Mike Blumenkrantz
a6f932639a zink: simplify some dynarray concat descriptor code
TIL this exists

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20681>
2023-01-19 20:26:44 +00:00
Mike Blumenkrantz
1329fec352 zink: consolidate semaphore creation where possible
all cacheable semaphores should now be using the cache

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20681>
2023-01-19 20:26:44 +00:00
Mike Blumenkrantz
7399b2241f zink: move semaphore caching to zink_reset_batch_state()
this makes semaphores available for reuse more rapidly

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20681>
2023-01-19 20:26:44 +00:00
Mike Blumenkrantz
b8252784cf zink: add a binary semaphore cache
after being waited upon, a binary semaphore can be reused, which saves
tons of present-related ioctls when fps is high

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20681>
2023-01-19 20:26:44 +00:00
Mike Blumenkrantz
283de45fd6 zink: add a util function for creating semaphores
annoying to keep copy/pasting this around

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20681>
2023-01-19 20:26:44 +00:00
Mike Blumenkrantz
020db79340 zink: preserve present resources during async presentation
ensure that these have a lifetime great enough to be presented

fixes #7781

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20793>
2023-01-19 20:00:14 +00:00
Eric Engestrom
482e215a67 ci/bare-metal: add more timestamps to help debugging issues
Acked-by: Emma Anholt <emma@anholt.net>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20792>
2023-01-19 19:05:35 +00:00
Mike Blumenkrantz
7f0e213a57 zink: NV_compute_shader_derivatives
nothing complicated here

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12120>
2023-01-19 18:00:22 +00:00
Julia Tatz
c71287e70c zink: correct sparse bo mem_type_idx placement
VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x01 has been incidently the
correct memory type index, but isn't guaranteed to be, which is why it
hasn't caused issues yet

Fixes: f9515d93 ("zink: allocate/place memory using memoryTypeIndex directly")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20264>
2023-01-19 17:20:00 +00:00
Julia Tatz
e20e8f2243 zink: trival renames heap_idx -> memoryTypeIndex
Trival renames to correctly identify vulkan memory type indices aren't
the same as zink heaps

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20264>
2023-01-19 17:20:00 +00:00
Julia Tatz
f6d3a5755f zink: zink_heap isn't 1-to-1 with memoryTypeIndex
Clarify the relationship between zink heaps and vulkan memory type
indices, and resolve the issues from mixing the two up.

Closes: #7588, #7813
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20264>
2023-01-19 17:20:00 +00:00
Dylan Baker
75276deebc meson: Use feature option methods for xmlconfig
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
37463bedec meson: use a feature option for shared-llvm
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
c52c2ed0f8 meson: use a feature option for egl
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
afa97e7468 meson: use a feature option for zstd
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
e3f60ea4a8 meson: use a feature option for xlib-lease
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
ce490a20e7 meson: use a feature option for power8
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
2653fe11c9 meson: use a feature option for lmsensors
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
202344e9a0 meson: use a feature option for libunwind
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
3f10a89180 meson: use a feature option for valgrind
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
d00c6e0fd7 meson: use a feature option for llvm
Still not as awesome as it should be, but an improvement over what we had
before.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
c40e1bb1d0 meson: use a feature option for gbm
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
6b334a8416 meson: use a feature option for gles2
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
ca615a4f16 meson: use a feature option for gles1
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
80eb78d7a4 meson: use a feature option for shared-glapi
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
98bd7cdb8c meson: use a feature option for shader_cache
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
b200d547dc meson: use a feature option for gallium-xa
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
6f66b89ac3 meson: use a feature option for gallium-va
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
eac76e433d meson: use a feature option for gallium-vdpau
Which we can use with the require method, and use the feature itself
as the require argument to dependency call. All of this results in less
code

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
8dcc1f8311 meson: use a feature option for dri3
This removes the deprecated 'true' and 'false' options, and uses a meson
feature, requiring significantly less code.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
643af2cf83 meson: drop meson < 0.54 workaround
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
3c5e969144 meson: replace uses of ExternalProgram.path with .full_path
The former is deprecated

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
92235e0c48 meson: replace has_exe_wrapper with can_run_host_binaries
The former is a deprecated alias for the latter, which more accurately
describes what the function does.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
45632b3297 meson: bump minimum required version to meson 0.59
This gives us some utility methods for feature options, allowing even
simpler code. We can replace something like:
```meson
_opt = get_option('opt')
if _opt.auto()
  opt = host_machine.system() != 'windows'
else
  opt = opt.enabled()
endif
```
with
```meson
opt = get_option('opt') \
    .disable_auto_if(host_machine.system() != 'windows') \
    .allowed()
```

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Mike Blumenkrantz
6ff334e54a zink: handle modifier nplanes queries correctly for planar formats
this just returns the number of planes in the base format as a default, which
matches the behavior of other drivers

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20753>
2023-01-19 16:01:14 +00:00
Mike Blumenkrantz
072e29a22e zink: store drm format as internal_format for imported resources
internal_format is the "real" format of a resource, and the "real" format
of imported resources is the external-facing format, not the pipe format

this ensures the correct format is available for internal ops, such as nplanes queries

Fixes: 2e2775c11b ("zink: fix PIPE_RESOURCE_PARAM_NPLANES with format modifier")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20753>
2023-01-19 16:01:14 +00:00
Samuel Pitoiset
700bc2dae0 radv: rename ac_surf_nbc_view::max_mip to num_levels
For readability.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20761>
2023-01-19 12:46:07 +00:00
Samuel Pitoiset
8d191b2cfb radv: fix creating BC image views when the base layer is > 0
When the base array layer of the image view is > 0, addrlib computes
the offset (in HwlComputeSubResourceOffsetForSwizzlePattern) which is
then added to the base VA in RADV. But if the driver doesn't reset
the base array layer, the hw will compute incorrect addressing
(ie. base array will be added twice). This also matches AMDVLK.

This fixes a VM fault followed by a GPU hang on RDNA2 when trying
to join a multiplayer game with medium settings in Halo Infinite.

Fixes: 98ba1e0d81 ("radv: Fix mipmap views on GFX10+")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20761>
2023-01-19 12:46:07 +00:00
Samuel Pitoiset
18aaa373b7 radv: fix buffer to image copies with BC views on the graphics queue
The color surface descriptor needs to be adjusted, otherwise addressing
is wrong.

Fixes tests performed on the graphics queue from
dEQP-VK.api.copy_and_blit.*.image_to_buffer.2d_images.mip_copies_*.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7900
Fixes: 98ba1e0d81 ("radv: Fix mipmap views on GFX10+")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20761>
2023-01-19 12:46:07 +00:00
Samuel Pitoiset
aff5fe3f94 radv: fix setting MAX_MIP for BC views
MAX_MIP should always be the number of levels minus one from the hw
perspective.

This doesn't fix anything known.

Fixes: 98ba1e0d81 ("radv: Fix mipmap views on GFX10+")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20761>
2023-01-19 12:46:07 +00:00
Eric Engestrom
34e6530518 mesa/st: drop unused param
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20772>
2023-01-19 10:10:45 +00:00
Pierre-Eric Pelloux-Prayer
ddc721e15c glthread: fix glArrayElement handling
This must be marshalled synchronously or the attrib pointers' content
might change by the time we use them.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8068
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20748>
2023-01-19 09:42:34 +00:00
Pierre-Eric Pelloux-Prayer
0f5c8c3dc3 vbo: lower VBO_SAVE_BUFFER_SIZE to avoid large VRAM usage
The ideal case for performance is to have a single buffer for
all display list. The caveat is that large buffers are less
likely to be freed because they're refcounted: it only takes
1 user (diplay list) to keep it in VRAM.

This lowers VRAM usage when replaying the trace attached
of the trace attached to !6140 from 5.5 GB to about 1.8 GB.

Viewperf snx performance isn't affected.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6140
Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20748>
2023-01-19 09:42:34 +00:00
Pierre-Eric Pelloux-Prayer
491f6b138e vbo: remove bogus assert
grow_vertex_storage may call wrap_filled_vertex, which will
trigger the assert incorrectly because the new size will be
smaller than 'new_size' but it's correct because
'vertex_store->used' has been reset to 0.

Fixes: a08baaff97 ("vbo/dlist: fix indentation in vbo_save_api.c")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20748>
2023-01-19 09:42:34 +00:00
Lionel Landwerlin
ff34e96701 nir/lower_io: fix bounds checking for 64bit_bounded_global
If the offset is negative like it's the case in

dEQP-VK.robustness.robustness2.bind.notemplate.r32i.unroll.volatile.storage_buffer_dynamic.readwrite.no_fmt_qual.len_256.samples_1.1d.comp

we end up passing the bounds checking condition because it's using
signed integers.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Suggested-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Cc: mesa-stable
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: 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/20762>
2023-01-19 09:16:40 +00:00
Kenneth Graunke
7092c1218a intel/compiler: Use more symbolic source names in components_read()
Rather than hardcoding source 1, source 2, etc.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20604>
2023-01-19 08:42:22 +00:00
Kenneth Graunke
16b66ab659 intel/compiler: Drop dest checking in atomic code
NIR atomic operation intrinsics all have destinations.  This is just
copy and pasted from other generic intrinsic handling where that may
or may not be the case.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20604>
2023-01-19 08:42:22 +00:00
Kenneth Graunke
780f3e2e6b intel/compiler: Delete all the A64 atomic variants for type sizes
These are handled identically in almost all cases.  There is one place
in the legacy surface lowering that was obtaining the bitsize from the
opcode, but the LSC-based lowering uses (type_sz(inst->dst.type) * 8)
for that and works just fine.  If we just do that in the legacy lowering
too, then we don't need this plethora of opcodes.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20604>
2023-01-19 08:42:22 +00:00
Kenneth Graunke
03ddde1230 intel/compiler: Combine nir_emit_{ssbo,shared}_atomic into one helper
These are basically identical save for:
- shared has surface hardcoded to SLM rather than an SSBO index
- shared has to handle adding the 'base' const_index (SSBO have none)
- the NIR source index for data is shifted by one

It's not worth copy and pasting the entire function for this.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20604>
2023-01-19 08:42:22 +00:00
Kenneth Graunke
b84939c678 intel/compiler: Delete fs_visitor::nir_emit_{ssbo,shared}_atomic_float()
These are now basically identical to their non-float counterparts.  The
only thing that differed was the opcode checking to determine which
operands existed.  Now that we have a unified opcode enum and a helper
for the number of data operands, we can just use that.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20604>
2023-01-19 08:42:22 +00:00
Kenneth Graunke
f7b29d7924 intel/compiler: Drop redundant 32-bit expansion for shared float atomics
We already expanded data to 32-bit a few lines earlier, so this is just
redundantly doing it a second time.

Fixes: 43169dbbe5 ("intel/compiler: Support 16 bit float ops")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20604>
2023-01-19 08:42:22 +00:00
Kenneth Graunke
02129eee3a intel/compiler: Eliminate SHADER_OPCODE_UNTYPED_ATOMIC_FLOAT
The only reason for the separate opcode was because of the overlapping
BRW_AOP_* enums, making it impossible to tell whether a particular AOP
was the integer or float operation.  Now that we use the lsc_opcode
enums, we can just have the legacy lowering inspect the opcode and
select the right descriptor.  No need for a separate opcode.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20604>
2023-01-19 08:42:22 +00:00
Kenneth Graunke
284f0c9a57 intel/compiler: Add an lsc_op_num_data_values() helper
There are a number of places that need to know how many operands an LSC
atomic takes (0 for inc/dec, 1 for most things, 2 for cmpxchg).  We can
add a helper for that and eliminate some code (with more to come).

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20604>
2023-01-19 08:42:22 +00:00
Kenneth Graunke
90a2137cd5 intel/compiler: Use LSC opcode enum rather than legacy BRW_AOPs
This gets our logical atomic messages using the lsc_opcode enum rather
than the legacy BRW_AOP_* defines.  We have to translate one way or
another, and using the modern set makes sense going forward.

One advantage is that the lsc_opcode encoding has opcodes for both
integer and floating point atomics in the same enum, whereas the legacy
encoding used overlapping values (BRW_AOP_AND == 1 == BRW_AOP_FMAX),
which made it impossible to handle both sensibly in common code.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20604>
2023-01-19 08:42:22 +00:00
Kenneth Graunke
8d2dc52a14 intel/compiler: Move atomic op translation into emit_*_atomic()
There's no need to pass both the intrinsic and an opcode computed from
that same intrinsic.  Just do it in the functions themselves.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20604>
2023-01-19 08:42:22 +00:00
Lionel Landwerlin
5ff3d4a8a2 anv: fix generated indirect draw shader stats checks
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Tested-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20776>
2023-01-19 07:36:19 +00:00
Tapani Pälli
4fd9bf6e7f intel/hasvk: remove some stale comments, wa was removed
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20783>
2023-01-19 06:37:20 +00:00
Francisco Jerez
f40e17059a intel/fs/gfx12+: Drop redundant handling of SHADER_OPCODE_BROADCAST in exec pipe inference.
Commit c80c0ed943 introduced handling of
SHADER_OPCODE_BROADCAST into inferred_exec_pipe(), but it was already
being handled, drop the redundant handling.  Shouldn't lead to any
functional changes.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20543>
2023-01-19 06:14:03 +00:00
Francisco Jerez
b867d1b851 intel/eu/gfx12+: Implement decoding of 64-bit immediates.
C.f. a12533f2ce.  The corresponding
change for the decoding path was never implemented so the disassembler
was printing incorrect immediate values.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20543>
2023-01-19 06:14:03 +00:00
Francisco Jerez
f80f29dc4b intel/disasm/gfx12+: Fix print out of non-existing condmod field with 64-bit immediate.
The conditional mode field doesn't exist for instructions with a
64-bit immediate, so this would currently print garbage.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20543>
2023-01-19 06:14:03 +00:00
Francisco Jerez
f3352745ad intel/disasm/gfx12+: Use helper instead of hardcoded bit access for 64-bit immediates.
So we don't have to duplicate code to handle differences in the
encoding of 64-bit immediates across platforms.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20543>
2023-01-19 06:14:03 +00:00
Francisco Jerez
4a2e7306dd intel/fs/gfx12: Ensure that prior reads have executed before barrier with acquire semantics.
This avoids a violation of the Vulkan memory model that was leading to
intermittent failures of at least 8k test-cases of the Vulkan CTS
(within the group dEQP-VK.memory_model.*) on TGL and DG2 platforms.
In theory the issue may be reproducible on earlier platforms like IVB
and ICL, but the SYNC.ALLWR instruction is not available on those
platforms so a different (likely costlier) fix will be needed.

The issue occurs within the sequence we emit for a NIR memory barrier
with acquire semantics requiring the synchronization of multiple
caches, e.g. in pseudocode for a barrier involving the TGM and UGM
caches on DG2:

 x <- load.ugm // Atomic read sequenced-before the barrier
 y <- fence.ugm
 z <- fence.tgm
 wait(y, z)
 w <- load.tgm // Read sequenced-after the barrier

In the example we must provide the guarantee that the memory load for
x is completed before the one for w, however this ordering can be
reversed with the intervention of a concurrent thread, since the UGM
fence will block on the prior UGM load and potentially take a long
time, while the TGM fence may complete and invalidate the TGM cache
immediately, so a concurrent thread could pollute the TGM cache with
stale contents for the w location *before* the UGM load has completed,
leading to an inversion of the expected memory ordering.

v2: Apply the workaround regardless of whether the NIR barrier
    intrinsic specifies multiple storage classes or a single one,
    since an acquire barrier is required to order subsequent requests
    relative to previous atomic requests of unknown storage class not
    necessarily specified by the memory scope information of the
    intrinsic.

Cc: mesa-stable
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/20690>
2023-01-18 21:34:33 -08:00
Alyssa Rosenzweig
e664082d35 nir/lower_blend: No-op nir_color_mask if no mask
In this usual case, do a quick check to avoid generating 5 useless instructions
(mov/vec4 instructions). They'll get copypropped but that creates more work for
the optimizer and nir/lower_blend runs in a hot variant path on both Asahi and
Panfrost.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20016>
2023-01-19 04:09:17 +00:00
Alyssa Rosenzweig
1fc25c8c79 nir/lower_blend: Handle undefs in stores
nir/lower_blend asserts:

   assert(nir_intrinsic_write_mask(store) ==
          nir_component_mask(store->num_components));

For the special blend shaders used in Panfrost, this holds. But for arbitrary
shaders coming out of GLSL-to-NIR (as used with Asahi), this does not hold. In
particular, after nir_opt_undef runs, undefined components can be trimmed.
Concretely, if we have the shader:

    gl_FragColor.xyz = foo;

Then this becomes in NIR

   gl_FragColor = vec4(foo.xyz, undef);

and then opt_undef will give the store_deref a wrmask of xyz but 4 components.
Then lower_blend asserts out.

Found in a gfxbench shader on asahi.

Closes: #6982
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20016>
2023-01-19 04:09:17 +00:00
Alyssa Rosenzweig
8b83210ab3 nir/lower_blend: Don't do logic ops on pure float
Per the spec.

Fixes arb_color_buffer_float-render on both Panfrost and Asahi (before/after
reproduced on Mali-T860 and AGX G13 respectively). Without that patch, that test
fails the assertion:

arb_color_buffer_float-render: ../src/compiler/nir/nir_lower_blend.c:259: nir_blend_logicop: Assertion `util_format_is_pure_integer(format)' failed.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20016>
2023-01-19 04:09:17 +00:00
Alyssa Rosenzweig
dbd0615e7a nir/lower_blend: Avoid useless iand with logic ops
The upper bits start correctly, there's no need to clear them as long as we keep
them zero'ed by using ixor with a valid bit mask instead of inot.

Makes the code generated for logic op slightly less ridiculous. I'm joking. It's
still ridiculous but I'm not in the mood to fix up the Midgard compiler and it's
just a little ALU for a feature almost nothing uses.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20016>
2023-01-19 04:09:17 +00:00
Alyssa Rosenzweig
ee127f03e4 nir/lower_blend: Fix SNORM logic ops
We need to sign extend. Incidentally this means the iand above is useless for
SNORM.

Fixes arb_color_buffer_float-render with GL_RGBA8_SNORM.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20016>
2023-01-19 04:09:17 +00:00
Alyssa Rosenzweig
f9839e7e1b nir/lower_blend: Clamp blend factors
Particularly constant colours, but also (more obscurely) SNORM.

Fixes arb_color_buffer_float-render with SNORM framebuffers. Issue affects both
Asahi and Panfrost (the latter after we start advertising EXT_render_snorm).

v2: Check the blend factor to avoid unnecessary clamps. This avoids regressing
blend shader code quality on Panfrost.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com> [v1]
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20016>
2023-01-19 04:09:17 +00:00
Alyssa Rosenzweig
fca457790e nir/lower_blend: Fix alpha=1 for RGBX format
In this case we have 4 components but the value of the fourth component
is undefined. Apply the fixup we already have.

Fixes
dEQP-GLES3.functional.draw_buffers_indexed.random.max_implementation_draw_buffers.0
on Asahi. That test blend with DST_ALPHA with its RGB565 attachment,
which is fine if RGB565 is preserved, but Asahi is demoting that
format to RGBX8 which means -- after lowering the tilebuffer access --
we blend with an ssa_undef.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20016>
2023-01-19 04:09:17 +00:00
Caleb Cornett
97061dd7ee d3d12: Add support for Xbox GDK.
The big items in this patch:
- New screen file, to support the Xbox "windowing" system
- Lots of small macros/changes to support the Xbox D3D12 API without messing with the Win32 path too much
- A few changes to avoid requiring COM interfaces (the big one was QueryInterface which is unsupported)

Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>
Co-authored-by: David Jacewicz <david.jacewicz@protonmail.com>
Co-authored-by: tieuchanlong <tieuchanlong@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19022>
2023-01-19 03:25:55 +00:00
Caleb Cornett
882a78b8ad wgl: Add support for Xbox GDK.
This patch is comprised of three main changes:
- Add a "shim" for GDI, since Xbox doesn't expose this library
- New framebuffer file, to support the Xbox "windowing" system
- Implement a custom WndProc hook for Xbox, since SetWindowsHookEx isn't supported either

Other than that, it's similar to the previous Xbox commits which mostly disable Win32-specific logic.

Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>
Co-authored-by: David Jacewicz <david.jacewicz@protonmail.com>
Co-authored-by: tieuchanlong <tieuchanlong@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19022>
2023-01-19 03:25:55 +00:00
Caleb Cornett
75415e58e3 dxil_validator: Add support for Xbox GDK.
In addition to the DLL names being different, we don't have to do the versioning work since we don't have to fuss with known bad versions (for example).

Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>
Co-authored-by: David Jacewicz <david.jacewicz@protonmail.com>
Co-authored-by: tieuchanlong <tieuchanlong@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19022>
2023-01-19 03:25:55 +00:00
Caleb Cornett
7588164717 util: Add #ifdefs for Xbox GDK support.
For the most part this just disables debug/console code, with the minor exception of u_memstream_open.

Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>
Co-authored-by: David Jacewicz <david.jacewicz@protonmail.com>
Co-authored-by: tieuchanlong <tieuchanlong@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19022>
2023-01-19 03:25:55 +00:00
Caleb Cornett
d575fe8881 futex: Change INT_MAX to INT32_MAX.
Some platforms (i.e. Xbox) don't have INT_MAX, so use the stdint constant instead.

Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>
Co-authored-by: David Jacewicz <david.jacewicz@protonmail.com>
Co-authored-by: tieuchanlong <tieuchanlong@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19022>
2023-01-19 03:25:55 +00:00
Paulo Zanoni
f9477770d8 anv: use vk_realloc for the anv_execbuf arrays
Three reasons for that:

0. The operation we're doing here is actually a reallocation.

1. The newer code is, IMHO, easier to read.

2. Realloc has this property where sometimes, when possible, it will
   expand your array without moving it somewhere else, so it doesn't
   need to copy the memory contents, returning the original pointer
   back to you. I did some analysis and while that case is not common,
   it does happen sometimes in real world applications (I could see it
   happening in Shootergame and Aztec Ruins, but not Dota 2), so we're
   able to save a few CPU cycles.

v2: Rebase.

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
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/20703>
2023-01-19 02:21:09 +00:00
Paulo Zanoni
6d4fc0e5bf anv: rename anv_execbuf->array_length to bo_array_length
Because this is counting the array length of the things related to the
BOs, just like syncobj_array_length is counting the array length of
the things related to syncobjs.

v2: Rebase.

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
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/20703>
2023-01-19 02:21:09 +00:00
Paulo Zanoni
e642cafdae anv: run buf_finish() if add_bo() fails during execute_simple_batch()
This is the only code path where we don't run anv_execbuf_finish() in
case anv_execbuf_add_bo() fails. While there is not a bug in the
current tree, I recently made an (uncommitted) modification that
started leaking memory and made me realize the lack of cleanup here.
If we had anv_execbuf_finish() being called upon error like we're
going to have after this patch my modification wouldn't have caused
the memory leak.

I think it's much safer and future-proof if we're able to operate
under the assumption that whatever is allocated and set to anv_execbuf
will be dealt with upon failure of anything else related to it, so
functions that fail should only be required to free pointers not yet
assigned to anv_execbuf.

The dEQP-VK 'alloc_callback_fail' tests should exercise this code
path. The one I was specifically using here is:
  dEQP-VK.api.object_management.alloc_callback_fail.device_group

v2: Rebase.

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
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/20703>
2023-01-19 02:21:09 +00:00
Paulo Zanoni
3d37950fd9 anv: check the return value of anv_execbuf_add_bo_bitset()
Because anv_execbuf_add_bo_bitset() calls anv_execbuf_add_bo(), which
can fail if its memory allocations fail.

I have seen dEQP tests exercising memory allocation failures during
anv_execbuf_add_bo(), but I don't think the path coming from
add_bo_biset() was specifically exercised. Anyway, add the error check
just in case.

v2: Rebase.

Cc: mesa-stable
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
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/20703>
2023-01-19 02:21:09 +00:00
Paulo Zanoni
ad6a036a68 anv: don't leave undefined values in exec->syncobj_values
In anv_execbuf_add_syncobj(), we try to not create or use
exec->syncobj_values if we don't need to. But when we figure we're
going to need it (i.e., when timeline_value is not zero), then we
create exec->syncobj_values with vk_zalloc, which means every previous
value is set to zero, as it should be. This is all correct.

The problem starts when we add a 16th element. In this case we double
exec->syncobj_array_length and realloc the buffer by using vk_alloc
and copying the old array to the new one. After that, we write the
timeline_value to the array only if it's not zero, and that's the
problem: since we just used vkalloc and memcpy, we don't have any
guarantees that the new array will be zero after the 16th element, and
if timeline_value is zero we write nothing to that position.

Once we start using exec->syncobj_values we have to commit to using
it, so the "if (timeline_value)" check near the end of the function
has to be changed to "if (exec->syncobj_values)", so we actually set
elements after the 16th to zero when they need to be zero.  Another
approach to fix this would be to memset the new elements once we
double syncobj_array_length.

In practice, I couldn't find any application or deqp test that used
more than 3 elements in exec->syncobj_array_length, and we need more
than 16 elements in order to be able to reproduce the bug, so I'm not
aware of any real-world bug that goes away with this patch. This issue
was found while reading code.

If we craft a little Vulkan program that submits a ton of timeline and
binary semaphores on vkQueueSubmit, then waits for them, we get the
following error without this patch:

MESA: error: ../../src/intel/vulkan/anv_batch_chain.c:1910: execbuf2 failed: Invalid argument (VK_ERROR_DEVICE_LOST)

v2: Rebase.

Cc: mesa-stable
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
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/20703>
2023-01-19 02:21:09 +00:00
Thomas H.P. Andersen
fd3e8047d2 docs/panvk: VK_KHR_descriptor_update_template
Implemented in !14780

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18642>
2023-01-19 02:15:22 +00:00
Maíra Canal
86c9bdcd9a v3dv: remove unused clamp_to_transparent_black_border property
Commit e07c5467 ("v3dv/format: use XYZ1 swizzle for three-component formats")
removes the only code that handled the clamp_to_transparent_black_border
variable. Therefore, the variable can be deleted, as it is not currently
being used.

Fixes: e07c5467 ("v3dv/format: use XYZ1 swizzle for three-component formats")
Signed-off-by: Maíra Canal <mcanal@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/20746>
2023-01-19 02:02:16 +00:00
Emma Anholt
11669c96bc Revert "nouveau/ci: temporary disable gk20a-gles"
This reverts commit 8a1a3a31da.  The farm
should be back up, and I swear nginx startup is fixed for real this time.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20775>
2023-01-19 01:16:49 +00:00
David Heidelberg
f410a6d011 ci/intel: fully utilize asus-cx9400-volteer
We have 15 machines:
 * 12 for anv-tgl-vk
 * 1 for intel-tgl-skqp
 * 2 for zink-anv-tgl and zink-anv-tgl-traces

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20754>
2023-01-19 00:44:09 +00:00
David Heidelberg
fb876f64f1 ci/anv: add multiple fails uncovered by change of sharding
Another fail discovered by changing number of parallel jobs.

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

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20754>
2023-01-19 00:44:09 +00:00
Joshua Peisach
257bb11332 gallum/asahi: fix memory leak in agx_resource_from_handle
Missing FREE(rsc)


Apply 1 suggestion(s) to 1 file(s)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20760>
2023-01-19 00:30:04 +00:00
Lionel Landwerlin
b82d9b1a3d nir/divergence: add missing RT intrinsinc handling
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20763>
2023-01-18 22:32:43 +00:00
Alyssa Rosenzweig
7e68cf91d7 mesa: Set info.separate_shader for ARB programs
ARB programs are logically separate, and Mesa will happily mix and match them.
We need to alert backends of this fact, by setting nir->info.separate_shader.
Otherwise, backends may link shaders invalidly.

Fixes fp-abs-01 on Bifrost. (We don't use separate_shader for anything on
Valhall, so the issue doesn't appear there.)

Compare 151aa19c21 ("ttn: Set nir->info.separate_shader"), which fixed a
similar issue with TGSI.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20688>
2023-01-18 21:06:03 +00:00
Emma Anholt
696069bc0d ci: Add some new folks to the restricted-traces access list.
They should now get pre-merge gated on the restricted traces passing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20771>
2023-01-18 20:34:17 +00:00
Pavel Ondračka
9db7c1a509 r300: remove backend negative addressing emulation
This is now handled in ntt.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20672>
2023-01-18 20:02:37 +00:00
Pavel Ondračka
7bec63c024 r300: set ubo_vec4_max ntt option properly
Besides making sure we don't overflow our reg index, this also prevents
constant folding resulting in negative relative offset in nir_opt_offsets.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20672>
2023-01-18 20:02:37 +00:00
Pavel Ondračka
cd18d541de ntt: pass ubo_vec4_max nir_opt_offsets flag through ntt options
This will be used by the r300 driver in the next commit.

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/20672>
2023-01-18 20:02:37 +00:00
Isaac Bosompem
4c0a54fc36 tool/pps: Fix 32-bit build issue with format string
Fixes a 32-bit build issue with Perfetto enabled.
Move the printf format specifier to use PRIx64 which
will be consistent regardless of the build type.

Signed-Off By: Isaac Bosompem <mrisaacb@google.com>

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20732>
2023-01-18 19:27:41 +00:00
Caleb Cornett
a32d6071e1 d3d12: Lower minimum supported Shader Model to 6.0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20769>
2023-01-18 18:06:37 +00:00
Patrick Lerda
5e3ca1f97f lima: fix memory leak related to u_transfer_helper_create()
Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7fb6224340 in calloc (/usr/lib64/libasan.so.6.0.0+0xa4340)
    #1 0x7facfdd5a0 in u_transfer_helper_create ../src/gallium/auxiliary/util/u_transfer_helper.c:580
    #2 0x7facf2e09c in lima_resource_screen_init ../src/gallium/drivers/lima/lima_resource.c:935
    #3 0x7facf23af4 in lima_screen_create ../src/gallium/drivers/lima/lima_screen.c:746
    #4 0x7fac83ed30 in kmsro_drm_screen_create ../src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c:124

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20764>
2023-01-18 17:50:40 +00:00
Luigi Santivetti
926ba335fd pvr: add support for tile buffer output clear
Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20742>
2023-01-18 15:10:21 +00:00
Luigi Santivetti
96784f6cc1 pvr: fix uses_tile_buffers in clear color attachment
Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20742>
2023-01-18 15:10:21 +00:00
Pierre-Eric Pelloux-Prayer
027dd2c246 radeonsi/sqtt: implement offset workaround for gfx11
Based on PAL and Samuel's code from !20338.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20529>
2023-01-18 13:36:50 +00:00
Pierre-Eric Pelloux-Prayer
215babd3ca radeonsi/sqtt: update registers for gfx11
Based on registers delta and PAL.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20529>
2023-01-18 13:36:50 +00:00
Pierre-Eric Pelloux-Prayer
a3dc8b870d radeonsi/sqtt: disable SE1+ on GFX11
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20529>
2023-01-18 13:36:50 +00:00
Pierre-Eric Pelloux-Prayer
2e3dc3838e radeonsi/sqtt: don't read results for disabled SEs
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20529>
2023-01-18 13:36:50 +00:00
Samuel Pitoiset
f10f2c9bbb ac: add TC_OP_ATOMIC_SUB_32
This will be used by SQTT to implement a workaround on GFX11

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@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/20529>
2023-01-18 13:36:50 +00:00
Alejandro Piñeiro
50bb7745ca v3dv: enable shaderStorageImageReadWithoutFormat
Note that as we are enabling the feature, we need to set the
VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT_KHR for any format
that supports STORAGE_IMAGE_BIT, from spec:

   "An implementation that supports
   VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT for any format from the given
   list of formats and supports shaderStorageImageReadWithoutFormat
   must support VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT
   for that same format if Vulkan 1.3 or the
   VK_KHR_format_feature_flags2 extension is supported."

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20744>
2023-01-18 13:09:57 +00:00
Alejandro Piñeiro
b56be4c37e broadcom/compiler: treat PIPE_FORMAT_NONE as 32-bit formats for output type
Needed to support Vulkan feature shaderStorageImageReadWithoutFormat.

With that enabled we could receive a NONE format on a load image. For
those we treat them as 32-bit formats, that would mean that the
lowering would not need to do any format-specific unpacking.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20744>
2023-01-18 13:09:57 +00:00
Alejandro Piñeiro
41a081380a broadcom/compiler: v3d_nir_lower_txf_ms doesn't need v3d_compile
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20744>
2023-01-18 13:09:57 +00:00
Kenneth Graunke
a6c6a4ad04 intel/blorp: Lower base_workgroup_id to zero
We don't use a base workgroup ID for BLOCS.  It needs to be lowered, or
else we'll assert fail when compiling the compute shader.

(Note for stable: this patch doesn't fix a bug in 4abdecce22
specifically, but rather is a missing patch that needed to go along with
the rest of MR 20068, on whichever branches it exists on.)

Fixes: 4abdecce22 ("iris: Lower load_base_workgroup_id to zero")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20750>
2023-01-18 12:21:03 +00:00
Amber
a6ac4cbae8 freedreno: add support for markers.
Signed-off-by: amber@igalia.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20727>
2023-01-18 10:53:36 +00:00
Amber
ab9dd18b68 util/u_trace: pass utrace context to marker functions.
This is needed later by freedreno in order to get
more device information in trace functions.

Signed-off-by: amber@igalia.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20727>
2023-01-18 10:53:36 +00:00
Konstantin Seurer
c7fc30421c radv: Advertise rt pipelines for Control (DX12)
The game has been working on radv since basically forever.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20729>
2023-01-18 09:58:24 +00:00
Erik Faye-Lund
0429f11dfb zink: remove depth_clip_control_missing workaround
The ANV bug this was meant to represent has been long fixed, and the
workaround has just been a proxy for EXT_depth_clip_control for a while
now.

Let's simplify things a bit, by removing this flag.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20740>
2023-01-18 09:31:06 +00:00
Erik Faye-Lund
c12fed1804 zink: fix depth-clip disable cap
We use EXT_depth_clip_enable for this, not EXT_depth_clip_control, which
is what depth_clip_control_missing is a proxy for.

Fixes: 721f33cd0f ("zink: fix return for PIPE_CAP_DEPTH_CLIP_DISABLE")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20740>
2023-01-18 09:31:06 +00:00
Erik Faye-Lund
09a87d2171 zink: whitespace fixup
This just cleans up some indentation, no functional changes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20745>
2023-01-18 09:11:54 +00:00
Samuel Pitoiset
84241b1f75 ac/nir: clear unused components before storing XFB outputs to LDS
Shader variables don't always exactly match intrinsics and they might
contain unused slots.

Fixes a bunch of regressions with RADV_PERFTEST=ngg_streamout on RDNA2,
and also fixes RDNA3 NGG streamout.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8099
Fixes: cd22bf90e7 ("ac/nir/ngg: refine nogs outputs handling")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20735>
2023-01-18 07:38:44 +00:00
Mike Blumenkrantz
e39bf3e6aa zink: skip implicit feedback loop layout changes if feedback loop not present
if a resource is bound as both a framebuffer attachment and a sampler but
isn't actually used as a sampler, it's just a framebuffer attachment, and it
should retain its layout as a framebuffer attachment without any barriers

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20674>
2023-01-18 07:20:58 +00:00
Mike Blumenkrantz
9ba0657903 zink: make implicit feedback loop application stricter
in many cases, a texture may be bound as both a framebuffer attachment
and a samplerview without the latter actually being used by a shader

this avoids unnecessary feedback loop tagging, which should improve
perf and avoid spurious warning messages on drivers that don't support
the feedback loop ext

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20674>
2023-01-18 07:20:58 +00:00
Mike Blumenkrantz
230a554719 zink: outdent code in add_implicit_color_feedback_loop()
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20674>
2023-01-18 07:20:58 +00:00
Mike Blumenkrantz
487e5cc781 zink: set textures_used in analyze_io
this is otherwise not usable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20674>
2023-01-18 07:20:58 +00:00
Mike Blumenkrantz
9a9c17cd49 zink: break out implicit feedback loop detection into separate function
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20674>
2023-01-18 07:20:58 +00:00
Rob Clark
6f91a5ab07 freedreno: Restore GL_VENDOR string
We cannot change this, as it has already been communicated to app
partners.  Also this breaks chrome's GPU quirk matching (which in some
cases is non-gpu-related, but when all you have is a hammer, everything
looks like a nail).

Fixes: 9c1fbc076a ("Return 'Mesa' for GL_VENDOR for community drivers")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20757>
2023-01-18 07:00:48 +00:00
Dave Airlie
589d4ff0cb vulkan/format: add a 10-bit video format
This adds support to the generic vulkan format code for
VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16
which is used for 10-bit H265.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
(Updated version acked by Lynne on irc)

v2: disable these for freedreno

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20389>
2023-01-18 06:36:27 +00:00
Dave Airlie
41dbeca4c2 vulkan/video: add common h264/h265 parameter set management code.
The video session and video session parameters objects can have a common
base class the drivers can inherit from if needed.

This creates code to parse the h264/h265 parameter sets into common
structs.

v2: add h265 VPS, add a macro for FIND/ADD generations, changes the API
to make generation easier.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20389>
2023-01-18 06:36:27 +00:00
Rob Clark
0c30e0fa00 freedreno/a6xx: Expose SSBO/image for all shader stages
Now that we've removed the limitation of a single bindful IBO state, we
can expose IBO support on all shader stages.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20687>
2023-01-18 06:10:10 +00:00
Rob Clark
a93d3f1498 freedreno/a6xx: Move tex state building
Now that it is only called from fd6_texture, move it there where it more
rightly belongs.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20687>
2023-01-18 06:10:10 +00:00
Rob Clark
a16c99a9a5 freedreno/a6xx: Move compute to tex state group
This lets compute shaders hit the shader state cache as well, and
unifies 3d and cs state emit allowing for more code sharing.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20687>
2023-01-18 06:10:10 +00:00
Rob Clark
b17ad0657f freedreno/a6xx: Remove tex fb_read state
Now that fb_read is using a bindless descriptor slot, we can remove the
dependency of the TEX state on the PROG state.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20687>
2023-01-18 06:10:10 +00:00
Rob Clark
f6b6400254 freedreno/a6xx: Removing munging of tex state for IBO
Now that we use bindless descriptors for SSBO/image, lowering to isam
means we can use the existing descriptor.  Avoiding the need to smash in
extra bindful sampler state.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20687>
2023-01-18 06:10:10 +00:00
Rob Clark
549a8d206a freedreno/a6xx: Remove bindfull IBO state
Now that it is unused.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20687>
2023-01-18 06:10:10 +00:00
Rob Clark
ce1e73f441 freedreno/a6xx: Switch over to bindless IBO
This allows support for SSBOs/images in all shader stages.  And also,
unlike the bindful IBO state, does not introduce a dependency on the
program state.  With bindless descriptors, SSBO and image fetch lowered
to isam can re-use the same descriptor.  This will let us remove the
TEX state dependency on PROG state (in a following cleanup commit).

Note, this does not yet switch the pipe caps to reflect that we can
support SSBOs/images in other shader stages.. because ir3 still tells us
nibo>0 even though we are using bindless and that triggers an assert in
the build_ibo() path.  Probably we want ir3 to be more clever.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20687>
2023-01-18 06:10:10 +00:00
Rob Clark
e51975142c freedreno/a6xx: Add bindless state
This will be used when we switch over to lowering image/SSBO to
bindless.

Note that it also starts using CP_SET_DRAW_STATE in the compute path.
Subsequent cleanup will switch texture and eventually other state over
as well (which will make more sense when we get more clever than
emitting all state for every compute grid, but for now simplifies
re-using the same code between 3d and compute).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20687>
2023-01-18 06:10:10 +00:00
Rob Clark
101700b150 freedreno/a6xx: Pre-bake IBO descriptor sets
Pre-bake IBO descriptor sets at the time that images/SSBOs are bound,
and re-use the pre-baked descriptors at draw time when we emit state.

This starts putting in place the state tracking we'll use when switching
over to bindless IBO state, without yet changing the shaders (lowering
to bindless) or changing the actual state emitted (other than switching
to use the storage descriptor for image reads via isam, like tu does).

Note that this even pre-bakes the iova into the descriptor, rather than
relying on OUT_RELOC() to do the bo tracking, so we need to manually
attach the bo to the ring.  But we already require FD_BO_NO_HARDPIN for
a6xx.  This makes the state emit a straight memcpy, and will simplify
things when it comes to generating the bindless descriptor set (which
due to the desc_size field in the low bits of the BINDLESS_BASE regs
would be awkward to construct as a ring rather than a bo).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20687>
2023-01-18 06:10:10 +00:00
Rob Clark
a45d111c18 freedreno/ir3: Add descriptor set lowering
Add support to lower IBO (image/SSBO) and fb-read to use bindless
descriptors.  This will be used by a6xx to avoid having to merge image
and SSBO state into a single compact IBO descriptor, and also simplify
enabling image and SSBO support for additional shader stages (since each
stage can use it's own descriptor set).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20687>
2023-01-18 06:10:10 +00:00
Rob Clark
066ff5c759 freedreno: Track image/SSBO usage for all stages
Once a6xx enables image/SSBO for all shader stages, we have to care
about more than just frag shader in the 3d path.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20687>
2023-01-18 06:10:10 +00:00
Rob Clark
165de87f8e freedreno/ir3: Let driver specify fb-read descriptor
Let the driver control where the shader should look for fb-read
descriptor.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20687>
2023-01-18 06:10:10 +00:00
Rob Clark
4982adb4cf freedreno/ir3: Stop copying options
Just copy the entire ir3_compiler_options into ir3_compiler, to make it
easier to add new options.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20687>
2023-01-18 06:10:10 +00:00
Qiang Yu
db2497f205 radeonsi: update nir xfb info after medium io lowering
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/19489>
2023-01-18 05:30:14 +00:00
Qiang Yu
49cfbe1fed nir/xfb_info: nir_gather_xfb_info_from_intrinsics update nir xfb_info
Use this function to update nir_shader->xfb_info.

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/19489>
2023-01-18 05:30:14 +00:00
Qiang Yu
b6c172f26c gallium/aux: remove nir_helpers
Not used by anyone.

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/19489>
2023-01-18 05:30:14 +00:00
Qiang Yu
1590817977 radeonsi: move gfx10_ngg_export_vertex to si_shader_llvm.c
It's now also used by non-ngg pipeline and older GPUs.

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/19489>
2023-01-18 05:30:14 +00:00
Qiang Yu
1475339543 radeonsi: replace llvm legacy gs code with nir lowering
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/19489>
2023-01-18 05:30:14 +00:00
Qiang Yu
6219374c4e radeonsi: remove llvm gs copy shader generate
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/19489>
2023-01-18 05:30:14 +00:00
Qiang Yu
e007c7fa6f radeonsi: replace llvm gs copy shader generation with nir
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/19489>
2023-01-18 05:30:14 +00:00
Qiang Yu
246630ac98 radeonsi: build legacy gs output info when shader compile
To be used by both legacy gs lowering and gs copy shader
generation.

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/19489>
2023-01-18 05:30:14 +00:00
Qiang Yu
2b0566f672 radeonsi: add nir implementation of gs copy shader generation
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/19489>
2023-01-18 05:30:14 +00:00
Qiang Yu
89aa75f81c radeonsi: use ac_nir_lower_legacy_vs to replace si_llvm_vs_build_end
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/19489>
2023-01-18 05:30:13 +00:00
Qiang Yu
acde71c015 radeonsi: use nir_print_xfb_info to replace si_dump_streamout
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/19489>
2023-01-18 05:30:13 +00:00
Qiang Yu
def3f700bc radeonsi: lower nir streamout intrinsics in abi
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/19489>
2023-01-18 05:30:13 +00:00
Qiang Yu
743fbc4bb0 radeonsi: implement nir_load_ring_gs2vs_offset_amd
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/19489>
2023-01-18 05:30:13 +00:00
Qiang Yu
16cf743f2d radeonsi: implement nir_load_ring_gsvs_amd
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/19489>
2023-01-18 05:30:13 +00:00
Emma Anholt
8aff228127 ci: Enable building the testing drivers with perfetto.
We've talked about being able to capture perfetto traces from CI jobs for
a while, and this would be a step toward that.  Mostly it's that we
occasionally break the perfetto build, so let's make sure we don't do
that.

Acked-by: Rob Clark <robdclark@chromium.org>
Acked-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20660>
2023-01-18 05:04:46 +00:00
Emma Anholt
64455dc32b freedreno/pps: Fix a signed/unsigned complaint.
../src/freedreno/ds/fd_pps_driver.cc:656:44: error: comparison of integer expressions of different signedness: '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and 'const unsigned int' [-Werror=sign-compare]
  656 |             assert(d->assigned_counters[i] < g->num_counters);
cc1plus: all warnings being treated as errors

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20660>
2023-01-18 05:04:46 +00:00
Emma Anholt
302858c48c ci/freedreno: Add glx-swap-event-async as a flake.
It's only happened a few times in the last year (used to be more popular),
but it just took out a merge.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20660>
2023-01-18 05:04:46 +00:00
Emma Anholt
327f736627 freedreno: Skip CPU/GPU timestamp sync when not supported.
Fixes immediate segfaults in perfetto-enabled builds on pre-a6xx.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20660>
2023-01-18 05:04:46 +00:00
Emma Anholt
79bbfb3168 ci/zink: Add more blit conversion xfails for a618.
Popular cases in this group recently:

      1 dEQP-GLES3.functional.fbo.blit.conversion.r16ui_to_r16ui
      1 dEQP-GLES3.functional.fbo.blit.conversion.r16ui_to_rgb10_a2ui
      1 dEQP-GLES3.functional.fbo.blit.conversion.rgb5_a1_to_rgb5_a1
      3 dEQP-GLES3.functional.fbo.blit.conversion.rgba4_to_r32f
      4 dEQP-GLES3.functional.fbo.blit.conversion.rgb565_to_rgba8
      5 dEQP-GLES3.functional.fbo.blit.conversion.rgba4_to_rg16f

There's pretty clearly something common with blitting from 16-bit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20759>
2023-01-18 04:43:59 +00:00
Emma Anholt
c4c94e8aed ci/iris: Generalize the 8888_pbuffer EGL known flakes and share with GLK.
It seems to be this whole group of tests, on both boards that run EGL
tests by default (aml-y is manual-only).  Make them a regex until someone
comes up with a fix.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20759>
2023-01-18 04:43:59 +00:00
Emma Anholt
6dc90009a5 ci/iris: Add known flakes for skqp.
We've had a lot more jobs run since I landed the CI, and these seem to be
the common flakes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20759>
2023-01-18 04:43:59 +00:00
Emma Anholt
c34b539e17 ci/llvmpipe: Drop dEQP-EGL.functional.sharing.*.link.7 flakes.
These appear to have been resolved by !20458 -- went from typically
multiple per day to none since then.  The link.19 fails to seem to still
happen, though.

Closes: #7759
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20759>
2023-01-18 04:43:59 +00:00
Jason Ekstrand
d292cb82b8 gallium,util: Pull u_indices and u_primconvert back into gallium
This was moved in !13741 but doing so created a link-time dependency
between util and gallium which causes problems for Vulkan drivers.
Meanwhile, having mesa/main depend on gallium is fine now that we don't
have any classic drivers.  It's a bit circular but should be harmless.

Fixes: 97ba2f2fd4 ("move util/indices to core util")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8098
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20734>
2023-01-18 03:53:30 +00:00
Ikshwaku Chauhan
fe3b467eb9 radeonsi: Fix distortion for yuv422 format for GFX10.
For yuv422 format camera show blur output for GFX10.

Signed-off-by: Ikshwaku Chauhan <ikshwaku.chauhan@amd.com>
Reviewed-by: Marek Olšák marek.olsak@amd.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20610>
2023-01-18 01:44:15 +00:00
Corentin Noël
5348704820 ci/venus: Remove failure now passing
It has been fixed either in the CTS or in llvmpipe itself but this now passes when running
in CI.

We haven't seen it in CI yet as we are only running a subset of the Vulkan CTS.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20743>
2023-01-17 23:56:45 +00:00
Mike Blumenkrantz
dc8c9d2056 zink: prune old swapchains on present
pruning old swapchains is challenging because there's no way to definitively
know when to destroy them without VK_EXT_swapchain_maintenance1 which isn't
supported yet

initially, I handled it by only pruning on shutdown and whenever a new swapchain
was created since those are both safe points, but this leads to scenarios where
a dead swapchain can exist for the entire lifetime of an application
if the swapinterval is changed

to avoid such ballooning, check whether the current swapchain has ever presented
on each present queue and then prune based on this

fixes #7529

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20588>
2023-01-17 23:21:58 +00:00
Emma Anholt
6b0db6bf8b dri2: Fix exposing robustness with swkms.
In the original change I noticed that missing robustness on swkms seemed
to be an oversight, since it was enabled on sw-non-kms, so I exposed the
ext based on the underlying pipe query.  However it turns out that there
is a dri_screen flag for allowing robust contexts that exists to do error
checking for GLX, which was under an !swkms check.  So we would expose the
ext, but then throw an error if you tried to create one.

Fixes: e6285ea55f ("egl: Replace the robustness DRI2 ext check with a pipe cap query.")
Closes: #8066
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20679>
2023-01-17 21:19:18 +00:00
Jesse Natalie
ca8c8f2fc1 dzn: Remove cmdbuf query 'wait' list
From the Vulkan spec, the WAIT flag on vkCmdCopyQueryPoolResults only
serves to increase the first synchronization scope to include query end
commands, but either way, the synchronization scope only includes
commands that occur earlier in submission order. In other words, we
don't need to enforce queue ordering, a pipeline barrier is all that's
needed.

Fixes deadlocks in the timestamp.misc_tests.two_cmd_buffers_primary test.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20617>
2023-01-17 20:17:42 +00:00
Jesse Natalie
261102bd9c dzn: Fix format support checks for storage/uniform texel buffers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20617>
2023-01-17 20:17:42 +00:00
Jesse Natalie
0069ac9e6e dzn: Disable depth when the rasterizer is disabled due to no position output
D3D considers the rasterizer enabled if there's a pixel shader *or* if
depth is enabled, since you can do depth-only rendering. After parsing
shaders, if we find that there was supposed to be a pixel shader, but
we removed it because there was no output position, disable depth too.

Also, store this info in the cache, since we might not even load the
nir shaders if we'd seen this pipeline before.

Fixes dEQP-VK.synchronization.internally_synchronized_objects.pipeline_cache_graphics

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20617>
2023-01-17 20:17:42 +00:00
Jesse Natalie
682605a99b dzn: Add a zeroed zsa state when depth or raster is disabled
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20617>
2023-01-17 20:17:42 +00:00
Jesse Natalie
25d460a818 dzn: Always align cached pipeline header size to input element align
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20617>
2023-01-17 20:17:42 +00:00
Jesse Natalie
4565490b71 dzn: Support unnormalized coordinate samplers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20617>
2023-01-17 20:17:42 +00:00
Jesse Natalie
552ab9c2f7 dzn: Support root signature 1.2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20617>
2023-01-17 20:17:42 +00:00
Jesse Natalie
1e0adac84a dzn: Define a symbol that was present in older D3D headers
D3D12_BARRIER_SYNC_INPUT_ASSEMBLER was renamed to D3D12_BARRIER_SYNC_INDEX_INPUT,
so conditionally define the old name based on the version of the headers that are
being used.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20617>
2023-01-17 20:17:42 +00:00
EmperorPenguin18
3eb33ec9e9 v3d: expose more drm formats with SAND128 modifier
Adds four more PIPE_FORMATs that expose BROADCOM_SAND128. This allows mpv
to do hardware decoding on the Raspberry Pi 4.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7944
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20510>
2023-01-17 19:57:28 +00:00
Rob Clark
aac66fe039 freedreno/a6xx: Rework barrier handling
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20575>
2023-01-17 19:32:13 +00:00
Rob Clark
63e889516d freedreno: Don't re-install a flushed batch
The compute path does this save/restore dance with the current batch, so
various things called to emit state can assume ctx->batch is the current
thing.  But during resource tracking, which could have flushed what was
previously the current batch.  Fixes a problem that surfaces in the next
patch when we stop just flushing batches for all the barriers.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20575>
2023-01-17 19:32:13 +00:00
Rob Clark
aa9b62cad3 freedreno/a6xx: Workaround for no pos/psize
The hw seems unhappy if there are zero outputs from the last geometry
stage.  So add a dummy varying as a workaround.  Turnip got a similar
workaround in commit d6d75fcd91 ("tu: Fix hangs for DS with no output")

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20575>
2023-01-17 19:32:13 +00:00
Rob Clark
e41d19a711 freedreno: Fix tracking of enabled SSBOs
Clearing all of the modified bits an relying on OR'ing the needed bits
back in the loop below doesn't quite work out, Because of early continue
if the SSBO has not changed.

Fixes: 0ed053f03d ("freedreno: simplify fd_set_shader_buffers(..)")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20575>
2023-01-17 19:32:13 +00:00
Rob Clark
ca2011d11c freedreno/drm: Remove assert
We can hit this scenario if there is a GPU hang before the userspace
fence writeback happens.  Since we have asserts enabled in CI, just
remove this assert.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20575>
2023-01-17 19:32:13 +00:00
Gert Wollny
adee0e7e53 r600/sfn: Do a bit of cleanup with the secondary read port validation
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20739>
2023-01-17 19:19:01 +00:00
Gert Wollny
ca5bbff558 r600/sfn: Fix readport check
We have to take multi-slot instructions into account, and we don't fail
when there are still possible bank swizzle values to be checked.

For clarity also rename the bank swizzle iterator iterator.

Fixes: 79ca456b48
   r600/sfn: rewrite NIR backend

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20739>
2023-01-17 19:19:01 +00:00
Rhys Perry
42d51ef2bb radv/gfx11: expose shaderBufferFloat32AtomicAdd
Signed-off-by: Rhys Perry <pendingchaos02@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/19810>
2023-01-17 17:39:15 +00:00
Rhys Perry
7dd16791ca radv: load ssbo_atomic_fadd descriptor
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/19810>
2023-01-17 17:39:15 +00:00
Rhys Perry
068c84f275 aco: add support for fp32 addition atomics
Signed-off-by: Rhys Perry <pendingchaos02@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/19810>
2023-01-17 17:39:15 +00:00
Rhys Perry
ea1ac3901a ac/llvm: add support for fp32 addition atomics
Signed-off-by: Rhys Perry <pendingchaos02@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/19810>
2023-01-17 17:39:15 +00:00
José Roberto de Souza
e879b28994 anv: Move anv_device_check_status() code to i915/anv_device.c
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Rohan Garg <rohan.garg@intel.com>
Acked-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20428>
2023-01-17 17:10:18 +00:00
José Roberto de Souza
94af444490 anv: Split i915 code from anv_batch_chain.c
There is no change in behavior here.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Rohan Garg <rohan.garg@intel.com>
Acked-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20428>
2023-01-17 17:10:18 +00:00
José Roberto de Souza
94ca73b356 anv: Export anv_exec_batch_debug() and chain_command_buffers()
This functions will be used by i915 and Xe KMD.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Rohan Garg <rohan.garg@intel.com>
Acked-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20428>
2023-01-17 17:10:18 +00:00
José Roberto de Souza
80c89c4606 anv: Start to move i915 specific code from anv_device to i915/anv_device
More code re-organization to separate i915_drm.h specific code from
the rest.

No behavior changes here.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Rohan Garg <rohan.garg@intel.com>
Acked-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20428>
2023-01-17 17:10:18 +00:00
Gert Wollny
8084b412ca virgl: drop the separable flag for cases that can't be handled
The host can't assign more than 32 locations explicitly, and we
exhaust this already when we handle patches and generics. So
drop the separable flag in cases when we have other IO that
uses generated names that will have to be matched by name.

v2: skip tests for VS input and FS outputs

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20738>
2023-01-17 16:58:52 +00:00
Rob Clark
aa7c83786d freedreno/ci: Add an a618 flake
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20749>
2023-01-17 16:33:29 +00:00
Rob Clark
a7a46556ec Revert "freedreno/ci: Switch a630 jobs over to manual"
This reverts commit 0cc3701338.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20749>
2023-01-17 16:33:29 +00:00
Rob Clark
23e6d0ce79 Revert "freedreno/ci: Switch also performance a630 job to manual"
This reverts commit 3be7a28b24.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20749>
2023-01-17 16:33:29 +00:00
Lionel Landwerlin
f9115b6d51 intel: use a shared UUID with other drivers
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/20408>
2023-01-17 17:36:07 +02:00
Tapani Pälli
53de48f1c4 intel/compiler: add cpp_std=c++17 when building tests
Otherwise build fails:

"../src/intel/compiler/brw_private.h:40:4: note:
 ‘std::variant’ is only available from C++17 onwards"

Fixes: 6c194ddd18 ("intel/compiler: Prepare SIMD selection helpers to handle different prog_datas")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20725>
2023-01-17 13:58:03 +00:00
Gert Wollny
d59e5aa08f virgl: Request setting the atomic offset in the range_base
With that NTT can encode the array base of atomic arrays separately
so that the host driver can address the arrays correctly.

Fixes GL-CTS: KHR-Single-GL43.arrays_of_arrays_gl.AtomicUsage

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19980>
2023-01-17 13:19:04 +00:00
Gert Wollny
994cf0e995 virgl: lower image variable offsets into the intrinsic range_base value
With that we get the correct base offset when accessing image arrays.
This is required if there a various images with different access
specifiers, because only with the correct base offset the host driver is
able to pick the right array.

Fixes GL-CTS: KHR-GL43.shading_language_420pack.binding_image_array

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19980>
2023-01-17 13:19:04 +00:00
Gert Wollny
7380656a8c ntt: Make use of the range_base offset when translating atomics in NTT
v2: Unconditionally add teh range base, it is properly initialized.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19980>
2023-01-17 13:19:04 +00:00
Gert Wollny
36f19058ae ntt: handle the image intrinsic range_base when translating to TGSI
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19980>
2023-01-17 13:19:04 +00:00
Gert Wollny
2e05cfa179 nir: Add range_base to atomic_counter and an option to use it
Some drivers may encode constant offsets in the instruction, so
make it possible for the drivers to request lowering the atomic
uniform offset into the range_base variable of the intrinsic.

v2: drop patch to use build-in array offset evaluation, it makes
    problems with zink, and update the code accordingly
v3: always initialize range base

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19980>
2023-01-17 13:19:04 +00:00
Gert Wollny
c4cde91c1b nir: Add possibility to store image var offset in range_base
Add the intrinsic range_base value to the image intrinsics and add
the option to store the image array offset into range_base instead
of adding it to the image array index if the driver requests it.

v2: Always initialize range_base

v3: fix for bindless intrinsics

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19980>
2023-01-17 13:19:04 +00:00
Jesse Natalie
2f4c7b5ccf dzn: Use typeless format for creation of depth-only or stencil-only D24S8
When querying capabilities or creating views using a scoped aspect
mask, we want to return the format for the correct single-channel
format, but when actually creating the resource (aspect mask 0),
we want to use the typeless format, since the single-channel formats
don't report multisampling support.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
9f928adf81 dzn: Set MultisampleEnable to enable MSAA lines
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
ca20577622 dzn: Storage buffer sizes need to be 4-byte-aligned
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
b948a5db4f dzn: Support int border colors
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
10282bbd96 dzn: Use R24G8_TYPELESS for 24/8 depth resources
This is the same that was already being done for R32G8X24, not sure
why it was missed for R24G8.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
a3005ecb56 dzn: When changing root signature, dirty descriptors too
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
14f0c85874 dzn: Support alpha blend factor
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
aa3fc8753d dzn: Get options13
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
22eb9b1c12 spirv2dxil: Replace not-provided inputs with zero instead of undef
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
61c391781e spirv2dxil: Allow killing position as an undef varying
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
3ddf41cb7d spirv2dxil: When removing unused inputs, make sure they're actually inputs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
00b9c10cf7 spirv2dxil: For removing unused vars, consider the whole I/O var size
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
85f44304d8 microsoft/compiler: Set num_components to 4 when updating pos write instructions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
5d8e89f92f microsoft/compiler: Use nir info.fs.uses_sample_shading to force sample-rate
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
cbc481f39f microsoft/compiler: Re-work the logic for adding SV_SampleIndex to force sample-rate
Only add SV_SampleIndex if there exists a sample-rate var that has either flat
interpolation or centroid (and therefore can't force sample rate implicitly),
unless there is also a sample-rate var that doesn't have those properties.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
b151ed4b95 microsoft/compiler: Always emit float types in the I/O signature for structs
There's VK tests that have mismatching interpolation specifiers between FS
and the previous stage. For structs, that resulted in different types, which
breaks DXIL validation.

We could link the shaders and have that overwrite the interpolation field from
the previous shader, but we could also just not care and always use float.
I don't see any regressions from that.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
c1a3d6b9a9 microsoft/compiler: Remove arrays when testing for structs in I/O
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
c86bd4bfbc microsoft/compiler: Implement texture sample count query
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
47481e8151 microsoft/compiler: Lower pack_[u/s]norm_2x16
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Simon Fels
4a0aeae371 virgl/vtest: allow socket being specified by env variable
Signed-off-by: Simon Fels <simon.fels@canonical.com>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20736>
2023-01-17 12:02:38 +00:00
Simon Fels
501309ef32 venus: allow vtest socket being specified by env variable
Signed-off-by: Simon Fels <simon.fels@canonical.com>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20736>
2023-01-17 12:02:38 +00:00
Illia Polishchuk
530a62ce73 hasvk: Add extra memory types for hasvk driver instead of a single one
Replicates a fix from Anv.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Illia Polishchuk <illia.a.polishchuk@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7360
Tested-by: Matti Hämäläinen <ccr@tnsp.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20720>
2023-01-17 10:48:20 +00:00
Illia Polishchuk
8491b1fd5e ANV: Add extra memory types for ANV driver instead of a single one
Some game engines can't handle single type well
And Intel on Windows uses 3 types so it's better to add extra one here

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7360
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Illia Polishchuk <illia.a.polishchuk@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20693>
2023-01-17 07:41:52 +00:00
Dave Airlie
83a1d56faa ci: bump vk cts to 1.3.3.1 + and a crash fix.
With the video changes some crashes were introduced in CTS,
apply the fix.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20629>
2023-01-17 04:23:08 +00:00
Thong Thai
bb003d406e gallium/auxiliary/vl: clean-up progressive shader
Add the progressive shader to the vl_compositor_cs_cleanup_shaders
function.

Signed-off-by: Thong Thai <thong.thai@amd.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8086
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8088
Tested-by: Mark Herbert <mark.herbert42@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20730>
2023-01-16 22:48:26 +00:00
Alyssa Rosenzweig
f02354d3e2 pan/mdg: Remove MSGS debug
These should all be unreachable and what's left is dead-code.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19350>
2023-01-16 22:20:43 +00:00
Alyssa Rosenzweig
23968aeeb5 pan/mdg: Scalarize LUT instructions in NIR
Simpler. Small shaderdb regressions from using IR registers instead of
SSA, but that's probably what we needed for correctness (given that SSA
is violated otherwise) hence the Cc.

total instructions in shared programs: 1520220 -> 1518127 (-0.14%)
instructions in affected programs: 167437 -> 165344 (-1.25%)
helped: 662
HURT: 206
helped stats (abs) min: 1.0 max: 46.0 x̄: 3.65 x̃: 2
helped stats (rel) min: 0.18% max: 22.22% x̄: 2.43% x̃: 1.71%
HURT stats (abs)   min: 1.0 max: 7.0 x̄: 1.56 x̃: 1
HURT stats (rel)   min: 0.17% max: 8.33% x̄: 2.66% x̃: 2.33%
95% mean confidence interval for instructions value: -2.65 -2.18
95% mean confidence interval for instructions %-change: -1.45% -0.99%
Instructions are helped.

total bundles in shared programs: 649844 -> 649345 (-0.08%)
bundles in affected programs: 59278 -> 58779 (-0.84%)
helped: 577
HURT: 249
helped stats (abs) min: 1.0 max: 39.0 x̄: 1.56 x̃: 1
helped stats (rel) min: 0.26% max: 30.00% x̄: 3.13% x̃: 2.19%
HURT stats (abs)   min: 1.0 max: 12.0 x̄: 1.61 x̃: 1
HURT stats (rel)   min: 0.58% max: 25.00% x̄: 5.25% x̃: 4.00%
95% mean confidence interval for bundles value: -0.78 -0.43
95% mean confidence interval for bundles %-change: -0.98% -0.23%
Bundles are helped.

total quadwords in shared programs: 1136767 -> 1134956 (-0.16%)
quadwords in affected programs: 141780 -> 139969 (-1.28%)
helped: 744
HURT: 311
helped stats (abs) min: 1.0 max: 9.0 x̄: 3.13 x̃: 2
helped stats (rel) min: 0.14% max: 26.67% x̄: 2.77% x̃: 2.13%
HURT stats (abs)   min: 1.0 max: 8.0 x̄: 1.68 x̃: 1
HURT stats (rel)   min: 0.35% max: 10.00% x̄: 3.17% x̃: 1.69%
95% mean confidence interval for quadwords value: -1.89 -1.54
95% mean confidence interval for quadwords %-change: -1.27% -0.77%
Quadwords are helped.

total registers in shared programs: 90461 -> 90273 (-0.21%)
registers in affected programs: 2833 -> 2645 (-6.64%)
helped: 250
HURT: 82
helped stats (abs) min: 1.0 max: 2.0 x̄: 1.08 x̃: 1
helped stats (rel) min: 6.67% max: 33.33% x̄: 14.06% x̃: 12.50%
HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 6.67% max: 50.00% x̄: 13.90% x̃: 12.50%
95% mean confidence interval for registers value: -0.67 -0.47
95% mean confidence interval for registers %-change: -8.62% -5.69%
Registers are helped.

total threads in shared programs: 55685 -> 55686 (<.01%)
threads in affected programs: 76 -> 77 (1.32%)
helped: 20
HURT: 17
helped stats (abs) min: 1.0 max: 2.0 x̄: 1.30 x̃: 1
helped stats (rel) min: 100.00% max: 100.00% x̄: 100.00% x̃: 100.00%
HURT stats (abs)   min: 1.0 max: 2.0 x̄: 1.47 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.47 0.52
95% mean confidence interval for threads %-change: 5.81% 56.35%
Inconclusive result (value mean confidence interval includes 0).

total spills in shared programs: 1387 -> 1379 (-0.58%)
spills in affected programs: 283 -> 275 (-2.83%)
helped: 5
HURT: 1

total fills in shared programs: 5256 -> 5176 (-1.52%)
fills in affected programs: 557 -> 477 (-14.36%)
helped: 5
HURT: 1

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19350>
2023-01-16 22:20:43 +00:00
Alyssa Rosenzweig
10759d1708 pan/mdg: Use special NIR ops for trig scaling
Otherwise the lowering is fundamentally unsound due to incorrect constant
folding, even though it worked by chance with the old pass ordering. We're about
to change slightly the way we handle fsin/fcos, which was enough to trigger this
unsoundness.

shader-db results are mostly a toss-up.

total instructions in shared programs: 1520675 -> 1520220 (-0.03%)
instructions in affected programs: 96841 -> 96386 (-0.47%)
helped: 397
HURT: 3
helped stats (abs) min: 1.0 max: 4.0 x̄: 1.15 x̃: 1
helped stats (rel) min: 0.22% max: 6.25% x̄: 1.15% x̃: 0.40%
HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 0.58% max: 2.08% x̄: 1.08% x̃: 0.58%
95% mean confidence interval for instructions value: -1.19 -1.08
95% mean confidence interval for instructions %-change: -1.26% -1.01%
Instructions are helped.

total bundles in shared programs: 650088 -> 649844 (-0.04%)
bundles in affected programs: 31132 -> 30888 (-0.78%)
helped: 229
HURT: 23
helped stats (abs) min: 1.0 max: 4.0 x̄: 1.21 x̃: 1
helped stats (rel) min: 0.49% max: 7.14% x̄: 1.28% x̃: 0.71%
HURT stats (abs)   min: 1.0 max: 3.0 x̄: 1.48 x̃: 1
HURT stats (rel)   min: 0.83% max: 8.33% x̄: 2.38% x̃: 1.85%
95% mean confidence interval for bundles value: -1.08 -0.86
95% mean confidence interval for bundles %-change: -1.15% -0.74%
Bundles are helped.

total quadwords in shared programs: 1137388 -> 1136767 (-0.05%)
quadwords in affected programs: 71826 -> 71205 (-0.86%)
helped: 367
HURT: 17
helped stats (abs) min: 1.0 max: 8.0 x̄: 1.80 x̃: 1
helped stats (rel) min: 0.31% max: 17.24% x̄: 2.27% x̃: 0.96%
HURT stats (abs)   min: 1.0 max: 6.0 x̄: 2.29 x̃: 2
HURT stats (rel)   min: 0.44% max: 11.11% x̄: 2.18% x̃: 1.47%
95% mean confidence interval for quadwords value: -1.76 -1.47
95% mean confidence interval for quadwords %-change: -2.36% -1.78%
Quadwords are helped.

total registers in shared programs: 90483 -> 90461 (-0.02%)
registers in affected programs: 890 -> 868 (-2.47%)
helped: 67
HURT: 44
helped stats (abs) min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
helped stats (rel) min: 8.33% max: 25.00% x̄: 10.52% x̃: 9.09%
HURT stats (abs)   min: 1.0 max: 2.0 x̄: 1.02 x̃: 1
HURT stats (rel)   min: 9.09% max: 50.00% x̄: 31.15% x̃: 33.33%
95% mean confidence interval for registers value: -0.39 -0.01
95% mean confidence interval for registers %-change: 1.75% 10.25%
Inconclusive result (value mean confidence interval and %-change mean confidence interval disagree).

total threads in shared programs: 55694 -> 55685 (-0.02%)
threads in affected programs: 21 -> 12 (-42.86%)
helped: 1
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: 2.0 max: 2.0 x̄: 2.00 x̃: 2
HURT stats (rel)   min: 50.00% max: 50.00% x̄: 50.00% x̃: 50.00%
95% mean confidence interval for threads value: -2.79 -0.21
95% mean confidence interval for threads %-change: -89.26% 39.26%
Inconclusive result (%-change mean confidence interval includes 0).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19350>
2023-01-16 22:20:43 +00:00
Alyssa Rosenzweig
c3839bd540 nir: Optimize vendored sin/cos the same way
As we've done for the AMD one, to prevent any codegen regression from switching
the Midgard lowering.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19350>
2023-01-16 22:20:43 +00:00
Alyssa Rosenzweig
a49ba0f1ae nir: Add Midgard-specific fsin/fcos ops
NIR has a fsin instruction that takes an argument in radians. Midgard instead
has an fsinpi argument that takes an argument in multiples of pi. So, we had a
NIR pass that would change fsin(x) to fsin(x / pi) and then map fsin to fsinpi
in the backend.

But that's invalid! In NIR, the opcode fsin is well-defined. fsin(x) means
something very different than fsin(x / pi). They won't usually be equal. The
transform fsin(x) -> fsin(x / pi) is fundamentally unsound.

It did work before, by accident. Most NIR passes don't care about the semantics
of ALU instructions.  fsin(x) and fsin(x / pi) are both well-defined but
fundamentally different NIR shaders. So while rewriting is wrong -- the NIR we
get out is not equivalent to the NIR we put in, and the Midgard ops we generate
are not equivalent to the NIR -- but if we don't run any passes that care about
the definition of fsin the two wrongs will cancel out to make a right.

However, some NIR passes do care about the definitions of ALU instructions,
instead of treating them as named black boxes. In particular, constant folding
(nir_opt_constant_fold) evaluates ALU instructions when their inputs are
constants, according to the definition in nir_opcodes.py. So our little charade
will only work if we don't call nir_opt_constant_fold, or if all the fsin
instructions have non-constant inputs. At the beginning of this series, that is
the case. With the later scalarization change, that's no longer the case, and
the unsoundness translates to real failing tests rather than a quibble of NIR's
semantics.

To mitigate, we define a new NIR opcode with the semantics we want and translate
fsin(x) = fsin_mdg(x / pi), where that equivalence does hold mathematically. So
the new translation is sound and doesn't rely on lucky pass ordering.

This matches the approach already used for AMD and AGX, which have fsin_amd and
fsin_agx opcodes respectively.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19350>
2023-01-16 22:20:43 +00:00
Pavel Ondračka
e86c7ac9f4 r300: remove backend input range transformation for sin and cos
We already do this in NIR since a04aa4bc08
and 3f97306b95 so there is no effect
for the mesa state tracker now that it can not emit TGSI any more.
This leaves only nine when RADEON_DEBUG=use_tgsi is set. D3D9 however
requires that sin and cos inputs already have the proper range.

This is super important when the nine shader uses relative adressing
and therefore needs all 256 constants we have. If we add our extra
constants for the fixup, we get over the limit and fail compilation.

v2: vertex shaders only

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18933>
2023-01-16 19:57:13 +00:00
Pavel Ondračka
d8f59b14d0 r300: skip sin/cos input range transformation for nine and ntt
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/18933>
2023-01-16 19:57:13 +00:00
Pavel Ondračka
0b21d3ae6c r300: update rv515 ci failures list
This fix missed in 421bf657bf where it was
updated only for R480.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20666>
2023-01-16 19:46:05 +00:00
Timur Kristóf
faba30a8f3 aco/optimizer: Optimize p_extract + v_mul_u32_u24 to v_mad_u32_u16.
This should perform the same but removes SDWA from the address
calculations in NGG culling shaders for example.

This is done because SDWA is no longer available on GFX11.

Fossil DB stats on GFX1100:
Totals from 36 (0.03% of 134913) affected shaders:
CodeSize: 300968 -> 300884 (-0.03%); split: -0.04%, +0.01%
Instrs: 60955 -> 60863 (-0.15%); split: -0.15%, +0.00%
Latency: 426809 -> 426819 (+0.00%); split: -0.06%, +0.06%
InvThroughput: 39076 -> 39025 (-0.13%); split: -0.14%, +0.01%
VClause: 1440 -> 1443 (+0.21%)
Copies: 5714 -> 5725 (+0.19%)

Fossil DB stats on GFX1100 with NGG culling enabled:
Totals from 60953 (45.18% of 134913) affected shaders:
VGPRs: 2273172 -> 2273160 (-0.00%)
CodeSize: 186401864 -> 186403036 (+0.00%); split: -0.00%, +0.00%
Instrs: 37038048 -> 36977353 (-0.16%); split: -0.16%, +0.00%
Latency: 146466770 -> 146350172 (-0.08%); split: -0.08%, +0.00%
InvThroughput: 15342790 -> 15228585 (-0.74%); split: -0.74%, +0.00%
VClause: 669662 -> 669665 (+0.00%)
Copies: 2972380 -> 2972482 (+0.00%); split: -0.01%, +0.01%

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17924>
2023-01-16 19:27:39 +00:00
Timur Kristóf
171d76ded1 aco/optimizer: Add missing v_lshlrev condition to can_apply_extract.
This was already handled by apply_extract but missing from
can_apply_extract, therefore may not be properly applied everywhere.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17924>
2023-01-16 19:27:39 +00:00
Adam Jackson
04ac0ec148 wsi/x11: Support depth 16 visuals
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7846
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20673>
2023-01-16 18:01:08 +00:00
Adam Jackson
37a8b2d12e wsi/x11: Infer the default surface format from the root window's visual
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20673>
2023-01-16 18:01:08 +00:00
Adam Jackson
4a7ffd9162 wsi/x11: Make get_sorted_vk_formats handle varying channel widths
Depths 24 and 30 happen to have uniform bpc but 16 does not. Pull the
real channel width out of the format description instead. This is still
a bit ignorant of channel order though.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20673>
2023-01-16 18:01:08 +00:00
Rhys Perry
aa6b2ec46a ac/nir: use store_buffer_amd's base index
This allows ACO to combine the addition into the store without checking
for wraparound.

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/20296>
2023-01-16 17:25:51 +00:00
Rhys Perry
39c214769b aco: restore semantic_can_reorder for GS output stores
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/20296>
2023-01-16 17:25:51 +00:00
Rhys Perry
18d3e4fecd radv,aco: use ac_nir_lower_legacy_gs
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/20296>
2023-01-16 17:25:51 +00:00
Rhys Perry
c7cedaaee2 radv: implement GS load_ring_gsvs_amd/load_ring_gs2vs_offset_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/20296>
2023-01-16 17:25:51 +00:00
Alyssa Rosenzweig
dfd6157d6c panfrost: Document render_condition_check contract
This was implicit before, leading to the bug fixed in the previous commit.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20689>
2023-01-16 17:11:19 +00:00
Alyssa Rosenzweig
02f9cddb61 panfrost: Fix clears with conditional rendering
batch can be invalidated by the render condition check.

Fixes nv_conditional_render-clear.

Fixes: 638b22354e ("panfrost: Clear with a quad to avoid flushing")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20689>
2023-01-16 17:11:19 +00:00
Alyssa Rosenzweig
7c7c38b126 panfrost: Remove unused debug parameter
We removed this path.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20707>
2023-01-16 16:57:47 +00:00
Alyssa Rosenzweig
ea03d0652d panfrost: Remove PAN_MESA_DEBUG=deqp
Now unused.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20707>
2023-01-16 16:57:46 +00:00
Alyssa Rosenzweig
46051049a6 panfrost: Stop testing CAP_INT16
This doesn't look like it'll be fixed any time soon. No point running dEQP with
different flags than production, IMO.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20707>
2023-01-16 16:57:46 +00:00
Lucas Stach
c966b06736 etnaviv: don't drop TS capability on GPUs with MMUv2
Currently etnaviv disables TS on all MC1.0 GPUs, since the TS unit
doesn't properly take into account the linear window offset with
MC1.0, creating address aliases on MMUv1 that aren't properly dealt
with.

MMUv2 however doesn't have a linear window, so we can safely enable
TS on those GPUs.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20552>
2023-01-16 16:43:03 +00:00
Juston Li
3b69b67545 util/fossilize_db: add runtime RO foz db loading via FOZ_DBS_DYNAMIC_LIST
Add a new environment varible
MESA_DISK_CACHE_READ_ONLY_FOZ_DBS_DYNAMICE_LIST that specifies a text
file containing a list of RO fossilize caches to load. The list file
is modifiable at runtime to allow for loading RO caches after
initialization unlike MESA_DISK_CACHE_READ_ONLY_FOZ_DBS.

The implementation spawns an updater thread that uses inotify to monitor
the list file for modifications, attempting to load new foz dbs added to
the list. Removing files from the list will not evict a loaded cache.

MESA_DISK_CACHE_READ_ONLY_FOZ_DBS_DYNAMIC_LIST takes an absolute path.
The file must exist at initialization for updating to occur.

File names of foz dbs in the list file are new-line separated and take
relative paths to the default cache directory like
MESA_DISK_CACHE_READ_ONLY_FOZ_DBS.

The maximum number of RO foz dbs is kept to 8 and is shared between
MESA_DISK_CACHE_READ_ONLY_FOZ_DBS_DYNAMIC_LIST and
MESA_DISK_CACHE_READ_ONLY_FOZ_DBS.

The intended use case for this feature is to allow prebuilt caches
to be downloaded and loaded asynchronously during app runtime.
Prebuilt caches be large (several GB) and depending on network
conditions would otherwise present extended wait time for caches
to be availible before app launch.
This will be used in Chrome OS.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19328>
2023-01-16 16:15:45 +00:00
Juston Li
eea2033b3e utils/fossilize_db: refactor out loading RO foz dbs
Move loading of RO foz dbs into its own load_ro_foz_dbs() function

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19328>
2023-01-16 16:15:45 +00:00
Juston Li
483ee5d6ba util/fossilize_db: don't destroy foz on RO load fail
When loading multiple RO foz dbs, if a db fails to load, continue trying
to load other RO foz dbs instead of destroying the foz cache.

Preserve destroying the foz cache and not preceding to load RO caches
if the RW cache fails to load.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19328>
2023-01-16 16:15:45 +00:00
Juston Li
4c19426fd6 docs/envvars: add missing mesa disk cache envvars
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19328>
2023-01-16 16:15:45 +00:00
Alyssa Rosenzweig
41d99c10d1 panfrost: Fix logic ops on Bifrost
opaque should not be set when logicops are enabled, that needs blending
even on Bifrost. Fixes is for when I believe the bug became possible to hit.
The logical error is older.

Fixes Piglit logicop tests again.

Fixes: d849d9779a ("panfrost: Avoid blend shader when not blending")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20685>
2023-01-16 16:02:23 +00:00
Alyssa Rosenzweig
fe4dc59e99 panfrost: Enable NV_primitive_restart on Valhall
Unlike literally every other mesa/st emulation, for some inexplicable reason we
need to pretend to support the CAP and then set a different EMULATE cap instead
of the emulation keying off the lack of support for the CAP. Set the CAPs
accordingly so we get NV_primitive_restart (with emulation of non-fixed
indices).

This gets Mesa to advertise GL 3.1 on Mali-G57 as intended.

Fixes: 30c14f54cf ("panfrost: Disable PIPE_CAP_PRIMITIVE_RESTART on v9")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20702>
2023-01-16 15:46:16 +00:00
Alyssa Rosenzweig
2f97883276 pan/bi: Add a unit test for fsat(reg.yx)
This would have caught the issue from the previous commit. Split out to make
backporting the previous change less onerous.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20683>
2023-01-16 15:29:38 +00:00
Alyssa Rosenzweig
ed46c617b0 pan/bi: Fix incorrect compilation of fsat(reg.yx)
Future changes to nir_lower_blend cause fsat(reg.yx) instructions to be
generated, which correspond to "FCLAMP.v2f16 x.h10" pseudoinstructions. These
get their swizzles lowered, but we forgot to clear the swizzle out, so we end up
with extra swap (cancelling out the intended swizzle).

Fix the lowering logic.

Fixes: ac636f5adb ("pan/bi: Use FCLAMP pseudo op for clamp prop")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20683>
2023-01-16 15:29:38 +00:00
Eric Engestrom
c672b593b9 bin/ci: add gitlab_gql.py.cache to the .gitignore
On my machine, the filecache doesn't have the extra `.db` suffix, just `.cache`.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20722>
2023-01-16 15:27:38 +00:00
Friedrich Vock
684eee0748 radv/bvh: Prevent NANs when computing node cost
Otherwise the degenerate geometry workaround never triggers, leading to bad performance.

Fixes: 6f45c98b ("radv/bvh: Adjust sah cost based on depth")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20723>
2023-01-16 14:49:54 +00:00
Alejandro Piñeiro
4c7caa6211 v3dv: skip two ycbcr tests
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Ella Stanforth
18319a236c v3dv: add support for multi-planar formats, enable YCbCr
Original patches wrote by Ella Stanforth.

Alejandro Piñeiro main changes (skipping the small fixes/typos):
  * Reduced the list of supported formats to
    VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM and
    VK_FORMAT_G8_B8R8_2PLANE_420_UNORM, that are the two only
    mandatory by the spec.
  * Fix format features exposed with YCbCr:
    * Disallow some features not supported with YCbCr (like blitting)
    * Disallow storage image support. Not clear if really useful. Even
      if there are CTS tests, there is an ongoing discussion about the
      possibility to remove them.
    * Expose VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT, that is
      mandatory for the formats supported.
    * Not expose VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT. Some
      CTS tests are failing right now, and it is not mandatory. Likely
      to be revisit later.
    * We are keeping VK_FORMAT_FEATURE_2_DISJOINT_BIT and
      VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT. Even if they
      are optional, it is working with the two formats that we are
      exposing. Likely that will need to be refined if we start to
      expose more formats.
  * create_image_view: don't use hardcoded 0x70, but instead doing an
    explicit bit or of VK_IMAGE_ASPECT_PLANE_0/1/2_BIT
  * image_format_plane_features: keep how supported aspects and
    separate stencil check is done. Even if the change introduced was
    correct (not sure about that though), that change is unrelated to
    this work
  * write_image_descriptor: add additional checks for descriptor type,
    to compute properly the offset.
  * Cosmetic changes (don't use // for comments, capital letters, etc)
  * Main changes coming from the review:
     * Not use image aliases. All the info is already on the image
       planes, and some points of the code were confusing as it was
       using always a hardcoded plane 0.
     * Squashed the two original main patches. YCbCr conversion was
       leaking on the multi-planar support, as some support needed
       info coming from the ycbcr structs.
     * Not expose the extension on Android, and explicitly assert that
       we expect plane_count to be 1 always.
  * For a full list of review changes  see MR#19950

Signed-off-by: Ella Stanforth <estanforth@igalia.com>
Signed-off-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Alejandro Piñeiro
2ef614a2d8 v3dv/image: use 64-byte alingment for linear images if needed
When used for transfer, the image could be used eventually as a
Texture Base Address, that needs to be 64-byte aligned.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Alejandro Piñeiro
aa31d38bcf v3dv: pass alignment to v3dv_buffer_init
Although for any buffer created by the user, or any API that can be
called by the user (like GetDeviceBufferMemoryRequirements) the
alignment is V3D_NON_COHERENT_ATOM_SIZE, there are internal uses of a
buffer that could require a fine-grained alignment (like when used as
a alias for a image, that has different alignment requirements).

Note that an alternative would have created a
v3dv_buffer_init_with_alignment (or similar name), but this option
seemed easier.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Alejandro Piñeiro
77f4885ccb v3dv/pipeline: rename lower_tex_src_to_offset to lower_tex_src
Less confusing this way.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Alejandro Piñeiro
98e6effadd v3dv/format: remove unused v3dv_get_tex_return_size
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Iago Toral Quiroga
36ec3d6fe3 v3dv: add paths to handle partial copies of linear images
v2:
   * Removed unneeded copy_image_linear_buffer
   * Add tiling/image-type check on copy_image_blit

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Jason Ekstrand
b39958a3a1 anv,nir: Move the ANV YCbCr lowering pass to common code
Nir changes:
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>

Anv changes:

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/19950>
2023-01-16 14:10:21 +00:00
Jason Ekstrand
f02a11e4e4 nir: Add copyright and include guards to nir_vulkan.h
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Jason Ekstrand
2ac771973d anv: Use the YCbCr format info from common code
We still maintain our own table of formats but all of the conversion and
sampling info we pull from common code.

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/19950>
2023-01-16 14:10:21 +00:00
Jason Ekstrand
30a91d333d anv: Use the common vk_ycbcr_conversion object
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/19950>
2023-01-16 14:10:21 +00:00
Jason Ekstrand
1cc342f5e1 vulkan: Add a common vk_ycbcr_conversion struct
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Jason Ekstrand
5eaf8218de vulkan/formats: Add YCbCr format information
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Jason Ekstrand
04e7ebea5d util/format: YUYV and UYVY have 4 8-bit channels
They're all packed and weird but this is more accurate than saying they
have a single x32 blob of data.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Jason Ekstrand
18feb32df0 anv/android: Use VkFormat for externalFormat
Using a pointer to an internal data structure works but it's a bit
sketchy.  Since every anv_format maps to a VkFormat, we may as well
just use the VkFormat.

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/19950>
2023-01-16 14:10:21 +00:00
Jason Ekstrand
9fc046a87d anv: Refactor Android externalFormat handling in CreateYcbcrConversion
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/19950>
2023-01-16 14:10:21 +00:00
Lionel Landwerlin
4121aa43c4 Revert "ci: build hasvk if we're building anv"
This reverts commit b4d3d11e43.

We're seeing problems on the builders running the hasvk tests.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20726>
2023-01-16 13:39:37 +00:00
Alejandro Piñeiro
b27e42dcb5 vulkan/wsi: check if image info was already freed
We set the different data being freed to NULL after freeing it, and
checks for NULL before freeing it.

This fixes several double free crash with v3dv, when running OOM wsi
tests, like for example:
dEQP-VK.wsi.xlib.swapchain.simulate_oom.composite_alpha

Although note that only one person got those on a new fresh install of
the Raspbian OS, so this problem was rare.

Fixes: 5b13d74583 ("vulkan/wsi/drm: Break create_native_image in pieces")
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20695>
2023-01-16 13:01:52 +00:00
Matt Coster
6b8dab7de2 pvr: Add support for geometry-only render jobs
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20545>
2023-01-16 12:48:37 +00:00
Matt Coster
85155e389e pvr: Extract setup of winsys job submit flags into separate functions
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20545>
2023-01-16 12:48:37 +00:00
Iago Toral Quiroga
9bf525b4bd broadcom/compiler: produce better code for f2f16 with RTZ rounding
Suggested by Georg Lehmann, this generates far less code and should
be more correct.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8090
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20721>
2023-01-16 12:03:24 +01:00
Pierre-Eric Pelloux-Prayer
a48642400b ac: don't call ac_query_pci_bus_info from ac_query_gpu_info
Instead let each driver call it.

radeonsi ignores the error because it doesn't require correct
pci-bus info to work properly.

radv keeps the existing behavior and fails if the pci-bus infos
is missing.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20645>
2023-01-16 10:27:15 +01:00
Pierre-Eric Pelloux-Prayer
6f533c4ee2 ac: add ac_query_pci_bus_info helper
No functional changes.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20645>
2023-01-16 10:27:15 +01:00
Pierre-Eric Pelloux-Prayer
91b0cc3fe3 ac/info: move pci bus info in a struct
And add a validity flag because there's no way to
tell if they're valid, unless for the caller of
drmGetDevice2.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20645>
2023-01-16 10:27:15 +01:00
Pierre-Eric Pelloux-Prayer
7893369c2e radeonsi: simplify dpbb settings
Use only 2 sets of parameters and add some debug variables
to ease tweaking them when testing.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20645>
2023-01-16 09:41:30 +01:00
David Heidelberg
3be7a28b24 freedreno/ci: Switch also performance a630 job to manual
Fixes: 0cc3701338 ("freedreno/ci: Switch a630 jobs over to manual")

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20716>
2023-01-16 00:53:38 +00:00
David Heidelberg
0886df2491 ci/zink: Penumbra is now fixed.
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20718>
2023-01-16 00:30:21 +00:00
Vinson Lee
6986332c80 radv: Fix memory leak.
Fix defect reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable page going out of scope leaks the storage it points to.

Fixes: 8d0e6c02c7 ("radv: Add RMV tracing utilities")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20711>
2023-01-15 23:55:40 +00:00
Friedrich Vock
eab2c39951 radv/rt: Divide by the correct workgroup size
Improves build performance by around 25%.

Fixes: 9369b407 ("radv: Use PLOC for BVH building")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20717>
2023-01-15 23:33:33 +00:00
Gert Wollny
0ca325cc10 glsl/nir: only set uses_sample_shading when the output is a fbfetch
Constructs like

  out vec4 fs_out;
  ....
  fs_out = vec4(...);
  if (fs_out.w < alpha_test_value)
     discard;

lead to initial nir that reads from fs_out, even though we don't actually
do a framebuffer fetch, and later nir passes will eliminate that direct
read from the output variable. As given in the commit message of 1124bee4
we are actually only interested in the framebuffer fetch, so set the
property only when an output is used for fbfetch reads.

v2: Iterate over all variables (Jason)

Fixes: commit 1124bee4ba
  glsl/nir: Set sample_shading if a FS output ever shows up as an rvalue

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20694>
2023-01-15 22:04:15 +00:00
Konstantin Seurer
03105138f1 radv/rt: Get rid of accel struct null checks
Quake II RTX ray queries:

Totals from 7 (14.29% of 49) affected shaders:
CodeSize: 167220 -> 165560 (-0.99%)
Instrs: 31674 -> 31454 (-0.69%)
Latency: 385145 -> 596737 (+54.94%)
InvThroughput: 78837 -> 122005 (+54.76%)
Copies: 4740 -> 4667 (-1.54%); split: -1.60%, +0.06%
Branches: 1565 -> 1493 (-4.60%)
PreSGPRs: 488 -> 501 (+2.66%); split: -0.41%, +3.07%
PreVGPRs: 617 -> 620 (+0.49%)

Performance stays the same.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20539>
2023-01-15 21:30:21 +00:00
Konstantin Seurer
33166ba50b radv: Use the null accel struct instead of emitting 0
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20539>
2023-01-15 21:30:21 +00:00
Konstantin Seurer
31ca19589f radv: Create a null TLAS as meta state
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20539>
2023-01-15 21:30:21 +00:00
Konstantin Seurer
6d06964f8a radv: Add a helper for finding memory indices
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20539>
2023-01-15 21:30:21 +00:00
Konstantin Seurer
2d738803b5 vulkan: Track the nullDescriptor feature
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20539>
2023-01-15 21:30:21 +00:00
Rob Clark
274e1d5a39 freedreno/ci: Add a618 egl/skqp/piglit jobs
Clone the existing a630 jobs and expectations.  This should give us a6xx
coverage to make up for the offline a630 runners.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20715>
2023-01-15 10:17:37 -08:00
Rob Clark
23e9fe5d53 freedreno/ci: Cleanup a618 yaml
De-duplicate GPU_VERSION/VK_DRIVER and add different jobs that can be
extended for limozeen vs kingoftown runners in order to de-duplicate the
DEVICE_TYPE/DTB/RUNNER_TAG variables.  This should simplify moving jobs
between runners to load-balance.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20715>
2023-01-15 10:17:37 -08:00
Rob Clark
0cc3701338 freedreno/ci: Switch a630 jobs over to manual
The a630 runners are not responding atm, so switch the jobs to manual
for the time being.

Note the other fd-farm runners are responding fine, which is why I
didn't take the entire farm offline.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20715>
2023-01-15 10:17:08 -08:00
Christian Gmeiner
4fb2463a37 etnaviv: nir: use lower_fround_even
The generated asm is not as good as the one from the binary blob but
does its job.

Passes: dEQP-GLES3.functional.shaders.operator.common_functions.round*.*

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20709>
2023-01-15 11:19:05 +01:00
Alyssa Rosenzweig
5fdfd8044d panfrost: Don't use AFBC of sRGB luminance-alpha
This isn't allowed for the same reason that AFBC of regular luminance-alpha
isn't allowed (and will raise DATA_INVALID_FAULTs). Reorder the checks to
ensure these formats are checked.

Fixes Piglit texwrap GL_EXT_texture_sRGB-s3tc.

Fixes: 476be5cb27 ("panfrost: Don't use texture format swizzles on v7")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20686>
2023-01-14 20:00:37 +00:00
Mike Blumenkrantz
48a0478126 zink: add renderdoc handling
renderdoc won't work with zink in frontends that aren't dri,
so ZINK_RENDERDOC should be used to specify start:end frames
to ensure that the vulkan command stream is captured

this is not a renderdoc issue: there are no frame boundaries in rusticl
or gallium-nine, so there is no possible way that renderdoc could
determine when/how to split frames

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20651>
2023-01-14 18:15:48 +00:00
Juston Li
7e52bd7b18 venus: vn_queue: align vulkan object variable naming
Per Yiwei:
"For vn_QueueSubmit and other exposed Vulkan entry points, we keep the
original Vulkan variable namings. If within the same function you need
to use struct vn_queue *queue, then we prefix a _ to the args in the
exposed entry points, so it becomes VkQueue _queue.

For all other places:

VkObject obj_handle
struct vn_object *obj

The obj in this file can be queue, fence, sem, event, cmd, dev, etc."

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20088>
2023-01-14 00:51:56 +00:00
Juston Li
32660a41ea venus: refactor QueueSubmit/QueueSubmit2
Refactor the QueueSubmit functions to share a common function differing
in the vkQueueSubmit/vkQueueSubmit2 call with differences with
VkSubmitInfo/VkSubmitInfo2 handled in the
vn_queue_submission_prepare_submit().

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20088>
2023-01-14 00:51:56 +00:00
Juston Li
6863092d95 venus: append fence feedback batch
Instead of calling an additional QueueSubmit for fence feedback, append
a SubmitInfo batch for fence feedback. This does require copying the
submitted batches to a larger buffer with an additional slot for the
fence feedback batch.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20088>
2023-01-14 00:51:56 +00:00
Juston Li
2889a0478b venus: drop VkQueueBindSparse
Sparse binding is already disabled with fence feedback enabled by
default due to the difficulty getting both to work.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20088>
2023-01-14 00:51:56 +00:00
Juston Li
3b107962a2 venus: remove filtering external semaphores for QueueSubmit
We now require VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT for
external semaphores.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20088>
2023-01-14 00:51:56 +00:00
Juston Li
f6ffb5ac36 venus: require exportable/importable bit for ext semaphores sync fd
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20088>
2023-01-14 00:51:56 +00:00
Juston Li
31e7471be2 venus: require exportable bit for ext fence sync fd
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20088>
2023-01-14 00:51:55 +00:00
Juston Li
75e369335f venus: require importable external semaphores for WSI
Semaphore sync fd import required for WSI to skip scrubbing
the wsi/external wait semaphores.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20088>
2023-01-14 00:51:55 +00:00
Juston Li
f09cc33dfb venus: refactor VK_KHR_synchronization2 ext sync fd requirements
In preparation for adding additional dependency requirements for
external sync fd support.

Move vn_physical_device_init_external_* so external sync fd support can
be retrieved earlier. Then move sync2 disabling to
vn_physical_device_get_passthrough_extensions and 1.3 downgrading
to vn_physical_device_init_properties.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20088>
2023-01-14 00:51:55 +00:00
Juston Li
72371af332 venus: refactor out vn_feedback_event_cmd_record2
Refactor out vn_feedback_event_cmd_record2 into a shared functon
that downgrades pipeline barrier commands for non synchronization2
commands.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20088>
2023-01-14 00:51:55 +00:00
Vincent Davis Jr
842ca28465 gbm/backend: fix gbm compile without dri
Commit introduces a fix that allows for gbm to be built with an empty
backend. There are situation especially in a Yocto/OE cross compilation
environment where you want to build with an empty backend. The particular
situation is as such:

The mesa-gl recipe is the preferred provider for virtual/libgbm, virtual/libgl,
virtual/mesa, etc... But the x11 DISTRO_FEATURE in't included this leads to build
errors such as:

| /../../../ld: src/gbm/libgbm.so.1.0.0.p/main_backend.c.o: in function `find_backend':
| backend.c:(.text.find_backend+0xa4): undefined reference to `gbm_dri_backend'
| /../../../ld: src/gbm/libgbm.so.1.0.0.p/main_backend.c.o:(.data.rel.ro.builtin_backends+0x4):
                undefined reference to `gbm_dri_backend'
| collect2: error: ld returned 1 exit status

Issue should be replicable by setting -Ddri3=disabled and -Dgbm=enabled

Add fix to bypasses compilation issue by excluding gbm dri backend. If
HAVE_DRI || HAVE_DRIX not specified.

Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Vincent Davis Jr <vince@underview.tech>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20447>
2023-01-13 22:29:29 +00:00
Jesse Natalie
f1faf30a5f dzn: Fix clear bind flag logic
This is the patch I had meant to merge

Fixes: 8b79e6fb ("dzn: No need to add another bind flag for clears if one is already present")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20361>
2023-01-13 21:55:41 +00:00
Jesse Natalie
5949521508 dzn/ci: Add image test group, which is all passing now
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20361>
2023-01-13 21:55:41 +00:00
Jesse Natalie
889f03fc24 dzn/ci: Remove flakes/fails that don't hit anymore
The fails weren't causing pipeline failures because the tests just
aren't run, thanks to the dEQP fraction.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20361>
2023-01-13 21:55:41 +00:00
Jesse Natalie
9f9a58eb95 ci/windows: Download updated WARP 1.0.4 package
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20361>
2023-01-13 21:55:41 +00:00
Adam Jackson
a5a19903ab mesa: Trivially advertise NV_generate_mipmap_sRGB
... if you have EXT_framebuffer_sRGB. The extension just relaxes an
error check that we're already not performing, and sRGB rendering
implies sRGB texture support, and mipmap generation would need it to be
a valid render format. So advertise it if EXT_framebuffer_sRGB works.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19476>
2023-01-13 20:53:16 +00:00
Adam Jackson
2aad8dbfa5 mesa: Fix extension table formatting
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19476>
2023-01-13 20:53:16 +00:00
Jason Ekstrand
d3feccfa6f radv: Use the new NIR builder tex helpers for meta
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/19480>
2023-01-13 20:25:01 +00:00
Jason Ekstrand
433fe592ac nir/builder: Add some texture helpers
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/19480>
2023-01-13 20:25:01 +00:00
Jason Ekstrand
30f3fec380 nir: Add more opcodes to nir_tex_instr_is_query()
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/19480>
2023-01-13 20:25:01 +00:00
Adam Jackson
7d8b90a470 glx: Harmonize glXCreateGLXPixmap with glXCreatePixmap
This was open-coding some things, and not perfectly. Likewise for the
destroy path.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20549>
2023-01-13 19:59:26 +00:00
Adam Jackson
2cc3763d04 glx: Fix drawable type inference in visual/fbconfig setup
This was just all kinds of wrong. Note that the comment implying "this
is a workaround for old XQuartz" is on the "not apple" side of the
ifdef. Anyway. xserver didn't start sending GLX_DRAWABLE_TYPE in the
fbconfig until:

    commit 8cde0af3c57f0375ba8ba77af9fdf74b79d9496d
    Author: Kristian Høgsberg <krh@redhat.com>
    Date:   Wed Apr 2 19:06:40 2008 -0400

        Send the GLX_EXT_texture_from_pixmap attributes to the client.

So we can remove this default from the fbconfig path. But we preserve it
for the GLXGetVisualConfigs path, because that is specified not to send
GLX_DRAWABLE_TYPE.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20549>
2023-01-13 19:59:26 +00:00
Adam Jackson
86c9a31d99 glx: Inline a few single-use constant strings into their user
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20549>
2023-01-13 19:59:26 +00:00
Adam Jackson
07292d6e76 glx: Move 1.2 GLXPixmap code into glx_pbuffer.c
We're going to rename this file to something like glx_drawable.c
eventually, but for right now let's just get all the create/destroy calls
in the same place.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20549>
2023-01-13 19:59:26 +00:00
Adam Jackson
cf90a2b28f glx: Check for initial "glX" first in glXGetProcAddress
This makes us match eglGetProcAddress, otherwise you scan the entire GLX
function table on every glXGetProcAddress.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20549>
2023-01-13 19:59:26 +00:00
Adam Jackson
f8d3c222db glx: Reflow MakeContextCurrent a little
First, move a few early-out checks up since they don't need to take the
GLX lock. Second, move garbage collecting deleted contexts up to
immediately after they are unbound. This fixes a memory leak, albeit a
difficult one to hit, in the case where you switch away from a deleted
context but switching to the new one errors out. In that case we would
leak the deleted context, since it's been unbound from all threads and
there's no longer an XID for it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20549>
2023-01-13 19:59:26 +00:00
Adam Jackson
cf9debb639 glx: Clean up some funny business from context bind/unbind
We always fully unbind the old context before binding the new one, so
there's no point in passing both contexts to both the unbind and then
the bind.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20549>
2023-01-13 19:59:26 +00:00
Adam Jackson
f0eed00010 glx: Remove support for glXGetDriverConfig for old drivers
gallium implements __DRI_CONFIG_OPTIONS version 2.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20549>
2023-01-13 19:59:26 +00:00
Adam Jackson
f53ec64d68 glx: Remove a can't-happen NULL check
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20549>
2023-01-13 19:59:26 +00:00
Adam Jackson
9de2776e01 glx: Remove glx_context::screen
We're already keeping a back pointer to the glx_screen which already
tracks this, it's not important enough to keep the screen number in two
places.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20549>
2023-01-13 19:59:26 +00:00
Adam Jackson
81f77f999b glx/dri3: Simplify protocol version tracking
This is really just a single elaborate capability check, so stash a
boolean in the display state for it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20549>
2023-01-13 19:59:26 +00:00
Alyssa Rosenzweig
862bf420a9 asahi: Handle sampler->compare_mode
Instead of smashing unconditionally to 1. Not sure if this fixes anything but it
gets rid of an unknown at least. Possibly slightly faster.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20561>
2023-01-13 19:43:14 +00:00
Bas Nieuwenhuizen
edca10e9c9 aco: Pass correct number of coords to Vega 1D LOD instruction.
If we pass a physical 2D texture descriptor we should also pass 2
coords. Otherwise it just uses the random content in the second
register which ends up funny sometimes.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20696>
2023-01-13 16:55:06 +01:00
t0b3
267dd1f4d5 nir/nir_opt_move: fix ALWAYS_INLINE compiler error
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Closes: #6825
Fixes: f1d20ec6 ("nir/nir_opt_move: handle non-SSA defs ")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17439>
2023-01-13 14:23:35 +00:00
Samuel Pitoiset
5b3fb44ecc radv: fix re-emitting RB+ when the non-compacted color format changes
If the previously emitted graphics pipeline uses the value A for
col_format_non_compacted and the new bound graphics pipeline uses B.

At bind time, radv_cmd_state::col_format_non_compacted will be set to
B and the rbplus flag will be dirtied. But if there is no draws and a
new graphics pipeline is bound with the same value as A, the next
draw will emit the rbplus state with B instead of A.

This can be basically triggered with meta operations after drawing
because the driver saves/restores the bound pipeline.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8073
Fixes: 11469f7553 ("radv: copy the non-compacted color format at pipeline bind time")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20692>
2023-01-13 13:57:40 +00:00
Samuel Pitoiset
ebec42d799 radv: fix hashing pipeline keys if RADV_PERFTEST=ngg_streamout is used
On GFX10-10.3, RADV_PERFTEST=ngg_streamout can be used to replace the
legacy path but it should be in the pipeline key. Otherwise, it's
possible to load legacy shaders from the cache instead of NGG.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20668>
2023-01-13 13:10:12 +00:00
Martin Roukala (né Peres)
aab08fc250 zink/ci: relocate radv testing from radv's gitlab-ci.yml
Zink testing should happen in the layered-backends stage, not the AMD
one.

Suggested-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20677>
2023-01-13 12:20:08 +00:00
Martin Roukala (né Peres)
89a85a8daa zink/ci: add a fail to the VG flake list
It seems to have happened only once so far, but let's be proactive as
an unexpected pass is fatal.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20677>
2023-01-13 12:20:08 +00:00
Martin Roukala (né Peres)
0907fb46ee zink/ci/radv: remove a test from the fails list
It seems `spec@ext_texture_array@fbo-depth-array stencil-draw` got
fixed last week, so let's update the expectations.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20677>
2023-01-13 12:20:08 +00:00
Martin Roukala (né Peres)
d7c1ba0bce ci/piglit: compress results.csv before uploading it to GitLab
The results.csv file of a full piglit run is about 6 MB.

Given how seldomly this file is being used, and the fact that it cannot
be viewed directly in gitlab's artifact page anyway.

Let's compress the file using zstd, and enjoy a ~90% reduction in size
at the cost of probably less than 500ms of compression time on a slow
device, and 55ms on the CI machines in the valve farm.

Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20669>
2023-01-13 11:27:57 +00:00
Martin Roukala (né Peres)
d110299d77 ci/deqp-runner: compress results.csv before uploading it to GitLab
The results.csv file can get ridiculously big for a vkcts run (up to
135MB). Given how seldomly this file is being used, and the fact that
it cannot be viewed directly in gitlab's artifact page anyway.

Let's compress the file using zstd, and enjoy a ~95% reduction in size
at the cost of probably less than 1 second of compression time on even
the slowest of the devices in CI (which would use sharing), and about
150ms on the CI machines in the Valve farm.

Suggested-by: Daniel Stone <daniels@collabora.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20669>
2023-01-13 11:27:57 +00:00
Sergi Blanch Torne
f19f119bae Revert "ci: Collabora's LAVA lab for maintance"
Farm up again

This reverts commit 900ccec7e8fa809ef0a9154db4d0ecec3fe26e9c.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20633>
2023-01-13 09:30:18 +00:00
Sergi Blanch Torne
9a4bd32790 ci: disable Collabora's LAVA lab for maintance
This is to inform you of some planned downtime in the LAVA lab as follows:

    Start: 2023-01-13 08:00 GMT
    End: 2023-01-13 12:00 GMT

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20632>
2023-01-13 08:12:37 +00:00
Samuel Pitoiset
2a5d7f4926 radv: fix missing implementation of creating images from swapchains
These pNext structs are part of VK_KHR_swapchain which is core Vulkan
1.1 but they were missing. Loosely based on ANV.

Passed WSI CTS.

Cc: 22.3 mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7797
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20641>
2023-01-13 07:42:33 +00:00
Lionel Landwerlin
2969850d88 intel/utrace: document tracepoints
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16655>
2023-01-13 01:22:15 +00:00
Lionel Landwerlin
2702159268 intel/ds: remove unused trace point
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16655>
2023-01-13 01:22:15 +00:00
Lionel Landwerlin
4dd3e755ea intel/ds: add INTEL_GPU_TRACEPOINT envvar to toggle tracepoints
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16655>
2023-01-13 01:22:15 +00:00
Lionel Landwerlin
28b15fa9e7 anv: add support for command buffer tagging in traces
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16655>
2023-01-13 01:22:15 +00:00
Lionel Landwerlin
662e05c9fb vulkan/debug_utils: copy debug util labels
The copied structures currently can point to freed memory.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16655>
2023-01-13 01:22:15 +00:00
Lionel Landwerlin
a34fcaf326 util/u_trace: add support for variable length trace points
Use case being :

struct tp {
   ...
   char string[0];
};

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16655>
2023-01-13 01:22:15 +00:00
Lionel Landwerlin
f1ab070d7f intel/ds: move event_id access to perfetto lambda
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16655>
2023-01-13 01:22:15 +00:00
Lionel Landwerlin
f0160ee2ab intel/ds: track secondary cmdbuffers in perfetto
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16655>
2023-01-13 01:22:15 +00:00
Lionel Landwerlin
9a16effeac anv: record secondaries' traces into primaries
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16655>
2023-01-13 01:22:15 +00:00
Lionel Landwerlin
1082c8ad11 pps: print out message when we get the first counters
Mostly for debug purposes, show the first visible counter timestamp.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16655>
2023-01-13 01:22:15 +00:00
Alyssa Rosenzweig
61c7e1bf48 agx: Peephole select after opt_preamble
Reduces control flow in Dolphin uber shaders, which saves us a few cycles.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20597>
2023-01-13 00:43:04 +00:00
Alyssa Rosenzweig
f4b3201244 nir/peephole_select: Allow load_preamble
load_preamble is intended to be almost free (costing at most a move), and it
does not have special bounds checking requirement, so it's ok to select with it.
With this, drivers that use nir_opt_preamble together with a late call to
peephole_select can optimize sequences like:

   if (x) {
      <uniform-on-uniform calculation>
   } else {
      <different uniform-on-uniform calculation>
   }

to simply

   bcsel(x, <uniform register 0>, <uniform register 1>)

rather than emitting needless control flow / branching over some moves.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20597>
2023-01-13 00:43:04 +00:00
Mike Blumenkrantz
f3d046af6a zink: simplify get_slot_components() for xfb emission
multiplying by the array size is always wrong for this case, and not
doing so allows for some simplification and better inlining, though
the output results are identical

the one corner case is clip/cull distance, which need special handling
since they're arrays with vec semantics

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20678>
2023-01-12 23:43:40 +00:00
Pavel Ondračka
3fcdd9e4a7 nir/lower_bool: ntt: Generate a good opcode for bcsel
This is heavily copy-pasted from a patch of Ian Romanick, including the
commit message.

Previously, this pass always generated fcsel for bcsel.  This was the
only place that generate fcsel, so various drivers assumed (and needed!)
that src0 was a Boolean with 0.0 or 1.0 as the only values.

Specifically, many DX9 / GL_ARB_vertex_program platforms lack a CMP
instruction in vertex shaders.  In those cases, they would use LRP to
implement fcsel.  The bummer is that many plaforms have a real fcsel
instruction, and those platforms would benefit from other places
generating that opcode.

Instead of leaving assumptions in drivers about the sources of an opcode
that they can't really support, allow them to control the way the
lowering pass translates bcsel.  Two flags are used to control this:

- If the driver sets has_fused_comp_and_csel in nir_options, fcsel_gt
  will be used.  Since the Boolean value is 0.0 or 1.0, this is
  equivalent to fcsel.

- If the parameter has_fcsel_ne is set, fcsel will be used.  This is the
  old path.

- Otherwise, the lowering pass assumes we're on a crufty, old DX9 vertex
  program, and it emits flrp.

With this, the assumptions about src0 of fcsel in NTT can be removed.
If a platform can't handle fcsel, it should ensure that the lowering
pass won't generate it.

No change in shader-db.

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/20162>
2023-01-12 23:01:05 +00:00
Ian Romanick
36e842839f i915: Enable generation of fcsel_gt and fcsel_ge opcodes
DX9 PS 1.x / GL_ARB_fragment_program shaders that have been converted to
GLSL are littered with patterns like

    ps_r1.x = ((ps_t0.y >= 0.0) ? ps_r1.x : ps_c1.y);

This is because CMP is a fundamental opcode in those earlier shading
languages.  i915 supports this opcode natively, but there's no way to
get it directly into the backend.  Instead, NIR and NTT generate some
combination of fcsel and sge and hope for the best.

i915
total instructions in shared programs: 49032 -> 48897 (-0.28%)
instructions in affected programs: 4173 -> 4038 (-3.24%)
helped: 39
HURT: 0

total temps in shared programs: 2795 -> 2790 (-0.18%)
temps in affected programs: 22 -> 17 (-22.73%)
helped: 5
HURT: 0

total const in shared programs: 4976 -> 4967 (-0.18%)
const in affected programs: 203 -> 194 (-4.43%)
helped: 9
HURT: 0

GAINED: shaders/trine/fp-13.shader_test FS

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20162>
2023-01-12 23:01:05 +00:00
Ian Romanick
cb1ab133ea r300: Enable generation of fcsel_gt and fcsel_ge opcodes
RV530:
total instructions in shared programs: 135032 -> 134833 (-0.15%)
instructions in affected programs: 15654 -> 15455 (-1.27%)
helped: 133
HURT: 13

total temps in shared programs: 17051 -> 17045 (-0.04%)
temps in affected programs: 202 -> 196 (-2.97%)
helped: 11
HURT: 5

RV370:
total instructions in shared programs: 84439 -> 84378 (-0.07%)
instructions in affected programs: 2519 -> 2458 (-2.42%)
helped: 49
HURT: 7

total temps in shared programs: 12399 -> 12380 (-0.15%)
temps in affected programs: 322 -> 303 (-5.90%)
helped: 20
HURT: 10

GAINED: shaders/godot3.4/22-69.shader_test FS

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20162>
2023-01-12 23:01:05 +00:00
Ian Romanick
70b25d9fe8 nir/lower_int_to_float: Add support for i32csel opcodes
These lower naturally to the corresponding fcsel opcodes.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20162>
2023-01-12 23:01:05 +00:00
Ian Romanick
451df66ea0 ntt: Add support for fcsel_gt and fcsel_ge opcodes
These match the TGSI CMP opcode very nicely.  Every driver that uses NTT
for its fragment shader path should be able to enable these opcodes now.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20162>
2023-01-12 23:01:05 +00:00
Dylan Baker
fd927737f5 docs: reset new_features.txt
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20680>
2023-01-12 22:45:38 +00:00
Dylan Baker
45de63b3fd VERSION: bump to 23.1.0-devel for further development
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20680>
2023-01-12 22:45:38 +00:00
Kenneth Graunke
ebdf6a7926 intel/genxml: Drop CACHE_MODE_SS definition.
This is a global register which isn't settable by userspace contexts.
It also shouldn't appear in any of our aubinator decodes from error
states or aub dumps, as no userspace batch should be setting it.

So it's not very valuable to have here.  Just makes us think we can
set it.  Plus, a lot of the field definitions changed a bunch, and
would need updating.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20627>
2023-01-12 21:48:40 +00:00
Konstantin Seurer
18e91ad329 radv: Fix deadlock in radv_rmv_log_event_create
Fixes: 8d0e6c0 ("radv: Add RMV tracing utilities")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20636>
2023-01-12 21:23:39 +00:00
GH Cao
af55e36d79 dzn: Declare debug only root_dwords as ASSERTED
Such variable is only used in assert(), so declare it as ASSERTED.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7885
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7234

Signed-off-by: GH Cao <driver1998.ms@outlook.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20676>
2023-01-12 21:02:23 +00:00
Emma Anholt
f67a0a7745 anv: Add a tracepoint for the fallback implicit sync wait path.
If you're here, you'd really like to know.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20658>
2023-01-12 20:21:03 +00:00
Emma Anholt
25edfcdb2a perfetto: Add the intel data sources to system.cfg.
Now I don't need to remember different perfetto setups depending on which
system I'm profiling.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20658>
2023-01-12 20:21:03 +00:00
Emma Anholt
dbd6031c06 docs/perfetto: Fix the name of the i915 render stages data sources.
Fixes: ef27399bca ("docs: update perfetto with the latest status")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20658>
2023-01-12 20:21:03 +00:00
Adam Jackson
b4d3d11e43 ci: build hasvk if we're building anv
!19355 should never have happened, but we didn't bother to add build
coverage for hasvk when we split it out from anv.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19356>
2023-01-12 18:48:21 +00:00
Konstantin Seurer
329e017300 vulkan/rmv: Only trace on the n-th frame
This makes it stop dumping on every n-th frame. It also uses a simple
increment, since the function is locked.

Fixes: defed48 ("vulkan: Add common RMV tracing infrastructure")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20635>
2023-01-12 18:24:49 +00:00
Friedrich Vock
0b081731cb radv/rmv: Capture names of pipelines but not command buffers
For command buffers, only scratch/upload bos are logged which cannot be attributed to command buffer handles.

Fixes: 5611ab25 ("radv: Add RMV tracing layer")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20647>
2023-01-12 16:42:22 +00:00
Friedrich Vock
681871ade1 radv/rmv: Fix resource ids for name tokens
Fixes: 5611ab25 ("radv: Add RMV tracing layer")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20647>
2023-01-12 16:42:22 +00:00
Pierre-Eric Pelloux-Prayer
ab9a9f702a hud: fix values printing
Oops...

Fixes: 595079c37c ("hud: extract float printf modifer selection logic to helper")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20643>
2023-01-12 16:52:23 +01:00
Pierre-Eric Pelloux-Prayer
63203f94e8 util: add a return value to util_sprintf
The regular sprintf is expected to return the number of char writter,
so let's do the same in our version.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20643>
2023-01-12 16:52:19 +01:00
Filip Gawin
fa227969a3 nv30: add nv49 results
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19696>
2023-01-12 15:11:01 +00:00
Filip Gawin
2b7b0868de r300: don't cache abs in fragment shader
Currently this ends up with unneeded move.

fixes: 63f353b456

Reviewed-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20625>
2023-01-12 14:58:22 +00:00
Simon Ser
2e2775c11b zink: fix PIPE_RESOURCE_PARAM_NPLANES with format modifier
Some format modifiers change the number of planes used by an image.
For instance AMD DCC modifiers uses 2 or 3 planes. However the
format modifier was ignored in the PIPE_RESOURCE_PARAM_NPLANES
get_param hook.

Fix this by using get_dmabuf_modifier_planes() instead of
util_format_get_num_planes().

This fixes wlroots-based compositors under zink.

Signed-off-by: Simon Ser <contact@emersion.fr>
Fixes: c025cb9ee9 ("zink: fix dmabuf plane returns")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20395>
2023-01-12 14:40:30 +00:00
Eric Engestrom
b3f517b988 gen_release_notes: include links in relnotes.rst when generating the new release note
This is required to allow the docs to build, which in turn is required
if we want to allow merge requests against release (staging) branches.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20460>
2023-01-12 14:34:59 +00:00
Eric Engestrom
13af997567 gen_release_notes: allow using the script from another checkout
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20459>
2023-01-12 14:32:10 +00:00
Eric Engestrom
4a2635153c gen_release_notes: avoid crashing when none of the commits mention closing an issue
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20459>
2023-01-12 14:32:10 +00:00
Eric Engestrom
b114debffb gen_release_notes: stop the script if we can't generate the release note
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20459>
2023-01-12 14:32:10 +00:00
Thong Thai
2f70f001a8 frontends/va/postproc: yuv422 to nv12
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Tested-by: Suresh Guttula <suresh.guttula@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19915>
2023-01-12 14:04:48 +00:00
Thong Thai
56eac722bd gallium/auxiliary/vl: compute shaders for progressive yuv
v2: Add a one line offset to the compute shader, to get the
correct output, as suggested by Suresh <Suresh.Guttula@amd.com>.
v3: Add `FALLTHROUGH` to fix a compilation error

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Tested-by: Suresh Guttula <suresh.guttula@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19915>
2023-01-12 14:04:48 +00:00
Thong Thai
49f36f4658 frontends/va/postproc: default to weave when deinterlacing
Signed-off-by: Thong Thai <thong.thai@amd.com>
Tested-by: Marcus Seyfarth <m.seyfarth@gmail.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19915>
2023-01-12 14:04:48 +00:00
Thong Thai
4c46e4a5da gallium/auxiliary/vl: fix scale and translate parameters
Fixes the scale and translate portion of the code to allow for
scale and crop to work properly.

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Tested-by: Marcus Seyfarth <m.seyfarth@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19915>
2023-01-12 14:04:48 +00:00
Corentin Noël
d4f759fefb docs: utilities: Update list of development utilities
Explicitly mention supported APIs and add GFXReconstruct for
Vulkan tracing and debugging.

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/20474>
2023-01-12 13:57:41 +00:00
Corentin Noël
9d9f8a4812 docs: debugging: Fix path to dlist.c
This file has now long being moved to another directory.

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/20474>
2023-01-12 13:57:41 +00:00
Rhys Perry
9112fe3c76 radv/gfx11: increase radeon_check_space for occlusion query begin
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/20652>
2023-01-12 13:37:42 +00:00
Corentin Noël
bee771412c dri: Free the already allocated optionCache and optionInfo on failure
These fields are allocated as they have to be taken into account for initScreen.

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/20663>
2023-01-12 13:11:31 +00:00
Corentin Noël
7e61696de9 dri: Do not free the given screen in initScreen implementation
The given screen is already freed by the caller in case a NULL-pointer is
returned by the implementation.

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/20663>
2023-01-12 13:11:31 +00:00
Corentin Noël
237e73ecca gbm: Avoid leaks on screen creation failures
Some of the code paths were not freeing the allocated strings,
also remove the unused ret variable as we are always returning -1 on failure.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20667>
2023-01-12 12:39:37 +00:00
Erico Nunes
b9835fe6aa lima/ci: add deqp-egl run to the deqp suite
Both wayland and X backends are covered by headless weston, with
X enabled through weston Xwayland.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Acked-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20392>
2023-01-12 10:21:13 +00:00
Erico Nunes
2a4a6aa76f lima/ci: change lima jobs to use deqp-runner suite
Align it with the state of other drivers' ci and make it
easier to enable more tests later.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20392>
2023-01-12 10:21:13 +00:00
Gert Wollny
1af39eda6e r600: Request that state validation is emitted for all changed states
Restricting the state change only to newly used states results in problems,
because SSBOs, Images, and the framebuffers make use of the same limited
set of resources, and not properly unbinding un-used resoureces leads to
invalid rendering and GPU hangs.

Fixes: aaa4b0e6
   st/mesa: move check_program_state code into _mesa_update_state

v2: use new cap name and switched meaning

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

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20493>
2023-01-12 08:34:49 +00:00
Gert Wollny
153af03b94 gallium: Add cap to request state validation for all dirty state
With aaa4b0e6 state validation is no longer called for all changed states,
but only for states that will be active with a new shader program.
Not all drivers support this and might prefer if the state validation
is emitted for all states that might be changed. So add a cap that the
driver can signal one or the other preference, and default to the new
behavior.

Fixes: aaa4b0e6
   st/mesa: move check_program_state code into _mesa_update_state

v2: - Rename cap and and invert its meaning, query the cap
      only once and store it in st, handle the mask update
      when updating the shader i.e. not in st_validate_state (Marek)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20493>
2023-01-12 08:34:49 +00:00
Erik Faye-Lund
e3e74a4402 docs: move note on other drivers to the bottom
This was always meant to be at the bottom of the page. To reduce the
risk of more driver-specific environment variables being added below,
let's add a horizontal rule to mark the difference. This should make it
more clear that this paragraph doesn't belong to the previous heading.

Fixes: c70c5ecd2e ("docs: move generic gallium envvars to root doc")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20644>
2023-01-12 08:11:30 +00:00
Qiang Yu
c412b21d85 ac/nir/ngg: implement 16bit output streamout
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20350>
2023-01-12 03:47:01 +00:00
Qiang Yu
cd22bf90e7 ac/nir/ngg: refine nogs outputs handling
Gather outputs in advance to save both output data and type. Output data
is used for streamout and gfx11 param export. Output type is used for
streamout latter.

The output info will also be used for nir vertex export in the future.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Singed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20350>
2023-01-12 03:47:01 +00:00
Qiang Yu
69d11b6926 ac/nir/ngg: fix gs 16bit output uninitialized channel when gfx11
Fixes: abe2e99e9e ("ac/nir/ngg: gs support 16bit outputs")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20350>
2023-01-12 03:47:01 +00:00
Qiang Yu
3c26fbc934 ac/nir/ngg: fix gs store output for no param offset slot when gfx11
When slot has no param offset, we should not emit store output for
them on gfx11.

Fixes: abe2e99e9e ("ac/nir/ngg: gs support 16bit outputs")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20350>
2023-01-12 03:47:01 +00:00
Qiang Yu
b4695f78ad ac/nir/ngg: always reset output when gs emit vertex
Follow the spec, all outputs even not this stream need to be
reset after emit vertex.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20350>
2023-01-12 03:47:01 +00:00
Qiang Yu
82f45dd5d4 ac/nir/ngg: assert no offset for nogs/gs output handling
As we does not support nogs/gs indirect output, so the offset
is always 0.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20350>
2023-01-12 03:47:01 +00:00
Qiang Yu
4b0ace2585 ac/nir/ngg: gs store output use nir_ssa_def instead of nir_variable
Because we called nir_lower_io_to_temporaries which ensure the
store output and emit vertex in the same block.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20350>
2023-01-12 03:47:01 +00:00
Qiang Yu
0224741ef6 ac/nir/ngg: gs save data type of outputs
Prepare to support 16bit streamout and remove nir_variable output.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20350>
2023-01-12 03:47:01 +00:00
Dave Airlie
417c51a511 lavapipe: fix one more descriptor set reference issue
I thought I'd fixed this already, must have gotten lost in a rebase.

fixes
dEQP-VK.pipeline.pipeline_library.graphics_library.misc.bind_null_descriptor_set.1010

Fixes: 20902d1ed6 ("lavapipe: fix descriptor set layout reference counting in layout merge")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20662>
2023-01-12 13:19:12 +10:00
Dave Airlie
f008a9baa7 ci/lvp: cleanup asan fails
cleanup the remaining file for what actually fails in CI now.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20630>
2023-01-12 01:46:26 +00:00
Dave Airlie
3ec428bb32 vk_cmd_queue: add a callback to free push descriptors set khr
This should clean this up properly.

Fixes: eb7eccc76f ("lavapipe: Use generated command queue code")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20630>
2023-01-12 01:46:26 +00:00
Dave Airlie
ff0433b8cb llvmpipe: unref images correctly in the fragment shader path
fixes a memory leak seen in lavapipe asan tests
dEQP-VK.robustness.robustness2.bind.template.rg32f.unroll.nonvolatile.storage_buffer.readwrite.no_fmt_qual.null_descriptor.samples_1.1d.frag

Fixes: 2909c654b0 ("llvmpipe: add fragment shader image support")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20630>
2023-01-12 01:46:26 +00:00
Dave Airlie
474965adb3 lavapipe: fix merged layout ref counting
When creating a merged layout, don't use ralloc, just use the
correct reference counting, also only reference a layout if the
pipeline uses it.

Fixes: d4d5a7abba ("lavapipe: implement EXT_graphics_pipeline_library")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20630>
2023-01-12 01:46:26 +00:00
Dave Airlie
20902d1ed6 lavapipe: fix descriptor set layout reference counting in layout merge
When taking the descriptor set layouts from the pipeline layout, make
sure to take references

Fixes: d4d5a7abba ("lavapipe: implement EXT_graphics_pipeline_library")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20630>
2023-01-12 01:46:26 +00:00
Dave Airlie
abd7ea2a88 lavapipe: drop unused macro
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20630>
2023-01-12 01:46:26 +00:00
Emma Anholt
0accbe03e8 gallium: Allow copy_region blits with matching formats.
If the blit formats match and the resource formats match, then that's a
memcpy whether or not the blit's view of the resource matches the
resource's format.

Improves perf of portal-2-v2's last frame on zink+anv by 1.33212% +/-
0.302829% (n=5), where there's a blit that is viewing the RGBA8_UNORM
src/dst resources as RGBA8_SRGB.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20594>
2023-01-12 01:04:45 +00:00
Emma Anholt
673837bb8b gallium: Add a unit test for util_can_blit_via_copy_region().
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20594>
2023-01-12 01:04:45 +00:00
Nico Cortes
29adbb132f Revert "intel/compiler: fine-grained control of dispatch widths"
This reverts commit bed18ab3e2.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8063
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20654>
2023-01-12 00:33:25 +00:00
David Heidelberg
a3b0300ef1 ci: make wget even more robust
The future is the curl or wget2, but today we have some issues to kill.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20626>
2023-01-11 23:07:43 +00:00
David Heidelberg
93994f365e ci: propagete robust wgetrc into lava rootfs
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20626>
2023-01-11 23:07:43 +00:00
David Heidelberg
b5e32c6a1c ci: when downgrading from Alpine 3.17 to 3.16, the tag was kept on 3.17
Fixes: 09d5c55836 ("ci: restore reliable Alpine 3.16")

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20626>
2023-01-11 23:07:43 +00:00
David Heidelberg
55135dc82f ci/amd: increase number of stoney runners
Everything up and running.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20626>
2023-01-11 23:07:43 +00:00
Eric Engestrom
c31443901e docs: update calendar for 22.3.3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20648>
2023-01-11 23:00:42 +00:00
Eric Engestrom
f2e54b71b5 docs: add release notes for 22.3.3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20648>
2023-01-11 23:00:42 +00:00
Jason Ekstrand
2e9ce1152e vulkan/wsi: Use the newly imported dma-buf.h
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16987>
2023-01-11 22:33:40 +00:00
Jan Beich
bce3acb135 drm-uapi/dma-buf.h: unbreak on non-Linux via local typedefs
In file included from src/vulkan/wsi/wsi_common_drm.c:34:
include/drm-uapi/dma-buf.h:23:10: fatal error: 'linux/types.h' file not found
 #include <linux/types.h>
          ^~~~~~~~~~~~~~~

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16987>
2023-01-11 22:33:40 +00:00
Jason Ekstrand
fb1c5d547e drm-uapi/dma-buf.h: Update from drm-misc-next (2022-06-10)
From https://cgit.freedesktop.org/drm-misc/

    9cc4853e4781bf0dd0f35355dc92d97c9da02f5d
    Author: Antonio Borneo <antonio.borneo@foss.st.com>
    Date:   Tue Jun 7 23:31:44 2022 +0200

        drm: adv7511: override i2c address of cec before accessing it

This version has the new sync_file import/export ioctls.

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16987>
2023-01-11 22:33:40 +00:00
Alyssa Rosenzweig
4311c636c2 agx: Don't crash trying to encoding minifloats
Fixes assertion fails in piglit isinf-and-isnan, which uses a constant infinity,
which has an out-of-bounds mantissa (but the function contract says that's
fine and we just return something undefined.)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20563>
2023-01-11 21:14:21 +00:00
Alyssa Rosenzweig
7859b531c2 agx: Use BITFIELD64_BIT for outputs_written
Fix by inspection.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20563>
2023-01-11 21:14:20 +00:00
Alyssa Rosenzweig
2976548e4a nir/gather_info: Handle store_zs_agx
This acts as a depth/stencil write. The AGX compiler checks outputs_written to
determine what conservative depth settings the driver needs. Nominally, this
should work: the original store_output(FRAG_RESULT_DEPTH) intrinsic causes the
DEPTH outputs_written bit to be set, so the metadata is still correct after
lowering store_output to store_zs_agx. However, there are a handful of places
that call nir_gather_info late, which *resets* the existing outputs_written
value and regathers, causing Asahi to use the wrong conservative depth settings
when shuffling NIR pass order and breaking gl_FragDepth.

To fix, handle store_zs_agx conservatively when gathering info so we don't have
to play games with the pass order or stashing info in a sideband.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20563>
2023-01-11 21:14:20 +00:00
Alyssa Rosenzweig
93c40e3353 agx: Wire up nir_intrinsic_store_agx
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20558>
2023-01-11 20:36:51 +00:00
Alyssa Rosenzweig
baac17131d agx: Remove load_global(_constant) support
Now lowered in NIR to better instructions than we were selecting.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20558>
2023-01-11 20:36:51 +00:00
Alyssa Rosenzweig
ac3272be84 agx: Use load_global_constant for UBO lowering
Rely on the common address arithmetic optimizations. We don't need the
special formats for UBO loads anyway, so this is simpler and optimizes
out the ushr.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20558>
2023-01-11 20:36:51 +00:00
Alyssa Rosenzweig
3a6a5281b3 agx: Lower global loads/stores to AGX versions
This lets us do all the needed address arithmetic in a central place.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20558>
2023-01-11 20:36:51 +00:00
Alyssa Rosenzweig
cc5ca8164d nir: Add store_agx intrinsic
This works like store_global, but lets us optimize address arithmetic. Like
load_agx, it is formatted to match the hardware semantic. We don't make use of
any clever formats in this series, though.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20558>
2023-01-11 20:36:51 +00:00
Rob Clark
f506dac18f freedreno/a6xx: Demote coherent img access to uncompressed
We cannot use UBWC for coherent access across shader stages.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20612>
2023-01-11 20:09:01 +00:00
Rob Clark
1e22971d92 gallium: Add image volatile/coherent flags
Freedreno needs to know when an image has volatile or coherent access
flags in the shader.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20612>
2023-01-11 20:09:01 +00:00
Rob Clark
5fb0992a53 mesa/st: Track complete access qualifier for images
Don't turn gl_access_qualifier coming from NIR back into GL enums,
losing information in the process.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20612>
2023-01-11 20:09:01 +00:00
Sil Vilerino
e8e7f06f10 d3d12: implement the get_decoder_fence vfunc
Implement the get_decoder_fence vfunc. Note that the waiting for
completion in this driver happens in the end_frame vfunc itself.

Signed-off-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20133>
2023-01-11 19:34:33 +00:00
Daniel Almeida
5e1bd07ac5 radeonsi: vcn: implement the get_decoder_fence vfunc
Implement the get_decoder_fence vfunc by waiting on the fence
previously passed in the end_frame vfunc.

Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20133>
2023-01-11 19:34:33 +00:00
Daniel Almeida
01a5de1b95 radeonsi: uvd: implement the get_decoder_fence vfunc
Implement the get_decoder_fence vfunc by waiting on the fence
previously passed in the end_frame vfunc.

Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20133>
2023-01-11 19:34:33 +00:00
Daniel Almeida
435139d196 r600: uvd: implement the get_decoder_fence vfunc
Implement the get_decoder_fence vfunc by waiting on the fence
previously passed in picture->fence in the end_frame vfunc.

Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20133>
2023-01-11 19:34:33 +00:00
Daniel Almeida
8187b35fa1 virgl: video: implement the get_decoder_fence vfunc
Implement the get_decoder_fence vfunc by waiting on the fence
previously passed in picture->fence in the end_frame vfunc.

Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20133>
2023-01-11 19:34:33 +00:00
Daniel Almeida
4246bcfc7a frontends: va: fix vaQuerySurfaceStatus and vaSyncSurface for decode
Use the new get_decoder_fence vfunc to  implement
vaQuerySurfaceStatus and vaSyncSurface in the va state tracker.

A pointer to the surface's fence is passed to the codecs before the
end_frame vfunc and the codec is responsible for allocating a fence on
command stream submission.

This fence is then queried on vaQuerySurfaceStatus and waited on in
vaSyncSurface.

Notably both functions were not implemented as per the VA-API docs for
PIPE_VIDEO_ENTRYPOINT_BITSTREAM.

Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20133>
2023-01-11 19:34:33 +00:00
Daniel Almeida
3a0d1f9fdc gallium: pipe: add PIPE_DEFAULT_DECODER_FEEDBACK_TIMEOUT_NS
Add PIPE_DEFAULT_DECODER_FEEDBACK_TIMEOUT_NS as a way to control
how much to wait for decoders if this is supported.

Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20133>
2023-01-11 19:34:33 +00:00
Daniel Almeida
9d583719e9 gallium: pipe: add get_decoder_fence vfunc
Add a get_decoder_fence vfunc that can be used to query the status
of the previous decode job denoted by 'fence' given 'timeout'.

A pointer to a fence pointer can be  passed to the codecs before the
end_frame vfunc and the codec should then be responsible for allocating
a fence on command stream submission.

Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20133>
2023-01-11 19:34:33 +00:00
Rob Clark
1b8bed38eb freedreno/a6xx: Remove shader key from fd6_emit
Only construct the key on-demand if the PROG state is dirty.  The newly
added "virtual" PROG_KEY state is used to know when other state that the
shader key depends on changes.  Worth ~13% at drawoverhead test 0.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20572>
2023-01-11 19:06:17 +00:00
Rob Clark
7b734cc668 freedreno/a6xx: Avoid zero-init fd6_emit
A pretty significant amount of time spent in fd6_draw_vbo is calling
memset to zero init the on-stack struct.  And a big part of the size
of the struct is fd6_state, of which we only need to initialize
num_groups to zero.  This is worth a 15% improvement in drawoverhead
test 0 ("no state change").

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20572>
2023-01-11 19:06:17 +00:00
Rob Clark
dfd16c489a freedreno/a6xx: Tighten up fd6_emit
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20572>
2023-01-11 19:06:17 +00:00
Rob Clark
2128607014 freedreno/a6xx: Move fb_read descriptor to fd6_gmem
We already overwrote the entire descriptor in patch_fb_read_sysmem().
Doing the same in patch_fb_read_gmem() will simplify things for moving
the fb_read descriptor to the FS's bindless descriptor set.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20572>
2023-01-11 19:06:17 +00:00
Rob Clark
1452451185 freedreno/a6xx: Split out fd6_state
Split out the build-up of CP_SET_DRAW_STATE packet, as we are going to
want to re-use this for compute state later when we switch to bindless
IBO descriptors.

While we are at it, drop the enable_mask param, as this is determined
solely by the group_id, and it is easier to maintain a table for the
handful of exceptions to ENABLE_ALL.  The compiler should be able to
optimize away the table lookup.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20572>
2023-01-11 19:06:17 +00:00
Rob Clark
c73a76195c freedreno/a6xx: Rename fd6_emit_3d_state()
To better reflect this is emitting 3d state, and to avoid a name
conflict in the next patch.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20572>
2023-01-11 19:06:17 +00:00
Eric Engestrom
417a10fcb1 wsi/meson: add missing dep
Same thing as https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20530:
newly added `src/vulkan/util/rmv/vk_rmv_tokens.h` (see !17331) includes
`src/util/` files, so anything that includes it needs `idep_mesautil`.

    In file included from ../src/vulkan/util/rmv/vk_rmv_common.h:29,
                     from ../src/vulkan/runtime/vk_device.h:26,
                     from ../src/vulkan/wsi/wsi_common.c:31:
    ../src/util/simple_mtx.h:34:12: fatal error: valgrind.h: No such file or directory
       34 | #  include <valgrind.h>
          |            ^~~~~~~~~~~~
    compilation terminated.

Fixes: 5f30a7538b ("vulkan: Add RMV token definitions")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20642>
2023-01-11 18:24:16 +00:00
Samuel Pitoiset
e11e68b56b radv,aco: fix enable_mrt_output_nan_fixup for RAGE2 again
Driver workarounds for game bugs can be easily broken. This one
shouldn't be applied to meta shaders and this restores previous logic.

Fixes: da32cbb5c6 ("aco: fix missing uses of MRT output flags")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20637>
2023-01-11 15:55:32 +00:00
David Heidelberg
38d6185432 ci: debian-build-testing, build only the LTO variant
The chance we'll miss anything from non-LTO is minimal, and having
both builds in one is too slow (usually the latest job to finish).

Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Acked-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20623>
2023-01-11 13:22:35 +00:00
Erik Faye-Lund
f44bd88c9d docs: fixup envvar-directive syntax
This directive needs a newline following it to render correctly.

While we're at it, fixup the incorrect indent for one of the
descriptions.

Fixes: 0c58ad3e32 ("docs: use envvar directive more")
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20640>
2023-01-11 13:37:07 +01:00
Marcin Ślusarz
0c58ad3e32 docs: use envvar directive more
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20638>
2023-01-11 11:56:05 +00:00
Iago Toral Quiroga
c2200a410b v3dv: expose VK_KHR_shader_integer_dot_product
NIR will automatically lower all of these opcodes unless the driver
specifies that it can handle them natively. We don't have any hardware
support for any of these opcodes though, so we just let NIR lower
all of them.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20639>
2023-01-11 11:23:14 +00:00
Iago Toral Quiroga
22ef66bcc9 v3d/compiler: remove unused sample_coverage field from fs key.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20634>
2023-01-11 10:54:05 +00:00
Iago Toral Quiroga
09782e5e6d v3dv: fix alpha-to-one for single sample setup
In Vulkan this is expected to work with single sample scenarios too.

Fixes new test in CTS main:
dEQP-VK.pipeline.monolithic.multisample.alpha_to_one.samples_1

cc: mesa-stable

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20634>
2023-01-11 10:54:05 +00:00
Iago Toral Quiroga
f40afe9883 v3d: add a debug option to optimize shader compile times
Particularly, this makes compilation stop as soon as we get a
valid shader and doesn't try to optimize spilling by trying
fallback strategies.

Might come in handy to reduce CTS execution time, for example,
dEQP-VK.ssbo.layout.random.8bit.all_per_block_buffers.6 goes from
43m46.715s down to 15m15.068s.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20601>
2023-01-11 10:25:28 +00:00
Jesse Natalie
dee97e7b99 dzn: Allow multiple graphics queues
There's no real reason not to, WDDM supports it. It's not really that
useful, but I don't expect most apps to really want to do it anyway.
It does enable some useful synchronization scenarios sometimes.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16200>
2023-01-11 09:31:02 +00:00
Boris Brezillon
5f1b8b3e6c dzn: Use DXGI swapchains
Makes things so much faster than doing CPU copies using StretchBlt().

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16200>
2023-01-11 09:31:02 +00:00
Boris Brezillon
2f462105fa vulkan/wsi: Hook-up DXGI swapchains and DComp
The CPU copy is horribly slow, so let's hook-up DXGI swapchains. Note
that we're still limited in term of features. For instance, we can't
support more than 2 images per swapchain because of the DXGI present
ordering constraint. We also have to do an extra copy, because DXGI
only allows rendering to a resource on the queue that the swapchain
was created against, but swapchains in Vulkan don't have a queue.

The swapchain is bound to the window using DirectComposition aka
DComp. The DComp infrastructure is set up in the surface, and is
transitioned from one swapchain to the next when the new swapchain
begins presenting.

Unlike Wayland and X, there's no requirement that the compositor has
to release a surface before you can start rendering against it. However,
since we're now supporting the non-sw path, we do need to prevent apps
from rendering to a resource *while* the blit is occurring. We do this
by blocking for a fence while acquiring an image.

Co-authored-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16200>
2023-01-11 09:31:02 +00:00
Jesse Natalie
e4d81c05ea vulkan/wsi: Port Win32 WSI to C++
In a future commit we'll want to be able to use DirectComposition
in the Win32 WSI layer, and unfortunately DComp doesn't have a C-
compatible header (despite being COM, it uses function overloads
and has references instead of pointers for some functions).

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16200>
2023-01-11 09:31:02 +00:00
Boris Brezillon
a40913b3e0 vulkan/wsi: Allow platform code to define extra dependencies
Needed for the windows platform if we want to hook up DXGI swapchains.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16200>
2023-01-11 09:31:02 +00:00
Boris Brezillon
2975a7f453 vulkan/wsi: Add support for image -> image blits
The win32 swapchain can be backed by a DXGI swapchain, but such swapchains
are incompatible with STORAGE images (AKA UNORDERED_ACCESS usage in
DXGI). So, we need to allocate an intermediate image that will serve as
a render-target, and copy this image to the WSI image when QueuePresent()
is called. That's pretty similar to what we do for the buffer blit case,
except the image -> buffer copy is replaced by an image -> image copy.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16200>
2023-01-11 09:31:02 +00:00
Boris Brezillon
65e4873d82 vulkan/wsi: Dissociate the blit context and image configuration steps
Even if all implementations wsi_configure_buffer_image() will need to
configure the image as well, it feels a bit weird to call
wsi_configure_image() from there, so let's the
wsi_configure_buffer_image() users call wsi_configure_image() too.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16200>
2023-01-11 09:31:02 +00:00
Boris Brezillon
fa4e729165 vulkan/wsi: Prepare things for image to image blits
Right now, the WSI core supports copying WSI images to a linear buffer
for implementations that want the result in this form. This being said,
most of the blit logic can be re-used for image to image copies, and that's
exactly what we'll need if we want to hook-up DXGI swapchains in the
win32 WSI implementation. So let's rename a few fields so we no longer
imply that images are copied to a buffer, and the use_buffer_blit boolean
an enum so we can extend the implementation to support image -> image
copies.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16200>
2023-01-11 09:31:02 +00:00
Boris Brezillon
bbcbf2cd91 vulkan/wsi: Don't set use_buffer_blit manually in the win32 WSI logic
We can simply pass use_buffer_blit=true to wsi_swapchain_init().

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16200>
2023-01-11 09:31:02 +00:00
Boris Brezillon
5fb2adb8fd vulkan/wsi: Simplify wsi_win32_surface_create_swapchain() error path
We are about to add more to this function, so let's try to automate
the cleanup steps in the error path. Incrementing image_count as
we add new images to the swapchain allows us to call
wsi_win32_swapchain_destroy() even if not all images were initialized.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16200>
2023-01-11 09:31:02 +00:00
Boris Brezillon
52c87d0b83 vulkan/wsi: Indent fixes in ws_common_win32.c
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16200>
2023-01-11 09:31:02 +00:00
Jesse Natalie
a67f5f32a8 meson: Define VK_USE_PLATFORM_WIN32_KHR for C++
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16200>
2023-01-11 09:31:02 +00:00
Samuel Pitoiset
9ff54a52ec docs: update new_features.txt for additional work with RADV
This release (23.0) contains less features than usual but the last
branchpoint was delayed and we had end of year holidays.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20609>
2023-01-11 08:52:26 +00:00
Marcin Ślusarz
bed18ab3e2 intel/compiler: fine-grained control of dispatch widths
Reviewed-by: Matt Turner <mattst88@gmail.com> [v1]
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20535>
2023-01-11 08:17:12 +00:00
Yiwei Zhang
bf3112805c ci/venus: re-enable venus-lavapipe
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19542>
2023-01-11 07:34:32 +00:00
Yiwei Zhang
3c91168c71 ci/venus: specify render server path to enable server config
The render server path is required by crosvm to enable render server.

v2: updated script to package server binary properly

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com> (v1)
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19542>
2023-01-11 07:34:32 +00:00
Yiwei Zhang
e86c99bb28 ci: uprev virglrenderer
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19542>
2023-01-11 07:34:32 +00:00
Giancarlo Devich
f13a42e5a1 Fix incorrect stage reference
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20616>
2023-01-11 07:18:42 +00:00
Giancarlo Devich
63345d59b0 d3d12: Unionize shader variables in d3d12_shader_key to reduce size
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20616>
2023-01-11 07:18:42 +00:00
Friedrich Vock
e1cbff228a docs: Add short documentation about RMV tracing variables
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17331>
2023-01-11 06:55:04 +00:00
Friedrich Vock
e624494c0f radv: Enable RMV tracing
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17331>
2023-01-11 06:55:04 +00:00
Friedrich Vock
abf3bcd6ea radv: Add RMV resource tracking
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17331>
2023-01-11 06:55:04 +00:00
Friedrich Vock
5611ab25d1 radv: Add RMV tracing layer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17331>
2023-01-11 06:55:04 +00:00
Friedrich Vock
8d0e6c02c7 radv: Add RMV tracing utilities
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17331>
2023-01-11 06:55:04 +00:00
Friedrich Vock
d816859ede radv: Use internal allocation helpers for internal allocations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17331>
2023-01-11 06:55:04 +00:00
Friedrich Vock
845792db73 vulkan: Add RMV file exporter
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17331>
2023-01-11 06:55:04 +00:00
Friedrich Vock
defed48104 vulkan: Add common RMV tracing infrastructure
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17331>
2023-01-11 06:55:04 +00:00
Friedrich Vock
5f30a7538b vulkan: Add RMV token definitions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17331>
2023-01-11 06:55:04 +00:00
Mike Blumenkrantz
b2739c9f00 zink: set surface->dt when updating swapchain
this otherwise re-creates swapchain surfaces on every frame and has
a significant perf hit for no reason

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20613>
2023-01-11 06:22:07 +00:00
Giancarlo Devich
54088f4bb5 d3d12: Reuse sampler tables inside of a batch
If a shader's sampler state is dirty often, the sampler descriptor heap
can get used up quickly, forcing flushing. If that happens quickly, we
run out of batches and have to wait for batches to finish on the GPU.

When this happens, it is often because the sampler state is switching,
not because it's truly unique. This change hashes and saves sampler
descriptor tables that can be reused in subsequent draws in the same
batch, instead of re-copying the same descriptors and consuming the
heap.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20618>
2023-01-11 05:22:45 +00:00
Charmaine Lee
32b23d8fb2 svga: fix max number of texture cube levels
The maximum number of mipmap levels supported for cubemap can be
determined from the maximum 2D texture size. There is no need
to limit the max to 12.

This fixes a regression in creating GL4.1 and up context since
commit 2658d02516 is now explicitly checking for
MaxCubeTextureLevels >= 15 for GL4.1 context.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20600>
2023-01-11 02:31:14 +00:00
Emma Anholt
1aa163ebb5 anv: Print the BO sizes in KB instead of hex bytes.
We already show the address range, which is most of why I'd think you'd be
looking at hex values.  I find a more human-readable number nice for
debugging, instead of counting zeroes to decide if it's 1.5MB or 96kb.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20540>
2023-01-11 00:35:34 +00:00
Emma Anholt
38e29fe712 anv: Fix the size/aperture space debug printouts to consider _ccs_size.
It's added in at anv_bo_vma_alloc_or_close(), so count it here too.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20540>
2023-01-11 00:35:34 +00:00
Emma Anholt
e937c4b716 anv: Add an aperture space summary to INTEL_DEBUG=submit.
Same as on iris, this is nice for tracking at a high level how much memory
is being used.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20540>
2023-01-11 00:35:34 +00:00
Pavel Ondračka
7ab7b9770e r300: allow more copy propagation with relative addressing
We are now extremelly careful when copy propagating a mov that uses
relative addressing. The search for readers will trigger abort when it
sees any other instruction using a relative addressing, irrespective of
the actual used registers or whether an address register load was seen.

Additionally, since ntt switch all movs using the relative addressing are
actually used only once right on the next line, and are result of ntt converting

vec4 32 ssa_10 = intrinsic load_ubo_vec4 (ssa_0, ssa_9) (access=0, base=11, component=0)

into

  5: ARL ADDR[0].x, TEMP[0].xxxx
  6: MOV TEMP[2], CONST[0][ADDR[0].x+11]

RV530 shader-db:
total instructions in shared programs: 132966 -> 131904 (-0.80%)
instructions in affected programs: 29896 -> 28834 (-3.55%)
helped: 234
HURT: 2
total temps in shared programs: 16969 -> 16905 (-0.38%)
temps in affected programs: 604 -> 540 (-10.60%)
helped: 68
HURT: 12

Partial fix for: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7723

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/20577>
2023-01-11 00:20:47 +00:00
Georg Lehmann
2b28983c5d aco: Use NSA on GFX11 with more than 5 vaddr registers.
On GFX11 the first 4 vaddr are single registers and the last contains the remaining vector.
image_bvh64_intersect_ray has a special NSA layout.

Foz-DB GFX1100:
Totals from 2763 (2.05% of 134913) affected shaders:
VGPRs: 145884 -> 145056 (-0.57%); split: -1.03%, +0.46%
CodeSize: 18406864 -> 18326136 (-0.44%); split: -0.47%, +0.04%
MaxWaves: 76030 -> 76146 (+0.15%)
Instrs: 3559785 -> 3525287 (-0.97%); split: -0.97%, +0.00%
Latency: 44278460 -> 43303419 (-2.20%); split: -2.33%, +0.13%
InvThroughput: 4966295 -> 4914927 (-1.03%); split: -1.04%, +0.01%
VClause: 51755 -> 51991 (+0.46%); split: -0.05%, +0.50%
SClause: 105241 -> 105267 (+0.02%); split: -0.08%, +0.10%
Copies: 214141 -> 182419 (-14.81%); split: -14.82%, +0.01%
Branches: 69525 -> 69521 (-0.01%)
PreVGPRs: 120910 -> 120256 (-0.54%); split: -0.56%, +0.02%

No changes on Navi21.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20370>
2023-01-11 00:00:38 +00:00
Georg Lehmann
9538d523b6 aco: Validate GFX11 NSA correctly.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20370>
2023-01-11 00:00:38 +00:00
Georg Lehmann
9abe4850ba aco: Handle NSA with vectors in get_mimg_nsa_dwords.
No Foz-DB changes.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20370>
2023-01-11 00:00:38 +00:00
Pierre-Eric Pelloux-Prayer
1ab80eb061 mesa: add missing count_scale attributes
The EXT_gpu_program_parameters spec says:

   <params> points to an array of 4*<count> values

for both functions.

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20603>
2023-01-10 23:14:54 +00:00
Pierre-Eric Pelloux-Prayer
37dcd18331 mesa: add missing count_scale attribute
The EXT_gpu_program_parameters spec says:

   <params> points to an array of 4*<count> values

Fixes: a4e935f2d7 ("mesa: add EXT_dsa + EXT_gpu_program_parameters functions")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7943
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8025
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20603>
2023-01-10 23:14:54 +00:00
Erik Faye-Lund
a84c40c6a4 zink: lower stipple + smooth
We can use the new functionality in the draw-helper to implement
stippled smooth lines instead of what we currently do, which is aliased
stipping on smooth lines.

Reviewed-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20134>
2023-01-10 22:50:07 +00:00
Erik Faye-Lund
c69637a2a5 gallium/draw: support lowering stipple + smooth
When computing line smoothing, we can also do something similar to
compute the line stippling. This can be useful for some drivers, who
can't easily split the lines before rasterizing them.

This does lead to slightly inaccurate stippling, because the
line-smoothing extends the line-length by a small amount. That leads to
the line-stippling pattern being over-stretched over the line-segment by
a fraction of a pixel in lenght. For short lines, this can be quite a
lot of error.

Reviewed-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20134>
2023-01-10 22:50:07 +00:00
Eric Engestrom
180e30857c egl: const display & config pointers in eglGetConfigAttrib()
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20567>
2023-01-10 22:23:06 +00:00
Eric Engestrom
f83a0e0a14 egl: inline _eglReportError(), and drop this and all the other unused defines
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20565>
2023-01-10 21:54:37 +00:00
Marek Olšák
3632d39835 radeonsi: rewrite si_update_ps_colorbuf0_slot to fix crashes and recursions
I'm convinced that u_blitter interactions with fbfetch can't be handled
in si_update_ps_colorbuf0_slot alone, so it has to be force-disabled
by si_blitter_begin. Another reason why it has to be disabled for u_blitter
and not ignored is because FBFETCH with MSAA enables sample shading
regardless of context states, and we don't want that for u_blitter.

Also, si_update_ps_colorbuf0_slot now disables FBFETCH explicitly before
its own DCC and CMASK decompression because even though u_blitter can't do
anything (due to blitter_running), si_blitter_end calls it too.

The result is that no recursion can occur thanks to the blitter_running
and suppress_update_ps_colorbuf0_slot flags, and FBFETCH is always
force-disabled before those flags are set, which is the state we want
to be in.

Fixes: bc6d22b920 ("radeonsi: fix ps_uses_fbfetch value")

Acked-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/20318>
2023-01-10 21:26:39 +00:00
Guilherme Gallo
8bc51d78a5 ci/lava: Tweak LAVA jobs timeouts
The Mesa CI LAVA job submitter was suffering from a bug in the LAVA
software that made their timeouts related to sub-actions unreliable,
such as waiting for the user login prompt automatic response.

The following MR
https://git.lavasoftware.org/lava/lava/-/merge_requests/1900 fixed this
issue. So we can now better control job timeouts granularity, failing
the job faster when there is something weird hanging the boot stage.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20596>
2023-01-10 20:10:49 +00:00
Guilherme Gallo
bbdbf0862c ci/lava: Update lavacli version
- Use new YAML loader derived from ruamel.yaml
- Remove PyYAML dependency from LAVA job submitter package

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20596>
2023-01-10 20:10:49 +00:00
Yiwei Zhang
b1f759e750 ci/venus: temporarily disable due to instability
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20622>
2023-01-10 19:55:07 +00:00
Lucas Stach
54f583738e etnaviv: hide TS sharing behind debug option
TS sharing isn't fully stable yet. There are some fixes pending, but they
don't take care of all reported issues. Hide TS sharing behind a debug
switch until all the known issues are resolved.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20606>
2023-01-10 19:38:37 +00:00
Dylan Baker
9572ecbee9 docs: Add calendar entries for 23.0 release candidates.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20619>
2023-01-10 09:59:12 -08:00
Eric Engestrom
a2f954f467 broadcom/ci: drop duplicate job definition
See line 48 above.

Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20605>
2023-01-10 17:15:16 +00:00
Rhys Perry
b1e59646de aco/gfx11: increase vgpr_limit to 256
fossil-db (gfx1100):
Totals from 280 (0.21% of 134574) affected shaders:
MaxWaves: 3124 -> 2846 (-8.90%); split: +3.46%, -12.36%
Instrs: 1139038 -> 1091407 (-4.18%); split: -4.18%, +0.00%
CodeSize: 5809332 -> 5486812 (-5.55%); split: -5.55%, +0.00%
VGPRs: 35004 -> 42864 (+22.45%); split: -1.85%, +24.31%
SpillSGPRs: 1896 -> 1865 (-1.64%); split: -2.37%, +0.74%
SpillVGPRs: 17807 -> 2382 (-86.62%)
Scratch: 2573312 -> 736256 (-71.39%)
Latency: 27470485 -> 17981296 (-34.54%); split: -34.54%, +0.00%
InvThroughput: 5606102 -> 6527051 (+16.43%); split: -4.19%, +20.61%
VClause: 32319 -> 19927 (-38.34%); split: -39.13%, +0.78%
SClause: 15014 -> 14897 (-0.78%); split: -0.95%, +0.17%
Copies: 102977 -> 93511 (-9.19%); split: -9.93%, +0.74%
Branches: 15164 -> 14969 (-1.29%)
PreSGPRs: 19132 -> 19014 (-0.62%)
PreVGPRs: 30494 -> 37460 (+22.84%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20251>
2023-01-10 16:01:38 +00:00
Rhys Perry
6872f8d861 aco/gfx11: allow true 16-bit instructions to access v128+
It looks like the LLVM assembler promotes true 16-bit instructions to VOP3
in this case.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20251>
2023-01-10 16:01:38 +00:00
Rhys Perry
254b178d5b aco: disallow SGPRS/constants with interpolation instructions
https://reviews.llvm.org/D137575

The VINTRP format cannot encode anything except VGPRs.

Reading VINTERPInstructions.td, looks like it's the same for GFX11.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20251>
2023-01-10 16:01:38 +00:00
Rhys Perry
5af891a747 aco: add more opcodes to can_use_DPP()
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20251>
2023-01-10 16:01:38 +00:00
Rhys Perry
c3dd1931d9 aco: allow Builder::Result to be dereferenced
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20251>
2023-01-10 16:01:38 +00:00
Rhys Perry
e386523380 aco/gfx11: fix discard early exit removal optimization
This optimization never happened because the NULL target was removed in
GFX11.

fossil-db (gfx1100):
Totals from 5439 (4.04% of 134574) affected shaders:
Instrs: 407865 -> 387123 (-5.09%)
CodeSize: 2163340 -> 2060644 (-4.75%)
Latency: 3432378 -> 3327802 (-3.05%)
InvThroughput: 270133 -> 262980 (-2.65%)
Branches: 8524 -> 3085 (-63.81%)

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/20513>
2023-01-10 14:01:29 +00:00
Pedro J. Estébanez
9d814c405b microsoft/spirv_to_dxil: Let linking report the need of runtime data
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20608>
2023-01-10 13:43:01 +00:00
Lucas Stach
6481805e00 etnaviv: properly check for new clear value in sampler TS setup
Comparing the 64bit clear value to the lower half 32bit clear state is
obviously wrong and results in a lot of false positives.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20586>
2023-01-10 13:02:36 +00:00
Lucas Stach
03fdcbba19 etnaviv: blt: properly use upper half of clear value
Instead of replicating the lower half of the clear value, properly
use the upper half to program the second clear value BLT state.

CC: mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20586>
2023-01-10 13:02:36 +00:00
Danylo Piliaiev
a358890667 ir3/print: Consider the size of input when matching it to a reg
First component of the input may never be read, so we have to find
the first component of the input which is being read.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20533>
2023-01-10 12:37:19 +00:00
Danylo Piliaiev
d474cc935e ir3: Force flat.b sources to be equal
From cc29b940 according to Jonathan Marek using 2 immediates in a cat2
instruction is only "correct" if they are both equal.

They were not equal after reassigning of packed inlocks.

flat.b seemed to work fine even with imm values being different,
but better not to risk.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20533>
2023-01-10 12:37:19 +00:00
Danylo Piliaiev
a45d32b10b tu: Fix varyings interpolation reading stale values
tu6_vpc_varying_mode returned how many bits are consumed IF they are
non-zero, for SMOOTH mode nothing is written and it was treated like
no bits were consumed.

When input with smooth interpolation was the last one and straddled
the VPC_VARYING_INTERP_MODE regs, the last interp mode were not written.

Fixes misrendering in "Psychonauts 2".

Cc: mesa-stable

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20533>
2023-01-10 12:37:19 +00:00
Michel Dänzer
25a151533c loader/dri3: Overhaul draw->cur_num_back handling
draw->cur_num_back is no longer used for immediately reducing the number
of allocated back buffers. It just reflects how many of them are
currently allocated, and is used to prevent allocating more if the
current maximum is already reached.

This fixes an issue where the current in-progress back buffer could get
freed, which would result in visible artifacts.

Unused buffers are freed once they exceed buffer age 200. This ensures
we do not keep around more buffers than necessary in the long run.

v2:
* Drop buffer age threshold to 200. This will free unused buffers more
  quickly, and seems enough to avoid doing so prematurely even with
  "glxgears -fullscreen" running at thousands of frames per second.
* Use "buf_id != LOADER_DRI3_FRONT_ID". (Pierre-Eric Pelloux-Prayer)
* Simplify loader_dri3_get_buffers changes slightly.
* We can now use any unallocated back buffer slot in dri3_find_back.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20385>
2023-01-10 10:44:17 +00:00
Michel Dänzer
27366cb510 loader/dri3: Add dri3_set_render_buffer helper
Preparation for next commit, no functional change intended.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20385>
2023-01-10 10:44:17 +00:00
Michel Dänzer
5d25a4cab4 loader/dri3: Move NULL handling into dri3_free_render_buffer
Both checking for draw->buffers[buf_id] being non-NULL, and setting
draw->buffers[buf_id] = NULL.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20385>
2023-01-10 10:44:17 +00:00
Samuel Pitoiset
6e888f6159 radv: enable PS epilogs on-demand for some dynamic states
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20201>
2023-01-10 09:55:29 +00:00
Samuel Pitoiset
eb07a11b8f radv: add support for compiling PS epilogs on-demand
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20201>
2023-01-10 09:55:29 +00:00
Samuel Pitoiset
11469f7553 radv: copy the non-compacted color format at pipeline bind time
For PS epilogs on-demand.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20201>
2023-01-10 09:55:29 +00:00
Samuel Pitoiset
bbd7f70073 radv: rework PS epilog emission
With PS epilogs compiled on-demand (for some dynamic states), they need
to be emitted outside of the graphics pipeline path. Also keep track
of the last emitted PS epilog to avoid redundant emission.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20201>
2023-01-10 09:55:29 +00:00
Samuel Pitoiset
7de50e4c6c radv: keep track of SPI_SHADER_COL_FORMAT for PS epilogs
To emit the related register.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20201>
2023-01-10 09:55:29 +00:00
Samuel Pitoiset
c9f30c4aa0 radv: enable the PS epilogs cache when some ds3 states are enabled
These dynamic states need to compile PS epilogs on-demand.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20201>
2023-01-10 09:55:29 +00:00
Samuel Pitoiset
75b0d6de04 radv: add support for a PS epilogs cache in the device
Similar to VS prologs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20201>
2023-01-10 09:55:29 +00:00
Eric Engestrom
c0f95913a0 ci/rpi4: add a couple of tests as flaky
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20591>
2023-01-10 09:03:28 +00:00
Eric Engestrom
7931b4026f ci/rpi3: add another test variant (draw-copypixels-sync) as flaky
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20591>
2023-01-10 09:03:28 +00:00
Erik Faye-Lund
28d6caad60 gallium/draw: assert shader-stage
Nobody calls this for the wrong shader-stage. Let's turn that check into
an assert instead.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20096>
2023-01-10 08:22:17 +00:00
Erik Faye-Lund
7c1b9ee6b7 gallium/draw: use nir_shader_instructions_pass for nir_lower_aaline_fs
This just cuts away some needless boilerplate code.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20096>
2023-01-10 08:22:17 +00:00
Samuel Pitoiset
3897a233fb radv: add a new dirty flag for the RB+ state
With PS epilogs on-demand, the non-compacted color format field won't
come from the pipeline and it seems easier to introduce a new dirty
flag for re-emitting this state.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18552>
2023-01-10 07:59:33 +00:00
Yiwei Zhang
f1e06b46a9 lvp: avoid redundant sampler views and image views
Align the sampler view creation condition with the image and buffer
creation usage which maps to PIPE_BIND_SAMPLER_VIEW, which fixes the spam
of "Illegal sampler view creation without bind flag". Also fix the
PIPE_BIND_SHADER_IMAGE assignment for image usage bits and avoid setting
the image view struct if without PIPE_BIND_SHADER_IMAGE.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20580>
2023-01-10 05:49:34 +00:00
Mike Blumenkrantz
f18827e015 zink: stop using VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT
this used to be fine back when there was only one thread doing cache management,
but now the cache is used by precompile threads too, so let the driver do sync

fixes #7660

Fixes: 41ffb15de5 ("zink: implement async gfx precompile")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20519>
2023-01-10 05:33:10 +00:00
Alyssa Rosenzweig
2e9ac9278c agx: Remove obsolete comment
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20559>
2023-01-10 05:19:25 +00:00
Alyssa Rosenzweig
90dea84ef6 agx: Remove dead arg
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20559>
2023-01-10 05:19:25 +00:00
Alyssa Rosenzweig
17d1559036 agx: Use i0/i1 variables
Now that we've defined them.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20559>
2023-01-10 05:19:25 +00:00
Alyssa Rosenzweig
1e61f13ffd agx: Get rid of emit_alu_bool
Deduplicate lots of cases. Splitting this out was silly, bools aren't that
special.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20559>
2023-01-10 05:19:25 +00:00
Alyssa Rosenzweig
5b25ee6cc7 agx: Use agx_subdivide_to for umul_high
Helpers!

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20559>
2023-01-10 05:19:25 +00:00
Alyssa Rosenzweig
f6c5b2a5a3 agx: Remove dead code
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20559>
2023-01-10 05:19:25 +00:00
Dmitry Osipenko
dd571ede85 docs/envvars: Document MESA_DISK_CACHE_COMBINE_RW_WITH_RO_FOZ
Add documentation for the MESA_DISK_CACHE_COMBINE_RW_WITH_RO_FOZ environment
variable.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Juston Li <justonli@google.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20595>
2023-01-10 04:53:44 +00:00
Dmitry Osipenko
6c1c5d9ef0 util/disk_cache: Fix rw cache lookup when using combined ro+rw caches
When combining of ro+rw caches is enabled, at first the ro cache should be
looked up and if data isn't found there then rw cache should be checked.
The rw cache checking got lost by accident after the code rebase and there
was no unit test covering this condition. Fix the rw cache looking up and
add the unit test case.

Fixes: 32fe60e8c4 ("util/disk_cache: Support combined foz ro and non-foz rw caches")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Juston Li <justonli@google.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20595>
2023-01-10 04:53:44 +00:00
Jesse Natalie
8b79e6fb5e dzn: No need to add another bind flag for clears if one is already present
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20400>
2023-01-10 04:25:26 +00:00
Jesse Natalie
c59141d3c2 dzn: Lower tg4 offsets
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20400>
2023-01-10 04:25:26 +00:00
Jesse Natalie
9a991cc52e dzn: Implement point coord
Since we don't support wide points, this isn't a useful feature, but the CTS
requires a particular point coord value for the single rasterized pixel, based
on where the original point coord fell within the pixel. Since we're not doing
a quad, we don't get free interpolation like the GL driver does, so split the
logic between vertex (transform point center into screen space) and pixel
(compute delta between current pixel/sample and point center).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20400>
2023-01-10 04:25:26 +00:00
Jesse Natalie
03ce60ec7e dzn: Lower fragcoord wtrans
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20400>
2023-01-10 04:25:26 +00:00
Jesse Natalie
e8b12006bb dzn: Use the right variable for heap slots when prepping resolves
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20400>
2023-01-10 04:25:26 +00:00
Jesse Natalie
22b8e0c74c microsoft/compiler: Set the advanced texture ops flag correctly
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20400>
2023-01-10 04:25:26 +00:00
Jesse Natalie
a84208ee4d microsoft/compiler: Fill out and sort the shader/module flags
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20400>
2023-01-10 04:25:26 +00:00
Jesse Natalie
beeeb74a4c microsoft/compiler: For Vulkan, centroid should be ignored on position
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20400>
2023-01-10 04:25:26 +00:00
Jesse Natalie
d3cae18cb5 microsoft/compiler: For Vulkan, when shading at sample rate, pos is sample pos
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20400>
2023-01-10 04:25:26 +00:00
Jesse Natalie
b0f3a387c9 nir_lower_fragcoord_wtrans: Support Vulkan shaders
In Vulkan shaders, you might not have all derefs pointing to a variable

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20400>
2023-01-10 04:25:26 +00:00
Timothy Arceri
ac5af6c06d util/driconf: add Dune: Spice Wars workaround
As per the bug report the game does not correctly handle a uniform
index of -1 being returned for the unused array element, which
results in rendering issues. So here we skip the uniform array
resizing optimisation.

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

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20579>
2023-01-10 03:53:19 +00:00
Giancarlo Devich
e986d8c337 d3d12: Update hard-coded heap sizes and batch limit
Increasing the heap sizes and active batch count reduces flushing
churn when rendering runs out of descriptors.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20589>
2023-01-10 03:22:26 +00:00
Daniel Stone
9c1fbc076a Return 'Mesa' for GL_VENDOR for community drivers
Rather than a grab-bag of random values, return 'Mesa' as the GL_VENDOR
string for all community-supported drivers.

Drivers which are primarily developed/maintained by the hardware vendor
retain that vendor's name as the GL_VENDOR string.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16064>
2023-01-10 01:50:33 +00:00
WebsterEndymion
7d9eb64990 zink: fix the stencil write
Stencil writing also needs to be considered when setting the flag renderpass

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20245>
2023-01-10 01:30:02 +00:00
WebsterEndymion
53c4ce495c zink: add a condition to needs_write_s
Previously missing check on the stencil write, condition added to needs_write_s using util_writes_stencil

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20245>
2023-01-10 01:30:02 +00:00
Mike Blumenkrantz
847d198c1f lavapipe: add some safety asserts when beginning rendering
if the render area exceeds the attachment size, this is not only illegal,
it will crash later

cc: mesa-stable

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20583>
2023-01-10 01:12:28 +00:00
Mike Blumenkrantz
b20df1abeb zink: add a fs base key, fix optimal fs key packing
the optimal fs key gets at most 16 bits, so it's crucial to only use
the ones that are needed in order to conserve bits for things needed
by all drivers

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20585>
2023-01-10 00:51:24 +00:00
Mike Blumenkrantz
8772651aa0 zink: use optimal key for pipeline library hash
this doesn't really change anything other than making the set collide less

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20585>
2023-01-10 00:51:24 +00:00
Mike Blumenkrantz
19332b13e1 zink: unify some shadow tex code in match_tex_dests_instr()
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20585>
2023-01-10 00:51:24 +00:00
Mike Blumenkrantz
e6c6a59f56 zink: fix some weird indentation in zink_set_sampler_views
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20585>
2023-01-10 00:51:24 +00:00
Mike Blumenkrantz
90cd9cd3d1 zink: simplify some depth texturing spv
the special-casing here is no longer necessary since multi-component
depth sample ops have already been rewritten by this point

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20585>
2023-01-10 00:51:24 +00:00
Mike Blumenkrantz
b23877e7fa zink: put line emulation stuff behind optimal_keys check in draw
these parts of the shader key can't be accessed in optimal_keys mode

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20585>
2023-01-10 00:51:24 +00:00
Mike Blumenkrantz
c6f06901b7 zink: only flag modules_changed in optimal path if a change has occurred
this should save some cycles when a recalc is a no-op

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20585>
2023-01-10 00:51:24 +00:00
Mike Blumenkrantz
b295accf07 zink: delete dead code
update_gfx_program_optimal() is the real version of this

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20585>
2023-01-10 00:51:24 +00:00
Eric Engestrom
bc801c0808 meson/zink: use vk_api_xml variable instead of re-constructing the file path
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20568>
2023-01-10 00:31:11 +00:00
Alyssa Rosenzweig
615c3a078b asahi: Fix segfault with null drawbuffer
Fixes fbo-drawbuffers-none piglit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20569>
2023-01-10 00:17:12 +00:00
Alyssa Rosenzweig
9b67afb55d agx: Fix missing #include
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20569>
2023-01-10 00:17:12 +00:00
Alyssa Rosenzweig
b4d8be165b asahi: Implement ARB_texture_mirror_clamp_to_edge
Guessing the enum value, passes texwrap piglit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20560>
2023-01-09 23:58:52 +00:00
Alyssa Rosenzweig
0e2d786579 asahi: Implement GL_CLAMP natively
Turns out there's a hardware mode for this. Apple's GL driver uses this.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20560>
2023-01-09 23:58:52 +00:00
Lionel Landwerlin
8679956e63 ci/zink+anv: remove dEQP-GLES31.functional.layout_binding.ubo.*
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20555>
2023-01-09 23:00:24 +00:00
Lionel Landwerlin
2d627f28c8 anv: use the null surface with unused push descriptor binding table entries
Some binding table entries have been identify as unused in the shaders
by the push constant analysis pass. We can just put the null entry in
there.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: b49b18f0b7 ("anv: reduce BT emissions & surface state writes with push descriptors")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20555>
2023-01-09 23:00:24 +00:00
Lionel Landwerlin
bbfca4eb92 anv: return properly typed value for no ubo promoted
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: ff91c5ca42 ("anv: add analysis for push descriptor uses and store it in shader cache")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20555>
2023-01-09 23:00:24 +00:00
Lionel Landwerlin
e2b0086b78 anv: check that push range actually match binding considered
We can't just check the load_ubo range is contained in the push entry,
we also need to check that the push entry set/binding matches the
load_ubo set/binding.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: ff91c5ca42 ("anv: add analysis for push descriptor uses and store it in shader cache")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20555>
2023-01-09 23:00:24 +00:00
Lionel Landwerlin
48bb3df951 anv: don't nullify entries
We'll use those to fill the push constant addresses, so we can't have
them turned to null.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: ff91c5ca42 ("anv: add analysis for push descriptor uses and store it in shader cache")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20555>
2023-01-09 23:00:24 +00:00
Tapani Pälli
319d485679 iris: let isl set tiling mode for external resources
Patch sets memory object external format (which is otherwise
PIPE_FORMAT_NONE for memory objects) before main surface gets
configured. With this we can add a check that when dealing
with external resource that has no modifier set, we let isl
figure out the tiling mode.

Fixes memobj tests on DG2:
   piglit.spec.ext_external_objects.vk-image-display-muliple-textures
   piglit.spec.ext_external_objects.vk-image-display-overwrite
   piglit.spec.ext_external_objects.vk-depth-display
   piglit.spec.ext_external_objects.vk-image-display
   piglit.spec.ext_external_objects.vk-stencil-display

v2: add assert and comment on tiling decision (Ken)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7684
Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Simon Zeni <simon@bl4ckb0ne.ca>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20473>
2023-01-09 22:38:29 +00:00
Rhys Perry
fdf4a87823 radv/rt: use a smaller value to enable scratch
The scratch allocation alignment on GFX11 is small enough that this should
help. Would be nice to someday remove this hack completely though.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20534>
2023-01-09 21:46:13 +00:00
Rhys Perry
810ced93f3 aco: align scratch size during assembly
This lets us use less scratch if both VGPR spilling and scratch intrinsics
are used.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20534>
2023-01-09 21:46:13 +00:00
Rhys Perry
c9846158cd aco/gfx11: reduce scratch allocation alignment
fossil-db (gfx1100):
Totals from 112 (0.08% of 134574) affected shaders:
Scratch: 1513472 -> 1455360 (-3.84%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20534>
2023-01-09 21:46:13 +00:00
Qiu Wenbo
ee32f3873c vc4: Fix running process_mux_deps on irrelevant type of instructions
Only ALU and ALU Small Imm instructions have input mux.

Signed-off-by: Qiu Wenbo <qiuwenbo@kylinos.com.cn>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20581>
2023-01-09 20:22:47 +00:00
Qiu Wenbo
7489c29abe vc4: Fix RADDR_A field extraction of branch instruction
Signed-off-by: Qiu Wenbo <qiuwenbo@kylinos.com.cn>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20581>
2023-01-09 20:22:47 +00:00
Mike Blumenkrantz
82bd38fa11 zink: add a bunch of asserts for starting dynamic render
try to avoid any race condition bugs triggering later when they're
harder to catch

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20584>
2023-01-09 20:06:14 +00:00
Mike Blumenkrantz
0997a6272e zink: re-clamp dynamic render area when doing swapchain fixups
this may catch another corner case if a late fixup changes fb size

fixes (lavapipe):
dEQP-EGL.functional.swap_buffers_with_damage.resize_before_swap.clear_render

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20584>
2023-01-09 20:06:14 +00:00
Mike Blumenkrantz
c53fc5f48e zink: catch a potential corner case with dynamic render and swapchain updates
zink_prep_fb_attachment() calls acquire internally, which means it's theoretically
possible that fixups are required very late in this function

never seen it happen, but who knows

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20584>
2023-01-09 20:06:14 +00:00
Mike Blumenkrantz
a59dc9d157 zink: split out swapchain render update fixups into separate function
this needs to be more granular for corner cases

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20584>
2023-01-09 20:06:14 +00:00
Mike Blumenkrantz
6f02fe8842 zink: protect against invalid scissored renderpass clears
if the clear region is oob, this is illegal and may crash some drivers

fixes (lavapipe):
dEQP-EGL.functional.swap_buffers_with_damage.resize_before_swap.buffer_age_clear_render
dEQP-EGL.functional.swap_buffers_with_damage.resize_before_swap.buffer_age_render_clear

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20584>
2023-01-09 20:06:14 +00:00
Mike Blumenkrantz
79a4d22928 zink: only update framebuffer object during swapchain update if framebuffer exists
otherwise this might be randomly creating an unused framebuffer for dynamic render

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20584>
2023-01-09 20:06:14 +00:00
Ian Romanick
51be623372 intel/eu/validate: Check predication and cmod for SEL, CMP, and CMPN
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20527>
2023-01-09 19:15:19 +00:00
Ian Romanick
e0f409c5d8 intel/eu/validate: Add validation for csel
v2: Also check the condition modifier. Suggested by Lionel.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20527>
2023-01-09 19:15:19 +00:00
Ian Romanick
3a7c23973b intel/eu/validate: Add validation for bfi2
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20527>
2023-01-09 19:15:19 +00:00
Ian Romanick
f34821d998 intel/eu/validate: More validation for logic ops
v2: Use number of source to condition validating src1 instead of using
the opcode. Suggested by Lionel.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20527>
2023-01-09 19:15:19 +00:00
Ian Romanick
8be7406c81 intel/compiler: Assert that ARF used is the accumulator
v2: Move the new check to be with similar existing checks. Suggested by
Lionel.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20527>
2023-01-09 19:15:19 +00:00
Ian Romanick
3b579a2ea8 intel/compiler: Validate 3-source instruction source strides
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20527>
2023-01-09 19:15:19 +00:00
Ian Romanick
c5684019f6 intel/compiler: Validate 3-source instruction sources have same base type
This can't be checked in EU validation because the bits to describe the
base type of the individual sources no longer exist.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20527>
2023-01-09 19:15:19 +00:00
Georg Lehmann
c241980751 aco: Mark more instructions as 16bit on GFX10.
p_cvt_f16_f32_rtne will be lowered to v_cvt_f16_f32 and we already know that
preserves the high bits.

I tested the others on GFX1036.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20574>
2023-01-09 18:54:35 +00:00
Rhys Perry
b64afc1d37 aco: use s_delay_alu skip field
fossil-db (gfx1100):
Totals from 130066 (96.65% of 134574) affected shaders:
Instrs: 80208817 -> 71420648 (-10.96%)
CodeSize: 403523036 -> 368370360 (-8.71%)
Latency: 658064779 -> 657935384 (-0.02%); split: -0.02%, +0.00%
InvThroughput: 87698268 -> 87693326 (-0.01%); split: -0.01%, +0.00%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20512>
2023-01-09 18:22:59 +00:00
Rhys Perry
e2f083c0a7 aco: add more dependency instructions under waitcnt class
This makes these instructions free when considering pipeline statistics
and s_delay_alu insertion.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20512>
2023-01-09 18:22:59 +00:00
Rhys Perry
c8357136d4 aco: improve parse_delay_alu
Use gpr_map to determine how many cycles each dependency of the
s_delay_alu needs. This information helps the pass avoid further
s_delay_alu instructions.

fossil-db (gfx1100):
Totals from 13097 (9.73% of 134574) affected shaders:
Instrs: 30711894 -> 30702692 (-0.03%)
CodeSize: 153462500 -> 153425692 (-0.02%)
Latency: 372758612 -> 372741922 (-0.00%)
InvThroughput: 50164111 -> 50160717 (-0.01%); split: -0.01%, +0.00%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20512>
2023-01-09 18:22:59 +00:00
Samuel Pitoiset
bbad550f3d radv/winsys: fill real info for CHIP_GFX1100
From my AMD Radeon 7900 XT.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20476>
2023-01-09 17:28:05 +00:00
Samuel Pitoiset
d944959fbf radv: configure VGT_TF_PARAM directly from the command buffer
The driver re-emits the tessellation domain origin state when a new
pipeline with tessellation is bound, so this can be moved there.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20486>
2023-01-09 15:46:49 +00:00
Samuel Pitoiset
f1b3e6aefd radv: fix re-emitting tessellation domain origin when it's dynamic
The winding order can be different between pipelines.

Fixes new dEQP-VK.pipeline.pipeline_library.dynamic_control_points.change_*_winding.

Fixes: f22290949d ("radv: add support for dynamic tessellation domain origin")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20486>
2023-01-09 15:46:49 +00:00
Pierre-Eric Pelloux-Prayer
6e24b76c10 util/00-mesa-defaults: add Limbo workaround
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7976
Cc: mesa-stable

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Tested-by: Diego Viola <diego.viola@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20548>
2023-01-09 15:17:34 +00:00
José Roberto de Souza
1067ec90a5 anv: Update PIPELINE_CONTROL flush when switching pipeline mode in TGL+
This 2 PIPELINE_CONTROL flushes are not necessary for TGL and newer
and also it have different requirements of flush, so here doing
this two changes at the same time.

As no ANV_PIPE_INVALIDATE_BITS is set as parameter of
anv_add_pending_pipe_bits(),
genX(cmd_buffer_apply_pipe_flushes)(cmd_buffer) will only emit one
PIPELINE_CONTROL.

BSpec: 44505
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
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/20501>
2023-01-09 14:40:26 +00:00
José Roberto de Souza
172e0b0ebf iris: Update PIPELINE_CONTROL flush when switching pipeline mode in TGL+
This 2 PIPELINE_CONTROL flushes are not necessary for TGL and newer
and also it have different requirements of flush, so here doing
this two changes at the same time.

BSpec: 44505
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
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/20501>
2023-01-09 14:40:26 +00:00
Pierre-Eric Pelloux-Prayer
595079c37c hud: extract float printf modifer selection logic to helper
And use it when printing to a file from hud_graph_add_value.

This turns:
  fps: 59.972473
Into:
  fps: 59.97

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20494>
2023-01-09 14:25:55 +01:00
Pierre-Eric Pelloux-Prayer
31d95dd3c6 dri: get rid of LIBGL_SHOW_FPS
The same functionnality can be achieved using GALLIUM_HUD=stdout,fps (and for
now a fallback is doing this if LIBGL_SHOW_FPS=1 is used).

This removes one entry from the vtable and simplify dri3_handle_present_event.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20494>
2023-01-09 14:25:51 +01:00
Pierre-Eric Pelloux-Prayer
87f4d79427 hud,dri: emulate LIBGL_SHOW_FPS using hud
LIBGL_SHOW_FPS=1 is now almost equivalent to using:

   GALLIUM_HUD=stdout,fps
   GALLIUM_HUD_VISIBLE=false
   GALLIUM_HUD_PERIOD=$LIBGL_SHOW_FPS

so we can drop LIBGL_SHOW_FPS handling in dri and move it to hud.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20494>
2023-01-09 14:25:43 +01:00
Pierre-Eric Pelloux-Prayer
0a3e91b9ee hud: add "stdout" option to print values to console
Values gathered by the hud context will be printed to stdout,
prefixed by their name.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20494>
2023-01-09 14:25:41 +01:00
Pierre-Eric Pelloux-Prayer
3170f7d7fa hud: check GALLIUM_HUD_DUMP_DIR value only once
Minor cleanup but will allow another change in the next commit.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20494>
2023-01-09 14:25:25 +01:00
Dmitry Osipenko
32fe60e8c4 util/disk_cache: Support combined foz ro and non-foz rw caches
Mesa utilizes only one type of cache at a time. This patch enables support
for combined reading from read-only Fossilize cache + non-foz read-write
caches.

From now on, a non-foz read-write caches will first try to retrieve data
from a read-only foz cache if new MESA_DISK_CACHE_COMBINE_RW_WITH_RO_FOZ
environment variable is set to true, otherwise the caching behaviour is
unchanged. The new flag has no effect when MESA_DISK_CACHE_SINGLE_FILE=1,
i.e. when the single-file foz cache is used.

This change allows us to ship a prebuilt RO caches for a certain
applications, while the rest of applications will benefit from the
regular RW caching that supports cache-size limitation. This feature
will be used by ChromeOS.

Usage example #1:

MESA_DISK_CACHE_DATABASE=0
MESA_DISK_CACHE_SINGLE_FILE=0
MESA_DISK_CACHE_COMBINE_RW_WITH_RO_FOZ=1
MESA_DISK_CACHE_READ_ONLY_FOZ_DBS=rocache1,rocache2

Usage example #2:

MESA_DISK_CACHE_DATABASE=1
MESA_DISK_CACHE_SINGLE_FILE=0
MESA_DISK_CACHE_COMBINE_RW_WITH_RO_FOZ=1
MESA_DISK_CACHE_READ_ONLY_FOZ_DBS=rocache1,rocache2

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18551>
2023-01-09 12:12:55 +00:00
Dmitry Osipenko
75dae4f8e3 util/disk_cache: Store environment variable values in disk_cache struct
Store values of all environment variables related to disk caching within
struct disk_cache. This makes code cleaner and also will allow us to
combine read-only single-file cache with read-write caches.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18551>
2023-01-09 12:12:55 +00:00
Dmitry Osipenko
434bf4b482 util/fossilize_db: Fix resource leaks in foz_prepare() error paths
The foz_prepare() doesn't perform cleanup on failure and then foz_destroy()
is never invoked for the foz_db, causing minor memory and FD leaks. Add the
cleanup to foz_prepare() error code paths. Make foz_destroy() to clear the
foz_db struct for consistency, right now the destroying is invoked only once,
but Mesa cache error code paths aren't trivial and may change in the future.

Suggested-by: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18551>
2023-01-09 12:12:55 +00:00
SoroushIMG
2b77a65800 zink: fix disappearing smooth lines after workaround
The passthrough geometery shader was using points for smooth lines.
This meant the shader would always statically get 1 vertex and never emit a line.

Fixes: 80285db9ef ("zink: lower smooth-lines if not supported")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20582>
2023-01-09 10:56:52 +00:00
Xaver Hugl
41eb491fb6 driconf: add a workaround for plasmashell freezing
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7624

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Dan Johansen <strit@manjaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20472>
2023-01-09 09:04:25 +00:00
Lionel Landwerlin
6b494745be intel/fs: only avoid SIMD32 if strictly inferior in throughput
This enabled SIMD32 in blorp shaders and seems to be give a small FPS
bump when using a DG2 GPU as secondary (requires copies to linear
buffers to exchange with main GPU).

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19341>
2023-01-09 08:41:47 +00:00
Samuel Pitoiset
480308c6e5 radv: remove unused radv_is_raster_enabled()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20517>
2023-01-09 08:20:10 +00:00
Samuel Pitoiset
1099fd71b0 radv: initialize blend state after compiling shaders
This function used to compute part of the graphics key but everything
has been moved.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20517>
2023-01-09 08:20:10 +00:00
Samuel Pitoiset
87b88de973 radv: replace blend_enable_4bit by radv_pipeline_is_blend_enabled()
Same logic, though this workaround shouldn't be determined from the
pipeline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20517>
2023-01-09 08:20:10 +00:00
Samuel Pitoiset
0768cc5ed1 radv: determine DISABLE_DUAL_QUAD directly from the command buffer
With dynamic color blend equations, dual-src blending will be
determined from the dynamic state, better to move it there now.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20517>
2023-01-09 08:20:10 +00:00
Samuel Pitoiset
ab48665f8d radv: simplify uses of color_write_mask/color_blend_enable
The common Vulkan code already sets them when they are dynamic, so this
was redundant.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20517>
2023-01-09 08:20:10 +00:00
Samuel Pitoiset
25f067ef4c radv: adjust CB_SHADER_MASK right after SPI_SHADER_COL_FORMAT is compacted
This is a cleanup.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20517>
2023-01-09 08:20:10 +00:00
Samuel Pitoiset
db2108672d radv: remove unused parameter in radv_init_multisample_state()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20517>
2023-01-09 08:20:10 +00:00
Vinson Lee
84527093c4 spirv2dxil: Fix memory leak on error path.
Fix resource leak reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable file_contents going out of scope leaks the storage it points to.

Fixes: 531d17c334 ("spirv2dxil: Support linking multiple shaders")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20576>
2023-01-08 21:12:46 +00:00
Erico Nunes
9b29876a02 ci: Start weston with Xwayland
This can be used instead of HWCI_START_XORG to provide X in CI.
It will only be actually used if HWCI_START_XORG is not set in the same
job.
It is particularly useful as weston has the explicit headless backend
which is more straightforward to use in the headless systems in CI.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20393>
2023-01-08 17:36:13 +01:00
Gert Wollny
c91a78c03a virgl: Use virgl host side shader stage IDs when reading caps
The ordering of enum pipe_shader_type changed, but not all locations where
the host uses the original ordering were changed to translate to the new
ordering, namely reading the shader caps was not fixed up so do this now.

v2: - inline virgl_shader_stage_convert (Corentin)
    - encapuslate use of host shader stage when reading array elements
      of host caps

Fixes: a26543f636
   gallium: reorder the shader stage enum to match Mesa

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

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20544>
2023-01-07 10:02:18 +00:00
David Heidelberg
300dc7d653 ci/virgl: cover more glx@glx-copy-sub-buffer flakes
Generally, where this test doesn't fail, there it flakes.

Cover all variants.

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

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20556>
2023-01-07 03:37:21 +01:00
Ryan Neph
91a1455e3b Revert "ci/venus: disable for now"
This reverts commit 22ab226396.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20554>
2023-01-07 01:23:28 +00:00
Ryan Neph
3e66ef53d4 ci: Bump crosvm and virglrenderer versions
Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20554>
2023-01-07 01:23:28 +00:00
Mary
d8e5714e81 isaspec: Fix bitmask conversions when isa.bitsize < 64
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20541>
2023-01-07 00:14:10 +01:00
Lucas Stach
2d7ea1895e etnaviv: add cleared surfaces to context flush set when necessary
A RS/BLT clear might only clear the TS buffer, so the cleared resources
need to be added to the context flush set when they aren't explicitly
flushed in order to make the effect of the clear visible in the resource
on context flush.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20012>
2023-01-06 19:30:47 +00:00
Lucas Stach
cf501a7f34 etnaviv: split adding resource to context flush set into own function
It is needed in a few more places, so split it into a separate
function to make it reusable.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20012>
2023-01-06 19:30:47 +00:00
Eric Engestrom
a6e487e367 ci_run_n_monitor.py: automatically retry on transient errors
This morning a GitLab update was deployed, leading to a few moments
where the API returned an error.

python-gitlab is actually able to handle a number of those and retry
automatically, so let's enable that:
https://python-gitlab.readthedocs.io/en/stable/api-usage-advanced.html#transient-errors

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20094>
2023-01-06 19:28:55 +00:00
Emma Anholt
617e7596d1 zink: Add an assert for not seeing any more MSAA image-to-buffer copies.
Now that transfer_map gets MSAA handled by the helper, we shouldn't have
to worry about this any more.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20523>
2023-01-06 19:00:17 +00:00
Emma Anholt
f74bbcd8a0 zink: Have u_transfer_helper resolve MSAA surfaces when mapping.
This fixes all the dEQP winsys multisampling failures (like
dEQP-GLES3.functional.multisample.default_framebuffer.depth) I've found so
far.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20523>
2023-01-06 19:00:17 +00:00
Emma Anholt
823e34f938 u_transfer_helper: Merge in-place and split z/s interleaved map handling.
The paths were mostly the same, except that in-place was missing the
appropriate layering for MSAA helper re-mapping.  We can instead share
more code, making the differences between the interleave packing clear,
and have the MSAA resolve blit happen once before we do the split
mappings.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20523>
2023-01-06 19:00:17 +00:00
Emma Anholt
4372069f5a u_transfer_helper: Use common code for interleaved unmap.
The function was static and only used from this caller, and the only
difference was that the interleaved case didn't handle trans->ss (which
will always be unset for an interleaved mapping since interleaving splits
the underlying map of the MSAA resource into trans->trans and
trans->trans2).

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20523>
2023-01-06 19:00:17 +00:00
Emma Anholt
b5b2194a3a u_transfer_helpre: Drop !interleave handling from the interleave code.
It's only called when need_interleave_path(), and they're static functions
in this file since !17959.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20523>
2023-01-06 19:00:17 +00:00
Emma Anholt
95c4241f47 docs/gallium: Explain that MSAA transfer_map must be supported.
It's called this way in various drivers, and is an established part of the
transfer_map interface.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20523>
2023-01-06 19:00:17 +00:00
Emma Anholt
03a26ae3d9 ci: Fix VK driver setup for HWCI_START_*.
Review feedback requested a change that was incorrect, causing Xorg to
start to fail, but I forgot to retest the manual -full jobs that relied on
it.

Fixes: 99a6f2a186 ("ci: Set the path to the VK drivers during HWCI_START_XORG/WESTON.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20523>
2023-01-06 19:00:17 +00:00
Rohan Garg
85650297d2 anv,hasvk: move the null check into the function call and drop null check copies
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20104>
2023-01-06 17:22:16 +00:00
Rohan Garg
0ae23b81a4 anv: Drop useless FIXME
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20104>
2023-01-06 17:22:16 +00:00
Rohan Garg
00ffe8227f anv,hasvk: drop unused function
align_i32 is not used anywhere

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20104>
2023-01-06 17:22:16 +00:00
Rohan Garg
05dca17b57 anv,hasvk: migrate to ROUND_DOWN_TO from util
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20104>
2023-01-06 17:22:16 +00:00
Rohan Garg
818eed3d2f anv,hasvk: migrate to u_minify from util
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20104>
2023-01-06 17:22:16 +00:00
Rohan Garg
9257b08f49 anv: migrate anv_minify to use u_minify
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20104>
2023-01-06 17:22:16 +00:00
Rohan Garg
4504188508 anv,hasvk: migrate to align64 from util
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20104>
2023-01-06 17:22:16 +00:00
Rohan Garg
a06f751ec8 anv,hasvk: migrate align32 to the right functions from util
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20104>
2023-01-06 17:22:16 +00:00
Rohan Garg
1e9fb7c696 anv,hasvk: Use the inbuilt macro from src/util for clamping int64_t
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20104>
2023-01-06 17:22:15 +00:00
Rohan Garg
0030d6d224 anv: constify variables and use early returns
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20104>
2023-01-06 17:22:15 +00:00
David Heidelberg
5fb935b3a4 ci/linker: update mold to 1.9
Bump needed for s390x fix with `-gsplit-dwarf` and `--gdb-index`.
See the https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20435
for more details.

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

Additionally disabled build testing and enabled LTO build for Mold.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20546>
2023-01-06 16:28:27 +00:00
Rhys Perry
9e55b3b790 aco/gfx11: update s_code_end padding
Match ac_rtld_open().

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Cc: 22.3 <mesa-stable>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20536>
2023-01-06 16:09:51 +00:00
Eric Engestrom
aab4a260db meson: add missing dependency
Now that renderonly.h includes util/simple_mtx.h, which itself includes
valgrind.h, dep_valgrind is required by any module that includes
renderonly.h.

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

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

Fixes: ad4d7ca833 ("kmsro: Fix renderonly_scanout BO aliasing")
Tested-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20530>
2023-01-06 15:40:39 +00:00
Erico Nunes
cf64ca6a0c ci: enable wayland platform in more debian builds
CI has recently gained coverage of wayland platform in EGL tests, but
some CI mesa builds such as arm builds currently don't enable the
wayland platform.
Enable it so test applications can properly initialize EGL with a
wayland platform.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20480>
2023-01-06 15:00:57 +00:00
Martin Roukala (né Peres)
98747e5c82 radv/ci: run Zink testing on VanGogh
Running zink testing on RDNA2 hardware has been on our TODO list for
a while. While we don't have enough NAVI21 to test everything, we could
make use of the VanGogh APUs to do our Zink testing.

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

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20006>
2023-01-06 14:09:31 +00:00
Martin Roukala (né Peres)
c90f69a043 zink/ci: rename zink-radv-* to zink-radv-navi10-*
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20006>
2023-01-06 14:09:31 +00:00
Martin Roukala (né Peres)
5b04a2138f radv/ci: merge all the zink jobs into a single one
Since GL CTS, GLES CTS, and Piglit executions are very fast compared
to the machine setup time, it makes sense to combine them into one
boot.

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

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20006>
2023-01-06 14:09:31 +00:00
David Heidelberg
22ab226396 ci/venus: disable for now
It flakes too much. Until it gets sorted out, we disable it.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20547>
2023-01-06 14:09:49 +01:00
Corentin Noël
808a25c30a venus: Avoid to copy the descriptor sets when it is not required
Allows to reduce the amount of allocations when the VkWriteDescriptorSet is
already sanitized.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20095>
2023-01-06 11:20:00 +00:00
Samuel Pitoiset
5757dbe1ee radv: fix returning VK_PIPELINE_COMPILE_REQUIRED from library
When VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED is set by
the application, the driver should return VK_COMPILE_REQUIRED but this
was broken for GPL (it returned VK_SUCCESS instead). Also, objects
shouldn't be destroyed when creating the library failed because it's
already handled in radv_graphics_lib_pipeline_create().

Cc: 22.3 mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7512
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20532>
2023-01-06 10:10:18 +00:00
Michel Dänzer
888f5e5aa1 radeonsi: Fix amdgpu-color-export with prologues
Polygon stippling is handled in the prologue, amdgpu-color-export needs
to be set for that.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8010
Fixes: 1825ad134b ("radeonsi,radv/llvm: fix amdgpu-color/depth-export with epilogs")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20531>
2023-01-06 08:56:31 +00:00
Samuel Pitoiset
988c871ca9 radv: stop dirtying INDEX_BUFFER for non-indexed draws
radv_emit_index_buffer() used to emit VGT_INDEX_TYPE but since I
implemented the DISABLE_INSTANCE_PACKING workaround, it's emitted
in radv_emit_draw_registers().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20522>
2023-01-06 08:32:01 +00:00
Samuel Pitoiset
509ba67aeb radv: flush push descriptors at bind time
This doesn't need to be flushed at draw time.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20522>
2023-01-06 08:32:01 +00:00
Samuel Pitoiset
f288acb50f radv: remove set but unused radv_cmd_state::index_{buffer,offset}
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20522>
2023-01-06 08:32:01 +00:00
Samuel Pitoiset
ddb21e86a4 radv: remove unused pipeline parameter from radv_emit_binning_state()
It's no longer needed because everything is dynamic.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20522>
2023-01-06 08:32:01 +00:00
Samuel Pitoiset
21e52a612d radv: remove enabling out-of-order rasterization internally
This was added ~4 years ago for very little performance improvements
(likely < 1%) and this is only supported on GFX8 and GFX9.

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

Applications can still enable it with VK_AMD_rasterization_order.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20514>
2023-01-06 08:11:17 +00:00
Jason Ekstrand
39c6f6454c isaspec: Give decode.c/h more descriptive names
Because these are being included across subdir boundaries, the name
"decode" is potentially pretty overloaded.  Instead, prefix them with
"isaspec_".  Also, since they're both weird includes now and not really
complete files in their own right, give them a descriptive suffix.

Acked-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20525>
2023-01-05 18:21:02 +00:00
Jason Ekstrand
e8945a8ce6 isaspec: Stop depending on glue headers and out-of-folder C files
The way the isaspec decoder used to work was that it would generate a
header and a C file, each with ISA-specific stuff in it. Then that would
get built together with a stand-alone decode.c file which lives in the
isaspec folder, not the driver's folder.  In order for decode.c to find
the ISA-specific headers, it would also generate a glue header which had
to be named isaspec-isa.h.  This effectively meant that you can't have
multiple isaspec definitions in the same folder.

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

Acked-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20525>
2023-01-05 18:21:02 +00:00
Jason Ekstrand
4953a8db25 isaspec: Use argparse
This also cleans up some of our python script execution conventions and
handles mako errors better. Copied a bit from vk_entrypoints_gen.py.

Acked-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20525>
2023-01-05 18:21:02 +00:00
Jason Ekstrand
e83ad77ef5 isaspec: Stop using s and xml from the global namespace
We really shouldn't rely on these being global variables.  Pass them
along instead.

Acked-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20525>
2023-01-05 18:21:02 +00:00
Alyssa Rosenzweig
05c17eae2b asahi: Advertise MRT and fbfetch
These should both work now.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:49:23 -05:00
Alyssa Rosenzweig
fa96dfb2d7 agx: Lower discard to zs_emit when zs_emit used
It is invalid to use both sample_mask and zs_emit in the same shader. We'll need
to do something similar for sample mask writes.

Fixes Dolphin ubershaders.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:49:23 -05:00
Alyssa Rosenzweig
ebe40b15ea agx: Fix discard with MRT
The exact semantics of sample_mask aren't quite clear to me yet, but executing
multiple sample_mask instructions seems to raise a fault :|

Fixes SuperTuxKart's advanced renderer.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:49:23 -05:00
Alyssa Rosenzweig
2b5519e865 agx: Introduce "no_varyings" instruction
Must be used at the end of a vertex shader that does NOT write any varyings, has
rasterizer discard enabled, and is run only for its side effects.

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

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:49:23 -05:00
Alyssa Rosenzweig
33e3418cfe agx: Consider "stop" a control flow instruction
...and therefore it needs to be after a "logical end". This means that
"after_block_logical" will do the right thing for the last block.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:49:22 -05:00
Alyssa Rosenzweig
f6aa43cf42 agx: Optimize waits locally
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:49:22 -05:00
Alyssa Rosenzweig
a01680b979 agx: Remove logical_end later
So we can use after_block_logical in the wait insertion pass.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:49:22 -05:00
Alyssa Rosenzweig
73ac73308b agx: Validate widths of vectors
Check the invariant that the widths of vectors in the IR are consistent, by
checking that write registers and read registers match up between the writers
and readers respectively.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:49:22 -05:00
Alyssa Rosenzweig
6685dba75e agx: Add agx_read_registers helper
To be used for inserting waits post-RA.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:49:22 -05:00
Alyssa Rosenzweig
e6631ba5af agx: Compact st_tile argument per mask
Otherwise the number of read registers won't match the vector we input, which
will trigger validation errors.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:49:22 -05:00
Alyssa Rosenzweig
545a3eb601 agx: Insert waits post-RA
This is the first step towards reducing stalling.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:49:22 -05:00
Alyssa Rosenzweig
463744e4f9 agx: Pack texture scoreboard slots
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:49:22 -05:00
Alyssa Rosenzweig
01f948ee13 agx: Pack wait instructions
For different scoreboard slots.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:49:22 -05:00
Alyssa Rosenzweig
640afb33b9 agx: Remove unused idiv const func
This was used for instancing, but has been unused since 8dcf7648f1 ("agx: Lower VBOs in NIR")

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:49:22 -05:00
Alyssa Rosenzweig
44925a142e agx: Use metadata for VS varying linking
Rather than variables. This gets rid of all backend nir_variable use.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:49:22 -05:00
Alyssa Rosenzweig
617f2f7a02 agx: Don't use nir_variable when gathering flat varyings
Walk the IR instead. This happens when preprocessing so it doesn't really
matter, but it complicates the nir_variable audit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:49:22 -05:00
Alyssa Rosenzweig
d00a43f682 agx: Hash agx_instr faster
Prior to this change, agx_opt_cse is our most expensive backend pass, due to the
time spent hashing instructions. hash_instr was calling into XXH32 a massive
number of times, often to hash only a single bit. It's much faster to hash
entire blocks of memory at a time. Optimize to do just that.

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

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

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:49:22 -05:00
Alyssa Rosenzweig
f44afe766f agx: Use texture write mask
We do need to use undefs instead of zeroes in this internal collect. While this
vector gets copypropped out, it'd cause us to fail compilation if noopt is on.
Fix that.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:49:22 -05:00
Alyssa Rosenzweig
7284e4967c agx: Note that textures clobber even masked
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:49:22 -05:00
Alyssa Rosenzweig
ddbec45b6f agx: Plumb in store instruction
This will be used for compute kernels (and transform feedback) in the (near)
future. For now, let's get the opcode plumbed in the backend to reduce some of
the rebase pain.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:49:22 -05:00
Alyssa Rosenzweig
6b645f12ad asahi/lower_tilebuffer: Avoid loading sample mask
If a render target isn't written to, we don't use the sample mask. Avoid
generating the intermediate instructions, common with gl_FragColor. It will get
DCE'd, but this means less work for DCE, which should help for shader jank since
this pass gets called per-variant.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:49:22 -05:00
Alyssa Rosenzweig
bb677c7fc8 asahi: Remove outdated comment
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:49:22 -05:00
Alyssa Rosenzweig
b612690e38 asahi: Implement linear 2D array textures
These are useful for layered staging resources. Tested by forcing linear
textures and running dEQP-GLES3.functional.texture.format.sized.2d_array.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:49:22 -05:00
Alyssa Rosenzweig
0bc70a0074 asahi: Correct acceleration_buffer for layered images
The old calculation was wrong if layer != 0.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:49:22 -05:00
Alyssa Rosenzweig
17d4486c6a asahi: Add XML for linear 2D arrays
These look a bit like compressed images, and elucidate one of the common fields.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:48:13 -05:00
Alyssa Rosenzweig
48c9a9676c asahi: Add XML required for vertex shader side effects
Basically for rasterizer discard. We'll use these in a moment to implement
transform feedback.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:48:13 -05:00
Alyssa Rosenzweig
6bda0f2a70 asahi: Dump uniforms when decoding
These often have addresses in them.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:48:13 -05:00
Alyssa Rosenzweig
d31a9cf3ae asahi: Check box implement NV_conditional_render
Use the freedreno lowering. It'll be slow but I don't know of any apps that
actually use this and it's required for GL 3.0.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:48:13 -05:00
Alyssa Rosenzweig
21a35b58ba ail: Add compression_layer_stride_B field
So we can index into the compression buffer of layered images.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:48:13 -05:00
Alyssa Rosenzweig
d703c2887d ail: Support linear 2D arrays
These are straightforward.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:48:13 -05:00
Alyssa Rosenzweig
35494ea83e docs/features: Add more missed asahi
Should already be there.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
2023-01-05 11:48:13 -05:00
Rob Clark
03beb32478 freedreno/decode: Deal with suballocated buffers
We can end up logging both the buffer that the toplevel cmdstream is
allocated, as well as the sub-allocated part of that buffer.  Possibly
the kernel could do better about this, but to avoid undecodeable
cmdstream dumps and devcores, detect this case and deal with it.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20496>
2023-01-05 15:44:39 +00:00
Rob Clark
8e437a2203 freedreno: Limit max draws per batch
Mostly so that piglit drawoverhead doesn't OoM itself with absurd # of
draws.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20496>
2023-01-05 15:44:39 +00:00
Rob Clark
8d44525feb freedreno/drm: Add nr_suballoc_bos size check
We also want to ensure we don't hit the limit of max suballoc BOs.
Piglit drawoverhead would manage to hit this.

Fixes: 4861067689 ("freedreno/drm: Add sub-allocator")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20496>
2023-01-05 15:44:39 +00:00
Rob Clark
912c91e383 freedreno: Fix FD_MESA_DEBUG=nohw
We need to construct a dummy fence in this case.

Fixes: 48b5164356 ("freedreno/drm: Return fence from submit flush")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20496>
2023-01-05 15:44:39 +00:00
Rob Clark
5c3d5f14ac freedreno/drm: Mark ring heap buffers for dumping
Ensure that these get FD_RELOC_DUMP flag set so cmdstream dumps and
devcore's capture them.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20496>
2023-01-05 15:44:39 +00:00
Bas Nieuwenhuizen
0d5570bb47 radv: Always compile accel structure shaders on demand.
Some CTS tests enable all extensions ... , which combined with having
no shader cache on some platforms results in some CTS tests timing
out (in particular tests recreating the device all the time).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20422>
2023-01-05 14:45:47 +00:00
Bas Nieuwenhuizen
ef37407971 radv: Support on demand compilation of fmask shaders.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20422>
2023-01-05 14:45:47 +00:00
Pavel Ondračka
32925bf708 r300: lower fsign in nir
Nothing significant in shader-db on RV530:
total instructions in shared programs: 134963 -> 134957 (<.01%)
instructions in affected programs: 1108 -> 1102 (-0.54%)
helped: 7
HURT: 1
total temps in shared programs: 17153 -> 17154 (<.01%)
temps in affected programs: 38 -> 39 (2.63%)
helped: 2
HURT: 3

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

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20208>
2023-01-05 12:01:32 +00:00
Pavel Ondračka
9af7f7d156 r300: move some ftrunc lowering to nir
There are still some ftruncs left as most of them originates in
nir_lower_int_to_float and that is currently called after nir_opt_algebraic
in ntt.

No change in shader-db.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20208>
2023-01-05 12:01:32 +00:00
Pavel Ondračka
31f678626f r300: use nir lowering for ffloor
Negligible amount of instructions saved on RV530:
total instructions in shared programs: 134970 -> 134963 (<.01%)
instructions in affected programs: 2273 -> 2266 (-0.31%)
helped: 9
HURT: 1

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

Signed-off-by: Pavel Ondračka <pave.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20208>
2023-01-05 12:01:32 +00:00
Pavel Ondračka
a93bc6afc4 nir: check for x - ffract(x) patterns when lowering f2i32
We already skip emitting ftrunc in nir_lower_int_to_float when there is
ffloor, fround or any other integer-making opcode preceding f2i32. However
if lower_ffloor is set for driver that doesn't support integers, the lowered
x - ffract(x) patterns would not be recognized and extra ftruct would be
emitted, doing unnecessary rounding.

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

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

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

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20208>
2023-01-05 12:01:32 +00:00
Pierre-Eric Pelloux-Prayer
b111e8aa49 egl: handle NULL loaderPrivate in dri_is_thread_safe
This can happen when a context is created from
loader_dri3_blit_context_get and glthread is enabled.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7949
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7960
Cc: mesa-stable

Acked-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20479>
2023-01-05 10:35:58 +00:00
Samuel Pitoiset
5449b6927a radv: use vk_dynamic_graphics_state for the color blend state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20314>
2023-01-05 10:07:01 +00:00
Samuel Pitoiset
e381ac7aaf radv: rework some color blend state fields for vk_dynamic_graphics_state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20314>
2023-01-05 10:07:01 +00:00
Samuel Pitoiset
29ca23dd93 radv: use vk_dynamic_graphics_state for the multisample state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20314>
2023-01-05 10:07:01 +00:00
Samuel Pitoiset
ed5dc76ea7 radv: use vk_dynamic_graphics_state for the depth stencil state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20314>
2023-01-05 10:07:01 +00:00
Samuel Pitoiset
a72fcfd40b radv: use vk_dynamic_graphics_state for the rasterization state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20314>
2023-01-05 10:07:01 +00:00
Samuel Pitoiset
3bc248e564 radv: use vk_dynamic_graphics_state for the discard rectangles state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20314>
2023-01-05 10:07:01 +00:00
Samuel Pitoiset
104a564920 radv: use vk_dynamic_graphic_state for the viewport state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20314>
2023-01-05 10:07:01 +00:00
Samuel Pitoiset
251933efa7 radv: use vk_dynamic_graphics_state for the input assembly state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20314>
2023-01-05 10:07:01 +00:00
Samuel Pitoiset
3bf256e86d radv: use vk_dynamic_graphics_state for the tessellation state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20314>
2023-01-05 10:07:01 +00:00
Samuel Pitoiset
4183002c62 radv: use vk_dynamic_graphics_state for the fragment shading rate state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20314>
2023-01-05 10:07:01 +00:00
Samuel Pitoiset
0241094eb4 radv: move viewport pre-computed xform outside of radv_viewport_state
I think we should distinguish between dynamic states (applications) and
hardware states, and this will allow us to use vk_viewport_state
instead of our own structs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20314>
2023-01-05 10:07:01 +00:00
Pierre-Eric Pelloux-Prayer
aa1a752979 vbo/save: avoid dangling_attr_ref situation
dangling_attr_ref=true can be set when the following happens:

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

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

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

This avoids the slow corner case.

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

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20495>
2023-01-05 09:10:59 +00:00
Pierre-Eric Pelloux-Prayer
a9ab06668f vbo: simplify current_init since VBO_ATTRIB_POS is 0
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20495>
2023-01-05 09:10:59 +00:00
Max Lee
32010d985c intel_noop_drm_shim: add ability to specify device id
Given a GPU platform, there are multiple device ids. This commit
adds ability to specify device id for the shim, instead of using
one of the hard-coded device ids per platform.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20526>
2023-01-05 08:37:01 +00:00
Maíra Canal
a2252adde8 v3dv: initialize fd variable for proper error handling
Currently, process_singlesync_signals() checks if fd == -1 to handle
possible errors in the drmSyncobjExportSyncFile function. But, fd is not
initialized, which means that drmSyncobjExportSyncFile might fail and
the error will not be handled as fd might not be equal to -1.

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

cc: mesa-stable

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20475>
2023-01-05 06:41:36 +00:00
Martin Roukala (né Peres)
f4b4bc0c2f ci/b2c: start making use of the harbor.fd.o
A new container registry was added recently in the fd.o infrastructure.
It is located in a datacenter that does not charge for bandwidth usage,
and aims to become the canonical registry in the future. It is however
currently configured to be a partial mirror of registry.fd.o, where
only the most-downloaded container images can be found.

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

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

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7913
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20450>
2023-01-05 05:51:39 +00:00
Qiang Yu
d045b33599 ac/nir: handle 16bit varying streamout for legacy vs and gs copy shader
This is for VARYING_SLOT_VARx_16BIT slots varying streamout.

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

Acked-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20157>
2023-01-05 01:12:06 +00:00
Qiang Yu
7d6d63c94a ac/nir,radv: use ac_nir_gs_output_info
We are also going to add more fields in it.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20157>
2023-01-05 01:12:06 +00:00
Qiang Yu
cf2ea3fce9 nir/xfb: save high_16bits output info
It is combined with slot location to identify a varying
when using VARYING_SLOT_VARx_16BIT.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20157>
2023-01-05 01:12:06 +00:00
Emma Anholt
b8d9f860a0 zink: Only expose PIPE_CAP_SHADER_ATOMIC_INT64 if we can do shared and ssbos.
Fixes: 3ac0706aa8 ("zink: export PIPE_CAP_SHADER_ATOMIC_INT64")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20506>
2023-01-05 00:55:18 +00:00
Emma Anholt
426cb025e7 zink: Only expose PIPE_CAP_IMAGE_ATOMIC_FLOAT_ADD if we can actually add.
Drivers may expose the ext without the add capability, if they can
load/store/exchange.

Fixes: c32f046ab6 ("zink: export PIPE_CAP_IMAGE_ATOMIC_FLOAT_ADD")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20506>
2023-01-05 00:55:18 +00:00
Timothy Arceri
a4a1f95431 util/00-mesa-defaults: add Metal Slug XX workaround
The game uses texture2D() in glsl 4.40 shaders, but texture2D()
was moved to compat in 4.20.

Cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20511>
2023-01-05 00:26:36 +00:00
Felix DeGrood
c1c81137d9 hasvk: Emit CS stall on INTEL_MEASURE timestamp
For INTEL_MEASURE, ensure all prior instructions completed before
timestamp taken. Continue to support no CS flush case for Perfetto.
CS stall was dropped from pipecontrol when adding u_trace support.

Fixes: cc5843a573 ("anv: implement u_trace support")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20502>
2023-01-04 22:43:36 +00:00
Felix DeGrood
7f6beb8537 anv: Emit CS stall on INTEL_MEASURE timestamp
For INTEL_MEASURE, ensure all prior instructions completed before
timestamp taken. Continue to support no CS flush case for Perfetto.
CS stall was dropped from pipecontrol when adding u_trace support.

Fixes: cc5843a573 ("anv: implement u_trace support")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20502>
2023-01-04 22:43:36 +00:00
Emma Anholt
0a11cea652 ci/zink: Add trace testing on anv TGL.
For now the restricted traces aren't available to the intel devs, so it
won't actually run for them, but I can manage that part for a bit until we
get the policy updated on the minio side (issue filed to do so).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20503>
2023-01-04 21:18:08 +00:00
Emma Anholt
a5572583e3 ci/zink: Add a manual full run of CTS+piglit on tgl.
If we want to ship zink on anv for ChromeOS, we've got to be able to know
that the tree is green when we uprev.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20503>
2023-01-04 21:18:08 +00:00
Emma Anholt
d19d0fe2eb ci/zink: Refactor a bit of test configuration yaml.
I'm adding more zink tests shortly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20503>
2023-01-04 21:18:08 +00:00
Emma Anholt
99a6f2a186 ci: Set the path to the VK drivers during HWCI_START_XORG/WESTON.
If the test is running with zink, we want zink to be able to find the
vulkan driver.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20503>
2023-01-04 21:18:08 +00:00
Emma Anholt
01b5e876a2 ci/iris: Add some recent flakes.
APL are clearly part of the existing set, glx-swap-copy on KBL is
plausibly new but it's a flake on other drivers too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20503>
2023-01-04 21:18:08 +00:00
Marek Olšák
cd15e95a11 mesa: set NewVertexElements when changing IsDynamic
Fixes: 0fbd82bdc4 - mesa: move calling _mesa_update_vao_derived_arrays into st_update_array
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7938

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20432>
2023-01-04 20:52:20 +00:00
Jesse Natalie
a573f6a6da dzn: Handle split front/back compare/write masks for dynamic state
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20364>
2023-01-04 11:12:34 -08:00
Jesse Natalie
33e2444384 dzn: For CmdBindIndexBuffer, look at the graphics pipeline instead of last used
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20364>
2023-01-04 11:12:34 -08:00
Jesse Natalie
a81e832af0 dzn: Don't touch pMultisampleState if rasterizerDiscardEnable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20364>
2023-01-04 11:12:34 -08:00
Jesse Natalie
22bb768a8e dzn: Remove spammy logging during device create
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20364>
2023-01-04 11:12:34 -08:00
Jesse Natalie
a0b9e5a93e dzn: Flip on enhanced barrier code paths based on D3D capability
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20324>
2023-01-04 18:20:26 +00:00
Jesse Natalie
dc9a3ed4d5 dzn: Add an "enhanced" version of CmdPipelineBarrier2
This allows us to *much* more accurately express the app's barrier
requests. Unfortunately, there's still a few mismatches, so in those
cases we'll end up conservatively over-synchronizing/flushing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20324>
2023-01-04 18:20:26 +00:00
Jesse Natalie
4fb076fc22 dzn: Add an enhanced barrier path for internal and fixup barriers
While enhanced barriers is a *much* closer model to Vulkan's, there's
still one big mismatch: Vulkan's "transfer" concept supports clears,
copies, and resolves, while D3D's closest match only supports copies.
So when doing clears and resolves, we need to transition from the copy
layout to the correct layout, and then back.

Internal barriers are done for some meta scenarios as well as render
pass initial layout transitions. These look more or less the same as
non-enhanced, we just want to avoid mixing the two paradigms if possible.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20324>
2023-01-04 18:20:26 +00:00
Jesse Natalie
d50f160d0a dzn: CmdWaitForEvents needs to submit barriers too
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20324>
2023-01-04 18:20:26 +00:00
Jesse Natalie
2314afae9d dzn: Fix aspects used for blit barriers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20324>
2023-01-04 18:20:26 +00:00
Jesse Natalie
5b9aedce0e dzn: Remove unnecessary read -> read transition barriers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20324>
2023-01-04 18:20:26 +00:00
Jesse Natalie
e616d33850 dzn: Respect sharing mode
D3D's "simultaneous access" concept pretty closely matches
Vulkan's concurrent sharing mode, except that we don't
support simultaneous access for depth buffers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20324>
2023-01-04 18:20:26 +00:00
Jesse Natalie
b9df7f0a27 dzn: Store valid BARRIER_ACCESS flag masks for a few objects
A subset of total access flags are valid based on command list
type and resource flags, so store that set during object creation.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20324>
2023-01-04 18:20:26 +00:00
Jesse Natalie
184339ba6f dzn: Store command list type in the command buffer object
We'll want to use this for choosing queue-type-specific
layouts in the new pipeline barrier implementation.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20324>
2023-01-04 18:20:26 +00:00
Jesse Natalie
d7f5563907 dzn: Create all buffers in COMMON state
Since they promote/decay, there's no point in using any
other initial state value.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20324>
2023-01-04 18:20:26 +00:00
Jesse Natalie
76e72ed452 dzn: Delete initial_state which is always COMMON
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20324>
2023-01-04 18:20:26 +00:00
Karmjit Mahil
0b72ff00b1 pvr: Remove PVR_STATIC_CLEAR_.*_BIT and use VkImageAspectFlags.
This commit removes the PVR_STATIC_CLEAR_.*_BIT used to index the
static clear templates in the device. Now we use the Vulkan flags
so no need for any conversion of the flags.

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/20055>
2023-01-04 16:30:39 +00:00
Karmjit Mahil
7509e259f8 pvr: Implement color/depth/depth+stencil attachment clear.
The depth/depth+stencil clear was already implemented. This adds
the z replication and color attachment clear branches.

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/20055>
2023-01-04 16:30:39 +00:00
Karmjit Mahil
6e2ec31043 pvr: Add clear attachment programs in device.
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/20055>
2023-01-04 16:30:39 +00:00
Karmjit Mahil
72151aa426 pvr: Add comments documenting large/normal clear words.
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/20055>
2023-01-04 16:30:39 +00:00
Karmjit Mahil
a308d38fae pvr: Add empty clear attachment usc programs.
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/20055>
2023-01-04 16:30:39 +00:00
Karmjit Mahil
821c6b9342 pvr: Implement depth/stencil/depth+stencil attachment clear.
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/20055>
2023-01-04 16:30:39 +00:00
Karmjit Mahil
5611dedd78 pvr: Fix typo in 'err_free_verices_buffer'.
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/20055>
2023-01-04 16:30:39 +00:00
Karmjit Mahil
603570535d pvr: Add pvr_clear_vertices_upload().
This function allows to easily setup and upload the vertices
required to clear a specific area. The vertices are
arranged in a triangle strip.

This will also be used in following commits implementing
vkCmdClearAttachments().

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/20055>
2023-01-04 16:30:39 +00:00
Karmjit Mahil
13fc4b1780 pvr: Move static clear state into pvr_clear.c .
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/20055>
2023-01-04 16:30:39 +00:00
Karmjit Mahil
aa37415f1c pvr: Add layer count support to pvr_clear_vdm_state().
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/20055>
2023-01-04 16:30:39 +00:00
Karmjit Mahil
4a9f23c564 pvr: Move clear VDM state into pvr_clear.h .
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/20055>
2023-01-04 16:30:39 +00:00
Karmjit Mahil
a70b724519 pvr: Add clear rta vert shader pds program.
The rta program will be used in following commits adding support
for vkCmdClearAttachments().

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/20055>
2023-01-04 16:30:39 +00:00
Karmjit Mahil
22bad762f4 pvr: Add pvr_clear.{h,c} .
This moves some clear related functionality into a new
pvr_clear.{h,c} just to for better organisation and allow for
easier reusability.

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/20055>
2023-01-04 16:30:39 +00:00
Karmjit Mahil
821da19046 pvr: Add multi layer passthough vert shader upload in device.
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/20055>
2023-01-04 16:30:39 +00:00
Karmjit Mahil
37e8e0a494 pvr: Change "ID" to "id" in instance_ID_modifier.
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/20055>
2023-01-04 16:30:39 +00:00
Corentin Noël
305f0de7a3 ci: Remove MESA_ARM_BUILD_TAG environment variable
Its value is already the same as MESA_IMAGE_TAG so no need to duplicate it.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20488>
2023-01-04 16:02:02 +00:00
Corentin Noël
37d56a0576 ci: Bump crosvm and virglrenderer versions
Update virglrenderer and crosvm to the latest version on time.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20488>
2023-01-04 16:02:02 +00:00
Gert Wollny
234e8fd157 r600/sfn: make sure we return a non-negative number of registers
If a shader doesn't use any register and only ssa values we might
end up with zero minimum registers, and because a unsigned is
returned that goes wrong.

Fixes: 565816dfa15214abbeef9a9d94e44f30507ca4d7
    r600/sfn: Set minimum required registers based on array allocation

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

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20516>
2023-01-04 14:45:33 +00:00
Samuel Pitoiset
c3e2e71b50 radv: rework generating the PS epilog key
Generating a PS epilog key will also be used when compiling PS epilogs
on-demand. This introduces a new helper that generates it.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20485>
2023-01-04 13:15:03 +00:00
Samuel Pitoiset
4f6f53a18a radv: simplify removing unused color exports
If CB_TARGET_MASK (color write mask) is 0 for a given MRT, this implies
that the color format is 0 because the driver compacts MRTs.

No fossils-db changes.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20485>
2023-01-04 13:15:03 +00:00
Danylo Piliaiev
476a1552c1 docs/freedreno: Extract debug tooling docs and improve gpu dbg docs
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20492>
2023-01-04 12:31:52 +00:00
Rhys Perry
f5de21336b radv/winsys: set has_3d_cube_border_color_mipmap for null winsys
Without this, NIR->LLVM will set level_zero to false, crashing compilation
of some GFX11 shaders with LLVM (image_gather4_c_o is not supported, while
image_gather4_c_lz_o is).

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/20483>
2023-01-04 11:46:37 +00:00
Danylo Piliaiev
e176eb6c39 docs/freedreno: Extract LRZ docs from tu_lrz
Most of the docs describe HW and are not specific to Turnip.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20491>
2023-01-04 11:12:14 +00:00
Samuel Pitoiset
22543653d5 radv: fix multiple resolves in the same subpass
If there is multiple resolves, the driver shouldn't always select the
fragment path because it doesn't work for all images.

Fixes dEQP-VK.pipeline.monolithic.multisample.misc.*

Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19986>
2023-01-04 08:24:36 +01:00
Ian Romanick
043508d8f8 glsl: Remove bit_count lowering
As far as I can tell, every driver that supports GLSL 1.30 or
GL_EXT_gpu_shader4 (and therefore also enables support for
GL_MESA_shader_integer_functions) also sets the NIR lower_bit_count
flag.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20323>
2023-01-03 18:37:53 -08:00
Ian Romanick
abe5acf7fd glsl: Remove bitfield_reverse lowering
As far as I can tell, every driver that supports GLSL 1.30 or
GL_EXT_gpu_shader4 (and therefore also enables support for
GL_MESA_shader_integer_functions) also sets the NIR
lower_bitfield_reverse flag.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20323>
2023-01-03 18:37:53 -08:00
Ian Romanick
f5722c4973 glsl: Remove bitfield_extract and bitfield_insert lowering
As far as I can tell, every driver that supports GLSL 1.30 or
GL_EXT_gpu_shader4 (and therefore also enables support for
GL_MESA_shader_integer_functions) also sets some subset of the various
NIR lower_bitfield_extract and lower_bitfield_insert flags.

v2: Declaration of 'result' still needs to be added to the IR. Noticed
by marge.

v3: Fix 'git rebase --autosquash' putting the v2 fix in the wrong
place. I've never seen that happen before. :(

Reviewed-by: Emma Anholt <emma@anholt.net> [v1]
Reviewed-by: Matt Turner <mattst88@gmail.com> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20323>
2023-01-03 18:37:53 -08:00
Ian Romanick
db241fbd70 nir: Don't allow conflicting bitfield lowering passes
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20323>
2023-01-03 18:37:53 -08:00
Ian Romanick
8ab7ec0129 intel/compiler: Enable lower_bitfield_extract_to_shifts and lower_bitfield_insert_to_shifts for pre-Gfx7
GLSL IR opcodes generated for bitfieldExtract and bitfieldInsert are
lowered by lower_instructions.  4dff3ff005 ("nir/opt_algebraic:
Optimize open coded bfm.") adds an optimization that can rematerialize
nir_op_bfm that was prevented by the GLSL IR lowering.

It appears that every piece of hardware, except older Intel GPUS, that
has real integers (i.e., lower_bitops is not set) also sets
lower_bitfield_extract_to_shifts and lower_bitfield_insert_to_shifts.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Fixes: 4dff3ff005 ("nir/opt_algebraic: Optimize open coded bfm.")
Closes: #7874
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20323>
2023-01-03 18:37:53 -08:00
Jason Ekstrand
13f7ef5e0c util: Drop the ENUM_PACKED macro
We have both PACKED and ENUM_PACKED macros which expand to the same
thing.  PACKED was based on a meson check for function attributes while
ENUM_PACKED appears to be a legacy gallium thing which was based on
defined(__GCC__).  This changes the one use of ENUM_PACKED to PACKED and
deletes ENUM_PACKED.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20412>
2023-01-04 01:09:32 +00:00
Emma Anholt
58e6d8eee2 ci: Update the skqp testing docs and retire the old runner script.
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20070>
2023-01-04 00:34:33 +00:00
Emma Anholt
0cff5d51ac ci/intel: Switch skqp testing over to deqp-runner.
The skqp runner gets us parallel execution, automatic caselist handling,
nice reports, and the same xfail/flake handling you know and love from
deqp and piglit.

And, now that we have flake handling, we can turn the tests back on!

Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20070>
2023-01-04 00:34:33 +00:00
Emma Anholt
2c69052fd5 ci/amd: Switch raven skqp testing over to deqp-runner.
The skqp runner gets us parallel execution, automatic caselist handling,
nice reports, and the same xfail/flake handling you know and love from
deqp and piglit.

Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20070>
2023-01-04 00:34:33 +00:00
Emma Anholt
eedc1cdef4 ci/freedreno: Switch skqp testing to using deqp-runner.
The skqp runner gets us parallel execution, automatic caselist handling
(which would have prevented a recent regression due to some skqp tests
having been forgotten in the checked in caselists), nice reports, and the
same xfail/flake handling you know and love from deqp and piglit.

Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20070>
2023-01-04 00:34:33 +00:00
Adam Jackson
fe1294e17a glx: Remove the GetProcAddress special case for indirect rendering
Some GL entrypoints would be aliased in an API sense but have different
GLX protocol. The only one that matters to us is EXT_texture_object,
which is the pre-GL-1.1 API. We're just going to drop support for that
and assume you have 1.1 or better, since 1.0 + EXT_texture_object is a
vanishingly rare combo at this point.

Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20300>
2023-01-03 23:36:26 +00:00
Adam Jackson
b090246ad2 glx: Only compute client GL extensions for indirect contexts
This is sort of a spiky way to do it, but the effect is to send the
appropriate SetClientInfo twice for indirect screens, where the second
one fills in the GL extensions. We can get away with this because the
only place the string is used is when the server computes the reply for
glGetString(GL_EXTENSIONS), which never matters for direct contexts.

Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20300>
2023-01-03 23:36:26 +00:00
Adam Jackson
4ccd253588 glx: Require GLX 1.3
GLX is a means to the end of direct rendered GL, really. Our indirect
protocol support has been largely untouched forever, anyone who wants it
can find it in amber. We're not going to drop or intentionally break it
(indirect support), but we're also not going to try super hard to
preserve its quirks anymore.

xserver has typically supported GLX 1.4 since 2009 (xserver 1.8, ad5c0d9e)
and unconditionally since 2016 (xserver 1.19, 36bcbf76). Assuming GLX
1.3 internally will let us fix some GLX drawable lifetime issues.

Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20300>
2023-01-03 23:36:26 +00:00
Adam Jackson
19c57ea3bf glx: Remove pointless GLX_INTEL_swap_event paranoia
It's not our job to filter this out, it's the server's job to not send
events that haven't been selected for. We'll still throw the event away
if we don't have any client-side state for it though.

Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20300>
2023-01-03 23:36:26 +00:00
Adam Jackson
0c043116c7 glx: Drop GLX_MESA_{pixmap_colormap,release_buffers} stubs
Whatever compatibility purpose these served has long since passed.

Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20300>
2023-01-03 23:36:26 +00:00
Adam Jackson
ce8291f030 glx: Replace FreeB 2.0 text with SPDX-License-Identifier: SGI-B-2.0
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20300>
2023-01-03 23:36:26 +00:00
Adam Jackson
cc93f08f1e glx: Remove dead declarations from <GL/glx.h>
MESA_swap_control is defined in glxext.h now. MESA_swap_frame_usage was
removed in Mesa 7.9 in 2010. The other two were never specified or
implemented.

Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20300>
2023-01-03 23:36:26 +00:00
Adam Jackson
ac02a860a1 include: Sync <GL/glxext.h> with Khronos
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20300>
2023-01-03 23:36:26 +00:00
Pavel Ondračka
421bf657bf r300: don't convert to constant swizzles when translating from TGSI
We currently convert it twice for unknown reasons, first when
translating from TGSI and later in constant folding. Not only is this
unnecessary, the first translation doesn't check for non-native
swizzles, so removing it actually saves few instructions and gains
a single Unigine shader for R300 at the expense of few more constant
loads and temps.

Also fixes few dEQPs because we could previously generate code like
TEX temp[1], none.01__, 2D[0];
and the native swizzle rewrite pass was not ready for it.

RV370 shader-db:

total instructions in shared programs: 84441 -> 84436 (<.01%)
instructions in affected programs: 63 -> 58 (-7.94%)
helped: 4
HURT: 0

total temps in shared programs: 12398 -> 12400 (0.02%)
temps in affected programs: 10 -> 12 (20.00%)
helped: 1
HURT: 3

total consts in shared programs: 79081 -> 79090 (0.01%)
consts in affected programs: 12 -> 21 (75.00%)
helped: 0
HURT: 7

GAINED: shaders/tropics/465.shader_test FS

No shader-db change with RV530.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20484>
2023-01-03 23:23:26 +00:00
Pavel Ondračka
7decc7efba r300: allow copy propagate of RC_FILE_NONE reads to TEX instructions
Texturing instructions can't read from constant sources, however this
can work when the constant was transformed to constant swizzles and
hence RC_FILE_NONE.

Prevents a regression in single Unigine Tropics shader that uses
constant (0.5,0.5) as a TEX coordinate in a next patch. We now
convert to constant swizzles twice, first when translating from TGSI
and than in constant folding. If we disable the first conversion
rc_transform_tex will emit a mov from constant to temporary. With this
patch, copy propagate will clean it up later.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20484>
2023-01-03 23:23:26 +00:00
Pavel Ondračka
d869f0f7ca r300: don't copy propagate constant swizzles to KIL on R300
Transforming
0: MOV temp[1], -none.1111;
1: KIL temp[1];
 to
0: KIL -none.1111;

Doesn't work on R300 while it works just fine with R500.

Prevents a regression when we enable the copy propagate of RC_FILE_NONE
to texture instructions in the next commit.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20484>
2023-01-03 23:23:26 +00:00
Georg Lehmann
39b7502f04 aco: Use v_mov_b16 on GFX11.
Foz-DB GFX1100:
Totals from 4684 (3.47% of 134913) affected shaders:
CodeSize: 41086444 -> 41043476 (-0.10%)
Instrs: 8176019 -> 8175995 (-0.00%)
Latency: 83792071 -> 83792023 (-0.00%)
InvThroughput: 10311371 -> 10311369 (-0.00%)

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20369>
2023-01-03 22:49:46 +00:00
Jesse Natalie
c2790fe537 CI/Windows: Use waffle instead of freeglut for piglit
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20466>
2023-01-03 22:20:41 +00:00
Jesse Natalie
4e03f1f8a1 CI/Windows: Update piglit for Waffle fix
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20466>
2023-01-03 22:20:41 +00:00
Rob Clark
9721d1d615 docs/freedreno: Add bindless/bindful descriptor docs
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20456>
2023-01-03 21:56:28 +00:00
Rob Clark
3b2e1b2d32 freedreno/registers: Cleanup bindless-base regs
Make it clear that the low two bits of the 64b address is it's own
bitfield.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20456>
2023-01-03 21:56:28 +00:00
Rob Clark
3fa2ce0890 freedreno/registers: Fix bo fields with low != 0
We need to add the missing left-shift.  And a right-shift is negative!

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20456>
2023-01-03 21:56:28 +00:00
Rob Clark
ffb77c8be6 freedreno/decode: Improved reg64 decoding
This also (other than for an a5xx hack) gets rid of relying on
type0_reg_vals which isn't updated in all paths.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20456>
2023-01-03 21:56:28 +00:00
Rob Clark
59f2748163 freedreno/decode: Add rnn_reginfo_free() helper
Simplify things a bit.. and fix a few places that just leaked the
rnndecaddrinfo.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20456>
2023-01-03 21:56:28 +00:00
Rob Clark
9feea4e7c0 freedreno/registers: Fix reg64 support
The maximum "high" position depends on 32b vs 64b registers.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20456>
2023-01-03 21:56:28 +00:00
Sil Vilerino
e34c0a3116 ci: Update mingw and vs2019 libva build dependency to libva/releases/tag/2.17.0
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20498>
2023-01-03 20:12:38 +00:00
Konstantin Seurer
ce7155b8a0 radv: Use the correct pipeline layout for LBVH IR generation
Fixes: 5ba950e ("radv: Switch to new LBVH implementation.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20481>
2023-01-03 19:53:40 +00:00
Adam Stylinski
50972297f4 nv30: Fix an offset for vbos being applied to a buffer twice
Similar to 1387d1d4, this offset was being applied twice (once in
translate_generic, and once when the buffer is mapped).

This fixes 7972, which was initially thought to be an endianness
specific issue.

CC: mesa-stable
Tested-by: Filip Gawin <filip@gawin.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20468>
2023-01-03 19:40:23 +00:00
Yiwei Zhang
0409834ca2 ci: update venus-lavapipe test expectations
Remove fixed push descriptor tests from expected failures.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20471>
2023-01-03 19:26:42 +00:00
Yiwei Zhang
33b778cc36 venus: properly ignore the sampler for immutable sampler
This was found while debugging venus-lavapipe ci failure. It's a real
bug though no tests have caught this yet, but fixing this would regress
venus-lavapipe non-templated push tests if without the dependent lvp
fix. The sampler in the descriptor write can be garbled if the binding
has immutable samplers.

cc: mesa-stable

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20471>
2023-01-03 19:26:42 +00:00
Yiwei Zhang
9a104f6348 lvp: properly ignore sampler write for immutable sampler
The issue is hidden due to a overly relaxed cts:
dEQP-VK.binding_model.shader_access.primary_cmd_buf.with_push*
that doesn't scrub the sampler from descriptor writes for immutable
samplers. The issue is exposed via venus-lavapipe ci because venus must
ignore the potentially garbled sampler. This change aligns the
VK_DESCRIPTOR_TYPE_SAMPLER path with the
VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER path by removing a false check
against the provided sampler from push since the sampler can be null. An
alternative is to also check against !binding->immutable_samplers there.

Test: venus-lavapipe with venus push descriptor support

cc: mesa-stable

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20471>
2023-01-03 19:26:42 +00:00
Jesse Natalie
531d17c334 spirv2dxil: Support linking multiple shaders
This probably could/should be split up into multiple commits, but
it's simpler to make this a monolithic change.

This change inlines a bunch of logic from spirv_to_dxil into the
spirv2dxil tool so that linking can be done on the nir shaders.
Probably the linking functionality should be exposed in the lib/dll
form too, which means that a helper for freeing intermediate nir
would be needed too. That's TODO for now.

The tool now requires arguments to be in-order, and once a filename
is encountered, will use the previous arguments to compile the shader.
If multiple graphics shaders are passed, they're linked as if they
were forming a pipeline together.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20440>
2023-01-03 18:42:45 +00:00
Jesse Natalie
ac7abf0483 spirv2dxil: Rename and move prep helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20440>
2023-01-03 18:42:45 +00:00
Jesse Natalie
31d722b706 CI/Windows: Use deqp-runner for D3D12 piglit
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20454>
2023-01-03 17:43:30 +00:00
Chad Versace
0a256f79d4 vulkan/runtime: Preserve pNext when upgrading to synchronization2 structs
The functions that upgraded VkFooMemoryBarrier to VkFooMemoryBarrier2
dropped the pNext pointers. It loses VkSampleLocationsInfoEXT, and may
lose additional structs too if VkFooMemoryBarrier receives further
extensions in the future.

Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20477>
2023-01-03 17:20:30 +00:00
Samuel Pitoiset
b0f07a3e85 radv: determine the gfx scratch size at pipeline bind time
This doesn't need to be in the draw path.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20299>
2023-01-03 16:58:13 +00:00
Samuel Pitoiset
c2a4bdf114 radv: dirty all dynamic states when beginning a new cmdbuf
Sounds safer to not rely on other cmdbuf states.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20299>
2023-01-03 16:58:13 +00:00
Samuel Pitoiset
18306d3231 radv: dirty states when beginning a cmdbuf instead of when a pipeline is bound
To reduce CPU overhead of radv_emit_graphics_pipeline().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20299>
2023-01-03 16:58:13 +00:00
Samuel Pitoiset
6aaba10c6e radv: move emitting the strmout buffer in CmdDrawIndirectByteCountEXT()
This doesn't need to be in the generic draw path because only one
draw command uses it.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20299>
2023-01-03 16:58:13 +00:00
Samuel Pitoiset
cb0a17652d radv: flush DFSM on CB_TARGET_MASK changes when it's emitted
To avoid performing the same check twice and to emit it at the right
place.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20299>
2023-01-03 16:58:13 +00:00
Sil Vilerino
fb0038f489 frontends/va: Update state var frame_num disregarding cap check
The frame_num variable must be updated for encode entrypoint disregarding
the outcome of the PIPE_VIDEO_CAP_REQUIRES_FLUSH_ON_END_FRAME cap check

fixes: 229c6f79a6 ("frontends/va: Implement vaSyncBuffer")

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20490>
2023-01-03 16:26:27 +00:00
Rhys Perry
1825ad134b radeonsi,radv/llvm: fix amdgpu-color/depth-export with epilogs
The main shader wouldn't use ac_build_export(), and the discard exit would
have no export.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Fixes: 1174ab6d56 ("ac/llvm: use amdgpu-color-export/amdgpu-depth-export")
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Tested-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7991
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20482>
2023-01-03 15:32:56 +00:00
David Heidelberg
c68530bedb postprocess: move the definition of pp_filters into **/pp_init.c
An LTO-friendly move.

Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7881

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20374>
2023-01-03 14:45:28 +00:00
David Heidelberg
f43cd04228 ci: build test LTO
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20374>
2023-01-03 14:45:28 +00:00
Mike Blumenkrantz
7ab5c5d36d zink: use EXT_descriptor_buffer with ZINK_DESCRIPTORS=db
this should be bug-free, as it passes cts/piglit/gaming on multiple drivers,
but since it's new, it stays behind an env var for at least one release

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20489>
2023-01-03 09:20:45 -05:00
Mike Blumenkrantz
20e1474c2c zink: move some descriptor data into a substruct
no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20489>
2023-01-03 09:19:31 -05:00
Mike Blumenkrantz
885e5a3571 Revert "zink: remove descriptor-mode selection infrastructure"
this would've been in-use, but khronos changes while I was on vacation
blocked a merge

This reverts commit 3f371d4e94.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20489>
2023-01-03 09:19:31 -05:00
Tapani Pälli
97f2b60833 anv: implement Wa_14015814527 for task shaders
After using task shader, we need to emit a zero URB state and a
nullprim (empty pipe control) before rendering with primitives.

After this, a normal URB state needs to be returned, this will
happen when pipeline batch is emitted during pipeline switch.

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/20334>
2023-01-03 12:44:08 +00:00
Pavel Ondračka
53d9b696e4 nir: basic tests for nir_opt_shrink_vectors
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20213>
2023-01-03 12:32:33 +01:00
Pavel Ondračka
3305c9602d nir: fix shrinking of load_const for large vectors
Specifically when shrinking load_const with number of components
> 5, if the final number of components is not allowed (for example 8->6)
it would report false for progress even if we actually did some
reshuffling and also it would skip on the rewrite of the readers.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20213>
2023-01-03 12:32:33 +01:00
Pavel Ondračka
cb7f201288 nir: remove duplicate alu channels in nir_opt_shrink_vectors
This will clean code like:
   vec3 32 ssa_8 = frcp ssa_7.www
   vec3 32 ssa_9 = fmul ssa_7.xyz, ssa_8
into
   vec1 32 ssa_8 = frcp ssa_7.w
   vec3 32 ssa_9 = fmul ssa_7.xyz, ssa_8.xxx

This helps r300 driver because we can only do single channel for math
ops at a time, so the first version would result in three frcp
instructions. The nir_opt_shrink_vectors comments even claim the pass
should be doing this, however it actually does it only for nir_op_vecx
instructions, so extend this for generic alu instructions.

RV530 shader-db:
total instructions in shared programs: 135032 -> 133707 (-0.98%)
instructions in affected programs: 46121 -> 44796 (-2.87%)
helped: 452
HURT: 26
total temps in shared programs: 17051 -> 17033 (-0.11%)
temps in affected programs: 1509 -> 1491 (-1.19%)
helped: 91
HURT: 30

12.02->12.08 (+0.5%) fps gain in Unigine Sanctuary (n=5) with RV530

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7051
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reiewed-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20213>
2023-01-03 12:32:33 +01:00
Alyssa Rosenzweig
980df9ede1 pan/bi: Move Bifrost specific C code to src/compiler/bifrost
The goal is to make files at the root of src/compiler/ apply to both Bifrost and
Valhall, while ISA-specific code (e.g. instruction packing) code goes in
compiler/bifrost/ or compiler/valhall/. This is what Valhall is already doing,
the Bifrost specific stuff was just grandfathered in.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20455>
2023-01-02 17:54:49 +00:00
Alyssa Rosenzweig
551c2aadd4 pan/bi: Remove standalone compiler
This functionality is now available on Linux with drm-shim + shader-db, and I
suspect the version bundled here is broken anyway. Strictly this drops
Windows/macOS support for the known-broken frontend to the shader compiler but I
can't say I'm terribly worried about that.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20455>
2023-01-02 17:54:48 +00:00
Alyssa Rosenzweig
1a35acd8d9 pan/bi: Rename panfrost/bifrost -> panfrost/compiler
This is the compiler for both Bifrost and Valhall, and presumably future
Mali GPUs too. Give it a more generic name so we can use the bifrost/ path for
something a bit more specific.

For historical reasons the compiler's name is still "bifrost" and uses the
prefix `bi_`. I think that's ok in the same way that i915 in the kernel supports
way more than just i915.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20455>
2023-01-02 17:54:48 +00:00
Sviatoslav Peleshko
261a334509 hasvk: Add layer with work-around for Doom 64 texture corruption
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7817
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19502>
2023-01-02 15:05:06 +00:00
Sviatoslav Peleshko
c2acd9f76a anv: Add layer with work-around for Doom 64 texture corruption
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7817
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19502>
2023-01-02 15:05:06 +00:00
Konstantin Seurer
28ee90bc7f radv: Add an app layer driconf and use it for Metro Exodus
To make adding more application layers easier.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20439>
2023-01-02 14:39:23 +00:00
Konstantin Seurer
1525063055 radv: Clean up entrypoints generation
This should make it easier to add new tracing and application layers.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20439>
2023-01-02 14:39:23 +00:00
Konstantin Seurer
124a405f6f radv: Use multiple dispatch tables for layers
Every layer has its own dispatch table that it can use to call down the
layer stack. This allows us to use RRA and RGP tracing simultaneously.
Using application layers with tracing should work as well.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20439>
2023-01-02 14:39:23 +00:00
Konstantin Seurer
0821f76fd7 radv: Move dispatch table init into a separate function
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20439>
2023-01-02 14:39:23 +00:00
Konstantin Seurer
b0e55c4d60 vulkan: Allow passing NULL dispatch tables to vk_device_init
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20439>
2023-01-02 14:39:23 +00:00
Gert Wollny
8ad6b10a01 r600: Don't merge alu groups with variable length dot using t-slot
Since the variable length dot must stay in its slot configuration
do not try to merge the group with the previous group when an op may be
moved to the t slot, because this may lead to breaking the multi-slot
operation.

Fixes:  357e5fac99
   r600/sfn: Use variable length DOT on Evergreen and Cayman

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20451>
2023-01-02 14:31:35 +00:00
Gert Wollny
9fd9f3cd10 r600/sfn: Set minimum required registers based on array allocation
In the rare case that after register allocation the highest directly
accessed register index is below the highest value used for an
indirectly accessed array we have to ensure that the shader allocates
enough registers to account for these indices that are not seen by the
assembler.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7966
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20451>
2023-01-02 14:31:35 +00:00
Gert Wollny
8348c9c84d r600: enable ARB_gl_spirv
76 out of 86 piglits pass.
Some fail because SSBOs are only supported for FS and CS on r600, but
the piglits try to use SSBOs with VS, and there are piglits that try to
bind SSBO at 8, and only 0-7 is supported as binding point.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20451>
2023-01-02 14:31:35 +00:00
Gert Wollny
0ff00cfe97 r600: Fix early exit when setting SSBOs
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20451>
2023-01-02 14:31:35 +00:00
Gert Wollny
ff4de13c70 r600/sfn: Fix FS primid input slot
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20451>
2023-01-02 14:31:35 +00:00
Gert Wollny
c69f2fe5fd r600/sfn: Fix warning for mixed use of enum and integer
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20451>
2023-01-02 14:31:35 +00:00
Gert Wollny
2df023a1f1 r600/sfn: pre-evaluate allowed dest mask in Alu instructions
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20451>
2023-01-02 14:31:35 +00:00
Gert Wollny
e2eb7cd3d8 r600/sfn: move handling of legacy math rules to assembler
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20451>
2023-01-02 14:31:35 +00:00
Erico Nunes
46a493a2f0 st/mesa: Fix free of non-shareable shaders on context destroy
On drivers that do not set PIPE_CAP_SHAREABLE_SHADERS,
st_destroy_program_variants() may reach st_save_zombie_shader()
which accesses st->zombie_shaders.mutex.
Destroying st->zombie_shaders.mutex before destroying program variants
may result in an invalid access in a multiple context scenario for
those drivers.
Move the mutex destroy call to after program variants destroy so that
it doesn't hit a deadlock on context destroy.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20458>
2023-01-02 13:50:52 +00:00
Rhys Perry
1174ab6d56 ac/llvm: use amdgpu-color-export/amdgpu-depth-export
These are necessary to use the correct export target on GFX11:
https://reviews.llvm.org/D128185

Fixes artifacts on Lara in Rise of the Tomb Raider benchmark and hair in
The Witcher 3 (classic).

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20357>
2023-01-02 12:00:04 +00:00
Timur Kristóf
d496f0b97d radv: Decouple radv_before_taskmesh_draw from radv_before_draw.
radv_before_taskmesh_draw will no longer call radv_before_draw and
instead implement the necessary functionality on its own.

radv_before_draw will no longer have to emit mesh shader descriptors.

As a result, both functions should have a lower CPU overhead now.

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/18829>
2023-01-02 12:24:42 +01:00
Samuel Pitoiset
050c39c92f radv: fix missing initialization of radv_resolve_barrier::dst_stage_mask
Otherwise, this value is unitialized when read in
radv_ace_internal_barrier().

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7909
Fixes: 4c6f83006d ("radv: Synchronization for task shaders.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20351>
2023-01-02 08:04:29 +01:00
Marek Olšák
fc0e23b6dd iris: implement PIPE_CAP_MAP_UNSYNCHRONIZED_THREAD_SAFE
required by glthread

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20379>
2023-01-01 16:00:07 -05:00
Marek Olšák
b9caddb4a7 glthread,gallium: add a CAP to disable glBufferSubData optimization in glthread
it regresses performance on iris

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20379>
2023-01-01 16:00:07 -05:00
Daniel Schürmann
83b31b11a5 aco: Reassign dead definitions of p_split_vector to associated register
Any unused split_vector definition can always use the same register
as the operand. This avoids creating unnecessary copies.

Fossil DB stats on Rembrandt (RDNA2):
Totals from 3904 (2.89% of 134906) affected shaders:
CodeSize: 18326692 -> 18271688 (-0.30%)
Instrs: 3386632 -> 3372888 (-0.41%)
Latency: 42337481 -> 42330085 (-0.02%); split: -0.02%, +0.00%
InvThroughput: 6566731 -> 6566424 (-0.00%); split: -0.01%, +0.00%
Copies: 224301 -> 210559 (-6.13%)

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16161>
2023-01-01 15:04:07 +01:00
Timur Kristóf
75b1027722 aco: Try to reassign split vector registers post-RA.
Eliminate unnecessary copies when the operand registers of a
p_split_vector instruction are not clobbered between the p_split_vector
and the user of its definitions.

This happens when p_split_vector doesn't kill its operand and its
definitions have a shorter lifespan that the operand. It affects every
NGG culling shader among other things.

This optimization exists because it's too difficult to solve it
in RA, and should be removed after we solved this in RA.

v2 by Daniel Schürmann:
- Rearrange and simplify conditions for the new optimization
- Fix a few bugs

v3 by Daniel Schürmann:
- Check number of encoded ALU operands

Fossil DB stats on Rembrandt (RDNA2):
Totals from 64896 (48.10% of 134906) affected shaders:
CodeSize: 175693348 -> 175434944 (-0.15%)
Instrs: 33333912 -> 33269388 (-0.19%)
Latency: 183766084 -> 183763432 (-0.00%); split: -0.00%, +0.00%
InvThroughput: 28589651 -> 28589340 (-0.00%); split: -0.00%, +0.00%
Copies: 2806550 -> 2742038 (-2.30%)

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/16161>
2023-01-01 15:04:07 +01:00
Timur Kristóf
3d29779a25 aco/optimizer_postRA: Distinguish overwritten untrackable and subdword.
This allows is_overwritten_since to return false when the last
writer instruction of a register can't be tracked but we know it wasn't
written in the current block.

Fossil DB stats on Rembrandt (RDNA2):
Totals from 1163 (0.86% of 134906) affected shaders:
CodeSize: 9815920 -> 9805016 (-0.11%)
Instrs: 1843688 -> 1840962 (-0.15%)
Latency: 19219153 -> 19209171 (-0.05%)
InvThroughput: 3354375 -> 3353852 (-0.02%)

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/16161>
2023-01-01 15:04:07 +01:00
Daniel Schürmann
d3b0f78110 aco/optimizer_postRA: Initialize loop header with preheader information
This works because of SSA and should be safer than just setting 'not_written_yet'.

No Fossil DB changes on Rembrandt (RDNA2).

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16161>
2023-01-01 15:03:57 +01:00
Daniel Schürmann
8f4eccb138 aco: fix reset_block_regs() in postRA-optimizer
Accidentally, we picked the index of the predecessors instead of the predecessors.

Totals from 8496 (6.30% of 134913) affected shaders: (GFX10.3)
CodeSize: 64070724 -> 64022516 (-0.08%); split: -0.08%, +0.00%
Instrs: 11932750 -> 11920698 (-0.10%); split: -0.10%, +0.00%
Latency: 144040266 -> 144017062 (-0.02%); split: -0.02%, +0.00%
InvThroughput: 29327735 -> 29326421 (-0.00%); split: -0.00%, +0.00%

Fossil DB stats on Rembrandt (RDNA2):
Totals from 4488 (3.33% of 134906) affected shaders:
CodeSize: 42759736 -> 42735392 (-0.06%); split: -0.06%, +0.00%
Instrs: 7960522 -> 7954436 (-0.08%); split: -0.08%, +0.00%
Latency: 96192647 -> 96172571 (-0.02%); split: -0.02%, +0.00%
InvThroughput: 19313576 -> 19312575 (-0.01%); split: -0.01%, +0.00%

Fixes: 75967a4814 ('aco/optimizer_postRA: Speed up reset_block() with predecessors.')
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16161>
2023-01-01 15:03:51 +01:00
Gert Wollny
b2dc63ed8c aux/trace: Add pipe_context::set_hw_atomic_buffers
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20453>
2023-01-01 13:18:54 +00:00
Konstantin Seurer
37cb882883 radv: Advertise rt pipelines for DOOM Eternal
The game has been fixed recently.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20464>
2022-12-31 20:24:54 +00:00
Konstantin Seurer
4125a35c9c radv: Advertise rt pipelines for Quake II RTX
The game has been working for a while now.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20464>
2022-12-31 20:24:54 +00:00
Konstantin Seurer
ea38efb17e radv: Add a driconf to advertise rt pipelines
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20464>
2022-12-31 20:24:54 +00:00
Christian Gmeiner
9e56f69edf isaspec: encode: handle special fieldname properties
Without this change a fieldname like '{DST::align=12}' was not used for
encoding. Change the regex to include such fieldnames and remove the fieldname
property in a later step.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20462>
2022-12-31 13:43:15 +00:00
Jordan Justen
4429bdd7f5 drm-shim: Use hide_drm_device_path() to hide other drm devices
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19241>
2022-12-30 15:51:11 -08:00
Jordan Justen
b39044fd9f drm-shim: Add hide_drm_device_path()
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19241>
2022-12-30 15:51:07 -08:00
Jordan Justen
d7ed05d1ba drm-shim: Convert nfasprintf and nfvasprintf to functions
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19241>
2022-12-30 15:50:36 -08:00
Rob Clark
c9a4c0f22a freedreno/a6xx: Linewrap
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20465>
2022-12-30 10:41:55 -08:00
Rob Clark
d75a1bb4d0 freedreno: Fix use_fence_fd typo
This was causing excessive flushes, because requesting an out-fence fd
triggers the drm layer to flush deferred submits instead of continued
merging.

Fixes: 48b5164356 ("freedreno/drm: Return fence from submit flush")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20465>
2022-12-30 10:41:55 -08:00
Rob Clark
92e6fea7df freedreno/drm: Flush deferred submits at context teardown
If we don't flush deferred submits, we could end up waiting on a fence
that is never signaled.

Fixes: 48b5164356 ("freedreno/drm: Return fence from submit flush")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20465>
2022-12-30 10:41:55 -08:00
Rob Clark
4441a41629 freedreno: Add some more traces
Add some more traces around fence waits to better see potential stalls.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20465>
2022-12-30 08:42:10 -08:00
Rob Clark
89286632a2 freedreno: Remove some impossible NULL checks
There is only one special case (a3xx/a4xx queries) were a pipe_resource
is allocated without a backing buffer (because we don't know the needed
size until we know the # of bins).  But those will never end up as an
a6xx render target!

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20465>
2022-12-30 08:42:02 -08:00
Konstantin Kharlamov
05ca7d114e bin/gen_release_notes.py: read Closes/Fixes tags case-insensitively
Cc: mesa-stable
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20241>
2022-12-30 03:39:38 +03:00
Konstantin Kharlamov
e67578a264 bin/gen_release_notes.py: parse "Fixes" tags as well as "Closes"
Some commits refer to bugs being fixed with "Fixes" tag. Example of one:

    e13d53e1fd 'Revert "glx/dri: Fix DRI drawable release at MakeCurrent time"'

Parse this tag as well.

Cc: mesa-stable
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20241>
2022-12-30 03:39:38 +03:00
Konstantin Kharlamov
52cd87ea16 bin/gen_release_notes.py: don't fail if "Closes" refers to an MR
Sometimes a tag "Closes:" in a commit may refer to a merge request
instead of an issue. Examples of such commits:

    34319c7d84 "ci/freedreno: disable antichambers trace"
    998122d9c2 "mesa: fix GL_INVALID_OPERATION in glEGLImageTargetTexStorageEXT"

Avoid failing on these by explicitly checking that the URL refers to an
issue

Cc: mesa-stable
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20241>
2022-12-30 03:39:38 +03:00
Konstantin Kharlamov
334123a908 bin/gen_release_notes.py: do not fail on confidential features
A commit may refer to an issue marked as confidential. That will look
like a 404 page for outside users. One example of such commit is:

    369c12e5be "anv: clear descriptorsets if AllocateDescriptorSets fails"

Let's handle that case.

Cc: mesa-stable
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20241>
2022-12-30 03:39:38 +03:00
Konstantin Kharlamov
bd807eecd1 bin/gen_release_notes.py: do not end "features" with "None"
Currently, the "New features" list unconditionally ends with a "None"
point, which makes no sense. The original author probably meant to check
whether the file is empty, so remove the else clause, and add the check
for emptiness.

Cc: mesa-stable
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20241>
2022-12-30 03:39:37 +03:00
Eric Engestrom
cf24b70dc6 docs: update calendar for 22.3.2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20457>
2022-12-29 23:09:54 +00:00
Eric Engestrom
b22dd4d2d3 docs: add release notes for 22.3.2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20457>
2022-12-29 21:20:19 +00:00
Eric Engestrom
980d6a91ee gen_release_notes: strip second newline in new features
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20132>
2022-12-29 19:20:07 +00:00
Rob Clark
75eb0d2891 freedreno/ir3: Allow isam for non-bindless ssbo loads
We already had the infrastructure for this, dating back to a5xx, so this
is low hanging fruit to hit the faster isam path.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20429>
2022-12-29 17:42:42 +00:00
David Heidelberg
7cf7bf8b9e ci/broadcom: add rpi3 flake color_clears.multi_context.gles2.rgba8888_pbuffer
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20452>
2022-12-29 17:21:38 +00:00
José Roberto de Souza
def474e916 intel/genxml/gen12.5: Pipe_Control::Remove Global Snapshot Count Reset
It was not meant to be used(Iris have assert for it) and it was
removed from Pipe_Control instruction in gen12.5 and newer.

BSpec: 47112
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20444>
2022-12-29 08:34:25 -08:00
José Roberto de Souza
c6d1f76da2 anv: Add and use emit_pipeline_select()
To avoid the replication of code to properly emit PIPELINE_SELECT.

init_compute_queue_state() had a different emit of PIPELINE_SELECT but
as there is no compute engine in GFX VER 11 we are safe with the
differences.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20444>
2022-12-29 08:34:15 -08:00
David Heidelberg
57f73d097e ci/iris: add iris-kbl flake
Ref: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7547

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20448>
2022-12-28 23:08:37 +00:00
Erico Nunes
4bd1829a5a ci: Enable gl-renderer in weston for wayland testing
The weston headless backend defaults to gl-renderer disabled, which
exposes a different set of globals and clients may fall back to software
rendering.
Enable gl-renderer so that clients use the hardware drivers.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20391>
2022-12-28 23:18:15 +01:00
Aleksey Komarov
dcae301828 pan/va: Fix MUX.i32 and MUX.v2i16 description. Should be:
`(A &amp; mask) | (B &amp; ~mask)`

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20441>
2022-12-28 21:36:54 +00:00
Aleksey Komarov
d14d7c49db pan/va: Fix d0 description in enum "Load lane (8-bit)"
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20441>
2022-12-28 21:36:54 +00:00
Aleksey Komarov
f102b57423 pan/va: Fix description for constant 0xFAFCFDFE: -2, -3, -4, -6
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20441>
2022-12-28 21:36:54 +00:00
David Heidelberg
db9cd8b5da ci/amd: decrease number of stoney runners
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20443>
2022-12-28 19:30:55 +01:00
Patrick Lerda
2b2824b9ea util/xmlconfig: fix memory leak triggered by duplicates
This change copies the string once.

Direct leak of 196 byte(s) in 14 object(s) allocated from:
    #0 0x7f71598ec7a7 in strdup (/usr/lib64/libasan.so.6+0x5c7a7)
    #1 0x7f70a56ff942 in driParseOptionInfo ../src/util/xmlconfig.c:357
    #2 0x7f70a56f0565 in pipe_loader_load_options ../src/gallium/auxiliary/pipe-loader/pipe_loader.c:126
    #3 0x7f70a56f0565 in pipe_loader_create_screen_vk ../src/gallium/auxiliary/pipe-loader/pipe_loader.c:167

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20026>
2022-12-28 14:06:49 +00:00
Alyssa Rosenzweig
f603d8ce9e asahi: Clang-format the subtree
See 0afd691f29 ("panfrost: clang-format the tree") for why I'm doing this.
Asahi already mostly follows Mesa style so this doesn't do much. But this means
we can all stop thinking about formatting and trust the robot poets to do that
for us.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20434>
2022-12-27 22:46:29 +00:00
Alyssa Rosenzweig
bf93fd46e2 asahi: Clang-format the twiddled tests
There are no outstanding commits to these files in any branch, so they don't
need to be considered for the rebasing script. That said, they are massive and
bottleneck the rebasing script, so we'll want to split them out to keep rebasing
efficient.

(Nominally I should make the rebasing script less stupid but with these files
ignored it works pretty well.)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20434>
2022-12-27 22:46:29 +00:00
Alyssa Rosenzweig
c4c4f0502b asahi: Add missing #include's
Otherwise we won't build after clang-format shuffles headers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20434>
2022-12-27 22:46:29 +00:00
Alyssa Rosenzweig
d9dc77f068 asahi: Add some clang-format commas
Otherwise clang-format will mangle this.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20434>
2022-12-27 22:46:29 +00:00
Alyssa Rosenzweig
c1f175c9fa asahi: Manually format some parts of the code
clang-format will mangle these.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20434>
2022-12-27 22:46:29 +00:00
Alyssa Rosenzweig
de0fcd08d3 asahi: Add .clang-format file
Derived from the Freedreno/Panfrost file, with foreach macros updated.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20434>
2022-12-27 22:46:29 +00:00
Alyssa Rosenzweig
680c873b35 agx: Undo sed fail
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20434>
2022-12-27 22:46:29 +00:00
Tapani Pälli
b9aa66d5d0 anv: disable preemption for 3DPRIMITIVE during streamout
This is required by Wa_16013994831.

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/20438>
2022-12-27 15:53:42 +00:00
Tapani Pälli
910f5a18cf intel/genxml: add disable preemption field for gen125
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/20438>
2022-12-27 15:53:42 +00:00
Lionel Landwerlin
afdbed9e9c anv: fix potential integer overflow
The loop going from 0 to max_draw_count multiplies the value which
could potentially overflow.

Fixes Coverity CID 1517852

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 3596a8ea7a ("anv: factor out some indirect draw count entry points")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20436>
2022-12-27 14:21:44 +00:00
Konstantin Seurer
eb2576902d radv: Use common vkEnumerateDeviceLayerProperties
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20417>
2022-12-27 13:04:30 +00:00
Konstantin Seurer
75619a907b radv: Remove last_primitive_reset_en
last_primitive_reset_en is not used anywhere.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20417>
2022-12-27 13:04:30 +00:00
nihui
e584447aed panvk: Fix null pointer dereference on cmd_buffer->ops
Fixes: 84cd81e104 (panvk: Use common code for command buffer lifecycle
management)

Signed-off-by: Hui Ni <shuizhuyuanluo@126.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20406>
2022-12-26 12:57:07 +00:00
Lionel Landwerlin
2024115b79 intel/ds: add missing generate draws perfetto glue
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7956
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20433>
2022-12-26 14:11:44 +02:00
Asahi Lina
bb4aa8a3ea panfrost: Fix race condition in BO imports
When importing a BO, if it is already imported, then the handle will
alias an existing BO instance. It is possible for the existing owner to
free the BO after the import and leave a dangling handle before we get a
chance to increase the refcount, so we need to lock the BO table mutex
before importing, to make sure nobody else goes through the free path
during that window.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20403>
2022-12-25 22:04:24 +00:00
Asahi Lina
f401599f79 vc4: Fix race condition in BO imports
When importing a BO, if it is already imported, then the handle will
alias an existing BO instance. It is possible for the existing owner to
free the BO after the import and leave a dangling handle before we get a
chance to increase the refcount, so we need to lock the BO table mutex
before importing, to make sure nobody else goes through the free path
during that window.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20403>
2022-12-25 22:04:24 +00:00
Asahi Lina
7dbb1a091a v3d: Fix race condition in BO imports
When importing a BO, if it is already imported, then the handle will
alias an existing BO instance. It is possible for the existing owner to
free the BO after the import and leave a dangling handle before we get a
chance to increase the refcount, so we need to lock the BO table mutex
before importing, to make sure nobody else goes through the free path
during that window.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20403>
2022-12-25 22:04:24 +00:00
Jordan Petridis
8c3c11ad33 Revert "ci: Windows runner is experiencing DNS issues; disable Microsoft farm"
Let's try this again, landed couple config changes on the runners.

This reverts commit c52b7aa732.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20424>
2022-12-25 15:32:39 +00:00
Asahi Lina
ad4d7ca833 kmsro: Fix renderonly_scanout BO aliasing
BOs can only have one handle. If renderonly_create_gpu_import_for_resource
ends up importing a BO that was already mapped for scanout, it will get
the same handle. This leaves us with two renderonly_scanout objects for
one handle, and the first one to be destroyed will free it.

Import the BO map tracking logic from asahi, to avoid aliasing
renderonly_scanout objects. Each actual BO now is only represented by a
single object instance, which is reference counted.

Fixes KWin full-screen PipeWire capture breaking scanout entirely.

Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20397>
2022-12-25 19:23:27 +09:00
Rob Clark
3e568cc6fe freedreno/perfetto: Add grid information for compute jobs
Just something I noticed was missing the other day.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20262>
2022-12-24 17:23:58 +00:00
Alyssa Rosenzweig
b53fa25587 panfrost: Clang-format pan_layout.c
Messed up the "clang-format off" for this file.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Aleksey Komarov <q4arus@ya.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20431>
2022-12-23 21:43:08 -05:00
Alyssa Rosenzweig
0afd691f29 panfrost: clang-format the tree
This switches us over to Mesa's code style [1], normalizing us within the tree.
The results aren't perfect, but they bring us a hell of a lot closer to the rest
of the tree. Panfrost doesn't feel so foreign relative to Mesa with this, which
I think (in retrospect after a bunch of years of being "different") is the right
call.

I skipped PanVK because that's paused right now.

  find panfrost/ -type f -name '*.h' | grep -v vulkan | xargs clang-format -i;
  find panfrost/ -type f -name '*.c' | grep -v vulkan | xargs clang-format -i;
  clang-format -i gallium/drivers/panfrost/*.c gallium/drivers/panfrost/*.h ; find
  panfrost/ -type f -name '*.cpp' | grep -v vulkan | xargs clang-format -i

[1] https://docs.mesa3d.org/codingstyle.html

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20425>
2022-12-24 02:22:57 +00:00
Alyssa Rosenzweig
a4705afe63 panfrost: Fix up some formatting for clang-format
clang-format will make a mess of these otherwise.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20425>
2022-12-24 02:22:57 +00:00
Alyssa Rosenzweig
e35719be6f panfrost: Add missing #includes
Found shuffling headers with clang format.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20425>
2022-12-24 02:22:57 +00:00
Alyssa Rosenzweig
90e128ae03 panfrost: Remove perfetto-specific .clang-format
We'll use the one in src/panfrost/.clang-format instead, which isn't identical
but should be good enough. This way they don't conflict with each other.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20425>
2022-12-24 02:22:57 +00:00
Alyssa Rosenzweig
ee2dcdc3df panfrost: Add clang-format file
Based on freedreno settings, tweaked for panfrost's foreach macros.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20425>
2022-12-24 02:22:57 +00:00
Lionel Landwerlin
c950fe97a0 anv: implement generated (indexed) indirect draws
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15642>
2022-12-23 22:52:50 +00:00
Lionel Landwerlin
3596a8ea7a anv: factor out some indirect draw count entry points
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15642>
2022-12-23 22:52:50 +00:00
Lionel Landwerlin
61b730f1f4 anv: decouple util function from anv_cmd_buffer
The issue we're addressing here is that we have 2 batches and the both
grow at different rate. We want to keep doubling the main batch size
as the application writes more and more commands to limit the number
of GEM BOs. But we don't want to have the generation batch size to be
linked to the main batch.

v2: remove gfx7 code

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15642>
2022-12-23 22:52:50 +00:00
Alyssa Rosenzweig
bd83e5ddaf pan/bi: Use write masks on Valhall texture instrs
I noticed a sequence like the following in a scheduled SuperTuxKart shader:

   TEX_SINGLE.slot0 @r0:r1, ..
   LD_VAR.wait0 @r2, ...
   FMA r1, ...

Why do we stall waiting for the TEX_SINGLE instruction when it's not actually
read? Because its upper channels are *never* read, leading to a
write-after-write dependency when the register allocator puts some unrelated ALU
destination in there. By appropriately masking the texture instruction's write,
that false dependency disappears, avoiding the stall.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20426>
2022-12-23 19:05:10 +00:00
Alyssa Rosenzweig
7d9c771b9b pan/va: Pack texture write masks
We'll generate nontrivial ones in a moment.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20426>
2022-12-23 19:05:10 +00:00
Alyssa Rosenzweig
182087245d panfrost: Don't flush readers for reads
Unsure if this can actually be hit, but bug fix by inspection: there is no need
to flush for read-after-read relationships.

This might be a bit faster, shrug.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20426>
2022-12-23 19:05:10 +00:00
Alyssa Rosenzweig
3c56b9c7a3 panfrost: Remove rsrc->track
Just check on the context instead. Usually the number of batches is small so
this is still fast, and avoids all the tricky atomics and the batch->resources
set which existed only for bookkeeping.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20426>
2022-12-23 19:05:10 +00:00
Alyssa Rosenzweig
955417aa3e panfrost: Upload sysvals to a staging buffer
Avoids reading write-combine memory to push sysvals.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20426>
2022-12-23 19:05:10 +00:00
Alyssa Rosenzweig
b481507c03 panfrost,asahi: Set vendor to Mesa
Picked from !16064.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20427>
2022-12-23 18:52:34 +00:00
José Roberto de Souza
3e28c5b9f9 anv: Pass anv_bo as parameter to anv_gem_mmap()
anv_bo has information that will be needed by a future patch in
anv_gem_mmap(), so here already preparing for that.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20423>
2022-12-23 18:22:29 +00:00
José Roberto de Souza
95ce9664d5 intel/common: Move i915 gem specific code to its own file
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20423>
2022-12-23 18:22:29 +00:00
José Roberto de Souza
f51bafc368 intel/common: Move i915 engine specific code to its own file
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20423>
2022-12-23 18:22:29 +00:00
José Roberto de Souza
c14060e0d8 iris: Make iris_bo_export_gem_handle() static
It is only used in iris_bufmgr.c so no neeed to export it.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20423>
2022-12-23 18:22:29 +00:00
Alyssa Rosenzweig
f6d73ea7b4 pan/lower_framebuffer: Remove unused pack
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20420>
2022-12-23 16:27:16 +00:00
Alyssa Rosenzweig
8dd35e0ac7 pan/mdg: Remove unused disassembler functions
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20420>
2022-12-23 16:27:16 +00:00
Alyssa Rosenzweig
8e1a466882 panfrost: Remove unused so_mask calculation
This was copied from Iris, but it's not actually used in the new NIR-based
transform feedback implementation that we now use on all chips.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20420>
2022-12-23 16:27:16 +00:00
Alyssa Rosenzweig
9cd6d0873d panfrost: Remove experimental v7-only indirect draw path
There are too many problems with indirect draws on v7 that we never got this
code path to the finish line, and none of us have a good plan (or reason) to fix
this. Proper indirect draws are only possible since v10 on Mali.

There was interest in using this path to implement indexed draws in PanVK, that
MR is stalled and it's not clear how much sense it makes to do Vulkan on
anything older than v9 or v10 at this point. This code isn't *gone*, it'll still
be in git history, but I don't see a lot of reason in keeping it in tree if it's
unused and complicating e.g. the sysval upload path of the driver.

Indirect dispatch remains supported on v7, as that path *is* working and flipped
on for end users. Indirect dispatch on v7 is considerably less complicated than
indirect draws.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20420>
2022-12-23 16:27:16 +00:00
Danylo Piliaiev
4890745b19 ir3: Do 16b tex dst folding only for floats
Folding signed or unsigned i32 -> i16 conversion into sampling
instruction causes it to behave differently with out-of-bounds
values. The conversion expects higher bits being masked, however
folded variant does clamp the value.

A concrete example is that:

 isaml.base0 (u16)(x)hr0.x

is not equal this:

 isaml.base0 (u32)(x)r0.w
 (sy)cov.u32u16 hr0.x, r0.w

Fixes misrendering in "Injustice 2".

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

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20396>
2022-12-23 15:48:18 +01:00
Danylo Piliaiev
1c9ee30838 nir/fold_16bit_tex_image: Add type granularity for dst folding
Some HW may be able to fold only some of dst types, e.g.
for Adreno folding i32 -> i16 could cause a different result since
folded variant clamps the result instead of masking it.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20396>
2022-12-23 15:48:18 +01:00
Lucas Stach
c5231025be etnaviv: disable linear PE by default
Linear PE causes a lot of issues in the ZS stage. While some of those issues
can be worked around on newer GPU cores by doing all ZS operations in the
late stage, GC600 r4653 exhibits spurious Z fails when linear PE is active
even though this GPU does not even have a early Z stage.

Disable linear PE for now, until the issue can be analyzed further. Leave the
debug option in place to allow to enable linear PE for testing.

Fixes: 43eb5e777e ("etnaviv: add debug option to disable linear PE feature")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20405>
2022-12-23 13:50:53 +00:00
Väinö Mäkelä
4c986c58b3 intel/blorp: Fix a hang caused by invalid dispatch enables on gfx7
Because commit b9403b1c47 moved dispatch enable handling away from the
compiler, the drivers must ensure correct dispatch enable values. This
is handled by the intel_set_ps_dispatch_state function.

v2: Fix gfx6 build and use brw_fs_get_dispatch_enables for gfx6 in
crocus
v3: Rebase, use intel_set_ps_dispatch_state, drop gfx6 handling

Fixes: b9403b1c47 ("intel: factor out dispatch PS enabling logic")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20267>
2022-12-23 10:17:04 +00:00
Tapani Pälli
7db1b94e07 intel/dev: setup 1024 GS urb entries for ADL-N
v2: apply only for devices with less than 32 EUs (Lionel)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7942
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/20414>
2022-12-23 09:51:01 +00:00
Lionel Landwerlin
25608659a0 intel/compiler: mark shader_record_ptr as uniform
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/20413>
2022-12-23 09:22:13 +00:00
Lionel Landwerlin
3af08b9c30 nir/divergence: handle shader_record_ptr intrinsic
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes 6b8fd65e84 ("spirv: Implement the new ray-tracing storage classes")

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20413>
2022-12-23 09:22:13 +00:00
Lionel Landwerlin
8a1a3a31da nouveau/ci: temporary disable gk20a-gles
Jobs are failing almost immediately with :

Cleaning up project directory and file based variables
ERROR: Failed to cleanup volumes
ERROR: Job failed: exit code 1

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20421>
2022-12-23 11:01:10 +02:00
Chia-I Wu
97c948fc2c freedreno: bump up FD6_MAX_BORDER_COLORS
Fixes

  $ deqp-gles31 -n 'dEQP-GLES31.functional.texture.border_clamp.*'

on a618/a635.

Fixes: c0fc8d5046 ("freedreno/a6xx: Switch to global bcolor buffer")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20419>
2022-12-22 17:31:57 -08:00
Martin Roukala (né Peres)
19920f126e radv/ci: remove locally-deleted files from the job bucket
This makes the downloaded artifacts reflect the content of the folder
as generated by the job.

In this the case of vkcts, this removes from the downloaded artifacts
the log files that were deemed uninteresting by deqp-runner.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20415>
2022-12-22 14:54:43 +00:00
Martin Roukala (né Peres)
596c11494f radv/ci/vkcts: do not sync back the *.qpa
These files are relatively big (amounting to ~4.5GB for one run) but
are not really useful.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20415>
2022-12-22 14:54:43 +00:00
David Heidelberg
fa07dcb588 radeon: drmGetVersion can return NULL
Do not crash on scenarios where drmGetVersion returns NULL.
Make Radeon driver initialization more robust.

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

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20402>
2022-12-22 14:32:03 +00:00
Lionel Landwerlin
739a08ad23 anv: handle null push descriptors in deferred optimization
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: b49b18f0 ("anv: reduce BT emissions & surface state writes with push descriptors")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20410>
2022-12-22 14:07:21 +00:00
David Heidelberg
c52b7aa732 ci: Windows runner is experiencing DNS issues; disable Microsoft farm
Multiple failures in https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20097

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20411>
2022-12-21 21:40:22 +00:00
Timur Kristóf
0d36f7f76d radv: Only apply taskmesh indirect 0 bug workaround when necessary.
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/20097>
2022-12-21 17:41:23 +01:00
Timur Kristóf
50330aaccb ac: Add has_taskmesh_indirect0_bug field to ac_gpu_info struct.
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/20097>
2022-12-21 17:40:28 +01:00
Timur Kristóf
d368914a38 radv: Include view index SET_SH_REG in ace_predication_size.
This fixes an issue when conditional rendering and multiple views
were used with a task+mesh draw call.

Fixes: 2479b62869
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/20098>
2022-12-21 16:55:35 +01:00
Guilherme Gallo
590f74084d ci/lava: Show LAVA job info during fails
Currently, LAVA jobs only show metadata when successful, let's show this
info in all retries to make it easier to debug or report issues.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20051>
2022-12-21 12:44:49 +00:00
Guilherme Gallo
2e723cdc10 ci/lava: Anticipate overlayfs download
To debug the LAVA jobs locally, we have an option in the
lava_job_submitter script to ignore the JWT token to make it possible to
retry jobs without the need to get an unexpired token.

But this trick needs to modify the overlayed directory so that we would
need to download and extract it earlier in the run.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20051>
2022-12-21 12:44:49 +00:00
Guilherme Gallo
584762c216 ci/lava: Fix Gitlab section rendering
LAVA splits the DUT log lines with `\r` in them. Unfortunately, it
breaks the Gitlab section line syntax when the HWCI script calls it
since it is a oneliner.

This commit changes the` fix_lava_gitlab_section_log` function to a
stateful generator that can merge lines that respects two consecutive
patterns.

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

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20051>
2022-12-21 12:44:49 +00:00
Guilherme Gallo
f040122bed ci/lava: Feed yaml.load with raw bytes data
LAVA uses XMLRPC to send jobs information and control, more specifically
it sends device logs via YAML dumps encoded in UTF-8 bytes.

In Python, we have xmlrpc.client.Binary class as the serializer
protocol, we get the logs wrapped by this class, which encodes the data
as UTF-8 bytes data.

We were converting the encoded data to a string via the `str` function,
but this led the loaded YAML data to use single quotes instead of double
quotes for string values that made special characters, such as `\x1b` to
be escaped as `\\x1b`.

With this fix, we can now drop one of the hacks that fixed the bash
colors.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20051>
2022-12-21 12:44:49 +00:00
Erico Nunes
ce0ca7ed21 Revert "ci: Lima farm maintenance"
This reverts commit e66df0d362.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20390>
2022-12-21 11:00:27 +01:00
Timur Kristóf
d004b4929d radv: Don't assume there is always at least 1 preamble.
This fixes a mistake which assumes there is always at least 1 preamble.
This assumption is currently incorrect on transfer queues.

Fixes: e10b2f273e
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/20401>
2022-12-21 09:39:37 +01:00
Yiwei Zhang
376a947c09 venus: fallback to passthrough pci bus info when not natively supported
This avoids an assert with VN_DEBUG=all on virtgpu backend.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20383>
2022-12-20 22:39:01 +00:00
Gert Wollny
55df7ad571 r600/sfn: Fix possible dest channels for variable size dot
Fixes:  357e5fac99
    r600/sfn: Use variable length DOT on Evergreen and Cayman

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20398>
2022-12-20 21:36:41 +00:00
Marcell Kiss
281c07d89f radv: Fix uninitalized struct for trap handler
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20354>
2022-12-20 19:52:23 +00:00
Gert Wollny
05fab97b2c r600/sfn: Don't try to re-use the iterator when uses is updated
It seems on libc++ the iterator is invalidated when an element is removed
from the set, so make sure that we don't implicitely use the old,
invalidated iterator in the range based - open code the loop using while
instead.

Fixes: f3415c (r600/sfn: copy propagate register load chains)

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

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20394>
2022-12-20 15:05:04 +00:00
Timur Kristóf
aace38c2d8 radv: Enable EXT_mesh_shader by default on GFX10.3.
Only enable mesh+task shaders when IBs and gang submit are enabled.
We won't support gang submit with noibs.

Also remove the RADV_PERFTEST=ext_ms option.
Side note, GFX11 task/mesh support is still a TODO.

Don't skip the CTS tests which require GFX->ACE synchronization.

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/20010>
2022-12-20 14:23:49 +00:00
Timur Kristóf
b8e4cc73bf radv/amdgpu: Remove cs_add_buffers because it's no longer necessary.
This function was added because previously ACE and GFX work was
submitted separately and we needed to make sure they both use the
same BOs. Now they are part of the same submission so this
function is not necessary anymore.

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/20010>
2022-12-20 14:23:49 +00:00
Timur Kristóf
97d3377b56 radv/amdgpu: Remove command submission with scheduled dependencies.
These are no longer used by any part of RADV, so we
can just safely delete it.

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/20010>
2022-12-20 14:23:49 +00:00
Timur Kristóf
7cb128ffb1 radv: Add gang wait preambles and postambles to ensure correct behaviour.
Add new preambles and postambles for synchronizing gang members in a
gang submission using semaphores.
These semaphores are both located in a small BO.

Gang wait preambles:

- gang leader writes 1 to a semaphore
- gang member waits for it to be written

When task shaders are used, make sure ACE waits until GFX starts to execute.
Userspace is required to emit this wait to make sure it behaves correctly
in a multi-process environment, because task shader dispatches are not
meant to be executed on multiple compute engines at the same time.

Gang wait postambles:

- gang member writes 1 to a semaphore
- gang leader waits for it to be written

This ensures that the gang leader waits for the whole gang,
which is necessary because the kernel signals the userspace fence
as soon as the gang leader is done, which may lead to bugs because the
same command buffers could be submitted again while still being executed.

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/20010>
2022-12-20 14:23:49 +00:00
Timur Kristóf
c47c4d5f80 radv: Remove ACE->GFX wait at the end of each command buffer.
This is now handled in the queue submission code so is not necessary.
However, keep the semaphore for future use.

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/20010>
2022-12-20 14:23:49 +00:00
Timur Kristóf
0b0c941d75 radv: Rename radv_update_ace_preambles to radv_update_gang_preambles.
The new name reflects more accurately what this is.

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/20010>
2022-12-20 14:23:49 +00:00
Timur Kristóf
bcadea6af6 radv: Implement gang submit in radv_queue_submit_normal.
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/20010>
2022-12-20 14:23:49 +00:00
Timur Kristóf
d065abef75 radv: Update ACE preambles in radv_queue_submit_normal.
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/20010>
2022-12-20 14:23:49 +00:00
Timur Kristóf
76deaa1b1a radv: Refactor command buffer handling in radv_queue_submit_normal.
Move processing of the command buffer array inside the loop that
splits a submission.

We now also add the perf counter lock/unlock to each submission
instead of just the first and last.

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/20010>
2022-12-20 14:23:49 +00:00
Timur Kristóf
5ec9a96b91 radv: Remove radv_queue_submit_with_ace and disable task/mesh shaders.
It would be too difficult to keep the radv_queue_submit_with_ace
function while also refactoring the radv_queue_submit_with_ace function,
so let's delete it first.

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/20010>
2022-12-20 14:23:49 +00:00
Timur Kristóf
ce62ec3bbb radv: Enable gang submit on the null winsys.
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/20010>
2022-12-20 14:23:49 +00:00
Timur Kristóf
24404d8330 ac: Add has_gang_submit field to ac_gpu_info.
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/20010>
2022-12-20 14:23:49 +00:00
Timur Kristóf
294604bc56 radv/amdgpu: Allow using more than 1 preamble with cs_submit.
Add the ability to have multiple preambles,
except for the sysmem (NOIBS/GFX6) code path which still only allows 1.

This is necessary because with gang submit we will need a way to submit
a preamble to different queues at the same time.

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/20010>
2022-12-20 14:23:49 +00:00
Timur Kristóf
e9d5b5c9b3 radv/amdgpu: Add IP type to IB info and use it when submitting.
This is necessary for supporting gang submit.

With gang submit, the kernel now allows us to submit multiple IBs
with different IP types. Therefore, RADV will also need to group
various CSs with different IP types together and remember the IP
type of each CS.

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/20010>
2022-12-20 14:23:49 +00:00
Timur Kristóf
ff772a7ba4 radv/amdgpu: Introduce a custom struct for submitted BO info.
We are going to need additional data which is not present in
the currently used struct.

This commit just adds the new struct but does not yet add
new fields to it.

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/20010>
2022-12-20 14:23:49 +00:00
Timur Kristóf
dfb89077b9 radv/amdgpu: Set fallback submit request ip_type from the last CS.
When using gang submit, the last IB is considered the "gang leader"
and its IP type will determine which fence to signal when the
submission is done. Therefore, use the last CS to set the IP type.

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/20010>
2022-12-20 14:23:49 +00:00
Timur Kristóf
e10b2f273e radv/amdgpu: Change extra_cs to array in get_bo_list.
This is necessary because we are going to want to allow using
more than just 1 preamble.

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/20010>
2022-12-20 14:23:49 +00:00
Timur Kristóf
f0492a6efb radv: Return correct error code when failed to allocate CS array.
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/20010>
2022-12-20 14:23:49 +00:00
Timur Kristóf
c70c2d9730 radv: Determine use_ace in radv_update_preambles.
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/20010>
2022-12-20 14:23:49 +00:00
Timur Kristóf
a59e49bae3 radv: Rename uses_perf_counters to use_perf_counters.
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/20010>
2022-12-20 14:23:49 +00:00
Timur Kristóf
3ff86e3be6 radv: Stylistic changes in radv_queue_submit_normal.
Move some variables, add const, and fix a comment.

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/20010>
2022-12-20 14:23:49 +00:00
Timur Kristóf
64aa555909 radv: Destroy mesh shader scratch ring in radv_queue_state_finish.
Fixes: 0280b526d5
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/20010>
2022-12-20 14:23:49 +00:00
Timur Kristóf
db4c62ea39 radv: Remove trailing whitespace again.
Also ran clang-format on the affected line.

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/20010>
2022-12-20 14:23:49 +00:00
Danylo Piliaiev
499e33061b lvp: fix load_helper_invocation not being lowered
nir_lower_is_helper_invocation should be after nir_lower_system_values
to handle possible nir_intrinsic_is_helper_invocation which may be
produced by nir_lower_system_values.

Happens with SPIR-V 1.6 for which gl_HelperInvocation is translated into
"BuiltIn HelperInvocation" + "Volatile", which nir_lower_system_values
translates into is_helper_invocation.

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/19677>
2022-12-20 11:06:52 +00:00
Danylo Piliaiev
7f2ce867cf tu: fix load_helper_invocation not being lowered
nir_lower_is_helper_invocation should be after nir_lower_system_values
to handle possible nir_intrinsic_is_helper_invocation which may be
produced by nir_lower_system_values.

Happens with SPIR-V 1.6 for which gl_HelperInvocation is translated into
"BuiltIn HelperInvocation" + "Volatile", which nir_lower_system_values
translates into is_helper_invocation.

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/19677>
2022-12-20 11:06:52 +00:00
Danylo Piliaiev
8482ad0110 nir/nir_lower_is_helper_invocation: Lower helper invocation if required
nir_lower_is_helper_invocation lowers intrinsic_is_helper_invocation
and uses load_helper_invocation (which is lowered by nir_lower_system_values).
While nir_lower_system_values may lower SYSTEM_VALUE_HELPER_INVOCATION
into intrinsic_is_helper_invocation.

So they depend on each other. Break the dependency by making
nir_lower_is_helper_invocation aware of lower_helper_invocation option
and emitting lowered load_helper_invocation when required.

Happens with SPIR-V 1.6 for which gl_HelperInvocation is translated into
"BuiltIn HelperInvocation" + "Volatile", which nir_lower_system_values
translates into is_helper_invocation.

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/19677>
2022-12-20 11:06:52 +00:00
Rohan Garg
ad9c0e8cd9 anv: Ensure we clear ANV_PIPE_PSS_STALL_SYNC_BIT on flush
Add the PSS stall bit to ANV_PIPE_STALL_BITS so that it get's cleared on
flush.

Fixes: f3c62973 ("anv,iris: PSS Stall Sync around color fast clears")

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
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/20317>
2022-12-20 10:44:54 +00:00
Yonggang Luo
22bf19c1f5 util: Fixes os_get_option_cached with bool options_tbl_exited
Fixes: cdad035cfd ("util: Add function debug_get_option_cached os_get_option_cached")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7922

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20386>
2022-12-20 01:49:10 +00:00
Giancarlo Devich
f0fe74ceaa d3d12: Don't flush indiscriminately for query result accumulation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20217>
2022-12-19 22:57:51 +00:00
Giancarlo Devich
a607df2f0f d3d12: Fix race condition when getting query results
Before, when an application called into d3d12_query_result, and
the results were not ready to be read, a flush-and-wait would
be attempted via synchronized mapping of the query result resource.

This can end up calling close/execute on the command list while it is
already being executed by the driver thread.

With the current fence value attached to the query, we now wait
for completion if necessary and then map the resource unsynchronized, or
return false if the result is not ready and wait == false.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20217>
2022-12-19 22:57:51 +00:00
Giancarlo Devich
8886f5e343 d3d12: Move query structs to header
Also adds `fence_value` to `d3d12_query` to track which batch of work
this query exists in and must be waited on.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20217>
2022-12-19 22:57:51 +00:00
Dave Airlie
c90e5ddc71 vulkan: update headers/registry to 1.3.238 for video decode
This moves the video decoding to KHR and out of beta.

Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20384>
2022-12-20 07:28:07 +10:00
Dave Airlie
7bcb6a0896 vulkan/util: handle LUNARG in the list of special prefixes
The latest headers update has a lunarg extension that needs this.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20384>
2022-12-20 07:28:04 +10:00
Dave Airlie
bfe1942e8a vulkan/cmd_queue: update generator to handle guarded types.
The latest includes/registry have some pNext structs that need
guarding spearately to their initial structs, so we have to track
the define guards better and use them in the generated code

For example:
VkVideoEncodeRateControlInfoKHR extends VkVideoCodingControlInfoKHR

However the first struct is protected by BETA, but the second isn't
the generator was always generating unguarded code for all structs

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20384>
2022-12-20 07:27:25 +10:00
Emma Anholt
c1968deec2 turnip: Lazily call tu6_emit_descriptor_sets() at draw time.
This lets us batch up the state changes from multiple
vkCmdBindDescriptorSets, which ANGLE and zink will both do in a single
draw.

Improves ANGLE (sysmem) driver_overhead perf by 5.18806% +/- 1.03444% (n=5).
Improves ANGLE aztec_ruins_high perf by ~.3%. (clear result in the graph,
but the screen went to sleep mid way through and so it was high variance)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20084>
2022-12-19 19:14:02 +00:00
Georg Lehmann
73db82c816 lavapipe: Enable VK_KHR_shader_non_semantic_info.
Already implemented in common code.

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

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20353>
2022-12-19 18:10:04 +00:00
David Heidelberg
a04720dc1c ci: move the CI handling scripts into bin/ci
Any change in .gitlab-ci/ directory triggers an entire CI run,
which is unnecessary for just changing the developers' scripts.

Added symlink to `.gitlab-ci/bin` to keep original invocation compatibility.

Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20371>
2022-12-19 16:36:19 +01:00
David Heidelberg
07f2c862e0 ci: ci_run_n_monitor.py: fix args.rev leftover
Fixes: a8b6b2367e ("ci: allow omitting of --rev for ci_run_n_monitor.py")

Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20371>
2022-12-19 16:35:39 +01:00
José Roberto de Souza
6b3f085c3c iris: Add BO_ALLOC_PLAIN flag
We had iris_bo_alloc() call with the wrong flags value, it was
mistaken by aligment, see commit 68652dca0c.

To avoid such mistakes in future here adding BO_ALLOC_PLAIN so
iris_bo_alloc() calls have a more descriptive flag parameter when
there is no special allocation request.

While at it, also standardizing unsigned as the type for this flag.

No behavior changes here.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19857>
2022-12-19 05:37:34 -08:00
Konstantin Seurer
c12f7f601c radv/bvh: Handle inactive triangles and AABBs
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20325>
2022-12-19 09:37:56 +00:00
Konstantin Seurer
4686ab731c radv/bvh: Move leaf node initialization into separate functions
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20325>
2022-12-19 09:37:56 +00:00
Qiang Yu
9bb1d8ab19 ac/llvm: remove deref image/texture code
They have been lowered to bindless ones in nir.

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/18666>
2022-12-19 09:22:45 +08:00
Qiang Yu
796d395ab9 ac,radv,radeonsi: remove unused param of load_sampler_desc abi
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/18666>
2022-12-19 09:22:42 +08:00
Qiang Yu
2fd6e150c3 ac/llvm: remove samples_identical nir to llvm code
It has been lowered in nir.

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/18666>
2022-12-19 09:22:38 +08:00
Qiang Yu
a8350dcd25 ac/llvm: remove implicite ms texture fmask handling
It has been lowered to fragment_mask_load_amd in nir.

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/18666>
2022-12-19 09:22:35 +08:00
Qiang Yu
523e7e094d ac/llvm: remove image/texture descriptor_amd nir to llvm code
They have been lowered in nir.

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/18666>
2022-12-19 09:22:31 +08:00
Qiang Yu
d4fdeaa820 radeonsi: replace llvm resource code with nir lower
Port from ac_nir_to_llvm.c and si_shader_llvm_resource.c.

Due to need waterfall of llvm backend, we can't get bind-texture
descriptor directly in nir. So we keep load_sampler_desc abi only
for bind-texture index to desc.

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/18666>
2022-12-19 09:22:27 +08:00
Qiang Yu
e85c5d8779 nir/divergence_analysis: add missing intrinsics
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/18666>
2022-12-19 09:22:24 +08:00
Qiang Yu
adecf52a3b ac/llvm: add disable_aniso_single_level abi
RADV use dri option to enabled this for some apps, but it's
done in nir lower currently. I'm afraid it still needs this
option to handle the non-uniform case as desc is loaded in
llvm.

radeonsi always enable this for bind-textures.

radeonsi will lower all bind-textures to bindless-textures,
and only bind-textures use desc index, so add this abi for
bindless desc index path.

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/18666>
2022-12-19 09:22:19 +08:00
Qiang Yu
194add2c23 nir: lower image add lower_to_fragment_mask_load_amd option
Like lower_to_fragment_fetch_amd option in lower tex,
this is for radeonsi to lower MS image ops.

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/18666>
2022-12-19 09:22:16 +08:00
Qiang Yu
1461b5f61b nir: add image fragment mask load intrinsic
Like nir_texop_fragment_mask_fetch_amd, this is used to load multi
sample image fmask data for AMD GPU.

We will lower multi sample image load and samples_identical intrinsics
to use it latter for radeonsi. RADV does not need this because it
always expand fmask images before dispatch compute shader.

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/18666>
2022-12-19 09:22:11 +08:00
Qiang Yu
88f6ca39a7 radeonsi: replace llvm load_ssbo abi with nir lower
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/18666>
2022-12-19 09:22:08 +08:00
Qiang Yu
d57a22d068 ac/llvm: check load_ssbo present before call it
radeonsi will remove it later.

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/18666>
2022-12-19 09:22:04 +08:00
Qiang Yu
5bc5cae571 radeonsi: add si_nir_lower_resource pass
Replace the load_ubo abi.

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/18666>
2022-12-19 09:20:50 +08:00
Friedrich Vock
f0f5d5c5e5 radv/rt: Refactor exiting PLOC
The previous approach was susceptible to sync hazards, causing hangs in Doom Eternal.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7897
Fixes: 271865373 ("radv: Add PLOC shader")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20377>
2022-12-18 21:24:45 +00:00
Friedrich Vock
54ca0665c8 radv/rt: Execute memory barrier before updating the phase end count
We want to be sure that the values were updated before letting other invocations continue.

Fixes: 271865373 ("radv: Add PLOC shader")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20377>
2022-12-18 21:24:45 +00:00
Friedrich Vock
0e0f42723e radv/rt: PLOC fixes for active_leaf_count
Fixes: 271865373 ("radv: Add PLOC shader")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20377>
2022-12-18 21:24:45 +00:00
Marek Olšák
b0f6de4ea6 util/tools: add the tool that generates perfect hash functions for GLenums
The big comment explains it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20287>
2022-12-18 14:35:59 -05:00
Marek Olšák
b5c0706d47 mesa: optimize _mesa_bytes_per_vertex_attrib using a hash-based translation
This reduces time spent in gl*Pointer for viewperf.

Generated by find_hash_func.c.

Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20287>
2022-12-18 14:35:59 -05:00
Marek Olšák
8e89f07fc8 mesa: compute _PipeFormat and _ElementSize after checking if the format changed
Split _mesa_set_vertex_format into 2 functions and set the derived fields
after we know that the format is different.

This skips _PipeFormat and _ElementSize recomputation every time we get
gl*Pointer with the same format.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20287>
2022-12-18 14:35:59 -05:00
Marek Olšák
6a8c1d5043 mesa: move user-specified vertex format fields into gl_vertex_format_user
to be used in the next commit

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20287>
2022-12-18 14:35:59 -05:00
Marek Olšák
13160c0d14 mesa: change gl_vertex_format::Format to bool Bgra to free bits
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20287>
2022-12-18 14:35:59 -05:00
Marek Olšák
124d2762db st/mesa: simplify prepare_indexed_draw
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20287>
2022-12-18 14:35:59 -05:00
Marek Olšák
8bcdcc8b23 st/mesa: optimize index buffer reference counting in st_indirect_draw_vbo
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20287>
2022-12-18 14:35:59 -05:00
Marek Olšák
819627041e mesa: set pipe_draw_info::index::resource directly and remove gl_bo
The motivation is to remove branching from prepare_indexed_draw
and remove the unsafe hack in vbo_save_playback_vertex_list.

There is some duplication that is not identical in all 3 cases.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20287>
2022-12-18 14:23:22 -05:00
Marek Olšák
ea11f48a53 st/mesa: fold GLThread.enabled into pin_thread_counter to skip that checking
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20287>
2022-12-18 14:22:45 -05:00
Marek Olšák
23f9f6787a st/mesa: use u_bit_scan64 only for 64-bit CPUs in st_validate_state
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20287>
2022-12-18 14:22:45 -05:00
Yiwei Zhang
47feb2b013 docs: update to latest venus driver support
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20310>
2022-12-17 21:34:47 -08:00
Yiwei Zhang
553c0a3067 venus: fix VK_EXT_pci_bus_info support
Natively support it for virtgpu while passthrough renderer support for
vtest. This is a must support to avoid prime blit in common wsi.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20310>
2022-12-17 21:34:47 -08:00
Yiwei Zhang
63cb570ef3 venus: sync protocol fixes and support for VK_EXT_pci_bus_info
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20310>
2022-12-17 21:34:47 -08:00
Marek Vasut
18f4dc6b75 etnaviv: Do expose 2D texture support on pre-halti GPUs
Commit d08bd9a8d8 ("etnaviv: don't expose array and 3D texture support on pre-halti GPUs")
started returning 0 from PIPE_CAP_MAX_TEXTURE_2D_SIZE as well due to switch
case fallthrough. Reinstate the behavior of PIPE_CAP_MAX_TEXTURE_2D_SIZE,
while at the same time, retain the new behavior introduced by commit
d08bd9a8d8 , Otherwise not even kmscube displays the spinning cube,
weston does not display desktop and so on.

Triggered on "Vivante GC600 rev 4653" , i.MX8M Mini .

Fixes: d08bd9a8d8 ("etnaviv: don't expose array and 3D texture support on pre-halti GPUs")
Closes: #7898
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20373>
2022-12-17 22:54:11 +01:00
Alyssa Rosenzweig
486c341769 panfrost: Add architecture description XML for v10
Add the GenXML hardware description for Mali architecture v10, as implemented in
Mali-G610. This is not 100% complete but it should be good enough for parity
with v9.

The XML itself is forked off of v9, with all Job Managerisms replaced with
CSFisms. This notably includes a large number of new structures defining the
instructions that run on the Command Execution Unit (CEU).

This is the first step towards supporting Mali-G610 (i.e. RK3588) upstream. Next
up will be pandecode support.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20360>
2022-12-17 20:33:39 +00:00
Rob Clark
a9cdbed5a2 freedreno/drm: Short-circuit kernel for timeout=0 waits
We already know from the userspace fence whether the fence has signaled
or not.  No need to do a syscall if we aren't going to wait.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
90b9b1330d freedreno/drm/virtio: Guest side fence waits
Now that fd_fence and fd_submit_fence are unified, we can wait on the
fence fd rather than needing to poll the host.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
995c64ddcb freedreno/drm/virtio: More tracepoints
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
be6d21ed56 freedreno: Limit cached staging BOs to PIPE_MAP_READ
WC is fine for staging upload buffers, and will let us hit the default
heap.  Probably introducing a separate cached-coherent heap is overkill,
and given that staging uploads are common (but downloads uncommon, out-
side of dEQP/piglit), it is better to just ask for WC.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
4be235af7c freedreno/drm/virtio: Remove prealloc_list
Now that we are allocating cmdstream from the heap, we shouldn't need
this.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
4861067689 freedreno/drm: Add sub-allocator
Add a heap that we can use for allocations of small mappable buffers.
This avoids the churn of mmap/unmap, which is especially expensive in
a VM.  It also allows packing more smaller allocations together in a
page, which is useful for PIPE_BUFFERs (which are also mappable).

This avoid jank caused by the overhead of setting up or tearing down
guest mappings when running in a VM.  And also significantly reduces
the # of BOs referenced on a submit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
7d0d82f25f util/vma: Add "nospan"
Add a way to request that allocations do not span a specified PoT
boundary.  This can be used, for ex, to ensure that allocations do
not span 4GB boundaries to work around hw/fw bugs.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
793741c936 freedreno/drm: Merge in_fence_fd's
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
137cd3b0fa freedreno/drm: Move no_implicit_sync accounting
No need to duplicate this.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
7b02bc6139 freedreno/drm: Drop fd_bo_fence
Remove the last fence-like-struct that isn't fd_fence.  Now that
fences are refcnt'd we can just attach them directly to BOs.  This
will simplify busy-ness tracking for suballoc BOs.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
434a8412e8 freedreno/drm: Re-enable submit fence merging
Now that we (a) create the fence ourselves, returning a reference from
fd_submit_flush(), and (b) refcnt the fences, we can now merge submits
with on out-fence by just attaching the same fence to all the submits.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
932ce591ac freedreno/drm: Simplify deferred submit flushing
Once we are sharing an out-fence for multiple deferred/merged submits
the complicated logic in fd_pipe_sp_flush() no longer works (or makes
sense), so just simplify all the paths into a single helper.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
48b5164356 freedreno/drm: Return fence from submit flush
This moves away from embedding the submit fence inside the pipe fence,
which lets us start refcnt'ing the fence.  This will enable several
cleanups and improvements:

1. Get rid of fd_bo_fence, and just have fd_bo hold pending fd_fence
   refs instead, which will be needed for cpu_prep implementation of
   sub-allocated buffers.
2. For merged submits, we can just return a new reference to an
   existing fence.

Note that this temporarily defeats submit-merging, which will be
fixed (and improved) in a following commit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
7469574814 freedreno: Rename fd_fence -> fd_pipe_fence
So we don't have namespace clashes in the next commit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
c1a621813b freedreno/drm: Combine fd_fence and fd_submit_fence
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
803df07d9e freedreno/drm: Replace shared/nosync fields
These are redundent with the alloc_flags.  A following commit will map
alloc_flags directly to bo heap that should be used, and adding the
FD_BO_SHARED bit when a BO is exported neatly avoids returning it to
the pool to be potentially erroneously reused.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
e6b364f924 freedreno/drm: Reorg BO alloc flags
And drop the unneeded _FD_BO_RING flag.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
fd20df8f09 freedreno/drm: Invert BO destruction
Sub-alloc'd heap BOs will need to do something a bit more special, ie.
not immediately cleanup fences (because those will be needed to know
when the BO is actually idle and vma node can be released), not tear
down the mmap (because the BO doesn't own it), and not close the handle
(also because the BO doesn't own it).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
84f44137ff freedreno/drm: Shuffle around BO init
Suballocated heap BOs will bypass the rest of bo_new() (as they skip the
BO cache, don't get an entry in the handle table, etc).  So move more of
the initialization into fd_bo_init_common().

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
db0f273cfb freedreno/drm: Drop pipe ref to device
The context and screen already holds refs to the device.  But since
fd_bo_fence holds a ref to the pipe, anyone anywhere leaking a single
bo with unwaited fences could cause the device to leak indirectly.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
c196e13e1f freedreno/drm: Get rid of fd_bo_del_locked()
This moves the table_lock into a small critical section in the BO delete
path when we are actually removing the entries from the handle/name
tables, so finally table_lock isn't the big-bo-lock!

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
5136f25667 freedreno/drm: Rework batch BO delete
Get rid of the per-device table of deferred handles, and instead keep
this on the stack so that no additional locking is needed.  This will
simplify getting rid of table_lock in the bo delete path.  For the BO
cache, add fd_bo_del_list_nocache() which works like fd_bo_del_array()
except that it bypasses returning BOs to the cache.  This gets rid of
the BO cache calls to private fd_bo fxns (which is useful now that the
bo_del/close_handles() dance has become a bit more complicated).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
75a4d90280 freedreno/drm: Start prying apart table_lock
We want to get back to the point where table_lock is only doing what
it's named for (ie. protecting handle/name tables).  This is the first
step.  Add new locks to protect fencing and the bo caches.  A single
global lock for fences, to avoid atomic instructions in the loop per
submit bo attaching fences.

This couldn't be broken appart into different commits, otherwise there
would have been an ABBA deadlock in BO cache's call to fd_bo_state()
to check if a BO is idle.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
2ee7012c2c freedreno/drm: Simplify cleanup_fences()
To prepare for moving fence state out from under table_lock, simplify
cleanup_fences() and stop trying to re-use it in the bo destruction
path (which otherwise wouldn't need the fence lock, since there is
no other owner of the bo ref at that point, and simply needs to drop
pipe refs).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
73ab83d228 freedreno/drm: Add bo list iterator macros
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
8c355c7cbc freedreno/drm: Add BO cache stats
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
1bf88d0bf9 freedreno/drm: Allow submit merging with explicit sync
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
87f89a0383 freedreno/drm: Move no_implicit_sync to base
No need to duplicate between backends.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
9372f11c81 freedreno/drm: Remove cpu_fini
It has been unused since nearly forever.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark
5c96dea638 freedreno: Update obsolete comment
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Yiwei Zhang
8a16c5283c venus: fix signaled fence creation under multiple timeline
Fixes: 3beb4f055e ("venus: allow renderer submissions on per-context virtgpu rings")

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20366>
2022-12-17 18:58:58 +00:00
Alyssa Rosenzweig
3827c465e1 asahi: Implement anisotropy
Passes KHR-GLES3.texture_filter_anisotropic.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
2022-12-17 18:10:28 +00:00
Alyssa Rosenzweig
0347d1c358 asahi: Identify seamful cube map bit
Fixes

   dEQP-GLES2.functional.texture.mipmap.cube.basic.linear_nearest

when run with a GLES2 version.

We wire up seamless cube maps for GLES3+ only, working around an obscure
mesa/st limitation. See 6148e3aae7 ("mesa: Fix
ctx->Texture.CubeMapSeamless") for the full context.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
2022-12-17 18:10:28 +00:00
Alyssa Rosenzweig
dc87d83a29 asahi: Set flatshading controls appropriately
Fixes dEQP-GLES3.functional.rasterization.flatshading.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
2022-12-17 18:10:28 +00:00
Alyssa Rosenzweig
623a2bf488 asahi: Identify XML for more flatshading controls
Names from PowerVR <3

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
2022-12-17 18:10:28 +00:00
Asahi Lina
3091f5a7f4 asahi: Enable VS_INSTANCEID and VERTEX_ELEMENT_INSTANCE_DIVISOR caps
These two should be functional at this point. The latter is required
(and quite well tested) by Darwinia.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
2022-12-17 18:10:28 +00:00
Alyssa Rosenzweig
8ba44b6492 asahi: Implement depth and stencil export
For gl_FragDepth, passes dEQP-GLES3.functional.shaders.fragdepth.* and piglit
fragdepth_gles2.

For stencil export, passes piglit glsl-fs-shader-stencil-export.

For gl_FragDepth together with stencil export, passes
dEQP-GLES3.functional.fbo.blit.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
2022-12-17 18:10:28 +00:00
Alyssa Rosenzweig
9578b47af3 agx: Implement depth and stencil export
Lower FRAG_RESULT_DEPTH and FRAG_RESULT_STENCIL writes to a combnied zs_emit
instruction with a multisampling index. To be used in the following commit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
2022-12-17 18:10:28 +00:00
Alyssa Rosenzweig
15155268de asahi: Allow texturing S8 portion of combined Z/S
Comes up in gles3.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
2022-12-17 18:10:28 +00:00
Asahi Lina
9fc2c0f341 asahi: Put meta shader keys into the meta shader itself
The hash table needs a key pointer with at least the lifetime of the
hash entry, which the key pointer we get does not have (since it is
stack-allocated by agx_build_meta). Copy it into the shader struct
itself and use that for the hash table.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
2022-12-17 18:10:28 +00:00
Asahi Lina
c12153cd89 asahi: Identify & disable triangle merging for shaders using derivatives
It seems triangle merging is incompatible with calculating derivatives
along primitive edges correctly. Take the appropriate NIR shader info
flags in the compiler and pass them down as a flag to the driver, so it
can set the disable triangle merging flag (formerly called "lines or
points").

TODO: Is this what macOS does when you set a sample mask there (which
apparently fixes the same bug on the Darwinia Metal backend)? Do we
also need to set this when sample masks are used?

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes Darwinia and dEQP2 projected tests.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
2022-12-17 18:10:28 +00:00
Asahi Lina
005f556065 asahi: Fix include guard comment on decode.h
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
2022-12-17 18:10:28 +00:00
Asahi Lina
b80fb31678 asahi: Allocate enough push ranges for the worst possible case
We need one for every possible sysval, plus up to 16 VBOs.

Fixes plasma-systemmonitor.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
2022-12-17 18:10:28 +00:00
Asahi Lina
440601dead asahi: Fix off-by-one assert in agx_create_vertex_elements
Needed to fix plasma-systemmonitor.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
2022-12-17 18:10:28 +00:00
Asahi Lina
d4270531c4 asahi: Consider shared resources always valid
Shared resources are in an unknown state, so we have to assume they
may contain valid data.

Fixes Xorg+Kwin random full-screen garbage on mouse cursor present.

However, we still get black flashing in some circumstances (that was
garbage flashing before this commit), which indicates that something
is reading an uninitialized/fresh shared framebuffer and expecting
valid data (prior screen contents?) TBD.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
2022-12-17 18:10:28 +00:00
Asahi Lina
0042f2beb2 asahi: Ensure we always have space for stream links + padding
It seems VDM can overread (maybe it does blockwise transfers?), so we
always need to leave space at the end of encoder buffers to avoid
faults.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
2022-12-17 18:10:28 +00:00
Asahi Lina
cea15fe06d asahi: Don't crash on VBOs without resources
There's a Firefox QuakeJS heisenbug that triggers this sometimes, by
binding vertex attributes with no buffer...

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
2022-12-17 18:10:28 +00:00
Asahi Lina
331c2f4b7e asahi: Do not leak staging resources for PIPE_MAP_READ
We were only dereferencing the resource in the PIPE_MAP_WRITE path of
agx_transfer_unmap, which means that read-only transfers leaked the
staging resource/BO. Always free the staging resource unconditionally.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
2022-12-17 18:10:28 +00:00
Alyssa Rosenzweig
eba2b182c8 agx: Fix packing of extension for block image stores
Probably impossible to hit in practice but let's get it right. Found when
forcing RA to use the upper half of the reg file.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
2022-12-17 18:10:28 +00:00
Alyssa Rosenzweig
ef23bbfdbd agx: Coalesce i2i16 and u2u16
Extract out the code for unpack_64_2x32_split_x and use it for other integer
downcasts too to coalesce out a move. Pointless, but I wanted to have a little
RA fun after getting stencil export working.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
2022-12-17 18:10:28 +00:00
Asahi Lina
58d02e4f59 ail: Assert that the mip level is in bounds
This preempts possible out-of-bounds accesses and later asserts when
trying to get the tile size.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
2022-12-17 18:10:28 +00:00
Alyssa Rosenzweig
a8ec3135bb ail: Fix tile sizes
Fixes dEQP-GLES3.functional.texture.filtering.2d.sizes.3x7_nearest_mipmap_linear.

Tested for all sizes 1..256x1..256.

Tested-by: Asahi Lina <lina@asahilina.net>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
2022-12-17 18:10:28 +00:00
Asahi Lina
d36a829fa1 ail: Fix typo
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
2022-12-17 18:10:28 +00:00
Asahi Lina
0d57fcaf28 ail: Always allocate the full miptree
Layer strides are based on the full miptree, and even for single-layer
images macOS always allocates a full one (possibly relevant for
compression). Make sure we do the same, regardless of how many mip
levels the user asked for.

Fixes Darwinia.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
2022-12-17 18:10:28 +00:00
Alyssa Rosenzweig
3c892d0d54 docs/features: Mark ARB_occlusion_query2 as done on asahi
Part of GLES.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
2022-12-17 18:10:28 +00:00
Alyssa Rosenzweig
5de1803658 docs/features: Mark panfrost supporting aniso
On Mali-G72+ (except for some buggy early G72 models).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
2022-12-17 18:10:28 +00:00
Alyssa Rosenzweig
71e2028ce3 nir: Add store_zs_agx intrinsic
Will be used for frag depth/stencil export with multisampling.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
2022-12-17 18:10:28 +00:00
Erico Nunes
e66df0d362 ci: Lima farm maintenance
General lab maintenance and addressing
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20051

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20343>
2022-12-17 14:33:43 +00:00
Michał Górny
a6b16333c6 r600/sfn: Fix test compilation with -fno-rtti
79ca456b48 reintroduced the use
of dynamic_cast<> in r600/sfn tests.  This breaks compilation with
-fno-rtti, as required to build against the LLVM configuration
recommended upstream.  Use static_cast<> instead to fix this.

Fixes: #7820
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20239>
2022-12-17 11:01:50 +00:00
Gert Wollny
8646e397ae r600/sfn: Fix test for possible dest slot
Fixes Coverity CID 1517721

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20367>
2022-12-17 11:15:17 +01:00
Gert Wollny
d90da01bef r600/sfn: don't use a return register when shader doesn't read it
This reduces register pressure.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20367>
2022-12-17 11:10:30 +01:00
Jianxun Zhang
58e1d14edf iris: Limit DG2 modifiers to DG2
These DG2 modifiers should be disabled on other devices.

Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20363>
2022-12-16 21:29:41 +00:00
Ryan Neph
50b7d36428 venus: rename sync_queue -> timeline
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19691>
2022-12-16 21:12:38 +00:00
Ryan Neph
9ae5c6be12 venus: support vtest+multiple_timelines and enable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19691>
2022-12-16 21:12:38 +00:00
Ryan Neph
fea4af6234 venus: add supports_multiple_timelines capset and enable
Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19691>
2022-12-16 21:12:38 +00:00
Ryan Neph
929e52c35a venus: support external fencing with multiple timelines
Without globalFencing, exportable fences and semaphores must instead
have their proxy vn_renderer_sync installed in the same renderer
ring_idx as ther last queue submissions to ensure they signal after
all work previously submitted to the same ring_idx. Exportable
fences/semaphores with a temporary (imported) payload don't need a proxy
vn_renderer_sync, since they already have a `poll()`able fd available.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19691>
2022-12-16 21:12:38 +00:00
Ryan Neph
2c1a7f877c venus: place wsi submissions on corresponding ring_idx
With implicit fencing, the image has a fence that blocks scanout until
rendering is complete. virtgpu doesn't support implicit fencing yet, but
Sommelier (a VM Wayland compositor) does the wait by exposing the bo as
a GEM handle and waiting on all fences in userspace with a
DRM_IOCTL_VIRTGPU_WAIT before issuing the wl_surface commit.
During vkQueueSubmit involving wsi images, we follow with an empty
renderer submission on the corresonding ring_idx to install a fence
on the appropriate virtgpu fence context after the last rendering
submission.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19691>
2022-12-16 21:12:38 +00:00
Ryan Neph
c957d08600 venus: remove workaround for empty renderer submissions
Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19691>
2022-12-16 21:12:38 +00:00
Ryan Neph
3beb4f055e venus: allow renderer submissions on per-context virtgpu rings
For submissions to renderers that support multiple timelines, put
them on the virtgpu fencing timeline (dma fence context) specified by
the VkQueue's bound ring_idx. CPU-sync'd renderer submissions
can be sent in the same manner by using ring_idx = 0.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19691>
2022-12-16 21:12:38 +00:00
Ryan Neph
9bba5032c2 venus: bind VkQueue to available ring_idx at creation
Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19691>
2022-12-16 21:12:38 +00:00
Ryan Neph
6dce6012df venus: use upstream DRM_IOCTL_VIRTGPU_CONTEXT_INIT
And remove SIMULATE_CONTEXT_INIT and PARAM_MAX_SYNC_QUEUE_COUNT now that
we expect guest kernel support for CONTEXT_INIT with standard support
for up to 64 rings.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19691>
2022-12-16 21:12:38 +00:00
Ryan Neph
a72f84c4a3 venus: update venus-protocol for multiple timelines
Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19691>
2022-12-16 21:12:38 +00:00
Ryan Neph
68be337235 venus: formatting fixes
Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19691>
2022-12-16 21:12:38 +00:00
Benjamin Tissoires
0bd9a062e1 CI: Overwrite valve infra's registry
This is a temporary workaround wihle we wait for valve-infra to sort
out this issue.

It is safe to do because registry.freedesktop.org is a mirror of
harbor.freedesktop.org.

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7913
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20362>
2022-12-16 20:23:17 +00:00
Yonggang Luo
cba819d65e util: Fixes thread safety of DEBUG_GET_ONCE_*_OPTION macros
Pick DEBUG_GET_ONCE_BOOL_OPTION as a example:
The intention of DEBUG_GET_ONCE_BOOL_OPTION are returned the same value across
thread, before this commit, on different thread call the function generated by
DEBUG_GET_ONCE_BOOL_OPTION may return different value if called setenv in the
middle of debug_get_bool_option, so use debug_get_option_cached along with
new exposed function debug_parse_bool_option to solve this issue

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19554>
2022-12-16 19:30:19 +00:00
Yonggang Luo
cdad035cfd util: Add function debug_get_option_cached os_get_option_cached
This is used to fixes DEBUG_GET_ONCE_*_OPTION macros latter

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19554>
2022-12-16 19:30:19 +00:00
Yonggang Luo
397a5c1b2e util: Improve os_get_android_option to be thread-safe
struct hash_table is not thread-safety, need guard by mutex,
but with thread local storage, we can simplify the code and also
got the thread safety without the need of mutex.
Another advantage is by using thread local storage, os_get_android_option
will have the same actions like getenv does, that it's not cached the
value, each call will access the property_get, like getenv will be affected
by putenv

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19554>
2022-12-16 19:30:19 +00:00
Yonggang Luo
501a46fd69 util: Improve prototype of debug_get_num_option and debug_get_flags_option
Getting debug_get_num_option to return int64_t, as long under 64 bit Linux are 64 bit size,
 so using fixed int64_t for cross platform consistence, as long under win32 is 32 bit size.

Getting DEBUG_GET_ONCE_FLAGS_OPTION to return uint64_t to getting it to be
consistence with debug_get_flags_option.

DEBUG_GET_ONCE_NUM_OPTION is not accessed in codebase, so add unittest for it, it maybe
used in future, remove it is not consistence

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19554>
2022-12-16 19:30:19 +00:00
Yonggang Luo
2794ad39fd util: Indent u_debug.c with 3 space instead of tab
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19554>
2022-12-16 19:30:19 +00:00
Yonggang Luo
36ba2e31f6 glsl: fixes -Werror,-Wunused-but-set-variable for clang-15 in glcpp-parse.y and glsl_parser.yy
error messages:
src/compiler/glsl/glcpp/glcpp-parse.c:1691:9: error: variable 'glcpp_parser_nerrs' set but not used [-Werror,-Wunused-but-set-variable]
    int yynerrs = 0;
        ^

src/compiler/glsl/glsl_parser.cpp:2370:9: error: variable '_mesa_glsl_nerrs' set but not used [-Werror,-Wunused-but-set-variable]
    int yynerrs = 0;
        ^

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19875>
2022-12-16 19:02:17 +00:00
Yonggang Luo
113def3bbd glsl: Fixes indent issue after replace tab with 3 space by tools in glcpp-parse.y
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19875>
2022-12-16 19:02:17 +00:00
Yonggang Luo
3261a54c79 glsl: replace tab with 3 space in glcpp-parse.y
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19875>
2022-12-16 19:02:17 +00:00
Yonggang Luo
c5a4520b3c glsl: Fixes ident issue in glsl_parser.yy and update editorconfig for it
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19875>
2022-12-16 19:02:17 +00:00
Yonggang Luo
9f5ace9857 panvk: Fixes -Werror,-Wunused-but-set-variable for clang-15 in panvk_descriptor_set.c
../../src/panfrost/vulkan/panvk_descriptor_set.c:67:13: error: variable 'dynoffset_idx' set but not used [-Werror,-Wunused-but-set-variable]
   unsigned dynoffset_idx = 0, img_idx = 0;
            ^

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19875>
2022-12-16 19:02:17 +00:00
Yonggang Luo
fb6b3bee25 loader: fixes -Werror,-Wdeprecated-non-prototype for clang-15 in pipe-loader
There are multiple error messages, show one of them:
../../src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c:219:54: error: passing arguments to a function without a prototype is deprecated in
all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
         sdev->ws = sdev->dd->winsys[i].create_winsys(drisw_lf);
                                                     ^

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19875>
2022-12-16 19:02:17 +00:00
Jesse Natalie
cd8f2b51a0 d3d12/ci: Update expectations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20346>
2022-12-16 18:40:47 +00:00
Jesse Natalie
53260f7bed dzn: Swizzle SRV access to stencil
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20346>
2022-12-16 18:40:47 +00:00
Jesse Natalie
e4e0ab2207 dzn: Pass input clip size to shader compilation
For cases where both clip and cull are used, and a shader has both
inputs and outputs that can contain them, we need metadata to tell
us where the clip array ends and the cull array begins, since they
get combined into CLIP location registers. For outputs, this is in
the nir info, but for input we pass it in a sideband channel.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20346>
2022-12-16 18:40:47 +00:00
Jesse Natalie
565d454071 dzn: Don't add UAV flag to DSV textures
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20346>
2022-12-16 18:40:47 +00:00
Jesse Natalie
c4201f4a79 dzn: Use ResolveSubresourceRegion to support non-averaging resolve modes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20346>
2022-12-16 18:40:47 +00:00
Jesse Natalie
e24468803e dzn: Use driver-implemented triangle fans if available
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20346>
2022-12-16 18:40:47 +00:00
Jesse Natalie
e1ea140d77 dzn: Get options15
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20346>
2022-12-16 18:40:47 +00:00
Jesse Natalie
e950224787 microsoft/compiler: Handle cull distance starting fractional with no previous clip
This can happen if the clip distance was declared, but was discarded as an
unused variable.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20346>
2022-12-16 18:40:47 +00:00
Jesse Natalie
638e375c19 microsoft/compiler: Sort all user varyings before any sysvals
User varyings are linked by both name and register. The name is based
on how many *variables* are before it in final driver_location sort
order, not necessarily how many registers are before it.

In some cases where clip/cull distance are involved, it's possible
for one shader to write into a part of the cull distance that's
ignored by a downstream shader, but because linking is done by
*whole* register locations, and clip/cull can be combined using
*fractional* register locations, this is hard to detect. Since no
non-sysvals end up using fractional locations, just put all non-sysvals
first so they always generate the same semantic names for the same
register locations.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20346>
2022-12-16 18:40:47 +00:00
Jesse Natalie
8c1af8854b microsoft/compiler: Make nir_var_to_dxil_sysvalue_type static
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20346>
2022-12-16 18:40:47 +00:00
Jesse Natalie
f363504b42 microsoft/compiler: Handle both input and output clip/cull distances
For clip/cull coming into a GS and being written, this pass was wrong
and would modify variable types incorrectly. Track both inputs and
outputs separately.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20346>
2022-12-16 18:40:47 +00:00
Alyssa Rosenzweig
476be5cb27 panfrost: Don't use texture format swizzles on v7
They're too restricted for AFBC. Fix up instead. There are two problems at play:

1. We can't just map the format swizzle to the pixel format ordering on v7,
   because the "reordered" values aren't allowed with compression.
2. We can't just compose the format swizzle with the API swizzle, because the
   composed swizzle is applied to the border colour, so we need to be able to
   apply an inverted swizzle to the border colour. That only works for bijective
   format swizzles.

Fortunately, there's a neat solution: decompose the format's swizzle into two
swizzles, the first mapping to a reordering that IS allowed for compression, and
the second a bijection. Then we use the allowed reordering when texturing, apply
the bijective swizzle to the API swizzle, and apply the inverse of the bijective
swizzle to the border colour. When we're sampling a border colour, what's now
happening mathematically is:

   (API swizzle o bijective swizzle)((bijective swizzle^-1)(border colour)) =
   (API swizzle o (bijective swizzle o bijective swizzle^-1))(border colour) =
   API swizzle(border colour)

which is exactly what we wanted.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20311>
2022-12-16 18:27:47 +00:00
Alyssa Rosenzweig
f159ff530e panfrost: Allow swizzled AFBC on v9+
On v6 and earlier, the hardware supports arbitrary format swizzles for AFBC, so
there's no restriction on AFBC. On v8 and newer, the format swizzle gets applied
to the *decompressed* interchange format, so we can effectively support BGRA of
AFBC images without any special handling. (Confirmed working on v9. Obviously I
can't test on v8 but the expression is cleaner if we assume optimistically it's
like v9. Without hardware, we get to make that assumption :-p)

That just leaves v7 as the only architecture where format swizzles are
restricted for compression but there are no plane descriptor. Don't apply the
restriction to the newer parts.

This gets us AFBC of window surfaces on v9+. As the limiting case, fullscreen
glmark2-es2-wayland -btexture (1080p) in sway on Mali-G57 from 1300fps to
2353fps.

45% reduction in frame time is nothing to sneeze at.

Achoo.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20311>
2022-12-16 18:27:47 +00:00
Alyssa Rosenzweig
cb5e417c01 panfrost: Introduce pan_afbc_mode
Introduce an enum to represent an AFBC compression mode. These modes are not
formats, on Valhall they are decoupled from the format. As such, it does not
make sense to use a pipe_format to represent them. Add an enum that we can use
in a straightforward way on Midgard and Bifrost to fallback for texture views,
and can map 1:1 to the Valhall hardware enum.

In addition to being less overloaded semantically, this lets -Wswitch kick in to
ensure that we handle all enums when translating. The straightforward
translation raises the following warnings:

../src/panfrost/lib/pan_cs.c:437:9: warning: enumeration value ‘PAN_AFBC_MODE_R5G5B5A1’ not handled in switch [-Wswitch]
  437 |         switch (panfrost_afbc_format(PAN_ARCH, format)) {
      |         ^~~~~~

...indicating that some formats were missed, leading to assertion fails "unknown
canonical AFBC format" when rendering RGB5A1, which dEQP-GLES31 does. Fixes
regressions in
dEQP-GLES31.functional.draw_buffers_indexed.random.max_required_draw_buffers.*
on Valhall.

Given how scarce v9 hardware is, that v10 isn't upstream yet, and the offending
code was merged a week ago, this should not have actually affected anyone. At
any rate, it's a good reminder we really do need CI for v9...

Fixes: 8e125b6c15 ("panfrost: Enable AFBC of more formats")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20311>
2022-12-16 18:27:47 +00:00
Alyssa Rosenzweig
0784adc668 panfrost: Luminance-alpha AFBC unsupported on v7+
The L8_UNORM, A8_UNORM, and L8A8_UNORM v7 formats do not support AFBC,
regardless of swizzling. We're about to lift the restrictions on swizzling with
AFBC on v7, so we'll need to handle these cases explicitly to avoid using AFBC
in these cases.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20311>
2022-12-16 18:27:47 +00:00
Alyssa Rosenzweig
a3f9aa3b3e panfrost: Align WSI strides for tiled AFBC
When calculating legacy WSI strides for tiled AFBC, we need to account for the
greater alignment requirement of tiled AFBC, or importing resources will fail
later.

Since tiled AFBC is only supported on v7 and later, and AFBC of window surfaces
isn't being used on Linux on v7 and later, this probably hasn't been hit in
practice. Probably.

We're about to fix AFBC of window surfaces so we need to fix this side first.

Fixes: 0255f554f3 ("panfrost: Advertise 16x16 tiled AFBC")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20311>
2022-12-16 18:27:47 +00:00
Alyssa Rosenzweig
b08a7e9db5 panfrost: Remove panfrost_blit_format
Trivial.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20311>
2022-12-16 18:27:47 +00:00
Alyssa Rosenzweig
4802168b94 panfrost: Remove RGTC emulation relic
u_transfer_helper no longer emulates RGTC, so this code path is dead. RGTC
emulation now happens in the state tracker so the formats will work out
properly. (Similar to how other BCn formats are emulated in mesa/st.)

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20311>
2022-12-16 18:27:47 +00:00
Alyssa Rosenzweig
3cb151573b asahi: Remove agx_blit_format
Copied from panfrost, decopy the useless.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20311>
2022-12-16 18:27:47 +00:00
Rhys Perry
9e3a7a1744 radv/ci: add yet another pipeline barrier test as flake
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/33638274

Also add a few similar tests.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20359>
2022-12-16 18:06:48 +00:00
Rhys Perry
357d1fc75b radv/gfx11: enable VK_AMD_shader_explicit_vertex_parameter
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/20341>
2022-12-16 17:45:34 +00:00
Rhys Perry
201291d968 ac/llvm/gfx11: implement load_input_vertex
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/20341>
2022-12-16 17:45:34 +00:00
Rhys Perry
98e83f19f9 aco/gfx11: implement load_input_vertex
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/20341>
2022-12-16 17:45:34 +00:00
pal1000
f69b43ae3e OpenCL/draw module: Support linking with LLVM and clang 15 static libraries
Cc: mesa-stable

Closes: #7243

Closes: #7487

Reviewed-by: Karol Herbst <kherbst@redhat.com>

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19009>
2022-12-16 16:52:48 +00:00
Samuel Pitoiset
83617f4a57 radv: enable graphicsPipelineLibraryIndependentInterpolationDecoration
They don't need to match.

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/20202>
2022-12-16 16:21:31 +00:00
Samuel Pitoiset
14e9fbb4d6 radv: enable graphicsPipelineLibraryFastLinking
I think fast-linking could be improved a lot but this allows to test
GPL with Zink (RADV_PERFTEST=gpl + ZINK_DEBUG=gpl).

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/20202>
2022-12-16 16:21:31 +00:00
Samuel Pitoiset
24db7caebd radv: import compiled binaries from libraries only when fast-linking is enabled
When VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT is used, the
pipeline includes a complete set of state specified entirely by
libraries. That means that we should skip using compiled binaries
(including PS epilogs) and we should create an optimized pipeline.

Found this with Zink because RADV was creating two pipelines with the
same PS epilog, while the optimized one shouldn't use any PS epilog.

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/20202>
2022-12-16 16:21:31 +00:00
Rhys Perry
74ceff1816 radv/gfx11: disable mesh shaders
Even if the perftest is used, these should be disabled on GFX11. We
don't implement it yet

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: 22.3 <mesa-stable>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20358>
2022-12-16 15:58:49 +00:00
Rhys Perry
192486b7aa aco/gfx11: export mrtz in discard early exit for non-color shaders
If a shader doesn't export any color targets and instead only exports
mrtz, the discard early exit block should match.

Fixes artifacts on Lara in Rise of the Tomb Raider benchmark and hair in
The Witcher 3 (classic).

https://reviews.llvm.org/D128185

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: bc8da20dda ("aco: export MRT0 instead of NULL on GFX11")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20345>
2022-12-16 15:35:28 +00:00
Erik Faye-Lund
c6cc1dc37c zink: fix line-smooth interpolation
Extending the lines by half a pixel in each direction without doing
anything about the varyings makes the varyings interpolate over a
distance than intended. While this can be negligeble for long lines,
it can lead to big error for short lines.

Let's instead add extra geometry for each of the line-caps, so we can
make sure the varyings stay constant for the whole cap, and interpolate
over the intended distance instead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19847>
2022-12-16 13:57:19 +00:00
Erik Faye-Lund
80285db9ef zink: lower smooth-lines if not supported
This implements line-smoothing the same way as the draw-module does,
except using a geometry shader instead of a CPU pass.

Ideally, this should be enabled either by checking for the various
smooth-line caps, or by a DRIconf setting.

Unfortunately, RADV doesn't support he smooth-lines features, and we
don't want to force it down a pessimistic shader-key code-path. So that
plan is out the window for now.

While DRIconf is also neat, it's a bit of work to wire up, and we don't
really know of any real-world applications who would need this yet. So,
for now, let's just unconditionally enable is on the IMG proprietary
driver, which is going to need this for sure.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19847>
2022-12-16 13:57:19 +00:00
Erik Faye-Lund
50d89663c5 zink: add line-smooth lowering passes
These passes implements basically the same logic as draw_pipe_aaline.c
does, but using geometry shaders instead of doing it CPU-side.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19847>
2022-12-16 13:57:19 +00:00
Erik Faye-Lund
23f1294f42 zink: fix line-stipple varying allocation
This was really derpy. There's two things wrong; first of all, we should
pick at LEAST VARYING_SLOT_VAR0, second, util_last_bit64 returns one
more than the index of the bit already, so we don't want to add twice
here.

Fixes: 4b17c099ca ("zink: add line-stippling lowering passes")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19847>
2022-12-16 13:57:19 +00:00
Gert Wollny
f135309e73 r600/sfn: Check possibility of channel switching also for trans-slot
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7878

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20355>
2022-12-16 13:39:55 +00:00
Gert Wollny
4b89a8fd00 r600: don't try to serialized shaders translated from TGSI
TTN seems to have a problem encoding vec4[4] correctly, so that
serialization might fail.

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7891

Fixes: 5b205ef (r600: Store nir shaders serialized to save memory)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20355>
2022-12-16 13:39:55 +00:00
David Heidelberg
a8b6b2367e ci: allow omitting of --rev for ci_run_n_monitor.py
When --rev is omitted, try to get revision automatically.

Acked-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20271>
2022-12-16 14:00:37 +01:00
David Heidelberg
f745e86391 ci: ci_run_n_monitor fix Unicode log parsing
Fixes issues as  `...truncated \ xXX escape` while parsing the log.

Acked-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20271>
2022-12-16 14:00:27 +01:00
Iago Toral Quiroga
df8611e816 v3dv: be more careful when restoring dirty state after meta operations
So far we have been only restoring dirty dynamic states used by meta
pipelines however, static state from meta pipelines will also clear
dirty flags, preventing follow-up draw calls in the command buffer
to honor these if they are flagged as dynamic states in their
pipelines. Fix this by always resetting all dirty state flags after
a meta operation so we re-emit all the state we need with the next draw
call.

Fixes:
dEQP-VK.dynamic_state.monolithic.image.clear

cc: mesa-stable

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20356>
2022-12-16 12:18:36 +00:00
Iago Toral Quiroga
3cc863649f v3dv: pipeline creation feedback may not request all stages
Nothing in the spec seems to require that the number of stages for
which creation feedback is requested must match the number of stages
available in the pipeline. In fact, the spec explicitly mentions
that this number could be 0:

   "If pipelineStageCreationFeedbackCount is not 0,
    pPipelineStageCreationFeedbacks must be a valid pointer to an
    array of pipelineStageCreationFeedbackCount
    VkPipelineCreationFeedback structures"

Fixes an assert crash in:
dEQP-VK.pipeline.monolithic.creation_feedback.graphics_tests.vertex_stage_fragment_stage_no_cache_zero_out_feedback_cout

cc: mesa-stable

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20352>
2022-12-16 11:14:40 +00:00
Michel Dänzer
bdcbdfdfcb egl/wayland: Prefer back buffer with minimum buffer age
This may allow applications making use of buffer age to save some effort
in some cases.

v2: (Simon Ser)
* Add space between struct member and "<" operator.
* Remove break statement which prevented the change from working as
  intended in swrast_update_buffers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18269>
2022-12-16 10:30:47 +00:00
Michel Dänzer
ec90a6e132 loader/dri3: Simplify new buffer allocation in dri3_find_back
We can find the idle buffer with lowest buffer age or the first
unallocated slot in the same loop.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18269>
2022-12-16 10:30:47 +00:00
Michel Dänzer
c82c71a650 loader/dri3: Find idle buffer with minimum buffer age in dri3_find_back
This may allow applications making use of buffer age to save some effort
in some cases.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18269>
2022-12-16 10:30:47 +00:00
Michel Dänzer
d588145161 loader/dri3: Clean up dri3_find_back logic
No need to go through the loop again for allocating a new buffer.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18269>
2022-12-16 10:30:47 +00:00
Karol Herbst
a093a44d45 zink: lower mem_global to scalar
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20106>
2022-12-16 08:02:32 +00:00
Karol Herbst
6d6c6caff1 nir_lower_io_to_scalar: handle load/store_global
Signed-off-by: Karol Herbst <kherbst@redhat.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/20106>
2022-12-16 08:02:32 +00:00
Karol Herbst
3cd641bebd nir_lower_io_to_scalar: make use of nir_get_io_offset_src
Signed-off-by: Karol Herbst <kherbst@redhat.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/20106>
2022-12-16 08:02:32 +00:00
Iago Toral Quiroga
ce94d3e48d v3dv: honor render area in subpass resolve fallback
When falling back to handling subpass resolves via separate
image resolves we were resolving the entire attachment instead
of limiting the resolve to the render area defined for the render
pass.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20331>
2022-12-16 07:48:36 +00:00
Iago Toral Quiroga
9ac053e0a2 v3dv: handle depth/stencil resolves we can't implement via TLB
If we can't use the TLB to do a subpass resolve we have a fallaback
that emits separate image resolves, but this fallback was only
handling color resolves. This adds depth/stencil as well.

Fixes some of the issues we have with CTS 1.3.4 in:
dEQP-VK.pipeline.monolithic.multisample.misc.*

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20331>
2022-12-16 07:48:36 +00:00
Iago Toral Quiroga
284285376b v3dv: don't resolve by averaging samples on depth/stencil resolves
For these we always want to use sample_0, averaging is reserved for
color formats. We were already doing this correctly for depth/stencil
resolved in render passes, but not for those happening through
vkCmdResolveImage.

Fixes some of the issues we have with CTS 1.3.4 in:
dEQP-VK.pipeline.monolithic.multisample.misc.*

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20331>
2022-12-16 07:48:36 +00:00
Iago Toral Quiroga
6117f855ee v3dv: always store/restore attachment state during meta operations
attachment state is only relevant during render passes, however,
there is a corner case: if we can't resolve an attachment in a
subpass using the hardware, we emit a manual image resolve in the
driver which can trigger a meta operation via blit. In this case,
we pretend we are not in a render pass (since vulkan disallows
blits/resolves in a render pass) but we really want to keep the
attachment state after the meta operation.

Fixes some of the issues we have with CTS 1.3.4 in:
dEQP-VK.pipeline.monolithic.multisample.misc.*

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20331>
2022-12-16 07:48:36 +00:00
Chad Versace
a5f9e59ce3 anv: Use vma_heap for descriptor pool host allocation
Pre-patch, anv_descriptor_pool used a free list for host allocations
that never merged adjacent free blocks.  If the pool only allocated
fixed-sized blocks, then this would not be a problem. But the pool
allocations are variable-sized, and this caused over half of the pool's
memory to be consumed by unusable free blocks in some workloads, causing
unnecessary memory footprint.

Replacing the free list with util_vma_heap, which does merge adjacent
free blocks, fixes the memory explosion in the target workload.

Disdavantges of util_vma_heap compared to the free list:
  - The heap calls malloc() when a new hole is created.
  - The heap calls free() when a hole disappears or is merged with an
    adjacent hole.
  - The Vulkan spec expects descriptor set creation/destruction to be
    thread-local lockless in the common case. For workloads that
    create/destroy with high frequency, malloc/free may cause overhead.
    Profiling is needed.

Tested with a ChromeOS internal TensorFlow benchmark, provided by
package 'tensorflow', running with its OpenCL backend on clvk.

  cmdline: benchmark_model --graph=mn2.tflite --use_gpu=true --min_secs=60
  gpu: adl
  memory footprint from start of benchmark:
    before: init=132.691MB max=227.684MB
    after:  init=134.988MB max=134.988MB

Reported-by: Romaric Jodin <rjodin@google.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20289>
2022-12-16 07:18:38 +00:00
Chad Versace
94a6384f1b util/vma: Track size of free memory in heap
This allows users to detect fragmentation on allocation failure.
If heap allocation fails but the allocation size is not larger than the
total free size, then the allocation failed due to fragmentation.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20289>
2022-12-16 07:18:38 +00:00
Iván Briano
766508f56a Revert "anv: Refactor anv_pipeline to use the anv_pipeline_type"
This reverts commit b1126abb38.

This breaks all hell at least on DG2, as there are several cases left
where current_pipeline gets checked against GPGPU to decide what to do,
and the value doesn't match that of ANV_HW_PIPELINE_STATE_COMPUTE.
On top of that, it also misses checking for
ANV_HW_PIPELINE_STATE_RAYTRACING.

Then there's the fact that in some cases, current_pipeline will be
UINT32_MAX, because it's the original undefined state and also used
after executing a secondary command buffer because we are not tracking
on which pipeline did the secondary left us.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7910
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20349>
2022-12-16 06:39:32 +00:00
Kenneth Graunke
94f2619b7d iris: Don't reject CPU access for non-invalidating buffer write maps
Buffer maps that don't invalidate their destination range work better
as direct CPU maps than staging blits.  The application may write only
part of the range, effectively combining the new data with existing
data.  So even if the map would stall, the staging blit path won't help
us, as we have to read the existing data to populate the staging buffer
before returning it.  This incurs a stall anyway - plus a read and copy.

In contrast, a direct map doesn't need to read any data - it can just
write the destination and the existing data will still be there.

Fixes excessive blits for stalling buffer writes that don't invalidate
the buffer since my recent map heuristic rework.

Fixes: bec68a85a2 ("iris: Improve direct CPU map heuristics")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7895
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20330>
2022-12-16 06:09:31 +00:00
Tapani Pälli
77244e30b6 anv: remove some gen8 specifics handled now in hasvk
Signed-off-by: Tapani Pälli <tapani.palli@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/20342>
2022-12-16 07:25:30 +02:00
David Heidelberg
09d5c55836 ci: restore reliable Alpine 3.16
Alpine 3.17 suffered random freezes.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20294>
2022-12-16 00:26:27 +00:00
Nanley Chery
94b4a4b2a5 iris: Check for zero in clear color compatibility fn
Both formats may interpret the clear color as zero.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20320>
2022-12-15 21:20:37 +00:00
Sil Vilerino
002096fcc4 d3d12: Add ASSERTED to variables only used in debug builds to fix build MSVC with C4189 errors
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20340>
2022-12-15 21:06:12 +00:00
Jordan Justen
5df50292d6 intel/isl: Disable CCS on MTL until B0 (Wa_14017353530)
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20322>
2022-12-15 11:43:00 -08:00
Jianxun Zhang
6e33423a6f intel/dev: Enable AUX map on MTL
Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20322>
2022-12-15 11:43:00 -08:00
Jordan Justen
f81579628a intel/aux_map: Ignore format bits when using tile-4
Based on Jianxun's ("iris: don't get format bits in AUX tables").

With gfx12.5+, the compression format is once again coming from the
surface state programming. MTL once again uses an aux-map, but it
ignores the format bits within the the aux-map metadata.

Ref: Bspec 44930: "Compression format from AUX page walk is ignored.
Instead compression format from Surface State is used."

gfx12.5+ also uses tile-4 rather than y-tiling, so if we don't see
y-tiling, we can return 0 from intel_aux_map_format_bits() for the
ignored format bits.

Rework:
 * Just return 0 if not using y-tiling as suggested by Nanley.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20322>
2022-12-15 11:43:00 -08:00
Jordan Justen
1bcce906e9 iris/resource: Check devinfo::has_local_mem before using BO_ALLOC_LMEM
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20322>
2022-12-15 11:42:59 -08:00
José Roberto de Souza
ac9af0dcee iris: Nuke dead IRIS_CONTEXT* macros
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19650>
2022-12-15 18:55:02 +00:00
José Roberto de Souza
2dd1b12bc6 iris: Nuke flags from iris_bufmgr that can read from devinfo
Now that devinfo is stored in iris_bufmgr we can nuke this duplicated
flags.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19650>
2022-12-15 18:55:02 +00:00
José Roberto de Souza
1e78dd9eda iris: Only fetch intel_device_info once per bufmgr
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19650>
2022-12-15 18:55:02 +00:00
José Roberto de Souza
aff85114fd iris: Store intel_device_info in iris_bufmgr
We can have multiple pipe_screen but only one iris_bufmgr per device.
So better to store intel_device_info into the shared iris_bufmgr and
save some memory.
Also in future patches iris_bufmgr will make more use of
intel_device_info.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19650>
2022-12-15 18:55:02 +00:00
Lionel Landwerlin
b21cd1ee1b anv: fixup another dirty issue with gpu_memcpy
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/20335>
2022-12-15 17:30:55 +00:00
Patrick Lerda
87f0b7d0c1 panfrost: fix memory leak related to disk cache
Direct leak of 3912 byte(s) in 2 object(s) allocated from:
    #0 0x7fbd4641b0 in __interceptor_malloc (/usr/lib64/libasan.so.6+0xa41b0)
    #1 0x7f74413518 in parse_and_validate_cache_item ../src/util/disk_cache_os.c:549
    #2 0x7f74414b84 in disk_cache_load_item ../src/util/disk_cache_os.c:599
    #3 0x7f74410364 in disk_cache_get ../src/util/disk_cache.c:551
    #4 0x7f775695ac in panfrost_disk_cache_retrieve ../src/gallium/drivers/panfrost/pan_disk_cache.c:125

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20336>
2022-12-15 17:16:40 +00:00
Rohan Garg
b1126abb38 anv: Refactor anv_pipeline to use the anv_pipeline_type
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/20316>
2022-12-15 16:38:18 +00:00
Konstantin Seurer
ffc8d490b7 radv/rra: Fix leaf node id order
Leaf nodes aren't stored in build order so we have to account for that
when dumping leaf node ids.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20184>
2022-12-15 16:00:17 +00:00
Konstantin Seurer
3a8c3b813e radv/rra: Validate geometry_id
The following patch will use geometry_id so make sure that it's in
bounds.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20184>
2022-12-15 16:00:17 +00:00
Konstantin Seurer
446c49cdf7 radv/rra: Refactor resource management during dumping
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20184>
2022-12-15 16:00:17 +00:00
Konstantin Seurer
ab8777b384 radv/rra: Emit leaf node ids for leaf nodes instead of internal nodes
Fixes: e4283d8 ("radv/rra: Handle box16 nodes")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20184>
2022-12-15 16:00:17 +00:00
Samuel Pitoiset
5a5f3fe561 ac/sqtt: bump the maximum number of traces to 6 for GFX11
GFX11 can have more than 4 SEs. I think it would be better to allocate
an array but that's for later.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20337>
2022-12-15 15:19:39 +00:00
Samuel Pitoiset
5f7955ff74 ac/rgp: add missing GFX11 bits for RGP
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20337>
2022-12-15 15:19:39 +00:00
Rhys Perry
54ae38042a ac/nir: remove num_es_threads_var
A bit count of es_accepted works for both when ngg is and isn't
dynamically enabled. Unlike the other sequence, this should only be a
single SALU instruction.

fossil-db (gfx1100, nggc):
Totals from 41388 (30.75% of 134574) affected shaders:
Instrs: 25783544 -> 25432959 (-1.36%); split: -1.36%, +0.00%
CodeSize: 127281160 -> 125878820 (-1.10%); split: -1.10%, +0.00%
Latency: 92849566 -> 92723047 (-0.14%); split: -0.14%, +0.00%
InvThroughput: 9542194 -> 9485012 (-0.60%); split: -0.60%, +0.00%
Copies: 2031074 -> 1928796 (-5.04%); split: -5.04%, +0.00%
Branches: 642407 -> 642409 (+0.00%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20321>
2022-12-15 13:30:25 +00:00
Rhys Perry
69e55d9c1b ac/nir: fix ngg culling on gfx11
This subtraction can underflow.

If subgroup_id*wave_size is larger than num_live_vertices_in_workgroup,
num_es_threads_var should be zero.

fossil-db (gfx1100, nggc):
Totals from 41388 (30.75% of 134574) affected shaders:
Instrs: 25700772 -> 25783544 (+0.32%)
CodeSize: 126950072 -> 127281160 (+0.26%)
Latency: 92809233 -> 92849566 (+0.04%); split: -0.00%, +0.04%
InvThroughput: 9526675 -> 9542194 (+0.16%)
Copies: 2031078 -> 2031074 (-0.00%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20321>
2022-12-15 13:30:25 +00:00
Eric Engestrom
ba31ec0d6f vc4: replace open-coded F_DUPFD_CLOEXEC with os_dupfd_cloexec()
Just like 12 lines above.

Split out of !20180

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20313>
2022-12-15 09:53:01 +00:00
Jordan Justen
78a75e0d25 intel/common/intel_genX_state.h: Add intel_set_ps_dispatch_state()
This replaces brw_fs_get_dispatch_enables(), which was added in
b9403b1c47 ("intel: factor out dispatch PS enabling logic"), but this
function will not work well for future changes to 3DSTATE_PS.

So, instead, this moves the related code into a "genX" file which can
directly update 3DSTATE_PS for the given platform.

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/20329>
2022-12-15 00:54:59 -08:00
Jordan Justen
f16e76d940 intel/common: Add intel_genX_state.h
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/20329>
2022-12-15 00:54:59 -08:00
Samuel Pitoiset
ed28705994 radv/ci: add lists for GFX1100
0 failures, call it a win (the RT ones are CTS bugs).

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/20315>
2022-12-15 08:34:29 +01:00
Kenneth Graunke
3440e89437 st/mesa: Enable Alpha writes when writing RGB faked as RGBA
Some GPUs are able to render more efficiently when all channels of a
color attachment are written, since whole pixels are being overwritten,
rather than hitting a read-modify-write cycle where newly written data
has to be combined with existing unmodified image data.

When faking GL_RGB as RGBA (in case RGB/RGBX isn't color renderable),
we introduce an extra channel that doesn't exist from the application
point of view.  With such a format, a color mask of 0x7 (RGB) would mean
to write all channels.  But because we've added an alpha channel behind
their back, this becomes a partial write.  We are free to write whatever
garbage we want to the alpha channel, however.  So we can enable alpha
writes, making this a more efficient full pixel write again.

This is done unconditionally as it's expected to address a problem
common to many drivers and isn't expected to be harmful, even on GPUs
where it may not help much.

Improves WebGL Aquarium performance on Alderlake GT1 by around 2.4x, in
the Chromium, using Wayland (the --enable-features=UseOzonePlatform and
--ozone-platform=wayland flags).

v2: Don't require PIPE_CAP_RGB_OVERRIDE_DST_ALPHA_BLEND (Marek)
v3: Fix independent blending enables (Emma) - now set when needed,
    skipped when not needed, and PIPE_CAP_INDEP_BLEND_ENABLE is no
    longer a requirement.  We just optimize where we can.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7864
Reviewed-by: Matt Turner <mattst88@gmail.com> [v1]
Reviewed-by: Marek Olšák <marek.olsak@amd.com> [v2]
Reviewed-by: Emma Anholt <emma@anholt.net> [v3]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20290>
2022-12-14 23:35:47 +00:00
Eric Engestrom
c1144c8264 docs: update calendar and link releases notes for 22.3.1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20328>
2022-12-14 23:04:28 +00:00
Eric Engestrom
42de551b83 docs: add release notes for 22.3.1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20328>
2022-12-14 23:04:28 +00:00
Alyssa Rosenzweig
a861501632 panfrost: Add tool to print supported texture formats
While all Panfrost-supported Mali GPUs support all the compressed texture
formats architecturally, the system integrator decides which formats will
actually be wired up in the production system-on-chip. In the past there may
have been legal considerations, I'm neither a lawyer nor a system integrator so
couldn't say.

It's useful for users to know which compressed texture formats are supported by
their hardware, to understand its performance characteristics (and perhaps to
buy systems that support their needs, especially if they need BCn formats which
are omitted in many Mali implementations).

To help with that, this commit adds a small standalone tool that prints which
formats are supported. It is tested so far on Mali-T860 and Mali-G57.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Tested-by: Chris Healy <healych@amazon.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20086>
2022-12-14 22:48:47 +00:00
Emma Anholt
dafbdd8a35 ci/nouveau: Add a bunch of the top hits of gk20a flakes.
A bit of categorization in the process.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20326>
2022-12-14 21:41:51 +00:00
Emma Anholt
3890df3382 ci/nouveau: Sort some uncategorized gk20a flakes.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20326>
2022-12-14 21:41:51 +00:00
Kenneth Graunke
0521027182 nir: Allow more than just ALU instructions in 'weak' GVN
This removes the ALU-only restriction on the "weak" GVN introduced by
the previous commit.  This makes it slightly more aggressive, allowing
it to coalesce things like UBO loads (still within sister then/else
blocks).  This also can have surprisingly large cascading effects.

I was concerned that this might increase register pressure, but
shader-db and fossil-db show effectively no change in spills/fills,
so it seems to be fine.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19823>
2022-12-14 20:56:55 +00:00
Kenneth Graunke
d5d03a7273 nir: Perform 'weak' global value numbering in all GCM passes
Full global value numbering (GVN) can be pretty aggressive, moving
values far away from their original locations, even out of loops,
and can extend their live ranges a lot.  So we've left it disabled.

This patch introduces a weaker form of GVN: we only allow coalescing
identical values when they appear on either side of the same if/else
construct.  For now, we also only allow ALU instructions.

This allows nir_opt_gcm to clean up identical instructions appearing
on both sides of if/then/else control flow.  But it avoids aggressively
combining every other occurrence of a value in the program.

This can still have surprisingly large cascading effects, as simple
constructs are cleaned up, leading to more opportunities to do the
same clean up, up a chain of nested ifs.  It also enables greater use
of the select peephole as ifs are cleaned up.

shader-db and fossil-db results show a reduction in spills/fills on
Icelake, so it doesn't seem to be hurting register pressure.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19823>
2022-12-14 20:56:55 +00:00
Paulo Zanoni
e930bff19e anv: remove anv_reloc_list->array_length
This is another field that, after the recent commits, became unused.
It's either zero-initialized (by the memset) or copy-initialized
(which means it's also zero). And it never even gets used anywhere
anyway, so even if the value was non-zero it wouldn't matter.

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
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/20309>
2022-12-14 10:44:31 -08:00
Paulo Zanoni
1358622878 anv: remove anv_reloc_list->reloc_bos
As a consequence of the last two commits, reloc_bos is always NULL and
never used anywhere, so remove it.

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
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/20309>
2022-12-14 10:44:31 -08:00
Paulo Zanoni
f1c4c646b8 anv: remove anv_reloc_list_grow()
The last commit made it clear that anv_reloc_list_grow() only ever
gets called with zero as num_additional_relocs, which means it will
always immediately return VK_SUCCESS without doing anything. That
means we can remove it.

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
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/20309>
2022-12-14 10:44:31 -08:00
Paulo Zanoni
4168d3ef30 anv: remove anv_reloc_list->num_relocs
There are only a few places in the code where num_relocs gets set:

  - During anv_reloc_list_init() where it gets memset() to 0.
  - At anv_reloc_list_init_clone() where it gets set with the value of
    another anv_reloc_list->num_relocs.
  - During anv_reloc_list_clear(), where it gets set to 0.
  - During anv_reloc_list_append(), where it gets added with the value
    of another anv_reloc_list->num_relocs.

As you can see, either we explicitly set the value to 0 or we copy the
value that's present in another anv_reloc_list, which should be 0. The
one place where we used to increment num_relocs was in
anv_reloc_list_add(), but that was deleted by:

  7b7381e8d7 ("anv: Delete anv_reloc_list_add()")

So in this commit we delete the num_relocs field from struct
anv_reloc_list and we also delete some lines where, if the value is 0,
nothing will happen.

There's more we could be deleting here, but I wanted this commit to be
minimal so it's very clear that num_relocs can't be non-zero. We were
having some speculation that anv_reloc_list may still be important for
actually adding BOs to the batch and building the validation list, so
let's go slowly with the removal to make everything more easily
reviewable.

The one possibility I could be missing here is another situation like
the memset() we have at anv_reloc_list_init() or some other crazy
indirect overwrite, but as far as I have checked, that is not the
case.

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
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/20309>
2022-12-14 10:44:31 -08:00
Paulo Zanoni
4b1c4925e7 anv: remove anv_execbuf->surface_states_relocs
Now that we removed relocations, this is not being used anywhere.

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
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/20309>
2022-12-14 10:44:31 -08:00
Jianxun Zhang
c14857e915 intel/common: clean up AUX macros
The hardcoded is either replaced with new interfaces or relocated
to C file if it is private.

Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20259>
2022-12-14 18:11:13 +00:00
Jianxun Zhang
9ff471fdc6 intel/vulkan: replace AUX macros with interfaces
Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20259>
2022-12-14 18:11:13 +00:00
Jianxun Zhang
78a4b6deed intel/isl: Support 1MB alignment for AUX mapping
Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20259>
2022-12-14 18:11:13 +00:00
Jianxun Zhang
9698eee50d intel/common: Support 1MB granularity AUX mapping format (Bspec 44930)
Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20259>
2022-12-14 18:11:13 +00:00
Emma Anholt
49c6e30611 ci/bare-metal: Avoid a bug in armhf stripping causing tempfiles in artifacts.
We're failing to strip, so at least try not to leave a million tempfiles
around.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20302>
2022-12-14 17:09:07 +00:00
Emma Anholt
dace7d780d ci/baremetal: Clean the directory we unpack artifacts into.
gitlab-runner reuses containers, and since we don't pull git, the working
directory doesn't get cleaned automatically.  You don't want to have stale
files from previous builds, particularly if someone's testing changes of
build options that might disable a driver.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20302>
2022-12-14 17:09:07 +00:00
Connor Abbott
046c75e95c tu: Use start offset for storage buffers
This lets us expose a minStorageBufferOffsetAlignment of 4 which is what
vkd3d-proton expects.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20105>
2022-12-14 16:19:47 +00:00
Connor Abbott
316ed8f965 tu: Expose *TexelBufferOffsetSingleTexelAlignment
This exactly matches what the HW can do.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20105>
2022-12-14 16:19:47 +00:00
Connor Abbott
4d2aa9a9f7 freedreno/fdl: Support texel-aligned iova for buffer views
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20105>
2022-12-14 16:19:47 +00:00
Connor Abbott
3ca90405e8 freedreno/a6xx: Document buffer-specific tex const fields
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20105>
2022-12-14 16:19:47 +00:00
Connor Abbott
f94bd1d723 freedreno: Document various preemption-related registers/packets
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20229>
2022-12-14 15:52:22 +00:00
Hans-Kristian Arntzen
34010a50d4 wsi/x11: Rename the present progress objects.
The lock and condition variable isn't just for present_id anymore,
it's also for normal forward progress.

Adds more detailed comments what the variables are supposed to
accomplish.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19990>
2022-12-14 14:20:54 +00:00
Hans-Kristian Arntzen
9e55766f63 wsi/x11: Fix possible deadlock with wait_ready.
With the introduction of locks around the XCB polling mechanism,
a possible deadlock was introduced.

If all 5 images were rapidly acquired and presented before the
FIFO thread had the chance to submit a present,
we would deadlock.

Before the lock however, it was still buggy since the two threads would
race to poll events and update internal state.

The fix is to just ensure that there are pending presentation requests
in flight, so that forward progress is guaranteed before we take the
poll lock.

Also, use a timedlock for acquire next image.

Similar as WaitForPresentKHR.
Also need to make the busy flag atomic to actually allow acquire thread
and present threads to access the busy flag.
Take advantage of busy flag being atomic so that we can gracefully handle
timeout == 0 scenarios where there actually are images available.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Fixes: 8fc7927787 ("wsi/x11: Implement VK_KHR_present_wait on X11.)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19990>
2022-12-14 14:20:54 +00:00
Timur Kristóf
657d1be153 radv: Don't lower subgroup shuffle on GFX11.
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/20293>
2022-12-14 13:54:04 +00:00
Timur Kristóf
db5c3f170f aco: Emulate Wave64 bpermute on GFX11.
Similar to emit_gfx10_wave64_bpermute, but uses the new
v_permlane64_b32 instruction to swap data between wave halves.

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/20293>
2022-12-14 13:54:04 +00:00
Timur Kristóf
853e76f007 aco: Stylistic changes to emit_gfx10_wave64_bpermute.
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/20293>
2022-12-14 13:54:04 +00:00
Timur Kristóf
640e801651 aco: Split opcodes for GFX6 and GFX10 emulated bpermute.
Different sequences are emitted for these, so it makes sense to
have different opcodes too.

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/20293>
2022-12-14 13:54:04 +00:00
Timur Kristóf
614348f28b aco: Don't accept constants on p_bpermute.
The sequence emitted for this pseudo instruction is not ready
to handle constants or literals at all.

Cc: mesa-stable
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/20293>
2022-12-14 13:54:04 +00:00
Martin Roukala (né Peres)
27b70f28d9 ci/venus: add a VKCTS mapping test to the flakes list
Seen on https://gitlab.freedesktop.org/mesa/mesa/-/jobs/33483156.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20312>
2022-12-14 13:36:38 +00:00
Kenneth Graunke
16a7e15d4f iris: Enable compression for image load/store in more cases
We were calling iris_resource_texture_aux_usage here, which disables
auxiliary support if color happens to already be resolved.  This makes
sense for read only images, where if we know ahead of time that aux
doesn't contain any useful information, we can just tell the hardware
to not bother looking at it.  However, it makes no sense for mutable
images, as even if the aux currently has no useful data, we want to
produce that data when doing our image writes.

Import the bits of logic we need from there and shed the rest.  We don't
need to consider HiZ, MCS, or MC, nor do we need to do format-based
CCS compatibility checks on Gfx12+, so it's actually very little code.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19060>
2022-12-14 13:01:27 +00:00
Kenneth Graunke
bf3d6ca94f iris: Allow fast clears on compressed image load/store access
While I haven't found documentation saying definitively that HDC
supports fast clear blocks, it seems to work just fine, even on
Tigerlake.  I have found several issues (atomics and HDC support
for linear compression) that both call out fast clears as an issue
in those corner cases, which suggests that fast clears do actually
work outside of those corners (which we already disable).

The previous commit implemented actual aux state updates for image
views.  With ISL_AUX_USAGE_GFX12_CCS_E, this means that we update
the aux state to COMPRESSED_CLEAR after writes.  But because we
weren't supporting fast clears, this meant that any such images
would need partial resolves to remove the clear color on next use.
Supporting fast clears allows us to drop all these resolves.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19060>
2022-12-14 13:01:27 +00:00
Kenneth Graunke
7b2a690a35 iris: Update aux state tracking for image views after draws/dispatches
On Tigerlake and later, we enable compression for image views.  However,
we never actually added any code to update the aux state, which meant
that if it ever changed, things would break, badly.

We managed to avoid catastrophic effects in most cases because of
two other issues which papered over the problem: if compression wasn't
already enabled for an image, we'd leave it disabled.  And, we avoided
writing via the CPU to buffers with auxiliary.  So in most cases, CCS
remained disabled, or got enabled (say by glTexImage()) then stayed on
permanently.  There were still issues, but they managed to remain more
hidden than one would expect given the severity of the bug.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19060>
2022-12-14 13:01:27 +00:00
Kenneth Graunke
a9652fe588 iris: Drop disable_rb_aux_buffer handling for image views
The goal here is to support OpenGL 4.6 section 9.3, "Feedback Loops
Between Textures and the Framebuffer" (from GL_ARB_texture_barrier)
where you can bind an image as both a framebuffer attachment and a
texture, and simultaneously sample-from and render-to it.

I'm not aware of any spec language that requires us to handle
simultaneously accessing something as a framebuffer attachment and an
image load/store resource.  GL_ARB_shader_image_load_store tends to
make flushing and synchronization something the app has to handle
explicitly rather than something the driver needs to do implicitly.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19060>
2022-12-14 13:01:27 +00:00
Kenneth Graunke
806082e96f iris: Drop 'isl_' prefix from 'formats_are_fast_clear_compatible'
Every time I see this function I think it's part of isl.  But it's not,
it's just a static function in an iris file.  The point of the name was
that the function checks two isl_format enums...but the prefix is just
confusing.  Just drop the prefix as it's a static function.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19060>
2022-12-14 13:01:27 +00:00
Kenneth Graunke
880fab60a7 iris: Pin the clear color BO in use_image()
Images with the RC_CCS modifier store the clear color in a separate BO,
which we also need to pin when using an image view.

Most images store the clear color in the same BO so it works anyway.

Thanks to Nanley Chery for catching this!

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19060>
2022-12-14 13:01:27 +00:00
Kenneth Graunke
699e60681a iris: Drop batch parameter from iris_update_postdraw_resolve_tracking
Eventually the resolve code started making everything take ice instead
of batch, and at some point this ceased to be used.  It's always render.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19060>
2022-12-14 13:01:27 +00:00
Emma Anholt
9dedbf66f6 zink: Fix reversed cap declarations for ImageBuffer
Fixes validation fails on
KHR-GLES31.core.texture_buffer.texture_buffer_texture_buffer_range.

Fixes: f55a4407ef ("zink: more accurately set {Sampled,Image}Buffer caps")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20308>
2022-12-14 12:23:58 +00:00
Martin Roukala (né Peres)
bedb9b73db radv/ci: bump most jobs to the kernel to 6.1 + latest firmwares
Unfortunately, not all jobs can be using Linux 6.1 right now, as
NAVI10 hits __vm_enough_memory errors then hangs in VKCTS. So for
this job, we will keep Linux 5.17 until this gets fixed.

Reference: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7888
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16835>
2022-12-14 10:20:11 +00:00
Marcin Ślusarz
264a0cabd1 anv: assert when number of primitives is higher than max
Such cases can lead to memory corruptions.

Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20279>
2022-12-14 09:55:11 +00:00
Marcin Ślusarz
d7a1916798 anv: handle mesh shaders with max primitives == 0
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20279>
2022-12-14 09:55:10 +00:00
Samuel Pitoiset
c26a053f2b radv: disable more NIR opts in radv_postprocess_nir() with DISABLE_OPTIMIZATIONS
To make fast-linking with GPL hopefully a bit faster.

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/20244>
2022-12-14 09:01:31 +00:00
Samuel Pitoiset
05d2ed7350 radv: move a conditional check to radv_remove_color_exports()
Better to have all restrictions inside the function.

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/20244>
2022-12-14 09:01:31 +00:00
Samuel Pitoiset
a43482e8d6 radv: advertise VK_AMD_shader_early_and_late_fragment_tests
Pass all dEQP-VK.*early_and_late* tests on GFX10.3.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19738>
2022-12-14 08:16:27 +00:00
Samuel Pitoiset
3ff58049b5 radv: implement AMD_shader_early_and_late_fragment_tests
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19738>
2022-12-14 08:16:27 +00:00
Samuel Pitoiset
877c10efd1 spirv: add support for AMD_shader_early_and_late_fragment_tests
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19738>
2022-12-14 08:16:27 +00:00
David Wu
ac8131b564 radeonsi/vcn: add support for 10bit input and enc 8bit output
This change is to support 10bit YUV input in addition to
original H264/HEVC 8bit output case. It adds
rvcn_enc_input_format_t and rvcn_enc_output_format_t for
picture input format and output format separately.

Signed-off-by: David (Ming Qiang) Wu <David.Wu3@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20284>
2022-12-14 07:42:28 +00:00
Ian Romanick
eb76cee9f8 nir: Eliminate nir_op_i2b
There are a lot of optimizations in opt_algebraic that match ('ine', a,
0), but there are almost none that match i2b.  Instead of adding a huge
pile of additional patterns (including variations that include both ine
and i2b), always lower i2b to a != 0.

At this point in the series, it should be impossible for anything to
generate i2b, so there /should not/ be any changes.

The failing test on d3d12 is a pre-existing bug that is triggered by
this change.  I talked to Jesse about it, and, after some analysis, he
suggested just adding it to the list of known failures.

v2: Don't rematerialize i2b instructions in dxil_nir_lower_x2b.

v3: Don't rematerialize i2b instructions in zink_nir_algebraic.py.

v4: Fix zink-on-TGL CI failures by calling nir_opt_algebraic after
nir_lower_doubles makes progress.  The latter can generate b2i
instructions, but nir_lower_int64 can't handle them (anymore).

v5: Add back most of the hunk at line 2125 of nir_opt_algebraic.py. I
had accidentally removed the f2b(bf2(x)) optimization.

v6: Just eliminate the i2b instruction.

v7: Remove missed i2b32 in midgard_compile.c. Remove (now unused)
emit_alu_i2orf2_b1 function from sfn_instr_alu.cpp. Previously this
function was still used. 🤷

No shader-db changes on any Intel platform.

All Intel platforms had similar results. (Ice Lake shown)
Instructions in all programs: 141165875 -> 141165873 (-0.0%)
Instructions helped: 2

Cycles in all programs: 9098956382 -> 9098956350 (-0.0%)
Cycles helped: 2

The two Vulkan shaders are helped because of the "new" (('b2i32',
('ine', ('ubfe', a, b, 1), 0)), ('ubfe', a, b, 1)) algebraic pattern.

Acked-by: Jesse Natalie <jenatali@microsoft.com> [earlier version]
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Daniel Schürmann <daniel@schuermann.dev> [earlier version]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15121>
2022-12-14 06:23:21 +00:00
Ian Romanick
8b37046765 nir/builder: Handle i2b conversions specially in nir_type_convert
The shaders affected here are ones that were previously affected when
i2b was unconditionally lowered in opt_algebraic. There are a few places
where some transformations happen in a different order, so some
algebraic patterns are missed.

All Broadwell and newer Intel platforms had similar results. (Ice Lake shown)
total instructions in shared programs: 19914369 -> 19914566 (<.01%)
instructions in affected programs: 92375 -> 92572 (0.21%)
helped: 0 / HURT: 90

total cycles in shared programs: 853851470 -> 853867215 (<.01%)
cycles in affected programs: 12400663 -> 12416408 (0.13%)
helped: 28 / HURT: 69

Haswell and Ivy Bridge had similar results. (Haswell shown)
total instructions in shared programs: 16710721 -> 16710700 (<.01%)
instructions in affected programs: 108010 -> 107989 (-0.02%)
helped: 57 / HURT: 103

total cycles in shared programs: 884299412 -> 884306546 (<.01%)
cycles in affected programs: 12986423 -> 12993557 (0.05%)
helped: 87 / HURT: 102

total spills in shared programs: 14937 -> 14925 (-0.08%)
spills in affected programs: 12 -> 0
helped: 9 / HURT: 0

total fills in shared programs: 17569 -> 17557 (-0.07%)
fills in affected programs: 12 -> 0
helped: 9 / HURT: 0

Sandy Bridge
total instructions in shared programs: 13902341 -> 13902347 (<.01%)
instructions in affected programs: 7311 -> 7317 (0.08%)
helped: 3 / HURT: 8

total cycles in shared programs: 741795500 -> 741792266 (<.01%)
cycles in affected programs: 273308 -> 270074 (-1.18%)
helped: 9 / HURT: 2

No shader-db changes on any other Intel platform.

No fossil-db changes on any Intel platform.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15121>
2022-12-14 06:23:21 +00:00
Ian Romanick
edae161d98 intel/fs: Use nir_type_convert instead of nir_type_conversion_op
In a future commit, nit_type_conversion_op won't be able to handle i2b
(and in a much later commit f2b), so switch many users to the fully
featured function.

No shader-db or fossil-db changes on any Intel platform.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15121>
2022-12-14 06:23:21 +00:00
Ian Romanick
e34b8866b4 microsoft/compiler: Use nir_type_convert instead of nir_type_conversion_op
In a future commit, nit_type_conversion_op won't be able to handle i2b
(and in a much later commit f2b), so switch many users to the fully
featured function.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15121>
2022-12-14 06:23:21 +00:00
Ian Romanick
58164794f4 spirv: Use nir_type_convert instead of nir_type_conversion_op
In a future commit, nit_type_conversion_op won't be able to handle i2b
(and in a much later commit f2b), so switch many users to the fully
featured function.

No shader-db or fossil-db changes on any Intel platform.

v2: Use the actual bit size of the source to determine the conversion
op.  With mediump, the "planned" bit size and the actual bit size might
be different.  Fixes many, many Vulkan CTS assertion failures on any
platform that sets mediump_16bit_alu (e.g., Freedreno).

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15121>
2022-12-14 06:23:21 +00:00
Ian Romanick
ded3572947 nir: Use nir_type_convert instead of nir_type_conversion_op
In a future commit, nit_type_conversion_op won't be able to handle i2b
(and in a much later commit f2b), so switch many users to the fully
featured function.

No shader-db or fossil-db changes on any Intel platform.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15121>
2022-12-14 06:23:21 +00:00
Ian Romanick
1197030727 glsl: Use nir_type_convert instead of nir_type_conversion_op
In a future commit, nit_type_conversion_op won't be able to handle i2b
(and in a much later commit f2b), so switch many users to the fully
featured function.

In gl_nir_lower_packed_varyings, all of the type conversions are between
int32 and uint32 types.  In NIR, those are just moves, so elide them.

No shader-db or fossil-db changes on any Intel platform.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15121>
2022-12-14 06:23:21 +00:00
Ian Romanick
9f86d18b2d nir/builder: Add rounding mode parameter to nir_type_convert
Later changes will use this.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15121>
2022-12-14 06:23:21 +00:00
Ian Romanick
43da822312 glsl_to_nir: Fix NIR bit-size of ir_triop_bitfield_extract and ir_quadop_bitfield_insert
Previously these would return result->bit_size of 32 even though the
type might have been int16_t or uint16_t.  This prevents many assertion
failures in "glsl: Use nir_type_convert instead of
nir_type_conversion_op" on zink.

Fixes: 5e922fbc16 ("glsl_to_nir: fix bitfield_extract with 16-bit operands")
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15121>
2022-12-14 06:23:21 +00:00
Ian Romanick
1fae751d49 microsoft/compiler: Simplify nir_intrinsic_load_front_face handling
It is invalid to have Boolean variables as either shader inputs or
outputs, so there is no point to try to lower them in general.  The only
use for this was some two-phase lowering of
nir_intrinsic_load_front_face that could be done in a single phase.
Create the SYSTEM_VALUE_FRONT_FACE as a uint and compare it with zero at
the same time.

No shader-db or fossil-db changes on any Intel platform.

v2: Remove dxil_nir_lower_bool_input from dxil_nir.h and drop it from
the other caller in the spirv_to_dxil codepath.  Noticed by Jesse.  Fix
setting bit size when loading SYSTEM_VALUE_FRONT_FACE.  Caught by CI.

v3: Use nir_ine_imm.  Change type of gl_FrontFacing GS output in
d3d12_nir_passes from Boolean to integer.  Both suggested by Jesse.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15121>
2022-12-14 06:23:21 +00:00
Ian Romanick
9342c14eeb nir/builder: Emit x != 0 for nir_i2b
There are a lot of optimizations in opt_algebraic that match ('ine', a,
0), but there are almost none that match i2b.  Instead of adding a huge
pile of additional patterns (including variation that include both ine
and i2b), just emit a != 0 instead of i2b(a).

I think that the changes to the unit tests weaken them slightly, but
perhaps that's okay?

No shader-db changes on any Intel platform.  The GLSL paths use other
means to generate i2b operations, but the SPIR-V paths use nir_i2b.
Presumably since 4676b3d3dd (nir: Use nir_test_mask instead of
i2b(iand)), no fossil-db changes either.

v2: Use nir_ine_imm.  Suggested by Jesse.

Acked-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15121>
2022-12-14 06:23:21 +00:00
Ian Romanick
7a5e9df39d nir: Use nir_i2b wrapper everywhere instead of using nir_i2b1 directly
No shader-db or fossil-db changes on any Intel platform.

v2: Add missed i2b1 in ir3_nir_opt_preamble.c.

v3: Add missed i2b1 in ac_nir_lower_ngg.c.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15121>
2022-12-14 06:23:21 +00:00
Ian Romanick
b60b2f2add nir/algebraic: Optimize some b2i involved in masking operations
v2: Remove the ineg from the b2i in the ior pattern.  Suggested by
Jason.

All Ivy Bridge and newer Intel platforms had similar results. (Ice Lake shown)
total instructions in shared programs: 19914441 -> 19914369 (<.01%)
instructions in affected programs: 63507 -> 63435 (-0.11%)
helped: 24 / HURT: 0

total cycles in shared programs: 853869766 -> 853851470 (<.01%)
cycles in affected programs: 10551542 -> 10533246 (-0.17%)
helped: 24 / HURT: 0

All Intel platforms had similar results. (Ice Lake shown)
Instructions in all programs: 141163061 -> 141092683 (-0.0%)
Instructions helped: 14103
Instructions hurt: 55

Cycles in all programs: 9132376195 -> 9133183045 (+0.0%)
Cycles helped: 13775
Cycles hurt: 380

Spills in all programs: 18286 -> 18284 (-0.0%)
Spills helped: 1

Fills in all programs: 30647 -> 30643 (-0.0%)
Fills helped: 1

Gained: 133
Lost: 130

Acked-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15121>
2022-12-14 06:23:21 +00:00
Ian Romanick
ba0b248ac2 nir/algebraic: Eliminate unary op on src of integer comparison w/ zero
This helps because it enables cmod propagation to do more.

The removed patterns involving b2i will be handled by other existing
patterns after the unary operations are removed.

All Intel platforms had similar results. (Ice Lake shown)
total instructions in shared programs: 19914458 -> 19914441 (<.01%)
instructions in affected programs: 5456 -> 5439 (-0.31%)
helped: 17 / HURT: 0

total cycles in shared programs: 855302118 -> 853869766 (-0.17%)
cycles in affected programs: 327354347 -> 325921995 (-0.44%)
helped: 291 / HURT: 81

All Intel platforms had similar results. (Ice Lake shown)
Instructions in all programs: 141205979 -> 141205961 (-0.0%)
Instructions helped: 4
Instructions hurt: 3

SENDs in all programs: 7466919 -> 7466913 (-0.0%)
SENDs helped: 1

Cycles in all programs: 9133387327 -> 9133384475 (-0.0%)
Cycles helped: 3
Cycles hurt: 12

In the shader that was helped for sends, it appears that a NIR pass that
moves code out of loops was able to move 3 send operations outside a
loop after this change.  I did not investigate further.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15121>
2022-12-14 06:23:20 +00:00
Ian Romanick
ee15d89322 nir/algebraic: Simplify min and max of b2i
This prevents ~400 shader-db regresssions and a handful of fossil-db
regressions after i2b is always lowered.

All Ivy Bridge and newer Intel platforms had similar results. (Ice Lake shown)
total cycles in shared programs: 855301494 -> 855302118 (<.01%)
cycles in affected programs: 52787 -> 53411 (1.18%)
helped: 4 / HURT: 5

All Intel platforms had similar results. (Ice Lake shown)
Instructions in all programs: 141206055 -> 141205979 (-0.0%)
Instructions helped: 14

Cycles in all programs: 9133376616 -> 9133387327 (+0.0%)
Cycles helped: 13
Cycles hurt: 3

Acked-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15121>
2022-12-14 06:23:20 +00:00
Ian Romanick
19222867e4 nir/algebraic: Reassociate some iand to eliminate an operation
No shader-db changes on any Intel platform.

All of the helped shaders were presumably regressed by 4676b3d3dd (nir:
Use nir_test_mask instead of i2b(iand)).

v2: Add some comments explaining why specific replacements are used.  In
the umin pattern, only markup the first usage of 'b' in the source
pattern.

Tiger Lake, Ice Lake, and Skylake had similar results. (Ice Lake shown)
Instructions in all programs: 141384970 -> 141200966 (-0.1%)
Instructions helped: 45842

Cycles in all programs: 9133648977 -> 9133282672 (-0.0%)
Cycles helped: 26812
Cycles hurt: 6025

Gained: 23
Lost: 135

Acked-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15121>
2022-12-14 06:23:20 +00:00
Ian Romanick
d48ce1f47d nir/algebraic: Remove redundant i2b(b2i(x)) patterns
A loop below already adds all the permutations... including the 1-bit
version that isn't included in this group.

No shader-db or fossil-db changes on any Intel platform.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Tested-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15121>
2022-12-14 06:23:20 +00:00
Ian Romanick
14a9bb04e4 nir/algebraic: Remove redundant i2b(-x) pattern
The exact same pattern appears later (around line 1323).

No shader-db or fossil-db changes on any Intel platform.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Tested-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15121>
2022-12-14 06:23:20 +00:00
Ian Romanick
8d90b13954 nir/algebraic: Catch some kinds of copy-and-paste bugs in algebraic patterns
A later commit adds a pattern

   (('umin', ('iand', a, '#b(is_pos_power_of_two)'),
             ('iand', c, '#b(is_pos_power_of_two)')),
    ('iand', ('iand', a, b), ('iand', c, b))),

When I originally made that pattern, I copied and pasted the search to
the replacement as

  (('umin', ('iand', a, '#b(is_pos_power_of_two)'),
            ('iand', c, '#b(is_pos_power_of_two)')),
   ('iand', ('iand', a, '#b(is_pos_power_of_two)'),
            ('iand', c, '#b(is_pos_power_of_two)'))),

The caused the variables in the replacement to be marked is_constant,
and that resulted in an assertion failure deep inside nir_search.

    src/compiler/nir/nir_search.c:530: construct_value: Assertion `!var->is_constant' failed.

These extra validation rules catch this kind of error at compile time
rather than at run time.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Tested-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15121>
2022-12-14 06:23:20 +00:00
Yonggang Luo
fa02fb5cca gallium/pp: typedef and use pp_st_invalidate_state_func to avoid cast
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20042>
2022-12-14 05:47:52 +00:00
Yonggang Luo
a23488d63e gallium/hud: typedef and use hud_st_invalidate_state_func to avoid cast
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20042>
2022-12-14 05:47:52 +00:00
Nanley Chery
e4e4ba2304 intel: Allow CCS_E on R11G11B10_FLOAT for TGL+
We now support blorp_copy with this format.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19937>
2022-12-14 03:05:24 +00:00
Nanley Chery
e862626031 intel/isl: Bump format_info entries from 100 to 110
The new format support is only tested on Ice Lake and onward. Makes the
next patch clearer.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19937>
2022-12-14 03:05:24 +00:00
Nanley Chery
2b2141d193 intel/isl: Lessen CCS_E-compatibility checks for TGL+
Tiger Lake and onward allow drivers to specify a compression format
independently from the surface format. So, even if the surface format
changes, hardware is still able to determine how to access the CCS.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19937>
2022-12-14 03:05:24 +00:00
Nanley Chery
2add57d0c2 intel: Hook up RENDER_SURFACE_STATE::DecompressInL3
The sampler's decompressor seems to lack support for some types of
format re-interpretation. Use the more capable decompressor for these
cases. This will be needed to avoid regressing piglit's
arb_texture_view-rendering-formats in later commits.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19937>
2022-12-14 03:05:24 +00:00
Eric Engestrom
408f1c689c v3dv: skip some invalid tests
Cc: mesa-stable
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20305>
2022-12-14 01:59:00 +00:00
Iago López Galeiras
5f2171625b asahi: unbind samplers and fix sampler_count if state is NULL
When states is NULL, unbind samplers (to avoid dangling pointers) and
set sampler_count to the highest non-null samplers[] entry instead of
setting it to 0.

This is ported from a similar fix in panfrost:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20285

Signed-off-by: Iago López Galeiras <iaguis@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20306>
2022-12-14 00:13:44 +00:00
Konstantin Seurer
687a82d2d3 radv/rt: Handle no-null shader flags
If those flags are set, we can assume that idx is not 0.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20286>
2022-12-13 23:30:28 +00:00
Marek Olšák
a3aea98a2a nir: validate that store_buffer_amd doesn't use a non-trivial writemask
Reviewed-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/19422>
2022-12-13 20:33:05 +00:00
Marek Olšák
afcbccb078 ac/llvm: implement ACCESS_USE_FORMAT_AMD as buffer_load/store_format
Reviewed-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/19422>
2022-12-13 20:33:05 +00:00
Marek Olšák
5307480f4e ac/llvm: unify load_buffer_amd and store_buffer_amd code
Reviewed-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/19422>
2022-12-13 20:33:05 +00:00
Marek Olšák
150c2cec63 nir: add ACCESS_USES_FORMAT_AMD for typed buffer opcodes
Reviewed-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/19422>
2022-12-13 20:33:05 +00:00
Marek Olšák
716ac4a55d nir: replace IS_SWIZZLED flag with ACCESS_IS_SWIZZLED_AMD
Reviewed-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/19422>
2022-12-13 20:33:05 +00:00
Marek Olšák
7998c3bdd3 nir: remove redundant SLC_AMD in favor of ACCESS_STREAM_CACHE_POLICY
ACCESS_STREAM_CACHE_POLICY was added to map to SLC for AMD.

Reviewed-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/19422>
2022-12-13 20:33:05 +00:00
Marek Olšák
c0d69b40bc nir: add nir_texop_sampler_descriptor_amd
We'll use it to query the min/mag filter in the shader.

Reviewed-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/19422>
2022-12-13 20:33:05 +00:00
Lionel Landwerlin
e2dc32d755 anv: move functions around to plan for generated draws
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20295>
2022-12-13 19:22:02 +00:00
Lionel Landwerlin
971e07361a genxml: add gen12/12.5 CS prefetch disable bits
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20295>
2022-12-13 19:22:02 +00:00
Lionel Landwerlin
4a3faab512 anv: move draw command helpers to their own file
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20295>
2022-12-13 19:22:02 +00:00
Lionel Landwerlin
624ac55721 anv: move total_batch_size to anv_batch
We'll want 2 batches :

   * the main one

   * another to contain dispatch commands to generate stuff in the
     main batch

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20295>
2022-12-13 19:22:02 +00:00
Lionel Landwerlin
8d21e29be3 anv: add helper to get current address of a batch
And allow the function to get the very first address in the batch.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20295>
2022-12-13 19:22:02 +00:00
Lionel Landwerlin
c9272e80b1 anv: add a utility function to ensure command buffer space
Ensuring the space is contiguous.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20295>
2022-12-13 19:22:02 +00:00
Lionel Landwerlin
21e32e1f8d anv: document utrace field
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20295>
2022-12-13 19:22:02 +00:00
Jason Ekstrand
c70ef757e6 anv: Use extended parameters on Gen11+
Gen11 added a nifty feature where we have three custom system-generated
values called extended parameters that we can set to any 32-bit values
we want.  These work just like vertex and instance ID and are controlled
in the pipeline by the 3DSTATE_SGVS_2 packet.  They are provided to the
draw call either by extra DWORDs on the end of 3DSTATE_PRIMITIVE or by
storing values to more state registers.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20295>
2022-12-13 19:22:02 +00:00
Jason Ekstrand
2680e32f71 intel/blorp: Emit a dummy 3DSTATE_VF_SGVS_2
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20295>
2022-12-13 19:22:02 +00:00
Jason Ekstrand
9859413bf4 intel/genxml: Add 3DPRIMITIVE_EXTENDED opcodes on Gen11+
On Gen11 and above, the 3DPRIMITIVE command takes an optional additional
three DWORDs of data as "extended parameters".  These extended
parameters only exist in the packet if "Extended Parameters Present" is
set.  Because our packing code doesn't handle variable-length commands
well, this commit adds a second version of the command which isn't real
but is just a copy of 3DPRIMITIVE with the additional dwords where the
"Extended Parameters Present" defaults to true and "DWord Length" is
adjusted by 3 as needed.  The 3DPRIMITIVE command is then the gen4-9
version which still works fine but doesn't have the new parameters.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20295>
2022-12-13 19:22:02 +00:00
Jason Ekstrand
781a16382d intel/genxml: Make some fields Booleans
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20295>
2022-12-13 19:22:02 +00:00
Lionel Landwerlin
75d20a18f5 anv/utrace: only record the emitted pipecontrol flags
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20295>
2022-12-13 19:22:02 +00:00
Lionel Landwerlin
5fd0d27280 intel/ds: trace a couple of more pipe control flags
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20295>
2022-12-13 19:22:02 +00:00
Marek Olšák
eea416d0c9 cso: fix a regression from draw_vbo rework
Fixes: c9b13a9338 - cso: remove cso_draw_vbo from all draws, call the driver or u_vbuf directly

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20288>
2022-12-13 18:41:26 +00:00
Aleksey Komarov
d51fc12af9 panfrost: fix sampler_count and unbind samplers in bind_sampler_states
1. Old approach did not support unbind (set to NULL) samplers because
it only copied memory if sampler is not empty. New approach checks
if sampler is empty - it will set NULL.

2. Old approach just set sampler_count to 0 if sampler is empty.
That's wrong and we need to find highest non-null samplers[] entry.
It was done in new approach.

3. Gallium dosc says:
```
NOTE: at this time, start is always zero ...
This may change in the future.
```
It's better to take into consideration start parameter in new approach.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20285>
2022-12-13 18:28:21 +00:00
Lionel Landwerlin
a921486e2a anv: disable Wa_1806565034 when robustImageAccess is enabled
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5711
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7859
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20280>
2022-12-13 18:05:19 +00:00
Lionel Landwerlin
94bb4a13fa intel/fs: make Wa_1806565034 conditional to non robust access
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20280>
2022-12-13 18:05:19 +00:00
Lionel Landwerlin
89a550a37b isl: make Wa_1806565034 conditional to non robust access
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20280>
2022-12-13 18:05:19 +00:00
Sathishkumar S
6a3179c5a9 frontends/va: fix crash during grayscale rendering
crash is observed as format is assumed to be yuv and buffer plane
order is undefined for monochrome. luma only format is not to be
considered yuv format. It has to be rendered with rgb=rrr.

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20165>
2022-12-13 15:37:18 +00:00
Sathishkumar S
7ad4a5079e radeonsi/vcn: fix regression in yuv422 jpeg decode
- yuv422 decode was blocked in 12acee17fa, enable it back.
- nv12 yuv422 and grayscale decode is supported on all versions.
- JPEG2 and higher versions supports 444p decode.
- add l8_unorm to supported formats, can be used for grayscale.

Fixes: 12acee17fa (frontends/va: reallocate surface for yuv400/yuv444 picture)

v2: indent the switch case correctly (Thong Thai)

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20165>
2022-12-13 15:37:18 +00:00
Samuel Pitoiset
b4f940913d radv: do not remove the PointSize built-in for polygon mode as points
Determine if it can be removed when generating the graphics pipeline
key because of dynamic states.

Fixes new CTS dEQP-VK.rasterization.polygon_as_large_points.* and also
spec@!opengl 1.1@polygon-offset with Zink/RADV.

Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20073>
2022-12-13 15:01:31 +00:00
Marcin Ślusarz
75375233f6 intel/compiler/mesh: extract emit_urb_direct_vec4_write
No functional changes.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20292>
2022-12-13 13:00:49 +00:00
Marcin Ślusarz
3a60112ce5 intel/compiler: optimize away local_inv_index and local_inv_id if workgroup size is 1
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20292>
2022-12-13 13:00:49 +00:00
Marcin Ślusarz
85b1c89e20 intel/compiler: split lower_cs_intrinsics_convert_block
No functional changes.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20292>
2022-12-13 13:00:48 +00:00
Marcin Ślusarz
bb93f1bda1 intel/compiler/mesh: extract shared code for offset adjustment
No functional changes.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20292>
2022-12-13 13:00:48 +00:00
Marcin Ślusarz
5ffdd47a26 anv: simplify EXT_mesh_shader lowering
No functional changes.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20292>
2022-12-13 13:00:48 +00:00
Marcin Ślusarz
7fbd1dfb18 anv,intel/compiler/mesh: drop lowering of gl_Primitive*IndicesEXT
Until U888X index format lands this change shouldn't have any impact on performance.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20292>
2022-12-13 13:00:48 +00:00
车扬
f6929e7c3b intel: fix the wrong function name
pipe not create_vertex_elements fuction

Signed-off-by: cheyang <cheyang@bytedance.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20291>
2022-12-13 11:43:17 +00:00
Lionel Landwerlin
a0991c7c79 anv: fixup descriptor copies
I did not properly understood that we cannot access the views written
to the descriptor sets because they might have been destroyed after
the write operation and the copy operation is allowed to copy what is
invalid data. The shader just can't access it.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 03e1e19246 ("anv: Refactor descriptor copy")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20222>
2022-12-13 09:13:05 +00:00
Gert Wollny
79cb465526 r600: Lower all bitfield ops on pre-EG
Fixes:  4dff3ff005
    nir/opt_algebraic: Optimize open coded bfm.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20283>
2022-12-13 09:04:53 +00:00
Gert Wollny
357e5fac99 r600/sfn: Use variable length DOT on Evergreen and Cayman
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20283>
2022-12-13 09:04:53 +00:00
Gert Wollny
573448f93c r600/sfn: prepare alu split for use of variable length dot
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20283>
2022-12-13 09:04:53 +00:00
Gert Wollny
edabd5cd84 r600/sfn: check used channels when evaluating allowed mask
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7878

v2: Fix ws in comment (iorn10)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20283>
2022-12-13 09:04:53 +00:00
Martin Roukala (né Peres)
8c30cf4443 ci/test-vk: uprev vkd3d
This commit uprevs vkd3d, which flags
test_primitive_restart_list_topology_stream_output as being a flake on
RADV / NAVI21.

Suggested-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20278>
2022-12-13 06:48:10 +00:00
Qiang Yu
d2ac1b18df ac/nir: add ac_nir_lower_legacy_gs
For legacy (non-NGG) GS to lower outputs to memory stores and add
shader query when required.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.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/20158>
2022-12-13 11:43:53 +08:00
Qiang Yu
0e52a4faf0 ac/nir: move ngg_gs_shader_query to a common function
To be shared by NGG GS and legacy GS. Legacy GS need this when
GFX10 which mix use NGG and legacy GS. For example when streamout
is enabled, it uses legacy GS, otherwise uses NGG GS. So legacy
GS also need to update query emulation which is a sum of NGG and
legacy GS results.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.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/20158>
2022-12-13 11:43:49 +08:00
Qiang Yu
9a6416b374 nir,ac/llvm,radv: add stream id index to nir_load_ring_gsvs_amd
For used by legacy GS to store output to different ring according
to stream id.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.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/20158>
2022-12-13 11:43:45 +08:00
Qiang Yu
0ea589ec69 ac/llvm,radv,radeonsi: pass instruction to intrinsic_load abi
For simple intrinsic which also need other fields to translate
to LLVM like stream_id.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.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/20158>
2022-12-13 11:43:40 +08:00
Qiang Yu
796a150196 nir: add nir_load_ring_gs2vs_offset_amd
Used by legacy GS output lowering.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.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/20158>
2022-12-13 11:42:33 +08:00
Qiang Yu
603e68ba36 ac/nir,radeonsi: replace llvm ngg gs invocation query with nir
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/20156>
2022-12-13 01:26:42 +00:00
Qiang Yu
fd240f759f nir,radv,radeonsi: add nir_atomic_add_gs_invocation_count_amd
For shader query emulation.

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/20156>
2022-12-13 01:26:42 +00:00
Emma Anholt
17c18a492a freedreno/registers: Add some docs for PM4 events.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19733>
2022-12-12 23:29:53 +00:00
Emma Anholt
378f83917c doc/freedreno: Add a bunch of docs of the hardware and drivers.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19733>
2022-12-12 23:29:53 +00:00
Emma Anholt
e284e6ad3c freedreno: Clarify that CACHE_FLUSH is pre-5xx.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19733>
2022-12-12 23:29:53 +00:00
Emma Anholt
5d37f6b16c ci/docs: Always expose the built docs.
When testing my docs changes outside of an MR, there was no way to look at
the result.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19733>
2022-12-12 23:29:53 +00:00
Peng Huang
7642f3b99c intel: Fix crashes for importing drm buffer
image_aspect_to_binding() converts aspect to index by subrracting
VK_IMAGE_ASPECT_MEMORY_PLANE_0_BIT_EXT, however these enum values
are bitfields, not consecutive numbers, so comparing and subtracting
them won't work.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20269>
2022-12-12 23:02:38 +00:00
Iván Briano
68b546ec3d hasvk: pipelineStageCreationFeedbackCount is allowed to be 0
Fixes: 6601e5d6fc ("anv: implement VK_EXT_pipeline_creation_feedback")

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20216>
2022-12-12 22:32:42 +00:00
Jan Palus
8560ce28c2 vdpau: allow building vdpau st with virgl only
Fixes: 6b5aecb195 ("virgl: add support for hardware video acceleration")

Signed-off-by: Jan Palus <jpalus@fastmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20108>
2022-12-12 22:01:27 +00:00
Timothy Arceri
9e9b8dc7f8 glsl: fix function inlining for images
Here we skip replacing parameters with their actual values for
images as glsl_to_nir() expects them to be copied to temps first.
Tree grafting has a similiar rule to avoid this happening also.

Fixes: 8d10a6835f ("glsl: dont create temps for builtin function inputs")

Tested-by: Martin Roukala <martin.roukala@mupuf.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20274>
2022-12-12 21:28:44 +00:00
Bas Nieuwenhuizen
92959061a9 radv: Improved export conflict bug workaround.
Based on f129db911b ("radeonsi/gfx11: use a better workaround for the export conflict bug")
which claims better performance.

I couldn't be bothered to do the refactor to check the sample count with
dynamic sample counts, so this is just conservative there.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20273>
2022-12-12 19:59:13 +00:00
Marek Olšák
3a294ff01f mesa: move the _mesa_set_varying_vp_inputs call to where the state changes
This removes the _mesa_update_vao_state() call from all glDraw* functions
where it was executed unconditionally.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19953>
2022-12-12 19:15:34 +00:00
Marek Olšák
fe1d533553 mesa: move _DrawVAOEnabledAttribs determination into st_update_array
This can just be computed where it's used.

Now the non-glDraw paths like glRasterPos, glBegin/End, and the slow
display list path have to save and restore _VPModeInputFilter, which
is the only field that's different from the glDraw* path.

_VPModeInputFilter is a bitmask of VP inputs that might have to be bound.
The only difference with glBegin/End and the slow display list path is
that they also add VERT_BIT_MAT_ALL to the bitmask, whereas the glDraw* path
doesn't have that.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19953>
2022-12-12 19:15:34 +00:00
Marek Olšák
01ef28f1af mesa: inline _mesa_draw_array_bits & _mesa_draw_current_bits
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19953>
2022-12-12 19:15:34 +00:00
Marek Olšák
a2cda5ba09 mesa: don't AND with VERT_BIT_ALL because it's ~0u
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19953>
2022-12-12 19:15:34 +00:00
Marek Olšák
b1b4f1e185 mesa: simplify VBO state flagging in _mesa_update_vao_state
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19953>
2022-12-12 19:15:34 +00:00
Marek Olšák
b57d56d754 mesa: remove VAO::NewVertexBuffers/Elements, set the dirty flags directly
These intermediate dirty flags are unnecessary now.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19953>
2022-12-12 19:15:34 +00:00
Marek Olšák
0fbd82bdc4 mesa: move calling _mesa_update_vao_derived_arrays into st_update_array
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19953>
2022-12-12 19:15:34 +00:00
Marek Olšák
76a214f390 mesa: remove the NewVAO flag, set directly what we need to set
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19953>
2022-12-12 19:15:34 +00:00
Marek Olšák
ee308fb9ae st/mesa: move st_atom.c contents into st_context.c
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19953>
2022-12-12 19:15:34 +00:00
Marek Olšák
ae2b911217 st/mesa: inline st_validate_state and remove redundant checking in callers
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19953>
2022-12-12 19:15:34 +00:00
Marek Olšák
eb97f624c7 st/mesa: remove the switch from st_validate_state by passing state mask directly
Instead of passing the enum that represents which states should be updated
to st_validate_state, pass the state bitmask to st_validate_state directly.
This removes the switch statement over the enums.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19953>
2022-12-12 19:15:34 +00:00
Marek Olšák
ae8147dd5a st/mesa: remove st_context::dirty, use gl_context::NewDirtyState instead
We stored the same state in 2 different variables, and then we OR'd them.

This changes the st_validate_state logic slightly, but should be identical.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19953>
2022-12-12 19:15:34 +00:00
Marek Olšák
33c3e429fe mesa: remove per_vertex_edgeflags parameter from DrawGalliumVertexState
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19953>
2022-12-12 19:15:34 +00:00
Marek Olšák
a5851ca8b1 mesa: completely rewrite the edge flag state update logic
This removes the edge flag logic from st_validate_state, which was always
executed and added overhead there. Now it's done only when needed.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19953>
2022-12-12 19:15:34 +00:00
Marek Olšák
b6e800af7d mesa: don't call _mesa_set_varying_vp_inputs in set_vertex_processing_mode
It's redundant because it's always called in _mesa_update_draw_vao.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19953>
2022-12-12 19:15:34 +00:00
Marek Olšák
c2557a5652 mesa: don't call _mesa_update_vao_derived_arrays for dynamic VAOs
This just moves the exit into the caller. There is nothing else in
_mesa_update_vao_derived_arrays that dynamic VAOs care about.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19953>
2022-12-12 19:15:34 +00:00
Marek Olšák
dcad210d12 mesa: merge 2 switch statements into one in _mesa_get_derived_vao_masks
_mesa_vao_enable_to_vp_inputs has a switch statement and we call it twice.
Let's inline it.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19953>
2022-12-12 19:15:34 +00:00
Marek Olšák
d5187dbc07 mesa: remove derived _EffEnabled* fields and compute them at their only use
We were passing the fields to their only use and used them only once,
so let's just compute them there.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19953>
2022-12-12 19:15:34 +00:00
Marek Olšák
888463b173 mesa: merge _mesa_draw_(user_array,nonzero_divisor)_bits into one helper
preparation for the next change

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19953>
2022-12-12 19:15:34 +00:00
Marek Olšák
e6375f95bb mesa: remove unused inline functions from arrayobj.h
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19953>
2022-12-12 19:15:34 +00:00
Marek Olšák
50a367f8f7 mesa: keep the current VAO also set as _DrawVAO
This removes setting _DrawVAO from all glDraw* functions that draw
primitives because now _DrawVAO is always equal to the current VAO.

glEnd, glRasterPos, and the slow display list path now have to save
_DrawVAO before changing it, and restore it after they are done.

This also removes _EmptyVAO, which becomes unused because we no longer
bind "no VAO" into _DrawVAO.

Rules:
- only glBindVertexArray and non-glDraw* paths should call
  _mesa_set_draw_vao, other places shouldn't
- only draws should call _mesa_update_vao_state, other places shouldn't

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19953>
2022-12-12 19:15:34 +00:00
Marek Olšák
b205d7663b mesa: split _mesa_set_draw_vao into set and update functions
This is the beginning of splitting _mesa_set_draw_vao and moving pieces
of it out of draw functions.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19953>
2022-12-12 19:15:34 +00:00
Friedrich Vock
568fa71ef8 radv: Handle NULL miss shaders
Fixes reflections in DOOM Eternal.

Fixes: 85580faa ("radv: Add ray traversal loop.")
Closes: #6210
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20270>
2022-12-12 18:52:59 +00:00
Friedrich Vock
276236ed6d radv: Change shaderGroupBaseAlignment to RADV_RT_HANDLE_SIZE
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20270>
2022-12-12 18:52:59 +00:00
Konstantin Seurer
5751ae45ec radv: Force non uniform texture sampling with NV Remix
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20243>
2022-12-12 18:18:32 +00:00
Konstantin Seurer
9492b84a68 radv: Add a driconf option to force non uniform texture sampling
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20243>
2022-12-12 18:18:32 +00:00
Konstantin Seurer
7a994d92ff spirv: Add a debug option to force non uniform texture sampling
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/20243>
2022-12-12 18:18:32 +00:00
Konstantin Seurer
cdd68cbafd radv/rt: Hash the pipeline key
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20243>
2022-12-12 18:18:32 +00:00
Konstantin Seurer
48ae92ceea radv/rt: Propagate radv_pipeline_key
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20243>
2022-12-12 18:18:32 +00:00
Konstantin Seurer
7b5ac0ae2a radv/rt: Work around incorrect NOT_DEFERRED handling in Portal RTX
Allows Portal RTX to reach the main menu.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20243>
2022-12-12 18:18:32 +00:00
Connor Abbott
cb3872f2cd tu: Implement VK_EXT_descriptor_buffer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19849>
2022-12-12 17:38:19 +00:00
Connor Abbott
b28899a261 vk/descriptor_set_layout: Add optional destructor
Drivers implementing descriptor buffers will want to allocate and free
descriptors with the layout for embedded samplers, so we need a hook to
allow them to free any GPU buffers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19849>
2022-12-12 17:38:19 +00:00
Connor Abbott
56e4359542 tu: Fall back to ldg for variable-size inline uniform blocks
With descriptor buffers, we have no way to know how big the descriptor
set actually is, so we have no idea how many constants we can safely
push. If we use a UBO then it will still get pushed, because we normally
assume that we can freely access UBOs without any fear of faults due to
the range checking. This does the easiest thing of using raw pointer
loads, although performance will fall off a cliff, because we don't have
many better options.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19849>
2022-12-12 17:38:19 +00:00
Connor Abbott
f4c9e9329c ir3/a6xx: Fix immediate offset stg/ldg path
The immediate offset is in units of bytes, whereas the register offset
is in dwords. We need to compensate for that.

Also, fix an off-by-one when checking the range - the offset field is 13
bits, but the sign bit means we can only represent up to 1 << 12 in
bytes or 1 << 10 in dwords.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19849>
2022-12-12 17:38:19 +00:00
Jesse Natalie
733264bd7c microsoft/compiler: Fix codegen when a loop ends in a jump
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7792
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20255>
2022-12-12 17:18:45 +00:00
Jesse Natalie
16c4c1a549 microsoft/compiler: Handle holes in driver_location when adding sysvals
All of the full runtime+compiler stacks reassign these driver_location
values to compact them and sort between shader stages, but for the
spirv2dxil tool, we leave the original shader's "location" intact. That
means that there can be holes in the driver_location space, and simply
counting how many inputs there are can lead to collisions. So instead
place all sysvals after the last-used driver_location.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7811
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20253>
2022-12-12 16:45:46 +00:00
Corentin Noël
1071d33c37 ci: Bump virglrenderer version
Update virglrenderer to the latest version on time.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20277>
2022-12-12 15:49:08 +00:00
Danylo Piliaiev
0d34df0e6c ir3/freedreno: Find regs for FS inputs when printing info
FS inputs are not directly loaded into regs, but require additional
instruction to do so. So in order to print in which reg the input
is loaded we have to scan the shader for the instruction
which loads the input.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20247>
2022-12-12 15:25:00 +00:00
Mikhail Korolev
c147a35644 radv: fix assertion on gpu hang detection
fixes assert in RADV_DECL_PIPELINE_DOWNCAST when bound pipline is a compute
pipeline

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20276>
2022-12-12 12:55:07 +00:00
Caio Oliveira
e9efd05af5 intel/compiler: Remove leftover declarations of old NIR passes
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19805>
2022-12-12 10:03:04 +00:00
Lionel Landwerlin
6106396825 intel/nir/rt: fixup primitive id
There is a delta index value in the hit structure, we forgot to add it
to the base value.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 0465714790 ("intel/nir/rt: add more helpers for ray queries")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7565
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19346>
2022-12-12 10:16:21 +02:00
Samuel Pitoiset
13f39da71a radv: fix hashing descriptor set layout
Shouldn't have pointers.

Fixes: 19f8d33876 ("radv: Use vk_descriptor_set_layout")
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/20250>
2022-12-12 07:33:21 +00:00
Friedrich Vock
e20564cfdb nir/lower_shader_calls: Remove phis after dead control flow
This potentially gets rid of some more phis without sources.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19960>
2022-12-11 22:13:32 +00:00
Friedrich Vock
a54c2c8289 nir: Do not consider phis with incompatible dests equal
CSE tries to collapse equal instructions, and collapsing two phis with incompatible dests is illegal.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Fixes: 6bdce55c ("nir: Add a basic CSE pass")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19960>
2022-12-11 22:13:32 +00:00
Eric Engestrom
c9c44d63da docs/release-calendar: add 22.3.x dates
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20131>
2022-12-11 22:06:49 +00:00
Emma Anholt
110d550941 zink: Don't set dynamic color attachment state for 0 attachments.
Fixes some validation failures like:

VUID-vkCmdSetColorBlendEquationEXT-attachmentCount-arraylength(ERROR / SPEC): msgNum: -175001922 - Validation Error: [ VUID-vkCmdSetColorBlendEquationEXT-attachmentCount-arraylength ] Object 0: handle = 0xaaaae7632fa0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xf591aebe | vkCmdSetColorBlendEquationEXT: parameter attachmentCount must be greater than 0. The Vulkan spec states: attachmentCount must be greater than 0 (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkCmdSetColorBlendEquationEXT-attachmentCount-arraylength)

However, we still have some around dynamic color attachment state:

    Objects: 1
        [0] 0xaaaafcab4150, type: 6, name: NULL
VUID_Undefined(ERROR / SPEC): msgNum: 2044605652 - Validation Error: [ VUID_Undefined ] Object 0: handle = 0xaaaafcab4150, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x79de34d4 | VkCommandBuffer 0xaaaafcab4150[]: Dynamic color blend enable state not set for this command buffer.
    Objects: 1
        [0] 0xaaaafcab4150, type: 6, name: NULL
VUID_Undefined(ERROR / SPEC): msgNum: 2044605652 - Validation Error: [ VUID_Undefined ] Object 0: handle = 0xaaaafcab4150, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x79de34d4 | VkCommandBuffer 0xaaaafcab4150[]: Dynamic color blend equation state not set for this command buffer.
    Objects: 1
        [0] 0xaaaafcab4150, type: 6, name: NULL
VUID_Undefined(ERROR / SPEC): msgNum: 2044605652 - Validation Error: [ VUID_Undefined ] Object 0: handle = 0xaaaafcab4150, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x79de34d4 | VkCommandBuffer 0xaaaafcab4150[]: Dynamic color write mask state not set for this command buffer.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20186>
2022-12-11 21:05:43 +00:00
Bas Nieuwenhuizen
efa4e9568b radv: Use correct watermark for early loop exit.
The previous check assumed the stack starts at offset=0, which isn't
necessarily true for ray queries.

Note that this didn't cause correctness issues, just made an optimization
not apply. Found when I accidentally made this load-bearing in a
refactor.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20265>
2022-12-11 18:51:29 +00:00
Bas Nieuwenhuizen
f0d6a1a685 radv: Rename stack_base to stack_low_watermark.
Better covers the purpose.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20265>
2022-12-11 18:51:29 +00:00
Gert Wollny
b0a6e0e174 Revert "r600/sfn: Make use of variable length DOT"
This reverts commit fcafe1ffc8.

Variable length DOT products are not supported for pre EG
cards, and the read port evaluation is not correctly
checked, so that scheduling might fail. Revert for now to
fix the issues below and get gack with a better implementation
later.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7876
Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7878

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20268>
2022-12-11 18:10:27 +01:00
Marek Olšák
c9b13a9338 cso: remove cso_draw_vbo from all draws, call the driver or u_vbuf directly
Instead of calling like this:
    st_draw_gallium -> cso_draw_vbo -> driver_draw_vbo

Do it like this:
    st_draw_gallium -> driver_draw_vbo
OR
    st_draw_gallium -> u_vbuf_draw_vbo

It's accomplished by adding a draw_vbo function pointer into cso_context.
The pointer is equal to pipe_context::draw_vbo when needed, so there is
no call overhead from this if cso's draw_vbo callback is indeed equal to
driver_draw_vbo. We just call cso_context_base::draw_vbo to jump into
the driver directly, or u_vbuf if needed.

The cso function with the indirect function call is inlined, so draws
don't actually visit any cso_context function.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20025>
2022-12-11 14:37:27 +00:00
Marek Olšák
85f01982a0 cso: add a base class cso_context_base holding pipe_context*
We'll add more stuff there. The first change is that we need pipe_context*
there.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20025>
2022-12-11 14:37:27 +00:00
Marek Olšák
37e89b41f1 cso: unify cso_draw_vbo and cso_multi_draw
This is going to be inlined.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20025>
2022-12-11 14:37:27 +00:00
Marek Olšák
8b4201d6bd gallium/u_vbuf: change u_vbuf_draw_vbo to accept pipe_context as first param
This makes the parameters equal to pipe_context::draw_vbo.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20025>
2022-12-11 14:37:27 +00:00
Marek Olšák
4a92492a8a gallium: add the u_vbuf pointer into pipe_context
This will allow removing the draw_vbo wrapping in cso_context.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20025>
2022-12-11 14:37:27 +00:00
Alyssa Rosenzweig
a9934a9f64 asahi: Implement occlusion queries
While the hardware supports both counter and boolean occlusion queries, the
programming model is quite different from OpenGL. In AGX (and in Metal),
there is a single "visibility result buffer" associated with the render pass.
Each draw that uses occlusion queries writes into this render pass global
visibility result buffer at a particular index. By contrast, the OpenGL
occlusion query model supposes that each query has independent state that can be
mixed and matched within a render pass. We can't simply allocate backing memory
for a query and write to it from a job. We can't allocate visibility result
buffers for each batch up front and statically assign OpenGL queries to indices,
because the OpenGL query can span multiple batches. Finally we can't use a
global visibility result buffer without introducing additional synchronization,
given that we now support multiple batches in-flight at once.

In this patch, I've elected to use a simple solution: allocate visibility result
buffers and indices on the fly as needed, and accumulate the results on the CPU
at the end of the render pass. When we have proper synchronization we'll want to
revisit this, but as everything is stalling at submit time now, I'm not inclined
to "optimize" something I can't test.

Passes dEQP-GLES3.functional.occlusion_query.* and the relevant piglit tests.
The piglits are considerably more thorough, checking lots of "we hate tilers"
conditions that dEQP skips over.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20123>
2022-12-10 21:55:30 -05:00
Alyssa Rosenzweig
4dabbb761b asahi: Move query functions to agx_query.c
New file. They're just stubs now but will get nontrivial in a moment.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20123>
2022-12-10 21:51:05 -05:00
Alyssa Rosenzweig
7a5f88cb38 asahi: Don't upload samplers for clears/stores
Unlikely to help but makes the traces neater.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20123>
2022-12-10 21:51:05 -05:00
Alyssa Rosenzweig
d2f27d282f asahi: Avoid reloads with staging blits
Noticed by inspection. Not likely to matter unless these staging blits are in a
hot path, but it's an easy win.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20123>
2022-12-10 21:51:05 -05:00
Alyssa Rosenzweig
dc4cf64a76 asahi: Don't reload uninitialized surfaces
Pointless. This should save some bandwidth in some cases (possibly mipmap
generation?)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20123>
2022-12-10 21:51:05 -05:00
Alyssa Rosenzweig
949a760c9f asahi: Fix Z32S8 harder
Fixes dEQP-GLES3.functional.texture.format.sized.2d.depth32f_stencil8_pot after
stencil texturing broke it.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20123>
2022-12-10 21:51:04 -05:00
Alyssa Rosenzweig
0c2500168d asahi: Don't shadow idle resources
Pointless allocation+memcpy.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20123>
2022-12-10 21:51:04 -05:00
Alyssa Rosenzweig
c9144eff48 asahi: Model alignment of occlusion query indices
8-byte offsets.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20123>
2022-12-10 21:51:04 -05:00
Alyssa Rosenzweig
3a318e4265 asahi: Identify some more fields used with layered
These values depend on the framebuffer width/height and maybe other
stuff. Maybe strides.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20123>
2022-12-10 21:51:04 -05:00
Alyssa Rosenzweig
c3eb81fd16 asahi: Identify XML for anisotropic filtering
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20123>
2022-12-10 21:51:04 -05:00
Alyssa Rosenzweig
7f247743a3 asahi: Check-box implement rasterizer discard
Passes dEQP-GLES3.functional.rasterizer_discard.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20123>
2022-12-10 21:51:04 -05:00
Alyssa Rosenzweig
d2a2d1997e asahi: Wire in 1D (array) textures
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20123>
2022-12-10 21:51:04 -05:00
Alyssa Rosenzweig
5612d2cbeb asahi: Dirty track VS/FS key updates
drawoverhead 1 score doubled to 7668.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20123>
2022-12-10 21:51:04 -05:00
Alyssa Rosenzweig
37feaf9c0c asahi: Separate VS/FS shader keys
First remove agx_shader_key from asahi_shader_key. It's trivial. agx_shader_key
is going to go away soon now that we lower everything in NIR.

Then everything else is mutually exclusive between stages. That means much
less to hash. drawoverhead test 1 from 2331 to 3443.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20123>
2022-12-10 21:50:52 -05:00
Alyssa Rosenzweig
720ff76de4 asahi: Implement invalidate_resource
From Panfrost. This lets us avoid storing depth/stencil attachments at the end
of the frame in GLES.

On my 4K monitor, glmark2 -btexture at fullscreen goes from 705fps to 1150fps. I
assume gains on real workloads will be smaller.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20123>
2022-12-10 21:50:46 -05:00
Alyssa Rosenzweig
28b652af80 asahi: Track batch masks on ZS/blend CSO
Adapted from panfrost, with the work happening at CSO create time instead of
draw time allowing us to do more sophisticated analysis. We'll use these for
accurate masks in a moment.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20123>
2022-12-10 21:50:45 -05:00
Alyssa Rosenzweig
33b1876857 asahi: Dirty track blend state
We'll want this to reduce variant lookups eventually.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20123>
2022-12-10 21:50:45 -05:00
Alyssa Rosenzweig
29e6c00e3c asahi: Enable dirty tracking
Whoops. drawoverhead test 1 score from 496 -> 2377.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20123>
2022-12-10 21:50:45 -05:00
Alyssa Rosenzweig
b28fe26d7c ail: Save level_offsets_compressed_B
So we can bind specific mip levels for rendering into compressed Z/S.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20123>
2022-12-10 21:50:45 -05:00
Aleksey Komarov
3895545b83 panfrost: implement clear_depth_stencil
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20238>
2022-12-10 10:56:09 +00:00
David Heidelberg
b19a14a094 nine: enable on panfrost
Also, enable required kmsro dependencies.

Tested-by: Aleksey Komarov <q4arus@ya.ru>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20238>
2022-12-10 10:56:09 +00:00
David Heidelberg
be841f0e78 panfrost: implement clear_render_target
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Co-authored-by: Aleksey Komarov <q4arus@ya.ru>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Aleksey Komarov <q4arus@ya.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20238>
2022-12-10 10:56:09 +00:00
David Heidelberg
8560c7613d panfrost: Handle resources without depth in batch_to_fb_info
Prevent preloading data from resources which doesn't exist.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Aleksey Komarov <q4arus@ya.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20238>
2022-12-10 10:56:09 +00:00
David Heidelberg
d76d791565 panfrost: Implement GL_EXT_clip_control
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Co-authored-by: Aleksey Komarov <q4arus@ya.ru>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Aleksey Komarov <q4arus@ya.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20238>
2022-12-10 10:56:09 +00:00
Paulo Zanoni
a099d6ae4d intel: add devinfo->has_64bit_float_via_math_pipe
Unusual hardware features that require special hanlding usually get a
devinfo field, so do this for MTL's unordered DF types. This will
guarantee that any platform based on MTL (thus inheriting from
MTL_FEATURES) will automatically be handled in these special cases.

v2: s/has_unordered_64bit_float/has_64bit_float_via_math_pipe/ (Curro).

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20072>
2022-12-10 03:59:19 +00:00
Paulo Zanoni
eac00f4ec7 intel/compiler: fix intel_swsb_decode for newer platforms
In the previous patch we adjusted the scoreboard pass to take into
consideration a new case of unordered operations for TGL. Fix the
decoding as well.

v2: use intel_device_info_is_mtl()  (Curro, Jordan)
v3: the part where we export num_sources_from_inst() is now a separate patch
    (Curro).
v4: Work around false positive maybe-unitialized warning since Marge
    uses -Werror=maybe-uninitialized (Marge).

Reviewed-by: Francisco Jerez <currojerez@riseup.net> (v3)
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20072>
2022-12-10 03:59:19 +00:00
Paulo Zanoni
295c5f59e0 intel/compiler: export brw_num_sources_from_inst
We want to call this from brw_disasm.c, so move it out to brw_eu.c
since it's about to become more of a shared utility function than
something specific to the EU validator.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20072>
2022-12-10 03:59:19 +00:00
Paulo Zanoni
df50add27e intel/compiler: avoid 64bit SEL_EXEC on MTL
On MTL, instructions with DF type are unordered, executed in the math
pipe. This means that they require different SWSB dependency handling,
and also that in some cases such as MOVs it's generally faster to
simply use 2 smaller ordered moves than a single unordered MOV.

One problem we have with the current code is that generate_code() is
not setting the proper SWSB dependencies for the generated DF MOVs,
causing some tests to fail.

One solution would be to fix generate_code() by making it set the
appropriate dependencies. This was the first patch I wrote. Another
solution to this problem, pointed to us by Curro, is to change
required_exec_type() so we use UD instructions instead of DF, just
like we do with platforms that don't have 64 bit instructions, which
means there won't be anything to fix in generate_code(). The second
solution is what this patch implements.

This fixes at least:
 - dEQP-VK.subgroups.arithmetic.framebuffer.subgroupmin_double_vertex

Thanks to Francisco Jerez for all the major help provided with this
problem.

Credits-to: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20072>
2022-12-10 03:59:19 +00:00
Paulo Zanoni
951855c349 intel/compiler: avoid (RegDist, SBID) on DF instructions on MTL
When we use this form there's no way to specify which pipe RegDist
refers to, so there are a few rules to figure this out, which is what
inferred_sync_pipe() implements. But for MTL there's no long pipe and
the documentation does not explicitly explain what should be the
inferred type for its long (DF) instructions - which are out-of-order,
by the way.  One way to interpret this is that such case should be
avoided.  So add the extra check to entirely avoid this case.

Notice that this is not actually fixing any bug, since returning
TGL_PIPE_LONG (what we do today) will actually make these DF
instructions incompatible with every in-order instruction, so we'll
never opt to use the (RegDist, SBID) form anyway. But still, it's
better to have this case explicitly documented instead of having it
covered by a semi coincidence.

v2: use intel_device_info_is_mtl()  (Curro, Jordan)

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20072>
2022-12-10 03:59:19 +00:00
Paulo Zanoni
16b9f87104 intel/compiler: on MTL, DF instructions run in the math pipe
Adjust the scoreboard code to take that into account.

Fixes at least:
  - dEQP-VK.glsl.builtin.precision_double.refract.compute.vec3
  - dEQP-VK.glsl.builtin.precision_double.matrixcompmult.compute.mat4

v2: use intel_device_info_is_mtl()  (Curro, Jordan)

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20072>
2022-12-10 03:59:19 +00:00
Francisco Jerez
051887fbf3 intel/fs: Make the result of is_unordered() dependent on devinfo.
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20072>
2022-12-10 03:59:19 +00:00
Lionel Landwerlin
d608706875 Revert "anv: compile anv_acceleration_structure.c"
This reverts commit 74d0be27ae.

Also remove anv_acceleration_structure.c, it was meant to be removed
earlier. There was probably a rebase issue somewhere.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20248>
2022-12-10 01:16:16 +00:00
Chia-I Wu
d217883c5c freedreno/a6xx: fix blend all_mrt_write_mask
Fix all_mrt_write_mask when independent_blend_enable is false.
Otherwise, lrz write is always diabled with MRT when
independent_blend_enable is false.  This fixes a 2% perf regression for
multiple gfxbench benchmarks.

Fixes: 0132c22de7 ("freedreno/a6xx: Don't disable LRZ for invalid channels")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20254>
2022-12-09 22:21:19 +00:00
Kenneth Graunke
bec68a85a2 iris: Improve direct CPU map heuristics
We were promoting reads with a valid primary to direct CPU maps even
if the mmap mode was IRIS_MMAP_WC, which would mean uncached reads from
VRAM.  In that case, GPU blits are in fact useful!

We were also only checking for !DISCARD_RANGE rather than MAP_READ,
which isn't a great idea for image maps, given the discussion in the
previous commit about image map semantics.

The original code was also just confusingly structured.  Make a helper
function with clearly defined cases where we want to bail on CPU maps.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19209>
2022-12-09 21:46:03 +00:00
Kenneth Graunke
eafaac2b1e iris: Only copy existing data into staging images with PIPE_MAP_READ
When performing transfer maps on images that require staging buffers
(say, for presenting a linear view of tiled memory), we were reading
the existing contents of the buffer into the staging resource on map
unless PIPE_MAP_DISCARD_RANGE was set.

The thinking was to support partial writes.  If you map a subrectangle
of an image, but then only write selective pixels - should it preserve
the existing contents of the mapped region?  I believed that it should,
unless you pass PIPE_MAP_DISCARD_RANGE to explicitly say that that it's
okay to invalidate the destination region.

However, that does not appear to be the interpretation favored by other
Mesa developers (in particular Michel Dänzer and Marek Olšák).  The
radeonsi driver does not do this readback from the destination region
to the staging buffer unless you pass PIPE_MAP_READ.  If you want to
do a partial write and preserve contents, you need to pass both flags:
(PIPE_MAP_READ | PIPE_MAP_WRITE).  Passing READ is expected to come
with an associated cost.

OpenGL defines GL_MAP_INVALIDATE_RANGE_BIT for mapping buffer objects,
which is translated to PIPE_MAP_DISCARD_RANGE.  However, unextended
OpenGL doesn't define mapping textures.  There are two main sources of
image maps: our internal MapTextureImage() hook, and gbm_bo_map().

I've audited our internal MapTextureImage() calls, and while some do
pass PIPE_MAP_DISCARD_RANGE, almost all of them wholly overwrite the
mapped region, and those that care about combining with existing image
contents all pass PIPE_MAP_READ.  So this should work there.

GBM defines three flags: GBM_BO_TRANSFER_READ, WRITE, and READ_WRITE.
There is no defined "invalidate range" bit.  In issue #6020, Matthias
Treydte notes that this extra readback can cause performance problems,
and with iris's current interpretation, there's no way to avoid it.
During that discussion, Michel and Matthias both argued that
GBM_BO_TRANSFER_WRITE should invalidate the destination contents and
avoid the readback, while GBM_BO_TRANSFER_READ_WRITE would preserve it.

This patch makes iris follow that model for image mappings, removing
readback on staging maps for both detiling and stall avoidance, unless
PIPE_MAP_READ is passed.  I believe we can change this with impunity.

For buffer objects, Ian Romanick and I both agree that partial writes
should be supported, and GL_MAP_INVALIDATE_RANGE_BIT exists precisely
to indicate that you should spend effort preserving existing contents.
So we continue doing readback for buffers unless PIPE_MAP_DISCARD_RANGE
is flagged, for now.  While I think this is work, it also seems to be
undertested in the CTS and Piglit.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6020
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19209>
2022-12-09 21:46:03 +00:00
Kenneth Graunke
50614d39fe iris: Return idle status from iris_invalidate_buffer, skip busy checks
If we successfully replace the backing storage for a buffer, we know
that it's idle, and the transfer map code can mark it unsynchronized
right away, letting us skip redundant resource_is_busy() checks.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19209>
2022-12-09 21:46:03 +00:00
Kenneth Graunke
f112add554 iris: Don't replace backing storage for exported buffers.
We already gave out the old BO...or acquired it from somewhere which
may be affecting it.  We simply can't replace the backing store.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19209>
2022-12-09 21:46:03 +00:00
Kenneth Graunke
6954a8ddbe iris: Promote DISCARD_RANGE to DISCARD_WHOLE_RESOURCE where possible
This allows us to replace the backing storage for a buffer, which
means we'd have an idle buffer and thus could do an unsynchronized
mapping where we otherwise wouldn't.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19209>
2022-12-09 21:46:03 +00:00
Kenneth Graunke
465eb092ed iris: Use persistent mappings for pinned memory (userptr)
This is a port of Nicolai's b52721e3b6
from radeonsi.  Because GL_AMD_pinned_memory guarantees that mappings
will refer to the same underlying page, we need to avoid using staging
maps.  Using a persistent map is a reasonable way to accomplish this.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19209>
2022-12-09 21:46:03 +00:00
Kenneth Graunke
b82d545442 iris: Delete map->dest_had_defined_contents
Dead since commit 6cc09699cd.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19209>
2022-12-09 21:46:03 +00:00
Rhys Perry
907fbf22dd nir/gather_info: use nir_ssa_scalar_resolved
This lets us skip copies.

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/19597>
2022-12-09 20:56:52 +00:00
Rhys Perry
085828ea4d vtn: add mesh output and task_payload to vtn_mode_is_cross_invocation
This fixes a potential race condition, and removes output loads (which
should not exist in the EXT_mesh_shader).

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/7391
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19597>
2022-12-09 20:56:52 +00:00
Rhys Perry
e1f5100311 nir: add task_payload and shader_out to nir_var_vec_indexable_modes
Since these can be cross-invocation, we need this to write individual
components without race conditions or loads.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7391
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19597>
2022-12-09 20:56:52 +00:00
Rhys Perry
a89755d179 radv: fix task payload lowering when shared_memory_explicit_layout=true
If shared_memory_explicit_layout=true, we would have skipped lowering task
payload variables to explicit types.

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/19597>
2022-12-09 20:56:52 +00:00
Rhys Perry
e4060752e2 radv: fix mesh shaders with null winsys
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/19597>
2022-12-09 20:56:52 +00:00
Rebecca Mckeever
f381187b8f panvk: Delete panvk_CmdSetDeviceMask, panvk_GetDeviceGroupPeerMemoryFeatures
Delete panvk_CmdSetDeviceMask and panvk_GetDeviceGroupPeerMemoryFeatures
so that the vk_common_* version will be used instead. This will avoid
repeated code.

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20218>
2022-12-09 14:08:14 -06:00
Rebecca Mckeever
aa76b70751 hasvk: Delete VK_KHR_device_group provided entrypoints
Delete anv_CmdDispatch, anv_CmdSetDeviceMask, and
anv_GetDeviceGroupPeerMemoryFeatures so that the vk_common_*
versions will be used instead. This will avoid repeated code.

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
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/20218>
2022-12-09 14:07:59 -06:00
Rebecca Mckeever
43f9c66224 anv: Delete VK_KHR_device_group provided entrypoints
Delete anv_CmdDispatch, anv_CmdSetDeviceMask, and
anv_GetDeviceGroupPeerMemoryFeatures so that the vk_common_*
versions will be used instead. This will avoid repeated code.

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
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/20218>
2022-12-09 14:07:48 -06:00
Rebecca Mckeever
159cf9122e tu: Delete VK_KHR_device_group provided entrypoints
Delete tu_CmdDispatch, tu_CmdSetDeviceMask, and
tu_GetDeviceGroupPeerMemoryFeatures so that the vk_common_*
versions will be used instead. This will avoid repeated code.

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20218>
2022-12-09 14:07:33 -06:00
Rebecca Mckeever
6b1e2e9eb6 v3dv: Delete VK_KHR_device_group provided entrypoints
Delete v3dv_CmdDispatch, v3dv_CmdSetDeviceMask, and
v3dv_GetDeviceGroupPeerMemoryFeatures so that the vk_common_*
versions will be used instead. This will avoid repeated code.

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20218>
2022-12-09 14:07:17 -06:00
Rebecca Mckeever
64d7385e61 radv: Delete VK_KHR_device_group provided entrypoints
Delete radv_CmdDispatch, radv_CmdSetDeviceMask, and
radv_GetDeviceGroupPeerMemoryFeatures so that the vk_common_*
versions will be used instead. This will avoid repeated code.

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20218>
2022-12-09 14:07:00 -06:00
Rebecca Mckeever
83400af043 vulkan/runtime: Add VK_KHR_device_group provided entrypoints
Add entrypoints vk_common_CmdDispatch, vk_common_CmdSetDeviceMask,
and vk_common_GetDeviceGroupPeerMemoryFeatures in Mesa Vulkan runtime so
that they are available to all drivers.

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20218>
2022-12-09 14:06:14 -06:00
Thong Thai
2d4a36ce64 gallium: add new variable for video frame statistics
Video encoder previously reuses the associated_data variable to output
encoding statistics, but it ended up breaking when transcoding. This
commit adds a new variable just for statistics.

Fixes: 2d1bd619df ("frontends/va: add ability for encoder to output statistics")
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20190>
2022-12-09 13:37:00 -05:00
Rhys Perry
c872e339a1 radv: remove some unnecessary 64-bit IO handling
nir_lower_io() lowers these to 32-bit.

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/20137>
2022-12-09 17:30:24 +00:00
Rhys Perry
6a5b615ab1 radv: fix streamout with different streams in the same varying slot
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/20137>
2022-12-09 17:30:24 +00:00
Rhys Perry
20e670d060 aco/ra: don't swap create_vector operand with definition blocker for SGPRs
There is no SGPR swap instruction, we always need 3 XORs.

fossil-db (navi21):
Totals from 76 (0.06% of 135636) affected shaders:
Instrs: 58400 -> 58347 (-0.09%); split: -0.10%, +0.01%
CodeSize: 312580 -> 312368 (-0.07%); split: -0.08%, +0.01%
Latency: 843333 -> 843180 (-0.02%); split: -0.02%, +0.00%
InvThroughput: 126431 -> 126412 (-0.02%)
Copies: 4008 -> 3955 (-1.32%); split: -1.47%, +0.15%

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/20240>
2022-12-09 15:58:43 +00:00
Rhys Perry
a05dd58309 aco/ra: don't swap p_create_vector operand with definition blocker for scc
SCC is 1-bit, and we can't copy a 32-bit value into it.

Fixes dEQP-VK.spirv_assembly.type.scalar.i32.iequal_tesse with
ACO_DEBUG=noopt.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 9476986e6f ("aco/ra: special-case get_reg_for_create_vector_copy()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20240>
2022-12-09 15:58:43 +00:00
Georg Lehmann
4dff3ff005 nir/opt_algebraic: Optimize open coded bfm.
Foz-DB Navi21:
Totals from 1553 (1.15% of 134913) affected shaders:
SpillVGPRs: 2246 -> 2223 (-1.02%); split: -1.42%, +0.40%
CodeSize: 10409156 -> 10410720 (+0.02%); split: -0.03%, +0.04%
Instrs: 1899725 -> 1898773 (-0.05%); split: -0.07%, +0.02%
Latency: 71225814 -> 71118314 (-0.15%); split: -0.21%, +0.06%
InvThroughput: 13384926 -> 13330369 (-0.41%); split: -0.47%, +0.06%
VClause: 38309 -> 38284 (-0.07%); split: -0.17%, +0.11%
SClause: 70743 -> 70706 (-0.05%)
Copies: 167296 -> 167230 (-0.04%); split: -0.28%, +0.24%
Branches: 42446 -> 42444 (-0.00%); split: -0.01%, +0.00%
PreVGPRs: 95191 -> 95188 (-0.00%)

Some minor instructions count regressions in parallel-rdp
because v_bfm_b32 can't use SDWA, but overall an improvement.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18887>
2022-12-09 14:59:16 +00:00
Ruijing Dong
a73e86e0a5 frontends/va: fix gst videotestsrc h264 enc fail issue.
problem:
when doing "gst-launch-1.0 -v videotestsrc num-buffer=10 !
   vaapih264enc ! fakeink"

The command will fail due to gst will fetch the first
available supported format in the list, it becomes P010_LE
due to the commit in

[0b02db3007]
frontends/va: fixed av1 decoding 10bit ffmpeg output YUV issue

fix:
move the P010_LE code block to the end of the function, the sequence
of the supported formats restored to its original.

cc: mesa-stable

Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20242>
2022-12-09 09:31:11 -05:00
Yonggang Luo
ee10a5f7a6 frontend/osmesa: inherit pipe_frontend_drawable instead of allocating separately
This is required by st/mesa now.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20027>
2022-12-09 13:14:03 +00:00
Yonggang Luo
5be128f67d frontend/hgl: inherit pipe_frontend_drawable instead of allocating separately
This is required by st/mesa now.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20027>
2022-12-09 13:14:03 +00:00
Marek Olšák
3ba24ad153 gallium: rename st_framebuffer_iface -> pipe_frontend_drawable, etc.
Also rename:
    iface -> drawable
    stfb -> drawable (where it means dri_drawable and not st_framebuffer)
    stfbi -> drawable or pdrawable (if drawable exists)

pipe_frontend_drawable* is really just dri_drawable* for DRI, and WGL/GLX
have their own variants. This makes it easier to understand what kind of
object is being used.

I always wondered what st_framebuffer_iface, iface, stfbi, iface_stamp,
and iface_ID actually mean. Now those terms are gone forever.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20027>
2022-12-09 13:14:03 +00:00
Marek Olšák
279dfeff1d gallium: remove pipe_frontend_screen::destroy callback, call it directly
This is the only one implemented by mesa/state_tracker.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20027>
2022-12-09 13:14:03 +00:00
Marek Olšák
ab7a86a0ee gallium: clean up comments in api.h, cosmetic changes
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20027>
2022-12-09 13:14:03 +00:00
Marek Olšák
e7a1cce4ee gallium: remove st_framebuffer_iface::st_manager_private
It's always equal to self.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20027>
2022-12-09 13:14:03 +00:00
Marek Olšák
4f376f3239 frontend/glx: inherit st_framebuffer_iface instead of allocating separately
All other frontends do it like this. This enables the next cleanup.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20027>
2022-12-09 13:14:03 +00:00
Marek Olšák
e51cb3ae20 gallium: remove unused ST_CONTEXT_ERROR_*
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20027>
2022-12-09 13:14:03 +00:00
Marek Olšák
ab281457aa gallium: rename st_manager_private -> st_screen
Oh you didn't know that st_context had a screen object too?
Yeah, this code is full of surprises.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20027>
2022-12-09 13:14:03 +00:00
Marek Olšák
8543dcb275 gallium: remove st_profile_type in favor of gl_api, move out st_context_attribs
st_context_attribs is moved into st_context.h.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20027>
2022-12-09 13:14:03 +00:00
Marek Olšák
81020faf20 gallium: remove unnecessary ST_PROFILE_*_MASK definitions
This didn't do anything.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20027>
2022-12-09 13:14:03 +00:00
Marek Olšák
9fdb0ce755 gallium: use PIPE_CONTEXT_* flags instead of ST_CONTEXT_FLAG_*
where PIPE_CONTEXT_* flags are available

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20027>
2022-12-09 13:14:03 +00:00
Marek Olšák
0122a67c81 gallium: move st function declarations from api.h into st_context.h
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20027>
2022-12-09 13:14:03 +00:00
Marek Olšák
be8f1d685e gallium: remove enum st_texture_type
just use GLenum

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20027>
2022-12-09 13:14:03 +00:00
Marek Olšák
59c9e62f48 st/mesa: remove st_context callbacks for dri/glx/wgl frontends
Use direct calls.

Other changes:
- kopper called thread_finish twice in the same function.
  Remove the second call.
- Context creation had no-op initializations of cso_context and pipe.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20027>
2022-12-09 13:14:03 +00:00
Marek Olšák
263dc7b605 gallium: remove st_context_iface, use st_context directly
st_context_iface was the base class that st_context inherited.
Just use st_context.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20027>
2022-12-09 13:14:03 +00:00
Marek Olšák
c61aa8fa81 gallium/pp: don't use st_context_iface, use an explicit callback
st_context_iface will be removed.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20027>
2022-12-09 13:14:03 +00:00
Marek Olšák
fdec352903 gallium/hud: don't use st_context_iface, use an explicit callback
st_context_iface will be removed.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20027>
2022-12-09 13:14:03 +00:00
Marek Olšák
64ee8d2430 gallium: rename st_context_iface::st_manager_private to frontend_context
It's really dri_context for DRI.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20027>
2022-12-09 13:14:03 +00:00
Marek Olšák
ec564cf043 gallium: remove duplicated st_context_iface::st_context_private
It's equal to fscreen, which is almost next to it.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20027>
2022-12-09 13:14:03 +00:00
Marek Olšák
cf2d71ec06 gallium: rename st_manager to pipe_frontend_screen (think dri_screen)
st_manager is really the base class of dri_screen, so let's call it
pipe_frontend_screen. That's a much better name than the vague "st_manager".

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20027>
2022-12-09 13:14:03 +00:00
Erik Faye-Lund
597b2648d2 zink: do not leave needless shader temps around
This used to not matter, but since we started emitting shader-temps
properly, this causes issues where we end up with samplers and images as
shader-temps. That causes asserts while emitting them.

So let's remove the unused vars as well.

This fixes a piglit regression that somehow went unnoticed on CI.

Fixes: 85964945e7 ("zink: emit vars with nir_var_shader_temp mode")
Tested-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20227>
2022-12-09 12:47:26 +00:00
Kenneth Graunke
8c2448d4e6 intel/compiler: Delete sampler key handling for planar format stuff
i965 used these, but Gallium drivers do this lowering via a separate
nir_lower_tex call from st/mesa.  Vulkan drivers don't use these at all.

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/20223>
2022-12-09 10:18:25 +00:00
Kenneth Graunke
88918baf5c intel/compiler: Delete key->msaa_16
None of the drivers have used this since we dropped i965, and BLORP
no longer uses it as of the previous commit.  We can also drop the
former compressed_multisample_tex_mask (now padding) field so that
things remain 64-bit aligned.

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/20223>
2022-12-09 10:18:25 +00:00
Kenneth Graunke
5d2a290cc7 intel/blorp: Set key->msaa_16 unconditionally on Gfx9+
This will result in us using the TXF_CMS_W message rather than the
TXF_CMS message on Skylake through Tigerlake for 2/4/8x MSAA blits,
which is technically slightly worse.  However, it shouldn't be that
much worse: the TXF_CMS message was removed altogether on Alchemist.

iris and anv set key->msaa_16 unconditionally, to avoid paying the
cost of shader recompiles for a miniscule gain.  crocus and hasvk
don't need to set it as they don't support 16x MSAA.  BLORP already
recompiles based on the sample count, so it could easily keep doing
this for the minor benefit.  But avoiding it will let us drop the
entire msaa_16 key field out of the compiler, which is nice.

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/20223>
2022-12-09 10:18:25 +00:00
Kenneth Graunke
584e18863e intel: Drop compressed_multisample_layout_mask from the compiler keys
The compiler looks at this key field to determine whether to perform
an MCS fetch for a txf_ms or samples_identical texture message, if a
nir_tex_src_ms_mcs_intel source wasn't provided.  If it isn't set,
it instead uses constant 0 (nothing is compressed).

All of the drivers (iris, crocus, anv, hasvk) unconditionally set this
to ~0 because we don't want to pay for costly shader recompiles (which
can cause nasty stuttering).  Most textures are compressed anyway, and
the hardware ignores the l2dms MCS parameter if MCS is disabled.

The only user was BLORP, which sets the key field based on whether the
texture's aux usage has MCS.  But if it has MCS, it also does the MCS
fetch itself and supplies it directly.  Otherwise, it relies on the
compiler to fill in the 0 value.  But it could easily just provide the
0 value itself in that case and not rely on the compiler at all.

With that fixed, we can just drop the key fields entirely.  We leave
them as padding for now to avoid repacking structures; we won't need
to after the next commits anyway.

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/20223>
2022-12-09 10:18:25 +00:00
Jianxun Zhang
5c62f526a4 intel/common: use format struct in aux mapping
Refactor aux mapping with the new format struct and helpers.

Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20167>
2022-12-09 09:49:42 +00:00
Jianxun Zhang
8ad9549677 intel/common: initialize format of aux mapping on GFX12
Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20167>
2022-12-09 09:49:42 +00:00
Jianxun Zhang
cf3ee73f8f intel/common: fix style of some comments in intel_aux_map.h
Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20167>
2022-12-09 09:49:42 +00:00
Jianxun Zhang
d0520430aa intel/common: Add a new struct to describe AUX mapping format
The new struct and some helper functions are for further
refactoring.

Reworks:
 * Jordan: Refactor code around aux format array

Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20167>
2022-12-09 09:49:42 +00:00
Jianxun Zhang
6b3740f359 intel/common: Add an enum of formats of AUX mapping
The new enum allows us to support multiple formats in the future.

Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20167>
2022-12-09 09:49:42 +00:00
Lionel Landwerlin
90c86fe63e intel: add MTL performance metrics
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20228>
2022-12-09 09:13:02 +00:00
Väinö Mäkelä
d4bcfed422 hasvk: Allow aliasing with modifiers for WSI images
Ignore ALIAS_BIT when format comes from WSI because
we have the ability to bind the MEMORY_BINDING_PRIVATE
from the other WSI image.

This commit is the same as f350b78b but for hasvk.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19840>
2022-12-09 08:35:02 +00:00
Gert Wollny
586ba9c223 r600/sfn: implement GDS op channel mask evaluation
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20205>
2022-12-09 08:26:31 +00:00
Gert Wollny
4d4411588b r600/sfn: allocate pinned registers as SSA
Don't allocate the helper_invocation register as pinned, because it is
not an SSA value.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20205>
2022-12-09 08:26:31 +00:00
Gert Wollny
b623e1a0ef r600/sfn: nir_op_vec results don't need channel pinning
This will be handled by the op that uses the vector

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20205>
2022-12-09 08:26:31 +00:00
Gert Wollny
9b34969459 r600/sfn: implement TF allowed channel mask override
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20205>
2022-12-09 08:26:31 +00:00
Gert Wollny
219854a864 r600/sfn: clean up TF emission in TCS
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20205>
2022-12-09 08:26:31 +00:00
Gert Wollny
18a8d148d8 r600/sfn: Cleanup copy-prop into vec4 source values
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20205>
2022-12-09 08:26:31 +00:00
Gert Wollny
38da65c445 r600/sfn: scheduler allow more lookahead on ALU instr
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20205>
2022-12-09 08:26:31 +00:00
Gert Wollny
fcafe1ffc8 r600/sfn: Make use of variable length DOT
This frees some alu slots for better group scheduling.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20205>
2022-12-09 08:26:31 +00:00
Gert Wollny
906c5efc37 r600/sfn: Don't require assignemnt in same block to copy-propagate
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20205>
2022-12-09 08:26:31 +00:00
Gert Wollny
5f82b4cf5b r600/sfn: No need to pin LDS dests to chan
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20205>
2022-12-09 08:26:31 +00:00
Gert Wollny
6d93139061 r600/sfn: allow copy propagation to LDS read dest
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20205>
2022-12-09 08:26:30 +00:00
Gert Wollny
d7d07d0d32 r600/sfn: allow more copy-propagate with dest chan fixed.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20205>
2022-12-09 08:26:30 +00:00
Gert Wollny
5dc35cf1d1 r600/sfn: Allow copy prop into GDS sources values
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20205>
2022-12-09 08:26:30 +00:00
Tapani Pälli
68ef0d8448 anv: emit sample mask state independent of fragment stage
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7861
Fixes: 9f6af43743 ("anv: dynamic multisample sample mask")
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/20221>
2022-12-09 08:00:42 +00:00
Samuel Pitoiset
25a5d7ac0d radv: fix re-emitting the RB+ state when dynamic color write mask change
Found by inspection.

Fixes: a92d1d13c5 ("radv: add support for dynamic color write mask")
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/20204>
2022-12-09 07:37:00 +00:00
Konstantin Seurer
4c83a96f16 radv/rt: Discard metadata after lowering intersection shaders
We inserted some enstructions and control flow. Therefore, metadata is
not valid anymore.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19866>
2022-12-09 07:07:10 +00:00
Konstantin Seurer
79b7ed61a8 radv/rt: Lower hit attributes to registers
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19866>
2022-12-09 07:07:10 +00:00
Konstantin Seurer
a598263800 radv/rt: Move load_hit_attrib_amd to the top
Make sure to load hit attributes before a trace_ray call can overwrite them.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19866>
2022-12-09 07:07:10 +00:00
Konstantin Seurer
36125598c8 nir: Add intrinsics for hit attribute io
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19866>
2022-12-09 07:07:10 +00:00
Konstantin Seurer
5bfc4c293f nir/split_vars: Handle ray hit attributes
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19866>
2022-12-09 07:07:10 +00:00
Konstantin Seurer
9f03e9c286 radv: Add nir_foreach_variable_with_modes to .clang-format
Yet another loop macro.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19866>
2022-12-09 07:07:10 +00:00
Emma Anholt
433c6f5d3a egl: Drop backwards compat for missing __DRI_ATTRIB_*_SHIFT.
The only implementation supports it.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20171>
2022-12-09 05:32:18 +00:00
Emma Anholt
a145a8301e gbm: Don't look up the DRI2_FENCE extension.
It's optional, and nothing references it.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20171>
2022-12-09 05:32:18 +00:00
Emma Anholt
5ff8edaa2a egl: Replace sRGB support check with a pscreen query.
This drops the remaining use of rendererQuery from EGL.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20171>
2022-12-09 05:32:18 +00:00
Emma Anholt
eb2dcda50c egl: Move common eglCreateContext() error checks from backends to core.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20171>
2022-12-09 05:32:18 +00:00
Emma Anholt
e6285ea55f egl: Replace the robustness DRI2 ext check with a pipe cap query.
This means that swkms will now report it with llvmpipe.  drisw reported it
with llvmpipe, and it appears to have been an oversight that got
refactored into an obvious "if !swkms" check later.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20171>
2022-12-09 05:32:18 +00:00
Emma Anholt
f4b2f9cff2 egl: Remove silly robustness support checks.
The EGL frontend checks for the extension's presence before allowing the
user to set these values.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20171>
2022-12-09 05:32:18 +00:00
Brian Paul
83b0f10941 gallivm: s/unsigned/enum util_format_type/ in lp_build_sample_common()
Use the actual type here for easier debugging.

Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20233>
2022-12-09 05:04:37 +00:00
Brian Paul
bc048f5c51 gallivm: fix incorrect type for undefined texcoords
Texcoords may be 1-5 components in length.  We initialize the
unused components with an LLVMGetUndef().  But we were using
an int vec type rather than a float vec type.

This eventually led to a failed assertion in lp_build_clamp()
where 'a' was a vec of int[8] but 'min' and 'max' were float[8]
in a trace of the game Tom Clancy's Splinter Cell: Blacklist.

The game seems to have a bug where a texture sampler mistakenly has
shadow comparison turned on, but the shader's tex sample instructions
are sampling a 2D R8G8B8A8_UNORM texture.  The instruction has a
2-component texcoord so when we do the sampler comparison operation
we're using the undefined 5th coordinate component.

Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20233>
2022-12-09 05:04:37 +00:00
Boyuan Zhang
5233551e19 radeonsi: disable av1 decode for navi24
Disable AV1 decode for Navi24 since hardware doesn't support.

fixed: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7855

cc: mesa-stable

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20230>
2022-12-09 04:38:40 +00:00
Brian Paul
f3d2d076ed gallivm: misc clean-ups in lp_bld_nir.c
Use switch instead of if/else. Add some braces. 80-column wrapping, etc.

Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20211>
2022-12-09 04:00:54 +00:00
Brian Paul
d44c4b1e0e llvmpipe: misc clean-ups in lp_scene.c
Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20211>
2022-12-09 04:00:54 +00:00
Brian Paul
7b7c2e3cac llvmpipe: misc clean-ups in lp_rast.c
Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20211>
2022-12-09 04:00:54 +00:00
Brian Paul
72f8e821e3 gallivm: minor clean-ups in lp_bld_quad.c
Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20211>
2022-12-09 04:00:54 +00:00
Brian Paul
f83bf1adc4 gallivm: asst. clean-ups in lp_bld_sample_soa.c
Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20211>
2022-12-09 04:00:54 +00:00
Brian Paul
b8e792e7cc gallivm: clean-ups in lp_bld_sample.c
Formatting/whitespace fixes.  Add const qualifiers, move var decls, etc.

Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20211>
2022-12-09 04:00:54 +00:00
Marek Olšák
44614965a5 mesa: fix typos in gl_array_attrib comments
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19783>
2022-12-09 03:18:53 +00:00
Marek Olšák
d25df150b8 mesa: use the format table for double attrib format translation too
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19783>
2022-12-09 03:18:53 +00:00
Marek Olšák
593e4ae4b4 mesa: add a format table for GL_BGRA vertex format translation too
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19783>
2022-12-09 03:18:53 +00:00
Marek Olšák
1b4278117a mesa: add more cases to the gallium vertex_formats table
The way we convert gltype to the index changed to handle more enums.
The reason why (gltype & 0x3f) works is because of how the enums are
defined.

Also change the type to uint8_t. We only need the low 7 bits of
the pipe format enum.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19783>
2022-12-09 03:18:53 +00:00
Marek Olšák
7089a4c59f st/mesa: move setting draw_needs_minmax_index into st_update_array_templ
This removes several parameters from setup_array that become unused.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19783>
2022-12-09 03:18:53 +00:00
Marek Olšák
4bf6ac2e42 st/mesa: simplify st_setup_current parameters
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19783>
2022-12-09 03:18:53 +00:00
Marek Olšák
98b7c4ea09 st/mesa: optimize uploading zero-stride vertex attribs
Instead of memcpy into a temporary array and then upload from that,
upload into a buffer directly.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19783>
2022-12-09 03:18:53 +00:00
Marek Olšák
a18b9d071d st/mesa: remove alignment code from st_setup_current
I was the one who added this code and it doesn't seem useful.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19783>
2022-12-09 03:18:53 +00:00
David Heidelberg
1d5962b0e6 ci: fix missing line after adding austraincoder's farm killswitch
Accidentally dropped.

Fixes: ff928d9567 ("ci: Allow disabling the whole of austriancoder's farm")

Reported-by: Ana Guerrero Lopez <anagl@igalia.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Ana Guerrero Lopez <anagl@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20236>
2022-12-09 02:48:25 +00:00
Jordan Justen
0d9be82fe6 intel/genxml: Add genX_rt_pack.h
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/20225>
2022-12-09 01:43:39 +00:00
Lionel Landwerlin
b4b4294a78 intel/fs: add a saturation propagation test
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20206>
2022-12-09 00:39:05 +00:00
Oleksii Bozhenko
d5d8bb1dbb brw: fix saturate propagation region overlap range
Fixes: 947c828d5c
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7691

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Oleksii Bozhenko <oleksii.bozhenko@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20206>
2022-12-09 00:39:05 +00:00
Tapani Pälli
bc4b7de0d0 intel/fs: implement Wa_14017989577
The first instruction of any kernel should have non-zero emask. This
restriction needs to be obeyed to avoid GPU hangs.

Patch adds a function to insert dummy mov as first instruction
to make sure this requirement is fulfilled.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20194>
2022-12-08 23:58:32 +00:00
Chia-I Wu
5ba35fd6cc freedreno: fix compute shared_size underflow
It caused ~5% of perf regression for some gfxbench benchmarks.

Fixes: b8d10d9e87 ("gallium: split up req_local_mem")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20219>
2022-12-08 22:33:56 +00:00
Ruijing Dong
a7b3a279fb radeonsi/vcn: av1 film_grain output fix
use film grain surface as the output instead of target,
which should be kept for DPB process.

fixed: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6903

CC: 22.3
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20139>
2022-12-08 21:59:24 +00:00
Ruijing Dong
af695149e9 frontends/va: pass in film_grain_target as new output
In av1 film grain case, to use the film_grain_target
as the output, instead of target buffer, which is kept
as the input for DPB processing in film_grain output
scenario.

CC: 22.3
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20139>
2022-12-08 21:59:24 +00:00
Ruijing Dong
7e91f94864 frontneds/va: use current_display_picture from VA for film grain
use the interface defined in vaapi for av1 film grain's output
https://github.com/intel/libva/blob/master/va/va_dec_av1.h#L296-L304

CC: 22.3
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20139>
2022-12-08 21:59:24 +00:00
Ruijing Dong
7f71f732ea frontends/omx: initialize film_grain_target
set film_grain_target to NULL, and not using it
in omx path.

CC: 22.3
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20139>
2022-12-08 21:59:24 +00:00
Ruijing Dong
b70953f5ba gallium: add film_grain_target into av1 dec desc
In vaapi, film_grain output will need to direct into
other output surface instead of the current render_target.

CC: 22.3
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20139>
2022-12-08 21:59:24 +00:00
Max Lee
2db09f5b22 drm-shim: add __readlink_chk as readlink with overflow check
As per Linux Standard Base Core Specification 4.0, __readlink_chk
display value of a symbolic link, with buffer overflow checking.

if size > buflen, abort() is called.

Signed-off-by: Max Lee <endlesspring@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19045>
2022-12-08 21:05:15 +00:00
Matt Coster
3068f046bc pvr: Check depth/stencil attachment is tile-aligned
The hardware requires depth/stencil attachments to be size-aligned to
the zls tile size (as defined by rogue_get_zls_tile_size_xy()).

In practice however, this is a tiny edge case. The restriction only
applies during some operations, and any attachment larger than the tile
size will be twiddled and over-allocated into alignment beforehand.

This commit also adds the mentioned rogue_get_zls_tile_size_xy()
function. These values differ from the regular tile_size_{x,y} feature
values in some cases. Instead of including them as features as well, we
compute them directly.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20160>
2022-12-08 14:53:13 +00:00
Matt Coster
2112a7d9ed pvr: Account for other depth formats in pvr_frag_state_stream_init()
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20160>
2022-12-08 14:53:13 +00:00
Matt Coster
6404eee627 pvr: Add stencil support in render job setup
The implementation here assumes separate depth and stencil attachments
are not possible, as they are in Vulkan without VK_KHR_dynamic_rendering
and before core 1.3.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20160>
2022-12-08 14:53:13 +00:00
Christian Gmeiner
ff928d9567 ci: Allow disabling the whole of austriancoder's farm
Add a global-level variable that allows disabling all jobs that would
have gone to my lab, to be used in case of outages.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18997>
2022-12-08 14:09:39 +00:00
Samuel Pitoiset
011a0b97b2 radv,aco: move radv_ps_epilog_key to the graphics pipeline key
To avoid redundant structs.

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/20199>
2022-12-08 13:28:00 +00:00
Samuel Pitoiset
67c9497435 radv: fix PS epilogs with RADV_PERFTEST=pswave32
This option is rarely or even never used but it was broken. While we
are at it, remove radv_ps_epilog_key::wave32 because the wave size
can only be changed globally for PS.

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/20199>
2022-12-08 13:28:00 +00:00
Samuel Pitoiset
b7f49de625 radv,aco: use 8-bit for color_is_int{8,10} everywhere
Do not need 32-bits because there is only up to 8 MRTs.

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/20199>
2022-12-08 13:28:00 +00:00
Samuel Pitoiset
9079bd821c radv,aco: rename color output related fields for consistency
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/20199>
2022-12-08 13:28:00 +00:00
Matt Coster
724e662948 pvr: Extract common code from pvr_CmdDispatch{,Indirect}
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20159>
2022-12-08 13:10:35 +00:00
Matt Coster
46213744c7 pvr: Track max_shared_regs for compute jobs
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20159>
2022-12-08 13:10:35 +00:00
Matt Coster
293230faf1 pvr: Refactor pvr_compute_pipeline and pvr_compute_pipeline_shader
This brings the two structs more into line with their graphics
counterparts, and removes the extra member access previously required
to access almost all members of pvr_compute_pipeline.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20159>
2022-12-08 13:10:35 +00:00
Tatsuyuki Ishi
327c906424 aco: Migrate RA to use std::optional
The use of std::optional simplifies expressions and would be useful for some
upcoming RA tweaks.

C++17 has been available since the merge of rusticl and should be safe to use as
far as packaging is concerned.

A few style choices are:
- Testing for emptiness uses implicit bool conversion.
- Constructing an empty value uses {}.
- Constructing a filled value uses the implicit conversion constructor.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20125>
2022-12-08 12:08:01 +00:00
Martin Roukala (né Peres)
a3249415e2 ci/valve-infra: use a new version of the mesa trigger
This new version of the container will re-try up to 3 times to download
the job bucket, rather than failing directly. If the issue persists,
the job will still succeed, but not all artifacts will be present...

Fixes: #7809
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20203>
2022-12-08 12:27:01 +02:00
Kenneth Graunke
bafbe7c23a intel/compiler: Set NoMask on cr0 access for float controls mode
This is trying to clear a bit in the control register.  However, it's
executing with whatever channel mask happens to be active.  Typically
this is the one at the start of the program, so at least some channels
will be active.  Typically the first channel will be active due to
packed dispatch, but that's not always guaranteed.  Without NoMask,
the float controls writes may randomly not happen.

Recent GPUs also seem to have a hang issue when the first instruction in
the shader doesn't have any active channels.  Having an instruction with
NoMask at the start of the program works around the issue.  See HSD bug
14017989577.  In our case, the float controls preamble was breaking that
restriction every time, causing us to run into this problem frequently.

Thanks to Tapani Pälli for finding this hang issue, and Francisco
Jerez and Lionel Landwerlin for helping pinpoint this issue during
review of a workaround patch in !20194.

Fixes GPU hangs in Elder Scrolls Online, Witcher 3, and likely more.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7639
Fixes: 9da56ffc52 ("i965/fs: add emit_shader_float_controls_execution_mode() and aux functions")
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-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/20214>
2022-12-08 09:54:09 +00:00
Gert Wollny
b6616b036f virgl: lower FMA and MULADD
On the host we emit this as separate ops anyway, so avoid
wired optimizations in the guest that might introduce
difficult to optimize dependencies.

v2: update trace expectations - some minor accuracy changes
    are to be expected when fma is handled differently

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20182>
2022-12-08 08:40:53 +00:00
Timothy Arceri
8d10a6835f glsl: dont create temps for builtin function inputs
It's not valid to be copying input variables to temps when
inlining atomic memory, interpolateAt functions, etc. We got away
with this previously because tree grafting would clean up the
mess but we shouldn't depend on an optimisation to clean up
invalid IR. Also I hope to remove tree grafting in a follow up
merge request.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19890>
2022-12-08 05:22:27 +00:00
Timothy Arceri
7b9ec592aa glsl: use ir_rvalue_visitor for function inlining
This allows us to drop some duplicate code that is already in the
ir_rvalue_visitor. It also allows us to better replace rvalues
and handle swizzle in the following patch without having to add
even more duplicate code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19890>
2022-12-08 05:22:27 +00:00
Yiwei Zhang
34b28cfb7d venus: scrub ignored fields for descriptor writes for push descriptor
Fixes: 933ca11f1a ("venus: implement vkCmdPushDescriptorSetWithTemplateKHR")

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20191>
2022-12-08 01:56:35 +00:00
Iván Briano
e1ab7629f8 vulkan: VkPolygonMode has a bit more than two values
Fixes: 9d0ed9cbcc ("vulkan: Add more dynamic rasterizer state")

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20212>
2022-12-08 00:40:11 +00:00
Väinö Mäkelä
4035853523 hasvk: Report correct multisampling limits on gfx7
Some limits reported by hasvk were too high, which caused CTS tests to
fail.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19393>
2022-12-08 00:16:44 +00:00
Bas Nieuwenhuizen
513442dc32 aco: Add s_delay_alu support for GFX11+
Roughly copied from LLVM. This facilitates better ALU usage by
switching between waves when there is an ALU stall, which isn't
automatic anymore on GFX11.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19743>
2022-12-07 22:05:25 +00:00
Bas Nieuwenhuizen
cd3bf56ace aco: Add helper to get cycle info for an instruction.
For use in s_delay_alu tracking

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19743>
2022-12-07 22:05:25 +00:00
Bas Nieuwenhuizen
352e492c7b aco: Add isTrans helper.
For the s_delay_alu tracking.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19743>
2022-12-07 22:05:25 +00:00
Samuel Pitoiset
bdb7fd69d6 radv: mark extendedDynamicState3SampleLocationsEnable as not required by Zink
Only dynamic blend equation support is still required.

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/19924>
2022-12-07 16:43:17 +01:00
Samuel Pitoiset
06a65be3d4 radv: advertise extendedDynamicState3LineRasterizationMode
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/19924>
2022-12-07 16:43:15 +01:00
Samuel Pitoiset
1009276312 radv: add support for dynamic line rasterization mode
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/19924>
2022-12-07 16:43:13 +01:00
Samuel Pitoiset
f992e663c7 radv: advertise extendedDynamicState3RasterizationSamples
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/19924>
2022-12-07 16:43:11 +01:00
Samuel Pitoiset
a2fe4e9b04 radv: add support for dynamic rasterization samples
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/19924>
2022-12-07 16:43:09 +01:00
Samuel Pitoiset
c88d4037aa radv: store the number of color/ds samples to the rendering 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/19924>
2022-12-07 16:43:07 +01:00
Mihai Preda
613e9b8e7a nir: fix digit order in print_bitset()
Also fix the leading curly for the new function definitions.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19570>
2022-12-07 12:59:33 +00:00
Mihai Preda
0320dbaff5 nir: print shader_info bools with the value
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19570>
2022-12-07 12:59:33 +00:00
Mihai Preda
da2d36a9d5 nir: print shader_info inputs/outputs as bit ranges
e.g.
inputs_read: 15-17
outputs_written: 0,32

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19570>
2022-12-07 12:59:33 +00:00
Mihai Preda
89eca6a2fa radeonsi: add AMD_DEBUG=elements for printing vertex elements
in si_create_vertex_elements()

This information is useful in debugging shader inputs/outputs

Sample output:
AMD_DEBUG=elements ./bin/arb_vertex_attrib_64bit-overlapping-locations shader -auto
elements[0]: offset  0, buffer_index 0, dual_slot 0, format  16, divisor 0
elements[1]: offset 16, buffer_index 0, dual_slot 0, format  16, divisor 0
elements[0]: offset  0, buffer_index 0, dual_slot 0, format 104, divisor 0
elements[0]: offset  0, buffer_index 0, dual_slot 0, format 105, divisor 0
elements[0]: offset  0, buffer_index 0, dual_slot 0, format 106, divisor 0
elements[0]: offset  0, buffer_index 0, dual_slot 0, format 107, divisor 0
elements[0]: offset  0, buffer_index 0, dual_slot 0, format  16, divisor 0
elements[1]: offset 16, buffer_index 0, dual_slot 0, format  16, divisor 0
elements[0]: offset  0, buffer_index 0, dual_slot 0, format 104, divisor 0
elements[0]: offset  0, buffer_index 0, dual_slot 0, format 105, divisor 0
elements[0]: offset  0, buffer_index 0, dual_slot 0, format 106, divisor 0
elements[0]: offset  0, buffer_index 0, dual_slot 0, format 107, divisor 0
elements[0]: offset  0, buffer_index 0, dual_slot 0, format 107, divisor 0
elements[1]: offset 16, buffer_index 0, dual_slot 1, format 107, divisor 0
elements[2]: offset 32, buffer_index 0, dual_slot 1, format 105, divisor 0
elements[0]: offset  0, buffer_index 0, dual_slot 0, format 107, divisor 0
elements[1]: offset 40, buffer_index 0, dual_slot 1, format 107, divisor 0
elements[2]: offset 56, buffer_index 0, dual_slot 1, format 105, divisor 0
elements[0]: offset  0, buffer_index 0, dual_slot 0, format 107, divisor 0
elements[1]: offset 64, buffer_index 0, dual_slot 1, format 107, divisor 0
elements[2]: offset 80, buffer_index 0, dual_slot 1, format 105, divisor 0

PIGLIT: {"result": "pass" }
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19570>
2022-12-07 12:59:33 +00:00
Mihai Preda
6dd170e5a4 util: minor refactor _mesa_sha1_print()
should not change the output; avoids an additional printf()
for the separator.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19570>
2022-12-07 12:59:33 +00:00
Mihai Preda
e9f3f80b1d nir: print_shader_info(): brief output
Make the shader_info printing less verbose by skipping the fields that
are likely not used (being zero).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19570>
2022-12-07 12:59:33 +00:00
Mihai Preda
814ba7d13d nir: print_shader_info: print stage-specific shader info
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19570>
2022-12-07 12:59:33 +00:00
Mihai Preda
37b7233c15 nir: print_shader_info() print bitsets
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19570>
2022-12-07 12:59:33 +00:00
Mihai Preda
4ed85c16f9 nir: print more in print_shader_info()
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19570>
2022-12-07 12:59:33 +00:00
Mihai Preda
185e65f0f5 nir: extract print_shader_info() from nir_print_shader_annotated()
This is a refactoring, it is not supposed to change the printed output.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19570>
2022-12-07 12:59:33 +00:00
Otavio Pontes
2e775b8bdb anv/hasvk: Clamping Scissor Rect values in a valid range
On cmd_buffer_emit_scissor(), if VkViewport height or width are set to
a value lower than 1.0, y_max or x_max can be attributed negative values,
causing an overflow. That leads to ScissorRectangleYMax or
ScissorRectangleXMax to be set to values on an unsupported range.

Clamping x_max and y_max in the valid range solves the problem.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7471
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20200>
2022-12-07 12:19:42 +00:00
Jonathan Marek
029919f3c8 tu: allow using resolve engine for SRGB MSAA resolves
CTS accepts this behavior since a1be5ce2c893f525da82bc28c6e81b17cacc5d14

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20120>
2022-12-07 11:55:51 +00:00
Danylo Piliaiev
1cfc413c9a meson: Do not enable drm for KGSL Turnip build
Android may use either DRM or some downstream solution, KGSL is a
downstream kernel driver for Adreno. Don't enable DRM when we want
Turnip to use KGSL instead of DRM.

Fixes: 09ac29cca9
("meson: Enable system_has_kms_drm for android")

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/20168>
2022-12-07 10:40:50 +00:00
Marek Olšák
3c3e5cc40d st/mesa: stop using redundant st_context::vp,tcp,tep,gp,fp,cp
Use ctx->XXProgram._Current instead of the st_context variables.

v2: split from a bigger commit

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19859>
2022-12-07 09:12:41 +00:00
Marek Olšák
33ca53ac79 st/mesa: fix the glBitmap cache wrt FS, scissor, and clamp color changes
We need to track those states in the cache and flush the cache
if the next glBitmap call uses different states.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19859>
2022-12-07 09:12:41 +00:00
Marek Olšák
525c70c61a st/mesa: don't flag ST_NEW_RASTERIZER for _NEW_PROGRAM
This should have no effect thanks to previous commits.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19859>
2022-12-07 09:12:41 +00:00
Marek Olšák
2a25b47c87 mesa: flag ST_NEW_RASTERIZER for !needs_texcoord_semantic if changing FS
This will be required with the next change, which will remove
the rasterizer state dependency on _NEW_PROGRAM.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19859>
2022-12-07 09:12:41 +00:00
Marek Olšák
7950661aa0 mesa: remove unused composite _NEW_* flags
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19859>
2022-12-07 09:12:41 +00:00
Marek Olšák
0a8d741b6d mesa: don't flag _NEW_PROGRAM for "texture_unit -> sampler" mapping changes
st/mesa just reorders sampler views, so we only need to rebind those.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19859>
2022-12-07 09:12:41 +00:00
Marek Olšák
dbc9cb6995 mesa: set fewer flags for VertexProgram.TwoSideEnabled changes
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19859>
2022-12-07 09:12:41 +00:00
Marek Olšák
5acc0fa1d2 mesa: set fewer dirty flags for PointSizeEnabled state changes
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19859>
2022-12-07 09:12:41 +00:00
Marek Olšák
5b97b452af mesa: flag ST_NEW_FS_CONSTANTS instead of _NEW_PROGRAM for ATI_fs constants
We only need to update the constant buffer.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19859>
2022-12-07 09:12:41 +00:00
Marek Olšák
4bc0edd1cf st/mesa: update st_context::active_states in _mesa_update_state
just a code movement to a better place

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19859>
2022-12-07 09:12:41 +00:00
Marek Olšák
aaa4b0e618 st/mesa: move check_program_state code into _mesa_update_state
_mesa_update_state() receives the _NEW_PROGRAM flag, so we can handle
any shader changes there.

There may be some overhead reduction because gfx_shaders_may_be_dirty
is removed.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19859>
2022-12-07 09:12:41 +00:00
Marek Olšák
0311827337 st/mesa: always unbind constant buffer 0 when unbinding a shader
softpipe loads from an unbound and destroyed constant buffer for some reason

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19859>
2022-12-07 09:12:41 +00:00
Marek Olšák
a77c687cfb mesa: clean up hairy code in state.c: update_program
No change in behavior.

Replace:

if (shader)
   bind(shader);
else
   bind(NULL);

With:

bind(shader);

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19859>
2022-12-07 09:12:41 +00:00
Erik Faye-Lund
65406bfde1 zink: fix rebase-mistake
This should not have re-introduced this lowering, effectively reverting
dcf3ae72ab.

Fixes: 16971cd667 ("zink: add driver-workaround for missing gl_point_size")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20195>
2022-12-07 08:54:09 +00:00
Lionel Landwerlin
e25e17dd0c intel/fs: clamp per vertex input accesses to patchControlPoints
In a tesselation control shader where an input array is accessed using
the index gl_InvocationID, we can end up accessing elements beyond the
number of input vertices specified in the shader key.

This happens because of the lowering in nir_lower_indirect_derefs().
This lowering will affect compact variables which happens in this
case :

  in gl_PerVertex {
      vec4  gl_Position;
      float gl_ClipDistance[1];
  } gl_in[gl_MaxPatchVertices];

The lowered code produced by NIR is somewhat ineffecient (implements a
binary seach) :

  if (gl_InvocationID < 16) {
     if (gl_InvocationID < 8) {
        if (gl_InvocationID < 4) {
          vec4 vals = load_at_offset(0);
          value = bcsel(vals, gl_InvocationID);
        } else {
          vec4 vals = load_at_offset(4);
          value = bcsel(vals, gl_InvocationID - 4);
        }
     } else {
        if (gl_InvocationID < 12) {
          vec4 vals = load_at_offset(8);
          value = bcsel(vals, gl_InvocationID - 8);
        } else {
          vec4 vals = load_at_offset(12);
          value = bcsel(vals, gl_InvocationID - 12);
        }
     }
  } else {
     if (gl_InvocationID < 24) {
        ...
     } else {
        ...
     }
  }

By default the gl_MaxPatchVertices must be set at 32 items and that's
what the lowering code will use to divide the access into chunks of 4.
But when running with 3 input vertices, this means we'll pull one more
item than what was delivered in the shader payload.

This triggers issues further down the register scheduling where the
g5UD (register for the 4th item) is overwritten by a previous SEND,
leading the URB read to use an invalid handle.

This pass clamps any access load_per_vertex_input intrinsic vertex
indice to (input_vertices - 1).

Fixes issues with tests like :
dEQP-VK.clipping.user_defined.clip_distance.vert_tess.*

Also fixes a hang with zink/anv on :
KHR-GL46.draw_elements_base_vertex_tests.AEP_shader_stages

v2: Don't replace source register

v3: Implement in NIR

v4: Clamp per vertex array sizes in NIR (Jason)

v5: Move the clamping on the intel compiler

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/9749>
2022-12-07 08:16:03 +00:00
Jason Ekstrand
9d43aebcad nir: Use nir_component_mask_t for nir_alu_dst::write_mask
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20193>
2022-12-06 18:37:19 -06:00
Dave Airlie
57b7102ef9 glx: fix xshm check to init xshm_opcode.
Found and proposed by Ray Strode (halfline)

Fixes: 68e8940114 ("glx/drisw: use xcb instead of X to query connection")
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20188>
2022-12-06 22:31:14 +00:00
Erik Faye-Lund
2ccf481c17 zink: don't use defunct custom-flag
We're no longer respecting this flag, so there's no need in setting it.

Fixes: 00dc0036bb ("zink: flatten out buffer creation usage flags codepath")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20183>
2022-12-06 22:09:46 +00:00
Konstantin Seurer
91ed8fb13a nir: Add missing includes
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14831>
2022-12-06 20:17:58 +00:00
Dawn Han
0033ec1f69 venus: check against the Vulkan type rather than type index.
Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20064>
2022-12-06 19:50:53 +00:00
Dawn Han
fbf4c6e43f venus: fix deqp tests failed on iub descriptor type
Fixes: abae9d4831 ("Add the iub binding count tracking")

Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20064>
2022-12-06 19:50:53 +00:00
Samuel Pitoiset
12f26b5e6d radv: fix guardband if the polygon mode is points or lines
If points or lines are drawn using the polygon mode, the guardband
should be adjusted for large points/lines.

Cc: 22.3 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/20185>
2022-12-06 19:30:51 +00:00
Mark Collins
12b0f7ac19 tu: Destroy disk_cache during tu_physical_device_finish
While running VK-CTS with valgrind, the application hit the max
thread count of 500. After further investigation, this was due to
multiple instances being created with the disk cache spinning up
worker threads which wouldn't be cleaned as disk_cache_destroy
wasn't being called.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20178>
2022-12-06 19:06:50 +00:00
Emma Anholt
f7d414b3e3 mesa: Add missing dep on generated marshal header in the tests build.
We lost the race in a recent MR of mine.

Fixes: 381e0b43d6 ("mesa: Add test to prevent windows.h to be included in shared headers")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20170>
2022-12-06 18:35:37 +00:00
Mark Collins
1c3671d2ba ir3: Disallow noperspective texture preloads
The `coord_offset` pass is responsible for upgrading any eligible
texture loads into prefetches, but a texture prefetch's capabilities
are limited and cannot handle any interpolation modes aside from
`smooth`.

An exception is carved out for `flat` interpolation modes, but this
doesn't exclude upgrading `noperspective` texture loads and results
in perspective-corrected samples being provided that can severely
break applications depending on this behaviour.

Fixes incorrect lighting projection on Super Mario Odyssey on
Skyline Emulator.

Fixes incorrect dirt texture mapping on Portal 2 trace on Turnip and
Zink on Turnip.

Fixes incorrect lighter shadowing on Half Life 2 trace on Turnip.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19842>
2022-12-06 17:27:50 +00:00
Mark Collins
5b8917bb91 ir3: Propagate coord_offset result from alu src insts
`coord_offset` is called on the source of `alu` instructions and
it returns -1 for failures, this not explicitly checked for and
as a result the fetch can incorrectly be upgraded to a prefetch
when it isn't appropriate to do so.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19842>
2022-12-06 17:27:50 +00:00
Emma Anholt
83b8687264 turnip: Initialize *memory on 0-sized alloc early exit.
Otherwise, making a CS using the memory will use the uninitialized .map
value (when checking the size of the CS in in begin's tu_cs_is_empty()
check), causing valgrind noise in
dEQP-VK.binding_model.descriptorset_random.sets4.dynindexed.ubolimitlow.sbolimitlow.sampledimghigh.lowimgsingletex.iublimitlow.nouab.vert.noia.0
(thanks to vi_info->vertexBindingDescriptionCount==0).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20173>
2022-12-06 16:59:59 +00:00
Marcin Ślusarz
7809f76fe8 intel/compiler/mesh: align payload size to the size of vec4
This reduces the number of instructions in task shaders when payload
size is not aligned to vec4 and payload_in_shared WA is enabled,
because nir_lower_task_shader will not need to handle the unaligned
size case.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20080>
2022-12-06 16:31:11 +00:00
Marcin Ślusarz
ffefa386fd nir/lower_task_shader: fix task payload corruption when shared memory workaround is enabled
We were not taking into account that when all invocations within workgroup
are active, we'll copy more data than needed, corrupting task payload
of other workgroups.

Fixes: 8aff8d3dd4 ("nir: Add common task shader lowering to make the backend's job easier.")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20080>
2022-12-06 16:31:11 +00:00
Rhys Perry
bd30adf89d aco: apply NUW to additions for scratch access
fossil-db (navi21):
Totals from 52 (0.04% of 135636) affected shaders:
Instrs: 79036 -> 78567 (-0.59%)
CodeSize: 431188 -> 427984 (-0.74%)
Latency: 1318142 -> 1313821 (-0.33%)
InvThroughput: 293842 -> 292836 (-0.34%)
VClause: 2555 -> 2361 (-7.59%); split: -8.06%, +0.47%
Copies: 8746 -> 8767 (+0.24%); split: -0.11%, +0.35%

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/20117>
2022-12-06 15:23:38 +00:00
Rhys Perry
381de3c809 aco: more carefully apply constant offsets into scratch accesses
Death stranding does scratch_arr[80-idx]. This doesn't seem to work if we
try to combine the subtraction into the access.

fossil-db (navi21):
Totals from 52 (0.04% of 135636) affected shaders:
Instrs: 78560 -> 79036 (+0.61%)
CodeSize: 427940 -> 431188 (+0.76%)
Latency: 1313809 -> 1318142 (+0.33%)
InvThroughput: 292833 -> 293842 (+0.34%)
VClause: 2361 -> 2555 (+8.22%); split: -0.51%, +8.73%
Copies: 8767 -> 8746 (-0.24%); split: -0.35%, +0.11%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 0e783d687a ("aco: use scratch_* for scratch load/store on GFX9+")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7735
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20117>
2022-12-06 15:23:38 +00:00
Rhys Perry
fae8c75ad0 radv/rt: set additions for scratch access as NUW
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/20117>
2022-12-06 15:23:38 +00:00
Rhys Perry
9b7217d12e nir/range_analysis: unsigned upper bound analysis for b2i
fossil-db (navi21):
Totals from 93 (0.07% of 135636) affected shaders:
Instrs: 133949 -> 133899 (-0.04%); split: -0.05%, +0.01%
CodeSize: 708124 -> 707528 (-0.08%); split: -0.09%, +0.01%
Latency: 2451564 -> 2450158 (-0.06%); split: -0.06%, +0.00%
InvThroughput: 398282 -> 397345 (-0.24%)
SClause: 4441 -> 4437 (-0.09%); split: -0.18%, +0.09%
Copies: 7578 -> 7546 (-0.42%); split: -0.55%, +0.13%

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/20117>
2022-12-06 15:23:38 +00:00
David Heidelberg
ccbb4648cb ci/freedreno: temporarily disable godot-trive on zink+freedreno
Test if this trace impact surrounding traces causing rendering changes.

Ref: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7732

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20179>
2022-12-06 13:54:36 +00:00
Marek Olšák
b75b9d6324 ac/llvm: set invariant.load on image loads with ACCESS_CAN_REORDER
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20146>
2022-12-06 13:27:16 +00:00
Marek Olšák
de3fcc77c7 ac/llvm: inline ac_get_load_intr_attribs
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20146>
2022-12-06 13:27:16 +00:00
Marek Olšák
ce860953a6 ac/llvm: rename attribute enums
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20146>
2022-12-06 13:27:16 +00:00
Marek Olšák
ce0a83efb8 ac/llvm: use invariant.load metadata on load intrinsics instead of readnone
readnone is illegal now and we should be using invariant.load since LLVM 15.
(suggested by Nicolai)

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20146>
2022-12-06 13:27:16 +00:00
Marek Olšák
d3a03d24fc ac/llvm: don't set "readnone" on non-memory intrinsics
It's illegal and LLVM always knows which intrinsics don't read memory.
This started failing IR validation with LLVM 16.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20146>
2022-12-06 13:27:16 +00:00
Marek Olšák
50bece9322 ac/llvm: don't set "convergent" on intrinsics where it's automatic
LLVM adds the flag automatically.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20146>
2022-12-06 13:27:16 +00:00
Marek Olšák
2b5edf96ff ac/llvm: simplify how function attributes are set
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20146>
2022-12-06 13:27:16 +00:00
Marek Olšák
9b4142ae9f ac/llvm: simplify how call attributes are set
set them directly in ac_build_intrinsic, the only place that sets them

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20146>
2022-12-06 13:27:16 +00:00
Marek Olšák
e94b040add ac/llvm: remove illegal function attributes READONLY and WRITEONLY
They are only legal on parameters.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20146>
2022-12-06 13:27:16 +00:00
Marek Olšák
89cd402c9b gallivm: remove illegal and unused function attributes
READONLY is illegal on calls. Others were unused.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20146>
2022-12-06 13:27:16 +00:00
Marek Olšák
6ab5f57039 gallivm: remove unused LP_FUNC_ATTR_LEGACY
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20146>
2022-12-06 13:27:16 +00:00
Marek Olšák
e54f2286be gallivm: remove unused LP_FUNC_ATTR_INACCESSIBLE_MEM_ONLY
LLVM 16 removed it anyway.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20146>
2022-12-06 13:27:16 +00:00
Marek Olšák
5104f4d496 ac/llvm: remove unused AC_FUNC_ATTR_LEGACY
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20146>
2022-12-06 13:27:16 +00:00
Marek Olšák
834d59a83e ac/llvm: remove AC_FUNC_ATTR_INACCESSIBLE_MEM_ONLY because LLVM 16 removed it
We didn't use it reasonably anyway.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20146>
2022-12-06 13:27:15 +00:00
Igor Torrente
16971cd667 zink: add driver-workaround for missing gl_point_size
Add code to support gl_point lowering.

In this commit the target of this lowering will be only the
imagination proprietary driver.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20109>
2022-12-06 12:37:13 +00:00
Igor Torrente
3193eebb45 zink: rename zink_set_line_stipple_keys
This function will be used by another primitive emulation and
a more generic name will be needed.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20109>
2022-12-06 12:37:13 +00:00
Igor Torrente
ea5b2b9c4c zink: add gl_point lowering pass
This lowering pass is intended for hardwares/drivers that can't honor
the gl_PointSize when GL_PROGRAM_POINT_SIZE is enabled.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20109>
2022-12-06 12:37:13 +00:00
Jose Fonseca
da5840f385 llvmpipe: Faithfully honour pipe_rasterizer_state::rasterizer_discard flag.
D3D10 established that rasterization should be discarded when a null PS was
bound, and depth/stencil state was disabled, and llvmpipe followed those
semantics.  Nowadays all APIs have explicit rasterization discard flag,
and so does Gallium, so it's better for llvmpipe to faithfully follow
that flag, and trust the state tracker to follow the right semantics.

Second guessing pipe_rasterizer_state::rasterizer_discard actually
causes problems, specially when no depth-stencil surface is bound, as
D3D10 mandates rasterization should still happen, yet among all the
translation layers it often happens depth-stencil enablement is
optimized away when no depth-stencil is bound, which in turn was causing
llvmpipe to disable rasterization when it shouldn't.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20155>
2022-12-06 11:44:11 +00:00
Jose Fonseca
36a7d6788c nir: Recognize empty shaders in nir_tgsi_scan_shader().
When a null PS is bound, the
pipe_query_data_pipeline_statistics::ps_invocations counter should not
be incremented.

However llvmpipe can't cope with a null PS bound, requiring the state
tracker to bind an empty pixel shader instead.  llvmpipe infers empty
TGSI pixel shaders by looking tgsi_shader_info::num_instructions, as an
empty shader should have a single END instruction, but this logic wasn't
working for NIR shaders.

I mulled over the possibility of making llvmpipe handle null pixel
shaders.  Spreading null checks everywhere would be invasive and error
prone, but it would be quite simple if llvmpipe simply created a dummy
PS internally, to be used as a replacement whenever a null PS was bound.
That said, I'm not sure if other gallium drivers can cope with a null PS
neither, and if nought, might as well keep using an empty PS in lavapipe
state tracker.  An any rate, this change makes sense on its own.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20155>
2022-12-06 11:44:11 +00:00
Erik Faye-Lund
dcf3ae72ab zink: do not lower gs-intrinscs, take two
Whoops, I missed a spot!

Fixes: ad26d29adc ("zink: do not lower gs-intrinsics")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20177>
2022-12-06 11:24:51 +00:00
Samuel Pitoiset
a42f8d49c3 radv: use LATE_Z for depth/stencil attachments used in feedback loops
To make sure shader invocations read the correct values.

Fixes dEQP-VK.rasterization.rasterization_order_attachment_access.*.samples_*.multi_draw_barriers

Cc: 22.3 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/19728>
2022-12-06 10:34:11 +01:00
Samuel Pitoiset
86c3b9df12 radv: apply register changes for SQTT on GFX11
Based on the register db, most of them moved.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20089>
2022-12-06 08:19:24 +01:00
Erik Faye-Lund
ad26d29adc zink: do not lower gs-intrinsics
We don't use the counters for anything useful, so let's drop this
lowering pass.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20135>
2022-12-06 07:12:20 +00:00
Chia-I Wu
7244d88516 nir: fix nir_link_varying_precision
link_varyings ignores precisions and can assign the same location to
variables with different precisions.  nir_link_varying_precision should
check location_frac as well.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20113>
2022-12-06 02:00:36 +00:00
Chia-I Wu
4663d6fc9c turnip: fix dynamic logicop state
When a pipeline has dynamic logicop state or blend state, we defer lrz
write decision to tu6_calculate_lrz_state.  As such,
tu6_calculate_lrz_state should look at both states when either of them
is dynamic.

Fixes dEQP-GLES2.functional.fragment_ops.interaction.basic_shader.21 on
angle, which uses dynamic logicop state and static blend state with
blending enabled.

Fixes: c8c7154c2e ("tu: Implement extendedDynamicState3ColorBlendEnable")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20136>
2022-12-06 01:13:11 +00:00
Nanley Chery
ea4de4ad3d anv: Don't ambiguate for undefined layouts on TGL+
For Tiger Lake and onward, we generally don't need to ambiguate the CCS
before accessing it. This is safe for two reasons:

- Tiger Lake and onward treat all CCS values as legal.
- We enable compression on all writable image layouts. The CCS will
  receive all writes and will therefore always be valid.

When dealing with modifiers, we continue to allow ambiguates in some
instances.

Before this patch, I found ~19.5k ambiguates in Wolfenstein:
Youngblood's Riverside benchmark (note that this includes manually
entering the benchmark and exiting the app). With this patch, the number
of ambiguates goes down to zero.

Improves performance of Fallout 4 at 1080p/High settings on Arc A380 by
around 22%.

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20118>
2022-12-06 00:49:17 +00:00
Nanley Chery
5c84b31891 anv: Move aux vars up in transition_color_buffer
I'd like to reuse one of them for an assert.

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20118>
2022-12-06 00:49:17 +00:00
Nanley Chery
822687f4c0 intel/dev: Add a has_illegal_ccs_values flag
Whether or not CCS can be used without initialization depends on the
platform:

- On gfx7-8, each CCS element is 1-bit and encodes "fast-cleared" or
  "pass-through". So, those platforms have no illegal values.

- On gfx9-11, each CCS element is 2-bits and some bit combinations
  are invalid.

- On gfx12+, each CCS element is 4-bits but they have no truly illegal
  values. Unused encodings are interpreted as "pass-through".

Refer to the "MCS/CCS Buffers for Render Target(s)" sections of the
PRMs for more info.

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20118>
2022-12-06 00:49:17 +00:00
Nanley Chery
d307655e52 anv: Use specific flush reasons for CCS operations
When INTEL_DEBUG=pc is set and a CCS operation is being performed, the
driver reports that flushes are happing before and after the operation.
It also reports that the operation is a fast clear, but that's not
always the case. We could be resolving for example.

Reporting the specific operation can help avoid confusion.

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20118>
2022-12-06 00:49:17 +00:00
Lionel Landwerlin
d4cd33630a intel: add missing restriction on fragment simd dispatch
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7755
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Tested-by: Mark Janes <markjanes@swizzler.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20169>
2022-12-06 00:37:50 +02:00
Lionel Landwerlin
b9403b1c47 intel: factor out dispatch PS enabling logic
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Tested-by: Mark Janes <markjanes@swizzler.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20169>
2022-12-06 00:37:47 +02:00
Emma Anholt
71180004e0 ci/i915: Update xfails.
Some things have drifted since we were last green.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20166>
2022-12-05 13:03:59 -08:00
Emma Anholt
f902203daa i915: Fix probing regression.
The device id was incorrectly getting passed as a pointer-to-pointer, and
also assert's expression doesn't get called on release builds.

Fixes: dfd20f002f ("intel: Add and use intel_gem_get_param()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20166>
2022-12-05 13:03:12 -08:00
Emma Anholt
a42feab5ae egl+glx: Always support no_error contexts.
Since we know we're loading this Mesa build, we know that no_error is
always supported (the renderer query always returned true).

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20069>
2022-12-05 19:26:41 +00:00
Emma Anholt
895ec843d3 egl: Collapse a bunch of renderer queries into pipe cap queries.
Now that we can access the pipe screen through the dri_screen, we can skip
some indirection.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20069>
2022-12-05 19:26:41 +00:00
Emma Anholt
7ab8dd13b9 egl: Pull the API mask directly out of the dri_screen.
Now that we know the driver on the other side is the same version of Mesa
as our build, we can just access the screen instead of having accessor
functions.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20069>
2022-12-05 19:26:41 +00:00
Emma Anholt
133e2f8ac3 dri: Add createContext hook to __DRI_MESA.
Again, reduces switching on driver type in the loader.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20069>
2022-12-05 19:26:41 +00:00
Emma Anholt
cdc7475f72 gallium/dri: Move the backendVtable InitScreen func into __DRI_MESA.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20069>
2022-12-05 19:26:41 +00:00
Emma Anholt
4dd656e19a dri: Add createNewScreen into the __DRI_MESA extension.
Now the loaders don't have to switch on dri2/dri3/swrast.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20069>
2022-12-05 19:26:41 +00:00
Emma Anholt
fbf9f671e4 gallium/dri: Clarify some "extensions" lists in driCreateNewScreen2.
I was having a hard time keeping track of them all.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20069>
2022-12-05 19:26:41 +00:00
Emma Anholt
1026d29344 dri: Introduce internal Mesa DRI driver loader extension.
All DRI loaders in Mesa (EGL, GLX, gbm) now require this ext and that the
driver come from a matching build.  This will let us use Mesa-internal
types and enums across the loader-driver bounary inside of Mesa.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Eric Engestrom <eric@igalia.com>
LOL-YESed-by: Kristian Høgsberg <krh@bitplanet.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20069>
2022-12-05 19:26:41 +00:00
Emma Anholt
2db044d7e5 gbm: Refactor screen creation a bit.
A lot of the screen creation path was duplicated between swrast and dri2.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20069>
2022-12-05 19:26:41 +00:00
Emma Anholt
3ad1ef82dd gbm: Drop redundant extension error checks.
loader_bind_extensions error handling has already made sure these are
present.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20069>
2022-12-05 19:26:41 +00:00
Emma Anholt
690ea44cf1 gallium/dri: Use loader_bind_extensions().
Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20069>
2022-12-05 19:26:41 +00:00
Emma Anholt
ca7a74199f egl: Switch to using loader_bind_extensions().
Slightly different than our dri2_bind_extensions(), but same idea.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20069>
2022-12-05 19:26:41 +00:00
Emma Anholt
3ae6ec9f60 glx: Use loader_bind_extensions().
This adds more consistent logging on failure and gives us a spot for
version checks.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20069>
2022-12-05 19:26:41 +00:00
Emma Anholt
e864047f97 loader: Simplify the extension matching logic.
Also, add debug logging for missing optional extensions.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20069>
2022-12-05 19:26:41 +00:00
Emma Anholt
6229b48aaa gbm: Promote dri_bind_extensions() to the loader util library.
It's better than EGL's copy of it by having optional ext support in the
match structs, and GLX wishes it had either of the two.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20069>
2022-12-05 19:26:41 +00:00
Konstantin Seurer
b49e7cb3f4 radv: Add missing radeon_check_space() in radv_cmd_buffer_after_draw()
Also adds a missing assert that cdw <= cdw_max.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20149>
2022-12-05 17:19:01 +00:00
Konstantin Seurer
d86f60d21e radv: Use wave32 for ray queries inside compute shaders
Results in a 6% performance improvement with Quake II RTX.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20143>
2022-12-05 16:46:26 +00:00
Boyuan Zhang
712fcaba1f frontends/va: return proper error for unsupported profile
Return VA_STATUS_ERROR_UNSUPPORTED_PROFILE if given profile is not
supported for both decode and encode.

Return VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT if given profile is
supported (for at lease one of decode or encode), but current given
entrypoint is not supported.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20082>
2022-12-05 15:51:47 +00:00
Samuel Pitoiset
da32cbb5c6 aco: fix missing uses of MRT output flags
Fixes regressions on GFX6 and the RAGE2 workaround.

Fixes: a297ac10a4 ("radv,aco: stop lowering FS outputs in NIR")
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/20154>
2022-12-05 15:01:19 +00:00
Matt Coster
40f09f4e1c pvr: Add empty PDS program
This is a trivial program to accomplish allocation of local/common
store shared registers, used when no actual program is available or
required.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20130>
2022-12-05 14:46:07 +00:00
Matt Coster
46c2492a5d pvr: Add pvr_pds_compute_shader_program_init()
Some fields are to be initialized to a specific non-zero value if
unused; this inline function takes care of that.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20130>
2022-12-05 14:46:07 +00:00
Matt Coster
8c506c4b03 pvr: Use util_dynarray_append_dynarray()
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18904>
2022-12-05 13:29:43 +00:00
Samuel Pitoiset
b051719b05 radv: do not set ZPASS_INCREMENT_DISABLE on GFX11
This field no longer exists.

Cc: 22.3 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/20090>
2022-12-05 12:13:29 +01:00
Samuel Pitoiset
3ab9218820 radv: fix SPI_SHADER_Z_FORMAT for alpha-to-coverage via MRTZ on GFX11
It should select a 32-bit format with alpha.

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/20126>
2022-12-05 08:22:28 +00:00
Samuel Pitoiset
a297ac10a4 radv,aco: stop lowering FS outputs in NIR
This was a bad idea because:
- it diverges too much with the fragment shader epilog
- it doesn't allow to implement alpha-to-coverage via MRTZ correctly
- it was supposed to be used by LLVM but this never happened

Reverting this back allows us to fix alpha-to-coverage via MRTZ
on GFX11 easily, including for fragment shader epilogs.

fossils-db (NAVI21):
Totals from 20411 (15.13% of 134913) affected shaders:
VGPRs: 972056 -> 971400 (-0.07%); split: -0.08%, +0.01%
CodeSize: 92284804 -> 92295392 (+0.01%); split: -0.05%, +0.06%
MaxWaves: 465010 -> 465166 (+0.03%); split: +0.03%, -0.00%
Instrs: 17034162 -> 17034963 (+0.00%); split: -0.00%, +0.01%
Latency: 252013190 -> 251971764 (-0.02%); split: -0.03%, +0.02%
InvThroughput: 45859625 -> 45842556 (-0.04%); split: -0.04%, +0.01%
VClause: 324627 -> 324629 (+0.00%); split: -0.03%, +0.03%
SClause: 672918 -> 672826 (-0.01%); split: -0.05%, +0.04%
Copies: 1172126 -> 1158152 (-1.19%); split: -1.20%, +0.01%
Branches: 420602 -> 420604 (+0.00%); split: -0.00%, +0.00%
PreSGPRs: 1025441 -> 1025481 (+0.00%)
PreVGPRs: 861787 -> 860650 (-0.13%); split: -0.17%, +0.03%

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/20126>
2022-12-05 08:22:28 +00:00
Samuel Pitoiset
3be728f1d0 aco: fix indexing MRT0 alpha channel for alpha-to-coverage via MRTZ on GFX11
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/20126>
2022-12-05 08:22:28 +00:00
Samuel Pitoiset
20856bfe0f aco: always use 32-bit for exporting alpha-to-coverage via MRTZ on GFX11
16-bit isn't possible. Note that this is currently style broken for
compressed formats because the w channel is never written to.

Ported from RadeonSI ('radeonsi/gfx11: fix alpha-to-coverage with
stencil or samplemask export')

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/20126>
2022-12-05 08:22:28 +00:00
Samuel Pitoiset
664aa7a37b radv: fix emitting invalid color attachments
Note sure how this happened.

Fixes: 97dc28b177 ("radv: fix configuring COLOR_INVALID on GFX11")
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/20127>
2022-12-05 07:46:47 +00:00
Gert Wollny
64d584b8e4 r600/sfn: Silence warning for unused parameters in override
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20141>
2022-12-04 17:11:28 +00:00
Gert Wollny
d7393c6b9c r600/sfn: Allow more copy-propagation into TEX src
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20141>
2022-12-04 17:11:28 +00:00
Gert Wollny
1975d5eaf4 r600/sfn: use only as many components as needed for tex backend coord
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20141>
2022-12-04 17:11:28 +00:00
Gert Wollny
bcd9da1b38 r600/sfn: drop useless const specifier in return value
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20141>
2022-12-04 17:11:28 +00:00
Gert Wollny
0a0dc7c04b r600/sfn: simplify if clauses with empty then branch
nir_opt_if doesn't catch all the possible cases of empty then branches,
so resolve this on the fly when creating the backend IR.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20141>
2022-12-04 17:11:28 +00:00
Gert Wollny
d4dfae313e r600/sfn: legalize image acccess on Cayman
If we access non-existing images Cayman hardware may lock up
and trigger a reset that is not always successful. Therefore,
make sure the images access is legal.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20141>
2022-12-04 17:11:28 +00:00
Gert Wollny
fc75c1e07f r600/sfn: use three channels only for unary trans opts if possible
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20141>
2022-12-04 17:11:28 +00:00
Gert Wollny
71df6ba92d r600/sfn: lower-to-scalar in optimization loop
This makes sure that no vector ops are left over

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20141>
2022-12-04 17:11:28 +00:00
Gert Wollny
b47928043d r600/sfn: Fix scheduling with limited channel availability
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20141>
2022-12-04 17:11:28 +00:00
Gert Wollny
1f7d34b4a2 r600/sfn: Don't copy propagate using non-allocated dest channel
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20141>
2022-12-04 17:11:28 +00:00
Pavel Ondračka
ca0164f487 r300: improve conversion to native swizzles
Don't add extra movs to construct the swizzles, but just split the
instruction into separate channels, if possible. Idea by Filip Gawin.

shader-db for RV370:
total instructions in shared programs: 84632 -> 83565 (-1.26%)
instructions in affected programs: 12613 -> 11546 (-8.46%)
helped: 295
HURT: 8

total temps in shared programs: 12437 -> 12237 (-1.61%)
temps in affected programs: 1807 -> 1607 (-11.07%)
helped: 153
HURT: 20

LOST:   1
GAINED: 19

The HURT instructions and the single lost shaders are some fluctuations
from pair scheduling. The number of instructions before pair scheduling
is always lower or equivalent.

Partial fix for: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6339

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20009>
2022-12-04 15:38:26 +01:00
Pavel Ondračka
384fc52dd3 r300: doublecheck for free alpha source when coventing to alpha
For any instruction that can be reasonably converted to alpha we check
all of its readers to see if the conversion is possible (including check
for at least one free alpha source) at the beginning of pair scheduling.
However, if the reader instruction has multiples sources that could be
converted to alpha and multiple indeed are, than we could run of of the
alpha sources eventually. So recheck just before converting that there
are still some unused sources left.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20009>
2022-12-04 15:38:12 +01:00
Marek Olšák
eb9f17b309 radeonsi: fix a regression causing GPU hang with GLCTS using streamout
Move the streamout code into the streamout-only branch. The code must be
guarded by si_shader_uses_streamout(). Using xfb_stride is not enough.

Fixes: 003cbddfee - radeonsi: use native shader info when init streamout args

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20147>
2022-12-04 04:31:48 -05:00
Jan Alexander Steffens (heftig)
b513389400 dzn: Don't crash when libd3d12.so can't be found
`dzn_instance_create` will call `dzn_instance_destroy` when the d3d12
library fails to load. Just like the issue in `d3d12_screen`, this will
lead to a crash because `d3d12_mod` is NULL.

To fix this, only close the library after if it was actually opened.

Cc: mesa-stable
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20145>
2022-12-04 01:07:08 +00:00
Jan Alexander Steffens (heftig)
b3d1ae19f2 d3d12: Don't crash when libd3d12.so can't be found
`d3d12_destroy_screen` is called by `d3d12_create_dxcore_screen` after
`d3d12_init_screen_base` fails and attempts to call `util_dl_close` on
a NULL pointer, leading to an abort.

To fix this, only close the library after if it was actually opened.

Cc: mesa-stable
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20145>
2022-12-04 01:06:48 +00:00
Qiang Yu
55ffbf867b radeonsi: fix ngg lds base load intrinsic llvm implementation
Otherwise we get llvm assertion.

Fixes: 7e1b804992 ("radeonsi: implement two lds base load intrinsics")
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/20142>
2022-12-03 22:41:29 +08:00
Sviatoslav Peleshko
77ecf9149c anv: Defer flushing PIPE_CONTROL bits forbidden in CCS while in GPGPU mode
Fixes: 313aeee8 ("anv: Use pending pipe control mechanism in flush_pipeline_select()
")

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7816
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20124>
2022-12-03 00:10:32 +00:00
Jason Ekstrand
cd5c66e165 dxil: Use nir_const_value_for_uint in dxil_nir_lower_int_samplers
This change should avoid any accidental rounding issues because of
border colors getting stored in a float in dxil_wrap_sampler_state.  It
also switches us to using the correct helpers for nir_const_value so we
can avoid any weird uninitialized data failures that can be caused by
filling out the fields in the struct directly.

Fixes: b9c61379ab ("microsoft/compiler: translate nir to dxil")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19689>
2022-12-02 23:12:30 +00:00
Jason Ekstrand
f3f1c28f8e r600/nir: Fix u64vec2 immediate lowering
There were a couple of issues here:

 1. We should be using nir_const_value_for_uint instead of setting the
    union fields directly to ensure the rest of the union is zeroed.

 2. It was always filling out the first two components of val even if
    the incoming constant had 2 64-bit components.

Fixes: 165fb5117b ("r600/sfn: add lowering passes to get 64 bit ops lowered to 32 bit vec2")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19689>
2022-12-02 23:12:30 +00:00
Jason Ekstrand
49d86200e5 st/mesa: Use nir_const_value_for_bool() in ATIFS
Fixes: 0a179bb6e2 ("st/mesa: Generate NIR for ATI_fragment_shader instead of TGSI.")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19689>
2022-12-02 23:12:30 +00:00
Jason Ekstrand
e6de164e03 nir: Use nir_const_value_for_int in nir_lower_subgroups
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7670
Fixes: e4e79de2a4 ("nir/subgroups: Support > 1 ballot components")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19689>
2022-12-02 23:12:30 +00:00
Konstantin Seurer
ef168a57b9 llvmpipe: Use get_first_non_void_channel more often
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18634>
2022-12-02 22:06:11 +00:00
Konstantin Seurer
c94e3687d1 virgl: Use get_first_non_void_channel more often
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18634>
2022-12-02 22:06:11 +00:00
Konstantin Seurer
9d4172f548 radeonsi: Use get_first_non_void_channel more often
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18634>
2022-12-02 22:06:11 +00:00
Konstantin Seurer
cc8b398c96 r600: Use get_first_non_void_channel more often
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18634>
2022-12-02 22:06:11 +00:00
Konstantin Seurer
9a452a97d9 r300: Use get_first_non_void_channel more often
Reviewed-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18634>
2022-12-02 22:06:11 +00:00
Konstantin Seurer
ad8de42ce5 radv: Use get_first_non_void_channel more often
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18634>
2022-12-02 22:06:11 +00:00
Yiwei Zhang
c2fdd6a2c2 venus: add VN_PERF_NO_CMD_BATCHING
Make it easier to debug object lifetime issues in Venus.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19830>
2022-12-02 21:42:25 +00:00
Yiwei Zhang
739b20beda venus: fix draw cmd batch accounting
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19830>
2022-12-02 21:42:25 +00:00
Yiwei Zhang
ea7c2d3d94 venus: add VN_PERF_NO_MEMORY_SUBALLOC
Make it easier for memory alignment debugging.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19830>
2022-12-02 21:42:25 +00:00
Yiwei Zhang
bda80458f9 venus: avoid no_async_buffer_create related caches with the perf option
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19830>
2022-12-02 21:42:25 +00:00
Konstantin Seurer
6397304519 radv: Only create bvh pipelines when using rt
Saves some time when creating non-rt devices.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20110>
2022-12-02 21:14:00 +00:00
Konstantin Seurer
f89708c2c5 vulkan: Use vk_image_sanitize_extent
We set the image type before the extend which allows us to use
vk_image_sanitize_extent.

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/20112>
2022-12-02 20:46:33 +00:00
Jesse Natalie
8d8188ec59 microsoft/clc: Add a test for nested function-temp arrays
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20111>
2022-12-02 09:53:09 -08:00
Jesse Natalie
88b2c2a5ca microsoft/compiler: Handle nested arrays correctly for emitting global consts
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20111>
2022-12-02 09:53:09 -08:00
Jesse Natalie
d4c70e483d compiler: Handle nested arrays correctly for computing CL size/alignment
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20111>
2022-12-02 09:52:44 -08:00
Jesse Natalie
4a976d371b gallium/u_debug_flush: Fix incompatible function signature warnings
Looks like an MSVC update started complaining that pipe_error is
no longer a compatible return type for function pointers that are
supposed to be int.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20102>
2022-12-02 17:15:30 +00:00
Konstantin Seurer
7fe515f6d4 radv/rra: Get rid of annoying memory aliasing warning
Such cursed behavior is almost non existent in practise. When capturing
a Doom Eternal, this warning spams the output for no reason.

The warning is also unnecessary since we copy acceleration structures
right after building them now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20047>
2022-12-02 16:48:07 +00:00
Konstantin Seurer
e2b7e478a5 radv/rra: Fix setting some offsets
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20047>
2022-12-02 16:48:07 +00:00
Konstantin Seurer
79dcacfc04 radv/rra: Refactor rra_fill_accel_struct_header_common
No need to re-do the offset calculation for every field.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20047>
2022-12-02 16:48:07 +00:00
Konstantin Seurer
bb6b45e26e radv/rra: Set the metadata size correctly
Fixes: 5749806 ("radv: Add Radeon Raytracing Analyzer trace dumping utilities")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20047>
2022-12-02 16:48:07 +00:00
Konstantin Seurer
0e3325dfb6 radv/rra: Remove an obsolete comment
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20047>
2022-12-02 16:48:07 +00:00
Konstantin Seurer
94ec359ae5 radv/rra: Defer destroying accel struct data
This allows us to dump acceleration structures that were destroyed
before present.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20047>
2022-12-02 16:48:07 +00:00
Konstantin Seurer
ae9c65a552 radv/rra: Copy accel structs directly after build
This is the second step of decoupling acceleration structure dumping
from lifetimes. It also simplifies the logic a bit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20047>
2022-12-02 16:48:07 +00:00
Konstantin Seurer
08a85076e5 radv/rra: Introduce radv_rra_accel_struct_data
This will be useful for dumping acceleration structures that were
destroyed before submit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20047>
2022-12-02 16:48:07 +00:00
Konstantin Seurer
ff3ba5c74d radv: Add hash_table_foreach to .clang-format
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20047>
2022-12-02 16:48:07 +00:00
Pedro J. Estébanez
b2c4338862 microsoft/spirv_to_dxil: Properly handle load- and is_helper_invocation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19908>
2022-12-02 16:29:13 +00:00
Karol Herbst
e22491c832 clc: fetch clang resource dir at runtime
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19617>
2022-12-02 15:38:44 +00:00
Karol Herbst
cd2609b12c clc: generate sources only with with_microsoft_clc
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19617>
2022-12-02 15:38:44 +00:00
Danylo Piliaiev
5d025f4003 nir/nir_opt_offsets: Prevent offsets going above max
In try_fold_load_store when trying to extract const addition from
non-const offset source, we should take into account that there is
already a constant base offset, which should count towards the limit.

The issue was found in "Monster Hunter: World" running on Turnip.

Fixes: cac6f633b2
("nir/opt_offsets: Use nir_ssa_scalar to chase offset additions.")

Well, the issue was present before this commit but it made a lot
of changes in surrounding code.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20099>
2022-12-02 15:04:52 +00:00
David Heidelberg
f7e76eee28 ci/amd: re-enable previously OOM tests
Since we have ZRAM now, we can enable previously failing tests on OOM.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19535>
2022-12-02 13:51:15 +00:00
David Heidelberg
3e80c5f1ec ci/kernel: enable ZRAM on all archs
Let's enable ZRAM with 2G. Should help prevent peak OOM scenarios.

For more info see: https://www.kernel.org/doc/html/latest/admin-guide/blockdev/zram.html

Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19535>
2022-12-02 13:51:15 +00:00
Bas Nieuwenhuizen
89663828ea aco: Don't use v_lshrrev_b64 for moves on GFX11.
Looking at VOPD things, shifts are not very likely to get dual issued
but plain moves are. Looking at RDNA2 v_lshrrev_b64 are half the perf
of v_mov_b32 (but you need twice as many moves), so on GFX11 this likely
reaches the threshold where moves are faster.

Totals from 68400 (50.70% of 134906) affected shaders:

CodeSize: 275489516 -> 275459536 (-0.01%); split: -0.01%, +0.00%
Instrs: 51775474 -> 51991286 (+0.42%)
Latency: 589884847 -> 589066439 (-0.14%); split: -0.15%, +0.01%
InvThroughput: 127154986 -> 126037619 (-0.88%); split: -0.88%, +0.00%
Copies: 3756157 -> 3976193 (+5.86%)
Branches: 1259604 -> 1260072 (+0.04%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19633>
2022-12-02 13:25:57 +00:00
Bas Nieuwenhuizen
91fe2a2361 aco: Use more detailed wave64 timing for GFX10+.
Also nabbed some dual issue stuff for GFX11 from LLVM.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19633>
2022-12-02 13:25:57 +00:00
Eric Engestrom
09caa570b1 docs: update calendar and link releases notes for 22.3.0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20129>
2022-12-02 12:17:41 +00:00
Eric Engestrom
9d665ae439 docs: add release notes for 22.3.0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20129>
2022-12-02 12:17:41 +00:00
David Heidelberg
5797af2d8d Revert "ci: disable Collabora's LAVA lab for maintance"
This reverts commit 3964a77454.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20128>
2022-12-02 12:25:16 +01:00
Qiang Yu
2fb1097bac ac/nir/ngg: merge multi stream gs shader queries
Before this commit each stream will emit a query block, now
we merge them to a single block.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20074>
2022-12-02 09:38:07 +00:00
Lionel Landwerlin
b7b91ae51e anv: enable VK_KHR_ray_tracing_maintenance1
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20011>
2022-12-02 09:28:23 +00:00
Lionel Landwerlin
d844fa4def anv: implement new queries for VK_KHR_ray_tracing_maintenance1
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20011>
2022-12-02 09:28:23 +00:00
Lionel Landwerlin
4d05be49c2 anv: implement vkCmdTraceRaysIndirect2KHR
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20011>
2022-12-02 09:28:23 +00:00
Lionel Landwerlin
675c5bd4cc anv: refactor ray tracing dispatch
Preparing for vkCmdTraceRaysIndirect2KHR

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20011>
2022-12-02 09:28:23 +00:00
Lionel Landwerlin
df38426072 intel/rt/nir: add support for RayCullMaskKHR
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20011>
2022-12-02 09:28:23 +00:00
Lionel Landwerlin
6202a2c6b4 intel/rt/nir: enable the trampoline shader to load the indirect ray shader bsr
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20011>
2022-12-02 09:28:23 +00:00
Lionel Landwerlin
af3f7948d1 anv: correctly predicate ray tracing
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 7479fe6ae0 ("anv: Implement vkCmdTraceRays and vkCmdTraceRaysIndirect")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20011>
2022-12-02 09:28:23 +00:00
Lionel Landwerlin
7d7c32de4c anv/genxml: make gen_rt more like other genxml files
The main goal is to be able to generate genX_bits.h for those
structures so we can get generated field offsets.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20011>
2022-12-02 09:28:23 +00:00
Lionel Landwerlin
8baacba4d6 hasvk: remove coarse pixel checks
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/19852>
2022-12-02 09:18:17 +00:00
Jason Ekstrand
2d150f3ecd hasvk: Drop more DG2 code
v2: remove unused devinfo (Lionel)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19852>
2022-12-02 09:18:17 +00:00
Jason Ekstrand
d0fea83d7b hasvk: Rip out local memory support
Things could probably be simplified further but this at least gets rid
of most of the dead code and the dead flags and fields.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19852>
2022-12-02 09:18:17 +00:00
Jason Ekstrand
4256d2cbc2 hasvk: Rip out scratch surfaces
These are a DG2+ thing

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19852>
2022-12-02 09:18:17 +00:00
Jason Ekstrand
eea49c7d32 hasvk: Drop SKL+ features
Most of these have already had all the code removeed.  We just need to
remove the feature bits and queries.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19852>
2022-12-02 09:18:17 +00:00
Jason Ekstrand
b71ac720a8 hasvk: Drop support for atomic_int64 and atomic_float2
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19852>
2022-12-02 09:18:17 +00:00
Jason Ekstrand
49201fe8c1 hasvk: Drop bindless image support
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19852>
2022-12-02 09:18:17 +00:00
Jason Ekstrand
7b700369b1 hasvk: Drop A64 descriptor set support
It's only used by task/mesh and ray-tracing.  Also drop a couple
remaining ray query things and a task/mesh we left behind.

v2: Fix incorrect use of nir_load_desc_set_address_intel (Lionel)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19852>
2022-12-02 09:18:17 +00:00
Jason Ekstrand
85cfa21e04 hasvk: Drop remnants of ray queries
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19852>
2022-12-02 09:18:17 +00:00
Jason Ekstrand
e490434479 hasvk: Drop CCS_E support
Oh, for the days of Broadwell and earlier where compression was called
fast-clear.  That was a simpler time.  The birds sang in the trees, the
oceans weren't brown from oil spills, and Intel surface compression was
actually comprehendable by humans.  To help the reviewer, keep the
following in mind:

 1. CCS_E is SKL+
 2. Implicit CCS is TGL+
 3. The AUX TT (AKA aux map) is TGL+
 4. HIZ+CCS, stencil CCS, and CCS for storage images are all TGL+
 4. CCS_D surfaces only ever get full resolves and MCS surfaces only
    ever get partial resolves

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19852>
2022-12-02 09:18:17 +00:00
Jason Ekstrand
5f1dbd80b3 hasvk: Rip out primitive replication
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19852>
2022-12-02 09:18:17 +00:00
Jason Ekstrand
7f97cd04c9 hasvk: Rip out remaining traces of CPS/FSR
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19852>
2022-12-02 09:18:17 +00:00
Jason Ekstrand
90aab6e9a5 hasvk/gpu_memcpy: Rip out SKL+
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19852>
2022-12-02 09:18:16 +00:00
Jason Ekstrand
6d80ce1283 hasvk/state: Rip out SKL+
v2: Fix incorrectly removed l3cr.SLMEnable setting (Lionel)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19852>
2022-12-02 09:18:16 +00:00
Jason Ekstrand
ce57cc4397 hasvk/blorp: Rip out SKL+
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19852>
2022-12-02 09:18:16 +00:00
Jason Ekstrand
cc68b7cd94 hasvk/pipeline: Rip out SKL+
v2: Fix incorrect DispatchMode removal (Lionel)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19852>
2022-12-02 09:18:16 +00:00
Jason Ekstrand
91090e39af hasvk/cmd_buffer: Rip out SKL+ support
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19852>
2022-12-02 09:18:16 +00:00
Lionel Landwerlin
0626b68c88 isl: don't report I915_FORMAT_MOD_Y_TILED_CCS on Gfx8
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19852>
2022-12-02 09:18:16 +00:00
Sergi Blanch Torne
3964a77454 ci: disable Collabora's LAVA lab for maintance
This is to inform you of some planned downtime in the LAVA lab as follows:
    Start: 2022-12-02 08:00 GMT
    End: 2022-12-02 12:00 GMT

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20103>
2022-12-02 08:06:15 +00:00
Qiang Yu
6c44d92362 ac/llvm,radeonsi: lower attribute ring intrinsics in nir
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/18010>
2022-12-02 07:34:32 +00:00
Qiang Yu
daaa8ddb8e ac/llvm,radeonsi: lower nir primitive counter add intrinsics
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/18010>
2022-12-02 07:34:31 +00:00
Qiang Yu
bb837bf6ef nir,ac/llvm: add nir_buffer_atomic_add_amd
Used by radeonsi for lower nir_atomic_add_gen/xfb_prim_count_amd.

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/18010>
2022-12-02 07:34:31 +00:00
Qiang Yu
7cec2e7520 ac/llvm,radeonsi: lower nir_load_streamout_buffer_amd
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/18010>
2022-12-02 07:34:31 +00:00
Qiang Yu
daf5d30b59 ac/llvm,radeonsi: lower nir_load_user_clip_plane in abi
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/18010>
2022-12-02 07:34:31 +00:00
Qiang Yu
84abc307a5 ac/llvm: remove lowered abi->intrinsic_load() intrinsics
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/18010>
2022-12-02 07:34:31 +00:00
Qiang Yu
2a5fcf42c9 radeonsi: remove si_llvm_load_intrinsic intrinsics lowered
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/18010>
2022-12-02 07:34:31 +00:00
Qiang Yu
a5bd39c7ed radeonsi: add si_nir_lower_abi pass
This pass is for lower intrinsics to driver spec nir instructions,
so that each compiler backend don't need to implement their own.
Like radv_nir_lower_abi().

Currently only lower intrinsics in si_llvm_load_intrinsic().

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/18010>
2022-12-02 07:34:31 +00:00
Qiang Yu
e9f08d8193 ac/nir: add ac_nir_unpack_arg
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/18010>
2022-12-02 07:34:31 +00:00
Qiang Yu
8030fbcf16 nir,ac/llvm: add nir_load_smem_buffer_amd
Used by radeonsi to load const buffer.

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/18010>
2022-12-02 07:34:31 +00:00
Qiang Yu
73ea7d651a ac/llvm: nir_load_smem_amd support 32bit base address
For radeonsi which use 32bit address in ac_build_load_to_sgpr().

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/18010>
2022-12-02 07:34:31 +00:00
Qiang Yu
0007c10c1e radeonsi: separate shader args from llvm
Move shader args out of llvm context, so that we can init
it before get nir. This is for creating a nir lower abi pass
which load args directly in nir.

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/18010>
2022-12-02 07:34:31 +00:00
Qiang Yu
003cbddfee radeonsi: use native shader info when init streamout args
We are going to init shader args earlier, there is no such
pipe_stream_output_info when that time.

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/18010>
2022-12-02 07:34:31 +00:00
Alyssa Rosenzweig
c445c29263 asahi: Use PIPE_CAP_VERTEX_ATTRIB_ELEMENT_ALIGNED_ONLY
The hardware only supports aligned loads and stores. That applies to vertex
buffer loads as well. As such, we need to ensure that the base address of vertex
buffers, the stride, and the offset are all aligned to the vertex buffer format,
ensuring that the load itself is aligned. Mesa has a CAP for that,
PIPE_CAP_VERTEX_ATTRIB_ELEMENT_ALIGNED_ONLY, which ensures that these conditions
are met and will rewrite a vertex buffer on the CPU in the off chance that
they're not.

This is a bug fix compared to the old code, because it requires that offsets and
base addresses are aligned (not just the strides like before). It's also an
optimization compared to the old code, because it does not require 4 byte
alignment for 8-bit and 16-bit formats. In fact, it doesn't require any
alignment for 8-bit formats. This will avoid needless CPU work for smaller
formats.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19996>
2022-12-02 06:25:20 +00:00
Alyssa Rosenzweig
8dcf7648f1 agx: Lower VBOs in NIR
Now we support all the vertex formats! This means we don't hit u_vbuf for format
translation, which helps performance in lots of applications. By doing the
lowering in NIR, the vertex fetch code itself can be optimized by NIR (e.g.
nir_opt_algebraic) which can improve generated code quality.

In my first implementation of this, I had a big switch statement mapping format
enums to interchange formats and post-processing code. This ends up being really
unwieldly, the combinatorics of bit packing + conversion + swizzles is
enormous and for performance we want to support everything (no u_vbuf
fallbacks). To keep the combinatorics in check, we rely on parsing the
util_format_description to separate out the issues of bit packing, conversion,
and swizzling, allowing us to handle bizarro formats like B10G10R10A2_SNORM with
no special casing.

In an effort to support everything in one shot, this handles all the formats
needed for the extensions EXT_vertex_array_bgra, ARB_vertex_type_2_10_10_10_rev,
and ARB_vertex_type_10f_11f_11f_rev.

Passes dEQP-GLES3.functional.vertex_arrays.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19996>
2022-12-02 06:25:20 +00:00
Alyssa Rosenzweig
fb49715a2c agx: Lower UBOs in NIR
Simpler than lowering in the backend and makes the sysvals obvious in the NIR.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19996>
2022-12-02 06:25:20 +00:00
Alyssa Rosenzweig
6b4ed663a8 agx: Implement 8-bit sign extensions
Long term, I think having i2i16 and i2i32 available with 8-bit sources should
make lowering the rest of 8-bit away a bit easier. Short term, this avoids
special casing 8-bit in the VBO lowering code.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19996>
2022-12-02 06:25:20 +00:00
Alyssa Rosenzweig
8127737c1e agx: Allow some 8-bit sources
8-bit sources are useful for int8->float32 conversions, which we can do in a
single hardware instruction.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19996>
2022-12-02 06:25:20 +00:00
Alyssa Rosenzweig
ba209fe493 agx: Implement formatted loads
These will be generated by the UBO and VBO lowerings. (and eventually by other
lowerings too?)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19996>
2022-12-02 06:25:20 +00:00
Alyssa Rosenzweig
580f25a266 agx: Add shift to device_load
We'll use this as an optimization soon. This acts in addition to the format's
shift.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19996>
2022-12-02 06:25:20 +00:00
Alyssa Rosenzweig
19a0db31eb asahi: Use NIR_PASS_V for agx_nir_lower_tilebuffer
This ensures that printing shaders before and after the NIR pass still works
with the standard NIR debug options.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19996>
2022-12-02 06:25:20 +00:00
Alyssa Rosenzweig
0af08acca5 nir: Add intrinsics for lowering UBOs/VBOs on AGX
We'll use formatted loads and some system values to lower UBOs and VBOs to
global memory in NIR, using the AGX-specific format support and addressing
arithmetic to optimize the emitted code.

Add the intrinsics and teach nir_opt_preamble how to move them so we don't
regress UBO pushing.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19996>
2022-12-02 06:25:20 +00:00
Lionel Landwerlin
a855bdbf47 intel/nir/rt: switch to workgroup_id_zero_base
RT don't use a base workgroup id so no reason of using workgroup_id.
Additionally the lowering introduced in b4dd3df227 requires something
provides base_workgroup_id which we don't have for RT as it's not
needed.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: b4dd3df227 ("intel/nir: Set has_base_workgroup_id for lower_compute_system_values")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7812
Reviewed-by: Mark Janes <markjanes@swizzler.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20115>
2022-12-02 05:25:22 +00:00
Qiang Yu
da4f49d0ad radeonsi: cleanup si_llvm_build_vs_exports gfx11 code
It's now completely handled in ac_nir_lower_ngg.c
export_vertex_params_gfx11.

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/17109>
2022-12-02 04:37:23 +00:00
Qiang Yu
9b2ec290c4 ac/llvm: remove unused llvm cull
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/17109>
2022-12-02 04:37:23 +00:00
Qiang Yu
f758ffccb8 radeonsi: remove unused ngg llvm code
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/17109>
2022-12-02 04:37:23 +00:00
Qiang Yu
853436bacd radeonsi: replace llvm ngg gs with nir lowering
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/17109>
2022-12-02 04:37:23 +00:00
Qiang Yu
028d0590f8 radeonsi: replace llvm ngg vs/tes with nir lowering
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/17109>
2022-12-02 04:37:23 +00:00
Qiang Yu
3542d5ce6b radeonsi: fix NGG VS primitive ID load
When NGG VS need to export primitive ID, it will load it in GS
threads, so need to use gs_prim_id arg. Current nir to llvm
translator check vs_prim_id present to use vs_prim_id first.

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/17109>
2022-12-02 04:37:23 +00:00
Qiang Yu
7e1b804992 radeonsi: implement two lds base load intrinsics
LDS will be accessed starting from esgs_ring which has offset 0.
So ngg_scratch and ngg_emit base address is just the offset from
the esgs_ring base.

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/17109>
2022-12-02 04:37:23 +00:00
Qiang Yu
7bc56911f8 radeonsi: implement export_vertex abi
Used by ngg lower.

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/17109>
2022-12-02 04:37:23 +00:00
Qiang Yu
6cbb6e6397 radeonsi: implement nir_intrinsic_load_provoking_vtx_in_prim_amd
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/17109>
2022-12-02 04:37:23 +00:00
Qiang Yu
3c1ebebeae radeonsi: use nir_lower_gs_intrinsics
Replace some llvm code.

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/17109>
2022-12-02 04:37:23 +00:00
David Heidelberg
224e9ce4a8 ci/zink: add missing spec@!opengl 1.1@masked-clear flake
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20119>
2022-12-02 03:16:31 +00:00
Giancarlo Devich
d3753aa336 wgl: Fix build break when LLVMPIPE and SOFTPIPE are both off
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20114>
2022-12-02 02:12:06 +00:00
David Heidelberg
5f94c36960 ci/cross: switch from the debcrossgen to the meson env2mfile
Modern Debian recommends to use `meson env2mfile` rather than `debcrossgen`:
```
WARNING: this tool is deprecated, use "meson env2mfile" instead.
```

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

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19863>
2022-12-02 00:33:10 +00:00
David Heidelberg
733498a4eb ci/arm_build: follow x86 and install newer Meson
This allows us utilize meson env2mfile.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19863>
2022-12-02 00:33:10 +00:00
David Heidelberg
9f551e4829 ci/meson: bump to 0.63.3
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19863>
2022-12-02 00:33:10 +00:00
David Heidelberg
0e7de16884 ci/x86: Remove meson from apt when we later install it with pip
But install Ninja, which is needed.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19863>
2022-12-02 00:33:10 +00:00
David Heidelberg
4ada7f0239 ci: CI should handle also arrays in meson cross-file
The new meson env2mfile generates everything in the arrays.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19863>
2022-12-02 00:33:10 +00:00
Eric Engestrom
43eab9252e meson: sort drivers alphabetically in any-of checks
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19977>
2022-12-01 23:53:08 +00:00
Eric Engestrom
5479234d45 meson: make long any-of checks easier to read and to update
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19977>
2022-12-01 23:53:08 +00:00
Eric Engestrom
8140eca23b meson: replace deprecated meson.get_cross_property(...) with meson.get_external_property(...)
According to the deprecation note:
> It's a pure subset of meson.get_external_property, and works strangely
> in host == build configurations, since it would be more accurately
> described as get_host_property.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19904>
2022-12-01 22:09:55 +00:00
Rhys Perry
9b6ab40b3b aco: improve do_pack_2x16() with zero constants
We can skip the v_or_b32 or use an instruction smaller than
v_alignbyte_b32.

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/19933>
2022-12-01 21:43:28 +00:00
Rhys Perry
917cfd587c aco: use v_minmax/v_maxmin opcodes
fossil-db (gfx1100):
Totals from 29868 (22.12% of 135032) affected shaders:
MaxWaves: 741336 -> 741344 (+0.00%)
Instrs: 34624902 -> 34539766 (-0.25%); split: -0.25%, +0.00%
CodeSize: 187196804 -> 187192100 (-0.00%); split: -0.01%, +0.01%
VGPRs: 1816860 -> 1816788 (-0.00%); split: -0.01%, +0.01%
Latency: 502597202 -> 502245627 (-0.07%); split: -0.08%, +0.01%
InvThroughput: 84813176 -> 84586122 (-0.27%); split: -0.28%, +0.01%
VClause: 633826 -> 633749 (-0.01%); split: -0.02%, +0.01%
SClause: 1317738 -> 1317047 (-0.05%); split: -0.06%, +0.01%
Copies: 2130610 -> 2130954 (+0.02%); split: -0.03%, +0.05%
Branches: 766093 -> 765969 (-0.02%); split: -0.02%, +0.00%
PreSGPRs: 1630250 -> 1630034 (-0.01%); split: -0.02%, +0.00%
PreVGPRs: 1590777 -> 1590664 (-0.01%); split: -0.01%, +0.00%

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/19933>
2022-12-01 21:43:28 +00:00
Rhys Perry
dfbc8e0192 aco: change order in combine_minmax()
Prepare for future optimizations.

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/19933>
2022-12-01 21:43:28 +00:00
Rhys Perry
ce5838599d aco/gfx11: use v_cvt_i32_i16/v_cvt_u32_u16
fossil-db (gfx1100):
Totals from 52753 (39.07% of 135032) affected shaders:
CodeSize: 153603860 -> 153163384 (-0.29%)

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/19933>
2022-12-01 21:43:28 +00:00
Danylo Piliaiev
8f0177b334 ir3: Reduce the maximum allowed imm offset for shared var load/store
STL/LDL have 13 bits to store imm offset. However the most significant
bit in the offset is a sign bit, so the positive offset is limited by
12 bits.

nir_opt_offsets only has the upper limit and doesn't deal with
negative offsets, so shared_max should be changed to `(1 << 12) - 1`.

The issue was found in "Monster Hunter: World".

Fixes: 0b2da9d795
("ir3: Limit the maximum imm offset in nir_opt_offset for shared vars")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20100>
2022-12-01 18:52:01 +00:00
Connor Abbott
96ec79c7e3 tu: Don't prefetch descriptors for inline uniforms
This could result in hangs if the entire descriptor set was inline
uniforms. Fixes
dEQP-VK.binding_model.descriptorset_random.sets4.dynindexed.ubolimitlow.nosbo.nosampledimg.outimgonly.iublimitlow.nouab.comp.noia.0
after 0a0a04bd made us prefetch descriptors again and uncovered this.

Fixes: 37cde2c6 ("tu: Rewrite inline uniform implementation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20101>
2022-12-01 18:28:05 +00:00
Jasber Chen
1d3cb3f188 frontends/va: partially updating RefPicList depends on slice type
problem casused by one frame with multiple slices and different slices type.
Invalid referenced values came from slice P/I would overwrite previous update.

Signed-off-by: Jasber Chen <yipeng.chen@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19943>
2022-12-01 18:14:23 +00:00
Chia-I Wu
c0346ac170 Revert "freedreno/a6xx: Remove unneeded MSAA clear fallback"
This reverts commit ded82cf4bd and fixes

$ deqp-gles31 --deqp-gl-config-name=rgba8888d24s8ms4 \
    -n dEQP-GLES31.functional.primitive_bounding_box.depth.*

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20085>
2022-12-01 17:35:42 +00:00
Samuel Pitoiset
ab7f518ed0 radv,driconf: fix static driconf by parsing 00-radv-defaults.conf
Otherwise when xmlconfig is disabled, drirc workarounds aren't applied
with RADV.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7785
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20077>
2022-12-01 16:55:31 +00:00
Samuel Pitoiset
60ff0df39b driconf: add support for multiple input files in the static script
RADV has its own drirc file and this is required to fix the static
driconf path.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20077>
2022-12-01 16:55:31 +00:00
Jordan Justen
686ada78cd intel/dev: Add (disabled) device info for MTL
Reworks:
 * Jordan: INTEL_PLATFORM_MTL_M/INTEL_PLATFORM_MTL_P
 * Lionel: .has_coarse_pixel_primitive_and_cb
 * Jordan: .has_mesh_shading & .has_ray_tracing
 * Paulo: .has_64bit_float
 * José: .has_integer_dword_mul (BSpec: 47431)
 * Jordan: Comment pci device ids for now similar to DG2:
   * 70a4e64685 ("intel: Add *disabled* device ids for DG2")
   * ad565f6b70 ("intel/dev: Enable first set of DG2 PCI IDs")

Ref: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/drm/i915_pciids.h?h=v6.0-rc4#n736
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19658>
2022-12-01 16:22:47 +00:00
Matt Coster
d5740d85c4 pvr: debug: Print hexdump at the end of all sub buffers
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20040>
2022-12-01 15:05:59 +00:00
Matt Coster
b530a6b055 pvr: debug: Add option to zero-alloc all buffer objects
This is designed for use by the control stream dump debug option, but
can also be used any time deterministic buffer state is desired.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20040>
2022-12-01 15:05:59 +00:00
Matt Coster
eb44597c2c pvr: debug: Print hexdump for referenced buffers with unknown encoding
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20040>
2022-12-01 15:05:59 +00:00
Matt Coster
49bdc7f7f7 pvr: debug: Add offset address field type for dumps
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20040>
2022-12-01 15:05:59 +00:00
Matt Coster
e05b32d00c pvr: debug: Include hexdump after each block in control stream dump
This makes it easier to quickly identify the raw words associated with
decoded values.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20040>
2022-12-01 15:05:59 +00:00
Matt Coster
14c0f3de4c pvr: debug: Enhancements to hex dumps
Contains the following enhancements & fixes:
 - Increase (decrease?) the granularity to single bytes rather than
   using an arbitrary word size,
 - Remove some spurious semicolons at the end of macros, and
 - Do not collapse sections of zero bytes that consist of only a single
   line.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20040>
2022-12-01 15:05:59 +00:00
Karmjit Mahil
0009b37bf1 pvr: Remove a todo in vkCmdEndRenderPass2().
The first end_sub_cmd() is to make sure that we end the last sub_cmd.
The end_sub_cmd() in pvr_resolve_unemitted_resolve_attachments() makes
sure that we end any transfer sub_cmds created in there.

Suggested-by: Frank Binns <frank.binns@imgtec.com>
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/19957>
2022-12-01 14:55:55 +00:00
Karmjit Mahil
e89be067b3 pvr: Replace sub_cmd flags with bools within each sub_cmd type.
This commit remove:
 - PVR_SUB_COMMAND_FLAG_TRANSFER_SERIALIZE_WITH_FRAG.
 - PVR_SUB_COMMAND_FLAG_OCCLUSION_QUERY.

The first flag was specific to transfer sub commands and the last
one, for graphics ones. Now we just have a bool in the transfer
sub_cmd, and one in the graphics sub_cmd.

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/19957>
2022-12-01 14:55:55 +00:00
Karmjit Mahil
8c9217e4d8 pvr: Handle PVR_SUB_COMMAND_FLAG_OCCLUSION_QUERY.
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/19957>
2022-12-01 14:55:55 +00:00
Karmjit Mahil
904a3c4dd7 pvr: Handle PVR_SUB_COMMAND_FLAG_TRANSFER_SERIALIZE_WITH_FRAG.
The flag was previously named PVR_SUB_COMMAND_FLAG_WAIT_ON_PREVIOUS_FRAG.
Since the next fragment job is also made to wait for the transfer
job to complete, the previous name might have been a bit misleading.

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/19957>
2022-12-01 14:55:55 +00:00
Iago Toral Quiroga
4276ec9f2a v3dv: fix job serialization for single sync path
The idea in the single sync path is that we serialize any job that
needs to wait, however, our ANY queue syncobj only tracks the last job
submitted to any hardware queue, so in practice when we wait on this
we are only serializing against the queue to which we have submitted
the last job, which is not correct.

Fix that by accumulating the last job sync into the ANY queue synbcobj
to ensure that waiting on this syncobj effectively waits on all
hardware queues.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20078>
2022-12-01 14:08:56 +00:00
Iago Toral Quiroga
95b9293eeb v3dv: make single-sync paths more explicit
Instead of having functions that return early in multi-sync mode
let's only call them when we are in single-sync mode. I think this
makes the code more explicit.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20078>
2022-12-01 14:08:56 +00:00
Boris Brezillon
93c084a99b panfrost: Add NATIVE_FENCE_FD cap
Add support for NATIVE_FENCE_FD so panfrost can advertise support for
EGL_ANDROID_native_fence_sync.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19774>
2022-12-01 13:52:05 +00:00
Boris Brezillon
8910533a5a panfrost: Move fence code to pan_fence.{c,h}
Before adding support for NATIVE_FENCE_FD, let's move the fencing logic
to a dedicated file to avoid spreading the code in different places.

Suggested-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19774>
2022-12-01 13:52:05 +00:00
Boris Brezillon
3bd0f5c502 panfrost: Destroy panfrost_context::syncobj in the ctx desctruction path
Destroy panfrost_context::syncobj in the ctx desctruction path so we
don't leak a sync object.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19774>
2022-12-01 13:52:05 +00:00
Qiang Yu
076a333d40 ac/nir/ngg: rename nogs 16bit output mask and var
To represent 16bit outputs more clearly.

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/19697>
2022-12-01 13:10:35 +00:00
Qiang Yu
abe2e99e9e ac/nir/ngg: gs support 16bit outputs
radeonsi uses 16bit varying slots.

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/19697>
2022-12-01 13:10:35 +00:00
Qiang Yu
68519891a7 ac/nir/ngg: gs skip check bit size before nir_u2u
nir_u2u do for us.

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/19697>
2022-12-01 13:10:35 +00:00
Qiang Yu
d3e20e8834 ac/nir/ngg: gs store output use src_type index for type info
More precise type info, can be used for 16bit output streamout
to convert 16bit int/uint/float to 32bit one later.

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/19697>
2022-12-01 13:10:35 +00:00
Qiang Yu
0cb5ea512f ac/nir/ngg: gs use u_foreach_bit64 to loop all output slots
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/19697>
2022-12-01 13:10:35 +00:00
Qiang Yu
13b75594d7 ac/nir/ngg: reduce nogs 16bit output gather space
Max slot number for 16bit output is 16, so no need to use
64 array size for them.

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/19697>
2022-12-01 13:10:35 +00:00
Jason Ekstrand
b67fdcdfbc util/dynarray: Add an append_array helper
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19685>
2022-12-01 12:26:27 +00:00
Marcin Ślusarz
db0e6f9a07 intel/compiler: user payload starts after TUE header & its padding
All data written by the user are offset by TUE header size.
Without this patch we copy the correct amount of user data, but both
"from" and "to" offsets are wrong.

Fixes: 37e78803d7 ("intel/compiler: use nir_lower_task_shader pass")

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19409>
2022-12-01 11:19:47 +00:00
Marcin Ślusarz
f6adfd6278 nir/lower_task_shader: allow offsetting of the start of payload
We need this, because on Intel task payload starts with private header,
followed by user-accessible data.

Fixes: 37e78803d7 ("intel/compiler: use nir_lower_task_shader pass")

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19409>
2022-12-01 11:19:47 +00:00
Marcin Ślusarz
7aaafaa8ae intel/compiler: adjust [store|load]_task_payload.base too
Base also needs to be converted from bytes to words.

Fixes: c36ae42e4c ("intel/compiler: Use nir_var_mem_task_payload")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19409>
2022-12-01 11:19:47 +00:00
David Heidelberg
d25fa88c6c ci/zink: add lavapipe flakes
Listed from: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7613
Bug: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7781

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20093>
2022-12-01 10:59:15 +00:00
Erik Faye-Lund
66b438dca1 zink: do not complain about missing line-stipple support
We can lower this now, so let's not complain about it...

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19117>
2022-12-01 10:21:02 +00:00
Erik Faye-Lund
d4a5977b17 zink: lower line stipple
This lowers line-stippling to a combination of geometry and fragment
shaders:

- The geometry shader computes the length of each line-segment, and
  outputs a varying that produces the stipple position.
- The fragment shader looks up the stipple position in the
  stipple-pattern once per sample, and updates the sample mask
  accordingly.

In case there's no geometry shader in place, we create a new
pass-through shader.

We should probably not declare the the push-constants in the pipeline
layout unless they're actually needed. But we already do this
unconditionally for the vertex shader and tesselation push-constants, so
let's do it unconditionally for these as well for now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19117>
2022-12-01 10:21:02 +00:00
Erik Faye-Lund
ad6eedab00 zink: allow to generate any vertex shader stage
There's times when it's going to be useful to generate geometry shaders
as well, so let's generalize the infrastructure for generated shader
stages a bit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19117>
2022-12-01 10:21:02 +00:00
Erik Faye-Lund
09ced773fc zink: process non-optimal-key passes first
Right now, it's only the vertex-shader that needs special handling for
non-optimal keys. That makes it possible to use fallthrough to always
end up in the last-vertex-stage conditional.

But we're about to add special handling for the geometry stage as well,
so let's prepare by splitting the switch-statement in two; one that only
happens for non-optimal keys, and does all the needed processing there,
and one that deals with the rest.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19117>
2022-12-01 10:21:02 +00:00
Erik Faye-Lund
81fcbfae74 zink: give gs its own shader-key
Line-stipple lowering is going to need some geometry-shader specific
lowering, so lets give the GS its own shader-key struct.

The GS variant only needs a non-optimal variant, so let's assert that to
be sure.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19117>
2022-12-01 10:21:02 +00:00
Erik Faye-Lund
85964945e7 zink: emit vars with nir_var_shader_temp mode
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19117>
2022-12-01 10:21:02 +00:00
Erik Faye-Lund
4b17c099ca zink: add line-stippling lowering passes
There's two notable limitations here:
- This will viewport-map to viewport #0 only. This is because we need
  the viewport-scale factors, which we'll be uploading using
  push-constants. And we don't want to waste too many of those...
- It's missing a "global" stipple-counter. It doesn't seem like there's
  a portable way of implementing this, so this is going to require a VK
  extension that can be implemented in a hardware-specific way in the
  long run. For now, let's just ignore the global stipple counter.

These two limitations don't seem viable to overcome for now, so but this
is better than nothing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19117>
2022-12-01 10:21:02 +00:00
Erik Faye-Lund
9f67e72e84 zink: setup driver-workaround for missing linestipple
This is not ideal, but at least it should work. In the long run, we
might want to store a bit per mode we're missing, so we can do this
conditionally. But that's quite a bit more complicated, so let's go with
this for now.

The line-stippling logic needs non-optimal shader-keys. So let's drop
some perf on the floor here.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19117>
2022-12-01 10:21:02 +00:00
David Heidelberg
4f01973034 ci/alpine: disable the job, still occasionally flakes
See: https://gitlab.freedesktop.org/mesa/mesa/-/jobs/32689466

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20076>
2022-12-01 09:48:04 +00:00
Emma Anholt
d09848d84d glx: Require __DRI_SWRAST >= 4 for doing swrast.
The only implementer in tree is v4.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20044>
2022-12-01 09:17:31 +00:00
Emma Anholt
7d36423032 egl: Refactor common error handling for context creation.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20044>
2022-12-01 09:17:31 +00:00
Emma Anholt
d592f56746 egl: Bump minimum version of __DRI_SWRAST to 4.
The only implementer in tree is v4.  This simplifies some bits now that we
always have CreateContextAttribs.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20044>
2022-12-01 09:17:31 +00:00
Emma Anholt
f4af33a36c glx: Require __DRI_DRI2 v2 for doing X11 DRI2.
The only implementer in tree is v4.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20044>
2022-12-01 09:17:31 +00:00
Emma Anholt
9fd2901454 egl: Require __DRI_DRI2 v4 if we're to do DRI2.
The only in-tree implementers are v4.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20044>
2022-12-01 09:17:30 +00:00
Emma Anholt
0847140e71 egl: Bump __DRI_CONFIG_OPTIONS min version to 2.
The only implementer in tree is v2.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20044>
2022-12-01 09:17:30 +00:00
Emma Anholt
d92dd4fb2f egl: Bump minimum version of __DRI_IMAGE to 6 and drop version checks.
All __DRI_IMAGEs in tree are v6+ (lowest being drisw) and implement
createImageFromTexture.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20044>
2022-12-01 09:17:30 +00:00
Emma Anholt
12d67aabed egl: Bump required version of optional __DRI2_FENCE to 2.
The only implementer of it in tree is v2, so no need for checks.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20044>
2022-12-01 09:17:30 +00:00
Emma Anholt
bb28bff583 gbm: Bump required __DRI_IMAGE version to 6.
That's the minimum implemented in tree (gallium swrast).  Drops a few more
version checks.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20044>
2022-12-01 09:17:30 +00:00
Emma Anholt
65822a31e2 gbm: Drop support for __DRI_DRI2 < 4 and __DRI_SWRAST < 4.
We're always loading a gallium driver built from this tree, so it's always
v4.

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/20044>
2022-12-01 09:17:30 +00:00
Emma Anholt
b695727cd3 dri: Add notes on what part of the loader interface are used by Xorg.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20044>
2022-12-01 09:17:30 +00:00
Connor Abbott
ccef6d1f5f freedreno/fdl: Set sRGB bit for storage images
This probably wasn't noticed earlier because tests using sRGB storage
images didn't exist, and we didn't know whether this works, but this
fixes dEQP-VK.image.store.without_format.2d.*_srgb which also proves
that the bit works.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20060>
2022-12-01 06:07:30 +00:00
Alyssa Rosenzweig
1555ac6f0b agx: Clamp point sizes
Fixes vs-point_size-zero.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20017>
2022-12-01 05:58:30 +00:00
Alyssa Rosenzweig
7108619c0d agx: Handle 32-bit gl_FragCoord.zw
The coefficient register is 16-bit so our builder will make the iter 16-bit too
(maybe not the best design...), force fp32 to match the NIR intrinsic.

Fixes glsl-fs-fragcoord-zw-ortho

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20017>
2022-12-01 05:58:30 +00:00
Alyssa Rosenzweig
eb4187b02d agx: Handle large varying indices
Fixes glsl-max-varyings.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20017>
2022-12-01 05:58:30 +00:00
Alyssa Rosenzweig
21f9a72c77 asahi: Support one-sided polygon modes
We can implement glPolygonMode(GL_FRONT_AND_BACK, ...) natively. What we can't
implement natively are two-sided polygon modes. For that Apple has a nontrivial
lowering which I don't feel the need to implement unless someone actually hits a
workload other than Piglit that uses it.

Vulkan requires only one-sided polygon modes (so this is sufficient there), and
GLES doesn't have polygon modes at all. If an app hits the unimplemented case,
throw a warning like Zink does.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20017>
2022-12-01 05:58:30 +00:00
Alyssa Rosenzweig
5e15b3c323 asahi: Handle NULL sampler views
Fixes fp-fragment-position (crash->pass).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20017>
2022-12-01 05:58:30 +00:00
Alyssa Rosenzweig
63d4f30aa7 asahi: Unset GL_CLAMP
Use the Zink lowering for the legacy mode, it's not too many instructions on AGX
anyway. Fixes texwrap tests.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20017>
2022-12-01 05:58:30 +00:00
Alyssa Rosenzweig
47cb8278be asahi: Set frag coord caps correctly
Fixes ./glsl-arb-fragment-coord-conventions, c.f. 12facf23b1 ("panfrost: Don't set CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER").

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20017>
2022-12-01 05:58:30 +00:00
Alyssa Rosenzweig
0bd71f7421 asahi: Set PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION
Fixes arb-provoking-vertex-render.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20017>
2022-12-01 05:58:30 +00:00
Alyssa Rosenzweig
1bf7d7139f asahi: Set PIPE_CAP_SUPPORTED_PRIM_MODES
To lower GL_POLYGONS which we don't do natively. Fixes a pile of crashes in
Piglit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20017>
2022-12-01 05:58:30 +00:00
Jason Ekstrand
216e5d6e10 hasvk: Drop anv_nir_add_base_work_group_id()
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20068>
2022-12-01 04:56:48 +00:00
Jason Ekstrand
2806968af8 anv: Drop anv_nir_add_base_work_group_id()
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20068>
2022-12-01 04:56:48 +00:00
Jason Ekstrand
b4dd3df227 intel/nir: Set has_base_workgroup_id for lower_compute_system_values
This option didn't exist half a decade ago when I first implemented base
workgroup support in ANV.  It's cleaner to just have split system values
like all the other zero_base+base things do.

We currently only do this for COMPUTE and not KERNEL because it lets us
avoid changing intel_clc for now.  We can add KERNEL later if needed.
We also don't do this lowering for task/mesh.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20068>
2022-12-01 04:56:48 +00:00
Jason Ekstrand
19ad2629d0 hasvk: Implement lower_base_workgroup_id
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20068>
2022-12-01 04:56:48 +00:00
Jason Ekstrand
3c09571f67 anv: Implement lower_base_workgroup_id
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20068>
2022-12-01 04:56:48 +00:00
Jason Ekstrand
f2aee04d28 crocus: Lower load_base_workgroup_id to zero
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20068>
2022-12-01 04:56:48 +00:00
Jason Ekstrand
4abdecce22 iris: Lower load_base_workgroup_id to zero
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20068>
2022-12-01 04:56:48 +00:00
Jason Ekstrand
7d2e3f660c intel/fs: Support load_workgroup_id_zero_base
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20068>
2022-12-01 04:56:48 +00:00
Jason Ekstrand
4fb33124c3 nir/divergence: Handle base_workgroup_id and workgrpu_id_zero_base
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20068>
2022-12-01 04:56:48 +00:00
Bas Nieuwenhuizen
9a311a1891 radv: Remove the old LBVH shader.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19891>
2022-12-01 02:20:48 +00:00
Bas Nieuwenhuizen
5ba950eb14 radv: Switch to new LBVH implementation.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19891>
2022-12-01 02:20:48 +00:00
Bas Nieuwenhuizen
ea159e47a5 radv: Add new LBVH shaders.
Contrary to the previous implementation, this actually implements an LBVH builder.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19891>
2022-12-01 02:20:48 +00:00
Bas Nieuwenhuizen
f531f671ef radv: Handle nodes with 2 invalid children in internal node converter.
Fixes: 682dc5c28e ("radv: Add conversion shader for internal nodes")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19891>
2022-12-01 02:20:48 +00:00
Alyssa Rosenzweig
8e125b6c15 panfrost: Enable AFBC of more formats
Enable AFBC for all RGBA UNORM formats possible in v5. This does not
cover the AFBC rules for newer gens, nor for YUV.

Noticed with an uncompressed R8 UNORM texture in SuperTuxKart.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19758>
2022-12-01 02:03:15 +00:00
Alyssa Rosenzweig
c7eb6a9fbb panfrost: Enable AFBC of sRGB formats
AFBC of sRGB formats should just work. We just need to flip it on and enjoy
the improved performance.

In particular, this means that RGBA8 UNORM and RGBA8 sRGB UNORM are now
considered compatible formats for AFBC. That's a bug fix, because
GALLIUM_HUD use will act like a texture view between sRGB and linear
views. For FBOs, that will "just" result in a decompression, hurting
performance. For window system rendering with AFBC, that will cause an
assertion failure, as we cannot decompress SHARED resources.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19758>
2022-12-01 02:03:15 +00:00
Alyssa Rosenzweig
8b7038ab3e panfrost: Enable AFBC of cube maps
Missed by mistake. This is not the same as 3D AFBC, it's just like a 2D
array. Noted in a supertuxkart pandecode.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19758>
2022-12-01 02:03:15 +00:00
Alyssa Rosenzweig
cd21cf5ab6 panfrost: Handle all RGB AFBC modes on v9
We're about to enable AFBC on more formats in the core AFBC code. The plane
descriptor packing needs to be aware of these new formats.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19758>
2022-12-01 02:03:15 +00:00
Georg Lehmann
a3beb82cf6 aco: Use wave size specific opcode for s_or in cube map coord code.
Cc: mesa-stable

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20041>
2022-12-01 01:39:27 +00:00
Jason Ekstrand
0531630658 nir/builder: Also short-circuit for auto-generated nir_t2t<N>()
This makes nir_i2i32(b, x) behave exactly like nir_i2iN(b, x, 32) etc.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7787
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20067>
2022-12-01 01:10:12 +00:00
Jason Ekstrand
e67e2293fa nir/builder: Rework the boolean conversion helpers
Move them up to where the other conversion helpers.  For nir_b2<T>(),
suffix them with N like all the others and make them use
nir_type_convert() as well.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20067>
2022-12-01 01:10:12 +00:00
Jason Ekstrand
d9a24632d3 nir/builder: Drop nir_i2i and nir_u2u in favor of nir_x2xN
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20067>
2022-12-01 01:10:12 +00:00
Jason Ekstrand
ccf19e0956 nir/builder: Move conversions higher in nir_builder.h
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20067>
2022-12-01 01:10:12 +00:00
Jason Ekstrand
9a225415e3 nir/builder: Short-circuit in nir_type_convert if no conversion happens
If both types are the same or both are integer types with the same bit
size, no actual conversion happens and nir_type_conversion_op() will
return nir_op_mov.  In this case, there's no point in emitting the move
and we can just return src instead.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20067>
2022-12-01 01:10:12 +00:00
Jason Ekstrand
c5fbcab803 nir/builder: Fix indentation of nir_type_convert
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20067>
2022-12-01 01:10:12 +00:00
Jason Ekstrand
8a406fe055 nir: Fix builder usage in lower_mediump_vars()
In our handling of load_deref, we were calling builder helpers to create
conversions and then adjusting the destination bit size of the load.  We
should adjust the bit size first because the builder sometimes looks at
the bit sizes of SSA values passed in as arguments.

Even though it's not strictly necessary, adjust the store_deref case as
well to make it fully symmetric with the load_deref case.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20067>
2022-12-01 01:10:12 +00:00
Alyssa Rosenzweig
976405907e pan/mdg: Emulate 8-bit with the 16-bit pipe
We don't care to support i8vec16, we just need a bit of 8-bit support to
implement format packing/unpacking in blend shaders. We're already doing
this by using the 16-bit pipe, we just need to commit to it all the way
-- reporting the correct sizes in max_bitsize_for_alu so the mask
packing logic works as intended -- and dropping the imov-specific hack
that was introduced to workaround a similar class of bugs.

With the previous patch, fixes:

   dEQP-GLES31.functional.draw_buffers_indexed.random.max_required_draw_buffers.1

Fixes: 39e4b7279d ("pan/midg: Fix swizzling on 8-bit sources")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19763>
2022-12-01 00:52:53 +00:00
Alyssa Rosenzweig
261d48fc9b pan/mdg: Refuse to schedule CSEL.vector to SMUL
Even if we only mask a single component from the result of CSEL.vector,
in our IR we treat its semantics as vector which causes trouble with
when scheduled to a scalar unit.

The problematic bundle looks like this:

   vmul.MOV.i32 R31, TMP0.xxxx, R0.yzww
   sadd.MAX.i32 TMP0.y, R0.y, #65408
   smul.CSEL.vector.i32 R0.y, TMP0.y, #127

As the comment in midgard.h illuminates, these CSEL instructions are
actually operating per-bit, lining up with the all-1's booleans in
Midgard. The Bifrost analogue is MUX.i32.bit, not CSEL.i32. We should
probably rename the Midgard instruction to make that clear.

Anyhoo, on the scalar unit, CSEL/MUX operates on the bottom 32-bits of
its source. That's ok for the usual r31.w case, because that's secretly
replicating to its nonexistent register, I think? But that doesn't work
with the CSEL.vector (MUX.vector) form, because the condition it's
actually muxing on is r31.x, which here is R0.y, not the intended R0.x.

Rather than adding more special cases to the already overcomplicated
scheduler (for the dubious benefit of avoiding a small shaderdb
regression), just avoid scheduling CSEL.vector to smul.

With the next patch, fixes:

dEQP-GLES31.functional.draw_buffers_indexed.random.max_required_draw_buffers.1

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19763>
2022-12-01 00:52:53 +00:00
Daniel Stone
921cfcf4c4 ci: Rebalance radv/grunt testing
We've recently rebalanced our lab devices to get a fewer number of
grunts. Switch to scheduling only on the newer shinier ones, running
fewer tests. We'll evaluate the runtime, and if they're quick enough
then we can increase the amount of testing we do.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20081>
2022-11-30 23:58:14 +00:00
Rajnesh Kanwal
24b1e3946c pvr: Add support to submit occlusion query sub cmds.
Co-authored-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
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/19371>
2022-11-30 22:45:41 +00:00
Rajnesh Kanwal
1b87ba7c9c pvr: Create a separate compute context for queries.
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/19371>
2022-11-30 22:45:41 +00:00
Rajnesh Kanwal
3ea2f82169 pvr: Set isp userpass to dirty for secondary command buffers.
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/19371>
2022-11-30 22:45:41 +00:00
Rajnesh Kanwal
224cfd772c pvr: Process queries and emit write program when ending sub_cmd.
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/19371>
2022-11-30 22:45:41 +00:00
Rajnesh Kanwal
952c1a55c8 pvr: Kick job and end sub_cmd if barrier_store is set in vkCmdExecuteCommands.
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/19371>
2022-11-30 22:45:41 +00:00
Rajnesh Kanwal
5c34be4340 pvr: Process secondary buffer queries in vkCmdExecuteCommands.
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/19371>
2022-11-30 22:45:41 +00:00
Rajnesh Kanwal
9df4be8cc4 pvr: Save error result in cmd_buffer state.
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/19371>
2022-11-30 22:45:41 +00:00
Rajnesh Kanwal
b6e8e1cf37 pvr: Implement vkCmdCopyQueryPoolResults API.
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/19371>
2022-11-30 22:45:41 +00:00
Rajnesh Kanwal
0aa9f32b95 pvr: Implement vkCmdResetQueryPool API.
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/19371>
2022-11-30 22:45:41 +00:00
Rajnesh Kanwal
d69362ae84 pvr: Add support to generate query programs.
This commit adds support to generate three types of query related
programs. PVR_QUERY_TYPE_AVAILABILITY_WRITE allows to submit the
queries, PVR_QUERY_TYPE_RESET_QUERY_POOL allows to reset the pool
and PVR_QUERY_TYPE_COPY_QUERY_RESULTS is to copy the results.

Co-authored-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
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/19371>
2022-11-30 22:45:41 +00:00
Rajnesh Kanwal
963b696511 pvr: Add PVR_SUB_CMD_TYPE_OCCLUSION_QUERY type sub cmd.
Co-authored-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
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/19371>
2022-11-30 22:45:41 +00:00
Rajnesh Kanwal
b85ee36051 pvr: Create device specific compute query programs.
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/19371>
2022-11-30 22:45:41 +00:00
Rajnesh Kanwal
68b8f80fb2 pvr: Implement vkCmdEndQuery API.
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/19371>
2022-11-30 22:45:41 +00:00
Rajnesh Kanwal
2b1992a000 pvr: Implement vkCmdBeginQuery API.
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/19371>
2022-11-30 22:45:41 +00:00
Rajnesh Kanwal
5055c182eb pvr: Sequential dependency should be NONE for 0 constant shared regs.
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/19371>
2022-11-30 22:45:41 +00:00
Rajnesh Kanwal
279c7c6d5a pvr: Implement vkGetQueryPoolResults API.
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/19371>
2022-11-30 22:45:41 +00:00
Rajnesh Kanwal
4fc2586efd pvr: Add support to generate update compute kernel.
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/19371>
2022-11-30 22:45:41 +00:00
Rajnesh Kanwal
9ac269fc7d pvr: Add support to generate compute kernel to update shared regs.
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/19371>
2022-11-30 22:45:41 +00:00
Rajnesh Kanwal
e38273013b pvr: Change CDM to compute, TA to geometry and 3D to fragment.
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/19371>
2022-11-30 22:45:41 +00:00
Gert Wollny
5b205ef413 r600: Store nir shaders serialized to save memory
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7247

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20061>
2022-11-30 20:31:57 +00:00
Georg Lehmann
22be0d09a0 aco: Don't prematurely emit s_andn2.
Split s_not + s_and allows more inverse comparision and s_cbranch_vccz
optimizations.

Foz-DB Navi21:
Totals from 516 (0.38% of 134913) affected shaders:
CodeSize: 7273724 -> 7273720 (-0.00%)
Instrs: 1364408 -> 1364407 (-0.00%)
Latency: 14604862 -> 14604858 (-0.00%)

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19143>
2022-11-30 18:25:15 +00:00
Yonggang Luo
df0842c4f2 Revert "radeonsi/ci: update stoney fail -> flakes"
This is partial reverts commit 5ed2265fbf.
As the xfail should not be removed from radeonsi-stoney-fails.txt
that point out by Emma Anholt

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19860>
2022-11-30 17:24:03 +00:00
Yonggang Luo
73f1fa4354 ci: Update radeonsi-raven xfail to flake
Partial revert "ci/amd: add raven flakes which was previously failing"

This reverts commit fbf93ef821.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7738
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19860>
2022-11-30 17:24:03 +00:00
Yonggang Luo
871443f4de ci: Add intel kbl xfail to flake
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7738

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19860>
2022-11-30 17:24:03 +00:00
Iago Toral Quiroga
71e86a4655 v3dv: pre-allocate actual events instead of event descriptors
Instead of keeping a free list of "event descriptors" which are
just the offsets in the BO state that are available, pre-allocate
the events. This is simpler as it doesn't require to allocate these
event descriptors at all.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20053>
2022-11-30 17:10:45 +00:00
Eric Engestrom
cf841cdd0b commit_in_branch.py: variables cleanup
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19988>
2022-11-30 17:08:48 +00:00
Eric Engestrom
707015891f commit_in_branch.py: add support for checking staging branches
Or any branch that contains a `/` slash.

Cc: mesa-stable
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19988>
2022-11-30 17:08:48 +00:00
Eric Engestrom
3b07d57ff9 commit_in_branch.py: fix tests
Apparently these were backported since I wrote these tests ^^

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19988>
2022-11-30 17:08:48 +00:00
Connor Abbott
8ba2d612d5 ir3: Don't save/restore disasm string pointer
It's not in the key, so it randomly may or may not be present, and if it
is present then we don't actually save/restore the contents, so we will
save/restore random pointer values from the last run. Turnip already
disables searching the shader cache when assembly is requested, but
still wrote the final ir3_shader_variant which resulted in trying to
save random stale pointers when saving off the executable if a
subsequent compile hit that cache entry.

This fixes flakes in
dEQP-VK.pipeline.pipeline_library.shader_module_identifier.pipeline_from_id.*
for me.

Fixes: 56909868cd ("turnip: implement VK_KHR_pipeline_executable_properties")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20056>
2022-11-30 16:39:59 +00:00
Connor Abbott
515c9a2e07 tu: Fix binding NULL descriptor sets
This fixes the new test
dEQP-VK.pipeline.pipeline_library.graphics_library.misc.other.null_descriptor_set_in_monolithic_pipeline.

Fixes: e9f5de11d4 ("tu: Initial implementation of VK_EXT_graphics_pipeline_library")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20057>
2022-11-30 15:09:24 +00:00
Lionel Landwerlin
863516dd63 radv: enable lower shader call vectorizing
Totals from 5 (71.43% of 7) affected shaders:
MaxWaves: 48 -> 50 (+4.17%)
Instrs: 32012 -> 32070 (+0.18%)
CodeSize: 172672 -> 172932 (+0.15%)
VGPRs: 512 -> 496 (-3.12%)
Latency: 715333 -> 715279 (-0.01%); split: -0.03%, +0.02%
InvThroughput: 149540 -> 146150 (-2.27%); split: -2.29%, +0.02%
VClause: 900 -> 897 (-0.33%)
Copies: 4173 -> 4199 (+0.62%); split: -0.12%, +0.74%
Branches: 1512 -> 1511 (-0.07%)
PreVGPRs: 475 -> 469 (-1.26%)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20075>
2022-11-30 11:13:13 +00:00
Samuel Pitoiset
96332b3433 radv: stop emitting R_00B8A0_COMPUTE_PGM_RSRC3 from the CS preamble
It will be always emitted as part of the compute pipeline.

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/20054>
2022-11-30 09:05:13 +00:00
Samuel Pitoiset
80072df824 radv: disable VRS entirely on GFX11
Based on registers, VRS changed a lot and it's unclear how to program
it. This disable VK_KHR_fragment_shading_rate, VRS flat shading and
RADV_FORCE_VRS.

Cc: 22.3 mesa-stable
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/20054>
2022-11-30 09:05:13 +00:00
Samuel Pitoiset
5d552b4f6c radv: do not enable NGG culling on GFX11
RadeonSI disables it as well. It's really unclear if it will help or
not (eg. NGG culling never helped on GFX10).

Cc: 22.3 mesa-stable
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/20054>
2022-11-30 09:05:13 +00:00
Samuel Pitoiset
84a7138d3c radv: do not enable DCC for MSAA images without FMASK
I don't know how this is supposed to work, especially for fast clears
because CMASK should be cleared to 0xC but FMASK implies CMASK.
This fixes a bunch of MSAA test failures on GFX10.3 with
RADV_DEBUG=nofmask.

Cc: 22.3 mesa-stable
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/20054>
2022-11-30 09:05:13 +00:00
Samuel Pitoiset
9b637aa9a1 radv: set INTERPOLATE_COMP_Z to 0 on GFX11
Ported from RadeonSI to fix a EQAA bug.

Cc: 22.3 mesa-stable
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/20054>
2022-11-30 09:05:13 +00:00
Samuel Pitoiset
62715a6d03 radv: set missing SPI_SHADER_PGM_xxx registers on GFX11
Found by inspection.

Cc: 22.3 mesa-stable
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/20054>
2022-11-30 09:05:13 +00:00
Erik Faye-Lund
d0342e28b3 nir: Add helper to create passthrough GS shader
Based on nir_create_passthrough_tcs and d3d12_make_passthrough_gs, this
creates a passthrough geometry shader that can be used by drivers that
needs to emulate some graphics features in the geometry shader.

Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19987>
2022-11-30 08:08:25 +00:00
Lionel Landwerlin
6f2dbe6da1 anv: enable lower_shader_calls vectorizing
On Q2RTX RT shaders :

Totals from 7 (22.58% of 31) affected shaders:
Instrs: 15453 -> 14418 (-6.70%)
Cycles: 232647 -> 224959 (-3.30%)
Send messages: 574 -> 481 (-16.20%)
Spill count: 118 -> 106 (-10.17%)
Fill count: 156 -> 140 (-10.26%)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20058>
2022-11-30 07:23:30 +00:00
Lionel Landwerlin
9d0560fe87 nir/lower_shader_calls: enable vectorizer
We cannot fully use the vectorizer outside of this pass because once
stack load/store operations have been lower to global load/store, the
robustness rule applies to those as they would to application
load/store.

But this is all internal and we know it doesn't require out of bound
checking. So doing the vectorizing here is the best solution. We just
have to teach the vectorizer about our intrinsics.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20058>
2022-11-30 07:23:30 +00:00
Lionel Landwerlin
9c76cda7f0 nir/lower_shader_calls: add a pass to split load/store into scalars
We'll run this pass prior to opt_load_store_vectorize to maximize the
effect of the optimization.

At the moment opt_load_store_vectorize is unable to pack this :

  store vec3
  store vec3
  store vec2

into this :

  store vec4
  store vec3

If your backend can only do vec4 stores max.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20058>
2022-11-30 07:23:30 +00:00
Lionel Landwerlin
e84eab42c4 nir/lower_shader_calls: avoid moving loads into loops
This is similar to what opt_gcm is doing. Moving a load inside a loop
will increase memory bandwidth.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20058>
2022-11-30 07:23:30 +00:00
Jessica Clarke
750325730b panfrost/blend: Fix invalid const values leading to NIR validation errors
Using a designated initializer like this leaves padding bits, which form
part of the aliasing u64/f64 member of the union, uninitialised, but a
nir_const_value must always have the unused bits zeroed out. Thus, use
the nir_const_value_for_float helper instead like everywhere else which
will do a memset 0 for us first.

Without this, using the pan_blend shader in a build with validation
enabled fails with:

  NIR validation failed after nir_lower_vars_to_ssa
  ...
            vec4 32 ssa_58 = load_const (0x3f7cfcfd /* 0.988235 */, 0x3f7cfcfd /* 0.988235 */, 0x3f7cfcfd /* 0.988235 */, 0x3f800000 /* 1.000000 */)
  error: memcmp(val, &cmp_val, sizeof(cmp_val)) == 0 (../src/compiler/nir/nir_validate.c:976)

Fixes: 1378c67bcf ("panfrost/blend: Inline blend constants")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20071>
2022-11-30 04:49:17 +00:00
Yiwei Zhang
6148ccef63 venus: fix android wsi with global fencing disabled
Fixes: b21e4a7990 ("venus: put android wsi on the sub-optimal path")

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20049>
2022-11-30 01:13:56 +00:00
Sajeesh Sidharthan
8b99e96dc8 radeonsi/vcn: set current pic index correctly
video corruption observed while running decode test for av1
content in chromeos.

solution is when target buffer is found in render pic list and when
target codec is null, set curr_pic_indx as index to the
pic in render pic list.

Cc: mesa-stable
Signed-off-by: Sajeesh Sidharthan <sajeesh.sidharthan@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20000>
2022-11-29 23:41:37 +00:00
Karol Herbst
5398dd04bf nir/lower_int64: fix shift lowering
Starting with !19748 lowered 64 bit shifts were showing wrong results for
shifts with insignificant bits set.

nir shifts are defined to only look at the least significant bits. The
lowering has take this into account.

So there are two things going on:
1. the `ieq` and `uge` further down depend on `y` being masked.
2. the calculation of `reverse_count` actually depends on a masked `y` as
   well, due to the `(iabs (iadd y -32))` giving a different result for
   shifts > 31;

Fixes: 41f3e9e5f5 ("nir: Implement lowering of 64-bit shift operations")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19995>
2022-11-29 23:08:53 +00:00
Emma Anholt
83efd336da ci/freedreno: Add another blend_equation_advanced flake.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20066>
2022-11-29 22:42:06 +00:00
Italo Nicola
7dd9bf45b9 panfrost: add GALLIUM_HUD=draw-calls
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20063>
2022-11-29 22:27:07 +00:00
Connor Abbott
0a0a04bdaa tu: Use right enum for compute active_shader_stages
This is VkShaderStageFlags, not VkPipelineStageFlags. Fixes preloading
descriptors for compute dispatches.

Fixes: d862a2ebcb ("turnip: Only emit descriptor loads for active stages in the pipeline.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20059>
2022-11-29 22:02:20 +00:00
Emma Anholt
f2414dc2a0 turnip: Drop the cs argument from tu6_emit_cache_flush*().
It's always draw_cs or cs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19939>
2022-11-29 19:30:25 +00:00
Emma Anholt
939648bbd0 turnip: Clean up a repeated pattern around tu6_emit_flushes().
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19939>
2022-11-29 19:30:25 +00:00
Emma Anholt
43aae91803 turnip: Make tu_emit_cache_flush_ccu manage flush bits like other paths.
Everyone else sets the cache bits directly then calls tu6_emit_flushes on
them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19939>
2022-11-29 19:30:25 +00:00
Samuel Pitoiset
07dc402a3f radv: inline gfx10_emit_streamout_{begin,end}()
Instead of having 2 different paths.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19632>
2022-11-29 16:50:13 +00:00
Roman Stratiienko
09ac29cca9 meson: Enable system_has_kms_drm for android
This allows to build libgbm when  system = 'android'  is set in
the cross_file.

Cc: "22.3" "22.2" mesa-stable
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Acked-by: Mauro Rossi <issor.oruam@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20033>
2022-11-29 15:01:22 +00:00
Rhys Perry
ae521aaa2a radv: compile GS copy shader after geometry shader
This affects the pipeline feedback durations: GS copy shader compilation
is now included in the GS compilation duration.

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/18898>
2022-11-29 14:28:11 +00:00
Rhys Perry
0cb48ec3b7 radv,aco: remove old streamout code
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/18898>
2022-11-29 14:28:11 +00:00
Rhys Perry
3a96977542 radv,aco: remove old GS copy shader code
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/18898>
2022-11-29 14:28:11 +00:00
Rhys Perry
17bd2721e6 radv,aco: implement GS copy shaders using NIR
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/18898>
2022-11-29 14:28:11 +00:00
Rhys Perry
3ab471a87d radv: make radv_use_llvm_for_stage device parameter const
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/18898>
2022-11-29 14:28:11 +00:00
Rhys Perry
12becb8839 radv: lower streamout in NIR
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/18898>
2022-11-29 14:28:11 +00:00
Rhys Perry
19d0403594 radv,aco: export legacy vertex outputs in NIR
This new behaviour will let us insert exports in GS copy shader control
flow.

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/18898>
2022-11-29 14:28:11 +00:00
Karmjit Mahil
09eb2a4023 pvr: Add missing valgrind includes and fix unused return value.
On including the header the compiler started throwing warnings
about the return value not being used when setting and getting the
vbits.

This commit adds the missing valgrind related headers and fixes the
warnings caused by including them.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20035>
2022-11-29 14:19:41 +00:00
Erik Faye-Lund
8d3475ab8c docs/zink: document missing max-image requirements
This should bring Zink's documentation up to speed with the previous
commit.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19780>
2022-11-29 13:35:46 +00:00
Erik Faye-Lund
2658d02516 mesa/main: verify more texture-limits for GL 4.1
OpenGL 4.1 also increased the minimum 3D and cube texture size as
well as the minimum number of texture-array layers. Let's also
verify these to prevent enbaling too recent GL versions on layered
drivers link Zink, VirGL etc.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19780>
2022-11-29 13:35:46 +00:00
Erik Faye-Lund
dc770eb9bb zink: check maxImageDimension1D as well as maxImageDimension2D
According to the docs for PIPE_CAP_MAX_TEXTURE_2D_SIZE, it's the limit
both for 2D *and* 1D textures. So let's take the min of the two vulkan
features here instead of assuming they're the same.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19780>
2022-11-29 13:35:46 +00:00
Erik Faye-Lund
1b892c5a7d freedreno: fix PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS for a6xx
We're reporting 2048 for VkPhysicalDeviceLimits::maxImageArrayLayers on
Turnip, so we should be able to use 2048 for OpenGL as well. And that's
the minimum required value for OpenGL 4.1 support.

According to http://vulkan.gpuinfo.org/, it seems like values of 2048
should be possible for at least as low as some Adreno 4xx GPUs. But
since we don't support recent GL versions on those, we this won't make a
big difference. So let's leave that up to someone who actually knows
what they're doing!

Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19780>
2022-11-29 13:35:46 +00:00
Erik Faye-Lund
d15e71ef3c d3d12: fix return-value for PIPE_CAP_MAX_TEXTURE_3D_LEVELS
D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION is 2^11, not 2^10 like the
comment said, and the code assumed. We need to add one to account for
the base-level.

Let's add a static_assert here to prove that this is the right value.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19780>
2022-11-29 13:35:46 +00:00
Erik Faye-Lund
acc0039aec d3d12: fix max-array-layers
We used to need this, because we incorrectly multiplied the cube array
sizes by 6. Now that this has been fixed, we can actually support the
OpenGL 4.1 limit for this.

Fixes: 7118b2136e ("d3d12: Don't multiply cube array sizes by 6")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19780>
2022-11-29 13:35:46 +00:00
Samuel Pitoiset
7e287609e3 radv: use HTILE for VRS image only on GFX10.3
Based on registers, GFX11 no longer uses HTILE.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19962>
2022-11-29 12:19:40 +00:00
Samuel Pitoiset
e3d3fb2e69 radv: do not clear VRS_HTILE_ENCODING on GFX11
This field no longer exists.

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/19962>
2022-11-29 12:19:40 +00:00
Sarah Walker
2673d0f8b2 pvr: Query kernel for free list max size
Signed-off-by: Sarah Walker <sarah.walker@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19976>
2022-11-29 10:10:16 +00:00
Connor Abbott
5e5c42ebb5 tu: Fix fault with variable-count inline uniform blocks
This seems to have been triggered by some recent CTS changes which
changed the random number generation. I'm seeing context faults in
dEQP-VK.binding_model.descriptorset_random.sets4.dynindexed.ubolimitlow.sbolimitlow.sampledimghigh.lowimgnotex.iublimitlow.nouab.comp.noia.0
that are fixed by this.

Fixes: 37cde2c634 ("tu: Rewrite inline uniform implementation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20039>
2022-11-29 09:42:52 +00:00
Aditya Swarup
6080dce4d8 intel/isl: Add MOCS settings for MTL platforms
Add MOCS settings for Xe platforms based on cache settings for L3/L4
and display.

Rework:
 * Jordan: Use intel_device_info_is_mtl()

BSpec: 45101
Signed-off-by: Aditya Swarup <aditya.swarup@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20045>
2022-11-29 00:36:41 -08:00
Mauro Rossi
ea10b0fc7a AOSP: Add intel_hasvk vulkan library suffix
Required to correctly install vulkan.intel_hasvk.so module
after commit 50013ca9 ("intel: add a hasvk vulkan driver")

In order to set property ro.hardware.vulkan as 'intel_hasvk' for the correct iGPU parts at init stage,
i915 'graphics version' can only be detected by means of /sys/kernel/debug/dri/0/i915_capabilities
and debugfs needs to be mounted at early-init stage

https://review.lineageos.org/c/LineageOS/android_device_lge_g3-common/+/19875

Cc: "22.3" mesa-stable
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Tested-by: Mauro Rossi <issor.oruam@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20048>
2022-11-29 09:05:17 +01:00
Qiang Yu
3507cdc59c ac/nir: legacy vs/gs use nir_xfb_info to replace pipe_stream_output_info
pipe_stream_output_info is built from nir_xfb_info, why not just use
nir_xfb_info directly.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20015>
2022-11-29 03:28:42 +00:00
Jianxun Zhang
59b29c5fc4 iris: Use devinfo::has_flat_ccs instead of verx10
The assumption that GFX12.5 devices don't have AUX map is
invalid since MTL's introduction.

Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@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/20043>
2022-11-29 02:47:44 +00:00
Jianxun Zhang
93baad8047 intel/dev: Set 'has_flat_ccs' flag for DG2
The code paths of flat ccs should be working on DG2 because
they are routed by other conditions like GFXVer so far. But
using this flag is the intended way, and we need to have
this change prior to updating these conditions with the flag.

Ref: 5262475242 ("intel/dev: Add a has_flat_ccs flag")

Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@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/20043>
2022-11-29 02:47:44 +00:00
Jordan Justen
4db33adf9d intel/isl: Disable CCS on MTL
MTL requires some ccs/aux-map changes from Jianxun Zhang, which are
still in progress. So, for now we disable ccs on MTL.

Rework:
 * Drop change in isl_surf_supports_ccs (Nanley)

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/20046>
2022-11-28 17:09:52 -08:00
Jordan Justen
cbae305258 anv, iris: Make use of devinfo::has_caching_uapi
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19911>
2022-11-28 21:54:20 +00:00
Jordan Justen
ed84f163ff intel/dev: Add devinfo::has_caching_uapi (and disable for dg1 and dg2+)
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19911>
2022-11-28 21:54:20 +00:00
David Heidelberg
0213750e6d ci/alpine: disable mold on Alpine builds
All the timeouts started close to Mold linking phase, disable it.

See:
 - https://gitlab.freedesktop.org/mesa/mesa/-/jobs/32502446
 - https://gitlab.freedesktop.org/mesa/mesa/-/jobs/32465151

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20032>
2022-11-28 20:53:37 +00:00
Thong Thai
afcff6f333 radeonsi/vcn/enc: add encoder statistics support
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19512>
2022-11-28 19:58:41 +00:00
Thong Thai
2d1bd619df frontends/va: add ability for encoder to output statistics
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19512>
2022-11-28 19:58:41 +00:00
Asahi Lina
022d03013a ail: Split off test-miptree.cpp from test-layout.cpp
Keep test-layout.cpp for the simple smoke tests, and move the big pile
of miptree tests to its own file.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20031>
2022-11-28 19:50:18 +00:00
Asahi Lina
d0532196a2 ail: Add uncompressed twiddled texture sizing tests
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20031>
2022-11-28 19:50:18 +00:00
Asahi Lina
50ee22f5a5 ail: Rename test-compression.cpp to test-comp-twiddled.cpp
To better align with the analogous test-uncomp-twiddled.cpp

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20031>
2022-11-28 19:50:18 +00:00
Asahi Lina
c52d4bef2d ail: Add more compression size test cases
Also sort the table in a consistent way, to make it easier to add
tests without creating duplicates in the future.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20031>
2022-11-28 19:50:18 +00:00
Asahi Lina
c39ca7007f ail: Fix logic for buffer alignment
It turns out that specifically Z/S single-layer textures have the main
miptree padded to the page size, but not others.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20031>
2022-11-28 19:50:18 +00:00
Asahi Lina
ecdcb3e1aa ail: Fix compression metadata buffer sizing corner cases
Although the metadata is possibly one byte per 8x4 block, the
logical block size for compression/allocation is a 16x16 block,
so align to that. Also align the initial dimensions to that size,
and change the minification to a simple DIV_ROUND_UP.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20031>
2022-11-28 19:50:18 +00:00
Asahi Lina
112830f1a0 asahi: Pass through layer alignment flag to the hardware
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20031>
2022-11-28 19:50:18 +00:00
Asahi Lina
d88b546e65 ail: Introduce layer_alignment flag
The hardware uses this flag to determine whether layer strides are
implicitly aligned to the page size or not.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20031>
2022-11-28 19:50:18 +00:00
Rhys Perry
974358a8c1 radv/llvm: add clip distance outputs manually if they're missing
It's possible that undef is written to clip/cull distance outputs and
they're eliminated, and we never set any position export to done=1 because
outinfo->pos_exports was calculated with the expectation that clip/cull is
exported.

Eliminating the export and fixing the done=1 bit hangs because the
hardware is still expecting clip/cull distances.

Fixes dEQP-VK.rasterization.provoking_vertex.transform_feedback.first.line_list
hang with LLVM.

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/19200>
2022-11-28 19:18:50 +00:00
Georg Lehmann
7aa94efe82 aco: Combine constant bit test to s_bitcmp.
Foz-DB Navi21:
Totals from 73988 (54.84% of 134913) affected shaders:
VGPRs: 2959768 -> 2959752 (-0.00%)
SpillSGPRs: 10250 -> 10697 (+4.36%); split: -0.64%, +5.00%
SpillVGPRs: 2326 -> 2291 (-1.50%); split: -2.24%, +0.73%
CodeSize: 261339476 -> 261045912 (-0.11%); split: -0.12%, +0.00%
Scratch: 239616 -> 238592 (-0.43%)
Instrs: 49214044 -> 49188242 (-0.05%); split: -0.06%, +0.00%
Latency: 413214139 -> 413296229 (+0.02%); split: -0.03%, +0.05%
InvThroughput: 71741622 -> 71786300 (+0.06%); split: -0.07%, +0.13%
VClause: 856838 -> 856973 (+0.02%); split: -0.01%, +0.02%
SClause: 1504502 -> 1504567 (+0.00%); split: -0.01%, +0.02%
Copies: 4058433 -> 4060424 (+0.05%); split: -0.03%, +0.08%
Branches: 1502953 -> 1502945 (-0.00%); split: -0.00%, +0.00%
PreSGPRs: 3081927 -> 3081531 (-0.01%); split: -0.02%, +0.01%
PreVGPRs: 2513990 -> 2513992 (+0.00%)

The vast majority of instruction count regressions are caused by parallel-rdp.

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/18870>
2022-11-28 18:43:53 +00:00
Georg Lehmann
73be938c48 aco: Combine bit test to s_bitcmp.
Foz-DB Navi21:
Totals from 6396 (4.74% of 134913) affected shaders:
VGPRs: 483280 -> 483152 (-0.03%); split: -0.03%, +0.01%
SpillSGPRs: 8119 -> 7941 (-2.19%)
CodeSize: 63377880 -> 63268556 (-0.17%); split: -0.20%, +0.03%
MaxWaves: 86778 -> 86810 (+0.04%)
Instrs: 11745621 -> 11725857 (-0.17%); split: -0.20%, +0.03%
Latency: 162400148 -> 162282230 (-0.07%); split: -0.08%, +0.01%
InvThroughput: 29179429 -> 29133173 (-0.16%); split: -0.16%, +0.00%
VClause: 208032 -> 208100 (+0.03%); split: -0.01%, +0.05%
SClause: 431390 -> 430849 (-0.13%); split: -0.24%, +0.11%
Copies: 896222 -> 893285 (-0.33%); split: -0.62%, +0.30%
Branches: 349806 -> 348770 (-0.30%); split: -0.90%, +0.60%
PreSGPRs: 618908 -> 613773 (-0.83%); split: -0.83%, +0.00%
PreVGPRs: 482901 -> 482893 (-0.00%)

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/18870>
2022-11-28 18:43:53 +00:00
Georg Lehmann
853d2cb6f1 aco: Combine s_abs and s_sub/s_add to s_absdiff.
Totals from 2 (0.00% of 134913) affected shaders:
CodeSize: 1344 -> 1336 (-0.60%)
Instrs: 277 -> 275 (-0.72%)

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/18870>
2022-11-28 18:43:53 +00:00
Georg Lehmann
7e1d77fd90 aco: Ignore instructions with exec operands in follow_operand.
No Foz-DB changes.

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/18870>
2022-11-28 18:43:53 +00:00
Georg Lehmann
65a3328b4c aco/optimizer: Cleanup ctx.uses handling for patterns which use follow_operand(..., true).
No Foz-DB changes.

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/18870>
2022-11-28 18:43:53 +00:00
Gert Wollny
28c7684eb9 r600/sfn: always use four slots for Cayman trans ops
This is a partial revert of
  ed6204eb0 (r600/sfn: only use 3 channels on Cayman for trans ops)

The scheduler and/or optimizer passes generate faulty code when
we use only three slots as decribed in the spec. So for now disable
this optimization.

Fixes: ed6204eb0 (r600/sfn: only use 3 channels on Cayman for trans ops)
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7774

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20034>
2022-11-28 18:34:19 +00:00
Samuel Pitoiset
aa545a0012 radv: reduce CPU overhead when emitting streamout descriptors
Only the last VGT stage can have streamout.

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/19723>
2022-11-28 17:59:51 +00:00
Alyssa Rosenzweig
eae904260b asahi: Implement DISCARD_WHOLE_RESOURCE
We can reallocate to avoid a flush.

Scrolling rosenzweig.io in Firefox with WebRender enabled is now vsyncing at
60fps instead of being capped around 50fps. SuperTuxKart is noticeably faster as
well, though this was prompted by WebRender.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20013>
2022-11-28 16:48:38 +00:00
Alyssa Rosenzweig
a3e5445d4a agx: Don't depend sampler view on BO
The BO can change when shadowing, fix up at drawtime.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20013>
2022-11-28 16:48:38 +00:00
Alyssa Rosenzweig
597e303b5b agx: Add merge helpers to GenXML
From panfrost.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20013>
2022-11-28 16:48:38 +00:00
Alyssa Rosenzweig
debee344a2 agx: Make empty texture pack to all-zeroes
So we can do partial textures.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20013>
2022-11-28 16:48:38 +00:00
Samuel Pitoiset
db7dcc4567 radv: only install 00-radv-defaults.conf if xmlconfig is used
RADV has its own drirc file. Make sure it also uses the xmlconfig
enable option.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20029>
2022-11-28 16:19:47 +00:00
Asahi Lina
f5a26cc646 asahi: Fix remaining build issues on macOS
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20030>
2022-11-28 16:10:19 +00:00
Eric Engestrom
fcb207a4d3 asahi: add fallback for DRM_FORMAT_MOD_INVALID on macOS
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19879>
2022-11-28 16:00:29 +00:00
Samuel Pitoiset
a6d7d2a525 radv: emit DB_RENDER_OVERRIDE2 as part of the framebuffer
The number of samples from the image has to match the number of samples
from the pipeline anyways.

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/19906>
2022-11-28 15:20:59 +00:00
Erik Faye-Lund
8d3c96a49c freedreno/decode: add missing dependency
The source code for rddecompiler includes adreno_common.xml.h, which is
a generated header. In order to ensure that the header has been written
when compiling rddecompiler.c, we need a dependency here.

Fixes: 03d80e0a6d ("freedreno/decode: Add 'rddecompiler' tool")
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20003>
2022-11-28 13:08:05 +00:00
Vinson Lee
f6bef7305b freedreno/rddecompiler: Fix memory leak.
Fix defect reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable stream_data going out of scope leaks the storage it points to.

Fixes: a7773c3c4c ("freedreno/rddecompiler: Add shader disasm/asm support")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20028>
2022-11-28 12:59:07 +00:00
Gert Wollny
9fe16c91b3 clover: test for nir fp64 lowering options for cl_khr_fp64
With NIR we have softfp64, but we don't really want this for CL,
so check whether fp64 is lowered to a software implementation.

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

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19919>
2022-11-28 11:48:42 +00:00
Karmjit Mahil
e30b6563ca pvr: Setup tile buffers.
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/20007>
2022-11-28 11:38:38 +00:00
Karmjit Mahil
42e9cc010d pvr: Don't print out secondaries if they aren't used.
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/20008>
2022-11-28 09:12:36 +00:00
Karmjit Mahil
ebf639f4ff pvr: Add '+' before desc offsets in debug output.
Having the '+' makes it more obvious that it's the offset of the
primary/secondary.

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/20008>
2022-11-28 09:12:36 +00:00
Karmjit Mahil
8a69019277 pvr: Use glsl syntax to show set and binding number.
This makes the descriptor set debug output's descriptor set number
and binding number more obvious. The previous format wasn't as
obvious unless you knew how to read it.

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/20008>
2022-11-28 09:12:36 +00:00
Karmjit Mahil
260db8112a pvr: Change how desc set debug output section dividers are printed.
Instead of hard coding in the exact string to print out for the
divider, now we're printing the same char n times so we only need
to specify the character and how many times to retreat it.

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/20008>
2022-11-28 09:12:36 +00:00
Karmjit Mahil
02626072e2 pvr: Don't print inactive bindings.
Previously all bindings were printed out and an "X" was used to
indicate if a binding was not active for a particular stage.
This commit just skips those bindings entirely reducing possible
confusion.

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/20008>
2022-11-28 09:12:36 +00:00
Karmjit Mahil
6d9a7d1597 pvr: Print out empty row if dynamic primaries or secondaries are missing.
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/20008>
2022-11-28 09:12:36 +00:00
Karmjit Mahil
567ae39738 pvr: Explain why dynamic descriptors are allocated separately.
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/20008>
2022-11-28 09:12:35 +00:00
Konstantin Seurer
c5d91ab254 radv/rt: Check space before emitting descriptors
Found by inspection.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20020>
2022-11-27 18:45:41 +00:00
Konstantin Seurer
0966fb2c10 radv/ray_queries: Fix AABB handling
AABB intersections always have to be committed manually.
-> We don't have to copy opaque ones to closest.

It's also invalid to query t for candidate AABBs.

Totals from 7 (14.29% of 49) affected shaders:
CodeSize: 171008 -> 169672 (-0.78%)
Instrs: 32499 -> 32250 (-0.77%); split: -0.78%, +0.01%
Latency: 418859 -> 414759 (-0.98%); split: -0.98%, +0.00%
InvThroughput: 89182 -> 88251 (-1.04%); split: -1.05%, +0.00%
VClause: 602 -> 599 (-0.50%)
SClause: 837 -> 835 (-0.24%)
Copies: 4804 -> 4802 (-0.04%); split: -0.35%, +0.31%
Branches: 1593 -> 1585 (-0.50%)
PreSGPRs: 567 -> 566 (-0.18%)

Fixes: 3f72061 ("radv/rq: Use the common traversal helper")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19698>
2022-11-27 12:57:02 +01:00
Konstantin Seurer
409556f048 radv/ray_queries: Move some initialization outside a likely branch
Gets rid of some copies.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19698>
2022-11-27 12:57:02 +01:00
Marek Olšák
8fdaa25c54 frontend/dri: rewrite and comment dri_make_current to make it make sense
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19741>
2022-11-27 02:52:42 +00:00
Marek Olšák
51fcabfb04 frontend/dri: unduplicate flush_drawable callback
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19741>
2022-11-27 02:52:42 +00:00
Marek Olšák
eaf99194ea frontend/dri: remove the drawable ctx hack, we should always use current context
I've checked the loaders that this is what they expect.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19741>
2022-11-27 02:52:42 +00:00
Marek Olšák
f2c4aba9e1 frontend/dri: clean up updating dri_drawable::refcount
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19741>
2022-11-27 02:52:42 +00:00
Marek Olšák
7d5b1cd02c frontend/dri: move callbacks from the VTable into dri_screen, dri_drawable
This just moves the callbacks and renames the functions.
Some functions had to be moved up because they are initialized there.
Remove some obsolete comments.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19741>
2022-11-27 02:52:42 +00:00
Marek Olšák
f34d607d2f frontend/dri: clean up the hacky implementation of kopper_drawable
Just put the kopper_drawable fields into dri_drawable and remove
kopper_drawable. The creation code is simplified.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19741>
2022-11-27 02:52:42 +00:00
Marek Olšák
165b8a9fef frontend/dri: inline __DRIscreen in dri_screen, make __DRIscreen opaque
This cleanup removes the dri_util structure __DRIscreen(Rec) that is
difficult to follow, and switches all code to using dri_screen directly.

It also inlines kopper_screen in dri_screen because I don't see any
other way to do this cleanup.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19741>
2022-11-27 02:52:42 +00:00
Marek Olšák
0a622f61ea frontend/dri: inline __DRIcontext in dri_context, make __DRIcontext opaque
This cleanup removes the dri_util structure __DRIcontext(Rec) that is
difficult to follow, and switches all code to using dri_context directly.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19741>
2022-11-27 02:52:42 +00:00
Marek Olšák
c65bde7b1e frontend/dri: inline __DRIdrawable in dri_drawable, make __DRIdrawable opaque
This cleanup removes the dri_util structure __DRIdrawable(Rec) that is
difficult to follow, and switches all code to using dri_drawable directly.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19741>
2022-11-27 02:52:42 +00:00
Marek Olšák
449a35a397 frontend/dri: replace the CopySubBuffer callback with a direct call
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19741>
2022-11-27 02:52:42 +00:00
Marek Olšák
2941eacb22 frontend/dri: replace the DestroyBuffer callback with a direct call
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19741>
2022-11-27 02:52:42 +00:00
Marek Olšák
f408bb647c frontend/dri: replace the DestroyScreen callback with a direct call
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19741>
2022-11-27 02:52:42 +00:00
Marek Olšák
d57284d673 frontend/dri: inline __DriverAPIRec
the vtable indirection was unnecessary

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19741>
2022-11-27 02:52:41 +00:00
Marek Olšák
e061affa7f frontend/dri: remove __DRIdrawableRec::dri2::stamp
It's practically unused. It was only off by one at initialization, but
that didn't have any effect.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19741>
2022-11-27 02:52:41 +00:00
Marek Olšák
f890714b70 frontend/dri: add comments describing drawable invalidation logic
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19741>
2022-11-27 02:52:41 +00:00
Marek Olšák
426f1cbea3 dri: move private __DRIDriverVtableExtension out of dri_interface.h
It's only used internally.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19741>
2022-11-27 02:52:41 +00:00
Marek Olšák
8cb8a3c03d glx,dri: simplify indirect function call syntax
just remove () and * and the space

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19741>
2022-11-27 02:52:41 +00:00
David Heidelberg
fbf93ef821 ci/amd: add raven flakes which was previously failing
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20022>
2022-11-26 23:35:53 +01:00
Bas Nieuwenhuizen
a97a6d0f0e radv: reserve space for the scissor in vkCmdBeginRendering.
Fixes: c7d0d328d5 ("radv: Set the window scissor to the render area, not framebuffer")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20014>
2022-11-26 14:35:54 +00:00
Tatsuyuki Ishi
2a3ed9521d radv: Enable rayTracingPipelineShaderGroupHandleCaptureReplay[Mixed].
Tested that a q2rtx gfxr capture replays correctly and without the
capture/replay feature warning.

I ran the CTS too, but it seems to be just giving out a pass without
testing the code path.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19949>
2022-11-26 13:57:56 +00:00
Tapani Pälli
dba75d345d nir: fix a leak of ralloc ctx in nir_opt_ray_query_ranges
Fixes following leak:

  ==7520== 48 bytes in 1 blocks are definitely lost in loss record 1,597 of 2,016
  ==7520==    at 0x484486F: malloc (vg_replace_malloc.c:381)
  ==7520==    by 0x5314A4E: ralloc_size (ralloc.c:117)
  ==7520==    by 0x5314A1F: ralloc_context (ralloc.c:104)
  ==7520==    by 0x6A95D68: nir_opt_ray_query_ranges (nir_opt_ray_queries.c:235)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: f5b6576585 ("nir: Add a pass for combining ray queries")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20002>
2022-11-25 22:04:52 +00:00
Lucas Stach
2de7d6d1d8 etnaviv: remove copy of resource level in etna_surface
Keeping a full copy of the resource level around in the surface is
confusing and this confusion has caused real bugs already. Get rid
of the copy by retrieving most of the information directly from the
etna_resource_level pointed at from the surface. Only the precomputed
offsets into the target and TS BOs need to be kept in the surface.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19814>
2022-11-25 21:30:40 +00:00
Lucas Stach
b6fa3cdb0e etnaviv: fix wrong surface TS clear size
Clearing ts_size - ts_offset bytes in a level means we are clearing the
TS region of all layers in the level starting from the surface layer, so
clearing one surface might corrupt all other layers of a resource level.
Use the correct size to clear only the requested TS region.

Cc: mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19814>
2022-11-25 21:30:40 +00:00
Lucas Stach
d9e2a7d6ad etnaviv: blt: use correct TS offset in clear operations
Using the ts_offset from the level means we are always clearing the
TS region of layer 0 of the level. Use the correct offset which takes
into account the layer offset.

Cc: mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19814>
2022-11-25 21:30:40 +00:00
Lucas Stach
58259e1437 etnaviv: fix ZS clear value computation
Instead of hand-rolling our own conversion and apparently getting the
rounding wrong, just use the common util function.

Fixes piglit test spec@!opengl 1.1@depthstencil-default_fb-clear

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19958>
2022-11-25 21:23:01 +00:00
Lucas Stach
4449b5a271 etnaviv: fix stencil operation without Z write
If stencil operations are enabled, we either need the full early or
late ZS stage, even if Z writes are disabled. Empirically the early
stage properly supports stencil operations, just need to be careful to
not mix early tests with late writes when stencil operations modify
the depth buffer.

Fixes piglit tests:
spec@!opengl 1.1@depthstencil-default_fb-copypixels
spec@!opengl 1.1@depthstencil-default_fb-readpixels
spec@!opengl 1.1@depthstencil-default_fb-blit

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19958>
2022-11-25 21:23:01 +00:00
Martin Roukala (né Peres)
ea3f73ba85 Revert "glx/dri: Fix DRI drawable release at MakeCurrent time"
This reverts commit 31b04e420b which
is also breaking KDE in some ways.

Fixes: #7674
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19972>
2022-11-25 20:08:45 +00:00
Martin Roukala (né Peres)
0cee008fee Revert "glx: Fix drawable refcounting for naked Windows"
This reverts commit 768238fdc0 which
is not only leading to memory leaks, but also reportedly breaks KDE
pretty badly.

Fixes: #7674, #7435
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19972>
2022-11-25 20:08:45 +00:00
Lucas Stach
797454edfc etnaviv: rs: fix blits with insufficient alignment for dual pipe operation
Up-aligning the blit height does not always work, as some blit targets
have a smaller padded height. Fall back to single pipe operation if
increasing the height alignment fails. Still try to do it opportunistically
as it improves performance when resolving MSAA targets.

Fixes: 0ff96aaef3 ("etnaviv: rs: fix MSAA alignment adjustment")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19991>
2022-11-25 19:06:28 +00:00
Lucas Stach
fd06b313b0 etnaviv: always use RS align when GPU has TEXTURE_HALIGN feature
Due to a logic bug we didn't always up-align the resource when the GPU
has the TEXTURE_HALIGN feature, which broke the RS blit when we need
to blit into a sampler shadow from a multi-tiled render target.

Fixes: 735718ed33 ("etnaviv: move etna_layout_multiple into etnaviv_resource.c")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19991>
2022-11-25 19:06:28 +00:00
Alyssa Rosenzweig
20cdc35fdb asahi: Add missing #include
Noticed when shuffling headers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19999>
2022-11-25 18:56:48 +00:00
Alyssa Rosenzweig
5e379acd31 asahi: Enable framebuffer compression
At 4K, glmark2 -bdesktop from 60fps to 86fps.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19999>
2022-11-25 18:56:48 +00:00
Alyssa Rosenzweig
59824c1ecb asahi: Fix incorrect debug string
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19999>
2022-11-25 18:56:48 +00:00
Alyssa Rosenzweig
9b80ebd86c asahi: Print debug info about unsupported blits
Black box for when we're going down.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19999>
2022-11-25 18:56:48 +00:00
Alyssa Rosenzweig
efa240b74b asahi: Don't hardcode is_dmabuf_modifier_supported
So we can add more modifiers more easily.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19999>
2022-11-25 18:56:48 +00:00
Asahi Lina
a6079e5aa8 asahi: Hook up compressed Z/S support on macOS
We still need to handle uncompressed depth on G13X, but that might never
actually happen in practice.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19999>
2022-11-25 18:56:48 +00:00
Asahi Lina
6f15873d44 asahi: Introduce compressed resource support
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19999>
2022-11-25 18:56:48 +00:00
Asahi Lina
78948c03f0 asahi: Identify compression-related XML
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19999>
2022-11-25 18:56:48 +00:00
Asahi Lina
bea975b298 ail: Add unit tests for compression
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19999>
2022-11-25 18:56:48 +00:00
Asahi Lina
0ba63d5c26 ail: Introduce support for compression
The main buffer is twiddled as before, but there's now also an auxiliary
compression buffer that we need to reserve space for.

With compression, the main buffer is aligned less. The macOS logic seems to be
to align to the page size only if the texture is both 3D and mipmapped, *and*
the layer stride is greater than the page size.

That's gated on compression being enabled. Page alignment seems to be needed for
uncompressed twiddled cube maps.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19999>
2022-11-25 18:56:48 +00:00
Sviatoslav Peleshko
478ffe7127 driconf/intel: Use fake vendor to WA bad detection in Source engine games
Source engine uses flawed device detection in Linux native OpenGL backend,
which causes it to use bad configurations for Intel devices and thus
not always render correctly. Workaround this by using vendor string that
does not include "Intel" in it.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7725
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19828>
2022-11-25 18:21:17 +00:00
Alyssa Rosenzweig
f9e11c71c7 asahi: Fix undefined behaviour with samplers
bind_sampler_states doesn't zero [nr_samplers, PIPE_MAX_SAMPLERS) so can get
non-null garbage samplers leading to a use-after-free (segfault derefencing
sampler) or a buffer overflow (writing samplers[] out).

Fixes crashes in Xonotic.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: dcow
Tested-by: dcow
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19994>
2022-11-25 18:11:10 +00:00
Alyssa Rosenzweig
b102f045ab asahi: Set GPR count accurately for background/EOT
Better occupancy, which is especially important when the background shader
does memory access (for reloads). On my 4K monitor, glmark2 -bdesktop fullscreen
from 95fps to 133fps.

At default settings, glmark2 -bterrain from 63fps to 71fps.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19997>
2022-11-25 18:02:42 +00:00
Alyssa Rosenzweig
bcba473eac asahi: Fix UB in union with logic ops
Colour mask written.

Fixes: 9dddbfeaef ("asahi: Fix logic ops")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19998>
2022-11-25 17:53:43 +00:00
Bas Nieuwenhuizen
8d83ffe531 radv/ci: Add coverage for ETC2 emulation.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19914>
2022-11-25 17:16:14 +00:00
Bas Nieuwenhuizen
13d755441c vulkan: Remove asserts that weren't valid for RADV ETC2 emulation.
Wasn't caught when radv was modified to use these helpers ...

Tried to move the aspects assert so it still checks application inputs.

Fixes: d9048e31a0 ("radv: Use vk_image_view as the base for radv_image_view")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19914>
2022-11-25 17:16:14 +00:00
Bas Nieuwenhuizen
eab61863c0 radv: Fix sampler types in ETC2 decode.
Otherwise we'd have a type mismatch vs texture fetches, which
is asserted upon these days.

Fixes: 1153db23f5 ("radv: Add ETC2 decode shader.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19914>
2022-11-25 17:16:14 +00:00
Bas Nieuwenhuizen
c6ec4925c0 radv: Use correct init order for ETC2 image views
Fixes: d9048e31a0 ("radv: Use vk_image_view as the base for radv_image_view")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19914>
2022-11-25 17:16:14 +00:00
Erik Faye-Lund
0685e330dd radeonsi: mark glx-multithread-texture as a flake
This has apparently been flaking for a while, so let's mark it as such.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7772
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20004>
2022-11-25 16:52:50 +00:00
Matt Coster
20747fabba pvr: debug: Add PPP sub-buffer support to CSB dumps.
This patch also includes the infrastructure for dumping sub-buffers in
print_sub_buffer() and new field types for floating and fixed point
decimals.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18948>
2022-11-25 16:42:55 +00:00
Matt Coster
97e54d69a9 pvr: csbgen: Remove TEXTURE_WRAP_VARYING-dependent fields
This patch removes all fields dependent on the TEXTURE_WRAP_VARYING,
feature which is not currently supported.

It also removes STATE_PPP_CTRL.trp which is conditional on another
unused feature.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18948>
2022-11-25 16:42:55 +00:00
Matt Coster
01f9601b02 pvr: debug: Add option to track pvr_bo allocations
This functionality should only need to be enabled when required by
other debug options.

While not used directly in this commit, it lays the groundwork for
dumping information from buffers referenced by other buffers.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18948>
2022-11-25 16:42:55 +00:00
Matt Coster
f9a234ef04 pvr: debug: Add "cs" debug option to dump control stream on job submit
With PVR_DEBUG=cs, the control stream will be dumped to stderr
immediately prior to every render or compute job submission.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18948>
2022-11-25 16:42:55 +00:00
Matt Coster
0432015265 pvr: debug: Add documentation for PVR_DEBUG environment variable
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18948>
2022-11-25 16:42:55 +00:00
Matt Coster
e6b752ff62 pvr: Add pvr_bo_cpu_map_unchanged() helper to load saved vbits on map
When HAVE_VALGRIND is set, vbits of the CPU mapping are stored when
pvr_bo_cpu_unmap() is called. They can be reloaded by calling
pvr_bo_cpu_map_unchanged() instead of pvr_bo_cpu_map(). The vbits are
not loaded by default on every map, since they could easily have been
changed by the device between the unmap/map calls. Only use
pvr_bo_cpu_map_unchanged() when you can safely assume that nothing has
changed in the underlying memory.

When HAVE_VALGRIND is not set, pvr_bo_cpu_map_unchanged() just inlines
to pvr_bo_cpu_map().

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18948>
2022-11-25 16:42:55 +00:00
Matt Coster
d51d79b450 pvr: csbgen: Generate enum-to-string functions for debugging
All enums should be unambiguous, so an error is raised when multiple
enum variants with the same value are encountered. When no enum
variants match the provided value, NULL is returned. This allows the
to-string functions to double as validators.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18948>
2022-11-25 16:42:55 +00:00
Matt Coster
f36c938c94 pvr: util: Add integer digit counting functions
These are (reasonably) fast helpers for computing the number of binary,
decimal or hexadecimal digits required to represent a given non-negative
integer.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18948>
2022-11-25 16:42:55 +00:00
Samuel Pitoiset
ccac91db7b radv: make sure to mark DCC as compressed on GFX11
The bit has moved to FDCC_ENABLE on GFX11.
Found by inspection.

Cc: 22.3 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/20005>
2022-11-25 15:22:18 +00:00
Rhys Perry
9b19a93319 ac/nir: combine shift translation
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
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/19966>
2022-11-25 14:40:22 +00:00
Rhys Perry
064336d359 ac/nir: mask shift operands
NIR shifts are defined to truncate the shift amount to the number of bits
needed to represent the bit-size of the value shifted. LLVM treats large
shifts as poison. This fix achieves NIR semantics for shifts.

As an example, a|(b << 32), where "a" is 32bits, should produce a|b
according to NIR (because 32&31 == 0).

This caused LLVM to incorrectly optimize "(a >> c) | (b << (32 - c))" to a
u2u32(pack_64_2x32(a, b) >> c) (v_alignbit_b32), when the original NIR
should have returned "a | b" if c==0.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19966>
2022-11-25 14:40:22 +00:00
Gert Wollny
d5217b024e virgl: Fix injection of double from const mov instruction
We only copy two components, we have to use the complete original source,
and we should rewrite the new source from scratch to avoid incorrect
dimension and indirect handling.

Fixes: 036d7172c (virgl: Move double operands to a temp to avoid double-swizzling bugs)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19975>
2022-11-25 11:54:18 +00:00
Samuel Pitoiset
762e5cccb5 radv: remove useless parenthesis in radv_cmd_buffer_flush_dynamic_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/19843>
2022-11-25 10:51:06 +00:00
Samuel Pitoiset
e9b3a6b81f radv: simplify handling logic op when it's not dynamic
The command buffer already emits ROP3_COPY if the logic op is disabled.

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/19843>
2022-11-25 10:51:06 +00:00
Samuel Pitoiset
470fbb35ef radv: fix and rework DISABLE_DUAL_QUAD setting
This bit can be enabled with various combinations and it looks better
to only emit it from the cmdbuf.

Fixes: 17b9aa92b7 ("radv: add support for dynamic logic op enable")
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/19843>
2022-11-25 10:51:06 +00:00
Samuel Pitoiset
0a327f9c7a radv: re-emit dynamic provoking vertex mode if primitive topology changed
The vertex shader depends on the primitive topology.

Fixes: 2cce8500de ("radv: add support for dynamic provoking vertex mode with NGG")
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/19843>
2022-11-25 10:51:06 +00:00
Samuel Pitoiset
de4de09a56 radv: re-emit dynamic depth clamp enable if depth clip enable changed
The depth clamp mode depends on depth clip enable/disable.

Fixes: e48c0fbd8f ("radv: add support for dynamic depth clamp enable")
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/19843>
2022-11-25 10:51:06 +00:00
Lionel Landwerlin
bbbc8e7ce7 anv: use the anv_state_pool address helper more
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19983>
2022-11-25 10:29:56 +00:00
Iago Toral Quiroga
08d34ca582 v3dv: allocate copy query pipelines lazily
Instead of creating all 8 pipeline combinations when we initialize
the device we create the pipelines when we need to use them. This
is probably better because applications are likely to always use
the same flags for the copy command, which means that only one
pipeline may be required.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19981>
2022-11-25 09:30:49 +00:00
Samuel Pitoiset
edc830be34 radv: fix memleak with link time optimizations and GPL
Do not clone the NIR when the driver retains NIR shaders because it
exits early, otherwise stage->nir will never be freed.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7768
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19973>
2022-11-25 08:46:38 +00:00
Erik Faye-Lund
16fd8b8324 docs/zink: update query requirements
These features are no longer required.

Reviewed-by: Soroush Kashani <soroush.kashani@imgtec.com>
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/19750>
2022-11-25 06:50:59 +00:00
Erik Faye-Lund
00a88f48fd mesa: do not require optional queries
The OpenGL specifications explicitly calls out these queries as allowing
zero bits, so these features aren't actually required to bump the OpenGL
version.

While we could in theory also enable the corresponding extensions
unconditionally, this risks breaking applications that assume that the
presence of the extensions are sufficient to use meaningfully use them,
like is the case with most other OpenGL extensions.

However, blocking more recent GL versions due to this seems like a bit
of an overreaction. So let's allow new OpenGL versions, but not the
extensions themselves.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19750>
2022-11-25 06:50:59 +00:00
Erik Faye-Lund
2906c468c1 mesa: support dummy queries for ARB_pipeline_statistics_query
Similar to ARB_occlusion_query / ARB_occlusion_query2, this extension
allows zero bits for the queries, meaning there's no actual hardware
requirements here.

So let's just report zero bits if the driver doesn't support the CAP,
and treat these queries as dummies like we already do for occlusion
queries.

We still don't expose the extension, this is just to make it possible to
allow the core OpenGL functionality without exposing the extension.

Reviewed-by: Soroush Kashani <soroush.kashani@imgtec.com>
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/19750>
2022-11-25 06:50:59 +00:00
Erik Faye-Lund
1b1e8873fe mesa: treat unsupported queries as dummies
It's legal in OpenGL to start a query even if the result will have zero
valid bits. It's not enough to just report zero bits, We need to also
prevent calling down into the driver with these invalid queries.

Because ARB_ES3_compatibility adds ANY_SAMPLES_PASSED and
ANY_SAMPLES_PASSED_CONSERVATIVE to the set of queries that support zero
bits, we also need to check for the corresponding indices.

Fixes: 0186e9e1c5 ("mesa: always support occlusion queries")
Reviewed-by: Soroush Kashani <soroush.kashani@imgtec.com>
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/19750>
2022-11-25 06:50:58 +00:00
Marek Olšák
c70eec86ef st/vdpau: fix interop with GL
Fixes: e00bb6cb98 - mesa/st: use tracked samplerview swizzle values
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7751

Tested-By: Veerabadhran.Gopalakrishnan@amd.com
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19961>
2022-11-24 19:47:49 -05:00
Alyssa Rosenzweig
4b19725ee5 panfrost: Revert "Require 64-byte alignment on imports"
This reverts commit 811f8a1946. As Alpine put it
-- this is causing more problems than it's fixing. Hotfix to revert the
offending commit until a more measured fix can be implemented.

Closes: #7731
Cc: mesa-stable
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Jan Palus
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19993>
2022-11-24 23:46:55 +00:00
Alyssa Rosenzweig
9f136fea8c agx: Use default SHAREABLE_SHADERS
No need to set this explicitly, u_default does it for us.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19971>
2022-11-24 23:37:48 +00:00
Alyssa Rosenzweig
6de5bd5f41 agx: Fix signedness issues packing
UBSan complains otherwise:

../src/asahi/compiler/agx_pack.c:701:21: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
../src/asahi/compiler/agx_pack.c:534:18: runtime error: left shift of 8 by 28 places cannot be represented in type 'int'

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19971>
2022-11-24 23:37:48 +00:00
Alyssa Rosenzweig
d608ca0363 agx: Handle vertex shaders that use <= 8 halfregs
r5 and r6 are always getting lowered. Will prevent a regression with VBO
lowering on a shader which has stride=0 and hence gets the vertex ID read
optimized out with NIR:

   dEQP-GLES2.functional.draw.random.50

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19971>
2022-11-24 23:37:48 +00:00
Alyssa Rosenzweig
94124925ca agx: Try to align sources of pack_64_2x32_split
Helps with coalescing the pack.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19971>
2022-11-24 23:37:48 +00:00
Alyssa Rosenzweig
442e29890d agx: Implement nir_op_pack_64_2x32_split
This maps to a collect where the dest size is 64 and the src size is 32.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19971>
2022-11-24 23:37:48 +00:00
Alyssa Rosenzweig
68e25f33da asahi: Allocate smaller scissor/zbias arrays
Don't waste 1MB per batch for descriptors that may be completely unused.
Instead, upload the scissor and depth bias arrays at submit time. This is a
simple solution to a silly problem: we can't grow the scissor/depth bias arrays,
and we don't know how big they will be at draw time. We could...

1. Statically allocate large buffers? Waste lots of memory.
2. Statically allocate small buffers? Forces too much flushing.
3. Dynamically allocate a growable GPU buffer? Requires either reading
   back write-combined memory contents, or maintaining a CPU copy in
   addition to extra GPU copies, or doing complicated MMU shenanigans.
   The first two options are slow and the last is complicated.

Instead, we upload these descriptors to a dynamically allocated CPU-side which
gets copied just once to the GPU at submit-time when the exact size is known,
minimizing wasted memory and copies and avoiding any unnecessary flushing or WC
memory reads.

In addition, this patch makes sure we flush if we would overflow with more than
65535 scissor descriptors in a batch. This is a (minor) bug fix.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19971>
2022-11-24 23:37:48 +00:00
Alyssa Rosenzweig
2baaff9cac asahi: Allocate/free batch BOs as needed
Rather than hanging onto them across batches. This lets us free these BOs if the
number of batches shrinks, which is pretty common if all 32 batches are used
during a loading screen for glGenerateMipmap() and then the in-game portion
drops to 1 or 2 batches only. Now that we have the BO cache wired up, this
should not adversely affect performance.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19971>
2022-11-24 23:37:48 +00:00
Alyssa Rosenzweig
04360a270e asahi: Copy panfrost's bo cache
Massive performance gains, some fps before/after numbers from glmark2:

   [shading] 1486 -> 2391
   [refract] 87   -> 127
   [terrain] 32   -> 56

...and it's basically for free with enough copy/paste, so thank you to Boris
Brezillon for an excellent Asahi patch, the LRU cache seems to work great on M1
:-p

There are a few minor changes I made from panfrost, notably adjusting the
constants to account for 16KiB pages and switching from pthread_mutex to
simple_mtx to be less weird in Mesa.

For context on the design, the following commits evolved it in Panfrost and
their commit messages may be useful... The logic in this module is the product
of years of mistakes and correcting course :-)

   f06809cdca ("panfrost: Evict the BO cache when allocation fails")
   77d0498913 ("panfrost: Fix major flaw in BO cache")
   ee82f9f07e ("panfrost: Try to evict unused BOs from the cache")
   2225383af8 ("panfrost: Make sure the BO is 'ready' when picked from the cache")
   9af4aeaaf7 ("panfrost: Don't return imported/exported BOs to the cache")

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19971>
2022-11-24 23:37:48 +00:00
Alyssa Rosenzweig
7c8e3963bd asahi: Stop aligning pool allocations to 4KiB
This defeats the point of specifying alignments and of packing allocations
together with the BO cache. We're a real driver now, let's allocate memory like
one.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19971>
2022-11-24 23:37:48 +00:00
Alyssa Rosenzweig
860f5d77c6 asahi: Label BOs internally
This will help debugging memory usage problems.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19971>
2022-11-24 23:37:48 +00:00
David Heidelberg
4a8134975e ci/alpine: bump to 3.17, new GCC 12 and LLVM 15
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19959>
2022-11-24 22:36:03 +01:00
David Heidelberg
629e940b2c ci/alpine: enable Mold linker
Alpine has Mold 1.7.1 in the repository.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19959>
2022-11-24 22:36:03 +01:00
Martin Roukala (né Peres)
c85d09bcdd radv/ci: do not create jobs that will fail outside of mesa's namespace
Mirror what is done for the freedreno project and do not allow manual
execution of jobs that require restricted access to a CI farm.

This fixes pushing new branches with non-radv-related changes.

Fixes: #7773
Reported-by: Erik Faye-Lund <kusmabite@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19984>
2022-11-24 18:06:47 +00:00
Italo Nicola
4b63667f31 hud: add GALLIUM_HUD_ROTATION option
The user can use GALLIUM_HUD_ROTATION={0,90,180,270} to rotate the hud
by the specified amount.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19854>
2022-11-24 17:13:46 +00:00
Timur Kristóf
8ec6cb06e3 ac/nir: Avoid data race with task shader payloads.
Device memory scope is necessary because we need to ensure there is
always a waitcnt_vscnt instruction in order to avoid a race condition
between payload stores and their loads after mesh shaders launch.

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/19967>
2022-11-24 13:18:37 +00:00
Erik Faye-Lund
a2a0ac21e4 docs/zink: add missing required device-feature
Seems I forgot to add this to the list of required features.

Fixes: eb0195358c ("zink: only inspect dual-src limit if feature enabled")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19779>
2022-11-24 12:57:46 +00:00
Erik Faye-Lund
13bccac5a7 zink: update textureCompressionBC requirement
The mesa state-tracker can now emulate all formats indicated by this
feature-flag, so we don't require this for OpenGL 4.2 any more.

It's however a good idea to support for power-usage and performance
reasons, saving on memory bandwidth. So let's move it to the
gl46_optimal block instead.

Fixes: e4ff42684b ("mesa/st: enable bptc extension with fallback")
Fixes: 2ea481b2f0 ("Zink: add Zink profiles file")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19779>
2022-11-24 12:57:46 +00:00
Erik Faye-Lund
754353c417 zink: fix incorrect requirements
These were in the wrong list all along.

Fixes: a466c2a783 ("zink: check for stores and atomics features")
Fixes: 2644835f03 ("zink: add missing required feature")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19779>
2022-11-24 12:57:46 +00:00
Erik Faye-Lund
b60bc52992 zink: remove needless requirements
We never required the uniform texel buffer bit for more than
bufferFeatures for a bunch of these formats.

Similarly, we *don't* need the uniform texel buffer bit for sampled
image access.

For the image-dimensions, the Mesa frontend doesn't validate the max 1D,
3D or Cube sizes, nor the max texture layers. So we'll expose GL 4.1
without these, even if that's not conformant.

Finally, we don't require robustImageAccess2 for OpenGL 4.3 at all. All
we need is the robustBufferAccess feature.

Fixes: 2ea481b2f0 ("Zink: add Zink profiles file")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19779>
2022-11-24 12:57:46 +00:00
Erik Faye-Lund
b707cf24a3 zink: fix json-errors in profile-file
There's some stray commas here, let's get rid of them.

Fixes: 2ea481b2f0 ("Zink: add Zink profiles file")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19779>
2022-11-24 12:57:46 +00:00
Iago Toral Quiroga
f71944ae0e v3dv: specialize query copy pipelines
Instead of having one shader that checks the various flags and emits
conditional code, create specialized pipelines for each relevant
combination of flags values so we can produce more optimized
pipelines with less conditional code for each scenario.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19770>
2022-11-24 12:21:59 +00:00
Iago Toral Quiroga
ae4351e939 v3dv: allocate one BO for both occlusion results and availability
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19770>
2022-11-24 12:21:59 +00:00
Iago Toral Quiroga
7a65b3f006 v3dv: reimplement occlusion queries
Our implementation was mostly CPU-based, with things such as query
resets and result copying handled in the CPU, as well as some aspects
of query availability tracking.

This new implementation handles all GPU-side query functions by
dispatching compute shaders to push the work to the GPU. This
involves query availability, reset and result copying.

For now, only occlusion queries are managed this way. Performance
queries can also be implemented in a similar fashion in the future
with some additional work, however, for timestamp queries our only
option to improve this would be to execute the actual timestamp in the
kernel, since we can't take a timestamp from a shader.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19770>
2022-11-24 12:21:59 +00:00
Iago Toral Quiroga
4050086439 v3dv: add a helper to create compute pipelines from nir
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19770>
2022-11-24 12:21:59 +00:00
Iago Toral Quiroga
cc9db4eac2 v3dv: reset pending cpu job state once processed
If we have any pending jobs queued in the command buffer state
to be emitted at the end of a given job, make sure we reset
that state once these have been processed.

cc: mesa-table

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19770>
2022-11-24 12:21:59 +00:00
Erik Faye-Lund
7906361787 Apply 1 suggestion(s) to 1 file(s)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19974>
2022-11-24 08:55:20 +00:00
Lionel Landwerlin
61bdc2a2e0 docs/perfetto: update section about vulkan app tracing
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 18e820009d ("common/utrace: Refactor and combine all envvars into `GPU_TRACES`")
Fixes: 8370a0d6bf ("common/utrace: Prefix all environment variables with `MESA_`")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19974>
2022-11-24 10:40:04 +02:00
Filip Gawin
a126ed19f9 r300: fix r300_max_vertex_count
(seems like we counted size twice)

Helps with:
dEQP-GLES2.functional.draw.draw_elements.points.single_attribute
dEQP-GLES2.functional.draw.draw_elements.points.multiple_attributes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19703>
2022-11-24 08:06:22 +00:00
Samuel Pitoiset
00bc06bc27 zink/ci: mark the two remaining GLES3 failures as CTS test bug
This means Zink/RADV could be conformant against GLES3!

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7395
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19932>
2022-11-24 07:41:20 +00:00
Martin Roukala (né Peres)
e3506dd06f radv/ci: don't download back the vkd3d-proton.cache files
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19930>
2022-11-24 06:54:44 +00:00
Martin Roukala (né Peres)
909fa621c4 radv/ci: set B2C_JOB_VOLUME_EXCLUSIONS in all jobs
This will also speed up the execution time of non-vkcts jobs.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19930>
2022-11-24 06:54:44 +00:00
Martin Roukala (né Peres)
bd743d7db5 radv/ci: do not sync back the install folder
When a job is over, we download back all the files generated by the
job. This however includes the mesa install/ folder which is close
to 1G in size.

This commit adds the install/ folder to the exclusion list for the
volume mirroring.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19930>
2022-11-24 06:54:44 +00:00
Martin Roukala (né Peres)
128a19caf1 radv/ci: run test automatically only for the mesa namespace
The Valve CI Farm uses allow lists for projects/users to prevent abuse,
so only enable automatic testing when running in the context of Mesa to
prevent failures in forks.

Suggested-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19930>
2022-11-24 06:54:44 +00:00
Yonggang Luo
3bf7791e93 util: Remove unused WIN32 and MSVC related staff in p_compiler.h
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19918>
2022-11-24 06:21:39 +00:00
Yonggang Luo
f70f20433b util: Rename PIPE_CDECL to UTIL_CDECL and moved into util/macros.h
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19918>
2022-11-24 06:21:39 +00:00
Yonggang Luo
b0203b5d47 util: Move EXCLUSIVE_CACHELINE and CACHE_LINE_SIZE macros into u_memory.h
They are coupled with MALLOC_STRUCT_CL,  so  move them into a single place and accessed consistently

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19918>
2022-11-24 06:21:39 +00:00
Yonggang Luo
50ab93afde util: Remove the latest PIPE_ALIGN_VAR in p_compiler.h
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19918>
2022-11-24 06:21:39 +00:00
Yonggang Luo
5670636598 clover: Fixes -Wundef in memory.cpp
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19926>
2022-11-24 04:33:07 +00:00
Yonggang Luo
172e8a0e6a gallium: Fixes -Wundef in draw_gs.c
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19926>
2022-11-24 04:33:07 +00:00
Yonggang Luo
84d6a615ea util: Fixes -Wundef in u_debug_stack_test.cpp
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19926>
2022-11-24 04:33:07 +00:00
Yonggang Luo
485505d550 util: Fixes -Wundef in u_qsort.h
Partial of: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7680

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19926>
2022-11-24 04:33:07 +00:00
Yonggang Luo
d1d2e0efcd mesa: Fixes -Wundef in arbprogparse.c
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19926>
2022-11-24 04:33:07 +00:00
Yonggang Luo
37e863f3c1 util: Fixes -Wundef in util/compiler.h
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19926>
2022-11-24 04:33:07 +00:00
Yonggang Luo
b461921ed8 gallivm: use valid LLVM_VERSION_MAJOR instead of LLVM_VERSION
Partial of: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7680
Fixes: 203920d4c6 ("gallivm: add atomic 32-bit float support")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19926>
2022-11-24 04:33:07 +00:00
Yonggang Luo
970c8dfd98 r600: Fixes -Werror,-Wunused-but-set-variable for clang-15
one of the error messages:
../../src/gallium/drivers/r600/r600_asm.c:2528:8: error: variable 'o' set but not used [-Werror,-Wunused-but-set-variable]
                        int o = 0;
                            ^

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19969>
2022-11-24 02:56:03 +00:00
Yonggang Luo
cdbe1ad570 aco: Fixes -Werror,-Wbitwise-instead-of-logical for clang-15 in aco_optimizer.cpp
error message:
error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19969>
2022-11-24 02:56:03 +00:00
Yonggang Luo
55b35e6193 mesa: fixes -Werror,-Wunused-but-set-variable for clang-15 in program_parse.y
error message:
src/mesa/program/program_parse.tab.c:1952:9: error: variable 'yynerrs' set but not used [-Werror,-Wunused-but-set-variable]
    int yynerrs = 0;
        ^

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19969>
2022-11-24 02:56:03 +00:00
Yonggang Luo
77c29bfffd mesa: indent fixes after replace tab with 3 space by find and replace in program/program_parse.y
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19969>
2022-11-24 02:56:03 +00:00
Yonggang Luo
59fb86ea6f mesa: replace tab with 3 space in mesa/program/program_parse.y by tools
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19969>
2022-11-24 02:56:03 +00:00
Thomas Debesse
20c936bee1 rusticl: print missing context features
Signed-off-by: Thomas Debesse <dev@illwieckz.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19498>
2022-11-23 23:55:29 +00:00
Alyssa Rosenzweig
bdc240e13e meson: Don't depend on expat for !use_xmlconfig
If we don't use xmlconfig, expat becomes an optional dependency on
Linux/BSD, which may be convenient for embedded systems that do not
otherwise need expat. (expat is so ubiquitous that this
probably doesn't matter a ton in practice, but fewer required Mesa deps
is probably nice anyway.)

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Suggested-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19626>
2022-11-23 23:14:10 +00:00
Alyssa Rosenzweig
6cd392cbe2 util: Gate installing drirc on use_xmlconfig
Pointless otherwise. This should shrink the on-disk size of the Android and
Windows builds slightly, but I have not tested this.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Suggested-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19626>
2022-11-23 23:14:10 +00:00
Alyssa Rosenzweig
662bb5977b util: Add xmlconfig build option
On embedded Linux, we can hardcode the driconf file (00-mesa-defaults.conf) with
no possibility of the file changing after the build. The static driconf
implementation, used on Windows and Android, suffices for that use case. It is
undesireable for these platforms to depend on expat or to spend time during app
start-up parsing driconf XML.

We already have the static driconf implemented, all we need is a meson option to
opt-out of runtime xmlconfig on Linux and use the static version instead.

To opt-out of runtime xmlconfig, build Mesa with -Dxmlconfig=disabled.

v2: Expand out feature.require() since it was only added in meson 0.59.0.

v3: Use more concise Meson syntax (Dylan)

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com> [v2]
Reviewed-by: Eric Engestrom <eric@igalia.com> [v2]
Reviewed-by: Emma Anholt <emma@anholt.net>
Tested-by: Chris Healy <healych@amazon.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19626>
2022-11-23 23:14:10 +00:00
Alyssa Rosenzweig
fb0a4a5d6c util: Define WITH_XMLCONFIG from Meson
This will allow us to disable runtime xmlconfig even outside of Windows/Android.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19626>
2022-11-23 23:14:10 +00:00
Alyssa Rosenzweig
fc6bb13945 zink: Don't check WITH_XMLCONFIG
It's not necessary -- no other driver does this despite most drivers having a
driconf check like Zink does -- and it adds a problematic cross-tree dependency.
This was been a relic from when xmlconfig didn't work at all on Windows, added
in commit 834b69d1ef ("zink: fix win32 build"). That has been replaced the
"static" xmlconfig only, which is good for almost everyone enough in practice.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19626>
2022-11-23 23:14:10 +00:00
Alyssa Rosenzweig
218ddd032e docs/features: Get Asahi on the board
We support a good chunk of GL 3.x now ... let's get us on the board so that
Mesamatrix can get onto solving the challenging problem of deciding what colour
to use for Asahi ;-)

Table filled out to the best of my abilities, there may be inaccuracies or
omissions.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19944>
2022-11-23 23:08:03 +00:00
Christian Gmeiner
4f5e59d114 etnaviv: Hide MSAA support behind debug flag
With the current level of MSAA support we have some real world rendering
problems in Chromium/Skia (issue #7678). Convert the MSAA support to an
explicit opt-in by settings ETNA_MESA_DEBUG=msaa.

Cc: 22.3 mesa-stable
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19870>
2022-11-23 21:12:11 +00:00
Eric Engestrom
4002640f8d docs: update calendar for 22.3.0-rc4
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19965>
2022-11-23 21:06:33 +00:00
Marek Olšák
3a406688f2 st/mesa: only call st_manager_validate_framebuffers at FBO change or SwapBuffers
Hopefully this doesn't break anything.

There are a lot of places that invalidate drawables, but no place attempted
to call the context directly like this. A few places don't even have
the context.

Explanation:

The DRI frontend uses a global atomic counter per drawable that is
incremented when that drawable changed buffers.
st_manager_validate_framebuffers checks for that atomic counter and
updates the framebuffer state if there is any change. This was called at
every state update, so likely before almost every draw (!!!).

This commit changes that. Everything is the same except that the change
of buffers will not be noticed until the beginning of the next frame or
when the framebuffer state update is triggered by something else.

The effect is that we don't waste time calling
st_manager_validate_framebuffers a million times per frame.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19775>
2022-11-23 20:37:02 +00:00
Alyssa Rosenzweig
044428211c pan/mdg: Fix out-of-order execution
We can go up to 15 instructions out of order (performance fix) but we
can't go past a branch (bug fix).

Fixes: 30a393f458 ("pan/mdg: Enable out-of-order execution after texture ops")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19762>
2022-11-23 20:23:50 +00:00
Danylo Piliaiev
af79e631ee freedreno/replay: Add option to replay specific range of cmdstreams
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19444>
2022-11-23 20:12:08 +00:00
Danylo Piliaiev
a7773c3c4c freedreno/rddecompiler: Add shader disasm/asm support
Now rddecompiler outputs shaders in editable assembly form.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19444>
2022-11-23 20:12:08 +00:00
Danylo Piliaiev
03d80e0a6d freedreno/decode: Add 'rddecompiler' tool
Decompiles a single cmdstream from .rd into compilable C source.
Given the address space bounds the generated program creates
a new .rd which could be used to override cmdstream with 'replay'.
Generated .rd is not replayable on its own and depends on buffers
provided by the source .rd.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19444>
2022-11-23 20:12:08 +00:00
Rob Clark
86d27ac4ff freedreno/cffdec: Add type0/type4 vs type3/type7 pkt helpers
The handling is the same, just the format differes for pre-a5xx vs later
gens, so split out some helpers to simplify this.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19444>
2022-11-23 20:12:08 +00:00
Rob Clark
13ab0088e0 freedreno/cffdec: Remove packet types
These don't add any value.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19444>
2022-11-23 20:12:08 +00:00
Rob Clark
00e2f9eff6 freedreno/cffdec: Remove dead code
pkt2 is already handled further down the if/else ladder.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19444>
2022-11-23 20:12:08 +00:00
Danylo Piliaiev
86e8b9339f freedreno/replay: Add option to override selected cmdstream
This adds an option to override a single cmdstream while replaying
.rd capture. Cmdstream for override is stored in the same .rd format,
where there is only one RD_CMDSTREAM_ADDR section and any amount
of buffers.

Instead of using provided .rd file, 'replay' calls external program
to generate it first, in order to be able to pass the range of
GPU addresses available for the new buffers.

Usage example:
 ./replay --override=13 --generator=~/cmdstream_gen

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19444>
2022-11-23 20:12:08 +00:00
Danylo Piliaiev
6d72407d39 freedreno/decode: Print cmdstream idx
Will be useful later for cmdstream substitution.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19444>
2022-11-23 20:12:08 +00:00
Danylo Piliaiev
060e168623 freedreno/decode: Move rd section parsing to a common header
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19444>
2022-11-23 20:12:08 +00:00
Eric Engestrom
4701508ec0 i915g: fix typo in #if
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19963>
2022-11-23 19:41:44 +00:00
Eric Engestrom
52a34309f6 iris: s/#if/#ifdef/ to fix -Wundef
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19963>
2022-11-23 19:41:44 +00:00
Eric Engestrom
8261f9ce4f freedredno: s/#if/#ifdef/ to fix -Wundef
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19963>
2022-11-23 19:41:44 +00:00
Eric Engestrom
cf520806b1 freedreno/ir3: fix -Wundef warning
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19963>
2022-11-23 19:41:44 +00:00
Eric Engestrom
0f0dac0f65 freedreno: fix HAVE_FREEDRENO_KGSL check
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19963>
2022-11-23 19:41:44 +00:00
Hans-Kristian Arntzen
55731f1d25 docs: Mark VK_KHR_present_wait as supported.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19279>
2022-11-23 19:06:12 +00:00
Hans-Kristian Arntzen
c78257e8b0 wsi/x11: Rewrite wait logic for ANI/WaitForPresentKHR.
When we need to poll the XCB connection with a non-trivial timeout,
be very careful to not hit an XCB bug where a poll() may hang for too
long even if an event is ready in the special event queue.

This is a pragmatic workaround, a wait_for_special_event_with_timeout()
is the only proper solution here.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19279>
2022-11-23 19:06:12 +00:00
Hans-Kristian Arntzen
c31ffe63ae wsi/x11: Mention problems with xcb_wait_for_special_event().
There is no pragmatic solution for this.
Comment about the rationale for doing it like this until we have a more
robust solution in XCB.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19279>
2022-11-23 19:06:12 +00:00
Hans-Kristian Arntzen
e3986a30e0 turnip: Conditionally enable VK_KHR_present_wait on Turnip.
Hide behind driconf.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Tested-by: Gabe Rowe <gaberowe@gmail.com>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19279>
2022-11-23 19:06:12 +00:00
Hans-Kristian Arntzen
4889be3883 anv: Conditionally expose VK_KHR_present_wait on ANV.
Gate it behind driconf query for now.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19279>
2022-11-23 19:06:12 +00:00
Hans-Kristian Arntzen
f1f78fa297 radv: Conditionally expose VK_KHR_present_wait on RADV.
Gate it behind driconf query for now.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19279>
2022-11-23 19:06:12 +00:00
Hans-Kristian Arntzen
c66248fb5b wsi/common: Allow present-wait to be unconditionally enabled.
If all potentially supported surface types support present wait,
we can expose the extension.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19279>
2022-11-23 19:06:12 +00:00
Hans-Kristian Arntzen
d071279710 driconf: Add DRI configuration for exposing VK_KHR_present_wait.
These extensions are flawed and do not support the concept of
per-surface queries. For the time being we cannot guarantee that we are
able to implement it on all surfaces, but the feature is useful enough
to make available as an opt-in feature for the time being, so hide it
behind an driconf until we have a better mechanism in place.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19279>
2022-11-23 19:06:12 +00:00
Hans-Kristian Arntzen
367fa98570 wsi/display: Implement VK_KHR_present_wait on KHR_display swapchain.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19279>
2022-11-23 19:06:12 +00:00
Hans-Kristian Arntzen
8fc7927787 wsi/x11: Implement VK_KHR_present_wait on X11.
Based on original implementation by Keith Packard in
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12086.

Also fixes the implementation to work on IMMEDIATE and MAILBOX
presentation modes and Xwayland.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19279>
2022-11-23 19:06:12 +00:00
Hans-Kristian Arntzen
c888da3d48 vulkan/wsi: Add mechanism to wait for WSI semaphore unsignal.
When vkWaitForPresentKHR succeeds, we are guaranteed
that any dependent semaphores have been unsignalled.

In an explicit sync world, we are guaranteed this automatically by
having a present complete, since that event must follow a semaphore wait
completion.

However, if the swapchain image is implicitly
synchronized, the semaphore might technically not have been unsignaled
before the present complete event triggers.

Present IDs must be signalled in monotonic order, same as timeline
semaphores.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19279>
2022-11-23 19:06:12 +00:00
Hans-Kristian Arntzen
339c0f6a7e vulkan/wsi: Refactor out wsi_init_pthread_cond_monotonic.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19279>
2022-11-23 19:06:12 +00:00
Daniel Stone
0aba2c604e vulkan/wsi: Add stub interface for VK_KHR_present_wait
Signed-off-by: Daniel Stone <daniels@collabora.com>
Co-authored-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19279>
2022-11-23 19:06:12 +00:00
LingMan
11f91505d9 intel/fs: Accept an unsigned int in fs_reg::fs_reg
The parameter `nr` is currenlty an `int` but it only gets assigned to an
`unsigned int`. Make it clear in the function signature what's actually
required.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19423>
2022-11-23 18:37:35 +00:00
LingMan
fc00314085 intel/fs: Preserve unsignedness in fs_visitor::split_virtual_grfs
GCC 12.2.0 warns:
../src/intel/compiler/brw_fs.cpp: In member function ‘bool fs_visitor::
split_virtual_grfs()’:
../src/intel/compiler/brw_fs.cpp:2199:10: warning: ‘void* memset(void*, int,
size_t)’ specified size between 18446744071562067968 and 18446744073709551615
exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
 2199 |    memset(vgrf_has_split, 0, num_vars * sizeof(*vgrf_has_split));

`num_vars` is an `int` but gets assigned the value of `this->alloc.count`,
which is an `unsigned int`. Thus, `num_vars` will be negative if
`this->alloc.count` is larger than int max value. Converting that negative
`int` to a `size_t`, which `memset` expects, then blows it up to a huge
positive value.

Simply turning `num_vars` into an `unsigned int` would be enough to fix this
specific problem, but there are many other instances where an `unsigned int`
gets assigned to an `int` for no good reason in this function. Some of which
the compiler warns about now, some of which it doesn't warn about.

This turns all variables in `fs_visitor::split_virtual_grfs`, which should
reasonably be unsigned, into `unsigned int`s. While at it, a few now pointless
casts are removed.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19423>
2022-11-23 18:37:35 +00:00
Philippe Lecluse
bd2dd03937 intel: Disable SSE2 instruction set if building for non x86 architectures
Signed-off-by: Philippe Lecluse <philippe.lecluse@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19812>
2022-11-23 16:57:23 +00:00
Philippe Lecluse
a821dfbda5 intel: Add SUPPORT_INTEL_INTEGRATED_GPUS build argument
This is meant to remove any integrated GPU only code paths that can't
be compiled in CPU architectures different than x86.

Discrete GPUS don't have need_clflush set to true so it was just
matter of remove some code blocks around need_clflush but was left a
check in anv_physical_device_init_heaps() to fail physical device
initialization if it ever became false.

Signed-off-by: Philippe Lecluse <philippe.lecluse@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19812>
2022-11-23 16:57:23 +00:00
Hans-Kristian Arntzen
f2e535e4fe vk/runtime: Fix narrowing of timeline signal and wait value to u32.
They are u64. Fixes deadlock in
dEQP-VK.wsi.xcb.present_id_wait.wait.past_no_timeout.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Fixes: 9bffd81f1c ("vulkan: Add common implementations of vkQueueSubmit
and vkQueueWaitIdle")

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19951>
2022-11-23 16:02:27 +00:00
Gert Wollny
913f99e90b r600/sb: Fix initialization order in sb_shader
Closes https://gitlab.freedesktop.org/mesa/mesa/-/issues/7608

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19955>
2022-11-23 15:51:28 +00:00
Lionel Landwerlin
99dcdf4d64 nir/divergence: add missing btd_shader_type_intel
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 6d9ae6ec1e ("intel: add a new intrinsic to get the shader stage from bindless shaders")
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19948>
2022-11-23 15:04:22 +00:00
Lionel Landwerlin
9bb055ff5d anv: generate correct addresses for state pool offsets
Fixes a number of CTS patterns on DG2 :

   - dEQP-VK.dynamic_rendering.primary_cmd_buff.random*
   - dEQP-VK.draw.*secondary_cmd*
   - dEQP-VK.dynamic_rendering.*secondary_cmd*
   - dEQP-VK.geometry.*secondary_cmd_buffer
   - dEQP-VK.multiview.*secondary_cmd*

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 9c1c1888d9 ("intel/fs: put scratch surface in the surface state heap")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19946>
2022-11-23 14:37:19 +00:00
Lionel Landwerlin
20e8e1eb06 blorp: support negative offsets in addresses
Similar to anv_address

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 9c1c1888d9 ("intel/fs: put scratch surface in the surface state heap")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19946>
2022-11-23 14:37:19 +00:00
Simon Ser
f0ddb389aa vulkan/device-select-layer: drop wayland-protocols dep
wayland-protocols is not a library, it just contains a bunch of
XML files. No need to try to link to it.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19894>
2022-11-23 12:15:23 +00:00
Simon Ser
b74a1c8fad panfrost: drop wayland-protocols dep
wayland-protocols is not a library, it just contains a bunch of
XML files. No need to try to link to it.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19894>
2022-11-23 12:15:23 +00:00
Simon Ser
d9f4e4a821 v3dv: drop wayland-protocols dep
wayland-protocols is not a library, it just contains a bunch of
XML files. No need to try to link to it.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19894>
2022-11-23 12:15:23 +00:00
Erik Faye-Lund
a4690750b7 gallium/draw: do not use trig to compute tangent
We've already done the expensive part of computing this without
trigenometry, e.g computing the length. So let's finish it off.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19899>
2022-11-23 10:39:00 +00:00
Erik Faye-Lund
089e724259 gallium/draw: properly fix short aalines
The fix we used to have for short smooth lines were incorrect, and
here's the real fix:

For lines shorter than one pixel, we need to clamp the length-wise
coverage to the line-length. That produces results that are consistent
with our approximation for longer lines.

Because we pass (length / 2) + 0.5 to the fragment shader instead of
the unmodified length, we need to spend a few instructions to
reconstruct the original width.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19899>
2022-11-23 10:39:00 +00:00
Erik Faye-Lund
20964181c1 aux/draw: vectorize aaline computations
This makes it a bit more similar to the TGSI version, which makes
modifying them easier to review.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19899>
2022-11-23 10:39:00 +00:00
Jimi Huotari
64e74b4277 driconf: disable glthread for FINAL FANTASY XI
Enabling 'glthread' here causes textures to be missing/invisible.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7562
Signed-off-by: Jimi Huotari <chiitoo@gentoo.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19935>
2022-11-23 10:03:04 +00:00
Samuel Pitoiset
4301f1d892 radv: fix number of PS samples with VK_AMD_mixed_attachment_samples
From the Vulkan spec:
    "If the VK_AMD_mixed_attachment_samples extension is enabled and
     the subpass uses color attachments, the samples value used to
     create each color attachment is used instead of
     rasterizationSamples."

Found by inspection, though I don't think this extension is widely
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/19907>
2022-11-23 07:52:13 +00:00
Martin Roukala (né Peres)
9eccb54dbf radv/ci: make use of the new VanGogh runners
I just added 3 new Steam Decks at my home CI, bringing the total count
to 5. Let's make use of 2 of these to reduce execution time in Mesa CI
and leave the last one available for DXVK-CI.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19929>
2022-11-23 07:20:47 +00:00
Lionel Landwerlin
1d9608be1a genxml: forbid usage of L1CC_WBP/L1CC_UC for stateless messages
We want to avoid those settings so that we do not have to emit a tile
fence to implement Wa_22013689345.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19322>
2022-11-23 06:54:04 +00:00
Lionel Landwerlin
945637514e intel/fs: improve Wa_22013689345 workaround
The initial implementation is a pretty big hammer. Implement the HW
recommendation to minimize cases in which we need a fence.

This improves by 10FPS on some of the Sascha Willems RT demos.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 6031ad4bf6 ("intel/fs: Add Wa_22013689345")
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19322>
2022-11-23 06:54:04 +00:00
Vinson Lee
86f353ed23 intel/perf: Fix memory leak.
Fix defect with Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable pass_array going out of scope leaks the storage it points to.

Fixes: d4cbb66506 ("intel/perf: support more than 64 queries")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19888>
2022-11-22 22:17:02 -08:00
José Roberto de Souza
15c1a9ed60 anv: Set 3DSTATE_RASTER API mode as recomended
TGL+ specification ask the API mode to be set to DX10.1 for Vulkan API.

BSpec: 46947
Reference: TGL PRMs, Volume 2d: Command Reference: Structures: 3DSTATE_RASTER_BODY
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19934>
2022-11-23 01:37:07 +00:00
Dawn Han
505a5bc79f venus: enable VK_KHR_push_descriptor
Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18988>
2022-11-23 01:21:34 +00:00
Dawn Han
933ca11f1a venus: implement vkCmdPushDescriptorSetWithTemplateKHR
Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18988>
2022-11-23 01:21:34 +00:00
Dawn Han
19f2b9d0bb venus: extend VkPipelineLayout lifetime for batched VkCmdPushConstants()
Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18988>
2022-11-23 01:21:34 +00:00
Dawn Han
91966f2eff venus: extend lifetime of push descriptor set layout
Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18988>
2022-11-23 01:21:34 +00:00
David Heidelberg
5ed2265fbf radeonsi/ci: update stoney fail -> flakes
Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19941>
2022-11-23 01:45:37 +01:00
David Heidelberg
321dc93276 ci: split arm_test into arm{hf,64}_test
Every barebone arm or aarch64 job depends on these.
When experimenting with CI, this job drags both kernel+rootfs_arm64 and armhf,
even when the latter is not used.

This should speed up development and relieve one instance for about 30 minutes
and overlap between finishing kernel+rootfs_arm64 and armhf jobs per change.

Here are some size stats:
old arm_test   904M (32+64)
new arm64_test 579M (64bit)
new armhf_test 402M (32bit)
---
both     ~ 981M (overhead is 81M overall, but never used together so it's only cost "at rest")

Runtime of the arm*_test jobs is ~ 2 minutes.

Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: "Sergi Blanch Torné" <sergi.blanch.torne@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19550>
2022-11-22 22:00:06 +00:00
Emma Anholt
f4b7b73df4 ci/iris: Drop EGL copyteximage2d.12 xfail.
It is still marked as a flake (along with other copyteximage cases) on all
these boards, so this will reduce the CI IRC channel noise given that we
actually expect a Pass.  I haven't found where exactly in history we went
from generally-fail to generally-pass, but it looks like around Feb 2022.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19912>
2022-11-22 21:28:02 +00:00
Emma Anholt
bffb7153a1 ci/llvmpipe: Add headless Wayland testing using weston.
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19912>
2022-11-22 21:28:02 +00:00
Emma Anholt
207f9677f6 ci/llvmpipe: Drop NIR stress testing from deqp-egl.
This was a pasteo from deqp-gles31.

Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19912>
2022-11-22 21:28:02 +00:00
Emma Anholt
05ae56adea ci/vc4,v3d: Add headless wayland testing using weston.
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19912>
2022-11-22 21:28:02 +00:00
Emma Anholt
1c59c10deb ci/iris: Add headless Wayland testing using weston.
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19912>
2022-11-22 21:28:02 +00:00
Emma Anholt
76831b6344 ci/freedreno: Add wayland testing using weston.
Take the old EGL job and make it a suite, stop segregating the reset tests
now that we assign reset blame appropriately, and add a variant using
headless weston.  This catches two failures we weren't covering before.

Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19912>
2022-11-22 21:28:02 +00:00
Emma Anholt
bdf66c44f0 ci/freedreno: Drop EGL wide_color and create_context flakes.
Haven't seen them since May 2021, when my current set of IRC logs start.
The color_clears, render, and sharing.gles2 flakes are definitely still
there.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19912>
2022-11-22 21:28:02 +00:00
Emma Anholt
2e99c85c7d ci/freedreno: Expire an old robustness flake.
Last happened in January, and Rob made great strides in reset stability
since then so I think it's gone.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19912>
2022-11-22 21:28:02 +00:00
Emma Anholt
6af1fbc251 ci/deqp-runner: Drop dead code for DEQP_CASELIST_FILTER.
The last user is now gone.

Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19912>
2022-11-22 21:28:02 +00:00
Emma Anholt
eb699d8014 ci/freedreno: Stop segregating reset tests from non-reset tests in EGL.
Now that we assign reset blame appropriately, they're safe to run
together, and no single-threading.  I put these in a .toml because I'm
about to add another window system.

Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19912>
2022-11-22 21:28:02 +00:00
Emma Anholt
ac2b84b8c2 ci: Add weston to our rootfses for wayland testing.
We want to be able to test the wayland EGL platform code in Mesa, which
has had no coverage yet.

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19912>
2022-11-22 21:28:02 +00:00
Emma Anholt
307700ad12 ci/softpipe: Add another blit flake.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19912>
2022-11-22 21:28:02 +00:00
Emma Anholt
19c7d18831 ci/llvmpipe: Update some flakes/skips from IRC logs.
Acked-by: David Heidelberg <david.heidelberg@collabora.com> (prev version)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19912>
2022-11-22 21:28:02 +00:00
Mauro Rossi
e74d989a69 r600/sfn: allow building with clang 6 (Android 9)
static constexpr const 'value' is replaced by static function
in all type_char template specializations
to avoid the following building errors happening with clang 6

/home/utente/pie-x86_kernel/prebuilts/clang/host/linux-x86/clang-4691093/bin/ld.lld: error: undefined symbol: r600::type_char<r600::ExportInstr>::value
>>> referenced by sfn_scheduler.cpp
>>>               sfn_sfn_scheduler.cpp.o:(bool r600::BlockSheduler::collect_ready_type<r600::ExportInstr>(std::__1::list<r600::ExportInstr*, std::__1::allocator<r600::ExportInstr*> >&, std::__1::list<r600::ExportInstr*, std::__1::allocator<r600::ExportInstr*> >&)) in archive src/gallium/drivers/r600/libr600.a
...
/home/utente/pie-x86_kernel/prebuilts/clang/host/linux-x86/clang-4691093/bin/ld.lld: error: undefined symbol: r600::type_char<r600::RatInstr>::value
>>> referenced by sfn_scheduler.cpp
>>>               sfn_sfn_scheduler.cpp.o:(bool r600::BlockSheduler::collect_ready_type<r600::RatInstr>(std::__1::list<r600::RatInstr*, std::__1::allocator<r600::RatInstr*> >&, std::__1::list<r600::RatInstr*, std::__1::allocator<r600::RatInstr*> >&)) in archive src/gallium/drivers/r600/libr600.a
clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)

Cc: "22.2" "22.3" mesa-stable
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19873>
2022-11-22 21:30:56 +01:00
Samuel Pitoiset
ce11c06429 aco: fix emitting DEALLOC_VGPRS in the discard block
It should be emitted right before s_endpgm.

Cc: 22.3 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/19931>
2022-11-22 19:52:04 +00:00
Samuel Pitoiset
c9f0b7b042 radv: fix possible hangs with NGG streamout and secondary cmdbuf
This was missing but it might hang if streamout is used only in
secondary command buffers.
Found by inspection.

Cc: 22.3 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/19801>
2022-11-22 19:25:52 +00:00
Samuel Pitoiset
3189be249d radv: fix NGG streamout when it's never enabled in runtime
If a shader has XFB outputs but the application never enables
streamout in runtime (no buffers bound and no begin/end pair), we
have to disable it in the shader by emitting buffer size as 0. It's
also still needed to remember that the cmdbuf needs GDS/GDS OA BOs,
so move this at pipeline bind time instead.

Cc: 22.3 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/19801>
2022-11-22 19:25:52 +00:00
Samuel Pitoiset
6a2bcce882 radv: re-mit streamout buffers to unbind them when NGG streamout is disabled
A buffer size as 0 acts like if streamout is disabled with NGG.

Cc: 22.3 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/19801>
2022-11-22 19:25:51 +00:00
Samuel Pitoiset
5b60949155 radv: enable NGG XFB queries only if streamout is enabled
Otherwise, it's possible to increase counters if a shader has XFB but
the application paused it.

Cc: 22.3 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/19801>
2022-11-22 19:25:51 +00:00
Samuel Pitoiset
ba81dcf971 radv: fix computing the pervertex LDS size with NGG streamout
The NGG streamout lowering pass allocates space for all outputs which
means we have to align our computation. Otherwise, the maximum number
of vertices is incorrect and we end up by reaching the maximum allowed
LDS size. This code could be shared instead of being duplicated but
that's for later.

Fixes some transform feedback tests with Zink and
RADV_PERFTEST=ngg_streamout on GFX10.3.

Cc: 22.3 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/19801>
2022-11-22 19:25:51 +00:00
Samuel Pitoiset
499abeba60 radv: stop overallocating LDS for VS/TES when NGG streamout is enabled
The number of shader outputs should only be considered when the
shader has XFB, otherwise we are overallocating LDS.

fossils-db (GFX1100):
Totals from 16602 (12.31% of 134913) affected shaders:
LDS: 17000448 -> 8500224 (-50.00%)

Cc: 22.3 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/19801>
2022-11-22 19:25:51 +00:00
noasakurajin
8b8d14f906 add zink to macos ci
This commit causes zink to be build in the macos ci on every commit.
 In addition to that meson will now error if there is no moltenvk-dir
 given on macos since the build would fail anyways.

 Reviewed-by: Eric Engestrom <eric@igalia.com>
 Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19531>
2022-11-22 19:04:13 +00:00
Christian Gmeiner
e244b0f8b2 etnaviv: nir: lower extract byte/word
Fixes e.g. 'Unhandled ALU op: extract_u16' seen with deqp on gc7000.

Cc: 22.3 mesa-stable
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19776>
2022-11-22 18:39:12 +00:00
Christian Gmeiner
7d78fe4a86 etnaviv: Support negative float inline immediates
Closes: #7652
Fixes: 45a111c21c ("nir/opt_algebraic: Fuse c - a * b to FMA")
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19776>
2022-11-22 18:39:12 +00:00
Lucas Stach
74ff3f70bb etnaviv: fix NULL pointer dereference in TS allocation
Commit c2b06e1a38 ("etnaviv: add support for sharing the TS buffer")
introduced a problem similar to the one fixed in 3b3cd51286 ("etnaviv:
fix renderonly check in etna_resource_alloc") in a different code path.
This causes a NULL pointer dereference when the screen is instanciated
on the render node. Fix it in the same way by just checking for a valid
pointer.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19923>
2022-11-22 18:30:41 +00:00
Lionel Landwerlin
3aadbb9fde anv: enable sample location enable dynamic state
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19925>
2022-11-22 17:04:33 +00:00
Pedro J. Estébanez
c869d1cb62 microsoft/nir_to_dxil: Avoid emitting SampleCmpLevel prior to SM 6.7 if possible
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19896>
2022-11-22 16:49:36 +00:00
Tomeu Vizoso
b07d57e481 rusticl: Emit build-id in libRusticlOpenCL
Drivers may need it for their on-disk shader caches.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19927>
2022-11-22 15:22:40 +00:00
Eric Engestrom
321d1d355b v3d: make format/modifier logic easier to read
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19900>
2022-11-22 14:53:18 +00:00
Constantine Shablya
c2695dac5a nir: convert nir_opt_idiv_const to nir_shader_instructions_pass
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19881>
2022-11-22 14:04:13 +00:00
Lucas Stach
e83c01919f etnaviv: remove use of flush_seqno as trigger for texture cache invalidate
The flush_seqno is only to be used/updated when a dirty tile status has
been written back to the resource. Using it as a marker to trigger a
texture cache invalidation is bogus and not actually needed. When the
texture resource is updated via a mapping or blit the texture cache
invalidation is already triggered by marking the caches as dirty. If the
resource is updated by fragment output, OpenGL explicitly defines the
result of a later texture read as undefined unless a TextureBarrier is
inserted, which also properly triggers the texture cache invalidate.

Also the current check is bogus as it doesn't handle seqno wraparound.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19800>
2022-11-22 13:55:29 +00:00
Lucas Stach
2f86639ea3 etnaviv: mark texture caches as dirty when blitting into a sampler resource
Same as with resource mappings the blit can target a resource that may be
cached in the texture cache. Mark the cache as dirty to make sure it is
invalidated before the next draw.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19800>
2022-11-22 13:55:29 +00:00
Lucas Stach
215613ba35 etnaviv: drop useless ts_for_sampler_view pointer check
Both state and desc texture implementations set this function pointer,
so there is no point in guarding against its absence.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19800>
2022-11-22 13:55:29 +00:00
Marek Olšák
d871958702 st/mesa: suppress async glthread flushing for GLX_EXT_texture_from_pixmap
This might fix some window system issues.

Fixes: 3da170faae - glthread: change when glFlush flushes asynchronously

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19809>
2022-11-22 13:04:30 +00:00
Lionel Landwerlin
5ebf72c44c util/glsl2spirv: don't store preprocessed files in source tree
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19893>
2022-11-22 12:25:12 +00:00
Danylo Piliaiev
1b492d5031 freedreno,tu,ir3: DCE ij_pix
SP_FS_PREFETCH_CNTL.IJ_WRITE_DISABLE allows disabling ij write, so
now we could DCE it.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19652>
2022-11-22 11:56:21 +00:00
Danylo Piliaiev
c7c186590c freedreno,tu: Update SP_FS_PREFETCH,SP_FS_PREFETCH_CNTL regs definition
Reverse engineer more fields of these regs.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19652>
2022-11-22 11:56:21 +00:00
Marek Olšák
c1a0f4b8fa mesa: add unlikely() and adjust error handling in BindBuffer
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19844>
2022-11-22 11:12:28 +00:00
Marek Olšák
c924cfae42 mesa: add no_error support into get_buffer_target()
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19844>
2022-11-22 11:12:28 +00:00
Marek Olšák
ba91328444 mesa: remove ctx->Extensions.EXT_pixel_buffer_object capability flag
to get rid of the fail path in get_buffer_target.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19844>
2022-11-22 11:12:28 +00:00
Lucas Stach
0fb813526e etnaviv: fix tile status interaction with write mappings
This fixes a longstanding bug in the interaction between TS and a write
mapping. The write does not update TS regardless of the way the update
is done. Update via etna_copy_resource would just set the target ts_valid
to false without actually writing back any dirty TS to the resource.
Writes via the CPU would update the resource, but keep ts_valid at true
even if the tile status may now not match the actually written tiles of
the resource anymore.

Fix this by writing back a dirty TS to the target resource if needed
before updating the level with the write data. Always invalidate TS,
even when the update is done by the CPU.

Cc: mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19846>
2022-11-22 10:01:56 +00:00
Lionel Landwerlin
f7d6c6e1ed anv: fixup context initialization on DG2
Fixing a typo :(

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 507a86e131 ("anv: ensure CPS is initialized when KHR_fragment_shading_rate is disabled")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19922>
2022-11-22 09:26:23 +00:00
Frank Binns
c580172701 CODEOWNERS: add MTCoster as an Imagination maintainer
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19845>
2022-11-22 09:24:43 +00:00
Yonggang Luo
af50f6a490 util: Remove EXPLICIT_CONVERSION macro and use c++11 explicit directly
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19895>
2022-11-22 15:42:15 +08:00
Yonggang Luo
8c32686116 tree-wide: Fixes multi-line macro width after replace to __func__
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19861>
2022-11-22 06:53:47 +00:00
Yonggang Luo
c24e2428ad gallium: __FUNCTION__ now never be used, remove it
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19861>
2022-11-22 06:53:47 +00:00
Yonggang Luo
6f4dc9b807 gallium: Replace the usage of __FUNCTION__ with __func__ in all gallium code
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19861>
2022-11-22 06:53:47 +00:00
Yonggang Luo
40a9fc57aa tree-wide: Use __func__ instead of __FUNCTION__ in non-gallium code
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19861>
2022-11-22 06:53:46 +00:00
Danylo Piliaiev
703d85485f meson: do not use source_root() when possible
source_root() function is deprecated in Meson version 0.56.0 because
it returns the source root of the parent project if called from a
subproject.

Why would anyone need Mesa as a meson subproject?
It would be used as subproject in a project generated by command buffer
"decompiler" for Freedreno.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19901>
2022-11-22 06:11:07 +00:00
Qiang Yu
74ad255c8c ac/nir/cull: fix culling for lines
Acked-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/19868>
2022-11-22 05:46:06 +00:00
Qiang Yu
d18a28ae87 ac/nir/ngg,radv: use intrinsic base for instance_rate_inputs check
radeonsi use packed location base while radv use un-packed location.
So we adjust instance_rate_inputs in each driver to hide the difference.
Note the attribute slot number is less than 16, so we can shift
instance_rate_inputs in radv by VERT_ATTRIB_GENERIC0 which is 16.

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/19868>
2022-11-22 05:46:06 +00:00
Jason Ekstrand
9cec1ed51d vulkan: Add a dummy vk_common_CmdSetColorBlendAdvancedEXT()
The entrypoint needs to exist but we don't need to do anything with it.

Fixes: 13c422e1b2 ("anv: toggle on EXT_extended_dynamic_state3")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19817>
2022-11-22 05:09:17 +00:00
Jason Ekstrand
182aa9eb15 vulkan: Add a common implementation of CmdSetSampleLocationsEnableEXT
Fixes: 13c422e1b2 ("anv: toggle on EXT_extended_dynamic_state3")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19817>
2022-11-22 05:09:17 +00:00
Jason Ekstrand
b172fd62f5 vulkan: Add state for extraPrimitiveOverestimationSize
Fixes: 13c422e1b2 ("anv: toggle on EXT_extended_dynamic_state3")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19817>
2022-11-22 05:09:17 +00:00
Karol Herbst
fa99fc3491 rusticl: advertise conformance on 12th Intel iGPUs
Submission can be found here:
https://www.khronos.org/conformance/adopters/conformant-products/opencl#submission_405

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Hard-reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19699>
2022-11-22 04:42:19 +00:00
Lionel Landwerlin
507a86e131 anv: ensure CPS is initialized when KHR_fragment_shading_rate is disabled
We need to set CPS_MODE_NONE when no per coarse pixel dispatch.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 231651fd89 ("anv: implement VK_KHR_fragment_shading_rate")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19867>
2022-11-22 03:53:57 +00:00
Lionel Landwerlin
62f12c2dad anv: fix 3d state initialization
We missed a couple of restriction leading to inconsistent 3d pipeline
state. It is mostly noticeable when doing a multiple sample dispatch
as the verify first 3d operation.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7531
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19867>
2022-11-22 03:53:57 +00:00
Ian Romanick
f75c83c4aa nir/loop_analyze: Fix get_iteration for nir_op_fneu
Consider the loop:

    float i = 0.0;
    while (true) {
       if (i != 0.0)
          break;

       i = i + 1.0;
    }

This loop clearly executes exactly one time.

Some trickery is necessary to handle cases where the initial loop value
is very large and the increment is, by comparison, very small.  From the
fenu_once test case,

    float i = -604462909807314587353088.0;
    while (true) {
       if (i != -604462909807314587353088.0)
          break;

       i = i + 36028797018963968.0;
    }

This loop should also execute exactly once, but this is much more
challenging to calculate due to precision issues.

Going towards smaller magnitude (i.e., adding a small positive value to
a large negative value) requires a smaller delta to make a difference
than going towards a larger magnitude. For this reason,
-604462909807314587353088.0 + 36028797018963968.0 !=
-604462909807314587353088.0, but -604462909807314587353088.0 +
-36028797018963968.0 == -604462909807314587353088.0. Math class is
tough.

No changes in shader-db or fossil-db.

v2: Fix major bug in checking result of the eval_const_binop(nir_op_feq,
...) discovered while developing fneu_once_easy unit test. Fix a typo in
the comment just above that. Add fneu_once_easy test.

v3: Skip the iteration count adjustment tests for nir_op_fenu and
nir_op_ine. Since the iteration count is either 1 or unknown, all this
function can do is add numerical error. Add fenu_once tests.

v4: Change the initial value in the fneu_once test from large positive
to large negative. Change check in get_iteration from nir_op_fsub to
nir_op_fadd. Both changes from discussion with M Henning. Also add some
more explanation in fneu_once.

v5: Rename test cases.

Fixes: 6772a17acc ("nir: Add a loop analysis pass")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19732>
2022-11-22 03:18:54 +00:00
Ian Romanick
d9f014401b nir/loop_analyze: Fix get_iteration for nir_op_ine
I discovered this problem because adding an algebraic transformation to
convert some uge and ult to ieq or ine caused a couple loops to stop
unrolling. Consider the loop:

    uint i = 0;
    while (true) {
       if (i >= 1)
          break;

       i++;
    }

This loop clearly executes exactly one time. Note that uge(x, 1) is
equivalent to ine(x, 0). Changing the condition to 'if (i != 0)' will
also execute exactly one time.

In the added test cases, uge_once correctly get an exact loop trip count
of 1. Without the changes to nir_loop_analyze.c, the ine_once case
detects a maximum loop trip count of zero and does not get an exact loop
trip count.

No changes in shader-db or fossil-db.

v2: Move nir_op_fneu changes to a separate commit.

v3: Rename test cases.

Fixes: 6772a17acc ("nir: Add a loop analysis pass")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19732>
2022-11-22 03:18:54 +00:00
Ian Romanick
dbad33da16 nir/loop_analyze: Add basic unit test framework
This test comes from a comment in the loop analysis code.

The ine_zero test checks that zero iteration loops involving ine are
correctly identified.

v2: Add ine_zero test. Suggested by Tim.

v3: Rename test cases.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19732>
2022-11-22 03:18:54 +00:00
Karol Herbst
b51eb98cf6 rusticl/device: put space at the end of CL_DEVICE_VERSION
Apparently some software relies on that and the spec kind of says it's
there.

Fixes: 20c90fed5a ("rusticl: added")
Reported-by: sobkas
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19872>
2022-11-22 03:10:33 +00:00
Adam Jackson
3732c7aa63 egl: Fix uninitialized variable warning
Fedora's gcc 12.2.1 says:

    ../src/egl/main/eglapi.c: In function ‘eglDupNativeFenceFDANDROID’:
    ../src/egl/main/eglapi.c:2268:11: warning: ‘ret’ may be used uninitialized [-Wmaybe-uninitialized]
     2268 |    EGLint ret;

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19913>
2022-11-22 01:54:51 +00:00
Pavel Ondračka
90df5c3b5f r300: don't reuse destination registers when lowering
Regalloc can sort it out later. No significant change is shader-db, the
one instruction reduction is likely because some optimize pass can
actually work better when we are closer to ssa-like form.

RV530:
total instructions in shared programs: 133718 -> 133717 (<.01%)
instructions in affected programs: 47 -> 46 (-2.13%)
helped: 1
HURT: 0

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19853>
2022-11-22 01:45:19 +00:00
Pavel Ondračka
b33845cf24 r300: simplify rc_find_free_temporary
Back when we had a stupid register allocator we did a lot of tricks to
optimize the register usage. The old version of rc_find_free_temporary
did a full program search each time it was called to find out what
registers and channels are actually used and than used that info to give
us the first free register to use.

Now that we have a proper register allocator both for vertex and
fragment shaders, this is no longer needed. Just scan the program when
called for the first time to find the first unused temporary index and
than increment by one everytime. Regalloc can sort it out later.

No change in shader-db confirms this assumption is sound.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19853>
2022-11-22 01:45:19 +00:00
Rob Clark
ded82cf4bd freedreno/a6xx: Remove unneeded MSAA clear fallback
This was added in commit 911ce374ca ("freedreno/a6xx: Fix MSAA clear"),
but the only case that can't handle fast-clear is sysmem blitter clear
path.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19884>
2022-11-21 23:38:56 +00:00
Rob Clark
87563e64c9 freedreno/a6xx: Use fallback path for MSAA clear_texture()
The trick for emulating MSAA clear by adjusting blit coords tends to
fall over with tiled/ubwc, so just use the fallback path instead.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19884>
2022-11-21 23:38:56 +00:00
David Heidelberg
042f006a43 .gitignore: add VSCode and VSCodium
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19902>
2022-11-21 23:09:30 +00:00
David Heidelberg
c415d8f08b ci: ci_run_n_monitor.py: fail when job is not found
Acked-by: Emma Anholt <emma@anholt.net>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19902>
2022-11-21 23:09:30 +00:00
Emma Anholt
50c7abefa6 ci/freedreno: add some missing a630 flakes.
Two from the GL 4.5 update, one that's been around longer.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19905>
2022-11-21 22:45:46 +00:00
Emma Anholt
be64e0cdc0 ci/turnip+zink: Generalize the 16-bit copy_image fails.
We just had another fail of the non_compressed texture2d_array group, and
we've got enough of a pattern here.

I left in the specific cases that had some debug info, though.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19905>
2022-11-21 22:45:46 +00:00
Alyssa Rosenzweig
70f40ea4d3 asahi: Wire up all BCn formats
We have these native. Passes the relevant piglits. Large reduction in memory
usage on Xonotic on higher settings (8x less memory per texture), which allows
Xonotic to run at high settings without OOMing.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Tested-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19903>
2022-11-21 22:33:43 +00:00
Gert Wollny
e496d24cb2 virgl: don't a use staging when a resources created with the shared flag
There seems to be a problem with running firefox by using Xwayland that
results in a shared resources being not always tagged as using staging.

As a result one process tries to map the resource that was allocated as
one that uses staging without actually using the staging resource, and
hence the mapped range only accounts for the small region that we have
to allocated because a zero-allocation doesn't work, but the application
mapping the resource assumes that a properly sized range is mapped, and
consequently this results in invalid memory access.

To work around this issue disable creating staging for resources that
are created by using shared binding. It is not clear to me whether this
is the best fix, but it seems to quell the issue.

Fixes: c9d99b7eec
    virgl: Fix texture transfers by using a staging resource

Related: https://gitlab.freedesktop.org/virgl/virglrenderer/-/issues/291
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19655>
2022-11-21 21:37:50 +00:00
Sajeesh Sidharthan
c22fbeb72a gallium/drivers: copy only the actual number of slice parameters
currently max number of slice(tile) parameters are copied for av1.
copy only actual number of slice parameters

Signed-off-by: Sajeesh Sidharthan <sajeesh.sidharthan@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19878>
2022-11-21 20:14:21 +00:00
Rhys Perry
368be87255 nir/algebraic: shrink 64-bit bitwise operations with 0/-1 constant half
fossil-db (navi21):
Totals from 457 (0.34% of 135636) affected shaders:
Instrs: 259349 -> 250383 (-3.46%)
CodeSize: 1411976 -> 1369136 (-3.03%)
Latency: 2175961 -> 2148158 (-1.28%)
InvThroughput: 502206 -> 490244 (-2.38%)
Copies: 15238 -> 15232 (-0.04%); split: -0.07%, +0.03%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19748>
2022-11-21 17:34:46 +00:00
Konstantin Seurer
8133d5551d radv/rt: Return the correct result for requested deferral
We do not implement deferred host operations so we will return
VK_OPERATION_NOT_DEFERRED_KHR for now.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19882>
2022-11-21 16:59:41 +00:00
Sajeesh Sidharthan
8d8caa44bd frontends/va: remove unused slice_param_idx variable
slice_param_idx was added to handle multiple slice params.
it's not used anymore.

Signed-off-by: Sajeesh Sidharthan <sajeesh.sidharthan@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19877>
2022-11-21 16:45:42 +00:00
Rhys Perry
3061bc792d aco: ensure MRT0 is written with dual source blending
Fixes crucible test func.shader.dualsrc_mrt0_undef on polaris10.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: 22.3 mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19806>
2022-11-21 15:01:56 +00:00
Rhys Perry
ea0ae17fc4 radv: disable MRT compaction with dual-source blending
Fixes crucible tests func.shader.dualsrc_mrt0_undef on navi21 and
func.shader.dualsrc_mrt1_undef on polaris10.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: 22.3 mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19806>
2022-11-21 15:01:56 +00:00
José Roberto de Souza
68652dca0c iris: Fix iris_bo_alloc() flags call argument
binder_realloc() -> iris_bo_alloc() is setting 4096 as flags parameter.
Up to now this is harmeless as there is no BO_ALLOC flag that uses
bit 12 but is better to avoid any future issues.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19898>
2022-11-21 14:35:55 +00:00
Danylo Piliaiev
f1305d49d9 tu: Implement VK_EXT_post_depth_coverage
Passes:
 dEQP-VK.pipeline.monolithic.multisample.sample_mask_with_depth_test.*
 KHR-GL45.post_depth_coverage_tests.*

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19682>
2022-11-21 14:11:05 +00:00
Pavel Ondračka
1ec172646c r300: more informative too many ALU instructions error
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19766>
2022-11-21 13:54:39 +00:00
Pavel Ondračka
b70543a955 r300: delete backend branch emulation
We now depend on NIR doing the right thing. It was not able to
handle the few cases where NIR failed anyway (and even if it did,
such complex cases would hit the instruction limit later).

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19766>
2022-11-21 13:54:39 +00:00
Pavel Ondračka
2fe73e3bcb r300: abort shader compilation early on loops and branches
R300/R400 GPUs can't do it in hardware and all the lowering should have
happened in NIR already, there is no point in wasting CPU time, just to
abort later when emitting.

Reduces CPU time for dEQP run by ~25% for RV370. The wallclock time is
now just slighly above 1 minute at 10 threads, mostly determined by the
long-running dEQP-GLES2.functional.flush_finish.* tests.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19766>
2022-11-21 13:54:39 +00:00
Bas Nieuwenhuizen
8d37ab6bfa radv: Fix custom build id with C90 compilation.
Seems some build configurations have problems with VLAs still.

Fixes: 97641e5c94 ("radv: Add ability to override the build id for the cache.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19869>
2022-11-21 12:57:41 +00:00
Maíra Canal
d34f3a1db5 v3dv: fix multiple typos
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19538>
2022-11-21 11:31:29 +00:00
Gert Wollny
67ffe25fd9 r600: Fix lower-to-scalar on TTN path
We must limit what alu ops are scalazized, and since we now
run finalize_nir we also have to make sure not to try to
scalarize backend specific instructions that are introduced
there.

While we touch the code, also remove the vectorization, it is
no longer helping.

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

Fixes: a81c50a2 (r600/sfn: implement finalize_nir)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19892>
2022-11-21 10:53:44 +00:00
Gert Wollny
a69eafc422 r600: reference glsl type system during translation
VL doesn't initialize the type systen, but creates shaders in TGSI.
When these are translated to NIR and then compiled in the driver
we need to have a reference to the glsl type system.

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

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19883>
2022-11-21 10:43:51 +00:00
Daniil Tatianin
089ae08ab1 intel_batch_decoder: disasm shaders when decoding states besides VS
Previously only 'decode_vs_state' would dump the referenced shader,
which meant we completely ignored every other shader when decoding
the '3DSTATE_PIPELINED_POINTERS' command.

Move the program disassembly logic from 'decode_vs_state' into a
common 'disasm_program_from_group' helper and call it from every
other decode_*_state function, too.

Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19880>
2022-11-21 10:00:32 +00:00
Jose Maria Casanova Crespo
c82775e3c7 v3d: Minor fixes on sand8 blit based on sand30 modifications
* load_uniform for sand8_stride is uint32 instead of int32 and its range
  is 4 instead of 1 as it is counted in bytes.
* Now we save and restore constant buffer 1 properly for the ubo used
  in the blit. We need to take into account that in V3D the first UBO
  with index 0 is stored on constant buffer 1, because gallium uses
  internally contant buffer 0 (See for reference commit c8212731e7)
* Removed not needed return.
* Added shader information about uniforms, ubos, inputs and outputs.
* Fixed typos in the comments.

Fixes: 95c4f0f910 "v3d: Enables DRM_FORMAT_MOD_BROADCOM_SAND128 support"
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19639>
2022-11-21 09:08:44 +00:00
Jose Maria Casanova Crespo
e97b20f3ca v3d: Also expose DRM_FORMAT_MOD_BROADCOM_SAND128 with PIPE_FORMAT_P030
Now we can display h265-10bit decoded frames formats on Raspberry Pi 4
devices on GL/ES applications.

v2: Don't expose LINEAR or UIF formats for P030 format.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19639>
2022-11-21 09:08:44 +00:00
Jose Maria Casanova Crespo
653cf8c8d2 v3d: Blit for P030 format with BROADCOM_SAND128 modifier to P010 UIF
Implements the support to blit SAND modifier with columns 128-bytes-wide
support for P030 format to P010 with UIF layout. This allows sampling
from H265 10-bit frames exported by the video decoder on the Raspberry
Pi 4 devices.

When a DRM_FORMAT_MOD_BROADCOM_SAND128 is enabled with an imported P030
texture. The sand30 blit converts the Luma and Chroma planes to
a tiled P010 format that can be sampled using gallium YUV lowerings
without the interleaved 128-bytes-wide-columns.

This patch follows a similar approach to SAND8 blit but extracting luma
and chroma components from the DRM_FORMAT_P030 format. P030 is a two
plane YCbCr420 format where 3 10 bit components with 2 padding bits are
packed in 4 bytes.

index 0 = Y plane, [31:0] x:Y2:Y1:Y0 2:10:10:10 little endian
index 1 = Cr:Cb plane, [63:0] x:Cr2:Cb2:Cr1:x:Cb1:Cr0:Cb0
                       [2:10:10:10:2:10:10:10] little endian

After the sand30_blit is done, the shadow texture is an UIF tiled texture
with an R16_UNORM format for luma and R16G16_UNORM for chroma.

To reduce the number of texture-fetch operations during the blit, we
read pairs of 32-bit dwords. They include 6 10-bit unorm components.
And then we write 4 UNORM16 components from an uvec4 because our render
targets do not support writing to UNORM16 formats.

As sampling will be done using 16bpp (luma) and 32bpp (chroma), the
sand30_blit writes consider the different microtile layouts of UIF
format between 64, 32 and 16 bpp.

v2: Fixes save and recovery of constant buffers (Iago)
    Typo corrections. (Iago)
    Removed not needed return. (Iago)
    Added shader information about uniforms, ubos, inputs and outputs.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19639>
2022-11-21 09:08:44 +00:00
Jose Maria Casanova Crespo
4ea4147935 gallium/dri: Add P030 format
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19639>
2022-11-21 09:08:44 +00:00
Samuel Pitoiset
e253729e03 zink: require extendedDynamicState3ColorBlendEquation for full ds3
Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19851>
2022-11-21 08:43:56 +00:00
Tatsuyuki Ishi
390c4b337a radv: Support accelerationStructureCaptureReplay.
The address itself was already stable assuming that the memory itself was
allocated with capture/replay. Enable the feature flag and add an equality
check to return VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR on mismatch.

Tested with:
- dEQP-VK.ray_tracing_pipeline.capture_replay.*
- q2rtx gfxrecon replays correctly without major errors.
  * There are debug logs about VkBuffers missing opaque address
  for unknown reason, however the AS part is confirmed to be correctly
  captured.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19841>
2022-11-21 08:22:03 +00:00
Samuel Pitoiset
165ef452fd radv/ci: add one more pipeline barrier test as flake
With the new memory type, this test timeout most of the time but it
always pass.

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/19808>
2022-11-21 07:55:24 +01:00
Samuel Pitoiset
5c5735fd68 radv: advertise VK_EXT_descriptor_buffer
Pass dEQP-VK.*descriptor_buffer*.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19808>
2022-11-21 07:55:24 +01:00
Samuel Pitoiset
46e0c77582 radv: implement VK_EXT_descriptor_buffer
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19808>
2022-11-21 07:55:24 +01:00
Samuel Pitoiset
e3fae40e96 radv: always restore NULL descriptor sets for meta operations
A valid but NULL descriptor set indicates a descriptor buffer.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19808>
2022-11-21 07:55:23 +01:00
Samuel Pitoiset
a59be04ea5 radv: rework writing image/buffer/accel_struct descriptors slightly
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/19808>
2022-11-21 07:55:23 +01:00
Samuel Pitoiset
e8cff91bd5 radv: avoid RMW operations in radv_make_texel_buffer_descriptor()
This would hurt performance depending on the memory type.

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/19808>
2022-11-21 07:55:23 +01:00
Samuel Pitoiset
fcd53eda0e radv: force 32-bit address-space for descriptor buffers usage
Descriptor pointers are passed through shaders with 32-bit.

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/19808>
2022-11-21 07:55:23 +01:00
Samuel Pitoiset
94bea63936 radv: add 32-bit memory types for visible VRAM and cached GTT
These would be only exposed for descriptor buffers which need to be
CPU accessible and because descriptor pointers are 32-bit.

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/19808>
2022-11-21 07:55:23 +01:00
Vinson Lee
d6d772d3d1 asahi: Fix memory leak on error path.
Fix defect reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable nresource going out of scope leaks the storage it points to.

Fixes: 7522f4f714 ("asahi: Make resource creation code modifier-aware")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19889>
2022-11-21 04:38:55 +00:00
Qiang Yu
e3b1f26a2b ac/llvm: fix 16bit varying llvm compile error
Found when 16bit vec3 varying with llvm14 (not found
when llvm15), one 32bit vec4 slot is filled like this:
  vec3[0] | undef
  vec3[1] | undef
  vec3[2] | undef
  undef   | undef

LLVM error is for the elements with undef:
  %287 = insertelement float %280, half %279, i64 0

After this change, we get:
  %287 = insertelement <2 x half> %280, half %279, i64 0

Fixes: 279eea5bda ("amd/llvm: Transition to LLVM "opaque pointers"")
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/19848>
2022-11-21 01:06:56 +00:00
Vinson Lee
e8ff841e98 asahi: Fix memory leak on error path.
Fix defect reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable rsc going out of scope leaks the storage it points to.

Fixes: 01964625eb ("asahi: Implement agx_resource_from_handle")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19887>
2022-11-20 13:41:55 -08:00
Yusuf Khan
0803e39b71 mapi: update gles 1.1 extention packet link
Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19874>
2022-11-20 15:14:01 +00:00
Daniel Schürmann
f1f33582e7 radv/rt: use explicitly named sbt entries in radv_pipeline_group_handle
This improves readability, makes it less error-prone and
allows for easier changes in future.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19850>
2022-11-20 11:30:16 +00:00
Eric Engestrom
2b99523a95 v3d(v): account for debug flags when using the cache
Signed-off-by: Eric Engestrom <eric@igalia.com>
Cc: mesa-stable
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19796>
2022-11-20 08:32:04 +00:00
Alyssa Rosenzweig
cee2c4624d asahi: Advertise all supported renderable formats
Now that we have the new tilebuffer infrastructure in place, all renderable
formats should be working.

This reverts commit 32ab63b4fcaaaf832d549ddcf7b3a225c5f73df4.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
2022-11-19 20:25:41 +00:00
Alyssa Rosenzweig
74e92274af asahi,agx: Use new tilebuffer infrastructure
Flag day change to replace the previous hardcoded background/end-of-tile shaders
and the API-style load/store_output in fragment shaders with the generated
shaders and lowered *_agx intrinsics. This gets us working non-UNORM8 render
targets and working MRT. It's also a step in the direction of working MSAA but
that needs a lot more work, since the multisampling programming model on AGX is
quite different from any of the APIs (including Metal).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
2022-11-19 20:25:41 +00:00
Alyssa Rosenzweig
c5c0ea39f6 asahi: Add new clear/reload/store infrastructure
With multiple render targets, it's not practical to generate all
variants of the background and end-of-tile programs at start up. Rather
than trying, add a hash table of meta program keys to background
programs, and compile variants as they're needed.

With the new infrastructure, it's sensible to handle clears with the
same code path as reloads. In addition to getting us closer to multiple
render target support, this gets us support for non-RGBA8 render
targets, as the u8norm tilebuffer format was baked into the hardcoded
clear shader and store shaders used before.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
2022-11-19 20:25:41 +00:00
Alyssa Rosenzweig
4f96651f1e asahi: Use correct tib settings for USC
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
2022-11-19 20:25:41 +00:00
Alyssa Rosenzweig
555447769d asahi: Extend texture descriptor packing for MSAA
Multisampling uses different values of the dimension enum in tandem with a new
samples field. Handle this in agx_pack_texture (split off here) so we can use
the new functionality for texture descriptors in reloads too.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
2022-11-19 20:25:41 +00:00
Alyssa Rosenzweig
cc555e0c04 asahi: Remove some bogus asserts
Hitting in dEQP-GLES31

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
2022-11-19 20:25:41 +00:00
Alyssa Rosenzweig
bbe7d8e4f5 asahi: Implement texture_barrier trivially
For the advanced blending tests.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
2022-11-19 20:25:41 +00:00
Alyssa Rosenzweig
03dc4bc3e8 asahi: Calculate tilebuffer layout per batch
It won't be fixed soon.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
2022-11-19 20:25:41 +00:00
Alyssa Rosenzweig
b1f5004ee7 asahi: Add agx_usc_shared_none helper
Convenience for vertex USC programs.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
2022-11-19 20:25:41 +00:00
Alyssa Rosenzweig
c713197c25 asahi: Add R16 SNORM formats
For completeness, since we do have hardware for this.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
2022-11-19 20:25:41 +00:00
Alyssa Rosenzweig
d637189d36 asahi: Add more XML via PowerVR
These bits are the same as RGX.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
2022-11-19 20:25:41 +00:00
Alyssa Rosenzweig
a3907e92da asahi: Add note to XML about 16-bit varyings
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
2022-11-19 20:25:41 +00:00
Alyssa Rosenzweig
94a8fe51d5 asahi: Identify more depth-related fields in XML
Needed for gl_FragDepth writes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
2022-11-19 20:25:41 +00:00
Alyssa Rosenzweig
6ce615d852 asahi: Add XML for layered rendering
We don't need to support this for a while but it's good to know the mechanism.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
2022-11-19 20:25:41 +00:00
Alyssa Rosenzweig
74de571402 asahi: Add NIR pass to lower tilebuffer access
The compiler can't handle load/store_output directly for nontrivial tilebuffer
layouts. Add a NIR pass to lower these intrinsics, applying a given layout.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
2022-11-19 20:25:41 +00:00
Alyssa Rosenzweig
66a680a043 asahi: Add tilebuffer layout helpers
Laying out the tilebuffer is nontrivial and a task shared between GL and VK, so
add unit-tested helpers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
2022-11-19 20:25:41 +00:00
Alyssa Rosenzweig
5d3243ea2d asahi: Add some notes about unknowns to the XML
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
2022-11-19 20:25:41 +00:00
Alyssa Rosenzweig
363ffa779d asahi: Identify multisampling fields of shared layout
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
2022-11-19 20:25:41 +00:00
Alyssa Rosenzweig
5a20c90508 asahi: Add _with_bo pool uploads
Will be useful for managing our meta shaders.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
2022-11-19 20:25:41 +00:00
Alyssa Rosenzweig
4a166acc93 agx: Add block_image_store instruction
This hw instruction writes out an entire block from the tilebuffer to an
attached render target (PBE descriptor). It is used (only?) in end-of-tile
shaders to implement write out. We need to handle it in the compiler as a
prerequisite to compiling end-of-tile shaders ourselves, instead of hardcoding.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
2022-11-19 20:25:41 +00:00
Alyssa Rosenzweig
0e106681e0 agx: Add helper to map pipe formats to agx_formats
Or a restricted subset thereof anyway.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
2022-11-19 20:25:41 +00:00
Alyssa Rosenzweig
db0461a8d0 agx: Implement nir_texop_txf_ms
Mutlisampled texture fetch (txf_ms) is encoded like regular txf. However, we now
need to pack the multisample index in the right place, which we do by extending
our existing NIR texture source lowering pass. 2D MS arrays use a new value of
dim which requires tweaking the encoding slightly. Otherwise, everything is
bog standard.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
2022-11-19 20:25:41 +00:00
Alyssa Rosenzweig
53d013a605 ail: Handle multisampling
It appears that multisampled textures on AGX have all samples of the same pixel
contiguous in memory, effectively using the layout of a single-sampled texture
with a larger block size. Handle in ail.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
2022-11-19 20:25:41 +00:00
Alyssa Rosenzweig
8781aef6b4 asahi: Make libasahi_lib depend on libasahi_decode
The track_alloc and track_free symbols are used, we need to link them in.
Depending on build flags / environment / etc, fixes the potential build error
hit by a CI job:

mold: error: undefined symbol: agxdecode_track_alloc
>>> referenced by agx_device.c
>>>               src/asahi/lib/libasahi_lib.a(src/asahi/lib/libasahi_lib.a.p/agx_device.c.o):(agx_shmem_alloc)>>> referenced by agx_device.c
>>>               src/asahi/lib/libasahi_lib.a(src/asahi/lib/libasahi_lib.a.p/agx_device.c.o):(agx_bo_create)
mold: error: undefined symbol: agxdecode_track_free
>>> referenced by agx_device.c
>>>               src/asahi/lib/libasahi_lib.a(src/asahi/lib/libasahi_lib.a.p/agx_device.c.o):(agx_bo_unreference)

...when trying to link with libasahi_lib without libasahi_decode for unit tests.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
2022-11-19 20:25:41 +00:00
Alyssa Rosenzweig
6ee6cfec41 asahi: Use PIPE_FORMATs for driver-compiler ABI
This avoids exposing the ISA-internal agx_format to the driver, instead hiding
it behind a real PIPE_FORMAT. This lets us use real pipe formats in formatted
intrinsics in NIR, which is convenient; it will allow us to simplify the
compiler/driver ABI; and it lets us use common format helpers (e.g.
util_format_get_blocksize) for the internal formats in driver lowering.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
2022-11-19 20:25:41 +00:00
Alyssa Rosenzweig
940b871dba nir: Define AGX intrinsics for local pixel access
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
2022-11-19 20:25:41 +00:00
Emma Anholt
7befecf500 turnip: Apply the RB_DBG_ECO_CNTL_blit workaround.
On blob v512.490 on a615, using WRAP_GPU_ID to fake GPU versions, I see
0x41 used everywhere, except for BLIT_OP_SCALE on a630.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19794>
2022-11-19 18:28:27 +00:00
Emma Anholt
9076b38610 freedreno: Don't WFI and set RB_DBG_ECO_CNTL if it's not changing.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19794>
2022-11-19 18:28:27 +00:00
Emma Anholt
4ab489a0b7 freedreno: Update RB_DBG_ECO_CNTL/RB_DBG_ECO_CNTL_blit.
On blob v512.490, using WRAP_GPU_ID to fake GPU versions, I see 0x41 used
everywhere, except for BLIT_OP_SCALE on a630.  Define the magic number in
dev info so it can be reused in the two places that set the
non-BLIT_OP_SCALE value.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19794>
2022-11-19 18:28:27 +00:00
Gert Wollny
be570cd322 r600/sfn: sort FS color outputs before all other outputs
The color outputs must be checked against the number of available
color buffers, therefore it is best to sort the color outputs to be
on the driver locations before the other FS outputs.

Fixes: 79ca456b48
   r600/sfn: rewrite NIR backend

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

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19804>
2022-11-19 16:59:26 +00:00
Gert Wollny
85e140aa5c r600: Print RAT instruction names in disassembly
Also print the swizzle of the address to indicate what
values may be used.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19804>
2022-11-19 16:59:26 +00:00
Gert Wollny
684e90b15c r600: Update scratch buffer late
For some reason the setup that comes after the scratch buffer
setup calls clobber the PS output configuration. Emitting the
scratch buffer setup as last action before the actual draw commands
seems to fix this.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19804>
2022-11-19 16:59:26 +00:00
Rob Clark
394d8e4122 freedreno/drm/virtio: Defer flush on BO free
Freeing BOs tends to be bursty (ie. when a submit is retired, or
expiring entries from BO cache).  Sending lots of small SET_IOVA
messages to the host can quickly eat up the available virtqueue
slots, resulting in (eventually) starving the guest waiting for
free virtqueue space.  By batching, we can avoid this and handle
things more efficiently on the host (ie. in a single wakeup rather
than many).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19832>
2022-11-19 16:32:25 +00:00
Rob Clark
b4a54824e5 freedreno/drm: Support for batched frees
Batch up handles before closing them to give the drm backend a chance to
batch up any extra handling needed (ie. virtio batching up messages to
host to release IOVA).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19832>
2022-11-19 16:32:25 +00:00
Rob Clark
e5a60e1df2 freedreno/drm: Add optimized path for freeing many BOs
Submits tend to hold references to a lot of BOs, which get unref'd when
the submit is destroyed/retired.  For now, all this does is reduce lock
aquire/release, but the next commit will build on it.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19832>
2022-11-19 16:32:25 +00:00
Alyssa Rosenzweig
d7511ad784 asahi: Add batch tracking logic
We already have the notion of an agx_batch, which encapsulates a render
pass. Extend the logic to allow multiple in-flight batches per context, avoiding
a flush in set_framebuffer_state and improving performance for certain
applications designed for IMRs that ping-pong unnecessarily between FBOs. I
don't have such an application immediately in mind, but I wanted to get this
flag-day out of the way while the driver is still small and flexible.

The driver was written from day 1 with batch tracking in mind, so this is a
relatively small change to actually wire it up, but there are lots of little
details to get right.

The code itself is mostly a copy/paste of panfrost, which in turn draws
inspiration from freedreno and v3d.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19865>
2022-11-19 15:33:16 +00:00
Alyssa Rosenzweig
de1eb9400f asahi: Use the batch for submission
So we can submit background batches.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19865>
2022-11-19 15:33:16 +00:00
Alyssa Rosenzweig
0d3b4ff2aa asahi: Use batch_reads for sysvals
Required for proper resource tracking.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19865>
2022-11-19 15:33:16 +00:00
Alyssa Rosenzweig
84f623ae7b asahi: Use a pipe_framebuffer_state batch key
More convenient for batch tracking.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19865>
2022-11-19 15:33:16 +00:00
Alyssa Rosenzweig
d36c911b7b asahi: Use batch instead of ctx for pipelines
So we can support multiple batches later.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19865>
2022-11-19 15:33:16 +00:00
Alyssa Rosenzweig
fb7257af4e asahi: Hide ctx->batch
This will make it easier to support multiple batches.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19865>
2022-11-19 15:33:16 +00:00
Alyssa Rosenzweig
3104b1aaaf asahi: Factor out prepare_for_map
This will be expanded, let's expand in the direction of less spaghetti.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19865>
2022-11-19 15:33:16 +00:00
Lionel Landwerlin
9c1c1888d9 intel/fs: put scratch surface in the surface state heap
In 4ceaed7839 we made scratch surface state allocations part of the
internal heap (mapped to STATE_BASE_ADDRESS::SurfaceStateBaseAddress)
so that it doesn't uses slots in the application's expected 1M
descriptors (especially with vkd3d-proton).

But all our compiler code relies on BSS
(STATE_BASE_ADDRESS::BindlessSurfaceStateBaseAddress).

The additional issue is that there is only 26bits of surface offset
available in CS instruction (CFE_STATE, 3DSTATE_VS, etc...) for
scratch surfaces. So we need the drivers to put the scratch surfaces
in the first chunk of STATE_BASE_ADDRESS::SurfaceStateBaseAddress
(hence all the driver changes).

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 4ceaed7839 ("anv: split internal surface states from descriptors")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7687
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19727>
2022-11-19 14:58:58 +00:00
Lionel Landwerlin
daab161535 iris: move bindless surface state heap inside the surface state heap
We're about to make scratch surface states part of the surface state
heap. Because those are required to be in the low 26bits parts surface
state heap (we're limited in bits handed in the CFE_STATE, 3DSTATE_VS,
etc... instructions), this change splits the 32bit surface state heap
as follow:

   - 8Mb of surface states for scratch
   - 1Gb - 8Mb of binding tables
   - 3Gb of surface states

That way all of the surfaces are located within a 4Gb region visible
from STATE_BASE_ADDRESS::SurfaceStateBaseAddress

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/19727>
2022-11-19 14:58:57 +00:00
Lionel Landwerlin
64f1ae4bc5 iris: prevent crash in decoder
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/19727>
2022-11-19 14:58:57 +00:00
Bas Nieuwenhuizen
1b5dc33caa radv: Convert instance bvh address to node in bvh build.
So we don't have to do it in the traversal loop. Should 2 and
instructions and a 64-bit shift, so 4/8 cycles per instance node
visit.

Totals from 7 (0.01% of 134913) affected shaders:

CodeSize: 208460 -> 208292 (-0.08%)
Instrs: 38276 -> 38248 (-0.07%)
Latency: 803181 -> 803142 (-0.00%)
InvThroughput: 165384 -> 165376 (-0.00%)
Copies: 4912 -> 4905 (-0.14%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19706>
2022-11-19 14:24:36 +00:00
Bas Nieuwenhuizen
d09ed23b9a radv: Fiddle with opaque flag positions to reduce instructions.
Totals from 7 (0.01% of 134913) affected shaders:

CodeSize: 209076 -> 208460 (-0.29%)
Instrs: 38374 -> 38276 (-0.26%)
Latency: 803899 -> 803181 (-0.09%)
InvThroughput: 165530 -> 165384 (-0.09%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19706>
2022-11-19 14:24:36 +00:00
Bas Nieuwenhuizen
3884210902 radv: Skip and for node_to_addr with bvh_base.
Cause the bvh base is always 64 byte aligned.

Totals from 7 (0.01% of 134913) affected shaders:

CodeSize: 209216 -> 209076 (-0.07%)
Instrs: 38402 -> 38374 (-0.07%)
Latency: 804537 -> 803899 (-0.08%)
InvThroughput: 165663 -> 165530 (-0.08%)
Copies: 4919 -> 4912 (-0.14%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19706>
2022-11-19 14:24:36 +00:00
Bas Nieuwenhuizen
0a26975840 radv: Move ray flag compares out of the loop.
To save on and+cmp combos with VALU instructions.

Totals from 7 (0.01% of 134913) affected shaders:

CodeSize: 208476 -> 209216 (+0.35%)
Instrs: 38384 -> 38402 (+0.05%)
Latency: 805725 -> 804537 (-0.15%)
InvThroughput: 165906 -> 165663 (-0.15%)
Copies: 4936 -> 4919 (-0.34%)
PreSGPRs: 393 -> 430 (+9.41%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19706>
2022-11-19 14:24:36 +00:00
Lionel Landwerlin
e2dadda35f Revert "nir/lower_shader_calls: put inserted instructions into a dummy block"
This reverts commit 35d82ecf1e.

Cc: mesa-stable
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19820>
2022-11-19 10:53:18 +00:00
Lionel Landwerlin
3686d5a312 nir/lower_shader_calls: wrap only jumps rather than entire code blocks
Moving entire chunks of code into a dummy if block is causing issues
in some situations. To work around the issue that we tried to fix in
35d82ecf1e ("nir/lower_shader_calls: put inserted instructions into a
dummy block") which is that we cannot cut and past a block of
instruction that ends with a jump if there are more instruction behind
where we're going to past. We can instead just wraps the jumps into
dummy if blocks.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19820>
2022-11-19 10:53:18 +00:00
Lionel Landwerlin
96d84e2a77 nir/lower_shader_calls: update metadata before validation
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19820>
2022-11-19 10:53:18 +00:00
Konstantin Seurer
6f45c98b58 radv/bvh: Adjust sah cost based on depth
Adds a cost field to radv_ir_node and uses it to model the cost of tree
depth. This improves framerates by 2% if my benchmarking is correct.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19756>
2022-11-19 10:18:50 +00:00
Ian Romanick
2ba55ec504 nir/range_analysis: Set higher default maximum for max_workgroup_count
Fixes: c2a81ebe19 ("nir: Add default unsigned upper bound configuration.")
Closes: #7676
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19835>
2022-11-19 05:40:42 +00:00
Caio Oliveira
d989746e55 iris: Pass devinfo directly in iris_setup_uniforms
Instead of reaching through brw_compiler.  This will make easy
future changes on brw_compiler side.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19836>
2022-11-19 05:15:15 +00:00
Michael Skorokhodov
a9602134a3 intel/compiler: Require C++17
Fixes: 6c194ddd18 ("intel/compiler: Prepare SIMD selection helpers to handle different prog_datas")

Signed-off-by: Mykhailo Skorokhodov <mykhailo.skorokhodov@globallogic.com>
Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19833>
2022-11-19 04:37:51 +00:00
Alyssa Rosenzweig
11a607dbc8 asahi: Don't support 16-bit vertex attributes
Currently broken, let vbuf deal with it. "Fixes" sysprof.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>
2022-11-19 04:27:11 +00:00
Alyssa Rosenzweig
9dddbfeaef asahi: Fix logic ops
Need to set colour mask correctly. Fixes spec@!opengl 1.0@gl-1.0-logicop@GL_AND,
at least the non-MSAA portion.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>
2022-11-19 04:27:11 +00:00
Alyssa Rosenzweig
a22ed99906 asahi: Restrict rendering to what we support
Noticed with Kodi that tries to use rgb10a2.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>
2022-11-19 04:27:11 +00:00
Alyssa Rosenzweig
37617ab09e asahi: Don't validate WSI (twiddled) strides
These are made up and won't necessarily be aligned.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>
2022-11-19 04:27:11 +00:00
Alyssa Rosenzweig
f328207475 asahi: Split out agx_usc.h into a common file
So the tilebuffer helpers can build the "shared" USC word. Also because Ella
will probably want to use these O:)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>
2022-11-19 04:27:11 +00:00
Alyssa Rosenzweig
8be506039d asahi: Note some magic bits used with memoryless RTs
Obviously there can't *actually* be memoryless render targets, because
how would partial renders work? The control stream with memoryless looks
like everything would if it went to memory (e.g. full 2D MSAA
attachments for the partial loads/stores even if only a resolved
2D image for the final store). Except the memoryless attachments all
load from the same address 0xeeee0000. Clearly that's not actually what
happens, so what gives? Unclear... but I see the magic bits mentioned
here set, and I assume there are some firmware (or kernel) shenanigans
used to JIT allocate the backing storage for partial renders.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>
2022-11-19 04:27:11 +00:00
Alyssa Rosenzweig
3fa87e47d5 asahi: Identify "Sample mask after depth/stencil" bit
Corresponds to Metal [[sample_mask,post_depth_coverage]].

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>
2022-11-19 04:27:11 +00:00
Alyssa Rosenzweig
ff616099ce asahi: Identify the pass type enum
Via PowerVR.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>
2022-11-19 04:27:10 +00:00
Alyssa Rosenzweig
2e6369f5f6 asahi: Identify PBE sample count
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>
2022-11-19 04:27:10 +00:00
Alyssa Rosenzweig
1f0edc0158 asahi: Identify Dimension for Render Target
Metal uses when rendering to multisampled 2D.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>
2022-11-19 04:27:10 +00:00
Alyssa Rosenzweig
016a699fa9 asahi: Fix agx_set_framebuffer_state for MRT
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>
2022-11-19 04:27:10 +00:00
Alyssa Rosenzweig
7e662320aa asahi: Set data_valid for the correct level
By inspection.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>
2022-11-19 04:27:10 +00:00
Alyssa Rosenzweig
9c52001a1d asahi: Implement stencil texturing
Stencil texturing is easy: S8_UINT is textured like R8_UINT (with a
little swizzle fixup), and stencil is always S8_UINT thanks to
u_transfer_helper. So we just need to do some fixups to make
u_transfer_helper's seperate_stencil work and everything will work out.

Passes dEQP-GLES31.functional.stencil_texturing.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>
2022-11-19 04:27:10 +00:00
Alyssa Rosenzweig
1ffbd53aa2 asahi: Add internal formats for RGB10A2
We need to use I16 as the interchange format here. Fixes:

   dEQP-GLES3.functional.fragment_out.basic.uint.rgb10_a2ui*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>
2022-11-19 04:27:10 +00:00
Alyssa Rosenzweig
efb5aef935 asahi: Implement perf_debug
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>
2022-11-19 04:27:10 +00:00
Alyssa Rosenzweig
c8e520985b asahi: Free the scanout resource
Fixes memory leaks with renderonly.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>
2022-11-19 04:27:10 +00:00
Alyssa Rosenzweig
6a12d793d8 agx: Handle collects in backwards isel
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>
2022-11-19 04:27:10 +00:00
Alyssa Rosenzweig
3b9d271646 agx: Assert more invariants in RA
Was helpful for debugging.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>
2022-11-19 04:27:10 +00:00
Alyssa Rosenzweig
c2159ce9e4 agx: Validate part of SSA form
To debug backend pass problems.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>
2022-11-19 04:27:10 +00:00
Alyssa Rosenzweig
1110fcccc2 agx: Split off NIR preprocessing from compiling
So we can specialize after lowering I/O.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>
2022-11-19 04:27:10 +00:00
Alyssa Rosenzweig
972354b5fd agx: Handle scalar texture destinations
Fixes dEQP-GLES3.functional.shaders.texture_functions.texturelod.sampler2dshadow_fragment.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>
2022-11-19 04:27:10 +00:00
Alyssa Rosenzweig
a92fb4f38c agx: Don't depend on GenXML
Separation of concerns, unused #include.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>
2022-11-19 04:27:10 +00:00
Alyssa Rosenzweig
3789dba5f6 agx: Lower packs/unpacks and bitfields
Needed for GLES3. These could be optimized.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19811>
2022-11-19 04:27:10 +00:00
Yonggang Luo
94886a2975 util: Move src/gallium/include/pipe/p_format.h to src/util/format/u_formats.h
Because p_format.h shared between vulkan drivers and opengl drivers

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/19629>
2022-11-19 03:38:19 +00:00
David Heidelberg
1facb6fbe8 ci/freedreno: disable flaking Civilization V
See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7491

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19862>
2022-11-19 02:22:30 +00:00
Yonggang Luo
e5f0d222b1 util: Rename PIPE_ALIGN_STACK to UTIL_ALIGN_STACK and moved into util/compiler.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/19676>
2022-11-19 01:37:46 +00:00
Yonggang Luo
778402f3b0 llvmpipe: fixes error: ‘enum pipe_blendfactor’ declared in lp_test_blend.c
error  message:
In file included from ../../src/gallium/drivers/llvmpipe/lp_test_blend.c:44:
../../src/gallium/drivers/llvmpipe/lp_bld_blend.h:47:21: error: ‘enum pipe_blendfactor’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
   47 |                enum pipe_blendfactor factor_src,

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/19676>
2022-11-19 01:37:46 +00:00
Yonggang Luo
6832a9433d util: convert usage of uint to unsigned in u_format.h
Because uint comes from pipe/p_compiler.h, and that depends will be removed in future

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/19676>
2022-11-19 01:37:46 +00:00
Yonggang Luo
b728bed567 util: use void * instead of byte * for util_copy_rect in u_format.h
As ubyte comes from p_compiler.h,  so do not use it,
and the code calles util_copy_rect may use args with type uint8_t*, ubyte* or unsigned char*,
so use the type void* that consistence with memcpy

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/19676>
2022-11-19 01:37:46 +00:00
Yonggang Luo
2f42ffcd02 tgsi: fixes error: ‘enum pipe_shader_type’ declared in tgsi_info.h
error message:
../../src/gallium/auxiliary/tgsi/tgsi_info.h:92:30: error: ‘enum pipe_shader_type’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
   92 | tgsi_get_processor_name(enum pipe_shader_type processor);

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/19676>
2022-11-19 01:37:46 +00:00
Yonggang Luo
887e0fdace aco: fixes error: 'uint' was not declared in aco_instruction_selection.cpp
uint is from pipe/p_compiler.h

error message:
../../src/amd/compiler/aco_instruction_selection.cpp:11061:4: error: 'uint' was not declared in this scope; did you mean 'rint'?
11061 |    uint en_mask = 1;

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/19676>
2022-11-19 01:37:46 +00:00
Yonggang Luo
72cf2b540c util: Remove the usage of enum pipe_error in u_hash_table.*
Use 0 instead of PIPE_OK in u_hash_table.c

Because pipe_error and PIPE_OK is comes from pipe/p_defines.h that doesn't belong
to src/util/

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/19676>
2022-11-19 01:37:46 +00:00
Yonggang Luo
8eff2c2223 util: Remove redundant #include "util/u_inlines.h" in u_trace.c
util/u_inlines.h is comes from src/gallium/auxiliary/util/u_inlines.h,
so when possible, do not use it under src/util folder

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/19676>
2022-11-19 01:37:46 +00:00
Caio Oliveira
fbe40720e0 intel/compiler: Remove redundant argument from brw_nir_create_passthrough_tcs
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19831>
2022-11-19 00:35:56 +00:00
Mark Janes
f0115ebc25 intel/perf: fix printf formatting of size_t for 32bit builds
Fixes: bdacd6df5a ("intel/perf: add a non installable tool to print metrics")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7736
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19856>
2022-11-18 23:29:16 +00:00
David Heidelberg
bc34217978 ci/dzn: add flake
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19858>
2022-11-18 23:04:14 +00:00
David Heidelberg
5cf862fbb9 docs: update Python requirement to 3.7
Reported in https://gitlab.freedesktop.org/mesa/mesa/-/issues/7716

Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19791>
2022-11-18 22:58:27 +00:00
Jason Ekstrand
6e4f0bdb7d include: Update the OpenCL headers
This syncs all our headers with their canonical versions from Khronos.
Of particular note, CL headers repo does not have cl.hpp and cl2.hpp has
been depricated all in favor of opencl.hpp which is the new canonical
header.  Fortunately, nothing in Mesa uses any of the C++ headers so
this shouldn't break anything.

Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19816>
2022-11-18 22:22:58 +00:00
Jason Ekstrand
9a9a49d630 clover: Use braces arround a union initializer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19816>
2022-11-18 22:22:58 +00:00
Jason Ekstrand
4b6c5781dc scripts: Fix khronos-update.py to use main for OpenCL headers
Also, cl.hpp no longer exists in OpenCL-Headers to fix it at the last
commit where it did exist.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19816>
2022-11-18 22:22:58 +00:00
Jim Wu
db2b098323 Update 00-mesa-defaults.conf
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19619>
2022-11-18 21:31:34 +00:00
Lionel Landwerlin
723b15fb75 nir/lower_explicit_io: fix metadata preserve
This pass can insert if blocks, therefore no dominance/block_index for
you.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19818>
2022-11-18 20:46:20 +00:00
Rhys Perry
716aaf3673 nir/lower_bit_size: lower uadd_sat/iadd_sat/isub_sat to unsaturated alu
The unsaturated arithmetic won't overflow/borrow, and may be faster.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19473>
2022-11-18 18:31:32 +00:00
Rhys Perry
8a4f9a874b nir/lower_bit_size: optimize usub_sat lowering
The result should never be larger than uint_max. This doesn't need a
special path.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19473>
2022-11-18 18:31:32 +00:00
Rhys Perry
e19584db2b nir/algebraic: optimize open-coded uadd_sat/usub_sat
fossil-db (navi21):
Totals from 19 (0.01% of 135636) affected shaders:
Instrs: 40730 -> 40688 (-0.10%)
CodeSize: 217708 -> 217568 (-0.06%)
Latency: 261466 -> 261373 (-0.04%)
InvThroughput: 74944 -> 74896 (-0.06%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19473>
2022-11-18 18:31:32 +00:00
Rhys Perry
6fc4a76057 radv: lower 8/16-bit uadd_carry/usub_borrow
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7615
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19473>
2022-11-18 18:31:32 +00:00
Rhys Perry
da30fb5df7 nir/lower_bit_size: lower uadd_carry
8/16-bit uadd_carry can exist in SPIR-V.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7615
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19473>
2022-11-18 18:31:32 +00:00
Caio Oliveira
4239512210 crocus: Pass devinfo directly in crocus_setup_uniforms
Instead of reaching through brw_compiler.  This will make easy
future changes on brw_compiler side.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19834>
2022-11-18 18:22:43 +00:00
Samuel Pitoiset
5a5bc3dd52 radv: advertise extendedDynamicState3ColorBlendEnable
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/19579>
2022-11-18 15:29:33 +00:00
Samuel Pitoiset
40b76ca08a radv: add support for dynamic color blend enable
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/19579>
2022-11-18 15:29:33 +00:00
David Heidelberg
faf15ff3f4 ci/freedreno: temporarily disable godot-trive
Test if this trace impact surrounding traces causing rendering changes.

Ref: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7732

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19838>
2022-11-18 14:42:32 +00:00
David Heidelberg
17aea35c44 ci/panfrost: drop glmark2 traces, useless
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19838>
2022-11-18 14:42:32 +00:00
David Heidelberg
b09e53479e ci/iris: drop glmark2 traces, useless
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19838>
2022-11-18 14:42:32 +00:00
David Heidelberg
0db9e170f6 ci/llvmpipe: drop glmark2 traces, useless
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19838>
2022-11-18 14:42:32 +00:00
David Heidelberg
40d4d0785a ci/virgl: drop glmark2 traces, useless
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19838>
2022-11-18 14:42:32 +00:00
David Heidelberg
1637291fd4 ci/broadcom: drop glmark2 traces, useless
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19838>
2022-11-18 14:42:32 +00:00
David Heidelberg
c80a7543df ci/freedreno: drop glmark2 traces, useless
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19838>
2022-11-18 14:42:32 +00:00
David Heidelberg
4f74621884 ci/amd: drop glmark2 traces, useless
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19838>
2022-11-18 14:42:32 +00:00
Konstantin Seurer
bdd2abe334 nir/lower_shader_calls: Get rid of any brw occurences
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19749>
2022-11-18 12:28:14 +00:00
Connor Abbott
37cde2c634 tu: Rewrite inline uniform implementation
Now we always push the inline uniforms, using an indirect CP_LOAD_STATE.
There is just enough space to be able to always push them if we expose
the minimum possible per-stage limits. This aligns us with Qualcomm and
removes the need to setup a uniform descriptor which will be
problematic.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18703>
2022-11-18 11:57:05 +00:00
Connor Abbott
e402d2dbe9 nir: Fix nir_chase_binding() vecN handling
In the comments we claimed to handle vecN instructions, for the case
where an offset is trimmed from the descriptor, but we didn't ignore the
offset itself and in effect only handled identity vecN's (which copy
propagation would normally remove already!), so the handling of vecN was
useless and this relied on copy propagation cleaning things up. Fix it
to ignore everything except the components in the original source.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18703>
2022-11-18 11:57:05 +00:00
Matt Coster
bd51305943 pvr: Minor cleanup around pvr_emit_vdm_index_list()
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19802>
2022-11-18 11:46:14 +00:00
Michel Dänzer
8d7aa4279a vulkan/wsi/wayland: Set num_modifier_lists = 0 if num_drm_modifiers == 0
This case was missed in
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18826 ,
resulting in native Wayland apps failing with

 ../src/vulkan/wsi/wsi_common_drm.c:452: wsi_configure_native_image: Assertion `!"Failed to find a supported modifier!  This should never " "happen because LINEAR should always be available"' failed.

if the Wayland compositor advertises only the INVALID modifier.

Fixes: c315e20d61 ("vulkan/wsi/wayland: Configure images via params passed to wsi_swapchain_init()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19795>
2022-11-18 09:42:03 +00:00
Matt Coster
fffc3866fe pvr: Support clear colours with more than 32 bits
The support for this seems to already exist, but was blocked by a
conditional. Replace with an assert to ensure the format can be packed
into 4x32 bit words (true for all currently supported formats).

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19799>
2022-11-18 09:32:57 +00:00
Karmjit Mahil
0ad5b0a74e pvr: Fix clang-format error.
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/19798>
2022-11-18 09:17:13 +00:00
Feng Jiang
8b48e11179 virgl/video: Check driver supported profiles and entrypoints
Since the support of video by the device and the driver may be
different, it is necessary to check on the driver side as well.

Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18831>
2022-11-18 07:46:11 +00:00
Feng Jiang
ebf6158bd0 virgl/video: Add support for H.265 encoding
Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Signed-off-by: Weishi Li <liweishi@kylinos.cn>
Signed-off-by: Liming Sun <sunliming@kylinos.cn>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18831>
2022-11-18 07:46:11 +00:00
Feng Jiang
d3a203c969 virgl/video: Add support for H.264 encoding
Implement encoding framework and support H.264 encoding.

Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Signed-off-by: Ming Xie <xieming@kylinos.cn>
Signed-off-by: Liming Sun <sunliming@kylinos.cn>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18831>
2022-11-18 07:46:11 +00:00
Boyuan Zhang
69ed5f13d8 virgl/video: Pass "max_references" to backend when creating a video codec
The "max_references" is an important value in sequence parameters,
which will be used when encoding SPS headers.

Signed-off-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18831>
2022-11-18 07:46:11 +00:00
Feng Jiang
d4f189fe69 frontends/va/enc: save intra_idr_period in the context
The va frontend loses some information when processing parameter
buffers, but the virgl video encoding driver needs it to work.

Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18831>
2022-11-18 07:46:11 +00:00
Feng Jiang
316652a4bb virgl/video: Move hardware-related definitions from virgl_video.h to virgl_video_hw.h
Considering the increasing number of hardware-related definitions,
it is better to put them in a separate file.

Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18831>
2022-11-18 07:46:11 +00:00
Kenneth Graunke
403083744d iris: Increase the maximum grid size
I had simply copied these values from another driver when adding initial
compute support to iris.  The actual hardware limit is UINT32_MAX (see
the GPGPU_WALKER/COMPUTE_WALKER ThreadGroupID{X,Y,Z}Dimension fields).

Thanks to Karol Herbst for noticing the unnecessarily low limit.

References: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7676
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19826>
2022-11-18 00:53:21 +00:00
Chia-I Wu
aa86369163 turnip: set ycbcr feature bits properly
Set ycbcr feature bits only for ycbcr formats.  Besides, we can control
chroma locations only for planar formats and we support
VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT
on newer gens.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19609>
2022-11-18 00:29:09 +00:00
Chia-I Wu
6bc1fd1862 freedreno: add has_separate_chroma_filter to fd_dev_info
The blob driver does not support
VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT
before a6xx_gen3.  It still sets CHROMA_LINEAR bit according to
chromaFilter, but the bit has no effect before a6xx_gen3 (confirmed on
a618 with blob version 512.490.0).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19609>
2022-11-18 00:29:09 +00:00
Jami Kettunen
f3a9076e51 freedreno: Find curses properly for building fdperf
Upstream ncurses doesn't ship any legacy ncurses.pc pkg-config symlinks
(just ncursesw.pc) which Void Linux strictly follows[1] for example.

Meson (since 0.54) has a generic curses dependency which works perfectly
in this case[2], thus also bump the toplevel minimum meson version from
0.53.

[1] https://github.com/void-linux/void-packages/tree/master/srcpkgs/ncurses
[2] https://mesonbuild.com/Dependencies.html#curses

Signed-off-by: Jami Kettunen <jami.kettunen@protonmail.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19664>
2022-11-17 23:57:05 +00:00
Yonggang Luo
d1e1911d82 ci: Update dozen flakes
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7549

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19824>
2022-11-17 23:42:46 +00:00
Yonggang Luo
dd34cdbfa4 svga: Fixes -Werror,-Wunused-but-set-variable for clang-15 in svga/svga_tgsi_vgpu10.c
error message:
../../src/gallium/drivers/svga/svga_tgsi_vgpu10.c:5199:13: error: variable 'indicesMask' set but not used [-Werror,-Wunused-but-set-variable]   unsigned indicesMask = 0;
            ^

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19527>
2022-11-17 23:17:40 +00:00
Yonggang Luo
e8a2f801af softpipe: fixes -Werror,-Wunused-but-set-variable for clang-15 in sp_tile_cache.c
error message:
../../src/gallium/drivers/softpipe/sp_tile_cache.c:346:9: error: variable 'numCleared' set but not used [-Werror,-Wunused-but-set-variable]
   uint numCleared = 0;
        ^

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19527>
2022-11-17 23:17:40 +00:00
Yonggang Luo
af082cb69c radv: fixes -Werror,-Wunused-but-set-variable for clang-15 in radv_shader_args.c
error message:
../../src/amd/vulkan/radv_shader_args.c:457:16: error: variable 'arg_count' set but not used [-Werror,-Wunused-but-set-variable]
      unsigned arg_count = 0;
               ^

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19527>
2022-11-17 23:17:40 +00:00
Yonggang Luo
4b0409ff9a intel: fixes -Werror,-Wunused-but-set-variable for clang-15
one of those error message:
../../src/intel/compiler/brw_vec4_cmod_propagation.cpp:53:8: error: variable 'ip' set but not used [-Werror,-Wunused-but-set-variable]
   int ip = block->end_ip + 1;

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19527>
2022-11-17 23:17:40 +00:00
Yonggang Luo
d6bd382352 intel: Fixes -Werror,-Wbitwise-instead-of-logical for clang-15 in brw_nir_lower_shader_calls.c
error message:
error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19527>
2022-11-17 23:17:40 +00:00
Filip Gawin
63f353b456 r300: don't use abs twice in transform_TRUNC on older hardware
r400:
total instructions in shared programs: 27594 -> 27523 (-0.26%)
instructions in affected programs: 3594 -> 3523 (-1.98%)
helped: 61
HURT: 0
helped stats (abs) min: 1 max: 4 x̄: 1.16 x̃: 1
helped stats (rel) min: 1.16% max: 8.70% x̄: 2.55% x̃: 1.64%
95% mean confidence interval for instructions value: -1.29 -1.04
95% mean confidence interval for instructions %-change: -3.13% -1.97%
Instructions are helped.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19807>
2022-11-17 21:57:38 +00:00
Jesse Natalie
efe5b9163e meson: Enable initialized-but-unused warning for MSVC
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19792>
2022-11-17 21:20:38 +00:00
Jesse Natalie
383715e33b gallium/vl: Remove unused win32 screen var
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19792>
2022-11-17 21:20:38 +00:00
Eric Engestrom
6c329e8f0a docs: update calendar for 22.3.0-rc3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19822>
2022-11-17 20:37:49 +00:00
Tomeu Vizoso
fb57aa69c8 zink/ci: Add automatic test on Adreno 618 with Turnip
Make the existing manual test automatic, sharding to 3 boards.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19071>
2022-11-17 19:30:46 +00:00
Tomeu Vizoso
8aa55cbcf2 ci/freedreno: Test on a618
Do the same testing we currently do on a630.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19071>
2022-11-17 19:30:46 +00:00
Tomeu Vizoso
7ba9d99e5a ci/turnip: Shard the tests on a618 over more boards
12 kingoftown Chromebooks have been added to Collabora's LAVA lab.

Use them to run the same tests as before, as the jobs never take less
than 10 minutes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19071>
2022-11-17 19:30:46 +00:00
Konstantin Seurer
f24bb8194b radv/rra: Fix copying accel structs that were not built yet
In the case that radv_GetEventStatus always returns true, the loop will
never exit.

Fixes: 5749806 ("radv: Add Radeon Raytracing Analyzer trace dumping utilities")
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19772>
2022-11-17 17:24:54 +00:00
Jason Ekstrand
a5e3a50688 vulkan: Update the XML and headers to 1.3.235
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19815>
2022-11-17 16:51:05 +00:00
Sil Vilerino
0c4fdbaa92 d3d12: Video Screen - Do not crash if HEVC not supported, return no support instead
Fixes: 8f654b90 ("d3d12: Fix HEVC wrong caps detection due to bad parenthesis in condition")
Signed-off-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19813>
2022-11-17 16:02:55 +00:00
José Roberto de Souza
23adf60f96 iris: Get VM id from iris_bufmgr's fd
iris_bufmgr_init_global_vm() was getting the VM id from the callers
fd not the iris_bufmgr's duplicated fd.

If i915 driver decides to always return unique vm ids, like a counter
that is initialized per device. So fd0 would have vm id = 0 by
default, fd1(dup of fd0) would have vm id = 1... in this scenario it
would cause a mismatch. But it is not the current i915 implementation.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19467>
2022-11-17 14:32:37 +00:00
Lionel Landwerlin
ac51c0c93c intel/perf: add ACM/DG2 performance metrics
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18893>
2022-11-17 12:57:07 +00:00
Lionel Landwerlin
fdf602a545 intel/perf: use the new OA format for Gfx12.5+
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18893>
2022-11-17 12:57:06 +00:00
Lionel Landwerlin
02608c25ec drm-uapi: import i915_drm.h changes for the new OA report type
To be replace by a proper drm-next update.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18893>
2022-11-17 12:57:06 +00:00
Lionel Landwerlin
61fef1ed72 intel/perf: fix B/C counters accumulation in non query mode
When we're not using queries, all the counters from the
MI_REPORT_PERF_COUNT are available. This is the case when using
perfetto with the global pps datasource that capture global counter
values.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 8750f43a90 ("intel/perf: add performance query layout using MI_SRM")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18893>
2022-11-17 12:57:06 +00:00
Lionel Landwerlin
6c2e7797f5 anv: tweak performance query timeout based on number of passes
This avoids device lost events when we replay a command buffer 1k
times on DG2.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18893>
2022-11-17 12:57:06 +00:00
Lionel Landwerlin
56bd81ee21 anv/perf: fixup counter/query mapping
The intel_perf_counter_pass::pass field is actually useless and
invalid.

Once you have mapped all the counters to all the metrics, the order of
the metrics capture is dictated by intel_perf_get_n_passes().

When reading values that is the order we should follow.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 2001a80d4a ("anv: Implement VK_KHR_performance_query")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18893>
2022-11-17 12:57:06 +00:00
Lionel Landwerlin
7fbfa694a8 intel/perf: simplify pass computation loop
We don't need to go through all the metric sets as we're already built
a bitset matching per counter to figure out in which metric set a
particular counter is.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18893>
2022-11-17 12:57:06 +00:00
Lionel Landwerlin
4d19685a99 intel/perf: don't ralloc on perf context a temporary hash table
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18893>
2022-11-17 12:57:06 +00:00
Lionel Landwerlin
e754bf6be4 intel/perf: allocate cleared counter infos
This array of structure needs to be initialized to 0 as it contains a
bitset we don't explicitly clear.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 3144bc1d33 ("intel/perf: move query_mask and location out of gen_perf_query_counter")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18893>
2022-11-17 12:57:06 +00:00
Lionel Landwerlin
bdacd6df5a intel/perf: add a non installable tool to print metrics
Useful to look at the layout of the queries.

v2: Rework based on Marcin's comment

v3: Rebase

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18893>
2022-11-17 12:57:06 +00:00
Mark Janes
e3a842d627 intel/perf: fix overflow in index types
With DG2, the number of perf groups and metrics climbs into the
thousands.  16bit fields are not sufficient for storing metrics
indices, and the build throws warnings when compiling the generated
intel_perf_metrics.c

Use a 32bit integer for these values.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18893>
2022-11-17 12:57:06 +00:00
Lionel Landwerlin
7770346902 intel/perf: support new variable names
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18893>
2022-11-17 12:57:06 +00:00
Lionel Landwerlin
c1aa1059c6 intel/perf: support new operators for upcoming metrics
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18893>
2022-11-17 12:57:06 +00:00
Lionel Landwerlin
d4cbb66506 intel/perf: support more than 64 queries
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18893>
2022-11-17 12:57:06 +00:00
Lionel Landwerlin
1dd4cc0da5 intel/perf: fix variable type assumption error
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18893>
2022-11-17 12:57:06 +00:00
Sergi Blanch Torne
d969ac7c02 ci: don't remove wget from the packages of debian/x86_test-vk
The 'wget' package was in the list of ephemeral packages used only during the
build. 'Wget' installation comes from the build for the 'x86_build-base', and
the inclusion on this list only affects its purge. Jobs that use this image,
like 'venus-lavapipe' in 'virglrenderer', cannot use it as other GL jobs can.
So, please don't consider this package ephemeral when it comes from the upper
layer builder.

This 'wget' package is a known dependency on a job that uses this image. So,
even if this package is installed in the base image, it is good to have it
explicitly mentioned in the packages to install.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19784>
2022-11-17 10:44:12 +00:00
Sergi Blanch Torne
987f9a67e0 ci: insert debian/x86_test-vk in image tags
Using the variable DEBIAN_X86_TEST_IMAGE_PATH in a Vulkan test, we realize the
reference to the Vulkan one is missing. Even more, hardcoded within mesa. With
this, a variable for Vulkan image has a reference VK on it, as well as the GL
one. But the old variable is still there, pointing to the value that can be
expected to avoid any brake on other CI elements.

Also, updated the build tag to regenerate the image.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19784>
2022-11-17 10:44:12 +00:00
Lionel Landwerlin
440da44a84 anv: get rid of ilog2_round_up
__builtin_clz(value - 1) is undefined for with value=1 (because
__builtin_clz(0) is undefined).

Because we set rt_pipeline->stack_size = 1 when a ray tracing pipeline
doesn't need any stack allocation to differentiate from a dynamic size
(rt_pipeline->stack_size = 0) we can run into this undefinied behavior
issue.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: f68d64dac0 ("anv: Add support for vkCmdSetRayTracingPipelineStackSizeKHR")
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19781>
2022-11-17 10:06:37 +00:00
David Heidelberg
a61378859c ci/alpine: rename job to alpine-build-testing
Better describes what the job does.

@thx to MrCooper for suggestion.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19789>
2022-11-17 10:23:21 +01:00
Leo Liu
9bd11f6523 frontends/va: Use YUV400 YUY2 444P for JPEG only
Since these formats are only for JPEG, and not all the backend driver
supports these format. Eg radeonsi does, virgl doesn't, they should
be used only for JPEG profile.

Fixes d2c0ff1caf (frontends/va: add support for yuv400 and yuv444)

Signed-off-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19787>
2022-11-17 09:06:15 +00:00
Samuel Pitoiset
62356e71f4 radv: suspend/resume XFB queries with NGG for meta operations
XFB queries enable primitives generated queries with NGG and meta
operations shouldn't be counted.

Reproduced on GFX10.3 by forcing NGG streamout.

Cc: 22.3 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/19785>
2022-11-17 07:21:23 +00:00
Samuel Pitoiset
50fe37070f aco: fix FS inputs loads in WQM with 16-bit
p_wqm needs to use the same size.

Fixes: 16d2c7ad55 ("aco/gfx11: perform FS input loads in WQM")
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/19788>
2022-11-17 07:00:02 +00:00
Alyssa Rosenzweig
b24fe2badf asahi: Unset PIPE_CAP_POINT_SIZE_FIXED
We do not support glPointSize(), we need point size lowered to gl_PointSize
writes in the frontend so we can use the GLES pat.

Fixes glamor.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19606>
2022-11-17 02:47:10 +00:00
Alyssa Rosenzweig
726603f779 asahi: Set data_valid with PERSISTENT or COHERENT
We won't get an unmap/flush but we could have had data already.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19606>
2022-11-17 02:47:10 +00:00
Asahi Lina
7522f4f714 asahi: Make resource creation code modifier-aware
Needed for WSI.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19606>
2022-11-17 02:47:10 +00:00
Alyssa Rosenzweig
a57b4577a1 asahi: Fix indexed draw decode
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19606>
2022-11-17 02:47:10 +00:00
Asahi Lina
fa81da9e2f asahi: Add render scanout to resource
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19606>
2022-11-17 02:47:10 +00:00
Asahi Lina
2aac18d7e4 asahi: Set cfg.levels for linear framebuffers
Otherwise we will crash in GenXML, which does not specify a default here.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19606>
2022-11-17 02:47:10 +00:00
Asahi Lina
a5b8918800 asahi: Set fd/ro appropriately
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19606>
2022-11-17 02:47:10 +00:00
Asahi Lina
f1771ec398 asahi: Implement agx_resource_get_param
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19606>
2022-11-17 02:47:10 +00:00
Asahi Lina
3732a41677 asahi: Implement agx_resource_get_handle
Only useful on Linux.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19606>
2022-11-17 02:47:10 +00:00
Asahi Lina
01964625eb asahi: Implement agx_resource_from_handle
Only used on Linux, but can compile anywhere.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19606>
2022-11-17 02:47:10 +00:00
Asahi Lina
b774ed7c18 asahi: Stub import/export code
It will be used on Linux, and it is convenient to be able to compile the same
code on macOS in the mean time.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19606>
2022-11-17 02:47:10 +00:00
Asahi Lina
943d939a9f asahi: Implement dmabuf modifier queries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19606>
2022-11-17 02:47:10 +00:00
Asahi Lina
7147313d0a asahi: Support XRGB formats
Just treat them like ARGB. Not sure if this is sane, but it works for now...

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19606>
2022-11-17 02:47:10 +00:00
Asahi Lina
7c59e75481 asahi: Add renderonly to device
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19606>
2022-11-17 02:47:10 +00:00
Alyssa Rosenzweig
69ee201733 asahi: Remove index_bias assert
Index bias works okay already, tested against dEQP-GLES31 on agx/next.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19606>
2022-11-17 02:47:10 +00:00
Alyssa Rosenzweig
6ca69b2843 asahi: Localize the modifier #define hack for macOS
This reduces the burden of synchronizing the values between Linux and macOS and
provides fewer ways to shoot ourselves in the foot.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19606>
2022-11-17 02:47:10 +00:00
Alyssa Rosenzweig
b89d82fd6c asahi: Use AIL tiling instead of DRM modifiers
...for internal parts of the driver that are unrelated to UAPI. This makes the
ail representation canonical and the modifier a mere UAPI detail.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19606>
2022-11-17 02:47:10 +00:00
Alyssa Rosenzweig
bf593e09b1 asahi: Handle synchronized transfers better
We need to flush the appropriate batch(es in the future) before a synchronized
transfer for correct results. To do so without major performance regressions, we
need to do extra bookkeeping about which batches write which resources. We
already know about reads via the BO list.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19606>
2022-11-17 02:47:10 +00:00
Alyssa Rosenzweig
e9dbbddf43 ail: Add get_wsi_stride_B helper
Centralize the logic around WSI strides, which are a software convention made
into UAPI rather than something set in silicon.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19606>
2022-11-17 02:47:10 +00:00
Jesse Natalie
2d04206673 meson: Enable SSE4.1 for MSVC
Modern MSVC always supports compiling with the SSE4.1 intrinsics with
no additional command line options, but doesn't have any options for
auto-vectorizing into SSE4.1.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16840>
2022-11-17 02:14:39 +00:00
Yonggang Luo
ad0d39efed glsl: Use DETECT_CC_GCC_VERSION in glsl/builtin_functions.cpp
The expression "(__GNUC__ * 100) + __GNUC_MINOR" is invalid
because __GNUC_MINOR is not defined by the compiler

This can not fixes the previous version because DETECT_CC_GCC_VERSION is not available
in previous released version

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19771>
2022-11-17 01:43:37 +00:00
Michel Dänzer
71a0a386b5 Revert "egl/glx: add fallback for zink loading"
This reverts commit 2569215f43.

Conflicts:
	src/egl/main/eglapi.c
	src/glx/glxext.c

It broke the fallback to swrast in some cases where zink can't work.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7333
Fixes: 2569215f43 ("egl/glx: add fallback for zink loading")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19681>
2022-11-17 01:08:33 +00:00
Dylan Baker
b1b419f7fe docs: update calendar and link releases notes for 22.2.4
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19793>
2022-11-17 01:03:13 +00:00
Dylan Baker
03eb7ae9ae docs: Add sha256 sum for 22.2.4
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19793>
2022-11-17 01:03:13 +00:00
Dylan Baker
5061bd6c25 docs: add release notes for 22.2.4
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19793>
2022-11-17 01:03:13 +00:00
Jesse Natalie
2a1bb4df95 dzn: Ensure SRV ResourceMinLODClamp is set to 0.0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19537>
2022-11-17 00:13:33 +00:00
Jesse Natalie
2f8d2a91a6 dzn: Use cube-array views for misaligned cubes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19537>
2022-11-17 00:13:33 +00:00
Jesse Natalie
6e7896aa44 dzn: Use DEPTH_STENCIL_DESC2 for front/back stencil read/write masks
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19537>
2022-11-17 00:13:33 +00:00
Jesse Natalie
73c9cfb61b dzn: Use ID3D12GraphicsCommandList8 for front/back stencil ref
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19537>
2022-11-17 00:13:33 +00:00
Jesse Natalie
c5b6d0c882 dzn: Get options14
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19537>
2022-11-17 00:13:33 +00:00
Jesse Natalie
6b887034be dzn: Use CreateCommandList1
We don't need to do the command list destroy/re-create dance if the
only reference to an allocator is a *closed* command list. Using
CreateCommandList1 gives us a closed command list to start with,
which better matches the semantics of Vulkan's begin/end for
command buffers.

Now that dzn's cmdbuf reset logic puts the cmdbuf back to the
*initial* state, move the command list reset to BeginCommandBuffer.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19537>
2022-11-17 00:13:33 +00:00
Jesse Natalie
56d4e038dd dzn: Use common command buffer state tracking
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19537>
2022-11-17 00:13:33 +00:00
Jesse Natalie
f3b631f1dc dzn: Upgrade baseline from ID3D12Device2 to 4
This is pretty old already and we'll want to use CreateCommandList1

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19537>
2022-11-17 00:13:33 +00:00
Jesse Natalie
a3dbc9ac25 microsoft/compiler: Emit sampleCmpLevel when needed
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19537>
2022-11-17 00:13:33 +00:00
Dave Airlie
442d1fe5ad gallivm: use masked intrinsics for global and scratch access.
This seems to improve luxmark scores for me on the luxball scene
from numbers in the 4-500 range to 5-700 range.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Tested-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19736>
2022-11-16 23:31:54 +00:00
Daniel Schürmann
fda262fe64 radv/rt: move Ray Tracing shader creation into separate file
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19525>
2022-11-16 22:43:49 +01:00
Sajeesh Sidharthan
ce97fa9349 frontends/va: set vbv buffer size same as target bitrate in cbr mode
video buffering verifier (vbv) buffer size must be set same as
target bitrate to achieve constant bitrate.

Signed-off-by: Sajeesh Sidharthan <sajeesh.sidharthan@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Veerabadhran Gopalakrishnan <Veerabadhran.Gopalakrishnan@amd.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19695>
2022-11-16 20:01:05 +00:00
Pavel Ondračka
3e19eb59a6 r300: respect extra presubtract swizzle limitations during regalloc
Regalloc was not aware of the extra limitations and in some cases could
convert native swizzle into non-native.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19764>
2022-11-16 19:51:47 +00:00
Pavel Ondračka
14d97e1e42 r300: handle presubtract when rewriting non-native swizzles
The extra presubtract limitations were completelly ignored.
Fixes 4 dEQP asin and atan tests.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7554
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19764>
2022-11-16 19:51:47 +00:00
Pavel Ondračka
8cfc44aace r300: don't allow constant swizzles from presubtract sources
It is not possible to rewrite it to a native swizzle later on R300/R400.

The way the native rewrite currently works, it will create bunch of
movs with the given presubtract and partial swizzles, however no
constant swizzle for presubtract source exists so it is just not
possible to rewrite it.

This prevents an infinite loop in supertuxkart shader when we really
start enforcing the presubtract swizzle limitations during native
swizzle rewrite in the next commit.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19764>
2022-11-16 19:51:47 +00:00
Pavel Ondračka
6738a7b5b4 r300: be more careful with presubtract and non-native swizzles
The problematic scenario is when we have the same source used by both
normal and presubtract argument. We check that case currently and count
the source only once. However if one of the arguments uses a non-native
swizzle, we have to rewrite it later and the source changes. Therefore
we end with too many sources and fail later during pair translation.

Example:
ADD temp[21].xy, temp[20].xy__, temp[17].xy__;
MAD temp[22].xy, temp[17].zw__, temp[11].xy__, temp[21].xy__;

will get converted to

MAD temp[22].xy, temp[17].zw__, temp[11].xy__, (temp[17] + temp[20]).xy__;

however after dataflow swizzles pass we end with

MOV temp[3].x, temp[17].z___;
MOV temp[3].y, temp[17]._w__;
MAD temp[22].xy, temp[3].xy__, temp[11].xy__, (temp[17] + temp[20]).xy__;

Just skip the "don't count the same source twice" optimization when a
non-native swizzle is used to fix 2 dEQP atan2 tests.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19764>
2022-11-16 19:51:47 +00:00
Jonathan Gray
fe851d7759 util: include sys/time.h for timespec functions
When the futex code moved it removed an include which broke the build
on OpenBSD.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Fixes: 095dfc6caa ("util: Move the implementation of futex_wake and futex_wait from futex.h to futex.c")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19735>
2022-11-16 19:09:30 +00:00
Samuel Pitoiset
fb781bfb0a aco: fix dual source blending on GFX11
Assembly looks similar to LLVM.

Cc: 22.3 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/19643>
2022-11-16 18:35:10 +00:00
Samuel Pitoiset
bb90d29660 aco: add p_dual_src_export_gfx11 for dual source blending on GFX11
Dual source blending must be in strict WQM mode.

Cc: 22.3 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/19643>
2022-11-16 18:35:10 +00:00
David Heidelberg
e93de8a75e dzn: add triangle_strip flake
Reference: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7672

Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19782>
2022-11-16 17:49:50 +00:00
Gert Wollny
35d6e290e4 r600/sfn: Fix location for reading cube array image dimensions
Fixes: 79ca456b48
        r600/sfn: rewrite NIR backend

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19755>
2022-11-16 17:22:04 +00:00
Gert Wollny
d1a81db9ee r600/sfn: set finalize_nir after reading debug flags
Fixes: a81c50a214 (upstream/main)
    r600/sfn: implement finalize_nir

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19755>
2022-11-16 17:22:04 +00:00
Gert Wollny
0ccf7ed791 r600/sfn: Honor shader key w.r.t. atomic counter layout
Fixes: 79ca456b48
        r600/sfn: rewrite NIR backend

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19755>
2022-11-16 17:22:04 +00:00
Georg Lehmann
6d02054047 aco: Combine v_cvt_u32_f32 with insert to v_cvt_pk_u8_f32.
No Foz-DB difference on Navi21.

Foz-DB GFX11:
Totals from 746 (0.55% of 134913) affected shaders:
CodeSize: 8430248 -> 8416128 (-0.17%); split: -0.17%, +0.00%
Instrs: 1617202 -> 1614707 (-0.15%)
Latency: 13943398 -> 13934161 (-0.07%); split: -0.07%, +0.00%
InvThroughput: 2601620 -> 2596624 (-0.19%); split: -0.20%, +0.01%
Copies: 114346 -> 114334 (-0.01%); split: -0.01%, +0.00%
PreVGPRs: 48314 -> 48312 (-0.00%)

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/18492>
2022-11-16 16:49:04 +00:00
Samuel Pitoiset
5a3cc2d453 aco: fix missing SCC for p_interp_gfx11 in emit_interp_mov_instr()
Fixes: 369c9b6425 ("aco: fix p_interp_gfx11 to not overwrite SCC")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19777>
2022-11-16 15:59:56 +00:00
Alyssa Rosenzweig
c567e5528f panfrost: Use PIPE_CAP_VERTEX_ATTRIB_ELEMENT_ALIGNED_ONLY
..instead of 4BYTE_ALIGNED_ONLY. This is more correct and avoids
needless repacking. Noticed in Firefox, which was hitting the vbuf
translate path.

Fixes: e03622e50f ("panfrost: Set STRIDE_4BYTE_ALIGNED_ONLY")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19761>
2022-11-16 15:40:37 +00:00
Alyssa Rosenzweig
42212a9bfd panfrost: Fix reference counting with batch->resources
Refactor accesses to batch->resources to happen through safe helpers
that update the appropriate bookkeeping. This makes it obvious that (in
particular) reference counts are updated when they should be.

The functional change is that we are now correctly unreferencing
resources during shadowing, fixing a leak of shadowed resources.

Closes: #7362
Fixes: 2d8f28df73 ("panfrost: Replace resource shadowing flush")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Mastodon, apparently
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19753>
2022-11-16 15:20:33 +00:00
Pavel Ondračka
ba9bdd5642 ci: improve run-shader-db and add r300 testing
Original author of r300 patch: Pavel Ondračka <pavel.ondracka@gmail.com>

Co-author: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19692>
2022-11-16 14:37:47 +00:00
David Heidelberg
6b87bad993 r300: use drm_shim_override
Acked-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19692>
2022-11-16 14:37:47 +00:00
David Heidelberg
e976f4930d ci/build: bump LLVM to 13 for debian-build-testing
Acked-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19692>
2022-11-16 14:37:47 +00:00
Pavel Ondračka
65ffcee23d meson: build radeon drm-shim also for r300 and r600
Right now the drm-shim is build only when one also builds radeonsi
or radv.

Acked-by: Pavel Ondračka <pavel.ondracka@gmail.com>
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/19692>
2022-11-16 14:37:47 +00:00
Joshua Ashton
c699122d6a turnip: Enable EXT_swapchain_colorspace
This extension is basically a no-op exposing some new enums.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19726>
2022-11-16 14:07:45 +00:00
Joshua Ashton
55b6813b7b anv: Enable EXT_swapchain_colorspace
This extension is basically a no-op exposing some new enums.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19726>
2022-11-16 14:07:45 +00:00
Joshua Ashton
5637a1b91e radv: Enable EXT_swapchain_colorspace
This extension is basically a no-op exposing some new enums.

Signed-off-by: Joshua Ashton <joshua@froggi.es>

Reviewed-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19726>
2022-11-16 14:07:45 +00:00
Joshua Ashton
0b9beb5107 wsi/display: Refactor available_surface_formats structure
Pack the VkSurfaceFormatKHR in here so we can expose formats +
color spaces in one.

This will be needed for exposing HDR color spaces such as
VK_COLOR_SPACE_HDR10_ST2084_EXT.

Signed-off-by: Joshua Ashton <joshua@froggi.es>

Reviewed-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19726>
2022-11-16 14:07:45 +00:00
José Roberto de Souza
d6c58f5446 iris: Destroy batch contexts in a single place
While at it also moving has_engines_context to iris_context, no need
to have this information replicated into every iris_batch.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19687>
2022-11-16 13:38:30 +00:00
José Roberto de Souza
cd159c7d6c iris: Set priority for replaced engine context
The replace_kernel_ctx() code path was not setting back the context
priority.

Fixes: 5c4c8bdc4c ("iris/batch: Add support for engines contexts")
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19687>
2022-11-16 13:38:30 +00:00
Matt Coster
f7e7fa6e5f pvr: Fix valgrind issue on compute job submissions
When no flags are set, submit_info->flags is uninitialized. This is not
a problem in the render codepath as the equivalent submit_info is
zeroed before being filled in.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19740>
2022-11-16 13:28:34 +00:00
Samuel Pitoiset
cd2e2021a0 radv: emit PA_SU_PRIM_FILTER_CNTL in the graphics preamble
This register doesn't change.

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/19654>
2022-11-16 13:02:14 +00:00
Samuel Pitoiset
d4ce63a87a radv: determine if sample positions are needed at pipeline bind time
Like other ring stuff that depends on 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/19654>
2022-11-16 13:02:14 +00:00
Samuel Pitoiset
5c9ade2464 radv: simplify load_sample_mask_in lowering
From the Vulkan spec:
    "Sample shading is enabled if at least one of the following
     conditions is true:

     - VkPipelineMultisampleStateCreateInfo::sampleShadingEnable is
       set to VK_TRUE, or
     - the fragment shader’s entry point interface includes input
       variables decorated with a BuiltIn of SampleId or SamplePosition
       built-ins."

We don't need to pass the number of rasterization samples, checking
for sample shading is enough. This will help for dynamic rasterization
samples.

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/19654>
2022-11-16 13:02:14 +00:00
Lucas Stach
0097592f8c etnaviv: rs: set TS_MODE for inplace resolve
When using the inplace resolve the TS_MODE isn't taken from the
RS_SOURCE_STRIDE state, but need to be set in RS_EXTRA_CONFIG.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19751>
2022-11-16 12:53:28 +00:00
Lucas Stach
7d370d80ed etnaviv: update headers from rnndb
Update to etna_viv commit 59403372cb48.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19751>
2022-11-16 12:53:28 +00:00
Lucas Stach
78c71d14e0 etnaviv: don't select TS modifier when not FAST_CLEAR capable
When presented with a list of modifiers to choose from we must never
pick a shared TS modifier if the local instance isn't FAST_CLEAR capable.

Fixes: c2b06e1a38 ("etnaviv: add support for sharing the TS buffer")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19751>
2022-11-16 12:53:28 +00:00
Martin Roukala (né Peres)
6e3fc88f0c radv/ci: mark the whole texturequerylod subtests as flakes on renoir
Seems like we keep on getting more of these flakes, so let's be a bit
broader.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19742>
2022-11-16 12:20:29 +00:00
Yonggang Luo
e70362e747 gallium/pipe: Trim trailing spaces in src/gallium/include/pipe/*.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/19545>
2022-11-16 11:21:01 +00:00
Michel Dänzer
b9be2773a1 ci: Drop a couple of -Werror exceptions from fedora-release job
No corresponding warnings left.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19744>
2022-11-16 10:40:34 +00:00
Michel Dänzer
2b724c0135 ci: Drop -Wno-error=unused-const-variable from debian-clang job
No corresponding warnings left.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19744>
2022-11-16 10:40:34 +00:00
Michel Dänzer
28ae62ef12 ci: Drop a couple of -Werror exceptions from debian-android job
No corresponding warnings left.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19744>
2022-11-16 10:40:34 +00:00
Samuel Pitoiset
1b8e66e564 radv: rework how vertex buffer descriptors are flushed
Dirty the flag at pipeline bind time, instead of passing this useless
pipeline_is_dirty flag.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19724>
2022-11-16 10:07:18 +00:00
Samuel Pitoiset
0945412ec8 radv: use more radv_dynamic_state pointers in radv_emit_XXX() helpers
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/19678>
2022-11-16 08:06:37 +00:00
Samuel Pitoiset
86d9a4f20f radv: cleanup radv_emit_viewport()
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/19678>
2022-11-16 08:06:37 +00:00
Samuel Pitoiset
2bb76d579c radv: constify more pointers in radv_emit_XXX() helpers
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/19678>
2022-11-16 08:06:37 +00:00
Samuel Pitoiset
34d81d264b radv: cleanup radv_CmdSetXXX() functions
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/19678>
2022-11-16 08:06:37 +00:00
Samuel Pitoiset
fc193133d4 aco: adjust an assertion about nir_texop_txf_ms and GFX11
This can fail with RADV_DEBUG=nofmask.

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/19613>
2022-11-16 07:59:15 +01:00
Samuel Pitoiset
cf7b96a83f radv: introduce RADV_DEBUG=nofmask
To disable MSAA compression on MSAA images. This will also allow us to
emulate GFX11 (FMASK has been removed) and to experiment 32 byte
descriptor sizes.

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/19613>
2022-11-16 07:59:11 +01:00
Sil Vilerino
912c72eda5 ci: Add va frontend to windows-build-rules
Fixes: 2d504bc5 ("CI: Add gallium-va and video-codecs in windows-vs2019 and debian-mingw32-x86_64")

Signed-off-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19767>
2022-11-16 04:23:05 +00:00
Rob Clark
35c78d4f15 freedreno/a6xx: Fix dummy binning pass FS shader
No changes, but it looks funning to see in the binning pass that FS uses
r0 and hr0.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19710>
2022-11-16 03:44:06 +00:00
Rob Clark
2de0a031ea freedreno/a6xx: Un-open-code some event names
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19710>
2022-11-16 03:44:06 +00:00
Rob Clark
0132c22de7 freedreno/a6xx: Don't disable LRZ for invalid channels
Similar idea to commit ("c9db71c8ba1 turnip: Don't disable LRZ for color
write mask channels beyond the format's"), but different implementation.
If the blend state masks writes to a color channel that doesn't exist,
that doesn't mean we need to disable LRZ write.  In particular, this
scenario will come up with z-prepasses (doh!)

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19710>
2022-11-16 03:44:06 +00:00
Rob Clark
4e9d913f81 freedreno/a6xx: Improve LRZ test for stencil write
If all the ops are KEEP, we don't actually write the stencil, and can
avoid falling off the LRZ fastpath.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19710>
2022-11-16 03:44:06 +00:00
Rob Clark
d03d08668f freedreno/a6xx: Use same LRZ state for draw and binning
Originally these where split as that is what the blob GL driver did (at
least at the time).  But that turns out to be unnecessary, so simplify
things and combine them into a single LRZ state object like tu does.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19710>
2022-11-16 03:44:06 +00:00
Rob Clark
2b186016a3 freedreno/a6xx: Handle additional depth test funcs
These were left as a TODO, and we forgot to revisit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19710>
2022-11-16 03:44:06 +00:00
Rob Clark
edca30efbf freedreno/drm: Fix suballoc alignment
IBO/etc descriptors need to be aligned to 64.. this was handled
correctly in the stateobj case (for tex descriptors) but not in
the streaming case (for IBO).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19710>
2022-11-16 03:44:06 +00:00
Alyssa Rosenzweig
cf6b2699ca panfrost: Don't set job_barrier on vertex jobs
This was a hack needed for the old transform feedback code. This barrier
is handled by the explicit XFB emulation that we're using on Midgard
now, so we don't need the barrier in the general case.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19760>
2022-11-16 02:45:14 +00:00
Pavel Ondračka
51457b19ce r300: tweak nir loop unrolling hint for r500 vertex shaders
This should prevent some cxbx-r shaders from unrolling above the
instruction limit and results in 3 gained cxbx-r shaders on RV530
with no other changes in shader-db.

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

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/19702>
2022-11-15 22:55:38 +00:00
Yonggang Luo
6ac678df43 freedreno: Add one flake
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7713

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19759>
2022-11-15 22:24:44 +00:00
M Henning
f3ee9be836 glsl: Drop borrow/carry lowerings in favor of nir
Unconditionally lowering prevents GL drivers from natively
implementing these ops. Drivers that need lowering should set
lower_uadd_carry and lower_usub_borrow on nir_shader_compiler_options to
get the nir lowerings.

Tested with dEQP-GLES31.functional.shaders.builtin_functions.integer.*

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19704>
2022-11-15 21:51:04 +00:00
Chia-I Wu
339d80d5f2 pps: make pps-producer RT only on freedreno
Calling sched_setscheduler twice every sample period has high CPU
overhead.  For intel and panfrost, their dump_perfcnt is preemptible and
they don't need the scheduler change.

For freedreno, simply makes the main thread RT at all time.  This solves
most of the cpu overhead issue.

v2: removed pthread_t param and just change the scheduler for the
    calling thread

Acked-by: Rob Clark <robdclark@chromium.org> (v1)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19668>
2022-11-15 21:21:42 +00:00
Yonggang Luo
557120b593 util: Include the needed util/detect*.h headers in multiple files
This is discovered either by manually or -W-no-def option

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/19674>
2022-11-15 20:35:55 +00:00
Yonggang Luo
4ff21b4a47 util: Remove the unused PIPE_(ARCH|OS|CC) macro defines from src/util/detect_arch.h and src/util/detect_cc.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/19674>
2022-11-15 20:35:55 +00:00
Yonggang Luo
1accc0df64 tree-wide: Convert all usage of PIPE_(OS|ARCH|CC)_* to DETECT_(OS|ARCH|CC)_* by use grep
This should be the last commit, and should be take care that can only in comment block or
version
Exclude files:
src/util/detect_*.h

From:
PIPE_(OS|ARCH|CC)_([0-9A-Z_]+)
To:
DETECT_$1_$2

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/19674>
2022-11-15 20:35:55 +00:00
Yonggang Luo
27fe4bd29f tree-wide: Convert all usage of #ifndef PIPE_(OS|ARCH|CC)_* to #if DETECT_(OS|ARCH|CC)_* by use grep
From:
#ifndef[\s]+PIPE_(OS|ARCH|CC)_([0-9A-Z_]+)
To:
#if !DETECT_$1_$2

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/19674>
2022-11-15 20:35:55 +00:00
Yonggang Luo
1817659bb6 tree-wide: Convert all usage of #ifdef PIPE_(OS|ARCH|CC)_* to #if DETECT_(OS|ARCH|CC)_* by use grep
From:
#ifdef[\s]+PIPE_(OS|ARCH|CC)_([0-9A-Z_]+)
To:
#if DETECT_$1_$2

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/19674>
2022-11-15 20:35:55 +00:00
Yonggang Luo
eab0da3c64 tree-wide: Convert all usage of defined PIPE_(OS|ARCH|CC)_* to DETECT_(OS|ARCH|CC)_* by use grep
From:
defined[\s]*PIPE_(OS|ARCH|CC)_([0-9A-Z_]+)
To:
DETECT_$1_$2

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/19674>
2022-11-15 20:35:55 +00:00
Yonggang Luo
80fac8637b tree-wide: Convert all usage of defined(PIPE_(OS|ARCH|CC)_*) to DETECT_(OS|ARCH|CC)_* by use grep
From:
defined[\s]*\([\s]*PIPE_(OS|ARCH|CC)_([0-9A-Z_]+)[\s]*\)
To:
DETECT_$1_$2

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/19674>
2022-11-15 20:35:55 +00:00
Yonggang Luo
4304177675 util: Add DETECT_ARCH_* and DETECT_CC_* macros for latter usage
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/19674>
2022-11-15 20:35:55 +00:00
Yonggang Luo
db01b983ed util: Move compiler configuration defines from detect_arch.h into detect_cc.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/19674>
2022-11-15 20:35:55 +00:00
Yonggang Luo
845222dbae util: Rename src/gallium/include/pipe/p_config.h to src/util/detect_arch.h
Even though the defines in p_config.h are stared with PIPE_, they are indeed
are generic detecting mechanics, we will rename them to DETECT_* in latter MR

We rename src/gallium/include/pipe/p_config.h src/util/detect_arch.h because
the detect code in src/gallium/include/pipe/p_config.h are most about
processor architecture detecting.

The file util/detect.h is added to replace functional of src/gallium/include/pipe/p_config.h
So we replace of #include "pipe/p_config.h" with #include "util/detect.h"

The file util/detect_cc.h is added as a placeholder for moving compiler related macro defines
from p_config.h into it in following commits

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/19674>
2022-11-15 20:35:55 +00:00
Yonggang Luo
7710cc8506 util: Test __PPC64__ for getting PIPE_ARCH_PPC_64 respond to __PPC64__ take effect
Fixes: e737a99a6f ("Fix PPC detection on darwin")

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/19674>
2022-11-15 20:35:55 +00:00
Sil Vilerino
d81e40b20c frontend/va: Fix WIN32 VA_DRIVER_INIT_FUNC declaration. Remove declspec as it uses .def file
Fixes: b557ceb7 ("frontends/va: Add windows VA frontend support via vl_winsys_win32 and libva-win32")
Closes: #7702

Signed-off-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19754>
2022-11-15 20:25:12 +00:00
Yonggang Luo
59f11b7612 util: Add test for util_get_process_name_may_override
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/19645>
2022-11-15 19:55:01 +00:00
Yonggang Luo
3325c5b80e util: Add tests for os_mman.h and util_get_process_name_may_override
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/19645>
2022-11-15 19:55:01 +00:00
Yonggang Luo
660b110494 util: Move src/gallium/auxiliary/os/os_mman.h to src/util/os_mman.h
Use "util/detect_os.h" instead of "pipe/p_config.h" and "pipe/p_compiler.h"
in src/util/os_mman.h

This is a prepare to implement os_mman on windows

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/19645>
2022-11-15 19:55:01 +00:00
Yonggang Luo
f5050d0fcd util: Replace the usage of os_get_command_line with util_get_command_line
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/19645>
2022-11-15 19:55:01 +00:00
Yonggang Luo
d600a0ed34 util: Merge the code from os_process.c into u_process.c
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/19645>
2022-11-15 19:55:01 +00:00
Yonggang Luo
fdad0477f0 util: Remove usage of boolean and duplicated code in os_process.*
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19645>
2022-11-15 19:55:01 +00:00
Yonggang Luo
3f4586575e util: Merge the __getProgramName code under HAIKU os
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19645>
2022-11-15 19:55:01 +00:00
Yonggang Luo
ed4fd1d90e util: cleanup cpuinfo.* and it's related files
_mesa_get_cpu_features is no more a needed thing as all it's usage are
replaced with util_get_cpu_caps in u_cpu_detect.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/19564>
2022-11-15 19:06:07 +00:00
Yonggang Luo
7436669d55 mesa/vbo: Replace the usage of cpu_has_sse4_1 with util_get_cpu_caps()->has_sse4_1 in vbo/vbo_minmax_index.c
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/19564>
2022-11-15 19:06:07 +00:00
Yonggang Luo
b84678ea28 util: Use util_get_cpu_caps instead cpu_has_sse4_1 macro
cpu_has_sse4_1 doesn't belongs to src/util, so do not depends on it,
this is a follow up of that u_cpu_detect.* doesn't depends on
pipe/p_*.h anymore

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/19564>
2022-11-15 19:06:07 +00:00
Yonggang Luo
6dab1896d1 util: Drop include "pipe/p_config.h" in src/util/u_cpu_detect.h
It's comes from src/gallium/include/pipe/p_config.h and that getting
streaming-load-memcpy.c can not use of it

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/19564>
2022-11-15 19:06:07 +00:00
Emma Anholt
3549439068 ci/nouveau: Add some recent flakes
Closes: #7708
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19757>
2022-11-15 18:53:26 +00:00
Jesse Natalie
72d66aa987 microsoft/compiler: Delete now-unused memcpy lowering pass
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19752>
2022-11-15 18:29:26 +00:00
Jesse Natalie
fb7fd02a2b microsoft/clc: Optimize memcpys
Use the optimization pass to try to remove them, and if that fails,
at least use the core nir lowering pass which is better about fixed-
size memcpys compared to the one we wrote for DXIL.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19752>
2022-11-15 18:29:26 +00:00
Daniel Schürmann
efc0835787 aco: move statistics enum to aco_shader_info.h
to make it accessible from the driver.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19721>
2022-11-15 16:34:07 +00:00
Daniel Schürmann
4306897979 radv: use radv_fill_nir_compiler_options() helper for prolog/epilog
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19721>
2022-11-15 16:34:07 +00:00
Daniel Schürmann
7c84ca8818 radv: create radv_fill_nir_compiler_options() helper function
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19721>
2022-11-15 16:34:07 +00:00
Samuel Pitoiset
369c9b6425 aco: fix p_interp_gfx11 to not overwrite SCC
s_wqm_b64 clobbers SCC.
Found this while working on dual source blending.

Fixes: 6113ee650a ("aco/gfx11: fix FS input loads in quad-divergent control flow")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19747>
2022-11-15 15:57:31 +00:00
David Heidelberg
3012e85e36 ci/alpine: build Mesa on top of Alpine 3.16
Alpine is lightweight distribution with musl-libc. We currently testing
with Debian and Fedora, which are both Glibc based distro, so this
option should be able give us chance to catch more build-system bugs.

Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19588>
2022-11-15 14:02:27 +00:00
David Heidelberg
8a35052253 ci/freedreno: add missing traces
Tested with:
```
.gitlab-ci/bin/ci_run_n_monitor.py --rev $(git rev-parse HEAD) --target ".*a[0-9]*-traces$" --force-manual
```

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19503>
2022-11-15 13:30:31 +00:00
Yonggang Luo
14eef14147 clover: empty soversion when on win32
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7675
Cc: mesa-stable

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Prodea Alexandru-Liviu <liviuprodea@yahoo.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19653>
2022-11-15 12:46:18 +00:00
Matt Coster
afb8308087 intel: Use common CONCAT/PASTE macros
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16945>
2022-11-15 11:54:42 +00:00
Matt Coster
6bf17673a5 glx: Use common CONCAT/PASTE macros
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16945>
2022-11-15 11:54:42 +00:00
Matt Coster
c411e2df70 gallium: Use common CONCAT/PASTE macros
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16945>
2022-11-15 11:54:42 +00:00
Matt Coster
f3c6ed77be amd: Use common CONCAT/PASTE macros
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16945>
2022-11-15 11:54:42 +00:00
Matt Coster
9991926bdf util: Add common CONCAT/PASTE macros
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16945>
2022-11-15 11:54:42 +00:00
Matt Coster
7a84473344 intel: Unify naming of CONCAT/PASTE macros
In isl/isl_priv.h:
 - __PASTE2 => PASTE2
 - __PASTE => CONCAT2

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Lionel Landwerlin <lionel.g.landwerlin@intel.com>

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16945>
2022-11-15 11:54:42 +00:00
Matt Coster
f2e9222701 glx: Unify naming of CONCAT/PASTE macros
In glxextensions.c:
 - CONCAT => PASTE2

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16945>
2022-11-15 11:54:42 +00:00
Matt Coster
6359836242 gallium: Unify naming of CONCAT/PASTE macros
In auxiliary/draw/draw_pt_vsplit_tmp.h:
 - CONCAT2 => PASTE2
 - CONCAT => CONCAT2

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16945>
2022-11-15 11:54:42 +00:00
Matt Coster
45f9939f9a amd: Unify naming of CONCAT/PASTE macros
In compiler/tests/framework.h:
 - _PASTE => PASTE2
 - PASTE => CONCAT2

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16945>
2022-11-15 11:54:42 +00:00
Erik Faye-Lund
c70c5ecd2e docs: move generic gallium envvars to root doc
It makes little sense to document the gallium envvars in multiple
places. Let's merge them all into the root envvar document.

This also moves GALLIUM_OVERRIDE_CPU_CAPS to toe root envvars doc, as
it's more generic than just LLVMpipe.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19593>
2022-11-15 11:25:05 +01:00
Erik Faye-Lund
e7e92f7954 docs: remove duplicate envvars
These envvars are also documented in the "envvars" document, which is
more prominent. Let's just drop these duplicate definitions to avoid
confusion.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19593>
2022-11-15 11:25:05 +01:00
Erik Faye-Lund
e91ee07b6a docs: fix badly encoded envvar-roles
Sphinx thinks the equals sign and the stuff that follows are parts of
the role, leading to warnings in nit-picky mode, as well as missing
links in the rendered result. Let's fix that by inserting some
whitespace.

While we're at it, fixup an incorrectly quoted literal.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19593>
2022-11-15 11:25:05 +01:00
Erik Faye-Lund
8723a18e67 docs: use envvar directive
When declaring an envvar, we should use the envvar directive, not the
envvar role. The latter is meant to reference the declaration, not the
other way around.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19593>
2022-11-15 11:25:05 +01:00
Erik Faye-Lund
9bfa939a5e docs: remove stale envvar-reference
This reference was left over when the envvar was removed.

Fixes: 231ccb6100 ("docs: Remove no-longer-accurate text about the xlib driver")

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19593>
2022-11-15 11:25:05 +01:00
Erik Faye-Lund
4eef5628c8 docs: drop custom envvar directive
The custom envvar directive is strange. It overloads the global
namespace, where there's already a well-known envvar directive, but the
envvar role won't resolve to envvars defined using the custom directive.

It's not really critical to declare the type and default value here, and
many descriptions already include this. Let's just use the plain one,
and let the description take care of the details where needed.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19593>
2022-11-15 11:25:05 +01:00
Erik Faye-Lund
864e658c0a docs: properly nest envvar descriptions
These were not nested properly, making the definitions not part of the
definition lists.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19593>
2022-11-15 11:25:05 +01:00
Erik Faye-Lund
7df50de210 docs: remove rogue "the"
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19719>
2022-11-15 10:01:15 +00:00
Erik Faye-Lund
afded9a0a5 docs: add missing extension-link
Not sure why I missed this one during the last round, but it seems I
did. Let's add the link!

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19719>
2022-11-15 10:01:15 +00:00
Erik Faye-Lund
9f2c9e4c3f docs: do not mention EGL_MESA_drm_display
This extension was removed back in 2016, but it seems we left a mention
of it in the docs.

The entire section with this extension seems kinda pointless now, so
let's drop it entirely.

Fixes: f3e23ead53 ("egl: remove remnants of MESA_drm_display")
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19719>
2022-11-15 10:01:15 +00:00
Erik Faye-Lund
a5f319a38e docs/tgsi: xDArray -> xD_ARRAY
This matches what we have in tgsi_strings.c, as well as the non-constant
part of the corresponding enum tgsi_texture_type values.

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19719>
2022-11-15 10:01:15 +00:00
Erik Faye-Lund
474ba56f78 docs/gallium: move period out of quotes
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19719>
2022-11-15 10:01:15 +00:00
Erik Faye-Lund
306a8379ca docs: lifecycle -> life cycle
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19719>
2022-11-15 10:01:15 +00:00
Erik Faye-Lund
a3a68da6ac docs: dll -> DLL
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19719>
2022-11-15 10:01:15 +00:00
Erik Faye-Lund
18fcd3c47c docs: un-committed -> uncommitted
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19719>
2022-11-15 10:01:15 +00:00
Erik Faye-Lund
4a42efb7fc docs: IPE -> PIPE
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19719>
2022-11-15 10:01:15 +00:00
Erik Faye-Lund
26d6f506a4 docs/asahi: use console blocks for console commands
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19719>
2022-11-15 10:01:15 +00:00
Erik Faye-Lund
5a31e1ecaa docs/asahi: use literal-block for build-options
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19719>
2022-11-15 10:01:15 +00:00
Erik Faye-Lund
2ebce11137 docs/asahi: fix indent
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19719>
2022-11-15 10:01:15 +00:00
Lucas Stach
3408cce076 etnaviv: don't always emit PE_DEPTH_CONFIG on shader changes
Since b29fe26d43 ("etnaviv: rework ZSA into a derived state") the PE
depth config is adjusted by etna_update_zsa() when the shader is changed.
When the PE depth config is actually changing as a result of this
adjustment the ZSA state is dirtied, so there is no need to emit the
state unconditionally when the shader is changed.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19686>
2022-11-15 09:51:56 +00:00
Lucas Stach
7fe91c9f66 etnaviv: switch to late Z when linear PE is used
In linear PE mode the early and late depth stage do not only disagree
about the cache layout, but they seem to fundamentally disagree about
the buffer layout. When Z was written via the late stage, early tests
always show spurious zfails, even if they are not in the same draw
call. Cache flushing and pipe stalls don't help in that case.

The only option to get reliable Z tests with linear render targets is
to move all Z handling into the PE stage. Even when early Z writes
are possible, we don't know if any other draw to the same surface
needs late Z handling, so we must never use the early stage.

Fixes: 53445284a4 ("etnaviv: add linear PE support")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19686>
2022-11-15 09:51:56 +00:00
Lucas Stach
e65d266529 etnaviv: fix shader register control with MSAA
Apparently MSAA doesn't only add another input, but it also increases
required temporaries by one. Simple programs where the register demand
is given by the number of inputs did work fine, while more complex ones,
where register demand is given by the number of temporaries exhibit
rendering issues without this fix.

Cc: 22.3 mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19582>
2022-11-15 09:07:40 +00:00
vabr-g
5bde671df2 gallium: Avoid nullptr-with-nonzero-offset
reserve() in rtasm_x86sse compares a pointer difference with some
integers to check if reallocation is needed.
It unfortunately groups the first pointer with an int, which makes it
possible to hit nullptr-with-nonzero-offset under Undefined Behavior
Sanitizer.
This patch suggests a reordering of the arithmetic expression so that
first the pointer difference is computed, and from that on it's just a
usual integer arithmetic, avoiding nullptr-with-nonzero-offset.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18522>
2022-11-15 07:52:59 +00:00
David Heidelberg
cdbb30334c ci/update_traces_checksum.py: make output more clean and implement colors
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19510>
2022-11-15 07:19:20 +00:00
David Heidelberg
e1d40d11f5 ci/update_traces_checksum.py: check if checksum is in the array, not it's value
Fixes: 45eda06953 ("ci: introduce update_traces_checksum.py")

Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19510>
2022-11-15 07:19:20 +00:00
Qiang Yu
88b1bb326d ac/llvm: fix gfx11 fs input load for 16bit varying
Otherwise we get empty output.

Fixes: b07204d780 ("radeonsi/gfx11: interp changes for 16bit")
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/19637>
2022-11-15 05:43:37 +00:00
Qiang Yu
c21e184cc5 ac/nir/ngg: remove nuw for negative value add
Add negative value is possible to wrap around. I haven't seen this
"nuw" causes any problem yet, but let's remove it for safe.

Fixes: 60ac5dda82 ("ac: Add NIR lowering for NGG GS.")
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/19718>
2022-11-15 05:19:20 +00:00
Qiang Yu
982b523769 ac/nir/ngg: fix nogs culling with nuw add
We should not use "nuw" here as negative add positive may wrap
around (negative is 0xffffff??).

This problem can be observed with LLVM15 (I can't see when LLVM14):
  %.neg = mul nsw i32 %31, -4
  %163 = add nuw nsw i32 %.neg, 16
  %164 = lshr i32 257, %.neg
  %165 = lshr i32 %164, %163

LLVM just assume %.neg is possitive, so pre-shift 0x01010101 by 16.
This get wrong value because we can't get back the shifted bits with
a negative shift right.

Fixes: 75dbb40439 ("ac/nir: Remove byte permute from prefix sum of the repack sequence.")
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/19718>
2022-11-15 05:19:20 +00:00
Caio Oliveira
e81c35d19f anv: Don't use REQUIRE_8 for Bindless Shaders
In 23c7142cd6 ("anv: disable SIMD16 for RT shaders") we were forcing the SIMD8
using the mechanism for subgroup size control, which is problematic since it has
other effects on the shader behavior.

The code was changed to select the SIMD in a different way in the previous patches,
so we can revert the behavior to the original semantics.

Fixes dEQP-VK.subgroups.builtin_var.ray_tracing.subgroupsize.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19601>
2022-11-15 04:55:18 +00:00
Caio Oliveira
eedbd1ddbf intel/compiler: Use SIMD selection helpers in compile_single_bs()
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19601>
2022-11-15 04:55:18 +00:00
Caio Oliveira
6c194ddd18 intel/compiler: Prepare SIMD selection helpers to handle different prog_datas
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19601>
2022-11-15 04:55:18 +00:00
Caio Oliveira
6ffa597bcf intel/compiler: Keep track of compiled/spilled in brw_simd_selection_state
We still update the cs_prog_data, but don't rely on it for this state anymore.
This will allow use the SIMD selector with shaders that don't use cs_prog_data.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19601>
2022-11-15 04:55:18 +00:00
Caio Oliveira
3c52e2d04c intel/compiler: Add a SIMD_COUNT constant
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19601>
2022-11-15 04:55:18 +00:00
Caio Oliveira
a0580dadfd intel/compiler: Create a struct to hold SIMD selection state
This is a preparation to decouple the storage of what SIMDs
compiled/spilled from the cs_prog_data.  This will allow reuse
of SIMD selection code by Bindless Shaders.

And since we have a struct now, move the error array there so
reduce the boilerplate of the users.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19601>
2022-11-15 04:55:18 +00:00
Caio Oliveira
8cda6cd774 intel/compiler: Simplify usage of brw_simd_select_for_workgroup_size()
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19601>
2022-11-15 04:55:18 +00:00
Caio Oliveira
a943dbf475 intel/compiler: Make brw_private.h and simd selector helpers C++
We don't intend to expose neither to drivers, so it is fine to be C++.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19601>
2022-11-15 04:55:18 +00:00
Dave Airlie
fb7de303ba gallivm: add coro malloc hooks earlier and always.
This fixes GALLIVM_DEBUG=asm for compute shaders, changing
the hooks after dumping causes a segfault because the
memory has already been finalised. Just add the hooks always,
and before dumping anything.

Fixes: f511d2a553 ("gallivm: rework coroutine malloc/free callouts.")
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19714>
2022-11-15 04:30:23 +00:00
Timothy Arceri
301daf868b glsl: remove unused intrinsics
Since everything now uses nir we can now drop these.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19713>
2022-11-15 03:47:18 +00:00
Jesse Natalie
cb32f9515e nir_scale_fdiv: Respect vector swizzles
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19709>
2022-11-15 03:05:13 +00:00
Marek Olšák
57863e21f6 radeonsi: print the number of shader outputs for shader-db
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19567>
2022-11-15 00:38:44 +00:00
Jose Fonseca
e2b044fe3f lavapipe: Prevent integer overflow adding index buffer offset and start index.
Direct3D and Vulkan's robustBufferAccess2 feature mandate that index
buffer out-of-bounds reads should return a zero index (ie, vertex at
index zero, not to be confused with a vertex with zero attributes, as
the kind resulting in vertex buffer out-of-bounds read.)

lavapipe was adding index_offset and start index together without
overflow checks, and if start index was sufficient large (as is the case
with WHCK wgf11draw which sets start index to (UINT)-5) it would cause
to wrap around causing fetches that should be out of bounds wrap around
and fetch inside bounds.

This change fixes this by doing a clamped add.  This ensures start index
is set to UINT32_MAX on overflow, which is sufficient in practice to
trigger draw index OOB code-paths, yield zero index to be returned.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19683>
2022-11-14 23:00:03 +00:00
Jose Fonseca
f47253c5c7 draw,util: Refactor draw_overflow_uadd into util.
So it can be used outside draw.  Also drop  the overflow_value parameter,
as it wasn't meaningfully useful.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19683>
2022-11-14 23:00:03 +00:00
Jose Fonseca
cb904ceb80 util/disk_cache: Prevent ‘sha1’ may be used uninitialized warnings.
These happen when shader cache is disabled (ENABLE_SHADER_CACHE
undefined) due to a prototype mismatch.

Also remove redundant return statements.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19683>
2022-11-14 23:00:03 +00:00
Ruijing Dong
b283567456 radeonsi/vcn: adding av1 decoding film grain block
add the logic for calculating film grain related
coefficients for VCN to generate film grain output.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19660>
2022-11-14 22:19:53 +00:00
Ruijing Dong
0b02db3007 frontends/va: fixed av1 decoding 10bit ffmpeg output YUV issue
av1 decoding supports NV12 and P010 output.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19660>
2022-11-14 22:19:53 +00:00
Emma Anholt
35606096de ci/llvmpipe: Switch rusticl and clover testing over to deqp-runner.
The usual reasons: Flake handling, familiar skips/xfails handling, faster
parallelization.  This also sets us up for running a subset of the CL CTS
once we decide to build it in our containers.

Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19608>
2022-11-14 21:45:28 +00:00
Guilherme Gallo
b0acae5f03 ci: Update to deqp-runner v0.16.0 for SKQP and CL support.
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19608>
2022-11-14 21:45:28 +00:00
Konstantin Seurer
57b2211cf0 radv/rt: Clone specialization infos
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19700>
2022-11-14 20:56:27 +00:00
Konstantin Seurer
39628c8999 radv/rt: Clone entrypoint names
Fixes a vtn crash with
dEQP-VK.ray_tracing_pipeline.pipeline_library.configurations.singlethreaded_compilation.s0_l1
and validation enabled.

Closes: #7642
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19700>
2022-11-14 20:56:27 +00:00
Konstantin Seurer
a4d6c57e65 radv: Use ralloc for allocating pipeline library resources
This fixes leaking shader modules on failure and simplifies freeing.

Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19700>
2022-11-14 20:56:27 +00:00
Konstantin Seurer
08b194fb46 vulkan,radv: Remove vk_shader_module_clone
The helper used ralloc which is unusual for vulkan objects, did not
handle allocation failures properly and was only useful for RADV.

Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19700>
2022-11-14 20:56:27 +00:00
David Heidelberg
902ec1fe0e replace sys/poll.h with poll.h
Fixes multiple warnings as this one:
```
/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp]
    1 | #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
      |  ^~~~~~~
```

Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19587>
2022-11-14 20:13:20 +00:00
David Heidelberg
48c1e0e166 intel/crocus: do not redefine PAGE_SIZE
See https://www.openwall.com/lists/musl/2015/09/11/5
```
../src/gallium/drivers/crocus/crocus_bufmgr.c:102: error: "PAGE_SIZE" redefined [-Werror]
```

Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19587>
2022-11-14 20:13:20 +00:00
David Heidelberg
9d81729c02 kopper: guard unused variable behind ifdef
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19587>
2022-11-14 20:13:20 +00:00
Eric Engestrom
92854b96bc docs/releasing: add convenient command to rebase everything since last release
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19536>
2022-11-14 20:06:44 +00:00
Eric Engestrom
68f942f217 docs/releasing: checkout the staging branch at the end of its creation process
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19536>
2022-11-14 20:06:44 +00:00
Eric Engestrom
739ecdf367 docs/releasing: update branchpoint instructions to be friendlier to our Marge-bot-based workflow
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19536>
2022-11-14 20:06:44 +00:00
Eric Engestrom
fa10735da3 docs/releasing: fix instructions to create a branch from a tag
Not sure if it used to work, but it doesn't anymore.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19536>
2022-11-14 20:06:44 +00:00
Eric Engestrom
6833138b5d docs/releasing: add VERSION variable to avoid typos when copy/pasting
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19536>
2022-11-14 20:06:44 +00:00
Caio Oliveira
494e2edb90 intel/compiler: Fix missing tie-breaker in brw_nir_analyze_ubo_ranges() ordering code
Per Ken suggestion, use ascending order for the start offset.

Fixes: 6d28c6e52c ("i965: Select ranges of UBO data to be uploaded as push constants.")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19731>
2022-11-14 19:41:35 +00:00
Caio Oliveira
9fd1d47aa0 intel/compiler: Fix dynarray usage in intel_clc
The code builds up the dynamic array of objects (spirv_objs) and
collect pointers to each of them into another dynamic
array (spirv_ptr_objs).

If the growth of the first array cause a reallocation, it is
possible that the previous pointers end up invalid.

Fixes: 77e929a527 ("intel/clc: allow multiple CL files to be compiled together")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19730>
2022-11-14 19:15:05 +00:00
Konstantin Seurer
71c4543af1 radv/rt: Get rid of null index AABB intersection handling
If the intersection shader is VK_SHADER_UNUSED_KHR (which is only allowed for a zero shader group) then no further processing of the intersection candidate occurs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19705>
2022-11-14 17:37:38 +00:00
Gert Wollny
ff896d5d09 r600/sfn: Call lower_flrp from driver code
gallium-nine seems to ignore the shader options and emits the
instruction despite "options::lower_flrp32 = true"

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19729>
2022-11-14 15:57:27 +01:00
Gert Wollny
e5646382ba r600/sfn: use only one undef in tex lowering
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19729>
2022-11-14 15:30:37 +01:00
Gert Wollny
df54aa7e33 r600/sfn: Use a bitfield for some register properties
Also simplify some use of these flags.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19729>
2022-11-14 15:30:37 +01:00
Gert Wollny
dba46bb8bc r600/sfn: handle possible inline const as array base for scratch loads
Replace some asserts with unreachable too.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19729>
2022-11-14 15:30:37 +01:00
Gert Wollny
307b81747e r600/sfn: Simlify check for zero and one
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19729>
2022-11-14 15:30:37 +01:00
Gert Wollny
a81c50a214 r600/sfn: implement finalize_nir
Move shader key independent lowering and some optimizations
to finalize_nir.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19708>
2022-11-14 14:11:14 +00:00
Alejandro Piñeiro
ec1cdc13d5 v3dv/bo: reset bo and then call gem close
After 'v3dv: fix debug dump on BO free' we changed the order, and this
lead to the following test
dEQP-VK.api.object_management.multithreaded_per_thread_resources.device_memory_small

v2: Expanded comment just before the reset, explaining that we need to
do the reset before we free the BO from the kernel (Iago)

Raising this assertion:
deqp-vk: ../src/broadcom/vulkan/v3dv_bo.c:281: v3dv_bo_alloc: Assertion `bo && bo->handle == 0' failed.

Fixes: 2c44597181 ('v3dv: fix debug dump on BO free')

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19693>
2022-11-14 12:37:52 +01:00
Eric Engestrom
b4b09bf8f2 Revert "ci/broadcom: v3dv-rpi4-vk:arm64 flakes too often"
This reverts commit cb02cf464c.

There are 3 reported flakes over a period of a month, and we have been
unable to reproduce it even once. It clearly doesn't happen often enough
to warrant disabling our vulkan CI, so let's restore it while we
continue to try to reproduce the issue on our side.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19720>
2022-11-14 10:16:28 +00:00
Erik Faye-Lund
3f371d4e94 zink: remove descriptor-mode selection infrastructure
We only support lazy descriptors these days, so having the
infrastructure around to support automatic selection of that one mode is
kinda silly.

And it's not like setting an environment variable that is never read is
going to cause any issues, so we don't even need this to avoid breaking
existing setups.

Let's just rip it out. We can reintroduce it again on the off-chance
that someone has a new clever descriptor mode they want to experiment
with.

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19670>
2022-11-14 09:46:15 +00:00
Samuel Pitoiset
d255bc8f05 radv: enable lowering of subgroup shuffle in NIR on GFX11+
VGPR allocation changed on GFX11 and this might have changed how
shared VGPRs work, so it's probably more secure to lower in NIR.

Cc: 22.3 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/19679>
2022-11-14 08:26:37 +01:00
Filip Gawin
a2dd0c77d6 r300: enable channel merging on r300/r400 VS
(VS doesn't have limitations like FS)

total instructions in shared programs: 27439 -> 26928 (-1.86%)
instructions in affected programs: 6219 -> 5708 (-8.22%)
helped: 157
HURT: 0
helped stats (abs) min: 1 max: 13 x̄: 3.25 x̃: 3
helped stats (rel) min: 1.03% max: 66.67% x̄: 17.66% x̃: 11.11%
95% mean confidence interval for instructions value: -3.58 -2.93
95% mean confidence interval for instructions %-change: -20.12% -15.20%
Instructions are helped.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19711>
2022-11-14 07:03:53 +00:00
Pavel Ondračka
54f6e72b27 r300: better register allocator for vertex shaders
This is a port of the fp pair regalloc. It is however much simpler as
contrary to the fp, we don't have to care about texturing, we can use
any swizzle we want and we don't have to track the inputs. Using the
register class machinery might actually be a slight overkill right now,
however the infrastructure will hopefully come in handy if someone
decides to implement the vp pair scheduling eventually.

Shader-db stats:

RV530:
total temps in shared programs: 18594 -> 17000 (-8.57%)
temps in affected programs: 5753 -> 4159 (-27.71%)
helped: 665
HURT: 0

RV370:
total temps in shared programs: 13555 -> 12181 (-10.14%)
temps in affected programs: 5116 -> 3742 (-26.86%)
helped: 633
HURT: 0

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

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19618>
2022-11-14 06:53:54 +00:00
Pavel Ondračka
0889c44f18 r300: another fix for reader detection in the presence of loops
This helps in some cases where we fail to detect that the write mask
is still alive after the loop and thus fail to detect some readers.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19618>
2022-11-14 06:53:54 +00:00
Pavel Ondračka
e571fb9d2e r300: properly account for per-channel negates when reswizzling
Vertex shaders can have a per-channel negate so we need to properly
update the negate mask when rewriting swizzles.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19618>
2022-11-14 06:53:54 +00:00
Pavel Ondračka
0146f5029a r300: don't skip source rewrite if RC_FILE_NONE in rc_for_all_reads_src
This function is used by rc_variable_change_dst when rewriting variables
and even though we don't need to rewrite the index for RC_FILE_NONE, we
still need to properly reswizzle.

All other users of the function are properly checking for RC_FILE_NONE
later.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19618>
2022-11-14 06:53:54 +00:00
Pavel Ondračka
7d28f429da r300: generalize rc_init_regalloc_state
It can now be used to init rc_regalloc_state for both vertex and
fragment shaders.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19618>
2022-11-14 06:53:54 +00:00
Pavel Ondračka
b9fe2df952 r300: add array with conflict values for the vp register classes
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19618>
2022-11-14 06:53:54 +00:00
Pavel Ondračka
431467b1d9 r300: add new register class list for vertex shaders
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19618>
2022-11-14 06:53:54 +00:00
Pavel Ondračka
59e22d9d35 r300: add FP suffix to the current class list
We will add a new one for vp in a next commit

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19618>
2022-11-14 06:53:54 +00:00
Pavel Ondračka
024a8d8bda r300: increase maximum number of writemask combinations
We can have up to 6 in vertex shaders.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19618>
2022-11-14 06:53:54 +00:00
Pavel Ondračka
240365a293 r300: move building of the interference graph to a separate function
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19618>
2022-11-14 06:53:54 +00:00
Pavel Ondračka
38f5b287e8 r300: generalize rc_find_class
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19618>
2022-11-14 06:53:54 +00:00
Pavel Ondračka
e1b4ba1350 r300: move some functions out of radeon_pair_regalloc
To prepare for a future sharing in vertex shader register allocator.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19618>
2022-11-14 06:53:54 +00:00
Pavel Ondračka
715e7172e8 r300: save pointer to register class list in the regalloc state
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19618>
2022-11-14 06:53:54 +00:00
Timothy Arceri
63c4849e8b nir: add another common ffract -> ffloor pattern
shader-db results (BDW):

total instructions in shared programs: 17527053 -> 17526931 (<.01%)
instructions in affected programs: 5116 -> 4994 (-2.38%)
helped: 25
HURT: 0
helped stats (abs) min: 2 max: 15 x̄: 4.88 x̃: 3
helped stats (rel) min: 0.25% max: 5.34% x̄: 3.39% x̃: 3.90%
95% mean confidence interval for instructions value: -6.19 -3.57
95% mean confidence interval for instructions %-change: -3.98% -2.81%
Instructions are helped.

total cycles in shared programs: 856680230 -> 856682009 (<.01%)
cycles in affected programs: 6583780 -> 6585559 (0.03%)
helped: 117
HURT: 77
helped stats (abs) min: 1 max: 854 x̄: 68.56 x̃: 16
helped stats (rel) min: <.01% max: 35.34% x̄: 2.12% x̃: 0.76%
HURT stats (abs)   min: 1 max: 2188 x̄: 127.27 x̃: 18
HURT stats (rel)   min: 0.01% max: 22.66% x̄: 1.86% x̃: 0.67%
95% mean confidence interval for cycles value: -30.07 48.41
95% mean confidence interval for cycles %-change: -1.28% 0.19%
Inconclusive result (value mean confidence interval includes 0).

LOST:   3
GAINED: 1

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19666>
2022-11-14 09:50:11 +11:00
Jason Ekstrand
11b2a063bf vulkan: Unconditionally add barriers for missing external subpass deps
This is a very scorched-earth approach which doesn't take into account
whether or not there are any explicitly provided dependencies.  We could
take a finer-grained approach in theory but it's unlikely to matter in
practice since you usually stall in Begin/EndRenderPass anyway.

Fixes: 1d726940d2 ("vulkan: Add a common CmdBegin/EndRederPass implementation")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6203
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7650
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19599>
2022-11-13 20:34:29 +00:00
Jason Ekstrand
4ff5051944 vulkan: Handle VK_SUBPASS_EXTERNAL at the end of a subpass
Fixes: 1d726940d2 ("vulkan: Add a common CmdBegin/EndRederPass implementation")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19599>
2022-11-13 20:34:29 +00:00
Gert Wollny
fee0042157 r600/sfn: Fix f2u32 and remove backend lowring of f2u64 and f2i64
The two conversion ops are now handled in nir_lower_int64,
but the fixup for the input to f2u32 has to be handled there
and not in f2u64.

Fixes: 29da985682
   nir/lower_int64: Enable lowering of 64-bit float to 64-bit integer conversions.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19707>
2022-11-13 12:56:29 +01:00
Gert Wollny
fd27b18631 r600/sfn: Fix source modifiers for ffract64
Fixes: 79ca456b48
    r600/sfn: rewrite NIR backend

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19707>
2022-11-13 12:56:19 +01:00
Caio Oliveira
e63d6ed85e spirv: Make vtn_fail and friends trap in debug mode
The SPIR-V parser catches its failures and failed assertions, clean up
and return a failure to the caller.  This is a good default behavior, but
when debugging sometimes is useful to hook the debugger right in the
failed assertion.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19663>
2022-11-13 07:07:56 +00:00
Lionel Landwerlin
ae76bba34a anv: bump pool bucket max allocation size
Age of Empire IV generates a shader of ~2.3Mb on DG2 which is above
the limit we currently have.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19669>
2022-11-12 21:40:34 +02:00
Simon Ser
145cb3e349 vulkan/wsi/wayland: fix unaligned load of dev_t
Fixes the following UBSan error:

    ../src/vulkan/wsi/wsi_common_wayland.c:654:27: runtime error: load of misaligned address 0x6110000666b4 for type 'dev_t' (aka 'unsigned long'), which requires 8 byte alignment

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19595>
2022-11-12 12:00:07 +01:00
Eric Engestrom
ad5c9c3fa4 llvmpipe: drop cache stats code
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Chris Healy <healych@amazon.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19644>
2022-11-12 03:04:35 +00:00
Eric Engestrom
4a14ba6fce disk_cache: add env var to show stats
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Tested-by: Chris Healy <healych@amazon.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19644>
2022-11-12 03:04:35 +00:00
Yiwei Zhang
f7d7e558c9 venus: handle VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT
This change adds some docs for the query size, and has been tested with
dEQP-VK.transform_feedback.primitives_generated_query.* on supported
implementations.

Fixes: 8f7b5bf34b ("venus: add VK_EXT_primitives_generated_query support")

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19684>
2022-11-12 01:11:56 +00:00
Jami Kettunen
8a5de0b6cf freedreno/pm4: Use unsigned instead of uint to fix musl build
Fixes the following error I noticed when building against aarch64 with
musl libc:

  In file included from ../src/freedreno/decode/crashdec.h:38,
                   from ../src/freedreno/decode/crashdec.c:40:
  ../src/freedreno/common/freedreno_pm4.h:104:15: error: unknown type name 'uint'
    104 | static inline uint
        |               ^~~~
  ../src/freedreno/common/freedreno_pm4.h:105:25: error: unknown type name 'uint'; did you mean 'int'?
    105 | pm4_calc_odd_parity_bit(uint val)
        |                         ^~~~
        |                         int

Signed-off-by: Jami Kettunen <jami.kettunen@protonmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19665>
2022-11-12 00:01:31 +00:00
Eric Engestrom
bc286e8586 ci: avoid triggering vc4 & v3d tests on v3dv-only MRs
There are a lot of vulkan-only MRs, so we can save a lot of CI resources
by not running GL tests as well.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19680>
2022-11-11 19:52:58 +00:00
Lucas Stach
2f85d9095e etnaviv: fix late Z with MSAA active
On RA_WRITE_DEPTH GPUs the RA stage needs to be told that MSAA is active
when the PE Z/S stage is needed. Not sure what it does exactly, but this
fixes broken late Z on those GPUs when performing MSAA rendering.

Cc: 22.3 mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19571>
2022-11-11 19:38:16 +00:00
Lucas Stach
804bf2eba2 etnaviv: update headers from rnndb
Update to etna_viv commit 6939cfeba30c.

Cc: 22.3 mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19571>
2022-11-11 19:38:16 +00:00
Konstantin Seurer
4035b0fa42 radv: Use a lds stack for ray queries when possible
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/17663>
2022-11-11 19:00:17 +00:00
Konstantin Seurer
3a50dcb3f4 radv: Always create ray query vars as shader temp
Avoid the whole "is this function or shader scope" code and fix some
memory leaks in the process.

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/17663>
2022-11-11 19:00:17 +00:00
Konstantin Seurer
2dc93e284e radv: Add a field for the max shared memory size
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17663>
2022-11-11 19:00:17 +00:00
Caio Oliveira
19c5739b74 spirv: Add MESA_SPIRV_DEBUG environment variable processing
This is similar to what NIR_DEBUG uses.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19603>
2022-11-11 10:09:35 -08:00
David Heidelberg
6addb8566d ci: remove duplicate entries from Fedora build
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19583>
2022-11-11 16:58:13 +00:00
Matt Coster
88f1fad3f7 pvr: Use common pipeline & dynamic state frameworks
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19342>
2022-11-11 16:48:51 +00:00
Matt Coster
a89ff8d4bc pvr: Use PVRX(TA_PASSTYPE) for pvr_fragment_shader_state.pass_type
Replaces the current uint32_t value.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19342>
2022-11-11 16:48:51 +00:00
Matt Coster
9056817a6c pvr: Store format aspects on render pass attachments
This expands the existing has_stencil field on struct
pvr_render_pass_attachment to be a complete set of VkImageApsectFlags.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19342>
2022-11-11 16:48:51 +00:00
Matt Coster
0e708609cb pvr: Remove scissor_accum dynamic state
This state is only required for an as-yet-unimplemented optimization.
If that optimization is ever implemented in the future, these
structures can be added back.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19342>
2022-11-11 16:48:51 +00:00
Matt Coster
082ad18cea pvr: VDMCTRL_INDEX_LIST[5-9] are not needed
An investigation turned up no need for these values on the currently
supported hardware configurations, so remove this comment for now.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19673>
2022-11-11 16:38:52 +00:00
Georg Lehmann
e21448d0d3 aco: Don't create useless exec movs while creating v_cmpx.
In a lot of situations the previous exec value was already copied from the
same registers that exec should be saved to. In that case we don't have to
insert an extra copy to save exec.

This breaks ssa but this pass is going out of ssa anyway.

Foz-DB Navi21:
Totals from 16129 (11.96% of 134913) affected shaders:
CodeSize: 128184044 -> 128054468 (-0.10%)
Instrs: 23902694 -> 23870325 (-0.14%)
Latency: 387124324 -> 387095955 (-0.01%); split: -0.01%, +0.00%
InvThroughput: 79949118 -> 79945859 (-0.00%); split: -0.01%, +0.00%
Copies: 1620768 -> 1588752 (-1.98%); split: -1.99%, +0.01%

Foz-DB Vega10:
Totals from 15546 (11.51% of 135041) affected shaders:
CodeSize: 120322524 -> 120200568 (-0.10%)
Instrs: 23448344 -> 23417855 (-0.13%)
Latency: 414018749 -> 413639289 (-0.09%); split: -0.09%, +0.00%
InvThroughput: 183819363 -> 183726539 (-0.05%); split: -0.05%, +0.00%
Copies: 2194937 -> 2164448 (-1.39%)

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18528>
2022-11-11 16:02:12 +00:00
Georg Lehmann
a653a390e1 aco: Make vcmpx definition handling clearer.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18528>
2022-11-11 16:02:12 +00:00
Lionel Landwerlin
bdf680cd3f intel/fs: use nir_opt_ray_query_ranges
Results on DG2 q2rtx shaders:

Totals from 6 (12.24% of 49) affected shaders:
Instrs: 88927 -> 54088 (-39.18%)
Cycles: 4115088 -> 2536902 (-38.35%)
Send messages: 2639 -> 1609 (-39.03%)
Spill count: 1321 -> 613 (-53.60%)
Fill count: 3130 -> 1104 (-64.73%)
Scratch Memory Size: 22528 -> 18432 (-18.18%)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16593>
2022-11-11 15:17:08 +00:00
Konstantin Seurer
bd9396c357 radv: Use nir_opt_ray_query_ranges
Quake II RTX:

Totals from 6 (12.24% of 49) affected shaders:
VGPRs: 584 -> 568 (-2.74%)
CodeSize: 152408 -> 152224 (-0.12%); split: -0.21%, +0.09%
Scratch: 252928 -> 116736 (-53.85%)
MaxWaves: 58 -> 60 (+3.45%)
Instrs: 28914 -> 28874 (-0.14%); split: -0.21%, +0.08%
Latency: 443165 -> 442141 (-0.23%)
InvThroughput: 97155 -> 94797 (-2.43%)
SClause: 719 -> 720 (+0.14%)
Copies: 4560 -> 4498 (-1.36%); split: -1.40%, +0.04%
PreVGPRs: 544 -> 535 (-1.65%)

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/16593>
2022-11-11 15:17:08 +00:00
Konstantin Seurer
f5b6576585 nir: Add a pass for combining ray queries
We can determice scopes/ranges of the use of ray queries and use this information to combine ray queries.

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/16593>
2022-11-11 15:17:08 +00:00
Konstantin Seurer
d22037b96c nir: Add and use nir_intrinsic_is_ray_query helper
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/16593>
2022-11-11 15:17:08 +00:00
Konstantin Seurer
04abfbca57 nir: Remove gather_info after removing dead vars
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/16593>
2022-11-11 15:17:08 +00:00
Timothy Arceri
34c52d8cb9 nir: fix typo in lower_double options handling
Seems the intention was to check that both flags were not enabled
instead we were checking that the floor flag was both set and not
set so the result would always be false.

Fixes: 3749a6ecd2 ("nir: honor lower_double options for ffloor and ffract")

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19642>
2022-11-11 14:36:00 +00:00
Mark Collins
d558309d67 freedreno/cffdec: Add NOP debug messages
We want to encode special messages into the CS that can be printed
by cffdec, these messages have identifiers that describe their
usage (message, scope begin and scope end) which allow for an
improved trace navigation experience due to the additional
information.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18271>
2022-11-11 13:50:57 +00:00
Mark Collins
d151ba5c30 tu: Implement utrace CS marker support
Adds support for emitting utrace markers into the CS, this allows
for useful debug information that can be decoded from a recorded
command stream.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18271>
2022-11-11 13:50:57 +00:00
Mark Collins
ac5a55ef11 common/utrace: Add CS logging support
Viewing CS traces retrieved from the driver is common practice to
determine driver bugs but there is no way to determine what
function a certain part of the CS was emitted by. This is crucial
information to determine what function is responsible for emitting
broken CS packets and to help with navigation of the CS trace.

Signed-off-by: Mark Collins <mark@igalia.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Ack-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18271>
2022-11-11 13:50:57 +00:00
Mark Collins
8370a0d6bf common/utrace: Prefix all environment variables with MESA_
To be more consistent with other environment variables and ensure
better scoping, all environment variables in utrace have now been
prefixed with `MESA_`.

Signed-off-by: Mark Collins <mark@igalia.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Ack-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18271>
2022-11-11 13:50:56 +00:00
Mark Collins
086b50078d common/utrace: Rename u_trace_context_actively_tracing to u_trace_should_process
Signed-off-by: Mark Collins <mark@igalia.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Ack-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18271>
2022-11-11 13:50:56 +00:00
Mark Collins
18e820009d common/utrace: Refactor and combine all envvars into GPU_TRACES
All environment variables involved in utrace usage were very
fragmented and convoluted to decode the meaning of, this commit has
simplified them down into easier to understand flags which directly
indicate the resulting behavior (such as `perfetto` enabling queued
logs rather than needing to set a `queued` flag) while combining
them into a single envvar `GPU_TRACES` and updating existing
terminology in utrace to match up with the new options.

Signed-off-by: Mark Collins <mark@igalia.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Ack-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18271>
2022-11-11 13:50:56 +00:00
Mark Collins
044d3e53d2 tu: Move utrace arguments to start from end
All arguments in Turnip code are fit to be moved to the start
event where they fit better as any sequential logging should print
the arguments with the scope start as it makes more sense than
printing arguments with the end of a scope.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18271>
2022-11-11 13:50:56 +00:00
Mark Collins
e954ec7fef tu/perfetto: Handle tracepoint args from start and end
Perfetto's tracing backend was designed to only handle arguments
at the end event, we want to cover arguments both at the start
and end of the trace.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18271>
2022-11-11 13:50:56 +00:00
Iago Toral Quiroga
f14e2ca099 v3dv: ignore imported BOs when tracking BO memory usage
Imported BOs are not allocated by the device so we don't
update BO stats when they are imported. Therefore, we should
not be updating them when they are freed either.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19675>
2022-11-11 13:25:28 +00:00
Jose Fonseca
6bb5aceb28 draw: Prevent index buffer overflow.
This prevents segfaults running wgf11draw DrawMethod=DrawIndexed tests
cases.

This change is not, however, sufficient to pass all tests.  That is,
there must remain code paths where indices read beyond the end of the
index buffer do not return zero index.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19648>
2022-11-11 12:59:29 +00:00
Iago Toral Quiroga
2c44597181 v3dv: fix debug dump on BO free
We were resetting the BO struct right before dumping its data. Fix
this by moving the reset later.

Fixes: 44fa8304d4 ('v3dv: add a refcount mechanism to BOs')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19672>
2022-11-11 11:54:36 +00:00
Matt Coster
947e183ff5 pvr: Implement new firmware stream interface
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-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/19530>
2022-11-11 11:34:17 +00:00
Matt Coster
a824b18fdf pvr: Set all compute sub-command registers in the same place
This moves the first group of registers from
pvr_sub_cmd_compute_job_init() to just before the second group in
pvr_compute_job_ws_submit_info_init().

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-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/19530>
2022-11-11 11:34:17 +00:00
noasakurajin
7666988937 disable zinks shader cache when the needed functions do not exist
Fixes: 4e14da056d ("zink: Enable mesa/st frontend shader caching.")
 Reviewed-by: Eric Engestrom <eric@igalia.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19592>
2022-11-11 11:16:50 +00:00
Tapani Pälli
0d85a0d7cd anv: remove dg2 condition for Wa_22011440098
We need same workaround for MTL.

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/19636>
2022-11-11 10:38:24 +00:00
Tapani Pälli
3eadb3f5b0 iris: remove dg2 condition for Wa_22011440098
We need same workaround for MTL.

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/19636>
2022-11-11 10:38:24 +00:00
Tapani Pälli
ecd4517560 anv: setup stage bitmask for Wa_22011440098
Fixes: 40b66a4499 ("anv, iris: Add Wa_22011440098 for DG2")
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/19636>
2022-11-11 10:38:24 +00:00
Tapani Pälli
210d95bdb3 iris: setup stage bitmask for Wa_22011440098
Fixes: 40b66a4499 ("anv, iris: Add Wa_22011440098 for DG2")
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/19636>
2022-11-11 10:38:24 +00:00
Lionel Landwerlin
4ceaed7839 anv: split internal surface states from descriptors
On Intel HW we use the same mechanism for internal operations surfaces
as well as application surfaces (VkDescriptor).

This change splits the surface pool in 2, one part dedicated to
internal allocations, the other to application VkDescriptors.

To do so, the STATE_BASE_ADDRESS::SurfaceStateBaseAddress points to a
4Gb area, with the following layout :
   - 1Gb of binding table pool
   - 2Gb of internal surface states
   - 1Gb of bindless surface states

That way any entry from the binding table can refer to both internal &
bindless surface states but none of the driver allocations interfere
with the allocation of the application.

Based off a change from Sviatoslav Peleshko.

v2: Allocate image view null surface state from bindless heap (Sviatoslav)
    Removed debug stuff (Sviatoslav)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7110
Cc: mesa-stable
Tested-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19275>
2022-11-11 10:13:27 +00:00
Gert Wollny
917d992b32 nir/algeraic_opt: use double options too for lowering ftrunc@64
ftrunc@64 also might need lowering on fp64 only, especially now
that it might be introduced by nir_lower_int64.

Fixes: 29da985682
   nir/lower_int64: Enable lowering of 64-bit float to 64-bit integer conversions.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19657>
2022-11-11 09:29:31 +00:00
Samuel Pitoiset
b142a7790e radv: advertise extendedDynamicState3ProvokingVertexMode with NGG
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/19168>
2022-11-11 08:50:03 +00:00
Samuel Pitoiset
2cce8500de radv: add support for dynamic provoking vertex mode with NGG
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/19168>
2022-11-11 08:50:03 +00:00
Samuel Pitoiset
d81cccbb77 radv: add lowering support for load_provoking_vtx_in_prim_amd when dynamic
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/19168>
2022-11-11 08:50:03 +00:00
Samuel Pitoiset
8d8aa05fd2 radv: declare shader arguments/locations for provoking vertex
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/19168>
2022-11-11 08:50:03 +00:00
Samuel Pitoiset
8bb572b7f8 radv: add radv_pipeline_key::dynamic_provoking_vtx_mode
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/19168>
2022-11-11 08:50:03 +00:00
Samuel Pitoiset
08b346e81a radv: re-emit NGG culling settings when conservative rast mode is dynamic
Found by inspection.

Fixes: fbed3aed4a ("radv: add support for dynamic conservative rasterization mode")
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/19651>
2022-11-11 08:20:23 +00:00
Luis Felipe Strano Moraes
d983827a62 meson: only enable intel-clc for x86_64 builds
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19662>
2022-11-11 07:35:27 +00:00
Yonggang Luo
8e677bc1e1 util: Replace the usage of boolean with c11 bool in u_cpu_detect.c
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19649>
2022-11-11 06:48:46 +00:00
Yonggang Luo
e39afa1ae8 microsoft: Fixes error: unknown type name ‘boolean’ in nir_to_dxil.c
error message:
../../src/microsoft/compiler/nir_to_dxil.c:1711:8: error: unknown type name ‘boolean’
 1711 | static boolean

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19649>
2022-11-11 06:48:46 +00:00
Yonggang Luo
5d794e8e3d util: Replace usage of boolean with c11 bool in src/util/format/* and src/util/tests/format/*
This is done by find and replace:
boolean -> bool
TRUE -> true
FALSE -> false

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19649>
2022-11-11 06:48:46 +00:00
Yonggang Luo
d13d93b089 util: Replace the usage of boolean with c11 bool in u_debug_symbol.c
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19649>
2022-11-11 06:48:46 +00:00
Yonggang Luo
28d044730f util: Replace the usage of boolean with c11 bool in u_debug_memory.c
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19649>
2022-11-11 06:48:46 +00:00
Yonggang Luo
89f7446643 util: Replace all usage of __FUNCTION__ with __func__ in src/util/*
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19646>
2022-11-11 06:15:42 +00:00
Yonggang Luo
605ebc32ee util: Remove va_copy fixup because of c11 is required
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19646>
2022-11-11 06:15:42 +00:00
Yonggang Luo
df3ca74053 util: Replace TAB with space in compiler.h
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19646>
2022-11-11 06:15:42 +00:00
Yonggang Luo
6eb2512fab util: Cleanup util/compiler.h
Remove MESA_*_ENDIAN
Use UTIL_ARCH_*_ENDIAN to define CPU_TO_LE32

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19646>
2022-11-11 06:15:42 +00:00
Yonggang Luo
6e8229c45a wsi: Use UTIL_ARCH_LITTLE_ENDIAN instead MESA_LITTLE_ENDIAN
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19646>
2022-11-11 06:15:42 +00:00
Yonggang Luo
67627c84a7 meson: Fixes name_prefix for clover on mingw
Cc: mesa-stable

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19610>
2022-11-11 05:38:20 +00:00
Yonggang Luo
f25d483e1b clover: Fixes building with mingw-x86
Cc: mesa-stable

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19610>
2022-11-11 05:38:20 +00:00
Yonggang Luo
a3b26e2758 clover: Rename *OpenCL.def to *OpenCL.def.in
Cc: mesa-stable

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19610>
2022-11-11 05:38:19 +00:00
Yonggang Luo
ab20ec9da7 meson: fixes mingw-clang32 building
Cc: mesa-stable

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19610>
2022-11-11 05:38:19 +00:00
Yonggang Luo
f03421702c meson: Refactoring shared gen_vs_module_defs_normal_command out
Cc: mesa-stable

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19610>
2022-11-11 05:38:19 +00:00
Yonggang Luo
e5656f07c7 radv: Fixes prototypes
Cc: mesa-stable

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19610>
2022-11-11 05:38:19 +00:00
Dave Airlie
9b3e4d5d7c pvr: use common command buffer status
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16922>
2022-11-11 05:01:24 +00:00
Jason Ekstrand
f1e95f324b pvr: Hook up vk_command_buffer_ops::reset
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16922>
2022-11-11 05:01:24 +00:00
Jason Ekstrand
255de11af3 pvr: Call command buffer reset conditionally
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16922>
2022-11-11 05:01:24 +00:00
Dave Airlie
49c4c5cb64 turnip: use common command buffer status code.
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16922>
2022-11-11 05:01:24 +00:00
Jason Ekstrand
697f448f6c turnip: Initialize push descriptors in tu_create_cmd_buffer()
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16922>
2022-11-11 05:01:24 +00:00
Dave Airlie
1486b54e80 panvk: move to using common command buffer status
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16922>
2022-11-11 05:01:24 +00:00
Jason Ekstrand
84cd81e104 panvk: Use common code for command buffer lifecycle management
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16922>
2022-11-11 05:01:24 +00:00
Jason Ekstrand
2126bb6c92 panvk: Drop panvk_cmd_buffer::queue_family_index
Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16922>
2022-11-11 05:01:24 +00:00
Dave Airlie
452ab5554d lavapipe: use common command buffer status code.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16922>
2022-11-11 05:01:24 +00:00
Dave Airlie
a0819382fc radv: use common command buffer status code.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16922>
2022-11-11 05:01:24 +00:00
Dave Airlie
a26755458e vulkan: Add common cmd buffer state tracking
For drivers already using vk_common_ResetCommandBuffer(), it now only
calls the driver's reset hook if the command buffer is not in the
INITIAL state.  Pulled this trick from the PowerVR driver.

v2 (Jason Ekstrand):
 - Rename from "status" to "state" since that's what's in the spec
 - Add vk_command_buffer_begin/end instead of drivers setting it all
   manually

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16922>
2022-11-11 05:01:24 +00:00
Qiang Yu
eca63c5e5c radeonsi: move param assign offset to si_get_nir_shader
We need this info for gfx11 param export soon and nir vertex
export lowering in the future.

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/19429>
2022-11-11 04:22:20 +00:00
Qiang Yu
35895c25e2 radeonsi: pack code into si_assign_param_offsets
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/19429>
2022-11-11 04:22:20 +00:00
Qiang Yu
63e2e45dfa radeonsi: small refine for si_nir_assign_param_offsets
Pass si_shader as arg directly, move primitive id pending
inside it.

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/19429>
2022-11-11 04:22:20 +00:00
Qiang Yu
17a66f2665 radeonsi: move si_nir_assign_param_offsets above
It's going to be called by si_get_nir_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/19429>
2022-11-11 04:22:20 +00:00
Qiang Yu
a6f86d003b radeonsi: implement nir_load_ring_attr_amd
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/19429>
2022-11-11 04:22:20 +00:00
Qiang Yu
3aaf7c103e ac/llvm: implement intrinsic for gfx11 param export
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/19429>
2022-11-11 04:22:20 +00:00
Qiang Yu
2510b7f66a radeonsi: use si_nir_clamp_vertex_color
Clamp vertex color in nir. Now only GS copy shader use
si_vertex_color_clamping, so move it there. It will be
completely removed after we switch to nir GS copy 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/19429>
2022-11-11 04:22:20 +00:00
Qiang Yu
42c2596b3c radeonsi: add si_nir_clamp_vertex_color pass
To replace the LLVM si_vertex_color_clamping.

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/19429>
2022-11-11 04:22:20 +00:00
Qiang Yu
533b39bfcb nir,ac/llvm,radeonsi: add nir_load_clamp_vertex_color_amd
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/19429>
2022-11-11 04:22:20 +00:00
Qiang Yu
a338d13a99 radeonsi: remove lower_fsat nir option
We implemented nir_op_fsat nir to llvm translation.

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/19429>
2022-11-11 04:22:20 +00:00
Lucas Stach
1d86188dc0 meson: enable Wmisleading-indentation
Clang enables it by default, but GCC does not. Enable it explicitly to
have some consistency between the supported compilers.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Eric Engestrom <eric@igalia.com>
Acked-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19439>
2022-11-11 01:56:28 +00:00
Rob Clark
5a6f95db13 freedreno/drm/virtio: Pre-allocate cmdstream buffers
We know cmdstream buffers are immediately mmap'd, which is both
expensive on the host, and breaks the pipelining as guest is forced
to stall waiting for the host.  So pre-allocate some cmdestream
buffers, so that we have something that is (hopefully) already
allocated and mapped to guest's physical memory before we need it.
The older buffer from the head of the prealloc list replaces the
newly allocated buffer which is pushed to the tail of the prealloc
list.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19656>
2022-11-11 01:27:03 +00:00
Rob Clark
1bb0cd6682 freedreno/drm: Use same-sized "chunks" for growable rings
Using the same size that we suballoc from for suballoc'd streaming and
long-lived stateobjs should help improve bo cache usage, by making more
of the backing BOs the same size and interchangable.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19656>
2022-11-11 01:27:03 +00:00
David Heidelberg
cb02cf464c ci/broadcom: v3dv-rpi4-vk:arm64 flakes too often
See https://gitlab.freedesktop.org/mesa/mesa/-/issues/7403

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19659>
2022-11-10 23:49:15 +00:00
Dylan Baker
41a929d94c util/glsl2spirv: pass path to glslangValidator into the script
This allows users to override the location of glslang using normal meson
mechanisms.

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>
2022-11-10 21:14:17 +00:00
Dylan Baker
ae30c6c375 meson: prog_glslang should always be for the build machine
It doesn't produce different code when compiled for the host machine,
and this avoids needing two copies and possibly a host machine emulator
in cross compilation settings

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>
2022-11-10 21:14:17 +00:00
Dylan Baker
9a85d2ed98 util/glsl2spirv: cleanup list extension
- consistently use list.extend instead of list +=, which has gotchas
- condense list extension calls when possible

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>
2022-11-10 21:14:17 +00:00
Dylan Baker
9a165945a9 util/glsl2spirv: use f-strings
Which are both faster and easier to read

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>
2022-11-10 21:14:17 +00:00
Dylan Baker
7c88c3a05b util/glsl2spirv: use if x in str instead of str.find
The latter is only idiomatically used when a start and/or stop position
is required.

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>
2022-11-10 21:14:17 +00:00
Dylan Baker
5488fa80dd util/glsl2spirv: simplify subprocess handling
Since we're not doing anything fancy, we can just use `subprocess.run`.
I've also removed the custom error class, we're not going to catch it,
so just printing and exiting is fine.

v2:
  - Print stdout as well as stderr in case of a glslang failure

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>
2022-11-10 21:14:17 +00:00
Dylan Baker
87c83c041a util/glsl2spirv: close resources as soon as possible
Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>
2022-11-10 21:14:17 +00:00
Dylan Baker
949c3b55db util/glsl2spirv: add type annotations
Which are all clean

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>
2022-11-10 21:14:17 +00:00
Dylan Baker
c01cd8cad1 util/glsl2spirv: add some error handling for unexpected code paths
We expect that convert_to_static_variable and override_version will find
and replace something, so let's fail loudly if they don't.

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>
2022-11-10 21:14:17 +00:00
Dylan Baker
6a5863df82 util/glsl2spriv: make --vn required
I'm not 100% sure whether it's right to make --vn required, or to avoid
the static conversion, but this seems correct. Mypy (type checking
coming soon) points out that if --vn is None then the
convert_to_static_variable function will fail. Our one use of this sets
--vn, so there is no change there. Making --vn required
ensures that it will never be None, avoiding the problem.

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>
2022-11-10 21:14:17 +00:00
Dylan Baker
4ffa8a9ac0 util/glsl2spirv: fix appending extra flags
The variable is called `extra`, but what's written is `extra - flags`,
and `flags` is undefined, so if the variable was ever passed there would
be an uncaught exception.

fixes: 9786d9ef2a

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>
2022-11-10 21:14:17 +00:00
Dylan Baker
041d9ac3dc util/glsl2spirv: let argparse actually enforce the restrictions we've set
Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>
2022-11-10 21:14:17 +00:00
Dylan Baker
f9df046436 util/glsl2spirv: drop inconsistent use of io.open
In Python 3 (the only python we support) `io.open` is an alias of the
builtin `open` function, so it's not getting us anything, and we're not
using it consistently.

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>
2022-11-10 21:14:17 +00:00
Dylan Baker
76e3b482be util/glsl2spirv: fix type error in argument handling
args.Olib is set to `store_true`, which means it will always be `True`
or `False`, this means that the we always, unconditionally, add
`--keep-uncalled` to the command line.

fixes: 9786d9ef2a

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>
2022-11-10 21:14:17 +00:00
David Heidelberg
f562e37c93 ci/freedreno: disable antichambers trace
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7668
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19627

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19634>
2022-11-10 20:43:44 +00:00
Emma Anholt
c9db71c8ba turnip: Don't disable LRZ for color write mask channels beyond the format's
aztec_ruins under ANGLE was getting LRZ writes disabled because 0xf out of
the 0x3 mask was enabled.  The goal was to see if there are partial writes
being done, though.  This caused a 2-3% performance regression.

Fixes: 85d0205db1 ("tu: Implement extendedDynamicState3ColorWriteMask")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19635>
2022-11-10 20:11:55 +00:00
Emma Anholt
062d4d83e1 ir3: Re-fuse ffmas after nir_lower_imul cleanup breaks them.
The nir_opt_algebraic() call to clean up nir_lower_imul's split up mul
operations (stuff like "the top 16 bits were 0, no need to mul and add
that part") would trigger the options->fuse_ffma_* early ffma splitting,
so you need to call nir_opt_algebraic_late() again after that (which, in
turn, requires a DCE).

Gets us a lot more ffmas in Aztec Ruins high under zink/angle, but doesn't
seem to change perf.

shader-db highlights:

total instructions in shared programs: 11574843 -> 10999629 (-4.97%)
instructions in affected programs: 3308870 -> 2733656 (-17.38%)

total dwords in shared programs: 24344722 -> 23230122 (-4.58%)
dwords in affected programs: 6569568 -> 5454968 (-16.97%)

total full in shared programs: 762616 -> 762224 (-0.05%)
full in affected programs: 15505 -> 15113 (-2.53%)

total stp in shared programs: 4046 -> 4050 (0.10%)
stp in affected programs: 3372 -> 3376 (0.12%)

total ldp in shared programs: 2166 -> 2170 (0.18%)
ldp in affected programs: 1716 -> 1720 (0.23%)

total (ss) in shared programs: 219541 -> 216261 (-1.49%)
(ss) in affected programs: 23227 -> 19947 (-14.12%)

total (sy) in shared programs: 101633 -> 101927 (0.29%)
(sy) in affected programs: 8611 -> 8905 (3.41%)

total waves in shared programs: 1501942 -> 1501772 (-0.01%)
waves in affected programs: 1880 -> 1710 (-9.04%)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18946>
2022-11-10 19:37:50 +00:00
Emma Anholt
a39113b616 ir3/ra: Make sure we don't pick a preferred reg overflowing the file.
If we're in handle_collect()'s dst allocation and are part of a merge set
near the end of the file, our check for reg_elem_size(reg) would let us
use the preferred reg when that would immediately lead to
allocate_dst_fixed() creating an interval extending thruogh reg_size(reg)
that overflows the file.

Avoids a regression on gfxbench5/gl_5_high_off/17.shader_test in the next
commit.  No change on shader-db.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18946>
2022-11-10 19:37:50 +00:00
Caio Oliveira
ecc2dfc503 intel/compiler: Use std::unique_ptr for tracking the fs_visitors
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19605>
2022-11-10 18:01:52 +00:00
Erik Faye-Lund
b79d9ee5a8 docs: add linkcheck job
This should make it easier to keep links in our docs up-to-date.

But, because links can die behind our backs, we can't really enable this
all over the place, or we'll risk blocking merge-requests due to
unrelated changes.

So let's just make this a periodic job on the main branch instead.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19574>
2022-11-10 17:26:19 +01:00
Erik Faye-Lund
4f26b5fa0f docs: do not linkcheck relnotes
There's a *lot* of relnotes, and we don't really actively maintain them.
Let's drop linkchecking them to speed things up a bit.

This does a whole lot of nothing unless you have Sphinx 4.4 or newer.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19574>
2022-11-10 17:26:19 +01:00
Erik Faye-Lund
80b5a7d48f docs: configure linkcheck
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19574>
2022-11-10 17:26:19 +01:00
Erik Faye-Lund
72718daeac docs/ci: allow overriding sphinx builder
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19574>
2022-11-10 17:26:19 +01:00
Erik Faye-Lund
1efc92fe8c docs/panfrost: drop anchor before channel-name
The use of a hash symbol in a URI is an anchor, not to indicate an IRC
channel name. This confuses the Sphinx linkchecker.

Dropping the hash here still makes the link work fine, so let's just do
that.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19574>
2022-11-10 17:26:19 +01:00
Erik Faye-Lund
67b77d8ade docs: apply some redirects
Here's a few redirects that we should apply, in case the redirects
gets removed in the future.

These are mostly of the 301 (moved permanently) kind, but also a
few where the site probably *should* have used the permanent
error-code.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19574>
2022-11-10 17:26:19 +01:00
Erik Faye-Lund
e9826708f9 docs: update lavasoftware.org link
Seems lavasoftware.org now prefers using the www-version of the link.
Let's update to that, to quiet some link-checking.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19574>
2022-11-10 17:26:19 +01:00
Erik Faye-Lund
0d96b8ea2f docs/perfetto: update documentation links
These links redirect to something seemingly random. Here's my best
effort to update them to the relevant pages in the current docs.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19574>
2022-11-10 17:26:19 +01:00
Erik Faye-Lund
62b9c32d9d docs: update link to GitLab CI docs
This link is being redirected, but not really where we want to send
people. Let's update it, so they end up in the right place.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19574>
2022-11-10 17:26:19 +01:00
Erik Faye-Lund
ccb41ce06c docs: update link to Intel intrinsics-guide
This link is being redirected, but not really where we want to send
people. Let's update it, so they end up in the right place.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19574>
2022-11-10 17:26:19 +01:00
Erik Faye-Lund
b5de3889b5 docs: update links to SPECviewperf 11/12
These links redirect to a catch-all page, and not really where we want
people to end up. Let's correct these links and point to the benchmark
specific pages.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19574>
2022-11-10 17:26:19 +01:00
Erik Faye-Lund
cdfd10741b docs: update link to the gl spec
This link is being redirected, but not really where we want to send
people. Let's update it, so they end up in the right place.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19574>
2022-11-10 17:26:15 +01:00
Erik Faye-Lund
a447247d5b docs: drop manual URL encoding
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19574>
2022-11-10 17:17:55 +01:00
Erik Faye-Lund
018e313a76 docs: point to github for defunct link
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19574>
2022-11-10 17:17:52 +01:00
Erik Faye-Lund
b925665e4e docs: link to web.archive.org for dead links
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19574>
2022-11-10 17:17:49 +01:00
Erik Faye-Lund
217df8825c docs: replace dead link
While it would be possible to dig this one up through web.archive.org,
there's a much better article written by Fabian Giesen on the subject,
so let's just link that one instead.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19574>
2022-11-10 17:17:45 +01:00
Erik Faye-Lund
1af9a8b169 docs: update dead link
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19574>
2022-11-10 17:17:42 +01:00
Erik Faye-Lund
1c4fe30466 docs: remove dead link to copy of article
There's no point in linking to a copy of this article on a defunct site.
So let's just remove it, the original source works just fine.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19574>
2022-11-10 17:17:39 +01:00
Erik Faye-Lund
86bacb3bd0 docs: update link to glsl
The page that was linked here is defunct, and doesn't have a direct
replacement. But a good alternative is to link to the OpenGL wiki, which
has a lot of useful information on the subject.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19574>
2022-11-10 17:17:35 +01:00
Erik Faye-Lund
9cda6292b9 docs/relnotes: drop links to defunct issue tracker
The Meego issue tracker has been defunct for a long time, and sadly the
content wasn't archived by web.archive.org. Let's just drop the links.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19574>
2022-11-10 17:17:32 +01:00
Erik Faye-Lund
2289c20802 docs/relnotes: escape non-urls
Sphinx can be a bit overly eager at interpreting text with colons in it
as URLs. There's a few cases in our older relnotes where this happens, so
let's escape them to avoid strange, broken links in the rendered output.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19574>
2022-11-10 17:17:28 +01:00
Erik Faye-Lund
ef05d28aa2 docs: fixup broken link syntax
Seems I got this slightly wrong when I fixed up the previous syntax
issue. Whoops, let's fix that!

Fixes: 6b3b633391 ("docs/zink: fix and cleanup rst syntax")
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19574>
2022-11-10 17:17:25 +01:00
Lionel Landwerlin
68fd9d2829 anv: fixup invalid enum for nir environment
Also switching away from PIPE_

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 8c4c4c3ee1 ("anv: Add softtp64 workaround")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19638>
2022-11-10 14:51:32 +00:00
Alyssa Rosenzweig
811f8a1946 panfrost: Require 64-byte alignment on imports
While Panfrost allocates linear images with strides that are a multiple of 64
bytes, other dma-buf producers on the system may not satisfy this requirement.
However, at least on v7 and newer, any image with a regular format must have a
stride that is a multiple of 64 bytes.

This fixes a real bug in an application that created a linear R8_UNORM image
with stride 480 bytes, imported it as an EGL_image, and then tried to texture
from it with the GPU. Previously, the driver allowed this situation but it
resulted in an imprecise fault from the GPU. This patch corrects the driver to
reject the import as invalid due to the unaligned stride, ensuring we never
attempt to texture from such a resource.

To implement, we add some new layout queries to centralize knowledge about the
stride alignment requirements, and we sprinkle in asserts to show how the
invariant is upheld throughout the lifecycle of image creation to texturing.

Cc: mesa-stable
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19620>
2022-11-10 14:37:18 +00:00
Alyssa Rosenzweig
1827b4a2db panfrost: Compile indirect dispatch shader on first use
For 2D UI workloads and even most 3D workloads, the indirect dispatch shader
won't actually be needed, but we currently compile it during eglInitialize() on
every v7 application. That hurts app start-up time, especially given that this
shader doesn't hit the disk cache. We can instead defer compiling this shader
until it's actually needed, when glDispatchComputeIndirect() gets called.

The tradeoff is that the first glDispatchComputeIndirect() call will be (much)
slower than successive calls, since we need to build and compile this internal
shader. I'm unconvinced that's a problem in practice.

An app would need to call glDispatchComputeIndirect for the first time in the
middle of a scene.  2D apps never would call that, OpenCL doesn't have that, and
GL compute will have the same costs just moved around.  So it's down to a 3D
GLES3.1 app that indirectly dispatches compute for the first time time in the
middle of a scene. Which, meh? It's not entirely implausible but we have bigger
fish to fry, and this fixes a real problem (about 5% of eglInitialize time spent
building this shader that won't actually get used).

es2_info starts slightly faster with this change.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19622>
2022-11-10 14:22:56 +00:00
Frank Binns
c6425d4490 pvr: conditionally call pvr_finishme() in pvr_csb_copy()
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/19578>
2022-11-10 14:11:07 +00:00
Frank Binns
3528874dd5 pvr: move TODO next to related code
This also removes the pvr_finishme(), as this is an improvement rather than
something we must do.

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/19578>
2022-11-10 14:11:07 +00:00
Frank Binns
97c4a318f8 pvr: replace unsupported sub-command type pvr_finishme()s with unreachable()s
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/19578>
2022-11-10 14:11:07 +00:00
Frank Binns
2d967f74d1 pvr: remove some stale FIXMEs/pvr_finishmes
* The pvr_finishme() in pvr_CreateImage() was added before vk_image_create() was
  being used and is no longer relevant.

* There's nothing special we need to do for the graphics pipeline flags and
  we don't currently store anything in the pipeline cache, so there's nothing
  to finish here.

* The firmware interface now uses fixed sized structures, so remove related
  FIXME.

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/19578>
2022-11-10 14:11:07 +00:00
Karmjit Mahil
9ebf72f62a pvr: Address TODO in PVR_PDS_CONST_MAP_ENTRY_TYPE_DESCRIPTOR_SET.
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/19523>
2022-11-10 13:52:37 +00:00
Karmjit Mahil
43641c614d pvr: Remove some TODOs.
- All the PDS programs setup in the pipeline are necessary. We
   can attempt optimisations later on.

 - No need to call pvr_pds_program_program_create_and_upload() in
   a loop.

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/19523>
2022-11-10 13:52:37 +00:00
Martin Roukala (né Peres)
54f5cfe81b radv/ci: enable pre-merge testing for vkcts on navi21
It has been a long-time coming, hasn't it? Hopefully more will come
soon!

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19556>
2022-11-10 13:22:33 +00:00
Martin Roukala (né Peres)
5e7cb59e11 radv/ci: move manual job decision to the jobs
This enables selectively enabling pre-merge testing on a per-job basis.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19556>
2022-11-10 13:22:33 +00:00
Martin Roukala (né Peres)
078020c45e ci: introduce the VALVE_FARM variable
This mirrors all the other *_FARM variables, and allows developers to
quickly disable all the jobs that would otherwise run on Valve's CI
infrastructure by setting it to the 'offline' value.

To this end, .radv_rules gets split into .radv-collabora-rules and
.radv-valve-rules, since the driver will be testable in two different
test farms. Every radv job is then made to inherit from the right farm.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19556>
2022-11-10 13:22:33 +00:00
Martin Roukala (né Peres)
bedbdb5554 ci/b2c-test: remove a noisy 'ls -l'
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19556>
2022-11-10 13:22:33 +00:00
Martin Roukala (né Peres)
a06d3c2d2c ci/b2c-test: update the trigger container to the latest version
This shouldn't affect anything, except some extra debug information
and some reliability improvements.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19556>
2022-11-10 13:22:33 +00:00
Lionel Landwerlin
b499a27d74 nir: make ray query load values visible in NIR prints
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19641>
2022-11-10 14:40:08 +02:00
Sarah Walker
525c1dd95b pvr: Fix segfault in pvr_CreatePipelineLayout when layout has zero bindings
Signed-off-by: Sarah Walker <sarah.walker@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19407>
2022-11-10 12:04:57 +00:00
Jason Ekstrand
4d63beaae6 hasvk: Switch to common code for command buffer lifecycles
This gets us command buffer object recycling.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18383>
2022-11-10 11:15:23 +00:00
Jason Ekstrand
415bf88637 anv: Switch to common code for command buffer lifecycles
This gets us command buffer object recycling.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18383>
2022-11-10 11:15:23 +00:00
Karol Herbst
89b49d479c rusticl: make image format/order work on radeonsi
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19381>
2022-11-10 10:21:34 +00:00
Karol Herbst
0cd23a6ae2 rusticl: skip lowering image/sampler derefs if drivers tells so
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19381>
2022-11-10 10:21:34 +00:00
Karol Herbst
d459a58473 nir/lower_cl_images: support keeping derefs
This is needed by radeonsi and zink

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19381>
2022-11-10 10:21:34 +00:00
Karol Herbst
eae281e788 rusticl/kernel: use binding for filling image channel data and order
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19381>
2022-11-10 10:21:34 +00:00
Karol Herbst
b44bf80ee6 rusticl: use texture vars for readonly images
This is needed by zink

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19381>
2022-11-10 10:21:34 +00:00
Karol Herbst
10144c1f0b rusticl: do not DCE any samplers or textures
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19381>
2022-11-10 10:21:34 +00:00
Karol Herbst
f8dd64739e radeonsi: do not DCE texture vars
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19381>
2022-11-10 10:21:34 +00:00
Karol Herbst
761a2819b5 nir: properly handle CL textures
Without this tex operations would reference images as the texture, which
doesn't really makes much sense. So move to a model closer to Vulkan by
using discrete texture and sampler variables instead.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19381>
2022-11-10 10:21:34 +00:00
Karol Herbst
915403ea6c nir/gather_info: take texture vars into account when counting textures
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19381>
2022-11-10 10:21:34 +00:00
Karol Herbst
829d6487c0 glsl: add texture subpass variants
Dzn needs those as it lowers images to textures and we want to be more
consistent about texture ops using texture vars instead of images.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19381>
2022-11-10 10:21:34 +00:00
Karol Herbst
87526f79db glsl: fix buffer texture type
Fixes: 3ace6b968b ("compiler/types: Add a texture type")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19381>
2022-11-10 10:21:34 +00:00
Samuel Pitoiset
d2563e6600 ac/nir: do not convert GS outputs to the expected variable size on GFX11
Outputs are always considered 32-bits.
Found by inspection.

Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19612>
2022-11-10 07:30:08 +00:00
Yonggang Luo
26a6d16db0 zink: Only #include <vulkan/vulkan_core.h> instead #include <vulkan/vulkan.h> in kopper_interface.h
It's pulled too much system dependent headers before this commit
when #include <vulkan/vulkan.h> directly,

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/19491>
2022-11-10 06:59:42 +00:00
Yonggang Luo
5425e05f2f zink: struct kopper_surface is not accessed, remove it in kopper_interface.h
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/19491>
2022-11-10 06:59:42 +00:00
Yonggang Luo
4c409b921b zink: Indent with 3 space in zink/zink_kopper.c
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/19491>
2022-11-10 06:59:42 +00:00
Yonggang Luo
4b337638bb wgl: Trim trailing spaces in stw_st.c
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/19491>
2022-11-10 06:59:42 +00:00
Yonggang Luo
0b82281e3e util: Use include_directories('..') instead include_directories('.') for inc_util
So include util headers are always using util/ prefix in mesa code base
And prevent including files under src/util without util/ prefix

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19546>
2022-11-10 06:27:25 +00:00
Yonggang Luo
e399dc3544 util: normalize include files under src/util/*.h with util/ prefix in mesa code base
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19546>
2022-11-10 06:27:25 +00:00
Yonggang Luo
beea3548ce util: Move texcompress template files into util/format
Because these files are accessed in  util/format/u_format_*.c
To make sure util are self contained we need move these files

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19547>
2022-11-10 05:35:41 +00:00
Yonggang Luo
0c12a39682 mesa: include <util/*.h> instead macros.h in texcompress_bptc_tmp.h
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19547>
2022-11-10 05:35:41 +00:00
Yonggang Luo
f6ed016fe9 util: Replace the usage of ALIGN16 with alignas(16) and them remove ALIGN16 macro
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19565>
2022-11-10 05:04:12 +00:00
Yonggang Luo
956935abaf vulkan: Replace _Alignas with alignas
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19565>
2022-11-10 05:04:12 +00:00
Yonggang Luo
38b2402b5f meson: Use deps_for_libmesa_util for idep_mesautil instead hand crafted list
Now the idep_mesautilc11 have no need reference when idep_mesautil is referenced

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19526>
2022-11-10 11:57:22 +08:00
Yonggang Luo
4d1a293e73 meson: Indent util/meson.build with 2 space
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19526>
2022-11-10 11:57:19 +08:00
Alyssa Rosenzweig
35a531fcd4 agx: Don't assert on texop twice
This is already asserted for lod modes.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19590>
2022-11-10 02:25:09 +00:00
Alyssa Rosenzweig
ededb108d9 agx: Implement unary math ops
Implement nir_op_bitfield_reverse, nir_op_bit_count, and
nir_op_ufind_msb. These map to native instructions.  With appropriate
integer render target and multiple render target support, passes:

   dEQP-GLES31.functional.shaders.builtin_functions.integer.bitfieldreverse.*vertex
   dEQP-GLES31.functional.shaders.builtin_functions.integer.bitfieldreverse.*fragment
   dEQP-GLES31.functional.shaders.builtin_functions.integer.bitcount.*vertex
   dEQP-GLES31.functional.shaders.builtin_functions.integer.bitcount.*fragment
   dEQP-GLES31.functional.shaders.builtin_functions.integer.findLSB.*vertex
   dEQP-GLES31.functional.shaders.builtin_functions.integer.findLSB.*fragment
   dEQP-GLES31.functional.shaders.builtin_functions.integer.findMSB.*vertex
   dEQP-GLES31.functional.shaders.builtin_functions.integer.findMSB.*fragment

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19590>
2022-11-10 02:25:09 +00:00
Alyssa Rosenzweig
44ccdca768 agx: Implement {i,u}mul_2x32_64
With support for MRT in the driver (not included here), passes:

   dEQP-GLES31.functional.shaders.builtin_functions.integer.imulextended.int_highp_fragment
   dEQP-GLES31.functional.shaders.builtin_functions.integer.umulextended.int_highp_fragment

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19590>
2022-11-10 02:25:09 +00:00
Alyssa Rosenzweig
74a884f73c agx: Implement nir_op_unpack_64_2x32_split_{x,y}
Used in the umul_extended lowering.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19590>
2022-11-10 02:25:09 +00:00
Alyssa Rosenzweig
ea88ebefb9 agx/ra: Remove index_to_reg
Use stronger asserts instead.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19590>
2022-11-10 02:25:09 +00:00
Alyssa Rosenzweig
dea00bcc8f agx: Add CSE optimization pass
Ported from the Bifrost compiler, in turn based on the ir3 one. This
cleans up a lot of junk we emit during NIR->AGX and will help with some
SSA RA troubles.

total instructions in shared programs: 34803 -> 34381 (-1.21%)
instructions in affected programs: 18652 -> 18230 (-2.26%)
helped: 198
HURT: 0
helped stats (abs) min: 1.0 max: 28.0 x̄: 2.13 x̃: 1
helped stats (rel) min: 0.31% max: 12.50% x̄: 3.94% x̃: 2.78%
95% mean confidence interval for instructions value: -2.45 -1.81
95% mean confidence interval for instructions %-change: -4.40% -3.48%
Instructions are helped.

total bytes in shared programs: 238094 -> 234824 (-1.37%)
bytes in affected programs: 126472 -> 123202 (-2.59%)
helped: 200
HURT: 0
helped stats (abs) min: 6.0 max: 168.0 x̄: 16.35 x̃: 8
helped stats (rel) min: 0.37% max: 17.65% x̄: 4.25% x̃: 3.38%
95% mean confidence interval for bytes value: -18.49 -14.21
95% mean confidence interval for bytes %-change: -4.67% -3.84%
Bytes are helped.

total halfregs in shared programs: 10078 -> 10107 (0.29%)
halfregs in affected programs: 565 -> 594 (5.13%)
helped: 22
HURT: 22
helped stats (abs) min: 1.0 max: 4.0 x̄: 1.23 x̃: 1
helped stats (rel) min: 5.71% max: 25.00% x̄: 23.38% x̃: 25.00%
HURT stats (abs)   min: 2.0 max: 4.0 x̄: 2.55 x̃: 2
HURT stats (rel)   min: 4.44% max: 30.77% x̄: 15.61% x̃: 12.73%
95% mean confidence interval for halfregs value: 0.03 1.28
95% mean confidence interval for halfregs %-change: -10.17% 2.40%
Inconclusive result (%-change mean confidence interval includes 0).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19590>
2022-11-10 02:25:09 +00:00
Alyssa Rosenzweig
4387d0886d agx: Describe whether instructions may be reordered
As per NIR, for the benefit of CSE. It is assumed that instructions that
cannot be eliminated also cannot be reordered.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19590>
2022-11-10 02:25:09 +00:00
Alyssa Rosenzweig
27869f6966 agx: Add and use replace_src helper
From Bifrost.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19590>
2022-11-10 02:25:09 +00:00
Alyssa Rosenzweig
adf3cbc04c agx: Use nir_opt_phi_precision
No shader-db changes, but helped a custom shader I wrote to test loops.
My shader-db is too small.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19590>
2022-11-10 02:25:09 +00:00
Alyssa Rosenzweig
98f0ebf264 agx: Pass agx_index to agx_copy
More straightforward interface and will allow including immediates later
if we want to.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19590>
2022-11-10 02:25:09 +00:00
Alyssa Rosenzweig
023f27fada agx: Coalesce collects when possible
Track collects and use them as affinities when choosing registers. On
glmark2:

total instructions in shared programs: 5498 -> 5388 (-2.00%)
instructions in affected programs: 2748 -> 2638 (-4.00%)
helped: 31
HURT: 0
helped stats (abs) min: 1.0 max: 12.0 x̄: 3.55 x̃: 3
helped stats (rel) min: 0.09% max: 57.14% x̄: 10.58% x̃: 5.97%
95% mean confidence interval for instructions value: -4.61 -2.49
95% mean confidence interval for instructions %-change: -15.16% -6.00%
Instructions are helped.

total bytes in shared programs: 37280 -> 36620 (-1.77%)
bytes in affected programs: 18880 -> 18220 (-3.50%)
helped: 31
HURT: 0
helped stats (abs) min: 6.0 max: 72.0 x̄: 21.29 x̃: 18
helped stats (rel) min: 0.07% max: 48.98% x̄: 9.16% x̃: 5.17%
95% mean confidence interval for bytes value: -27.64 -14.94
95% mean confidence interval for bytes %-change: -13.03% -5.29%
Bytes are helped.

total halfregs in shared programs: 1267 -> 1279 (0.95%)
halfregs in affected programs: 37 -> 49 (32.43%)
helped: 0
HURT: 9
HURT stats (abs)   min: 1.0 max: 2.0 x̄: 1.33 x̃: 1
HURT stats (rel)   min: 16.67% max: 66.67% x̄: 35.58% x̃: 28.57%
95% mean confidence interval for halfregs value: 0.95 1.72
95% mean confidence interval for halfregs %-change: 21.50% 49.67%
Halfregs are HURT.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19590>
2022-11-10 02:25:09 +00:00
Alyssa Rosenzweig
4cc2427ad6 agx: Introduce agx_foreach_ssa_{src,dest} macros
These are convenient iterators especially in the register allocator.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19590>
2022-11-10 02:25:09 +00:00
Alyssa Rosenzweig
4971870441 agx/ra: Factor out assign_regs
Prepare to record bookkeeping needed for live range splits.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19590>
2022-11-10 02:25:09 +00:00
Alyssa Rosenzweig
2b806b5cf8 agx/ra: Use BITSET_*_RANGE in some places
A bit neater.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19590>
2022-11-10 02:25:09 +00:00
Alyssa Rosenzweig
be5357a353 agx: Free dests of splits that are never read
Otherwise the registers "leak", bloating register pressure by
arbitrarily large amounts. This is easy to handle in DCE by rewriting to
a null destination, though we could use a sideband channel if we didn't
want null destinations in the IR.

glmark2 subset of shader-db is much improved:

total instructions in shared programs: 7324 -> 7313 (-0.15%)
instructions in affected programs: 483 -> 472 (-2.28%)
helped: 5
HURT: 2

total bytes in shared programs: 42788 -> 42722 (-0.15%)
bytes in affected programs: 2808 -> 2742 (-2.35%)
helped: 5
HURT: 2

total halfregs in shared programs: 2421 -> 2058 (-14.99%)
halfregs in affected programs: 1235 -> 872 (-29.39%)
helped: 28
HURT: 0

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19590>
2022-11-10 02:25:09 +00:00
Alyssa Rosenzweig
9a48c35668 agx: Refuse to handle discontiguous iter
This will cause problems with register allocation.

instructions HURT:   shaders/glmark/1-24.shader_test MESA_SHADER_FRAGMENT: 135 -> 136 (0.74%)
instructions HURT:   shaders/glmark/1-8.shader_test MESA_SHADER_FRAGMENT: 84 -> 85 (1.19%)

bytes HURT:   shaders/glmark/1-24.shader_test MESA_SHADER_FRAGMENT: 914 -> 922 (0.88%)
bytes HURT:   shaders/glmark/1-8.shader_test MESA_SHADER_FRAGMENT: 574 -> 580 (1.05%)

halfregs helped:   shaders/glmark/1-8.shader_test MESA_SHADER_FRAGMENT: 20 -> 19 (-5.00%)
halfregs helped:   shaders/glmark/1-24.shader_test MESA_SHADER_FRAGMENT: 25 -> 23 (-8.00%)
halfregs helped:   shaders/glmark/7-3.shader_test MESA_SHADER_FRAGMENT: 11 -> 10 (-9.09%)
halfregs helped:   shaders/glmark/4-2.shader_test MESA_SHADER_FRAGMENT: 23 -> 19 (-17.39%)

total instructions in shared programs: 5716 -> 5718 (0.03%)
instructions in affected programs: 219 -> 221 (0.91%)
helped: 0
HURT: 2

total bytes in shared programs: 38118 -> 38132 (0.04%)
bytes in affected programs: 1488 -> 1502 (0.94%)
helped: 0
HURT: 2

total halfregs in shared programs: 1639 -> 1631 (-0.49%)
halfregs in affected programs: 79 -> 71 (-10.13%)
helped: 4
HURT: 0
helped stats (abs) min: 1.0 max: 4.0 x̄: 2.00 x̃: 1
helped stats (rel) min: 5.00% max: 17.39% x̄: 9.87% x̃: 8.55%
95% mean confidence interval for halfregs value: -4.25 0.25
95% mean confidence interval for halfregs %-change: -18.31% -1.43%
Inconclusive result (value mean confidence interval includes 0).

Total CPU time (seconds): 11.41 -> 11.72 (2.72%)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19590>
2022-11-10 02:25:09 +00:00
Alyssa Rosenzweig
af2137883c agx: Don't emit writeout 0xC200
Metal omits this in OpenGL mode, and since we have no clue what it does,
I see no reason for us not to do the same.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19590>
2022-11-10 02:25:09 +00:00
Timothy Arceri
e295ee778b mesa: fix typo from adding glGetObjectLabelEXT
Fixes: 	675bcbb7a1 ("mesa: add EXT_debug_label support")

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19607>
2022-11-10 01:07:45 +00:00
Eric Engestrom
069bdef621 docs: update calendar for 22.3.0-rc2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19631>
2022-11-10 01:01:51 +00:00
Emma Anholt
74bbeb5116 ci/iris: Add some flakes from the new testing on JSL.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19628>
2022-11-09 22:07:10 +00:00
Ian Romanick
351b8c6aec intel/fs: Enable nir_op_imul_32x16 and nir_op_umul_32x16 on pre-Gfx7
Even though Intel's CI doesn't test these old platforms anymore, the
validation added in "intel/eu/validate: Validate integer multiplication
source size restrictions" combined with full shader-db runs gives me
confidence in the changes.

Sandy Bridge
total instructions in shared programs: 13902341 -> 13902167 (<.01%)
instructions in affected programs: 30771 -> 30597 (-0.57%)
helped: 66 / HURT: 0

total cycles in shared programs: 741795500 -> 741791931 (<.01%)
cycles in affected programs: 987602 -> 984033 (-0.36%)
helped: 28 / HURT: 5

Iron Lake
total instructions in shared programs: 8365806 -> 8365754 (<.01%)
instructions in affected programs: 1766 -> 1714 (-2.94%)
helped: 10 / HURT: 0

total cycles in shared programs: 248542694 -> 248542378 (<.01%)
cycles in affected programs: 29836 -> 29520 (-1.06%)
helped: 9 / HURT: 0

GM45
total instructions in shared programs: 5187127 -> 5187101 (<.01%)
instructions in affected programs: 891 -> 865 (-2.92%)
helped: 5 / HURT: 0

total cycles in shared programs: 163643914 -> 163643750 (<.01%)
cycles in affected programs: 22206 -> 22042 (-0.74%)
helped: 5 / HURT: 0

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19602>
2022-11-09 21:34:26 +00:00
Ian Romanick
293ad13e3f intel/fs: Slightly restructure emitting nir_op_imul_32x16 and nir_op_umul_32x16
There are no immediate values at this point, so all of this code was
bunk. :face_palm:

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19602>
2022-11-09 21:34:26 +00:00
Ian Romanick
ee2a299661 intel/eu/validate: Validate integer multiplication source size restrictions
v2: Expect correct result on BDW in test_eu.

v3: Fix SNB type-size check. Noticed by Marcin.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19602>
2022-11-09 21:34:26 +00:00
Ian Romanick
d668512f88 intel/compiler: Fix signed integer range analysis of imax and imin
Some review feedback of an earlier commit caused me to rearrange some
code quite a bit. I wasn't paying enough attention while applying the
later commits, and these breaks should have been returns. As it is, the
result of the imin or imax analysis is overwritten by the default case
handling... effectively the original commit does nothing. :(

Tiger Lake and Ice Lake had similar results. (Ice Lake shown)
total instructions in shared programs: 19914090 -> 19904772 (-0.05%)
instructions in affected programs: 121258 -> 111940 (-7.68%)
helped: 445 / HURT: 0

total cycles in shared programs: 855291535 -> 855266659 (<.01%)
cycles in affected programs: 2737005 -> 2712129 (-0.91%)
helped: 426 / HURT: 17

LOST:   0
GAINED: 3

Skylake and Broadwell had similar results. (Skylake shown)
total cycles in shared programs: 842395356 -> 842338259 (<.01%)
cycles in affected programs: 5460985 -> 5403888 (-1.05%)
helped: 458 / HURT: 0

Haswell and Ivy Bridge had similar results. (Haswell shown)
total instructions in shared programs: 16710449 -> 16708449 (-0.01%)
instructions in affected programs: 44101 -> 42101 (-4.54%)
helped: 75 / HURT: 0

total cycles in shared programs: 882760230 -> 882727923 (<.01%)
cycles in affected programs: 2867797 -> 2835490 (-1.13%)
helped: 62 / HURT: 10

No shader-db change on any other Intel platform.

No fossil-db changes on any Intel platform.

Fixes: 5ec75ca10d ("intel/compiler: Teach signed integer range analysis about imax and imin")
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19602>
2022-11-09 21:34:26 +00:00
Dave Airlie
0f81d9bc88 drm-shim/nouveau: fix the shim to work with nvif ioctl.
The new nouveau code asks the kernel for supported class,
this needs the new nvif interface, so stub it up using
the old code.

unfortunately this also needs a clang warning turned off
so the gnu extension this code needs is enabled in meson

Reviewed-by: M Henning <drawoc@darkrefraction.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17633>
2022-11-09 21:21:22 +00:00
Ben Skeggs
3a94b3b2a7 gv100/ir: noop OP_BAR for now
Let's get stuff rolling and deal with figuring this out later.

Acked-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17633>
2022-11-09 21:21:22 +00:00
Ben Skeggs
f650c2b076 nvc0: fix ga10x compute launch
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Acked-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17633>
2022-11-09 21:21:22 +00:00
Ben Skeggs
56dbf443a8 nvc0: no tex cb mthd on ga10x
I somewhat expect this isn't necessary on Volta and newer too, as the
index is coded into shaders now, but, HW doesn't complain, so leave it.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Acked-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17633>
2022-11-09 21:21:22 +00:00
Ben Skeggs
25d4db0600 nvc0: recognise ga10x chipsets
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Acked-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17633>
2022-11-09 21:21:22 +00:00
Ben Skeggs
5a1ccd0a88 nvc0: properly allocate copy engine class before using it
Important for upcoming kernel changes to more correctly manage the CE
context on Volta and newer, or the channel will be killed in response
to a CTXNOTVALID error from the GPU.

The kernel will have a workaround for Volta and Turing GPUs to preserve
ABI, but will require userspace to behave correctly on Ampere and newer.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Acked-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17633>
2022-11-09 21:21:22 +00:00
Ben Skeggs
7ad20e7ba9 nvc0: lookup supported classes instead of determining from chipset
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Acked-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17633>
2022-11-09 21:21:22 +00:00
Iago Toral Quiroga
1174f37609 broadcom/compiler: avoid using ldvary sequence to hide latency of branching
This can cause us to stomp the contents of r5 before we have a chance to read
it, like this:

0x3d103186bb800000 nop                           ; nop                         ; ldvary.r0
0x3d105686bbf40000 nop                           ; mov rf26, r5                ; ldvary.r1
0x020000ef0000d000 bu.allna  232, r:unif (0x0000001c / 0.000000)
0x3d1096c6bbf40000 nop                           ; mov rf27, r5                ; ldvary.r2

Here, the MOV in the last instruction is supposed to read r5 produced from
ldvary.r0, but because we have inserted the bu instruction in between now
that read happens at the same time that ldvary.r1 updates r5, stomping the
value we were supposed to read.

Fix this by disallowing injection of a branch instruction in between an ldvary
instruction and its write to the r5 register 2 instructions later.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7062
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19616>
2022-11-09 20:51:25 +00:00
Emma Anholt
019ca611fa nir/lower_io_to_vector: Demote the old scalar vars to globals.
This prevents nir_lower_io_to_temporaries from emitting new writes to the
old globals that we meant to have disappear through
DCE/remove_unused_variables.  If you don't do this, then unless you call
nir_opt_undef() and it successfully catches io_to_temps' new writes of
undefs to the scalar components, the scalar vars will stick around and
have stores that conflict with the real vector vars.

This hasn't been a problem for the end result of codegen because
nir_opt_undef() did succeed.  However, things went south with vars_to_ssa
mediump lowering, which obscured the result from opt_undef.  And, it's
really mind-bending to see undef writes to the outputs for a chunk of the
shader compiler pipeline anyway.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18218>
2022-11-09 20:21:17 +00:00
Jason Ekstrand
25c180b509 intel: Don't cross DWORD boundaries with byte scratch load/store
The back-end swizzles dwords so that our indirect scratch messages match
the memory layout of spill/fill messages for better cache coherency.
The swizzle happens at a DWORD granularity.  If a read or write crosses
a DWORD boundary, the first bit will get correctly swizzled but whatever
piece lands in the next dword will not because the scatter instructions
assume sequential addresses for all bytes.  For DWORD writes, this is
handled naturally as part of scalarizing.  For smaller writes, we need
to be sure that a single write never escapes a dword.

Fixes: fd04f858b0 ("intel/nir: Don't try to emit vector load_scratch instructions")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7364
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19580>
2022-11-09 19:45:10 +00:00
Jason Ekstrand
85685cf932 intel/lower_mem_access_bit_sizes: Compute alignments automatically
Because dup_mem_intrinsic() retains the SSA offset from the original
intrinsic and only modifies it by adding a constant, we can compute the
alignment based on the original alignment and the constant offset.  This
is both easier and more accurate.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19580>
2022-11-09 19:45:10 +00:00
Mario Kleiner
24094ee03d vulkan/wsi/display: Reset connector state in vkReleaseDisplay().
If an application was transitioning out of fullscreen exclusive
display mode, the wsi_display_connector->active state was not
reset in vkReleaseDisplay() from fullscreen. When the app then
later tried to go to fullscreen display mode again on the same
display output with the same video mode, this caused
_wsi_display_queue_next() to skip a required drmModeSetCrtc()
during the first vkQueuePresent() after entering direct display
mode.

While this often worked by pure luck on a single-display setup,
it goes sideways on a multi-display setup where the viewport
of the associated crtc does not have a (x,y) offset of (0,0).
E.g., XOrg/X11 RandR output leasing of an output whose viewport
starts at x = 1920:

1. X-Server has RandR outputs viewport at x = 1920, in a shared
   framebuffer, shared across all crtc's on a X-Screen.

2. Application leases that output for direct display mode,
   1st vkQueuePresent() triggers drmModeSetCrtc() of output
   to (x,y) = 0,0, as required for Vulkan/wsi/direct framebuffer
   setup.

3. Application does rendering and presenting.

4. Application vkReleaseDisplay() the output, terminates the
   RandR lease. X-Server takes over again.

5. X-Server modesets to reconfigure output back to viewport
   with (x,y) = 1920, 0.

6. Application leases same output again later on, and tries
   vkQueuePresent() again. Because of the bug fixed in this
   commit, the required drmModeSetCrtc() to (x,y) = 0,0 is
   erroneously skipped due to the stale cached connector state.

7. drmModePageflip() fails due to the wrong crtc viewport
   (x,y) = 1920, 0, mismatched for the need of the Vulkan
   framebuffer of (x,y) = 0,0. Kernel returns -ENOSPACE,
   Swapchain goes into permanent VK_ERROR_SURFACE_LOST state.
   Destroying and recreating the swapchain, as recommended
   by the Vulkan spec for error handling won't help. Game over!

Resetting wsi_display_connector->active = false; fixes the
problem of wrong / stale connector state and Vulkan/wsi/display
clients are happy on multi-display setups again, as tested
in various single- and multi-display configurations.

This bug affects all Mesa releases with Vulkan/WSI/Display
support and should therefore be backported.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Fixes: 352d320a07 ("vulkan: Add EXT_direct_mode_display [v2]")
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19484>
2022-11-09 17:13:19 +00:00
Karol Herbst
4ca61b5420 rusticl/nir: copy alignment info when lowering kernel input loads
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19614>
2022-11-09 16:39:26 +00:00
Erik Faye-Lund
ba78af66c6 docs: use ext-role for GL / VK extensions
This makes sure that we generate proper links to all of these
extensions.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19594>
2022-11-09 16:10:55 +00:00
Erik Faye-Lund
f69560bdcb docs: add ext-role for spec extension links
This is a custom Sphinx role that generates links to GL and VK
extensions.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19594>
2022-11-09 16:10:55 +00:00
Erik Faye-Lund
d20bfeaa89 docs: drop rogue backtick
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19594>
2022-11-09 16:10:55 +00:00
Erik Faye-Lund
24372e4882 docs: NV_gpu_shader4 -> NV_gpu_program4
There's no GL_NV_gpu_shader4 extension, and the TEX opcode is defined in
NV_gpu_program4. Correct the mistake.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19594>
2022-11-09 16:10:55 +00:00
Erik Faye-Lund
b51d1af1c1 docs: feeddback -> feedback
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19594>
2022-11-09 16:10:55 +00:00
Alyssa Rosenzweig
fd0af2bb4d panfrost: DRY buffer range special case
Pattern from iris.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19576>
2022-11-09 15:56:20 +00:00
Alyssa Rosenzweig
f8553ef44c panfrost: Remove out-of-band CRC support
Without additional signalling of modifiers, CRCs cannot possibly in a correct
way work across process boundaries. Since we don't do that signalling, we should
not be allocating private CRCs for imported resources, and we should not be
using our own private CRCs for internal resources.

The entire out-of-bands CRC infrastructure is a hack to let us do CRCs even for
imported/exported BOs, but that can't possibly work. Remove it, and remove a
pile of special cases across the driver.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19576>
2022-11-09 15:56:20 +00:00
Alyssa Rosenzweig
cf7a3906b0 panfrost: Copy resources when necessary
If the map doesn't set MAP_DISCARD_RANGE, we do have to copy the existing
contents over. MAP_WRITE on its only gives permission to replace the contents,
unfortunately it does not require that the application actually do so.

Closes: #7640
Fixes: 0b26a9f773 ("panfrost: Don't copy resources if replaced")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Roman Elshin
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19576>
2022-11-09 15:56:20 +00:00
Samuel Pitoiset
59cc628c06 radv: use radv_max_descriptor_set_size() for Vulkan 1.2 properties
Instead of copying this limit entirely.

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/19598>
2022-11-09 15:16:01 +00:00
Alyssa Rosenzweig
d40af87909 panfrost: Fix build with Perfetto (again)
Sync UAPI for the upstream fix.

Upstream commit: https://cgit.freedesktop.org/drm-misc/commit/?h=drm-misc-fixes&id=c4299907c09a638c0a30f029338d07941c049d73

Closes: #7195
Fixes: 6a4532cbab ("panfrost: Sync panfrost_drm.h from drm-misc-next")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Tested-by: Chris Healy <healych@amazon.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19581>
2022-11-09 14:35:31 +00:00
Yonggang Luo
81b4af2849 ci: Fixes macos.yml
Stick to macos-11 to prevent accident broken
always install meson with pip to prevent pull new version of python

Cc: mesa-stable

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19615>
2022-11-09 14:00:40 +00:00
Yonggang Luo
4d058a7034 meson: -DVK_ENABLE_BETA_EXTENSIONS at a single place
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19549>
2022-11-09 13:30:24 +00:00
Martin Roukala (né Peres)
560b327696 radv/ci: add more subtests to VanGogh's flakes list
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19591>
2022-11-09 12:18:04 +00:00
Erik Faye-Lund
293d8eb20e docs: use c:expr role shorthand
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19575>
2022-11-09 12:09:17 +00:00
Erik Faye-Lund
4be9600ccb docs: remove needless c:expr roles
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19575>
2022-11-09 12:09:17 +00:00
Erik Faye-Lund
4bc1d3e79c docs: make c:expr the default-role
Mesa is a C-project, so c:expr is a really handy role to default to.
This means that `foo` is a short-hand for :c:expr:`foo`.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19575>
2022-11-09 12:09:17 +00:00
Konstantin Seurer
35d0d30a0e radv/rra: Fix node type validation
Silly mistake...

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19584>
2022-11-09 09:16:15 +00:00
Caio Oliveira
8ab628ab2e nir: Don't reorder volatile intrinsics
Fixes issue with "is helper invocation" that in recent SPIR-V is mapped to
a volatile Load.  The CSE was catching the loads before they were transformed
in the new is_helper_invocation intrinsic (that is not reorderable).

Fixes: 729df14e45 ("nir: Handle volatile semantics for loading HelperInvocation builtin")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19432>
2022-11-09 06:02:18 +00:00
Chia-I Wu
10b0a5dc34 freedreno/a6xx: set chroma offsets to MIDPOINT
Vulkan has VkChromaLocation and all drivers suggest
VK_CHROMA_LOCATION_MIDPOINT on Android.  The blob also uses MIDPOINT.
Based on my limited tests, the image quality is higher with MIDPOINT.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19514>
2022-11-09 05:15:38 +00:00
Chia-I Wu
cbf68450f8 freedreno/a6xx: set CHROMA_LINEAR
This seems to have no effect on a618, but restores linear filtering on
a635 when the texture is yuv.  The blob sets it on a635 as well (but not
on a618).

Fixed android.media.cts.DecodeAccuracyTest#* on a635.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19514>
2022-11-09 05:15:38 +00:00
Yonggang Luo
d61ac94658 c11: Remove _MTX_INITIALIZER_NP for windows
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18493>
2022-11-09 04:38:28 +00:00
Yonggang Luo
37d79e38e9 egl: Remove the need of _MTX_INITIALIZER_NP by using simple_mtx_t/SIMPLE_MTX_INITIALIZER in egllog.c
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18493>
2022-11-09 04:38:28 +00:00
Yonggang Luo
23e6a4ccda nir: Remove the need of _MTX_INITIALIZER_NP by using simple_mtx_t/SIMPLE_MTX_INITIALIZER in nir/nir_validate.c
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18493>
2022-11-09 04:38:28 +00:00
Yonggang Luo
e518ff4fd5 glsl: Remove the need of _MTX_INITIALIZER_NP by using simple_mtx_t/SIMPLE_MTX_INITIALIZER
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18493>
2022-11-09 04:38:28 +00:00
Yonggang Luo
db708b7e9c llvmpipe: Remove the need of _MTX_INITIALIZER_NP by using simple_mtx_t/SIMPLE_MTX_INITIALIZER in lp_texture.c
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18493>
2022-11-09 04:38:28 +00:00
Yonggang Luo
fb979a19b0 vulkan/device-select-layer: Remove the need of call_once by using simple_mtx_t instead mtx_t
Function device_select_once_init are removed in-favor of SIMPLE_MTX_INITIALIZER

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18493>
2022-11-09 04:38:28 +00:00
Rob Clark
c0fc8d5046 freedreno/a6xx: Switch to global bcolor buffer
Since we expect a limited # of unique border-color entry states, we can
use a global table of border-color entries, rather than constructing the
state at draw time.  This shifts all the border-color overhead from draw
time to sampler state CSO creation time.  And it's less code!

A hashtable is used to map unique border-color table value to entry so
multiple usages of what maps to the same table entry all re-use a single
slot in the table.  This puts an upper bound on the # of unique border-
color plus format value.  In practice this shouldn't be a problem, we'll
just size the table to be large enough to not run into problems with
CTS.  Note that the border-color table entry is not completely format
dependent (mostly just integer vs float dependent), so for example a
single color with different float formats can map to a single table
entry.

This also fixes the problem that we completely ignored border-color for
GS/tess stages.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7518
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19561>
2022-11-09 02:51:17 +00:00
Rob Clark
27b2496bae freedreno/a6xx: Rename tex cache key/equals fxns
We'll need different functions for border-color cache.  Prep for next
patch.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19561>
2022-11-09 02:51:17 +00:00
Rob Clark
c8cf786976 freedreno/a6xx: Move bcolor entry setup
Just code motion, in prep for a following patch.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19561>
2022-11-09 02:51:17 +00:00
Rob Clark
755e3ff0ee freedreno/ci: Update a5xx expectations
These seem to have not been updated in a while.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19561>
2022-11-09 02:51:17 +00:00
Rob Clark
ed9152e2c1 freedreno: Use our border-color quirk
This will let us remove our assumption that samplers and views map 1:1,
and generally simplify our border-color handling.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19561>
2022-11-09 02:51:17 +00:00
David Heidelberg
26e742c661 ci/bare-metal: remove consolidations leftovers
All defined in the baremetal-test-arm*

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19548>
2022-11-09 02:23:37 +00:00
Rob Clark
e090e313fa freedreno/ir3: Reduce compiler thread pool size
With the current scheme, looking at game startup which should be the
worst case (most heavily loaded) time for the compiler threads, and they
seem to be ~10% busy.  Furthermore we typically have a mix of "big" and
"LITTLE" cores.. with about half being "big".  So sizing the thread pool
to the half the # of CPU cores seems reasonable.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19387>
2022-11-08 23:36:51 +00:00
Rob Clark
a6e4f8d03f util/disk_cache: Add some blob cache traces
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19387>
2022-11-08 23:36:51 +00:00
Rob Clark
d831fd40c8 util/disk_cache: Add compression in blob cb path
Android's implementation of the blob-cache get/put funcs do not
implement any compression.  And the default cache size is rather small,
at 2MB (!!) per app (although I assume everyone patches android to
increase the size limit).

We don't bother compressing the has_key/put_key path, since that path is
only storing a uint32_t.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19387>
2022-11-08 23:36:51 +00:00
Simon Ser
2fdc3846e7 vulkan/wsi/wayland: return VK_ERROR_NATIVE_WINDOW_IN_USE_KHR
If the surface is already in use by another swapchain, return
VK_ERROR_NATIVE_WINDOW_IN_USE_KHR. The spec states:

> If pCreateInfo->oldSwapchain is VK_NULL_HANDLE, and the native
> window referred to by pCreateInfo->surface is already associated
> with a Vulkan swapchain, VK_ERROR_NATIVE_WINDOW_IN_USE_KHR must
> be returned.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
References: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7467
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19229>
2022-11-08 22:52:41 +00:00
Eric Engestrom
b4921b5d7a ci: run shaderdb on vc4 as well
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19305>
2022-11-08 21:23:27 +00:00
Eric Engestrom
83b1cb936e vc4: add DRM_VC4_CREATE_SHADER_BO support to drm-shim
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19305>
2022-11-08 21:23:27 +00:00
Yusuf Khan
2c5b1d0e3b nv50/ir: Support fmulz and ffmaz
Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19333>
2022-11-08 21:10:08 +00:00
Yusuf Khan
47251d2852 nv50/ir: add prefer_nir flag for getting compiler options
So that we dont expose certain options for nir_to_tgsi

Signed-off-by: Yusuf Khan <yusiamerican@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19333>
2022-11-08 21:10:08 +00:00
Connor Abbott
def56b531c tu: Support GMEM with layered rendering and multiview
It turns out that this actually is supported. GMEM can hold multiple
layers which are cleared, loaded, and resolved separately. The stride
between layers seems to be implicitly calculated based on the tile size,
and we have to match it when blitting to/from GMEM. One tricky thing is
that now we may realize that we don't have enough space for GMEM only
when computing the tiling config, because we may not know the number of
framebuffer layers until we have the framebuffer and too many
framebuffer layers will exhaust GMEM.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19505>
2022-11-08 16:35:02 +00:00
Samuel Pitoiset
a9ab53fbe2 radv: stop emulating number of generated primitives by GS on GFX11
According to RadeonSI, only GFX10 and GFX10.3 need to emulate.

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/19319>
2022-11-08 16:15:16 +00:00
Lionel Landwerlin
97b3dd34c1 anv: fix missing VkPhysicalDeviceExtendedDynamicState3PropertiesEXT handling
Fixes: 13c422e1b2 ("anv: toggle on EXT_extended_dynamic_state3")
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19573>
2022-11-08 15:28:57 +00:00
Tapani Pälli
2a60037523 crocus: enable NV_alpha_to_coverage_dither_control
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19463>
2022-11-08 11:45:46 +00:00
Tapani Pälli
3c84809ca6 iris: enable NV_alpha_to_coverage_dither_control
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19463>
2022-11-08 11:45:46 +00:00
Samuel Pitoiset
bff6a38ed9 radv: advertise extendedDynamicState3ColorWriteMask
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/19589>
2022-11-08 11:04:54 +00:00
Samuel Pitoiset
a92d1d13c5 radv: add support for dynamic color write mask
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/19589>
2022-11-08 11:04:54 +00:00
Caio Oliveira
22d8ed84b8 intel/compiler: Remove unused fs_visitor::emit_percomp()
Since 7ef7738a61 ("i965: Write gl_FragCoord directly to the destination.") this
is not used.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19586>
2022-11-08 07:33:09 +00:00
Caio Oliveira
90861e6fea intel/compiler: Remove various unused function declarations
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19586>
2022-11-08 07:33:08 +00:00
Caio Oliveira
48506a9029 intel/compiler: Remove unused data members
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19586>
2022-11-08 07:33:08 +00:00
Yonggang Luo
7fe5fec747 util: Remove os/os_thread.h and replace #include "os/os_thread.h" with #include "util/u_thread.h"
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19557>
2022-11-08 05:21:42 +00:00
Yonggang Luo
a72d57fe26 util: cleanup os_thread.h
__pipe_mutex_assert_locked is not used anymore so remove it from os_thread.h
The remove of "pipe/p_compiler.h" caused compiling failure also fixed

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19557>
2022-11-08 05:21:42 +00:00
Yonggang Luo
1129537e4c util: Move pipe_semaphore to u_thread.h and rename it to util_semaphore
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19557>
2022-11-08 05:21:42 +00:00
Yonggang Luo
b732064f9e gallium/util: Remove the EMBEDDED_DEVICE macro because nobody use it
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7641

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19552>
2022-11-08 02:37:20 +00:00
Ian Romanick
9abeb3d739 intel/fs: Optimize integer multiplication of large constants by factoring
Many Intel platforms can only perform 32x16 bit multiplication.  The
straightforward way to implement 32x32 bit multiplications is by
splitting one of the operands into high and low parts called H and L,
repsectively.  The full multiplication can be implemented as:

         ((A * H) << 16) + (A * L)

On Intel platforms, special register accesses can be used to eliminate
the shift operation.  This results in three instructions and a temporary
register for most values.

If H or L is 1, then one (or both) of the multiplications will later be
eliminated.  On some platforms it may be possible to eliminate the
multiplication when H is 256.

If L is zero (note that H cannot be zero), one of the multiplications
will also be eliminated.

Instead of splitting the operand into high and low parts, it may
possible to factor the operand into two 16-bit factors X and Y.  The
original multiplication can be replaced with (A * (X * Y)) = ((A * X) *
Y).  This requires two instructions without a temporary register.

I may have gone a bit overboard with optimizing the factorization
routine.  It was a fun brainteaser, and I couldn't put it down. :) On my
1.3GHz Ice Lake, a standalone test could chug through 1,000,000 randomly
selected values in about 5.7 seconds.  This is about 9x the performance
of the obvious, straightforward implementation that I started with.

v2: Drop an unnecessary return.  Rearrange logic slightly and rename
variables in factor_uint32 to better match the names used in the large
comment.  Both suggested by Caio. Rearrange logic to avoid possibly
using `a` uninitialized. Noticed by Marcin.

v3: Use DIV_ROUND_UP instead of open coding it. Noticed by Caio.

Tiger Lake, Ice Lake, Haswell, and Ivy Bridge had similar results. (Ice Lake shown)
total instructions in shared programs: 19912558 -> 19912526 (<.01%)
instructions in affected programs: 3432 -> 3400 (-0.93%)
helped: 10 / HURT: 0

total cycles in shared programs: 856413218 -> 856412810 (<.01%)
cycles in affected programs: 122032 -> 121624 (-0.33%)
helped: 9 / HURT: 0

No shader-db changes on any other Intel platforms.

Tiger Lake and Ice Lake had similar results. (Ice Lake shown)
Instructions in all programs: 141997227 -> 141996923 (-0.0%)
Instructions helped: 71

Cycles in all programs: 9162524757 -> 9162523886 (-0.0%)
Cycles helped: 63
Cycles hurt: 5

No fossil-db changes on any other Intel platforms.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17718>
2022-11-08 00:02:16 +00:00
Ian Romanick
5ec75ca10d intel/compiler: Teach signed integer range analysis about imax and imin
This is especially helpful for a*isign(a) generated by idiv_by_const
optimization.  On many GPUs, isign(a) is lowered to imax(imin(a, 1),
-1).

There are no changes on fossil-db because ANV uses a different
optimization path for idiv with a constant denominator.  A future MR
will change this.

NOTE: This commit used to help a few hundred shader-db shaders, but
now none are affected.  I suspect this is due to some change in the
idiv_by_const optimization.  This could possibly be dropped.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17718>
2022-11-08 00:02:16 +00:00
Ian Romanick
1b0da3a765 intel/compiler: Signed integer range analysis for imul_32x16 generation
Only iabs and ineg are treated specially.  Everything else just uses
nir_unsigned_upper_bound.  The special treatment of source modifiers is
because they cause problems for nir_unsigned_upper_bound.  Once those
are peeled off, nir_unsigned_upper_bound can generally produce a
tighter bound.

Future commits will add more opcodes.  This mostly introduces the
basic framework.

v2: Add a bunch of comments to signed_integer_range_analysis. Re-arrange
the code a little to reduce duplication.  Both suggested by
Caio. Rearrange some logic to simplify things. Suggested by Marcin.

Tiger Lake, Ice Lake, Haswell, and Ivy Bridge had similar results. (Ice Lake shown)
total instructions in shared programs: 19912894 -> 19912558 (<.01%)
instructions in affected programs: 109275 -> 108939 (-0.31%)
helped: 74 / HURT: 0

total cycles in shared programs: 856422769 -> 856413218 (<.01%)
cycles in affected programs: 15268102 -> 15258551 (-0.06%)
helped: 65 / HURT: 4

total fills in shared programs: 8218 -> 8217 (-0.01%)
fills in affected programs: 1171 -> 1170 (-0.09%)
helped: 1 / HURT: 0

Skylake and Broadwell had similar results. (Skylake shown)
total cycles in shared programs: 845145547 -> 845142263 (<.01%)
cycles in affected programs: 15261465 -> 15258181 (-0.02%)
helped: 65 / HURT: 0

Tiger Lake
Tiger Lake
Instructions in all programs: 157580768 -> 157579730 (-0.0%)
Instructions helped: 312
Instructions hurt: 28

Cycles in all programs: 7566977172 -> 7566967746 (-0.0%)
Cycles helped: 288
Cycles hurt: 53

Spills in all programs: 19701 -> 19700 (-0.0%)
Spills helped: 2
Spills hurt: 4

Fills in all programs: 33311 -> 33335 (+0.1%)
Fills helped: 5
Fills hurt: 4

Ice Lake
Instructions in all programs: 141998667 -> 141997227 (-0.0%)
Instructions helped: 420
Instructions hurt: 3

Cycles in all programs: 9162565297 -> 9162524757 (-0.0%)
Cycles helped: 389
Cycles hurt: 29

Spills in all programs: 19918 -> 19916 (-0.0%)
Spills helped: 2
Spills hurt: 3

Fills in all programs: 32795 -> 32814 (+0.1%)
Fills helped: 6
Fills hurt: 3

Skylake
Instructions in all programs: 132567691 -> 132567745 (+0.0%)
Instructions hurt: 24

Cycles in all programs: 8828897462 -> 8828889517 (-0.0%)
Cycles helped: 405
Cycles hurt: 6

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17718>
2022-11-08 00:02:16 +00:00
Ian Romanick
f90d71055b intel/compiler: Add and use a pass to generate imul_32x16 instructions
Gfx8 and Gfx9 platforms are helped for cycles because now many
instructions like

    mul(8)          g12<1>D         g10<8,8,1>D     6D

become

    mul(8)          g12<1>D         g10<8,8,1>D     6W

It is the same number of instructions, but the 32x16 multiply is a
little faster.

v2: Fix transposed hi and lo in "(hi >= INT16_MIN && lo <= INT16_MAX)".
Noticed by Caio.  Use nir_src_is_const instead of open coding it.
Suggested by Caio.

Broadwell and Skylake had similar results. (Skylake shown)
total cycles in shared programs: 845748380 -> 845145547 (-0.07%)
cycles in affected programs: 446346348 -> 445743515 (-0.14%)
helped: 6017
HURT: 0
helped stats (abs) min: 2 max: 7380 x̄: 100.19 x̃: 8
helped stats (rel) min: <.01% max: 3.72% x̄: 0.41% x̃: 0.39%
95% mean confidence interval for cycles value: -113.37 -87.00
95% mean confidence interval for cycles %-change: -0.42% -0.41%
Cycles are helped.

Skylake
Cycles in all programs: 8844820715 -> 8828897462 (-0.2%)
Cycles helped: 47914
Cycles hurt: 1

No shader-db or fossil-db changes on any other Intel platform.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17718>
2022-11-08 00:02:16 +00:00
Ian Romanick
9479e3a19b intel/fs: Allow constant copy prop from DW to W
This enables copy propagation of

    mov(8)          g5<1>UD         0x00000180UD
    mul(8)          g10<1>D         g2.3<0,1,0>D    g5<16,8,2>W

into

    mul(8)          g10<1>D         g2.3<0,1,0>D    180W

This is necessary for any optimization passes that generate imul_32x16
instructions.

No fossil-db or shader-db changes on any Intel platform.

v2: Fix type size check to (src size != 2) || (dest size != 4).  It was
previously &&. :( This allowed copying constants into UB sources, and
that is invalid.

v3: Fix incorrect extraction of upper 16-bits of immediate value when
subnr=2. Noticed by Caio.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17718>
2022-11-08 00:02:16 +00:00
Ian Romanick
90d267b2d1 intel/fs: Fix bounds checking for integer multiplication lowering
The previous bounds checking would cause

    mul(8)          g121<1>D        g120<8,8,1>D    0xec4dD

to be lowered to

    mul(8)          g121<1>D        g120<8,8,1>D    0xec4dUW
    mul(8)          g41<1>D         g120<8,8,1>D    0x0000UW
    add(8)          g121.1<2>UW     g121.1<16,8,2>UW g41<16,8,2>UW

Instead of picking the bounds (and the new type) based on the old type,
pick the new type based on the value only.

This helps a few fossil-db shaders in Witcher 3 and Geekbench5.  No
changes on any other Intel platforms.

Tiger Lake
Instructions in all programs: 157581069 -> 157580768 (-0.0%)
Instructions helped: 24

Cycles in all programs: 7566979620 -> 7566977172 (-0.0%)
Cycles helped: 22
Cycles hurt: 4

Ice Lake
Instructions in all programs: 141998965 -> 141998667 (-0.0%)
Instructions helped: 26

Cycles in all programs: 9162568666 -> 9162565297 (-0.0%)
Cycles helped: 24
Cycles hurt: 2

Skylake
No changes.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17718>
2022-11-08 00:02:16 +00:00
Ian Romanick
db20412168 intel/fs: Fix constant propagation into 32x16 integer multiplication
Don't copy propagate the constant in situations like

    mov(8)          g8<1>D          0x7fffffffD
    mul(8)          g16<1>D         g8<8,8,1>D      g15<16,8,2>W

On platforms that only have a 32x16 multiplier, this will result in
lowering the multiply to

    mul(8)          g15<1>D         g14<8,8,1>D     0xffffUW
    mul(8)          g16<1>D         g14<8,8,1>D     0x7fffUW
    add(8)          g15.1<2>UW      g15.1<16,8,2>UW g16<16,8,2>UW

On Gfx8 and Gfx9, which have the full 32x32 multiplier, it results in

    mul(8)          g16<1>D         g15<16,8,2>W    0x7fffffffD

Volume 2a of the Skylake PRM says:

    When multiplying a DW and any lower precision integer, the
    DW operand must on src0.

See also https://gitlab.freedesktop.org/mesa/crucible/-/merge_requests/104.

Previous to INTEL_shader_integer_functions2 (in Vulkan or OpenGL), I
don't think it would be possible to create a situation where this could
occur.  I discovered this via some optimizations that can determine that
the non-constant source must be able to fit in 16-bits.  The case listed
above came from piglit's "ext_transform_feedback-order arrays points"
with those optimizations in place.

No shader-db or fossil-db changes on any Intel platform.

Fixes: de6c0f8487 ("intel/fs: Implement support for NIR opcodes for INTEL_shader_integer_functions2")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17718>
2022-11-08 00:02:16 +00:00
Charmaine Lee
3194fe9362 wgl: fix reference to wgl(Create|Delete)Context function pointers
Currently in wglCreateContextAttribsARB(), we get and save the
pointers to OPENGL32.DLL's wglCreate/DeleteContext() functions.
But these function pointers might be invalid after opengl32.dll is
unloaded and reloaded again and possibly in a different address space.
This patch, provided by Jose Fonseca, uses GetModuleHandle and gets
the proc address of wglCreate/DeleteContext functions every time the
function is called.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19478>
2022-11-07 23:48:30 +00:00
Gert Wollny
4f599dc3a5 r600: Fix some border color swizzles on Evergreen
Note: (u)int32 is broken on this hardware.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19532>
2022-11-07 22:37:06 +00:00
Gert Wollny
923d635357 r600: fix some border color swizzles on CAYMAN
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19532>
2022-11-07 22:37:06 +00:00
Dylan Baker
196499d75e docs: update calendar and link releases notes for 22.2.3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19585>
2022-11-07 10:28:11 -08:00
Dylan Baker
616635909e docs: Add sha256 sum for 22.2.3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19585>
2022-11-07 10:28:07 -08:00
Dylan Baker
2fe1aab18f docs: add release notes for 22.2.3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19585>
2022-11-07 10:28:06 -08:00
Mauro Rossi
fd8ec189e5 Android.mk: Fix gnu++14 related build failures
This patch filters-out '-std=gnu++14' from the cflags obtained
from AOSP/KATI dummy target output to avoid the following building errors:

FAILED: src/gallium/drivers/r600/45f68e3@@r600@sta/sfn_sfn_assembler.cpp.o
...
clang++ ... -std=c++17 ... -std=gnu++14
...
In file included from ../src/gallium/drivers/r600/sfn/sfn_assembler.cpp:27:
In file included from ../src/gallium/drivers/r600/sfn/sfn_assembler.h:32:
In file included from ../src/gallium/drivers/r600/sfn/sfn_shader.h:31:
../src/gallium/drivers/r600/sfn/sfn_instr.h:369:56: error: no template named 'is_base_of_v' in namespace 'std'; did you mean 'is_base_of'?
template <typename T, typename = std::enable_if_t<std::is_base_of_v<Instr, T>>>
                                                  ~~~~~^~~~~~~~~~~~
                                                       is_base_of
/home/utente/pie-x86_kernel/external/libcxx/include/type_traits:1412:29: note: 'is_base_of' declared here
struct _LIBCPP_TEMPLATE_VIS is_base_of
                            ^
In file included from ../src/gallium/drivers/r600/sfn/sfn_assembler.cpp:27:
In file included from ../src/gallium/drivers/r600/sfn/sfn_assembler.h:32:
In file included from ../src/gallium/drivers/r600/sfn/sfn_shader.h:31:
../src/gallium/drivers/r600/sfn/sfn_instr.h:369:51: error: template argument for non-type template parameter must be an expression
template <typename T, typename = std::enable_if_t<std::is_base_of_v<Instr, T>>>
                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/utente/pie-x86_kernel/external/libcxx/include/type_traits:439:16: note: template parameter is declared here
template <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp, _Tp>::type;
               ^
2 errors generated.

Cc: "22.2" "22.3" mesa-stable
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19563>
2022-11-07 17:46:42 +00:00
José Roberto de Souza
41ee836c9a intel: Add and use intel_gem_can_render_on_fd()
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19425>
2022-11-07 17:22:14 +00:00
José Roberto de Souza
29550bc50a intel: Add has_context_isolation to intel_device_info
Iris, hasvk and anv were fetching the same information, better do it
on one place.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19425>
2022-11-07 17:22:14 +00:00
José Roberto de Souza
d5d1331381 intel: Add has_userptr_probe to intel_device_info
Iris, hasvk and anv were fetching the same information, better do it
on one place.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19425>
2022-11-07 17:22:14 +00:00
José Roberto de Souza
e9eceb1106 intel: Add has_mmap_offset to intel_device_info
All 4 drivers were fetching the same information, better do it on one
place.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19425>
2022-11-07 17:22:14 +00:00
José Roberto de Souza
dfd20f002f intel: Add and use intel_gem_get_param()
Again sharing the same function across all Intel drivers.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19425>
2022-11-07 17:22:14 +00:00
Alyssa Rosenzweig
c076aeb865 docs/asahi: Document drm-shim
Explain how to build drm-shim and how to use it for shader-db.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19540>
2022-11-07 16:10:11 +00:00
Alyssa Rosenzweig
350be81aa3 asahi: Add drm-shim implementation
Forked off from v3d's. This gets us a render node which is good enough for
shader-db.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19540>
2022-11-07 16:10:11 +00:00
Martin Roukala (né Peres)
af868fcaad radv/ci: add another test to the navi21 flakes list
Add dEQP-VK.memory.pipeline_barrier.host_read_host_write.1048576 to
the list of flakes of navi21. Found after 80 runs.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19569>
2022-11-07 15:31:13 +00:00
Samuel Pitoiset
505290dc44 ac/nir,radv: rework and fix NGG queries enables for VS/TES
XFB queries need to be enabled with NGG streamout and VS/TES.
Previously, the NGG lowering code relied on has_prim_query for XFB.

This fixes failures with RADV_PERFTEST=ngg_streamout on GFX10.3 with
the vkd3d-proton testsuite. Vulkan CTS is missing TES tests with XFB
queries apparently.

Cc: 22.3 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/19493>
2022-11-07 14:54:53 +00:00
Samuel Pitoiset
e4de5580bd radv: move computing the binning state to the cmdbuf
With dynamic color write mask and rasterization samples, the binning
state will have to be re-computed dynamically. This shouldn't hurt
anything right now because it's only done at pipeline bind time.

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/19164>
2022-11-07 14:22:02 +00:00
Samuel Pitoiset
a5151dc46a radv: always set FLUSH_ON_BINNING_TRANSITION
The hardware can detect binning transitions apparently, so it can be
hardcoded. This matches RadeonSI and PAL.

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/19164>
2022-11-07 14:22:02 +00:00
Samuel Pitoiset
5e9d7a1640 radv: cleanup setting disabled binning state for GFX9
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/19164>
2022-11-07 14:22:02 +00:00
Samuel Pitoiset
04b557da39 radv: remove unused blend parameter to radv_pipeline_init_binning_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/19164>
2022-11-07 14:22:02 +00:00
Samuel Pitoiset
33d60bda9d radv: re-emit the guardband state when restoring meta operations
Meta operations change dynamic states like viewports and previously,
the guardband state was also always re-emitted because it relied on
dynamic viewport/scissor changes.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7577
Fixes: 40d8df7280 ("radv: emit the guardband state separately from the scissor 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/19521>
2022-11-07 13:42:51 +00:00
Marek Vasut
20984aab0f etnaviv: Use old set of state registers for PE configuration on GC880
While the GC880 is HALTI0, it still uses the old set of state registers
for PE pipe configuration. This is another specialty of the GC880, readd
the missing handling for this GPU otherwise e.g. Qt5 cube example suffers
from rendering corruption with both eglfs and wayland backends.

Fixes: 7c46a48836 ("etnaviv: use new PE pipe address states on >= HALTI0")
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Marek Vasut <marex@denx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19562>
2022-11-07 13:32:20 +00:00
Jason Ekstrand
402a9a36f0 anv: Rip out shadow surfaces
These are only used for storage-compatible compressed surfaces on
Broadwell and earlier and Stencil on Gfx7 where there isn't proper
stencil sampling support.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18402>
2022-11-07 12:07:11 +00:00
Samuel Pitoiset
0bf06400be radv: consider allocated command buffers in the initial state.
The Vulkan spec says:
    "When a command buffer is allocated, it is in the initial state.
     Some commands are able to reset a command buffer (or a set of
     command buffers) back to this state from any of the executable,
     recording or invalid state. Command buffers in the initial state
     can only be moved to the recording state, or freed."

Because the status wasn't initialized, it was implicitly set to
RADV_CMD_BUFFER_STATUS_INVALID and that triggered a reset for newly
allocated command buffers.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@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/19506>
2022-11-07 12:02:36 +01:00
Erik Faye-Lund
9b55f1c12b docs: upgrade some links to https
We're in 2022 now, and HTTPS is available in a lot more places in the
past. Let's upgrade some links, to protect the privacy of our readers.

The links that are left either don't support HTTPS, or are simply dead
and needs to be updated anyway. That's besides the scope of this
merge-request, so I'm leaving that for someone else.

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19492>
2022-11-07 10:58:12 +00:00
Erik Faye-Lund
e5f9a9998d docs: use anonymous links when possible
Anonymous links has some benefits in that it reduces the chance of
warnings when similar identifiers are used. So let's use them instead
when we can.

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19492>
2022-11-07 10:58:12 +00:00
Erik Faye-Lund
6b3b633391 docs/zink: fix and cleanup rst syntax
This new section didn't use the correct RST syntax, and ended up
with a broken section in the rendered docs.

Fix the syntax, and clean things up a bit to avoid overly long lines.

Fixes: be235edfe2 ("zink: add profile documentation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19481>
2022-11-07 10:52:35 +00:00
Martin Roukala (né Peres)
296ebb09fc zink/ci: document a new fail after a piglit uprev to radv expectations
Add spec@egl 1.4@egl-ext_egl_image_storage,Fail to the list of RADV
expectations.

Fixes: 70ce1dcacc ("ci: Update piglit with s3 support")
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19555>
2022-11-07 10:30:05 +00:00
Martin Roukala (né Peres)
c1c7adbcbd radv/ci: use wildcards for the query_pool.statistics_query flakes on VG
I got yet another new failure in VanGogh, and rather than playing the
game of wack a mole, let's be a little less picky and just use these
wildcards:

 - dEQP-VK.query_pool.statistics_query.geometry_shader_primitives.*
 - dEQP-VK.query_pool.statistics_query.host_query_reset.geometry_shader_primitives.*

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19541>
2022-11-07 10:01:52 +00:00
Francisco Jerez
5d4df3ac23 intel/compiler: Run extra fp64 lowering pass on devices that don't support int64.
In some cases nir_lower_int64 will emit fp64 operations which aren't
natively supported on any Intel hardware (e.g. ftrunc, frem).  An
extra pass of nir_opt_algebraic (for frem) and nir_lower_doubles is
required in order to take care of them.  This fixes several int64
test-cases on MTL hardware.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mykhailo Skorokhodov <mykhailo.skorokhodov@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19390>
2022-11-07 07:35:22 +00:00
Francisco Jerez
e14f85366e nir/lower_int64: Fix float16 to int64 conversions.
Currently float16 to int64 conversions don't work correctly, because
the "div" variable has an infinite value, since 2^32 isn't
representable as a 16-bit float, which causes the result of of rem(x,
div) to be NaN for all inputs, leading to an incorrect result.  Since
no values of magnitude greater than 2^32 are representable as a
float16 we don't actually need to do the fdiv/frem operations, the
conversion is equivalent to f2u32 with the result padded to 64 bits.

Rework:
 * Jordan: Handle f16 in if/else rather than conditional

Fixes: 936c58c8fc ("nir: Extend nir_lower_int64() to support i2f/f2i lowering")
Reviewed-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/19391>
2022-11-07 06:18:08 +00:00
Tomeu Vizoso
ec9b9ff971 ci: Disable automatic jobs on Chromebooks with Comet Lake
During the weekend they started to show network problems so often that
they are unable to take on jobs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19566>
2022-11-07 06:50:16 +01:00
Marek Olšák
8b66c0ac76 amd: add cosmetic gfx10 and gfx11 changes
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19477>
2022-11-06 18:16:48 -05:00
Marek Olšák
9cc58f0f49 ac/surface/tests: add more gfx103 and gfx11 tests
This might start timing out in the CI.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19477>
2022-11-06 18:16:48 -05:00
Marek Olšák
24e8a6f17c ac/llvm: don't use the mbcnt workaround for LLVM 16 and set range metadata
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19477>
2022-11-06 18:16:48 -05:00
Marek Olšák
f78dad5e33 radeonsi: allow int16 with FP16 since it no longer hangs
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19477>
2022-11-06 18:16:48 -05:00
Marek Olšák
8737d34add radeonsi: remove clamping shader code from in-bounds blits
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19477>
2022-11-06 18:16:45 -05:00
Marek Olšák
11993185a2 radeonsi: don't load/resolve/store non-existent src/dst channels in blit shaders
RGBX only loads and resolves 3 components, etc.

v2: buf fixes to make AMD_TEST=computeblit pass

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> (v1)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19477>
2022-11-06 18:15:25 -05:00
Marek Olšák
8956682810 amd: rename enums ARCTURUS -> MI100, ALDEBARAN -> MI200
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19477>
2022-11-06 17:20:39 -05:00
Marek Olšák
bdfacd0a24 radeonsi/gfx11: fix compute scratch buffer - WAVES is always per SE
Fixes: ba02ed91a6 - ac/gfx11: fix the scratch buffer

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19477>
2022-11-06 17:10:35 -05:00
Marek Olšák
803802c29f radeonsi/ci: update CI results
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19477>
2022-11-06 17:10:33 -05:00
Marek Olšák
bf5c1773c0 radeonsi: fix the compute wave size - it was always Wave32
si_determine_wave_size always returned 32 because shader->info was
uninitialized. Do it after it's initialized.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19477>
2022-11-06 17:10:18 -05:00
Konstantin Seurer
c37357f4e0 radv/rra: Remove some node type validation
Node types can only be invalid for certain acceleration structure types.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19544>
2022-11-06 17:03:52 +00:00
Konstantin Seurer
868107e16c radv/rra: Improve validation message formatting
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19544>
2022-11-06 17:03:52 +00:00
Konstantin Seurer
07bf85c2ec radv/rra: Rename rra_accel_struct_validation_fail
...to rra_validation_fail since it is used quite often.
Shortening the name should improve readability.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19544>
2022-11-06 17:03:52 +00:00
Konstantin Seurer
e5b3efe582 radv/rt: Restore prev barycentrics when rejecting hits
Closes: #6348
cc: mesa-stable

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19534>
2022-11-06 11:36:10 +00:00
Yonggang Luo
7753e80219 util: Add multi-threaded test for util/u_debug.h and util/perf/u_trace.h
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18764>
2022-11-05 20:40:55 +00:00
Yonggang Luo
2c1c87f76f util: Fixes memory leak in __getProgramName
This is happened when multi-threading access to util_get_process_name

memory leak point:
Direct leak of 4097 byte(s) in 1 object(s) allocated from:
    #0 0x7f42888c0e8f in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0x7f4288859d18 in __interceptor_realpath ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:3608
    #2 0x55a9c272e03d in __getProgramName ../src/util/u_process.c:75
    #3 0x55a9c272e03d in util_get_process_name ../src/util/u_process.c:197
    #4 0x55a9c2746da7 in util_queue_init ../src/util/u_queue.c:416
    #5 0x55a9c272c233 in queue_init ../src/util/perf/u_trace.c:403
    #6 0x55a9c272c233 in u_trace_context_init ../src/util/perf/u_trace.c:453
    #7 0x55a9c262eb54 in test_thread ../src/util/tests/perf/u_trace_test.cpp:14
    #8 0x55a9c275228b in impl_thrd_routine ../src/c11/impl/threads_posix.c:67

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18764>
2022-11-05 20:40:55 +00:00
Yonggang Luo
171c3c551a util: Fixes debug_get_option_* thread safety by set initialized=true after the value get
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18764>
2022-11-05 20:40:55 +00:00
Yonggang Luo
e2c3739a3f util: It's not thread safe to set initialized=true before get the real GALLIUM_PRINT_OPTIONS
Even though initialized = true can make sure have no recursion, but that's may leading to
debug_get_option_should_print return false at the second thread, but the first thread
return true. These two threads should return the same value, even though this function is for
debug only, but it's better to getting it to be correct.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18764>
2022-11-05 20:40:55 +00:00
Bas Nieuwenhuizen
9a8453d07e radv: Use compares for node type in traversal.
The HW has no bit test instruction, so we change 3 pairs of and+cmp
to a single and + 3 cmps, saving 2 VALU instructions.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19454>
2022-11-05 16:38:48 +00:00
Yusuf Khan
4770d3f0ba r600: enable memory objects
Support was there but the cap was not enabled

Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Acked-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19406>
2022-11-05 16:09:43 +00:00
David Heidelberg
39b9067b71 nine: enable on freedreno
nine-tests on Adreno 630:
 ~ 10000 passing
 ~ 85 failures

Acked-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19244>
2022-11-05 14:35:41 +00:00
David Heidelberg
cc485cfd7c ci/broadcom: juint is already defined in .piglit-traces-test
Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18532>
2022-11-05 14:04:44 +00:00
Alex Brachet
c987a727a7 nir: Fix qsort comparator function
`pred` is a pointer, for sufficiently large numbers these
being cast to int were both > 0 regardless of the order
of `data1` and `data2`.

Fixes: 523a28d3fe ("nir: add an instruction set API")

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19539>
2022-11-05 00:09:00 +00:00
António Monteiro
d31375b521 math: remove unused matrix_print & print_matrix_floats
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19428>
2022-11-04 23:20:02 +00:00
António Monteiro
c49aca943c math: remove vector class
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19428>
2022-11-04 23:20:02 +00:00
António Monteiro
2d4d4df57a math: remove unused debug classes
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19428>
2022-11-04 23:20:02 +00:00
António Monteiro
94e10ced83 math: remove unused matrix_is_general_scale
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19428>
2022-11-04 23:20:02 +00:00
António Monteiro
18702a28bd math: remove unused matrix_has_rotation
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19428>
2022-11-04 23:20:02 +00:00
António Monteiro
55373642db util: remove unused enter debug exit loggers
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19428>
2022-11-04 23:20:02 +00:00
António Monteiro
c7b70ca61a util: remove fifo class
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19428>
2022-11-04 23:20:02 +00:00
António Monteiro
0c0812cf6e util: remove unused debug_dump_enum_noprefix
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19428>
2022-11-04 23:20:02 +00:00
António Monteiro
dc0de85fed util: remove unused debug_print_blob
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19428>
2022-11-04 23:20:02 +00:00
António Monteiro
c43c640809 util: remove unused set_random_entry
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19428>
2022-11-04 23:20:02 +00:00
António Monteiro
0b6c0bfa09 util: remove unused half_to_unorm8
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19428>
2022-11-04 23:20:02 +00:00
António Monteiro
e25fdc701b gallium/util: remove unused macros and their functions from sse class
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19428>
2022-11-04 23:20:02 +00:00
António Monteiro
753b31c35e gallium/util: drop unused sampler_view_default_dx9_template
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19428>
2022-11-04 23:20:02 +00:00
António Monteiro
7995050462 gallium/util: drop unused rect_area
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19428>
2022-11-04 23:20:02 +00:00
António Monteiro
4abb08ac60 gallium/util: Drop unused translate_prim_restart_ib
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19428>
2022-11-04 23:20:02 +00:00
António Monteiro
2c25d2ea90 gallium/util: Remove linear class
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19428>
2022-11-04 23:20:02 +00:00
António Monteiro
469251c898 gallium/util: Remove dirty surfaces class
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19428>
2022-11-04 23:20:02 +00:00
António Monteiro
3b98e2a556 gallium/util: Remove dirty flags class
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19428>
2022-11-04 23:20:02 +00:00
António Monteiro
707d5b5b02 math: drop invert_matrix_perpective
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19428>
2022-11-04 23:20:02 +00:00
Samuel Pitoiset
06adf6ad11 radv: invalidate L2 instead of only writeback L2 when using DCC stores
It seems INV_L2 is the right thing to do, especially for RDNA2 chips
with non-coherent RBs (NAVI22 is one of these). This fixes DCC
corruption.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6476
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7507
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/19516>
2022-11-04 22:40:11 +00:00
Samuel Pitoiset
26c8fedc1b radv: make the GDS/GDS OA buffer objects resident
GDS is used for NGG queries/streamout (GFX10+ only) and the BOs were
only added to the graphics queue because compute doesn't need them.
Though, the kernel emits a GDS switch when a queue submission doesn't
use GDS. That means that submitting jobs on the compute queue without
GDS can reset the state of the graphics queue and lead to GPU hangs.

The only viable solution for now is to make the GDS BOs resident to
avoid resetting the state between queues. This shouldn't introduce
more syncs between queues because GDS BOs are similar for both.

This fixes a GPU hang with Warhammer Chaosbane during loading time and
possibly some spurious random GPU hangs. Note that this GPU hang was
workarounded on the Steam side with RADV_DEBUG=nongg.

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/19466>
2022-11-04 21:52:35 +00:00
Yonggang Luo
cdc1abad7b util: include gles header instead of hand crafted macros
Now the glapi/glapi_dispatch.c are cleaned up because of this

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
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/19509>
2022-11-04 19:28:19 +00:00
Eric Engestrom
02d61c1b31 docs/amber: fix link to docs on amber branch
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19533>
2022-11-04 19:22:45 +00:00
Sathishkumar S
f1ea0bc18a gallium/vl: return the buffer plane order for yuv444p format
plane order is expected when trying to render yuv surfaces, update it for yuv444p

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19445>
2022-11-04 18:35:13 +00:00
Sathishkumar S
61c487719d radeonsi/vcn: enable yuv formats supported on jpeg 2.5.0 and 2.6.0
decode of yuv444 yuv400 and yuv422 is supported on JPEG ip version 2.5.0 and 2.6.0.

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19445>
2022-11-04 18:35:13 +00:00
Sathishkumar S
581220aa54 radeonsi/vcn: enable yuv422 jpeg decode
add yuv422 to supported decode format on asics that support it.

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19445>
2022-11-04 18:35:13 +00:00
Boris Brezillon
1c567ae3a2 dzn: Hook-up format-casting
This was only partially supported, with not way to cross D3D12
old compatibility boundary. With the RelaxedFormatCastingSupported
feature, we can cast any format to any other format with the same
block size, which maps pretty well to how Vulkan see things.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17339>
2022-11-04 17:39:46 +00:00
Boris Brezillon
bda14ae998 dzn: Try to get a ID3D12Device10 object
Will be needed to support format casting.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17339>
2022-11-04 17:39:46 +00:00
Boris Brezillon
457e9deee1 vulkan: Provide a vk_image_create_get_format_list() helper
Some drivers need to know the full list of formats that can be used
when VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT or
VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT is set (dozen needs
that at least). While VkImageFormatListCreateInfo is a nice way to
get the actual of formats the user intends to use at view creation time,
this paramter is optional, and when it's missing, we need to know the
full list of compatible formats if we want things to work properly.

Provide a helper that hides all the complexity and return a format list
even when VkImageFormatListCreateInfo is missing.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17339>
2022-11-04 17:39:46 +00:00
Boris Brezillon
d65f439661 vulkan: Automatically generate helpers to retrieve format information
In Vulkan, formats are classified in compatible groups, allowing
formats to be cast to other formats in the same group. Some drivers
might need to have access to the full compatible format list, so let's
auto-generate helpers to allow that.

Acked-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17339>
2022-11-04 17:39:46 +00:00
Boris Brezillon
bbc4b4f59a dzn: Query D3D12_FEATURE_DATA_D3D12_OPTIONS12
Needed to detect whether relaxed format casting is supported or not.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17339>
2022-11-04 17:39:46 +00:00
Erik Faye-Lund
40bd7b4307 docs: use code-block
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19494>
2022-11-04 16:38:06 +00:00
Erik Faye-Lund
ebf33212ed docs: eg -> e.g.
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19494>
2022-11-04 16:38:06 +00:00
Erik Faye-Lund
e082cff56b docs/gallium: glsl -> GLSL
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19494>
2022-11-04 16:38:06 +00:00
Erik Faye-Lund
45b4f82091 docs/gallium: fixup broken markup
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19494>
2022-11-04 16:38:06 +00:00
Erik Faye-Lund
1d947e8f7f docs: remove spurious backtick
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19494>
2022-11-04 16:38:06 +00:00
Erik Faye-Lund
8458451180 docs: fix a couple of links
This was broken RST syntax, and lead to a couple of rogue cite-tags in
the rendered HTML.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19494>
2022-11-04 16:38:06 +00:00
Erik Faye-Lund
5525d0b196 docs: use inline-code instead of default role
A single backtick escaped string in Sphinx refers to the "default role"
which is vague, and in practice ends up producing the HTML cite-element.
That's almost certainly not what these uses wanted.

A bunch of these would probably be better served using appropriate roles
instead of inline-code markup, but this is almost certainly what was
meant here instead. Let's not let perfect be the enemy of good here, and
just do what was intended. Using the right roles everywhere is a big
task.

I usually don't do changes like these to the relnotes, but in this case
there were a *single* article that had these mistakes. I assume that was
an early bug in the script that generateg the relnotes. Let's patch it,
so we don't get misrendering if we change the default-role.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19494>
2022-11-04 16:38:06 +00:00
Erik Faye-Lund
779b4639b7 docs: consistently use single-quotes in config
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19494>
2022-11-04 16:38:06 +00:00
Tomeu Vizoso
7c5c181694 ci: Uprev kernel to 6.0
And also enable some kconfigs needed by existing Qualcomm-based
Chromebooks and also a new model: kingoftown.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19069>
2022-11-04 14:51:24 +00:00
Eric Engestrom
ef5f9c99e0 VERSION: fix version as it will be a new year
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19529>
2022-11-04 14:30:55 +00:00
David Heidelberg
e9b81c663d Revert "ci: Collabora farm maintanance"
Farm is up again.

This reverts commit e0c577d5227fa6aaa061b3f388711fb24d6fc146.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19515>
2022-11-04 12:22:17 +00:00
Benjamin Tissoires
67cee534a8 CI: convert to use the new S3 server instead of the legacy minio
We don't need to login anymore, but we can't use plain minio commands
now. `ci-fairy` got a helper as `s3cp` to keep an almost identical
API.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19076>
2022-11-04 11:41:42 +00:00
Guilherme Gallo
a04ed2f971 ci: Update ci-fairy in CI, rootfs and containers
ci-fairy is pulverized in possible different versions at Mesa CI.
This commit updates all of them to the version that migrates minio to
s3.
Also, trigger the build of base and test containers, as both uses
ci-fairy as well

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19076>
2022-11-04 11:41:42 +00:00
Guilherme Gallo
a108e4f70c ci: Update piglit-traces tests expectations
Found some:
- crashes in zink, softpipe
- fails in a630-restricted
- unexpectedpass in broadcom
    - fixed by https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/730

More details in the test expectations files comments.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19076>
2022-11-04 11:41:42 +00:00
Guilherme Gallo
70ce1dcacc ci: Update piglit with s3 support
With new S3 support, we can use JWT-only server interaction via the
removal of `role-session` and `minio-host` arguments from PIGLIT_ARGS in
YAML.
This parameter change will come in a later commit.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19076>
2022-11-04 11:41:42 +00:00
Benjamin Tissoires
96e251aa86 ci: re-enable scheduled pipelines for git cache
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19076>
2022-11-04 11:41:42 +00:00
Martin Roukala (né Peres)
d7ad9e7014 zink/ci: add another subtest to the list of known failures for radv
This test as a whole does not seem to work anywhere, even lavapipe, but
one particular subtest was passing until a recent change
(!19438 - zink: polygon mode fixes?).

After consideration by @kusma, it appears that the subtest was passing
by accident due to zink generating the wrong values. Given that this is
not something that users would ever experience as a regression, we
simply document this new failure along with all the others for this
test.

Fixes: 53721827ea ("zink: correct depth-bias enable condition")
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19517>
2022-11-04 11:23:16 +00:00
Iago Toral Quiroga
c7150ad8e6 broadcom/compiler: drop unused v3d_compile parameter for nir pass
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19519>
2022-11-04 09:58:10 +00:00
Iago Toral Quiroga
22789d34be v3dv: use vk_alloc instead of malloc
Fixes: e6884df088 ('v3dv: fix event synchronization')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19518>
2022-11-04 09:22:05 +00:00
Iago Toral Quiroga
36ef75b6eb v3dv: vkCmdWaitEvents2 takes an array of VkDependencyInfo
We have been incorrectly assuming there was just one for all the
events, apparently CTS never uses more than one event.

Fixes: e6884df088 ('v3dv: fix event synchronization')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19518>
2022-11-04 09:22:05 +00:00
Martin Roukala (né Peres)
dc08875415 zink/ci: mark another test as fixed after the frontend caching series
Just like on Lavapipe, Emma Anholt's !19124 also fixed the
restore-sso-program test on RADV.

Fixes: 4e14da056d ("zink: Enable mesa/st frontend shader caching.")
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19468>
2022-11-04 07:18:35 +00:00
Samuel Pitoiset
224f774e61 ci: uprev vkd3d-proton to v2.7
For up-to-date vkd3d-proton testsuite.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19499>
2022-11-04 06:52:17 +00:00
Samuel Pitoiset
e891e84f4b radv: fix setting MIN_LOD for texture descriptors on GFX11
Found by inspection because the MIN_LOD bits were moved.

Cc: 22.3 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/19496>
2022-11-04 06:43:04 +00:00
David Heidelberg
617e48ecda ci: Collabora farm maintanance
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19511>
2022-11-04 05:09:32 +00:00
Jesse Natalie
798aa43b6b microsoft/spirv2dxil: Lower sample pos for fragment shaders
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19471>
2022-11-04 01:40:17 +00:00
Jesse Natalie
1399f37a3b d3d12: Move lower_sample_pos to microsoft/compiler
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19471>
2022-11-04 01:40:17 +00:00
Marek Olšák
ca29d9a67c ac: fix IB parsing for Stoney
We need to pass the family to register parsing functions.

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/19419>
2022-11-04 00:42:08 +00:00
Marek Olšák
a54c8cdaf2 ac/gpu_info: simplify how has_accelerated_dot_product is set
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/19419>
2022-11-04 00:42:08 +00:00
Marek Olšák
a338a2da58 amd/registers: regenerate gfx11 headers from amd-staging-drm-next
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/19419>
2022-11-04 00:42:08 +00:00
Marek Olšák
b361ecc0da amd/registers: describe allowed register ranges better
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/19419>
2022-11-04 00:42:08 +00:00
Marek Olšák
ff4cd2133d amd/registers: fix parse_kernel_headers.py warnings by adding missing enums
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/19419>
2022-11-04 00:42:07 +00:00
Marek Olšák
c4104482c8 ac/llvm: remove unnecessary gfx11 condition for nir_intrinsic_store_buffer_amd
ac_build_buffer_store_dword is responsible for this.

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/19419>
2022-11-04 00:42:07 +00:00
Jesse Natalie
d79da61ffa dzn: Set Agility SDK parameters and update test expectations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19178>
2022-11-03 23:54:45 +00:00
Jesse Natalie
a954ed2a70 d3d12: Set Agility SDK parameters and update test expectations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19178>
2022-11-03 23:54:45 +00:00
Jesse Natalie
e4025c4712 ci/windows: Bump test image tag
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19178>
2022-11-03 23:54:45 +00:00
Jesse Natalie
3cd2b8d0c9 ci/windows: Enable developer mode for test container
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19178>
2022-11-03 23:54:45 +00:00
Jesse Natalie
9426425bf0 ci/windows: Get DXIL.dll (and DXCompiler.dll) from GitHub and put it in System32
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19178>
2022-11-03 23:54:45 +00:00
Jesse Natalie
c0db462fdd ci/windows: Download updated WARP and copy to piglit/vk-gl-cts
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19178>
2022-11-03 23:54:45 +00:00
Jesse Natalie
2c17e446fb ci/windows: Download DirectX Agility SDK and copy to piglit/vk-gl-cts
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19178>
2022-11-03 23:54:45 +00:00
Jesse Natalie
70039dcad6 microsoft/compiler: Fix feature flag handling for 64-bit bitcasts
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19178>
2022-11-03 23:54:45 +00:00
Mauro Rossi
814b822fe0 hasvk: fix android build and reported API version
anv_device.c for vulkan.intel_hasvk requires changes to be compiled
and behave correctly for android target

Fixes the following building error:

FAILED: src/intel/vulkan_hasvk/libanv_hasvk_common.a.p/anv_device.c.o
...
../src/intel/vulkan_hasvk/anv_device.c:143:19: error: use of undeclared identifier 'ANV_API_VERSION_1_3'
   *pApiVersion = ANV_API_VERSION_1_3;
                  ^
../src/intel/vulkan_hasvk/anv_device.c:1822:44: error: use of undeclared identifier 'ANV_API_VERSION_1_3'
      .apiVersion = pdevice->use_softpin ? ANV_API_VERSION_1_3 : ANV_API_VERSION_1_2,
                                           ^
../src/intel/vulkan_hasvk/anv_device.c:1822:66: error: use of undeclared identifier 'ANV_API_VERSION_1_2'
      .apiVersion = pdevice->use_softpin ? ANV_API_VERSION_1_3 : ANV_API_VERSION_1_2,
                                                                 ^
3 errors generated.

Cc: "22.3" mesa-stable
Fixes: 00eefdc ("hasvk: stop advertising Vk 1.3 on non-softpin")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19452>
2022-11-03 23:33:14 +00:00
Friedrich Vock
95ed033066 radv: Use spirv1.5 instead of vulkan1.2
Ubuntu 20.04 ships a glslangValidator that doesn't know about vulkan1.2 yet.

Fixes: 27186537 ("radv: Add PLOC shader")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19479>
2022-11-03 22:58:47 +00:00
Connor Abbott
08f0d96b72 tu: VK_EXT_extended_dynamic_state3 is finished
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
85d0205db1 tu: Implement extendedDynamicState3ColorWriteMask
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
6f759c74a2 tu: Implement extendedDynamicState3ColorBlendEquation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
536ff11238 tu: Make tu_pipeline::dynamic_state_mask 64-bit
We're running out.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
aab81d660a freedreno: Make BIT() 64-bit
In turnip we were using this a lot with the dynamic state enum, and
we're running out of space there because we're needing to add more and
more dynamic states that don't correspond to draw states. Make it
64-bit-safe so we don't need to rewrite everything in turnip. In the
case where the thing being operated on is 32-bit the compiler can
usually optimize it away, as can be seen with the release build size
before and after:

before:
   text    data     bss     dec     hex filename
5404913  293592   22744 5721249  574ca1 /home/cwabbott/build/mesa-release/lib64/libvulkan_freedreno.so
   text    data     bss     dec     hex filename
13981320         498550  205000 14684870         e012c6 /home/cwabbott/build/mesa-release/lib64/dri/msm_dri.so

after:
   text    data     bss     dec     hex filename
5404969  293592   22744 5721305  574cd9 /home/cwabbott/build/mesa-release/lib64/libvulkan_freedreno.so
   text    data     bss     dec     hex filename
13981320         498550  205000 14684870         e012c6 /home/cwabbott/build/mesa-release/lib64/dri/msm_dri.so

In the end the only changes is an additional ~50 bytes of text in
turnip.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
c8c7154c2e tu: Implement extendedDynamicState3ColorBlendEnable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
f3b3af3468 tu: Remove blend dependency on attachment format
This matches freedreno, still passes all the tests, and will make
dynamic blend easier because we can compute more up-front.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
84726da2f4 tu: Implement extendedDynamicState3SampleLocationsEnable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
d99e5ffee7 tu: Clamp sample locations
This was missed in the initial implementation and fixes extreme sample
locations like (1.0, 1.0).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
e63c8b3bf1 tu: Implement extendedDynamicState3ProvokingVertexMode
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
1af2471bd7 tu: Implement extendedDynamicState3LineRasterizationMode
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
92dd505f7c tu: Impement extendedDynamicState3RasterizationStream
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
6b82998985 tu: Rename RASTERIZER_DISCARD state to PC_RASTER_CNTL
It also contains the rasterization stream.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
68b02ff200 tu: Implement extendedDynamicState3DepthClipNegativeOneToOne
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
2a19b8d696 tu: Implement extendedDynamicState3AlphaToOneEnable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
87bdddf8f1 tu: Implement extendedDynamicState3AlphaToCoverageEnable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
5e362c82c8 tu: Implement extendedDynamicState3RasterizationSamples
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
01055198dc tu: Set default sample mask to all 1's
This avoids a dependency on the sample count in the blend state, and
seems to work. Otherwise, we'd need to make blend dynamic if samples is
dynamic and record whether the sample mask was NULL, which is a lot more
complicated.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
e61583f6f1 tu: Split up tu6_update_msaa()
Most of the time we will only be updating either the number of samples
or whether it should be disabled, not both, and we don't need to compare
both. With pipelines we were comparing both, but with dynamic
rasterization samples we want to only update disable when binding the
pipeline and only update samples when calling
vkCmdSetRasterizationSamplesEXT(). Stop optimizing the uncommon case
where both are changed when binding a pipeline, and split it into 2
parts while sharing the common part that records and emits the state
packet.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
ac051c556d tu: Don't use rasterizationSamples when enabling sample shading
From the spec language, it seems like this change wasn't strictly
required and is just an optimization for when minSampleShading would
be small enough to allow one sample per pixel. However
rasterizationSamples will soon possibly be dynamic, and I don't think we
should keep this around.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
f062a64405 tu: Implement extendedDynamicState3SampleMask
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
80befbf844 tu: Implement extendedDynamicState3LogicOpEnable
This is a little tricky because now we always have to store the
translated logicOp in the pipeline, regardless of whether it's enabled
or not, because the enable/disable may now be dynamic even if the
logicOp is not.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
99caf95eba tu: Implement extendedDynamicState3Depth*Enable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
0e09559bd6 tu: Implement extendedDynamicState3TessellationDomainOrigin
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
55bbf56a17 tu: Implement extendedDynamicState3PolygonMode
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
d20256eba3 tu: Combine GRAS_SU_CNTL drawstate with rast draw state
Emit GRAS_SU_CNTL, GRAS_CL_CNTL, the polygon mode, and the VRS registers
in one draw state. We're running out of draw states, and this saves a
draw state while preparing us for the rest of the rasterization state to
be dynamic.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
009df9f778 tu: VK_EXT_extended_dynamic_state3 boilerplate
Enable the extension but don't enable anything yet.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
4466f9aa02 tu: tu: Clear patchControlPoints dirty state with static patchControlPoints
Noticed by inspection after the previous issue.

Fixes: 68f3c38c80 ("tu: Implement extendedDynamicState2PatchControlPoints")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
9f7896685f tu: Ignore line stipple dynamic state
At least in the current Vulkan spec there is no validation language
saying that it isn't valid to set this state if stippled lines aren't
supported, so it seems we have to just ignore it. Ignore it if the user
specifies a dynamic line stipple state and don't emit warnings if they
call CmdSetLineStippleEXT because zink will do this.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Connor Abbott
9061f5f57d tu: Clear viewport dirty state with static viewports
Vulkan allows the user to set extraneous dynamic state which then gets
ignored if a pipeline with static state is bound. We weren't
implementing this correctly for viewports because we weren't clearing
the dirty bit, but it was happening to work until changes for dynamic
depth negative-one-to-one broke
dEQP-VK.pipeline.*.depth.depth_clip_control.d32_sfloat_less_viewport_before_static.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
2022-11-03 21:59:42 +00:00
Konstantin Seurer
6da2320a92 radv/rra: Print invalid node types
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19465>
2022-11-03 21:25:04 +00:00
José Roberto de Souza
fd14fcb9f9 intel: Add and use intel_gem_get_context_param()
Again sharing the same function across all Intel drivers.

There is still two additional DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM
calls, one in intel/dev and other in perf.
The first one can't call intel_gem_get_context_param() because of the
build order of libs and the second one because it sets the size
parameter.

Will revisit those calls in future but this is already an improvement.

v2:
- using intel_gem_get_context_param() for the recently added query for
I915_CONTEXT_PARAM_PROTECTED_CONTENT

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18974>
2022-11-03 21:01:30 +00:00
José Roberto de Souza
39486661e9 intel: Add and use intel_gem_set_context_param()
Again sharing the same function across all Intel drivers.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18974>
2022-11-03 21:01:30 +00:00
José Roberto de Souza
6ae6921216 intel: Add and use intel_gem_destroy_context()
Again sharing the same function across all Intel drivers.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18974>
2022-11-03 21:01:30 +00:00
José Roberto de Souza
f928ead625 intel: Add and use intel_gem_create_context()
Add intel_gem_create_context() to common/intel_gem.c/h and use it
on Iris, Crocus, ANV and HASVK.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18974>
2022-11-03 21:01:30 +00:00
José Roberto de Souza
ce4a7e7d40 intel: Refactor intel_gem_create_context_engines()
This function was returning a int but there was no meaninfull errno
code being returned, also context_id is a uint32_t what would be
problematic if i915 even returned 2147483648(-1).

So here changing the return type and add context_id pointer parameter.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18974>
2022-11-03 21:01:30 +00:00
José Roberto de Souza
f8c9b5a96b iris: Do not set I915_CONTEXT_PARAM_RECOVERABLE twice
For the protected context path, it was already set.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18974>
2022-11-03 21:01:30 +00:00
José Roberto de Souza
5f7c2b0e16 intel/common: Add and use intel_gem_create_context_ext()
v2:
- added flag mask bit to enable context protected and recoverable
v3:
- added enum intel_gem_create_context_flags

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18974>
2022-11-03 21:01:30 +00:00
Lucas Stach
aa35e86cc8 etnaviv: warn when imported TS buffer is the same as color buffer
Color and TS buffers are allocated separately for each etnaviv resource, so
getting the same base and TS buffer at import time is unexpected and a strong
hint at the application doing something wrong, like passing in the same GEM
handle for all planes on a GBM import. Print a warning to give the user some
feedback.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9780>
2022-11-03 20:24:41 +00:00
Lucas Stach
c2b06e1a38 etnaviv: add support for sharing the TS buffer
This adds support for sharing the TS buffer, which up until now has been
an internal implementation detail, with the outside world. This mainly
improves performance with a GPU compositor present, but on i.MX8M also
direct to display use-cases benefit.

The impact of this change depends on the GPU generation:
- old GPUs with a single pipe won't see any difference
- GC2000 can skip the TS resolve in the client and will benefit from a
  more efficient blit into the sampler compatible format when the client
  buffer contains cleared tiles
- GC3000 can directly sample with TS support, so saves both write and read
  memory bandwidth when the client buffer contains cleared tiles
- GC7000 with compression support can keep the client buffer in compressed
  format, thus saving both read and write bandwidth even for fully filled
  client buffers
- GC7000 coupled to a display unit supporting the compression format (DCSS
  on i.MX8M) does not even need to uncompress the render buffer for display
  so will see significant bandwidth saving even when GPU compositing is
  bypassed

There is a slight complication in that the tile clear color isn't part of
the TS buffer, but is programmed into state registers in the GPU. To handle
this externally shared TS buffers now contain a software metadata area,
where the clear color is stored by the driver, so the receiving end of the
TS buffer can retrieve the clear color from this area.

The compression format is handled in the same way by storing it in the SW
meta area. While we can derive the compression format from the color buffer
format in most cases, some users, like weston, expect that they can "upgrade"
ARGB to XRGB color formats. While this works with plain color formats, as
it's just masking a channel, the compression format differs when alpha is in
use. Receivers of the TS buffer should thus not try to infer the compression
format from the color buffer format, but instead fetch it from the SW meta.

The import/export handling of the TS buffer is modelled after the Intel iris
driver: we add a separate plane for the TS buffer and fold it into the base
resource after the import.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9780>
2022-11-03 20:24:41 +00:00
Lucas Stach
f7463b1292 etnaviv: canonicalize modifier on import
Unknown modifiers are currently squashed down to linear when transforming
the modifier into our interal layout representation. However, the only real
modifier that we expect to see, which isn't Vivante specific or LINEAR, is
the INVALID modifier. Treat this modifier as linear and reject any other
unexpected modifiers.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9780>
2022-11-03 20:24:41 +00:00
Lucas Stach
48b6ec82b4 drm-uapi: bump headers
From drm-next at the following commit:

    commit 7f7a942c0a338c4a2a7b359bdb2b68e9896122ec
    Merge: 0a20a3ea4259 ddcb8fa6514f
    Author: Dave Airlie <airlied@redhat.com>
    Date:   Thu Oct 27 14:44:02 2022 +1000

        Merge tag 'drm-next-20221025' of git://linuxtv.org/pinchartl/media into drm-next

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9780>
2022-11-03 20:24:41 +00:00
Lucas Stach
539cc90929 etnaviv: allocate TS memory from KMS when resource bind is SCANOUT
Some display engines are able to resolve fast clear and/or compression
on the fly and need access to the TS buffer to do so. As they might
have restrictions on which memory they can access, allocate the TS
buffer memory from the KMS side when the resource should be SCANOUT
capable.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9780>
2022-11-03 20:24:41 +00:00
Lucas Stach
f1f89b2e98 etnaviv: rework modifier queries
Rework the loops in the modifier queries to make them a bit more
straight-forward and use less local variables. Those loops get
much more complex as more variations of the modifiers get added,
so the simplification done here is an attempt to keep the complexity
at bay.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9780>
2022-11-03 20:24:41 +00:00
Lucas Stach
a4193b8594 etnaviv: correct comment about tile status size
The earlier understanding of how tile status tracks the color/depth
surface was wrong and the TS size calculations have long been fixed,
as we now know that color/depth tiles have a fixed size in bytes and
thus don't depend on the surface format. But nobody changed the comment
explaining how TS works, so it's still around as a trap for the reader.

Reword the comment to not confuse people that aren't intimately
familiar with the inner workings of tile status.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9780>
2022-11-03 20:24:41 +00:00
Eric Engestrom
f525a152a7 docs: make the "amber" branch's name explicit
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19507>
2022-11-03 19:05:35 +00:00
Yonggang Luo
381e0b43d6 mesa: Add test to prevent windows.h to be included in shared headers
This test is hand crafted by running command
find | grep .*h$ >../headers.txt
under src directory, and using find replace to creating
the file list and then removed the files should not be directly included

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>
2022-11-03 16:07:32 +00:00
Yonggang Luo
bf338c3d7f mesa: #include "util/glheader.h" instead GL/gl.h in shared code
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>
2022-11-03 16:07:31 +00:00
Yonggang Luo
de53069af6 mapi: #include "util/glheader.h" instead of #include "GL/gl.h"
Also add macro to guard windows.h won't be included

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>
2022-11-03 16:07:31 +00:00
Yonggang Luo
2c89401f75 glapi: #include "util/glheader.h" in glapi_priv.h and glapitable.h directly
So that we do not need define GLAPIENTRY repeatedly, always using the
GLAPIENTRY macro comes from GL/gl.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>
2022-11-03 16:07:31 +00:00
Yonggang Luo
bfa3ce44a6 mesa: Move glheader.h from mesa/main/glheader.h to util/glheader.h
So it's can be accessed in broader places

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>
2022-11-03 16:07:31 +00:00
Yonggang Luo
7b7bbe871c mesa: sync GLAPIENTRY with KHRONOS_APIENTRY in GL/gl.h
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>
2022-11-03 16:07:31 +00:00
Yonggang Luo
147a491a74 mesa: BUILD_GL32 is not used anymore
Remove usage of BUILD_GL32 in GL/gl.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>
2022-11-03 16:07:31 +00:00
Yonggang Luo
d7b09092d4 mesa: Remove out-dated comment in common_x86.c
Follow up: 8e3696137f ("remove final imports.h and imports.c bits")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>
2022-11-03 16:07:31 +00:00
Yonggang Luo
f40afd1363 util: Prevent glheader.h from including <windows.h> by defining APIENTRY
When APIENTRY is not defined, GL/gl.h and GL/glext.h will automatically
include <windows.h>, so we save the macro APIENTRY by push_macro and then
define APIENTRY before include of GL/gl.h and GL/glext.h.
After that we use pop_macro to recover the previous macro again.

Because windows.h is not included by glheader.h, mesa/main/errors.c needs
to include <windows.h> directly to prevent the following error:
errors.c:98:10: error: implicit declaration of function 'OutputDebugStringA' [-Werror=implicit-function-declaration]
   98 |          OutputDebugStringA(buf);

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>
2022-11-03 16:07:31 +00:00
Yonggang Luo
afc3d5eff3 glapi: Remove duplicated #include "main/glheader.h"
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>
2022-11-03 16:07:31 +00:00
Yonggang Luo
fe08c22bee docs: XFree86 source files in libGL.txt are out date, remove it
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>
2022-11-03 16:07:31 +00:00
Sarah Walker
ae268884da pvr: Fix NULL pointer indirection in pvr_enable_z_replicate()
Check input_subpass->depth_stencil_attachment is non-NULL before indirecting
it.

Signed-off-by: Sarah Walker <sarah.walker@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19475>
2022-11-03 15:22:11 +00:00
Yonggang Luo
b0016bc36a mesa: Use DEBUG_NAMED_VALUE_END for const struct debug_named_value
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19448>
2022-11-03 14:40:33 +00:00
Rob Clark
de6f86fc44 docs: Fix features.txt typo
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19500>
2022-11-03 14:26:43 +00:00
Iago Toral Quiroga
e6884df088 v3dv: fix event synchronization
Since we now implement events in the GPU we need to be more careful
and insert barriers to honor the dependencies provided by the API
as well as ensuring we are synchronizing these with the compute
queue, since that is how we implement GPU event functionality.

Fixes: ecb01d53fd ("v3dv: refactor events")
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
2022-11-03 14:16:12 +01:00
Iago Toral Quiroga
8113f973b3 v3dv: make the helper to emit pipeline barriers public to other files
Fixes: ecb01d53fd ("v3dv: refactor events")
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
2022-11-03 14:16:12 +01:00
Iago Toral Quiroga
67e82fd1f2 v3dv: always check VK_ACCESS_2_MEMORY_READ_BIT for read accesses
Fixes: a981ac0539 ('v3dv: skip binning sync if binning shaders don't access external resources')

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
2022-11-03 14:16:12 +01:00
Iago Toral Quiroga
4c861cf22a v3dv: increase limit for active event objects
Fixes: ecb01d53fd ("v3dv: refactor events")
Fixes: dEQP-VK.api.command_buffers.execute_large_primary

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
2022-11-03 14:16:12 +01:00
Iago Toral Quiroga
5e97150e21 v3dv: do better cleanup on failure during pipeline cache operation
Fixes (with disk cache enabled):
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
dEQP-VK.api.object_management.alloc_callback_fail.device
dEQP-VK.api.object_management.alloc_callback_fail.device_group

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
2022-11-03 14:16:11 +01:00
Iago Toral Quiroga
1f5966397a v3dv: handle allocation failure during pipeline initialization
Fixes (with disk cache disabled):
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
dEQP-VK.api.object_management.alloc_callback_fail.device
dEQP-VK.api.object_management.alloc_callback_fail.device_group

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
2022-11-03 14:16:11 +01:00
Iago Toral Quiroga
7f905a8117 v3dv: fix incorrect return type
Fixes: ecb01d53fd ("v3dv: refactor events")

Partially fixes:
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
dEQP-VK.api.object_management.alloc_callback_fail.device
dEQP-VK.api.object_management.alloc_callback_fail.device_group

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
2022-11-03 14:16:11 +01:00
Iago Toral Quiroga
b78fd50e90 v3dv: do a better job at cleaning up the device on init failure
These leaks on device creation failure have been there before, but
were only exposed as CTS failures after the recent event refactoring.

Partially fixes:
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
dEQP-VK.api.object_management.alloc_callback_fail.device
dEQP-VK.api.object_management.alloc_callback_fail.device_group

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
2022-11-03 14:16:11 +01:00
Eric Engestrom
aff368fe83 v3dv: avoid freeing already-freed memory
Fixes: ecb01d53fd ("v3dv: refactor events")
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
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/19458>
2022-11-03 14:16:11 +01:00
Iago Toral Quiroga
c793d384c1 v3dv: remove unnecessary check for NULL
We are initializing the device, so we know this will be NULL.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
2022-11-03 14:16:11 +01:00
Eric Engestrom
c6c5949ff7 vk/runtime: drop incorrect UNUSED annotation
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
2022-11-03 14:16:11 +01:00
Martin Roukala (né Peres)
dd908e87d0 radv/ci: document a recent regression on VanGogh
It seems like !19442 may have been introducing a lot of flakes in the
dEQP-VK.query_pool.statistics_query.* tests.

Samuel is looking into it right now, but let's document the flakes in
the mean time so that we can get back to a green baseline.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19470>
2022-11-03 12:01:26 +00:00
Martin Roukala (né Peres)
751eb1ba06 radv/ci: document a flake on VanGogh
Seen only once, so not really worth filing a bug for.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19470>
2022-11-03 12:01:26 +00:00
Martin Roukala (né Peres)
a7ad99f0ae radv/ci: document some VanGogh flakes that came from splitting the job
These tests are also flaky on NAVI21, which were also introduced when
the job was split in two.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19470>
2022-11-03 12:01:26 +00:00
Samuel Pitoiset
fab87b0f41 radv: fix fallback for extreme geometry with tessellation on GFX11
It would assert anyways. Found by inspection.

Cc: 22.3 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/19495>
2022-11-03 11:27:53 +00:00
Lionel Landwerlin
ba0336ab3f anv: Reduce RHWO optimization (Wa_1508744258)
Implement Wa_1508744258:

   Disable RHWO by setting 0x7010[14] by default except during resolve
   pass.

Disable the RCC RHWO optimization at all times except when resolving
single sampled color surfaces.

v2: Move stalling to genX(cmd_buffer_apply_pipe_flushes) for clarity (Mark)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mark Janes <markjanes@swizzler.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19450>
2022-11-03 10:47:59 +00:00
Bas Nieuwenhuizen
d876ddc920 radv: Make the compute scratch waves per SE as well.
Fixes: 278e533ec9 ("radv: update scratch buffer registers on GFX11")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19488>
2022-11-03 10:03:44 +00:00
Bas Nieuwenhuizen
b8865ad046 radv: Fix compute scratch buffer emission.
Copied wrong from radeonsi. The registers following the scratch
buffer address are the shader rsrc1/rsrc2. Not the user SGPR0
containing the ring resource word 1.

Fixes: 278e533ec9 ("radv: update scratch buffer registers on GFX11")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19488>
2022-11-03 10:03:44 +00:00
Bas Nieuwenhuizen
32cf10e17a radv: Style cleanup.
Now have a local info ptr.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19488>
2022-11-03 10:03:44 +00:00
Erik Faye-Lund
ab1727237a docs/isl: remove empty headings
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19461>
2022-11-03 07:46:13 +00:00
Erik Faye-Lund
d2b3ebf0d8 docs/isl: put emphasis on unit names
This convinces the spell-checker that this is something meaniningful, it
seems...

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19461>
2022-11-03 07:46:13 +00:00
Erik Faye-Lund
05a081f7ee docs/isl: correct rst-syntax
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19461>
2022-11-03 07:46:13 +00:00
Erik Faye-Lund
f5eb25ec9f docs/tgsi: quote literal numbers
This makes them stand out a bit, and render using a monospace font.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19460>
2022-11-03 07:40:35 +00:00
Erik Faye-Lund
eaa0b58963 docs/tgsi: mark pseudocode as such
This is more semantically strong.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19460>
2022-11-03 07:40:35 +00:00
Erik Faye-Lund
c69dbe9d81 docs/tgsi: always use uppercase for instruction names
This reads a bit cleaner.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19460>
2022-11-03 07:40:35 +00:00
Erik Faye-Lund
42afb3095b docs/tgsi: use src1 instead of "second arg"
This is more consistent with what we do elsewhere here.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19460>
2022-11-03 07:40:35 +00:00
Erik Faye-Lund
a9fce4d2be docs/tgsi: put emphasis on src etc
This makes them stand out a bit more.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19460>
2022-11-03 07:40:35 +00:00
Erik Faye-Lund
d264ec7b22 docs/gallium: use math-role for zero and one also
Without this, the zero and one renders with a different font than the
other equations. There's no good reason for this, so let's just use the
math-role for these too.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19460>
2022-11-03 07:40:35 +00:00
Erik Faye-Lund
be857778bb docs/gallium: use table instead of list
This makes this a bit easer to read, as the equations line up properly.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19460>
2022-11-03 07:40:35 +00:00
Erik Faye-Lund
c85a05a685 docs/gallium: use definition-lists for member-lists
For some reason, we started with headings for some of these, and then
switched to definition lists midway though.

Let's stick with the definition lists, as that looks a bit more tidy.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19460>
2022-11-03 07:40:35 +00:00
Qiang Yu
e2ac43ddad ac/nir: create gs copy shader with scalar outputs
radeonsi assume IO has been scalarized, this simplify the code
and radeonsi implementation.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19455>
2022-11-03 01:17:18 +00:00
Karol Herbst
cb8038b841 rusticl: remove Option from set_global_binding
We never bind NULL resources through set_global_binding and drivers depend
on this behaviour already.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>
2022-11-02 23:36:56 +00:00
Alyssa Rosenzweig
5f93feed61 panfrost: Don't merge workgroups with variable shared mem
If nir->info.shared_size = 0 but grid->variable_shared_mem > 0, the shader uses
shared memory but the compiler may not realize that. We need to disable
workgroup merging even in this case. The alternate approach is to statically
check for shared intrinsics in the compiler, but this is a bit easier all things
considered.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>
2022-11-02 23:36:56 +00:00
Karol Herbst
cd37325dd9 rusticl: create the constant buffer ahead of launches
v2: don't bind a const buffer if there is none

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>
2022-11-02 23:36:56 +00:00
Karol Herbst
09e15994fc rusticl: create the CSO ahead of launches
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>
2022-11-02 23:36:56 +00:00
Karol Herbst
09d05e4e1c rusticl: unbind compute state before deleting
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>
2022-11-02 23:36:56 +00:00
Karol Herbst
9ccdd86b90 iris: invalidate sysvals if grid dimension changes
Cc: mesa-stable
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>
2022-11-02 23:36:56 +00:00
Karol Herbst
b8d10d9e87 gallium: split up req_local_mem
This will be required if a frontend has to request additional shared mem
on top of the shader declared one, but wants to create the CSO before
knowing the total amount.

In OpenCL applications can bind additional shared mem through kernel
arguments and this happens quite late.

Note: Clover sets the req_local_mem incorrectly before so we can leave it
as broken.

v2: fix panfrost code (Alyssa)

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>
2022-11-02 23:36:56 +00:00
Karol Herbst
7b01545716 rusticl: use real constant buffer for cb0
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>
2022-11-02 23:36:56 +00:00
Karol Herbst
900d50c386 rusticl/nir: add load_kernel_input lowering pass
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>
2022-11-02 23:36:56 +00:00
Karol Herbst
e18512fe88 nir: set range and base for load_kernel_input
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>
2022-11-02 23:36:56 +00:00
Karol Herbst
2a52297141 gallium: drop pipe_compute_state.req_private_mem
nothing used it and nothing will use it, so just drop it and clean up some
dead struct fields in drivers.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
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/18581>
2022-11-02 23:36:56 +00:00
Karol Herbst
b5a3b9f555 gallium/tests: drop compute test
The TGSIs don't compile and are rather an annoyence when touching gallium
APIs.

Originally they were written with adding CL support to TGSI, but that
never panned out.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>
2022-11-02 23:36:56 +00:00
António Monteiro
f804f8065d nouveau/nvc0: Remove unused validate_zcull function
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19271>
2022-11-02 23:25:47 +00:00
António Monteiro
e1a7bcb49a nouveau/nv50: Remove unused alternative sample position ms8
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19271>
2022-11-02 23:25:47 +00:00
António Monteiro
9ea6973ca6 nouveau/nvc0: Remove unused alternative sample position ms8
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19271>
2022-11-02 23:25:47 +00:00
Yonggang Luo
287435134c glx: Fixes apple/apple_visual.c that include non-exist util/debug.h
Fixes: aa4ac5ff8b ("utils: Merge util/debug.* into util/u_debug.* and remove util/debug.*")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Illia Abernikhin <illia.abernikhin@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19486>
2022-11-02 22:51:12 +00:00
Alyssa Rosenzweig
2d8f28df73 panfrost: Replace resource shadowing flush
The entire point of resource shadowing is to avoid unnecessary flushing.
Flushing readers after shadowing is counterproductive. A refresher on
how resource shadowing is supposed to work:

First, we determine if it's beneficial to shadow resources. If so, we
create a new backing buffer object. We flush the current writer of the
resource, if there is one, so the current contents become known to the
CPU. If we are not discarding the original resource, we then copy the
existing contents of the buffer to the new shadow buffer on the CPU.
Finally, we swap the resource's backing buffer for our shadow. Any batch
that reads the resource will continue to read the old copy of the
resource, and any future draw calls will see the new copy with the
change implemented.

Where did we go wrong?

In 988d5aae74 ("panfrost: Flush resources when shadowing"), we started
flushing all readers. We didn't actually need to flush, we just needed
to avoid dangling references on the batches reading the old copy of the
resource. But that's easily enough avoided: just remove the references.
The batches still hold a reference to the underlying BO, which will be
freed at the right time regardless.

Originally motivated by glmark2 -bbuffer:update-method=subdata, which
has some pathological access paterns.

Firefox is a lot faster anecdotally (now scrolling at 60fps in firefox).

But what actually motivated this is an apitrace from Duckstation's GLES
renderer. With this patch, the in-game portion is improved 3fps to 21fps.

Closes: #4028
Fixes: 988d5aae74 ("panfrost: Flush resources when shadowing")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19361>
2022-11-02 22:27:30 +00:00
Alyssa Rosenzweig
0b26a9f773 panfrost: Don't copy resources if replaced
If a synchronized transfer_map is going to overwrite an entire resource,
there's no need to memcpy in the original contents ahead-of-time. This
memcpy is particularly bad for large buffers where it's copying WC->WC,
although that could be mitigated with threaded_context's cpu_storage in
the future if needed.

Prevents a performance regression in glmark2's buffer scenes from the
next patch, hence the Cc.

Cc: mesa-stable
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19361>
2022-11-02 22:27:30 +00:00
Eric Engestrom
dfa8600a2d zink: add missing build_id linker args
Fixes: 4e14da056d ("zink: Enable mesa/st frontend shader caching.")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19485>
2022-11-02 21:39:12 +00:00
Eric Engestrom
f0a29496bb docs: update calendar for 22.3.0-rc1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19483>
2022-11-02 21:18:02 +00:00
Jordan Justen
d911eb17d8 intel/dev: Set has_lsc in XEHP_FEATURES rather than DG2_FEATURES
MTL will want this set as well.

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/19447>
2022-11-02 20:00:08 +00:00
Eric Engestrom
dfbc142b7a docs: reset new_features.txt
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
2022-11-02 19:19:44 +00:00
Eric Engestrom
53c109944d VERSION: bump to 22.4
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
2022-11-02 19:19:35 +00:00
4022 changed files with 1058037 additions and 224956 deletions

View File

@@ -8,7 +8,7 @@ charset = utf-8
insert_final_newline = true
tab_width = 8
[*.{c,h,cpp,hpp,cc,hh}]
[*.{c,h,cpp,hpp,cc,hh,y,yy}]
indent_style = space
indent_size = 3
max_line_length = 78

View File

@@ -9,9 +9,10 @@ jobs:
strategy:
matrix:
glx_option: ['dri', 'xlib']
runs-on: macos-latest
runs-on: macos-11
env:
GALLIUM_DUMP_CPU: true
MESON_EXEC: /Users/runner/Library/Python/3.11/bin/meson
steps:
- name: Checkout
uses: actions/checkout@v3
@@ -25,28 +26,29 @@ jobs:
brew "libxcb"
brew "libxdamage"
brew "libxext"
brew "meson"
brew "molten-vk"
brew "ninja"
brew "pkg-config"
brew "python@3.10"
EOL
brew update
brew bundle --verbose
- name: Install Mako
run: pip3 install --user mako
- name: Install Mako and meson
run: pip3 install --user mako meson
- name: Configure
run: |
cat > native_config <<EOL
[binaries]
llvm-config = '/usr/local/opt/llvm/bin/llvm-config'
EOL
meson . build --native-file=native_config -Dbuild-tests=true -Dosmesa=true -Dgallium-drivers=swrast -Dglx=${{ matrix.glx_option }}
$MESON_EXEC . build --native-file=native_config -Dmoltenvk-dir=$(brew --prefix molten-vk) -Dbuild-tests=true -Dosmesa=true -Dgallium-drivers=swrast,zink -Dglx=${{ matrix.glx_option }}
- name: Build
run: meson compile -C build
run: $MESON_EXEC compile -C build
- name: Test
run: meson test -C build --print-errorlogs
run: $MESON_EXEC test -C build --print-errorlogs
- name: Install
run: meson install -C build --destdir $PWD/install
run: $MESON_EXEC install -C build --destdir $PWD/install
- name: 'Upload Artifact'
if: always()
uses: actions/upload-artifact@v3

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
.vscode*
*.pyc
*.pyo
*.out

View File

@@ -1,3 +1,16 @@
workflow:
rules:
- if: $GITLAB_USER_LOGIN == "marge-bot" && $CI_COMMIT_BRANCH == null
variables:
MESA_CI_PERFORMANCE_ENABLED: 1
- if: $GITLAB_USER_LOGIN == "marge-bot" && $CI_COMMIT_BRANCH
variables:
LAVA_JOB_PRIORITY: 40
- if: $GITLAB_USER_LOGIN != "marge-bot"
variables:
LAVA_JOB_PRIORITY: 50
- when: always
variables:
FDO_UPSTREAM_REPO: mesa/mesa
MESA_TEMPLATES_COMMIT: &ci-templates-commit d5aa3941aa03c2f716595116354fb81eb8012acb
@@ -8,7 +21,7 @@ variables:
rm download-git-cache.sh
set +o xtrace
CI_JOB_JWT_FILE: /minio_jwt
MINIO_HOST: minio-packet.freedesktop.org
MINIO_HOST: s3.freedesktop.org
# per-pipeline artifact storage on MinIO
PIPELINE_ARTIFACTS_BASE: ${MINIO_HOST}/artifacts/${CI_PROJECT_PATH}/${CI_PIPELINE_ID}
# per-job artifact storage on MinIO
@@ -20,16 +33,21 @@ variables:
FD_FARM: "online"
COLLABORA_FARM: "online"
MICROSOFT_FARM: "online"
LIMA_FARM: "online"
LIMA_FARM: "offline"
IGALIA_FARM: "online"
ANHOLT_FARM: "online"
VALVE_FARM: "online"
AUSTRIANCODER_FARM: "online" # only etnaviv GPUs
default:
before_script:
- echo -e "\e[0Ksection_start:$(date +%s):unset_env_vars_section[collapsed=true]\r\e[0KUnsetting vulnerable environment variables"
- echo -n "${CI_JOB_JWT}" > "${CI_JOB_JWT_FILE}"
- unset CI_JOB_JWT
- echo -e "\e[0Ksection_end:$(date +%s):unset_env_vars_section\r\e[0K"
- >
export SCRIPTS_DIR=$(mktemp -d) &&
curl -L -s --retry 4 -f --retry-all-errors --retry-delay 60 -O --output-dir "${SCRIPTS_DIR}" "${CI_PROJECT_URL}/-/raw/${CI_COMMIT_SHA}/.gitlab-ci/setup-test-env.sh" &&
chmod +x ${SCRIPTS_DIR}/setup-test-env.sh &&
. ${SCRIPTS_DIR}/setup-test-env.sh &&
echo -n "${CI_JOB_JWT}" > "${CI_JOB_JWT_FILE}" &&
unset CI_JOB_JWT # Unsetting vulnerable env variables
after_script:
- >
@@ -39,20 +57,20 @@ default:
export CI_JOB_JWT="$(<${CI_JOB_JWT_FILE})" &&
rm "${CI_JOB_JWT_FILE}"
# Retry build or test jobs up to twice when the gitlab-runner itself fails somehow.
# Retry when job fails. Failed jobs can be found in the Mesa CI Daily Reports:
# https://gitlab.freedesktop.org/mesa/mesa/-/issues/?sort=created_date&state=opened&label_name%5B%5D=CI%20daily
retry:
max: 2
when:
- runner_system_failure
max: 1
include:
- project: 'freedesktop/ci-templates'
ref: 34f4ade99434043f88e164933f570301fd18b125
ref: 16bc29078de5e0a067ff84a1a199a3760d3b3811
file:
- '/templates/ci-fairy.yml'
- project: 'freedesktop/ci-templates'
ref: *ci-templates-commit
file:
- '/templates/alpine.yml'
- '/templates/debian.yml'
- '/templates/fedora.yml'
- local: '.gitlab-ci/image-tags.yml'
@@ -61,6 +79,7 @@ include:
- local: '.gitlab-ci/build/gitlab-ci.yml'
- local: '.gitlab-ci/test/gitlab-ci.yml'
- local: '.gitlab-ci/test-source-dep.yml'
- local: 'docs/gitlab-ci.yml'
- local: 'src/amd/ci/gitlab-ci.yml'
- local: 'src/broadcom/ci/gitlab-ci.yml'
- local: 'src/etnaviv/ci/gitlab-ci.yml'
@@ -103,15 +122,6 @@ stages:
# --------------------------------
.rules-anchors:
rules:
# Pipeline for forked project branch
- if: &is-forked-branch '$CI_COMMIT_BRANCH && $CI_PROJECT_NAMESPACE != "mesa"'
when: manual
# Forked project branch / pre-merge pipeline not for Marge bot
- if: &is-forked-branch-or-pre-merge-not-for-marge '$CI_PROJECT_NAMESPACE != "mesa" || ($GITLAB_USER_LOGIN != "marge-bot" && $CI_PIPELINE_SOURCE == "merge_request_event")'
when: manual
# Pipeline runs for the main branch of the upstream Mesa project
- if: &is-mesa-main '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH && $CI_COMMIT_BRANCH'
when: always
# Post-merge pipeline
- if: &is-post-merge '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_BRANCH'
when: on_success
@@ -126,71 +136,15 @@ stages:
when: on_success
.docs-base:
extends:
- .fdo.ci-fairy
- .build-rules
script:
- apk --no-cache add graphviz doxygen
- pip3 install sphinx===5.1.1 breathe===4.34.0 mako===1.2.3 sphinx_rtd_theme===1.0.0
- docs/doxygen-wrapper.py --out-dir=docs/doxygen_xml
- sphinx-build -W -b html docs public
pages:
extends: .docs-base
stage: deploy
artifacts:
paths:
- public
needs: []
rules:
- !reference [.no_scheduled_pipelines-rules, rules]
- if: *is-mesa-main
changes: &docs-or-ci
- docs/**/*
- .gitlab-ci.yml
when: always
# Other cases default to never
test-docs:
extends: .docs-base
# Cancel job if a newer commit is pushed to the same branch
interruptible: true
stage: deploy
needs: []
rules:
- !reference [.no_scheduled_pipelines-rules, rules]
- if: *is-forked-branch
changes: *docs-or-ci
when: manual
# Other cases default to never
test-docs-mr:
extends:
- test-docs
needs:
- sanity
artifacts:
expose_as: 'Documentation preview'
paths:
- public/
rules:
- if: *is-pre-merge
changes: *docs-or-ci
when: on_success
# Other cases default to never
# When to automatically run the CI for build jobs
.build-rules:
rules:
- !reference [.no_scheduled_pipelines-rules, rules]
# If any files affecting the pipeline are changed, build/test jobs run
# automatically once all dependency jobs have passed
- changes: &all_paths
- VERSION
- bin/git_sha1_gen.py
- bin/install_megadrivers.py
- bin/meson_get_version.py
- bin/symbols-check.py
# GitLab CI
- .gitlab-ci.yml
@@ -220,7 +174,6 @@ test-docs-mr:
.container-rules:
rules:
- !reference [.no_scheduled_pipelines-rules, rules]
# Run pipeline by default in the main project if any CI pipeline
# configuration files were changed, to ensure docker images are up to date
- if: *is-post-merge
@@ -264,9 +217,7 @@ make git archive:
# compress the current folder
- tar -cvzf ../$CI_PROJECT_NAME.tar.gz .
# login with the JWT token file
- ci-fairy minio login --token-file "${CI_JOB_JWT_FILE}"
- ci-fairy minio cp ../$CI_PROJECT_NAME.tar.gz minio://$MINIO_HOST/git-cache/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/$CI_PROJECT_NAME.tar.gz
- ci-fairy s3cp --token-file "${CI_JOB_JWT_FILE}" ../$CI_PROJECT_NAME.tar.gz https://$MINIO_HOST/git-cache/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/$CI_PROJECT_NAME.tar.gz
# Sanity checks of MR settings and commit logs
@@ -287,18 +238,3 @@ sanity:
when: on_failure
reports:
junit: check-*.xml
# Rules for tests that should not block merging, but should be available to
# optionally run with the "play" button in the UI in pre-merge non-marge
# pipelines. This should appear in "extends:" after any includes of
# test-source-dep.yml rules, so that these rules replace those.
.test-manual-mr:
rules:
- !reference [.no_scheduled_pipelines-rules, rules]
- if: *is-forked-branch-or-pre-merge-not-for-marge
changes:
*all_paths
when: manual
variables:
JOB_TIMEOUT: 80

View File

@@ -15,3 +15,20 @@ glx@glx_arb_sync_control@timing.*
# This test is not built with waffle, while we do build tests with waffle
spec@!opengl 1.1@windowoverlap
# These tests all read from the front buffer after a swap. Given that we
# run piglit tests in parallel in Mesa CI, and don't have a compositor
# running, the frontbuffer reads may end up with undefined results from
# windows overlapping us.
#
# Piglit does mark these tests as not to be run in parallel, but deqp-runner
# doesn't respect that. We need to extend deqp-runner to allow some tests to be
# marked as single-threaded and run after the rayon loop if we want to support
# them.
#
# Note that "glx-" tests don't appear in x11-skips.txt because they can be
# run even if PIGLIT_PLATFORM=gbm (for example)
glx@glx-copy-sub-buffer.*
# Reads the front buffer but it doesn't have to.
# https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/755
glx-swap-copy

View File

@@ -52,7 +52,7 @@ deployment:
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"
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 %},remove,expiration=pipeline_end,preserve"
{% for volume in volumes %}
b2c.volume={{ volume }}
{% endfor %}

View File

@@ -92,10 +92,12 @@ if args.mount_volume is not None:
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 }}'
)
# Use the gateway's pull-through registry caches to reduce load on fd.o.
values['local_container'] = args.local_container
for url, replacement in [('registry.freedesktop.org', '{{ fdo_proxy_registry }}'),
('harbor.freedesktop.org', '{{ harbor_fdo_registry }}')]:
values['local_container'] = values['local_container'].replace(url, replacement)
if 'B2C_KERNEL_CMDLINE_EXTRAS' in environ:
values['cmdline_extras'] = environ['B2C_KERNEL_CMDLINE_EXTRAS']

View File

@@ -1,26 +0,0 @@
#!/bin/sh
# This test script groups together a bunch of fast dEQP variant runs
# to amortize the cost of rebooting the board.
set -ex
EXIT=0
# Run reset tests without parallelism:
if ! env \
DEQP_RESULTS_DIR=results/reset \
FDO_CI_CONCURRENT=1 \
DEQP_CASELIST_FILTER='.*reset.*' \
/install/deqp-runner.sh; then
EXIT=1
fi
# Then run everything else with parallelism:
if ! env \
DEQP_RESULTS_DIR=results/nonrobustness \
DEQP_CASELIST_INV_FILTER='.*reset.*' \
/install/deqp-runner.sh; then
EXIT=1
fi

View File

@@ -80,8 +80,9 @@ mkdir -p /nfs/results
rm -rf /tftp/*
if echo "$BM_KERNEL" | grep -q http; then
apt install -y wget
wget $BM_KERNEL -O /tftp/vmlinuz
apt-get install -y curl
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
$BM_KERNEL -o /tftp/vmlinuz
else
cp $BM_KERNEL /tftp/vmlinuz
fi

View File

@@ -1,5 +1,7 @@
#!/bin/bash
. "$SCRIPTS_DIR"/setup-test-env.sh
BM=$CI_PROJECT_DIR/install/bare-metal
CI_COMMON=$CI_PROJECT_DIR/install/common
@@ -100,10 +102,12 @@ fi
# moving that container to the runner. So, if BM_KERNEL+BM_DTB are URLs,
# fetch them instead of looking in the container.
if echo "$BM_KERNEL $BM_DTB" | grep -q http; then
apt install -y wget
apt-get install -y curl
wget $BM_KERNEL -O kernel
wget $BM_DTB -O dtb
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
"$BM_KERNEL" -o kernel
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
"$BM_DTB" -o dtb
cat kernel dtb > Image.gz-dtb
rm kernel

View File

@@ -1,5 +1,7 @@
#!/bin/bash
. "$SCRIPTS_DIR"/setup-test-env.sh
# Boot script for devices attached to a PoE switch, using NFS for the root
# filesystem.
@@ -71,6 +73,8 @@ fi
set -ex
date +'%F %T'
# Clear out any previous run's artifacts.
rm -rf results/
mkdir -p results
@@ -79,13 +83,18 @@ mkdir -p results
# state, since it's volume-mounted on the host.
rsync -a --delete $BM_ROOTFS/ /nfs/
date +'%F %T'
# If BM_BOOTFS is an URL, download it
if echo $BM_BOOTFS | grep -q http; then
apt install -y wget
wget ${FDO_HTTP_CACHE_URI:-}$BM_BOOTFS -O /tmp/bootfs.tar
apt-get install -y curl
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
"${FDO_HTTP_CACHE_URI:-}$BM_BOOTFS" -o /tmp/bootfs.tar
BM_BOOTFS=/tmp/bootfs.tar
fi
date +'%F %T'
# If BM_BOOTFS is a file, assume it is a tarball and uncompress it
if [ -f $BM_BOOTFS ]; then
mkdir -p /tmp/bootfs
@@ -93,14 +102,20 @@ if [ -f $BM_BOOTFS ]; then
BM_BOOTFS=/tmp/bootfs
fi
date +'%F %T'
# 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 $BM_BOOTFS/usr/lib/modules/ /nfs/usr/lib/modules/
[ -d $BM_BOOTFS/lib/modules ] && rsync -a $BM_BOOTFS/lib/modules/ /nfs/lib/modules/
date +'%F %T'
# Install kernel image + bootloader files
rsync -aL --delete $BM_BOOTFS/boot/ /tftp/
date +'%F %T'
# Set up the pxelinux config for Jetson Nano
mkdir -p /tftp/pxelinux.cfg
cat <<EOF >/tftp/pxelinux.cfg/default-arm-tegra210-p3450-0000
@@ -132,6 +147,8 @@ EOF
mkdir -p /nfs/results
. $BM/rootfs-setup.sh /nfs
date +'%F %T'
echo "$BM_CMDLINE" > /tftp/cmdline.txt
# Add some required options in config.txt
@@ -155,8 +172,12 @@ while [ $((ATTEMPTS--)) -gt 0 ]; do
done
set -e
date +'%F %T'
# Bring artifacts back from the NFS dir to the build dir where gitlab-runner
# will look for them.
cp -Rp /nfs/results/. results/
date +'%F %T'
exit $ret

View File

@@ -8,12 +8,17 @@ mkdir -p $rootfs_dst/results
cp $BM/bm-init.sh $rootfs_dst/init
cp $CI_COMMON/init*.sh $rootfs_dst/
date +'%F %T'
# Make JWT token available as file in the bare-metal storage to enable access
# to MinIO
cp "${CI_JOB_JWT_FILE}" "${rootfs_dst}${CI_JOB_JWT_FILE}"
date +'%F %T'
cp $CI_COMMON/capture-devcoredump.sh $rootfs_dst/
cp $CI_COMMON/intel-gpu-freq.sh $rootfs_dst/
cp "$SCRIPTS_DIR/setup-test-env.sh" "$rootfs_dst/"
set +x
@@ -28,3 +33,5 @@ set -x
# Add the Mesa drivers we built, and make a consistent symlink to them.
mkdir -p $rootfs_dst/$CI_PROJECT_DIR
rsync -aH --delete $CI_PROJECT_DIR/install/ $rootfs_dst/$CI_PROJECT_DIR/install/
date +'%F %T'

1
.gitlab-ci/bin Symbolic link
View File

@@ -0,0 +1 @@
../bin/ci

View File

@@ -1,2 +0,0 @@
schema.graphql
gitlab_gql.py.cache.db

View File

@@ -0,0 +1,3 @@
#!/bin/sh
_COMPILER=clang++
. compiler-wrapper.sh

View File

@@ -0,0 +1,3 @@
#!/bin/sh
_COMPILER=clang
. compiler-wrapper.sh

View File

@@ -0,0 +1,3 @@
#!/bin/sh
_COMPILER=g++
. compiler-wrapper.sh

View File

@@ -0,0 +1,3 @@
#!/bin/sh
_COMPILER=gcc
. compiler-wrapper.sh

View File

@@ -0,0 +1,21 @@
#!/bin/sh -e
if command -V ccache >/dev/null 2>/dev/null; then
CCACHE=ccache
else
CCACHE=
fi
if [ "$(ps -p $(ps -p $PPID -o ppid --no-headers) -o comm --no-headers)" != ninja ]; then
# Not invoked by ninja (e.g. for a meson feature check)
exec $CCACHE $_COMPILER "$@"
fi
if [ "$(eval printf "'%s'" "\"\${$(($#-1))}\"")" = "-c" ]; then
# Not invoked for linking
exec $CCACHE $_COMPILER "$@"
fi
# Compiler invoked by ninja for linking. Add -Werror to turn compiler warnings into errors
# with LTO. (meson's werror should arguably do this, but meanwhile we need to)
exec $CCACHE $_COMPILER "$@" -Werror

View File

@@ -10,6 +10,7 @@
- _build/meson-logs/*.txt
- _build/meson-logs/strace
- shader-db
- artifacts
# Just Linux
.build-linux:
@@ -21,15 +22,16 @@
# 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"
- |
export PATH="/usr/lib/ccache:$PATH"
export CCACHE_BASEDIR="$PWD"
if test -x /usr/bin/ccache; then
section_start ccache_before "ccache stats before build"
ccache --show-stats
section_end ccache_before
fi
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"
- if test -x /usr/bin/ccache; then ccache --show-stats | grep "cache hit rate"; fi
- !reference [default, after_script]
.build-windows:
@@ -73,16 +75,17 @@ debian-testing:
-D glx=dri
-D gbm=enabled
-D egl=enabled
-D platforms=x11
-D platforms=x11,wayland
GALLIUM_ST: >
-D dri3=enabled
-D gallium-va=enabled
GALLIUM_DRIVERS: "swrast,virgl,radeonsi,zink,crocus,iris,i915"
VULKAN_DRIVERS: "swrast,amd,intel,virtio-experimental"
VULKAN_DRIVERS: "swrast,amd,intel,intel_hasvk,virtio-experimental"
BUILDTYPE: "debugoptimized"
EXTRA_OPTION: >
-D spirv-to-dxil=true
-D valgrind=false
-D valgrind=disabled
-D perfetto=true
MINIO_ARTIFACT_NAME: mesa-amd64
LLVM_VERSION: "13"
script:
@@ -100,7 +103,7 @@ debian-testing-asan:
-Wno-error=stringop-truncation
EXTRA_OPTION: >
-D b_sanitize=address
-D valgrind=false
-D valgrind=disabled
-D tools=dlclose-skip
MINIO_ARTIFACT_NAME: ""
ARTIFACTS_DEBUG_SYMBOLS: 1
@@ -137,12 +140,13 @@ debian-testing-msan:
GALLIUM_DRIVERS: "swrast"
BUILDTYPE: "debugoptimized"
EXTRA_OPTION: >
-D valgrind=false
-D valgrind=disabled
script:
- .gitlab-ci/meson/build.sh
- .gitlab-ci/prepare-artifacts.sh
debian-clover-testing:
# TODO: remove together with Clover
.debian-clover-testing:
extends:
- .debian-cl-testing
variables:
@@ -183,12 +187,19 @@ debian-build-testing:
-D spirv-to-dxil=true
-D osmesa=true
-D tools=drm-shim,etnaviv,freedreno,glsl,intel,intel-ui,nir,nouveau,lima,panfrost,asahi
script:
- .gitlab-ci/lava/lava-pytest.sh
- .gitlab-ci/run-shellcheck.sh
- .gitlab-ci/run-yamllint.sh
- .gitlab-ci/meson/build.sh
- .gitlab-ci/run-shader-db.sh
-D b_lto=true
LLVM_VERSION: 13
script: |
section_start lava-pytest "lava-pytest"
.gitlab-ci/lava/lava-pytest.sh
section_switch shellcheck "shellcheck"
.gitlab-ci/run-shellcheck.sh
section_switch yamllint "yamllint"
.gitlab-ci/run-yamllint.sh
section_switch meson "meson"
.gitlab-ci/meson/build.sh
section_switch shader-db "shader-db"
.gitlab-ci/run-shader-db.sh
# Test a release build with -Werror so new warnings don't sneak in.
debian-release:
@@ -214,13 +225,53 @@ debian-release:
-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,microsoft-experimental"
BUILDTYPE: "release"
EXTRA_OPTION: >
-D spirv-to-dxil=true
-D osmesa=true
-D tools=all
-D intel-clc=enabled
-D imagination-srv=true
BUILDTYPE: "release"
MINIO_ARTIFACT_NAME: "mesa-amd64-${BUILDTYPE}"
script:
- .gitlab-ci/meson/build.sh
- 'if [ -n "$MESA_CI_PERFORMANCE_ENABLED" ]; then .gitlab-ci/prepare-artifacts.sh; fi'
alpine-build-testing:
extends:
- .meson-build
- .use-alpine/x86_build
stage: build-x86_64
variables:
BUILDTYPE: "release"
C_ARGS: >
-Wno-error=cpp
-Wno-error=array-bounds
-Wno-error=stringop-overread
DRI_LOADERS: >
-D glx=disabled
-D gbm=enabled
-D egl=enabled
-D glvnd=false
-D platforms=wayland
LLVM_VERSION: ""
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=disabled
-D gallium-omx=disabled
-D gallium-va=enabled
-D gallium-xa=disabled
-D gallium-nine=true
-D gallium-rusticl=false
-D gles1=disabled
-D gles2=enabled
-D llvm=enabled
-D microsoft-clc=disabled
-D shared-llvm=enabled
UNWIND: "disabled"
VULKAN_DRIVERS: "amd,broadcom,freedreno,intel,imagination-experimental"
script:
- .gitlab-ci/meson/build.sh
@@ -230,27 +281,29 @@ fedora-release:
- .use-fedora/x86_build
variables:
BUILDTYPE: "release"
C_ARGS: >
C_LINK_ARGS: >
-Wno-error=array-bounds
-Wno-error=stringop-overflow
-Wno-error=stringop-overread
-Wno-error=uninitialized
CPP_ARGS: >
CPP_LINK_ARGS: >
-Wno-error=array-bounds
-Wno-error=stringop-overflow
-Wno-error=stringop-overread
DRI_LOADERS: >
-D glx=dri
-D gbm=enabled
-D egl=enabled
-D glvnd=true
-D platforms=x11,wayland
# intel-clc disabled, we need llvm-spirv-translator 13.0+, Fedora 34 only packages 12.0.
EXTRA_OPTION: >
-D b_lto=true
-D osmesa=true
-D selinux=true
-D tools=drm-shim,etnaviv,freedreno,glsl,intel,nir,nouveau,lima,panfrost,imagination
-D vulkan-layers=device-select,overlay
-D intel-clc=disabled
-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_DRIVERS: "crocus,etnaviv,freedreno,i915,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
@@ -268,7 +321,7 @@ fedora-release:
-D shared-llvm=enabled
LLVM_VERSION: ""
UNWIND: "disabled"
VULKAN_DRIVERS: "amd,broadcom,freedreno,intel,imagination-experimental"
VULKAN_DRIVERS: "amd,broadcom,freedreno,imagination-experimental,intel,intel_hasvk"
script:
- .gitlab-ci/meson/build.sh
@@ -276,6 +329,7 @@ debian-android:
extends:
- .meson-cross
- .use-debian/android_build
- .ci-deqp-artifacts
variables:
UNWIND: "disabled"
C_ARGS: >
@@ -283,11 +337,13 @@ debian-android:
-Wno-error=constant-conversion
-Wno-error=enum-conversion
-Wno-error=initializer-overrides
-Wno-error=missing-braces
-Wno-error=sometimes-uninitialized
-Wno-error=unused-function
-Wno-error=implicit-const-int-float-conversion
CPP_ARGS: >
-Wno-error=deprecated-declarations
-Wno-error=c99-designator
-Wno-error=unused-variable
-Wno-error=unused-but-set-variable
-Wno-error=self-assign
DRI_LOADERS: >
-D glx=disabled
-D gbm=disabled
@@ -296,8 +352,9 @@ debian-android:
EXTRA_OPTION: >
-D android-stub=true
-D llvm=disabled
-D platform-sdk-version=29
-D valgrind=false
-D platform-sdk-version=33
-D valgrind=disabled
-D android-libbacktrace=disabled
GALLIUM_ST: >
-D dri3=disabled
-D gallium-vdpau=disabled
@@ -309,14 +366,17 @@ debian-android:
-D gallium-rusticl=false
LLVM_VERSION: ""
PKG_CONFIG_LIBDIR: "/disable/non/android/system/pc/files"
ARTIFACTS_DEBUG_SYMBOLS: 1
MINIO_ARTIFACT_NAME: mesa-x86_64-android
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
- 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
- CROSS=x86_64-linux-android GALLIUM_DRIVERS=iris,virgl VULKAN_DRIVERS=amd,intel .gitlab-ci/meson/build.sh
- .gitlab-ci/prepare-artifacts.sh
.meson-cross:
extends:
@@ -328,7 +388,7 @@ debian-android:
-D glx=dri
-D gbm=enabled
-D egl=enabled
-D platforms=x11
-D platforms=x11,wayland
-D osmesa=false
GALLIUM_ST: >
-D dri3=enabled
@@ -359,8 +419,11 @@ debian-armhf:
CROSS: armhf
EXTRA_OPTION: >
-D llvm=disabled
-D valgrind=false
-D valgrind=disabled
MINIO_ARTIFACT_NAME: mesa-armhf
# The strip command segfaults, failing to strip the binary and leaving
# tempfiles in our artifacts.
ARTIFACTS_DEBUG_SYMBOLS: 1
script:
- .gitlab-ci/meson/build.sh
- .gitlab-ci/prepare-artifacts.sh
@@ -373,8 +436,9 @@ debian-arm64:
VULKAN_DRIVERS: "freedreno,broadcom,panfrost,imagination-experimental"
EXTRA_OPTION: >
-D llvm=disabled
-D valgrind=false
-D valgrind=disabled
-D imagination-srv=true
-D perfetto=true
MINIO_ARTIFACT_NAME: mesa-arm64
script:
- .gitlab-ci/meson/build.sh
@@ -387,7 +451,7 @@ debian-arm64-asan:
EXTRA_OPTION: >
-D llvm=disabled
-D b_sanitize=address
-D valgrind=false
-D valgrind=disabled
-D tools=dlclose-skip
ARTIFACTS_DEBUG_SYMBOLS: 1
MINIO_ARTIFACT_NAME: mesa-arm64-asan
@@ -404,6 +468,18 @@ debian-arm64-build-test:
script:
- .gitlab-ci/meson/build.sh
debian-arm64-release:
extends:
- debian-arm64
variables:
BUILDTYPE: release
MINIO_ARTIFACT_NAME: mesa-arm64-${BUILDTYPE}
C_ARGS: >
-Wno-error=stringop-truncation
script:
- .gitlab-ci/meson/build.sh
- 'if [ -n "$MESA_CI_PERFORMANCE_ENABLED" ]; then .gitlab-ci/prepare-artifacts.sh; fi'
debian-clang:
extends: .meson-build
variables:
@@ -421,7 +497,6 @@ debian-clang:
-Wno-error=implicit-const-int-float-conversion
-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 glx=dri
@@ -489,9 +564,10 @@ windows-vs2019:
-D egl=disabled
-D gbm=disabled
EXTRA_OPTION: >
-D valgrind=false
-D valgrind=disabled
debian-clover:
# TODO: remove with Clover
.debian-clover:
extends: .debian-cl
variables:
GALLIUM_DRIVERS: "r600,radeonsi,swrast"
@@ -585,26 +661,21 @@ debian-ppc64el:
GALLIUM_DRIVERS: "nouveau,radeonsi,swrast,virgl,zink"
VULKAN_DRIVERS: "amd,swrast"
debian-mingw32-x86_64:
# Disabled as it hangs with winedbg on shared runners
.debian-mingw32-x86_64:
extends: .meson-build_mingw
stage: build-misc
variables:
UNWIND: "disabled"
C_ARGS: >
-Wno-error=format
-Wno-error=format-extra-args
-Wno-error=deprecated-declarations
-Wno-error=unused-but-set-variable
CPP_ARGS: >
-Wno-error=format
-Wno-error=unused-function
-Wno-error=unused-variable
-Wno-error=unused-but-set-variable
-Wno-error=unused-value
-Wno-error=switch
-Wno-error=parentheses
-Wno-error=missing-prototypes
-Wno-error=sign-compare
-Wno-error=narrowing
-Wno-error=overflow
CPP_ARGS: $C_ARGS
GALLIUM_DRIVERS: "swrast,d3d12,zink"
VULKAN_DRIVERS: "swrast,amd,microsoft-experimental"
GALLIUM_ST: >
@@ -614,7 +685,7 @@ debian-mingw32-x86_64:
-D microsoft-clc=enabled
-D static-libclc=all
-D llvm=enabled
-D gallium-va=true
-D gallium-va=enabled
-D video-codecs=h264dec,h264enc,h265dec,h265enc,vc1dec
EXTRA_OPTION: >
-D min-windows-version=7

View File

@@ -10,6 +10,7 @@ for var in \
CI_COMMIT_TITLE \
CI_JOB_ID \
CI_JOB_JWT_FILE \
CI_JOB_STARTED_AT \
CI_JOB_NAME \
CI_JOB_URL \
CI_MERGE_REQUEST_SOURCE_BRANCH_NAME \
@@ -27,9 +28,8 @@ for var in \
CI_SERVER_URL \
CROSVM_GALLIUM_DRIVER \
CROSVM_GPU_ARGS \
CURRENT_SECTION \
DEQP_BIN_DIR \
DEQP_CASELIST_FILTER \
DEQP_CASELIST_INV_FILTER \
DEQP_CONFIG \
DEQP_EXPECTED_RENDERER \
DEQP_FRACTION \
@@ -62,6 +62,7 @@ for var in \
HWCI_FREQ_MAX \
HWCI_KERNEL_MODULES \
HWCI_KVM \
HWCI_START_WESTON \
HWCI_START_XORG \
HWCI_TEST_SCRIPT \
IR3_SHADER_DEBUG \
@@ -116,6 +117,8 @@ for var in \
VK_DRIVER \
VK_ICD_FILENAMES \
VKD3D_PROTON_RESULTS \
ZINK_DESCRIPTORS \
LVP_POISON_MEMORY \
; do
if [ -n "${!var+x}" ]; then
echo "export $var=${!var@Q}"

View File

@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# Make sure to kill itself and all the children process from this script on
# exiting, since any console output may interfere with LAVA signals handling,
@@ -36,7 +36,10 @@ BACKGROUND_PIDS=
# Second-stage init, used to set up devices and our job environment before
# running tests.
. /set-job-env-vars.sh
for path in '/set-job-env-vars.sh' './set-job-env-vars.sh'; do
[ -f "$path" ] && source "$path"
done
. "$SCRIPTS_DIR"/setup-test-env.sh
set -ex
@@ -45,6 +48,16 @@ set -ex
echo -n $HWCI_KERNEL_MODULES | xargs -d, -n1 /usr/sbin/modprobe
}
# Set up ZRAM
HWCI_ZRAM_SIZE=2G
if zramctl --find --size $HWCI_ZRAM_SIZE -a zstd; then
mkswap /dev/zram0
swapon /dev/zram0
echo "zram: $HWCI_ZRAM_SIZE activated"
else
echo "zram: skipping, not supported"
fi
#
# Load the KVM module specific to the detected CPU virtualization extensions:
# - vmx for Intel VT
@@ -63,7 +76,8 @@ if [ "$HWCI_KVM" = "true" ]; then
modprobe ${KVM_KERNEL_MODULE}
mkdir -p /lava-files
wget -S --progress=dot:giga -O /lava-files/${KERNEL_IMAGE_NAME} \
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-o "/lava-files/${KERNEL_IMAGE_NAME}" \
"${KERNEL_IMAGE_BASE_URL}/${KERNEL_IMAGE_NAME}"
fi
@@ -118,6 +132,7 @@ BACKGROUND_PIDS="$! $BACKGROUND_PIDS"
if [ -n "$HWCI_START_XORG" ]; then
echo "touch /xorg-started; sleep 100000" > /xorg-script
env \
VK_ICD_FILENAMES=/install/share/vulkan/icd.d/${VK_DRIVER}_icd.`uname -m`.json \
xinit /bin/sh /xorg-script -- /usr/bin/Xorg -noreset -s 0 -dpms -logfile /Xorg.0.log &
BACKGROUND_PIDS="$! $BACKGROUND_PIDS"
@@ -131,9 +146,28 @@ if [ -n "$HWCI_START_XORG" ]; then
export DISPLAY=:0
fi
RESULT=fail
if [ -n "$HWCI_START_WESTON" ]; then
WESTON_X11_SOCK="/tmp/.X11-unix/X0"
if [ -n "$HWCI_START_XORG" ]; then
echo "Please consider dropping HWCI_START_XORG and instead using Weston XWayland for testing."
WESTON_X11_SOCK="/tmp/.X11-unix/X1"
fi
export WAYLAND_DISPLAY=wayland-0
# Display server is Weston Xwayland when HWCI_START_XORG is not set or Xorg when it's
export DISPLAY=:0
mkdir -p /tmp/.X11-unix
env \
VK_ICD_FILENAMES="/install/share/vulkan/icd.d/${VK_DRIVER}_icd.$(uname -m).json" \
weston -Bheadless-backend.so --use-gl -Swayland-0 --xwayland --idle-time=0 &
BACKGROUND_PIDS="$! $BACKGROUND_PIDS"
while [ ! -S "$WESTON_X11_SOCK" ]; do sleep 1; done
fi
set +e
sh -c "$HWCI_TEST_SCRIPT"
bash -c ". $SCRIPTS_DIR/setup-test-env.sh && $HWCI_TEST_SCRIPT"
EXIT_CODE=$?
set -e
@@ -150,13 +184,12 @@ cleanup
# upload artifacts
if [ -n "$MINIO_RESULTS_UPLOAD" ]; then
tar --zstd -cf results.tar.zst results/;
ci-fairy minio login --token-file "${CI_JOB_JWT_FILE}";
ci-fairy minio cp results.tar.zst minio://"$MINIO_RESULTS_UPLOAD"/results.tar.zst;
ci-fairy s3cp --token-file "${CI_JOB_JWT_FILE}" results.tar.zst https://"$MINIO_RESULTS_UPLOAD"/results.tar.zst;
fi
# We still need to echo the hwci: mesa message, as some scripts rely on it, such
# as the python ones inside the bare-metal folder
[ ${EXIT_CODE} -eq 0 ] && RESULT=pass
[ ${EXIT_CODE} -eq 0 ] && RESULT=pass || RESULT=fail
set +x
echo "hwci: mesa: $RESULT"

View File

@@ -0,0 +1,174 @@
From bf8ada0d15f94824ee1643d4e17a66dffdbaf2e5 Mon Sep 17 00:00:00 2001
From: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Date: Fri, 26 Aug 2022 18:24:27 +0200
Subject: [PATCH 1/2] Allow running on Android from the command line
For testing the Android EGL platform without having to go via the
Android activity manager, build deqp-egl.
Tests that render to native windows are unsupported, as command line
programs cannot create windows on Android.
$ cmake -S . -B build/ -DDEQP_TARGET=android -DDEQP_TARGET_TOOLCHAIN=ndk-modern -DCMAKE_C_FLAGS=-Werror -DCMAKE_CXX_FLAGS=-Werror -DANDROID_NDK_PATH=./android-ndk-r21d -DANDROID_ABI=x86_64 -DDE_ANDROID_API=28 -DGLCTS_GTF_TARGET=gles32 -G Ninja
$ ninja -C build modules/egl/deqp-egl
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
---
CMakeLists.txt | 36 ++-----------------
.../android/tcuAndroidNativeActivity.cpp | 36 ++++++++++---------
.../platform/android/tcuAndroidPlatform.cpp | 12 ++++++-
3 files changed, 33 insertions(+), 51 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1ff2bb9..8c76abb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -249,7 +249,7 @@ include_directories(
external/vulkancts/framework/vulkan/generated/vulkan
)
-if (DE_OS_IS_ANDROID OR DE_OS_IS_IOS)
+if (DE_OS_IS_IOS)
# On Android deqp modules are compiled as libraries and linked into final .so
set(DEQP_MODULE_LIBRARIES )
set(DEQP_MODULE_ENTRY_POINTS )
@@ -293,7 +293,7 @@ macro (add_deqp_module MODULE_NAME SRCS LIBS EXECLIBS ENTRY)
set(DEQP_MODULE_LIBRARIES ${DEQP_MODULE_LIBRARIES} PARENT_SCOPE)
set(DEQP_MODULE_ENTRY_POINTS ${DEQP_MODULE_ENTRY_POINTS} PARENT_SCOPE)
- if (NOT DE_OS_IS_ANDROID AND NOT DE_OS_IS_IOS)
+ if (NOT DE_OS_IS_IOS)
# Executable target
add_executable(${MODULE_NAME} ${PROJECT_SOURCE_DIR}/framework/platform/tcuMain.cpp ${ENTRY})
target_link_libraries(${MODULE_NAME} PUBLIC "${EXECLIBS}" "${MODULE_NAME}${MODULE_LIB_TARGET_POSTFIX}")
@@ -367,37 +367,7 @@ add_subdirectory(external/vulkancts/vkscpc)
add_subdirectory(external/openglcts)
# Single-binary targets
-if (DE_OS_IS_ANDROID)
- include_directories(executor)
- include_directories(${PROJECT_BINARY_DIR}/external/vulkancts/framework/vulkan)
-
- set(DEQP_SRCS
- framework/platform/android/tcuAndroidMain.cpp
- framework/platform/android/tcuAndroidJNI.cpp
- framework/platform/android/tcuAndroidPlatformCapabilityQueryJNI.cpp
- framework/platform/android/tcuTestLogParserJNI.cpp
- ${DEQP_MODULE_ENTRY_POINTS}
- )
-
- set(DEQP_LIBS
- tcutil-platform
- xecore
- ${DEQP_MODULE_LIBRARIES}
- )
-
- add_library(deqp SHARED ${DEQP_SRCS})
- target_link_libraries(deqp ${DEQP_LIBS})
-
- # Separate out the debug information because it's enormous
- add_custom_command(TARGET deqp POST_BUILD
- COMMAND ${CMAKE_STRIP} --only-keep-debug -o $<TARGET_FILE:deqp>.debug $<TARGET_FILE:deqp>
- COMMAND ${CMAKE_STRIP} -g $<TARGET_FILE:deqp>)
-
- # Needed by OpenGL CTS that defines its own activity but depends on
- # common Android support code.
- target_include_directories(deqp PRIVATE framework/platform/android)
-
-elseif (DE_OS_IS_IOS)
+if (DE_OS_IS_IOS)
# Code sign identity
set(DEQP_IOS_CODE_SIGN_IDENTITY "drawElements" CACHE STRING "Code sign identity for iOS build")
diff --git a/framework/platform/android/tcuAndroidNativeActivity.cpp b/framework/platform/android/tcuAndroidNativeActivity.cpp
index 6f8cd8f..b83e30f 100644
--- a/framework/platform/android/tcuAndroidNativeActivity.cpp
+++ b/framework/platform/android/tcuAndroidNativeActivity.cpp
@@ -116,23 +116,25 @@ namespace Android
NativeActivity::NativeActivity (ANativeActivity* activity)
: m_activity(activity)
{
- activity->instance = (void*)this;
- activity->callbacks->onStart = onStartCallback;
- activity->callbacks->onResume = onResumeCallback;
- activity->callbacks->onSaveInstanceState = onSaveInstanceStateCallback;
- activity->callbacks->onPause = onPauseCallback;
- activity->callbacks->onStop = onStopCallback;
- activity->callbacks->onDestroy = onDestroyCallback;
- activity->callbacks->onWindowFocusChanged = onWindowFocusChangedCallback;
- activity->callbacks->onNativeWindowCreated = onNativeWindowCreatedCallback;
- activity->callbacks->onNativeWindowResized = onNativeWindowResizedCallback;
- activity->callbacks->onNativeWindowRedrawNeeded = onNativeWindowRedrawNeededCallback;
- activity->callbacks->onNativeWindowDestroyed = onNativeWindowDestroyedCallback;
- activity->callbacks->onInputQueueCreated = onInputQueueCreatedCallback;
- activity->callbacks->onInputQueueDestroyed = onInputQueueDestroyedCallback;
- activity->callbacks->onContentRectChanged = onContentRectChangedCallback;
- activity->callbacks->onConfigurationChanged = onConfigurationChangedCallback;
- activity->callbacks->onLowMemory = onLowMemoryCallback;
+ if (activity) {
+ activity->instance = (void*)this;
+ activity->callbacks->onStart = onStartCallback;
+ activity->callbacks->onResume = onResumeCallback;
+ activity->callbacks->onSaveInstanceState = onSaveInstanceStateCallback;
+ activity->callbacks->onPause = onPauseCallback;
+ activity->callbacks->onStop = onStopCallback;
+ activity->callbacks->onDestroy = onDestroyCallback;
+ activity->callbacks->onWindowFocusChanged = onWindowFocusChangedCallback;
+ activity->callbacks->onNativeWindowCreated = onNativeWindowCreatedCallback;
+ activity->callbacks->onNativeWindowResized = onNativeWindowResizedCallback;
+ activity->callbacks->onNativeWindowRedrawNeeded = onNativeWindowRedrawNeededCallback;
+ activity->callbacks->onNativeWindowDestroyed = onNativeWindowDestroyedCallback;
+ activity->callbacks->onInputQueueCreated = onInputQueueCreatedCallback;
+ activity->callbacks->onInputQueueDestroyed = onInputQueueDestroyedCallback;
+ activity->callbacks->onContentRectChanged = onContentRectChangedCallback;
+ activity->callbacks->onConfigurationChanged = onConfigurationChangedCallback;
+ activity->callbacks->onLowMemory = onLowMemoryCallback;
+ }
}
NativeActivity::~NativeActivity (void)
diff --git a/framework/platform/android/tcuAndroidPlatform.cpp b/framework/platform/android/tcuAndroidPlatform.cpp
index 69ab384..d7288f6 100644
--- a/framework/platform/android/tcuAndroidPlatform.cpp
+++ b/framework/platform/android/tcuAndroidPlatform.cpp
@@ -22,6 +22,7 @@
*//*--------------------------------------------------------------------*/
#include "tcuAndroidPlatform.hpp"
+#include "tcuAndroidNativeActivity.hpp"
#include "tcuAndroidUtil.hpp"
#include "gluRenderContext.hpp"
#include "egluNativeDisplay.hpp"
@@ -170,7 +171,7 @@ eglu::NativeWindow* NativeWindowFactory::createWindow (const eglu::WindowParams&
Window* window = m_windowRegistry.tryAcquireWindow();
if (!window)
- throw ResourceError("Native window is not available", DE_NULL, __FILE__, __LINE__);
+ throw NotSupportedError("Native window is not available", DE_NULL, __FILE__, __LINE__);
return new NativeWindow(window, params.width, params.height, format);
}
@@ -286,6 +287,9 @@ static size_t getTotalSystemMemory (ANativeActivity* activity)
try
{
+ if (!activity)
+ throw tcu::InternalError("No activity (running from command line?");
+
const size_t totalMemory = getTotalAndroidSystemMemory(activity);
print("Device has %.2f MiB of system memory\n", static_cast<double>(totalMemory) / static_cast<double>(MiB));
return totalMemory;
@@ -382,3 +386,9 @@ bool Platform::hasDisplay (vk::wsi::Type wsiType) const
} // Android
} // tcu
+
+tcu::Platform* createPlatform (void)
+{
+ tcu::Android::NativeActivity activity(NULL);
+ return new tcu::Android::Platform(activity);
+}
--
2.39.1

View File

@@ -0,0 +1,161 @@
From 6d99990e93869e361035b7c06c05183041dec8b4 Mon Sep 17 00:00:00 2001
From: Ricardo Garcia <rgarcia@igalia.com>
Date: Mon, 20 Feb 2023 13:57:53 +0100
Subject: [PATCH] Fix build for the surfaceless and null-WS target platforms
Both platforms should not be considered for building Vulkan Video, which
is only available in the normal Linux and Win32 targets, and their
createLibrary platform methods do not take a library type argument.
No test results should be affected by these changes.
Components: Framework
VK-GL-CTS issue: 4295
Change-Id: I4de5b42685899099a9cfcf7da64fe299fef61ffc
---
external/vulkancts/framework/vulkan/vkPlatform.hpp | 2 +-
.../vulkancts/modules/vulkan/api/vktApiVersionCheck.cpp | 2 +-
external/vulkancts/modules/vulkan/video/CMakeLists.txt | 2 +-
.../modules/vulkan/video/vktVideoSessionNvUtils.cpp | 2 +-
external/vulkancts/modules/vulkan/vktTestPackage.cpp | 2 +-
external/vulkancts/vkscpc/vkscpc.cpp | 2 +-
external/vulkancts/vkscserver/vksServices.cpp | 2 +-
framework/delibs/debase/deDefs.h | 6 ++++++
framework/platform/CMakeLists.txt | 1 +
targets/nullws/nullws.cmake | 1 +
10 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/external/vulkancts/framework/vulkan/vkPlatform.hpp b/external/vulkancts/framework/vulkan/vkPlatform.hpp
index bec39d326..7574166b9 100644
--- a/external/vulkancts/framework/vulkan/vkPlatform.hpp
+++ b/external/vulkancts/framework/vulkan/vkPlatform.hpp
@@ -399,7 +399,7 @@ public:
Platform (void) {}
~Platform (void) {}
-#if (DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_UNIX)
+#ifdef DE_PLATFORM_USE_LIBRARY_TYPE
virtual Library* createLibrary (LibraryType libraryType = LIBRARY_TYPE_VULKAN, const char* libraryPath = DE_NULL) const = 0;
#else
virtual Library* createLibrary (const char* libraryPath = DE_NULL) const = 0;
diff --git a/external/vulkancts/modules/vulkan/api/vktApiVersionCheck.cpp b/external/vulkancts/modules/vulkan/api/vktApiVersionCheck.cpp
index 5f6d884f4..af6bf6938 100644
--- a/external/vulkancts/modules/vulkan/api/vktApiVersionCheck.cpp
+++ b/external/vulkancts/modules/vulkan/api/vktApiVersionCheck.cpp
@@ -133,7 +133,7 @@ public:
tcu::TestLog& log = m_context.getTestContext().getLog();
const deUint32 apiVersion = m_context.getUsedApiVersion();
const vk::Platform& platform = m_context.getTestContext().getPlatform().getVulkanPlatform();
-#if (DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_UNIX)
+#ifdef DE_PLATFORM_USE_LIBRARY_TYPE
de::MovePtr<vk::Library> vkLibrary = de::MovePtr<vk::Library>(platform.createLibrary(vk::Platform::LibraryType::LIBRARY_TYPE_VULKAN, m_context.getTestContext().getCommandLine().getVkLibraryPath()));
#else
de::MovePtr<vk::Library> vkLibrary = de::MovePtr<vk::Library>(platform.createLibrary(m_context.getTestContext().getCommandLine().getVkLibraryPath()));
diff --git a/external/vulkancts/modules/vulkan/video/CMakeLists.txt b/external/vulkancts/modules/vulkan/video/CMakeLists.txt
index 464adb1e2..f9a2044e7 100644
--- a/external/vulkancts/modules/vulkan/video/CMakeLists.txt
+++ b/external/vulkancts/modules/vulkan/video/CMakeLists.txt
@@ -1,5 +1,5 @@
include_directories(..)
-if (DE_OS_IS_WIN32 OR DE_OS_IS_UNIX)
+if ((DE_OS_IS_WIN32 OR DE_OS_IS_UNIX) AND NOT DEQP_USE_SURFACELESS AND NOT DEQP_USE_NULLWS)
include_directories(${FFMPEG_INCLUDE_PATH})
add_compile_definitions(DE_BUILD_VIDEO)
endif()
diff --git a/external/vulkancts/modules/vulkan/video/vktVideoSessionNvUtils.cpp b/external/vulkancts/modules/vulkan/video/vktVideoSessionNvUtils.cpp
index 00491930c..9323278be 100644
--- a/external/vulkancts/modules/vulkan/video/vktVideoSessionNvUtils.cpp
+++ b/external/vulkancts/modules/vulkan/video/vktVideoSessionNvUtils.cpp
@@ -148,7 +148,7 @@ private:
};
NvFunctions::NvFunctions (const vk::Platform& platform)
-#ifdef DE_BUILD_VIDEO
+#ifdef DE_PLATFORM_USE_LIBRARY_TYPE
: m_library (de::MovePtr<vk::Library>(platform.createLibrary(vk::Platform::LIBRARY_TYPE_VULKAN_VIDEO_DECODE_PARSER, DE_NULL)))
#else
: m_library (de::MovePtr<vk::Library>(platform.createLibrary()))
diff --git a/external/vulkancts/modules/vulkan/vktTestPackage.cpp b/external/vulkancts/modules/vulkan/vktTestPackage.cpp
index 959a9d368..cac454c71 100644
--- a/external/vulkancts/modules/vulkan/vktTestPackage.cpp
+++ b/external/vulkancts/modules/vulkan/vktTestPackage.cpp
@@ -204,7 +204,7 @@ static void restoreStandardOutput () { qpRedirectOut(openWrite, open
static MovePtr<vk::Library> createLibrary (tcu::TestContext& testCtx)
{
-#if (DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_UNIX)
+#ifdef DE_PLATFORM_USE_LIBRARY_TYPE
return MovePtr<vk::Library>(testCtx.getPlatform().getVulkanPlatform().createLibrary(vk::Platform::LIBRARY_TYPE_VULKAN, testCtx.getCommandLine().getVkLibraryPath()));
#else
return MovePtr<vk::Library>(testCtx.getPlatform().getVulkanPlatform().createLibrary(testCtx.getCommandLine().getVkLibraryPath()));
diff --git a/external/vulkancts/vkscpc/vkscpc.cpp b/external/vulkancts/vkscpc/vkscpc.cpp
index 55b5665c8..91725633a 100644
--- a/external/vulkancts/vkscpc/vkscpc.cpp
+++ b/external/vulkancts/vkscpc/vkscpc.cpp
@@ -288,7 +288,7 @@ int main (int argc, char** argv)
tcu::DirArchive archive {""};
tcu::TestLog log { cmdLine.getOption<opt::LogFile>().c_str() }; log.supressLogging(true);
de::SharedPtr<tcu::Platform> platform {createPlatform()};
-#if (DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_UNIX)
+#ifdef DE_PLATFORM_USE_LIBRARY_TYPE
de::SharedPtr<vk::Library> library {platform->getVulkanPlatform().createLibrary(vk::Platform::LIBRARY_TYPE_VULKAN, DE_NULL)};
#else
de::SharedPtr<vk::Library> library {platform->getVulkanPlatform().createLibrary(DE_NULL)};
diff --git a/external/vulkancts/vkscserver/vksServices.cpp b/external/vulkancts/vkscserver/vksServices.cpp
index 461c7a349..fe1160edc 100644
--- a/external/vulkancts/vkscserver/vksServices.cpp
+++ b/external/vulkancts/vkscserver/vksServices.cpp
@@ -163,7 +163,7 @@ VkscServer* createServerVKSC(const std::string& logFile)
tcu::DirArchive archive {""};
tcu::TestLog log { logFile.c_str() }; log.supressLogging(true);
tcu::Platform* platform {createPlatform()};
-#if (DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_UNIX)
+#ifdef DE_PLATFORM_USE_LIBRARY_TYPE
vk::Library* library {platform->getVulkanPlatform().createLibrary(vk::Platform::LIBRARY_TYPE_VULKAN, DE_NULL)};
#else
vk::Library* library {platform->getVulkanPlatform().createLibrary(DE_NULL)};
diff --git a/framework/delibs/debase/deDefs.h b/framework/delibs/debase/deDefs.h
index 39cd65d0b..2885fe5c5 100644
--- a/framework/delibs/debase/deDefs.h
+++ b/framework/delibs/debase/deDefs.h
@@ -101,6 +101,12 @@
# error Unknown operating system.
#endif
+#if ((DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_UNIX)) && !defined(DEQP_SURFACELESS) && !defined(NULLWS)
+# define DE_PLATFORM_USE_LIBRARY_TYPE 1
+#else
+# undef DE_PLATFORM_USE_LIBRARY_TYPE
+#endif
+
/* CPUs */
#define DE_CPU_VANILLA 0
#define DE_CPU_X86 1
diff --git a/framework/platform/CMakeLists.txt b/framework/platform/CMakeLists.txt
index 00c53e3c9..b2a1d57b6 100644
--- a/framework/platform/CMakeLists.txt
+++ b/framework/platform/CMakeLists.txt
@@ -113,6 +113,7 @@ if (NOT DEFINED TCUTIL_PLATFORM_SRCS)
endif()
elseif (DE_OS_IS_UNIX AND DEQP_USE_SURFACELESS)
+ add_definitions(-DDEQP_SURFACELESS=1)
set(TCUTIL_PLATFORM_SRCS
surfaceless/tcuSurfacelessPlatform.hpp
surfaceless/tcuSurfacelessPlatform.cpp
diff --git a/targets/nullws/nullws.cmake b/targets/nullws/nullws.cmake
index 81a7f9ea2..5f6f9b773 100644
--- a/targets/nullws/nullws.cmake
+++ b/targets/nullws/nullws.cmake
@@ -1,6 +1,7 @@
message("*** Using nullws target")
set(DEQP_TARGET_NAME "nullws")
+set(DEQP_USE_NULLWS ON)
add_definitions(-DNULLWS)
find_library(GLES2_LIBRARY NAMES libGLESv2 GLESv2)
--
2.39.1

View File

@@ -0,0 +1,27 @@
From c2d5252f4a8be94720235feb9e358ecb0a2e8e11 Mon Sep 17 00:00:00 2001
From: Helen Koike <helen.koike@collabora.com>
Date: Tue, 27 Sep 2022 12:35:22 -0300
Subject: [PATCH 2/2] Android prints to stdout instead of logcat
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
---
framework/qphelper/qpDebugOut.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/framework/qphelper/qpDebugOut.c b/framework/qphelper/qpDebugOut.c
index 6579e9f..c200c6f 100644
--- a/framework/qphelper/qpDebugOut.c
+++ b/framework/qphelper/qpDebugOut.c
@@ -98,7 +98,7 @@ void qpDiev (const char* format, va_list args)
}
/* print() implementation. */
-#if (DE_OS == DE_OS_ANDROID)
+#if (0)
#include <android/log.h>
--
2.39.1

View File

@@ -0,0 +1,72 @@
#!/bin/bash
# shellcheck disable=SC2086 # we want word splitting
set -e
set -o xtrace
EPHEMERAL="
autoconf
automake
bzip2
cmake
git
libtool
libepoxy-dev
libtbb-dev
make
openssl-dev
unzip
xz
zstd-dev
"
apk add \
bash \
bison \
ccache \
clang-dev \
coreutils \
curl \
flex \
gcc \
g++ \
gettext \
glslang \
linux-headers \
llvm15-dev \
meson \
expat-dev \
elfutils-dev \
libselinux-dev \
libva-dev \
libpciaccess-dev \
zlib-dev \
python3-dev \
py3-mako \
py3-ply \
vulkan-headers \
spirv-tools-dev \
util-macros \
$EPHEMERAL
. .gitlab-ci/container/container_pre_build.sh
. .gitlab-ci/container/build-libdrm.sh
. .gitlab-ci/container/build-wayland.sh
pushd /usr/local
git clone https://gitlab.freedesktop.org/mesa/shader-db.git --depth 1
rm -rf shader-db/.git
cd shader-db
make
popd
############### Uninstall the build software
apk del $EPHEMERAL
. .gitlab-ci/container/container_post_build.sh

View File

@@ -1,6 +1,12 @@
CONFIG_LOCALVERSION_AUTO=y
CONFIG_DEBUG_KERNEL=y
CONFIG_CRYPTO_ZSTD=y
CONFIG_ZRAM_MEMORY_TRACKING=y
CONFIG_ZRAM_WRITEBACK=y
CONFIG_ZRAM=y
CONFIG_ZSMALLOC_STAT=y
# abootimg with a 'dummy' rootfs fails with root=/dev/nfs
CONFIG_BLK_DEV_INITRD=n

View File

@@ -1,6 +1,12 @@
CONFIG_LOCALVERSION_AUTO=y
CONFIG_DEBUG_KERNEL=y
CONFIG_CRYPTO_ZSTD=y
CONFIG_ZRAM_MEMORY_TRACKING=y
CONFIG_ZRAM_WRITEBACK=y
CONFIG_ZRAM=y
CONFIG_ZSMALLOC_STAT=y
# abootimg with a 'dummy' rootfs fails with root=/dev/nfs
CONFIG_BLK_DEV_INITRD=n
@@ -40,6 +46,7 @@ CONFIG_OF=y
CONFIG_QCOM_COMMAND_DB=y
CONFIG_QCOM_RPMHPD=y
CONFIG_QCOM_RPMPD=y
CONFIG_QCOM_OCMEM=y
CONFIG_SDM_GPUCC_845=y
CONFIG_SDM_VIDEOCC_845=y
CONFIG_SDM_DISPCC_845=y
@@ -60,6 +67,7 @@ CONFIG_POWER_RESET_QCOM_PON=y
CONFIG_RTC_DRV_PM8XXX=y
CONFIG_INTERCONNECT=y
CONFIG_INTERCONNECT_QCOM=y
CONFIG_INTERCONNECT_QCOM_MSM8996=y
CONFIG_INTERCONNECT_QCOM_SDM845=y
CONFIG_INTERCONNECT_QCOM_MSM8916=y
CONFIG_INTERCONNECT_QCOM_OSM_L3=y
@@ -67,11 +75,16 @@ CONFIG_INTERCONNECT_QCOM_SC7180=y
CONFIG_CRYPTO_DEV_QCOM_RNG=y
CONFIG_SC_DISPCC_7180=y
CONFIG_SC_GPUCC_7180=y
CONFIG_QCOM_SPMI_ADC5=y
CONFIG_DRM_PARADE_PS8640=y
CONFIG_PHY_QCOM_USB_HS=y
# db410c ethernet
CONFIG_USB_RTL8152=y
# db820c ethernet
CONFIG_ATL1C=y
# Chromebooks ethernet
CONFIG_USB_ONBOARD_HUB=y
CONFIG_ARCH_ALPINE=n
CONFIG_ARCH_BCM2835=n

View File

@@ -7,13 +7,14 @@ set -o xtrace
# network transfer, disk usage, and runtime on test jobs)
# shellcheck disable=SC2154 # arch is assigned in previous scripts
if wget -q --method=HEAD "${ARTIFACTS_PREFIX}/${FDO_UPSTREAM_REPO}/${ARTIFACTS_SUFFIX}/${arch}/done"; then
if curl -X HEAD -s "${ARTIFACTS_PREFIX}/${FDO_UPSTREAM_REPO}/${ARTIFACTS_SUFFIX}/${arch}/done"; then
ARTIFACTS_URL="${ARTIFACTS_PREFIX}/${FDO_UPSTREAM_REPO}/${ARTIFACTS_SUFFIX}/${arch}"
else
ARTIFACTS_URL="${ARTIFACTS_PREFIX}/${CI_PROJECT_PATH}/${ARTIFACTS_SUFFIX}/${arch}"
fi
wget "${ARTIFACTS_URL}"/lava-rootfs.tar.zst -O rootfs.tar.zst
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
"${ARTIFACTS_URL}"/lava-rootfs.tar.zst -o rootfs.tar.zst
mkdir -p /rootfs-"$arch"
tar -C /rootfs-"$arch" '--exclude=./dev/*' --zstd -xf rootfs.tar.zst
rm rootfs.tar.zst
@@ -22,9 +23,12 @@ if [[ $arch == "arm64" ]]; then
mkdir -p /baremetal-files
pushd /baremetal-files
wget "${ARTIFACTS_URL}"/Image
wget "${ARTIFACTS_URL}"/Image.gz
wget "${ARTIFACTS_URL}"/cheza-kernel
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O "${ARTIFACTS_URL}"/Image
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O "${ARTIFACTS_URL}"/Image.gz
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O "${ARTIFACTS_URL}"/cheza-kernel
DEVICE_TREES=""
DEVICE_TREES="$DEVICE_TREES apq8016-sbc.dtb"
@@ -33,7 +37,8 @@ if [[ $arch == "arm64" ]]; then
DEVICE_TREES="$DEVICE_TREES imx8mq-nitrogen.dtb"
for DTB in $DEVICE_TREES; do
wget "${ARTIFACTS_URL}/$DTB"
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O "${ARTIFACTS_URL}/$DTB"
done
popd
@@ -41,14 +46,16 @@ elif [[ $arch == "armhf" ]]; then
mkdir -p /baremetal-files
pushd /baremetal-files
wget "${ARTIFACTS_URL}"/zImage
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O "${ARTIFACTS_URL}"/zImage
DEVICE_TREES=""
DEVICE_TREES="$DEVICE_TREES imx6q-cubox-i.dtb"
DEVICE_TREES="$DEVICE_TREES tegra124-jetson-tk1.dtb"
for DTB in $DEVICE_TREES; do
wget "${ARTIFACTS_URL}/$DTB"
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O "${ARTIFACTS_URL}/$DTB"
done
popd

View File

@@ -6,26 +6,26 @@ set -ex
git config --global user.email "mesa@example.com"
git config --global user.name "Mesa CI"
CROSVM_VERSION=acd262cb42111c53b580a67355e795775545cced
CROSVM_VERSION=00af43e1b565e1ae0047ba84b970da5e089e4f48
git clone --single-branch -b main --no-checkout https://chromium.googlesource.com/crosvm/crosvm /platform/crosvm
pushd /platform/crosvm
git checkout "$CROSVM_VERSION"
git submodule update --init
VIRGLRENDERER_VERSION=3c5a9bbb7464e0e91e446991055300f4f989f6a9
VIRGLRENDERER_VERSION=fc2ad36998f8af8ea3cc68fb9c747dfec9cb4635
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/ -Drender-server=true -Drender-server-worker=process -Dvenus-experimental=true $EXTRA_MESON_ARGS
meson build/ -Drender-server-worker=process -Dvenus-experimental=true $EXTRA_MESON_ARGS
ninja -C build install
popd
RUSTFLAGS='-L native=/usr/local/lib' cargo install \
bindgen \
bindgen-cli \
-j ${FDO_CI_CONCURRENT:-4} \
--root /usr/local \
--version 0.60.1 \
--version 0.63.0 \
$EXTRA_CARGO_ARGS
RUSTFLAGS='-L native=/usr/local/lib' cargo install \

View File

@@ -16,13 +16,38 @@ if [ -n "${DEQP_RUNNER_GIT_TAG}${DEQP_RUNNER_GIT_REV}" ]; then
DEQP_RUNNER_CARGO_ARGS="${DEQP_RUNNER_CARGO_ARGS} ${EXTRA_CARGO_ARGS}"
else
# Install from package registry
DEQP_RUNNER_CARGO_ARGS="--version 0.15.0 ${EXTRA_CARGO_ARGS} -- deqp-runner"
DEQP_RUNNER_CARGO_ARGS="--version 0.16.0 ${EXTRA_CARGO_ARGS} -- deqp-runner"
fi
cargo install --locked \
-j ${FDO_CI_CONCURRENT:-4} \
--root /usr/local \
${DEQP_RUNNER_CARGO_ARGS}
if [ -z "$ANDROID_NDK_HOME" ]; then
cargo install --locked \
-j ${FDO_CI_CONCURRENT:-4} \
--root /usr/local \
${DEQP_RUNNER_CARGO_ARGS}
else
mkdir -p /deqp-runner
pushd /deqp-runner
git clone --branch v0.16.1 --depth 1 https://gitlab.freedesktop.org/anholt/deqp-runner.git deqp-runner-git
pushd deqp-runner-git
cargo install --locked \
-j ${FDO_CI_CONCURRENT:-4} \
--root /usr/local --version 2.10.0 \
cargo-ndk
rustup target add x86_64-linux-android
RUSTFLAGS='-C target-feature=+crt-static' cargo ndk --target x86_64-linux-android build
mv target/x86_64-linux-android/debug/deqp-runner /deqp-runner
cargo uninstall --locked \
--root /usr/local \
cargo-ndk
popd
rm -rf deqp-runner-git
popd
fi
# remove unused test runners to shrink images for the Mesa CI build (not kernel,
# which chooses its own deqp branch)

View File

@@ -7,17 +7,25 @@ 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.3.3.0 \
-b vulkan-cts-1.3.5.0 \
--depth 1 \
/VK-GL-CTS
pushd /VK-GL-CTS
# Apply a patch to update zlib link to an available version.
# vulkan-cts-1.3.3.0 uses zlib 1.2.12 which was removed from zlib server due to
# a CVE. See https://zlib.net/
# FIXME: Remove this patch when uprev to 1.3.4.0+
wget -O- https://github.com/KhronosGroup/VK-GL-CTS/commit/6bb2e7d64261bedb503947b1b251b1eeeb49be73.patch |
git am -
cts_commits_to_backport=()
for commit in "${cts_commits_to_backport[@]}"
do
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
"https://github.com/KhronosGroup/VK-GL-CTS/commit/$commit.patch" | git am -
done
# Fix surfaceless build.
git am < $OLDPWD/.gitlab-ci/container/0001-Fix-build-for-the-surfaceless-and-null-WS-target-pla.patch
# Android specific patches.
git am < $OLDPWD/.gitlab-ci/container/0001-Allow-running-on-Android-from-the-command-line.patch
git am < $OLDPWD/.gitlab-ci/container/0002-Android-prints-to-stdout-instead-of-logcat.patch
# --insecure is due to SSL cert failures hitting sourceforge for zlib and
# libpng (sigh). The archives get their checksums checked anyway, and git
@@ -31,15 +39,24 @@ cp doc/testlog-stylesheet/testlog.{css,xsl} /deqp
popd
pushd /deqp
# When including EGL/X11 testing, do that build first and save off its
# deqp-egl binary.
cmake -S /VK-GL-CTS -B . -G Ninja \
-DDEQP_TARGET=x11_egl_glx \
-DCMAKE_BUILD_TYPE=Release \
$EXTRA_CMAKE_ARGS
ninja modules/egl/deqp-egl
cp /deqp/modules/egl/deqp-egl /deqp/modules/egl/deqp-egl-x11
if [ "${DEQP_TARGET}" != 'android' ]; then
# When including EGL/X11 testing, do that build first and save off its
# deqp-egl binary.
cmake -S /VK-GL-CTS -B . -G Ninja \
-DDEQP_TARGET=x11_egl_glx \
-DCMAKE_BUILD_TYPE=Release \
$EXTRA_CMAKE_ARGS
ninja modules/egl/deqp-egl
cp /deqp/modules/egl/deqp-egl /deqp/modules/egl/deqp-egl-x11
cmake -S /VK-GL-CTS -B . -G Ninja \
-DDEQP_TARGET=wayland \
-DCMAKE_BUILD_TYPE=Release \
$EXTRA_CMAKE_ARGS
ninja modules/egl/deqp-egl
cp /deqp/modules/egl/deqp-egl /deqp/modules/egl/deqp-egl-wayland
fi
cmake -S /VK-GL-CTS -B . -G Ninja \
-DDEQP_TARGET=${DEQP_TARGET:-x11_glx} \
@@ -47,7 +64,9 @@ cmake -S /VK-GL-CTS -B . -G Ninja \
$EXTRA_CMAKE_ARGS
ninja
mv /deqp/modules/egl/deqp-egl-x11 /deqp/modules/egl/deqp-egl
if [ "${DEQP_TARGET}" != 'android' ]; then
mv /deqp/modules/egl/deqp-egl-x11 /deqp/modules/egl/deqp-egl
fi
# Copy out the mustpass lists we want.
mkdir /deqp/mustpass
@@ -56,28 +75,30 @@ for mustpass in $(< /VK-GL-CTS/external/vulkancts/mustpass/main/vk-default.txt)
>> /deqp/mustpass/vk-master.txt
done
cp \
/deqp/external/openglcts/modules/gl_cts/data/mustpass/gles/aosp_mustpass/3.2.6.x/*.txt \
/deqp/mustpass/.
cp \
/deqp/external/openglcts/modules/gl_cts/data/mustpass/egl/aosp_mustpass/3.2.6.x/egl-master.txt \
/deqp/mustpass/.
cp \
/deqp/external/openglcts/modules/gl_cts/data/mustpass/gles/khronos_mustpass/3.2.6.x/*-master.txt \
/deqp/mustpass/.
cp \
/deqp/external/openglcts/modules/gl_cts/data/mustpass/gl/khronos_mustpass/4.6.1.x/*-master.txt \
/deqp/mustpass/.
cp \
/deqp/external/openglcts/modules/gl_cts/data/mustpass/gl/khronos_mustpass_single/4.6.1.x/*-single.txt \
/deqp/mustpass/.
if [ "${DEQP_TARGET}" != 'android' ]; then
cp \
/deqp/external/openglcts/modules/gl_cts/data/mustpass/gles/aosp_mustpass/3.2.6.x/*.txt \
/deqp/mustpass/.
cp \
/deqp/external/openglcts/modules/gl_cts/data/mustpass/egl/aosp_mustpass/3.2.6.x/egl-master.txt \
/deqp/mustpass/.
cp \
/deqp/external/openglcts/modules/gl_cts/data/mustpass/gles/khronos_mustpass/3.2.6.x/*-master.txt \
/deqp/mustpass/.
cp \
/deqp/external/openglcts/modules/gl_cts/data/mustpass/gl/khronos_mustpass/4.6.1.x/*-master.txt \
/deqp/mustpass/.
cp \
/deqp/external/openglcts/modules/gl_cts/data/mustpass/gl/khronos_mustpass_single/4.6.1.x/*-single.txt \
/deqp/mustpass/.
# Save *some* executor utils, but otherwise strip things down
# to reduct deqp build size:
mkdir /deqp/executor.save
cp /deqp/executor/testlog-to-* /deqp/executor.save
rm -rf /deqp/executor
mv /deqp/executor.save /deqp/executor
# Save *some* executor utils, but otherwise strip things down
# to reduct deqp build size:
mkdir /deqp/executor.save
cp /deqp/executor/testlog-to-* /deqp/executor.save
rm -rf /deqp/executor
mv /deqp/executor.save /deqp/executor
fi
# Remove other mustpass files, since we saved off the ones we wanted to conventient locations above.
rm -rf /deqp/external/openglcts/modules/gl_cts/data/mustpass

View File

@@ -4,7 +4,8 @@
set -ex
mkdir -p kernel
wget -qO- ${KERNEL_URL} | tar -xj --strip-components=1 -C kernel
curl -L -s --retry 4 -f --retry-all-errors --retry-delay 60 ${KERNEL_URL} \
| tar -xj --strip-components=1 -C kernel
pushd kernel
# The kernel doesn't like the gold linker (or the old lld in our debians).

View File

@@ -5,7 +5,8 @@ set -ex
export LIBDRM_VERSION=libdrm-2.4.110
wget https://dri.freedesktop.org/libdrm/"$LIBDRM_VERSION".tar.xz
curl -L -O --retry 4 -f --retry-all-errors --retry-delay 60 \
https://dri.freedesktop.org/libdrm/"$LIBDRM_VERSION".tar.xz
tar -xvf "$LIBDRM_VERSION".tar.xz && rm "$LIBDRM_VERSION".tar.xz
cd "$LIBDRM_VERSION"
meson build -D vc4=false -D freedreno=false -D etnaviv=false $EXTRA_MESON_ARGS

View File

@@ -2,11 +2,14 @@
set -ex
wget https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v13.0.0.tar.gz
tar -xvf v13.0.0.tar.gz && rm v13.0.0.tar.gz
VER="13.0.0"
mkdir SPIRV-LLVM-Translator-13.0.0/build
pushd SPIRV-LLVM-Translator-13.0.0/build
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O "https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${VER}.tar.gz"
tar -xvf "v${VER}.tar.gz" && rm "v${VER}.tar.gz"
mkdir "SPIRV-LLVM-Translator-${VER}/build"
pushd "SPIRV-LLVM-Translator-${VER}/build"
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
ninja
ninja install
@@ -15,5 +18,5 @@ ninja llvm-spirv
cp tools/llvm-spirv/llvm-spirv /usr/bin/
popd
du -sh SPIRV-LLVM-Translator-13.0.0
rm -rf SPIRV-LLVM-Translator-13.0.0
du -sh "SPIRV-LLVM-Translator-${VER}"
rm -rf "SPIRV-LLVM-Translator-${VER}"

View File

@@ -1,12 +1,13 @@
#!/bin/bash
#!/usr/bin/env bash
set -ex
MOLD_VERSION="1.6.0"
MOLD_VERSION="1.10.0"
git clone -b v"$MOLD_VERSION" --single-branch --depth 1 https://github.com/rui314/mold.git
cd mold
make
make install
cd ..
pushd mold
cmake -DCMAKE_BUILD_TYPE=Release -D BUILD_TESTING=OFF -D MOLD_LTO=ON
cmake --build . --parallel
cmake --install .
popd
rm -rf mold

View File

@@ -3,9 +3,11 @@
set -ex
REV="355ad6bcb2cb3d9e030b7c6eef2b076b0dfb4d63"
git clone https://gitlab.freedesktop.org/mesa/piglit.git --single-branch --no-checkout /piglit
pushd /piglit
git checkout 591c91865012de4224bea551eac5d2274acf06ad
git checkout "$REV"
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

@@ -20,10 +20,11 @@ RUST_VERSION=1.59.0-2022-02-24
# For rust in Mesa, we use rustup to install. This lets us pick an arbitrary
# version of the compiler, rather than whatever the container's Debian comes
# with.
wget https://sh.rustup.rs -O - | sh -s -- \
--default-toolchain $RUST_VERSION \
--profile minimal \
-y
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
--proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \
--default-toolchain $RUST_VERSION \
--profile minimal \
-y
rustup component add rustfmt

View File

@@ -49,7 +49,7 @@ download_skia_source() {
set -ex
SCRIPT_DIR=$(realpath "$(dirname "$0")")
SKQP_PATCH_DIR="${SCRIPT_DIR}"
SKQP_PATCH_DIR="${SCRIPT_DIR}/patches"
BASE_ARGS_GN_FILE="${SCRIPT_DIR}/build-skqp_base.gn"
SKQP_ARCH=${SKQP_ARCH:-x64}

View File

@@ -2,7 +2,7 @@
set -ex
VKD3D_PROTON_COMMIT="5b73139f182d86cd58a757e4b5f0d4cfad96d319"
VKD3D_PROTON_COMMIT="507cb3195bae32395c69763afec2b1ac078d509a"
VKD3D_PROTON_DST_DIR="/vkd3d-proton-tests"
VKD3D_PROTON_SRC_DIR="/vkd3d-proton-src"

View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -ex
VALIDATION_TAG="v1.3.238"
git clone -b "$VALIDATION_TAG" --single-branch --depth 1 https://github.com/KhronosGroup/Vulkan-ValidationLayers.git
pushd Vulkan-ValidationLayers
mkdir build
pushd build
python3 ../scripts/update_deps.py --dir ../external --arch x64 --config debug
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_TESTS=OFF -DBUILD_WERROR=OFF -C ../external/helper.cmake ..
ninja install
popd
rm -rf Vulkan-ValidationLayers

View File

@@ -1,4 +1,5 @@
#!/bin/bash
# shellcheck disable=SC2086 # we want word splitting
set -ex
@@ -8,7 +9,7 @@ export WAYLAND_PROTOCOLS_VERSION="1.24"
git clone https://gitlab.freedesktop.org/wayland/wayland
cd wayland
git checkout "$LIBWAYLAND_VERSION"
meson -Ddocumentation=false -Ddtd_validation=false -Dlibraries=true _build
meson -Ddocumentation=false -Ddtd_validation=false -Dlibraries=true _build $EXTRA_MESON_ARGS
ninja -C _build install
cd ..
rm -rf wayland
@@ -16,7 +17,7 @@ rm -rf wayland
git clone https://gitlab.freedesktop.org/wayland/wayland-protocols
cd wayland-protocols
git checkout "$WAYLAND_PROTOCOLS_VERSION"
meson _build
meson _build $EXTRA_MESON_ARGS
ninja -C _build install
cd ..
rm -rf wayland-protocols

View File

@@ -7,4 +7,6 @@ fi
# Clean up any build cache for rust.
rm -rf /.cargo
ccache --show-stats
if test -x /usr/bin/ccache; then
ccache --show-stats
fi

View File

@@ -1,22 +1,28 @@
#!/bin/sh
if test -f /etc/debian_version; then
CCACHE_PATH=/usr/lib/ccache
else
CCACHE_PATH=/usr/lib64/ccache
if test -x /usr/bin/ccache; then
if test -f /etc/debian_version; then
CCACHE_PATH=/usr/lib/ccache
elif test -f /etc/alpine-release; then
CCACHE_PATH=/usr/lib/ccache/bin
else
CCACHE_PATH=/usr/lib64/ccache
fi
# Common setup among container builds before we get to building code.
export CCACHE_COMPILERCHECK=content
export CCACHE_COMPRESS=true
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.
export CC="${CCACHE_PATH}/gcc"
export CXX="${CCACHE_PATH}/g++"
ccache --show-stats
fi
# Common setup among container builds before we get to building code.
export CCACHE_COMPILERCHECK=content
export CCACHE_COMPRESS=true
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.
export CC="${CCACHE_PATH}/gcc"
export CXX="${CCACHE_PATH}/g++"
# When not using the mold linker (e.g. unsupported architecture), force
# linkers to gold, since it's so much faster for building. We can't use
# lld because we're on old debian and it's buggy. ming fails meson builds
@@ -25,8 +31,6 @@ find /usr/bin -name \*-ld -o -name ld | \
grep -v mingw | \
xargs -n 1 -I '{}' ln -sf '{}.gold' '{}'
ccache --show-stats
# Make a wrapper script for ninja to always include the -j flags
{
echo '#!/bin/sh -x'
@@ -43,4 +47,6 @@ export MAKEFLAGS="-j${FDO_CI_CONCURRENT:-4}"
echo -e "retry_connrefused = on\n" \
"read_timeout = 300\n" \
"tries = 4\n" \
"retry_on_host_error = on\n" \
"retry_on_http_error = 429,500,502,503,504\n" \
"wait_retry = 32" >> /etc/wgetrc

View File

@@ -5,9 +5,10 @@ arch=$2
cpu_family=$3
cpu=$4
cross_file="/cross_file-$arch.txt"
sdk_version=$5
# armv7 has the toolchain split between two names.
arch2=${5:-$2}
arch2=${6:-$2}
# Note that we disable C++ exceptions, because Mesa doesn't use exceptions,
# and allowing it in code generation means we get unwind symbols that break
@@ -15,21 +16,22 @@ arch2=${5:-$2}
cat > "$cross_file" <<EOF
[binaries]
ar = '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/$arch-ar'
c = ['ccache', '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/${arch2}29-clang', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables']
cpp = ['ccache', '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/${arch2}29-clang++', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables']
ar = '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar'
c = ['ccache', '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/${arch2}${sdk_version}-clang', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables']
cpp = ['ccache', '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/${arch2}${sdk_version}-clang++', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables', '-static-libstdc++']
c_ld = 'lld'
cpp_ld = 'lld'
strip = '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/$arch-strip'
strip = '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip'
pkgconfig = ['/usr/bin/pkg-config']
[host_machine]
system = 'linux'
system = 'android'
cpu_family = '$cpu_family'
cpu = '$cpu'
endian = 'little'
[properties]
needs_exe_wrapper = true
pkg_config_libdir = '/usr/local/lib/${arch2}/pkgconfig/:/${ndk}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/${arch2}/pkgconfig/'
EOF

View File

@@ -10,6 +10,7 @@ pc="$2"
cflags="$3"
libs="$4"
version="$5"
sdk_version="$6"
sysroot=$ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot
@@ -24,7 +25,7 @@ for arch in \
cat >$pcdir/$pc <<EOF
prefix=$sysroot
exec_prefix=$sysroot
libdir=$sysroot/usr/lib/$arch/29
libdir=$sysroot/usr/lib/$arch/$sdk_version
sharedlibdir=$sysroot/usr/lib/$arch
includedir=$sysroot/usr/include
@@ -33,7 +34,7 @@ Description: zlib compression library
Version: $version
Requires:
Libs: -L$sysroot/usr/lib/$arch/29 $libs
Libs: -L$sysroot/usr/lib/$arch/$sdk_version $libs
Cflags: -I$sysroot/usr/include $cflags
EOF
done

View File

@@ -2,19 +2,18 @@
arch=$1
cross_file="/cross_file-$arch.txt"
/usr/share/meson/debcrossgen --arch "$arch" -o "$cross_file"
meson env2mfile --cross --debarch "$arch" -o "$cross_file"
# Explicitly set ccache path for cross compilers
sed -i "s|/usr/bin/\([^-]*\)-linux-gnu\([^-]*\)-g|/usr/lib/ccache/\\1-linux-gnu\\2-g|g" "$cross_file"
if [ "$arch" = "i386" ]; then
# Work around a bug in debcrossgen that should be fixed in the next release
sed -i "s|cpu_family = 'i686'|cpu_family = 'x86'|g" "$cross_file"
fi
# Rely on qemu-user being configured in binfmt_misc on the host
# shellcheck disable=SC1003 # how this sed doesn't seems to work for me locally
sed -i -e '/\[properties\]/a\' -e "needs_exe_wrapper = False" "$cross_file"
# Add a line for rustc, which debcrossgen is missing.
cc=$(sed -n 's|c = .\(.*\).|\1|p' < "$cross_file")
# Add a line for rustc, which meson env2mfile is missing.
cc=$(sed -n "s|^c\s*=\s*\[?'\(.*\)'\]?|\1|p" < "$cross_file")
if [[ "$arch" = "arm64" ]]; then
rust_target=aarch64-unknown-linux-gnu
elif [[ "$arch" = "armhf" ]]; then
@@ -28,6 +27,7 @@ elif [[ "$arch" = "s390x" ]]; then
else
echo "Needs rustc target mapping"
fi
# shellcheck disable=SC1003 # how this sed doesn't seems to work for me locally
sed -i -e '/\[binaries\]/a\' -e "rust = ['rustc', '--target=$rust_target', '-C', 'linker=$cc']" "$cross_file"

View File

@@ -15,7 +15,7 @@ if [ $DEBIAN_ARCH = arm64 ]; then
"
elif [ $DEBIAN_ARCH = amd64 ]; then
# Add llvm 13 to the build image
apt-get -y install --no-install-recommends wget gnupg2 software-properties-common
apt-get -y install --no-install-recommends curl gnupg2 software-properties-common
apt-key add /llvm-snapshot.gpg.key
add-apt-repository "deb https://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-13 main"
# Debian bullseye has older wine 5.0, we want >= 7.0 for traces.
@@ -61,6 +61,7 @@ apt-get -y install --no-install-recommends \
$EXTRA_LOCAL_PACKAGES \
bash \
ca-certificates \
curl \
firmware-realtek \
initramfs-tools \
jq \
@@ -102,9 +103,10 @@ apt-get -y install --no-install-recommends \
sntp \
strace \
waffle-utils \
wget \
weston \
xinit \
xserver-xorg-core \
xwayland \
zstd
@@ -123,7 +125,7 @@ fi
# Needed for ci-fairy, this revision is able to upload files to
# MinIO and doesn't depend on git
pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates@34f4ade99434043f88e164933f570301fd18b125
pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates@ffe4d1b10aab7534489f0c4bbc4c5899df17d3f2
# Needed for manipulation with traces yaml files.
pip3 install yq

View File

@@ -15,9 +15,11 @@ apt-get update
apt-get install -y --no-remove \
$STABLE_EPHEMERAL \
curl \
crossbuild-essential-$arch \
libelf-dev:$arch \
libexpat1-dev:$arch \
libffi-dev:$arch \
libpciaccess-dev:$arch \
libstdc++6:$arch \
libvulkan-dev:$arch \
@@ -35,7 +37,7 @@ apt-get install -y --no-remove \
libxrandr-dev:$arch \
libxshmfence-dev:$arch \
libxxf86vm-dev:$arch \
wget
libwayland-dev:$arch
if [[ $arch != "armhf" ]]; then
# See the list of available architectures in https://apt.llvm.org/bullseye/dists/llvm-toolchain-bullseye-13/main/
@@ -45,12 +47,16 @@ if [[ $arch != "armhf" ]]; then
LLVM=11
fi
# We don't need clang-format for the crossbuilds, but the installed amd64
# package will conflict with libclang. Uninstall clang-format (and its
# problematic dependency) to fix.
apt-get remove -y clang-format-13 libclang-cpp13
# llvm-*-tools:$arch conflicts with python3:amd64. Install dependencies only
# with apt-get, then force-install llvm-*-{dev,tools}:$arch with dpkg to get
# around this.
apt-get install -y --no-remove --no-install-recommends \
libclang-cpp${LLVM}:$arch \
libffi-dev:$arch \
libgcc-s1:$arch \
libtinfo-dev:$arch \
libz3-dev:$arch \
@@ -68,6 +74,8 @@ fi
EXTRA_MESON_ARGS="--cross-file=/cross_file-${arch}.txt -D libdir=lib/$(dpkg-architecture -A $arch -qDEB_TARGET_MULTIARCH)"
. .gitlab-ci/container/build-libdrm.sh
. .gitlab-ci/container/build-wayland.sh
apt-get purge -y \
$STABLE_EPHEMERAL

View File

@@ -12,27 +12,29 @@ EPHEMERAL="\
apt-get install -y --no-remove $EPHEMERAL
# Fetch the NDK and extract just the toolchain we want.
ndk=android-ndk-r21d
wget -O $ndk.zip https://dl.google.com/android/repository/$ndk-linux-x86_64.zip
ndk=$ANDROID_NDK
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-o $ndk.zip https://dl.google.com/android/repository/$ndk-linux.zip
unzip -d / $ndk.zip "$ndk/toolchains/llvm/*"
rm $ndk.zip
# Since it was packed as a zip file, symlinks/hardlinks got turned into
# duplicate files. Turn them into hardlinks to save on container space.
rdfind -makehardlinks true -makeresultsfile false /android-ndk-r21d/
rdfind -makehardlinks true -makeresultsfile false /${ndk}/
# Drop some large tools we won't use in this build.
find /android-ndk-r21d/ -type f | grep -E -i "clang-check|clang-tidy|lldb" | xargs rm -f
find /${ndk}/ -type f | grep -E -i "clang-check|clang-tidy|lldb" | xargs rm -f
sh .gitlab-ci/container/create-android-ndk-pc.sh /$ndk zlib.pc "" "-lz" "1.2.3"
sh .gitlab-ci/container/create-android-ndk-pc.sh /$ndk zlib.pc "" "-lz" "1.2.3" $ANDROID_SDK_VERSION
sh .gitlab-ci/container/create-android-cross-file.sh /$ndk x86_64-linux-android x86_64 x86_64
sh .gitlab-ci/container/create-android-cross-file.sh /$ndk i686-linux-android x86 x86
sh .gitlab-ci/container/create-android-cross-file.sh /$ndk aarch64-linux-android arm armv8
sh .gitlab-ci/container/create-android-cross-file.sh /$ndk arm-linux-androideabi arm armv7hl armv7a-linux-androideabi
sh .gitlab-ci/container/create-android-cross-file.sh /$ndk x86_64-linux-android x86_64 x86_64 $ANDROID_SDK_VERSION
sh .gitlab-ci/container/create-android-cross-file.sh /$ndk i686-linux-android x86 x86 $ANDROID_SDK_VERSION
sh .gitlab-ci/container/create-android-cross-file.sh /$ndk aarch64-linux-android aarch64 armv8 $ANDROID_SDK_VERSION
sh .gitlab-ci/container/create-android-cross-file.sh /$ndk arm-linux-androideabi arm armv7hl $ANDROID_SDK_VERSION armv7a-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.110
wget https://dri.freedesktop.org/libdrm/$LIBDRM_VERSION.tar.xz
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O https://dri.freedesktop.org/libdrm/$LIBDRM_VERSION.tar.xz
tar -xf $LIBDRM_VERSION.tar.xz && rm $LIBDRM_VERSION.tar.xz
for arch in \
@@ -61,7 +63,8 @@ done
rm -rf $LIBDRM_VERSION
export LIBELF_VERSION=libelf-0.8.13
wget https://fossies.org/linux/misc/old/$LIBELF_VERSION.tar.gz
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O https://fossies.org/linux/misc/old/$LIBELF_VERSION.tar.gz
# Not 100% sure who runs the mirror above so be extra careful
if ! echo "4136d7b4c04df68b686570afa26988ac ${LIBELF_VERSION}.tar.gz" | md5sum -c -; then
@@ -87,11 +90,11 @@ for arch in \
ccarch=armv7a-linux-androideabi
fi
export CC=/android-ndk-r21d/toolchains/llvm/prebuilt/linux-x86_64/bin/${arch}-ar
export CC=/android-ndk-r21d/toolchains/llvm/prebuilt/linux-x86_64/bin/${ccarch}29-clang
export CXX=/android-ndk-r21d/toolchains/llvm/prebuilt/linux-x86_64/bin/${ccarch}29-clang++
export LD=/android-ndk-r21d/toolchains/llvm/prebuilt/linux-x86_64/bin/${arch}-ld
export RANLIB=/android-ndk-r21d/toolchains/llvm/prebuilt/linux-x86_64/bin/${arch}-ranlib
export CC=/${ndk}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar
export CC=/${ndk}/toolchains/llvm/prebuilt/linux-x86_64/bin/${ccarch}${ANDROID_SDK_VERSION}-clang
export CXX=/${ndk}/toolchains/llvm/prebuilt/linux-x86_64/bin/${ccarch}${ANDROID_SDK_VERSION}-clang++
export LD=/${ndk}/toolchains/llvm/prebuilt/linux-x86_64/bin/${arch}-ld
export RANLIB=/${ndk}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib
# The configure script doesn't know about android, but doesn't really use the host anyway it
# seems

View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -e
arch=arm64 . .gitlab-ci/container/debian/arm_test.sh

View File

@@ -24,6 +24,7 @@ apt-get -y install \
bison \
ccache \
cmake \
curl \
debootstrap \
fastboot \
flex \
@@ -50,8 +51,9 @@ apt-get -y install \
libxrandr-dev \
libxshmfence-dev \
libxxf86vm-dev \
libwayland-dev \
llvm-11-dev \
meson \
ninja-build \
pkg-config \
python3-mako \
python3-pil \
@@ -59,7 +61,6 @@ apt-get -y install \
python3-requests \
python3-setuptools \
u-boot-tools \
wget \
xz-utils \
zlib1g-dev \
zstd
@@ -68,7 +69,10 @@ apt-get -y install \
apt-get install -y --no-remove -t buster \
android-sdk-ext4-utils
pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates@34f4ade99434043f88e164933f570301fd18b125
pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates@ffe4d1b10aab7534489f0c4bbc4c5899df17d3f2
# We need at least 0.61.4 for proper Rust; 0.62 for modern meson env2mfile
pip3 install meson==0.63.3
arch=armhf
. .gitlab-ci/container/cross_build.sh
@@ -81,6 +85,8 @@ arch=armhf
EXTRA_MESON_ARGS=
. .gitlab-ci/container/build-libdrm.sh
. .gitlab-ci/container/build-wayland.sh
apt-get purge -y $STABLE_EPHEMERAL
. .gitlab-ci/container/container_post_build.sh

View File

@@ -1,4 +1,5 @@
#!/bin/bash
# shellcheck disable=SC2154 # arch is assigned in previous scripts
set -e
set -o xtrace
@@ -10,6 +11,7 @@ apt-get update
apt-get install -y --no-remove \
cpio \
curl \
fastboot \
netcat \
procps \
@@ -18,19 +20,21 @@ apt-get install -y --no-remove \
python3-serial \
rsync \
snmp \
wget \
zstd
# setup SNMPv2 SMI MIB
wget https://raw.githubusercontent.com/net-snmp/net-snmp/master/mibs/SNMPv2-SMI.txt \
-O /usr/share/snmp/mibs/SNMPv2-SMI.txt
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
https://raw.githubusercontent.com/net-snmp/net-snmp/master/mibs/SNMPv2-SMI.txt \
-o /usr/share/snmp/mibs/SNMPv2-SMI.txt
arch=arm64 . .gitlab-ci/container/baremetal_build.sh
arch=armhf . .gitlab-ci/container/baremetal_build.sh
. .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
if [[ "$arch" == "arm64" ]]; then
# This firmware file from Debian bullseye causes hangs
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
"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
fi
mkdir -p /baremetal-files/jetson-nano/boot/
ln -s \

View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -e
arch=armhf . .gitlab-ci/container/debian/arm_test.sh

View File

@@ -27,6 +27,8 @@ apt-get install -y --no-remove \
$STABLE_EPHEMERAL \
bison \
ccache \
curl \
clang-format-13 \
dpkg-cross \
findutils \
flex \
@@ -59,7 +61,7 @@ apt-get install -y --no-remove \
libxshmfence-dev \
libxxf86vm-dev \
make \
meson \
ninja-build \
pkg-config \
python3-mako \
python3-pil \
@@ -67,7 +69,6 @@ apt-get install -y --no-remove \
python3-requests \
qemu-user \
valgrind \
wget \
x11proto-dri2-dev \
x11proto-gl-dev \
x11proto-randr-dev \
@@ -76,10 +77,10 @@ apt-get install -y --no-remove \
zstd
# Needed for ci-fairy, this revision is able to upload files to MinIO
pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates@34f4ade99434043f88e164933f570301fd18b125
pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates@ffe4d1b10aab7534489f0c4bbc4c5899df17d3f2
# We need at least 0.61.4 for proper Rust
pip3 install meson==0.61.5
# We need at least 1.0.0 for proper Rust; 0.62 for modern meson env2mfile
pip3 install meson==1.0.0
. .gitlab-ci/container/build-rust.sh

View File

@@ -17,7 +17,8 @@ mingw-w64-x86_64-zstd-1.5.2-2-any.pkg.tar.zst
for i in $MINGW_PACKET_LIST
do
wget -q https://mirror.msys2.org/mingw/mingw64/$i
curl -L -s --retry 4 -f --retry-all-errors --retry-delay 60 \
-O "https://mirror.msys2.org/mingw/mingw64/$i"
tar xf $i --strip-components=1 -C /usr/x86_64-w64-mingw32/
done
popd

View File

@@ -27,9 +27,8 @@ popd
# Building libva
git clone https://github.com/intel/libva
pushd libva/
# Checking out commit hash with libva-win32 support
# This feature will be released with libva version 2.17
git checkout 2579eb0f77897dc01a02c1e43defc63c40fd2988
# libva-win32 is released with libva version 2.17 (see https://github.com/intel/libva/releases/tag/2.17.0)
git checkout 2.17.0
popd
# libva already has a build dir in their repo, use builddir instead
mkdir -p libva/builddir

View File

@@ -14,7 +14,6 @@ STABLE_EPHEMERAL=" \
bzip2 \
libtool \
libssl-dev \
python3-pip \
"
apt-get update
@@ -43,8 +42,8 @@ apt-get install -y --no-remove \
llvm-13-dev \
llvm-11-dev \
ocl-icd-opencl-dev \
python3-freezegun \
python3-pytest \
python3-pip \
python3-venv \
procps \
spirv-tools \
shellcheck \
@@ -63,7 +62,8 @@ export XORGMACROS_VERSION=util-macros-1.19.0
. .gitlab-ci/container/build-mold.sh
wget $XORG_RELEASES/util/$XORGMACROS_VERSION.tar.bz2
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 -O \
$XORG_RELEASES/util/$XORGMACROS_VERSION.tar.bz2
tar -xvf $XORGMACROS_VERSION.tar.bz2 && rm $XORGMACROS_VERSION.tar.bz2
cd $XORGMACROS_VERSION; ./configure; make install; cd ..
rm -rf $XORGMACROS_VERSION
@@ -92,7 +92,7 @@ ninja install
popd
rm -rf DirectX-Headers
pip3 install git+https://git.lavasoftware.org/lava/lavacli@3db3ddc45e5358908bc6a17448059ea2340492b7
python3 -m pip install -r .gitlab-ci/lava/requirements.txt
# install bindgen
RUSTFLAGS='-L native=/usr/local/lib' cargo install \

View File

@@ -0,0 +1,99 @@
#!/usr/bin/env bash
# The relative paths in this file only become valid at runtime.
# shellcheck disable=SC1091
# shellcheck disable=SC2086 # we want word splitting
set -e
set -o xtrace
export DEBIAN_FRONTEND=noninteractive
# Ephemeral packages (installed for this script and removed again at the end)
STABLE_EPHEMERAL=" \
ccache \
unzip \
dpkg-dev \
build-essential:native \
config-package-dev \
debhelper-compat \
cmake \
ninja-build \
"
apt-get install -y --no-remove --no-install-recommends \
$STABLE_EPHEMERAL \
iproute2
############### Building ...
. .gitlab-ci/container/container_pre_build.sh
############### Downloading NDK for native builds for the guest ...
# Fetch the NDK and extract just the toolchain we want.
ndk=$ANDROID_NDK
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-o $ndk.zip https://dl.google.com/android/repository/$ndk-linux.zip
unzip -d / $ndk.zip
rm $ndk.zip
############### Build dEQP runner
export ANDROID_NDK_HOME=/$ndk
. .gitlab-ci/container/build-rust.sh
. .gitlab-ci/container/build-deqp-runner.sh
rm -rf /root/.cargo
rm -rf /root/.rustup
############### Build dEQP GL
DEQP_TARGET="android" \
EXTRA_CMAKE_ARGS="-DDEQP_TARGET_TOOLCHAIN=ndk-modern -DANDROID_NDK_PATH=/$ndk -DANDROID_ABI=x86_64 -DDE_ANDROID_API=28" \
. .gitlab-ci/container/build-deqp.sh
############### Downloading Cuttlefish resources ...
CUTTLEFISH_VERSION=9082637 # Chosen from https://ci.android.com/builds/branches/aosp-master/grid?
mkdir /cuttlefish
pushd /cuttlefish
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-o aosp_cf_x86_64_phone-img-$CUTTLEFISH_VERSION.zip https://ci.android.com/builds/submitted/$CUTTLEFISH_VERSION/aosp_cf_x86_64_phone-userdebug/latest/raw/aosp_cf_x86_64_phone-img-$CUTTLEFISH_VERSION.zip
unzip aosp_cf_x86_64_phone-img-$CUTTLEFISH_VERSION.zip
rm aosp_cf_x86_64_phone-img-$CUTTLEFISH_VERSION.zip
ls -lhS ./*
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
https://ci.android.com/builds/submitted/$CUTTLEFISH_VERSION/aosp_cf_x86_64_phone-userdebug/latest/raw/cvd-host_package.tar.gz | tar -xzvf-
popd
############### Building and installing Debian package ...
git clone --depth 1 https://github.com/google/android-cuttlefish.git
pushd android-cuttlefish
pushd base
dpkg-buildpackage -uc -us
popd
apt-get install -y ./cuttlefish-base_*.deb
popd
rm -rf android-cuttlefish
addgroup --system kvm
usermod -a -G kvm,cvdnetwork root
############### Uninstall the build software
rm -rf "/${ndk:?}"
ccache --show-stats
apt-get purge -y \
$STABLE_EPHEMERAL
apt-get autoremove -y --purge

View File

@@ -63,6 +63,7 @@ apt-get install -y \
sysvinit-core
apt-get install -y --no-remove \
curl \
git \
git-lfs \
inetutils-syslogd \
@@ -94,7 +95,6 @@ apt-get install -y --no-remove \
socat \
vulkan-tools \
waffle-utils \
wget \
xauth \
xvfb \
zlib1g \
@@ -118,7 +118,7 @@ mkdir -p /lava-files/
# Needed for ci-fairy, this revision is able to upload files to MinIO
# and doesn't depend on git
pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates@34f4ade99434043f88e164933f570301fd18b125
pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates@ffe4d1b10aab7534489f0c4bbc4c5899df17d3f2
# Needed for manipulation with traces yaml files.
pip3 install yq

View File

@@ -25,9 +25,11 @@ STABLE_EPHEMERAL=" \
libudev-dev \
libvulkan-dev \
libwaffle-dev \
libwayland-dev \
libx11-xcb-dev \
libxcb-dri2-0-dev \
libxkbcommon-dev \
libxrandr-dev \
libxrender-dev \
llvm-13-dev \
llvm-11-dev \
@@ -59,14 +61,15 @@ apt-get install -y --no-remove \
python3-lxml \
python3-renderdoc \
python3-simplejson \
spirv-tools
spirv-tools \
weston
. .gitlab-ci/container/container_pre_build.sh
############### Build piglit
PIGLIT_OPTS="-DPIGLIT_BUILD_CL_TESTS=ON -DPIGLIT_BUILD_DMA_BUF_TESTS=ON" . .gitlab-ci/container/build-piglit.sh
PIGLIT_OPTS="-DPIGLIT_BUILD_GLX_TESTS=ON -DPIGLIT_BUILD_CL_TESTS=ON -DPIGLIT_BUILD_DMA_BUF_TESTS=ON" . .gitlab-ci/container/build-piglit.sh
############### Build dEQP GL
@@ -76,6 +79,10 @@ DEQP_TARGET=surfaceless . .gitlab-ci/container/build-deqp.sh
. .gitlab-ci/container/build-apitrace.sh
############### Build validation layer for zink
. .gitlab-ci/container/build-vulkan-validation.sh
############### Uninstall the build software
ccache --show-stats

View File

@@ -45,13 +45,13 @@ STABLE_EPHEMERAL=" \
python3-setuptools \
python3-wheel \
software-properties-common \
wget \
wine64-tools \
xz-utils \
"
apt-get install -y --no-remove --no-install-recommends \
$STABLE_EPHEMERAL \
curl \
libepoxy0 \
libxcb-shm0 \
pciutils \
@@ -66,10 +66,6 @@ apt-key add .gitlab-ci/container/debian/winehq.gpg.key
apt-add-repository https://dl.winehq.org/wine-builds/debian/
apt-get update -q
# Needed for Valve's tracing jobs to collect information about the graphics
# hardware on the test devices.
pip3 install gfxinfo-mupuf==0.0.9
# workaround wine needing 32-bit
# https://bugs.winehq.org/show_bug.cgi?id=53393
apt-get install -y --no-remove wine-stable-amd64 # a requirement for wine-stable
@@ -105,7 +101,7 @@ wine64 \
. .gitlab-ci/container/build-hang-detection.sh
############### Build piglit
############### Build piglit replayer
PIGLIT_BUILD_TARGETS="piglit_replayer" . .gitlab-ci/container/build-piglit.sh

View File

@@ -16,13 +16,11 @@ EPHEMERAL="
pkgconfig(gbm)
pkgconfig(openssl)
unzip
wget
xz
"
dnf install -y --setopt=install_weak_deps=False \
bison \
ccache \
clang-devel \
flex \
gcc \
@@ -31,7 +29,6 @@ dnf install -y --setopt=install_weak_deps=False \
glslang \
kernel-headers \
llvm-devel \
clang-devel \
meson \
"pkgconfig(dri2proto)" \
"pkgconfig(expat)" \
@@ -62,11 +59,10 @@ dnf install -y --setopt=install_weak_deps=False \
"pkgconfig(xshmfence)" \
"pkgconfig(xxf86vm)" \
"pkgconfig(zlib)" \
procps-ng \
python-unversioned-command \
python3-devel \
python3-mako \
python3-devel \
python3-mako \
python3-ply \
vulkan-headers \
spirv-tools-devel \
@@ -82,7 +78,8 @@ export XORG_RELEASES=https://xorg.freedesktop.org/releases/individu
export XORGMACROS_VERSION=util-macros-1.19.0
wget $XORG_RELEASES/util/$XORGMACROS_VERSION.tar.bz2
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O $XORG_RELEASES/util/$XORGMACROS_VERSION.tar.bz2
tar -xvf $XORGMACROS_VERSION.tar.bz2 && rm $XORGMACROS_VERSION.tar.bz2
cd $XORGMACROS_VERSION; ./configure; make install; cd ..
rm -rf $XORGMACROS_VERSION

View File

@@ -174,6 +174,8 @@ debian/android_build:
- .use-debian/x86_build-base
variables:
MESA_IMAGE_TAG: &debian-android_build ${DEBIAN_BUILD_TAG}
ANDROID_SDK_VERSION: 33
ANDROID_NDK: android-ndk-r25b
.use-debian/android_build:
extends:
@@ -189,7 +191,7 @@ debian/android_build:
debian/x86_test-base:
extends: debian/x86_build-base
variables:
KERNEL_URL: &kernel-rootfs-url "https://gitlab.freedesktop.org/gfx-ci/linux/-/archive/v5.19-for-mesa-ci-d4efddaec194/linux-v5.17-for-mesa-ci-b78f7870d97b.tar.bz2"
KERNEL_URL: &kernel-rootfs-url "https://gitlab.freedesktop.org/gfx-ci/linux/-/archive/v6.1-for-mesa-ci-439f86d0051b/linux-v6.1-for-mesa-ci-439f86d0051b.tar.bz2"
MESA_IMAGE_TAG: &debian-x86_test-base ${DEBIAN_BASE_TAG}
.use-debian/x86_test-base:
@@ -213,7 +215,7 @@ debian/x86_test-gl:
- .set-image-base-tag
variables:
MESA_BASE_TAG: *debian-x86_test-base
MESA_IMAGE_PATH: ${DEBIAN_X86_TEST_IMAGE_PATH}
MESA_IMAGE_PATH: ${DEBIAN_X86_TEST_IMAGE_GL_PATH}
MESA_IMAGE_TAG: *debian-x86_test-gl
needs:
- debian/x86_test-gl
@@ -229,11 +231,28 @@ debian/x86_test-vk:
- .set-image-base-tag
variables:
MESA_BASE_TAG: *debian-x86_test-base
MESA_IMAGE_PATH: "debian/x86_test-vk"
MESA_IMAGE_PATH: ${DEBIAN_X86_TEST_IMAGE_VK_PATH}
MESA_IMAGE_TAG: *debian-x86_test-vk
needs:
- debian/x86_test-vk
# Debian 11 based x86 test image for Android
debian/x86_test-android:
extends: .use-debian/x86_test-base
variables:
MESA_IMAGE_TAG: &debian-x86_test-android ${DEBIAN_X86_TEST_ANDROID_TAG}
ANDROID_NDK: android-ndk-r25b
.use-debian/x86_test-android:
extends:
- .set-image-base-tag
variables:
MESA_BASE_TAG: *debian-x86_test-base
MESA_IMAGE_PATH: ${DEBIAN_X86_TEST_ANDROID_IMAGE_PATH}
MESA_IMAGE_TAG: *debian-x86_test-android
needs:
- debian/x86_test-android
# Debian 11 based ARM build image
debian/arm_build:
extends:
@@ -255,13 +274,31 @@ debian/arm_build:
- debian/arm_build
# Fedora 34 based x86 build image
# Alpine based x86 build image
alpine/x86_build:
extends:
- .fdo.container-build@alpine
- .container
variables:
FDO_DISTRIBUTION_VERSION: "3.17"
MESA_IMAGE_TAG: &alpine-x86_build ${ALPINE_X86_BUILD_TAG}
.use-alpine/x86_build:
extends:
- .set-image
variables:
MESA_IMAGE_PATH: "alpine/x86_build"
MESA_IMAGE_TAG: *alpine-x86_build
needs:
- alpine/x86_build
# Fedora 36 based x86 build image
fedora/x86_build:
extends:
- .fdo.container-build@fedora
- .container
variables:
FDO_DISTRIBUTION_VERSION: 34
FDO_DISTRIBUTION_VERSION: 36
MESA_IMAGE_TAG: &fedora-x86_build ${FEDORA_X86_BUILD_TAG}
.use-fedora/x86_build:
@@ -322,30 +359,56 @@ kernel+rootfs_armhf:
MESA_ROOTFS_TAG: *kernel-rootfs
# x86 image with ARM64 & armhf kernel & rootfs for baremetal testing
debian/arm_test:
.debian/arm_test:
extends:
- .fdo.container-build@debian
- .container
# Don't want the .container rules
- .build-rules
needs:
- kernel+rootfs_arm64
- kernel+rootfs_armhf
variables:
FDO_DISTRIBUTION_TAG: "${MESA_IMAGE_TAG}--${MESA_ROOTFS_TAG}--${MESA_ARM_BUILD_TAG}--${MESA_TEMPLATES_COMMIT}"
FDO_DISTRIBUTION_TAG: "${MESA_IMAGE_TAG}--${MESA_ROOTFS_TAG}--${MESA_TEMPLATES_COMMIT}"
ARTIFACTS_PREFIX: "https://${MINIO_HOST}/mesa-lava"
ARTIFACTS_SUFFIX: "${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}
ARTIFACTS_SUFFIX: "${MESA_ROOTFS_TAG}--${MESA_ARTIFACTS_TAG}--${MESA_TEMPLATES_COMMIT}"
MESA_ARTIFACTS_TAG: *debian-arm_build
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}"
debian/armhf_test:
extends:
- .debian/arm_test
needs:
- kernel+rootfs_armhf
variables:
MESA_IMAGE_TAG: &debian-armhf_test ${DEBIAN_BASE_TAG}
debian/arm64_test:
extends:
- .debian/arm_test
needs:
- kernel+rootfs_arm64
variables:
MESA_IMAGE_TAG: &debian-arm64_test ${DEBIAN_BASE_TAG}
.use-debian/arm_test:
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
.use-debian/armhf_test:
image: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${MESA_IMAGE_TAG}--${MESA_ROOTFS_TAG}--${MESA_TEMPLATES_COMMIT}"
extends:
- .use-debian/arm_test
variables:
MESA_IMAGE_PATH: "debian/armhf_test"
MESA_IMAGE_TAG: *debian-armhf_test
needs:
- debian/arm_test
.use-debian/arm64_test:
image: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${MESA_IMAGE_TAG}--${MESA_ROOTFS_TAG}--${MESA_TEMPLATES_COMMIT}"
extends:
- .use-debian/arm_test
variables:
MESA_IMAGE_PATH: "debian/arm64_test"
MESA_IMAGE_TAG: *debian-arm64_test
needs:
- debian/arm_test
@@ -434,6 +497,7 @@ windows_test_vs2019:
MESA_BASE_IMAGE_PATH: *windows_vs_image_path
MESA_BASE_IMAGE_TAG: *windows_vs_image_tag
MESA_BASE_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_BASE_IMAGE_PATH}:${MESA_BASE_IMAGE_TAG}"
timeout: 2h 30m
needs:
- windows_vs2019

View File

@@ -3,7 +3,8 @@
APITRACE_VERSION="11.1"
APITRACE_VERSION_DATE=""
wget "https://github.com/apitrace/apitrace/releases/download/${APITRACE_VERSION}/apitrace-${APITRACE_VERSION}${APITRACE_VERSION_DATE}-win64.7z"
curl -L -O --retry 4 -f --retry-all-errors --retry-delay 60 \
"https://github.com/apitrace/apitrace/releases/download/${APITRACE_VERSION}/apitrace-${APITRACE_VERSION}${APITRACE_VERSION_DATE}-win64.7z"
7zr x "apitrace-${APITRACE_VERSION}${APITRACE_VERSION_DATE}-win64.7z" \
"apitrace-${APITRACE_VERSION}${APITRACE_VERSION_DATE}-win64/bin/apitrace.exe" \
"apitrace-${APITRACE_VERSION}${APITRACE_VERSION_DATE}-win64/bin/d3dretrace.exe"

View File

@@ -5,7 +5,8 @@ set -e
dxvk_install_release() {
local DXVK_VERSION=${1:-"1.10.3"}
wget "https://github.com/doitsujin/dxvk/releases/download/v${DXVK_VERSION}/dxvk-${DXVK_VERSION}.tar.gz"
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O "https://github.com/doitsujin/dxvk/releases/download/v${DXVK_VERSION}/dxvk-${DXVK_VERSION}.tar.gz"
tar xzpf dxvk-"${DXVK_VERSION}".tar.gz
# https://github.com/doitsujin/dxvk/issues/2921
sed -i 's/wine="wine"/wine="wine32"/' "dxvk-${DXVK_VERSION}"/setup_dxvk.sh

View File

@@ -11,7 +11,8 @@ export DEBIAN_FRONTEND=noninteractive
check_minio()
{
MINIO_PATH="${MINIO_HOST}/mesa-lava/$1/${DISTRIBUTION_TAG}/${DEBIAN_ARCH}"
if wget -q --method=HEAD "https://${MINIO_PATH}/done"; then
if curl -L --retry 4 -f --retry-all-errors --retry-delay 60 -s -X HEAD \
"https://${MINIO_PATH}/done"; then
exit
fi
}
@@ -40,7 +41,9 @@ if [[ "$DEBIAN_ARCH" = "arm64" ]]; then
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-r5.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/qcom/sc7180-trogdor-kingoftown-r1.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/mediatek/mt8192-asurada-spherion-r0.dtb"
KERNEL_IMAGE_NAME="Image"
elif [[ "$DEBIAN_ARCH" = "armhf" ]]; then
@@ -83,11 +86,13 @@ fi
apt-get update
apt-get install -y --no-remove \
-o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' \
${ARCH_PACKAGES} \
automake \
bc \
clang \
cmake \
curl \
debootstrap \
git \
glslang-tools \
@@ -109,6 +114,7 @@ apt-get install -y --no-remove \
libx11-xcb-dev \
libxcb-dri2-0-dev \
libxkbcommon-dev \
libwayland-dev \
ninja-build \
patch \
protobuf-compiler \
@@ -118,7 +124,6 @@ apt-get install -y --no-remove \
python3-numpy \
python3-serial \
unzip \
wget \
zstd
@@ -184,7 +189,7 @@ if [[ "$DEBIAN_ARCH" = "arm64" ]] \
fi
############### Build piglit
PIGLIT_OPTS="-DPIGLIT_BUILD_DMA_BUF_TESTS=ON" . .gitlab-ci/container/build-piglit.sh
PIGLIT_OPTS="-DPIGLIT_BUILD_DMA_BUF_TESTS=ON -DPIGLIT_BUILD_GLX_TESTS=ON" . .gitlab-ci/container/build-piglit.sh
mv /piglit /lava-files/rootfs-${DEBIAN_ARCH}/.
############### Build libva tests
@@ -198,6 +203,8 @@ 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/
mkdir -p /lava-files/rootfs-${DEBIAN_ARCH}/usr/local/libexec/
mv /usr/local/libexec/virgl* /lava-files/rootfs-${DEBIAN_ARCH}/usr/local/libexec/
fi
############### Build libdrm
@@ -240,6 +247,7 @@ cp .gitlab-ci/container/debian/winehq.gpg.key /lava-files/rootfs-${DEBIAN_ARCH}/
chroot /lava-files/rootfs-${DEBIAN_ARCH} sh /create-rootfs.sh
rm /lava-files/rootfs-${DEBIAN_ARCH}/{llvm-snapshot,winehq}.gpg.key
rm /lava-files/rootfs-${DEBIAN_ARCH}/create-rootfs.sh
cp /etc/wgetrc /lava-files/rootfs-${DEBIAN_ARCH}/etc/.
############### Install the built libdrm
@@ -267,7 +275,6 @@ popd
. .gitlab-ci/container/container_post_build.sh
############### Upload the files!
ci-fairy minio login --token-file "${CI_JOB_JWT_FILE}"
FILES_TO_UPLOAD="lava-rootfs.tar.zst \
$KERNEL_IMAGE_NAME"
@@ -276,9 +283,9 @@ if [[ -n $DEVICE_TREES ]]; then
fi
for f in $FILES_TO_UPLOAD; do
ci-fairy minio cp /lava-files/$f \
minio://${MINIO_PATH}/$f
ci-fairy s3cp --token-file "${CI_JOB_JWT_FILE}" /lava-files/$f \
https://${MINIO_PATH}/$f
done
touch /lava-files/done
ci-fairy minio cp /lava-files/done minio://${MINIO_PATH}/done
ci-fairy s3cp --token-file "${CI_JOB_JWT_FILE}" /lava-files/done https://${MINIO_PATH}/done

View File

@@ -1,6 +1,12 @@
CONFIG_LOCALVERSION_AUTO=y
CONFIG_DEBUG_KERNEL=y
CONFIG_CRYPTO_ZSTD=y
CONFIG_ZRAM_MEMORY_TRACKING=y
CONFIG_ZRAM_WRITEBACK=y
CONFIG_ZRAM=y
CONFIG_ZSMALLOC_STAT=y
CONFIG_PWM=y
CONFIG_PM_DEVFREQ=y
CONFIG_OF=y

View File

@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
set -e
@@ -13,6 +13,7 @@ mount -t devpts devpts /dev/pts
mount -t tmpfs tmpfs /tmp
. ${VM_TEMP_DIR}/crosvm-env.sh
. ${VM_TEMP_DIR}/setup-test-env.sh
# .gitlab-ci.yml script variable is using relative paths to install directory,
# so change to that dir before running `crosvm-script`
@@ -31,7 +32,7 @@ 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 ${VM_TEMP_DIR}/crosvm-script.sh 2> ${STDERR_FIFO}; echo \$? > ${VM_TEMP_DIR}/exit_code",nofork
system:"stdbuf -eL bash ${VM_TEMP_DIR}/crosvm-script.sh 2> ${STDERR_FIFO}; echo \$? > ${VM_TEMP_DIR}/exit_code",nofork
kill ${DMESG_PID}
wait

View File

@@ -66,9 +66,11 @@ set_vsock_context || { echo "Could not generate crosvm vsock CID" >&2; exit 1; }
echo "Variables passed through:"
SCRIPT_DIR=$(readlink -en "${0%/*}")
${SCRIPT_DIR}/common/generate-env.sh | tee ${VM_TEMP_DIR}/crosvm-env.sh
cp ${SCRIPTS_DIR}/setup-test-env.sh ${VM_TEMP_DIR}/setup-test-env.sh
# Set the crosvm-script as the arguments of the current script
echo "$@" > ${VM_TEMP_DIR}/crosvm-script.sh
echo ". ${VM_TEMP_DIR}/setup-test-env.sh" > ${VM_TEMP_DIR}/crosvm-script.sh
echo "$@" >> ${VM_TEMP_DIR}/crosvm-script.sh
# Setup networking
/usr/sbin/iptables-legacy -w -t nat -A POSTROUTING -o eth0 -j MASQUERADE
@@ -96,7 +98,8 @@ LIBGL_ALWAYS_SOFTWARE=${CROSVM_LIBGL_ALWAYS_SOFTWARE} \
GALLIUM_DRIVER=${CROSVM_GALLIUM_DRIVER} \
VK_ICD_FILENAMES=$CI_PROJECT_DIR/install/share/vulkan/icd.d/${CROSVM_VK_DRIVER}_icd.x86_64.json \
crosvm --no-syslog run \
--gpu "${CROSVM_GPU_ARGS}" -m "${CROSVM_MEMORY:-4096}" -c 2 --disable-sandbox \
--gpu "${CROSVM_GPU_ARGS}" --gpu-render-server "path=/usr/local/libexec/virgl_render_server" \
-m "${CROSVM_MEMORY:-4096}" -c "${CROSVM_CPU:-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" \
-s $VM_SOCKET \

115
.gitlab-ci/cuttlefish-runner.sh Executable file
View File

@@ -0,0 +1,115 @@
#!/usr/bin/env bash
section_start cuttlefish_setup "cuttlefish: setup"
set -xe
export HOME=/cuttlefish
export PATH=$PATH:/cuttlefish/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${CI_PROJECT_DIR}/install/lib/:/cuttlefish/lib64
export EGL_PLATFORM=surfaceless
syslogd
chown root.kvm /dev/kvm
/etc/init.d/cuttlefish-host-resources start
cd /cuttlefish
launch_cvd --verbosity=DEBUG --report_anonymous_usage_stats=n --cpus=8 --memory_mb=8192 --gpu_mode="$ANDROID_GPU_MODE" --daemon --enable_minimal_mode=true --guest_enforce_security=false --use_overlay=false
sleep 1
cd -
adb connect vsock:3:5555
ADB="adb -s vsock:3:5555"
$ADB root
sleep 1
$ADB shell echo Hi from Android
$ADB logcat dEQP:D *:S &
# overlay vendor
OV_TMPFS="/data/overlay-remount"
$ADB shell mkdir -p "$OV_TMPFS"
$ADB shell mount -t tmpfs none "$OV_TMPFS"
$ADB shell mkdir -p "$OV_TMPFS/vendor-upper"
$ADB shell mkdir -p "$OV_TMPFS/vendor-work"
opts="lowerdir=/vendor,upperdir=$OV_TMPFS/vendor-upper,workdir=$OV_TMPFS/vendor-work"
$ADB shell mount -t overlay -o "$opts" none /vendor
$ADB shell setenforce 0
# deqp
$ADB push /deqp/modules/egl/deqp-egl /data/.
$ADB push /deqp/assets/gl_cts/data/mustpass/egl/aosp_mustpass/3.2.6.x/egl-master.txt /data/.
$ADB push /deqp-runner/deqp-runner /data/.
# download mesa-x86_64-android.tar.zst
MESA_ANDROID_ARTIFACT_URL=https://${PIPELINE_ARTIFACTS_BASE}/${MINIO_ARTIFACT_NAME}.tar.zst
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 -o ${MINIO_ARTIFACT_NAME}.tar.zst ${MESA_ANDROID_ARTIFACT_URL}
tar -xvf ${MINIO_ARTIFACT_NAME}.tar.zst
$ADB push install/all-skips.txt /data/.
$ADB push install/$GPU_VERSION-flakes.txt /data/.
$ADB push install/deqp-$DEQP_SUITE.toml /data/.
# remove 32 bits libs from /vendor/lib
$ADB shell rm /vendor/lib/dri/${ANDROID_DRIVER}_dri.so
$ADB shell rm /vendor/lib/libglapi.so
$ADB shell rm /vendor/lib/egl/libGLES_mesa.so
$ADB shell rm /vendor/lib/egl/libEGL_angle.so
$ADB shell rm /vendor/lib/egl/libEGL_emulation.so
$ADB shell rm /vendor/lib/egl/libGLESv1_CM_angle.so
$ADB shell rm /vendor/lib/egl/libGLESv1_CM_emulation.so
$ADB shell rm /vendor/lib/egl/libGLESv2_angle.so
$ADB shell rm /vendor/lib/egl/libGLESv2_emulation.so
# replace on /vendor/lib64
$ADB push install/lib/dri/${ANDROID_DRIVER}_dri.so /vendor/lib64/dri/${ANDROID_DRIVER}_dri.so
$ADB push install/lib/libglapi.so /vendor/lib64/libglapi.so
$ADB push install/lib/libEGL.so /vendor/lib64/egl/libEGL_mesa.so
$ADB shell rm /vendor/lib64/egl/libEGL_angle.so
$ADB shell rm /vendor/lib64/egl/libEGL_emulation.so
$ADB shell rm /vendor/lib64/egl/libGLESv1_CM_angle.so
$ADB shell rm /vendor/lib64/egl/libGLESv1_CM_emulation.so
$ADB shell rm /vendor/lib64/egl/libGLESv2_angle.so
$ADB shell rm /vendor/lib64/egl/libGLESv2_emulation.so
RESULTS=/data/results
uncollapsed_section_switch cuttlefish_test "cuttlefish: testing"
set +e
$ADB shell "mkdir /data/results; cd /data; strace -o /data/results/out.strace -f -s 1000 ./deqp-runner \
suite \
--suite /data/deqp-$DEQP_SUITE.toml \
--output $RESULTS \
--skips /data/all-skips.txt $DEQP_SKIPS \
--flakes /data/$GPU_VERSION-flakes.txt \
--testlog-to-xml /deqp/executor/testlog-to-xml \
--fraction-start $CI_NODE_INDEX \
--fraction `expr $CI_NODE_TOTAL \* ${DEQP_FRACTION:-1}` \
--jobs ${FDO_CI_CONCURRENT:-4} \
$DEQP_RUNNER_OPTIONS"
EXIT_CODE=$?
set -e
section_switch cuttlefish_results "cuttlefish: gathering the results"
$ADB pull $RESULTS results
cp /cuttlefish/cuttlefish/instances/cvd-1/logs/logcat results
cp /cuttlefish/cuttlefish/instances/cvd-1/kernel.log results
cp /cuttlefish/cuttlefish/instances/cvd-1/logs/launcher.log results
section_end cuttlefish_results
exit $EXIT_CODE

View File

@@ -1,6 +1,6 @@
#!/bin/bash
echo -e "\e[0Ksection_start:$(date +%s):test_setup[collapsed=true]\r\e[0Kpreparing test setup"
section_start test_setup "deqp: preparing test setup"
set -ex
@@ -18,6 +18,7 @@ INSTALL=`pwd`/install
export LD_LIBRARY_PATH=`pwd`/install/lib/
export EGL_PLATFORM=surfaceless
export VK_ICD_FILENAMES=`pwd`/install/share/vulkan/icd.d/"$VK_DRIVER"_icd.${VK_CPU:-`uname -m`}.json
export OCL_ICD_VENDORS=`pwd`/install/etc/OpenCL/vendors/
RESULTS=`pwd`/${DEQP_RESULTS_DIR:-results}
mkdir -p $RESULTS
@@ -85,14 +86,6 @@ if [ -z "$DEQP_SUITE" ]; then
sed -ni $CI_NODE_INDEX~$CI_NODE_TOTAL"p" /tmp/case-list.txt
fi
if [ -n "$DEQP_CASELIST_FILTER" ]; then
sed -ni "/$DEQP_CASELIST_FILTER/p" /tmp/case-list.txt
fi
if [ -n "$DEQP_CASELIST_INV_FILTER" ]; then
sed -ni "/$DEQP_CASELIST_INV_FILTER/!p" /tmp/case-list.txt
fi
if [ ! -s /tmp/case-list.txt ]; then
echo "Caselist generation failed"
exit 1
@@ -123,18 +116,19 @@ if [ -e "$INSTALL/$GPU_VERSION-skips.txt" ]; then
DEQP_SKIPS="$DEQP_SKIPS $INSTALL/$GPU_VERSION-skips.txt"
fi
if [ "$PIGLIT_PLATFORM" != "gbm" ] ; then
DEQP_SKIPS="$DEQP_SKIPS $INSTALL/x11-skips.txt"
fi
if [ "$PIGLIT_PLATFORM" = "gbm" ]; then
DEQP_SKIPS="$DEQP_SKIPS $INSTALL/gbm-skips.txt"
fi
report_load() {
echo "System load: $(cut -d' ' -f1-3 < /proc/loadavg)"
echo "# of CPU cores: $(cat /proc/cpuinfo | grep processor | wc -l)"
}
# wrapper to supress +x to avoid spamming the log
quiet() {
set +x
"$@"
set -x
}
if [ "$GALLIUM_DRIVER" = "virpipe" ]; then
# deqp is to use virpipe, and virgl_test_server llvmpipe
export GALLIUM_DRIVER="$GALLIUM_DRIVER"
@@ -159,11 +153,7 @@ if [ -z "$DEQP_SUITE" ]; then
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
uncollapsed_section_switch deqp "deqp: deqp-runner"
set +e
if [ -z "$DEQP_SUITE" ]; then
@@ -196,11 +186,10 @@ fi
DEQP_EXITCODE=$?
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"
section_switch test_post_process "deqp: post-processing test results"
set -x
# Remove all but the first 50 individual XML files uploaded as artifacts, to
@@ -237,6 +226,11 @@ 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"
# Compress results.csv to save on bandwidth during the upload of artifacts to
# GitLab. This reduces the size in a VKCTS run from 135 to 7.6MB, and takes
# 0.17s on a Ryzen 5950X (16 threads, 0.95s when limited to 1 thread).
zstd --rm -T0 -8qc $RESULTS/results.csv -o $RESULTS/results.csv.zst
section_end test_post_process
exit $DEQP_EXITCODE

View File

@@ -16,8 +16,9 @@ fi
TMP_DIR=$(mktemp -d)
echo "Downloading archived master..."
/usr/bin/wget -O $TMP_DIR/$CI_PROJECT_NAME.tar.gz \
https://${MINIO_HOST}/git-cache/${FDO_UPSTREAM_REPO}/$CI_PROJECT_NAME.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 ]]

7
.gitlab-ci/gbm-skips.txt Normal file
View File

@@ -0,0 +1,7 @@
# gbm does not support reading the front buffer after a swapbuffers, and that's
# intentional. Don't bother running these tests when PIGLIT_PLATFORM=gbm.
#
# Note that this doesn't include tests like fbo-sys-blit, which draw/read front
# but don't swap.
spec@!opengl 1.0@gl-1.0-swapbuffers-behavior
spec@!opengl 1.1@read-front

View File

@@ -1,27 +1,33 @@
variables:
DEBIAN_X86_BUILD_BASE_IMAGE: "debian/x86_build-base"
DEBIAN_BASE_TAG: "2022-10-19-remove-xvmc-dev"
DEBIAN_BASE_TAG: "2023-03-27-virglrenderer-crosvm"
DEBIAN_X86_BUILD_IMAGE_PATH: "debian/x86_build"
DEBIAN_BUILD_TAG: "2022-10-22-mold-1_6"
DEBIAN_BUILD_TAG: "2023-04-03-android-meson-aarch64"
DEBIAN_X86_BUILD_MINGW_IMAGE_PATH: "debian/x86_build-mingw"
DEBIAN_BUILD_MINGW_TAG: "2022-10-18-dx-headers-va"
DEBIAN_BUILD_MINGW_TAG: "2023-01-03-ci-libva-2.17"
DEBIAN_X86_TEST_BASE_IMAGE: "debian/x86_test-base"
DEBIAN_X86_TEST_IMAGE_PATH: "debian/x86_test-gl"
DEBIAN_X86_TEST_GL_TAG: "2022-10-20-bindgen-zlib-cve"
DEBIAN_X86_TEST_VK_TAG: "2022-10-20-bindgen-zlib-cve"
DEBIAN_X86_TEST_IMAGE_GL_PATH: "debian/x86_test-gl"
DEBIAN_X86_TEST_IMAGE_VK_PATH: "debian/x86_test-vk"
DEBIAN_X86_TEST_IMAGE_PATH: ${DEBIAN_X86_TEST_IMAGE_GL_PATH}
DEBIAN_X86_TEST_ANDROID_IMAGE_PATH: "debian/x86_test-android"
FEDORA_X86_BUILD_TAG: "2022-09-22-python3-ply-2"
KERNEL_ROOTFS_TAG: "2022-10-20-bindgen-zlib-cve"
DEBIAN_X86_TEST_ANDROID_TAG: "2023-02-20-uprev-deqp-v2"
DEBIAN_X86_TEST_GL_TAG: "2023-04-11-piglit-355ad6bc"
DEBIAN_X86_TEST_VK_TAG: "2023-04-11-piglit-355ad6bc"
ALPINE_X86_BUILD_TAG: "2023-03-20-3.17-bump"
FEDORA_X86_BUILD_TAG: "2023-03-13-procps-ng"
KERNEL_ROOTFS_TAG: "2023-04-11-piglit-355ad6bc"
WINDOWS_X64_VS_PATH: "windows/x64_vs"
WINDOWS_X64_VS_TAG: "2022-10-20-upgrade-zlib"
WINDOWS_X64_BUILD_PATH: "windows/x64_build"
WINDOWS_X64_BUILD_TAG: "2022-10-18-wrap-nodownload-va"
WINDOWS_X64_BUILD_TAG: "2023-04-05-agility-710"
WINDOWS_X64_TEST_PATH: "windows/x64_test"
WINDOWS_X64_TEST_TAG: "2022-08-17-bump"
WINDOWS_X64_TEST_TAG: "2023-04-05-agility-710"

View File

@@ -4,7 +4,6 @@
variables:
GIT_STRATEGY: none # testing doesn't build anything from source
FDO_CI_CONCURRENT: 6 # should be replaced by per-machine definitions
DEQP_VER: gles2
# proxy used to cache data locally
FDO_HTTP_CACHE_URI: "http://caching-proxy/cache/?uri="
# base system generated by the container build job, shared between many pipelines
@@ -32,7 +31,7 @@
tags:
- $RUNNER_TAG
after_script:
- wget -q "https://${JOB_RESULTS_PATH}" -O- | tar --zstd -x
- curl -L --retry 4 -f --retry-all-errors --retry-delay 60 -s "https://${JOB_RESULTS_PATH}" | tar --zstd -x
.lava-test:armhf:
variables:
@@ -40,7 +39,6 @@
KERNEL_IMAGE_NAME: zImage
KERNEL_IMAGE_TYPE: "zimage"
BOOT_METHOD: u-boot
HWCI_TEST_SCRIPT: "/install/deqp-runner.sh"
extends:
- .use-debian/arm_build # for same $MESA_ARTIFACTS_TAG as in kernel+rootfs_armhf
- .use-debian/x86_build
@@ -51,13 +49,18 @@
- debian/x86_build
- debian-armhf
.lava-test-deqp:armhf:
extends:
- .lava-test:armhf
variables:
HWCI_TEST_SCRIPT: "/install/deqp-runner.sh"
.lava-test:arm64:
variables:
ARCH: arm64
KERNEL_IMAGE_NAME: Image
KERNEL_IMAGE_TYPE: "image"
BOOT_METHOD: u-boot
HWCI_TEST_SCRIPT: "/install/deqp-runner.sh"
extends:
- .use-debian/arm_build # for same $MESA_ARTIFACTS_TAG as in kernel+rootfs_arm64
- .use-debian/x86_build
@@ -70,13 +73,18 @@
- debian/x86_build
- debian-arm64
.lava-test-deqp:arm64:
variables:
HWCI_TEST_SCRIPT: "/install/deqp-runner.sh"
extends:
- .lava-test:arm64
.lava-test:amd64:
variables:
ARCH: amd64
KERNEL_IMAGE_NAME: bzImage
KERNEL_IMAGE_TYPE: "zimage"
BOOT_METHOD: u-boot
HWCI_TEST_SCRIPT: "/install/deqp-runner.sh"
extends:
- .use-debian/x86_build-base # for same $MESA_ARTIFACTS_BASE_TAG as in kernel+rootfs_amd64
- .use-debian/x86_build
@@ -86,6 +94,12 @@
- kernel+rootfs_amd64
- debian-testing
.lava-test-deqp:amd64:
variables:
HWCI_TEST_SCRIPT: "/install/deqp-runner.sh"
extends:
- .lava-test:amd64
.lava-traces-base:
variables:
HWCI_TEST_SCRIPT: "/install/piglit/piglit-traces.sh"
@@ -121,3 +135,8 @@
extends:
- .lava-test:amd64
- .lava-piglit
.lava-piglit:arm64:
extends:
- .lava-test:arm64
- .lava-piglit

View File

@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#
# Copyright (C) 2022 Collabora Limited
# Author: Guilherme Gallo <guilherme.gallo@collabora.com>
@@ -26,6 +26,11 @@
set -ex
# Use this script in a python virtualenv for isolation
python3 -m venv .venv
. .venv/bin/activate
python3 -m pip install -r ${CI_PROJECT_DIR}/.gitlab-ci/lava/requirements-test.txt
TEST_DIR=${CI_PROJECT_DIR}/.gitlab-ci/tests
PYTHONPATH="${TEST_DIR}:${PYTHONPATH}" python3 -m \

View File

@@ -5,7 +5,8 @@ set -x
# Try to use the kernel and rootfs built in mainline first, so we're more
# likely to hit cache
if wget -q --method=HEAD "https://${BASE_SYSTEM_MAINLINE_HOST_PATH}/done"; then
if curl -s -X HEAD -L --retry 4 -f --retry-all-errors --retry-delay 60 \
"https://${BASE_SYSTEM_MAINLINE_HOST_PATH}/done"; then
BASE_SYSTEM_HOST_PATH="${BASE_SYSTEM_MAINLINE_HOST_PATH}"
else
BASE_SYSTEM_HOST_PATH="${BASE_SYSTEM_FORK_HOST_PATH}"
@@ -17,17 +18,26 @@ 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/
cp artifacts/ci-common/intel-gpu-freq.sh results/job-rootfs-overlay/
cp "$SCRIPTS_DIR"/setup-test-env.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
echo -e "\e[0Ksection_start:$(date +%s):variables[collapsed=true]\r\e[0KVariables passed through:"
section_start variables "Variables passed through:"
cat results/job-rootfs-overlay/set-job-env-vars.sh
echo -e "\e[0Ksection_end:$(date +%s):variables\r\e[0K"
section_end variables
tar zcf job-rootfs-overlay.tar.gz -C results/job-rootfs-overlay/ .
ci-fairy minio login --token-file "${CI_JOB_JWT_FILE}"
ci-fairy minio cp job-rootfs-overlay.tar.gz "minio://${JOB_ROOTFS_OVERLAY_PATH}"
ci-fairy s3cp --token-file "${CI_JOB_JWT_FILE}" job-rootfs-overlay.tar.gz "https://${JOB_ROOTFS_OVERLAY_PATH}"
ARTIFACT_URL="${FDO_HTTP_CACHE_URI:-}https://${BUILD_PATH}"
# Make it take the mesa build from MINIO_ARTIFACT_NAME, if it is specified in
# the environment. This will make the LAVA behavior consistent with the
# baremetal jobs.
if [ -n "${MINIO_ARTIFACT_NAME}" ]
then
ARTIFACT_URL="${FDO_HTTP_CACHE_URI:-}https://${PIPELINE_ARTIFACTS_BASE}/${MINIO_ARTIFACT_NAME}.tar.zst"
fi
touch results/lava.log
tail -f results/lava.log &
@@ -36,7 +46,7 @@ PYTHONPATH=artifacts/ artifacts/lava/lava_job_submitter.py \
--pipeline-info "$CI_JOB_NAME: $CI_PIPELINE_URL on $CI_COMMIT_REF_NAME ${CI_NODE_INDEX}/${CI_NODE_TOTAL}" \
--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}" \
--build-url "${ARTIFACT_URL}" \
--job-rootfs-overlay-url "${FDO_HTTP_CACHE_URI:-}https://${JOB_ROOTFS_OVERLAY_PATH}" \
--job-timeout ${JOB_TIMEOUT:-30} \
--first-stage-init artifacts/ci-common/init-stage1.sh \

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (C) 2020 - 2022 Collabora Limited
# Copyright (C) 2020 - 2023 Collabora Limited
# Authors:
# Gustavo Padovan <gustavo.padovan@collabora.com>
# Guilherme Gallo <guilherme.gallo@collabora.com>
@@ -20,11 +20,11 @@ import traceback
import urllib.parse
import xmlrpc.client
from datetime import datetime, timedelta
from io import StringIO
from os import getenv
from typing import Any, Optional
import lavacli
import yaml
from lava.exceptions import (
MesaCIException,
MesaCIKnownIssueException,
@@ -42,7 +42,7 @@ from lava.utils import (
hide_sensitive_data,
print_log,
)
from lavacli.utils import loader
from lavacli.utils import flow_yaml as lava_yaml
# 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.
@@ -61,24 +61,38 @@ NUMBER_OF_RETRIES_TIMEOUT_DETECTION = int(getenv("LAVA_NUMBER_OF_RETRIES_TIMEOUT
# How many attempts should be made when a timeout happen during LAVA device boot.
NUMBER_OF_ATTEMPTS_LAVA_BOOT = int(getenv("LAVA_NUMBER_OF_ATTEMPTS_LAVA_BOOT", 3))
# Supports any integers in [0, 100].
# The scheduler considers the job priority when ordering the queue
# to consider which job should run next.
JOB_PRIORITY = int(getenv("LAVA_JOB_PRIORITY", 75))
def generate_lava_yaml(args):
def generate_lava_yaml_payload(args) -> dict[str, Any]:
# General metadata and permissions, plus also inexplicably kernel arguments
values = {
'job_name': 'mesa: {}'.format(args.pipeline_info),
'device_type': args.device_type,
'visibility': { 'group': [ args.visibility_group ] },
'priority': 75,
'priority': JOB_PRIORITY,
'context': {
'extra_nfsroot_args': ' init=/init rootwait usbcore.quirks=0bda:8153:k'
},
"timeouts": {
"job": {"minutes": args.job_timeout},
"action": {"minutes": 3},
"actions": {
"depthcharge-retry": {
# Could take between 1 and 1.5 min in slower boots
"minutes": 2
},
"depthcharge-start": {
# Should take less than 1 min.
"minutes": 1,
},
"depthcharge-action": {
"minutes": 3 * NUMBER_OF_ATTEMPTS_LAVA_BOOT,
}
# This timeout englobes the entire depthcharge timing,
# including retries
"minutes": 2 * NUMBER_OF_ATTEMPTS_LAVA_BOOT,
},
}
},
}
@@ -147,8 +161,13 @@ def generate_lava_yaml(args):
# - fetch and unpack per-job environment from lava-submit.sh
# - exec .gitlab-ci/common/init-stage2.sh
with open(args.first_stage_init, 'r') as init_sh:
run_steps += [ x.rstrip() for x in init_sh if not x.startswith('#') and x.rstrip() ]
with open(args.first_stage_init, "r") as init_sh:
run_steps += [
x.rstrip() for x in init_sh if not x.startswith("#") and x.rstrip()
]
run_steps.append(
f"curl -L --retry 4 -f --retry-all-errors --retry-delay 60 {args.job_rootfs_overlay_url} | tar -xz -C /",
)
if args.jwt_file:
with open(args.jwt_file) as jwt_file:
@@ -166,8 +185,7 @@ def generate_lava_yaml(args):
run_steps += [
'mkdir -p {}'.format(args.ci_project_dir),
'wget -S --progress=dot:giga -O- {} | tar --zstd -x -C {}'.format(args.build_url, args.ci_project_dir),
'wget -S --progress=dot:giga -O- {} | tar -xz -C /'.format(args.job_rootfs_overlay_url),
'curl {} | tar --zstd -x -C {}'.format(args.build_url, args.ci_project_dir),
# Sleep a bit to give time for bash to dump shell xtrace messages into
# console which may cause interleaving with LAVA_SIGNAL_STARTTC in some
@@ -185,7 +203,7 @@ def generate_lava_yaml(args):
{ 'test': test },
]
return yaml.dump(values, width=10000000)
return values
def setup_lava_proxy():
@@ -272,8 +290,12 @@ class LAVAJob:
def _load_log_from_data(self, data) -> list[str]:
lines = []
if isinstance(data, xmlrpc.client.Binary):
# We are dealing with xmlrpc.client.Binary
# Let's extract the data
data = data.data
# When there is no new log data, the YAML is empty
if loaded_lines := yaml.load(str(data), Loader=loader(False)):
if loaded_lines := lava_yaml.load(data):
lines = loaded_lines
self.last_log_line += len(lines)
return lines
@@ -338,7 +360,7 @@ def find_exception_from_metadata(metadata, job_id):
def find_lava_error(job) -> None:
# Look for infrastructure errors and retry if we see them.
results_yaml = _call_proxy(job.proxy.results.get_testjob_results_yaml, job.job_id)
results = yaml.load(results_yaml, Loader=loader(False))
results = lava_yaml.load(results_yaml)
for res in results:
metadata = res["metadata"]
find_exception_from_metadata(metadata, job.job_id)
@@ -348,16 +370,17 @@ def find_lava_error(job) -> None:
job.status = "fail"
def show_job_data(job):
def show_job_data(job, colour=f"{CONSOLE_LOG['BOLD']}{CONSOLE_LOG['FG_GREEN']}"):
with GitlabSection(
"job_data",
"LAVA job info",
type=LogSectionType.LAVA_POST_PROCESSING,
start_collapsed=True,
colour=colour,
):
show = _call_proxy(job.proxy.scheduler.jobs.show, job.job_id)
for field, value in show.items():
print("{}\t: {}".format(field, value))
print(f"{field:<15}: {value}")
def fetch_logs(job, max_idle_time, log_follower) -> None:
@@ -433,8 +456,6 @@ def follow_job_execution(job):
while not job.is_finished:
fetch_logs(job, max_idle_time, lf)
show_job_data(job)
# Mesa Developers expect to have a simple pass/fail job result.
# If this does not happen, it probably means a LAVA infrastructure error
# happened.
@@ -453,6 +474,7 @@ def print_job_final_status(job):
f"{CONSOLE_LOG['RESET']}"
)
show_job_data(job, colour=f"{CONSOLE_LOG['BOLD']}{color}")
def retriable_follow_job(proxy, job_definition) -> LAVAJob:
retry_count = NUMBER_OF_RETRIES_TIMEOUT_DETECTION
@@ -505,7 +527,9 @@ def main(args):
# script section timeout with a reasonable delay.
GL_SECTION_TIMEOUTS[LogSectionType.TEST_CASE] = timedelta(minutes=args.job_timeout)
job_definition = generate_lava_yaml(args)
job_definition_stream = StringIO()
lava_yaml.dump(generate_lava_yaml_payload(args), job_definition_stream)
job_definition = job_definition_stream.getvalue()
if args.dump_yaml:
with GitlabSection(

View File

@@ -0,0 +1,6 @@
-r requirements.txt
freezegun==1.1.0
hypothesis==6.67.1
pytest==7.2.1
pytest-cov==3.0.0
PyYAML==5.3.1

View File

@@ -0,0 +1 @@
lavacli==1.5.2

View File

@@ -3,7 +3,6 @@ from .gitlab_section import GitlabSection
from .log_follower import (
LogFollower,
fatal_err,
fix_lava_color_log,
fix_lava_gitlab_section_log,
hide_sensitive_data,
print_log,

View File

@@ -0,0 +1,35 @@
import os
import re
from enum import Enum
class LavaFarm(Enum):
"""Enum class representing the different LAVA farms."""
LIMA = 1
COLLABORA = 2
UNKNOWN = 3
LAVA_FARM_RUNNER_PATTERNS: dict[LavaFarm, str] = {
# Lima pattern comes first, since it has the same prefix as the
# Collabora pattern.
LavaFarm.LIMA: r"^mesa-ci-[\x01-\x7F]+-lava-lima$",
LavaFarm.COLLABORA: r"^mesa-ci-[\x01-\x7F]+-lava-[\x01-\x7F]+$",
LavaFarm.UNKNOWN: r"^[\x01-\x7F]+",
}
def get_lava_farm() -> LavaFarm:
"""
Returns the LAVA farm based on the RUNNER_TAG environment variable.
:return: The LAVA farm
"""
runner_tag: str = os.getenv("RUNNER_TAG", "unknown")
for farm, pattern in LAVA_FARM_RUNNER_PATTERNS.items():
if re.match(pattern, runner_tag):
return farm
raise ValueError(f"Unknown LAVA runner tag: {runner_tag}")

View File

@@ -20,6 +20,7 @@ from typing import Optional, Union
from lava.exceptions import MesaCITimeoutError
from lava.utils.console_format import CONSOLE_LOG
from lava.utils.gitlab_section import GitlabSection
from lava.utils.lava_farm import LavaFarm, get_lava_farm
from lava.utils.lava_log_hints import LAVALogHints
from lava.utils.log_section import (
DEFAULT_GITLAB_SECTION_TIMEOUTS,
@@ -38,6 +39,8 @@ class LogFollower:
fallback_timeout: timedelta = FALLBACK_GITLAB_SECTION_TIMEOUT
_buffer: list[str] = field(default_factory=list, init=False)
log_hints: LAVALogHints = field(init=False)
lava_farm: LavaFarm = field(init=False, default=get_lava_farm())
_merge_next_line: str = field(default_factory=str, init=False)
def __post_init__(self):
section_is_created = bool(self.current_section)
@@ -49,6 +52,10 @@ class LogFollower:
section_is_created == section_has_started
), "Can't follow logs beginning from uninitialized GitLab sections."
# Initialize fix_lava_gitlab_section_log generator
self.gl_section_fix_gen = fix_lava_gitlab_section_log()
next(self.gl_section_fix_gen)
@property
def phase(self) -> LogSectionType:
return (
@@ -120,6 +127,52 @@ class LogFollower:
return False
def remove_trailing_whitespace(self, line: dict[str, str]) -> None:
"""
Removes trailing whitespace from the end of the `msg` value in the log line dictionary.
Args:
line: A dictionary representing a single log line.
Note:
LAVA treats carriage return characters as a line break, so each carriage return in an output console
is mapped to a console line in LAVA. This method removes trailing `\r\n` characters from log lines.
"""
msg: Optional[str] = line.get("msg")
if not msg:
return False
messages = [msg] if isinstance(msg, str) else msg
for message in messages:
# LAVA logs brings raw messages, which includes newlines characters as \r\n.
line["msg"]: str = re.sub(r"\r\n$", "", message)
def merge_carriage_return_lines(self, line: dict[str, str]) -> bool:
"""
Merges lines that end with a carriage return character into a single line.
Args:
line: A dictionary representing a single log line.
Returns:
A boolean indicating whether the current line has been merged with the next line.
Note:
LAVA treats carriage return characters as a line break, so each carriage return in an output console
is mapped to a console line in LAVA.
"""
if line["msg"].endswith("\r"):
self._merge_next_line += line["msg"]
return True
if self._merge_next_line:
line["msg"] = self._merge_next_line + line["msg"]
self._merge_next_line = ""
return False
def feed(self, new_lines: list[dict[str, str]]) -> bool:
"""Input data to be processed by LogFollower instance
Returns true if the DUT (device under test) seems to be alive.
@@ -131,14 +184,19 @@ class LogFollower:
is_job_healthy = False
for line in new_lines:
self.remove_trailing_whitespace(line)
if self.detect_kernel_dump_line(line):
continue
if self.merge_carriage_return_lines(line):
continue
# At least we are fed with a non-kernel dump log, it seems that the
# job is progressing
is_job_healthy = True
self.manage_gl_sections(line)
if parsed_line := parse_lava_line(line):
if parsed_line := self.parse_lava_line(line):
self._buffer.append(parsed_line)
self.log_hints.detect_failure(new_lines)
@@ -150,58 +208,64 @@ class LogFollower:
self._buffer = []
return buffer
def parse_lava_line(self, line) -> Optional[str]:
prefix = ""
suffix = ""
def fix_lava_color_log(line):
"""This function is a temporary solution for the color escape codes mangling
problem. There is some problem in message passing between the LAVA
dispatcher and the device under test (DUT). Here \x1b character is missing
before `[:digit::digit:?:digit:?m` ANSI TTY color codes, or the more
complicated ones with number values for text format before background and
foreground colors.
When this problem is fixed on the LAVA side, one should remove this function.
"""
line["msg"] = re.sub(r"(\[(\d+;){0,2}\d{1,3}m)", "\x1b" + r"\1", line["msg"])
if line["lvl"] in ["results", "feedback", "debug"]:
return
elif line["lvl"] in ["warning", "error"]:
prefix = CONSOLE_LOG["FG_RED"]
suffix = CONSOLE_LOG["RESET"]
elif line["lvl"] == "input":
prefix = "$ "
suffix = ""
elif line["lvl"] == "target" and self.lava_farm != LavaFarm.COLLABORA:
# gl_section_fix_gen will output the stored line if it can't find a
# match for the first split line
# So we can recover it and put it back to the buffer
if recovered_first_line := self.gl_section_fix_gen.send(line):
self._buffer.append(recovered_first_line)
return f'{prefix}{line["msg"]}{suffix}'
def fix_lava_gitlab_section_log(line):
def fix_lava_gitlab_section_log():
"""This function is a temporary solution for the Gitlab section markers
mangling problem. Gitlab parses the following lines to define a collapsible
splitting problem. Gitlab parses the following lines to define a collapsible
gitlab section in their log:
- \x1b[0Ksection_start:timestamp:section_id[collapsible=true/false]\r\x1b[0Ksection_header
- \x1b[0Ksection_end:timestamp:section_id\r\x1b[0K
There is some problem in message passing between the LAVA dispatcher and the
device under test (DUT), that digests \x1b and \r control characters
incorrectly. When this problem is fixed on the LAVA side, one should remove
this function.
device under test (DUT), that replaces \r control characters into \n. When
this problem is fixed on the LAVA side, one should remove this function.
"""
if match := re.match(r"\[0K(section_\w+):(\d+):(\S+)\[0K([\S ]+)?", line["msg"]):
marker, timestamp, id_collapsible, header = match.groups()
# The above regex serves for both section start and end lines.
# When the header is None, it means we are dealing with `section_end` line
header = header or ""
line["msg"] = f"\x1b[0K{marker}:{timestamp}:{id_collapsible}\r\x1b[0K{header}"
while True:
line = yield False
first_line = None
split_line_pattern = re.compile(r"\x1b\[0K(section_\w+):(\d+):([^\s\r]+)$")
second_line_pattern = re.compile(r"\x1b\[0K([\S ]+)?")
if not re.search(split_line_pattern, line["msg"]):
continue
first_line = line["msg"]
# Delete the current line and hold this log line stream to be able to
# possibly merge it with the next line.
line["msg"] = ""
line = yield False
# This code reached when we detect a possible first split line
if re.search(second_line_pattern, line["msg"]):
assert first_line
line["msg"] = f"{first_line}\r{line['msg']}"
else:
# The current line doesn't match with the previous one, send back the
# latter to give the user the chance to recover it.
yield first_line
def parse_lava_line(line) -> Optional[str]:
prefix = ""
suffix = ""
if line["lvl"] in ["results", "feedback", "debug"]:
return
elif line["lvl"] in ["warning", "error"]:
prefix = CONSOLE_LOG["FG_RED"]
suffix = CONSOLE_LOG["RESET"]
elif line["lvl"] == "input":
prefix = "$ "
suffix = ""
elif line["lvl"] == "target":
fix_lava_color_log(line)
fix_lava_gitlab_section_log(line)
return f'{prefix}{line["msg"]}{suffix}'
def print_log(msg):
def print_log(msg: str) -> None:
# Reset color from timestamp, since `msg` can tint the terminal color
print(f"{CONSOLE_LOG['RESET']}{datetime.now()}: {msg}")
@@ -214,5 +278,5 @@ def fatal_err(msg):
sys.exit(1)
def hide_sensitive_data(yaml_data, hide_tag="HIDEME"):
def hide_sensitive_data(yaml_data: str, hide_tag: str ="HIDEME"):
return "".join(line for line in yaml_data.splitlines(True) if hide_tag not in line)

View File

@@ -1,22 +1,29 @@
#!/bin/bash
#!/usr/bin/env bash
section_switch meson-configure "meson: configure"
set -e
set -o xtrace
CROSS_FILE=/cross_file-"$CROSS".txt
export PATH=$PATH:$PWD/.gitlab-ci/build
touch native.file
printf > native.file "%s\n" \
"[binaries]" \
"c = 'compiler-wrapper-${CC:-gcc}.sh'" \
"cpp = 'compiler-wrapper-${CXX:-g++}.sh'"
# We need to control the version of llvm-config we're using, so we'll
# tweak the cross file or generate a native file to do so.
if test -n "$LLVM_VERSION"; then
LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
echo -e "[binaries]\nllvm-config = '`which $LLVM_CONFIG`'" > native.file
echo "llvm-config = '`which $LLVM_CONFIG`'" >> native.file
if [ -n "$CROSS" ]; then
sed -i -e '/\[binaries\]/a\' -e "llvm-config = '`which $LLVM_CONFIG`'" $CROSS_FILE
fi
$LLVM_CONFIG --version
else
rm -f native.file
touch native.file
fi
# cross-xfail-$CROSS, if it exists, contains a list of tests that are expected
@@ -24,7 +31,7 @@ fi
# tests in their meson.build with:
#
# test(...,
# should_fail: meson.get_cross_property('xfail', '').contains(t),
# should_fail: meson.get_external_property('xfail', '').contains(t),
# )
#
# where t is the name of the test, and the '' is the string to search when
@@ -59,15 +66,19 @@ case $CI_JOB_NAME in
esac
rm -rf _build
meson _build --native-file=native.file \
meson setup _build \
--native-file=native.file \
--wrap-mode=nofallback \
--force-fallback-for perfetto \
${CROSS+--cross "$CROSS_FILE"} \
-D prefix=`pwd`/install \
-D libdir=lib \
-D buildtype=${BUILDTYPE:-debug} \
-D build-tests=true \
-D c_args="$(echo -n $C_ARGS)" \
-D c_link_args="$(echo -n $C_LINK_ARGS)" \
-D cpp_args="$(echo -n $CPP_ARGS)" \
-D cpp_link_args="$(echo -n $CPP_LINK_ARGS)" \
-D enable-glcpp-tests=false \
-D libunwind=${UNWIND} \
${DRI_LOADERS} \
@@ -79,11 +90,17 @@ meson _build --native-file=native.file \
${EXTRA_OPTION}
cd _build
meson configure
uncollapsed_section_switch meson-build "meson: build"
if command -V mold &> /dev/null ; then
mold --run ninja
else
ninja
fi
uncollapsed_section_switch meson-test "meson: test"
LC_ALL=C.UTF-8 meson test --num-processes ${FDO_CI_CONCURRENT:-4} --print-errorlogs ${MESON_TEST_ARGS}
if command -V mold &> /dev/null ; then
mold --run ninja install
@@ -91,3 +108,4 @@ else
ninja install
fi
cd ..
section_end meson-test

View File

@@ -1,7 +1,7 @@
#!/bin/sh
if [ "x$STRACEDIR" = "x" ]; then
STRACEDIR=meson-logs/strace/$(for i in $@; do basename -z -- $i; echo -n _; done)
STRACEDIR=meson-logs/strace/$(for i in $@; do basename -z -- $i; echo -n _; done).$$
fi
mkdir -p $STRACEDIR

View File

@@ -76,6 +76,14 @@ if [ -e "$INSTALL/$GPU_VERSION-skips.txt" ]; then
PIGLIT_SKIPS="$PIGLIT_SKIPS $INSTALL/$GPU_VERSION-skips.txt"
fi
if [ "$PIGLIT_PLATFORM" != "gbm" ] ; then
PIGLIT_SKIPS="$PIGLIT_SKIPS $INSTALL/x11-skips.txt"
fi
if [ "$PIGLIT_PLATFORM" = "gbm" ]; then
PIGLIT_SKIPS="$PIGLIT_SKIPS $INSTALL/gbm-skips.txt"
fi
set +e
piglit-runner \
@@ -114,4 +122,9 @@ if [ -n "$FLAKES_CHANNEL" ]; then
--branch-title "${CI_MERGE_REQUEST_TITLE:-$CI_COMMIT_TITLE}"
fi
# Compress results.csv to save on bandwidth during the upload of artifacts to
# GitLab. This reduces a full piglit run to 550 KB, down from 6 MB, and takes
# 55ms on my Ryzen 5950X (with or without parallelism).
zstd --rm -T0 -8qc $RESULTS/results.csv -o $RESULTS/results.csv.zst
exit $PIGLIT_EXITCODE

View File

@@ -3,7 +3,7 @@
set -ex
INSTALL=$(realpath -s "$PWD"/install)
MINIO_ARGS="--credentials=/tmp/.minio_credentials"
MINIO_ARGS="--token-file ${CI_JOB_JWT_FILE}"
RESULTS=$(realpath -s "$PWD"/results)
mkdir -p "$RESULTS"
@@ -12,8 +12,8 @@ if [ "$PIGLIT_REPLAY_SUBCOMMAND" = "profile" ]; then
# workaround for older Debian Bullseye libyaml 0.2.2
sed -i "/^%YAML 1\.2$/d" "$PIGLIT_REPLAY_DESCRIPTION_FILE"
yq -i -Y '. | del(.traces[][] | select(.label[0,1,2,3,4,5,6,7,8,9] == "no-perf"))' \
"$PIGLIT_REPLAY_DESCRIPTION_FILE" # label positions are a bit hack
yq -iY 'del(.traces[][] | select(.label[]? == "no-perf"))' \
"$PIGLIT_REPLAY_DESCRIPTION_FILE"
fi
# WINE
@@ -129,7 +129,7 @@ replay_minio_upload_images() {
fi
__MINIO_PATH="$PIGLIT_REPLAY_REFERENCE_IMAGES_BASE"
__DESTINATION_FILE_PATH="${line##*-}"
if wget -q --method=HEAD "https://${__MINIO_PATH}/${__DESTINATION_FILE_PATH}" 2>/dev/null; then
if curl -L -s -X HEAD "https://${__MINIO_PATH}/${__DESTINATION_FILE_PATH}" 2>/dev/null; then
continue
fi
else
@@ -137,8 +137,8 @@ replay_minio_upload_images() {
__DESTINATION_FILE_PATH="$__MINIO_TRACES_PREFIX/${line##*-}"
fi
ci-fairy minio cp $MINIO_ARGS "$RESULTS/$__PREFIX/$line" \
"minio://${__MINIO_PATH}/${__DESTINATION_FILE_PATH}"
ci-fairy s3cp $MINIO_ARGS "$RESULTS/$__PREFIX/$line" \
"https://${__MINIO_PATH}/${__DESTINATION_FILE_PATH}"
done
}
@@ -173,8 +173,6 @@ if [ "$RUN_CMD_WRAPPER" ]; then
RUN_CMD="set +e; $RUN_CMD_WRAPPER "$(/usr/bin/printf "%q" "$RUN_CMD")"; set -e"
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

View File

@@ -1,75 +0,0 @@
#!/bin/bash
set -e
set -o xtrace
VERSION=`head -1 install/VERSION`
ROOTDIR=`pwd`
if [ -d results ]; then
cd results && rm -rf ..?* .[!.]* *
fi
cd /piglit
export OCL_ICD_VENDORS=$ROOTDIR/install/etc/OpenCL/vendors/
set +e
unset DISPLAY
export LD_LIBRARY_PATH=$ROOTDIR/install/lib
clinfo
# If the job is parallel at the gitlab job level, will take the corresponding
# fraction of the caselist.
if [ -n "$CI_NODE_INDEX" ]; then
if [ "$PIGLIT_PROFILES" != "${PIGLIT_PROFILES% *}" ]; then
echo "Can't parallelize piglit with multiple profiles"
exit 1
fi
USE_CASELIST=1
fi
if [ -n "$USE_CASELIST" ]; then
./piglit print-cmd $PIGLIT_TESTS $PIGLIT_PROFILES --format "{name}" > /tmp/case-list.txt
sed -ni $CI_NODE_INDEX~$CI_NODE_TOTAL"p" /tmp/case-list.txt
PIGLIT_TESTS="--test-list /tmp/case-list.txt"
fi
./piglit run -c -j${FDO_CI_CONCURRENT:-4} $PIGLIT_OPTIONS $PIGLIT_TESTS $PIGLIT_PROFILES $ROOTDIR/results
retVal=$?
if [ $retVal -ne 0 ]; then
echo "Found $(cat /tmp/version.txt), expected $VERSION"
fi
set -e
PIGLIT_RESULTS=${PIGLIT_RESULTS:-$PIGLIT_PROFILES}
mkdir -p .gitlab-ci/piglit
./piglit summary console $ROOTDIR/results \
| tee ".gitlab-ci/piglit/$PIGLIT_RESULTS.txt.orig" \
| head -n -1 \
| grep -v ": pass" \
| sed '/^summary:/Q' \
> .gitlab-ci/piglit/$PIGLIT_RESULTS.txt
if [ -n "$USE_CASELIST" ]; then
# Just filter the expected results based on the tests that were actually
# executed, and switch to the version with no summary
cat .gitlab-ci/piglit/$PIGLIT_RESULTS.txt.orig | sed '/^summary:/Q' | rev \
| cut -f2- -d: | rev | sed "s/$/:/g" > /tmp/executed.txt
grep -F -f /tmp/executed.txt $ROOTDIR/install/$PIGLIT_RESULTS.txt \
> .gitlab-ci/piglit/$PIGLIT_RESULTS.txt.baseline || true
else
cp $ROOTDIR/install/$PIGLIT_RESULTS.txt .gitlab-ci/piglit/$PIGLIT_RESULTS.txt.baseline
fi
if diff -q .gitlab-ci/piglit/$PIGLIT_RESULTS.txt{.baseline,}; then
exit 0
fi
./piglit summary html --exclude-details=pass $ROOTDIR/results/summary $ROOTDIR/results
echo Unexpected change in results:
diff -u .gitlab-ci/piglit/$PIGLIT_RESULTS.txt{.baseline,}
exit 1

View File

@@ -1,4 +1,6 @@
#!/bin/bash
#!/usr/bin/env bash
section_switch prepare-artifacts "artifacts: prepare"
set -e
set -o xtrace
@@ -10,7 +12,7 @@ rm -rf install/bin install/include
# Strip the drivers in the artifacts to cut 80% of the artifacts size.
if [ -n "$CROSS" ]; then
STRIP=`sed -n -E "s/strip\s*=\s*'(.*)'/\1/p" "$CROSS_FILE"`
STRIP=$(sed -n -E "s/strip\s*=\s*\[?'(.*)'\]?/\1/p" "$CROSS_FILE")
if [ -z "$STRIP" ]; then
echo "Failed to find strip command in cross file"
exit 1
@@ -36,6 +38,7 @@ cp -Rp .gitlab-ci/*.txt install/
cp -Rp .gitlab-ci/report-flakes.py install/
cp -Rp .gitlab-ci/valve install/
cp -Rp .gitlab-ci/vkd3d-proton install/
cp -Rp .gitlab-ci/setup-test-env.sh install/
cp -Rp .gitlab-ci/*-runner.sh install/
find . -path \*/ci/\*.txt \
-o -path \*/ci/\*.toml \
@@ -54,6 +57,7 @@ if [ -n "$MINIO_ARTIFACT_NAME" ]; then
# Pass needed files to the test stage
MINIO_ARTIFACT_NAME="$MINIO_ARTIFACT_NAME.tar.zst"
zstd artifacts/install.tar -o ${MINIO_ARTIFACT_NAME}
ci-fairy minio login --token-file "${CI_JOB_JWT_FILE}"
ci-fairy minio cp ${MINIO_ARTIFACT_NAME} minio://${PIPELINE_ARTIFACTS_BASE}/${MINIO_ARTIFACT_NAME}
ci-fairy s3cp --token-file "${CI_JOB_JWT_FILE}" ${MINIO_ARTIFACT_NAME} https://${PIPELINE_ARTIFACTS_BASE}/${MINIO_ARTIFACT_NAME}
fi
section_end prepare-artifacts

View File

@@ -1,27 +1,39 @@
#!/usr/bin/env bash
set -e
set -v
ARTIFACTSDIR=`pwd`/shader-db
mkdir -p $ARTIFACTSDIR
ARTIFACTSDIR=$(pwd)/shader-db
mkdir -p "$ARTIFACTSDIR"
export DRM_SHIM_DEBUG=true
LIBDIR=`pwd`/install/lib
LIBDIR=$(pwd)/install/lib
export LD_LIBRARY_PATH=$LIBDIR
cd /usr/local/shader-db
for driver in freedreno intel v3d; do
echo "Running drm-shim for $driver"
env LD_PRELOAD=$LIBDIR/lib${driver}_noop_drm_shim.so \
./run -j${FDO_CI_CONCURRENT:-4} ./shaders \
> $ARTIFACTSDIR/${driver}-shader-db.txt
for driver in freedreno intel v3d vc4; do
section_start shader-db-${driver} "Running shader-db for $driver"
env LD_PRELOAD="$LIBDIR/lib${driver}_noop_drm_shim.so" \
./run -j"${FDO_CI_CONCURRENT:-4}" ./shaders \
> "$ARTIFACTSDIR/${driver}-shader-db.txt"
section_end shader-db-${driver}
done
# Run shader-db over a number of supported chipsets for nouveau
for chipset in 40 a3 c0 e4 f0 134 162; do
echo "Running drm-shim for nouveau - $chipset"
env LD_PRELOAD=$LIBDIR/libnouveau_noop_drm_shim.so \
section_start shader-db-nouveau-${chipset} "Running shader-db for nouveau - ${chipset}"
env LD_PRELOAD="$LIBDIR/libnouveau_noop_drm_shim.so" \
NOUVEAU_CHIPSET=${chipset} \
./run -j${FDO_CI_CONCURRENT:-4} ./shaders \
> $ARTIFACTSDIR/nouveau-${chipset}-shader-db.txt
./run -j"${FDO_CI_CONCURRENT:-4}" ./shaders \
> "$ARTIFACTSDIR/nouveau-${chipset}-shader-db.txt"
section_end shader-db-nouveau-${chipset}
done
# Run shader-db for r300 (RV370 and RV515)
for chipset in 0x5460 0x7140; do
section_start shader-db-r300-${chipset} "Running shader-db for r300 - ${chipset}"
env LD_PRELOAD="$LIBDIR/libradeon_noop_drm_shim.so" \
RADEON_GPU_ID=${chipset} \
./run -j"${FDO_CI_CONCURRENT:-4}" -o r300 ./shaders \
> "$ARTIFACTSDIR/r300-${chipset}-shader-db.txt"
section_end shader-db-r300-${chipset}
done

View File

@@ -0,0 +1,100 @@
#!/usr/bin/env bash
function x_off {
if [[ "$-" == *"x"* ]]; then
state_x=1
set +x
else
state_x=0
fi
}
# TODO: implement x_on !
function error {
x_off 2>/dev/null
RED="\e[0;31m"
ENDCOLOR="\e[0m"
# we force the following to be not in a section
section_end $CURRENT_SECTION
DATE_S=$(date -u +"%s")
JOB_START_S=$(date -u +"%s" -d "${CI_JOB_STARTED_AT:?}")
CURR_TIME=$((DATE_S-JOB_START_S))
CURR_MINSEC="$(printf "%02d" $((CURR_TIME/60))):$(printf "%02d" $((CURR_TIME%60)))"
echo -e "\n${RED}[${CURR_MINSEC}] ERROR: $*${ENDCOLOR}\n"
[ "$state_x" -eq 0 ] || set -x
}
function trap_err {
error ${CURRENT_SECTION:-'unknown-section'}: ret code: $*
}
function build_section_start {
local section_params=$1
shift
local section_name=$1
CURRENT_SECTION=$section_name
shift
CYAN="\e[0;36m"
ENDCOLOR="\e[0m"
DATE_S=$(date -u +"%s")
JOB_START_S=$(date -u +"%s" -d "${CI_JOB_STARTED_AT:?}")
CURR_TIME=$((DATE_S-JOB_START_S))
CURR_MINSEC="$(printf "%02d" $((CURR_TIME/60))):$(printf "%02d" $((CURR_TIME%60)))"
echo -e "\n\e[0Ksection_start:$(date +%s):$section_name$section_params\r\e[0K${CYAN}[${CURR_MINSEC}] $*${ENDCOLOR}\n"
}
function section_start {
x_off 2>/dev/null
build_section_start "[collapsed=true]" $*
[ "$state_x" -eq 0 ] || set -x
}
function build_section_end {
echo -e "\e[0Ksection_end:$(date +%s):$1\r\e[0K"
CURRENT_SECTION=""
}
function section_end {
x_off >/dev/null
build_section_end $*
[ "$state_x" -eq 0 ] || set -x
}
function section_switch {
x_off 2>/dev/null
if [ -n "$CURRENT_SECTION" ]
then
build_section_end $CURRENT_SECTION
fi
build_section_start "[collapsed=true]" $*
[ "$state_x" -eq 0 ] || set -x
}
function uncollapsed_section_switch {
x_off 2>/dev/null
if [ -n "$CURRENT_SECTION" ]
then
build_section_end $CURRENT_SECTION
fi
build_section_start "" $*
[ "$state_x" -eq 0 ] || set -x
}
export -f x_off
export -f error
export -f trap_err
export -f build_section_start
export -f section_start
export -f build_section_end
export -f section_end
export -f section_switch
export -f uncollapsed_section_switch
# Freedesktop requirement (needed for Wayland)
[ -n "${XDG_RUNTIME_DIR}" ] || export XDG_RUNTIME_DIR="$(mktemp -p "$PWD" -d xdg-runtime-XXXXXX)"
set -E
trap 'trap_err $?' ERR

View File

@@ -1,371 +0,0 @@
#!/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.
# Args:
# $1: section id
# $2: section header
gitlab_section_start() {
echo -e "\e[0Ksection_start:$(date +%s):$1[collapsed=${GL_COLLAPSED:-false}]\r\e[0K\e[32;1m$2\e[0m"
}
# Args:
# $1: section id
gitlab_section_end() {
echo -e "\e[0Ksection_end:$(date +%s):$1\r\e[0K"
}
# sponge allows piping to files that are being used as input.
# E.g.: sort file.txt | sponge file.txt
# In order to avoid installing moreutils just to have the sponge binary, we can
# use a bash function for it
# Source https://unix.stackexchange.com/a/561346/310927
sponge () (
set +x
append=false
while getopts 'a' opt; do
case $opt in
a) append=true ;;
*) echo error; exit 1
esac
done
shift "$(( OPTIND - 1 ))"
outfile=$1
tmpfile=$(mktemp "$(dirname "$outfile")/tmp-sponge.XXXXXXXX") &&
cat >"$tmpfile" &&
if "$append"; then
cat "$tmpfile" >>"$outfile"
else
if [ -f "$outfile" ]; then
chmod --reference="$outfile" "$tmpfile"
fi
if [ -f "$outfile" ]; then
mv "$tmpfile" "$outfile"
elif [ -n "$outfile" ] && [ ! -e "$outfile" ]; then
cat "$tmpfile" >"$outfile"
else
cat "$tmpfile"
fi
fi &&
rm -f "$tmpfile"
)
remove_comments_from_files() (
INPUT_FILES="$*"
for INPUT_FILE in ${INPUT_FILES}
do
[ -f "${INPUT_FILE}" ] || continue
sed -i '/#/d' "${INPUT_FILE}"
sed -i '/^\s*$/d' "${INPUT_FILE}"
done
)
subtract_test_lists() (
MINUEND=$1
sort "${MINUEND}" | sponge "${MINUEND}"
shift
for SUBTRAHEND in "$@"
do
sort "${SUBTRAHEND}" | sponge "${SUBTRAHEND}"
join -v 1 "${MINUEND}" "${SUBTRAHEND}" |
sponge "${MINUEND}"
done
)
merge_rendertests_files() {
BASE_FILE=$1
shift
FILES="$*"
# shellcheck disable=SC2086
cat $FILES "$BASE_FILE" |
sort --unique --stable --field-separator=, --key=1,1 |
sponge "$BASE_FILE"
}
assure_files() (
for CASELIST_FILE in $*
do
>&2 echo "Looking for ${CASELIST_FILE}..."
[ -f ${CASELIST_FILE} ] || (
>&2 echo "Not found. Creating empty."
touch ${CASELIST_FILE}
)
done
)
# Generate rendertests from scratch, customizing with fails/flakes/crashes files
generate_rendertests() (
set -e
GENERATED_FILE=$(mktemp)
TESTS_FILE_PREFIX="${SKQP_FILE_PREFIX}-${SKQP_BACKEND}_rendertests"
FLAKES_FILE="${TESTS_FILE_PREFIX}-flakes.txt"
FAILS_FILE="${TESTS_FILE_PREFIX}-fails.txt"
CRASHES_FILE="${TESTS_FILE_PREFIX}-crashes.txt"
RENDER_TESTS_FILE="${TESTS_FILE_PREFIX}.txt"
# Default to an empty known flakes file if it doesn't exist.
assure_files ${FLAKES_FILE} ${FAILS_FILE} ${CRASHES_FILE}
# skqp does not support comments in rendertests.txt file
remove_comments_from_files "${FLAKES_FILE}" "${FAILS_FILE}" "${CRASHES_FILE}"
# create an exhaustive rendertest list
"${SKQP_BIN_DIR}"/list_gms | sort > "$GENERATED_FILE"
# Remove undesirable tests from the list
subtract_test_lists "${GENERATED_FILE}" "${CRASHES_FILE}" "${FLAKES_FILE}"
# Add ",0" to each test to set the expected diff sum to zero
sed -i 's/$/,0/g' "$GENERATED_FILE"
merge_rendertests_files "$GENERATED_FILE" "${FAILS_FILE}"
mv "${GENERATED_FILE}" "${RENDER_TESTS_FILE}"
echo "${RENDER_TESTS_FILE}"
)
generate_unittests() (
set -e
GENERATED_FILE=$(mktemp)
TESTS_FILE_PREFIX="${SKQP_FILE_PREFIX}_unittests"
FLAKES_FILE="${TESTS_FILE_PREFIX}-flakes.txt"
FAILS_FILE="${TESTS_FILE_PREFIX}-fails.txt"
CRASHES_FILE="${TESTS_FILE_PREFIX}-crashes.txt"
UNIT_TESTS_FILE="${TESTS_FILE_PREFIX}.txt"
# Default to an empty known flakes file if it doesn't exist.
assure_files ${FLAKES_FILE} ${FAILS_FILE} ${CRASHES_FILE}
# Remove unitTest_ prefix
for UT_FILE in "${FAILS_FILE}" "${CRASHES_FILE}" "${FLAKES_FILE}"; do
sed -i 's/^unitTest_//g' "${UT_FILE}"
done
# create an exhaustive unittests list
"${SKQP_BIN_DIR}"/list_gpu_unit_tests > "${GENERATED_FILE}"
# Remove undesirable tests from the list
subtract_test_lists "${GENERATED_FILE}" "${CRASHES_FILE}" "${FLAKES_FILE}" "${FAILS_FILE}"
remove_comments_from_files "${GENERATED_FILE}"
mv "${GENERATED_FILE}" "${UNIT_TESTS_FILE}"
echo "${UNIT_TESTS_FILE}"
)
run_all_tests() {
rm -f "${SKQP_ASSETS_DIR}"/skqp/*.txt
}
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 'vk|gl(es)?'
then
echo "Generating rendertests.txt file"
GENERATED_RENDERTESTS=$(generate_rendertests)
cp "${GENERATED_RENDERTESTS}" "${SKQP_ASSETS_DIR}"/skqp/rendertests.txt
mkdir -p "${SKQP_RESULTS_DIR}/${SKQP_BACKEND}"
cp "${GENERATED_RENDERTESTS}" "${SKQP_RESULTS_DIR}/${SKQP_BACKEND}/generated_rendertests.txt"
return 0
fi
# The unittests.txt path is hardcoded inside assets directory,
# that is why it needs to be a special case.
if echo "${SKQP_BACKEND}" | grep -qE "unitTest"
then
echo "Generating unittests.txt file"
GENERATED_UNITTESTS=$(generate_unittests)
cp "${GENERATED_UNITTESTS}" "${SKQP_ASSETS_DIR}"/skqp/unittests.txt
mkdir -p "${SKQP_RESULTS_DIR}/${SKQP_BACKEND}"
cp "${GENERATED_UNITTESTS}" "${SKQP_RESULTS_DIR}/${SKQP_BACKEND}/generated_unittests.txt"
fi
)
resolve_tests_files() {
if [ -n "${RUN_ALL_TESTS}" ]
then
run_all_tests
return
fi
SKQP_BACKEND=${1}
if ! copy_tests_files "${SKQP_BACKEND}"
then
echo "No override test file found for ${SKQP_BACKEND}. Using the default one."
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."
# shellcheck disable=SC2012
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
}
show_reports() (
set +xe
# Unit tests produce empty HTML reports, guide the user to check the TXT file.
if echo "${SKQP_BACKENDS}" | grep -qE "unitTest"
then
# Remove the empty HTML report to avoid confusion
rm -f "${SKQP_RESULTS_DIR}"/unitTest/report.html
echo "See skqp unit test results at:"
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
REPORT_FILES=$(mktemp)
find "${SKQP_RESULTS_DIR}"/**/report.html -type f > "${REPORT_FILES}"
while read -r REPORT
do
# shellcheck disable=SC2001
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 < "${REPORT_FILES}"
# If there is no report available, tell the user that something is wrong.
if [ ! -s "${REPORT_FILES}" ]
then
echo "No skqp report available. Probably some fatal error has occured during the skqp execution."
fi
)
usage() {
cat <<EOF
Usage: $(basename "$0") [-a]
Arguments:
-a: Run all unit tests and render tests, useful when introducing a new driver to skqp.
EOF
}
parse_args() {
while getopts ':ah' opt; do
case "$opt" in
a)
echo "Running all skqp tests"
export RUN_ALL_TESTS=1
shift
;;
h)
usage
exit 0
;;
?)
echo "Invalid command option."
usage
exit 1
;;
esac
done
}
set -e
parse_args "${@}"
# Needed so configuration files can contain paths to files in /install
INSTALL="$CI_PROJECT_DIR"/install
if [ -z "$GPU_VERSION" ]; then
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
LD_LIBRARY_PATH=$INSTALL:$LD_LIBRARY_PATH
setup_backends
SKQP_BIN_DIR=${SKQP_BIN_DIR:-/skqp}
SKQP_ASSETS_DIR="${SKQP_BIN_DIR}"/assets
SKQP_RESULTS_DIR="${SKQP_RESULTS_DIR:-${PWD}/results}"
mkdir -p "${SKQP_ASSETS_DIR}"/skqp
# Show the reports on exit, even when a test crashes
trap show_reports INT TERM EXIT
SKQP_EXITCODE=0
for SKQP_BACKEND in ${SKQP_BACKENDS}
do
resolve_tests_files "${SKQP_BACKEND}"
SKQP_BACKEND_RESULTS_DIR="${SKQP_RESULTS_DIR}"/"${SKQP_BACKEND}"
mkdir -p "${SKQP_BACKEND_RESULTS_DIR}"
BACKEND_EXITCODE=0
GL_COLLAPSED=true gitlab_section_start "skqp_${SKQP_BACKEND}" "skqp logs for ${SKQP_BACKEND}"
"${SKQP_BIN_DIR}"/skqp "${SKQP_ASSETS_DIR}" "${SKQP_BACKEND_RESULTS_DIR}" "${SKQP_BACKEND}_" ||
BACKEND_EXITCODE=$?
gitlab_section_end "skqp_${SKQP_BACKEND}"
if [ ! $BACKEND_EXITCODE -eq 0 ]
then
echo "skqp failed on ${SKQP_BACKEND} tests with exit code: ${BACKEND_EXITCODE}."
else
echo "skqp succeeded on ${SKQP_BACKEND}."
fi
# Propagate error codes to leverage the final job result
SKQP_EXITCODE=$(( SKQP_EXITCODE | BACKEND_EXITCODE ))
done
exit $SKQP_EXITCODE

View File

@@ -14,6 +14,20 @@
- if: *is-scheduled-pipeline
when: never
# Rule for restricted traces jobs to only run for users with access to those
# traces (both https://gitlab.freedesktop.org/gfx-ci/tracie/traces-db-private
# for trace access, and minio bucket access for viewing result images from CI).
#
# This is a compromise, allowing some marked developers to have their MRs
# blocked on regressions to non-redistributable traces, while not blocking
# merges for other devs who would be unable to debug changes to them.
.restricted-rules:
rules:
# 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|okias|gallo|kwg|majanes|llanderwelin|zmike)$/") &&
($GITLAB_USER_LOGIN != "marge-bot" || $CI_COMMIT_BRANCH)'
when: never
# Mesa core source file dependencies that may impact any test job
# ---------------------------------------------------------------
.core-rules:
@@ -30,7 +44,6 @@
- src/drm-shim/**/*
- src/gbm/**/*
- src/gtest/**/*
- src/hgl/**/*
- src/include/**/*
# Some src/util and src/compiler files use headers from mesa/ (e.g.
# mtypes.h). We should clean that up.
@@ -39,6 +52,75 @@
- src/util/**/*
when: on_success
# Same core dependencies for doing manual runs.
.core-manual-rules:
rules:
# We only want manual jobs to show up when it's not marge's pre-merge CI
# run, otherwise she'll wait until her timeout. The exception is
# performance jobs, see below.
- if: '($GITLAB_USER_LOGIN == "marge-bot" &&
$CI_PIPELINE_SOURCE == "merge_request_event" &&
$CI_JOB_NAME !~ "/performance$/")'
when: never
- !reference [.scheduled_pipeline-rules, rules]
- changes:
*core_file_list
when: manual
# Rules for performance jobs tracking. We want perf jobs to run as code is
# merged to main, but we don't want them to block marge. So, they need to have
# only when: never or when: manual, and a separate script maintained by
# Collabora triggers the manual job after merge to main. These "never" filters
# need to come before any paths with "manual".
.performance-rules:
rules:
- !reference [.no_scheduled_pipelines-rules, rules]
# Run only on pre-merge pipelines from Marge
- if: $MESA_CI_PERFORMANCE_ENABLED == null
when: never
# Allow the merge to complete even before the job completes (since it won't
# even start until the separate script triggers on it).
allow_failure: true
.piglit-performance-base:
extends:
- .performance-rules
variables:
LAVA_JOB_PRIORITY: 40
PIGLIT_REPLAY_SUBCOMMAND: "profile"
PIGLIT_REPLAY_EXTRA_ARGS: "--db-path ${CI_PROJECT_DIR}/replayer-db/"
# More than this can hit OOM due to BOs leaked during the replay of the last frame
PIGLIT_REPLAY_LOOP_TIMES: 150
# We don't want for more than one workload to be submitted to the GPU at a time
FDO_CI_CONCURRENT: 1
# Piglit is very sparse in its status output and downloads of big traces can take a while
LAVA_DEVICE_HANGING_TIMEOUT_SEC: 600
GIT_STRATEGY: none
HWCI_FREQ_MAX: "true"
# Always use the same device
LAVA_TAGS: "cbg-0"
# Ensure that we are using the release build artifact
MINIO_ARTIFACT_NAME: mesa-${ARCH}-release
# Reset dependencies in performance jobs to enforce the release build artifact
dependencies: null
# Don't run in parallel. It is okay to performance jobs to take a little
# longer to finish, as they don't block marge from merging an MR.
parallel: null
.piglit-performance:arm64:
extends:
- .piglit-performance-base
needs:
- debian/arm64_test
- debian-arm64-release
.piglit-performance:amd64:
extends:
- .piglit-performance-base
needs:
- kernel+rootfs_amd64
- debian-release
# Mesa source file dependencies that may impact any GL driver test job.
.gl-rules:
rules:
@@ -72,6 +154,16 @@
- src/gallium/winsys/*
when: on_success
.gl-manual-rules:
rules:
- !reference [.core-manual-rules, rules]
- changes:
*mesa_core_file_list
when: manual
- changes:
*gallium_core_file_list
when: manual
# Source file dependencies that may impact any Vulkan driver build or test
.vulkan-rules:
rules:
@@ -80,6 +172,13 @@
- src/vulkan/**/*
when: on_success
.vulkan-manual-rules:
rules:
- !reference [.core-manual-rules, rules]
- changes:
*vulkan_file_list
when: manual
.softpipe-rules:
stage: software-renderer
rules:
@@ -110,6 +209,14 @@
- src/gallium/winsys/sw/**/*
when: on_success
.lavapipe-manual-rules:
stage: software-renderer
rules:
- !reference [.vulkan-manual-rules, rules]
- !reference [.gl-manual-rules, rules]
- changes: *lavapipe_file_list
when: manual
.llvmpipe-cl-rules:
stage: software-renderer
rules:
@@ -131,6 +238,7 @@
*llvmpipe_file_list
when: on_success
# TODO: remove together with Clover
.llvmpipe-clover-rules:
rules:
- !reference [.llvmpipe-cl-rules, rules]
@@ -160,6 +268,16 @@
- if: '$ANHOLT_FARM == "offline"'
when: never
.valve-farm-rules:
rules:
- if: '$VALVE_FARM == "offline"'
when: never
.austriancoder-farm-rules:
rules:
- if: '$AUSTRIANCODER_FARM == "offline"'
when: never
# Skips freedreno jobs if either of the farms we use are offline.
.freedreno-farm-rules:
rules:
@@ -170,6 +288,7 @@
# Rules for changes that impact either freedreno or turnip.
.freedreno-common-rules:
rules:
- !reference [.no_scheduled_pipelines-rules, rules]
- !reference [.freedreno-farm-rules, rules]
- changes: &freedreno_core_file_list
- src/freedreno/ci/**/*
@@ -181,6 +300,14 @@
- src/freedreno/registers/**/*
when: on_success
.freedreno-common-manual-rules:
rules:
- !reference [.freedreno-farm-rules, rules]
- !reference [.core-manual-rules, rules]
- changes:
*freedreno_core_file_list
when: manual
.freedreno-rules:
stage: freedreno
rules:
@@ -192,15 +319,33 @@
- src/gallium/winsys/freedreno/**/*
when: on_success
.freedreno-manual-rules:
stage: freedreno
rules:
- !reference [.freedreno-common-manual-rules, rules]
- !reference [.gl-manual-rules, rules]
- changes:
*freedreno_gl_file_list
when: manual
.turnip-rules:
stage: freedreno
rules:
- !reference [.freedreno-common-rules, rules]
- !reference [.vulkan-rules, rules]
- changes:
- changes: &freedreno_vulkan_file_list
- src/freedreno/vulkan/**/*
when: on_success
.turnip-manual-rules:
stage: freedreno
rules:
- !reference [.freedreno-common-manual-rules, rules]
- !reference [.vulkan-manual-rules, rules]
- changes:
*freedreno_vulkan_file_list
when: manual
# For piglit and skqp test jobs that run both GL and VK tests.
.freedreno-turnip-rules:
rules:
@@ -210,55 +355,45 @@
.freedreno-rules-restricted:
stage: freedreno
rules:
# 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|okias|gallo)$/") &&
($GITLAB_USER_LOGIN != "marge-bot" || $CI_COMMIT_BRANCH)'
when: never
- !reference [.restricted-rules, rules]
- !reference [.freedreno-rules, rules]
# Rules for GL driver performance tracking. We want them to run as code is
# merged to main, but we don't want them to block marge. So, they need to have
# only when: never or when: manual, and a separate script maintained by
# Collabora triggers the manual job after merge to main.
.gl-rules-performance:
rules:
- !reference [.no_scheduled_pipelines-rules, rules]
# 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
# Unfortunately YAML doesn't let us concatenate arrays, so we have to do the
# rules duplication manually
.freedreno-rules-performance:
stage: freedreno
rules:
- !reference [.freedreno-farm-rules, rules]
- !reference [.gl-rules-performance, rules]
- changes:
*freedreno_core_file_list
when: manual
- changes:
*freedreno_gl_file_list
when: manual
- !reference [.performance-rules, rules]
- !reference [.freedreno-manual-rules, rules]
allow_failure: true # see comment in .performance-rules, which we don't inherit this line from.
variables:
LAVA_JOB_PRIORITY: 40
# Ensure that we are using the release build artifact
MINIO_ARTIFACT_NAME: mesa-arm64-release
needs:
- debian/arm64_test
- debian-arm64-release
dependencies: null
.nouveau-rules:
stage: nouveau
rules:
- !reference [.anholt-farm-rules, rules]
- !reference [.gl-rules, rules]
- changes:
- changes: &nouveau_file_list
- src/nouveau/**/*
- src/gallium/drivers/nouveau/**/*
- src/gallium/winsys/kmsro/**/*
- src/gallium/winsys/nouveau/**/*
when: on_success
.nouveau-manual-rules:
stage: nouveau
rules:
- !reference [.anholt-farm-rules, rules]
- !reference [.gl-manual-rules, rules]
- changes:
*nouveau_file_list
when: manual
.panfrost-midgard-rules:
stage: arm
rules:
@@ -279,6 +414,19 @@
- src/panfrost/midgard/**/*
when: on_success
.panfrost-midgard-manual-rules:
stage: arm
rules:
- !reference [.collabora-farm-rules, rules]
- !reference [.gl-manual-rules, rules]
- changes: *panfrost_gallium_file_list
when: manual
- changes: *panfrost_common_file_list
when: manual
- changes:
- src/panfrost/midgard/**/*
when: manual
.panfrost-bifrost-rules:
stage: arm
rules:
@@ -294,8 +442,41 @@
- changes: &panfrost_vulkan_file_list
- src/panfrost/vulkan/*
when: on_success
- changes: &panfrost_bifrost_file_list
- src/panfrost/compiler/**/*
when: on_success
.panfrost-bifrost-manual-rules:
stage: arm
rules:
- !reference [.collabora-farm-rules, rules]
- !reference [.vulkan-manual-rules, rules]
- !reference [.gl-manual-rules, rules]
- changes:
- src/panfrost/bifrost/**/*
*panfrost_common_file_list
when: manual
- changes:
*panfrost_gallium_file_list
when: manual
- changes:
*panfrost_vulkan_file_list
when: manual
- changes:
*panfrost_bifrost_file_list
when: manual
.broadcom-common-rules:
rules:
- changes: &broadcom_file_list
- src/broadcom/meson.build
- src/broadcom/ci/**/*
- src/broadcom/cle/**/*
- src/broadcom/clif/**/*
- src/broadcom/common/**/*
- src/broadcom/compiler/**/*
- src/broadcom/drm-shim/**/*
- src/broadcom/qpu/**/*
- src/broadcom/simulator/**/*
when: on_success
.vc4-rules:
@@ -303,8 +484,8 @@
rules:
- !reference [.igalia-farm-rules, rules]
- !reference [.gl-rules, rules]
- !reference [.broadcom-common-rules, rules]
- changes:
- src/broadcom/**/*
- src/gallium/drivers/vc4/**/*
- src/gallium/winsys/kmsro/**/*
- src/gallium/winsys/vc4/**/*
@@ -315,13 +496,25 @@
rules:
- !reference [.igalia-farm-rules, rules]
- !reference [.gl-rules, rules]
- changes:
- src/broadcom/**/*
- !reference [.broadcom-common-rules, rules]
- changes: &v3d_file_list
- src/gallium/drivers/v3d/**/*
- src/gallium/winsys/kmsro/**/*
- src/gallium/winsys/v3d/**/*
when: on_success
.v3d-manual-rules:
stage: broadcom
rules:
- !reference [.igalia-farm-rules, rules]
- !reference [.gl-manual-rules, rules]
- changes:
*broadcom_file_list
when: manual
- changes:
*v3d_file_list
when: manual
.v3dv-rules:
stage: broadcom
rules:
@@ -346,38 +539,31 @@
.radv-rules:
stage: amd
rules:
- !reference [.collabora-farm-rules, rules]
- !reference [.vulkan-rules, rules]
- changes: &radv_file_list
- src/amd/**/*
- src/vulkan/**/*
when: on_success
.virgl-rules:
stage: layered-backends
rules:
- !reference [.gl-rules, rules]
- changes:
*llvmpipe_file_list
when: on_success
- changes: &virgl_file_list
- src/gallium/drivers/virgl/**/*
- src/gallium/winsys/virgl/**/*
when: on_success
# Unfortunately we can't sed the on_success from another rules set, so we have
# to do duplicate the files lists to set the job to manual (see
# .gl-rules-performance)
.virgl-iris-rules-performance:
stage: layered-backends
.radv-collabora-rules:
stage: amd
rules:
- !reference [.collabora-farm-rules, rules]
- !reference [.gl-rules-performance, rules]
- !reference [.radv-rules, rules]
.radv-valve-rules:
stage: amd
rules:
- !reference [.valve-farm-rules, rules]
- !reference [.radv-rules, rules]
.radv-valve-manual-rules:
stage: amd
rules:
- !reference [.valve-farm-rules, rules]
- !reference [.vulkan-manual-rules, rules]
- changes:
*llvmpipe_file_list
when: manual
- changes:
*virgl_file_list
*radv_file_list
when: manual
.venus-rules:
@@ -434,22 +620,38 @@
stage: intel
rules:
- !reference [.gl-rules, rules]
- changes:
- changes: &i915g_file_list
- src/gallium/drivers/i915/**/*
- src/gallium/winsys/i915/**/*
- src/intel/**/*
when: on_success
.i915g-manual-rules:
stage: intel
rules:
- !reference [.gl-manual-rules, rules]
- changes:
*i915g_file_list
when: manual
.crocus-rules:
stage: intel
rules:
- !reference [.gl-rules, rules]
- changes:
- changes: &crocus_file_list
- src/gallium/drivers/crocus/**/*
- src/gallium/winsys/crocus/**/*
- src/intel/**/*
when: on_success
.crocus-manual-rules:
stage: intel
rules:
- !reference [.gl-manual-rules, rules]
- changes:
*crocus_file_list
when: manual
.iris-rules:
stage: intel
rules:
@@ -462,17 +664,34 @@
- src/intel/**/*
when: on_success
.iris-manual-rules:
stage: intel
rules:
- !reference [.collabora-farm-rules, rules]
- !reference [.gl-manual-rules, rules]
- changes:
*iris_file_list
when: manual
# Unfortunately we can't sed the on_success from another rules set, so we have
# to do duplicate the files lists to set the job to manual (see
# .gl-rules-performance)
# .performance-rules)
.iris-rules-performance:
stage: intel
rules:
- !reference [.collabora-farm-rules, rules]
- !reference [.gl-rules-performance, rules]
- !reference [.performance-rules, rules]
- !reference [.gl-manual-rules, rules]
- changes:
*iris_file_list
when: manual
allow_failure: true # see comment in .performance-rules, which we don't inherit this line from.
variables:
LAVA_JOB_PRIORITY: 40
MINIO_ARTIFACT_NAME: "mesa-amd64-release"
needs:
- kernel+rootfs_amd64
- debian-release
.anv-rules:
stage: intel
@@ -484,6 +703,33 @@
- src/intel/**/*
when: on_success
.anv-manual-rules:
stage: intel
rules:
- !reference [.collabora-farm-rules, rules]
- !reference [.vulkan-manual-rules, rules]
- changes:
- src/intel/**/*
when: on_success
.hasvk-rules:
stage: intel
rules:
- !reference [.anholt-farm-rules, rules]
- !reference [.vulkan-rules, rules]
- changes:
- src/intel/**/*
when: on_success
.hasvk-manual-rules:
stage: intel
rules:
- !reference [.anholt-farm-rules, rules]
- !reference [.vulkan-manual-rules, rules]
- changes:
- src/intel/**/*
when: on_success
.intel-rules:
stage: intel
rules:
@@ -497,6 +743,50 @@
- src/intel/**/*
when: on_success
.virgl-rules:
stage: layered-backends
rules:
- !reference [.gl-rules, rules]
- changes:
*llvmpipe_file_list
when: on_success
- changes: &virgl_file_list
- src/gallium/drivers/virgl/**/*
- src/gallium/winsys/virgl/**/*
when: on_success
.virgl-iris-manual-rules:
stage: layered-backends
rules:
- !reference [.collabora-farm-rules, rules]
- !reference [.gl-manual-rules, rules]
- changes:
*virgl_file_list
when: manual
- changes:
*iris_file_list
when: manual
.virgl-iris-rules-performance:
stage: layered-backends
rules:
- !reference [.collabora-farm-rules, rules]
- !reference [.performance-rules, rules]
- !reference [.gl-manual-rules, rules]
- changes:
*llvmpipe_file_list
when: manual
- changes:
*virgl_file_list
when: manual
allow_failure: true # see comment in .performance-rules, which we don't inherit this line from.
variables:
LAVA_JOB_PRIORITY: 40
MINIO_ARTIFACT_NAME: "mesa-amd64-release"
needs:
- kernel+rootfs_amd64
- debian-release
.zink-common-rules:
rules:
- !reference [.gl-rules, rules]
@@ -504,6 +794,13 @@
- src/gallium/drivers/zink/**/*
when: on_success
.zink-common-manual-rules:
rules:
- !reference [.gl-manual-rules, rules]
- changes:
- src/gallium/drivers/zink/**/*
when: manual
.zink-lvp-rules:
stage: layered-backends
rules:
@@ -516,12 +813,37 @@
- !reference [.anv-rules, rules]
- !reference [.zink-common-rules, rules]
.zink-anv-manual-rules:
stage: layered-backends
rules:
- !reference [.anv-manual-rules, rules]
- !reference [.zink-common-manual-rules, rules]
.zink-anv-rules-restricted:
stage: layered-backends
rules:
- !reference [.restricted-rules, rules]
- !reference [.anv-rules, rules]
- !reference [.zink-common-rules, rules]
.zink-turnip-rules:
stage: layered-backends
rules:
- !reference [.turnip-rules, rules]
- !reference [.zink-common-rules, rules]
.zink-turnip-manual-rules:
stage: layered-backends
rules:
- !reference [.turnip-manual-rules, rules]
- !reference [.zink-common-manual-rules, rules]
.zink-radv-manual-rules:
stage: layered-backends
rules:
- !reference [.radv-valve-manual-rules, rules]
- !reference [.zink-common-manual-rules, rules]
# Unfortunately YAML doesn't let us concatenate arrays, so we have to do the
# rules duplication manually
.windows-build-rules:
@@ -545,6 +867,8 @@
when: on_success
- changes:
- src/microsoft/**/*
- src/gallium/frontends/va/*
- src/gallium/targets/va/*
when: on_success
- changes:
*radv_file_list
@@ -565,7 +889,6 @@
rules:
- if: '$MICROSOFT_FARM == "offline"'
when: never
- !reference [.no_scheduled_pipelines-rules, rules]
- !reference [.core-rules, rules]
- changes: &spirv2dxil_file_list
- src/microsoft/ci/*
@@ -588,8 +911,9 @@
.etnaviv-rules:
stage: etnaviv
rules:
- !reference [.austriancoder-farm-rules, rules]
- !reference [.gl-rules, rules]
- changes:
- changes: &etnaviv_file_list
- src/etnaviv/**/*
- src/gallium/drivers/etnaviv/**/*
- src/gallium/winsys/etnaviv/**/*
@@ -598,6 +922,14 @@
- src/gallium/winsys/etnaviv/**/*
when: on_success
.etnaviv-manual-rules:
stage: etnaviv
rules:
- !reference [.gl-manual-rules, rules]
- changes:
*etnaviv_file_list
when: manual
# Rules for unusual architectures that only build a subset of drivers
.ppc64el-rules:
rules:
@@ -643,8 +975,15 @@
# Rules for linters
.lint-rustfmt-rules:
rules:
- !reference [.no_scheduled_pipelines-rules, rules]
- !reference [.core-rules, rules]
- changes:
- src/**/*.rs
when: on_success
.lint-clang-format-rules:
rules:
- !reference [.core-rules, rules]
- changes:
- src/**/asahi/**/*
- src/**/panfrost/**/*
when: on_success

Some files were not shown because too many files have changed in this diff Show More