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

2236 Commits

Author SHA1 Message Date
s2s
7e8265bf20 Apply texture shift and offset on a per pixel basis. Clean texture engine code. 2021-07-29 14:06:33 +07:00
s2s
73b2d0060b Change LOD calculation formula. Use the maximum value of the change of S and T per change in X and Y. 2021-07-27 18:14:58 +07:00
Rosalie Wanders
1ad662092d Fix building zilmar-spec with cmake with mingw 2021-07-23 12:29:36 +07:00
Rosalie Wanders
4a55160770 GLideNUI: add Qt6 compatibility 2021-07-23 12:27:02 +07:00
oddMLan
61ff59d24b Add OSD Statistics checkbox to WTL 2021-07-23 12:24:13 +07:00
oddMLan
a59bd2eb00 Fix oversight in OSD statistics (GLideNUI-Qt)
It wasn't saving the setting properly with custom game settings.
2021-07-23 12:24:13 +07:00
Sergey Lipskiy
5072ec8ee8 Fix anisotropic filtering.
Fixed #2527 Is anisotropic filtering always ON
2021-07-22 22:17:07 +07:00
Rosalie Wanders
14229b93ba Fix Project64 when statusbar is hidden 2021-07-21 19:58:15 +07:00
s2s
81ac29a04f Fix an overlook in 213c10d 2021-07-21 19:56:11 +07:00
Rosalie Wanders
94dd897b5d GLideNUI: fix multisampling causing odd UI behavior
Fixes #2524
2021-07-21 19:55:07 +07:00
s2s
213c10d6de Restore equivalent to old code for nativeResFactor=0 2021-06-13 21:54:52 +07:00
s2s
ce1fb27cf7 Fix detection of native-res texture rectangle when computing the texture coordinate offset. 2021-06-13 21:54:52 +07:00
Sergey Lipskiy
66e8ff3c00 Drop render state after drawing a primitive, in gDPFullSync() and
GraphicsDrawer::copyTexturedRect to avoid wrong use of TexCoordBounds heuristics.

Fixed flickering in the starcraft intro when it transitions from picture to picture.
2021-06-06 18:57:33 +07:00
Gillou68310
c8a25914bc Fix wrong buffer height in PostProcessor 2021-06-05 21:06:32 +07:00
Francisco Zurita
15668b9064 Wait for buffer to be empty before reallocating memory 2021-05-26 23:02:15 +07:00
Francisco Zurita
e9d08c33bd Temporary fix for NVidia shaking on Windows 2021-05-26 23:02:15 +07:00
Sergey Lipskiy
be851a3b45 Fix rect coordinates in TexrectDrawer::draw()
Fixed #2501 Blending issue with native-res texrects enabled.
2021-05-23 22:57:53 +07:00
s2s
acfb569dea Use a 640x640 bounding box for screen coordinates.
A smaller bounding box allows rendering in higher resolutions. It should be made bigger if geometry is clipped.
2021-05-15 23:31:10 +07:00
Sergey Lipskiy
7abf593da3 Set m_cleared to false in FrameBuffer::copyRdram().
m_cleared means that the RDRAM buffer contains only fillcolor.
It should be false after copyRdram() since from now the buffer validity check should work with m_RdramCopy.

It Fixes Kirby 64 broken level selection, #2491
Without this fix, the level selection is broken when copy color to RDRAM is disabled
2021-05-15 20:44:07 +07:00
fzurita
f4a0019acf Fix GLES 2.0 GLSL shader compilation error. 2021-05-02 18:24:11 +07:00
fzurita
f5e73a8081 Bind to the current frame buffer FBO when copying auxiliary buffers to
RDRAM
2021-05-02 18:24:11 +07:00
fzurita
6ee8c71bf0 Only try to use an EGLImage if initialization of it was successful 2021-05-02 18:24:11 +07:00
fzurita
0cf810416b Destroy EGL image after we are done with it 2021-05-02 18:24:11 +07:00
Sergey Lipskiy
d93efe0c30 Fixed #2488 compilation on Fedora 34 2021-05-02 17:07:08 +07:00
fzurita
c5d942b436 Fix crash when trying to delete invalid frame buffer 2021-05-01 17:02:28 +07:00
Sergey Lipskiy
4049f7d1ff Fix culling with software clipping.
fixes #2485 Invisible textures in Fighting Force 64 (USA)
      #2447 Graphical issues in Diddy Kong Racing
