When capabilities are needed for specific SPIR-V instructions, it is
fragile to do so based on GLSL/AST usage; it should be based on actual
instructions they got translated to.
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.
- 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.
glslang/SPIRV/SpvBuilder.cpp:2533:27: error: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Werror,-Wsign-compare]
for (int c = 0; c < accessChain.swizzle.size(); ++c)
~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
glslang/hlsl/hlslParseHelper.cpp:69:5: error: field 'cullDistanceInput' will be initialized after field 'clipDistanceOutput' [-Werror,-Wreorder]
cullDistanceInput(nullptr),
^
1 error generated.
glslang/glslang/MachineIndependent/attribute.cpp:85:16: error: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Werror,-Wsign-compare]
if (argNum >= args->getSequence().size())
~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
When a matrix is divided by a scalar it tries to take the reciprocal
of the scalar to convert the operation into a multiply. However it was
always doing this by making a 32-bit constant. If the scalar is a
double then this would end up making an FDiv instruction with
different types in the operands.
This patch adds a helper method called makeFpConstant which makes a
floating-point constant of the given type. The code to take the
reciprocal now uses it to make the same type as the result.
Fixes https://github.com/KhronosGroup/glslang/issues/1278
This is a partial implemention of structurebuffers supporting:
* structured buffer types of:
* StructuredBuffer
* RWStructuredBuffer
* ByteAddressBuffer
* RWByteAddressBuffer
* Atomic operations on RWByteAddressBuffer
* Load/Load[234], Store/Store[234], GetDimensions methods (where allowed by type)
* globallycoherent flag
But NOT yet supporting:
* AppendStructuredBuffer / ConsumeStructuredBuffer types
* IncrementCounter/DecrementCounter methods
Please note: the stride returned by GetDimensions is as calculated by glslang for std430,
and may not match other environments in all cases.
- Add support for invocation functions with "InclusiveScan" and
"ExclusiveScan" modes.
- Add support for invocation functions taking int64/uint64/doube/float16
as inout data types.
- fixed ParseHelper.cpp newlines (crlf -> lf)
- removed trailing white space in most source files
- fix some spelling issues
- extra blank lines
- tabs to spaces
- replace #include comment about no location
- Support GL_AMD_shader_ballot (SPV_AMD_shader_ballot).
- Support GL_AMD_shader_trinary_minmax (SPV_AMD_shader_trinary_minmax).
- Support GL_AMD_shader_explicit_vertex_parameter
(SPV_AMD_shader_explicit_vertex_parameter).
- Support GL_AMD_gcn_shader (SPV_AMD_gcn_shader).