platform/upstream/mesa.git
3 years agoci: build piglit inside baremetal and LAVA's rootfs
Andres Gomez [Thu, 27 Aug 2020 19:18:17 +0000 (22:18 +0300)]
ci: build piglit inside baremetal and LAVA's rootfs

v2:
  - Updated the ci-fairy commit to use.

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6388>

3 years agoci: move API specification to driver instead of test suite
Andres Gomez [Thu, 27 Aug 2020 17:47:34 +0000 (20:47 +0300)]
ci: move API specification to driver instead of test suite

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6388>

3 years agoci: move general build commands to their own section
Andres Gomez [Wed, 11 Nov 2020 19:29:46 +0000 (21:29 +0200)]
ci: move general build commands to their own section

The STRIP_CMD env var is used in several build scripts, not just by
dEQP.

Also, we want to have the rootfs destination directory created so it
also exists for builds that only move directory trees in there.

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6388>

3 years agoci: add Vulkan piglit traces jobs and remove tracie ones
Andres Gomez [Thu, 27 Aug 2020 17:33:10 +0000 (20:33 +0300)]
ci: add Vulkan piglit traces jobs and remove tracie ones

v2:
  - Rename *-piglit-traces jobs with *-traces.

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6388>

3 years agoci: only modify LD_LIBRARY_PATH when running the piglit cmd
Andres Gomez [Fri, 21 Aug 2020 08:51:47 +0000 (11:51 +0300)]
ci: only modify LD_LIBRARY_PATH when running the piglit cmd

Doing it earlier may interfere with the optional command wrapper.

v2:
  - Fixed typo (Eric).

Suggested-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6388>

3 years agoci: add piglit replay jobs and remove tracie ones
Andres Gomez [Wed, 19 Aug 2020 13:42:56 +0000 (16:42 +0300)]
ci: add piglit replay jobs and remove tracie ones

Along the way, modify the piglit run script and refactor the way
piglit jobs are generated.

v2:
  - Squashed the commit to remove tracie jobs (Eric).

v3:
  - Extend information in the comments about the need to use a
    running X server for replaying with Vulkan (Tomeu).
  - Do actually fail if the upload doesn't work (Tomeu).

v4:
  - Rename *-piglit-traces jobs with *-traces.

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> [v3]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6388>

3 years agoci: specify MinIO's host URL in a global variable
Andres Gomez [Sun, 23 Aug 2020 20:32:40 +0000 (23:32 +0300)]
ci: specify MinIO's host URL in a global variable

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6388>

3 years agoci: build piglit in the Vulkan testing image
Andres Gomez [Mon, 24 Aug 2020 11:10:24 +0000 (14:10 +0300)]
ci: build piglit in the Vulkan testing image

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6388>

3 years agoci: update piglit's version so it features replayer
Andres Gomez [Mon, 17 Aug 2020 09:09:56 +0000 (12:09 +0300)]
ci: update piglit's version so it features replayer

We also need that summary's aggregate command can use JUnit as backend,
a cross-compilation fix for its CMakeList.txt, a fix for the JUnit
backend and a small change in replayer's compare output.

v2:
  - Updated the piglit commit so it features another couple of needed
    fixes.

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com> [v1]
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6388>

3 years agoci: spread the usage of the FDO_UPSTREAM_REPO variable
Andres Gomez [Wed, 9 Dec 2020 19:41:01 +0000 (21:41 +0200)]
ci: spread the usage of the FDO_UPSTREAM_REPO variable

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6388>

3 years agoci: install ci-fairy in the testing images
Andres Gomez [Mon, 24 Aug 2020 11:09:17 +0000 (14:09 +0300)]
ci: install ci-fairy in the testing images

v2:
  - Updated the ci-fairy commit to use.

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6388>

3 years agoci: use ephemeral packages when building the build-base image
Andres Gomez [Mon, 24 Aug 2020 18:56:41 +0000 (21:56 +0300)]
ci: use ephemeral packages when building the build-base image

v2:
  - Update tag for the android_build image (Michel).

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com> [v1]
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6388>

3 years agoci: specify source and build directories with CMake
Andres Gomez [Mon, 9 Nov 2020 15:35:46 +0000 (17:35 +0200)]
ci: specify source and build directories with CMake

The -S and -B flags were officially introduced in CMake 3.13.

Avoids the following warning:

"
CMake Warning:
  No source or binary directory provided.  Both will be assumed to be the
  same as the current working directory, but note that this warning will
  become a fatal error in future CMake releases.
"

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6388>

3 years agospirv2nir: Add --opengl (-g) argument for OpenGL SPIR-V
Caio Marcelo de Oliveira Filho [Fri, 18 Dec 2020 06:01:06 +0000 (22:01 -0800)]
spirv2nir: Add --opengl (-g) argument for OpenGL SPIR-V

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8156>

3 years agodocs/egl.rst: switch true→enabled
Trevor Woerner [Sat, 19 Dec 2020 05:56:33 +0000 (00:56 -0500)]
docs/egl.rst: switch true→enabled

The old "true/false" values for some of the configuration options have been
deprecated in favour of enabled/disabled.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8173>