2021-04-28 19:20:44 +07:00
s2s
02d12d180d Change heuristic when using non-multiple-of-native rendering resolutions.
The games behave unpredictably at random rendering resolutions, so a simpler heuritic is used.

Fixes #2482
2021-04-28 17:37:12 +07:00
Sergey Lipskiy
827cc2294f Set video.threadedVideo off by default (except for Android), as suggested in #2479 2021-04-21 11:02:49 +07:00
Sergey Lipskiy
e85e0f4a5f Fix issues in ColorBufferToRDRAM::_prepareCopy:
* remove an optimization: don't update current buffer if it is the same for the current frame.
This optimization causes crash in Zelda OOT pause screen with "aux buffer copy" enabled.
* fix width calculation for aux buffers when "aux buffer copy" enabled.
2021-04-20 23:32:27 +07:00
Sergey Lipskiy
fe869cf5d2 Add hotkey to toggle 2D texrects in native resolution. 2021-04-19 21:55:00 +07:00
Sergey Lipskiy
370e57b131 Add hotkey for "EnableTexCoordBounds" setting. 2021-04-19 21:55:00 +07:00
s2s
e70c9bfcd7 fix native rects 2021-04-19 21:55:00 +07:00
s2s
4aa7fe9fc2 Change heuristic to render texture rectangles 2021-04-19 21:55:00 +07:00
s2s
f94ffe2b9d Increment shader storage version number 2021-04-19 21:55:00 +07:00
Sergey Lipskiy
aa6e549e17 Support "enableTexCoordBounds" config option in Qt GUI. 2021-04-19 21:55:00 +07:00
s2s
4e0a0186f5 Add config option for texture coordinate bounds 2021-04-19 21:55:00 +07:00
s2s
cdd1dcc438 Use texture coordinate bounds for non-native resolutions 2021-04-19 21:55:00 +07:00
s2s
acf26e613d Apply a vertex position or texture coordinate shift to approximate N64 rasterization rules 2021-04-19 21:55:00 +07:00
s2s
39153304e1 Workaround for framebuffer textures 2021-04-19 21:55:00 +07:00
s2s
fe244c5560 Update widescreen hack 2021-04-19 21:55:00 +07:00
Sergey Lipskiy
3d67ac4630 Fix clipping 2021-04-19 21:55:00 +07:00
Sergey Lipskiy
e2e0214719 Fix texrect drawer. 2021-04-19 21:55:00 +07:00
s2s
81318c5445 Use screen coordinates to render primitives 2021-04-19 21:55:00 +07:00
fzurita
1d90610782 Fix EGL image being broken at 1x native resolution factor 2021-04-19 21:50:55 +07:00
fzurita
43a5d16905 Keep a color copy FBO and texture per N64 frame buffer 2021-04-19 21:50:55 +07:00
fzurita
5f7a7cadc2 Stop using predefined texture sizes introduced for Android
For Android we use EGL image for async copies and for sync copies and
devices that don't support EGL image, the fixed texture sizes don't seem
to improve performance.
2021-04-19 21:50:55 +07:00
Logan
7a6289b270 Fix N64 Depth Compare on Intel PC 2021-04-14 21:07:22 +07:00
Sergey Lipskiy
d27ce4781f Fix calculation of clamping parameters for texture engine:
use integer part of tile coordinates to calculate tile dimensions.

Fixed texture glitches io topgear overdrive, #2464
2021-03-18 16:35:57 +07:00
Sergey Lipskiy
e31b7b7045 Fix issues in renderAndDrawTriangles.
Fixed regression with Paper Mario Lantern Ghost Boss Fight #2468
2021-03-16 00:20:31 +07:00
Sergey Lipskiy
92c9bd8408 Fix issues with software clipping:
* fixed max screen Y calculation. It fixes bug in Top Gear Overdrive, #2450
* fixed typo in rasterise().
2021-03-02 21:44:07 +07:00
Sergey Lipskiy
e07b09b4d0 Add Statistics OSD info.
Show number of drawn rects, lines and triangles per frame.
2021-02-28 19:50:05 +07:00
fzurita
063fdae46e Don't allow EGL image on tegra devices 2021-02-22 13:03:21 +07:00
Sergey Lipskiy
e09d153233 Do not test values of 8bit buffer before write them to RDRAM.
Fixed copy of 8bit aux buffers to RDRAM.

