platform/upstream/glslang.git
5 years agoCMake: Fix linking pthread of CMake < 3.1
Rémi Verschelde [Tue, 18 Dec 2018 10:43:09 +0000 (11:43 +0100)]
CMake: Fix linking pthread of CMake < 3.1

As reported in #1624, Ubuntu 14.04 LTS still uses CMake 2.8.12 which
does not support the Threads::Threads target (added in CMake 3.1).

This could be reverted once the required CMake version is bumped to 3.1+.

5 years agoMerge pull request #1632 from alan-baker/mem-model-1610
John Kessenich [Tue, 18 Dec 2018 00:49:05 +0000 (17:49 -0700)]
Merge pull request #1632 from alan-baker/mem-model-1610

Move memory model scope tests to Vulkan 1.1 batch

5 years agoMove memory model scope tests to Vulkan 1.1 batch
Alan Baker [Mon, 17 Dec 2018 22:07:55 +0000 (17:07 -0500)]
Move memory model scope tests to Vulkan 1.1 batch

Fixes #1610

* Updated expected result due to version change

5 years agoBuild: Make calling argument types match declared parameter types.
John Kessenich [Mon, 17 Dec 2018 21:00:43 +0000 (14:00 -0700)]
Build: Make calling argument types match declared parameter types.

Fixes #1630 and fixes #1631.

5 years agoMerge pull request #1628 from jeffbolznv/storagebuffer_sbt
John Kessenich [Sat, 15 Dec 2018 03:30:39 +0000 (20:30 -0700)]
Merge pull request #1628 from jeffbolznv/storagebuffer_sbt

Fix bug where shaderRecordNV buffers were using StorageBuffer storage class

5 years agoFix bug where shaderRecordNV buffers were using StorageBuffer storage class
Jeff Bolz [Sat, 15 Dec 2018 02:59:53 +0000 (20:59 -0600)]
Fix bug where shaderRecordNV buffers were using StorageBuffer storage class

5 years agoLicensing. Fixes #958. Add licenes file and update copyrights.
John Kessenich [Fri, 14 Dec 2018 17:47:35 +0000 (10:47 -0700)]
Licensing. Fixes #958. Add licenes file and update copyrights.

5 years agoBuild: Reduce warnings.
John Kessenich [Fri, 14 Dec 2018 01:43:02 +0000 (18:43 -0700)]
Build: Reduce warnings.

5 years agoGLSL/SPV: XFB: No streams on types, but support them on built-in blocks.
John Kessenich [Thu, 13 Dec 2018 19:06:12 +0000 (12:06 -0700)]
GLSL/SPV: XFB: No streams on types, but support them on built-in blocks.

From internal Khronos discussions, work, and testing.

5 years agoMerge pull request #1625 from jeffbolznv/update_spirv_tools
John Kessenich [Thu, 13 Dec 2018 01:18:25 +0000 (18:18 -0700)]
Merge pull request #1625 from jeffbolznv/update_spirv_tools

Update to newest SPIRV-Tools, emit default Binding decoration.

5 years agoUpdate to newest SPIRV-Tools. It checks the Vulkan rule that all resources must have...
Jeff Bolz [Wed, 12 Dec 2018 02:53:59 +0000 (20:53 -0600)]
Update to newest SPIRV-Tools. It checks the Vulkan rule that all resources must have a set and binding decoration, which many tests fail. So add code to set a default value of zero. Also disable PCH for Ninja builds.

5 years agoInfrastructure: Fix .gitattributes typo eof -> eol. Also update README
John Kessenich [Mon, 10 Dec 2018 23:47:05 +0000 (16:47 -0700)]
Infrastructure: Fix .gitattributes typo eof -> eol. Also update README

Add to README: git config --global core.fileMode false

5 years agoMerge pull request #1620 from akien-mga/unix-executable-bit
John Kessenich [Mon, 10 Dec 2018 22:37:21 +0000 (15:37 -0700)]
Merge pull request #1620 from akien-mga/unix-executable-bit

Remove Unix executable permission from text files

5 years agoMerge pull request #1624 from akien-mga/osdependent-link-threads
John Kessenich [Mon, 10 Dec 2018 15:46:53 +0000 (08:46 -0700)]
Merge pull request #1624 from akien-mga/osdependent-link-threads

