platform/upstream/glslang.git
6 years agoMerge pull request #1457 from KhronosGroup/parse-floats
John Kessenich [Fri, 27 Jul 2018 19:46:35 +0000 (12:46 -0700)]
Merge pull request #1457 from KhronosGroup/parse-floats

Tests: Add more string -> float tests. Related to #1456.

6 years agoPP: Address #1456: Strip float suffixes before using platform library.
John Kessenich [Fri, 27 Jul 2018 19:08:05 +0000 (13:08 -0600)]
PP: Address #1456: Strip float suffixes before using platform library.

6 years agoTests: Add more string -> float tests. Related to #1456.
John Kessenich [Fri, 27 Jul 2018 17:19:55 +0000 (11:19 -0600)]
Tests: Add more string -> float tests. Related to #1456.

6 years agoPP: floating-point parsing: more stable handling of istringstream::fail
John Kessenich [Thu, 26 Jul 2018 20:29:29 +0000 (14:29 -0600)]
PP: floating-point parsing: more stable handling of istringstream::fail

Possibly addresses #1456

6 years agoBump revision.
John Kessenich [Wed, 25 Jul 2018 21:33:34 +0000 (15:33 -0600)]
Bump revision.

6 years agoMerge pull request #1455 from TiemoJung/nullpointer_crash_fix
John Kessenich [Wed, 25 Jul 2018 18:13:05 +0000 (11:13 -0700)]
Merge pull request #1455 from TiemoJung/nullpointer_crash_fix

Fixes a crash when in/out varying variable had no semantic name and a…

6 years agoGLSL: No more restrictions on (non)shadow sampler construction.
John Kessenich [Wed, 25 Jul 2018 18:11:04 +0000 (12:11 -0600)]
GLSL: No more restrictions on (non)shadow sampler construction.

 Match https://github.com/KhronosGroup/GLSL/pull/22

6 years agoFixes a crash when in/out varying variable had no semantic name and an error was...
t.jung [Tue, 24 Jul 2018 11:22:21 +0000 (13:22 +0200)]
Fixes a crash when in/out varying variable had no semantic name and an error was reported in ioremapper phase when the variable was rejected

6 years agoMerge pull request #1451 from KhronosGroup/shadow-forces-depth
John Kessenich [Mon, 23 Jul 2018 23:41:00 +0000 (16:41 -0700)]
Merge pull request #1451 from KhronosGroup/shadow-forces-depth

GLSL/SPV: If a texture is used with a shadow sampler, force 'shadow'.

6 years agoHLSL: Fix #1445: distance() works on scalars.
John Kessenich [Mon, 23 Jul 2018 22:55:01 +0000 (16:55 -0600)]
HLSL: Fix #1445: distance() works on scalars.

6 years agoMerge pull request #1453 from greg-lunarg/kg22
John Kessenich [Mon, 23 Jul 2018 22:03:31 +0000 (15:03 -0700)]
Merge pull request #1453 from greg-lunarg/kg22

Update spirv-tools known good

6 years agoGLSL: Construct shadow texture from non-shadow sampler.
John Kessenich [Mon, 23 Jul 2018 21:59:09 +0000 (15:59 -0600)]
GLSL: Construct shadow texture from non-shadow sampler.

Tracks https://github.com/KhronosGroup/GLSL/pull/22.

6 years agoGLSL/SPV: If a texture is used with a shadow sampler, force 'shadow'.
John Kessenich [Sat, 21 Jul 2018 01:04:15 +0000 (19:04 -0600)]
GLSL/SPV: If a texture is used with a shadow sampler, force 'shadow'.

Fixes #854. But, only good if we are not trying to use the same
texture for both shadow and non-shadow constructors.

Force the type of the texture to have 'shadow' set when it is
constructed with a samplerShadow.

6 years agoUpdate spirv-tools known good
GregF [Mon, 23 Jul 2018 17:57:16 +0000 (11:57 -0600)]
Update spirv-tools known good

Includes the following:

Add Vulkan 1.1 capability sets
Don't merge types of resources
Remove stores of undef.
Make sure the constant folder get the correct type.

6 years agoMerge branch 'zeux-master'
John Kessenich [Fri, 20 Jul 2018 23:13:19 +0000 (17:13 -0600)]
Merge branch 'zeux-master'

