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