platform/upstream/mesa.git
21 months agointel/genxml: re-process with extra whitespace removed
Dylan Baker [Tue, 4 Oct 2022 17:14:21 +0000 (10:14 -0700)]
intel/genxml: re-process with extra whitespace removed

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18955>

21 months agointel/genxml: remove newlines between xml islands
Dylan Baker [Mon, 3 Oct 2022 17:38:02 +0000 (10:38 -0700)]
intel/genxml: remove newlines between xml islands

When we move to using etree to print this it won't have them, so this
minimizes the diff further.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18955>

21 months agointel/genxml: re-process with space before `/>`
Dylan Baker [Tue, 4 Oct 2022 17:13:47 +0000 (10:13 -0700)]
intel/genxml: re-process with space before `/>`

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18955>

21 months agointel/genxml: write a space before the '/>` closing tag
Dylan Baker [Mon, 3 Oct 2022 17:49:09 +0000 (10:49 -0700)]
intel/genxml: write a space before the '/>` closing tag

ElementTree.write will do this, and we want to minimize the diff when we
switch from our own writer to the builtin one.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18955>

21 months agoradeonsi/vcn: enable multi-slice encoding
Ruijing Dong [Thu, 6 Oct 2022 20:45:58 +0000 (16:45 -0400)]
radeonsi/vcn: enable multi-slice encoding

- enable h264 multiple slice encoding
- enable hevc multiple slice encoding
- enable hevc block size config options.
- enable amp, strong_intra_smmothing,
         constrained_intra_pred and deblocking filter
         disable config options for hevc encoding.

Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18992>

21 months agoradeonsi/vcn: enable dbk in avc encoding
Ruijing Dong [Thu, 6 Oct 2022 20:37:47 +0000 (16:37 -0400)]
radeonsi/vcn: enable dbk in avc encoding

enable deblocking filter in avc encoder.

Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18992>

21 months agofrontends/va: add h264 dbk enc parameters
Ruijing Dong [Thu, 6 Oct 2022 20:33:36 +0000 (16:33 -0400)]
frontends/va: add h264 dbk enc parameters

Obtain va h264 dbk enc parameters.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18992>

21 months agogallium/pipe/video: add data struct for dbk in avc encoding.
Ruijing Dong [Thu, 6 Oct 2022 20:26:56 +0000 (16:26 -0400)]
gallium/pipe/video: add data struct for dbk in avc encoding.

add dbk data structure for preparing enabling
avc deblocking filter.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18992>

21 months agoradv: Rework modification detection of the meta cache.
Bas Nieuwenhuizen [Fri, 8 Oct 2021 00:11:19 +0000 (02:11 +0200)]
radv: Rework modification detection of the meta cache.

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

21 months agoradv: Use a VkPipelineCache handle for meta shaders.
Bas Nieuwenhuizen [Thu, 7 Oct 2021 22:39:17 +0000 (00:39 +0200)]
radv: Use a VkPipelineCache handle for meta shaders.

Prep work for using the common vk caches.

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

21 months agoradv: Constify entry_size.
Bas Nieuwenhuizen [Fri, 8 Oct 2021 00:03:06 +0000 (02:03 +0200)]
radv: Constify entry_size.

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

21 months agoradv: use SHA1_DIGEST_LENGTH in the pipeline cache
Samuel Pitoiset [Tue, 11 Oct 2022 09:06:05 +0000 (11:06 +0200)]
radv: use SHA1_DIGEST_LENGTH in the pipeline cache

Instead of a magic value.

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

21 months agoradv: move the disk cache to the vk_physical_device struct
Samuel Pitoiset [Tue, 11 Oct 2022 10:27:20 +0000 (12:27 +0200)]
radv: move the disk cache to the vk_physical_device struct

To be able to use it from the common pipeline cache implementation.

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

21 months agoradv: Remove create_accel_build_shader
Konstantin Seurer [Sun, 9 Oct 2022 12:46:31 +0000 (14:46 +0200)]
radv: Remove create_accel_build_shader

Unused since every kernel is written in GLSL now.

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

21 months agozink: handle global and scratch vars
Mike Blumenkrantz [Wed, 12 Oct 2022 01:53:49 +0000 (21:53 -0400)]
zink: handle global and scratch vars

also delete cs pushconst since that was for clover and I don't care anymore

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

