Commit graph

29 commits

Author SHA1 Message Date
comex ab567491e1 Add support for OpGroupNonUniform{All,Any,AllEqual,Ballot}, and fix OpGroupNonUniformShuffleXor.
These Vulkan 1.1 operations can be used in place of
`OpSubgroup{All,Any,AllEqual,Ballot}KHR`, among other things.

For `OpGroupNonUniformShuffleXor`, which was already implemented, turns
out the scope argument needs to be encoded not as an immediate, but as
an id that points to a constant integer.
2020-11-26 17:20:01 -03:00
comex 393fccea5b Fix Reserve count for trinary ops. 2020-11-25 19:44:32 -03:00
ReinUsesLisp 0b9ee36247 Stream SPIR-V instructions directly to a binary
Before this commit sirit generated a stream of tokens that would then be
inserted to the final SPIR-V binary. This design was carried from the
initial design of manually inserting opcodes into the code. Now that
all instructions but labels are inserted when their respective function
is called, the old design can be dropped in favor of generating a valid
stream of SPIR-V opcodes.

The API for variables is broken, but adopting the new one is trivial.
Instead of calling OpVariable and then adding a global or local
variable, OpVariable was removed and global or local variables are
generated when they are called.

Avoiding duplicates is now done with an std::unordered_set instead of
using a linear search jumping through vtables.
2020-08-01 01:50:01 -03:00
ReinUsesLisp c4ea8f4b76 Upgrade to C++20 and use std::span 2020-07-29 05:46:50 -03:00
ReinUsesLisp eefca56afd memory: Add OpImageTexelPointer 2020-06-02 02:13:37 -03:00
ReinUsesLisp a62c5bbc10 barrier: Add OpControlBarrier 2020-05-15 02:54:06 -03:00
ReinUsesLisp 414fc4dbd2 arithmetic: Add IAddCarry 2020-04-25 21:54:10 -03:00
ReinUsesLisp a712959f1e atomic: Fix typo 2020-01-19 16:39:42 -03:00
ReinUsesLisp 15bacd3b1b atomic: Add memory atomic instructions 2020-01-19 16:36:33 -03:00
ReinUsesLisp 9f4d057aa2 image: Remove assumed lod in image samples
This commits breaks the API. Depth image samples assumed a lod operand,
this made using Grad samples clumsy to use.
2019-12-15 18:23:59 -03:00
ReinUsesLisp 12f40a8032 Add OpMemoryBarrier 2019-12-09 21:44:36 -03:00
ReinUsesLisp 71b53b855a Add OpSubgroupBallotKHR and vote instructions 2019-11-10 21:15:45 -03:00
ReinUsesLisp 688d6d9799 Add OpSubgroupReadInvocationKHR 2019-11-03 00:32:35 -03:00
ReinUsesLisp 9b897c3541 Add OpGroupNonUniformShuffleXor 2019-11-02 19:39:41 -03:00
ReinUsesLisp 3067893923 Add EmitVertex and EndPrimitive 2019-11-01 17:28:32 -03:00
ReinUsesLisp a1972e35f1 instructions/logical: Silence -Wpedantic 2019-10-24 03:08:42 -03:00
ReinUsesLisp 42248408a9 Remove Emit entry in favor of auto-emitting code
All instructions but OpVariable and OpLabel are automatically emitted.
These functions have to call AddLocalVariable/AddGlobalVariable or
AddLabel respectively.
2019-10-18 04:27:52 -03:00
ReinUsesLisp ae7c664016 Add OpAny and OpAll 2019-09-09 16:46:36 -03:00
ReinUsesLisp 4a0c6e03e1 Add OpVectorExtractDynamic and OpVectorInsertDynamic 2019-09-09 15:42:47 -03:00
ReinUsesLisp 60a856d266 Relicense to The BSD 3-clause license 2019-07-14 18:50:44 -03:00
Lioncash 6fd44e494c Pass std::string by value where applicable.
By taking the std::string by value in the constructor, this allows for
certain situations where copies can be elided entirely (when moving an
instance into the constructor)

e.g.

std::string var = ...

...

... = LiteralString(std::move(var)) // Or whatever other initialization
                                    // is done.

No copy will be done in this case, the move transfers it into the
constructor, and then the move within the initializer list transfers it
into the member variable.

tl;dr: This allows the calling code to potentially construct less
std::string instances by allowing moving into the parameters themselves.
2019-03-14 04:30:39 -03:00
ReinUsesLisp 1c06f8530e Remove Op prefix on Type instructions 2019-03-13 18:32:38 -03:00
ReinUsesLisp 4b1c1d1e38 Add ellipsis overloads for instructions ending in vectors 2019-03-11 04:38:09 -03:00
ReinUsesLisp ba92d8ea08 Update README.md and remove automatic capabilities addition 2019-03-11 03:41:44 -03:00
ReinUsesLisp 73595f4588 Change clang-format settings 2019-03-11 03:26:21 -03:00
ReinUsesLisp 38838c9a9d Sort macro defitions for image instructions 2019-03-11 03:19:59 -03:00
ReinUsesLisp 2b0a59d890 Add OpSwitch 2019-01-05 23:58:43 -03:00
ReinUsesLisp 3641e1de45 Add OpKill 2018-12-02 22:57:55 -03:00
ReinUsesLisp f259019494 Rename "insts" directory to "instructions" 2018-11-16 04:15:48 -03:00