platform/upstream/glslang.git
7 years agoRevert "Merge pull request #779 from steve-lunarg/buffer-unsampled-fix"
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.

7 years agoMerge pull request #774 from steve-lunarg/tess-ctrlpt-pcf
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

7 years agoMerge pull request #810 from steve-lunarg/clip-crash-fix
John Kessenich [Fri, 31 Mar 2017 19:34:55 +0000 (13:34 -0600)]
Merge pull request #810 from steve-lunarg/clip-crash-fix

HLSL: Fix #804: crash on empty sequence node passed to intrinsic expansions

7 years agoHLSL: fix crash on empty sequence node passed to intrinsic expansions
steve-lunarg [Fri, 31 Mar 2017 18:47:34 +0000 (12:47 -0600)]
HLSL: fix crash on empty sequence node passed to intrinsic expansions

7 years agoHLSL: pass tessellation execution modes through to SPIR-V
steve-lunarg [Thu, 23 Mar 2017 17:56:07 +0000 (11:56 -0600)]
HLSL: pass tessellation execution modes through to SPIR-V

The SPIR-V generator had assumed tessellation modes such as
primitive type and vertex order would only appear in tess eval
(domain) shaders.  SPIR-V allows either, and HLSL allows and
possibly requires them to be in the hull shader.

This change:

1. Passes them through for either tessellation stage, and,

2. Does not set up defaults in the domain stage for HLSl compilation,
to avoid conflicting definitions.

7 years agoMerge pull request #797 from steve-lunarg/scalar-length
John Kessenich [Fri, 31 Mar 2017 15:26:47 +0000 (09:26 -0600)]
Merge pull request #797 from steve-lunarg/scalar-length

HLSL: allow length() on scalars

7 years agoHLSL: Fix #802: Preserve promoted child under ! operator.
John Kessenich [Fri, 31 Mar 2017 05:32:21 +0000 (23:32 -0600)]
HLSL: Fix #802: Preserve promoted child under ! operator.

7 years agoHLSL: Implicit bool conversions for conditional expressions and related.
John Kessenich [Fri, 31 Mar 2017 04:09:30 +0000 (22:09 -0600)]
HLSL: Implicit bool conversions for conditional expressions and related.

Covers if(cond), while(cond), do-while(cond), for(;cond;), and (cond ? :).
Fixes #778.

7 years agoHLSL: Add namespace grammar and some basic semantics.
John Kessenich [Thu, 30 Mar 2017 22:22:26 +0000 (16:22 -0600)]
HLSL: Add namespace grammar and some basic semantics.

Unknown how extensive the semantics need to be yet. Need real
feedback from workloads. This is just done as part of unifying it
with the class/struct namespaces and grammar productions.

7 years agoHLSL: HS return is arrayed to match SPIR-V semantics
steve-lunarg [Thu, 23 Mar 2017 00:39:25 +0000 (18:39 -0600)]
HLSL: HS return is arrayed to match SPIR-V semantics

HLSL HS outputs a per ctrl point value, and the DS reads an array
of that type.  (It also has a per patch frequency).  The per-ctrl-pt
frequency is arrayed on just one side, as opposed to SPIR-V which
is arrayed on both.  To match semantics, the compiler creates an
array behind the scenes and indexes it by invocation ID, assigning
the HS return value to it.

7 years agoHLSL: strip off array dimension when assign locations of arrayed IO.
steve-lunarg [Sun, 19 Mar 2017 04:24:14 +0000 (22:24 -0600)]
HLSL: strip off array dimension when assign locations of arrayed IO.

7 years agoHLSL: require tessellation factors to be fixed size arrays
steve-lunarg [Sat, 18 Mar 2017 00:51:05 +0000 (18:51 -0600)]
HLSL: require tessellation factors to be fixed size arrays

SPIR-V requires that tessellation factor arrays be size 4 (outer) or 2 (inner).
HLSL allows other sizes such as 3, or even scalars.  This commit converts
between them by forcing the IO types to be the SPIR-V size, and allowing
copies between the internal and IO types to handle these cases.

