Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/metal/mtl_batch.mm
| Show First 20 Lines • Show All 937 Lines • ▼ Show 20 Lines | switch (input_prim_type) { | ||||
| BLI_assert_msg(false, "Cannot generate optimized topology buffer for other types."); | BLI_assert_msg(false, "Cannot generate optimized topology buffer for other types."); | ||||
| break; | break; | ||||
| } | } | ||||
| uint32_t output_IB_elems = output_prim_count * ((output_prim_type == GPU_PRIM_TRIS) ? 3 : 2); | uint32_t output_IB_elems = output_prim_count * ((output_prim_type == GPU_PRIM_TRIS) ? 3 : 2); | ||||
| /* Allocate buffer. */ | /* Allocate buffer. */ | ||||
| uint32_t buffer_bytes = output_IB_elems * 4; | uint32_t buffer_bytes = output_IB_elems * 4; | ||||
| BLI_assert(buffer_bytes > 0); | BLI_assert(buffer_bytes > 0); | ||||
| this->emulated_topology_buffer_ = MTLContext::get_global_memory_manager().allocate( | this->emulated_topology_buffer_ = MTLContext::get_global_memory_manager()->allocate( | ||||
| buffer_bytes, true); | buffer_bytes, true); | ||||
| /* Populate. */ | /* Populate. */ | ||||
| uint32_t *data = (uint32_t *)this->emulated_topology_buffer_->get_host_ptr(); | uint32_t *data = (uint32_t *)this->emulated_topology_buffer_->get_host_ptr(); | ||||
| BLI_assert(data != nullptr); | BLI_assert(data != nullptr); | ||||
| /* TODO(Metal): Support inverse winding modes. */ | /* TODO(Metal): Support inverse winding modes. */ | ||||
| bool winding_clockwise = false; | bool winding_clockwise = false; | ||||
| ▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines | |||||