Commit Graph

173710 Commits

Author SHA1 Message Date
Konstantin Seurer
20beebb041 amd: Move ac_hw_stage to its own file
Otherwise ACO has to include ac_shader_util.h which also includes NIR.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23906>
2023-07-03 21:12:45 +00:00
Konstantin Seurer
82aaf1893d nir/builder_opcodes: Do not generate empty intrinsic indices
Gets rid of all the

struct nir_*_indices {
   int _; /* exists to avoid empty initializers */
};

declarations. 14293 loc -> 12900 loc

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23906>
2023-07-03 21:12:45 +00:00
Konstantin Seurer
e379b9ad8c nir/opt_dead_cf: Handle if statements ending in a jump correctly
If a then/else block ends in a jump, the phi nodes do not necessarily
have to reference the always taken branch because they are dead code.
Avoid crashing in this case by only rewriting phis, if the block does
not end in a jump.

cc: mesa-stable

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23150>
2023-07-03 20:36:51 +00:00
Connor Abbott
7be8d0f7f4 tu: Use common dirty tracking for PC_PRIMITIVE_CNTL_0
This improves the vkoverhead base draw call throughput by around 4%
which fixes a regression from the old code while making things simpler.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22301>
2023-07-03 19:51:05 +00:00
Connor Abbott
97da0a7734 tu: Rewrite to use common Vulkan dynamic state
This drops a significant amount of code for tracking partial state that
is now handled by the common state tracking infrastructure.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22301>
2023-07-03 19:51:05 +00:00
Connor Abbott
56cd6a8b64 tu: Split pipeline struct into different types
The common state code expects you to use a different struct for state in
graphics pipelines and in pipeline libraries. This means we need to
copy the approach radv uses in order to be compatible. This also allows
us to shrink the structs a bit by moving compute-only things to the
compute pipeline and library-only things to the library pipeline.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22301>
2023-07-03 19:51:05 +00:00
Connor Abbott
db1ea9f749 freedreno/a6xx: Fix name of A6XX_PC_PRIMITIVE_CNTL_0::TESS_UPPER_LEFT_DOMAIN_ORIGIN
Document what it actually does.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22301>
2023-07-03 19:51:05 +00:00
Connor Abbott
5704d0ad27 tu: Don't use A6XX_PC_PRIMITIVE_CNTL_0::TESS_UPPER_LEFT_DOMAIN_ORIGIN
This field also affects triangle strip and triangle fan ordering, so we
would get the incorrect (D3D) order with tessellation and geometry
shaders both enabled. Instead flip clockwise/counterclockwise when
the domain origin is upper-left, as radv does.

Because the register is only emitted when tessellation is active which
forces sysmem, it shouldn't regress performance to emit it directly
instead of using a draw state. We're already very tight on draw states.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22301>
2023-07-03 19:51:05 +00:00
Connor Abbott
df7be7323a vk/graphics_state: Don't track each vertex input field
It's unlikely that anyone will call vkCmdSetVertexInputEXT() twice with
the exact same arguments, so this wasn't really doing anything, and it
hurt performance in the common case as shown via "vkoverhead -test 21"
on turnip.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22301>
2023-07-03 19:51:05 +00:00
Connor Abbott
2a8e627e3a vulkan: Fix renderpass flags with driver-specific renderpass
We need to use the driver's renderpass to get the flags if the driver
provides it.

