Commit Graph

2836 Commits

Author SHA1 Message Date
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
5cc2e4f634
Merge pull request #1475 from KhronosGroup/fix-1474
GLSL: Support geometry streams.
2020-09-30 16:16:48 +02:00
Hans-Kristian Arntzen
e0c9aad934 GLSL: Add support for transform_feedback3 geometry streams. 2020-09-30 13:01:35 +02:00
Hans-Kristian Arntzen
7a99d1cb72 GLSL: Use literal array size for cull/clip array sizes. 2020-09-30 13:01:18 +02:00
Hans-Kristian Arntzen
e6f5ce6b89
Merge pull request #1471 from KhronosGroup/fix-1467
Work around MSVC warning.
2020-09-28 18:47:29 +02:00
Hans-Kristian Arntzen
6254be910e
Merge pull request #1470 from KhronosGroup/fix-1469
Allow flip_vert_y in all relevant stages.
2020-09-28 18:46:55 +02:00
Hans-Kristian Arntzen
34a6a45fba Work around MSVC warning. 2020-09-28 14:12:54 +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
ea3cd74426
Merge pull request #1468 from dj2/roll-09-22
Roll dependencies.
2020-09-24 20:00:59 +02:00
dan sinclair
9880b05572 Roll dependencies.
This CL rolls the spirv-tools, spirv-headers and glslang dependencies.
2020-09-22 12:31:38 -04:00
Hans-Kristian Arntzen
8891bd3512
Merge pull request #1466 from KhronosGroup/fix-1465
Clean up and fix awkward conditional branch codegen.
2020-09-17 13:49:14 +02:00
Hans-Kristian Arntzen
2144274a91 Clean up conditional branch codegen.
Should only need to look at whether or not we're branching to our own
merge target. Any other branch needs to emit code in some way.
2020-09-17 12:12:37 +02:00
Hans-Kristian Arntzen
54cc0b01f6 Deal with case where a selection construct conditionally merges/breaks. 2020-09-17 12:02:43 +02:00
Hans-Kristian Arntzen
16d9fea77c
Merge pull request #1463 from KhronosGroup/fix-1462
Implement a simple evaluator of specialization constants.
2020-09-14 13:31:10 +02:00
Hans-Kristian Arntzen
66afe8c499 Implement a simple evaluator of specialization constants.
In some cases, we need to get a literal value from a spec constant op.
Mostly relevant when emitting buffers, so implement a 32-bit integer
scalar subset of the evaluator. Can be extended as needed to support
evaluating any specialization constant operation.
2020-09-14 11:45:59 +02:00
Hans-Kristian Arntzen
bdbef7b1f3
Merge pull request #1461 from Kangz/fix-warnings
Fix -Wduplicate-enum and -Wrange-for-analysis.
2020-09-04 12:59:22 +02:00
Corentin Wallez
bcd71536e2 Fix -Wduplicate-enum and -Wrange-for-analysis. 2020-09-04 11:13:21 +02:00
Hans-Kristian Arntzen
ba2d0e17d3
Merge pull request #1460 from KhronosGroup/fix-1458
Roll dependencies.
2020-09-04 10:50:18 +02:00
Hans-Kristian Arntzen
446596643a Roll glslang/SPIRV-Tools deps. 2020-09-04 09:30:07 +02:00
Hans-Kristian Arntzen
18d03b3ea6 Handle OpUndef %void.
Apparently this is legal and spirv-opt is starting to emit this kind of
code now.
2020-09-04 09:29:44 +02:00
Hans-Kristian Arntzen
bad9dab8df
Merge pull request #1457 from cdavis5e/msl-layered-subpass-data
MSL: Support layered input attachments.
2020-09-03 12:06:29 +02:00
Chip Davis
4cf840ee7b MSL: Support layered input attachments.
These need to use arrayed texture types, or Metal will complain when
binding the resource. The target layer is addressed relative to the
Layer output by the vertex pipeline, or to the ViewIndex if in a
multiview pipeline. Unlike with the s/t coordinates, Vulkan does not
forbid non-zero layer coordinates here, though this cannot be expressed
in Vulkan GLSL.

