diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-18 16:19:22 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-18 16:19:22 +0100 |
commit | 58cb11b396fa3c424bec35d201df5e3d123c466a (patch) | |
tree | fde387980da0289d3dc3a90391a31d8c5586d624 /servers/rendering/renderer_rd/effects/vrs.cpp | |
parent | b1605c6d35139dab8b17eff3a6ce38fbdadaf89f (diff) | |
parent | 616ba8745fb475fa626dbbffbd34ebc47ae3dbea (diff) |
Merge pull request #68710 from BastiaanOlij/fix_vrs
Fix VRS issues
Diffstat (limited to 'servers/rendering/renderer_rd/effects/vrs.cpp')
-rw-r--r-- | servers/rendering/renderer_rd/effects/vrs.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/servers/rendering/renderer_rd/effects/vrs.cpp b/servers/rendering/renderer_rd/effects/vrs.cpp index 5ff00aa94c..701d53b41d 100644 --- a/servers/rendering/renderer_rd/effects/vrs.cpp +++ b/servers/rendering/renderer_rd/effects/vrs.cpp @@ -92,18 +92,15 @@ void VRS::copy_vrs(RID p_source_rd_texture, RID p_dest_framebuffer, bool p_multi } Size2i VRS::get_vrs_texture_size(const Size2i p_base_size) const { - // TODO we should find some way to store this properly, we're assuming 16x16 as this seems to be the standard but in our vrs_capacities we - // obtain a minimum and maximum size, and we should choose something within this range and then make sure that is consistently set when creating - // our frame buffer. Also it is important that we make the resulting size we calculate down below available to the end user so they know the size - // of the VRS buffer to supply. - Size2i texel_size = Size2i(16, 16); - - int width = p_base_size.x / texel_size.x; - if (p_base_size.x % texel_size.x != 0) { + int32_t texel_width = RD::get_singleton()->limit_get(RD::LIMIT_VRS_TEXEL_WIDTH); + int32_t texel_height = RD::get_singleton()->limit_get(RD::LIMIT_VRS_TEXEL_HEIGHT); + + int width = p_base_size.x / texel_width; + if (p_base_size.x % texel_width != 0) { width++; } - int height = p_base_size.y / texel_size.y; - if (p_base_size.y % texel_size.y != 0) { + int height = p_base_size.y / texel_height; + if (p_base_size.y % texel_height != 0) { height++; } return Size2i(width, height); |