Commit graph

185405 commits

Author SHA1 Message Date
Caio Oliveira
2a1c2a1bf1 intel/brw: Remove Gfx8- code from thread payload
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27691>
2024-02-28 05:45:38 +00:00
Caio Oliveira
ed6f0665e0 intel/brw: Remove Gfx8- code from register allocator
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27691>
2024-02-28 05:45:38 +00:00
Caio Oliveira
85eb672325 intel/brw: Remove Gfx8- code from scheduler
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27691>
2024-02-28 05:45:38 +00:00
Caio Oliveira
6e88fa8a77 intel/brw: Remove Gfx8- code from brw_compile_* functions
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27691>
2024-02-28 05:45:38 +00:00
Caio Oliveira
a4bf016582 intel/brw: Remove Gfx8- code from assembler
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27691>
2024-02-28 05:45:38 +00:00
Caio Oliveira
83d7ddebcb intel/brw: Remove Gfx8- code from disassembler
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27691>
2024-02-28 05:45:38 +00:00
Caio Oliveira
15469b0a63 intel/brw: Remove unused legacy shader stages
CLIP, STRIP-FAN and FF Geometry don't apply to Gfx9+.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27691>
2024-02-28 05:45:38 +00:00
Caio Oliveira
c621f75e7b intel/brw: Remove now unused vec4-only opcodes
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27691>
2024-02-28 05:45:38 +00:00
Caio Oliveira
a641aa294e intel/brw: Remove vec4 backend
It still exists as part of ELK for older gfx versions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27691>
2024-02-28 05:45:37 +00:00
Caio Oliveira
7c23b90537 intel/brw: Always use scalar shaders
Remove scalar_stage[] array, since now it is always scalar.  This
removes any usage of vec4 shaders in brw.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27691>
2024-02-28 05:45:37 +00:00
Caio Oliveira
303fd4e935 intel/brw: Move type_size_* functions out of vec4-specific file
Will make easier later to delete vec4 files.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27691>
2024-02-28 05:45:37 +00:00
Caio Oliveira
9bfccc1935 intel/brw: Move brw_compile_* functions out of vec4-specific files
These contain code that is both fs and vec4.  Will make easier later to
delete vec4 files.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27691>
2024-02-28 05:45:37 +00:00
Caio Oliveira
c11d7743b3 intel/blorp: Remove Gfx8- references in BRW code
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27691>
2024-02-28 05:45:37 +00:00
Vinson Lee
6c190bdfe9 intel/clc: Fix file descriptor leak
Fix defect reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable fp going out of scope leaks the storage it points to.

Fixes: 4fd7495c69 ("intel/clc: add ability to output NIR")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27778>
2024-02-28 04:30:33 +00:00
Faith Ekstrand
41722c6137 nak: Add support for imad on Volta+ and enable it in simple cases
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27159>
2024-02-27 21:51:30 -06:00
Faith Ekstrand
a747cd1bd5 nak: Move NAK_FS_OUT_COLOR next to the enum
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27159>
2024-02-27 21:51:30 -06:00
Faith Ekstrand
f4fb5277c3 nir: Add an imad opcode
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27159>
2024-02-27 21:51:30 -06:00
Faith Ekstrand
1881d97c27 nak: Implement nir_op_iadd3 on SM70+
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27159>
2024-02-27 21:51:29 -06:00
Mike Blumenkrantz
0c95d39309 zink: add nvk baseline
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27843>
2024-02-27 21:50:47 -05:00
Mike Blumenkrantz
9ffb7e0179 zink: update nv blob baseline
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27843>
2024-02-27 21:50:47 -05:00
Daniel Almeida
efc4ac0d27 nak/sm50: sprinkle OpAnnotate in optimization passes
Not only do we want to know where an Op originated from, but also how it got
transformed along the way if possible. Preferably all the way to the final
machine code emitted.

