Commit Graph

161343 Commits

Author SHA1 Message Date
Alyssa Rosenzweig 6a183a9ffd agx: Add iterators for phi/non-phi instructions
We know that phi nodes are always at the start (this is asserted in
agx_validate and a fundamental invariant of SSA form). That means we can
cheaply iterate all n phi nodes forward (or n non-phi nodes backwards)
in O(n) time. We already open code this idiom in a few places, use
common iterators instead so we don't need to justify in random places.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18804>
2022-10-14 01:37:39 +00:00
Mike Blumenkrantz d3880a6324 zink: disable fbfetch when flushing clears
this ensures there's no weird perf happening, avoids using renderpass
instead of dynamic rendering, and avoids hitting an assert from broken
framebuffer construction

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19065>
2022-10-14 01:16:30 +00:00
Mike Blumenkrantz 1ae26de36f zink: unset rp_changed after initializing renderpass attachments
if fbfetch is setup here, it will flag rp_changed

this is already inside renderpass setup, however, so just unset it
to avoid erroneously trigering the assert

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19065>
2022-10-14 01:16:30 +00:00
Mike Blumenkrantz f72071fbc3 zink: clamp line_stipple_factor to 1 if stipple is disabled
0 is technically an illegal value even though it won't be read in this case

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19065>
2022-10-14 01:16:30 +00:00
Mike Blumenkrantz 2710ef4c2a zink: don't add other usage bits for transient images
this is illegal

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19065>
2022-10-14 01:16:30 +00:00
Mike Blumenkrantz 3dcc03d979 zink: check core feature for pipeline cache control
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19065>
2022-10-14 01:16:30 +00:00
Emma Anholt 179e638bb8 zink: Fix dummy CB path decision for VK_EXT_cwe presence.
We have to do the dummy workaround when we *don't* have the ext.  This was
apparently a mis-sedding.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19057>
2022-10-14 00:55:36 +00:00
Karol Herbst 6a18e154bc rusticl/mem: propper CL_MEM_ALLOC_HOST_PTR support
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18793>
2022-10-13 23:15:33 +00:00
Karol Herbst 7195b62c63 lp: claim being UMA
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18793>
2022-10-13 23:15:33 +00:00
Karol Herbst 72f763f5cc rusticl/mem: rewrite the (un)mapping code
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18793>
2022-10-13 23:15:33 +00:00
Karol Herbst dc081353ac rusticl: add helper ctx wrapper for coherent and direct mapping
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18793>
2022-10-13 23:15:33 +00:00
Karol Herbst ea5b23c75b rusticl: rework resource mappings a little
The _async variants will be removed later.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18793>
2022-10-13 23:15:33 +00:00
Karol Herbst 6b235361f7 rusticl/mesa: add bx() method to PipeTransfer
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18793>
2022-10-13 23:15:33 +00:00
Karol Herbst 557f4dd89a rusticl: add support for coherent resources
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18793>
2022-10-13 23:15:33 +00:00
Timothy Arceri a5e9e64aae glthread: fix matrix stack depth tracking
Dont bump the depth if the application attempts to overflow or
underflow the stack.

Fixes: 6febe2b880 ("glthread: track all matrix stack depths")

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19059>
2022-10-13 22:47:49 +00:00
Alyssa Rosenzweig 6689d67603 asahi: Remove no-direct-packing
It's weird.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18922>
2022-10-13 18:06:52 -04:00
Alyssa Rosenzweig ea58edaafb asahi: Use a header more like Intel's GenXML
We're trying to converge on a common schema.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18922>
2022-10-13 18:06:52 -04:00
Alyssa Rosenzweig ab2d5deec2 asahi,panfrost: Remove exact attribute
Not used, although in the future it might be...

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18922>
2022-10-13 18:06:52 -04:00
Alyssa Rosenzweig a64e38b0aa panfrost,asahi: Remove unused function
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18922>
2022-10-13 18:06:51 -04:00
Alyssa Rosenzweig 0f24c8ef5f panfrost,asahi: Remove unused prepare macro
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18922>
2022-10-13 18:06:51 -04:00
Alyssa Rosenzweig 0302519f1c asahi/genxml: Defeature uint/float
Unused, relic from panfrost and not in upstream genxml.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18922>
2022-10-13 18:06:51 -04:00
Alyssa Rosenzweig 8eefda4ea9 asahi: Eliminate "Pixel Format" type from GenXML
This is leaky and hurts compatibility with upstream GenXML. Just use the
actual hardware fields.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18922>
2022-10-13 18:06:51 -04:00
Alyssa Rosenzweig f4b03ea6dc nir/lower_system_values: Fix cs_local_index_to_id with variable workgroups
In that case we need to use the sysval. That sysval can be optimized anyway in
the nonvariable case. Fixes test_basic.get_linear_ids on panfrost.

