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

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

Created:
6 years, 11 months ago by oetuaho-nv
Modified:
6 years, 11 months ago
CC:
chromium-reviews, rjkroege, joi+watch-content_chromium.org, ozone-reviews_chromium.org, Ian Vollick, jam, extensions-reviews_chromium.org, chromium-apps-reviews_chromium.org, 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, Elliot Glaysher
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. The patch is conservative like this to avoid requiring the exact specification of binding conditions in case a function only has one name, and to make it less likely to expose bugs elsewhere. 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 TEST=gpu_unittests, cc_unittests, WebGL conformance tests Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=245623

Patch Set 1 #

Patch Set 2 : Fix missing GL_EXPORT issue #

Patch Set 3 : Rebased to accommodate stubbing out draw calls #

Total comments: 17

Patch Set 4 : Clarify code in generate_bindings.py according to feedback #

Total comments: 6

Patch Set 5 : Simplify Windows initialization and generate_bindings according to review feedback #

Patch Set 6 : Accommodate new tests added to gles2_cmd_decoder_unittest.cc #

Patch Set 7 : Accommodated changes in content tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+856 lines, -469 lines) Patch
cc/test/layer_tree_pixel_test.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
cc/test/pixel_test.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
content/browser/compositor/software_browser_compositor_output_surface_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
content/browser/compositor/software_output_device_ozone_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
content/common/gpu/gpu_channel_manager.cc View 1 chunk +2 lines, -2 lines 0 comments Download
content/common/gpu/media/rendering_helper.cc View 6 chunks +9 lines, -41 lines 0 comments Download
gpu/command_buffer/common/unittest_main.cc View 1 chunk +2 lines, -1 line 0 comments Download
gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc View 1 2 3 4 5 79 chunks +89 lines, -11 lines 0 comments Download
gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h View 4 chunks +4 lines, -2 lines 0 comments Download
gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc View 1 2 3 4 5 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 32 chunks +341 lines, -204 lines 0 comments Download
M ui/gl/gl.gyp View 2 chunks +4 lines, -0 lines 0 comments Download
ui/gl/gl_bindings.h View 1 2 5 chunks +11 lines, -17 lines 0 comments Download
ui/gl/gl_context.h View 4 chunks +13 lines, -4 lines 0 comments Download
ui/gl/gl_context.cc View 4 chunks +20 lines, -3 lines 0 comments Download
ui/gl/gl_context_cgl.cc View 1 chunk +1 line, -1 line 0 comments Download
ui/gl/gl_context_egl.cc View 1 chunk +1 line, -1 line 0 comments Download
ui/gl/gl_context_glx.cc View 1 chunk +1 line, -1 line 0 comments Download
ui/gl/gl_context_nsview.mm View 1 chunk +4 lines, -0 lines 0 comments Download
ui/gl/gl_context_osmesa.cc View 1 chunk +1 line, -1 line 0 comments Download
ui/gl/gl_context_stub_with_extensions.h View 1 1 chunk +37 lines, -0 lines 0 comments Download
ui/gl/gl_context_stub_with_extensions.cc View 1 chunk +30 lines, -0 lines 0 comments Download
ui/gl/gl_context_wgl.cc View 1 chunk +1 line, -1 line 0 comments Download
ui/gl/gl_egl_api_implementation.h View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
ui/gl/gl_egl_api_implementation.cc View 2 chunks +4 lines, -4 lines 0 comments Download
ui/gl/gl_gl_api_implementation.h View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
ui/gl/gl_gl_api_implementation.cc View 1 2 3 4 5 3 chunks +6 lines, -10 lines 0 comments Download
ui/gl/gl_glx_api_implementation.h View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
ui/gl/gl_glx_api_implementation.cc View 2 chunks +4 lines, -4 lines 0 comments Download
ui/gl/gl_implementation.h View 1 2 2 chunks +11 lines, -9 lines 0 comments Download
ui/gl/gl_implementation.cc View 1 2 4 chunks +2 lines, -31 lines 0 comments Download
ui/gl/gl_implementation_android.cc View 1 2 3 4 5 4 chunks +17 lines, -10 lines 0 comments Download
ui/gl/gl_implementation_linux.h View 1 chunk +1 line, -1 line 0 comments Download
ui/gl/gl_implementation_linux.cc View 2 chunks +3 lines, -3 lines 0 comments Download
ui/gl/gl_implementation_mac.cc View 5 chunks +17 lines, -10 lines 0 comments Download
M ui/gl/gl_implementation_ozone.cc View 6 chunks +19 lines, -12 lines 0 comments Download
M ui/gl/gl_implementation_win.cc View 1 2 3 4 7 chunks +63 lines, -18 lines 0 comments Download
M ui/gl/gl_implementation_x11.cc View 7 chunks +22 lines, -15 lines 0 comments Download
M ui/gl/gl_osmesa_api_implementation.h View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
ui/gl/gl_osmesa_api_implementation.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M ui/gl/gl_surface.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M ui/gl/gl_surface_wgl.cc View 1 2 3 4 5 1 chunk +0 lines, -19 lines 0 comments Download
M ui/gl/gl_surface_win.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
A ui/gl/gl_version_info.h View 1 chunk +34 lines, -0 lines 0 comments Download
A ui/gl/gl_version_info.cc View 1 chunk +38 lines, -0 lines 0 comments Download
M ui/gl/gl_wgl_api_implementation.h View 1 2 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: 25 (0 generated)
oetuaho-nv
Reuploaded from https://codereview.chromium.org/94963003/ to get the patch under the correct code review account. The patch ...
6 years, 11 months ago (2014-01-07 16:11:43 UTC) #1
Ken Russell (switch to Gerrit)
I think we should proceed with landing this, and not block it on crbug.com/270179 . ...
6 years, 11 months ago (2014-01-08 02:46:59 UTC) #2
oetuaho-nv
On 2014/01/08 02:46:59, Ken Russell wrote: > I think we should proceed with landing this, ...
6 years, 11 months ago (2014-01-08 17:18:07 UTC) #3
oetuaho-nv
On 2014/01/08 17:18:07, oetuaho-nv wrote: > On 2014/01/08 02:46:59, Ken Russell wrote: > > I ...
6 years, 11 months ago (2014-01-10 15:47:36 UTC) #4
oetuaho-nv
Submitted another rebase to accommodate the patch "Allow tests to stub out GL draw calls." ...
6 years, 11 months ago (2014-01-13 17:09:33 UTC) #5
no sievers
https://codereview.chromium.org/98643013/diff/620001/ui/gl/generate_bindings.py File ui/gl/generate_bindings.py (right): https://codereview.chromium.org/98643013/diff/620001/ui/gl/generate_bindings.py#newcode26 ui/gl/generate_bindings.py:26: extension/extensions: Extensions where the function is found. If not ...
6 years, 11 months ago (2014-01-13 23:46:40 UTC) #6
oetuaho-nv
https://codereview.chromium.org/98643013/diff/620001/ui/gl/generate_bindings.py File ui/gl/generate_bindings.py (right): https://codereview.chromium.org/98643013/diff/620001/ui/gl/generate_bindings.py#newcode26 ui/gl/generate_bindings.py:26: extension/extensions: Extensions where the function is found. If not ...
6 years, 11 months ago (2014-01-14 16:39:57 UTC) #7
oetuaho-nv
I did a couple of other minor improvements to generate_bindings.py while trying to take the ...
6 years, 11 months ago (2014-01-14 20:42:09 UTC) #8
no sievers
https://codereview.chromium.org/98643013/diff/620001/ui/gl/generate_bindings.py File ui/gl/generate_bindings.py (right): https://codereview.chromium.org/98643013/diff/620001/ui/gl/generate_bindings.py#newcode1493 ui/gl/generate_bindings.py:1493: if len(func['names']) == 1: On 2014/01/14 16:39:58, oetuaho-nv wrote: ...
6 years, 11 months ago (2014-01-14 23:16:00 UTC) #9
oetuaho-nv
https://codereview.chromium.org/98643013/diff/620001/ui/gl/generate_bindings.py File ui/gl/generate_bindings.py (right): https://codereview.chromium.org/98643013/diff/620001/ui/gl/generate_bindings.py#newcode1493 ui/gl/generate_bindings.py:1493: if len(func['names']) == 1: On 2014/01/14 23:16:01, sievers wrote: ...
6 years, 11 months ago (2014-01-15 15:50:23 UTC) #10
no sievers
LGTM, thanks. Just wondering: Why do you specify desktop GL 3.0 for many of the ...
6 years, 11 months ago (2014-01-15 21:03:27 UTC) #11
oetuaho-nv
On 2014/01/15 21:03:27, sievers wrote: > LGTM, thanks. > > Just wondering: Why do you ...
6 years, 11 months ago (2014-01-16 13:09:58 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/oetuaho@nvidia.com/98643013/900001
6 years, 11 months ago (2014-01-16 16:47:29 UTC) #13
commit-bot: I haz the power
Retried try job too often on linux_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_rel&number=214919
6 years, 11 months ago (2014-01-16 17:42:30 UTC) #14
oetuaho-nv
Needed to rebase yet again, since new tests with incompatible InitDecoder() call had appeared. Actually, ...
6 years, 11 months ago (2014-01-16 18:34:38 UTC) #15
no sievers
On 2014/01/16 18:34:38, oetuaho-nv wrote: > Needed to rebase yet again, since new tests with ...
6 years, 11 months ago (2014-01-16 21:04:42 UTC) #16
piman
lgtm
6 years, 11 months ago (2014-01-16 21:44:51 UTC) #17
Ken Russell (switch to Gerrit)
On 2014/01/16 21:04:42, sievers wrote: > On 2014/01/16 18:34:38, oetuaho-nv wrote: > > Needed to ...
6 years, 11 months ago (2014-01-16 21:46:33 UTC) #18
Ken Russell (switch to Gerrit)
On 2014/01/16 21:46:33, Ken Russell wrote: > On 2014/01/16 21:04:42, sievers wrote: > > On ...
6 years, 11 months ago (2014-01-17 04:21:31 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/oetuaho@nvidia.com/98643013/1400001
6 years, 11 months ago (2014-01-17 13:25:31 UTC) #20
commit-bot: I haz the power
Retried try job too often on chromium_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=chromium_presubmit&number=45298
6 years, 11 months ago (2014-01-17 13:44:21 UTC) #21
oetuaho-nv
Had to do one more rebase (hopefully the last) ** Presubmit ERRORS ** Missing LGTM ...
6 years, 11 months ago (2014-01-17 13:59:11 UTC) #22
scherkus (not reviewing)
media/ lgtm
6 years, 11 months ago (2014-01-17 17:46:58 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/oetuaho@nvidia.com/98643013/1400001
6 years, 11 months ago (2014-01-17 20:10:23 UTC) #24
commit-bot: I haz the power
6 years, 11 months ago (2014-01-17 21:31:04 UTC) #25
Message was sent while issue was closed.
Change committed as 245623

Powered by Google App Engine
This is Rietveld 408576698