Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. GPUSampler

GPUSampler

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.

Note: This feature is available inWeb Workers.

TheGPUSampler interface of theWebGPU API represents an object that can control how shaders transform and filter texture resource data.

AGPUSampler object instance is created using theGPUDevice.createSampler() method.

Instance properties

label

A string providing a label that can be used to identify the object, for example inGPUError messages or console warnings.

Examples

The following snippet creates aGPUSampler that does trilinear filtering and repeats texture coordinates:

js
// …const sampler = device.createSampler({  addressModeU: "repeat",  addressModeV: "repeat",  magFilter: "linear",  minFilter: "linear",  mipmapFilter: "linear",});

The WebGPU samplesShadow Mapping sample uses comparison samplers to sample from a depth texture to render shadows.

Specifications

Specification
WebGPU
# gpusampler

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp