platform/upstream/mesa.git
16 months agoaco/opcodes: move v_cndmask_b32 back to the VOP2 list
Georg Lehmann [Mon, 13 Mar 2023 18:23:25 +0000 (19:23 +0100)]
aco/opcodes: move v_cndmask_b32 back to the VOP2 list

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21882>

16 months agoaco/spill: Use arena allocator for spills
Tony Wasserka [Wed, 21 Jul 2021 15:19:13 +0000 (17:19 +0200)]
aco/spill: Use arena allocator for spills

Gives a marginal speedup.

Co-authored-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12000>

16 months agoaco/spill: Use arena allocator for next use distances
Tony Wasserka [Tue, 20 Jul 2021 15:05:43 +0000 (17:05 +0200)]
aco/spill: Use arena allocator for next use distances

Speedup of aco::spill(): ~50%

Co-authored-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12000>

16 months agonouveau: eliminate busy waiting on fences
Karol Herbst [Sat, 5 Nov 2022 10:49:11 +0000 (11:49 +0100)]
nouveau: eliminate busy waiting on fences

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19543>

16 months agoanv: convert most pc in genX_cmd_buffer to use pc helper
Tapani Pälli [Thu, 15 Jun 2023 09:53:14 +0000 (12:53 +0300)]
anv: convert most pc in genX_cmd_buffer to use pc helper

Some are left, batch_set_preemption does not have devinfo pointer
and IndirectStatePointersDisable does not have corresponding ANV bit.

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

16 months agoanv: change most pipe controls in gfx8_cmd_buffer to use pc helper
Tapani Pälli [Thu, 8 Jun 2023 06:48:40 +0000 (09:48 +0300)]
anv: change most pipe controls in gfx8_cmd_buffer to use pc helper

One using a flag (PSDSyncEnable) that has no corresponding ANV bit.

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

16 months agoanv: change pipe control in indirect draw gen to use pc helper
Tapani Pälli [Thu, 15 Jun 2023 09:30:43 +0000 (12:30 +0300)]
anv: change pipe control in indirect draw gen to use pc helper

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

16 months agoanv: change pipe controls in genX_gpu_memcpy to use pc helper
Tapani Pälli [Thu, 8 Jun 2023 06:36:57 +0000 (09:36 +0300)]
anv: change pipe controls in genX_gpu_memcpy to use pc helper

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

16 months agoanv: change pipe control in genX_pipeline to use pc helper
Tapani Pälli [Thu, 8 Jun 2023 06:35:22 +0000 (09:35 +0300)]
anv: change pipe control in genX_pipeline to use pc helper

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

16 months agoanv: change pipe controls in genX_state to use pc helper
Tapani Pälli [Thu, 8 Jun 2023 06:32:07 +0000 (09:32 +0300)]
anv: change pipe controls in genX_state to use pc helper

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

16 months agoanv: convert genX_query pipe controls to use pc helper
Tapani Pälli [Wed, 7 Jun 2023 10:45:53 +0000 (13:45 +0300)]
anv: convert genX_query pipe controls to use pc helper

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

16 months agoanv: implement invalidate part of emit_apply_pipe_flushes with helper
Tapani Pälli [Thu, 15 Jun 2023 09:20:45 +0000 (12:20 +0300)]
anv: implement invalidate part of emit_apply_pipe_flushes with helper

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

16 months agoanv: implement flush part of emit_apply_pipe_flushes with helper
Tapani Pälli [Thu, 15 Jun 2023 09:19:16 +0000 (12:19 +0300)]
anv: implement flush part of emit_apply_pipe_flushes with helper

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

16 months agoanv: wrap pipe control emission to a set of helper functions
Tapani Pälli [Wed, 7 Jun 2023 07:52:53 +0000 (10:52 +0300)]
anv: wrap pipe control emission to a set of helper functions

This makes it possible to have HW specific rules and WA's implemented
in a central place. Also all pipe controls will get anv_debug_dump_pc.

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

16 months agovirgl: Fix stack overflow in virgl_bind_sampler_states
Tim Pambor [Thu, 15 Jun 2023 15:06:28 +0000 (15:06 +0000)]
virgl: Fix stack overflow in virgl_bind_sampler_states

Triggered on hosts with more than 32 samplers.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9207
Fixes: 63c4c559 ("virgl: obtain supported number of shader sampler views from host")
Signed-off-by: Tim Pambor <tp@osasysteme.de>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23678>

16 months agoradv: add dgc_emit_index_buffer()
Samuel Pitoiset [Thu, 15 Jun 2023 05:56:41 +0000 (07:56 +0200)]
radv: add dgc_emit_index_buffer()

