mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +02:00
Fixed output ptr for parcelReadData(). Pass fence ptr to _gfxDequeueBuffer() in gfxSwapBuffers().
This commit is contained in:
parent
eec87a6ccf
commit
428d0373a8
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user