mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
vulkan: fix love_ScreenSize shader variable when a canvas is active.
This commit is contained in:
@@ -1430,8 +1430,17 @@ graphics::Shader::BuiltinUniformData Graphics::getCurrentBuiltinUniformData()
|
|||||||
// Same with point size.
|
// Same with point size.
|
||||||
data.normalMatrix[1].w = getPointSize();
|
data.normalMatrix[1].w = getPointSize();
|
||||||
|
|
||||||
data.screenSizeParams.x = static_cast<float>(swapChainExtent.width);
|
const auto &rt = states.back().renderTargets.getFirstTarget();
|
||||||
data.screenSizeParams.y = static_cast<float>(swapChainExtent.height);
|
if (rt.texture != nullptr)
|
||||||
|
{
|
||||||
|
data.screenSizeParams.x = rt.texture->getPixelWidth(rt.mipmap);
|
||||||
|
data.screenSizeParams.y = rt.texture->getPixelHeight(rt.mipmap);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
data.screenSizeParams.x = getPixelWidth();
|
||||||
|
data.screenSizeParams.y = getPixelHeight();
|
||||||
|
}
|
||||||
|
|
||||||
data.screenSizeParams.z = 1.0f;
|
data.screenSizeParams.z = 1.0f;
|
||||||
data.screenSizeParams.w = 0.0f;
|
data.screenSizeParams.w = 0.0f;
|
||||||
|
|||||||
Reference in New Issue
Block a user