metal: fix texel buffer size

This commit is contained in:
Alex Szpakowski
2021-03-31 23:04:27 -03:00
parent 5fa570b9a6
commit ceaa8f95ff
+2 -1
View File
@@ -76,8 +76,9 @@ Buffer::Buffer(love::graphics::Graphics *gfx, id<MTLDevice> device, const Settin
if (@available(iOS 12, macOS 10.14, *))
{
MTLPixelFormat pixformat = getMTLPixelFormat(getDataMember(0).decl.format);
size_t width = arraylength * getDataMembers().size();
auto desc = [MTLTextureDescriptor textureBufferDescriptorWithPixelFormat:pixformat
width:arraylength
width:width
resourceOptions:opts
usage:MTLTextureUsageShaderRead];
texture = [buffer newTextureWithDescriptor:desc offset:0 bytesPerRow:size];