Arm Community
Site
Search
User
Site
Search
User
Groups
Education Hub
Distinguished Ambassadors
Open Source Software and Platforms
Research Collaboration and Enablement
Forums
AI and ML forum
Architectures and Processors forum
Arm Development Platforms forum
Arm Development Studio forum
Arm Virtual Hardware forum
Automotive forum
Compilers and Libraries forum
Graphics, Gaming, and VR forum
High Performance Computing (HPC) forum
Infrastructure Solutions forum
Internet of Things (IoT) forum
Keil forum
Morello forum
Operating Systems forum
SoC Design and Simulation forum
SystemReady Forum
Blogs
AI and ML blog
Announcements
Architectures and Processors blog
Automotive blog
Graphics, Gaming, and VR blog
High Performance Computing (HPC) blog
Infrastructure Solutions blog
Internet of Things (IoT) blog
Operating Systems blog
SoC Design and Simulation blog
Tools, Software and IDEs blog
Support
Arm Support Services
Documentation
Downloads
Training
Arm Approved program
Arm Design Reviews
Community Help
More
Cancel
Support forums
Graphics, Gaming, and VR forum
glReadPixels
Jump...
Cancel
Locked
Locked
Replies
12 replies
Subscribers
136 subscribers
Views
9617 views
Users
0 members are here
OpenGL ES
Mali-GPU
Mali-400
Options
Share
More actions
Cancel
Related
How was your experience today?
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion
glReadPixels
Sebastien (OBSOLETE) Baudouin
over 11 years ago
Note: This was originally posted on 9th March 2012 at
http://forums.arm.com
Hi all,
i try to render scene in an off screen way, controlling the location of my pixels (the pointer is fixed by myself).
It seems that MALI400 is not supporting eglCreatePixmapSurface, interface that would allows me to create a surface that will use pixels in the location i want.
As it is not working i have to use the API glReadPixels which is very very slow (compare to other GPU).
So i'm wondering if there is a reason for such bad perf for ReadPixels and if someone knows a way with MALI to render a scene at place (pixel buffer address) you want.
Thanks for your help.
BR
Seb
Parents
Sebastien (OBSOLETE) Baudouin
over 11 years ago
Note: This was originally posted on 14th March 2012 at
http://forums.arm.com
Hi Karthik,
First i wanted to thanks you for the very good feedback you provided me.I implemented the solution you gave and it is working fine with a very good level of performance compare to glReadPixels.
For information, I wanted to notice that i had to adapt a part of step 6 code:
you are creating a texture and also a EGLImageKHR. On my side i modified your code to arrive to following one.
glViewport[color=#666600]([/color][color=#006666]0[/color][color=#666600],[/color] [color=#006666]0[/color][color=#666600],[/color] w[color=#666600],[/color] h[color=#666600]);[/color]
checkGlError[color=#666600]([/color][color=#008800]"glViewport"[/color][color=#666600]);[/color][color=#880000]/* Initialize FBOs. */[/color]
glGenFramebuffers[color=#666600]([/color][color=#006666]1[/color][color=#666600],[/color] [color=#666600]&[/color]iFBO[color=#666600]);[/color]
checkGlError[color=#666600]([/color][color=#008800]"glGenFramebuffers"[/color][color=#666600]);[/color][color=#666600]
[/color][color=#880000]/* Initialize FBO texture. */[/color]
glGenTextures[color=#666600]([/color][color=#006666]1[/color][color=#666600],[/color] [color=#666600]&[/color]iFBOTex[color=#666600]);[/color]
glBindTexture[color=#666600]([/color]GL_TEXTURE_2D[color=#666600],[/color] iFBOTex[color=#666600]);[/color]
_glEGLImageTargetTexture2DOES[color=#666600]([/color]GL_TEXTURE_2D[color=#666600],[/color] pEGLImage[color=#666600]);[/color]
checkGlError[color=#666600]([/color][color=#008800]"_glEGLImageTargetTexture2DOES"[/color][color=#666600]);[/color][color=#666600]
[/color][color=#880000]/* Attach texture to the framebuffer. */[/color]
glFramebufferTexture2D[color=#666600]([/color]GL_FRAMEBUFFER[color=#666600],[/color] GL_COLOR_ATTACHMENT0[color=#666600],[/color] GL_TEXTURE_2D[color=#666600],[/color] iFBOTex[color=#666600],[/color] [color=#006666]0[/color][color=#666600]);[/color]
checkGlError[color=#666600]([/color][color=#008800]"glFramebufferTexture2D"[/color][color=#666600]);[/color]
[color=#880000]/* Check FBO is OK. */[/color]
iResult [color=#666600]=[/color] glCheckFramebufferStatus[color=#666600]([/color]GL_FRAMEBUFFER[color=#666600]);[/color]
[color=#000088]if[/color][color=#666600]([/color]iResult [color=#666600]!=[/color] GL_FRAMEBUFFER_COMPLETE[color=#666600])[/color]
[color=#666600]{[/color]
LOGE[color=#666600]([/color][color=#008800]"Error: Framebuffer incomplete at %s:%i\n"[/color][color=#666600],[/color] __FILE__[color=#666600],[/color] __LINE__[color=#666600]);[/color]
[color=#666600]}[/color]
[color=#880000]/* Render to framebuffer object. */[/color]
[color=#880000]/* Bind our framebuffer for rendering. */[/color]
glBindFramebuffer[color=#666600]([/color]GL_FRAMEBUFFER[color=#666600],[/color] iFBO[color=#666600]);[/color]
checkGlError[color=#666600]([/color][color=#008800]"glBindFramebuffer"[/color][color=#666600]);[/color]
[color=#880000]/* Unbind framebuffer. */[/color]
glBindFramebuffer[color=#666600]([/color]GL_FRAMEBUFFER[color=#666600],[/color] [color=#006666]0[/color][color=#666600]);[/color]
Cancel
Up
0
Down
Cancel
Reply
Sebastien (OBSOLETE) Baudouin
over 11 years ago
Note: This was originally posted on 14th March 2012 at
http://forums.arm.com
Hi Karthik,
First i wanted to thanks you for the very good feedback you provided me.I implemented the solution you gave and it is working fine with a very good level of performance compare to glReadPixels.
For information, I wanted to notice that i had to adapt a part of step 6 code:
you are creating a texture and also a EGLImageKHR. On my side i modified your code to arrive to following one.
glViewport[color=#666600]([/color][color=#006666]0[/color][color=#666600],[/color] [color=#006666]0[/color][color=#666600],[/color] w[color=#666600],[/color] h[color=#666600]);[/color]
checkGlError[color=#666600]([/color][color=#008800]"glViewport"[/color][color=#666600]);[/color][color=#880000]/* Initialize FBOs. */[/color]
glGenFramebuffers[color=#666600]([/color][color=#006666]1[/color][color=#666600],[/color] [color=#666600]&[/color]iFBO[color=#666600]);[/color]
checkGlError[color=#666600]([/color][color=#008800]"glGenFramebuffers"[/color][color=#666600]);[/color][color=#666600]
[/color][color=#880000]/* Initialize FBO texture. */[/color]
glGenTextures[color=#666600]([/color][color=#006666]1[/color][color=#666600],[/color] [color=#666600]&[/color]iFBOTex[color=#666600]);[/color]
glBindTexture[color=#666600]([/color]GL_TEXTURE_2D[color=#666600],[/color] iFBOTex[color=#666600]);[/color]
_glEGLImageTargetTexture2DOES[color=#666600]([/color]GL_TEXTURE_2D[color=#666600],[/color] pEGLImage[color=#666600]);[/color]
checkGlError[color=#666600]([/color][color=#008800]"_glEGLImageTargetTexture2DOES"[/color][color=#666600]);[/color][color=#666600]
[/color][color=#880000]/* Attach texture to the framebuffer. */[/color]
glFramebufferTexture2D[color=#666600]([/color]GL_FRAMEBUFFER[color=#666600],[/color] GL_COLOR_ATTACHMENT0[color=#666600],[/color] GL_TEXTURE_2D[color=#666600],[/color] iFBOTex[color=#666600],[/color] [color=#006666]0[/color][color=#666600]);[/color]
checkGlError[color=#666600]([/color][color=#008800]"glFramebufferTexture2D"[/color][color=#666600]);[/color]
[color=#880000]/* Check FBO is OK. */[/color]
iResult [color=#666600]=[/color] glCheckFramebufferStatus[color=#666600]([/color]GL_FRAMEBUFFER[color=#666600]);[/color]
[color=#000088]if[/color][color=#666600]([/color]iResult [color=#666600]!=[/color] GL_FRAMEBUFFER_COMPLETE[color=#666600])[/color]
[color=#666600]{[/color]
LOGE[color=#666600]([/color][color=#008800]"Error: Framebuffer incomplete at %s:%i\n"[/color][color=#666600],[/color] __FILE__[color=#666600],[/color] __LINE__[color=#666600]);[/color]
[color=#666600]}[/color]
[color=#880000]/* Render to framebuffer object. */[/color]
[color=#880000]/* Bind our framebuffer for rendering. */[/color]
glBindFramebuffer[color=#666600]([/color]GL_FRAMEBUFFER[color=#666600],[/color] iFBO[color=#666600]);[/color]
checkGlError[color=#666600]([/color][color=#008800]"glBindFramebuffer"[/color][color=#666600]);[/color]
[color=#880000]/* Unbind framebuffer. */[/color]
glBindFramebuffer[color=#666600]([/color]GL_FRAMEBUFFER[color=#666600],[/color] [color=#006666]0[/color][color=#666600]);[/color]
Cancel
Up
0
Down
Cancel
Children
No data