platform/upstream/mesa.git
2 years agopanfrost: Don't check alpha test in fs_required on Bifrost+
Alyssa Rosenzweig [Wed, 30 Mar 2022 16:39:17 +0000 (12:39 -0400)]
panfrost: Don't check alpha test in fs_required on Bifrost+

Alpha testing is only native on Midgard. Saves a few instructions.

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

2 years agointel/compiler: Fix sample_d messages on DG2
Ian Romanick [Wed, 6 Apr 2022 21:12:09 +0000 (14:12 -0700)]
intel/compiler: Fix sample_d messages on DG2

DG2 can only do sample_d and sample_d_c on 1D and 2D surfaces.  The
maximum number of gradient components and coordinate components should
be 2.  In spite of this limitation, the Bspec lists a mysterious R
component before the min_lod, so the maximum coordinate components is 3.

Fixes the following Vulkan CTS failures on DG2:

    dEQP-VK.glsl.texture_functions.texturegradclamp.isampler1d_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.isampler2d_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.sampler1d_fixed_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.sampler1d_float_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.sampler2d_fixed_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.sampler2d_float_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.usampler1d_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.usampler2d_fragment

The Fixes: tag below is a bit misleading. This commit fixes some test
cases similar to ones fixed by the Fixes: commit.  I just want to make
sure this commit gets applied everywhere that commit was also applied.

Fixes: 635ed58e527 ("intel/compiler: Lower txd for 3D samplers on XeHP.")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15781>

2 years agodzn: Pass a NULL ralloc context to dxil_create_validator()
Boris Brezillon [Thu, 7 Apr 2022 09:48:56 +0000 (02:48 -0700)]
dzn: Pass a NULL ralloc context to dxil_create_validator()

instance is not allocated with ralloc, we can't pass it as a ralloc
context to dxil_create_validator().

Fixes: 09c2016d6be ("dzn: use dxil_validator")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15787>

2 years agovulkan,docs: Add documentation for Vulkan dispatch
Jason Ekstrand [Mon, 21 Mar 2022 23:17:54 +0000 (18:17 -0500)]
vulkan,docs: Add documentation for Vulkan dispatch

Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15472>

2 years agovulkan,docs: Document vk_device
Jason Ekstrand [Tue, 22 Mar 2022 22:20:06 +0000 (17:20 -0500)]
vulkan,docs: Document vk_device

Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15472>

2 years agovulkan,docs: Document vk_physical_device
Jason Ekstrand [Mon, 21 Mar 2022 23:18:04 +0000 (18:18 -0500)]
vulkan,docs: Document vk_physical_device

Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15472>

2 years agovulkan,docs: Document vk_instance
Jason Ekstrand [Sat, 19 Mar 2022 00:25:48 +0000 (19:25 -0500)]
vulkan,docs: Document vk_instance

Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15472>

2 years agovulkan,docs: Document vk_object_base
Jason Ekstrand [Fri, 18 Mar 2022 22:31:35 +0000 (17:31 -0500)]
vulkan,docs: Document vk_object_base

Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15472>

2 years agovulkan: vk_object_base_init/finish have no unused parameters
Jason Ekstrand [Fri, 18 Mar 2022 22:27:06 +0000 (17:27 -0500)]
vulkan: vk_object_base_init/finish have no unused parameters

Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15472>

2 years agoanv/formats: Relax usage checks if EXTENDED_USAGE_BIT is set
Jason Ekstrand [Fri, 10 Dec 2021 19:24:49 +0000 (13:24 -0600)]
anv/formats: Relax usage checks if EXTENDED_USAGE_BIT is set

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14153>

2 years agoandroid: Set max platform-sdk-version to 10000
Roman Stratiienko [Mon, 14 Mar 2022 15:24:30 +0000 (17:24 +0200)]
android: Set max platform-sdk-version to 10000

platform-sdk-version::max require updating every time new Android releases.
It makes sense to set this value to some unreachable maximum value to avoid
such patches. Such approach will allow to use stable mesa3d without any
changes with newest Android as well.

