GPU: Removes GPU_shader_get_builtin_ssbo
Simplify the API. Use hardcoded ssbo location instead.
This commit is contained in:
@@ -57,7 +57,6 @@ class ShaderInterface {
|
||||
/** Location of builtin uniforms. Fast access, no lookup needed. */
|
||||
int32_t builtins_[GPU_NUM_UNIFORMS];
|
||||
int32_t builtin_blocks_[GPU_NUM_UNIFORM_BLOCKS];
|
||||
int32_t builtin_buffers_[GPU_NUM_STORAGE_BUFFERS];
|
||||
|
||||
/**
|
||||
* Currently only used for `GPU_shader_get_attribute_info`.
|
||||
@@ -128,17 +127,9 @@ class ShaderInterface {
|
||||
return builtin_blocks_[builtin];
|
||||
}
|
||||
|
||||
/* Returns binding position. */
|
||||
inline int32_t ssbo_builtin(const GPUStorageBufferBuiltin builtin) const
|
||||
{
|
||||
BLI_assert(builtin >= 0 && builtin < GPU_NUM_STORAGE_BUFFERS);
|
||||
return builtin_buffers_[builtin];
|
||||
}
|
||||
|
||||
protected:
|
||||
static inline const char *builtin_uniform_name(GPUUniformBuiltin u);
|
||||
static inline const char *builtin_uniform_block_name(GPUUniformBlockBuiltin u);
|
||||
static inline const char *builtin_storage_block_name(GPUStorageBufferBuiltin u);
|
||||
|
||||
inline uint32_t set_input_name(ShaderInput *input, char *name, uint32_t name_len) const;
|
||||
inline void copy_input_name(ShaderInput *input,
|
||||
@@ -234,18 +225,6 @@ inline const char *ShaderInterface::builtin_uniform_block_name(GPUUniformBlockBu
|
||||
}
|
||||
}
|
||||
|
||||
inline const char *ShaderInterface::builtin_storage_block_name(GPUStorageBufferBuiltin u)
|
||||
{
|
||||
switch (u) {
|
||||
case GPU_STORAGE_BUFFER_DEBUG_VERTS:
|
||||
return "drw_debug_verts_buf";
|
||||
case GPU_STORAGE_BUFFER_DEBUG_PRINT:
|
||||
return "drw_debug_print_buf";
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
/* Returns string length including '\0' terminator. */
|
||||
inline uint32_t ShaderInterface::set_input_name(ShaderInput *input,
|
||||
char *name,
|
||||
|
||||
Reference in New Issue
Block a user