소스 검색

metal: fix texel buffer size

Alex Szpakowski 4 년 전
부모
커밋
ceaa8f95ff
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      src/modules/graphics/metal/Buffer.mm

+ 2 - 1
src/modules/graphics/metal/Buffer.mm

@@ -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];