platform/upstream/mesa.git
2 years agoglsl/linker: get rid of gl_context from atomic counters paths
Dave Airlie [Fri, 7 Jan 2022 01:08:33 +0000 (11:08 +1000)]
glsl/linker: get rid of gl_context from atomic counters paths

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14433>

2 years agoglsl/linker: get rid of gl_context from uniform assign paths
Dave Airlie [Fri, 7 Jan 2022 01:00:21 +0000 (11:00 +1000)]
glsl/linker: get rid of gl_context from uniform assign paths

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14433>

2 years agoglsl/linker: get rid of gl_context from link varyings
Dave Airlie [Fri, 7 Jan 2022 00:56:45 +0000 (10:56 +1000)]
glsl/linker: get rid of gl_context from link varyings

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14433>

2 years agoglsl/linker: remove direct gl_context usage in favour of consts/exts/api
Dave Airlie [Fri, 7 Jan 2022 00:52:30 +0000 (10:52 +1000)]
glsl/linker: remove direct gl_context usage in favour of consts/exts/api

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14433>

2 years agoglsl/linker: move more ctx->Consts to consts.
Dave Airlie [Fri, 7 Jan 2022 00:37:35 +0000 (10:37 +1000)]
glsl/linker: move more ctx->Consts to consts.

Don't pass gl contexts around as much

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14433>

2 years agoglsl/linker: don't pass gl_context just for constants in xfb code
Dave Airlie [Fri, 7 Jan 2022 00:35:02 +0000 (10:35 +1000)]
glsl/linker: don't pass gl_context just for constants in xfb code

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14433>

2 years agoglsl: don't pass gl_context to lower shared references.
Dave Airlie [Fri, 7 Jan 2022 00:33:06 +0000 (10:33 +1000)]
glsl: don't pass gl_context to lower shared references.

this uses the consts only

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14433>

2 years agoglsl/linker: cleanup passing gl_context unnecessarily
Dave Airlie [Fri, 7 Jan 2022 00:31:10 +0000 (10:31 +1000)]
glsl/linker: cleanup passing gl_context unnecessarily

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14433>

2 years agonir_opt_dead_cf: Remove dead ifs
Jesse Natalie [Tue, 4 Jan 2022 16:39:47 +0000 (08:39 -0800)]
nir_opt_dead_cf: Remove dead ifs

An if that looks like:
if (x) { } else { }
That has no phis following it is dead. Currently these are only
removed by peephole select, but that means that 'x' is considered
used until that pass is run, which can make it difficult to apply
sane lowering in the case where loading 'x' requires complex or
expensive transformations, but 'x' is *really* unused.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14400>

2 years agod3d12: Set appropriate caps for shader images
Jesse Natalie [Wed, 29 Dec 2021 00:31:48 +0000 (16:31 -0800)]
d3d12: Set appropriate caps for shader images

Note that currently there's no emulation if the D3D12 driver doesn't
support the "UAV typed load" feature for all of the GL required formats.
This is not a required D3D12 feature, so this support won't light up
on all D3D12 hardware.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agod3d12: Handle bitcasting of shader images
Jesse Natalie [Fri, 31 Dec 2021 01:54:05 +0000 (17:54 -0800)]
d3d12: Handle bitcasting of shader images

This is handled in 2 ways:
* For casts in the same "class," we can just do the cast. There's also
  limited support for 4x8 => 1x32 and 2x16 => 1x32.
* For casts that are just by size, use a lowering pass. This reads the
  data in the appropriate UINT format (except R11G11B10), retrieves
  the original bits, re-packs it into the dest, and returns it to the
  app for loads. For stores, the process is done in reverse - bits
  for the final format are computed and re-expanded to the format that
  should be used for the store.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agod3d12: Handle memory barriers
Jesse Natalie [Wed, 29 Dec 2021 23:55:27 +0000 (15:55 -0800)]
d3d12: Handle memory barriers

This is a bit fragile. The algorithm is essentially:
- Let the driver track state for non-dual-bound resources.
- For resources that are dual-bound as SSBO/image and a second
  bind point, assume they're being used as UAVs.
- When a MemoryBarrier is issued, dirty all destination bind points
  so they re-assert their state, and if the destination is not UAV,
  temporarily suppress UAV state re-assertion.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agod3d12: Lower cube images to 2D arrays via existing int cubemap lowering pass
Jesse Natalie [Wed, 29 Dec 2021 17:59:33 +0000 (09:59 -0800)]
d3d12: Lower cube images to 2D arrays via existing int cubemap lowering pass

