GPUTexture: format-Eigenschaft
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimentell: Dies ist eine experimentelle Technologie
Überprüfen Sie die Browser-Kompatibilitätstabelle sorgfältig vor der Verwendung auf produktiven Webseiten.
Sicherer Kontext: Diese Funktion ist nur in sicheren Kontexten (HTTPS) in einigen oder allen unterstützenden Browsern verfügbar.
Hinweis: Diese Funktion ist in Web Workers verfügbar.
Die format
-Eigenschaft des GPUTexture
-Interfaces ist eine schreibgeschützte Eigenschaft, die das Format der GPUTexture
darstellt.
Dieses wird über die format
-Eigenschaft im Deskriptor-Objekt gesetzt, das im ursprünglichen Aufruf von GPUDevice.createTexture()
übergeben wurde.
Wert
Ein Enumerationswert. Siehe den Abschnitt Texture formats der Spezifikation für alle möglichen Werte.
Beispiele
// ...
const depthTexture = device.createTexture({
size: [canvas.width, canvas.height],
format: "depth24plus",
usage: GPUTextureUsage.RENDER_ATTACHMENT,
});
console.log(depthTexture.format); // "depth24plus"
Spezifikationen
Specification |
---|
WebGPU # dom-gputexture-format |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | server | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
format | |||||||||||||
rgb10a2uint texture format |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Partial support
- Partial support
- In development. Supported in a pre-release version.
- In development. Supported in a pre-release version.
- No support
- No support
- Experimental. Expect behavior to change in the future.
- See implementation notes.
- User must explicitly enable this feature.
- Has more compatibility info.
Siehe auch
- Die WebGPU API