mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +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.
|
||||
data.normalMatrix[1].w = getPointSize();
|
||||
|
||||
data.screenSizeParams.x = static_cast<float>(swapChainExtent.width);
|
||||
data.screenSizeParams.y = static_cast<float>(swapChainExtent.height);
|
||||
const auto &rt = states.back().renderTargets.getFirstTarget();
|
||||
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.w = 0.0f;
|
||||
|
||||
Reference in New Issue
Block a user