fix(iced-video): Write the conversion matrix buffer so the video actually shows up
Some checks failed
build / checks-matrix (push) Has been cancelled
build / checks-build (push) Has been cancelled
build / codecov (push) Has been cancelled
docs / docs (push) Has been cancelled

This commit is contained in:
2026-01-15 17:01:41 +05:30
parent 335e8fdbef
commit 429371002b
4 changed files with 89 additions and 75 deletions

View File

@@ -19,16 +19,12 @@ fn vs_main(
@group(0) @binding(0) var y_texture: texture_2d<f32>;
@group(0) @binding(1) var uv_texture: texture_2d<f32>;
@group(0) @binding(2) var texture_sampler: sampler;
@group(0) @binding(3) var<uniform> rgb_primaries: mat4x4<f32>;
@group(0) @binding(3) var<uniform> rgb_primaries: mat3x3<f32>;
@fragment
fn fs_main(input: VertexOutput) -> @location(0) vec4<f32> {
let y = textureSample(y_texture, texture_sampler, input.tex_coords).r;
let uv = textureSample(uv_texture, texture_sampler, input.tex_coords).rg;
let yuv = vec4f(y, uv, 0);
let rgb = rgb_primaries * yuv;
return vec4f(rgb.r, rgb.g, rgb.b, 1.0);
// let rgb = rgb_primaries * yuv;
// return vec4f(rgb, 1.0);
let yuv = vec3f(y, uv);
return vec4f(yuv * rgb_primaries, 1.0);
}