mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 05:19:56 +00:00
OpenXR - Add FBO supersampling
This commit is contained in:
parent
630cae9616
commit
6894f581ab
@ -160,10 +160,12 @@ void InitVROnAndroid(void* vm, void* activity, const char* system, int version,
|
||||
if (strcmp(vendor, "PICO") == 0) {
|
||||
VR_SetPlatformFLag(VR_PLATFORM_CONTROLLER_PICO, true);
|
||||
VR_SetPlatformFLag(VR_PLATFORM_EXTENSION_INSTANCE, true);
|
||||
VR_SetConfigFloat(VR_CONFIG_VIEWPORT_SUPERSAMPLING, 1.0f);
|
||||
} else {
|
||||
VR_SetPlatformFLag(VR_PLATFORM_CONTROLLER_QUEST, true);
|
||||
VR_SetPlatformFLag(VR_PLATFORM_EXTENSION_PASSTHROUGH, true);
|
||||
VR_SetPlatformFLag(VR_PLATFORM_EXTENSION_PERFORMANCE, true);
|
||||
VR_SetConfigFloat(VR_CONFIG_VIEWPORT_SUPERSAMPLING, 1.3f);
|
||||
}
|
||||
VR_SetPlatformFLag(VR_PLATFORM_RENDERER_VULKAN, (GPUBackend)g_Config.iGPUBackend == GPUBackend::VULKAN);
|
||||
|
||||
@ -432,6 +434,8 @@ void UpdateVRInput(bool haptics, float dp_xscale, float dp_yscale) {
|
||||
float speed = (cx + cy) / 2;
|
||||
float x = cx - tan(ToRadians(angles.y - VR_GetConfigFloat(VR_CONFIG_MENU_YAW))) * speed;
|
||||
float y = cy - tan(ToRadians(angles.x)) * speed * VR_GetConfigFloat(VR_CONFIG_CANVAS_ASPECT);
|
||||
x *= VR_GetConfigFloat(VR_CONFIG_VIEWPORT_SUPERSAMPLING);
|
||||
y *= VR_GetConfigFloat(VR_CONFIG_VIEWPORT_SUPERSAMPLING);
|
||||
|
||||
//set renderer
|
||||
VR_SetConfig(VR_CONFIG_MOUSE_X, (int)x);
|
||||
|
@ -131,6 +131,9 @@ void VR_GetResolution(engine_t* engine, int *pWidth, int *pHeight) {
|
||||
*pWidth = width;
|
||||
*pHeight = height;
|
||||
}
|
||||
|
||||
*pWidth *= VR_GetConfigFloat(VR_CONFIG_VIEWPORT_SUPERSAMPLING);
|
||||
*pHeight *= VR_GetConfigFloat(VR_CONFIG_VIEWPORT_SUPERSAMPLING);
|
||||
}
|
||||
|
||||
void VR_Recenter(engine_t* engine) {
|
||||
@ -239,10 +242,7 @@ void VR_InitRenderer( engine_t* engine ) {
|
||||
if (VR_GetPlatformFlag(VR_PLATFORM_RENDERER_VULKAN)) {
|
||||
vulkanContext = &engine->graphicsBindingVulkan;
|
||||
}
|
||||
ovrRenderer_Create(engine->appState.Session, &engine->appState.Renderer,
|
||||
engine->appState.ViewConfigurationView[0].recommendedImageRectWidth,
|
||||
engine->appState.ViewConfigurationView[0].recommendedImageRectHeight,
|
||||
vulkanContext);
|
||||
ovrRenderer_Create(engine->appState.Session, &engine->appState.Renderer, eyeW, eyeH, vulkanContext);
|
||||
|
||||
if (VR_GetPlatformFlag(VRPlatformFlag::VR_PLATFORM_EXTENSION_PASSTHROUGH)) {
|
||||
XrPassthroughCreateInfoFB ptci = {XR_TYPE_PASSTHROUGH_CREATE_INFO_FB};
|
||||
|
@ -22,6 +22,9 @@ enum VRConfigFloat {
|
||||
VR_CONFIG_CANVAS_DISTANCE, VR_CONFIG_MENU_PITCH, VR_CONFIG_MENU_YAW, VR_CONFIG_RECENTER_YAW,
|
||||
VR_CONFIG_CANVAS_ASPECT,
|
||||
|
||||
//viewport setup
|
||||
VR_CONFIG_VIEWPORT_SUPERSAMPLING,
|
||||
|
||||
VR_CONFIG_FLOAT_MAX
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user