platform/upstream/mesa.git
20 months agofrontends/va: Add windows VA frontend support via vl_winsys_win32 and libva-win32
Sil Vilerino [Wed, 7 Sep 2022 17:42:04 +0000 (13:42 -0400)]
frontends/va: Add windows VA frontend support via vl_winsys_win32 and libva-win32

Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19063>

20 months agogallium/vl: Add vl_winsys_win32 support
Sil Vilerino [Wed, 7 Sep 2022 17:40:44 +0000 (13:40 -0400)]
gallium/vl: Add vl_winsys_win32 support

Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19063>

20 months agohasvk: use DX rules for point rasterization
Iván Briano [Wed, 5 Oct 2022 03:02:25 +0000 (20:02 -0700)]
hasvk: use DX rules for point rasterization

It seems that's what the reference renderer in the CTS expects for
Vulkan. This mostly matters if the edges of a point primitive fall
exactly on a pixel sampling point.

Fixes some upcoming tests under
dEQP-VK.pipeline.monolithic.depth.format.*.point_list*

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

20 months agoanv: use DX rules for point rasterization
Iván Briano [Wed, 5 Oct 2022 03:02:25 +0000 (20:02 -0700)]
anv: use DX rules for point rasterization

It seems that's what the reference renderer in the CTS expects for
Vulkan. This mostly matters if the edges of a point primitive fall
exactly on a pixel sampling point.

Fixes some upcoming tests under
dEQP-VK.pipeline.monolithic.depth.format.*.point_list*

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

21 months agoanv: compile_upload_rt_shader expects a valid pointer
Iván Briano [Tue, 18 Oct 2022 00:40:36 +0000 (17:40 -0700)]
anv: compile_upload_rt_shader expects a valid pointer

Fixes crashes on almost every CTS test that uses raytracing pipelines.

Fixes: ff91c5ca42b ("anv: add analysis for push descriptor uses and store it in shader cache")

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

21 months agoutil: Move the implementation of futex_wake and futex_wait from futex.h to futex.c
Yonggang Luo [Sat, 3 Sep 2022 08:58:05 +0000 (16:58 +0800)]
util: Move the implementation of futex_wake and futex_wait from futex.h to futex.c

Doing this is to avoid include bloat on Windows that pulls windows.h,
for other unix platforms, it's also benefit include the used symbols only when use
futex_wake and futex_wait.
No functional change, there is no performance incur because function call is consume
much less time than syscall

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19120>

21 months agofreedreno: Fix fence unref race
Rob Clark [Fri, 14 Oct 2022 18:32:01 +0000 (11:32 -0700)]
freedreno: Fix fence unref race

Destroying a fence that was never flushed could race with the submit
queue, which could cause either an fd leak or closing an fd that the
retire queue would want to use.

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

21 months agoradeonsi: fix max_dw computation for CS preambles
Marek Olšák [Mon, 10 Oct 2022 21:18:52 +0000 (17:18 -0400)]
radeonsi: fix max_dw computation for CS preambles

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

21 months agowinsys/amdgpu: fix (enable) preemption for chained IBs
Marek Olšák [Wed, 28 Sep 2022 10:24:49 +0000 (06:24 -0400)]
winsys/amdgpu: fix (enable) preemption for chained IBs

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

21 months agoradeonsi: rename si_create_multi_fence -> si_alloc_fence
Marek Olšák [Wed, 21 Sep 2022 20:14:32 +0000 (16:14 -0400)]
radeonsi: rename si_create_multi_fence -> si_alloc_fence

We no longer have any multi fences (gfx+sdma fence).

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

21 months agov3dv: drop error overwrite
Eric Engestrom [Fri, 30 Sep 2022 13:35:55 +0000 (14:35 +0100)]
v3dv: drop error overwrite

Let the error returned be bubbled up.

Fixes: dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
Fixes: 591103d04d5f18ae30c7 ("v3dv: don't return incompatible driver if GPU is not present")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18901>

21 months agoasahi: Lower point sprites in driver
Alyssa Rosenzweig [Tue, 18 Oct 2022 17:45:36 +0000 (13:45 -0400)]
asahi: Lower point sprites in driver

mesa/st can't save us now!

Fixes: 310959d9fe1 ("mesa/st: rip out point-sprite cap")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18651>

21 months agou_transfer_helper: Handle Z24S8 with z24_in_z32f but no interleaving
Alyssa Rosenzweig [Sun, 18 Sep 2022 14:54:29 +0000 (10:54 -0400)]
u_transfer_helper: Handle Z24S8 with z24_in_z32f but no interleaving

First, the separate Z/S condition kicks in, splitting up Z24S8 into
Z24X8 + S8. But then the driver is asked to create a Z24X8 resource,
which it may not be able to do. We need to further lower at create
time to Z32F + S8, so the driver is only asked to create supported
formats. We can do this with an extra condition at create time.

The alternate approach would be recursing into
transfer_helper_resource_create, but this seemed more obvious.

Fixes assertion failure running neverball on Asahi.

Assertion failed: (templ->format != PIPE_FORMAT_Z24X8_UNORM &&
      templ->format != PIPE_FORMAT_Z24_UNORM_S8_UINT &&
      "u_transfer_helper should have lowered"), function
agx_resource_create, file agx_pipe.c, line 174.

Fixes: 45a37ace287 ("u_transfer_helper: Handle Z24X8 for drivers that don't use the interleaved transfer_map")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18651>

21 months agonir/lower_io: Set interpolated_input dest_type
Alyssa Rosenzweig [Sat, 15 Oct 2022 01:27:21 +0000 (21:27 -0400)]
nir/lower_io: Set interpolated_input dest_type

...even for non-pixel interpolation, for consistency. Otherwise backends get
funny intrinsics with interpolateAt:

   vec4 32 ssa_4 = intrinsic load_interpolated_input (ssa_3, ssa_2) (base=1, component=0, dest_type=invalid /*0*/, io location=33 slots=1 /*161*/)

We know it'll be a float, but backends shouldn't need to special case this. (Or
maybe interpolated_input shouldn't have a dest_type index. I'd be ok with that
resolution too. But having one and not setting it consistently is wrong.)

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19085>

21 months agomesa: Fix multiple matrix pops in a row
Alyssa Rosenzweig [Sat, 15 Oct 2022 18:42:49 +0000 (14:42 -0400)]
mesa: Fix multiple matrix pops in a row

When we pop a matrix, we update stack->Top, which means that stack->Top has
changed since last push. We cannot skip subsequent pops or we'll get an
incorrect matrix.

Fixes Neverball rendering. When collecting a coin in game, the
point-sprite stars popping out of the coin are in the wrong places
due to an incorrect transformation matrix.

Close: #7502
Fixes: e6ecd22140f ("mesa: make glPopMatrix a no-op if the matrix hasn't changed")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19090>

21 months agotu: Optimize hash_renderpass_instance by removing XXH64_update
Mark Collins [Tue, 6 Sep 2022 05:55:04 +0000 (05:55 +0000)]
tu: Optimize hash_renderpass_instance by removing XXH64_update

It was determined through testing that `XXH64_update` is
significantly slower than calling `XXH64` directly as far as small
data velocity is concerned. This function is called on every RP end
which made it visible while profiling but substantial difference
(measured to be ~4x) made it not show up whatsoever.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18428>

