Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(504)

Issue 94963003: Take GL version and extensions correctly into account when binding functions (Closed)

Created:
7 years ago by oetuaho
Modified:
6 years, 11 months ago
CC:
chromium-reviews, rjkroege, joi+watch-content_chromium.org, ozone-reviews_chromium.org, Ian Vollick, jam, sievers+watch_chromium.org, jbauman+watch_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, kalyank, piman+watch_chromium.org, cc-bugs_chromium.org, danakj+watch_chromium.org, jbauman, bajones
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Take GL version and extensions correctly into account when binding functions Platform libraries may return non-null function pointers from dlsym or getProcAddress for unsupported GL functions. Previously the function binding logic tried to address this with a separate extension function binding step, but since some of the bindings were still done without consulting the extension string, this failed to account for some conflicts between core and extension functions such as glDiscardFramebufferEXT vs. glInvalidateFramebuffer. Fix this by binding all functions that have multiple versions only after the context has been made current, and consulting the extension and version strings. The logic for binding each function is now only in one place in the generated code and easy to follow. The patch still does not guarantee that the function pointers would be set to null if the function is unsupported. It only attempts to guarantee that an incorrect version of a function is not bound in case another version is supported. GetGLCoreProcAddress and GetGLProcAddress are combined into one function, which always first looks for the function pointer with dlsym and then with GetProcAddress. The new conditions for binding make sure that this does not result in errors. The patched bindings do not query for incorrect OES or ARB extension strings without the GL_ prefix. Including the incorrect extension strings without the prefix is assumed to have been a mistake. This applies to OES_get_program_binary, OES_vertex_array_object, ARB_get_program_binary, ARB_vertex_array_object, and APPLE_vertex_array_object. BUG=322489

Patch Set 1 #

Patch Set 2 : Take GL version and extensions correctly into account when binding functions #

Patch Set 3 : Take GL version and extensions correctly into account when binding functions #

Patch Set 4 : Fixed issues related to RefCounted GLContext that showed up on debug build #

Total comments: 11

Patch Set 5 : Addressed review feedback and Mac build failure #

Total comments: 15

Patch Set 6 : Addressed nits #

Total comments: 27

Patch Set 7 : Addressed feedback not including Windows issues #

Patch Set 8 : Improve Windows initialization and renderBufferMultisample explanation #

Unified diffs Side-by-side diffs Delta from patch set Stats (+877 lines, -481 lines) Patch
M cc/test/layer_tree_pixel_test.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M cc/test/pixel_test.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/aura/software_browser_compositor_output_surface_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/aura/software_output_device_ozone_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/common/gpu/gpu_channel_manager.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/common/gpu/media/rendering_helper.cc View 1 2 3 4 5 6 6 chunks +9 lines, -41 lines 0 comments Download
M gpu/command_buffer/common/unittest_main.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc View 1 2 3 4 5 6 74 chunks +84 lines, -11 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h View 1 2 3 4 5 6 4 chunks +4 lines, -2 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc View 1 2 3 4 5 6 6 chunks +12 lines, -1 line 0 comments Download
M gpu/config/gpu_info_collector_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M gpu/tools/compositor_model_bench/compositor_model_bench.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M media/tools/player_x11/gl_video_renderer.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/compositor/test/test_suite.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/gl/generate_bindings.py View 1 2 3 4 5 6 7 32 chunks +343 lines, -201 lines 0 comments Download
M ui/gl/gl.gyp View 1 2 3 4 5 6 2 chunks +4 lines, -0 lines 0 comments Download
M ui/gl/gl_bindings.h View 1 2 3 4 5 6 5 chunks +11 lines, -17 lines 0 comments Download
M ui/gl/gl_context.h View 1 2 4 chunks +13 lines, -4 lines 0 comments Download
M ui/gl/gl_context.cc View 1 2 4 chunks +20 lines, -3 lines 0 comments Download
M ui/gl/gl_context_cgl.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/gl/gl_context_egl.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/gl/gl_context_glx.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/gl/gl_context_nsview.mm View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M ui/gl/gl_context_osmesa.cc View 1 1 chunk +1 line, -1 line 0 comments Download
A ui/gl/gl_context_stub_with_extensions.h View 1 2 3 4 5 6 1 chunk +37 lines, -0 lines 0 comments Download
A ui/gl/gl_context_stub_with_extensions.cc View 1 2 3 4 5 6 1 chunk +30 lines, -0 lines 0 comments Download
M ui/gl/gl_context_wgl.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/gl/gl_egl_api_implementation.h View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/gl/gl_egl_api_implementation.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M ui/gl/gl_gl_api_implementation.h View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/gl/gl_gl_api_implementation.cc View 1 2 3 4 5 6 3 chunks +6 lines, -10 lines 0 comments Download
M ui/gl/gl_glx_api_implementation.h View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/gl/gl_glx_api_implementation.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M ui/gl/gl_implementation.h View 1 2 3 4 5 6 2 chunks +11 lines, -9 lines 0 comments Download
M ui/gl/gl_implementation.cc View 4 chunks +2 lines, -31 lines 0 comments Download
M ui/gl/gl_implementation_android.cc View 1 2 3 4 5 6 4 chunks +17 lines, -10 lines 0 comments Download
M ui/gl/gl_implementation_linux.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/gl/gl_implementation_linux.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M ui/gl/gl_implementation_mac.cc View 1 2 3 4 5 6 5 chunks +17 lines, -10 lines 0 comments Download
M ui/gl/gl_implementation_ozone.cc View 1 2 3 4 5 6 6 chunks +19 lines, -12 lines 0 comments Download
M ui/gl/gl_implementation_win.cc View 1 2 3 4 5 6 7 7 chunks +51 lines, -18 lines 0 comments Download
M ui/gl/gl_implementation_x11.cc View 1 2 3 4 5 6 7 chunks +22 lines, -15 lines 0 comments Download
M ui/gl/gl_osmesa_api_implementation.h View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/gl/gl_osmesa_api_implementation.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M ui/gl/gl_surface.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -0 lines 0 comments Download
M ui/gl/gl_surface.cc View 1 2 3 4 5 6 7 2 chunks +5 lines, -3 lines 0 comments Download
M ui/gl/gl_surface_egl.cc View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download
M ui/gl/gl_surface_mac.cc View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M ui/gl/gl_surface_wgl.cc View 1 2 3 4 5 6 7 1 chunk +0 lines, -19 lines 0 comments Download
M ui/gl/gl_surface_win.cc View 1 2 3 4 5 6 7 1 chunk +19 lines, -15 lines 0 comments Download
M ui/gl/gl_surface_x11.cc View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
A ui/gl/gl_version_info.h View 1 2 3 4 5 6 1 chunk +34 lines, -0 lines 0 comments Download
A ui/gl/gl_version_info.cc View 1 2 3 4 5 6 1 chunk +38 lines, -0 lines 0 comments Download
M ui/gl/gl_wgl_api_implementation.h View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/gl/gl_wgl_api_implementation.cc View 2 chunks +4 lines, -4 lines 0 comments Download