As was suggested by Yiwei Zhang we can use value 10000 that corresponds to
CUR_DEVELOPMENT [1] definition which may be used by AOSP/master in between
of Android major releases.

[1]: https://developer.android.com/reference/android/os/Build.VERSION_CODES#CUR_DEVELOPMENT

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15747>

2 years agopanfrost: Split out image access tracking
Alyssa Rosenzweig [Thu, 7 Apr 2022 14:41:45 +0000 (10:41 -0400)]
panfrost: Split out image access tracking

This logic is not device-specific. It is pulled from our existing Bifrost image
implementation and will be reused for Valhall.

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

2 years agopanfrost: Add helpers to set batch masks
Alyssa Rosenzweig [Thu, 7 Apr 2022 14:40:44 +0000 (10:40 -0400)]
panfrost: Add helpers to set batch masks

This logic is not device specific and will be used for both Bifrost and Valhall.

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

2 years agopanfrost: Disable PIPE_CAP_PRIMITIVE_RESTART on v9
Alyssa Rosenzweig [Thu, 7 Apr 2022 14:32:01 +0000 (10:32 -0400)]
panfrost: Disable PIPE_CAP_PRIMITIVE_RESTART on v9

Valhall removed the ability to set an explicit primitive restart index as
required by desktop OpenGL, in favour of fixed primitive restart indices only as
required by OpenGL ES.

Set the CAPs accordingly so that mesa/st lowers unusual primitive restart
indices at draw call time.

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

2 years agopanfrost: Make alpha=0 NOP / 1 store Bifrost only
Alyssa Rosenzweig [Thu, 7 Apr 2022 14:27:34 +0000 (10:27 -0400)]
panfrost: Make alpha=0 NOP / 1 store Bifrost only

These fields were removed in Valhall in favour of a simpler overdraw mechanism.

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

2 years agopanfrost: Move assign_vertex_buffer to pan_helpers
Alyssa Rosenzweig [Tue, 5 Apr 2022 16:40:08 +0000 (12:40 -0400)]
panfrost: Move assign_vertex_buffer to pan_helpers

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

2 years agopanfrost: Hide AFBC on Valhall
Alyssa Rosenzweig [Thu, 3 Feb 2022 18:29:00 +0000 (13:29 -0500)]
panfrost: Hide AFBC on Valhall

The relevant data structures have been shuffled a bit. We need to wire up AFBC
for Valhall; however, that's out of scope for the initial bring up. Just hide it
so we can build.

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

2 years agopanfrost: Adapt pan_shader.h for Valhall
Alyssa Rosenzweig [Tue, 5 Apr 2022 16:36:45 +0000 (12:36 -0400)]
panfrost: Adapt pan_shader.h for Valhall

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

2 years agopanfrost: Add shader_stage helper
Alyssa Rosenzweig [Tue, 5 Apr 2022 16:35:25 +0000 (12:35 -0400)]
panfrost: Add shader_stage helper

For Valhall, which specifies these in the shader program descriptor.

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

2 years agopanfrost: Add panfrost_make_resource_table helper
Alyssa Rosenzweig [Tue, 5 Apr 2022 16:33:33 +0000 (12:33 -0400)]
panfrost: Add panfrost_make_resource_table helper

For Valhall drivers.

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

2 years agopanfrost: Hide parts of pan_encoder.h for Valhall
Alyssa Rosenzweig [Tue, 5 Apr 2022 16:33:10 +0000 (12:33 -0400)]
panfrost: Hide parts of pan_encoder.h for Valhall

These pertain to data structures that no longer exist.

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

2 years agopanfrost: Control tiler memory usage
Alyssa Rosenzweig [Thu, 31 Mar 2022 14:39:51 +0000 (10:39 -0400)]
panfrost: Control tiler memory usage

Ensure we don't hit OOM when rendering at 8192x8192 on Valhall by disabling
the smallest bin size of the hierarchy mask.

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

2 years agopanfrost: Handle stencil texturing on Valhall
Alyssa Rosenzweig [Thu, 31 Mar 2022 14:21:07 +0000 (10:21 -0400)]
panfrost: Handle stencil texturing on Valhall

