00001 #pragma once 00002 00003 /*==================================================================================== 00004 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00005 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00006 *** *** 00007 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00008 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00009 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00010 *** *** 00011 *** RESTRICTED RIGHTS LEGEND *** 00012 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00013 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00014 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00015 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00016 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00017 *** *** 00018 *** COPYRIGHT (C) 1996-2020 BY FEI S.A.S, *** 00019 *** BORDEAUX, FRANCE *** 00020 *** ALL RIGHTS RESERVED *** 00021 **==================================================================================*/ 00022 00023 #include <Inventor/helpers/SbGraphicsCapabilities.h> 00024 #include <Inventor/SbString.h> 00025 #include <Inventor/SbVec.h> 00026 #include <Inventor/SbBase.h> 00027 00028 00047 class SbGPUCapabilities : public SbGraphicsCapabilities 00048 { 00049 public: 00050 00052 enum Profile 00053 { 00054 COMPATIBILITY = 0x1, 00055 CORE = 0x2 00056 }; 00057 00059 enum GpuVendor 00060 { 00061 INTEL_GPU, 00062 AMD_GPU, 00063 NVIDIA_GPU, 00064 UNKNOWN_GPU 00065 }; 00066 00068 int getVersion() const; 00069 00071 Profile getProfile() const; 00072 00074 GpuVendor getGpuVendor() const; 00075 00077 const SbString& getRenderer() const; 00078 00080 const SbVec2i32& getMaxViewportSize() const; 00081 00083 int getMaxTextureSize() const; 00084 00086 int getMax3DTextureSize() const; 00087 00089 int getMaxVertexAttribs() const; 00090 00092 int getMaxFixedPipelineTextureUnits() const; 00093 00095 friend std::ostream& operator<<(std::ostream& os, const SbGPUCapabilities& capabilities); 00096 00097 private: 00098 00099 // protect from suspicious instancing 00100 SbGPUCapabilities(); 00101 00102 // OpenGL version 00103 int m_version; 00104 00105 // GLContext profile 00106 Profile m_profile; 00107 00108 // GPU Vendor 00109 GpuVendor m_vendor; 00110 00111 // Name of renderer 00112 SbString m_renderer; 00113 00114 // GL_MAX_VIEWPORT_DIMS 00115 SbVec2i32 m_maxViewportSize; 00116 00117 // GL_MAX_TEXTURE_SIZE 00118 int m_maxTextureSize; 00119 00120 // GL_MAX_3D_TEXTURE_SIZE 00121 int m_max3DTextureSize; 00122 00123 // GL_MAX_VERTEX_ATTRIBS 00124 int m_maxVertexAttribs; 00125 00126 // GL_MAX_TEXTURE_UNITS (i.e. max texture units for fixed pipeline) 00127 int m_maxFixedPipelineTextureUnits; 00128 }; 00129