Showing the changes to libraries/render-utils/src/FramebufferCache.cpp (1 of 4 files). Show all
Unified · Split
| @@ -35,9 +35,7 @@ void FramebufferCache::setFrameBufferSize(QSize frameBufferSize) { · 34 unmodified lines | ||
| 35 | 35 | _frameBufferSize = frameBufferSize; |
| 36 | 36 | _primaryFramebufferFull.reset(); |
| 37 | 37 | _primaryFramebufferDepthColor.reset(); |
| 38 | − _primaryFramebufferStencilColor.reset(); | |
| 39 | 38 | _primaryDepthTexture.reset(); |
| 40 | − _primaryStencilTexture.reset(); | |
| 41 | 39 | _primaryColorTexture.reset(); |
| 42 | 40 | _primaryNormalTexture.reset(); |
| 43 | 41 | _primarySpecularTexture.reset(); |
| @@ -49,7 +47,6 @@ void FramebufferCache::setFrameBufferSize(QSize frameBufferSize) { · 5 unmodified lines | ||
| 49 | 47 | void FramebufferCache::createPrimaryFramebuffer() { |
| 50 | 48 | _primaryFramebufferFull = gpu::FramebufferPointer(gpu::Framebuffer::create()); |
| 51 | 49 | _primaryFramebufferDepthColor = gpu::FramebufferPointer(gpu::Framebuffer::create()); |
| 52 | − _primaryFramebufferStencilColor = gpu::FramebufferPointer(gpu::Framebuffer::create()); | |
| 53 | 50 | |
| 54 | 51 | auto colorFormat = gpu::Element(gpu::VEC4, gpu::NUINT8, gpu::RGBA); |
| 55 | 52 | auto width = _frameBufferSize.width(); |
| @@ -66,24 +63,14 @@ void FramebufferCache::createPrimaryFramebuffer() { · 10 unmodified lines | ||
| 66 | 63 | |
| 67 | 64 | _primaryFramebufferDepthColor->setRenderBuffer(0, _primaryColorTexture); |
| 68 | 65 | |
| 69 | − _primaryFramebufferStencilColor->setRenderBuffer(0, _primaryColorTexture); | |
| 70 | − | |
| 71 | 66 | // auto depthFormat = gpu::Element(gpu::SCALAR, gpu::FLOAT, gpu::DEPTH); |
| 72 | 67 | auto depthFormat = gpu::Element(gpu::SCALAR, gpu::UINT32, gpu::DEPTH_STENCIL); // Depth24_Stencil8 texel format |
| 73 | 68 | _primaryDepthTexture = gpu::TexturePointer(gpu::Texture::create2D(depthFormat, width, height, defaultSampler)); |
| 74 | − | |
| 75 | − // auto stencilFormat = gpu::Element(gpu::SCALAR, gpu::UINT32, gpu::DEPTH_STENCIL); // Depth24_Stencil8 texel format | |
| 76 | − auto stencilFormat = depthFormat; | |
| 77 | − // _primaryStencilTexture = gpu::TexturePointer(gpu::Texture::create2D(stencilFormat, width, height, defaultSampler)); | |
| 78 | − _primaryStencilTexture = _primaryDepthTexture; | |
| 79 | − | |
| 69 | + | |
| 80 | 70 | _primaryFramebufferFull->setDepthStencilBuffer(_primaryDepthTexture, depthFormat); |
| 81 | 71 | |
| 82 | 72 | _primaryFramebufferDepthColor->setDepthStencilBuffer(_primaryDepthTexture, depthFormat); |
| 83 | − | |
| 84 | − // _primaryFramebufferStencilColor->setDepthStencilBuffer(_primaryStencilTexture, stencilFormat); | |
| 85 | − _primaryFramebufferStencilColor = _primaryFramebufferDepthColor; | |
| 86 | − | |
| 73 | + | |
| 87 | 74 | _selfieFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create()); |
| 88 | 75 | auto tex = gpu::TexturePointer(gpu::Texture::create2D(colorFormat, width * 0.5, height * 0.5, defaultSampler)); |
| 89 | 76 | _selfieFramebuffer->setRenderBuffer(0, tex); |
| @@ -103,13 +90,6 @@ gpu::FramebufferPointer FramebufferCache::getPrimaryFramebufferDepthColor() { · 13 unmodified lines | ||
| 103 | 90 | return _primaryFramebufferDepthColor; |
| 104 | 91 | } |
| 105 | 92 | |
| 106 | −gpu::FramebufferPointer FramebufferCache::getPrimaryFramebufferStencilColor() { | |
| 107 | − if (!_primaryFramebufferStencilColor) { | |
| 108 | − createPrimaryFramebuffer(); | |
| 109 | − } | |
| 110 | − return _primaryFramebufferStencilColor; | |
| 111 | −} | |
| 112 | − | |
| 113 | 93 | gpu::TexturePointer FramebufferCache::getPrimaryDepthTexture() { |
| 114 | 94 | if (!_primaryDepthTexture) { |
| 115 | 95 | createPrimaryFramebuffer(); |
| @@ -117,13 +97,6 @@ gpu::TexturePointer FramebufferCache::getPrimaryDepthTexture() { · 1 unmodified line | ||
| 117 | 97 | return _primaryDepthTexture; |
| 118 | 98 | } |
| 119 | 99 | |
| 120 | −gpu::TexturePointer FramebufferCache::getPrimaryStencilTexture() { | |
| 121 | − if (!_primaryStencilTexture) { | |
| 122 | − createPrimaryFramebuffer(); | |
| 123 | − } | |
| 124 | − return _primaryStencilTexture; | |
| 125 | −} | |
| 126 | − | |
| 127 | 100 | gpu::TexturePointer FramebufferCache::getPrimaryColorTexture() { |
| 128 | 101 | if (!_primaryColorTexture) { |
| 129 | 102 | createPrimaryFramebuffer(); |