mirror of
https://github.com/love2d/love.git
synced 2026-08-19 20:19:42 +02:00
metal: fix texel buffer size
This commit is contained in:
@@ -76,8 +76,9 @@ Buffer::Buffer(love::graphics::Graphics *gfx, id<MTLDevice> device, const Settin
|
|||||||
if (@available(iOS 12, macOS 10.14, *))
|
if (@available(iOS 12, macOS 10.14, *))
|
||||||
{
|
{
|
||||||
MTLPixelFormat pixformat = getMTLPixelFormat(getDataMember(0).decl.format);
|
MTLPixelFormat pixformat = getMTLPixelFormat(getDataMember(0).decl.format);
|
||||||
|
size_t width = arraylength * getDataMembers().size();
|
||||||
auto desc = [MTLTextureDescriptor textureBufferDescriptorWithPixelFormat:pixformat
|
auto desc = [MTLTextureDescriptor textureBufferDescriptorWithPixelFormat:pixformat
|
||||||
width:arraylength
|
width:width
|
||||||
resourceOptions:opts
|
resourceOptions:opts
|
||||||
usage:MTLTextureUsageShaderRead];
|
usage:MTLTextureUsageShaderRead];
|
||||||
texture = [buffer newTextureWithDescriptor:desc offset:0 bytesPerRow:size];
|
texture = [buffer newTextureWithDescriptor:desc offset:0 bytesPerRow:size];
|
||||||
|
|||||||
Reference in New Issue
Block a user