platform/upstream/mesa.git
3 years agoglsl: fix int16 type
Erik Faye-Lund [Fri, 9 Apr 2021 05:22:53 +0000 (07:22 +0200)]
glsl: fix int16 type

This shouldn't be unsigned, or else we'll trigger asserts.

Fixes: 7f00d4dac81 ("glsl: Handle 16-bit types in loop analysis")
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10125>

3 years agoglsl: fix is_integer_16_32
Erik Faye-Lund [Fri, 9 Apr 2021 05:15:36 +0000 (07:15 +0200)]
glsl: fix is_integer_16_32

This shouldn't check for 64-bit...

Fixes: a052a9c2777 ("glsl: handle int16 and uint16 types and add instructions for mediump")
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10125>

3 years agopanfrost: Only do point coord replacement for PIPE_PRIM_POINTS
Icecream95 [Sat, 10 Apr 2021 03:28:15 +0000 (15:28 +1200)]
panfrost: Only do point coord replacement for PIPE_PRIM_POINTS

Fixes rendering in Terraria on Midgard.

Thanks to macc24 for reporting this and to HdkR for pointing me to a
similar issue for virgl.

Cc: mesa-stable
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10154>

3 years agoanv: Use vk_object_alloc/free
Jason Ekstrand [Thu, 8 Apr 2021 21:12:27 +0000 (16:12 -0500)]
anv: Use vk_object_alloc/free

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10123>

3 years agovulkan: Add a vk_object_multialloc helper
Jason Ekstrand [Thu, 8 Apr 2021 21:46:04 +0000 (16:46 -0500)]
vulkan: Add a vk_object_multialloc helper

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10123>

3 years agoanv: Clean up anv_semaphore::base on the error path
Jason Ekstrand [Thu, 8 Apr 2021 21:40:45 +0000 (16:40 -0500)]
anv: Clean up anv_semaphore::base on the error path

Fixes: 682c81bdfb7 "vulkan,anv: Add a base object struct type"
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10123>

3 years agoanv: Clean up anv_descriptor_pool::base on the error path
Jason Ekstrand [Thu, 8 Apr 2021 21:27:02 +0000 (16:27 -0500)]
anv: Clean up anv_descriptor_pool::base on the error path

Fixes: 682c81bdfb7 "vulkan,anv: Add a base object struct type"
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10123>

3 years agoanv: Refactor framebuffer creation
Jason Ekstrand [Thu, 8 Apr 2021 21:17:22 +0000 (16:17 -0500)]
anv: Refactor framebuffer creation

This avoids having the create call duplicated.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10123>

3 years agoanv: Clean up anv_device_memory::base on failure
Jason Ekstrand [Thu, 8 Apr 2021 21:10:26 +0000 (16:10 -0500)]
anv: Clean up anv_device_memory::base on failure

Fixes: 682c81bdfb7 "vulkan,anv: Add a base object struct type"
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10123>

3 years agoradv: Update editorconfig.
Bas Nieuwenhuizen [Thu, 8 Apr 2021 00:54:40 +0000 (02:54 +0200)]
radv: Update editorconfig.

Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10091>

3 years agoradv: Format.
Bas Nieuwenhuizen [Sat, 10 Apr 2021 01:24:05 +0000 (03:24 +0200)]
radv: Format.

Using

find ./src/amd/vulkan -regex '.*/.*\.\(c\|h\|cpp\)' | xargs -P8 -n1 clang-format --style=file -i

Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10091>

3 years agoradv: Add clang-format for AMD code.
Bas Nieuwenhuizen [Wed, 7 Apr 2021 20:52:55 +0000 (22:52 +0200)]
radv: Add clang-format for AMD code.

Copied from https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8883
with increased colum width as 80 really made a mess.

Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10091>

3 years agopanfrost: Flush output after disassembling shaders
Icecream95 [Wed, 7 Apr 2021 11:51:01 +0000 (23:51 +1200)]
panfrost: Flush output after disassembling shaders

Fixes text printed to stderr appearing in the middle of disassembly
when piping stdout and stderr to the same place.

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

3 years agoandroid: anv: fix build error in anv_android.c
Mauro Rossi [Thu, 8 Apr 2021 21:32:14 +0000 (23:32 +0200)]
android: anv: fix build error in anv_android.c

Fixes the following building error:

external/mesa/src/intel/vulkan/anv_android.c:568:13: error: no member named 'stride' in 'struct anv_image_create_info'
   anv_info.stride = gralloc_info->stride *
   ~~~~~~~~ ^
1 error generated.

Fixes: afd2f489d338 ("anv: Drop unused anv_image_create_info::stride")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10119>

3 years agoandroid: anv: Remove anv_intel.c from Makefile.sources
Mauro Rossi [Thu, 8 Apr 2021 21:29:12 +0000 (23:29 +0200)]
android: anv: Remove anv_intel.c from Makefile.sources

Fixes the following building error:

