Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/metal/mtl_shader.mm
| Show First 20 Lines • Show All 530 Lines • ▼ Show 20 Lines | bool MTLShader::get_push_constant_is_dirty() | ||||
| return push_constant_modified_; | return push_constant_modified_; | ||||
| } | } | ||||
| void MTLShader::push_constant_bindstate_mark_dirty(bool is_dirty) | void MTLShader::push_constant_bindstate_mark_dirty(bool is_dirty) | ||||
| { | { | ||||
| push_constant_modified_ = is_dirty; | push_constant_modified_ = is_dirty; | ||||
| } | } | ||||
| void MTLShader::vertformat_from_shader(GPUVertFormat *format) const | |||||
| { | |||||
| GPU_vertformat_clear(format); | |||||
| const MTLShaderInterface *mtl_interface = static_cast<const MTLShaderInterface *>(interface); | |||||
| for (const uint attr_id : IndexRange(mtl_interface->get_total_attributes())) { | |||||
| const MTLShaderInputAttribute &attr = mtl_interface->get_attribute(attr_id); | |||||
| /* Extract type parameters from Metal type. */ | |||||
| GPUVertCompType comp_type = comp_type_from_vert_format(attr.format); | |||||
| uint comp_len = comp_count_from_vert_format(attr.format); | |||||
| GPUVertFetchMode fetch_mode = fetchmode_from_vert_format(attr.format); | |||||
| GPU_vertformat_attr_add(format, | |||||
| mtl_interface->get_name_at_offset(attr.name_offset), | |||||
| comp_type, | |||||
| comp_len, | |||||
| fetch_mode); | |||||
| } | |||||
| } | |||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name METAL Custom Behavior | /** \name METAL Custom Behavior | ||||
| * \{ */ | * \{ */ | ||||
| void MTLShader::set_vertex_function_name(NSString *vert_function_name) | void MTLShader::set_vertex_function_name(NSString *vert_function_name) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 699 Lines • Show Last 20 Lines | |||||