John Kessenich [Thu, 12 Jan 2017 23:51:18 +0000 (16:51 -0700)]
HLSL: matrix swizzle (_12, _m23) syntax, partial semantics.
This partially addressess issue #670, for when the matrix swizzle
degenerates to a component or column: m[c], m[c][r] (where HLSL
swaps rows and columns for user's view).
An error message is given for the arbitrary cases not covered.
These cases will work for arbitrary use of l-values.
Future work will handle more arbitrary swizzles, which might
not work as arbitrary l-values.
John Kessenich [Thu, 12 Jan 2017 19:00:59 +0000 (12:00 -0700)]
PP: Clean up and rationalize floating-point-number scanner.
This encapsulates where the string could overflow, removing 40 lines
of fragile code. It also improves handling of numbers that are too long.
There are a couple of open issues that could related to this function
being more rational (locale dependence, 1.#INF).
John Kessenich [Thu, 12 Jan 2017 17:18:23 +0000 (10:18 -0700)]
Merge pull request #664 from steve-lunarg/stage-io-fix
add other builtins to interstage IO
John Kessenich [Wed, 11 Jan 2017 21:50:16 +0000 (14:50 -0700)]
Infrastructure: Support standard build with ENABLE_HLSL set to off.
John Kessenich [Wed, 11 Jan 2017 21:24:56 +0000 (14:24 -0700)]
Infrastructure: Protect against missing built-in symbol table generators.
John Kessenich [Wed, 11 Jan 2017 01:49:07 +0000 (18:49 -0700)]
Merge pull request #663 from KhronosGroup/full-include-semantics
Includer interface change to support full include semantics (requires downstream changes)
John Kessenich [Tue, 10 Jan 2017 01:52:55 +0000 (18:52 -0700)]
Merge pull request #668 from slime73/DisableHLSL
Add a CMake option to disable compilation of HLSL input support.
Alex Szpakowski [Mon, 9 Jan 2017 22:10:14 +0000 (18:10 -0400)]
Change disabled-by-default DISABLE_HLSL option to enabled-by-default ENABLE_HLSL.
Matches existing options.
steve-lunarg [Sat, 7 Jan 2017 16:07:14 +0000 (09:07 -0700)]
WIP: add other builtins to interstage IO
(Still adding tests: do not commit)
This fixes PR #632 so that:
(a) The 4 PerVertex builtins are added to an interface block for all stages except fragment.
(b) Other builtin qualified variables are added as "loose" linkage members.
(c) Arrayness from the PerVertex builtins is moved to the PerVertex block.
(d) Sometimes, two PerVertex blocks are created, one for in, one for out (e.g, for some GS that
both reads and writes a Position)
Alex Szpakowski [Mon, 9 Jan 2017 01:20:25 +0000 (21:20 -0400)]
Add a CMake option to disable compilation of HLSL input support.
John Kessenich [Sun, 8 Jan 2017 23:11:24 +0000 (16:11 -0700)]
Merge pull request #667 from slime73/Compiler-Warnings
Address several compiler warnings
Alex Szpakowski [Sun, 8 Jan 2017 22:21:17 +0000 (18:21 -0400)]
Reorder initializer fields to match variable declaration order (or vice versa) for several class constructors.
Alex Szpakowski [Sun, 8 Jan 2017 21:57:21 +0000 (17:57 -0400)]
Add a virtual destructor to a class which has virtual methods.
Alex Szpakowski [Sun, 8 Jan 2017 21:54:48 +0000 (17:54 -0400)]
Mark an overriden method in a subclass with ‘override’.
John Kessenich [Fri, 6 Jan 2017 23:48:18 +0000 (16:48 -0700)]
PP #include: address PR feedback.
John Kessenich [Fri, 6 Jan 2017 22:01:48 +0000 (15:01 -0700)]
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
John Kessenich [Fri, 6 Jan 2017 21:54:18 +0000 (14:54 -0700)]
PP #include non-functional: consistent notation for "header" and "header name".
This is versus a variety of file-related language, designated, requested, etc.
Will simplify diffs for next commit.
John Kessenich [Fri, 6 Jan 2017 19:34:14 +0000 (12:34 -0700)]
Non-functional: White space after "//", mostly for copyrights.
John Kessenich [Fri, 6 Jan 2017 07:34:48 +0000 (00:34 -0700)]
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
John Kessenich [Fri, 6 Jan 2017 07:32:39 +0000 (00:32 -0700)]
Merge pull request #661 from KhronosGroup/fix-include-error-paths
PP: #include: simplify the different paths out of #include.
John Kessenich [Thu, 5 Jan 2017 20:32:52 +0000 (13:32 -0700)]
PP: #include: simplify the different paths out of #include.
- some paths didn't release 'res'
- token is always '\n' after proper acceptance of the directive itself,
so no need to test it, change it to '\n', etc.
- assuming setCurrentColumn(0) is not needed unless there are header tokens,
but not clear why it is ever needed
Note: much of the simplified code read as if the included header tokens had
actually been processed, versus queued up for processing; maybe that explains
some things.
John Kessenich [Thu, 5 Jan 2017 19:18:34 +0000 (12:18 -0700)]
PP: #include: add names to error messages, so that lexical analysis can be tested.
John Kessenich [Thu, 5 Jan 2017 17:45:32 +0000 (10:45 -0700)]
Non-functional: Very minor clean up.
John Kessenich [Thu, 5 Jan 2017 17:40:14 +0000 (10:40 -0700)]
Merge pull request #650 from steve-lunarg/lvalue-swizzle-fix
HLSL: allow destination swizzles when writing RWTexture/RWBuffer
John Kessenich [Thu, 5 Jan 2017 17:28:26 +0000 (10:28 -0700)]
HLSL: Fix issue #658: Don't adopt initializer constness from declaration.
This also makes it match how GLSL handles the same thing.
John Kessenich [Wed, 4 Jan 2017 21:07:34 +0000 (14:07 -0700)]
Merge pull request #648 from steve-lunarg/type-identifiers
HLSL: allow type keywords as identifiers, and add half type
John Kessenich [Wed, 4 Jan 2017 18:41:36 +0000 (11:41 -0700)]
Merge pull request #632 from steve-lunarg/structure-splitting
HLSL: inter-stage structure splitting.
John Kessenich [Tue, 3 Jan 2017 22:34:33 +0000 (15:34 -0700)]
Merge pull request #659 from steve-lunarg/d3dcolortoubyte4
Add D3DCOLORtoUBYTE4 decomposition
John Kessenich [Tue, 3 Jan 2017 22:30:05 +0000 (15:30 -0700)]
Merge pull request #647 from steve-lunarg/default-fn-params
HLSL: default function parameters
steve-lunarg [Tue, 3 Jan 2017 21:42:18 +0000 (14:42 -0700)]
Add EOpD3DCOLORtoUBYTE4 decomposition
John Kessenich [Tue, 3 Jan 2017 03:12:08 +0000 (20:12 -0700)]
PP: Recognize <> style #include header names. I.e., #include <header-name>.
Also correctly test and handle missing newline.
steve-lunarg [Wed, 28 Dec 2016 17:03:58 +0000 (10:03 -0700)]
HLSL: allow destination swizzles when writing RWTexture/RWBuffer objects.
Reads and write syntax to UAV objects is turned into EOpImageLoad/Store
operations. This translation did not support destination swizzles,
for example, "mybuffer[tc].zyx = 3;", so such statements would fail to
compile. Now they work.
Parial updates are explicitly prohibited.
New test: hlsl.rw.swizzle.frag
John Kessenich [Tue, 3 Jan 2017 00:56:08 +0000 (17:56 -0700)]
PP: Fix issue #426, recover from bad-source macro expansion.
John Kessenich [Tue, 3 Jan 2017 00:01:21 +0000 (17:01 -0700)]
SPV: Fix issue #369, don't support gl_NumSamples -> SPIR-V.
John Kessenich [Mon, 2 Jan 2017 21:59:19 +0000 (14:59 -0700)]
HLSL: Fix issue #646: map SV_DispatchThreadID -> GlobalInvocationID.
John Kessenich [Fri, 30 Dec 2016 23:42:57 +0000 (16:42 -0700)]
HLSL: Handle const with no initializer. Fixes issue #651.
John Kessenich [Fri, 30 Dec 2016 22:59:28 +0000 (15:59 -0700)]
HLSL: Support empty {} initializers for arrays and scalars.
steve-lunarg [Sat, 24 Dec 2016 01:56:57 +0000 (18:56 -0700)]
HLSL default function parameters
This PR adds support for default function parameters in the following cases:
1. Simple constants, such as void fn(int x, float myparam = 3)
2. Expressions that can be const folded, such a ... myparam = sin(some_const)
3. Initializer lists that can be const folded, such as ... float2 myparam = {1,2}
New tests are added: hlsl.params.default.frag and hlsl.params.default.err.frag
(for testing error situations, such as ambiguity or non-const-foldable).
In order to avoid sampler method ambiguity, the hlsl better() lambda now
considers sampler matches. Previously, all sampler types looked identical
since only the basic type of EbtSampler was considered.
steve-lunarg [Tue, 27 Dec 2016 01:45:52 +0000 (18:45 -0700)]
HLSL: allow scalar type keywords as identifiers, and add half type support.
HLSL allows type keywords to also be identifiers, so a sequence such as "float half = 3" is
valid, or more bizzarely, something like "float.float = int.uint + bool;"
There are places this is not supported. E.g, it's permitted for struct members, but not struct
names or functions. Also, vector or matrix types such as "float3" are not permitted as
identifiers.
This PR adds that support, as well as support for the "half" type. In production shaders,
this was seen with variables named "half". The PR attempts to support this without breaking
useful grammar errors such as "; expected" at the end of unterminated statements, so it errs
on that side at the possible expense of failing to accept valid constructs containing a type
keyword identifier. If others are discovered, they can be added.
Also, half is now accepted as a valid type, alongside the min*float types.
steve-lunarg [Mon, 19 Dec 2016 22:48:01 +0000 (15:48 -0700)]
HLSL: struct splitting: assignments of hierarchical split types
This commit adds support for copying nested hierarchical types of split
types. E.g, a struct of a struct containing both user and builtin interstage
IO variables.
When copying split types, if any subtree does NOT contain builtin interstage
IO, we can copy the whole subtree with one assignment, which saves a bunch
of AST verbosity for memberwise copies of that subtree.
steve-lunarg [Wed, 14 Dec 2016 22:22:25 +0000 (15:22 -0700)]
HLSL: inter-stage structure splitting.
This adds structure splitting, which among other things will enable GS support where input structs
are passed, and thus become input arrays of structs in the GS inputs. That is a common GS case.
The salient points of this PR are:
* Structure splitting has been changed from "always between stages" to "only into the VS and out of
the PS". It had previously happened between stages because it's not legal to pass a struct
containing a builtin IO variable.
* Structs passed between stages are now split into a struct containing ONLY user types, and a
collection of loose builtin IO variables, if any. The user-part is passed as a normal struct
between stages, which is valid SPIR-V now that the builtin IO is removed.
* Internal to the shader, a sanitized struct (with IO qualifiers removed) is used, so that e.g,
functions can work unmodified.
* If a builtin IO such as Position occurs in an arrayed struct, for example as an input to a GS,
the array reference is moved to the split-off loose variable, which is given the array dimension
itself.
When passing things around inside the shader, such as over a function call, the the original type
is used in a sanitized form that removes the builtIn qualifications and makes them temporaries.
This means internal function calls do not have to change. However, the type when returned from
the shader will be member-wise copied from the internal sanitized one to the external type.
The sanitized type is used in variable declarations.
When copying split types and unsplit, if a sub-struct contains only user variables, it is copied
as a single entity to avoid more AST verbosity.
Above strategy arrived at with talks with @johnkslang.
This is a big complex change. I'm inclined to leave it as a WIP until it can get some exposure to
real world cases.
John Kessenich [Thu, 22 Dec 2016 00:40:29 +0000 (17:40 -0700)]
Merge pull request #640 from chaoc/modify-shader-ballot
Modify shader ballot extension by adding OpSubgroupReadInvocationKHR
John Kessenich [Wed, 21 Dec 2016 20:49:16 +0000 (13:49 -0700)]
PP: Non-functional: Make a proper class out of the atom <-> string mapping.
chaoc [Tue, 20 Dec 2016 20:44:35 +0000 (12:44 -0800)]
Modify shader ballot extension by adding OpSubgroupReadInvocationKHR
John Kessenich [Wed, 21 Dec 2016 19:32:56 +0000 (12:32 -0700)]
PP: Support operator creation with token pasting.
John Kessenich [Wed, 21 Dec 2016 18:55:53 +0000 (11:55 -0700)]
PP: Rationalize names of tokens.
John Kessenich [Wed, 21 Dec 2016 17:59:07 +0000 (10:59 -0700)]
Merge pull request #641 from chaoc/passthrough
Add support for SPV_NV_geometry_shader_passthrough
John Kessenich [Wed, 21 Dec 2016 17:50:33 +0000 (10:50 -0700)]
Merge pull request #644 from hrydgard/override-warning-fixes
Fix a large number of Clang warnings about inconsistent usage of 'override'
Henrik Rydgård [Wed, 21 Dec 2016 11:48:08 +0000 (12:48 +0100)]
Fix a large number of warnings about inconsistent usage of 'override' produced by clang
John Kessenich [Wed, 21 Dec 2016 04:47:30 +0000 (21:47 -0700)]
PP: Non-functional: Only use string <-> atom mapping when needed.
Also, eliminate the 'atom' field of TPpToken.
Parsing a real 300 line shader, through to making the AST, is about 10% faster.
Memory is slightly reduced (< 1%).
The whole google-test suite, inclusive of all testing overhead, SPIR-V generation,
etc., runs 3% faster.
Since this is a code *simplification* that leads to perf. improvement, I'm not
going to invest too much more in measuring the perf. than this. The PP code is
simply now in a better state to see how to further rationalize/improve it.
John Kessenich [Wed, 21 Dec 2016 02:42:53 +0000 (19:42 -0700)]
PP: Non-functional: rationalize TPpToken.
Always keep 'token' outside.
Always return the string to upper levels inside.
John Kessenich [Tue, 20 Dec 2016 18:10:09 +0000 (11:10 -0700)]
PP: Non-functional: clean up, simplify, completely identical operation.
chaoc [Tue, 20 Dec 2016 21:28:52 +0000 (13:28 -0800)]
Add support for SPV_NV_geometry_shader_passthrough
John Kessenich [Tue, 20 Dec 2016 18:02:11 +0000 (11:02 -0700)]
Merge pull request #639 from hrydgard/master
CMake: Add option to make it possible to not build the executables
John Kessenich [Tue, 20 Dec 2016 18:01:21 +0000 (11:01 -0700)]
Merge pull request #638 from chaoc/master
Add support for SPV_NV_sample_mask_override_coverage
John Kessenich [Tue, 20 Dec 2016 04:57:06 +0000 (21:57 -0700)]
PP: Non-functional: Remove custom allocator and related improvements.
Removed the preprocesser memory pool.
Removed extra copies and unnecessary allocations of objects related to the ones
that were using the pool.
Replaced some allocated pointers with objects instead, generally using more
modern techiques. There end up being fewer memory allocations/deletions to get right.
Overall combined effect of all changes is to use slightly less memory and
run slightly faster (< 1% for both, but noticable).
As part of simplifying the code base, this change makes it easier to see
PP symbol tracking, which I suspect has an even bigger run-time simplification
to make.
Henrik Rydgård [Tue, 20 Dec 2016 00:56:00 +0000 (01:56 +0100)]
Add option to make it possible not to build the executables
John Kessenich [Mon, 19 Dec 2016 22:32:04 +0000 (15:32 -0700)]
PP: Add missing i64val code.
Also, checking both 'atom' and 'name' is redundant, and I'm hoping to
eliminate more atom stuff.
chaoc [Tue, 20 Dec 2016 00:29:34 +0000 (16:29 -0800)]
Add support for SPV_NV_sample_mask_override_coverage
chaoc [Tue, 20 Dec 2016 00:21:14 +0000 (16:21 -0800)]
Merge remote-tracking branch 'refs/remotes/KhronosGroup/master'
John Kessenich [Mon, 19 Dec 2016 21:43:42 +0000 (14:43 -0700)]
Build: Fix #633, add missing overrides.
John Kessenich [Mon, 19 Dec 2016 21:31:57 +0000 (14:31 -0700)]
Merge pull request #637 from KhronosGroup/token-paste
PP: Implement token pasting for PP identifiers.
John Kessenich [Mon, 19 Dec 2016 21:07:58 +0000 (14:07 -0700)]
Merge pull request #624 from steve-lunarg/remapper-strip-removed
WIP: Remapper: remove debug info for IDs stripped in other passes
John Kessenich [Mon, 19 Dec 2016 20:30:29 +0000 (13:30 -0700)]
Merge pull request #635 from steve-lunarg/sample-fix-2
HLSL: allow "sample" in expressions.
John Kessenich [Mon, 19 Dec 2016 20:30:06 +0000 (13:30 -0700)]
Merge pull request #625 from jbeich/gcc6
Unbreak build on FreeBSD with GCC/libstdc++ 6.2.0
John Kessenich [Mon, 19 Dec 2016 16:19:43 +0000 (09:19 -0700)]
PP: Implement token pasting for PP identifiers.
Implement token pasting as per the C++ specification, within the current
style of the PP code.
Non-identifiers (turning 12 ## 10 into the numeral 1210) is not yet covered;
they should be a simple incremental change built on this one.
Addresses issue #255.
steve-lunarg [Mon, 19 Dec 2016 00:51:14 +0000 (17:51 -0700)]
HLSL: allow "sample" in expressions.
Unlike other qualifiers, HLSL allows "sample" to be either a qualifier keyword or an
identifier (e.g, a variable or function name).
A fix to allow this was made a while ago, but that fix was insufficient when 'sample'
was used in an expression. The problem was around the initial ambiguity between:
sample float a; // "sample" is part of a fully specified type
and
sample.xyz; // sample is a keyword in a dot expression
Both start the same. The "sample" was being accepted as a qualifier before enough
further parsing was done to determine we were not a declaration after all. This
consumed the token, causing it to fail for its real purpose.
Now, when accepting a fully specified type, the token is pushed back onto the stack if
the thing is not a fully specified type. This leaves it available for subsequent
purposes.
Changed the "hlsl.identifier.sample.frag" test to exercise this situation, distilled
down from a production shaders.
John Kessenich [Sat, 17 Dec 2016 00:11:18 +0000 (17:11 -0700)]
Fix comment typo.
John Kessenich [Thu, 15 Dec 2016 00:02:32 +0000 (17:02 -0700)]
HLSL: More robust handling of bad shader input, catching a few more things.
John Kessenich [Wed, 14 Dec 2016 22:15:41 +0000 (15:15 -0700)]
Merge pull request #629 from null77/fix-unicode
Change unicode dash to ASCII.
Jamie Madill [Wed, 14 Dec 2016 20:48:56 +0000 (15:48 -0500)]
Change unicode dash to ASCII.
This change is helpful for integration with Chromium, which recently
added a compiler option to warn when compiling any source files which
use extended characters. In this case the offending character was a
single unicode dash in a comment.
John Kessenich [Wed, 14 Dec 2016 02:32:01 +0000 (19:32 -0700)]
Merge pull request #628 from null77/fix-cast-warn
Fix size_t to int cast warnings.
Jamie Madill [Tue, 13 Dec 2016 22:30:58 +0000 (17:30 -0500)]
Fix size_t to int cast warnings.
Several instances in Visual Studio 2015:
warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
John Kessenich [Mon, 12 Dec 2016 18:41:43 +0000 (11:41 -0700)]
Fix last commit; EOptionKeepUncalled incorrect enum bug.
steve-lunarg [Fri, 9 Dec 2016 18:13:23 +0000 (11:13 -0700)]
Remapper: remove debug info for IDs stripped in other passes
If some DCE is performed such as removing dead functions, then even
if we are NOT stripping debug info, we still must remove the debug
opcodes that refer to the now-dead IDs.
Also, this adds a small change to perform no ID remapping if none
is requested, making spirv-remap properly be a no-op if no options
are given.
John Kessenich [Sat, 10 Dec 2016 02:22:20 +0000 (19:22 -0700)]
Linker: Eliminate uncalled functions, because they can be ill-defined.
Fixes issue #610. Also provides a testing option to keep uncalled functions.
John Kessenich [Sat, 10 Dec 2016 00:29:07 +0000 (17:29 -0700)]
Linker: Track the mangled entry-point name along with the non-mangled one.
John Kessenich [Sat, 10 Dec 2016 00:14:27 +0000 (17:14 -0700)]
GLSL Linker: Track entry point across compilation units.
This wasn't needed until the recent generalization of "main" to "entry point",
so makes some HLSL-specific code be generic now, for GLSL functional correctness.
Jan Beich [Fri, 9 Dec 2016 03:32:01 +0000 (03:32 +0000)]
Add missing header and drop duplicate one
In file included from C:/Projects/glslang/glslang/MachineIndependent/glslang.y:59:0:
glslang/MachineIndependent/ParseHelper.h:276:24: error: 'va_list' has not been declared
va_list args);
^~~~~~~
John Kessenich [Fri, 9 Dec 2016 04:01:59 +0000 (21:01 -0700)]
Linker: Walk the call graph to report an error on missing bodies.
John Kessenich [Thu, 8 Dec 2016 18:18:07 +0000 (11:18 -0700)]
Merge pull request #621 from steve-lunarg/recursive-flattening
HLSL: Recursive composite flattening
John Kessenich [Thu, 8 Dec 2016 18:17:21 +0000 (11:17 -0700)]
Merge pull request #619 from steve-lunarg/opcode-specific-promote
HLSL: opcode specific promotion rules for interlocked ops
John Kessenich [Thu, 8 Dec 2016 18:15:59 +0000 (11:15 -0700)]
Merge pull request #620 from fjhenigman/foo
GLSL: Always define TShader::~Includer().
steve-lunarg [Tue, 29 Nov 2016 00:09:54 +0000 (17:09 -0700)]
HLSL: Recursive composite flattening
This PR implements recursive type flattening. For example, an array of structs of other structs
can be flattened to individual member variables at the shader interface.
This is sufficient for many purposes, e.g, uniforms containing opaque types, but is not sufficient
for geometry shader arrayed inputs. That will be handled separately with structure splitting,
which is not implemented by this PR. In the meantime, that case is detected and triggers an error.
The recursive flattening extends the following three aspects of single-level flattening:
- Flattening of structures to individual members with names such as "foo[0].samp[1]";
- Turning constant references to the nested composite type into a reference to a particular
flattened member.
- Shadow copies between arrays of flattened members and the nested composite type.
Previous single-level flattening only flattened at the shader interface, and that is unchanged by this PR.
Internally, shadow copies are, such as if the type is passed to a function.
Also, the reasons for flattening are unchanged. Uniforms containing opaque types, and interface struct
types are flattened. (The latter will change with structure splitting).
One existing test changes: hlsl.structin.vert, which did in fact contain a nested composite type to be
flattened.
Two new tests are added: hlsl.structarray.flatten.frag, and hlsl.structarray.flatten.geom (currently
issues an error until type splitting is online).
The process of arriving at the individual member from chained postfix expressions is more complex than
it was with one level. See large-ish comment above HlslParseContext::flatten() for details.
steve-lunarg [Tue, 6 Dec 2016 22:50:11 +0000 (15:50 -0700)]
HLSL: opcode specific promotion rules for interlocked ops
PR #577 addresses most but not all of the intrinsic promotion problems.
This PR resolves all known cases in the remainder.
Interlocked ops need special promotion rules because at the time
of function selection, the first argument has not been converted
to a buffer object. It's just an int or uint, but you don't want
to convert THAT argument, because that implies converting the
buffer object itself. Rather, you can convert other arguments,
but want to stay in the same "family" of functions. E.g, if
the first interlocked arg is a uint, use only the uint family,
never the int family, you can convert the other args as you please.
This PR allows making such opcode and arg specific choices by
passing the op and arg to the convertible lambda. The code in
the new test "hlsl.promote.atomic.frag" would not compile without
this change, but it must compile.
Also, it provides better handling of downconversions (to "worse"
types), which are permitted in HLSL. The existing method of
selecting upconversions is unchanged, but if that doesn't find
any valid ones, then it will allow downconversions. In effect
this always uses an upconversion if there is one.
Frank Henigman [Tue, 6 Dec 2016 21:35:12 +0000 (16:35 -0500)]
GLSL: Always define TShader::~Includer().
Rather than update the existing ifdef to cover all necessary cases,
get rid of it and always define TShader::~Includer().
John Kessenich [Tue, 6 Dec 2016 07:48:11 +0000 (00:48 -0700)]
Merge pull request #615 from dneto0/consistent-location-for-test-files
runtests should refer to test files in current directory
John Kessenich [Tue, 6 Dec 2016 04:36:48 +0000 (21:36 -0700)]
GLSL: Allow desktop shaders to call functions from outside main().
Fixes issue #239.
John Kessenich [Mon, 5 Dec 2016 17:25:02 +0000 (10:25 -0700)]
Merge pull request #613 from Corillian/hlslpreprocess
Fixed processing #include's when preprocessing HLSL
David Neto [Mon, 5 Dec 2016 16:30:02 +0000 (11:30 -0500)]
runtests should refer to test files in current directory
Recently added entry point renaming file referred to
test source file hlsl.entry.rename.frag via relative directory.
Change it to be consistent with other tests: assume test
sources are in the current directory.
Keith Newton [Sun, 4 Dec 2016 22:07:10 +0000 (17:07 -0500)]
Fixed processing #include's when preprocessing HLSL
John Kessenich [Sat, 3 Dec 2016 20:58:46 +0000 (13:58 -0700)]
Don't print the "Linked stage" message unless the AST is being dumped.
John Kessenich [Sat, 3 Dec 2016 20:29:46 +0000 (13:29 -0700)]
Merge branch 'steve-lunarg-intrinsic-promotion'
John Kessenich [Sat, 3 Dec 2016 20:27:22 +0000 (13:27 -0700)]
Merge branch 'intrinsic-promotion' of https://github.com/steve-lunarg/glslang into steve-lunarg-intrinsic-promotion
John Kessenich [Fri, 2 Dec 2016 06:47:49 +0000 (23:47 -0700)]
Merge pull request #604 from steve-lunarg/entry-rename-2
HLSL: allow renaming of shader entry point when creating SPIR-V
steve-lunarg [Mon, 31 Oct 2016 21:13:43 +0000 (15:13 -0600)]
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.
John Kessenich [Mon, 28 Nov 2016 06:00:14 +0000 (23:00 -0700)]
Fix non-Windows build error.
John Kessenich [Mon, 28 Nov 2016 05:51:36 +0000 (22:51 -0700)]
HLSL: Support the constructor idiom "(struct type)0".
This highly leverages the previous commit to handle partial initializers.
John Kessenich [Mon, 28 Nov 2016 00:39:07 +0000 (17:39 -0700)]
HLSL: Support {...} initializer lists that are too short.
John Kessenich [Mon, 28 Nov 2016 00:32:19 +0000 (17:32 -0700)]
Fix crash by returning early from finalCheck() if there is no tree to process.