[core] Remove unused OffscreenTexture variant with depth render target

This commit is contained in:
Aleksandar Stojiljkovic
2019-06-09 14:18:59 +03:00
parent df062afe6d
commit d7fa18efa6
5 changed files with 2 additions and 44 deletions

View File

@@ -42,11 +42,6 @@ public:
virtual std::unique_ptr<OffscreenTexture>
createOffscreenTexture(Size,
TextureChannelDataType = TextureChannelDataType::UnsignedByte) = 0;
virtual std::unique_ptr<OffscreenTexture>
createOffscreenTexture(Size,
Renderbuffer<RenderbufferPixelType::Depth>&,
TextureChannelDataType = TextureChannelDataType::UnsignedByte) = 0;
public:
// Creates an empty texture with the specified dimensions.
Texture createTexture(const Size size,

View File

@@ -437,13 +437,6 @@ Context::createOffscreenTexture(const Size size, const gfx::TextureChannelDataTy
return std::make_unique<gl::OffscreenTexture>(*this, size, type);
}
std::unique_ptr<gfx::OffscreenTexture>
Context::createOffscreenTexture(const Size size,
gfx::Renderbuffer<gfx::RenderbufferPixelType::Depth>& depth,
gfx::TextureChannelDataType type) {
return std::make_unique<gl::OffscreenTexture>(*this, size, depth, type);
}
std::unique_ptr<gfx::DrawScopeResource> Context::createDrawScopeResource() {
return std::make_unique<gl::DrawScopeResource>(createVertexArray());
}

View File

@@ -181,10 +181,6 @@ private:
std::unique_ptr<gfx::OffscreenTexture> createOffscreenTexture(
Size, gfx::TextureChannelDataType = gfx::TextureChannelDataType::UnsignedByte) override;
std::unique_ptr<gfx::OffscreenTexture> createOffscreenTexture(
Size,
gfx::Renderbuffer<gfx::RenderbufferPixelType::Depth>&,
gfx::TextureChannelDataType = gfx::TextureChannelDataType::UnsignedByte) override;
std::unique_ptr<gfx::TextureResource>
createTextureResource(Size, gfx::TexturePixelType, gfx::TextureChannelDataType) override;

View File

@@ -15,23 +15,11 @@ public:
assert(!size.isEmpty());
}
OffscreenTextureResource(gl::Context& context_,
const Size size_,
gfx::Renderbuffer<gfx::RenderbufferPixelType::Depth>& depth_,
const gfx::TextureChannelDataType type_)
: context(context_), size(size_), depth(&depth_), type(type_) {
assert(!size.isEmpty());
}
void bind() override {
if (!framebuffer) {
assert(!texture);
texture = context.createTexture(size, gfx::TexturePixelType::RGBA, type);
if (depth) {
framebuffer = context.createFramebuffer(*texture, *depth);
} else {
framebuffer = context.createFramebuffer(*texture);
}
framebuffer = context.createFramebuffer(*texture);
} else {
context.bindFramebuffer = framebuffer->framebuffer;
}
@@ -56,7 +44,6 @@ private:
gl::Context& context;
const Size size;
optional<gfx::Texture> texture;
gfx::Renderbuffer<gfx::RenderbufferPixelType::Depth>* depth = nullptr;
const gfx::TextureChannelDataType type;
optional<gl::Framebuffer> framebuffer;
};
@@ -67,15 +54,6 @@ OffscreenTexture::OffscreenTexture(gl::Context& context,
: gfx::OffscreenTexture(size, std::make_unique<OffscreenTextureResource>(context, size_, type)) {
}
OffscreenTexture::OffscreenTexture(
gl::Context& context,
const Size size_,
gfx::Renderbuffer<gfx::RenderbufferPixelType::Depth>& renderbuffer,
const gfx::TextureChannelDataType type)
: gfx::OffscreenTexture(
size, std::make_unique<OffscreenTextureResource>(context, size_, renderbuffer, type)) {
}
bool OffscreenTexture::isRenderable() {
try {
getResource<OffscreenTextureResource>().bind();

View File

@@ -1,7 +1,7 @@
#pragma once
#include <mbgl/gfx/offscreen_texture.hpp>
#include <mbgl/gfx/renderbuffer.hpp>
#include <mbgl/gfx/types.hpp>
namespace mbgl {
namespace gl {
@@ -13,10 +13,6 @@ public:
OffscreenTexture(gl::Context&,
Size size,
gfx::TextureChannelDataType type = gfx::TextureChannelDataType::UnsignedByte);
OffscreenTexture(gl::Context&,
Size size,
gfx::Renderbuffer<gfx::RenderbufferPixelType::Depth>&,
gfx::TextureChannelDataType type = gfx::TextureChannelDataType::UnsignedByte);
bool isRenderable() override;