6 years agoMerge branch 'master' of https://github.com/zeux/glslang into zeux-master
John Kessenich [Fri, 20 Jul 2018 21:28:38 +0000 (15:28 -0600)]
Merge branch 'master' of https://github.com/zeux/glslang into zeux-master

6 years agoMerge pull request #1450 from KhronosGroup/link-merge-all
John Kessenich [Fri, 20 Jul 2018 19:40:32 +0000 (12:40 -0700)]
Merge pull request #1450 from KhronosGroup/link-merge-all

Link: Merge all downstream consumed intermediate modes.

6 years agoLink: Merge all the settings in TIntermediate.
John Kessenich [Fri, 20 Jul 2018 05:10:32 +0000 (23:10 -0600)]
Link: Merge all the settings in TIntermediate.

Fixes #1309.

6 years agoMerge pull request #1436 from karl-lunarg/karl-ccache
John Kessenich [Thu, 19 Jul 2018 03:39:31 +0000 (20:39 -0700)]
Merge pull request #1436 from karl-lunarg/karl-ccache

build: Add ccache option to CMake config

6 years agoMerge pull request #1446 from KhronosGroup/spv-link
John Kessenich [Thu, 19 Jul 2018 00:29:17 +0000 (17:29 -0700)]
Merge pull request #1446 from KhronosGroup/spv-link

Link/SPV: Correct symbol IDs on merging ASTs to a single coherent space

6 years agoMerge pull request #1437 from mattparks/patch-2
John Kessenich [Thu, 19 Jul 2018 00:15:32 +0000 (17:15 -0700)]
Merge pull request #1437 from mattparks/patch-2

CMake options for postfix and SPVRemapper.

6 years agoMerge branch 'jeffbolznv-missing_descriptor_indexing_extension'
John Kessenich [Thu, 19 Jul 2018 00:11:16 +0000 (18:11 -0600)]
Merge branch 'jeffbolznv-missing_descriptor_indexing_extension'

6 years agoMerge branch 'missing_descriptor_indexing_extension' of https://github.com/jeffbolznv...
John Kessenich [Thu, 19 Jul 2018 00:10:45 +0000 (18:10 -0600)]
Merge branch 'missing_descriptor_indexing_extension' of https://github.com/jeffbolznv/glslang into jeffbolznv-missing_descriptor_indexing_extension

6 years agoLink/SPV: Correct symbol IDs on merging ASTs to a single coherent space
John Kessenich [Fri, 13 Jul 2018 16:40:40 +0000 (10:40 -0600)]
Link/SPV: Correct symbol IDs on merging ASTs to a single coherent space

This is one step in providing full linker functionality for creating
correct SPIR-V from multiple compilation units for the same stage.
(This was the only remaining "hard" part. The rest should be simple.)

6 years agoMerge pull request #1442 from dneto0/use-forked-android-ndk-repo
John Kessenich [Thu, 12 Jul 2018 22:07:51 +0000 (15:07 -0700)]
Merge pull request #1442 from dneto0/use-forked-android-ndk-repo

NDK build: Use NDK r17b and its own CMake toolchain file

6 years agoAdd missing OpExtension SPV_EXT_descriptor_indexing for dynamic indexing capabilities
Jeff Bolz [Thu, 12 Jul 2018 21:51:18 +0000 (16:51 -0500)]
Add missing OpExtension SPV_EXT_descriptor_indexing for dynamic indexing capabilities

6 years agoErrors and Build: Fix build warnings, which also improved error messages.
John Kessenich [Thu, 12 Jul 2018 21:11:07 +0000 (15:11 -0600)]
Errors and Build: Fix build warnings, which also improved error messages.

6 years agoNDK build: Use NDK r17b and its own CMake toolchain file
David Neto [Thu, 12 Jul 2018 18:49:26 +0000 (14:49 -0400)]
NDK build: Use NDK r17b and its own CMake toolchain file

More recent NDK releases have their own CMake toolchain file.
Use it.

Also, download the NDK from github.com:dneto0/android-ndk.
That is a fork of the repo we used to use, but we have more
control over how long it stays stable.

6 years agoTravis CI: Fix comments disabling code.
John Kessenich [Thu, 12 Jul 2018 17:37:09 +0000 (11:37 -0600)]
Travis CI: Fix comments disabling code.

6 years agoMerge pull request #1440 from dneto0/later-android
John Kessenich [Thu, 12 Jul 2018 17:01:54 +0000 (10:01 -0700)]
Merge pull request #1440 from dneto0/later-android