Use a Bifrost compatible path. It's not clear this is optimal but it passes the
tests and is no worse than what we do on Bifrost.

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

2 years agopanfrost: Handle Valhall texturing
Alyssa Rosenzweig [Sun, 23 Jan 2022 20:50:58 +0000 (15:50 -0500)]
panfrost: Handle Valhall texturing

Surface descriptors have been replaced by plane descriptors, which facilitate
the intermediate layout of textures. This allows for more sophisticated handling
of texture compressions, of particular to interest to copy_image. However, it
requires a considerable amount of new logic to handle.

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

2 years agofrontend/va: Create decoder once the max_references is updated
Krunal Patel [Tue, 5 Apr 2022 11:41:20 +0000 (17:11 +0530)]
frontend/va: Create decoder once the max_references is updated

Issue: When a video is decoded where the max_references is updated the
decoder keeps using same old value. This results into green patches and
decoding is not proper.

Root Cause: The max_references is updated only once when the instance is
created for the first time.

Fix: Added a check along with the context->decoder to check if the
context->templat.max_references has changed. If yes, then we go ahead
and create the decoder again.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Krunal Patel <krunalkumarmukeshkumar.patel@amd.corp-partner.google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15750>

2 years agozink: ci updates
Mike Blumenkrantz [Thu, 7 Apr 2022 13:54:08 +0000 (09:54 -0400)]
zink: ci updates

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

2 years agozink: export PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE
Mike Blumenkrantz [Mon, 21 Mar 2022 18:51:37 +0000 (14:51 -0400)]
zink: export PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE

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

2 years agozink: run the cubemap -> array compiler pass if the shader key is set
Mike Blumenkrantz [Mon, 21 Mar 2022 18:51:19 +0000 (14:51 -0400)]
zink: run the cubemap -> array compiler pass if the shader key is set

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

2 years agozink: handle nonseamless cube sampler binding
Mike Blumenkrantz [Mon, 21 Mar 2022 18:50:12 +0000 (14:50 -0400)]
zink: handle nonseamless cube sampler binding

now when a cube is sampled with a nonseamless sampler, the relevant shader
stage is flagged for a variant update, the

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

2 years agozink: create an array view for all cube samplerviews
Mike Blumenkrantz [Mon, 21 Mar 2022 18:52:31 +0000 (14:52 -0400)]
zink: create an array view for all cube samplerviews

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

2 years agozink: set nonseamless hint for sampler states
Mike Blumenkrantz [Mon, 21 Mar 2022 18:52:02 +0000 (14:52 -0400)]
zink: set nonseamless hint for sampler states

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

2 years agozink: handle shader key variants that have nonseamless cubemaps
Mike Blumenkrantz [Mon, 21 Mar 2022 18:48:19 +0000 (14:48 -0400)]
zink: handle shader key variants that have nonseamless cubemaps

this is just the program-based handling, which means finding the right
variant and/or creating new ones based on matching a 32bit mask indicating
which textures must be rewritten

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

2 years agozink: specify struct member name when copying inline uniforms for gfx variants
Mike Blumenkrantz [Mon, 21 Mar 2022 23:45:30 +0000 (19:45 -0400)]
zink: specify struct member name when copying inline uniforms for gfx variants

avoid memory mismatch if inline uniform values aren't first member of struct

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

2 years agozink: support nir_op_imod
Mike Blumenkrantz [Mon, 21 Mar 2022 20:22:15 +0000 (16:22 -0400)]
zink: support nir_op_imod

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

2 years agozink: add a gently mangled version of the d3d12 cubemap -> array compiler pass
Mike Blumenkrantz [Mon, 21 Mar 2022 18:46:26 +0000 (14:46 -0400)]
zink: add a gently mangled version of the d3d12 cubemap -> array compiler pass

this differs in that it doesn't handle images and also doesn't filter
based on sampler type, instead using a 32bit mask for determining which
samplers to rewrite

