Add documentation for chromium_experimental_framebuffer_fetch
Bug: tint:2085
Change-Id: I4408983e1b68f56b809f6b340f125edb483959f2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/160583
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
diff --git a/docs/tint/extensions/chromium_experimental_framebuffer_fetch.md b/docs/tint/extensions/chromium_experimental_framebuffer_fetch.md
new file mode 100644
index 0000000..0715cb6
--- /dev/null
+++ b/docs/tint/extensions/chromium_experimental_framebuffer_fetch.md
@@ -0,0 +1,29 @@
+# Chromium Experimental Framebuffer Fetch
+
+The `chromium_experimental_framebuffer_fetch` extension adds support for framebuffer inputs to fragment stages in WGSL.
+Framebuffer input, or framebuffer fetch, lets a fragment shader read the value of framebuffer attachments for the current fragment.
+It synchronizes the read with all previous writes to the same fragment (in API order).
+
+## Status
+
+Framebuffer Fetch support in Tint is experimental and might change as we gain implementation experience.
+It will also be updated to follow an upstream specification if one is made at some point.
+Specification work in the WebGPU group hasn't started.
+
+## Pseudo-specification
+
+This adds a new builtin attribute `@color` which takes a `u32` argument and is only allowed on `@fragment` entry point scalar / vector inputs.
+Two input variables cannot have the same `@color` attribute.
+
+## Example usage
+
+```
+@fragment fn main(@color(0) vec4f previousColor) -> @location(0) vec4f {
+ let color = computeThisFragmentColor();
+ return myBlend(previousColor, color);
+}
+```
+
+## To-dos
+
+Are f16 types allowed for the `@color` inputs?
diff --git a/docs/tint/extensions/chromium_experimental_push_constant.md b/docs/tint/extensions/chromium_experimental_push_constant.md
index 6f23c1a..93b04e7 100644
--- a/docs/tint/extensions/chromium_experimental_push_constant.md
+++ b/docs/tint/extensions/chromium_experimental_push_constant.md
@@ -22,7 +22,7 @@
```
var<push_constant> draw_id : u32;
-@fragment fn main() -> u32 {
+@fragment fn main() -> @location(0) u32 {
return draw_id;
}
```