platform/upstream/mesa.git
18 months agointel/dev: Move i915 code to i915/intel_device_info.c
José Roberto de Souza [Mon, 22 Aug 2022 18:44:53 +0000 (11:44 -0700)]
intel/dev: Move i915 code to i915/intel_device_info.c

No behavior changes here.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20437>

18 months agointel/dev: Export functions that will be used by different kernel drivers
José Roberto de Souza [Mon, 22 Aug 2022 18:14:36 +0000 (11:14 -0700)]
intel/dev: Export functions that will be used by different kernel drivers

No behavior changes here.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20437>

18 months agoradv: remove an old FIXME about a possible bug with TC-compat HTILE
Samuel Pitoiset [Thu, 19 Jan 2023 09:14:53 +0000 (10:14 +0100)]
radv: remove an old FIXME about a possible bug with TC-compat HTILE

I added this FIXME 2 years ago because it was unclear if it was
broken or not. Since, CTS coverage improved and the number of tests
with depth/stencil on the compute queue increased a lot. vkd3d-proton
also widely uses depth/stencil with GENERAL on GFX10+ and likely with
async compute as well. No issues so far.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4048
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20785>

18 months agofreedreno: Add driconf to disable conservative LRZ
Rob Clark [Mon, 16 Jan 2023 16:35:06 +0000 (08:35 -0800)]
freedreno: Add driconf to disable conservative LRZ

The problematic sequence of draws is pretty rare.  But there are a small
handful of games which do not exhibit the problematic sequence and for
which invalidating LRZ on draws with blend plus depthwrite enabled hurts
performance slightly.  This driconf option enables opting in to the
previous behavior.

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

18 months agoutil/xmlconfig: Use os_get_option()
Rob Clark [Mon, 16 Jan 2023 16:38:03 +0000 (08:38 -0800)]
util/xmlconfig: Use os_get_option()

Enable the property_get() fallback on android.

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

18 months agoturnip: Invalidate LRZ on blend+depthwrite
Rob Clark [Sat, 14 Jan 2023 19:18:26 +0000 (11:18 -0800)]
turnip: Invalidate LRZ on blend+depthwrite

See the previous commit for details.

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

18 months agoturnip: Rename lrz force_disable_mask
Rob Clark [Tue, 17 Jan 2023 16:41:54 +0000 (08:41 -0800)]
turnip: Rename lrz force_disable_mask

Prep to use it to communicate more than just force-disable cases.

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

18 months agofreedreno/a6xx: Invalidate LRZ on blend+depthwrite
Rob Clark [Sat, 14 Jan 2023 18:17:53 +0000 (10:17 -0800)]
freedreno/a6xx: Invalidate LRZ on blend+depthwrite

Writing depth with blend enabled means we need to invalidate LRZ,
because the written depth value could mean that a later draw with
depth enabled (where we would otherwise write LRZ) could have
fragments which don't pass the depth test due to this draw.  For
example, consider this sequence of draws, with depth mode GREATER:

  draw A:
    z=0.1, fragments pass
  draw B:
    z=0.4, fragments pass
    blend enabled (LRZ write disabled)
    depth write enabled
  draw C:
    z=0.2, fragments don't pass
    blend disabled
    depth write enabled

Normally looking at the state in draw C, we'd assume we could
enable LRZ write.  But this would cause early-z/lrz to discard
fragments from draw A which should be visible due to draw B.

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

18 months agofreedreno/a6xx: Add LRZ perf warn for ztest direction changes
Rob Clark [Sat, 14 Jan 2023 18:16:36 +0000 (10:16 -0800)]
freedreno/a6xx: Add LRZ perf warn for ztest direction changes

Add a perf warning when LRZ invalidate happens due to depth test
direction reversal.

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

18 months agogallium/util: Add util_writes_depth() helper
Rob Clark [Sat, 14 Jan 2023 17:31:54 +0000 (09:31 -0800)]
gallium/util: Add util_writes_depth() helper

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

18 months agoradeonsi: report 0 block size for Polaris HEVC encoding
Rose Hudson [Sun, 15 Jan 2023 12:20:07 +0000 (12:20 +0000)]
radeonsi: report 0 block size for Polaris HEVC encoding