21 months agoanv: fill AlphaToCoverageEnable lazily from state
Tapani Pälli [Mon, 17 Oct 2022 07:54:03 +0000 (10:54 +0300)]
anv: fill AlphaToCoverageEnable lazily from state

Now the first blend state is filled only when emitted.

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

21 months agoanv: move emit_shading_rate to gfx8_cmd_buffer
Tapani Pälli [Mon, 17 Oct 2022 07:47:43 +0000 (10:47 +0300)]
anv: move emit_shading_rate to gfx8_cmd_buffer

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

21 months agod3d10ump: No need define snprintf anymore in InputAssembly.cpp
Yonggang Luo [Mon, 19 Sep 2022 19:34:25 +0000 (03:34 +0800)]
d3d10ump: No need define snprintf anymore in InputAssembly.cpp

As minimal visual studio version are 2019

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18685>

21 months agonir: No need redefine snprintf anymore in nir.h
Yonggang Luo [Mon, 19 Sep 2022 19:33:44 +0000 (03:33 +0800)]
nir: No need redefine snprintf anymore in nir.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18685>

21 months agogallium: delete graw
Yonggang Luo [Sun, 16 Oct 2022 19:58:49 +0000 (03:58 +0800)]
gallium: delete graw

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

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19099>

21 months agoglsl/glsl_to_nir: remove unreachable code
Timothy Arceri [Mon, 17 Oct 2022 02:28:19 +0000 (13:28 +1100)]
glsl/glsl_to_nir: remove unreachable code

This hack in glsl_to_nir() to clean up after the glsl ir linker should
no longer be reachable. These type of linking opts are now done via
a nir based linker long after GLSL IR has been coverted to nir by
this pass.

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

21 months agoradv: fix setting results for initialization failures in thread trace and trap handler
Sergei Chernyadyev [Mon, 17 Oct 2022 17:29:39 +0000 (20:29 +0300)]
radv: fix setting results for initialization failures in thread trace and trap handler

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

21 months agoradeonsi: Inherit the old modifier when reallocating the texture.
nyanmisaka [Mon, 17 Oct 2022 14:51:37 +0000 (22:51 +0800)]
radeonsi: Inherit the old modifier when reallocating the texture.

Otherwise the reallocated texture has an invalid modifier when exporting
the VAAPI surface handle.

Signed-off-by: nyanmisaka <nst799610810@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19097>

21 months agoanv: fix FTBFS on grl due to changes in clang 15
Luis Felipe Strano Moraes [Sun, 16 Oct 2022 20:50:24 +0000 (13:50 -0700)]
anv: fix FTBFS on grl due to changes in clang 15

This was causing build failures when RT is enabled on recent Fedora releases.

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

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

21 months agonir: Usher nir_normalize_cubemap_coords into 2022
Alyssa Rosenzweig [Thu, 22 Sep 2022 14:22:03 +0000 (10:22 -0400)]
nir: Usher nir_normalize_cubemap_coords into 2022

I stumbled upon this old NIR pass (still in use by intel and broadcom)
and noticed how most of the code was NIR boilerplate that we have
helpers for. Rewrite the pass to use all the helpers.

v2: Fix cube map arrays.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18754>

21 months agonir: Fix nir_fmax_abs_vec_comp
Alyssa Rosenzweig [Thu, 13 Oct 2022 21:18:09 +0000 (17:18 -0400)]
nir: Fix nir_fmax_abs_vec_comp

This failed to take fabs of the first component, implementing an unintended
formula that would return the right results in some common cases but is wrong in
general:

   max { x, |y|, |z| }

instead of the intended

   max { |x|, |y|, |z| }

Reexpress the implementation to make correctness obvious.

Fixes: 272e927d0e9 ("nir/spirv: initial handling of OpenCL.std extension opcodes")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18754>

21 months agod3d12: HEVC Set D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_USE_ASYMETRIC_MOTIO...
Sil Vilerino [Mon, 17 Oct 2022 12:27:28 +0000 (08:27 -0400)]
d3d12: HEVC Set D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_USE_ASYMETRIC_MOTION_PARTITION when required by caps

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19119>

21 months agod3d12: Fix HEVC wrong caps detection due to bad parenthesis in condition
Sil Vilerino [Mon, 17 Oct 2022 12:15:51 +0000 (08:15 -0400)]
d3d12: Fix HEVC wrong caps detection due to bad parenthesis in condition

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19119>

21 months agod3d12: HEVC Encode workaround for edge case in caps reporting not contemplated by...
Sil Vilerino [Fri, 14 Oct 2022 12:22:52 +0000 (08:22 -0400)]
d3d12: HEVC Encode workaround for edge case in caps reporting not contemplated by upper layer interface

Workaround for https://github.com/intel/libva/issues/641

Example where VAConfigAttribValEncHEVCBlockSizes.max_transform_hierarchy_depth_intra/inter overflows

MinCbLog2SizeY = log2(8) = 3
CtbLog2SizeY = log2(64) = 6
MinTbLog2SizeY = log2(4) = 2
MaxTbLog2SizeY = log2(32) = 5

max_transform_hierarchy_depth_intra = (CtbLog2SizeY − MinTbLog2SizeY) = 4
max_transform_hierarchy_depth_inter = (CtbLog2SizeY − MinTbLog2SizeY) = 4

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19119>

21 months agotu: Fix the size of patch control points state
Danylo Piliaiev [Fri, 14 Oct 2022 14:00:17 +0000 (16:00 +0200)]
tu: Fix the size of patch control points state

tu6_emit_patch_control_points was called with CS size calculated
at compile time, but HS params have dynamic size. Account for this.

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

Fixes: 68f3c38c8011e3ff304a67b6ffb33fd21ee65b0c
("tu: Implement extendedDynamicState2PatchControlPoints")

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

21 months agoaco/spill: Fix spilling of Phi operands
Daniel Schürmann [Mon, 17 Oct 2022 09:40:40 +0000 (11:40 +0200)]
aco/spill: Fix spilling of Phi operands

By adding the renamed variable, phi operands got spilled twice at the precessors.

Fixes: dEQP-VK.ray_query.misc.dynamic_indexing
Closes: #7493
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19109>

21 months agopan/mdg: Fix 16-bit alignment with spiller
Alyssa Rosenzweig [Sun, 16 Oct 2022 01:32:11 +0000 (21:32 -0400)]
pan/mdg: Fix 16-bit alignment with spiller

The loop over sources has to happen for every instruction, regardless of whether
we also need to register allocate the destination. The other source loops handle
this properly, but this one was missed.

Fixes spilling failure in shaders/android/angle/aztec_ruins/16.shader_test when
the input NIR is shuffled a bit (from reordering passes).

Fixes: 129d390bd8c ("pan/mdg: Fix bound setting in RA for sources")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19093>

21 months agopan/mdg: Limit work registers for large workgroups
Alyssa Rosenzweig [Sat, 15 Oct 2022 23:01:47 +0000 (19:01 -0400)]
pan/mdg: Limit work registers for large workgroups

When more than 8 registers are used, Midgard can only fit 64 threads in a
thread group. For barriers to work properly, a threadgroup must fit an entire
work group. The GL driver configures the hardware to have threadgroups the size
of work groups. That means if more than 64 threads are used in a workgroup, and
more than 8 registers are used, the hardware will fault spawning threads.

