Commit Graph

986 Commits

Author SHA1 Message Date
Jason Ekstrand 5abc05f1df vulkan/wsi/x11: Don't leak shm_reply if we don't have dri3 or present
Fixes: b5c390c113 ("vulkan/wsi: add support for detecting mit-shm pixmaps.")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17388>
2022-07-07 11:44:19 -05:00
Jason Ekstrand 124848bf9e vulkan/wsi: Support tiled CPU images
Some drivers such as lavapipe are 100% fine with using linear for WSI
images.  Most HW drivers, however, would rather render tiled and eat a
blit.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17388>
2022-07-07 11:44:19 -05:00
Jason Ekstrand 83fb6fe569 vulkan/wsi: Align buffer image strides to optimalBufferCopyRowPitchAlignment
This isn't a big deal for the current buffer paths because the required
alignment for PRIME is already higher than any driver advertises.
However, the SW path we're about to add won't have the PRIME requirement.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17388>
2022-07-07 11:44:17 -05:00
Jason Ekstrand 13148b9c68 vulkan/wsi: Compute stride and size in configure_buffer_image
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17388>
2022-07-07 11:44:10 -05:00
Jason Ekstrand cf37837d36 vulkan/wsi: Persistently map CPU images
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17388>
2022-07-07 11:44:09 -05:00
Jason Ekstrand 1d0290fbfe vulkan/wsi: Delete SW support from configure_native_image
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17388>
2022-07-07 10:21:35 -05:00
Jason Ekstrand 4c79ec1934 vulkan/wsi/wayland: Use wsi_configure_cpu_image
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17388>
2022-07-07 10:21:34 -05:00
Jason Ekstrand 3d48b3c6f8 vulkan/wsi/x11: Use wsi_configure_cpu_image
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17388>
2022-07-07 10:21:33 -05:00
Jason Ekstrand afe2cb7b11 vulkan/wsi: Add a helper for creating CPU images
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17388>
2022-07-07 10:21:30 -05:00
Jason Ekstrand 1cc20fbefd vulkan/wsi: Move select_memory_type to common and rework it a bit
Instead of taking a single boolean for device-local, take a set of
required properties and denied properties.  This will let us require
additional things like being CPU mappable in the future.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17388>
2022-07-07 10:21:29 -05:00
Jason Ekstrand fbb7b6e052 vulkan/wsi/wayland: Use a single memcpy in the SW path
The strides match.  There's no reason to loop over image height.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17388>
2022-07-07 10:21:27 -05:00
Jason Ekstrand ca6bd57e76 vulkan/wsi: Pass the size to MapMemory in the SW path
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17388>
2022-07-07 10:21:24 -05:00
Chia-I Wu 3831079fdf vulkan/device_select: remove get_pdevice_proc_addr
It is optional and is needed only when a layer has physical device
extensions that may be unknown to the loader.

This simplifies the layer a bit, but more importantly, it works around a
bug in the loader when there is another layer in the layer chain that
wraps VkInstance.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16307>
2022-07-06 23:53:25 +00:00
Hans-Kristian Arntzen 0119de08f2 vulkan: Add common code for VK_EXT_shader_module_identifier.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17332>
2022-07-06 16:27:21 +00:00
Hans-Kristian Arntzen 6d66a43a70 vulkan: Update Vulkan XML and headers to 1.3.219.
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17332>
2022-07-06 16:27:21 +00:00
Jordan Justen d5884a716f vulkan/wsi: Disable dma-buf sync file if ENOSYS is returned
ENOSYS is commented as "Invalid system call number". This is returned
by qemu-user for unbridged ioctls.

