diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-28 02:39:04 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-28 02:39:04 +0100 |
| commit | 472c2258dbeca000a454ea1781f09df63477563e (patch) | |
| tree | 98ac75c3824f19f4a598a807b3cb6aa13e8cb0c3 /src/effects/peak_meter_effect.cc | |
| parent | 1c5a9fb7b8c704a59ec58894adf46d73d1615072 (diff) | |
replace wgsl type: vec4<f32> -> vec4f ..
Diffstat (limited to 'src/effects/peak_meter_effect.cc')
| -rw-r--r-- | src/effects/peak_meter_effect.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/effects/peak_meter_effect.cc b/src/effects/peak_meter_effect.cc index 27adba4..2a7b7f9 100644 --- a/src/effects/peak_meter_effect.cc +++ b/src/effects/peak_meter_effect.cc @@ -14,8 +14,8 @@ PeakMeter::PeakMeter(const GpuContext& ctx, const char* shader_main = R"( struct VertexOutput { - @builtin(position) position: vec4<f32>, - @location(0) uv: vec2<f32>, + @builtin(position) position: vec4f, + @location(0) uv: vec2f, }; @group(0) @binding(0) var inputSampler: sampler; @@ -25,18 +25,18 @@ PeakMeter::PeakMeter(const GpuContext& ctx, @vertex fn vs_main(@builtin(vertex_index) vertexIndex: u32) -> VertexOutput { var output: VertexOutput; - var pos = array<vec2<f32>, 3>( - vec2<f32>(-1.0, -1.0), - vec2<f32>(3.0, -1.0), - vec2<f32>(-1.0, 3.0) + var pos = array<vec2f, 3>( + vec2f(-1.0, -1.0), + vec2f(3.0, -1.0), + vec2f(-1.0, 3.0) ); - output.position = vec4<f32>(pos[vertexIndex], 0.0, 1.0); + output.position = vec4f(pos[vertexIndex], 0.0, 1.0); output.uv = pos[vertexIndex] * 0.5 + 0.5; return output; } @fragment - fn fs_main(input: VertexOutput) -> @location(0) vec4<f32> { + fn fs_main(input: VertexOutput) -> @location(0) vec4f { let bar_y_min = 0.005; let bar_y_max = 0.015; let bar_x_min = 0.015; @@ -47,7 +47,7 @@ PeakMeter::PeakMeter(const GpuContext& ctx, if (in_bar_y && in_bar_x) { let uv_x = (input.uv.x - bar_x_min) / (bar_x_max - bar_x_min); let factor = step(uv_x, uniforms.audio_intensity); - return mix(vec4<f32>(0.0, 0.0, 0.0, 1.0), vec4<f32>(1.0, 0.0, 0.0, 1.0), factor); + return mix(vec4f(0.0, 0.0, 0.0, 1.0), vec4f(1.0, 0.0, 0.0, 1.0), factor); } return textureSample(inputTexture, inputSampler, input.uv); |
