[WGSL] Add mechanism to validate override values#34501
Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom Oct 2, 2024
Merged
Conversation
Collaborator
|
EWS run on previous version of this PR (hash 03b79cb) Details |
03b79cb to
b1ce966
Compare
Collaborator
|
EWS run on current version of this PR (hash b1ce966) Details |
mwyrzykowski
approved these changes
Oct 1, 2024
https://bugs.webkit.org/show_bug.cgi?id=280676 rdar://136876110 Reviewed by Mike Wyrzykowski. At compile time we validate constant values according to the spec, as an example in this patch we cover that array sizes must be bigger than 0. However, when the value can only be computed after overrides have been provided, we need a way to validate the these values at a later stage. This patch introduces the mechanism that will be used for such validations, by storing the necessary validations in the shader module, and then executing each validation every time the module is used in a pipeline. * Source/WebGPU/WGSL/CompilationMessage.h: (WGSL::CompilationMessage::CompilationMessage): * Source/WebGPU/WGSL/TypeCheck.cpp: (WGSL::TypeChecker::visit): * Source/WebGPU/WGSL/WGSL.cpp: (WGSL::generate): * Source/WebGPU/WGSL/WGSL.h: * Source/WebGPU/WGSL/WGSLShaderModule.cpp: Added. (WGSL::ShaderModule::validateOverrides): * Source/WebGPU/WGSL/WGSLShaderModule.h: (WGSL::ShaderModule::addOverrideValidation): * Source/WebGPU/WGSL/tests/invalid/override.wgsl: Added. * Source/WebGPU/WGSL/wgslc.cpp: (runWGSL): * Source/WebGPU/WebGPU.xcodeproj/project.pbxproj: * Source/WebGPU/WebGPU/Pipeline.mm: (WebGPU::createLibrary): * Source/WebGPU/WebGPU/ShaderModule.mm: (WebGPU::earlyCompileShaderModule): Canonical link: https://commits.webkit.org/284570@main
b1ce966 to
a9fce28
Compare
Collaborator
|
Committed 284570@main (a9fce28): https://commits.webkit.org/284570@main Reviewed commits have been landed. Closing PR #34501 and removing active labels. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
a9fce28
b1ce966