Commit Graph

67 Commits

Author SHA1 Message Date
olebeck
450ce40b01 improve fragment shader performance 2025-07-02 02:18:22 +02:00
olebeck
fca27bf78d Merge remote-tracking branch 'upstream/master' 2025-07-01 02:49:57 +02:00
olebeck
13c269eacf hopefully actually fix uniform buffers 2025-07-01 00:05:02 +02:00
Anders Jenbo
ab48ce60b0
OpenGL ES 2.0 Only lookup shader locations once (#460) 2025-06-30 23:38:44 +02:00
olebeck
00cd13d5f1 update GXMRenderer_EnumDevice 2025-06-30 23:01:33 +02:00
olebeck
43888843a0 Merge remote-tracking branch 'upstream/master' 2025-06-30 22:58:46 +02:00
Anders Jenbo
225adda309
Rendering refactoring (#459)
* Hint texture intent to renderer

* improve transparancy for 32bit rendering

* Align OpenGL ES 2.0 with SDL_GPU's 2D rendering
2025-06-30 22:51:26 +02:00
olebeck
3c548d987c Merge remote-tracking branch 'upstream/master' 2025-06-30 21:10:28 +02:00
olebeck
9cab1ac14d double buffered uniforms seem to work now 2025-06-30 21:07:42 +02:00
David Gow
e87184b502
Fix the OpenGL backends on non-glx Linux platforms (and remove GLEW dependency) (#446)
* Work around issues with depth-buffer size on EGL-based platforms

The OpenGL 1.1 and OpenGL ES 2.0 backends can break on EGL-based platforms,
such as Wayland, or X11 with SDL_VIDEO_FORCE_EGL=1. One of the reasons for
this (the other being glew on the GL1.1 backend) is that SDL/egl get very
confused by the way we set OpenGL attributes, particularly SDL_GL_DEPTH_SIZE,
resulting in SDL_GL_CreateContext() failing with EGL_BAD_MATCH.

The exact cause of this is unknown, but it seems to be a combination of:
- SDL_GL_SetAttribute() is supposed to be called _before_ the window is
  created, and we're calling it afterward.
- Creating several test windows during the enumeration process, mixing
  and matching between OpenGL and OpenGL ES profiles.

The "most correct" solution is probably to delay creating the game window
until the backend creation process, rather than before the enumeration
occurs. But that's a real refactor, which could cause other issues.

Instead, set the 24-bit bit depth (which we've hardcoded anyway) before
creating the window, and use SDL_GL_ResetAttributes() when creating backends.

This seems to work here in all of the cases I was able to try (modulo the GLEW
dependency, which is removed in the next patch).

* miniwin: Remove GLEW dependency for OpenGL 1.1

GLEW normally backs directly onto glXGetProcAddress on Linux, which is broken
on non-GLX setups, such as Wayland (but also X11 with EGL, and presumably KMSDRM).

Replace it with manual calls to SDL_GL_GetProcAddress() for the VBO path.

Note, however, that SDL_opengl.h includes "windows.h", so conflicts with the
miniwin implementation, which breaks builds on windows.

In order to work around this, we do what the Direct3D9 implementation does and
push all of the OpenGL calls to a separate file, actual.cpp.

Going forward, it may make sense to load _all_ OpenGL entry points via SDL,
which would allow us to avoid linking directly with libGL/libOpenGL, and
therefore eliminate the separate build dependency altogether, as well as
allowing more runtime configurability as to the OpenGL library to load.

(But that's definitely a bit uglier, and also useful very rarely.)
2025-06-29 17:47:09 +02:00
olebeck
5005772243 correct texture address mode, use tlsf instead of sceClibMspace 2025-06-29 16:30:20 +02:00
olebeck
2aeeff7d07 remove some unneeded changes 2025-06-28 03:30:03 +02:00
olebeck
7b258b0e30 fix normals matrix 2025-06-28 02:44:52 +02:00
olebeck
a7f41dd4a3 clean up a bit 2025-06-27 23:59:17 +02:00
olebeck
4aad9a9786 make 3d work, broken lights 2025-06-27 17:20:25 +02:00
olebeck
5f9b9675eb fix Draw2DImage 2025-06-27 00:38:05 +02:00
olebeck
5a6d05c38f support paletted textures directly to avoid copying the texture twice 2025-06-26 17:45:52 +02:00
olebeck
fb17107bca fix rendering somewhat, some geometry shows up 2025-06-26 14:03:20 +02:00
olebeck
06f2179ea1 make gxm renderer work with new d3drm 2025-06-26 02:34:16 +02:00
olebeck
b41e760d9d Merge remote-tracking branch 'upstream/master' 2025-06-25 22:07:25 +02:00
olebeck
d0020a3b9a avoid sdl renderer for vita, seems broken 2025-06-25 21:40:17 +02:00
Anders Jenbo
b65284a7a0
Move 2D drawing and upscaling to the renderer (#348) 2025-06-25 19:45:26 +02:00
olebeck
b38091ba1b add gxm renderer (not working with display yet) 2025-06-24 16:36:09 +02:00
dcd4262f76
miniwin: fix OpenGL include on macOS (#350) 2025-06-20 22:54:05 +02:00
Anders Jenbo
ff03ffcc5a
Correct types for IDirect3DRMMesh::AddGroup (#345) 2025-06-19 04:55:33 +00:00
Anders Jenbo
6b2db2d85b
Correct some types for IDirect3DRMMesh (#344) 2025-06-19 04:40:03 +00:00
Anders Jenbo
ea4b9ab1c9
Implement DirectX 9 backend (#332) 2025-06-18 18:10:48 +02:00
Anders Jenbo
eab95514d6
Add an OpenGL ES 2.0 renderer (#287) 2025-06-17 03:47:23 +02:00
Anders Jenbo
79726d25a4
Split framebuffer from general surfaces (#319) 2025-06-16 18:11:56 +02:00
Anders Jenbo
2828452b35
Clean up rendering (#301) 2025-06-16 04:28:32 +02:00
Anders Jenbo
65aafd2f44
Implement some minor functions in miniwin (#310) 2025-06-14 22:00:44 +02:00
Anders Jenbo
975764dc17
Align OpenGL and SDL_GPU specular with software (#305) 2025-06-14 18:05:25 +02:00
Anders Jenbo
d06caa99cb
Dial software speculare color in to match the original as best possible (#302) 2025-06-14 16:52:08 +02:00
Anders Jenbo
81ba75ea65
SIMD optimize z-buffer clear (#283) 2025-06-13 01:21:34 +02:00
Anders Jenbo
bbb0de6e9a
Implement full screen (#290) 2025-06-12 22:51:52 +02:00
Christian Semmler
b95ca4b2a3
Fix m_callbacks resource issue (#289) 2025-06-12 21:37:51 +02:00
Anders Jenbo
d06972cfb5
Some sanity checks on Direct3DRMObjectBaseImpl::Release() (#285) 2025-06-11 22:18:56 +00:00
Anders Jenbo
b2354a85d0
Sort and render transparent objects last (#277) 2025-06-11 02:15:26 +02:00
Anders Jenbo
2c9d9ba920
Upload mesh data to GPU using VBOs when available (#275) 2025-06-10 23:33:14 +00:00
Anders Jenbo
4c5b255471
Use indexed triangles in SDL_GPU (#274) 2025-06-10 23:07:02 +02:00
Anders Jenbo
c8b8035de8
Upload models to GPU before rendering (#272) 2025-06-10 06:34:49 +02:00
Anders Jenbo
08c654bf60
Simplify access to groups internally (#270) 2025-06-09 21:42:24 +02:00
Anonymous Maarten
7e9acc8d04
Add IDirect3DRMMiniwinDevice interface (#267) 2025-06-09 16:34:37 +00:00
Anders Jenbo
de82e8477a
Use dedicated path for flat shading (#248) 2025-06-09 05:06:19 +02:00
Anders Jenbo
cd4a24ec9e
Use indexed faces (#257) 2025-06-09 04:56:29 +02:00
Anders Jenbo
5be9b09b40
SDL3 GPU texture support (#254)
Co-authored-by: Anonymous Maarten <anonymous.maarten@gmail.com>
2025-06-09 01:04:19 +02:00
Anders Jenbo
ee372fbc8f
Replace GeometryVertex with D3DRMVERTEX (#259) 2025-06-08 23:06:38 +02:00
Anders Jenbo
d32c30492f
Add flat shading to Appearance (#258) 2025-06-08 22:40:14 +02:00
Anders Jenbo
06fb577d7f
Big performance boost (#242) 2025-06-06 03:08:38 +02:00
Anders Jenbo
874cc526be
Add texture support for OpenGL (#239) 2025-06-05 13:26:06 +02:00