Commit graph

141245 commits

Author SHA1 Message Date
Mike Blumenkrantz
3b5f345e9b zink: don't use PARTIAL bit for query results with time queries
this is illegal

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>
2021-03-29 02:50:53 +00:00
Mike Blumenkrantz
70b1251587 zink: bump pools up to 5k queries each
50 is very small and triggers constant stalls; this should probably be
tuned more at some point in the future since even this value is small in
some scenarios

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>
2021-03-29 02:50:53 +00:00
Mike Blumenkrantz
93190be1b9 zink: rewrite query internals
this adds internal qbos to each query which record the results of queries incrementally,
meaning that any time we want the result of a query we just have to read the
buffer back

in particular this opens up some possibilities for further optimization, specifically with
actual qbos where we can now pass the internal qbo off to a compute shader to
mimic the check_query_results() handling and avoid having to actually sync or
do a cpu read

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>
2021-03-29 02:50:53 +00:00
Mike Blumenkrantz
313407672c zink: remove special casing for occlusion qbos
this seems fine now

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>
2021-03-29 02:50:53 +00:00
Mike Blumenkrantz
2f81d6fbf0 zink: manually handle more bool query types for copying
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>
2021-03-29 02:50:53 +00:00
Mike Blumenkrantz
35b899c2a2 zink: remove flush from query buffer copy
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>
2021-03-29 02:50:53 +00:00
Mike Blumenkrantz
a9f6e6d606 zink: create result buffers for all query streams
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>
2021-03-29 02:50:53 +00:00
Mike Blumenkrantz
5c25ca55f0 zink: clean up query creation failure paths
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>
2021-03-29 02:50:53 +00:00
Mike Blumenkrantz
36f4e61403 zink: rework border color handling
we should be matching the format type here to the underlying surface type
for int/float

also we can avoid using a custom border color if the color can be reduced to
a non-custom color

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9793>
2021-03-29 02:37:14 +00:00
Mike Blumenkrantz
4c9b987146 zink: ralloc shader cache and keys
hash table keys (keybox) are allocated, so we can avoid leaking them by
allocating everything on a single ralloc context

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9794>
2021-03-29 02:28:09 +00:00
Mike Blumenkrantz
00dc0036bb zink: flatten out buffer creation usage flags codepath
GL doesn't know what it's doing, so we just need all the flags all the time

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>
2021-03-28 22:17:57 -04:00
Mike Blumenkrantz
c96b20970f zink: toggle between linear/optimal tiling during image creation
if we would be creating an unusable image, don't

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>
2021-03-28 22:17:57 -04:00
Mike Blumenkrantz
aac88f49e5 zink: check image format props before creating image
ensure that these attrs are viable before failing silently later on

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>
2021-03-28 22:17:57 -04:00
Mike Blumenkrantz
7edc3f50c1 zink: add color output bit and/or use linear tiling for sampled images
these need to have some way to get data onto them

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>
2021-03-28 22:17:57 -04:00
Mike Blumenkrantz
0a0fb85fbe zink: incrementally add image usage flags based on device caps
these should be provided, but if not...

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>
2021-03-28 22:17:57 -04:00
Mike Blumenkrantz
69cdb6b776 zink: create separate vk image/buffer objects for shader image use
the STORAGE_TEXEL and STORAGE_IMAGE bits can't be accurately applied due
to opengl allowing all resources to be used everywhere, so instead we can
create a separate object on demand which is used only by shaders and gets
extra barriers inferred along with the base object to avoid desync whenever
it is used

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>
2021-03-28 22:17:57 -04:00
Mike Blumenkrantz
475c1bda8e zink: break out barrier struct initializing into helper funcs
make this and the no-op handling reusable for future extension

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>
2021-03-28 22:17:57 -04:00
Mike Blumenkrantz
86e1e1dafd zink: reorder barrier util functions to set up barrier struct before batch
no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>
2021-03-28 22:17:57 -04:00
Mike Blumenkrantz
7cee75f143 zink: make descriptor state invalidate public
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>
2021-03-28 22:17:57 -04:00
Mike Blumenkrantz
d922850e36 zink: break out image/buffer create info structs into helper funcs
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>
2021-03-28 22:17:57 -04:00
Mike Blumenkrantz
cde60ab179 zink: fix format support detection for storage texel buffers and shader images
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>
2021-03-28 22:17:56 -04:00
Mike Blumenkrantz
b741e270cd zink: reset all fences when waiting on batch state
at this point we know all the states are available, so we can shortcut
future state-finding

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9787>
2021-03-29 01:38:09 +00:00
Mike Blumenkrantz
34a2f96f59 zink: stall when we start getting a lot of uncompleted batches
temporary oom handling, though it's unrealistic for this to be hit

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9787>
2021-03-29 01:38:09 +00:00
Mike Blumenkrantz
c39295a24b zink: use correct surface ref function for context destroy
the regular surface reference function can never be used in the driver
if it is possible that a surface may be destroyed, as this may reference
a previously-destroyed context

