platform/upstream/glslang.git
8 years agoSupport specialization composite constants
qining [Mon, 21 Mar 2016 13:51:37 +0000 (09:51 -0400)]
Support specialization composite constants

Fix issue #163, support creation and reference of composite type
specialization constants.

e.g.:
```
layout(constant_id = 200) const float myfloat = 1.25;
layout(constant_id = 201) const int myint = 14;
struct structtype {
  float f;
  int i;
};
const structtype outer_struct_var = {myfloat, myint};
void main(){}
```
generated code (use glslangValidator):
```
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 12

                              Capability Shader
               1:             ExtInstImport  "GLSL.std.450"
                              MemoryModel Logical GLSL450
                              EntryPoint Vertex 4  "main"
                              Source GLSL 450
                              Name 4  "main"
                              Name 10  "structtype"
                              MemberName 10(structtype) 0  "f"
                              MemberName 10(structtype) 1  "i"
                              Decorate 7 SpecId 200
                              Decorate 9 SpecId 201
               2:             TypeVoid
               3:             TypeFunction 2
               6:             TypeFloat 32
               7:    6(float) SpecConstant 1067450368
               8:             TypeInt 32 1
               9:      8(int) SpecConstant 14
  10(structtype):             TypeStruct 6(float) 8(int)
              11:10(structtype) SpecConstantComposite 7 9
         4(main):           2 Function None 3
               5:             Label
                              Return
                              FunctionEnd
```

Rname two function names to match their functionalities.
1) Rename `GlslangToSpvTraverser::createSpvSpecConstant()` to
`createSpvConstant()`;
2) Rename `GlslangToSpvTraverser::createSpvConstant()` to
`createSpvConstantFromConstUnionArray()`

Add function `GlslangToSpvTraverser::createSpvConstantFromSubTree()` to
handle constant creation from sub trees (e.g.: specialization constants).

Related PR: #208

8 years agoMerge pull request #212 from amdrexu/bugfix
John Kessenich [Tue, 22 Mar 2016 14:56:20 +0000 (08:56 -0600)]
Merge pull request #212 from amdrexu/bugfix

VS2012: Fix a build issue in parser.

8 years agoParser: Fix a build issue (VS2012).
Rex Xu [Tue, 22 Mar 2016 07:42:07 +0000 (15:42 +0800)]
Parser: Fix a build issue (VS2012).

8 years agoMerge pull request #210 from AWoloszyn/fix-compilation
John Kessenich [Mon, 21 Mar 2016 20:06:55 +0000 (14:06 -0600)]
Merge pull request #210 from AWoloszyn/fix-compilation

Fixed compilation issue introduced by my last commit

8 years agoFixed compilation issue introduced by my last commit
Andrew Woloszyn [Mon, 21 Mar 2016 19:56:31 +0000 (15:56 -0400)]
Fixed compilation issue introduced by my last commit

8 years agoMerge pull request #198 from AWoloszyn/update-includer
John Kessenich [Mon, 21 Mar 2016 19:23:20 +0000 (13:23 -0600)]
Merge pull request #198 from AWoloszyn/update-includer

Updated the includer interface to allow relative includes.

8 years agoFront-end: Propagate spec-constness up through aggregate constructors.
John Kessenich [Mon, 21 Mar 2016 18:55:00 +0000 (12:55 -0600)]
Front-end: Propagate spec-constness up through aggregate constructors.

8 years agoUpdated the includer interface to allow relative includes.
Andrew Woloszyn [Mon, 7 Mar 2016 18:23:09 +0000 (13:23 -0500)]
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.

8 years agoFront-end: propagate specialization-constness through conversions and swizzles.
John Kessenich [Mon, 21 Mar 2016 00:45:23 +0000 (18:45 -0600)]
Front-end: propagate specialization-constness through conversions and swizzles.

8 years agoFront-end: Add specialization-constant subtrees for const variables/symbols.
John Kessenich [Sun, 20 Mar 2016 22:46:00 +0000 (16:46 -0600)]
Front-end: Add specialization-constant subtrees for const variables/symbols.

