[Bf-blender-cvs] [642bba24a91] temp-vulkan-shader: Added support for compute and shader storage.

Jeroen Bakker noreply at git.blender.org
Fri Dec 2 12:04:58 CET 2022


Commit: 642bba24a91c3b09cfc28ea3405251120f1980e3
Author: Jeroen Bakker
Date:   Fri Dec 2 11:10:16 2022 +0100
Branches: temp-vulkan-shader
https://developer.blender.org/rB642bba24a91c3b09cfc28ea3405251120f1980e3

Added support for compute and shader storage.

===================================================================

M	source/blender/gpu/vulkan/vk_backend.cc
M	source/blender/gpu/vulkan/vk_shader.cc

===================================================================

diff --git a/source/blender/gpu/vulkan/vk_backend.cc b/source/blender/gpu/vulkan/vk_backend.cc
index c7e0b35ef27..9c62fe14694 100644
--- a/source/blender/gpu/vulkan/vk_backend.cc
+++ b/source/blender/gpu/vulkan/vk_backend.cc
@@ -155,6 +155,7 @@ void VKBackend::capabilities_init(VKContext &context)
   /* Reset all capabilities from previous context. */
   GCaps = {};
   GCaps.compute_shader_support = true;
+  GCaps.shader_storage_buffer_objects_support = true;
 }
 
 }  // namespace blender::gpu
\ No newline at end of file
diff --git a/source/blender/gpu/vulkan/vk_shader.cc b/source/blender/gpu/vulkan/vk_shader.cc
index 51dfbb97dee..58b13ea8747 100644
--- a/source/blender/gpu/vulkan/vk_shader.cc
+++ b/source/blender/gpu/vulkan/vk_shader.cc
@@ -510,6 +510,9 @@ static char *glsl_patch_get()
   // TODO: we should remove usage of gl_InstanceID/gl_VertexID.
   STR_CONCAT(patch, slen, "#define gl_InstanceID gpu_InstanceIndex\n");
 
+  STR_CONCAT(patch, slen, "#define DFDX_SIGN 1.0\n");
+  STR_CONCAT(patch, slen, "#define DFDY_SIGN 1.0\n");
+
   /* GLSL Backend Lib. */
   STR_CONCAT(patch, slen, datatoc_glsl_shader_defines_glsl);



More information about the Bf-blender-cvs mailing list