Commit 5c1d21a1 by Ian Elliott Committed by Commit Bot

Vulkan: App-compat for apps that disable validation & don't link

As seen on Android, when PUBG MOBILE rebuilds all of its shaders, it: - Disables validation - Tries to link two shaders that can't be linked - Calls glUseProgram() for the un-linked program - Never uses the program Because validation was disabled, the appropriate error isn't produced and ANGLE ASSERT's in the post-validation code. For application-compatibility, this case is recognized and avoided. Bug: b/168839960 Change-Id: I521785c741d57d6c228bb60c81abe638d95e8d2d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2505547 Commit-Queue: Ian Elliott <ianelliott@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 8442ea94
...@@ -1763,6 +1763,14 @@ void State::setVertexBindingDivisor(GLuint bindingIndex, GLuint divisor) ...@@ -1763,6 +1763,14 @@ void State::setVertexBindingDivisor(GLuint bindingIndex, GLuint divisor)
angle::Result State::setProgram(const Context *context, Program *newProgram) angle::Result State::setProgram(const Context *context, Program *newProgram)
{ {
if (newProgram && !newProgram->isLinked())
{
// Protect against applications that disable validation and try to use a program that was
// not successfully linked.
WARN() << "Attempted to use a program that was not successfully linked";
return angle::Result::Continue;
}
if (mProgram != newProgram) if (mProgram != newProgram)
{ {
if (mProgram) if (mProgram)
......
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