Skip to content

Commit

Permalink
WebGPU support for rendering to RG11B10 format (#5824)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Valigursky <mvaligursky@snapchat.com>
  • Loading branch information
mvaligursky and Martin Valigursky authored Nov 15, 2023
1 parent 53c6fa9 commit 5d92cab
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/platform/graphics/webgl/webgl-graphics-device.js
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,7 @@ class WebglGraphicsDevice extends GraphicsDevice {
this.extVertexArrayObject = true;
this.extColorBufferFloat = this.getExtension('EXT_color_buffer_float');
this.extDepthTexture = true;
this.textureRG11B10Renderable = true;
} else {
this.extBlendMinmax = this.getExtension("EXT_blend_minmax");
this.extDrawBuffers = this.getExtension('WEBGL_draw_buffers');
Expand Down
1 change: 1 addition & 0 deletions src/platform/graphics/webgl/webgl-texture.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ class WebglTexture {
}
break;
case PIXELFORMAT_111110F: // WebGL2 only
Debug.assert(device.isWebGL2, "PIXELFORMAT_111110F texture format is not supported by WebGL1.");
this._glFormat = gl.RGB;
this._glInternalFormat = gl.R11F_G11F_B10F;
this._glPixelType = gl.UNSIGNED_INT_10F_11F_11F_REV;
Expand Down
2 changes: 1 addition & 1 deletion src/platform/graphics/webgpu/webgpu-graphics-device.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ class WebgpuGraphicsDevice extends GraphicsDevice {
// "depth32float-stencil8",
// "indirect-first-instance",
// "shader-f16",
// "rg11b10ufloat-renderable",
// "bgra8unorm-storage",

// request optional features
Expand All @@ -223,6 +222,7 @@ class WebgpuGraphicsDevice extends GraphicsDevice {
this.extCompressedTextureETC = requireFeature('texture-compression-etc2');
this.extCompressedTextureASTC = requireFeature('texture-compression-astc');
this.supportsTimestampQuery = requireFeature('timestamp-query');
this.textureRG11B10Renderable = requireFeature('rg11b10ufloat-renderable');
Debug.log(`WEBGPU features: ${requiredFeatures.join(', ')}`);

/** @type {GPUDeviceDescriptor} */
Expand Down

0 comments on commit 5d92cab

Please sign in to comment.