Metal: Fix crash when using `batch_for_shader`.
`batch_for_shader` is an utility function that creates the correct vertex buffer based on the given shader. In the shader interface the `attr_types_` contains the GPUType for each location in the vertex buffer. When using Metal, the `attr_types_` was never updated, resulting in using incorrect or non-existing data types. This patch fixes this by updating the `attr_types_` when building the shader interface. Reviewed By: fclem Differential Revision: https://developer.blender.org/D17042
This commit is contained in:
parent
203bacbe4a
commit
7f81d18ffe
|
@ -2607,6 +2607,10 @@ MTLShaderInterface *MSLGeneratorInterface::bake_shader_interface(const char *nam
|
|||
c_offset);
|
||||
c_offset += size;
|
||||
}
|
||||
|
||||
/* Used in `GPU_shader_get_attribute_info`. */
|
||||
interface->attr_types_[this->vertex_input_attributes[attribute].layout_location] = uint8_t(
|
||||
this->vertex_input_attributes[attribute].type);
|
||||
}
|
||||
|
||||
/* Prepare Interface Default Uniform Block. */
|
||||
|
|
Loading…
Reference in New Issue