Skip to content

Commit

Permalink
Add draft text/wgsl media type registration. WGSL uses UTF-8
Browse files Browse the repository at this point in the history
  • Loading branch information
dneto0 committed Oct 20, 2022
1 parent 63a7a24 commit 48791e8
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 6 deletions.
7 changes: 1 addition & 6 deletions wgsl/index.bs
Expand Up @@ -437,12 +437,7 @@ The WebGPU specification describes the consequences of each kind of error.

# Textual Structure # {#textual-structure}

A WGSL program is text.
This specification does not prescribe a particular encoding for that text.
However, UTF-8 is always a valid encoding for a WGSL program.

Note: The intent of promoting UTF-8 like this is to simplify interchange of WGSL programs
and to encourage interoperability among tools.
A WGSL program is Unicode text using the UTF-8 encoding.

WGSL program text consists of a sequence of Unicode [=code points=], grouped into contiguous non-empty sets forming:
* [=comments=]
Expand Down
65 changes: 65 additions & 0 deletions wgsl/media-type-registration.txt
@@ -0,0 +1,65 @@
Type name: text

Subtype name: wgsl

Required parameters: N/A

Optional parameters: None

Encoding considerations: binary

WGSL is Unicode text using the UTF-8 encoding. See [WGSL] Section
3. Textual Structure.

Security considerations:

WebGPU Shading Language (WGSL) is a programming language for GPU
code to be executed in the context of the WebGPU API. For security
considerations, see [WebGPU] Section 2.1 Security Considerations.

Interoperability considerations:

Implementations of WebGPU may have different capabilities, and
these differences may affect what features may be exercised by
WGSL programs. See [WebGPU] Section 3.6 Optional capabilities,
and [WGSL] Section 11. Language Extensions.

It is expected that implementations will behave as if this
registration applies to later editions of [WGSL], and its published
specification references may be updated accordingly from time to
time. Although this expectation is unusual among media type
registrations, it matches widespread industry conventions.

Published specification: [WGSL]

Applications that use this media type:

Implementations of WebGPU [WebGPU]. This is expected to include
web browsers.

Fragment identifier considerations: None

Additional information:

Magic number(s): None
File extension(s): .wgsl
Macintosh file type code(s): TEXT

Person & email address to contact for further information:
David Neto, dneto@google.com, or the Editors listed in [WGSL].

Intended usage: COMMON

Author: W3C. See the Editors listed in [WGSL].

Change controller: W3C

Normative References:

[WebGPU] W3C, "WebGPU” W3C Working Draft, October 2022.
<https://www.w3.org/TR/webgpu/>.

[WGSL] W3C, “WebGPU Shading Language” W3C Working Draft, October
2022. <https://www.w3.org/TR/wgsl/>.


0 comments on commit 48791e8

Please sign in to comment.