CMake: Link OSDependent with Threads::Threads

5 years agoCMake: Link OSDependent with Threads::Threads
Rémi Verschelde [Mon, 10 Dec 2018 13:26:54 +0000 (14:26 +0100)]
CMake: Link OSDependent with Threads::Threads

Would typically be pthreads.
Without this, '-Wl,--no-undefined' would output these errors:

/usr/bin/ld: OSDependent/Unix/libOSDependent.a(ossource.cpp.o): in function `glslang::OS_CleanupThreadData()':
/home/akien/Mageia/Sandbox/_rpm/BUILD/glslang-7.10.2984/glslang/OSDependent/Unix/ossource.cpp:83: undefined reference to `__pthread_register_cancel'
/usr/bin/ld: /home/akien/Mageia/Sandbox/_rpm/BUILD/glslang-7.10.2984/glslang/OSDependent/Unix/ossource.cpp:93: undefined reference to `__pthread_unregister_cancel'
/usr/bin/ld: OSDependent/Unix/libOSDependent.a(ossource.cpp.o): in function `glslang::OS_AllocTLSIndex()':
/home/akien/Mageia/Sandbox/_rpm/BUILD/glslang-7.10.2984/glslang/OSDependent/Unix/ossource.cpp:122: undefined reference to `pthread_key_create'
/usr/bin/ld: OSDependent/Unix/libOSDependent.a(ossource.cpp.o): in function `glslang::OS_SetTLSValue(void*, void*)':
/home/akien/Mageia/Sandbox/_rpm/BUILD/glslang-7.10.2984/glslang/OSDependent/Unix/ossource.cpp:137: undefined reference to `pthread_setspecific'
/usr/bin/ld: OSDependent/Unix/libOSDependent.a(ossource.cpp.o): in function `glslang::OS_FreeTLSIndex(void*)':
/home/akien/Mageia/Sandbox/_rpm/BUILD/glslang-7.10.2984/glslang/OSDependent/Unix/ossource.cpp:162: undefined reference to `pthread_key_delete'
/usr/bin/ld: OSDependent/Unix/libOSDependent.a(ossource.cpp.o): in function `glslang::InitGlobalLock()':
/home/akien/Mageia/Sandbox/_rpm/BUILD/glslang-7.10.2984/glslang/OSDependent/Unix/ossource.cpp:175: undefined reference to `pthread_mutexattr_init'
/usr/bin/ld: /home/akien/Mageia/Sandbox/_rpm/BUILD/glslang-7.10.2984/glslang/OSDependent/Unix/ossource.cpp:176: undefined reference to `pthread_mutexattr_settype'
/usr/bin/ld: OSDependent/Unix/libOSDependent.a(ossource.cpp.o): in function `glslang::OS_GetTLSValue(void*)':
/home/akien/Mageia/Sandbox/_rpm/BUILD/glslang-7.10.2984/glslang/OSDependent/Unix/ossource.cpp:149: undefined reference to `pthread_getspecific'

5 years agoRemove Unix executable permission from text files
Rémi Verschelde [Mon, 10 Dec 2018 09:48:55 +0000 (10:48 +0100)]
Remove Unix executable permission from text files

5 years agoMerge branch 'ClemensRognerSD-dx9-sampler'
John Kessenich [Sat, 8 Dec 2018 01:40:14 +0000 (18:40 -0700)]
Merge branch 'ClemensRognerSD-dx9-sampler'

5 years agoManually merge ClemensRognerSD-dx9-sampler and resolve conflicts.
John Kessenich [Sat, 8 Dec 2018 01:38:26 +0000 (18:38 -0700)]
Manually merge ClemensRognerSD-dx9-sampler and resolve conflicts.

5 years agoSPV: Fix #1575, fix #1593: Support HLSL #line
greg-lunarg [Sat, 8 Dec 2018 00:36:33 +0000 (17:36 -0700)]
SPV: Fix #1575, fix #1593: Support HLSL #line

SPIR-V OpLines now contain filenames from HLSL-style #lines.

