epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 2 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 3 | * Copyright 2011 Google Inc. |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
bsalomon@google.com | 1744f97 | 2013-02-26 21:46:32 +0000 | [diff] [blame] | 9 | #include "gl/GrGLExtensions.h" |
tomhudson@google.com | 6c8c34e | 2012-02-14 15:31:03 +0000 | [diff] [blame] | 10 | #include "gl/GrGLInterface.h" |
bsalomon@google.com | 9c1f1ac | 2012-05-07 17:09:37 +0000 | [diff] [blame] | 11 | #include "../GrGLUtil.h" |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 12 | |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 13 | #define GL_GLEXT_PROTOTYPES |
bsalomon@google.com | 6f47663 | 2013-01-08 16:33:41 +0000 | [diff] [blame] | 14 | #include "osmesa_wrapper.h" |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 15 | |
bsalomon@google.com | 6fb736f | 2011-09-16 18:51:57 +0000 | [diff] [blame] | 16 | #define GR_GL_GET_PROC(F) interface->f ## F = (GrGL ## F ## Proc) \ |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 17 | OSMesaGetProcAddress("gl" #F); |
bsalomon@google.com | 6fb736f | 2011-09-16 18:51:57 +0000 | [diff] [blame] | 18 | #define GR_GL_GET_PROC_SUFFIX(F, S) interface->f ## F = (GrGL ## F ## Proc) \ |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 19 | OSMesaGetProcAddress("gl" #F #S); |
| 20 | |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 21 | // We use OSMesaGetProcAddress for every gl function to avoid accidentally using |
| 22 | // non-Mesa gl functions. |
| 23 | |
| 24 | const GrGLInterface* GrGLCreateMesaInterface() { |
bsalomon@google.com | 0b77d68 | 2011-08-19 13:28:54 +0000 | [diff] [blame] | 25 | if (NULL != OSMesaGetCurrentContext()) { |
bsalomon@google.com | 1744f97 | 2013-02-26 21:46:32 +0000 | [diff] [blame] | 26 | |
bsalomon@google.com | df8114d | 2013-03-01 18:10:41 +0000 | [diff] [blame] | 27 | GrGLGetStringProc getString = (GrGLGetStringProc) OSMesaGetProcAddress("glGetString"); |
| 28 | GrGLGetStringiProc getStringi = (GrGLGetStringiProc) OSMesaGetProcAddress("glGetStringi"); |
| 29 | GrGLGetIntegervProc getIntegerv = |
| 30 | (GrGLGetIntegervProc) OSMesaGetProcAddress("glGetIntegerv"); |
bsalomon@google.com | 1744f97 | 2013-02-26 21:46:32 +0000 | [diff] [blame] | 31 | |
| 32 | GrGLExtensions extensions; |
bsalomon@google.com | df8114d | 2013-03-01 18:10:41 +0000 | [diff] [blame] | 33 | if (!extensions.init(kDesktop_GrGLBinding, getString, getStringi, getIntegerv)) { |
bsalomon@google.com | 1744f97 | 2013-02-26 21:46:32 +0000 | [diff] [blame] | 34 | return NULL; |
| 35 | } |
| 36 | |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 37 | const char* versionString = (const char*) getString(GL_VERSION); |
bsalomon@google.com | c82b889 | 2011-09-22 14:10:33 +0000 | [diff] [blame] | 38 | GrGLVersion glVer = GrGLGetVersionFromString(versionString); |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 39 | |
bsalomon@google.com | c82b889 | 2011-09-22 14:10:33 +0000 | [diff] [blame] | 40 | if (glVer < GR_GL_VER(1,5)) { |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 41 | // We must have array and element_array buffer objects. |
bsalomon@google.com | 6fb736f | 2011-09-16 18:51:57 +0000 | [diff] [blame] | 42 | return NULL; |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 43 | } |
bsalomon@google.com | 6fb736f | 2011-09-16 18:51:57 +0000 | [diff] [blame] | 44 | GrGLInterface* interface = new GrGLInterface(); |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 45 | |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 46 | GR_GL_GET_PROC(ActiveTexture); |
| 47 | GR_GL_GET_PROC(BeginQuery); |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 48 | GR_GL_GET_PROC(AttachShader); |
| 49 | GR_GL_GET_PROC(BindAttribLocation); |
| 50 | GR_GL_GET_PROC(BindBuffer); |
bsalomon@google.com | bc5cf51 | 2011-09-21 16:21:07 +0000 | [diff] [blame] | 51 | GR_GL_GET_PROC(BindFragDataLocation); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 52 | GR_GL_GET_PROC(BindTexture); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 53 | GR_GL_GET_PROC(BlendFunc); |
robertphillips@google.com | e788430 | 2012-04-18 14:39:58 +0000 | [diff] [blame] | 54 | |
| 55 | if (glVer >= GR_GL_VER(1,4) || |
bsalomon@google.com | 1744f97 | 2013-02-26 21:46:32 +0000 | [diff] [blame] | 56 | extensions.has("GL_ARB_imaging") || |
| 57 | extensions.has("GL_EXT_blend_color")) { |
robertphillips@google.com | e788430 | 2012-04-18 14:39:58 +0000 | [diff] [blame] | 58 | GR_GL_GET_PROC(BlendColor); |
bsalomon@google.com | 0efcc37 | 2012-06-08 20:36:22 +0000 | [diff] [blame] | 59 | } |
robertphillips@google.com | e788430 | 2012-04-18 14:39:58 +0000 | [diff] [blame] | 60 | |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 61 | GR_GL_GET_PROC(BufferData); |
| 62 | GR_GL_GET_PROC(BufferSubData); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 63 | GR_GL_GET_PROC(Clear); |
| 64 | GR_GL_GET_PROC(ClearColor); |
| 65 | GR_GL_GET_PROC(ClearStencil); |
commit-bot@chromium.org | 46fbfe0 | 2013-08-30 15:52:12 +0000 | [diff] [blame] | 66 | GR_GL_GET_PROC(ClientActiveTexture); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 67 | GR_GL_GET_PROC(ColorMask); |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 68 | GR_GL_GET_PROC(CompileShader); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 69 | GR_GL_GET_PROC(CompressedTexImage2D); |
commit-bot@chromium.org | 98168bb | 2013-04-11 22:00:34 +0000 | [diff] [blame] | 70 | GR_GL_GET_PROC(CopyTexSubImage2D); |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 71 | GR_GL_GET_PROC(CreateProgram); |
| 72 | GR_GL_GET_PROC(CreateShader); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 73 | GR_GL_GET_PROC(CullFace); |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 74 | GR_GL_GET_PROC(DeleteBuffers); |
| 75 | GR_GL_GET_PROC(DeleteProgram); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 76 | GR_GL_GET_PROC(DeleteQueries); |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 77 | GR_GL_GET_PROC(DeleteShader); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 78 | GR_GL_GET_PROC(DeleteTextures); |
| 79 | GR_GL_GET_PROC(DepthMask); |
| 80 | GR_GL_GET_PROC(Disable); |
commit-bot@chromium.org | 46fbfe0 | 2013-08-30 15:52:12 +0000 | [diff] [blame] | 81 | GR_GL_GET_PROC(DisableClientState); |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 82 | GR_GL_GET_PROC(DisableVertexAttribArray); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 83 | GR_GL_GET_PROC(DrawArrays); |
| 84 | GR_GL_GET_PROC(DrawBuffer); |
bsalomon@google.com | d32c5f5 | 2011-08-02 19:29:03 +0000 | [diff] [blame] | 85 | GR_GL_GET_PROC(DrawBuffers); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 86 | GR_GL_GET_PROC(DrawElements); |
| 87 | GR_GL_GET_PROC(Enable); |
commit-bot@chromium.org | 46fbfe0 | 2013-08-30 15:52:12 +0000 | [diff] [blame] | 88 | GR_GL_GET_PROC(EnableClientState); |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 89 | GR_GL_GET_PROC(EnableVertexAttribArray); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 90 | GR_GL_GET_PROC(EndQuery); |
| 91 | GR_GL_GET_PROC(Finish); |
| 92 | GR_GL_GET_PROC(Flush); |
| 93 | GR_GL_GET_PROC(FrontFace); |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 94 | GR_GL_GET_PROC(GenBuffers); |
commit-bot@chromium.org | cffff79 | 2013-07-26 16:36:04 +0000 | [diff] [blame] | 95 | GR_GL_GET_PROC(GenerateMipmap); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 96 | GR_GL_GET_PROC(GenQueries); |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 97 | GR_GL_GET_PROC(GetBufferParameteriv); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 98 | GR_GL_GET_PROC(GetError); |
| 99 | GR_GL_GET_PROC(GetIntegerv); |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 100 | GR_GL_GET_PROC(GetProgramInfoLog); |
| 101 | GR_GL_GET_PROC(GetProgramiv); |
bsalomon@google.com | 1744f97 | 2013-02-26 21:46:32 +0000 | [diff] [blame] | 102 | if (glVer >= GR_GL_VER(3,3) || extensions.has("GL_ARB_timer_query")) { |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 103 | GR_GL_GET_PROC(GetQueryObjecti64v); |
| 104 | GR_GL_GET_PROC(GetQueryObjectui64v) |
| 105 | GR_GL_GET_PROC(QueryCounter); |
bsalomon@google.com | 1744f97 | 2013-02-26 21:46:32 +0000 | [diff] [blame] | 106 | } else if (extensions.has("GL_EXT_timer_query")) { |
bsalomon@google.com | f97c194 | 2011-10-19 21:35:26 +0000 | [diff] [blame] | 107 | GR_GL_GET_PROC_SUFFIX(GetQueryObjecti64v, EXT); |
| 108 | GR_GL_GET_PROC_SUFFIX(GetQueryObjectui64v, EXT); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 109 | } |
| 110 | GR_GL_GET_PROC(GetQueryObjectiv); |
| 111 | GR_GL_GET_PROC(GetQueryObjectuiv); |
| 112 | GR_GL_GET_PROC(GetQueryiv); |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 113 | GR_GL_GET_PROC(GetShaderInfoLog); |
| 114 | GR_GL_GET_PROC(GetShaderiv); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 115 | GR_GL_GET_PROC(GetString); |
bsalomon@google.com | 1744f97 | 2013-02-26 21:46:32 +0000 | [diff] [blame] | 116 | GR_GL_GET_PROC(GetStringi); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 117 | GR_GL_GET_PROC(GetTexLevelParameteriv); |
| 118 | GR_GL_GET_PROC(GenTextures); |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 119 | GR_GL_GET_PROC(GetUniformLocation); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 120 | GR_GL_GET_PROC(LineWidth); |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 121 | GR_GL_GET_PROC(LinkProgram); |
commit-bot@chromium.org | 46fbfe0 | 2013-08-30 15:52:12 +0000 | [diff] [blame] | 122 | GR_GL_GET_PROC(LoadIdentity); |
| 123 | GR_GL_GET_PROC(LoadMatrixf); |
| 124 | GR_GL_GET_PROC(MatrixMode); |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 125 | GR_GL_GET_PROC(MapBuffer); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 126 | GR_GL_GET_PROC(PixelStorei); |
| 127 | GR_GL_GET_PROC(ReadBuffer); |
| 128 | GR_GL_GET_PROC(ReadPixels); |
| 129 | GR_GL_GET_PROC(Scissor); |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 130 | GR_GL_GET_PROC(ShaderSource); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 131 | GR_GL_GET_PROC(StencilFunc); |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 132 | GR_GL_GET_PROC(StencilFuncSeparate); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 133 | GR_GL_GET_PROC(StencilMask); |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 134 | GR_GL_GET_PROC(StencilMaskSeparate); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 135 | GR_GL_GET_PROC(StencilOp); |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 136 | GR_GL_GET_PROC(StencilOpSeparate); |
commit-bot@chromium.org | 46fbfe0 | 2013-08-30 15:52:12 +0000 | [diff] [blame] | 137 | GR_GL_GET_PROC(TexGenf); |
| 138 | GR_GL_GET_PROC(TexGenfv); |
| 139 | GR_GL_GET_PROC(TexGeni); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 140 | GR_GL_GET_PROC(TexImage2D) |
| 141 | GR_GL_GET_PROC(TexParameteri); |
bsalomon@google.com | 6f6efa9 | 2012-05-31 18:09:11 +0000 | [diff] [blame] | 142 | GR_GL_GET_PROC(TexParameteriv); |
bsalomon@google.com | 280e99f | 2012-01-05 16:17:38 +0000 | [diff] [blame] | 143 | GR_GL_GET_PROC(TexStorage2D); |
| 144 | if (NULL == interface->fTexStorage2D) { |
| 145 | GR_GL_GET_PROC_SUFFIX(TexStorage2D, EXT); |
| 146 | } |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 147 | GR_GL_GET_PROC(TexSubImage2D); |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 148 | GR_GL_GET_PROC(Uniform1f); |
| 149 | GR_GL_GET_PROC(Uniform1i); |
| 150 | GR_GL_GET_PROC(Uniform1fv); |
| 151 | GR_GL_GET_PROC(Uniform1iv); |
| 152 | GR_GL_GET_PROC(Uniform2f); |
| 153 | GR_GL_GET_PROC(Uniform2i); |
| 154 | GR_GL_GET_PROC(Uniform2fv); |
| 155 | GR_GL_GET_PROC(Uniform2iv); |
| 156 | GR_GL_GET_PROC(Uniform3f); |
| 157 | GR_GL_GET_PROC(Uniform3i); |
| 158 | GR_GL_GET_PROC(Uniform3fv); |
| 159 | GR_GL_GET_PROC(Uniform3iv); |
| 160 | GR_GL_GET_PROC(Uniform4f); |
| 161 | GR_GL_GET_PROC(Uniform4i); |
| 162 | GR_GL_GET_PROC(Uniform4fv); |
| 163 | GR_GL_GET_PROC(Uniform4iv); |
| 164 | GR_GL_GET_PROC(UniformMatrix2fv); |
| 165 | GR_GL_GET_PROC(UniformMatrix3fv); |
| 166 | GR_GL_GET_PROC(UniformMatrix4fv); |
| 167 | GR_GL_GET_PROC(UnmapBuffer); |
| 168 | GR_GL_GET_PROC(UseProgram); |
| 169 | GR_GL_GET_PROC(VertexAttrib4fv); |
| 170 | GR_GL_GET_PROC(VertexAttribPointer); |
commit-bot@chromium.org | 46fbfe0 | 2013-08-30 15:52:12 +0000 | [diff] [blame] | 171 | GR_GL_GET_PROC(VertexPointer); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 172 | GR_GL_GET_PROC(Viewport); |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 173 | |
bsalomon@google.com | ecd8484 | 2013-03-01 15:36:02 +0000 | [diff] [blame] | 174 | if (glVer >= GR_GL_VER(3,0) || extensions.has("GL_ARB_vertex_array_object")) { |
| 175 | // no ARB suffix for GL_ARB_vertex_array_object |
| 176 | GR_GL_GET_PROC(BindVertexArray); |
| 177 | GR_GL_GET_PROC(DeleteVertexArrays); |
| 178 | GR_GL_GET_PROC(GenVertexArrays); |
| 179 | } |
| 180 | |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 181 | // First look for GL3.0 FBO or GL_ARB_framebuffer_object (same since |
| 182 | // GL_ARB_framebuffer_object doesn't use ARB suffix.) |
bsalomon@google.com | 1744f97 | 2013-02-26 21:46:32 +0000 | [diff] [blame] | 183 | if (glVer >= GR_GL_VER(3,0) || extensions.has("GL_ARB_framebuffer_object")) { |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 184 | GR_GL_GET_PROC(GenFramebuffers); |
bsalomon@google.com | cee661a | 2011-07-26 12:32:36 +0000 | [diff] [blame] | 185 | GR_GL_GET_PROC(GetFramebufferAttachmentParameteriv); |
| 186 | GR_GL_GET_PROC(GetRenderbufferParameteriv); |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 187 | GR_GL_GET_PROC(BindFramebuffer); |
| 188 | GR_GL_GET_PROC(FramebufferTexture2D); |
| 189 | GR_GL_GET_PROC(CheckFramebufferStatus); |
| 190 | GR_GL_GET_PROC(DeleteFramebuffers); |
| 191 | GR_GL_GET_PROC(RenderbufferStorage); |
| 192 | GR_GL_GET_PROC(GenRenderbuffers); |
| 193 | GR_GL_GET_PROC(DeleteRenderbuffers); |
| 194 | GR_GL_GET_PROC(FramebufferRenderbuffer); |
| 195 | GR_GL_GET_PROC(BindRenderbuffer); |
| 196 | GR_GL_GET_PROC(RenderbufferStorageMultisample); |
| 197 | GR_GL_GET_PROC(BlitFramebuffer); |
bsalomon@google.com | 1744f97 | 2013-02-26 21:46:32 +0000 | [diff] [blame] | 198 | } else if (extensions.has("GL_EXT_framebuffer_object")) { |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 199 | GR_GL_GET_PROC_SUFFIX(GenFramebuffers, EXT); |
bsalomon@google.com | cee661a | 2011-07-26 12:32:36 +0000 | [diff] [blame] | 200 | GR_GL_GET_PROC_SUFFIX(GetFramebufferAttachmentParameteriv, EXT); |
| 201 | GR_GL_GET_PROC_SUFFIX(GetRenderbufferParameteriv, EXT); |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 202 | GR_GL_GET_PROC_SUFFIX(BindFramebuffer, EXT); |
| 203 | GR_GL_GET_PROC_SUFFIX(FramebufferTexture2D, EXT); |
| 204 | GR_GL_GET_PROC_SUFFIX(CheckFramebufferStatus, EXT); |
| 205 | GR_GL_GET_PROC_SUFFIX(DeleteFramebuffers, EXT); |
| 206 | GR_GL_GET_PROC_SUFFIX(RenderbufferStorage, EXT); |
| 207 | GR_GL_GET_PROC_SUFFIX(GenRenderbuffers, EXT); |
| 208 | GR_GL_GET_PROC_SUFFIX(DeleteRenderbuffers, EXT); |
| 209 | GR_GL_GET_PROC_SUFFIX(FramebufferRenderbuffer, EXT); |
| 210 | GR_GL_GET_PROC_SUFFIX(BindRenderbuffer, EXT); |
bsalomon@google.com | 1744f97 | 2013-02-26 21:46:32 +0000 | [diff] [blame] | 211 | if (extensions.has("GL_EXT_framebuffer_multisample")) { |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 212 | GR_GL_GET_PROC_SUFFIX(RenderbufferStorageMultisample, EXT); |
| 213 | } |
bsalomon@google.com | 1744f97 | 2013-02-26 21:46:32 +0000 | [diff] [blame] | 214 | if (extensions.has("GL_EXT_framebuffer_blit")) { |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 215 | GR_GL_GET_PROC_SUFFIX(BlitFramebuffer, EXT); |
| 216 | } |
| 217 | } else { |
| 218 | // we must have FBOs |
bsalomon@google.com | 6fb736f | 2011-09-16 18:51:57 +0000 | [diff] [blame] | 219 | delete interface; |
| 220 | return NULL; |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 221 | } |
bsalomon@google.com | 271cffc | 2011-05-20 14:13:56 +0000 | [diff] [blame] | 222 | GR_GL_GET_PROC(BindFragDataLocationIndexed); |
bsalomon@google.com | 6fb736f | 2011-09-16 18:51:57 +0000 | [diff] [blame] | 223 | interface->fBindingsExported = kDesktop_GrGLBinding; |
| 224 | return interface; |
| 225 | } else { |
| 226 | return NULL; |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 227 | } |
bungeman@google.com | 0e45441 | 2011-05-19 17:47:02 +0000 | [diff] [blame] | 228 | } |