Fixes: 998d84fca5 ("nir/lower_system_values: Support lowering more intrinsics")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18662>
2022-10-13 21:25:23 +00:00
Kenneth Graunke 2dfab687ec intel/compiler: Vectorize gl_TessLevelInner/Outer[] writes [v2]
Setting the NIR options takes care of iris thanks to the common st/mesa
linking code, and updating brw_nir_link_shaders should handle anv.

The main effort here is updating remap_tess_levels, which needs to
handle vector stores, writemasking, and swizzling.  Unfortunately,
we also need to continue handling the existing single-component
access because it's used for TES inputs, which we don't vectorize.

We could try to vectorize TES inputs too, but they're all pushed
anyway, so it wouldn't buy us much other than deleting this code.
Also, we do have opt_combine_stores, but not one for loads.

One limitation of using nir_vectorize_tess_levels is that it works
on variables, and so isn't able to combine outer/inner writes that
happen to live in the same vec4 slot (for triangle domains).  That
said, it's still better than before.

For writes, we allow the intrinsics to supply up to the full size
of the variable (vec4 for outer, vec2 for inner) even if the domain
only requires a subset of those components (i.e. triangles needs 3).

shader-db results on Icelake:

   total instructions in shared programs: 19600314 -> 19597528 (-0.01%)
   instructions in affected programs: 65338 -> 62552 (-4.26%)
   helped: 271 / HURT: 0
   helped stats (abs) min: 6 max: 24 x̄: 10.28 x̃: 12
   helped stats (rel) min: 1.30% max: 18.18% x̄: 5.80% x̃: 7.59%
   95% mean confidence interval for instructions value: -10.71 -9.85
   95% mean confidence interval for instructions %-change: -6.17% -5.43%
   Instructions are helped.

   total cycles in shared programs: 851842332 -> 851808165 (<.01%)
   cycles in affected programs: 618577 -> 584410 (-5.52%)
   helped: 271 / HURT: 0
   helped stats (abs) min: 64 max: 540 x̄: 126.08 x̃: 111
   helped stats (rel) min: 2.57% max: 37.97% x̄: 6.12% x̃: 5.06%
   95% mean confidence interval for cycles value: -135.35 -116.80
   95% mean confidence interval for cycles %-change: -6.67% -5.57%
   Cycles are helped.

   total sends in shared programs: 1025238 -> 1024308 (-0.09%)
   sends in affected programs: 6454 -> 5524 (-14.41%)
   helped: 271 / HURT: 0
   helped stats (abs) min: 2 max: 8 x̄: 3.43 x̃: 4
   helped stats (rel) min: 5.71% max: 25.00% x̄: 14.98% x̃: 17.39%
   95% mean confidence interval for sends value: -3.57 -3.29
   95% mean confidence interval for sends %-change: -15.42% -14.54%
   Sends are helped.

According to Felix DeGrood, this results in a 10% improvement in
the draw call time for certain draw calls from Strange Brigade.

v2: Fix assertions about number of components and add more of them.
    Combine the quads and triangles handling as it's nearly identical.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19061>
2022-10-13 11:38:21 -07:00
semjon00 44d917bdf3 hasvk: force inline more pipe flush functions
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18965>
2022-10-13 14:21:38 +00:00
semjon00 760b43f32c hasvk: combine flushes in Draw/DrawIndexed/DrawIndirectByteCountEXT
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18965>
2022-10-13 14:21:38 +00:00
semjon00 bee1f7b83a hasvk: don't export gfx state flushing helper
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18965>
2022-10-13 14:21:38 +00:00
semjon00 6db3a82fb2 hasvk: don't export flush_compute_state
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18965>
2022-10-13 14:21:38 +00:00
Yonggang Luo 4f0f272069 util: Implement atomic operations consistently across compilers and testing for it
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18795>
2022-10-13 13:51:18 +00:00
Yonggang Luo 96e7d1cf0c util: Remove the include of windows.h when compiling with MSVC
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7345

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18795>
2022-10-13 13:51:18 +00:00
Karol Herbst 1c86a5f309 rusticl/kernel: preserve fp16 denorms to fix vload/vstore_half
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19041>
2022-10-13 13:13:54 +00:00
Yiwei Zhang 5fa7c53631 venus: avoid accessing local var in VN_ADD_EXT_TO_PNEXT_OF
This boring refactor:
- makes it consistent for extension name alias
- shortens the line a bit to not further regress line width
- applies macro when possible to be consistent
- removes some redundant empty lines

v2: rebase

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chad Versace <chadversary@chromium.org> (v1)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18993>
2022-10-13 05:35:26 +00:00
Mike Blumenkrantz ea429b90b7 lavapipe: store compiler options to physical device
this minimizes noise in gallium trace

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18867>
2022-10-13 04:17:28 +00:00
Mike Blumenkrantz d1acd88c14 zink: prevent ballooning of view object memory
if a resource is in use every frame and never goes idle, it becomes
impossible to execute pruning, as there is no tracking for when views
are no longer in use