3 years agoci: Bump deqp to current vulkan-cts-1.2.5.0 also in the Lava jobs
Andres Gomez [Tue, 22 Dec 2020 12:10:18 +0000 (14:10 +0200)]
ci: Bump deqp to current vulkan-cts-1.2.5.0 also in the Lava jobs

The tag update was forgotten after e384476d1e9 ("ci: Bump deqp to
current vulkan-cts-1.2.5.0").

Noticeably, this introduces 2 more failures in the panfrost-t860 job:
  - dEQP-GLES3.functional.shaders.matrix.inverse.dynamic.lowp_mat2_float_vertex
  - dEQP-GLES3.functional.shaders.matrix.inverse.dynamic.mediump_mat2_float_vertex,Fail

Fixes: e384476d1e9 ("ci: Bump deqp to current vulkan-cts-1.2.5.0")
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8198>

3 years agodoc/features: mark off tessellation for zink
Mike Blumenkrantz [Tue, 22 Dec 2020 13:58:16 +0000 (08:58 -0500)]
doc/features: mark off tessellation for zink

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8199>

3 years agoaco: create VMEM clauses slightly more aggressive
Daniel Schürmann [Wed, 12 Aug 2020 16:19:11 +0000 (18:19 +0200)]
aco: create VMEM clauses slightly more aggressive

Totals from 3325 (2.39% of 139391) affected shaders (NAVI10):
SGPRs: 331528 -> 331056 (-0.14%); split: -0.14%, +0.00%
VGPRs: 306164 -> 337764 (+10.32%); split: -0.02%, +10.34%
CodeSize: 38843180 -> 38865388 (+0.06%); split: -0.04%, +0.10%
MaxWaves: 18908 -> 17028 (-9.94%); split: +0.01%, -9.95%
Instrs: 7423908 -> 7427934 (+0.05%); split: -0.06%, +0.12%
Cycles: 527411756 -> 526388408 (-0.19%); split: -0.21%, +0.02%
VMEM: 1148421 -> 992660 (-13.56%); split: +0.10%, -13.67%
SMEM: 227337 -> 232380 (+2.22%); split: +2.26%, -0.04%
VClause: 146416 -> 111171 (-24.07%); split: -24.10%, +0.03%
SClause: 243674 -> 243689 (+0.01%); split: -0.00%, +0.01%
Copies: 663496 -> 660333 (-0.48%); split: -0.85%, +0.37%
Branches: 223725 -> 223721 (-0.00%)

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

3 years agoaco: schedule position exports in the same pass as memory operations
Daniel Schürmann [Thu, 13 Aug 2020 14:54:57 +0000 (16:54 +0200)]
aco: schedule position exports in the same pass as memory operations

No fossil-db changes.

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

3 years agoaco: fix def-use distance calculation when scheduling.
Daniel Schürmann [Thu, 13 Aug 2020 08:13:49 +0000 (10:13 +0200)]
aco: fix def-use distance calculation when scheduling.

This change also increases the VMEM_MAX_MOVES
to mitigate some of the scheduling changes.

Totals from 34301 (24.61% of 139391) affected shaders:
SGPRs: 2515440 -> 2552304 (+1.47%); split: -1.25%, +2.71%
VGPRs: 1786676 -> 1794724 (+0.45%); split: -0.31%, +0.76%
CodeSize: 151079856 -> 151209828 (+0.09%); split: -0.06%, +0.15%
MaxWaves: 392454 -> 388966 (-0.89%); split: +0.39%, -1.28%
Instrs: 28870746 -> 28895907 (+0.09%); split: -0.09%, +0.17%
Cycles: 960450680 -> 961315796 (+0.09%); split: -0.09%, +0.18%
VMEM: 19027987 -> 19796223 (+4.04%); split: +7.49%, -3.45%
SMEM: 2434691 -> 2394829 (-1.64%); split: +2.80%, -4.43%
VClause: 551776 -> 543051 (-1.58%); split: -1.73%, +0.15%
SClause: 1230147 -> 1227637 (-0.20%); split: -1.40%, +1.20%
Copies: 1957640 -> 1963617 (+0.31%); split: -1.11%, +1.41%
Branches: 611747 -> 612504 (+0.12%); split: -0.11%, +0.23%

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

3 years agoaco: allow to schedule SALU/SMEM through exec changes
Daniel Schürmann [Wed, 12 Aug 2020 14:16:46 +0000 (16:16 +0200)]
aco: allow to schedule SALU/SMEM through exec changes

Totals from 16794 (12.05% of 139391) affected shaders (NAVI10):
SGPRs: 757760 -> 762048 (+0.57%); split: -0.39%, +0.95%
VGPRs: 402844 -> 402744 (-0.02%); split: -0.04%, +0.02%
CodeSize: 22290900 -> 22285068 (-0.03%); split: -0.06%, +0.04%
MaxWaves: 294163 -> 294222 (+0.02%); split: +0.03%, -0.01%
Instrs: 4190074 -> 4188513 (-0.04%); split: -0.08%, +0.04%
Cycles: 40685028 -> 40678640 (-0.02%); split: -0.03%, +0.02%
VMEM: 7711867 -> 7704315 (-0.10%); split: +0.28%, -0.38%
SMEM: 942472 -> 1007052 (+6.85%); split: +7.15%, -0.30%
VClause: 92990 -> 92974 (-0.02%); split: -0.03%, +0.01%
SClause: 263700 -> 263810 (+0.04%); split: -0.38%, +0.42%
Copies: 277467 -> 276988 (-0.17%); split: -0.37%, +0.20%
Branches: 45899 -> 45896 (-0.01%)

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

3 years agoaco: make pred_by_exec_mask() accessible in other files
Daniel Schürmann [Wed, 12 Aug 2020 14:58:35 +0000 (16:58 +0200)]
aco: make pred_by_exec_mask() accessible in other files

and rename to needs_exec_mask().

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

3 years agoaco: don't emit parallelcopy when switching to WQM.
Daniel Schürmann [Wed, 12 Aug 2020 12:52:04 +0000 (14:52 +0200)]
aco: don't emit parallelcopy when switching to WQM.

The reason was an RA bug which has been fixed a while ago.
This change fixes some register demand miscalculations.

Totals from 1013 (0.73% of 139391) affected shaders (NAVI10):
CodeSize: 6050408 -> 6047504 (-0.05%); split: -0.05%, +0.00%
Instrs: 1160533 -> 1159765 (-0.07%); split: -0.07%, +0.00%
Cycles: 8027212 -> 8024140 (-0.04%); split: -0.04%, +0.00%
VMEM: 296195 -> 296091 (-0.04%)
SMEM: 73003 -> 73011 (+0.01%); split: +0.05%, -0.04%
SClause: 37221 -> 37222 (+0.00%)
Copies: 70931 -> 70166 (-1.08%)

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

3 years agozink: export tess shader pipe caps
Mike Blumenkrantz [Fri, 18 Dec 2020 02:29:26 +0000 (21:29 -0500)]
zink: export tess shader pipe caps

Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8152>

3 years agozink: handle partial writes to shader outputs
Mike Blumenkrantz [Thu, 23 Jul 2020 13:20:36 +0000 (09:20 -0400)]
zink: handle partial writes to shader outputs

this is super gross. spirv doesn't provide any facility for doing per-component
writes, which means all components of a value must be written every time

to this end, we need to manually split both the src and dst composites and
do per-component access for each store in order to accurately handle both
non-sequential wrmasks (which could be handled by nir_lower_wrmasks, yes, but
we aren't using it) as well as partial wrmasks

see also mesa/mesa#4006

Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8152>

3 years agozink: implement passthrough tcs shader injection
Mike Blumenkrantz [Sun, 19 Jul 2020 13:12:40 +0000 (09:12 -0400)]
zink: implement passthrough tcs shader injection

GL allows the pipeline to "infer" a tcs shader if a tes shader is bound using
API-specified default values for gl_TessLevelOuter and gl_TessLevelInner,
but VK requires that both shaders be explicitly present

to handle this, create a generic tcs which translates all vs outputs to
invocation-based arrays and copy the appropriate value to the expected tes
input array location. also emit the default inner/outer values as push constants
so we don't have to recompile the shaders whenever the api calls occur

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

3 years agozink: add stubs for tess outer/inner level handling
Mike Blumenkrantz [Fri, 18 Dec 2020 02:27:37 +0000 (21:27 -0500)]
zink: add stubs for tess outer/inner level handling

Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8152>

3 years agozink: add push constant handling to get_storage_class()
Mike Blumenkrantz [Fri, 18 Dec 2020 01:32:42 +0000 (20:32 -0500)]
zink: add push constant handling to get_storage_class()

Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8152>

3 years agozink: only run nir_lower_clip_halfz for last vertex processing stage
Mike Blumenkrantz [Fri, 17 Jul 2020 14:48:45 +0000 (10:48 -0400)]
zink: only run nir_lower_clip_halfz for last vertex processing stage

this lets us remove the calcs to un-convert POS during load

Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8152>

3 years agozink: add handling for tcs and tes shader states
Mike Blumenkrantz [Fri, 18 Dec 2020 02:29:08 +0000 (21:29 -0500)]
zink: add handling for tcs and tes shader states

Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8152>

3 years agozink: support PIPE_PRIM_PATCHES
Mike Blumenkrantz [Fri, 18 Dec 2020 02:28:50 +0000 (21:28 -0500)]
zink: support PIPE_PRIM_PATCHES

Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8152>

3 years agozink: set tess info in pipeline creation
Mike Blumenkrantz [Fri, 18 Dec 2020 02:28:22 +0000 (21:28 -0500)]
zink: set tess info in pipeline creation

Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8152>

3 years agozink: pull xfb info from tess shader when applicable
Mike Blumenkrantz [Fri, 18 Dec 2020 02:26:34 +0000 (21:26 -0500)]
zink: pull xfb info from tess shader when applicable

if it's the last vertex stage then it does the xfb

Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8152>

3 years agozink: set scoped barrier flag in nir options
Mike Blumenkrantz [Fri, 18 Dec 2020 02:24:43 +0000 (21:24 -0500)]
zink: set scoped barrier flag in nir options

Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8152>

3 years agozink: set up ntv init for tess shaders
Mike Blumenkrantz [Fri, 18 Dec 2020 02:24:28 +0000 (21:24 -0500)]
zink: set up ntv init for tess shaders

Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8152>

3 years agozink: add handling for tess shader intrinsics
Mike Blumenkrantz [Fri, 18 Dec 2020 02:23:54 +0000 (21:23 -0500)]
zink: add handling for tess shader intrinsics

Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8152>

3 years agozink: add ntv handling for tess shader i/o variables
Mike Blumenkrantz [Fri, 18 Dec 2020 02:22:17 +0000 (21:22 -0500)]
zink: add ntv handling for tess shader i/o variables

Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8152>

3 years agozink: don't always run nir_lower_io_arrays_to_elements_no_indirects
Mike Blumenkrantz [Thu, 16 Jul 2020 13:50:59 +0000 (09:50 -0400)]
zink: don't always run nir_lower_io_arrays_to_elements_no_indirects

this is automatically run for fs and vs, which is the only place we really
want it

Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8152>

3 years agoradv: add code that checks if the extension table is sorted correctly
Samuel Pitoiset [Mon, 21 Dec 2020 21:53:01 +0000 (22:53 +0100)]
radv: add code that checks if the extension table is sorted correctly

Ported from ANV.

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

3 years agoradv: sort the extension table like Khronos
Samuel Pitoiset [Mon, 21 Dec 2020 21:51:37 +0000 (22:51 +0100)]
radv: sort the extension table like Khronos

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

3 years agocso: inline cso_construct_key
Marek Olšák [Fri, 4 Dec 2020 13:19:37 +0000 (08:19 -0500)]
cso: inline cso_construct_key

The x86 asm is a lot shorter and the loop is unrolled.

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

3 years agocso: remove context and delete_state pointers from all CSOs
Marek Olšák [Thu, 3 Dec 2020 20:52:20 +0000 (15:52 -0500)]
cso: remove context and delete_state pointers from all CSOs

We just need them per context, not per CSO. The new delete callback
replaces the per-CSO callbacks.

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

3 years agost/mesa: don't make a local copy of blend color
Marek Olšák [Thu, 3 Dec 2020 18:47:19 +0000 (13:47 -0500)]
st/mesa: don't make a local copy of blend color

This is perfectly safe and nothing bad can happen... and we have also CI.

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

3 years agocso: don't pass blend_color through cso_context
Marek Olšák [Thu, 3 Dec 2020 18:38:34 +0000 (13:38 -0500)]
cso: don't pass blend_color through cso_context

It's never saved or restored. Redundant state changes are already
filtered out by mesa/main.

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

3 years agogallium: inline pipe_depth_state to decrease DSA state size by 4 bytes
Marek Olšák [Fri, 4 Dec 2020 13:37:14 +0000 (08:37 -0500)]
gallium: inline pipe_depth_state to decrease DSA state size by 4 bytes

Depth and alpha states are now packed together, interleaved somewhat.

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

3 years agogallium: inline pipe_alpha_state to enable better DSA bitfield packing
Marek Olšák [Fri, 4 Dec 2020 13:19:57 +0000 (08:19 -0500)]
gallium: inline pipe_alpha_state to enable better DSA bitfield packing

pipe_alpha_state and pipe_depth_state will be packed together
because they have only a few bitfields each. This will eventually
remove 4 bytes of padding in pipe_depth_stencil_alpha_state.

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

3 years agogallium: pass pipe_stencil_ref by value (it has only 2 bytes)
Marek Olšák [Thu, 3 Dec 2020 16:36:53 +0000 (11:36 -0500)]
gallium: pass pipe_stencil_ref by value (it has only 2 bytes)

This changes pipe_context::set_stencil_ref to pass the parameter by value.

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

3 years agoradv: enable VK_EXT_line_rasterization on GFX9
Samuel Pitoiset [Mon, 21 Dec 2020 21:35:40 +0000 (22:35 +0100)]
radv: enable VK_EXT_line_rasterization on GFX9

It was disabled because some CTS failed but they pass now.

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

3 years agoturnip: use ir3_compiler_destroy instead of ralloc_free
Hyunjun Ko [Thu, 19 Nov 2020 01:36:13 +0000 (01:36 +0000)]
turnip: use ir3_compiler_destroy instead of ralloc_free

Fixes: c0f22c3d9406ef3 "freedreno/ir3: add ir3_compiler_destroy()"

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

3 years agoturnip/kgsl: support VK_KHR_performance_query
Hyunjun Ko [Fri, 13 Nov 2020 08:53:03 +0000 (08:53 +0000)]
turnip/kgsl: support VK_KHR_performance_query

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

3 years agoturnip: enable VK_KHR_performance_query with new debug flag
Hyunjun Ko [Fri, 20 Nov 2020 05:35:19 +0000 (05:35 +0000)]
turnip: enable VK_KHR_performance_query with new debug flag

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

3 years agoturnip: support multipass for performance query.
Hyunjun Ko [Fri, 20 Nov 2020 05:33:50 +0000 (05:33 +0000)]
turnip: support multipass for performance query.

To support multipass, querying perf counters happens in several steps
below.

0) There's a scratch reg to set pass indices for perf counters query.
   Prepare cmd streams to set each pass index to the reg at device
   creation time. See tu_CreateDevice in tu_device.c
1) Emit command streams to read all requested perf counters at all
   passes in begin/end query with CP_REG_TEST/CP_COND_REG_EXEC, which
   reads the scratch reg where pass index is set.
