Commit 9ccb9b4102897282f5ed9df2fac5d83632921ced

Le Hoang Quyen 2024-05-03T22:23:03

Metal: fix incorrect tracking if blit & render encoder coexist Currently mtl::CommandBuffer tracks only one active command encoder. However this tracking is wrong if a blit/compute encoder is created without ending the current render encoder. Blit/compute and render encoders are allowed to coexist because the actual rendering encoding is deferred. The bug would happen for e.g. if: - There is an active render encoder. - ContextMtl::getBlitCommandEncoderWithoutEndingRenderEncoder() is called. - In this case, active encoder will be set to the blit encoder. - Later when blit encoder is ended, tracked active encoder would be set to null even though it should be the render encoder. This CL fixes the bug by tracking separate active blit/compute & render encoders. Bug: angleproject:7643 Bug: angleproject:8685 Change-Id: I9893402ecd4c0388aa0153acdb2be04315563086 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5514184 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Quyen Le <lehoangquyen@chromium.org>