Commit Graph

127914 Commits

Author SHA1 Message Date
Rhys Perry 0eaa5dfac0 aco: remove image parameter from get_sampler_desc()
We can just check whether tex_instr is NULL instead.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10036>
2021-04-20 17:42:21 +00:00
Rhys Perry 6a7b89c89d ac/nir: set TRUNC_COORD=0 for nir_texop_tg4
Fixes black squares in Assassin's Creed: Valhalla and rendering of
FidelityFX-CACAO demo.

shader-db (sienna cichlid):
Totals:
SGPRS: 2977068 -> 2977220 (0.01 %)
VGPRS: 1929624 -> 1929616 (-0.00 %)
Spilled SGPRs: 5769 -> 5769 (0.00 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 61423092 -> 61424672 (0.00 %) bytes
Max Waves: 895765 -> 895766 (0.00 %)

Totals from affected shaders:
SGPRS: 9520 -> 9672 (1.60 %)
VGPRS: 7464 -> 7456 (-0.11 %)
Spilled SGPRs: 0 -> 0 (0.00 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 527432 -> 529012 (0.30 %) bytes
Max Waves: 1819 -> 1820 (0.05 %)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Fixes: 58f25098a0 ("radv: Use TRUNC_COORD on samplers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10036>
2021-04-20 17:42:21 +00:00
Rhys Perry 3cbe9894f7 aco: set TRUNC_COORD=0 for nir_texop_tg4
Fixes black squares in Assassin's Creed: Valhalla and rendering of
FidelityFX-CACAO demo.

fossil-db (sienna cichlid):
Totals from 3052 (2.09% of 146267) affected shaders:
SpillSGPRs: 8437 -> 8646 (+2.48%)
CodeSize: 30993832 -> 31116916 (+0.40%); split: -0.00%, +0.40%
Instrs: 5869934 -> 5886783 (+0.29%); split: -0.00%, +0.29%
Latency: 250330521 -> 250463770 (+0.05%); split: -0.00%, +0.05%
InvThroughput: 59797617 -> 59814584 (+0.03%); split: -0.00%, +0.03%
VClause: 92114 -> 92132 (+0.02%)
SClause: 197373 -> 197338 (-0.02%); split: -0.02%, +0.01%
Copies: 479482 -> 482394 (+0.61%); split: -0.01%, +0.61%
Branches: 219629 -> 219635 (+0.00%)
PreSGPRs: 248970 -> 249366 (+0.16%)

fossil-db (polaris10):
Totals from 3050 (2.06% of 147787) affected shaders:
SGPRs: 282864 -> 282912 (+0.02%); split: -0.01%, +0.02%
VGPRs: 242572 -> 242612 (+0.02%)
SpillSGPRs: 10387 -> 10675 (+2.77%)
CodeSize: 31872460 -> 31996128 (+0.39%)
MaxWaves: 10924 -> 10925 (+0.01%)
Instrs: 6222217 -> 6239072 (+0.27%)
Latency: 317482545 -> 317773685 (+0.09%); split: -0.00%, +0.09%
InvThroughput: 156149624 -> 156242072 (+0.06%); split: -0.00%, +0.06%
VClause: 92295 -> 92254 (-0.04%); split: -0.05%, +0.01%
SClause: 243342 -> 243321 (-0.01%); split: -0.01%, +0.00%
Copies: 678902 -> 681700 (+0.41%); split: -0.00%, +0.41%
Branches: 219698 -> 219703 (+0.00%)
PreSGPRs: 244251 -> 244644 (+0.16%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fixes: 58f25098a0 ("radv: Use TRUNC_COORD on samplers")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3110
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10036>
2021-04-20 17:42:21 +00:00
Erik Faye-Lund 95d9d811c9 zink: do not require vulkan memory model for shader-images
The claim that we require vulkan memory model's MakeAvailable and
MakeVisible semantics for image writes isn't accurate. This would be
required *if* we were already using the Vulkan memory model.

But we're using the GLSL450 memory model in those cases, which has no
such requirements.

This means that any problems on RADV due to the lack of these semantics
are RADV bugs, and should be fixed in RADV instead.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10345>
2021-04-20 15:52:07 +00:00
Mike Blumenkrantz 874535752b zink: force scanout sync when mapping scanout resource
this is just for unit tests where the scanout object is redundant and
the only time a flush occurs is from stalling on readback

Fixes: 104603fa76 ("zink: create separate linear tiling image for scanout")

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10239>
2021-04-20 14:29:38 +00:00
Mike Blumenkrantz 2138aef7c9 zink: merge copy-to-scanout path into non-deferred flush path
this eliminates any desync between scanout presentation and clears

Fixes: 104603fa76 ("zink: create separate linear tiling image for scanout")

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10239>
2021-04-20 14:29:38 +00:00
Juan A. Suarez Romero 05cf1e7f36 iris: enable GL_EXT_memory_object feature
This is enabled by enabling gallium's memobj capability.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4337>
2021-04-20 15:59:03 +03:00
Juan A. Suarez Romero 772dc50d16 iris: hook up resource creation from memory object
v2:
* Fixed indentation in iris_resource_from_memobj

v3:
* Removed the call to iris_resource_configure_aux, as we don't
  have any auxiliary buffer support.

v4:
* Added a comment about the assertion that there's no aux buffer
  in case we add them later.

v5:
* Changed the logic of iris_resource_from_memobj. When the user doesn't
  explicitly set the tiling to linear, we use a similar logic with the
  anv driver's logic to calculate it instead of querying the kernel.
  This is because the Vulkan driver doesn't perform ioctls to update the
  kernel when it suballocates buffers.

v6:
* Removed the line that sets the modifier info in the resource. We
  shouldn't need it.

v7, v8:
* Removed left over code related to modifiers.

v9:
* Replaced FORCE_LINEAR_TILING flag with PIPE_BIND_LINEAR where
  necessary.

v10: rebase, use iris_resource_configure_main (Tapani)

v11:
* isl surfaces should be created only for textures and not for
  buffers (fixes: pixel buffer tests assertion failure on BDW).

v12:
* fix in return type is required after rebasing to master.

Signed-off--by: Juan A. Suarez Romero <jasuarez@igalia.com>
Signed-off-by: Eleni Maria Stea <estea@igalia.com>
Co-authored-by: Eleni Maria Stea <estea@igalia.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com> (v9)
Reviewed-by: Tapani Pälli <tapani.palli@intel.com> (v12)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4337>
2021-04-20 15:59:03 +03:00
Juan A. Suarez Romero cdb5a72764 iris: hook up memory object creation from handle
v2: use iris_bo_import_dmabuf (Tapani)
v3: included "util/u_memory.h" to fixed compilation errors caused by
    using the CALLOC_STRUCT macro
v4: implemented iris_memobj_destroy (pscreen->memobj_destroy) callback
v5: removed iris_bo_from_handle and changed the approach for setting the
    tiling: Instead of querying the kernel and call
    iris_bo_import_dmabuf to create the bo, we call
    iris_bo_import_dmabuf_no_mods that imports the bo but without
    setting the tiling mode. We are going to update it when we create
    the resource. Also: implemented the iris_bo_import_dmabuf_no_mods.
v6: rebase to iris_bo_import_dmabuf changes and take a reference
    to memobj->bo (Tapani Pälli)

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Signed-off-by: Eleni Maria Stea <estea@igalia.com>
Co-authored-by: Eleni Maria Stea <estea@igalia.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4337>
2021-04-20 15:59:03 +03:00
Tapani Pälli 58e9371141 anv: do not support image export with stencil aspect set
Export/import with iris does not work properly so disable it for now.

v2: Added a vk_errorfi and assigned to a result (Lionel Landwerlin)
v3: Changed the type of error to be VK_ERROR_FORMAT_NOT_SUPPORTED
(Lionel Landwerlin)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Eleni Maria Stea <elene.mst@gmail.com> (v2, v3)
Reviewed-by: Eleni Maria Stea <elene.mst@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4337>
2021-04-20 15:59:03 +03:00
Boris Brezillon 4b2c7f286f panfrost: Fix RSD emission on Bifrost v6
Bifrost v6 doesn't have wait dependency fields.
Fixes some dEQP-GLES3.functional.shaders.fragdepth tests on G72.

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/10314>
2021-04-20 12:28:16 +00:00
Samuel Pitoiset 6aaa325f89 radv: remove radv_image_iview::multiplane_planes
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/10218>
2021-04-20 12:16:33 +00:00
Samuel Pitoiset 8198aeac8d radv: remove radv_image_iview::bo
This saves one 64-bit pointer.

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/10218>
2021-04-20 12:16:33 +00:00
Bas Nieuwenhuizen 9da4590df8 amd/common: Use cap to test kernel modifier support.
Turns out both kernel v5.10 and v5.11 have the same amdgpu driver
version and only one has modifiers ... In addition the version check
is kinda annoying for backports.

So lets use the cap. Since the cap is technically about ADDFB2 I
tested that this works on rendernodes (and reading the code there
is no distinction from what kind of node this is called).

Fixes: 9a937330ef ("radeonsi: Only set modifier creation function for GFX9+ & with kernel support.")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10337>
2021-04-20 11:59:43 +00:00
Boris Brezillon 8d9b52f45a panfrost: Reserve thread storage descriptor in panfrost_launch_grid()
If we don't do that the compute batch is left with an empty thread
storage descriptor, and panfrost_batch_submit() tries to emit an FB
descriptors using invalid FB information.

Reported-by: Italo Nicola <italonicola@collabora.com>
Fixes: ff3eada7eb ("panfrost: Use the generic preload and FB helpers in the gallium driver")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Tested-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10312>
2021-04-20 11:41:11 +00:00
Juan A. Suarez Romero 57ff43499b ci/softpipe: run KHR-GLESxx tests
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10287>
2021-04-20 12:39:27 +02:00
Juan A. Suarez Romero fbc0c05c53 ci/llvmpipe: run KHR-GLES2.* tests
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10287>
2021-04-20 12:39:27 +02:00
Juan A. Suarez Romero 0dde87457e ci/v3d: add KHR-GLES test jobs
Add (manually launched) jobs for KHR-GLES2.*, KHR-GLES3.* and
KHR-GLES31.*

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10287>
2021-04-20 12:39:27 +02:00
Samuel Iglesias Gonsálvez b2a60c157e turnip: add LRZ early-z support
Imported the logic from Freedreno driver.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7186>
2021-04-20 10:01:58 +00:00
Samuel Iglesias Gonsálvez af049b6668 turnip: fix setting dynamic state mask for VK_DYNAMIC_STATE_STENCIL_OP_EXT case
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7186>
2021-04-20 10:01:58 +00:00
Samuel Iglesias Gonsálvez 88c7aa0b3e turnip: group all geometry constant draw states in one
Thus, we can free some draw state slots for future use.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7186>
2021-04-20 10:01:58 +00:00
Samuel Iglesias Gonsálvez 2c0c696f16 turnip: update LRZ state based on stencil test state
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7186>
2021-04-20 10:01:58 +00:00
Samuel Iglesias Gonsálvez ff8e3547b3 turnip: implement LRZ direction
There are some LRZ compare op switches that are not supported by
the HW, like GREATER* <-> LESS* ones.

This patch tracks the direction of the switch and disables LRZ
if needed.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7186>
2021-04-20 10:01:58 +00:00
Samuel Pitoiset 1d3542694b radv: fix emitting depth bias when beginning a command buffer
If depth bias is enabled but zero values used, they were never
emitted to the command buffer because they are equal to the default
values.

Previously, they were always emitted when the bound DS attachment
changed.

This should fix some sort of Z fighting with Dota2 on all GPUs.
This also fixes a different issue (ie. some occlusion queries failures)
on GFX6 because CLEAR_STATE is not used on that chip.

Fixes: 8a47422d97 ("radv: do not scale the depth bias for D16_UNORM depth surfaces")
Cc: 21.1 mesa-stable
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/10310>
2021-04-20 09:09:38 +00:00
Samuel Pitoiset e4c0724dc6 radv: fix fast clearing depth-only or stencil-only aspects with HTILE
DB isn't coherent with L2 on GFX6-8. This is needed when the
clear HTILE mask path is selected.

This fixes an issue with avatars in Heroes of The Storm.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3362
Cc: 21.1 mesa-stable
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/10277>
2021-04-20 08:20:49 +00:00
Erik Faye-Lund 00ff60f799 gallivm: add 16-bit integer support
The new failure here is due to a bug in the test-case, and a fix has
been submitted here:

https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/502

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10185>
2021-04-20 07:49:21 +00:00
Erik Faye-Lund 1c82c05d58 gallivm: run nir_opt_algebraic_late
Without this, we're left with a bunch of medium-precision residue, like
i2imp. And to avoid that the lowering intrudces left-over instructions,
also run other lowering passes, similar to what other drivers do.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10185>
2021-04-20 07:49:21 +00:00
Erik Faye-Lund da5f346e6c gallivm: handle 16-bit input in i2b32
Fixes: dac8cb981f ("gallivm/nir: allow 8/16-bit conversion and comparison.")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10185>
2021-04-20 07:49:21 +00:00
Tomeu Vizoso 106da39b19 ci/radeonsi: Add expected failures due to #4674 having slipped in
https://gitlab.freedesktop.org/mesa/mesa/-/issues/4674

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10139>
2021-04-20 07:26:51 +00:00
Tomeu Vizoso 79c65217a1 ci: Test RadeonSI with piglit's quick_gl
And do some job refactoring to share more lines between job definitions.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10139>
2021-04-20 07:26:51 +00:00
Tomeu Vizoso a056362d92 ci: Reenable radeonsi jobs, and extend coverage
Now that we have more devices to test on.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10139>
2021-04-20 07:26:51 +00:00
Carsten Haitzler (Rasterman) fcebdcb3b3 panfrost: Fix Bo imports to not take the process down if fd is invalid
If the calling process happens to use an invalid bo (e.g. fd has been
closed), this led to lseek() returning -1 and this mmap trying to mmap
a buffer of size -1 (0xffffffffffffffff ...) which led to mmap
failing, which led to munmap failing which then led to the process
aborting.

This fixes that to gracefully handle the mmap failures and percolate
the failures back up through the API so eglCreateImage will not return
a valid image anymore, thus the error is detectable in the caller
process too.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10313>
2021-04-20 08:26:04 +02:00
Christian Gmeiner 027095065d drm-shim: fix compile with glibc >= 2.33
Fixes compile of drm-shim with glibc 2.33.

Closes: #3782
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10309>
2021-04-20 05:49:29 +00:00
Dave Airlie 4a384f587a llvmpipe: delay late screen creation until context init.
This avoids a problem with lavapipe where the screen hangs around in the
vulkan instance but is just wasting resources.

This was pointed out by Mike Blumenkrantz

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10338>
2021-04-20 12:09:13 +10:00
Dave Airlie 3172289d8b llvmpipe: wrap late screen init with a mutex.
Next step can just move this into context init

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10338>
2021-04-20 12:09:13 +10:00
Dave Airlie c93e95156a llvmpipe: split screen init up.
Add a late init path for stuff that can be delayed.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10338>
2021-04-20 12:09:13 +10:00
Dave Airlie 6d3ded7995 lavapipe: add support for non-dri loader on linux
If you build --glx=gallium-xlib then lavapipe will fail to
link this should let it use the non-dri paths on Linux in that
case

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Tested-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9400>
2021-04-20 01:00:54 +00:00
Jesse Natalie 2b69dd6809 xmlconfig: Fix MSVC warning C4334 (32bit shift cast to 64bit)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>
2021-04-20 00:28:35 +00:00
Jesse Natalie b678115480 llvmpipe: Fix MSVC warning C4334 (32bit shift cast to 64bit)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>
2021-04-20 00:28:35 +00:00
Jesse Natalie 4a3f044473 gallium/aux: Fix MSVC warning C4334 (32bit shift cast to 64bit)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>
2021-04-20 00:28:35 +00:00
Jesse Natalie 0e2566a8a7 shader_enums: Fix MSVC warning C4334 (32bit shift cast to 64bit)
The warning is triggered when assigning into inputs_read, which is 64bit.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>
2021-04-20 00:28:35 +00:00
Jesse Natalie 67b5fba62a microsoft/compiler: Fix MSVC warning C4334 (32bit shift cast to 64bit)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>
2021-04-20 00:28:35 +00:00
Jesse Natalie 53786d2eb2 microsoft/clc: Fix undeclared function warning
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>
2021-04-20 00:28:34 +00:00
Jesse Natalie d641adca6a microsoft/clc: Fix MSVC unreferenced variable warnings
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>
2021-04-20 00:28:34 +00:00
Jesse Natalie 1a0fbca1bd d3d12: Fix MSVC warning C4334 (32bit shift cast to 64bit)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>
2021-04-20 00:28:34 +00:00
Jesse Natalie 09440ce3fb nir: Fix MSVC warning C4334 (32bit shift cast to 64bit)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>
2021-04-20 00:28:34 +00:00
Erico Nunes 750ddf3239 gallium/hud: extend check for has_srgb
gallium hud checks for the PIPE_FORMAT_B8G8R8A8_SRGB format to set
has_srgb, but can then receive a different format such as
PIPE_FORMAT_B8G8R8X8 in hud_run.
If the driver supports PIPE_FORMAT_B8G8R8A8_SRGB but does not support
the other formats such as PIPE_FORMAT_B8G8R8X8_SRGB, that will break
rendering as gallium hud assumes srgb is also supported for that format.
Extend the check to set has_srgb to prevent that from happening.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10222>
2021-04-20 00:11:11 +00:00
Erico Nunes f93dc9dc77 gallium/hud: create vs_text to match fs_text
gallium hud uses different tgsi fragment shaders for text and background
quads, which have different varying layouts. Since these are compiled
directly from tgsi they bypass some optimizations and may not work
properly on all backends.
A simple fix for the varying layout problem is to define a vs_text
shader to match the varyings in fs_text so the problem is avoided.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10222>
2021-04-20 00:11:11 +00:00
Lepton Wu 5322572c78 virgl: move new added field to the end.
This field was introduced 2 months ago and it breaks virgl
compatibility between guest/host. Switch the new added field
to the end. We will still have compatibility issue but the
"bug window" is much smaller.

Fixes: e778aceaae ("virgl: update headers")

Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10333>
2021-04-20 00:00:30 +00:00
Francisco Jerez 0f247cc8a9 iris/gfx12: Invalidate ISP at the end of every batch.
As requested by Ken since we're now (after 20e2c7308f)
re-emitting constants at the beginning of every batch which may lead
to some redundant constant restore overhead.  No statistically
significant performance changes observed with either change.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9903>
2021-04-19 23:50:32 +00:00
Alejandro Piñeiro f5133f6bce v3dv/pipeline: track descriptor maps per stage, not per pipeline
One of the conclusions of our recent clean up on the limits was that
the pipeline limits needed to be the per-stage limits multiplied by
the number of stages.

But until now we only have a set of descriptor maps for the full
pipeline. That would work if we could set the same limit per pipeline
that per stage, but that is not the case. So if, for example, we have
the fragment shader using V3D_MAX_TEXTURE_SAMPLERS textures, and then
the vertex shader, with a different descriptor set, using one texture,
we would get an index greater that V3D_MAX_TEXTURE_SAMPLERS. We assert
that index as an error on the vulkan backend, but fwiw, it would be
also asserted on the compiler.

With this commit we track and allocate a descriptor map per stage,
although we reuse the vertex shader descriptor map for the vertex bin.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10272>
2021-04-19 23:10:35 +00:00
Michel Zou 48d31a6280 meson: link vulkan_util with link_whole on mingw
It was missing for mingw.

Closes #4633

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: James Park <jpark37@lagfreegames.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10276>
2021-04-19 22:46:30 +00:00
Michel Zou 54deb1010f gallium: fix uninitialized variable warning
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10276>
2021-04-19 22:46:30 +00:00
Michel Zou dc036b1769 vulkan: fix duplicate win32 def
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10276>
2021-04-19 22:46:30 +00:00
Michel Zou 45f32ce239 lavapipe: fix unused variable warning
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10276>
2021-04-19 22:46:30 +00:00
Eric Anholt ed04fd44ca freedreno/a6xx: Don't try to do Z-as-RGBA blits for mismatched formats.
Fixes piglit crashes doing glCopyTexSubImage from (for example)
PIPE_FORMAT_Z24_UNORM_S8_UINT to PIPE_FORMAT_Z32_FLOAT_S8X24_UINT where,
in addition to reading the source Z values incorrectly, we would try to
dereference the missing separate stencil of the Z24S8 buffer.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10328>
2021-04-19 22:26:24 +00:00
Lionel Landwerlin 856953b131 spirv: fix uToAccelerationStructure handling
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 7f223a2329 ("spirv: Implement SpvOpConvertUToAccelerationStructureKHR")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10324>
2021-04-19 22:02:53 +00:00
Eric Anholt bdad5ce27b freedreno: Mark glsl-fs-fogscale as a Fail.
I have a note in -flakes.txt about how it can flake to being a Crash
instead of a Fail, but I haven't been able to reproduce that flake today.
It does always fail in the GS subtest, though, so quiet the flake spam in

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10330>
2021-04-19 21:38:10 +00:00
Eric Anholt c1352205ab mapi: Respect MESA_DEBUG=silent for no-op debug output.
We set this in deqp-runner runs to disable Mesa debug/debugoptimized
builds printing to stderr for expected GL test behavior, and with the
addition of dEQP-EGL mapi got very verbose.  Move it to a call_once() too
to avoid data races.

Acked-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10240>
2021-04-19 20:53:27 +00:00
Eric Anholt 8a8e55d6a8 ci/freedreno: Test dEQP-EGL against Xorg.
This should help us be able to refactor core EGL code with more
confidence, and increase our confidence uprevving Mesa in ChromeOS.

Part of #1884

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10240>
2021-04-19 20:53:27 +00:00
Eric Anholt 510c687cfb ci/llvmpipe: Test dEQP-EGL against Xvfb.
This should help us refactor EGL code with more confidence than just
relying on piglit.  Reveals several llvmpipe EGL issues.

Part of #1884

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10240>
2021-04-19 20:53:27 +00:00
Alyssa Rosenzweig adcbda42e3 panfrost: Allow FPK when there are no side effects
Enables FPK for most real content.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10271>
2021-04-19 20:32:59 +00:00
Alyssa Rosenzweig dbf9a4b072 panfrost: Don't allow FPK if a RT is missing
A fragment shader that forgets to write to one of the bound render
targets (in the presence of MRT) invalidates a core FPK invariant. Check
for this and add it to the naughty list.

I don't think this needs a backport since FPK isn't really used yet.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10271>
2021-04-19 20:32:59 +00:00
Alyssa Rosenzweig 600a48248e panfrost: Invert blend_reads_dest logic
Easier to understand (and match to actual hardware behaviour) this way.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10271>
2021-04-19 20:32:59 +00:00
Alyssa Rosenzweig ba51d2583e panfrost: Set clean_fragment_write for blits
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10271>
2021-04-19 20:32:59 +00:00
Alyssa Rosenzweig d034461921 panfrost: Set allow_forward_pixel_to_be_killed for blit
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10271>
2021-04-19 20:32:59 +00:00
Alyssa Rosenzweig e85b1d8fdf panfrost: Don't allow_forward_pixel_to_kill for Z/S blit
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10271>
2021-04-19 20:32:59 +00:00
Alyssa Rosenzweig 899dd8e60a nir: Update some comments referring to imov
This was renamed when I was in high school. I remember updating the
Midgard compiler while sitting in AP Physics.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10296>
2021-04-19 20:07:35 +00:00
Eric Anholt 44f744be42 zink: Enable PIPE_CAP_PACKED_UNIFORMS.
We already support everything necessary and just need to ask the frontend
to DTRT.  This makes UBO0 get more tightly packed, saving upload space,
and allows for _mesa_optimize_state_parameters() as well.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10150>
2021-04-19 19:57:33 +00:00
Eric Anholt 24d7c413fe panfrost: Enable packed uniforms.
Since we can handle arbitrary offsets in the load_ubo paths, we can let
the GLSL compiler pack UBO 0 tighter, saving uniform uploads.  This may
cause some straddling loads that could reduce performance for vec3s, but
those are rare in shader-db and we expect this to be outweighed by the
wins for normal float/vec2 packing.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10151>
2021-04-19 19:44:51 +00:00
Erik Faye-Lund ff007afce2 zink: document requirement of VK_EXT_custom_border_color
Without this extension, we misrender when custom border colors are
used. Let's document this, and emit a warning when the extension is
missing.

Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10316>
2021-04-19 19:31:36 +00:00
Bas Nieuwenhuizen a144fa608d radv: Fix memory leak on descriptor pool reset with layout_size=0.
Gotta track those sets too to free them. Alse changed the search
on destroy to check for set instead of offset since offset is not
necessarily unique anymore.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4652
CC: mesa-stable
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10317>
2021-04-19 19:19:58 +00:00
Mauro Rossi 63c2dfe132 android: panfrost/lib: add pan_cs.c to Makefile.sources
Fixes the following building errors:

FAILED: out/target/product/x86_64/obj/SHARED_LIBRARIES/gallium_dri_intermediates/LINKED/gallium_dri.so
...
ld.lld: error: undefined symbol: pan_emit_tls
>>> referenced by pan_cmdstream.c:2279 (external/mesa/src/gallium/drivers/panfrost/pan_cmdstream.c:2279)
...
ld.lld: error: undefined symbol: pan_emit_fbd
>>> referenced by pan_cmdstream.c:2302 (external/mesa/src/gallium/drivers/panfrost/pan_cmdstream.c:2302)
...
ld.lld: error: undefined symbol: pan_emit_fragment_job
>>> referenced by pan_cmdstream.c:2382 (external/mesa/src/gallium/drivers/panfrost/pan_cmdstream.c:2382)
...
ld.lld: error: undefined symbol: pan_emit_bifrost_tiler_heap
>>> referenced by pan_job.c:718 (external/mesa/src/gallium/drivers/panfrost/pan_job.c:718)
...
ld.lld: error: undefined symbol: pan_emit_bifrost_tiler
>>> referenced by pan_job.c:723 (external/mesa/src/gallium/drivers/panfrost/pan_job.c:723)
...
ld.lld: error: undefined symbol: pan_fbd_has_zs_crc_ext
>>> referenced by pan_job.c:893 (external/mesa/src/gallium/drivers/panfrost/pan_job.c:893)
...
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)

Cc: 21.1 <mesa-stable@lists.freedesktop.org>
Fixes: 387f8c037d ("panfrost: Add various helpers to simplify FB desc emission")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10299>
2021-04-19 18:53:43 +00:00
Chia-I Wu 588a52869e venus: refactor vn_queue_submission_count_semaphores
Add vn_queue_submission_count_batch_semaphores that works on a single
batch at a time.  Also avoid code duplication.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10290>
2021-04-19 18:25:00 +00:00
Jesse Natalie 9c689ef395 gallium: Define PIPE_ARCH_AARCH64 for MSVC arm64 builds
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10014>
2021-04-19 17:59:44 +00:00
Eric Anholt 80923e8d58 util/format: Add some NEON intrinsics-based u_format_unpack.
In looking at the profile of dEQP, GLES3 was spending 5-10% of its time in
ReadPixels, and almost all of that is b8g8r8a8_unorm8.  It's really slow
because we're getting about 47MB/s by doing uncached reads 32 bits at a
time in the code-generated unpack.  If we use NEON to generate larger bus
transactions, we can speed things up to 136MB/s.  In comparison, raw
ldr/str read/writes with no byte swapping can hit a max of 216MB/sec.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10014>
2021-04-19 17:59:44 +00:00
Eric Anholt 2b5178ee48 util: Switch the non-block formats to unpacking rgba rows instead of rects.
We have only a few callers of unpack that do rects, so add a helper that
iterates over y adding the strides.  This saves us 36kb of generated code
and means that adding cpu-specific variants for RGBA format unpack will be
much simpler.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10014>
2021-04-19 17:59:44 +00:00
Eric Anholt 921b05f582 mesa: Remove dead _mesa_unpack_rgba_block().
Despite many changes over its lifetime, it appears to have been dead ever
since its introduction in 2011.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10014>
2021-04-19 17:59:44 +00:00
Drew Davenport 9b7814779b radeonsi: Report multi-plane formats as unsupported
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6693 added
NV12 lowering to PIPE_FORMAT_R8_G8B8_420_UNORM, which regressed some
video decode use cases in radeonsi, for example CtsDecodeTestCases in
android CTS. There are also discolored frames in video playback use
cases (i.e. youtube).

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3632
previously fixed similar issues in radeonsi. This change takes that a
step further to report any multi-plane format as unsupported.

Fixes: 826a10255f ("st/mesa: Add NV12 lowering to PIPE_FORMAT_R8_G8B8_420_UNORM")
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tested-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9490>
2021-04-19 17:42:33 +00:00
Danylo Piliaiev 64367f2359 turnip: implement VK_KHR_shader_terminate_invocation
OpTerminateInvocation provides the behavior required by the GLSL
discard statement, which we already implement.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9460>
2021-04-19 17:11:36 +00:00
Danylo Piliaiev 9dd9424a85 turnip: implement VK_EXT_shader_demote_to_helper_invocation
The "demote" intrinsic has the semantics of D3D discard, which means
it doesn't change the control flow, allowing derivatives to work.

On A6xx there is no known way to check whether invocation was demoted,
thus we use nir_lower_is_helper_invocation.

Add "logical" OPC_DEMOTE which is later translated to "kill".
Such separation is necessary to run "kill" specific optimizations
which are invalid for "demote".

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9460>
2021-04-19 17:11:36 +00:00
Danylo Piliaiev f17b41ab4f nir: add lowering pass for helperInvocationEXT()
Some hardware doesn't have a way to check if invocation was demoted,
in such case we have to track it ourselves.
OpIsHelperInvocationEXT is specified as:

 "An invocation is currently a helper invocation if it was originally
  invoked as a helper invocation or if it has been demoted to a helper
  invocation by OpDemoteToHelperInvocationEXT."

Therefore we:
- Set gl_IsHelperInvocationEXT = gl_HelperInvocation
- Add "gl_IsHelperInvocationEXT = true" right before each demote
- Add "gl_IsHelperInvocationEXT = gl_IsHelperInvocationEXT || condition"
  right before each demote_if

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9460>
2021-04-19 17:11:36 +00:00
Eric Anholt 09a23851ae ci/piglit: Always include the HTML summary in a run.
It's the best visualization for run results when using the piglit
framework, and now all the DUTs return artifacts.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10297>
2021-04-19 16:46:33 +00:00
Samuel Pitoiset 9434675d60 aco: fix opquantize2f16 on GFX6-7
Make sure to preserve signed zeroes.

Fixes dEQP-VK.spirv_assembly.instruction.compute.opquantize.flush_to_zero
on GFX6 (Pitcairn). Untested on GFX7.

Fixes: 54a09545ec ("aco: optimize a*0.0")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10319>
2021-04-19 16:33:37 +00:00
Connor Abbott 08499369d0 ir3: Assemble and disassemble swz/gat/sct
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10291>
2021-04-19 16:10:44 +00:00
Connor Abbott d48d43039a ir3: Improve cat1 modifier disassembly
Remove bit that shouldn't be part of (rptN), and rewrite the handling of
(even) and (pos_infinity) to uncover a missing (neg_infinity) modifier.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10291>
2021-04-19 16:10:44 +00:00
Connor Abbott 4c5b696cc3 ir3/parser: Fix oob write with immediates array
immediates_count and immediates_size are supposed to have the same
units, but it was only incrementing immediates_count by 1. While we're
here, also fix the case where constants are specified out-of-order.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10291>
2021-04-19 16:10:44 +00:00
Jesse Natalie 8c140006e2 microsoft/clc: If local size isn't specified either in the shader or at runtime, set it to (1,1,1)
Otherwise we can end up in situations like having divide-by-zero. If the optimization is smart enough
that we end up with a *constant* divide-by-zero, then the DXIL validator will fail to sign, which
can trigger fatal errors with CLOn12.

We want to run an initial translation of all kernels during program build, but at that point we don't
know the local size to be able to specify it through kernel specialization data.

v2: Metadata output of 0 is used to indicate that the size wasn't explicitly specific. Copy the
    size to the metadata before overriding it to (1,1,1). If conf was explicitly specified,
    update the metadata again (though nobody should be paying attention to it).

Closes: https://github.com/microsoft/OpenCLOn12/issues/20
Closes: https://github.com/darktable-org/darktable/issues/8700
Reviewed-By: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10303>
2021-04-19 15:38:57 +00:00
Stéphane Marchesin b460d4da60 virgl: resources without any binding can be cached
Certain games create and destroy lots of resources without binding them.
This can take quite a bit of time and even create unneeded
synchronization. However, we know that if a resource was never bound to
anything, it can be cached. This change does that.

Counting the number of uncached allocation with a tabletop simulator trace:
Before: 2967 uncached allocations over the replay
After: 24 uncached allocations over the replay

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10225>
2021-04-19 14:59:04 +00:00
Erik Faye-Lund 7886983835 nir/lower_tex: do not stumble on 16-bit inputs
If a has been lowered to float16 here, then we end up trying to
construct a vector of mixed precision, which the validator asserts
about.

So let's make sure we use the same type for all arguments.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10201>
2021-04-19 14:28:05 +00:00
Erik Faye-Lund bd1b0c3266 lavapipe: implement VK_EXT_custom_border_color
This fixes a bunch of piglit failures on Zink.

Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10320>
2021-04-19 14:01:41 +00:00
Erik Faye-Lund a20e0b8a97 lavapipe: resolve border-color when creating sampler
This is going to make it easier to implement the custom border-color
extension.

While we're moving the code, tweak the memset code a bit, so we don't do
any float-ism in the int-case. It doesn't change anything functionally,
just makes it slightly clearer what's going on here.

Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10320>
2021-04-19 14:01:41 +00:00
Mike Blumenkrantz 33e117ed7f st/pbo: use cso_set_vertex_buffers_and_elements() for st_pbo_draw
this lets us use the more consistent codepath and ordering (buffers -> elems)
as well as set take_ownership=true to skip the unref

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10257>
2021-04-19 13:24:06 +00:00
Mike Blumenkrantz 001c6f8201 zink: fix tcs input reservation for user vars
tcs user vars are var_size[32], which isn't actually how many slots they need,
just how big the variable is (oops), so this needs to be divided
by MAX_PATCH_VERTICES to get the real slot count

slot mapping has always been broken for all tcs inputs, but this probably fixes
all of the related issues there, including unlimited crashes when playing Tomb Raider

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

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10269>
2021-04-19 13:11:04 +00:00
Mike Blumenkrantz a8ba8eb12f zink: fix tcs slot map eval for user vars
tcs user inputs need to have their size adjusted in order to determine whether
they'll overflow the existing slot map

Fixes: 5c5e1abea2 ("zink: evaluate existing slot map during program init and force new map as needed")

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10269>
2021-04-19 13:11:04 +00:00
Mike Blumenkrantz a1c7aff88a zink: always copy the nir shader before compiling
nir_convert_from_ssa and assign_io_locations both modify this unconditionally,
the latter of which possibly re-modifies variables in ways that can break the
slot map and cause stack overflows during vk driver pipeline compilation

Fixes: 2b4609b66c ("zink: run nir_convert_from_ssa last during compile")
Fixes: 2d98efd323 ("zink: pre-populate locations in variables")

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10269>
2021-04-19 13:11:04 +00:00
Erik Faye-Lund d09442461f zink: fix stencil-export cap emission
This cap should only ever be emitted for fragment-shaders, but we
accidentally emit it for all shaders. Let's tighten the check to avoid a
validator warning when emitting non-fragment shaders without support for
VK_EXT_shader_stencil_export.

Fixes: 8724d4fb36 ("zink: check shader stencil output")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10249>
2021-04-19 10:48:43 +00:00
Marek Olšák 451089812a gallium/util: add easy profiling helpers using TIME_ELAPSED queries
There are no users and that's intentional.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10262>
2021-04-19 08:29:17 +00:00
Gert Wollny 1b5851fadb Revert "r600: don't set an index_bias for indirect draw calls"
This reverts commit acdf1a1234.

While this commit fixed the gles CTS regressions, it introduced
regressions that made the driver unusable, hence the revert.

Closes #4657

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10311>
2021-04-19 10:00:55 +02:00
Lionel Landwerlin f90d625841 vulkan/util: cast enums to int64_t in switch
With the new Vulkan Video extensions a bunch of enum values have been
added. The problem is that those are behind #ifdef so our generated
code complains that we using enum values not defined.

Since we're not using enum names but integer values, we can silence
all those by casting the enum type to int64_t.

Signed-off-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/10304>
2021-04-19 06:14:11 +00:00
Dave Airlie a49ef6e731 iris: move target to isl dim translate to inline.
This avoids a conflict in namespace when crocus wants to use the
same function.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10308>
2021-04-19 16:01:03 +10:00
Dave Airlie a067399e37 iris: move get_time into a static in bufmgr code.
This ends up polluting the namespace if you build iris/crocus
at once, just move it to where it's used for now.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10308>
2021-04-19 16:00:51 +10:00
Rob Clark c74d93cf01 freedreno/fdl: Re-indent
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10293>
2021-04-17 15:38:56 +00:00
Rob Clark 6050976232 freedreno/perfcntrs: Re-indent
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10293>
2021-04-17 15:38:56 +00:00
Rob Clark d26a224ca9 freedreno/ir2: Re-indent
clang-format -fallback-style=none --style=file -i src/freedreno/ir2/*.[ch]

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10293>
2021-04-17 15:38:56 +00:00
Rob Clark 2dbf09c2b4 freedreno/drm-shim: Re-indent
clang-format -fallback-style=none --style=file -i src/freedreno/drm-shim/*.[ch]

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10293>
2021-04-17 15:38:56 +00:00
Rob Clark 45856c5fbc freedreno/decode: Re-indent
clang-format -fallback-style=none --style=file -i src/freedreno/decode/*.[ch]

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10293>
2021-04-17 15:38:56 +00:00
Rob Clark 3894bc9664 freedreno/computerator: Re-indent
clang-format -fallback-style=none --style=file -i src/freedreno/computerator/*.[ch]

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10293>
2021-04-17 15:38:56 +00:00
Rob Clark ccd68b672a freedreno/common: Re-indent
clang-format -fallback-style=none --style=file -i src/freedreno/common/*.[ch]

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10293>
2021-04-17 15:38:56 +00:00
Rob Clark f5918f750f freedreno/afuc: Re-indent
clang-format -fallback-style=none --style=file -i src/freedreno/afuc/*.[ch]

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10293>
2021-04-17 15:38:56 +00:00
Rob Clark b94db11708 freedreno/drm: Re-indent
clang-format -fallback-style=none --style=file -i src/freedreno/drm/*.[ch]

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10293>
2021-04-17 15:38:56 +00:00
Marek Olšák a1653854f5 radeonsi: fix automatic DCC retiling after compute image stores
Only internal compute shaders use DCC stores, so the TODOs are not
critical yet.

Fixes: 1d64a1045e - radeonsi: enable dcc image stores on gfx10+

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10261>
2021-04-17 02:37:49 +00:00
Marek Olšák 4d7dd094e3 radeonsi: fix automatic DCC retiling after DCC clear and DCC decompression
Fixes: d4f7962d48 - radeonsi: Add displayable DCC flushing without explicit flushes.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10261>
2021-04-17 02:37:49 +00:00
Marek Olšák a0771e6b27 radeonsi: fix incorrect comments in culling code and NIR lowering
The lowering code removes the "VS inputs" item from the list because the hw
doesn't support indirect indexing of VS inputs.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10261>
2021-04-17 02:37:49 +00:00
Marek Olšák e0ffd1f928 radeonsi: don't decompress DCC for float formats in si_compute_copy_image
Format reinterpretation disabled it.

Fixes: 1d64a1045e "radeonsi: enable dcc image stores on gfx10+"

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10261>
2021-04-17 02:37:49 +00:00
Marek Olšák ec1ddb976a amd/registers: rename IMG_FORMAT to GFX10_FORMAT to disambiguate the meaning
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10261>
2021-04-17 02:37:49 +00:00
Marek Olšák 3e0ce4af4f amd/registers: clean up gfx103.json
because gfx103.json is automatically generated and can't be changed
manually. This fixes the file generator without changing the generated
header.

Missing registers must be in registers-manually-defined.json, and
missing fields must be in parse_kernel_headers.py.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10261>
2021-04-17 02:37:49 +00:00
Marek Olšák a142925b7a amd/registers: fix the kernel header parser with latest headers
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10261>
2021-04-17 02:37:49 +00:00
Chia-I Wu 418da19f91 venus: add vn_wsi_create_scanout_image
A helper called from vn_wsi_create_scanout_image to hijack wsi scanout
image creation.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10294>
2021-04-16 17:29:38 -07:00
Chia-I Wu b7db6598df venus: add vn_image_create
A helper called from vn_CreateImage to allocate and initialize vn_image.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10294>
2021-04-16 17:29:36 -07:00
Chia-I Wu e1787ec77d venus: add vn_image_init_memory_requirements
A helper called from vn_CreateImage to initialize memory requirements.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10294>
2021-04-16 17:29:27 -07:00
Eric Anholt 5de3cbbb2e nir: Generate load_ubo_vec4 directly for !PIPE_CAP_NATIVE_INTEGERS
The prog_to_nir->NIR-to-TGSI change ended up causing regressions on r300,
and svga against r300-class hardware, because nir_lower_uniforms_to_ubo()
introduced shifts that nir_lower_ubo_vec4() tried to reverse, but that NIR
couldn't prove are no-ops (since shifting up and back down may drop bits),
and the hardware can't do the integer ops.

Instead, make it so that nir_lower_uniforms_to_ubo can generate
nir_intrinsic_load_ubo_vec4 directly for !INTEGER hardware.

Fixes: cf3fc79cd0 ("st/mesa: Replace mesa_to_tgsi() with prog_to_nir() and nir_to_tgsi().")
Closes: #4602
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10194>
2021-04-16 21:58:00 +00:00
Eric Anholt 71d6d1b1ab nir_to_tgsi: Use ARL instead of UARL in the !native_integers case.
Our "integer" index is stored as a float in this case, and we just need to
use teh right opcode for loading it, which will be the only one supported
by !native_integers hardware.

Fixes: cf3fc79cd0 ("st/mesa: Replace mesa_to_tgsi() with prog_to_nir() and nir_to_tgsi().")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10194>
2021-04-16 21:58:00 +00:00
Mike Blumenkrantz 5b9c3cb7b9 zink: compare against screen batch id when determining which semaphore to use
semaphores are per-screen now, so check the screen value

Fixes: fa36a16c68 ("zink: make timeline semaphores per-screen")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10267>
2021-04-16 21:09:01 +00:00
Francisco Jerez 20e2c7308f iris/gen12: Work around push constant corruption on context switch.
This has been confirmed to fix sporadic graphics corruption on Gen12
platforms for a number of workloads (including Heaven, Valley and
CS:GO among others).  Corruption seems to occur during context switch
fairly consistently, but unfortunately this problem doesn't seem to be
documented.  Until the hardware team comes up with a better
workaround, fix the problem by reemitting constants at the beginning
of each batch.

No corruption has been observed so far in GL due to preemption,
however this is a possibility to keep in mind, it may be necessary to
disable preemption in addition to this patch in order to fully address
this problem (see also 81201e4617).

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4412
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4454
Cc: mesa-stable
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2021-04-16 12:41:40 -07:00
Jesse Natalie aea6f8effc microsoft/compiler: Propagate access when lowering SSBO loads
We'll want to preserve whether the load is accessing a read-only
SSBO or not.

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10149>
2021-04-16 17:08:17 +00:00
Jesse Natalie 474824bf3d microsoft/compiler: Support raw SRVs in addition to typed SRVs
These will be used for read-only SSBOs

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10149>
2021-04-16 17:08:17 +00:00
Jesse Natalie a5f402f002 microsoft/compiler: Store nir_shader in the ntd_context
This means we can stop passing it as a second parameter all the time

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10149>
2021-04-16 17:08:17 +00:00
Jesse Natalie 50d7e97c1d microsoft/compiler: Better support UBO/SSBO references to descriptors
Previously UBOs only supported static indices, and SSBOs only
supported dynamic indices. UBO support for descriptors was added
as an alternative to static indices, but the logic for detecting
descriptors to SSBOs couldn't just differentiate on constants vs not.

Add a helper which can differentiate cleanly across the board and
handle pre-created handles from descriptors, or static/dynamic raw
indices.

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10149>
2021-04-16 17:08:17 +00:00
Jesse Natalie d6b5aaaff8 microsoft/compiler: Split Vulkan resource_index / descriptor processing
Instead of doing all of the handle logic in the descriptor load, split
it so that the resource index is actually computed during resource_index
processing, and it's converted to a handle during the load_descriptor.

At the same time, add SSBO handling and dynamic indexing handling.

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10149>
2021-04-16 17:08:17 +00:00
Jesse Natalie 8a821e2b8b microsoft/compiler: Emit SSBO variables
Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10149>
2021-04-16 17:08:17 +00:00
Jesse Natalie 15de712270 microsoft/compiler: Emit CBVs via variables for Vulkan
The resources need to be emitted in a particular order, so CBVs
have to be emitted first and can't be emitted as we iterate through
instructions.

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10149>
2021-04-16 17:08:17 +00:00
Jesse Natalie debdc81ccf microsoft/compiler: Support arrays of UBOs
Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10149>
2021-04-16 17:08:17 +00:00
Jesse Natalie 88ff88bb7d microsoft/compiler: Support raw SRVs/UAVs through dxil_module_get_res_type
Switch the OpenCL "globals" array to use that helper

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10149>
2021-04-16 17:08:17 +00:00
Jesse Natalie 0c8220685e microsoft/spirv_to_dxil: Lower loads/stores to DXIL
This adjusts UBO loads to be float4 loads, and handles SSBO accesses
that are larger/smaller than 32bit.

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10149>
2021-04-16 17:08:17 +00:00
Jesse Natalie 14997c7e96 microsoft/spirv_to_dxil: Lower samplers from deref to index
Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10149>
2021-04-16 17:08:17 +00:00
Mauro Rossi 0a71aaa29d egl/android: include "util/compiler.h" for FALLTHROUGH macro
Fixes the following building error:

external/mesa/src/egl/drivers/dri2/platform_android.c:1263:10: error: use of undeclared identifier 'FALLTHROUGH'
         FALLTHROUGH; /* for pbuffers */
         ^
1 error generated.

Fixes: 2928c21eb7 ("Convert most remaining free-form fall-through comments to FALLTHROUGH")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10264>
2021-04-16 16:42:20 +00:00
Axel Davy 5613984fd9 st/nine: Fix compilation error on non-x86 platforms
The unused variable was improperly declared.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4647
Fixes: d9e79bfe4f ("st/nine: Disable fpu exceptions during init")

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10263>
2021-04-16 16:15:29 +00:00
Michel Dänzer db538bde71 ci: Add test which occasionally times out to lavapipe-vk skips
E.g. https://gitlab.freedesktop.org/mesa/mesa/-/jobs/8912925 .

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10279>
2021-04-16 13:40:26 +00:00
Simon Ser ebab310987 frontends/va: improve surface attribs processing
Instead of checking whether the attribute is settable for each
attrib type, check that once at the beginning of the loop.

Instead of having an if for each attrib type, use a switch.

Return an error if we encounter an unknown attribute. This allows
the caller to make sure settable attributes aren't ignored. The
intel media driver seems to just assert [1] that it doesn't encounter
unknown attributes.

[1]: 95d413e519/media_driver/linux/common/ddi/media_libva.cpp (L2530)

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10104>
2021-04-16 15:26:04 +02:00
Iago Toral Quiroga 6c80b084f2 v3dv: better tracking of dirty push constant state
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10283>
2021-04-16 12:29:11 +00:00
Iago Toral Quiroga 30f125f04f v3dv: dirty viewport doesn't affect fragment shaders
The uniform state for the viewport is only used with geometry stages.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10283>
2021-04-16 12:29:11 +00:00
Iago Toral Quiroga 35ff75701f v3dv: improve dirty descriptor set state tracking
We were using the pipeline layout to discard uniform updates for
stages that don't use descriptors, but we can do better by keeping
track of the stages used by the specific dirty descriptor sets and
only update uniforms for stages that are included in those.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10283>
2021-04-16 12:29:11 +00:00
Lionel Landwerlin 505d176a8e anv: disable baked in pipeline bits from dynamic emission path
In 27ee40f4c9 ("anv: Add support for sample locations") we
introduced the ability to emit sample locations baked in as part of
the pipeline or dynamically.

This is different from the previous dynamic states that were always
removed from the pipeline batch and instead emitted dynamically all
the time.

The mistake in 27ee40f4c9 is that sample locations are now emitted
all the time, leading to bigger command buffers for unnecessary
reasons.

This change introduces a bit fields of what is baked in the pipeline
and doesn't need to be dynamically emitted.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 4ad4cd8906 ("anv: Enabled the VK_EXT_sample_locations extension")
Cc: <mesa-stable>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10282>
2021-04-16 11:53:25 +00:00
Lionel Landwerlin 30bc562bda anv: fix 3DSTATE_MULTISAMPLE emission on gen8+
When pipeline->dynamic_state.sample_locations.samples is not set
because the state is dynamic, we're currently calling
genX(emit_multisample) with a 0 samples value which is incorrect.

Found when using renderdoc with the drawing overlay.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 4ad4cd8906 ("anv: Enabled the VK_EXT_sample_locations extension")
Cc: <mesa-stable>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10282>
2021-04-16 11:53:25 +00:00
Juan A. Suarez Romero d29b5b9f20 v3dv: avoid dereferencing null value
Fixes CID#1468079 "Dereference null return value (NULL_RETURNS)"

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10280>
2021-04-16 11:12:31 +00:00
Rhys Perry 86d903e88d radv: fix clearing DCC-compressed e5b9g9r9 images
Fixes
dEQP-VK.api.image_clearing.core.clear_color_image.2d.optimal.single_layer.e5b9g9r9_ufloat_pack32_33x128
with RADV_DEBUG=forcecompress on GFX10.3.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: 21.1 <mesa-stable>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10176>
2021-04-16 11:56:32 +01:00
Adam Jackson 7ae2ba5da9 glx: Remove some ancient backwards-compatibility typedefs
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10223>
2021-04-16 10:13:07 +00:00
Adam Jackson 0e77a23a34 glx: Fold client_gl_only array into its one real user
The initialization we're doing for it in __glXExtensionsCtr is trivial,
and this is only to make glGetString(GL_EXTENSIONS) work in indirect
contexts anyway.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10223>
2021-04-16 10:13:07 +00:00
Adam Jackson 9f97f994c3 glx: Enable pure-client-library extensions explicitly
These are rare enough to not be worth tracking separately. Especially
since after this change all the known_gl_extensions have N for both
direct_support and direct_only (unsurprising, since that's only used to
compute usable indirect extensions).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10223>
2021-04-16 10:13:07 +00:00
Adam Jackson e5d3cfb597 glx: Remove redundant client_support field from extension table
It's always true, simplify accordingly.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10223>
2021-04-16 10:13:07 +00:00
Adam Jackson 3f6996acfd glx: Generalize __glXGetStringFromTable a little
Make the second argument optional, and treat its absence as if the
filter always matches.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10223>
2021-04-16 10:13:07 +00:00
Adam Jackson 2014e1fe05 glx: Remove some non-functional GL extension from the table
We don't actually have GLX protocol for these in Mesa, hence the initial
N column.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10223>
2021-04-16 10:13:07 +00:00
Adam Jackson 896c650b1b glx: Mark GLX_{ATI_pixel_format_float,NV_float_buffer} as supported
... at least as far as libGL is concerned, because they'd work just fine
if you tried. The only thing the ATI extension seems to add (I can't
find an official spec, this is inferred from the registry XML) is
selecting the GLX_RENDER_TYPE, which we don't validate before putting on
the wire. The only thing the NV extension adds is an additional fbconfig
attribute, and that only known by glXGetFBConfigAttrib; our
implementation of that just reads the value the server sends, if any,
and doesn't try to filter out unknown attributes.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10223>
2021-04-16 10:13:07 +00:00
Adam Jackson fcc9ce09d4 glx: Remove major/minor version tracking from extension table
With the previous ancient dead code removed, there's no longer anything
using these values.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10223>
2021-04-16 10:13:07 +00:00
Adam Jackson 6b6a1ef075 glx: Remove some truly ancient unused code
The "left here but disabled" comment dates to 2004! The idea here is to
add extensions implied by a particular GL version to the GL extension
string, but nothing useful is accomplished by doing so, and this is all
only used in the case of indirect rendering anyway.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10223>
2021-04-16 10:13:07 +00:00
Adam Jackson b2ecd0d589 glx: Remove silly __glXGetGLVersion() indirection
Hardcode the values at the one caller that uses them.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10223>
2021-04-16 10:13:07 +00:00
Samuel Pitoiset 66e1b42d06 radv: keep DCC compressed for clears on compute with image stores
Without image stores, DCC is always decompressed on compute.

Cc: 21.1 <mesa-stable@lists.freedesktop.org>
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/10168>
2021-04-16 09:47:52 +00:00
Marek Olšák 84895dba7f amd: remove some references to older LLVM versions in comments
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10199>
2021-04-16 09:25:19 +00:00
Marek Olšák b878444c3a amd: drop support for LLVM 10
It doesn't support RDNA 2.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10199>
2021-04-16 09:25:19 +00:00
Marek Olšák 2747332723 amd: drop support for LLVM 9
This would be easy to support except that it doesn't support RDNA 2.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10199>
2021-04-16 09:25:19 +00:00
Samuel Pitoiset 936b58378c amd: drop support for LLVM 8
It doesn't support Navi1x and the removal enables this nice code cleanup.

v2: rebase - mareko

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> (v1)
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10199>
2021-04-16 09:25:19 +00:00
Matt Turner 566dc4d740 intel/eu: Add instruction compaction support on XeHP.
This patch includes a number of reworks and fixes squashed in by
Nanley Chery, Sagar Ghuge, Jordan Justen and Francisco Jerez.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10000>
2021-04-16 08:27:35 +00:00
Francisco Jerez a2572a9da4 intel/fs: Add more efficient fragment coordinate calculation.
The PIXEL_X/Y opcodes used by the current implementation are broken on
XeHP due to the new regioning restrictions of the floating-point pipe.
We could have the regioning lowering pass fix it in theory by lowering
the conversions into separate MOV instructions, but that would be more
costly than this implementation that only needs a pair of pipelined
ADDs and a pair of pipelined MOVs.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10000>
2021-04-16 08:27:35 +00:00
Francisco Jerez a0e0dfe174 intel/fs: Introduce lowering pass to implement derivatives in terms of quad swizzles.
Unfortunately the funky Align1 regions used by the code generator in
order to implement derivatives efficiently aren't available to the
floating-point pipeline on XeHP.  We need to lower them into a number
of pipelined integer shuffle instructions followed by the
floating-point difference computation.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10000>
2021-04-16 08:27:35 +00:00
Jordan Justen 635ed58e52 intel/compiler: Lower txd for 3D samplers on XeHP.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10000>
2021-04-16 08:27:35 +00:00
Jordan Justen 515ee73b4e intel/fs: End computer shader with message gateway on XeHP.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10000>
2021-04-16 08:27:35 +00:00
Jordan Justen 262cb08557 intel/fs: Disable 3-src immediates on XeHP.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>

[ Francisco Jerez: Add TODO comment explaining why this is helpful and
  how we could better fix it. ]

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10000>
2021-04-16 08:27:35 +00:00
Jordan Justen 02ce55d2b1 intel/eu: Allow 64-bit registers on XeHP.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10000>
2021-04-16 08:27:35 +00:00
Francisco Jerez 262b647b25 intel/compiler: Lower integer division on XeHP.
It has been removed from the hardware.

[jordan.l.justen@intel.com: Move to brw_postprocess_nir]

v2: Switch to nir_lower_idiv_precise (Rhys).
v3: Fix for interface changes of nir_lower_idiv.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10000>
2021-04-16 08:27:35 +00:00
Rafael Antognolli 49b2d9f428 intel/fs: Lower dword integer multiplies on XeHP.
From the BSpec:

 "When multiplying DW X DW, resulting dst can only be QW precision. If
 DW precision is required at output than MUL/MACH macro must be used."

So for now simply lower it. We might want to revisit it later.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10000>
2021-04-16 08:27:35 +00:00
Francisco Jerez 3f50dde8b3 intel/eu: Teach EU validator about FP/DP pipeline regioning restrictions.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10000>
2021-04-16 08:27:35 +00:00
Francisco Jerez f3e5cd813a intel/fs: Handle regioning restrictions of split FP/DP pipelines.
The floating-point and double-precision FPU pipelines of XeHP
platforms don't support arbitrary regioning modes, corresponding
channels of sources and destination are required to be aligned to the
same sub-register offset, similar to the restriction FP64 instructions
had on CHV/BXT platforms.

Most violations of this restriction can be fixed easily by teaching
has_dst_aligned_region_restriction() about the change so the regioning
lowering pass gets rid of any unsupported regioning.  For cases where
this is not sufficient (e.g. because a virtual instruction internally
uses some regioning mode not supported by the floating-point pipeline)
the regioning lowering pass is extended with an additional
lower_exec_type() codepath that bit-casts sources and destination to
an integer type whenever the execution type is not supported by the
instruction.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10000>
2021-04-16 08:27:35 +00:00
Francisco Jerez 0dc16965a9 intel/fs: Fix repclear assembly for XeHP+ regioning restrictions.
The regioning mode used here is no longer supported by the
floating-point pipeline.  We could run the regioning lowering pass in
order to fix it with some extra copies, but it's more efficient to
change the instruction to use integer types.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10000>
2021-04-16 08:27:35 +00:00
Francisco Jerez 05cce1f97d intel/fs: Use CHV/BXT implementation of 64-bit MOV_INDIRECT on XeHP+.
According to the hardware spec "Vx1 and VxH indirect addressing for
Float, Half-Float, Double-Float and Quad-Word data must not be used."

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10000>
2021-04-16 08:27:35 +00:00
Francisco Jerez d57f3ced6c intel/fs: Calculate SWSB cross-pipeline synchronization information.
In combination with the previous changes we can just check whether an
instruction has any potentially unsatisfied dependencies on more than
one pipeline, and if so use TGL_PIPE_ALL synchronization with an
appropriate RegDist counter, otherwise synchronize with the single
pipeline it has a dependency on, if any.

Only minor difficulty is caused by the fact that the hardware doesn't
have any way to encode pipeline information when a RegDist and an SBID
dependency need to be provided simultaneously, in which case the
synchronization pipeline is inferred by the hardware.  We need to
verify that the hardware's inference will give the correct result
(which may not be the case if e.g. some data was bit-cast from a
different type), and if not emit separate SYNC instructions instead of
baking the RegDist dependency into the instruction (Note that SET SBID
dependencies must always be baked into the corresponding out-of-order
instruction).

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10000>
2021-04-16 08:27:35 +00:00
Francisco Jerez 3f063334fc intel/fs: Represent SWSB in-order dependency addresses as vectors.
This extends the current ordered_address instruction counter to a
vector with one component per asynchronous ALU pipeline, allowing us
to track the last instruction that accessed a register separately for
each ALU pipeline of the XeHP EU, making it straightforward to
infer the right cross-pipeline synchronization annotations.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>

v2: Make unit tests happy (with ubsan as run by GitLab automation).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10000>
2021-04-16 08:27:35 +00:00
Jordan Justen 78b643fb7f Revert "intel/compiler: Silence unused parameter warning in update_inst_scoreboard"
This was a placeholder for the XeHP cross-pipeline synchronization
code, bring it back.

This reverts commit a80e44902f.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10000>
2021-04-16 08:27:35 +00:00
Francisco Jerez d4537770bb intel/fs: Add helper functions inferring sync and exec pipeline of an instruction.
Define two helper functions local to the software scoreboard lowering
pass describing the behavior of the hardware and code generator:
inferred_sync_pipe() calculates the ALU pipeline the hardware will
implicitly synchronize with when a RegDist SWSB annotation is used
without providing explicit pipeline synchronization information,
inferred_exec_pipe() infers the ALU pipeline that will execute the
instruction.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10000>
2021-04-16 08:27:35 +00:00
Francisco Jerez 12479abded intel/fs: Implement representation of SWSB cross-pipeline synchronization annotations.
The execution units of XeHP platforms have multiple asynchronous ALU
pipelines instead of (as far as software is concerned) the single
in-order pipeline that handled most ALU instructions except for
extended math in the original Xe.  It's now the compiler's
responsibility to identify cross-pipeline dependencies and insert
synchronization annotations whenever necessary, which are encoded as
some additional bits of the SWSB instruction field.

This commit represents the cross-pipeline synchronization annotations
as part of the existing tgl_swsb structure used for codegen.  The
existing tgl_swsb_*() helpers used by hand-crafted assembly are
extended to default to TGL_PIPE_ALL big-hammer synchronization in
order to ensure backwards compatibility with the existing assembly.
The following commits will extend the software scoreboard lowering
pass in order to keep track of cross-pipeline dependencies across IR
instructions, and insert more specific pipeline annotations in the
SWSB field.

The disassembler is also extended here to print out any existing
pipeline sync annotations.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10000>
2021-04-16 08:27:34 +00:00
Adam Jackson d53fc2240b glx/drisw: Enable GLX_ARB_create_context_no_error
Detect this the same way as we do for drihw.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9233>
2021-04-16 06:50:35 +00:00
Iago Toral Quiroga 1cf36797bf v3dv: fix sRGB blending workaround
This workaround needs to set a flag in the current job but it was
implemented at pipeline binding time, which can happen outside a
render pass. Move it to the pre-draw handler, where it belongs.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4645
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10255>
2021-04-16 06:05:59 +00:00
Yiwei Zhang 757a711f39 venus: fix virtgpu_bo_init_dmabuf for classic resource
1. only do size check if the input size is not 0
2. blob_mem can be 0 because guest minigbm uses RESOURCE_CREATE_3D
3. set bo->blob_flags to 0 for classic resource to fail virtgpu_bo_map

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10273>
2021-04-16 04:56:19 +00:00
Eric Anholt 23159f1a7a ci/freedreno: Skip some precision tests on a530.
These have flaked as Timeouts in CI in the last month.  .precision.* is
generally very slow (some in the 15s-30s range), but it's unclear to me
why they sometimes spike up to 60 seconds (thermal throttling?).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10274>
2021-04-16 04:34:14 +00:00
Eric Anholt afa965b7c5 ci/virgl: Mark a couple of new Crash tests as flakes.
These have shown up in CI runs since the deqp uprev.  Also, link the bug
report I made for one of the failing tests.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10274>
2021-04-16 04:34:14 +00:00
Alexander Shi 55fb9417a6 mesa: texparam: Add a clamping macro to handle out-of-range floats returned as integers.
The parameters GL_TEXTURE_MIN_LOD, GL_TEXTURE_MAX_LOD,
GL_TEXTURE_MAX_ANISOTROPY_EXT, GL_TEXTURE_LOD_BIAS are stored as floats but
returned as integers. Setting their values outside of the integer range results
has undefined behaviour when the c-runtime method lroundf converts the value
back to an integer.

Fixes: 53c36dfc('replace IROUND with util functions')
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10244>
2021-04-16 01:44:16 +00:00
Adam Jackson 31dba8d51b gallium/xlib: Fix for recent gl_config changes
This mirrors the changes needed elsewhere for parts of !9817:

Fixes: 4daef7ffe3 mesa: Remove redundant gl_config::sampleBuffers
Fixes: 4fbe1cbe4c mesa: Stop tracking visual rating in gl_config
Fixes: d21b8afa3d mesa: Remove the pretense of aux buffer support
Fixes: 78dfab95b8 mesa: Remove unused gl_config::level
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4544
Acked-by: Eric Anholt <eric@anholt.net>
Tested-by: Jan Zielinski <jan.zielinski@intel.com>
Acked-by: Jan Zielinski <jan.zielinski@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10050>
2021-04-16 00:56:15 +00:00
Icecream95 3af12216e3 panfrost: Unset shared/scanout binding flags for staging resources
Fixes Xwayland crashes when starting non-GL applications.

Fixes: e00d94f14f ("panfrost: Enable AFBC buffer sharing")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10266>
2021-04-15 23:12:30 +00:00
Icecream95 716ce3cc1a panfrost: Assert staging resource allocation was successful
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10266>
2021-04-15 23:12:30 +00:00
Adam Jackson fc9b3b260e Revert "glx: Lift sending the MakeCurrent request to top-level code"
This provokes crashes in Cinnamon for some reason that I haven't
diagnosed yet.

This reverts commit 80b67a3b44.

Fixes: 80b67a3b44 glx: Lift sending the MakeCurrent request to top-level code
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4639
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10260>
2021-04-15 19:48:10 +00:00
Yiwei Zhang d148540e5a venus: cap api version to 1.1 for Android
Android hasn't officially adopted 1.2 yet, so we just cap it to avoid
troubles(e.g. vkjson doesn't like 1.2 atm).

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10258>
2021-04-15 18:31:31 +00:00
Eric Anholt 7d234da6ee freedreno: Fix YUV sampler regression.
We have to keep sampler uniforms around for later YUV lowering, and we
only need to remove uniforms that take up storage space.  Code comes from
radeonsi.

Closes: #4644.
Fixes: de17b4aab5 ("freedreno: Remove uniform variables after finalizing NIR.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10246>
2021-04-15 16:20:15 +00:00
Michel Dänzer bf480cc9c2 osmesa: Replace default case FALLTHROUGH annotation by following return
Avoids warning about the annotation with GCC 10:

../src/gallium/frontends/osmesa/osmesa.c: In function ‘osmesa_choose_format’:
../src/util/compiler.h:84:21: warning: attribute ‘fallthrough’ not preceding a case label or default label
   84 | #define FALLTHROUGH __attribute__((fallthrough))
      |                     ^~~~~~~~~~~~~
../src/gallium/frontends/osmesa/osmesa.c:316:7: note: in expansion of macro ‘FALLTHROUGH’
  316 |       FALLTHROUGH;
      |       ^~~~~~~~~~~

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10220>
2021-04-15 16:01:22 +00:00
Michel Dänzer d200f45875 Use explicit break instead of fall-through to break-only case
clang generates a warning if there's no explicit break or fall-through
annotation. The latter would be kind of silly in this case, and not
robust against any future changes turning the fall-through invalid.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10220>
2021-04-15 16:01:22 +00:00
Michel Dänzer 8d4c31b3c7 iris: Drop unneeded default switch case
Avoids clang warning about the fall-through annotation.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10220>
2021-04-15 16:01:22 +00:00
Michel Dänzer a8a88a8d39 llvmpipe: Drop switch with only default case
Replace it with the default case contents.

Avoids clang warning about the fall-through annotation.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10220>
2021-04-15 16:01:22 +00:00
Michel Dänzer 9ef5372441 Guard FALLTHROUGH annotations after assert()
clang warns if it can determine that the assert() never returns and
there's a fall-through annotation below.

Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10220>
2021-04-15 16:01:22 +00:00
Michel Dänzer 2928c21eb7 Convert most remaining free-form fall-through comments to FALLTHROUGH
One exception is src/amd/addrlib/, for which -Wimplicit-fallthrough is
explicitly disabled.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10220>
2021-04-15 16:01:22 +00:00
Michel Dänzer 96f0f46350 util: Remove unused Android options_tbl_lock
Avoids warning:

../src/util/os_misc.c:132:21: error: unused variable 'options_tbl_lock' [-Werror,-Wunused-variable]
static simple_mtx_t options_tbl_lock = _SIMPLE_MTX_INITIALIZER_NP;
                    ^

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10220>
2021-04-15 16:01:21 +00:00
Michel Dänzer 7e5911846e lima/ppir: Cast pointer to uintptr_t instead of uint64_t
Avoids warnings on armhf:

./src/gallium/drivers/lima/ir/pp/nir.c: In function 'ppir_get_block':
../src/gallium/drivers/lima/ir/pp/nir.c:554:66: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
    ppir_block *block = _mesa_hash_table_u64_search(comp->blocks, (uint64_t)nblock);
                                                                  ^
../src/gallium/drivers/lima/ir/pp/nir.c: In function 'ppir_compile_nir':
../src/gallium/drivers/lima/ir/pp/nir.c:899:52: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
          _mesa_hash_table_u64_insert(comp->blocks, (uint64_t)nblock, block);
                                                    ^

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10220>
2021-04-15 16:01:21 +00:00
Connor Abbott cf727e6ba4 tu: Expose VK_EXT_robustness2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7573>
2021-04-15 16:05:13 +02:00
Connor Abbott 0fb14420da tu: Handle null descriptors
Writing all 0's, including for the format, seems to work. Actually
setting the format seems to break textureSize() (getsize returns 1 for
some reason).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7573>
2021-04-15 16:05:13 +02:00
Connor Abbott f58ece08da tu: Handle robust UBO behavior for pushed UBO ranges
If we push a UBO range but then find out at draw-time that part of the
pushed range is out of range of the UBO descriptor, then we have to fill
in the rest of the range with 0's to mimic the bounds-checking that ldc
would've done.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7573>
2021-04-15 16:05:13 +02:00
Connor Abbott cb02a48f83 tu: Correctly preserve old push descriptor contents
We were never setting set->size, so we were always copying 0 bytes. But
as we only copy the contents when the layout and therefore the size is
the same, we don't have to take the old size into account anyway.

This fixes some VK_EXT_robustness2 tests that use push descriptors.

Fixes: 6d4f33e ("turnip: initial implementation of VK_KHR_push_descriptor")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7573>
2021-04-15 16:05:13 +02:00
Connor Abbott c68ea960a7 ir3, tu: Add compiler flag for robust UBO behavior
This needs to be part of the compiler because it's the only piece that
we always have access to in all the places ir3_optimize_loop() is
called, and it's only enabled for the whole Vulkan device. Right now
it's just used for constraining vectorization, but the next commit adds
another use.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7573>
2021-04-15 16:05:11 +02:00
Connor Abbott 8f54028479 ir3: Reduce max const file indirect offset base to 9 bits
This fixes
dEQP-VK.robustness.robustness2.bind.notemplate.r32i.dontunroll.nonvolatile.uniform_buffer.no_fmt_qual.len_260.samples_1.1d.frag,
which accesses the shader UBO with c<a0.x + 512> due to the constant
data UBO coming before it in the const file. The len_256 variant has a
smaller constant data UBO, so it uses c<a0.x + 256> instead, and that
works, so 512 seems to be the real limit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7573>
2021-04-15 16:03:54 +02:00
Connor Abbott 8e11f0560e ir3: Fix list corruption in legalize_block()
We forgot to remove the instruction under consideration from instr_list
before inserting it into the block's list, which caused instr_list to
become corrupted. This happened to work but caused further corruption in
some rare scenarios.

Fixes: adf1659 ("freedreno/ir3: use standard list implementation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7573>
2021-04-15 16:03:54 +02:00
Gustavo Padovan f601fd635b gitlab-ci: enable Intel AML-Y as experimental
The LAVA lab has been running well with the rammus chromebook for some
time now. Let's add it to MesaCI as experimental to get more testing,
and later enable it in production.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10238>
2021-04-15 13:03:19 +00:00
Gustavo Padovan e8bc0a28a4 traces-iris: fix expectation for Intel GLK
glmark2/buffer-columns=200:interleave=true:update-dispersion=0.9:upd...
was missing the expectation checksum.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10238>
2021-04-15 13:03:19 +00:00
Iago Toral Quiroga bed3f31fc6 v3dv: don't use a dedicated BO for each occlusion query
Dedicated BOs waste memory and are also a significant cause of CPU
overhead when applications use hundreds of them per frame due to
all the work the kernel has to do to page in all these BOs for a job.
The UE4 Vehicle demo was hitting this causing it to freeze and stutter
under 1fps.

The hardware allows us to setup groups of 16 queries in consecutive
4-byte addresses, requiring only that each group of 16 queries is
aligned to a 1024 byte boundary. With this change, we allocate all
the queries in a pool in a single BO and we assign them different
offsets based on the above restriction. This eliminates the freezes
and stutters in the Vehicle sample.

One caveat of this solution is that we can only wait or test for
completion of a query by testing if the GPU is still using its BO,
which basically means that we can only wait for all active queries
in a pool to complete and not just the ones being requested by the
API. Since the Vulkan recommendation is to use a different query
pool per frame this should not be a big issue though.

If this ever becomes a problem (for example if an application does't
follow the recommendation and instead allocates a single pool and
splits its queries between frames), we could try to group queries
in a pool into a number of BOs to try and find a balance, but for
now this should work fine in most cases.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10253>
2021-04-15 12:45:07 +00:00
Mike Blumenkrantz cca616ebd5 zink: export PIPE_CAP_SAMPLER_REDUCTION_MINMAX_ARB
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10248>
2021-04-15 12:35:09 +00:00
Mike Blumenkrantz 92f5006814 zink: handle minmax sampler creation for VK_EXT_sampler_filter_minmax
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10248>
2021-04-15 12:35:09 +00:00
Mike Blumenkrantz 22e1ed5722 zink: support format queries for VK_EXT_sampler_filter_minmax
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10248>
2021-04-15 12:35:09 +00:00
Mike Blumenkrantz b62633c599 zink: hook up VK_EXT_sampler_filter_minmax
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10248>
2021-04-15 12:35:09 +00:00
Rhys Perry ec70882238 radv: fix barrier in radv_decompress_dcc_compute shader
ACO doesn't create a waitcnt for barriers between texture samples and
image stores because texture samples are supposed to use read-only
memory. It could also schedule the barrier to above the texture sample.
We also have use a larger memory scope to avoid an ACO optimization.

Tested on GFX8 with Sachsa Willems deferred sample. With some DCC
decompressions and the compute path forced.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: 21.1 <mesa-stable>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9496>
2021-04-15 12:02:36 +00:00
Hans-Kristian Arntzen 08fdaec473 radv: Allocate buffer list for MUTABLE descriptor types as well.
Fixes: 86644b84b9 ("radv: Implement VK_VALVE_mutable_descriptor_type.")
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10132>
2021-04-15 11:51:33 +00:00
Hans-Kristian Arntzen b60bc59180 radv: Take image alignment into account when allocating MUTABLE pool.
Allocating a descriptor set is aligned to 32 bytes, so just like the
other buffer types, bump the descriptor size to 32 bytes when allocating
MUTABLE descriptor types from a pool.

Fixes: 86644b84b9 ("radv: Implement VK_VALVE_mutable_descriptor_type.")
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10132>
2021-04-15 11:51:33 +00:00
Karol Herbst f945cca983 clover/llvm: handle Fixed vs Scalable vectors explicitly starting with llvm-11
This fixes compilation with llvm-13.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4200
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/9973>
2021-04-15 11:39:47 +00:00
Iago Toral Quiroga 917049e7d6 v3dv: fix array sizes when tracking BOs during uniform setup
The resource indices we get point to descriptor map entries that include
all shader stages, so we need to size the arrays to account for more than
just one stage.

For now we only support up to 2 stages in a pipeline, so we use that.

Fixes: 002304482c ('v3dv: avoid redundant BO job additions for UBO/SSBO')
Fixes: fa170dab4c ('v3dv: avoid redundant BO job additions for textures and samplers')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10252>
2021-04-15 11:26:04 +00:00
Iago Toral Quiroga e7e8464d94 v3dv: fix descriptor set limits
There were various issues here:
   - MAX_DYNAMIC_UNIFORM_BUFFERS was larger than MAX_UNIFORM_BUFFERS.
   - In some cases we were exposing more than the minimums required.
     While that is not incorrect, it is not following what we have
     been doing in general.
   - The Vulkan spec states that some of the MaxDescriptorSet limits
     need to be multipled by 6 to include all shader stages, even
     if the implementation doesn't support all shader stages.

Fixes: cbd299b051 ('v3dv/device: do not compute per-pipeline limits multiplying per-stage')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10252>
2021-04-15 11:26:04 +00:00
Alejandro Piñeiro a0152c5948 v3dv/debug: use gl stage when checking debug flag
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10229>
2021-04-15 10:29:44 +00:00
Alejandro Piñeiro 98698c4d01 v3dv/debug: print correct stage name
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10229>
2021-04-15 10:29:44 +00:00
Eric Anholt 6d510fd473 ci/freedreno: Merge a630 piglit to a single job.
piglit_gl clocked in at 6:12 end-to-end runtime, and piglit_shader spent
2:53 in deqp-runner, so merging them together should be about 9 minutes.
Removing a boot should save us a minute or two of runner time per
pipeline.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10243>
2021-04-15 10:06:14 +00:00
Simon Ser 35e25ea1d0 ac/surface: allow non-DCC modifiers for YUV on GFX9+
Accept non-linear tiling for multi-planar formats on GFX9+, as long
as DCC is disabled. DCC support is possible in theory, but untested
for now.

GFX8 is still restricted to linear tiling because it's not yet clear
how modifiers should be handled on these chips for multi-planar
formats. Each plane may need a different modifier.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10134>
2021-04-15 09:43:17 +00:00
Simon Ser 979e138695 radeonsi: stop special-casing YUV formats in si_query_dmabuf_modifiers
Instead of having a special case for YUV formats in
si_query_dmabuf_modifiers, let ac_get_supported_modifiers handle
them. Keep setting external_only = 1 for YUV formats, since we
can only sample from such formats (we can't use them as render
targets).

This shouldn't change si_query_dmabuf_modifiers's behavior, because
for YUV formats ac_get_supported_modifiers will return a single
LINEAR modifier.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10134>
2021-04-15 09:43:17 +00:00
Simon Ser 19378dfe3c ac/surface: use blocksizebits instead of blocksize
util_format_get_blocksize asserts that the blocksize isn't zero.
However the blocksize will be zero if the format's channel encoding
is unspecified. The channel encoding is only meaningful for the
plain u_format layout, so util_format_get_blocksize can't be used
for formats with another layout. For example, YUV formats don't have
the channel encoding specified.

Use util_format_get_blocksizebits, which just returns zero without
an assertion for formats which don't have a channel encoding.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10134>
2021-04-15 09:43:17 +00:00
Simon Ser 6e697b595f util/format: document block depth field
After the pixel block width and height, a third field is used to
store the pixel block depth. Document this field.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10134>
2021-04-15 09:43:17 +00:00
Simon Ser b26a546b2f radeon/vcn: handle tiled buffers when decoding
Set the swizzle mode when decoding.

Add a safe-guard to make sure the provided surface isn't DCC, because
we don't handle this situation.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10134>
2021-04-15 09:43:17 +00:00
Samuel Iglesias Gonsálvez 029bc53be6 turnip: fix typo in tu_CmdBeginRenderPass2()
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8615>
2021-04-15 09:51:25 +02:00
Samuel Iglesias Gonsálvez d52917f858 turnip/lrz: added support for depth bounds test enable
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8615>
2021-04-15 09:51:25 +02:00
Samuel Iglesias Gonsálvez 2161aebf8d turnip: document GRAS_LRZ_CNTL's UNK5 bitfield
It is used by the blob to enable depth bounds test for LRZ.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8615>
2021-04-15 09:51:25 +02:00
Samuel Iglesias Gonsálvez 54cf12774a turnip/lrz: add support for VK_EXT_extended_dynamic_state
When the depth or stencil state changes dynamically, that might affect
LRZ state and we need to recalculate it and emit it again.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8615>
2021-04-15 09:51:20 +02:00
Samuel Iglesias Gonsálvez 6d6cbb7361 turnip: refactor how LRZ state is calculated
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8615>
2021-04-15 09:50:51 +02:00
Samuel Iglesias Gonsálvez 43ebba4e88 turnip: initialize pipeline->rb_{stencil,depth}_cntl always
This change will simplify further changes on LRZ state management.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8615>
2021-04-15 09:50:51 +02:00
Samuel Iglesias Gonsálvez 1f9fb7677b turnip: move pipeline gras_su and rb{stencil,depth}_cntl_mask initialization
Move them up, so they are initialized even when the dynamic state is
not used.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8615>
2021-04-15 09:50:51 +02:00
Iago Toral Quiroga b8403192ed v3dv: use a bitfield to implement a quick check for job BO tracking
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10210>
2021-04-15 06:09:34 +00:00
Iago Toral Quiroga 9e76240f84 v3dv: optimize a few cases of BO job additions
In these cases we know that the BO has not been added to the job
before, so we can skip the usual process for adding the BO where
we check if we had already added it before to avoid duplicates.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10210>
2021-04-15 06:09:34 +00:00
Iago Toral Quiroga 493a316e40 v3dv: avoid redundant BO job additions for spill / shared BOs
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10210>
2021-04-15 06:09:34 +00:00
Iago Toral Quiroga 002304482c v3dv: avoid redundant BO job additions for UBO/SSBO
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10210>
2021-04-15 06:09:34 +00:00
Iago Toral Quiroga fa170dab4c v3dv: avoid redundant BO job additions for textures and samplers
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10210>
2021-04-15 06:09:34 +00:00
Felix DeGrood e7ea5e500f intel/blorp: remove tile flush from emit surface state
Tile cache flush not required when emitting new surface state.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10217>
2021-04-15 04:54:40 +00:00
Felix DeGrood c85ea824bc iris: reduce redundant tile cache flushes
We are flushing tile cache more often than is necessary. In
unified cache mode, tile cache flushing is expensive, evicting all
depth/pixel data from the L3$. This is only need for a handful of
cases, such as: making cpu or gpu changes globally visible
(e.g. map), fast color clears, or slow depth clears. Tile cache
flushing is a gen12+ feature.

Remove blanket flushing of tile cache on all depth/RT flushes.
Replace with selective tile cache flushing.

Improves performance in several workloads:
AztecRuins.ogl-high-offscreen-1440p 1%
UnigineValley.ogl-g2                1%
Dota 2 (replay Jul 2020).ogl-g2     1%
Counter-Strike GO.ogl-g2            1%
Manhattan.ogl-Off-19x10             2%
CarChase.ogl-Off-19x10              1%
Bioshock Infinite.ogl-g2            1%

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10217>
2021-04-15 04:54:40 +00:00
Kenneth Graunke bfe2c5f667 iris: only flush the render cache for aux changes, not format changes
Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10217>
2021-04-15 04:54:40 +00:00
Felix DeGrood ed8f2c4cbe iris: Cache VB/IB in L3$ for Gen12
Gen12 enables caching of Vertex and Index Buffers in L3.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10217>
2021-04-15 04:54:40 +00:00
Felix DeGrood ed94528711 intel: add L3 Bypass Disable to gen xml
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10217>
2021-04-15 04:54:40 +00:00
Mike Blumenkrantz 376c878c16 mesa/st: plumb GL_TEXTURE_REDUCTION_MODE_ARB through QueryInternalFormat
enable per-format querying of texture_filter_minmax support if the ARB extension
is enabled

also now return 0 if neither extension is supported

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10030>
2021-04-15 01:20:40 +00:00
Mike Blumenkrantz b122beaff3 gallium: split PIPE_CAP_SAMPLER_REDUCTION_MINMAX into modes
this enables detection for the EXT vs the ARB extension, which have
different specifications regarding which formats must be supported

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10030>
2021-04-15 01:20:40 +00:00
Mike Blumenkrantz 59ad872458 gallium: add PIPE_BIND_SAMPLER_REDUCTION_MINMAX
for querying format support

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10030>
2021-04-15 01:20:40 +00:00
Yiwei Zhang 1932207902 venus: implement dma_buf fd import and properties query
This change is for supporting VK_ANDROID_native_buffer implementation,
and it does not advertise VK_KHR_external_memory_fd.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10195>
2021-04-15 00:58:00 +00:00
Yiwei Zhang 001549c92c venus: update venus-protocol headers
Add support for external memory fd properties query and import
- vkGetMemoryResourcePropertiesMESA
- VkImportMemoryResourceInfoMESA
- VkMemoryResourcePropertiesMESA

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10195>
2021-04-15 00:58:00 +00:00