Commit Graph

880 Commits

Author SHA1 Message Date
Kenneth Graunke 75393ee16b Add forgotten autogenerated EXT_texture_array_fs folder. 2010-06-09 16:46:09 -07:00
Kenneth Graunke af05703826 Implement 1.30 int/uint variants of min/max/clamp. 2010-06-09 16:14:45 -07:00
Kenneth Graunke c3bf0cbefc texture_builtins.py: The unsigned integer type is "uint", not "unsigned"
This doesn't actually affect anything yet, but is good to fix anyway.
2010-06-09 16:11:36 -07:00
Kenneth Graunke c9aabc866f Implement 1.30 hyperbolic trig builtins (sinh, cosh, tanh). 2010-06-09 16:08:36 -07:00
Kenneth Graunke 1d0e07c420 Implement 1.20 'transpose' builtin. 2010-06-09 15:56:46 -07:00
Kenneth Graunke 43ff6fc4ae Implement 1.20 'outerProduct' builtin. 2010-06-09 15:47:34 -07:00
Kenneth Graunke 0c8ffadc8c Implement matrixCompMult builtin - the last of the 110 builtins. 2010-06-09 15:35:54 -07:00
Kenneth Graunke d6a32d4b54 ir_constant_visitor: Add support for dFdx and dFdy operations.
If the argument is a constant expression...it's not changing per pixel,
so the result is simply 0.
2010-06-09 15:23:40 -07:00
Kenneth Graunke b843c7a20c Implement dFdx, dFdy, and fwidth via new expression opcodes. 2010-06-09 14:44:39 -07:00
Kenneth Graunke cbd881da3f Implement 'refract' builtin. 2010-06-09 14:44:39 -07:00
Kenneth Graunke 3ffedf1249 Fix some typing issues in asin.
CorrectFunction.vert now passes.
2010-06-09 14:15:04 -07:00
Kenneth Graunke c476ba8fe2 Add a completely bogus implementation of the noise[1234] builtins.
idr suggested this.  Eventually we will need a real one.
2010-06-09 14:07:35 -07:00
Kenneth Graunke 855fcb22c1 Implement 'acos' builtin.
This is tacked on to the end of the 'asin' file because acos calls asin,
whech means asin needs to be defined first.  Alphabetical order fail.
2010-06-09 13:52:32 -07:00
Carl Worth 2fb30a2e49 Merge remote branch 'kwg/fixes' 2010-06-09 13:29:37 -07:00
Kenneth Graunke 539f29323f Implement 'faceforward' builtin. 2010-06-09 13:27:16 -07:00
Kenneth Graunke 29b22287fe Implement 'distance' builtin. 2010-06-09 13:17:00 -07:00
Kenneth Graunke cdf1726ffd Add remaining signatures for 'clamp' builtin. 2010-06-09 13:10:00 -07:00
Kenneth Graunke 76796ed66f Add remaining signatures for 'max' builtin. 2010-06-09 13:05:40 -07:00
Kenneth Graunke 47d44c877e Add remaining signatures for 'min' builtin. 2010-06-09 13:04:16 -07:00
Kenneth Graunke 2438f64e63 Add remaining signatures for 'mod' builtin. 2010-06-09 13:04:03 -07:00
Kenneth Graunke b97efa5db5 ir_function_cloning_visitor: Add support for ir_texture. 2010-06-09 11:14:58 -07:00
Kenneth Graunke 8331d48948 Don't call _mesa_glsl_initialize_types for every builtin function.
This was clearly wrong; types are now only initialized once.
2010-06-09 11:14:58 -07:00
Kenneth Graunke 57503a22d7 Only initialize types after #extension directives have been processed.
Since _mesa_glsl_initialize_types add types for various extensions, we
can't call it until after processing "#extension foo : disable" lines.