also zink doesn't use sampler derefs

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

2 years agozink: rename a variable
Mike Blumenkrantz [Mon, 21 Mar 2022 16:39:07 +0000 (12:39 -0400)]
zink: rename a variable

no functional changes

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

2 years agopan/va: Add LD_TILE.v3.f16 packing test
Alyssa Rosenzweig [Wed, 23 Mar 2022 14:44:05 +0000 (10:44 -0400)]
pan/va: Add LD_TILE.v3.f16 packing test

This tests the staging register behaviour.

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

2 years agopan/bi: Consider flow control in DCE
Alyssa Rosenzweig [Thu, 7 Apr 2022 13:47:46 +0000 (09:47 -0400)]
pan/bi: Consider flow control in DCE

We don't want to remove instructions like `NOP.wait` on Valhall; this would be
tantamount to deleting barriers.

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

2 years agopan/bi: Don't lower vertex_id for malloc IDVS
Alyssa Rosenzweig [Thu, 31 Mar 2022 15:08:17 +0000 (11:08 -0400)]
pan/bi: Don't lower vertex_id for malloc IDVS

Based on hardware behaviour, it appears vertex_id is zero-based with the legacy
geometry flow but not with the new malloc IDVS flow. Since the geometry flow is
per-shader (not per-machine), there's not a good way to communicate this to NIR.
Rather than trying to shoehorn this obscure detail into NIR, just do the
lowering ourselves instead of in NIR. It's not much more code anyway.

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

2 years agopan/bi: Report whether workgroups can be merged
Alyssa Rosenzweig [Wed, 30 Mar 2022 20:31:39 +0000 (16:31 -0400)]
pan/bi: Report whether workgroups can be merged

This flag gates a Valhall hardware optimization for compute shaders.

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

2 years agopan/bi: Avoid masked writes for now
Alyssa Rosenzweig [Wed, 23 Mar 2022 16:21:12 +0000 (12:21 -0400)]
pan/bi: Avoid masked writes for now

Our swizzle lowering optimizations depend on replication of scalar fp16. This
holds on Bifrost (at least for now), but not on Valhall which has proper support
for write masks. For now, enforce Bifrost-compatible behaviour as we do not make
use of the write masks on Valhall yet.

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

2 years agopan/bi: Generate LD_BUFFER on Valhall
Alyssa Rosenzweig [Fri, 21 Jan 2022 19:05:39 +0000 (14:05 -0500)]
pan/bi: Generate LD_BUFFER on Valhall

Replace LOAD.ubo with LD_BUFFER since the .ubo segment doesn't exist on Valhall.
We could do this with a lowering pass instead but this is probably fine.

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

2 years agopan/bi: Make psiz variants
Alyssa Rosenzweig [Sun, 13 Mar 2022 15:29:23 +0000 (11:29 -0400)]
pan/bi: Make psiz variants

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

2 years agopan/bi: Lower gl_PointSize to FP16 on Valhall
Alyssa Rosenzweig [Fri, 28 Jan 2022 17:07:41 +0000 (12:07 -0500)]
pan/bi: Lower gl_PointSize to FP16 on Valhall

It is unclear if FP32 point sizes are supported on Valhall -- I can't get the
DDK to use them at any rate. Always lower them to FP16 and store them as FP16
for hardware use.

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

2 years agopan/bi: Force psiz to mediump
Alyssa Rosenzweig [Thu, 3 Feb 2022 21:16:36 +0000 (16:16 -0500)]
pan/bi: Force psiz to mediump

To match driver behaviour.

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

2 years agopan/bi: Set table for Valhall LD_ATTR
Alyssa Rosenzweig [Sat, 11 Dec 2021 23:15:03 +0000 (18:15 -0500)]
pan/bi: Set table for Valhall LD_ATTR

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

2 years agopan/bi: Emit Valhall-style varying stores
Alyssa Rosenzweig [Wed, 8 Dec 2021 00:14:58 +0000 (19:14 -0500)]
pan/bi: Emit Valhall-style varying stores

