Commit Graph

5641 Commits

Author SHA1 Message Date
rogerman aff2d07146 Cocoa Port: Huge refactor to ClientDisplayView, now supporting the use of shared fetch objects and shared client objects in order to lower memory usage and CPU/GPU usage when many display views are running at the same time.
- OpenGL display views now use a shared fetch object to fetch the emulated GPU framebuffers and store them in shared textures within a shared context. In conjunction with the new double-buffering support from the last commit, this eliminates the copying between the framebuffers and each display view.
- OpenGL display views now use shared HQnx LUT textures, rather than having to initialize and maintain a copy of the LUT textures for each display view.
- OpenGL display views no longer perform any rendering while their associated NSView is hidden, improving the performance of creating new display views.
- OpenGL display views can now DMA directly from pinned-memory both custom-sized framebuffers and CPU-pixel-scaled native-sized framebuffers at the same time.
2017-02-01 15:56:54 -08:00
rogerman 08b8a1a62c GPU: The output framebuffers are now double-buffered and page-aligned.
- Framebuffers are now page-aligned on 4KB boundaries. This is to
improve performance when using the framebuffers directly as pinned AGP
memory.
- Framebuffers are now double-buffered. The target buffer index is now
tracked using the bufferIndex field of NDSDisplayInfo.
- Clients may no longer supply their own buffers to
SetCustomFramebufferSize(). Clients must use the pointers supplied by
NDSDisplayInfo.
- The frameskip flag is now set only on line 0 and remains consistent
for all 192 lines of rendering.
- GPUSubsystem no longer needs a special allocater/deallocator for
itself, so it has been reverted back to a standard C++ new/delete.
- Add a GPUClientFetchObject helper class as an aid to clients that
need to read out the framebuffers. (Should probably move to its own
file at some later date.)
2017-02-01 09:34:21 -08:00
rogerman fc3570a18a Revert "Fix buffer overrun issues with custom memset functions."
This reverts commit 53c4a27aef.

