Commit Graph

358 Commits

Author SHA1 Message Date
Mike Blumenkrantz 1542f3eb47 zink: decompose vertex attribs into single components when not supported
this avoids vbuf in a lot more cases on radv where 3component attribs aren't supported

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12771>
2021-09-14 01:55:56 +00:00
Mike Blumenkrantz 14e9d01aa6 zink: export PIPE_SHADER_CAP_FP16_CONST_BUFFERS
this is now functional

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12823>
2021-09-13 02:13:06 +00:00
Mike Blumenkrantz 7c1b7ded7a zink: add "nofallback" descriptor mode
this disables lazy fallback and forces caching always

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12783>
2021-09-12 23:58:48 +00:00
Mike Blumenkrantz 0edbdc671f zink: fix some pipe caps for max instructions
all shaders are supported now

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12760>
2021-09-08 04:45:28 +00:00
Mike Blumenkrantz ad584ed34e zink: use dispatch table for (almost) all vulkan calls
try to avoid hitting the loader when possible

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12757>
2021-09-08 04:31:24 +00:00
Mike Blumenkrantz c5059915ee zink: use EXT_primitive_topology_list_restart where available
this also fixes an error where PATCHES was reported as supported

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12626>
2021-09-08 03:08:39 +00:00
Mike Blumenkrantz 71aa4adba3 zink: fix PIPE_SHADER_CAP_FP16_DERIVATIVES handling
this requires 16bit io, not just alus

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12634>
2021-09-07 13:29:57 +00:00
Mike Blumenkrantz 6931fe58ca zink: fix PIPE_CAP_DRAW_PARAMETERS export
before 1.2, assume this is available if the extension is there, otherwise
require the feature

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12710>
2021-09-07 13:17:45 +00:00
Mike Blumenkrantz c552d99b09 zink: use imageless framebuffers
this feature lets zink avoid the screen-based framebuffer cache with locks
in favor of a context-based one that doesn't need any complicated wizardry
to work since it doesn't need to track refcounts for attachments or work
across contexts since the surface info gets passed in when the renderpass
is begun

also expand the dummy surface to an array for use with multisampling and simplify
surface refs there for non-imageless case

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12661>
2021-09-02 15:53:16 +00:00
Mike Blumenkrantz 0b2b2a4783 zink: remove ZINK_HEAP_HOST_VISIBLE_ANY
this was just the coherent heap but splitting the slabs more to make
suballocating worse

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12659>
2021-09-01 04:24:03 +00:00
Mike Blumenkrantz 1bbab34660 zink: enable fbfetch pipe cap
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12603>
2021-08-31 19:45:29 +00:00
Mike Blumenkrantz 25fe797104 zink: move alphaToOne warning to a dynamic warning
stop spamming these if they aren't even being used

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12647>
2021-08-31 19:32:26 +00:00
Mike Blumenkrantz 9a8960de53 zink: determine whether the gpu has a resizable BAR at startup
this can be used to make different allocation and mapping decisions

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12579>
2021-08-30 13:46:04 +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
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
Mike Blumenkrantz c1d342e986 zink: enable compat contexts
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12423>
2021-08-17 21:49:01 +00:00
Mike Blumenkrantz 40fdb3212c zink: add a suballocator
this is an aux/pipebuffer implementation borrowing heavily from the
one in radeonsi. it currently has the following limitations, which
will be resolved in a followup series:
* 32bit address space still explodes
* swapchain images still have separate memory handling

performance in games like Tomb Raider has been observed to increase by
over 1000%

SQUASHED: simplify get_memory_type_index()

now that the heaps are enumerated, this can be reduced to a simple
array index with a fallback

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12146>
2021-08-17 13:21:28 +00:00
Mike Blumenkrantz c886ce2991 zink: simplify else clause for mem info gathering
it doesn't matter if this is host-visible, it just has to not be device-local

Fixes: 73f6bff07f ("zink: fix mem info query to be more permissive")

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12199>
2021-08-04 14:07:58 -04:00
Mike Blumenkrantz 42442a0d4e zink: sum available memory heaps instead of assigning
this is supposed to accumulate now

Fixes: 73f6bff07f ("zink: fix mem info query to be more permissive")

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12199>
2021-08-04 14:07:58 -04:00
Rob Clark 6edf0d8e90 driconfig: Add support for device specific config
Add support for driconf overrides on a per-device level, for cases
where we don't want to override behavior for all devices supported
by a particular driver.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12135>
2021-08-02 16:37:24 -07:00
Emma Anholt b080aa9466 gallium/driconf: Allow the driver to parse the driconf options.
This will give the driver a chance to set a device name separate from the
driver name, using info probed during screen creation.  All drivers
querying driconf in screen creation now have to call parsing on their own,
but other drivers get fallback parsing after screen creation.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12135>
2021-08-02 16:35:07 -07:00
Mike Blumenkrantz 64785df389 zink: add env var to disable timelines
for ci use only

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12089>
2021-07-27 23:09:47 +00:00
Mike Blumenkrantz 627371fe01 zink: export PIPE_CAP_TGSI_BALLOT
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11990>
2021-07-27 22:44:59 +00:00
Mike Blumenkrantz 2736bf4e17 zink: split mem cache per type
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11966>
2021-07-22 00:32:50 +00:00
Mike Blumenkrantz 7aca74e219 zink: inline mem cache hash table
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11966>
2021-07-22 00:32:50 +00:00
Mike Blumenkrantz fdfa155f2b zink: move mem cache to sub-struct
no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11966>
2021-07-22 00:32:50 +00:00
Mike Blumenkrantz d8905446d6 zink: rework oom flushing
tracking mem usage on the context is bad because if an app is always using
a large amount of memory across multiple batches, it triggers the oom flushes
on every flush and forces fencing

