From ebf41b6436a934ecaeae34b37ec1bcdd36845fa4 Mon Sep 17 00:00:00 2001 From: fincs Date: Tue, 22 May 2018 21:23:17 +0200 Subject: [PATCH] Make sure framebuffer is flushed/reinitialized before changing program --- source/base.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/base.c b/source/base.c index b606cb1..061c8d9 100644 --- a/source/base.c +++ b/source/base.c @@ -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;