platform/upstream/mesa.git
2 years agoturnip/trace: Delete unused start/end_resolve tracepoints
Danylo Piliaiev [Thu, 27 Jan 2022 14:58:37 +0000 (16:58 +0200)]
turnip/trace: Delete unused start/end_resolve tracepoints

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

2 years agoturnip/perfetto: handle gpu timestamps being non-monotonic
Danylo Piliaiev [Wed, 15 Sep 2021 14:35:56 +0000 (17:35 +0300)]
turnip/perfetto: handle gpu timestamps being non-monotonic

Perfetto requires time in clock snaphots to be monotonic, otherwise
the clock would be excluded.
GPU timestamps start from zero after every suspend-resume cycle
which makes them non-monotonic.

As a solution on msm we check whether GPU was just resumed and
remember previous highest timestamp to then add it to the next
timestamps.

If the functionality to get whether gpu is resumed is unavailable
or doesn't work - we fallback to a check for a discontinuity
in timestamps. For kgsl we always use fallback.

Fixes renderstage timeline disappearing in AGI.

Or you could avoid the issue altogether by preventing GPU from going to
sleep by increasing auto suspend delay e.g.:

  echo 5000 > /sys/devices/platform/soc\@0/3d00000.gpu/power/autosuspend_delay_ms

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

2 years agoturnip/trace: process u_trace chunks on queue submission
Danylo Piliaiev [Tue, 14 Sep 2021 12:25:47 +0000 (15:25 +0300)]
turnip/trace: process u_trace chunks on queue submission

tu_QueuePresentKHR was not the best place since application
isn't required to call it.

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

2 years agoturnip: rename tu_drm_get_timestamp into tu_device_get_gpu_timestamp
Danylo Piliaiev [Tue, 14 Sep 2021 11:49:43 +0000 (14:49 +0300)]
turnip: rename tu_drm_get_timestamp into tu_device_get_gpu_timestamp

It is not drm specific and will be implemented in kgsl.

Change parameter to tu_device along the way.

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

2 years agoturnip/trace: refactor creation and usage of trace flush data
Danylo Piliaiev [Fri, 10 Sep 2021 14:33:20 +0000 (17:33 +0300)]
turnip/trace: refactor creation and usage of trace flush data

Fixes the case when last cmd buffer in submission doesn't have
tracepoints leading to flush data not being freed.

Added a few comments, renamed things, refactored allocations - now
the data flow should be a bit more clean.

Extracted submission data creation into tu_u_trace_submission_data_create
which would be later used in in tu_kgsl.

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

2 years agoturnip/perfetto: Optimize timestamp synchronization
Danylo Piliaiev [Thu, 23 Sep 2021 15:18:37 +0000 (18:18 +0300)]
turnip/perfetto: Optimize timestamp synchronization

We shouldn't do ioctl to get timestamp if perfetto isn't connected.
Also it's better to sync timestamps after submission since the
call could block until GPU is resumed.

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

2 years agovirgl/ci: make crosvm-runner pass variables in a secure way
Guilherme Gallo [Fri, 14 Jan 2022 21:43:08 +0000 (18:43 -0300)]
virgl/ci: make crosvm-runner pass variables in a secure way

crosvm-runner.sh was using `export -p` to create an environment script
for the virtualized system, but this command will dump every declared
environment variable in the system, which includes Gitlab's CI variables
with sensitive data, such as passwords and auth tokens.

Replacing `export -p` to `generate-env.sh`, which only exports the
necessary variables for Mesa CI jobs.

Extra changes:

* Stop changing ${PWD} variable programmatically in scripts. ${PWD} is a
variable used by most prolific coreutils and bash commands, such as `cd`
and `pwd`, besides it is set by subshells [1]; changing this variable
may lead to complex situations.
As drop-in replacement for ${PWD}, use ${DEQP_BIN_DIR} to flag that
there is a special folder where dEQP should be run.
* Double quote path and array variables. See: https://github.com/koalaman/shellcheck/wiki/SC2086
* Do not export variables directly from commands output. See: https://github.com/koalaman/shellcheck/wiki/SC2155

[1]
```
$ cd /tmp
$ export PWD=test; bash -c 'echo $PWD'
/tmp
```

v2:
- Revert $DEQP_BIN_DIR quoting in crosvm-runner.sh and crosvm-init.sh
- Log all the passed variables to stdout, to help with debugging when
  new variable are needed to be put in `generate-env.sh`

v3:
- Revert $DEQP_BIN_DIR quoting leftovers

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14626>

2 years agoci/freedreno: Update hashes for closed traces.
Emma Anholt [Wed, 26 Jan 2022 20:40:04 +0000 (12:40 -0800)]
ci/freedreno: Update hashes for closed traces.

These two had different pixel results from last time someone updated them,
but things still look fine.

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

2 years agotu: Report code size in pipeline statistics
Connor Abbott [Thu, 27 Jan 2022 15:48:05 +0000 (16:48 +0100)]
tu: Report code size in pipeline statistics

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

