WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 106508
[EFL] [WebGL] Add support for bliting texture contents to FBO.
https://bugs.webkit.org/show_bug.cgi?id=106508
Summary
[EFL] [WebGL] Add support for bliting texture contents to FBO.
Kalyan
Reported
2013-01-09 17:12:17 PST
We currently rely on EXT_framebuffer_blit to copy contents from one FBO to another. This extension is not exposed on GLES1.1 or 2.0. ANGLE_framebuffer_blit seems to provide similar interactions. I am not sure how well it is supported. Does Angle included as part of WebKit include support for the extension ?? One possibility is to use this extension when available and provide a fall back mechanism.
Attachments
WIP
(30.21 KB, patch)
2013-01-09 17:14 PST
,
Kalyan
no flags
Details
Formatted Diff
Diff
WIP
(24.57 KB, patch)
2013-01-14 11:12 PST
,
Kalyan
no flags
Details
Formatted Diff
Diff
WIP
(30.38 KB, patch)
2013-01-29 14:08 PST
,
Kalyan
no flags
Details
Formatted Diff
Diff
WIP
(21.99 KB, patch)
2013-02-08 07:15 PST
,
Kalyan
no flags
Details
Formatted Diff
Diff
patch
(8.47 KB, patch)
2013-02-09 10:13 PST
,
Kalyan
no flags
Details
Formatted Diff
Diff
patchv2
(8.43 KB, patch)
2013-02-10 04:12 PST
,
Kalyan
no flags
Details
Formatted Diff
Diff
patchv3
(8.28 KB, patch)
2013-02-10 07:09 PST
,
Kalyan
no flags
Details
Formatted Diff
Diff
patchv4
(8.36 KB, patch)
2013-02-10 09:19 PST
,
Kalyan
noam
: review-
Details
Formatted Diff
Diff
patchv5
(12.79 KB, patch)
2013-02-11 17:00 PST
,
Kalyan
no flags
Details
Formatted Diff
Diff
Show Obsolete
(9)
View All
Add attachment
proposed patch, testcase, etc.
Kalyan
Comment 1
2013-01-09 17:14:32 PST
Created
attachment 182022
[details]
WIP
Kalyan
Comment 2
2013-01-09 17:22:01 PST
Initial Approach: what the patch does is basically check for the availability of the blit extension. If the extension is unavailable it falls back to use shaders.
Zeno Albisser
Comment 3
2013-01-14 03:50:31 PST
It seems the WIP patch is mostly based on what GraphicsSurfaceWin does. Do you think it would be possible to adopt this code instead of duplicating it? If it is just about naming, we could probably rename it to GraphicsSurfaceEGL or similar. ;)
Kalyan
Comment 4
2013-01-14 04:18:19 PST
(In reply to
comment #3
)
> It seems the WIP patch is mostly based on what GraphicsSurfaceWin does. Do you think it would be possible to adopt this code instead of duplicating it? > If it is just about naming, we could probably rename it to GraphicsSurfaceEGL or similar. ;)
It does do something similar to what is done in GraphicsSurfaceWin. I would be more than happy to get the common elements (copytexture parts out) and create something common to be used by all surface implementations. I can get rid of the Angle part from this patch. some differences: 1)This patch tries to make use of OES_vertex_array_object if supported. 2)Take Sampler objects into use(if supported). 3)Save and restore previous VBO state, program etc.
Kalyan
Comment 5
2013-01-14 11:12:37 PST
Created
attachment 182603
[details]
WIP
Kalyan
Comment 6
2013-01-29 14:08:06 PST
Created
attachment 185304
[details]
WIP
Kalyan
Comment 7
2013-02-08 07:15:46 PST
Created
attachment 187316
[details]
WIP Trying to use TextureMapperGL to achieve the same. Doesn't work yet
Kalyan
Comment 8
2013-02-09 08:03:26 PST
(In reply to
comment #7
)
> Created an attachment (id=187316) [details] > WIP > > Trying to use TextureMapperGL to achieve the same. Doesn't work yet
k, having it working now. Issue with TextureMapperGL is that it doesn't keep track of vertex array object. This was k as on it was mostly used in UI process. With WebGL apps this is needed, we could do this in our side so it doesn't add any overhead for other use cases.
Kalyan
Comment 9
2013-02-09 10:13:54 PST
Created
attachment 187435
[details]
patch
Kalyan
Comment 10
2013-02-09 10:22:27 PST
Made changes to use TextureMapperGL to draw texture content to surface.
Kalyan
Comment 11
2013-02-10 04:12:17 PST
Created
attachment 187475
[details]
patchv2
Kalyan
Comment 12
2013-02-10 07:09:01 PST
Created
attachment 187480
[details]
patchv3 minor cleanup.
WebKit Review Bot
Comment 13
2013-02-10 07:12:07 PST
Attachment 187480
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp', u'Source/WebCore/platform/graphics/opengl/GLPlatformSurface.cpp', u'Source/WebCore/platform/graphics/opengl/GLPlatformSurface.h']" exit_code: 1 Source/WebCore/platform/graphics/opengl/GLPlatformSurface.cpp:72: This { should be at the end of the previous line [whitespace/braces] [4] Total errors found: 1 in 4 files If any of these errors are false positives, please file a bug against check-webkit-style.
Kalyan
Comment 14
2013-02-10 09:19:46 PST
Created
attachment 187483
[details]
patchv4 style fix
Noam Rosenthal
Comment 15
2013-02-10 10:34:49 PST
Comment on
attachment 187483
[details]
patchv4 View in context:
https://bugs.webkit.org/attachment.cgi?id=187483&action=review
> Source/WebCore/platform/graphics/opengl/GLPlatformSurface.cpp:167 > + // Save any current bound vertex array to restore after updating surface with texture content. > + // This is needed as TextureMapperGL doesn't track and restore current bound vertex array. > + ScopedStateSaver stateSaver; > + ::glBindFramebuffer(GL_FRAMEBUFFER, 0); > + ::glColorMask(true, true, true, true); > + m_textureBlitter->beginPainting(); > + m_textureBlitter->drawTexture(texture, m_flags, textureSize, m_rect, m_identityMatrix, 1.0, 0); > + m_textureBlitter->endPainting();
This looks flaky. TextureMapperGL may change other attributes in the future and this would break. Why not use TextureMapperShaderProgram directly? That class has a more deterministic API than TMGL.
> Source/WebCore/platform/graphics/opengl/GLPlatformSurface.cpp:169 > + ::glFlush();
You probably don't want to flush with every frame...
Kalyan
Comment 16
2013-02-10 12:26:32 PST
(In reply to
comment #15
)
> (From update of
attachment 187483
[details]
) > TextureMapperGL may change other attributes in the future and this would break. > Why not use TextureMapperShaderProgram directly? That class has a more deterministic API than TMGL.
Good point. Will try to do that.
> > Source/WebCore/platform/graphics/opengl/GLPlatformSurface.cpp:169 > > + ::glFlush(); > > You probably don't want to flush with every frame...
It is needed for certain backends. (I.e using EGL and EGLImage). I do agree, this might not be the right place for it as on GLX you don't need to do this. I will get rid of it.
Kalyan
Comment 17
2013-02-11 17:00:04 PST
Created
attachment 187728
[details]
patchv5 Removes dependency on TextureMapperGL
Zeno Albisser
Comment 18
2013-02-13 03:35:54 PST
Comment on
attachment 187728
[details]
patchv5 View in context:
https://bugs.webkit.org/attachment.cgi?id=187728&action=review
> Source/WebCore/platform/graphics/opengl/GLPlatformSurface.cpp:73 > +class GLStateTracker {
I am somewhat skeptical to the concept of tracking gl states. How do you make sure that you track all the necessary states? Or in other words, how do you know that there is nothing else you have to save and restore? I know we have different concepts here between EFL and Qt. So just to make it clear, I am not objecting... just raising a concern, that might need to be adressed in future.
> Source/WebCore/platform/graphics/opengl/GLPlatformSurface.cpp:234 > + else
I would remove the "else" here. It seems not logical to have a conditional push() but a non-conditional pop(). But i see that it would not matter in case m_shaderProgram has not been initialized before.
Kalyan
Comment 19
2013-02-13 04:24:15 PST
(In reply to
comment #18
)
> (From update of
attachment 187728
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=187728&action=review
> I know we have different concepts here between EFL and Qt. So just to make it clear, I am not objecting... just raising a concern, that might need to be adressed in future.
We only track things which we manipulate on our side(i.e disable blend, depth, vbo etc) and not everything. I do agree that it might not be needed with a shared context in place. Support for that is not yet there, we can get rid of state tracking once we have it in place.
Kalyan
Comment 20
2013-02-16 03:01:50 PST
Comment on
attachment 187728
[details]
patchv5 Removing request for review till 109988 is done.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug