Vita: Improved frame drawing speed

This commit is contained in:
Vicki Pfau 2019-03-25 21:39:57 -07:00
parent 782742a731
commit 029d0e169b
3 changed files with 5 additions and 2 deletions

View File

@ -37,6 +37,7 @@ Misc:
- Qt: Improve camera initialization
- Qt: Support switching webcams
- Core: Add keysRead callback
- Vita: Improved frame drawing speed
0.7.1: (2019-02-24)
Bugfixes:

View File

@ -36,7 +36,6 @@ static void _drawStart(void) {
static void _drawEnd(void) {
vita2d_end_drawing();
vita2d_wait_rendering_done();
vita2d_swap_buffers();
}

View File

@ -324,7 +324,7 @@ void mPSP2Setup(struct mGUIRunner* runner) {
tex = vita2d_create_empty_texture_format(256, toPow2(height), SCE_GXM_TEXTURE_FORMAT_X8U8U8U8_1BGR);
screenshot = vita2d_create_empty_texture_format(256, toPow2(height), SCE_GXM_TEXTURE_FORMAT_X8U8U8U8_1BGR);
outputBuffer = vita2d_texture_get_datap(tex);
outputBuffer = anonymousMemoryMap(256 * toPow2(height) * 4);
runner->core->setVideoBuffer(runner->core, outputBuffer, 256);
runner->core->setAudioBufferSize(runner->core, PSP2_SAMPLES);
@ -458,6 +458,7 @@ void mPSP2Teardown(struct mGUIRunner* runner) {
CircleBufferDeinit(&rumble.history);
vita2d_free_texture(tex);
vita2d_free_texture(screenshot);
mappedMemoryFree(outputBuffer, 256 * 256 * 4);
frameLimiter = true;
}
@ -525,6 +526,8 @@ void _drawTex(vita2d_texture* t, unsigned width, unsigned height, bool faded) {
void mPSP2Draw(struct mGUIRunner* runner, bool faded) {
unsigned width, height;
runner->core->desiredVideoDimensions(runner->core, &width, &height);
void* texpixels = vita2d_texture_get_datap(tex);
memcpy(texpixels, outputBuffer, 256 * height * 4);
_drawTex(tex, width, height, faded);
}