3DS: Minor fixes for GPU issues, detect usable cores better

This commit is contained in:
Vicki Pfau 2017-08-29 21:33:26 -07:00
parent c0f0d54a52
commit ca3a7f1895
1 changed files with 11 additions and 5 deletions

View File

@ -214,7 +214,9 @@ static void _postAudioBuffer(struct mAVStream* stream, blip_t* left, blip_t* rig
static void _drawStart(void) { static void _drawStart(void) {
C3D_FrameBegin(frameLimiter ? 0 : C3D_FRAME_NONBLOCK); 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) { static void _drawEnd(void) {
@ -257,9 +259,8 @@ static void _guiFinish(void) {
} }
static void _setup(struct mGUIRunner* runner) { static void _setup(struct mGUIRunner* runner) {
bool isNew3DS = false; uint8_t mask;
APT_CheckNew3DS(&isNew3DS); if (R_SUCCEEDED(svcGetProcessAffinityMask(&mask, CUR_PROCESS_HANDLE, 4)) && mask >= 4) {
if (isNew3DS && !envIsHomebrew()) {
mCoreConfigSetDefaultIntValue(&runner->config, "threadedVideo", 1); mCoreConfigSetDefaultIntValue(&runner->config, "threadedVideo", 1);
mCoreLoadForeignConfig(runner->core, &runner->config); mCoreLoadForeignConfig(runner->core, &runner->config);
} }
@ -390,6 +391,11 @@ static void _gameUnloaded(struct mGUIRunner* runner) {
} }
} }
static void _storeCounter(struct mGUIRunner* runner) {
UNUSED(runner);
frameCounter = C3D_FrameCounter(0);
}
static void _drawTex(struct mCore* core, bool faded) { static void _drawTex(struct mCore* core, bool faded) {
unsigned screen_w, screen_h; unsigned screen_w, screen_h;
switch (screenMode) { switch (screenMode) {
@ -848,7 +854,7 @@ int main() {
.teardown = 0, .teardown = 0,
.gameLoaded = _gameLoaded, .gameLoaded = _gameLoaded,
.gameUnloaded = _gameUnloaded, .gameUnloaded = _gameUnloaded,
.prepareForFrame = 0, .prepareForFrame = _storeCounter,
.drawFrame = _drawFrame, .drawFrame = _drawFrame,
.drawScreenshot = _drawScreenshot, .drawScreenshot = _drawScreenshot,
.paused = _gameUnloaded, .paused = _gameUnloaded,