diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-07-18 08:24:24 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-07-18 08:24:24 +0200 |
commit | fc61780b35af913801d72086456f493f63197da6 (patch) | |
tree | f85891288a7bd988da9f0f15ae64e5c63f00d493 /gfx/angle/src/tests/gl_tests/UniformTest.cpp | |
parent | 69f7f9e5f1475891ce11cc4f431692f965b0cd30 (diff) | |
parent | 50d3e596bbe89c95615f96eb71f6bc5be737a1db (diff) | |
download | UXP-fc61780b35af913801d72086456f493f63197da6.tar UXP-fc61780b35af913801d72086456f493f63197da6.tar.gz UXP-fc61780b35af913801d72086456f493f63197da6.tar.lz UXP-fc61780b35af913801d72086456f493f63197da6.tar.xz UXP-fc61780b35af913801d72086456f493f63197da6.zip |
Merge commit '50d3e596bbe89c95615f96eb71f6bc5be737a1db' into Basilisk-releasev2018.07.18
# Conflicts:
# browser/app/profile/firefox.js
# browser/components/preferences/jar.mn
Diffstat (limited to 'gfx/angle/src/tests/gl_tests/UniformTest.cpp')
-rwxr-xr-x | gfx/angle/src/tests/gl_tests/UniformTest.cpp | 52 |
1 files changed, 2 insertions, 50 deletions
diff --git a/gfx/angle/src/tests/gl_tests/UniformTest.cpp b/gfx/angle/src/tests/gl_tests/UniformTest.cpp index 4dd2738ef..c3ec72c5c 100755 --- a/gfx/angle/src/tests/gl_tests/UniformTest.cpp +++ b/gfx/angle/src/tests/gl_tests/UniformTest.cpp @@ -459,54 +459,6 @@ TEST_P(UniformTestES3, TranposedMatrixArrayUniformStateQuery) } } -// Check that trying setting too many elements of an array doesn't overflow -TEST_P(UniformTestES3, OverflowArray) -{ - const std::string &vertexShader = - "#version 300 es\n" - "void main() { gl_Position = vec4(1); }"; - const std::string &fragShader = - "#version 300 es\n" - "precision mediump float;\n" - "uniform float uniF[5];\n" - "uniform mat3x2 uniMat3x2[5];\n" - "out vec4 color;\n" - "void main() {\n" - " color = vec4(uniMat3x2[0][0][0] + uniF[0]);\n" - "}"; - - mProgram = CompileProgram(vertexShader, fragShader); - ASSERT_NE(mProgram, 0u); - - glUseProgram(mProgram); - - const size_t kOverflowSize = 10000; - std::vector<GLfloat> values(10000 * 6); - - // Setting as a clump - GLint floatLocation = glGetUniformLocation(mProgram, "uniF"); - ASSERT_NE(-1, floatLocation); - GLint matLocation = glGetUniformLocation(mProgram, "uniMat3x2"); - ASSERT_NE(-1, matLocation); - - // Set too many float uniforms - glUniform1fv(floatLocation, kOverflowSize, &values[0]); - - // Set too many matrix uniforms, transposed or not - glUniformMatrix3x2fv(matLocation, kOverflowSize, GL_FALSE, &values[0]); - glUniformMatrix3x2fv(matLocation, kOverflowSize, GL_TRUE, &values[0]); - - // Same checks but with offsets - GLint floatLocationOffset = glGetUniformLocation(mProgram, "uniF[3]"); - ASSERT_NE(-1, floatLocationOffset); - GLint matLocationOffset = glGetUniformLocation(mProgram, "uniMat3x2[3]"); - ASSERT_NE(-1, matLocationOffset); - - glUniform1fv(floatLocationOffset, kOverflowSize, &values[0]); - glUniformMatrix3x2fv(matLocationOffset, kOverflowSize, GL_FALSE, &values[0]); - glUniformMatrix3x2fv(matLocationOffset, kOverflowSize, GL_TRUE, &values[0]); -} - // Check that sampler uniforms only show up one time in the list TEST_P(UniformTest, SamplerUniformsAppearOnce) { @@ -612,7 +564,7 @@ TEST_P(UniformTestES3, ReturnsOnlyOneArrayElement) for (const auto &array : uniformArrays) { uniformStream << "uniform " << array.type << " " << array.name << "[" - << ToString(kArraySize) << "];\n"; + << std::to_string(kArraySize) << "];\n"; // We need to make use of the uniforms or they get compiled out. for (int i = 0; i < 4; i++) @@ -658,7 +610,7 @@ TEST_P(UniformTestES3, ReturnsOnlyOneArrayElement) { for (size_t index = 0; index < kArraySize; index++) { - std::string strIndex = "[" + ToString(index) + "]"; + std::string strIndex = "[" + std::to_string(index) + "]"; // Check all the different glGetUniformv functions CheckOneElement<float>(glGetUniformfv, mProgram, uniformArray.name + strIndex, uniformArray.components, 42.4242f); |