Varying stores was changed in Valhall. Rather than using attribute descriptors
like on Bifrost and Midgard, on Valhall we store to memory directly with
hardware-allocated buffers. This requires a new implementation of store_output,
with special provisions for writing gl_PointSize from a position shader.

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

2 years agopan/bi: Emit Valhall-style varying loads
Alyssa Rosenzweig [Tue, 7 Dec 2021 23:56:24 +0000 (18:56 -0500)]
pan/bi: Emit Valhall-style varying loads

Memory-allocated IDVS requires special varying load instructions that take an
offset into the hardware-allocated varying buffer, as opposed to a varying slot.
Emit these instructions.

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

2 years agopan/bi: Track whether the malloc IDVS flow is used
Alyssa Rosenzweig [Thu, 24 Mar 2022 20:39:52 +0000 (16:39 -0400)]
pan/bi: Track whether the malloc IDVS flow is used

This affects what instructions the fragment shader uses. Will be used for the
legacy geometry flow in blit shaders. Whether that is a good idea remains to be
seen, admittedly.

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

2 years agopan/bi: Handle Valhall texturing in helper analysis
Alyssa Rosenzweig [Tue, 3 Aug 2021 15:11:42 +0000 (11:11 -0400)]
pan/bi: Handle Valhall texturing in helper analysis

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

2 years agopan/bi: Emit Valhall texture instructions
Alyssa Rosenzweig [Wed, 23 Mar 2022 16:05:43 +0000 (12:05 -0400)]
pan/bi: Emit Valhall texture instructions

Valhall uses an updated version fo the TEXC path. To avoid disrupting the
existing Bifrost code, add a new Valhall-specific texture path that generates
the new-style texture instructions.

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

2 years agopan/bi: Specialize BLEND emit for Valhall
Alyssa Rosenzweig [Thu, 29 Jul 2021 21:39:14 +0000 (17:39 -0400)]
pan/bi: Specialize BLEND emit for Valhall

Fewer arguments compared to Bifrost; the corresponding information is encoded in
a Valhall-specific blend shader prologue instead.

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

2 years agopan/bi: Waits before tilebuffer access on Valhall
Alyssa Rosenzweig [Sun, 9 Jan 2022 21:01:34 +0000 (16:01 -0500)]
pan/bi: Waits before tilebuffer access on Valhall

On Bifrost, this is handled in the scheduler. Until we grow a Valhall scheduler,
add a NOP with the appropriate flow control. This is correct but carries a small
performance cost.

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

2 years agopan/bi: Fix spilling on Valhall
Alyssa Rosenzweig [Tue, 21 Dec 2021 22:06:05 +0000 (17:06 -0500)]
pan/bi: Fix spilling on Valhall

We need a slightly different idiom on Valhall, since the segment modifiers no
longer exist but we now have an immediate offset.

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

2 years agopan/bi: Mark LD_TILE as w=format
Alyssa Rosenzweig [Fri, 28 Jan 2022 23:16:09 +0000 (18:16 -0500)]
pan/bi: Mark LD_TILE as w=format

This tracks register usage more precisely for LD_TILE, which is an encoding
difference on Valhall.

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

2 years agopanfrost: Add a table for images
Alyssa Rosenzweig [Wed, 30 Mar 2022 18:11:56 +0000 (14:11 -0400)]
panfrost: Add a table for images

For the default Valhall ABI.

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

2 years agoradv: improve failure logging for amdgpu on init
Mike Blumenkrantz [Wed, 6 Apr 2022 14:49:26 +0000 (10:49 -0400)]
radv: improve failure logging for amdgpu on init

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

2 years agopan/va: Allow small constants in register pairs
Alyssa Rosenzweig [Thu, 31 Mar 2022 14:46:07 +0000 (10:46 -0400)]
pan/va: Allow small constants in register pairs

They are zero extended 32->64-bit. Allow this. Noticed debugging spilling on
Valhall.

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

2 years agopan/va: Add flow control lowering pass
Alyssa Rosenzweig [Wed, 30 Mar 2022 21:46:20 +0000 (17:46 -0400)]
pan/va: Add flow control lowering pass

