John Kessenich [Mon, 19 Jun 2017 22:25:44 +0000 (16:25 -0600)]
Non-functional: Attempt to reset Travis error, while adding more nullptr use.
Top of master is listing a test error, not from glslang, but internally
within Travis itself. Seeing if another run gets it to work again.
John Kessenich [Mon, 19 Jun 2017 21:41:11 +0000 (15:41 -0600)]
HLSL: Remove support for named tbuffer/cbuffer. Fixes #939.
John Kessenich [Mon, 19 Jun 2017 21:13:26 +0000 (15:13 -0600)]
HLSL: Non-functional: Make test valid HLSL, and related comments/cleanup.
John Kessenich [Thu, 15 Jun 2017 18:11:37 +0000 (12:11 -0600)]
Merge pull request #917 from KhronosGroup/remove-redundant-locations
Replace #422: Remove the redundant location setting in AST->SPIR-V.
John Kessenich [Thu, 15 Jun 2017 17:10:57 +0000 (11:10 -0600)]
Tests: Fix missing test result.
John Kessenich [Thu, 15 Jun 2017 16:40:49 +0000 (10:40 -0600)]
Standalone: Implement -D and -U for preprocessor macros.
Works for both GLSL and HLSL.
Fixes #87.
John Kessenich [Wed, 14 Jun 2017 23:36:50 +0000 (17:36 -0600)]
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.
John Kessenich [Wed, 14 Jun 2017 21:52:44 +0000 (15:52 -0600)]
Infrastructure: Rationalize command-line options.
Makes alphabetical order, fit in 80 columns, abstract in-option
string argument.
John Kessenich [Wed, 14 Jun 2017 21:02:01 +0000 (15:02 -0600)]
Merge pull request #931 from LoopDawg/scalar-mat-assign
HLSL: fix several issues in mat construction from scalars
LoopDawg [Fri, 9 Jun 2017 20:36:46 +0000 (14:36 -0600)]
HLSL: fix several issues in mat construction from scalars
This fixes:
1. A compilation error when assigning scalars to matricies
2. A semantic error in matrix construction from scalars. This was
initializing the diagonal, where HLSL semantics require the scalar be
replicated to every matrix element.
3. Functions accepting mats can be called with scalars, which will
be shape-converted to the matrix type. This was previously failing
to match the function signature.
NOTE: this does not yet handle complex scalars (a function call,
say) used to construct matricies. That'll be added when the
node replicator service is available. For now, there's an assert.
There's one new test (hlsl.scalar2matrix.frag). An existing test
lsl.type.half.frag changes, because of (2) above, and a negative
test error message changes due to (3) above.
Fixes #923.
John Kessenich [Wed, 14 Jun 2017 16:05:19 +0000 (10:05 -0600)]
Merge pull request #937 from amdrexu/bugfix
SPV: Fix an typo of SPV_AMD_texture_gather_bias_lod
Rex Xu [Wed, 14 Jun 2017 15:09:39 +0000 (23:09 +0800)]
SPV: Fix an typo of SPV_AMD_texture_gather_bias_lod
John Kessenich [Wed, 14 Jun 2017 05:13:10 +0000 (23:13 -0600)]
HLSL: Fix #924: Convert between two different arrays with cast.
John Kessenich [Wed, 14 Jun 2017 04:22:52 +0000 (22:22 -0600)]
HLSL: Recognize types declared as identifiers as identifiers.
E.g., in
float float;
(float) * float;
The "(float)" is not a type cast, it is an expression.
John Kessenich [Mon, 12 Jun 2017 16:41:54 +0000 (10:41 -0600)]
Merge pull request #932 from LoopDawg/warning-fix-1
HLSL: compilation warning fix: no functional change
LoopDawg [Sat, 10 Jun 2017 13:42:03 +0000 (07:42 -0600)]
HLSL: compilation warning fix: no functional change
One liner to eliminate a compile warning.
John Kessenich [Fri, 9 Jun 2017 18:51:03 +0000 (12:51 -0600)]
Merge branch 'amdrexu-feature'
Rex Xu [Fri, 24 Mar 2017 05:41:14 +0000 (13:41 +0800)]
Implement extension GL_AMD_gpu_shader_int16
- Add int16 types (int16_t, uint16_t, i16vec, u16vec).
- Add int16 support to GLSL operators.
- Add int16 type conversions (to int16, from int16).
- Add int16 built-in functions.
John Kessenich [Thu, 8 Jun 2017 23:12:56 +0000 (17:12 -0600)]
HLSL: Allow macro expansions to create the 'defined' operator.
John Kessenich [Thu, 8 Jun 2017 18:26:49 +0000 (12:26 -0600)]
GLSL: Fix #853: Only outer dimension of array can be specialization constant.
John Kessenich [Thu, 8 Jun 2017 16:36:45 +0000 (10:36 -0600)]
GLSL: Correct missing "not" from error message about non writeonly images.
John Kessenich [Thu, 8 Jun 2017 16:13:15 +0000 (10:13 -0600)]
GLSL: Disallow 'shared' in nested scopes.
This implements Khronos-private specification bug 16130.
John Kessenich [Thu, 8 Jun 2017 16:07:14 +0000 (10:07 -0600)]
GLSL: Disallow unsized arrays of atomic_uint.
This tracks Khronos-private specification bug 15945.
John Kessenich [Thu, 8 Jun 2017 01:03:11 +0000 (19:03 -0600)]
Build: reset for multi-threaded test error, that reported a single missing character.
John Kessenich [Thu, 8 Jun 2017 00:53:33 +0000 (18:53 -0600)]
GLSL: Fix Khronos private Bugzilla 15973: local sizes can't be 0.
John Kessenich [Wed, 7 Jun 2017 23:15:38 +0000 (17:15 -0600)]
GLSL: Fix #396: Error when 'defined' comes from macro expansion.
John Kessenich [Wed, 7 Jun 2017 22:04:29 +0000 (16:04 -0600)]
Merge pull request #922 from KhronosGroup/dash-I
Infrastructure: add include search paths (-I, etc.).
Fixes #921.
John Kessenich [Wed, 7 Jun 2017 21:06:58 +0000 (15:06 -0600)]
Infrastructure: add include search paths (-I, etc.).
John Kessenich [Wed, 7 Jun 2017 05:35:25 +0000 (23:35 -0600)]
HLSL: Implement half matrices, and map all half* -> float*.
John Kessenich [Wed, 7 Jun 2017 01:52:55 +0000 (19:52 -0600)]
HLSL: Track control-flow nesting and warn on aliasing under it.
John Kessenich [Wed, 7 Jun 2017 01:19:45 +0000 (19:19 -0600)]
Infrastructure: Move nesting counters, etc., to base class.
This lets all languages share the same definitions.
John Kessenich [Wed, 7 Jun 2017 00:31:47 +0000 (18:31 -0600)]
Build: Fix build warnings.
John Kessenich [Tue, 6 Jun 2017 22:27:34 +0000 (16:27 -0600)]
Merge pull request #920 from jeremy-lunarg/jeremy-build
Build: Fix linux
Jeremy Hayes [Tue, 6 Jun 2017 18:03:54 +0000 (12:03 -0600)]
Build: Fix linux
I believe this is a repeat of 12d6936.
John Kessenich [Tue, 6 Jun 2017 17:37:33 +0000 (11:37 -0600)]
HLSL: Fix #919: for-init-statement is arbitrary declaration or expression.
Unlike "if (XXX)" and "while (XXX)", with "for (YYY...", the YYY can be
more kinds of statements than the XXX.
John Kessenich [Mon, 5 Jun 2017 22:42:33 +0000 (16:42 -0600)]
GLSL: replace general missing functionality with specific messages.
John Kessenich [Mon, 5 Jun 2017 15:08:12 +0000 (09:08 -0600)]
Merge pull request #912 from amdrexu/feature
Implement the extension GL_AMD_texture_gather_bias_lod
Rex Xu [Thu, 17 Nov 2016 09:47:59 +0000 (17:47 +0800)]
Implement the extension GL_AMD_texture_gather_bias_lod
John Kessenich [Sun, 4 Jun 2017 19:22:39 +0000 (13:22 -0600)]
Replace #422: Remove the redundant location setting in AST->SPIR-V.
This was redundant in two ways:
1) it replicated algorithms owned in the front end, and
2) it sometimes left location information on both a block and its members.
John Kessenich [Sun, 4 Jun 2017 19:17:20 +0000 (13:17 -0600)]
GLSL: Fix bug setting component=0 for an auto-location assignment.
Setting component=0 is later taken to mean the shader did so, which
is not always legal. It should instead set the component as not set
by the shader.
John Kessenich [Sun, 4 Jun 2017 19:05:50 +0000 (13:05 -0600)]
GLSL: Error when using location on an arrayed block.
This implements a recent change to the GLSL specification to enforce
this ill-defined situation.
John Kessenich [Sat, 3 Jun 2017 21:29:06 +0000 (15:29 -0600)]
Merge pull request #899 from antiagainst/rm-empty-cpps
Remove empty cpp files
John Kessenich [Sat, 3 Jun 2017 21:28:11 +0000 (15:28 -0600)]
Merge pull request #915 from LoopDawg/subvec4-intrinsic
HLSL: add test coverage for sub-vec4 texture intrinsics
John Kessenich [Sat, 3 Jun 2017 00:48:26 +0000 (18:48 -0600)]
Merge pull request #905 from KhronosGroup/flatten-opaque-structs
SPV: When passing structs of opaque types, flatten and pass the membe…
John Kessenich [Fri, 2 Jun 2017 22:28:39 +0000 (16:28 -0600)]
HLSL: Convert run-time sampler assignments to compile-time aliases.
For "s.m = t", a sampler member assigned a sampler, make t an alias
for s.m, and when s.m is flattened, it will flatten to the alias t.
Normally, assignments to samplers are disallowed.
John Kessenich [Fri, 26 May 2017 06:01:36 +0000 (00:01 -0600)]
SPV: When passing structs of opaque types, flatten and pass the members instead.
This avoids either A) needing uniformConstant struct, or
B) initializing a struct with opaque members, as writing them is not
allowed.
John Kessenich [Fri, 2 Jun 2017 00:16:33 +0000 (18:16 -0600)]
HLSL: iomapper: Fix #914. Tolerate user aliasing of bindings.
Because it is valid in HLSL to alias bindings:
A) remove validation that aliasing is not done
B) make the algorithms tolerate aliasing
LoopDawg [Thu, 1 Jun 2017 19:10:25 +0000 (13:10 -0600)]
HLSL: add test coverage for sub-vec4 texture intrinsics
This changes no functional code. There was a bit of a testing hole
in that textures templatized on sub-vec4 types were not being exercised
with any intrinsics. This adds some basic sanity coverage of that case.
John Kessenich [Thu, 1 Jun 2017 18:37:52 +0000 (12:37 -0600)]
Merge pull request #907 from KhronosGroup/include
HLSL: Add an Includer to handle #include for local HLSL paths.
John Kessenich [Thu, 1 Jun 2017 18:36:21 +0000 (12:36 -0600)]
Merge pull request #913 from amdrexu/bugfix
Parser: Add missing codes for float16
John Kessenich [Mon, 22 May 2017 21:00:42 +0000 (15:00 -0600)]
HLSL: Add an Includer to handle #include.
Rex Xu [Thu, 1 Jun 2017 11:58:54 +0000 (19:58 +0800)]
Parser: Add missing codes for float16
John Kessenich [Thu, 1 Jun 2017 04:47:28 +0000 (22:47 -0600)]
Merge pull request #911 from KhronosGroup/debug-info
SPV: Add OpSource shader source code and file name.
John Kessenich [Thu, 1 Jun 2017 00:50:53 +0000 (18:50 -0600)]
SPV: Debug output: Include OpLine information for execution path.
Note that declaratives are not handled, only procedurals.
John Kessenich [Wed, 31 May 2017 23:11:16 +0000 (17:11 -0600)]
SPV: Add OpSource shader source code and file name.
John Kessenich [Mon, 29 May 2017 17:40:43 +0000 (11:40 -0600)]
Merge pull request #856 from TiemoJung/texture_upgrade
Pure Texture to Sampled Texture Transform
t.jung [Tue, 25 Apr 2017 21:31:03 +0000 (23:31 +0200)]
Pure Texture to Sampled Texture Transform
Adds a transformation step to the post processing step.
Two modes are available:
1) keep
- Keeps samplers, textures and sampled textures as is
2) transform pure texture into sampled texture and remove pure samplers
- removes all pure samplers
- transforms all pure textures into its sampled counter part
Change-Id: If54972e8052961db66c23f4b7e719d363cf6edbd
John Kessenich [Thu, 25 May 2017 05:12:58 +0000 (23:12 -0600)]
Merge pull request #901 from LoopDawg/imat-construct
HLSL: Add imat, umat, and bmat constructors
John Kessenich [Thu, 25 May 2017 05:10:28 +0000 (23:10 -0600)]
SPV: Fix #904: Correctly check for built-in block redeclations for location check.
John Kessenich [Wed, 24 May 2017 22:44:47 +0000 (16:44 -0600)]
HLSL: Fix #903: Don't short-circuit && or ||.
John Kessenich [Wed, 24 May 2017 22:02:56 +0000 (16:02 -0600)]
HLSL: Fix #902: Incorrect protection against zero arguments.
LoopDawg [Sun, 21 May 2017 03:40:27 +0000 (21:40 -0600)]
HLSL: Add imat, umat, and bmat constructors
Fixes #894
John Kessenich [Sat, 20 May 2017 19:23:25 +0000 (13:23 -0600)]
Fix #373: Implicitly make gl_FragColor a location=0 output.
John Kessenich [Sat, 20 May 2017 18:14:13 +0000 (12:14 -0600)]
SPV: Correctly enforce 'location' presence on in/out blocks.
Blocks have this on members, not the object.
John Kessenich [Sat, 20 May 2017 17:33:54 +0000 (11:33 -0600)]
Merge pull request #900 from LoopDawg/tx-overloads
HLSL: allow name mangling based on texture template type
John Kessenich [Sat, 20 May 2017 05:44:51 +0000 (23:44 -0600)]
More non-determinism fixed.
John Kessenich [Sat, 20 May 2017 05:29:50 +0000 (23:29 -0600)]
Fix C++ portability, non-deterministic order of argument evaluation.
John Kessenich [Sat, 20 May 2017 05:00:13 +0000 (23:00 -0600)]
Fix #857: Convert uniform int to local bool for struct alias assignment.
This was done for one direction, but not both directions, so this commit
picks up the other direction.
John Kessenich [Sat, 20 May 2017 02:19:00 +0000 (20:19 -0600)]
HLSL: Don't do logical short-circuits when the operands are bool-vectors.
This seems a bit ill-defined, and was generating code that made OpPhi of two
operands that were Boolean vectors result in a scalar bool.
LoopDawg [Thu, 18 May 2017 23:43:08 +0000 (17:43 -0600)]
HLSL: allow name mangling based on texture template type
Name mangling did not account for the vector size in the template type of a texture.
This adds that. The mangle is as it ever was for the vec4 case, which leaves
all GLSL behavior and most HLSL behavior uneffected. For vec1-3 the size is added
to the mangle.
Current limitation: textures cannot presently be templatized on structured types,
so this works only for vectors of basic types.
Fixes #895.
Lei Zhang [Fri, 19 May 2017 20:59:24 +0000 (16:59 -0400)]
Remove empty cpp files
This solves ranlib warnings on MacOS.
John Kessenich [Fri, 19 May 2017 03:12:04 +0000 (21:12 -0600)]
Merge pull request #896 from KhronosGroup/spv-location
SPV: Give error on not assigning locations to I/O when generating SPIR-V.
John Kessenich [Fri, 19 May 2017 00:19:12 +0000 (18:19 -0600)]
Merge pull request #897 from LoopDawg/remap-specconstop-fix.2
Remapper: handle embedded opcode in OpSpecConstantOp
LoopDawg [Thu, 18 May 2017 22:13:04 +0000 (16:13 -0600)]
Remapper: handle embedded opcode in OpSpecConstantOp
OpSpecConstantOp contains an embedded opcode which is given as a literal
argument to the OpSpecConstantOp. The subsequent arguments are as the
embedded op would expect, which may be a mixture of IDs and literals. This
adds support for that to the remapper binary parser. Upon seeing such an
embedded op, the parser flips over to parsing the argument list as
appropriate for that opcode.
Fixes #882.
John Kessenich [Thu, 18 May 2017 00:28:19 +0000 (18:28 -0600)]
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.
John Kessenich [Wed, 17 May 2017 16:55:22 +0000 (10:55 -0600)]
Merge pull request #860 from steve-lunarg/sb-counter-args.2
HLSL: add ability to pass struct buffers with counters to fns
John Kessenich [Wed, 17 May 2017 15:25:57 +0000 (09:25 -0600)]
Merge pull request #893 from KhronosGroup/member-call
HLSL: Implement member functions calling member functions.
Fixes #883.
steve-lunarg [Thu, 27 Apr 2017 17:22:32 +0000 (11:22 -0600)]
WIP: HLSL: add ability to pass struct buffers with counters to fns
This modifies function parameter passing to pass the counter
buffer associated with a struct buffer to a function as a
hidden parameter. Similarly function declarations will have
hidden parameters added to accept the associated counter buffers.
There is a limitation: if a SB type may or may not have an associated
counter, passing it as a function parameter will assume that it does, and
the counter will appear in the linkage whether or not there is a counter
method used on the object.
John Kessenich [Wed, 17 May 2017 05:16:26 +0000 (23:16 -0600)]
HLSL: Implement member functions calling member functions.
John Kessenich [Tue, 16 May 2017 16:38:32 +0000 (10:38 -0600)]
Merge pull request #852 from steve-lunarg/declared-builtin
track declared builtin type
steve-lunarg [Mon, 24 Apr 2017 01:44:28 +0000 (19:44 -0600)]
WIP: track declared builtin type [proposal]
Marking as WIP since it might deserve discussion or at least explicit consideration.
During type sanitization, the TQualifier's TBuiltInVariable type is lost. However,
sometimes it's needed downstream. There were already two methods in use to track
it through to places it was needed: one in the TParameter, and one in a map in the
HlslParseContext used for structured buffers.
The latter was going to be insufficient when SB types with counters are passed to
user functions, and it's proving awkward to track the data to where it's needed.
This PR holds a proposal: track the original declared builtin type in the TType,
so it's trivially available where needed.
This lets the other two mechanisms be removed (and they are in this PR). There's a
side benefit of not losing certain types of information before the reflection interface.
This PR is only that proposal, so it changes no test results. If it's acceptable,
I'll use it for the last piece of SB counter functionality.
John Kessenich [Mon, 15 May 2017 15:39:15 +0000 (09:39 -0600)]
Merge pull request #890 from LoopDawg/mip-operator
HLSL: add .mips[][] operator for texture types
LoopDawg [Fri, 12 May 2017 23:14:31 +0000 (17:14 -0600)]
HLSL: add .mips[][] operator for texture types
This implements mytex.mips[mip][coord] for texture types. There is
some error testing, but not comprehensive. The constructs can be
nested, e.g in this case the inner .mips is parsed before the completion
of the outer [][] operator.
tx.mips[tx.mips[a][b].x][c]
John Kessenich [Sat, 13 May 2017 22:03:12 +0000 (16:03 -0600)]
Merge pull request #889 from antiagainst/travis-android
Check Android build on Travis CI
Lei Zhang [Sat, 13 May 2017 18:26:30 +0000 (14:26 -0400)]
Check Android build on Travis CI.
Also stop requiring sudo privilege so that we can use containers
for testing.
John Kessenich [Sat, 13 May 2017 18:54:08 +0000 (12:54 -0600)]
Merge pull request #888 from LoopDawg/geometry-stage-mix
HLSL: allow GS-specific methods in non-GS stages
LoopDawg [Sat, 13 May 2017 15:20:11 +0000 (09:20 -0600)]
HLSL: allow GS-specific methods in other stages
Using GS methods such as Append() in non-GS stages should be ignored, but was
creating errors due to the lack of a stream output symbol for the non-GS stage.
John Kessenich [Fri, 12 May 2017 21:25:41 +0000 (15:25 -0600)]
HLSL: Fix #884: Use promoted children, not pre-promoted, in completing binary nodes.
John Kessenich [Fri, 12 May 2017 20:53:06 +0000 (14:53 -0600)]
Merge pull request #886 from antiagainst/unordered-set
Use unordered_set in ReadableOrderTraverser.
Lei Zhang [Fri, 12 May 2017 00:46:01 +0000 (20:46 -0400)]
Use unordered_set in ReadableOrderTraverser.
Previously we are using unordered_map to map to bool, which can
be simplified with unordered_set.
John Kessenich [Wed, 10 May 2017 17:11:44 +0000 (11:11 -0600)]
Merge pull request #880 from aras-p/master
Fix for lumped/unity/batch builds
John Kessenich [Wed, 10 May 2017 17:10:53 +0000 (11:10 -0600)]
Merge pull request #874 from xlpiao/DescriptorSet-and-Binding
HLSL: Manually configure descriptor set and binding number for resources
Aras Pranckevicius [Wed, 10 May 2017 13:58:38 +0000 (16:58 +0300)]
[lumped builds] Add include guards (#pragma once) to header files that did not have any.
The codebase seems to use both “#pragma once“ approach, and “#ifndef / #define” approach,
so I picked pragma once as that one is less typing & less brittle.
When glslang is built with some other build system and lumped/unity builds are used,
without the include guards some headers would get included multiple times, leading to duplicate
declaration errors.
Aras Pranckevicius [Wed, 10 May 2017 13:52:50 +0000 (16:52 +0300)]
[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.
Hyangran Park [Tue, 2 May 2017 07:27:29 +0000 (16:27 +0900)]
HLSL: Manually configure descriptor set and binding number for resources
John Kessenich [Wed, 10 May 2017 05:30:56 +0000 (23:30 -0600)]
Build fix: Make string assignment simpler to avoid some compiler issues.
Included changing related parameters to const.
Should fix complaints with previous commit. See issue #879.
John Kessenich [Mon, 8 May 2017 06:47:48 +0000 (00:47 -0600)]
Build: Fix portability in previous commit.
John Kessenich [Mon, 8 May 2017 06:12:28 +0000 (00:12 -0600)]
SPV: Support texelFetch() on a textureBuffer (no sampler).
Fixes Vulkan Khronos-internal issue 770.
John Kessenich [Fri, 5 May 2017 11:09:58 +0000 (05:09 -0600)]
SPV: Emit extension for using StorageClassStorageBuffer.
John Kessenich [Thu, 4 May 2017 20:06:02 +0000 (23:06 +0300)]
Merge pull request #878 from steve-lunarg/unroll-hint
HLSL: implement [unroll] and [loop] attributes