Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extensions: add MESA_EGL_image_cubemap #533

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions extensions/MESA/MESA_EGL_image_cubemap.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
Name

MESA_EGL_image_cubemap

Name Strings

GL_MESA_EGL_image_cubemap

Contact

Simon Zeni, Status Holdings Ltd. <[email protected]>

Contributors

Simon Zeni

Status

Draft

Version

Version 0.1, 2022/08/05

Number

OpenGL ES Extension #546

Dependencies

OpenGL ES 2.0 is required, or any previous version that offers support
for GL_ARB_texture_cube_map extension

GL_OES_EGL_image is required.

EGL 1.2 is required, with the EGL_KHR_image or EGL_KHR_image_base

This extension is written based on the wording of the OpenGL 2.0

Overview

This extension provides a mechanism for creating cubemap textures from
EGLImage objects.

MESA_gl_texture_cubemap_image defines the process of creating an EGLImage
from an OpenGL ES cubemap texture.

The companion EGL_KHR_image_base and EGL_KHR_image extensions provide the
definition and rationale for EGLImage objects.

EGL extension specifications are located in the EGL Registry at
http://www.khronos.org/registry/egl/

New Tokens

None.

New Procedures and Functions

void EGLImageTargetCubemapMESA(enum target, eglImageOES image)

Additions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization)

In section 3.8.2 following the specification added by OES_EGL_image:

"It is also possible to specify cubemap textures images from existing
EGLImage objects. Images specified this way will be EGLImage sibilings
with the original EGLImage source and any other EGLImage targets.

The command

void EGLImageTargetCubemapMESA(enum target, eglImageOES image);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this now a subset of https://registry.khronos.org/OpenGL/extensions/EXT/EXT_EGL_image_storage.txt - or am I missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have somehow missed this extension, maybe because it's not implemented in mesa 1, thanks!
I'll take care of fixing that.


defines an complete cubemap texture with 6 faces. All properties of the
texture images (including width, height, format, border, mipmap levels of
detail, and image data) are taken from the specified eglImageOES <image>,
rather than from the client or the framebuffer. Any existing image arrays
associated with any mipmap levels in the texture object are freed (as if
TexImage was called for each, with an image of zero size). As a result of
this referencing operation, all of the pixel data in the <buffer> used as
the EGLImage source resource (i.e., the <buffer> parameter passed to the
CreateImageOES command that returned <image>) will become undefined.

<target> must be TEXTURE_CUBE_MAP, and <image> must be the handle of a
valid EGLImage resource, cast into the type eglImageOES. Assuming no
errors are generated by the command EGLImageTargetCubemapMESA, the newly
specified texture object will be an EGLImage target of the specified
eglImageOES. If an application later respecifies any face of the cubemap
texture object (through mechanism such as calls to TexImage2D or
TexSubImage2D), the implementation must allocate a new space for the image
and copy any existing data to the newly (re)specified texture object. The
(re)specified texture object will not be an EGLImage target.

If the GL is unable to specify a texture object using the supploed
eglImageOES <image> (if the <image> refers to a different type of image,
such as a TEXTURE_2D), the error INVALID_OPERATION is generated.

If <image> does not refer to a valid eglImageOES object, the error
INVALID_VALUE is generated.

If <target> is not TEXTURE_CUBE_MAP, the error INVALID_ENUM is generated.

Revision History

Version 0.1, 2022-08-05 (Simon Zeni)
- Initial draft
2 changes: 2 additions & 0 deletions extensions/glext.php
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,8 @@
</li>
<li value=546><a href="extensions/EXT/EXT_EGL_sync.txt">GL_EXT_EGL_sync</a>
</li>
<li value=546><a href="extensions/MESA/MESA_EGL_image_cubemap.txt">GL_MESA_EGL_image_cubemap</a>
</li>
<li value=547><a href="extensions/INTEL/INTEL_shader_integer_functions2.txt">GL_INTEL_shader_integer_functions2</a>
</li>
<li value=548><a href="extensions/MESA/MESA_framebuffer_flip_x.txt">GL_MESA_framebuffer_flip_x</a>
Expand Down
6 changes: 6 additions & 0 deletions extensions/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -5684,4 +5684,10 @@
'supporters' : { 'NVIDIA' },
'url' : 'extensions/NV/GLX_NV_multigpu_context.txt',
},
'GL_MESA_EGL_image_cubemap' : {
'number' : 546,
'flags' : { 'public' },
'supporters' : { 'MESA' },
'url' : 'extensions/MESA/MESA_EGL_image_cubemap.txt',
},
}