Commit d8e821aa by Geoff Lang Committed by Commit Bot

Expand the TextureGL::releaseTexImage size reset workaround to Win AMD.

Windows 10 AMD drivers have also had issues with generating errors when calling glTexImage2D with zero size after unbinding a surface. BUG=angleproject:3859 Change-Id: Iae3e31418b6c89056d0d4aab954519598d8f25f9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1775111Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent d3b31037
...@@ -347,10 +347,10 @@ struct FeaturesGL : FeatureSetBase ...@@ -347,10 +347,10 @@ struct FeaturesGL : FeatureSetBase
"Mac has issues with blitFramebuffer when the parameters don't match the framebuffer size.", "Mac has issues with blitFramebuffer when the parameters don't match the framebuffer size.",
&members, "http://crbug.com/830046"}; &members, "http://crbug.com/830046"};
// Calling glTexImage2D with zero size on a rectangle texture generates GL errors // Calling glTexImage2D with zero size generates GL errors
Feature resettingRectangleTexturesGeneratesErrors = { Feature resettingTexturesGeneratesErrors = {
"reset_rectangle_texture_generates_errors", FeatureCategory::OpenGLWorkarounds, "reset_texture_generates_errors", FeatureCategory::OpenGLWorkarounds,
"Calling glTexImage2D with zero size on a rectangle texture generates errors.", &members, "Calling glTexImage2D with zero size generates errors.", &members,
"http://anglebug.com/3859"}; "http://anglebug.com/3859"};
}; };
......
...@@ -1244,8 +1244,7 @@ angle::Result TextureGL::releaseTexImage(const gl::Context *context) ...@@ -1244,8 +1244,7 @@ angle::Result TextureGL::releaseTexImage(const gl::Context *context)
ASSERT(getType() == gl::TextureType::_2D || getType() == gl::TextureType::Rectangle); ASSERT(getType() == gl::TextureType::_2D || getType() == gl::TextureType::Rectangle);
const angle::FeaturesGL &features = GetFeaturesGL(context); const angle::FeaturesGL &features = GetFeaturesGL(context);
if (getType() != gl::TextureType::Rectangle && if (!features.resettingTexturesGeneratesErrors.enabled)
!features.resettingRectangleTexturesGeneratesErrors.enabled)
{ {
// Not all Surface implementations reset the size of mip 0 when releasing, do it manually // Not all Surface implementations reset the size of mip 0 when releasing, do it manually
const FunctionsGL *functions = GetFunctionsGL(context); const FunctionsGL *functions = GetFunctionsGL(context);
......
...@@ -1554,7 +1554,8 @@ void InitializeFeatures(const FunctionsGL *functions, angle::FeaturesGL *feature ...@@ -1554,7 +1554,8 @@ void InitializeFeatures(const FunctionsGL *functions, angle::FeaturesGL *feature
features->clipSrcRegionBlitFramebuffer.enabled = IsApple(); features->clipSrcRegionBlitFramebuffer.enabled = IsApple();
features->resettingRectangleTexturesGeneratesErrors.enabled = IsApple(); features->resettingTexturesGeneratesErrors.enabled =
IsApple() || (IsWindows() && IsAMD(device));
} }
void InitializeFrontendFeatures(const FunctionsGL *functions, angle::FrontendFeatures *features) void InitializeFrontendFeatures(const FunctionsGL *functions, angle::FrontendFeatures *features)
......
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