Skip to content

Commit

Permalink
Remove WebGL1 support from RenderPassColorGrab (#6793)
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 Jul 9, 2024
1 parent 2cbd167 commit 0252785
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions src/scene/graphics/render-pass-color-grab.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ const _colorUniformNames = ['uSceneColorMap', 'texture_grabPass'];
/**
* A render pass implementing grab of a color buffer.
*
* TODO: implement mipmapped color buffer support for WebGL 1 as well, which requires
* the texture to be a power of two, by first downscaling the captured framebuffer
* texture to smaller power of 2 texture, and then generate mipmaps and use it for rendering
* TODO: or even better, implement blur filter to have smoother lower levels
*
* @ignore
*/
class RenderPassColorGrab extends RenderPass {
Expand Down Expand Up @@ -135,22 +130,6 @@ class RenderPassColorGrab extends RenderPass {
device.activeTexture(device.maxCombinedTextures - 1);
device.bindTexture(colorBuffer);
device.gl.generateMipmap(colorBuffer.impl._glTarget);

} else { // webgl 1

// initialize the texture
if (!colorBuffer.impl._glTexture) {
colorBuffer.impl.initialize(device, colorBuffer);
}

// copy framebuffer to it
device.bindTexture(colorBuffer);
const gl = device.gl;
gl.copyTexImage2D(gl.TEXTURE_2D, 0, colorBuffer.impl._glFormat, 0, 0, colorBuffer.width, colorBuffer.height, 0);

// stop the device from updating this texture further
colorBuffer._needsUpload = false;
colorBuffer._needsMipmapsUpload = false;
}

DebugGraphics.popGpuMarker(device);
Expand Down

0 comments on commit 0252785

Please sign in to comment.