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

153 Commits

Author SHA1 Message Date
Sergey Lipskiy
76d72f77b7 [Code refactor] Correct TextureCache::_load:
add RAII holder for texture data.
2020-08-31 11:53:41 +07:00
S2S
d13a3d7890 Perform hdRatio division with floating point precision. Allows non-integer scaled HD textures, but their use is discouraged. 2020-07-17 20:26:32 +07:00
Sergey Lipskiy
0c5d036395 Correct _calculateCRC:
calculated texture size in bytes can be too large to fit TMEM.
It leads to out-of-bounds reads in checksum calculations and thus random checksum.
Example:

Fixed Unplayable performance with any kind of texture enhancement. #2279
2020-06-16 16:57:47 +07:00
Sergey Lipskiy
7228d0d5db Separate "Dump" and "Reload" options. 2020-06-14 15:52:09 +07:00
Sergey Lipskiy
edf5f9ac30 Fix load of 16bit RGBA textures when TLUT mode is TT_IA16
Fixed #2218 Taz express: little bug
2020-05-10 20:14:53 +07:00
S2S
4834359ec1 Delay texture coordinate normalization. Adapt texture filter to texture engine. 2020-05-10 16:24:28 +07:00
Sergey Lipskiy
03b404bd4e Use noperspective shade color only for triangles with screen-space coordinates.
noperspective works incorrect for polygons, which are partially out of view.

Fixed #2240 SM64 strange green textures
2020-05-04 20:20:58 +07:00
Logan McNaughton
c168f53d12 Fix bug introduced by 85a8635952 2020-04-05 11:06:58 +07:00
Logan McNaughton
85a8635952 Update to XXH3 for CRC_OPT 2020-03-30 21:16:59 +07:00
Sergey Lipskiy
cfa3ded934 Correct tile size calculation.
Fixed #2156 Tony Hawk's Pro Skater 3- Missing Characters on Copyright Screen
2020-01-02 20:36:35 +07:00
fzurita
44ce554d5f Fix issues with EGL image public API on GLES 2.0 2019-11-30 15:54:59 +07:00
Sergey Lipskiy
5484972b37 Correct tile size calculation.
Fixed regression in Paper Mario caused by commit 5c5c218e4.
2019-10-28 20:16:24 +07:00
Sergey Lipskiy
2b0e1e64c2 Temporal workaround for crashes in TextureCache::_loadHiresTexture when mip-mapped textures loaded.
See #1711 for details.
2019-10-26 18:57:28 +07:00
Sergey Lipskiy
98d906d4e0 Correct tile height calculation.
Fixed Neon Genesis Evangelion glitches #2102
2019-10-16 13:43:50 +07:00
Sergey Lipskiy
0338f27225 Do not shift texture coordinates by 0.5 for point-sampled textures.
Attempt to fix texture mapping issue from #2097.
2019-10-14 14:11:24 +07:00
Sergey Lipskiy
cffeab2f0f Fixed backgrounds load in Bakuretsu Muteki Bangaioh (J). 2019-10-12 23:57:10 +07:00
Sergey Lipskiy
5bab3c155f Fix crashes in Bakuretsu Muteki Bangaioh (J) 2019-10-12 01:03:14 +07:00
Sergey Lipskiy
5c5c218e41 Correct tile size calculation.
Fixed text in Zelda debug rom. See bug reported by AriaHiro64 in #1885
2019-08-21 12:39:53 +07:00
Sergey Lipskiy
c28ea61b8f Fix for texture issues in Stunt Racer, reported by DonelBueno in #1885
Stunt Racer uses combiner with two textures for track polygons, but actually loads only T0.
T1 replaced by T0 because of LOD flags in othermode.
This situation was not checked in the main code and ClampWrapMirror shader got wrong parameters,
which lead to the glitches.
2019-08-16 19:10:09 +07:00
Sergey Lipskiy
947fedcbb5 Code cleanup: remove unused getMirrorClamp function. 2019-08-16 17:47:20 +07:00
Sergey Lipskiy
83dde99f6b Fix TextureCache::_loadHiresTexture: use correct tile when gSP.texture.tile != 0 2019-06-19 19:02:57 +07:00
Sergey Lipskiy
2d712f2ae0 Rewrite textures loading and mapping:
- use RiceVideo method for texture size calculation.
  RiceVideo uses the same method for texture dumping.
- rewrite texture mapping.
  Texture Clamp-Wrap-Mirror implemented in shaders.

Problem explanation:
https://github.com/gonetz/GLideN64/issues/1885#issuecomment-485136358

