mesa.git
15 months agoutil: Merge util_format_read_4* functions.
Eric Anholt [Wed, 1 Jul 2020 23:50:02 +0000 (16:50 -0700)]
util: Merge util_format_read_4* functions.

Everyone wants the same thing: unpack 4-bytes-per-channel data based on the
base type of the format.

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

15 months agoutil: Merge util_format_write_4* functions.
Eric Anholt [Wed, 1 Jul 2020 23:37:05 +0000 (16:37 -0700)]
util: Merge util_format_write_4* functions.

Everyone wants the same thing: pack 4-bytes-per-channel data based on the
base type of the format.

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

15 months agosvga: Reuse util_format_unpack_rgba().
Eric Anholt [Wed, 1 Jul 2020 23:27:38 +0000 (16:27 -0700)]
svga: Reuse util_format_unpack_rgba().

This assumes that pipe_color_union is a vec4, but that seems safe.

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

15 months agogallium/util: Move the Z/S handling to the outside of get_tile().
Eric Anholt [Wed, 1 Jul 2020 23:48:54 +0000 (16:48 -0700)]
gallium/util: Move the Z/S handling to the outside of get_tile().

This lets us drop the special case for S8_UINT, and makes our read_4 path
just like other callers.

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

15 months agogallium/util: Clean up the Z/S tile write path.
Eric Anholt [Wed, 1 Jul 2020 23:32:37 +0000 (16:32 -0700)]
gallium/util: Clean up the Z/S tile write path.

The switch statement is silly, we have a helper to detect all of Z/S.
And, take the time explain why all of Z/S tile writing is unimplemented.

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

15 months agogallium/util: Fix location of the comment about S8_UINT handling.
Eric Anholt [Wed, 1 Jul 2020 23:17:32 +0000 (16:17 -0700)]
gallium/util: Fix location of the comment about S8_UINT handling.

I clearly wrote it in the wrong place in "softpipe: Refactor
pipe_get/put_tile_rgba_* paths."

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

15 months agoetnaviv: Use the util_pack_color_union() helper.
Eric Anholt [Wed, 1 Jul 2020 23:14:40 +0000 (16:14 -0700)]
etnaviv: Use the util_pack_color_union() helper.

This snuck in since I cleaned up the other instances of it.

Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5728>

15 months agoutil: Remove unused util_format_planar_is_supported().
Eric Anholt [Wed, 1 Jul 2020 23:02:15 +0000 (16:02 -0700)]
util: Remove unused util_format_planar_is_supported().

Nothing calls it, and it should have been left in gallium, anyway.

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

15 months agosoftpipe: Clean up softpipe's SSBO load/store interpreting instructions.
Eric Anholt [Wed, 1 Jul 2020 21:30:42 +0000 (14:30 -0700)]
softpipe: Clean up softpipe's SSBO load/store interpreting instructions.

There's no need to go to all this trouble of setting up 16-byte vectors to
pack/unpack our 32-bit values, memcpy is really good at moving 4 bytes
around.

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

15 months agoutil: Mark util_format_description() as a const function.
Eric Anholt [Wed, 1 Jul 2020 20:33:21 +0000 (13:33 -0700)]
util: Mark util_format_description() as a const function.

It will return the same table every time with no other side effects, so we
want it to be CSEed.  Saves 3.5k on my aarch64 GL drivers, almost 9k on
turnip, but weirdly increases my x86 GL driver collection by ~3k.

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

15 months agonir: refactor nir_can_move_instr
Daniel Schürmann [Wed, 24 Jun 2020 10:23:05 +0000 (11:23 +0100)]
nir: refactor nir_can_move_instr

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5622>

15 months agonir: also move vecN in case of nir_move_copies
Daniel Schürmann [Wed, 24 Jun 2020 10:14:18 +0000 (11:14 +0100)]
nir: also move vecN in case of nir_move_copies

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5622>

15 months agoturnip: use global bo for clear blit shaders
Jonathan Marek [Mon, 6 Jul 2020 15:48:54 +0000 (11:48 -0400)]
turnip: use global bo for clear blit shaders

