ANGLE: Metal: TransformFeedbackTest.RenderOnceChangeXfbBufferRenderAgain fails validation#63322
Conversation
|
EWS run on previous version of this PR (hash ef7b4a3) Details
|
ef7b4a3 to
78eafe7
Compare
|
EWS run on previous version of this PR (hash 78eafe7) Details
|
| @@ -107,6 +108,7 @@ class TransformFeedback final : public RefCountObject<TransformFeedbackID>, publ | |||
| // Returns true if the buffer is bound to any of the indexed binding points in this transform | |||
| // feedback. | |||
| bool isBufferBound(BufferID bufferID) const; | |||
| void invalidateVertexCapacity() { mState.mVertexCapacity = 0; } | |||
There was a problem hiding this comment.
Nit: mVertexCapacity = 0 is doing double duty as both "needs recompute" and "legitimately zero capacity" (e.g. null program executable). When capacity is genuinely zero, checkBufferSpaceForDraw will re-enter recomputeVertexCapacity on every draw. Not a correctness issue since the result is the same, but a dedicated bool mVertexCapacityDirty or a negative sentinel like -1 would make the intent unambiguous and avoid the redundant recompute.
There was a problem hiding this comment.
Yeah, you're of course right. The idea was that recomputation doesn't matter, as drawing with 0 capacity is never sensical.
I don't want to use -1, as there have been enough issues with such a value being mistakenly used.
I wrapped it in std::optional.
I also moved the code from the free method to the compute function, as the method wasn't used anywhere else and the calling function was not doing any other significant work.
I also enabled the unit tests and removed a workaround from the code that addressed a unitest thing that is not an issue anymore.
I'll land with these changes and let you review post-landing. I can adjust if there's something incorrect.
78eafe7 to
7dfa05d
Compare
|
EWS run on previous version of this PR (hash 7dfa05d) Details
|
7dfa05d to
9f169d3
Compare
|
EWS run on previous version of this PR (hash 9f169d3) Details
|
9f169d3 to
10dd337
Compare
|
EWS run on previous version of this PR (hash 10dd337) Details
|
10dd337 to
91ac6e8
Compare
|
EWS run on current version of this PR (hash 91ac6e8) Details
|
…ain fails validation https://bugs.webkit.org/show_bug.cgi?id=312988 rdar://175334405 Reviewed by Dan Glastonbury. TransformFeedbackTest.RenderOnceChangeXfbBufferRenderAgain would draw the second draw with too small transform feedback buffer. This should generate INVALID_OPERATION, but didn't. Implement the feature by invalidating the vertex capacity of the transform feedback buffer when the buffer is updated. Recalculate the capacity upon the draw call validation check. WebGL does not use this feature, as updating the buffer is disallowed by WebGL specification. However, the validation failure would make running the ANGLEEnd2EndTests inconventient on Metal, as the tests stop when the process crashes. Enable TransformFeedback_unittest in WebKit build. * Source/ThirdParty/ANGLE/ANGLE.xcodeproj/project.pbxproj: * Source/ThirdParty/ANGLE/src/libANGLE/Buffer.cpp: (gl::Buffer::onStateChange): (gl::Buffer::onContentsChange): * Source/ThirdParty/ANGLE/src/libANGLE/Context.cpp: (gl::Context::invalidateTransformFeedbackCapacities const): * Source/ThirdParty/ANGLE/src/libANGLE/Context.h: * Source/ThirdParty/ANGLE/src/libANGLE/TransformFeedback.cpp: (gl::TransformFeedbackState::TransformFeedbackState): (gl::TransformFeedback::begin): (gl::TransformFeedback::end): (gl::TransformFeedback::resume): (gl::TransformFeedback::checkBufferSpaceForDraw): (gl::TransformFeedback::checkBufferSpaceForDraw const): Deleted. (gl::TransformFeedback::recomputeVertexCapacity): Deleted. * Source/ThirdParty/ANGLE/src/libANGLE/TransformFeedback.h: * Source/ThirdParty/ANGLE/src/libANGLE/validationES.cpp: (gl::ValidateDrawArraysTransformFeedbackBufferSize): * Source/ThirdParty/ANGLE/src/tests/gl_tests/TransformFeedbackTest.cpp: * Source/ThirdParty/ANGLE/src/tests/gl_tests/VertexAttributeTest.cpp: Canonical link: https://commits.webkit.org/311839@main
91ac6e8 to
7e67d72
Compare
|
Committed 311839@main (7e67d72): https://commits.webkit.org/311839@main Reviewed commits have been landed. Closing PR #63322 and removing active labels. |
🛠 win
7e67d72
91ac6e8
🧪 api-mac🧪 ios-wk2-wpt🧪 api-mac-debug🧪 api-ios🧪 mac-AS-debug-wk2🧪 mac-intel-wk2