Commit Graph

139611 Commits

Author SHA1 Message Date
Marcin Ślusarz 2c3e2d69bd nir: handle float atomics in nir_lower_memory_model
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Fixes: 2adb337256 ("nir,radv/aco: add and use pass to lower make available/visible barriers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10766>
2021-05-12 11:09:07 +00:00
Marcin Ślusarz 27073b59bc nir: handle float atomics in nir_gather_info
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10766>
2021-05-12 11:09:07 +00:00
Erik Faye-Lund 8166e41e1f translate: assert that nr_elements is in range
This just ensures that we don't end up reading/writing outside of the
space reserved in the key. This would have made it easier to to track
down the issue in the previous commit faster.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10730>
2021-05-12 11:26:54 +02:00
Erik Faye-Lund 100c4dbd9c translate: reserve more vertex-shader outputs
It's not just position that's special here, we also need space for
other special vertex-shader outputs.

This fixes a crash with Zink on Lavapipe, because Zink always emits
psize to avoid some shader-keys. While this might not be ideal, it's not
illegal. So we need to handle it.

But it seems we're missing more, and this list is taken from
compute_vertex_info() in lp_state_derived.c.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10730>
2021-05-12 11:26:54 +02:00
Erik Faye-Lund 790b9a5872 lavapipe: correct reported number of UBOs
When emitting the state we add one to the UBO index, so we have to
subtract one from the number of UBOs that we support. This is still
fine, because Vulkan only requires 14 UBOs to be supported, and LLVMpipe
supports 16.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10731>
2021-05-12 10:52:36 +02:00
Boris Brezillon 7db79fa677 panfrost: Flag indirect draw/dispatch shaders as internal
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10417>
2021-05-12 07:03:51 +00:00
Boris Brezillon ec2b46a1ce panfrost: Expose the DRAW_PARAMETERS cap on Bifrost
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10417>
2021-05-12 07:03:51 +00:00
Boris Brezillon a5ba2e2045 pan/bi: Add support for gl_DrawID
We simply pass the drawid as a sysval.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10417>
2021-05-12 07:03:51 +00:00
Boris Brezillon 7cc4c8c5e5 pan/bi: Add support for gl_{BaseVertex,BaseInstance}
Extend the VERTEX_INSTANCE_OFFSETS sysval to pass
BaseVertex/BaseInstance information to the shader.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10417>
2021-05-12 07:03:51 +00:00
Alyssa Rosenzweig 69d81edaf8 pan/bi: Add first_vertex to vertex ID
Apparently r61 is zero based.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Tested-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10417>
2021-05-12 07:03:51 +00:00
Boris Brezillon 0e74598e36 panfrost: Split the indexed and !indexed indirect draw info structs
Some fields are overlapping, so let's just split those structs to
avoid confusion.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10417>
2021-05-12 07:03:51 +00:00
Gustavo Padovan 5d6608ef78 iris/ci: enable intel devices automatically in MR pipelines
After a period of stabilization it is now time to move them
to be part of the MR pipelines. We will still watch the
behavior and look for any issue that arises.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10550>
2021-05-12 08:21:38 +02:00
Gustavo Padovan 12f0b14e2d iris/ci: disable failing gimark test for now
In order to enable the intel devices to automatically be part of
Marge pipelines we need it to be fully passing all tests. We will
remove the gimark tests temporaly to achieve that.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10550>
2021-05-12 08:21:38 +02:00
Vinson Lee fe1378dcb6 nv50/ir: Initialize GCRA::RIG_Node members.
Fix defects reported by Coverity Scan.

uninit_member: Non-static class member degree is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member degreeLimit is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member maxReg is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member f is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member reg is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member weight is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10714>
2021-05-12 05:32:19 +00:00
Hyunjun Ko 3f229e34c9 turnip: Implement VK_KHR_timeline_semaphore.
Implements non-shareable timelines using legacy syncobjs,
inspired by anv/radv implementation.

v1. Avoid memcpy in/out_syncobjs and fix some mistakes.
v2.
 - Handle vkQueueWaitIdle.
 - Add enum tu_semaphore_type.
 - Fix to handle VK_SEMAPHORE_WAIT_ANY_BIT_KHR correctly.
 - Fix a crash of dEQP-VK.synchronization.timeline_semaphore.device_host.misc.max_difference_value.

v3. Avoid indefinite waiting in vkQueueWaitIdle by calling
tu_device_submit_deferred_locked itself.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10126>
2021-05-12 05:07:44 +00:00
Hyunjun Ko daefc6e2a4 turnip: prep work for timeline semaphore support
Small refactor to classify semphore types, currently only binary
syncobj is being used though.

v1. Fix a crash of dEQP-VK.api.null_handle.destroy_semaphore

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10126>
2021-05-12 05:07:44 +00:00
Mike Blumenkrantz 73a9dbce6b zink: pop descriptor refs when invalidating sets
this avoids memory ballooning, mainly for samplers, when a descriptorset
component has refs for a very, very large number of sets

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>
2021-05-11 22:39:50 -04:00
Mike Blumenkrantz e3933548c2 zink: remove screen param from zink_descriptors_update()
this was redundant

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>
2021-05-11 22:39:50 -04:00
Mike Blumenkrantz 987b0eb638 zink: make zink_context_update_descriptor_states() static
this is no longer used externally

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>
2021-05-11 22:39:50 -04:00
Mike Blumenkrantz 21868216c9 zink: call invalidate on invalid descriptor sets during recycle
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>
2021-05-11 22:39:50 -04:00
Mike Blumenkrantz d2ff25c708 zink: use better iterating for buffer rebinds
now that the number of descriptors for a given type is known, we can iterate
over all bound descriptors for the type instead of relying on shader usage

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>
2021-05-11 22:39:50 -04:00
Mike Blumenkrantz 7cc47e59c8 zink: add slot params to zink_context_invalidate_descriptor_state
allow more precision with invalidation

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>
2021-05-11 22:39:50 -04:00
Mike Blumenkrantz 402eaa0795 zink: track number of tbos in shader data
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>
2021-05-11 22:39:50 -04:00
Mike Blumenkrantz 1082dc5f4a zink: track max slot idx for descriptor types
this will be useful when restoring states across renderpasses

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>
2021-05-11 22:39:50 -04:00
Mike Blumenkrantz 095b8ad8b1 zink: don't track sampler states onto buffer sampler sets
this should always just be a null pointer to reduce overhead

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>
2021-05-11 22:39:50 -04:00
Mike Blumenkrantz 208e34e110 zink: update samplerview descriptor layouts when image binds are set
for this case it's important to match the GENERAL layout in sampler bindings
if the resource is also being used as a shader image

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>
2021-05-11 22:39:50 -04:00
Mike Blumenkrantz 4c7d951b76 zink: track bind counts for descriptors
* for samplers this is a per-stage slot mask that will be used for fast layout updates
* images get a count for gfx and compute usage
* any writable descriptor bind gets its own gfx/compute counter
* all descriptor binds are now counted

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>
2021-05-11 22:39:50 -04:00
Mike Blumenkrantz 27a4ba52db zink: unify resource rebinding
this improves handling for shader images

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>
2021-05-11 22:39:50 -04:00
Mike Blumenkrantz 42634824f8 zink: add context-based descriptor info tracking infrastructure
this maintains the exact structs needed to update descriptor states

it's incomplete at this moment due to lacking shader image rebinds, but
it's also not yet being used

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>
2021-05-11 22:39:50 -04:00
Mike Blumenkrantz a8e80b3344 zink: stop invalidating descriptor sets on pool destroy
this was debug code I was using for testing pool validity, but it
stopped being useful and just crashes sometimes now

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>
2021-05-11 22:39:50 -04:00
Yiwei Zhang 47eabd0e6b virgl: do not use winsys info for guest storage of classic resource
winsys_stride is the stride of the host storage of the classic resource,
and using that breaks the readback on the guest storage.

v2: move the scrubbing to virgl_resource_from_handle
The returned modifier also points directly to the host driver's real
modifier but not a virtualized one. Leave plane_offset as zero here
matches the prior behavior before introducing winsys info.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> (v1)
Reviewed-by: Chia-I Wu <olvaffe@gmail.com> (v2)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10757>
2021-05-11 23:51:42 +00:00
Mark Janes 494255c821 iris: Use const uploader for user index data
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10759>
2021-05-11 16:03:22 -07:00
Mark Janes cdadb84e41 iris: Use const uploader for draw parameters
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10759>
2021-05-11 16:03:21 -07:00
Mark Janes 19ea0974da iris: Use const uploader for blorp vertex data
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10759>
2021-05-11 16:03:20 -07:00
Mark Janes beceb392d7 iris: Use const_uploader for iris_create_stream_output_target
This data is written and read by the GPU, and does not need to be in
system memory.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10759>
2021-05-11 16:03:20 -07:00
Mark Janes 8838861ea3 iris: Upload constant resources for efficient GPU access
Re-using the stream_uploader for constant data hurts performance on
DG1.  Constant data like uniform buffers should reside in local
memory for faster GPU access.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10759>
2021-05-11 16:03:18 -07:00
Mark Janes ecd75318e3 iris: Increase the size of upload buffers
Smaller sizes may generate CPU overhead while saving negligible
memory.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10759>
2021-05-11 16:03:15 -07:00
Emma Anholt 161478ad4c ci/iris: Add some more traces to replay.
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10295>
2021-05-11 20:07:29 +00:00
Emma Anholt cd142cc483 ci/panfrost: Add some more traces to replay.
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10295>
2021-05-11 20:07:29 +00:00
Emma Anholt 7520ac54dd ci: Switch to apitraces for glmark2
This brings in upstream mediump fixes, and should also replay faster than
.rdc files.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10295>
2021-05-11 20:07:29 +00:00
Tomeu Vizoso 8b04b77118 ci: Remove the need for an empty Piglit results file
Just create such an empty file if there isn't already.

So drivers that are expected to pass all tests don't need to commit an
empty results file.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10295>
2021-05-11 20:07:29 +00:00
Adam Jackson 584145ea88 zink/ntv: Don't call free() on ralloc'd memory
Caught this with an LTO build:

[1465/1465] Linking target src/gallium/targets/dri/libgallium_dri.so
In function ‘spirv_shader_delete’,
    inlined from ‘nir_to_spirv’ at ../src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c:3907:7:
../src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c:3916:4: warning: ‘free’ called on pointer ‘block_1394’ with nonzero offset 48 [-Wfree-nonheap-object]
 3916 |    FREE(s);
      |    ^
../src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c: In function ‘nir_to_spirv’:
../src/util/ralloc.c:133:18: note: returned from ‘malloc’
  133 |    void *block = malloc(align64(size + sizeof(ralloc_header),
      |                  ^

Since s->words is allocated on the same ralloc context we can simplify
further by freeing the context all at once.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10754>
2021-05-11 16:45:14 +00:00
Mike Blumenkrantz eb63c7dece iris: refcount separate screen objects for resource tracking
this screen object can never, ever be accessed like this in a resource,
as it may have previously been replaced by a wrapper (e.g., driver trace)
which will then explode when it is accessed directly

instead, keep a separate screen ref on the resource which is known to be
the actual driver object and not a wrapper

Fixes: 0a497eb130 ("iris: make resources take a ref on the screen object")

Reviewed-by: Lionel Landwerlin lionel.g.landwerlin@intel.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10632>
2021-05-11 14:50:19 +00:00
Emma Anholt 9a5c9ff342 turnip: Drop fail annotation for driver_properties.
These subtests weren't run in CI, and the whole set is skipped since
dropping to 1.1.

Fixes: 7bcda21441 ("turnip: Demote API version to 1.1.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10734>
2021-05-11 14:16:25 +00:00
Emma Anholt 63a3d18ae1 ci/turnip: Add some links to issues and MRs for some test failures.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10734>
2021-05-11 14:16:25 +00:00
Emma Anholt 90b08175b7 ci/turnip: Clean up some stale fail annotations.
This test group was fixed in the deqp 1.2.6.0 uprev, but we do a
fractional run that didn't include these tests.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10734>
2021-05-11 14:16:25 +00:00
Adam Jackson 37e1526479 gallivm: Fix a signature mismatch warning
gcc 11 says:

../src/gallium/auxiliary/gallivm/lp_bld_format_soa.c:84:49: warning: argument 3 of type ‘struct LLVMOpaqueValue * const*’ declared as a pointer [-Warray-parameter=]
   84 |                             const LLVMValueRef *unswizzled,
      |                             ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
In file included from ../src/gallium/auxiliary/gallivm/lp_bld_format_soa.c:42:
../src/gallium/auxiliary/gallivm/lp_bld_format.h:126:48: note: previously declared as an array ‘struct LLVMOpaqueValue * const[4]’
  126 |                             const LLVMValueRef unswizzled[4],
      |                             ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10738>
2021-05-11 09:14:30 -04:00
Danylo Piliaiev 811f289c56 turnip: copy all layers specified in vkCmdCopyImage
When copying layered images we ignored .layerCount parameter.

Fixes mis-rendering of walls in D3D11 game "Company Of Heroes 2".

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10736>
2021-05-11 11:42:12 +00:00
Iago Toral Quiroga 6f93354bae broadcom/compiler: clarify PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR setting
We enabled this in the past to fix some register allocation issues we
faced with geometry shaders but we didn't document why it is safe for
us to do this, which is not immediately obvious.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10745>
2021-05-11 12:26:19 +02:00
Iago Toral Quiroga 370495abd1 v3d: disable GLSL loop unrolling again
We had re-enabled this because of some test regressions:

KHR-GLES31.core.geometry_shader.limits.max_input_components and
ext_transform_feedback-max-varyings failed to register allocate,
but now that we support indirect indexing on vertex shader outputs natively
this is no longer an issue.

Piglit's max-samplers tests failed. These tests use indirect indexing
on samplers which is not supported and fail to link with this error message:
"Failed to link: error: sampler arrays indexed with non-constant expressions
is forbidden in GLSL  110". This is expected. The reason these were passing
before is that loop unrolling was able to turn indirect indexing into
direct indexing. We add them to the expected fail list.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10723>
2021-05-11 09:31:31 +00:00