Commit Graph

1373 Commits

Author SHA1 Message Date
otakuto
d03da06ac1 Remove execute permissions 2018-08-07 03:16:20 +09:00
John Kessenich
994d4bf325 Tests: Add more string -> float tests. Related to #1456. 2018-07-27 13:06:54 -06:00
John Kessenich
e161cc11f7 GLSL: No more restrictions on (non)shadow sampler construction.
Match https://github.com/KhronosGroup/GLSL/pull/22
2018-07-25 12:11:04 -06:00
John Kessenich
62faea79d7
Merge pull request #1451 from KhronosGroup/shadow-forces-depth
GLSL/SPV: If a texture is used with a shadow sampler, force 'shadow'.
2018-07-23 16:41:00 -07:00
John Kessenich
11da9eed5d HLSL: Fix #1445: distance() works on scalars. 2018-07-23 16:55:01 -06:00
John Kessenich
7d4c9a07b5 GLSL: Construct shadow texture from non-shadow sampler.
Tracks https://github.com/KhronosGroup/GLSL/pull/22.
2018-07-23 15:59:09 -06:00
John Kessenich
0339af3c1f 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.
2018-07-23 15:58:32 -06:00
John Kessenich
5a7321eb03 Merge branch 'master' of https://github.com/zeux/glslang into zeux-master 2018-07-20 17:11:44 -06:00
John Kessenich
b617e14acb Link: Merge all the settings in TIntermediate.
Fixes #1309.
2018-07-20 12:34:59 -06:00
John Kessenich
41436ad204 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.)
2018-07-18 18:07:41 -06:00
John Kessenich
e7f9caeac4 Errors and Build: Fix build warnings, which also improved error messages. 2018-07-12 15:11:07 -06:00
John Kessenich
8dafeab47e
Merge pull request #1438 from Think-Silicon/getUniformStages
Reflection exposes the Shader Stages where a Uniform is present
2018-07-11 08:19:21 -07:00
John Kessenich
cf6bd066b9 HLSL: Fix #1432: Globally initialize local static variables. 2018-07-11 01:09:14 -06:00
dmpakas
f556e5da26 Reflection exposes the Shader Stages where a Uniform is present 2018-07-10 18:25:48 +03:00
Arseny Kapoulkine
112e2858cf 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.
2018-07-05 15:55:12 -07:00
John Kessenich
312dcfb070 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.
2018-07-03 13:51:31 -06:00
John Kessenich
dccfeedfc3 HLSL: Fix #1423: implement CalculateLevelOfDetailUnclamped().
(If there is a bias issue, we need to discover what it is.)
2018-07-02 18:53:19 -06:00
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
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
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
2c8265bb62 GLSL: Fix #1358: Support "struct name", where name could be a user type 2018-06-11 19:28:15 -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
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
Jeff Bolz
af7a94876c Add bit width of types to disassembleInstruction 2018-05-24 21:08:20 -05: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
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
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
ebec909487 GLSL: Fix #1279: refract does not have a double-type eta. 2018-05-17 10:43:21 -06: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
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
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
John Kessenich
d3ed90be3a Fix #944: Convert argument type to match formal parameter type. 2018-05-04 11:43:03 -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
d8462c6f49 validate script: fix path 2018-04-23 15:17:21 -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
3beac945ff Infrastructure: If using .hlsl suffix, default is -D. 2018-04-17 21:02:19 -06:00
John Kessenich
2ead40ffa8 Tests: Add usage and tests for previous commit. 2018-04-17 17:44:11 -06:00
John Kessenich
c034c5a8a2 HLSL/SPV: Declare DepthReplacing for shaders declaring SV_Depth* outputs. 2018-04-13 18:36:58 -06:00
danginsburg
5a69b675d6 Update gold results 2018-04-13 09:51:22 -04:00