5 years agoMerge pull request #1614 from alan-baker/test-updates
John Kessenich [Fri, 7 Dec 2018 21:10:06 +0000 (14:10 -0700)]
Merge pull request #1614 from alan-baker/test-updates

Update test infrastructure

5 years agoModify testing to only record validation pass/fail
Alan Baker [Tue, 4 Dec 2018 15:43:23 +0000 (10:43 -0500)]
Modify testing to only record validation pass/fail

* Changed unit tests to only record known the validation pass/fail
status
 * errors are output as part of the failure message if the result is
 unexpected
 * can turn off validation for each test individually
* Moved some SPV_KHR_vulkan_memory_model tests to be compiled for Vulkan
1.1

5 years agoMerge pull request #1613 from alegal-arm/types
John Kessenich [Tue, 4 Dec 2018 06:21:15 +0000 (23:21 -0700)]
Merge pull request #1613 from alegal-arm/types

Rename GL_KHX_shader_explicit_arithmetic_types to GL_EXT_shader_expli…

5 years agoRename GL_KHX_shader_explicit_arithmetic_types to GL_EXT_shader_explicit_arithmetic_types
Alexander Galazin [Mon, 3 Dec 2018 12:16:59 +0000 (13:16 +0100)]
Rename GL_KHX_shader_explicit_arithmetic_types to GL_EXT_shader_explicit_arithmetic_types

5 years agoMerge pull request #1602 from Igalia/apinheiro/prevent-xfbstride-twice
John Kessenich [Thu, 29 Nov 2018 17:43:25 +0000 (10:43 -0700)]
Merge pull request #1602 from Igalia/apinheiro/prevent-xfbstride-twice

GlslangToSpv: prevent add XfbStride twice

5 years agoGlslangToSpv: prevent add XfbStride twice
Alejandro Piñeiro [Thu, 25 Oct 2018 10:49:33 +0000 (12:49 +0200)]
GlslangToSpv: prevent add XfbStride twice

Without this commit, if the XfbStride was explicitly set, the
decoration was added twice on the shader.

v2 (changes after Jonh Kessenich first review)
   * Simplified by just removing the firs assignment
   * Removed assert

5 years agoMerge pull request #1603 from KhronosGroup/uint-array-length
John Kessenich [Thu, 29 Nov 2018 09:32:46 +0000 (02:32 -0700)]
Merge pull request #1603 from KhronosGroup/uint-array-length

SPV: Generate OpArrayLength with no signedness.

5 years agoBump version.
John Kessenich [Thu, 29 Nov 2018 07:37:16 +0000 (00:37 -0700)]
Bump version.

5 years agoSPV: For GLSL only, bitcast OpArrayLength result back to int.
John Kessenich [Wed, 28 Nov 2018 14:01:37 +0000 (07:01 -0700)]
SPV: For GLSL only, bitcast OpArrayLength result back to int.

This makes the rest of the AST consuming the result match GLSL
semantics and hence get complete type matching.

5 years agoMerge pull request #1606 from dj2/ndk_build
John Kessenich [Wed, 28 Nov 2018 02:42:19 +0000 (19:42 -0700)]
Merge pull request #1606 from dj2/ndk_build

Add NDK build files

5 years agoSPV: Generate OpArrayLength with no signedness.
John Kessenich [Tue, 27 Nov 2018 16:19:10 +0000 (09:19 -0700)]
SPV: Generate OpArrayLength with no signedness.

5 years agoAdd NDK build files
dan sinclair [Mon, 26 Nov 2018 21:27:55 +0000 (16:27 -0500)]
Add NDK build files

5 years agoBuild: Fix build warnings introduced by 2173c6.
John Kessenich [Tue, 27 Nov 2018 14:45:52 +0000 (07:45 -0700)]
Build: Fix build warnings introduced by 2173c6.

Also bump version for recent changes.

5 years agoMerge pull request #1567 from Igalia/apinheiro/xfb-1535
John Kessenich [Tue, 27 Nov 2018 14:17:10 +0000 (07:17 -0700)]
Merge pull request #1567 from Igalia/apinheiro/xfb-1535

ParseHelper: assign global XfbBuffer to a block missing it

5 years agoMerge pull request #1595 from dgkoch/EXT_fragment_invocation_density
John Kessenich [Tue, 27 Nov 2018 13:41:36 +0000 (06:41 -0700)]
Merge pull request #1595 from dgkoch/EXT_fragment_invocation_density

