211 uint32_t &name_buffer_offset)
const;
234 return "ModelMatrix";
238 return "ModelViewMatrix";
240 return "ProjectionMatrix";
242 return "ViewProjectionMatrix";
244 return "ModelViewProjectionMatrix";
247 return "ModelMatrixInverse";
249 return "ViewMatrixInverse";
251 return "ModelViewMatrixInverse";
253 return "ProjectionMatrixInverse";
255 return "ViewProjectionMatrixInverse";
258 return "NormalMatrix";
260 return "WorldClipPlanes";
265 return "gpu_BaseInstance";
269 return "gpu_scene_linear_to_rec709";
289 return "drw_matrices";
293 return "drw_clipping_";
305 if (name[name_len - 1] ==
']') {
306 for (; name_len > 1; name_len--) {
307 if (name[name_len] ==
'[') {
308 name[name_len] =
'\0';
326 memcpy(name_buffer + name_buffer_offset, name.
c_str(), name_len + 1);
327 name_buffer_offset +=
set_input_name(input, name_buffer + name_buffer_offset, name_len);
331 const uint inputs_len,
336 for (
int i = inputs_len - 1; i >= 0; i--) {
337 if (inputs[i].name_hash == name_hash) {
338 if ((i > 0) &&
UNLIKELY(inputs[i - 1].name_hash == name_hash)) {
340 for (; i >= 0 && inputs[i].
name_hash == name_hash; i--) {
359 const uint inputs_len,
360 const int binding)
const
363 for (
int i = inputs_len - 1; i >= 0; i--) {
364 if (inputs[i].binding == binding) {
372 const uint inputs_len)
const
375 int valid_bindings = 0;
376 for (
int i = inputs_len - 1; i >= 0; i--) {
377 if (inputs[i].binding > -1) {
381 return valid_bindings;
constexpr const char * c_str() const
constexpr int64_t size() const
void copy_input_name(ShaderInput *input, const StringRefNull &name, char *name_buffer, uint32_t &name_buffer_offset) const
uint16_t enabled_ssbo_mask_
int32_t uniform_builtin(const GPUUniformBuiltin builtin) const
const ShaderInput * tlas_get(const int binding) const
void set_image_formats_from_info(const shader::ShaderCreateInfo &info)
uint64_t enabled_tex_mask_
const ShaderInput * attr_get(const StringRefNull name) const
const ShaderInput * uniform_get(const StringRefNull name) const
uint32_t set_input_name(ShaderInput *input, char *name, uint32_t name_len) const
const ShaderInput * texture_get(const int binding) const
const ShaderInput * ubo_get(const int binding) const
const char * input_name_get(const ShaderInput *input) const
static const char * builtin_uniform_block_name(GPUUniformBlockBuiltin u)
static std::atomic< Key > next_uid_
int32_t ubo_builtin(const GPUUniformBlockBuiltin builtin) const
bool attr_len_get() const
uint8_t enabled_ima_mask_
const ShaderInput * ubo_get(const StringRefNull name) const
const ShaderInput * ssbo_get(const StringRefNull name) const
bool uniform_len_get() const
bool constant_len_get() const
uint valid_bindings_get(const ShaderInput *const inputs, const uint inputs_len) const
int32_t builtin_blocks_[GPU_NUM_UNIFORM_BLOCKS]
const ShaderInput * attr_get(const int binding) const
int32_t builtins_[GPU_NUM_UNIFORMS]
std::array< TextureWriteFormat, GPU_MAX_IMAGE > image_formats_
uint16_t enabled_attr_mask_
const ShaderInput * tlas_get(const StringRefNull name) const
bool ssbo_len_get() const
uint16_t enabled_ubo_mask_
uint8_t attr_types_[GPU_VERT_ATTR_MAX_LEN]
const ShaderInput * constant_get(const StringRefNull name) const
const ShaderInput * ssbo_get(const int binding) const
static const char * builtin_uniform_name(GPUUniformBuiltin u)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
unsigned __int64 uint64_t
@ GPU_UNIFORM_VIEWPROJECTION
@ GPU_UNIFORM_BASE_INSTANCE
@ GPU_UNIFORM_SCENE_LINEAR_XFORM
@ GPU_UNIFORM_VIEWPROJECTION_INV
@ GPU_UNIFORM_PROJECTION_INV
@ GPU_UNIFORM_SRGB_TRANSFORM
@ GPU_UNIFORM_MODELVIEW_INV
BLI_INLINE unsigned int BLI_hash_string(const char *str)
@ GPU_UNIFORM_BLOCK_MODEL
@ GPU_UNIFORM_BLOCK_DRW_VIEW
@ GPU_UNIFORM_BLOCK_DRW_CLIPPING
@ GPU_UNIFORM_BLOCK_DRW_MODEL
@ GPU_UNIFORM_BLOCK_DRW_INFOS
Describe inputs & outputs, stage interfaces, resources and sources of a shader. If all data is correc...