Commit Graph

136705 Commits

Author SHA1 Message Date
Mike Blumenkrantz 2b18105ff7 zink: add some asserts for pipeline barriers to check renderpass state
it's illegal to emit barriers during a renderpass

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9543>
2021-03-16 10:45:32 -04:00
Mike Blumenkrantz f4a53287de zink: handle cached descriptor set punting
if an active set gets invalidated, it needs to be punted from the active
hash table so it doesn't get reused

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9543>
2021-03-16 10:45:32 -04:00
Daniel Stone e6aacec9e1 CI: Try really hard to get updated Windows TLS certs
Windows doesn't actually distribute a full TLS CA certificate store, but
pulls them in over time with Windows Update. Try to prime it by manually
pulling the certificates and installing them.

This bumps the Windows tag to force a rebuild.

Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9618>
2021-03-16 11:07:02 +00:00
Mike Blumenkrantz 616720d6ae zink: track resource_object usage instead of resource usage
the resource object is now a state tracker for the inner resource_object,
so it can safely be destroyed even if the backing resource is still in use

this also requires updating various things to keep descriptor states/caches working

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9544>
2021-03-15 22:08:06 -04:00
Mike Blumenkrantz 708f19317c zink: split out backing resource object create/destroy
moving towards these being able to exist semi-independently...

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9544>
2021-03-15 22:08:06 -04:00
Mike Blumenkrantz 46bbc835c1 zink: move resource internals to a separate struct
this starts the path towards being able to replace the backing objects for
a resource

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9544>
2021-03-15 22:08:06 -04:00
Mike Blumenkrantz f6c6320a5f zink: break out batch id finding for resource usage into util function
this is generally helpful for figuring out the last batch a resource was
used for

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9544>
2021-03-15 22:08:06 -04:00
Mike Blumenkrantz c699cc0f9b zink: avoid looping for non-ubo descriptor updates based on set usage
if we know that the descriptor set is cached and already in use by a given
batch, then we also know that all the resources in the set are tracked, which
means that we can skip over some looping  during descriptor updates which would
otherwise be used to add tracking for sampler/image views/states

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9567>
2021-03-16 01:01:57 +00:00
Mike Blumenkrantz 839d609b8c zink: add batch usage flags for sampler views/states and desc sets
this massively cuts down cpu time for hashing and lookups, resulting in
a noticeable performance increase

the sampler_state batch usage for now is just being set for future use when
it will be leveraged to permit immediate deletion

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9567>
2021-03-16 01:01:57 +00:00
Bas Nieuwenhuizen 013aa05edb radv: Use correct DCC compressed block size for sampling.
Don't need to change the pre-GFX9 samplers because this option doesn't
vary there.