Implement GL_EXT_fragment_invocation_density

5 years agoMerge pull request #1597 from sheredom/add_conversion_folding
John Kessenich [Tue, 27 Nov 2018 10:53:28 +0000 (03:53 -0700)]
Merge pull request #1597 from sheredom/add_conversion_folding

Add conversion folding when the source is a constant.

5 years agoMerge pull request #1598 from alan-baker/geo-xfb-caps
John Kessenich [Mon, 26 Nov 2018 17:53:24 +0000 (10:53 -0700)]
Merge pull request #1598 from alan-baker/geo-xfb-caps

Update known good SPIRV tools and headers

5 years agoUpdate known good SPIRV tools and headers
Alan Baker [Mon, 26 Nov 2018 16:24:22 +0000 (11:24 -0500)]
Update known good SPIRV tools and headers

* Fixes use of optimizer
* Updated test outputs
 * GeometryStreams and TransformFeedback no longer fail validation

5 years agoImplement GL_EXT_fragment_invocation_density
Daniel Koch [Mon, 26 Nov 2018 15:01:58 +0000 (10:01 -0500)]
Implement GL_EXT_fragment_invocation_density

including SPV generation using SPV_EXT_fragment_invocation_density.
This is an alias of the functionality in SPV_NV_shading_rate, and thus in some
cases we can only have one set of the tokens present (switch statements), so
we have picked the EXT version. This required updating the expected test
results for SPV_NV_shading_rate.

Also updated the known-good for spirv-headers so that the validator in
spirv-tools knows about the new extension.

5 years agoSPV: non-functional: update to latest headers.
John Kessenich [Mon, 26 Nov 2018 13:34:38 +0000 (06:34 -0700)]
SPV: non-functional: update to latest headers.

5 years agoAdd conversion folding when the source is a constant.
Neil Henning [Mon, 26 Nov 2018 10:17:33 +0000 (10:17 +0000)]
Add conversion folding when the source is a constant.

This change adds unary conversion folding when the source is a constant.
This fixes an ISV issue whereby:

```
const float16_t f = float16_t(42.0);
```

Wouldn't compile because the conversion operator would always produce an
EvqTemporary when it could have produced an EvqConst.

I've also added a test case that proves out that all basic-type to
basic-type conversions work.

5 years agoMerge pull request #1592 from KhronosGroup/subgroupBroadcast-const-id
John Kessenich [Sun, 25 Nov 2018 06:13:25 +0000 (23:13 -0700)]
Merge pull request #1592 from KhronosGroup/subgroupBroadcast-const-id

GLSL: Fix #1591: Require the id in subgroupBroadcast to be constant.

5 years agoGLSL: Fix #1591: Require the id in subgroupBroadcast to be constant.
John Kessenich [Wed, 21 Nov 2018 21:43:18 +0000 (14:43 -0700)]
GLSL: Fix #1591: Require the id in subgroupBroadcast to be constant.

5 years agoMerge pull request #1587 from dneto0/update-known-good
John Kessenich [Fri, 16 Nov 2018 21:41:13 +0000 (14:41 -0700)]
Merge pull request #1587 from dneto0/update-known-good

Update to newer SPIRV-Tools, including VK_EXT_scalar_block_layout

5 years agoUpdate to newer SPIRV-Tools, including VK_EXT_scalar_block_layout
David Neto [Fri, 16 Nov 2018 21:04:23 +0000 (16:04 -0500)]
Update to newer SPIRV-Tools, including VK_EXT_scalar_block_layout

Validator has more refined messages about what kind of block layout
rules have been applied.

5 years agoBump minor version.
John Kessenich [Fri, 16 Nov 2018 17:02:18 +0000 (10:02 -0700)]
Bump minor version.

5 years agoMerge branch 'jeffbolznv-scalar_block_layout'
John Kessenich [Fri, 16 Nov 2018 16:57:59 +0000 (09:57 -0700)]
Merge branch 'jeffbolznv-scalar_block_layout'

