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

Correct texture initialization.

This commit is contained in:
Sergey Lipskiy 2017-01-26 21:36:54 +07:00
parent 8a99fe3eb5
commit ea4d174e5c
2 changed files with 3 additions and 12 deletions

View File

@ -89,6 +89,7 @@ void FrameBuffer::_setAndAttachTexture(ObjectHandle _fbo, CachedTexture *_pTextu
const FramebufferTextureFormats & fbTexFormat = gfxContext.getFramebufferTextureFormats();
Context::InitTextureParams params;
params.handle = _pTexture->name;
params.textureUnitIndex = textureIndices::Tex[_t];
if (_multisampling)
params.msaaLevel = config.video.multisampling;
params.width = _pTexture->realWidth;

View File

@ -1157,6 +1157,7 @@ void TextureCache::_load(u32 _tile, CachedTexture *_pTexture)
&ghqTexInfo) != 0 && ghqTexInfo.data != nullptr) {
Context::InitTextureParams params;
params.handle = _pTexture->name;
params.textureUnitIndex = textureIndices::Tex[_tile];
params.mipMapLevel = 0;
params.msaaLevel = 0;
params.width = ghqTexInfo.width;
@ -1177,6 +1178,7 @@ void TextureCache::_load(u32 _tile, CachedTexture *_pTexture)
gfxContext.setTextureUnpackAlignment(2);
Context::InitTextureParams params;
params.handle = _pTexture->name;
params.textureUnitIndex = textureIndices::Tex[_tile];
params.mipMapLevel = mipLevel;
params.mipMapLevels = _pTexture->max_level + 1;
params.msaaLevel = 0;
@ -1383,12 +1385,6 @@ void TextureCache::_updateBackground()
CachedTexture * pCurrent = _addTexture(crc);
Context::BindTextureParameters bindParams;
bindParams.target = target::TEXTURE_2D;
bindParams.texture = pCurrent->name;
bindParams.textureUnitIndex = textureIndices::Tex[0];
gfxContext.bindTexture(bindParams);
pCurrent->address = gSP.bgImage.address;
pCurrent->format = gSP.bgImage.format;
@ -1535,12 +1531,6 @@ void TextureCache::update(u32 _t)
CachedTexture * pCurrent = _addTexture(crc);
Context::BindTextureParameters bindParams;
bindParams.target = target::TEXTURE_2D;
bindParams.texture = pCurrent->name;
bindParams.textureUnitIndex = textureIndices::Tex[_t];
gfxContext.bindTexture(bindParams);
pCurrent->address = gDP.loadInfo[pTile->tmem].texAddress;
pCurrent->format = pTile->format;