Vulkan: Initial Compute Shaders support. #104518

Closed
Jeroen Bakker wants to merge 31 commits from Jeroen-Bakker:vulkan-compute-shaders into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

31 Commits

Author SHA1 Message Date
Jeroen Bakker 6937a26243 Merge branch 'main' into vulkan-compute-shaders 2023-02-21 14:31:23 +01:00
Jeroen Bakker baf768ecfb Merge branch 'main' into vulkan-compute-shaders 2023-02-21 07:48:58 +01:00
Jeroen Bakker 28220c4505 Merge branch 'main' into vulkan-compute-shaders 2023-02-20 09:23:31 +01:00
Jeroen Bakker 36d6cb2b17 Merge branch 'blender-v3.5-release' 2023-02-20 09:18:53 +01:00
Jeroen Bakker dd76a85011 Merge branch 'blender-v3.5-release' 2023-02-20 08:12:35 +01:00
Jeroen Bakker 64f81d7c29 Merge branch 'main' into vulkan-compute-shaders 2023-02-18 17:41:22 +01:00
Jeroen Bakker c7b9a5a759 Remove binding clashing between textures and images. 2023-02-17 11:29:20 +01:00
Jeroen Bakker 902250a704 Remove debug statement. 2023-02-17 10:15:14 +01:00
Jeroen Bakker aca7d7ed35 Add support for shaders without any resources. 2023-02-17 10:05:29 +01:00
Jeroen Bakker 59c667b524 Merge branch 'main' into vulkan-compute-shaders 2023-02-17 09:55:33 +01:00
Jeroen Bakker 5079127a5a Merge branch 'main' into vulkan-compute-shaders 2023-02-17 09:50:43 +01:00
Jeroen Bakker 1a6a97d8df Add support for shader input lookup in shaders using samplers + images. 2023-02-17 09:40:17 +01:00
Jeroen Bakker 74c505c25d Separate descriptor set bindings and gpu module bindings. 2023-02-17 09:00:44 +01:00
Jeroen Bakker 380e69148e Check if image format is supported. 2023-02-16 12:13:14 +01:00
Jeroen Bakker 4fcaf128b0 Added documentation to the GHOST C-api and Context. 2023-02-16 10:25:44 +01:00
Jeroen Bakker 68bbed1e4b Added initial support for sampling. 2023-02-16 09:27:29 +01:00
Jeroen Bakker 26b0c7c3fb Increase descriptor pool resources.
Added image samplers and uniform buffers. Required for
shader builder.
2023-02-16 07:50:25 +01:00
Jeroen Bakker bbece58e98 Merge branch 'main' into vulkan-compute-shaders 2023-02-14 15:13:12 +01:00
Jeroen Bakker d75180cfba Improve comments of known limitations of the implementation. 2023-02-14 14:43:15 +01:00
Jeroen Bakker a2ba452c31 Move common data conversions to vk_common. 2023-02-14 14:23:41 +01:00
Jeroen Bakker 22cc7f7749 Fixed unneeded std::move. 2023-02-14 14:07:30 +01:00
Jeroen Bakker 6225cb7c94 Introduce vk_common. 2023-02-14 13:46:31 +01:00
Jeroen Bakker 64c20b4d6e Add support for 2d and 3d textures. 2023-02-14 12:58:11 +01:00
Jeroen Bakker fda61f18d1 Add support for 1d textures. 2023-02-14 12:38:20 +01:00
Jeroen Bakker afa2d25db0 Added 1d texture, bind as image. Descriptor sets still needs to be updated. 2023-02-13 16:08:55 +01:00
Jeroen Bakker 319c79128d Fix ssbo name change during merge. 2023-02-13 14:24:55 +01:00
Jeroen Bakker 0295a2e2fa Merge branch 'main' into vulkan-compute-shaders 2023-02-13 13:58:47 +01:00
Jeroen Bakker 8b6db40ccc Use guardedalloc for vulkan allocations. 2023-02-13 13:56:26 +01:00
Jeroen Bakker 0331654760 Added initial support for index buffers. 2023-02-13 13:29:56 +01:00
Jeroen Bakker 95609c174e Fix missing create info for ssbo test. 2023-02-13 09:45:52 +01:00
Jeroen Bakker 366404d274 Vulkan: Initial Compute Shaders and SSBO+VBO support.
This patch adds initial support for compute shaders and SSBOs to
the vulkan backend. As the development is oriented to the test-
cases we have the implementation is limited to what is used there.

It has been validated that with this patch 2 test cases are running
as expected
- `GPUVulkanTest.gpu_shader_compute_ssbo`
- `GPUVulkanTest.gpu_storage_buffer_create_update_read`

This patch includes:
- Allocating VkBuffer on device.
- Uploading data from CPU to VkBuffer.
- Binding VkBuffer as SSBO to a compute shader.
- Execute compute shader and altering VkBuffer.
- Download the VkBuffer to CPU ram.
- Validate that it worked.

GHOST API has been changed as the original design was created before
we even had support for compute shaders in blender. The function `GHOST_getVulkanBackbuffer` has been separated to retrieve the command
buffer without a backbuffer (`GHOST_getVulkanCommandBuffer`). In order
to do correct command buffer processing we needed access to the queue
owned by GHOST. This is returned as part of the `GHOST_getVulkanHandles`
function.
2023-02-13 09:36:43 +01:00