mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-14 19:31:25 +00:00
Add a config parameter for the CanonicalizeEntryPoint transform that selects between emitting builtins as parameters (for MSL) or struct members (for HLSL). This fixes all of the shader IO issues in Tint's E2E tests for MSL. Fixed: tint:817 Change-Id: Ieb31cdbd2e4d96ac41f8d8515fd07ead8241d770 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/53282 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: James Price <jrprice@google.com>
20 lines
623 B
Plaintext
20 lines
623 B
Plaintext
#include <metal_stdlib>
|
|
|
|
using namespace metal;
|
|
struct FragmentInputs {
|
|
float4 position;
|
|
bool front_facing;
|
|
uint sample_index;
|
|
uint sample_mask;
|
|
};
|
|
|
|
fragment void tint_symbol(float4 tint_symbol_2 [[position]], bool tint_symbol_3 [[front_facing]], uint tint_symbol_4 [[sample_id]], uint tint_symbol_5 [[sample_mask]]) {
|
|
FragmentInputs const inputs = {.position=tint_symbol_2, .front_facing=tint_symbol_3, .sample_index=tint_symbol_4, .sample_mask=tint_symbol_5};
|
|
if (inputs.front_facing) {
|
|
float4 const foo = inputs.position;
|
|
uint const bar = (inputs.sample_index + inputs.sample_mask);
|
|
}
|
|
return;
|
|
}
|
|
|