clang: error: no such file or directory: 'external/mesa/src/intel/vulkan/anv_intel.c'
clang: error: no input files

Fixes: 5e6db1916860 "anv: Remove vkCreateDmaBufINTEL (v4)"
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10119>

3 years agoci: enable venus in some meson build jobs
Chia-I Wu [Fri, 9 Apr 2021 04:01:58 +0000 (21:01 -0700)]
ci: enable venus in some meson build jobs

Enable it in meson-{android,clang,vulkan,i386}.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10124>

3 years agoetnaviv: remove stale comment in etna_resource_copy_region
Lucas Stach [Fri, 26 Feb 2021 20:48:42 +0000 (21:48 +0100)]
etnaviv: remove stale comment in etna_resource_copy_region

The comment about using the RS engine was correct before the code got
changed to use the 3D blitter and a fallback before etnaviv was merged
into upstream Mesa. It has been incorrect ever since. As it's just
adding confusion, instead of being helpful, remove it.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9310>

3 years agoetnaviv: don't try to copy PIPE_BUFFER with the 3D engine
Lucas Stach [Fri, 26 Feb 2021 20:28:20 +0000 (21:28 +0100)]
etnaviv: don't try to copy PIPE_BUFFER with the 3D engine

PIPE_BUFFER layout is incompatible with the 3D pipe, so don't try to
blit it via a 3D engine blit, but fall back to the software copy.

Fixes crashes in piglit tests arb_copy_buffer and arb_map_buffer_range.

Fixes: c9e8b49b8852 (etnaviv: gallium driver for Vivante GPUs)
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9310>

3 years agovenus: include individual venus-protcol headers
Chia-I Wu [Thu, 8 Apr 2021 00:53:44 +0000 (17:53 -0700)]
venus: include individual venus-protcol headers

Include individual headers than vn_protocol_driver.h to save compile
time.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10117>

3 years agovenus: split out vn_queue.[ch]
Chia-I Wu [Thu, 8 Apr 2021 00:44:41 +0000 (17:44 -0700)]
venus: split out vn_queue.[ch]

Move VkQueue, VkFence, VkSemaphore, and VkEvent functions to the new
files.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10117>

3 years agovenus: split out vn_device_memory.[ch]
Chia-I Wu [Thu, 8 Apr 2021 00:30:54 +0000 (17:30 -0700)]
venus: split out vn_device_memory.[ch]

Move VkDeviceMemory functions to the new files.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10117>

3 years agovenus: split out vn_image.[ch]
Chia-I Wu [Thu, 8 Apr 2021 00:27:26 +0000 (17:27 -0700)]
venus: split out vn_image.[ch]

Move VkImage{,View} and VkSampler{,YcbcrConversion} functions to the new
files.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10117>

3 years agovenus: split out vn_buffer.[ch]
Chia-I Wu [Thu, 8 Apr 2021 00:25:40 +0000 (17:25 -0700)]
venus: split out vn_buffer.[ch]

Move VkBuffer{,View} functions to the new files.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10117>

3 years agovenus: split out vn_descriptor_set.[ch]
Chia-I Wu [Wed, 7 Apr 2021 23:48:25 +0000 (16:48 -0700)]
venus: split out vn_descriptor_set.[ch]

Move VkDescriptor{Pool,Set,SetLayout,UpdateTemplate} functions to the
new files.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10117>

3 years agovenus: split out vn_render_pass.[ch]
Chia-I Wu [Wed, 7 Apr 2021 23:42:37 +0000 (16:42 -0700)]
venus: split out vn_render_pass.[ch]

Move VkRenderPass and VkFramebuffer functions to the new files.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10117>

3 years agovenus: split out vn_query_pool.[ch]
Chia-I Wu [Wed, 7 Apr 2021 23:37:33 +0000 (16:37 -0700)]
venus: split out vn_query_pool.[ch]

Move VkQueryPool functions to the new files.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10117>

3 years agovenus: split out vn_pipeline.[ch]
Chia-I Wu [Wed, 7 Apr 2021 23:29:38 +0000 (16:29 -0700)]
venus: split out vn_pipeline.[ch]

Move VkShaderModule and VkPipeline{,Layout,Cache} functions to the new
files.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10117>

3 years agovenus: split out vn_command_buffer.[ch]
Chia-I Wu [Wed, 7 Apr 2021 22:19:46 +0000 (15:19 -0700)]
venus: split out vn_command_buffer.[ch]

Move VkCommand{Pool,Buffer} functions to the new files.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10117>

3 years agovenus: prepare for splitting vn_device.[ch]
Chia-I Wu [Wed, 7 Apr 2021 22:26:15 +0000 (15:26 -0700)]
venus: prepare for splitting vn_device.[ch]

Make virtqueue/ring sync functions available to other files.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10117>

3 years agovenus: update venus-protocol headers
Chia-I Wu [Wed, 7 Apr 2021 22:01:06 +0000 (15:01 -0700)]
venus: update venus-protocol headers