5 years agoMerge branch 'scalar_block_layout' of https://github.com/jeffbolznv/glslang into...
John Kessenich [Fri, 16 Nov 2018 16:57:33 +0000 (09:57 -0700)]
Merge branch 'scalar_block_layout' of https://github.com/jeffbolznv/glslang into jeffbolznv-scalar_block_layout

5 years agoMove to next SPIRV-Tools known good.
John Kessenich [Fri, 16 Nov 2018 06:43:35 +0000 (23:43 -0700)]
Move to next SPIRV-Tools known good.

5 years agoGLSL: Increase supported sizes of XBF strides and offsets.
John Kessenich [Thu, 15 Nov 2018 22:07:28 +0000 (15:07 -0700)]
GLSL: Increase supported sizes of XBF strides and offsets.

5 years agoMerge pull request #1583 from TiemoJung/fix_dot_int
John Kessenich [Thu, 15 Nov 2018 18:29:12 +0000 (11:29 -0700)]
Merge pull request #1583 from TiemoJung/fix_dot_int

[HLSL/Spir-V] fix for incorrect spir-v on int dot(int, int)

5 years agoBump revision.
John Kessenich [Thu, 15 Nov 2018 17:37:21 +0000 (10:37 -0700)]
Bump revision.

5 years agoUpdate to latest SPIR-V Tools.
John Kessenich [Thu, 15 Nov 2018 16:57:43 +0000 (09:57 -0700)]
Update to latest SPIR-V Tools.

5 years ago[HLSL/Spir-V] fix for incorrect spir-v on int dot(int, int)
t.jung [Thu, 15 Nov 2018 09:21:36 +0000 (10:21 +0100)]
[HLSL/Spir-V] fix for incorrect spir-v on int dot(int, int)

Decomposes OpDot into corresponding multiplies and additions.

5 years agoMerge pull request #1579 from TiemoJung/handle_c_register
John Kessenich [Wed, 14 Nov 2018 18:40:45 +0000 (11:40 -0700)]
Merge pull request #1579 from TiemoJung/handle_c_register

HLSL: implemented c register handling

5 years agoMerge pull request #1580 from TiemoJung/float1_times_scalar_fix
John Kessenich [Wed, 14 Nov 2018 18:39:22 +0000 (11:39 -0700)]
Merge pull request #1580 from TiemoJung/float1_times_scalar_fix

HLSL: fix invalid spir-v vector * scalar for float1

5 years agoMerge pull request #1577 from TiemoJung/fix_broken_type_system
John Kessenich [Wed, 14 Nov 2018 18:35:22 +0000 (11:35 -0700)]
Merge pull request #1577 from TiemoJung/fix_broken_type_system

Updated type conversion rules for HLSL frontend

5 years agoImplement GL_EXT_scalar_block_layout
Jeff Bolz [Wed, 14 Nov 2018 15:30:53 +0000 (09:30 -0600)]
Implement GL_EXT_scalar_block_layout

5 years agoHLSL: fix invalid spir-v vector * scalar for float1
t.jung [Wed, 14 Nov 2018 12:04:39 +0000 (13:04 +0100)]
HLSL: fix invalid spir-v vector * scalar for float1

Missing check for float results in always emitting OpIMul even for float types

5 years agoHLSL: implemented c register handling
t.jung [Wed, 14 Nov 2018 11:59:18 +0000 (12:59 +0100)]
HLSL: implemented c register handling

Adjusted a test not to use c register for
a structured buffer, they are supposed to
use t registers

Added comments with hints for what are the
register types are used for.

5 years agoUpdated type conversion rules for HLSL frontend
t.jung [Tue, 13 Nov 2018 16:11:03 +0000 (17:11 +0100)]
Updated type conversion rules for HLSL frontend

5 years agoMerge pull request #1571 from dj2/result
John Kessenich [Tue, 13 Nov 2018 15:36:43 +0000 (08:36 -0700)]
Merge pull request #1571 from dj2/result

Handle potentially uninitialized result

5 years agoReview feedback
Dan Sinclair [Tue, 13 Nov 2018 14:17:44 +0000 (09:17 -0500)]
Review feedback

5 years agoMerge pull request #1573 from dneto0/fix-pch
John Kessenich [Mon, 12 Nov 2018 23:13:40 +0000 (16:13 -0700)]
Merge pull request #1573 from dneto0/fix-pch

