From 472c2258dbeca000a454ea1781f09df63477563e Mon Sep 17 00:00:00 2001 From: skal Date: Sat, 28 Feb 2026 02:39:04 +0100 Subject: replace wgsl type: vec4 -> vec4f .. --- src/effects/peak_meter_effect.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/effects/peak_meter_effect.cc') 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, - @location(0) uv: vec2, + @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, 3>( - vec2(-1.0, -1.0), - vec2(3.0, -1.0), - vec2(-1.0, 3.0) + var pos = array( + vec2f(-1.0, -1.0), + vec2f(3.0, -1.0), + vec2f(-1.0, 3.0) ); - output.position = vec4(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 { + 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(0.0, 0.0, 0.0, 1.0), vec4(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); -- cgit v1.2.3