Commit Graph

141380 Commits

Author SHA1 Message Date
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 caf79bd421 zink: unify gfx shader create callbacks
these are identical

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 84bce72014 zink: mark bind_stage() as inline
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 1672056ee8 zink: simplify zink_program_has_descriptors()
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11407>
2021-06-16 04:38:26 +00:00
Mike Blumenkrantz f6108c2d64 zink: remove return types from program update functions during draw
also remove some null checks; these add overhead and the app is going to
explode anyway if they fail

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11406>
2021-06-16 04:25:00 +00:00
Mike Blumenkrantz ee24c719ee zink: slightly refactor program updating during draw
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11406>
2021-06-16 04:25:00 +00:00
Mike Blumenkrantz 3edb0a0a53 zink: destroy lazy descriptor pools during batch reset when unused
this should keep resource usage a bit lower

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11404>
2021-06-16 04:12:35 +00:00
Mike Blumenkrantz 95fe2f7b82 zink: track active use counts for descriptor layouts
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11404>
2021-06-16 04:12:35 +00:00
Mike Blumenkrantz 43dace32a0 zink: cache descriptor update templates along with layout
this simplifies a bunch of code and just makes more sense given that the
lifetimes should match

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11404>
2021-06-16 04:12:35 +00:00
Dave Airlie 2e97d8245d crocus: disable Z16
This is disabled on i965 for all pre-gen8, so do the same here.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11409>
2021-06-16 13:40:47 +10:00
Dave Airlie 2a540877d1 crocus: fixup render aux usage function.
This got misaligned somewhere in development, should fix the
regressions vs i965 in tesseract as seen on phoronix benchmarks.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11409>
2021-06-16 13:40:47 +10:00
Mike Blumenkrantz 1108db982e zink: make batch_usage_matches take a batch state param
no functional changes, just some unwinding in some cases

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11399>
2021-06-16 02:45:45 +00:00
Mike Blumenkrantz 6e0f552fd2 zink: make batch_usage_set take a batch state param
no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11399>
2021-06-16 02:45:45 +00:00
Mike Blumenkrantz a96c6e4589 zink: remove unnecessary conditionals in resource batch tracking
this is no longer an atomic op

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11399>
2021-06-16 02:45:45 +00:00
Mike Blumenkrantz fec24a2fa4 zink: unset program batch usage on state reset
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11399>
2021-06-16 02:45:45 +00:00
Mike Blumenkrantz 48add48209 zink: make batch_usage_unset take a batch state param
no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11399>
2021-06-16 02:45:45 +00:00
Mike Blumenkrantz 50cfe0dbd1 zink: remove atomic from batch usage setting
this shouldn't be necessary since usage can only be set from the context thread
and only needs to be accessed atomically for the cmpxchg when unsetting

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11399>
2021-06-16 02:45:45 +00:00
Mike Blumenkrantz 559f534e11 zink: move batch usage functions to static inlines
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11399>
2021-06-16 02:45:45 +00:00
Mike Blumenkrantz b3f4e76c07 zink: optimize zink_tc_fence struct packing
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11400>
2021-06-16 01:28:12 +00:00
Mike Blumenkrantz 1c1b0f7c91 zink: reorder has_barriers flag in batch state struct
better struct packing

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11400>
2021-06-16 01:28:12 +00:00
Mike Blumenkrantz e1ba1b5b25 zink: split batch state work_count into separate vars
this has better struct packing

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11400>
2021-06-16 01:28:12 +00:00
Mike Blumenkrantz b85a6b9162 zink: remove zink_batch_state::descs_used
this is no longer used or needed

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11400>
2021-06-16 01:28:12 +00:00
Dave Airlie f93aec2d04 crocus: fixed some missing WM dirtys.
This fixes misrendering in ET: legacy.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11390>
2021-06-16 00:41:00 +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
Mike Blumenkrantz 75c7619253 zink: unblock last_set cached descriptor reuse when safe to do so
if no changes at all have occurred to a given set since the last use,
and if the program hasn't changed, then there is no possiblility for
the set to have been invalidated, and so it can immediately be reused

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
Mike Blumenkrantz 7348a083ed zink: skip hash updates for descriptor types which aren't used
this is pointless and hurts drawoverhead perf

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
Mike Blumenkrantz d8c11ebe29 zink: add oob asserts for descriptor set ref setting
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
Mike Blumenkrantz cc2d54641c zink: enable templated descriptor updates in cache mode
this leverages the template infrastructure from the lazy manager for the
cached mode, alternatively generating a pseudo-template for updates
if real templates aren't available in order to retain 1.0 compatibility

