Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: cherry-pick d24570fb65 from angle (#34037)
* chore: cherry-pick d24570fb65 from angle * chore: update patches Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
- Loading branch information
1 parent
ce7c83e
commit 6a952c4
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
patches/angle/m100_fix_crash_when_pausing_xfb_then_deleting_a_buffer.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Jamie Madill <jmadill@chromium.org> | ||
Date: Mon, 14 Mar 2022 10:37:31 -0400 | ||
Subject: Fix crash when pausing XFB then deleting a buffer. | ||
|
||
Fix is to validate XFB buffer bindings even if we're paused. | ||
This is undefined behaviour so we can use any non-crashing solution. | ||
|
||
Bug: chromium:1305190 | ||
Change-Id: Ib95404cdb13adbde7f34d6cc77473a8b3cbf1de7 | ||
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3522283 | ||
Reviewed-by: Geoff Lang <geofflang@chromium.org> | ||
Commit-Queue: Jamie Madill <jmadill@chromium.org> | ||
(cherry picked from commit 708ce9cfd63bc8eab7c48987612a2dedce78c69a) | ||
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3594105 | ||
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> | ||
|
||
diff --git a/src/libANGLE/validationES.cpp b/src/libANGLE/validationES.cpp | ||
index d5732741dff989b8b8f6f669511bf7bc001c4eaa..eb571bb2de3c4568810026e0364bf069bd8ca681 100644 | ||
--- a/src/libANGLE/validationES.cpp | ||
+++ b/src/libANGLE/validationES.cpp | ||
@@ -3949,7 +3949,7 @@ const char *ValidateDrawStates(const Context *context) | ||
} | ||
} | ||
|
||
- if (state.isTransformFeedbackActiveUnpaused()) | ||
+ if (state.isTransformFeedbackActive()) | ||
{ | ||
if (!ValidateProgramExecutableXFBBuffersPresent(context, executable)) | ||
{ | ||
diff --git a/src/tests/gl_tests/TransformFeedbackTest.cpp b/src/tests/gl_tests/TransformFeedbackTest.cpp | ||
index 63dd230829716b7a95b7917b47fb1fc278c1098a..e6ed494e89c0a0c48af4789be91d240df769281f 100644 | ||
--- a/src/tests/gl_tests/TransformFeedbackTest.cpp | ||
+++ b/src/tests/gl_tests/TransformFeedbackTest.cpp | ||
@@ -3660,6 +3660,25 @@ void main() { | ||
EXPECT_GL_ERROR(GL_INVALID_OPERATION); | ||
} | ||
|
||
+// Same as the above, with a paused transform feedback. | ||
+TEST_P(TransformFeedbackTest, DeletePausedTransformFeedbackBuffer) | ||
+{ | ||
+ ANGLE_GL_PROGRAM_TRANSFORM_FEEDBACK(testProgram, essl1_shaders::vs::Simple(), | ||
+ essl1_shaders::fs::Green(), {"gl_Position"}, | ||
+ GL_INTERLEAVED_ATTRIBS); | ||
+ glUseProgram(testProgram); | ||
+ | ||
+ GLBuffer buffer; | ||
+ glBindBuffer(GL_PIXEL_UNPACK_BUFFER, buffer); | ||
+ glBufferData(GL_PIXEL_UNPACK_BUFFER, 3, nullptr, GL_STATIC_DRAW); | ||
+ glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, buffer); | ||
+ | ||
+ glBeginTransformFeedback(GL_POINTS); | ||
+ glPauseTransformFeedback(); | ||
+ buffer.reset(); | ||
+ glDrawArrays(GL_POINTS, 0, 1); | ||
+} | ||
+ | ||
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(TransformFeedbackTest); | ||
ANGLE_INSTANTIATE_TEST_ES3(TransformFeedbackTest); | ||
|