From 261642e4e3355ce976e16790900755fc84419dc6 Mon Sep 17 00:00:00 2001 From: David Neto Date: Thu, 22 Apr 2021 12:54:43 +0000 Subject: [PATCH] Update spirv-reader readme Change-Id: I933cab554b3bbd278a23b892535cba4992649002 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/48760 Auto-Submit: David Neto Kokoro: Kokoro Reviewed-by: Alan Baker Commit-Queue: Alan Baker --- src/reader/spirv/README.md | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/reader/spirv/README.md b/src/reader/spirv/README.md index 9d132b04d7..e5f2f0dd90 100644 --- a/src/reader/spirv/README.md +++ b/src/reader/spirv/README.md @@ -13,27 +13,25 @@ It's usable from the Tint command line: # Translate SPIR-V into WGSL. tint --format wgsl a.spv -## Validation +## Supported dialects -The SPIR-V module must pass validation for the `SPV_ENV_WEBGPU_0` target -environment in SPIRV-Tools. +The SPIR-V module must pass validation for the Vulkan 1.1 environment in SPIRV-Tools. +In particular, SPIR-V 1.4 and later are not supported. -That set of rules is _experimental_ and was originally intended -to constraint SPIR-V modules being ingested directly by the WebGPU API. -Those rules are now too restrictive, because some amount of sanitization -and normalization occurs during translation from SPIR-V to WGSL. -The validation rules will be relaxed at some point TBD. +For example, the equivalent of the following must pass: -Generally, validation of _functionality_ used will remain, e.g. WebGPU currently -does not support `CullDistance` or subgroup operations. + spirv-val --target-env vulkan1.1 a.spv -However, detailed rules about the form of SPIR-V can be relaxed, e.g. the -requirement to use SPIR-V 1.3, and restrictive rules about statically unreachable -code. +Additionally, the reader imposes additional constraints based on: + +* The features supported by WGSL. Some Vulkan features might not be supportable because + WebGPU must be portable to other graphics APIs. +* Limitations of the reader itself. These might be relaxed in the future with extra + engineering work. ## Feedback -Please file issues at https://crbug.com/tint, and put `spirv-reader` in the issue title. +Please file issues at https://crbug.com/tint, and apply label `SpirvReader`. -Outstanding issues can be found by using the `spirv-reader` label in the Chromium project's -bug tracker: https://bugs.chromium.org/p/tint/issues/list?q=label:spirv-reader +Outstanding issues can be found by using the `SpirvReader` label in the Chromium project's +bug tracker: https://bugs.chromium.org/p/tint/issues/list?q=label:SpirvReader