Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 032431a

Browse files
Alexis HétuCommit Bot
authored andcommitted
Revert "Allow rendering to half float in ES2 contexts when possible"
This reverts commit 1dc0d39. Reason for revert: Causes a failure on the bots. See: http://anglebug.com/5206 Original change's description: > Allow rendering to half float in ES2 contexts when possible > > According to the EXT_color_buffer_half_float spec: > > "Dependencies on OES_texture_half_float > > If OES_texture_half_float is not supported, then all references to > RGBA16F_EXT, RGB16F_EXT, RG16F_EXT, R16F_EXT, HALF_FLOAT_OES and > half should be ignored. > > If OES_texture_half_float is supported, textures created with: > > <internalformat> = RGBA > <format> = RGBA > <type> = HALF_FLOAT_OES > > are renderable." > > This fixes 4 viz_unittests when running with SwANGLE: > All/GLI420ConverterPixelTest.ScaleAndConvert/0 > All/GLI420ConverterPixelTest.ScaleAndConvert/1 > GLScalerPixelTest.Example_ScaleAndExportForScreenVideoCapture > GLScalerPixelTest.ScalesWithColorManagement > > Bug: angleproject:5174 > Change-Id: If8623b1edbc8f0bac83513ea202ef49ad388101c > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2489726 > Commit-Queue: Alexis Hétu <sugoi@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> TBR=sugoi@chromium.org,geofflang@chromium.org,sugoi@google.com Change-Id: Iab2df8ac563661fcf270425408b17e7bbe48a255 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:5174 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2490820 Reviewed-by: Alexis Hétu <sugoi@chromium.org> Commit-Queue: Alexis Hétu <sugoi@chromium.org>
1 parent 25bbf5d commit 032431a

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/libANGLE/formatutils.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,15 @@ static bool RequireExtOrExtOrExt(const Version &, const Extensions &extensions)
138138
return extensions.*bool1 || extensions.*bool2 || extensions.*bool3;
139139
}
140140

141+
static bool UnsizedHalfFloatOESRGBATextureAttachmentSupport(const Version &clientVersion,
142+
const Extensions &extensions)
143+
{
144+
// dEQP requires ES3 + EXT_color_buffer_half_float for rendering to RGB[A] + HALF_FLOAT_OES
145+
// textures but WebGL allows it with just ES 2.0
146+
return (clientVersion.major >= 3 || extensions.webglCompatibility) &&
147+
extensions.colorBufferHalfFloat;
148+
}
149+
141150
// R8, RG8
142151
static bool SizedRGSupport(const Version &clientVersion, const Extensions &extensions)
143152
{
@@ -1071,8 +1080,8 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap()
10711080
AddRGBAFormat(&map, GL_RGBA, false, 16, 16, 16, 16, 0, GL_RGBA, GL_HALF_FLOAT, GL_FLOAT, false, NeverSupported, NeverSupported, NeverSupported, NeverSupported, NeverSupported);
10721081
AddRGBAFormat(&map, GL_RED, false, 16, 0, 0, 0, 0, GL_RED, GL_HALF_FLOAT_OES, GL_FLOAT, false, RequireExtAndExt<&Extensions::textureHalfFloat, &Extensions::textureRG>, RequireExt<&Extensions::textureHalfFloatLinear>, AlwaysSupported, NeverSupported, NeverSupported);
10731082
AddRGBAFormat(&map, GL_RG, false, 16, 16, 0, 0, 0, GL_RG, GL_HALF_FLOAT_OES, GL_FLOAT, false, RequireExtAndExt<&Extensions::textureHalfFloat, &Extensions::textureRG>, RequireExt<&Extensions::textureHalfFloatLinear>, AlwaysSupported, NeverSupported, NeverSupported);
1074-
AddRGBAFormat(&map, GL_RGB, false, 16, 16, 16, 0, 0, GL_RGB, GL_HALF_FLOAT_OES, GL_FLOAT, false, RequireExt<&Extensions::textureHalfFloat>, RequireExt<&Extensions::textureHalfFloatLinear>, RequireExt<&Extensions::colorBufferHalfFloat>, NeverSupported, NeverSupported);
1075-
AddRGBAFormat(&map, GL_RGBA, false, 16, 16, 16, 16, 0, GL_RGBA, GL_HALF_FLOAT_OES, GL_FLOAT, false, RequireExt<&Extensions::textureHalfFloat>, RequireExt<&Extensions::textureHalfFloatLinear>, RequireExt<&Extensions::colorBufferHalfFloat>, NeverSupported, NeverSupported);
1083+
AddRGBAFormat(&map, GL_RGB, false, 16, 16, 16, 0, 0, GL_RGB, GL_HALF_FLOAT_OES, GL_FLOAT, false, RequireExt<&Extensions::textureHalfFloat>, RequireExt<&Extensions::textureHalfFloatLinear>, UnsizedHalfFloatOESRGBATextureAttachmentSupport, NeverSupported, NeverSupported);
1084+
AddRGBAFormat(&map, GL_RGBA, false, 16, 16, 16, 16, 0, GL_RGBA, GL_HALF_FLOAT_OES, GL_FLOAT, false, RequireExt<&Extensions::textureHalfFloat>, RequireExt<&Extensions::textureHalfFloatLinear>, UnsizedHalfFloatOESRGBATextureAttachmentSupport, NeverSupported, NeverSupported);
10761085
AddRGBAFormat(&map, GL_RED, false, 32, 0, 0, 0, 0, GL_RED, GL_FLOAT, GL_FLOAT, false, RequireExtAndExt<&Extensions::textureFloatOES, &Extensions::textureRG>, RequireExt<&Extensions::textureFloatLinearOES>, AlwaysSupported, NeverSupported, NeverSupported);
10771086
AddRGBAFormat(&map, GL_RG, false, 32, 32, 0, 0, 0, GL_RG, GL_FLOAT, GL_FLOAT, false, RequireExtAndExt<&Extensions::textureFloatOES, &Extensions::textureRG>, RequireExt<&Extensions::textureFloatLinearOES>, AlwaysSupported, NeverSupported, NeverSupported);
10781087
AddRGBAFormat(&map, GL_RGB, false, 32, 32, 32, 0, 0, GL_RGB, GL_FLOAT, GL_FLOAT, false, RequireExt<&Extensions::textureFloatOES>, RequireExt<&Extensions::textureFloatLinearOES>, NeverSupported, NeverSupported, NeverSupported);

0 commit comments

Comments
 (0)