Blender V5.3
draw_command.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
15
16#include "BKE_global.hh"
17#include "BLI_map.hh"
18#include "BLI_math_base_c.hh"
19#include "DRW_gpu_wrapper.hh"
20
21#include "GPU_index_buffer.hh"
22#include "GPU_ray_tracing.hh"
24#include "draw_handle.hh"
25#include "draw_state.hh"
26#include "draw_view.hh"
27
28namespace blender {
29
30/* Forward declarations. */
31namespace draw::detail {
32template<typename T, int64_t block_size> class SubPassVector;
33template<typename DrawCommandBufType> class PassBase;
34} // namespace draw::detail
35
36namespace draw::command {
37
38class DrawCommandBuf;
39class DrawMultiBuf;
40
41/* -------------------------------------------------------------------- */
44
51 /* True if specialization_constants was set. */
53 /* True if the bound shader uses specialization. */
55 gpu::Shader *shader = nullptr;
56 bool front_facing = true;
57 bool inverted_view = false;
62
63 void front_facing_set(bool facing)
64 {
65 /* Facing is inverted if view is not in expected handedness. */
66 facing = this->inverted_view == facing;
67 /* Remove redundant changes. */
68 if (assign_if_different(this->front_facing, facing)) {
69 GPU_front_facing(!facing);
70 }
71 }
72
73 void cleanup()
74 {
75 if (front_facing == false) {
76 GPU_front_facing(false);
77 }
78
79 if (G.debug & G_DEBUG_GPU) {
84 }
85 }
86
91};
92
94
95/* -------------------------------------------------------------------- */
98
128
140
143
144 void execute(RecordingState &state) const;
145 std::string serialize() const;
146};
147
150
151 void execute() const;
152 std::string serialize() const;
153};
154
160
161 void execute() const;
162 std::string serialize() const;
163};
164
167 int slot;
169
170 enum class Type : uint8_t {
171 Sampler = 0,
172 BufferSampler,
176 UniformAsStorageBuf,
177 VertexAsStorageBuf,
178 IndexAsStorageBuf,
181
200
201 ResourceBind() = default;
202
204 : slot(slot_), is_reference(false), type(Type::UniformBuf), uniform_buf(res) {};
206 : slot(slot_), is_reference(true), type(Type::UniformBuf), uniform_buf_ref(res) {};
208 : slot(slot_), is_reference(false), type(Type::StorageBuf), storage_buf(res) {};
210 : slot(slot_), is_reference(true), type(Type::StorageBuf), storage_buf_ref(res) {};
212 : slot(slot_), is_reference(false), type(Type::TopLevelAS), tlas(res) {};
213 ResourceBind(int slot_, gpu::UniformBuf *res, Type /*type*/)
214 : slot(slot_), is_reference(false), type(Type::UniformAsStorageBuf), uniform_buf(res) {};
215 ResourceBind(int slot_, gpu::UniformBuf **res, Type /*type*/)
216 : slot(slot_), is_reference(true), type(Type::UniformAsStorageBuf), uniform_buf_ref(res) {};
217 ResourceBind(int slot_, gpu::VertBuf *res, Type /*type*/)
218 : slot(slot_), is_reference(false), type(Type::VertexAsStorageBuf), vertex_buf(res) {};
219 ResourceBind(int slot_, gpu::VertBuf **res, Type /*type*/)
220 : slot(slot_), is_reference(true), type(Type::VertexAsStorageBuf), vertex_buf_ref(res) {};
221 ResourceBind(int slot_, gpu::IndexBuf *res, Type /*type*/)
222 : slot(slot_), is_reference(false), type(Type::IndexAsStorageBuf), index_buf(res) {};
223 ResourceBind(int slot_, gpu::IndexBuf **res, Type /*type*/)
224 : slot(slot_), is_reference(true), type(Type::IndexAsStorageBuf), index_buf_ref(res) {};
225 ResourceBind(int slot_, draw::Image *res)
226 : slot(slot_), is_reference(false), type(Type::Image), texture(draw::as_texture(res)) {};
227 ResourceBind(int slot_, draw::Image **res)
228 : slot(slot_), is_reference(true), type(Type::Image), texture_ref(draw::as_texture(res)) {};
230 : sampler(state), slot(slot_), is_reference(false), type(Type::Sampler), texture(res) {};
232 : sampler(state), slot(slot_), is_reference(true), type(Type::Sampler), texture_ref(res) {};
233 ResourceBind(int slot_, gpu::VertBuf *res)
234 : slot(slot_), is_reference(false), type(Type::BufferSampler), vertex_buf(res) {};
235 ResourceBind(int slot_, gpu::VertBuf **res)
236 : slot(slot_), is_reference(true), type(Type::BufferSampler), vertex_buf_ref(res) {};
237
238 void execute() const;
239 std::string serialize() const;
240};
241
246 enum class Type : uint8_t {
247 IntValue = 0,
248 FloatValue,
249 IntReference,
250 FloatReference,
258 union {
259 int int1_value;
263 float float1_value;
267 const int *int_ref;
268 const int2 *int2_ref;
269 const int3 *int3_ref;
270 const int4 *int4_ref;
271 const float *float_ref;
272 const float2 *float2_ref;
273 const float3 *float3_ref;
274 const float4 *float4_ref;
275 const float4x4 *float4x4_ref;
276 };
277
278 PushConstant() = default;
279
280 PushConstant(int loc, const float &val)
281 : location(loc), array_len(1), comp_len(1), type(Type::FloatValue), float1_value(val) {};
282 PushConstant(int loc, const float2 &val)
283 : location(loc), array_len(1), comp_len(2), type(Type::FloatValue), float2_value(val) {};
284 PushConstant(int loc, const float3 &val)
285 : location(loc), array_len(1), comp_len(3), type(Type::FloatValue), float3_value(val) {};
286 PushConstant(int loc, const float4 &val)
287 : location(loc), array_len(1), comp_len(4), type(Type::FloatValue), float4_value(val) {};
288
289 PushConstant(int loc, const int &val)
290 : location(loc), array_len(1), comp_len(1), type(Type::IntValue), int1_value(val) {};
291 PushConstant(int loc, const int2 &val)
292 : location(loc), array_len(1), comp_len(2), type(Type::IntValue), int2_value(val) {};
293 PushConstant(int loc, const int3 &val)
294 : location(loc), array_len(1), comp_len(3), type(Type::IntValue), int3_value(val) {};
295 PushConstant(int loc, const int4 &val)
296 : location(loc), array_len(1), comp_len(4), type(Type::IntValue), int4_value(val) {};
297
298 PushConstant(int loc, const float *val, int arr)
299 : location(loc), array_len(arr), comp_len(1), type(Type::FloatReference), float_ref(val) {};
300 PushConstant(int loc, const float2 *val, int arr)
301 : location(loc), array_len(arr), comp_len(2), type(Type::FloatReference), float2_ref(val) {};
302 PushConstant(int loc, const float3 *val, int arr)
303 : location(loc), array_len(arr), comp_len(3), type(Type::FloatReference), float3_ref(val) {};
304 PushConstant(int loc, const float4 *val, int arr)
305 : location(loc), array_len(arr), comp_len(4), type(Type::FloatReference), float4_ref(val) {};
306 PushConstant(int loc, const float4x4 *val)
307 : location(loc), array_len(1), comp_len(16), type(Type::FloatReference), float4x4_ref(val) {
308 };
309
310 PushConstant(int loc, const int *val, int arr)
311 : location(loc), array_len(arr), comp_len(1), type(Type::IntReference), int_ref(val) {};
312 PushConstant(int loc, const int2 *val, int arr)
313 : location(loc), array_len(arr), comp_len(2), type(Type::IntReference), int2_ref(val) {};
314 PushConstant(int loc, const int3 *val, int arr)
315 : location(loc), array_len(arr), comp_len(3), type(Type::IntReference), int3_ref(val) {};
316 PushConstant(int loc, const int4 *val, int arr)
317 : location(loc), array_len(arr), comp_len(4), type(Type::IntReference), int4_ref(val) {};
318
319 void execute(RecordingState &state) const;
320 std::string serialize() const;
321};
322
324 /* Shader to set the constant in. */
326 /* Value of the constant or a reference to it. */
327 union {
328 int int_value;
330 float float_value;
331 bool bool_value;
332 const int *int_ref;
333 const uint *uint_ref;
334 const float *float_ref;
335 const bool *bool_ref;
336 };
337
339
340 enum class Type : uint8_t {
341 IntValue = 0,
342 UintValue,
343 FloatValue,
344 BoolValue,
345 IntReference,
346 UintReference,
347 FloatReference,
348 BoolReference,
350
352
353 SpecializeConstant(gpu::Shader *sh, int loc, const float &val)
354 : shader(sh), float_value(val), location(loc), type(Type::FloatValue) {};
355 SpecializeConstant(gpu::Shader *sh, int loc, const int &val)
356 : shader(sh), int_value(val), location(loc), type(Type::IntValue) {};
357 SpecializeConstant(gpu::Shader *sh, int loc, const uint &val)
358 : shader(sh), uint_value(val), location(loc), type(Type::UintValue) {};
359 SpecializeConstant(gpu::Shader *sh, int loc, const bool &val)
360 : shader(sh), bool_value(val), location(loc), type(Type::BoolValue) {};
361 SpecializeConstant(gpu::Shader *sh, int loc, const float *val)
362 : shader(sh), float_ref(val), location(loc), type(Type::FloatReference) {};
363 SpecializeConstant(gpu::Shader *sh, int loc, const int *val)
364 : shader(sh), int_ref(val), location(loc), type(Type::IntReference) {};
365 SpecializeConstant(gpu::Shader *sh, int loc, const uint *val)
366 : shader(sh), uint_ref(val), location(loc), type(Type::UintReference) {};
367 SpecializeConstant(gpu::Shader *sh, int loc, const bool *val)
368 : shader(sh), bool_ref(val), location(loc), type(Type::BoolReference) {};
369
370 void execute(RecordingState &state) const;
371 std::string serialize() const;
372};
373
374struct Draw {
375 gpu::Batch *batch;
377 uint32_t expand_prim_type : 4; /* #GPUPrimType */
382
383 Draw() = default;
384
385 Draw(gpu::Batch *batch,
389 GPUPrimType expanded_prim_type,
390 uint expanded_prim_len,
392 {
393 BLI_assert(batch != nullptr);
394 BLI_assert(expanded_prim_type <= 15);
395 BLI_assert(expanded_prim_len <= 15);
396 this->batch = batch;
397 this->res_id = res_id;
398 this->instance_len = min_uu(instance_len, (1 << 24) - 1);
399 this->vertex_len = vertex_len;
400 this->vertex_first = vertex_first;
401 this->expand_prim_type = expanded_prim_type;
402 this->expand_prim_len = expanded_prim_len;
403 }
404
406 {
408 }
409
410 void execute(RecordingState &state) const;
411 std::string serialize() const;
412};
413
414struct DrawMulti {
415 gpu::Batch *batch;
419
420 void execute(RecordingState &state) const;
421 std::string serialize(const std::string &line_prefix) const;
422};
423
425 gpu::Batch *batch;
428
429 void execute(RecordingState &state) const;
430 std::string serialize() const;
431};
432
433struct Dispatch {
435 union {
436 int3 size;
437 int3 *size_ref;
438 };
439
440 Dispatch() = default;
441
442 Dispatch(int3 group_len) : is_reference(false), size(group_len) {};
443 Dispatch(int3 *group_len) : is_reference(true), size_ref(group_len) {};
444
445 void execute(RecordingState &state) const;
446 std::string serialize() const;
447};
448
451
452 void execute(RecordingState &state) const;
453 std::string serialize() const;
454};
455
456struct Barrier {
458
459 void execute() const;
460 std::string serialize() const;
461};
462
463struct Clear {
464 uint8_t clear_channels; /* #GPUFrameBufferBits. But want to save some bits. */
466 float depth;
468
469 void execute() const;
470 std::string serialize() const;
471};
472
477
478 void execute() const;
479 std::string serialize() const;
480};
481
482struct StateSet {
485
486 void execute(RecordingState &state) const;
487 std::string serialize() const;
488
489 /* Set state of the GPU module manually. */
490 static void set(DRWState state = DRW_STATE_DEFAULT);
491};
492
497
498 void execute() const;
499 std::string serialize() const;
500};
501
503 union {
506 };
507 union {
510 };
513
514 void execute() const;
515 std::string serialize() const;
516};
517
537
539
540BLI_STATIC_ASSERT(sizeof(Undetermined) <= 24, "One of the command type is too large.")
541
542
543
544/* -------------------------------------------------------------------- */
553
555 friend Manager;
556
557 private:
558 using ResourceIdBuf = StorageArrayBuffer<uint, 128, false>;
560
562 ResourceIdBuf resource_id_buf_;
564 uint resource_id_count_ = 0;
565
566 public:
567 void clear()
568 {
569 resource_id_buf_.trim_to_next_power_of_2(resource_id_count_);
570 };
571
573 Vector<Undetermined, 0> &commands,
574 gpu::Batch *batch,
575 uint instance_len,
576 uint vertex_len,
577 uint vertex_first,
578 ResourceIDRange id_range,
579 uint custom_id,
580 GPUPrimType expanded_prim_type,
581 uint16_t expanded_prim_len)
582 {
583 BLI_assert(batch != nullptr);
584 vertex_first = vertex_first != -1 ? vertex_first : 0;
585 instance_len = instance_len != -1 ? instance_len : 1;
586
587 BLI_assert_msg(custom_id == 0, "Custom ID is not supported in PassSimple");
588 UNUSED_VARS_NDEBUG(custom_id);
589
590 for (auto res_id : id_range.id_range()) {
591 int64_t index = commands.append_and_get_index({});
592 headers.append({Type::Draw, uint(index)});
593 commands[index].draw = {batch,
594 instance_len,
595 vertex_len,
596 vertex_first,
597 expanded_prim_type,
598 expanded_prim_len,
599 ResourceID(res_id)};
600 }
601 }
602
603 void generate_commands(Vector<Header, 0> &headers,
604 Vector<Undetermined, 0> &commands,
605 SubPassVector &sub_passes);
606
607 void bind(RecordingState &state);
608
609 private:
610 static void finalize_commands(Vector<Header, 0> &headers,
611 Vector<Undetermined, 0> &commands,
612 SubPassVector &sub_passes,
613 uint &resource_id_count,
614 ResourceIdBuf &resource_id_buf);
615};
616
618
619/* -------------------------------------------------------------------- */
646
648 friend Manager;
649 friend DrawMulti;
650
651 private:
652 using DrawGroupBuf = StorageArrayBuffer<DrawGroup, 16>;
653 using DrawPrototypeBuf = StorageArrayBuffer<DrawPrototype, 16>;
654 using DrawCommandBuf = StorageArrayBuffer<DrawCommand, 16, true>;
655 using ResourceIdBuf = StorageArrayBuffer<uint, 128, true>;
656
657 using DrawGroupKey = std::pair<uint, gpu::Batch *>;
658 using DrawGroupMap = Map<DrawGroupKey, uint>;
660 DrawGroupMap group_ids_;
661
663 DrawGroupBuf group_buf_ = {"DrawGroupBuf"};
665 DrawPrototypeBuf prototype_buf_ = {"DrawPrototypeBuf"};
667 DrawCommandBuf command_buf_ = {"DrawCommandBuf"};
669 ResourceIdBuf resource_id_buf_ = {"ResourceIdBuf"};
671 uint header_id_counter_ = 0;
673 uint group_count_ = 0;
675 uint prototype_count_ = 0;
677 uint resource_id_count_ = 0;
678
679 public:
680 void clear()
681 {
682 group_buf_.trim_to_next_power_of_2(group_count_);
683 /* Two commands per group (inverted and non-inverted scale). */
684 command_buf_.trim_to_next_power_of_2(group_count_ * 2);
685 prototype_buf_.trim_to_next_power_of_2(prototype_count_);
686 resource_id_buf_.trim_to_next_power_of_2(resource_id_count_);
687 header_id_counter_ = 0;
688 group_count_ = 0;
689 prototype_count_ = 0;
690 group_ids_.clear();
691 }
692
694 Vector<Undetermined, 0> &commands,
695 gpu::Batch *batch,
696 uint instance_len,
697 uint vertex_len,
698 uint vertex_first,
699 ResourceIDRange id_range,
700 uint custom_id,
701 GPUPrimType expanded_prim_type,
702 uint16_t expanded_prim_len)
703 {
704 BLI_assert(batch != nullptr);
705 /* Custom draw-calls cannot be batched and will produce one group per draw. */
706 const bool custom_group = ((vertex_first != 0 && vertex_first != -1) || vertex_len != -1);
707
708 BLI_assert(vertex_len != 0);
709 vertex_len = vertex_len == -1 ? 0 : vertex_len;
710 instance_len = instance_len != -1 ? instance_len : 1;
711
712 /* If there was some state changes since previous call, we have to create another command. */
713 if (headers.is_empty() || headers.last().type != Type::DrawMulti) {
714 uint index = commands.append_and_get_index({});
715 headers.append({Type::DrawMulti, index});
716 commands[index].draw_multi = {batch, this, uint(-1), header_id_counter_++};
717 }
718
719 DrawMulti &cmd = commands.last().draw_multi;
720
721 uint &group_id = group_ids_.lookup_or_add(DrawGroupKey(cmd.uuid, batch), uint(-1));
722
723 bool inverted = id_range.has_inverted_handedness();
724
725 for (auto res_id : id_range.id_range()) {
726 DrawPrototype &draw = prototype_buf_.get_or_resize(prototype_count_++);
727 draw.res_id = uint32_t(res_id);
728 draw.custom_id = custom_id;
729 draw.instance_len = instance_len;
730 draw.group_id = group_id;
731
732 if (group_id == uint(-1) || custom_group) {
733 uint new_group_id = group_count_++;
734 draw.group_id = new_group_id;
735
736 DrawGroup &group = group_buf_.get_or_resize(new_group_id);
737 group.next = cmd.group_first;
738 group.len = instance_len;
739 group.front_facing_len = inverted ? 0 : instance_len;
740 group.front_facing_counter = 0;
741 group.back_facing_counter = 0;
742 group.desc.vertex_len = vertex_len;
743 group.desc.vertex_first = vertex_first;
744 group.desc.gpu_batch = batch;
745 group.desc.expand_prim_type = expanded_prim_type;
746 group.desc.expand_prim_len = expanded_prim_len;
747 BLI_assert_msg(expanded_prim_len < (1 << 3),
748 "Not enough bits to store primitive expansion");
749 /* Custom group are not to be registered in the group_ids_. */
750 if (!custom_group) {
751 group_id = new_group_id;
752 }
753 /* For serialization only. Reset before use on GPU. */
755 /* Append to list. */
756 cmd.group_first = new_group_id;
757 }
758 else {
759 DrawGroup &group = group_buf_[group_id];
760 group.len += instance_len;
761 group.front_facing_len += inverted ? 0 : instance_len;
762 /* For serialization only. Reset before use on GPU. */
764 /* NOTE: We assume that primitive expansion is coupled to the shader itself. Meaning we
765 * rely on shader bind to isolate the expanded draws into their own group (as there could
766 * be regular draws and extended draws using the same batch mixed inside the same pass).
767 * This will cause issues if this assumption is broken. Also it is very hard to detect this
768 * case for error checking. At least we can check that expansion settings don't change
769 * inside a group. */
770 BLI_assert(group.desc.expand_prim_type == expanded_prim_type);
771 BLI_assert(group.desc.expand_prim_len == expanded_prim_len);
772 }
773 }
774 }
775
777 Vector<Undetermined, 0> &commands,
778 VisibilityBuf &visibility_buf,
779 int visibility_word_per_draw,
780 int view_len,
781 bool use_custom_ids);
782
784};
785
787
788}; // namespace draw::command
789
790} // namespace blender
#define UNUSED_VARS_NDEBUG(...)
#define BLI_assert_msg(a, msg)
virtual bool serialize(void *o_alignedDataBuffer, unsigned i_dataBufferSize, bool i_swapEndian) const
Data buffer MUST be 16 byte aligned.
int64_t append_and_get_index(const T &value)
void append(const T &value)
const T & last(const int64_t n=0) const
bool is_empty() const
void append_draw(Vector< Header, 0 > &headers, Vector< Undetermined, 0 > &commands, gpu::Batch *batch, uint instance_len, uint vertex_len, uint vertex_first, ResourceIDRange id_range, uint custom_id, GPUPrimType expanded_prim_type, uint16_t expanded_prim_len)
void generate_commands(Vector< Header, 0 > &headers, Vector< Undetermined, 0 > &commands, VisibilityBuf &visibility_buf, int visibility_word_per_draw, int view_len, bool use_custom_ids)
void append_draw(Vector< Header, 0 > &headers, Vector< Undetermined, 0 > &commands, gpu::Batch *batch, uint instance_len, uint vertex_len, uint vertex_first, ResourceIDRange id_range, uint custom_id, GPUPrimType expanded_prim_type, uint16_t expanded_prim_len)
void bind(RecordingState &state)
#define DRW_STATE_DEFAULT
Definition draw_state.hh:79
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
const int state
ccl_device_inline float3x3 inverted(const float3x3 m)
BLI_STATIC_ASSERT(MBC_BATCH_LEN< 64, "Number of batches exceeded the limit of bit fields")
StorageArrayBuffer< uint, 4, true > VisibilityBuf
Definition draw_view.hh:35
BMesh Iterators.
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void GPU_storagebuf_debug_unbind_all()
__int64 int64_t
Definition BKE_text.h:90
VecBase< int32_t, 4 > int4
unsigned int uint
Definition BKE_text.h:55
bool assign_if_different(T &old_value, T &&new_value)
void GPU_texture_unbind_all()
MatBase< float, 4, 4 > float4x4
Global G
Definition blender.cc:57
VecBase< float, 4 > float4
unsigned short uint16_t
Definition BKE_text.h:80
unsigned int uint32_t
Definition BKE_text.h:81
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
VecBase< int32_t, 3 > int3
unsigned char uint8_t
Definition BKE_text.h:79
@ DRW_STATE_NO_DRAW
Definition draw_state.hh:29
void GPU_texture_image_unbind_all()
void GPU_front_facing(bool invert)
Definition gpu_state.cc:60
void GPU_uniformbuf_debug_unbind_all()
VecBase< float, 3 > float3
VecBase< double, 4 > double4
MINLINE uint min_uu(uint a, uint b)
std::string serialize() const
void execute(RecordingState &state) const
void execute(RecordingState &state) const
struct blender::draw::command::DrawGroup::@260053362377366347260167202326266235125360167346 desc
void execute(RecordingState &state) const
std::string serialize(const std::string &line_prefix) const
void execute(RecordingState &state) const
void execute(RecordingState &state) const
Draw(gpu::Batch *batch, uint instance_len, uint vertex_len, uint vertex_first, GPUPrimType expanded_prim_type, uint expanded_prim_len, ResourceID res_id)
PushConstant(int loc, const float4x4 *val)
PushConstant(int loc, const float3 *val, int arr)
PushConstant(int loc, const int3 *val, int arr)
void execute(RecordingState &state) const
PushConstant(int loc, const int4 *val, int arr)
PushConstant(int loc, const float2 *val, int arr)
PushConstant(int loc, const int3 &val)
enum blender::draw::command::PushConstant::Type type
PushConstant(int loc, const float3 &val)
PushConstant(int loc, const int2 &val)
PushConstant(int loc, const int &val)
PushConstant(int loc, const int2 *val, int arr)
PushConstant(int loc, const float *val, int arr)
PushConstant(int loc, const float4 &val)
PushConstant(int loc, const float2 &val)
PushConstant(int loc, const float4 *val, int arr)
PushConstant(int loc, const float &val)
PushConstant(int loc, const int *val, int arr)
PushConstant(int loc, const int4 &val)
gpu::shader::SpecializationConstants specialization_constants
const gpu::shader::SpecializationConstants * specialization_constants_get()
ResourceBind(int slot_, gpu::TopLevelAS *res)
ResourceBind(int slot_, gpu::VertBuf **res, Type)
enum blender::draw::command::ResourceBind::Type type
ResourceBind(int slot_, draw::Image *res)
ResourceBind(int slot_, gpu::StorageBuf **res)
ResourceBind(int slot_, gpu::VertBuf *res)
ResourceBind(int slot_, gpu::UniformBuf *res)
ResourceBind(int slot_, gpu::Texture **res, GPUSamplerState state)
ResourceBind(int slot_, gpu::UniformBuf **res)
ResourceBind(int slot_, gpu::UniformBuf **res, Type)
ResourceBind(int slot_, gpu::Texture *res, GPUSamplerState state)
ResourceBind(int slot_, draw::Image **res)
ResourceBind(int slot_, gpu::VertBuf **res)
ResourceBind(int slot_, gpu::IndexBuf *res, Type)
ResourceBind(int slot_, gpu::StorageBuf *res)
ResourceBind(int slot_, gpu::UniformBuf *res, Type)
ResourceBind(int slot_, gpu::VertBuf *res, Type)
ResourceBind(int slot_, gpu::IndexBuf **res, Type)
void execute(RecordingState &state) const
SpecializeConstant(gpu::Shader *sh, int loc, const uint *val)
SpecializeConstant(gpu::Shader *sh, int loc, const int &val)
SpecializeConstant(gpu::Shader *sh, int loc, const bool *val)
SpecializeConstant(gpu::Shader *sh, int loc, const float *val)
void execute(RecordingState &state) const
SpecializeConstant(gpu::Shader *sh, int loc, const uint &val)
SpecializeConstant(gpu::Shader *sh, int loc, const bool &val)
SpecializeConstant(gpu::Shader *sh, int loc, const int *val)
enum blender::draw::command::SpecializeConstant::Type type
SpecializeConstant(gpu::Shader *sh, int loc, const float &val)
void execute(RecordingState &state) const
static void set(DRWState state=DRW_STATE_DEFAULT)