refs #2461
2021-02-21 15:41:56 +07:00
fzurita
35554dabf0 Fix N64 Depth compare with Adreno 2021-02-17 16:58:28 +07:00
Sergey Lipskiy
442d4ed894 Fix near-palne clipping for GLES.
Fixes #2449 Cruis'n world invisible car
2021-02-14 01:00:10 +07:00
s2s
090b38e2d3 Optimize coverage computation algorithm 2021-02-13 15:26:25 +07:00
Sergey Lipskiy
7a0dd7ff1a Fixes in software clipping:
fixed culling when viewport is negative.

Fixed Graphical issues in Diddy Kong Racing #2447
2021-02-07 18:47:12 +07:00
fzurita
f48b158c0d Fix usage of GL extension GL_EXT_draw_elements_base_vertex 2021-02-07 11:39:19 +07:00
fzurita
dc6340bfff Fix issue where the barycoords vertex attribute was not being disabled 2021-02-04 20:06:43 +07:00
fzurita
c92d13c094 Improve the draw elemenets base vertex check 2021-02-04 20:05:13 +07:00
Rosalie Wanders
31b38a7a2b GLideNHQ: add wildcard support 2021-02-02 17:55:14 +07:00
Sergey Lipskiy
88e606de95 Another fix for texrect lower y. Follow-up 1e915af.
Fixed #2402 Wave race, black lines in texrects [Regression].
2021-01-31 21:25:27 +07:00
Sergey Lipskiy
7d237650ef Correct texture coordinates calculation in gSPSprite2DBase.
Fixed WipEout 64 Texture Pack #2423
2021-01-24 19:40:47 +07:00
fzurita
85ad11bbdd GLideN64 soft vertex clipping performance improvement for Adreno GPUs 2021-01-22 15:14:46 +07:00
fzurita
e129d66c22 Compile shader from keys if shader storage binary is invalid 2021-01-20 22:47:33 +07:00
Sergey Lipskiy
402cf6f8b6 Implement software vertex clipping. 2021-01-20 17:07:23 +07:00
fzurita
8b75b5dc96 Fix incorrect width used for sync color buffer reads with EGLImage 2021-01-20 16:42:35 +07:00
S2S
eb8ac40136 Revert 538674d
Fixes Oak's Check with CopyColorFromRDRAM enabled
2021-01-08 23:00:42 +07:00
Sergey Lipskiy
1c7b8914bc Revert cmake version back to 2.6 for GLideNHQ because it don't compile on Mac with 3.9 2021-01-06 12:30:42 +07:00
Sergey Lipskiy
a44b58add1 Fix warnings.
refs #2428
2021-01-05 14:17:58 +07:00
fzurita
2aa18a8ac7 Fix recently introduced GLES 2.0 GLSL compilation errors 2021-01-05 13:40:47 +07:00
Sergey Lipskiy
ad272060f7 Disable coverage by default.
Fixes #2426
2021-01-03 21:55:08 +07:00
Rosalie Wanders
66051912c5 TextDrawer::drawText: add setScissor 2020-12-31 11:44:45 +07:00
Sergey Lipskiy
955c2f3b17 Add isHWLSupported bit to CombinerKey.
A game may use several microcodes, where some microcodes support HW lighting and others are not.
The same combiner can be used for both cases. isHWLSupported bit helps to resolve that problem.
2020-12-28 16:18:18 +07:00
Sergey Lipskiy
f9ef2bd8fb Remove old LLE code. 2020-12-27 21:48:45 +07:00
Jj0YzL5nvJ
1ccdec39af Avoid more problems with spaces and drop AWK 2020-12-27 15:56:32 +07:00
oddMLan
af0b9382fe [UI-wtl] Fix texture dir saving
Also: Attempt to mkdir directory if typed/copied to the edit field (ported from 6d47fa5c48)