PCH filename depends on current binary dir

5 years agoPCH filename depends on current binary dir
David Neto [Mon, 12 Nov 2018 22:09:07 +0000 (17:09 -0500)]
PCH filename depends on current binary dir

Fixes #1572

5 years agoHandle potentially uninitialized result
Dan Sinclair [Mon, 12 Nov 2018 18:56:52 +0000 (13:56 -0500)]
Handle potentially uninitialized result

5 years agoMerge pull request #1569 from amdrexu/bugfix
John Kessenich [Mon, 12 Nov 2018 16:01:35 +0000 (09:01 -0700)]
Merge pull request #1569 from amdrexu/bugfix

Fix parser issue: redeclare gl_FragStencilRefARB is not supported

5 years agoFix parser issue: redeclare gl_FragStencilRefARB is not supported
Rex Xu [Mon, 12 Nov 2018 07:15:57 +0000 (15:15 +0800)]
Fix parser issue: redeclare gl_FragStencilRefARB is not supported

5 years agoParseHelper: assign global XfbBuffer to a block missing it
Alejandro Piñeiro [Tue, 23 Oct 2018 12:54:26 +0000 (14:54 +0200)]
ParseHelper: assign global XfbBuffer to a block missing it

If a block has assigned a XfbOffset it is assumed that it would
inherit the current global XfbBuffer. This commit fixes two use cases:

1) Getting the members of a Block with a XfbOffset to be assigned an
   offset, as explained on GLSL 4.60 spec, section "4.4.2 Output
   Layout Qualifiers", subsection "Transform Feedback Layout
   Qualifiers".

2) Compute properly an error on overlapping ranges if a block is
   assigned a XfbOffset and one of it members is assigned a explicit
   one. This gets working because when the members of a block get
   assigned a Offset/Buffer at fixBlockXfbOffsets, then the block is
   deassigned the Offsets, so ranges are computed only with the block
   members.

BTW, this is already done when redeclaring block builtins.

Fixes #1535

5 years agoMerge pull request #1547 from Igalia/apinheiro/xfb-struct-assignment
John Kessenich [Fri, 9 Nov 2018 19:27:39 +0000 (12:27 -0700)]
Merge pull request #1547 from Igalia/apinheiro/xfb-struct-assignment

Apinheiro/xfb struct assignment

5 years agoMerge pull request #1565 from greg-lunarg/kg25
John Kessenich [Fri, 9 Nov 2018 04:08:54 +0000 (21:08 -0700)]
Merge pull request #1565 from greg-lunarg/kg25

Add DeadBranchElim before MergeReturn in legalization.

5 years agoAdd DeadBranchElim before MergeReturn in legalization.
GregF [Thu, 8 Nov 2018 17:35:45 +0000 (10:35 -0700)]
Add DeadBranchElim before MergeReturn in legalization.

MergeReturn now requires this or could throw an error.

5 years agoFix #1563: Corrupt token when an object macro miscalls a function macro
John Kessenich [Thu, 8 Nov 2018 01:25:56 +0000 (18:25 -0700)]
Fix #1563: Corrupt token when an object macro miscalls a function macro

5 years agoPP: More clearly distinguish funtion-like and object-like macros
John Kessenich [Thu, 8 Nov 2018 00:14:46 +0000 (17:14 -0700)]
PP: More clearly distinguish funtion-like and object-like macros

5 years agoMerge pull request #1564 from jeffbolznv/spirv-pch
John Kessenich [Wed, 7 Nov 2018 17:01:25 +0000 (10:01 -0700)]
Merge pull request #1564 from jeffbolznv/spirv-pch

Rename PCH macro to glslang_pch (to avoid name collision) and update to latest spirv-tools

6 years agoRename PCH macro to glslang_pch (to avoid name collision) and update to latest spirv...
Jeff Bolz [Wed, 7 Nov 2018 15:35:20 +0000 (09:35 -0600)]
Rename PCH macro to glslang_pch (to avoid name collision) and update to latest spirv-tools

6 years agoTests: Add test for ways of calling no-argument macro with ().
John Kessenich [Tue, 6 Nov 2018 21:51:27 +0000 (14:51 -0700)]
Tests: Add test for ways of calling no-argument macro with ().