This commit inserts OpAnnotates in some of the optimization passes when
map_instr() or Instr::new_boxed is used.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27158>
2024-02-28 01:12:03 +00:00
Daniel Almeida
feb2d3e1da nak/sm50: support annotations through OpAnnotate
Add a new op to annotate the IR. This will help debugging and is only
in effect when NAK_DEBUG=annotate is set.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27158>
2024-02-28 01:12:03 +00:00
Daniel Almeida
a69bd9a70a nak/sm50: add an annotate debug flag
Add a flag so that users can enable debug annotations when printing the IR.
This does nothing for now. A follow-up commit will actually implement
annotations.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27158>
2024-02-28 01:12:03 +00:00
Daniel Almeida
02774be708 nak/sm50: add a memstream abstraction
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27158>
2024-02-28 01:12:03 +00:00
Juston Li
e57cf175e2 venus: move feedback on empty last batch to prior batch
For submissions with an empty last batch containing no cmd buffers but
with semaphores as zink does, adding feedback to that batch would make
it no longer empty and increase submission overhead on some drivers.

Since feedback order is enforced by barriers, the feedback cmds can
instead be appended to the previous batch (if it exists) so that the
last batch remains empty.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27830>
2024-02-28 00:56:26 +00:00
Thong Thai
0586a3fb22 frontends/va/postproc: do not use efc if image is to be translated
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10658

Signed-off-by: Thong Thai <thong.thai@amd.com>
Tested-by: Andrej Benz <hello@benz.dev>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27802>
2024-02-27 22:56:04 +00:00
Faith Ekstrand
b8c3d18fba nvk: Advertise VK_EXT_shader_object
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9648
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27024>
2024-02-27 22:17:09 +00:00
Faith Ekstrand
fb564040a7 nvk: Advertise VK_KHR_graphics_pipeline_library
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9635
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27024>
2024-02-27 22:17:09 +00:00
Faith Ekstrand
813b253939 nvk: Switch to shader objects
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27024>
2024-02-27 22:17:09 +00:00
Faith Ekstrand
4001658c18 nvk: Use vk_render_pass_state::attachments for write masks
This pulls everything into nvk_cmd_draw.c where it's a bit easier to
manage.  When the time comes for switching to EXT_shader_object, this
will let us handle VK_EXT_dynamic_rendering_unused_attachments via the
common vk_pipeline code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27024>
2024-02-27 22:17:09 +00:00
Faith Ekstrand
839629634f nvk: Move nir_lower_patch_vertices to nvk_lower_nir()
As long as it happens after we merge tess info between the two stages
(it does) then there's no need to have it in the pipeline code.  It's
just an optimization anyway.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27024>
2024-02-27 22:17:09 +00:00
Faith Ekstrand
bd76444257 nvk: Pass an array of descriptor sets to nvk_lower_nir
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27024>
2024-02-27 22:17:09 +00:00
Faith Ekstrand
a4f519d72d nvk: Move populate_fs_key to nvk_shader.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27024>
2024-02-27 22:17:09 +00:00
Faith Ekstrand
045741ac30 nvk/shader: Refactor some helpers
This puts them in the form we need for vk_shader.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27024>
2024-02-27 22:17:09 +00:00
Faith Ekstrand
626f38e25e nvk: Populate vk_descriptor_set_layout::blake3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27024>
2024-02-27 22:17:09 +00:00
Faith Ekstrand
9308e8d90d vulkan: Add generic graphics and compute VkPipeline implementations
These implementations are built on top of vk_shader.  For the most part,
the driver shouldn't notice a difference between draws consuming
pipelines vs. draws consuming shaders.  The only real difference is
that, when vk_driver_shader_ops::compile() is called for pipelines, a
struct vk_graphics_pipeline_state is provided.  For shader objects, the
state object will be NULL indicating that all state is unknown.  Besides
that, all the rest of the differences between Vulkan 1.0 pipelines,
VK_EXT_graphics_pipeline_library, and VK_EXT_shader_object are handled
by the Vulkan runtime code.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27024>
2024-02-27 22:17:09 +00:00
Faith Ekstrand
c488dc9f50 vulkan: Add a BLAKE3 hash to vk_descriptor_set_layout
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27024>
2024-02-27 22:17:09 +00:00
Faith Ekstrand
682b99a63f vulkan: Add push constant ranges to vk_pipeline_layout
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27024>
2024-02-27 22:17:09 +00:00
Faith Ekstrand
e2cb395a1f vulkan: Add a vk_pipeline base struct
We need to be able to thunk through a destroy callback if we want to
have different kinds of pipelines implemented in different parts of the
stack.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27024>
2024-02-27 22:17:09 +00:00
Faith Ekstrand
5e71e6f3f6 vulkan: Add a new dynamic state for render pass attachments
This is useful for implementing VK_EXT_dynamic_rendering_unused_attachments

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27024>
2024-02-27 22:17:09 +00:00
Faith Ekstrand
6ec177b116 vulkan: Rework vk_render_pass_state::attachments
The new bitfield has a separat flag for each of the color attachments.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27024>
2024-02-27 22:17:09 +00:00
Faith Ekstrand
c09c086c12 vulkan: Add a vk_render_pass_state_has_attachment_info() helper
We already have a helper like this internally.  Give it a better name
and expose it.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27024>
2024-02-27 22:17:09 +00:00
Faith Ekstrand
9f62008bff vulkan: Add runtime code for VK_EXT_shader_object
This adds a new base vk_shader object along with vtables for creating,
binding, and working with shader objects.