Fixes: f3876db1ee ("vulkan: Plumb rendering flags through vk_graphics_pipeline_state")
Reviewed-by: Faith Ekstrand <faith.ekstrand@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22301>
2023-07-03 19:51:05 +00:00
Connor Abbott
ea52d0d9e0 vk/graphics_state: Track attachment count as state
Even if this isn't dynamic state per-se because it always comes from the
pipeline, it's useful to be able to track it for the various dynamic
states that it affects, which may be either precompiled or not on
turnip.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22301>
2023-07-03 19:51:05 +00:00
Connor Abbott
d322a80170 radv: Fix radv_pipeline_is_blend_enabled
This was relying on cb being NULL instead of just gracefully handling
it, and it will stop being NULL once we start tracking attachment count
as state. Moreover is was broken in the case where only the blend enable
is dynamic.

Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22301>
2023-07-03 19:51:05 +00:00
Connor Abbott
f497cc9d56 vk/graphics_state: Add helpers for pre-baking state
Previously, drivers have either not supported some dynamic state (like
vertex input or sample locations) at all or it's been always dynamic. In
order to be able to set dynamic state sometimes and other times leave it
up to driver-specific state packets, we need a few helpers.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22301>
2023-07-03 19:51:05 +00:00
Connor Abbott
5405c9ed50 vk/graphics_state: Fix some assertions when copying state
On turnip we support dynamic vertex input, but static vertex input is
precompiled and so we will copy from a source without VI to a
destination with VI and it's valid in this case to do nothing. On the
other hand, it should never be valid if VI state is set but the pointer
isn't there, which the code previously silently skipped over. There's a
similar issue with sample locations.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22301>
2023-07-03 19:51:05 +00:00
Connor Abbott
7da44ef671 vk/graphics_state: Add VI_BINDINGS_VALID state
This is a mirror of vi::bindings_valid, but we can track it and set it
properly even when vertex input state is precompiled, because it is also
needed on turnip for knowing the size of the vertex buffer and vertex
stride state packets even when vertex input state is precompiled.
Previously drivers that could pre-bake vertex input state were expected
to handle this themselves, but this would've been complicated for turnip
because we can handle both pre-baked and dynamic vertex input state. Now
we have the one field which is correctly set in all circumstances and we
never have to setup space for vertex input state in the pipeline.

Reviewed-by: Faith Ekstrand <faith.ekstrand@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22301>
2023-07-03 19:51:05 +00:00
Connor Abbott
ea4257be32 vk/graphics_state: Add feedback_loop_input_only
On turnip, there are two cases for feedback loops:

- For feedback loops that involve input attachments, everything works as
  normal in GMEM mode but have to do a workaround in sysmem.
- For feedback loops that may involve any texture, GMEM mode is
  impossible and we have to disable it.

