------------------------------------------------------------------------------
| 648 | |
| 649 | //------------------------------------------------------------------------------ |
| 650 | unsigned int vtkTextureObject::GetDefaultInternalFormat( |
| 651 | int vtktype, int numComps, bool shaderSupportsTextureInt) |
| 652 | { |
| 653 | GLenum result = 0; |
| 654 | |
| 655 | // if shader supports int textures try that first |
| 656 | if (shaderSupportsTextureInt) |
| 657 | { |
| 658 | result = this->Context->GetDefaultTextureInternalFormat( |
| 659 | vtktype, numComps, true, false, this->UseSRGBColorSpace); |
| 660 | if (!result) |
| 661 | { |
| 662 | vtkDebugMacro("Unsupported internal texture type!"); |
| 663 | } |
| 664 | return result; |
| 665 | } |
| 666 | |
| 667 | // try default next |
| 668 | result = this->Context->GetDefaultTextureInternalFormat( |
| 669 | vtktype, numComps, false, false, this->UseSRGBColorSpace); |
| 670 | if (result) |
| 671 | { |
| 672 | return result; |
| 673 | } |
| 674 | |
| 675 | // try floating point |
| 676 | result = this->Context->GetDefaultTextureInternalFormat( |
| 677 | vtktype, numComps, false, true, this->UseSRGBColorSpace); |
| 678 | |
| 679 | if (!result) |
| 680 | { |
| 681 | vtkDebugMacro("Unsupported internal texture type!"); |
| 682 | vtkDebugMacro("Unable to find suitable internal format for T=" |
| 683 | << vtktype << " NC=" << numComps << " SSTI=" << shaderSupportsTextureInt); |
| 684 | } |
| 685 | |
| 686 | return result; |
| 687 | } |
| 688 | |
| 689 | //------------------------------------------------------------------------------ |
| 690 | void vtkTextureObject::SetInternalFormat(unsigned int glInternalFormat) |
no test coverage detected