Commit Graph

2978 Commits

Author SHA1 Message Date
GregF
c6831d1ed4 Add support for OpConstantNull and OpConstantSampler to spirv-remap
Fixes issue #1408
2018-06-19 13:51:28 -06:00
John Kessenich
c99304c5dc Bump revision. 2018-06-19 09:47:23 -06:00
John Kessenich
2a805d9cea Revert "GLSL: Fix #1279: refract does not have a double-type eta."
This reverts commit ebec909487.

Khronos decided glslang was originally correct, and the specifications
are incorrect.
2018-06-19 09:43:09 -06:00
John Kessenich
bea08fe02a
Merge pull request #1405 from Igalia/nroberts/amb-arrays
Take into account arrays of opaque types with --auto-map-bindings
2018-06-14 21:13:43 -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
1ea8f595f9
Merge pull request #1402 from greg-lunarg/kg21
Update spirv-tools known-good
2018-06-08 12:56:23 -06:00
GregF
ff50b9fbb9 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.
2018-06-08 11:10:33 -06:00
John Kessenich
7dc1a989b8
Merge pull request #1401 from dneto0/bad-e11
Relax a stringToDouble test for, OSX AppleClang 9.1
2018-06-07 01:33:48 -06:00
David Neto
617d1b1209 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
2018-06-06 22:36:42 -07:00
John Kessenich
ba018e6762 SPV: Fix #1399 emit ImageGatherExtended when using ConstOffsets operand 2018-06-05 08:53:36 -06:00
John Kessenich
ad7645f4f5 Fix #1360: uint->int width conversions must still be typed as uint. 2018-06-04 20:09:30 -06:00
John Kessenich
14b85d3ff3 Fix #1395: GLSL volatile maps to SPIR-V Volatile and Coherent.
The major version number was bumped in the previous commit to support
this.
2018-06-04 15:36:03 -06:00
John Kessenich
d6c975572e Change the major revision number for next commit. 2018-06-04 15:33:31 -06:00
John Kessenich
a7eb582ac5 Bump revision. 2018-06-04 15:30:54 -06:00
John Kessenich
9c3fde7f50
Merge pull request #1397 from LoopDawg/warning-fix-4
Fix several signed/unsigned comparison compile warnings.
2018-06-02 23:27:45 -06:00
LoopDawg
470a68cfd4 Fix several signed/unsigned comparison compile warnings. 2018-06-01 20:23:50 -06:00
John Kessenich
32d3ec3199
Merge pull request #1394 from greg-lunarg/kg20
Update spirv-tools known-good.
2018-05-31 18:31:18 -06:00
GregF
b0c42b2884 Update spirv-tools known-good.
Includes:

Fold FMix feeding Extract, and use the simplification pass.
2018-05-31 16:17:18 -06:00
John Kessenich
4f88853412 Fix #1391: Remove use of nonportable strnlen(). 2018-05-27 19:53:20 -06:00
John Kessenich
b91189dbe5
Merge pull request #876 from ligfx/cmaketargetincludedirectories
CMake: use target_include_directories to expose includes
2018-05-27 19:29:42 -06:00
Michael Maltese
a895f378ee CMake: use target_include_directories to expose includes
This makes glslang simpler to embed in larger projects.
2018-05-27 11:36:32 -07: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
369dc87a8f
Merge pull request #1387 from jeffbolznv/disassembly_explicit_types
Add bit width of types to disassembleInstruction
2018-05-25 15:55:41 -06:00
John Kessenich
fa34a9adea
Merge pull request #1385 from KhronosGroup/fix-strtod
PP: Fix strtod problems: add tests, remove 2nd use, replace
2018-05-25 11:08:14 -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
Jeff Bolz
af7a94876c Add bit width of types to disassembleInstruction 2018-05-24 21:08:20 -05: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
John Kessenich
8e4b496d4a
Merge pull request #1388 from greg-lunarg/kg19
Update spirv-tools known-good
2018-05-24 09:42:32 -06:00
GregF
d2b55801b9 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.
2018-05-23 18:56:20 -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
c6d255396f
Merge pull request #1384 from LoopDawg/self-cast
HLSL: allow self-type cast (as no-op passthrough)
2018-05-19 13:32:52 -06:00
LoopDawg
c59916710e 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
2018-05-17 13:03:12 -06:00
John Kessenich
2aaef1221f Bump revision. 2018-05-17 11:26:36 -06:00
John Kessenich
ebec909487 GLSL: Fix #1279: refract does not have a double-type eta. 2018-05-17 10:43:21 -06:00
John Kessenich
a0044f4fee
Merge pull request #1381 from LoopDawg/coverage_array
HLSL: require coverage mask to be arrayed output.
2018-05-17 10:22:40 -06:00
John Kessenich
98e1d7f64b
Merge pull request #1383 from amdrexu/bugfix
Fix issue #1376: SPV_AMD_gpu_shader_half_float is not emitted under vulkan1.1
2018-05-17 10:19:56 -06:00
Rex Xu
b4a2a6cf94 Fix issue #1376: SPV_AMD_gpu_shader_half_float is not emitted under
vulkan1.1