This takes vn_protocol_driver_{structs,commands,calls}.h and split them
by Vulkan handle types.  This enables us to split up vn_device.c in the
following commits without slowing down compile time too much.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10117>

3 years agoir3/postsched: Make sure to schedule inputs before kill
Connor Abbott [Thu, 25 Feb 2021 10:14:53 +0000 (11:14 +0100)]
ir3/postsched: Make sure to schedule inputs before kill

Before, we would prefer to schedule inputs before kills, which works
assuming that the live range of the bary_ij system value don't get
split and therefore all bary.f are ready at the start of the block.
However live range splitting can mess up that assumption and cause a
kill to get scheduled before a move that leads to a bary.f.

This fixes even e.g. dEQP-GLES2.functional.shaders.discard.basic_always
on a3xx before introducing CSE of collect instructions, but even after
that it could be a problem theoretically as the register allocator
doesn't guarantee that any live ranges aren't split.

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

3 years agoanv: fix debugoptimized build compile
Mike Blumenkrantz [Fri, 9 Apr 2021 15:35:59 +0000 (11:35 -0400)]
anv: fix debugoptimized build compile

this function is only needed for asserts

Fixes: 2e4c153c6ba ("anv/image: Refactor check_memory_bindings()")

fixes #4599

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

3 years agodri: Use __DRI_BUFFER_COUNT consistently internally
Adam Jackson [Thu, 8 Apr 2021 22:46:02 +0000 (18:46 -0400)]
dri: Use __DRI_BUFFER_COUNT consistently internally

These arrays were all sized with insufficiently large magic numbers,
which is probably not a good idea.

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

3 years agozink: don't lose existing pNext when using wsi_image_create_info in image creation
Mike Blumenkrantz [Fri, 9 Apr 2021 14:43:59 +0000 (10:43 -0400)]
zink: don't lose existing pNext when using wsi_image_create_info in image creation

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

3 years agoegl/haiku: Fix ConfigID naming inline with mesa
Alexander von Gluck IV [Sun, 7 Mar 2021 22:57:17 +0000 (16:57 -0600)]
egl/haiku: Fix ConfigID naming inline with mesa

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9454>

3 years agomeson: Refuse to build lavapipe without llvmpipe
Jesse Natalie [Thu, 8 Apr 2021 16:33:46 +0000 (09:33 -0700)]
meson: Refuse to build lavapipe without llvmpipe

This config doesn't work, and as of recently it no longer links.
Let's fail it early.

Fixes: 7b79db11c2e ("lavapipe: enable correct workgroup sizing")
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10107>

3 years agoir3: Don't count (nopX) towards the wrong category
Matt Turner [Thu, 8 Apr 2021 20:31:14 +0000 (20:31 +0000)]
ir3: Don't count (nopX) towards the wrong category

Prior to this commit

   (nop3) mad.f32 r0.y, c0.x, r1.w, c0.y

was counted as 4 cat3 instructions (and still 3 cat0/nops) in shader-db
results. With this change, it is counted as only 1 cat3 instruction.

Probably never going to have better shader-db results than this in my
career:

total cat2 in shared programs: 1214667 -> 732058 (-39.73%)
cat2 in affected programs: 1194729 -> 712120 (-40.39%)
helped: 8551
HURT: 0

total cat3 in shared programs: 376448 -> 274745 (-27.02%)
cat3 in affected programs: 344918 -> 243215 (-29.49%)
helped: 7222
HURT: 0

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

3 years agozink: only unmap PIPE_MAP_ONCE in synchronous mode
Mike Blumenkrantz [Thu, 8 Apr 2021 18:52:47 +0000 (14:52 -0400)]
zink: only unmap PIPE_MAP_ONCE in synchronous mode

this flag cannot be used to infer that a transfer_map call will be matched
by a transfer_unmap call when tc reordering is active

fixes #4600

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

3 years agozink: handle checking batch completion from other contexts without timelines
Mike Blumenkrantz [Thu, 8 Apr 2021 14:08:00 +0000 (10:08 -0400)]
zink: handle checking batch completion from other contexts without timelines

if a batch state can't be found, it may exist on a different context, so the screen
value needs to be checked

if the screen value indicates that the batch hasn't completed and we're waiting,
force a flush so there's a fence that can be waited upon

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

3 years agozink: make timeline semaphores per-screen
Mike Blumenkrantz [Thu, 8 Apr 2021 14:52:55 +0000 (10:52 -0400)]
zink: make timeline semaphores per-screen

I misread the spec, and it turns out timeline ids can't be reused across
semaphores. This is obvious in retrospect, but what can be done?

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

3 years agoradv: allow to force VRS rates on GFX10.3 with RADV_FORCE_VRS
Samuel Pitoiset [Tue, 19 Jan 2021 15:12:01 +0000 (16:12 +0100)]
radv: allow to force VRS rates on GFX10.3 with RADV_FORCE_VRS