21 months agozink: add some bda handling
Mike Blumenkrantz [Wed, 12 Oct 2022 01:55:16 +0000 (21:55 -0400)]
zink: add some bda handling

will be useful in the near future

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

21 months agozink: add a safety assert in descriptor updates
Mike Blumenkrantz [Tue, 11 Oct 2022 20:24:51 +0000 (16:24 -0400)]
zink: add a safety assert in descriptor updates

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

21 months agozink: move descriptor layout/pool stuff to screen object
Mike Blumenkrantz [Tue, 11 Oct 2022 20:34:27 +0000 (16:34 -0400)]
zink: move descriptor layout/pool stuff to screen object

this already has locks for async gfx precompiles, but compute shaders
can be compiled on one context and bound on another, which means
all the descriptor stuff they allocate has to be portable:
specifically the pool key ids MUST match across contexts

this is trivially achieved by making pool keys into screen objects

fixes #7434

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

21 months agodocs: update calendar and link releases notes for 22.2.1
Dylan Baker [Tue, 11 Oct 2022 20:49:07 +0000 (13:49 -0700)]
docs: update calendar and link releases notes for 22.2.1

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

21 months agodocs: Add sha256 sum for 22.2.1
Dylan Baker [Tue, 11 Oct 2022 19:09:25 +0000 (12:09 -0700)]
docs: Add sha256 sum for 22.2.1

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

21 months agodocs: add release notes for 22.2.1
Dylan Baker [Tue, 11 Oct 2022 18:53:31 +0000 (11:53 -0700)]
docs: add release notes for 22.2.1

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

21 months agozink: fix isNan mismatch between NIR and SPIR-V
SoroushIMG [Fri, 30 Sep 2022 15:08:27 +0000 (16:08 +0100)]
zink: fix isNan mismatch between NIR and SPIR-V

SPIR-V and Vulkan allow implementations to optimize
float ops assuming inputs are not NaN unless SignedZeroInfNanPreserve
execution mode is enabled.

This means isnan which is turned to nir_op_fneu(a,a) and then emitted
as SpvOpFUnordNotEqual could potentially be optimised to a const 0.

isnan is special in this approach and therefore recognise this pattern,
and emit SpvOpIsNan instead of enabling SignedZeroInfNanPreserve which
will hurt performace of some vulkan drivers.

Fixes dEQP-GL45-ES31.functional.shaders.builtin_functions.common.isnan.*

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18910>

21 months agozink: stop enabling minmax filtering when not supported
SoroushIMG [Thu, 1 Sep 2022 18:40:16 +0000 (19:40 +0100)]
zink: stop enabling minmax filtering when not supported

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18910>

21 months agozink: fix invalid Offset set for variables which do not need an offset
SoroushIMG [Tue, 19 Jul 2022 12:25:02 +0000 (13:25 +0100)]
zink: fix invalid Offset set for variables which do not need an offset

Offset decoration in spirv is unsigned and it does not have a notion of an invalid offset.
Unlike NIR which set -1 for invlaid offset. This translates to invalid spirv being produced.
Instead, just don't emit an Offset decoration.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18910>

21 months agoradv/rra: Calculate bvh size requirements recursively
Konstantin Seurer [Mon, 10 Oct 2022 14:07:08 +0000 (16:07 +0200)]
radv/rra: Calculate bvh size requirements recursively

Gets rid of the assumption, that every internal node has the same size.

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

21 months agoradv/rra: Handle box16 nodes
Konstantin Seurer [Sun, 9 Oct 2022 20:00:17 +0000 (22:00 +0200)]
radv/rra: Handle box16 nodes

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

21 months agoradv: Use half floats for box16 coords
Konstantin Seurer [Sun, 9 Oct 2022 16:30:42 +0000 (18:30 +0200)]
radv: Use half floats for box16 coords

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

21 months agoradv: Add radv_bvh_node_box16
Konstantin Seurer [Sun, 9 Oct 2022 16:24:51 +0000 (18:24 +0200)]
radv: Add radv_bvh_node_box16

Adds the last useful node type. The different triangle types can be
derived by addition.

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

21 months agoradv: Rename node_internal to node_box32
Konstantin Seurer [Sun, 9 Oct 2022 16:21:27 +0000 (18:21 +0200)]
radv: Rename node_internal to node_box32

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