8 years agoFront-end infrastructure: Encapsulate semantic-level questions/actions about const...
John Kessenich [Sun, 20 Mar 2016 06:46:02 +0000 (00:46 -0600)]
Front-end infrastructure: Encapsulate semantic-level questions/actions about const/temp.

Much about const or temp is mechanical, about actual declaration,
while much is semantic, about something higher level.  This commit
checks every use everywhere, and for the high-level ones, substitutes
an encapsulated version instead.

8 years agoFront-end infrastructure: simplify and localize creating symbol nodes, reducing repli...
John Kessenich [Sun, 20 Mar 2016 00:10:22 +0000 (18:10 -0600)]
Front-end infrastructure: simplify and localize creating symbol nodes, reducing replication.

8 years agoMerge pull request #209 from amdrexu/bugfix
John Kessenich [Fri, 18 Mar 2016 20:42:07 +0000 (14:42 -0600)]
Merge pull request #209 from amdrexu/bugfix

Parser: Type promotion for operator modulus(%) is missing.

8 years agoParser: Type promotion for operator modulus(%) is missing.
Rex Xu [Fri, 18 Mar 2016 08:26:23 +0000 (16:26 +0800)]
Parser: Type promotion for operator modulus(%) is missing.

8 years agoMerge pull request #203 from dneto0/wip-mingw
John Kessenich [Wed, 16 Mar 2016 20:08:30 +0000 (14:08 -0600)]
Merge pull request #203 from dneto0/wip-mingw

Support Linux-to-Windows cross compile via MinGW

8 years agoSupport compilation via MinGW
David Neto [Mon, 29 Feb 2016 04:32:44 +0000 (23:32 -0500)]
Support compilation via MinGW

Change-Id: Ie52f0b1b2b20948c6f4b3cb5474537d36a5a3385

8 years agoMerge pull request #204 from amdrexu/bugfix
John Kessenich [Tue, 15 Mar 2016 15:14:27 +0000 (09:14 -0600)]
Merge pull request #204 from amdrexu/bugfix

SPV: Implement boolean selection for mix().

8 years agoSPV: Implement boolean selection for mix().
Rex Xu [Tue, 15 Mar 2016 04:08:31 +0000 (12:08 +0800)]
SPV: Implement boolean selection for mix().

Use OpSelect to implement boolean selection of mix(). FMix is applicable
to linear blending of mix().

8 years agoMerge pull request #199 from dekimir/test-dead-decors
John Kessenich [Fri, 11 Mar 2016 19:34:02 +0000 (12:34 -0700)]
Merge pull request #199 from dekimir/test-dead-decors

SPV test: Test dead-decoration removal.

8 years agoTest dead-decoration removal.
Dejan Mircevski [Fri, 11 Mar 2016 17:06:17 +0000 (12:06 -0500)]
Test dead-decoration removal.

8 years agoMerge pull request #195 from Qining/remove-decoration-on-undef-IDs
John Kessenich [Thu, 10 Mar 2016 16:51:22 +0000 (09:51 -0700)]
Merge pull request #195 from Qining/remove-decoration-on-undef-IDs

SPV: Remove decoration of undefined IDs

8 years agoChange to traditional 'for' loop
qining [Thu, 10 Mar 2016 02:40:41 +0000 (21:40 -0500)]
Change to traditional 'for' loop

8 years agoMerge pull request #194 from google/if-macro
John Kessenich [Thu, 10 Mar 2016 02:07:41 +0000 (19:07 -0700)]
Merge pull request #194 from google/if-macro

Preprocessor: Fix array out of bounds bug in processing if-else-endif macros.

8 years agoRemove decoration of undefined IDs
qining [Thu, 10 Mar 2016 00:54:03 +0000 (19:54 -0500)]
Remove decoration of undefined IDs

Fix issue #185 by removing OpDecorate instructions whose target IDs are
defined in unreachable blocks and thus not dumped in the generated
SPIR-V code.

8 years agoFix array out of bounds bug in processing if-else-endif macros.
Lei Zhang [Wed, 9 Mar 2016 19:53:57 +0000 (14:53 -0500)]
Fix array out of bounds bug in processing if-else-endif macros.

If we are not inside an if macro, we cannot simply decrease
elsetracker.

