OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 | 8 |
9 #include "gl/GrGLInterface.h" | 9 #include "gl/GrGLInterface.h" |
10 #include "gl/GrGLExtensions.h" | 10 #include "gl/GrGLExtensions.h" |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 // These functions are added to the 3.0 version of both GLES and GL. | 459 // These functions are added to the 3.0 version of both GLES and GL. |
460 if (glVer >= GR_GL_VER(3,0) || | 460 if (glVer >= GR_GL_VER(3,0) || |
461 (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_EXT_map_buffer_r
ange")) || | 461 (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_EXT_map_buffer_r
ange")) || |
462 (kGL_GrGLStandard == fStandard && fExtensions.has("GL_ARB_map_buffer_ran
ge"))) { | 462 (kGL_GrGLStandard == fStandard && fExtensions.has("GL_ARB_map_buffer_ran
ge"))) { |
463 if (NULL == fFunctions.fMapBufferRange || | 463 if (NULL == fFunctions.fMapBufferRange || |
464 NULL == fFunctions.fFlushMappedBufferRange) { | 464 NULL == fFunctions.fFlushMappedBufferRange) { |
465 RETURN_FALSE_INTERFACE; | 465 RETURN_FALSE_INTERFACE; |
466 } | 466 } |
467 } | 467 } |
468 | 468 |
469 if ((kGL_GrGLStandard == fStandard && fExtensions.has("GL_EXT_direct_state_a
ccess")) || | |
470 (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_NV_path_renderin
g"))) { | |
471 if (NULL == fFunctions.fMatrixLoadf || | |
472 NULL == fFunctions.fMatrixLoadIdentity) { | |
473 RETURN_FALSE_INTERFACE | |
474 } | |
475 } | |
476 | |
477 if ((kGL_GrGLStandard == fStandard && | 469 if ((kGL_GrGLStandard == fStandard && |
478 (glVer >= GR_GL_VER(4,3) || fExtensions.has("GL_ARB_program_interface_q
uery"))) || | 470 (glVer >= GR_GL_VER(4,3) || fExtensions.has("GL_ARB_program_interface_q
uery"))) || |
479 (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,1))) { | 471 (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,1))) { |
480 if (NULL == fFunctions.fGetProgramResourceLocation) { | 472 if (NULL == fFunctions.fGetProgramResourceLocation) { |
481 RETURN_FALSE_INTERFACE | 473 RETURN_FALSE_INTERFACE |
482 } | 474 } |
483 } | 475 } |
484 | 476 |
485 if (kGLES_GrGLStandard == fStandard || glVer >= GR_GL_VER(4,1) || | 477 if (kGLES_GrGLStandard == fStandard || glVer >= GR_GL_VER(4,1) || |
486 fExtensions.has("GL_ARB_ES2_compatibility")) { | 478 fExtensions.has("GL_ARB_ES2_compatibility")) { |
487 #if 0 // Enable this once Chrome gives us the function ptr | 479 #if 0 // Enable this once Chrome gives us the function ptr |
488 if (NULL == fFunctions.fGetShaderPrecisionFormat) { | 480 if (NULL == fFunctions.fGetShaderPrecisionFormat) { |
489 RETURN_FALSE_INTERFACE | 481 RETURN_FALSE_INTERFACE |
490 } | 482 } |
491 #endif | 483 #endif |
492 } | 484 } |
493 | 485 |
494 if (fExtensions.has("GL_NV_path_rendering")) { | 486 if (fExtensions.has("GL_NV_path_rendering")) { |
495 if (NULL == fFunctions.fPathCommands || | 487 if (NULL == fFunctions.fMatrixLoadf || |
| 488 NULL == fFunctions.fMatrixLoadIdentity || |
| 489 NULL == fFunctions.fPathCommands || |
496 NULL == fFunctions.fPathCoords || | 490 NULL == fFunctions.fPathCoords || |
497 NULL == fFunctions.fPathParameteri || | 491 NULL == fFunctions.fPathParameteri || |
498 NULL == fFunctions.fPathParameterf || | 492 NULL == fFunctions.fPathParameterf || |
499 NULL == fFunctions.fGenPaths || | 493 NULL == fFunctions.fGenPaths || |
500 NULL == fFunctions.fDeletePaths || | 494 NULL == fFunctions.fDeletePaths || |
501 NULL == fFunctions.fIsPath || | 495 NULL == fFunctions.fIsPath || |
502 NULL == fFunctions.fPathStencilFunc || | 496 NULL == fFunctions.fPathStencilFunc || |
503 NULL == fFunctions.fStencilFillPath || | 497 NULL == fFunctions.fStencilFillPath || |
504 NULL == fFunctions.fStencilStrokePath || | 498 NULL == fFunctions.fStencilStrokePath || |
505 NULL == fFunctions.fStencilFillPathInstanced || | 499 NULL == fFunctions.fStencilFillPathInstanced || |
(...skipping 27 matching lines...) Expand all Loading... |
533 RETURN_FALSE_INTERFACE | 527 RETURN_FALSE_INTERFACE |
534 } | 528 } |
535 } | 529 } |
536 | 530 |
537 if (fExtensions.has("GL_NV_framebuffer_mixed_samples")) { | 531 if (fExtensions.has("GL_NV_framebuffer_mixed_samples")) { |
538 if (NULL == fFunctions.fCoverageModulation) { | 532 if (NULL == fFunctions.fCoverageModulation) { |
539 RETURN_FALSE_INTERFACE | 533 RETURN_FALSE_INTERFACE |
540 } | 534 } |
541 } | 535 } |
542 | 536 |
| 537 if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,1)) || |
| 538 (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0)) || |
| 539 fExtensions.has("GL_ARB_draw_instanced") || |
| 540 fExtensions.has("GL_EXT_draw_instanced")) { |
| 541 if (NULL == fFunctions.fDrawArraysInstanced || |
| 542 NULL == fFunctions.fDrawElementsInstanced) { |
| 543 RETURN_FALSE_INTERFACE |
| 544 } |
| 545 } |
| 546 |
| 547 if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,2)) || |
| 548 (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0)) || |
| 549 fExtensions.has("GL_ARB_instanced_arrays") || |
| 550 fExtensions.has("GL_EXT_instanced_arrays")) { |
| 551 if (NULL == fFunctions.fVertexAttribDivisor) { |
| 552 RETURN_FALSE_INTERFACE |
| 553 } |
| 554 } |
| 555 |
| 556 if (fExtensions.has("GL_NV_bindless_texture")) { |
| 557 if (NULL == fFunctions.fGetTextureHandle || |
| 558 NULL == fFunctions.fGetTextureSamplerHandle || |
| 559 NULL == fFunctions.fMakeTextureHandleResident || |
| 560 NULL == fFunctions.fMakeTextureHandleNonResident || |
| 561 NULL == fFunctions.fGetImageHandle || |
| 562 NULL == fFunctions.fMakeImageHandleResident || |
| 563 NULL == fFunctions.fMakeImageHandleNonResident || |
| 564 NULL == fFunctions.fIsTextureHandleResident || |
| 565 NULL == fFunctions.fIsImageHandleResident || |
| 566 NULL == fFunctions.fUniformHandleui64 || |
| 567 NULL == fFunctions.fUniformHandleui64v || |
| 568 NULL == fFunctions.fProgramUniformHandleui64 || |
| 569 NULL == fFunctions.fProgramUniformHandleui64v) { |
| 570 RETURN_FALSE_INTERFACE |
| 571 } |
| 572 } |
| 573 |
| 574 if (kGL_GrGLStandard == fStandard && fExtensions.has("GL_EXT_direct_state_ac
cess")) { |
| 575 if (NULL == fFunctions.fTextureParameteri || |
| 576 NULL == fFunctions.fTextureParameteriv || |
| 577 NULL == fFunctions.fTextureParameterf || |
| 578 NULL == fFunctions.fTextureParameterfv || |
| 579 NULL == fFunctions.fTextureImage1D || |
| 580 NULL == fFunctions.fTextureImage2D || |
| 581 NULL == fFunctions.fTextureSubImage1D || |
| 582 NULL == fFunctions.fTextureSubImage2D || |
| 583 NULL == fFunctions.fCopyTextureImage1D || |
| 584 NULL == fFunctions.fCopyTextureImage2D || |
| 585 NULL == fFunctions.fCopyTextureSubImage1D || |
| 586 NULL == fFunctions.fCopyTextureSubImage2D || |
| 587 NULL == fFunctions.fGetTextureImage || |
| 588 NULL == fFunctions.fGetTextureParameterfv || |
| 589 NULL == fFunctions.fGetTextureParameteriv || |
| 590 NULL == fFunctions.fGetTextureLevelParameterfv || |
| 591 NULL == fFunctions.fGetTextureLevelParameteriv) { |
| 592 RETURN_FALSE_INTERFACE |
| 593 } |
| 594 if (glVer >= GR_GL_VER(1,2)) { |
| 595 if (NULL == fFunctions.fTextureImage3D || |
| 596 NULL == fFunctions.fTextureSubImage3D || |
| 597 NULL == fFunctions.fCopyTextureSubImage3D || |
| 598 NULL == fFunctions.fCompressedTextureImage3D || |
| 599 NULL == fFunctions.fCompressedTextureImage2D || |
| 600 NULL == fFunctions.fCompressedTextureImage1D || |
| 601 NULL == fFunctions.fCompressedTextureSubImage3D || |
| 602 NULL == fFunctions.fCompressedTextureSubImage2D || |
| 603 NULL == fFunctions.fCompressedTextureSubImage1D || |
| 604 NULL == fFunctions.fGetCompressedTextureImage) { |
| 605 RETURN_FALSE_INTERFACE |
| 606 } |
| 607 } |
| 608 if (glVer >= GR_GL_VER(1,5)) { |
| 609 if (NULL == fFunctions.fNamedBufferData || |
| 610 NULL == fFunctions.fNamedBufferSubData || |
| 611 NULL == fFunctions.fMapNamedBuffer || |
| 612 NULL == fFunctions.fUnmapNamedBuffer || |
| 613 NULL == fFunctions.fGetNamedBufferParameteriv || |
| 614 NULL == fFunctions.fGetNamedBufferPointerv || |
| 615 NULL == fFunctions.fGetNamedBufferSubData) { |
| 616 RETURN_FALSE_INTERFACE |
| 617 } |
| 618 } |
| 619 if (glVer >= GR_GL_VER(2,0)) { |
| 620 if (NULL == fFunctions.fProgramUniform1f || |
| 621 NULL == fFunctions.fProgramUniform2f || |
| 622 NULL == fFunctions.fProgramUniform3f || |
| 623 NULL == fFunctions.fProgramUniform4f || |
| 624 NULL == fFunctions.fProgramUniform1i || |
| 625 NULL == fFunctions.fProgramUniform2i || |
| 626 NULL == fFunctions.fProgramUniform3i || |
| 627 NULL == fFunctions.fProgramUniform4i || |
| 628 NULL == fFunctions.fProgramUniform1fv || |
| 629 NULL == fFunctions.fProgramUniform2fv || |
| 630 NULL == fFunctions.fProgramUniform3fv || |
| 631 NULL == fFunctions.fProgramUniform4fv || |
| 632 NULL == fFunctions.fProgramUniform1iv || |
| 633 NULL == fFunctions.fProgramUniform2iv || |
| 634 NULL == fFunctions.fProgramUniform3iv || |
| 635 NULL == fFunctions.fProgramUniform4iv || |
| 636 NULL == fFunctions.fProgramUniformMatrix2fv || |
| 637 NULL == fFunctions.fProgramUniformMatrix3fv || |
| 638 NULL == fFunctions.fProgramUniformMatrix4fv) { |
| 639 RETURN_FALSE_INTERFACE |
| 640 } |
| 641 } |
| 642 if (glVer >= GR_GL_VER(2,1)) { |
| 643 if (NULL == fFunctions.fProgramUniformMatrix2x3fv || |
| 644 NULL == fFunctions.fProgramUniformMatrix3x2fv || |
| 645 NULL == fFunctions.fProgramUniformMatrix2x4fv || |
| 646 NULL == fFunctions.fProgramUniformMatrix4x2fv || |
| 647 NULL == fFunctions.fProgramUniformMatrix3x4fv || |
| 648 NULL == fFunctions.fProgramUniformMatrix4x3fv) { |
| 649 RETURN_FALSE_INTERFACE |
| 650 } |
| 651 } |
| 652 if (glVer >= GR_GL_VER(3,0)) { |
| 653 if (NULL == fFunctions.fNamedRenderbufferStorage || |
| 654 NULL == fFunctions.fGetNamedRenderbufferParameteriv || |
| 655 NULL == fFunctions.fNamedRenderbufferStorageMultisample || |
| 656 NULL == fFunctions.fCheckNamedFramebufferStatus || |
| 657 NULL == fFunctions.fNamedFramebufferTexture1D || |
| 658 NULL == fFunctions.fNamedFramebufferTexture2D || |
| 659 NULL == fFunctions.fNamedFramebufferTexture3D || |
| 660 NULL == fFunctions.fNamedFramebufferRenderbuffer || |
| 661 NULL == fFunctions.fGetNamedFramebufferAttachmentParameteriv || |
| 662 NULL == fFunctions.fGenerateTextureMipmap || |
| 663 NULL == fFunctions.fFramebufferDrawBuffer || |
| 664 NULL == fFunctions.fFramebufferDrawBuffers || |
| 665 NULL == fFunctions.fFramebufferReadBuffer || |
| 666 NULL == fFunctions.fGetFramebufferParameteriv || |
| 667 NULL == fFunctions.fNamedCopyBufferSubData || |
| 668 NULL == fFunctions.fVertexArrayVertexOffset || |
| 669 NULL == fFunctions.fVertexArrayColorOffset || |
| 670 NULL == fFunctions.fVertexArrayEdgeFlagOffset || |
| 671 NULL == fFunctions.fVertexArrayIndexOffset || |
| 672 NULL == fFunctions.fVertexArrayNormalOffset || |
| 673 NULL == fFunctions.fVertexArrayTexCoordOffset || |
| 674 NULL == fFunctions.fVertexArrayMultiTexCoordOffset || |
| 675 NULL == fFunctions.fVertexArrayFogCoordOffset || |
| 676 NULL == fFunctions.fVertexArraySecondaryColorOffset || |
| 677 NULL == fFunctions.fVertexArrayVertexAttribOffset || |
| 678 NULL == fFunctions.fVertexArrayVertexAttribIOffset || |
| 679 NULL == fFunctions.fEnableVertexArray || |
| 680 NULL == fFunctions.fDisableVertexArray || |
| 681 NULL == fFunctions.fEnableVertexArrayAttrib || |
| 682 NULL == fFunctions.fDisableVertexArrayAttrib || |
| 683 NULL == fFunctions.fGetVertexArrayIntegerv || |
| 684 NULL == fFunctions.fGetVertexArrayPointerv || |
| 685 NULL == fFunctions.fGetVertexArrayIntegeri_v || |
| 686 NULL == fFunctions.fGetVertexArrayPointeri_v || |
| 687 NULL == fFunctions.fMapNamedBufferRange || |
| 688 NULL == fFunctions.fFlushMappedNamedBufferRange) { |
| 689 RETURN_FALSE_INTERFACE |
| 690 } |
| 691 } |
| 692 } |
| 693 |
| 694 if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(4,3)) || |
| 695 fExtensions.has("GL_KHR_debug")) { |
| 696 if (NULL == fFunctions.fDebugMessageControl || |
| 697 NULL == fFunctions.fDebugMessageInsert || |
| 698 NULL == fFunctions.fDebugMessageCallback || |
| 699 NULL == fFunctions.fGetDebugMessageLog || |
| 700 NULL == fFunctions.fPushDebugGroup || |
| 701 NULL == fFunctions.fPopDebugGroup || |
| 702 NULL == fFunctions.fObjectLabel) { |
| 703 RETURN_FALSE_INTERFACE |
| 704 } |
| 705 } |
| 706 |
543 return true; | 707 return true; |
544 } | 708 } |
OLD | NEW |