2) Pick the right cs setting proper pass index to the reg and prepend it
   to the command buffer at each submit time.
3) If the pass index in the reg is true, then executes the command
   stream below CP_COND_REG_EXEC.

Would need to implement for kgsl in the future.

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

3 years agoturnip: Implement VK_KHR_performance_query
Hyunjun Ko [Fri, 20 Nov 2020 05:32:27 +0000 (05:32 +0000)]
turnip: Implement VK_KHR_performance_query

There are still some commands unimplemented yet.

- vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR:
  The following patch supports this.

- vkAcquireProfilingLockKHR / vkReleaseProfilingLock
  This patch supports only monitoring perf counters for each submit.
  To reserve/configure counters across submits we would need a kernel
  interface to be able to do that.

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

3 years agopanfrost: Fix panfrost_small_padded_vertex_count for 17 vertices
Icecream95 [Tue, 22 Dec 2020 00:02:34 +0000 (13:02 +1300)]
panfrost: Fix panfrost_small_padded_vertex_count for 17 vertices

All odd numbers above 10 need to be rounded up to an even number, so
add one and mask off the least significant bit instead of maintaining
a list of special cases.

Fixes crashes in SuperTuxKart.

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

3 years agopanfrost: Expose ARB_texture_filter_anisotropic on supported GPUs
Icecream95 [Sun, 20 Dec 2020 04:11:42 +0000 (17:11 +1300)]
panfrost: Expose ARB_texture_filter_anisotropic on supported GPUs

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

