summaryrefslogtreecommitdiff
path: root/main.cpp
AgeCommit message (Collapse)AuthorFilesLines
2010-06-23glsl2 main: Switch from realloc to talloc_realloc to construct program source.HEADmasterCarl Worth1-2/+2
This closes 1 leak in the glsl-orangebook-ch06-bump.frag test leaving 4 to go, (all of which are inside hash_table.c).
2010-06-23main: Close memory leak of shader string from load_text_file.Carl Worth1-4/+5
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.
2010-06-23glsl_symbol_table: Add new talloc-based new()Carl Worth1-5/+1
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)
2010-06-23glsl2 main: Use talloc to allocate _mesa_glsl_parse_stateCarl Worth1-27/+30
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.
2010-06-23glsl2 main: Use talloc to allocate whole_program struct.Carl Worth1-12/+15
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.
2010-06-22ir_validate: New pass for checking our invariants.Eric Anholt1-0/+4
2010-06-21glcpp: Print to the main compiler's infolog, not stdout.Kenneth Graunke1-1/+1
2010-06-21Use yy_scan_string and stop caring about shader->SourceLen.Kenneth Graunke1-2/+2
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.
2010-06-21Make the main compiler call the preprocessor.Kenneth Graunke1-3/+11
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.
2010-06-21Complain and exit if the given shader file doesn't exist.Kenneth Graunke1-0/+4
2010-06-19Print out the info log if compilation fails.Kenneth Graunke1-0/+1
2010-06-19Initialize the shader info logIan Romanick1-0/+7
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2010-06-19Make shader a talloc context.Kenneth Graunke1-2/+6
2010-06-19Rename prog to shader. Less confusing.Kenneth Graunke1-27/+27
2010-06-17Don't link shaders by defaultIan Romanick1-1/+3
Add a command line option to trigger linking. This "fixes" all the failing test cases. Oops.
2010-06-17linker: Initial bits of the linkerIan Romanick1-0/+5
No linking is done yet, but some of the semantic checking is done.
2010-06-17Use glsl_program instead of an open-coded vector of shadersIan Romanick1-8/+8
2010-06-17Change glsl_program to glsl_shaderIan Romanick1-5/+5
2010-06-17Compile multiple shaders listed on the command lineIan Romanick1-18/+36
2010-06-17Extract compilation to a separate routineIan Romanick1-47/+63
Pull all of the code that actually compiles shaders into a separate function. Use a glsl_program to track data about the compiled shader.
2010-06-15Printing LIR is optionalIan Romanick1-1/+3
2010-06-15Printing the AST is optionalIan Romanick1-8/+24
2010-06-15Minor bits of code rearrangingIan Romanick1-7/+7
2010-06-15Infer shader type from suffix on filenameIan Romanick1-16/+21
2010-06-14Remove ability to read "IR shaders" from stand-alone compilerIan Romanick1-25/+11
2010-06-14Move stand-alone compiler main routine to main.cppIan Romanick1-0/+175