Commit graph

160371 commits

Author SHA1 Message Date
Mike Blumenkrantz
b3be2ace59 zink: PIPE_CAP_SHAREABLE_SHADERS
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18689>
2022-09-23 17:02:11 +00:00
Mike Blumenkrantz
10ed67867e zink: use screen param for zink_shader_free()
the context is no longer used

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18689>
2022-09-23 17:02:11 +00:00
Mike Blumenkrantz
ac1b343477 zink: use program's context for cache deletion
this forces deletion of the program from its owner context under lock

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18689>
2022-09-23 17:02:11 +00:00
Mike Blumenkrantz
275e4a9c89 zink: add locking for program caches
these are context-based, so destroying them from another context needs locks

locks are not currently able to be contended

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18689>
2022-09-23 17:02:11 +00:00
Mike Blumenkrantz
a10cad018b zink: don't try to delete programs from the cache if stages have been modified
this is guaranteed to fail anyway

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18689>
2022-09-23 17:02:11 +00:00
Mike Blumenkrantz
eab18cb7a2 zink: use screen params for program reference functions
these never used the context anyway

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18689>
2022-09-23 17:02:11 +00:00
Mike Blumenkrantz
697eb99d69 zink: track the owner context for gfx programs
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18689>
2022-09-23 17:02:11 +00:00
Mike Blumenkrantz
2fa7091263 zink: track a mask of gfx stages remaining in gfx programs
this provides a hint to improve program deletion

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18689>
2022-09-23 17:02:11 +00:00
Joshua Ashton
0f770caa23 freedreno: Disable 8bpp_ubwc on a6xx gen2
Fixes text corruption in VSCode on a680.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18779>
2022-09-23 16:08:33 +00:00
Ruijing Dong
7bf8af2c8d radeon/vcn: process invalid frame rate in encoding
Just in case app sending zeros in frame rate,
which could cause zero division, it will be treated
as fixed value, 30fps.

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/18737>
2022-09-23 13:52:46 +00:00
Pierre-Eric Pelloux-Prayer
4fdf10fdaf radeonsi/gfx11: don't set VERTS_PER_SUBGRP to 0
It seems slower.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Fixes: 25a66477d0 ("radeonsi/gfx11: register changes")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18758>
2022-09-23 13:29:18 +00:00
Pierre-Eric Pelloux-Prayer
7483e50404 winsys/amdgpu: init 'r' before using it
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Fixes: 471c82d21e ("winsys/amdgpu: flatten huge if and reorder code in amdgpu_cs_submit_ib")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18758>
2022-09-23 13:29:18 +00:00
Tapani Pälli
58829d9f11 iris: implement Wa_14016118574
After each 3DPRIMITIVE, we need to send a dummy post sync op if point or
line list was used or if had only 1 or 2 vertices per primitive.

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/18746>
2022-09-23 12:27:05 +00:00
Tapani Pälli
f2645229c2 anv: implement Wa_14016118574
After each 3DPRIMITIVE, we need to send a dummy post sync op if point or
line list was used or if had only 1 or 2 vertices per primitive.

v2: add missing _3DPRIM_POINTLIST_BF (Lionel)

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/18746>
2022-09-23 12:27:05 +00:00
Erik Faye-Lund
c7ff9876d6 zink: correct emulation of luminance-alpha formats
util_format_luminance_to_red returns a red-alpha format, not a red-green
format, which is what we need in Vulkan. So let's also call
emulate_red_alpha so we can finish up with a valid format.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18596>
2022-09-23 10:55:15 +00:00
Erik Faye-Lund
e7f192030c zink: fix luminance/luminance-alpha emulation
We need to check the pipe_resource's format, not the texture-view
format. We're trying to overcome differences in the physical memory
layout, not the interpretation of the view.

But since we're now looking at the resource-format, we also need to take
the view-swizzle into account, because the state tracker likes to do
blits between LA and RA formats.

This had little effect in practice for luminance formats, but for
luminance-alpha formats things went kinda sideways. But luckily,
we don't actually use those formats yet, triggering state-tracker
emulation instead.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18596>
2022-09-23 10:55:15 +00:00
Erik Faye-Lund
09afab4c29 zink: refactor swizzle-clamping code
It's going to be a lot easier to work on this if we can use loops
instead of open-coding. So let's move the swizzles into arrays, process
them, and then stick it back into their place at the end.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18596>
2022-09-23 10:55:15 +00:00
Erik Faye-Lund
51c7691108 zink: fixup indent
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18596>
2022-09-23 10:55:15 +00:00
Erik Faye-Lund
37b66f7874 zink: fix luminance clears
We should clear the red and green channels for luminance alpha formats,
and leave the other channels alone.

