Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
std::move on a std::string_view doesn't do anything a regular copy
wouldn't.
|
|
|
|
Amends some -Wdocumentation warnings with clang.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Skip an explicit cast on the caller, allowing code like:
Decorate(some_op, spv::Decoration::BuiltIn, spv::BuiltIn::WorkgroupId)
|
|
`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.
|
|
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...
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
This commits breaks the API. Depth image samples assumed a lod operand,
this made using Grad samples clumsy to use.
|
|
|
|
|
|
|
|
|
|
|
|
All instructions but OpVariable and OpLabel are automatically emitted.
These functions have to call AddLocalVariable/AddGlobalVariable or
AddLabel respectively.
|
|
Vulkan receives SPIR-V modules with a uint32_t alignment. Returning
uint8_t forced users to invoke undefined behaviour (reinterpret_cast)
or copy.
|
|
This reverts commit 1e665afa361d0c91b2b3a226a1c537d0b504ca11.
|
|
This reverts commit bb6a3421d27b19d8caa203cca96f47210a670070.
|
|
|
|
|
|
|
|
|
|
Instead of manually searching each element in the declarations vector,
use an unordered_set to emplace new declarations avoiding repetition.
|
|
Previously this wasn't utilizing any of the compiler flags, meaning it
wasn't applying any of the specified warnings.
Since applying the warnings to the target, this uncovered a few warning
cases, such as shadowing class variables on MSVC, etc, which have been fixed.
|
|
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.
|
|
|
|
|
|
|