7 years agoHLSL: support per control point patch const fn invocation
steve-lunarg [Tue, 14 Mar 2017 23:37:10 +0000 (17:37 -0600)]
HLSL: support per control point patch const fn invocation

This PR emulates per control point inputs to patch constant functions.
Without either an extension to look across SIMD lanes or a dedicated
stage, the emulation must use separate invocations of the wrapped
entry point to obtain the per control point values.  This is provided
since shaders are wanting this functionality now, but such an extension
is not yet available.

Entry point arguments qualified as an invocation ID are replaced by the
current control point number when calling the wrapped entry point.  There
is no particular optimization for the case of the entry point not having
such an input but the PCF still accepting ctrl pt frequency data.  It'll
work, but anyway makes no so much sense.

The wrapped entry point must return the per control point data by value.
At this time it is not supported as an output parameter.

7 years agoFix #809: smear scalar condition in OpSelect for selecting vector operands.
John Kessenich [Thu, 30 Mar 2017 16:09:28 +0000 (10:09 -0600)]
Fix #809: smear scalar condition in OpSelect for selecting vector operands.

7 years agoNon-functional: Round of adding 'const', related to more efficient getFullNamespaceNa...
John Kessenich [Wed, 29 Mar 2017 05:43:10 +0000 (23:43 -0600)]
Non-functional: Round of adding 'const', related to more efficient getFullNamespaceName().

7 years agoMerge pull request #801 from amdrexu/bugfix
John Kessenich [Wed, 29 Mar 2017 16:04:30 +0000 (10:04 -0600)]
Merge pull request #801 from amdrexu/bugfix

HLSL: Fix an issue of frexp().

7 years agoMerge pull request #806 from amdrexu/bugfix2
John Kessenich [Wed, 29 Mar 2017 15:59:28 +0000 (09:59 -0600)]
Merge pull request #806 from amdrexu/bugfix2

Don't emit NV-specific interface members if NV extensions are disabled.

7 years agoDon't emit NV-specific interface members if NV extensions are disabled.
Rex Xu [Wed, 29 Mar 2017 15:01:36 +0000 (23:01 +0800)]
Don't emit NV-specific interface members if NV extensions are disabled.

7 years agoHLSL: Fix an issue of frexp().
Rex Xu [Wed, 29 Mar 2017 09:12:40 +0000 (17:12 +0800)]
HLSL: Fix an issue of frexp().

The "exp" parameter is floating-point type in HLSL intrinsic while it is
integer type in GLSL built-in function.

7 years agoHLSL: Move frexp() to a separate test file.
Rex Xu [Wed, 29 Mar 2017 09:04:58 +0000 (17:04 +0800)]
HLSL: Move frexp() to a separate test file.

7 years agoFix #800 (mostly): set of Linux warnings.
John Kessenich [Tue, 28 Mar 2017 15:52:38 +0000 (09:52 -0600)]
Fix #800 (mostly): set of Linux warnings.

7 years agoTests: strengthen the value of test for NV members.
John Kessenich [Sat, 25 Mar 2017 00:57:50 +0000 (18:57 -0600)]
Tests: strengthen the value of test for NV members.

7 years agoFix #790: Don't emit NV-specific interface members unless enabled by extension.
John Kessenich [Sat, 25 Mar 2017 00:38:16 +0000 (18:38 -0600)]
Fix #790: Don't emit NV-specific interface members unless enabled by extension.

7 years agoHLSL: allow length() on scalars
steve-lunarg [Fri, 24 Mar 2017 16:12:53 +0000 (10:12 -0600)]
HLSL: allow length() on scalars

7 years agoMerge pull request #796 from steve-lunarg/emptystruct-return-fix
John Kessenich [Fri, 24 Mar 2017 15:11:00 +0000 (09:11 -0600)]
Merge pull request #796 from steve-lunarg/emptystruct-return-fix

HLSL: fix crash on empty struct return from entry point

