platform/upstream/mesa.git
19 months agolavapipe: add a ref for the tess_ccw nir on creation
Mike Blumenkrantz [Tue, 7 Mar 2023 16:58:31 +0000 (11:58 -0500)]
lavapipe: add a ref for the tess_ccw nir on creation

not sure if it matters but good to be consistent

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

19 months agolavapipe: refactor pipeline destroy a bit
Mike Blumenkrantz [Tue, 7 Mar 2023 15:15:56 +0000 (10:15 -0500)]
lavapipe: refactor pipeline destroy a bit

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

19 months agolavapipe: delete unused struct member
Mike Blumenkrantz [Mon, 6 Mar 2023 22:30:36 +0000 (17:30 -0500)]
lavapipe: delete unused struct member

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

19 months agolavapipe: break out all the important parts of gfx pipeline setting for reuse
Mike Blumenkrantz [Mon, 6 Mar 2023 22:19:07 +0000 (17:19 -0500)]
lavapipe: break out all the important parts of gfx pipeline setting for reuse

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

19 months agolavapipe: pull out dynamic tess origin check in gfx pipeline bind
Mike Blumenkrantz [Mon, 6 Mar 2023 22:10:21 +0000 (17:10 -0500)]
lavapipe: pull out dynamic tess origin check in gfx pipeline bind

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

19 months agolavapipe: don't access pipeline shader structs as much during bind
Mike Blumenkrantz [Mon, 6 Mar 2023 22:07:28 +0000 (17:07 -0500)]
lavapipe: don't access pipeline shader structs as much during bind

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

19 months agolavapipe: PIPE_SHADER_ -> MESA_SHADER_
Mike Blumenkrantz [Mon, 6 Mar 2023 22:05:02 +0000 (17:05 -0500)]
lavapipe: PIPE_SHADER_ -> MESA_SHADER_

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

19 months agolavapipe: merge some loops in handle_graphics_pipeline()
Mike Blumenkrantz [Mon, 6 Mar 2023 22:01:13 +0000 (17:01 -0500)]
lavapipe: merge some loops in handle_graphics_pipeline()

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

19 months agolavapipe: refactor compute shader binding
Mike Blumenkrantz [Mon, 6 Mar 2023 21:50:53 +0000 (16:50 -0500)]
lavapipe: refactor compute shader binding

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

19 months agolavapipe: stop using rendering_state::pipeline
Mike Blumenkrantz [Mon, 6 Mar 2023 21:46:32 +0000 (16:46 -0500)]
lavapipe: stop using rendering_state::pipeline

access shaders directly now

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

19 months agolavapipe: add a device member to rendering_state
Mike Blumenkrantz [Mon, 6 Mar 2023 21:46:03 +0000 (16:46 -0500)]
lavapipe: add a device member to rendering_state

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

19 months agolavapipe: track bound shader stages on rendering_state
Mike Blumenkrantz [Mon, 6 Mar 2023 21:45:36 +0000 (16:45 -0500)]
lavapipe: track bound shader stages on rendering_state

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

19 months agolavapipe: refactor shader compile functions to not take pipeline params
Mike Blumenkrantz [Mon, 6 Mar 2023 21:44:30 +0000 (16:44 -0500)]
lavapipe: refactor shader compile functions to not take pipeline params

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

19 months agolavapipe: don't memcpy tess_ccw when copying pipeline library shaders
Mike Blumenkrantz [Wed, 15 Mar 2023 11:27:12 +0000 (07:27 -0400)]
lavapipe: don't memcpy tess_ccw when copying pipeline library shaders

this gets handled later

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

19 months agolavapipe: always copy streamout info when creating shaders
Mike Blumenkrantz [Mon, 6 Mar 2023 21:28:23 +0000 (16:28 -0500)]
lavapipe: always copy streamout info when creating shaders

llvmpipe should be smart enough to figure this out internally

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

19 months agoci/radeonsi: Skip really slow tests on stoney
Daniel Stone [Tue, 14 Mar 2023 16:01:50 +0000 (16:01 +0000)]
ci/radeonsi: Skip really slow tests on stoney

These allocate way more memory than is reasonable, a bunch of times. I'd
guess they pushed the machine pretty deep into memory pressure which is
why it was all taking like 3 minutes.

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

