Commit graph

141701 commits

Author SHA1 Message Date
Erik Faye-Lund
fde7b6694b zink: use alloca instead of hard-to-size vlas
These variable-length arrays are hard to size statically, and VLAs
aren't supported by MSVC. So let's use alloca instead.

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11380>
2021-06-16 13:04:55 +00:00
Erik Faye-Lund
14597315f8 zink: use max-descriptor define
This avoids compile errors on MSVC due to VLAs.

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11380>
2021-06-16 13:04:55 +00:00
Erik Faye-Lund
4439f500a2 zink: introduce a define for max descriptors per type
We know what this max is in the compiler, let's move that out into
zink_descriptors.h, so we can reuse the constant.

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11380>
2021-06-16 13:04:55 +00:00
Erik Faye-Lund
0ee48216dd zink: fix more initializer styles
Empty initializer lists are a GCC extension, let's use the syntax that
compilers like MSVC also supports.

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11380>
2021-06-16 13:04:55 +00:00
Erik Faye-Lund
3179ce61e9 zink: drop some more vla usage
MSVC doesn't like them, so let's get rid of more of them.

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11380>
2021-06-16 13:04:55 +00:00
Erik Faye-Lund
c14af0065e zink: add missing compiler-dependency
Without this, we depend on something else previously in the build to
have built these.

Fixes: ed2fb809 ("zink: introduce vk_dispatch_table")
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11380>
2021-06-16 13:04:55 +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
bb9efa527a zink: split stencil ref changes to separate dirty flag
the values here are for the cmdbuf, not the pipeline, so they should
always be updated regardless of what the current dsa state uses

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11396>
2021-06-16 12:10:08 +00:00
Mike Blumenkrantz
e6a100b4cd zink: add update flag for dsa state change
reduce overhead by avoiding unnecessary updates

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11396>
2021-06-16 12:10:08 +00:00
Mike Blumenkrantz
57ee14dd8c zink: add update flag for rasterizer state change
this can be used to avoid updating related dynamic states too frequently

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11396>
2021-06-16 12:10:08 +00:00
Mike Blumenkrantz
541af28cb2 zink: handle nir_op_pack_64_2x32
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11392>
2021-06-16 11:57:55 +00:00
Charlie
9753dec07d v3dv: remove sRGB blending workaround
This reverts commits 4c15131b1d and
1cf36797bf.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11377>
2021-06-16 11:05:03 +00:00
Charlie
70d3ba1b68 v3dv: clamp srgb render targets
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11377>
2021-06-16 11:05:03 +00:00
Iago Toral Quiroga
a78e7a76c8 Revert "v3dv: allow creating uncompressed views from compressed images and vice versa"
This reverts commit b32a48c7e2.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11415>
2021-06-16 10:49:42 +00:00
Iago Toral Quiroga
8ae5b44339 v3dv: don't support VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT
The hardware doesn't support this naturally and we need to do a lot
of nasty stuff in the driver to almost make it work.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11415>
2021-06-16 10:49:42 +00:00
Karol Herbst
c1f938b647 nv50/ir: fix surface lowering when values get shared accross operations
With nir I encountered the case where the same value can be written to from
multiple surface operations. This caused some weird messups with the unions
as the def.rewrite operations caused unrelated instructions to get new their
value replaced as well.

In order to replace def.rewrite, we have to create a new temp value, write
to that one instead and move to the original value.

Fixes: 869e32593a ("gm107/ir: fix loading z offset for layered 3d image bindings")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11053>
2021-06-16 11:58:18 +02:00
Ilia Mirkin
561f9ae74b st/mesa: always report the max samples as supported
This is required by GL. Doing this even when the backend driver does not
support it leads to creating attachments which are not renderable. This
is not ideal, but does pass tests. This covers scenarios such as missing
MSAA for 128-bit formats on Sandybridge, and missing 8x MSAA on 128-bit
formats on NVIDIA Tesla generation boards.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11372>
2021-06-16 05:13:16 +00:00
Mike Blumenkrantz
b14b1bef5d zink: stop sanitizing primitive_restart flag in draw info
this is a 1bit struct member, sanitizing is pointless

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11408>
2021-06-16 05:00:44 +00:00
Mike Blumenkrantz
38119e4e7d zink: move batch decl to top of draw_vbo
this may still change during descriptor updating, but having the pointer
earlier is helpful

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11408>
2021-06-16 05:00:43 +00:00
Mike Blumenkrantz
83b1d937a7 zink: remove unnecessary draw checks
I don't know how/why these got here but they aren't needed

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11408>
2021-06-16 05:00:43 +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
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