21 months agodraw: s/start_or_maxelt/start/ in llvm VS code
Brian Paul [Fri, 7 Oct 2022 19:24:25 +0000 (13:24 -0600)]
draw: s/start_or_maxelt/start/ in llvm VS code

Per the now removed comment, the maxelt part of start_or_maxelt was
not used.  Rename to start to avoid confusion.

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: move vs_slot var in tgsi/llvm_fetch_gs_input()
Brian Paul [Fri, 7 Oct 2022 19:18:22 +0000 (13:18 -0600)]
draw: move vs_slot var in tgsi/llvm_fetch_gs_input()

Move the decl to where it's first used.  Remove the unneeded increment.

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: fix some const-correctness in draw_vbo()
Brian Paul [Fri, 7 Oct 2022 03:24:56 +0000 (21:24 -0600)]
draw: fix some const-correctness in draw_vbo()

There's no need to cast away const for use_info and draw_info.  There
might have been a reason in the past.

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: make draw_geometry_shader_run() return void
Brian Paul [Thu, 6 Oct 2022 17:08:16 +0000 (11:08 -0600)]
draw: make draw_geometry_shader_run() return void

The return value was always zero and unused.

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: replace double conditional expression with if/else
Brian Paul [Thu, 6 Oct 2022 16:35:18 +0000 (10:35 -0600)]
draw: replace double conditional expression with if/else

This is a bit more verbose, but quicker to grok, IMHO.

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_pt_fetch_shade_pipeline_llvm.c
Brian Paul [Wed, 5 Oct 2022 19:42:12 +0000 (13:42 -0600)]
draw: asst. clean-ups in draw_pt_fetch_shade_pipeline_llvm.c

Also rename vid_base to vertex_id_offset to match code elsewhere.

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_private.h
Brian Paul [Fri, 7 Oct 2022 19:14:15 +0000 (13:14 -0600)]
draw: asst. clean-ups in draw_private.h

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: clean-up count assignment in draw_pt_arrays()
Brian Paul [Thu, 6 Oct 2022 16:36:59 +0000 (10:36 -0600)]
draw: clean-up count assignment in draw_pt_arrays()