makes encoded videos resemble the input again :)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7992
Fixes: c4482a3c1a9 ("radeonsi/vcn: enable multi-slice encoding")
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20714>

18 months agoradv: Make NGG query emission a dirty flag.
Timur Kristóf [Tue, 10 Jan 2023 22:39:42 +0000 (23:39 +0100)]
radv: Make NGG query emission a dirty flag.

Don't emit the NGG query user SGPR if its state doesn't change.
Based on original work by Mike Blumenkrantz.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18819>

18 months agoiris: add restrictions for 3DSTATE_RASTER::AntiAliasingEnable
Tapani Pälli [Thu, 12 Jan 2023 12:17:12 +0000 (14:17 +0200)]
iris: add restrictions for 3DSTATE_RASTER::AntiAliasingEnable

Field must be disabled if any render targets have integer
format, additionally for Gfx12+ field must be disabled when
num multisamples > 1 or forced multisample count > 1.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7892
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
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/20671>

18 months agohasvk: add restrictions for 3DSTATE_RASTER::AntiAliasingEnable
Tapani Pälli [Fri, 13 Jan 2023 13:52:00 +0000 (15:52 +0200)]
hasvk: add restrictions for 3DSTATE_RASTER::AntiAliasingEnable

Field must be disabled if any render targets have integer format.

Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20671>

18 months agoanv: add restrictions for 3DSTATE_RASTER::AntiAliasingEnable
Tapani Pälli [Thu, 12 Jan 2023 16:33:25 +0000 (18:33 +0200)]
anv: add restrictions for 3DSTATE_RASTER::AntiAliasingEnable

Field must be disabled if any render targets have integer
format, additionally for Gfx12+ field must be disabled when
num multisamples > 1 or forced multisample count > 1.

Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20671>

18 months agoradv: advertise extendedDynamicState3ColorBlendEquation
Samuel Pitoiset [Thu, 24 Nov 2022 15:01:45 +0000 (16:01 +0100)]
radv: advertise extendedDynamicState3ColorBlendEquation

This enables full ds3 support with Zink!

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

18 months agoradv: fix detecting that blend is enabled when all CB states are dynamic
Samuel Pitoiset [Fri, 9 Dec 2022 10:16:53 +0000 (11:16 +0100)]
radv: fix detecting that blend is enabled when all CB states are dynamic

It's allowed to be NULL.

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

18 months agoradv: enable compiling PS epilogs on-demand for dynamic color blend equations
Samuel Pitoiset [Tue, 10 Jan 2023 09:48:01 +0000 (10:48 +0100)]
radv: enable compiling PS epilogs on-demand for dynamic color blend equations

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

18 months agoradv: add support for dynamic blend equation
Samuel Pitoiset [Fri, 6 Jan 2023 14:29:44 +0000 (15:29 +0100)]
radv: add support for dynamic blend equation

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

18 months agoradv: add a new helper for normalizing blend factors
Samuel Pitoiset [Wed, 18 Jan 2023 07:25:54 +0000 (08:25 +0100)]
radv: add a new helper for normalizing blend factors

It will be also used when compiling PS epilogs on-demand.

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

18 months agoradv: move some color blend helpers to radv_private.h
Samuel Pitoiset [Fri, 25 Nov 2022 08:08:08 +0000 (09:08 +0100)]
radv: move some color blend helpers to radv_private.h

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

18 months agozink/ci: add spec@!opengl 1.1@line-smooth-stipple to the fails list
Martin Roukala (né Peres) [Fri, 20 Jan 2023 07:45:58 +0000 (09:45 +0200)]
zink/ci: add spec@!opengl 1.1@line-smooth-stipple to the fails list

Fixes: a8d2b288eee3 ("ci/piglit: 2023-01-19 uprev")
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20807>

18 months agoiris: Don't flush the render cache for a compute batch
Rohan Garg [Wed, 18 Jan 2023 15:00:24 +0000 (16:00 +0100)]
iris: Don't flush the render cache for a compute batch

Make sure we comply with BSpec and ensure that certain flush flags
are not set for compute batches

Signed-off-by: Rohan Garg's avatarRohan Garg <rohan.garg@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15664>

18 months agotu/kgsl: do not use kgsl_command_object::offset
Danylo Piliaiev [Thu, 19 Jan 2023 18:59:24 +0000 (19:59 +0100)]
tu/kgsl: do not use kgsl_command_object::offset

