aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/SkSLMemoryLayoutTest.cpp
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2017-07-28 15:19:46 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-28 20:43:03 +0000
commit5af9ea399d5e0344cc4b7da4e97b5dc5b3c74f64 (patch)
treedf906a3af0b954b130340589f24d128ce655bb01 /tests/SkSLMemoryLayoutTest.cpp
parent0edfbb78244739cb6e695f240edb7f659a543160 (diff)
renamed SkSL types in preparation for killing precision modifiers
Bug: skia: Change-Id: Iff0289e25355a89cdc289a0892ed755dd1b1c900 Reviewed-on: https://skia-review.googlesource.com/27703 Commit-Queue: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tests/SkSLMemoryLayoutTest.cpp')
-rw-r--r--tests/SkSLMemoryLayoutTest.cpp124
1 files changed, 62 insertions, 62 deletions
diff --git a/tests/SkSLMemoryLayoutTest.cpp b/tests/SkSLMemoryLayoutTest.cpp
index ff3d0105bd..0a5d382e8a 100644
--- a/tests/SkSLMemoryLayoutTest.cpp
+++ b/tests/SkSLMemoryLayoutTest.cpp
@@ -18,43 +18,43 @@ DEF_TEST(SkSLMemoryLayout140Test, r) {
// basic types
REPORTER_ASSERT(r, 4 == layout.size(*context.fFloat_Type));
- REPORTER_ASSERT(r, 8 == layout.size(*context.fVec2_Type));
- REPORTER_ASSERT(r, 12 == layout.size(*context.fVec3_Type));
- REPORTER_ASSERT(r, 16 == layout.size(*context.fVec4_Type));
+ REPORTER_ASSERT(r, 8 == layout.size(*context.fFloat2_Type));
+ REPORTER_ASSERT(r, 12 == layout.size(*context.fFloat3_Type));
+ REPORTER_ASSERT(r, 16 == layout.size(*context.fFloat4_Type));
REPORTER_ASSERT(r, 4 == layout.size(*context.fInt_Type));
- REPORTER_ASSERT(r, 8 == layout.size(*context.fIVec2_Type));
- REPORTER_ASSERT(r, 12 == layout.size(*context.fIVec3_Type));
- REPORTER_ASSERT(r, 16 == layout.size(*context.fIVec4_Type));
+ REPORTER_ASSERT(r, 8 == layout.size(*context.fInt2_Type));
+ REPORTER_ASSERT(r, 12 == layout.size(*context.fInt3_Type));
+ REPORTER_ASSERT(r, 16 == layout.size(*context.fInt4_Type));
REPORTER_ASSERT(r, 1 == layout.size(*context.fBool_Type));
- REPORTER_ASSERT(r, 2 == layout.size(*context.fBVec2_Type));
- REPORTER_ASSERT(r, 3 == layout.size(*context.fBVec3_Type));
- REPORTER_ASSERT(r, 4 == layout.size(*context.fBVec4_Type));
- REPORTER_ASSERT(r, 32 == layout.size(*context.fMat2x2_Type));
- REPORTER_ASSERT(r, 32 == layout.size(*context.fMat2x4_Type));
- REPORTER_ASSERT(r, 48 == layout.size(*context.fMat3x3_Type));
- REPORTER_ASSERT(r, 64 == layout.size(*context.fMat4x2_Type));
- REPORTER_ASSERT(r, 64 == layout.size(*context.fMat4x4_Type));
+ REPORTER_ASSERT(r, 2 == layout.size(*context.fBool2_Type));
+ REPORTER_ASSERT(r, 3 == layout.size(*context.fBool3_Type));
+ REPORTER_ASSERT(r, 4 == layout.size(*context.fBool4_Type));
+ REPORTER_ASSERT(r, 32 == layout.size(*context.fFloat2x2_Type));
+ REPORTER_ASSERT(r, 32 == layout.size(*context.fFloat2x4_Type));
+ REPORTER_ASSERT(r, 48 == layout.size(*context.fFloat3x3_Type));
+ REPORTER_ASSERT(r, 64 == layout.size(*context.fFloat4x2_Type));
+ REPORTER_ASSERT(r, 64 == layout.size(*context.fFloat4x4_Type));
REPORTER_ASSERT(r, 4 == layout.alignment(*context.fFloat_Type));
- REPORTER_ASSERT(r, 8 == layout.alignment(*context.fVec2_Type));
- REPORTER_ASSERT(r, 16 == layout.alignment(*context.fVec3_Type));
- REPORTER_ASSERT(r, 16 == layout.alignment(*context.fVec4_Type));
+ REPORTER_ASSERT(r, 8 == layout.alignment(*context.fFloat2_Type));
+ REPORTER_ASSERT(r, 16 == layout.alignment(*context.fFloat3_Type));
+ REPORTER_ASSERT(r, 16 == layout.alignment(*context.fFloat4_Type));
REPORTER_ASSERT(r, 4 == layout.alignment(*context.fInt_Type));
- REPORTER_ASSERT(r, 8 == layout.alignment(*context.fIVec2_Type));
- REPORTER_ASSERT(r, 16 == layout.alignment(*context.fIVec3_Type));
- REPORTER_ASSERT(r, 16 == layout.alignment(*context.fIVec4_Type));
+ REPORTER_ASSERT(r, 8 == layout.alignment(*context.fInt2_Type));
+ REPORTER_ASSERT(r, 16 == layout.alignment(*context.fInt3_Type));
+ REPORTER_ASSERT(r, 16 == layout.alignment(*context.fInt4_Type));
REPORTER_ASSERT(r, 1 == layout.alignment(*context.fBool_Type));
- REPORTER_ASSERT(r, 2 == layout.alignment(*context.fBVec2_Type));
- REPORTER_ASSERT(r, 4 == layout.alignment(*context.fBVec3_Type));
- REPORTER_ASSERT(r, 4 == layout.alignment(*context.fBVec4_Type));
- REPORTER_ASSERT(r, 16 == layout.alignment(*context.fMat2x2_Type));
- REPORTER_ASSERT(r, 16 == layout.alignment(*context.fMat2x4_Type));
- REPORTER_ASSERT(r, 16 == layout.alignment(*context.fMat3x3_Type));
- REPORTER_ASSERT(r, 16 == layout.alignment(*context.fMat4x2_Type));
- REPORTER_ASSERT(r, 16 == layout.alignment(*context.fMat4x4_Type));
+ REPORTER_ASSERT(r, 2 == layout.alignment(*context.fBool2_Type));
+ REPORTER_ASSERT(r, 4 == layout.alignment(*context.fBool3_Type));
+ REPORTER_ASSERT(r, 4 == layout.alignment(*context.fBool4_Type));
+ REPORTER_ASSERT(r, 16 == layout.alignment(*context.fFloat2x2_Type));
+ REPORTER_ASSERT(r, 16 == layout.alignment(*context.fFloat2x4_Type));
+ REPORTER_ASSERT(r, 16 == layout.alignment(*context.fFloat3x3_Type));
+ REPORTER_ASSERT(r, 16 == layout.alignment(*context.fFloat4x2_Type));
+ REPORTER_ASSERT(r, 16 == layout.alignment(*context.fFloat4x4_Type));
// struct 1
std::vector<SkSL::Type::Field> fields1;
- fields1.emplace_back(SkSL::Modifiers(), SkString("a"), context.fVec3_Type.get());
+ fields1.emplace_back(SkSL::Modifiers(), SkString("a"), context.fFloat3_Type.get());
SkSL::Type s1(SkSL::Position(), SkString("s1"), fields1);
REPORTER_ASSERT(r, 16 == layout.size(s1));
REPORTER_ASSERT(r, 16 == layout.alignment(s1));
@@ -76,7 +76,7 @@ DEF_TEST(SkSLMemoryLayout140Test, r) {
REPORTER_ASSERT(r, 16 == layout.size(s4));
REPORTER_ASSERT(r, 16 == layout.alignment(s4));
- fields2.emplace_back(SkSL::Modifiers(), SkString("b"), context.fVec3_Type.get());
+ fields2.emplace_back(SkSL::Modifiers(), SkString("b"), context.fFloat3_Type.get());
SkSL::Type s5(SkSL::Position(), SkString("s5"), fields2);
REPORTER_ASSERT(r, 32 == layout.size(s5));
REPORTER_ASSERT(r, 16 == layout.alignment(s5));
@@ -87,7 +87,7 @@ DEF_TEST(SkSLMemoryLayout140Test, r) {
REPORTER_ASSERT(r, 16 == layout.alignment(array1));
REPORTER_ASSERT(r, 16 == layout.stride(array1));
- SkSL::Type array2(SkString("vec4[4]"), SkSL::Type::kArray_Kind, *context.fVec4_Type, 4);
+ SkSL::Type array2(SkString("float4[4]"), SkSL::Type::kArray_Kind, *context.fFloat4_Type, 4);
REPORTER_ASSERT(r, 64 == layout.size(array2));
REPORTER_ASSERT(r, 16 == layout.alignment(array2));
REPORTER_ASSERT(r, 16 == layout.stride(array2));
@@ -99,43 +99,43 @@ DEF_TEST(SkSLMemoryLayout430Test, r) {
// basic types
REPORTER_ASSERT(r, 4 == layout.size(*context.fFloat_Type));
- REPORTER_ASSERT(r, 8 == layout.size(*context.fVec2_Type));
- REPORTER_ASSERT(r, 12 == layout.size(*context.fVec3_Type));
- REPORTER_ASSERT(r, 16 == layout.size(*context.fVec4_Type));
+ REPORTER_ASSERT(r, 8 == layout.size(*context.fFloat2_Type));
+ REPORTER_ASSERT(r, 12 == layout.size(*context.fFloat3_Type));
+ REPORTER_ASSERT(r, 16 == layout.size(*context.fFloat4_Type));
REPORTER_ASSERT(r, 4 == layout.size(*context.fInt_Type));
- REPORTER_ASSERT(r, 8 == layout.size(*context.fIVec2_Type));
- REPORTER_ASSERT(r, 12 == layout.size(*context.fIVec3_Type));
- REPORTER_ASSERT(r, 16 == layout.size(*context.fIVec4_Type));
+ REPORTER_ASSERT(r, 8 == layout.size(*context.fInt2_Type));
+ REPORTER_ASSERT(r, 12 == layout.size(*context.fInt3_Type));
+ REPORTER_ASSERT(r, 16 == layout.size(*context.fInt4_Type));
REPORTER_ASSERT(r, 1 == layout.size(*context.fBool_Type));
- REPORTER_ASSERT(r, 2 == layout.size(*context.fBVec2_Type));
- REPORTER_ASSERT(r, 3 == layout.size(*context.fBVec3_Type));
- REPORTER_ASSERT(r, 4 == layout.size(*context.fBVec4_Type));
- REPORTER_ASSERT(r, 16 == layout.size(*context.fMat2x2_Type));
- REPORTER_ASSERT(r, 32 == layout.size(*context.fMat2x4_Type));
- REPORTER_ASSERT(r, 48 == layout.size(*context.fMat3x3_Type));
- REPORTER_ASSERT(r, 32 == layout.size(*context.fMat4x2_Type));
- REPORTER_ASSERT(r, 64 == layout.size(*context.fMat4x4_Type));
+ REPORTER_ASSERT(r, 2 == layout.size(*context.fBool2_Type));
+ REPORTER_ASSERT(r, 3 == layout.size(*context.fBool3_Type));
+ REPORTER_ASSERT(r, 4 == layout.size(*context.fBool4_Type));
+ REPORTER_ASSERT(r, 16 == layout.size(*context.fFloat2x2_Type));
+ REPORTER_ASSERT(r, 32 == layout.size(*context.fFloat2x4_Type));
+ REPORTER_ASSERT(r, 48 == layout.size(*context.fFloat3x3_Type));
+ REPORTER_ASSERT(r, 32 == layout.size(*context.fFloat4x2_Type));
+ REPORTER_ASSERT(r, 64 == layout.size(*context.fFloat4x4_Type));
REPORTER_ASSERT(r, 4 == layout.alignment(*context.fFloat_Type));
- REPORTER_ASSERT(r, 8 == layout.alignment(*context.fVec2_Type));
- REPORTER_ASSERT(r, 16 == layout.alignment(*context.fVec3_Type));
- REPORTER_ASSERT(r, 16 == layout.alignment(*context.fVec4_Type));
+ REPORTER_ASSERT(r, 8 == layout.alignment(*context.fFloat2_Type));
+ REPORTER_ASSERT(r, 16 == layout.alignment(*context.fFloat3_Type));
+ REPORTER_ASSERT(r, 16 == layout.alignment(*context.fFloat4_Type));
REPORTER_ASSERT(r, 4 == layout.alignment(*context.fInt_Type));
- REPORTER_ASSERT(r, 8 == layout.alignment(*context.fIVec2_Type));
- REPORTER_ASSERT(r, 16 == layout.alignment(*context.fIVec3_Type));
- REPORTER_ASSERT(r, 16 == layout.alignment(*context.fIVec4_Type));
+ REPORTER_ASSERT(r, 8 == layout.alignment(*context.fInt2_Type));
+ REPORTER_ASSERT(r, 16 == layout.alignment(*context.fInt3_Type));
+ REPORTER_ASSERT(r, 16 == layout.alignment(*context.fInt4_Type));
REPORTER_ASSERT(r, 1 == layout.alignment(*context.fBool_Type));
- REPORTER_ASSERT(r, 2 == layout.alignment(*context.fBVec2_Type));
- REPORTER_ASSERT(r, 4 == layout.alignment(*context.fBVec3_Type));
- REPORTER_ASSERT(r, 4 == layout.alignment(*context.fBVec4_Type));
- REPORTER_ASSERT(r, 8 == layout.alignment(*context.fMat2x2_Type));
- REPORTER_ASSERT(r, 16 == layout.alignment(*context.fMat2x4_Type));
- REPORTER_ASSERT(r, 16 == layout.alignment(*context.fMat3x3_Type));
- REPORTER_ASSERT(r, 8 == layout.alignment(*context.fMat4x2_Type));
- REPORTER_ASSERT(r, 16 == layout.alignment(*context.fMat4x4_Type));
+ REPORTER_ASSERT(r, 2 == layout.alignment(*context.fBool2_Type));
+ REPORTER_ASSERT(r, 4 == layout.alignment(*context.fBool3_Type));
+ REPORTER_ASSERT(r, 4 == layout.alignment(*context.fBool4_Type));
+ REPORTER_ASSERT(r, 8 == layout.alignment(*context.fFloat2x2_Type));
+ REPORTER_ASSERT(r, 16 == layout.alignment(*context.fFloat2x4_Type));
+ REPORTER_ASSERT(r, 16 == layout.alignment(*context.fFloat3x3_Type));
+ REPORTER_ASSERT(r, 8 == layout.alignment(*context.fFloat4x2_Type));
+ REPORTER_ASSERT(r, 16 == layout.alignment(*context.fFloat4x4_Type));
// struct 1
std::vector<SkSL::Type::Field> fields1;
- fields1.emplace_back(SkSL::Modifiers(), SkString("a"), context.fVec3_Type.get());
+ fields1.emplace_back(SkSL::Modifiers(), SkString("a"), context.fFloat3_Type.get());
SkSL::Type s1(SkSL::Position(), SkString("s1"), fields1);
REPORTER_ASSERT(r, 16 == layout.size(s1));
REPORTER_ASSERT(r, 16 == layout.alignment(s1));
@@ -157,7 +157,7 @@ DEF_TEST(SkSLMemoryLayout430Test, r) {
REPORTER_ASSERT(r, 4 == layout.size(s4));
REPORTER_ASSERT(r, 4 == layout.alignment(s4));
- fields2.emplace_back(SkSL::Modifiers(), SkString("b"), context.fVec3_Type.get());
+ fields2.emplace_back(SkSL::Modifiers(), SkString("b"), context.fFloat3_Type.get());
SkSL::Type s5(SkSL::Position(), SkString("s5"), fields2);
REPORTER_ASSERT(r, 32 == layout.size(s5));
REPORTER_ASSERT(r, 16 == layout.alignment(s5));
@@ -168,7 +168,7 @@ DEF_TEST(SkSLMemoryLayout430Test, r) {
REPORTER_ASSERT(r, 4 == layout.alignment(array1));
REPORTER_ASSERT(r, 4 == layout.stride(array1));
- SkSL::Type array2(SkString("vec4[4]"), SkSL::Type::kArray_Kind, *context.fVec4_Type, 4);
+ SkSL::Type array2(SkString("float4[4]"), SkSL::Type::kArray_Kind, *context.fFloat4_Type, 4);
REPORTER_ASSERT(r, 64 == layout.size(array2));
REPORTER_ASSERT(r, 16 == layout.alignment(array2));
REPORTER_ASSERT(r, 16 == layout.stride(array2));