Note that the coordinates are not lowered, just types.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agod3d12: Fill out shader image descriptor tables
Jesse Natalie [Wed, 29 Dec 2021 00:29:55 +0000 (16:29 -0800)]
d3d12: Fill out shader image descriptor tables

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agod3d12: Create textures as UAV-capable when appropriate
Jesse Natalie [Wed, 29 Dec 2021 00:29:41 +0000 (16:29 -0800)]
d3d12: Create textures as UAV-capable when appropriate

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agod3d12: Handle set_shader_images
Jesse Natalie [Tue, 28 Dec 2021 23:32:46 +0000 (15:32 -0800)]
d3d12: Handle set_shader_images

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agod3d12: Handle images in the root signature
Jesse Natalie [Tue, 28 Dec 2021 23:33:11 +0000 (15:33 -0800)]
d3d12: Handle images in the root signature

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agod3d12: Retrieve shader image dimensions during shader compiles
Jesse Natalie [Wed, 29 Dec 2021 00:29:13 +0000 (16:29 -0800)]
d3d12: Retrieve shader image dimensions during shader compiles

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agod3d12: Init null UAVs
Jesse Natalie [Wed, 29 Dec 2021 00:28:30 +0000 (16:28 -0800)]
d3d12: Init null UAVs

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agod3d12: Handle format support queries for shader images
Jesse Natalie [Wed, 29 Dec 2021 00:28:05 +0000 (16:28 -0800)]
d3d12: Handle format support queries for shader images

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agod3d12: Figure out if we can support GL shader images
Jesse Natalie [Wed, 29 Dec 2021 00:31:42 +0000 (16:31 -0800)]
d3d12: Figure out if we can support GL shader images

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agod3d12: Add missed SSBO binding enum value
Jesse Natalie [Tue, 28 Dec 2021 23:29:37 +0000 (15:29 -0800)]
d3d12: Add missed SSBO binding enum value

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agod3d12: Rename UAV -> SSBO to disambiguate with image UAVs
Jesse Natalie [Tue, 28 Dec 2021 23:28:38 +0000 (15:28 -0800)]
d3d12: Rename UAV -> SSBO to disambiguate with image UAVs

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agod3d12: Fix format table typeless-ness for A8 and RGBA1010102
Jesse Natalie [Fri, 31 Dec 2021 01:53:23 +0000 (17:53 -0800)]
d3d12: Fix format table typeless-ness for A8 and RGBA1010102

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agod3d12: Shrink 2D array size so that max-layer cube arrays can be created
Jesse Natalie [Fri, 31 Dec 2021 15:23:42 +0000 (07:23 -0800)]
d3d12: Shrink 2D array size so that max-layer cube arrays can be created

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agomicrosoft/compiler: Fix handling of fp16-in-32bit-val ops to handle high bits
Jesse Natalie [Fri, 31 Dec 2021 01:50:51 +0000 (17:50 -0800)]
microsoft/compiler: Fix handling of fp16-in-32bit-val ops to handle high bits

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agomicrosoft/compiler: Hook up memory/control barriers
Jesse Natalie [Wed, 29 Dec 2021 18:38:36 +0000 (10:38 -0800)]
microsoft/compiler: Hook up memory/control barriers

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agomicrosoft/compiler: Handle forced early depth
Jesse Natalie [Wed, 29 Dec 2021 01:54:04 +0000 (17:54 -0800)]
microsoft/compiler: Handle forced early depth

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agomicrosoft/compiler: Implement atomic image ops
Jesse Natalie [Wed, 29 Dec 2021 01:37:32 +0000 (17:37 -0800)]
microsoft/compiler: Implement atomic image ops

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agomicrosoft/compiler: Handle images as derefs for GL
Jesse Natalie [Fri, 31 Dec 2021 01:51:41 +0000 (17:51 -0800)]
microsoft/compiler: Handle images as derefs for GL

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agomicrosoft/compiler: Fix array-of-array handling for derefs of textures/images
Jesse Natalie [Fri, 31 Dec 2021 01:52:11 +0000 (17:52 -0800)]
microsoft/compiler: Fix array-of-array handling for derefs of textures/images

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agomicrosoft/compiler: Emit SRVs/UAVs as arrays
Jesse Natalie [Tue, 28 Dec 2021 22:52:15 +0000 (14:52 -0800)]
microsoft/compiler: Emit SRVs/UAVs as arrays

This is done regardless of size so that "dynamic" indexing with a
uniform can work even on arrays of size 1.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agomicrosoft/compiler: Unify handle retrieval between images and UBO/SSBO
Jesse Natalie [Tue, 28 Dec 2021 22:17:37 +0000 (14:17 -0800)]
microsoft/compiler: Unify handle retrieval between images and UBO/SSBO

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agomicrosoft/compiler: Emit GL images in descriptor space 1 with driver_location instead...
Jesse Natalie [Tue, 28 Dec 2021 21:45:26 +0000 (13:45 -0800)]
microsoft/compiler: Emit GL images in descriptor space 1 with driver_location instead of binding

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agomicrosoft/compiler: Put SSBO and image handles in separate arrays
Jesse Natalie [Tue, 28 Dec 2021 21:39:33 +0000 (13:39 -0800)]
microsoft/compiler: Put SSBO and image handles in separate arrays

