Commit graph

55614 commits

Author SHA1 Message Date
Roland Scheidegger
b277cbd620 lavapipe: initialize index_bias to zero for non-indexed draws
This is mostly just cosmetic, since the index bias will be ignored.
(The multi draw function already initializes this to 0 too.)

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18126>
2022-08-19 16:56:10 +00:00
Glenn Kennard
7908cb895e nv30: Fix non-scissored clears after a scissor has been set
Additionally add support for PIPE_CAP_CLEAR_SCISSORED since we are already
touching the scissor state.

Fixes various gnome-shell rendering artifacts.

v2: Remove NEW_SCISSOR as clear now updates scissor registers explicitly
v3: Reset scissor_off state since its not off now after clear

Cc: mesa-stable

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18137>
2022-08-19 13:41:09 +00:00
Erik Faye-Lund
49e6a55e5e zink: remove needless check
textureCompressionBC is just a short-hand to know is *all* BPTC formats
are supported. We're already checking per format, so we don't need this
coarser check.

Besides, it's also kinda wrong; textureCompressionBC also requires all
BC formats, not just BPTC. In other words, all DXT formats and RGTC
formats were missing from the check.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17986>
2022-08-19 12:35:18 +00:00
Danylo Piliaiev
09676b5817 freedreno: Disable LRZ write when alpha-to-coverage is enabled
Alpha-to-coverage acts like discard and happens after FS ends,
so like with discard LRZ write should be disabled.
With discard we don't know at the moment of binning whether
fragment would be not discarded, so we cannot write its depth to LRZ.

Cc: mesa-stable

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18102>
2022-08-19 11:45:14 +00:00
SoroushIMG
b386df918f zink: Fix incorrect emission of SPIR-V shift ops
SPIR-V shift ops unlike NIR have undefined behavior if shift count
larger than or equalt to bitwidth.
This means that true translation of NIR ishl/ishr/ushr to SPIR-V requires
masking like that done in gallivm.
This was seen in the case of soft fp64 in cts case
KHR-GL46.gpu_shader_fp64.builtin.ceil_double.

Cc: mesa-stable
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18074>
2022-08-19 09:35:46 +00:00
Gert Wollny
f0f22d850c r600: Fix SCRATCH OP de-assembly
1d871aa626
   r600g: Implement spilling of temp arrays (v2)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18130>
2022-08-19 08:37:42 +00:00
Gert Wollny
ebcd8c51dc r600: Don't use SB with R600 style scratch reads
SB fails when handling indirect READ_SCRATCH commands.

Fixes: 1d871aa626
   r600g: Implement spilling of temp arrays (v2)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18130>
2022-08-19 08:37:42 +00:00
Gert Wollny
d6bb8a40a6 r600/sfn: Handle R600 scratch read
Fixes: 33765aa92a
     r600/sfn: Enable NIR for pre RG hardware

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18130>
2022-08-19 08:37:42 +00:00
Gert Wollny
404d95ca49 r600: Force NOPs when loading AR on R600 class hardware
Loading indirectly from a register that was just written to
doesn't work on R600 class hardware, so add a NOP group with
the address register load being emitted in the t-slot. to make
sure that the register write was finished.

Fixes: 33765aa92a
     r600/sfn: Enable NIR for pre RG hardware

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18130>
2022-08-19 08:37:42 +00:00
Gert Wollny
7749599d73 r600/sfn: Initialize out buffer when printing op
79ca456b48
   r600/sfn: rewrite NIR backend

Closes: #7021

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18130>
2022-08-19 08:37:42 +00:00
Gert Wollny
069f3869ac r600/sfn: Fix color outputs when color0 writes all
Fixes: 33765aa92a
       r600/sfn: Enable NIR for pre RG hardware

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18130>
2022-08-19 08:37:42 +00:00
Gert Wollny
f6582027dc r600/sfn: Sort FS inputs to make interpolated values come first
On R600 and R700 class hardware the input declaration order maps
directly to the register the hardware writes the inputs to, so
make all interpolated inputs come first, and only then emit the
system values like POS or FACE.

Related: #7035

Fixes: 33765aa92a
     r600/sfn: Enable NIR for pre RG hardware

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18130>
2022-08-19 08:37:42 +00:00
Gert Wollny
34b9e3e44c r600/sfn: Add GS thread fix just like the TGSI code path
The old code does the same for R600.

Fixes: 33765aa92a
     r600/sfn: Enable NIR for pre RG hardware

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18130>
2022-08-19 08:37:42 +00:00
Gert Wollny
00599f6e71 r600/sfn: Schedule shift instruction on R600 in t-slot
Fixes: 33765aa92a
    r600/sfn: Enable NIR for pre RG hardware

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18130>
2022-08-19 08:37:42 +00:00
Dave Airlie
fd8e311988 crocus: sync performance monitor code with iris.
This provides the same info as iris does now, and exposes
INTEL_performance_query

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18099>
2022-08-19 05:21:52 +00:00
Karol Herbst
c63303aea2 ci: update fails list
one might want to investigate this, but for now let's move on and unblock
MRs.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18108>
2022-08-18 20:31:37 +00:00
Ikshwaku Chauhan
ddc8ab9e43 Revert "radeon: add EFC support to only VCN2.0 devices"
This reverts commit 23e5b910c5.