WIP: Travis-CI: Use Android NDK r13b specifically

6 years agoTravis-CI: Use Android NDK r13b specifically
David Neto [Wed, 11 Jul 2018 19:31:36 +0000 (15:31 -0400)]
Travis-CI: Use Android NDK r13b specifically

The Travis-CI bot downloads a copy of the Android NDK.  The source
we get it from recently updated to Android NDK r17b.  However,
the android.toolchain.cmake file does not know how to parse the
Android native API level from that version of the NDK.  So check
out the NDK r13b version that we were using until yesterday.

Fixes #1439

6 years agoMerge pull request #1438 from Think-Silicon/getUniformStages
John Kessenich [Wed, 11 Jul 2018 15:19:21 +0000 (08:19 -0700)]
Merge pull request #1438 from Think-Silicon/getUniformStages

Reflection exposes the Shader Stages where a Uniform is present

6 years agoNon-functional: Retrigger bots; the previous failure looks suspicious.
John Kessenich [Wed, 11 Jul 2018 08:24:36 +0000 (02:24 -0600)]
Non-functional: Retrigger bots; the previous failure looks suspicious.

6 years agoHLSL: Fix #1432: Globally initialize local static variables.
John Kessenich [Wed, 11 Jul 2018 07:09:14 +0000 (01:09 -0600)]
HLSL: Fix #1432: Globally initialize local static variables.

6 years agoReflection exposes the Shader Stages where a Uniform is present
dmpakas [Tue, 10 Jul 2018 15:25:48 +0000 (18:25 +0300)]
Reflection exposes the Shader Stages where a Uniform is present

6 years agoAllowed debug postfix to be changed.
Matthew Albrecht [Sat, 7 Jul 2018 22:00:08 +0000 (17:00 -0500)]
Allowed debug postfix to be changed.

6 years agoAdded the cmake option to disable building SPVRemapper.
Matthew Albrecht [Sat, 7 Jul 2018 21:53:06 +0000 (16:53 -0500)]
Added the cmake option to disable building SPVRemapper.

6 years agoMerge pull request #1434 from antiagainst/fix-spirv-tools-header
John Kessenich [Fri, 6 Jul 2018 19:18:32 +0000 (13:18 -0600)]
Merge pull request #1434 from antiagainst/fix-spirv-tools-header

Use public SPIRV-Tools header

6 years agobuild: Add ccache option to CMake config
Karl Schultz [Fri, 6 Jul 2018 18:12:09 +0000 (12:12 -0600)]
build: Add ccache option to CMake config

This is totally optional, but lets people build this repo with
ccache to improve rebuild speeds.  It also can help a great deal
on ccache-enabled CI systems like Travis-CI.  We build fixed
revisions of glslang a lot on Travis, so this will be a big help
with CI machine loading.

6 years agoSPIRV: Simplify matrix->matrix constructor
Arseny Kapoulkine [Thu, 5 Jul 2018 20:19:39 +0000 (13:19 -0700)]
SPIRV: Simplify matrix->matrix constructor

When constructing a matrix from another matrix with smaller dimensions,
there's no need to extract the scalars out of columns and rebuild the
resulting matrix from scalars - instead, we can just construct shorter
vectors with OpShuffle and combine them to the final result.

This keeps the common casts such as mat3(mat4) in vector registers,
which may improve performance for some GPUs, and cleans up output of
translation tools like SPIRV-Cross.

Fixes #1412.

6 years agoUse public SPIRV-Tools header
Lei Zhang [Wed, 4 Jul 2018 18:53:45 +0000 (14:53 -0400)]
Use public SPIRV-Tools header

6 years agoMerge pull request #1431 from KhronosGroup/implement-8-16-bit-storage
John Kessenich [Tue, 3 Jul 2018 20:21:07 +0000 (14:21 -0600)]
Merge pull request #1431 from KhronosGroup/implement-8-16-bit-storage

Implement GL_EXT_shader_16bit_storage and GL_EXT_shader_8bit_storage …

6 years agoImplement GL_EXT_shader_16bit_storage and GL_EXT_shader_8bit_storage extensions.
John Kessenich [Tue, 3 Jul 2018 19:19:51 +0000 (13:19 -0600)]
Implement GL_EXT_shader_16bit_storage and GL_EXT_shader_8bit_storage extensions.

These introduce limited support for 8/16-bit types such that they can only be accessed in buffer memory and converted to/from 32-bit types.