Fixes issue #2330
2020-12-27 15:51:02 +07:00
oddMLan
3d5311d180 Add pixel coverage checkbox to GLideN64-wtl 2020-12-27 13:11:38 +07:00
Sergey Lipskiy
ca68dc3675 Do not fail if indices of barycoords attributes are greater or equal to max vertex attributes. 2020-12-27 13:11:32 +07:00
S2S
2f8372c113 Cleanup coverage calculation 2020-12-27 12:20:46 +07:00
S2S
a214ab822e Standarize the number of barycentric coordinate vertex attributes.
Use only two coordinates as vertex attributes for triangles to match the number of coordinates rectangles use. The third one can be computed in the vertex shader.
2020-12-27 12:20:42 +07:00
Sergey Lipskiy
47054eabc0 Add enableCoverage setting.
Not implemented for GLideNUI-wtl yet.
2020-12-27 12:20:39 +07:00
Sergey Lipskiy
2233cf9f04 Support 'barycoords' vertex attribute in unbuffered drawer. 2020-12-27 12:20:35 +07:00
S2S
61172283c1 Update blender to use coverage 2020-12-27 12:20:19 +07:00
S2S
fa848dc3f9 Fix issue with dual source blending 2020-12-27 12:01:16 +07:00
S2S
fdf3bc4f21 Compute coverage value 2020-12-27 12:01:16 +07:00
S2S
486cf59614 Load barycentric coordinates as vertex attributes 2020-12-27 12:01:16 +07:00
Sergey Lipskiy
192317955e Limit maxMSAALevel by 16. 2020-12-26 10:24:00 +07:00
Rosalie Wanders
ddec3866a7 Implement cross-platform max MSAA level detection 2020-12-26 10:23:54 +07:00
Sergey Lipskiy
f04ac8296d Implement max MSAA level detection.
Zilmar spec and Windows only.

