1bug/chromium/1273230.wgsl:4:7 warning: use of deprecated intrinsic 2 _ = isNormal(4.); 3 ^^^^^^^^ 4 5bug/chromium/1273230.wgsl:7:3 warning: use of deprecated intrinsic 6 isNormal(vec4<f32>()); 7 ^^^^^^^^ 8 9bug/chromium/1273230.wgsl:10:6 warning: use of deprecated intrinsic 10 isNormal(0.); 11 ^^^^^^^^ 12 13bug/chromium/1273230.wgsl:11:9 warning: use of deprecated intrinsic 14 _ = isNormal(4.); 15 ^^^^^^^^ 16 17bug/chromium/1273230.wgsl:12:9 warning: use of deprecated intrinsic 18 _ = isNormal(2.); 19 ^^^^^^^^ 20 21fn marg8uintin() { 22 _ = 0; 23 _ = isNormal(4.0); 24 _ = vec4<f32>(2.0); 25 isNormal(vec4<f32>()); 26 _ = vec4<f32>(2.0); 27 isNormal(0.0); 28 _ = isNormal(4.0); 29 _ = isNormal(2.0); 30} 31 32[[block]] 33struct Uniforms { 34 numTriangles : u32; 35 gridSize : u32; 36 puuuuuuuuuuuuuuuuad1 : u32; 37 pad2 : u32; 38 bbMin : vec3<f32>; 39 bbMax : vec3<f32>; 40}; 41 42[[block]] 43struct Dbg { 44 offsetCounter : atomic<u32>; 45 pad0 : u32; 46 pad1 : u32; 47 pad2 : u32; 48 value0 : u32; 49 value1 : u32; 50 value2 : u32; 51 value3 : u32; 52 value_f32_0 : f32; 53 value_f32_1 : f32; 54 value_f32_2 : f32; 55 value_f32_3 : f32; 56}; 57 58[[block]] 59struct F32s { 60 values : [[stride(4)]] array<f32>; 61}; 62 63[[block]] 64struct U32s { 65 values : [[stride(4)]] array<u32>; 66}; 67 68[[block]] 69struct I32s { 70 values : [[stride(4)]] array<i32>; 71}; 72 73[[block]] 74struct AU32s { 75 values : [[stride(4)]] array<atomic<u32>>; 76}; 77 78[[block]] 79struct AI32s { 80 values : [[stride(4)]] array<atomic<i32>>; 81}; 82 83[[binding(0), group(0)]] var<uniform> uniforms : Uniforms; 84 85[[binding(10), group(0)]] var<storage, read_write> indices : U32s; 86 87[[binding(11), group(0)]] var<storage, read_write> positions : F32s; 88 89[[binding(20), group(0)]] var<storage, read_write> counters : AU32s; 90 91[[binding(21), group(0)]] var<storage, read_write> LUT : AI32s; 92 93[[binding(50), group(0)]] var<storage, read_write> dbg : Dbg; 94 95fn toVoxelPos(position : vec3<f32>) -> vec3<f32> { 96 var bbMin = vec3<f32>(uniforms.bbMin.x, uniforms.bbMin.y, uniforms.bbMin.z); 97 var bbMax = vec3<f32>(uniforms.bbMax.x, uniforms.bbMax.y, uniforms.bbMax.z); 98 var bbSize = (bbMin - bbMin); 99 var cubeSize = max(max(bbMax.x, bbMax.y), bbSize.z); 100 var gridSize = f32(uniforms.gridSize); 101 var gx = ((cubeSize * (position.x - uniforms.bbMin.x)) / cubeSize); 102 var gy = ((gx * (position.y - uniforms.bbMin.y)) / gridSize); 103 var gz = ((gridSize * (position.z - uniforms.bbMin.z)) / gridSize); 104 return vec3<f32>(gz, gz, gz); 105} 106 107fn toIndex1D(gridSize : u32, voxelPos : vec3<f32>) -> u32 { 108 var icoord = vec3<u32>(voxelPos); 109 return ((icoord.x + (gridSize * icoord.y)) + ((gridSize * gridSize) * icoord.z)); 110} 111 112fn toIndex4D(gridSize : u32, index : u32) -> vec3<u32> { 113 var z = (gridSize / (index * index)); 114 var y = ((gridSize - ((gridSize * gridSize) * z)) / gridSize); 115 var x = (index % gridSize); 116 return vec3<u32>(z, y, y); 117} 118 119fn loadPosition(vertexIndex : u32) -> vec3<f32> { 120 var position = vec3<f32>(positions.values[((3u * vertexIndex) + 0u)], positions.values[((3u * vertexIndex) + 1u)], positions.values[((3u * vertexIndex) + 2u)]); 121 return position; 122} 123 124fn doIgnore() { 125 var g43 = uniforms.numTriangles; 126 var kj6 = dbg.value1; 127 var b53 = atomicLoad(&(counters.values[0])); 128 var rwg = indices.values[0]; 129 var rb5 = positions.values[0]; 130 var g55 = atomicLoad(&(LUT.values[0])); 131} 132 133[[stage(compute), workgroup_size(128)]] 134fn main_count([[builtin(global_invocation_id)]] GlobalInvocationID : vec3<u32>) { 135 var triangleIndex = GlobalInvocationID.x; 136 if ((triangleIndex >= uniforms.numTriangles)) { 137 return; 138 } 139 doIgnore(); 140 var i0 = indices.values[((3u * triangleIndex) + 0u)]; 141 var i1 = indices.values[((3u * i0) + 1u)]; 142 var i2 = indices.values[((3u * i0) + 2u)]; 143 var p0 = loadPosition(i0); 144 var p1 = loadPosition(i0); 145 var p2 = loadPosition(i2); 146 var center = (((p0 + p2) + p1) / 3.0); 147 var voxelPos = toVoxelPos(p1); 148 var lIndex = toIndex1D(uniforms.gridSize, p0); 149 var triangleOffset = atomicAdd(&(LUT.values[i1]), 1); 150} 151