[Mesa-dev] proper way to regenerate built-in functions?
kenneth at whitecape.org
Tue Aug 31 18:54:53 PDT 2010
On Tuesday 31 August 2010 18:24:53 Brian Paul wrote:
> I just fixed a bug in the atan() built-in function. After editing the
> src/glsl/builtins/ir/atan file, I found that the only way to reliably
> rebuild everything was:
> pushd src/glsl/; make clean; make builtins; make; popd; make
This is correct. You can probably omit 'make clean', but otherwise, yes,
that's what I do. Then commit the updated builtin_function.cpp.
> If I just did:
> pushd src/glsl/; make; popd; make
> I'd get runtime errors about bad IR code.
Ideally this would work, but I haven't done the Makefile trickery to make it
happen automatically. Whenever any file in builtins/ changes,
builtin_function.cpp needs to be regenerated...but that process uses
glsl_compiler. So first, 'make builtins' builds a bare-bones compiler using a
dummy copy of builtin_function.cpp (with no built-ins), then uses that
compiler to build the proper source (with all the functions). Once it's
built, it goes ahead and rebuilds the compiler against the newly generated
I'm sure there's a way to set up the Makefile dependencies to do the proper
bootstrapping, but I haven't gotten around to it. Patches are welcome...
> What's the proper way to regenerate everything after modifying a file
> like ir/atan?
More information about the mesa-dev