offset field in kgsl_command_object is NOT used by KGSL, so
we should offset directly to iova.

Fixes weird hangs on KGSL. E.g. fixes the hang in:
 dEQP-VK.memory.pipeline_barrier.transfer_dst_storage_texel_buffer.1024

cc: mesa-stable

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

18 months agoanv: uncompressed views of compressed 3d images are now valid
Iván Briano [Thu, 19 Jan 2023 23:23:56 +0000 (15:23 -0800)]
anv: uncompressed views of compressed 3d images are now valid

There was a VUID-VkImageViewCreateInfo-image-04739 in the Vulkan 1.3
spec that said:

    If image was created with the
    VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag and format is a
    non-compressed format, viewType must not be VK_IMAGE_VIEW_TYPE_3D

That VUID has since been removed, and when a view of a 3D image is
created, with put the depth into the array_len, so it won't be always 1.

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

18 months agoradv: Fix depth-only-with-discard when epilogs are used.
Tatsuyuki Ishi [Sat, 14 Jan 2023 09:30:32 +0000 (18:30 +0900)]
radv: Fix depth-only-with-discard when epilogs are used.

For a depth-only-with-discard pipeline, spi_shader_col_format needs to be
fixed up to a single channel export, or otherwise discard will not work.

Since col_format can change depending on the dynamic state, precompute the
need for this workaround on pipeline creation and apply it when emitting
prolog states.

Fixes: eb07a11b8f4 ("radv: add support for compiling PS epilogs on-demand")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20704>

18 months agomeson: use sections in summary()
Thomas H.P. Andersen [Wed, 18 Jan 2023 21:56:39 +0000 (22:56 +0100)]
meson: use sections in summary()

Makes the list easier to read

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12161>

18 months agomeson: use summary()
Thomas H.P. Andersen [Mon, 2 Aug 2021 00:10:11 +0000 (02:10 +0200)]
meson: use summary()

Make use of mesons summary() to create and align the configuration
summary.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12161>

18 months agodzn: Rework meta blit VS
Jesse Natalie [Thu, 19 Jan 2023 00:31:02 +0000 (16:31 -0800)]
dzn: Rework meta blit VS

Some D3D12 drivers, like my PC's AMD driver, don't like using a
dynamic index to load from a constant buffer that's bound via
root constants. Instead, just go ahead and load the full set of
vertex data and just bcsel which one to use.

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

18 months agodzn: Delete an unnecessary assert
Jesse Natalie [Thu, 19 Jan 2023 00:30:23 +0000 (16:30 -0800)]
dzn: Delete an unnecessary assert

As far as I can tell, having multiple levels in the view for a
color target just means to target the first one.

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

18 months agodzn: Enable independent blending
Jesse Natalie [Thu, 19 Jan 2023 00:29:52 +0000 (16:29 -0800)]
dzn: Enable independent blending

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

18 months agoci: bump ci-fairy with session support (robust downloads)
David Heidelberg [Thu, 19 Jan 2023 15:09:13 +0000 (16:09 +0100)]
ci: bump ci-fairy with session support (robust downloads)

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20788>

18 months agoci/piglit: 2023-01-19 uprev
David Heidelberg [Thu, 19 Jan 2023 14:10:23 +0000 (15:10 +0100)]
ci/piglit: 2023-01-19 uprev

Emergency uprev to get robustness against http 50x errors for traces.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20788>

18 months agoci: migrate from wget to curl
David Heidelberg [Wed, 18 Jan 2023 23:26:03 +0000 (00:26 +0100)]
ci: migrate from wget to curl

Better error handling is more reliable.

Options:
 -L, follow location
 --retry, number of retries
 --retry-all-errors, does not fail on ALL errors, that's why there is -f
 -f, fail fast with no output at all on server errors
 --retry-delay, make curl sleep this amount of time before each retry

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20788>

18 months agoci/piglit: explicitely define we want GLX tests
David Heidelberg [Thu, 19 Jan 2023 16:37:14 +0000 (17:37 +0100)]
ci/piglit: explicitely define we want GLX tests

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20788>

18 months agomeson: use the same workaround for setting 'lib' on windows
Dylan Baker [Tue, 17 Jan 2023 18:11:13 +0000 (10:11 -0800)]
meson: use the same workaround for setting 'lib' on windows

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20752>

