Commit graph

170634 commits

Author SHA1 Message Date
Amber
2cbc24b9da turnip: fix buffer markers using wrong addresses
Fixes failures in dEQP-VK.api.buffer_marker.*

Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22792>
2023-05-03 11:58:49 +00:00
Bas Nieuwenhuizen
df08ed7d1c radv: Move all the dirty flags from TES binding to TCS binding.
With merged shaders we might not have an explicit TES.

Fixes: 879ddf9720 ("radv: rework binding shaders to cmdbuf by introducing new helpers")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8939
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22784>
2023-05-03 11:24:16 +00:00
Georg Lehmann
f572344901 radv: use lower_ballot_bit_count_to_mbcnt_amd
Foz-DB Navi21:
Totals from 62 (0.05% of 134864) affected shaders:
VGPRs: 2464 -> 2440 (-0.97%)
CodeSize: 332408 -> 324276 (-2.45%)
MaxWaves: 1690 -> 1692 (+0.12%)
Instrs: 62356 -> 60828 (-2.45%)
Latency: 595723 -> 592554 (-0.53%)
InvThroughput: 126106 -> 124241 (-1.48%)
SClause: 2163 -> 2162 (-0.05%)
Copies: 6392 -> 6226 (-2.60%); split: -2.94%, +0.34%
Branches: 2295 -> 2298 (+0.13%)
PreSGPRs: 2390 -> 2389 (-0.04%)
PreVGPRs: 2139 -> 2117 (-1.03%); split: -1.08%, +0.05%

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22783>
2023-05-03 10:39:20 +00:00
Georg Lehmann
b93c92eba3 nir: lower ballot_bit_count_exclusive/inclusive to mbcnt_amd
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22783>
2023-05-03 10:39:20 +00:00
Lionel Landwerlin
5489033fa8 intel/compiler: make uses_pos_offset a tri-state
This value depends on the per-sample value which can be unknown at
compile time with graphics pipeline libraries. So we need to have this
dynamic has well and pick the right value when generating the
3DSTATE_PS/3DSTATE_WM packet.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: d8dfd153c5 ("intel/fs: Make per-sample and coarse dispatch tri-state")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22728>
2023-05-03 10:03:57 +00:00
David Heidelberg
ef01a9cf3b mesa/main: drop unused variable
Fixes: c5b3d488f9 ("mesa/main: make ffvertex output nir")

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22812>
2023-05-03 11:03:14 +02:00
Iago Toral Quiroga
9f522ac0c6 broadcom/compiler: don't allocate undef to rf0
rf0 is affected by restrictions in some scenarios so we rather use
a register that does not cause conflicts for scheduling.

total instructions in shared programs: 12850958 -> 12848024 (-0.02%)
instructions in affected programs: 331974 -> 329040 (-0.88%)
helped: 2559
HURT: 201
Instructions are helped.

total max-temps in shared programs: 2210893 -> 2210803 (<.01%)
max-temps in affected programs: 1486 -> 1396 (-6.06%)
helped: 96
HURT: 7
Max-temps are helped.

total sfu-stalls in shared programs: 21975 -> 21965 (-0.05%)
sfu-stalls in affected programs: 32 -> 22 (-31.25%)
helped: 16
HURT: 6
Sfu-stalls are helped.

total inst-and-stalls in shared programs: 12872933 -> 12869989 (-0.02%)
inst-and-stalls in affected programs: 332036 -> 329092 (-0.89%)
helped: 2560
HURT: 189
Inst-and-stalls are helped.

total nops in shared programs: 305911 -> 303501 (-0.79%)
nops in affected programs: 11215 -> 8805 (-21.49%)
helped: 2131
HURT: 3
Nops are helped.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22797>
2023-05-03 05:39:35 +00:00
Patrick Lerda
4ca8be82d5 r600: fix refcnt imbalance related to atomic_buffer_state
Indeed, these references are not freed.