Reason for revert:
It's causing the regression for H264 transcoding. We will Enable EFC
once we verify all corner cases and as of now disabling

Signed-off-by: Ikshwaku Chauhan <ikshwaku.chauhan@amd.com>
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17869>
2022-08-18 17:33:33 +00:00
Kenneth Graunke
1ef43ea3c4 iris: Fix PIPE_CAP_UMA
If we have VRAM we're not exactly a unified memory architecture, are we?

Cc: mesa-stable
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18123>
2022-08-18 17:05:35 +00:00
Dmitry Osipenko
79f47249e8 llvmpipe: Align persistent mappings to page size
KVM requires memory mapping to be aligned to page size, otherwise it
refuses to do the mapping. In particular this causes KVM mapping errors
when llvmpipe is used by virtio-gpu on host and guest tries to map buffer
that has a persistent mapping, i.e. it tries to map the llvmpipe's host
blob/buffer. Mesa virgl driver uses host blobs only for the buffers with
persistent mapping, hence let's align buffer allocations to the page size
when the persistence flag is set to fix the KVM fault.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Acked-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18053>
2022-08-18 15:51:40 +00:00
Mike Blumenkrantz
49efa73ba1 zink: try to reuse swapchain modifier for dmabuf export
the non-negotiated path assumes that drivers know what implicit modifiers they're
using, but zink doesn't know what it's doing, so instead try to copy the
swapchain's modifier and reuse that since in theory it should work

Fixes: 247b8f2924 ("zink: add all format modifiers when adding for dmabuf export")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18095>
2022-08-18 14:38:15 +00:00
Mike Blumenkrantz
f7b1ef37c0 zink: iterate over all modifiers and nuke the ones that aren't supported
the spec mandates that all modifiers passed to the driver be valid, so
iterate through all of them and delete the invalid ones

Fixes: 247b8f2924 ("zink: add all format modifiers when adding for dmabuf export")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18095>
2022-08-18 14:38:15 +00:00
Mike Blumenkrantz
63d70d6dd9 zink: bail out of dmabuf resource creation when srgb explosion is expected
if srgb-ness isn't supported by the driver for dmabuf, bail out early with an
error message with the assumption that this would later (maybe) explode when
trying to create a view for srgb framebuffer

ref !17900

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18095>
2022-08-18 14:38:15 +00:00
Rob Clark
f228c26520 llvmpipe: Add some missing locking
The lp_rasterizer is shared across contexts, and lp_rast_fence called
without holding rast_mutex could race with rast_mutex being replaced and
unref'd on a different thread.

Fixes: a680fd078c ("llvmpipe: make last_fence a screen/rast object not a context one.")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18116>
2022-08-18 00:27:36 +00:00
Charmaine Lee
854e8797ac svga: support TGSI_SEMANTIC_TEXCOORD in swtnl draw context
Since PIPE_CAP_TGSI_TEXCOORD is now enabled, texcoord is now declared
as TGSI_SEMANTIC_TEXCOORD instead of TGSI_SEMANTIC_GENERIC.

Fixes assert running REDTurbineDEMO with MTL Renderer when the guest needs to
fallback to swtnl for line stipple.

Fixes: e73443b7a5 ("svga: enable PIPE_CAP_TGSI_TEXCOORD for vgpu10 and up")

Reviewed-by: Martin Krastev <krastevm@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18113>
2022-08-17 19:52:36 +00:00
Pierre-Eric Pelloux-Prayer
fddb4eda2f radeonsi: prevent u_blitter recursion in si_update_ps_colorbuf0_slot
When u_blitter calls util_blitter_restore_fragment_states we may
end up in si_update_ps_colorbuf0_slot.
This commit makes sure we don't call u_blitter from there.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6921
Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17981>
2022-08-17 12:03:46 +02:00
Kenneth Graunke
781f5fc499 iris: Clean up iris_sample_with_depth_aux()
The majority of the logic here was for the Gfx8-9 sample-from-hiz
hardware feature, which only applies to AUX_USAGE_HIZ, and neither
of the combined HiZ+CCS modes.  So, reorganize the function to put
the logic for each case in the case itself.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4674>
2022-08-17 01:20:25 +00:00
Kenneth Graunke
bf93229c85 iris: Always retain ISL_AUX_USAGE_HIZ_CCS_WT in texture aux usage
When using HIZ_CCS_WT, we always want to use that for texturing so that
we're able to sample from the CCS buffer, which will have the latest
data due to the write-through mode.

With the previous commit in place, HiZ now exists for all miplevels
on platforms which support HIZ_CCS_WT, so we no longer need the
per-miplevel checks.

