Performance improvement

This commit is contained in:
Simon 2020-03-27 23:43:22 +00:00
parent d6434d11dc
commit 1bbcbb9f57
5 changed files with 9 additions and 42 deletions

View file

@ -8,7 +8,7 @@ LOCAL_MODULE := qzdoom
LOCAL_CFLAGS := -D__MOBILE__ -DNO_PIX_BUFF -DOPNMIDI_DISABLE_GX_EMULATOR -DGZDOOM -DLZDOOM -DUSE_GL_HW_BUFFERS -DNO_VBO -D__STDINT_LIMITS -DENGINE_NAME=\"lzdoom\"
LOCAL_CPPFLAGS := -DHAVE_FLUIDSYNTH -DHAVE_MPG123 -DHAVE_SNDFILE -std=c++14 -DHAVE_JWZGLES -Wno-inconsistent-missing-override -Werror=format-security -fexceptions -fpermissive -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -D__forceinline=inline -DNO_GTK -DNO_SSE -fsigned-char
LOCAL_CPPFLAGS := -DHAVE_FLUIDSYNTH -DHAVE_MPG123 -DHAVE_SNDFILE -std=c++14 -Wno-inconsistent-missing-override -Werror=format-security -fexceptions -fpermissive -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -D__forceinline=inline -DNO_GTK -DNO_SSE -fsigned-char
LOCAL_CFLAGS += -DNO_SEND_STATS
@ -45,13 +45,11 @@ LOCAL_C_INCLUDES := \
$(GZDOOM_TOP_PATH)/src/scripting/vm \
$(GZDOOM_TOP_PATH)/src/posix \
$(GZDOOM_TOP_PATH)/src/posix\nosdl \
$(SDL_INCLUDE_PATHS) \
$(SUPPORT_LIBS)/fluidsynth-lite/include \
$(SUPPORT_LIBS)/openal/include/AL \
$(SUPPORT_LIBS)/libsndfile-android/jni/ \
$(SUPPORT_LIBS)/libmpg123 \
$(SUPPORT_LIBS)/jpeg8d \
$(SUPPORT_LIBS)/gl4es/include \
$(GZDOOM_TOP_PATH)/mobile/src \
$(GL4ES_PATH)
@ -63,9 +61,6 @@ LOCAL_C_INCLUDES := \
ANDROID_SRC_FILES = \
../mobile/src/i_specialpaths_android.cpp
# ../../../Clibs_OpenTouch/idtech1/gzdoom_game_interface.cpp \
# ../../../Clibs_OpenTouch/idtech1/touch_interface.cpp \
# ../../../Clibs_OpenTouch/idtech1/android_jni.cpp \
PLAT_POSIX_SOURCES = \
posix/i_cd.cpp \

View file

@ -88,7 +88,6 @@ namespace s3d
/* virtual */
OculusQuestEyePose::~OculusQuestEyePose()
{
dispose();
}
/* virtual */
@ -128,14 +127,6 @@ namespace s3d
return projection;
}
void OculusQuestEyePose::initialize()
{
}
void OculusQuestEyePose::dispose()
{
}
bool OculusQuestEyePose::submitFrame() const
{
prepareEyeBuffer( eye );
@ -149,7 +140,7 @@ namespace s3d
return true;
}
VSMatrix OculusQuestEyePose::getQuadInWorld() const
VSMatrix OculusQuestEyePose::getHUDProjection() const
{
VSMatrix new_projection;
new_projection.loadIdentity();
@ -174,7 +165,7 @@ namespace s3d
new_projection.rotate(-hmdorientation[PITCH], 1, 0, 0);
}
new_projection.rotate(30, 1, 0, 0);
new_projection.rotate(35, 1, 0, 0);
}
// hmd coordinates (meters) from ndc coordinates
@ -205,7 +196,7 @@ namespace s3d
return;
// Update HUD matrix to render on a separate quad
gl_RenderState.mProjectionMatrix = getQuadInWorld();
gl_RenderState.mProjectionMatrix = getHUDProjection();
gl_RenderState.ApplyMatrices();
}
@ -230,19 +221,12 @@ namespace s3d
: leftEyeView(0)
, rightEyeView(1)
, sceneWidth(0), sceneHeight(0)
, crossHairDrawer(new F2DDrawer)
, cached2DDrawer(nullptr)
{
eye_ptrs.Push(&leftEyeView);
eye_ptrs.Push(&rightEyeView);
//Get this from my code
VR_GetScreenRes(&sceneWidth, &sceneHeight);
leftEyeView.initialize();
rightEyeView.initialize();
crossHairDrawer->Clear();
}
void OculusQuestMode::getTracking(ovrTracking2 *_tracking) const
@ -548,14 +532,6 @@ namespace s3d
/* virtual */
OculusQuestMode::~OculusQuestMode()
{
{
leftEyeView.dispose();
rightEyeView.dispose();
}
if (crossHairDrawer != nullptr) {
delete crossHairDrawer;
crossHairDrawer = nullptr;
}
}
} /* namespace s3d */

View file

@ -52,15 +52,13 @@ public:
virtual void AdjustHud() const override;
virtual void AdjustBlend() const override;
void initialize();
void dispose();
bool submitFrame() const;
protected:
mutable uint32_t framebuffer;
int eye;
VSMatrix getQuadInWorld() const;
VSMatrix getHUDProjection() const;
mutable VSMatrix projection;
};

View file

@ -226,15 +226,13 @@ void OpenGLFrameBuffer::Swap()
Finish.Reset();
Finish.Clock();
if (swapbefore) glFinish();
#ifdef USE_GL_HW_BUFFERS
GLRenderer->GPUDropSync();
#endif
#else
if (swapbefore) glFinish();
SwapBuffers();
if (!swapbefore) glFinish();
#endif
gl_RenderState.SetVertexBuffer(NULL);

View file

@ -165,7 +165,7 @@ DFrameBuffer *NoSDLGLVideo::CreateFrameBuffer (int width, int height, bool bgra,
NoSDLBaseFB *fb;
const char *hwBuffers = Args->CheckValue("-hwbuffers");
int buffers = 1;
int buffers = 2;
if (hwBuffers)
{
buffers = atoi(hwBuffers);