18 months agomeson: use [] instead of 'lib for !windows name_prefix
Dylan Baker [Tue, 17 Jan 2023 18:09:18 +0000 (10:09 -0800)]
meson: use [] instead of 'lib for !windows name_prefix

This is a poorly documented value that uses the default value, but
doesn't emit a warning. In the future Meson will fix this.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20752>

18 months agomeson: use builtin support for reading version from a file
Dylan Baker [Tue, 17 Jan 2023 17:50:26 +0000 (09:50 -0800)]
meson: use builtin support for reading version from a file

In meson 0.57 support was added for reading a version from a file to
meson natively, so we don't need this workaround anymore.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20752>

18 months agomeson: remove version checks for < 0.59
Dylan Baker [Tue, 17 Jan 2023 17:46:41 +0000 (09:46 -0800)]
meson: remove version checks for < 0.59

Which is now required, so these are useless

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20752>

18 months agodzn: Enable multiview
Jesse Natalie [Wed, 11 Jan 2023 21:09:49 +0000 (13:09 -0800)]
dzn: Enable multiview

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

18 months agodzn: Implement multiview queries
Jesse Natalie [Wed, 11 Jan 2023 19:03:20 +0000 (11:03 -0800)]
dzn: Implement multiview queries

This is a weird way to do queries, but in multiview, each query
takes up N slots, where N is the number of views. D3D doesn't do
it that way, and only has one result, which fortunately is a valid
way to do Vulkan queries. We just need to take care to zero out
the other view results, and make sure they get "signaled" when
the cmdbuf is submitted.

Note that it is invalid in D3D to use ResolveQueryData on query
slots that have never actually been begun/ended, so we zero out
the data by copying zeroes into the buffer. This probably could
be optimized but oh well.

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

18 months agodzn: Handle draws and clears for multiview rendering
Jesse Natalie [Wed, 11 Jan 2023 19:00:46 +0000 (11:00 -0800)]
dzn: Handle draws and clears for multiview rendering

For draws, when we're emulating multiview, we need to loop them
and set up the right sysval. For clears, we always need to loop.
When not emulating, we also need to set up the right view instance
mask.

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

18 months agodzn: Handle multiview pipeline creation
Jesse Natalie [Wed, 11 Jan 2023 18:57:39 +0000 (10:57 -0800)]
dzn: Handle multiview pipeline creation

This handles both native and emulated pipeline creation

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

18 months agodzn: Put nir compilation options in a struct
Jesse Natalie [Wed, 11 Jan 2023 18:56:10 +0000 (10:56 -0800)]
dzn: Put nir compilation options in a struct

The function signatures are getting unwieldly...

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

18 months agospirv2dxil: Claim multiview support
Jesse Natalie [Wed, 11 Jan 2023 18:53:55 +0000 (10:53 -0800)]
spirv2dxil: Claim multiview support

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

18 months agospirv2dxil: Implement lowering for multiview
Jesse Natalie [Wed, 11 Jan 2023 18:53:45 +0000 (10:53 -0800)]
spirv2dxil: Implement lowering for multiview

D3D's view instancing is an optional feature, and even when it's
supported, it only goes up to 4 views, where Vulkan requires a
minimum of 6 supported views. So, we need to have a path for handling
the cases where we can't use the native feature.

In this mode, pass the view ID as a runtime var. The caller is then
responsible for looping the draw calls and filling out the constant
buffer value correctly for each draw. When we get to the last pre-rast
stage, we'll additionally want to write out gl_Layer to select the
right RTV array slice. Lastly, for the fragment shader, if there's
any input attachments, those get loaded using the RTV slice instead
of the view ID. RTV slice input into the PS is done with a signature
entry (which must be output from the previous stage) rather than a
system value.

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

18 months agospirv2dxil: Pass runtime conf struct to lower_shader_system_values
Jesse Natalie [Wed, 11 Jan 2023 18:48:16 +0000 (10:48 -0800)]
spirv2dxil: Pass runtime conf struct to lower_shader_system_values

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

18 months agomicrosoft/compiler: Support view instancing
Jesse Natalie [Wed, 11 Jan 2023 18:46:51 +0000 (10:46 -0800)]
microsoft/compiler: Support view instancing