count was initialized to draw_info[i].count but then re-assigned a few
lines later.  Remove the original assignment.  Move the var decl.

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_pt.c
Brian Paul [Thu, 6 Oct 2022 16:33:19 +0000 (10:33 -0600)]
draw: asst. clean-ups in draw_pt.c

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_split_tmp.h
Brian Paul [Thu, 6 Oct 2022 03:47:43 +0000 (21:47 -0600)]
draw: asst. clean-ups in draw_split_tmp.h

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_pt_vsplit_tmp.h
Brian Paul [Thu, 6 Oct 2022 03:47:18 +0000 (21:47 -0600)]
draw: asst. clean-ups in draw_pt_vsplit_tmp.h

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_pipe.c
Brian Paul [Thu, 6 Oct 2022 03:47:03 +0000 (21:47 -0600)]
draw: asst. clean-ups in draw_pipe.c

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_prim_assembler.[ch]
Brian Paul [Thu, 6 Oct 2022 03:42:07 +0000 (21:42 -0600)]
draw: asst. clean-ups in draw_prim_assembler.[ch]

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_gs.[ch]
Brian Paul [Thu, 6 Oct 2022 03:38:57 +0000 (21:38 -0600)]
draw: asst. clean-ups in draw_gs.[ch]

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_cliptest_tmp.h
Brian Paul [Thu, 6 Oct 2022 03:31:54 +0000 (21:31 -0600)]
draw: asst. clean-ups in draw_cliptest_tmp.h

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_llvm.c
Brian Paul [Thu, 6 Oct 2022 03:26:12 +0000 (21:26 -0600)]
draw: asst. clean-ups in draw_llvm.c

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_pipe_aapoint.c
Brian Paul [Thu, 6 Oct 2022 03:16:47 +0000 (21:16 -0600)]
draw: asst. clean-ups in draw_pipe_aapoint.c

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_pt_so_emit.c
Brian Paul [Thu, 6 Oct 2022 03:14:31 +0000 (21:14 -0600)]
draw: asst. clean-ups in draw_pt_so_emit.c

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_vertex.[ch]
Brian Paul [Thu, 6 Oct 2022 03:09:32 +0000 (21:09 -0600)]
draw: asst. clean-ups in draw_vertex.[ch]

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_pipe_wide_point.c
Brian Paul [Thu, 6 Oct 2022 03:08:28 +0000 (21:08 -0600)]
draw: asst. clean-ups in draw_pipe_wide_point.c

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_pipe_wide_line.c
Brian Paul [Thu, 6 Oct 2022 03:06:54 +0000 (21:06 -0600)]
draw: asst. clean-ups in draw_pipe_wide_line.c

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_pipe_util.c
Brian Paul [Thu, 6 Oct 2022 03:05:08 +0000 (21:05 -0600)]
draw: asst. clean-ups in draw_pipe_util.c

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_pipe_user_cull.c
Brian Paul [Thu, 6 Oct 2022 03:03:39 +0000 (21:03 -0600)]
draw: asst. clean-ups in draw_pipe_user_cull.c

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_pipe_unfilled.c
Brian Paul [Thu, 6 Oct 2022 03:02:20 +0000 (21:02 -0600)]
draw: asst. clean-ups in draw_pipe_unfilled.c

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_pipe_twoside.c
Brian Paul [Thu, 6 Oct 2022 03:00:15 +0000 (21:00 -0600)]
draw: asst. clean-ups in draw_pipe_twoside.c

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_pipe_pstipple.c
Brian Paul [Thu, 6 Oct 2022 02:58:23 +0000 (20:58 -0600)]
draw: asst. clean-ups in draw_pipe_pstipple.c

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_pipe_offset.c
Brian Paul [Thu, 6 Oct 2022 02:56:24 +0000 (20:56 -0600)]
draw: asst. clean-ups in draw_pipe_offset.c

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_pipe_flatshade.c
Brian Paul [Thu, 6 Oct 2022 02:56:15 +0000 (20:56 -0600)]
draw: asst. clean-ups in draw_pipe_flatshade.c

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_pipe_clip.c
Brian Paul [Thu, 6 Oct 2022 02:52:17 +0000 (20:52 -0600)]
draw: asst. clean-ups in draw_pipe_clip.c

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_pipe_cull.c
Brian Paul [Thu, 6 Oct 2022 02:43:42 +0000 (20:43 -0600)]
draw: asst. clean-ups in draw_pipe_cull.c

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_pt_post_vs.c
Brian Paul [Thu, 6 Oct 2022 02:40:57 +0000 (20:40 -0600)]
draw: asst. clean-ups in draw_pt_post_vs.c

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_pt_fetch.c
Brian Paul [Thu, 6 Oct 2022 02:37:13 +0000 (20:37 -0600)]
draw: asst. clean-ups in draw_pt_fetch.c

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_pipe.h
Brian Paul [Thu, 6 Oct 2022 02:34:29 +0000 (20:34 -0600)]
draw: asst. clean-ups in draw_pipe.h

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: remove unused draw_has_llvm()
Brian Paul [Wed, 5 Oct 2022 18:13:16 +0000 (12:13 -0600)]
draw: remove unused draw_has_llvm()

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: remove goto in llvm_pipeline_generic()
Brian Paul [Wed, 5 Oct 2022 16:06:23 +0000 (10:06 -0600)]
draw: remove goto in llvm_pipeline_generic()

Just use an else clause.

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_vs.[ch]
Brian Paul [Thu, 6 Oct 2022 02:31:38 +0000 (20:31 -0600)]
draw: asst. clean-ups in draw_vs.[ch]

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_vs_variant.c
Brian Paul [Wed, 5 Oct 2022 19:48:21 +0000 (13:48 -0600)]
draw: asst. clean-ups in draw_vs_variant.c

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_vs_llvm.c
Brian Paul [Wed, 5 Oct 2022 18:13:42 +0000 (12:13 -0600)]
draw: asst. clean-ups in draw_vs_llvm.c

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agodraw: asst. clean-ups in draw_context.[ch]
Brian Paul [Wed, 5 Oct 2022 18:23:06 +0000 (12:23 -0600)]
draw: asst. clean-ups in draw_context.[ch]

Fix whitespace/formatting for consistency.  Move var decls to where
they're first used, etc.

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>

21 months agoradv: Consider inactive internal nodes never in the tree.
Bas Nieuwenhuizen [Tue, 11 Oct 2022 10:51:05 +0000 (12:51 +0200)]
radv: Consider inactive internal nodes never in the tree.