Contributed from Khronos-internal work.

6 years agoBump revision.
John Kessenich [Tue, 3 Jul 2018 15:34:43 +0000 (09:34 -0600)]
Bump revision.

6 years agoHLSL: Fix #1423: implement CalculateLevelOfDetailUnclamped().
John Kessenich [Tue, 3 Jul 2018 00:52:14 +0000 (18:52 -0600)]
HLSL: Fix #1423: implement CalculateLevelOfDetailUnclamped().

(If there is a bias issue, we need to discover what it is.)

6 years agoMerge pull request #1416 from aejsmith/samplerless-texture-functions
John Kessenich [Tue, 3 Jul 2018 00:35:41 +0000 (18:35 -0600)]
Merge pull request #1416 from aejsmith/samplerless-texture-functions

Add support for GL_EXT_samplerless_texture_functions

6 years agoMerge branch 'HaydnTrigg-patch-1'
John Kessenich [Mon, 2 Jul 2018 22:04:31 +0000 (16:04 -0600)]
Merge branch 'HaydnTrigg-patch-1'

6 years agoMerge branch 'patch-1' of https://github.com/HaydnTrigg/glslang into HaydnTrigg-patch-1
John Kessenich [Mon, 2 Jul 2018 22:04:08 +0000 (16:04 -0600)]
Merge branch 'patch-1' of https://github.com/HaydnTrigg/glslang into HaydnTrigg-patch-1

6 years agoMerge pull request #1420 from KhronosGroup/spir-dis
John Kessenich [Mon, 2 Jul 2018 21:55:01 +0000 (15:55 -0600)]
Merge pull request #1420 from KhronosGroup/spir-dis

SPV: Add option to print disassembly in standard form using SPIRV-Tools.

6 years agoSPV: Add option to print disassembly in standard form using SPIRV-Tools.
John Kessenich [Tue, 12 Jun 2018 00:12:15 +0000 (18:12 -0600)]
SPV: Add option to print disassembly in standard form using SPIRV-Tools.

6 years agoBump revision.
John Kessenich [Mon, 2 Jul 2018 19:49:16 +0000 (13:49 -0600)]
Bump revision.

6 years agoPP: Rationalize return values of MacroExpand.
John Kessenich [Mon, 2 Jul 2018 19:47:31 +0000 (13:47 -0600)]
PP: Rationalize return values of MacroExpand.

This results in better error recovery, including fewer
crashes on badly formed PP input.

6 years agoPP/HLSL: Fix #1424: support comma in nested curly braces for macro arg
John Kessenich [Mon, 2 Jul 2018 16:40:32 +0000 (10:40 -0600)]
PP/HLSL: Fix #1424: support comma in nested curly braces for macro arg

6 years agoAdd support for GL_EXT_samplerless_texture_functions
Alex Smith [Sat, 23 Jun 2018 08:34:24 +0000 (09:34 +0100)]
Add support for GL_EXT_samplerless_texture_functions

6 years agoConstant.cpp Floating point divide by zero
Haydn Trigg [Fri, 29 Jun 2018 17:55:06 +0000 (13:55 -0400)]
Constant.cpp Floating point divide by zero

Constant.cpp will throw a floating point divide by zero if floating point exceptions are enabled in Win32 causing the program to crash. This fix manually checks the right-hand argument of the division and sets appropriate Infinity, Negative Infinity, or NAN as if the floating point exceptions were disabled.

6 years agoMerge pull request #1419 from tgjones/spirv-remap-artifact
John Kessenich [Wed, 27 Jun 2018 22:47:38 +0000 (16:47 -0600)]
Merge pull request #1419 from tgjones/spirv-remap-artifact

Include spirv-remap.exe in AppVeyor artifacts

6 years agoInclude spirv-remap.exe in AppVeyor artifacts
Tim Jones [Wed, 27 Jun 2018 09:31:19 +0000 (17:31 +0800)]
Include spirv-remap.exe in AppVeyor artifacts

6 years agoMerge pull request #1413 from karl-lunarg/fix-update
John Kessenich [Fri, 22 Jun 2018 06:33:36 +0000 (00:33 -0600)]
Merge pull request #1413 from karl-lunarg/fix-update

script: Improve update sources script

6 years agoscript: Improve update sources script
Karl Schultz [Thu, 21 Jun 2018 23:30:07 +0000 (17:30 -0600)]
script: Improve update sources script