For emitting VK_INDIRECT_COMMANDS_TOKEN_TYPE_INDEX_BUFFER_NV.

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

16 months agoradv: add dgc_emit_draw_indexed() helper
Samuel Pitoiset [Thu, 15 Jun 2023 05:50:59 +0000 (07:50 +0200)]
radv: add dgc_emit_draw_indexed() helper

For emitting VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_INDEXED_NV.

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

16 months agoradv: add dgc_emit_draw() helper
Samuel Pitoiset [Thu, 15 Jun 2023 05:43:05 +0000 (07:43 +0200)]
radv: add dgc_emit_draw() helper

For emitting VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_NV.

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

16 months agoradv: add dgc_emit_vertex_buffer() helper
Samuel Pitoiset [Mon, 12 Jun 2023 07:35:56 +0000 (09:35 +0200)]
radv: add dgc_emit_vertex_buffer() helper

For emitting VK_INDIRECT_COMMANDS_TOKEN_TYPE_VERTEX_BUFFER_NV.

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

16 months agoradv: add dgc_emit_push_constant() helper
Samuel Pitoiset [Mon, 12 Jun 2023 07:35:25 +0000 (09:35 +0200)]
radv: add dgc_emit_push_constant() helper

For emitting VK_INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_NV.

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

16 months agoradv: add dgc_emit_state() helper
Samuel Pitoiset [Mon, 12 Jun 2023 07:34:52 +0000 (09:34 +0200)]
radv: add dgc_emit_state() helper

For emitting VK_INDIRECT_COMMANDS_TOKEN_TYPE_STATE_FLAGS_NV.
The scissor workaround for GFX9 is only needed if the state is emitted,
so move it there as well.

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

16 months agoradv: remove unused radv_dgc_token struct
Samuel Pitoiset [Thu, 8 Jun 2023 07:39:26 +0000 (09:39 +0200)]
radv: remove unused radv_dgc_token struct

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

16 months agoac/radeonsi: add av1 defaults header file from radeonsi
Dave Airlie [Tue, 7 Feb 2023 22:04:10 +0000 (08:04 +1000)]
ac/radeonsi: add av1 defaults header file from radeonsi

This just moves this header file so radv can use it.

Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23640>

16 months agolavapipe: correctly update shader object per-stage push constant sizes
Mike Blumenkrantz [Wed, 14 Jun 2023 14:12:20 +0000 (10:12 -0400)]
lavapipe: correctly update shader object per-stage push constant sizes

Fixes: 8b3022c9180 ("lavapipe: implement EXT_shader_object")

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

16 months agolavapipe: fix shader binary binding with mesh shaders
Mike Blumenkrantz [Wed, 14 Jun 2023 13:42:22 +0000 (09:42 -0400)]
lavapipe: fix shader binary binding with mesh shaders

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

16 months agolavapipe: more fixes for sample shading
Mike Blumenkrantz [Wed, 14 Jun 2023 12:28:07 +0000 (08:28 -0400)]
lavapipe: more fixes for sample shading

this fixes the case where a draw without sample shading precedes
a draw with sample shading without changes to the sample mask

Fixes: cc9e9580531 ("lavapipe: fix DS3 min sample setting")

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

16 months agoaux/trace: add methods for mesh shaders
Mike Blumenkrantz [Wed, 14 Jun 2023 12:13:55 +0000 (08:13 -0400)]
aux/trace: add methods for mesh shaders

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

16 months agoclc: static assert that clc_optional_features has no padding
Karol Herbst [Thu, 15 Jun 2023 22:29:24 +0000 (00:29 +0200)]
clc: static assert that clc_optional_features has no padding

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23685>

16 months agomeson: Remove reference to removed SWR driver
Matt Turner [Thu, 15 Jun 2023 15:25:48 +0000 (11:25 -0400)]
meson: Remove reference to removed SWR driver

Fixes: e2de00876a7 ("gallium/swr: Remove common code and build options")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23679>

16 months agobin/pick-ui: use asyncio.new_event_loop
Dylan Baker [Thu, 20 Apr 2023 23:02:16 +0000 (16:02 -0700)]
bin/pick-ui: use asyncio.new_event_loop

Instead of .get_event_loop, which is deprecated when there isn't a
running loop (like in our case).

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

16 months agobin/pick: Add support for adding notes on patches
Dylan Baker [Thu, 20 Apr 2023 18:27:21 +0000 (11:27 -0700)]
bin/pick: Add support for adding notes on patches