Since the parent doesn't know to signal it.

Fixes: e83e4fafc84 ("radv: Only emit parents from parents that actually end up in the tree.")
Reviewed-By: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19033>

21 months agoturnip: Add perf debug for more UBWC-disable cases that we could support.
Emma Anholt [Thu, 6 Oct 2022 19:01:03 +0000 (12:01 -0700)]
turnip: Add perf debug for more UBWC-disable cases that we could support.

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

21 months agoturnip: Add perf_debug for UBWC being disabled due to mutable formats.
Emma Anholt [Wed, 31 Aug 2022 19:23:43 +0000 (12:23 -0700)]
turnip: Add perf_debug for UBWC being disabled due to mutable formats.

I suspect this is going to be a popular perf issue for zink and angle.  I
keep having to print out format lists for debug.

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

21 months agoturnip: Move the ubwc_possible check before mutable formats.
Emma Anholt [Thu, 6 Oct 2022 17:42:22 +0000 (10:42 -0700)]
turnip: Move the ubwc_possible check before mutable formats.

I'm going to add some perf debug about mutable formats, and I don't want
to warn when UBWC would be impossible anyway.

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

21 months agoturnip: Add a perf_debug for feedback-related performance traps.
Emma Anholt [Mon, 3 Oct 2022 22:50:33 +0000 (15:50 -0700)]
turnip: Add a perf_debug for feedback-related performance traps.

This can show up in layering drivers.

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

21 months agozink: Decorate mediump outputs as RelaxedPrecision.
Emma Anholt [Tue, 4 Oct 2022 21:00:07 +0000 (14:00 -0700)]
zink: Decorate mediump outputs as RelaxedPrecision.

The NIR lowering for mediump can sometimes detect stores of 16-bit values
and demote the outputs, but even better is to have them decorated properly
in the first place.  Fixes a bunch of full-precision outputs in gfxbench
Aztec Ruins.

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

21 months agozink: Fix RelaxedPrecision decoration of texture samples.
Emma Anholt [Tue, 20 Sep 2022 21:55:19 +0000 (14:55 -0700)]
zink: Fix RelaxedPrecision decoration of texture samples.

You can't do it unless GL called the sampler mediump.  Also, the spirv
says "For image-sampling operations, decorations can appear on both the
sampling instruction and the image variable being sampled.  If either is
decorated, they both should be decorated, and if both are decorated their
decorations must match. If only one is decorated, the sampling instruction
can behave either as if both were decorated or neither were decorated." so
emit it on the declaration too.

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

21 months agoci/zink: Add some more flakes for turnip.
Emma Anholt [Wed, 5 Oct 2022 18:23:58 +0000 (11:23 -0700)]
ci/zink: Add some more flakes for turnip.

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

21 months agoradv: Implement pipeline-wide skiptriangles/skipaabbs.
Bas Nieuwenhuizen [Tue, 11 Oct 2022 01:12:15 +0000 (03:12 +0200)]
radv: Implement pipeline-wide skiptriangles/skipaabbs.

Reviewed-By: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19030>

21 months agoradv: always re-emit patch control points when a pipeline with tess is bound
Samuel Pitoiset [Mon, 10 Oct 2022 15:16:09 +0000 (17:16 +0200)]
radv: always re-emit patch control points when a pipeline with tess is bound

We already re-emit this state when it's static. It could be dirtied
conditionally but the number of parameters to check is not worth it.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7457
Fixes: eef1511437a ("radv: implement dynamic patch control points")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19021>

21 months agozink: add ZINK_DEBUG=shaderdb
Mike Blumenkrantz [Wed, 5 Oct 2022 15:57:39 +0000 (11:57 -0400)]
zink: add ZINK_DEBUG=shaderdb

this should enable shader-db support with zink

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

21 months agozink: implement async gfx precompile
Mike Blumenkrantz [Thu, 22 Sep 2022 20:42:19 +0000 (16:42 -0400)]
zink: implement async gfx precompile

the pipe_context::link_shader hook is called when shaders are
linked into a program by the application

by leveraging this, it becomes possible to utilize the existing
graphics pipeline library to implement precompilation
by creating a partial pipeline containing only the shader stages
and then adding in the vertex input and fragment output stages
dynamically using the fast-link feature