Fixes: 30b57f10b3 ("vulkan/wsi: Signal semaphores and fences from the dma-buf")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17325>
2022-07-01 10:28:34 +00:00
Jason Ekstrand d06335ed76 vulkan: Depend on vk_pipeline_layout in vk_cmd_enqueue
Now that we have a common pipeline layout with reference counting, we
don't need these driver hooks for reference counting anymore.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17286>
2022-06-29 20:31:58 +00:00
Jason Ekstrand e6c75bcd9c vulkan: Add a common implementation of pipeline layouts
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17286>
2022-06-29 20:31:57 +00:00
Jason Ekstrand 949ce92f05 vulkan: Add a base struct for descriptor set layouts
There's some tricky stuff in here with properly handling Vulkan
allocation scopes and reference counting.  Probably best to do it once.
Also, this means that common code can now take references to descriptor
set layouts which seems useful.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17286>
2022-06-29 20:31:57 +00:00
Jason Ekstrand d46db2e5a6 vulkan: Fix a comment
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17286>
2022-06-29 20:31:57 +00:00
Jesse Natalie d4f7f21fa5 vulkan_entrypoints_gen: For Windows ARM64EC, prefix symbols with '#'
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17267>
2022-06-29 01:18:19 +00:00
Boris Brezillon 542538cf02 vulkan: Add a vk_pipeline_hash_shader_stage() helper
All drivers implement some sort of shader hashing, but each of
them does it slightly differently. Let's provide a generic helper
to avoid new copies of the same logic and encourage new drivers
to use one of the already implemented function.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17186>
2022-06-28 09:07:32 +00:00
Jason Ekstrand 21374eb777 vulkan/render_pass: Support VkAttachmentSampleCountInfoAMD
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16953>
2022-06-24 22:37:53 +00:00
Jason Ekstrand 541819b2d6 vulkan/render_pass: Allow for mixed sample counts
RADV supports VK_AMD_mixed_attachment_samples which does exactly what it
sounds like.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16953>
2022-06-24 22:37:53 +00:00
Jason Ekstrand 7e11cdc77a vulkan/render_pass: Pass sample locations to barriers
This is required for depth/stencil images created with
VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16953>
2022-06-24 22:37:53 +00:00
Jason Ekstrand 6216c59dbb vulkan/render_pass: Use a special layout for self-dependencies
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16953>
2022-06-24 22:37:53 +00:00
Jason Ekstrand 3a204d5cf3 vulkan/render_pass: Add a better helper for render pass inheritance
Instead of making drivers dive into the render pass and framebuffer
themselves, provide a helper that constructs a VkRenderingInfo for a
render pass resume that they can use instead.  This should reduce code
duplication between driver implementations of BeginRendering and
BeginCommandBuffer.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16953>
2022-06-24 22:37:53 +00:00
Jason Ekstrand 8ce7faab47 vulkan: Add a vk_pipeline_shader_stage_to_nir helper
This is similar to vk_shader_module_to_nir only it takes a
VkPipelineShaderStageCreateInfo and handles
VK_KHR_graphics_pipeline_library semantics for when a
VkShaderModuleCreateInfo is provided instead of an actual module.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17196>
2022-06-23 15:41:00 +00:00
Jason Ekstrand 288c1c29fb vulkan/nir: Make spirv_data const in vk_spirv_to_nir
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17196>
2022-06-23 15:41:00 +00:00
Jason Ekstrand 981cf8a41d vulkan: Add some border color helpers
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15359>
2022-06-23 00:01:41 +00:00
Dave Airlie d3e723fb77 wsi/x11: add xcb_put_image support for larger transfers.
This was noticed as a problem in the EGL code, just fixup wsi.

Cc: mesa-stable
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17155>
2022-06-22 03:28:21 +00:00
Jason Ekstrand 64d074879b vulkan/wsi: Use HAVE_LIBDRM to detect DRM instead of !_WIN32
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17170>
2022-06-22 01:15:20 +00:00
Lionel Landwerlin efc398c722 vulkan/wsi: fix crash with debug names on swapchain
If you set a name of on a swapchain object, because the base object
struct has not been initialized with a VkDevice,
vk_object_base_finish() will segfault when trying to free the object
name.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: cb1e0db23e ("vulkan/wsi: Make wsi_swapchain inherit from vk_object_base")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17165>
2022-06-21 17:05:10 +00:00
Yonggang Luo 1173c0f33a meson: Using get_argument_syntax as the `--compiler_id` option for gen_vs_module_defs.py
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17065>
2022-06-16 19:59:58 +00:00
Jan Beich 78523eea2f vulkan/wsi: treat EBADF as missing DMA_BUF_IOCTL_{EXPORT,IMPORT}_SYNC_FILE
FreeBSD supports DMA-BUF but not DMA_BUF_IOCTL_SYNC and similar yet.
As it returns EBADF instead of ENOTTY all consumers fail due to
VK_ERROR_OUT_OF_HOST_MEMORY.

Fixes: 30b57f10b3 ("vulkan/wsi: Signal semaphores and fences from the dma-buf")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17070>
2022-06-16 02:33:23 +00:00
Boris Brezillon b78d3ebe72 vulkan/util: Fill VkPhysicalDeviceIDProperties::deviceNodeMask
This field copy was missing in
vk_get_physical_device_core_1_1_property_ext().

