Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/metal/mtl_immediate.mm
| Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | if (context_ && this->vertex_idx > 0 && this->shader) { | ||||
| /* Populate pipeline state vertex descriptor. */ | /* Populate pipeline state vertex descriptor. */ | ||||
| MTLStateManager *state_manager = static_cast<MTLStateManager *>( | MTLStateManager *state_manager = static_cast<MTLStateManager *>( | ||||
| MTLContext::get()->state_manager); | MTLContext::get()->state_manager); | ||||
| MTLRenderPipelineStateDescriptor &desc = state_manager->get_pipeline_descriptor(); | MTLRenderPipelineStateDescriptor &desc = state_manager->get_pipeline_descriptor(); | ||||
| const MTLShaderInterface *interface = active_mtl_shader->get_interface(); | const MTLShaderInterface *interface = active_mtl_shader->get_interface(); | ||||
| /* Reset vertex descriptor to default state. */ | /* Reset vertex descriptor to default state. */ | ||||
| desc.reset_vertex_descriptor(); | desc.reset_vertex_descriptor(); | ||||
| desc.vertex_descriptor.total_attributes = interface->get_total_attributes(); | |||||
| desc.vertex_descriptor.num_attributes = interface->get_total_attributes(); | desc.vertex_descriptor.max_attribute_value = interface->get_total_attributes() - 1; | ||||
| desc.vertex_descriptor.num_vert_buffers = 1; | desc.vertex_descriptor.num_vert_buffers = 1; | ||||
| for (int i = 0; i < desc.vertex_descriptor.num_attributes; i++) { | for (int i = 0; i < desc.vertex_descriptor.total_attributes; i++) { | ||||
| desc.vertex_descriptor.attributes[i].format = MTLVertexFormatInvalid; | desc.vertex_descriptor.attributes[i].format = MTLVertexFormatInvalid; | ||||
| } | } | ||||
| desc.vertex_descriptor.uses_ssbo_vertex_fetch = | desc.vertex_descriptor.uses_ssbo_vertex_fetch = | ||||
| active_mtl_shader->get_uses_ssbo_vertex_fetch(); | active_mtl_shader->get_uses_ssbo_vertex_fetch(); | ||||
| desc.vertex_descriptor.num_ssbo_attributes = 0; | desc.vertex_descriptor.num_ssbo_attributes = 0; | ||||
| /* SSBO Vertex Fetch -- Verify Attributes. */ | /* SSBO Vertex Fetch -- Verify Attributes. */ | ||||
| if (active_mtl_shader->get_uses_ssbo_vertex_fetch()) { | if (active_mtl_shader->get_uses_ssbo_vertex_fetch()) { | ||||
| ▲ Show 20 Lines • Show All 285 Lines • Show Last 20 Lines | |||||