In a future change, the bindings for images and SSBOs will start to
overlap in GL (using a separate space to disambiguate them)

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agomicrosoft/compiler: Change vulkan_environment bool to an enum
Jesse Natalie [Tue, 28 Dec 2021 21:13:03 +0000 (13:13 -0800)]
microsoft/compiler: Change vulkan_environment bool to an enum

There are currently 3 different "environments" supported by this backend,
and they have slightly different semantics for how resources are accessed,
which is only going to get a little weirder when GL images start getting
supported. To try to make things less confusing, use an explicit enum
with heavy documentation on what's different between them.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>

2 years agoanv/blorp: Apply pending pipe flushes after PIPELINE_SELECT
Caio Oliveira [Fri, 24 Dec 2021 07:20:10 +0000 (23:20 -0800)]
anv/blorp: Apply pending pipe flushes after PIPELINE_SELECT

Allows the PIPELINE_SELECT change to consume any outstanding flushes.
In case it doesn't, we still apply the pipe flushses afterwards.

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

2 years agoanv: Use pending pipe control mechanism in flush_pipeline_select()
Caio Oliveira [Fri, 24 Dec 2021 07:17:28 +0000 (23:17 -0800)]
anv: Use pending pipe control mechanism in flush_pipeline_select()

This removes the repeated implementation of a workaround and a
per-platform case.

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

2 years agoanv: Add another case to INTEL_DEBUG=pc output
Caio Oliveira [Fri, 24 Dec 2021 07:14:32 +0000 (23:14 -0800)]
anv: Add another case to INTEL_DEBUG=pc output

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

2 years agoradv: Add common entrypoint dependency.
Bas Nieuwenhuizen [Thu, 6 Jan 2022 20:57:28 +0000 (21:57 +0100)]
radv: Add common entrypoint dependency.

To ensure we have the header. The revert likely reintroduced compilation flakiness due
to missing dependencies.

Fixes: a255f6f8230 ("radv: do not use the common entrypoint for the Metro Exodus layer")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14430>

2 years agoradv: Set optimal copy alignment to 1.
Bas Nieuwenhuizen [Wed, 5 Jan 2022 23:57:56 +0000 (00:57 +0100)]
radv: Set optimal copy alignment to 1.

I think we set it to 128 for no reason at all. The app is still
required to align to the texel size.

Note that we prefer 4 bytes for non-formatted buffer->buffer copy,
but that isn't in scope for these properties according to the
Vulkan spec.

It also happens to help hide what looks like an application bug at
this point with Baldurs Gate 3.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5509
Cc: mesa-stable
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14415>

2 years agoradv: fix xfb query copy param ordering
Mike Blumenkrantz [Thu, 6 Jan 2022 17:21:33 +0000 (12:21 -0500)]
radv: fix xfb query copy param ordering

Fixes: afff9dd0f04 ("radv: Use correct buffer size for query pool result copies.")

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14422>

2 years agoradv/winsys: remove unused syncobj functions
Samuel Pitoiset [Mon, 3 Jan 2022 08:38:20 +0000 (09:38 +0100)]
radv/winsys: remove unused syncobj functions

The vulkan common runtime code uses the drm functions directly.

Fixes: 91fe0b5629d ("radv: Delete lots of sync code.")
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/14375>

2 years agoradv: remove remaining dead code related to the old sync code
Samuel Pitoiset [Mon, 3 Jan 2022 08:17:13 +0000 (09:17 +0100)]
radv: remove remaining dead code related to the old sync code

Fixes: 91fe0b5629d ("radv: Delete lots of sync code.")
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/14375>

2 years agovbo/dlist: add vertices to incomplete primitives
Pierre-Eric Pelloux-Prayer [Mon, 3 Jan 2022 09:55:38 +0000 (10:55 +0100)]
vbo/dlist: add vertices to incomplete primitives

If a primitive is added with missing vertices, this will shift all
the vertices and produce incorrect rendering.

In issue #5786 the app uses GL_LINE_STRIPS with a single vertex.

Adding extra vertices can make the initial estimation for the index
buffer size incorrect, so this buffer can now be growed if needed.

Fixes: ac3d4c7635b ("vbo/dlist: convert LINE_STRIPS to LINES")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5786
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14243>