6 years agoMerge pull request #1559 from jeffbolznv/glslang_pch
John Kessenich [Fri, 2 Nov 2018 16:24:48 +0000 (10:24 -0600)]
Merge pull request #1559 from jeffbolznv/glslang_pch

Use precompiled headers for some glslang projects (MSVC-only)

6 years agoMerge pull request #1557 from nicebyte/spec-const-decorations
John Kessenich [Fri, 2 Nov 2018 16:23:22 +0000 (10:23 -0600)]
Merge pull request #1557 from nicebyte/spec-const-decorations

Add names for composite spec constants in SPIR-V

6 years agoAdd names for composite constants in SPIR-V
Grigory Dzhavadyan [Tue, 30 Oct 2018 05:56:44 +0000 (22:56 -0700)]
Add names for composite constants in SPIR-V

Consider the following code:

    layout(constant_id=0) const int Y = 1;
    layout(constant_id=1) const int Z = 2;
    layout(constant_id=3) const int X = Y + Z;

Previously, it would produce SPIR-V decorations like this:

    Decorate 21(Y) SpecId 1
    Decorate 22 SpecId 3
    Decorate 33(Z) SpecId 0

This seems inaccurate, since the spec constant `X` that is dependent on
the two others did not get a name in the SPIR-V decorations. This behavior
may potentially negatively affect shader introspection capabilities.

This change alters the behavior to always add a name, which results in the code
above producing the following decorations:

    Decorate 21(Y) SpecId 1
    Decorate 22(X) SpecId 3
    Decorate 33(Z) SpecId 0

6 years agoUse precompiled headers for some glslang projects
Jeff Bolz [Wed, 31 Oct 2018 20:38:08 +0000 (15:38 -0500)]
Use precompiled headers for some glslang projects

6 years agoMerge pull request #1543 from alelenv/nv-raytracing-final
John Kessenich [Wed, 31 Oct 2018 18:00:36 +0000 (12:00 -0600)]
Merge pull request #1543 from alelenv/nv-raytracing-final

Add support for nv_ray_tracing final

6 years agoMultiple features and misc fixes for final raytracing non experimental version.
Ashwin Lele [Mon, 22 Oct 2018 23:41:44 +0000 (16:41 -0700)]
Multiple features and misc fixes for final raytracing non experimental version.

6 years agoParseHelper: assign xfb_offset for struct members too
Alejandro Piñeiro [Fri, 26 Oct 2018 10:35:54 +0000 (12:35 +0200)]
ParseHelper: assign xfb_offset for struct members too

If the out variable is a struct type, with a xfb_offset explicitly
assigned, the members need to get their xfb_offset assigned. This is
specially relevant, as we cannot use layout qualifiers on struct
members.

6 years agoMerge pull request #1558 from Kangz/fix_build_gn
John Kessenich [Tue, 30 Oct 2018 23:17:11 +0000 (17:17 -0600)]
Merge pull request #1558 from Kangz/fix_build_gn

BUILD.gn: remove reference to non-existent header

6 years agoBUILD.gn: remove reference to non-existent header
Corentin Wallez [Tue, 30 Oct 2018 15:11:46 +0000 (16:11 +0100)]
BUILD.gn: remove reference to non-existent header

6 years agoMerge pull request #1556 from Kangz/msvc
John Kessenich [Mon, 29 Oct 2018 22:16:46 +0000 (16:16 -0600)]
Merge pull request #1556 from Kangz/msvc

Fix MSVC warning C4065: 'default' but no 'case' labels

6 years agoFix MSVC warning C4065: 'default' but no 'case' labels
Corentin Wallez [Mon, 29 Oct 2018 15:24:00 +0000 (16:24 +0100)]
Fix MSVC warning C4065: 'default' but no 'case' labels

This would happen in SpvPostProcess when we don't enable AMD extensions.

6 years agoBuild: Pin googletest to a version that works with visual studio 2013.
John Kessenich [Fri, 26 Oct 2018 17:28:37 +0000 (11:28 -0600)]
Build: Pin googletest to a version that works with visual studio 2013.

