Skip to content

Commit 385460e

Browse files
committed
fix ispc
1 parent 89fa34a commit 385460e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/shady/emit/c/emit_c.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,8 @@ static Module* run_backend_specific_passes(CompilerConfig* config, CEmitterConfi
695695
Module* old_mod = NULL;
696696
Module** pmod = &initial_mod;
697697

698+
// C lacks a nice way to express constants that can be used in type definitions afterwards, so let's just inline them all.
699+
RUN_PASS(eliminate_constants)
698700
if (econfig->dialect == CDialect_ISPC) {
699701
RUN_PASS(lower_workgroups)
700702
}
@@ -704,8 +706,6 @@ static Module* run_backend_specific_passes(CompilerConfig* config, CEmitterConfi
704706
if (config->lower.simt_to_explicit_simd) {
705707
RUN_PASS(simt2d)
706708
}
707-
// C lacks a nice way to express constants that can be used in type definitions afterwards, so let's just inline them all.
708-
RUN_PASS(eliminate_constants)
709709
return *pmod;
710710
}
711711

src/shady/passes/lower_workgroups.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ Module* lower_workgroups(const CompilerConfig* config, Module* src) {
179179
.config = config,
180180
.globals = calloc(sizeof(Node*), PRIMOPS_COUNT),
181181
};
182+
ctx.rewriter.config.rebind_let = true;
182183
rewrite_module(&ctx.rewriter);
183184
free(ctx.globals);
184185
destroy_rewriter(&ctx.rewriter);

0 commit comments

Comments
 (0)