Commit Graph

57 Commits

Author SHA1 Message Date
TSnake41 a02c026eb7 zink: print result code string on vulkan failure
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17726>
2022-07-28 16:06:50 +00:00
Marek Olšák 3e94d498b3 gallium: add pipe_blit_info::dst_sample, update u_blitter to write that sample
A new radeonsi blit test will use it to upload different sample values
into MSAA textures.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17694>
2022-07-23 18:21:31 +00:00
Mike Blumenkrantz edab34f68d zink: allow no-op renderpass updates in zink_batch_rp()
in some cases it becomes desirable to "maybe" stop and start the current
renderpass, such as when updates MAY result in layout changes for attachments

for such cases, avoid splitting the renderpass unless it actually needs to
be split

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17640>
2022-07-20 17:30:19 +00:00
Mike Blumenkrantz 4aec761596 zink: improve granularity of renderpass switching
this should ensure that (future) renderpass recalcs will never split
a renderpass unnecessarily

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17640>
2022-07-20 17:30:19 +00:00
Mike Blumenkrantz 13951385b3 zink: reuse rt layout functions to refactor zink_render_pass_attachment_get_barrier_info()
maybe slightly easier to read?

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17640>
2022-07-20 17:30:19 +00:00
Mike Blumenkrantz c602e877a3 zink: break out color rt layout calc
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17640>
2022-07-20 17:30:19 +00:00
Mike Blumenkrantz 903060787e zink: break out zs renderpass layout calc
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17640>
2022-07-20 17:30:19 +00:00
Mike Blumenkrantz 1ff18f0879 zink: break out renderpass attachment load op calc
no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17640>
2022-07-20 17:30:19 +00:00
Mike Blumenkrantz 1bc9db6879 zink: split out rp_changed to be more granular for dynamic render
sometimes a state change MAY require a renderpass change, but this change
will not require splitting the current renderpass

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17640>
2022-07-20 17:30:19 +00:00
Mike Blumenkrantz d9a320b62c zink: remove redundant renderpass update check for clears
this should be handled already in the clear code

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17640>
2022-07-20 17:30:19 +00:00
Mike Blumenkrantz ac38139c34 zink: simplify zink_framebuffer_clear_data union
no functional changes

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
2022-07-18 03:40:38 +00:00
Mike Blumenkrantz b0e62adbcc zink: delete zink_fb_clear_util_unpack_clear_color
no longer used

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
2022-07-18 03:40:38 +00:00
Mike Blumenkrantz 9d68684240 zink: always use storeOp=STORE for depth renderpass
it's unknown whether there may be clears to the depth attachment at the start of
a renderpass, so always assume there will be

Fixes: c132a28745 ("zink: use store op NONE when necessary for depth usage")

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
2022-07-18 03:40:38 +00:00
Mike Blumenkrantz 8bb5a11503 zink: fix transient attachment rp assert
cc: mesa-stable

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
2022-07-18 03:40:37 +00:00
Mike Blumenkrantz b240be28e3 zink: check for pending clears to determine write status of zs attachments
as @Venemo discovered, zs layouts were being incorrectly set to readonly
in the case where the attachment was only used for an explicit clear,
so ensure that gets taken into account

cc: mesa-stable

fixes (radv):
dEQP-GLES31.functional.stencil_texturing.render.depth24_stencil8_clear
dEQP-GLES31.functional.stencil_texturing.render.depth32f_stencil8_clear

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17033>
2022-06-14 20:58:55 +00:00
Mike Blumenkrantz d8877437d6 zink: avoid uninit values in renderpass state
cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17010>
2022-06-14 19:21:15 +00:00
Mike Blumenkrantz de1e67b39d zink: hook up surface invalidation to LOAD_OP_DONT_CARE
this should improve perf for tilers

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16877>
2022-06-06 00:36:20 +00:00
Mike Blumenkrantz e6ec9ca0ab zink: rename renderpass attrib value
this never really meant "swapchain", it just meant that load isn't needed

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16877>
2022-06-06 00:36:20 +00:00
Mike Blumenkrantz 20427d01ac zink: fix framebuffer attachment usage asserts for dummy attachments
dummy attachments never overwrite existing attachments,
so they must be explicitly compared like this to avoid
erroneous crashing

