Age | Commit message (Collapse) | Author |
|
|
|
Need to register resource name.
|
|
Need this to be context sensitive, since array of block-like struct is
template, but struct of block-like array is C-style.
Also, test a mix and match, so we have constant array of block-like
struct with array inside. :v
|
|
C++ deduces this based on the pointer type, so cast to atomic_uint/int
if we have to.
|
|
WorkgroupSize builtin is deprecated in 1.6 and LocalSizeId is supported
in Vulkan starting with maintenance4.
|
|
MSL: Handle non-thread storage class in Modf/Frexp pointer versions.
|
|
|
|
Consider it a write to a variable, similar to OpStore.
|
|
|
|
Effectively, only the last component of the select was considered, need
to correctly early out if any case is hit.
|
|
We cannot naively convert these to decimal literals. C/C++ (and thus
MSL) has extremely awkward literal promotion rules.
|
|
Handles a special case with array copies.
The implementation of this fix is not perfect, but should be good
enough for time being.
|
|
|
|
Fix bug in to_trivial_mix_op, where we made a pre-1.4 assumption that
component count of selector is equal to value component count.
|
|
|
|
|
|
We need to handle loads from array as well, so the float4 hack doesn't
work.
|
|
Need to allow the flattened space to go through in some edge cases where
we cannot reasonably unflatten.
|
|
Need to consider all members, bi_type is invalid for Blocks, need to
look at member decorations.
|
|
|
|
Multiple patches can run in the same workgroup when using multi-patch
mode, so we need to allocate enough storage to avoid false sharing.
|
|
|
|
Handle edge cases in OpCopyMemory.
|
|
Implement this by synthesizing an OpLoad/OpStore pair instead.
|
|
|
|
|
|
MSL: Handle load and store to TessLevel array in TESC.
|
|
More edge cases ... :(
|
|
|
|
Need to rewrite array size depending on execution mode.
|
|
Need to be careful not to emit globals we're not supposed to.
|
|
Introduce a helper to make it clearer if a resource can be
considered for argument buffers or not.
|
|
--msl-decoration-binding would end up overriding the input attachment
index to binding which is very unexpected and broken.
|
|
Tests that the builtin is considered active.
|
|
|
|
Subsequent stages can legally attempt to read from these variables,
which causes compilation failure.
Always make sure we emit user outputs in vertex shaders if they are
active in the entry point.
|
|
|
|
|
|
|
|
|
|
|
|
gl_ identifiers are already handled by fixups, so remove redundant code.
|
|
We only considered invalid names, and overwrote the alias for the
function. The correct fix is to replace illegal names early, do the
reserved fixup, then copy back alias to entry point name.
|
|
Need to emit nonuniformEXT(sampler2D()) since constructor expressions in
Vulkan GLSL do not propgate the nonuniform qualifier.
|
|
This is necessary to avoid invalid output because of how implicit
dependencies on builtins work.
For example, the fixup for `BuiltInSubgroupEqMask` initializes the
variable based on `builtin_subgroup_invocation_id_id`, a field storing
the ID for a variable with decoration `BuiltInSubgroupLocalInvocationId`.
This could be either a variable that already exists in the input
(spirv_msl.cpp:300) or, if necessary, a newly created one
(spirv_msl.cpp:621). In both cases, though,
`builtin_subgroup_invocation_id_id` is only set under the condition
`need_subgroup_mask || needs_subgroup_invocation_id`.
`need_subgroup_mask` is true if any of the `BuiltInSubgroupXXMask` are
set in `active_input_builtins`.
Normally, if the program contains `BuiltInSubgroupEqMask`,
`Compiler::ActiveBuiltinHandler` will set it in `active_input_builtins`.
But this only happens if the variable is actually used, whereas
`fix_up_shader_inputs_outputs` loops over all variables in the program
regardless of whether they're used.
If `BuiltInSubgroupEqMask` is not used,
`builtin_subgroup_invocation_id_id` is never set, but before this patch
the fixup hook would try to use it anyway, producing MSL that references
a nonexistent variable named `_0`.
Avoid this by changing `fix_up_shader_inputs_outputs` to skip builtins
which are not set in `active_input_builtins` or
`active_output_builtins`. And add a test case.
|
|
Add support for declaring a fixed subgroup size. Metal, like Vulkan with
`VK_EXT_subgroup_size_control`, allows the thread execution width to
vary depending on factors such as register usage. Unfortunately, this
breaks several tests that depend on the subgroup size being what the
device says it is. So we'll fix the subgroup size at the size the device
declares. The extra invocations in the subgroup will appear to be
inactive. Because of this, the ballot mask builtins are now ANDed with
the active subgroup mask.
Add support for emulating a subgroup of size 1. This is intended to be
used by Vulkan Portability implementations (e.g. MoltenVK) when the
hardware/software combo provides insufficient support for subgroups.
Luckily for us, Vulkan 1.1 only requires that the subgroup size be at
least 1.
Add support for quadgroup and SIMD-group functions which were added to
iOS in Metal 2.2 and 2.3. This will allow clients to take advantage of
expanded quadgroup and SIMD-group support in recent Metal versions and
on recent Apple GPUs (families 6 and 7).
Gut emulation of subgroup builtins in fragment shaders. It turns out
codegen for the SIMD-group functions in fragment wasn't implemented for
AMD on Mojave; it's a safe bet that it wasn't implemented for the other
drivers either. Subgroup support in fragment shaders now requires Metal
2.2.
|
|
It was not always possible to get backing variable for a late-combined
image sampler.
|
|
Another Apple GPU feature that will now be supported on Apple Silicon
Macs.
|
|
|
|
Metal doesn't support broadcasting or shuffling boolean values, but we
can work around that by casting it to `ushort`, then casting it back to
`bool`. I used `ushort` instead of `uint` because 16-bit values give
better throughput on Apple GPUs.
|