Metal: Fix a warning and compilation errors
These were oversight when developping without testing on MacOS.
This commit is contained in:
@@ -989,6 +989,9 @@ inline bool mtl_convert_vertex_format(MTLVertexFormat shader_attrib_format,
|
||||
case GPU_COMP_I10:
|
||||
out_vert_format = MTLVertexFormatInt1010102Normalized;
|
||||
break;
|
||||
case GPU_COMP_MAX:
|
||||
BLI_assert_unreachable();
|
||||
break;
|
||||
}
|
||||
*r_convertedFormat = out_vert_format;
|
||||
return (out_vert_format != MTLVertexFormatInvalid);
|
||||
|
||||
@@ -37,6 +37,7 @@ class MTLUniformBuf : public UniformBuf {
|
||||
void bind(int slot) override;
|
||||
void bind_as_ssbo(int slot) override;
|
||||
void unbind() override;
|
||||
void clear_to_zero() override;
|
||||
|
||||
id<MTLBuffer> get_metal_buffer(int *r_offset);
|
||||
int get_size();
|
||||
|
||||
@@ -84,7 +84,7 @@ void MTLUniformBuf::update(const void *data)
|
||||
void MTLUniformBuf::clear_to_zero()
|
||||
{
|
||||
/* TODO(fclem): Avoid another allocation and just do the clear on the GPU if possible. */
|
||||
void *clear_data = calloc(size_in_bytes_);
|
||||
void *clear_data = calloc(1, size_in_bytes_);
|
||||
this->update(clear_data);
|
||||
free(clear_data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user