Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2267d02509a726e02caa8d13b7b5cbbf6fb8efbd
      
https://github.com/WebKit/WebKit/commit/2267d02509a726e02caa8d13b7b5cbbf6fb8efbd
  Author: Kimmo Kinnunen <[email protected]>
  Date:   2026-05-04 (Mon, 04 May 2026)

  Changed paths:
    M Source/ThirdParty/ANGLE/src/libANGLE/validationES.h
    M 
Source/ThirdParty/ANGLE/src/tests/gl_tests/DrawBaseVertexBaseInstanceTest.cpp
    M Source/ThirdParty/ANGLE/src/tests/gl_tests/WebGLCompatibilityTest.cpp

  Log Message:
  -----------
  ANGLE: WebGL2CompatibilityTest.DrawWithInstancedAndNonInstancedAttributes 
fails validation
https://bugs.webkit.org/show_bug.cgi?id=313229
rdar://175507506

Reviewed by Dan Glastonbury.

The validation and the tests were written based on incorrect instance
element index formula.

The OpenGL instanced draw attribute element computation is:
    element_index = floor(instance / attrib.divisor) + baseinstance

The instance runs from 0..primcount-1.

Max element_index is produced by max instance,
which is primcount - 1.

The validation and the tests were written based on the formula:
 const GLint64 limit = context->getInstancedVertexElementLimit();
 if (baseinstance >= limit || primcount > limit - baseinstance)

This was equivalent of:
    element_index = floor((primcount - 1 + baseinstance) / attrib.divisor)

Fix by using the cached instanced max element index value only if
baseinstance is 0. Otherwise, check each attribute individually.

* Source/ThirdParty/ANGLE/src/libANGLE/validationES.h:
(gl::ValidateDrawInstancedAttribs):
* Source/ThirdParty/ANGLE/src/tests/gl_tests/DrawBaseVertexBaseInstanceTest.cpp:
* Source/ThirdParty/ANGLE/src/tests/gl_tests/WebGLCompatibilityTest.cpp:

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



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

Reply via email to