2 years agovbo/dlist: fix loopback crash
Pierre-Eric Pelloux-Prayer [Thu, 16 Dec 2021 16:44:20 +0000 (17:44 +0100)]
vbo/dlist: fix loopback crash

The original code incorrectly adjusted only when Loopback
was false, while primitives' start value is actually
modified unconditionnally.

Fixes: 32535942680 ("vbo/dlist: rework buffer sizes")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5754
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14243>

2 years agoradeonsi/gfx8: use the proper dcc clear size
Pierre-Eric Pelloux-Prayer [Wed, 5 Jan 2022 15:06:25 +0000 (16:06 +0100)]
radeonsi/gfx8: use the proper dcc clear size

dcc_fast_clear_size is assigned using addrlib's dccFastClearSize, which
is computed using the whole surface size (including layers) so we don't
need to multiply dcc_fast_clear_size by num_layers.

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

2 years agoisaspec: Remove duplicate return statement.
Vinson Lee [Thu, 30 Dec 2021 07:51:32 +0000 (23:51 -0800)]
isaspec: Remove duplicate return statement.

Fix defect reported by Coverity Scan.

Structurally dead code (UNREACHABLE)
unreachable: This code cannot be reached: return val;.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14350>

2 years agointel/compiler: Adjust TCS instance-id for dg2+
Jordan Justen [Tue, 14 Jul 2020 05:24:19 +0000 (22:24 -0700)]
intel/compiler: Adjust TCS instance-id for dg2+

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14385>

2 years agoci: skqp: Add documentation on how to maintain skqp jobs
Guilherme Gallo [Wed, 5 Jan 2022 16:35:18 +0000 (13:35 -0300)]
ci: skqp: Add documentation on how to maintain skqp jobs

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14146>

2 years agoci: Add a630_skqp jobs
Guilherme Gallo [Fri, 10 Dec 2021 19:02:58 +0000 (16:02 -0300)]
ci: Add a630_skqp jobs

Start Xorg during skqp job, since it is needed to make rendered tests
work.

There are 1 new job, namely `a630_skqp` which runs GL and GLES backends
and then the skqp GPU unittests.

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

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14146>

2 years agoci: Build skqp on ARM64 images
Guilherme Gallo [Tue, 7 Dec 2021 14:13:00 +0000 (11:13 -0300)]
ci: Build skqp on ARM64 images

This commit makes `kernel+rootfs_arm64` job build and install skqp on
ARM64 devices rootfs.

Skia repository has a tool to prepare skqp models located at
`tools/skqp/cut-release`, which get files from [Skia
Gold](https://skia.org/docs/dev/testing/skiagold/), generate
files.checksum, rendertests.txt and unittests.txt. One gives a range of
commits to let `cut-release` find the right resources to prepare skqp
for the user. However, it is failing, since it fails when trying to get
image packages from a range of commits via HTTPS from the host
https://public-gold.skia.org but it responds with error 404 every time.
I tried a range a thousand of commits, yet it still does not give
results. The workaround employed was to recover the most recent
`files.checksum` and `rendertests.txt` files from the git history and
generate `unittests.txt` from `list_gpu_unit_tests` binary.

`skqp` runs two lists of tests, `rendertests.txt` and `unittests.txt`.
Both must be located inside the `skqp` assets folder.  The first list
uses GL and GLES to test rendering scenarios. The second runs some unit
tests that do not render an image per se.

In order to make the first `a630_skqp` to be green, the crashing tests
were removed from the test lists and the expectations of the failing
ones were updated.

It is worth noting that `rendertests.txt` can bring some detail about
each test expectation, so each test can have a max pixel error count, to
tell `skqp` that it is OK to have at most that number of errors for that
test. See also:
https://github.com/google/skia/blob/main/tools/skqp/README_ALGORITHM.md

As each render backend has a different error count, two different
`rendertests.txt` files were created,
`src/freedreno/ci/freedreno-a630-skqp-gl_rendertests.txt`,
`src/freedreno/ci/freedreno-a630-skqp-gles_rendertests.txt` and
, which one refers to GL and GLES tests respectfully.
The unit tests file for a630 is located at
`src/freedreno/ci/freedreno-a630-skqp_unittests.txt`

```
aaclip
domain
formats
highcontrastfilter
rectangle_texture
yuv_make_color_space
```

```
ProcessorOptimizationValidationTest
VkProtectedContext_CreateNonprotectedContext
VkYCbcrSampler_DrawImageWithYcbcrSampler
VkYCbcrSampler_NoYcbcrSurface
```

Each test was updated with the max_error count equal to the first run result.

```
analytic_antialias_inverse
async_rescale_and_read_dog_down
async_rescale_and_read_dog_up
async_rescale_and_read_rose
async_rescale_and_read_text_down
async_rescale_and_read_text_up
async_rescale_and_read_text_up_large
async_rescale_and_read_yuv420_rose
complexclip2_path_bw
encode-platform
imageblur_large
lcdtextsize
onebadarc
onefailarc
scale-pixels
surfaceprops
textfilter_color
textfilter_image
```

Considering all the following tests results as wrong.

```
async_rescale_and_read_no_bleed
backdrop_imagefilter_croprect_persp
complexclip2
imageblurrepeatmode
mixerCF
overdrawcolorfilter
patch_alpha
patch_primitive
rrect_clip_bw
scaledemoji_rendering
yuv_splitter
```

v2:
  a) add link to HTML report on job log
  b) remove extraneous spaces diff
  c) remove unnecessary conditions from build-skqp.sh
  d) use fixed skqp source commit SHA