To workaround this hardware limitation, we need to limit the number of work
registers used depending on the size of the workgroup. Typically, the work group
size is known at compile-time so that determination can usually be made without
variants. To avoid variants, we make a pessimistic estimate in the case when
it's not known at compile-time.

shader-db shows 6 shaders affected. I expect that all of these would fault with
DATA_INVALID_FAULT if they tried to execute before this patch, due to the
oversize local size, and faulting is even slower than spilling ;-)

Fixes dEQP-GLES31.functional.synchronization.* on Mali-T860.

instructions HURT:   shaders/android/gfxbench/carchase/6.shader_test MESA_SHADER_COMPUTE: 121 -> 157 (29.75%)
instructions HURT:   shaders/android/gfxbench/carchase/386.shader_test MESA_SHADER_COMPUTE: 121 -> 157 (29.75%)
instructions HURT:   shaders/android/gfxbench/carchase/374.shader_test MESA_SHADER_COMPUTE: 141 -> 184 (30.50%)
instructions HURT:   shaders/android/gfxbench/carchase/4-1.shader_test MESA_SHADER_COMPUTE: 141 -> 184 (30.50%)
instructions HURT:   shaders/android/com.miHoYo.GenshinImpact/18.shader_test MESA_SHADER_COMPUTE: 513 -> 933 (81.87%)
instructions HURT:   shaders/android/com.miHoYo.GenshinImpact/16.shader_test MESA_SHADER_COMPUTE: 505 -> 1002 (98.42%)

bundles HURT:   shaders/android/gfxbench/carchase/374.shader_test MESA_SHADER_COMPUTE: 73 -> 116 (58.90%)
bundles HURT:   shaders/android/gfxbench/carchase/4-1.shader_test MESA_SHADER_COMPUTE: 73 -> 116 (58.90%)
bundles HURT:   shaders/android/gfxbench/carchase/6.shader_test MESA_SHADER_COMPUTE: 61 -> 97 (59.02%)
bundles HURT:   shaders/android/gfxbench/carchase/386.shader_test MESA_SHADER_COMPUTE: 61 -> 97 (59.02%)
bundles HURT:   shaders/android/com.miHoYo.GenshinImpact/18.shader_test MESA_SHADER_COMPUTE: 281 -> 701 (149.47%)
bundles HURT:   shaders/android/com.miHoYo.GenshinImpact/16.shader_test MESA_SHADER_COMPUTE: 278 -> 775 (178.78%)

registers helped:   shaders/android/gfxbench/carchase/374.shader_test MESA_SHADER_COMPUTE: 11 -> 8 (-27.27%)
registers helped:   shaders/android/gfxbench/carchase/4-1.shader_test MESA_SHADER_COMPUTE: 11 -> 8 (-27.27%)
registers helped:   shaders/android/gfxbench/carchase/6.shader_test MESA_SHADER_COMPUTE: 14 -> 8 (-42.86%)
registers helped:   shaders/android/gfxbench/carchase/386.shader_test MESA_SHADER_COMPUTE: 14 -> 8 (-42.86%)
registers helped:   shaders/android/com.miHoYo.GenshinImpact/16.shader_test MESA_SHADER_COMPUTE: 16 -> 8 (-50.00%)
registers helped:   shaders/android/com.miHoYo.GenshinImpact/18.shader_test MESA_SHADER_COMPUTE: 16 -> 8 (-50.00%)

threads helped:   shaders/android/gfxbench/carchase/6.shader_test MESA_SHADER_COMPUTE: 1 -> 2 (100.00%)
threads helped:   shaders/android/gfxbench/carchase/386.shader_test MESA_SHADER_COMPUTE: 1 -> 2 (100.00%)
threads helped:   shaders/android/gfxbench/carchase/374.shader_test MESA_SHADER_COMPUTE: 1 -> 2 (100.00%)
threads helped:   shaders/android/gfxbench/carchase/4-1.shader_test MESA_SHADER_COMPUTE: 1 -> 2 (100.00%)
threads helped:   shaders/android/com.miHoYo.GenshinImpact/16.shader_test MESA_SHADER_COMPUTE: 1 -> 2 (100.00%)
threads helped:   shaders/android/com.miHoYo.GenshinImpact/18.shader_test MESA_SHADER_COMPUTE: 1 -> 2 (100.00%)

spills HURT:   shaders/android/gfxbench/carchase/374.shader_test MESA_SHADER_COMPUTE: 0 -> 5
spills HURT:   shaders/android/gfxbench/carchase/4-1.shader_test MESA_SHADER_COMPUTE: 0 -> 5
spills HURT:   shaders/android/gfxbench/carchase/6.shader_test MESA_SHADER_COMPUTE: 0 -> 8
spills HURT:   shaders/android/gfxbench/carchase/386.shader_test MESA_SHADER_COMPUTE: 0 -> 8
spills HURT:   shaders/android/com.miHoYo.GenshinImpact/18.shader_test MESA_SHADER_COMPUTE: 0 -> 112
spills HURT:   shaders/android/com.miHoYo.GenshinImpact/16.shader_test MESA_SHADER_COMPUTE: 0 -> 146

fills HURT:   shaders/android/gfxbench/carchase/6.shader_test MESA_SHADER_COMPUTE: 0 -> 26
fills HURT:   shaders/android/gfxbench/carchase/386.shader_test MESA_SHADER_COMPUTE: 0 -> 26
fills HURT:   shaders/android/gfxbench/carchase/374.shader_test MESA_SHADER_COMPUTE: 0 -> 33
fills HURT:   shaders/android/gfxbench/carchase/4-1.shader_test MESA_SHADER_COMPUTE: 0 -> 33
fills HURT:   shaders/android/com.miHoYo.GenshinImpact/18.shader_test MESA_SHADER_COMPUTE: 0 -> 209
fills HURT:   shaders/android/com.miHoYo.GenshinImpact/16.shader_test MESA_SHADER_COMPUTE: 0 -> 234

total instructions in shared programs: 1521691 -> 1522766 (0.07%)
instructions in affected programs: 1542 -> 2617 (69.71%)
helped: 0
HURT: 6
HURT stats (abs)   min: 36.0 max: 497.0 x̄: 179.17 x̃: 43
HURT stats (rel)   min: 29.75% max: 98.42% x̄: 50.13% x̃: 30.50%
95% mean confidence interval for instructions value: -49.36 407.69
95% mean confidence interval for instructions %-change: 17.14% 83.12%
Inconclusive result (value mean confidence interval includes 0).

total bundles in shared programs: 649296 -> 650371 (0.17%)
bundles in affected programs: 827 -> 1902 (129.99%)
helped: 0
HURT: 6
HURT stats (abs)   min: 36.0 max: 497.0 x̄: 179.17 x̃: 43
HURT stats (rel)   min: 58.90% max: 178.78% x̄: 94.01% x̃: 59.02%
95% mean confidence interval for bundles value: -49.36 407.69
95% mean confidence interval for bundles %-change: 36.20% 151.83%
Inconclusive result (value mean confidence interval includes 0).