3 years agopanfrost: Add a gpu_revision argument to panfrost_get_quirks
Icecream95 [Sun, 20 Dec 2020 04:01:59 +0000 (17:01 +1300)]
panfrost: Add a gpu_revision argument to panfrost_get_quirks

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

3 years agopanfrost: Set the anisotropy level when cso->max_anisotropy is set
Icecream95 [Wed, 16 Dec 2020 10:57:20 +0000 (23:57 +1300)]
panfrost: Set the anisotropy level when cso->max_anisotropy is set

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

3 years agopanfrost: Fix the Maximum anisotropy field in the XML
Icecream95 [Wed, 16 Dec 2020 10:50:33 +0000 (23:50 +1300)]
panfrost: Fix the Maximum anisotropy field in the XML

It needs a a minus(1) modifier.

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

3 years agopanfrost: Fix LOD mode field on Bifrost
Alyssa Rosenzweig [Sat, 19 Dec 2020 14:37:37 +0000 (09:37 -0500)]
panfrost: Fix LOD mode field on Bifrost

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

3 years agopan/bi: Minor styling cleanup in disasm
Alyssa Rosenzweig [Wed, 16 Dec 2020 20:15:17 +0000 (15:15 -0500)]
pan/bi: Minor styling cleanup in disasm

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