For instance, this issue is triggered on an evergreen card with
"piglit/bin/shader_runner tests/spec/arb_shader_atomic_counter_ops/execution/all_touch_test.shader_test -auto -fbo"
while setting GALLIUM_REFCNT_LOG=refcnt.log.

Fixes: 06993e4ee3 ("r600: add support for hw atomic counters. (v3)")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22798>
2023-05-03 04:55:01 +00:00
Constantine Shablya
0937a02d96 vulkan: rename vk_physical_device_features.py to vk_physical_device_features_gen.py
In-line with other files that generate source code

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22333>
2023-05-03 03:27:54 +00:00
Constantine Shablya
9cf1cdfaa8 vulkan: put TEMPLATE_H before TEMPLATE_C
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22333>
2023-05-03 03:27:54 +00:00
Constantine Shablya
005cfc63fc vulkan: put interesting code before boring code
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22333>
2023-05-03 03:27:54 +00:00
Constantine Shablya
64f4b277ea vulkan: inline vk_get_physical_device_features into vk_common_GetPhysicalDeviceFeatures2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22333>
2023-05-03 03:27:54 +00:00
Constantine Shablia
528d430ca1 v3dv: use common vkGetPhysicalDeviceFeatures2
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22333>
2023-05-03 03:27:54 +00:00
Constantine Shablia
99bc68f042 panvk: use common vkGetPhysicalDeviceFeatures2
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22333>
2023-05-03 03:27:54 +00:00
Constantine Shablia
a252a9dc24 anv: move get_features after get_device_extensions (ugly diff)
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22333>
2023-05-03 03:27:54 +00:00
Constantine Shablya
430abb971a anv: switch to using the common vkGetPhysicalDeviceFeatures2
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22333>
2023-05-03 03:27:54 +00:00
Constantine Shablya
61413d70a0 vulkan: introduce supported_features parameter to vk_physical_device_init
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22333>
2023-05-03 03:27:54 +00:00
Constantine Shablya
cc02214304 vulkan: add common implementation of vkGetPhysicalDeviceFeatures2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22333>
2023-05-03 03:27:54 +00:00
Emma Anholt
c93b179d76 vulkan: Actually increment the count of objects in GetPipelineCacheData.
Otherwise a load of the cache won't load any of the objects in it!

Fixes: 591da98779 ("vulkan: Add a common VkPipelineCache implementation")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22700>
2023-05-03 00:27:49 +00:00
Emma Anholt
bc257928d7 vulkan: Handle alignment failure in the pipeline cache.
On malloc failure, or more likely a passed in pDataSize < pipeline cache
data size, we should return incomplete.  Otherwise,
vk_pipeline_cache_object_serialize will assertion fail about the start not
being aligned.

Closes: #8868
Fixes: 591da98779 ("vulkan: Add a common VkPipelineCache implementation")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22700>
2023-05-03 00:27:49 +00:00
Jesse Natalie
888bfa7f04 dzn: Ensure bindless is factored into pipeline/nir hash
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22810>
2023-05-02 16:39:51 -07:00
Jesse Natalie
aa43b03086 dzn: Ensure subgroup size control is factored into pipeline hash
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22810>
2023-05-02 16:39:34 -07:00
Jesse Natalie
dacc3cc597 dzn: Use the nir hash as an input to the dxil hash
Instead of re-computing all the same bits we already computed,
just use the nir hash. Helps prevent missing a bit between the two.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22810>
2023-05-02 16:39:34 -07:00
Jesse Natalie
c9a34e6de0 dzn: Ensure sample-rate shading is factored into nir hash
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22810>
2023-05-02 16:39:31 -07:00
Jesse Natalie
cc8cdbb0ef dzn: Hook up subgroup size to compute shader compilation
Previously this was only in the graphics path... where it does nothing,
since D3D only supports wave size control for compute. Whoops.

Fixes: db083070 ("dzn: Implement subgroup size control extension")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22810>
2023-05-02 16:39:10 -07:00
Patrick Lerda
d615dfca40 crocus: fix refcnt imbalance related to crocus_create_surface()
Indeed, the objects are not freed when the function returns NULL.

