mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-04 05:31:27 +00:00
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>
23 lines
942 B
Plaintext
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;
|
|
}
|
|
|