diff --git a/src/modules/graphics/vulkan/Graphics.cpp b/src/modules/graphics/vulkan/Graphics.cpp index 5313a7e2c..3cdfc145e 100644 --- a/src/modules/graphics/vulkan/Graphics.cpp +++ b/src/modules/graphics/vulkan/Graphics.cpp @@ -1430,8 +1430,17 @@ graphics::Shader::BuiltinUniformData Graphics::getCurrentBuiltinUniformData() // Same with point size. data.normalMatrix[1].w = getPointSize(); - data.screenSizeParams.x = static_cast(swapChainExtent.width); - data.screenSizeParams.y = static_cast(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;