Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
explainer: use data-no-idl to prevent IDL parsing
  • Loading branch information
kainino0x committed Apr 6, 2021
commit 70c65beb610f8046fff92a6c6945c0a69ee02890
25 changes: 6 additions & 19 deletions explainer/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,6 @@ Boilerplate: repository-issue-tracking no

Issue(tabatkins/bikeshed#2006): Set up cross-linking into the WebGPU and WGSL specs.

<!--
Invisible chunk of IDL to contain definitions to make the IDL compiler happy
on this incomplete spec.
-->
<div style="display:none">
<script type=idl>
typedef [EnforceRange] unsigned long long GPUSize64;
typedef unsigned long GPUFlagsConstant;

interface GPUBuffer {};
</script>
</div>

# Motivation # {#motivation}

See [Introduction](https://gpuweb.github.io/gpuweb/#introduction).
Expand Down Expand Up @@ -264,7 +251,7 @@ When an application requests to map a buffer, it initiates a transfer of the buf
At this time, the GPU may still need to finish executing some operations that use the buffer, so the transfer doesn't complete until all previously-enqueued GPU operations are finished.
That's why mapping a buffer is an asynchronous operation (we'll discuss the other arguments below):

<script type=idl>
<xmp class=idl data-no-idl>
typedef [EnforceRange] unsigned long GPUMapModeFlags;
interface GPUMapMode {
const GPUFlagsConstant READ = 0x0001;
Expand All @@ -276,7 +263,7 @@ partial interface GPUBuffer {
optional GPUSize64 offset = 0,
optional GPUSize64 size);
};
</script>
</xmp>

<div class=example>
Using it is done like so:
Expand All @@ -296,11 +283,11 @@ partial interface GPUBuffer {
Once the application has finished using the buffer on the CPU, it can transfer ownership back to the GPU by unmapping it.
This is an immediate operation that makes the application lose all access to the buffer on the CPU (i.e. detaches `ArrayBuffers`):

<script type=idl>
<xmp class=idl data-no-idl>
partial interface GPUBuffer {
undefined unmap();
};
</script>
</xmp>

<div class=example>
Using it is done like so:
Expand Down Expand Up @@ -353,12 +340,12 @@ This way the browser knows which parts of the underlying `GPUBuffer` have been "

The range must be within the range requested in `mapAsync()`.

<script type=idl>
<xmp class=idl data-no-idl>
partial interface GPUBuffer {
ArrayBuffer getMappedRange(optional GPUSize64 offset = 0,
optional GPUSize64 size);
};
</script>
</xmp>

<div class=example>
Using it is done like so:
Expand Down