This allows to force the VRS rates via RADV_FORCE_VRS, the supported
values are 2x2, 1x2 and 2x1. This supports the primitive shading rate
mode for non GUI elements.

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

3 years agoradv: use explicit VRS mode when configuring PA_CL_VRS_CNTL
Samuel Pitoiset [Tue, 19 Jan 2021 13:58:59 +0000 (14:58 +0100)]
radv: use explicit VRS mode when configuring PA_CL_VRS_CNTL

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

3 years agomicrosoft: fixup clc_log() define
Lionel Landwerlin [Fri, 9 Apr 2021 11:58:19 +0000 (14:58 +0300)]
microsoft: fixup clc_log() define

The local msg variable shadows one of the argument of
SPIRVMessageConsumer making the error message "(null)".

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10133>

3 years agobroadcom/compiler: rename unifa tracking fields
Iago Toral Quiroga [Thu, 8 Apr 2021 07:08:20 +0000 (09:08 +0200)]
broadcom/compiler: rename unifa tracking fields

The term 'last' may be misleading because the offset represents
the current unifa offset, which is the offset used by the last
load plus 4 bytes, so rename these to use the term 'current'
instead.

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

3 years agobroadcom/compiler: sort constant UBO loads by index and offset
Iago Toral Quiroga [Tue, 6 Apr 2021 11:53:36 +0000 (13:53 +0200)]
broadcom/compiler: sort constant UBO loads by index and offset

This implements a NIR pass that groups together constant UBO loads
for the same UBO index in order of increasing offset when the distance
between them is small enough that it enables the "skip unifa write"
optimization.

This may increase register pressure because it can move UBO loads
earlier, so we also add a compiler strategy fallback to disable the
optimization if we need to drop thread count to compile the shader
with this optimization enabled.

total instructions in shared programs: 13557555 -> 13550300 (-0.05%)
instructions in affected programs: 814684 -> 807429 (-0.89%)
helped: 4485
HURT: 2377
Instructions are helped.

total uniforms in shared programs: 3777243 -> 3760990 (-0.43%)
uniforms in affected programs: 112554 -> 96301 (-14.44%)
helped: 7226
HURT: 36
Uniforms are helped.

total max-temps in shared programs: 2318133 -> 2333761 (0.67%)
max-temps in affected programs: 63230 -> 78858 (24.72%)
helped: 23
HURT: 3044
Max-temps are HURT.

total sfu-stalls in shared programs: 32245 -> 32567 (1.00%)
sfu-stalls in affected programs: 389 -> 711 (82.78%)
helped: 139
HURT: 451
Inconclusive result.

total inst-and-stalls in shared programs: 13589800 -> 13582867 (-0.05%)
inst-and-stalls in affected programs: 817738 -> 810805 (-0.85%)
helped: 4478
HURT: 2395
Inst-and-stalls are helped.

total nops in shared programs: 354365 -> 342202 (-3.43%)
nops in affected programs: 31000 -> 18837 (-39.24%)
helped: 4405
HURT: 265
Nops are helped.

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

3 years agobroadcom/compiler: allow compilation strategies to limit minimum thread count
Iago Toral Quiroga [Tue, 6 Apr 2021 11:39:23 +0000 (13:39 +0200)]
broadcom/compiler: allow compilation strategies to limit minimum thread count

This adds a minimum thread count parameter to each compilation strategy with
the intention to limit the minimum allowed thread count that can be used to
register allocate with that strategy.

For now all strategies allow the minimum thread count supported by the
hardware, but we will be using this infrastructure to impose a more
strict limit in an upcoming optimization.

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

3 years agobroadcom/compiler: add a definition for the unifa skip distance
Iago Toral Quiroga [Thu, 8 Apr 2021 07:02:16 +0000 (09:02 +0200)]
broadcom/compiler: add a definition for the unifa skip distance

We will be using this distance to setup another optimization in a
follow-up patch.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
x# Please enter the commit message for your changes. Lines starting

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

3 years agov3dv: fix index buffer binding
Iago Toral Quiroga [Fri, 9 Apr 2021 08:47:51 +0000 (10:47 +0200)]
v3dv: fix index buffer binding

This can be called outside a render pass so we should not expect to have
a job available. Also, we should not be emitting state here, instead we
should do in the pre-draw handler with all the other draw call state.

Fixes cases of crashes in RenderDoc when selecting elements in the
Event Browser.

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

3 years agobroadcom/compiler: fix first_component assertion
Juan A. Suarez Romero [Thu, 8 Apr 2021 09:53:50 +0000 (11:53 +0200)]
broadcom/compiler: fix first_component assertion

first_component is an uint, and thus if it takes value 0 we can't know
if it is because writemask has its first bit to 1, or all bits to 0.

As we want to ensure that at least one bit is set, apply the assertion
in writemask.

Fixes CID#1472829 "Macro compares unsigned to 0 (NO_EFFECT)".

v2:
 - Restore "first_component <= last_component" assertion (Iago)

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10103>

