Don't use PPSSPP-specific stuff in Common/VR for now.

This commit is contained in:
Henrik Rydgård committed 2022-10-17 23:13:43 +02:00
1 parent 0a222345c1
commit 0251f33ec3
10 files changed
+118 -40

No files matched your search

+10 -10
View File
@@ -8,7 +8,7 @@
#include <ctime>
#include <cassert>
#if PPSSPP_PLATFORM(ANDROID)
#ifdef ANDROID
#include <pthread.h>
#include <sys/prctl.h>
#endif
@@ -44,7 +44,7 @@ void ovrFramebuffer_Clear(ovrFramebuffer* frameBuffer) {
frameBuffer->Acquired = false;
}
#if PPSSPP_PLATFORM(ANDROID)
#ifdef OPENXR
bool ovrFramebuffer_CreateGL(XrSession session, ovrFramebuffer* frameBuffer, int width, int height, bool multiview) {
@@ -138,8 +138,6 @@ bool ovrFramebuffer_CreateGL(XrSession session, ovrFramebuffer* frameBuffer, int
return true;
}
#endif
bool ovrFramebuffer_CreateVK(XrSession session, ovrFramebuffer* frameBuffer, int width, int height,
bool multiview, void* context) {
@@ -255,7 +253,7 @@ void ovrFramebuffer_Destroy(ovrFramebuffer* frameBuffer) {
delete[] frameBuffer->VKDepthImages;
delete[] frameBuffer->VKFrameBuffers;
} else {
#if PPSSPP_PLATFORM(ANDROID)
#ifdef ANDROID
GL(glDeleteFramebuffers(frameBuffer->TextureSwapChainLength, frameBuffer->GLFrameBuffers));
free(frameBuffer->GLFrameBuffers);
#endif
@@ -272,7 +270,7 @@ void* ovrFramebuffer_SetCurrent(ovrFramebuffer* frameBuffer) {
if (frameBuffer->UseVulkan) {
return (void *)frameBuffer->VKFrameBuffers[frameBuffer->TextureSwapChainIndex];
} else {
#if PPSSPP_PLATFORM(ANDROID)
#ifdef ANDROID
GL(glBindFramebuffer(GL_DRAW_FRAMEBUFFER, frameBuffer->GLFrameBuffers[frameBuffer->TextureSwapChainIndex]));
#endif
return nullptr;
@@ -304,7 +302,7 @@ void ovrFramebuffer_Acquire(ovrFramebuffer* frameBuffer) {
if (frameBuffer->UseVulkan) {
//TODO:implement
} else {
#if PPSSPP_PLATFORM(ANDROID)
#ifdef ANDROID
GL(glEnable( GL_SCISSOR_TEST ));
GL(glViewport( 0, 0, frameBuffer->Width, frameBuffer->Height ));
GL(glClearColor( 0.0f, 0.0f, 0.0f, 1.0f ));
@@ -326,7 +324,7 @@ void ovrFramebuffer_Release(ovrFramebuffer* frameBuffer) {
if (frameBuffer->UseVulkan) {
//TODO:implement
} else {
#if PPSSPP_PLATFORM(ANDROID)
#ifdef ANDROID
GL(glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE));
GL(glClearColor(0.0f, 0.0f, 0.0f, 1.0f));
GL(glClear(GL_COLOR_BUFFER_BIT));
@@ -357,7 +355,7 @@ void ovrRenderer_Create(XrSession session, ovrRenderer* renderer, int width, int
if (vulkanContext) {
ovrFramebuffer_CreateVK(session, &renderer->FrameBuffer[i], width, height, multiview, vulkanContext);
} else {
#if PPSSPP_PLATFORM(ANDROID)
#ifdef ANDROID
ovrFramebuffer_CreateGL(session, &renderer->FrameBuffer[i], width, height, multiview);
#endif
}
@@ -375,7 +373,7 @@ void ovrRenderer_MouseCursor(ovrRenderer* renderer, int x, int y, int size) {
if (renderer->FrameBuffer[0].UseVulkan) {
//TODO:implement
} else {
#if PPSSPP_PLATFORM(ANDROID)
#ifdef ANDROID
GL(glEnable(GL_SCISSOR_TEST));
GL(glScissor(x, y, size, size));
GL(glViewport(x, y, size, size));
@@ -547,3 +545,5 @@ int ovrApp_HandleXrEvents(ovrApp* app) {
}
return recenter;
}
#endif