Skip to content

Commit 3c41298

Browse files
committed
effects: Make the preshader VM a static function
1 parent 66e0f6b commit 3c41298

2 files changed

Lines changed: 6 additions & 12 deletions

File tree

mojoshader_effects.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
#include <math.h>
1717
#endif /* MOJOSHADER_USE_SDL_STDLIB */
1818

19-
void MOJOSHADER_runPreshader(const MOJOSHADER_preshader *preshader,
20-
float *outregs)
19+
static void run_preshader(const MOJOSHADER_preshader *preshader,
20+
float *outregs)
2121
{
2222
const float *inregs = preshader->registers;
2323

@@ -208,7 +208,7 @@ void MOJOSHADER_runPreshader(const MOJOSHADER_preshader *preshader,
208208
outregs[operand->index + i] = (float) dst[i];
209209
} // else
210210
} // for
211-
} // MOJOSHADER_runPreshader
211+
} // run_preshader
212212

213213
static MOJOSHADER_effect MOJOSHADER_out_of_mem_effect = {
214214
1, &MOJOSHADER_out_of_mem_error, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
@@ -1878,7 +1878,7 @@ void MOJOSHADER_effectCommitChanges(MOJOSHADER_effect *effect)
18781878
param->valuesI + (j << 2), \
18791879
param->type.columns << 2); \
18801880
} while (++i < raw->preshader->symbol_count); \
1881-
MOJOSHADER_runPreshader(raw->preshader, &selector); \
1881+
run_preshader(raw->preshader, &selector); \
18821882
shader_object = effect->params[raw->params[0]].value.valuesI[(int) selector]; \
18831883
raw = &effect->objects[shader_object].shader; \
18841884
gls = raw->shader; \
@@ -1906,7 +1906,7 @@ void MOJOSHADER_effectCommitChanges(MOJOSHADER_effect *effect)
19061906

19071907
/* This is where parameters are copied into the constant buffers.
19081908
* If you're looking for where things slow down immensely, look at
1909-
* the copy_parameter_data() and MOJOSHADER_runPreshader() functions.
1909+
* the copy_parameter_data() and run_preshader() functions.
19101910
* -flibit
19111911
*/
19121912
// !!! FIXME: We're just copying everything every time. Blech. -flibit
@@ -1930,7 +1930,7 @@ void MOJOSHADER_effectCommitChanges(MOJOSHADER_effect *effect)
19301930
pd->preshader->registers, \
19311931
NULL, \
19321932
NULL); \
1933-
MOJOSHADER_runPreshader(pd->preshader, stage##_reg_file_f); \
1933+
run_preshader(pd->preshader, stage##_reg_file_f); \
19341934
} \
19351935
}
19361936
effect->ctx.mapUniformBufferMemory(effect->ctx.shaderContext,

mojoshader_internal.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,6 @@ typedef Uint64 uint64;
234234
#define MATCH_MICROSOFT_PREPROCESSOR 1
235235
#endif
236236

237-
// Other stuff you can disable...
238-
239-
#ifdef MOJOSHADER_EFFECT_SUPPORT
240-
void MOJOSHADER_runPreshader(const MOJOSHADER_preshader*, float*);
241-
#endif
242-
243237

244238
// Get basic wankery out of the way here...
245239

0 commit comments

Comments
 (0)