3 years agopan/bi: Remove all-0's termination condition
Alyssa Rosenzweig [Wed, 16 Dec 2020 20:14:14 +0000 (15:14 -0500)]
pan/bi: Remove all-0's termination condition

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

3 years agopan/bi: Space out disassembly
Alyssa Rosenzweig [Wed, 16 Dec 2020 20:06:56 +0000 (15:06 -0500)]
pan/bi: Space out disassembly

Makes things much more legible with some "room to breathe".

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

3 years agopan/bi: Allow toggling disassembly verbosity
Alyssa Rosenzweig [Wed, 16 Dec 2020 20:02:26 +0000 (15:02 -0500)]
pan/bi: Allow toggling disassembly verbosity

Verbose mode is especially useful for debugging packing, but otherwise
just gets in the way I find.

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

3 years agointel/fs: don't spill a register, set by undef
Yevhenii Kolesnikov [Wed, 9 Dec 2020 19:16:37 +0000 (21:16 +0200)]
intel/fs: don't spill a register, set by undef

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3941
Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8185>

3 years agolvp: Fix vtn warnings about unsupported image read/write without format.
Eric Anholt [Mon, 21 Dec 2020 19:08:11 +0000 (11:08 -0800)]
lvp: Fix vtn warnings about unsupported image read/write without format.

These are just warnings printed to the console and don't affect testcase
pass/fail, but clog up the deqp-runner job logs.

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

3 years agoci/deqp: Make sure that we pull in all board-specific xfail/skip/flake files.
Eric Anholt [Thu, 17 Dec 2020 19:08:42 +0000 (11:08 -0800)]
ci/deqp: Make sure that we pull in all board-specific xfail/skip/flake files.

When introducing/removing these files, it's easy to forget to update the
yml to point to them.  Instead of requiring the separate update, just have
the runner script pick the right one from a single per-gpu variable.

As a result, we now pick up the new deqp-lvp-skips.txt that was added but
not conected.  This also required moving some bypass flakes from the
shared a630 flakes list to a separate list, which is a feature because now
we'd notice the introduction of flakes to the gmem path.

