Commit Graph

21 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen
bf3f651f6c
Workaround MSVC jank 2023-06-06 12:58:22 +02:00
Hans-Kristian Arntzen
2ace2714ed
Apply suggestions from code review 2023-06-06 12:41:59 +02:00
Tibor Klajnscek
c4fdb3f371 added get_required_extensions() API to GLSL compiler 2023-05-26 15:43:43 +02:00
Hans-Kristian Arntzen
4704482bbc meta: Update copyright headers to 2021. 2021-01-14 16:07:49 +01:00
Hans-Kristian Arntzen
f9818f0804 Update license headers to 2020. 2020-01-16 15:24:37 +01:00
Hans-Kristian Arntzen
cc153f8d7f HLSL: Add a resource remapping API similar to MSL.
Allows more flexibility of how resources are assigned without having to
remap decorations.
2020-01-09 12:41:06 +01:00
Hans-Kristian Arntzen
333980ae91 Refactor into stronger types in public API.
Some fallout where internal functions are using stronger types.
Overkill to move everything over to strong types right now, but perhaps
move over to it slowly over time.
2019-09-06 12:29:47 +02:00
Chip Davis
39dce88d3b MSL: Add support for sampler Y'CbCr conversion.
This change introduces functions and in one case, a class, to support
the `VK_KHR_sampler_ycbcr_conversion` extension. Except in the case of
GBGR8 and BGRG8 formats, for which Metal natively supports implicit
chroma reconstruction, we're on our own here. We have to do everything
ourselves. Much of the complexity comes from the need to support
multiple planes, which must now be passed to functions that use the
corresponding combined image-samplers. The rest is from the actual
Y'CbCr conversion itself, which requires additional post-processing of
the sample retrieved from the image.

Passing sampled images to a function was a particular problem. To
support this, I've added a new class which is emitted to MSL shaders
that pass sampled images with Y'CbCr conversions attached around. It
can handle sampled images with or without Y'CbCr conversion. This is an
awful abomination that should not exist, but I'm worried that there's
some shader out there which does this. This support requires Metal 2.0
to work properly, because it uses default-constructed texture objects,
which were only added in MSL 2. I'm not even going to get into arrays of
combined image-samplers--that's a whole other can of worms.  They are
deliberately unsupported in this change.

I've taken the liberty of refactoring the support for texture swizzling
while I'm at it. It's now treated as a post-processing step similar to
Y'CbCr conversion. I'd like to think this is cleaner than having
everything in `to_function_name()`/`to_function_args()`. It still looks
really hairy, though. I did, however, get rid of the explicit type
arguments to `spvGatherSwizzle()`/`spvGatherCompareSwizzle()`.

Update the C API. In addition to supporting this new functionality, add
some compiler options that I added in previous changes, but for which I
neglected to update the C API.
2019-09-01 18:35:53 -05:00
Hans-Kristian Arntzen
048f2380f3 MSL: Support custom bindings for argument buffer itself. 2019-06-24 11:10:20 +02:00
Hans-Kristian Arntzen
7fd379774e Expand constexpr sampler sanity check. 2019-06-10 16:00:20 +02:00
Hans-Kristian Arntzen
30bb197a5d MSL: Support remapping constexpr samplers by set/binding.
Older API was oriented around IDs which are not available unless you're
doing full reflection, which is awkward for certain use cases which know
their set/bindings up front.

Optimize resource bindings to be hashmap rather than doing linear seeks
all the time.
2019-06-10 15:41:36 +02:00
Hans-Kristian Arntzen
0b9a884f3f Add Git/timestamp --revision support. 2019-05-24 15:24:41 +02:00
Hans-Kristian Arntzen
542d6683b8 Validate that C ABI in CMakeLists.txt matches code. 2019-05-14 10:06:33 +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
3a57286595 Implement edge cases in insert/end and add a simple test case. 2019-04-09 15:09:44 +02:00
Hans-Kristian Arntzen
074f765a83 Explicitly pass down paths to glslang/spirv-tools.
Windows and CMake really cannot get along with %PATH%, sigh ...
2019-03-07 12:36:16 +01:00
Hans-Kristian Arntzen
5341a189ff Add support for sanitizing address and threads. 2019-03-05 10:11:04 +01:00
Hans-Kristian Arntzen
afef135dd8 Add a simple SPIR-V for purposes of smoke testing the C API. 2019-03-04 11:37:01 +01:00
Hans-Kristian Arntzen
ee11bb3bc6 Add a C API smoke test. 2019-03-04 11:14:33 +01:00
Hans-Kristian Arntzen
c266429be9 Partially implement subgroup ops for HLSL SM 6.0.
Lots of stuff that needs tons of emulation, which I'm not going to
bother with.
2018-04-11 15:57:41 +02:00