mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Fix creating a linear rgba8 canvas when gamma correct rendering is on.
Fixes #1973
This commit is contained in:
@@ -168,7 +168,7 @@ Texture::Texture(Graphics *gfx, const Settings &settings, const Slices *slices)
|
||||
, computeWrite(settings.computeWrite)
|
||||
, readable(true)
|
||||
, mipmapsMode(settings.mipmaps)
|
||||
, sRGB(isGammaCorrect() && !settings.linear)
|
||||
, sRGB(false)
|
||||
, width(settings.width)
|
||||
, height(settings.height)
|
||||
, depth(settings.type == TEXTURE_VOLUME ? settings.layers : 1)
|
||||
@@ -204,7 +204,7 @@ Texture::Texture(Graphics *gfx, const Settings &settings, const Slices *slices)
|
||||
love::image::ImageDataBase *slice = slices->get(0, 0);
|
||||
|
||||
format = slice->getFormat();
|
||||
if (sRGB)
|
||||
if (isGammaCorrect() && !settings.linear)
|
||||
format = getSRGBPixelFormat(format);
|
||||
|
||||
pixelWidth = slice->getWidth();
|
||||
@@ -236,6 +236,7 @@ Texture::Texture(Graphics *gfx, const Settings &settings, const Slices *slices)
|
||||
readable = !renderTarget || !isPixelFormatDepthStencil(format);
|
||||
|
||||
format = gfx->getSizedFormat(format, renderTarget, readable);
|
||||
sRGB = isPixelFormatSRGB(format) || (isCompressed() && isGammaCorrect() && !settings.linear);
|
||||
|
||||
if (mipmapsMode == MIPMAPS_AUTO && isCompressed())
|
||||
mipmapsMode = MIPMAPS_MANUAL;
|
||||
|
||||
Reference in New Issue
Block a user