Fixes: ab79e6b8e336 ("ci: skip failing test on lavapipe")
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8147>

3 years agoradv: Enable DCC in the GENERAL layout on GFX10+.
Bas Nieuwenhuizen [Thu, 17 Sep 2020 18:18:42 +0000 (20:18 +0200)]
radv: Enable DCC in the GENERAL layout on GFX10+.

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

3 years agoradv: Disable DCC explicitly for incompatible copies.
Bas Nieuwenhuizen [Thu, 17 Sep 2020 18:02:11 +0000 (20:02 +0200)]
radv: Disable DCC explicitly for incompatible copies.

If we enable DCC for GENERAL we cannot set the layout to GENERAL to
disable DCC, so do it explicitly.

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

3 years agoradv: Add option to disable DCC in renderpasses without layout.
Bas Nieuwenhuizen [Thu, 17 Sep 2020 17:58:18 +0000 (19:58 +0200)]
radv: Add option to disable DCC in renderpasses without layout.

If DCC is enabled for GENERAL then we cannot disable DCC by going
to the GENERAL layout.

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

3 years agoradv: Never allow fast clears on DCC images that are not compressed.
Bas Nieuwenhuizen [Fri, 18 Sep 2020 23:52:32 +0000 (01:52 +0200)]
radv: Never allow fast clears on DCC images that are not compressed.

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

3 years agoradv: Don't skip layout transitions that only differ in render loop.
Bas Nieuwenhuizen [Sun, 20 Sep 2020 00:23:11 +0000 (02:23 +0200)]
radv: Don't skip layout transitions that only differ in render loop.

This can result in meaningful compression changes so we shouldn't skip.

Fixes: 66131ceb8bc "radv: Pass through render loop detection to internal layout decisions."
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7004>

3 years agoradv: ignore the mutable bit for TC-compatible HTILE
Samuel Pitoiset [Mon, 21 Dec 2020 16:50:04 +0000 (17:50 +0100)]
radv: ignore the mutable bit for TC-compatible HTILE

All depth/stencil formats are incompatible each others, so the
mutable bit and the image format list can be ignored.

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

3 years agoglsl: remove unused state variable
cheyang [Sun, 20 Dec 2020 13:00:46 +0000 (21:00 +0800)]
glsl: remove unused state variable

Because compile_shader function state variable
not determine whether the compilation is successful.

Signed-off-by: cheyang <cheyang@bytedance.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8178>

3 years agofreedreno/a6xx: bump varyings limit
Danylo Piliaiev [Wed, 2 Dec 2020 14:10:53 +0000 (16:10 +0200)]
freedreno/a6xx: bump varyings limit

GL_MAX_VARYING_COMPONENTS is bumped to 124 since it should
not include the components of gl_Position. (Same as in blob)

GL_MAX_*_OUTPUT_COMPONENTS is bumped to 128, only
GL_MAX_GEOMETRY_INPUT_COMPONENTS is 64. (Same as in blob)

Per GL 3.2 spec the minimum of:
 - GL_MAX_GEOMETRY_OUTPUT_COMPONENTS is 128
 - GL_MAX_FRAGMENT_INPUT_COMPONENTS is 128
 - others is 64

Per ARB_tessellation_shader the minimum of:
 - GL_MAX_TESS_CONTROL_*_COMPONENTS to be 128
 - GL_MAX_TESS_EVALUATION_*_COMPONENTS to be 128

Allows passing of:
 gl-3.2-minmax
 arb_tessellation_shader-minmax

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

3 years agofreedreno/a6xx: Fix SP_HS_UNKNOWN_A831 value and document it
Danylo Piliaiev [Mon, 14 Dec 2020 16:42:59 +0000 (18:42 +0200)]
freedreno/a6xx: Fix SP_HS_UNKNOWN_A831 value and document it

It appears that storage for varyings in a wave has an upper
limit of wavesize * max_a831 where max_a831 is 64.
Exceeding the limit seam to force gpu to reduce primitives
processed per wave, at least calculations make sense with
such interpretation.

With blob SP_HS_UNKNOWN_A831 never exceeds 64 and setting
it to 65 in freedreno leads to a hang.

On A630 tests (patch_size=3 + gl_Position + array of vec4)
have shown such relation:

| Num of vec4 | A831 | PC_HS_INPUT_SIZE |
|-------------|------|------------------|
| 1           | 0x10 | 0xc              |
| 2           | 0x14 | 0xf              |
| 3           | 0x18 | 0x12             |
| 4           | 0x1c | 0x15             |
| 5           | 0x20 | 0x18             |
| 6           | 0x24 | 0x1b             |
| 7           | 0x28 | 0x1e             |
| 8           | 0x2c | 0x21             |
| 9           | 0x30 | 0x24             |
| 10          | 0x34 | 0x27             |
| 11          | 0x38 | 0x2a             |
| 12          | 0x3c | 0x2d             |
| 13          | 0x3f | 0x30             |
| 14          | 0x40 | 0x33             |
| 15          | 0x3d | 0x36             |
| 16          | 0x3d | 0x39             |
| 17          | 0x40 | 0x3c             |
| 18          | 0x3f | 0x3f             |
| 19          | 0x3e | 0x42             |
| 20          | 0x3d | 0x45             |
| 21          | 0x3f | 0x48             |
| 22          | 0x3d | 0x4b             |
| 23          | 0x40 | 0x4e             |
| 24          | 0x3d | 0x51             |
| 25          | 0x3f | 0x54             |
| 26          | 0x3c | 0x57             |
| 27          | 0x3e | 0x5a             |
| 28          | 0x40 | 0x5d             |
| 29          | 0x3c | 0x60             |
| 30          | 0x3e | 0x63             |
| 31          | 0x40 | 0x66             |
|-------------|------|------------------|

