OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "GrGLAssembleInterface.h" | 10 #include "GrGLAssembleInterface.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 GET_PROC(DeleteQueries); | 131 GET_PROC(DeleteQueries); |
132 GET_PROC(DeleteShader); | 132 GET_PROC(DeleteShader); |
133 GET_PROC(DeleteTextures); | 133 GET_PROC(DeleteTextures); |
134 GET_PROC(DepthMask); | 134 GET_PROC(DepthMask); |
135 GET_PROC(Disable); | 135 GET_PROC(Disable); |
136 GET_PROC(DisableVertexAttribArray); | 136 GET_PROC(DisableVertexAttribArray); |
137 GET_PROC(DrawArrays); | 137 GET_PROC(DrawArrays); |
138 GET_PROC(DrawBuffer); | 138 GET_PROC(DrawBuffer); |
139 GET_PROC(DrawBuffers); | 139 GET_PROC(DrawBuffers); |
140 GET_PROC(DrawElements); | 140 GET_PROC(DrawElements); |
| 141 |
| 142 if (glVer >= GR_GL_VER(3,1) || extensions.has("GL_ARB_draw_instanced") || |
| 143 extensions.has("GL_EXT_draw_instanced")) { |
| 144 GET_PROC(DrawArraysInstanced); |
| 145 GET_PROC(DrawElementsInstanced); |
| 146 } |
| 147 |
| 148 if (glVer >= GR_GL_VER(4,0)) { |
| 149 // We don't use ARB_draw_indirect because it does not support a base ins
tance. |
| 150 GET_PROC(DrawArraysIndirect); |
| 151 GET_PROC(DrawElementsIndirect); |
| 152 } |
| 153 |
141 GET_PROC(Enable); | 154 GET_PROC(Enable); |
142 GET_PROC(EnableVertexAttribArray); | 155 GET_PROC(EnableVertexAttribArray); |
143 GET_PROC(EndQuery); | 156 GET_PROC(EndQuery); |
144 GET_PROC(Finish); | 157 GET_PROC(Finish); |
145 GET_PROC(Flush); | 158 GET_PROC(Flush); |
146 GET_PROC(FrontFace); | 159 GET_PROC(FrontFace); |
147 GET_PROC(GenBuffers); | 160 GET_PROC(GenBuffers); |
148 GET_PROC(GenerateMipmap); | 161 GET_PROC(GenerateMipmap); |
149 GET_PROC(GetBufferParameteriv); | 162 GET_PROC(GetBufferParameteriv); |
150 GET_PROC(GetError); | 163 GET_PROC(GetError); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 GET_PROC(Uniform4iv); | 234 GET_PROC(Uniform4iv); |
222 GET_PROC(UniformMatrix2fv); | 235 GET_PROC(UniformMatrix2fv); |
223 GET_PROC(UniformMatrix3fv); | 236 GET_PROC(UniformMatrix3fv); |
224 GET_PROC(UniformMatrix4fv); | 237 GET_PROC(UniformMatrix4fv); |
225 GET_PROC(UnmapBuffer); | 238 GET_PROC(UnmapBuffer); |
226 GET_PROC(UseProgram); | 239 GET_PROC(UseProgram); |
227 GET_PROC(VertexAttrib1f); | 240 GET_PROC(VertexAttrib1f); |
228 GET_PROC(VertexAttrib2fv); | 241 GET_PROC(VertexAttrib2fv); |
229 GET_PROC(VertexAttrib3fv); | 242 GET_PROC(VertexAttrib3fv); |
230 GET_PROC(VertexAttrib4fv); | 243 GET_PROC(VertexAttrib4fv); |
| 244 |
| 245 if (glVer >= GR_GL_VER(3,2) || extensions.has("GL_ARB_instanced_arrays")) { |
| 246 GET_PROC(VertexAttribDivisor); |
| 247 } |
| 248 |
231 GET_PROC(VertexAttribPointer); | 249 GET_PROC(VertexAttribPointer); |
232 GET_PROC(Viewport); | 250 GET_PROC(Viewport); |
233 GET_PROC(BindFragDataLocationIndexed); | 251 GET_PROC(BindFragDataLocationIndexed); |
234 | 252 |
235 if (glVer >= GR_GL_VER(3,0) || extensions.has("GL_ARB_vertex_array_object"))
{ | 253 if (glVer >= GR_GL_VER(3,0) || extensions.has("GL_ARB_vertex_array_object"))
{ |
236 // no ARB suffix for GL_ARB_vertex_array_object | 254 // no ARB suffix for GL_ARB_vertex_array_object |
237 GET_PROC(BindVertexArray); | 255 GET_PROC(BindVertexArray); |
238 GET_PROC(GenVertexArrays); | 256 GET_PROC(GenVertexArrays); |
239 GET_PROC(DeleteVertexArrays); | 257 GET_PROC(DeleteVertexArrays); |
240 } else if (extensions.has("GL_APPLE_vertex_array_object")) { | 258 } else if (extensions.has("GL_APPLE_vertex_array_object")) { |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 GET_PROC(InvalidateFramebuffer); | 349 GET_PROC(InvalidateFramebuffer); |
332 GET_PROC(InvalidateSubFramebuffer); | 350 GET_PROC(InvalidateSubFramebuffer); |
333 GET_PROC(InvalidateTexImage); | 351 GET_PROC(InvalidateTexImage); |
334 GET_PROC(InvalidateTexSubImage); | 352 GET_PROC(InvalidateTexSubImage); |
335 } | 353 } |
336 | 354 |
337 if (glVer >= GR_GL_VER(4,3) || extensions.has("GL_ARB_program_interface_quer
y")) { | 355 if (glVer >= GR_GL_VER(4,3) || extensions.has("GL_ARB_program_interface_quer
y")) { |
338 GET_PROC(GetProgramResourceLocation); | 356 GET_PROC(GetProgramResourceLocation); |
339 } | 357 } |
340 | 358 |
341 if (glVer >= GR_GL_VER(3,1) || extensions.has("GL_ARB_draw_instanced") || | 359 if (glVer >= GR_GL_VER(4,3)) { |
342 extensions.has("GL_EXT_draw_instanced")) { | 360 // We don't use ARB_multi_draw_indirect because it does not support GL_D
RAW_INDIRECT_BUFFER. |
343 GET_PROC(DrawArraysInstanced); | 361 GET_PROC(MultiDrawArraysIndirect); |
344 GET_PROC(DrawElementsInstanced); | 362 GET_PROC(MultiDrawElementsIndirect); |
345 } | |
346 | |
347 if (glVer >= GR_GL_VER(3,2) || extensions.has("GL_ARB_instanced_arrays")) { | |
348 GET_PROC(VertexAttribDivisor); | |
349 } | 363 } |
350 | 364 |
351 if (extensions.has("GL_NV_bindless_texture")) { | 365 if (extensions.has("GL_NV_bindless_texture")) { |
352 GET_PROC_SUFFIX(GetTextureHandle, NV); | 366 GET_PROC_SUFFIX(GetTextureHandle, NV); |
353 GET_PROC_SUFFIX(GetTextureSamplerHandle, NV); | 367 GET_PROC_SUFFIX(GetTextureSamplerHandle, NV); |
354 GET_PROC_SUFFIX(MakeTextureHandleResident, NV); | 368 GET_PROC_SUFFIX(MakeTextureHandleResident, NV); |
355 GET_PROC_SUFFIX(MakeTextureHandleNonResident, NV); | 369 GET_PROC_SUFFIX(MakeTextureHandleNonResident, NV); |
356 GET_PROC_SUFFIX(GetImageHandle, NV); | 370 GET_PROC_SUFFIX(GetImageHandle, NV); |
357 GET_PROC_SUFFIX(MakeImageHandleResident, NV); | 371 GET_PROC_SUFFIX(MakeImageHandleResident, NV); |
358 GET_PROC_SUFFIX(MakeImageHandleNonResident, NV); | 372 GET_PROC_SUFFIX(MakeImageHandleNonResident, NV); |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 GET_PROC(CullFace); | 571 GET_PROC(CullFace); |
558 GET_PROC(DeleteBuffers); | 572 GET_PROC(DeleteBuffers); |
559 GET_PROC(DeleteProgram); | 573 GET_PROC(DeleteProgram); |
560 GET_PROC(DeleteShader); | 574 GET_PROC(DeleteShader); |
561 GET_PROC(DeleteTextures); | 575 GET_PROC(DeleteTextures); |
562 GET_PROC_SUFFIX(DeleteVertexArrays, OES); | 576 GET_PROC_SUFFIX(DeleteVertexArrays, OES); |
563 GET_PROC(DepthMask); | 577 GET_PROC(DepthMask); |
564 GET_PROC(Disable); | 578 GET_PROC(Disable); |
565 GET_PROC(DisableVertexAttribArray); | 579 GET_PROC(DisableVertexAttribArray); |
566 GET_PROC(DrawArrays); | 580 GET_PROC(DrawArrays); |
| 581 |
| 582 if (version >= GR_GL_VER(3,0)) { |
| 583 GET_PROC(DrawArraysInstanced); |
| 584 GET_PROC(DrawElementsInstanced); |
| 585 } else if (extensions.has("GL_EXT_draw_instanced")) { |
| 586 GET_PROC_SUFFIX(DrawArraysInstanced, EXT); |
| 587 GET_PROC_SUFFIX(DrawElementsInstanced, EXT); |
| 588 } |
| 589 |
| 590 if (version >= GR_GL_VER(3,1)) { |
| 591 GET_PROC(DrawArraysIndirect); |
| 592 GET_PROC(DrawElementsIndirect); |
| 593 } |
| 594 |
567 GET_PROC(DrawElements); | 595 GET_PROC(DrawElements); |
568 GET_PROC(Enable); | 596 GET_PROC(Enable); |
569 GET_PROC(EnableVertexAttribArray); | 597 GET_PROC(EnableVertexAttribArray); |
570 GET_PROC(Finish); | 598 GET_PROC(Finish); |
571 GET_PROC(Flush); | 599 GET_PROC(Flush); |
572 GET_PROC(FrontFace); | 600 GET_PROC(FrontFace); |
573 GET_PROC(GenBuffers); | 601 GET_PROC(GenBuffers); |
574 GET_PROC(GenerateMipmap); | 602 GET_PROC(GenerateMipmap); |
575 GET_PROC(GenTextures); | 603 GET_PROC(GenTextures); |
576 GET_PROC_SUFFIX(GenVertexArrays, OES); | 604 GET_PROC_SUFFIX(GenVertexArrays, OES); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 GET_PROC(Uniform4fv); | 664 GET_PROC(Uniform4fv); |
637 GET_PROC(Uniform4iv); | 665 GET_PROC(Uniform4iv); |
638 GET_PROC(UniformMatrix2fv); | 666 GET_PROC(UniformMatrix2fv); |
639 GET_PROC(UniformMatrix3fv); | 667 GET_PROC(UniformMatrix3fv); |
640 GET_PROC(UniformMatrix4fv); | 668 GET_PROC(UniformMatrix4fv); |
641 GET_PROC(UseProgram); | 669 GET_PROC(UseProgram); |
642 GET_PROC(VertexAttrib1f); | 670 GET_PROC(VertexAttrib1f); |
643 GET_PROC(VertexAttrib2fv); | 671 GET_PROC(VertexAttrib2fv); |
644 GET_PROC(VertexAttrib3fv); | 672 GET_PROC(VertexAttrib3fv); |
645 GET_PROC(VertexAttrib4fv); | 673 GET_PROC(VertexAttrib4fv); |
| 674 |
| 675 if (version >= GR_GL_VER(3,0)) { |
| 676 GET_PROC(VertexAttribDivisor); |
| 677 } else if (extensions.has("GL_EXT_instanced_arrays")) { |
| 678 GET_PROC_SUFFIX(VertexAttribDivisor, EXT); |
| 679 } |
| 680 |
646 GET_PROC(VertexAttribPointer); | 681 GET_PROC(VertexAttribPointer); |
647 GET_PROC(Viewport); | 682 GET_PROC(Viewport); |
648 GET_PROC(BindFramebuffer); | 683 GET_PROC(BindFramebuffer); |
649 GET_PROC(BindRenderbuffer); | 684 GET_PROC(BindRenderbuffer); |
650 GET_PROC(CheckFramebufferStatus); | 685 GET_PROC(CheckFramebufferStatus); |
651 GET_PROC(DeleteFramebuffers); | 686 GET_PROC(DeleteFramebuffers); |
652 GET_PROC(DeleteRenderbuffers); | 687 GET_PROC(DeleteRenderbuffers); |
653 GET_PROC(FramebufferRenderbuffer); | 688 GET_PROC(FramebufferRenderbuffer); |
654 GET_PROC(FramebufferTexture2D); | 689 GET_PROC(FramebufferTexture2D); |
655 | 690 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 GET_PROC_SUFFIX(BindFragmentInputLocation, CHROMIUM); | 807 GET_PROC_SUFFIX(BindFragmentInputLocation, CHROMIUM); |
773 } | 808 } |
774 | 809 |
775 if (extensions.has("GL_NV_framebuffer_mixed_samples")) { | 810 if (extensions.has("GL_NV_framebuffer_mixed_samples")) { |
776 GET_PROC_SUFFIX(CoverageModulation, NV); | 811 GET_PROC_SUFFIX(CoverageModulation, NV); |
777 } | 812 } |
778 if (extensions.has("GL_CHROMIUM_framebuffer_mixed_samples")) { | 813 if (extensions.has("GL_CHROMIUM_framebuffer_mixed_samples")) { |
779 GET_PROC_SUFFIX(CoverageModulation, CHROMIUM); | 814 GET_PROC_SUFFIX(CoverageModulation, CHROMIUM); |
780 } | 815 } |
781 | 816 |
782 if (version >= GR_GL_VER(3,0)) { | 817 if (extensions.has("GL_EXT_multi_draw_indirect")) { |
783 GET_PROC(DrawArraysInstanced); | 818 GET_PROC_SUFFIX(MultiDrawArraysIndirect, EXT); |
784 GET_PROC(DrawElementsInstanced); | 819 GET_PROC_SUFFIX(MultiDrawElementsIndirect, EXT); |
785 } else if (extensions.has("GL_EXT_draw_instanced")) { | |
786 GET_PROC_SUFFIX(DrawArraysInstanced, EXT); | |
787 GET_PROC_SUFFIX(DrawElementsInstanced, EXT); | |
788 } | |
789 | |
790 if (version >= GR_GL_VER(3,0)) { | |
791 GET_PROC(VertexAttribDivisor); | |
792 } else if (extensions.has("GL_EXT_instanced_arrays")) { | |
793 GET_PROC_SUFFIX(VertexAttribDivisor, EXT); | |
794 } | 820 } |
795 | 821 |
796 if (extensions.has("GL_NV_bindless_texture")) { | 822 if (extensions.has("GL_NV_bindless_texture")) { |
797 GET_PROC_SUFFIX(GetTextureHandle, NV); | 823 GET_PROC_SUFFIX(GetTextureHandle, NV); |
798 GET_PROC_SUFFIX(GetTextureSamplerHandle, NV); | 824 GET_PROC_SUFFIX(GetTextureSamplerHandle, NV); |
799 GET_PROC_SUFFIX(MakeTextureHandleResident, NV); | 825 GET_PROC_SUFFIX(MakeTextureHandleResident, NV); |
800 GET_PROC_SUFFIX(MakeTextureHandleNonResident, NV); | 826 GET_PROC_SUFFIX(MakeTextureHandleNonResident, NV); |
801 GET_PROC_SUFFIX(GetImageHandle, NV); | 827 GET_PROC_SUFFIX(GetImageHandle, NV); |
802 GET_PROC_SUFFIX(MakeImageHandleResident, NV); | 828 GET_PROC_SUFFIX(MakeImageHandleResident, NV); |
803 GET_PROC_SUFFIX(MakeImageHandleNonResident, NV); | 829 GET_PROC_SUFFIX(MakeImageHandleNonResident, NV); |
(...skipping 30 matching lines...) Expand all Loading... |
834 if (extensions.has("EGL_KHR_image") || extensions.has("EGL_KHR_image_base"))
{ | 860 if (extensions.has("EGL_KHR_image") || extensions.has("EGL_KHR_image_base"))
{ |
835 GET_EGL_PROC_SUFFIX(CreateImage, KHR); | 861 GET_EGL_PROC_SUFFIX(CreateImage, KHR); |
836 GET_EGL_PROC_SUFFIX(DestroyImage, KHR); | 862 GET_EGL_PROC_SUFFIX(DestroyImage, KHR); |
837 } | 863 } |
838 | 864 |
839 interface->fStandard = kGLES_GrGLStandard; | 865 interface->fStandard = kGLES_GrGLStandard; |
840 interface->fExtensions.swap(&extensions); | 866 interface->fExtensions.swap(&extensions); |
841 | 867 |
842 return interface; | 868 return interface; |
843 } | 869 } |
OLD | NEW |