Karol Herbst [Wed, 24 May 2023 14:30:04 +0000 (16:30 +0200)]
nv50/ir: convert to scoped_barrier
Contrary to how we implemented barriers the MEMBAR instruction actually
does not allow us to specify which memory to synchronize. We can only
specify the scope.
No regressions on TU102.
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: M Henning <drawoc@darkrefraction.com>
Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23208>
Juan A. Suarez Romero [Tue, 6 Jun 2023 11:51:38 +0000 (13:51 +0200)]
v3d: handle samplerExternalOES
Add handling for GLSL_SAMPLER_DIM_EXTERNAL.
Fixes `spec@oes_egl_image_external_essl3@oes_egl_image_external_essl3`.
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23469>
Yonggang Luo [Mon, 5 Jun 2023 09:26:51 +0000 (17:26 +0800)]
vulkan: move nir_convert_ycbcr into vulkan runtime
This only used by vulkan drivers and depends on vulkan util, so do the move to decouple
nir from vulkan utils
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23444>
Mike Blumenkrantz [Wed, 10 May 2023 00:16:52 +0000 (20:16 -0400)]
zink: also disable bg compile for compute with nobgc
forgot this one in the original MR
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22933>
Emma Anholt [Mon, 5 Jun 2023 19:18:23 +0000 (12:18 -0700)]
ci/etnaviv: Update some xfails common between the last 3 nightly runs.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23446>
Emma Anholt [Mon, 5 Jun 2023 19:12:14 +0000 (12:12 -0700)]
ci/crocus: Update trace hash for the neverball regression.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23446>
Mike Blumenkrantz [Thu, 1 Jun 2023 13:18:50 +0000 (09:18 -0400)]
lavapipe: fix memory budget reporting
I put this on the wrong struct
Fixes:
1c42056ee12 ("lavapipe: EXT_memory_budget")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23395>
Dave Airlie [Tue, 6 Jun 2023 00:59:38 +0000 (10:59 +1000)]
lavapipe: don't remove queue family barriers.
This fixes the remaining barrier issues.
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23453>
Dave Airlie [Tue, 6 Jun 2023 00:08:10 +0000 (10:08 +1000)]
llvmpipe: emit fences for barrier.
I tried emitting less here but I'm just gonna hit it with the big
seq_cst hammer.
Fixes:
dEQP-VK.memory_model.message_passing.*
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23453>
Yiwei Zhang [Thu, 1 Jun 2023 23:56:05 +0000 (16:56 -0700)]
docs: update venus VK_EXT_device_memory_report support
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23411>
Yiwei Zhang [Thu, 1 Jun 2023 23:54:30 +0000 (16:54 -0700)]
venus: enable VK_EXT_device_memory_report
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23411>
Yiwei Zhang [Sat, 3 Jun 2023 07:01:48 +0000 (00:01 -0700)]
venus: emit device memory report for device memory events
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23411>
Yiwei Zhang [Thu, 1 Jun 2023 22:59:34 +0000 (15:59 -0700)]
venus: handle device memory report requests
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23411>
Yiwei Zhang [Sat, 3 Jun 2023 07:16:06 +0000 (00:16 -0700)]
venus: refactor vn_device_memory to track VkMemoryType
The VkMemoryType::heapIndex will be used by device memory report.
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23411>
Rob Clark [Tue, 6 Jun 2023 14:43:35 +0000 (07:43 -0700)]
freedreno/a6xx: Use idalloc for samp/view seqno's
Samplers and views can be re-created dynamically or long-lasting,
resulting in the possibility of a tex cache collision. So instead
of a simple counter, use idalloc.
Fixes:
a3c73987ab92 ("freedreno/a6xx: Move rsc seqno out of tex cache key")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9111
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23470>
Rob Clark [Tue, 6 Jun 2023 14:33:06 +0000 (07:33 -0700)]
freedreno/a6xx: Directly invalidate on samp view update
Instead of incrementing the seqno, just directly invalidate any existing
tex cache entries when we update a sampler view.
No reason not to just directly clear stale entries, and avoiding to re-
assign the seqno will simplify the next patch.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23470>
Rob Clark [Mon, 5 Jun 2023 14:19:39 +0000 (07:19 -0700)]
freedreno/batch: Add driver-thread assert
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23470>
Rob Clark [Tue, 30 May 2023 18:57:35 +0000 (11:57 -0700)]
freedreno: Add extra assert
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23470>
Alyssa Rosenzweig [Fri, 19 May 2023 17:00:57 +0000 (13:00 -0400)]
asahi: Remove stale comments
Trivial.
It is now later and I have confirmed with Piglit.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Asahi Lina [Fri, 2 Jun 2023 08:25:49 +0000 (17:25 +0900)]
asahi: Do not leak meta shader NIR
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Asahi Lina [Fri, 2 Jun 2023 08:20:44 +0000 (17:20 +0900)]
asahi: Fix memory leak in agx_nir_lower_sysvals()
We need to free the dynarray.
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Asahi Lina [Fri, 2 Jun 2023 07:51:07 +0000 (16:51 +0900)]
asahi: Use os_dupfd_cloexec() instead of dup()
This fixes file descriptor leaks in konsole/etc.
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Mon, 29 May 2023 23:51:21 +0000 (19:51 -0400)]
asahi: Decompress with format reinterpretation
The internal layout used with compression partially depends on the pixel format.
Some limited reinterpretation is definitely allowed (linear vs sRGB views of the
same physical format are documented by Apple as allowed). Some reinterpretations
are definitely forbidden (R8G8B8A8 vs R32, I think). At some point we'll need to
work out the exact rule. I suspect the answer is that "you can reinterpret iff
the Channels field matches". Meaning that R8G8B8A8_UNORM and B8G8R8A8_SINT would
be compatible, but not R16G16_UNORM. But I haven't tested that.
Fixes all fails in:
dEQP-GLES31.functional.image_load_store.*.format_reinterpret.*
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Fri, 19 May 2023 20:00:34 +0000 (16:00 -0400)]
asahi: Decompress writable images
We can't write to compressed images. Decompress on the fly if needed. mesa/st
doesn't bother to do this for us.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Fri, 19 May 2023 19:59:54 +0000 (15:59 -0400)]
asahi: Extract transition_resource helper
We'll reuse this logic for images. Extract it out and generalize it.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Fri, 12 May 2023 12:13:22 +0000 (08:13 -0400)]
asahi: Add ASAHI_MESA_DEBUG=nowc flag
Add a debug flag to disable write-combining as a performance hack. This may help
diagnose slowness with glReadPixels() heavy workloads like screen capture.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Mon, 15 May 2023 20:48:14 +0000 (16:48 -0400)]
agx: Stop bit-inexact conversion propagation
Despite being mathematically equivalent, the following code sequences are not
bit-identical under IEEE 754 rules due to differing internal precision:
fadd16 r0l, r2, 0.0 z = f2f16 x
fadd16 r1h, r0l, r0h w = fadd z, y
versus
fadd32 r1h, r2, r0h f2f16(w) = fadd x, f2f32(y)
This is probably fine under GL's relaxed floating point precision rules, but
it's definitely not ok with the more strict OpenCL or Vulkan. It also is a
potential problem with GL invariance rules, if we get different results for the
same shader depending whether we did a monolithic compile or a fast link. The
place for doing inexact transformations is NIR, when we have the information
available to do so correctly. By the time we get to the backend, everything we
do needs to be bit-exact to preserve sanity.
Fixes dEQP-GLES2.functional.shaders.algorithm.rgb_to_hsl_vertex. We believe that
this is a CTS bug, but it's a useful one since it uncovered a serious driver bug
that would bite us in the much less friendly Vulkan (or god forbid OpenCL) CTS
later. It also seems like a magnet for GL app bugs, the fp16 support we do now
is uncovering bad enough bugs as it is.
shader-db results are pretty abysmal, though :|
total instructions in shared programs: 1537964 -> 1571328 (2.17%)
instructions in affected programs: 670231 -> 703595 (4.98%)
total bytes in shared programs:
10533984 ->
10732316 (1.88%)
bytes in affected programs: 4662414 -> 4860746 (4.25%)
total halfregs in shared programs: 483448 -> 474541 (-1.84%)
halfregs in affected programs: 58867 -> 49960 (-15.13%)
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Thu, 25 May 2023 17:22:53 +0000 (13:22 -0400)]
asahi: Advertise GL 3.1
We now have support for baseline MSAA, except for support for eMRT. But hey,
this gets us 99% of the way there, so it's worth flipping on at least in
agx/next.
We can also advertise dual-source blending again. It was reverted since Chromium
freaks out with dual-source blending on a GL 2.1 driver, but since we're
advertising GL 3.1 now, it's ok.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Thu, 25 May 2023 17:22:53 +0000 (13:22 -0400)]
agx: Emit shader info late
So we can take into account program transformations for the final info. This
reports more accurate metadata.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Thu, 25 May 2023 17:22:52 +0000 (13:22 -0400)]
asahi: Use nonempty tib for MSAA
Affects
dEQP-GLES31.functional.texture.multisample.samples_4.use_texture_depth_2d. This
needs tests, but whatever, 70% of the YouTube chat said to land the hack.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
HackHackHacked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Acked-by: YouTube Viewers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Thu, 25 May 2023 17:22:52 +0000 (13:22 -0400)]
asahi: Lower MSAA
Use the shiny new passes to lower fragment shaders. Monolithic only right now.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Thu, 25 May 2023 17:22:51 +0000 (13:22 -0400)]
agx: Handle centroid and sample interpolation
Works great now that all the infrastructure is wired up.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Thu, 25 May 2023 17:22:51 +0000 (13:22 -0400)]
agx: Model interpolation for iter instructions
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Thu, 25 May 2023 17:22:50 +0000 (13:22 -0400)]
agx: Split iter and iterproj instructions
These are different (though related) instructions. I've split them in applegpu,
let's mirror that here. This simplifies the IR a bit.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Thu, 25 May 2023 17:22:50 +0000 (13:22 -0400)]
asahi,agx: Call lower_discard_zs_emit in the driver
The driver needs to lower MSAA (because only it knows the sample count). MSAA
lowering depends on discards getting lowered (in order to get sample masks on the
discards for sample shading to work properly). Discard lowering depends on all
discards emitted. But the driver needs to lower clip planes which generates
discards. To break the circular dependency, we have the driver call the
discard lowering pass itself (in between lowering clip planes and lowering
MSAA). Technically, this is probably a layering violation but it's the least
gross solution I see.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Thu, 25 May 2023 17:22:49 +0000 (13:22 -0400)]
agx: Lower discard in NIR
We already lower discard in NIR when depth/stencil writes are used in the
shader. In this patch, we extend that lowering for when depth/stencil writes are
not used, in which case the discard is lowered to a sample_mask instruction.
This is a step towards multisampling, since the old lowering assumed
single-sample and there's no way to express a sample mask with a standard NIR
discard instructions so we need to lower in NIR anyway for sample shading (i.e.
if a discard_if diverges between samples in a pixel).
This changes the lowering for discard_if to be free of control flow (instead
executing a sample mask instruction unconditionally). This seems to be slightly
faster in SuperTuxKart and slightly slower in Dolphin, but I'm not too worried
right now.
To make this work, we do need some extra lowering to ensure we always execute a
sample_mask instruction, in case a discard_if is buried in other control flow
(as occurs with Dolphin's ubershaders). So that's added too. We need that for
MSAA anyway, so pardon the line count.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Thu, 25 May 2023 17:22:49 +0000 (13:22 -0400)]
agx: Enable tag writes when sample mask written
Including indirectly via discard/demote.
Fixes graphical artefacts in Chromium when API sample masks are hooked up, which
will result in fragment programs that do not write colour/depth but do a lone
sample mask write. These need tag writes enabled (according to a trace from
Metal for a case constructed to test this scenario).
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Thu, 25 May 2023 17:22:49 +0000 (13:22 -0400)]
agx: Handle sample_mask_agx
1:1 translation.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Thu, 25 May 2023 17:22:48 +0000 (13:22 -0400)]
agx: Plumb in nir_intrinsic_load_sample_mask_in
We have a special register for this, although this will need some lowering for
glSampleMask.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Thu, 25 May 2023 17:22:47 +0000 (13:22 -0400)]
agx: Model both sources of sample_mask
We need to control both sources to implement multisampling properly. The
semantic is something like:
foreach sample in the first mask {
if correspond bit in second bit set {
make sample live
} else {
make sample dead
}
}
But I'm reticent to document more formally until the details are really
understood and properly tested.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Thu, 25 May 2023 17:22:47 +0000 (13:22 -0400)]
asahi: Plumb ppp_multisamplectl into shaders
This lets us implement gl_SamplePositions in a cheap way with some ALU in the
shader preamble.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Thu, 25 May 2023 17:22:46 +0000 (13:22 -0400)]
asahi: Plumb API sample mask into shaders
So we can lower glSampleMask() appropriately.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Thu, 25 May 2023 17:22:46 +0000 (13:22 -0400)]
asahi: Set uses_sample_shading for background program
If we read gl_SampleID we need the lowering, even though we don't call into
gather_info to set the bit for us. So set the bit manually.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Thu, 25 May 2023 17:22:46 +0000 (13:22 -0400)]
agx: Assert that sample shading is lowered
Lest someone mess this up later and then try to "implement" these intrinsics in
the backend.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Thu, 25 May 2023 17:22:45 +0000 (13:22 -0400)]
asahi: Add alpha-to-coverage (and alpha-to-one) lowering
This should probably be shared code but meh.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Thu, 25 May 2023 17:22:45 +0000 (13:22 -0400)]
asahi: Add passes to lower sample intrinsics
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Thu, 25 May 2023 17:22:44 +0000 (13:22 -0400)]
asahi: Add passes to lower MSAA
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Thu, 25 May 2023 17:22:42 +0000 (13:22 -0400)]
agx: Use textures_used, not num_textures
The latter doesn't account for holes. Fixes regression in Neverball on Asahi.
Fixes:
e607a89f ("mesa/main: ff-fragshader to nir")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Sun, 21 May 2023 03:21:57 +0000 (23:21 -0400)]
agx: Constant fold when optimizing int64
Otherwise we can get bcsel(false, ...) in the final optimized code, which isn't
great.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Alyssa Rosenzweig [Fri, 12 May 2023 17:33:57 +0000 (13:33 -0400)]
agx: Set support_16bit_alu
Allows some more optimizations.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23480>
Gert Wollny [Tue, 30 May 2023 09:46:32 +0000 (11:46 +0200)]
r600/sfn: Switch to scoped barriers
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23272>
Gert Wollny [Tue, 30 May 2023 09:46:10 +0000 (11:46 +0200)]
r600/sfn: assert that group barrier is not emitted in divergent code flow
Also rename emit_barrier to emit_group_barrier
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23272>
Caio Oliveira [Sat, 3 Jun 2023 00:12:44 +0000 (17:12 -0700)]
spirv: Add workaround for OpImageQueryLevels with Multi-sampled images
Warn and replace the query with the constant value 1.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9148
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23407>
Yonggang Luo [Sat, 3 Jun 2023 23:34:38 +0000 (07:34 +0800)]
compiler: Remove redundant struct glsl_type in nir_types.h
The struct glsl_type already declared in glsl_types.h
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23420>
Yonggang Luo [Sat, 3 Jun 2023 23:31:56 +0000 (07:31 +0800)]
compiler: Remove the need include "util/glheader.h" and "util/ralloc.h" in glsl_types.h
These includes can be moved into .cpp files and down-stream headers
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23420>
Yonggang Luo [Sat, 3 Jun 2023 22:48:50 +0000 (06:48 +0800)]
mesa, compiler: Move gl_texture_index to glsl_types.h
This move is done for decouple glsl_types.h from src/mesa/*
This is achieved by move gl_texture_index from src/mesa/main/menums.h to src/compiler/shader_enums.h
And move ATOMIC_COUNTER_SIZE,MAX_VERTEX_STREAMS from src/mesa/main/config.h to src/compiler/shader_enums.h
Move include main/[config|menums].h into glsl/glsl_parser_extras.h from glsl_types.h
As now glsl_types.h should not include headers from src/mesa/*
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23420>
Yonggang Luo [Sun, 4 Jun 2023 05:54:21 +0000 (13:54 +0800)]
compiler: Move can_implicitly_convert_to helper to glsl module from glsl_types.h
This move is done for decouple glsl_types from glsl_parser_extras
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23420>
Yonggang Luo [Sun, 4 Jun 2023 05:52:55 +0000 (13:52 +0800)]
compiler: Combine duplicated implementation of is_gl_identifier into glsl_types.h
As glsl_types.cpp also called is_gl_identifier, so move it into glsl_types.h,
this will help the decouple glsl_types.h from src/compiler/glsl/*
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23420>
Patrick Lerda [Thu, 1 Jun 2023 23:33:03 +0000 (01:33 +0200)]
r600: fix r600_draw_vbo() buffer overflow
The previous implementation was copying the data using the
aligned length (size_dw). The aligned length could overflow
the original buffer size.
For instance, this issue is triggered with "piglit/bin/draw-batch -auto -fbo":
==5736==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fff139c77e8 at pc 0x7f25b350a9a0 bp 0x7fff139c6cb0 sp 0x7fff139c6460
READ of size 8 at 0x7fff139c77e8 thread T0
#0 0x7f25b350a99f in __interceptor_memcpy (/usr/lib64/libasan.so.6+0x3c99f)
#1 0x7f25a8fcdf24 in radeon_emit_array ../src/gallium/include/winsys/radeon_winsys.h:760
#2 0x7f25a8fcdf24 in r600_draw_vbo ../src/gallium/drivers/r600/r600_state_common.c:2448
#3 0x7f25a8ae7ba1 in u_vbuf_draw_vbo ../src/gallium/auxiliary/util/u_vbuf.c:1791
#4 0x7f25a7bc18ca in _mesa_validated_drawrangeelements ../src/mesa/main/draw.c:1696
#5 0x7f25a7bc7e53 in _mesa_DrawElements ../src/mesa/main/draw.c:1824
Fixes:
0cf5d1f22620 ("gallium: remove PIPE_CAP_INFO_START_WITH_USER_INDICES and fix all drivers")
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/23436>
Vinson Lee [Tue, 6 Jun 2023 06:22:07 +0000 (23:22 -0700)]
dzn: Fix qpool->queries_lock double lock
Fix defect reported by Coverity Scan.
Double lock (LOCK)
double_lock: mtx_lock locks qpool->queries_lock while it is locked.
Fixes:
a012b219640 ("microsoft: Initial vulkan-on-12 driver")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23455>
Caio Oliveira [Thu, 1 Jun 2023 18:12:12 +0000 (11:12 -0700)]
nir/print: Do not print raw values
In many cases the raw value is not really helpful,
since we only work with enums and the raw value is
already printed for indices without special printing.
If an index benefits from having special printing AND the
raw value, we can include the printing of the raw value
as part of its handler.
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23375>
Mykhailo Skorokhodov [Fri, 2 Jun 2023 15:18:09 +0000 (18:18 +0300)]
iris: Fix memory size with disabled resizable bar
When the resizable bar feature is disabled,
then vram.mappable.size is only 256MB.
The second half of the total size is in the vram.unmappable.size variable.
Signed-off-by: Mykhailo Skorokhodov <mykhailo.skorokhodov@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23402>
Eric Engestrom [Tue, 6 Jun 2023 10:16:52 +0000 (12:16 +0200)]
ci/zink+radv: update expectations
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23465>
Eric Engestrom [Tue, 6 Jun 2023 10:16:47 +0000 (12:16 +0200)]
ci/radv: update expectations
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23465>
Alyssa Rosenzweig [Thu, 1 Jun 2023 01:08:47 +0000 (21:08 -0400)]
treewide: Use nir_trim_vector more
Via Coccinelle patches
@@
expression a, b, c;
@@
-nir_channels(b, a, (1 << c) - 1)
+nir_trim_vector(b, a, c)
@@
expression a, b, c;
@@
-nir_channels(b, a, BITFIELD_MASK(c))
+nir_trim_vector(b, a, c)
@@
expression a, b;
@@
-nir_channels(b, a, 3)
+nir_trim_vector(b, a, 2)
@@
expression a, b;
@@
-nir_channels(b, a, 7)
+nir_trim_vector(b, a, 3)
Plus a fixup for pointless trimming an immediate in RADV and radeonsi.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23352>
Alyssa Rosenzweig [Thu, 1 Jun 2023 00:56:31 +0000 (20:56 -0400)]
treewide: Use nir_tex_src_for_ssa
Via Coccinelle patch:
@@
expression a, b, c;
@@
-a.src = nir_src_for_ssa(b);
-a.src_type = c;
+a = nir_tex_src_for_ssa(c, b);
@@
expression a, b, c;
@@
-a.src_type = c;
-a.src = nir_src_for_ssa(b);
+a = nir_tex_src_for_ssa(c, b);
Plus manual fixups, including...
* a few identity swizzles changed to nir_trim_vector in TTN and prog-to-nir to
fix the Coccinelle-botched formatting, and similarly a pointless nir_channels
* collapsing a now-pointless temp in vtn
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23352>
Alyssa Rosenzweig [Thu, 25 May 2023 20:51:33 +0000 (16:51 -0400)]
nir: Add and use nir_tex_src_ssa
This makes texture instructions a lot less annoying to construct, especially in
cases where the deref-based helpers don't work.
I only converted core NIR, not the drivers. Since it was by hand.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23352>
Marek Olšák [Fri, 2 Jun 2023 14:02:17 +0000 (10:02 -0400)]
amd: remove unused PKT0 definitions
We never use type 0 packets.
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Fri, 2 Jun 2023 14:00:07 +0000 (10:00 -0400)]
radeonsi: don't use SET_SH_REG_INDEX if the kernel doesn't use CU reservation
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Fri, 2 Jun 2023 13:53:07 +0000 (09:53 -0400)]
radeonsi: don't use SET_SH_REG_INDEX on gfx7-9
It was accidentally used with geometry shaders. It might have caused hangs.
Fixes:
ccaaf8fe04c956d9f1 - amd: massively simplify how info->spi_cu_en is applied
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Thu, 1 Jun 2023 17:35:34 +0000 (13:35 -0400)]
radeonsi: re-indent gfx10_create_sh_query_result_cs
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Sat, 27 May 2023 04:08:48 +0000 (00:08 -0400)]
radeonsi/ci: add gfx6 failures
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Sat, 27 May 2023 06:17:37 +0000 (02:17 -0400)]
radeonsi: add a separate cdna_init_compute_preamble_state function
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Thu, 25 May 2023 01:20:58 +0000 (21:20 -0400)]
radeonsi: don't set registers set by CLEAR_STATE in the preamble for gfx10-11
CLEAR_STATE doesn't clear PA_SC_GENERIC_SCISSOR_* only on some older chips
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Thu, 25 May 2023 01:04:11 +0000 (21:04 -0400)]
radeonsi: add a separate gfx10_init_gfx_preamble_state function
and set the registers in an order sorted by the offset.
It's less of a mess now.
Acked-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Sat, 27 May 2023 06:31:59 +0000 (02:31 -0400)]
radeonsi: add helpers to create and clone a sized pm4 state
to simplify si_init_cs_preamble_state and it will be used in the following
commits
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Thu, 25 May 2023 00:03:04 +0000 (20:03 -0400)]
radeonsi: don't program COMPUTE_MAX_WAVE_ID (GDS register) on gfx6
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Wed, 24 May 2023 23:41:08 +0000 (19:41 -0400)]
radeonsi: optimize no-op primitive restart index changes thanks to index masking
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Mon, 15 May 2023 01:01:00 +0000 (21:01 -0400)]
radeonsi: rename the msaa_sample_locs state to sample locations
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Mon, 15 May 2023 00:59:22 +0000 (20:59 -0400)]
radeonsi: merge si_emit_msaa_sample_locs with si_emit_sample_locations
Acked-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Mon, 15 May 2023 00:50:06 +0000 (20:50 -0400)]
radeonsi: move PA_SU_SMALL_PRIM_FILTER_CNTL to the preamble when possible
PA_SU_SMALL_PRIM_FILTER_CNTL is set in the gfx preamble if the sample loc
bug isn't present. Else, it's set as part of sample locs state.
This is part 3 of simplifying si_emit_msaa_sample_locs.
Acked-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Mon, 15 May 2023 00:28:52 +0000 (20:28 -0400)]
radeonsi: adjust 16x EQAA sample locs to make PA_SU_PRIM_FILTER_CNTL immutable
and move PA_SU_PRIM_FILTER_CNTL to the gfx preamble.
If sample locations don't use the -8 coordinate, the EXCLUSION can always
be set to 1.
This is part 2 of simplifying si_emit_msaa_sample_locs.
Acked-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Mon, 15 May 2023 00:14:18 +0000 (20:14 -0400)]
radeonsi: always set sample locations even for 1x MSAA for simplicity
This is part 1 of simplifying si_emit_msaa_sample_locs.
Acked-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Sun, 14 May 2023 23:52:47 +0000 (19:52 -0400)]
radeonsi: move PA_CL_NGG_CNTL emission into rasterizer state
It's a better place. Edge flags only have effect if polygon mode is
enabled. Changing shaders should no longer roll the context due to line
culling flipping EDGE_FLAG_ENA.
Acked-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Sat, 13 May 2023 21:49:41 +0000 (17:49 -0400)]
radeonsi: reorder and comment tracked registers
Acked-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Sat, 13 May 2023 03:49:13 +0000 (23:49 -0400)]
radeonsi: split tracked_regs masks into context registers and other registers
Acked-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Sat, 13 May 2023 02:40:30 +0000 (22:40 -0400)]
radeonsi: increase SDMA gfx9+ limits
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Sat, 13 May 2023 01:55:09 +0000 (21:55 -0400)]
radeonsi: decompress DCC for SDMA if we're really going to use SDMA
change the order of operations
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Sat, 13 May 2023 01:41:07 +0000 (21:41 -0400)]
radeonsi: unduplicate si_translate_format_to_hw
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Fri, 12 May 2023 21:10:30 +0000 (17:10 -0400)]
radeonsi: completely rewrite how VGT_SHADER_STAGES_EN is set
Use a state atom with an emit function instead of precomputing up to 256
pm4 states in si_context.
Some register fields are precomputed in si_shader for NGG. Others are set
in si_update_shaders.
Acked-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Sun, 7 May 2023 16:52:25 +0000 (12:52 -0400)]
radeonsi: remove RADEON_FLAG_MALL_NOALLOC due to no use
and we'll need to use that bit for something else in the future.
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Sun, 7 May 2023 21:03:06 +0000 (17:03 -0400)]
radeonsi: add a gfx11 version of si_decompress_textures, add assertions < GFX11
si_decompress_textures is renamed to gfx6_decompress_textures.
gfx11_decompress_textures is added.
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Sun, 7 May 2023 20:39:33 +0000 (16:39 -0400)]
radeonsi: remove a useless depth texture function call in a fast color clear
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Wed, 5 Apr 2023 09:40:44 +0000 (05:40 -0400)]
radeonsi: use nir_lower_alu_to_scalar correctly
We should use the filter callback that's also used by st/mesa.
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Fri, 14 Apr 2023 01:07:31 +0000 (21:07 -0400)]
radeonsi: print shader-db stats with AMD_DEBUG=vs,ps,stats
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Fri, 19 May 2023 06:23:50 +0000 (02:23 -0400)]
radeonsi/gfx11: extend DB_Z_INFO.NUM_SAMPLES programming to > GFX11
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Sat, 27 May 2023 08:43:27 +0000 (04:43 -0400)]
radeonsi: export non-zero edgeflags for GS and tess
because edge flags are always enabled when polygon mode is enabled
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Mon, 8 May 2023 00:33:07 +0000 (20:33 -0400)]
radeonsi: remove gl_BackColor VS outputs on demand if color_two_side is disabled
We just need to set the ps_inputs_read_or_disabled mask correctly.
The VS outputs_written mask should set BFCn instead of COLn, which is why
this removes the is_varying parameter that forced COLn to be set for BFCn.
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Mon, 8 May 2023 00:31:49 +0000 (20:31 -0400)]
radeonsi: define si_shader_io_get_unique_index() values as SI_UNIQUE_SLOT_*
for later use
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>
Marek Olšák [Wed, 31 May 2023 18:19:14 +0000 (14:19 -0400)]
amd: add radeon_info* into ac_llvm_context and radv_nir_compiler_options
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22833>