platform/upstream/mesa.git
3 years agoci/a3xx: Run all of GLES3 dEQP.
Eric Anholt [Fri, 26 Feb 2021 20:55:49 +0000 (12:55 -0800)]
ci/a3xx: Run all of GLES3 dEQP.

We're not spending half our time booting any more, so run the other half.

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

3 years agoci/a5xx: Run all of gles2 in one job.
Eric Anholt [Fri, 26 Feb 2021 20:24:50 +0000 (12:24 -0800)]
ci/a5xx: Run all of gles2 in one job.

Now that we're not spending so much time on boot overhead, no need to
parallelize.

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

3 years agoci/freedreno: Switch the fastboot boards to using nfsroot.
Eric Anholt [Fri, 26 Feb 2021 18:24:31 +0000 (10:24 -0800)]
ci/freedreno: Switch the fastboot boards to using nfsroot.

This saves time in packing the rootfs, allows for larger rootfses, and
avoids the need for webdav.

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

3 years agoci/freedreno: Also retest when only CI configuration changes.
Eric Anholt [Fri, 26 Feb 2021 20:47:44 +0000 (12:47 -0800)]
ci/freedreno: Also retest when only CI configuration changes.

Fixes: dab845d457eb ("ci: Move specific driver testing to separate files in separate dirs.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9314>

3 years agotgsi_exec: Jump over entirely non-taken THEN or ELSE branches.
Eric Anholt [Mon, 1 Mar 2021 20:23:56 +0000 (12:23 -0800)]
tgsi_exec: Jump over entirely non-taken THEN or ELSE branches.

TGSI has these nice labels for us for where to jump in this case, let's
use them.  Improves piglit arb_shader_image_load_store-shader-mem-barrier
runtime massively, though not enough to make the test really reasonable to
run.

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

3 years agotgsi_exec: Roll the loops for condmask handling.
Eric Anholt [Mon, 1 Mar 2021 20:19:48 +0000 (12:19 -0800)]
tgsi_exec: Roll the loops for condmask handling.

No need to hand-unroll this, the compiler will do it.

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

3 years agoi965: support GL_EXT_color_buffer_half_float
Ilia Mirkin [Tue, 2 Mar 2021 21:05:59 +0000 (16:05 -0500)]
i965: support GL_EXT_color_buffer_half_float

FP16 rendering is supported on all gen4 hardware.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9379>

3 years agoci: Use lock file to build deqp-runner
Antonio Caggiano [Tue, 2 Mar 2021 15:01:05 +0000 (16:01 +0100)]
ci: Use lock file to build deqp-runner

Build deqp-runner with the `--locked` option to use dependencies
versions specified in `Cargo.lock`.

v2: Bump image tags.

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Suggested-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9368>

3 years agoac/llvm: open code fpow on LLVM 12 using fmul.legacy
Marek Olšák [Fri, 12 Feb 2021 06:06:18 +0000 (01:06 -0500)]
ac/llvm: open code fpow on LLVM 12 using fmul.legacy

A quick look at the asm shows that this enables source modifiers
(neg, abs) for v_mul_legacy_f32.

Totals from affected shaders:
SGPRS: 110104 -> 110400 (0.27 %)
VGPRS: 57632 -> 57636 (0.01 %)
Spilled SGPRs: 66 -> 63 (-4.55 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 3290412 -> 3283068 (-0.22 %) bytes
Max Waves: 32141 -> 32141 (0.00 %)

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

3 years agoac/llvm: add type parameter into ac_build_buffer_load to fix 16-bit TES inputs
Marek Olšák [Mon, 15 Feb 2021 06:25:25 +0000 (01:25 -0500)]
ac/llvm: add type parameter into ac_build_buffer_load to fix 16-bit TES inputs

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

3 years agoac/llvm: fix visit_load_ubo_buffer to use SMEM for 16 bits instead of VMEM
Marek Olšák [Fri, 12 Feb 2021 08:54:19 +0000 (03:54 -0500)]
ac/llvm: fix visit_load_ubo_buffer to use SMEM for 16 bits instead of VMEM

This has 3 advantages:
- It's SMEM.
- Multiple single component loads are merged into 1 multi-dword load by LLVM.
- The result is always packed for packed instructions.

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

3 years agoac/llvm: implement 16-bit and 64-bit fpow correctly
Marek Olšák [Fri, 12 Feb 2021 06:05:19 +0000 (01:05 -0500)]
ac/llvm: implement 16-bit and 64-bit fpow correctly

LLVM converts to 32 bits and back for llvm.pow, so we can't use it.

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

3 years agoac/llvm: add support for 16-bit source operands for samplers
Marek Olšák [Thu, 11 Feb 2021 08:22:00 +0000 (03:22 -0500)]
ac/llvm: add support for 16-bit source operands for samplers

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

3 years agonir/search: Constify instruction parameter to search helpers
Ian Romanick [Tue, 12 May 2020 19:48:17 +0000 (12:48 -0700)]
nir/search: Constify instruction parameter to search helpers

The search helps must *never* modify the instruction passed in, so let
the compiler enforce this.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9378>

3 years agoanv: fix missing general state pool in validation list
Lionel Landwerlin [Wed, 3 Mar 2021 13:21:55 +0000 (15:21 +0200)]
anv: fix missing general state pool in validation list

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 83fee30e85965c ("anv: allow multiple command buffers in anv_queue_submit")
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9388>

3 years agoci/lava: Move the driver expectation files to the per-driver CI dir.
Eric Anholt [Mon, 1 Mar 2021 20:53:37 +0000 (12:53 -0800)]
ci/lava: Move the driver expectation files to the per-driver CI dir.

This will cause less retesting of other drivers when changing the dEQP
results for a driver.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9353>

3 years agoci/lava: Move the per-driver gitlab-ci.yml to each driver.
Eric Anholt [Mon, 1 Mar 2021 20:50:51 +0000 (12:50 -0800)]
ci/lava: Move the per-driver gitlab-ci.yml to each driver.

Follow-up to !9139, will cause less testing of other drivers when changing
the CI configuration for a single driver.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9353>

3 years agoci: Move deqp-default-skips.txt back to .gitlab-ci/
Eric Anholt [Mon, 1 Mar 2021 20:57:30 +0000 (12:57 -0800)]
ci: Move deqp-default-skips.txt back to .gitlab-ci/

Since we don't manually enumerate the drivers using it, we have to retest
all drivers when changing it (which basically never happens, anyway).

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9353>

3 years agoradv: fix RGP barrier layout transition for TC-compatible CMASK images
Samuel Pitoiset [Wed, 3 Mar 2021 16:11:15 +0000 (17:11 +0100)]
radv: fix RGP barrier layout transition for TC-compatible CMASK images

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

3 years agozink: Enable GL_EXT_depth_bounds_test
Adam Jackson [Tue, 2 Mar 2021 17:28:04 +0000 (12:28 -0500)]
zink: Enable GL_EXT_depth_bounds_test

Available since Vulkan 1.0, and in fact already wired up, just not
advertised. It looks like we could make this dynamic state but this
works for now.

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

3 years agoradv: don't shrink image stores for The Surge 2
Rhys Perry [Tue, 23 Feb 2021 19:33:02 +0000 (19:33 +0000)]
radv: don't shrink image stores for The Surge 2

The game seems to declare the wrong format.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: e4d75c22 ("nir/opt_shrink_vectors: shrink image stores using the format")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4347
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9229>

3 years agonir/opt_shrink_vectors: add option to skip shrinking image stores
Rhys Perry [Tue, 23 Feb 2021 19:31:48 +0000 (19:31 +0000)]
nir/opt_shrink_vectors: add option to skip shrinking image stores

Some games declare the wrong format, so we might want to disable this
optimization in that case.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: e4d75c22 ("nir/opt_shrink_vectors: shrink image stores using the format")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9229>

3 years agoturnip: fix leak of tu_shader object during compute pipeline creation
Danylo Piliaiev [Tue, 2 Mar 2021 10:00:58 +0000 (12:00 +0200)]
turnip: fix leak of tu_shader object during compute pipeline creation

tu_shader should be freed after pipeline is successfully created.

Fixes tests:
 dEQP-VK.api.object_management.alloc_callback_fail.compute_pipeline
 dEQP-VK.api.object_management.alloc_callback_fail_multiple.compute_pipeline

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9364>

3 years agoradv: bump the initial SQTT buffer size to 32MB per SE
Samuel Pitoiset [Tue, 2 Mar 2021 14:33:36 +0000 (15:33 +0100)]
radv: bump the initial SQTT buffer size to 32MB per SE

Most of the games need 32MB or more, but rarely less.

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

3 years agoradv: trigger a new SQTT capture automatically after resizing the buffer
Samuel Pitoiset [Tue, 2 Mar 2021 14:29:25 +0000 (15:29 +0100)]
radv: trigger a new SQTT capture automatically after resizing the buffer

It's way better.

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

3 years agoradv: double the SQTT buffer size when it is resized
Samuel Pitoiset [Tue, 2 Mar 2021 14:14:50 +0000 (15:14 +0100)]
radv: double the SQTT buffer size when it is resized

Computing the expected buffer size isn't reliable on GFX10+ because
DROPPED_CNTR returns weird results.

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

3 years agoac/sqtt: fix determining if the trace is complete on GFX10+
Samuel Pitoiset [Tue, 2 Mar 2021 14:13:24 +0000 (15:13 +0100)]
ac/sqtt: fix determining if the trace is complete on GFX10+

DROPPED_CNTR isn't reliable and might still report non-zero if the
SQTT buffer isn't full. Checking if the number of written bytes by
the hw is equal to the SQTT buffer size seems reliable.

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

3 years agoradv: do not trace inactive shader engines with SQTT
Samuel Pitoiset [Tue, 2 Mar 2021 15:42:39 +0000 (16:42 +0100)]
radv: do not trace inactive shader engines with SQTT

This fixes a GPU hang on my Sienna because the number of SE is
less than the maximum, and SE #1 is disabled.

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

3 years agozink: ci updates
Mike Blumenkrantz [Wed, 3 Mar 2021 01:21:00 +0000 (20:21 -0500)]
zink: ci updates

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

3 years agozink: use staging resource for write transfer_map in order to not stall
Mike Blumenkrantz [Wed, 9 Sep 2020 20:08:54 +0000 (16:08 -0400)]
zink: use staging resource for write transfer_map in order to not stall

we can just give the user a staging resource and then flush the data back
later

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

3 years agoradeonsi: don't crash on NULL images in si_check_needs_implicit_sync
Marek Olšák [Tue, 2 Mar 2021 07:33:36 +0000 (02:33 -0500)]
radeonsi: don't crash on NULL images in si_check_needs_implicit_sync

This fixes CTS test: KHR-GL46.arrays_of_arrays_gl.AtomicUsage

Fixes: bddc0e023c "radeonsi: fix read from compute / write from draw sync"

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

3 years agoac/llvm: fix ac_build_atomic_rmw with LLVM 13
Marek Olšák [Tue, 2 Mar 2021 07:59:23 +0000 (02:59 -0500)]
ac/llvm: fix ac_build_atomic_rmw with LLVM 13

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4383

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

3 years agonir/vec_to_movs: Don't generate MOVs for undef channels.
Eric Anholt [Mon, 1 Mar 2021 19:57:19 +0000 (11:57 -0800)]
nir/vec_to_movs: Don't generate MOVs for undef channels.

This appeared in softpipe's image operations, since NIR always uses
4-component values for the coords, while the GLSL IR only has 2 components
for a 2D image (for example).
arb_shader_image_load_store-shader-mem-barrier (which times out in CI and
spends its time inside of tgsi_exec) was spending 4/51 of its instructions
on moving these undefs around.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9345>

3 years agonir: Add a nir_src_is_undef() helper, like nir_src_is_const().
Eric Anholt [Mon, 1 Mar 2021 23:04:25 +0000 (15:04 -0800)]
nir: Add a nir_src_is_undef() helper, like nir_src_is_const().

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9345>

3 years agozink: export PIPE_CAP_TGSI_VS_LAYER_VIEWPORT
Mike Blumenkrantz [Mon, 14 Dec 2020 16:41:26 +0000 (11:41 -0500)]
zink: export PIPE_CAP_TGSI_VS_LAYER_VIEWPORT

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

3 years agozink: enable PIPE_CAP_CLEAR_SCISSORED
Mike Blumenkrantz [Wed, 14 Oct 2020 13:10:17 +0000 (09:10 -0400)]
zink: enable PIPE_CAP_CLEAR_SCISSORED

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

3 years agolavapipe: sort bindings before creating descriptor set
Dave Airlie [Tue, 2 Mar 2021 20:50:00 +0000 (06:50 +1000)]
lavapipe: sort bindings before creating descriptor set

This ensures the dynamic offsets are correct

Fixes: b38879f8c5f5 ("vallium: initial import of the vulkan frontend")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9359>

3 years agolavapipe: reorder descriptor set stages to get correct binding
Dave Airlie [Tue, 2 Mar 2021 04:30:30 +0000 (14:30 +1000)]
lavapipe: reorder descriptor set stages to get correct binding

The fragment stage was in the wrong place here.

Fixes: b38879f8c5f5 ("vallium: initial import of the vulkan frontend")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9359>

3 years agogallium/dri: Remove dri2_format_mapping::cpp
Ian Romanick [Mon, 1 Mar 2021 23:11:31 +0000 (15:11 -0800)]
gallium/dri: Remove dri2_format_mapping::cpp

I was suspicious that some entries in dri2_format_table (in
dri_helpers.c) had this field set incorrectly.  It seemed like
DRM_FORMAT_ABGR16161616F and DRM_FORMAT_XBGR16161616F should have been 8
instead of 4.  Upon digging I found that nothing uses the field.  Fix
code by removing it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9354>

3 years agoclover: Add missing include for llvm-12 build fix
Karol Herbst [Tue, 2 Mar 2021 19:09:39 +0000 (20:09 +0100)]
clover: Add missing include for llvm-12 build fix

Fixes: d1eab2b1eb1 ("clover: Fix build with llvm-12.")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9372>

3 years agozink: apply only the pending zs clear bits during deferred clears
Mike Blumenkrantz [Tue, 2 Mar 2021 14:22:18 +0000 (09:22 -0500)]
zink: apply only the pending zs clear bits during deferred clears

both bits will have been flagged at this point in order to indicate
that the aspects will be cleared "at some point" during the loop, but
when actually iterating through the pending clears, only the bits set
in the clear call should be applied

Fixes: 5c629e9ff24 ("zink: defer pipe_context::clear calls when not currently in a renderpass")

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

3 years agost/nine: Simplify checks for driconf options
Axel Davy [Sun, 7 Feb 2021 19:28:34 +0000 (20:28 +0100)]
st/nine: Simplify checks for driconf options

Remove the useless driCheckOption calls. They always
succeed.

As a result the intended behaviour for thread_submit
was not working (different default depending on the gpu
used). Add a comment to fix that in the future.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>

3 years agodriconf: Rename csmt_int back to csmt_force
Axel Davy [Sun, 7 Feb 2021 19:01:57 +0000 (20:01 +0100)]
driconf: Rename csmt_int back to csmt_force

Fixes regression introduced by
<https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6916>

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>

3 years agost/nine: Fix leak at device destruction
Axel Davy [Mon, 8 Feb 2021 22:33:29 +0000 (23:33 +0100)]
st/nine: Fix leak at device destruction

At the release of the last object holding a reference
on the device, the device dtor was executed and
the objector dtor was ignored.

The proper way is to execute the object dtor, then
the device dtor.

The previous code was likely for a workaround against
something that was fixed since.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>

3 years agost/nine: Protect *PrivateData also for Volumes
Axel Davy [Wed, 3 Feb 2021 22:12:12 +0000 (23:12 +0100)]
st/nine: Protect *PrivateData also for Volumes

*PrivateData functions were not protected by
a mutex for Volumes whereas they definitely
should.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>

3 years agost/nine: Refactor ht_guid_delete
Axel Davy [Sun, 31 Jan 2021 19:04:40 +0000 (20:04 +0100)]
st/nine: Refactor ht_guid_delete

Have ht_guid_delete take a hash_entry.

As a result, we can use _mesa_hash_table_remove instead of
_mesa_hash_table_remove_key.
The previous code using the latter was incorrect as the key
of the entry was read after it was freed.

Fixes: https://github.com/iXit/wine-nine-standalone/issues/40

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>

3 years agost/nine: Add new debug and error checks
Axel Davy [Thu, 21 May 2020 14:55:19 +0000 (16:55 +0200)]
st/nine: Add new debug and error checks

Add new debug messages and error checks

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>

3 years agost/nine: Enable DF24 support
Axel Davy [Sat, 26 Jan 2019 20:24:05 +0000 (21:24 +0100)]
st/nine: Enable DF24 support

We can enable it, now that FETCH4 is
implemented.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>

3 years agost/nine: Implement experimental FETCH4
Axel Davy [Sun, 13 Jan 2019 21:44:51 +0000 (22:44 +0100)]
st/nine: Implement experimental FETCH4

FETCH4 is a feature that needs to be implemented
to advertise D3DFMT_DF24.
It's basically a variant of Gather4.

This first implementation will need to be completed
to implement the feature fully, but the feature
doesn't seem to be much used (other equivalent
features are preferred by games).

Note until DF24 is advertised, apps are not supposed to use
FETCH4.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>

3 years agost/nine: Track formats compatible with FETCH4
Axel Davy [Sat, 2 Feb 2019 18:20:35 +0000 (19:20 +0100)]
st/nine: Track formats compatible with FETCH4

FETCH4 is a d3d9 extension not much used, as newer
ones were prefered. However it's support is required
to advertise the DF24 format.

Prepares support by tracking compatible formats.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>

3 years agost/nine: Unmap buffers after full unlock
Axel Davy [Sun, 20 Dec 2020 18:37:13 +0000 (19:37 +0100)]
st/nine: Unmap buffers after full unlock

Do not unmap anything until all buffer unlocks
were received.

A buffer can be filled in several threads, and thus
in the case of double locks, it's not possible to know
which unlock is received first.
Thus only unmap the buffers when the last unlock is
received.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>

3 years agost/nine: Clamp GetAvailableTextureMem
Axel Davy [Sun, 17 Jan 2021 17:20:03 +0000 (18:20 +0100)]
st/nine: Clamp GetAvailableTextureMem

Previously we used to clamp "available_texture_limit",
which was incorrect. "available_texture_mem" should
have been clamped instead.
The resulting code was noop.

The idea behind that code was that 32 bits executable
would see maximum 4GB video memory.

However it seems according to users that 32 bits apps
should be able to allocate more than 4GB, thus the
clamping is inappropriate.

Instead clamp the return of GetAvailableTextureMem, to
correctly report a high value when there is more than
4GB available.

I do not know what should exactly be the clamp value,
for now have a 64MB margin below UINT_MAX.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>

3 years agost/nine: Do not allow depth buffer render targets
Axel Davy [Tue, 4 Aug 2020 20:09:56 +0000 (22:09 +0200)]
st/nine: Do not allow depth buffer render targets

Without the proposed check, some apps will decide to use depth buffers
as render targets.

Bug found investigating:
https://github.com/iXit/wine-nine-standalone/issues/82

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>

3 years agost/nine: Reduce system memory allocated by D3DUSAGE_AUTOGENMIPMAP
Axel Davy [Thu, 21 May 2020 15:51:55 +0000 (17:51 +0200)]
st/nine: Reduce system memory allocated by D3DUSAGE_AUTOGENMIPMAP

For D3DUSAGE_AUTOGENMIPMAP basically, everything behaves
for the application as if the texture had one level.
However the pipe_resource has more levels, and those
get generated automatically.

Previously we did allocate all the Surfaces as if
the texture had all the levels, except of just one.
The app could still just access the first level.

This patch completly removes the useless unaccessible
Surfaces.
In addition removes redundant handling of D3DUSAGE_AUTOGENMIPMAP.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>

3 years agor600/sfn: Update status
Gert Wollny [Fri, 26 Feb 2021 21:15:15 +0000 (22:15 +0100)]
r600/sfn: Update status

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>

3 years agor600: Enable GLSL 450 for nir shaders.
Gert Wollny [Fri, 26 Feb 2021 15:15:31 +0000 (16:15 +0100)]
r600: Enable GLSL 450 for nir shaders.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>

3 years agor600: Don't optimize using source modifiers on literals
Gert Wollny [Sun, 28 Feb 2021 21:52:58 +0000 (22:52 +0100)]
r600: Don't optimize using source modifiers on literals

The code improvement is limited and it interferes with using literals
directly in LDS index ops, since here source modifiers are not
supported, but the current assembler code might inject the modifiers.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>

3 years agor600/sfn: Fix loading TES gl_PatchVerticesIn
Gert Wollny [Sun, 28 Feb 2021 20:41:28 +0000 (21:41 +0100)]
r600/sfn: Fix loading TES gl_PatchVerticesIn

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>

3 years agor600/sfn: handle querying the number of layers in cube arrays
Gert Wollny [Sun, 28 Feb 2021 19:15:56 +0000 (20:15 +0100)]
r600/sfn: handle querying the number of layers in cube arrays

This has to be loaded from a constant buffer instead of the actual
texture.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>

3 years agonir: disaallow reordering for r600 shared load and remove component field
Gert Wollny [Sun, 28 Feb 2021 18:03:55 +0000 (19:03 +0100)]
nir: disaallow reordering for r600 shared load and remove component field

The original shared load op can't be reordered, so it might be better to
also not allow this for the lowered variant.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>

3 years agor600/sfn: encode component in address for local IO
Gert Wollny [Sun, 28 Feb 2021 18:02:08 +0000 (19:02 +0100)]
r600/sfn: encode component in address for local IO

The backend code was actually assuming this, but the lowering still set
the components and write masks like it would be honoured.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>

3 years agor600/sfn: remove some old debug output
Gert Wollny [Fri, 26 Feb 2021 20:24:18 +0000 (21:24 +0100)]
r600/sfn: remove some old debug output

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>

3 years agor600/sfn: remove unused emit_alu_op2_split_src_mods
Gert Wollny [Fri, 26 Feb 2021 20:24:01 +0000 (21:24 +0100)]
r600/sfn: remove unused emit_alu_op2_split_src_mods

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>

3 years agor600/sfn: remove code for nir_op_fsign since it is lowered
Gert Wollny [Fri, 26 Feb 2021 20:23:39 +0000 (21:23 +0100)]
r600/sfn: remove code for nir_op_fsign since it is lowered

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>

3 years agor600: unify nir shader options evaluation
Gert Wollny [Fri, 26 Feb 2021 20:11:44 +0000 (21:11 +0100)]
r600: unify nir shader options evaluation

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>

3 years agor600/sfn: Allow any channel for the helper invocation evaluation
Gert Wollny [Fri, 26 Feb 2021 17:44:13 +0000 (18:44 +0100)]
r600/sfn: Allow any channel for the helper invocation evaluation

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>

3 years agor600/sfn: lower isign and iabs in nir
Gert Wollny [Fri, 26 Feb 2021 17:42:52 +0000 (18:42 +0100)]
r600/sfn: lower isign and iabs in nir

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>

3 years agor600/sfn: set info about using helper_invocation to skip sb
Gert Wollny [Fri, 26 Feb 2021 15:33:41 +0000 (16:33 +0100)]
r600/sfn: set info about using helper_invocation to skip sb

sb can't handle helper invocations, so skip sb when it is used.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>

3 years agor600/sfn: Lower FS inputs to temps late and, and lower interpolate at
Gert Wollny [Fri, 26 Feb 2021 15:14:52 +0000 (16:14 +0100)]
r600/sfn: Lower FS inputs to temps late and, and lower interpolate at

This fixes FS shaders where a var is loaded with two different
interpolators.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>

3 years agoutil: Always use timespec_get on Windows.
Jose Fonseca [Wed, 24 Feb 2021 20:02:34 +0000 (20:02 +0000)]
util: Always use timespec_get on Windows.

include/c11/threads_win32.h provides a fallback implementation of
timespec_get when necessary.

Fixes https://gitlab.freedesktop.org/mesa/mesa/-/issues/4109

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

3 years agoaco: add missing usable_read2 check
Rhys Perry [Fri, 26 Feb 2021 16:05:40 +0000 (16:05 +0000)]
aco: add missing usable_read2 check

A Hitman 2 shader does: read64(local_invocation_index() * 4 - 4). This was
likely emitting a ds_read2_b32 on GFX6. For local_invocation_index()=0,
because the first dword was out-of-bounds, the second was likely also
considered out-of-bounds (even though it's not, at offset 0).

Likely fixes https://gitlab.freedesktop.org/mesa/mesa/-/issues/3882

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 57e6886f981 ("aco: refactor load_lds to use new helpers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9332>

3 years agoRevert "radv,aco: allow unaligned LDS access on GFX9+"
Rhys Perry [Mon, 1 Mar 2021 10:43:01 +0000 (10:43 +0000)]
Revert "radv,aco: allow unaligned LDS access on GFX9+"

This reverts commit 1a0b0e8460c1881f94975b3dfbe9c312d9c3fcf7.

The bounds checking behaviour of ds_read_b64, ds_read_b96 and ds_read_b128
make this feature very difficult to use safely.

This fixes a blocking artifact in Hitman 2. Previously, it contained:
ds_read_b64(local_invocation_index() * 4 - 4)
For local_invocation_index()=0, the second dword would be considered
out-of-bounds, even though it's at offset 0.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9332>

3 years agobroadcom/compiler: ldvary pipelining tracking and documentation clean-ups
Iago Toral Quiroga [Tue, 2 Mar 2021 08:35:30 +0000 (09:35 +0100)]
broadcom/compiler: ldvary pipelining tracking and documentation clean-ups

Now that we can pipeline all varyings we should not be referring
specifically to smooth varyings anywhere.

Also, rename the instruction field 'ldvary_pipelining' to
'is_ldvary_sequence', which is more appropriate, since we always
set this for any instruction involved with varying setups,
independently of whether they end up being pipelined or not.

This also does some other minor edits which intend to slightly
simplify the code and make it a bit more compact.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9363>

3 years agoglsl/float64: Bump #version to 400
Kenneth Graunke [Mon, 1 Mar 2021 21:56:35 +0000 (13:56 -0800)]
glsl/float64: Bump #version to 400

An earlier commit tried to make this shader compatible with GLSL 3.30,
but it requires, GL_ARB_gpu_shader_int64, which requires GLSL 4.00 and
GL 4.0 according to the extension spec.  So we were failing to enable
the required extension, breaking compilation of this shader.

The original intention of that patch was to get this working on zink,
which at the time only supported GL 3.3.  But now it supports later
OpenGL versions, so we don't need to do this any longer.  Rather than
revert the patch and raise the version all the way back to 430, just
bump it to the require 400 at Ian Romanick's suggestion.

Fixes: 4d47b22bf00 ("glsl/float64: make this compatible with glsl 330")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3991
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9351>

3 years agoclover: Fix build with llvm-12.
Karol Herbst [Wed, 24 Feb 2021 11:44:41 +0000 (12:44 +0100)]
clover: Fix build with llvm-12.

Fix build error after LLVM commit c495dfe0268b ("[clang][cli] NFC:
Decrease the scope of ParseLangArgs parameters").

../src/gallium/frontends/clover/llvm/invocation.cpp: In function ‘std::unique_ptr<clang::CompilerInstance> {anonymous}::create_compiler_instance(const clover::device&, const string&, const std::vector<std::__cxx11::basic_string<char> >&, std::string&)’:
../src/gallium/frontends/clover/llvm/invocation.cpp:252:55: error: cannot convert ‘clang::PreprocessorOptions’ to ‘std::vector<std::__cxx11::basic_string<char> >&’
  252 |                                 c->getPreprocessorOpts(),
      |                                 ~~~~~~~~~~~~~~~~~~~~~~^~
      |                                                       |
      |                                                       clang::PreprocessorOptions

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4114
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8543>

3 years agobroadcom/compiler: allow pipelining of flat and noperspective varyings
Iago Toral Quiroga [Mon, 1 Mar 2021 08:18:39 +0000 (09:18 +0100)]
broadcom/compiler: allow pipelining of flat and noperspective varyings

These end up having a NOP between the ldvary and the next instruction
in the sequence (a MOV for flat and an FADD for noperspetive):

nop                  ; nop               ; ldvary.r0
nop                  ; nop
fadd  rf6, r0, r5    ; nop               ; ldvary.r1
nop                  ; nop
fadd  rf5, r1, r5    ; nop               ; ldvary.r2
nop                  ; nop
fadd  rf4, r2, r5    ; nop               ; ldvary.r3

To pipeline these, we can reuse the same infrastructure we have in
place for smooth varyings but we need to avoid breaking the sequence
due to the NOP instruction. We do that by testing if dropping the
sequence when we failed to pick up the next instruction also fails
to choose an instruction.

This is not perfect, because we may be able to choose an instruction
outside the sequence such as an ldunif, and use that to break a
sequence that we could otherwise continue after scheduling the NOP
instruction, but it is still better than nothing.

total instructions in shared programs: 13820690 -> 13819774 (<.01%)
instructions in affected programs: 64026 -> 63110 (-1.43%)
helped: 479
HURT: 62
Instructions are helped.

total max-temps in shared programs: 2326435 -> 2326423 (<.01%)
max-temps in affected programs: 102 -> 90 (-11.76%)
helped: 7
HURT: 0
Max-temps are helped.

total sfu-stalls in shared programs: 30683 -> 30710 (0.09%)
sfu-stalls in affected programs: 13 -> 40 (207.69%)
helped: 2
HURT: 24
Sfu-stalls are HURT.

total inst-and-stalls in shared programs: 13851373 -> 13850484 (<.01%)
inst-and-stalls in affected programs: 62818 -> 61929 (-1.42%)
helped: 466
HURT: 65
Inst-and-stalls are helped.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9304>

3 years agobroadcom/compiler: pipeline smooth ldvary sequences
Iago Toral Quiroga [Fri, 26 Feb 2021 11:31:52 +0000 (12:31 +0100)]
broadcom/compiler: pipeline smooth ldvary sequences

Typically, we would schedule smooth varyings like this:

nop                  ; nop               ; ldvary.r4
nop                  ; fmul  r0, r4, rf0
fadd  rf13, r0, r5   ; nop               ; ldvary.r1
nop                  ; fmul  r2, r1, rf0
fadd  rf12, r2, r5   ; nop               ; ldvary.r3
nop                  ; fmul  r4, r3, rf0
fadd  rf11, r4, r5   ; nop               ; ldvary.r0

where we pair up an ldvary with the fadd of the previous sequence
instead of the previous fmul. This is because ldvary has an implicit
write to r5 which is read by the fadd of the previous sequence, so
our dependency tracking doesn't allow us to move the ldvary before the
fadd, however, the r5 write of the ldvary instruction happens in the
instruction after it is emitted so we can actually move it to the fmul
and the r5 write would still happen in the same instruction as the fadd,
which is fine.

This patch allows us to pipeline these sequences optimally. For that,
after merging an ldvary into a previous instruction in the middle of
a pipelineable ldvary sequence, we check if we can manually move it
to the last scheduled instruction instead (the one before the
instruction we are currently scheduling).

If we are successful at moving the ldvary to the previous instruction,
then we flag the ldvary as scheduled immediately, which may promote
its children (the follow-up fmul instruction for that ldvary) to DAG
heads and continue the merge loop so that fmul can be picked and
merged into the final fadd of the previous sequence (where we had
originally merged the ldvary). This leads to a result that looks like
this:

nop                  ; nop               ; ldvary.r4
nop                  ; fmul  r0, r4, rf0 ; ldvary.r1
fadd  rf13, r0, r5   ; fmul  r2, r1, rf0 ; ldvary.r3
fadd  rf12, r2, r5   ; fmul  r4, r3, rf0 ; ldvary.r0

Shader-db results:

total instructions in shared programs: 14071591 -> 13820690 (-1.78%)
instructions in affected programs: 7809692 -> 7558791 (-3.21%)
helped: 41209
HURT: 4528
Instructions are helped.

total max-temps in shared programs: 2335784 -> 2326435 (-0.40%)
max-temps in affected programs: 84302 -> 74953 (-11.09%)
helped: 4561
HURT: 293
Max-temps are helped.

total sfu-stalls in shared programs: 31537 -> 30683 (-2.71%)
sfu-stalls in affected programs: 3551 -> 2697 (-24.05%)
helped: 1713
HURT: 750
Sfu-stalls are helped.

total inst-and-stalls in shared programs: 14103128 -> 13851373 (-1.79%)
inst-and-stalls in affected programs: 7820726 -> 7568971 (-3.22%)
helped: 41411
HURT: 4535
Inst-and-stalls are helped.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9304>

3 years agobroadcom/compiler: track pipelineable ldvary sequences
Iago Toral Quiroga [Fri, 26 Feb 2021 11:23:12 +0000 (12:23 +0100)]
broadcom/compiler: track pipelineable ldvary sequences

If we have two (or more) smooth varyings like this:

nop t3; ldvary.rf0
fmul t5, t3, t0
fadd t6, t5, r5
nop t7; ldvary.rf0
fmul t9, t7, t0
fadd t10, t9, r5
nop t11; ldvary.rf0
fmul t13, t11, t0
fadd t14, t13, r5

We may be able to pipeline them like this:

nop                  ; nop               ; ldvary.r4
nop                  ; fmul  r0, r4, rf0 ; ldvary.r1
fadd  rf13, r0, r5   ; fmul  r2, r1, rf0 ; ldvary.r3
fadd  rf12, r2, r5   ; fmul  r4, r3, rf0 ; ldvary.r0

But in order to do this, we will need to manually tweak the
QPU scheduling.

This patch tracks information about ldvary sequences that are
good candidates for pipelining, and a follow-up patch will
use this information to pipeline them when we emit the QPU
code.

v2 (apinheiro):
  - Rename the v3d_compile fields to avoid confusion with the qinst fields.
  - Assert that a sequence's start instruction is not the same as the end.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9304>

3 years agobroadcom/compiler: fix indentation style
Iago Toral Quiroga [Fri, 26 Feb 2021 11:22:47 +0000 (12:22 +0100)]
broadcom/compiler: fix indentation style

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9304>

3 years agobroadcom/compiler: fix DAG pre-remove for merged instructions
Iago Toral Quiroga [Wed, 24 Feb 2021 10:22:16 +0000 (11:22 +0100)]
broadcom/compiler: fix DAG pre-remove for merged instructions

When selecting an instruction to merge, we want to pre-remove that
instruction from the DAG, not the one we are merging it in, which
we had already pre-removed right before.

The reason this was not causing problems before is that the
consequence of this bug is we will choose the same instruction
again in the merge loop and trying to merge that instruction twice
will fail and we would break out of the merge loop and move on.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9304>

3 years agoanv: toggle on sample shading if it is set in the shader
Tapani Pälli [Sun, 14 Feb 2021 15:49:35 +0000 (17:49 +0200)]
anv: toggle on sample shading if it is set in the shader

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4300
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9040>

3 years agointel: Use devinfo genx10 field
Jordan Justen [Sat, 27 Feb 2021 23:38:53 +0000 (15:38 -0800)]
intel: Use devinfo genx10 field

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9329>

3 years agointel/dev: Add devinfo genx10 field
Jordan Justen [Sat, 27 Feb 2021 23:09:56 +0000 (15:09 -0800)]
intel/dev: Add devinfo genx10 field

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9329>

3 years agointel: Use GEN_VERSIONx10 in more places
Jordan Justen [Sat, 27 Feb 2021 22:03:47 +0000 (14:03 -0800)]
intel: Use GEN_VERSIONx10 in more places

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9329>

3 years agoiris: fix in fences backend for ext_external_objects edge case
Eleni Maria Stea [Sun, 14 Feb 2021 18:28:02 +0000 (20:28 +0200)]
iris: fix in fences backend for ext_external_objects edge case

EXT_external_objects require we call glSignalSemaphoreEXT followed by a
glFlush. If the rendering workload is small when Signal and Flush
take place the relevant batch buffers with the actual rendering might
have been submitted already. In that case the following condition is met:
(iris_batch_bytes_used(batch) == 0). This causes:
glFlush() --> iris_fence_flush() -> iris_batch_flush() ->
_iris_batch_flush() to no-op, and so the fence doesn't get submitted to the
kernel. Then when anv tries to submit an execuf2 that must wait on the
shared VkSempahore / drm_syncobj fence, there isn't one and the kernel
rejects the batchbuffer causing an -EINVAL return of the execbuf2 ioctl
and a VK_DEVICE_LOST error. Empty batch buffers do have typically one
fence attached, but the ones carrying the extra fence from a
glSignalSempahore() call do have at least 2.

See also: the discussion in MR!4337.

v2: Changed the batch struct to have a contains_fence_signal variable
that is set to true when i915_EXEC_FENCE_SIGNAL fence is added to the
batch and off when batch is reset (Tapani Pälli)

Authored-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reported-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Signed-off-by: Eleni Maria Stea <elene.mst@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8861>

3 years agoutil/disk_cache: move cache tests to the util directory
Timothy Arceri [Mon, 1 Mar 2021 04:26:36 +0000 (15:26 +1100)]
util/disk_cache: move cache tests to the util directory

The cache has been detangled from glsl and used outside it (with Vulkan drivers)
for years now.

This also cleans up the dependancies in the build file. The test doesn't
depend on the glsl lib but rather the util lib.

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

3 years agolavapipe: VK_EXT_extended_dynamic_state support
Dave Airlie [Mon, 1 Mar 2021 05:52:07 +0000 (15:52 +1000)]
lavapipe: VK_EXT_extended_dynamic_state support

zink can use this in some paths, and it's not a crazy thing to support
for lavapipe.

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

3 years agoradeonsi: don't index si_context::shaders with enum gl_shader_stage
Marek Olšák [Fri, 26 Feb 2021 23:01:19 +0000 (18:01 -0500)]
radeonsi: don't index si_context::shaders with enum gl_shader_stage

Fixes: a8373b3d387 "radeonsi: store si_context::xxx_shader members in union"

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

3 years agolavapipe: Define supported extensions in C
Dave Airlie [Tue, 16 Feb 2021 04:17:20 +0000 (14:17 +1000)]
lavapipe: Define supported extensions in C

One less python generator, like anv/radv

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9075>

3 years agolavapipe: expose a 1.0 vulkan API for now.
Dave Airlie [Mon, 1 Mar 2021 03:08:46 +0000 (13:08 +1000)]
lavapipe: expose a 1.0 vulkan API for now.

lavapipe doesn't have all 1.1 features yet, just return
the baseline 1.0 API always.

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

3 years agozink/instance: work with vulkan 1.0 and later loader.
Dave Airlie [Mon, 1 Mar 2021 03:07:10 +0000 (13:07 +1000)]
zink/instance: work with vulkan 1.0 and later loader.

If zink is meant to work against Vulkan 1.0 API then it
should expose the 1.0 API as create time as well as always
ask for all the vulkan 1.0 extensions.

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9075>

3 years agomesa/st: even better no-oping for clears
Mike Blumenkrantz [Mon, 1 Mar 2021 21:57:35 +0000 (16:57 -0500)]
mesa/st: even better no-oping for clears

<imirkin> zmike: re 6a8c51dc5a4 -- couldn't minx be > maxx after the clamping? in nouveau i did >= for the bail condition

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9350>

3 years agozink: ci updates
Mike Blumenkrantz [Mon, 1 Mar 2021 22:11:15 +0000 (17:11 -0500)]
zink: ci updates

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

3 years agozink: handle GLSL_SAMPLER_DIM_EXTERNAL in ntv
Mike Blumenkrantz [Fri, 9 Oct 2020 21:32:59 +0000 (17:32 -0400)]
zink: handle GLSL_SAMPLER_DIM_EXTERNAL in ntv

this fixes most of the tests that use it

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

3 years agotnl: Call _mesa_matrix_analyse to make sure the inverse MVP is updated
Kenneth Graunke [Mon, 1 Mar 2021 19:55:42 +0000 (11:55 -0800)]
tnl: Call _mesa_matrix_analyse to make sure the inverse MVP is updated

A recent commit stopped updating the inverse MVP matrix, because usually
only GLSL built-ins need it.  However, TNL also needs it.  So make sure
it's correct when needed.

Fixes: 10371c520c1 ("mesa: don't compute the ModelView * Projection matrix if not used")
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9346>

3 years agoandroid: driconf: Generate a static table when no xmlconfig
Mauro Rossi [Thu, 25 Feb 2021 20:54:00 +0000 (21:54 +0100)]
android: driconf: Generate a static table when no xmlconfig

Fixes the following building error:

FAILED: out/target/product/x86_64/obj_x86/STATIC_LIBRARIES/libmesa_util_intermediates/xmlconfig.o
...
external/mesa/src/util/xmlconfig.c:1030:12: fatal error: 'driconf_static.h' file not found
           ^~~~~~~~~~~~~~~~~~
1 error generated.

Fixes: a6b0ceb ("driconf: Generate a static table when no xmlconfig")
Acked-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Marijn Suijten <marijn.suijten@somainline.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9294>

3 years agodriconf: avoid Non-ASCII character error in driconf_static.py
Mauro Rossi [Thu, 25 Feb 2021 20:55:31 +0000 (21:55 +0100)]
driconf: avoid Non-ASCII character error in driconf_static.py

MR to move to python3 in Android build gen rules is still pending

The change is to avoid following building error:

FAILED: out/target/product/x86_64/gen/STATIC_LIBRARIES/libmesa_util_intermediates/driconf_static.h
/bin/bash -c "/usr/bin/python external/mesa/src/util/driconf_static.py external/mesa/src/util/00-mesa-defaults.conf > out/target/product/x86_64/gen/STATIC_LIBRARIES/libmesa_util_intermediates/driconf_static.h"
  File "external/mesa/src/util/driconf_static.py", line 2
SyntaxError: Non-ASCII character '\xc2' in file external/mesa/src/util/driconf_static.py on line 2, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

Fixes: a6b0ceb ("driconf: Generate a static table when no xmlconfig")
Acked-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Marijn Suijten <marijn.suijten@somainline.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9294>

3 years agod3d12: Handle null constant buffers
Jesse Natalie [Mon, 1 Mar 2021 17:37:57 +0000 (09:37 -0800)]
d3d12: Handle null constant buffers

RuneScape ends up hitting this path, and it's easy enough to get
some well-defined behavior instead of a crash.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9342>

3 years agomesa/st: no-op scissored clear calls with size zero
Mike Blumenkrantz [Mon, 1 Mar 2021 19:53:50 +0000 (14:53 -0500)]
mesa/st: no-op scissored clear calls with size zero

Wx0 and 0xH should result in no-ops in the driver, so they can just
become no-ops before they reach the driver to save some validation later

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

3 years agomesa/st: clamp scissored clear regions to fb size
Mike Blumenkrantz [Mon, 1 Mar 2021 19:52:25 +0000 (14:52 -0500)]
mesa/st: clamp scissored clear regions to fb size

these should never be larger than the fb and drivers shouldn't have to
care about it

Fixes: 1c8bcad81a7 ("gallium: add pipe cap for scissored clears and pass scissor state to clear() hook")

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