Commit Graph

144326 Commits

Author SHA1 Message Date
Erik Faye-Lund e3239dff05 zink: avoid overflow when calculating size
If we multiply before we (implicitly) cast the result to the target
type, we needlessly risk overflowing the result.

CID: 1490790, 1475922

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12559>
2021-08-27 18:32:03 +00:00
Erik Faye-Lund c96afa9fc8 zink: initialize pQueueFamilyIndices
This silences a Coverity warning about an uninitialized variable.

CID: 1490800

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12559>
2021-08-27 18:32:03 +00:00
Erik Faye-Lund 64c558ab83 zink: do not warn about rare features until used
We currently cause the following scary warning to be printed on
start-up for *every* application regardless if that feature is being
used or not when run on top of ANV:

> WARNING: Some incorrect rendering might occur because the selected
> Vulkan device (Intel(R) UHD Graphics 620 (KBL GT2)) doesn't support
> base Zink requirements: line_rast_feats.stippledRectangularLines
> line_rast_feats.stippledSmoothLines

There's no need to scare the users about this, as most applications
don't care about these combinational features. So let's instead emit a
warning when these features are attempted (but failed) to be used
instead.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12587>
2021-08-27 18:21:08 +00:00
Erik Faye-Lund 28b3563a95 Revert "zink: always init bordercolor value for sampler"
This reverts commit 336dea90f0.

This change was incorrect for two reasons:

1. We already initialize this field on line 334
2. Unconditionally setting this to
   VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK breaks rendering with e.g
   opaque white borders, because we've already matched those to a
   non-custom enum value first.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12591>
2021-08-27 18:09:51 +00:00
Lepton Wu bcd9db327d i965: Enable RGBX8888_SRGB format.
This is required by Android. Some Android games like nier reincarnation
show a black screen without this.

Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12393>
2021-08-27 17:00:34 +00:00
Timur Kristóf 589ccf3d77 aco: Consider maximum number of workgroups per CU/WGP on Navi.
No Fossil DB changes.

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/12517>
2021-08-27 16:41:08 +00:00
Timur Kristóf c8698199a1 aco: Consider LDS usage by PS inputs in MaxWaves calculation.
Before PS waves are launched, PS inputs are moved from PC to LDS
and the corresponding part of the PC is deallocated.
Each PS input occupies 3 * vec4 (3 * 16 = 48 bytes) of LDS space.
See Figure 10.3 in the GCN3 ISA manual.

These limit occupancy the same way as other stages' LDS usage does.
Note that PS can request additional LDS space via EXTRA_LDS_SIZE,
so that also must be taken into account here.

No Fossil DB changes.

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/12517>
2021-08-27 16:41:08 +00:00
Mike Blumenkrantz 9bc61108d7 zink: remove extra program ref from cached descriptor updates
this happens in draw/compute now

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12582>
2021-08-27 16:30:08 +00:00
Mike Blumenkrantz 5c3db42d1d zink: avoid pulling in unused push descriptors for cached ubo0
instead of just reading the template bufferinfo data, ensure that only
buffers which will be read are added to the set to avoid stale cache entries

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12582>
2021-08-27 16:30:08 +00:00
Tomeu Vizoso 9e314a6822 iris/ci: Correctly set freq governors to max
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12598>
2021-08-27 17:34:01 +02:00
Tomeu Vizoso 1f1dc49531 freedreno/ci: Correctly set freq governors to max
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12598>
2021-08-27 17:34:01 +02:00
Boris Brezillon 5a4fcb42f7 panvk: Fix panvk_copy_fb_desc()
We should not skip the copy when the batch is attached a framebuffer
descriptor, quite the opposite. Let's drop the check instead of reversing
it since we are guaranteed to have an FB attached when
panvk_copy_fb_desc() is called.

Fixes: 792a0ab0b1 ("panvk: Prepare per-gen split")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12590>
2021-08-27 16:38:45 +02:00
Boris Brezillon d84dedc48f panvk: Make the per-arch static lib depend on panvk_entrypoints.h
The panvk_entrypoints.h header is included by all panvk_vX_xxx.c
source files, without this dependency the build can fail.