2 years agointel/ci: expected failure for 1.3 with older CTS
Lionel Landwerlin [Thu, 27 Jan 2022 08:17:46 +0000 (10:17 +0200)]
intel/ci: expected failure for 1.3 with older CTS

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

2 years agorelnotes/features: updates for Vulkan 1.3
Lionel Landwerlin [Tue, 25 Jan 2022 13:05:54 +0000 (15:05 +0200)]
relnotes/features: updates for Vulkan 1.3

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14706>

2 years agoanv: Advertise Vulkan 1.3
Jason Ekstrand [Tue, 7 Sep 2021 15:45:16 +0000 (10:45 -0500)]
anv: Advertise Vulkan 1.3

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

2 years agoanv: switch a bunch of struct/enum to 1.3 versions
Lionel Landwerlin [Fri, 3 Sep 2021 08:39:50 +0000 (11:39 +0300)]
anv: switch a bunch of struct/enum to 1.3 versions

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14706>

2 years agoanv: Implement 1.3 features/properties
Jason Ekstrand [Wed, 12 Jan 2022 20:17:27 +0000 (12:17 -0800)]
anv: Implement 1.3 features/properties

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

2 years agoanv: SPIR-V 1.6 shaders imply ALLOW_VARYING_SUBGROUP_SIZE
Caio Marcelo de Oliveira Filho [Fri, 17 Sep 2021 00:49:54 +0000 (17:49 -0700)]
anv: SPIR-V 1.6 shaders imply ALLOW_VARYING_SUBGROUP_SIZE

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

2 years agopanvk: Fix pointer corruption in panvk_add_wait_event_syncobjs
Manas Chaudhary [Wed, 26 Jan 2022 20:56:41 +0000 (02:26 +0530)]
panvk: Fix pointer corruption in panvk_add_wait_event_syncobjs

nr_in_fences was being incremented to point to an
illegal address

Fixes: 1e23004600c3 ("panvk: Add vkEvents support")
Cc: mesa-stable
Signed-off-by: Manas Chaudhary <manas.chaudhary@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14744>

2 years agozink: unify some context casts in zink_create_sampler_view
Mike Blumenkrantz [Wed, 26 Jan 2022 21:55:02 +0000 (16:55 -0500)]
zink: unify some context casts in zink_create_sampler_view

no functional changes

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

2 years agoanv: silence wsi debug logging
Mike Blumenkrantz [Wed, 26 Jan 2022 20:46:36 +0000 (15:46 -0500)]
anv: silence wsi debug logging

this is triggered by mesa's own wsi handling, so stop printing nonsense

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14743>

2 years agovulkan/wsi/x11: document implementation
Roman Gilg [Mon, 31 Aug 2020 00:35:57 +0000 (02:35 +0200)]
vulkan/wsi/x11: document implementation

To extend the shared understanding of our code base and ease contributing
document purpose and flow for many of our internal functions.

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

2 years agoradv/ci: mark the dEQP fails related to a missing VKCTS 1.3 as expected
Martin Roukala (né Peres) [Wed, 26 Jan 2022 07:56:01 +0000 (09:56 +0200)]
radv/ci: mark the dEQP fails related to a missing VKCTS 1.3 as expected

Now that RADV is exposing Vulkan 1.3 by default, VKCTS is getting
confused by it and fails 2 tests:

 - dEQP-VK.api.version_check.version: This version of CTS does not
   support Vulkan device version 1.3.204 (Fail)
 - dEQP-VK.info.device_properties: deviceProperties apiVersion not
   valid (Fail)

Mark both of these failures as expected, while we wait for VKCTS 1.3
to be released.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14729>

2 years agov3dv: document why we don't expose VK_EXT_scalar_block_layout
Iago Toral Quiroga [Tue, 25 Jan 2022 11:53:20 +0000 (12:53 +0100)]
v3dv: document why we don't expose VK_EXT_scalar_block_layout

And since this is an optional feature in Vulkan 1.2, fill in the
corresponding feature query while we are at it.

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

2 years agov3dv: rework Vulkan 1.2 feature queries
Iago Toral Quiroga [Tue, 25 Jan 2022 11:49:44 +0000 (12:49 +0100)]
v3dv: rework Vulkan 1.2 feature queries

Fill them into a VkPhysicalDeviceVulkan12Features struct like we
do for Vulkan 1.1, and then read them from there.

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

2 years agov3dv: implement VK_KHR_imageless_framebuffer
Iago Toral Quiroga [Mon, 24 Jan 2022 12:38:08 +0000 (13:38 +0100)]
v3dv: implement VK_KHR_imageless_framebuffer

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14704>

2 years agov3dv: drop signature of undefined function
Iago Toral Quiroga [Mon, 24 Jan 2022 13:26:28 +0000 (14:26 +0100)]
v3dv: drop signature of undefined function

This is a left over from when we added multi-version support in the
driver, where we turned this helper into a versioned scheme.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14704>

2 years agoci/traces: Always generate the junit XML.
Emma Anholt [Wed, 12 Jan 2022 19:27:03 +0000 (11:27 -0800)]
ci/traces: Always generate the junit XML.