7 years agoHLSL: fix crash on empty struct return from entry point
steve-lunarg [Fri, 24 Mar 2017 14:56:37 +0000 (08:56 -0600)]
HLSL: fix crash on empty struct return from entry point

7 years agoTests: Update test results.
John Kessenich [Thu, 23 Mar 2017 20:52:38 +0000 (14:52 -0600)]
Tests: Update test results.

7 years agoHLSL: Allow use of $Global members in between function calls.
John Kessenich [Thu, 23 Mar 2017 05:21:34 +0000 (23:21 -0600)]
HLSL: Allow use of $Global members in between function calls.

This allows global initializers to use $Global members.

7 years agoHLSL: Implement 'this' keyword.
John Kessenich [Wed, 22 Mar 2017 17:38:22 +0000 (11:38 -0600)]
HLSL: Implement 'this' keyword.

7 years agoHLSL: non-static member functions: track and find active anonymous 'this' scopes...
John Kessenich [Wed, 22 Mar 2017 05:56:40 +0000 (23:56 -0600)]
HLSL: non-static member functions: track and find active anonymous 'this' scopes and members.

Thanks to @steve-lunarg for his input and discussions on handling member functions.

7 years agoHLSL: Non-functional: the symbol field of a token was in practice unused; remove it.
John Kessenich [Wed, 22 Mar 2017 00:35:04 +0000 (18:35 -0600)]
HLSL: Non-functional: the symbol field of a token was in practice unused; remove it.

Another precurser to getting member non-static functions working.

7 years agoMerge pull request #782 from steve-lunarg/builtin-methods-prefix
John Kessenich [Mon, 20 Mar 2017 05:49:55 +0000 (23:49 -0600)]
Merge pull request #782 from steve-lunarg/builtin-methods-prefix

HLSL: use prefix for builtin functions names to avoid namespace colliā€¦

7 years agoMerge pull request #779 from steve-lunarg/buffer-unsampled-fix
John Kessenich [Mon, 20 Mar 2017 05:46:03 +0000 (23:46 -0600)]
Merge pull request #779 from steve-lunarg/buffer-unsampled-fix

HLSL: Buffer types should be unsampled.

7 years agoHLSL: use prefix for builtin functions names to avoid namespace collisions
steve-lunarg [Mon, 20 Mar 2017 00:12:37 +0000 (18:12 -0600)]
HLSL: use prefix for builtin functions names to avoid namespace collisions

It would have been possible for globally scoped user functions to collide
with builtin method names.  This adds a prefix to avoid polluting the
namespace.

Ideally this would be an invalid character to use in user identifiers, but
as that requires changing the scanner, for the moment it's an unlikely yet
valid prefix.

7 years agoHLSL: Basic turn on of non-static member functions.
John Kessenich [Mon, 20 Mar 2017 00:09:59 +0000 (18:09 -0600)]
HLSL: Basic turn on of non-static member functions.

Still need: pass by reference in SPIR-V and symbol-table level
for accessing 'this' members from member functions.

7 years agoHLSL: Add implicit-this tracking to TFunction.
John Kessenich [Sun, 19 Mar 2017 19:10:28 +0000 (13:10 -0600)]
HLSL: Add implicit-this tracking to TFunction.

7 years agoHLSL non-functional: Generalize namespace nesting.
John Kessenich [Sun, 19 Mar 2017 18:24:29 +0000 (12:24 -0600)]
HLSL non-functional: Generalize namespace nesting.

Also use this to move deferred member-function-body parsing to a better
place.

This should also be well poised for implementing the 'namespace' keyword.

7 years agoWIP: HLSL: propagate readonly qualifier for buffer types
steve-lunarg [Sun, 19 Mar 2017 18:40:12 +0000 (12:40 -0600)]
WIP: HLSL: propagate readonly qualifier for buffer types

7 years agoWIP: HLSL: Buffer types should be unsampled.
steve-lunarg [Fri, 17 Mar 2017 19:19:42 +0000 (13:19 -0600)]
WIP: HLSL: Buffer types should be unsampled.

