1134 Commits

Author SHA1 Message Date
John Kessenich
ab8960fd12
Merge pull request #1416 from aejsmith/samplerless-texture-functions
Add support for GL_EXT_samplerless_texture_functions
2018-07-02 18:35:41 -06:00
John Kessenich
513cc4cf87 Merge branch 'HaydnTrigg-patch-1' 2018-07-02 16:13:29 -06:00
John Kessenich
c88edb1319 Merge branch 'patch-1' of https://github.com/HaydnTrigg/glslang into HaydnTrigg-patch-1 2018-07-02 16:04:08 -06:00
John Kessenich
802c62bca4 PP: Rationalize return values of MacroExpand.
This results in better error recovery, including fewer
crashes on badly formed PP input.
2018-07-02 13:47:31 -06:00
John Kessenich
9cc81de096 PP/HLSL: Fix #1424: support comma in nested curly braces for macro arg 2018-07-02 10:40:32 -06:00
Alex Smith
e47bfaedf6 Add support for GL_EXT_samplerless_texture_functions 2018-07-01 10:58:53 +01:00
Haydn Trigg
e826286f99
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.
2018-06-29 13:55:06 -04:00
John Kessenich
866f67140e Build: Make literal casting have fewer warnings and be more consistent. 2018-06-20 18:10:55 -06:00
John Kessenich
2a805d9cea 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.
2018-06-19 09:43:09 -06:00
Neil Roberts
1d024b5346 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.
2018-06-14 14:54:33 +02:00
John Kessenich
2c8265bb62 GLSL: Fix #1358: Support "struct name", where name could be a user type 2018-06-11 19:28:15 -06:00
John Kessenich
d6c975572e Change the major revision number for next commit. 2018-06-04 15:33:31 -06:00
LoopDawg
470a68cfd4 Fix several signed/unsigned comparison compile warnings. 2018-06-01 20:23:50 -06:00
John Kessenich
4f88853412 Fix #1391: Remove use of nonportable strnlen(). 2018-05-27 19:53:20 -06:00
John Kessenich
92d05c0c83
Merge pull request #1386 from zeux/master
Fix TextureUpgradeAndSamplerRemovalTransform when used with qualifiers
2018-05-25 16:10:58 -06:00
John Kessenich
3e8e9f7bbd 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
2018-05-24 22:08:30 -06:00
John Kessenich
6c52f8968c 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.
2018-05-24 18:24:06 -06:00
John Kessenich
1ea1b13f38 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.
2018-05-24 18:18:22 -06:00
Arseny Kapoulkine
b239d22f7b 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.
2018-05-21 15:27:07 -07:00
John Kessenich
ebec909487 GLSL: Fix #1279: refract does not have a double-type eta. 2018-05-17 10:43:21 -06:00
Neil Roberts
22b71f9af9 Skip outermost array when assigning locations to auto-array interfaces
When assigning a location to an interface whose stage automatically
converts the interfaces to an array, it now strips off the outermost
array from the type before calculating how many locations it consumes.
2018-05-10 16:53:49 +02:00
danginsburg
fb6924d23b Fix issue #1367 - change the I/O remapper to ignore push constants so it does not apply a binding/descriptor set to them. 2018-05-02 16:42:22 -04:00
John Kessenich
9cf275bb9e Build: Add missing break statements. Fixes #1052. 2018-04-26 14:12:29 -06:00
John Kessenich
46e07313f9 GLSL/Vulkan: Warn about arrays of arrays of resources that need bindings.
Initial way of addressing #1362.
2018-04-24 13:29:12 -06:00
John Kessenich
b4cb70fcd9 GLSL: Fix #1359: don't allow unsized arrays as initializers. 2018-04-23 15:32:47 -06:00
John Kessenich
c325f43646 GLSL: Fix #1300: Can redeclare without size a sized built-in block array. 2018-04-19 19:42:50 -06:00
John Kessenich
0f8d43e505 GLSL/Vulkan: Enforce no location aliasing in vertex inputs. 2018-04-12 11:37:57 -06:00
John Kessenich
5d3babdbdf Build: Fix #1347: Compile with NV_EXTENSIONS disabled. 2018-04-12 01:03:25 -06:00
John Kessenich
461ea09943 Non-functional: Fix tabs. 2018-04-11 00:03:47 -06:00
John Kessenich
e891afacf4 GLSL: Fix #1330: default outputs for GL_NV_geometry_shader_passthrough 2018-04-10 22:01:19 -06:00
John Kessenich
c3a370db1d
Merge pull request #1341 from St0fF-NPL-ToM/master
fix VS2012 compile issues
2018-04-10 14:16:39 -06:00
St0fF
1aaa3567d9 Revert "add ability to record accessed and declared "named defines""
This reverts commit e7350423067442f616431c1cdf4f18dd7990a491.
2018-04-10 14:44:23 +02:00
John Kessenich
619dc89684
Merge pull request #1338 from cgmb/minor-shaderlang-fixups
Minor cleanup in ShaderLang.cpp
2018-04-09 17:40:23 -06:00
John Kessenich
1dcd162399 GLSL/SPV: no location on atomic_uint; Fix #1339. 2018-04-09 17:21:30 -06:00
Cory Bloor
39bbad5a00 Minor cleanup in ShaderLang.cpp
Use unique_ptr to simplify memory management in ProcessDeferred.
2018-04-09 16:18:37 -06:00
St0fF
e735042306 add ability to record accessed and declared "named defines"
Added the needed 2 sets to TIntermediate, added accessor-functions, inserter functions.  Implemented recording of such named defines inside the preprocessor parser.
2018-04-09 19:28:45 +02:00
St0fF
77d04598d3 fix VS2012 compile issues
small fixes needed to compile under Win8.1/VS2012/static_lib
2018-04-09 17:37:01 +02:00
John Kessenich
b92ce60fc7 GLSL/SPV: Fix #1310: don't create unnecessary integer matrices. 2018-04-07 18:49:54 -06:00
John Kessenich
7f0bcfd8d8 Fix #1333: Protect against -g for non-generating code. 2018-04-05 19:00:01 -06:00
John Kessenich
5611c6d27b GLSL/SPV: Implement SPV_EXT_descriptor_indexing and GL_EXT_nonuniform_qualifier 2018-04-05 11:25:02 -06:00
John Kessenich
6a4a427efe GLSL: Implement correct semantic checking for run-time sized arrays. 2018-04-02 14:52:15 -06:00
John Kessenich
5a867acad5 Linker: Fix #1329: correctly merge unsized arrays, and fix link tests. 2018-04-01 21:22:34 -06:00
Matthew Albrecht
2199356979 Added getter for uniform block bindings 2018-03-30 09:58:01 -05:00
Jeff Bolz
2abe9a4d34 Implement GL_NV_shader_subgroup_partitioned 2018-03-29 22:52:17 -05:00
John Kessenich
7be36647fc
Merge pull request #1319 from KhronosGroup/array-rationalization
Array rationalization
2018-03-28 23:26:27 -06:00
John Kessenich
ead8622484 Non-functional. Rationalizations enabling future generalizations:
- Use much simpler method to update implicit array sizes.
  The previous overly complicated method was error prone.
- Rationalize all use of unsized arrays.
- Combine decorations when generating SPIR-V, to simplify
  adding extensions.
2018-03-28 18:01:20 -06:00
John Kessenich
2316924b09 Non-Functional: Remove merge-replicated code and fix white space. 2018-03-28 13:02:12 -06:00
Rex Xu
ae06d1fe94 Add int16 support to AMD_trinary_minmax and AMD_shader_ballot 2018-03-28 16:33:01 +08:00
John Kessenich
859b0342b8 Types: Fix #1290: Rationalize and correct "mixed" style array dimensioning.
There a couple functional problems, which when reduced down also led to
some good simplifications and rationalization.  So, this commit:
 - corrects "mixed" functionality: int[A] f[B] -> f[B][A]
 - correct multi-identifier decls: int[A] f[B], g[C] -> f and g are independently sized.
 - increases symmetry between different places in the code that do this
 - makes fewer ways to do the same thing; several methods are just gone now
 - makes more clear when something is copied or shared
2018-03-26 00:38:53 -06:00
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