[decoders] change the API to allow more flexability in the future

This commit is contained in:
Geoffrey McRae
2018-05-15 19:19:39 +10:00
parent 332d53e016
commit 3a2d612b41
3 changed files with 25 additions and 27 deletions

View File

@@ -1070,17 +1070,16 @@ static bool draw_frame(struct Inst * this)
this->fences[this->texIndex] = NULL;
}
if (!this->decoder->get_buffer(
this->decoderData,
this->texPixels[this->texIndex],
this->texSize
))
const uint8_t * data = this->decoder->get_buffer(this->decoderData);
if (!data)
{
LG_UNLOCK(this->formatLock);
DEBUG_ERROR("Failed to get the buffer from the decoder");
return false;
}
memcpySSE(this->texPixels[this->texIndex], data, this->texSize);
if (this->amdPinnedMemSupport)
this->fences[this->texIndex] = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);