3843 Commits

Author SHA1 Message Date
John Kessenich
569dd84a72
Merge pull request #1306 from Igalia/uniform-aml-v2
Improve --auto-map-locations for uniforms (v2)
2018-03-21 11:19:12 -06:00
John Kessenich
1b1ad97d0e
Merge pull request #1305 from amdrexu/bugfix
Add additional error check for fragment shader outputs
2018-03-21 10:35:59 -06:00
Neil Roberts
2d53904999 Take into account the number of locations taken up by a uniform
When assigning uniform locations it now takes into account the number
of locations occupied by the type. For uniforms, all types except
arrays and structs take up one location. For arrays the base location
count is multiplied by the array dimensions and for structs it is the
sum of the locations of each member.
2018-03-21 12:03:39 +01:00
Neil Roberts
1fe4a44759 Add locations to opaque types for OpenGL 2018-03-21 12:03:39 +01:00
Rex Xu
b126550b1a Add additional error check for fragment shader outputs
Int64 and uint64 are disallowed as fragment shader outputs, similar to
double.
2018-03-21 15:27:38 +08:00
John Kessenich
95b1334aa2 Bump patch version. 2018-03-19 01:11:04 -06:00
John Kessenich
ca4366cf51
Merge pull request #1302 from KhronosGroup/cpp-relax-skiptokens-errors
PP: don't give errors on some tokens under #if 0 (or similar).
2018-03-19 01:09:51 -06:00
John Kessenich
e7e081bda9 PP: don't give errors on some tokens under #if 0 (or similar).
Fixes #1295.

Tokens that are accepted by any version of HLSL or GLSL should be
allowed when #ifdef'd off, such that errors are not reported.
2018-03-19 00:43:18 -06:00
John Kessenich
56e8056582
Merge pull request #1282 from KhronosGroup/hlslFunctionality1
WIP: Implement SPV_GOOGLE_hlsl_functionality1.
2018-03-16 20:41:52 -06:00
John Kessenich
5d610ee1dc Implement SPV_GOOGLE_hlsl_functionality1.
Enabled via -fhlsl_functionality1
2018-03-16 20:21:44 -06:00
John Kessenich
cd23a47566
Merge pull request #1291 from ben-clayton/add-nv-nopersp
Add support for GL_NV_shader_noperspective_interpolation
2018-03-16 15:50:38 -06:00
John Kessenich
0af69da12e Bump patch version. 2018-03-16 11:52:10 -06:00
John Kessenich
fb1e40b4de
Merge pull request #1299 from KhronosGroup/fix-conversions
Fix conversions
2018-03-16 11:30:09 -06:00
Ben Clayton
f648083365 Add tests for GL_NV_shader_noperspective_interpolation 2018-03-16 16:49:29 +00:00
John Kessenich
cb32c54466
Merge pull request #1289 from Igalia/igalia/dmat-scalar-division
Use the correct type for the constant for matrix/scalar division
2018-03-15 23:49:59 -06:00
John Kessenich
647fccaf2f AST: Fix shift conversions, which don't require matching types.
The base and shift amount need to be integers, but not of the same type.
This fixes #1296 and replaces #1297.
2018-03-15 21:11:36 -06:00
John Kessenich
6e899be5ec Non-functional: Rationalize operators handled by the split addConversion() functions.
Historically, addConversion() was split to handle binary node <-> node conversions
from non-binary node -> type conversions. However, the split wasn't entirely clean
WRT HLSL design and left duplication of case statements, which are misleading, and
this commit cleans up.
2018-03-15 19:58:49 -06:00
John Kessenich
137a24dffa AST: Remove convertToBasicType() which was obfuscating the conversion design.
Reinforces that conversion rules are operation-specific.
Side effect is that HLSL logical-operator conversions are more direct
(e.g. float -> bool, rather than float -> int -> bool).
2018-03-15 19:32:27 -06:00
John Kessenich
075c8c11e2
Merge pull request #1294 from dgkoch/dgkoch_build_fixes4
Fix build several build errors
2018-03-14 01:05:56 -06:00
Daniel Koch
bfe0952118 Fix build several build errors
glslang/SPIRV/SpvBuilder.cpp:2533:27: error: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Werror,-Wsign-compare]
        for (int c = 0; c < accessChain.swizzle.size(); ++c)
                        ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

glslang/hlsl/hlslParseHelper.cpp:69:5: error: field 'cullDistanceInput' will be initialized after field 'clipDistanceOutput' [-Werror,-Wreorder]
    cullDistanceInput(nullptr),
    ^
1 error generated.

glslang/glslang/MachineIndependent/attribute.cpp:85:16: error: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Werror,-Wsign-compare]
    if (argNum >= args->getSequence().size())
        ~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
2018-03-13 17:06:51 -04:00
John Kessenich
3e2a3c46d2
Merge pull request #1293 from baldurk/remove-en-dash
Replace en-dash with simple ASCII hyphen
2018-03-13 14:32:56 -06:00
Baldur Karlsson
34cd7630f8 Replace en-dash with simple ASCII hyphen
* This means the source file is ASCII instead of (assumed) UTF-8 and
  doesn't cause warnings when compiling on non-western codepages.