Fixes tex_rect_02.frag.
2010-06-09 11:14:58 -07:00
Kenneth Graunke 4b0029a97d Commit output of texture_builtins.py and refresh builtin_function.cpp. 2010-06-09 11:14:58 -07:00
Kenneth Graunke 5e65c1ccae texture_builtins.py: Support the EXT_texture_array extension. 2010-06-09 11:14:58 -07:00
Kenneth Graunke 0d80f71867 Add EXT_texture_array support. 2010-06-09 11:14:58 -07:00
Kenneth Graunke cc249f79e7 generate_builtins.pl: Support stage-specific builtins even for extensions. 2010-06-09 11:14:58 -07:00
Kenneth Graunke c34a624c9f texture_builtins.py: Fixes for Array variants.
The array layer is now included as part of the texture coordinate.
2010-06-09 11:14:58 -07:00
Kenneth Graunke 538da12092 texture_builtins.py: Add support for 130 Proj variants. 2010-06-09 11:14:58 -07:00
Kenneth Graunke b3bcea7db6 Add a python script to generate texture builtins. 2010-06-09 11:14:58 -07:00
Kenneth Graunke 9aefbe838c generate_builtins.pl: Support directiories for each extension. 2010-06-09 11:14:58 -07:00
Kenneth Graunke 9d1fc46f0c generate_builtins.pl: Support _fs directories as well as _vs. 2010-06-09 11:14:57 -07:00
Kenneth Graunke 56d3f6ad78 Set the type of ir_texture properly; infer it from the sampler type. 2010-06-09 11:14:57 -07:00
Kenneth Graunke dd5b4a544b ir_reader: Add support for reading ir_texture. 2010-06-09 11:14:57 -07:00
Kenneth Graunke 3c7934bfaa ir_reader: Refactor reading of dereferences for later reuse. 2010-06-09 11:14:57 -07:00
Kenneth Graunke 26d74cd1d1 Add stub visitor support for ir_texture. 2010-06-09 11:14:57 -07:00
Kenneth Graunke be298063b5 ir_print_visitor: Add support for ir_texture. 2010-06-09 11:14:57 -07:00
Kenneth Graunke c30f6e5dea Add mappings between ir_texture_opcode and strings. 2010-06-09 11:14:57 -07:00
Ian Romanick 81377c012c Define IR instruction for texture look-ups 2010-06-09 11:14:57 -07:00
Ian Romanick 2f8b0435b0 Use array delete operator to delete an array
This was detected by valgrind.  I think GCC still does the right
thing, but the C++ spec allows the compiler to do something
stupid... like crash or only delete the first entry in the array.
2010-06-09 11:00:23 -07:00
Ian Romanick cfb3536f10 Bump GL_MAX_TEXTURE_COORDS from 2 to 4
Every platform that supports GLSL sets GL_MAX_TEXTURE_COORDS to at
least 4, so hard-code 4 for now.

This causes the following tests to pass:

    glslparsertest/glsl2/norsetto-bumptbn_sh_fp.vert
    glslparsertest/glsl2/xreal-lighting-d-omni.vert
    glslparsertest/glsl2/xreal-lighting-db-omni.vert
    glslparsertest/glsl2/xreal-lighting-dbs-omni.vert
2010-06-07 19:10:33 -07:00
Ian Romanick 19eb5896c4 Only allow global precision qualifier for int and float
This causes the following tests to pass:

    glslparsertest/glsl2/precision-03.vert
2010-06-07 19:03:03 -07:00
Ian Romanick 9bcb67bdc4 Fix parsing of precision qualifiers
This causes the following tests to pass:

     glslparsertest/glsl2/precision-02.vert
     glslparsertest/glsl2/precision-04.vert
     glslparsertest/glsl2/precision-06.vert

This causes the following test to fail.  This shader was previously
failing to compile, but it was failing for the wrong reasons.

     glslparsertest/glsl2/precision-03.vert
2010-06-07 18:56:16 -07:00
Ian Romanick 15d162d7b1 Don't process empty shaders
Some valid shaders, such as 'precision highp float;', evaluate to
empty sets of instructions.  This causes some of the optimization
stages to enter infinite loops.  Instead, don't bother processing the
empty ones.
2010-06-07 18:53:06 -07:00
Ian Romanick 6cd2a5cc4b Generate an error on empty declaration lists
This causes an error for code such as 'float;'
2010-06-07 18:49:48 -07:00
Kenneth Graunke 2ab0b13dd9 Disallow defining macros whose names start with "__" or "GL_".
The GLSL specification reserves these for future use.
2010-06-04 14:53:58 -07:00
Kenneth Graunke 603b8fc4b2 Check variable mode when comparing qualifier lists.
Fixes function-05.vert.
2010-06-04 12:57:20 -07:00
Carl Worth 5ae88af988 test suite: Add expected output for every test.
Rather than using the (munged) output of "gcc -E" we now capture
precisely the output we expect from every test case. This allows us to
stay immune from strange output from gcc (unpredictable whitespace
output---aprticularly with different gcc versions).

This will also allow us to write tests that capture expected error
messages from the preprocessor as well.
2010-06-02 15:59:45 -07:00
Carl Worth 14c98a5644 Restore error message for a macro with unbalanced parentheses.
We had to remove this earlier because our recursive function calls
caused the same nodes to be examined for expansion more than once.
And in the test suite, one node would be examined before it had
its closing parenthesis and then again later after the parenthesis
was added.

So we removed this error message to allow the test case to pass.
Now that we've removed the unnecessary recursive function call
we can catch this error case and report it as desired.
2010-06-02 15:49:54 -07:00
Carl Worth 22b3aced03 Eliminate some recursion from children of _expand_token_list
Previously, both _expand_node and _expand_function would always make
mutually recursive calls into _expand_token_list. This was unnecessary
since these functions can simply return unexpanded results, after which
the outer iteration will next attempt expansion of the results.

The only trick in doing this is to arrange so that the active list is
popped at the appropriate time. To do this, we add a new token_node_t
marker to the active stack. When pushing onto the active list, we set
marker to last->next, and when the marker is seen by the token list
iteration, we pop from the active stack.
2010-06-02 15:32:03 -07:00