Skip to content

Commit 8a474d6

Browse files
committed
fix: Improvement to argument usage tracking
1 parent 4636de8 commit 8a474d6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+578
-1010
lines changed

apps/typegpu-docs/tests/individual-example-tests/3d-fish.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -305,15 +305,6 @@ describe('3d fish example', () => {
305305
return vertexShader_Output(worldPosition.xyz, worldNormal, canvasPosition, (*currentModelData).variant, _arg_textureUV, (*currentModelData).applySeaFog, (*currentModelData).applySeaDesaturation);
306306
}
307307
308-
struct fragmentShader_Input {
309-
@location(0) worldPosition: vec3f,
310-
@location(1) worldNormal: vec3f,
311-
@location(2) variant: f32,
312-
@location(3) textureUV: vec2f,
313-
@location(4) @interpolate(flat) applySeaFog: u32,
314-
@location(5) @interpolate(flat) applySeaDesaturation: u32,
315-
}
316-
317308
@group(0) @binding(1) var modelTexture: texture_2d<f32>;
318309
319310
@group(0) @binding(3) var sampler_1: sampler;
@@ -418,6 +409,15 @@ describe('3d fish example', () => {
418409
return vec3f(r, g, b);
419410
}
420411
412+
struct fragmentShader_Input {
413+
@location(0) worldPosition: vec3f,
414+
@location(1) worldNormal: vec3f,
415+
@location(2) variant: f32,
416+
@location(3) textureUV: vec2f,
417+
@location(4) @interpolate(flat) applySeaFog: u32,
418+
@location(5) @interpolate(flat) applySeaDesaturation: u32,
419+
}
420+
421421
@fragment fn fragmentShader(_arg_0: fragmentShader_Input) -> @location(0) vec4f {
422422
var textureColorWithAlpha = textureSample(modelTexture, sampler_1, _arg_0.textureUV);
423423
var textureColor = textureColorWithAlpha.rgb;

apps/typegpu-docs/tests/individual-example-tests/bitonic-sort.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,12 @@ describe('bitonic sort example', () => {
118118
return fullScreenTriangle_Output(vec4f(pos[vertexIndex], 0, 1), uv[vertexIndex]);
119119
}
120120
121+
@group(0) @binding(0) var<storage, read> data_1: array<u32>;
122+
121123
struct fragmentFn_Input {
122124
@location(0) uv: vec2f,
123125
}
124126
125-
@group(0) @binding(0) var<storage, read> data_1: array<u32>;
126-
127127
@fragment fn fragmentFn(_arg_0: fragmentFn_Input) -> @location(0) vec4f {
128128
let data = (&data_1);
129129
let arrayLength_1 = arrayLength(&(*data));

apps/typegpu-docs/tests/individual-example-tests/blur.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -470,14 +470,14 @@ describe('blur example', () => {
470470
return fullScreenTriangle_Output(vec4f(pos[vertexIndex], 0, 1), uv[vertexIndex]);
471471
}
472472
473-
struct renderFragment_Input {
474-
@location(0) uv: vec2f,
475-
}
476-
477473
@group(0) @binding(0) var renderView: texture_2d<f32>;
478474
479475
@group(0) @binding(1) var sampler_1: sampler;
480476
477+
struct renderFragment_Input {
478+
@location(0) uv: vec2f,
479+
}
480+
481481
@fragment fn renderFragment(_arg_0: renderFragment_Input) -> @location(0) vec4f {
482482
return textureSample(renderView, sampler_1, _arg_0.uv);
483483
}"

apps/typegpu-docs/tests/individual-example-tests/camera-thresholding.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ describe('camera thresholding example', () => {
3232
return fullScreenTriangle_Output(vec4f(pos[vertexIndex], 0, 1), uv[vertexIndex]);
3333
}
3434
35-
struct mainFrag_Input {
36-
@location(0) uv: vec2f,
37-
}
38-
3935
@group(0) @binding(0) var<uniform> uvTransformUniform: mat2x2f;
4036
4137
@group(1) @binding(0) var inputTexture: texture_external;
@@ -48,6 +44,10 @@ describe('camera thresholding example', () => {
4844
4945
@group(0) @binding(3) var<uniform> thresholdBuffer: f32;
5046
47+
struct mainFrag_Input {
48+
@location(0) uv: vec2f,
49+
}
50+
5151
@fragment fn mainFrag(_arg_0: mainFrag_Input) -> @location(0) vec4f {
5252
var uv2 = ((uvTransformUniform * (_arg_0.uv - 0.5f)) + 0.5f);
5353
var col = textureSampleBaseClampToEdge(inputTexture, sampler_1, uv2);

apps/typegpu-docs/tests/individual-example-tests/caustics.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ describe('caustics example', () => {
3131
return mainVertex_Output(vec4f(pos[vertexIndex], 0f, 1f), uv[vertexIndex]);
3232
}
3333
34-
struct mainFragment_Input {
35-
@location(0) uv: vec2f,
36-
}
37-
3834
@group(0) @binding(0) var<uniform> tileDensity: f32;
3935
4036
fn tilePattern(uv: vec2f) -> f32 {
@@ -120,6 +116,10 @@ describe('caustics example', () => {
120116
return mat2x2f(vec2f(cos(angle), sin(angle)), vec2f(-(sin(angle)), cos(angle)));
121117
}
122118
119+
struct mainFragment_Input {
120+
@location(0) uv: vec2f,
121+
}
122+
123123
@fragment fn mainFragment(_arg_0: mainFragment_Input) -> @location(0) vec4f {
124124
var skewMat = mat2x2f(vec2f(0.9800665974617004, 0.19866932928562164), vec2f((-1.9866933079506122f + (_arg_0.uv.x * 3f)), 4.900332889206208f));
125125
var skewedUv = (skewMat * _arg_0.uv);

apps/typegpu-docs/tests/individual-example-tests/chroma-keying.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ describe('chroma keying example', () => {
3232
return fullScreenTriangle_Output(vec4f(pos[vertexIndex], 0, 1), uv[vertexIndex]);
3333
}
3434
35-
struct fragment_Input {
36-
@location(0) uv: vec2f,
37-
}
38-
3935
@group(0) @binding(0) var<uniform> uvTransform: mat2x2f;
4036
4137
@group(1) @binding(0) var inputTexture: texture_external;
@@ -48,6 +44,10 @@ describe('chroma keying example', () => {
4844
4945
@group(0) @binding(3) var<uniform> threshold: f32;
5046
47+
struct fragment_Input {
48+
@location(0) uv: vec2f,
49+
}
50+
5151
@fragment fn fragment(_arg_0: fragment_Input) -> @location(0) vec4f {
5252
var uv2 = ((uvTransform * (_arg_0.uv - 0.5f)) + 0.5f);
5353
var col = textureSampleBaseClampToEdge(inputTexture, sampler_1, uv2);

apps/typegpu-docs/tests/individual-example-tests/confetti.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ describe('confetti example', () => {
5959
6060
struct VertexIn {
6161
@location(0) tilt: f32,
62-
@location(1) angle: f32,
63-
@location(2) color: vec4f,
64-
@location(3) center: vec2f,
6562
@builtin(vertex_index) vertexIndex: u32,
63+
@location(1) angle: f32,
64+
@location(2) center: vec2f,
65+
@location(3) color: vec4f,
6666
}
6767
6868
@vertex fn vertex(_arg_0: VertexIn) -> VertexOut {

apps/typegpu-docs/tests/individual-example-tests/cubemap-reflection.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,14 @@ describe('cubemap reflection example', () => {
257257
return cubeVertexFn_Output((camera.projection * vec4f(viewPos, 1f)), _arg_position.xyz);
258258
}
259259
260-
struct cubeFragmentFn_Input {
261-
@location(0) texCoord: vec3f,
262-
}
263-
264260
@group(1) @binding(0) var cubemap: texture_cube<f32>;
265261
266262
@group(1) @binding(1) var texSampler: sampler;
267263
264+
struct cubeFragmentFn_Input {
265+
@location(0) texCoord: vec3f,
266+
}
267+
268268
@fragment fn cubeFragmentFn(_arg_0: cubeFragmentFn_Input) -> @location(0) vec4f {
269269
return textureSample(cubemap, texSampler, normalize(_arg_0.texCoord));
270270
}
@@ -287,11 +287,6 @@ describe('cubemap reflection example', () => {
287287
return vertexFn_Output((camera.projection * (camera.view * _arg_position)), _arg_normal, _arg_position);
288288
}
289289
290-
struct fragmentFn_Input {
291-
@location(0) normal: vec4f,
292-
@location(1) worldPos: vec4f,
293-
}
294-
295290
struct DirectionalLight {
296291
direction: vec3f,
297292
color: vec3f,
@@ -314,6 +309,11 @@ describe('cubemap reflection example', () => {
314309
315310
@group(1) @binding(1) var texSampler: sampler;
316311
312+
struct fragmentFn_Input {
313+
@location(0) normal: vec4f,
314+
@location(1) worldPos: vec4f,
315+
}
316+
317317
@fragment fn fragmentFn(_arg_0: fragmentFn_Input) -> @location(0) vec4f {
318318
var normalizedNormal = normalize(_arg_0.normal.xyz);
319319
var normalizedLightDir = normalize(light.direction);

apps/typegpu-docs/tests/individual-example-tests/disco.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ describe('disco example', () => {
3232
return mainVertex_Output(vec4f(pos[vertexIndex], 0f, 1f), uv[vertexIndex]);
3333
}
3434
35-
struct mainFragment2_Input {
36-
@location(0) uv: vec2f,
37-
}
38-
3935
@group(0) @binding(0) var<uniform> resolutionUniform: vec2f;
4036
4137
fn aspectCorrected(uv: vec2f) -> vec2f {
@@ -65,6 +61,10 @@ describe('disco example', () => {
6561
return (acc + (col * weight));
6662
}
6763
64+
struct mainFragment2_Input {
65+
@location(0) uv: vec2f,
66+
}
67+
6868
@fragment fn mainFragment2(_arg_0: mainFragment2_Input) -> @location(0) vec4f {
6969
var originalUv = aspectCorrected(_arg_0.uv);
7070
var aspectUv = originalUv;
@@ -243,10 +243,6 @@ describe('disco example', () => {
243243
return mainVertex_Output(vec4f(pos[vertexIndex], 0f, 1f), uv[vertexIndex]);
244244
}
245245
246-
struct mainFragment1_Input {
247-
@location(0) uv: vec2f,
248-
}
249-
250246
@group(0) @binding(0) var<uniform> resolutionUniform: vec2f;
251247
252248
fn aspectCorrected(uv: vec2f) -> vec2f {
@@ -276,6 +272,10 @@ describe('disco example', () => {
276272
return (acc + (col * weight));
277273
}
278274
275+
struct mainFragment1_Input {
276+
@location(0) uv: vec2f,
277+
}
278+
279279
@fragment fn mainFragment1(_arg_0: mainFragment1_Input) -> @location(0) vec4f {
280280
var originalUv = aspectCorrected(_arg_0.uv);
281281
var aspectUv = originalUv;

apps/typegpu-docs/tests/individual-example-tests/fluid-double-buffering.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -558,10 +558,6 @@ describe('fluid double buffering example', () => {
558558
return vertexMain_Output(vec4f(pos[_arg_idx].x, pos[_arg_idx].y, 0f, 1f), uv[_arg_idx]);
559559
}
560560
561-
struct fragmentMain_Input {
562-
@location(0) uv: vec2f,
563-
}
564-
565561
fn coordsToIndex(x: i32, y: i32) -> i32 {
566562
return (x + (y * 256i));
567563
}
@@ -595,6 +591,10 @@ describe('fluid double buffering example', () => {
595591
return false;
596592
}
597593
594+
struct fragmentMain_Input {
595+
@location(0) uv: vec2f,
596+
}
597+
598598
@fragment fn fragmentMain(_arg_0: fragmentMain_Input) -> @location(0) vec4f {
599599
let x = i32((_arg_0.uv.x * 256f));
600600
let y = i32((_arg_0.uv.y * 256f));

0 commit comments

Comments
 (0)