Messages

Total messages: 30 (0 generated)
oetuaho
gpu_unittests, content_unittests and cc_unittests now passed on debug build on Android and Linux, in addition ...
7 years ago (2013-12-03 13:44:50 UTC) #1
Ken Russell (switch to Gerrit)
Thanks for working on this. I definitely think this change should be made, as you've ...
7 years ago (2013-12-04 02:30:51 UTC) #2
oetuaho
Answers to review feedback inline, I'll be uploading a new version shortly. https://codereview.chromium.org/94963003/diff/60001/ui/gl/generate_bindings.py File ui/gl/generate_bindings.py ...
7 years ago (2013-12-04 13:05:35 UTC) #3
oetuaho
I think the new patch set I uploaded is ready for testing on other platforms, ...
7 years ago (2013-12-04 14:54:10 UTC) #4
piman
https://codereview.chromium.org/94963003/diff/80001/ui/gl/generate_bindings.py File ui/gl/generate_bindings.py (right): https://codereview.chromium.org/94963003/diff/80001/ui/gl/generate_bindings.py#newcode1520 ui/gl/generate_bindings.py:1520: file.write(' if (!fn.%sFn && (%s))\n ' % (known_as, cond)) ...
7 years ago (2013-12-04 22:45:11 UTC) #5
oetuaho
Responded to comments. I'll upload a patch set addressing the nits. https://codereview.chromium.org/94963003/diff/80001/ui/gl/generate_bindings.py File ui/gl/generate_bindings.py (right): ...
7 years ago (2013-12-05 09:47:14 UTC) #6
piman
LGTM, thanks. https://codereview.chromium.org/94963003/diff/80001/ui/gl/generate_bindings.py File ui/gl/generate_bindings.py (right): https://codereview.chromium.org/94963003/diff/80001/ui/gl/generate_bindings.py#newcode1520 ui/gl/generate_bindings.py:1520: file.write(' if (!fn.%sFn && (%s))\n ' % ...
7 years ago (2013-12-05 19:47:03 UTC) #7
no sievers
This is great, thanks for doing this. https://codereview.chromium.org/94963003/diff/90001/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc File gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc (right): https://codereview.chromium.org/94963003/diff/90001/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc#newcode4875 gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc:4875: RenderbufferStorageMultisample(GL_RENDERBUFFER, Here ...
7 years ago (2013-12-05 20:51:56 UTC) #8
no sievers
https://codereview.chromium.org/94963003/diff/90001/ui/gl/gl_context.h File ui/gl/gl_context.h (right): https://codereview.chromium.org/94963003/diff/90001/ui/gl/gl_context.h#newcode121 ui/gl/gl_context.h:121: bool InitializeDynamicBindings(); On 2013/12/05 20:51:57, sievers wrote: > Is ...
7 years ago (2013-12-05 21:07:16 UTC) #9
no sievers
On 2013/12/05 21:07:16, sievers wrote: > https://codereview.chromium.org/94963003/diff/90001/ui/gl/gl_context.h > File ui/gl/gl_context.h (right): > > https://codereview.chromium.org/94963003/diff/90001/ui/gl/gl_context.h#newcode121 > ...
7 years ago (2013-12-05 21:11:03 UTC) #10
oetuaho
I don't think that we should cram overhauling the whole context creation into this patch ...
7 years ago (2013-12-09 17:17:06 UTC) #11
no sievers
> I don't think that we should cram overhauling the whole context creation into this ...
7 years ago (2013-12-09 20:05:23 UTC) #12
Ken Russell (switch to Gerrit)
Daniel, thanks for your careful review of this patch. This looks good. Only one issue ...
7 years ago (2013-12-10 00:07:06 UTC) #13
oetuaho
On 2013/12/10 00:07:06, Ken Russell wrote: > Daniel, thanks for your careful review of this ...
7 years ago (2013-12-10 10:37:56 UTC) #14
oetuaho
https://codereview.chromium.org/94963003/diff/90001/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc File gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc (right): https://codereview.chromium.org/94963003/diff/90001/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc#newcode4875 gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc:4875: RenderbufferStorageMultisample(GL_RENDERBUFFER, On 2013/12/10 00:07:07, Ken Russell wrote: > On ...
7 years ago (2013-12-10 10:39:04 UTC) #15
oetuaho
I now uploaded a patch set that takes care of all but the Windows issues, ...
7 years ago (2013-12-10 17:29:44 UTC) #16
no sievers
On 2013/12/10 10:39:04, oetuaho wrote: > https://codereview.chromium.org/94963003/diff/90001/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc > File gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc (right): > > https://codereview.chromium.org/94963003/diff/90001/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc#newcode4875 > ...
7 years ago (2013-12-10 18:30:17 UTC) #17
no sievers
On 2013/12/10 10:39:04, oetuaho wrote: > And I don't think that initializing the unit test ...
7 years ago (2013-12-10 18:33:40 UTC) #18
oetuaho
Re GL_EXT / ES3 core vs. GL_IMG, what I've understood is that for glRenderbufferStorageMultisample, there ...
7 years ago (2013-12-10 19:12:45 UTC) #19
no sievers
On 2013/12/10 19:12:45, oetuaho wrote: > Re GL_EXT / ES3 core vs. GL_IMG, what I've ...
7 years ago (2013-12-10 19:29:33 UTC) #20
Ken Russell (switch to Gerrit)
On 2013/12/10 19:29:33, sievers wrote: > On 2013/12/10 19:12:45, oetuaho wrote: > > Re GL_EXT ...
7 years ago (2013-12-10 19:53:49 UTC) #21
oetuaho
On 2013/12/10 19:53:49, Ken Russell wrote: > To reiterate: > > EXT_multisampled_render_to_texture and IMG_multisampled_render_to_texture are ...
7 years ago (2013-12-12 16:42:09 UTC) #22
no sievers
On 2013/12/12 16:42:09, oetuaho wrote: > I also had another idea for further development. Right ...
7 years ago (2013-12-12 19:40:31 UTC) #23
Ken Russell (switch to Gerrit)
On 2013/12/12 19:40:31, sievers wrote: > In the example above where extensions are *not* compatible, ...
7 years ago (2013-12-12 23:43:13 UTC) #24
oetuaho
On 2013/12/12 19:40:31, sievers wrote: > On 2013/12/12 16:42:09, oetuaho wrote: > > I also ...
7 years ago (2013-12-13 16:15:15 UTC) #25
oetuaho
The newest patch set contains an attempt to fix some of the Windows issues, and ...
7 years ago (2013-12-17 16:20:23 UTC) #26
Ken Russell (switch to Gerrit)
On 2013/12/17 16:20:23, oetuaho wrote: > The newest patch set contains an attempt to fix ...
7 years ago (2013-12-17 20:05:06 UTC) #27
no sievers
On 2013/12/17 16:20:23, oetuaho wrote: > The newest patch set contains an attempt to fix ...
7 years ago (2013-12-17 21:49:56 UTC) #28
oetuaho
On 2013/12/17 20:05:06, Ken Russell wrote: > On 2013/12/17 16:20:23, oetuaho wrote: > > The ...
7 years ago (2013-12-18 15:01:49 UTC) #29
oetuaho
6 years, 11 months ago (2014-01-07 15:10:27 UTC) #30
Message was sent while issue was closed.
I closed this issue to be able to reupload with my new account with the correct
email address.

The new issue, with the code rebased on top of the latest LKGR is here:
https://codereview.chromium.org/98643013 and I'll add the same reviewers there.

Powered by Google App Engine
This is Rietveld 408576698