Commit Graph

6548 Commits

Author SHA1 Message Date
zeromus ed92e1ef68 get rid of printf warnings 2019-03-17 22:02:40 -04:00
rogerman fe9541b448 NDSSystem.cpp: Make firmware loading more robust. 2019-03-10 00:57:16 -08:00
rogerman 8fa60fafd3 Firmware: Ensure that memory leaks don't happen when errors occur. 2019-03-10 00:53:26 -08:00
rogerman 42817475c2 OpenGL Renderer: Fix bug where Edge Mark and Fog were not properly being handled when the framebuffer is cleared using a clear image, such as in "Sonic Chronicles: The Dark Brotherhood". (Regression from commit 0dab591.) 2019-02-06 23:17:35 -08:00
rogerman bb25742512 GPU: Fix some compiler warnings. 2019-02-06 18:43:11 -08:00
rogerman fa8cf5a6dc OpenGL Renderer: Fix bug where the Special Zero Alpha Blending option would cause graphical glitches in certain games while MSAA was enabled on GPUs that support the GL_ARB_sample_shading extension. (Regression from commit e4ec1d6.) 2019-02-06 17:57:44 -08:00
rogerman 3c87d8b268 OpenGL Renderer: In GLX, there is no need to load glBlendEquation(), which is an OpenGL v1.2 function, since the current version of GLX (v1.4, circa 2005) implicitly supports OpenGL v1.3. Fixes #254. (Regression from commit ef3e93b.) 2019-02-06 10:23:17 -08:00
rogerman ee7d707acf OpenGL Renderer: Fix compiling for non-Cocoa ports. (Regression from commit ef3e93b.) 2019-02-05 11:58:31 -08:00
rogerman ef3e93b4e9 OpenGL Renderer: Fog rendering now uses dual-source blending if available. (OpenGL 3.2 only.) 2019-02-05 02:43:20 -08:00
rogerman fc4f12efd0 OpenGL Renderer: In the shaders, replace texture() with texelFetch() wherever appropriate. (OpenGL 3.2 only.)
- Also do some minor code cleanup.
2019-02-05 01:57:20 -08:00
rogerman e433a6d80e SoftRasterizer: Fix a bug where some games would occasionally have unreliable rendering or precipitous performance drops. (Regression from commit e06d11f.) 2019-02-04 23:40:15 -08:00
rogerman 242ccb26cf GFX3D: Oops! Make the clipper modes actually work as intended instead of ALWAYS using ClipperMode_Full. 2019-02-02 20:39:47 -08:00
rogerman 4f8b788e97 Render3D: Refactor the Render3D class in order to better reflect how the 3D renderers do things now. 2019-02-01 17:57:33 -08:00
rogerman 3e73a550e3 OpenGL Renderer: Ensure that all color attachments are assigned sequentially without gaps, and ensure that fragment shaders write out a value to each assigned attachment in all cases. This is being done to try and satisfy extremely picky AMD drivers that can do crazy-go-nuts things when the color attachments are not meticulously managed this way. 2019-01-29 16:50:47 -08:00
rogerman e4ec1d634a OpenGL Renderer: Better emulate the special NDS rendering quirk for drawing front-facing fragments on top of back-facing opaque fragments. Completely fixes the Customize screens in Sands of Destruction. (Related to commit 8944328.)
- Specifically, translucent polygons now properly render on top of the back-facing opaque fragments from the opaque polygon rendering pass. Do note that emulating this special NDS rendering quirk is still not complete, as it does not account for drawing any translucent polygons on top of the opaque fragments of back-facing partially-translucent alpha-textured polygons. However, I have not seen any games that actually go so deep into such an edge case. If there is such a game, then this issue will need to be revisited.
- Now that this special rendering quirk is more accurate, this does cost some performance. However, since this rendering quirk is controlled by the "Enable Depth L-Equal Polygon Facing" option, which is OFF by default, this performance loss is deemed acceptable in favor of the increased accuracy.
2019-01-29 01:20:13 -08:00
zeromus 1c937adb9e fix #250, probably 2019-01-27 12:24:35 -05:00
rogerman e06d11f6df GFX3D: The polygon clipping stage now occurs before any polygon sorting, allowing for the sorting of smaller lists. This can be a significant performance improvement for some 3D scenes with high polygon counts.
- 3D renderers no longer perform polygon clipping themselves, instead relying on GFX3D to do it. By default, the clipping mode is ClipperMode_DetermineClipOnly, but 3D renderers can change this by overriding the virtual method Render3D::GetPreferredPolygonClippingMode() and returning their preferred clipping mode.
2019-01-23 16:03:09 -08:00
rogerman b8e85e0c9d OpenGL Renderer: Revert the texture sampling hack in commit 02cd950 -- it causes graphical glitches in Sands of Destruction, especially visible within the Sky Gaol. 2019-01-23 14:44:47 -08:00
rogerman 4cd19ce522 OpenGL Renderer: Before rendering, determine the list of clipped polygons, and then only render the clipped polygons, just like how SoftRasterizer does it. Most 3D games will see a significant performance improvement. For certain games with very high polygon count scenes, those games will see a massive performance boost. 2019-01-21 16:21:32 -08:00
rogerman bb93a0a365 OpenGL Renderer: Fix an occasional crashing bug that may occur when initializing the Clear Image textures. (Regression from commit 3dc860b.) 2019-01-18 16:20:11 -08:00
rogerman d70bc19d9a OpenGL Renderer: Oops!!! Fix a critical bug that completely broke all rendering!!! (Regression from commit ab3d489.) 2019-01-18 14:32:13 -08:00
rogerman ab3d48947a OpenGL Renderer: Reduce some buffer related synchronization in BeginRender(). 2019-01-18 13:54:37 -08:00
rogerman 02cd950b02 OpenGL Renderer: In an effort to try and reduce graphical glitches whenever users try to run enhancements that were never native to the NDS to begin with, the texture sampling method is now being forced to clamp for polygons with texture coordinates of either 0.0 or 1.0. 2019-01-17 23:03:52 -08:00
rogerman 0dab5917b6 OpenGL Renderer: Fix a bug where the incorrect buffer would be cleared when trying to clear the Fog attributes buffer while Edge Mark is disabled. Partially addresses #247. (Regression from commit 21a3fae.) 2019-01-16 16:19:33 -08:00
rogerman d63ae63d1b OpenGL Renderer: Fix compiling for non-Cocoa ports. (Regression from commit c9db815.) 2019-01-16 15:46:13 -08:00
rogerman c9db815171 OpenGL Renderer: Improve the overall reliability of CPU-to-GPU buffer writes, fixing a bug where certain polygons would intermittently flicker in some games. (OpenGL 3.2 only.) 2019-01-16 11:57:36 -08:00
rogerman 7990e6c3f3 OpenGL Renderer: Fix a bug where Fog rendering would fail when used with MSAA. Fixes #246. (OpenGL 3.2 only. Regression from commit 21a3fae.) 2019-01-15 21:47:50 -08:00
zeromus 6ed5cf8420 winport - fix bug using all available window size when maximizing and fullscreening 2019-01-16 00:10:25 -05:00
rogerman 3dc860b248 Render 3D: Simplify the code a little by removing the working Polygon ID buffer for clear images.
- As a collateral improvement, this change also works as a minor optimization for the OpenGL Renderer for games that use clear images.
2019-01-14 16:13:08 -08:00
rogerman 26504031ff OpenGL Renderer: Partially revert commit 0f045d4 -- don't do the Z adjust in the vertex shader. Apparently, we shouldn't need to explicitly do this in OpenGL, as this adjustment should be automatic. Fixes a graphical glitch that can occur in "Sonic Chronicles: The Dark Brotherhood". 2019-01-14 15:17:13 -08:00
rogerman 0f045d430c OpenGL Renderer: When rendering the main geometry, adjusts all Z-positions in the vertex shader so that Z is more likely to naturally fall between the depth range of 0.0 and 1.0. Further mitigates the performance cost of using the NDS-Style Depth Calculation option. 2019-01-14 12:08:33 -08:00
zeromus 9b1ce0efc3 add --slot1-no8000prot, fixes #183 2019-01-13 14:51:51 -05:00
rogerman 066366184c Video Filters: Fix an issue where the internal buffers were not created using a guaranteed alignment, possibly causing a segfault on AVX2-enabled systems. Fixes #245. 2019-01-11 00:40:16 -08:00
rogerman f5d90a77c1 GPU: Fix graphical glitch that can occur when frameskip is enabled, running a custom resolution on a multicore CPU system. (Regression from commit abc0649.) 2019-01-10 21:33:16 -08:00
zeromus 605ce35812 winport - restore some tool windows which are minimized, when their menu option is selected 2019-01-10 20:54:31 -05:00
rogerman 4a13a03f46 Windows Port: Fix compiling on 32-bit Windows. (Regression from commit abc0649.) 2019-01-09 23:40:32 -08:00
rogerman abc0649ad2 GPU: Significantly improve the performance of HD rendering for many 3D games.
- Specifically, if the previous frame is determined to draw the entire HD layer directly over the backdrop layer, then the current frame's entire custom framebuffer is asynchronously cleared using line 0's backdrop color since most games will keep the backdrop color constant for all scanlines. Because this is a common rendering case, many 3D games should see a performance improvement when running very large HD framebuffers (8x or higher).
- Also fix a compiling issue for non-SSE2 systems. (Regression from commit 3890431.)
2019-01-09 22:41:42 -08:00
rogerman 3890431154 GPU: Working engine buffers are now set up in advance, asynchronously, starting after line 191. 2019-01-08 23:47:36 -08:00
rogerman 0f87ada863 types.h: Add support for atomic variables.
- Also clean up some stuff that doesn't belong in this file.
2019-01-08 17:17:30 -08:00
rogerman 50f42fae55 OpenGL Renderer: More minor shader efficiency tweaks when using the NDS Style Depth Calculation option. 2019-01-06 00:23:17 -08:00
rogerman 85ee9e0ff9 OpenGL Renderer: Fix some interactions between Edge Mark and the Special Zero Alpha Blending option. (Regression from commit 6f8c060.)
- Also remove some extraneous stencil buffer clears.
2019-01-05 12:49:16 -08:00
rogerman 40a4b3cdcf OpenGL Renderer: Do some minor shader efficiency tweaks. (OpenGL 3.2 only.) 2019-01-04 18:48:28 -08:00
rogerman 21a3fae0f3 OpenGL Renderer: Do some minor efficiency, stability, and consistency tweaks. 2019-01-02 01:10:59 -08:00
rogerman f97c633441 OpenGL Renderer: Okay, let's try using GL_AMD_conservative_depth for those AMD drivers that outright lie about supporting GL_ARB_conservative_depth. (Related to commit 4d6a132 and commit 39f9483.) 2018-12-30 02:12:54 -08:00
rogerman 39f9483034 OpenGL Renderer: Also require GLSL 4.00 when using the GL_ARB_conservative_depth extension. (Related to commit 4d6a132.) 2018-12-30 01:36:54 -08:00
rogerman 4d6a132116 OpenGL Renderer: Mitigate some of the performance penalty of using the NDS Style Depth Calculation option.
- GPUs that support the GL_ARB_conservative_depth extension will benefit more from this commit. (OpenGL 3.2 only.)
- Also fix some miscellaneous bugs.
2018-12-29 22:37:37 -08:00
rogerman 0c0bd5144e Cocoa Port: Do a small optimization when doing video output framebuffer fetches for Metal display views. 2018-12-28 15:39:09 -08:00
rogerman aeea0ea46a OpenGL Renderer: Remove the material_6bit_to_float LUT, since we already have an equivalent existing LUT -- divide6bitBy63_LUT. 2018-12-26 22:35:34 -08:00
rogerman c1357c1451 OpenGL Renderer: Do some minor performance improving tweaks.
- Most notably, fix a performance regression where polygon drawing was no longer getting batched due to an incorrect polygon-facing test. (Regression from commit dab414c.)
2018-12-26 19:48:22 -08:00
rogerman 062d9a65a7 Cocoa Port: Do a minor optimization for Metal display views running on macOS v10.13 High Sierra and later. 2018-12-24 21:35:17 -08:00