|
Blender
V2.93
|
#include <gpu_shader_interface.hh>
Inherited by blender::gpu::GLShaderInterface.
Public Member Functions | |
| ShaderInterface () | |
| virtual | ~ShaderInterface () |
| void | debug_print (void) |
| const ShaderInput * | attr_get (const char *name) const |
| const ShaderInput * | ubo_get (const char *name) const |
| const ShaderInput * | ubo_get (const int binding) const |
| const ShaderInput * | uniform_get (const char *name) const |
| const ShaderInput * | texture_get (const int binding) const |
| const char * | input_name_get (const ShaderInput *input) const |
| int32_t | uniform_builtin (const GPUUniformBuiltin builtin) const |
| int32_t | ubo_builtin (const GPUUniformBlockBuiltin builtin) const |
Public Attributes | |
| ShaderInput * | inputs_ = NULL |
| char * | name_buffer_ = NULL |
| uint | attr_len_ = 0 |
| uint | ubo_len_ = 0 |
| uint | uniform_len_ = 0 |
| uint16_t | enabled_attr_mask_ = 0 |
| uint16_t | enabled_ubo_mask_ = 0 |
| uint8_t | enabled_ima_mask_ = 0 |
| uint64_t | enabled_tex_mask_ = 0 |
| int32_t | builtins_ [GPU_NUM_UNIFORMS] |
| int32_t | builtin_blocks_ [GPU_NUM_UNIFORM_BLOCKS] |
Protected Member Functions | |
| uint32_t | set_input_name (ShaderInput *input, char *name, uint32_t name_len) const |
| void | sort_inputs (void) |
Static Protected Member Functions | |
| static const char * | builtin_uniform_name (GPUUniformBuiltin u) |
| static const char * | builtin_uniform_block_name (GPUUniformBlockBuiltin u) |
Implementation of Shader interface. Base class which is then specialized for each implementation (GL, VK, ...).
Definition at line 52 of file gpu_shader_interface.hh.
|
default |
|
virtual |
Definition at line 38 of file gpu_shader_interface.cc.
References inputs_, MEM_freeN, and name_buffer_.
|
inline |
Definition at line 78 of file gpu_shader_interface.hh.
References attr_len_, and inputs_.
Referenced by blender::gpu::vbo_bind().
|
inlinestaticprotected |
Definition at line 190 of file gpu_shader_interface.hh.
References GPU_UNIFORM_BLOCK_INFO, GPU_UNIFORM_BLOCK_MODEL, GPU_UNIFORM_BLOCK_VIEW, and NULL.
Referenced by blender::gpu::GLShaderInterface::GLShaderInterface().
|
inlinestaticprotected |
Definition at line 140 of file gpu_shader_interface.hh.
References GPU_UNIFORM_BASE_INSTANCE, GPU_UNIFORM_CLIPPLANES, GPU_UNIFORM_COLOR, GPU_UNIFORM_MODEL, GPU_UNIFORM_MODEL_INV, GPU_UNIFORM_MODELVIEW, GPU_UNIFORM_MODELVIEW_INV, GPU_UNIFORM_MVP, GPU_UNIFORM_NORMAL, GPU_UNIFORM_ORCO, GPU_UNIFORM_PROJECTION, GPU_UNIFORM_PROJECTION_INV, GPU_UNIFORM_RESOURCE_CHUNK, GPU_UNIFORM_RESOURCE_ID, GPU_UNIFORM_SRGB_TRANSFORM, GPU_UNIFORM_VIEW, GPU_UNIFORM_VIEW_INV, GPU_UNIFORM_VIEWPROJECTION, GPU_UNIFORM_VIEWPROJECTION_INV, and NULL.
Referenced by blender::gpu::GLShaderInterface::GLShaderInterface().
| void blender::gpu::ShaderInterface::debug_print | ( | void | ) |
Definition at line 78 of file gpu_shader_interface.cc.
References attr_len_, enabled_tex_mask_, inputs_, name_buffer_, blender::Span< T >::size(), ubo_len_, and uniform_len_.
|
inline |
Definition at line 102 of file gpu_shader_interface.hh.
References name_buffer_, and blender::gpu::ShaderInput::name_offset.
|
inlineprotected |
Definition at line 205 of file gpu_shader_interface.hh.
References BLI_hash_string(), name_buffer_, blender::gpu::ShaderInput::name_hash, and blender::gpu::ShaderInput::name_offset.
Referenced by blender::gpu::GLShaderInterface::GLShaderInterface().
|
protected |
Definition at line 71 of file gpu_shader_interface.cc.
References attr_len_, inputs_, blender::gpu::sort_input_list(), ubo_len_, and uniform_len_.
Referenced by blender::gpu::GLShaderInterface::GLShaderInterface().
|
inline |
Definition at line 97 of file gpu_shader_interface.hh.
References attr_len_, inputs_, ubo_len_, and uniform_len_.
|
inline |
Definition at line 115 of file gpu_shader_interface.hh.
References BLI_assert, builtin_blocks_, and GPU_NUM_UNIFORM_BLOCKS.
Referenced by GPU_shader_get_builtin_block().
|
inline |
Definition at line 83 of file gpu_shader_interface.hh.
References attr_len_, inputs_, and ubo_len_.
Referenced by blender::gpu::GLShaderInterface::GLShaderInterface().
|
inline |
Definition at line 87 of file gpu_shader_interface.hh.
|
inline |
Definition at line 108 of file gpu_shader_interface.hh.
References BLI_assert, builtins_, and GPU_NUM_UNIFORMS.
Referenced by GPU_shader_get_builtin_uniform().
|
inline |
Definition at line 92 of file gpu_shader_interface.hh.
References attr_len_, inputs_, ubo_len_, and uniform_len_.
| uint blender::gpu::ShaderInterface::attr_len_ = 0 |
Input counts inside input array.
Definition at line 60 of file gpu_shader_interface.hh.
Referenced by attr_get(), debug_print(), blender::gpu::GLShaderInterface::GLShaderInterface(), sort_inputs(), texture_get(), ubo_get(), and uniform_get().
| int32_t blender::gpu::ShaderInterface::builtin_blocks_[GPU_NUM_UNIFORM_BLOCKS] |
Definition at line 70 of file gpu_shader_interface.hh.
Referenced by blender::gpu::GLShaderInterface::GLShaderInterface(), and ubo_builtin().
| int32_t blender::gpu::ShaderInterface::builtins_[GPU_NUM_UNIFORMS] |
Location of builtin uniforms. Fast access, no lookup needed.
Definition at line 69 of file gpu_shader_interface.hh.
Referenced by blender::gpu::GLShaderInterface::GLShaderInterface(), and uniform_builtin().
| uint16_t blender::gpu::ShaderInterface::enabled_attr_mask_ = 0 |
Enabled bind-points that needs to be fed with data.
Definition at line 64 of file gpu_shader_interface.hh.
Referenced by blender::gpu::GLShaderInterface::GLShaderInterface(), and blender::gpu::GLVertArray::update_bindings().
| uint8_t blender::gpu::ShaderInterface::enabled_ima_mask_ = 0 |
Definition at line 66 of file gpu_shader_interface.hh.
Referenced by blender::gpu::GLShaderInterface::GLShaderInterface().
| uint64_t blender::gpu::ShaderInterface::enabled_tex_mask_ = 0 |
Definition at line 67 of file gpu_shader_interface.hh.
Referenced by debug_print(), and blender::gpu::GLShaderInterface::GLShaderInterface().
| uint16_t blender::gpu::ShaderInterface::enabled_ubo_mask_ = 0 |
Definition at line 65 of file gpu_shader_interface.hh.
Referenced by blender::gpu::GLShaderInterface::GLShaderInterface().
| ShaderInput* blender::gpu::ShaderInterface::inputs_ = NULL |
Flat array. In this order: Attributes, Ubos, Uniforms.
Definition at line 56 of file gpu_shader_interface.hh.
Referenced by attr_get(), debug_print(), blender::gpu::GLShaderInterface::GLShaderInterface(), sort_inputs(), texture_get(), ubo_get(), uniform_get(), and ~ShaderInterface().
| char* blender::gpu::ShaderInterface::name_buffer_ = NULL |
Buffer containing all inputs names separated by '\0'.
Definition at line 58 of file gpu_shader_interface.hh.
Referenced by debug_print(), blender::gpu::GLShaderInterface::GLShaderInterface(), input_name_get(), set_input_name(), and ~ShaderInterface().
| uint blender::gpu::ShaderInterface::ubo_len_ = 0 |
Definition at line 61 of file gpu_shader_interface.hh.
Referenced by debug_print(), blender::gpu::GLShaderInterface::GLShaderInterface(), sort_inputs(), texture_get(), ubo_get(), and uniform_get().
| uint blender::gpu::ShaderInterface::uniform_len_ = 0 |
Definition at line 62 of file gpu_shader_interface.hh.
Referenced by debug_print(), blender::gpu::GLShaderInterface::GLShaderInterface(), sort_inputs(), texture_get(), and uniform_get().