Fixes: 92a5ea13fc ("zink: implement a global framebuffer cache")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9787>
2021-03-29 01:38:09 +00:00
Mike Blumenkrantz
cbe9e95a96 zink: only do shader updates when relevant stages are dirty
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9792>
2021-03-29 01:22:53 +00:00
Mike Blumenkrantz
dfe9bfef9b lavapipe: fix array texture region copies
these need to use different struct members for copying array textures

the buffer2image variants are already doing the right thing

Fixes: b38879f8c5 ("vallium: initial import of the vulkan frontend")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9761>
2021-03-28 22:32:05 +00:00
Mike Blumenkrantz
2f8453cf56 zink: also fix image buffer layer copying
this differs based on image type

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9759>
2021-03-28 22:23:06 +00:00
Mike Blumenkrantz
191a8e0778 zink: fix handling for image types in resource_copy_region hook
different image types are supposed to use different members of this struct
to indicate layer copies, and this can't necessarily be inferred by checking
array_size

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9759>
2021-03-28 22:23:06 +00:00
Mike Blumenkrantz
cca3d1d9a9 lavapipe: remove lvp_descriptor_update_template::descriptor_set_layout
this wasn't used and caused crashes when running with validation enabled
due to violating spec:

This parameter is ignored if templateType is not VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9861>
2021-03-28 19:31:35 +00:00
Mike Blumenkrantz
71ebcf30e4 lavapipe: ignore templateType when descriptor template isn't for push descriptors
spec compliance requires this and validation may crash without it

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9853>
2021-03-28 19:20:46 +00:00
Gert Wollny
c3bf3e8d43 r600/sfn: make allocate_temp_register private to valuepool
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>
2021-03-28 09:27:48 +00:00
Gert Wollny
bf60ffd0cd r600/sfn: use get_temp_vec4 directly when fetching
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>
2021-03-28 09:27:48 +00:00
Gert Wollny
6da330ece7 r600/sfn: clean up value pool interface usage in emit_stream
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>
2021-03-28 09:27:48 +00:00
Gert Wollny
36fa612228 r600/sfn: clean up multi-sample texture load
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>
2021-03-28 09:27:48 +00:00
Gert Wollny
2362986e79 r600/sfn: remove find_msb lowering in driver
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>
2021-03-28 09:27:48 +00:00
Gert Wollny
6bcc2defa9 r600/sfn: force dual source blend output handling in some cases
If an output has a dual source index > 0 then we need to emit both
outputs, even if the number of outputs is larger than the number
of active outputs.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>
2021-03-28 09:27:48 +00:00
Gert Wollny
40fdf1be46 r600/sfn: remove old deref code
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>
2021-03-28 09:27:48 +00:00
Gert Wollny
84f5b15978 r600/sfn: lowered FS output IO
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>
2021-03-28 09:27:48 +00:00
Gert Wollny
3bbc078025 r600/sfn: lower VS IO and drop old deref code
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>
2021-03-28 09:27:48 +00:00
Gert Wollny
65bec7ab0a r600/sfn: drop the local register mep
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>
2021-03-28 09:27:48 +00:00
Gert Wollny
46beb625b9 r600/sfn: switch assembler creation to use visitor
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>
2021-03-28 09:27:48 +00:00
Gert Wollny
d45c8bf8d9 r600/sfn: fix some formatting
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>
2021-03-28 09:27:48 +00:00
Gert Wollny
56e4a46510 r600/sfn: remove extra parameter from alu assemebly emission
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>
2021-03-28 09:27:48 +00:00
Gert Wollny
a976a50958 r600/sfn: Add skelton for visitor pattern
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>
2021-03-28 09:27:48 +00:00
Gert Wollny
829028babc r600/sfn: Make some value pool functions private
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>
2021-03-28 09:27:48 +00:00
Rob Clark
ea2c47390a util/primconvert: Handle indirect and multi-draw
Indirect handling was completely missing.  And even though we have to
emulate multi-draw, this pushes it out of the fast/hot path in the
driver's draw_vbo()

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9742>
2021-03-27 19:30:04 +00:00
Rob Clark
180ca32bb2 freedreno: Don't handle multi-draw in indirect case
num_draws is only applicable to direct draws, so we can simplify things
a bit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9742>
2021-03-27 19:30:04 +00:00
Rob Clark
0254e513f2 virgl: Use util_draw_multi() helper
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9742>
2021-03-27 19:30:04 +00:00
Rob Clark
6a2634e9be v3d: Use util_draw_multi() helper
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9742>
2021-03-27 19:30:04 +00:00
Rob Clark
fc0c3e22c9 vc4: Use util_draw_multi() helper
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9742>
2021-03-27 19:30:04 +00:00