Fixes https://github.com/KhronosGroup/glslang/issues/29.

8 years agoSPV: Issue #180: push_constants don't have descriptor sets.
John Kessenich [Wed, 9 Mar 2016 04:36:22 +0000 (21:36 -0700)]
SPV: Issue #180: push_constants don't have descriptor sets.

8 years agoMerge pull request #192 from Qining/enable-adding-multiviewport-capability
John Kessenich [Tue, 8 Mar 2016 04:22:54 +0000 (21:22 -0700)]
Merge pull request #192 from Qining/enable-adding-multiviewport-capability

SPV: Declare MultiViewport capability.

8 years agoRun regression tests, update spv.420.geom.out so capability MultiViewport is declared
qining [Tue, 8 Mar 2016 04:05:59 +0000 (23:05 -0500)]
Run regression tests, update spv.420.geom.out so capability MultiViewport is declared

8 years agoEnable adding capability: MultiViewport
qining [Tue, 8 Mar 2016 02:32:15 +0000 (21:32 -0500)]
Enable adding capability: MultiViewport

Fix issue #191:
https://github.com/KhronosGroup/glslang/issues/191

8 years agoMerge pull request #168 from amdrexu/feature2
John Kessenich [Sun, 6 Mar 2016 22:45:11 +0000 (15:45 -0700)]
Merge pull request #168 from amdrexu/feature2

SPV: Add support for memory qualifiers.

8 years agoMerge pull request #165 from amdrexu/feature
John Kessenich [Sun, 6 Mar 2016 22:43:01 +0000 (15:43 -0700)]
Merge pull request #165 from amdrexu/feature

SPV: Support the new OpCode - OpImageSparseRead

8 years agoInfrastructure: Tweak CMake for 31c294cea86ae0115820f2a02c5a33cfca662a26, removal...
John Kessenich [Sun, 6 Mar 2016 22:37:56 +0000 (15:37 -0700)]
Infrastructure: Tweak CMake for 31c294cea86ae0115820f2a02c5a33cfca662a26, removal of bison.

8 years agoMerge pull request #122 from baldurk/remove-bison-binary
John Kessenich [Sun, 6 Mar 2016 22:14:46 +0000 (15:14 -0700)]
Merge pull request #122 from baldurk/remove-bison-binary

Remove bison binary

8 years agoSPV: Use heuristic to avoid geometry multi-streams when possible.
John Kessenich [Fri, 4 Mar 2016 05:29:11 +0000 (22:29 -0700)]
SPV: Use heuristic to avoid geometry multi-streams when possible.

8 years agoMerge pull request #187 from amdrexu/bugfix
John Kessenich [Fri, 4 Mar 2016 04:59:21 +0000 (21:59 -0700)]
Merge pull request #187 from amdrexu/bugfix

SPV: Continue to fix the issue of bool -> uint32

8 years agoMerge pull request #188 from bsalomon/master
John Kessenich [Fri, 4 Mar 2016 04:57:51 +0000 (21:57 -0700)]
Merge pull request #188 from bsalomon/master

Fix line endings in Test/100.conf

8 years agoFix line endings in Test/100.conf.
Brian Salomon [Thu, 3 Mar 2016 17:12:07 +0000 (12:12 -0500)]
Fix line endings in Test/100.conf.

8 years agoSPV: Continue to fix the issue of bool -> uint32
Rex Xu [Thu, 3 Mar 2016 06:38:51 +0000 (14:38 +0800)]
SPV: Continue to fix the issue of bool -> uint32

For short-circuit operator (&& and ||), the conversion is missing.

8 years agoSyntax: correct spelling of rgb10_a2ui.
John Kessenich [Tue, 1 Mar 2016 15:43:17 +0000 (08:43 -0700)]
Syntax: correct spelling of rgb10_a2ui.

8 years agoRemove custom command for bison, it fails if bison is not found
baldurk [Fri, 1 Jan 2016 00:21:56 +0000 (01:21 +0100)]
Remove custom command for bison, it fails if bison is not found

8 years agoCommit bison-generated files from Windows GNU Bison 2.7
baldurk [Thu, 31 Dec 2015 23:54:05 +0000 (00:54 +0100)]
Commit bison-generated files from Windows GNU Bison 2.7