6 years agoMerge pull request #1542 from sheredom/fix_8bit_storagebuffer
John Kessenich [Fri, 26 Oct 2018 16:27:46 +0000 (10:27 -0600)]
Merge pull request #1542 from sheredom/fix_8bit_storagebuffer

Fix 8-bit storage nearly always using the UniformAndStorageBuffer8BitAccess capability.

6 years agoSPV/Standalone: Support specifying arbitrary versions of SPIR-V.
John Kessenich [Fri, 26 Oct 2018 16:12:32 +0000 (10:12 -0600)]
SPV/Standalone: Support specifying arbitrary versions of SPIR-V.

6 years agoMerge pull request #1549 from sparmarNV/fix-SPV_NV_mesh_shader
John Kessenich [Fri, 26 Oct 2018 15:25:38 +0000 (09:25 -0600)]
Merge pull request #1549 from sparmarNV/fix-SPV_NV_mesh_shader

Allow GL_NV_mesh_shader in fragment shaders for perprimitiveNV

6 years agoFix 8-bit storage nearly always using the
Neil Henning [Tue, 23 Oct 2018 14:02:29 +0000 (15:02 +0100)]
Fix 8-bit storage nearly always using the
UniformAndStorageBuffer8BitAccess capability.

When using the 8-bit storage extension it basically always used the
`UniformAndStorageBuffer8BitAccess` capability, even in cases where it
wasn't required. For instance if we are targeting Vulkan 1.1 (SPIR-V 1.3
or higher), and we are only using 8-bit types in an SSBO, we only need
the `StorageBuffer8BitAccess` capability.

I fixed this by enabling storage buffer use in Vulkan 1.1 / SPIR-V 1.3
or higher, and then changing the logic to match.

I also added some tests that will output different capabilities when run
on Vulkan 1.0 and 1.1, thus they are added twice to the test list (one
for each version).

Fixes #1539

6 years agoAllow GL_NV_mesh_shader in fragment shaders for perprimitiveNV
Sahil Parmar [Fri, 26 Oct 2018 06:50:59 +0000 (23:50 -0700)]
Allow GL_NV_mesh_shader in fragment shaders for perprimitiveNV

- Emit relevant capability/extension for use of perprimitiveNV in fragment shader
- Remove redundant checks for mesh shader qualifiers in glslang.y
- Add profile version check for use of extension GL_NV_mesh_shader
- Add a new gtest for use of perprimitiveNV in fragment shader

6 years agoMerge pull request #1545 from dj2/warnings
John Kessenich [Thu, 25 Oct 2018 19:44:40 +0000 (13:44 -0600)]
Merge pull request #1545 from dj2/warnings

Fixup unused parameter warnings

6 years agoPP: Fix #155: Don't give error on HLSL PP-only parsing.
John Kessenich [Thu, 25 Oct 2018 18:43:02 +0000 (12:43 -0600)]
PP: Fix #155: Don't give error on HLSL PP-only parsing.

6 years agoFixup unused parameter warnings
Dan Sinclair [Wed, 24 Oct 2018 13:54:45 +0000 (09:54 -0400)]
Fixup unused parameter warnings

This CL removes the current parameters which are unused in order to
fixup the issued clang warnings.

6 years agoMerge pull request #1534 from Kangz/no_static_lib
John Kessenich [Mon, 22 Oct 2018 14:33:55 +0000 (08:33 -0600)]
Merge pull request #1534 from Kangz/no_static_lib

BUILD.gn: remove the static_library target.

6 years agoBuild: Fix #1490, unused variables.
John Kessenich [Sun, 21 Oct 2018 00:30:57 +0000 (18:30 -0600)]
Build: Fix #1490, unused variables.

6 years agoFix #1536: use string instead of TString for uniform-location override.
John Kessenich [Sat, 20 Oct 2018 23:36:13 +0000 (17:36 -0600)]
Fix #1536: use string instead of TString for uniform-location override.

6 years agoBUILD.gn: remove the static_library target.
Corentin Wallez [Wed, 17 Oct 2018 10:22:28 +0000 (12:22 +0200)]
BUILD.gn: remove the static_library target.

This had no sources and depended on a source_set which is an invalid use
of GN because the source_set gets propagated to dependents of the
static_library instead.