This adds support for D3D12-native view instancing to the compiler.
Essentially, it's just the ability to load SV_ViewID (dx.op.viewID),
set the right capability, and fill out some more PSV data. Note that
the PSV data is currently garbage. Ideally, we'd fill out a proper
input -> output and viewID -> output dependency table, but AFAIK
this is only used to enforce D3D API validation, and drivers ignore
it, so it's less critical to get it right.

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

18 months agomicrosoft/compiler: Delete stale TODO comment
Jesse Natalie [Wed, 11 Jan 2023 18:44:51 +0000 (10:44 -0800)]
microsoft/compiler: Delete stale TODO comment

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

18 months agomicrosoft/compiler: Subpass textures are supposed to be arrays
Jesse Natalie [Wed, 11 Jan 2023 18:44:26 +0000 (10:44 -0800)]
microsoft/compiler: Subpass textures are supposed to be arrays

When doing multiview subpass rendering, they get loaded with the
view/layer index.

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

18 months agomicrosoft/compiler: Delete incorrect implementation for load_layer_id
Jesse Natalie [Wed, 11 Jan 2023 18:43:44 +0000 (10:43 -0800)]
microsoft/compiler: Delete incorrect implementation for load_layer_id

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

18 months agozink: simplify some dynarray concat descriptor code
Mike Blumenkrantz [Thu, 12 Jan 2023 19:27:19 +0000 (14:27 -0500)]
zink: simplify some dynarray concat descriptor code

TIL this exists

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

18 months agozink: consolidate semaphore creation where possible
Mike Blumenkrantz [Thu, 12 Jan 2023 19:49:26 +0000 (14:49 -0500)]
zink: consolidate semaphore creation where possible

all cacheable semaphores should now be using the cache

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

18 months agozink: move semaphore caching to zink_reset_batch_state()
Mike Blumenkrantz [Thu, 12 Jan 2023 19:25:25 +0000 (14:25 -0500)]
zink: move semaphore caching to zink_reset_batch_state()

this makes semaphores available for reuse more rapidly

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

18 months agozink: add a binary semaphore cache
Mike Blumenkrantz [Thu, 12 Jan 2023 19:21:20 +0000 (14:21 -0500)]
zink: add a binary semaphore cache

after being waited upon, a binary semaphore can be reused, which saves
tons of present-related ioctls when fps is high

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

18 months agozink: add a util function for creating semaphores
Mike Blumenkrantz [Mon, 19 Sep 2022 20:12:57 +0000 (16:12 -0400)]
zink: add a util function for creating semaphores

annoying to keep copy/pasting this around

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

18 months agozink: preserve present resources during async presentation
Mike Blumenkrantz [Thu, 19 Jan 2023 18:33:04 +0000 (13:33 -0500)]
zink: preserve present resources during async presentation

ensure that these have a lifetime great enough to be presented

fixes #7781

cc: mesa-stable

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

18 months agoci/bare-metal: add more timestamps to help debugging issues
Eric Engestrom [Thu, 19 Jan 2023 18:15:23 +0000 (18:15 +0000)]
ci/bare-metal: add more timestamps to help debugging issues

Acked-by: Emma Anholt <emma@anholt.net>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20792>

18 months agozink: NV_compute_shader_derivatives
Mike Blumenkrantz [Wed, 26 May 2021 15:25:21 +0000 (11:25 -0400)]
zink: NV_compute_shader_derivatives

nothing complicated here

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

18 months agozink: correct sparse bo mem_type_idx placement
Julia Tatz [Mon, 16 Jan 2023 20:34:47 +0000 (15:34 -0500)]
zink: correct sparse bo mem_type_idx placement

VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x01 has been incidently the
correct memory type index, but isn't guaranteed to be, which is why it
hasn't caused issues yet

Fixes: f9515d93 ("zink: allocate/place memory using memoryTypeIndex directly")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20264>

18 months agozink: trival renames heap_idx -> memoryTypeIndex
Julia Tatz [Mon, 16 Jan 2023 18:18:40 +0000 (13:18 -0500)]
zink: trival renames heap_idx -> memoryTypeIndex

Trival renames to correctly identify vulkan memory type indices aren't
the same as zink heaps

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

