Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 646adcab0cefd03d90d7c6a2a574cf09c8b13667
      
https://github.com/WebKit/WebKit/commit/646adcab0cefd03d90d7c6a2a574cf09c8b13667
  Author: Tadeu Zagallo <[email protected]>
  Date:   2024-11-11 (Mon, 11 Nov 2024)

  Changed paths:
    A LayoutTests/fast/webgpu/nocrash/fuzz-282710-expected.txt
    A LayoutTests/fast/webgpu/nocrash/fuzz-282710.html
    M Source/WebGPU/WGSL/GlobalVariableRewriter.cpp

  Log Message:
  -----------
  [WebGPU] explicit layouts should be validated for compatibility with the 
shader
https://bugs.webkit.org/show_bug.cgi?id=282710
rdar://138847403

Reviewed by Dan Glastonbury.

There is a bug in our validation code that checks the compatibility between the
variables used by the shader and the bind group provided via the API, and it 
happens
in two steps:
- first, we start by traversing the API-provided bind group we check if the 
shader
  contains a variable for that group/binding pair. Here we incorrectly check 
against
  all the variables in the shader, but we should only consider the variables 
that
  are actually used, since it's valid to have multiple variables with the same
  binding, so long as they are not used by the same entry point.
- the second part of the code is actually correct, where we only validate the 
used
  variables against the bind group. However, since we incorrectly selected an 
unused
  variable to be serialized in the previous step, that variable is never, 
allowing
  a type mismatch between the generated shader and the bind group.

* LayoutTests/fast/webgpu/nocrash/fuzz-282710-expected.txt: Added.
* LayoutTests/fast/webgpu/nocrash/fuzz-282710.html: Added.
* Source/WebGPU/WGSL/GlobalVariableRewriter.cpp:
(WGSL::RewriteGlobalVariables::insertStructs):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to