Navigation Menu

Skip to content

Commit

Permalink
Run preshaders during MOJOSHADER_glProgramReady().
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed May 31, 2011
1 parent 43fa79c commit 5de66c0
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion mojoshader_opengl.c
Expand Up @@ -1826,9 +1826,32 @@ void MOJOSHADER_glProgramReady(void)
GLfloat *dstf = program->vs_uniforms_float4;
GLint *dsti = program->vs_uniforms_int4;
GLint *dstb = program->vs_uniforms_bool;
const MOJOSHADER_preshader *preshader = NULL;
int ran_preshader = 0;
uint32 i;

program->generation = ctx->generation;
if (program->vertex)
{
preshader = program->vertex->parseData->preshader;
if (preshader)
{
MOJOSHADER_runPreshader(preshader, ctx->vs_reg_file_f);
ran_preshader = 1;
} // if
} // if

if (program->fragment)
{
preshader = program->fragment->parseData->preshader;
if (preshader)
{
MOJOSHADER_runPreshader(preshader, ctx->ps_reg_file_f);
ran_preshader = 1;
} // if
} // if

if (ran_preshader)
ctx->generation++;

for (i = 0; i < count; i++)
{
Expand Down Expand Up @@ -1892,6 +1915,8 @@ void MOJOSHADER_glProgramReady(void)
// !!! FIXME: set constants that overlap the array.
} // for

program->generation = ctx->generation;

ctx->profilePushUniforms();
} // if
} // MOJOSHADER_glProgramReady
Expand Down

0 comments on commit 5de66c0

Please sign in to comment.