A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setIndexBuffer below:

GPURenderBundleEncoder: setIndexBuffer() method - Web APIs

GPURenderBundleEncoder: setIndexBuffer() method

Limited availability

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Note: This feature is available in Web Workers.

The setIndexBuffer() method of the GPURenderBundleEncoder interface sets the current GPUBuffer that will provide index data for subsequent drawing commands.

Note: This method is functionally identical to its equivalent on GPURenderPassEncoder — setIndexBuffer().

Syntax
setIndexBuffer(buffer, indexFormat, offset, size)
Parameters
buffer

A GPUBuffer representing the buffer containing the index data to use for subsequent drawing commands.

indexFormat

An enumerated value that defines the format of the index data contained in buffer. Possible values are:

offset Optional

A number representing the offset, in bytes, into buffer where the index data begins. If omitted, offset defaults to 0.

size Optional

A number representing the size, in bytes, of the index data contained in buffer. If omitted, size defaults to the buffer's GPUBuffer.size - offset.

Note on indexFormat

indexFormat determines both the data type of index values in a buffer and, when used with a pipeline that specifies a strip primitive topology ("line-strip" or "triangle-strip"), also determines the primitive restart value. The primitive restart value is an index value indicating that a new primitive should be started rather than continuing to construct the strip with the prior indexed vertices. The value is 0xFFFF for "uint16", or 0xFFFFFFFF for "uint32".

Return value

None (Undefined).

Validation

The following criteria must be met when calling setIndexBuffer(), otherwise a GPUValidationError is generated and the GPURenderBundleEncoder becomes invalid:

Examples
// …

const bundleEncoder = device.createRenderBundleEncoder(descriptor);

bundleEncoder.setPipeline(pipeline);
bundleEncoder.setBindGroup(0, sceneBindGroupForRender);
bundleEncoder.setBindGroup(1, modelBindGroup);
bundleEncoder.setVertexBuffer(0, vertexBuffer);
bundleEncoder.setIndexBuffer(indexBuffer, "uint16");
bundleEncoder.drawIndexed(indexCount);

const renderBundle = bundleEncoder.finish();

// …
Specifications Browser compatibility See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4