Skip to content

Commit

Permalink
effects: When cloning, do not copy pass state
Browse files Browse the repository at this point in the history
  • Loading branch information
flibitijibibo committed Dec 28, 2024
1 parent 0379642 commit ba3ab52
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mojoshader_effects.c
Original file line number Diff line number Diff line change
Expand Up @@ -1529,16 +1529,17 @@ MOJOSHADER_effect *MOJOSHADER_cloneEffect(const MOJOSHADER_effect *effect)
m, d);
} // for

/* Copy the current technique/pass */
/* Copy the current technique, but do NOT copy the pass, pass >= 0 just
* means that the effect we're cloning is currently active
*/
for (i = 0; i < effect->technique_count; i++)
if (&effect->techniques[i] == effect->current_technique)
{
clone->current_technique = &clone->techniques[i];
break;
} // if
assert(clone->current_technique != NULL);
clone->current_pass = effect->current_pass;
assert(clone->current_pass == -1);
clone->current_pass = -1;

/* Copy object table */
siz = sizeof (MOJOSHADER_effectObject) * effect->object_count;
Expand Down

0 comments on commit ba3ab52

Please sign in to comment.