I forgot that these functions are based on element count, not based on
byte count. Rename “length” to “elementCount” for better clarification.
2017-01-26 01:23:42 -08:00
rogerman 62f230ef44 common.cpp: Add the convenience function malloc_alignedPage(), which returns a 4KB page-aligned (for most systems) block of memory. 2017-01-25 20:03:22 -08:00
rogerman 53c4a27aef Fix buffer overrun issues with custom memset functions. 2017-01-25 20:01:28 -08:00
rogerman b9a9b8e7b2 Cocoa Port: Another round of refactoring for ClientDisplayView.
- Fetching and loading of GPU frame data is now performed as two
separate operations.
- Display windows no longer draw concurrently on backgrounds threads;
instead they are updated synchronously.
- Associate the CALayer after the .xib completely loads the NSView for
better compatibility.
- MacOGLDisplayView now creates an NSOpenGLContext instead of a
CGLContextObj, bringing back compatibility with macOS 10.5 Leopard.
- Fix building with the Xcode 3 project.
2017-01-24 19:08:44 -08:00
rogerman 3b0920d7f0 Video Filters: Rework the Scanline and Nearest2X filters to modern standards, and also add an SSE2 version of the Scanline filter. 2017-01-23 12:31:52 -08:00
zeromus 48bef75fd9 sync with retroarch again -- new work to make scond_signal slightly more pthreads compliant (and other tidies) 2017-01-21 22:43:34 -06:00
zeromus e79b37dcb4 synchronize rthreads with libretro-common scond/slock cleanup and optimization for smoke testing 2017-01-21 17:12:50 -06:00
rogerman c7af5cbe11 Cocoa Port: Refactor ClientDisplayView to improve subclasses' ease-of-use for the HUD-related methods. 2017-01-20 16:44:44 -08:00
rogerman aa8069ce1a Cocoa Port: More refactoring work on ClientDisplayView.
- Most notably, HandleGPUFrameEndEvent() now sends the entirety of the
NDSDisplayInfo struct to the client.
- The OpenGL blitter now skips the loading, processing and rendering of
disabled screens.
- Begin preparing DisplayView to handle the upcoming Apple Metal
blitter.
- Do some misc. code cleanup and simplification.
2017-01-18 16:05:41 -08:00
zeromus e487193545 remove outdated information from linux readme (address #35) 2017-01-17 18:45:14 -06:00
rogerman 8aa066dffc GPU: Add some more properties to NDSDisplayInfo pertaining to auto-applying the master brightness. 2017-01-17 11:30:14 -08:00
rogerman 25c0232673 Cocoa Port: Fix some bugs with HUD font loading and HUD rendering on Retina displays. 2017-01-15 21:45:26 -08:00
rogerman 6756f41bdb Cocoa Port: Significantly increase the performance of the 4xBRZ, 5xBRZ and 6xBRZ shaders.
- Also disable the 4xBRZ shader for low-tier GPUs. (Testing has shown
that low-tier GPUs have no chance at running this shader in real-time
anyways.)
- Also do some misc. tweaks to other various shaders.
2017-01-15 20:36:13 -08:00
zeromus d33f2f095c change an `int` to `s32` which was being serialized as an s32 2017-01-13 18:41:31 -06:00
rogerman 019a959702 GPU: Silence compiler warnings about implicit 64-to-32 bit conversions. 2017-01-13 16:29:39 -08:00
Markus Kitsinger (SwooshyCueb) 125df2970e copy paths to variables rather than uninitialized data 2017-01-12 22:29:24 -06:00
rogerman 558cbf71d2 Cocoa Port: Also bring back setWantsBestResolutionOpenGLSurface: in order to support Retina displays on Macs running macOS 10.7 Lion. 2017-01-12 10:57:59 -08:00
rogerman 3af5423387 Cocoa Port: Bring back NSOpenGLContext for Macs running macOS 10.7 Lion or earlier.
Also do some misc. backwards compatibility fixes.
2017-01-11 17:56:21 -08:00
rogerman 07a68dbb7a Cocoa Port: Clean out utilities.c a little bit more. 2017-01-10 23:57:47 -08:00
rogerman 669487ff05 Cocoa Port: Eliminate the old colorspace conversion functions from utilities.c in favor of the new colorspace handler functions. 2017-01-10 23:45:06 -08:00
rogerman 858d14b5fe Cocoa Port: Transition display views from using an NSOpenGLContext to using a CAOpenGLLayer. 2017-01-10 21:45:09 -08:00
rogerman ee306a9f07 Cocoa Port: Disable the default clipping feature in display views as a micro optimization. 2017-01-10 10:42:08 -08:00
zeromus 522a4e25d1 merge latest rthreads.c from libretro-common, and improve sthread_isself to null check argument (fixes crash in winport's single-core codepaths when lua window is open) 2017-01-09 16:51:02 -06:00
rogerman 9c573370f3 Cocoa Port: Oops! Revert a little test code that snuck in from the last commit. 2017-01-09 14:00:20 -08:00
rogerman 34656d977c Cocoa Port: Simplify OpenGL context handling. 2017-01-09 13:57:59 -08:00
rogerman 91f2bb9ee5 Cocoa Port: Even more display view refactoring work.
- Move Mac-specific OpenGL code to its own file.
- Eliminate the CocoaDSDisplayDelegate and CocoaDSDisplayVideoDelegate
protocols. Instead, call ClientDisplay3DView class methods directly.
2017-01-09 11:20:25 -08:00
zeromus a5b4df2038 bring softrasterizer shadow rendering up to modern standards. 2017-01-08 15:25:47 -06:00
rogerman f1558bf4e6 Cocoa Port: More display view refactoring work. 2017-01-08 00:21:19 -08:00
rogerman c7c472673f Cocoa Port: Fix a few more issues caused by commit cffc343.
- Fix bug where restored windows would fail to update properly if the
window size would be the same as the one set in user defaults.
(Regression from commit cffc343.)
- Fix bug where changing the rotation to be exactly 180 degrees
different from the old rotation would cause the view to render the
screens with a vertical offset. (Regression from commit cffc343.)
- OGLDisplayLayer respects its own _needUpdateRotationScale and
_needUpdateVertices flags once again, preventing it from repeatedly
uploading already established data to the GPU. (Regression from commit
cffc343.)
2017-01-07 15:54:23 -08:00
rogerman 6eca2163f7 Cocoa Port: Fix bug where switching the display mode to Main or Touch would fail to work correctly.
Also do some misc. code cleanup.

(The bug is a regression from commit cffc343.)
2017-01-06 17:22:02 -08:00
rogerman 34df91f412 Merge remote-tracking branch 'origin/master' 2017-01-06 15:23:43 -08:00
rogerman cffc343496 Cocoa Port: Continue refactoring of the display view code to reduce port-specific dependence. 2017-01-06 15:23:26 -08:00
zeromus ce044f3700 remove rewind code completely (it wasnt hooked up to the UI and it was worthless anyway) 2017-01-06 16:53:46 -06:00
rogerman 616962f0b7 Cocoa Port: Standardize display rotations to always assume a left-handed Cartesian coordinate system (clockwise rotation). 2017-01-03 03:31:35 -08:00
rogerman a6cb37901f Cocoa Port: Eliminate dsPointFromEvent:inputID: method. 2017-01-03 00:25:24 -08:00
rogerman eed334f999 Cocoa Port: Change "Display Orientation" to "Display Layout".
Also change the name of “Hybrid (3:2)” to “Hybrid (2:1)”. The display
ratio was incorrectly identified as 3:2, when in fact it is 2:1.
2017-01-02 23:01:31 -08:00
rogerman ce494a2eaa Cocoa Port: Begin refactoring display view code to reduce the dependence on port-specific code. 2017-01-02 22:39:25 -08:00
rogerman 207a3b2e9e Cocoa Port: New feature -- add Hybrid display orientations.
- The new Hybrid display orientations show three NDS screens — the top
and bottom screens on the left side, and a larger major screen on the
right side. This feature is intended to better use the widescreen
resolution of most users’ host displays, which are usually 16:9 or
16:10. Three different Hybrid orientations are provided (3:2, 16:9, and
16:10) so that users can choose the display size ratio that they prefer.
- Horizontal display orientation no longer uses the display separation
setting.
- Do some additional code cleanup.
2016-12-31 18:10:48 -08:00
rogerman cf8f021b30 OpenGL Renderer: Don't force backface culling when drawing shadow polygons.
Do note that we need to do this for SoftRasterizer as well, but
SoftRasterizer will need some additional rework on shadow polygon
handling to get all the test cases to work.

Fixes issue #21.
2016-12-30 11:04:35 -08:00
rogerman c9d5d69c06 GPU: Fix graphical inconsistencies with BG extended layers using custom VRAM.
(Regression from commit 36e03fe.)
2016-12-29 17:36:31 -08:00
rogerman 000efb1095 GPU: Fix bug where native-sized lines would be improperly blended with non-native-sized lines during display capture.
Fixes a graphical issue in Golden Sun: Dark Dawn whenever a battle
sequence begins when using a custom framebuffer size.
2016-12-29 14:12:23 -08:00
rogerman 36e03fefa5 GPU: Disable the use of custom VRAM for extended BG layers whenever they are scaled or rotated.
Fixes the zoom-in effect whenever entering buildings in Pokemon
Black/White. (Regression from r5371.)
2016-12-29 10:26:24 -08:00
zeromus ae37e1259e winport: fix crash with HD prescale and --num-cores 1. OSD is messed up in this case. Not going to fix that now since --num-cores 1 is a very old quirks hack anyway. Fixes #20 2016-12-28 17:25:12 -06:00
rogerman 1213deb102 OpenGL Renderer: Fix various bugs when running OpenGL 2.1 and earlier.
Fixes regressions from commits 8fab805 and 7b13501.
2016-12-28 14:07:06 -08:00
zeromus 4710cf7e37 fix errors in ogl old 3d driver (recent changes from ogl 3.2 not fully ported) 2016-12-27 21:09:08 -06:00
rogerman 8159da3f0c GFX3D: Save the opaque polygon count in POLYLIST. 2016-12-26 14:19:45 -08:00
rogerman f50f9d38fd OpenGL Renderer: Reduce OGLRENDER_MAX_MULTISAMPLES from 16 to 8.
Now that framebuffer sizes can be greater than 256x192, using MSAAx16
is excessive and consumes too much bandwidth. We’re reducing the
maximum sample size of MSAA to 8 since it will significantly reduce
bandwidth consumption at the larger framebuffer sizes while remaining
mostly visually equivalent to MSAAx16.
2016-12-26 12:37:22 -08:00
rogerman 4e96cc8b6e Cocoa Port: Simplify some code in the OpenGL blitter. 2016-12-24 11:08:17 -08:00