"psurf->texture = tex;" is redundant with
"pipe_resource_reference(&psurf->texture, tex);".

For instance, this issue is triggered with
"piglit/bin/ext_texture_array-compressed teximage pbo -fbo -auto"
while setting GALLIUM_REFCNT_LOG=refcnt.log.

Fixes: f3630548f1 ("crocus: initial gallium driver for Intel gfx 4-7")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22799>
2023-05-02 22:18:49 +00:00
Ryan Neph
551e92d8a6 virgl: check a debug option again at context creation
Android apps commonly use HWUI (a GLES-based UI framework provided by
the system), that generally performs eglInitialize() before the app can
do the same for its custom rendering needs.

If an app is going to set VIRGL_DEBUG to enable case-by-case driver
behaviors (e.g. experimental shader_sync option), it should be checked
again during context creation.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22744>
2023-05-02 21:43:37 +00:00
Jesse Natalie
73952bfbfd dzn: Fix UBO descriptors pointing to the end of the buffer
UBO descriptors can re-use the default descriptor when their upper
bound is 64KiB, not the end of the buffer.

Fixes dEQP-VK.memory.pipeline_barrier.host_write_uniform_buffer.1048576

Fixes: d34ac0a70b ("dzn: Re-design custom buffer descriptors")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22805>
2023-05-02 21:14:09 +00:00
Mike Blumenkrantz
905f7f8365 Revert "zink: don't create separate shader dsls if there are no bindings"
This reverts commit 83a1b74240.

this is creating the pipeline layout, which is always required, not the dsl

Fixes: 83a1b74240 ("zink: don't create separate shader dsls if there are no bindings")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22801>
2023-05-02 20:08:32 +00:00
Mike Blumenkrantz
27d6a98638 zink: only unset a generated tcs if the bound tcs is the generated one
this could otherwise unbind a non-generated tcs if the tes had at some
point generated a tcs

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22801>
2023-05-02 20:08:32 +00:00
Daniel Schürmann
cf13a1d791 radv/rt: Fix and improve VkPipelineCreationFeedback
Due to a copy-paste error, we asserted pipelineStageCreationFeedbackCount == 1
and wrote the stage feedback of the combined shader into the feedback of the first
stage. This is fixed.
Instead, we now write the precompilation feedback for each stage. This not ideal,
but definitely an improvement.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22100>
2023-05-02 19:15:10 +00:00
Daniel Schürmann
7070c4e5ff radv/rt: remove merged VkPipelineShaderStageCreateInfo
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22100>
2023-05-02 19:15:10 +00:00
Daniel Schürmann
4408395a30 radv/rt: refactor compute_rt_stack_size() to use radv_ray_tracing_stage information
instead of pStages.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22100>
2023-05-02 19:15:10 +00:00
Daniel Schürmann
8ec81a43cb radv/rt: use precompiled stages to create RT shader
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22100>
2023-05-02 19:15:10 +00:00
Daniel Schürmann
7836e32778 radv/rt: retain parsed NIR shaders in radv_ray_tracing_lib_pipeline
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22100>
2023-05-02 19:15:10 +00:00
Daniel Schürmann
284ab601a5 radv/rt: introduce struct radv_ray_tracing_stage
The purpose of this struct is to bundle per-stage information
for ray-tracing pipelines.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22100>
2023-05-02 19:15:10 +00:00
Daniel Schürmann
a5b0b150df radv/rt: expose radv_parse_rt_stage()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22100>
2023-05-02 19:15:10 +00:00
Daniel Schürmann
8665506cbd radv/pipeline_cache: add NIR caching capabilities
This patch adds functions to radv_pipeline_cache in order to cache
serialized NIR shaders as opaque cache objects.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22100>
2023-05-02 19:15:10 +00:00
Daniel Schürmann
9afb52a122 vulkan/pipeline_cache: expose vk_raw_data_cache_object
together with vk_raw_data_cache_object_ops and vk_raw_data_cache_object_create().

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22100>
2023-05-02 19:15:10 +00:00
Karol Herbst
37c6c5c624 nvc0: do not randomly emit fences.
We track fences in a global list and have a per context "current" fence
which we randomly attach things to. If we take such a fence and emit it
without also creating a new fence for future tasks we can get out of sync
leading to random failures.

