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-2018 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 int getMaxSamples() const; 00096 00098 friend std::ostream& operator<<(std::ostream& os, const SbGPUCapabilities& capabilities); 00099 00100 private: 00101 00102 // protect from suspicious instancing 00103 SbGPUCapabilities(); 00104 00105 // OpenGL version 00106 int m_version; 00107 00108 // GLContext profile 00109 Profile m_profile; 00110 00111 // GPU Vendor 00112 GpuVendor m_vendor; 00113 00114 // Name of renderer 00115 SbString m_renderer; 00116 00117 // GL_MAX_VIEWPORT_DIMS 00118 SbVec2i32 m_maxViewportSize; 00119 00120 // GL_MAX_TEXTURE_SIZE 00121 int m_maxTextureSize; 00122 00123 // GL_MAX_3D_TEXTURE_SIZE 00124 int m_max3DTextureSize; 00125 00126 // GL_MAX_VERTEX_ATTRIBS 00127 int m_maxVertexAttribs; 00128 00129 // GL_MAX_TEXTURE_UNITS (i.e. max texture units for fixed pipeline) 00130 int m_maxFixedPipelineTextureUnits; 00131 00132 // GL_MAX_SAMPLES 00133 int m_maxSamplesMultiSampling; 00134 }; 00135