Interpolation functions, using 16-bit interpolants, should always emit
this extension string regardless of vulkan enviornment version.
2018-05-17 13:51:28 +08:00
LoopDawg
4e6d3eaf5d HLSL: require coverage mask to be arrayed output.
SPIR-V requires the coverage mask to be an array of integers, but HLSL
allows scalar integers.  This adds the requisite type conversion and
wrapped entry point handling.

Fixes: #1202
2018-05-16 13:58:10 -06:00
John Kessenich
cfb05ec702
Merge pull request #1379 from LoopDawg/groupid-fix
HLSL: various SPIR-V compute shader IDs must be 3-vectors of integers
2018-05-16 10:36:16 -06:00
LoopDawg
91a8178efb HLSL: various SPIR-V compute shader IDs must be a 3-vector of integers.
This PR forces the external definition of SV_GroupID variables to 3-vectors.
The conversion process between the shader-declared type and the external type
happens in wrapped main IO variable conversion.

The same applies to SV_DispatchThreadID and SV_GroupThreadID.

Fixes: #1371
2018-05-16 06:48:02 -06:00
John Kessenich
90de7a7495
Merge pull request #1378 from LoopDawg/append-decl-order
HLSL: Allow stream output Append() method after entry point.
2018-05-16 00:46:19 -06:00
LoopDawg
1326b8c754 HLSL: Allow stream output Append() method after entry point.
Append() method is special: unlike most outputs, it does not copy
some temporary data to a symbol in the entry point epilogue, but
rather uses an emit builtin after each write to the output stream.

This had been handled by remembering the special output symbol for
the stream as it was declared in the shader entry point before
symbol sanitization.  However the prior code was too simple and
only handled cases where the Append() method happened after the
entry point, so that the output symbol had been seen.

This PR adds a patching step so that the Append()s may appear in
any order WRT the entry point.  They are patched in an epilogue,
whereupon it is guaranteed in a well formed shader that we have
seen the appropriate declaration.

Fixes #1217.
2018-05-15 15:13:09 -06:00
John Kessenich
1831087e48 SPV: Fix #1374: For an SSBO 16-bit access, only emit StorageUniformBufferBlock16 capability. 2018-05-14 22:08:53 -06:00
John Kessenich
2fb966aad2
Merge pull request #1375 from Igalia/nroberts/aml-arrayio
Skip outermost array when assigning locations to auto-array interfaces
2018-05-12 14:24:05 -06:00
John Kessenich
ecbd056b75 Tests: Fix #1372: Don't legalize runtests HLSL tests.
We want these tests to be independent of whether SPIRV-opt is used.
2018-05-10 10:22:13 -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
John Kessenich
fd9d9ef436 Bump version. 2018-05-04 21:35:05 -06:00
John Kessenich
d2e9829a88
Merge pull request #1370 from KhronosGroup/fix-param-types
Fix #944: Convert argument type to match formal parameter type.
2018-05-04 21:19:47 -06:00