mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-05 06:03:34 +00:00
Bug: tint:376 Change-Id: I2994ff7394efa903050b470a850b41628d5b775c Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/52324 Commit-Queue: Antonio Maiorano <amaiorano@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
76 lines
1.1 KiB
Plaintext
76 lines
1.1 KiB
Plaintext
#include <metal_stdlib>
|
|
|
|
using namespace metal;
|
|
struct tint_symbol_1 {
|
|
float4 value [[color(0)]];
|
|
};
|
|
|
|
void vector_scalar_f32() {
|
|
float3 v = 0.0f;
|
|
float s = 0.0f;
|
|
float3 r = 0.0f;
|
|
r = (v + s);
|
|
r = (v - s);
|
|
r = (v * s);
|
|
r = (v / s);
|
|
}
|
|
|
|
void vector_scalar_i32() {
|
|
int3 v = 0;
|
|
int s = 0;
|
|
int3 r = 0;
|
|
r = (v + s);
|
|
r = (v - s);
|
|
r = (v * s);
|
|
r = (v / s);
|
|
r = (v % s);
|
|
}
|
|
|
|
void vector_scalar_u32() {
|
|
uint3 v = 0u;
|
|
uint s = 0u;
|
|
uint3 r = 0u;
|
|
r = (v + s);
|
|
r = (v - s);
|
|
r = (v * s);
|
|
r = (v / s);
|
|
r = (v % s);
|
|
}
|
|
|
|
void scalar_vector_f32() {
|
|
float3 v = 0.0f;
|
|
float s = 0.0f;
|
|
float3 r = 0.0f;
|
|
r = (s + v);
|
|
r = (s - v);
|
|
r = (s * v);
|
|
r = (s / v);
|
|
}
|
|
|
|
void scalar_vector_i32() {
|
|
int3 v = 0;
|
|
int s = 0;
|
|
int3 r = 0;
|
|
r = (s + v);
|
|
r = (s - v);
|
|
r = (s * v);
|
|
r = (s / v);
|
|
r = (s % v);
|
|
}
|
|
|
|
void scalar_vector_u32() {
|
|
uint3 v = 0u;
|
|
uint s = 0u;
|
|
uint3 r = 0u;
|
|
r = (s + v);
|
|
r = (s - v);
|
|
r = (s * v);
|
|
r = (s / v);
|
|
r = (s % v);
|
|
}
|
|
|
|
fragment tint_symbol_1 tint_symbol() {
|
|
return {float4(0.0f, 0.0f, 0.0f, 0.0f)};
|
|
}
|
|
|