1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
|
@group(0) @binding(0) var<storage> r: f32;
fn testI32(x: i32) -> i32 { return x; }
fn testResourceShadowedByLocal() -> i32
{
var r : i32;
_ = testI32(r);
return 0;
}
fn testResourceShadowedByParameter(r: i32) -> i32
{
_ = testI32(r);
return 0;
}
fn testLocalConstShadowedByLocal() -> i32
{
const x: f32 = 0.1;
{
let x: i32 = 1;
_ = testI32(x);
}
return 0;
}
const x: f32 = 0.1123;
fn testGlobalConstShadowedByLocal() -> i32
{
let x: i32 = 1;
_ = testI32(x);
return 0;
}
fn testGlobalConstShadowedByParameter(x: i32) -> i32
{
_ = testI32(x);
return 0;
}
fn testParameterShadowedByLocal(x: f32) -> i32
{
{
let x: i32 = 1;
_ = testI32(x);
}
return 0;
}
fn testUserDefinedFunctionShadowedByLocal() -> i32
{
let main: i32 = 1;
_ = testI32(main);
return 0;
}
fn testUserDefinedFunctionShadowedByLocalConst() -> i32
{
const main: i32 = 1;
_ = testI32(main);
return 0;
}
fn testBuiltinShadowedByLocal() -> i32
{
let textureLoad: i32 = 1;
_ = testI32(textureLoad);
return 0;
}
fn testBuiltinShadowedByLocalConst() -> i32
{
const textureLoad: i32 = 1;
_ = testI32(textureLoad);
return 0;
}
@group(0) @binding(1) var<storage> transpose: i32;
fn testBuiltinShadowedByGlobal() -> i32
{
_ = testI32(transpose);
return 0;
}
const step: i32 = 42;
fn testBuiltinShadowedByGlobalConst() -> i32
{
_ = testI32(step);
return 0;
}
fn testBuiltinShadowedByParameter(textureLoad: i32) -> i32
{
_ = testI32(textureLoad);
return 0;
}
fn trunc(x: i32) -> i32 { return x; }
fn testBuiltinShadowedByUserDefinedFunction() -> i32
{
_ = trunc(42);
return 0;
}
struct max { x: i32 }
fn testBuiltinShadowedByStruct() -> i32
{
_ = testI32(max(42).x);
return 0;
}
@compute @workgroup_size(1)
fn main()
{
_ = testResourceShadowedByLocal();
_ = testResourceShadowedByParameter(42);
_ = testLocalConstShadowedByLocal();
_ = testGlobalConstShadowedByLocal();
_ = testGlobalConstShadowedByParameter(42);
_ = testParameterShadowedByLocal(0.1);
_ = testUserDefinedFunctionShadowedByLocal();
_ = testUserDefinedFunctionShadowedByLocalConst();
_ = testBuiltinShadowedByLocal();
_ = testBuiltinShadowedByLocalConst();
_ = testBuiltinShadowedByGlobal();
_ = testBuiltinShadowedByGlobalConst();
_ = testBuiltinShadowedByParameter(42);
_ = testBuiltinShadowedByUserDefinedFunction();
_ = testBuiltinShadowedByStruct();
const i32 = 0;
const vec2 = 0;
const x = i32 * vec2;
}
|