3 years agor600: Enable sb for nir only on specific request
Gert Wollny [Thu, 8 Apr 2021 16:41:47 +0000 (18:41 +0200)]
r600: Enable sb for nir only on specific request

SB si known to be buggy and the ultimate aim is to make it go away. To
test workloads with better optimizations it makes sense to be able to
enable SB, but for the NIR backend it should not be enabled together
with NIR the default. Therefore an a specific debug option "nirsb" that
enables NIR with SB.

Fixes: 3b27243b01ecdfea6df068338e56ffbd9b16b663
    r600: Enable sb also for NIR

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

3 years agoradv: add MSAA support to CopyImage() on compute queue
Samuel Pitoiset [Tue, 6 Apr 2021 12:29:47 +0000 (14:29 +0200)]
radv: add MSAA support to CopyImage() on compute queue

CopyImage supports copying MSAA images if the number of samples match.
Found by inspection because this is untested by CTS for some reasons.

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

3 years agoradv: do not clamp framebuffer dimensions to the minimum dimension
Samuel Pitoiset [Thu, 8 Apr 2021 17:16:04 +0000 (19:16 +0200)]
radv: do not clamp framebuffer dimensions to the minimum dimension

This shouldn't be needed and this is going to be wrong with VRS
attachments because dimensions are divided by the VRS texel size.

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

3 years agoegl: support no error attribute set to false with ES 1.1
Tapani Pälli [Tue, 6 Apr 2021 16:03:04 +0000 (19:03 +0300)]
egl: support no error attribute set to false with ES 1.1

We advertise the extension so it should support case where context has
attribute EGL_CONTEXT_OPENGL_NO_ERROR_KHR set to EGL_FALSE indepdendent
of ES version used.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4586
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10102>

3 years agocompiler/glsl: clean up output
Erik Faye-Lund [Mon, 29 Mar 2021 12:02:03 +0000 (14:02 +0200)]
compiler/glsl: clean up output

It's really hard to make sure we have the right amount of %s in the
format string, so let's change how we generate this string.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9896>

3 years agocompiler/glsl: fix volatile string
Erik Faye-Lund [Wed, 31 Mar 2021 08:09:58 +0000 (10:09 +0200)]
compiler/glsl: fix volatile string

The reason the member has a leading underscore is because volatile is a
keyword in C. We don't want to carry that detail into the error-string,
so let's drop the underscore.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9896>

3 years agocompiler/glsl: correct the number of string-arguments
Erik Faye-Lund [Mon, 29 Mar 2021 11:44:50 +0000 (13:44 +0200)]
compiler/glsl: correct the number of string-arguments

This format-string seems to have been incorrect since it's inception.
But there's also been commits that have both forgotten to add and remove
flags as appropriate as well.

Let's correct the format-list. This was done by counting by hand. A
better solution for the long-term is coming in a future commit.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9896>

3 years agomicrosoft/compiler: Add some more float16 support
Jesse Natalie [Tue, 6 Apr 2021 17:48:26 +0000 (10:48 -0700)]
microsoft/compiler: Add some more float16 support

We can support float16 constants, b2f16, and casts to float16.

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Reviewed-by: Michael Tang <tangm@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10063>

3 years agomicrosoft/spirv_to_dxil: Support doubles
Jesse Natalie [Tue, 6 Apr 2021 17:47:34 +0000 (10:47 -0700)]
microsoft/spirv_to_dxil: Support doubles

First, we need to lower alu to scalar so that all alu ops on doubles
only take one input. Then, we can use our new double lowering pass.

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Reviewed-by: Michael Tang <tangm@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10063>

3 years agomicrosoft/compiler: Implement new double pack/unpack alu ops
Jesse Natalie [Tue, 6 Apr 2021 17:46:21 +0000 (10:46 -0700)]
microsoft/compiler: Implement new double pack/unpack alu ops

MakeDouble is pretty straightforward, but SplitDouble is interesting
since it returns a unique 2-element struct.

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Reviewed-by: Michael Tang <tangm@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10063>

3 years agomicrosoft/compiler: Add a lowering pass to emit double [un]pack instructions
Jesse Natalie [Tue, 6 Apr 2021 17:44:55 +0000 (10:44 -0700)]
microsoft/compiler: Add a lowering pass to emit double [un]pack instructions

Whenever we have an ALU op that's operating on a double, we'll unpack
it as an integer, then repack it as a float. When we have an ALU op that
returns a double, we'll unpack it as a double, then repack it as an integer.

Then, simple algebraic opts will remove any redundant unpack/repack ops,
so we should be left with constructing and deconstructing doubles using
the right operations.

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Reviewed-by: Michael Tang <tangm@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10063>

3 years agonir: Add a new opcode for [un]packing doubles
Jesse Natalie [Tue, 6 Apr 2021 17:42:59 +0000 (10:42 -0700)]
nir: Add a new opcode for [un]packing doubles

