pvr: reset nextContext in Reset(). Use tactx_Alloc for direct fb render

Fix crash with multipass renders
Issue #634
This commit is contained in:
Flyinghead 2022-05-16 13:04:38 +02:00
parent 430256266f
commit 58d1f7cee1
3 changed files with 4 additions and 3 deletions

View File

@ -268,8 +268,7 @@ void rend_vblank()
if (!render_called && fb_dirty && FB_R_CTRL.fb_enable)
{
DEBUG_LOG(PVR, "Direct framebuffer write detected");
TA_context *ctx = new TA_context();
ctx->Alloc();
TA_context *ctx = tactx_Alloc();
ctx->rend.isRenderFramebuffer = true;
rend_start_render(ctx);
fb_dirty = false;

View File

@ -106,7 +106,7 @@ static std::mutex mtx_pool;
static std::vector<TA_context*> ctx_pool;
static std::vector<TA_context*> ctx_list;
static TA_context *tactx_Alloc()
TA_context *tactx_Alloc()
{
TA_context *ctx = nullptr;

View File

@ -348,6 +348,7 @@ struct TA_context
{
verify(tad.End() - tad.thd_root <= TA_DATA_SIZE);
tad.Clear();
nextContext = nullptr;
rend_inuse.lock();
rend.Clear();
rend.proc_end = rend.proc_start = tad.thd_root;
@ -377,6 +378,7 @@ extern tad_context ta_tad;
TA_context* tactx_Pop(u32 addr);
void tactx_Term();
TA_context *tactx_Alloc();
/*
Ta Context