This is pretty useful for keeping track of why a patch isn't landed, or
who I'm waiting on feedback from.

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

16 months agobin/pick: use lineboxes to make the UI clearer
Dylan Baker [Thu, 13 Apr 2023 17:32:05 +0000 (10:32 -0700)]
bin/pick: use lineboxes to make the UI clearer

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

16 months agobin/pick: fix issue where None for nomination_type could fail
Dylan Baker [Thu, 20 Apr 2023 18:22:42 +0000 (11:22 -0700)]
bin/pick: fix issue where None for nomination_type could fail

We have an assumption it's never None, so use a special value in the
Enum instead.

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

16 months agorusticl/spirv: Key optional clc features when caching.
Karol Herbst [Wed, 10 May 2023 17:49:22 +0000 (19:49 +0200)]
rusticl/spirv: Key optional clc features when caching.

Sadly I can't use serde yet, so I have to do this nonsense.

Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23532>

16 months agoclc: add commment to clc_optional_features to ensure no padding exists
Karol Herbst [Thu, 15 Jun 2023 13:41:31 +0000 (15:41 +0200)]
clc: add commment to clc_optional_features to ensure no padding exists

Hopefully this is good enough.

Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23532>

16 months agodocs: upgrade bootstrap to 5.3.0
Erik Faye-Lund [Sun, 4 Jun 2023 14:44:59 +0000 (16:44 +0200)]
docs: upgrade bootstrap to 5.3.0

The release version of Bootstrap 5.3.0 is out, let's upgrade from the
alpha-version we were using.

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

16 months agonv50/ir: resolve -Woverloaded-virtual=1 warnings
Karol Herbst [Thu, 15 Jun 2023 15:33:24 +0000 (17:33 +0200)]
nv50/ir: resolve -Woverloaded-virtual=1 warnings

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

16 months agonv50/ir: use override
Karol Herbst [Thu, 15 Jun 2023 15:33:11 +0000 (17:33 +0200)]
nv50/ir: use override

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

16 months agozink: more anv ci flakes
Mike Blumenkrantz [Thu, 15 Jun 2023 17:56:28 +0000 (13:56 -0400)]
zink: more anv ci flakes

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

16 months agoanv: avoid requiring ordered memory planes for explicit import
Yiwei Zhang [Wed, 14 Jun 2023 09:53:31 +0000 (02:53 -0700)]
anv: avoid requiring ordered memory planes for explicit import

The spec does not have such requirement, but anv requires it for
validating the offset. However, for DRM_FORMAT_YVU420, chroma channels
can be swapped upon import to match B/R channel order of
VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM.

This fixes some sw codec path in Instagram when interop with gpu.

v2: fix image memory requirement for re-ordered explicit import

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net> (v1)
Reviewed-by: Matt Tuner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23643>

16 months agoasahi: Use bitfield_extract for texture lowering
Alyssa Rosenzweig [Sun, 21 May 2023 03:02:35 +0000 (23:02 -0400)]
asahi: Use bitfield_extract for texture lowering

This makes descriptor crawls a lot easier to read, which is good because more
are coming.

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

16 months agoagx: Implement bitfieldExtract natively
Alyssa Rosenzweig [Sun, 21 May 2023 02:15:06 +0000 (22:15 -0400)]
agx: Implement bitfieldExtract natively

We have a bfeil instruction which mostly maps to the GLSL thing, so use it with
the appropriate lowering.

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

16 months agonir/builder: Add ubitfield_extract_imm helper
Alyssa Rosenzweig [Sun, 21 May 2023 03:01:45 +0000 (23:01 -0400)]
nir/builder: Add ubitfield_extract_imm helper

We have a ubfe_imm helper that creates ubfe ops. Not all drivers support ubfe,
however, as it requires SM5 semantics. A few drivers support oly
ubitfield_extract. They should still get the convenience of an _imm helper, so
add a symmetric helper.

It might be nice to unify these helpers into a single helper that asserts its
inputs do not overflow (such that the two ops become equivalent) and emits
either ubfe or ubitfield_extract depending on the underlying driver. That is
left for future work as it's unclear exactly what naming/semantics we want.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23351>

16 months agopvr: add missing frag to geom dependency for jobs targetting same render target
SoroushIMG [Tue, 23 May 2023 07:43:22 +0000 (08:43 +0100)]
pvr: add missing frag to geom dependency for jobs targetting same render target

Seen as a firmware assert when using a debug build of the firmware
and tested against:

dEQP-VK.pipeline.monolithic.render_to_image.core.1d_array.huge.width_layers.r8g8b8a8_unorm_d16_unorm