v3:
  a) Use only main skia repository to fetch models and build skqp
  b) Use list_gpu_unit_tests binary to create a base unittests.txt file
  c) Remove crashing tests
  d) Set failing tests expectations for the first skqp run

v4:
  a) Remove clang dependency
  b) Separate each skqp backend result into its folder
  c) Regroup a630_skqp in one job

v5:
  a) Separate tests files per driver

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5580
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14146>

2 years agoradv: do not use the common entrypoint for the Metro Exodus layer
Samuel Pitoiset [Wed, 5 Jan 2022 18:01:30 +0000 (19:01 +0100)]
radv: do not use the common entrypoint for the Metro Exodus layer

This is incorrect, it will calls the function recursively.

It seems there is random build failures with common runtime code
and MSVC but that's a different issue.

Closes: #5815
Fixes: 46c59e8fd69 ("radv: Remove dependencies on vk_common entrypoints.")
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/14374>

2 years agoetnaviv: initialize vertex attributes on context reset
Lucas Stach [Tue, 21 Dec 2021 20:58:07 +0000 (21:58 +0100)]
etnaviv: initialize vertex attributes on context reset

It seems that at least some GC400 come out of reset with random vertex
attributes enabled and also don't disable them on the write to the first
config register as normal. Enabling all attributes seems to provide the
GPU with the required edge to actually disable the unused attributes on
the next draw.

Cc: mesa-stable
Reported-by: Steven Walter
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/14285>

2 years agor300: Fix omod failing to increase the number of channels stored.
Emma Anholt [Wed, 5 Jan 2022 00:51:01 +0000 (16:51 -0800)]
r300: Fix omod failing to increase the number of channels stored.

In dEQP-GLES2.functional.shaders.operator.geometric.reflect.highp_vec2_fragment
and friends this pass would turn:

  0: DP3 temp[1].x, input[1].yx0_, input[0].wy0_;
  1: MUL temp[2].xy, temp[1].xx__, const[0].xx__;

into

  0: DP3 temp[2].x * 2, input[1].yx0_, input[0].wy0_;
  1: MUL temp[3].xy, temp[2].xy__, input[1].yx__;