19 months agoci/radeonsi: sort and dedup stoney skips
Daniel Stone [Tue, 14 Mar 2023 16:00:33 +0000 (16:00 +0000)]
ci/radeonsi: sort and dedup stoney skips

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

19 months agoaco: add tests for neg(mul) with opsel
Georg Lehmann [Sun, 26 Mar 2023 20:38:24 +0000 (22:38 +0200)]
aco: add tests for neg(mul) with opsel

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

19 months agoaco/tests: run optimize.mad_mix.input_conv.modifiers on gfx11
Georg Lehmann [Sun, 26 Mar 2023 20:25:02 +0000 (22:25 +0200)]
aco/tests: run optimize.mad_mix.input_conv.modifiers on gfx11

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

19 months agoaco: add test for min/max combining with opsel
Georg Lehmann [Sun, 26 Mar 2023 20:01:57 +0000 (22:01 +0200)]
aco: add test for min/max combining with opsel

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

19 months agoaco: add tests for cmp ordering with opsel
Georg Lehmann [Sun, 26 Mar 2023 19:31:48 +0000 (21:31 +0200)]
aco: add tests for cmp ordering with opsel

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

19 months agoaco: add tests for swap operand with opsel
Georg Lehmann [Sun, 26 Mar 2023 19:00:55 +0000 (21:00 +0200)]
aco: add tests for swap operand with opsel

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

19 months agoaco: add tests for dpp with opsel
Georg Lehmann [Sun, 26 Mar 2023 18:26:08 +0000 (20:26 +0200)]
aco: add tests for dpp with opsel

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

19 months agoaco: add tests for fma with opsel
Georg Lehmann [Tue, 21 Mar 2023 13:24:28 +0000 (14:24 +0100)]
aco: add tests for fma with opsel

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

19 months agoaco/optimizer: remove to_SDWA
Georg Lehmann [Wed, 22 Mar 2023 18:58:28 +0000 (19:58 +0100)]
aco/optimizer: remove to_SDWA

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

19 months agoaco: keep label_mul/usedef/minmax in apply_extract
Georg Lehmann [Thu, 9 Mar 2023 13:53:34 +0000 (14:53 +0100)]
aco: keep label_mul/usedef/minmax in apply_extract

16bit int mad/fma/minmax combining can work with opsel set.

All other optimizations should already check if the instruction uses sdwa,
because we don't check this when applying the label initially.

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

19 months agoaco/optimizer: use opsel for VOP12C
Georg Lehmann [Tue, 21 Mar 2023 12:29:15 +0000 (13:29 +0100)]
aco/optimizer: use opsel for VOP12C

Foz-DB GFX1100:
Totals from 11759 (8.72% of 134864) affected shaders:
VGPRs: 848288 -> 844556 (-0.44%); split: -0.44%, +0.00%
SpillSGPRs: 8527 -> 8543 (+0.19%)
SpillVGPRs: 1411 -> 1423 (+0.85%); split: -0.21%, +1.06%
CodeSize: 114337120 -> 113882472 (-0.40%); split: -0.40%, +0.01%
Scratch: 128768 -> 129024 (+0.20%); split: -0.20%, +0.40%
MaxWaves: 250962 -> 252014 (+0.42%)
Instrs: 22187426 -> 22062378 (-0.56%); split: -0.57%, +0.00%
Latency: 232655375 -> 232376977 (-0.12%); split: -0.20%, +0.08%
InvThroughput: 28292530 -> 28217699 (-0.26%); split: -0.45%, +0.18%
VClause: 352463 -> 352364 (-0.03%); split: -0.12%, +0.10%
SClause: 659282 -> 659354 (+0.01%); split: -0.02%, +0.04%
Copies: 1371369 -> 1342340 (-2.12%); split: -2.30%, +0.19%
Branches: 495903 -> 495941 (+0.01%); split: -0.00%, +0.01%
PreSGPRs: 867295 -> 863664 (-0.42%)
PreVGPRs: 793480 -> 790549 (-0.37%)

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

19 months agoaco/gfx11: allow opsel for VOP12C
Georg Lehmann [Tue, 21 Mar 2023 12:26:19 +0000 (13:26 +0100)]
aco/gfx11: allow opsel for VOP12C

