Hans-Kristian Arntzen
d75666b170
GLSL: Emit num_views for OVR_multiview2.
2021-06-28 12:56:27 +02:00
Hans-Kristian Arntzen
26a4986009
GLSL: Implement noncoherent framebuffer fetch.
2021-05-21 14:22:57 +02:00
Hans-Kristian Arntzen
e47a30e807
Honor NoContraction qualifier.
...
We'll need to force a temporary and mark it as precise.
MSL is a little weird here, but we can piggyback on top of the invariant
float math option here to force fma() operations everywhere.
2021-05-07 12:59:47 +02:00
Hans-Kristian Arntzen
532f65583e
Rewrite how non-uniform qualifiers are handled.
...
Remove all shenanigans with propagation, and only consume nonuniform
qualifiers exactly where needed (last minute).
2021-04-22 16:03:08 +02:00
Hans-Kristian Arntzen
96ba044f01
HLSL: Fix automatic location assignment in block IO.
2021-04-20 13:04:26 +02:00
Hans-Kristian Arntzen
ae9ca7d73c
MSL: Fix copy of arrays to/from stage IO variables.
...
Need to take into account effective storage classes and whether or not
we target stage IO blocks since native arrays are conditionally enabled.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
75ed73818c
MSL: Handle loading Clip/CullDistance in TESE.
...
Need to allow the flattened space to go through in some edge cases where
we cannot reasonably unflatten.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
ae7bb41ef4
MSL: Test that we can mask location writes in TESC.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
ba93b6518d
MSL: Fix masking of vertex block outputs.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
a393de31e6
MSL: Refactor out variable/block member masking.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
394c038bfd
MSL: Do not consider effective storage for any composite.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
f2b5fb3f45
MSL: Emit threadgroup storage class for masked control point outputs.
...
Shader can still rely on writes to threadgroup memory to be visible.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
2a2d57df13
MSL: Sketch out API to aid LTO-style optimization.
2021-04-19 12:10:49 +02:00
Hans-Kristian Arntzen
ee31e84e30
GLSL: Handle complex load/store scenarios to gl_SampleMask.
...
Need special workarounds to handle array load/store since array size is
unsized in GLSL, and array copy is not possible.
Also, consider bitcast for scalar loads and stores.
2021-03-09 10:25:03 +01:00
Hans-Kristian Arntzen
97796e0609
MSL: Deal with pointer-to-pointer qualifier ordering.
2021-02-26 13:37:14 +01:00
Hans-Kristian Arntzen
7ab3f3f74e
Deal better with CompositeExtract from constant composite.
...
There is no good reason for applications to emit this kind of code, but
some do. Special case this scenario.
2021-01-22 12:30:16 +01:00
Hans-Kristian Arntzen
4704482bbc
meta: Update copyright headers to 2021.
2021-01-14 16:07:49 +01:00
Hans-Kristian Arntzen
2097c30985
GLSL: Support both SPV_KHR_ray_tracing and NV_ray_tracing.
...
Fairly minor differences, so can keep them side by side without too much
effort. NV support is effectively deprecated now however.
- Add OpConvertUToAccelerationStructureKHR
- Ignore/Terminate ray is now a terminator in KHR, but a call in NV.
- Fix some bugs with reportIntersection.
2021-01-08 14:59:04 +01:00
Hans-Kristian Arntzen
39fee93906
GLSL: Refactor out Output variable initialization.
2021-01-05 12:50:36 +01:00
Hans-Kristian Arntzen
175381fe08
GLSL: Handle some extreme edge cases in Output variable initialization.
...
Deal with patch blocks, arrays of patch blocks, arrays of blocks, etc.
2021-01-05 12:06:36 +01:00
Hans-Kristian Arntzen
c8765a75f2
GLSL: Fix KHR subgroup extension table for subgroups.
2020-12-11 12:26:43 +01:00
Hans-Kristian Arntzen
a11c4780d0
GLSL: Emit nonuniformEXT in correct place for late-combined samplers.
...
Need to emit nonuniformEXT(sampler2D()) since constructor expressions in
Vulkan GLSL do not propgate the nonuniform qualifier.
2020-12-07 13:00:15 +01:00
Hans-Kristian Arntzen
cf1e9e0643
Add MIT dual license for the SPIRV-Cross API.
2020-12-01 16:47:08 +01:00
Hans-Kristian Arntzen
6fc2a0581a
Run format_all.sh.
2020-11-08 13:59:52 +01:00
Hans-Kristian Arntzen
ea334c14bc
Merge pull request #1527 from rdb/legacy-transpose
...
GLSL: implement transpose() in GLSL 1.10 / ES 1.00
2020-11-07 16:37:59 +01:00
rdb
b3bd674aa7
GLSL: Remove unused lod
argument from legacy_tex_op()
2020-11-07 12:43:53 +01:00
rdb
bf71994dae
GLSL: implement transpose() in GLSL 1.10 / ES 1.00
2020-11-06 22:27:54 +01:00
rdb
e8c500ceef
GLSL: Fix support for textureLod in legacy vertex shaders
2020-11-06 16:37:27 +01:00
Hans-Kristian Arntzen
e47561a28b
GLSL: Support a workaround for loading row-major matrices.
...
On AMD Windows OpenGL, it has been reported that we need to load
matrices via a wrapper function.
2020-10-27 12:07:09 +01:00
Chip Davis
3e6010d8c5
MSL: Don't use a bitcast for tessellation levels in tesc shaders.
...
`half` cannot be bitcasted to `float`, because the two types are not the
same size. Use an expanding cast instead.
We were already doing this for stores to the tessellation levels; why I
didn't also do this for loads is beyond me.
2020-10-14 18:35:59 -05:00
Hans-Kristian Arntzen
5619329665
Style nits for GL subgroup implementation.
2020-10-08 13:25:29 +02:00
Hans-Kristian Arntzen
819c599ecd
Merge branch 'issues1350-2' of git://github.com/devshgraphicsprogramming/SPIRV-Cross into master
2020-10-08 12:20:07 +02:00
criss
db52e277b9
Resolved issues 1350, 1351, 1352
2020-10-08 12:14:52 +02:00
Hans-Kristian Arntzen
5ea576ece2
Allow flip_vert_y in all relevant stages.
2020-09-28 14:10:08 +02:00
Hans-Kristian Arntzen
a07441568e
Overhaul how we deal with reserved identifiers.
...
- Do not silently drop reserved identifiers in the parser. This makes it
possible to reflect identifiers which are reserved by the
cross-compiler module.
- Instead of dropping the name, emit _RESERVED_IDENTIFIER_FIXUP in the
source to make it clear that a name has been rewritten.
- Document what is reserved and not.
2020-08-21 16:33:27 +02:00
Hans-Kristian Arntzen
57c93d44ac
GLSL: Add option to force flattening IO blocks.
...
It is not always desirable to use actual blocks.
A prime example in the case where EXT_shader_io_blocks is not supported
on the target implementation.
2020-07-28 15:16:06 +02:00
Hans-Kristian Arntzen
36c999ae3f
MSVC 2013: Fix silently broken builds.
...
Anonymous structs with initializers apparently fail to compile in MSVC
2013, so just name the structs.
2020-07-11 13:35:44 +02:00
Hans-Kristian Arntzen
fa5b206d97
MSL: Workaround broken vector -> scalar access chain in MSL.
...
On MSL, the compiler refuses to allow access chains into a normal vector type.
What happens in practice instead is a read-modify-write where a vector type is
loaded, modified and written back.
The workaround is to convert a vector into a pointer-to-scalar before
the access chain continues to add the scalar index.
2020-07-06 10:03:44 +02:00
Hans-Kristian Arntzen
2d43103a55
GLSL: Support multi-level struct flattening for I/O.
2020-07-03 14:38:51 +02:00
Hans-Kristian Arntzen
d573a95a9c
Run format_all.sh.
2020-07-01 11:42:58 +02:00
Hans-Kristian Arntzen
3afbfdb090
Implement context-sensitive expression read tracking.
...
When inside a loop, treat any read of outer expressions to happen
multiple times, forcing a temporary of said outer expressions.
This avoids the problem where we can end up relying on loop-invariant code motion to happen in the
compiler when converting optimized shaders.
2020-06-29 12:20:35 +02:00
Hans-Kristian Arntzen
7314f51a32
MSL: Deal with loading non-value-type arrays.
2020-06-18 12:46:39 +02:00
Hans-Kristian Arntzen
03d4bcea68
MSL: Improve handling of array types in buffer objects.
...
When loading and storing array types which belong to buffer objects, we
need to treat these values as not being value types. Also, need to
handle array load/store from/to more address space combinations.
2020-06-18 11:49:03 +02:00
Hans-Kristian Arntzen
cbe0cca73b
Refactor texture fetch function generation.
...
Use structs instead of a million bool/uint32_t arguments passed on stack.
2020-06-08 10:17:40 +02:00
Hans-Kristian Arntzen
275974e062
GLSL: Implement sparse feedback.
2020-06-04 15:50:28 +02:00
Hans-Kristian Arntzen
5e5d1c27ce
GLSL: Support f16x2 <-> f32 bitcast.
...
There is no native formulation, so introduce a concept of a "complex"
bitcast to handle odd-ball cases which have no native unary operation.
2020-04-21 23:27:33 +02:00
Hans-Kristian Arntzen
941cceedb4
Expose a query if samplers or images are comparison resources.
2020-04-03 17:43:42 +02:00
Hans-Kristian Arntzen
b8905bbd95
Add support for forcefully zero-initialized variables.
...
Useful to better support certain platforms which require all variables
to be initialized to something.
2020-03-26 13:38:27 +01:00
Hans-Kristian Arntzen
04e877df12
GLSL: Implement GL_EXT_shader_framebuffer_fetch.
2020-03-19 14:53:39 +01:00
Hans-Kristian Arntzen
01968c4486
Add option to disable storage image qualifier deduction.
2020-03-04 16:42:31 +01:00