- remove unused variable to pass pylint
- Use another approach to detect if known-good remote is already
  present to avoid the need for "ignore following errors" message.

6 years agoMerge pull request #1411 from KhronosGroup/fix-literal-warnings
John Kessenich [Thu, 21 Jun 2018 00:54:12 +0000 (18:54 -0600)]
Merge pull request #1411 from KhronosGroup/fix-literal-warnings

Build: Make literal casting have fewer warnings and be more consistent.

6 years agoBuild: Make literal casting have fewer warnings and be more consistent.
John Kessenich [Thu, 21 Jun 2018 00:10:55 +0000 (18:10 -0600)]
Build: Make literal casting have fewer warnings and be more consistent.

6 years agoMerge pull request #1409 from greg-lunarg/remap3
John Kessenich [Wed, 20 Jun 2018 05:52:10 +0000 (23:52 -0600)]
Merge pull request #1409 from greg-lunarg/remap3

Add support for OpConstantNull and OpConstantSampler to spirv-remap

6 years agoAdd support for OpConstantNull and OpConstantSampler to spirv-remap
GregF [Tue, 19 Jun 2018 19:47:50 +0000 (13:47 -0600)]
Add support for OpConstantNull and OpConstantSampler to spirv-remap

Fixes issue #1408

6 years agoBump revision.
John Kessenich [Tue, 19 Jun 2018 15:47:23 +0000 (09:47 -0600)]
Bump revision.

6 years agoRevert "GLSL: Fix #1279: refract does not have a double-type eta."
John Kessenich [Tue, 19 Jun 2018 15:43:09 +0000 (09:43 -0600)]
Revert "GLSL: Fix #1279: refract does not have a double-type eta."

This reverts commit ebec909487b8c44a8c28b40c9899857593cc9bb5.

Khronos decided glslang was originally correct, and the specifications
are incorrect.

6 years agoMerge pull request #1405 from Igalia/nroberts/amb-arrays
John Kessenich [Fri, 15 Jun 2018 03:13:43 +0000 (21:13 -0600)]
Merge pull request #1405 from Igalia/nroberts/amb-arrays

Take into account arrays of opaque types with --auto-map-bindings

6 years agoTake into account arrays of opaque types when reserving bindings
Neil Roberts [Wed, 13 Jun 2018 10:00:18 +0000 (12:00 +0200)]
Take into account arrays of opaque types when reserving bindings

TDefaultIoResolverBase::reserveSlot and getFreeSlot now have a size
parameter to reserve a range of bindings. This is used by
TDefaultIoResolver::resolveBinding to reserve a continuous range when
the type is an array and the target API is GL.

6 years agoGLSL: Fix #1358: Support "struct name", where name could be a user type
John Kessenich [Tue, 12 Jun 2018 01:25:24 +0000 (19:25 -0600)]
GLSL: Fix #1358: Support "struct name", where name could be a user type

6 years agoMerge pull request #1402 from greg-lunarg/kg21
John Kessenich [Fri, 8 Jun 2018 18:56:23 +0000 (12:56 -0600)]
Merge pull request #1402 from greg-lunarg/kg21

Update spirv-tools known-good

6 years agoUpdate spirv-tools known-good
GregF [Fri, 8 Jun 2018 17:10:33 +0000 (11:10 -0600)]
Update spirv-tools known-good

Includes the following spirv-opt improvements:

Preserve inst-to-block and def-use in passes.
Add store for var initializer in inlining.
Handle types with self references.

6 years agoMerge pull request #1401 from dneto0/bad-e11
John Kessenich [Thu, 7 Jun 2018 07:33:48 +0000 (01:33 -0600)]
Merge pull request #1401 from dneto0/bad-e11

Relax a stringToDouble test for, OSX AppleClang 9.1

6 years agoRelax a stringToDouble test for, OSX AppleClang 9.1
David Neto [Thu, 7 Jun 2018 00:19:19 +0000 (17:19 -0700)]
Relax a stringToDouble test for, OSX AppleClang 9.1

1e-323 was flushed to zero.
1e-308 is also flushed to zero.
Use 1e-307 instead, which still satisfies the test intent.

Fixes #1400

6 years agoSPV: Fix #1399 emit ImageGatherExtended when using ConstOffsets operand
John Kessenich [Tue, 5 Jun 2018 14:53:36 +0000 (08:53 -0600)]
SPV: Fix #1399 emit ImageGatherExtended when using ConstOffsets operand