Note the attempt to use .y of temp[2].  Just bail when we more dst
channels than src channels, since the rewrite can't generate more channels
for us.  Fixes this subset of tests (which I hadn't included in the xfails
until now since results hadn't quite been stable).

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Filip Gawin <filip.gawin@zoho.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14405>

2 years agoci/r300: Update xfails from a full dEQP run.
Emma Anholt [Wed, 5 Jan 2022 00:56:14 +0000 (16:56 -0800)]
ci/r300: Update xfails from a full dEQP run.

I can now run the whole thing instead of doing subsets, so update for
that.

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

2 years agor300: Use uif() instead of pointer aliasing in program printing.
Emma Anholt [Wed, 5 Jan 2022 00:20:28 +0000 (16:20 -0800)]
r300: Use uif() instead of pointer aliasing in program printing.

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

2 years agov3dv: Use the common QueueSignalReleaseImageANDROID from RADV
Jason Ekstrand [Sun, 2 Jan 2022 05:08:48 +0000 (23:08 -0600)]
v3dv: Use the common QueueSignalReleaseImageANDROID from RADV

This is an actual functional change as we now plumb through the sync FD
instead of doing a vkQueueSubmit and trusting in implicit sync.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Tested-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14372>

2 years agoanv: Use the common QueueSignalReleaseImageANDROID from RADV
Jason Ekstrand [Sun, 2 Jan 2022 05:06:13 +0000 (23:06 -0600)]
anv: Use the common QueueSignalReleaseImageANDROID from RADV

This is an actual functional change as we now plumb through the sync FD
instead of doing a vkQueueSubmit and trusting in implicit sync.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14372>

2 years agoradv: Move QueueSignalReleaseImageANDROID to common code
Jason Ekstrand [Sun, 2 Jan 2022 05:03:36 +0000 (23:03 -0600)]
radv: Move QueueSignalReleaseImageANDROID to common code

This is mostly a copy+paste job but with a few syntax changes to make it
follow more closely with other common Vulkan code.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14372>

2 years agoanv,radv,v3dv: Move AcquireImageANDROID to common code
Jason Ekstrand [Sun, 2 Jan 2022 04:51:59 +0000 (22:51 -0600)]
anv,radv,v3dv: Move AcquireImageANDROID to common code

All three implementations are identical.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Tested-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14372>

2 years agofrontends/va/enc: default motion estimation parameters for performance
Thong Thai [Wed, 29 Dec 2021 16:37:45 +0000 (11:37 -0500)]
frontends/va/enc: default motion estimation parameters for performance

Sets the default motion estimation parameters for the H.264 encoder to
values that increase encoding performance - realistically, this only
benefits the VCE encoder, as the parameters are used no where else.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3540
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2702
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14339>

2 years agozink: fix -Warray-bounds warning
Michel Zou [Sat, 28 Aug 2021 11:45:40 +0000 (13:45 +0200)]
zink: fix -Warray-bounds warning

It would seems msvc and mingw dont pack across disparate types so zink_bind_rasterizer_state is too big for int32

string.h:202:10: warning: ‘__builtin___memcpy_chk’ forming offset [4, 7] is out of the bounds [0, 4] of object ‘rast_bits’ with type ‘uint32_t’ {aka ‘unsigned int’} [-Warray-bounds]
  202 |   return __builtin___memcpy_chk(__dst, __src, __n, __mingw_bos(__dst, 0));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/gallium/drivers/zink/zink_state.c: In function ‘zink_bind_rasterizer_state’:
../src/gallium/drivers/zink/zink_state.c:586:16: note: ‘rast_bits’ declared here

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

2 years agoradeonsi: print the number of param exports for shader-db
Marek Olšák [Mon, 3 Jan 2022 09:21:42 +0000 (04:21 -0500)]
radeonsi: print the number of param exports for shader-db

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

2 years agoradeonsi: print all streamout info
Marek Olšák [Sun, 2 Jan 2022 04:26:07 +0000 (23:26 -0500)]
radeonsi: print all streamout info

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

2 years agoac/nir: move ac_are_tessfactors_def_in_all_invocs into radeonsi
Marek Olšák [Thu, 23 Dec 2021 00:40:03 +0000 (19:40 -0500)]
ac/nir: move ac_are_tessfactors_def_in_all_invocs into radeonsi

radv isn't going to use it because it's for the TCS epilog

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

2 years agoac: move ac_exp_param.h to ac_nir.h
Marek Olšák [Mon, 13 Dec 2021 01:20:36 +0000 (20:20 -0500)]
ac: move ac_exp_param.h to ac_nir.h

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

2 years agoradeonsi: move the GS copy shader into shader variants
Marek Olšák [Mon, 20 Dec 2021 02:04:56 +0000 (21:04 -0500)]
radeonsi: move the GS copy shader into shader variants

This will allow further optimizations for shader variants that change
GS outputs (affecting the copy shader), and this is mainly about sharing
optimizations with NGG instead of having a totally separate codepath for
legacy GS.

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

2 years agoradeonsi: add into the disk cache key whether cached shaders contain LLVM IR
Marek Olšák [Wed, 29 Dec 2021 00:10:07 +0000 (19:10 -0500)]
radeonsi: add into the disk cache key whether cached shaders contain LLVM IR

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

2 years agoradeonsi: move si_nir_scan_shader into si_shader_info.c
Marek Olšák [Thu, 23 Dec 2021 00:32:06 +0000 (19:32 -0500)]
radeonsi: move si_nir_scan_shader into si_shader_info.c

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

2 years agoradeonsi: change si_shader_output_values::vertex_stream to a bitmask
Marek Olšák [Mon, 13 Dec 2021 06:14:44 +0000 (01:14 -0500)]
radeonsi: change si_shader_output_values::vertex_stream to a bitmask

to match si_shader_info.

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

2 years agoradeonsi: use nir->scratch_size instead of ac_count_scratch_private_memory
Marek Olšák [Sun, 12 Dec 2021 04:56:20 +0000 (23:56 -0500)]
radeonsi: use nir->scratch_size instead of ac_count_scratch_private_memory

It's the same.

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

2 years agoradeonsi: do opt_large_constants & lower_indirect_derefs after uniform inlining
Marek Olšák [Sun, 12 Dec 2021 04:51:03 +0000 (23:51 -0500)]
radeonsi: do opt_large_constants & lower_indirect_derefs after uniform inlining

because loop unrolling caused by uniform inlining can eliminate large constants
and indirect derefs.

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

2 years agoradeonsi: move smoothing to the main shader part to remove 1 live VGPR
Marek Olšák [Mon, 13 Dec 2021 19:36:37 +0000 (14:36 -0500)]
radeonsi: move smoothing to the main shader part to remove 1 live VGPR

The samplemask VGPR that we had to pass to the epilog increased VGPR usage
by 1 for all shaders. Do it in the main function by using the mono key
structure, which causes on-demand compilation and stall, but we'll save
the VGPR.

57794 shaders in 35145 tests
Totals:
SGPRS: 2715856 -> 2716272 (0.02 %)
VGPRS: 1776168 -> 1718432 (-3.25 %)
Spilled SGPRs: 3704 -> 3630 (-2.00 %)
Spilled VGPRs: 1727 -> 1733 (0.35 %)
Private memory VGPRs: 256 -> 256 (0.00 %)
Scratch size: 2008 -> 2016 (0.40 %) dwords per thread
Code Size: 61429584 -> 61393288 (-0.06 %) bytes
Max Waves: 838645 -> 840484 (0.22 %)

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

2 years agoradeonsi: pass sample_coverage VGPR index to the PS prolog instead of guessing
Marek Olšák [Tue, 14 Dec 2021 03:37:41 +0000 (22:37 -0500)]
radeonsi: pass sample_coverage VGPR index to the PS prolog instead of guessing

The code was correct, but little confusing. This is cleaner.

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

2 years agoradeonsi: remove unused si_shader::prolog2
Marek Olšák [Mon, 20 Dec 2021 01:48:45 +0000 (20:48 -0500)]
radeonsi: remove unused si_shader::prolog2

This became unused when the GS prolog was removed.

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

2 years agoradeonsi: don't bind the ESGS ring twice, handle the difference in the shader
Marek Olšák [Sat, 18 Dec 2021 14:22:57 +0000 (09:22 -0500)]
radeonsi: don't bind the ESGS ring twice, handle the difference in the shader

The other shader is changed to modify the descriptor to get the required
values.

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

2 years agoradeonsi: reorder slots for internal buffers, reuse a slot for GS_QUERY_BUF
Marek Olšák [Sat, 18 Dec 2021 13:41:37 +0000 (08:41 -0500)]
radeonsi: reorder slots for internal buffers, reuse a slot for GS_QUERY_BUF

GFX10_GS_QUERY_BUF is also renamed.

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

2 years agoradeonsi: simplify compacted_mrt_index in si_export_mrt_color
Marek Olšák [Sat, 18 Dec 2021 08:57:14 +0000 (03:57 -0500)]
radeonsi: simplify compacted_mrt_index in si_export_mrt_color

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

2 years agoradeonsi: export mrtz before color exports
Marek Olšák [Fri, 17 Dec 2021 20:18:54 +0000 (15:18 -0500)]
radeonsi: export mrtz before color exports

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

2 years agoradeonsi: remove unnecessary code that was used to find the last export
Marek Olšák [Fri, 17 Dec 2021 20:15:49 +0000 (15:15 -0500)]
radeonsi: remove unnecessary code that was used to find the last export

We can do it trivially like this.

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

2 years agoradeonsi: set done=1 for PS exports at the end of si_llvm_build_ps_epilog
Marek Olšák [Fri, 17 Dec 2021 19:21:19 +0000 (14:21 -0500)]
radeonsi: set done=1 for PS exports at the end of si_llvm_build_ps_epilog

so that we can reorder the exports

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

2 years agoradeonsi: clean up si_export_mrt_color
Marek Olšák [Fri, 17 Dec 2021 18:45:56 +0000 (13:45 -0500)]
radeonsi: clean up si_export_mrt_color

Remove the intermediate args variable.

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

2 years agoradeonsi: make get_thread_id_in_tg non-static
Marek Olšák [Thu, 23 Sep 2021 16:13:08 +0000 (12:13 -0400)]
radeonsi: make get_thread_id_in_tg non-static

for future work

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

2 years agoradeonsi: modifiers can't disable DCC
Marek Olšák [Sat, 18 Dec 2021 22:04:32 +0000 (17:04 -0500)]
radeonsi: modifiers can't disable DCC

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

2 years agoac/llvm: remove the num_channels parameter from ac_build_buffer_store_dword
Marek Olšák [Mon, 3 Jan 2022 19:04:57 +0000 (14:04 -0500)]
ac/llvm: remove the num_channels parameter from ac_build_buffer_store_dword

It was used when LLVM didn't support vec3 and we had to pass vec4
with num_channels=3. We no longer need to do that.

This also removes the vec3 splitting or conversion to vec4 in callers.

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

2 years agoac/llvm: add vindex into ac_build_buffer_store_dword
Marek Olšák [Thu, 23 Sep 2021 15:11:07 +0000 (11:11 -0400)]
ac/llvm: add vindex into ac_build_buffer_store_dword

for future work

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

2 years agoamd/registers: work around an assertion in parse_kernel_headers.py
Marek Olšák [Thu, 9 Dec 2021 04:31:39 +0000 (23:31 -0500)]
amd/registers: work around an assertion in parse_kernel_headers.py

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

2 years agov3dv: add a refcount mechanism to BOs
Iago Toral Quiroga [Tue, 4 Jan 2022 11:56:42 +0000 (12:56 +0100)]
v3dv: add a refcount mechanism to BOs

Until now we have lived without a refcount mechanism in the driver
because in Vulkan the user is responsible for handling the life
span of memory allocations for all Vulkan objects, however,
imported BOs are tricky because the kernel doesn't refcount
so user-space needs to make sure that:

1. When importing a BO into the same device used to create it
   (self-importing) it does not double free the same BO.
2. Frees imported BOs that were not allocated through the same
   device.

Our initial implementation always freed BOs when requested,
so we handled 2) correctly but not 1) and we would double-free
self-imported BOs. We tried to fix that in commit d809d9f3
but that broke 2) and we started to leak BOs for some imports.

