MCPcopy Create free account
hub / github.com/Kitware/VTK / GetDefaultInternalFormat

Method GetDefaultInternalFormat

Rendering/OpenGL2/vtkTextureObject.cxx:650–687  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

648
649//------------------------------------------------------------------------------
650unsigned 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//------------------------------------------------------------------------------
690void vtkTextureObject::SetInternalFormat(unsigned int glInternalFormat)

Callers 2

GetInternalFormatMethod · 0.95
LoadVolumeMethod · 0.80

Calls 1

Tested by

no test coverage detected