Skip to content

Commit

Permalink
Bug 1459526 - Handle full-range video in Webrender. r=gw,lsalzman
Browse files Browse the repository at this point in the history
+ Begin to add video tests to ensure we ratchet towards correctness.
+ Test rec709 x (yuv420p, yuv420p10, gbrp) x (tv, pc) x codecs.
+ Just mark fuzziness for now. Better would be e.g. 16_127_233 'bad
  references'.

Differential Revision: https://phabricator.services.mozilla.com/D115298

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/10a229d128c0ff0c059abbcac250db8398a40004
  • Loading branch information
kdashg committed Jun 25, 2021
1 parent daa8b00 commit 4bccca7
Show file tree
Hide file tree
Showing 16 changed files with 737 additions and 276 deletions.
56 changes: 49 additions & 7 deletions glsl-to-cxx/src/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2260,7 +2260,10 @@ fn translate_expression(state: &mut State, e: &syntax::Expr) -> Expr {
match (lhs.ty.kind, rhs.ty.kind) {
(TypeKind::Mat2, TypeKind::Vec2) |
(TypeKind::Mat3, TypeKind::Vec3) |
(TypeKind::Mat3, TypeKind::Mat3) |
(TypeKind::Mat3, TypeKind::Mat43) |
(TypeKind::Mat4, TypeKind::Vec4) => rhs.ty.clone(),
(TypeKind::Mat43, TypeKind::Vec4) => Type::new(TypeKind::Vec3),
(TypeKind::Mat2, TypeKind::Float) |
(TypeKind::Mat3, TypeKind::Float) |
(TypeKind::Mat4, TypeKind::Float) => lhs.ty.clone(),
Expand Down Expand Up @@ -2551,7 +2554,7 @@ fn translate_expression(state: &mut State, e: &syntax::Expr) -> Expr {
.fields
.iter()
.find(|x| &x.name == i)
.expect("missing field");
.expect(&format!("missing field `{}` in `{}`", i, sym.name));
Expr {
kind: ExprKind::Dot(e, i.clone()),
ty: field.ty.clone(),
Expand Down Expand Up @@ -3043,6 +3046,13 @@ pub fn ast_to_hir(state: &mut State, tu: &syntax::TranslationUnit) -> Translatio
Type::new(Vec4),
vec![Type::new(Vec4)],
);
declare_function(
state,
"vec4",
Some("make_vec4"),
Type::new(Vec4),
vec![Type::new(IVec4)],
);

declare_function(
state,
Expand Down Expand Up @@ -3228,6 +3238,35 @@ pub fn ast_to_hir(state: &mut State, tu: &syntax::TranslationUnit) -> Translatio
Type::new(Float),
],
);
declare_function(
state,
"mat3x4",
Some("make_mat3x4"),
Type::new(Mat34),
vec![
Type::new(Float),
Type::new(Float),
Type::new(Float),
Type::new(Float),

Type::new(Float),
Type::new(Float),
Type::new(Float),
Type::new(Float),

Type::new(Float),
Type::new(Float),
Type::new(Float),
Type::new(Float),
],
);
declare_function(
state,
"transpose",
None,
Type::new(Mat43),
vec![Type::new(Mat34)],
);
declare_function(
state,
"mat4",
Expand Down Expand Up @@ -4127,7 +4166,7 @@ pub fn ast_to_hir(state: &mut State, tu: &syntax::TranslationUnit) -> Translatio
None,
Type::new(Void),
vec![Type::new(*s), Type::new(Vec2), Type::new(Vec4),
Type::new(Int), Type::new(Int)],
Type::new(Vec3), Type::new(Mat3), Type::new(Int)],
);
declare_function(
state,
Expand All @@ -4136,7 +4175,7 @@ pub fn ast_to_hir(state: &mut State, tu: &syntax::TranslationUnit) -> Translatio
Type::new(Void),
vec![Type::new(*s), Type::new(Vec2), Type::new(Vec4),
Type::new(*s), Type::new(Vec2), Type::new(Vec4),
Type::new(Int), Type::new(Int)],
Type::new(Vec3), Type::new(Mat3), Type::new(Int)],
);
declare_function(
state,
Expand All @@ -4146,15 +4185,16 @@ pub fn ast_to_hir(state: &mut State, tu: &syntax::TranslationUnit) -> Translatio
vec![Type::new(*s), Type::new(Vec2), Type::new(Vec4),
Type::new(*s), Type::new(Vec2), Type::new(Vec4),
Type::new(*s), Type::new(Vec2), Type::new(Vec4),
Type::new(Int), Type::new(Int)],
Type::new(Vec3), Type::new(Mat3), Type::new(Int)],
);
declare_function(
state,
"swgl_commitTextureLinearColorYUV",
None,
Type::new(Void),
vec![Type::new(*s), Type::new(Vec2), Type::new(Vec4),
Type::new(Int), Type::new(Int), Type::new(Float)],
Type::new(Vec3), Type::new(Mat3), Type::new(Int),
Type::new(Float)],
);
declare_function(
state,
Expand All @@ -4163,7 +4203,8 @@ pub fn ast_to_hir(state: &mut State, tu: &syntax::TranslationUnit) -> Translatio
Type::new(Void),
vec![Type::new(*s), Type::new(Vec2), Type::new(Vec4),
Type::new(*s), Type::new(Vec2), Type::new(Vec4),
Type::new(Int), Type::new(Int), Type::new(Float)],
Type::new(Vec3), Type::new(Mat3), Type::new(Int),
Type::new(Float)],
);
declare_function(
state,
Expand All @@ -4173,7 +4214,8 @@ pub fn ast_to_hir(state: &mut State, tu: &syntax::TranslationUnit) -> Translatio
vec![Type::new(*s), Type::new(Vec2), Type::new(Vec4),
Type::new(*s), Type::new(Vec2), Type::new(Vec4),
Type::new(*s), Type::new(Vec2), Type::new(Vec4),
Type::new(Int), Type::new(Int), Type::new(Float)],
Type::new(Vec3), Type::new(Mat3), Type::new(Int),
Type::new(Float)],
);
}

Expand Down
Loading

0 comments on commit 4bccca7

Please sign in to comment.