Changeset 280926 in webkit
- Timestamp:
- Aug 11, 2021, 1:04:36 PM (5 years ago)
- Location:
- trunk/Source/ThirdParty/ANGLE
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
src/libANGLE/renderer/metal/ContextMtl.h (modified) (1 diff)
-
src/libANGLE/renderer/metal/ContextMtl.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/ThirdParty/ANGLE/ChangeLog
r280904 r280926 1 2021-08-11 Kyle Piddington <kpiddington@apple.com> 2 3 Avoid infinite recursion when command buffer creation fails 4 https://bugs.webkit.org/show_bug.cgi?id=228978 5 <rdar://79224824> 6 7 Reviewed by Kenneth Russell. 8 9 In cases where the MTLCommandBuffer is not a valid metal object, 10 we can end up in an infinite recursive loop during draw call setup. Refactor setupDraw to take no more than two attempts through the setup function. 11 12 Testing: Ran WebGL tests, use case samples. Set up synthetic 13 repro forcing bail out path, saw WebGL content fail to render 14 instead of a web process crash. 15 16 * src/libANGLE/renderer/metal/ContextMtl.h: 17 * src/libANGLE/renderer/metal/ContextMtl.mm: 18 (rx::ContextMtl::setupDraw): 19 (rx::ContextMtl::setupDrawImpl): 20 1 21 2021-08-11 Kimmo Kinnunen <kkinnunen@apple.com> 2 22 -
trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/ContextMtl.h
r278335 r280926 382 382 const void *indices, 383 383 bool transformFeedbackDraw); 384 angle::Result setupDrawImpl(const gl::Context *context, 385 gl::PrimitiveMode mode, 386 GLint firstVertex, 387 GLsizei vertexOrIndexCount, 388 GLsizei instanceCount, 389 gl::DrawElementsType indexTypeOrNone, 390 const void *indices, 391 bool transformFeedbackDraw); 384 392 385 393 angle::Result drawTriFanArrays(const gl::Context *context, -
trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/ContextMtl.mm
r279251 r280926 2121 2121 bool transformFeedbackDraw) 2122 2122 { 2123 ANGLE_TRY(setupDrawImpl(context, mode, firstVertex, vertexOrIndexCount, instances, indexTypeOrNone, indices, transformFeedbackDraw)); 2124 // Setting up the draw required us to call a command buffer flush, re-run setupDraw with state invaliated to restart the command buffer from the current draw with previously set state 2125 if (!mCmdBuffer.valid()) 2126 { 2127 invalidateState(context); 2128 ANGLE_TRY(setupDrawImpl(context, mode, firstVertex, vertexOrIndexCount, instances, indexTypeOrNone, indices, transformFeedbackDraw)); 2129 } 2130 // If the command buffer still isn't valid after a second attempt, we have a problem and should stop the draw call to avoid infinite recursion. 2131 if(!mCmdBuffer.valid()) 2132 { 2133 return angle::Result::Stop; 2134 } 2135 return angle::Result::Continue; 2136 2137 } 2138 angle::Result ContextMtl::setupDrawImpl(const gl::Context *context, 2139 gl::PrimitiveMode mode, 2140 GLint firstVertex, 2141 GLsizei vertexOrIndexCount, 2142 GLsizei instances, 2143 gl::DrawElementsType indexTypeOrNone, 2144 const void *indices, 2145 bool transformFeedbackDraw) 2146 { 2123 2147 ASSERT(mProgram); 2124 2148 … … 2250 2274 uniformBuffersDirty, transformFeedbackDraw)); 2251 2275 2252 // Setting up the draw required us to call a command buffer flush, re-run setupDraw with state invaliated to restart the command buffer from the current draw with previously set state 2253 if (!mCmdBuffer.valid()) 2254 { 2255 invalidateState(context); 2256 ANGLE_TRY(setupDraw(context, mode, firstVertex, vertexOrIndexCount, instances, indexTypeOrNone, indices, transformFeedbackDraw)); 2257 } 2276 2258 2277 mDirtyBits.reset(); 2259 2278 return angle::Result::Continue;
Note:
See TracChangeset
for help on using the changeset viewer.