Commit Graph

26 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen
c0f48374c7 Add reserve to object pool. 2024-01-18 11:54:24 +01:00
Gulfem Savrun Yeniceri
a25d0acaad Add missing <exception> include
https://reviews.llvm.org/D146097 removed the transitive include for
<exception>, which caused the following issue:

In file included from ../../third_party/spirv-cross/spirv_common.hpp:28:
../../third_party/spirv-cross/spirv_cross_containers.hpp:334:9: error:
no member named 'terminate' in namespace 'std

This patch adds the missing include to fix the issue.
2023-03-20 20:50:03 +00:00
Hans-Kristian Arntzen
549cde7fae Fix GCC5 build. 2023-01-05 12:24:02 +01:00
Chip Davis
8cf99e7d44 MSL: Implement CompositeInsert OpSpecConstantOp.
This op creates a new composite constant with one element replaced. So,
we reconstruct the `SPIRConstant` for the composite constant, but with
one of the IDs replaced. Constant initializer lists are memoized for
when the result of a `CompositeInsert` is used in another
`CompositeInsert`.

(I wanted to add a test case for GLSL as well, but for two things:
1. `glslang` in Vulkan mode chokes on the first constant array,
   insisting that its initializer needs to be a constant. [Bug in
   glslang?]
2. The declarations for the buffers used by the shader aren't emitted,
   regardless of whether Vulkan mode is enabled.)

Fixes five tests under
`dEQP-VK.spirv_assembly.instruction.*.opspecconstantop.vector_related`.
2022-11-01 18:11:39 -07:00
Edvin Pettersson
4dcf64a99b
Fixed potential compilation error in spirv_cross_containers.hpp 2021-11-05 01:39:35 +01:00
Hans-Kristian Arntzen
96d95fbb31 MSVC: Workaround crtdbg macroing free(). 2021-09-30 14:12:08 +02:00
Jon Leech
f2a65545b8 Finish adding SPDX tags and setup a reuse checked in Github Actions CI 2021-06-29 11:03:52 +02:00
Hans-Kristian Arntzen
4704482bbc meta: Update copyright headers to 2021. 2021-01-14 16:07:49 +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
criss
db52e277b9 Resolved issues 1350, 1351, 1352 2020-10-08 12:14:52 +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
d573a95a9c Run format_all.sh. 2020-07-01 11:42:58 +02:00
Hans-Kristian Arntzen
c2655ab291 Run format_all.sh. 2020-03-19 14:22:49 +01:00
Hans-Kristian Arntzen
92a4294c57 Reject SPIR-V modules with garbage ID bound.
SPIR-V spec has a limit of ~4 million, and Vulkan spec does not increase
this bound, so be a bit defensive and fail early.
2020-02-14 12:57:01 +01:00
Hans-Kristian Arntzen
8bbb5fb763 Make SmallVector noexcept.
Fixes a linting error from cppcheck where reserve() calls can throw, but
caller is marked noexcept to allow proper move semantics.

Only real place to throw would be if allocations fail, but these
allocations tend to be small, and if allocation actually fails here,
we're basically OOM anyways, so just terminate. Constructors and assignment
could also fail, but the only way that could happen is memory related in
SPIRV-Cross' case, so just terminate if that happens as well.

Also, for good measure, add missing -fno-exceptions to EXCEPTIONS_TO_ASSERTIONS
path in CMake.
2020-01-23 10:52:37 +01:00
Hans-Kristian Arntzen
f9818f0804 Update license headers to 2020. 2020-01-16 15:24:37 +01:00
Hans-Kristian Arntzen
b522b409ae Run format_all.sh. 2020-01-08 10:48:30 +01:00
Hans-Kristian Arntzen
3ccfbce264 Run format_all.sh. 2019-08-28 14:25:26 +02:00
Hans-Kristian Arntzen
bc3bf47446 Rewrite how switch block case labels are emitted. 2019-06-20 11:57:05 +02:00
Hans-Kristian Arntzen
9420b75314 Work around false positive warning on GCC 8.3. 2019-04-24 08:49:53 +02:00
Hans-Kristian Arntzen
3c3d4d74f7 Workaround lack of lvalue/rvalue operator overload on MSVC 2013. 2019-04-09 16:20:47 +02:00
Hans-Kristian Arntzen
bbac2e8d8d Support direct conversions to std::vector from SmallVector.
Makes it a bit nicer to consume SmallVector.
2019-04-09 15:47:59 +02:00
Hans-Kristian Arntzen
9f31a94b10 Make sure ids_for_types are moved correctly in move operator. 2019-04-09 15:16:37 +02:00
Hans-Kristian Arntzen
3fa00f9936 Run format_all.sh. 2019-04-09 15:10:02 +02:00
Hans-Kristian Arntzen
03ddea8eb1 Refactor out error handling and containers to new headers.
spirv_common.hpp got very crowded and it made more sense to split out
concerns to different headers.
2019-04-09 15:09:44 +02:00