Commit graph

10 commits

Author SHA1 Message Date
Loïc Molinari
37a5c249e5 gl-renderer: Add OES_texture_float support to utilities
OES_texture_float allows OpenGL ES 2 implementations to support
GL_R32F, GL_RG32F, GL_RGB32F and GL_RGBA32F texture formats.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2025-02-06 08:42:56 +00:00
Loïc Molinari
9048d752c5 gl-renderer: Add OES_texture_half_float support to utilities
OES_texture_half_float allows OpenGL ES 2 implementations to support
GL_R16F, GL_RG16F, GL_RGB16F and GL_RGBA16F texture formats.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2025-02-06 08:42:56 +00:00
Loïc Molinari
eaf2ec3888 gl-renderer: Add EXT_texture_rg support to utilities
EXT_texture_rg adds support for GL_R8 and GL_RG8 FBOs and textures.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2025-02-06 08:42:56 +00:00
Loïc Molinari
177efc7a59 gl-renderer: Add EXT_texture_storage support to utilities
OpenGL ES 2 implementations support texture immutability and sized
internal formats using the GL_EXT_texture_storage extension.

Co-authored-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2025-02-06 08:42:56 +00:00
Loïc Molinari
0cede83390 gl-renderer: Add OpenGL ES 2 support to texture utilities
Use glTexImage2D() instead of glTexStorage2D() and convert coloured
sized internal formats to base formats in order to support OpenGL ES
2.

Co-authored-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2025-02-06 08:42:56 +00:00
Loïc Molinari
a7611efce9 gl-renderer: Add texture utilities
Add gl_texture_is_format_supported(), gl_texture_2d_init(),
gl_texture_2d_upload() and gl_texture_fini() utilities. The creation
function accepts all the coloured sized internal format from OpenGL ES
3 using glTexStorage2D() to create immutable textures and reduce API
overhead.

Co-authored-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2025-02-06 08:42:56 +00:00
Loïc Molinari
8c74b48493 gl-renderer: Check for OES_EGL_image to create FBOs from EGLImages
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2025-02-06 08:42:56 +00:00
Loïc Molinari
dc7299d69c gl-renderer: Check supported FBO formats
Validate the colour-renderable sized internal formats passed to
gl_fbo_init() using a new gl_fbo_is_format_supported() utility. Sized
internal formats are now required. More formats will progressively be
added depending on the OpenGL ES version and the supported extensions.

Support for RGBA8 FBOs is now required by the GL renderer.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2025-02-06 08:42:56 +00:00
Loïc Molinari
1dc6868947 gl-renderer: Add OpenGL ES 3 sized internal format table
This table will be used as a reference by GL utilities.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2025-02-06 08:42:56 +00:00
Loïc Molinari
7f3969c823 gl-renderer: Move utilities to new file gl-utils.c
These utility functions are used (or will be used) in different source
files. This prevents gl-renderer.c from growing too much (the coming
texture utilities are quite verbose) by moving generic functions out.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2025-02-06 08:42:56 +00:00