RWBuffer objects were generating (properly) unsampled resoures, while
Buffer objects were not.  This fixes that.

7 years agoFix #777: don't parse .suffix if <stage> is provided.
John Kessenich [Thu, 16 Mar 2017 17:20:38 +0000 (11:20 -0600)]
Fix #777: don't parse .suffix if <stage> is provided.

Adding a test for this also uncovered an extraneous \r in the runtests script,
fixed now.

7 years agoMerge pull request #776 from amdrexu/bugfix
John Kessenich [Thu, 16 Mar 2017 15:54:00 +0000 (09:54 -0600)]
Merge pull request #776 from amdrexu/bugfix

SPV: Fix unexpected declarations of capability and extension

7 years agoSPV: Fix unexpected declarations of capability and extension
Rex Xu [Thu, 16 Mar 2017 15:02:39 +0000 (23:02 +0800)]
SPV: Fix unexpected declarations of capability and extension

7 years agoHLSL: Fix #771: add inline keyword.
John Kessenich [Wed, 15 Mar 2017 15:05:14 +0000 (09:05 -0600)]
HLSL: Fix #771: add inline keyword.

7 years agoMerge pull request #767 from DragoonX6/master
John Kessenich [Wed, 15 Mar 2017 14:45:50 +0000 (08:45 -0600)]
Merge pull request #767 from DragoonX6/master

Fix building on MinGW-w64

7 years agoMerge branch 'TiemoJung-semantic_handling'
John Kessenich [Wed, 15 Mar 2017 03:50:06 +0000 (21:50 -0600)]
Merge branch 'TiemoJung-semantic_handling'

7 years agoMerge branch 'semantic_handling' of https://github.com/TiemoJung/glslang into TiemoJu...
John Kessenich [Wed, 15 Mar 2017 03:49:42 +0000 (21:49 -0600)]
Merge branch 'semantic_handling' of https://github.com/TiemoJung/glslang into TiemoJung-semantic_handling

7 years agoGLSL output: Removed fixed-size buffer; fixes #769.
John Kessenich [Wed, 15 Mar 2017 01:43:13 +0000 (19:43 -0600)]
GLSL output: Removed fixed-size buffer; fixes #769.

Makes some white-space differences in most output, plus a few cases
where more could have been put out but was cut short by the previous
fix-sized buffer.

7 years agoFull stack: properly implement GL_EXT_device_group and GL_EXT_multiview.
John Kessenich [Tue, 14 Mar 2017 22:45:30 +0000 (16:45 -0600)]
Full stack: properly implement GL_EXT_device_group and GL_EXT_multiview.

7 years agoFix location of #defines for core and compatibility profile.
John Kessenich [Tue, 14 Mar 2017 21:19:32 +0000 (15:19 -0600)]
Fix location of #defines for core and compatibility profile.

These were recently added for all profiles, versus just desktop.

7 years agoRevert previous check-in, until knowing what the spec. is and whether the test failur...
John Kessenich [Tue, 14 Mar 2017 04:49:36 +0000 (22:49 -0600)]
Revert previous check-in, until knowing what the spec. is and whether the test failure is related.

7 years agoSPV: Address #759: make ViewIndex and DeviceIndex by 'in', not 'uniform'.
John Kessenich [Mon, 13 Mar 2017 21:43:26 +0000 (15:43 -0600)]
SPV: Address #759: make ViewIndex and DeviceIndex by 'in', not 'uniform'.

7 years agoMerge pull request #768 from amdrexu/bugfix
John Kessenich [Mon, 13 Mar 2017 21:31:11 +0000 (15:31 -0600)]
Merge pull request #768 from amdrexu/bugfix

HLSL: Additional channel value for textureGatherXXX().

7 years agoHLSL: Additional channel value for textureGatherXXX().
Rex Xu [Mon, 13 Mar 2017 09:07:18 +0000 (17:07 +0800)]
HLSL: Additional channel value for textureGatherXXX().

