1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-04 10:03:36 +00:00

Fix RE2 and NFL QB Club 98 on GLES

This commit is contained in:
Logan McNaughton 2018-04-14 19:25:34 -06:00 committed by Sergey Lipskiy
parent e958eca3ed
commit 6a10a83d09
3 changed files with 10 additions and 5 deletions

View File

@ -19,7 +19,7 @@ namespace graphics {
InternalColorFormatParam RGBA4(GL_RGBA4); InternalColorFormatParam RGBA4(GL_RGBA4);
InternalColorFormatParam RGB5_A1(GL_RGB5_A1); InternalColorFormatParam RGB5_A1(GL_RGB5_A1);
InternalColorFormatParam RG(GL_RG8); InternalColorFormatParam RG(GL_RG8);
InternalColorFormatParam RED(GL_R8); InternalColorFormatParam R16F(GL_R16F);
InternalColorFormatParam DEPTH(GL_DEPTH_COMPONENT24); InternalColorFormatParam DEPTH(GL_DEPTH_COMPONENT24);
InternalColorFormatParam RG32F(GL_RG32F); InternalColorFormatParam RG32F(GL_RG32F);
InternalColorFormatParam LUMINANCE(0x1909); InternalColorFormatParam LUMINANCE(0x1909);

View File

@ -19,7 +19,7 @@ namespace graphics {
extern InternalColorFormatParam RGBA4; extern InternalColorFormatParam RGBA4;
extern InternalColorFormatParam RGB5_A1; extern InternalColorFormatParam RGB5_A1;
extern InternalColorFormatParam RG; extern InternalColorFormatParam RG;
extern InternalColorFormatParam RED; extern InternalColorFormatParam R16F;
extern InternalColorFormatParam DEPTH; extern InternalColorFormatParam DEPTH;
extern InternalColorFormatParam RG32F; extern InternalColorFormatParam RG32F;
extern InternalColorFormatParam LUMINANCE; extern InternalColorFormatParam LUMINANCE;

View File

@ -971,16 +971,21 @@ void TextureCache::_loadDepthTexture(CachedTexture * _pTexture, u16* _pDest)
if (!config.generalEmulation.enableFragmentDepthWrite) if (!config.generalEmulation.enableFragmentDepthWrite)
return; return;
u32 size = _pTexture->realWidth * _pTexture->realHeight;
std::vector<f32> pDestFloat(size);
for (u32 i = 0; i < size; ++i)
pDestFloat[i] = _pDest[i] / 65535.0;
Context::InitTextureParams params; Context::InitTextureParams params;
params.handle = _pTexture->name; params.handle = _pTexture->name;
params.mipMapLevel = 0; params.mipMapLevel = 0;
params.msaaLevel = 0; params.msaaLevel = 0;
params.width = _pTexture->realWidth; params.width = _pTexture->realWidth;
params.height = _pTexture->realHeight; params.height = _pTexture->realHeight;
params.internalFormat = internalcolorFormat::RED; params.internalFormat = internalcolorFormat::R16F;
params.format = colorFormat::RED; params.format = colorFormat::RED;
params.dataType = datatype::UNSIGNED_SHORT; params.dataType = datatype::FLOAT;
params.data = _pDest; params.data = pDestFloat.data();
gfxContext.init2DTexture(params); gfxContext.init2DTexture(params);
} }