2018-03-13 19:53:30 +00:00
Ben Clayton
017a567be1 Add support for GL_NV_shader_noperspective_interpolation 2018-03-13 15:55:18 +00:00
Neil Roberts
eddb1318ae Use the correct type for the constant for matrix/scalar division
When a matrix is divided by a scalar it tries to take the reciprocal
of the scalar to convert the operation into a multiply. However it was
always doing this by making a 32-bit constant. If the scalar is a
double then this would end up making an FDiv instruction with
different types in the operands.

This patch adds a helper method called makeFpConstant which makes a
floating-point constant of the given type. The code to take the
reciprocal now uses it to make the same type as the result.

Fixes https://github.com/KhronosGroup/glslang/issues/1278
2018-03-13 13:50:56 +01:00
John Kessenich
2ad4737dc2
Merge pull request #1286 from greg-lunarg/kg14
Update known_good to SPIR-V 1.3 support
2018-03-12 12:42:27 -06:00
John Kessenich
b095da74ed
Merge pull request #1288 from amdrexu/bugfix
HLSL: Correct some mistakes for min16 types
2018-03-12 12:41:56 -06:00
John Kessenich
2bd8cd04b0
Merge pull request #1287 from eintw1ck/master
include/Common.h: reorder includes to avoid redefinition on some platforms
2018-03-12 12:39:00 -06:00
Rex Xu
a00e51b5b2 HLSL: Correct some mistakes for min16 types
- Add missing constructor ops to support float16/int16/uint16 types
- Allow half float literals
- Correct two errors of double literal parse in HLSL: extension check and
  postfix
2018-03-12 23:15:11 +08:00
Josh de Kock
b3e80f5aec include/Common.h: reorder includes to avoid redefinition on some platforms
On some systems sstream defines snprintf, this leads to the a redefinition of sprintf_s if snprintf is defined before checking if it exists in sstream.
2018-03-11 19:51:17 +00:00
GregF
bfa64afb78 Increment minor version to 4 2018-03-09 17:51:11 -07:00
GregF
c96885f405 Update known_good to SPIR-V 1.3 support 2018-03-09 17:45:57 -07:00
John Kessenich
845860d565
Merge pull request #1283 from siavashserver/fix-memory-leak
Fix memory leak upon ProcessDeferred failure.
2018-03-08 10:55:02 -07:00
John Kessenich
ca2793403a
Merge pull request #1284 from amdrexu/bugfix
Allow --hlsl-enable-16bit-types to be used without AMD_EXTENSIONS
2018-03-08 10:24:32 -07:00
Rex Xu
7798aaf149 Allow --hlsl-enable-16bit-types to be used without AMD_EXTENSIONS 2018-03-08 22:17:04 +08:00
siavashserver
b502a802f4
Fix memory leak upon ProcessDeferred failure. 2018-03-08 09:13:36 +03:30
John Kessenich
a51525059f
Merge pull request #1269 from bkaradzic/master
Fixed GCC+Clang errors and warnings on Linux and OSX.
2018-03-07 14:31:57 -07:00
John Kessenich
9c82dd10cf Merge branch 'amdrexu-feature' 2018-03-07 14:30:40 -07:00
John Kessenich
fb97d25c98 Merge branch 'feature' of https://github.com/amdrexu/glslang into amdrexu-feature 2018-03-07 14:29:45 -07:00
John Kessenich
45422f1851 Merge branch 'amdrexu-bugfix' 2018-03-07 14:26:08 -07:00
John Kessenich
f15fbc04f7 Merge branch 'bugfix' of https://github.com/amdrexu/glslang into amdrexu-bugfix 2018-03-07 14:25:46 -07:00
John Kessenich
56364b0850 Merge branch 'sheredom-fixup_sm_60_wording' 2018-03-07 14:21:55 -07:00
John Kessenich
e62d1baf3a Merge branch 'fixup_sm_60_wording' of https://github.com/sheredom/glslang into sheredom-fixup_sm_60_wording 2018-03-07 14:20:11 -07:00
John Kessenich
ac3707921e Revert the commits that change OpArrayLength type and bumped the version number.
Now, version 5.* is all connected to making the uint type, which doesn't quite work.
Generator versions 4 and 6 do not do this.
2018-03-07 11:48:25 -07:00
Neil Henning
fd920b3b6a WaveReadLaneFirst is the correct wording (was using WaveReadFirstLane previously...). 2018-03-07 17:04:20 +00:00
John Kessenich
097047a919
Merge pull request #1277 from KhronosGroup/Vulkan_1_1
SPV: Implement Vulkan 1.1 features and extensions.
2018-03-07 09:26:43 -07:00
Rex Xu
e68a7698e6 Add more error checks for swizzleInvocations{Masked}AMD() 2018-03-07 17:22:41 +08:00
Rex Xu
cb61eec948 HLSL: Map min types to GLSL 16-bit types 2018-03-07 13:10:01 +08:00
Branimir Karadžić
1e5c946326 Fixed ifdef. 2018-03-06 20:11:46 -08:00
John Kessenich
66011cb2c2 SPV: Implement Vulkan 1.1 features and extensions. 2018-03-06 16:12:04 -07:00
John Kessenich
b2ae1d0521 Revert "Merge pull request #1274 from greg-lunarg/legal2"
This reverts commit 2c65069ecdbc41dc16580ff58d9d99a2e80ac9ce, reversing
changes made to fa9b465b92b7e043623ef24d9002aacb32fab0d8.
2018-03-06 14:50:41 -07:00