Vulkan: Initial Compute Shaders support. #104518
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Blocks
#104880 Vulkan: Push constants
blender/blender
Reference: blender/blender#104518
Loading…
Reference in New Issue
No description provided.
Delete Branch "Jeroen-Bakker:vulkan-compute-shaders"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This patch adds initial support for compute shaders 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 that the following test
cases are running as expected
GPUVulkanTest.gpu_shader_compute_vbo
GPUVulkanTest.gpu_shader_compute_ibo
GPUVulkanTest.gpu_shader_compute_ssbo
GPUVulkanTest.gpu_storage_buffer_create_update_read
GPUVulkanTest.gpu_shader_compute_2d
This patch includes:
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 commandbuffer without a backbuffer (
GHOST_getVulkanCommandBuffer
). In orderto do correct command buffer processing we needed access to the queue
owned by GHOST. This is returned as part of the
GHOST_getVulkanHandles
function.
Open topics (not considered part of this patch)
NVIDIA doesn't seem to support 1d textures.
583871c678
toc1b85103fe
Vulkan: Initial Compute Shaders and SSBO support.to Vulkan: Initial Compute Shaders support.Vulkan: Initial Compute Shaders support.to WIP: Vulkan: Initial Compute Shaders support.This looks pretty solid!
I have to admit I could not review this in depth.
I couldn't make it to run on moltenvk. I always get
Error: VK_LAYER_KHRONOS_validation not supported. Error: VK_KHR_portability_enumeration not found. Error: VK_KHR_get_physical_device_properties2 not found. Vulkan Error : intern/ghost/intern/GHOST_ContextVK.cpp:907 : vkCreateInstance(&create_info, __null, &m_instance) failled with VK_ERROR_INCOMPATIBLE_DRIVER
even after following https://stackoverflow.com/a/72791361
But that might be a problem on my end.
@ -0,0 +7,4 @@
#pragma once
#ifdef __APPLE__
Cant we make that part of a header to avoid the duplication?
@ -680,3 +677,4 @@
BLI_assert(geometry_module_ == VK_NULL_HANDLE);
BLI_assert(fragment_module_ == VK_NULL_HANDLE);
BLI_assert(compute_module_ != VK_NULL_HANDLE);
compute_pipeline_ = std::move(VKPipeline::create_compute_pipeline(
WIP: Vulkan: Initial Compute Shaders support.to Vulkan: Initial Compute Shaders support.Patch builds for me with
WITH_VULKAN_BACKEND
enabled.How do we run these tests? I enabled both draw and render Opengl options in CMake, but these do not seem to run any of the GPU ones mentioned in the PR message (and fail a lot for me btw)...
@mont29 I compile with
WITH_GTEST=On
,WITH_OPENGL_DRAW_TEST=On
,WITH_VULKAN_BACKEND=On
.To run the test I normally use the command line
bin/tests/blender_test --gtest_filter=GPUVulkanTest.gpu_shader_compute*
If this doesn't work we can check tomorrow.
Bah forgot to re-enable vulkan before trying again...
Yes tests are working now with this command, not sure why running it with something like `CTest -R "Vulkan" does not work though...
GPUVulkanTest.gpu_shader_compute_1d
is failing for me thoughOnly checked the parts in GHOST currently. I find the API documentation scattering between
GHOST_C-api.h
,GHOST_IContext.h
, and others, fairly confusing...Some functions are documented in several places (some being seemingly more detailed than the others, like for
getVulkanBackbuffer
), others are only documented in the C API header. Would love to see this being harmonized (with e.g. everything in the C API, since I think the C++ headers are only used internally currently?).@ -1204,1 +1204,3 @@
uint32_t *r_graphic_queue_family);
uint32_t *r_graphic_queue_family,
void *r_queue);
void GHOST_GetVulkanCommandBuffer(GHOST_ContextHandle context, void *r_command_buffer);
Documentation? ;)
On NVidia platforms compute 1d test is failing due to:
Commit-id:
7fb1f060ff
Pull request closed