Currently we track this through a special flag on the pipeline, but this
won't be practical in the future. Add a flag to the common renderpass
state struct to patch this info through when using our own renderpass.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22301>
2023-07-03 19:51:05 +00:00
Connor Abbott
1d5eeefd9b vk/graphics_state: Remove vk_subpass_info
It only has a subset of the renderpass state, whereas with turnip we
need to use pretty much all of it at one point or another. Just allow
the driver to pass in the entire vk_render_pass_state if it's using its
own renderpass implementation.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22301>
2023-07-03 19:51:05 +00:00
Connor Abbott
282e73118d util/bitset: Add some extra functions
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22301>
2023-07-03 19:51:04 +00:00
Yonggang Luo
5be8f98f5a compiler/clc: Switch to use nir_foreach_function_impl in function nir_lower_libclc
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23901>
2023-07-03 19:16:48 +00:00
Juan A. Suarez Romero
0dd0f35205 v3d/ci: add new flake
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23975>
2023-07-03 18:57:04 +00:00
Sil Vilerino
d2719c3177 d3d12: Video Decode - Refactor and style fixes
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23969>
2023-07-03 18:28:38 +00:00
Sil Vilerino
5a8d8dad9a d3d12: Video Process - Implement get_processor_fence and async queing
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23969>
2023-07-03 18:28:38 +00:00
Sil Vilerino
c875028b02 d3d12: Video Encode - GPU wait on input surface fence
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23969>
2023-07-03 18:28:38 +00:00
Sil Vilerino
9510c11c6f d3d12: Video Decode - Sync 3D context copy with decode work for texture array case
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23969>
2023-07-03 18:28:37 +00:00
Sil Vilerino
4b15eaeba8 d3d12: Apply style format to d3d12_video_dec.cpp
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23969>
2023-07-03 18:28:37 +00:00
Sil Vilerino
af0b4eacab d3d12: Video Decode - Implement get_decoder_fence and async queing
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23969>
2023-07-03 18:28:37 +00:00
Sil Vilerino
fb1783616e frontend/va: Add video processing async fence support
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23969>
2023-07-03 18:28:37 +00:00
Sil Vilerino
c78611c0ab frontend/va: Pass surf->fence in PIPE_VIDEO_ENTRYPOINT_ENCODE contexts for driver to wait on input surface pending work
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23969>
2023-07-03 18:28:37 +00:00
Tatsuyuki Ishi
6b09f8f453 zink/ci: Add ext_transform_feedback@api-errors to fail list.
These leaks pipelines due to a test bug.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23878>
2023-07-03 17:59:07 +00:00
Tatsuyuki Ishi
94b92718d9 radv: Enable weak reference cache for device->mem_cache.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23878>
2023-07-03 17:59:07 +00:00
Daniel Schürmann
3bd72eec1e radv: reference pipeline cache object in radv_pipeline
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23878>
2023-07-03 17:59:07 +00:00
Konstantin Seurer
05269047d3 intel: Use nir_builder_at
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23883>
2023-07-03 15:21:38 +00:00
Konstantin Seurer
ed08305549 panfrost: Use nir_builder_at
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23883>
2023-07-03 15:21:37 +00:00
Konstantin Seurer
12a268ea81 microsoft: Use nir_builder_at
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23883>
2023-07-03 15:21:37 +00:00
Konstantin Seurer
8b606d5347 lavapipe: Use nir_builder_at
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23883>
2023-07-03 15:21:37 +00:00
Konstantin Seurer
47934ecf07 zink: Use nir_builder_at
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23883>
2023-07-03 15:21:37 +00:00
Konstantin Seurer
b8486673a0 vc4: Use nir_builder_at
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23883>
2023-07-03 15:21:37 +00:00
Konstantin Seurer
364edfefe4 radeonsi: Use nir_builder_at
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23883>
2023-07-03 15:21:37 +00:00
Konstantin Seurer
977f385e65 r600: Use nir_builder_at
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23883>
2023-07-03 15:21:37 +00:00
Konstantin Seurer
fba5c97bc1 etnaviv: Use nir_builder_at
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23883>
2023-07-03 15:21:37 +00:00
Konstantin Seurer
7f9e790d42 crocus: Use nir_builder_at
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23883>
2023-07-03 15:21:37 +00:00
Konstantin Seurer
2c413ed86f gallium,st: Use nir_builder_at
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23883>
2023-07-03 15:21:37 +00:00
Konstantin Seurer
79a37ceda0 freedreno: Use nir_builder_at
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23883>
2023-07-03 15:21:37 +00:00
Konstantin Seurer
be45d4fa6e spirv: Use nir_builder_at
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23883>
2023-07-03 15:21:37 +00:00
Konstantin Seurer
574079e354 nir: Use nir_builder_at
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23883>
2023-07-03 15:21:37 +00:00
Konstantin Seurer
c1b472c834 glsl: Use nir_builder_at
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23883>
2023-07-03 15:21:37 +00:00
Konstantin Seurer
5c8c2ec85c v3d: Use nir_builder_at
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23883>
2023-07-03 15:21:37 +00:00
Konstantin Seurer
8ce27e7ed2 asahi: Use nir_builder_at
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23883>
2023-07-03 15:21:37 +00:00
Konstantin Seurer
1ea963c00b radv: Use nir_builder_at
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23883>
2023-07-03 15:21:37 +00:00
Konstantin Seurer
a7cd206937 nir: Add nir_builder_at
Creates and returns a nir_builder from a cursor. The nir_function_impl
is retrieved using said cursor. This should be fine as long as it is not
used on extracted control flow.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23883>
2023-07-03 15:21:37 +00:00