This fixes the problem for good by adding refcounts to BOs
so that self-imported BOs have a refcnt > 1 and are only freed
when all references are freed.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5769
Tested-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14392>

2 years agoradeonsi: decrease the size of si_pm4_state::pm4 except for cs_preamble_state
Marek Olšák [Thu, 9 Dec 2021 00:00:08 +0000 (19:00 -0500)]
radeonsi: decrease the size of si_pm4_state::pm4 except for cs_preamble_state

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

2 years agoradeonsi: replace SI_PM4_MAX_DW with a max_dw field
Marek Olšák [Wed, 8 Dec 2021 23:40:58 +0000 (18:40 -0500)]
radeonsi: replace SI_PM4_MAX_DW with a max_dw field

it will vary

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

2 years agoradeonsi: pack si_pm4_state
Marek Olšák [Wed, 8 Dec 2021 23:32:33 +0000 (18:32 -0500)]
radeonsi: pack si_pm4_state

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

2 years agoradv: apply spi_cu_en to CU_EN
Marek Olšák [Wed, 8 Dec 2021 08:10:24 +0000 (03:10 -0500)]
radv: apply spi_cu_en to CU_EN

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

2 years agoradv: set COMPUTE_DESTINATION_EN_SEn to spi_cu_en
Marek Olšák [Wed, 8 Dec 2021 05:56:03 +0000 (00:56 -0500)]
radv: set COMPUTE_DESTINATION_EN_SEn to spi_cu_en

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

