Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
compiler: do not bind internal variables
  • Loading branch information
Sebastien Bourdeauducq committed Nov 24, 2011
1 parent 93dd584 commit b4193b5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/renderer/compiler.c
Expand Up @@ -275,7 +275,7 @@ static bool init_pfv(struct compiler_sc *sc)
int i;

fpvm_init(&sc->pfv_fragment, 0);
fpvm_set_bind_mode(&sc->pfv_fragment, 1);
fpvm_set_bind_mode(&sc->pfv_fragment, FPVM_BIND_ALL);
for(i=0;i<COMP_PFV_COUNT;i++)
sc->p->pfv_allocation[i] = -1;
fpvm_set_bind_callback(&sc->pfv_fragment, pfv_bind_callback, sc);
Expand Down Expand Up @@ -425,17 +425,18 @@ static bool init_pvv(struct compiler_sc *sc)
int i;

fpvm_init(&sc->pvv_fragment, 1);
fpvm_set_bind_mode(&sc->pvv_fragment, 1);
for(i=0;i<COMP_PVV_COUNT;i++)
sc->p->pvv_allocation[i] = -1;
fpvm_set_bind_callback(&sc->pvv_fragment, pvv_bind_callback, sc);


fpvm_set_bind_mode(&sc->pvv_fragment, FPVM_BIND_SOURCE);
#define A(dest, val) if(!fpvm_assign(&sc->pvv_fragment, dest, val)) goto fail_assign
A("x", "i2f(_Xi)*_hmeshsize");
A("y", "i2f(_Yi)*_vmeshsize");
A("rad", "sqrt(sqr(x-0.5)+sqr(y-0.5))");
/* TODO: generate ang */
#undef A
fpvm_set_bind_mode(&sc->pvv_fragment, FPVM_BIND_ALL);

return true;

Expand All @@ -446,6 +447,8 @@ static bool init_pvv(struct compiler_sc *sc)

static int finalize_pvv(struct compiler_sc *sc)
{
fpvm_set_bind_mode(&sc->pvv_fragment, FPVM_BIND_SOURCE);

#define A(dest, val) if(!fpvm_assign(&sc->pvv_fragment, dest, val)) goto fail_assign

/* Zoom */
Expand Down

0 comments on commit b4193b5

Please sign in to comment.