Commit 6446c888 by Jeff Gilbert Committed by Commit Bot

Combine SizedFloatRGBA[Renderbuffer,TextureAttachment]Support.

Bug: angleproject:3332 Change-Id: Ia937727062d3296af9691a95d296c89b8e9476ac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1544779Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
parent 95446754
...@@ -280,13 +280,6 @@ static bool SizedHalfFloatRGBARenderbufferSupport(const Version &clientVersion, ...@@ -280,13 +280,6 @@ static bool SizedHalfFloatRGBARenderbufferSupport(const Version &clientVersion,
(extensions.colorBufferFloat || extensions.colorBufferHalfFloat); (extensions.colorBufferFloat || extensions.colorBufferHalfFloat);
} }
static bool SizedFloatRGBARenderbufferSupport(const Version &clientVersion,
const Extensions &extensions)
{
return (clientVersion >= Version(3, 0) || extensions.textureFloat) &&
(extensions.colorBufferFloat || extensions.colorBufferFloatRGBA);
}
// R32F, RG32F // R32F, RG32F
static bool SizedFloatRGSupport(const Version &clientVersion, const Extensions &extensions) static bool SizedFloatRGSupport(const Version &clientVersion, const Extensions &extensions)
{ {
...@@ -309,10 +302,12 @@ static bool SizedFloatRGBASupport(const Version &clientVersion, const Extensions ...@@ -309,10 +302,12 @@ static bool SizedFloatRGBASupport(const Version &clientVersion, const Extensions
extensions.colorBufferFloatRGBA; extensions.colorBufferFloatRGBA;
} }
static bool SizedFloatRGBATextureAttachmentSupport(const Version &clientVersion, static bool SizedFloatRGBARenderableSupport(const Version &clientVersion,
const Extensions &extensions) const Extensions &extensions)
{ {
return (extensions.colorBufferFloat || extensions.colorBufferFloatRGBA); // This logic is the same for both Renderbuffers and TextureAttachment.
return extensions.colorBufferFloatRGBA || // ES2
extensions.colorBufferFloat; // ES3
} }
InternalFormat::InternalFormat() InternalFormat::InternalFormat()
...@@ -790,7 +785,7 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap() ...@@ -790,7 +785,7 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap()
AddRGBAFormat(&map, GL_R32F, true, 32, 0, 0, 0, 0, GL_RED, GL_FLOAT, GL_FLOAT, false, SizedFloatRGSupport, RequireExt<&Extensions::textureFloatLinear>, RequireExt<&Extensions::colorBufferFloat>, RequireExt<&Extensions::colorBufferFloat>); AddRGBAFormat(&map, GL_R32F, true, 32, 0, 0, 0, 0, GL_RED, GL_FLOAT, GL_FLOAT, false, SizedFloatRGSupport, RequireExt<&Extensions::textureFloatLinear>, RequireExt<&Extensions::colorBufferFloat>, RequireExt<&Extensions::colorBufferFloat>);
AddRGBAFormat(&map, GL_RG32F, true, 32, 32, 0, 0, 0, GL_RG, GL_FLOAT, GL_FLOAT, false, SizedFloatRGSupport, RequireExt<&Extensions::textureFloatLinear>, RequireExt<&Extensions::colorBufferFloat>, RequireExt<&Extensions::colorBufferFloat>); AddRGBAFormat(&map, GL_RG32F, true, 32, 32, 0, 0, 0, GL_RG, GL_FLOAT, GL_FLOAT, false, SizedFloatRGSupport, RequireExt<&Extensions::textureFloatLinear>, RequireExt<&Extensions::colorBufferFloat>, RequireExt<&Extensions::colorBufferFloat>);
AddRGBAFormat(&map, GL_RGB32F, true, 32, 32, 32, 0, 0, GL_RGB, GL_FLOAT, GL_FLOAT, false, SizedFloatRGBSupport, RequireExt<&Extensions::textureFloatLinear>, RequireExt<&Extensions::colorBufferFloatRGB>, NeverSupported ); AddRGBAFormat(&map, GL_RGB32F, true, 32, 32, 32, 0, 0, GL_RGB, GL_FLOAT, GL_FLOAT, false, SizedFloatRGBSupport, RequireExt<&Extensions::textureFloatLinear>, RequireExt<&Extensions::colorBufferFloatRGB>, NeverSupported );
AddRGBAFormat(&map, GL_RGBA32F, true, 32, 32, 32, 32, 0, GL_RGBA, GL_FLOAT, GL_FLOAT, false, SizedFloatRGBASupport, RequireExt<&Extensions::textureFloatLinear>, SizedFloatRGBATextureAttachmentSupport, SizedFloatRGBARenderbufferSupport); AddRGBAFormat(&map, GL_RGBA32F, true, 32, 32, 32, 32, 0, GL_RGBA, GL_FLOAT, GL_FLOAT, false, SizedFloatRGBASupport, RequireExt<&Extensions::textureFloatLinear>, SizedFloatRGBARenderableSupport, SizedFloatRGBARenderableSupport );
// Depth stencil formats // Depth stencil formats
// | Internal format |sized| D |S | X | Format | Type | Component type | Texture supported | Filterable | Texture attachment | Renderbuffer | // | Internal format |sized| D |S | X | Format | Type | Component type | Texture supported | Filterable | Texture attachment | Renderbuffer |
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment