WebGL Aquarium doesn't render with ANGLE Metal

Blits should not be using the context's write mask,
this leads to missed color information on blits.

Bug: chromium:1257769
Change-Id: Iaf4ff00a727b1bec2424b4d3939fddd4c802a8ea
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3212644
Reviewed-by: Alexey Knyazev <lexa.knyazev@gmail.com>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Kyle Piddington <kpiddington@apple.com>
This commit is contained in:
Kyle Piddington 2021-10-07 15:02:35 -07:00 коммит произвёл Angle LUCI CQ
Родитель 4ca3d7d643
Коммит fab8834323
3 изменённых файлов: 5 добавлений и 8 удалений

Просмотреть файл

@ -472,10 +472,9 @@ angle::Result FramebufferMtl::blitWithDraw(const gl::Context *context,
colorBlitParams.srcLevel = srcColorRt->getLevelIndex();
colorBlitParams.srcLayer = srcColorRt->getLayerIndex();
colorBlitParams.blitWriteMaskArray = contextMtl->getWriteMaskArray();
colorBlitParams.enabledBuffers = getState().getEnabledDrawBuffers();
colorBlitParams.filter = filter;
colorBlitParams.dstLuminance = srcColorRt->getFormat()->actualAngleFormat().isLUMA();
colorBlitParams.enabledBuffers = getState().getEnabledDrawBuffers();
colorBlitParams.filter = filter;
colorBlitParams.dstLuminance = srcColorRt->getFormat()->actualAngleFormat().isLUMA();
ANGLE_TRY(contextMtl->getDisplay()->getUtils().blitColorWithDraw(
context, renderEncoder, srcColorRt->getFormat()->actualAngleFormat(), colorBlitParams));

Просмотреть файл

@ -80,9 +80,8 @@ struct BlitParams
struct ColorBlitParams : public BlitParams
{
ColorBlitParams() { blitWriteMaskArray.fill(MTLColorWriteMaskAll); }
ColorBlitParams() {}
WriteMaskArray blitWriteMaskArray;
gl::DrawBufferMask enabledBuffers;
GLenum filter = GL_NEAREST;
bool unpackPremultiplyAlpha = false;

Просмотреть файл

@ -1487,8 +1487,7 @@ id<MTLRenderPipelineState> ColorBlitUtils::getColorBlitRenderPipelineState(
RenderPipelineDesc pipelineDesc;
const RenderPassDesc &renderPassDesc = cmdEncoder->renderPassDesc();
renderPassDesc.populateRenderPipelineOutputDesc(params.blitWriteMaskArray,
&pipelineDesc.outputDescriptor);
renderPassDesc.populateRenderPipelineOutputDesc(&pipelineDesc.outputDescriptor);
// Disable blit for some outputs that are not enabled
pipelineDesc.outputDescriptor.updateEnabledDrawBuffers(params.enabledBuffers);