18 months agozink: zink_heap isn't 1-to-1 with memoryTypeIndex
Julia Tatz [Mon, 16 Jan 2023 18:09:02 +0000 (13:09 -0500)]
zink: zink_heap isn't 1-to-1 with memoryTypeIndex

Clarify the relationship between zink heaps and vulkan memory type
indices, and resolve the issues from mixing the two up.

Closes: #7588, #7813
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20264>

18 months agomeson: Use feature option methods for xmlconfig
Dylan Baker [Wed, 21 Dec 2022 19:44:55 +0000 (11:44 -0800)]
meson: Use feature option methods for xmlconfig

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>

18 months agomeson: use a feature option for shared-llvm
Dylan Baker [Wed, 21 Dec 2022 17:26:25 +0000 (09:26 -0800)]
meson: use a feature option for shared-llvm

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>

18 months agomeson: use a feature option for egl
Dylan Baker [Wed, 21 Dec 2022 01:48:04 +0000 (17:48 -0800)]
meson: use a feature option for egl

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>

18 months agomeson: use a feature option for zstd
Dylan Baker [Wed, 21 Dec 2022 00:37:35 +0000 (16:37 -0800)]
meson: use a feature option for zstd

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>

18 months agomeson: use a feature option for xlib-lease
Dylan Baker [Wed, 21 Dec 2022 00:36:46 +0000 (16:36 -0800)]
meson: use a feature option for xlib-lease

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>

18 months agomeson: use a feature option for power8
Dylan Baker [Wed, 21 Dec 2022 00:06:10 +0000 (16:06 -0800)]
meson: use a feature option for power8

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>

18 months agomeson: use a feature option for lmsensors
Dylan Baker [Tue, 20 Dec 2022 23:43:55 +0000 (15:43 -0800)]
meson: use a feature option for lmsensors

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>

18 months agomeson: use a feature option for libunwind
Dylan Baker [Tue, 20 Dec 2022 23:41:44 +0000 (15:41 -0800)]
meson: use a feature option for libunwind

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>

18 months agomeson: use a feature option for valgrind
Dylan Baker [Tue, 20 Dec 2022 23:38:10 +0000 (15:38 -0800)]
meson: use a feature option for valgrind

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>

18 months agomeson: use a feature option for llvm
Dylan Baker [Tue, 20 Dec 2022 23:36:13 +0000 (15:36 -0800)]
meson: use a feature option for llvm

Still not as awesome as it should be, but an improvement over what we had
before.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>

18 months agomeson: use a feature option for gbm
Dylan Baker [Tue, 20 Dec 2022 23:21:11 +0000 (15:21 -0800)]
meson: use a feature option for gbm

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>

18 months agomeson: use a feature option for gles2
Dylan Baker [Tue, 20 Dec 2022 23:19:00 +0000 (15:19 -0800)]
meson: use a feature option for gles2

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>

18 months agomeson: use a feature option for gles1
Dylan Baker [Tue, 20 Dec 2022 23:17:13 +0000 (15:17 -0800)]
meson: use a feature option for gles1

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>

18 months agomeson: use a feature option for shared-glapi
Dylan Baker [Tue, 20 Dec 2022 23:12:47 +0000 (15:12 -0800)]
meson: use a feature option for shared-glapi

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>

18 months agomeson: use a feature option for shader_cache
Dylan Baker [Tue, 20 Dec 2022 23:09:41 +0000 (15:09 -0800)]
meson: use a feature option for shader_cache

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>

18 months agomeson: use a feature option for gallium-xa
Dylan Baker [Tue, 20 Dec 2022 23:07:14 +0000 (15:07 -0800)]
meson: use a feature option for gallium-xa

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>

18 months agomeson: use a feature option for gallium-va
Dylan Baker [Tue, 20 Dec 2022 23:05:26 +0000 (15:05 -0800)]
meson: use a feature option for gallium-va

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>

18 months agomeson: use a feature option for gallium-vdpau
Dylan Baker [Tue, 20 Dec 2022 22:59:48 +0000 (14:59 -0800)]
meson: use a feature option for gallium-vdpau

Which we can use with the require method, and use the feature itself
as the require argument to dependency call. All of this results in less
code

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>

18 months agomeson: use a feature option for dri3
Dylan Baker [Tue, 20 Dec 2022 22:52:18 +0000 (14:52 -0800)]
meson: use a feature option for dri3

