web api instance property
GPUTexture: sampleCount property
Secure contextAvailable in workers
The sampleCount read-only property of the
GPUTexture interface represents the sample count of the GPUTexture.
This is set via the sampleCount property in the descriptor object passed into the originating createTexture() call. If omitted, this defaults to 1.
Value
A number. Possible values are:
- 1
- 4, which indicates a multi-sampled texture.
Examples
// …
const depthTexture = device.createTexture({
size: [canvas.width, canvas.height],
format: "depth24plus",
usage: GPUTextureUsage.RENDER_ATTACHMENT,
});
console.log(depthTexture.sampleCount); // 1
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.
See also
- The WebGPU API