GL: Ensure all instanced attributes have a buffer with data

Apple OpenGL drivers sometimes crash when given an instanced draw with
a buffer that has never been given data.

It's not efficient to check if the attribute is both zero-sized and
instanced so just ensure that every time a zero-sized buffer is bound
to an attribute, it gets initialized with some data.

Bug: chromium:1456243
Change-Id: I66b7c7017843153db2df3bc50010cba765d03c5f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4642048
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
This commit is contained in:
Geoff Lang
2023-06-23 14:46:28 -04:00
committed by Angle LUCI CQ
parent 5922b83bff
commit 4e6124dae8
10 changed files with 57 additions and 1 deletions

View File

@@ -675,6 +675,13 @@ struct FeaturesGL : FeatureSetBase
&members, "http://crbug.com/1420130"
};
FeatureInfo ensureNonEmptyBufferIsBoundForDraw = {
"ensureNonEmptyBufferIsBoundForDraw",
FeatureCategory::OpenGLFeatures,
"Apple OpenGL drivers crash when drawing with a zero-sized buffer bound using a non-zero divisor.",
&members, "http://crbug.com/1456243"
};
};
inline FeaturesGL::FeaturesGL() = default;

View File

@@ -731,6 +731,14 @@
"Rewrite vec/mat constructors to work around driver bugs"
],
"issue": "http://crbug.com/1420130"
},
{
"name": "ensure_non_empty_buffer_is_bound_for_draw",
"category": "Features",
"description": [
"Apple OpenGL drivers crash when drawing with a zero-sized buffer bound using a non-zero divisor."
],
"issue": "http://crbug.com/1456243"
}
]
}