Fixes #2216 MSAA max not 16x in UI
2020-12-26 09:51:32 +07:00
Rosalie Wanders
deb84826e4 Implement linux support for OSD font settings 2020-12-25 20:19:54 +07:00
Rosalie Wanders
6d47fa5c48 GLideNUI: attempt to mkdir texture pack directories 2020-12-25 20:03:52 +07:00
Rosalie Wanders
1833971dc5 GLideNUI: correct macro in saveCustomRomSettings 2020-12-25 19:59:42 +07:00
Sergey Lipskiy
8d028a9eaf Add debug option to force enable unbuffred drawer. 2020-12-23 17:09:55 +07:00
fzurita
3b6aa38b14 Disable "draw_elements_base_vertex" extension if renderer is PowerVR and
GLES is < 3.2
2020-12-21 12:02:04 +07:00
fzurita
c39df6b8c2 Fix issues with post processing and scaling changes 2020-12-20 18:38:20 +07:00
fzurita
8f387f2d08 Enable blast corps hack for frame buffer fetch blending 2020-12-20 18:26:58 +07:00
fzurita
02e6ccb3ef Fix missing check for frame buffer fetch in unemulated blending modes 2020-12-20 18:26:58 +07:00
fzurita
895401f981 Cleanup unneeded code 2020-12-17 17:57:37 +07:00
Sergey Lipskiy
8500bc08e2 Add hotkey for "force gamma correction" setting.
Fixed #2318 Request: Keyboard shortcut to enable Custom Gamma Correction Levels
2020-12-05 17:35:02 +07:00
Sergey Lipskiy
22842a56fc Disable all hotkey by default.
Fixes #2394 Can't disable or change default hotkeys for GLideN64
2020-12-05 16:02:06 +07:00
Sergey Lipskiy
93524b65f7 Fix compilation of GLideNUI-WTL.
Hotkeys are not supported in wtl ui yet.
2020-12-02 18:14:08 +07:00
Rosalie Wanders
1e07bbcbb0 osal_keys_unix: add linux support 2020-12-02 18:14:08 +07:00
Sergey Lipskiy
abb9108f14 Implement configurable hotkeys. 2020-12-02 18:14:08 +07:00
Sergey Lipskiy
7a38e80448 Correct TxFilter::TxFilter - remove colon in rom name. 2020-11-25 16:58:48 +07:00
dankcushions
cb76d2f39d Added check for GL_EXT_draw_elements_base_vertex 2020-11-25 12:49:27 +07:00
dankcushions
0e228e9109 Removed GLES version check for glBufferStorage, allowing for any device that supports it. 2020-11-25 12:47:03 +07:00
Rosalie Wanders
3df9b2c312 DisplayWindowMupen64plus: disable WithRate function on any failure 2020-11-23 14:51:28 +07:00
Rosalie Wanders
07ce8f7bcb FrameBuffer: don't resolve multisampled texture when m_pResolveTexture is null 2020-11-23 14:48:58 +07:00
Rosalie Wanders
5f1803ab29 Introduce pluginNameWithRevision 2020-11-19 16:50:32 +07:00
S2S
bb05409c16 Disable clamping for special textures 2020-11-16 10:40:47 +07:00
fzurita
e89f5fedcc Fix build error and warning with Android 2020-11-16 10:39:10 +07:00
Sergey Lipskiy
78c89fbbfd Fix some of PVS-Studio warnings. 2020-11-14 20:00:19 +07:00
Sergey Lipskiy
46c65776a0 Code refactor and cleanup:
* type cast fixes
* signed/unsigned fixes
* code formatting fixes
* class members initialization fixes
2020-11-14 16:54:28 +07:00
Sergey Lipskiy
ddd93673d8 Fixed some undefined behaviour errors found in #2364 2020-11-14 16:50:50 +07:00
gizmo98
ec02cc722f Spread bayer matrix
Multiplay matrix values with 2.0f so values are better spread between
1.0 and 0.0.
2020-11-13 10:08:04 +07:00
gizmo98
93ddc890e2 Use angrylion's magic square matrix
We use a precalculated matrix for float color values. It’s angrylion’s
matrix divided bei 16.0f * 2.0f.
2020-11-13 10:08:04 +07:00
fzurita
9aec59056f Fix some shader compilation issues 2020-11-11 13:34:45 +07:00
S2S
ff62e3cf18 Cleanup blending code
Abstract extension specific code to fragment shader header
2020-11-11 13:34:45 +07:00
fzurita
f01405bc75 Implement N64 blending using framebuffer fetch extensions 2020-11-11 13:34:45 +07:00
fzurita
d509758b6f Disable dual source blending for Adreno, it causes GPU driver crashes 2020-11-11 13:34:45 +07:00
fzurita
1b70d5b145 Fix shader compilation errors with Adreno GPUs with hybrid filter 2020-11-11 13:34:45 +07:00
Sergey Lipskiy
e81022ad71 Correct _calculateCRC:
tile tmem address can be set to a value greater than 512, that is above TMEM size.
It should be used with proper mask for tileTmemInBytes calculation.

Fixed #2360 Castlevania 64 Crash
2020-11-10 15:41:35 +07:00
Sergey Lipskiy
b6e030c8b8 [Code cleanup] Fix spaces. 2020-10-31 15:40:03 +07:00
gizmo98
e5d59a6394 Use angrylion's bayer matrix
https://github.com/gonetz/GLideN64/issues/2359