Signed-off-by: SoroushIMG <soroush.kashani@imgtec.com>
Acked-by: James Glanville <james.glanville@imgtec.com>
Reported-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23651>

16 months agomicrosoft/clc: Add unreachable() to fix 'may be unitialized' warning
Caio Oliveira [Thu, 15 Jun 2023 06:17:36 +0000 (23:17 -0700)]
microsoft/clc: Add unreachable() to fix 'may be unitialized' warning

  In function ‘lower_load_kernel_input’,
      inlined from ‘clc_nir_lower_kernel_input_loads’ at ../src/microsoft/clc/clc_nir.c:205:28:
  ../src/microsoft/clc/clc_nir.c:169:7: warning: ‘base_type’ may be used uninitialized [-Wmaybe-uninitialized]
    169 |       glsl_vector_type(base_type, nir_dest_num_components(intr->dest));
        |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../src/microsoft/clc/clc_nir.c: In function ‘clc_nir_lower_kernel_input_loads’:
  ../src/microsoft/clc/clc_nir.c:151:24: note: ‘base_type’ was declared here
    151 |    enum glsl_base_type base_type;
        |                        ^~~~~~~~~

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

16 months agor300: remove unused opcodes from r300_tgsi_to_rc
Pavel Ondračka [Wed, 14 Jun 2023 08:25:42 +0000 (10:25 +0200)]
r300: remove unused opcodes from r300_tgsi_to_rc

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23642>

16 months agor300: remove unused LIT lowering
Pavel Ondračka [Wed, 14 Jun 2023 08:01:13 +0000 (10:01 +0200)]
r300: remove unused LIT lowering

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23642>

16 months agor300: remove unused ROUND lowering
Pavel Ondračka [Wed, 14 Jun 2023 07:58:30 +0000 (09:58 +0200)]
r300: remove unused ROUND lowering

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23642>

16 months agor300: remove unused DST lowering
Pavel Ondračka [Wed, 14 Jun 2023 07:53:10 +0000 (09:53 +0200)]
r300: remove unused DST lowering

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23642>

16 months agor300: remove unused POW lowering
Pavel Ondračka [Wed, 14 Jun 2023 06:45:59 +0000 (08:45 +0200)]
r300: remove unused POW lowering

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23642>

16 months agor300: remove unused FLR lowering
Pavel Ondračka [Wed, 14 Jun 2023 06:42:30 +0000 (08:42 +0200)]
r300: remove unused FLR lowering

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23642>

16 months agor300: move CEIL lowering to NIR
Pavel Ondračka [Wed, 14 Jun 2023 06:39:33 +0000 (08:39 +0200)]
r300: move CEIL lowering to NIR

Also remove unused backend CEIL lowering.

Single regressed gnome-shell shader due to fceil followed by f2i32
where before nir_lower_int_to_float would recognize that we already
have integer and emit mov instead of trunc for the f2i32. We can
clean this up easily once we move ntt to the backend.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23642>

16 months agor300: remove unused SSG lowering
Pavel Ondračka [Wed, 14 Jun 2023 06:36:08 +0000 (08:36 +0200)]
r300: remove unused SSG lowering

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23642>

16 months agor300: remove unused SIN/COS lowering
Pavel Ondračka [Wed, 14 Jun 2023 06:36:28 +0000 (08:36 +0200)]
r300: remove unused SIN/COS lowering

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23642>

16 months agoradv/rt: Stop forcing wave32 by setting compute_subgroup_size
Konstantin Seurer [Mon, 12 Jun 2023 15:24:49 +0000 (17:24 +0200)]
radv/rt: Stop forcing wave32 by setting compute_subgroup_size

We end up reporting the wrong subgroup size this way.

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

16 months agoiris: Drop GPGPU Tex Invalidate restriction for TGL+
Nanley Chery [Tue, 20 Sep 2022 23:39:01 +0000 (16:39 -0700)]
iris: Drop GPGPU Tex Invalidate restriction for TGL+

According to the HW docs, TGL+ no longer requires that a CS stall be
added to a texture cache invalidate done in the compute pipeline.

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

16 months agoiris: Drop the RT flush for PIPE_BARRIER_TEXTURE
Nanley Chery [Thu, 15 Sep 2022 22:41:59 +0000 (15:41 -0700)]
iris: Drop the RT flush for PIPE_BARRIER_TEXTURE

The render target flush would have been needed if it was possible to:

1) pollute the render cache and write to the data port in one draw
   call.

2) perform a subsequent operation that assumed the render cache was
   up-to-date.