Fixes: f848f2adfa ("radv: Use ac_surface DCC settings for shareable images.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4455
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4425
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9611>
2021-03-16 00:50:11 +00:00
Jason Ekstrand ee395df315 genxml: Make 1-bit L3$ config register fields bool on Gen7
Otherwise, they look like booleans but, if you put a value other than
0/1 in them, the GenXML generator code will explode.

Fixes: b6875b0094 "anv: Drop has_slm in emit_l3_config for gen11+"
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9614>
2021-03-15 17:22:49 -07:00
Danylo Piliaiev b8ca39a80d turnip: implement intrinsic_vulkan_resource_reindex
Descriptor arrays are continuous, so it's just an addition of offset.

Fixes test:
 dEQP-VK.spirv_assembly.instruction.compute.variable_pointers.dynamic_offset.select_descriptor_array

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9495>
2021-03-15 23:56:26 +00:00
Eric Anholt 3dc8102420 ci/freedreno: Add three more a5xx flakes from the last day.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9575>
2021-03-15 22:45:13 +00:00
Mauro Rossi 2538e3b48a android: i965: Rename files with "intel_" prefix to "brw_"
The necessary changes for Android build were missing in Makefile.sources

Fixes: 9d95e1bd79 (i965: Rename files with "intel_" prefix to "brw_")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9576>
2021-03-15 23:24:02 +01:00
Mike Blumenkrantz f4a8912dc2 anv: use common interfaces for shader modules
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9508>
2021-03-15 21:47:44 +00:00
Mike Blumenkrantz 71b17149e8 tu: use common interfaces for shader modules
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9508>
2021-03-15 21:47:44 +00:00
Mike Blumenkrantz 07c9dc54dd v3dv: use common interfaces for shader modules
squashed changes from Alejandro Piñeiro <apinheiro@igalia.com>:

Add call to vk_object_base_init on internal shader_module: we have
some cases where internally we have some shader modules that we don't
create through CreateShaderModule, so in this case we need to manually
call base_init. Not sure why this wasn't needed before.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9508>
2021-03-15 21:47:44 +00:00
Mike Blumenkrantz 1d1c7a965c radv: use common interfaces for shader modules
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9508>
2021-03-15 21:47:44 +00:00
Mike Blumenkrantz c3db26a6f6 lavapipe: use common interfaces for shader modules
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9508>
2021-03-15 21:47:44 +00:00
Mike Blumenkrantz a41e98ddca vk/util: add a util macro for initializing stack vk_shader_module structs
radv does a lot of this, so having a central dispatch point will be useful in
case changes are made to this struct in the future

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9508>
2021-03-15 21:47:44 +00:00
Mike Blumenkrantz 76078ed9fe vk/util: add unified shader module struct/functions
there's some extra logging stuff dumped into here to match functionality,
eventually that should also be consolidated into vk_util.c

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9508>
2021-03-15 21:47:44 +00:00
Dave Airlie b0de4468c2 lavapipe: add host query reset
This just resets the queries on the host size.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9594>
2021-03-16 06:50:37 +10:00
Dave Airlie 6865ec210b lavapipe: fix writing availability for queries.
If the availability has to be written it needs to be written
 to the correct place.

The host query reset tests fall over this.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9594>
2021-03-16 06:50:33 +10:00
Dave Airlie 774bbc299f lavapipe: add missing break
No effect as-is but annoying later.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9594>
2021-03-16 06:50:28 +10:00
Sagar Ghuge 3a73148f25 anv: Set correct binding table entry count
We can use surface_count as it is to set binding table entry count since
it's already in units.

On Felix's Tigerlake with the GPU at fixed frequency, this patch
improves performance of several games:

   - Shadow of the Tomb Raider: +1.5%
   - Dota2vk: +1%
   - Dark Souls: +1%

v2: (Ken)
- Remove get_binding_table_entry_count() and use surface_count directly.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9548>
2021-03-15 20:11:13 +00:00
Jordan Justen b6875b0094 anv: Drop has_slm in emit_l3_config for gen11+
For some gen12+ platforms, L3 config (cfg) can be NULL leading to a
seg-fault in emit_l3_config. But, we don't use has_slm for gen11+, so
we can just avoid declaring the variable.

Reworks:
 * Drop has_slm variable for all gens (suggested-by Jason)

Ref: 633dec7163 ("anv: Set L3 full way allocation at context init if L3 cfg is NULL")
Ref: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9534
Fixes: 581e68bc99 ("anv: move L3 config emission to genX_state.c")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9589>
2021-03-15 11:33:25 -07:00
Anuj Phogat b1ab69f467 anv: Remove redundant #if checks
Patch removes redundant #if checks and unused code inside another #if
block.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9604>
2021-03-15 18:02:58 +00:00
Caio Marcelo de Oliveira Filho f603a2c25a anv: Lower ViewIndex to zero when multiview is disabled
Vulkan spec says

    If multiview is enabled in the render pass, this value will be one
    of the bits set in the view mask of the subpass the pipeline is
    compiled against. If multiview is not enabled in the render pass,
    this value will be zero.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4446
Fixes: 0db7070330 ("anv/pipeline: Add shader lowering for multiview")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9574>
2021-03-15 09:51:14 -08:00
Mike Blumenkrantz edcad555f8 zink: stop leaking programs
gfx and compute programs both end up with an extra ref from creation,
so they both need to lose a ref during creation after they get their
shader refs

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9470>
2021-03-15 15:37:46 +00:00
Mike Blumenkrantz 46b356ca2d zink: unset ctx->program pointers when an unref destroys the object
if we destroy a program object which is currently the "active" program then
we need to unset the pointer to avoid invalid access

also unset injected tcs pointers where appropriate

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9470>
2021-03-15 15:37:46 +00:00
Mike Blumenkrantz ddb807e5c9 zink: return true from program ref functions upon free
this lets us unset the context pointer accurately

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9470>
2021-03-15 15:37:46 +00:00
Mike Blumenkrantz 25d895747c zink: use internal api for first-frame fence
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9290>
2021-03-15 11:19:16 -04:00
Mike Blumenkrantz e93ca92d4a zink: force explicit fence only on first frame flush
we have implicit sync hooked up for drivers now so we don't need to worry
about drawing over our frontbuffer unexpectedly

still a weird issue remaining where we miss the first frame without an explicit
fence, but I expect that will get resolved eventually by wsi

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9290>
2021-03-15 11:18:59 -04:00
Mike Blumenkrantz bbfeebabfd zink: force mesa flush implicit fencing on ANV
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9290>
2021-03-15 10:58:21 -04:00
Mike Blumenkrantz 6fb4e1345d zink: determine whether the vulkan driver requires mesa flush wsi
this is used for ANV's implicit fencing (until we get wsi)

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9290>
2021-03-15 10:58:21 -04:00
Mike Blumenkrantz 86bd643d6a zink: use a safer iteration for fb surfaces during rp init
doing a pointer iteration looks cool, but if the array is full, then it
goes out of bounds and we crash

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9542>
2021-03-15 14:10:52 +00:00
Mike Blumenkrantz 38f7faa8a4 zink: implement a surface cache
this is a global cache for all surface objects, enabling some memory
optimizations as well as improved reuse of cached descriptors

loosely based on patches from Antonio Caggiano

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9541>
2021-03-15 09:42:30 -04:00
Mike Blumenkrantz 2643f9ed28 zink: ralloc screen objects
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9541>
2021-03-15 09:42:30 -04:00
Michel Zou 6083ebe078 swr: fix array-bounds warning
Reviewed-by: Jan Zielinski <jan.zielinski@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9502>
2021-03-15 13:19:09 +00:00
Michel Zou 12af7f97ee swr: fix deprecated llvm 11 declaration warning
Reviewed-by: Jan Zielinski <jan.zielinski@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9502>
2021-03-15 13:19:09 +00:00
Michel Zou c58a7c7108 swr: fix unused SplitString warning
Reviewed-by: Jan Zielinski <jan.zielinski@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9502>
2021-03-15 13:19:09 +00:00
Michel Zou 17441cf92f swr: Fix SWR_CONTEXT pre-declaration
Silents a warning on msvc

Reviewed-by: Jan Zielinski <jan.zielinski@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9502>
2021-03-15 13:19:09 +00:00
Michel Zou 0e8cdea6d9 swr: fix win32 intrinsics
The doc doesnt mention Index is altered when mask is null.
This is consistent with both llvm & migw implementations.

Reviewed-by: Jan Zielinski <jan.zielinski@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9502>
2021-03-15 13:19:09 +00:00
Michel Zou 31dbef02a0 swr: extern declaration for win32 intrinsics
This fixes compilation on msvc because llvm redefines these too
Closes #4417

Reviewed-by: Jan Zielinski <jan.zielinski@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9502>
2021-03-15 13:19:09 +00:00
Samuel Pitoiset 321dadf229 radv: rework radv_use_dcc_for_image() a bit
To make it clear that only GFX8-9 have missing DCC features.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9526>
2021-03-15 13:22:44 +01:00
Samuel Pitoiset 9704ed3f57 radv: remove useless DCC disable check for 3D images on GFX10+
addrlib uses the S swizzle mode which disables DCC completely.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9526>
2021-03-15 13:22:44 +01:00
Samuel Pitoiset 2bc51226e1 radv: add missing SQTT events for copy_commands2/create_renderpass2
A bunch of entrypoints were missing.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9560>
2021-03-15 12:34:39 +01:00
Marcin Ślusarz 99e9a6721a anv: fix memory allocation error handling
Reported by Coverity.

Fixes: 0a7224f3ff ("anv: group as many command buffers into a single execbuf")
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9596>
2021-03-15 10:53:41 +01:00
Lionel Landwerlin 87966b0aa0 intel: install intel_device_info
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Suggested-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9595>
2021-03-15 09:22:13 +00:00
Pierre-Eric Pelloux-Prayer 9e5623ccc3 frontends/va: fix protected slice data buffer read size
Read vlVaBuffer->size bytes instead of an hardcoded value.

Fixes: deb7dc82f6 ("frontends/va: handle protected slice data buffer")
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9553>
2021-03-15 09:43:15 +01:00