Something an instruction has two logic flow controls, namely wait + reconverge.
These are orthogonal -- we need to insert a NOP to handle this. Add a lowering
pass that works out flow control to replace the ad hoc previous va_pack_flow.

Fixes dEQP-GLES31.functional.ssbo.layout.single_basic_type.shared.lowp_vec3.

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

2 years agopan/va: Don't truncate slots
Alyssa Rosenzweig [Wed, 30 Mar 2022 20:02:03 +0000 (16:02 -0400)]
pan/va: Don't truncate slots

Causes BARRIER not to work.

Fixes: f45654af595 ("pan/va: Add packing routines")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15756>

2 years agopan/va: Model image load instructions
Alyssa Rosenzweig [Wed, 30 Mar 2022 19:51:38 +0000 (15:51 -0400)]
pan/va: Model image load instructions

These use the attribute pipe, the new versions of LD_ATTR_TEX, but reading
texture descriptors instead of attribute descriptors unlike their Bifrost
predecessors.

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

2 years agopan/va: Pack LEA_TEX_IMM
Alyssa Rosenzweig [Wed, 30 Mar 2022 19:23:04 +0000 (15:23 -0400)]
pan/va: Pack LEA_TEX_IMM

Mostly automatic.

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

2 years agopan/va: Add indirect LEA_{ATTR, TEX}
Alyssa Rosenzweig [Wed, 30 Mar 2022 16:45:07 +0000 (12:45 -0400)]
pan/va: Add indirect LEA_{ATTR, TEX}

For parity with Bifrost. We might need these for images.

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

2 years agopan/bi: Model Valhall image loads
Alyssa Rosenzweig [Wed, 30 Mar 2022 19:52:09 +0000 (15:52 -0400)]
pan/bi: Model Valhall image loads

Like LD_ATTR_TEX.

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

2 years agointel/nir: don't report progress on rayqueries if no queries
Lionel Landwerlin [Wed, 6 Apr 2022 14:20:04 +0000 (17:20 +0300)]
intel/nir: don't report progress on rayqueries if no queries

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c78be5da300a ("intel/fs: lower ray query intrinsics")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15769>

2 years agoturnip: Implement VK_EXT_primitives_generated_query
Danylo Piliaiev [Tue, 5 Apr 2022 09:41:10 +0000 (12:41 +0300)]
turnip: Implement VK_EXT_primitives_generated_query

Similar to pipeline statistics but done for a single counter.

We use REG_A6XX_RBBM_PRIMCTR_7 to get generated primitives
and not PRIMCTR_8 because PRIMCTR_7 counts pre-clipped prims
while PRIMCTR_8 counts them after clipping.

OpenGL spec for GL_PRIMITIVES_GENERATED says:
 "Subsequent rendering will increment the counter once for every
  vertex that is emitted from the geometry shader, or from the
  vertex shader if no geometry shader is present."

Passes tests:
 dEQP-VK.transform_feedback.primitives_generated_query.*

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

2 years agoradv: mark all states declared dynamic at pipeline creation
Samuel Pitoiset [Wed, 6 Apr 2022 09:10:56 +0000 (11:10 +0200)]
radv: mark all states declared dynamic at pipeline creation

It will be easier to merge dynamic states from libraries this way.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15764>

2 years agoradv: add a new helper to determine if rasterization is enabled
Samuel Pitoiset [Wed, 6 Apr 2022 08:48:22 +0000 (10:48 +0200)]
radv: add a new helper to determine if rasterization is enabled

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15764>

2 years agoradv: fix dynamic raster discard with VK_EXT_depth_clip_control
Samuel Pitoiset [Wed, 6 Apr 2022 08:43:04 +0000 (10:43 +0200)]
radv: fix dynamic raster discard with VK_EXT_depth_clip_control

Fixes: 43e83949dc6 ("radv: implement VK_EXT_depth_clip_control")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15764>