total registers in shared programs: 90681 -> 90647 (-0.04%)
registers in affected programs: 82 -> 48 (-41.46%)
helped: 6
HURT: 0
helped stats (abs) min: 3.0 max: 8.0 x̄: 5.67 x̃: 6
helped stats (rel) min: 27.27% max: 50.00% x̄: 40.04% x̃: 42.86%
95% mean confidence interval for registers value: -8.03 -3.30
95% mean confidence interval for registers %-change: -50.95% -29.13%
Registers are helped.

total threads in shared programs: 55717 -> 55723 (0.01%)
threads in affected programs: 6 -> 12 (100.00%)
helped: 6
HURT: 0
helped stats (abs) min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
helped stats (rel) min: 100.00% max: 100.00% x̄: 100.00% x̃: 100.00%
95% mean confidence interval for threads value: 1.00 1.00
95% mean confidence interval for threads %-change: 100.00% 100.00%
Threads are helped.

total spills in shared programs: 1108 -> 1392 (25.63%)
spills in affected programs: 0 -> 284
helped: 0
HURT: 6

total fills in shared programs: 4721 -> 5282 (11.88%)
fills in affected programs: 0 -> 561
helped: 0
HURT: 6

Cc: mesa-stable
Closes: #7228
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19092>

21 months agopan/mdg: Lower PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK on Midgard
Alyssa Rosenzweig [Sat, 15 Oct 2022 22:59:15 +0000 (18:59 -0400)]
pan/mdg: Lower PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK on Midgard

The register file on Midgard is not large enough to sustain 256 threads in a
threadgroup when all ISA-defined registers are used. As such, we want
to advertise the smallest MAX_THREADS_PER_BLOCK permissible by the spec to
avoid compiling shaders that will necessarily spill. The minimum-maximum in
OpenGL ES 3.1 is 128, so set that on Midgard.

6 compute shaders LOST in shader-db due to exceeding this new limit. These
shaders would fault if they were attempted to be executed.

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

21 months agopanfrost/ci: Remove stale fail
Alyssa Rosenzweig [Sat, 15 Oct 2022 20:30:25 +0000 (16:30 -0400)]
panfrost/ci: Remove stale fail

Due to fractional run. This whole section passes.

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

21 months agoanv: Enable 16 bit float ops on devices that have a LSC
Rohan Garg [Mon, 17 Oct 2022 13:54:06 +0000 (15:54 +0200)]
anv: Enable 16 bit float ops on devices that have a LSC

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

21 months agointel/compiler: Support 16 bit float ops
Rohan Garg [Mon, 17 Oct 2022 13:53:50 +0000 (15:53 +0200)]
intel/compiler: Support 16 bit float ops

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

21 months agoRevert "panfrost/ci: Disable t720 jobs"
Daniel Stone [Mon, 17 Oct 2022 11:13:47 +0000 (12:13 +0100)]
Revert "panfrost/ci: Disable t720 jobs"

This reverts commit b3a69d1c31a0c4073e7865945b9f70f96be6c34e.

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

21 months agov3dv/pipeline: keep qpu_insts around if we expect them to be used later
Alejandro Piñeiro [Fri, 30 Sep 2022 11:32:41 +0000 (13:32 +0200)]
v3dv/pipeline: keep qpu_insts around if we expect them to be used later

If the pipeline was created with the creation flags
VK_PIPELINE_CREATE_CAPTURE_STATISTICS_BIT_KHR or
VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR it is
really likely that methods from VK_KHR_pipeline_executable_properties
that would require having access to the qpu insts around will be
called.

Instead of getting those back from the BO where we upload them, we
just keep them around. This could require more host memory, but would
allow us to avoid needing to handle map/unmap the BO when needed (so
needing the host memory in any case). This can be tricky if those
methods are being called from different threads (so we can avoid
adding a mutex there).

In the same way, if the pipeline was not created with those flags, we
skip collecting data that requires the QPU. Only
GetPipelineExecutableProperties is allowed to be called without any of
those flags, and doesn't require that info.

This fixes a race condition crash at GetPipelineExecutableProperties
when using fossilize-replay with some fossils with several shaders,
and using several threads, as some thread would be unmapping the bo
before other thread stopped to use it.

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

21 months agoglthread: leave dlist dispatch in place for Begin/End
Timothy Arceri [Sat, 15 Oct 2022 10:33:14 +0000 (21:33 +1100)]
glthread: leave dlist dispatch in place for Begin/End

If Begin/End are called from a display list make sure to leave
the dlist.c's dispatch table in place just like the non-glthread
code does.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7335
Fixes: 7f1cac7ba682 ("mesa/glthread: enable immediate mode")

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

21 months agoradv: discard the PS epilog when the pipeline doesn't use a fragment shader
Samuel Pitoiset [Mon, 10 Oct 2022 13:53:43 +0000 (15:53 +0200)]
radv: discard the PS epilog when the pipeline doesn't use a fragment shader

This makes no sense and this was broken.

Fixes dEQP-VK.mesh_shader.ext.smoke.*_lib.mesh_shader_triangle_rasterization_disabled.

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/19019>

21 months agoradv: do not create a noop FS when the FS is imported from a library
Samuel Pitoiset [Mon, 10 Oct 2022 14:11:50 +0000 (16:11 +0200)]
radv: do not create a noop FS when the FS is imported from a library

The entrypoint can be NULL even if the FS is imported from a library,
but we shouldn't overwrite the pre-compiled FS by a noop.

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/19019>

21 months agoRevert "CI: Igalia farm is down"
Jose Maria Casanova Crespo [Mon, 17 Oct 2022 00:02:01 +0000 (02:02 +0200)]
Revert "CI: Igalia farm is down"

This reverts commit aa405b789ebf1797fdb3a1891fac49d0cca21c42.

Igalia farm is up again. Switch died and it needed to be replaced.

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

21 months agomesa: add EXT_debug_label support
Timothy Arceri [Wed, 5 Oct 2022 23:44:39 +0000 (10:44 +1100)]
mesa: add EXT_debug_label support

KHR_debug provides the same functionality but this extension is
still in use and adding support for it seems fairly harmless.

For example its used by Unity and without it we keep
getting given apitraces from Unity games that just spew out
unsupported function errors due to the missing support.

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

21 months agoci/windows: Getting the default supported windows version to be 7 when using mingw
Yonggang Luo [Sun, 16 Oct 2022 16:05:08 +0000 (00:05 +0800)]
ci/windows: Getting the default supported windows version to be 7 when using mingw

MSVC are already tested with default windows version 8

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19096>

21 months agoci/windows: Remove -Dlibelf:warning_level=1 as libelf subproject are already removed
Yonggang Luo [Sun, 16 Oct 2022 16:02:40 +0000 (00:02 +0800)]
ci/windows: Remove -Dlibelf:warning_level=1 as libelf subproject are already removed

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19096>

21 months agoci/windows: Enable gles1 for msvc
Yonggang Luo [Sat, 15 Oct 2022 07:30:39 +0000 (15:30 +0800)]
ci/windows: Enable gles1 for msvc

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19096>

21 months agoradv/rra: Use the accel struct type for header validation
Konstantin Seurer [Sat, 15 Oct 2022 10:02:05 +0000 (12:02 +0200)]
radv/rra: Use the accel struct type for header validation

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19089>

