summaryrefslogtreecommitdiff
path: root/test/programs
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2019-05-17 19:24:54 +0300
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2019-05-21 15:05:37 +0300
commitc2f974f2a57348213cc02d2472f9c54ba86e6010 (patch)
treefc5bbe006910eb755efd618900a04bf8f75b234d /test/programs
parentf210bbbb6c9532c5bdcf176e191bef9a0a9858c7 (diff)
downloadqtlocation-mapboxgl-c2f974f2a57348213cc02d2472f9c54ba86e6010.tar.gz
[core] Remove binary shader support
The implementation is buggy and not worth maintaining anymore because performance benefits are not substantial or sometimes worse. Also, removing it saves about 150 ~ 180 KB in binary size. Below timings are averages of minimum 5 runs. ``` Device Init launch Average relaunch s10 1129.8 ms 700 ms s10 - binary 1346.75 ms 694 ms Pixel 1692 ms 723 ms Pixel - binary 1883 ms 1039 ms Kazam 17948 ms 1339 ms Kazam - binary 19157 ms 1564 ms Wiko 2060 ms 1278 ms Wiko - binary 3876 ms 1136 ms ``` Fixes #14294
Diffstat (limited to 'test/programs')
-rw-r--r--test/programs/binary_program.test.cpp44
1 files changed, 0 insertions, 44 deletions
diff --git a/test/programs/binary_program.test.cpp b/test/programs/binary_program.test.cpp
deleted file mode 100644
index 76073efc87..0000000000
--- a/test/programs/binary_program.test.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-#include <mbgl/test/util.hpp>
-
-#include <mbgl/gl/binary_program.hpp>
-
-using namespace mbgl;
-
-TEST(BinaryProgram, ObtainValues) {
- const gl::BinaryProgram binaryProgram{ 42,
- "binary code",
- "identifier",
- { { "a_pos", 1 }, { "a_data", 4 } },
- { { "u_world", 1 }, { "u_ratio", 3 } },
- { { "u_image", 0 } } };
-
- EXPECT_EQ(42u, binaryProgram.format());
- EXPECT_EQ("binary code", binaryProgram.code());
- EXPECT_EQ("identifier", binaryProgram.identifier());
- EXPECT_EQ(1u, binaryProgram.attributeLocation("a_pos"));
- EXPECT_FALSE(binaryProgram.attributeLocation("u_world"));
- EXPECT_EQ(4u, binaryProgram.attributeLocation("a_data"));
- EXPECT_EQ(1, binaryProgram.uniformLocation("u_world"));
- EXPECT_EQ(3, binaryProgram.uniformLocation("u_ratio"));
- EXPECT_EQ(-1, binaryProgram.uniformLocation("a_data"));
- EXPECT_EQ(0, binaryProgram.textureLocation("u_image"));
- EXPECT_EQ(-1, binaryProgram.textureLocation("u_image2"));
-
- auto serialized = binaryProgram.serialize();
-
- const gl::BinaryProgram binaryProgram2(std::move(serialized));
-
- EXPECT_EQ(42u, binaryProgram2.format());
- EXPECT_EQ("binary code", binaryProgram2.code());
- EXPECT_EQ("identifier", binaryProgram2.identifier());
- EXPECT_EQ(1u, binaryProgram2.attributeLocation("a_pos"));
- EXPECT_FALSE(binaryProgram2.attributeLocation("u_world"));
- EXPECT_EQ(4u, binaryProgram2.attributeLocation("a_data"));
- EXPECT_EQ(1, binaryProgram2.uniformLocation("u_world"));
- EXPECT_EQ(3, binaryProgram2.uniformLocation("u_ratio"));
- EXPECT_EQ(-1, binaryProgram2.uniformLocation("a_data"));
- EXPECT_EQ(0, binaryProgram.textureLocation("u_image"));
- EXPECT_EQ(-1, binaryProgram.textureLocation("u_image2"));
-
- EXPECT_THROW(gl::BinaryProgram(""), std::runtime_error);
-}