Fill the global bo will all possible shaders for 3D clear/blit. Note the
global bo size is still <4k (so this doesn't cost any extra memory), this
saves having to allocate shaders in sub_cs everytime the 3D path is used.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5776>

15 months agoaco: remove superflous (bool & exec) if the result comes from VOPC
Daniel Schürmann [Fri, 19 Jun 2020 15:09:48 +0000 (16:09 +0100)]
aco: remove superflous (bool & exec) if the result comes from VOPC

This works in cases where the VOPC instruction was executed with
the same exec mask.

Totals from affected shaders: (VEGA)
SGPRS: 1342204 -> 1342164 (-0.00 %)
VGPRS: 877220 -> 877220 (0.00 %)
Spilled SGPRs: 157800 -> 157800 (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: 118083212 -> 118021748 (-0.05 %) bytes
LDS: 26 -> 26 (0.00 %) blocks
Max Waves: 144024 -> 144024 (0.00 %)

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5563>

15 months agoradv: enable zerovram for Quantic Dream games
Rhys Perry [Wed, 1 Jul 2020 15:00:55 +0000 (16:00 +0100)]
radv: enable zerovram for Quantic Dream games

Fixes various artifacts with Detroit: Become Human. This assumes other
Vulkan games using the same engine could have the same issues.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: <mesa-stable@lists.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5710>

15 months agogitlab-ci: More stable URL for kernel and ramdisk artifacts, for LAVA
Tomeu Vizoso [Wed, 1 Apr 2020 11:07:46 +0000 (13:07 +0200)]
gitlab-ci: More stable URL for kernel and ramdisk artifacts, for LAVA

Place the kernel and ramdisk into a place in the file server so the URL
will only change when the contents also change.

Also put the Mesa build into a separate tarball so the ramdisk's
contents don't change every build.

With proper caching in place, all devices in the same farm need only to
download the mesa tarball once, saving time.

As we switch to MinIO for making kernels and rootfs available to LAVA
devices, we can stop using Docker to distribute them.

Instead, build when needed in separate jobs that push directly to MinIO,
from where LAVA devices can download them.

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

15 months agogitlab-ci: Build kernel drivers for a few ethernet USB dongles
Tomeu Vizoso [Mon, 15 Jun 2020 07:29:49 +0000 (09:29 +0200)]
gitlab-ci: Build kernel drivers for a few ethernet USB dongles

So LAVA devices can download traces and upload test results.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5515>

15 months agonv50/ir/nir: fix cache mode conversion
Karol Herbst [Mon, 6 Jul 2020 18:06:40 +0000 (20:06 +0200)]
nv50/ir/nir: fix cache mode conversion

The nir access qualifier is actually a bitfield, so we need to read out
like one.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5747>

15 months agogv100/ir: fix coherent and volatile memory access
Karol Herbst [Mon, 6 Jul 2020 14:57:07 +0000 (16:57 +0200)]
gv100/ir: fix coherent and volatile memory access

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5747>

15 months agogv100/ir: implement sample shading
Karol Herbst [Sat, 4 Jul 2020 20:12:10 +0000 (22:12 +0200)]
gv100/ir: implement sample shading

Fixes sample shading tests in the Khronos OpenGL(ES) CTS

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5747>

15 months agonv50/ir/nir: fix interpolation on explicit operations
Karol Herbst [Sat, 4 Jul 2020 09:32:14 +0000 (11:32 +0200)]
nv50/ir/nir: fix interpolation on explicit operations

Fixes a bunch of interpolate tests in the aosp GLES CTS

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5747>

15 months agoiris: Fix fast-clearing of depth via glClearTex(Sub)Image
Danylo Piliaiev [Thu, 2 Jul 2020 08:39:25 +0000 (11:39 +0300)]
iris: Fix fast-clearing of depth via glClearTex(Sub)Image

If we clear depth only texture via glClearTex(Sub)Image it may cause:
../src/intel/blorp/blorp_genX_exec.h:1554: blorp_emit_surface_states: Assertion `params->depth.enabled || params->stencil.enabled' failed.

due to clear_depth_stencil calling blorp_clear_depth_stencil when
depth is already fast-cleared and there is no stencil.

Fixes piglit test: arb_clear_texture-depth

Fixes: 51638cf18a532510f9e1fd8f36207b56d38137b8
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5770>

15 months agodocs: fixup envvar output
Erik Faye-Lund [Thu, 2 Jul 2020 12:15:57 +0000 (14:15 +0200)]
docs: fixup envvar output

Sphinx 2.x has changed how this works, and some of this whitespace now
gets stripped as a result. So let's instead actual whitespace as separate
text-nodes instead.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5706>

15 months agodocs: use svg for graphviz output
Erik Faye-Lund [Thu, 2 Jul 2020 11:24:06 +0000 (13:24 +0200)]
docs: use svg for graphviz output

This works a lot better on hidpi screens.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5706>

15 months agodocs: move gallium specific docs into gallium folder
Erik Faye-Lund [Tue, 30 Jun 2020 11:01:04 +0000 (13:01 +0200)]
docs: move gallium specific docs into gallium folder

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5706>

15 months agodocs: add an extension to generate redirects
Erik Faye-Lund [Thu, 2 Jul 2020 10:14:28 +0000 (12:14 +0200)]
docs: add an extension to generate redirects

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5706>

15 months agodocs: clean up gallium index-file
Erik Faye-Lund [Tue, 30 Jun 2020 10:51:04 +0000 (12:51 +0200)]
docs: clean up gallium index-file

This makes the TOC make much more sense.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5706>

15 months agomerge gallium docs into main docs
Erik Faye-Lund [Tue, 30 Jun 2020 10:44:19 +0000 (12:44 +0200)]
merge gallium docs into main docs

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5706>

15 months agoci: add graphviz to the .docs-base template
Erik Faye-Lund [Thu, 2 Jul 2020 11:09:36 +0000 (13:09 +0200)]
ci: add graphviz to the .docs-base template

The Gallium docs uses graphviz, so let's make sure it's installed first.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5706>

15 months agofreedreno: Sync registers with envytools
Connor Abbott [Fri, 19 Jun 2020 11:15:42 +0000 (13:15 +0200)]
freedreno: Sync registers with envytools

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

15 months agofreedreno: Include adreno_pm4.xml.h before adreno_a6xx.xml.h
Connor Abbott [Mon, 6 Jul 2020 11:35:43 +0000 (13:35 +0200)]
freedreno: Include adreno_pm4.xml.h before adreno_a6xx.xml.h

This matches the XML, and soon adreno_a6xx.xml will start including
types from adreno_pm4.xml.

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

15 months agogallium/swr: Fix compilation warnings
jzielins [Mon, 6 Jul 2020 15:38:02 +0000 (17:38 +0200)]
gallium/swr: Fix compilation warnings

In some places in SWR cod objects are initialized using
memset/memcpy. This is usually done to enable
allocating those objects in aligned memory.
It generates compilation warnings though,
which are worked around by casting the pointers to void*
before calling memset/memcpy.

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

15 months agofreedreno/a6xx: Force gl_Layer to 0 when necessary
Connor Abbott [Fri, 3 Jul 2020 10:04:03 +0000 (12:04 +0200)]
freedreno/a6xx: Force gl_Layer to 0 when necessary

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

15 months agotu: Force gl_Layer to 0 when necessary
Connor Abbott [Fri, 3 Jul 2020 10:03:00 +0000 (12:03 +0200)]
tu: Force gl_Layer to 0 when necessary

In particular this will help us implement input attachments correctly
with layered rendering.

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

15 months agoir3: Add layer_zero variant bit
Connor Abbott [Fri, 3 Jul 2020 10:01:17 +0000 (12:01 +0200)]
ir3: Add layer_zero variant bit

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

15 months agopan/decode: Make mapped memory read-only while decoding
Icecream95 [Mon, 22 Jun 2020 10:49:53 +0000 (22:49 +1200)]
pan/decode: Make mapped memory read-only while decoding

This will help catch any bugs where descriptors are accidentally
modified.

v2: Use a dynarray of ro memory mappings rather than iterating through
    the mmap hash table.

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

15 months agopanfrost: Expose MSAA 4x
Alyssa Rosenzweig [Tue, 30 Jun 2020 19:19:47 +0000 (15:19 -0400)]
panfrost: Expose MSAA 4x

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

15 months agopanfrost: Save sample_mask before blitting
Alyssa Rosenzweig [Fri, 3 Jul 2020 18:16:20 +0000 (14:16 -0400)]
panfrost: Save sample_mask before blitting

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

15 months agopanfrost: Enable MSAA if we render to such a surface
Alyssa Rosenzweig [Fri, 3 Jul 2020 16:04:53 +0000 (12:04 -0400)]
panfrost: Enable MSAA if we render to such a surface

We hit this case for clears of MSAA surfaces without draws.

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

15 months agopanfrost: Set depth/stencil_layer_stride accordingly
Alyssa Rosenzweig [Fri, 3 Jul 2020 16:04:36 +0000 (12:04 -0400)]
panfrost: Set depth/stencil_layer_stride accordingly

Same logic as colour layer stride, I think.

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

15 months agopanfrost: Identify depth/stencil layer strides
Alyssa Rosenzweig [Fri, 3 Jul 2020 15:27:48 +0000 (11:27 -0400)]
panfrost: Identify depth/stencil layer strides

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

15 months agopanfrost: Implement alpha-to-coverage
Alyssa Rosenzweig [Thu, 2 Jul 2020 15:17:37 +0000 (11:17 -0400)]
panfrost: Implement alpha-to-coverage

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

15 months agopanfrost: Pass sample_mask to the hardware
Alyssa Rosenzweig [Thu, 2 Jul 2020 14:07:08 +0000 (10:07 -0400)]
panfrost: Pass sample_mask to the hardware

Gallium computes it for us.

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

15 months agopanfrost: Identify coverage_mask
Alyssa Rosenzweig [Thu, 2 Jul 2020 14:06:33 +0000 (10:06 -0400)]
panfrost: Identify coverage_mask

The driver specifies the mask directly.

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

15 months agopanfrost: Don't advertise MSAA 2x
Alyssa Rosenzweig [Tue, 30 Jun 2020 20:53:38 +0000 (16:53 -0400)]
panfrost: Don't advertise MSAA 2x

Let the frontend promote to MSAA 4x if the app requests it. We don't
support MSAA 2x.

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

15 months agopanfrost: Set layer_stride for multisampled rendering
Alyssa Rosenzweig [Tue, 30 Jun 2020 20:49:52 +0000 (16:49 -0400)]
panfrost: Set layer_stride for multisampled rendering

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

15 months agopanfrost: Include pointer for each sample
Alyssa Rosenzweig [Tue, 30 Jun 2020 20:43:47 +0000 (16:43 -0400)]
panfrost: Include pointer for each sample

Treating it like an array/3D texture.

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

15 months agopanfrost: Index texture by sample
Alyssa Rosenzweig [Tue, 30 Jun 2020 20:43:32 +0000 (16:43 -0400)]
panfrost: Index texture by sample

This will allow MSAA to route through.

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

15 months agopanfrost: Allocate space for multisampling
Alyssa Rosenzweig [Tue, 30 Jun 2020 20:29:16 +0000 (16:29 -0400)]
panfrost: Allocate space for multisampling

As an effective depth. Ugly but matches the blob.

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

15 months agopanfrost: Identify layer_stride
Alyssa Rosenzweig [Tue, 30 Jun 2020 20:21:18 +0000 (16:21 -0400)]
panfrost: Identify layer_stride

For MSAA.

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

15 months agopanfrost: Set depth to sample_count for MSAA 2D
Alyssa Rosenzweig [Tue, 30 Jun 2020 19:41:24 +0000 (15:41 -0400)]
panfrost: Set depth to sample_count for MSAA 2D

Treated like a 3D texture.

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

15 months agopan/mdg: Use _VTX tag for texelFetch in frag shaders
Alyssa Rosenzweig [Tue, 30 Jun 2020 19:41:43 +0000 (15:41 -0400)]
pan/mdg: Use _VTX tag for texelFetch in frag shaders

Probably a misnomer, let's match what the blob seemingly does though? At
least in blit shaders?

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

15 months agopan/mdg: Handle nir_texop_txf_ms
Alyssa Rosenzweig [Tue, 30 Jun 2020 19:32:01 +0000 (15:32 -0400)]
pan/mdg: Handle nir_texop_txf_ms

Same as nir_texop_txf, the special case where sample = 0.

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

15 months agopan/mdg: Handle nir_tex_src_ms_index
Alyssa Rosenzweig [Tue, 30 Jun 2020 19:31:39 +0000 (15:31 -0400)]
pan/mdg: Handle nir_tex_src_ms_index

Goes in .z for a txf_ms coordinate, same as a shadow comparator so we
reuse the impl.

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

15 months agopan/mdg: Handle GLSL_SAMPLER_DIM_MS
Alyssa Rosenzweig [Tue, 30 Jun 2020 19:31:30 +0000 (15:31 -0400)]
pan/mdg: Handle GLSL_SAMPLER_DIM_MS

Same as 2D.

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

15 months agopan/mdg: Allow ignoring move mode
Alyssa Rosenzweig [Fri, 3 Jul 2020 13:20:44 +0000 (09:20 -0400)]
pan/mdg: Allow ignoring move mode

Ensures we can gaurantee we'll pick something, which matters for
depth/stencil export.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes: de41c4c103d ("pan/mdg: Prioritize non-moves on VADD/VLUT")
Tested-by: Icecream95 <ixn@keemail.me>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5782>

15 months agopan/decode: Identify layered MSAA flag
Alyssa Rosenzweig [Mon, 6 Jul 2020 22:45:16 +0000 (18:45 -0400)]
pan/decode: Identify layered MSAA flag

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

15 months agopan/decode: Fix MSAA texture decoding
Alyssa Rosenzweig [Tue, 30 Jun 2020 20:21:30 +0000 (16:21 -0400)]
pan/decode: Fix MSAA texture decoding

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

15 months agopan/mdg: Fix indirect UBO swizzles
Alyssa Rosenzweig [Mon, 6 Jul 2020 14:57:04 +0000 (10:57 -0400)]
pan/mdg: Fix indirect UBO swizzles

Helps a lot of vertex shaders dramatically.

total instructions in shared programs: 48491 -> 48252 (-0.49%)
instructions in affected programs: 3091 -> 2852 (-7.73%)
helped: 30
HURT: 0
helped stats (abs) min: 1 max: 35 x̄: 7.97 x̃: 5
helped stats (rel) min: 0.57% max: 21.60% x̄: 7.98% x̃: 6.85%
95% mean confidence interval for instructions value: -11.11 -4.83
95% mean confidence interval for instructions %-change: -10.17% -5.80%
Instructions are helped.

total bundles in shared programs: 23392 -> 23105 (-1.23%)
bundles in affected programs: 2017 -> 1730 (-14.23%)
helped: 35
HURT: 0
helped stats (abs) min: 1 max: 34 x̄: 8.20 x̃: 7
helped stats (rel) min: 1.11% max: 34.69% x̄: 15.52% x̃: 18.42%
95% mean confidence interval for bundles value: -10.91 -5.49
95% mean confidence interval for bundles %-change: -19.28% -11.77%
Bundles are helped.

total quadwords in shared programs: 39586 -> 39611 (0.06%)
quadwords in affected programs: 1717 -> 1742 (1.46%)
helped: 5
HURT: 24
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 0.83% max: 3.57% x̄: 2.45% x̃: 2.78%
HURT stats (abs)   min: 1 max: 2 x̄: 1.25 x̃: 1
HURT stats (rel)   min: 1.00% max: 3.77% x̄: 2.17% x̃: 1.89%
95% mean confidence interval for quadwords value: 0.50 1.22
95% mean confidence interval for quadwords %-change: 0.61% 2.13%
Quadwords are HURT.

total registers in shared programs: 3337 -> 3272 (-1.95%)
registers in affected programs: 373 -> 308 (-17.43%)
helped: 34
HURT: 0
helped stats (abs) min: 1 max: 5 x̄: 1.91 x̃: 1
helped stats (rel) min: 6.25% max: 33.33% x̄: 16.76% x̃: 16.03%
95% mean confidence interval for registers value: -2.31 -1.51
95% mean confidence interval for registers %-change: -19.15% -14.37%
Registers are helped.

total threads in shared programs: 2593 -> 2615 (0.85%)
threads in affected programs: 22 -> 44 (100.00%)
helped: 21
HURT: 0
helped stats (abs) min: 1 max: 2 x̄: 1.05 x̃: 1
helped stats (rel) min: 100.00% max: 100.00% x̄: 100.00% x̃: 100.00%
95% mean confidence interval for threads value: 0.95 1.15
95% mean confidence interval for threads %-change: 100.00% 100.00%
Threads are [helped].

total loops in shared programs: 6 -> 6 (0.00%)
loops in affected programs: 0 -> 0
helped: 0
HURT: 0

total spills in shared programs: 17 -> 1 (-94.12%)
spills in affected programs: 16 -> 0
helped: 2
HURT: 0

total fills in shared programs: 35 -> 5 (-85.71%)
fills in affected programs: 30 -> 0
helped: 2
HURT: 0

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

15 months agopan/mdg: Respect type/mask in mir_lower_special_reads
Alyssa Rosenzweig [Mon, 6 Jul 2020 14:33:29 +0000 (10:33 -0400)]
pan/mdg: Respect type/mask in mir_lower_special_reads

Fixes RA issues with the lowered moves, as well as enabling more
aggressive scheduling (hence the slight shdaer-db win).

total instructions in shared programs: 48539 -> 48491 (-0.10%)
instructions in affected programs: 4400 -> 4352 (-1.09%)
helped: 13
HURT: 0
helped stats (abs) min: 1 max: 8 x̄: 3.69 x̃: 3
helped stats (rel) min: 0.50% max: 1.89% x̄: 1.06% x̃: 1.10%
95% mean confidence interval for instructions value: -5.05 -2.33
95% mean confidence interval for instructions %-change: -1.29% -0.84%
Instructions are helped.

total bundles in shared programs: 23447 -> 23392 (-0.23%)
bundles in affected programs: 2224 -> 2169 (-2.47%)
helped: 21
HURT: 1
helped stats (abs) min: 1 max: 8 x̄: 2.67 x̃: 2
helped stats (rel) min: 0.89% max: 20.00% x̄: 9.04% x̃: 2.40%
HURT stats (abs)   min: 1 max: 1 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 1.20% max: 1.20% x̄: 1.20% x̃: 1.20%
95% mean confidence interval for bundles value: -3.51 -1.49
95% mean confidence interval for bundles %-change: -12.52% -4.63%
Bundles are helped.

total quadwords in shared programs: 39651 -> 39586 (-0.16%)
quadwords in affected programs: 5557 -> 5492 (-1.17%)
helped: 38
HURT: 1
helped stats (abs) min: 1 max: 2 x̄: 1.74 x̃: 2
helped stats (rel) min: 0.61% max: 14.29% x̄: 3.92% x̃: 1.20%
HURT stats (abs)   min: 1 max: 1 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 0.69% max: 0.69% x̄: 0.69% x̃: 0.69%
95% mean confidence interval for quadwords value: -1.87 -1.47
95% mean confidence interval for quadwords %-change: -5.55% -2.05%
Quadwords are helped.

total registers in shared programs: 3336 -> 3337 (0.03%)
registers in affected programs: 21 -> 22 (4.76%)
helped: 1
HURT: 2
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 11.11% max: 11.11% x̄: 11.11% x̃: 11.11%
HURT stats (abs)   min: 1 max: 1 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 16.67% max: 16.67% x̄: 16.67% x̃: 16.67%

total threads in shared programs: 2592 -> 2593 (0.04%)
threads in affected programs: 1 -> 2 (100.00%)
helped: 1
HURT: 0

total spills in shared programs: 17 -> 17 (0.00%)
spills in affected programs: 0 -> 0
helped: 0
HURT: 0

total fills in shared programs: 35 -> 35 (0.00%)
fills in affected programs: 0 -> 0
helped: 0
HURT: 0

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

15 months agoir3: use empirical size for params as used by the shader
Ilia Mirkin [Sun, 5 Jul 2020 05:58:01 +0000 (01:58 -0400)]
ir3: use empirical size for params as used by the shader

For example only some UCPs may be used by the shader, triggering asserts
that too many consts are being uploaded.

While we're at it, also fix the const size when loading UCPs, since
otherwise it doesn't correspond to what the shader is actually using.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5752>

15 months agobifrost: Set RTZ rounding mode for f2i conversion
Chris Forbes [Sat, 4 Jul 2020 22:26:42 +0000 (15:26 -0700)]
bifrost: Set RTZ rounding mode for f2i conversion

Fixes dEQP-GLES2.functional.shaders.conversions.scalar_to_scalar.float_to_int_fragment

Signed-off-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5779>

15 months agotu: Enable KHR_variable_pointers
Connor Abbott [Mon, 29 Jun 2020 17:33:50 +0000 (19:33 +0200)]
tu: Enable KHR_variable_pointers

Passes dEQP-VK.spirv_assembly.instruction.graphics.variable_pointers.*
and dEQP-VK.spirv_assembly.instruction.compute.variable_pointers.*

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

15 months agotu: Rewrite variable lowering
Connor Abbott [Mon, 29 Jun 2020 17:18:20 +0000 (19:18 +0200)]
tu: Rewrite variable lowering

Don't lower to offsets, instead use nir_lower_explicit_io here and
use actual pointers for UBO's and SSBO's. This makes
KHR_variable_pointers trivial. This also fixes asserts with shared
variables, which are now supposed to be lowered with
nir_lower_explicit_io.

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

15 months agoanv: garbage collect timeline semaphore when querying value
Lionel Landwerlin [Mon, 6 Jul 2020 14:11:35 +0000 (17:11 +0300)]
anv: garbage collect timeline semaphore when querying value

If we don't garbage collect the timeline, the value never progresses
even though work completed.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3226
Fixes: 34f32a6d664807 ("anv: implement VK_KHR_timeline_semaphore")
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5774>

15 months agov3d: Enable perpendicular line caps when line smoothing
Neil Roberts [Mon, 22 Jun 2020 10:50:18 +0000 (12:50 +0200)]
v3d: Enable perpendicular line caps when line smoothing

V3D has a bit to set the line caps to be perpendicular to the line
rather than aligned to the edges of the framebuffer. I don’t know what
the disadvantages are of enabling this, but I noticed by experimentation
that enabling line smoothing on the Intel driver also enables nicer line
caps, so it seems nice to enable it here too.

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

15 months agov3d: Add a lowering pass for line smoothing
Neil Roberts [Mon, 22 Jun 2020 12:26:02 +0000 (14:26 +0200)]
v3d: Add a lowering pass for line smoothing

When line smoothing is enabled, the driver now increases the width of
the line so that it can add some semi-transparent pixels to either side
of the line. A lowering pass is added which modifies the alpha component
of every write to fragment output 0 so that if the fragment is outside
the width of the line then the alpha is reduced. It additionally
discards fragments that are completely invisible. It might seem bad to
use discard on a tiled renderer but the assumption is that any bad
effects from using discard will also happen anyway because of enabling
alpha blending.

v2: Disable the line smoothing pass entirely when the framebuffer
    contains an integer colour output or one with no alpha channel.
    Calculate the coverage once upfront and store in a global variable
    instead of calculating each time an output write is modified. Also
    do the conditional discard once upfront.
v3: Don’t check whether the output buffer has an alpha channel. Only
    look at output 0. Use aa_line_width intrinsic instead of calculating
    the real line width in the shader. Clamp the coverage as part of the
    global variable, not per output write.

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

15 months agov3d: Handle the line width intrinsics
Neil Roberts [Mon, 22 Jun 2020 07:52:25 +0000 (09:52 +0200)]
v3d: Handle the line width intrinsics

Adds new QUNIFORMs to store the line widths.

v2: Also handle the aa_line_width intrinsic

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

15 months agonir: Add intrinsics for the line width
Neil Roberts [Mon, 22 Jun 2020 07:49:33 +0000 (09:49 +0200)]
nir: Add intrinsics for the line width

The first intrinsic is intended to expose the value set by glLineWidth
to shaders internally. The second intrinsic exposes the value actually
sent to the hardware. This may be wider than the first one in order to
implement anti-aliasing. These will be used in later patches to
implement a line smoothing lowering pass.

v2: Add a second intrinsic for the expanded line width for
    anti-aliasing.

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

15 months agov3d: Implement the line coord intrinsic
Neil Roberts [Mon, 22 Jun 2020 12:25:08 +0000 (14:25 +0200)]
v3d: Implement the line coord intrinsic

The line coord intrinsic is loaded from the implicit varying stored in
the same slot as the point coord when drawing lines.

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

15 months agocompiler: Add a system value for the line coord
Neil Roberts [Fri, 3 Jul 2020 10:57:36 +0000 (12:57 +0200)]
compiler: Add a system value for the line coord

The line coord is a coordinate along the axis perpendicular to the line.
It is in the range [0,1] between the two edges of the line. It is
available at least on Broadcom hardware.

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

15 months agointel/perf: move query_mask and location out of gen_perf_query_counter
Marcin Ślusarz [Tue, 16 Jun 2020 12:40:21 +0000 (14:40 +0200)]
intel/perf: move query_mask and location out of gen_perf_query_counter

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mark Janes <mark.a.janes@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5399>

15 months agoiris: remove iris_monitor_config
Marcin Ślusarz [Tue, 9 Jun 2020 12:54:10 +0000 (14:54 +0200)]
iris: remove iris_monitor_config

perf_cfg is enough - it already contains almost all necessary
information and is constructed in a more optimal way (O(n) vs O(n^2)
- it uses hash table to build the unique counter list).

"Almost all", because it doesn't contain OA raw counters, but
we should have not exposed them anyway. Quoting Mark Janes:
"I see no reason to include the OA raw counters in the list that
are provided to the user. They are unusable.
The MDAPI library can be used to configure raw counters in a way
that provides esoteric metrics, but that library is written against
INTEL_performance_query."

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mark Janes <mark.a.janes@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5399>

15 months agoa4xx: hook up centroid ij coords
Ilia Mirkin [Mon, 6 Jul 2020 03:16:33 +0000 (23:16 -0400)]
a4xx: hook up centroid ij coords

This is necessary now that the compiler respects centroid interpolation,
even in non-MSAA mode. Otherwise the interpolation doesn't work. Fixes a
bunch of dEQP centroid transform feedback tests.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5778>

15 months agonir: Add docs to nir_lower[_explicit]_io
Jason Ekstrand [Thu, 11 Jun 2020 21:08:06 +0000 (16:08 -0500)]
nir: Add docs to nir_lower[_explicit]_io

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5418>

15 months agonir: Remove shared support from lower_io
Jason Ekstrand [Wed, 10 Jun 2020 17:51:01 +0000 (12:51 -0500)]
nir: Remove shared support from lower_io

No drivers are using this anymore so we can delete it and not keep
maintaining this legacy code-path.  If any drivers want this in the
future, they should use nir_lower_varst_to_explicit_types followed by
nir_lower_explicit_io.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5418>

15 months agonir: Assert that nir_lower_io is only called with allowed modes
Jason Ekstrand [Wed, 10 Jun 2020 17:47:50 +0000 (12:47 -0500)]
nir: Assert that nir_lower_io is only called with allowed modes

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5418>

15 months agopanfrost: Only call nir_lower_io on shader_in/out
Jason Ekstrand [Wed, 10 Jun 2020 22:54:25 +0000 (17:54 -0500)]
panfrost: Only call nir_lower_io on shader_in/out

Gallium drivers should never see nir_var_uniform because gallium lowers
regular uniforms to a UBO.  No GL driver should ever see either
nir_var_mem_shared because that's lowered in GLSL IR.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5418>

15 months agov3d: Only call nir_lower_io on shader_in/out
Jason Ekstrand [Wed, 10 Jun 2020 23:02:39 +0000 (18:02 -0500)]
v3d: Only call nir_lower_io on shader_in/out

Gallium drivers should never see nir_var_uniform because gallium lowers
regular uniforms to a UBO.  No GL driver should ever see either
nir_var_mem_shared because that's lowered in GLSL IR.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5418>

15 months agovc4: Only call nir_lower_io on shader_in/out
Jason Ekstrand [Wed, 10 Jun 2020 22:53:18 +0000 (17:53 -0500)]
vc4: Only call nir_lower_io on shader_in/out

Gallium drivers should never see nir_var_uniform because gallium lowers
regular uniforms to a UBO.  No GL driver should ever see either
nir_var_mem_shared because that's lowered in GLSL IR.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5418>

15 months agonouveau: Only call nir_lower_io on shader_in/out
Jason Ekstrand [Wed, 10 Jun 2020 22:50:37 +0000 (17:50 -0500)]
nouveau: Only call nir_lower_io on shader_in/out

Gallium drivers should never see nir_var_uniform because gallium lowers
regular uniforms to a UBO.  No GL driver should ever see either
nir_var_mem_shared because that's lowered in GLSL IR.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5418>

15 months agolima: Only call nir_lower_io on shader_in/out
Jason Ekstrand [Wed, 10 Jun 2020 22:49:13 +0000 (17:49 -0500)]
lima: Only call nir_lower_io on shader_in/out

Gallium drivers should never see nir_var_uniform because gallium lowers
regular uniforms to a UBO.  No GL driver should ever see either
nir_var_mem_shared because that's lowered in GLSL IR.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5418>

15 months agofreedreno: Only call nir_lower_io on shader_in/out
Jason Ekstrand [Wed, 10 Jun 2020 22:42:15 +0000 (17:42 -0500)]
freedreno: Only call nir_lower_io on shader_in/out

Gallium drivers should never see nir_var_uniform because gallium lowers
regular uniforms to a UBO.  No GL driver should ever see either
nir_var_mem_shared because that's lowered in GLSL IR.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5418>

15 months agoir3: mark ucp_enables as allowed values on all keys
Ilia Mirkin [Sun, 5 Jul 2020 04:19:08 +0000 (00:19 -0400)]
ir3: mark ucp_enables as allowed values on all keys

Both vertex and fragment shaders need to have the lowering.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5751>

15 months agoetnaviv: replace prims-emitted query
Christian Gmeiner [Sun, 5 Jul 2020 11:32:19 +0000 (13:32 +0200)]
etnaviv: replace prims-emitted query

As we do not support stream output buffers we only count the primitives
processed by the pipeline. Use the correct query type.

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

15 months agoa4xx: add polygon offset clamp, fix units
Ilia Mirkin [Mon, 6 Jul 2020 02:06:48 +0000 (22:06 -0400)]
a4xx: add polygon offset clamp, fix units

For some reason, in order to get all tests to pass, pretty much all
hardware (across vendors) has to program in offset_units * 2. This fixes
dEQP-GLES3.functional.polygon_offset.float32_displacement_with_units.

While we're at it, add polygon offset clamp support.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5763>

15 months agoa4xx: add noperspective interpolation support
Ilia Mirkin [Sun, 5 Jul 2020 02:13:32 +0000 (22:13 -0400)]
a4xx: add noperspective interpolation support

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5753>

15 months agonir: add vec2_index_32bit_offset address format
Connor Abbott [Mon, 29 Jun 2020 17:47:57 +0000 (19:47 +0200)]
nir: add vec2_index_32bit_offset address format

For turnip, we use the "bindless" model on a6xx. Loads and stores with
the bindless model require a bindless base, which is an immediate field
in the instruction that selects between 5 different 64-bit "bindless
base registers", a 32-bit descriptor index that's added to the base, and
the usual 32-bit offset. The bindless base usually, but not always,
corresponds to the Vulkan descriptor set.  We can handle the case where
the base is non-constant by using a bunch of if-statements, to make it a
little easier in core NIR, and this seems to be what Qualcomm's driver
does too. Therefore, the pointer format we need to use in NIR has a vec2
index, for the bindless base and descriptor index. Plumb this format
through core NIR.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5683>

15 months agonir: Refactor load/store intrinsic helper
Connor Abbott [Mon, 29 Jun 2020 17:16:26 +0000 (19:16 +0200)]
nir: Refactor load/store intrinsic helper

Add the possibility to specify the source components. This is necessary
to let the UBO/SSBO index have more than one component, and it also lets
us remove a few hand-rolled load intrinsic definitions.

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5683>

15 months agofreedreno/regs: document SS6_UBO state src
Jonathan Marek [Thu, 2 Jul 2020 02:32:06 +0000 (22:32 -0400)]
freedreno/regs: document SS6_UBO state src

Document this new a6xx_state_src value seen in A640/A650 tess traces.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5760>

15 months agofreedreno/fdperf: prefer render node
Rob Clark [Sun, 5 Jul 2020 18:47:15 +0000 (11:47 -0700)]
freedreno/fdperf: prefer render node

Avoid inadvertantly becoming master if fdperf happens to be the first
thing to open the device.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5762>

15 months agofreedreno/fdperf: better compatible string matching
Rob Clark [Sun, 5 Jul 2020 18:35:01 +0000 (11:35 -0700)]
freedreno/fdperf: better compatible string matching

Previously we would match the start of the compatible string, in
a couple of cases, in order to match compatible strings like
"qcom,adreno-630.2".  But these cases would always list a more
generic compatible (ie. "qcom,adreno") as a later choice.  So if
we parse all the compatible strings, we can do a more precise
exact match.

This avoids us accidentially matching on "qcom,adreno-smmu" and
the hilarity that ensues.

Fixes: 5a13507164a ("freedreno/perfcntrs: add fdperf")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5762>

15 months agofreedreno/fdperf: fix print of base address
Rob Clark [Sun, 5 Jul 2020 18:25:42 +0000 (11:25 -0700)]
freedreno/fdperf: fix print of base address

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5762>

15 months agowsi/x11: Log swapchain status changes
Jason Ekstrand [Sat, 27 Jun 2020 18:44:28 +0000 (13:44 -0500)]
wsi/x11: Log swapchain status changes

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

15 months agovulkan/wsi: Don't consider VK_SUBOPTIMAL_KHR to be an error condition
Jason Ekstrand [Sat, 27 Jun 2020 13:50:47 +0000 (08:50 -0500)]
vulkan/wsi: Don't consider VK_SUBOPTIMAL_KHR to be an error condition

This was causing vkAcquireNextImageKHR to not signal the fences and
semaphores.  In the case where the semaphore was brand new, this could
cause an unsignalled syncobj to be passed into execbuffer2 which it will
reject with -EINVAL leading to VK_ERROR_DEVICE_LOST.  Thanks to Henrik
Rydgård who works on the PPSSPP project for helping me figure this out.

Fixes: ca3cfbf6f1e00 "vk: Add an initial implementation of the actual..."
Fixes: 778b51f491cfe "vulkan/wsi: Add a hooks for signaling semaphores..."
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5672>

15 months agoRevert "radv: add support for MRTs compaction to avoid holes"
Bas Nieuwenhuizen [Sun, 5 Jul 2020 17:20:50 +0000 (19:20 +0200)]
Revert "radv: add support for MRTs compaction to avoid holes"

This reverts commit 7a5e6fd25f2e132ef4cacc3a5b714c4e153227b0.

Since we have two different users bisecting issues to this commit, let's
revert.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 7a5e6fd25f2 "radv: add support for MRTs compaction to avoid holes"
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3202
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3228
(Other report in https://gitlab.freedesktop.org/mesa/mesa/-/issues/3151#note_558589)

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

15 months agoradv: Always enable PERFECT_ZPASS_COUNTS.
Bas Nieuwenhuizen [Sun, 5 Jul 2020 16:57:35 +0000 (18:57 +0200)]
radv: Always enable PERFECT_ZPASS_COUNTS.

We have an issue with early depth testing and discard, where
non-perfect counts count the tile if the early depth test succeeds.

We could spend a lot of effort to set this conditionally based
on the presence of the two conditions, but in the presence of
inherited queries let's try this first.

Changing PERFECT_ZPASS_COUNTS since I'm pretty sure this has a lower
performance impact than always using late depth testing.

CC: <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3218
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5757>

15 months agoradv: Set handle types in Android semaphore/fence import.
Bas Nieuwenhuizen [Sun, 5 Jul 2020 17:57:29 +0000 (19:57 +0200)]
radv: Set handle types in Android semaphore/fence import.

Seems like we forgot to set it all this time ...

Fixes: b1444c9ccb0 "radv: Implement VK_ANDROID_native_buffer."
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5759>

15 months agoradv: disable FMASK compression when drawing with GENERAL layout
Samuel Pitoiset [Tue, 3 Dec 2019 13:01:28 +0000 (14:01 +0100)]
radv: disable FMASK compression when drawing with GENERAL layout

Fixes: 96063100 "radv: enable shaderStorageImageMultisample feature on GFX8+"
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3219
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/855
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/3165>

15 months agoRevert "nir: Support sysval tess levels in SPIR-V to NIR"
Jonathan Marek [Sat, 4 Jul 2020 02:11:16 +0000 (22:11 -0400)]
Revert "nir: Support sysval tess levels in SPIR-V to NIR"

This reverts commit d2d4677b56efa0003065b61e39c1ef977c83f7da.

The option is not used by any driver.

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