6 years agoFix #1360: uint->int width conversions must still be typed as uint.
John Kessenich [Tue, 5 Jun 2018 01:11:25 +0000 (19:11 -0600)]
Fix #1360: uint->int width conversions must still be typed as uint.

6 years agoFix #1395: GLSL volatile maps to SPIR-V Volatile and Coherent.
John Kessenich [Mon, 4 Jun 2018 21:36:03 +0000 (15:36 -0600)]
Fix #1395: GLSL volatile maps to SPIR-V Volatile and Coherent.

The major version number was bumped in the previous commit to support
this.

6 years agoChange the major revision number for next commit.
John Kessenich [Mon, 4 Jun 2018 21:33:31 +0000 (15:33 -0600)]
Change the major revision number for next commit.

6 years agoBump revision.
John Kessenich [Mon, 4 Jun 2018 21:30:54 +0000 (15:30 -0600)]
Bump revision.

6 years agoMerge pull request #1397 from LoopDawg/warning-fix-4
John Kessenich [Sun, 3 Jun 2018 05:27:45 +0000 (23:27 -0600)]
Merge pull request #1397 from LoopDawg/warning-fix-4

Fix several signed/unsigned comparison compile warnings.

6 years agoFix several signed/unsigned comparison compile warnings.
LoopDawg [Sat, 2 Jun 2018 02:23:34 +0000 (20:23 -0600)]
Fix several signed/unsigned comparison compile warnings.

6 years agoMerge pull request #1394 from greg-lunarg/kg20
John Kessenich [Fri, 1 Jun 2018 00:31:18 +0000 (18:31 -0600)]
Merge pull request #1394 from greg-lunarg/kg20

Update spirv-tools known-good.

6 years agoUpdate spirv-tools known-good.
GregF [Thu, 31 May 2018 22:17:18 +0000 (16:17 -0600)]
Update spirv-tools known-good.

Includes:

Fold FMix feeding Extract, and use the simplification pass.

6 years agoFix #1391: Remove use of nonportable strnlen().
John Kessenich [Mon, 28 May 2018 01:53:20 +0000 (19:53 -0600)]
Fix #1391: Remove use of nonportable strnlen().

6 years agoMerge pull request #876 from ligfx/cmaketargetincludedirectories
John Kessenich [Mon, 28 May 2018 01:29:42 +0000 (19:29 -0600)]
Merge pull request #876 from ligfx/cmaketargetincludedirectories

CMake: use target_include_directories to expose includes

6 years agoCMake: use target_include_directories to expose includes
Michael Maltese [Tue, 2 May 2017 23:16:06 +0000 (16:16 -0700)]
CMake: use target_include_directories to expose includes

This makes glslang simpler to embed in larger projects.

6 years agoMerge pull request #1386 from zeux/master
John Kessenich [Fri, 25 May 2018 22:10:58 +0000 (16:10 -0600)]
Merge pull request #1386 from zeux/master

Fix TextureUpgradeAndSamplerRemovalTransform when used with qualifiers

6 years agoMerge pull request #1387 from jeffbolznv/disassembly_explicit_types
John Kessenich [Fri, 25 May 2018 21:55:41 +0000 (15:55 -0600)]
Merge pull request #1387 from jeffbolznv/disassembly_explicit_types

Add bit width of types to disassembleInstruction

6 years agoMerge pull request #1385 from KhronosGroup/fix-strtod
John Kessenich [Fri, 25 May 2018 17:08:14 +0000 (11:08 -0600)]
Merge pull request #1385 from KhronosGroup/fix-strtod

PP: Fix strtod problems: add tests, remove 2nd use, replace

6 years agoPP: Implement locale-independent strtod, using istringstream and a fast path.
John Kessenich [Fri, 25 May 2018 00:26:44 +0000 (18:26 -0600)]
PP: Implement locale-independent strtod, using istringstream and a fast path.

Fixes #1228. Fixes #234.

This uses imbue() to be locale independent.  Notes:

- 'sstream >> double' is much slower than strtod()
  * this was measurable in the test suite as a whole, despite being
    a tiny fraction of what the test suite does
- so, this embeds a fast path that bypasses sstream most of the time
  => the test suite is faster than before
- sstream is probably slower, because it does more accurate rounding than strtod()
- sstream does not create INFINITY by itself, this was done based on failure inferencing

