aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/FloatingPointTextureTest.cpp
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2016-11-17 13:27:31 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-17 19:25:37 +0000
commit3a88725d582a8ad816db872d171aa7fdb9b85822 (patch)
tree8d8e421a71e6c205be75553edf5020aaebe348a9 /tests/FloatingPointTextureTest.cpp
parent06a65e2799eaead18f778792801406aff4aec0d9 (diff)
Always use GL_HALF_FLOAT_OES on ANGLE, even with ES3.
In the past, ANGLE always used GL_HALF_FLOAT. I filed a bug about that, and they switched to HALF_FLOAT_OES. However, ES3 has direct support for HALF_FLOAT, so we expect that as the format for read pixels. The better solution would be to remember and return the value we get back from IMPLEMENTATION_COLOR_READ_TYPE, but there are subtleties that create additional bugs when we do that. In particular: If trying to read Alpha8 from RGBA, the current sequence is: 1. readPixelsSupported asks for the format to use. getExternalFormat switches out the format (assuming we're using GL_RED). This creates a format/type pair that fails the ES3.2 rules (16.1.2), so we ask the driver for the secondary format, which matches the one that we expect (from our config table). 2. Then we *actually* do the readPixels, and here we just call getReadPixelsFormat, which does the remapping, but skips the follow up checks in readPixelsSupported. So we end up passing a format/type pair that our code in readPixelsSupported thinks is illegal (and which is neither the pair that our config table stores, *nor* the pair returned by the implementation). A straightforward solution of the original problem is to notice that we had to ask the implementation (because the values are filled in), so we should trust those and not the ones in the config table. But then we miss out on the chance to overwrite the values for the alpha only from RGBA case. Sigh. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4963 Change-Id: Icb0c151c9f07ffc178ed3a597fa8ab0ed3c6cb94 Reviewed-on: https://skia-review.googlesource.com/4963 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'tests/FloatingPointTextureTest.cpp')
-rw-r--r--tests/FloatingPointTextureTest.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/tests/FloatingPointTextureTest.cpp b/tests/FloatingPointTextureTest.cpp
index fe0368d55a..8f0be39360 100644
--- a/tests/FloatingPointTextureTest.cpp
+++ b/tests/FloatingPointTextureTest.cpp
@@ -69,18 +69,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(FloatingPointTextureTest, reporter, ctxInfo)
static const int HALF_ALPHA_CONTROL_ARRAY_SIZE = DEV_W * DEV_H * 1 /*alpha-only*/;
static const SkHalf kMaxIntegerRepresentableInHalfFloatingPoint = 0x6800; // 2 ^ 11
-// The half float tests currently fail on ES3 ANGLE.
-static bool is_rendering_and_not_angle_es3(sk_gpu_test::GrContextFactory::ContextType type) {
- if (type == sk_gpu_test::GrContextFactory::kANGLE_D3D11_ES3_ContextType ||
- type == sk_gpu_test::GrContextFactory::kANGLE_GL_ES3_ContextType) {
- return false;
- }
- return sk_gpu_test::GrContextFactory::IsRenderingContext(type);
-}
-
-DEF_GPUTEST_FOR_CONTEXTS(HalfFloatAlphaTextureTest,
- &is_rendering_and_not_angle_es3,
- reporter, ctxInfo) {
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(HalfFloatAlphaTextureTest, reporter, ctxInfo) {
runFPTest<SkHalf>(reporter, ctxInfo.grContext(), SK_HalfMin, SK_HalfMax, SK_HalfEpsilon,
kMaxIntegerRepresentableInHalfFloatingPoint,
HALF_ALPHA_CONTROL_ARRAY_SIZE, kAlpha_half_GrPixelConfig);
@@ -88,9 +77,7 @@ DEF_GPUTEST_FOR_CONTEXTS(HalfFloatAlphaTextureTest,
static const int HALF_RGBA_CONTROL_ARRAY_SIZE = DEV_W * DEV_H * 4 /*RGBA*/;
-DEF_GPUTEST_FOR_CONTEXTS(HalfFloatRGBATextureTest,
- &is_rendering_and_not_angle_es3,
- reporter, ctxInfo) {
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(HalfFloatRGBATextureTest, reporter, ctxInfo) {
runFPTest<SkHalf>(reporter, ctxInfo.grContext(), SK_HalfMin, SK_HalfMax, SK_HalfEpsilon,
kMaxIntegerRepresentableInHalfFloatingPoint,
HALF_RGBA_CONTROL_ARRAY_SIZE, kRGBA_half_GrPixelConfig);