2 years agozink: update ci list
Mike Blumenkrantz [Fri, 1 Apr 2022 16:54:41 +0000 (12:54 -0400)]
zink: update ci list

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

2 years agozink: ci fixup
Mike Blumenkrantz [Fri, 1 Apr 2022 13:14:39 +0000 (09:14 -0400)]
zink: ci fixup

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

2 years agozink: handle zombie swapchains
Mike Blumenkrantz [Thu, 24 Mar 2022 17:53:03 +0000 (13:53 -0400)]
zink: handle zombie swapchains

inject a dummy, matching image that can be used until the frontend
catches up and rescues us from whatever is happening

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

2 years agodriconf: add override for Xwayland
Mike Blumenkrantz [Tue, 22 Mar 2022 19:32:33 +0000 (15:32 -0400)]
driconf: add override for Xwayland

zink needs this to avoid deadlocking on startup

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

2 years agozink: export PIPE_CAP_DEVICE_RESET_STATUS_QUERY
Mike Blumenkrantz [Tue, 22 Mar 2022 19:22:57 +0000 (15:22 -0400)]
zink: export PIPE_CAP_DEVICE_RESET_STATUS_QUERY

this can work now

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

2 years agozink: it's kopperin' time
Mike Blumenkrantz [Thu, 13 Jan 2022 20:29:54 +0000 (15:29 -0500)]
zink: it's kopperin' time

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

2 years agozink: add kopper api
Mike Blumenkrantz [Tue, 22 Mar 2022 19:05:09 +0000 (15:05 -0400)]
zink: add kopper api

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

2 years agozink: check whether clear is enabled before applying in unbind
Mike Blumenkrantz [Tue, 22 Mar 2022 19:29:45 +0000 (15:29 -0400)]
zink: check whether clear is enabled before applying in unbind

this is implicit, but make it explicit

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

2 years agozink: move variable decl up in unbind_fb_surface
Mike Blumenkrantz [Tue, 22 Mar 2022 19:29:17 +0000 (15:29 -0400)]
zink: move variable decl up in unbind_fb_surface

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

2 years agozink: pass index to unbind_fb_surface
Mike Blumenkrantz [Tue, 22 Mar 2022 19:28:44 +0000 (15:28 -0400)]
zink: pass index to unbind_fb_surface

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

2 years agozink: move drirc handling up
Mike Blumenkrantz [Tue, 22 Mar 2022 19:26:55 +0000 (15:26 -0400)]
zink: move drirc handling up

this can modify instance creation

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

2 years agozink: split surface creation more to allow disabling caching
Mike Blumenkrantz [Tue, 22 Mar 2022 19:24:25 +0000 (15:24 -0400)]
zink: split surface creation more to allow disabling caching

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

2 years agozink: add fail logging for drmPrimeFDToHandle
Mike Blumenkrantz [Tue, 22 Mar 2022 19:21:26 +0000 (15:21 -0400)]
zink: add fail logging for drmPrimeFDToHandle

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

2 years agozink: add VK_KHR_swapchain_mutable_format
Mike Blumenkrantz [Tue, 22 Mar 2022 19:20:23 +0000 (15:20 -0400)]
zink: add VK_KHR_swapchain_mutable_format

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

2 years agozink: use two submits for every queue submit
Mike Blumenkrantz [Tue, 22 Mar 2022 19:14:55 +0000 (15:14 -0400)]
zink: use two submits for every queue submit

first one empty for now

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

2 years agozink: change early returns in zink_blit to gotos
Mike Blumenkrantz [Tue, 22 Mar 2022 19:10:42 +0000 (15:10 -0400)]
zink: change early returns in zink_blit to gotos

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

2 years agozink: move blit src/dst decls up in function
Mike Blumenkrantz [Tue, 22 Mar 2022 19:10:02 +0000 (15:10 -0400)]
zink: move blit src/dst decls up in function

no changes

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

2 years agozink: move update_framebuffer_state() higher up in file
Mike Blumenkrantz [Tue, 22 Mar 2022 19:08:13 +0000 (15:08 -0400)]
zink: move update_framebuffer_state() higher up in file

