Commit Graph

372 Commits

Author SHA1 Message Date
Grigory Dzhavadyan
33ddaaafc1 Make FindLanguage use the entire name if parseStageName is false 2018-04-12 20:31:27 -07:00
Grigory Dzhavadyan
ef203bfa38 Fix build error 2018-04-12 19:29:26 -07:00
Grigory Dzhavadyan
3350741e24 Make glslang validator support files ending in .glsl
This patch makes  the validator accept *.<stage name>.[g/h]lsl pattern
for file names.

This patch preserves previous behavior (i.e. *.vert/*.frag/etc. in file
names still work).
2018-04-12 14:35:24 -07:00
John Kessenich
7f0bcfd8d8 Fix #1333: Protect against -g for non-generating code. 2018-04-05 19:00:01 -06:00
GregF
fb03a55e0f Only print legalization warning if optimizer disabled 2018-03-29 13:17:54 -06:00
John Kessenich
7cec64fc42 Non functional: add EshTargetClientVersion alias for EShTargetClientVersion.
Fixes #1304.
2018-03-22 23:54:04 -06:00
John Kessenich
5d610ee1dc Implement SPV_GOOGLE_hlsl_functionality1.
Enabled via -fhlsl_functionality1
2018-03-16 20:21:44 -06:00
John Kessenich
fb97d25c98 Merge branch 'feature' of https://github.com/amdrexu/glslang into amdrexu-feature 2018-03-07 14:29:45 -07:00
Rex Xu
cb61eec948 HLSL: Map min types to GLSL 16-bit types 2018-03-07 13:10:01 +08:00
John Kessenich
66011cb2c2 SPV: Implement Vulkan 1.1 features and extensions. 2018-03-06 16:12:04 -07:00
John Kessenich
c6c80a6e48 Versioning: Address #1255: Move to semantic versioning.
Still missing is automation and final decisions on mechanisms in general.
2018-03-05 22:23:17 -07:00
David Neto
506d2c241d Fix typo in help for -V<bad-number> 2018-02-27 21:55:23 -05:00
John Kessenich
2b5ea9f851 SPV Version: Emit the requested SPIR-V version, not the header version.
Fixes #1236.
2018-01-31 18:41:59 -07:00
John Kessenich
22f02d09cc EShTargetSpv: Fix #1235, spelling, in a backward compatible way. 2018-01-31 17:53:24 -07:00
LoopDawg
b22c069f7a HLSL: add optional position.Y inversion
Adds command line options:

   --invert-y
   --iy

(synonyms) which invert position.Y on vertex shader output.  Handles these cases:

* Direct single variable return
* Member of direct returned struct
* Single variable output parameter
* Member of struct output parameter

API:

    // Enables position.Y output negation in vertex shader
    void TShader::setInvertY(bool invert);

Fixes #1173
2017-12-07 10:48:14 -07:00
John Kessenich
e2c15b4f6e Memory: Reference count number of clients, to support multiple independent clients in same process.
Addresses 2nd item in #976.
2017-11-16 23:02:14 -07:00
John Kessenich
b63f4a3808 Usage: clarify meaning of -s; fixes #1135. 2017-11-16 22:32:20 -07:00
John Kessenich
94f28eb61a Memory: Add loop around main, to test tear-down and reuse, and monitor memory changes. 2017-11-13 01:52:26 -07:00
LoopDawg
e570955cdc Reverse order of setShiftBindingForSet parameters
Per feedback on PR #1111, this reverses the order of the parameters for the setShiftBinding API.

It is now:

    void TShader::setShiftBindingForSet(TResourceType res, unsigned int base, unsigned int set);
2017-11-09 09:51:15 -07:00
John Kessenich
af52799c2d Errors: Have a whole set of tool-level error messages report to stderr. 2017-11-02 22:48:15 -06:00
John Kessenich
a372a3ed1e Versioning: Update some version strings. Still need better overall version. 2017-11-02 22:34:43 -06:00
LoopDawg
08a14422c1 Add per-descriptor-set IO mapping shift values.
This PR adds the ability to provide per-descriptor-set IO mapping shift
values.  If a particular binding does not land into a per-set value,
then it falls back to the prior behavior (global shifts per resource class).

Because there were already 6 copies of many different methods and internal
variables and functions, and this PR would have added 6 more, a new API is
introduced to cut down on replication and present a cleaner interface.
For the global (non-set-specific) API, the old entry points still exist
for backward compatibility, but are phrased internally in terms of the
following.

    // Resource type for IO resolver
    enum TResourceType {
        EResSampler,
        EResTexture,
        EResImage,
        EResUbo,
        EResSsbo,
        EResUav,
        EResCount
    };

Methods on TShader:

    void setShiftBinding(TResourceType res, unsigned int base);
    void setShiftBindingForSet(TResourceType res, unsigned int set, unsigned int base);

The first method replaces the 6 prior entry points of various spellings, which
exist now in depreciated form.  The second provides per-resource-set functionality.
Both accept an enum from the list above.

From the command line, the existing options can accept either a single shift value as
before, or a series of 1 or more [set offset] pairs.  Both can be provided, as in:

    ... --stb 20 --stb 2 25 3 30 ...

which will use the offset 20 for anything except descriptor set 2 (which uses 25) and
3 (which uses 30).
2017-10-19 11:50:30 -06:00
John Kessenich
3693e631f5 Fix #1060: Could crash if using --source-entry-point with -e; fixed. 2017-09-29 17:51:52 -06:00
GregF
52fe3d598c Legalization: Fix warnings and disable tests when spirv-tools not present 2017-09-28 10:13:23 -06:00
GregF
cd1f169c6a Enable HLSL legalization
Also added known-good mechanism to fetch latest validated spirv-tools.
Also added -Od and -Os to disable optimizer and optimize for size.

Fetching spirv-tools is optional for both glsl and hlsl. Legalization
of hlsl is done by default if spirv-opt is present at cmake time.
Optimization for glsl is currently done through the option -Os.

Legalization testing is currently only done on four existing shaders.
A separate baseLegalResults directory holds those results. All previous
testing is done with the optimizer disabled.
2017-09-27 15:06:05 -06:00
John Kessenich
b3ca4045c5 Build: Fix build warnings. 2017-09-11 20:39:54 -06:00
John Kessenich
a25530cc18 Non-functional: Make usage for entry points more consistent. 2017-09-11 20:13:49 -06:00
Sven-Hendrik Haase
0dd1285cb6 Add --stdin 2017-09-07 20:35:40 +02:00
John Kessenich
2a27116cae SPV reflection: Add OpModuleProcessed for compile options. 2017-08-25 11:48:02 -06:00
LoopDawg
52017192e5 Fix crash with --resource-set-binding [n] (common set form, not per-register form)
--resource-set-binding has a mode which allows per-register assignments of
bindings and descriptor sets on the command line, and another accepting a
single descriptor set value to assign to all variables.

The former worked, but the latter would crash when assigning the values.
This fixes it, and makes the former case a bit more robust against premature
termination of the pre-register values, which must come in (regname,set,binding)
triples.

This also allows the form "--resource-set-binding stage setnum", which was
mentioned in the usage message, but did not parse.

The operation of the per-register form of this option is unchanged.
2017-07-18 11:15:40 -06:00
LoopDawg
b97b25e40b Fix StandAlone.cpp compilation warnings
find_first_of returns size_t, was overflowing int.
2017-07-12 09:05:05 -06:00
John Kessenich
17b5f9175d Merge pull request #969 from d3x0r/patch-1
Add option to skip installation
2017-07-04 11:00:42 -06:00
Rohith Chandran
6206091e63 Fix CMake scripts: The set_property script can be used to set only a single property, so now setting the POSITION_INDEPENDENT_CODE property correctly. 2017-07-04 10:53:45 -04:00
d3x0r
4593312490 Update CMakeLists.txt 2017-07-04 06:01:09 -07:00
John Kessenich
6353d55e94 Command-line: Add support for setting language's environment. 2017-06-26 14:49:11 -06:00
John Kessenich
c178f0a4d9 Infrastructure: Non-functional: rationalize some command-line processing. 2017-06-26 14:49:11 -06:00
John Kessenich
4be4aebdcd Infrastructure: Non-functional: Move to rich description of environment.
This is for input languages, client APIs, code to generate, etc.
2017-06-26 14:49:11 -06:00
John Kessenich
a931366f56 Standalone: Implement -D and -U for preprocessor macros.
Works for both GLSL and HLSL.
Fixes #87.
2017-06-15 10:57:18 -06:00
John Kessenich
04acb1b7c9 Standalone: Rationalize ShaderCompUnit and file data.
ShaderCompUnit was poorly done, a mix of a list of things and hard
coding to a single thing. This makes it all a true list.

File data was greatly simplified to be a single string, no longer
supporting breaking a single file into multiple strings.
2017-06-14 17:36:50 -06:00
John Kessenich
6263fb19fb Infrastructure: Rationalize command-line options.
Makes alphabetical order, fit in 80 columns, abstract in-option
string argument.
2017-06-14 15:52:44 -06:00
John Kessenich
971a0a8d2d Infrastructure: add include search paths (-I, etc.). 2017-06-07 15:09:54 -06:00
John Kessenich
3494b4da9b HLSL: Add an Includer to handle #include. 2017-06-01 11:16:32 -06:00
John Kessenich
121853f4df SPV: Add OpSource shader source code and file name. 2017-05-31 17:14:15 -06:00
John Kessenich
71facdf435 SPV: Give error on not assigning locations to I/O.
Also, provides an option to auto-assign locations.
Existing tests use this option, to avoid the error message,
however, it is not fully implemented yet.
2017-05-18 15:07:05 -06:00
John Kessenich
d9b08d5c3d Merge pull request #880 from aras-p/master
Fix for lumped/unity/batch builds
2017-05-10 11:11:44 -06:00
Aras Pranckevicius
8e204b2d67 [lumped builds] Only define _CRT_SECURE_NO_WARNINGS if it’s not defined yet.
When glslang is built with some other build system and lumped/unity builds are used,
without the checks this would get “macro is being redefined” warnings/errors.
2017-05-10 16:52:50 +03:00
Hyangran Park
36dc82908f HLSL: Manually configure descriptor set and binding number for resources 2017-05-10 16:50:18 +09:00
David Seifert
22afc38b55 Modernise CMake #2
This reverts commit cfc69d95af.
* Change CMAKE_INSTALL_PREFIX default on Windows in order
  to prevent permission denied errors when trying to install
  to "Program Files".
2017-04-29 11:23:15 +02:00
John Kessenich
cfc69d95af Revert "Modernise CMake" 2017-04-28 22:04:24 -06:00
David Seifert
5a5699bdbd Modernise CMake
* Use `GNUInstallDirs` in order to respect GNU conventions.
  This is especially important for multi-arch/multi-lib setups.
* Specify position independent mode building properly, without
  using the historic hack of adding `-fPIC` as a definition.
  This makes the build system more portable.
* Only detect C++ (and not C) to slightly speed up configuring.
* Specify C++11 mode using modern CMake idioms.
* Fix some whitespace issues.
2017-04-28 22:46:52 +02:00
steve-lunarg
be28355019 WIP: HLSL: hlsl register class iomapping
Adds --hlsl-iomap option to perform IO mapping in HLSL register space.

--shift-cbuffer-binding is now a synonym for --shift-ubo-binding.

The idea way to do this seems to be passing in a dedicated IO resolver, but
that would require more intrusive restructuring, so maybe best for its
own PR.

The TDefaultHlslIoResolver class and the former TDefaultIoResolver class
share quite a bit of mechanism in a common base class.

TODO: tbuffers are landing in the wrong register class, which needs some
investigation.  They're either wrong upstream, or the detection in the
resolver is wrong.
2017-04-20 12:41:39 -06:00
John Kessenich
4f1403ed1b SPV: Fix #807: use --hlsl-offsets to allow hlsl-style offsets in a buffer.
Corresponds to the EShMsgHlslOffsets flag in messages.
Works for both GLSL and HLSL.
2017-04-05 17:38:20 -06:00
Juan Lopez
a558b26537 This refactor the StandAlone and WorkList files in order to use more
C++11 features remove the dependencies from OS specific code. Changes:

- Making WorkList class to have its own mutex instead of the OS specific
global one. The new mutex is the one from std library. The OS specific
code is also removed.

- Using the C++11 std library to handle threads in StandAlone
application
and enabling concurrent processing on non-windows platforms.

- converting the global variable Worklist into local variable workList.
2017-04-04 22:29:59 +02:00
John Kessenich
e751bca75c Fix #777: don't parse .suffix if <stage> is provided.
Adding a test for this also uncovered an extraneous \r in the runtests script,
fixed now.
2017-03-16 11:30:20 -06:00
steve-lunarg
932bb5cc4e Add reflection queries for thread local size and ssbo auto-binding
New command line option --shift-ssbo-binding mirrors --shift-ubo-binding, etc.

New reflection query getLocalSize(int dim) queries local size, e.g, CS threads.
2017-02-22 09:40:28 -07:00
John Kessenich
8f674e821e Fix issue #676: emit error message on failure to open spv file. 2017-02-18 09:45:40 -07:00
Flavio
15017db971 Removed tabs and replaced with spaces. Changed layout for "else if" 2017-02-15 14:29:33 -08:00
Flavio
aea3c890d3 Added --vn option to generate a C header file containing a variable assigned to the hex representation of the shader. This is a standard feature on Microsoft's HLSL compiler and it allows developers to include pre-compiled shaders directly into the code. This option enables "Hex output", so it is NOT required to specify -x as well. The output file name is preserved, so no ".h" extension is added. If you want the output file to have ".h" extension then you have to specify it on the output file name. The generated header file uses the "#pragma once" pragma to avoid multiple inclusions. 2017-02-06 11:46:35 -08:00
Michael Maltese
6077a19ba3 CMake: add target_link_libraries internally
Makes it easier to include glslang in a larger CMake project---instead
of having to call `target_link_libraries(glslang OSDependent OGLCompiler
HLSL)`, for example, you only need to call
`target_link_libraries(glslang)` and it will pull in the helpers it
needs.

This is also better in terms of cleaning up the "public interface",
of sorts, for building glslang: end-users probably shouldn't need to
know or be explicitly dependent on internal targets.
2017-01-21 10:59:15 -08:00
John Kessenich
dc1a8196cf Infrastructure: Support standard build with ENABLE_HLSL set to off. 2017-01-11 14:50:16 -07:00
John Kessenich
ce80197c22 Merge pull request #663 from KhronosGroup/full-include-semantics
Includer interface change to support full include semantics (requires downstream changes)
2017-01-10 18:49:07 -07:00
Alex Szpakowski
ff21a25bc8 Change disabled-by-default DISABLE_HLSL option to enabled-by-default ENABLE_HLSL.
Matches existing options.
2017-01-09 18:10:14 -04:00
Alex Szpakowski
84eabf7ea7 Add a CMake option to disable compilation of HLSL input support. 2017-01-08 21:20:25 -04:00
John Kessenich
facde2c804 PP #include: address PR feedback. 2017-01-06 16:48:18 -07:00
John Kessenich
63204c2501 External interface change: PP: Full <> and "" semantics for the Includer.
Any previous use would only be for "", which would probably mean changing

    include(...)  -> includeLocal(...)

See comments about includeLocal() being an additional search over
includeSystem(), not a superset search.

This also removed ForbidIncluder, as
 - the message in ForbidIncluder was redundant: error results were
   already returned to the caller, which then gives the error it
   wants to
 - there is a trivial default implementation that a subclass can
   override any subset of (I still like abstract base classes though)
 - trying to get less implementation out of the interface file anyway
2017-01-06 15:08:54 -07:00
John Kessenich
927608b393 Non-functional: White space after "//", mostly for copyrights. 2017-01-06 12:34:14 -07:00
John Kessenich
ecba76fe73 Non-Functional: Whitespace, comments, replace accidentally deleted comment.
- fixed ParseHelper.cpp newlines (crlf -> lf)
- removed trailing white space in most source files
- fix some spelling issues
- extra blank lines
- tabs to spaces
- replace #include comment about no location
2017-01-06 11:24:14 -07:00
John Kessenich
20f01e7fd0 Fix last commit; EOptionKeepUncalled incorrect enum bug. 2016-12-12 11:41:43 -07:00
John Kessenich
906cc21816 Linker: Eliminate uncalled functions, because they can be ill-defined.
Fixes issue #610. Also provides a testing option to keep uncalled functions.
2016-12-09 19:22:20 -07:00
steve-lunarg
f1e0c87127 allow renaming of shader entry point when creating SPIR-V
Use "--source-entrypoint name" on the command line, or the
TShader::setSourceEntryPoint(char*) API.

When the name given to the above interfaces is detected in the
shader source, it will be renamed to the entry point name supplied
to the -e option or the TShader::setEntryPoint() method.
2016-12-01 08:51:43 -07:00
steve-lunarg
9088be4c07 Add UAV (image) binding offset and HLSL register support
This PR adds:

1. The "u" register class for RW* objects.

2. --shift-image-bindings (== --sib), analogous to --shift-texture-bindings etc.

3. Case insensitive reg classes.

4. Tests for above.
2016-11-01 14:44:54 -06:00
David Neto
e301f67828 Use std::atoi instead of std::stoi
Some Android cross cross-compilers don't have std::stoi.

E.g. i686-linux-android-g++ from Android NDK r10e don't have std::stoi.
2016-10-31 17:02:45 -04:00
steve-lunarg
4e3dd2087c WIP: avoid strtok 2016-10-21 14:51:43 -06:00
John Kessenich
1fabc0f697 Merge pull request #548 from baldurk/vs2010-compile-fixes
VS2010 compile fixes
2016-10-15 23:09:31 -06:00
steve-lunarg
cce8d48bcc HLSL: phase 3c: add option to use Unknown storage format
This uses the Unknown storage format, instead of deducing the
format from the texture declaration type.
2016-10-14 18:50:37 -06:00
baldurk
31d5d48812 Change constructor to use ()s instead of {}s 2016-10-13 19:25:52 +02:00
steve-lunarg
9ae34742cf Check for out-of-range bindings during IO mapping. 2016-10-05 13:42:42 -06:00
steve-lunarg
bc9b7656b7 Restrict uniform array flattening to sampler and texture arrays.
Previously the uniform array flattening feature would trigger on loose
uniform arrays of any basic type (e.g, floats).  This PR restricts it
to sampler and texture arrays.  Other arrays would end up in their own
uniform block (anonymous or otherwise).  (Atomic counter arrays might be an
exception, but those are not currently flattened).
2016-09-29 14:01:25 -06:00
steve-lunarg
e0b9debda2 Flatten uniform arrays
This checkin adds a --flatten-uniform-arrays option which can break
uniform arrays of samplers, textures, or UBOs up into individual
scalars named (e.g) myarray[0], myarray[1], etc.  These appear as
individual linkage objects.

Code notes:

- shouldFlatten internally calls shouldFlattenIO, and shouldFlattenUniform,
  but is the only flattening query directly called.

- flattenVariable will handle structs or arrays (but not yet arrayed structs;
  this is tested an an error is generated).

- There's some error checking around unhandled situations.  E.g, flattening
  uniform arrays with initializer lists is not implemented.

- This piggybacks on as much of the existing mechanism for struct flattening
  as it can.  E.g, it uses the same flattenMap, and the same
  flattenAccess() method.

- handleAssign() has been generalized to cope with either structs or arrays.

- Extended test infrastructure to test flattening ability.
2016-09-22 08:47:48 -06:00
steve-lunarg
7f7c2ed780 HLSL: Add location offsets per resource type
This PR adds the ability to offset sampler, texture, and UBO bindings
from provided base bindings, and to auto-number bindings that are not
provided with explicit register numbers. The mechanism works as
follows:

- Offsets may be given on the command line for all stages, or
  individually for one or more single stages, in which case the
  offset will be auto-selected according to the stage being
  compiled. There is also an API to set them. The new command line
  options are --shift-sampler-binding, --shift-texture-binding, and
  --shift-UBO-binding.

- Uniforms which are not given explicit bindings in the source code
  are auto-numbered if and only if they are in live code as
  determined by the algorithm used to build the reflection
  database, and the --auto-map-bindings option is given. This auto-numbering
  avoids using any binding slots which were explicitly provided in
  the code, whether or not that explicit use was live. E.g, "uniform
  Texture1D foo : register(t3);" with --shift-texture-binding 10 will
  reserve binding 13, whether or not foo is used in live code.

- Shorter synonyms for the command line options are available.  See
  the --help output.

The testing infrastructure is slightly extended to allow use of the
binding offset API, and two new tests spv.register.(no)autoassign.frag are
added for comparing the resulting SPIR-V.
2016-09-20 20:31:27 -06:00
Lei Zhang
424cf80f8b Disable C4996 (secure CRT) recommendation on Windows for strtok().
strtok_s() is suggested by MSVC, but it has different signature
than the C11 standard one. So we just turn off the recommendation
here.
2016-08-26 14:43:14 -04:00
steve-lunarg
a8456415b8 WIP: SPV Remapper: add remapper test framework 2016-08-25 10:46:51 -06:00
John Kessenich
219b025d7e Non-functional: Fix commit 98f164ec48.
Fix previous commit to not use tabs and otherwise match local coding
conventions better.
2016-08-23 17:51:13 -06:00
dankbaker
afe6e9c4fc HLSL and standalone, modifying Standalone to send filename as string source, and HLSL backend will use this to print a better error mesage when things fail 2016-08-21 12:29:08 -04:00
John Kessenich
28660bb580 Merge pull request #450 from dankbaker/standalone_change
Allowing explicit specification of shader compiltion type via -T opti…
2016-08-11 16:37:52 -06:00
Dan Baker
5afdd78131 Standalong: Changing -T to -S since it's a stage now instead of a target 2016-08-11 17:53:57 -04:00
Dan Baker
895275e357 Standalone: Changing some comments and user strings 2016-08-11 14:55:49 -04:00
Dan Baker
c6ede8938a Changing target to stage 2016-08-11 14:06:06 -04:00
dankbaker
45d49bcd51 Allowing explicit specification of shader compiltion type via -T option, rather then looking at file extension. For HLSL files, this is nice because .hlsl extension is natively udnerstood by visual studio, likely to be used with the -e option. 2016-08-08 22:24:29 -04:00
John Kessenich
66ec80e01b Build: C++ headers: Replace PR #366 with a more directed version. 2016-08-05 14:04:23 -06:00
John Kessenich
b84313dca1 Versions: Update version output.
Also, the per-build part had stopped auto-updating,
which is fixed locally as a git hook.
2016-07-20 16:03:29 -06:00
John Kessenich
a86836ede2 Front-end: Fix known crashes by early exit on error (issue #29, issue #34, issue #35).
Added -C option to request cascading errors.  By default, will exit early,
to avoid all error-recovery-based crashes.

This works by simulating end-of-file in input on first error, so no
need for exception handling, or stack unwinding, or any complex error
checking/handling to get out of the stack.
2016-07-09 14:53:11 -06:00
John Kessenich
7f349c73db Build: Remove causes of pedantic warnings. Addresses issue #352 and PR #242. 2016-07-08 22:09:10 -06:00
John Kessenich
c45dddae5f Merge pull request #314 from mre4ce/master
Added -x option to save SPIR-V as 32-bit hexadecimal numbers to a text file.
2016-07-08 15:26:27 -06:00
John Kessenich
91e4aa5900 SPV: Further refine OpenGL vs. Vulkan differences for SPIR-V.
Includes adding test cases to verify the differences.
2016-07-07 19:27:15 -06:00
David Neto
b37dc0e458 For MinGW, statically link exes against basic runtimes
Avoids the need to ship basic runtimes like libgcc_s_sjlj-1.dll
with the executables.
2016-06-02 14:37:24 -04:00
Johannes van Waveren
1fd017546a turn -x into an option next to -o 2016-05-31 08:39:41 -05:00
Johannes van Waveren
ecb0f3b75b Added -x option to save SPIR-V as 32-bit hexadecimal numbers to a text file. 2016-05-27 12:55:53 -05:00
David Neto
2ed1d9bba0 atoi comes from stddef.h or cstddef
This is required to fix the Android build for ARM.
2016-05-20 16:06:49 -04:00
Lei Zhang
1b141728a6 Test compiling shaders with given resource limits using GTest. 2016-05-19 14:18:21 -04:00
Lei Zhang
8a9b1ee3b4 Rename DefaultResourceLimits.* to ResourceLimits.*. 2016-05-19 13:53:16 -04:00
John Kessenich
e2d06dbf60 Merge pull request #268 from AWoloszyn/update-cmake
CMake: Updated to better organize folders and options.
2016-05-05 13:46:36 -06:00
Andrew Woloszyn
db0eaf9887 Updated cmake to better organize folders and options.
This adds solution folders that properly group gtest/glslang/hlsl.
This also marks gtest options as advanced so they don't show up
in cmake-gui by default.
2016-05-05 14:45:53 -04:00
Lei Zhang
17535f7d55 Create a new logger class for all messages w.r.t. SPIR-V build. 2016-05-05 10:15:06 -04:00
Lei Zhang
09caf12bec Avoid printing to stdout directly in library functions.
Previously GlslangToSpv() reported missing/TBD functionalities
by directly writing to stdout using printf. That could cause
problems to callers of GlslangToSpv(). This patch cleans up
the error reporting logic in GlslangToSpv(), TGlslangToSpvTraverser,
and spv::Builder a little bit to use ostringstream.

Also fixed the usage of GlslangToSpv() in GTest fixtures to
capture warnings/errors reported when translating AST to SPIR-V.
2016-05-05 10:15:06 -04:00
Lei Zhang
3f460532cc Remove duplicated cmake_minimum_required() calls. 2016-05-04 17:01:36 -04:00
John Kessenich
1c7e70763b Merge branch 'master' into hlsl-frontend 2016-04-03 20:36:48 -06:00
John Kessenich
f0bcb0aaf4 Comment: fix comment from gtest check in. 2016-04-02 13:09:14 -06:00
Lei Zhang
414eb60482 Link in Google Test framework.
The existing test harness is a homemade shell script. All the tests
and the expected results are written in plain text files. The harness
just reads in a test, invoke the glslangValidator binary on it, and
compare the result with the golden file. All tests are kinda
integration tests.

This patch add Google Test as an external project, which provides a
new harness for reading shader source files, compile to SPIR-V, and
then compare with the expected output.
2016-03-31 10:31:30 -04:00
Andrew Woloszyn
a132af5b78 Updated the includer interface to allow relative includes.
This plumbs both the current file path and the include depth
back up to the includer. This allows the includer to properly
support relative paths.

This also replaces the string copy that was done during include
with a zero-copy method of accomplishing the same thing. This
prevents extra copies of entire files.
2016-03-21 10:19:45 -04:00
John Kessenich
e01a9bc8c0 HLSL: Plumb in HLSL parse context and keywords, and most basic HLSL parser and test. 2016-03-12 21:40:08 -07:00
John Kessenich
66e2faf844 Support multiple source languages, adding HLSL as an option. 2016-03-12 18:34:36 -07:00
John Kessenich
4d65ee31a6 Generalize "main" to a settable entry point name. 2016-03-12 18:17:47 -07:00
John Kessenich
52d08596ec Merge pull request #175 from rdb/master
Fix compilation issues with MSVC 2010
2016-02-27 21:29:14 -07:00
Jack Andersen
52e61acf26 SPV: Ensure Parameterize is called during Disassemble 2016-02-23 12:03:21 -10:00
rdb
32084e889d Fix compilation issues with MSVC 2010
(mostly by eliminating use of range-based for loops and std::tie)
2016-02-23 22:17:38 +01:00
John Kessenich
5996961bd1 Merge pull request #134 from AWoloszyn/glslangvalidator-memory
Freed up some command line memory (not used programmatically).
2016-01-18 11:10:18 -07:00
Andrew Woloszyn
b891c2b827 Freed up some memory when no longer needed in glslangValidator. 2016-01-18 09:26:25 -05:00
John Kessenich
c57b2a97fa Memory/Perf: For link-mode, isolate file I/O so API can be looped over.
Separating file I/O from compile/link lets the compile/link be done
repeatedly in a loop for testing and measuring of performance and
memory footprint, including seeing memory growth over time for
functional-level memory-leak testing.

While the older compile-only mode already had this functionality,
and typically showed no memory leaks, SPIR-V uses the link path,
has pending "TODO" for memory freeing, and this shows several
kilobytes of leaking per compile-link. Most likely, pending
merge request 131 will address much of this.
2016-01-16 15:30:03 -07:00
Kenneth Perry
b07e6beb8a Display the filename if we have output, even if validating a single file. 2015-12-15 10:52:34 -06:00
Pyry Haulos
5f6892e23c Use generic osinclude.h
Using platform-neutral osinclude.h makes it easier to substitute
implementation when necessary and eliminates some variability between
build configurations.
2015-12-01 13:01:34 -08:00
baldurk
5100d5603f Remove legacy build system 2015-11-16 23:51:35 +01:00
baldurk
876a0e392e Add an osinclude.h below each OS directory, redirects by platform macro
* Linux folder has been renamed to Unix, to match defines and so that it
  compiles on OS X.
* This removes the need for a per-platform include search path for the
  right OS folder
2015-11-16 18:05:18 +01:00
baldurk
08dee03d18 Remove include_directories from CMakeLists, to enforce relative includes
* This also moves bison generated files into the source tree, so that
  include of glslang_tab.cpp.h and includes from glslang_tab.cpp work
  the same way.
2015-11-16 18:05:18 +01:00
John Kessenich
55e7d11ce8 SPIR-V: Move from Version .99 Rev 31 to Version 1.0, Rev 2. 2015-11-15 22:31:41 -07:00
Andrew Woloszyn
8b64fa5474 Fixes for compiling glslang on Android.
Primarily fix is due to Android not supporting std::to_string().
2015-08-17 11:39:38 -04:00
John Kessenich
5e4b1242bf Move to revision 31 of SPIR-V. 2015-08-06 22:55:01 -06:00
John Kessenich
d618070ab0 Merge pull request #46 from google/include-directive
#include directive support
2015-08-05 10:29:23 -06:00
John Kessenich
61d7d7ad73 Revisioning: Include GLSL.std.450 version. Also, the revision.h script now includes redirection to revision.h. 2015-08-03 12:04:56 -06:00
John Kessenich
0da9eaabe8 Version reporting: Restart active use of revision.h, now based on a git tag.
The new make-revision script regenerates glslang/Include/revision.h,
used as it always has been, but made with a git-tag version and the
the number of commits on master.

I have a pre-commit hook that will automatically do this on master,
likely often enough to work in practice, without needing pull requests
to include it.
2015-08-02 10:21:10 -06:00
Dejan Mircevski
7be4b8282d Add #include processing to glslang (though turned off by default).
When an include directive is recognized by the preprocessor, it
executes a callback on the filepath argument to obtain the file
contents.  That way the compilation client can deal with the file
system, include paths, etc.

Currently only accepts quoted filepaths -- no angle brackets yet.
2015-07-31 19:41:18 -04:00
Andrew Woloszyn
e837f99afb Removed the single usage of exceptions in all of glslang. 2015-07-17 13:31:25 -04:00
Andrew Woloszyn
aae1ad8296 Added error output to the preprocessor.
This patch distinguishes preprocessing errors with normal parsing
errors and gives glslangValidator the ability to output preprocessing
errors.
2015-07-14 16:02:25 -04:00
John Kessenich
68d78fd31e Updated command-line options, adding -o for saving binaries, -G for OpenGL SPIR-V validation, -v etc.
Old uses should still work as they did before.
Also encapsulated use of these flags during parsing, for the parse context.
Added SPIR-V version to -v.
2015-07-12 19:28:10 -06:00
John Kessenich
b329715caf Fix clang static analyzer issues, as reported by floooh. 2015-07-11 18:01:03 -06:00
John Kessenich
140f3df134 Final round for line endings. 2015-06-26 16:58:36 -06:00
John Kessenich
6626cadbad glslang front-end: Don't emit blank lines for empty info logs. From Andrew Woloszyn <awoloszyn@google.com>.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31531 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-06-19 05:14:19 +00:00
John Kessenich
c555dddd53 glslang preprocessing: Add -E option to print out preprocessed GLSL, and do the work needed to generate a preprocessed stream. From Andrew Woloszyn <awoloszyn@google.com>.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31508 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-06-17 02:38:44 +00:00
John Kessenich
fae38ee277 glslang portability: Fixed a slew of OSX compilation warnings (but not all).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31469 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-06-10 23:23:12 +00:00
John Kessenich
79eaa91e6f glslang portability: Resolve OSX errors, some other OS warnings.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31468 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-06-10 22:05:48 +00:00
John Kessenich
01685c3ff8 SPV compression: Final check-in enabling this on MSVC 2012. All compression submissions from Steve (spvremapper@lunarg.com).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31236 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-05-20 16:04:17 +00:00
John Kessenich
3c4a276282 SPIR-V compression: Requires rerunning CMake. Adds a standalone tool for running the SPV compression.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31232 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-05-19 21:07:04 +00:00
John Kessenich
ca3457f1a7 glslang: Fix a few more warnings, and see it using nullptr causes anyone problems (testing c++11 portability).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31218 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-05-18 01:59:45 +00:00
John Kessenich
93dfbe1309 glslang: Fix over 100 warnings from MSVC warning level 4.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31202 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-05-15 17:30:55 +00:00
John Kessenich
2aa7f3a671 SPV compression: Remove file/path manipulation stuff, setting up for that to be a separate tool. Added copyright messages as well.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31201 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-05-15 16:02:07 +00:00
John Kessenich
ccc7acc969 SPIR-V compression: restore a line of code deleted by the previous submission.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31181 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-05-13 20:53:52 +00:00
John Kessenich
4217d2ea22 SPIR-V compression: Add stripping and remapping tools for compressibility of generated SPIR-V.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31180 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-05-13 20:38:44 +00:00
John Kessenich
acba77200b glslang: Add SPIR-V human readable form. (Use -H.)
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@30038 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-03-04 03:48:38 +00:00
John Kessenich
0df0cdeeeb glslangValidator: Add straightforward SPIR-V support (non-optimizing, ~3.x functionality).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@30032 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2015-03-03 17:09:43 +00:00
John Kessenich
3ce4e59090 Increase portability. (Submission from Nikita Kindt, as were some recent related submissions.)
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@28444 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-10-06 19:57:34 +00:00
John Kessenich
167b6d1b30 Remove dead call.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@28368 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-10-01 01:08:21 +00:00
John Kessenich
fccfb5a90e Remove unneeded skeletal work.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@28345 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-09-28 18:43:52 +00:00
John Kessenich
cf74ae1b2d Have memory counters normally turned off, to avoid cross-windows-platform linking problems.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@28078 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-09-12 17:25:16 +00:00
John Kessenich
01fd50e4f2 Add option for printing documentation (empty).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@27966 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-09-08 21:01:09 +00:00
John Kessenich
d78e3512ac Minor change in command-line options.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@27840 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-08-25 20:07:55 +00:00
John Kessenich
a7a68a9b32 Non-functional misc. changes. Slight increase in performance from moving two performance path methods into a header.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@27835 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-08-24 18:21:00 +00:00
John Kessenich
da66bc7d29 Implement write-only semantic checking, the non-r32f/i/u readonly/writeonly check, and ES 3.1 support of volatile. Also, fix a typo in MaxComputeGroupY.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@27765 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-08-19 20:32:48 +00:00
John Kessenich
d6c72a44ab A patch submitted for MinGW building.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@27757 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-08-18 19:42:35 +00:00
John Kessenich
26ad268037 Add -d option for desktop default for missing #version.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@27729 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-08-13 20:17:19 +00:00
John Kessenich
cd77f8e922 Implement GL_ARB_shader_texture_image_samples. Also add in gl_MaxSamples and the float imageAtomicExchange.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@27721 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-08-13 16:54:02 +00:00
John Kessenich
699684180f Implement cull distances for GLSL 4.5 (but not as an extension yet, just a 4.5 feature).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@27714 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-08-13 06:37:59 +00:00
John Kessenich
ddea678e3e Implement GL_ARB_shader_image_load_store. Partly done (format layout qualifiers) from a submission.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@27670 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-08-10 18:19:36 +00:00
John Kessenich
92f9038388 Create dummy side project.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@27519 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-07-28 04:21:04 +00:00
John Kessenich
fd30542a0f Non-functional trivial clean up.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26972 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-06-05 16:30:53 +00:00
John Kessenich
fde703438f CMake: Collapse into a single library all the libraries under the glslang directory, and represent the proper hierarchy in MSVS. There are still a total of 3 libraries to link against: glslang, OGLCompiler, and OSDependent.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26137 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-03-31 00:06:32 +00:00
John Kessenich
585982e32a Add getStage() and getIntermediate() methods for consumers. Also removed dead options and update test file.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26126 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-03-28 17:49:10 +00:00
John Kessenich
0af1e7c608 Allow selection of the "Platform Toolset", so that XP binaries can be built.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25952 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-03-17 23:56:45 +00:00
John Kessenich
3ce1058dbe update Linux build for latest CMake changes from Windows
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25793 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-03-11 06:35:42 +00:00
John Kessenich
d18e2d8adc Add CMake support for Visual Studio and installation, with an expected "install" for CMAKE_INSTALL_PREFIX, and updated test scripts to consume the CMake installation.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25791 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-03-11 02:10:26 +00:00
John Kessenich
35f04bde8a Make 64-bit VS compile clean. Mostly size_t vs. int tweaks.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25411 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-02-19 02:47:20 +00:00
John Kessenich
8922da24a4 Check in a much improved submitted set of makefiles for Linux builds. This eliminates dependencies on system headers, and generally simplifies the makefiles.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25408 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-02-19 01:00:58 +00:00
John Kessenich
0547c2a6bb Add submitted CMake files for Linux builds. All existing ways of building remain in tact.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25403 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-02-19 00:18:25 +00:00
John Kessenich
6494baf371 Check-in a couple submitted char* string portability bug fixes: correct sizing of buffers and stop overwriting preprocessor token names with themselves.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25402 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-02-19 00:08:59 +00:00
John Kessenich
51cdd90fa8 Fix the few non-portable uses of "char" (where a -1 might be relevant): All uses of char are now either "int", "unsigned char" or char arrays for storing strings. Also, went to consistent "char* foo" coding convention. (There were only a few ambiguous uses.)
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25400 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-02-18 23:37:57 +00:00
John Kessenich
c7776ec3fd GL_ARB_enhanced_layouts, part 4: Numerical side of xfb_*: offset computation, size computation, alias detection, paddings, overflow, implicit strides, gl_Max* checks, etc.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25014 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2014-01-26 01:37:13 +00:00
John Kessenich
623833fabc Tessellation partial implementation (not ready for use yet), including:
- the built-in constants
 - built-in variable declarations, some dependent on gl_MaxPatchVertices
 - layout qualifier for vertices (shared with geometry shader max_vertices)
 - layout qualifiers for vertex spacing, vertex order, point mode, and primitive type
 - link semantics for layout qualifiers

Still TBD:
 - patch qualifier and arrayed input handling
 - sizing of gl_out[]
 - additional semantic checking
 - supporting the extension on version 150

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24468 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-11 18:57:40 +00:00
John Kessenich
319de233dc Add a versioning system and tie it to the -v command-line option. System is described in glslang/Include/revision.template.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24314 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-12-04 04:43:40 +00:00
John Kessenich
bf63ef05d9 Add GetEsslVersionString() and GetGlslVersionString().
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24054 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-14 00:16:43 +00:00
John Kessenich
c999ba2816 Complete hook up all the compile/link errors to the command-line exit status. (Also, an updated test left from the last check-in.)
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23961 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-07 23:33:24 +00:00
John Kessenich
b0a7eb599b Stop emitting the "#version missing" warning, and hook up the existing "suppress warnings" to a command-line option (-w).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23952 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-07 17:44:20 +00:00
John Kessenich
11f9fc7247 Add and partially implement an interface for doing uniform reflection. It includes an AST traversal to identify live accesses.
It does not yet correctly compute block offsets, give correct GL-API-style type values, or handle arrays.

This is tied to the new -q flag.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23938 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-07 01:06:34 +00:00
John Kessenich
c36e1d8e51 Interface and naming improvements:
- the new C++ style interface now stands on its own, with the addition of glslang::InitializeProcess() and glslang::FinalizeProcess()
 - more "global" pool names from a decade ago are fixed to be thread names
 - StandAlone.cpp fully uses one of the old-style interface or new C++ style interface


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23851 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-01 17:41:52 +00:00
John Kessenich
5b0f13acbc Include per-shader and per-program pools in the new C++ interface to glslang. (And picked up missing test result from previous check in.)
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23844 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-11-01 03:08:40 +00:00
John Kessenich
ea869fb403 Improve preprocessor by using GLSL scanner, allowing read-only strings to be compiled, unifying of line # tracking, and correct detection that ES #version appeared after a comment.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23721 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-28 18:12:06 +00:00
John Kessenich
284231c9c5 Add built-in constants through version 440. Some still need to be consumed when initializing the symbol table.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23634 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-22 01:50:39 +00:00
John Kessenich
e7c59c187c Add all built-in variables for all versions/profiles/stages of GLSL. Also, made more readable; declarations are cut and paste from the specs, with quotes around them. This does not include built-in constants yet (other than MaxClipDistances), just the non-constants.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23551 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-16 22:28:35 +00:00
John Kessenich
4c70685382 Memory management hygiene: Use compare() instead of substr(), and put a few more things intrinsically in the memory pool.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23467 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-11 16:28:43 +00:00
John Kessenich
a5830dfc0e Add the following ESSL 2.0 (#version 100) limitations to the configuration file, internal infrastructure, and test cases. Still need to implement the actual detection of non-inductive loops and array accesses. While and do-while loop detection is done.
nonInductiveForLoops
whileLoops
doWhileLoops
generalUniformIndexing
generalAttributeMatrixVectorIndexing
generalVaryingIndexing
generalSamplerIndexing
generalVariableIndexing
generalConstantMatrixVectorIndexing


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23323 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-10-02 05:10:48 +00:00
John Kessenich
05a7063007 Add optional configuration file for specifying (existing) limits. Details explained by usage statement. More limits to be added in the future.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23105 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-09-17 19:26:08 +00:00
John Kessenich
38f3b890de Ensure the shared symbol table levels are read-only to make multi-threading safe. Also removed inadvertent extra copies of the symbol table shared across all stages.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22939 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-09-06 19:52:57 +00:00
John Kessenich
69f4b517c2 Add link validation infrastructure for multiple compilation units per stage. Includes a new, straightforward, C++ interface to the front end.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22927 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-09-04 21:19:27 +00:00
John Kessenich
94a81fbd31 Option rationalization and minor clean up.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22907 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-08-31 02:41:30 +00:00
John Kessenich
b603f918a4 Put all glslang internals (but not the external interface) into the glslang namespace.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22882 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-08-29 00:39:25 +00:00
John Kessenich
c027579631 Put in infrastructure for tessellation, geometry, and compute stages, and partially flesh out with built-in functions.
Added the built-in functions EmitVertex(), EndPrimitive(), barrier(), memoryBarrier(), memoryBarrierAtomicCounter(), memoryBarrierBuffer(), memoryBarrierImage(), memoryBarrierShared(), and groupMemoryBarrier().

Have not added any new built-in variables.

Also changed the linear performance relateToOperator() to a high-performance version.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22659 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-08-09 17:14:49 +00:00
John Kessenich
4586dbdc1b Track expected test results and add more README information.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22602 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-08-05 15:52:03 +00:00
John Kessenich
54f6e5661d Set up infrastructure for installing an executable. Changes the standalone name to glslangValidator.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22593 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-08-03 00:04:10 +00:00
John Kessenich
ee6a9c8ba8 Make previous check in compile correctly on linux.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22568 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-07-31 23:19:17 +00:00
John Kessenich
2b07c7e70a Improve multi-threading and move Standalone to a multi-threading model (currently off though).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22565 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-07-31 18:44:13 +00:00
John Kessenich
e0ab8db923 Final linux tweak.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22294 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-07-08 21:50:31 +00:00
John Kessenich
3a05b78826 A few linux improvements/fixes for the previous check in.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22292 e7fa87d3-cd2b-0410-9028-fcbf551c1848
2013-07-08 20:51:29 +00:00