Commit Graph

206 Commits

Author SHA1 Message Date
TheTurtle
6cecb95d67
Merge pull request #4 from baggins183/debug-print
Add NonSemantic DebugPrintf
2024-10-05 19:35:25 +03:00
Frodo Baggins
339ed29ccb add description for instruction 2024-09-20 18:42:27 -07:00
Frodo Baggins
d8fa51152f revert some clang format stuff 2024-09-19 17:56:30 -07:00
Frodo Baggins
c3619a5f42 fix operand copy 2024-09-19 17:09:30 -07:00
Frodo Baggins
b0f30ba771 fix wordcount of printf OpExtInstImport. Also refactor so OpString and other debug insts come before OpName and OpMemberName to fix spirv-val errors 2024-09-19 16:40:51 -07:00
Frodo Baggins
b51af1a2ca Add NonSemantic DebugPrintf 2024-09-18 23:04:20 -07:00
TheTurtle
37090c74cc
Merge pull request #3 from greggameplayer/feature/OpGroupNonUniformBroadcastFirst
Implement OpGroupNonUniformBroadcastFirst
2024-08-30 02:59:36 +03:00
greggameplayer
d5a049d589
Implement OpGroupNonUniformBroadcastFirst
- update to latest spirv-headers
- add OpGroupNonUniformBroadcastFirst
2024-08-30 00:43:15 +02:00
IndecisiveTurtle
8db09231c4 spirv: Add OpLdexp 2024-07-02 02:32:58 +03:00
psucien
505cc66a2b Added OpUMulExtended and OpSMulExtended 2024-06-17 00:31:18 +02:00
raphaelthegreat
fc65ebb5b5 Add uniform quad op 2024-06-09 20:39:17 +03:00
raphaelthegreat
8c281cc0b7 stream: Revert vector grow step 2024-05-30 01:08:20 +03:00
raphaelthegreat
9c12a07e62 cmake: Remove unsupported clang-cl flag 2024-05-22 00:33:10 +03:00
GPUCode
8f19453e25 instructions: Solve pedantic warning 2023-05-07 01:26:12 +03:00
GPUCode
f0b6bbe55b
Support variadic arguments for OpPhi 2022-11-20 13:01:05 +02:00
GPUCode
297d820eeb stream: Reduce vector resize calls
* Shader modules are very large so constantly requesting new space hurts performance
2022-11-06 21:50:15 +02:00
GPUCode
0a9ed97801 stream: Add missing span include 2022-11-06 21:46:14 +02:00
GPUCode
836bf7c67c Add missing GLSL instructions 2022-11-06 21:02:05 +02:00
Billy Laws
da4ffce189 Add OpGroupNonUniformBroadcast subgroup op 2022-10-22 17:06:10 -03:00
Alexandre Bouvier
aa292d5665 cmake: Support using system SPIRV-Headers 2022-05-14 15:59:52 -03:00
voidanix
b8f133bf63 Include <utility> header for gcc 12 2022-04-28 15:43:21 -03:00
Lioncash
8cfe8badf7 sirit: Add TypeSInt/TypeUInt helpers
Provides shorthands for specific signedness, so that usage code doesn't
need to explicitly use raw booleans.

