platform/upstream/mesa.git
3 years agozink: simplify clear-apply on fb state change
Mike Blumenkrantz [Tue, 9 Mar 2021 20:39:50 +0000 (15:39 -0500)]
zink: simplify clear-apply on fb state change

since surfaces are cached and deduplicated, we no longer have to
do deep comparisons to determine whether two surfaces are equal and can
just compare the pointers

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10087>

3 years agozink: stop unmapping resources
Mike Blumenkrantz [Tue, 26 Jan 2021 23:10:13 +0000 (18:10 -0500)]
zink: stop unmapping resources

it turns out there's not actually a requirement that resources be unmapped,
which means that a ton of overhead can be saved both in the unmap codepath
(the cpu overhead here is pretty insane) and then also when mapping cached
resource memory, as the map can now be added to the cache for immediate reuse

as seen in radeonsi

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9980>

3 years agozink: fix conditional when assigning tess variable io
Mike Blumenkrantz [Thu, 1 Apr 2021 21:43:50 +0000 (17:43 -0400)]
zink: fix conditional when assigning tess variable io

this was not copied directly and changed the old conditional, which
was intended to catch only non-patch tess io

fixes tess io with legacy builtins, e.g., spec@!opengl 2.0@vertex-program-two-side back front2 back2

Fixes: 2d98efd3232 ("zink: pre-populate locations in variables")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9996>

3 years agozink: bypass separate stencil path in resource_reference_rw when not a zs image
Mike Blumenkrantz [Tue, 12 Jan 2021 22:05:24 +0000 (17:05 -0500)]
zink: bypass separate stencil path in resource_reference_rw when not a zs image

no point in trying to get a stencil resource if none exists

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9961>

3 years agozink: remove atomic usage from batch tracking comparisons
Mike Blumenkrantz [Tue, 12 Jan 2021 17:28:22 +0000 (12:28 -0500)]
zink: remove atomic usage from batch tracking comparisons

race conditions here have no impact because it cannot change the evaluation
of this condition

also no need to check zs stuff if there's no update happening

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9961>

3 years agozink: add env var to force uniform inlining
Mike Blumenkrantz [Tue, 29 Dec 2020 18:30:24 +0000 (13:30 -0500)]
zink: add env var to force uniform inlining

this is great for debugging/testing, but there's no great heuristics
for using it yet

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9888>

3 years agozink: implement uniform inlining
Mike Blumenkrantz [Wed, 16 Dec 2020 17:20:39 +0000 (12:20 -0500)]
zink: implement uniform inlining

this lets us inline away our problems

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9888>

3 years agozink: add a pipe_screen::finalize_nir hook
Mike Blumenkrantz [Tue, 29 Dec 2020 16:32:18 +0000 (11:32 -0500)]
zink: add a pipe_screen::finalize_nir hook

moves some of the always-run passes into the base nir

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9888>

3 years agoaux/trace: add GALLIUM_TRACE_TRIGGER mode
Mike Blumenkrantz [Tue, 6 Apr 2021 13:40:21 +0000 (09:40 -0400)]
aux/trace: add GALLIUM_TRACE_TRIGGER mode

similar to amd/radv driver debug modes for sqtt, this specifies a filename
which is checked on every flush(PIPE_FLUSH_END_OF_FRAME); when it exists,
the next frame (and only that frame) is captured into the trace

to use, specify a file with the env var, run your app, and 'touch /path/to/file'
when you want to capture a trace

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10058>

3 years agomicrosoft/spirv_to_dxil: Use non-zero exit code on failed compilations
Enrico Galli [Tue, 6 Apr 2021 23:12:49 +0000 (16:12 -0700)]
microsoft/spirv_to_dxil: Use non-zero exit code on failed compilations

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10064>

3 years agomicrosoft/spirv_to_dxil: Add support for load_vulkan_descriptor
Enrico Galli [Wed, 24 Mar 2021 07:41:04 +0000 (00:41 -0700)]
microsoft/spirv_to_dxil: Add support for load_vulkan_descriptor

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10064>

3 years agoutil/hash_table: add macro for destructively iterating entries
Mike Blumenkrantz [Tue, 12 Jan 2021 19:49:48 +0000 (14:49 -0500)]
util/hash_table: add macro for destructively iterating entries

a common usage for hash tables is for tracking exactly one instance of a pointer
for a given period of time, after which the table's entries are purged and it
is reused

this macro enables the purge phase of such usage to reset the table to a
pristine state, avoiding future rehashing due to ballooning of deleted entries

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8498>

3 years agoutil/set: add macro for destructively iterating set entries
Mike Blumenkrantz [Tue, 12 Jan 2021 19:49:48 +0000 (14:49 -0500)]
util/set: add macro for destructively iterating set entries