When mapping HLSL gather intrinsics to GLSL textureGatherXXX() built-in
function, the channel selection value is only valid for non-shadow samplers.

7 years agoFix building on MinGW-w64
DragoonX6 [Sun, 12 Mar 2017 03:44:55 +0000 (04:44 +0100)]
Fix building on MinGW-w64

Some HLSL to Spirv tests fail.

7 years agoHLSL: Member-functions: capture body token stream for deferred syntax/semantics.
John Kessenich [Sun, 12 Mar 2017 02:32:47 +0000 (19:32 -0700)]
HLSL: Member-functions: capture body token stream for deferred syntax/semantics.

This is needed for accessing types/variables within a member function body that are
not known until after the struct is finished being declared. However, that funtionality
is not yet present, this is just the deferred processing, which is working for
static member functions.

7 years agoHLSL: Non-functional: consolidate function declarator information.
John Kessenich [Sun, 12 Mar 2017 00:55:28 +0000 (17:55 -0700)]
HLSL: Non-functional: consolidate function declarator information.

7 years agoMerge pull request #762 from LukasBanana/master
John Kessenich [Sat, 11 Mar 2017 21:16:58 +0000 (14:16 -0700)]
Merge pull request #762 from LukasBanana/master

Added 'GL_core_profile' and 'GL_compatibility_profile' to macro expansion

7 years agoHLSL: Add scoping operator, accept static member functions, and support calling them.
John Kessenich [Sat, 11 Mar 2017 21:13:00 +0000 (14:13 -0700)]
HLSL: Add scoping operator, accept static member functions, and support calling them.

7 years agoHLSL: non-functional: simplify handleBuiltInMethod() to isBuiltInMethod().
John Kessenich [Sat, 11 Mar 2017 16:39:55 +0000 (09:39 -0700)]
HLSL: non-functional: simplify handleBuiltInMethod() to isBuiltInMethod().

7 years agoAdded 'GL_core_profile' and 'GL_compatibility_profile' macro definition to preamble.
Lukas Hermanns [Fri, 10 Mar 2017 19:45:20 +0000 (20:45 +0100)]
Added 'GL_core_profile' and 'GL_compatibility_profile' macro definition to preamble.

Added version check (version >= 150) for GL_(core/compatibility)_profile macros.

Added GL_core_profile standard macro check to "150.vert" test file.

Fixed version check for GL_core_profile macros, and removed bad token character from 150.vert test.

Updated 150.vert.out test base-result with google-test suite.

7 years agoPP: Recognize the '::' token, and translate appropriately to GLSL/HLSL token.
John Kessenich [Sat, 11 Mar 2017 01:03:43 +0000 (18:03 -0700)]
PP: Recognize the '::' token, and translate appropriately to GLSL/HLSL token.

7 years agoMerge pull request #764 from steve-lunarg/imagequery-sign
John Kessenich [Fri, 10 Mar 2017 22:35:12 +0000 (15:35 -0700)]
Merge pull request #764 from steve-lunarg/imagequery-sign

Preserve signedness in SPIR-V image query ops

7 years agoPreserve signedness in SPV image query ops
steve-lunarg [Fri, 10 Mar 2017 19:45:50 +0000 (12:45 -0700)]
Preserve signedness in SPV image query ops

The AST->SPIRV translation of image queries was dropping signedness,
causing some validation troubles.

7 years agoMerge pull request #763 from steve-lunarg/nullstruct-preservation
John Kessenich [Fri, 10 Mar 2017 16:16:06 +0000 (09:16 -0700)]
Merge pull request #763 from steve-lunarg/nullstruct-preservation

HLSL: preserve empty structures after splitting

7 years agoWIP: HLSL: preserve empty structures after splitting
steve-lunarg [Fri, 10 Mar 2017 02:10:57 +0000 (19:10 -0700)]
WIP: HLSL: preserve empty structures after splitting

