dawn-cmake/test/shader_io/compute_input_mixed.wgsl.expected.msl
Ben Clayton 8ec32a6ec9 writers: Use the new sem::Module::DependencyOrderedDeclarations
As the resolver currently enforces in-order declarations, this does not
change the declaration order from iterating over the
ast::Module::GlobalDeclarations.

The MSL backend has been changed to use the
sem::Module::DependencyOrderedDeclarations list instead of looping over
different declaration types separately.

Bug: tint:1266
Change-Id: I698d612032285311017bfceab3c42adae1928a0e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/79767
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-02-09 23:55:51 +00:00

23 lines
942 B
Plaintext

#include <metal_stdlib>
using namespace metal;
struct ComputeInputs0 {
uint3 local_invocation_id;
};
struct ComputeInputs1 {
uint3 workgroup_id;
};
void tint_symbol_inner(ComputeInputs0 inputs0, uint local_invocation_index, uint3 global_invocation_id, ComputeInputs1 inputs1) {
uint const foo = (((inputs0.local_invocation_id[0] + local_invocation_index) + global_invocation_id[0]) + inputs1.workgroup_id[0]);
}
kernel void tint_symbol(uint3 local_invocation_id [[thread_position_in_threadgroup]], uint local_invocation_index [[thread_index_in_threadgroup]], uint3 global_invocation_id [[thread_position_in_grid]], uint3 workgroup_id [[threadgroup_position_in_grid]]) {
ComputeInputs0 const tint_symbol_1 = {.local_invocation_id=local_invocation_id};
ComputeInputs1 const tint_symbol_2 = {.workgroup_id=workgroup_id};
tint_symbol_inner(tint_symbol_1, local_invocation_index, global_invocation_id, tint_symbol_2);
return;
}