a common usage for sets is for tracking exactly one instance of a pointer
for a given period of time, after which the set's entries are purged and it
is reused

this macro enables the purge phase of such usage to reset the table to a
pristine state, avoiding future rehashing due to ballooning of deleted entries

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8498>

3 years agoaux/trace: add a bunch of methods for lavapipe
Mike Blumenkrantz [Wed, 31 Mar 2021 17:54:17 +0000 (13:54 -0400)]
aux/trace: add a bunch of methods for lavapipe

with all of these, lavapipe can now be traced

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9958>

3 years agoaux/trace: add screen deduplication for zink+lavapipe tracing
Mike Blumenkrantz [Tue, 6 Apr 2021 14:07:49 +0000 (10:07 -0400)]
aux/trace: add screen deduplication for zink+lavapipe tracing

if zink+lavapipe is enabled at compile-time, special handling is needed
to ensure that only the intended screen is traced, otherwise malformed
xml will be generated

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10059>

3 years agodocs: update lavapipe bits for 1.1
Dave Airlie [Wed, 7 Apr 2021 20:24:19 +0000 (06:24 +1000)]
docs: update lavapipe bits for 1.1

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10086>

3 years agozink: export PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER
Mike Blumenkrantz [Thu, 10 Dec 2020 16:14:51 +0000 (11:14 -0500)]
zink: export PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER

avoids memcpy slowpath

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9733>

3 years agolavapipe: enable Vulkan 1.1 support
Dave Airlie [Thu, 4 Mar 2021 05:34:35 +0000 (15:34 +1000)]
lavapipe: enable Vulkan 1.1 support

This is not fully conformant but the failures are the same as the Vulkan 1.0
failures.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9645>

3 years agolavapipe: enable correct workgroup sizing
Dave Airlie [Mon, 5 Apr 2021 21:41:58 +0000 (07:41 +1000)]
lavapipe: enable correct workgroup sizing

If I say layering violation, you say?

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9645>

3 years agolavapipe: enable subgroups features
Dave Airlie [Fri, 19 Mar 2021 02:05:01 +0000 (12:05 +1000)]
lavapipe: enable subgroups features

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9645>

3 years agogallivm: add compute shader subgroup system values support
Dave Airlie [Fri, 19 Mar 2021 02:04:32 +0000 (12:04 +1000)]
gallivm: add compute shader subgroup system values support

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9645>

3 years agogallivm: add subgroup lowering support
Dave Airlie [Fri, 19 Mar 2021 02:04:11 +0000 (12:04 +1000)]
gallivm: add subgroup lowering support

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9645>

3 years agogallivm: add subgroup read invocation support
Dave Airlie [Fri, 19 Mar 2021 02:03:56 +0000 (12:03 +1000)]
gallivm: add subgroup read invocation support

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9645>

3 years agogallivm: add subgroup ballot support
Dave Airlie [Fri, 19 Mar 2021 02:03:38 +0000 (12:03 +1000)]
gallivm: add subgroup ballot support

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9645>

3 years agogallivm: add subgroup reduction + in/ex scan support
Dave Airlie [Fri, 19 Mar 2021 02:02:50 +0000 (12:02 +1000)]
gallivm: add subgroup reduction + in/ex scan support

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9645>

3 years agogallivm: add subgroup elect intrinsic support.
Dave Airlie [Fri, 19 Mar 2021 02:01:41 +0000 (12:01 +1000)]
gallivm: add subgroup elect intrinsic support.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9645>

3 years agogallivm: add subgroup system values support
Dave Airlie [Fri, 19 Mar 2021 01:59:33 +0000 (11:59 +1000)]
gallivm: add subgroup system values support

This just adds support for retrieving subgroup system values.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9645>

3 years agogallivm: move get_flt_bld to header.
Dave Airlie [Fri, 19 Mar 2021 01:58:18 +0000 (11:58 +1000)]
gallivm: move get_flt_bld to header.

Rewrite a little as we have to add 16-bit support later in life

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9645>

3 years agogallivm: add subgroup vote 64-bit and feq support.
Dave Airlie [Fri, 19 Mar 2021 01:56:35 +0000 (11:56 +1000)]
gallivm: add subgroup vote 64-bit and feq support.

These are both required for vulkan subgroup support.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9645>

3 years agolavapipe: fix missing protected memory properties
Dave Airlie [Wed, 17 Mar 2021 22:54:43 +0000 (08:54 +1000)]
lavapipe: fix missing protected memory properties

This is needed for vk 1.1

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9645>

3 years agolavapipe: add vulkan 1.1 properties/features apis
Dave Airlie [Tue, 22 Dec 2020 07:02:29 +0000 (17:02 +1000)]
lavapipe: add vulkan 1.1 properties/features apis

