summaryrefslogtreecommitdiff
path: root/servers/xr
diff options
context:
space:
mode:
authorBastiaan Olij <mux213@gmail.com>2022-11-16 13:32:42 +1100
committerBastiaan Olij <mux213@gmail.com>2022-11-17 00:32:42 +1100
commit616ba8745fb475fa626dbbffbd34ebc47ae3dbea (patch)
tree6bf67bacd645cbb05238808015acb3882acbe769 /servers/xr
parent5993209b2649c93b56789bfc243c5a6046ee77ce (diff)
Fix VRS issues
Diffstat (limited to 'servers/xr')
-rw-r--r--servers/xr/xr_interface.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/servers/xr/xr_interface.cpp b/servers/xr/xr_interface.cpp
index 4d58d24405..ec4ae98397 100644
--- a/servers/xr/xr_interface.cpp
+++ b/servers/xr/xr_interface.cpp
@@ -167,11 +167,12 @@ RID XRInterface::get_vrs_texture() {
// Default logic will return a standard VRS image based on our target size and default projections.
// Note that this only gets called if VRS is supported on the hardware.
- Size2 texel_size = Size2(16.0, 16.0); // For now we assume we always use 16x16 texels, seems to be the standard.
+ 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 view_count = get_view_count();
Size2 target_size = get_render_target_size();
real_t aspect = target_size.x / target_size.y; // is this y/x ?
- Size2 vrs_size = Size2(round(0.5 + target_size.x / texel_size.x), round(0.5 + target_size.y / texel_size.y));
+ Size2 vrs_size = Size2(round(0.5 + target_size.x / texel_width), round(0.5 + target_size.y / texel_height));
real_t radius = vrs_size.length() * 0.5;
Size2 vrs_sizei = vrs_size;
@@ -179,6 +180,8 @@ RID XRInterface::get_vrs_texture() {
const uint8_t densities[] = {
0, // 1x1
1, // 1x2
+ // 2, // 1x4 - not supported
+ // 3, // 1x8 - not supported
// 4, // 2x1
5, // 2x2
6, // 2x4