Make sure framebuffer is flushed/reinitialized before changing program

This commit is contained in:
fincs 2018-05-22 21:23:17 +02:00
parent 8d8979947e
commit ebf41b6436

View File

@ -168,12 +168,6 @@ void C3Di_UpdateContext(void)
int i;
C3D_Context* ctx = C3Di_GetContext();
if (ctx->flags & C3DiF_Program)
{
shaderProgramConfigure(ctx->program, (ctx->flags & C3DiF_VshCode) != 0, (ctx->flags & C3DiF_GshCode) != 0);
ctx->flags &= ~(C3DiF_Program | C3DiF_VshCode | C3DiF_GshCode);
}
if (ctx->flags & C3DiF_FrameBuf)
{
ctx->flags &= ~C3DiF_FrameBuf;
@ -199,6 +193,12 @@ void C3Di_UpdateContext(void)
GPUCMD_AddIncrementalWrites(GPUREG_SCISSORTEST_MODE, ctx->scissor, 3);
}
if (ctx->flags & C3DiF_Program)
{
shaderProgramConfigure(ctx->program, (ctx->flags & C3DiF_VshCode) != 0, (ctx->flags & C3DiF_GshCode) != 0);
ctx->flags &= ~(C3DiF_Program | C3DiF_VshCode | C3DiF_GshCode);
}
if (ctx->flags & C3DiF_AttrInfo)
{
ctx->flags &= ~C3DiF_AttrInfo;