mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Minor code cleanup.
This commit is contained in:
parent
b9453474b6
commit
d7407d58f9
|
@ -153,28 +153,28 @@ void DepthBuffer::_initDepthBufferTexture(FrameBuffer * _pBuffer, CachedTexture
|
|||
_pTexture->textureBytes = _pTexture->realWidth * _pTexture->realHeight * fbTexFormat.depthFormatBytes;
|
||||
textureCache().addFrameBufferTextureSize(_pTexture->textureBytes);
|
||||
|
||||
{
|
||||
Context::InitTextureParams params;
|
||||
params.handle = _pTexture->name;
|
||||
params.msaaLevel = _multisample ? config.video.multisampling : 0U;
|
||||
params.width = _pTexture->realWidth;
|
||||
params.height = _pTexture->realHeight;
|
||||
params.internalFormat = fbTexFormat.depthInternalFormat;
|
||||
params.format = fbTexFormat.depthFormat;
|
||||
params.dataType = fbTexFormat.depthType;
|
||||
gfxContext.init2DTexture(params);
|
||||
}
|
||||
_pTexture->frameBufferTexture = _multisample ? CachedTexture::fbMultiSample : CachedTexture::fbOneSample;
|
||||
if (!_multisample) {
|
||||
Context::TexParameters params;
|
||||
params.handle = _pTexture->name;
|
||||
params.target = textureTarget::TEXTURE_2D;
|
||||
params.textureUnitIndex = textureIndices::Tex[0];
|
||||
params.minFilter = textureParameters::FILTER_NEAREST;
|
||||
params.magFilter = textureParameters::FILTER_NEAREST;
|
||||
gfxContext.setTextureParameters(params);
|
||||
}
|
||||
Context::InitTextureParams initParams;
|
||||
initParams.handle = _pTexture->name;
|
||||
initParams.msaaLevel = _multisample ? config.video.multisampling : 0U;
|
||||
initParams.width = _pTexture->realWidth;
|
||||
initParams.height = _pTexture->realHeight;
|
||||
initParams.internalFormat = fbTexFormat.depthInternalFormat;
|
||||
initParams.format = fbTexFormat.depthFormat;
|
||||
initParams.dataType = fbTexFormat.depthType;
|
||||
gfxContext.init2DTexture(initParams);
|
||||
|
||||
if (!_multisample) {
|
||||
_pTexture->frameBufferTexture = CachedTexture::fbOneSample;
|
||||
Context::TexParameters texParams;
|
||||
texParams.handle = _pTexture->name;
|
||||
texParams.target = textureTarget::TEXTURE_2D;
|
||||
texParams.textureUnitIndex = textureIndices::Tex[0];
|
||||
texParams.minFilter = textureParameters::FILTER_NEAREST;
|
||||
texParams.magFilter = textureParameters::FILTER_NEAREST;
|
||||
gfxContext.setTextureParameters(texParams);
|
||||
} else {
|
||||
_pTexture->frameBufferTexture = CachedTexture::fbMultiSample;
|
||||
}
|
||||
}
|
||||
|
||||
void DepthBuffer::_initDepthBufferRenderbuffer(FrameBuffer * _pBuffer)
|
||||
|
|
|
@ -85,37 +85,35 @@ void FrameBuffer::_initTexture(u16 _width, u16 _height, u16 _format, u16 _size,
|
|||
|
||||
void FrameBuffer::_setAndAttachTexture(ObjectHandle _fbo, CachedTexture *_pTexture, u32 _t, bool _multisampling)
|
||||
{
|
||||
{
|
||||
const FramebufferTextureFormats & fbTexFormat = gfxContext.getFramebufferTextureFormats();
|
||||
Context::InitTextureParams params;
|
||||
params.handle = _pTexture->name;
|
||||
params.textureUnitIndex = textureIndices::Tex[_t];
|
||||
Context::InitTextureParams initParams;
|
||||
initParams.handle = _pTexture->name;
|
||||
initParams.textureUnitIndex = textureIndices::Tex[_t];
|
||||
if (_multisampling)
|
||||
params.msaaLevel = config.video.multisampling;
|
||||
params.width = _pTexture->realWidth;
|
||||
params.height = _pTexture->realHeight;
|
||||
initParams.msaaLevel = config.video.multisampling;
|
||||
initParams.width = _pTexture->realWidth;
|
||||
initParams.height = _pTexture->realHeight;
|
||||
if (_pTexture->size > G_IM_SIZ_8b) {
|
||||
params.internalFormat = fbTexFormat.colorInternalFormat;
|
||||
params.format = fbTexFormat.colorFormat;
|
||||
params.dataType = fbTexFormat.colorType;
|
||||
}
|
||||
else {
|
||||
params.internalFormat = fbTexFormat.monochromeInternalFormat;
|
||||
params.format = fbTexFormat.monochromeFormat;
|
||||
params.dataType = fbTexFormat.monochromeType;
|
||||
}
|
||||
gfxContext.init2DTexture(params);
|
||||
initParams.internalFormat = fbTexFormat.colorInternalFormat;
|
||||
initParams.format = fbTexFormat.colorFormat;
|
||||
initParams.dataType = fbTexFormat.colorType;
|
||||
} else {
|
||||
initParams.internalFormat = fbTexFormat.monochromeInternalFormat;
|
||||
initParams.format = fbTexFormat.monochromeFormat;
|
||||
initParams.dataType = fbTexFormat.monochromeType;
|
||||
}
|
||||
gfxContext.init2DTexture(initParams);
|
||||
|
||||
if (!_multisampling) {
|
||||
Context::TexParameters params;
|
||||
params.handle = _pTexture->name;
|
||||
params.target = textureTarget::TEXTURE_2D;
|
||||
params.textureUnitIndex = textureIndices::Tex[_t];
|
||||
params.minFilter = textureParameters::FILTER_NEAREST;
|
||||
params.magFilter = textureParameters::FILTER_NEAREST;
|
||||
gfxContext.setTextureParameters(params);
|
||||
Context::TexParameters texParams;
|
||||
texParams.handle = _pTexture->name;
|
||||
texParams.target = textureTarget::TEXTURE_2D;
|
||||
texParams.textureUnitIndex = textureIndices::Tex[_t];
|
||||
texParams.minFilter = textureParameters::FILTER_NEAREST;
|
||||
texParams.magFilter = textureParameters::FILTER_NEAREST;
|
||||
gfxContext.setTextureParameters(texParams);
|
||||
}
|
||||
{
|
||||
|
||||
Context::FrameBufferRenderTarget bufTarget;
|
||||
bufTarget.bufferHandle = _fbo;
|
||||
bufTarget.bufferTarget = bufferTarget::FRAMEBUFFER;
|
||||
|
@ -123,7 +121,6 @@ void FrameBuffer::_setAndAttachTexture(ObjectHandle _fbo, CachedTexture *_pTextu
|
|||
bufTarget.textureTarget = _multisampling ? textureTarget::TEXTURE_2D_MULTISAMPLE : textureTarget::TEXTURE_2D;
|
||||
bufTarget.textureHandle = _pTexture->name;
|
||||
gfxContext.addFrameBufferRenderTarget(bufTarget);
|
||||
}
|
||||
assert(!gfxContext.isFramebufferError());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user