This removes the deprecated 'true' and 'false' options, and uses a meson
feature, requiring significantly less code.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>

18 months agomeson: drop meson < 0.54 workaround
Dylan Baker [Tue, 20 Dec 2022 23:31:28 +0000 (15:31 -0800)]
meson: drop meson < 0.54 workaround

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>

18 months agomeson: replace uses of ExternalProgram.path with .full_path
Dylan Baker [Wed, 21 Dec 2022 17:31:30 +0000 (09:31 -0800)]
meson: replace uses of ExternalProgram.path with .full_path

The former is deprecated

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>

18 months agomeson: replace has_exe_wrapper with can_run_host_binaries
Dylan Baker [Wed, 21 Dec 2022 17:30:44 +0000 (09:30 -0800)]
meson: replace has_exe_wrapper with can_run_host_binaries

The former is a deprecated alias for the latter, which more accurately
describes what the function does.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>

18 months agomeson: bump minimum required version to meson 0.59
Dylan Baker [Tue, 20 Dec 2022 22:46:17 +0000 (14:46 -0800)]
meson: bump minimum required version to meson 0.59

This gives us some utility methods for feature options, allowing even
simpler code. We can replace something like:
```meson
_opt = get_option('opt')
if _opt.auto()
  opt = host_machine.system() != 'windows'
else
  opt = opt.enabled()
endif
```
with
```meson
opt = get_option('opt') \
    .disable_auto_if(host_machine.system() != 'windows') \
    .allowed()
```

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>

18 months agozink: handle modifier nplanes queries correctly for planar formats
Mike Blumenkrantz [Tue, 17 Jan 2023 19:45:48 +0000 (14:45 -0500)]
zink: handle modifier nplanes queries correctly for planar formats

this just returns the number of planes in the base format as a default, which
matches the behavior of other drivers

cc: mesa-stable

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

18 months agozink: store drm format as internal_format for imported resources
Mike Blumenkrantz [Tue, 17 Jan 2023 19:43:51 +0000 (14:43 -0500)]
zink: store drm format as internal_format for imported resources

internal_format is the "real" format of a resource, and the "real" format
of imported resources is the external-facing format, not the pipe format

this ensures the correct format is available for internal ops, such as nplanes queries

Fixes: 2e2775c11b0 ("zink: fix PIPE_RESOURCE_PARAM_NPLANES with format modifier")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20753>

18 months agoradv: rename ac_surf_nbc_view::max_mip to num_levels
Samuel Pitoiset [Thu, 19 Jan 2023 07:45:27 +0000 (08:45 +0100)]
radv: rename ac_surf_nbc_view::max_mip to num_levels

For readability.

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

18 months agoradv: fix creating BC image views when the base layer is > 0
Samuel Pitoiset [Tue, 17 Jan 2023 15:18:24 +0000 (16:18 +0100)]
radv: fix creating BC image views when the base layer is > 0

When the base array layer of the image view is > 0, addrlib computes
the offset (in HwlComputeSubResourceOffsetForSwizzlePattern) which is
then added to the base VA in RADV. But if the driver doesn't reset
the base array layer, the hw will compute incorrect addressing
(ie. base array will be added twice). This also matches AMDVLK.

This fixes a VM fault followed by a GPU hang on RDNA2 when trying
to join a multiplayer game with medium settings in Halo Infinite.

Fixes: 98ba1e0d817 ("radv: Fix mipmap views on GFX10+")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20761>

18 months agoradv: fix buffer to image copies with BC views on the graphics queue
Samuel Pitoiset [Tue, 17 Jan 2023 16:53:13 +0000 (17:53 +0100)]
radv: fix buffer to image copies with BC views on the graphics queue

The color surface descriptor needs to be adjusted, otherwise addressing
is wrong.

Fixes tests performed on the graphics queue from
dEQP-VK.api.copy_and_blit.*.image_to_buffer.2d_images.mip_copies_*.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7900
Fixes: 98ba1e0d817 ("radv: Fix mipmap views on GFX10+")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20761>

18 months agoradv: fix setting MAX_MIP for BC views
Samuel Pitoiset [Tue, 17 Jan 2023 16:33:12 +0000 (17:33 +0100)]
radv: fix setting MAX_MIP for BC views

