egl: Add support for SDL_GL_FLOATBUFFERS.

Fixes #6001.
main
Ryan C. Gordon 2022-08-09 15:41:02 -04:00
parent 201484ff6f
commit a346c4bbef
No known key found for this signature in database
GPG Key ID: FA148B892AB48044
1 changed files with 12 additions and 0 deletions

View File

@ -45,6 +45,13 @@
#endif #endif
#endif /* EGL_KHR_create_context */ #endif /* EGL_KHR_create_context */
#ifndef EGL_EXT_pixel_format_float
#define EGL_EXT_pixel_format_float
#define EGL_COLOR_COMPONENT_TYPE_EXT 0x3339
#define EGL_COLOR_COMPONENT_TYPE_FIXED_EXT 0x333A
#define EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT 0x333B
#endif
#ifndef EGL_EXT_present_opaque #ifndef EGL_EXT_present_opaque
#define EGL_EXT_present_opaque 1 #define EGL_EXT_present_opaque 1
#define EGL_PRESENT_OPAQUE_EXT 0x31DF #define EGL_PRESENT_OPAQUE_EXT 0x31DF
@ -762,6 +769,11 @@ SDL_EGL_PrivateChooseConfig(_THIS, SDL_bool set_config_caveat_none)
attribs[i++] = _this->gl_config.multisamplesamples; attribs[i++] = _this->gl_config.multisamplesamples;
} }
if (_this->gl_config.floatbuffers) {
attribs[i++] = EGL_COLOR_COMPONENT_TYPE_EXT;
attribs[i++] = EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT;
}
if (_this->egl_data->is_offscreen) { if (_this->egl_data->is_offscreen) {
attribs[i++] = EGL_SURFACE_TYPE; attribs[i++] = EGL_SURFACE_TYPE;
attribs[i++] = EGL_PBUFFER_BIT; attribs[i++] = EGL_PBUFFER_BIT;