Browse Source

Shaders: inflate rendering test thresholds a bit for the iPhone GPU.

pull/383/head
Marco Melorio 7 years ago committed by Vladimír Vondruš
parent
commit
c632099501
  1. 18
      src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp
  2. 13
      src/Magnum/Shaders/Test/FlatGLTest.cpp
  3. 6
      src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp
  4. 44
      src/Magnum/Shaders/Test/PhongGLTest.cpp
  5. 1
      src/Magnum/Shaders/Test/VectorGLTest.cpp
  6. 5
      src/Magnum/Shaders/Test/VertexColorGLTest.cpp

18
src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp

@ -88,6 +88,7 @@ struct DistanceFieldVectorGLTest: GL::OpenGLTester {
- SwiftShader ES2/ES3 - SwiftShader ES2/ES3
- ARM Mali (Huawei P10) ES2/ES3 - ARM Mali (Huawei P10) ES2/ES3
- WebGL 1 / 2 (on Mesa Intel) - WebGL 1 / 2 (on Mesa Intel)
- iPhone 6 w/ iOS 12.4
*/ */
using namespace Math::Literals; using namespace Math::Literals;
@ -257,8 +258,8 @@ void DistanceFieldVectorGLTest::renderDefaults2D() {
#if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL))
/* SwiftShader has off-by-one differences on edges, ARM Mali off-by-one in /* SwiftShader has off-by-one differences on edges, ARM Mali off-by-one in
all channels. */ all channels. Apple A8 off-by-more. */
const Float maxThreshold = 3.0f, meanThreshold = 0.076f; const Float maxThreshold = 4.0f, meanThreshold = 0.077f;
#else #else
/* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */ /* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */
const Float maxThreshold = 17.0f, meanThreshold = 0.480f; const Float maxThreshold = 17.0f, meanThreshold = 0.480f;
@ -313,8 +314,8 @@ void DistanceFieldVectorGLTest::renderDefaults3D() {
#if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL))
/* SwiftShader has off-by-one differences on edges, ARM Mali off-by-one in /* SwiftShader has off-by-one differences on edges, ARM Mali off-by-one in
all channels. */ all channels. Apple A8 off-by-more. */
const Float maxThreshold = 3.0f, meanThreshold = 0.076f; const Float maxThreshold = 4.0f, meanThreshold = 0.077f;
#else #else
/* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */ /* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */
const Float maxThreshold = 17.0f, meanThreshold = 0.480f; const Float maxThreshold = 17.0f, meanThreshold = 0.480f;
@ -369,8 +370,9 @@ void DistanceFieldVectorGLTest::render2D() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
#if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL))
/* SwiftShader has off-by-one differences when smoothing */ /* SwiftShader has off-by-one differences when smoothing, Apple A8 a bit
const Float maxThreshold = 5.667f, meanThreshold = 0.268f; more. */
const Float maxThreshold = 6.0f, meanThreshold = 0.360f;
#else #else
/* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */ /* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */
const Float maxThreshold = 17.0f, meanThreshold = 2.386f; const Float maxThreshold = 17.0f, meanThreshold = 2.386f;
@ -430,8 +432,8 @@ void DistanceFieldVectorGLTest::render3D() {
#if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL))
/* SwiftShader has off-by-one differences when smoothing plus a bunch of /* SwiftShader has off-by-one differences when smoothing plus a bunch of
different pixels on primitive edges */ different pixels on primitive edges, Apple A8 a bit more. */
const Float maxThreshold = 17.0f, meanThreshold = 0.192f; const Float maxThreshold = 17.0f, meanThreshold = 0.204f;
#else #else
/* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */ /* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */
const Float maxThreshold = 17.0f, meanThreshold = 1.613f; const Float maxThreshold = 17.0f, meanThreshold = 1.613f;

13
src/Magnum/Shaders/Test/FlatGLTest.cpp

@ -122,6 +122,7 @@ struct FlatGLTest: GL::OpenGLTester {
- NVidia Windows - NVidia Windows
- Intel Windows - Intel Windows
- AMD on macOS - AMD on macOS
- iPhone 6 w/ iOS 12.4
*/ */
using namespace Math::Literals; using namespace Math::Literals;
@ -571,8 +572,8 @@ void FlatGLTest::renderTextured2D() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
#if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL))
/* SwiftShader has minor rounding errors */ /* SwiftShader has minor rounding errors, Apple A8 slightly more */
const Float maxThreshold = 1.334f, meanThreshold = 0.012f; const Float maxThreshold = 2.334f, meanThreshold = 0.023f;
#else #else
/* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */ /* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */
const Float maxThreshold = 15.667f, meanThreshold = 3.254f; const Float maxThreshold = 15.667f, meanThreshold = 3.254f;
@ -673,8 +674,8 @@ template<class T> void FlatGLTest::renderVertexColor2D() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
#if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL))
/* SwiftShader has minor rounding errors. ARM Mali slightly more */ /* SwiftShader has minor rounding errors. ARM Mali / Apple A8 a bit more */
const Float maxThreshold = 1.334f, meanThreshold = 0.015f; const Float maxThreshold = 3.334f, meanThreshold = 0.064f;
#else #else
/* WebGL 1 doesn't have 8bit renderbuffer storage, so it's worse */ /* WebGL 1 doesn't have 8bit renderbuffer storage, so it's worse */
const Float maxThreshold = 15.334f, meanThreshold = 4.355f; const Float maxThreshold = 15.334f, meanThreshold = 4.355f;
@ -731,8 +732,8 @@ template<class T> void FlatGLTest::renderVertexColor3D() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
#if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL))
/* SwiftShader has some minor differences on the edges */ /* SwiftShader has some minor differences on the edges, Apple A8 more */
const Float maxThreshold = 76.67f, meanThreshold = 0.072f; const Float maxThreshold = 76.67f, meanThreshold = 0.138f;
#else #else
/* WebGL 1 doesn't have 8bit renderbuffer storage, so it's worse */ /* WebGL 1 doesn't have 8bit renderbuffer storage, so it's worse */
const Float maxThreshold = 76.67f, meanThreshold = 3.908f; const Float maxThreshold = 76.67f, meanThreshold = 3.908f;

6
src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp

@ -100,6 +100,7 @@ struct MeshVisualizerGLTest: GL::OpenGLTester {
- SwiftShader ES2/ES3 - SwiftShader ES2/ES3
- ARM Mali (Huawei P10) ES2/ES3 - ARM Mali (Huawei P10) ES2/ES3
- WebGL 1 / 2 (on Mesa Intel) - WebGL 1 / 2 (on Mesa Intel)
- iPhone 6 w/ iOS 12.4
*/ */
using namespace Math::Literals; using namespace Math::Literals;
@ -473,8 +474,9 @@ void MeshVisualizerGLTest::renderWireframe() {
/* Test it's not *too* off, at least */ /* Test it's not *too* off, at least */
if(data.flags & MeshVisualizer::Flag::NoGeometryShader) { if(data.flags & MeshVisualizer::Flag::NoGeometryShader) {
#if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL))
/* SwiftShader has differently rasterized edges on four pixels */ /* SwiftShader has differently rasterized edges on four pixels. Apple
const Float maxThreshold = 170.0f, meanThreshold = 0.327f; A8 on more. */
const Float maxThreshold = 170.0f, meanThreshold = 0.330f;
#else #else
/* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */ /* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */
const Float maxThreshold = 170.0f, meanThreshold = 1.699f; const Float maxThreshold = 170.0f, meanThreshold = 1.699f;

44
src/Magnum/Shaders/Test/PhongGLTest.cpp

@ -123,6 +123,7 @@ struct PhongGLTest: GL::OpenGLTester {
- NVidia Windows - NVidia Windows
- Intel Windows - Intel Windows
- AMD on macOS - AMD on macOS
- iPhone 6 w/ iOS 12.4
*/ */
constexpr struct { constexpr struct {
@ -565,8 +566,8 @@ void PhongGLTest::renderColored() {
#if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL))
/* SwiftShader has some minor rounding differences (max = 1). ARM Mali G71 /* SwiftShader has some minor rounding differences (max = 1). ARM Mali G71
has bigger rounding differences. */ and Apple A8 has bigger rounding differences. */
const Float maxThreshold = 8.34f, meanThreshold = 0.066f; const Float maxThreshold = 8.34f, meanThreshold = 0.100f;
#else #else
/* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */ /* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */
const Float maxThreshold = 15.34f, meanThreshold = 3.33f; const Float maxThreshold = 15.34f, meanThreshold = 3.33f;
@ -651,8 +652,8 @@ void PhongGLTest::renderSinglePixelTextured() {
#if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL))
/* SwiftShader has some minor rounding differences (max = 1). ARM Mali G71 /* SwiftShader has some minor rounding differences (max = 1). ARM Mali G71
has bigger rounding differences. */ and Apple A8 has bigger rounding differences. */
const Float maxThreshold = 7.0f, meanThreshold = 0.066f; const Float maxThreshold = 7.67f, meanThreshold = 0.100f;
#else #else
/* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */ /* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */
const Float maxThreshold = 15.34f, meanThreshold = 3.33f; const Float maxThreshold = 15.34f, meanThreshold = 3.33f;
@ -749,8 +750,8 @@ void PhongGLTest::renderTextured() {
#if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL))
/* SwiftShader has few rounding errors at the edges (giving a large max /* SwiftShader has few rounding errors at the edges (giving a large max
error), but that's basically it. */ error), but that's basically it. Apple A8 has more. */
const Float maxThreshold = 210.4f, meanThreshold = 0.126f; const Float maxThreshold = 210.4f, meanThreshold = 0.202f;
#else #else
/* WebGL 1 doesn't have 8bit renderbuffer storage, so it's a bit worse */ /* WebGL 1 doesn't have 8bit renderbuffer storage, so it's a bit worse */
const Float maxThreshold = 210.4f, meanThreshold = 3.434f; const Float maxThreshold = 210.4f, meanThreshold = 3.434f;
@ -834,8 +835,9 @@ void PhongGLTest::renderTexturedNormal() {
/* One pixel in the center didn't survive the transformation. But that's /* One pixel in the center didn't survive the transformation. But that's
okay. Due to the density of the normal map, SwiftShader has an overally okay. Due to the density of the normal map, SwiftShader has an overally
consistent off-by-a-bit error. AMD macOS drivers have one pixel off consistent off-by-a-bit error. AMD macOS drivers have one pixel off
due to a rounding error on the edge. */ due to a rounding error on the edge. Apple A8 has a slightly larger
const Float maxThreshold = 191.0f, meanThreshold = 0.3421f; overall difference. */
const Float maxThreshold = 191.0f, meanThreshold = 0.438f;
#else #else
/* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */ /* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */
const Float maxThreshold = 191.0f, meanThreshold = 3.017f; const Float maxThreshold = 191.0f, meanThreshold = 3.017f;
@ -895,8 +897,9 @@ template<class T> void PhongGLTest::renderVertexColor() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
#if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL))
/* SwiftShader has some minor differences on the edges */ /* SwiftShader has some minor differences on the edges, Apple A8 a bit
const Float maxThreshold = 105.4f, meanThreshold = 0.075f; more */
const Float maxThreshold = 105.4f, meanThreshold = 0.167f;
#else #else
/* WebGL 1 doesn't have 8bit renderbuffer storage, so it's worse */ /* WebGL 1 doesn't have 8bit renderbuffer storage, so it's worse */
const Float maxThreshold = 105.4f, meanThreshold = 3.254f; const Float maxThreshold = 105.4f, meanThreshold = 3.254f;
@ -931,7 +934,12 @@ void PhongGLTest::renderShininess() {
CORRADE_SKIP("AnyImageImporter / TgaImageImporter plugins not found."); CORRADE_SKIP("AnyImageImporter / TgaImageImporter plugins not found.");
{ {
#if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) #ifdef CORRADE_TARGET_IOS
/* Apple A8 has a large single-pixel difference in the shininess ~= 0
case, but it's not nearly as bad as in the "huge ring" case on Mesa
etc. */
const Float maxThreshold = 211.0f, meanThreshold = 0.052f;
#elif !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL))
/* SwiftShader has some minor rounding differences (max = 1.67). ARM /* SwiftShader has some minor rounding differences (max = 1.67). ARM
Mali G71 has bigger rounding differences. */ Mali G71 has bigger rounding differences. */
const Float maxThreshold = 12.0f, meanThreshold = 0.043f; const Float maxThreshold = 12.0f, meanThreshold = 0.043f;
@ -1072,8 +1080,9 @@ void PhongGLTest::renderAlpha() {
#if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL))
/* In some cases (separate vs combined alpha) there are off-by-one errors. /* In some cases (separate vs combined alpha) there are off-by-one errors.
That's okay, as we have only 8bit texture precision. SwiftShader has That's okay, as we have only 8bit texture precision. SwiftShader has
additionally a few minor rounding errors at the edges. */ additionally a few minor rounding errors at the edges, Apple A8 a bit
const Float maxThreshold = 172.667f, meanThreshold = 0.171f; more. */
const Float maxThreshold = 172.667f, meanThreshold = 0.229f;
#else #else
/* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */ /* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */
const Float maxThreshold = 172.667f, meanThreshold = 4.736f; const Float maxThreshold = 172.667f, meanThreshold = 4.736f;
@ -1142,8 +1151,8 @@ void PhongGLTest::renderObjectId() {
/* Color output should have no difference -- same as in colored() */ /* Color output should have no difference -- same as in colored() */
#if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL))
/* SwiftShader has some minor rounding differences (max = 1). ARM Mali G71 /* SwiftShader has some minor rounding differences (max = 1). ARM Mali G71
has bigger rounding differences. */ and Apple A8 has bigger rounding differences. */
const Float maxThreshold = 8.34f, meanThreshold = 0.066f; const Float maxThreshold = 8.34f, meanThreshold = 0.100f;
#else #else
/* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */ /* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */
const Float maxThreshold = 15.34f, meanThreshold = 3.33f; const Float maxThreshold = 15.34f, meanThreshold = 3.33f;
@ -1233,8 +1242,9 @@ void PhongGLTest::renderZeroLights() {
#if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL))
/* Compared to FlatGLTest::renderAlpha3D(0.5), there's a bit more different /* Compared to FlatGLTest::renderAlpha3D(0.5), there's a bit more different
pixels on the edges, caused by matrix multiplication being done in the pixels on the edges, caused by matrix multiplication being done in the
shader and not on the CPU side. */ shader and not on the CPU side. Apple A8 sprinkles a bunch of tiny
const Float maxThreshold = 139.0f, meanThreshold = 0.122f; differences here and there. */
const Float maxThreshold = 139.0f, meanThreshold = 0.140f;
#else #else
/* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */ /* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */
const Float maxThreshold = 139.0f, meanThreshold = 2.896f; const Float maxThreshold = 139.0f, meanThreshold = 2.896f;

1
src/Magnum/Shaders/Test/VectorGLTest.cpp

@ -88,6 +88,7 @@ struct VectorGLTest: GL::OpenGLTester {
- SwiftShader ES2/ES3 - SwiftShader ES2/ES3
- ARM Mali (Huawei P10) ES2/ES3 - ARM Mali (Huawei P10) ES2/ES3
- WebGL 1 / 2 (on Mesa Intel) - WebGL 1 / 2 (on Mesa Intel)
- iPhone 6 w/ iOS 12.4
*/ */
using namespace Math::Literals; using namespace Math::Literals;

5
src/Magnum/Shaders/Test/VertexColorGLTest.cpp

@ -85,6 +85,7 @@ struct VertexColorGLTest: GL::OpenGLTester {
- SwiftShader ES2/ES3 - SwiftShader ES2/ES3
- ARM Mali (Huawei P10) ES2/ES3 - ARM Mali (Huawei P10) ES2/ES3
- WebGL 1 / 2 (on Mesa Intel) - WebGL 1 / 2 (on Mesa Intel)
- iPhone 6 w/ iOS 12.4
*/ */
using namespace Math::Literals; using namespace Math::Literals;
@ -340,8 +341,8 @@ template<class T> void VertexColorGLTest::render3D() {
#if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL))
/* AMD has one different pixel compared to Intel, SwiftShader has /* AMD has one different pixel compared to Intel, SwiftShader has
differently rasterized edges on five pixels */ differently rasterized edges on five pixels. Apple A8 some more. */
const Float maxThreshold = 204.0f, meanThreshold = 0.158f; const Float maxThreshold = 204.0f, meanThreshold = 0.167f;
#else #else
/* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */ /* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */
const Float maxThreshold = 204.0f, meanThreshold = 1.284f; const Float maxThreshold = 204.0f, meanThreshold = 1.284f;

Loading…
Cancel
Save