7 years agoHLSL: Accept SV_Cull/ClipDistanceN, by refactoring the way semantics are mapped.
John Kessenich [Thu, 9 Mar 2017 21:37:32 +0000 (14:37 -0700)]
HLSL: Accept SV_Cull/ClipDistanceN, by refactoring the way semantics are mapped.

7 years agoMerge pull request #761 from baldurk/vs2010-compile-fixes
John Kessenich [Thu, 9 Mar 2017 18:28:21 +0000 (11:28 -0700)]
Merge pull request #761 from baldurk/vs2010-compile-fixes

Compile fixes for VS2010

7 years agoMerge pull request #760 from steve-lunarg/gathercmpred
John Kessenich [Thu, 9 Mar 2017 18:13:31 +0000 (11:13 -0700)]
Merge pull request #760 from steve-lunarg/gathercmpred

HLSL: Enable GatherCmpRed.  Green/Blue/Alpha cannot be supported.

7 years agoCompile fixes for VS2010
baldurk [Thu, 9 Mar 2017 17:48:59 +0000 (17:48 +0000)]
Compile fixes for VS2010

* Removed range-based for
* Added explicit return type to non-trivial lambda
* Added explicit scope for tInterstageIoData

7 years agoEnable GatherCmpRed. Green/Blue/Alpha cannot be supported.
steve-lunarg [Thu, 9 Mar 2017 15:59:45 +0000 (08:59 -0700)]
Enable GatherCmpRed.  Green/Blue/Alpha cannot be supported.

This implements GatherCmpRed in terms of OpImageDrefGather.

There appears to be no way to implement the Green/Blue/Apha forms: see #673.

7 years agoHLSL: Non-functional: Remove dead .length() code.
John Kessenich [Thu, 9 Mar 2017 04:16:35 +0000 (21:16 -0700)]
HLSL: Non-functional: Remove dead .length() code.

7 years agoHLSL: Non-functional: Drive existing method recognition by syntax, not by name.
John Kessenich [Thu, 9 Mar 2017 03:09:03 +0000 (20:09 -0700)]
HLSL: Non-functional: Drive existing method recognition by syntax, not by name.

This (and previous commit) is a better foundation to build real methods on.

7 years agoHLSL: Non-functional: Don't process function name/parameters before expected a functi...
John Kessenich [Thu, 9 Mar 2017 01:53:51 +0000 (18:53 -0700)]
HLSL: Non-functional: Don't process function name/parameters before expected a function declaration.

7 years agoMerge pull request #756 from steve-lunarg/getdimensions-fix
John Kessenich [Wed, 8 Mar 2017 03:57:49 +0000 (20:57 -0700)]
Merge pull request #756 from steve-lunarg/getdimensions-fix

HLSL: use LOD form of ImageQuerySize when needed.

7 years agoHLSL: Grammar: Generalize accepting a declaration to accept an aggregate of subtrees.
John Kessenich [Wed, 8 Mar 2017 03:44:09 +0000 (20:44 -0700)]
HLSL: Grammar: Generalize accepting a declaration to accept an aggregate of subtrees.

This is slightly cleaner today for entry-point wrapping, which sometimes made
two subtrees for a function definition instead of just one subtree.  It will be
critical though for recognizing a struct with multiple member functions.

7 years agoHLSL: use LOD form of ImageQuerySize when needed.
steve-lunarg [Wed, 8 Mar 2017 02:30:25 +0000 (19:30 -0700)]
HLSL: use LOD form of ImageQuerySize when needed.

The non-LOD form of image size query is prohibited in certain cases:
see the OpImageQuerySize and OpImageQuerySizeLod sections of the SPIR-V
spec for details.  Sometimes we were generating the non-LOD form when
we should have been using the LOD form.  Sometimes the LOD form is required
even if the underlying HLSL query did not supply a MIP level itself,
in which case level 0 is now queried.

7 years agoHLSL: Fix #754: recognize type casts in if-statements separately from declarations.
John Kessenich [Tue, 7 Mar 2017 01:18:37 +0000 (18:18 -0700)]
HLSL: Fix #754: recognize type casts in if-statements separately from declarations.