The other restrictions in this function only apply to the Gfx8-9 feature
where the sampler directly supported reading from HiZ itself, which was
removed.  Hardware where HiZ and CCS can be used together doesn't have
that feature nor its restrictions.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4952
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4674>
2022-08-17 01:20:25 +00:00
Kenneth Graunke
d70b76ea71 iris: Enable HiZ for non-8x4 aligned miplevels on Icelake and later
8x4 alignment was absolutely required prior to Gfx8, and while some
things were relaxed on Gfx8-9, Nanley's experiments in issue #3788
indicated that there were still issues on those platforms.

It appears that the restrictions were relaxed on Icelake and
non-8x4 aligned HiZ "should" work on Gfx11+.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4674>
2022-08-17 01:20:25 +00:00
Kenneth Graunke
fe0152e216 iris: Pass devinfo to iris_resource_level_has_hiz()
This will let us enforce 8x4 alignment rules differently based on the
specific hardware generation in question.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4674>
2022-08-17 01:20:25 +00:00
Dave Airlie
ad274ba889 nir_to_tgsi_info: drop const_buffers_declared
Drivers don't use this, so avoid the assert it could have.

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18042>
2022-08-17 05:48:49 +10:00
Sonny Jiang
4291e545d5 radeonsi/vcn: add decode support for gfx1101 and gfx1103
Add decode support for gfx1101 and gfx1103

Signed-off-by: Sonny Jiang <sonny.jiang@amd.com>
Reviewed-by: James Zhu <James.Zhu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18063>
2022-08-16 18:47:50 +00:00
Mike Blumenkrantz
cf7c17a7af zink: rework descriptor pool overflow
previously this would just destroy and recreate pools, but it's much
smarter to instead store the pools and just reuse them when needed

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18065>
2022-08-16 17:55:47 +00:00
Mike Blumenkrantz
fb9f110113 zink: use a single allocation for zink_descriptor_layout_key
this is slightly more smart

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18065>
2022-08-16 17:55:47 +00:00
Mike Blumenkrantz
234620d8ab zink: use a dynarray instead of hash table for tracking pools
this may use a little more memory, but having direct access to the pool
without needing a lookup in a (potentially big) hash table is definitely
worth it

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18065>
2022-08-16 17:55:47 +00:00
Mike Blumenkrantz
33a1bffa94 zink: add an id member for zink_descriptor_pool_key
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18065>
2022-08-16 17:55:47 +00:00
Mike Blumenkrantz
13d4fda841 zink: require VK_KHR_descriptor_update_template
it's been long enough, and there's no technical reason why drivers
shouldn't have this implemented

ZINK_DESCRIPTORS environment variable is preserved for future use

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18065>
2022-08-16 17:55:47 +00:00
Mike Blumenkrantz
62b3e75e4c zink: use a maybe more accurate wild guess for pcp-less gpl
this is only reachable with an env var, so being wrong is still okay,
but maybe be right slightly more often

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17955>
2022-08-15 14:58:37 +00:00
Mike Blumenkrantz
85165a246c zink: (correctly) require extendedDynamicState2PatchControlPoints for GPL
this is otherwise broken

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17955>
2022-08-15 14:58:37 +00:00
Mike Blumenkrantz
c261179e14 zink: require EXT_non_seamless_cube_map for GPL support
it's impossible to precompile without this

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17955>
2022-08-15 14:58:37 +00:00
Mike Blumenkrantz
b88c3d5bd3 zink: fix program cache comparisons
I missed this when pipe shader types were merged with mesa types

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18051>
2022-08-14 20:11:48 -04:00
Mike Blumenkrantz
6ac64fcb6b zink: delete zink_shader_stage()
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18051>
2022-08-14 18:38:05 -04:00
Mike Blumenkrantz
b988b8c84b zink: remove all pipe_shader_type usage
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18051>
2022-08-14 18:38:05 -04:00
Mike Blumenkrantz
2792d2bd4a zink: PIPE_SHADER_TYPES -> MESA_SHADER_STAGES
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18051>
2022-08-14 18:38:05 -04:00
Mike Blumenkrantz
fc657f8c07 zink: explicitly define ZINK_GFX_SHADER_COUNT
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18051>
2022-08-14 18:38:04 -04:00
Mike Blumenkrantz
7040745060 zink: ZINK_SHADER_COUNT -> ZINK_GFX_SHADER_COUNT
more descriptive

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18051>
2022-08-14 18:38:04 -04:00
Mike Blumenkrantz
89daf988bc zink: use statically sized array for descriptor allocation
this will never be more than 100

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18051>
2022-08-14 18:38:04 -04:00
Mike Blumenkrantz
2ca46b66c3 zink: rename _lazy descriptor stuff
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18051>
2022-08-14 18:38:04 -04:00
Mike Blumenkrantz
48cb86d487 zink: reorder some descriptor structs
should yield slightly better packing

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18051>
2022-08-14 18:38:04 -04:00
Mike Blumenkrantz
e373f97804 zink: merge batch descriptor data onto batch state
also clean up some related descriptor code

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18051>
2022-08-14 18:38:04 -04:00
Mike Blumenkrantz
2c281b7ccd zink: merge program descriptor data onto program struct
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18051>
2022-08-14 18:38:04 -04:00