Foz-DB GFX1100:
Totals from 515 (0.38% of 134864) affected shaders:
CodeSize: 2768228 -> 2761076 (-0.26%)
Instrs: 520301 -> 518523 (-0.34%)
Latency: 5190860 -> 5187254 (-0.07%)
InvThroughput: 2120844 -> 2119447 (-0.07%)
Copies: 57238 -> 56101 (-1.99%)

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

19 months agoaco: don't label mul with opsel as abs/neg
Georg Lehmann [Fri, 24 Mar 2023 12:35:07 +0000 (13:35 +0100)]
aco: don't label mul with opsel as abs/neg

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

19 months agoaco/ir: copy opsel when converting to DPP
Georg Lehmann [Thu, 23 Mar 2023 12:14:05 +0000 (13:14 +0100)]
aco/ir: copy opsel when converting to DPP

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

19 months agoaco: swap opsel when swapping VOP2/C operands
Georg Lehmann [Thu, 23 Mar 2023 12:10:58 +0000 (13:10 +0100)]
aco: swap opsel when swapping VOP2/C operands

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

19 months agoaco: return true in usesModifiers for VOP12C with opsel
Georg Lehmann [Fri, 24 Mar 2023 16:08:56 +0000 (17:08 +0100)]
aco: return true in usesModifiers for VOP12C with opsel

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

19 months agoaco: support neg(mul)/abs(mul) optimization in more cases
Georg Lehmann [Fri, 24 Mar 2023 12:30:01 +0000 (13:30 +0100)]
aco: support neg(mul)/abs(mul) optimization in more cases

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

19 months agoaco: support v_cvt_f32_f16 with opsel in combine_mad_mix
Georg Lehmann [Fri, 24 Mar 2023 10:13:45 +0000 (11:13 +0100)]
aco: support v_cvt_f32_f16 with opsel in combine_mad_mix

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

19 months agoaco: update match_op3_for_vop3 for VOP12C opsel
Georg Lehmann [Wed, 22 Mar 2023 18:31:17 +0000 (19:31 +0100)]
aco: update match_op3_for_vop3 for VOP12C opsel

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

19 months agoaco: handle opsel in combine_constant_comparison_ordering
Georg Lehmann [Tue, 28 Mar 2023 19:48:04 +0000 (21:48 +0200)]
aco: handle opsel in combine_constant_comparison_ordering

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

19 months agoaco: handle opsel in combine_ordering_test
Georg Lehmann [Wed, 22 Mar 2023 18:52:10 +0000 (19:52 +0100)]
aco: handle opsel in combine_ordering_test

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

19 months agoaco: handle opsel in combine_comparison_ordering
Georg Lehmann [Wed, 22 Mar 2023 18:41:21 +0000 (19:41 +0100)]
aco: handle opsel in combine_comparison_ordering

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

19 months agoaco/optimizer: preserve opsel when fusing fma
Georg Lehmann [Tue, 21 Mar 2023 12:19:59 +0000 (13:19 +0100)]
aco/optimizer: preserve opsel when fusing fma

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

19 months agoaco/ra: prepare for VOP12C opsel
Georg Lehmann [Tue, 21 Mar 2023 11:39:26 +0000 (12:39 +0100)]
aco/ra: prepare for VOP12C opsel

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

19 months agoaco/to_hw_instr: use VOP1 opsel for v_mov_b16
Georg Lehmann [Tue, 21 Mar 2023 11:27:28 +0000 (12:27 +0100)]
aco/to_hw_instr: use VOP1 opsel for v_mov_b16

Foz-DB GFX1100:
Totals from 4661 (3.46% of 134864) affected shaders:
CodeSize: 36500568 -> 36391704 (-0.30%)

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

19 months agoaco: validate VOP12C opsel
Georg Lehmann [Tue, 21 Mar 2023 11:07:51 +0000 (12:07 +0100)]
aco: validate VOP12C opsel

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

19 months agoaco/assembler: support VOP12C opsel
Georg Lehmann [Tue, 21 Mar 2023 10:54:33 +0000 (11:54 +0100)]
aco/assembler: support VOP12C opsel

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

19 months agoaco/vn: hash opsel for VOP12C
Georg Lehmann [Wed, 22 Mar 2023 10:32:04 +0000 (11:32 +0100)]
aco/vn: hash opsel for VOP12C

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