8 years agoAdd a note to README.md about how to build the bison grammar
baldurk [Thu, 31 Dec 2015 23:31:43 +0000 (00:31 +0100)]
Add a note to README.md about how to build the bison grammar

8 years agoRemove bison binaries see issue #103
baldurk [Thu, 31 Dec 2015 23:29:11 +0000 (00:29 +0100)]
Remove bison binaries see issue #103

8 years agoMerge pull request #173 from amdrexu/bugfix
John Kessenich [Sun, 28 Feb 2016 04:37:17 +0000 (21:37 -0700)]
Merge pull request #173 from amdrexu/bugfix

SPV: Fix an issue caused by bool-to-uint32 conversion.

8 years agoMerge pull request #175 from rdb/master
John Kessenich [Sun, 28 Feb 2016 04:29:14 +0000 (21:29 -0700)]
Merge pull request #175 from rdb/master

Fix compilation issues with MSVC 2010

8 years agoMerge pull request #178 from baldurk/minor-warning-fix
John Kessenich [Sun, 28 Feb 2016 04:14:15 +0000 (21:14 -0700)]
Merge pull request #178 from baldurk/minor-warning-fix

Minor warning fixes

8 years agoGCC/Clang warning fix - unsigned/signed mismatch in comparison
baldurk [Thu, 25 Feb 2016 20:47:14 +0000 (21:47 +0100)]
GCC/Clang warning fix - unsigned/signed mismatch in comparison

8 years agoGCC warning fix - unhandled enums in switch statement
baldurk [Wed, 10 Feb 2016 19:04:20 +0000 (20:04 +0100)]
GCC warning fix - unhandled enums in switch statement

8 years agoMSVC warning fix - conversion from size_t to int, possible loss of data
baldurk [Wed, 10 Feb 2016 18:41:29 +0000 (19:41 +0100)]
MSVC warning fix - conversion from size_t to int, possible loss of data

8 years agoMerge pull request #174 from mgadams/alias_proto_warnings
John Kessenich [Thu, 25 Feb 2016 04:43:59 +0000 (21:43 -0700)]
Merge pull request #174 from mgadams/alias_proto_warnings

Fix warnings/errors for strict aliasing & function prototypes

8 years agoMerge pull request #176 from jackoalan/parameterize-ensure
John Kessenich [Thu, 25 Feb 2016 04:41:02 +0000 (21:41 -0700)]
Merge pull request #176 from jackoalan/parameterize-ensure

SPV: Ensure Parameterize is called during Disassemble

8 years agoMerge pull request #172 from Marqin/master
John Kessenich [Thu, 25 Feb 2016 04:39:47 +0000 (21:39 -0700)]
Merge pull request #172 from Marqin/master

fix #171 - error: ‘isinf’ was not declared in this scope

8 years agoSPV: Fix an issue caused by bool-to-uint32 conversion.
Rex Xu [Tue, 23 Feb 2016 09:51:09 +0000 (17:51 +0800)]
SPV: Fix an issue caused by bool-to-uint32 conversion.

This issue is related with the commit
103bef9d74d768f0690ed53f52681baead384d1e.

8 years agoSPV: Ensure Parameterize is called during Disassemble
Jack Andersen [Tue, 23 Feb 2016 22:03:21 +0000 (12:03 -1000)]
SPV: Ensure Parameterize is called during Disassemble

8 years agoFix compilation issues with MSVC 2010
rdb [Tue, 23 Feb 2016 21:17:38 +0000 (22:17 +0100)]
Fix compilation issues with MSVC 2010
(mostly by eliminating use of range-based for loops and std::tie)

8 years agoFix warnings/errors for strict aliasing & function prototypes
Mark Adams [Tue, 23 Feb 2016 17:17:11 +0000 (12:17 -0500)]
Fix warnings/errors for strict aliasing & function prototypes

This fixes various issues related to gcc's strict-aliasing warning
by using unions. It also handles various cases hit with
gcc's missing-declarations warning.

