History

Moving the num mips per texture to the creator so it s immutable and simpler

samcake committed 9 years ago

Commit b6504bb1 parent 60208bc23 files · +193 −151Browse files

Showing the changes to libraries/render-utils/src/DeferredFramebuffer.cpp (1 of 23 files). Show all

Unified · Split

libraries/render-utils/src/DeferredFramebuffer.cpp+5−5
@@ -53,9 +53,9 @@ void DeferredFramebuffer::allocate() { · 52 unmodified lines
5353
5454 auto defaultSampler = gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_POINT);
5555
56− _deferredColorTexture = gpu::TexturePointer(gpu::Texture::createRenderBuffer(colorFormat, width, height, defaultSampler));
57− _deferredNormalTexture = gpu::TexturePointer(gpu::Texture::createRenderBuffer(linearFormat, width, height, defaultSampler));
58− _deferredSpecularTexture = gpu::TexturePointer(gpu::Texture::createRenderBuffer(colorFormat, width, height, defaultSampler));
56+ _deferredColorTexture = gpu::TexturePointer(gpu::Texture::createRenderBuffer(colorFormat, width, height, 1, defaultSampler));
57+ _deferredNormalTexture = gpu::TexturePointer(gpu::Texture::createRenderBuffer(linearFormat, width, height, 1, defaultSampler));
58+ _deferredSpecularTexture = gpu::TexturePointer(gpu::Texture::createRenderBuffer(colorFormat, width, height, 1, defaultSampler));
5959
6060 _deferredFramebuffer->setRenderBuffer(0, _deferredColorTexture);
6161 _deferredFramebuffer->setRenderBuffer(1, _deferredNormalTexture);
@@ -65,7 +65,7 @@ void DeferredFramebuffer::allocate() { · 3 unmodified lines
6565
6666 auto depthFormat = gpu::Element(gpu::SCALAR, gpu::UINT32, gpu::DEPTH_STENCIL); // Depth24_Stencil8 texel format
6767 if (!_primaryDepthTexture) {
68− _primaryDepthTexture = gpu::TexturePointer(gpu::Texture::createRenderBuffer(depthFormat, width, height, defaultSampler));
68+ _primaryDepthTexture = gpu::TexturePointer(gpu::Texture::createRenderBuffer(depthFormat, width, height, 1, defaultSampler));
6969 }
7070
7171 _deferredFramebuffer->setDepthStencilBuffer(_primaryDepthTexture, depthFormat);
@@ -75,7 +75,7 @@ void DeferredFramebuffer::allocate() { · 3 unmodified lines
7575
7676 auto smoothSampler = gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_MIP_LINEAR);
7777
78− _lightingTexture = gpu::TexturePointer(gpu::Texture::createRenderBuffer(gpu::Element(gpu::SCALAR, gpu::FLOAT, gpu::R11G11B10), width, height, defaultSampler));
78+ _lightingTexture = gpu::TexturePointer(gpu::Texture::createRenderBuffer(gpu::Element(gpu::SCALAR, gpu::FLOAT, gpu::R11G11B10), width, height, 1, defaultSampler));
7979 _lightingFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create("lighting"));
8080 _lightingFramebuffer->setRenderBuffer(0, _lightingTexture);
8181 _lightingFramebuffer->setDepthStencilBuffer(_primaryDepthTexture, depthFormat);