Samuel Pitoiset
f0d4212847
radv: stop using radv_physical_device for radeon helpers
...
It will be easier to share helpers between RadeonSI and RADV.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29192 >
2024-05-15 11:34:35 +00:00
Chia-I Wu
59babe9fa0
radv: make radv_pipeline_has_ngg static
...
radv_pipeline_has_ngg has no external user anymore. Also remove the
unused radv_pipeline_has_gs_copy_shader.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29200 >
2024-05-14 23:42:25 +00:00
Chia-I Wu
be391fdb33
radv: check gs_copy_shader directly for executable props
...
The pipeline could be a graphics pipeline library and
radv_pipeline_to_graphics would assert on debug builds.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29200 >
2024-05-14 23:42:25 +00:00
Samuel Pitoiset
6c8224c693
radv: simplify radv_emit_ps_inputs() slightly
...
Also remove useless check about ps_offset being zero because memcmp
return false in this case.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28983 >
2024-05-14 15:32:08 +00:00
Samuel Pitoiset
c63ac0521a
radv: track all graphics shaders context registers
...
This should be similar to the previous ctx_cs logic that was
implemented in order to reduce context rolls but this also applies
to shader objects.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28983 >
2024-05-14 15:32:08 +00:00
Samuel Pitoiset
db597d274b
radv: add more radeon_opt_set_xxx variants
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28983 >
2024-05-14 15:32:08 +00:00
Samuel Pitoiset
d5af67ea2c
radv: add graphics shaders context registers that need to be tracked
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28983 >
2024-05-14 15:32:07 +00:00
Samuel Pitoiset
9532b0f1b2
radv: emit graphics pipelines directly from the cmdbuf
...
This allows us to unify emitting monolithic graphics pipelines and
shader objects.
Though, this temporarily reduces performance in some games due to more
context rolls. But this will be fixed in the following commits by
using the recent mechanism to track context register writes.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28983 >
2024-05-14 15:32:07 +00:00
Samuel Pitoiset
fca40bcce3
radv: make radv_conv_gl_prim_to_gs_out() a non-static function
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28983 >
2024-05-14 15:32:07 +00:00
Hans-Kristian Arntzen
6c3457033a
radv: Implement VK_MESA_image_alignment_control
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Co-authored-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Co-authored-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29129 >
2024-05-14 09:30:40 +00:00
Samuel Pitoiset
2097bec163
radv: fix the late scissor workaround for GFX9 since a recent refactoring
...
This was a typo.
Fixes: 92337aff03 ("radv: split cmdbuf dirty flags into dirty/dirty_dynamic")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11142
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29156 >
2024-05-14 08:36:46 +00:00
Dave Airlie
2f02af39b3
radv/video/encode: fix quality params on v2 hw.
...
This should have the extra dword as well.
Fixes: 54d499818c ("radv/video: add initial support for encoding with h264.")
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29098 >
2024-05-14 05:45:57 +00:00
Rhys Perry
38cbc3c605
radv: advertise VK_EXT_legacy_vertex_attributes
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11094
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29071 >
2024-05-13 17:22:27 +00:00
Rhys Perry
d48c8905f1
radv: keep track of unaligned dynamic vertex access
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29071 >
2024-05-13 17:22:26 +00:00
Samuel Pitoiset
62b4e9a779
radv: simplify radv_emit_hw_gs() slightly
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29132 >
2024-05-13 16:10:20 +00:00
Samuel Pitoiset
bdefab362c
radv: simplify radv_emit_hw_vs() slightly
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29132 >
2024-05-13 16:10:20 +00:00
Samuel Pitoiset
5572a83b00
radv: simplify radv_emit_hw_ngg() slightly
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29132 >
2024-05-13 16:10:20 +00:00
Samuel Pitoiset
dd3ae170a7
radv: do not emit VGT_GS_OUT_PRIM_TYPE to ctx_cs on GFX11
...
Missed that one but it doesn't cause any context rolls.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29132 >
2024-05-13 16:10:20 +00:00
Samuel Pitoiset
f228e7ed2d
radv: remove gfx10_emit_ge_pc_alloc()
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29132 >
2024-05-13 16:10:20 +00:00
Konstantin Seurer
406dda70e7
radv: Zero initialize capture replay group handles
...
radv_serialized_shader_arena_block is not tightly packed and using an
initializer list leaves the gaps uninitialized.
cc: mesa-stable
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28961 >
2024-05-12 10:28:27 +00:00
Konstantin Seurer
df82221bb3
radv: Remove arenas from capture_replay_arena_vas
...
Avoids an use after free when looking up an arena.
cc: mesa-stable
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28961 >
2024-05-12 10:28:27 +00:00
Konstantin Seurer
e050abc961
radv: Fix radv_shader_arena_block list corruption
...
Remove it from the previous list befor adding it to a new one.
cc: mesa-stable
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28961 >
2024-05-12 10:28:27 +00:00
Tatsuyuki Ishi
e21ea25de9
radv: Remove radv_queue::device again
...
It was mistakenly revived.
Fixes: 0fb19b8331 ("radv: add radv_queue.h")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29151 >
2024-05-12 09:58:22 +00:00
Marek Olšák
a6c46509cc
ac/llvm: use new s_wait instructions and split the existing ones for gfx12
...
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29007 >
2024-05-11 22:14:05 -04:00
Marek Olšák
2adc66e586
amd: add initial common code for gfx12
...
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29007 >
2024-05-11 22:14:05 -04:00
Marek Olšák
58a5de5c34
amd: add gfx12 register definitions into the register header generator
...
The generator renamed some definitions to resolve conflicts.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29007 >
2024-05-11 22:14:05 -04:00
Dr. David Alan Gilbert
8b6b327d1b
treewide: Cleanup unused structs
...
vk/wsi: Remove unused struct 'wsi_headless_format'
'wsi_headless_format' appears unused, and seems
to have been since initial commit.
radv: Remove unused struct 'blit_region'
'blit_region' appears unused, I think since initial commit.
r600: Remove unused structs
'eg_interp' and 'r600_shader_src' are unused.
I think they are just leftovers from the cleanup
in 20e6c31ba6 .
i915: Remove unused struct 'i915_tracked_hw_state'
'i915_tracked_hw_state' appears unused. I think it's just
a leftover from 179cb58795 .
llvmpipe: Remove unused struct 'linear_interp'
'linear_interp' doesn't ever seem to have been used.
radeonsi: Remove unused struct 'texture_orig_info'
'texture_orig_info' seems unused, I think since 46b2b3bda8 .
svga: Remove unused struct 'svga_3d_invalidate_gb_image'
'svga_3d_invalidate_gb_image' appears unused since 1942c06f9c .
Remove it.
nir: Remove unused struct 'split_struct_state'
'split_struct_state' looks unused since the original commit.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29105 >
2024-05-11 17:30:59 +00:00
Samuel Pitoiset
43fbbc0732
radv: track and bind more VRS states from the graphics pipeline
...
This doesn't change anything but this will allow us to emit all
graphics shaders from the cmdbuf.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29103 >
2024-05-09 08:15:56 +00:00
Samuel Pitoiset
8c17b05615
radv: do not emit non-context registers to radv_pipeline::ctx_cs
...
These registers don't cause context rolls.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29103 >
2024-05-09 08:15:56 +00:00
Samuel Pitoiset
24814be08a
radv: stop recomputing the last VGT API stage when emitting graphics shaders
...
The last VGT shader is already set correctly.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29103 >
2024-05-09 08:15:56 +00:00
Samuel Pitoiset
6753f981b6
radv: remove unused parameter to radv_pipeline_emit_pm4()
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29103 >
2024-05-09 08:15:56 +00:00
Samuel Pitoiset
c6a22dd05c
radv: precompute NGG register values
...
To make emission faster.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29031 >
2024-05-09 06:29:29 +00:00
Samuel Pitoiset
751e5d8bd7
radv: move common registers between VS/GS and NGG
...
For more clarity.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29031 >
2024-05-09 06:29:29 +00:00
Faith Ekstrand
ac500495ac
radv: Use vk_physical_device_get_spirv_capabilities()
...
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Iván Briano <ivan.briano@intel.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28905 >
2024-05-09 01:14:23 +00:00
Faith Ekstrand
c1eaa03904
spirv: Drop the SubgroupUniformControlFlow check
...
It's just a vtn_fail_if() and there's no actual cap for it. It's not
really gaining us much to have the check.
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Iván Briano <ivan.briano@intel.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28905 >
2024-05-09 01:14:22 +00:00
Faith Ekstrand
eed3b56402
spirv: Move the old AMD extensions out of capabilities
...
These aren't real capabilities. They control whether or not we turn on
the extended instruction sets for these instruction types.
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Iván Briano <ivan.briano@intel.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28905 >
2024-05-09 01:14:22 +00:00
Samuel Pitoiset
1173058002
radv: add a new mechanism for tracking registers per cmdbuf
...
We already track a couple of registers per cmdbuf and this introduces
a generic mechanism, instead of having a bunch of last_xxx fields.
Loosely based on RadeonSI.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28644 >
2024-05-08 11:45:52 +00:00
Samuel Pitoiset
31b039d8b7
radv: advertise VK_KHR_dynamic_rendering_local_read
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27263 >
2024-05-07 10:35:04 +00:00
Samuel Pitoiset
c533a79878
radv: implement VK_KHR_dynamic_rendering_local_read
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27263 >
2024-05-07 10:35:04 +00:00
Samuel Pitoiset
53a142ad23
aco: add support for remapping color attachments
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27263 >
2024-05-07 10:35:04 +00:00
Samuel Pitoiset
c9162034bc
radv: precompute DB_SHADER_CONTROL for fragment shaders later
...
To regroup all precomputed register values.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29022 >
2024-05-06 18:00:02 +00:00
Samuel Pitoiset
c658ed5136
radv: precompute vertex shader register values
...
To make emission faster.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29022 >
2024-05-06 18:00:02 +00:00
Samuel Pitoiset
4b53d36f0d
radv: precompute legacy GS register values
...
To make emission faster.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29022 >
2024-05-06 18:00:02 +00:00
Samuel Pitoiset
fa9b0ee86c
radv: precompute mesh shader register values
...
To make emission faster.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29022 >
2024-05-06 18:00:02 +00:00
Samuel Pitoiset
7f7ef10bea
radv: precompute fragment shader register values
...
To make emission faster.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29022 >
2024-05-06 18:00:02 +00:00
Samuel Pitoiset
e5bc4d85bb
radv: precompute existing legacy GS register values later
...
To precompute all registers at the same place.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29022 >
2024-05-06 18:00:02 +00:00
Samuel Pitoiset
92337aff03
radv: split cmdbuf dirty flags into dirty/dirty_dynamic
...
We are out of bits.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29039 >
2024-05-06 08:33:37 +02:00
Georg Lehmann
603982ea80
nir/opt_16bit_tex_image: optimize packed conversions too
...
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28730 >
2024-05-04 15:01:45 +00:00
Georg Lehmann
e63afdc681
radv: always run nir_opt_16bit_tex_image
...
The pass can optimize pack_half and constants sources even when
no 16bit instructions exist.
Foz-DB Navi21:
Totals from 3042 (3.83% of 79395) affected shaders:
MaxWaves: 69039 -> 69031 (-0.01%); split: +0.01%, -0.02%
Instrs: 2292054 -> 2291874 (-0.01%); split: -0.03%, +0.02%
CodeSize: 12567868 -> 12544888 (-0.18%); split: -0.23%, +0.05%
VGPRs: 145384 -> 145352 (-0.02%); split: -0.06%, +0.04%
SpillSGPRs: 451 -> 452 (+0.22%)
Latency: 23546543 -> 23536416 (-0.04%); split: -0.07%, +0.03%
InvThroughput: 5180446 -> 5164437 (-0.31%); split: -0.35%, +0.04%
VClause: 50537 -> 50535 (-0.00%); split: -0.05%, +0.04%
SClause: 84726 -> 84750 (+0.03%); split: -0.04%, +0.06%
Copies: 140384 -> 140421 (+0.03%); split: -0.34%, +0.37%
Branches: 40412 -> 40413 (+0.00%)
PreVGPRs: 120213 -> 120262 (+0.04%); split: -0.03%, +0.07%
VALU: 1607545 -> 1607593 (+0.00%); split: -0.03%, +0.03%
SALU: 215846 -> 215837 (-0.00%); split: -0.03%, +0.02%
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28730 >
2024-05-04 15:01:44 +00:00
Georg Lehmann
3a35522c8a
radv, radeonsi: don't use D16 for f2f16_rtz
...
D16 rounds towards zero for fp32 -> fp16, but for fixed point it rounds to
nearest even in fp16. MIMG without D16 also rounds to nearest even, but in fp32.
This means D16 and f2f16_rtz(tex@32) can produce different results.
Sadly this also means we can never use d16 if fp16 rounding isn't undefined.
Cc: mesa-stable
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28730 >
2024-05-04 15:01:44 +00:00