TypeUInt(32), is easier to gloss than TypeInt(32, false), especially for
those not familiar with the API.
2021-07-27 22:11:21 -03:00
Lioncash
a39596358a sirit: Remove unnecessary std::move in OpLabel
std::move on a std::string_view doesn't do anything a regular copy
wouldn't.
2021-04-17 01:22:43 -03:00
Lioncash
dc20d93ee6 sirit: substraction -> subtraction typo 2021-04-17 01:22:31 -03:00
Lioncash
6db9b43998 sirit: Resolve -Wdocumentation warnings
Amends some -Wdocumentation warnings with clang.
2021-04-17 01:22:31 -03:00
FernandoS27
a3d7754e9f Add Derivatives Instructions. 2021-04-17 01:22:09 -03:00
ReinUsesLisp
da093a04fe Add OpEmitStreamVertex and OpEndStreamPrimitive 2021-04-12 03:55:25 -03:00
ReinUsesLisp
dc47faf89f Use std::nullopt when possible 2021-04-11 02:04:17 -03:00
ReinUsesLisp
51d541f1a1 Remove forward references and add phi node patching
The previous API for forward declarations broke when more than one
definition was done. Forward references on instructions that are not
labels were only needed for phi nodes, so it has been replaced with a
deferred phi node instruction and a method to patch these after
everything has been defined.
2021-04-11 02:02:43 -03:00
ReinUsesLisp
f1cccfd0f3 Add OpUnreachable 2021-03-29 16:10:15 -03:00
ReinUsesLisp
84fab90024 Add OpFunctionParameter 2021-03-28 18:52:32 -03:00
ReinUsesLisp
0ef6e807ab Add DemoteToHelperInvocation support 2021-03-19 18:46:11 -03:00
ReinUsesLisp
4b1ff612c4 Add support for sparse texture instructions 2021-03-08 18:31:00 -03:00
ReinUsesLisp
f6a7130486 Add support for self-referencing phi nodes 2021-02-24 18:30:10 -03:00
ReinUsesLisp
9a08dab7ee Update SPIRV-Headers 2021-02-20 03:22:09 -03:00
ReinUsesLisp
20d75babd0 Assert when an OpId has an invalid result type 2021-02-19 15:42:25 -03:00
ReinUsesLisp
200310e8fa Assert operand's id is not zero 2021-02-15 23:00:12 -03:00
ReinUsesLisp
f819ade0ef Add support for forward declarations 2021-02-14 22:45:31 -03:00
ReinUsesLisp
c374bfd9fd Add Phi support 2021-02-12 21:08:46 -03:00
ReinUsesLisp
1f7b70730d Fix global variables being added in code 2021-02-07 23:52:40 -03:00
ReinUsesLisp
cae2725cc0 Add overload for decorating with enums
Skip an explicit cast on the caller, allowing code like:
Decorate(some_op, spv::Decoration::BuiltIn, spv::BuiltIn::WorkgroupId)
2021-02-07 23:52:40 -03:00
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
c095705f59 Change count to string_words
Co-authored-by: Rodrigo Locatti <reinuseslisp@airmail.cc>
2020-11-26 17:18:44 -03:00
comex
63c5b548c5 Fix OpExtension.
There were two issues:
- The word0 was omitted entirely.
- The word count didn't account for the nul terminator.
2020-11-26 17:18:44 -03:00
comex
13396c96ac Use requires clauses to better disambiguate variadic and non-variadic overloads
Suppose you try to call, say, `AddEntryPoint` with a `std::vector<Id>`
as the `interfaces` argument - something that yuzu does.  This can match
the non-variadic overload, since `std::vector<Id>` is implicitly
convertible to the argument type `std::span<const Id>`.  But it can also
match the variadic overload, and the compiler sees that as a 'better'
match because it doesn't require implicit conversion.  So it picks that
overload and promptly errors out trying to convert `std::vector<Id>` to
`Id`.

To make the compiler pick the right overload, you would have to
explicitly convert to `std::span<const Id>`, which is annoyingly
verbose.

To avoid this, add `requires` clauses to all variadic convenience
overloads, requiring each of the variadic arguments to be convertible to
the corresponding element type.  If you pass a vector/array/etc., this
rules out the variadic overload as a candidate, and the call goes
through with the non-variadic overload.

Also, use slightly different code to forward to the non-variadic
overloads, that works even if the arguments need to be converted.

Note: I used this in a WIP branch updating yuzu to the latest version of
sirit.

Note 2: I tried to run clang-format on this, but it mangled the requires
clauses pretty horribly, so I didn't accept its changes.  I googled it,
and apparently clang-format doesn't properly support concepts yet...
2020-11-25 20:02:04 -03:00
comex
393fccea5b Fix Reserve count for trinary ops. 2020-11-25 19:44:32 -03:00
ReinUsesLisp
634428758b Fix build errors on gcc 2020-08-10 04:55:04 -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