[webkit-changes] [WebKit/WebKit] 381c92: [WGSL] Add typing for indexed access on vectors

Tadeu Zagallo noreply at github.com
Wed Apr 19 01:56:30 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 381c92243cdde79aaee748e8b8c57aac87877b56
      https://github.com/WebKit/WebKit/commit/381c92243cdde79aaee748e8b8c57aac87877b56
  Author: Tadeu Zagallo <tzagallo at apple.com>
  Date:   2023-04-19 (Wed, 19 Apr 2023)

  Changed paths:
    M Source/WebGPU/WGSL/TypeCheck.cpp
    A Source/WebGPU/WGSL/tests/invalid/vector.wgsl

  Log Message:
  -----------
  [WGSL] Add typing for indexed access on vectors
https://bugs.webkit.org/show_bug.cgi?id=255598
rdar://108197306

Reviewed by Myles C. Maxfield.

So far we only supported field access on vectors (e.g. vec2.x) but not indexed
access (e.g. vec2[0]). This extends the typing to add support for that. Just
like our current support for indexed access on arrays, we still don't validate
if the access is out-of-bounds when the index is a constant.

* Source/WebGPU/WGSL/TypeCheck.cpp:
(WGSL::TypeChecker::visit):
* Source/WebGPU/WGSL/tests/invalid/vector.wgsl: Added.

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




More information about the webkit-changes mailing list