3DS: Minor fixes for GPU issues, detect usable cores better
Vicki Pfau vi@endrift.com
Tue, 29 Aug 2017 21:33:26 -0700
1 files changed,
11 insertions(+),
5 deletions(-)
jump to
M
src/platform/3ds/main.c
→
src/platform/3ds/main.c
@@ -227,7 +227,9 @@ static void _postAudioBuffer(struct mAVStream* stream, blip_t* left, blip_t* right);
static void _drawStart(void) { C3D_FrameBegin(frameLimiter ? 0 : C3D_FRAME_NONBLOCK); - frameCounter = C3D_FrameCounter(0); + // Mark both buffers used to make sure they get cleared + C3D_FrameDrawOn(topScreen[doubleBuffer]); + C3D_FrameDrawOn(bottomScreen[doubleBuffer]); } static void _drawEnd(void) {@@ -284,9 +286,8 @@ CAMU_SetAutoWhiteBalance(imageSource->cam, false);
} static void _setup(struct mGUIRunner* runner) { - bool isNew3DS = false; - APT_CheckNew3DS(&isNew3DS); - if (isNew3DS && !envIsHomebrew()) { + uint8_t mask; + if (R_SUCCEEDED(svcGetProcessAffinityMask(&mask, CUR_PROCESS_HANDLE, 4)) && mask >= 4) { mCoreConfigSetDefaultIntValue(&runner->config, "threadedVideo", 1); mCoreLoadForeignConfig(runner->core, &runner->config); }@@ -439,6 +440,11 @@ #endif
default: break; } +} + +static void _storeCounter(struct mGUIRunner* runner) { + UNUSED(runner); + frameCounter = C3D_FrameCounter(0); } static void _drawTex(struct mCore* core, bool faded) {@@ -989,7 +995,7 @@ .setup = _setup,
.teardown = 0, .gameLoaded = _gameLoaded, .gameUnloaded = _gameUnloaded, - .prepareForFrame = 0, + .prepareForFrame = _storeCounter, .drawFrame = _drawFrame, .drawScreenshot = _drawScreenshot, .paused = _gameUnloaded,