Blender V5.3
gl_shader_interface.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2016 by Mike Erwin. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
11#include "BLI_bitmap.hh"
12
13#include "gl_batch.hh"
14#include "gl_context.hh"
15
17
18#include "GPU_capabilities.hh"
19
20namespace blender {
21
22using namespace blender::gpu::shader;
23namespace gpu {
24
25/* -------------------------------------------------------------------- */
31
32static inline int block_binding(int32_t program, uint32_t block_index)
33{
34 /* For now just assign a consecutive index. In the future, we should set it in
35 * the shader using layout(binding = i) and query its value. */
36 glUniformBlockBinding(program, block_index, block_index);
37 return block_index;
38}
39
40static inline int sampler_binding(int32_t program,
41 uint32_t uniform_index,
42 int32_t uniform_location,
43 int *sampler_len)
44{
45 /* Identify sampler uniforms and assign sampler units to them. */
46 GLint type;
47 glGetActiveUniformsiv(program, 1, &uniform_index, GL_UNIFORM_TYPE, &type);
48
49 switch (type) {
50 case GL_SAMPLER_1D:
51 case GL_SAMPLER_2D:
52 case GL_SAMPLER_3D:
53 case GL_SAMPLER_CUBE:
54 case GL_SAMPLER_CUBE_MAP_ARRAY_ARB: /* OpenGL 4.0 */
55 case GL_SAMPLER_1D_SHADOW:
56 case GL_SAMPLER_2D_SHADOW:
57 case GL_SAMPLER_1D_ARRAY:
58 case GL_SAMPLER_2D_ARRAY:
59 case GL_SAMPLER_1D_ARRAY_SHADOW:
60 case GL_SAMPLER_2D_ARRAY_SHADOW:
61 case GL_SAMPLER_2D_MULTISAMPLE:
62 case GL_SAMPLER_2D_MULTISAMPLE_ARRAY:
63 case GL_SAMPLER_CUBE_SHADOW:
64 case GL_SAMPLER_BUFFER:
65 case GL_INT_SAMPLER_1D:
66 case GL_INT_SAMPLER_2D:
67 case GL_INT_SAMPLER_3D:
68 case GL_INT_SAMPLER_CUBE:
69 case GL_INT_SAMPLER_1D_ARRAY:
70 case GL_INT_SAMPLER_2D_ARRAY:
71 case GL_INT_SAMPLER_2D_MULTISAMPLE:
72 case GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY:
73 case GL_INT_SAMPLER_BUFFER:
74 case GL_UNSIGNED_INT_SAMPLER_1D:
75 case GL_UNSIGNED_INT_SAMPLER_2D:
76 case GL_UNSIGNED_INT_SAMPLER_3D:
77 case GL_UNSIGNED_INT_SAMPLER_CUBE:
78 case GL_UNSIGNED_INT_SAMPLER_1D_ARRAY:
79 case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
80 case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
81 case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY:
82 case GL_UNSIGNED_INT_SAMPLER_BUFFER: {
83 /* For now just assign a consecutive index. In the future, we should set it in
84 * the shader using layout(binding = i) and query its value. */
85 int binding = *sampler_len;
86 glUniform1i(uniform_location, binding);
87 (*sampler_len)++;
88 return binding;
89 }
90 default:
91 return -1;
92 }
93}
94
95static inline int image_binding(int32_t program,
96 uint32_t uniform_index,
97 int32_t uniform_location,
98 int *image_len)
99{
100 /* Identify image uniforms and assign image units to them. */
101 GLint type;
102 glGetActiveUniformsiv(program, 1, &uniform_index, GL_UNIFORM_TYPE, &type);
103
104 switch (type) {
105 case GL_IMAGE_1D:
106 case GL_IMAGE_2D:
107 case GL_IMAGE_3D:
108 case GL_IMAGE_CUBE:
109 case GL_IMAGE_BUFFER:
110 case GL_IMAGE_1D_ARRAY:
111 case GL_IMAGE_2D_ARRAY:
112 case GL_IMAGE_CUBE_MAP_ARRAY:
113 case GL_INT_IMAGE_1D:
114 case GL_INT_IMAGE_2D:
115 case GL_INT_IMAGE_3D:
116 case GL_INT_IMAGE_CUBE:
117 case GL_INT_IMAGE_BUFFER:
118 case GL_INT_IMAGE_1D_ARRAY:
119 case GL_INT_IMAGE_2D_ARRAY:
120 case GL_INT_IMAGE_CUBE_MAP_ARRAY:
121 case GL_UNSIGNED_INT_IMAGE_1D:
122 case GL_UNSIGNED_INT_IMAGE_2D:
123 case GL_UNSIGNED_INT_IMAGE_3D:
124 case GL_UNSIGNED_INT_IMAGE_CUBE:
125 case GL_UNSIGNED_INT_IMAGE_BUFFER:
126 case GL_UNSIGNED_INT_IMAGE_1D_ARRAY:
127 case GL_UNSIGNED_INT_IMAGE_2D_ARRAY:
128 case GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY: {
129 /* For now just assign a consecutive index. In the future, we should set it in
130 * the shader using layout(binding = i) and query its value. */
131 int binding = *image_len;
132 glUniform1i(uniform_location, binding);
133 (*image_len)++;
134 return binding;
135 }
136 default:
137 return -1;
138 }
139}
140
141static inline int ssbo_binding(int32_t program, uint32_t ssbo_index)
142{
143 GLint binding = -1;
144 GLenum property = GL_BUFFER_BINDING;
145 GLint values_written = 0;
146 glGetProgramResourceiv(
147 program, GL_SHADER_STORAGE_BLOCK, ssbo_index, 1, &property, 1, &values_written, &binding);
148
149 return binding;
150}
151
153
154/* -------------------------------------------------------------------- */
157
158static Type gpu_type_from_gl_type(int gl_type)
159{
160 switch (gl_type) {
161 case GL_FLOAT:
162 return Type::float_t;
163 case GL_FLOAT_VEC2:
164 return Type::float2_t;
165 case GL_FLOAT_VEC3:
166 return Type::float3_t;
167 case GL_FLOAT_VEC4:
168 return Type::float4_t;
169 case GL_FLOAT_MAT3:
170 return Type::float3x3_t;
171 case GL_FLOAT_MAT4:
172 return Type::float4x4_t;
173 case GL_UNSIGNED_INT:
174 return Type::uint_t;
175 case GL_UNSIGNED_INT_VEC2:
176 return Type::uint2_t;
177 case GL_UNSIGNED_INT_VEC3:
178 return Type::uint3_t;
179 case GL_UNSIGNED_INT_VEC4:
180 return Type::uint4_t;
181 case GL_INT:
182 return Type::int_t;
183 case GL_INT_VEC2:
184 return Type::int2_t;
185 case GL_INT_VEC3:
186 return Type::int3_t;
187 case GL_INT_VEC4:
188 return Type::int4_t;
189 case GL_BOOL:
190 return Type::bool_t;
191 case GL_FLOAT_MAT2:
192 case GL_FLOAT_MAT2x3:
193 case GL_FLOAT_MAT2x4:
194 case GL_FLOAT_MAT3x2:
195 case GL_FLOAT_MAT3x4:
196 case GL_FLOAT_MAT4x2:
197 case GL_FLOAT_MAT4x3:
198 default:
199 BLI_assert(0);
200 }
201 return Type::float_t;
202}
203
205{
206 GLuint last_program;
207 glGetIntegerv(GL_CURRENT_PROGRAM, reinterpret_cast<GLint *>(&last_program));
208
209 /* Necessary to make #glUniform works. */
210 glUseProgram(program);
211
212 GLint max_attr_name_len = 0, attr_len = 0;
213 glGetProgramiv(program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &max_attr_name_len);
214 glGetProgramiv(program, GL_ACTIVE_ATTRIBUTES, &attr_len);
215
216 GLint max_ubo_name_len = 0, ubo_len = 0;
217 glGetProgramiv(program, GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH, &max_ubo_name_len);
218 glGetProgramiv(program, GL_ACTIVE_UNIFORM_BLOCKS, &ubo_len);
219
220 GLint max_uniform_name_len = 0, active_uniform_len = 0, uniform_len = 0;
221 glGetProgramiv(program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &max_uniform_name_len);
222 glGetProgramiv(program, GL_ACTIVE_UNIFORMS, &active_uniform_len);
223 uniform_len = active_uniform_len;
224
225 GLint max_ssbo_name_len = 0, ssbo_len = 0;
226 glGetProgramInterfaceiv(program, GL_SHADER_STORAGE_BLOCK, GL_ACTIVE_RESOURCES, &ssbo_len);
227 glGetProgramInterfaceiv(
228 program, GL_SHADER_STORAGE_BLOCK, GL_MAX_NAME_LENGTH, &max_ssbo_name_len);
229
230 BLI_assert_msg(ubo_len <= 16, "enabled_ubo_mask_ is uint16_t");
231
232 /* Work around driver bug with Intel HD 4600 on Windows 7/8, where
233 * GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH does not work. */
234 if (attr_len > 0 && max_attr_name_len == 0) {
235 max_attr_name_len = 256;
236 }
237 if (ubo_len > 0 && max_ubo_name_len == 0) {
238 max_ubo_name_len = 256;
239 }
240 if (uniform_len > 0 && max_uniform_name_len == 0) {
241 max_uniform_name_len = 256;
242 }
243 if (ssbo_len > 0 && max_ssbo_name_len == 0) {
244 max_ssbo_name_len = 256;
245 }
246
247 /* GL_ACTIVE_UNIFORMS lied to us! Remove the UBO uniforms from the total before
248 * allocating the uniform array. */
249 GLint max_ubo_uni_len = 0;
250 for (int i = 0; i < ubo_len; i++) {
251 GLint ubo_uni_len;
252 glGetActiveUniformBlockiv(program, i, GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS, &ubo_uni_len);
253 max_ubo_uni_len = max_ii(max_ubo_uni_len, ubo_uni_len);
254 uniform_len -= ubo_uni_len;
255 }
256 /* Bit set to true if uniform comes from a uniform block. */
257 BLI_bitmap *uniforms_from_blocks = BLI_BITMAP_NEW(active_uniform_len, __func__);
258 /* Set uniforms from block for exclusion. */
259 GLint *ubo_uni_ids = MEM_new_array_uninitialized<GLint>(max_ubo_uni_len, __func__);
260 for (int i = 0; i < ubo_len; i++) {
261 GLint ubo_uni_len;
262 glGetActiveUniformBlockiv(program, i, GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS, &ubo_uni_len);
263 glGetActiveUniformBlockiv(program, i, GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES, ubo_uni_ids);
264 for (int u = 0; u < ubo_uni_len; u++) {
265 BLI_BITMAP_ENABLE(uniforms_from_blocks, ubo_uni_ids[u]);
266 }
267 }
268 MEM_delete(ubo_uni_ids);
269
270 int input_tot_len = attr_len + ubo_len + uniform_len + ssbo_len;
271 inputs_ = MEM_new_array_zeroed<ShaderInput>(input_tot_len, __func__);
272
273 const uint32_t name_buffer_len = attr_len * max_attr_name_len + ubo_len * max_ubo_name_len +
274 uniform_len * max_uniform_name_len +
275 ssbo_len * max_ssbo_name_len;
276 name_buffer_ = MEM_new_array_uninitialized<char>(name_buffer_len, "name_buffer");
277 uint32_t name_buffer_offset = 0;
278
279 /* Attributes */
281 for (int i = 0; i < attr_len; i++) {
282 char *name = name_buffer_ + name_buffer_offset;
283 GLsizei remaining_buffer = name_buffer_len - name_buffer_offset;
284 GLsizei name_len = 0;
285 GLenum type;
286 GLint size;
287
288 glGetActiveAttrib(program, i, remaining_buffer, &name_len, &size, &type, name);
289 GLint location = glGetAttribLocation(program, name);
290 /* Ignore OpenGL names like `gl_BaseInstanceARB`, `gl_InstanceID` and `gl_VertexID`. */
291 if (location == -1) {
292 continue;
293 }
294
295 ShaderInput *input = &inputs_[attr_len_++];
296 input->location = input->binding = location;
297
298 name_buffer_offset += set_input_name(input, name, name_len);
299 enabled_attr_mask_ |= (1 << input->location);
300
301 /* Used in `GPU_shader_get_attribute_info`. */
303 }
304
305 /* Uniform Blocks */
306 for (int i = 0; i < ubo_len; i++) {
307 char *name = name_buffer_ + name_buffer_offset;
308 GLsizei remaining_buffer = name_buffer_len - name_buffer_offset;
309 GLsizei name_len = 0;
310
311 glGetActiveUniformBlockName(program, i, remaining_buffer, &name_len, name);
312
313 ShaderInput *input = &inputs_[attr_len_ + ubo_len_++];
314 input->binding = input->location = block_binding(program, i);
315
316 name_buffer_offset += this->set_input_name(input, name, name_len);
317 enabled_ubo_mask_ |= (1 << input->binding);
318 }
319
320 /* Uniforms & samplers & images */
321 for (int i = 0, sampler = 0, image = 0; i < active_uniform_len; i++) {
322 if (BLI_BITMAP_TEST(uniforms_from_blocks, i)) {
323 continue;
324 }
325 char *name = name_buffer_ + name_buffer_offset;
326 GLsizei remaining_buffer = name_buffer_len - name_buffer_offset;
327 GLsizei name_len = 0;
328
329 glGetActiveUniformName(program, i, remaining_buffer, &name_len, name);
330
332 input->location = glGetUniformLocation(program, name);
333 input->binding = sampler_binding(program, i, input->location, &sampler);
334
335 name_buffer_offset += this->set_input_name(input, name, name_len);
336 enabled_tex_mask_ |= (input->binding != -1) ? (1lu << input->binding) : 0lu;
337
338 if (input->binding == -1) {
339 input->binding = image_binding(program, i, input->location, &image);
340
341 enabled_ima_mask_ |= (input->binding != -1) ? (1lu << input->binding) : 0lu;
342 }
343 }
344
345 /* SSBOs */
346 for (int i = 0; i < ssbo_len; i++) {
347 char *name = name_buffer_ + name_buffer_offset;
348 GLsizei remaining_buffer = name_buffer_len - name_buffer_offset;
349 GLsizei name_len = 0;
350 glGetProgramResourceName(
351 program, GL_SHADER_STORAGE_BLOCK, i, remaining_buffer, &name_len, name);
352
353 const GLint binding = ssbo_binding(program, i);
354
356 input->binding = input->location = binding;
357
358 name_buffer_offset += this->set_input_name(input, name, name_len);
359 enabled_ssbo_mask_ |= (input->binding != -1) ? (1lu << input->binding) : 0lu;
360 }
361
362 /* Builtin Uniforms */
363 for (int32_t u_int = 0; u_int < GPU_NUM_UNIFORMS; u_int++) {
364 GPUUniformBuiltin u = static_cast<GPUUniformBuiltin>(u_int);
365 builtins_[u] = glGetUniformLocation(program, builtin_uniform_name(u));
366 }
367
368 /* Builtin Uniforms Blocks */
369 for (int32_t u_int = 0; u_int < GPU_NUM_UNIFORM_BLOCKS; u_int++) {
370 GPUUniformBlockBuiltin u = static_cast<GPUUniformBlockBuiltin>(u_int);
371 const ShaderInput *block = this->ubo_get(builtin_uniform_block_name(u));
372 builtin_blocks_[u] = (block != nullptr) ? block->binding : -1;
373 }
374
375 MEM_delete(uniforms_from_blocks);
376
377 /* Resize name buffer to save some memory. */
378 if (name_buffer_offset < name_buffer_len) {
379 name_buffer_ = static_cast<char *>(
380 MEM_realloc_uninitialized(name_buffer_, name_buffer_offset));
381 }
382
383 // this->debug_print();
384
385 this->sort_inputs();
386
387 glUseProgram(last_program);
388}
389
391{
392 using namespace blender::gpu::shader;
393
394 attr_len_ = info.vertex_inputs_.size();
395 uniform_len_ = info.push_constants_.size();
397 ubo_len_ = 0;
398 ssbo_len_ = 0;
399
401
402 for (ShaderCreateInfo::Resource &res : all_resources) {
403 switch (res.bind_type) {
405 ubo_len_++;
406 break;
408 ssbo_len_++;
409 break;
411 uniform_len_++;
412 break;
414 uniform_len_++;
415 break;
418 break;
419 }
420 }
421
422 BLI_assert_msg(ubo_len_ <= 16, "enabled_ubo_mask_ is uint16_t");
423
424 int input_tot_len = attr_len_ + ubo_len_ + uniform_len_ + ssbo_len_ + constant_len_;
425 inputs_ = MEM_new_array_zeroed<ShaderInput>(input_tot_len, __func__);
426 ShaderInput *input = inputs_;
427
429 uint32_t name_buffer_offset = 0;
430
431 /* Necessary to make #glUniform works. TODO(fclem) Remove. */
432 GLuint last_program;
433 glGetIntegerv(GL_CURRENT_PROGRAM, reinterpret_cast<GLint *>(&last_program));
434
435 glUseProgram(program);
436
437 /* Attributes */
438 for (const ShaderCreateInfo::VertIn &attr : info.vertex_inputs_) {
439 copy_input_name(input, attr.name, name_buffer_, name_buffer_offset);
440 input->location = input->binding = attr.index;
441 enabled_attr_mask_ |= (1 << input->location);
442 /* Used in `GPU_shader_get_attribute_info`. */
443 attr_types_[input->location] = uint8_t(attr.type);
444
445 input++;
446 }
447
448 /* Uniform Blocks */
449 for (const ShaderCreateInfo::Resource &res : all_resources) {
451 copy_input_name(input, res.uniformbuf.name, name_buffer_, name_buffer_offset);
452 input->location = input->binding = res.slot;
453 enabled_ubo_mask_ |= (1 << input->binding);
454 input++;
455 }
456 }
457
458 /* Uniforms & samplers & images */
459 for (const ShaderCreateInfo::Resource &res : all_resources) {
461 copy_input_name(input, res.sampler.name, name_buffer_, name_buffer_offset);
462 input->binding = res.slot;
463 enabled_tex_mask_ |= (1ull << input->binding);
464 input++;
465 }
466 else if (res.bind_type == ShaderCreateInfo::Resource::BindType::IMAGE) {
467 copy_input_name(input, res.image.name, name_buffer_, name_buffer_offset);
468 input->binding = res.slot;
469 enabled_ima_mask_ |= (1 << input->binding);
470 input++;
471 }
472 }
473 for (const ShaderCreateInfo::PushConst &uni : info.push_constants_) {
474 copy_input_name(input, uni.name, name_buffer_, name_buffer_offset);
475 input->location = glGetUniformLocation(program, name_buffer_ + input->name_offset);
476 input->binding = -1;
477 input++;
478 }
480
481 /* SSBOs */
482 for (const ShaderCreateInfo::Resource &res : all_resources) {
484 copy_input_name(input, res.storagebuf.name, name_buffer_, name_buffer_offset);
485 input->location = input->binding = res.slot;
486 enabled_ssbo_mask_ |= (1 << input->binding);
487 input++;
488 }
489 }
490
491 for (const ShaderCreateInfo::Resource &res : info.geometry_resources_) {
493 ssbo_attr_mask_ |= (1 << res.slot);
494 }
495 else {
496 BLI_assert_msg(0, "Resource type is not supported for Geometry frequency");
497 }
498 }
499
500 /* Constants */
501 int constant_id = 0;
502 for (const SpecializationConstant &constant : info.specialization_constants_) {
503 copy_input_name(input, constant.name, name_buffer_, name_buffer_offset);
504 input->location = constant_id++;
505 input++;
506 }
507
508 this->sort_inputs();
509
510 /* Resolving builtins must happen after the inputs have been sorted. */
511 /* Builtin Uniforms */
512 for (int32_t u_int = 0; u_int < GPU_NUM_UNIFORMS; u_int++) {
513 GPUUniformBuiltin u = static_cast<GPUUniformBuiltin>(u_int);
514 const ShaderInput *uni = this->uniform_get(builtin_uniform_name(u));
515 builtins_[u] = (uni != nullptr) ? uni->location : -1;
516 }
517
518 /* Builtin Uniforms Blocks */
519 for (int32_t u_int = 0; u_int < GPU_NUM_UNIFORM_BLOCKS; u_int++) {
520 GPUUniformBlockBuiltin u = static_cast<GPUUniformBlockBuiltin>(u_int);
521 const ShaderInput *block = this->ubo_get(builtin_uniform_block_name(u));
522 builtin_blocks_[u] = (block != nullptr) ? block->binding : -1;
523 }
524
525 // this->debug_print();
526
527 glUseProgram(last_program);
528}
529
531{
532 for (auto *ref : refs_) {
533 if (ref != nullptr) {
534 ref->remove(this);
535 }
536 }
537}
538
540
541/* -------------------------------------------------------------------- */
544
546{
547 for (int i = 0; i < refs_.size(); i++) {
548 if (refs_[i] == nullptr) {
549 refs_[i] = ref;
550 return;
551 }
552 }
553 refs_.append(ref);
554}
555
557{
558 for (int i = 0; i < refs_.size(); i++) {
559 if (refs_[i] == ref) {
560 refs_[i] = nullptr;
561 break; /* cannot have duplicates */
562 }
563 }
564}
565
567
568/* -------------------------------------------------------------------- */
572
574
575} // namespace gpu
576} // namespace blender
#define BLI_BITMAP_NEW(_num, _alloc_string)
Definition BLI_bitmap.hh:39
#define BLI_BITMAP_TEST(_bitmap, _index)
Definition BLI_bitmap.hh:63
#define BLI_BITMAP_ENABLE(_bitmap, _index)
Definition BLI_bitmap.hh:80
#define GPU_NUM_UNIFORMS
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
#define MEM_realloc_uninitialized(vmemh, len)
GLShaderInterface(GLuint program, const shader::ShaderCreateInfo &info)
void copy_input_name(ShaderInput *input, const StringRefNull &name, char *name_buffer, uint32_t &name_buffer_offset) const
void set_image_formats_from_info(const shader::ShaderCreateInfo &info)
const ShaderInput * uniform_get(const StringRefNull name) const
uint32_t set_input_name(ShaderInput *input, char *name, uint32_t name_len) const
static const char * builtin_uniform_block_name(GPUUniformBlockBuiltin u)
const ShaderInput * ubo_get(const StringRefNull name) const
int32_t builtin_blocks_[GPU_NUM_UNIFORM_BLOCKS]
int32_t builtins_[GPU_NUM_UNIFORMS]
uint8_t attr_types_[GPU_VERT_ATTR_MAX_LEN]
static const char * builtin_uniform_name(GPUUniformBuiltin u)
#define sampler(slot)
static Type gpu_type_from_gl_type(int gl_type)
static int block_binding(int32_t program, uint32_t block_index)
static int sampler_binding(int32_t program, uint32_t uniform_index, int32_t uniform_location, int *sampler_len)
static int ssbo_binding(int32_t program, uint32_t ssbo_index)
static int image_binding(int32_t program, uint32_t uniform_index, int32_t uniform_location, int *image_len)
BMesh Iterators.
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
MINLINE int max_ii(int a, int b)
unsigned int uint32_t
Definition BKE_text.h:81
unsigned char uint8_t
Definition BKE_text.h:79
unsigned int BLI_bitmap
Definition BLI_bitmap.hh:15
signed int int32_t
Definition BKE_text.h:78
GPUUniformBlockBuiltin
@ GPU_NUM_UNIFORM_BLOCKS
void * MEM_new_array_zeroed(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
Describe inputs & outputs, stage interfaces, resources and sources of a shader. If all data is correc...
Vector< SpecializationConstant, 0 > specialization_constants_