We use a precalculated matrix for float color values. It’s angrylion’s
matrix divided bei 16.0f.
https://github.com/project64/angrylion-rdp/blob/093754a4a53437925824317a
b22ce6a56748fe14/n64video.cpp#L2509
2020-10-31 13:55:10 +07:00
purplemarshmallow
909cf172b9 correct "remove hack_texrect_shade_alpha"
fix regression  #2369
2020-10-31 12:18:57 +07:00
gizmo98
4981503bfc Code refactor: add vi status constants 2020-10-29 16:55:37 +07:00
Logan
cf7b3c84ce Protect against addressing nullptr 2020-10-29 16:51:27 +07:00
fzurita
c7144d0775 Fix issues with EGL image with Intel GPUs 2020-10-18 12:23:45 +07:00
Logan McNaughton
42c196c30a Update xxHash to 0.8.0 2020-10-12 13:25:53 +07:00
S2S
5fa66762b3 Define STVEC in an Intel friendly way. 2020-10-12 12:58:14 +07:00
Jj0YzL5nvJ
b5a6b3b1e2 Avoid problem with spaces 2020-10-12 12:56:14 +07:00
Rosalie Wanders
b200b33b84 DisplayWindow: introduce _restart()
DisplayWindowMupen64plus: m_resize{Width,Height} moved from _resizeWindow() to _restart()
2020-10-08 16:13:24 +07:00
purplemarshmallow
9a69fe8e58 remove hack_texrect_shade_alpha 2020-10-08 15:57:35 +07:00
Rosalie Wanders
00dac336f8 GLideNUI: detect application instance dynamically 2020-10-02 17:08:31 +07:00
Rosalie Wanders
4f5a763666 getRevision: silence error if Revision.h doesn't exist 2020-10-01 18:09:20 +07:00
Rosalie Wanders
80ecddd574 GLideNUI: Fix sprintf deprecation warning 2020-10-01 18:06:44 +07:00
Sergey Lipskiy
3dfa0e7622 [Code cleanup] Fix code formatting in mupen64plus_DisplayWindow.cpp in accordance with the rest of the code. 2020-10-01 18:05:24 +07:00
Rosalie Wanders
3179b37e8a Fix _resizeWindow for M64P_GLIDENUI 2020-10-01 18:00:30 +07:00
Rosalie Wanders
1f5f9874d9 Correctly implement FindPluginPath for Windows 2020-09-19 21:53:24 +07:00
Rosalie Wanders
229a6bc788 Correctly implement FindPluginPath for Linux 2020-09-16 19:05:17 +07:00
Rosalie Wanders
366ff85de3 Allow GLideNUI to work with mupen64plus
* Update the mupen64plus API headers
  * Add the new video extension functions in the opengl wrappers
  * Pull new headers from upsteam mupen64plus-core

* Modify CMakeLists.txt
  * Add GLideNUI source files
  * Expose new MUPENPLUSAPI_GLIDENUI option
    * This allows you to compile GLideN64 for mupen64plus with GLideNUI
    * NOTE that this only works with front-ends which call PluginConfig

* Move src/windows/Config_windows.cpp to src/GLideNUI/Config_GLideNUI.cpp
  * This makes more sense because it's not windows-exclusive anymore

* Add src/GLideNUI/fullscreenresolutions_mupen64plus.cpp
  * This allows GLideNUI to enumerate the fullscreen refresh rates and resolutions

* Modify src/Graphics/OpenGLContext/mupen64plus/mupen64plus_DisplayWindow.cpp
  * This modification allows mupen64plus with GLideNUI to use the selected fullscreen resolution and refresh rates

* Expose a new PluginConfig function which calls Config_DoConfig()
  * NOTE that this only works with front-ends which call this function
  * NOTE that this technically breaks the mupen spec
2020-09-16 19:02:46 +07:00
Sergey Lipskiy
35567da2ad Modifications for mip-mapped textures load.
Treat specail case for Southern Swamp grass texture, Zelda MM, #2315
2020-09-16 18:50:55 +07:00
Sergey Lipskiy
1e915af002 Correct gDPTextureRectangle:
use ceil(lry) instead of max(lry, uly + 1.0f)
It fixes the issue with zero height rectangles,
which often contain a garbage, see #2157
2020-09-16 18:49:53 +07:00
Sergey Lipskiy
15cbdc6593 [Code refactor] Remove redundant code. 2020-08-31 11:53:50 +07:00
Sergey Lipskiy
76d72f77b7 [Code refactor] Correct TextureCache::_load:
add RAII holder for texture data.
2020-08-31 11:53:41 +07:00
oddMLan
1111a7636c Add missing settings to Zilmar-spec from Mupen-spec
This allow testing these settings more easily with a Zilmar-spec emulator by just editing the ini
2020-08-14 17:29:04 +07:00
oddMLan
38fd50414f Fix downscaling aliasing caused by 2f5280c 2020-08-14 17:29:04 +07:00
oddMLan
d7d68c4667 GLideN64.sln: Add TinyXML++ and ts2lang projects
This will allow seamless translation from .ts to .Lang files compatible with the WTL GUI
2020-07-17 21:44:08 +07:00
oddMLan
e808510b86 [GLideNUI-wtl] Always use internal English strings (ignore gliden64_en.Lang) 2020-07-17 21:44:08 +07:00