It doesn't really matter much what we're filling them in with, and the
rest of the code is kinda confused, and either does 0 or 1 a bit
randomly. Randonly pick 1.0 for the alpha and 0 for the rest.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18596>
2022-09-23 10:55:15 +00:00
Erik Faye-Lund
21ec469a2f zink: emulate latc formats with rgtc
util_format_luminance_to_red returns PIPE_FORMAT_NONE for LATC formats,
because there's no red-alpha variant of it, only red-green.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18596>
2022-09-23 10:55:15 +00:00
Erik Faye-Lund
88ed8245a8 docs: add an amber article
This gives a brief introduction to the Amber branch, and where to
find documentation for it.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18648>
2022-09-23 10:49:08 +00:00
Samuel Pitoiset
eded5bda4e radv/ci: add piglit testing with Zink on NAVI10
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18315>
2022-09-23 11:15:16 +02:00
Samuel Pitoiset
940246b058 zink/ci: update list of flakes for Piglit with RADV on NAVI10
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18315>
2022-09-23 11:14:22 +02:00
Samuel Pitoiset
e133f0f9ca zink/ci: update list of expected failures with RADV on NAVI10
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18315>
2022-09-23 11:13:53 +02:00
Samuel Pitoiset
74cc2a20cd zink/ci: skip GLX tests with RADV
Can't work with GBM.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18315>
2022-09-23 11:13:51 +02:00
Samuel Pitoiset
7ced2ed740 zink/ci: skip arb_shader_clock with RADV
They are too random.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18315>
2022-09-23 11:13:49 +02:00
Samuel Pitoiset
32b0c82ba8 zink/ci: skip ext_external_objects from Piglit with RADV
This subset randomly hangs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18315>
2022-09-23 11:13:48 +02:00
Lionel Landwerlin
e76e3d9cea intel/nir/rt: fixup alignment of memcpy iterations
Not sure if fixes anything because it's always 16 at least, but this
is more correct.

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/17396>
2022-09-23 08:29:17 +00:00
Lionel Landwerlin
139e8f4635 intel/fs: fixup a64 messages
And run algebraic when either int64 for float64 are not supported so
those don't end up in the generated code.

Cc: mesa-stable
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/17396>
2022-09-23 08:29:17 +00:00
Lionel Landwerlin
838bbdcf2e intel/nir/rt: store ray query state in scratch
Initially I tried to store ray query state in the RT scratch space but
got the offset wrong. In the end putting this in the scratch surface
makes more sense, especially for non RT stages.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c78be5da30 ("intel/fs: lower ray query intrinsics")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17396>
2022-09-23 08:29:17 +00:00
Lionel Landwerlin
f7fab09a07 intel/nir/rt: change scratch check validation
It's very unfortunate that we have the RT scratch being conflated with
the usual scratch. In our implementation those are 2 different buffers.

The usual scratch access are done through the scratch surface state
(delivered through thread payload), while RT scratch (which outlives
thread dispatch with shader calls) is its own buffer.

So checking the NIR scratch size makes no sense as we can have normal
scratch accesses completely unrelated to RT scratch accesses.

This change switches the validation by looking at whether the scratch
base pointer intrinsic is being used (which is what we use/abuse to
implement RT scratch).

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c78be5da30 ("intel/fs: lower ray query intrinsics")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17396>
2022-09-23 08:29:17 +00:00
Lionel Landwerlin
259b1647e6 intel/nir/rt: fix ray query proceed level
Initially the level is world (top level), then it's whatever level the
potential hit is.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c78be5da30 ("intel/fs: lower ray query intrinsics")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17396>
2022-09-23 08:29:17 +00:00
Lionel Landwerlin
3f01071c79 intel/nir/rt: remove ray query mem hit writes at initialization
This will not even be read by HW.

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/17396>
2022-09-23 08:29:17 +00:00
Lionel Landwerlin
f843bec7de intel/nir/rt: spill/fill the entire ray query data
We need the traversal stack to saved/restored along with mem hits.
Total spill/fill is 256bytes.

We can potentially optimize this but we have to be very careful about
what state the query is in.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c78be5da30 ("intel/fs: lower ray query intrinsics")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17396>
2022-09-23 08:29:17 +00:00
Lionel Landwerlin
a88f725eea intel/nir/rt: fixup generate hit
This function copies the potential hit from its memory location to the
committed hit location. A couple of fields got their bit offset wrong.

Fixes some CTS tests in dEQP-VK.ray_query.*

