161d482312
Add windows executable.
John Kessenich
2013-08-03 00:27:08 +00:00
b849c1de5c
Add Linux executables
John Kessenich
2013-08-03 00:16:49 +00:00
54f6e5661d
Set up infrastructure for installing an executable. Changes the standalone name to glslangValidator.
John Kessenich
2013-08-03 00:04:10 +00:00
53f3cc977d
Fix bison file naming issues from upgrading to version 2.7 of bison.
John Kessenich
2013-08-01 18:04:50 +00:00
ee6a9c8ba8
Make previous check in compile correctly on linux.
John Kessenich
2013-07-31 23:19:17 +00:00
2b07c7e70a
Improve multi-threading and move Standalone to a multi-threading model (currently off though).
John Kessenich
2013-07-31 18:44:13 +00:00
b40a488e89
Update index.
John Kessenich
2013-07-22 22:31:08 +00:00
d7c0c3f49e
Push index page now that SVN access is setup.
John Kessenich
2013-07-22 22:29:42 +00:00
c4cc787e71
Put on hold pending configuring glslang for public access.
John Kessenich
2013-07-22 07:53:37 +00:00
e2c091bdd6
Link glslang project into site nav.
John Kessenich
2013-07-22 07:40:27 +00:00
fb4a0b60bf
Fix warning in release build. Update to-do list.
John Kessenich
2013-07-09 23:57:13 +00:00
d9d5f93da8
Tie missing default-precision error checks to EShMsgRelaxedErrors.
John Kessenich
2013-07-09 17:23:39 +00:00
e0ab8db923
Final linux tweak.
John Kessenich
2013-07-08 21:50:31 +00:00
3a05b78826
A few linux improvements/fixes for the previous check in.
John Kessenich
2013-07-08 20:51:29 +00:00
7213324259
Reframe the preprocessor as a C++ class, with instances, removing all C code, removing all global variables. Upgrade bison version to pass a parse context on through to the preprocessor. All the basic things to make something thread safe.
John Kessenich
2013-07-08 19:39:16 +00:00
5f1a0b7998
Eliminate flex as the GLSL lexical analyzer, going from two nested lexical analyzers down to one, leaving just the preprocessor's lexical analysis. A new layer replaces it, to translate from the preprocessor's view of tokenization to glslang's view of tokenization.
John Kessenich
2013-07-06 19:54:21 +00:00
73ed17a87b
Rationalize naming/access to current thread-local-storage scheme. However, the preprocessor tokenizer is not thread-safe, so this may all change.
John Kessenich
2013-07-02 20:18:59 +00:00
1fde51d3fb
1) Don't propagate precision of built-in function arguments to return type when return type is bool (e.g., isnan). 2) Check an additional path for missing default precision qualification, except allow built-in declarations to pass the check.
John Kessenich
2013-07-01 17:56:24 +00:00
6c0928d924
Fix bug dropping some qualifiers when merging with block member default qualification.
John Kessenich
2013-07-01 04:54:28 +00:00
69c3d8c1a0
Use the default of "smooth" for interpolation qualification for vertex outs and fragment ins (rather than all fragment IO).
John Kessenich
2013-06-28 05:32:15 +00:00
554c854143
Fix preprocessor memory leak.
John Kessenich
2013-06-26 23:41:30 +00:00
db4cd54dac
Handle bad input file.
John Kessenich
2013-06-26 22:42:55 +00:00
e369bfccfe
Semantic checks for .length(), switch/case/default, and multidimensional arrays.
John Kessenich
2013-06-26 05:54:40 +00:00
ef84d10e4c
Add semantic check for precision qualifier on wrong kind of type. Added a few more tests.
John Kessenich
2013-06-25 21:53:59 +00:00
d3f85891a7
Support line-continuation (backslash before newline) for tokens and one-line comments in the preprocessor.
John Kessenich
2013-06-25 21:09:47 +00:00
e5f80b8054
Remove the -a option, it doesn't belong here.
John Kessenich
2013-06-25 18:31:47 +00:00
41cf6b540b
Add scanner that can find '#version' across an array of non-null terminated, length-based, strings. Handle the ES error where #version is not the first thing found, while still supporting desktop behavior, and more generally support length-based multiple strings for a single shader.
John Kessenich
2013-06-25 18:10:05 +00:00
ebf0825ec4
Add the 6 hyperbolic trig functions.
John Kessenich
2013-06-24 22:40:19 +00:00
eebed6f60b
Disallow variable indexing into sampler array for ES and desktop before version 400.
John Kessenich
2013-06-24 21:52:41 +00:00
01fc0645cb
Add semantic checks for order of qualification and repetition within a class of qualifiers.
John Kessenich
2013-06-24 21:22:03 +00:00
f5c1075031
Address a g++ complaint.
John Kessenich
2013-06-24 18:24:23 +00:00
06f8464fb5
Create linkage symbol nodes in the AST so a linker has access to all global objects that were declared, for error checking, etc. Use it now for all ins/outs/uniforms as well as gl_VertexID and gl_InstanceID.
John Kessenich
2013-06-24 17:26:56 +00:00
b29ba33089
Fix bug of accidentally overriding initial layout location with 0, which does not mean no location. Added in/out structure tests.
John Kessenich
2013-06-21 19:43:44 +00:00
211cba242b
Add grammar productions for the syntax "layout(...) uniform;" for setting global defaults.
John Kessenich
2013-06-20 22:54:40 +00:00
60d9f7a881
Add grammar productions for adding 'invariant' to already declared variables.
John Kessenich
2013-06-19 20:44:17 +00:00
41a36bbb2f
Track separate precision defaults for each kind of sampler, give initial defaults as per spec. Also make fragment floats have no default. Modify/add tests to adapt to these changes.
John Kessenich
2013-06-19 05:41:25 +00:00
c59d0cd9e6
Encapsulate warnings like errors. Add warning for missing #version.
John Kessenich
2013-06-17 21:47:23 +00:00
a622cf2dc5
Fix linux build problem.
John Kessenich
2013-06-14 17:32:46 +00:00
f78fff94e9
Implement __VERSION__ macro, make ftransform() non-ES only, add more tests.
John Kessenich
2013-06-13 23:56:04 +00:00
fb7044a9a8
Semantic checks: ES doesn't have unsized arrays or noise*().
John Kessenich
2013-06-13 20:16:43 +00:00
3da5a3267e
Add semantic checks for nested blocks/structures.
John Kessenich
2013-06-13 00:13:36 +00:00
fd8e101072
Simply compile-time error handling: mostly removed the need to test an error occurred and the need to call recover().
John Kessenich
2013-06-12 22:41:21 +00:00
fbe01520b6
Get all the scoping rules right for ES and non ES, name hiding, built-in overriding, etc.
John Kessenich
2013-06-12 06:13:17 +00:00
3c31bc3289
Fix a linux build issue.
John Kessenich
2013-06-11 18:30:26 +00:00
a5cecfc6b6
Add constant folding for the exp*(), log*(), *sqrt(), round*(), floor(), fract(), ceil(), abs(), and sign() built in functions.
John Kessenich
2013-06-11 00:09:48 +00:00
fddf3ce3a1
Unify constant floats and constant doubles; they can all be constant doubles.
John Kessenich
2013-06-10 21:56:23 +00:00
50a8cabbbb
Add constant folding for length(), normalize(), fwidth(), dFdx(), and dFdy().
John Kessenich
2013-06-10 07:37:49 +00:00
00f605b930
A round of increasing robustness against buffer overruns.
John Kessenich
2013-06-10 07:36:26 +00:00
7408a69952
Add semantic check for ES variably indexing a uniform block.
John Kessenich
2013-06-07 19:07:39 +00:00
3ce5745ade
Add more tests for built-in variables.
John Kessenich
2013-06-07 18:54:19 +00:00
0fbb0c4930
Block/structure fixes: Merge qualifiers with multiple declarators, handle arrays of blocks, more semantic checks for what's allowed.
John Kessenich
2013-06-06 18:31:21 +00:00
ceb0623823
Fix another problem with undefined macros needing to evaluate to 0 within a preprocessor expression, but not outside a preprocessor expression.
John Kessenich
2013-06-03 04:15:57 +00:00
04de88f990
The new test that was to have been added with the previous check in.
John Kessenich
2013-06-02 22:57:37 +00:00
2327da4784
Add test for operation semantics, fix one bug it found.
John Kessenich
2013-05-30 23:31:38 +00:00
69762564de
A bunch of semantic checks were missing for binary arithmetic operations. Refactor the "promote" logic to fix these.
John Kessenich
2013-05-30 19:15:35 +00:00
0f359f0e35
Change warning to error for use of double underscore.
John Kessenich
2013-05-29 22:40:31 +00:00
8d00fd0e29
Add missing type check for operands having the same type (after conversion) around the ":" in a "?:" operation.
John Kessenich
2013-05-28 07:29:58 +00:00
2d0f1e5424
Add precision qualifier propagation for swizzling, texture lookups, built-in funtions mapped to operators, comma op, and more robustly propagate for all binary/unary ops.
John Kessenich
2013-05-17 02:51:45 +00:00
61f205ecd8
Remove too aggressive and redundant lexical keyword check: attribute and varying can always be error checked in the grammar.
John Kessenich
2013-05-07 23:48:06 +00:00
52ac67e913
Make the PP report an error on undefined macro in "#if ..." for ES profiles, unless relaxed error checking is requested. Still works as normal CPP on non-ES.
John Kessenich
2013-05-05 23:46:22 +00:00
c2ff7702be
For all keywords already present, get correct when they could be identifiers, are reserved words, or are keywords, for all versions of ESSL and GLSL.
John Kessenich
2013-04-25 16:44:03 +00:00
09da79e190
Put memory counter stuff in #ifdef _WIN32.
John Kessenich
2013-04-17 19:34:23 +00:00
1d923219fe
Add some more qualifier helper functions.
John Kessenich
2013-04-17 05:02:12 +00:00
6e4d1087a4
Fix dependency misspelling that caused unnecessary grammar rebuilds.
John Kessenich
2013-04-15 00:14:34 +00:00
8df53cc057
Rationalize command-line options: controlling memory leak testing, AST output, and info log output.
John Kessenich
2013-04-14 19:23:50 +00:00
4d5de020d8
Force "smooth" interpolation qualification when in a fragment shader.
John Kessenich
2013-04-13 06:05:31 +00:00
78016eff17
Small tweak to switch statements: use a smaller base class.
John Kessenich
2013-04-12 22:57:28 +00:00
b49a191532
Update all "TODO", add some comments.
John Kessenich
2013-04-12 17:17:07 +00:00
0108aa1183
Minor changes: remove use of 'auto', plug obscure memory leak, update copyright.
John Kessenich
2013-04-12 16:50:28 +00:00
0576126005
Add switch/case/default statements, using a switch node that contains a sequence of case/default nodes and top-level nodes of the code chunks in between them.
John Kessenich
2013-04-12 03:57:02 +00:00
8e5425745f
- Temp fix for the GLSL yacc file (linux builds failing).
John Kessenich
2013-04-11 22:38:16 +00:00
b51f62c573
Add the GL_ES macro for ES personalities, along with a general mechanism for adding preambles in front of shaders without effecting line numbers, etc.
John Kessenich
2013-04-11 16:31:09 +00:00
63eed3867a
Additional layout-related error checking.
John Kessenich
2013-04-10 23:30:05 +00:00
bcd79fe5a3
Implement default layout qualifiers at global and block levels with proper inheritance. Also add more error checking of qualifiers.
John Kessenich
2013-04-10 22:26:56 +00:00
ba04210097
Add anonymous members as a new symbol table type, so the infrastructure can handle blocks with no names.
John Kessenich
2013-04-10 20:15:16 +00:00
ed3197921e
Change TType member from "type" to "basicType". It was very confusing.
John Kessenich
2013-04-10 02:28:55 +00:00
f6648dc12c
Add interface blocks as a basic type and handle uniform blocks that have an instance name. Includes handling qualifiers on structure members.
John Kessenich
2013-04-10 02:06:46 +00:00
e9942d26f5
Initial implementation of layout qualifiers. More to come after uniform blocks are in place.
John Kessenich
2013-04-09 01:20:01 +00:00
3ed2db58f1
Put in correct rules for multiple versions of qualification and typing of inputs and outputs. Also, removed EvqAttribute, merging it with EvqVaryingIn.
John Kessenich
2013-04-07 22:43:16 +00:00
ad3663be1f
Add ES 300 built-ins trunc, round, roundEven, modf, isnan, isinf, floatBitsToInt, floatBitsToUint, intBitsToFloat, uintBitsToFloat, packSnorm2x16, unpackSnorm2x16, packUnorm2x16, unpackUnorm2x16, packHalf2x16, and unpackHalf2x16, and new form of min, max, clamp, and mix.
John Kessenich
2013-04-07 20:04:12 +00:00
4ba94413d3
Split out the unary-argument built-in function path from the addUnaryMath() path, allowing the return types to be treated correctly without any special casing. Also, implement the correct precision qualifier propagation rules for built-in functions mapped to operators.
John Kessenich
2013-04-07 02:10:55 +00:00
ebeeece6a7
Add uint type (big change). For both int/uint, add the operators >>, <<, &, |, and ^. Also added unsigned literals and uint precision support. Also fixed how int/uint literal underflow/overflow is handled.
John Kessenich
2013-04-05 04:05:39 +00:00
ae722a6230
CPP: Handle the "u" and "U" suffixes for uint literals, and correctly handle underflow/overflow of integer literals.
John Kessenich
2013-04-03 18:42:43 +00:00
7d58d655c2
Add a forward reference function call test.
John Kessenich
2013-03-21 17:33:38 +00:00
a067b588aa
Fix release build, it was missing the custom build steps.
John Kessenich
2013-03-13 01:58:33 +00:00
213c464c60
Add and use ability to tell the backend compiler what version/profile the source shader was.
John Kessenich
2013-03-12 17:53:55 +00:00
d7c120f16f
A few trivial things, including removing '/' as a command line option indicator so absolute paths work naturally.
John Kessenich
2013-03-12 17:52:59 +00:00
20169715df
Get a clean g++/gcc build. Runs and gets correct results on linux.
John Kessenich
2013-03-09 19:50:19 +00:00
cfd643e447
Another round of gcc/g++ fixes.
John Kessenich
2013-03-08 23:14:42 +00:00
37827023c4
Add warning-suppression flag. Combined with relaxed errors, so an enum can be used instead of many bools.
John Kessenich
2013-03-08 19:26:11 +00:00
4055816bc9
Add compilation mode flags for forward-compatible contexts and relaxed error checking. These initiate as arguments to ShCompile() and both default to being off.
John Kessenich
2013-03-08 18:49:22 +00:00
9500dff05e
Upgrade to MSVC 11. Fix pool_allocator a bit.
John Kessenich
2013-03-08 06:51:50 +00:00
53fb465729
Change infrastructure to support constant folding across built-in functions, as required by 1.2 semantics. Partially fleshed out with min/max and some trig functions. Still have to complete all operations.
John Kessenich
2013-03-07 19:22:07 +00:00
3f3e0ad3ad
Add unsigned ints to constUnions. (Unsigned int support is still partial throughout.)
John Kessenich
2013-03-07 01:02:02 +00:00
3252b18590
Minor updates to tests.
John Kessenich
2013-03-04 23:50:08 +00:00
ca8899c9ae
Add productions/data for about 14 qualifiers (versions 1.2 through 4.3). Fixed some case issues for rect/array keywords.
John Kessenich
2013-03-01 21:53:13 +00:00
4b67103b02
Implement operator-based implicit type conversions.
John Kessenich
2013-02-28 20:49:41 +00:00
ef8ae2e345
Allow gl_FragColor and gl_FragData in non-forward-compatible contexts for non-ES versions 150 - 410. Also add deprecation message for attribute/varying for core profile.
John Kessenich
2013-02-27 19:02:52 +00:00
df807514b6
Skip dummy unused second component for 1D non-array shadows.
John Kessenich
2013-02-26 19:48:48 +00:00