7 years agoMerge pull request #755 from steve-lunarg/sb-orderfix
John Kessenich [Tue, 7 Mar 2017 00:56:56 +0000 (17:56 -0700)]
Merge pull request #755 from steve-lunarg/sb-orderfix

HLSL: Fix ordering defect if global SB decl after fn param

7 years agoWIP: HLSL: Fix ordering defect if global SB decl after fn param
steve-lunarg [Mon, 6 Mar 2017 19:01:44 +0000 (12:01 -0700)]
WIP: HLSL: Fix ordering defect if global SB decl after fn param

This change propagates the storage qualifier from the buffer object to its contained
array type so that isStructBufferType() realizes it is one.  That propagation was
happening before only for global variable declarations, so compilation defects would
result if the use of a function parameter happened before a global declaration.

This fixes that case, whether or not there ever is a global declaration, and
regardless of the relative order.

This changes the hlsl.structbuffer.fn.frag test to exercise the alternate order.

There are no differences to generated SPIR-V for the cases which successfully compiled before.

7 years agoSPV: Allow push constant buffers to not have an instance name.
John Kessenich [Mon, 6 Mar 2017 15:51:35 +0000 (08:51 -0700)]
SPV: Allow push constant buffers to not have an instance name.

7 years agoHLSL: Test for issue #699.
John Kessenich [Sat, 4 Mar 2017 01:18:23 +0000 (18:18 -0700)]
HLSL: Test for issue #699.

7 years agoMerge pull request #750 from dgkoch/rename_KHX_to_EXT
John Kessenich [Sat, 4 Mar 2017 00:23:53 +0000 (17:23 -0700)]
Merge pull request #750 from dgkoch/rename_KHX_to_EXT

Rename KHX_multiview/device_group to EXT_multiview/device to match the released specs

7 years agoHLSL: Add 'class' keyword as (so far) synonym for 'struct'.
John Kessenich [Sat, 4 Mar 2017 00:01:01 +0000 (17:01 -0700)]
HLSL: Add 'class' keyword as (so far) synonym for 'struct'.

7 years agoRename KHX to EXT to match the released specs
Daniel Koch [Fri, 3 Mar 2017 23:40:48 +0000 (18:40 -0500)]
Rename KHX to EXT to match the released specs

GL_KHX_multiview and GL_KHX_device_group don't exist,
they were released as GL_EXT_multiview and GL_EXT_device_group.

7 years agoMerge pull request #748 from dgkoch/dgkoch_build_fixes2
John Kessenich [Fri, 3 Mar 2017 16:20:43 +0000 (09:20 -0700)]
Merge pull request #748 from dgkoch/dgkoch_build_fixes2

More build fixes

7 years agoMore build fixes
Daniel Koch [Fri, 3 Mar 2017 15:34:07 +0000 (10:34 -0500)]
More build fixes

Fix another build warning on some platforms

Use an explicit cast from size_t to int to avoid warning.

7 years agoHLSL: Fix #747: accept 'struct' in front of previously user-defined type name.
John Kessenich [Thu, 2 Mar 2017 21:30:59 +0000 (14:30 -0700)]
HLSL: Fix #747: accept 'struct' in front of previously user-defined type name.

7 years agoSPV: Fix #739: OpSelect can only operate on scalars and vectors.
John Kessenich [Wed, 1 Mar 2017 20:49:11 +0000 (13:49 -0700)]
SPV: Fix #739: OpSelect can only operate on scalars and vectors.

7 years agoMerge pull request #744 from realitix/sanitize_sh_link
John Kessenich [Wed, 1 Mar 2017 20:17:24 +0000 (13:17 -0700)]
Merge pull request #744 from realitix/sanitize_sh_link

Sanitize ShaderLang.h

7 years agoMerge pull request #746 from dgkoch/dgkoch_build_fixes
John Kessenich [Wed, 1 Mar 2017 20:14:51 +0000 (13:14 -0700)]
Merge pull request #746 from dgkoch/dgkoch_build_fixes