6 years agoAdd bit width of types to disassembleInstruction
Jeff Bolz [Wed, 23 May 2018 04:13:30 +0000 (23:13 -0500)]
Add bit width of types to disassembleInstruction

6 years agoPP: Remove second parsing of numbers recorded in macros; save/use original.
John Kessenich [Fri, 25 May 2018 00:24:06 +0000 (18:24 -0600)]
PP: Remove second parsing of numbers recorded in macros; save/use original.

This partly addresses #1228 and #234 by reducing usage of strtod (or atof).
There is now only place to parse a floating-point number.

6 years agoTesting: Add new tests, and new ways of testing, for floating-point.
John Kessenich [Fri, 25 May 2018 00:11:47 +0000 (18:11 -0600)]
Testing: Add new tests, and new ways of testing, for floating-point.

- Adds a pragma to see binary output of double values (not portable)
- Print decimals that show more values, but in a portable way
  (lots of portability issues)
- Expand the tests to test more double values

Note: it is quite difficult to have 100% portable tests for floating point.
The current situation works by not printing full precision, and working around
several portability issues.

6 years agoMerge pull request #1388 from greg-lunarg/kg19
John Kessenich [Thu, 24 May 2018 15:42:32 +0000 (09:42 -0600)]
Merge pull request #1388 from greg-lunarg/kg19

Update spirv-tools known-good

6 years agoUpdate spirv-tools known-good
GregF [Thu, 24 May 2018 00:56:20 +0000 (18:56 -0600)]
Update spirv-tools known-good

Includes:

Fold divide and multiply by same value.
Allow ADCE to remove more instructions.
Remove dead Workgroup variables in ADCE.
Fold fclamp feeding compare.
Add pass to fold a load feeding an extract.
Remove redundant stores.
SROA: Only create symbols that are loaded.
Get ADCE to handle OpCopyMemory
Remove the limit on struct size in SROA.

6 years agoFix TextureUpgradeAndSamplerRemovalTransform when used with qualifiers
Arseny Kapoulkine [Mon, 21 May 2018 22:27:07 +0000 (15:27 -0700)]
Fix TextureUpgradeAndSamplerRemovalTransform when used with qualifiers

The transform removes sampler arguments from functions and function
calls; this causes function arguments to change their indices. When some
function arguments have an output qualifier, this qualifier can get lost
because of the removal which can lead to incorrect results (e.g. out
qualifier not having effect).

To fix this we iterate through both seq & qual arrays in lock-step and
manually remove/replace entries as appropriate.

6 years agoMerge pull request #1384 from LoopDawg/self-cast
John Kessenich [Sat, 19 May 2018 19:32:52 +0000 (13:32 -0600)]
Merge pull request #1384 from LoopDawg/self-cast

HLSL: allow self-type cast (as no-op passthrough)

6 years agoHLSL: allow self-type cast (as no-op passthrough)
LoopDawg [Thu, 17 May 2018 19:03:12 +0000 (13:03 -0600)]
HLSL: allow self-type cast (as no-op passthrough)

Previously, casting an object of a struct type to an identical type
would produce an error.  This PR allows this case.

As a side-effect of the change, several self-type casts in existing
tests go away.  For example:

    0:10          Construct float ( temp float)
    0:10            'f' ( in float)

becomes this (without the unneeded constructor op):

    0:10          'f' ( in float)

For vector or array types this can result in somewhat less overall code.

Fixes: #1218

6 years agoBump revision.
John Kessenich [Thu, 17 May 2018 17:26:36 +0000 (11:26 -0600)]
Bump revision.

6 years agoGLSL: Fix #1279: refract does not have a double-type eta.
John Kessenich [Thu, 17 May 2018 16:42:10 +0000 (10:42 -0600)]
GLSL: Fix #1279: refract does not have a double-type eta.

6 years agoMerge pull request #1381 from LoopDawg/coverage_array
John Kessenich [Thu, 17 May 2018 16:22:40 +0000 (10:22 -0600)]
Merge pull request #1381 from LoopDawg/coverage_array

HLSL: require coverage mask to be arrayed output.

6 years agoMerge pull request #1383 from amdrexu/bugfix
John Kessenich [Thu, 17 May 2018 16:19:56 +0000 (10:19 -0600)]
Merge pull request #1383 from amdrexu/bugfix

Fix issue #1376: SPV_AMD_gpu_shader_half_float is not emitted under vulkan1.1