Fixes: 19ff5019b7 ("vulkan: Add helpers for filling exts for core features and properties.")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16926>
2022-06-14 22:44:42 +00:00
Erik Faye-Lund 2c43044507 vulkan/util: assume c11
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16908>
2022-06-14 15:08:37 +00:00
Renato Pereyra 2ef6b0aab1 Revert "wsi/x11: Avoid using xcb_wait_for_special_event in FIFO modes"
This reverts commit 44a20baeb8.

Signed-off-by: Renato Pereyra <renatopereyra@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16954>
2022-06-13 17:58:46 +00:00
Renato Pereyra ee587f202e Revert "wsi/x11: Don't leak xcb_get_geometry_reply_t."
This reverts commit 24049b8771.

Signed-off-by: Renato Pereyra <renatopereyra@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16954>
2022-06-13 17:58:46 +00:00
Jason Ekstrand 30b57f10b3 vulkan/wsi: Signal semaphores and fences from the dma-buf
Instead of attempting to signal based on the memory object, use the new
DMA_BUF_IOCTL_EXPORT_SYNC_FILE to get a sync_file for the dma-buf and
use that to signal the semaphore or fence.  Because this happens before
we transfer ownership back to the driver, the resulting sync_file should
only contain dma_fences from the compositor and/or display and shouldn't
be mixed up with the driver in any way.  This gives us a real semaphore
and fence (as opposed to the dummy objects we've used int the past)
without over-synchronization.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4037>
2022-06-10 01:33:12 +00:00
Jason Ekstrand 18bd05827d vulkan/wsi: Set memory ownership after signaling fences and semaphores
This isn't a functional change today because the set of drivers which
use set_ownership and those that use signal_fence/semaphore_for_memory
are mutually exclusive.  It's important for the next commit, though.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4037>
2022-06-10 01:33:12 +00:00
Jason Ekstrand 6930f08860 vulkan/wsi: Re-arrange QueueSubmit code in wsi_common_queue_present
Instead of treating the blit submit specially in the buffer_blit_queue
case, treat the dummy submit as special.  This lets us keep all the
handling of special-queue blits together.  It also means that the
wsi_memory_signal_submit_info gets chained into the final submit which
is what we want if we're to rely on it for implicit sync.  If we chain
it into the dummy submit, we'll implicit sync on all work previous to
the blit but not the blit.  This won't work if X11 or a Wayland
compositor is depending on that to synchronize the linear copy.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4037>
2022-06-10 01:33:12 +00:00
Jason Ekstrand bee3d2e156 vulkan/wsi: Reset fences earlier in wsi_common_queue_present
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4037>
2022-06-10 01:33:12 +00:00
Jason Ekstrand d211f4891a vulkan/wsi: Use a STACK_ARRAY for stage_flags
This avoids the heap allocation in the common case.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4037>
2022-06-10 01:33:12 +00:00
Jason Ekstrand b03216de9c wsi: Always signal semaphores and fences in wsi_common_acquire_next_image
If the driver wants to do something special, it can reset the semaphore
or fence again and re-signal it.  Sure, that wastes a malloc/free but
this is the window-system path.  It'll be fine.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4037>
2022-06-10 01:33:12 +00:00
Jason Ekstrand e32892130f vulkan/wsi: Fix a signal_semaphore_with_memory check
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4037>
2022-06-10 01:33:12 +00:00
Georg Lehmann d5d16a4f00 vulkan: Spec update to 1.3.217.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12729>
2022-06-09 23:39:43 +00:00
Konstantin Seurer 7c44cb6f5e vulkan: Spec update to 1.3.216
Update the vulkan headers and xml to 1.3.216
including the spirv headers. The new spirv spec
added new OpAlias*INTEL ops, which we ignore in
vtn_gather_types_c.py.

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16430>
2022-06-08 20:20:21 +00:00
Jason Ekstrand c144030f7e vulkan,radv: Steal some image offset/extent helpers from radv
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16873>
2022-06-07 17:57:42 +00:00
Jason Ekstrand 80547e5379 vulkan: Add a helper for image<->buffer copies
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16873>
2022-06-07 17:57:42 +00:00
Jason Ekstrand ed0cd6f654 vulkan/format: Add a vk_format_get_aspect_format helper
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16873>
2022-06-07 17:57:42 +00:00
Jason Ekstrand 69e4d39d18 vulkan,radv: Move vk_format_get_plane_format to common code
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16873>
2022-06-07 17:57:42 +00:00
Jason Ekstrand 2c2b3e68e1 vulkan,anv: Move the image offset/extent sanitize helpers to common code
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16873>
2022-06-07 17:57:41 +00:00
Erik Faye-Lund 6ed10a99bd vulkan/device_select: remove needless c99_compat.h includes
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16812>
2022-06-02 13:09:16 +00:00
Jason Ekstrand 56b66abc0b vulkan/runtime: Add min_lod to vk_image_view
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14129>
2022-05-31 13:42:28 +00:00
Konstantin Seurer 7f1e967c02 vulkan: Use the correct enum in vk_buffer
VkBufferCreateFlags is correct.

Fixes: f6ae21b ("vulkan: Add a base struct for buffers")
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16764>
2022-05-30 17:43:58 +00:00
Jason Ekstrand f6ae21b864 vulkan: Add a base struct for buffers
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16607>
2022-05-27 18:38:42 -05:00
Yogesh Mohan Marimuthu 1a8b03732f vulkan/wsi: fix extra free if buffer_blit_queue
In wsi_destroy_image(), if buffer_blit_queue then
do not call extra free. This will fix assert in
debug release and accessing out of allocated memory.

Fixes:
  7bd5aa111c
  ("vulkan/wsi: add a private transfer pool to exec the DRI_PRIME blit")

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset's avatarSamuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16649>
2022-05-27 09:19:15 +00:00
Yiwei Zhang a19e1f338e vulkan: remove the VkPhysicalDeviceMemoryProperties workaround
cts fix landed in vulkan-cts-1.2.5 while mesa CI has bumped once.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Tested-by: Mark Janes <markjanes@swizzler.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16694>
2022-05-24 23:35:28 +00:00
Jason Ekstrand c24aa449d0 vulkan,anv,turnip: Add a common CmdBindVertexBuffers wrapper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16611>
2022-05-20 02:12:37 +00:00
Jason Ekstrand 8b13ee75ba vulkan: Fall back to raw data objects when deserializing if ops == NULL
This can happen if an object is serialized whose object type isn't in
the pipeline cache import ops.  In this case, we generate a raw data
object and plan to turn it into the right object type later.

Fixes: d35e78bb85 ("vulkan/pipeline_cache: Implement deserialize for raw objects")
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16584>
2022-05-19 14:51:40 +00:00
Jason Ekstrand d35e78bb85 vulkan/pipeline_cache: Implement deserialize for raw objects
When caching NIR, it's cached as a raw object because we cache the
serialized NIR.  When it's then loaded from the disk cache later, we
fail to deserialize it because raw objects are a special case.  There
are two callers of vk_pipeline_cache_object_deserialize(), one of which
has a special case for raw objects and the other is called only when
we've checked that it isn't a raw object.  The special cases are
pointless; raw objects should deserialize themselves.

Fixes: 591da98779 ("vulkan: Add a common VkPipelineCache implementation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16281>
2022-05-18 04:43:10 +00:00
Jason Ekstrand fc8d2543fc vulkan,v3dv: Add a driver_internal flag to vk_image_view_init/create
We already had a little workaround for v3dv where, for some if its meta
ops, it had to bind a depth/stenicil image as color.  Instead of
special-casing binding depth/stencil as color, let's flip on the
drier_internal flag and get rid of most of the checks in that case.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16376>
2022-05-17 18:14:55 +00:00
Jason Ekstrand f99ac7f2de v3dv: Don't use color aspects for depth/stencil images
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16376>
2022-05-17 18:14:55 +00:00
Jason Ekstrand 36e0f9507d vulkan: Only be clever about vk_image_view::view_format for normal views
For color view of depth views, just set whatever format they asked for.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16376>
2022-05-17 18:14:55 +00:00
Erik Faye-Lund 57b353ec6a vulkan/wsi: unbreak win32-support
There's no unistd.h on Windows, let's not include it unconditionally.

But we also don't want to deal with DRM modifiers or DMABUFs on Windows,
so let's also ifdef out the rest of that stuff.

Fixes: a8b009aed6 ("vulkan/wsi: fix missing unistd include")
Fixes: c72ff19a9e ("vulkan/wsi: Close file descriptors in wsi_destroy_image")

Reviewed-By: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16373>
2022-05-16 18:57:06 +00:00
Jason Ekstrand 6899cd2b6e vulkan: Start collecting enabled features in vk_device
We're not trying to make this 100% complete.  For now, all we care about
is robustBufferAccess.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16276>
2022-05-12 10:53:16 +00:00
Karol Herbst 9c5fd100cc nir: add a nir_remove_non_entrypoints helper
This code just got duplicated a lot. There is still more, but the
remaining instances do a bit more than just removing other functions.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16348>
2022-05-10 03:37:44 +00:00
Michel Zou a8b009aed6 vulkan/wsi: fix missing unistd include
fixes: c72ff19a

Closes #6428

Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16353>
2022-05-10 02:37:21 +00:00
Boris Brezillon 718070f0e7 vulkan/wsi: Make wsi_win32_surface_get_capabilities() return the current extent
We can get that information with GetClientRect(), and some applications
complain when the window size doesn't match the currentExtent values.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16394>
2022-05-09 09:31:53 +00:00
Bas Nieuwenhuizen a7f44b6269 vulkan/wsi/x11: Ensure we have the required number of images for acquire.
For games that needs >1 at the same time the existing check wasn't enough.

Cc: mesa-stable
Reviewed-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15132>
2022-05-08 16:27:42 +02:00
Georg Lehmann 24049b8771 wsi/x11: Don't leak xcb_get_geometry_reply_t.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6443
Fixes: 44a20baeb8 ("wsi/x11: Avoid using xcb_wait_for_special_event in FIFO modes")
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16384>
2022-05-08 12:39:05 +00:00
Jason Ekstrand 6214251c03 vulkan/wsi: Add signal_fence/semaphore_for_image helpers
These operations are about to get a bit more complex so let's add a
couple nice helpers to keep things clean.

Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16333>
2022-05-04 22:09:02 +00:00
Jason Ekstrand 233be8ee59 vulkan/wsi: Set the right stage flags for semaphore waits
This is currently technically broken for compute.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16333>
2022-05-04 22:09:02 +00:00
Jason Ekstrand 5f4ee14895 vulkan/wsi: Reset the image fence right before vkQueueSubmit
Instead of resetting at the top of the loop, we create the fence in the
signaled state and then unconditionally reset it before vkQueueSubmit.
This gives us a bit more flexibility with how we handle the fence in the
case where the client provides zero semaphores.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16333>
2022-05-04 22:09:02 +00:00
Jason Ekstrand 5576e8b735 vulkan/wsi: Hang on to file descriptors
Instead of closing the dma-buf file descriptors immediately after
handing them to the window system, hang on to them.  We want to be able
to use them for synchronization.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16333>
2022-05-04 22:09:02 +00:00
Jason Ekstrand 17fb3ad94f vulkan/wsi: Only use a single fd per wsi_image
The only thing this was helping was X11 where the protocol requires that
we pass in an array of images.  We can move all the dup() code to the
X11 back-end and leave the others a bit cleaner.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16333>
2022-05-04 22:09:02 +00:00
Jason Ekstrand c72ff19a9e vulkan/wsi: Close file descriptors in wsi_destroy_image
Most of the time, this is a non-issue because the WSI back-end closes
them as part of handing them to the window-system and sets fds[*] to -1.
The one exception here was Wayland which was closing them but leaving
fds[*] pointing to bogus file descriptors.  Having wsi_destroy_image
close them makes clean-up easier and more reliable.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16333>
2022-05-04 22:09:01 +00:00
Adam Jackson bbdf7e45b1 wsi/x11: Hook up KHR_incremental_present
We create one XFIXES region per swapchain image. If the QueuePresent
comes in with a list of rectangles, we push them into the region and
pass it to xcb_present_pixmap.

The extension is technically just a hint. We still fall back to the
unhinted "update the whole image" path if the update region has more
than an arbitrary number of rects, or if we're stuck using plain
PutImage instead of ShmPutImage.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16218>
2022-05-04 19:31:53 +00:00
Adam Jackson 44a20baeb8 wsi/x11: Avoid using xcb_wait_for_special_event in FIFO modes
If the window is destroyed from underneath us while we happen to be in
xcb_wait_for_special_event, there's no recovery. The special event will
never match because the XID is no longer valid, and Present doesn't have
an in-band DestroyNotify. We're going to work around this by using the
poll API instead. If we get an event we short-circuit back to the top of
the "wait for available image" loop, so we drain the whole special event
queue before any other logic. Which means if we run out of special
events (and the connection and swapchain are still valid) that we
_don't_ have enough images available, so to hurry along any events that
the X server hasn't flushed out yet we call GetGeometry on the
swapchain's window. As a side effect this verifies that the window is
still alive.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15800>
2022-05-04 15:06:51 +00:00
Georg Lehmann bf6372df62 meson: Tell glslang to be quiet.
Without --quiet glslang unconditionally prints the input file name to stdout.
Check if --quiet is supported because some distros only have ancient glslang
versions.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16312>
2022-05-04 11:30:43 +00:00
Iván Briano bf04be17f7 vulkan/wsi/wayland: Fix double free on error condition
If wsi_configure_native_image() fails, it will call
wsi_destroy_image_info() itself, so let's try to not call it again from
wsi_wl_swapchain_destroy().

Fixes the CTS tests:
dEQP-VK.wsi.wayland.swapchain.simulate_oom.*

Fixes: b626a5be43 ("vulkan/wsi/wayland: Split image creation")

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16257>
2022-05-02 19:26:27 +00:00
Lionel Landwerlin 1e7ea18026 vulkan/runtime: 0-out pipeline cache object
I'm running into crashes because cache->cache_object is uninitialized.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 591da98779 ("vulkan: Add a common VkPipelineCache implementation")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16275>
2022-05-02 19:02:42 +00:00
Dave Airlie 85a94be0fe vulkan/wsi: keep allocate queue families in image, just don't fill them
This changes the code so that it only looks at the passed in families
when concurrent, otherwise it always allocates one.

Fixes: 48b3ef625e ("vulkan/wsi: handle queue families properly for non-concurrent sharing mode.")
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Tested-by: Mike Lothian <mike@fireburn.co.uk>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15331>
2022-04-29 10:58:00 +10:00
prashanth 09e4fd1d84 vulkan/device_select: force default device if environment variable set
Force default device if MESA_VK_DEVICE_SELECT_FORCE_DEFAULT_DEVICE
environment variable set. This will not give multiple device
options to app. There are apps that selects gpu to use based on its
own criteria, this patch can force default behaviour for these apps
by giving only one gpu device to select from.

v2: return 0 if no physical device present (Mihai Preda)
v3: document environment variables (Mihai Preda)(Marek Olšák)

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15585>
2022-04-28 08:05:40 +00:00
Jordan Justen 212fb25b26 vulkan/wsi/x11: Use atomic_int with sent_image_count
Without this being atomically incremented and decremented, I observed
this assert triggering in debug builds:

  src/vulkan/wsi/wsi_common_x11.c:x11_present_to_x11_dri3():

  assert(chain->sent_image_count <= chain->base.image_count);

I think this was happening since,

  src/vulkan/wsi/wsi_common_x11.c:x11_handle_dri3_present_event()

which decrements chain->sent_image_count may be run in a separate
thread.

Fixes: d0bc1ad377 ("vulkan/wsi/x11: add sent image counter")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15908>
2022-04-27 20:52:53 -07:00
Erik Faye-Lund 3620e7e71c vulkan: drop empty vulkan_wsi_args
This is always empty, so let's just get rid of it.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16162>
2022-04-27 11:51:26 +00:00
Erik Faye-Lund 6623f60c34 vulkan: use c_msvc_compat_args for shared code
Due to both Lavapipe on Windows and Dozen, we need to support MSVC in
the shared Vulkan code. So let's make sure we compile with the
compatibility flags for it.

Techinically speaking, we also need this in the wsi subdir, because we
also compile wsi_common_win32.c with MSVC. But wsi_common_wayland.c
contains void-pointer arithmetic, causing compiler errors if we do.

Fixing that properly is a bit more involved, because Meson doesn't love
passing different compiler arguments per source-file. The alternative is
to remove the void-pointer arithmetic, but that seems a bit pointless as
this code will never be compiled on MSVC.

So, let's leave that one out for now. We can probably do better in the
future, but this gets us a step further.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6386
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16162>
2022-04-27 11:51:26 +00:00
Konstantin Seurer 1873880b50 vulkan: Add a shader module clone helper
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16027>
2022-04-26 18:20:11 +00:00
Jason Ekstrand 37d4b72ff3 vulkan/log: Allow but warn for client-invisible objects
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16107>
2022-04-26 16:22:23 +00:00
Jason Ekstrand 62a44d1bda vulkan/log: Allow but warn if called with a NULL object
Most of the time when the logging code is invoked, it means we're
already in an edge case.  It should be as robust as possible, otherwise
we risk making hard to debug things even harder.  To that end, instead
of blowing up if passed a NULL object on the list, handle it as
gracefully as we can.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16107>
2022-04-26 16:22:23 +00:00
Jason Ekstrand e0f27eca7a vulkan: Use ALL_COMMANDS_BIT for waits/signals instead of ~0
This is a bit more accurate for what's going on and, while all Mesa
drivers today seem to be ok with extra bits, ensures we're passing a
valid Vulkan thing.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16145>
2022-04-26 14:17:28 +00:00
Jason Ekstrand 02fea6c179 vulkan: Set signals[i].stageMask = ALL_COMMANDS for QueueSubmit2 wrapping
My understanding of the signal masks is that they control what stages
must complete before the semaphore is signaled.  Using 0 theoretically
means the semaphore could be signaled immediately without waiting on
anything.  Use ~0 instead to say it depends on everything.

Fixes: 97f0a4494b ("vulkan: implement legacy entrypoints on top of VK_KHR_synchronization2")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16145>
2022-04-26 14:17:28 +00:00
Mike Blumenkrantz 76b2b6ebe9 vk/cache: unbreak vk_pipeline_cache_create with flags
long ago I fixed this in individual drivers

now I fix it in all drivers

Fixes: 591da98779 ("vulkan: Add a common VkPipelineCache implementation"

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16149>
2022-04-25 22:22:56 +00:00
Mike Blumenkrantz f5bc062ffd vulkan: bump layer api versions to current vk header version
should probably try to keep these in sync? maybe?

cc: mesa-stable

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16138>
2022-04-25 19:56:39 +00:00
Erik Faye-Lund d217fb9b0a vulkan: do not depend on alignof(void)
alignof(void) is a non-standard GCC extension, and it doesn't compile on
MSVC. But since the Windows CI has been disabled due to stability
issues, a breakage snuk in nevertheless.

Since alignof(char) works the same as alignof(void), let's pass char
instead of void here. That hides the GCC weirdness without doing any
functional changes.

Fixes: 591da98779 ("vulkan: Add a common VkPipelineCache implementation")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16134>
2022-04-25 15:34:38 +00:00
Jason Ekstrand 93d0c66b27 vulkan/pipeline_cache: Add helpers for storing NIR in the cache
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13184>
2022-04-22 19:38:52 +00:00
Jason Ekstrand 591da98779 vulkan: Add a common VkPipelineCache implementation
This is partly copied+pasted from ANV but is mostly new code with lots
of reference counting bugs fixed (I hope!).  The new cache caches
"object" which derive from a base vk_pipeline_class_object struct.  It
uses a kernel-style "ops" interface for virtual methods on these objects
to allow for easy destruction (when the reference count hits zero) as
well as serialization an deserialization interfaces.  This should allow
drivers to cache basically whatever they want without having to think
too hard about the details.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13184>
2022-04-22 19:38:52 +00:00
Illia Abernikhin dd24ab86cc vulkan/runtime: repair thread safety in method vk_queue_start_submit_thread()
Accessing queue->submit.thread_run without holding lock vk_queue.submit.mutex.
Elsewhere, vk_queue.submit.thread_run is accessed with vk_queue.mutex
held 1 out of 2 times (1 of these accesses strongly imply that it is necessary).

Found by Coverity.
CID: 1503334

Signed-off-by: Illia Abernikhin <illia.abernikhin@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15736>
2022-04-22 14:15:29 +00:00
Yonggang Luo 4ead2f6579 win32: Fixes 32 bits visual studio module definition files by add script gen_vs_module_defs.py
Getting opengl32*.def consistence with Windows SDK.
Getting osmesa.mingw.def's gl* functions consistence with Windows SDK.
stw_* functions are cdecl, not stdcall, so there is no need mangling the symbol.
Fixes egl.def for x86
d3d10sw: Move the place of d3d10_sw.def to d3d10_sw.def.in
Fixes vulkan_lvp.def for x86
Fixes #5552
Remove stdcall-fixup

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/14041>
2022-04-19 19:38:47 +00:00