21 months agoradv/rra: Continue dumping accel structs if validation fails
Konstantin Seurer [Sat, 15 Oct 2022 09:53:21 +0000 (11:53 +0200)]
radv/rra: Continue dumping accel structs if validation fails

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19089>

21 months agoradv/rra: Add basic header validation
Konstantin Seurer [Sat, 15 Oct 2022 09:52:41 +0000 (11:52 +0200)]
radv/rra: Add basic header validation

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19089>

21 months agoradv/rra: Validate before gathering bvh info
Konstantin Seurer [Sat, 15 Oct 2022 08:59:20 +0000 (10:59 +0200)]
radv/rra: Validate before gathering bvh info

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19089>

21 months agoradv/rra: Fix dumps in the case of aliasing
Konstantin Seurer [Fri, 14 Oct 2022 16:50:30 +0000 (18:50 +0200)]
radv/rra: Fix dumps in the case of aliasing

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19089>

21 months agoCI: Igalia farm is down
Jose Maria Casanova Crespo [Sun, 16 Oct 2022 10:05:02 +0000 (12:05 +0200)]
CI: Igalia farm is down

It seems a power outage affected the Raspberry Pi farm nodes.

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

21 months agoutil: Turn -DWINDOWS_NO_FUTEX to be pre_args
Yonggang Luo [Sat, 15 Oct 2022 10:50:09 +0000 (18:50 +0800)]
util: Turn -DWINDOWS_NO_FUTEX to be pre_args

Turn -DWINDOWS_NO_FUTEX to be pre_args for not need add direct dependencies
to dep_futex for libraries and executables.
So only add dependencies to idep_mesautil is enough.

And this will make sure all source code are either using Windows futex,
or use mtx_t consistently across different sources, other than mixed usage of
futex and mtx_t before this commit.

