Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/platform/graphics/graphics-device.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,24 @@ class GraphicsDevice extends EventHandler {
*/
supportsClipDistances = false;

/**
* True if the device supports WebGPU texture format tier 1 capabilities. When enabled, a wider
* set of normalized texture formats can be used as render targets and storage textures.
*
* @type {boolean}
* @readonly
*/
supportsTextureFormatTier1 = false;

/**
* True if the device supports WebGPU texture format tier 2 capabilities. This extends tier 1
* and enables read-write storage access for selected texture formats.
*
* @type {boolean}
* @readonly
*/
supportsTextureFormatTier2 = false;

/**
* True if the device supports primitive index in fragment shaders (WebGPU only). When
* supported, fragment shaders can access the `pcPrimitiveIndex` built-in variable which
Expand Down
1 change: 1 addition & 0 deletions src/platform/graphics/webgpu/webgpu-graphics-device.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ class WebgpuGraphicsDevice extends GraphicsDevice {
this.supportsClipDistances = requireFeature('clip-distances');
this.supportsTextureFormatTier1 = requireFeature('texture-format-tier1');
this.supportsTextureFormatTier2 = requireFeature('texture-format-tier2');
this.supportsTextureFormatTier1 ||= this.supportsTextureFormatTier2;
this.supportsPrimitiveIndex = requireFeature('primitive-index');
Debug.log(`WEBGPU features: ${requiredFeatures.join(', ')}`);

Expand Down