MAX_MIP should always be the number of levels minus one from the hw
perspective.

This doesn't fix anything known.

Fixes: 98ba1e0d817 ("radv: Fix mipmap views on GFX10+")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20761>

18 months agomesa/st: drop unused param
Eric Engestrom [Wed, 18 Jan 2023 17:54:29 +0000 (17:54 +0000)]
mesa/st: drop unused param

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20772>

18 months agoglthread: fix glArrayElement handling
Pierre-Eric Pelloux-Prayer [Tue, 17 Jan 2023 15:06:00 +0000 (16:06 +0100)]
glthread: fix glArrayElement handling

This must be marshalled synchronously or the attrib pointers' content
might change by the time we use them.

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

18 months agovbo: lower VBO_SAVE_BUFFER_SIZE to avoid large VRAM usage
Pierre-Eric Pelloux-Prayer [Tue, 17 Jan 2023 09:14:52 +0000 (10:14 +0100)]
vbo: lower VBO_SAVE_BUFFER_SIZE to avoid large VRAM usage

The ideal case for performance is to have a single buffer for
all display list. The caveat is that large buffers are less
likely to be freed because they're refcounted: it only takes
1 user (diplay list) to keep it in VRAM.

This lowers VRAM usage when replaying the trace attached
of the trace attached to !6140 from 5.5 GB to about 1.8 GB.

Viewperf snx performance isn't affected.

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

18 months agovbo: remove bogus assert
Pierre-Eric Pelloux-Prayer [Tue, 17 Jan 2023 09:13:00 +0000 (10:13 +0100)]
vbo: remove bogus assert

grow_vertex_storage may call wrap_filled_vertex, which will
trigger the assert incorrectly because the new size will be
smaller than 'new_size' but it's correct because
'vertex_store->used' has been reset to 0.

Fixes: a08baaff976 ("vbo/dlist: fix indentation in vbo_save_api.c")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20748>

18 months agonir/lower_io: fix bounds checking for 64bit_bounded_global
Lionel Landwerlin [Tue, 17 Jan 2023 21:42:03 +0000 (23:42 +0200)]
nir/lower_io: fix bounds checking for 64bit_bounded_global

If the offset is negative like it's the case in

dEQP-VK.robustness.robustness2.bind.notemplate.r32i.unroll.volatile.storage_buffer_dynamic.readwrite.no_fmt_qual.len_256.samples_1.1d.comp

we end up passing the bounds checking condition because it's using
signed integers.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Suggested-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Cc: mesa-stable
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20762>

18 months agointel/compiler: Use more symbolic source names in components_read()
Kenneth Graunke [Tue, 10 Jan 2023 23:09:12 +0000 (15:09 -0800)]
intel/compiler: Use more symbolic source names in components_read()

Rather than hardcoding source 1, source 2, etc.

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

18 months agointel/compiler: Drop dest checking in atomic code
Kenneth Graunke [Tue, 10 Jan 2023 00:49:43 +0000 (16:49 -0800)]
intel/compiler: Drop dest checking in atomic code

NIR atomic operation intrinsics all have destinations.  This is just
copy and pasted from other generic intrinsic handling where that may
or may not be the case.

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

18 months agointel/compiler: Delete all the A64 atomic variants for type sizes
Kenneth Graunke [Tue, 10 Jan 2023 00:44:26 +0000 (16:44 -0800)]
intel/compiler: Delete all the A64 atomic variants for type sizes

These are handled identically in almost all cases.  There is one place
in the legacy surface lowering that was obtaining the bitsize from the
opcode, but the LSC-based lowering uses (type_sz(inst->dst.type) * 8)
for that and works just fine.  If we just do that in the legacy lowering
too, then we don't need this plethora of opcodes.

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

18 months agointel/compiler: Combine nir_emit_{ssbo,shared}_atomic into one helper
Kenneth Graunke [Tue, 10 Jan 2023 00:23:08 +0000 (16:23 -0800)]
intel/compiler: Combine nir_emit_{ssbo,shared}_atomic into one helper

These are basically identical save for:
- shared has surface hardcoded to SLM rather than an SSBO index
- shared has to handle adding the 'base' const_index (SSBO have none)
- the NIR source index for data is shifted by one

It's not worth copy and pasting the entire function for this.

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