While it's not the primary interface to interpreting trace job failures,
it was set in all the traces jobs it looks like and it's low cost anyway.

Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14604>

2 years agoci/traces: Drop PIGLIT_REPLAY_UPLOAD_TO_MINIO.
Emma Anholt [Wed, 12 Jan 2022 19:24:44 +0000 (11:24 -0800)]
ci/traces: Drop PIGLIT_REPLAY_UPLOAD_TO_MINIO.

You have to do this as part of the traces workflow, otherwise there are no
baseline images for your driver to compare to in the HTML summary.

Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14604>

2 years agoci/traces: Drop the baseline file creation for trace results.
Emma Anholt [Wed, 12 Jan 2022 19:19:39 +0000 (11:19 -0800)]
ci/traces: Drop the baseline file creation for trace results.

It's always empty for traces.  This reduces more noise in the job logs so
people are more likely to see the link to the HTML.

Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14604>

2 years agoci/traces: Clean up the failure report message.
Emma Anholt [Wed, 12 Jan 2022 19:13:12 +0000 (11:13 -0800)]
ci/traces: Clean up the failure report message.

You really want to be reviewing the HTML summary with image diffs, not the
junit XML (though we do still generate it so you get the results in the
gitlab UI if that's how you like to interact with it).

Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14604>

2 years agoci/traces: Drop the PIGLIT_PROFILES setting for traces replay.
Emma Anholt [Wed, 12 Jan 2022 19:06:08 +0000 (11:06 -0800)]
ci/traces: Drop the PIGLIT_PROFILES setting for traces replay.

Now that the script just does traces, no need to conditionalize this
stuff.

Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14604>

2 years agoci/traces: Rename the piglit/run.sh script to piglit-traces.sh.
Emma Anholt [Wed, 12 Jan 2022 18:59:08 +0000 (10:59 -0800)]
ci/traces: Rename the piglit/run.sh script to piglit-traces.sh.

That's the only use of this script that's left.

Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14604>

2 years agoci/llvmpipe,softpipe: Switch piglit testing to piglit-runner.
Emma Anholt [Wed, 12 Jan 2022 17:54:44 +0000 (09:54 -0800)]
ci/llvmpipe,softpipe: Switch piglit testing to piglit-runner.

The new runner reduces the runtime by about 1/3 thanks to using rust
instead of python, and includes automatic flake handling so you don't just
have to skip flaky tests.  The wrapper script also includes IRC flake
reporting (so one can track and update the flakes list to improve CI
reliability), always uploading results to CI for review (so you can
diagnose flakes and look at timings), has a prettier regressions report
and a helpful timing report, and is the same as what's used by all the HW
runners as well.

The downside is that by dropping the massive list of skips, you no longer
get flagged if Mesa refactors end up accidentally disabling extensions and
thus making tests skip.  For that, I've started on
https://gitlab.freedesktop.org/anholt/deqp-runner/-/merge_requests/33 so
that hardware drivers get extension checking coverage too.

Thanks to the perf improvement, we get to drop one of the jobs for
llvmpipe.

xfail lists were mostly sed-jobs from the prior expectations lists.  The
exceptions to that you'll find in the form of whitespace around the
affected test group (usually changes of capitalization or
special-characters), or an explanation for the more interesting changes
(which thankfully we can now record in the xfails lists!).

Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14604>

2 years agoci/llvmpipe: Drop the skip of piglit edgeflag test.
Emma Anholt [Wed, 12 Jan 2022 18:35:45 +0000 (10:35 -0800)]
ci/llvmpipe: Drop the skip of piglit edgeflag test.

I think the fail was fixed by 39ea95330fb5 ("mesa: ensure parameter list
capacity before associating uniform storage"), it doesn't reproduce for me
any more.

Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14604>

2 years agoRevert "ci: freedreno: Update a530 dEQP fail expectation list"
Emma Anholt [Wed, 26 Jan 2022 16:52:14 +0000 (08:52 -0800)]
Revert "ci: freedreno: Update a530 dEQP fail expectation list"

This reverts commit a35c5540e4241cb4473f5cc9cb1a53bdeee85ada.  Another
patch doing so had already landed, so 530 was now failing all its (manual)
tests.

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

2 years agofreedreno: Add missing generated header dependency
Rob Clark [Wed, 26 Jan 2022 17:34:48 +0000 (09:34 -0800)]
freedreno: Add missing generated header dependency

Fixes:

  In file included from ../mesa-freedreno-22.0.0_pre/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c:45:
  In file included from ../mesa-freedreno-22.0.0_pre/src/gallium/drivers/freedreno/ir3/ir3_gallium.h:34:
  In file included from ../mesa-freedreno-22.0.0_pre/src/gallium/drivers/freedreno/freedreno_util.h:31:
  ../mesa-freedreno-22.0.0_pre/src/freedreno/drm/freedreno_ringbuffer.h:35:10: fatal error: 'adreno_common.xml.h' file not found
  #include "adreno_common.xml.h"
           ^~~~~~~~~~~~~~~~~~~~~
  1 error generated.

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

2 years agodri_interface: Remove the remaining DRI1 API definitions
Adam Jackson [Wed, 26 Jan 2022 19:10:34 +0000 (14:10 -0500)]
dri_interface: Remove the remaining DRI1 API definitions

None of these are used anymore, and as a bonus we can drop the dance
around the libdrm headers.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14738>

2 years agoanv: Re-enable CCS_E on TGL+
Nanley Chery [Tue, 25 Jan 2022 17:19:33 +0000 (12:19 -0500)]
anv: Re-enable CCS_E on TGL+

Commit e6147895885 ("anv: Also disallow CCS_E for multi-LOD images")
accidentally disabled CCS_E on TGL+ because it checked for
image->vk.mip_levels > 0 instead of image->vk.mip_levels > 1.

Instead of reverting it, we remove the code which disables CCS_E for
mipmapped or arrayed images now that we've sufficiently handled the
clear color issue in other ways.

Fixes: e6147895885 ("anv: Also disallow CCS_E for multi-LOD images")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14723>

2 years agoanv: Use ANV_FAST_CLEAR_DEFAULT_VALUE for CCS on TGL+
Nanley Chery [Tue, 25 Jan 2022 21:33:26 +0000 (16:33 -0500)]
anv: Use ANV_FAST_CLEAR_DEFAULT_VALUE for CCS on TGL+

On TGL, if a block of fragment shader outputs match the surface's clear
color, the HW may convert them to fast-clears (see HSD 14010672564).
This can lead to rendering corruptions if not handled properly. We
restrict the clear color to zero to avoid issues that can occur with:

   - Texture view rendering (including blorp_copy calls)
   - Images with multiple levels or array layers

Fixes: e6147895885 ("anv: Also disallow CCS_E for multi-LOD images")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14723>

2 years agoanv: Disable CCS_E for some 8/16bpp copies on TGL+
Nanley Chery [Mon, 24 Jan 2022 23:53:37 +0000 (18:53 -0500)]
anv: Disable CCS_E for some 8/16bpp copies on TGL+

CCS_E is currently disabled on TGL+, but we'll enable it soon. We choose
to explicitly disable it for certain copy operations to avoid CTS
failures in the following groups:

- dEQP-VK.drm_format_modifiers.export_import.*
- dEQP-VK.synchronization*

Fixes: e6147895885 ("anv: Also disallow CCS_E for multi-LOD images")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14723>

2 years agoanv: Drop assert against modifier with aux on gfx12
Nanley Chery [Mon, 24 Jan 2022 23:54:17 +0000 (18:54 -0500)]
anv: Drop assert against modifier with aux on gfx12

Commit b664349973b ("anv: Enable implicit CCS for external images")
introduced support for implicit CCS with I915_FORMAT_MOD_Y_TILED.

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

2 years agodocs: use http-redirect when possible
Erik Faye-Lund [Sat, 1 Jan 2022 13:03:53 +0000 (14:03 +0100)]
docs: use http-redirect when possible

GitLab Pages has added a feature to do proper HTTP redirects, which
are genreally better than the HTML redirects we currently use.

Unfortunately, it doesn't support redirecting to other domains, all
paths must start with a slash. So there's sadly *one* redirect this
doesn't work for. So let's leave that one using a HTML redirect, and
use HTTP redirects when we can.

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

2 years agosoftpipe: Dispatch 4 CS invocations per tgsi_exec thread.
Emma Anholt [Wed, 26 Jan 2022 05:31:06 +0000 (21:31 -0800)]
softpipe: Dispatch 4 CS invocations per tgsi_exec thread.

We were executing 1 non-helper invocation and 3 helpers per CS tgsi_exec
machine, which was a total waste of the CPU when we could trivially have
all 4 invocations do real work (at least in the common case of a
gl_WorkGroupSize.x >= 4).

This didn't have the effect on dEQP that I was hoping for, as it turns out
that its shaders are almost all 1x1x1 workgroups.  However, it does reduce
the runtime of piglit arb_compute_shader-local-id from 2:10 to 47 seconds
on my system.

Part of #4097

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

2 years agosoftpipe: Initialize the CS dispatch mask at machine setup time.
Emma Anholt [Wed, 26 Jan 2022 05:29:40 +0000 (21:29 -0800)]
softpipe: Initialize the CS dispatch mask at machine setup time.

It's not modified later, so no need to reset it per barrier or per
workgroup.

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

2 years agosoftpipe: Improve some local var naming in compute shaders.
Emma Anholt [Wed, 26 Jan 2022 05:19:05 +0000 (21:19 -0800)]
softpipe: Improve some local var naming in compute shaders.

These aren't dimensions, they're gl_LocalInvocationID.xyz.

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

2 years agotgsi_exec: Fix shared var stores for >1 real invocation, and overflow checks.
Emma Anholt [Wed, 26 Jan 2022 05:48:44 +0000 (21:48 -0800)]
tgsi_exec: Fix shared var stores for >1 real invocation, and overflow checks.

The shared var store overflow checks left a lot of overflowing
opportunities available, while the buffer storage path did proper
checking.  But, more importantly for this branch, it always used the first
invocation's offset for each invocation in the quad (which only worked so
far because softpipe only dispatched a single non-helper invocation
per quad).

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

2 years agoturnip: fix leaks of submit requests.
Hyunjun Ko [Wed, 26 Jan 2022 03:04:40 +0000 (03:04 +0000)]
turnip: fix leaks of submit requests.

Fixes: 479a1c40 ("turnip: Porting to common vulkan implementation for synchronization.")

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14727>

2 years agozink: return 256 for PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT
Mike Blumenkrantz [Tue, 25 Jan 2022 18:47:12 +0000 (13:47 -0500)]
zink: return 256 for PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT

this isn't the minimum allowed by the driver, but zink doesn't return
the minimum allowed by the driver anyway and hasn't in a very long time

instead, it suballocates using a minimum alignment of 256 bytes, so use
that instead

fixes (in caselists):
KHR-GL46.map_buffer_alignment.functional

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

2 years agozink: fix unused variable warning
Michel Zou [Wed, 26 Jan 2022 19:54:28 +0000 (20:54 +0100)]
zink: fix unused variable warning

fixes: 4ed30be3

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

2 years agodocs/release-calendar: add another 21.3.x since 22.0 has been delayed a bit
Eric Engestrom [Wed, 26 Jan 2022 18:47:30 +0000 (18:47 +0000)]
docs/release-calendar: add another 21.3.x since 22.0 has been delayed a bit

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

2 years agodocs: update calendar and link releases notes for 21.3.5
Eric Engestrom [Wed, 26 Jan 2022 18:39:08 +0000 (18:39 +0000)]
docs: update calendar and link releases notes for 21.3.5

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

2 years agodocs: add release notes for 21.3.5
Eric Engestrom [Wed, 26 Jan 2022 18:36:17 +0000 (18:36 +0000)]
docs: add release notes for 21.3.5

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

2 years ago.mailmap: Switch Jason Ekstrand to @collabora.com
Jason Ekstrand [Mon, 17 Jan 2022 15:42:50 +0000 (09:42 -0600)]
.mailmap: Switch Jason Ekstrand to @collabora.com

Jason is starting at Collabora on the 24th.  More details at
https://www.jlekstrand.net/jason/blog/2022/01/hello-collabora/

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14586>

2 years agotu: VkExternalImageFormatProperties is optional
Yiwei Zhang [Wed, 26 Jan 2022 07:53:59 +0000 (07:53 +0000)]
tu: VkExternalImageFormatProperties is optional

..even if external image info has valid external handles.

Fixes: 26380b3a9f8 ("turnip: Add driver skeleton (v2)")

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14730>

2 years agoradeon/vcn: Updating render_pic_list for correction
Ruijing Dong [Mon, 24 Jan 2022 18:00:32 +0000 (13:00 -0500)]
radeon/vcn: Updating render_pic_list for correction

In order to keep track of reference frame buffer address changing,
using past_ref to compare with render_pic_list, once the one in
past_ref is valid and if render_pic_list has that entry, it will
need to update it to the latest one in ref[i].

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

Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14646>

2 years agofrontend/va: Keep surface buf addr before reallocation
Ruijing Dong [Mon, 24 Jan 2022 17:42:58 +0000 (12:42 -0500)]
frontend/va: Keep surface buf addr before reallocation

The reference buffer address is used as the indication in h264 DPB
Tier2, when reference buffer was reallocated, h264 DPB would lose
track of that reference picture. Adding a pointer obsolete_buf in
vlVaSurface data structure for tracking this released buffer, also
in h264_picture_desc adding a private field, which contains
past_ref[16] for tracking previously released buffer vs current
buffer for reference frames.

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

Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14646>

2 years agozink: reorder fbfetch flag-setting to avoid null deref
Mike Blumenkrantz [Tue, 25 Jan 2022 16:25:24 +0000 (11:25 -0500)]
zink: reorder fbfetch flag-setting to avoid null deref

this avoids dereferencing pg->dd which is allocated a few lines later

Fixes: 417477f60ed ("zink: always use lazy (non-push) updating for fbfetch descriptors")

fixes (radv):
dEQP-GLES31.functional.blend_equation_advanced.basic.multiply

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

2 years agoradv: fix optimized MSAA copies with suballocated images
Rhys Perry [Mon, 24 Jan 2022 20:05:37 +0000 (20:05 +0000)]
radv: fix optimized MSAA copies with suballocated images

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: deb4685df39 ("radv: implement optimized MSAA copies using FMASK")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5829
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14705>

2 years agozink: handle bogus xfb draws
Mike Blumenkrantz [Tue, 18 Jan 2022 22:39:05 +0000 (17:39 -0500)]
zink: handle bogus xfb draws

drawing unpopulated xfb data is legal(?) and tested in cts, and the correct
operation is to just drop the draw, so do that here

fixes (nvidia):
GTF-GL46.gtf40.GL3Tests.transform_feedback2.transform_feedback2_api

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

2 years agoanv: Enable VK_KHR_dynamic_rendering
Iván Briano [Thu, 4 Nov 2021 19:19:07 +0000 (12:19 -0700)]
anv: Enable VK_KHR_dynamic_rendering

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

2 years agoanv: implement the meat of VK_KHR_dynamic_rendering
Iván Briano [Thu, 4 Nov 2021 19:33:05 +0000 (12:33 -0700)]
anv: implement the meat of VK_KHR_dynamic_rendering

Includes a fake framebuffer allocation that's necessary for the code we
still use from the regular render passes.

v3: (Lionel)
- Reuse the attachment count from the faux render pass, remove now
  unused function
- Add a cmd_buffer_end_rendering function to match begin_rendering,
  making use of the split stuff from end_subpass

v4: (Lionel)
- Don't bother with mark_images_writen or resolves on suspend case
- Remove flush at the end of end_rendering, it's not needed

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

2 years agoanv: split end_subpass into more discrete components
Iván Briano [Mon, 8 Nov 2021 21:10:00 +0000 (13:10 -0800)]
anv: split end_subpass into more discrete components

v3: Split cmd_buffer_end_subpass instead of doing parts conditionally (Lionel)

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

2 years agoanv: Split attachment clearing code into their own functions
Iván Briano [Tue, 9 Nov 2021 00:32:31 +0000 (16:32 -0800)]
anv: Split attachment clearing code into their own functions

v3: Avoid recalculating parameters the caller already had (Lionel)

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

2 years agoanv: allocate fake render pass for continuation command buffers
Iván Briano [Thu, 4 Nov 2021 19:30:20 +0000 (12:30 -0700)]
anv: allocate fake render pass for continuation command buffers

v4: Assert if there's no VkCommandBufferInheritanceRenderingInfoKHR (Lionel)

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

2 years agoanv: Split out state attachments allocation
Iván Briano [Mon, 8 Nov 2021 19:32:37 +0000 (11:32 -0800)]
anv: Split out state attachments allocation

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

2 years agoanv: allocate fake render pass on pipeline creation
Iván Briano [Thu, 4 Nov 2021 19:29:09 +0000 (12:29 -0700)]
anv: allocate fake render pass on pipeline creation

v3: (Lionel)
- Handle VkPipelineRenderingCreateInfoKHR not being present
- Rename dynamic_pass and set it for regular render passes too

v4: C99 is good (Lionel)

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

2 years agoanv: add functions to set up fake render passes
Iván Briano [Thu, 4 Nov 2021 19:26:26 +0000 (12:26 -0700)]
anv: add functions to set up fake render passes

There's two of them because they can be created from three points in the
code that provide different details and this is the least ugly way I
could think of for now.

v2: Avoid allocations (Lionel)

v3: Move definition closer to its usage (Lionel)

v4: (Lionel)
 - Simplify anv_dynamic_pass_init_full
 - Zero out pass/subpass to avoid stall pointers

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

2 years agoanv: Remove unused struct member
Iván Briano [Tue, 9 Nov 2021 00:00:11 +0000 (16:00 -0800)]
anv: Remove unused struct member

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

2 years agoanv/pass: Don't set first_subpass_layout for stencil-only attachments
Jason Ekstrand [Tue, 26 Oct 2021 17:38:18 +0000 (12:38 -0500)]
anv/pass: Don't set first_subpass_layout for stencil-only attachments

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

2 years agopanfrost: Remove NO_BLEND_PACKS quirk
Alyssa Rosenzweig [Tue, 25 Jan 2022 23:10:10 +0000 (18:10 -0500)]
panfrost: Remove NO_BLEND_PACKS quirk

Now unused.

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

2 years agopanfrost: Simplify format class selection
Alyssa Rosenzweig [Tue, 25 Jan 2022 23:08:55 +0000 (18:08 -0500)]
panfrost: Simplify format class selection

This was made way more complicated than it needs to be for a Midgard-only pass.
The only caller doesn't care about the class, only if it's native or not.
Simplify it appropriately.

It really isn't that hard.

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

2 years agopanfrost: Don't set NO_BLEND_PACKS on Bifrost
Alyssa Rosenzweig [Tue, 25 Jan 2022 22:58:14 +0000 (17:58 -0500)]
panfrost: Don't set NO_BLEND_PACKS on Bifrost

It doesn't make sense on Bifrost -- the only consumer of the quirk is
pan_lower_framebuffer, a Midgard-only pass.

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

2 years agopanfrost: Remove MIDGARD_{NO_TYPED_BLEND_STORES,MISSING_LOADS}
Alyssa Rosenzweig [Tue, 25 Jan 2022 22:56:33 +0000 (17:56 -0500)]
panfrost: Remove MIDGARD_{NO_TYPED_BLEND_STORES,MISSING_LOADS}

These "quirks" are common for Midgard, yet are only consumed by
pan_lower_framebuffer -- a Midgard-only pass. So the quirks should be removed
and inlined into their users. Thid removes MIDGARD_QUIRKS altogether.

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

2 years agopanfrost: Remove NO_TILE_ENABLE_MAP quirk
Alyssa Rosenzweig [Tue, 25 Jan 2022 22:51:48 +0000 (17:51 -0500)]
panfrost: Remove NO_TILE_ENABLE_MAP quirk

Function of architecture. Add a comment to the sole consumer of the quirk bit
about why it's used.

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

2 years agopanfrost: Remove MIDGARD_BROKEN_FP16 quirk
Alyssa Rosenzweig [Tue, 25 Jan 2022 22:49:54 +0000 (17:49 -0500)]
panfrost: Remove MIDGARD_BROKEN_FP16 quirk

Unused.

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

2 years agopanfrost: Remove MIDGARD_SFBD quirk
Alyssa Rosenzweig [Tue, 25 Jan 2022 22:49:08 +0000 (17:49 -0500)]
panfrost: Remove MIDGARD_SFBD quirk

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

2 years agopanfrost: Remove HAS_SWIZZLES quirk
Alyssa Rosenzweig [Tue, 25 Jan 2022 22:46:40 +0000 (17:46 -0500)]
panfrost: Remove HAS_SWIZZLES quirk

It's a function of the major arch.

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

2 years agod3d12: Set caps for tesselation
Jesse Natalie [Sat, 1 Jan 2022 22:49:40 +0000 (14:49 -0800)]
d3d12: Set caps for tesselation

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>

2 years agod3d12: Handle input clip array size in the shader key
Jesse Natalie [Thu, 6 Jan 2022 15:42:22 +0000 (07:42 -0800)]
d3d12: Handle input clip array size in the shader key

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>

2 years agod3d12: Update varying creation logic to handle location_frac
Jesse Natalie [Wed, 5 Jan 2022 15:38:38 +0000 (07:38 -0800)]
d3d12: Update varying creation logic to handle location_frac

When multiple variables are packed into the same location, we need
to re-construct variables that read/write the same components of that
register so that the DXIL signature is correct. We could try to
merge these variables, but getting the types right sounds harder than
just preserving the multiple individual variables.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>

2 years agod3d12: Add a state variable for patch_vertices_in
Jesse Natalie [Thu, 6 Jan 2022 00:07:51 +0000 (16:07 -0800)]
d3d12: Add a state variable for patch_vertices_in

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>

2 years agod3d12: Handle passthrough TCS in the case where eval is bound
Jesse Natalie [Mon, 3 Jan 2022 20:49:28 +0000 (12:49 -0800)]
d3d12: Handle passthrough TCS in the case where eval is bound

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>

2 years agod3d12: Handle patch_vertices and patch topology
Jesse Natalie [Sun, 2 Jan 2022 23:21:55 +0000 (15:21 -0800)]
d3d12: Handle patch_vertices and patch topology

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>

2 years agod3d12: Link tesselation control and eval shaders
Jesse Natalie [Sun, 2 Jan 2022 21:03:32 +0000 (13:03 -0800)]
d3d12: Link tesselation control and eval shaders

GLSL puts a bunch of tessellation info in the eval shaders, because
passthrough control shaders can exist. D3D12 puts it in the control
(hull) shader instead. So, when specializing, copy info from domain
to hull. For initial compiles (no domain shader), just make something
up.

D3D12 also requires the domain and hull shaders to have identical
patch constant signatures. Use the existing infrastructure and extend
it to also propagate patch constants. Notably, patch constant locations
are outside of the 64-bit range value so they require a separate pass
to avoid shifts larger than 64.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>

2 years agod3d12: Initial plumbing for tesselation
Jesse Natalie [Sat, 1 Jan 2022 22:49:28 +0000 (14:49 -0800)]
d3d12: Initial plumbing for tesselation

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>

2 years agod3d12: Enable PIPE_CAP_TGSI_TEXCOORD
Jesse Natalie [Thu, 6 Jan 2022 17:03:18 +0000 (09:03 -0800)]
d3d12: Enable PIPE_CAP_TGSI_TEXCOORD

This is required to be able to use the necessary number of varyings,
otherwise we hit asserts because mesa/st starts assigning varyings
locations above 64 due to the +9 reserving these texcoords.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>

2 years agomicrosoft/compiler: Handle clip/cull distance as an input to tess shaders
Jesse Natalie [Thu, 6 Jan 2022 15:40:24 +0000 (07:40 -0800)]
microsoft/compiler: Handle clip/cull distance as an input to tess shaders

In order to get the semantics right, we need to know how many of the clip/
cull fields are designated for which purpose. In the case of a shader that
can receive these fields as both input and output, the shader_info property
is reserved to store the output info. We could add a dedicated input field
to shader_info, but since it'd probably only be useful for us, just send
it through a side channel during shader linking.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>

2 years agomicrosoft/compiler: Location_frac needs to be included in sort order
Jesse Natalie [Wed, 5 Jan 2022 15:40:49 +0000 (07:40 -0800)]
microsoft/compiler: Location_frac needs to be included in sort order

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>

2 years agomicrosoft/compiler: Primitive ID should only be added as a sysval in geometry shaders
Jesse Natalie [Mon, 3 Jan 2022 22:47:35 +0000 (14:47 -0800)]
microsoft/compiler: Primitive ID should only be added as a sysval in geometry shaders

Docs say that its presence in signatures as a "shadow" element (meaning it's not
accessed via load/store, but with a dedicated opcode) is legacy. It seems it
wasn't carried forward when HS/DS were added in D3D11.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>

2 years agomicrosoft/compiler: Emit DS PSV validation and entrypoint metadata
Jesse Natalie [Mon, 3 Jan 2022 17:04:03 +0000 (09:04 -0800)]
microsoft/compiler: Emit DS PSV validation and entrypoint metadata

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>

2 years agomicrosoft/compiler: Handle domain location intrinsic
Jesse Natalie [Sun, 2 Jan 2022 23:23:06 +0000 (15:23 -0800)]
microsoft/compiler: Handle domain location intrinsic

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>

2 years agomicrosoft/compiler: Handle load_output in the HS stage as reading a previously writte...
Jesse Natalie [Tue, 4 Jan 2022 16:39:26 +0000 (08:39 -0800)]
microsoft/compiler: Handle load_output in the HS stage as reading a previously written patch constant

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>

2 years agomicrosoft/compiler: Handle load_per_vertex_output as LoadOutputControlPoint
Jesse Natalie [Tue, 4 Jan 2022 00:15:12 +0000 (16:15 -0800)]
microsoft/compiler: Handle load_per_vertex_output as LoadOutputControlPoint

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>

2 years agomicrosoft/compiler: For load_input from DS, use loadPatchConstant
Jesse Natalie [Mon, 3 Jan 2022 21:35:39 +0000 (13:35 -0800)]
microsoft/compiler: For load_input from DS, use loadPatchConstant

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>

2 years agomicrosoft/compiler: For store_output from HS, use storePatchConstant
Jesse Natalie [Sun, 2 Jan 2022 17:56:08 +0000 (09:56 -0800)]
microsoft/compiler: For store_output from HS, use storePatchConstant

In HS, store_per_vertex_output maps to storeOutput in DXIL. The data
that isn't per-vertex is patch constants.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>

2 years agomicrosoft/compiler: Add a pass for hull and domain shaders to shrink tess level vars
Jesse Natalie [Mon, 3 Jan 2022 13:51:36 +0000 (05:51 -0800)]
microsoft/compiler: Add a pass for hull and domain shaders to shrink tess level vars

DXIL validation will complain if the tess factor signature entries have the
wrong number of components for the shader's domain. Make sure that both
hull and domain shaders have the right number, and drop loads and stores
from the removed components.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>

2 years agomicrosoft/compiler: Add patch constant signature into PSV and as container blob
Jesse Natalie [Mon, 3 Jan 2022 14:08:35 +0000 (06:08 -0800)]
microsoft/compiler: Add patch constant signature into PSV and as container blob

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>

2 years agomicrosoft/compiler: Gather patch const signature and handle tess factor in it
Jesse Natalie [Mon, 3 Jan 2022 14:01:14 +0000 (06:01 -0800)]
microsoft/compiler: Gather patch const signature and handle tess factor in it

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>

2 years agomicrosoft/compiler: When sorting patch varyings, adjust location to be in normal...
Jesse Natalie [Mon, 3 Jan 2022 21:33:53 +0000 (13:33 -0800)]
microsoft/compiler: When sorting patch varyings, adjust location to be in normal varying range

This way, patch varyings come before the patch sysvals (tess levels).

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>

2 years agomicrosoft/compiler: Overlap patch and non-patch varyings so both are separately 0...
Jesse Natalie [Sun, 2 Jan 2022 18:15:58 +0000 (10:15 -0800)]
microsoft/compiler: Overlap patch and non-patch varyings so both are separately 0-indexed

Also add tess factors to the list of sysvals that can cause vars to be sorted last.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>

2 years agomicrosoft/compiler: Fix I/O signatures for tess shaders
Jesse Natalie [Mon, 3 Jan 2022 13:45:48 +0000 (05:45 -0800)]
microsoft/compiler: Fix I/O signatures for tess shaders

- Skip patch variables, those go into a separate patch constant signature
- Use nir_is_arrayed_io and only strip one level of array when it's true

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>

2 years agomicrosoft/compiler: Emit HS PSV validation and entrypoint metadata
Jesse Natalie [Mon, 3 Jan 2022 14:20:25 +0000 (06:20 -0800)]
microsoft/compiler: Emit HS PSV validation and entrypoint metadata

Note that this requires the shader info "tess" data to be correct.
For GLSL tess control shaders, only the output primitive count is
automatically available. The rest will need to be either guessed
or filled in from a matching tess eval (domain) shader. This is handled
by the d3d12 driver in a later patch.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>