8 years agofix #171 - error: ‘isinf’ was not declared in this scope
Hubert Jarosz [Tue, 23 Feb 2016 00:32:37 +0000 (01:32 +0100)]
fix #171 - error: ‘isinf’ was not declared in this scope

glslang/MachineIndependent/intermOut.cpp used `isinf`,
but it's in `std` namespace, so should use `std::isinf`.

8 years agoSPV: Add support for memory qualifiers.
Rex Xu [Sun, 21 Feb 2016 12:59:01 +0000 (20:59 +0800)]
SPV: Add support for memory qualifiers.

8 years agoSPV: Fix 'location' inheritance bug.
John Kessenich [Fri, 19 Feb 2016 19:21:50 +0000 (12:21 -0700)]
SPV: Fix 'location' inheritance bug.

8 years agoSPV: Support the new OpCode - OpImageSparseRead
Rex Xu [Fri, 19 Feb 2016 14:24:03 +0000 (22:24 +0800)]
SPV: Support the new OpCode - OpImageSparseRead

8 years agoSPV: Fix Linux build warning.
John Kessenich [Fri, 19 Feb 2016 02:47:33 +0000 (19:47 -0700)]
SPV: Fix Linux build warning.

8 years agoMerge pull request #164 from google/bison
John Kessenich [Thu, 18 Feb 2016 18:58:50 +0000 (11:58 -0700)]
Merge pull request #164 from google/bison

Error out if bison is not found on non-Windows operating systems.

8 years agoError out if bison is not found on non-Windows operating systems.
Lei Zhang [Thu, 18 Feb 2016 11:16:11 +0000 (06:16 -0500)]
Error out if bison is not found on non-Windows operating systems.

We cannot just default to use tools/bison.exe when it is not on
Windows.

8 years agoSPV: Implement Vulkan version of GLSL (KHR_vulkan_glsl).
John Kessenich [Tue, 16 Feb 2016 03:58:50 +0000 (20:58 -0700)]
SPV: Implement Vulkan version of GLSL (KHR_vulkan_glsl).

8 years agoSPV: Fix issue #159: use ExplicitLod forms for non-fragment stages.
John Kessenich [Mon, 15 Feb 2016 22:40:42 +0000 (15:40 -0700)]
SPV: Fix issue #159: use ExplicitLod forms for non-fragment stages.

8 years agoSPV Capabilities: StorageImageExtendedFormats, StorageImageReadWithoutFormat, and...
John Kessenich [Mon, 15 Feb 2016 18:57:00 +0000 (11:57 -0700)]
SPV Capabilities: StorageImageExtendedFormats, StorageImageReadWithoutFormat, and StorageImageWriteWithoutFormat.

8 years agoSPV Capabilities: SampleRateShading, SparseResidency, MinLod, and ImageQuery.
John Kessenich [Mon, 15 Feb 2016 18:09:46 +0000 (11:09 -0700)]
SPV Capabilities: SampleRateShading, SparseResidency, MinLod, and ImageQuery.

8 years agoSPV Capabilities: Image types.
John Kessenich [Mon, 15 Feb 2016 00:37:30 +0000 (17:37 -0700)]
SPV Capabilities: Image types.

SampledBuffer
ImageBuffer
Sampled1D
Image1D
SampledCubeArray
ImageCubeArray
SampledRect
ImageRect
InputAttachment
ImageMSArray
StorageImageMultisample

8 years agoSPV capabilities: Add int16, int64, float16, and float64.
John Kessenich [Mon, 15 Feb 2016 00:11:15 +0000 (17:11 -0700)]
SPV capabilities: Add int16, int64, float16, and float64.

8 years agoSPV: Handle GLSL bool loads from a uniform buffer as a conversion from int -> bool.
John Kessenich [Tue, 9 Feb 2016 04:38:15 +0000 (21:38 -0700)]
SPV: Handle GLSL bool loads from a uniform buffer as a conversion from int -> bool.

SPIR-V bool is abstract; it has no bit pattern for storage with transparent memory.
OpenGL's convention is a bool in a uniform buffer is 32-bit int with non-0 being 'true'.

8 years agoMerge pull request #161 from ossy-szeged/master
John Kessenich [Sun, 7 Feb 2016 18:23:28 +0000 (11:23 -0700)]
Merge pull request #161 from ossy-szeged/master

