Skip to content

Commit ebf41b6

Browse files
committed
Make sure framebuffer is flushed/reinitialized before changing program
1 parent 8d89799 commit ebf41b6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

source/base.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,6 @@ void C3Di_UpdateContext(void)
168168
int i;
169169
C3D_Context* ctx = C3Di_GetContext();
170170

171-
if (ctx->flags & C3DiF_Program)
172-
{
173-
shaderProgramConfigure(ctx->program, (ctx->flags & C3DiF_VshCode) != 0, (ctx->flags & C3DiF_GshCode) != 0);
174-
ctx->flags &= ~(C3DiF_Program | C3DiF_VshCode | C3DiF_GshCode);
175-
}
176-
177171
if (ctx->flags & C3DiF_FrameBuf)
178172
{
179173
ctx->flags &= ~C3DiF_FrameBuf;
@@ -199,6 +193,12 @@ void C3Di_UpdateContext(void)
199193
GPUCMD_AddIncrementalWrites(GPUREG_SCISSORTEST_MODE, ctx->scissor, 3);
200194
}
201195

196+
if (ctx->flags & C3DiF_Program)
197+
{
198+
shaderProgramConfigure(ctx->program, (ctx->flags & C3DiF_VshCode) != 0, (ctx->flags & C3DiF_GshCode) != 0);
199+
ctx->flags &= ~(C3DiF_Program | C3DiF_VshCode | C3DiF_GshCode);
200+
}
201+
202202
if (ctx->flags & C3DiF_AttrInfo)
203203
{
204204
ctx->flags &= ~C3DiF_AttrInfo;

0 commit comments

Comments
 (0)