summaryrefslogtreecommitdiffstats
path: root/src/glsl
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Calcluate Mesa state slots in front-end instead of back-endIan Romanick2011-03-294-3/+94
| | | | | | | | | | | | This should be the last bit of infrastructure changes before generating GLSL IR for assembly shaders. This commit leaves some odd code formatting in ir_to_mesa and brw_fs. This was done to minimize whitespace changes / reindentation in some loops. The following commit will restore formatting sanity. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* glsl: Move _mesa_builtin_uniform_desc from uniforms.c to ir_variable.cppIan Romanick2011-03-291-0/+253
| | | | | | | | This array is going to be used in the main compiler soon. Leaving them uniforms.c caused problems for building the stand-alone compiler. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* glsl: Accept precision qualifiers on sampler types, but only in ES.Kenneth Graunke2011-03-261-2/+9
| | | | | | | | | | GLSL 1.30 states clearly that only float and int are allowed, while the GLSL ES specification's issues section states that sampler types may take precision qualifiers. Fixes compilation failures in 3DMarkMobileES 2.0 and GLBenchmark 2.0. NOTE: This is a candidate for stable release branches.
* glsl: Generate readable unique names at print time.Kenneth Graunke2011-03-252-11/+63
| | | | | | | | | | | | | | | | | | | | Since GLSL IR allows multiple ir_variables to share the same name, we need to generate unique names when printing the IR. Previously, we always used %s@%p, appending the ir_variable's memory address. While this worked, it had two drawbacks: - When there aren't duplicates, the extra "@0x669a3e88" is useless and makes the code harder to read. - Real duplicates were hard to tell apart: channel_expressions@0x6699e3c8 vs. channel_expressions@0x6699ddd8 We now append @2, @3, @4, and so on, but only where necessary to distinguish duplicates. Since we only do this at print time, any performance impact is irrelevant. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Make add_variable, add_uniform, et. al. have similar signaturesIan Romanick2011-03-251-106/+109
| | | | | | While making some other changes in this area I was finding it annoying each of these functions took mostly the same set of parameters in differing orders.
* glsl: Fix off-by-one error setting max_array_access for non-constant indexingIan Romanick2011-03-251-1/+1
| | | | NOTE: This is a candidate for the stable branches.
* glsl: Add array access bounds checking to ir_validateIan Romanick2011-03-251-0/+15
|
* glsl: Add void to _mesa_destroy_shader_compiler() argument list.José Fonseca2011-03-251-2/+2
| | | | | At least MSVC sees a distinction between foo() and foo(void) and warns about it.
* autoconf: don't use CFLAGS for cpp filesTobias Droste2011-03-161-1/+1
| | | | Signed-off-by: Tobias Droste <[email protected]>
* glsl2: Silence unused added variable gcc warning.José Fonseca2011-03-161-0/+1
|
* glsl: add cast to silence signed/unsigned comparison warningBrian Paul2011-03-151-1/+1
|
* glsl: Only allow unsized array assignment in an initializerIan Romanick2011-03-151-14/+17
| | | | | | | | | | | It should have been a tip when the spec says "However, implicitly sized arrays cannot be assigned to. Note, this is a rare case that *initializers and assignments appear to have different semantics*." (empahsis mine) Fixes bugzilla #34367. NOTE: This is a candidate for stable release branches.
* glsl: Skip processing the first function's body in do_dead_functions().Eric Anholt2011-03-151-1/+10
| | | | It can't call anything, so there's no point.
* glsl: Whitespace fixup in opt_dead_functions.cpp.Eric Anholt2011-03-151-106/+108
|
* glsl: Skip processing of expression trees in discard simplification.Eric Anholt2011-03-151-0/+10
| | | | It only cares about "if", "loop", and "discard".
* glsl: Reduce processing of expression trees in do_structure_splitting.Eric Anholt2011-03-151-0/+6
| | | | | | Most of the time we don't have a non-uniform struct variable in the shader, so this cuts the time spent in do_structure_splitting during glean texCombine by about 2/3.
* glsl: Skip processing expression trees in do_if_simplification().Eric Anholt2011-03-151-0/+10
| | | | Reduces time spent in this during glean texCombine by about 2/3.
* glsl: Skip processing expression trees in optimize_redundant_jumps()Eric Anholt2011-03-151-0/+9
| | | | Cuts the time spent in this function during glean texCombine by 2/3.
* scons: copy hash_table.c, symbol_table.c to glsl directoryJose Fonseca2011-03-151-2/+7
| | | | | | | | This fixes an issue where the .obj files wound up in the src/ directory rather than the build/ directory. That prevented combined 32-bit and 64-bit builds from working. Signed-off-by: Brian Paul <[email protected]>
* glsl: Explicitly specify a type when reading/printing ir_texture.Kenneth Graunke2011-03-145-33/+42
| | | | | | This is necessary for GLSL 1.30+ shadow sampling functions, which return a single float rather than splatting the value to a vec4 based on GL_DEPTH_TEXTURE_MODE.
* texture_builtins.py: Add support for 130-style Shadow sampler variants.Kenneth Graunke2011-03-141-1/+53
|
* glsl: Document glsl_type::sampler_dimensionalityChad Versace2011-03-121-1/+1
|
* mesa: Add gl_MESAFogParamsOptimized for our special pre-computed fog params.Eric Anholt2011-03-111-0/+1
| | | | | | | It would be nice if we handled optimized uniform math like this in some generic way, since people often end up doing uniform expressions in shaders, but for now keep this hard-coded like it was in the texenvprogram code.
* mesa: Add a builtin uniform for the ATI_envmap_bumpmap rotation matrix.Eric Anholt2011-03-111-0/+4
| | | | | | | For fixed function fragment processing in GLSL IR, we want to be able to reference this state value. gl_* not explicitly permitted is reserved, so using this variable name internally shouldn't be any issue.
* glsl: silence warning in printf() with a castBrian Paul2011-03-101-1/+1
|
* glsl: Use insert_before for lists instead of open coding itIan Romanick2011-03-081-4/+1
|
* linker: Add imported functions to the linked IRIan Romanick2011-03-081-1/+7
| | | | | | Fixes piglit test glsl-function-chain16 and bugzilla #34203. NOTE: This is a candidate for stable release branches.
* glsl: Add several function / call related validationsIan Romanick2011-03-081-0/+27
| | | | | | | | The signature list in a function must contain only ir_function_signature nodes. The target of an ir_call must be an ir_function_signature. These were added while trying to debug Mesa bugzilla #34203.
* glsl: Function signatures cannot have NULL return typeIan Romanick2011-03-082-1/+7
| | | | | The return type can be void, and this is the case where a `_ret_val' variable should not be declared.
* glsl: Process redeclarations before initializersIan Romanick2011-03-041-43/+44
| | | | | | | | | | | | If an array redeclaration includes an initializer, the initializer would previously be dropped on the floor. Instead, directly apply the initializer to the correct ir_variable instance and append the generated instructions. Fixes bugzilla #34374 and piglit tests glsl-{vs,fs}-array-redeclaration. NOTE: This is a candidate for stable release branches. 0292ffb8 and 8e6cb9fe are also necessary.
* glsl: Refactor AST-to-HIR code handling variable initializersIan Romanick2011-03-041-108/+125
|
* glsl: Refactor AST-to-HIR code handling variable redeclarationsIan Romanick2011-03-041-113/+133
|
* scons: Unbreak mingw cross compilation.José Fonseca2011-03-041-7/+12
|
* scons: Get glsl2 and glcpp programs building correctly.José Fonseca2011-03-041-20/+21
|
* glsl/glcpp: Use stdio.h instead of unistd.h.José Fonseca2011-03-041-25/+15
|
* glsl: Define YY_NO_UNISTD_H on MSVC.José Fonseca2011-03-042-0/+8
|
* glcpp: Remove trailing contexts from #if rules.Kenneth Graunke2011-03-031-6/+6
| | | | These are now unnecessary.
* glcpp: Rework lexer to use a SKIP state rather than REJECT.Kenneth Graunke2011-03-031-21/+16
| | | | | | | | | | | | | | | | | | | Previously, the rule deleted by this commit was matched every single time (being the longest match). If not skipping, it used REJECT to continue on to the actual correct rule. The flex manual advises against using REJECT where possible, as it is one of the most expensive lexer features. So using it on every match seems undesirable. Perhaps more importantly, it made it necessary for the #if directive rules to contain a look-ahead pattern to make them as long as the (now deleted) "skip the whole line" rule. This patch introduces an exclusive start state, SKIP, to avoid REJECTs. Each time the lexer is called, the code at the top of the rules section will run, implicitly switching the state to the correct one. Fixes piglit tests 16384-consecutive-chars.frag and 16385-consecutive-chars.frag.
* glcpp/tests: Update 063-comments.c.expected to match output.Kenneth Graunke2011-03-031-0/+7
| | | | | | | The expected result has been out of sync with what glcpp produces for some time; glcpp's actual result seems to be correct and is very close to GCC's cpp. Updating this will make it easier to catch regressions in upcoming commits.
* scons: More tweaks to fix MinGW build.José Fonseca2011-03-031-5/+16
|
* scons: Ensure generated headers are in the include path.José Fonseca2011-03-031-0/+3
|
* glsl: Remove unused glcpp/Makefile.am.Kenneth Graunke2011-03-021-44/+0
| | | | This is a remnant of when glsl2 lived in its own repository.
* glsl: Remove 'tests' subfolder.Kenneth Graunke2011-03-0270-631/+0
| | | | These have long since moved to piglit and aren't useful to have here.
* scons: Use Flex and Bison to generate lexer/parser files.Kenneth Graunke2011-03-011-4/+15
| | | | | This gets it building again here; I'll leave it up to the SCons maintainers to make further improvements.
* glsl: Rename .lpp to .ll and .ypp to .yy.Kenneth Graunke2011-03-013-2/+2
| | | | | SCons has built-in support for .ll and .yy, but not .lpp and .ypp. Since there's no real benefit to using the old names, change them.
* Add generated parser / lexer files to gitignore listsIan Romanick2011-03-012-0/+6
|
* glcpp: Remove files generated by flex and bison from GITIan Romanick2011-03-013-7003/+0
|
* glsl: Remove files generated by flex and bison from GITIan Romanick2011-03-013-9482/+0
|
* glsl: Enable GL_OES_texture_3D extension for ES2.Kenneth Graunke2011-02-287-2/+39
|
* glsl: Use reralloc instead of plain realloc.Kenneth Graunke2011-02-281-5/+3
| | | | | | Plugs a memory leak when compiling shaders with user defined structures. NOTE: This is a candidate for the 7.9 and 7.10 branches.