1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-02 09:03:37 +00:00
GLideN64/src/DepthBuffer.cpp

477 lines
17 KiB
C++
Raw Normal View History

2014-10-13 12:38:51 +00:00
#ifdef OS_MAC_OS_X
#include <malloc/malloc.h>
#else
#include <malloc.h>
2014-10-13 12:38:51 +00:00
#endif
#include <assert.h>
2013-06-01 13:10:30 +00:00
#include "OpenGL.h"
2013-12-14 14:30:20 +00:00
#include "Combiner.h"
2013-06-01 13:10:30 +00:00
#include "FrameBuffer.h"
#include "DepthBuffer.h"
#include "VI.h"
#include "Config.h"
2013-06-01 13:10:30 +00:00
#include "Debug.h"
2017-01-01 13:56:13 +00:00
#include <Graphics/Context.h>
#include <Graphics/Parameters.h>
#include "DisplayWindow.h"
2013-12-14 14:30:20 +00:00
const GLuint ZlutImageUnit = 0;
const GLuint TlutImageUnit = 1;
const GLuint depthImageUnit = 2;
using namespace graphics;
DepthBuffer::DepthBuffer() : m_address(0), m_width(0), m_ulx(0), m_uly(0), m_lrx(0), m_lry(0),
m_depthImageFBO(0), m_pDepthImageTexture(nullptr), m_pDepthBufferTexture(nullptr),
m_depthRenderbuffer(0), m_depthRenderbufferWidth(0),
m_cleared(false), m_pResolveDepthBufferTexture(nullptr), m_resolved(false),
m_pDepthBufferCopyTexture(nullptr), m_copied(false)
{
2017-01-02 14:00:49 +00:00
m_copyFBO = GLuint(gfxContext.createFramebuffer());
if (Context::imageTextures && config.frameBufferEmulation.N64DepthCompare != 0)
2017-01-02 14:00:49 +00:00
m_depthImageFBO = GLuint(gfxContext.createFramebuffer());
}
2014-09-08 11:00:13 +00:00
DepthBuffer::DepthBuffer(DepthBuffer && _other) :
m_address(_other.m_address), m_width(_other.m_width),
m_ulx(_other.m_ulx), m_uly(_other.m_uly), m_lrx(_other.m_lrx), m_lry(_other.m_lry),
m_depthImageFBO(_other.m_depthImageFBO), m_pDepthImageTexture(_other.m_pDepthImageTexture), m_pDepthBufferTexture(_other.m_pDepthBufferTexture),
m_depthRenderbuffer(_other.m_depthRenderbuffer), m_depthRenderbufferWidth(_other.m_depthRenderbufferWidth),
m_cleared(_other.m_cleared), m_pResolveDepthBufferTexture(_other.m_pResolveDepthBufferTexture), m_resolved(_other.m_resolved),
m_pDepthBufferCopyTexture(_other.m_pDepthBufferCopyTexture), m_copied(_other.m_copied)
{
_other.m_depthImageFBO = 0;
_other.m_pDepthImageTexture = nullptr;
_other.m_pDepthBufferTexture = nullptr;
_other.m_depthRenderbuffer = 0;
_other.m_pResolveDepthBufferTexture = nullptr;
_other.m_resolved = false;
_other.m_pDepthBufferCopyTexture = nullptr;
_other.m_copied = false;
}
2014-09-08 11:00:13 +00:00
DepthBuffer::~DepthBuffer()
{
2017-01-02 14:00:49 +00:00
gfxContext.deleteFramebuffer(graphics::ObjectHandle(m_depthImageFBO));
gfxContext.deleteFramebuffer(graphics::ObjectHandle(m_depthRenderbuffer));
gfxContext.deleteFramebuffer(graphics::ObjectHandle(m_copyFBO));
textureCache().removeFrameBufferTexture(m_pDepthImageTexture);
textureCache().removeFrameBufferTexture(m_pDepthBufferTexture);
textureCache().removeFrameBufferTexture(m_pResolveDepthBufferTexture);
textureCache().removeFrameBufferTexture(m_pDepthBufferCopyTexture);
}
2015-01-27 16:00:06 +00:00
void DepthBuffer::initDepthImageTexture(FrameBuffer * _pBuffer)
{
if (!Context::imageTextures || config.frameBufferEmulation.N64DepthCompare == 0 || m_pDepthImageTexture != nullptr)
2015-01-27 16:00:06 +00:00
return;
2017-01-14 12:26:02 +00:00
const graphics::FramebufferTextureFormats & fbTexFormat = gfxContext.getFramebufferTextureFormats();
2017-01-01 14:59:54 +00:00
m_pDepthImageTexture = textureCache().addFrameBufferTexture(false);
2015-01-27 16:00:06 +00:00
m_pDepthImageTexture->width = (u32)(_pBuffer->m_pTexture->width);
m_pDepthImageTexture->height = (u32)(_pBuffer->m_pTexture->height);
m_pDepthImageTexture->format = 0;
m_pDepthImageTexture->size = 2;
m_pDepthImageTexture->clampS = 1;
m_pDepthImageTexture->clampT = 1;
m_pDepthImageTexture->address = _pBuffer->m_startAddress;
m_pDepthImageTexture->clampWidth = _pBuffer->m_width;
m_pDepthImageTexture->clampHeight = _pBuffer->m_height;
m_pDepthImageTexture->frameBufferTexture = CachedTexture::fbOneSample;
2015-01-27 16:00:06 +00:00
m_pDepthImageTexture->maskS = 0;
m_pDepthImageTexture->maskT = 0;
m_pDepthImageTexture->mirrorS = 0;
m_pDepthImageTexture->mirrorT = 0;
m_pDepthImageTexture->realWidth = m_pDepthImageTexture->width;
m_pDepthImageTexture->realHeight = m_pDepthImageTexture->height;
2017-01-14 12:26:02 +00:00
m_pDepthImageTexture->textureBytes = m_pDepthImageTexture->realWidth * m_pDepthImageTexture->realHeight * fbTexFormat.depthImageFormatBytes;
2015-01-27 16:00:06 +00:00
textureCache().addFrameBufferTextureSize(m_pDepthImageTexture->textureBytes);
2017-01-01 13:56:13 +00:00
{
graphics::Context::InitTextureParams params;
params.handle = graphics::ObjectHandle(m_pDepthImageTexture->glName);
params.width = m_pDepthImageTexture->realWidth;
params.height = m_pDepthImageTexture->realHeight;
2017-01-14 12:26:02 +00:00
params.internalFormat = fbTexFormat.depthImageInternalFormat;
params.format = fbTexFormat.depthImageFormat;
params.dataType = fbTexFormat.depthImageType;
2017-01-01 13:56:13 +00:00
gfxContext.init2DTexture(params);
}
{
graphics::Context::TexParameters params;
params.handle = graphics::ObjectHandle(m_pDepthImageTexture->glName);
params.target = graphics::target::TEXTURE_2D;
2017-01-06 08:19:35 +00:00
params.textureUnitIndex = graphics::textureIndices::Tex[0];
2017-01-01 13:56:13 +00:00
params.minFilter = graphics::textureParameters::FILTER_NEAREST;
params.magFilter = graphics::textureParameters::FILTER_NEAREST;
gfxContext.setTextureParameters(params);
}
{
graphics::Context::FrameBufferRenderTarget bufTarget;
bufTarget.bufferHandle = graphics::ObjectHandle(m_depthImageFBO);
bufTarget.bufferTarget = graphics::bufferTarget::DRAW_FRAMEBUFFER;
bufTarget.attachment = graphics::bufferAttachment::COLOR_ATTACHMENT0;
bufTarget.textureTarget = graphics::target::TEXTURE_2D;
bufTarget.textureHandle = graphics::ObjectHandle(m_pDepthImageTexture->glName);
gfxContext.addFrameBufferRenderTarget(bufTarget);
}
2015-01-27 16:00:06 +00:00
2017-01-20 11:47:19 +00:00
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, GLuint(_pBuffer->m_FBO));
depthBufferList().clearBuffer(0, 0, VI.width, VI.height);
}
void DepthBuffer::_initDepthBufferTexture(FrameBuffer * _pBuffer, CachedTexture * _pTexture, bool _multisample)
2015-01-27 16:00:06 +00:00
{
2017-01-14 12:26:02 +00:00
const graphics::FramebufferTextureFormats & fbTexFormat = gfxContext.getFramebufferTextureFormats();
if (_pBuffer != nullptr) {
_pTexture->width = (u32)(_pBuffer->m_pTexture->width);
_pTexture->height = (u32)(_pBuffer->m_pTexture->height);
_pTexture->address = _pBuffer->m_startAddress;
_pTexture->clampWidth = _pBuffer->m_width;
_pTexture->clampHeight = _pBuffer->m_height;
2017-01-14 12:26:02 +00:00
} else {
if (config.frameBufferEmulation.nativeResFactor == 0) {
_pTexture->width = dwnd().getWidth();
_pTexture->height = dwnd().getHeight();
} else {
_pTexture->width = VI.width * config.frameBufferEmulation.nativeResFactor;
_pTexture->height = VI.height * config.frameBufferEmulation.nativeResFactor;
}
_pTexture->address = gDP.depthImageAddress;
_pTexture->clampWidth = VI.width;
_pTexture->clampHeight = VI.height;
2015-01-27 16:00:06 +00:00
}
_pTexture->format = 0;
_pTexture->size = 2;
_pTexture->clampS = 1;
_pTexture->clampT = 1;
_pTexture->frameBufferTexture = CachedTexture::fbOneSample;
_pTexture->maskS = 0;
_pTexture->maskT = 0;
_pTexture->mirrorS = 0;
_pTexture->mirrorT = 0;
_pTexture->realWidth = _pTexture->width;
_pTexture->realHeight = _pTexture->height;
2017-01-14 12:26:02 +00:00
_pTexture->textureBytes = _pTexture->realWidth * _pTexture->realHeight * fbTexFormat.depthFormatBytes;
textureCache().addFrameBufferTextureSize(_pTexture->textureBytes);
2015-01-27 16:00:06 +00:00
2017-01-01 13:56:13 +00:00
{
graphics::Context::InitTextureParams params;
params.handle = graphics::ObjectHandle(_pTexture->glName);
params.msaaLevel = _multisample ? config.video.multisampling : 0U;
params.width = _pTexture->realWidth;
params.height = _pTexture->realHeight;
2017-01-14 12:26:02 +00:00
params.internalFormat = fbTexFormat.depthInternalFormat;
params.format = fbTexFormat.depthFormat;
params.dataType = fbTexFormat.depthType;
2017-01-01 13:56:13 +00:00
gfxContext.init2DTexture(params);
}
2017-01-02 14:00:49 +00:00
_pTexture->frameBufferTexture = _multisample ? CachedTexture::fbMultiSample : CachedTexture::fbOneSample;
2017-01-01 13:56:13 +00:00
{
graphics::Context::TexParameters params;
params.handle = graphics::ObjectHandle(_pTexture->glName);
params.target = _multisample ? graphics::target::TEXTURE_2D_MULTISAMPLE : graphics::target::TEXTURE_2D;
2017-01-06 08:19:35 +00:00
params.textureUnitIndex = graphics::textureIndices::Tex[0];
2017-01-01 13:56:13 +00:00
params.minFilter = graphics::textureParameters::FILTER_NEAREST;
params.magFilter = graphics::textureParameters::FILTER_NEAREST;
gfxContext.setTextureParameters(params);
}
2015-01-27 16:00:06 +00:00
}
void DepthBuffer::_initDepthBufferRenderbuffer(FrameBuffer * _pBuffer)
{
if (m_depthRenderbuffer != 0)
return;
u32 height;
if (_pBuffer != NULL) {
m_depthRenderbufferWidth = (u32)(_pBuffer->m_pTexture->width);
height = (u32)(_pBuffer->m_pTexture->height);
} else {
if (config.frameBufferEmulation.nativeResFactor == 0) {
m_depthRenderbufferWidth = dwnd().getWidth();
height = dwnd().getHeight();
} else {
m_depthRenderbufferWidth = VI.width * config.frameBufferEmulation.nativeResFactor;
height = VI.height * config.frameBufferEmulation.nativeResFactor;
}
}
graphics::ObjectHandle renderbufHandle = gfxContext.createRenderbuffer();
m_depthRenderbuffer = GLuint(renderbufHandle);
graphics::Context::InitRenderbufferParams params;
params.handle = renderbufHandle;
params.target = graphics::target::RENDERBUFFER;
2017-01-14 12:26:02 +00:00
params.format = gfxContext.getFramebufferTextureFormats().depthInternalFormat;
params.width = m_depthRenderbufferWidth;
params.height = height;
gfxContext.initRenderbuffer(params);
}
void DepthBuffer::setDepthAttachment(GLuint _fbo, GLenum _target)
{
graphics::Context::FrameBufferRenderTarget params;
params.attachment = graphics::bufferAttachment::DEPTH_ATTACHMENT;
params.bufferHandle = graphics::ObjectHandle(_fbo);
params.bufferTarget = _target;
#ifndef USE_DEPTH_RENDERBUFFER
params.textureHandle = graphics::ObjectHandle(m_pDepthBufferTexture->glName);
params.textureTarget = config.video.multisampling != 0 ? graphics::target::TEXTURE_2D_MULTISAMPLE : graphics::target::TEXTURE_2D;
#else
params.textureHandle = graphics::ObjectHandle(m_depthRenderbuffer);
params.textureTarget = graphics::target::RENDERBUFFER;
#endif // USE_DEPTH_RENDERBUFFER
gfxContext.addFrameBufferRenderTarget(params);
m_copied = false;
m_resolved = false;
}
void DepthBuffer::initDepthBufferTexture(FrameBuffer * _pBuffer)
{
#ifndef USE_DEPTH_RENDERBUFFER
if (m_pDepthBufferTexture == nullptr) {
2017-01-01 14:59:54 +00:00
m_pDepthBufferTexture = textureCache().addFrameBufferTexture(config.video.multisampling != 0);
_initDepthBufferTexture(_pBuffer, m_pDepthBufferTexture, config.video.multisampling != 0);
}
#else
_initDepthBufferRenderbuffer(_pBuffer);
#endif
#ifdef GL_MULTISAMPLING_SUPPORT
if (config.video.multisampling != 0 && m_pResolveDepthBufferTexture == nullptr) {
2017-01-01 14:59:54 +00:00
m_pResolveDepthBufferTexture = textureCache().addFrameBufferTexture(false);
_initDepthBufferTexture(_pBuffer, m_pResolveDepthBufferTexture, false);
}
#endif
}
CachedTexture * DepthBuffer::resolveDepthBufferTexture(FrameBuffer * _pBuffer)
{
#ifdef GL_MULTISAMPLING_SUPPORT
if (config.video.multisampling == 0)
return m_pDepthBufferTexture;
if (m_resolved)
return m_pResolveDepthBufferTexture;
2017-01-20 11:47:19 +00:00
glBindFramebuffer(GL_READ_FRAMEBUFFER, GLuint(_pBuffer->m_FBO));
glReadBuffer(GL_COLOR_ATTACHMENT0);
GLuint attachment = GL_COLOR_ATTACHMENT0;
glDrawBuffers(1, &attachment);
assert(checkFBO());
2017-01-20 11:47:19 +00:00
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, GLuint(_pBuffer->m_resolveFBO));
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, m_pResolveDepthBufferTexture->glName, 0);
assert(checkFBO());
glDisable(GL_SCISSOR_TEST);
glBlitFramebuffer(
0, 0, m_pDepthBufferTexture->realWidth, m_pDepthBufferTexture->realHeight,
0, 0, m_pResolveDepthBufferTexture->realWidth, m_pResolveDepthBufferTexture->realHeight,
GL_DEPTH_BUFFER_BIT, GL_NEAREST
);
glEnable(GL_SCISSOR_TEST);
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
2017-01-20 11:47:19 +00:00
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, GLuint(_pBuffer->m_FBO));
m_resolved = true;
return m_pResolveDepthBufferTexture;
#else
return m_pDepthBufferTexture;
#endif
2015-01-27 16:00:06 +00:00
}
#ifndef GLES2
CachedTexture * DepthBuffer::copyDepthBufferTexture(FrameBuffer * _pBuffer)
{
if (m_copied)
return m_pDepthBufferCopyTexture;
if (m_pDepthBufferCopyTexture == nullptr) {
2017-01-01 14:59:54 +00:00
m_pDepthBufferCopyTexture = textureCache().addFrameBufferTexture(false);
_initDepthBufferTexture(_pBuffer, m_pDepthBufferCopyTexture, false);
}
2017-01-20 11:47:19 +00:00
glBindFramebuffer(GL_READ_FRAMEBUFFER, GLuint(_pBuffer->m_FBO));
glReadBuffer(GL_COLOR_ATTACHMENT0);
assert(checkFBO());
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_copyFBO);
glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
_pBuffer->m_pTexture->frameBufferTexture == CachedTexture::fbMultiSample ? _pBuffer->m_pResolveTexture->glName : _pBuffer->m_pTexture->glName,
0);
glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, m_pDepthBufferCopyTexture->glName, 0);
assert(checkFBO());
glDisable(GL_SCISSOR_TEST);
glBlitFramebuffer(
0, 0, m_pDepthBufferTexture->realWidth, m_pDepthBufferTexture->realHeight,
0, 0, m_pDepthBufferTexture->realWidth, m_pDepthBufferTexture->realHeight,
GL_DEPTH_BUFFER_BIT, GL_NEAREST
);
glEnable(GL_SCISSOR_TEST);
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
2017-01-20 11:47:19 +00:00
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, GLuint(_pBuffer->m_FBO));
m_copied = true;
return m_pDepthBufferCopyTexture;
}
#endif
void DepthBuffer::activateDepthBufferTexture(FrameBuffer * _pBuffer)
{
textureCache().activateTexture(0, resolveDepthBufferTexture(_pBuffer));
2015-01-27 16:00:06 +00:00
}
void DepthBuffer::bindDepthImageTexture()
{
2015-01-27 16:00:06 +00:00
#ifdef GL_IMAGE_TEXTURES_SUPPORT
2017-01-14 12:26:02 +00:00
glBindImageTexture(depthImageUnit, m_pDepthImageTexture->glName, 0, GL_FALSE, 0, GL_READ_WRITE,
GLenum(gfxContext.getFramebufferTextureFormats().depthImageInternalFormat));
2015-01-27 16:00:06 +00:00
#endif
}
DepthBufferList::DepthBufferList() : m_pCurrent(nullptr), m_pzLUT(nullptr)
{
m_pzLUT = new u16[0x40000];
for (int i = 0; i<0x40000; i++) {
u32 exponent = 0;
u32 testbit = 1 << 17;
while ((i & testbit) && (exponent < 7)) {
exponent++;
testbit = 1 << (17 - exponent);
}
const u32 mantissa = (i >> (6 - (6 < exponent ? 6 : exponent))) & 0x7ff;
m_pzLUT[i] = (u16)(((exponent << 11) | mantissa) << 2);
}
}
DepthBufferList::~DepthBufferList()
{
delete[] m_pzLUT;
m_pzLUT = nullptr;
m_list.clear();
}
DepthBufferList & DepthBufferList::get()
{
static DepthBufferList depthBufferList;
return depthBufferList;
}
void DepthBufferList::init()
{
m_pCurrent = nullptr;
}
void DepthBufferList::destroy()
{
m_pCurrent = nullptr;
2014-09-08 11:00:13 +00:00
m_list.clear();
}
void DepthBufferList::setNotCleared()
{
for (DepthBuffers::iterator iter = m_list.begin(); iter != m_list.end(); ++iter)
iter->m_cleared = false;
}
2014-09-08 11:00:13 +00:00
DepthBuffer * DepthBufferList::findBuffer(u32 _address)
{
2014-09-08 11:00:13 +00:00
for (DepthBuffers::iterator iter = m_list.begin(); iter != m_list.end(); ++iter)
if (iter->m_address == _address)
return &(*iter);
return nullptr;
2014-09-08 11:00:13 +00:00
}
2014-09-08 11:00:13 +00:00
void DepthBufferList::removeBuffer(u32 _address )
{
for (DepthBuffers::iterator iter = m_list.begin(); iter != m_list.end(); ++iter)
if (iter->m_address == _address) {
frameBufferList().clearDepthBuffer(&(*iter));
2014-09-08 11:00:13 +00:00
m_list.erase(iter);
return;
}
}
2014-09-08 11:00:13 +00:00
void DepthBufferList::saveBuffer(u32 _address)
{
2014-09-08 11:00:13 +00:00
if (!config.frameBufferEmulation.enable)
return;
FrameBuffer * pFrameBuffer = frameBufferList().findBuffer(_address);
if (pFrameBuffer != nullptr)
pFrameBuffer->m_isDepthBuffer = true;
DepthBuffer * pDepthBuffer = findBuffer(_address);
2014-09-08 11:00:13 +00:00
if (pDepthBuffer != nullptr && pFrameBuffer != nullptr && pDepthBuffer->m_width != pFrameBuffer->m_width) {
2014-09-08 11:00:13 +00:00
removeBuffer(_address);
pDepthBuffer = nullptr;
}
if (pDepthBuffer == nullptr && VI.height != 0) {
2014-09-08 11:00:13 +00:00
m_list.emplace_front();
DepthBuffer & buffer = m_list.front();
2014-09-08 11:00:13 +00:00
buffer.m_address = _address;
buffer.m_width = pFrameBuffer != nullptr ? pFrameBuffer->m_width : VI.width;
2015-01-27 16:00:06 +00:00
buffer.initDepthBufferTexture(pFrameBuffer);
2014-09-08 11:00:13 +00:00
pDepthBuffer = &buffer;
}
2016-07-23 05:18:27 +00:00
//Check for null since the depth buffer will not be initialized if VI.height == 0
if(pDepthBuffer != nullptr) {
DepthBuffer * pCurrent = m_pCurrent;
m_pCurrent = pDepthBuffer;
frameBufferList().attachDepthBuffer();
if (pDepthBuffer->m_address != gDP.depthImageAddress)
m_pCurrent = pCurrent;
}
2013-06-01 13:10:30 +00:00
#ifdef DEBUG
DebugMsg( DEBUG_HIGH | DEBUG_HANDLED, "DepthBuffer_SetBuffer( 0x%08X ); color buffer is 0x%08X\n",
address, ( pFrameBuffer != nullptr && pFrameBuffer->m_FBO > 0) ? pFrameBuffer->m_startAddress : 0
);
2013-06-01 13:10:30 +00:00
#endif
}
void DepthBufferList::clearBuffer(u32 _ulx, u32 _uly, u32 _lrx, u32 _lry)
{
if (m_pCurrent == nullptr)
2013-12-15 17:20:12 +00:00
return;
2017-01-14 12:26:02 +00:00
const graphics::FramebufferTextureFormats & fbTexFormats = gfxContext.getFramebufferTextureFormats();
m_pCurrent->m_cleared = true;
m_pCurrent->m_ulx = _ulx;
m_pCurrent->m_uly = _uly;
m_pCurrent->m_lrx = _lrx;
m_pCurrent->m_lry = _lry;
if (m_pCurrent->m_depthImageFBO == 0 || !Context::imageTextures || config.frameBufferEmulation.N64DepthCompare == 0)
2013-12-14 14:30:20 +00:00
return;
float color[4] = {1.0f, 1.0f, 0.0f, 1.0f};
2017-01-14 12:26:02 +00:00
glBindImageTexture(depthImageUnit, 0, 0, GL_FALSE, 0, GL_READ_WRITE, GLenum(fbTexFormats.depthImageInternalFormat));
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_pCurrent->m_depthImageFBO);
const u32 cycleType = gDP.otherMode.cycleType;
gDP.otherMode.cycleType = G_CYC_FILL;
dwnd().getDrawer().drawRect(_ulx, _uly, _lrx, _lry, color);
gDP.otherMode.cycleType = cycleType;
2017-01-14 12:26:02 +00:00
glBindImageTexture(depthImageUnit, m_pCurrent->m_pDepthImageTexture->glName, 0, GL_FALSE, 0, GL_READ_WRITE, GLenum(fbTexFormats.depthImageInternalFormat));
frameBufferList().setCurrentDrawBuffer();
2013-12-14 14:30:20 +00:00
}
2014-09-08 11:00:13 +00:00
void DepthBuffer_Init()
{
depthBufferList().init();
}
void DepthBuffer_Destroy()
{
depthBufferList().destroy();
}