2 years agoradeonsi: apply spi_cu_en to CU_EN
Marek Olšák [Wed, 8 Dec 2021 07:15:50 +0000 (02:15 -0500)]
radeonsi: apply spi_cu_en to CU_EN

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

2 years agoradeonsi: program COMPUTE_STATIC_THREAD_MGMT_SE4..7 on Arcturus
Marek Olšák [Wed, 8 Dec 2021 06:11:21 +0000 (01:11 -0500)]
radeonsi: program COMPUTE_STATIC_THREAD_MGMT_SE4..7 on Arcturus

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

2 years agoradeonsi: set COMPUTE_DESTINATION_EN_SEn to spi_cu_en
Marek Olšák [Wed, 8 Dec 2021 05:56:03 +0000 (00:56 -0500)]
radeonsi: set COMPUTE_DESTINATION_EN_SEn to spi_cu_en

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

2 years agoac/gpu_info: add AMD_CU_MASK environment variable to set CU_EN
Marek Olšák [Wed, 8 Dec 2021 05:33:10 +0000 (00:33 -0500)]
ac/gpu_info: add AMD_CU_MASK environment variable to set CU_EN

requested internally

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

2 years agoac/gpu_info: set cu_mask correctly for Arcturus
Marek Olšák [Wed, 8 Dec 2021 04:23:21 +0000 (23:23 -0500)]
ac/gpu_info: set cu_mask correctly for Arcturus

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

2 years agoi915g: Turn off FP16 in the vertex shaders.
Emma Anholt [Mon, 20 Dec 2021 23:15:38 +0000 (15:15 -0800)]
i915g: Turn off FP16 in the vertex shaders.

This ended up being turned on in gallivm, but since we use nir_to_tgsi on
the VS and TGSI doesn't have FP16, we can't let that happen.

Fixes: f814a2449e2c ("llvmpipe: enable FP16 and update CL + traces piglit results.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14403>