Supporting 3D textures will require additional work. Part of the problem
is that Metal does not allow texture views to subset a 3D texture, so we
need some way to pass the base depth to the shader.
2020-09-02 09:18:25 -05:00
Hans-Kristian Arntzen
c7507e39d4
Merge pull request #1456 from KhronosGroup/fix-1455
MSL: Fix OpCompositeInsert and OpVectorInsertDynamic.
2020-09-02 12:36:51 +02:00
Hans-Kristian Arntzen
3360daa6f3 MSL: Fix OpCompositeInsert and OpVectorInsertDynamic.
Need to take care of unpacked RHS expressions.
2020-09-02 10:27:39 +02:00
Hans-Kristian Arntzen
9e3dbdc8d6
Merge pull request #1454 from cdavis5e/msl-multiview-non-layered
MSL: Don't set the layer for multiview if the device doesn't support it.
2020-09-02 10:09:54 +02:00
Chip Davis
cab7335e64 MSL: Don't set the layer for multiview if the device doesn't support it.
Some older iOS devices don't support layered rendering. In that case,
don't set `[[render_target_array_index]]`, because the compiler will
reject the shader in that case. The client will then have to unroll the
render pass manually.
2020-09-01 19:30:28 -05:00
Hans-Kristian Arntzen
4752a44f9e
Merge pull request #1453 from cdavis5e/msl-multiview-base-instance
MSL: Fix multiview view index calculation with a non-zero base instance.
2020-09-01 14:29:53 +02:00
Chip Davis
53080ecca8 MSL: Fix multiview view index calculation with a non-zero base instance.
Account for a non-zero base instance when calculating the view index and
the "real" instance index. Before, it was likely broken with a non-zero
base instance, since the calculated instance index could be less than
the base instance.
2020-08-31 20:33:44 -05:00
Hans-Kristian Arntzen
685f86471e
Merge pull request #1452 from KhronosGroup/minor-nits
Minor nits
2020-08-24 12:13:01 +02:00
Hans-Kristian Arntzen
95993f78af Run format_all.sh. 2020-08-24 11:02:49 +02:00
Hans-Kristian Arntzen
ee1b4e7042 Work around annoying warning on GCC 10.2.
GCC warns if N == 0 in SmallVector and simpler workarounds do nothing.
2020-08-24 11:01:59 +02:00
Hans-Kristian Arntzen
eec76b04c7
Merge pull request #1450 from KhronosGroup/fix-1440
Overhaul how we deal with reserved identifiers.
2020-08-24 10:50:16 +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
f0fe4442e3
Merge pull request #1448 from KhronosGroup/fix-1437
HLSL: Fix some subtle bugs in buffer packing handling.
2020-08-20 19:21:50 +02:00
Hans-Kristian Arntzen
4f0f0e5a07
Merge pull request #1449 from KhronosGroup/fix-1443
HLSL: Fix FragCoord.w.
2020-08-20 19:20:48 +02:00
Hans-Kristian Arntzen
fdbc80d131 HLSL: Fix FragCoord.w.
Need to invert it, SM 4.0+ uses W, not 1/W (like Vulkan/GL).
2020-08-20 16:22:48 +02:00
Hans-Kristian Arntzen
fad36a6b28 HLSL: Deal with partially filled 16-byte word in cbuffers.
The last element of an array or matrix in HLSL cbuffers are not filled
completely, but only have a size equal to the base vector.
2020-08-20 16:05:21 +02:00
Hans-Kristian Arntzen
dd1f53ff15 HLSL: Fix bug in is_packing_standard for cbuffer.
Was not keeping offset in sync with actual_offset and HLSL could trigger
spurious realignments due to the straddle check.
2020-08-20 15:26:55 +02:00
Hans-Kristian Arntzen
4c7944bb42
Merge pull request #1446 from kakashidinho/master
Fix #1445: MSL: Enclose args when convert distance(a,b) to abs(a-b)
2020-08-13 21:05:11 +02:00
Le Hoang Quyen
ab8eb70af1 Fix #1445: MSL: Enclose args when convert distance(a,b) to abs(a-b) 2020-08-13 21:16:08 +08:00
Hans-Kristian Arntzen
82d1c43e40
Merge pull request #1441 from cdavis5e/msl-tesc-composite-out
MSL: Fix handling of matrices and structs in the output control point array.
2020-08-04 01:19:21 +02:00
Chip Davis
3347b1076d MSL: Fix handling of matrices and structs in the output control point array.
Prior to this point, we were treating them as flattened, as they are in
old-style tessellation control shaders, and still are for structs in
new-style shaders. This is not true for outputs; output composites are
not flattened at all. This semantic mismatch broke a Vulkan CTS test.
It should now pass.
2020-08-03 17:18:18 -05:00
Hans-Kristian Arntzen
c333445ada
Merge pull request #1436 from KhronosGroup/fix-1408
GLSL/HLSL: Be more exhaustive with aliasing struct type declarations.
2020-07-29 14:30:30 +02:00
Hans-Kristian Arntzen
8a1843ab20 Add some test cases for complex type aliasing scenario. 2020-07-29 13:02:52 +02:00
Hans-Kristian Arntzen
eb580d6656 Ensure that we use primary alias type when emitting flattened members. 2020-07-29 13:02:25 +02:00
Hans-Kristian Arntzen
aac6885950 GLSL: Be more aggressive about using type_alias.
To facilitate an improved linking-by-name use case for older GL,
we will be more aggressive about merging struct definitions, even for
rather unrelated cases where we don't strictly need to use type aliases.
2020-07-29 12:48:41 +02:00
Hans-Kristian Arntzen
038b0bf238 Only rewrite type aliases for the base type. 2020-07-29 12:48:41 +02:00
Hans-Kristian Arntzen
7778792aec
Merge pull request #1434 from KhronosGroup/glsl-force-flattened-io
GLSL: Add option to force flattening IO blocks.
2020-07-28 15:55:01 +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