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

Issue 8381001: Split GL binding init into core and extension part (Closed)

Created:
9 years, 2 months ago by Sami (do not use)
Modified:
9 years, 1 month ago
CC:
chromium-reviews, Vangelis Kokkevis
Visibility:
Public.

Description

Split GL binding init into core and extension part This change splits the GL binding initialization into to phases: core functions and extension functions. This is motivated by two peculiarities of the EGL window binding layer: 1. Pointers to core GL entry points may not be queried through eglGetProcAddress(). 2. The return value of eglGetProcAddress() is not specified to be NULL for unsupported functions. In light of these limitations, the current strategy of blindly querying all GL entry points from eglGetProcAddress() and falling back to dlsym() results in bogus function pointers on some EGL implementations. This patch fixes the problem as follows: 1. Add GetGLCoreProcAddress() that only queries dlsym() and use it to initialize pointers to all entry points. On EGL based platforms pointers to extension functions will most likely be NULL at this point. 2. When a context is first made current, look up the set of supported extensions and use GetGLProcAddress() to populate the remaining extension function pointers. The reworked GL bindings generator uses the standard Khronos headers to recognize the extension functions and produce appropriate initialization code. Note that the patch also updates gl2ext.h to match the upstream Khronos version and corrects some minor errors in the downstream changes. BUG=5427391 TEST= Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=107602

Patch Set 1 #

Patch Set 2 : Use existing glext.h/wglext.h/glxext.h headers from Mesa. #

Total comments: 2