Fixes: 792a0ab0b1 ("panvk: Prepare per-gen split")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Tested-by: Fabio Pedretti <pedretti.fabio@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12590>
2021-08-27 16:37:36 +02:00
Mike Blumenkrantz 3990f95822 zink: more effectively utilize batch_usage for query destruction
there's no need to track the number of batches that a query is referenced on,
as all the tracking is already done by the batch_usage mechanism, so this
can be simplified to manage destruction based on whether batch_usage exists

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12578>
2021-08-27 14:26:50 +00:00
Mike Blumenkrantz 0f40ac286b zink: don't try to sync previous timestamp query qbo values
this makes no sense, so don't explode the qbo by trying

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12578>
2021-08-27 14:26:50 +00:00
Mike Blumenkrantz 4421180fe3 zink: move time query ending out to zink_end_query
time queries only need to be ended when the api ends them, not per-cmdbuf

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12578>
2021-08-27 14:26:50 +00:00
Mike Blumenkrantz 68c1b1b0e3 zink: improve threadsafe qbo access
these should be staging resources since they're being read from often,
and this allows dropping the UNSYNCHRONIZED flag from map since it should
be inferred

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12578>
2021-08-27 14:26:50 +00:00
Mike Blumenkrantz 4a5dfabb12 zink: make zink_gfx_pipeline_state::vertices_per_patch a bitfield
this is clamped to MAX_PATCH_VERTICES

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12586>
2021-08-27 10:52:59 +00:00
Mike Blumenkrantz 7b3dfea6c1 zink: repack zink_gfx_pipeline_state
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12586>
2021-08-27 10:52:59 +00:00
Mike Blumenkrantz 9c5a2ab6a9 zink: convert rasterizer pipeline components to bitfield
this reduces the hashed pipeline key size by 53 bits

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12586>
2021-08-27 10:52:59 +00:00
Mike Blumenkrantz c73adf8c90 zink: steal a bit from rast_samples in pipeline state
zink only handles values up to 64, so this still has an extra bit

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12586>
2021-08-27 10:52:59 +00:00
Mike Blumenkrantz 9260b86905 zink: add clip_halfz to rasterizer hw state
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12586>
2021-08-27 10:52:59 +00:00
Mike Blumenkrantz 0e5ba2a508 zink: repack zink_rasterizer_hw_state
this is now 11 bits

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12586>
2021-08-27 10:52:59 +00:00
Mike Blumenkrantz 827fcb7e32 zink: zero viewport and scissor count in pipeline with dynamic state1
this is illegal

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12586>
2021-08-27 10:52:59 +00:00
Mike Blumenkrantz cab68281ba zink: move viewport count into dynamic state1 part of pipeline hash
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12586>
2021-08-27 10:52:59 +00:00
Mike Blumenkrantz 94e9091ba2 zink: move dynamic state1 pipeline members into substruct
this is a bit easier to manage

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12586>
2021-08-27 10:52:59 +00:00
Boris Brezillon 19e29960e9 panfrost: v7 does not support RGB32_UNORM textures
Cc: mesa-stable
Fixes: c6bdd976e6 ("panfrost: Split out v6/v7 format tables")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12588>
2021-08-27 08:21:14 +00:00
Yevhenii Kharchenko b945262773 iris: fix layer calculation for TEXTURE_3D ReadPixels() on mip-level>0
Fixes assert when ReadPixels() called to read from FBO to
GL_PIXEL_PACK_BUFFER, on mip-level > 0, since num_layers
wasn't properly calculated with mip-level.

v2: patched 'iris_create_sampler_view' function instead of
'resolve_sampler_views'. Just like it was suggested in this
function's comment.
The logic of fix is similar to one in 'update_image_surface' function
of i965 driver, which is introduced in commit
f9fd0cf479.
With a slight change: setting array_len=1, like it was done in
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5808 ,
since minifying depth fails KHR-GLES2.texture_3d.filtering tests.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4145
Fixes: 3c979b0e ('iris: add some draw resolve hooks')