Fix typo in an include guard.

8 years agoFix typo in an include guard.
Csaba Osztrogonác [Fri, 5 Feb 2016 15:40:35 +0000 (07:40 -0800)]
Fix typo in an include guard.

8 years agoSemantics: Map noise*() to an operator for PureOperatorBuiltins mode.
John Kessenich [Tue, 2 Feb 2016 22:59:12 +0000 (15:59 -0700)]
Semantics: Map noise*() to an operator for PureOperatorBuiltins mode.

Fixes issue #157.

8 years agoSPV: RelaxedPrecision: Plumb this through the full AST->SPV translator.
John Kessenich [Tue, 2 Feb 2016 19:37:46 +0000 (12:37 -0700)]
SPV: RelaxedPrecision: Plumb this through the full AST->SPV translator.

8 years agoMerge pull request #155 from mgadams/resultid_warnings
John Kessenich [Tue, 2 Feb 2016 16:14:38 +0000 (09:14 -0700)]
Merge pull request #155 from mgadams/resultid_warnings

Build: Fix two new Windows build warnings/errors

8 years agoMerge pull request #153 from greg-lunarg/gsf-pr1
John Kessenich [Tue, 2 Feb 2016 16:11:01 +0000 (09:11 -0700)]
Merge pull request #153 from greg-lunarg/gsf-pr1

SPV Remapper: Update for 1.0 and bug fixes

8 years agoFix two new Windows build warnings/errors
Mark Adams [Tue, 2 Feb 2016 03:13:06 +0000 (19:13 -0800)]
Fix two new Windows build warnings/errors

8 years agospirv-remap: Fixed strings not at end of operands, fixed L/S defect
GregF [Mon, 1 Feb 2016 23:44:57 +0000 (16:44 -0700)]
spirv-remap: Fixed strings not at end of operands, fixed L/S defect

Also added new op classes.

8 years agospirv-remap: assert on unhandled OperandClass
GregF [Tue, 5 Jan 2016 23:41:29 +0000 (16:41 -0700)]
spirv-remap: assert on unhandled OperandClass

8 years agospirv-remap: inhibit loadstore opt if variable ref'd by other instructions
GregF [Tue, 5 Jan 2016 20:00:04 +0000 (13:00 -0700)]
spirv-remap: inhibit loadstore opt if variable ref'd by other instructions

8 years agospirv-remap: handle OperandImageOperands during remap
GregF [Tue, 5 Jan 2016 15:41:59 +0000 (08:41 -0700)]
spirv-remap: handle OperandImageOperands during remap

8 years agoSPV: Address superset of issue #151: missing OpCapability instructions.
John Kessenich [Mon, 1 Feb 2016 20:45:25 +0000 (13:45 -0700)]
SPV: Address superset of issue #151: missing OpCapability instructions.

This commit adds:
CapabilityGeometryPointSize
CapabilityTessellationPointSize
CapabilityClipDistance
CapabilityCullDistance
CapabilityMultiViewport
CapabilityTransformFeedback
CapabilityGeometryStreams
CapabilityDerivativeControl
CapabilityInterpolationFunction

8 years agoFix front-end bug: Constant folding of array-of-struct index op.
John Kessenich [Mon, 1 Feb 2016 18:57:33 +0000 (11:57 -0700)]
Fix front-end bug: Constant folding of array-of-struct index op.

If a constant object was both an array and a structure, and was
indexed with a constant, the arrayness was ignored and the wrong
subconstant selected.  This fixes that.

8 years agoTodo: removed Todo.txt, and migrated to issues, closing issue #13.
John Kessenich [Sat, 23 Jan 2016 01:27:05 +0000 (18:27 -0700)]
Todo: removed Todo.txt, and migrated to issues, closing issue #13.

8 years agoSPV: Require desktop 140 or ES 310 or above.
John Kessenich [Sat, 23 Jan 2016 00:47:22 +0000 (17:47 -0700)]
SPV: Require desktop 140 or ES 310 or above.

