WebGL: Validate simple rendering feedback loops.
This adds the most basic form of rendering feedback loop detection:
when we're rendering to a texture that's also bound as an input. It
doesn't filter by selected mipmap level or 3D texture slice, or
do depth attachment validation. It also is missing checks for feedback
loops against the default Framebuffer.
BUG=angleproject:1685
Change-Id: Idb0ee2bfe1c35611544d132204c0da832c0f1c48
Reviewed-on: https://chromium-review.googlesource.com/425489
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/libANGLE/validationES.cpp b/src/libANGLE/validationES.cpp
index 14d1036..f07b216 100644
--- a/src/libANGLE/validationES.cpp
+++ b/src/libANGLE/validationES.cpp
@@ -3221,6 +3221,18 @@
}
}
+ // Detect rendering feedback loops for WebGL.
+ if (context->getExtensions().webglCompatibility)
+ {
+ if (framebuffer->formsRenderingFeedbackLoopWith(state))
+ {
+ context->handleError(
+ Error(GL_INVALID_OPERATION,
+ "Rendering feedback loop formed between Framebuffer and active Texture."));
+ return false;
+ }
+ }
+
// No-op if zero count
return (count > 0);
}