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 [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
steve-lunarg [Wed, 3 May 2017 02:14:50 +0000 (20:14 -0600)]
HLSL: implement [unroll] and [loop] attributes
This adds infrastructure suitable for any front end to create SPIR-V loop
control flags. The only current front end doing so is HLSL.
[unroll] turns into spv::LoopControlUnrollMask
[loop] turns into spv::LoopControlDontUnrollMask
no specification means spv::LoopControlMaskNone
John Kessenich [Wed, 3 May 2017 05:40:15 +0000 (08:40 +0300)]
Merge pull request #877 from steve-lunarg/warn-fix1
Fix iomapper build warnings
steve-lunarg [Wed, 3 May 2017 00:59:55 +0000 (18:59 -0600)]
Fix iomapper build warnings
John Kessenich [Tue, 2 May 2017 19:38:14 +0000 (22:38 +0300)]
Merge pull request #873 from steve-lunarg/gathercmp
HLSL: Implement missing GatherCmp method
steve-lunarg [Tue, 2 May 2017 03:59:34 +0000 (21:59 -0600)]
HLSL: Implement missing GatherCmp
John Kessenich [Sun, 30 Apr 2017 20:02:23 +0000 (14:02 -0600)]
Merge pull request #870 from SoapGentoo/cmake-fixes
Modernise CMake #2
David Seifert [Sat, 29 Apr 2017 08:57:36 +0000 (10:57 +0200)]
Modernise CMake #2
This reverts commit
cfc69d95afed34e1ba1371df0ddb56f2f491a5cb.
* Change CMAKE_INSTALL_PREFIX default on Windows in order
to prevent permission denied errors when trying to install
to "Program Files".
John Kessenich [Sat, 29 Apr 2017 04:13:35 +0000 (22:13 -0600)]
Merge pull request #869 from KhronosGroup/revert-828-fixes
Revert "Modernise CMake"
John Kessenich [Sat, 29 Apr 2017 04:04:24 +0000 (22:04 -0600)]
Revert "Modernise CMake"
John Kessenich [Sat, 29 Apr 2017 03:50:19 +0000 (21:50 -0600)]
Merge pull request #828 from SoapGentoo/fixes
Modernise CMake
David Seifert [Fri, 28 Apr 2017 20:46:52 +0000 (22:46 +0200)]
Make test suite optional by using CTest
David Seifert [Fri, 28 Apr 2017 20:46:52 +0000 (22:46 +0200)]
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.
John Kessenich [Fri, 28 Apr 2017 15:15:51 +0000 (09:15 -0600)]
Merge pull request #868 from TiemoJung/two_pass_io_remap
Notification phase for io remapper
John Kessenich [Fri, 28 Apr 2017 15:09:51 +0000 (09:09 -0600)]
Merge pull request #867 from steve-lunarg/emptyinit
HLSL: Allow empty struct initializers
t.jung [Fri, 28 Apr 2017 13:54:57 +0000 (15:54 +0200)]
Notification phase for io remapper
Adds a notification phase to the io remapper.
The idea behind this is to give the user a
chance to group uniforms and/or in/out variables
for a better pipeline layout sharing for vulkan.
Change-Id: I7492421085a4156ed3534f01d906ab390d73a623
steve-lunarg [Fri, 28 Apr 2017 00:22:52 +0000 (18:22 -0600)]
HLSL: Allow empty struct initializers
Review request: does this harm GLSL in any way?
John Kessenich [Thu, 27 Apr 2017 21:18:46 +0000 (15:18 -0600)]
HLSL: Turn on hlsl-offsets by default for HLSL-source shaders.
John Kessenich [Thu, 27 Apr 2017 07:36:52 +0000 (01:36 -0600)]
Merge pull request #859 from steve-lunarg/sampleposition
HLSL: add standard sample position return form of GetSamplePosition m…
steve-lunarg [Wed, 26 Apr 2017 14:31:56 +0000 (08:31 -0600)]
HLSL: add standard sample position return form of GetSamplePosition method
Multisample textures support a GetSamplePosition() method intended to query
positions given a sample index. This cannot be truly implemented in SPIR-V,
but #753 requested returning standard positions for the 1..16 cases, which
this PR adds. Anything besides that returns (0,0). If the standard positions
are not used, this will be wrong.
This should be revisited when there is a real query available.
John Kessenich [Tue, 25 Apr 2017 22:05:03 +0000 (16:05 -0600)]
Merge pull request #855 from steve-lunarg/constantbuffer
HLSL: Add ConstantBuffer<T> syntax
steve-lunarg [Tue, 25 Apr 2017 15:30:28 +0000 (09:30 -0600)]
HLSL: Add ConstantBuffer<T> syntax
Note: multi-dimension arrays of ConstantBuffer objects will go through uniform flattening.
John Kessenich [Sat, 22 Apr 2017 15:54:34 +0000 (09:54 -0600)]
Merge pull request #851 from dgkoch/dgkoch_build_fixes3
Fix Android build errors
Daniel Koch [Fri, 21 Apr 2017 20:16:43 +0000 (16:16 -0400)]
Fix Android build errors
glslang/MachineIndependent/iomapper.cpp:207:9: error: field 'resolver' will be initialized after field 'stage' [-Werror,-Wreorder]
: resolver(r)
^
glslang/MachineIndependent/iomapper.cpp:263:9: error: field 'resolver' will be initialized after field 'stage' [-Werror,-Wreorder]
: resolver(r)
^
hlsl/hlslParseHelper.cpp:70:5: error: field 'gsStreamOutput' will be initialized after field 'inputPatch' [-Werror,-Wreorder]
gsStreamOutput(nullptr),
^
John Kessenich [Fri, 21 Apr 2017 17:27:24 +0000 (11:27 -0600)]
Merge pull request #849 from steve-lunarg/samplercmp-errmsg
HLSL: add error for expected comparison sampler in SampleCmp* ops
steve-lunarg [Fri, 21 Apr 2017 15:54:53 +0000 (09:54 -0600)]
HLSL: add error for expected comparison sampler in SampleCmp* ops
This adds an error message if a non-comparison sampler is used with
comparison sampling methods. There's no functional change for correct shaders.
John Kessenich [Fri, 21 Apr 2017 03:32:16 +0000 (21:32 -0600)]
HLSL: Fix #846: support mixed ternary types.
Vector conditions properly convert the true/false expression types to same
width vector as the condition.
Scalar conditions make the true/false expressions convert to each other.
John Kessenich [Fri, 21 Apr 2017 02:36:06 +0000 (20:36 -0600)]
Merge pull request #847 from steve-lunarg/sb-param-fix
HLSL: fix for byte address buffers in fn parmeters
John Kessenich [Fri, 21 Apr 2017 02:35:09 +0000 (20:35 -0600)]
Merge pull request #842 from steve-lunarg/sb-cast
HLSL: cast non-int types to uint on Load/Store indexes
John Kessenich [Fri, 21 Apr 2017 02:34:12 +0000 (20:34 -0600)]
Merge pull request #840 from steve-lunarg/iomap-hlsl
HLSL: hlsl register class iomapping
steve-lunarg [Thu, 20 Apr 2017 22:37:14 +0000 (16:37 -0600)]
HLSL: fix for byte address buffers in fn parmeters
Byte address buffers were failing to detect that they were byte address
buffers when used as fn parameters.
Note: this detection is a little awkward, and could be simplified if
it was easy to obtain the declared builtin type for an object.
steve-lunarg [Thu, 20 Apr 2017 19:16:23 +0000 (13:16 -0600)]
HLSL: add readonly qualifier to tbuffer, so they end up as SRV
steve-lunarg [Tue, 18 Apr 2017 18:18:01 +0000 (12:18 -0600)]
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.
John Kessenich [Thu, 20 Apr 2017 18:21:53 +0000 (12:21 -0600)]
GLSL: Fix #822: Improve information given for syntax errors.
Also, fixed one test file that didn't have its syntax error as the last line.
John Kessenich [Thu, 20 Apr 2017 17:08:24 +0000 (11:08 -0600)]
HLSL: Fix #96: Support do-while loop substatements with no curly braces.
steve-lunarg [Thu, 20 Apr 2017 15:00:56 +0000 (09:00 -0600)]
HLSL: cast non-int types to uint on Load/Store indexes
Some texture and SB operations can take non-integer indexes, which should be
cast to integers before use if they are not already. This adds makeIntegerIndex()
for the purpose. Int types are left alone.
(This was done before for operator[], but needs to apply to some other things
too, hence its extraction into common function now)
John Kessenich [Thu, 20 Apr 2017 00:34:49 +0000 (18:34 -0600)]
SPV: Support test #pragma for generating the StorageBuffer storage class.
Longer term, this storage class should be generated based on the mode
of compilation.
John Kessenich [Wed, 19 Apr 2017 23:42:22 +0000 (17:42 -0600)]
Merge pull request #835 from steve-lunarg/sb-counters
HLSL: structuredbuffer counter functionality
John Kessenich [Wed, 19 Apr 2017 03:07:05 +0000 (21:07 -0600)]
HLSL: vector shape conversions for all ops: Fix #839. Fix #653. Fix #631.
John Kessenich [Tue, 18 Apr 2017 20:47:33 +0000 (14:47 -0600)]
HLSL: Address #839: avoid crash by distinguishing between bad argument and no argument.
steve-lunarg [Sat, 15 Apr 2017 14:18:16 +0000 (08:18 -0600)]
WIP: HLSL: add refection queries for structuredbuffer counter blocks
This adds TProgram::getUniformBlockCounterIndex(int index), which returns the
index the block of the counter buffer associated with the block of the passed in
index, if any, or -1 if none.
steve-lunarg [Fri, 14 Apr 2017 00:42:58 +0000 (18:42 -0600)]
WIP: HLSL: add Append/ConsumeBuffer support
steve-lunarg [Mon, 10 Apr 2017 14:19:21 +0000 (08:19 -0600)]
WIP: HLSL: structuredbuffer counter functionality
This is WIP, heavy on the IP part. There's not yet enough to use in real workloads.
Currently present:
* Creation of separate counter buffers for structured buffer types needing them.
* IncrementCounter / DecrementCounter methods
* Postprocess to remove unused counter buffers from linkage
* Associated counter buffers are given @count suffix (invalid as a user identifier)
Not yet present:
* reflection queries to obtain bindings for counter buffers
* Append/Consume buffers
* Ability to use SB references passed as fn parameters
John Kessenich [Thu, 13 Apr 2017 23:08:11 +0000 (17:08 -0600)]
SPV Non-functional: fix ordering causing problems with another branch.
John Kessenich [Thu, 13 Apr 2017 04:37:32 +0000 (22:37 -0600)]
HLSL: Fix #770: implicitly convert bool operands to numeric operators.
John Kessenich [Wed, 12 Apr 2017 23:24:34 +0000 (17:24 -0600)]
HLSL: Fix #834: Report #version is an illegal command.
John Kessenich [Wed, 12 Apr 2017 22:31:15 +0000 (16:31 -0600)]
HLSL: Fix #758: Support character literals (except for numeric escape sequences).
John Kessenich [Wed, 12 Apr 2017 20:56:52 +0000 (14:56 -0600)]
HLSL: Fix #803: Add shape conversions to the constant-initializer path.
John Kessenich [Wed, 12 Apr 2017 20:20:31 +0000 (14:20 -0600)]
Merge pull request #833 from KhronosGroup/hlsl-inf-syntax
HLSL: Fix #672: Support 1.#INF and -1.#INF syntax.
John Kessenich [Wed, 12 Apr 2017 19:26:57 +0000 (13:26 -0600)]
HLSL: Support 1.#INF and -1.#INF syntax.
John Kessenich [Wed, 12 Apr 2017 02:17:23 +0000 (20:17 -0600)]
HLSL: Fix boolean conversion bug and add more tests for ?:.
Null-conversion needs the right sized vectors to kick out with matching types.
John Kessenich [Wed, 12 Apr 2017 01:45:00 +0000 (19:45 -0600)]
HLSL: Support vector 'cond ? :' -> EOpMix -> OpSelect.
John Kessenich [Tue, 11 Apr 2017 23:30:08 +0000 (17:30 -0600)]
HLSL: Non-functional: add vector ? : tests.
John Kessenich [Tue, 11 Apr 2017 15:51:32 +0000 (09:51 -0600)]
HLSL: Fix #832: don't require terminating semicolon for cbuffer/tbuffer.
John Kessenich [Mon, 10 Apr 2017 17:59:52 +0000 (11:59 -0600)]
Merge pull request #831 from steve-lunarg/isfinite
HLSL: fix return type for isfinite
steve-lunarg [Mon, 10 Apr 2017 14:27:34 +0000 (08:27 -0600)]
HLSL: fix return type for isfinite
The prior decomposition of isfinite was not setting the return type on the
sequence node. (Sequence was used because there's an internal temporary
to avoid the complex rvalue problem).
John Kessenich [Sat, 8 Apr 2017 16:03:45 +0000 (10:03 -0600)]
Merge pull request #827 from amdrexu/feature4
Implement the extension SPV_KHR_16bit_storage
John Kessenich [Fri, 7 Apr 2017 21:40:30 +0000 (15:40 -0600)]
Non-functional: Fix typos in comments.
John Kessenich [Fri, 7 Apr 2017 21:33:08 +0000 (15:33 -0600)]
HLSL: Emit the OpSource HLSL instruction for HLSL, using new headers.
John Kessenich [Fri, 7 Apr 2017 16:16:54 +0000 (10:16 -0600)]
Merge pull request #825 from steve-lunarg/index-cast
HLSL: cast bracket dereference index to int type if not.
Rex Xu [Fri, 7 Apr 2017 15:22:33 +0000 (23:22 +0800)]
Implement the extension SPV_KHR_16bit_storage
steve-lunarg [Fri, 7 Apr 2017 02:22:20 +0000 (20:22 -0600)]
HLSL: cast bracket dereference index to int type if not.
HLSL can index arrays using operator[] with non-integer types, and
inserts a conversion to a uint if needed.
John Kessenich [Thu, 6 Apr 2017 23:21:58 +0000 (17:21 -0600)]
SPV: Move to latest public headers.
John Kessenich [Thu, 6 Apr 2017 00:11:31 +0000 (18:11 -0600)]
Merge pull request #823 from steve-lunarg/tess-coord-size
HLSL: allow non-vec3 tessellation coordinate declarations
John Kessenich [Wed, 5 Apr 2017 23:38:20 +0000 (17:38 -0600)]
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.
steve-lunarg [Wed, 5 Apr 2017 17:03:02 +0000 (11:03 -0600)]
HLSL: allow non-vec3 tessellation coordinate declarations
HLSL requires vec2 tessellation coordinate declarations in some cases
(e.g, isoline topology), where SPIR-V requires the TessCoord qualified
builtin to be a vec3 in all cases. This alters the IO form of the
variable to be a vec3, which will be copied to the shader's declared
type if needed. This is not a validation; the shader type must be correct.
John Kessenich [Tue, 4 Apr 2017 21:37:45 +0000 (15:37 -0600)]
Merge branch 'jantlo-cpp11-feat'
John Kessenich [Tue, 4 Apr 2017 21:37:18 +0000 (15:37 -0600)]
Merge branch 'cpp11-feat' of https://github.com/jantlo/glslang into jantlo-cpp11-feat
Juan Lopez [Sun, 2 Apr 2017 21:04:00 +0000 (23:04 +0200)]
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.
John Kessenich [Tue, 4 Apr 2017 18:28:20 +0000 (12:28 -0600)]
PP: Fix #783: Catch end-of-argument expansion in token pasting.
John Kessenich [Tue, 4 Apr 2017 17:47:42 +0000 (11:47 -0600)]
HLSL: Fix #805: Support cast of scalars to structures.
Somewhat complex due to recognizing a general scalar, but not
replicating it for each member to avoid side effects.
John Kessenich [Tue, 4 Apr 2017 04:32:35 +0000 (22:32 -0600)]
Merge pull request #817 from steve-lunarg/isfinite
HLSL: Decompose OpIsFinite to avoid capability restrictions
John Kessenich [Tue, 4 Apr 2017 03:48:37 +0000 (21:48 -0600)]
HLSL: Non-functional: rationalize making constructors.
Improves foundation for adding scalar casts.
Makes handle/make names more sane, better commented, uses more
precise subclass typing, and removes mutual recursion between
converting initializer lists and making constructors.
John Kessenich [Tue, 4 Apr 2017 04:02:30 +0000 (22:02 -0600)]
Merge pull request #812 from steve-lunarg/PatchIO
HLSL: Support InputPatch variables in patch constant functions
steve-lunarg [Tue, 4 Apr 2017 02:05:21 +0000 (20:05 -0600)]
Decompose OpIsFinite to avoid capability restrictions
OpIsFinite is not available everywhere: decompose isfinite
to !isinf && !isnan.
steve-lunarg [Sat, 1 Apr 2017 21:34:48 +0000 (15:34 -0600)]
WIP: HLSL: Support InputPatch variables in patch constant functions
Previously, patch constant functions only accepted OutputPatch. This
adds InputPatch support, via a pseudo-builtin variable type, so that
the patch can be tracked clear through from the qualifier.
John Kessenich [Mon, 3 Apr 2017 22:58:14 +0000 (16:58 -0600)]
Merge pull request #808 from steve-lunarg/gs-ep-wrap-fix
HLSL: fix GS to work with EP wrapping
steve-lunarg [Thu, 30 Mar 2017 02:01:13 +0000 (20:01 -0600)]
HLSL: fix GS implementation for EP wrapping
The prior implementation of GS did not work with the new EP wrapping architecture.
This fixes it: the Append() method now looks up the actual output rather
than the internal sanitized temporary type, and writes to that.
John Kessenich [Mon, 3 Apr 2017 20:29:20 +0000 (14:29 -0600)]
Fix #287: pin down the io-array size before checking for out of range index.
John Kessenich [Mon, 3 Apr 2017 19:20:08 +0000 (13:20 -0600)]
Merge pull request #815 from steve-lunarg/tess-ds-pcf-order
HLSL: handle PCF input to DS in arbitrary argument position
steve-lunarg [Mon, 3 Apr 2017 15:27:53 +0000 (09:27 -0600)]
HLSL: handle PCF input to DS in arbitrary argument position
In the hull shader, the PCF output does not participate in an argument list,
so has no defined ordering. It is always put at the end of the linkage. That
means the DS input reading PCF data must be be at the end of the DS linkage
as well, no matter where it may appear in the argument list. This change
makes sure that happens.
The detection is by looking for arguments that contain tessellation factor
builtins, even as a struct member. The whole struct is taken as the PCF output
if any members are so qualified.
John Kessenich [Mon, 3 Apr 2017 16:07:47 +0000 (10:07 -0600)]
Merge pull request #814 from steve-lunarg/contains
Refactor TType::contains* methods (nonfunctional)
steve-lunarg [Sun, 2 Apr 2017 23:27:39 +0000 (17:27 -0600)]
Refactor TType::contains* methods (nonfunctional)
There were many (~8) different places in TType which all knew how to traverse
the struct/type hierarchy. There's a need to add another, but I didn't
want to duplicate the traversal code again. This is a small refactoring
which passes a predicate to a single traverse-and-test method. That also
shortens all the containsSomething() methods from 9 lines of body to 1.
There are no test differences: it's nonfunctional.
John Kessenich [Sat, 1 Apr 2017 17:07:31 +0000 (11:07 -0600)]
Merge pull request #811 from steve-lunarg/combine-test
HLSL: set combined flag false for Buffer<>
steve-lunarg [Fri, 31 Mar 2017 23:40:09 +0000 (17:40 -0600)]
WIP: HLSL: force uncombined flag off for Buffer<>
John Kessenich [Fri, 31 Mar 2017 20:39:30 +0000 (14:39 -0600)]
Revert "Merge pull request #779 from steve-lunarg/buffer-unsampled-fix"
This reverts commit
1dd65ca3983d3c361e66fbf788f050177f596d3a, reversing
changes made to
4960baaf663b18a6e0a58edb9073158ef7331930.
John Kessenich [Fri, 31 Mar 2017 19:37:52 +0000 (13:37 -0600)]
Merge pull request #774 from steve-lunarg/tess-ctrlpt-pcf
HLSL: support per control point patch const fn invocation