Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 746d4c43e40a9cc16381da0caf3d4b3f44712215
      
https://github.com/WebKit/WebKit/commit/746d4c43e40a9cc16381da0caf3d4b3f44712215
  Author: Roberto Rodriguez <[email protected]>
  Date:   2026-07-29 (Wed, 29 Jul 2026)

  Changed paths:
    M 
Source/ThirdParty/ANGLE/src/compiler/translator/tree_ops/msl/RewriteInterpolants.cpp
    M 
Source/ThirdParty/ANGLE/src/compiler/translator/tree_ops/spirv/RewriteInterpolateAtOffset.cpp
    M 
Source/ThirdParty/ANGLE/src/tests/gl_tests/ShaderMultisampleInterpolation.cpp

  Log Message:
  -----------
  [ANGLE] Correctly rewrite nested interpolateAtOffset offsets
https://bugs.webkit.org/show_bug.cgi?id=320515
rdar://180731415

Reviewed by Dan Glastonbury.

Compiling a fragment shader that nests one interpolateAtOffset inside another
call's offset argument crashes in the Metal backend. The offset rewrite wraps
each offset in a helper that adjusts it for Metal and passes the original offset
into that helper as a child. It incorrectly queues the replacement with
OriginalNode::IS_DROPPED, telling the tree updater the original is gone. For
nested calls the inner call is both a replaced node and the parent of its own
replacement, so the updater points the inner replacement at the wrapper, cannot
find the offset there, and fails an assertion.

Fix by queuing the replacement with OriginalNode::BECOMES_CHILD, which matches
what actually happens since the offset is reused inside the wrapper. The updater
then leaves the inner call's parent alone and both offsets are rewritten
correctly.

Vulkan (SPIR-V) backend has same bug in its own interpolateAtOffset offset 
rewrite
so fix here too to keep it intact when the change is upstreamed.

* 
Source/ThirdParty/ANGLE/src/compiler/translator/tree_ops/msl/RewriteInterpolants.cpp:
* Source/ThirdParty/ANGLE/src/tests/gl_tests/ShaderMultisampleInterpolation.cpp:
* 
Source/ThirdParty/ANGLE/src/compiler/translator/tree_ops/spirv/RewriteInterpolateAtOffset.cpp:

Canonical link: https://commits.webkit.org/318205@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to