Skip to content

Commit

Permalink
Backed out changeset f7016db57a2e (bug 1459526) for causing reftest f…
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandru Michis committed Jun 18, 2021
1 parent e003c95 commit 1c43f3b
Show file tree
Hide file tree
Showing 16 changed files with 276 additions and 735 deletions.
56 changes: 7 additions & 49 deletions glsl-to-cxx/src/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2260,10 +2260,7 @@ 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 @@ -2554,7 +2551,7 @@ fn translate_expression(state: &mut State, e: &syntax::Expr) -> Expr {
.fields
.iter()
.find(|x| &x.name == i)
.expect(&format!("missing field `{}` in `{}`", i, sym.name));
.expect("missing field");
Expr {
kind: ExprKind::Dot(e, i.clone()),
ty: field.ty.clone(),
Expand Down Expand Up @@ -3046,13 +3043,6 @@ 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 @@ -3238,35 +3228,6 @@ 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 @@ -4166,7 +4127,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(Vec3), Type::new(Mat3), Type::new(Int)],
Type::new(Int), Type::new(Int)],
);
declare_function(
state,
Expand All @@ -4175,7 +4136,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(Vec3), Type::new(Mat3), Type::new(Int)],
Type::new(Int), Type::new(Int)],
);
declare_function(
state,
Expand All @@ -4185,16 +4146,15 @@ 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(Vec3), Type::new(Mat3), Type::new(Int)],
Type::new(Int), Type::new(Int)],
);
declare_function(
state,
"swgl_commitTextureLinearColorYUV",
None,
Type::new(Void),
vec![Type::new(*s), Type::new(Vec2), Type::new(Vec4),
Type::new(Vec3), Type::new(Mat3), Type::new(Int),
Type::new(Float)],
Type::new(Int), Type::new(Int), Type::new(Float)],
);
declare_function(
state,
Expand All @@ -4203,8 +4163,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(Vec3), Type::new(Mat3), Type::new(Int),
Type::new(Float)],
Type::new(Int), Type::new(Int), Type::new(Float)],
);
declare_function(
state,
Expand All @@ -4214,8 +4173,7 @@ 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(Vec3), Type::new(Mat3), Type::new(Int),
Type::new(Float)],
Type::new(Int), Type::new(Int), Type::new(Float)],
);
}

Expand Down
Loading

0 comments on commit 1c43f3b

Please sign in to comment.