Keith Packard
a60767ec26
vulkan/x11: Mark present complete using serial instead of MSC
...
Present operations do not necessarily complete after the requested
time; if the CRTC has been blanked, they will complete
immediately. This means we cannot use the MSC value to tell when a
present has finished.
Instead of using MSC, track whether each present is complete by serial
number, which is the low 32-bits of the SBC value. This value is
provided in the present_pixmap request and returned in the present
complete notify event.
Signed-off-by: Keith Packard <keithp@keithp.com >
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com >
Reviewed-by: Adam Jackson <ajax@redhat.com >
2021-04-26 11:55:46 -07:00
Jason Ekstrand
d5ee5f6104
vulkan: Update the XML and headers to 1.2.177
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10460 >
2021-04-26 15:13:19 +00:00
Lionel Landwerlin
2b49d5d193
vulkan: bump headers/registry to version 1.2.175
...
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Tapani Pälli <tapani.palli@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10206 >
2021-04-22 15:34:52 +00:00
Michel Zou
48d31a6280
meson: link vulkan_util with link_whole on mingw
...
It was missing for mingw.
Closes #4633
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Acked-by: James Park <jpark37@lagfreegames.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10276 >
2021-04-19 22:46:30 +00:00
Michel Zou
dc036b1769
vulkan: fix duplicate win32 def
...
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10276 >
2021-04-19 22:46:30 +00:00
Lionel Landwerlin
f90d625841
vulkan/util: cast enums to int64_t in switch
...
With the new Vulkan Video extensions a bunch of enum values have been
added. The problem is that those are behind #ifdef so our generated
code complains that we using enum values not defined.
Since we're not using enum names but integer values, we can silence
all those by casting the enum type to int64_t.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10304 >
2021-04-19 06:14:11 +00:00
Michel Dänzer
2928c21eb7
Convert most remaining free-form fall-through comments to FALLTHROUGH
...
One exception is src/amd/addrlib/, for which -Wimplicit-fallthrough is
explicitly disabled.
Reviewed-by: Eric Anholt <eric@anholt.net >
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com >
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com >
Reviewed-by: Gert Wollny <gert.wollny@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10220 >
2021-04-15 16:01:22 +00:00
James Park
d32512effc
vulkan/util: Use util_bitcount
...
__builtin_popcount is not available on all compilers.
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com >
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10159 >
2021-04-12 03:25:59 +00:00
Jason Ekstrand
22478bb0e4
vulkan: Add a vk_object_multialloc helper
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10123 >
2021-04-10 02:18:02 +00:00
Chad Versace
5e6db19168
anv: Remove vkCreateDmaBufINTEL (v4)
...
Superceded by VK_EXT_image_drm_format_modifier.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com > (v1)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net > (v4)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1466 >
2021-04-08 14:15:55 +00:00
Chad Versace
0845cabc72
vulkan: Track dependencies of Python imports
...
The meson.build was unaware of transitive dependencies introduced by
Python imports.
Android still needs fixing. But I did not update the Android files lest
I break the build.
Ideally, we would fix this by using a Python runner that generates
a depfile, similar to how meson creates depfiles for C files by passing
flags -MD -MQ -MF to gcc. But this patch gets the job done, without
stalling on the ideal general solution, by manually tracking the Python
imports in new 'foo_depend_files' variables.
CC: mesa-stable@lists.freedesktop.org
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1466 >
2021-04-08 14:15:54 +00:00
Michel Dänzer
8ec530d982
wsi/x11: Wait for fences with IMMEDIATE on Xwayland
...
The commit below was already meant to do this, but accidentally missed
this part.
Fixes stutter when the frame-rate drops below the refresh rate.
Fixes: e8f50bd600 "wsi/x11: Treat IMMEDIATE present mode the same as
MAILBOX for Xwayland"
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10026 >
2021-04-07 13:20:20 +00:00
Mauro Rossi
1b3a0f8829
vulkan/util: Fix implicit declaration of ffs for Android build
...
Similar to 641320ce02 and 68bb26af63 to avoid Android build errors
Fixes the following building error:
In file included from external/mesa/src/vulkan/util/vk_util.c:28:
external/mesa/src/vulkan/util/vk_util.h:248:30: error: implicit declaration of function 'ffs' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
return (gl_shader_stage) (ffs((uint32_t) vk_stage) - 1);
^
1 error generated.
Fixes: 06ebbde630 ("vulkan: Deduplicate mesa stage conversion")
Acked-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10023 >
2021-04-04 17:04:04 +02:00
Alyssa Rosenzweig
06ebbde630
vulkan: Deduplicate mesa stage conversion
...
Across every driver...
v2: Add casts to appease -fpermissive used on CI.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9477 >
2021-04-03 17:34:39 +00:00
Keith Packard
8c7940cc0f
wsi/x11: Fix type of target_msc argument to x11_present_to_x11_dri3
...
Broken out of VK_GOOGLE_display_timing patch
Cc: stable
Co-author: Jakob Bornecrantz <jakob@collabora.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com >
Signed-off-by: Keith Packard <keithp@keithp.com >
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9939 >
2021-04-01 17:39:47 +00:00
Bas Nieuwenhuizen
83c92a48b7
vulkan: Fix descriptor set creation with zero bindings.
...
MAX2(count * struct size, 1) results in 1 for count=0, not the size of a struct.
Since this MAX only seems to exist so we can keep using NULL for error reporting,
just refactor to return a VkResult.
Fixes: ad241b15a9 ("vk: consolidate dynamic descriptor binding sorting")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4522
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Acked-by: Dave Airlie <airlied@redhat.com >
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9880 >
2021-03-29 23:32:50 +00:00
Lionel Landwerlin
54fe5b0482
meson: switch vulkan layer to list of choices
...
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Acked-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2832 >
2021-03-25 19:10:03 +00:00
Samuel Pitoiset
0ce6b625a2
vulkan: add common entrypoints for VK_KHR_create_renderpass2
...
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/9601 >
2021-03-24 11:21:53 +00:00
Mauro Rossi
cd1d8b4371
android: vulkan/util: add vk_descriptors.{c,h} to Makefile.sources
...
Fixes the following building errors:
FAILED: out/target/product/x86_64/obj/SHARED_LIBRARIES/vulkan.radv_intermediates/LINKED/vulkan.radv.so
...
ld.lld: error: undefined symbol: vk_create_sorted_bindings
>>> referenced by radv_descriptor_set.c:158 (external/mesa/src/amd/vulkan/radv_descriptor_set.c:158)
...
ld.lld: error: undefined symbol: vk_create_sorted_bindings
>>> referenced by radv_descriptor_set.c:340 (external/mesa/src/amd/vulkan/radv_descriptor_set.c:340)
Fixes: ad241b15a9 ("vk: consolidate dynamic descriptor binding sorting")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9766 >
2021-03-23 20:29:55 +01:00
Mike Blumenkrantz
ad241b15a9
vk: consolidate dynamic descriptor binding sorting
...
this code was duplicated across several drivers
Reviewed-by: Adam Jackson <ajax@redhat.com >
turnip changes Reviewed-by: Hyunjun Ko <zzoon@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9480 >
2021-03-22 16:51:55 +00:00
Iago Toral Quiroga
1e4abf1fe3
vulkan/util: call glsl_type_singleton_init_or_ref from vk_instance_init
...
v2: link libvulkan_util with libglsl so it can find the glsl singleton symbols.
v3: link with libcompiler instead of libglsl (Jason)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com >
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com > for the v3dv bits.
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com > for the turnip bits.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com > for the radv bits.
Acked-by: Dave Airlie <airlied@redhat.com > for the lvp bits.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9457 >
2021-03-17 08:15:36 +01:00
Samuel Pitoiset
7c68a2518f
vulkan: add missing vk_shader_module.c/h includes to Makefile
...
Fixes: 76078ed9fe ("vk/util: add unified shader module struct/functions")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9620 >
2021-03-16 16:01:10 +01:00
Mike Blumenkrantz
a41e98ddca
vk/util: add a util macro for initializing stack vk_shader_module structs
...
radv does a lot of this, so having a central dispatch point will be useful in
case changes are made to this struct in the future
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9508 >
2021-03-15 21:47:44 +00:00
Mike Blumenkrantz
76078ed9fe
vk/util: add unified shader module struct/functions
...
there's some extra logging stuff dumped into here to match functionality,
eventually that should also be consolidated into vk_util.c
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9508 >
2021-03-15 21:47:44 +00:00
Michel Zou
862671369d
vulkan: fix CreateRenderPass prototype
...
Fixes compilation on win32
Fixes: 2523c477 " turnip: Move the CreateRenderPass wrapper..."
Reviewed-by: Dave Airlie <airlied@redhat.com >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9530 >
2021-03-12 17:37:38 +00:00
Jason Ekstrand
e7e297732e
vulkan/alloc: Use char * for pointer arithmetic
...
MSVC doesn't like arithmetic on void *.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9511 >
2021-03-10 20:59:59 -06:00
Jason Ekstrand
492b5577f0
vulkan/util: Add a type parameter to vk_multialloc_add
...
We also switch from using __alignof__ to alignof() in util/macros.h
which works on MSVC with the one unfortunate downside of requiring an
actual type and not a value.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9511 >
2021-03-10 20:59:56 -06:00
Jason Ekstrand
c120edd8e8
vulkan/alloc: Add VK_MULTIALLOC_DECL macros
...
These both declare the variable and add it to the allocator in one go.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9511 >
2021-03-10 20:59:55 -06:00
Jason Ekstrand
5afdbfe0c8
vk/alloc: Handle zero sizes better in vk_multialloc_add
...
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9511 >
2021-03-10 20:59:53 -06:00
Jason Ekstrand
c22267262e
vulkan: Use ALWAYS_INLINE for multialloc
...
This way it properly compiles on Visual Studio.
Fixes: 145444d265 "anv: Move multialloc to common code"
Acked-by: Daniel Stone <daniels@collabora.com >
Acked-by: Rob Clark <robdclark@chromium.org >
Reviewed-by: Eric Anholt <eric@anholt.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9506 >
2021-03-10 23:15:17 +00:00
Jason Ekstrand
b302159b1c
vulkan: Preserve preserve attachments in CreateRenderPass
...
This is trivial so I really don't know why it wasn't handled in the
initial turnip code.
Reviewed-by: Eric Anholt <eric@anholt.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8857 >
2021-03-10 18:17:31 +00:00
Jason Ekstrand
147187f754
vulkan: Add some asserts and checks for multiview in CreateRenderPass
...
Reviewed-by: Eric Anholt <eric@anholt.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8857 >
2021-03-10 18:17:31 +00:00
Jason Ekstrand
5de355b0f9
vulkan: Use correct aspectMask in CreateRenderPass
...
If a VkRenderPassInputAttachmentAspectCreateInfo is provided, we use the
aspects specified there. Otherwise, we default to every aspect in the
format. For attachments which are not input attachments, aspectMask is
left zero.
Reviewed-by: Eric Anholt <eric@anholt.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8857 >
2021-03-10 18:17:31 +00:00
Jason Ekstrand
4fb6c051c9
anv: Move vk_format helpers to common code
...
The Android ones we put in anv_android.c. Maybe one day we'll want a
vk_android.h to put some common Android stuff but, for now, let's keep
it contained to ANV's android code.
Reviewed-by: Eric Anholt <eric@anholt.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8857 >
2021-03-10 18:17:31 +00:00
Jason Ekstrand
c7345bd1fb
vulkan: Use VK_MULTIALLOC in CreateRenderPass
...
The variable-length stack allocations are causing issues with ubsan when
the array size is zero. Also, a heap allocation is probably safer.
Reviewed-by: Eric Anholt <eric@anholt.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8857 >
2021-03-10 18:17:31 +00:00
Jason Ekstrand
145444d265
anv: Move multialloc to common code
...
Reviewed-by: Eric Anholt <eric@anholt.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8857 >
2021-03-10 18:17:31 +00:00
Jason Ekstrand
2523c47720
turnip: Move the CreateRenderPass wrapper to common code
...
Reviewed-by: Eric Anholt <eric@anholt.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8857 >
2021-03-10 18:17:31 +00:00
Georg Lehmann
fb1100d718
vulkan/device_select: Only call vkGetPhysicalDeviceProperties2 if the device supports it.
...
vkGetPhysicalDeviceProperties2 is not allowed to be used with a 1.0 device
because it's a vulkan 1.1 function.
Closes : #4396
Fixes: 38ce8d4d ("vulkan/device_select: Stop using device properties 2.")
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9462 >
2021-03-09 15:00:57 +00:00
James Park
98c622a96e
vulkan: Update dispatch table gen for Windows
...
Update entry null test to deal with MSVC not supporting weak functions.
Also fix warnings for returning from void functions.
Acked-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9121 >
2021-02-26 04:29:52 +10:00
James Park
10244fe76e
vulkan: Fix source list for vulkan_wsi on Windows
...
I don't think link_whole works right for VS project generation, but MSVC
doesn't support GCC weak functions anyway, so work around it.
Acked-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9121 >
2021-02-26 04:29:52 +10:00
Michel Zou
8af568e4ae
vulkan: implement wsi_win32 backend
...
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7208 >
2021-02-25 03:41:36 +00:00
James Park
9f30370654
vulkan: Use typed outarray API
...
MSVC cannot perform GCC __typeof__ for C code. (C++ has decltype.)
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9208 >
2021-02-23 17:18:11 +10:00
Bas Nieuwenhuizen
38ce8d4d00
vulkan/device_select: Stop using device properties 2.
...
We have to choose between:
1) Stop handling two identical GPUs
2) Stop having crashes with other layers active.
3) Fix the Vulkan Loader.
Since nobody seems to want to spend enough effort to do 3 the
effective choice is between 1 and 2. This is choosing 2, as
two identical GPUs is pretty uncommon since crossfire doesn't
work on Linux anyway.
(And it would only work sporadically as the game needs to enable the
extension)
CC: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3801
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8414 >
2021-02-22 13:18:53 +00:00
Dave Airlie
5a340c0929
vulkan/util: add api to reset object magic + private data.
...
This will be used to for reissuing dispatchable objects like
command buffers.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9145 >
2021-02-22 09:32:13 +10:00
Michel Zou
6ccbb89207
meson: invalid keyword argument dependencies
...
Fixes: e4cc52c0 (vulkan: Add common extension tables)
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8821 >
2021-02-16 11:35:32 +00:00
Lionel Landwerlin
3414d4fdc5
vulkan: document flags choice for vkGetDeviceQueue
...
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9053 >
2021-02-15 21:01:28 +02:00
Michel Zou
664a803879
vulkan: Fix windows api conflict
...
It must be undefined in the header too
Fixes: e487ae1b
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8975 >
2021-02-11 17:56:27 +00:00
Michel Zou
e487ae1b99
vulkan: Fix windows api conflict
...
Closes #4247
Acked-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8956 >
2021-02-10 17:10:50 +00:00
Michel Zou
2ef3dca476
vulkan/lavapipe: add missing VKAPI_ATTR/CALL
...
Acked-by: Jose Fonseca <jfonsec@vmware.com >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8823 >
2021-02-09 19:21:03 +00:00
Jason Ekstrand
2d6de5d227
anv,vulkan: Move anv_icd.py to a common location
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Tested-by: Tapani Pälli <tapani.palli@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8792 >
2021-02-04 20:02:12 +00:00