Fixed output ptr for parcelReadData(). Pass fence ptr to _gfxDequeueBuffer() in gfxSwapBuffers().

This commit is contained in:
yellows8 2017-12-02 19:24:33 -05:00
parent eec87a6ccf
commit 428d0373a8
2 changed files with 4 additions and 3 deletions

View File

@ -15,6 +15,7 @@ static bool g_gfx_ProducerConnected = 0;
static bool g_gfx_ProducerSlotsRequested[2] = {0, 0}; static bool g_gfx_ProducerSlotsRequested[2] = {0, 0};
static u8 *g_gfxFramebuf; static u8 *g_gfxFramebuf;
static size_t g_gfxFramebufSize; static size_t g_gfxFramebufSize;
static bufferProducerFence g_gfx_DequeueBuffer_fence;
static bool g_gfxDoubleBuf = 1; static bool g_gfxDoubleBuf = 1;
@ -289,7 +290,7 @@ void gfxSwapBuffers() {
rc = _gfxQueueBuffer(g_gfxCurrentProducerBuffer); rc = _gfxQueueBuffer(g_gfxCurrentProducerBuffer);
if (R_SUCCEEDED(rc)) rc = _gfxDequeueBuffer(NULL); if (R_SUCCEEDED(rc)) rc = _gfxDequeueBuffer(&g_gfx_DequeueBuffer_fence);
if (R_FAILED(rc)) fatalSimple(rc); if (R_FAILED(rc)) fatalSimple(rc);
} }

View File

@ -83,7 +83,7 @@ void* parcelWriteData(Parcel *ctx, void* data, size_t data_size)
void* parcelReadData(Parcel *ctx, void* data, size_t data_size) void* parcelReadData(Parcel *ctx, void* data, size_t data_size)
{ {
void* ptr = ctx->payload; void* ptr = &ctx->payload[ctx->pos];
size_t aligned_data_size; size_t aligned_data_size;
if(data_size & BIT(31)) if(data_size & BIT(31))
@ -95,7 +95,7 @@ void* parcelReadData(Parcel *ctx, void* data, size_t data_size)
return NULL; return NULL;
if(data) if(data)
memcpy(data, &ctx->payload[ctx->pos], data_size); memcpy(data, ptr, data_size);
ctx->pos += aligned_data_size; ctx->pos += aligned_data_size;
return ptr; return ptr;