Commit graph

124 commits

Author SHA1 Message Date
Le Philousophe
e301905875 GRAPHICS: OPENGL: Fix shader version check discrepancy
We required version 110 for OpenGL backend shaders while we only checked
for version 100, although this version is not expected to work without
proper ARB extension support.
Increase minimum supported version to 1.10 which matches OpenGL 2.0
2025-02-19 18:49:22 +01:00
Cameron Cawley
20ceda8f28 GRAPHICS: OPENGL: Fix warnings when GLAD is disabled 2024-12-24 13:25:39 +02:00
Cameron Cawley
255562991c GRAPHICS: OPENGL: Enable more features with OpenGL ES 3 2024-12-24 13:25:39 +02:00
Cameron Cawley
26a2e738fd ANDROID: Fix build after FrameBuffer class changes 2024-11-30 23:36:34 +01:00
Cameron Cawley
a9ca83819d BACKENDS: OPENGL: Use the shared Texture class for the overlay in 3D games 2024-11-30 18:21:47 +02:00
Cameron Cawley
20b41fc8d9 GRAPHICS: OPENGL: Separate the GLTexture class from the graphics manager 2024-11-30 18:21:47 +02:00
Le Philousophe
634bc2811e GRAPHICS: OPENGL: Add back ARB_fragment extensions
These extensions were removed in PR #5683 but they are still used by
Grim Fandango.
The following API were enabled:
- GL 3.3 compatibility
- GLES1 1.0 common
- GLES2 2.0
The following extensions have been selected:
- GL_ARB_fragment_program
- GL_ARB_fragment_shader
- GL_ARB_shading_language_100
- GL_ARB_texture_non_power_of_two
- GL_EXT_color_subtable
- GL_EXT_convolution
- GL_EXT_histogram
- GL_EXT_packed_depth_stencil
- GL_EXT_packed_pixels
- GL_EXT_paletted_texture
- GL_EXT_texture_compression_s3tc
- GL_EXT_unpack_subimage
- GL_KHR_debug
- GL_OES_depth24
- GL_OES_packed_depth_stencil
- GL_OES_texture_npot
- GL_SGI_color_table
- GL_SGIS_texture_edge_clamp