no changes

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

2 years agozink: put screen param into flush queue global data
Mike Blumenkrantz [Tue, 22 Mar 2022 18:58:12 +0000 (14:58 -0400)]
zink: put screen param into flush queue global data

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

2 years agozink: move flush queue init down a little further
Mike Blumenkrantz [Tue, 22 Mar 2022 18:38:58 +0000 (14:38 -0400)]
zink: move flush queue init down a little further

no functional changes

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

2 years agogallium: Learn about kopper
Adam Jackson [Tue, 15 Mar 2022 19:36:28 +0000 (15:36 -0400)]
gallium: Learn about kopper

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

2 years agoglx: Learn about kopper
Adam Jackson [Tue, 15 Mar 2022 19:35:19 +0000 (15:35 -0400)]
glx: Learn about kopper

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

2 years agoegl: Learn about kopper
Adam Jackson [Tue, 15 Mar 2022 19:35:48 +0000 (15:35 -0400)]
egl: Learn about kopper

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

2 years agokopper: Define the driver interface
Adam Jackson [Tue, 15 Mar 2022 19:32:30 +0000 (15:32 -0400)]
kopper: Define the driver interface

The loader extension provides upcalls to get surface state (native
resource and size) into the driver. The driver extension is called by a
kopper-aware loader in preference to __DRI_SWRAST's createNewDrawable.

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

2 years agomeson: Define a HAVE_XXXX macro for every gallium driver we build
Adam Jackson [Thu, 24 Mar 2022 19:05:32 +0000 (15:05 -0400)]
meson: Define a HAVE_XXXX macro for every gallium driver we build

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

2 years agost/manager: update framebuffer size if texture has been resized
Mike Blumenkrantz [Wed, 29 Sep 2021 17:15:01 +0000 (13:15 -0400)]
st/manager: update framebuffer size if texture has been resized

zink/kopper can and does expect this when resizing swapchains,
so don't ignore it

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

2 years agoclc/tests: use dxil_validator
Erik Faye-Lund [Tue, 5 Apr 2022 10:35:05 +0000 (12:35 +0200)]
clc/tests: use dxil_validator

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15751>

2 years agodzn: use dxil_validator
Erik Faye-Lund [Tue, 5 Apr 2022 10:28:53 +0000 (12:28 +0200)]
dzn: use dxil_validator

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15751>

2 years agomicrosoft/spirv_to_dxil: use dxil_validator
Erik Faye-Lund [Tue, 5 Apr 2022 09:29:19 +0000 (11:29 +0200)]
microsoft/spirv_to_dxil: use dxil_validator

This has one negative side-effect; we're no longer able to print
validation errors without dxcompiler.dll. I doubt that's a real problem,
but if it is, we should add this ability to dxil_validator instead of
having a second implementation here.

The reasons I didn't try adding this in the first place is:

1. This code seems a bit janky; it doesn't consult the "known"-variable
   to figure out if the encoding is OK, and it's lacking a fallback path
   in that case.
2. It seems unlikely that the compiler varies the encoding of the output
   in the first place; one of the two code-paths in here is probably
   untested.
3. Since dxil_validator leaves reporting to the call-site, we'd need to
   either add and output-encoding to the API (yuck), or re-encode the
   string to UTF-8 using WinAPI.

Right now, it seems questionable if fixing all of the above is worth it.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15751>

2 years agod3d12: use dxil_validator
Erik Faye-Lund [Tue, 5 Apr 2022 09:11:54 +0000 (11:11 +0200)]
d3d12: use dxil_validator

Now that we have a shiny, new dxil validator interface, let's start
using it in the D3D12 gallium driver.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15751>

2 years agomicrosoft/compiler: add common dxil-validator API
Erik Faye-Lund [Tue, 5 Apr 2022 08:39:01 +0000 (10:39 +0200)]
microsoft/compiler: add common dxil-validator API

This API is only available on Windows, which is the only OS where DXIL
validation is a requirement, and where DXIL.dll (and dxcompiler.dll) are
available.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15751>