if all goes well, and if the vulkan driver's fast-linking is
truly fast, the full pipeline should be dynamically combined
in time to avoid stuttering, and an optimized variant will be
queued for async compile to be used the next time the pipeline
triggers a draw

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

21 months agozink: change zink_gfx_program::last_pipeline -> struct zink_gfx_pipeline_cache_entry
Mike Blumenkrantz [Sun, 2 Oct 2022 12:13:45 +0000 (08:13 -0400)]
zink: change zink_gfx_program::last_pipeline -> struct zink_gfx_pipeline_cache_entry

this ensures that the latest version of the pipeline pointer in the cache
entry will always be used

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

21 months agozink: gfx_pipeline_cache_entry -> zink_gfx_pipeline_cache_entry
Mike Blumenkrantz [Sun, 2 Oct 2022 12:11:30 +0000 (08:11 -0400)]
zink: gfx_pipeline_cache_entry -> zink_gfx_pipeline_cache_entry

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

21 months agozink: allow creating full pipelines unoptimized
Mike Blumenkrantz [Fri, 23 Sep 2022 16:26:27 +0000 (12:26 -0400)]
zink: allow creating full pipelines unoptimized

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

21 months agoanv: toggle on EXT_extended_dynamic_state3
Tapani Pälli [Sun, 4 Sep 2022 16:38:10 +0000 (19:38 +0300)]
anv: toggle on EXT_extended_dynamic_state3

This enabled the extension and toggles on supported features.

v2: set false to non-supported features (Lionel)
    add dynamic sample mask (Tapani)

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

21 months agoanv: dynamic multisample sample mask
Tapani Pälli [Fri, 30 Sep 2022 05:11:26 +0000 (08:11 +0300)]
anv: dynamic multisample sample mask

This affects following packets:

  3DSTATE_SAMPLE_MASK

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

21 months agoanv: dynamic color blend equation
Tapani Pälli [Thu, 29 Sep 2022 14:15:06 +0000 (17:15 +0300)]
anv: dynamic color blend equation

This affects following packets:

  BLEND_STATE_ENTRY
  3DSTATE_PS_BLEND

v2: move vk_to_intel_blend and vk_to_intel_blend_op,
    remove ps_blend merge (Lionel)

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

21 months agoanv: dynamic color write mask
Tapani Pälli [Sun, 4 Sep 2022 16:32:15 +0000 (19:32 +0300)]
anv: dynamic color write mask

This affects following packets:

  3DSTATE_BLEND_STATE_POINTERS

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

21 months agoanv: dynamic provoking vertex mode
Tapani Pälli [Sun, 4 Sep 2022 16:31:09 +0000 (19:31 +0300)]
anv: dynamic provoking vertex mode

This affects following packets:

  3DSTATE_CLIP
  3DSTATE_SF
  3DSTATE_STREAMOUT

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

21 months agoanv: dynamic states for depth clip and clamp
Tapani Pälli [Fri, 30 Sep 2022 04:45:54 +0000 (07:45 +0300)]
anv: dynamic states for depth clip and clamp

This change implements 3 states in one go:

  - depth clamp enable
  - depth clip enable
  - depth clip negative one to one

This affects following packets:

  3DSTATE_CLIP
  3DSTATE_VIEWPORT_STATE_POINTERS_CC
  3DSTATE_RASTER

v2: remove clip enable bit check from viewport emit (Lionel)
v3: use helper function from runtime to get depth clip (Lionel)

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

21 months agoanv: dynamic alpha to one enable
Tapani Pälli [Sun, 4 Sep 2022 16:16:17 +0000 (19:16 +0300)]
anv: dynamic alpha to one enable

This affects following packets:

  BLEND_STATE

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

21 months agoanv: dynamic state for logic op enable
Tapani Pälli [Sun, 4 Sep 2022 16:14:40 +0000 (19:14 +0300)]
anv: dynamic state for logic op enable

This affects following packets:

  3DSTATE_PS_BLEND
  3DSTATE_BLEND_STATE_POINTERS

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

21 months agoanv: dynamic line rasterization mode
Tapani Pälli [Sun, 4 Sep 2022 16:12:21 +0000 (19:12 +0300)]
anv: dynamic line rasterization mode

This affects following packets:

  3DSTATE_RASTER

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

21 months agoanv: dynamic line stipple enable
Tapani Pälli [Sun, 4 Sep 2022 16:05:44 +0000 (19:05 +0300)]
anv: dynamic line stipple enable

