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.
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.)
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.
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.
- 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.
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.
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
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
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
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.