metal: fix love_ScreenSize when a canvas is active

This commit is contained in:
Alex Szpakowski
2021-04-02 16:10:20 -03:00
parent 1e90b4e8f7
commit 4cac353908
+6 -1
View File
@@ -731,8 +731,13 @@ void Graphics::applyShaderUniforms(id<MTLRenderCommandEncoder> renderEncoder, lo
// Same with point size.
builtins->normalMatrix[1].w = getPointSize();
// FIXME: should be active RT dimensions
builtins->screenSizeParams = Vector4(getPixelWidth(), getPixelHeight(), 1.0f, 0.0f);
auto rt = states.back().renderTargets.getFirstTarget().texture.get();
if (rt != nullptr)
{
builtins->screenSizeParams.x = rt->getPixelWidth();
builtins->screenSizeParams.y = rt->getPixelHeight();
}
builtins->constantColor = getColor();
gammaCorrectColor(builtins->constantColor);