Fixed various glitches with HD textures, #1885
2019-06-19 19:02:52 +07:00
Sergey Lipskiy
fc96b78542 Fix load of 4bit CI textures when TLUT mode is off. Correction for commit 98960950
Fixed color of the glove in Doubutsu no Mori sub-screen.
2019-03-23 12:37:38 +07:00
Sergey Lipskiy
989609505c Fix load of 4bit CI textures when TLUT mode is off.
Fixed Goemon - Mononoke Sugoroku: wrong gfx #1892
2019-03-06 18:36:40 +07:00
Sergey Lipskiy
e13a2ffd6b Correct gDPLoadTileInfo bytes calculation for 32bit textures.
Fixed ready 2 rumble 2 : wrong gfx in intro #2021
2019-03-05 16:06:26 +07:00
Sergey Lipskiy
3704b37c3e Fix some of PVS-Studio warnings. 2019-03-03 11:47:10 +07:00
Sergey Lipskiy
f55283e32f Fix CRC calculation for mip-mapped textures.
Fixed green smear on mipmaps in Turok, #1558
2019-02-25 15:44:56 +07:00
Sergey Lipskiy
19cf24f701 Apply "Disable enhancement for backgrounds" option only for S2DEX background commands.
Related to Ocarina of time - Temple of time issue #1984
2019-02-24 19:47:28 +07:00
Sergey Lipskiy
49465a094d Implement dump of background textures. 2019-02-19 12:49:40 +07:00
Sergey Lipskiy
9bf36d390a Implement 3-point texture filtering for mipmapped textures.
Fixed #1558 3-point texture filtering doesn't work with mipmapped textures.
2019-02-16 20:45:51 +07:00
Sergey Lipskiy
edc81952ab Fix texture unpack alignment for filtered textures.
Fixed #1412: Enhancements cause buggy texture elements.
2019-02-15 17:44:45 +07:00
Sergey Lipskiy
2aeff6caa5 Fix tile size when it is loaded by BgCopy with LoadBlock.
BgCopy set dimensions for tile0 to zero.
We can't use dimensions of load tile either because of CopyBlock.
The only way to find size of loaded texture is to use coordinates of texrect.
There is one-to-one correspondence between rect pixels and texture texels in copy mode,
so we can safely use it in this case.
2019-02-02 18:34:10 +07:00
Sergey Lipskiy
aab318b4f7 Fix tile load for BG commands. 2019-02-02 18:34:08 +07:00
Sergey Lipskiy
9ac633d2ea Add originalMaskT, originalMaskS fields for struct gDPTile.
masks and maskt set by gDPSetTile, but _calcTileSizes may change them if actual
tile dimension do not correspond the mask. This creates problem for S2DEX_BG_1Cyc command,
which set tile masks and maskt to maximum, while actual size of loaded tiles may vary.
_calcTileSizes may set new values for masks and maskt, which are valid for the current tile but invalid for next ones.
Thus, original values of tile masks and maskt must be restored when tile size calculated again in _calcTileSizes.
2019-02-02 18:34:08 +07:00
Sergey Lipskiy
a44d5a8960 Fix condition to apply hardware texture filtering:
FILTER_LINEAR must be used only if the current combiner uses LOD.
2018-10-18 11:14:34 +07:00
gizmo98
35099ec8cb Backgrounds: Fix cut off textures and texture fragments and seams
-Fix cut off textures in hamster64. Enable coord correction if
gDP.otherMode.textureFilter == G_TF_BILERP.
-Fix seams in hamster64 and texture fragments in starcraft64. Enable
texture clamp if lrs/lrt <= (imageW/imageH - 1).
2018-10-13 19:09:24 +07:00
Sergey Lipskiy
9f936be57e Correct condition for texture filtering: remove (gSP.objRendermode&G_OBJRM_BILERP) != 0 from the condition.
It seems that flag G_OBJRM_BILERP in objRendermode does not mean that texture will be filtered.
2018-09-30 18:03:46 +07:00
Logan McNaughton
6ddaba8ec5 Remove FB Attachment caching 2018-05-08 16:27:37 +07:00
Sergey Lipskiy
10710f96ac Fix warnings from compiler and static code analizer. 2018-05-06 15:28:07 +07:00
Sergey Lipskiy
75ea06cec7 Code refactoring: fix issues found by static code analizer. 2018-04-19 20:16:21 +07:00
Logan McNaughton
6a10a83d09 Fix RE2 and NFL QB Club 98 on GLES 2018-04-16 21:38:42 +07:00
Logan McNaughton
18e9a73eba Cache SpecialFeatures check 2018-04-07 11:30:33 +07:00
Logan McNaughton
b49ee1dd8b Fix GLESX clipping hack in GraphicsDrawer 2018-04-07 11:30:33 +07:00
Sergey Lipskiy
7aeb1018ea Fix texture size calculation and texture load.
Fixed Missing Ground Textures in Super Smash Bros. #1716
2018-03-11 14:43:16 +07:00
Logan McNaughton
91ab96d514 Fix FB attachment caching when texture is deleted 2018-03-09 20:32:34 +07:00
Logan McNaughton
cb90bb95ed Cleanup FB Texture caching code 2018-02-26 21:15:51 +07:00
Sergey Lipskiy
210315ec46 Fix texture filtering when mip-mapiing is off, #1699 2018-01-03 17:09:23 +07:00
Sergey Lipskiy
2e53bf19a0 Fix CRC calculation for 32bit textures. 2017-12-16 15:14:46 +07:00
Sergey Lipskiy
26623cec1f Code cleanup: fix issues in GLideN64 found by static code analyser. 2017-11-18 22:07:27 +07:00
Sergey Lipskiy
e1c7a44593 Force texture wrap/mirror for hires textures when texture size is half of real (load) texture size.
Fixed Majora's Mask - custom textures broken on moon #1662
2017-11-18 15:31:02 +07:00