Signed-off-by: Yevhenii Kharchenko <yevhenii.kharchenko@globallogic.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9253>
2021-08-27 08:07:10 +00:00
Samuel Pitoiset d90a8c79df radv: remove unecessary radv_finishme() for invalid color formats
Something really bad happen (likely driver bug) if this is triggered.
Replace with some assertions to catch an eventual issue in debug build.

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/12556>
2021-08-27 07:29:17 +00:00
Samuel Pitoiset df90bb3f88 radv: remove useless check about number of samples in the HW resolve path
Although this can likely hang, this is invalid and should be caught
by the validation layers. There is many ways to hang the GPU with VK,
this check alone is useless.

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/12556>
2021-08-27 07:29:17 +00:00
Samuel Pitoiset b05c2023cc radv: remove outdated radv_finishme() in the HW resolve path
Resolving layered MSAA images is actually implemented by the HW
resolve path but never used because the driver uses the compute path.

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/12556>
2021-08-27 07:29:17 +00:00
Mike Blumenkrantz aab95f1bdf zink: set primitive restart with extended dynamic state2
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12585>
2021-08-27 03:31:25 +00:00
Mike Blumenkrantz 9c2fe8e621 zink: bump dynamic pipeline state count
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12585>
2021-08-27 03:31:25 +00:00
Mike Blumenkrantz 53da55ac87 zink: template for VK_EXT_extended_dynamic_state2
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12585>
2021-08-27 03:31:25 +00:00
Mike Blumenkrantz 7811037de5 zink: hook up VK_EXT_extended_dynamic_state2
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12585>
2021-08-27 03:31:25 +00:00
Mike Blumenkrantz 5b5201f0fd zink: no-op prim changes for pipeline recalc
this is no longer part of pipeline hash since we're using dynamic state

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12585>
2021-08-27 03:31:25 +00:00
Mike Blumenkrantz 0cec4d581c zink: consolidate pipeline hash tables
with dynamic prim type, pipelines can now be grouped by base prim type
instead of requiring a different pipeline for overall prim type

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12585>
2021-08-27 03:31:25 +00:00
Mike Blumenkrantz 305966ca75 zink: use dynamic prim type
this is part of dynamic state but wasn't used since it required
actual work to effectively make use of it

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12585>
2021-08-27 03:31:25 +00:00
Mike Blumenkrantz 3674839d11 zink: batch mem barrier hooks
memory barriers are redundant, so batch them and apply based on actual
usage to be slightly more efficient

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12576>
2021-08-27 02:59:24 +00:00
Mike Blumenkrantz 115935cc53 zink: slim down streamout component of mem barrier hook
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12576>
2021-08-27 02:59:24 +00:00
Mike Blumenkrantz c095a32026 zink: remove query flush from memory barrier hook
qbos are separate buffers with their own barriers, so this just stalls
pointlessly

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12576>
2021-08-27 02:59:24 +00:00
Mike Blumenkrantz ce87300412 zink: use ctx gfx prim mode for draw comparisons
just being consistent

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12572>
2021-08-27 02:39:34 +00:00
Mike Blumenkrantz 95a9ea54f3 zink: init ctx->gfx_prim_mode to nonzero value to trigger pipeline changes
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12572>
2021-08-27 02:39:34 +00:00
Mike Blumenkrantz b06ef86020 zink: reorder gfx program/pipeline/descriptor binds if dynamic state is present
this enables deferring the heavy lifting until the rest of the state updates are
done

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12572>
2021-08-27 02:39:34 +00:00
Mike Blumenkrantz c2aa47a708 zink: remove extra unsetting of ctx->vertex_state_changed
this is already managed in zink_get_gfx_pipeline

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12572>
2021-08-27 02:39:34 +00:00
Mike Blumenkrantz 8a4681aea5 zink: pass current program's shader array, not ctx array
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12572>
2021-08-27 02:39:34 +00:00
Mike Blumenkrantz ab08dcd895 zink: remove attachment count from pipeline hash
this is redundant

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12572>
2021-08-27 02:39:34 +00:00
Mike Blumenkrantz 1bb9704bce zink: declare ctx var during blend state bind
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12572>
2021-08-27 02:39:34 +00:00
Mike Blumenkrantz 960e776f24 zink: assert precise queries are occlusion queries
this should always be the case

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12583>
2021-08-27 02:26:17 +00:00
Mike Blumenkrantz 9d9e197d74 zink: require occlusionQueryPrecise for occlusion queries
ensure this is present to avoid driver explosions

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12583>
2021-08-27 02:26:17 +00:00