v2: Copy primitive/instance leaf pointers

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 0465714790 ("intel/nir/rt: add more helpers for ray queries")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17396>
2022-09-23 08:29:17 +00:00
Xin LI
2905dd7951 meson: Improve detection of qsort_r().
Instead of trying to guess the interface style by solely checking
the OS name, check if a fake test program can be built and linked.
This will give more accurate result when FreeBSD and other systems
moved to the interface based on GNU qsort_r().

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18527>
2022-09-23 07:45:01 +00:00
Gert Wollny
6be7c2ef51 r600: Make NIR the default shader IR
By default sb is disabled, to enable it one can
set
  R600_DEBUG=nirsb

TGSI can be enabled by using
  R600_DEBUG=use_tgsi

In this case "sb" will be enabled, but one can use
the TGSI backend without sb by setting

  R600_DEBUG=use_tgsi,sb

Closes: #6858

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18753>
2022-09-23 07:34:31 +00:00
Gert Wollny
ad74cd3c3f r600: Add slot to ALU disassambly
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18753>
2022-09-23 07:34:31 +00:00
Dave Airlie
0995c6827a lavapipe: use slow clear path if conditional rendering.
the ->clear path checks render condition which isn't necessary.

Fixes dEQP-VK.conditional_rendering.draw.condition_host_memory_expect_noop_rp_clear.draw*

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18686>
2022-09-23 07:20:18 +00:00
Samuel Pitoiset
31dc15b977 radv: rework and rename radv_make_buffer_descriptor()
Pass the VA directly and rename to radv_make_texel_buffer_descriptor().
This helper will be re-used for future work.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18750>
2022-09-23 06:55:21 +00:00
Samuel Pitoiset
81d7a6bdff radv: remove unnecessary radv_buffer_view::vk_format
It's not really useful.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18750>
2022-09-23 06:55:21 +00:00
Samuel Pitoiset
a5ca3c1638 radv: pass a VkSampler to write_sampler_descriptor()
For future work, and remove useless radv_device parameter.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18750>
2022-09-23 06:55:21 +00:00
Iago Toral Quiroga
4ea916f704 broadcom/compiler: don't apply robust buffer access to shared variables
This feature is only concerned with buffers bound through a descriptor
set. We are still keeping the code for this (disabled by default) since
it may be useful for debugging some scenarios.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18744>
2022-09-23 06:27:54 +00:00
Iago Toral Quiroga
44b02b5cb1 broadcom/compiler: handle shared stores with robust buffer access
For some reason we supported all shared intrinsics but this one.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18744>
2022-09-23 06:27:54 +00:00
Iago Toral Quiroga
b2bce9c98a broadcom/compiler: fix robust buffer access
Our implemention was bogus, it was only putting a cap on the offset
based on the aligned buffer size and this doesn't ensure the access
to the buffer happens within its valid range.

I think the only reason we have been passing the tests is that we
align all buffers sizes to 256B and the tests create buffers with a
size that is smaller than that (like 64B). When get the size of the
buffer from the shader, we get the actual bound range (so 64B in this
case) and by capping to that we don't ensure the access will stay
within that range, but we ensure it will stay within the underlying
memory bound to the buffer (256B), and this is fine by the spec,
however, I think if the actual buffer range was the same as the
underlying allocation we would fail the tests.

A valid behavior for robust buffer access on an out-of-bounds access
is to return any valid bytes within the buffer, so we can just
make that offset 0.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18744>
2022-09-23 06:27:54 +00:00
Paul Gofman
e7e989f62e vbo/dlist: keep buffers used in loopback_vertex_list() mapped.
When display list loopback path is hit the major performance
drop during glCallList() happens due to constantly mapping and
unmapping the buffer.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17285>
2022-09-23 04:41:50 +00:00
Marek Olšák
4d44399c2e gallium/u_threaded: add an option for unsychronized create_fence_fd
And enable it for radeonsi. This may be needed by Android.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18731>
2022-09-23 03:47:50 +00:00
Mike Blumenkrantz
21ba47c821 zink: handle culldistance xfb outputs like clipdistance
fixes:
spec@ext_transform_feedback@builtin-varyings gl_culldistance

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18724>
2022-09-23 02:49:08 +00:00
Mike Blumenkrantz
1146793881 glsl: fix gl_CullDistance xfb linking
this matches the behavior for gl_ClipDistance

ref #7152

Fixes: 0c8492cd3b ("glsl: fix location for array subscript")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18724>
2022-09-23 02:49:08 +00:00
Caio Oliveira
eb6aa25d16 spirv: Make a helper function to check glslang/shaderc
When deciding on workarounds that apply to GLSLang we should also check
for ShaderC (when using glslang).  Add a helper to do that and reuse in
the three places we check for it.

This patch will now consider shaderc for wa_glslang_cs_barrier workaround.

Suggested by Timur Kristóf.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18442>
2022-09-23 01:25:48 +00:00