Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/metal/mtl_drawlist.mm
| Show First 20 Lines • Show All 179 Lines • ▼ Show 20 Lines | void MTLDrawList::submit() | ||||
| /* Heuristic to determine whether using indirect drawing is more efficient. */ | /* Heuristic to determine whether using indirect drawing is more efficient. */ | ||||
| size_t command_size = MDI_INDEXED ? sizeof(MTLDrawIndexedPrimitivesIndirectArguments) : | size_t command_size = MDI_INDEXED ? sizeof(MTLDrawIndexedPrimitivesIndirectArguments) : | ||||
| sizeof(MTLDrawPrimitivesIndirectArguments); | sizeof(MTLDrawPrimitivesIndirectArguments); | ||||
| const bool is_finishing_a_buffer = (command_offset_ + command_size > buffer_size_); | const bool is_finishing_a_buffer = (command_offset_ + command_size > buffer_size_); | ||||
| can_use_MDI = can_use_MDI && (is_finishing_a_buffer || command_len_ > 2); | can_use_MDI = can_use_MDI && (is_finishing_a_buffer || command_len_ > 2); | ||||
| /* Bind Batch to setup render pipeline state. */ | /* Bind Batch to setup render pipeline state. */ | ||||
| BLI_assert(batch_ != nullptr); | |||||
| id<MTLRenderCommandEncoder> rec = batch_->bind(0, 0, 0, 0); | id<MTLRenderCommandEncoder> rec = batch_->bind(0, 0, 0, 0); | ||||
| if (!rec) { | if (rec == nil) { | ||||
| BLI_assert_msg(false, "A RenderCommandEncoder should always be available!\n"); | BLI_assert_msg(false, "A RenderCommandEncoder should always be available!\n"); | ||||
| return; | return; | ||||
| } | } | ||||
| /* Common properties. */ | /* Common properties. */ | ||||
| MTLPrimitiveType mtl_prim_type = gpu_prim_type_to_metal(batch_->prim_type); | MTLPrimitiveType mtl_prim_type = gpu_prim_type_to_metal(batch_->prim_type); | ||||
| /* Execute multi-draw indirect. */ | /* Execute multi-draw indirect. */ | ||||
| ▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines | |||||