If -DWINDOWS_NO_FUTEX is not globally available, that would cause
/src/util/simple_mtx.h:116: undefined reference to `futex_wait'

This error is raised when
 * compiled with -D min-windows-version=7
 * moved futex_wait from futex.h to futex.c
 * used simple_mtx_t in more codes

Or linkage error:
src/compiler/libcompiler.a.p/glsl_types.cpp.obj: in function `futex_wake':
/../../src/util/futex.h:154: undefined reference to `WaitOnAddress'
When:
 * compiled with -D min-windows-version=7
 * used simple_mtx_t in more codes

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7494
Fixes: c002bbeb2f7 ("util: Add a Win32 futex impl")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19087>

21 months agomesa,gallium: Revert "Make point coord origin a CAP"
Alyssa Rosenzweig [Fri, 14 Oct 2022 17:45:48 +0000 (13:45 -0400)]
mesa,gallium: Revert "Make point coord origin a CAP"

This reverts commit e749f67f8989874f6795d95422c1f3eb4d2706ba, which added a CAP
to support drivers that can only do upside-down point coordinates. That was
added specifically for Asahi, since Metal's point coordinate convention is
opposite Mesa's. Since then, additional reverse-engineering aided by the PowerVR
headers led me to the bit doing the flip in hardware, so Asahi does not use the
CAP since baadc1ec13f ("asahi: Don't use lower_wpos_pntc"). Garbage collect it.

[If it's needed for future hardware, we can revive it. But the plan is Vulkan
anyway.]

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Suggested-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19078>

21 months agointel: Add and use intel_engines_class_to_string()
José Roberto de Souza [Wed, 5 Oct 2022 20:27:08 +0000 (13:27 -0700)]
intel: Add and use intel_engines_class_to_string()

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18975>

21 months agointel: Convert i915 engine type to intel in tools/ common/ and ds/
José Roberto de Souza [Wed, 5 Oct 2022 19:52:05 +0000 (12:52 -0700)]
intel: Convert i915 engine type to intel in tools/ common/ and ds/

This ones were left to be done after initial conversion.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18975>

21 months agointel: Convert missing i915 engine types to intel
José Roberto de Souza [Wed, 5 Oct 2022 19:46:31 +0000 (12:46 -0700)]
intel: Convert missing i915 engine types to intel

This convertions were missed due to bad rebased in my end, sorry.

Fixes: 03b959286e2c ("intel: Make engine related functions and types not i915 dependent")
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18975>

21 months agonir: Be smarter fusing ffma
Alyssa Rosenzweig [Sat, 15 Oct 2022 17:39:26 +0000 (13:39 -0400)]
nir: Be smarter fusing ffma

If there is a single use of fmul, and that single use is fadd, it makes
sense to fuse ffma, as we already do. However, if there are multiple
uses, fusing may impede code gen. Consider the source fragment:

   a = fmul(x, y)
   b = fadd(a, z)
   c = fmin(a, t)
   d = fmax(b, c)

The fmul has two uses. The current ffma fusing is greedy and will
produce the following "optimized" code.

   a = fmul(x, y)
   b = ffma(x, y, z)
   c = fmin(a, t)
   d = fmax(b, c)

Actually, this code is worse! Instead of 1 fmul + 1 fadd, we now have 1
fmul + 1 ffma. In effect, two multiplies (and a fused add) instead of
one multiply and an add. Depending on the ISA, that could impede
scheduling or increase code size. It can also increase register
pressure, extending the live range.

It's tempting to gate on is_used_once, but that would hurt in cases
where we really do fuse everything, e.g.:

   a = fmul(x, y)
   b = fadd(a, z)
   c = fadd(a, t)

For ISAs that fuse ffma, we expect that 2 ffma is faster than 1 fmul + 2
fadd. So what we really want is to fuse ffma iff the fmul will get
deleted. That occurs iff all uses of the fmul are fadd and will
themselves get fused to ffma, leaving fmul to get dead code eliminated.
That's easy to implement with a new NIR search helper, checking that all
uses are fadd.

shader-db results on Mali-G57 [open shader-db + subset of closed]:

total instructions in shared programs: 179491 -> 178991 (-0.28%)
instructions in affected programs: 36862 -> 36362 (-1.36%)
helped: 190
HURT: 27

total cycles in shared programs: 10573.20 -> 10571.75 (-0.01%)
cycles in affected programs: 72.02 -> 70.56 (-2.02%)
helped: 28
HURT: 1

total fma in shared programs: 1590.47 -> 1582.61 (-0.49%)
fma in affected programs: 319.95 -> 312.09 (-2.46%)
helped: 194
HURT: 1

total cvt in shared programs: 812.98 -> 813.03 (<.01%)
cvt in affected programs: 118.53 -> 118.58 (0.04%)
helped: 65
HURT: 81

total quadwords in shared programs: 98968 -> 98840 (-0.13%)
quadwords in affected programs: 2960 -> 2832 (-4.32%)
helped: 20
HURT: 4

total threads in shared programs: 4693 -> 4697 (0.09%)
threads in affected programs: 4 -> 8 (100.00%)
helped: 4
HURT: 0

v2: Update trace checksums for virgl due to numerical differences.

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

21 months agoglthread: fix buffer allocation size with non-signed buffer offset path
Mike Blumenkrantz [Fri, 7 Oct 2022 04:42:08 +0000 (00:42 -0400)]
glthread: fix buffer allocation size with non-signed buffer offset path

this needs to always add the start_offset to avoid creating
buffers that are too small

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18994>

21 months agogallium/vl: Add opaque rgb pixel formats
Andri Yngvason [Tue, 4 Oct 2022 20:33:01 +0000 (20:33 +0000)]
gallium/vl: Add opaque rgb pixel formats

Signed-off-by: Andri Yngvason <andri@yngvason.is>
Reviewed-by: Simon Ser <contact@emersion.fr>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18959>

21 months agomesa/main: remove driver-cap for ARB_point_sprite
Erik Faye-Lund [Wed, 12 Oct 2022 11:09:08 +0000 (13:09 +0200)]
mesa/main: remove driver-cap for ARB_point_sprite

It's always supported, no need for checks here.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Begrudgingly-reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19049>

21 months agomesa/st: rip out point-sprite cap
Erik Faye-Lund [Wed, 12 Oct 2022 10:54:30 +0000 (12:54 +0200)]
mesa/st: rip out point-sprite cap

All current drivers reports supporting this cap, let's just assume
it's always supported.

It seems better to lower this in the drivers, like we already do for
etnaviv, panfrost and zink...

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Begrudgingly-reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19049>

21 months agorusticl: correctly check global argument size
Italo Nicola [Thu, 6 Oct 2022 12:32:03 +0000 (12:32 +0000)]
rusticl: correctly check global argument size

As the spec that is quoted in the comment says, if the argument is a
memory object, arg_size should be different than sizeof(cl_mem). The
previous verification only worked if the underlying type has the same
size as sizeof(cl_mem).

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18985>

21 months agorusticl: use 32-bit address format for 32-bit devices
Italo Nicola [Thu, 6 Oct 2022 12:20:44 +0000 (12:20 +0000)]
rusticl: use 32-bit address format for 32-bit devices

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18985>

21 months agoclc: add 32-bit target
Italo Nicola [Thu, 6 Oct 2022 12:18:45 +0000 (12:18 +0000)]
clc: add 32-bit target

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18985>

21 months agopanfrost/ci: Disable t720 jobs
Alyssa Rosenzweig [Sat, 15 Oct 2022 00:19:48 +0000 (20:19 -0400)]
panfrost/ci: Disable t720 jobs

They're dead, Jim!

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Suggested-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19084>

21 months agozink: use util_dynarray_clear
Erik Faye-Lund [Fri, 14 Oct 2022 06:25:31 +0000 (08:25 +0200)]
zink: use util_dynarray_clear

We already have a helper for this, let's use it.

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

21 months agozink: fixup dynarray-type
Erik Faye-Lund [Thu, 13 Oct 2022 19:01:23 +0000 (21:01 +0200)]
zink: fixup dynarray-type

This doesn't make a functional difference, because the size here ends up
being the same; the size of a pointer. But let's use the right type for
consistency.

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

21 months agozink: fix broken pool-alloc consolidation
Erik Faye-Lund [Thu, 13 Oct 2022 18:44:12 +0000 (20:44 +0200)]
zink: fix broken pool-alloc consolidation

When appending the content of a util_dynarray to another util_dynarray, we
need to copy the content to the *end* of the util_dynarray, not the
beginning.

As we've already resized the dynarray, We also shouldn't add to the size
once more at the end, otherwise we'll end up with garbage.

Fixes: 43dcdf33654 ("zink: rework/improve descriptor pool overflow handling on batch reset")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7485
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19068>

21 months agoanv: reduce BT emissions & surface state writes with push descriptors
Lionel Landwerlin [Sun, 2 Oct 2022 16:24:40 +0000 (19:24 +0300)]
anv: reduce BT emissions & surface state writes with push descriptors

Zink on Anv running Gfxbench gl_driver2 is significantly slower than
Iris.

The reason is simple, whereas Iris implements uniform updates using
push constants and only has to emit 3DSTATE_CONSTANT_* packets, Zink
uses push descriptors with a uniform buffer, which on our
implementation use both push constants & binding tables.

Anv ends up doing the following for each uniform update :
   - allocate 2 surface states :
      - one for the uniform buffer as the offset specify by zink
      - one for the descriptor set buffer
   - pack the 2 RENDER_SURFACE_STATE
   - re-emit binding tables
   - re-emit push constants

Of all of those operations, only the last one ends up being useful in
this benchmark because all the uniforms have been promoted to push
constants.

This change defers the 3 first operations at draw time and executes
them only if the pipeline needs them.

Vkoverhead before / after :
  descriptor_template_1ubo_push:                      40670 / 85786
  descriptor_template_12ubo_push:                      4050 / 13820
  descriptor_template_1combined_sampler_push,         34410 / 34043
  descriptor_template_16combined_sampler_push,         2746 / 2711
  descriptor_template_1sampled_image_push,            34765 / 34089
  descriptor_template_16sampled_image_push,            2794 / 2649
  descriptor_template_1texelbuffer_push,             108537 / 111342
  descriptor_template_16texelbuffer_push,             20619 / 20166
  descriptor_template_1ssbo_push,                     41506 / 85976
  descriptor_template_8ssbo_push,                      6036 / 18703
  descriptor_template_1image_push,                    88932 / 89610
  descriptor_template_16image_push,                   20937 / 20959
  descriptor_template_1imagebuffer_push,             108407 / 113240
  descriptor_template_16imagebuffer_push,             32661 / 34651

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19050>

21 months agoanv: add analysis for push descriptor uses and store it in shader cache
Lionel Landwerlin [Tue, 11 Oct 2022 23:00:41 +0000 (02:00 +0300)]
anv: add analysis for push descriptor uses and store it in shader cache

We'll use this information to avoid :
   - binding table emission
   - allocation of surface states

v2: Fix anv_nir_push_desc_ubo_fully_promoted()

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19050>

21 months agoanv: initialization pipeline layout to 0s
Lionel Landwerlin [Tue, 11 Oct 2022 22:54:14 +0000 (01:54 +0300)]
anv: initialization pipeline layout to 0s

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

21 months agoanv: track descriptor set layout flags
Lionel Landwerlin [Tue, 11 Oct 2022 22:52:55 +0000 (01:52 +0300)]
anv: track descriptor set layout flags

To identify push descriptors.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19050>

21 months agoanv: limit push constant reemission
Lionel Landwerlin [Sat, 8 Oct 2022 16:07:16 +0000 (19:07 +0300)]
anv: limit push constant reemission

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19050>

21 months agoisl: avoid gfx version switch cases on the hot path
Lionel Landwerlin [Sun, 2 Oct 2022 16:20:30 +0000 (19:20 +0300)]
isl: avoid gfx version switch cases on the hot path

Some of the surface state packing functions are called from the hot
path in Anv. We can use function pointers to avoid repeatedly going
through switch/case.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19050>

21 months agoanv: remove multiple push descriptors
Lionel Landwerlin [Sun, 2 Oct 2022 16:17:14 +0000 (19:17 +0300)]
anv: remove multiple push descriptors

VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00293

   pSetLayouts must not contain more than one descriptor set layout
   that was created with
   VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR set

There is only one push descriptor set with all the descriptor sets, so
no need to have an array.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19050>

21 months agoanv: optimize 3DSTATE_VF emission
Lionel Landwerlin [Sun, 2 Oct 2022 11:39:52 +0000 (14:39 +0300)]
anv: optimize 3DSTATE_VF emission

We can avoid reemitting this when the index buffer index type doesn't
change.

Also we don't need to update this when the pipeline changes as we do
not pull any value from the pipeline. Instead rely on the dynamic
state to tell if dyn->ia.primitive_restart_enable changed.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19050>

21 months agoanv: limit calls into cmd_buffer_flush_dynamic_state
Lionel Landwerlin [Sun, 2 Oct 2022 08:03:29 +0000 (11:03 +0300)]
anv: limit calls into cmd_buffer_flush_dynamic_state

Avoids a bunch of checks if we can.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19050>

21 months agoanv: comment out the Gfx8/9 VB cache key workaround for newer Gens
Lionel Landwerlin [Sun, 2 Oct 2022 22:41:04 +0000 (01:41 +0300)]
anv: comment out the Gfx8/9 VB cache key workaround for newer Gens

This code shows up a little on profiling on Gfx12 and since it's only
a gfx8/9 workaround we might as well ifdef it out.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19050>

21 months agoanv: remove unused code
Lionel Landwerlin [Sat, 8 Oct 2022 16:06:48 +0000 (19:06 +0300)]
anv: remove unused code

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19050>

21 months agovulkan/runtime: don't lookup the pipeline disk cache if disabled
Lionel Landwerlin [Thu, 21 Jul 2022 12:11:20 +0000 (15:11 +0300)]
vulkan/runtime: don't lookup the pipeline disk cache if disabled

When the Anv pipeline got migrated to the runtime, we gain/lost a bit
of functionality which is that the disk cache is always read
regardless of VK_ENABLE_PIPELINE_CACHE=0.

This change brings the old behavior back.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 591da9877900c ("vulkan: Add a common VkPipelineCache implementation")
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19050>

21 months agoradv: Mark dEQP-VK.ray_query.misc.dynamic_indexing as crashing in CI.
Bas Nieuwenhuizen [Fri, 14 Oct 2022 13:42:40 +0000 (15:42 +0200)]
radv: Mark dEQP-VK.ray_query.misc.dynamic_indexing as crashing in CI.

Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7493
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19073>

21 months agovulkan/wsi: Add dep_libudev to idep dependencies
Ryan Houdek [Tue, 11 Oct 2022 20:04:41 +0000 (13:04 -0700)]
vulkan/wsi: Add dep_libudev to idep dependencies

Otherwise users of `idep_vulkan_wsi` won't pull in the udev dependency,
which will cause the linker to fail later on in compiling.

The user of this dependency is lavapipe which would fail to link if this
isn't provided.

Fixes: 4885e63a6d20c57f98b7b641ea3c39a8ff3ae2dd (vulkan/wsi: implement missing wsi_register_device_event)

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

21 months agoci/traces: Blender demo (Cube Diorama) flakes on Intel APL
David Heidelberg [Fri, 14 Oct 2022 01:49:39 +0000 (20:49 -0500)]
ci/traces: Blender demo (Cube Diorama) flakes on Intel APL

Acked-by: Karol Herbst <kherbst@redhat.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19067>

21 months agonir: move fusing csel and comparisons to opt_late_algebraic
Gert Wollny [Wed, 5 Oct 2022 13:01:05 +0000 (15:01 +0200)]
nir: move fusing csel and comparisons to opt_late_algebraic

With that simple comparisons are cleaned up properly.

This helps with some tesselation shaders on r600.

Shader-db stats R600/Cayman:

--------------------------------------------------------------
total dw in shared programs: 1621806 -> 1620884 (-0.06%)
dw in affected programs: 41650 -> 40728 (-2.21%)
helped: 211
HURT: 4
helped stats (abs) min: 2 max: 26 x̄: 4.46 x̃: 4
helped stats (rel) min: 0.30% max: 9.68% x̄: 2.87% x̃: 2.52%
HURT stats (abs)   min: 2 max: 8 x̄: 5.00 x̃: 5
HURT stats (rel)   min: 0.23% max: 1.67% x̄: 1.02% x̃: 1.09%
95% mean confidence interval for dw value: -4.81 -3.77
95% mean confidence interval for dw %-change: -3.03% -2.57%
Dw are helped.

total gprs in shared programs: 41192 -> 41182 (-0.02%)
gprs in affected programs: 731 -> 721 (-1.37%)
helped: 53
HURT: 45
helped stats (abs) min: 1 max: 3 x̄: 1.23 x̃: 1
helped stats (rel) min: 5.88% max: 40.00% x̄: 16.56% x̃: 14.29%
HURT stats (abs)   min: 1 max: 2 x̄: 1.22 x̃: 1
HURT stats (rel)   min: 7.69% max: 40.00% x̄: 19.42% x̃: 20.00%
95% mean confidence interval for gprs value: -0.37 0.16
95% mean confidence interval for gprs %-change: -3.92% 3.85%
Inconclusive result (value mean confidence interval includes 0).

total alu_groups in shared programs: 203677 -> 203632 (-0.02%)
alu_groups in affected programs: 2876 -> 2831 (-1.56%)
helped: 68
HURT: 30
helped stats (abs) min: 1 max: 4 x̄: 1.46 x̃: 1
helped stats (rel) min: 0.84% max: 25.00% x̄: 7.48% x̃: 5.41%
HURT stats (abs)   min: 1 max: 6 x̄: 1.80 x̃: 1
HURT stats (rel)   min: 1.98% max: 33.33% x̄: 10.09% x̃: 5.61%
95% mean confidence interval for alu_groups value: -0.81 -0.11
95% mean confidence interval for alu_groups %-change: -4.20% <.01%
Alu_groups are helped.

total loops in shared programs: 72 -> 72 (0.00%)
loops in affected programs: 0 -> 0
helped: 0
HURT: 0

total cf in shared programs: 88230 -> 88233 (<.01%)
cf in affected programs: 71 -> 74 (4.23%)
helped: 1
HURT: 4
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 33.33% max: 33.33% x̄: 33.33% x̃: 33.33%
HURT stats (abs)   min: 1 max: 1 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 1.89% max: 33.33% x̄: 17.14% x̃: 16.67%
95% mean confidence interval for cf value: -0.51 1.71
95% mean confidence interval for cf %-change: -24.20% 38.29%
Inconclusive result (value mean confidence interval includes 0).

total stack in shared programs: 3827 -> 3827 (0.00%)
stack in affected programs: 0 -> 0
helped: 0
HURT: 0

LOST:   0
GAINED: 0

Total CPU time (seconds): 45.32 -> 41.69 (-8.01%)
--------------------------------------------------------------

v2: Simplify replacement pattern (Rhys Perry)
v3: fix ws (Alexander Orzechowski)
v4: move the original lowering to opt_late_algebraic and
    drop cleanup code (Alyssa)
v5: Add shader-sb stats (Alyssa)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18970>

21 months agor600/sfn: run cleanup passes after late algebraic opt
Gert Wollny [Sun, 9 Oct 2022 16:08:18 +0000 (18:08 +0200)]
r600/sfn: run cleanup passes after late algebraic opt

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18970>

21 months agohasvk: Correctly set NonPerspectiveBarycentricEnable on gfx7
Väinö Mäkelä [Sun, 9 Oct 2022 06:53:12 +0000 (09:53 +0300)]
hasvk: Correctly set NonPerspectiveBarycentricEnable on gfx7

The incorrect #else has existed since commit bfd9942cdc0, but the issue
was already present before that. NonPerspectiveBarycentricEnable must be
enabled if non-perspective interpolation is used.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7449
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19004>

21 months agonir: fix NIR_DEBUG=validate_ssa_dominance
Lionel Landwerlin [Wed, 5 Oct 2022 10:08:56 +0000 (13:08 +0300)]
nir: fix NIR_DEBUG=validate_ssa_dominance

validate_ssa_def_dominance() asserts :

   validate_assert(state, !BITSET_TEST(state->ssa_defs_found, def->index));

Because the previous validation lefts bits set when it processed the
IR.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18966>

21 months agoutil/mesa/wide: Rename _SIMPLE_MTX_INITIALIZER_NP to SIMPLE_MTX_INITIALIZER
Yonggang Luo [Fri, 2 Sep 2022 16:13:15 +0000 (00:13 +0800)]
util/mesa/wide: Rename _SIMPLE_MTX_INITIALIZER_NP to SIMPLE_MTX_INITIALIZER

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18393>

21 months agoci/bin: Remove whitespace from token files
Guilherme Gallo [Mon, 15 Aug 2022 20:07:21 +0000 (17:07 -0300)]
ci/bin: Remove whitespace from token files

There was a security problem with some `gitlab_gql.py` scenarios because
of `\r` and `\n` in the token file, which interrupted the requests for
Gitlab endpoints.

Stripping the token file after reading the file content solves the
problem.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18066>

21 months agoci/bin: Fix requirements.txt
Guilherme Gallo [Mon, 15 Aug 2022 19:18:53 +0000 (16:18 -0300)]
ci/bin: Fix requirements.txt

Add missing aiohttp and PyYAML packages

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18066>

21 months agoagx: Reserve live-in regs at the start of block
Alyssa Rosenzweig [Sun, 25 Sep 2022 00:57:31 +0000 (20:57 -0400)]
agx: Reserve live-in regs at the start of block

...Rather than reserving the union of the registers live-out of the
predecessors. This avoids reserving registers that are killed along a
control flow edge (where the predecessor has another successor that does
use the register).

glmark2 subset of shaderdb:

total instructions in shared programs: 6442 -> 6440 (-0.03%)
instructions in affected programs: 42 -> 40 (-4.76%)
helped: 1
HURT: 0

total bytes in shared programs: 42186 -> 42174 (-0.03%)
bytes in affected programs: 270 -> 258 (-4.44%)
helped: 1
HURT: 0

total halfregs in shared programs: 1769 -> 1757 (-0.68%)
halfregs in affected programs: 75 -> 63 (-16.00%)
helped: 3
HURT: 0
helped stats (abs) min: 4.0 max: 4.0 x̄: 4.00 x̃: 4
helped stats (rel) min: 16.00% max: 16.00% x̄: 16.00% x̃: 16.00%

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

21 months agoagx: Pass in max regs as a paramter to RA
Alyssa Rosenzweig [Sat, 24 Sep 2022 23:13:00 +0000 (19:13 -0400)]
agx: Pass in max regs as a paramter to RA

This will allow us to restrict max regs later.

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

21 months agoagx: Introduce ra_ctx data structure
Alyssa Rosenzweig [Sat, 24 Sep 2022 04:15:55 +0000 (00:15 -0400)]
agx: Introduce ra_ctx data structure

We have more parameters to pass, this will get unwieldly otherwise.

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

21 months agoagx: Write to r0l with a "nesting" instruction
Alyssa Rosenzweig [Sat, 24 Sep 2022 04:04:21 +0000 (00:04 -0400)]
agx: Write to r0l with a "nesting" instruction

This avoids modeling the r0l register explicitly in the IR, which would
complicate RA for little benefit at this stage. Do the simplest thing
that could possibly work in SSA.

glmark2 subset.

total instructions in shared programs: 6442 -> 6442 (0.00%)
instructions in affected programs: 701 -> 701 (0.00%)
helped: 4
HURT: 5
helped stats (abs) min: 1.0 max: 3.0 x̄: 2.00 x̃: 2
helped stats (rel) min: 1.46% max: 7.69% x̄: 4.03% x̃: 3.48%
HURT stats (abs)   min: 1.0 max: 3.0 x̄: 1.60 x̃: 1
HURT stats (rel)   min: 0.81% max: 7.41% x̄: 2.67% x̃: 1.14%
95% mean confidence interval for instructions value: -1.58 1.58
95% mean confidence interval for instructions %-change: -3.70% 3.08%
Inconclusive result (value mean confidence interval includes 0).

total bytes in shared programs: 42196 -> 42186 (-0.02%)
bytes in affected programs: 7768 -> 7758 (-0.13%)
helped: 8
HURT: 5
helped stats (abs) min: 2.0 max: 18.0 x̄: 7.25 x̃: 4
helped stats (rel) min: 0.13% max: 7.26% x̄: 2.02% x̃: 0.97%
HURT stats (abs)   min: 6.0 max: 18.0 x̄: 9.60 x̃: 6
HURT stats (rel)   min: 0.82% max: 6.32% x̄: 2.37% x̃: 1.02%
95% mean confidence interval for bytes value: -7.02 5.48
95% mean confidence interval for bytes %-change: -2.30% 1.63%
Inconclusive result (value mean confidence interval includes 0).

total halfregs in shared programs: 1926 -> 1769 (-8.15%)
halfregs in affected programs: 1395 -> 1238 (-11.25%)
helped: 71
HURT: 0
helped stats (abs) min: 1.0 max: 10.0 x̄: 2.21 x̃: 2
helped stats (rel) min: 1.92% max: 52.63% x̄: 15.33% x̃: 11.76%
95% mean confidence interval for halfregs value: -2.69 -1.73
95% mean confidence interval for halfregs %-change: -17.98% -12.68%
Halfregs are helped.

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

21 months agoagx: Preload vertex/instance ID only at start
Alyssa Rosenzweig [Fri, 23 Sep 2022 21:27:43 +0000 (17:27 -0400)]
agx: Preload vertex/instance ID only at start

This means we don't reserve the registers, which improves RA
considerably. Using a special preload psuedo-op instead of a regular
move allows us to constrain semantics and gaurantee coalescing.

shader-db on glmark2 subset:

total instructions in shared programs: 6448 -> 6442 (-0.09%)
instructions in affected programs: 230 -> 224 (-2.61%)
helped: 4
HURT: 0

total bytes in shared programs: 42232 -> 42196 (-0.09%)
bytes in affected programs: 1530 -> 1494 (-2.35%)
helped: 4
HURT: 0

total halfregs in shared programs: 2291 -> 1926 (-15.93%)
halfregs in affected programs: 2185 -> 1820 (-16.70%)
helped: 75
HURT: 0

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

21 months agoagx: Print agx_dim appropriately
Alyssa Rosenzweig [Sat, 24 Sep 2022 03:15:10 +0000 (23:15 -0400)]
agx: Print agx_dim appropriately

Easier to read, and gets us closer to proper disasm in Mesa.

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

21 months agoagx: Print instructions as "dest = src"
Alyssa Rosenzweig [Fri, 23 Sep 2022 20:40:39 +0000 (16:40 -0400)]
agx: Print instructions as "dest = src"

This makes the dataflow easier to read, especially with splits and
collects (which take variable numbers of sources/destinations).

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