The header only, aliasing and merge options were chosen.
The permalink is this one:
https://gen.glad.sh/#generator=c&api=gl%3D3.3%2Cgles1%3D1.0%2Cgles2%3D2.0&profile=gl%3Dcompatibility%2Cgles1%3Dcommon&extensions=GL_ARB_fragment_program%2CGL_ARB_fragment_shader%2CGL_ARB_shading_language_100%2CGL_ARB_texture_non_power_of_two%2CGL_EXT_color_subtable%2CGL_EXT_convolution%2CGL_EXT_histogram%2CGL_EXT_packed_depth_stencil%2CGL_EXT_packed_pixels%2CGL_EXT_paletted_texture%2CGL_EXT_texture_compression_s3tc%2CGL_EXT_unpack_subimage%2CGL_KHR_debug%2CGL_OES_depth24%2CGL_OES_packed_depth_stencil%2CGL_OES_texture_npot%2CGL_SGI_color_table%2CGL_SGIS_texture_edge_clamp&options=ALIAS%2CALIAS%2CHEADER_ONLY%2CMERGE%2CMERGE%2CMERGE
2024-11-15 23:21:33 +01:00
Le Philousophe
dea9f5f33e GRAPHICS: OPENGL: Fix typo in comment 2024-11-11 14:05:56 +01:00
Le Philousophe
7794de5e5e GRAPHICS: OPENGL: Allow sscanf_s for GLAD
It is properly guarded so it won't bring any portability problem and the
file is autogenerated so this avoids to patch the file.
2024-06-01 13:42:01 +02:00
Le Philousophe
a31ea07f82 Revert "GRAPHICS: OPENGL: Disable usage of sscanf_s"
This reverts commit 5040e1129d.
Instead of modifying an autogenerated file, patch around it.
2024-06-01 13:42:01 +02:00
Eugene Sandulenko
5040e1129d
GRAPHICS: OPENGL: Disable usage of sscanf_s
This follows the earlier commit that added this symbol to forbidden.h
The code in glad.h is not using any features of sscanf_s, e.g.
sizes for the provided strings for safety, so it is not clear
why are they using it. Perhaps because it is declared "safer"
2024-05-30 09:24:59 +02:00
Le Philousophe
635cb6b998 GRAPHICS: OPENGL: Upgrade glad headers
This allows to remove a workaround in context creation
2024-03-17 15:39:32 +01:00
Hubert Maier
794f292b5d
AMIGAOS: Use compiler defines 2024-03-16 01:59:27 +02:00
Christian Kündig
7aa72a1633 EMSCRIPTEN: OPENGL: Disable GLAD 2024-02-27 17:07:13 +01:00
Christian Kündig
65bdafa0a0 EMSCRIPTEN: OPENGL: Disable OPENGL_DEBUG on Emscripten
863988f was causing a 10x increase in frame times regressing GRIM from 55fps to 3-5 fps.
2024-02-27 17:07:13 +01:00
Le Philousophe
42fa87acea GRAPHICS: OPENGL: Don't try to use GLAD aliasing for shaders
Aliasing doesn't cover all the functions we use.
In addition, old GLSL 1.00 doesn't support the #version stance.
2024-01-27 09:44:39 +01:00
Le Philousophe
03a53b1a1e OPENGL: Fix GLSL version parsing
Some old GLES2 implementation did have a different version prefix.
Be more relax like almost everyone and look for the first digit to start
parsing.
2023-12-28 09:31:31 +01:00
Cameron Cawley
5b1b14ad80 COMMON: Mark more symbols as const 2023-12-26 20:23:59 +01:00
Le Philousophe
226de788c8 GRAPHICS: Make API use the Path class 2023-12-24 13:19:25 +01:00
Le Philousophe
802c91554f COMMON: Make extrapath a Path object 2023-12-24 13:19:25 +01:00
Le Philousophe
306ca933d4 OPENGL: Use GLAD version when available and check functions before use
When GLAD fails to parse version, glGetError is null and raises a
SIGSEGV.
Current version of GLAD has a bug while parsing extensions so there is a
workaround here which should disappear when it's fixed.
2023-12-14 18:37:23 +01:00
neuromancer
7a96738168 GRAPHICS: OPENGL: added another setUniform function to set an uniform value in shaders from an array of ints 2023-04-04 20:00:17 +02:00
neuromancer
5d92a98038 FREESCAPE: initial implementation of the opengl shader renderer 2023-04-01 23:12:43 +02:00
Le Philousophe
6bbcd95c10 GRAPHICS: Handle cases where glGetString returns a nullptr 2023-03-11 18:19:54 +01:00
Cameron Cawley
cc47ebd314 OPENGL: Add debug output for more features 2023-02-12 19:27:47 +00:00
Cameron Cawley
58e96a8755 OPENGL: Check if GL_TEXTURE_MAX_LEVEL is supported before using it 2023-02-05 22:31:57 +01:00
Le Philousophe
b1ebc64c03 GRAPHICS: OPENGL: Free log after using it 2023-01-28 18:44:51 +01:00
Eugene Sandulenko
4dcfc483e8
GRAPHICS: OPENGL: Do not search shaders in dev environment in release builds 2023-01-05 15:29:33 +01:00
grisenti
a8b8b5263f
OPENGL: add hpl1 shaders directory in shader class 2022-12-23 14:03:40 +01:00
Le Philousophe
94b8f34302 GRAPHICS: Don't use unsafe sprintf and vsprintf 2022-10-23 22:46:19 +02:00
Le Philousophe
82cd971aca OPENGL: Add more texture wrap modes detection 2022-10-16 19:43:05 +02:00
Le Philousophe
884c3aa795 OPENGL: Use the correct index when attribute is added after link 2022-10-09 18:30:29 +02:00
Le Philousophe
a205c79a98 OPENGL: Allow to get last call error status 2022-10-09 17:25:35 +02:00
Le Philousophe
cb36b46864 OPENGL: Allow loading of raw shader source 2022-10-08 23:39:18 +02:00
Eugene Sandulenko
31100637fa GRAPHICS: OPENGL: Refactor for adding possibility to avoid calling error() directly 2022-10-08 23:39:18 +02:00
Paweł Kołodziejski
d9d0dfa20d
GRAPHICS, OPENGL: Updated GLAD and added EXT_texture_compression_s3tc 2022-09-11 11:43:13 +02:00
Le Philousophe
6c2c603df2 OPENGL: Fix cast on Vertex Attribute pointer 2022-07-16 09:57:42 +02:00
Le Philousophe
15235fa8ad OPENGL: Add workaround for AmigaOS which supports GLSL 0.9 2022-07-13 19:00:15 +02:00
Le Philousophe
1b35e66c01 OPENGL: Dump GLSL version string
This will ease to debug parsing errors
2022-07-04 08:13:49 +02:00
Cameron Cawley
0eb11216fb OPENGL: Add Shader::addAttribute() 2022-07-03 22:26:10 +03:00
D G Turner
8ee4251f41 OPENGL: Fix Integer to Pointer Cast GCC Compiler Warning
This is emitted when -Wint-to-pointer-cast is passed to GCC.
2022-06-30 01:04:59 +01:00
Cameron Cawley
c13961362f OPENGL: Ensure that glGetError() is cleared before calling a checked function 2022-06-29 22:37:38 +01:00
Cameron Cawley
863988fee4 OPENGL: Add proper error checking to the Shader class 2022-06-29 22:37:38 +01:00
Cameron Cawley
fb1db0e94f OPENGL: Allow enabling vertex attributes without using a VBO 2022-06-29 14:15:46 +01:00
Cameron Cawley
7b4aff4ac6 OPENGL: Add a return value to setUniform(), and use Common::String 2022-06-28 21:40:36 +01:00
D G Turner
6bcd18f126 OPENGL: Add Missing Header Defining USE_FORCED_GLES Symbol to Shader Code
This missing header meant that USE_FORCED_GLES would always be undefined
and thus by default resolve to false i.e. disabled.
2022-06-26 23:14:14 +01:00
Le Philousophe
98c306376f OPENGL: Merge both OpenGL shaders objects 2022-06-26 18:32:10 +02:00
Le Philousophe
4ab044a254 OPENGL: Merge both OpenGL contexts 2022-06-26 18:32:10 +02:00
Le Philousophe
8569296384 OPENGL: Detect framebuffer support using GL_ARB_framebuffer_object
We use functions from GL_ARB_framebuffer_object extension and not from
GL_EXT_framebuffer_object where functions are suffixed by EXT.
This avoids crashes on implementations supporting only the EXT version.
2022-05-27 18:13:10 +02:00
Le Philousophe
c9b4949746 AMIGAOS: Improve shader compatibility
OGLES2 doesn't support uniform booleans so we use macros to make it use
integers in this case. For other platforms, this change should be a
noop.
OGLES2 doesn't like float suffix for constants, remove it as well.
2022-04-17 12:34:38 +02:00