Still have to add subgroups before advertising 1.1

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9645>

3 years agolavapipe: add some asserts for blit region extents
Mike Blumenkrantz [Fri, 2 Apr 2021 15:05:09 +0000 (11:05 -0400)]
lavapipe: add some asserts for blit region extents

this enforces spec for 3d vs array texture blits, more to come

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10005>

3 years agoci: update zink/virgl results for depth clamping fixes
Dave Airlie [Wed, 7 Apr 2021 03:44:14 +0000 (13:44 +1000)]
ci: update zink/virgl results for depth clamping fixes

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10068>

3 years agollvmpipe: always take depth clamping from state tracker
Dave Airlie [Wed, 7 Apr 2021 01:18:44 +0000 (11:18 +1000)]
llvmpipe: always take depth clamping from state tracker

Don't be smarter than state tracker here, of d3d10 wants to do
something the state tracker should hard code that. Since lavapipe
wants to use clip_halfz and depth clipping independently.

This fixes some issues blitting Z that zink was seeing

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10068>

3 years agollvmpipe: when depth clamp is disable clamp to 0.0/1.0
Dave Airlie [Wed, 7 Apr 2021 03:18:29 +0000 (13:18 +1000)]
llvmpipe: when depth clamp is disable clamp to 0.0/1.0

When depth clamp is disabled the viewport values aren't meaningful,
however the value is about to be converted to a unorm so needs
to still be clamped to 0/1.

This might not be the best place for this, maybe it should be in
the write swizzled code.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10068>

3 years agoradv: enable DCC for concurrent images on GFX10
Samuel Pitoiset [Tue, 9 Mar 2021 09:16:18 +0000 (10:16 +0100)]
radv: enable DCC for concurrent images on GFX10

The driver now supports DCC stores on GFX10 that means that we can
keep DCC compressed on all layouts/queues.

This should help games which use aync compute or which declare
all images as concurrent like Youngblood.

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/9850>

3 years agoradv: simplify a check when enabling DCC for concurrent images
Samuel Pitoiset [Tue, 9 Mar 2021 08:58:38 +0000 (09:58 +0100)]
radv: simplify a check when enabling DCC for concurrent images

If the image is marked as concurrent, each element of
pQueueFamilyIndices must be unique, so queue_family_mask is
different than 1.

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/9850>

3 years agozink: emit WorkgroupSize when not using ExecutionModeLocalSize
Mike Blumenkrantz [Wed, 7 Apr 2021 16:56:49 +0000 (12:56 -0400)]
zink: emit WorkgroupSize when not using ExecutionModeLocalSize

the system_values_read bit might not be set if the value isn't read or is
DCE, but it still needs to be emitted

probably.

fixes #4591

Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
Tested-by: Witold Baryluk <witold.baryluk@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10079>

3 years agodocs: update calendar and link releases notes for 21.0.2
Dylan Baker [Wed, 7 Apr 2021 17:19:53 +0000 (10:19 -0700)]
docs: update calendar and link releases notes for 21.0.2

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10078>

3 years agorelnotes: Add sha256sum for 21.0.2
Dylan Baker [Wed, 7 Apr 2021 17:17:13 +0000 (10:17 -0700)]
relnotes: Add sha256sum for 21.0.2

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10078>

3 years agodocs: add release notes for 21.0.2
Dylan Baker [Wed, 7 Apr 2021 16:35:07 +0000 (09:35 -0700)]
docs: add release notes for 21.0.2

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10078>

3 years agoci: Use lavacli from master
Corentin Noël [Wed, 7 Apr 2021 12:54:50 +0000 (14:54 +0200)]
ci: Use lavacli from master

This allows to fix some credential leaks and provides compatibility with
the latest LAVA version.

Avoids failures when the LAVA instance returns Error 500

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9851>

3 years agoradv: enable DCC stores with MSAA 4x/8x on GFX10+
Samuel Pitoiset [Tue, 6 Apr 2021 06:50:34 +0000 (08:50 +0200)]
radv: enable DCC stores with MSAA 4x/8x on GFX10+

Should work now.

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/10052>

3 years agonir/lower_idiv: Add 8-bit and 16-bit lowering path
Alyssa Rosenzweig [Tue, 5 Jan 2021 20:35:10 +0000 (15:35 -0500)]
nir/lower_idiv: Add 8-bit and 16-bit lowering path

Roundtrip to a larger float and divide there. The extra details for
mod/rem are handled directly in integer space to simplify verification
of rounding details. The one issue is that the mantissa might be
rounded down which will cause issues; adding 1 unconditionally (proposed
by Jonathan Marek) fixes this. The lowerings here were tested
exhaustively on all pairs of 16-bit integers.

