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

Commit 1dc0d39

Browse files
sugoi1Commit Bot
authored andcommitted
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>
1 parent 089ef0f commit 1dc0d39

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/libANGLE/formatutils.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,6 @@ 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-
150141
// R8, RG8
151142
static bool SizedRGSupport(const Version &clientVersion, const Extensions &extensions)
152143
{
@@ -1080,8 +1071,8 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap()
10801071
AddRGBAFormat(&map, GL_RGBA, false, 16, 16, 16, 16, 0, GL_RGBA, GL_HALF_FLOAT, GL_FLOAT, false, NeverSupported, NeverSupported, NeverSupported, NeverSupported, NeverSupported);
10811072
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);
10821073
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);
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);
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);
10851076
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);
10861077
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);
10871078
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)