8 years agoSemantics: Spec. changing to reflect reality of int/uint conversion for |^&.
John Kessenich [Fri, 22 Jan 2016 22:40:24 +0000 (15:40 -0700)]
Semantics: Spec. changing to reflect reality of int/uint conversion for |^&.

This effects 4.x, where int/uint conversions are done, but not earlier.

8 years agoSPV: Use a more accurate MemorySemanticsAllMemory mask.
John Kessenich [Fri, 22 Jan 2016 17:15:03 +0000 (10:15 -0700)]
SPV: Use a more accurate MemorySemanticsAllMemory mask.

8 years agoSPV: the OpImageTexelPointer sample 0 should be <id> of 0, not literal 0.
John Kessenich [Fri, 22 Jan 2016 16:54:12 +0000 (09:54 -0700)]
SPV: the OpImageTexelPointer sample 0 should be <id> of 0, not literal 0.

8 years agoSPV: Add recursive distrubition of 'location' across structure members.
John Kessenich [Fri, 22 Jan 2016 01:56:57 +0000 (18:56 -0700)]
SPV: Add recursive distrubition of 'location' across structure members.

8 years agoSPV: Add unary-matrix operations, operating at vector level.
John Kessenich [Wed, 20 Jan 2016 18:19:27 +0000 (11:19 -0700)]
SPV: Add unary-matrix operations, operating at vector level.

8 years agoMerge pull request #138 from dekimir/fix-old-msvc
John Kessenich [Wed, 20 Jan 2016 17:46:40 +0000 (10:46 -0700)]
Merge pull request #138 from dekimir/fix-old-msvc

Fix #137 by avoiding a C++11 feature.

8 years agoMerge pull request #139 from dekimir/small-header-always
John Kessenich [Wed, 20 Jan 2016 17:46:21 +0000 (10:46 -0700)]
Merge pull request #139 from dekimir/small-header-always

SPV: Split loop header from condition testing for for/while loops.

8 years agoAdd Test/spv.for-complex-condition.vert.
Dejan Mircevski [Wed, 20 Jan 2016 16:54:11 +0000 (11:54 -0500)]
Add Test/spv.for-complex-condition.vert.

8 years agoSplit loop header from condition testing for for/while loops.
Dejan Mircevski [Wed, 20 Jan 2016 16:51:43 +0000 (11:51 -0500)]
Split loop header from condition testing for for/while loops.

8 years agoFix #137 by avoiding a C++11 feature.
Dejan Mircevski [Wed, 20 Jan 2016 15:19:25 +0000 (10:19 -0500)]
Fix #137 by avoiding a C++11 feature.

Apparently, older MSVC versions don't support brace-initializers for
function arguments.

Thanks @baldurk for a suggestion on his branch.

8 years agoMerge pull request #136 from dekimir/no-block-removal
John Kessenich [Wed, 20 Jan 2016 02:26:08 +0000 (19:26 -0700)]
Merge pull request #136 from dekimir/no-block-removal

SPV: Don't remove SPIR-V blocks before codegen, use new InReadableOrder instead.

8 years agoDon't remove SPIR-V blocks before codegen.
Dejan Mircevski [Wed, 20 Jan 2016 02:13:38 +0000 (21:13 -0500)]
Don't remove SPIR-V blocks before codegen.

A removed block releases its instructions, so Module::idToInstruction
suddenly contains dangling references.  The original motivation for
block removal was to skip some unreachable blocks, but that's already
achieved by InReadableOrder.cpp.

Also updated stale comments.

8 years agoMerge pull request #127 from dekimir/loopgen
John Kessenich [Tue, 19 Jan 2016 22:32:07 +0000 (15:32 -0700)]
Merge pull request #127 from dekimir/loopgen

SPV: Rework loop code generation to match SPIR-V 1.0.

8 years agoMove continue-block to after all branches.
Dejan Mircevski [Tue, 19 Jan 2016 21:56:45 +0000 (16:56 -0500)]
Move continue-block to after all branches.

8 years agoMerge branch 'topo' into loopgen-after-readable-order
Dejan Mircevski [Tue, 19 Jan 2016 21:47:41 +0000 (16:47 -0500)]
Merge branch 'topo' into loopgen-after-readable-order