Fix build warnings on some platforms

7 years agoBuild: Another fix for issue #718: implement the hidden methods of tFinalize.
John Kessenich [Wed, 1 Mar 2017 20:12:26 +0000 (13:12 -0700)]
Build: Another fix for issue #718: implement the hidden methods of tFinalize.

7 years agoFix build warnings on some platforms
Daniel Koch [Tue, 28 Feb 2017 14:01:43 +0000 (09:01 -0500)]
Fix build warnings on some platforms

Use an explicit cast from size_t to int to avoid errors like the following:
glslang\glslang\MachineIndependent\preprocessor\Pp.cpp(1053) : error C2220: warning treated as error - no 'object' file generated
glslang\glslang\MachineIndependent\preprocessor\Pp.cpp(1053) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data

affects Pp.cpp, hlslParseHelper.cpp.

Initialize local variable to get rid of warningsa about potentially
uninitialized variables:
glslang\hlsl\hlslparsehelper.cpp(3667) : error C2220: warning treated as error - no 'object' file generated
glslang\hlsl\hlslparsehelper.cpp(3667) : warning C4701: potentially uninitialized local variable 'builtIn' used

affects hlslParseHelper.cpp

7 years agoSanitize ShaderLang.h
Jean-Sebastien Bevilacqua [Wed, 1 Mar 2017 08:23:14 +0000 (09:23 +0100)]
Sanitize ShaderLang.h

ShaderLang.h contains declaration for `ShLink` function which is never
defined.

See this grep output:

$grep -Hrn 'ShLink'
glslang/Public/ShaderLang.h:206:SH_IMPORT_EXPORT int ShLink(
glslang/Public/ShaderLang.h:214:SH_IMPORT_EXPORT int ShLinkExt(
glslang/MachineIndependent/ShaderLang.cpp:1268:int ShLinkExt(

7 years agoPP: Fix issue #738: don't assert on characters within a string.
John Kessenich [Wed, 1 Mar 2017 01:39:20 +0000 (18:39 -0700)]
PP: Fix issue #738: don't assert on characters within a string.

7 years agoPP: Partially address issue #738: handle premature end of argument when token pasting.
John Kessenich [Wed, 1 Mar 2017 01:04:47 +0000 (18:04 -0700)]
PP: Partially address issue #738: handle premature end of argument when token pasting.

7 years agoMerge pull request #742 from steve-lunarg/f16tof32-typefix
John Kessenich [Tue, 28 Feb 2017 23:18:24 +0000 (16:18 -0700)]
Merge pull request #742 from steve-lunarg/f16tof32-typefix

HLSL: small fix for index type in f16tof32 opcode

7 years agoHLSL: small fix for index type in f16tof32 opcode
steve-lunarg [Tue, 28 Feb 2017 21:14:14 +0000 (14:14 -0700)]
HLSL: small fix for index type in f16tof32 opcode

The f16tof32 opcode was indexing a vector with a float 0, rather
than an int 0.  It may have made no functional difference due to the
identical bit pattern, but code looking at the type could be
confused.

7 years agoGLSL: Fix #741: rationalize per-block vs. per-member offset checking.
John Kessenich [Tue, 28 Feb 2017 21:10:00 +0000 (14:10 -0700)]
GLSL: Fix #741: rationalize per-block vs. per-member offset checking.

7 years agoMerge pull request #736 from steve-lunarg/structbuffer-params
John Kessenich [Tue, 28 Feb 2017 20:10:51 +0000 (13:10 -0700)]
Merge pull request #736 from steve-lunarg/structbuffer-params

HLSL: add structuredbuffer pass by reference in fn params

7 years agoPP: Address #737: accept 'h'/'H' floating-point suffix more broadly.
John Kessenich [Tue, 28 Feb 2017 19:40:40 +0000 (12:40 -0700)]
PP: Address #737: accept 'h'/'H' floating-point suffix more broadly.