Some of our queries could trigger such cases and even though this issues
appears to be triggered by the MT rework, I'm convinced that this was only
made more visible by those fixes and we had this bug lurking for quite a
while.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7429
Fixes: df0a4d02f2 ("nvc0: make state handling race free")
Signed-off-by: Karol Herbst <git@karolherbst.de>
Acked-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22722>
2023-05-02 18:54:04 +00:00
Corentin Noël
a86e8969c7 ci: Uprev crosvm and virglrenderer
Update crosvm, virglrenderer and bindgen-cli to their latest version on time.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22712>
2023-05-02 18:12:45 +00:00
Lionel Landwerlin
53605f226b nir/lower_non_uniform_access: add get_ssbo_size handling
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22793>
2023-05-02 16:27:15 +00:00
Karol Herbst
8c1bc1b964 rusticl/nir: finish blob after serializing
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22776>
2023-05-02 15:28:38 +00:00
Karol Herbst
fb7e9b1c36 clc: free kernel args in clc_free_kernels_info
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22776>
2023-05-02 15:28:38 +00:00
Daniel Schürmann
7fc259e4e7 radv: add padding to radv_shader_binary_legacy
This fixes an alignment mismatch in radv_shader_serialize()

Fixes: 577d76f60f ('radv: add radv_shader_serialize() and radv_shader_deserialize() functions')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22735>
2023-05-02 14:33:56 +00:00
Daniel Schürmann
df262d80da vulkan/pipeline_cache: use vk_pipeline_cache_insert_object() to replace raw data objects
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22735>
2023-05-02 14:33:56 +00:00
Daniel Schürmann
cbab396f54 vulkan/pipeline_cache: replace raw data objects on cache insertion of real objects
It might happen that a raw data object (from pipeline cache creation)
was never looked up, and thus never deserialized, before it gets
inserted again into the cache. In this case, the deserialized object
got replaced by the raw data object.
Instead, replace the raw data object with the real object in the cache.

Fixes: 8b13ee75ba ('vulkan: Fall back to raw data objects when deserializing if ops == NULL')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22735>
2023-05-02 14:33:56 +00:00
Christian Gmeiner
edfc9d9d96 etnaviv: Add util_blitter_save_so_targets(..) call
We do not support stream outputs yet so be better at faking it.
Fixes the following assertion when running deqp-gles3:
 u_blitter.c:635: blitter_check_saved_vertex_states: Assertion `!ctx->has_stream_out || ctx->base.saved_num_so_targets != ~0u' failed

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22754>
2023-05-02 13:12:36 +00:00
Matt Coster
db6f94f2c4 pvr: Correctly validate PBE accum format
Fixes: dEQP-VK.pipeline.monolithic.blend.format.e5b9g9r9_ufloat_pack32
  .states
  .color_sas_1mda_add_alpha_1msa_sas_rsub
    -color_1mda_cc_min_alpha_cc_cc_min
    -color_1mcc_1mca_rsub_alpha_1mca_1mda_min
    -color_sc_1mda_sub_alpha_sa_cc_min

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reported-by: James Glanville <james.glanville@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22795>
2023-05-02 12:48:44 +00:00
Rhys Perry
7cda715ad6 radv: fix bc optimization with POS_W_FLOAT_ENA(1)
0286CC_PERSP_CENTER_ENA is also set if:
- No barycentrics are used
- POS_W_FLOAT is enabled

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: a4b60295a7 ("aco,ac/llvm,radv,radeonsi: handle ps bc optimization in nir for radv")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8928
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22782>
2023-05-02 12:18:50 +00:00