[Bf-blender-cvs] [b1ba82ba978] temp-vulkan-shader: Fix sampler is a keyword, do not use a parameter name.

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


Commit: b1ba82ba978a39b75d748888aa9f883d9eb9b92c
Author: Jeroen Bakker
Date:   Fri Dec 2 11:26:21 2022 +0100
Branches: temp-vulkan-shader
https://developer.blender.org/rBb1ba82ba978a39b75d748888aa9f883d9eb9b92c

Fix sampler is a keyword, do not use a parameter name.

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

M	source/blender/compositor/realtime_compositor/shaders/library/gpu_shader_compositor_texture_utilities.glsl
M	source/blender/gpu/vulkan/vk_backend.cc

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

diff --git a/source/blender/compositor/realtime_compositor/shaders/library/gpu_shader_compositor_texture_utilities.glsl b/source/blender/compositor/realtime_compositor/shaders/library/gpu_shader_compositor_texture_utilities.glsl
index 128fc6aeaf5..cd99e16add6 100644
--- a/source/blender/compositor/realtime_compositor/shaders/library/gpu_shader_compositor_texture_utilities.glsl
+++ b/source/blender/compositor/realtime_compositor/shaders/library/gpu_shader_compositor_texture_utilities.glsl
@@ -1,35 +1,35 @@
 /* A shorthand for 1D textureSize with a zero LOD. */
-int texture_size(sampler1D sampler)
+int texture_size(sampler1D sampler_1d)
 {
-  return textureSize(sampler, 0);
+  return textureSize(sampler_1d, 0);
 }
 
 /* A shorthand for 1D texelFetch with zero LOD and bounded access clamped to border. */
-vec4 texture_load(sampler1D sampler, int x)
+vec4 texture_load(sampler1D sampler_1d, int x)
 {
-  const int texture_bound = texture_size(sampler) - 1;
-  return texelFetch(sampler, clamp(x, 0, texture_bound), 0);
+  const int texture_bound = texture_size(sampler_1d) - 1;
+  return texelFetch(sampler_1d, clamp(x, 0, texture_bound), 0);
 }
 
 /* A shorthand for 2D textureSize with a zero LOD. */
-ivec2 texture_size(sampler2D sampler)
+ivec2 texture_size(sampler2D sampler_2d)
 {
-  return textureSize(sampler, 0);
+  return textureSize(sampler_2d, 0);
 }
 
 /* A shorthand for 2D texelFetch with zero LOD and bounded access clamped to border. */
-vec4 texture_load(sampler2D sampler, ivec2 texel)
+vec4 texture_load(sampler2D sampler_2d, ivec2 texel)
 {
-  const ivec2 texture_bounds = texture_size(sampler) - ivec2(1);
-  return texelFetch(sampler, clamp(texel, ivec2(0), texture_bounds), 0);
+  const ivec2 texture_bounds = texture_size(sampler_2d) - ivec2(1);
+  return texelFetch(sampler_2d, clamp(texel, ivec2(0), texture_bounds), 0);
 }
 
 /* A shorthand for 2D texelFetch with zero LOD and a fallback value for out-of-bound access. */
-vec4 texture_load(sampler2D sampler, ivec2 texel, vec4 fallback)
+vec4 texture_load(sampler2D sampler_2d, ivec2 texel, vec4 fallback)
 {
-  const ivec2 texture_bounds = texture_size(sampler) - ivec2(1);
+  const ivec2 texture_bounds = texture_size(sampler_2d) - ivec2(1);
   if (any(lessThan(texel, ivec2(0))) || any(greaterThan(texel, texture_bounds))) {
     return fallback;
   }
-  return texelFetch(sampler, texel, 0);
+  return texelFetch(sampler_2d, texel, 0);
 }
diff --git a/source/blender/gpu/vulkan/vk_backend.cc b/source/blender/gpu/vulkan/vk_backend.cc
index 9c62fe14694..b402ef2f503 100644
--- a/source/blender/gpu/vulkan/vk_backend.cc
+++ b/source/blender/gpu/vulkan/vk_backend.cc
@@ -156,6 +156,7 @@ void VKBackend::capabilities_init(VKContext &context)
   GCaps = {};
   GCaps.compute_shader_support = true;
   GCaps.shader_storage_buffer_objects_support = true;
+  GCaps.shader_image_load_store_support = true;
 }
 
 }  // namespace blender::gpu
\ No newline at end of file



More information about the Bf-blender-cvs mailing list