This affects following packets:

  3DSTATE_WM

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

21 months agoanv: dynamic rasterization stream
Tapani Pälli [Sun, 4 Sep 2022 16:03:41 +0000 (19:03 +0300)]
anv: dynamic rasterization stream

This affects following packets:

  3DSTATE_STREAMOUT

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

21 months agoanv: dynamic state for tessellation domain origin
Tapani Pälli [Tue, 27 Sep 2022 16:20:25 +0000 (19:20 +0300)]
anv: dynamic state for tessellation domain origin

This affects following packets:

  3DSTATE_TE

v2: remove render target check, move cmd_emit_te and
    stop merging it, cleanups (Lionel)

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

21 months agoanv: dynamic state for polygon mode
Tapani Pälli [Sun, 4 Sep 2022 15:59:22 +0000 (18:59 +0300)]
anv: dynamic state for polygon mode

Remove 'polygon_mode' from pipeline and read it from
dynamic state instead.

This affects following packets:

  3DSTATE_CLIP
  3DSTATE_RASTER

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

21 months agoac/nir/tess: Remove jump from tess factor writes.
Timur Kristóf [Mon, 15 Aug 2022 11:22:15 +0000 (13:22 +0200)]
ac/nir/tess: Remove jump from tess factor writes.

When the output patch size <= 32 we can be sure regardless
of wave size that each wave will take this branch, therefore
the jump can be removed.

Fossil DB stats on Navi 21:

Totals from 1385 (1.03% of 134906) affected shaders:
CodeSize: 2664436 -> 2658896 (-0.21%)
Instrs: 488618 -> 487233 (-0.28%)
Latency: 2290157 -> 2289199 (-0.04%)
InvThroughput: 898658 -> 898364 (-0.03%)
Branches: 6554 -> 5169 (-21.13%)

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-By: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17921>

21 months agoac/nir/ngg: Remove jumps from some branches where we know LGKMCNT==0.
Timur Kristóf [Sat, 6 Aug 2022 05:37:47 +0000 (07:37 +0200)]
ac/nir/ngg: Remove jumps from some branches where we know LGKMCNT==0.

The GPU can skip LDS instructions when LGKMCNT==0, and for these
branches this should be always faster than a jump.

Fossil DB stats on Navi 21:

Totals from 60918 (45.16% of 134906) affected shaders:
CodeSize: 158624792 -> 157893776 (-0.46%)
Instrs: 30234254 -> 30051500 (-0.60%)
Latency: 139521675 -> 139434597 (-0.06%); split: -0.06%, +0.00%
InvThroughput: 21184146 -> 21183653 (-0.00%); split: -0.00%, +0.00%
Branches: 1115134 -> 932380 (-16.39%)

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-By: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17921>

21 months agoaco: Allow explicitly removing jumps on GFX10+ when beneficial.
Timur Kristóf [Wed, 23 Feb 2022 09:13:54 +0000 (10:13 +0100)]
aco: Allow explicitly removing jumps on GFX10+ when beneficial.

"Removing jumps" in ACO means skipping the jump instruction
at the beginning of a divergent branch (but still modify exec).

ACO already supports implicitly removing jumps when it decides
that executing a branch with empty exec mask is more beneficial
than a jump.

This commit adds the possibility to use this explicitly
through nir_selection_control. ACO will respect this
setting and remove the branch instructions when this is specified,
unless it decides that this would cause bugs (eg. exp instruction).

There are two cases that benefit from the new change:

1. When the application requests to "flatten" a branch (ie.
remove control flow), we now respect that.
2. When the compiler stack determines that a divergent branch
is always taken.

v2 by Georg Lehmann: fixed applying sel_ctrl to else blocks

Fossil DB stats on Navi 21:

Totals from 13 (0.01% of 134906) affected shaders:
CodeSize: 136616 -> 136496 (-0.09%)
Instrs: 26196 -> 26166 (-0.11%)
Latency: 417928 -> 417889 (-0.01%)
Branches: 1241 -> 1211 (-2.42%)

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-By: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17921>

21 months agonir: Print nir_selection_control_divergent_always_taken.
Georg Lehmann [Mon, 10 Oct 2022 08:44:35 +0000 (10:44 +0200)]
nir: Print nir_selection_control_divergent_always_taken.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17921>