Brief tests with high patch sizes also confirm that formula
matches blob behaviour.

A831 is not a limit for storage available for one thread, so
naming it as SP_HS_WAVE_INPUT_SIZE would make more sense.

Fixes: 47e2c195 "freedreno/a6xx: Program state for tessellation stages"

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

3 years agoir3: Allow tesselation to use all 32 varying slots
Danylo Piliaiev [Thu, 10 Dec 2020 17:18:18 +0000 (19:18 +0200)]
ir3: Allow tesselation to use all 32 varying slots

POS, PSIZE, CLIP_DIST0, and CLIP_DIST1 have their own predefined
indices, map's size should take this into account.

Fixes: 9e063b01 "ir3: Switch tess lowering to use location"

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

3 years agofreedreno/a6xx: Fix assert which checks the count of shader outputs
Danylo Piliaiev [Mon, 7 Dec 2020 13:56:03 +0000 (15:56 +0200)]
freedreno/a6xx: Fix assert which checks the count of shader outputs

The actual max count is 32 which corresponds to 128 output components.

Fixes: 2251a434 "freedreno/a6xx: Write multiple regs for SP_VS_OUT_REG and SP_VS_VPC_DST_REG"

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

3 years agomesa: fix layered framebuffer attachment target check
Tapani Pälli [Tue, 15 Dec 2020 11:15:29 +0000 (13:15 +0200)]
mesa: fix layered framebuffer attachment target check

Current code was making the layer target checking for depth and stencil
attachments as well while the check in spec is specified only for color.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3980
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8102>

3 years agolavapipe: add transform feedback support
Dave Airlie [Tue, 8 Dec 2020 04:48:44 +0000 (14:48 +1000)]
lavapipe: add transform feedback support

This adds support for EXT_transform_feedback which can be used by
zink to enable more CI

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7981>

3 years agollvmpipe: handle SO statistics multi value query copy. (v2)
Dave Airlie [Thu, 17 Dec 2020 22:29:12 +0000 (08:29 +1000)]
llvmpipe: handle SO statistics multi value query copy. (v2)

This is hard to abstract using the vulkan interface, so just
add support for copying both values in the llvmpipe backend
for the lavapipe frontend.

v2: use a loop

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7981>

3 years agollvmpipe: add support for vulkan streamout offset hook
Dave Airlie [Tue, 8 Dec 2020 05:06:48 +0000 (15:06 +1000)]
llvmpipe: add support for vulkan streamout offset hook

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7981>

3 years agogallium: add an api to retrieve pipe offsets
Dave Airlie [Tue, 8 Dec 2020 05:06:17 +0000 (15:06 +1000)]
gallium: add an api to retrieve pipe offsets

This is needed to implement the vulkan transform feedback pause
resume functionality

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7981>

3 years agod3d12: Fix memory leak if create_root_signature failed.
Vinson Lee [Fri, 18 Dec 2020 22:36:54 +0000 (14:36 -0800)]
d3d12: Fix memory leak if create_root_signature failed.

Fix defect reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable data going out of scope leaks the storage it points to.

Fixes: 2ea15cd661c ("d3d12: introduce d3d12 gallium driver")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8170>

3 years agod3d12: Fix memory leak if create_gfx_pipeline_state failed.
Vinson Lee [Fri, 18 Dec 2020 01:29:13 +0000 (17:29 -0800)]
d3d12: Fix memory leak if create_gfx_pipeline_state failed.

Fix defect reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable data going out of scope leaks the storage it points to.

Fixes: 2ea15cd661c ("d3d12: introduce d3d12 gallium driver")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8150>

3 years agopanfrost: Fix CLAMP wrap mode
Icecream95 [Sat, 19 Dec 2020 11:21:58 +0000 (00:21 +1300)]
panfrost: Fix CLAMP wrap mode

MALI_WRAP_MODE_CLAMP doesn't work fully on either GPU generation, so
use other wrap modes instead in some cases.

With nearest filtering, Midgard only clamps to the edge for two of the
edges, and uses the border colour for the other two. Using the clamp
mode on Bifrost causes broken rendering and/or GPU faults.

Fixes piglit test "texwrap" on both Midgard and Bifrost, and fixes
Chromium B.S.U. rendering on Bifrost.

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

3 years agopanfrost: Fix precise occlusion queries on Bifrost
Icecream95 [Sat, 19 Dec 2020 03:23:16 +0000 (16:23 +1300)]
panfrost: Fix precise occlusion queries on Bifrost

Bifrost doesn't need the sample count to be divided by four for
non-MSAA framebuffers.

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

