mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
Change the 'viewformats' texture setting field to be a list of pixel formats.
Replace Texture:hasViewFormats with Texture:getViewFormats.
This commit is contained in:
@@ -76,8 +76,15 @@ Texture::Texture(love::graphics::Graphics *gfxbase, id<MTLDevice> device, const
|
||||
desc.usage |= MTLTextureUsageRenderTarget;
|
||||
if (computeWrite)
|
||||
desc.usage |= MTLTextureUsageShaderWrite;
|
||||
if (viewFormats)
|
||||
desc.usage |= MTLTextureUsagePixelFormatView;
|
||||
|
||||
for (PixelFormat viewformat : viewFormats)
|
||||
{
|
||||
if (getLinearPixelFormat(viewformat) != getLinearPixelFormat(format))
|
||||
{
|
||||
desc.usage |= MTLTextureUsagePixelFormatView;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
texture = [device newTextureWithDescriptor:desc];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user