to avoid eventually ooming in this scenario, add some data to zink_resource_object
which can effectively "queue" pruning of these views if ballooning is
detected at a time when the views are guaranteed to be safe to delete

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19056>
2022-10-13 03:56:02 +00:00
Mike Blumenkrantz 765debc602 zink: delete view objects when unsetting resource usage in batch reset
if the resource has no usage, it's guaranteed to be idle, which means view
objects can be pruned to avoid memory ballooning

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19056>
2022-10-13 03:56:02 +00:00
Mike Blumenkrantz 43dcdf3365 zink: rework/improve descriptor pool overflow handling on batch reset
the existing model for descriptor pools works thusly:
* allocate pool
  * when possible, reuse existing pool from overflow array
* when pool is full, append to overflow array
* on batch reset, cycle the overflow arrays to enable reuse

the problem with this is it uses two separate arrays for overflow, and these arrays
are cycled but never consolidated, leading to wasted memory allocations for whichever
array is not currently being recycled

to resolve this, make the following changes to batch resets:
* set the recycle index to whichever overflow array is smaller
* copy the elements from the smaller array to the larger array (consolidate)
* set the number of elements in the smaller array to 0

this leads to always appending to an empty array while the array containing all the
"free" pools is always the one that's available for recycled use

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19053>
2022-10-13 03:02:59 +00:00
Mike Blumenkrantz 340cfa1001 zink: fix pool overflow handling on batch reset
this mechanism worked off the previous iteration of descriptor updating,
in which pools were stored in a set to the batch state and could be iterated
normally

now, however, they're stored as a sparse array, and so the dynarray util for getting
the number of elements cannot be used

instead, use the calculated size for the array like every other accessor for
the pools to ensure correct indexing

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19053>
2022-10-13 03:02:59 +00:00
Mike Blumenkrantz 6c59aeebbf zink: handle oom better during descriptor updating
in the case where a new descriptor pool cannot be allocated naturally:
* iterate free batch states and try to free up memory
* iterate in-use batch states and try to free up memory
* ???

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19053>
2022-10-13 03:02:59 +00:00
Mike Blumenkrantz 7b88bc5482 zink: move descriptor function up in file
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19053>
2022-10-13 03:02:59 +00:00
Chad Versace f8f4648cac venus: Enable Vulkan 1.3
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19046>
2022-10-12 16:59:21 -07:00
Chad Versace 85a6a2461d venus: Enable VK_KHR_synchronization2
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19046>
2022-10-12 16:59:20 -07:00
Chad Versace 58eb3ac666 venus: Refactor vn_command_buffer_builder temp storage
Easy refactor. Change the storage type from `VkImageMemoryBarrier *` to
`void *`. Prepares for VK_KHR_synchronization2.

The patch series is cleaner with this refactor. I promise.

Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19046>
2022-10-12 16:59:20 -07:00
Chad Versace 7daedd2a30 venus: Add vn_queue_wait_idle_before_present()
Trivial refactor.

Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19046>
2022-10-12 16:59:20 -07:00
Chad Versace cc1407df44 venus: Change signature of vn_get_fence_feedback_cmd
Trivial refactor.

Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19046>
2022-10-12 16:59:20 -07:00
Chad Versace e469bedb95 venus/queue: Rename some local vars
Reduces noise in following patches.

Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19046>
2022-10-12 16:59:19 -07:00
Simon Zeni c71006726e meson: remove unused EGL_NO_X11 definition
Last EGL header update changed the logic for the Xlib header inclusion. Now
the caller has to specify USE_X11 if they want the Xlib definitions.

Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18848>
2022-10-12 19:26:01 +00:00
Simon Zeni 96894e6746 EGL: sync headers with Khronos
Since [1], EGL removed the inclusion of the Xlib headers by default.
The logic is now reversed, and the call has to define USE_X11 to include the
Xlib headers instead of EGL_NO_X11_HEADERS to prevent the inclusion.

[1]: 3670d645f4

Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18848>
2022-10-12 19:26:01 +00:00
Simon Zeni 1fc7f0f084 egl: set API symbols public
With the latest header update from Khronos, KHRONOS_APICALL (which is then
defined as EGLAPI) is empty, preventing the API symbols to be visible.
This commit adds `PUBLIC` to all the symbols from the EGL API that needs to be
visible.

Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18848>
2022-10-12 19:26:01 +00:00
Simon Zeni 15b931bee7 egl: fix Xlib include in egldisplay.h
Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18848>
2022-10-12 19:26:01 +00:00
Brian Paul 0c87909bcf draw: fix base vertex bug
Move the assignment of draw->start_index into the num_draws loop
in draw_pt_arrays() so that it's updated for each primitive we're
drawing.  Previously, it was only set once to the 0th primitive's
start index.

This fixes incorrect gl_BaseVertex values when using
vkCmdDrawMultiEXT() with more than one VkMultiDrawInfoEXT item.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19039>
2022-10-12 18:59:11 +00:00