Patch Set 3 : Added dependencies to gl.gyp. Used NOT_REACHED() instead of DCHECK(0). #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1061 lines, -80 lines) Patch
A gpu/EGL/eglext.h View 1 chunk +335 lines, -0 lines 0 comments Download
M gpu/GLES2/gl2ext.h View 19 chunks +364 lines, -40 lines 0 comments Download
M gpu/command_buffer/common/gl_mock.h View 1 2 chunks +1 line, -2 lines 0 comments Download
M gpu/command_buffer/common/gles2_cmd_format.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M ui/gfx/gl/generate_bindings.py View 1 2 14 chunks +195 lines, -25 lines 0 comments Download
M ui/gfx/gl/gl.gyp View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M ui/gfx/gl/gl_bindings_skia_in_process.cc View 1 2 chunks +4 lines, -5 lines 0 comments Download
M ui/gfx/gl/gl_context.h View 1 chunk +5 lines, -0 lines 0 comments Download
M ui/gfx/gl/gl_context.cc View 1 chunk +11 lines, -0 lines 0 comments Download
M ui/gfx/gl/gl_context_cgl.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M ui/gfx/gl/gl_context_egl.cc View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M ui/gfx/gl/gl_context_glx.cc View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M ui/gfx/gl/gl_context_osmesa.cc View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M ui/gfx/gl/gl_context_wgl.cc View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M ui/gfx/gl/gl_implementation.h View 3 chunks +11 lines, -0 lines 0 comments Download
M ui/gfx/gl/gl_implementation.cc View 4 chunks +31 lines, -3 lines 0 comments Download
M ui/gfx/gl/gl_implementation_linux.cc View 1 2 1 chunk +25 lines, -0 lines 0 comments Download
M ui/gfx/gl/gl_implementation_mac.cc View 1 chunk +20 lines, -0 lines 0 comments Download
M ui/gfx/gl/gl_implementation_win.cc View 1 chunk +25 lines, -0 lines 0 comments Download
M ui/gfx/gl/gl_interface.h View 1 1 chunk +4 lines, -4 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Sami
9 years, 1 month ago (2011-10-26 16:52:22 UTC) #1
vangelis
On 2011/10/26 16:52:22, Sami wrote: apatrick and gman would be more appropriate reviewers for this ...
9 years, 1 month ago (2011-10-26 17:40:56 UTC) #2
greggman
I only looked at the files in gpu. For those LGTM Al would know the ...
9 years, 1 month ago (2011-10-26 18:21:18 UTC) #3
apatrick_chromium
Looks good but I think the generate_gl_bindings action in ui/gfx/gl/gl.gyp needs to be updated to ...
9 years, 1 month ago (2011-10-26 18:29:11 UTC) #4
Sami
Thanks for the reviews. I've added dependencies to gl.gyp and switched to NOTREACHED(). Another look ...
9 years, 1 month ago (2011-10-27 13:46:06 UTC) #5
apatrick_chromium
LGTM
9 years, 1 month ago (2011-10-27 17:54:30 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skyostil@google.com/8381001/8001
9 years, 1 month ago (2011-10-27 17:58:50 UTC) #7
commit-bot: I haz the power
9 years, 1 month ago (2011-10-27 17:59:04 UTC) #8
Presubmit check for 8381001-8001 failed and returned exit status 1.

Running presubmit commit checks ...

** Presubmit Messages **
If this change requires manual test instructions to QA team, add
TEST=[instructions].

** Presubmit Warnings **
Found lines longer than 80 characters (first 5 shown).
  gpu/EGL/eglext.h, line 37, 81 chars \
  gpu/EGL/eglext.h, line 71, 116 chars \
  gpu/EGL/eglext.h, line 72, 91 chars \
  gpu/EGL/eglext.h, line 74, 127 chars \
  gpu/EGL/eglext.h, line 75, 102 chars

Found a tab character in:

***************
gpu/EGL/eglext.h, line 42
gpu/EGL/eglext.h, line 43
gpu/EGL/eglext.h, line 44
gpu/EGL/eglext.h, line 49
gpu/EGL/eglext.h, line 50
gpu/EGL/eglext.h, line 51
gpu/EGL/eglext.h, line 52
gpu/EGL/eglext.h, line 53
gpu/EGL/eglext.h, line 54
gpu/EGL/eglext.h, line 55
gpu/EGL/eglext.h, line 56
gpu/EGL/eglext.h, line 57
gpu/EGL/eglext.h, line 58
gpu/EGL/eglext.h, line 59
gpu/EGL/eglext.h, line 60
gpu/EGL/eglext.h, line 61
gpu/EGL/eglext.h, line 62
gpu/EGL/eglext.h, line 63
gpu/EGL/eglext.h, line 64
gpu/EGL/eglext.h, line 65
gpu/EGL/eglext.h, line 66
gpu/EGL/eglext.h, line 67
gpu/EGL/eglext.h, line 68
gpu/EGL/eglext.h, line 69
gpu/EGL/eglext.h, line 80
gpu/EGL/eglext.h, line 82
gpu/EGL/eglext.h, line 93
gpu/EGL/eglext.h, line 98
gpu/EGL/eglext.h, line 99
gpu/EGL/eglext.h, line 104
gpu/EGL/eglext.h, line 105
gpu/EGL/eglext.h, line 106
gpu/EGL/eglext.h, line 107
gpu/EGL/eglext.h, line 108
gpu/EGL/eglext.h, line 109
gpu/EGL/eglext.h, line 114
gpu/EGL/eglext.h, line 115
gpu/EGL/eglext.h, line 120
gpu/EGL/eglext.h, line 130
gpu/EGL/eglext.h, line 131
gpu/EGL/eglext.h, line 132
gpu/EGL/eglext.h, line 133
gpu/EGL/eglext.h, line 134
gpu/EGL/eglext.h, line 135
gpu/EGL/eglext.h, line 136
gpu/EGL/eglext.h, line 137
gpu/EGL/eglext.h, line 138
gpu/EGL/eglext.h, line 139
gpu/EGL/eglext.h, line 158
gpu/EGL/eglext.h, line 168
gpu/EGL/eglext.h, line 169
gpu/EGL/eglext.h, line 170
gpu/EGL/eglext.h, line 171
gpu/EGL/eglext.h, line 176
gpu/EGL/eglext.h, line 195
gpu/EGL/eglext.h, line 196
gpu/EGL/eglext.h, line 197
gpu/EGL/eglext.h, line 198
gpu/EGL/eglext.h, line 199
gpu/EGL/eglext.h, line 200
gpu/EGL/eglext.h, line 201
gpu/EGL/eglext.h, line 202
gpu/EGL/eglext.h, line 203
gpu/EGL/eglext.h, line 204
gpu/EGL/eglext.h, line 205
gpu/EGL/eglext.h, line 206
gpu/EGL/eglext.h, line 207
gpu/EGL/eglext.h, line 231
gpu/EGL/eglext.h, line 232
gpu/EGL/eglext.h, line 233
gpu/EGL/eglext.h, line 241
gpu/EGL/eglext.h, line 248
gpu/EGL/eglext.h, line 249
gpu/EGL/eglext.h, line 250
gpu/EGL/eglext.h, line 251
gpu/EGL/eglext.h, line 258
gpu/EGL/eglext.h, line 263
gpu/EGL/eglext.h, line 265
gpu/EGL/eglext.h, line 266
gpu/EGL/eglext.h, line 267
gpu/EGL/eglext.h, line 272
gpu/EGL/eglext.h, line 273
gpu/EGL/eglext.h, line 274
gpu/EGL/eglext.h, line 275
gpu/EGL/eglext.h, line 276
gpu/EGL/eglext.h, line 277
gpu/EGL/eglext.h, line 278
gpu/EGL/eglext.h, line 289
gpu/EGL/eglext.h, line 306
gpu/EGL/eglext.h, line 311
gpu/EGL/eglext.h, line 312
gpu/EGL/eglext.h, line 313
***************

License must match:
.*? Copyright \(c\) 2011 The Chromium Authors\. All rights reserved\.\n.*? Use
of this source code is governed by a BSD-style license that can be\n.*? found in
the LICENSE file\.\n
Found a bad license header in these files:
  gpu/EGL/eglext.h \
  gpu/GLES2/gl2ext.h

Presubmit checks took 2.4s to calculate.

Powered by Google App Engine
This is Rietveld 408576698