Age | Commit message (Collapse) | Author |
|
This closes 1 leak in the glsl-orangebook-ch06-bump.frag test leaving
4 to go, (all of which are inside hash_table.c).
|
|
Could have just added a call to free() to main, but since we're using
talloc everywhere else, we might as well just use it here too. So pass
a new 'ctx' argument to load_text_file.
This removes a single memory leak from all invocations of the
standalone glsl compiler.
|
|
We take advantage of overloading of the new operator (with an
additional parameter!) to make this look as "C++ like" as possible.
This closes 507 memory leaks when compiling glsl-orangebook-ch06-bump.frag
when measured with:
valgrind ./glsl glsl-orangebook-ch06-bump.frag
as seen here:
total heap usage: 55,623 allocs, 14,389 frees
(was 13,882 frees before)
|
|
This is a short-lived object. It exists only for the duration of the
compile_shader() function, (as opposed to the shader and whole_program
which live longer).
The state is created with the same talloc parent as the shader, so
that other allocation can be done with talloc_parent(state) as the
owner in order to attach to a long-lived object.
|
|
This way, whole_program can be our top-level talloc context object,
allowing us to free the lot with a single talloc_free in the end.
|
|
|
|
|
|
We had to call strlen on the preprocessed source, which seemed a bit
pointless; also, we updated shader->SourceLen but not shader->Source,
which was even more confusing. Just leave both untouched.
|
|
By using a single function, the main compiler doesn't need to include
glcpp.h, which currently has a lot of details about the preprocessor
internals. In particular, this prevents the two yacc grammars from
seeing each other, which would be rather messy to sort out.
|
|
|
|
|
|
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
|
|
|
|
|
|
Add a command line option to trigger linking. This "fixes" all the
failing test cases. Oops.
|
|
No linking is done yet, but some of the semantic checking is done.
|
|
|
|
|
|
|
|
Pull all of the code that actually compiles shaders into a separate
function. Use a glsl_program to track data about the compiled shader.
|
|
|
|
|
|
|
|
|
|
|
|
|