instead, add an explicit flag for oom flushing and another for stalling, then
flag oom flushing and stalling as needed, with set_framebuffer_state being an
additional flush point now since it's guaranteed not to split renderpasses

also proactively prune pending batch states if there's a lot of them

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11965>
2021-07-22 00:22:24 +00:00
Mike Blumenkrantz 696542bd3b zink: populate modifier props onto screen object during init
Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10782>
2021-07-13 00:21:51 +00:00
Mike Blumenkrantz 73f6bff07f zink: fix mem info query to be more permissive
airlied was right, this was way too conservative

Fixes: ff4ba3d4a7 ("zink: support PIPE_CAP_QUERY_MEMORY_INFO")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11803>
2021-07-11 20:18:16 +00:00
Erik Faye-Lund c3b0f439a7 zink: fill in the right line-mode based on state
We need to fill in the right line-mode here based on the state to get
the correct rasterization; bresenham isn't always the right one.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11795>
2021-07-09 13:18:47 +00:00
Mike Blumenkrantz 25ad69968b zink: check last_finished before timeline waiting
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11686>
2021-07-02 03:40:45 +00:00
Mike Blumenkrantz fd633c2444 zink: add a screen function for waiting on a batch id
this is super hacky for the non-timeline case but whatever

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11686>
2021-07-02 03:40:45 +00:00
Mike Blumenkrantz ce90f73eb0 zink: rework pipeline cache implementation
this is now a screen-based queue which can be triggered to serialize
cache updates, ensuring synchronization

the cache is on the program object, enabling incremental updates as well as
variant loading for an entire pipeline collection at once

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11595>
2021-07-02 00:09:33 +00:00
Dave Airlie d9c0687a54 zink: drop getenv hacking now that gallium is fixed.
This drops the getenv hacks which cause problems testing multithread apps

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11643>
2021-07-01 10:27:44 +00:00
Erik Faye-Lund ccb9f8670e zink: do not store moltenvk functions in screen
These functions are only used once anyway, no need to store them and
make the rest of Zink care.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11554>
2021-06-24 10:46:55 +02:00
Erik Faye-Lund 95cbb560cf zink: remove unused moltenvk functions
These functions were added, but never used. Let's get rid of them.

Fixes: c2cb2dd3bc ("zink: Added support for MacOS MoltenVK APIs.")
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11554>
2021-06-24 10:46:52 +02:00
Erik Faye-Lund 7b220f8694 zink: unbreak moltenvk code
These functions don't exist in the Khronos XML, so we don't generate
dispatch-table entries for them. So let's not try to call them in that
way.

Fixes: 5574868103 ("zink: use the dispatch tables")
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11554>
2021-06-24 10:46:31 +02:00
Mike Blumenkrantz c032c9e32d zink: export supported primitive restart types
this is now handled by gallium, so the codepath can be dropped

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10973>
2021-06-23 03:13:42 +00:00
Mike Blumenkrantz 2953d70994 zink: export supported prim types
this is now handled by gallium, so the related codepaths can be dropped

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10973>
2021-06-23 03:13:42 +00:00
Mike Blumenkrantz 8ac4be916e zink: export 8bit index buffer support based on extension presence
this is now handled by gallium, so the codepath can be dropped

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10973>
2021-06-23 03:13:42 +00:00
Mike Blumenkrantz 09c28a35a5 zink: export PIPE_CAP_EMULATE_NONFIXED_PRIMITIVE_RESTART
gallium will now handle unsupported restart index rewriting, so
this codepath can be removed

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10973>
2021-06-23 03:13:41 +00:00
Mike Blumenkrantz 478f129ee7 zink: move queue submit thread to screen
this needs to be a screen-based queue in order to serialize properly
with multiple contexts

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11437>
2021-06-22 20:57:33 +00:00
Mike Blumenkrantz d0833f611a zink: support more RGBX formats
the base formats are supported, so these should fall into place naturally

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11391>
2021-06-16 19:45:25 +00:00
Mike Blumenkrantz 806251c72d zink: move queue init to screen creation
this is a race condition

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11398>
2021-06-16 15:03:22 +00:00
Erik Faye-Lund b20c1c2a3b zink: drop paranoid code
If we ever get here, res->dt is non-NULL. No need to assert, and no need
to check twice.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11414>
2021-06-16 12:42:07 +00:00
Erik Faye-Lund 0bb4703292 zink: do not unmap dt-buffers twice
Seems I missed that we already did an unconditional unmap here, and
forgot to remove it. Whoops.

Fixes: 5159f406d ("zink: use gallium api to copy to display-target")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11414>
2021-06-16 12:42:07 +00:00
Mike Blumenkrantz a1fb2e9c27 zink: use u_live_shader_cache
let the duplicated shader madness end

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11403>
2021-06-16 04:49:45 +00:00
Mike Blumenkrantz 4e3768914d zink: add ZINK_DESCRIPTORS env var to explicitly set a mode
currently this supports 3 modes, with the default being a hybrid between
caching and lazy

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11188>
2021-06-15 20:15:58 -04:00
Hoe Hao Cheng 65c8ae6bbd zink: zero-init structs with ISO C
zero-initing with empty braces is a GNU extension, MSVC does not like
it.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11376>
2021-06-15 12:33:03 +00:00
Hoe Hao Cheng b5d344c3af zink: move extension function verification to when it is used
Some vulkan functions are not loaded when the corresponding features are
not enabled, but the verifier checks for *all* functions, so make the
verifier more forgiving and use a stub to catch when we actually use a
function that is not loaded.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11328>
2021-06-13 18:58:34 +00:00