HLSL doesn't support bitcasting a 64bit integer to a double. DXIL
doesn't have generic pack/unpack instructions, so we lower those to
integer bitwise ops. As a result, NIR generic double pack/unpack would
require our backend to emit a bitcast to get a double, but we want
to match HLSL semantics and emit MakeDouble/SplitDouble.

Adding a dedicated opcode for double pack/unpack allows us to add a
pass to emit that instead, which lets our backend emit the right
instruction to pack and unpack doubles.

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

3 years agomicrosoft/compiler: Support fp16 i/o vars
Jesse Natalie [Mon, 5 Apr 2021 20:22:16 +0000 (13:22 -0700)]
microsoft/compiler: Support fp16 i/o vars

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Reviewed-by: Michael Tang <tangm@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10063>

3 years agomicrosoft/spirv_to_dxil: Lower io arrays
Jesse Natalie [Mon, 5 Apr 2021 19:19:40 +0000 (12:19 -0700)]
microsoft/spirv_to_dxil: Lower io arrays

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Reviewed-by: Michael Tang <tangm@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10063>

3 years agomicrosoft/spirv_to_dxil: Lower globals to function_temp
Jesse Natalie [Mon, 5 Apr 2021 17:40:01 +0000 (10:40 -0700)]
microsoft/spirv_to_dxil: Lower globals to function_temp

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Reviewed-by: Michael Tang <tangm@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10063>

3 years agozink: fix CI flakiness in glx-multithread-clearbuffer
Mike Blumenkrantz [Fri, 9 Apr 2021 00:33:30 +0000 (20:33 -0400)]
zink: fix CI flakiness in glx-multithread-clearbuffer

unsetting zink from GALLIUM_DRIVER is required in order for lavapipe to
work, but setting it back is totally broken in the case where an app
creates a ton of screens simultaneously

instead, just leave it set to llvmpipe, and if a race condition occurs,
at least llvmpipe isn't going to fail a test that zink passes

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

3 years agoradv: Support DCC modifiers fully.
Bas Nieuwenhuizen [Tue, 9 Mar 2021 02:32:32 +0000 (03:32 +0100)]
radv: Support DCC modifiers fully.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9998>

3 years agoradv: Add retiling for foreign queues.
Bas Nieuwenhuizen [Tue, 9 Mar 2021 02:41:36 +0000 (03:41 +0100)]
radv: Add retiling for foreign queues.

This way modifier images that don't go through the present layout
get the retile executed properly.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9998>

3 years agoradv: Support DCC without DCC/FCE predicates.
Bas Nieuwenhuizen [Tue, 9 Mar 2021 02:22:45 +0000 (03:22 +0100)]
radv: Support DCC without DCC/FCE predicates.

Imported images can't have this as part of the associated memory.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9998>

3 years agoradv: Support DCC without a fast clear value.
Bas Nieuwenhuizen [Mon, 8 Mar 2021 14:45:50 +0000 (15:45 +0100)]
radv: Support DCC without a fast clear value.

For imported images we can't have one in the associated memory.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9998>

3 years agoglx: Downgrade sRGB-ful fbconfigs
Adam Jackson [Tue, 6 Apr 2021 19:57:26 +0000 (15:57 -0400)]
glx: Downgrade sRGB-ful fbconfigs

Again, NVIDIA supports this on every fbconfig, Mesa alternates it on and
off for some reason but only on some drivers, and in particular llvmpipe
doesn't try to create sRGB-ful fbconfigs. Nerf it out of the fbconfig.

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

3 years agoglx: Downgrade tfp mipmap-capable fbconfigs
Adam Jackson [Tue, 6 Apr 2021 19:56:01 +0000 (15:56 -0400)]
glx: Downgrade tfp mipmap-capable fbconfigs

Again, NVIDIA does this but Mesa doesn't. Just disable it in the
fbconfig so apps can't try to use it.

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

3 years agoglx: Downgrade aux-buffer-ful fbconfigs
Adam Jackson [Tue, 6 Apr 2021 19:54:28 +0000 (15:54 -0400)]
glx: Downgrade aux-buffer-ful fbconfigs

Mesa's never supported this, but NVIDIA does, on every fbconfig. Just
disable it if we see it.

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

3 years agoglx: Don't downgrade the visual caveat from the server
Adam Jackson [Tue, 6 Apr 2021 19:50:35 +0000 (15:50 -0400)]
glx: Don't downgrade the visual caveat from the server

Mesa marks accumful fbconfigs as slow (for no especially good reason,
it's only accum operations that aren't accelerated, and we could fix
that). NVIDIA doesn't. All that mismatching on this attribute can do is
prevent a config from working exactly as well as it possibly can.

Trust the server's opinion here (but warn if you ask for warnings).

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

3 years agoglx: Stop pretending to validate the pbuffer fbconfig attributes
Adam Jackson [Tue, 6 Apr 2021 19:42:04 +0000 (15:42 -0400)]
glx: Stop pretending to validate the pbuffer fbconfig attributes