3 years agodocs/panfrost: Mention the IRC channel
Alyssa Rosenzweig [Fri, 18 Dec 2020 00:36:20 +0000 (19:36 -0500)]
docs/panfrost: Mention the IRC channel

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Suggested-by: Icecream95 <ixn@disroot.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8148>

3 years agodocs/panfrost: Document building Panfrost
Alyssa Rosenzweig [Fri, 18 Dec 2020 00:14:24 +0000 (19:14 -0500)]
docs/panfrost: Document building Panfrost

Pretty similar to anything else in Mesa, although kmsro is required and
LLVM is not.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8148>

3 years agodocs/systems: Update Panfrost link
Alyssa Rosenzweig [Fri, 18 Dec 2020 00:05:24 +0000 (19:05 -0500)]
docs/systems: Update Panfrost link

There's not much on the standalone site anymore (it dates back from
before Panfrost was upstreamed), let's just keep everything in Mesa.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8148>

3 years agodocs: Update Panfrost in the source tree
Alyssa Rosenzweig [Fri, 18 Dec 2020 00:04:05 +0000 (19:04 -0500)]
docs: Update Panfrost in the source tree

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8148>

3 years agodocs/panfrost: Fix comment about Lima
Alyssa Rosenzweig [Thu, 17 Dec 2020 23:58:56 +0000 (18:58 -0500)]
docs/panfrost: Fix comment about Lima

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Suggested-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8148>

3 years agovc4: Fix typos.
Vinson Lee [Wed, 16 Dec 2020 04:03:09 +0000 (20:03 -0800)]
vc4: Fix typos.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8120>

3 years agoradv: remove useless push constants data when resolving ds attachments
Samuel Pitoiset [Wed, 16 Dec 2020 14:02:18 +0000 (15:02 +0100)]
radv: remove useless push constants data when resolving ds attachments

Depth/stencil resolves are only allowed inside a subpass, which means
the offset is always 0 and the draw/dispatch covers the whole image.

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

3 years agospirv: Remove more dead variables
Caio Marcelo de Oliveira Filho [Wed, 16 Dec 2020 22:31:32 +0000 (14:31 -0800)]
spirv: Remove more dead variables

SPIR-V modules can have multiple shaders (including of the same
stage), but the global variables are all declared for the whole
module.  This can result in variables with same Binding but
incompatible types, so those need to be removed before we use.

Previously, a similar issue but with a narrower scope was fixed by
6775665e5ee ("spirv: Eliminate dead input/output variables after
translation.").

This patch depends on the previous patch that prevents variables used
only in pointer initializers to be considered dead.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3686
Fixes: 3a266a18 ("nir/spirv: Add support for declaring variables")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8133>

3 years agonir: Consider pointer initializers in nir_remove_dead_variables
Caio Marcelo de Oliveira Filho [Wed, 16 Dec 2020 07:25:51 +0000 (23:25 -0800)]
nir: Consider pointer initializers in nir_remove_dead_variables

Between the creation of a shader (from GLSL or SPIRV frontends) and
nir_lower_variable_initializers is called, variables may refer to
other variables for initialization.  Those referred variables need to
be kept alive, so consider that in the pass.

Fixes: 7acc81056f7 ("compiler/nir: Add support for variable initialization from a pointer")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8133>

3 years agonir: Remove unused parameter in remove_dead_var_writes
Caio Marcelo de Oliveira Filho [Wed, 16 Dec 2020 06:58:58 +0000 (22:58 -0800)]
nir: Remove unused parameter in remove_dead_var_writes

And destroy the live set earlier in nir_remove_dead_variables.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8133>

3 years agonir: Fix outdated name in comment
Caio Marcelo de Oliveira Filho [Wed, 16 Dec 2020 22:07:57 +0000 (14:07 -0800)]
nir: Fix outdated name in comment

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8133>

3 years agospirv: Implement OpArrayLength for OpenGL
Caio Marcelo de Oliveira Filho [Thu, 17 Dec 2020 04:51:30 +0000 (20:51 -0800)]
spirv: Implement OpArrayLength for OpenGL

Uses same NIR intrinsic as glsl_to_nir.  Make it an option so it is
easy later to move Vulkan drivers incrementally to use it.

Fixes piglit test spec/arb_gl_spirv/execution/ssbo/unsized-array-length.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3691
Fixes: 15e43907 ("iris: Enable ARB_gl_spirv and ARB_spirv_extensions")
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8136>

3 years agozink: fix gl_SampleMaskIn handling
Mike Blumenkrantz [Fri, 7 Aug 2020 20:19:58 +0000 (16:19 -0400)]
zink: fix gl_SampleMaskIn handling

this is an array[1], so we need to do some extra legwork here even though
probably it'd work fine even without it

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

3 years agozink: fix rp hash table
Mike Blumenkrantz [Wed, 9 Dec 2020 20:26:30 +0000 (15:26 -0500)]
zink: fix rp hash table

hash table keys for inserted items have to be valid memory ranges for the
lifetime of the corresponding entry, so using a stack-allocated key like this
is broken and doesn't accurately return the correct renderpass

Fixes a872f4636924: ("zink: cache render-passes")

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