v2: Update idiv lowering per Rhys Perry's comment.

v3: Rewrite lowerings.

v4: Remove useless ftrunc, fix 8-bit issue, simplify code.

v5: Remove useless ffloor

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Tested-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Tested-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8339>

3 years agonir/lower_idiv: Factor out numer/denom load
Alyssa Rosenzweig [Tue, 5 Jan 2021 19:06:07 +0000 (14:06 -0500)]
nir/lower_idiv: Factor out numer/denom load

No need to duplicate across paths.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8339>

3 years agonir/lower_idiv: Convert to lower_instructions
Alyssa Rosenzweig [Tue, 5 Jan 2021 16:22:19 +0000 (11:22 -0500)]
nir/lower_idiv: Convert to lower_instructions

Helps deduplicate some code between the two lowering paths. In
particular, it ports the missing 32-bit? check to the precise pass. This
does not change anything immediately: drivers depending on this to lower
16-bit did not work before due to type mismatches and will not work now
since it'll refuse to lower. But that means sub-32-bit idiv can be
lowered more efficiently in an algebraic pass.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8339>

3 years agonir: Add {i2f, u2f, f2i, f2u} helpers
Alyssa Rosenzweig [Tue, 5 Jan 2021 19:43:14 +0000 (14:43 -0500)]
nir: Add {i2f, u2f, f2i, f2u} helpers

Convenient for bitsize independent lowerings, will be used in the idiv
lowering.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8339>

3 years agonir: Add nir_type_convert
Alyssa Rosenzweig [Tue, 5 Jan 2021 19:42:10 +0000 (14:42 -0500)]
nir: Add nir_type_convert

Generalizes nir_convert_to_bit_size, which we implement as a
special-case.

v2: Take a sized dest type but allow unsized or sized source to address
Jason's feedback. Shorten name.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8339>

3 years agoradv: perform MSAA color decompression for storage images with DCC
Samuel Pitoiset [Fri, 26 Mar 2021 12:41:03 +0000 (13:41 +0100)]
radv: perform MSAA color decompression for storage images with DCC

For MSAA storage images with DCC, we also need to perform a MSAA
color decompression.

Fixes dEQP-VK.pipeline.multisample.storage_image.* if DCC stores
is enabled.

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/9854>

3 years agoaco: fix integer tg4 workaround with unnormalized coordinates
Rhys Perry [Wed, 31 Mar 2021 16:46:52 +0000 (17:46 +0100)]
aco: fix integer tg4 workaround with unnormalized coordinates

Same as LLVM from 2abf62d3483afd8f0de7f19d114d164de4741127.

