Commit Graph

6887 Commits

Author SHA1 Message Date
rogerman 8b5ac56d66 OpenGL Renderer: More FBO rework. 2024-07-19 14:38:05 -07:00
rogerman 60385bd099 OpenGL Renderer: Rework how the output framebuffers work.
- The output framebuffers now bind their own FBOs rather than changing draw targets with glDrawBuffer().
- Rework the general FBO management.
- Legacy OpenGL now outputs native RGBA color if FBOs are supported. This should give a minor performance increase on older GPUs.
- The fixed-function pipeline can now flip the framebuffer on GPU. This greatly reduces the CPU usage when doing the final color conversion and gives a significant performance increase on ancient GPUs.
2024-07-18 21:45:00 -07:00
rogerman 811e1de45e OpenGL Renderer: Oops! Roll back some internal test code that accidentally slipped into commit 0c7cb99. 2024-07-18 12:46:11 -07:00
rogerman 3e650f2f73 OpenGL Renderer: Add entry point for glBlendColor, fixing compiling on Windows. (Regression from commit 0c7cb99.) 2024-07-18 12:26:53 -07:00
rogerman 0c7cb99d78 OpenGL Renderer: Greatly simplify the fog rendering pass.
- There is no more need to switch to the working texture as the destination for the fog output. This change will be essential for future commits.
- The dual-source blending method has been obsoleted and removed.
- FBOs are no longer required for the fog feature, easing requirements for ancient GPUs.
- Ancient GPUs may see a small performance benefit due to shader simplification.
2024-07-18 12:17:25 -07:00
rogerman 70fef83ded OpenGL Renderer: Fix bug when the screen wasn't being cleared properly when no polygons are being sent to the renderer. (Regression from commit 241ca96.) 2024-07-16 16:15:47 -07:00
rogerman ff9231bb34 OpenGL Renderer: 16-bit texture data that is converted to 32-bit is now byte-swapped correctly on big endian systems. 2024-07-15 23:09:53 -07:00
rogerman ab1d37a44f Colorspace Handler: Fix compiling on AltiVec systems. (Regression from commit 586aea5.) 2024-07-15 23:07:24 -07:00
rogerman cc0b3ed00d Cocoa Port: Update the OpenGL blitter code to reflect the current code pattern in OGLRender.h.
- Centralize all header includes into OGLDisplayOutput.h.
- Update all extension versions of OpenGL functions/tokens that would be core in OpenGL v1.5.
2024-07-15 16:52:43 -07:00
rogerman 80694cd966 OpenGL ES Renderer: More ES fixes.
- Change the remaining FBO attachments that I missed the last time to use RGBA8 internal format.
- Fix picky ancient drivers that won't accept GL_RED as a texture internal format. It has been changed to GL_LUMINANCE.
- Fix picky ES drivers that demand that the external format used in both glTexImage2D() and glTexSubImage2D() are exactly the same.
- OpenGL ES doesn't support GL_UNSIGNED_SHORT_1_5_5_5_REV for texture data, and GL_UNSIGNED_SHORT_5_5_5_1 is incompatible with our data. So instead, all 16-bit data will be converted to 32-bit LE before uploading it via the textures, and such ES textures will now take GL_UNSIGNED_BYTE format.
- Remove the #include for EGL/egl.h in OGLRender.h, since EGL shouldn't exist at this level of the code stack.
2024-07-15 16:45:21 -07:00
rogerman 586aea5310 Colorspace Handler: Add new functions for 16-bit to 18-bit and 32-bit color conversion, now respecting the 16-bit color's alpha bit.
- ColorspaceConvert5551To8888()
- ColorspaceConvert5551To6665()
- ColorspaceConvertBuffer5551To8888()
- ColorspaceConvertBuffer5551To6665()
- Also rename the existing 16-bit color conversion functions to help further distinguish the functions from one another.
2024-07-15 16:24:02 -07:00
Roger Manuel 4b0805e139
Windows Port: Fix yet another compiling issue related to the OpenGL context. (Fixes #811.) 2024-07-15 10:00:38 -07:00
rogerman 15a6e51739 OpenGL Renderer: Add support for Fog, Edge Mark, and on-GPU framebuffer color conversion for ancient GPUs that have support for shaders and FBOs, but lack support for GL_EXT_framebuffer_blit. 2024-07-14 19:38:29 -07:00
rogerman de62116cc8 Windows Port: Fix OpenGL renderer init failure. (Regression from commit 76fe5f7. Fixes #810.) 2024-07-14 17:22:47 -07:00
rogerman 241ca96cf1 OpenGL Renderer: Fix issues that would throw a GL error.
- glTexParameteri() with GL_TEXTURE_2D_MULTISAMPLE throws INVALID_ENUM when trying to assign a sampler-related state, so these calls have been removed.
- glMapBufferRange() throws GL_INVALID_OPERATION if the buffer size is 0, so check for this condition first.
2024-07-13 10:43:04 -07:00
rogerman aaf88d9f14 OpenGL ES Renderer: More ES tune-ups.
- Any ES-specific error messages are now reported as "OpenGL ES" instead of "OpenGL".
- Explicitly declare the internal format of all textures and RBOs used as FBO attachments as "GL_RGBA8" instead of the generic "GL_RGBA". This may fix some extremely picky ES drivers that would throw GL_INVALID_ENUM if we don't use a sized internal format.
- Hard code the read pixels format as GL_RGBA and the read data type as GL_UNSIGNED_BYTE. It is meaningless to rely on GL_IMPLEMENTATION_COLOR_READ_FORMAT and GL_IMPLEMENTATION_COLOR_READ_TYPE since we are reading from our own FBOs that are hard coded to GL_RGBA8 format.
- Require that OpenGL ES contexts support the GL_OES_surfaceless_context extension, since we are doing offscreen rendering strictly on FBOs only. This extension has been around for a very long time, and so this serves as a kind of compatibility check.
2024-07-12 15:41:09 -07:00
rogerman d480f95d79 Cocoa Port: Fix yet another crash-on-exit bug that could happen when running on an older system. 2024-07-12 12:00:49 -07:00
SimonAfek dd88556d53
CI: update github workflows (#809)
* Update macOS version in build_interface.yml

* Typo fixes in build_interface.yml

* build.yml: Update runner images

* build.yml: Update deprecated actions

* build_interface.yml: Update runner images

* build_interface.yml: Update deprecated actions

* build_interface.yml: Remove unnecessary packages from macOS "brew install" line to address warnings

* build_win.yml: Update runner image + remove vs-version parameter from setup-msbuild action

* build_win.yml: Update deprecated actions
2024-07-11 17:38:52 +02:00
rogerman 00dd6fb97a OpenGL ES Renderer: Use the proper ES extension header, and also avoid double #defining some of the tokens. 2024-07-10 21:53:49 -07:00
rogerman bb3011c262 OpenGL Renderer: Return to a more traditional method of doing texture reads in shaders, effectively removing dependent texture reads where appropriate.
- This change won't affect standard OpenGL on a desktop PC, but may improve performance on lesser GPUs trying to run OpenGL ES.
2024-07-10 16:01:13 -07:00
rogerman 86a29d768a OpenGL ES Renderer: Do some minor changes/fixes.
- Fix a bug where _isShaderFixedLocationSupported wasn't being set to true, causing shaders to fail.
- OpenGL version checks now account for non-compliant ES drivers that contain text before the version number.
- Manually set the default read/draw buffers for all FBOs upon creation. We shouldn't need to do this, since they should always be set later, but just in case...
- Add missing GL_BGRA macro.
- Tidy up the OpenGL naming in some error strings.
2024-07-10 13:59:02 -07:00
rogerman 3a6f2f6dc5 OpenGL ES Renderer: Add a new OpenGL ES 3.0 renderer. 2024-07-09 23:00:27 -07:00
rogerman 0e88f9aa94 OpenGL Renderer: Final changes for OpenGL ES compatibility. 2024-07-09 22:03:33 -07:00
rogerman 384854f6e7 OpenGL Renderer: More updates to the 3.2 Core Profile renderer to be more cross-compatible with OpenGL ES 3.0.
- Add support for fixed locations in shaders for OpenGL 3.3 and later.
- The fog density table texture is now a 2D texture instead of a 1D texture.
- Fix a memory leak where the polygon state texture wasn't being deleted upon the destruction of the OpenGLRenderer object.
2024-07-09 01:18:50 -07:00
rogerman 7dbece1082 OpenGL: Do some minor changes to the 3.2 Core Profile renderer to make it more cross-compatible with OpenGL ES 3.0.
- PBO handling now works via glMapBufferRange() instead of glMapBuffer().
- Polygon states can now be uploaded using plain integer textures. 64k UBOs and TBOs are no longer required.
2024-07-06 16:20:53 -07:00
rogerman 09090e93f9 GFX3D: Change POLYLIST_SIZE to 16384 to ensure proper memory alignment with buffers based on CLIPPED_POLYLIST_SIZE and VERTLIST_SIZE. 2024-07-06 13:58:05 -07:00
rogerman c962c550e7 OpenGL: Handle legacy functions and tokens more gracefully for OpenGL variants that may not have them. 2024-07-05 18:13:43 -07:00
rogerman 76fe5f758c OpenGL: More changes in preparation of OpenGL ES.
- Slightly change the names of attachment defines so that they can be distinguished from the native OpenGL attachment defines.
- The minimum version driver check now accounts for OpenGL ES.
- OpenGLRendererCreate() can now handle any possible OpenGL variant, as declared in the OpenGLVariantID enum.
- Framebuffer read backs may now assigned their format and data type. (Legacy OpenGL assigns the format as GL_BGRA, while 3.2 Core Profile assigns the format as GL_RGBA.)
2024-07-03 16:55:47 -07:00
rogerman ba56bbc7c2 OGLRender_3_2.cpp... try again... 2024-07-03 13:05:43 -07:00
rogerman 3ec0b0c2e1 OpenGL: Continue preparation for adding OpenGL ES. (Related to commit 086980d.) 2024-07-03 13:01:17 -07:00
rogerman fc6ff8edbd GPU: Fix a bug on big-endian systems where setting the backdrop color could cause a crash. 2024-07-02 01:35:10 -07:00
rogerman fe0ae83c40 Cocoa Port: Fix a longstanding, yet rare, crash that may occur when quitting the app. 2024-07-02 00:16:46 -07:00
rogerman d4163a1893 OpenGL: Fix building on Windows and Linux. (Regression from commit 086980d.) 2024-07-01 16:26:46 -07:00
rogerman 086980deaf OpenGL: Start reorganizing stuff in preparation for adding new OpenGL variants, such as OpenGL ES.
- All platform-specific header includes are now centralized in OGLRender.h.
- Remove all ARB and EXT versions of legacy functions (everything pre 3.0). Legacy functions now only reference their core versions.
- Do a some minor code cleanup.
2024-07-01 16:19:05 -07:00
rogerman 76bd1a5e35 Change line-ending style in OGLRender.h from Windows-style CRLF to Unix-style LF. 2024-06-29 14:50:47 -07:00
rogerman 6309a9c6a7 libretro: So apparently, _XOPEN_SOURCE has to be at the top of the file. Hopefully this makes both GCC14 users and Mac users happy. (Related to commit 779606e. Based on PR #793.) 2024-06-07 17:16:53 -07:00
rogerman 779606ec2f libretro: Fix building on Mach-based operating systems, otherwise known as Mac OS X and modern macOS (regression from commit 90d0abd). Based on PR #793. 2024-06-07 16:33:13 -07:00
zeromus ffb8666a8f winport - plumb S9X_JOY_NEUTRAL through inifile:
[Controls]
DigitalizationThreshold=50
2024-06-07 00:24:55 -04:00
zeromus ff6c33a8d6 winport - reduce joystick digitalization threshold from 60% to a more normal 50%. With a too-high threshold, it's impossible to specify diagonals. This is preferable for games without diagonals (else you accidentally crouch when you just meant to walk to the side) instead of 8-way games, so we have to be pretty aggressive about the threshold. But 50 is the more normal choice. 2024-06-07 00:18:09 -04:00
zeromus 90d0abdae0
Merge pull request #792 from atsampson/xopen-strdup
libretro-common: fix implicit declarations
2024-05-13 07:59:48 -05:00
Adam Sampson 738298a9e8 libretro-common: fix implicit declarations
strdup and realpath are only declared by glibc's headers if
_XOPEN_SOURCE >= 500.
2024-05-13 12:47:10 +01:00
zeromus 4a53a30b91 winport - fix bug where desmume would create working directory using some wrong locale encoding and produce a Pok魯n directory instead of using the Pokémon that was already there (fixes #791) 2024-05-12 21:33:49 -04:00
rofl0r 9515af82b2
add an issue template for github (#784) 2024-04-12 21:39:12 +02:00
rogerman bae67e2d0c GPU: Implement the DISPCNT register's ForceBlank bit by clearing the line to white if the ForceBlank bit is set. (Fixes #775.) 2024-03-02 15:18:51 -08:00
Max Fedotov 0a6eca6dce
GTK: hybrid layout support (#773)
* GTK: hybrid layout support
* Fix HUD with new layouts
* Simplify rotoscaled_hudedit logic a bit
2024-02-26 19:12:50 +00:00
Max Fedotov 45738beb88
GTK: make OSD scalable (#769)
* gtk: make OSD scalable

* Scale save slot indicator (oops), make text outlines look smoother, use
larger font when not scaling

* Save and load HUD layout, prefer raster font on low resolution, select
vector font size close to raster one, make OSDCLASS::scale floating point

* Build fix

* Add reset HUD layout action, only require fontconfig if libagg is found.

* Try another font in case we could not locate monospace

* Detect screen bytes per pixel instead of hardcoding it, define
AGG2D_USE_VECTORFONTS if fontconfig is found.

* Different pixel formats are handled by different draw target
implementations
2024-02-14 08:20:57 +00:00
zeromus 6508c2b115 placate -Werror=format-security (probably) (re: #768) 2024-02-01 04:26:38 -05:00
Max Fedotov f2cfd23ef2
gtk: implement GPU scale factor feature (#764)
* [WIP] gtk: implement GPU scale factor feature

* Replace combobox with spin button, fix taking screenshot

* Fix distorted image, add some checks for scale factor value

* Make OSD at least properly visible
2024-01-25 14:28:46 +00:00
rogerman b06537cf51 Cocoa Port: Fix building on Cocoa port related to new files being added in commit 8be30fe.
- Note that this commit ONLY fixes building, but DOES NOT actually add barcode reader support to the Cocoa port just yet.
2023-10-10 13:45:07 -07:00
zeromus 0b027d8cc0
Merge pull request #735 from windwakr/hcv1000-fixes
Slot2: Sega Card Reader fixes
2023-10-07 11:04:03 -05:00