Acked-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
Mike Blumenkrantz 4487825f0b zink: move samplerview descset refs to base objects
this further extends the lifetimes for sets

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
Mike Blumenkrantz ff692d042b zink: add funcs for descriptor_surface refs
this abstracts more code for the cache backend

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:57 -04:00
Mike Blumenkrantz 2d99f10286 zink: move shader image descriptor set refs to underlying type
this was kinda useless since it meant that the set was invalidated any
time the shader image was unbound

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:14:36 -04:00
Mike Blumenkrantz df5c97eea8 zink: update null sampler/image descriptor surface with is_buffer during hashing
this is the only time it might need to be used, so it can be updated naturally here

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:14:36 -04:00
Mike Blumenkrantz b2f4b35d5d zink: add is_buffer flag to union zink_descriptor_surface
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:14:36 -04:00
Mike Blumenkrantz fd9118a739 zink: run lazy batch descriptor functions in cache mode
Acked-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:14:36 -04:00
Mike Blumenkrantz e00268894f zink: unify cached descriptor update code
this is all pretty much standardized now, so it can be combined into something
simpler

Acked-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:14:35 -04:00
Mike Blumenkrantz 93021aa6c8 zink: move ubo range assert to update_descriptor_state()
Acked-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:04:53 -04:00
Mike Blumenkrantz e5b0d21628 zink: remove sorting for dynamic ubo offset updating
if the offsets are assigned in the right order, they don't need to be
ordered later

Acked-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:04:53 -04:00
Mike Blumenkrantz 0b54edad9b zink: modernize cached image descriptor updating
use the auto-updated descriptor info

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:04:53 -04:00
Mike Blumenkrantz b9c0e99960 zink: modernize cached ssbo descriptor updating
use the already-updated bufferinfo structs

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:04:53 -04:00
Mike Blumenkrantz 24b98a2925 zink: modernize cached ubo descriptor updating
use the already-updated bufferinfo structs

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:04:53 -04:00
Mike Blumenkrantz c0e9896139 zink: modernize cached push ubo descriptor updating
use the already-updated bufferinfo structs

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:04:53 -04:00
Mike Blumenkrantz d2f04604d6 zink: match lazy descriptor set layout in cache mode
now cached descriptors also use a push set for ubo0, also reusing the
ZINK_DESCRIPTOR_TYPES for this set for enum purposes

Acked-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:04:52 -04:00
Mike Blumenkrantz ab7ea7acfa zink: split lazy sets based on descriptor type
this is now closer to the cached descriptor set layout, but with
the push set as the zero-indexed set (passed as ZINK_DESCRIPTOR_TYPES
for enum purposes)

Acked-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:04:36 -04:00
Mike Blumenkrantz c4dd9cdabb zink: add a function for creating descriptor layouts for push sets
push sets contain a single ubo at index 0 per shader stage in the set

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:03:58 -04:00
Ian Romanick daa2ccff7a v3d: ci: Add KHR-GLES31.core.shader_image_load_store.basic-glsl-earlyFragTests to flakes
Closes: #4934
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11386>
2021-06-15 21:37:17 +00:00
Yiwei Zhang ac27493824 venus: add debug info for experimental features during init
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11387>
2021-06-15 21:25:28 +00:00
Jason Ekstrand 7bf0c762c3 anv: Agressively no-op Flush/InvalidateMappedMemoryRanges
This has two steps.  First, for each range we look at the memory object
and see if it actually needs flushing before we start throwing CLFLUSH
instructions.  Second, we look at the whole list of types on device
initialization and decide whether or not we need CLFLUSH at all.  The
first part should speed up atom chips a bit since we're currently
CLFLUSHing everything even when we don't need to.  The second isn't
needed on most of today's parts because we base it on !has_llc but it is
needed for discrete parts.  It's also over-all cleaner.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11364>
2021-06-15 21:00:37 +00:00
Emma Anholt 591a3c738d freedreno: Be more strict about QUERY_AVAILABLE to simplify the code.
ARB_oq doesn't just say "polling in a loop will make it complete
eventually", it says "querying will make it complete in finite time."

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11368>
2021-06-15 20:42:26 +00:00
Emma Anholt bfb83d1fe8 freedreno: Drop a bit of indirection around the batch cache flush path.
Checking the flag to call separate functions which then call the same
helper with the flag is a bit silly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11368>
2021-06-15 20:42:26 +00:00
Emma Anholt 32bed95e0b freedreno: Make a bunch of the batch cache take ctx as the arg.
As we move the batch cache from screen to context, it cleans up the diff a
ton to separate this mechanical change out, and makes the API generally
more consistent (since you usually have to pass the ctx anyway).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11368>
2021-06-15 20:42:26 +00:00