For hardware drivers we've never set this to anything interesting so
there's no benefit to validating it. For drisw we're at the mercy of
whatever the X server sent to us anyway, and it's not like any server is
going to vary two fbconfigs by _just_ these values.

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

3 years agodri: Don't tie the accum buffer's alpha-ness to the color buffer's
Adam Jackson [Tue, 6 Apr 2021 19:20:29 +0000 (15:20 -0400)]
dri: Don't tie the accum buffer's alpha-ness to the color buffer's

Let's preface this all by noting that the accum buffer is unused even by
legacy feature standards, and that anybody needing it to be performant
is probably not using Mesa to begin with since we've never accelerated
it. This fix is really about making drisw work under hostile GLX
environments, since it doesn't have any control over what's running on
the server side.

NVIDIA's driver simply lists RGBA16 accumulation buffers for every
fbconfig, and the accum buffer's alpha channel is always non-zero even
if the color buffer is RGBX. If we try to point llvmpipe at such a
screen, then _none_ of the depth-24 fbconfigs will find a matching DRI
config, since DRI's accumful config will have 0 accum alpha bits. This
is somewhat limiting since most X applications are expecting an RGBX
config and will be accidentally translucent at depth 32.

Due to the somewhat ugly nature of how xserver constructs fbconfigs, if
you run a driver with this fix against a server from before this fix (or
vice versa), you will find the opposite result: none of your RGBX
fbconfigs will have an accum buffer, though the RGBA ones still will.
That's a pretty acceptable tradeoff to me since what we're gaining is
the ability to use llvmpipe at all.

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

3 years agomesa: gl_config::rgbBits should count alphaBits too
Adam Jackson [Tue, 6 Apr 2021 19:36:51 +0000 (15:36 -0400)]
mesa: gl_config::rgbBits should count alphaBits too

This backs {EGL,GLX}_BUFFER_SIZE, which explicitly include alpha.

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

3 years agolavapipe: add dummy sampler ycbcr conversion
Dave Airlie [Thu, 4 Mar 2021 05:33:19 +0000 (15:33 +1000)]
lavapipe: add dummy sampler ycbcr conversion

This at least keeps the CTS tests happy.

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

3 years agolavapipe: add vk1.1 image swapchain support
Dave Airlie [Thu, 8 Apr 2021 06:37:04 +0000 (16:37 +1000)]
lavapipe: add vk1.1 image swapchain support

Adding support to create images from memory in the swapchain.
Just missed this in my pass of 1.1 features

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

3 years agogallium/threaded_context: add another rule for buffer mapping
Mike Blumenkrantz [Thu, 8 Apr 2021 18:43:04 +0000 (14:43 -0400)]
gallium/threaded_context: add another rule for buffer mapping

a synchronous driver can use PIPE_MAP_ONCE to infer that a buffer is
guaranteed to not be mapped multiple times, as this is only used when
doing map -> memcpy -> unmap directly

a threaded driver performs maps/unmaps asynchronously, so this flag
can only be used by the driver to confirm that the mapped region is accessed
exactly once, not that it will not need to remain mapped for other transfer_map
uses after it is unmapped

in short, consider this scenario:
  transfer_map(A) -> memcpy(map, data) -> transfer_unmap(map_A) ->
  transfer_map(A) -> memcpy(map, data) -> transfer_unmap(map_A)

when a synchronous driver executes this, the call chain is unmodified

when a tc driver executes this, the call chain may become:
  transfer_map(A) -> memcpy(map, data) ->
  transfer_map(A) -> memcpy(map, data) ->
  transfer_unmap(map_A) -> transfer_unmap(map_A)

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

3 years agoetnaviv: tell the truth if alpha-test is supported
Christian Gmeiner [Fri, 12 Mar 2021 08:18:51 +0000 (09:18 +0100)]
etnaviv: tell the truth if alpha-test is supported

GPUs with the feature bit PE_NO_ALPHA_TEST set have no fixed-function
alpha test unit and we want to let st lower it with a shader variant.

For GC7000K this fixes all fbo-alphatest-formats piglits like:
 spec@ext_framebuffer_object@fbo-alphatest-formats
 spec@ext_packed_float@fbo-alphatest-formats
 spec@ext_texture_srgb@fbo-alphatest-formats

This only works with the NIR compiler backend.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Tested-by: Lukas F. Hartmann <lukas@mntmn.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9871>

3 years agofeatures: mark off ARB_fragment_shader_interlock for zink
Mike Blumenkrantz [Thu, 8 Apr 2021 16:55:41 +0000 (12:55 -0400)]
features: mark off ARB_fragment_shader_interlock for zink

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

3 years agovenus: implement vn_debug_init_once with os_get_option
Yiwei Zhang [Tue, 6 Apr 2021 00:50:36 +0000 (00:50 +0000)]
venus: implement vn_debug_init_once with os_get_option

getenv is not working well with Android VM. Instead, use os_get_option
to read Android system property.

