Skip to content

Commit

Permalink
fix: various typos (mdn#25942)
Browse files Browse the repository at this point in the history
  • Loading branch information
nschonni authored Apr 6, 2023
1 parent c2985cb commit ee9993f
Show file tree
Hide file tree
Showing 28 changed files with 61 additions and 62 deletions.
11 changes: 5 additions & 6 deletions files/en-us/web/api/gpuadapter/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ A `GPUAdapter` object is requested using the {{domxref("GPU.requestAdapter()")}}

## Instance properties

- {{domxref("GPUAdapter.features", "features")}} {{Experimental_Inline}} {{readonlyinline}}
- {{domxref("GPUAdapter.features", "features")}} {{Experimental_Inline}} {{ReadOnlyInline}}
- : A {{domxref("GPUSupportedFeatures")}} object that describes additional functionality supported by the adapter.
- {{domxref("GPUAdapter.isFallbackAdapter", "isFallbackAdapter")}} {{Experimental_Inline}} {{readonlyinline}}
- {{domxref("GPUAdapter.isFallbackAdapter", "isFallbackAdapter")}} {{Experimental_Inline}} {{ReadOnlyInline}}
- : A boolean value. Returns `true` if the adapter is a [fallback adapter](/en-US/docs/Web/API/GPU/requestAdapter#fallback_adapters), and `false` if not.
- {{domxref("GPUAdapter.limits", "limits")}} {{Experimental_Inline}} {{readonlyinline}}
- {{domxref("GPUAdapter.limits", "limits")}} {{Experimental_Inline}} {{ReadOnlyInline}}
- : A {{domxref("GPUSupportedLimits")}} object that describes the limits supported by the adapter.

## Instance methods
Expand All @@ -36,18 +36,17 @@ A `GPUAdapter` object is requested using the {{domxref("GPU.requestAdapter()")}}
```js
async function init() {
if (!navigator.gpu) {
throw Error('WebGPU not supported.');
throw Error("WebGPU not supported.");
}

const adapter = await navigator.gpu.requestAdapter();
if (!adapter) {
throw Error('Couldn\'t request WebGPU adapter.');
throw Error("Couldn't request WebGPU adapter.");
}

const device = await adapter.requestDevice();

//...

}
```

Expand Down
8 changes: 4 additions & 4 deletions files/en-us/web/api/gpuadapterinfo/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ A `GPUAdapterInfo` object instance is requested using the {{domxref("GPUAdapter.

## Instance properties

- {{domxref("GPUAdapterInfo.architecture", "architecture")}} {{Experimental_Inline}} {{readonlyinline}}
- {{domxref("GPUAdapterInfo.architecture", "architecture")}} {{Experimental_Inline}} {{ReadOnlyInline}}
- : The name of the family or class of GPUs the adapter belongs to. Returns an empty string if it is not available.
- {{domxref("GPUAdapterInfo.description", "description")}} {{Experimental_Inline}} {{readonlyinline}}
- {{domxref("GPUAdapterInfo.description", "description")}} {{Experimental_Inline}} {{ReadOnlyInline}}
- : A human-readable string describing the adapter. Returns an empty string if it is not available.
- {{domxref("GPUAdapterInfo.device", "device")}} {{Experimental_Inline}} {{readonlyinline}}
- {{domxref("GPUAdapterInfo.device", "device")}} {{Experimental_Inline}} {{ReadOnlyInline}}
- : A vendor-specific identifier for the adapter. Returns an empty string if it is not available.
- {{domxref("GPUAdapterInfo.vendor", "vendor")}} {{Experimental_Inline}} {{readonlyinline}}
- {{domxref("GPUAdapterInfo.vendor", "vendor")}} {{Experimental_Inline}} {{ReadOnlyInline}}
- : The name of the adapter vendor. Returns an empty string if it is not available.

## Examples
Expand Down
6 changes: 3 additions & 3 deletions files/en-us/web/api/gpubuffer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ A `GPUBuffer` object instance is created using the {{domxref("GPUDevice.createBu
- {{domxref("GPUBuffer.label", "label")}} {{Experimental_Inline}}
- : A string providing a label that can be used to identify the object, for example in
{{domxref("GPUError")}} messages or console warnings.
- {{domxref("GPUBuffer.mapState", "mapState")}} {{Experimental_Inline}} {{readonlyinline}}
- {{domxref("GPUBuffer.mapState", "mapState")}} {{Experimental_Inline}} {{ReadOnlyInline}}
- : An enumerated value representing the mapped state of the `GPUBuffer`.
- {{domxref("GPUBuffer.size", "size")}} {{Experimental_Inline}} {{readonlyinline}}
- {{domxref("GPUBuffer.size", "size")}} {{Experimental_Inline}} {{ReadOnlyInline}}
- : A number representing the length of the `GPUBuffer`'s memory allocation, in bytes.
- {{domxref("GPUBuffer.usage", "usage")}} {{Experimental_Inline}} {{readonlyinline}}
- {{domxref("GPUBuffer.usage", "usage")}} {{Experimental_Inline}} {{ReadOnlyInline}}
- : The {{glossary("bitwise flags")}} representing the allowed usages of the `GPUBuffer`.

## Instance methods
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/gpucanvascontext/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The **`GPUCanvasContext`** interface of the {{domxref("WebGPU API", "WebGPU API"

## Instance properties

- {{domxref("GPUCanvasContext.canvas", "canvas")}} {{Experimental_Inline}} {{readonlyinline}}
- {{domxref("GPUCanvasContext.canvas", "canvas")}} {{Experimental_Inline}} {{ReadOnlyInline}}
- : Returns a reference to the canvas that the context was created from.

## Instance methods
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/gpucompilationinfo/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The **`GPUCompilationInfo`** interface of the {{domxref("WebGPU API", "WebGPU AP

## Instance properties

- {{domxref("GPUCompilationInfo.messages", "messages")}} {{Experimental_Inline}} {{readonlyinline}}
- {{domxref("GPUCompilationInfo.messages", "messages")}} {{Experimental_Inline}} {{ReadOnlyInline}}
- : An array of {{domxref("GPUCompilationMessage")}} objects, each one containing the details of an individual shader compilation message. Messages can be informational, warnings, or errors.

## Examples
Expand Down
12 changes: 6 additions & 6 deletions files/en-us/web/api/gpucompilationmessage/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ An array of `GPUCompilationMessage` objects is available in the `messages` prope

## Instance properties

- {{domxref("GPUCompilationMessage.length", "length")}} {{Experimental_Inline}} {{readonlyinline}}
- {{domxref("GPUCompilationMessage.length", "length")}} {{Experimental_Inline}} {{ReadOnlyInline}}
- : A number representing the length of the substring that the message corresponds to.
- {{domxref("GPUCompilationMessage.lineNum", "lineNum")}} {{Experimental_Inline}} {{readonlyinline}}
- {{domxref("GPUCompilationMessage.lineNum", "lineNum")}} {{Experimental_Inline}} {{ReadOnlyInline}}
- : A number representing the line number in the shader code that the message corresponds to.
- {{domxref("GPUCompilationMessage.linePos", "linePos")}} {{Experimental_Inline}} {{readonlyinline}}
- {{domxref("GPUCompilationMessage.linePos", "linePos")}} {{Experimental_Inline}} {{ReadOnlyInline}}
- : A number representing the position in the code line that the message corresponds to. This could be an exact point, or the start of the relevant substring.
- {{domxref("GPUCompilationMessage.message", "message")}} {{Experimental_Inline}} {{readonlyinline}}
- {{domxref("GPUCompilationMessage.message", "message")}} {{Experimental_Inline}} {{ReadOnlyInline}}
- : A string representing human-readable message text.
- {{domxref("GPUCompilationMessage.offset", "offset")}} {{Experimental_Inline}} {{readonlyinline}}
- {{domxref("GPUCompilationMessage.offset", "offset")}} {{Experimental_Inline}} {{ReadOnlyInline}}
- : A number representing the offset from the start of the shader code to the exact point, or the start of the relevant substring, that the message corresponds to.
- {{domxref("GPUCompilationMessage.type", "type")}} {{Experimental_Inline}} {{readonlyinline}}
- {{domxref("GPUCompilationMessage.type", "type")}} {{Experimental_Inline}} {{ReadOnlyInline}}
- : An enumerated value representing the type of the message — `"error"`, `"info"`, or `"warning"`.

## Examples
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ None ({{jsxref("Undefined")}}).

## Examples

In our [basic compute demo](https://mdn.github.io/dom-examples/webgpu-compute-demo/), several commands are recorded via a {{domxref("GPUCommandEncoder")}}. Most of these commands originate from the {{domxref("GPUComputePassEncoder")}} created via `beginComputePass()`. The `setPipeeline()` call is used as appropriate to set the pipeline to use for this pass.
In our [basic compute demo](https://mdn.github.io/dom-examples/webgpu-compute-demo/), several commands are recorded via a {{domxref("GPUCommandEncoder")}}. Most of these commands originate from the {{domxref("GPUComputePassEncoder")}} created via `beginComputePass()`. The `setPipeline()` call is used as appropriate to set the pipeline to use for this pass.

```js
const BUFFER_SIZE = 1000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ createComputePipeline(descriptor)

- `constants` {{optional_inline}}

- : A sequence of record types, with the structure `(id, value)`, representing override values for [WGSL constants that can be overriden in the pipeline](https://gpuweb.github.io/gpuweb/#typedefdef-gpupipelineconstantvalue). These behave like [ordered maps](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map). In each case, the `id` is a key used to identify or select the record, and the `constant` is an enumerated value representing a WGSL.
- : A sequence of record types, with the structure `(id, value)`, representing override values for [WGSL constants that can be overridden in the pipeline](https://gpuweb.github.io/gpuweb/#typedefdef-gpupipelineconstantvalue). These behave like [ordered maps](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map). In each case, the `id` is a key used to identify or select the record, and the `constant` is an enumerated value representing a WGSL.

Depending on which constant you want to override, the `id` may take the form of the numeric ID of the constant, if one is specified, or otherwise the constant's identifier name.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ browser-compat: api.GPUDevice.createComputePipelineAsync
The **`createComputePipelineAsync()`** method of the
{{domxref("GPUDevice")}} interface returns a {{jsxref("Promise")}} that fulfills with a {{domxref("GPUComputePipeline")}}, which can control the compute shader stage and be used in a {{domxref("GPUComputePassEncoder")}}, once the pipeline can be used without any stalling.

> **Note:** It is generally preferrable to use this method over {{domxref("GPUDevice.createComputePipeline()")}} whenever possible, as it prevents blocking of GPU operation execution on pipeline compilation.
> **Note:** It is generally preferable to use this method over {{domxref("GPUDevice.createComputePipeline()")}} whenever possible, as it prevents blocking of GPU operation execution on pipeline compilation.
## Syntax

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/gpudevice/createqueryset/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ createQuerySet(descriptor)
- : A string providing a label that can be used to identify the object, for example in {{domxref("GPUError")}} messages or console warnings.
- `type`

- : An emumerated value specifying the type of queries to be managed by the resulting {{domxref("GPUQuerySet")}}. Possible values are:
- : An enumerated value specifying the type of queries to be managed by the resulting {{domxref("GPUQuerySet")}}. Possible values are:

- `"occlusion"`
- : Occlusion queries are available on render passes to query the number of fragment samples that pass all the per-fragment tests for a set of drawing commands (including scissor, sample mask, alpha to coverage, stencil, and depth tests). To run an occlusion query, an appropriate {{domxref("GPUQuerySet")}} must be provided as the value of the `occlusionQuerySet` descriptor property when invoking {{domxref("GPUCommandEncoder.beginRenderPass()")}} to run a render pass.
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/gpudevice/createrenderpipeline/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ The `fragment` object contains an array of objects, each of which can contain th

- `constants` {{optional_inline}}

- : A sequence of record types, with the structure `(id, value)`, representing override values for [WGSL constants that can be overriden in the pipeline](https://gpuweb.github.io/gpuweb/#typedefdef-gpupipelineconstantvalue). These behave like [ordered maps](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map). In each case, the `id` is a key used to identify or select the record, and the `constant` is an enumerated value representing a WGSL.
- : A sequence of record types, with the structure `(id, value)`, representing override values for [WGSL constants that can be overridden in the pipeline](https://gpuweb.github.io/gpuweb/#typedefdef-gpupipelineconstantvalue). These behave like [ordered maps](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map). In each case, the `id` is a key used to identify or select the record, and the `constant` is an enumerated value representing a WGSL.

Depending on which constant you want to override, the `id` may take the form of the numeric ID of the constant, if one is specified, or otherwise the constant's identifier name.

Expand Down Expand Up @@ -277,7 +277,7 @@ The `vertex` object can contain the following properties:

- `constants` {{optional_inline}}

- : A sequence of record types, with the structure `(id, value)`, representing override values for [WGSL constants that can be overriden in the pipeline](https://gpuweb.github.io/gpuweb/#typedefdef-gpupipelineconstantvalue). These behave like [ordered maps](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map). In each case, the `id` is a key used to identify or select the record, and the `constant` is an enumerated value representing a WGSL.
- : A sequence of record types, with the structure `(id, value)`, representing override values for [WGSL constants that can be overridden in the pipeline](https://gpuweb.github.io/gpuweb/#typedefdef-gpupipelineconstantvalue). These behave like [ordered maps](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map). In each case, the `id` is a key used to identify or select the record, and the `constant` is an enumerated value representing a WGSL.

Depending on which constant you want to override, the `id` may take the form of the numeric ID of the constant, if one is specified, or otherwise the constant's identifier name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ browser-compat: api.GPUDevice.createRenderPipelineAsync
The **`createRenderPipelineAsync()`** method of the
{{domxref("GPUDevice")}} interface returns a {{jsxref("Promise")}} that fulfills with a {{domxref("GPURenderPipeline")}}, which can control the vertex and fragment shader stages and be used in a {{domxref("GPURenderPassEncoder")}} or {{domxref("GPURenderBundleEncoder")}}, once the pipeline can be used without any stalling.

> **Note:** It is generally preferrable to use this method over {{domxref("GPUDevice.createRenderPipeline()")}} whenever possible, as it prevents blocking of GPU operation execution on pipeline compilation.
> **Note:** It is generally preferable to use this method over {{domxref("GPUDevice.createRenderPipeline()")}} whenever possible, as it prevents blocking of GPU operation execution on pipeline compilation.
## Syntax

Expand Down
6 changes: 3 additions & 3 deletions files/en-us/web/api/gpudevice/createtexture/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ createTexture(descriptor)
`dimension` defaults to `"2d"` if the value is omitted.

- `format`
- : An emumerated value specifying the format of the texture. See the [Texture formats](https://gpuweb.github.io/gpuweb/#enumdef-gputextureformat) section of the specification for all the possible values.
- : An enumerated value specifying the format of the texture. See the [Texture formats](https://gpuweb.github.io/gpuweb/#enumdef-gputextureformat) section of the specification for all the possible values.
- `label` {{optional_inline}}
- : A string providing a label that can be used to identify the object, for example in {{domxref("GPUError")}} messages or console warnings.
- `mipLevelCount` {{optional_inline}}
Expand Down Expand Up @@ -73,7 +73,7 @@ createTexture(descriptor)
```

- `viewFormats` {{optional_inline}}
- : An array of enumerated values specifying other [texture formats](https://gpuweb.github.io/gpuweb/#enumdef-gputextureformat) permitted when calling {{domxref("GPUTexture.createView()")}} on this texture, in addition to the texture format specificed in its `format` value.
- : An array of enumerated values specifying other [texture formats](https://gpuweb.github.io/gpuweb/#enumdef-gputextureformat) permitted when calling {{domxref("GPUTexture.createView()")}} on this texture, in addition to the texture format specified in its `format` value.

### Return value

Expand Down Expand Up @@ -105,7 +105,7 @@ The following criteria must be met when calling **`createTexture()`**, otherwise
- `mipLevelCount` is equal to 1.
- The `size` depth/array layer count value is equal to 1.
- `usage` includes the `GPUTextureUsage.RENDER_ATTACHMENT` flag.
- `usage` does not include the `GPUTextureUsage.STOREAGE_BINDING` flag.
- `usage` does not include the `GPUTextureUsage.STORAGE_BINDING` flag.
- The specified format supports multi-sampling.
- The `mipLevelCount` value is less than or equal to the [maximum miplevel count](https://gpuweb.github.io/gpuweb/#abstract-opdef-maximum-miplevel-count).
- The formats specified in `format` and `viewFormats` are [compatible](https://gpuweb.github.io/gpuweb/#texture-view-format-compatible) with one another.
Expand Down
8 changes: 4 additions & 4 deletions files/en-us/web/api/gpudevice/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ A `GPUDevice` object is requested using the {{domxref("GPUAdapter.requestDevice(

_Inherits properties from its parent, {{DOMxRef("EventTarget")}}._

- {{domxref("GPUDevice.features", "features")}} {{Experimental_Inline}} {{readonlyinline}}
- {{domxref("GPUDevice.features", "features")}} {{Experimental_Inline}} {{ReadOnlyInline}}

- : A {{domxref("GPUSupportedFeatures")}} object that describes additional functionality supported by the device.

- {{domxref("GPUDevice.label", "label")}} {{Experimental_Inline}}

- : A string providing a label that can be used to identify the object, for example in {{domxref("GPUError")}} messages or console warnings.

- {{domxref("GPUDevice.limits", "limits")}} {{Experimental_Inline}} {{readonlyinline}}
- {{domxref("GPUDevice.limits", "limits")}} {{Experimental_Inline}} {{ReadOnlyInline}}

- : A {{domxref("GPUSupportedLimits")}} object that describes the limits supported by the device.

- {{domxref("GPUDevice.lost", "lost")}} {{Experimental_Inline}} {{readonlyinline}}
- {{domxref("GPUDevice.lost", "lost")}} {{Experimental_Inline}} {{ReadOnlyInline}}

- : Contains a {{jsxref("Promise")}} that remains pending throughout the device's lifetime and resolves with a {{domxref("GPUDeviceLostInfo")}} object when the device is lost.

- {{domxref("GPUDevice.queue", "queue")}} {{Experimental_Inline}} {{readonlyinline}}
- {{domxref("GPUDevice.queue", "queue")}} {{Experimental_Inline}} {{ReadOnlyInline}}
- : Returns the primary {{domxref("GPUQueue")}} for the device.

## Instance methods
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/gpudevice/limits/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ browser-compat: api.GPUDevice.limits
The **`limits`** read-only property of the
{{domxref("GPUDevice")}} interface returns a {{domxref("GPUSupportedLimits")}} object that describes the limits supported by the device. All limit values will be included, and the limits requested during the creation of the device (i.e. when {{domxref("GPUAdapter.requestDevice()")}} is called) will be reflected in those values.

> **Note:** Not all limits will be reported as expcted, even if they are supported by the underlying hardware. See {{domxref("GPUAdapter.limits")}} for more details.
> **Note:** Not all limits will be reported as expected, even if they are supported by the underlying hardware. See {{domxref("GPUAdapter.limits")}} for more details.
## Value

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/gpudevice/poperrorscope/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ let sampler = device.createSampler({
device.popErrorScope().then((error) => {
if (error) {
sampler = null;
console.error(`An error occured while creating sampler: ${error.message}`);
console.error(`An error occurred while creating sampler: ${error.message}`);
}
});
```
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/gpudevice/pusherrorscope/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ let sampler = device.createSampler({
device.popErrorScope().then((error) => {
if (error) {
sampler = null;
console.error(`An error occured while creating sampler: ${error.message}`);
console.error(`An error occurred while creating sampler: ${error.message}`);
}
});
```
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/gpudevicelostinfo/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ See the {{domxref("GPUDevice.lost")}} page for more information about "lost" sta

## Instance properties

- {{domxref("GPUDeviceLostInfo.message", "message")}} {{Experimental_Inline}} {{readonlyinline}}
- {{domxref("GPUDeviceLostInfo.message", "message")}} {{Experimental_Inline}} {{ReadOnlyInline}}
- : A string providing a human-readable message that explains why the device was lost.
- {{domxref("GPUDeviceLostInfo.reason", "reason")}} {{Experimental_Inline}} {{readonlyinline}}
- {{domxref("GPUDeviceLostInfo.reason", "reason")}} {{Experimental_Inline}} {{ReadOnlyInline}}
- : An enumerated value that defines the reason the device was lost in a machine-readable way.

## Examples
Expand Down
Loading

0 comments on commit ee9993f

Please sign in to comment.