Samuel Pitoiset
d47b13c028
radv: do not decompress/resummarize levels without HTILE
...
It's completely useless to decompress or resummarize levels that
are not compressed using HTILE.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8124 >
2021-01-27 09:02:17 +01:00
Samuel Pitoiset
c30f010e8f
radv: remove redundant check in radv_process_depth_stencil()
...
This is already checked in radv_handle_depth_image_transition().
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8579 >
2021-01-20 17:18:39 +00:00
Bas Nieuwenhuizen
f23eaf0db6
radv: Add option to disable DCC in renderpasses without layout.
...
If DCC is enabled for GENERAL then we cannot disable DCC by going
to the GENERAL layout.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7004 >
2020-12-21 18:32:24 +00:00
James Park
28d02b9d3e
ac,amd/llvm,radv: Initialize structs with {0}
...
Necessary to compile with MSVC.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7123 >
2020-10-14 12:15:23 +00:00
Samuel Pitoiset
ffea3e7348
radv: cleanup creating the decompress/resummarize pipelines
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4389 >
2020-04-08 07:55:14 +02:00
Samuel Pitoiset
6f6276bd24
radv: rename extra graphics pipeline decompress/resummarize fields
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4389 >
2020-04-08 07:55:12 +02:00
Samuel Pitoiset
8b7586655f
radv: rename decompress/resummarize depth/stencil functions
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4389 >
2020-04-08 07:55:10 +02:00
Samuel Pitoiset
e6e97ea92e
radv/sqtt: describe layout transitions with user markers
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4138 >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4138 >
2020-03-12 17:04:55 +00:00
Samuel Pitoiset
b6cebf6439
radv: do not recursively begin/end render pass for meta operations
...
To avoid breaking SQTT user markers that are emitted to report
barriers and layout transitions to RGP.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4136 >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4136 >
2020-03-11 07:54:43 +00:00
Samuel Pitoiset
0d2da2a8c0
radv: add explicit external subpass dependencies to meta operations
...
No functional changes because a subpass dependency with dstStageMask
set to VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT is a no-op.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3330 >
2020-01-23 11:25:38 +01:00
Samuel Pitoiset
2af39c719e
radv: select the depth decompress path based on the aspect mask
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
2019-11-25 16:29:23 +01:00
Samuel Pitoiset
905c005561
radv: create decompress pipelines for separate depth/stencil layouts
...
No functional changes as the driver still uses the depth+stencil
pipeline.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
2019-11-25 16:29:21 +01:00
Samuel Pitoiset
faa58201f3
radv: rework creation of decompress/resummarize meta pipelines
...
This refactoring will help for creating more decompress pipelines.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
2019-11-25 16:29:18 +01:00
Samuel Pitoiset
76812339f7
radv: decompress mipmapped depth/stencil images during transitions
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
2019-08-26 15:56:48 +02:00
Samuel Pitoiset
81c6473b7f
radv: add mipmaps support for decompress/resummarize
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
2019-08-26 15:56:45 +02:00
Samuel Pitoiset
18ccde4d68
radv: add radv_process_depth_image_layer() helper
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
2019-08-26 15:56:42 +02:00
Bas Nieuwenhuizen
216a9d8871
radv: Add extra struct to image view creation.
...
For extra args. Unlike image creation, I'm not embedding the vk
struct in there, so all the inline structs can be kept.
Reviewed-by: Dave Airlie <airlied@redhat.com >
2019-08-07 02:13:07 +02:00
Samuel Pitoiset
a21f23c811
radv: add radv_get_depth_pipeline() helper
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
2019-07-03 08:51:42 +02:00
Samuel Pitoiset
a20925f2a9
radv: allow the depth decompress pass to emit dynamic sample locations
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-By: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
2019-06-07 13:11:00 +02:00
Samuel Pitoiset
2dd8dfd913
radv: allow to set dynamic sample locations to the depth decompress pass
...
If VK_EXT_sample_locations is used, the driver might need to emit
the sample locations specified during layout transitions.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-By: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
2019-06-07 13:10:55 +02:00
Samuel Pitoiset
cc7deb749c
radv: drop few useless state changes when doing color/depth decompressions
...
Viewport/scissor don't need to be updated for array textures.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
2018-11-29 10:18:55 +01:00
Mauro Rossi
43318d5857
radv/meta_decompress: fix pointer to integer conversion
...
VK_NULL_HANDLE replaces NULL to avoid following building error:
external/mesa/src/amd/vulkan/radv_meta_decompress.c:365:54: error:
incompatible pointer to integer conversion passing 'void *' to parameter
of type 'VkShaderModule' (aka 'unsigned long long') [-Werror,-Wint-conversion]
VkResult ret = create_pipeline(cmd_buffer->device, NULL, samples,
^~~~
prebuilts/clang/host/linux-x86/clang-4053586/lib64/clang/5.0.300080/include/stddef.h:105:16:
note: expanded from macro 'NULL'
# define NULL ((void*)0)
^~~~~~~~~~
external/mesa/src/amd/vulkan/radv_meta_decompress.c:97:32:
note: passing argument to parameter 'vs_module_h' here
VkShaderModule vs_module_h,
^
1 error generated.
Fixes: fbcd167314
("radv: Add on-demand compilation of built-in shaders.")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
2018-08-15 14:34:50 +02:00
Bas Nieuwenhuizen
fbcd167314
radv: Add on-demand compilation of built-in shaders.
...
In environments where we cannot cache, e.g. Android (no homedir),
ChromeOS (readonly rootfs) or sandboxes (cannot open cache), the
startup cost of creating a device in radv is rather high, due
to compiling all possible built-in pipelines up front. This meant
depending on the CPU a 1-4 sec cost of creating a Device.
For CTS this cost is unacceptable, and likely for starting random
apps too.
So if there is no cache, with this patch radv will compile shaders
on demand. Once there is a cache from the first run, even if
incomplete, the driver knows that it can likely write the cache
and precompiles everything.
Note that I did not switch the buffer and itob/btoi compute pipelines
to on-demand, since you cannot really do anything in Vulkan without
them and there are only a few.
This reduces the CTS runtime for the no caches scenario on my
threadripper from 32 minutes to 8 minutes.
Reviewed-by: Dave Airlie <airlied@redhat.com >
2018-08-14 10:26:24 +02:00
Samuel Pitoiset
0fc9113ac5
radv: add radv_image_has_{cmask,fmask,dcc,htile}() helpers
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
2018-04-09 11:21:10 +02:00
Samuel Pitoiset
3595a11648
radv: create pipeline layout objects for all meta operations
...
They are dummy objects but the spec requires layout to not be
NULL, this just makes sure we are creating valid pipeline layout
objects. This will allow us to remove some useless checks.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
2017-12-19 21:22:06 +01:00
Samuel Pitoiset
ba3dc3519d
radv: add radv_meta_save() helper
...
And merge radv_meta_save_novertex() with
radv_meta_save_graphics_reset_vport_scissor_novertex().
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
2017-10-06 09:49:06 +02:00
Samuel Pitoiset
8d91f4e45f
radv: merge radv_meta_{save,restore}_pass() with RADV_META_SAVE_PASS
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
2017-10-06 09:49:06 +02:00
Samuel Pitoiset
55ee532932
radv: convert all GFX operations to the RADV_META_SAVE_XXX flags
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
2017-10-06 09:49:05 +02:00
Samuel Pitoiset
807f2d4f33
radv: introduce the concept of meta save flags
...
This will allow us to save/restore the different states on-demand
based on the meta operation. For now, this saves/restores all
states. Compute will follow once the graphics part is done.
The main idea is to merge all save/restore helpers.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
2017-10-06 09:49:05 +02:00
Samuel Pitoiset
b269ed3d94
radv: select the pipeline outside of the loop when decompressing htile
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
2017-10-06 09:49:05 +02:00
Samuel Pitoiset
8196a3c63e
radv: remove useless checks around radv_CmdBindPipeline()
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
2017-10-04 23:18:51 +02:00
Samuel Pitoiset
06dbe0722f
radv: cleanup radv_device_finish_meta_XXX() helpers
...
Unnecessary to double check that handles are not NULL.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
2017-10-02 11:56:20 +02:00
Samuel Pitoiset
331a4f885a
radv: drop useless param in emit_depth_decomp()
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
2017-10-02 11:56:20 +02:00
Samuel Pitoiset
457306fa4c
radv: do not need to double zero-init the meta state structures
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
2017-10-02 11:56:20 +02:00
Samuel Pitoiset
913bfd42a3
radv: set image view type when decompressing depth surfaces
...
This was missing.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
2017-09-28 08:52:38 +02:00
Xavier Bouchoux
bf8637addf
radv/meta: missing initialisations in create_pass().
...
Otherwise radv_cmd_state_setup_attachments() will complain it has no clearvalues,
when called via radv_process_depth_image_inplace().
v2: use LOAD/STORE instead of DONT_CARE, to preserve stencil values.
Signed-off-by: Xavier Bouchoux <xavierb@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
2017-09-04 00:26:39 +02:00
Alex Smith
2e9a13bf22
radv: Fix decompression on multisampled depth buffers
...
Need to take the sample count into account in the depth decompress and
resummarize pipelines and render pass.
Fixes: f4e499ec79
("radv: add initial non-conformant radv vulkan driver")
Signed-off-by: Alex Smith <asmith@feralinteractive.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Cc: "17.2" <mesa-stable@lists.freedesktop.org >
2017-08-07 23:47:49 +02:00
Bas Nieuwenhuizen
7c7196e35c
radv: Disable depth & stencil tests when the depthbuffer doesn't support it.
...
Signed-off-by: Bas Nieuwenhuizen <basni@google.com >
Acked-by: Dave Airlie <airlied@redhat.com >
2017-07-05 20:23:00 +02:00
Bas Nieuwenhuizen
78bef01da2
radv: Remove unused args of radv_image_view_init.
...
Signed-off-by: Bas Nieuwenhuizen <basni@google.com >
Reviewed-by: Dave Airlie <airlied@redhat.com >
2017-06-26 01:24:50 +02:00
Dave Airlie
7e8d0a402b
radv: move some image info into a separate struct.
...
This is to rework the surface code like radeonsi.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Signed-off-by: Dave Airlie <airlied@redhat.com >
2017-05-03 06:00:17 +10:00
Dave Airlie
03a2ca6356
radv/meta: refactor out some common shaders.
...
The vs vertex generate and fs noop shaders are used in a few places,
so refactor them out.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Signed-off-by: Dave Airlie <airlied@redhat.com >
2017-04-19 10:03:05 +10:00
Dave Airlie
3a7fd0c4db
radv/meta: move depth decompress to using inline vertex data
...
This removes the vertex buffer, and just generates the values
in the shader.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Signed-off-by: Dave Airlie <airlied@redhat.com >
2017-04-19 10:02:47 +10:00
Bas Nieuwenhuizen
4083a2ddcb
radv: Set proper viewport & scissor for meta draws.
...
Signed-off-by: Bas Nieuwenhuizen <basni@google.com >
Reviewed-by: Dave Airlie <airlied@redhat.com >
2017-03-30 22:21:14 +02:00
Bas Nieuwenhuizen
3b455c1cb7
radv: Use winsys HTILE info.
...
Signed-off-by: Bas Nieuwenhuizen <basni@google.com >
Reviewed-by: Dave Airlie <airlied@redhat.com >
2017-03-07 09:58:27 +01:00
Pierre-Loup A. Griffais
f6d3af2af6
radv: fix depth transitions with layerCount = VK_REMAINING_ARRAY_LAYERS
...
Interpreting layerCount literally would try to create billions of image
views in radv_process_depth_image_inplace().
Signed-off-by: Pierre-Loup A. Griffais <pgriffais@valvesoftware.com >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
2017-01-07 01:26:08 +01:00
Dave Airlie
d8423772ca
radv: add some asserts for operations on general queue
...
These might be useful in the future, or not.
Signed-off-by: Dave Airlie <airlied@redhat.com >
2016-12-27 03:27:14 +00:00
Timothy Arceri
e1af20f18a
nir/i965/anv/radv/gallium: make shader info a pointer
...
When restoring something from shader cache we won't have and don't
want to create a nir_shader this change detaches the two.
There are other advantages such as being able to reuse the
shader info populated by GLSL IR.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
2016-10-26 14:29:36 +11:00
Dave Airlie
12301c5418
radv: drop the RADV_CALL macro.
...
This is leftover from anv, and we really never needed it.
Signed-off-by: Dave Airlie <airlied@redhat.com >
2016-10-12 08:56:41 +10:00
Dave Airlie
f4e499ec79
radv: add initial non-conformant radv vulkan driver
...
This squashes all the radv development up until now into
one for merging.
History can be found:
https://github.com/airlied/mesa/tree/semi-interesting
This requires llvm 3.9 and is in no way considered
a conformant vulkan implementation. It can run a number
of vulkan applications, and supports all GPUs using
the amdgpu kernel driver.
Thanks to Intel for providing anv and spirv->nir,
and Emil Velikov for reviewing build integration.
Parts of this are:
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com >
Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net >
Authors: Bas Nieuwenhuizen and Dave Airlie
Signed-off-by: Dave Airlie <airlied@redhat.com >
2016-10-07 09:16:09 +10:00