e.g. adb shell setprop mesa.vn.debug drm

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

3 years agovenus: bring up Android support
Yiwei Zhang [Sat, 3 Apr 2021 19:14:00 +0000 (19:14 +0000)]
venus: bring up Android support

1. implement hwvulkan_device_t
2. mask Android extension support

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

3 years agovenus: properly enable WSI for different platforms
Yiwei Zhang [Mon, 5 Apr 2021 21:20:09 +0000 (21:20 +0000)]
venus: properly enable WSI for different platforms

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

3 years agonir/spirv: remove unused fields from `vtn_builder`
Andrii Simiklit [Thu, 8 Apr 2021 11:17:00 +0000 (14:17 +0300)]
nir/spirv: remove unused fields from `vtn_builder`

They were used for tracking whether SSA needed to be repaired,
but now the repair is done for all functions with structured control flow.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7755>

3 years agospirv: repair ssa defs for switchs with only default case
Andrii Simiklit [Tue, 24 Nov 2020 12:28:12 +0000 (14:28 +0200)]
spirv: repair ssa defs for switchs with only default case

This fixes OpSwitch corner case when switch doesn't have any targets
just a `default` and SSAs defined in it is used after switch block
directly without phis.

v2: Just use `repair_ssa` for all structured control-flow cases
               ( - Jason Ekstrand <jason@jlekstrand.net>
                 - Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com> )

Closes: #3787
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7755>

3 years agointel/compiler: remove unused member 'input_vue_map'
Yevhenii Kharchenko [Tue, 6 Apr 2021 22:23:08 +0000 (01:23 +0300)]
intel/compiler: remove unused member 'input_vue_map'

v2: Instead of fixing unitialized member 'fs_visitor::input_vue_map'
(as reported by Coverity Scan in defect CID 1474559),
remove unused members 'vec4_tcs_visitor::input_vue_map' and
'fs_visitor::input_vue_map'.

Also fixed 'debug_enabled' argument skipped in a fs_visitor constructor
call from brw_compile_tes().

Signed-off-by: Yevhenii Kharchenko <yevhenii.kharchenko@globallogic.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10040>

3 years agoradv: add MSAA support to ClearColorImage() on compute queue
Samuel Pitoiset [Wed, 7 Apr 2021 07:08:18 +0000 (09:08 +0200)]
radv: add MSAA support to ClearColorImage() on compute queue

Found by inspection.

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

3 years agovenus: initial support for WSI
Chia-I Wu [Mon, 21 Oct 2019 20:52:12 +0000 (13:52 -0700)]
venus: initial support for WSI

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5800>

3 years agovenus: initial support for transform feedback
Chia-I Wu [Fri, 9 Oct 2020 17:33:23 +0000 (10:33 -0700)]
venus: initial support for transform feedback

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5800>

3 years agovenus: advertise extensions promoted to 1.2
Chia-I Wu [Fri, 11 Sep 2020 22:14:34 +0000 (15:14 -0700)]
venus: advertise extensions promoted to 1.2

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5800>

3 years agovenus: advertise extensions promoted to 1.1
Chia-I Wu [Fri, 11 Sep 2020 17:39:17 +0000 (10:39 -0700)]
venus: advertise extensions promoted to 1.1

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5800>

3 years agovenus: initial support for command buffers
Chia-I Wu [Tue, 5 Nov 2019 20:53:15 +0000 (12:53 -0800)]
venus: initial support for command buffers

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5800>

3 years agovenus: initial support for module and pipelines
Chia-I Wu [Tue, 5 Nov 2019 20:52:14 +0000 (12:52 -0800)]
venus: initial support for module and pipelines

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5800>

3 years agovenus: initial support for events and queries
Chia-I Wu [Tue, 5 Nov 2019 20:51:09 +0000 (12:51 -0800)]
venus: initial support for events and queries

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5800>

3 years agovenus: initial support for render pass and fb
Chia-I Wu [Tue, 5 Nov 2019 20:50:20 +0000 (12:50 -0800)]
venus: initial support for render pass and fb

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5800>

3 years agovenus: initial support for descriptor sets
Chia-I Wu [Tue, 5 Nov 2019 20:48:58 +0000 (12:48 -0800)]
venus: initial support for descriptor sets

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5800>

3 years agovenus: initial support for buffers/images/samplers
Chia-I Wu [Mon, 4 Nov 2019 21:09:04 +0000 (13:09 -0800)]
venus: initial support for buffers/images/samplers

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5800>

3 years agovenus: initial support for VkDeviceMemory commands
Chia-I Wu [Mon, 4 Nov 2019 20:57:01 +0000 (12:57 -0800)]
venus: initial support for VkDeviceMemory commands

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5800>

3 years agovenus: initial support for queue/fence/semaphore
Chia-I Wu [Wed, 6 Nov 2019 18:19:20 +0000 (10:19 -0800)]
venus: initial support for queue/fence/semaphore

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5800>