However, this is not possible for the two glMemoryBarrier barrier bits
that get translated to this pipe barrier:

* GL_TEXTURE_FETCH_BARRIER_BIT is only used for sampling operations.
  It's possible to pollute the render cache and data cache with writes
  to a texture in one draw call (1). However, the GL spec states that
  apps cannot assume that any existing render caches are up-to-date for
  sampling the written locations immediately afterwards. Apps are
  required to use glTextureBarrier before the sampling operation, so
  requirement #2 is not satisfied.

* GL_PIXEL_BUFFER_BARRIER_BIT could be used for a PBO upload (2), but
  it's not possible to pollute the render cache and data cache with a
  PBO access in one draw call. PBOs cannot be bound to framebuffers
  for rendering, so requirement #1 is not satisfied.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v1)
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18725>

16 months agoRevert "iris: Add missed tile flush flag"
Nanley Chery [Thu, 15 Sep 2022 22:22:37 +0000 (15:22 -0700)]
Revert "iris: Add missed tile flush flag"

This reverts commit 0523607ebb108d8c90bbda9c6564b66a0a6250e6.

The issue that commit worked around seems to have been fixed as of
commit 1c8b4940ebf ("iris: Emit flushes for push constant source
buffers"). I could no longer reproduce it from that point onward with
this revert applied.

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

16 months agointel/blorp: Avoid 32bpc fast clear sampling issue
Nanley Chery [Mon, 12 Jun 2023 11:59:06 +0000 (07:59 -0400)]
intel/blorp: Avoid 32bpc fast clear sampling issue

For 32bpc formats, the ICL+ sampler fetches the raw clear color dwords
used for rendering instead of the converted pixel dwords typically used
for sampling. The CLEAR_COLOR struct page documents this for 128bpp
formats, but not for 32bpp and 64bpp formats.

In blorp_copy, map R11G11B10_FLOAT to R8G8B8A8_UINT instead of R32_UINT.
This will cause the sampler to fetch the clear color pixel, allowing
drivers to keep clear color support enabled during copies.

If iris is forced to convert blits to copies, this patch fixes the
following test on gfx12:

  dEQP-GLES3.functional.fbo.color.repeated_clear.blit.rbo.r11f_g11f_b10f

At the moment, both iris and anv won't hit this issue outside of
blorp_copy. This is due to the read/write access restrictions they
currently place on texture views that reinterpret the surface format.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8964
Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23604>

16 months agonir: add missed nir_cmp_imm-helpers
Erik Faye-Lund [Tue, 6 Jun 2023 11:56:18 +0000 (13:56 +0200)]
nir: add missed nir_cmp_imm-helpers

Seems I missed these in my previous round, let's fix them up now!

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23461>

16 months agonir: add and use nir_imod_imm
Erik Faye-Lund [Mon, 5 Jun 2023 13:31:47 +0000 (15:31 +0200)]
nir: add and use nir_imod_imm

Just a short-hand, really. Makes the code a bit easier to read.

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

16 months agonir: add and use nir_fdiv_imm
Erik Faye-Lund [Mon, 5 Jun 2023 13:15:21 +0000 (15:15 +0200)]
nir: add and use nir_fdiv_imm

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23461>

16 months agonir: use nir_imm_{true,false}
Erik Faye-Lund [Mon, 5 Jun 2023 12:54:54 +0000 (14:54 +0200)]
nir: use nir_imm_{true,false}

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23461>

16 months agonir: isub -> iadd_imm
Erik Faye-Lund [Mon, 5 Jun 2023 10:41:14 +0000 (12:41 +0200)]
nir: isub -> iadd_imm

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23461>

16 months agonir: use more imm-helpers
Erik Faye-Lund [Mon, 5 Jun 2023 10:36:39 +0000 (12:36 +0200)]
nir: use more imm-helpers

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23461>

16 months agomesa/st: use nir_imm_vec4
Erik Faye-Lund [Mon, 5 Jun 2023 10:20:36 +0000 (12:20 +0200)]
mesa/st: use nir_imm_vec4

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23461>

16 months agoiris: Don't use STREAMING_LOAD without SSE
Alyssa Rosenzweig [Mon, 12 Jun 2023 22:00:39 +0000 (18:00 -0400)]
iris: Don't use STREAMING_LOAD without SSE

isl will assert out otherwise. Hit this with intel_stub_gpu on arm64, but it is
a legitimate bug since someone might plug a DG2 card into a workstation-grade
arm64 or ppc64 supporting PCIe (it exists).

This forward ports the logic from crocus, which checks for both SSE at a
compile-time level as well as in the CPU caps. This might be excessive since DG2
cards apparently wouldn't work properly on old non-SSE x86 boxes anyway? I just
crocus-and-pasted.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23608>

16 months agodri3: only invalidate drawables on geometry change if geometry has changed
Mike Blumenkrantz [Wed, 14 Jun 2023 15:34:28 +0000 (11:34 -0400)]
dri3: only invalidate drawables on geometry change if geometry has changed

this is otherwise pointless

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23649>

16 months agonir: use new immediate comparison helpers
Erik Faye-Lund [Fri, 2 Jun 2023 18:12:29 +0000 (20:12 +0200)]
nir: use new immediate comparison helpers

There's plenty of places we can use these new and shiny helpers, so
let's clean up the code a bit.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23460>

16 months agonir: add nir_[fui]gt_imm and nir_[fui]le_imm helpers
Erik Faye-Lund [Mon, 5 Jun 2023 08:19:58 +0000 (10:19 +0200)]
nir: add nir_[fui]gt_imm and nir_[fui]le_imm helpers

These are similar to the nir_{cmp}_imm variants we already have, except
they negate the condition (apart from equality) and flip the arguments.
The reason we need this, is that we don't have all comparison directions
that would be required to always pass the immediate in the second
argument.

This allows us to create any comparison with an immediate without
having to manually create the immediate value.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23460>

16 months agoac: fix PIPE_FORMAT_R11G11B10_FLOAT DST_SEL_W
Rhys Perry [Wed, 14 Jun 2023 11:14:19 +0000 (12:14 +0100)]
ac: fix PIPE_FORMAT_R11G11B10_FLOAT DST_SEL_W

Previously, the W component would be incorrect for attributes using this
format when loaded in RADV's vertex shader prologs.

Fixes dEQP-VK.pipeline.fast_linked_library.vertex_input.*b10g11r11*missing_components*

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 6a2ada93b49 ("ac: add ac_vtx_format_info")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23645>

16 months agopvr: fix division by block size in blit
Luigi Santivetti [Mon, 5 Jun 2023 22:34:12 +0000 (23:34 +0100)]
pvr: fix division by block size in blit

dEQP-VK.pipeline.monolithic.image.suballocation.\
 sampling_type.combined.view_type.2d.\
 format.etc2_r8g8b8_unorm_block.count_1.size.13x13

Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23591>

16 months agopvr: Remove outdated finishme
Karmjit Mahil [Tue, 13 Jun 2023 10:46:20 +0000 (11:46 +0100)]
pvr: Remove outdated finishme

The color attachment load is being handled just below the finishme.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23619>

16 months agopvr: Dedup a check with pvr_is_render_area_tile_aligned()
Karmjit Mahil [Fri, 10 Feb 2023 16:00:04 +0000 (16:00 +0000)]
pvr: Dedup a check with pvr_is_render_area_tile_aligned()

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22657>

16 months agor600/sfn: Downgrade some error message to warning
Gert Wollny [Thu, 15 Jun 2023 05:55:45 +0000 (07:55 +0200)]
r600/sfn: Downgrade some error message to warning

This doesn't seem to be an error, so just print a warning when
warnings are enabled.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23665>

16 months agor600/sfn: Silence warnings "overloaded-virtual"
Gert Wollny [Thu, 15 Jun 2023 05:54:27 +0000 (07:54 +0200)]
r600/sfn: Silence warnings "overloaded-virtual"

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23665>

16 months agoradv: reset some dynamic states when the fragment shader stage is unbound
Samuel Pitoiset [Mon, 12 Jun 2023 06:43:34 +0000 (08:43 +0200)]
radv: reset some dynamic states when the fragment shader stage is unbound

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

16 months agoradv: fix re-emitting early_z/late_z when the bound PS changes
Samuel Pitoiset [Mon, 12 Jun 2023 06:37:10 +0000 (08:37 +0200)]
radv: fix re-emitting early_z/late_z when the bound PS changes

This state depends on the fragment shader.

Fixes: d740e283e16 ("radv: implement VK_EXT_attachment_feedback_loop_dynamic_state")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23494>

16 months agoradv: fix re-emitting some dynamic states when the previous FS is NULL
Samuel Pitoiset [Wed, 7 Jun 2023 08:26:38 +0000 (10:26 +0200)]
radv: fix re-emitting some dynamic states when the previous FS is NULL

If the previous FS is NULL, some dynamic states still need to be
re-emitted.

Doesn't fix anything known.

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

16 months agomesa/arbprog: fix compile errors
Christian Gmeiner [Wed, 14 Jun 2023 10:23:39 +0000 (12:23 +0200)]
mesa/arbprog: fix compile errors

When DEBUG_FP is set I see the following compiler errors:

../../src/gitlab_mesa/src/mesa/program/arbprogparse.c: In function '_mesa_parse_arb_fragment_program':
../../src/gitlab_mesa/src/mesa/program/arbprogparse.c:133:4: error: implicit declaration of function '_mesa_print_program'; did you mean '_mesa_parse_arb_program'? [-Werror=implicit-function-declaration]
  133 |    _mesa_print_program(&program->Base);
      |    ^~~~~~~~~~~~~~~~~~~
      |    _mesa_parse_arb_program
../../src/gitlab_mesa/src/mesa/program/arbprogparse.c:133:32: error: 'struct gl_program' has no member named 'Base'
  133 |    _mesa_print_program(&program->Base);
      |                                ^~
cc1: some warnings being treated as errors

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23644>

16 months agoac/nir/ngg: fix ngg_gs_clear_primflags crash
Qiang Yu [Mon, 12 Jun 2023 09:50:50 +0000 (17:50 +0800)]
ac/nir/ngg: fix ngg_gs_clear_primflags crash

We get current_clear_primflag_idx_var==NULL when stream 0 output
number is known, so output_compile_time_known==true. But we also
need this variable when stream 1~3 output number is unknown or
vertex number is less than a primitive's needs.

Fixes: 60ac5dda82e1 ("ac: Add NIR lowering for NGG GS.")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23614>

16 months agozink: strip format list when disabling mutable during image creation
Mike Blumenkrantz [Tue, 13 Jun 2023 15:35:04 +0000 (11:35 -0400)]
zink: strip format list when disabling mutable during image creation

drivers shouldn't be getting a format list if it won't be used

cc: mesa-stable

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

16 months agozink: drop dt checks for mutable format init
Mike Blumenkrantz [Wed, 14 Jun 2023 14:46:01 +0000 (10:46 -0400)]
zink: drop dt checks for mutable format init

these are no longer applicable

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

16 months agozink: add srgb mutable for all resources by default
Mike Blumenkrantz [Wed, 7 Jun 2023 18:37:16 +0000 (14:37 -0400)]
zink: add srgb mutable for all resources by default

this should enable compression on more intermediate fb attachments

it also means that VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT can now be set
on images where ZINK_BIND_MUTABLE is not set, so non-resource APIs need
to check ZINK_BIND_MUTABLE

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

16 months agozink: wrap format mismatch checks for blit/surface
Mike Blumenkrantz [Wed, 14 Jun 2023 12:49:57 +0000 (08:49 -0400)]
zink: wrap format mismatch checks for blit/surface

no functional changes

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

16 months agozink: remove redundant conditional in set_sampler_views
Mike Blumenkrantz [Wed, 7 Jun 2023 21:02:35 +0000 (17:02 -0400)]
zink: remove redundant conditional in set_sampler_views

it's redundant, but it checks a different flag so it consumes cycles

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

16 months agocompiler/types: Use hash table pre-hashed functions for type caching
Caio Oliveira [Fri, 26 May 2023 21:05:28 +0000 (14:05 -0700)]
compiler/types: Use hash table pre-hashed functions for type caching

Calculate the hash outside the critical region, then use that both
for search and insertion.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23280>

16 months agocompiler/types: Tidy up the asserts in get_*_instance functions
Caio Oliveira [Sat, 27 May 2023 00:38:13 +0000 (17:38 -0700)]
compiler/types: Tidy up the asserts in get_*_instance functions

Use the local variable in the assertions, move them out the critical region.
No behavior change.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23279>

16 months agocompiler/types: Be consistent when naming array element/size
Caio Oliveira [Fri, 26 May 2023 20:43:05 +0000 (13:43 -0700)]
compiler/types: Be consistent when naming array element/size

The element type passed is different than the array type and it is not
a "base type" in the glsl_type sense, so pick a name that reflects that.
Also stick to a single name for the array_size.

Just renames, no behavior change.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23279>

16 months agonir_lower_returns: Mark assert-only var as ASSERTED
Jesse Natalie [Tue, 13 Jun 2023 17:04:04 +0000 (10:04 -0700)]
nir_lower_returns: Mark assert-only var as ASSERTED

Fixes: 5d238c0c ("nir_lower_returns: Optimize phis before beginning the pass")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23634>

16 months agoradv/video: restrict the number of IBs on video related queues.
Dave Airlie [Wed, 14 Jun 2023 02:12:48 +0000 (12:12 +1000)]
radv/video: restrict the number of IBs on video related queues.

The hardware gets given a session context from userspace in each
submission, but if the session context changes the hardware wants
a FENCE to be emitted to know it can give up the current session.

IF a test submits interleaved session ctx access and uses a single
vulkan submit the hardware crashes, unless each IB is submitted
in a separate submission so the fence can be sent.

In theory it could be possible to construct a single command buffer
to trigger this so I do think the hardware should be smarter here.

Should this be fixed in the kernel to always emit a fence between
IBs?

Fixes: dEQP-VK.video.decode.h264_interleaved

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

16 months agorusticl: fix UB in CLProp machinery
LingMan [Wed, 14 Jun 2023 07:02:53 +0000 (09:02 +0200)]
rusticl: fix UB in CLProp machinery

Viewing structs as a collection of u8 is not generally sound. Any padding bytes might be
uninitialized and creating an integer from uninitialized memory constitutes producing an invalid
value, which is instant UB.

Since we only copy these bytes around, the fix is to simply work with MaybeUninit<u8>, which can handle uninitialized memory just fine, instead.

See: https://doc.rust-lang.org/reference/behavior-considered-undefined.html
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23652>

16 months agorusticl: drop cl_prop_for_type macro
LingMan [Wed, 14 Jun 2023 02:53:19 +0000 (04:53 +0200)]
rusticl: drop cl_prop_for_type macro

There's no reason to differentiate between primitive types and structs here. `cl_prop_for_struct`
can handle primitive types just fine.
Drop `cl_prop_for_type` and rename the existing `cl_prop_for_struct` to `cl_prop_for_type`.

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

16 months agorusticl: drop CLProp implementation for String
LingMan [Wed, 14 Jun 2023 06:16:40 +0000 (08:16 +0200)]
rusticl: drop CLProp implementation for String

Route the data to the implementation for &str instead. It works just as fine.

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

16 months agorusticl: core: stop using cl_prop from the api module
LingMan [Wed, 14 Jun 2023 05:56:50 +0000 (07:56 +0200)]
rusticl: core: stop using cl_prop from the api module

It's a layering violation and really the wrong tool for the job. Add a new fn to view a given slice
as a &[u8] instead of going though the clprop machinery which creates a new Vec.

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

16 months agosvga: fix compute shader type after ntt
Charmaine Lee [Wed, 14 Jun 2023 05:24:32 +0000 (08:24 +0300)]
svga: fix compute shader type after ntt

Reset compute shader type after ntt.

Fixes: 0ac95418048 ("gallium: Drop PIPE_SHADER_CAP_PREFERRED_IR")

Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23659>

16 months agorusticl: enforce using unsafe blocks in unsafe functions
Karol Herbst [Wed, 14 Jun 2023 21:06:23 +0000 (23:06 +0200)]
rusticl: enforce using unsafe blocks in unsafe functions

Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23660>

16 months agozink: add mem debugging
Mike Blumenkrantz [Tue, 13 Jun 2023 14:58:12 +0000 (10:58 -0400)]
zink: add mem debugging

modeled off turnip's debug infra, this adds debug printing for oom
scenarios

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

16 months agozink: break out vk flag unrolling into util function
Mike Blumenkrantz [Tue, 13 Jun 2023 14:45:38 +0000 (10:45 -0400)]
zink: break out vk flag unrolling into util function

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

16 months agonir/algebraic: Simplify various trivial bfi
Ian Romanick [Tue, 31 Mar 2020 22:37:00 +0000 (15:37 -0700)]
nir/algebraic: Simplify various trivial bfi

These are mostly just obvious patterns that somebody will eventually
want to add.

DG2, Tiger Lake, Ice Lake, Skylake, Broadwell, and Haswell had similar
results (Ice Lake shown)
total instructions in shared programs: 20570033 -> 20570026 (<.01%)
instructions in affected programs: 7363 -> 7356 (-0.10%)
helped: 6 / HURT: 0

total cycles in shared programs: 902118781 -> 902118854 (<.01%)
cycles in affected programs: 419132 -> 419205 (0.02%)
helped: 4 / HURT: 2

DG2, Tiger Lake, Ice Lake, and Skylake had similar results (Ice Lake shown)
Totals:
Instrs: 152819500 -> 152819380 (-0.00%)
Cycles: 15014627187 -> 15014624437 (-0.00%)

Totals from 115 (0.02% of 662497) affected shaders:
Instrs: 28963 -> 28843 (-0.41%)
Cycles: 404582 -> 401832 (-0.68%)

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19968>