19 months agoaco/ra: don't reallocate VOP3 instruction for non-vcc lane mask
Georg Lehmann [Wed, 29 Mar 2023 15:59:15 +0000 (17:59 +0200)]
aco/ra: don't reallocate VOP3 instruction for non-vcc lane mask

This would need to copy opsel soon but we can just reuse the old instruction.

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

19 months agoaco: Un-swap addressable VGPRs/SGPRs in RT prolog
Friedrich Vock [Wed, 29 Mar 2023 14:51:24 +0000 (16:51 +0200)]
aco: Un-swap addressable VGPRs/SGPRs in RT prolog

Fixes: 6446b791681 ("aco: implement select_rt_prolog()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22188>

19 months agoradv/rt: Also adjust the SGPR count in postprocess_rt_config
Friedrich Vock [Wed, 29 Mar 2023 14:04:54 +0000 (16:04 +0200)]
radv/rt: Also adjust the SGPR count in postprocess_rt_config

Fixes: bea022d1f6a ("radv/rt: Add shader config combination/postprocessing utils")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22188>

19 months agoperfetto: Move intel's cmdbuf/queue annotation code to the shared util.
Emma Anholt [Thu, 16 Mar 2023 22:46:46 +0000 (15:46 -0700)]
perfetto: Move intel's cmdbuf/queue annotation code to the shared util.

This will let other drivers use the same way of presenting annotations
without duplicating the whole hash table thing.

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

19 months agoperfetto: Deduplicate clock sync packet emit from renderstage sources.
Emma Anholt [Thu, 16 Mar 2023 20:21:44 +0000 (13:21 -0700)]
perfetto: Deduplicate clock sync packet emit from renderstage sources.

This is way more horrifying than I hoped -- I can't figure out a way to
have the method be on TraceContext, so it's a static method of the
datasource, but then you have to name the templated types over and over.
You have to pass in a TraceContext because intel emits the clock sync
packet within a Trace(), and perfetto just silently corrupts the trace if
you Trace() in a Trace().

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

19 months agoperfetto: Make a MesaRenderpassDataSource with common setup/start/stop.
Emma Anholt [Thu, 16 Mar 2023 18:44:27 +0000 (11:44 -0700)]
perfetto: Make a MesaRenderpassDataSource with common setup/start/stop.

Deduplicates some code from intel/tu/freedreno, and will be a common place
to put other shared code.

The downside I can see is this logging:

[013.129]      tu_perfetto.cc:122 Tracing started
[013.129]  intel_driver_ds.cc:133 Tracing started

("oh, huh, apparently data sources for both drivers are registered?  wild")

becomes:

[142.906] erfetto_renderpass.h:50 Tracing started
[142.907] erfetto_renderpass.h:50 Tracing started

("huh, why is my driver's data source being started twice?").
Unfortunately we can't easily get a string for the data source type due to
not having rtti.

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

19 months agointel/perfetto: Drop unused "pipelined" field.
Emma Anholt [Mon, 27 Mar 2023 22:01:51 +0000 (15:01 -0700)]
intel/perfetto: Drop unused "pipelined" field.

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

19 months agoperfetto: Add a .clang-format for the directory.
Emma Anholt [Fri, 24 Mar 2023 00:33:13 +0000 (17:33 -0700)]
perfetto: Add a .clang-format for the directory.

I was frustrated trying to write code and not be able to just mash ^K^F to
format what I'd written.  This .clang-format is just cargo-cult of turnip
with a few tweaks to reduce the diff to the current directory contents.
The remaining deltas in the reformat look decent to me, and mostly bring
things closer to mesa-vague-consensus style.

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

19 months agoanv: Add assert in functions not supported by Xe kmd
José Roberto de Souza [Tue, 23 Aug 2022 17:50:59 +0000 (10:50 -0700)]
anv: Add assert in functions not supported by Xe kmd

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

19 months agoanv: Disable anv_bo_sync_type for Xe kmd
José Roberto de Souza [Thu, 15 Sep 2022 13:46:23 +0000 (06:46 -0700)]
anv: Disable anv_bo_sync_type for Xe kmd

anv_bo_sync_type is only supported with i915, if necessary it will be
implemented for Xe kmd.

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

19 months agoanv: Implement Xe version of anv_queue_exec_locked() and queue_exec_trace()
José Roberto de Souza [Fri, 10 Feb 2023 16:00:16 +0000 (08:00 -0800)]
anv: Implement Xe version of anv_queue_exec_locked() and queue_exec_trace()

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

19 months agoanv: Move to a function code to clflush batch buffers
José Roberto de Souza [Wed, 29 Mar 2023 16:08:33 +0000 (09:08 -0700)]
anv: Move to a function code to clflush batch buffers

This also need to be executed in Xe kmd, so moving it to a function.
No changes in behavior intended here.

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

19 months agoutil/disk_cache: use posix_fallocate() for index files
Juston Li [Thu, 23 Mar 2023 20:06:55 +0000 (13:06 -0700)]
util/disk_cache: use posix_fallocate() for index files

ftruncate() allocates disk space lazily. If the disk is full and it is
unable to allocate disk space when accesed via mmap(), it will crash
with a SIGBUS.

Switch to posix_fallocate(), which ensures disk space is allocated
otherwise it fails if there isn't enough disk space. The disk cache
won't be enabled in this case.

For normal cases, a small increase in disk usage as the 1.3MB index
file will be fully allocated when initialized now.

fallback to ftruncate() if posix_fallocate() isn't found.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22097>

19 months agoanv: hash immutable sampler conversion data not pointers
Lionel Landwerlin [Tue, 28 Mar 2023 09:52:21 +0000 (12:52 +0300)]
anv: hash immutable sampler conversion data not pointers

The conversion pointer has a vk_object_base containing pointers.

Previous commits had a similar issue, storing an internal pointer to
the array of formats in anv_format.c

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22160>

19 months agonir/algebraic: Undistribute fsat from fmax
Ian Romanick [Thu, 23 Mar 2023 23:01:13 +0000 (16:01 -0700)]
nir/algebraic: Undistribute fsat from fmax

To be helpful, the thing inside the fsat has to be used with and without
the fsat. Otherwise it just moves a saturate destination modifier
around. To not be harmful, the fsat has to only be used by the bcsel.

All Broadwell and newer Intel platforms had similar results. (Ice Lake shown)
total instructions in shared programs: 20174475 -> 20174449 (<.01%)
instructions in affected programs: 3913 -> 3887 (-0.66%)
helped: 13 / HURT: 0

total cycles in shared programs: 866844832 -> 866844719 (<.01%)
cycles in affected programs: 46037 -> 45924 (-0.25%)
helped: 10 / HURT: 1

All Intel platforms had similar results. (Ice Lake shown)
Instructions in all programs: 161491468 -> 161491372 (-0.0%)
helped: 31 / HURT: 8

Cycles in all programs: 10933090736 -> 10933024716 (-0.0%)
helped: 32 / HURT: 18

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

19 months agointel/fs: Don't copy propagate from saturate to sel
Ian Romanick [Thu, 23 Mar 2023 21:19:29 +0000 (14:19 -0700)]
intel/fs: Don't copy propagate from saturate to sel

There are already NIR algebraic optimizations (see also ac6646129f7
("nir: Move fsat outside of fmin/fmax if second arg is 0 to 1.") that
will try to remove the saturate from things like

    fmax(0.5, fsat(x))

This basically reverts 40aeb558ce8 ("i965/fs: Allow propagation of
instructions with saturate flag to sel"). That commit message had no
shader-db information, so it's unclear whether this actually helped
anything ever.

No shader-db changes on any Intel platform.

One shader in Far Cry New Dawn was affected.

Cycles in all programs: 10933090738 -> 10933090736 (-0.0%)
Cycles helped: 1

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

19 months agoradv: fix setting radv_shader_info::user_data_0 with rt
Rhys Perry [Wed, 29 Mar 2023 13:35:58 +0000 (14:35 +0100)]
radv: fix setting radv_shader_info::user_data_0 with rt

Fixes raytracing pipelines.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 0e81ec98ce9 ("radv: move user_data_0 to the shader info pass")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22187>

19 months agoci/zink: Reduce zink-tu-a618-traces parallelism
Guilherme Gallo [Mon, 27 Mar 2023 22:52:25 +0000 (19:52 -0300)]
ci/zink: Reduce zink-tu-a618-traces parallelism

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

19 months agoci/zink: Fix zink-tu-a618-traces perf job rules
Guilherme Gallo [Mon, 27 Mar 2023 19:17:51 +0000 (16:17 -0300)]
ci/zink: Fix zink-tu-a618-traces perf job rules

The pipeline should create this job only when it is under performance
enabled workflow, represented by the presence of
MESA_CI_PERFORMANCE_ENABLED variable.

For example:
The following pipeline
https://gitlab.freedesktop.org/gallo/mesa/-/pipelines/840525 has
`zink-tu-a618-traces-performance` job, even if it was not triggered by
marge-bot, which means that performance jobs should be disabled.

This job should appear in pipelines with performance jobs enabled
https://gitlab.freedesktop.org/gallo/mesa/-/pipelines/840529

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

19 months agoradeonsi: simplify binning settings to work around GPU hangs
Marek Olšák [Wed, 22 Mar 2023 16:22:59 +0000 (12:22 -0400)]
radeonsi: simplify binning settings to work around GPU hangs

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

19 months agoradeonsi/gfx11: reduce MSAA samples to 8 for no-attachment framebuffer
Marek Olšák [Sun, 19 Mar 2023 21:05:40 +0000 (17:05 -0400)]
radeonsi/gfx11: reduce MSAA samples to 8 for no-attachment framebuffer

EQAA is unsupported

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

19 months agoamd: set the correct LLVM processor name for gfx1036
Marek Olšák [Sun, 19 Mar 2023 20:07:00 +0000 (16:07 -0400)]
amd: set the correct LLVM processor name for gfx1036

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

19 months agoamd: rename GFX1036 -> RAPHAEL_MENDOCINO
Marek Olšák [Sun, 19 Mar 2023 18:52:16 +0000 (14:52 -0400)]
amd: rename GFX1036 -> RAPHAEL_MENDOCINO

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

19 months agoamd: update addrlib
Marek Olšák [Sun, 19 Mar 2023 17:34:44 +0000 (13:34 -0400)]
amd: update addrlib

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

19 months agozink/ci: remove `primitive-id-no-gs-quads` from radv-vangogh-fails
antonino [Mon, 20 Mar 2023 16:43:29 +0000 (17:43 +0100)]
zink/ci: remove `primitive-id-no-gs-quads` from radv-vangogh-fails

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agozink: unbind generated gs in `bind_last_vertex_stage`
antonino [Thu, 9 Mar 2023 15:24:54 +0000 (16:24 +0100)]
zink: unbind generated gs in `bind_last_vertex_stage`

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agozink: improve generated gs unbinding
antonino [Wed, 8 Mar 2023 16:30:10 +0000 (17:30 +0100)]
zink: improve generated gs unbinding

Avoid looping by using the new `parent` field to check if a generaetd gs
is bound and use `bind_gs_state` insted of `bind_gfx_stage` so that
`bind_last_vertex_stage` is automatically called

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agozink: zink: add `parent` to `zink_shader::non_fs`
antonino [Wed, 8 Mar 2023 15:13:47 +0000 (16:13 +0100)]
zink: zink: add `parent` to `zink_shader::non_fs`

For a generated gs this field will store a pointer to the shader that
"owns" it.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agozink: unified `zink_set_primitive_emulation_keys` and `zink_create_primitive_emulatio...
antonino [Wed, 8 Mar 2023 17:25:02 +0000 (18:25 +0100)]
zink: unified `zink_set_primitive_emulation_keys` and `zink_create_primitive_emulation_gs`

Those two functions shared most of the code

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agozink: prevent crash when freeing
antonino [Wed, 22 Feb 2023 16:24:57 +0000 (17:24 +0100)]
zink: prevent crash when freeing

If the same vertex shader is used for more than one pipeline where for some a gs
is generated but not for others then the logic to free pipeline
libraries might use the incorrect stage_mask and try to free a non
existing gs.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agozink: advertise support for the quad primitive
antonino [Mon, 13 Feb 2023 11:50:16 +0000 (12:50 +0100)]
zink: advertise support for the quad primitive

Zink now exposes the `PIPE_PRIM_QUADS` among supported primitives and
handles them with geometry shaders.

Previously, while not exposing this capability, gallium would internally
generate an index buffer to draw them with triangles.

However the information necessary to avoid drawing the diagonal line
when using the line primitive was not preserved.

fails are added for wireframe xfb quads tests

xfb is expected to output tessellatated quads while showing a quad
without a diagonal, however there is no sane way of achieving this.

As part of the test quads will be rendered with and without xfb and the
results compared.

Now to avoid breaking xfb zink has to always split quads into triangles
when xfb is enabled. This means that the test will fail.

Previously the diagonal was always present so the test passed

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agozink: keep xfb properties in quad emulation gs
antonino [Thu, 16 Feb 2023 15:57:02 +0000 (16:57 +0100)]
zink: keep xfb properties in quad emulation gs

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agonir: keep xfb properties in nir_create_passthrough_gs
antonino [Thu, 16 Feb 2023 15:56:40 +0000 (16:56 +0100)]
nir: keep xfb properties in nir_create_passthrough_gs

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agozink: handle provoking vertex mode for filled quads
antonino [Mon, 20 Feb 2023 18:52:50 +0000 (19:52 +0100)]
zink: handle provoking vertex mode for filled quads

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agonir/zink: handle provoking vertex mode in `nir_create_passthrough_gs`
antonino [Mon, 20 Feb 2023 18:49:25 +0000 (19:49 +0100)]
nir/zink: handle provoking vertex mode in `nir_create_passthrough_gs`

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agozink: implement flat shading using inlined uniforms
antonino [Thu, 9 Feb 2023 13:12:43 +0000 (14:12 +0100)]
zink: implement flat shading using inlined uniforms

Zink will now handle flat interpolation correctly when line loops
are generated from primitives.

The flat shading information is passed to the emulation gs using constant
uniforms which get inlined.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agozink: add `needs_inlining` to `zink_shader`
antonino [Tue, 21 Feb 2023 17:03:08 +0000 (18:03 +0100)]
zink: add `needs_inlining` to `zink_shader`

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agozink: add flags to `zink_gfx_program` and `zink_context`
antonino [Tue, 21 Feb 2023 09:29:25 +0000 (10:29 +0100)]
zink: add flags to `zink_gfx_program` and `zink_context`

Adds `optimal_keys` and `needs_inlining` to `zink_gfx_program` and
`is_generated_gs_bound` to `zink_context`

Those will be needed for shaders that rely on some uniforms to be
inlined

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agozink: fix flat shading on filled quads
antonino [Tue, 7 Feb 2023 16:01:52 +0000 (17:01 +0100)]
zink: fix flat shading on filled quads

Quads emulated by zink will now have the correct provoking vertex.

Also outputs of the previous shader stage that would normally
not be passed down to the FS (when no GS is bound) will now be skipped.

Different provoking vertex modes are not handled yet.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agozink: handle quads
antonino [Fri, 3 Feb 2023 17:35:42 +0000 (18:35 +0100)]
zink: handle quads

Zink can now handle the quad primitive by emulating it in a gs

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agozink: add `zink_rast_prim` enum
antonino [Tue, 21 Feb 2023 09:37:57 +0000 (10:37 +0100)]
zink: add `zink_rast_prim` enum

Adds an enum with primitives that are natively by vulkan

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agozink: filled quad emulation gs generation function
antonino [Fri, 3 Feb 2023 17:12:54 +0000 (18:12 +0100)]
zink: filled quad emulation gs generation function

This change adds a function to generate a geometry shader that will take a quad
as an input (passed as a line strip with adjacency because quads are not
available as an input primitives for GS) and generate a triangle strip.

This can be used to emulate the quad primitive.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agozink: force line strip out when emulating stipple
antonino [Fri, 3 Feb 2023 14:43:09 +0000 (15:43 +0100)]
zink: force line strip out when emulating stipple

Fixes a bug where, whenever a primtiive that has more than 2 vertices is rendered
with line stipple, the edge between the first and last vertex will have
stretched out stipple.

This happens because interpolation will occur between two non consecutive
stipple counters for the last edge
(which is between the last and first vertices).

Forcing `nir_create_passthrough_gs` to generate a line strip avoids
this because the last vertex will be duplicated and will have
the correct stipple counter for each edge.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agonir: allow to force line strip out in nir_create_passthrough_gs
antonino [Fri, 3 Feb 2023 14:42:20 +0000 (15:42 +0100)]
nir: allow to force line strip out in nir_create_passthrough_gs

`nir_create_passthrough_gs` now allows the user to force the generated GS
to always output a line strip from the primitive
regardless of whether edgeflags are present.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agozink: handle edgeflags
antonino [Fri, 3 Feb 2023 10:44:39 +0000 (11:44 +0100)]
zink: handle edgeflags

Vulkan has no support for edgeflags.

If the user has a geometry shader bound nothing needs to be done as edgeflags
don't work with them, otherwise a geometry shader that emulates them
is generated.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agozink: add `has_edgeflags` flag to zink_shader and zink_gfx_program
antonino [Tue, 21 Feb 2023 09:27:54 +0000 (10:27 +0100)]
zink: add `has_edgeflags` flag to zink_shader and zink_gfx_program

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agonir: handle edge flags in nir_create_passthrough_gs
antonino [Thu, 2 Feb 2023 16:30:05 +0000 (17:30 +0100)]
nir: handle edge flags in nir_create_passthrough_gs

`nir_create_passthrough_gs` will now take a boolean argument to decide
whether it needs to handle edgeflags.

When true is passed it will output a line strip where edges that
shouldn't be visible are not emitted.

This is usefull because geometry shaders will generally throw away
edgeflags so for a passthrough GS to act transparently it needs to emulate them.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agonir: calculate number of vertices in nir_create_passthrough_gs
antonino [Fri, 3 Feb 2023 10:23:09 +0000 (11:23 +0100)]
nir: calculate number of vertices in nir_create_passthrough_gs

`nir_create_passthrough_gs` has been changed to take the type of primitive
as opposed to the number of vertices as an argument.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agonir: avoid generating conflicting output variables
antonino [Mon, 20 Feb 2023 18:26:20 +0000 (19:26 +0100)]
nir: avoid generating conflicting output variables

Because not all vertex outputs can have corresponding fragment inputs
(eg. edgeflags) some logic is needed to correctly generate variables in
a passthough gs.

Before this change some output variables ened up with the same location.

Fixes: d0342e28b32 ("nir: Add helper to create passthrough GS shader")

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agonir: handle primitives with adjacency
antonino [Mon, 13 Feb 2023 11:57:38 +0000 (12:57 +0100)]
nir: handle primitives with adjacency

`nir_create_passthrough_gs` can now handle primitives with adjacency where some
vertices need to be skipped.

Fixes: d0342e28b32 ("nir: Add helper to create passthrough GS shader")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agozink: handle switching between primitives
antonino [Fri, 3 Feb 2023 10:43:04 +0000 (11:43 +0100)]
zink: handle switching between primitives

Zink will generate geometry shaders to emulate certain features, however there
might be different variants of those depending on the primitive type.

This commits adds the logic to generate or bind the correct emulation GS
in the case where nothing changes except the primitive type.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>

19 months agointel/compiler: compactify locations of mesh outputs
Marcin Ślusarz [Mon, 18 Jul 2022 11:47:00 +0000 (13:47 +0200)]
intel/compiler: compactify locations of mesh outputs

Needed in support of anv code for Wa_14015590813.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17622>

19 months agoanv: work around for per-prim attributes corruption
Marcin Ślusarz [Wed, 6 Jul 2022 15:17:42 +0000 (17:17 +0200)]
anv: work around for per-prim attributes corruption

Wa_14015590813 for gfx 12.5

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17622>

19 months agoci/broadcom: Skip another texelfetch case.
Eric Anholt [Tue, 28 Mar 2023 22:54:06 +0000 (15:54 -0700)]
ci/broadcom: Skip another texelfetch case.

This one has also flaked a pipeline recently with a timeout.

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

19 months agoci/freedreno: Flake KHR-GL45.shader_image_load_store.basic-allTargets-store
Eric Anholt [Tue, 28 Mar 2023 22:50:11 +0000 (15:50 -0700)]
ci/freedreno: Flake KHR-GL45.shader_image_load_store.basic-allTargets-store

It has UnexpectedPassed a couple of times recently.

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

19 months agonir: Fix use of alloca() without #include c99_alloca.h
Sil Vilerino [Mon, 27 Mar 2023 20:29:32 +0000 (16:29 -0400)]
nir: Fix use of alloca() without #include c99_alloca.h

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22150>