Unlike other parts of the runtime, the new shader object code is a bit
more sanitized and opinionated than just handing you the Vulkan
entrypoints.  For one thing, the create_shaders() calback takes a NIR
shader, not SPIR-V.  Conversion of SPIR-V into NIR, handling of magic
meta NIR shaders, etc. is all done in common code.  [De]serialization is
done via `struct blob` and the common code does a checksum of the binary
and handles rejecting invalid binaries based on shaderBinaryUUID and
shaderBinaryVersion.  This should make life a bit easier for driver
authors as well as provides a bit nicer interface for building the
common pipeline implementation on top of shader objects.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27024>
2024-02-27 22:17:09 +00:00
Connor Abbott
0d225c9e43 vk/graphics_state: Add stubs required by VK_EXT_shader_objects
Because these functions were introduced by VK_EXT_shader_objects, we
technically have to expose them even though they have to do with NV
extensions that no one else supports.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27024>
2024-02-27 22:17:09 +00:00
Connor Abbott
657b8e5264 vk/graphics_state: Remove bogus assert in CmdSetSampleMaskEXT
We're supposed to just ignore samples above what we support, and there's
no VU matching this assert. Fixes a crash in
dEQP-VK.pipeline.shader_object_unlinked_spirv.extended_dynamic_state.misc.sample_shading_dynamic_sample_count.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27024>
2024-02-27 22:17:08 +00:00
Faith Ekstrand
6ad294202e vulkan: Move the descriptor set limit to vk_limits.h
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27024>
2024-02-27 22:17:08 +00:00
Faith Ekstrand
498d58a5f8 vulkan: Add a vk_get_subgroup_size() helper
No reason to duplicate this logic between pipelines and shader objects.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27024>
2024-02-27 22:17:08 +00:00
M Henning
af2cea8f84 nak: Remove assert on nir->info.outputs_written
nir->info.outputs_written isn't used for fragment shaders except as an
early out a few lines above this, so we don't rely on this property.

My best guess is that this was intended to check if the information
from nir_gather_info is stale, but dead variables fail the assert
even if the info is up to date.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27595>
2024-02-27 21:58:08 +00:00
David Rosca
82ff9204ab frontends/va: Only set VP9 segmentation fields when segmentation is enabled
Workaround for ffmpeg setting segmentation_update_map to 1 with
segmentation_enabled == 0.

Fixes decoding sample from https://github.com/mpv-player/mpv/issues/13533

Cc: mesa-stable

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27816>
2024-02-27 20:54:48 +00:00
Ruijing Dong
eb74aa8515 frontends/va: get av1 encoding ref frame infos for L0.
Reference frame list is formed by each of the provided
recon_frame, while the assumption here is to use the API
provided by VAAPI interface, when a frame is marked as
"long term reference" by

av1->picture_flags.bits.long_term_reference

Its recon_frame will be kept in DPB marked by its
recon_frame as signature. When a future input requests
refering to it, it can go this way:

1. set av1->ref_frame_ctrl_l0.field.search_idx2 to indicate
   which ref_frame_idx slot will be used.
   x = av1->ref_frame_ctrl_l0.field.search_idx2;
2. n = av1->ref_frame_idx[x-1];
   av1->reference_frames[n] as the signature to compare with.
   if av1->reference_frames[n] is pointing to the
   same video buffer (signature) as the one marked as
   "long term reference". Then the new input is refering to
   it only.
3. in SVC case, long terms are used for temproal_id 0 only,
   because using long term means potentially scene change
   could happen.
4. the "long term reference" recon_frame should be kept,
   instead of being reused until it is no longer needed to
   avoid signature duplication.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27771>
2024-02-27 20:20:46 +00:00