Fixes: 3892c13381 ("zink: add an alternate path for EXT_color_write_enable usage")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16848>
2022-06-03 04:04:46 +00:00
Mike Blumenkrantz 8fef8ed1b0 zink: add renderpass bits for color/depth r/w
these are different renderpasses according to compatibility rules

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16621>
2022-05-26 01:49:43 +00:00
Mike Blumenkrantz f4aa727e44 zink: use a zink_render_pass_pipeline_state bit for fbfetch
improve compatibility detection

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16621>
2022-05-26 01:49:43 +00:00
Mike Blumenkrantz b25b8027e5 zink: split out scissor flagging from framebuffer updating
this is kinda similar but not actually the same thing

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476>
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz 91a9676a0c zink: lift some renderpass mechanics up a level in the api
(should be) no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476>
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz b2a33d364e zink: break out zs rt attrib analysis into util function
(should be) no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476>
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz 728fa3606a zink: break out color rt attrib analysis into util function
(should be) no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476>
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz 69efe357b3 zink: pass rt attrib to zink_render_pass_attachment_get_barrier_info()
no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476>
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz 079b95fc6a zink: remove renderpass state flag for swapchain
this is redundant and can be merged onto the rt attrib

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476>
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz e107fa386b zink: break up swapchain renderpass update to util function
no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476>
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz 190ccf3324 zink: break out sample location updating to separate function
no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476>
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz 3ef8cdbab2 zink: use local variable for getting rt barrier info
no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476>
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz 37f9b8ef9b zink: remove fb rebind check during renderpass begin
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476>
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz b181080d9f zink: move renderpass handling to zink_render_pass.c
no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16476>
2022-05-20 16:42:21 +00:00
Mike Blumenkrantz 8c539328fd zink: require renderpass2
drivers should be able to support this, and it allows for deleting
a lot of untested code

Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15904>
2022-04-18 23:45:30 +00:00
Mike Blumenkrantz d461b1f722 zink: only use VK_DEPENDENCY_BY_REGION_BIT if sync2 is available
this breaks texture barriers since non-sync2 barriers don't have this
available

Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15904>
2022-04-18 23:45:30 +00:00
Mike Blumenkrantz aced1ac2d3 zink: add a self-dependency for fbfetch renderpasses
it's necessary to have a self-dependency here so that texture barriers
can be emitted during the renderpass to enable fbfetch

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15831>
2022-04-11 01:11:07 +00:00
Mike Blumenkrantz a72f05ff96 zink: add handling for !sync2 in renderpass dependencies
src/dst stage can't be zero without sync2

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15827>
2022-04-08 20:05:24 +00:00
Mike Blumenkrantz eb8cde0d93 zink: use GENERAL layout for mixed zs fb attachments
this interaction requires read-only sampler access from
depth component with writes to the stencil component, which can only
be done in the GENERAL layout

affects:
GTF-GL46.gtf30.GL3Tests.framebuffer_blit.framebuffer_blit_functionality_color_and_stencil_blit

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15716>
2022-04-06 04:49:00 +00:00
Mike Blumenkrantz c132a28745 zink: use store op NONE when necessary for depth usage
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15716>
2022-04-06 04:49:00 +00:00
Tales Lelo da Aparecida fe66cff411 zink: validate and log errors on vulkan calls
This commit also replaces debug_printf with mesa_loge

Signed-off-by: Tales Lelo da Aparecida <tales.aparecida@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15601>
2022-03-28 21:46:59 -03:00
Mike Blumenkrantz 4d9fc17ae8 zink: set aspectMask for renderpass2 VkAttachmentReference2 structs
this is otherwise just garbage

fixes #5569

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13561>
2021-10-28 02:16:15 +00:00
Mike Blumenkrantz fbff2b6c65 zink: implement GL_EXT_multisampled_render_to_texture
this requires allocating and using a lazily-allocated msaa surface as a transient
attachment for the base render operation, resolving it

...except vulkan has no "replicate" renderpass attachment mechanism, so for now we're
just gonna allocate a transient surface and hang on to it. sorry tilers!

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12934>
2021-09-24 21:00:21 +00:00
Mike Blumenkrantz a4dcacf18f zink: remove fbfetch layout thingy from zs renderpass init
zs doesn't do fbfetch

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12934>
2021-09-24 21:00:21 +00:00
Mike Blumenkrantz ad584ed34e zink: use dispatch table for (almost) all vulkan calls
try to avoid hitting the loader when possible

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12757>
2021-09-08 04:31:24 +00:00
Mike Blumenkrantz 8dac288c8d zink: track compatible render passes
Two render passes are compatible if their corresponding color, input, resolve, and depth/stencil
attachment references are compatible and if they are otherwise identical except for:
• Initial and final image layout in attachment descriptions
• Load and store operations in attachment descriptions
• Image layout in attachment references

VK 8.2

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12605>
2021-09-01 03:28:11 +00:00
Mike Blumenkrantz 3b04a3c797 zink: add a renderpass flag for input attachment layout handling
this has special requirements

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12603>
2021-08-31 19:45:29 +00:00
Hoe Hao Cheng 65c8ae6bbd zink: zero-init structs with ISO C
zero-initing with empty braces is a GNU extension, MSVC does not like
it.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11376>
2021-06-15 12:33:03 +00:00
Mike Blumenkrantz 1ea682ed5a zink: use dynamic state to apply sample locations during draw
not even going to attempt to figure out how to efficiently hash this

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11189>
2021-06-09 17:26:52 +00:00
Mike Blumenkrantz 4304a7adc7 zink: use VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL when possible
this is allowed for fb attachments, so we can use it to avoid needing to
change layouts for zs textures if we know that it isn't going to be written
to during a given subpass

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11130>
2021-06-04 15:10:11 +00:00
Mike Blumenkrantz 90d2631027 zink: use DONTCARE renderpass when a new scanout fb attachment is set
using DONTCARE for the loadOp is more optimal for this case

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10698>
2021-05-11 00:10:26 +00:00
Mike Blumenkrantz 9114863609 zink: use explicit subpass deps
this lets us avoid the spec-mandated barrier and use flags based on
what we'll actually be doing in the pass

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9986>
2021-04-08 04:02:21 +00:00