diff options
Diffstat (limited to 'source/blender/gpu/intern/gpu_shader_interface.hh')
-rw-r--r-- | source/blender/gpu/intern/gpu_shader_interface.hh | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/source/blender/gpu/intern/gpu_shader_interface.hh b/source/blender/gpu/intern/gpu_shader_interface.hh index 735b8fea71d..4bd8f245e2b 100644 --- a/source/blender/gpu/intern/gpu_shader_interface.hh +++ b/source/blender/gpu/intern/gpu_shader_interface.hh @@ -34,7 +34,6 @@ #include "BLI_utildefines.h" #include "GPU_shader.h" -#include "gpu_shader_create_info.hh" namespace blender::gpu { @@ -51,7 +50,6 @@ typedef struct ShaderInput { * Base class which is then specialized for each implementation (GL, VK, ...). */ class ShaderInterface { - friend shader::ShaderCreateInfo; /* TODO(fclem): should be protected. */ public: /** Flat array. In this order: Attributes, Ubos, Uniforms. */ @@ -74,7 +72,6 @@ class ShaderInterface { public: ShaderInterface(); - ShaderInterface(const shader::ShaderCreateInfo &info); virtual ~ShaderInterface(); void debug_print(); @@ -132,10 +129,6 @@ class ShaderInterface { static inline const char *builtin_uniform_block_name(GPUUniformBlockBuiltin u); inline uint32_t set_input_name(ShaderInput *input, char *name, uint32_t name_len) const; - inline void copy_input_name(ShaderInput *input, - const StringRefNull &name, - char *name_buffer, - uint32_t &name_buffer_offset) const; /** * Finalize interface construction by sorting the #ShaderInputs for faster lookups. @@ -223,12 +216,8 @@ inline uint32_t ShaderInterface::set_input_name(ShaderInput *input, { /* remove "[0]" from array name */ if (name[name_len - 1] == ']') { - for (; name_len > 1; name_len--) { - if (name[name_len] == '[') { - name[name_len] = '\0'; - break; - } - } + name[name_len - 3] = '\0'; + name_len -= 3; } input->name_offset = (uint32_t)(name - name_buffer_); @@ -236,17 +225,6 @@ inline uint32_t ShaderInterface::set_input_name(ShaderInput *input, return name_len + 1; /* include NULL terminator */ } -inline void ShaderInterface::copy_input_name(ShaderInput *input, - const StringRefNull &name, - char *name_buffer, - uint32_t &name_buffer_offset) const -{ - uint32_t name_len = name.size(); - /* Copy include NULL terminator. */ - memcpy(name_buffer + name_buffer_offset, name.c_str(), name_len + 1); - name_buffer_offset += set_input_name(input, name_buffer + name_buffer_offset, name_len); -} - inline const ShaderInput *ShaderInterface::input_lookup(const ShaderInput *const inputs, const uint inputs_len, const char *name) const |