fossil-db (GFX8):
Totals from 15 (0.01% of 147787) affected shaders:
VGPRs: 744 -> 748 (+0.54%)
CodeSize: 100472 -> 100732 (+0.26%)
Instrs: 19995 -> 20059 (+0.32%)
Latency: 1001530 -> 1001859 (+0.03%)
InvThroughput: 378508 -> 378747 (+0.06%)
SClause: 676 -> 675 (-0.15%)
Copies: 1655 -> 1654 (-0.06%)
PreSGPRs: 735 -> 742 (+0.95%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10053>

3 years agoir3: Don't copy propagate arrays in ir3_cp
Connor Abbott [Fri, 19 Mar 2021 15:41:38 +0000 (16:41 +0100)]
ir3: Don't copy propagate arrays in ir3_cp

We don't check whether there's an intervening write in this pass, which
makes it incorrect. ir3_cp_postsched does check correctly, but we were
accidentally doing it here anyway for some sources.

While we're here, delete some code that was only used in the array case.

Fixes: f370e954 ("freedreno/ir3: handle const/immed/abs/neg in cp")
Reviewed-by: Rob Clark <robdclark@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10076>

3 years agoir3/cp_postsched: Set address of uses for relative mov's
Connor Abbott [Fri, 19 Mar 2021 15:37:30 +0000 (16:37 +0100)]
ir3/cp_postsched: Set address of uses for relative mov's

Fixes: 680ca5b ("freedreno/ir3: add post-scheduler cp pass")
Reviewed-by: Rob Clark <robdclark@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10076>

3 years agoir3: Fix valid flags for STIB
Connor Abbott [Fri, 19 Feb 2021 17:03:08 +0000 (18:03 +0100)]
ir3: Fix valid flags for STIB

Disallow immediates for the source. This was hidden by the fact that we
didn't copy-propagate trivial collect instructions.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10076>

3 years agoir3/legalize: Fix last input (ss) insertion
Connor Abbott [Thu, 11 Mar 2021 12:11:20 +0000 (13:11 +0100)]
ir3/legalize: Fix last input (ss) insertion

If there was a mix of ldlv and bary.f and we inserted an (ss) *after*
the last input which was a bary.f, then last_input_needs_ss would get
unset, even though it shouldn't. For figuring out whether we need the
(ss), we need to know whether there are any pending ldlv's when
last_input gets executed, not at the end of the block, which means that
the existing code's strategy of inserting it after the whole block has
been processed won't work. Rework it to do the last_input processing in
the main loop instead.

Reviewed-by: Rob Clark <robdclark@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10076>

3 years agofreedreno/a3xx: Fix SP_FS_CTRL_REG1_INITIALOUTSTANDING
Connor Abbott [Tue, 2 Mar 2021 16:30:52 +0000 (17:30 +0100)]
freedreno/a3xx: Fix SP_FS_CTRL_REG1_INITIALOUTSTANDING

Unfortunately this didn't fix anything, but I thought I might as well
include it.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10076>

3 years agoutil/bitset: Avoid out-of-bounds reads
Connor Abbott [Tue, 23 Feb 2021 16:30:33 +0000 (17:30 +0100)]
util/bitset: Avoid out-of-bounds reads

I missed a corner case here: when the next range ends right at the end
of the bitset, we need to return immediately to avoid trying to search
after the bitset. And when finding the next end, we similarly need to
bail if the range is size 1 at the very end of the range. In practice
this probably would'nt have been noticed, because it would break out of
the loop anyway, but I happened to be running something using this under
Valgrind and it complained.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10076>

3 years agointel: avoid dumping null cs sampler/binding states
Mike Blumenkrantz [Wed, 7 Apr 2021 14:08:26 +0000 (10:08 -0400)]
intel: avoid dumping null cs sampler/binding states

this crashes the driver

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/10077>

3 years agonir_to_tgsi: run constant folding after nir_opt_algebraic
Rhys Perry [Wed, 7 Apr 2021 09:04:28 +0000 (10:04 +0100)]
nir_to_tgsi: run constant folding after nir_opt_algebraic

Otherwise, an infinite loop can occur.

The first nir_opt_algebraic in the loop can optimize:
op(bcsel(a, #b, c), #d) to bcsel(a, op(b, d), op(c, d))
which (because op(b, d) is not constant folded), will be reverted by the
second nir_opt_algebraic in the loop.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10071>

3 years agointel: Drop gen_device_info::has_resource_streamer
Jason Ekstrand [Wed, 7 Apr 2021 02:39:56 +0000 (21:39 -0500)]
intel: Drop gen_device_info::has_resource_streamer

We've never done anything with that HW and it was removed in ICL.
There's no point in carrying around the useless field.

Acked-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10069>

3 years agowsi/x11: Wait for fences with IMMEDIATE on Xwayland
Michel Dänzer [Tue, 6 Apr 2021 10:15:45 +0000 (12:15 +0200)]
wsi/x11: Wait for fences with IMMEDIATE on Xwayland

The commit below was already meant to do this, but accidentally missed
this part.

Fixes stutter when the frame-rate drops below the refresh rate.

Fixes: e8f50bd60087 "wsi/x11: Treat IMMEDIATE present mode the same as
                     MAILBOX for Xwayland"

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10026>

3 years agoturnip: implement variableMultisampleRate
Danylo Piliaiev [Thu, 11 Mar 2021 14:22:38 +0000 (16:22 +0200)]
turnip: implement variableMultisampleRate

If subpass doesn't have depth/color attachments - samples count is
devised from VkPipelineMultisampleStateCreateInfo::rasterizationSamples.
Without variableMultisampleRate enabled all pipelines in such subpass
should have the same samples count; variableMultisampleRate allows
to have pipelines with different number of samples in one subpass,
given that it doesn't have depth/color attachments.

Blob doesn't have it enabled but there is no known reason for this.

Passes:
 dEQP-VK.pipeline.multisample.variable_rate.*

Fixes test:
 dEQP-VK.pipeline.framebuffer_attachment.no_attachments_ms

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9556>

3 years agoci: Don't retry failed test runs
Tomeu Vizoso [Wed, 31 Mar 2021 13:01:48 +0000 (15:01 +0200)]
ci: Don't retry failed test runs

After a recent LAVA update, failures in running a test would cause the
whole test to be retried. We only want for the boot to be retried (in
case of infrastructuer errors), so set the nr of retries for tests to 1.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9950>

3 years agoci: Set more reasonable timeouts for LAVA jobs
Tomeu Vizoso [Wed, 31 Mar 2021 13:00:35 +0000 (15:00 +0200)]
ci: Set more reasonable timeouts for LAVA jobs

The test timeout shouldn't be bigger than the whole job's timeout.

Also, reduce the timeouts to a more sane level and remove timeouts that
don't bring value.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9950>

3 years agoci: Use a single template for LAVA jobs
Tomeu Vizoso [Mon, 1 Feb 2021 10:42:43 +0000 (11:42 +0100)]
ci: Use a single template for LAVA jobs

It's a pain to keep both templates in sync and there aren't really that
many differences.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9950>

3 years agoaux/trace: add a set_inlinable_constants hook
Mike Blumenkrantz [Tue, 6 Apr 2021 13:39:54 +0000 (09:39 -0400)]
aux/trace: add a set_inlinable_constants hook

Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10057>

3 years agov3d: use uint type in _gen_unpack_uint
Juan A. Suarez Romero [Tue, 6 Apr 2021 14:45:20 +0000 (16:45 +0200)]
v3d: use uint type in _gen_unpack_uint

Use a unsigned int type in the loop to avoid unintended sign extensions.

Fixes CID#1414500 (Unintended sign extension [SIGN_EXTENSION]).

Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10060>

3 years agopanfrost: Hook up indirect draw support
Boris Brezillon [Mon, 25 Jan 2021 11:00:56 +0000 (12:00 +0100)]
panfrost: Hook up indirect draw support

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/8700>

3 years agopanfrost: Prepare things for indirect draws
Boris Brezillon [Mon, 25 Jan 2021 15:45:14 +0000 (16:45 +0100)]
panfrost: Prepare things for indirect draws

Several things need to be tweaked to re-use existing helpers for
indirect draws:

* Indirect draws should always be considered as instanced draws since
  we don't know in advance how many instances will be requested. For
  each vertex attribute buffer entry we store the element divisor which
  will be extracted by the compute shader and transformed into a HW
  divisor

* PRIMITIVE.index_count should be initialized to its default value
  (one, or zero after the minus(1) modification) waiting for the
  compute shader to patch it

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/8700>

3 years agopanfrost: Add helpers to support indirect draws
Boris Brezillon [Mon, 25 Jan 2021 12:14:49 +0000 (13:14 +0100)]
panfrost: Add helpers to support indirect draws

Indirect draws are implemented with compute jobs patching the
vertex/tiler jobs. Provide helpers to do that.

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/8700>

3 years agopanfrost: Stop including pan_device.h from pan_bo.h
Boris Brezillon [Tue, 6 Apr 2021 09:36:34 +0000 (11:36 +0200)]
panfrost: Stop including pan_device.h from pan_bo.h

We want to define structures containing pan_pool objects in pan_device.h
but it is prevented by the

      pan_device.h -> pan_pool.h -> pan_bo.h
          ^____________________________|

loop.

Break this loop by not including pan_device.h from pan_bo.h.

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/8700>

3 years agogallium/u_threaded: split draws that don't fit in a batch
Pierre-Eric Pelloux-Prayer [Tue, 30 Mar 2021 13:51:50 +0000 (15:51 +0200)]
gallium/u_threaded: split draws that don't fit in a batch

Multidraws with large draw count will try to call tc_add_slot_based_call
with a payload larger than TC_CALLS_PER_BATCH.

This commit split these draws in multiple commands to avoid this issue.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4534
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9920>

3 years agopanfrost: Skip disabled RTs when selecting a RT for transaction elimination
Boris Brezillon [Tue, 30 Mar 2021 07:39:26 +0000 (09:39 +0200)]
panfrost: Skip disabled RTs when selecting a RT for transaction elimination

If the render target is disabled, the CRC won't be updated, and the
slice state should stay unchanged.

Fixes dEQP-GLES2.functional.fbo.render.shared_colorbuffer.tex2d_rgba_stencil_index8
and dEQP-GLES2.functional.fbo.render.shared_colorbuffer.rbo_rgba4_depth_component16.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9907>

3 years agopanfrost: Don't reserve space in the color buffer for disabled RTs
Boris Brezillon [Tue, 30 Mar 2021 07:34:58 +0000 (09:34 +0200)]
panfrost: Don't reserve space in the color buffer for disabled RTs

Render targets that have no clear or draws are disabled and thus don't
use the color buffer. Don't reserve space for those.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9907>

3 years agowinsys/amdgpu: remove another 8 bytes from amdgpu_winsys_bo by packing better
Marek Olšák [Sun, 28 Mar 2021 10:49:55 +0000 (06:49 -0400)]
winsys/amdgpu: remove another 8 bytes from amdgpu_winsys_bo by packing better

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9809>

3 years agogallium/pb: remove 8 bytes from pb_buffer by packing variables
Marek Olšák [Sun, 28 Mar 2021 10:23:02 +0000 (06:23 -0400)]
gallium/pb: remove 8 bytes from pb_buffer by packing variables

Only svga used usages beyond 16 bits. All other drivers are OK with 16 bits.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9809>

3 years agogallium/pb: change pb_buffer::alignment to alignment_log2
Marek Olšák [Sun, 28 Mar 2021 10:17:03 +0000 (06:17 -0400)]
gallium/pb: change pb_buffer::alignment to alignment_log2

Alignments are always 2^n, so store n = log2(alignment). The next commit
will take advantage of the saved space.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9809>

3 years agowinsys/amdgpu: add amdgpu_cs::ws to reduce dereferences
Marek Olšák [Wed, 24 Mar 2021 00:38:48 +0000 (20:38 -0400)]
winsys/amdgpu: add amdgpu_cs::ws to reduce dereferences

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9809>

3 years agowinsys/amdgpu: remove amdgpu_winsys_bo::ws
Marek Olšák [Tue, 23 Mar 2021 07:43:07 +0000 (03:43 -0400)]
winsys/amdgpu: remove amdgpu_winsys_bo::ws

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9809>

3 years agoradeon_winsys.h: add a winsys parameter to most winsys buffer functions
Marek Olšák [Tue, 23 Mar 2021 22:33:41 +0000 (18:33 -0400)]
radeon_winsys.h: add a winsys parameter to most winsys buffer functions

This will allow removing the winsys pointer from buffers.

The amdgpu winsys adds dummy_ws to get radeon_winsys because there can be
no radeon_winsys around (e.g. while amdgpu_winsys is being destroyed), but
we still need some way to call buffer functions.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9809>

3 years agoradeon_winsys.h: add a new function radeon_bo_reference that takes a winsys
Marek Olšák [Tue, 23 Mar 2021 05:41:57 +0000 (01:41 -0400)]
radeon_winsys.h: add a new function radeon_bo_reference that takes a winsys

This will allow removing the winsys pointer from buffers.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9809>

3 years agowinsys/radeon: rename radeon_bo_reference -> radeon_ws_bo_reference
Marek Olšák [Tue, 23 Mar 2021 06:06:46 +0000 (02:06 -0400)]
winsys/radeon: rename radeon_bo_reference -> radeon_ws_bo_reference

radeon_bo_reference will be a new function in radeon_winsys.h.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9809>

3 years agogallium/pb: pass an optional winsys pointer to the buffer destroy function
Marek Olšák [Tue, 23 Mar 2021 05:31:39 +0000 (01:31 -0400)]
gallium/pb: pass an optional winsys pointer to the buffer destroy function

This will allow removing the winsys pointer from buffers.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9809>

3 years agointel/compiler: lower bit sizes in NIR postprocessing
Lionel Landwerlin [Fri, 19 Mar 2021 09:09:56 +0000 (11:09 +0200)]
intel/compiler: lower bit sizes in NIR postprocessing

It appears that between preprocess & postprocess some descriptor
lowering introduces 8bit types in the shader, so run the lower bit
size again to make sure we don't have any unsupported types in our
shader.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: e06144a818950e ("anv: Use 64bit_global_32bit_offset for SSBOs")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4478
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9705>

3 years agopan/bi: Remove conversion lowering
Alyssa Rosenzweig [Fri, 1 Jan 2021 03:15:55 +0000 (22:15 -0500)]
pan/bi: Remove conversion lowering

Inherited from Midgard, it's easier to just do at NIR->BIR time now that
we have a builder that doesn't suck. Impeded certain optimizations.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10065>

3 years agopan/bi: Generalize f2i16, f2u16
Alyssa Rosenzweig [Wed, 6 Jan 2021 22:13:34 +0000 (17:13 -0500)]
pan/bi: Generalize f2i16, f2u16

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10065>

3 years agopan/bi: Fill in some more conversions
Alyssa Rosenzweig [Fri, 1 Jan 2021 03:14:42 +0000 (22:14 -0500)]
pan/bi: Fill in some more conversions

The trick is that downcasts are just swizzling out what you don't want,
so things like U32_TO_F16 can be synthesized as V2U16_TO_V2F16 with
src.h00

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10065>

3 years agopan/bi: Lower swizzles
Alyssa Rosenzweig [Tue, 23 Feb 2021 23:46:43 +0000 (23:46 +0000)]
pan/bi: Lower swizzles

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10065>

3 years agopan/bi: Optimize MKVEC.v2i16 generation
Alyssa Rosenzweig [Thu, 31 Dec 2020 21:04:38 +0000 (16:04 -0500)]
pan/bi: Optimize MKVEC.v2i16 generation

Prefer SWZ.v2i16 in cases where that's possible, it will be easier to
optimize later.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10065>

3 years agopan/bi: Add bi_swz_16 helper
Alyssa Rosenzweig [Thu, 31 Dec 2020 21:16:07 +0000 (16:16 -0500)]
pan/bi: Add bi_swz_16 helper

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10065>

3 years agoradeonsi: fix si_compute_copy_image if DCC decompression happens before a copy
Marek Olšák [Tue, 6 Apr 2021 16:28:46 +0000 (12:28 -0400)]
radeonsi: fix si_compute_copy_image if DCC decompression happens before a copy

The buffer clear after DCC decompression overwrote user SGPRs that we set
here, leading to invalid image coordinates. Set them after we bind images.

This will actually be fixed by "radeonsi: don't decompress DCC for float
formats in si_compute_copy_image" as well.

Fixes: ad71ef9326f "radeonsi: don't use a constant buffer for the copy_image compute shader"
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4583

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10061>

3 years agozink: drop VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT from compute path
Mike Blumenkrantz [Tue, 6 Apr 2021 17:22:15 +0000 (13:22 -0400)]
zink: drop VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT from compute path

this was dropped a while ago from gfx but I failed to pick it up for compute

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10062>

3 years agomesa: Remove unused gl_config::mutableRenderBuffer
Adam Jackson [Mon, 5 Apr 2021 20:12:29 +0000 (16:12 -0400)]
mesa: Remove unused gl_config::mutableRenderBuffer

This bit is only meaningful for EGL, where we in fact derive it from
whether EGL_KHR_mutable_render_buffer is enabled and don't actually look
at the DRI attribute.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10045>

3 years agomesa: Make _mesa_initialize_visual return void
Adam Jackson [Mon, 22 Mar 2021 22:21:12 +0000 (18:21 -0400)]
mesa: Make _mesa_initialize_visual return void

The assertions here clearly never get hit, and if they did it'd mean we
were _trying_ to enable 64-bit Z or something. And checking only that
the accumulation has non-negative size is... curious. Just delete it and
clean up the callers.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10045>

3 years agomesa: Remove unused _mesa_create_framebuffer
Adam Jackson [Mon, 22 Mar 2021 22:20:16 +0000 (18:20 -0400)]
mesa: Remove unused _mesa_create_framebuffer

One fewer gl_config in the API.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10045>

3 years agoradeon: Exchange one curious idiom for another in radeonMakeCurrent
Adam Jackson [Mon, 22 Mar 2021 22:15:48 +0000 (18:15 -0400)]
radeon: Exchange one curious idiom for another in radeonMakeCurrent

radeonMakeCurrent is the only consumer of _mesa_create_framebuffer(),
and all we're doing here is making a dummy for the context to hang on to
when there is no current drawable. intelMakeCurrent uses
_mesa_get_incomplete_framebuffer() for this instead, which is
equivalent, and which matches the usage elsewhere in the tree.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10045>

3 years agogallium: Remove curious st_visual::no_config
Adam Jackson [Wed, 24 Mar 2021 18:24:10 +0000 (14:24 -0400)]
gallium: Remove curious st_visual::no_config

The gallium context creation API embeds storage for a whole st_visual
even if the context is to have no config. no_config was being used to
signal this, but we can just as easily check that the color format is
non-NONE.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10045>

3 years agozink: flag DYNAMIC resources as coherent
Mike Blumenkrantz [Tue, 9 Feb 2021 19:11:12 +0000 (14:11 -0500)]
zink: flag DYNAMIC resources as coherent

the contents of these may change frequently, so we should skip all the
flush/invalidate

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9983>

3 years agozink: don't use cached mem for staging resources
Mike Blumenkrantz [Thu, 28 Jan 2021 21:00:18 +0000 (16:00 -0500)]
zink: don't use cached mem for staging resources

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9983>

3 years agoradv: fix format feature reporting for modifiers
Simon Ser [Thu, 1 Apr 2021 15:06:31 +0000 (17:06 +0200)]
radv: fix format feature reporting for modifiers

The format_feature_flags bitfield is derived from the modifier if
the tiling is set to VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT.
However radv will reset the tiling to either LINEAR or OPTIMAL if
the caller supplied a VkPhysicalDeviceImageDrmFormatModifierInfoEXT
in the chain.

Stop resetting the tiling, so that we can compute the correct feature
flags.

Signed-off-by: Simon Ser <contact@emersion.fr>
Fixes: 6c83e3ea98b7 ("radv: Add format modifier format queries.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9978>

3 years agonir/lower_tex: handle deref casts
Rhys Perry [Mon, 5 Apr 2021 13:56:46 +0000 (14:56 +0100)]
nir/lower_tex: handle deref casts

A RDR2 shader has a undef->texture cast which is eventually optimized out.
Without handling NULL from nir_deref_instr_get_variable(), compiling this
shader will result in a crash.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Fixes: bc438c91d9b ("nir/lower_tex: ignore texture_index if tex_instr has deref src")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10038>