Go to the documentation of this file.
28 #ifndef __RenderSystemCapabilities__
29 #define __RenderSystemCapabilities__
48 #define CAPS_CATEGORY_SIZE 4
49 #define OGRE_CAPS_BITSHIFT (32 - CAPS_CATEGORY_SIZE)
50 #define CAPS_CATEGORY_MASK (((1 << CAPS_CATEGORY_SIZE) - 1) << OGRE_CAPS_BITSHIFT)
51 #define OGRE_CAPS_VALUE(cat, val) ((cat << OGRE_CAPS_BITSHIFT) | (1 << val))
224 major = minor = release = build = 0;
230 str << major <<
"." << minor <<
"." << release <<
"." << build;
240 if (tokens.size() > 1)
242 if (tokens.size() > 2)
244 if (tokens.size() > 3)
381 mDriverVersion = version;
388 setDriverVersion(version);
394 return mDriverVersion;
410 setVendor(vendorFromString(vendorString));
439 mNumWorldMatrices = num;
444 mNumTextureUnits = num;
449 mStencilBufferBitDepth = num;
454 mNumVertexBlendMatrices = num;
460 mNumMultiRenderTargets = num;
465 return mNumWorldMatrices;
482 return mNumTextureUnits;
493 return mStencilBufferBitDepth;
500 return mNumVertexBlendMatrices;
506 return mNumMultiRenderTargets;
557 mSupportedShaderProfiles.insert(profile);
565 mSupportedShaderProfiles.erase(profile);
572 return (mSupportedShaderProfiles.end() != mSupportedShaderProfiles.find(profile));
580 return mSupportedShaderProfiles;
587 return mVertexProgramConstantFloatCount;
592 return mVertexProgramConstantIntCount;
597 return mVertexProgramConstantBoolCount;
602 return mGeometryProgramConstantFloatCount;
607 return mGeometryProgramConstantIntCount;
612 return mGeometryProgramConstantBoolCount;
617 return mFragmentProgramConstantFloatCount;
622 return mFragmentProgramConstantIntCount;
627 return mFragmentProgramConstantBoolCount;
645 mVertexProgramConstantFloatCount = c;
650 mVertexProgramConstantIntCount = c;
655 mVertexProgramConstantBoolCount = c;
660 mGeometryProgramConstantFloatCount = c;
665 mGeometryProgramConstantIntCount = c;
670 mGeometryProgramConstantBoolCount = c;
675 mFragmentProgramConstantFloatCount = c;
680 mFragmentProgramConstantIntCount = c;
685 mFragmentProgramConstantBoolCount = c;
695 return mMaxPointSize;
700 mNonPOW2TexturesLimited = l;
712 return mNonPOW2TexturesLimited;
717 mMaxSupportedAnisotropy = s;
722 return mMaxSupportedAnisotropy;
728 mNumVertexTextureUnits = n;
733 return mNumVertexTextureUnits;
738 mVertexTextureUnitsShared = shared;
743 return mVertexTextureUnitsShared;
749 mGeometryProgramNumOutputVertices = numOutputVertices;
754 return mGeometryProgramNumOutputVertices;
760 return mRenderSystemName;
765 mRenderSystemName = rs;
771 mCategoryRelevant[cat] = relevant;
777 return mCategoryRelevant[cat];
789 mTesselationHullProgramConstantFloatCount = c;
794 mTesselationHullProgramConstantIntCount = c;
799 mTesselationHullProgramConstantBoolCount = c;
804 return mTesselationHullProgramConstantFloatCount;
809 return mTesselationHullProgramConstantIntCount;
814 return mTesselationHullProgramConstantBoolCount;
820 mTesselationDomainProgramConstantFloatCount = c;
825 mTesselationDomainProgramConstantIntCount = c;
830 mTesselationDomainProgramConstantBoolCount = c;
835 return mTesselationDomainProgramConstantFloatCount;
840 return mTesselationDomainProgramConstantIntCount;
845 return mTesselationDomainProgramConstantBoolCount;
851 mComputeProgramConstantFloatCount = c;
856 mComputeProgramConstantIntCount = c;
861 mComputeProgramConstantBoolCount = c;
866 return mComputeProgramConstantFloatCount;
871 return mComputeProgramConstantIntCount;
876 return mComputeProgramConstantBoolCount;
888 #endif // __RenderSystemCapabilities__
@ RSC_TWO_SIDED_STENCIL
Supports separate stencil updates for both front and back faces.
@ RSC_VAO
Support for Vertex Array Objects (VAOs)
bool hasCapability(const Capabilities c) const
Checks for a capability.
ushort mVertexProgramConstantIntCount
The number of integer constants vertex programs support.
void setVendor(GPUVendor v)
void setTesselationDomainProgramConstantBoolCount(ushort c)
The number of boolean constants tesselation Domain programs support.
void setGeometryProgramNumOutputVertices(int numOutputVertices)
Set the number of vertices a single geometry program run can emit.
Real mMaxSupportedAnisotropy
The maximum supported anisotropy.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
bool getNonPOW2TexturesLimited(void) const
Are non-power of two textures limited in features?
@ RSC_TEXTURE_COMPRESSION_BC6H_BC7
Supports compressed textures in BC6H and BC7 format (DirectX feature level 11_0)
Real mMaxPointSize
The maximum point size.
static void initVendorStrings()
ushort getGeometryProgramConstantIntCount(void) const
The number of integer constants geometry programs support.
@ GPU_VENDOR_COUNT
placeholder
void setNonPOW2TexturesLimited(bool l)
Non-POW2 textures limited.
@ RSC_SCISSOR_TEST
Supports performing a scissor test to exclude areas of the screen.
ushort getStencilBufferBitDepth(void) const
Determines the bit depth of the hardware accelerated stencil buffer, if supported.
@ GPU_IMAGINATION_TECHNOLOGIES
#define OGRE_CAPS_VALUE(cat, val)
@ RSC_TEXTURE_1D
Supports 1d textures.
@ RSC_VBO
Supports hardware vertex and index buffers.
@ RSC_HWRENDER_TO_VERTEX_BUFFER
Supports rendering to vertex buffers.
void removeShaderProfile(const String &profile)
Remove a given shader profile, if present.
ushort getComputeProgramConstantFloatCount(void) const
The number of floating-point constants fragment programs support.
void setFragmentProgramConstantFloatCount(ushort c)
The number of floating-point constants fragment programs support.
@ RSC_POINT_EXTENDED_PARAMETERS_EXT
Support for point parameters EXT implementation.
set< String >::type ShaderProfiles
void setStencilBufferBitDepth(ushort num)
void setNumWorldMatrices(ushort num)
void setGeometryProgramConstantFloatCount(ushort c)
The number of floating-point constants geometry programs support.
vector< String >::type StringVector
ushort getFragmentProgramConstantFloatCount(void) const
The number of floating-point constants fragment programs support.
@ RSC_TEXTURE_COMPRESSION
Supports compressed textures.
ushort getGeometryProgramConstantBoolCount(void) const
The number of boolean constants geometry programs support.
void setVertexProgramConstantIntCount(ushort c)
The number of integer constants vertex programs support.
ushort mNumTextureUnits
The number of texture units available.
void addShaderProfile(const String &profile)
Adds the profile to the list of supported profiles.
ushort mFragmentProgramConstantIntCount
The number of integer constants fragment programs support.
CapabilitiesCategory
Enumerates the categories of capabilities.
@ RSC_HWRENDER_TO_TEXTURE
Supports hardware render-to-texture (bigger than framebuffer)
void fromString(const String &versionString)
#define CAPS_CATEGORY_MASK
void setVertexProgramConstantBoolCount(ushort c)
The number of boolean constants vertex programs support.
@ RSC_PERSTAGECONSTANT
Is DirectX feature "per stage constants" supported.
@ RSC_SHADER_SUBROUTINE
Supports dynamic linkage/shader subroutine.
ushort mTesselationHullProgramConstantIntCount
The number of integer constants tesselation Hull programs support.
@ RSC_TEXTURE_COMPRESSION_PVRTC
Supports compressed textures in the PVRTC format.
GPUVendor
Enumeration of GPU vendors.
void setTesselationDomainProgramConstantIntCount(ushort c)
The number of integer constants tesselation Domain programs support.
@ RSC_VERTEX_TEXTURE_FETCH
Supports vertex texture fetch.
@ RSC_RTT_SEPARATE_DEPTHBUFFER
Supports a separate depth buffer for RTTs. D3D 9 & 10, OGL w/FBO (RSC_FBO implies this flag)
@ RSC_HWOCCLUSION
Supports hardware occlusion queries.
static vector< String >::type split(const String &str, const String &delims="\t\n ", unsigned int maxSplits=0, bool preserveDelims=false)
Returns a StringVector that contains all the substrings delimited by the characters in the passed del...
ushort getVertexProgramConstantFloatCount(void) const
The number of floating-point constants vertex programs support.
ushort getTesselationHullProgramConstantIntCount(void) const
The number of integer constants fragment programs support.
ushort mTesselationDomainProgramConstantFloatCount
The number of floating-point constants tesselation Domain programs support.
bool isCapabilityRenderSystemSpecific(const Capabilities c) const
Returns true if capability is render system specific.
String mRenderSystemName
The identifier associated with the render system for which these capabilities are valid.
ushort mNumVertexBlendMatrices
The number of matrices available for hardware blending.
String getRenderSystemName(void) const
Get the identifier of the rendersystem from which these capabilities were generated.
bool isCategoryRelevant(CapabilitiesCategory cat)
Return whether a category is 'relevant' or not, ie will it be reported.
ushort mTesselationHullProgramConstantBoolCount
The number of boolean constants tesselation Hull programs support.
StringStream StrStreamType
static String vendorToString(GPUVendor v)
Convert a vendor enum to a string.
ushort getVertexProgramConstantBoolCount(void) const
The number of boolean constants vertex programs support.
virtual ~RenderSystemCapabilities()
@ RSC_FIXED_FUNCTION
Supports fixed-function pipeline.
void log(Log *pLog)
Write the capabilities to the pass in Log.
void setMaxSupportedAnisotropy(Real s)
Set the maximum supported anisotropic filtering.
void setNumTextureUnits(ushort num)
virtual size_t calculateSize() const
@ RSC_FRAGMENT_PROGRAM
Supports fragment programs (pixel shaders)
void setTesselationHullProgramConstantBoolCount(ushort c)
The number of boolean constants tesselation Domain programs support.
@ RSC_FBO
Support for Frame Buffer Objects (FBOs)
void setDeviceName(const String &name)
sets the device name for Render system
@ RSC_RTT_DEPTHBUFFER_RESOLUTION_LESSEQUAL
Supports attaching a depth buffer to an RTT that has width & height less or equal than RTT's.
void setTesselationHullProgramConstantIntCount(ushort c)
The number of integer constants tesselation Domain programs support.
@ RSC_HWSTENCIL
Supports hardware stencil buffer.
void setFragmentProgramConstantIntCount(ushort c)
The number of integer constants fragment programs support.
GPUVendor mVendor
GPU Vendor.
ushort getTesselationDomainProgramConstantFloatCount(void) const
The number of floating-point constants fragment programs support.
String getDeviceName() const
gets the device name for render system
bool mNonPOW2TexturesLimited
Are non-POW2 textures feature-limited?
ushort getComputeProgramConstantBoolCount(void) const
The number of boolean constants fragment programs support.
void setTesselationHullProgramConstantFloatCount(ushort c)
The number of floating-point constants tesselation Hull programs support.
@ RSC_NON_POWER_OF_2_TEXTURES
Supports non-power of two textures.
@ RSC_MIPMAP_LOD_BIAS
Supports mipmap LOD biasing.
ShaderProfiles mSupportedShaderProfiles
The list of supported shader profiles.
void setNumVertexTextureUnits(ushort n)
Set the number of vertex texture units supported.
ushort mComputeProgramConstantFloatCount
The number of floating-point constants compute programs support.
void setTesselationDomainProgramConstantFloatCount(ushort c)
The number of floating-point constants tesselation Domain programs support.
@ RSC_TEXTURE_3D
Supports 3d (volume) textures.
@ RSC_CUBEMAPPING
Supports cube mapping.
bool getVertexTextureUnitsShared(void) const
Get whether the vertex texture units are shared with the fragment processor.
#define OGRE_CAPS_BITSHIFT
void parseVendorFromString(const String &vendorString)
Parse and set vendor.
ushort mFragmentProgramConstantFloatCount
The number of floating-point constants fragment programs support.
ushort getNumWorldMatrices(void) const
static int parseInt(const String &val, int defaultValue=0)
Converts a String to a whole number.
void setGeometryProgramConstantIntCount(ushort c)
The number of integer constants geometry programs support.
@ RSC_MRT_DIFFERENT_BIT_DEPTHS
Supports MRTs with different bit depths.
@ RSC_ATOMIC_COUNTERS
Supports asynchronous hardware occlusion queries.
@ RSC_VERTEX_FORMAT_UBYTE4
Supports the VET_UBYTE4 vertex element type.
bool mVertexTextureUnitsShared
Are vertex texture units shared with fragment processor?
static GPUVendor vendorFromString(const String &vendorString)
Convert a vendor string to an enum.
ushort getNumMultiRenderTargets(void) const
The number of simultaneous render targets supported.
int mGeometryProgramNumOutputVertices
The number of vertices a geometry program can emit in a single run.
singleton class for storing the capabilities of the graphics card.
static StringVector msGPUVendorStrings
@ RSC_HWRENDER_TO_TEXTURE_3D
ushort getTesselationHullProgramConstantBoolCount(void) const
The number of boolean constants fragment programs support.
@ RSC_TESSELATION_HULL_PROGRAM
Supports hardware tesselation hull programs.
@ RSC_FBO_ATI
Support for Frame Buffer Objects ATI implementation (ARB FBO is higher precedence)
@ RSC_HWOCCLUSION_ASYNCHRONOUS
Supports asynchronous hardware occlusion queries.
ushort getTesselationHullProgramConstantFloatCount(void) const
The number of floating-point constants fragment programs support.
void setMaxPointSize(Real s)
Maximum point screen size in pixels.
GPUVendor getVendor() const
@ RSC_GL1_5_NOHWOCCLUSION
Support for GL 1.5 but without HW occlusion workaround.
@ RSC_TEXTURE_COMPRESSION_ETC2
Supports compressed textures in the ETC2 format.
ushort getComputeProgramConstantIntCount(void) const
The number of integer constants fragment programs support.
ushort getNumTextureUnits(void) const
Returns the number of texture units the current output hardware supports.
void setFragmentProgramConstantBoolCount(ushort c)
The number of boolean constants fragment programs support.
ushort mStencilBufferBitDepth
The stencil buffer bit depth.
ushort mComputeProgramConstantBoolCount
The number of boolean constants compute programs support.
ushort mFragmentProgramConstantBoolCount
The number of boolean constants fragment programs support.
void setVertexProgramConstantFloatCount(ushort c)
The number of floating-point constants vertex programs support.
ushort mVertexProgramConstantFloatCount
The number of floating-point constants vertex programs support.
@ RSC_CAN_GET_COMPILED_SHADER_BUFFER
Supports using vertex buffers for instance data.
@ RSC_FBO_ARB
Support for Frame Buffer Objects ARB implementation (regular FBO is higher precedence)
ushort mGeometryProgramConstantIntCount
The number of integer constants vertex geometry support.
void setRenderSystemName(const String &rs)
Set the identifier of the rendersystem from which these capabilities were generated.
bool isDriverOlderThanVersion(DriverVersion v) const
ushort mTesselationDomainProgramConstantBoolCount
The number of boolean constants tesselation Domain programs support.
@ RSC_ADVANCED_BLEND_OPERATIONS
Supports Blending operations other than +.
ushort getNumVertexBlendMatrices(void) const
Returns the number of matrices available to hardware vertex blending for this rendering system.
Real getMaxPointSize(void) const
Maximum point screen size in pixels.
const ShaderProfiles & getSupportedShaderProfiles() const
Returns a set of all supported shader profiles.
@ RSC_POINT_SPRITES
Supports basic point sprite rendering.
String mDeviceName
The name of the device as reported by the render system.
@ RSC_TEXTURE_COMPRESSION_ATC
Supports compressed textures in the ATC format.
Capabilities
Enum describing the different hardware capabilities we want to check for OGRE_CAPS_VALUE(a,...
void setComputeProgramConstantBoolCount(ushort c)
The number of boolean constants compute programs support.
void setDriverVersion(const DriverVersion &version)
Set the driver version.
@ RSC_TEXTURE_FLOAT
Supports float textures and render targets.
void setCapability(const Capabilities c)
Adds a capability flag.
ushort getTesselationDomainProgramConstantIntCount(void) const
The number of integer constants fragment programs support.
ushort getFragmentProgramConstantBoolCount(void) const
The number of boolean constants fragment programs support.
@ RSC_STENCIL_WRAP
Supports wrapping the stencil value at the range extremeties.
@ RSC_POINT_EXTENDED_PARAMETERS
Supports extra point parameters (minsize, maxsize, attenuation)
void parseDriverVersionFromString(const String &versionString)
void setGeometryProgramConstantBoolCount(ushort c)
The number of boolean constants geometry programs support.
@ RSC_ALPHA_TO_COVERAGE
Supports Alpha to Coverage (A2C)
@ RSC_TEXTURE_COMPRESSION_VTC
Supports compressed textures in the VTC format.
@ RSC_POINT_EXTENDED_PARAMETERS_ARB
Support for point parameters ARB implementation.
@ RSC_TEXTURE_COMPRESSION_DXT
Supports compressed textures in the DXT/ST3C formats.
void setComputeProgramConstantIntCount(ushort c)
The number of integer constants compute programs support.
void setComputeProgramConstantFloatCount(ushort c)
The number of floating-point constants compute programs support.
ushort mGeometryProgramConstantBoolCount
The number of boolean constants vertex geometry support.
ushort getTesselationDomainProgramConstantBoolCount(void) const
The number of boolean constants fragment programs support.
float Real
Software floating point type.
@ RSC_PBUFFER
Support for PBuffer.
DriverVersion mDriverVersion
This is used to build a database of RSC's if a RSC with same name, but newer version is introduced,...
@ RSC_USER_CLIP_PLANES
Supports user clipping planes.
@ RSC_ANISOTROPY
Supports anisotropic texture filtering.
void unsetCapability(const Capabilities c)
Remove a capability flag.
ushort mNumWorldMatrices
The number of world matrices available.
ushort mTesselationHullProgramConstantFloatCount
The number of floating-point constants tesselation Hull programs support.
@ RSC_GEOMETRY_PROGRAM
Supports hardware geometry programs.
@ RSC_RTT_MAIN_DEPTHBUFFER_ATTACHABLE
Supports using the MAIN depth buffer for RTTs.
ushort mVertexProgramConstantBoolCount
The number of boolean constants vertex programs support.
ushort getGeometryProgramConstantFloatCount(void) const
The number of floating-point constants geometry programs support.
@ RSC_GL1_5_NOVBO
Supports OpenGL version 1.5.
ushort mNumMultiRenderTargets
The number of simultaneous render targets supported.
@ RSC_TEXTURE_COMPRESSION_ETC1
Supports compressed textures in the ETC1 format.
ushort getVertexProgramConstantIntCount(void) const
The number of integer constants vertex programs support.
void setCategoryRelevant(CapabilitiesCategory cat, bool relevant)
Mark a category as 'relevant' or not, ie will it be reported.
@ RSC_SEPARATE_SHADER_OBJECTS
Support for Separate Shader Objects.
@ RSC_TEXTURE_COMPRESSION_BC4_BC5
Supports compressed textures in BC4 and BC5 format (DirectX feature level 10_0)
ushort mNumVertexTextureUnits
The number of vertex texture units supported.
void setNumMultiRenderTargets(ushort num)
The number of simultaneous render targets supported.
@ CAPS_CATEGORY_COUNT
Placeholder for max value.
ushort getNumVertexTextureUnits(void) const
Get the number of vertex texture units supported.
ushort mGeometryProgramConstantFloatCount
The number of floating-point constants geometry programs support.
@ RSC_DOT3
Supports fixed-function DOT3 texture blend.
int getGeometryProgramNumOutputVertices(void) const
Get the number of vertices a single geometry program run can emit.
ushort getFragmentProgramConstantIntCount(void) const
The number of integer constants fragment programs support.
Real getMaxSupportedAnisotropy()
Get the maximum supported anisotropic filtering.
@ RSC_AUTOMIPMAP
Supports generating mipmaps in hardware.
DriverVersion is used by RenderSystemCapabilities and both GL and D3D9 to store the version of the cu...
@ RSC_VERTEX_BUFFER_INSTANCE_DATA
Supports using vertex buffers for instance data.
ushort mComputeProgramConstantIntCount
The number of integer constants compute programs support.
RenderSystemCapabilities()
@ RSC_INFINITE_FAR_PLANE
Supports infinite far plane projection.
@ RSC_COMPUTE_PROGRAM
Supports hardware compute programs.
@ RSC_TESSELATION_DOMAIN_PROGRAM
Supports hardware tesselation domain programs.
void setNumVertexBlendMatrices(ushort num)
bool isShaderProfileSupported(const String &profile) const
Returns true if profile is in the list of supported profiles.
void setVertexTextureUnitsShared(bool shared)
Set whether the vertex texture units are shared with the fragment processor.
DriverVersion getDriverVersion() const
ushort mTesselationDomainProgramConstantIntCount
The number of integer constants tesselation Domain programs support.
@ RSC_VERTEX_PROGRAM
Supports vertex programs (vertex shaders)
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.