Commit 0e120e3d by Geoff Lang Committed by Shannon Woods

Added a Renderer::getMaxSupportedFormatSamples method to query the max support…

Added a Renderer::getMaxSupportedFormatSamples method to query the max support samples for a specific internal texture format. TRAC #23212 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Geoff Lang
parent 61e49a5c
...@@ -2468,6 +2468,11 @@ int Context::getMaxSupportedSamples() const ...@@ -2468,6 +2468,11 @@ int Context::getMaxSupportedSamples() const
return mRenderer->getMaxSupportedSamples(); return mRenderer->getMaxSupportedSamples();
} }
GLsizei Context::getMaxSupportedFormatSamples(GLint internalFormat) const
{
return mRenderer->getMaxSupportedFormatSamples(internalFormat);
}
unsigned int Context::getMaxTransformFeedbackBufferBindings() const unsigned int Context::getMaxTransformFeedbackBufferBindings() const
{ {
return mRenderer->getMaxTransformFeedbackBuffers(); return mRenderer->getMaxTransformFeedbackBuffers();
......
...@@ -431,6 +431,7 @@ class Context ...@@ -431,6 +431,7 @@ class Context
int getMaximumTextureLevel() const; int getMaximumTextureLevel() const;
unsigned int getMaximumRenderTargets() const; unsigned int getMaximumRenderTargets() const;
GLsizei getMaxSupportedSamples() const; GLsizei getMaxSupportedSamples() const;
GLsizei getMaxSupportedFormatSamples(GLint internalFormat) const;
unsigned int getMaxTransformFeedbackBufferBindings() const; unsigned int getMaxTransformFeedbackBufferBindings() const;
GLintptr getUniformBufferOffsetAlignment() const; GLintptr getUniformBufferOffsetAlignment() const;
const char *getCombinedExtensionsString() const; const char *getCombinedExtensionsString() const;
......
...@@ -201,6 +201,7 @@ class Renderer ...@@ -201,6 +201,7 @@ class Renderer
virtual int getMaxSwapInterval() const = 0; virtual int getMaxSwapInterval() const = 0;
virtual GLsizei getMaxSupportedSamples() const = 0; virtual GLsizei getMaxSupportedSamples() const = 0;
virtual GLsizei getMaxSupportedFormatSamples(GLint internalFormat) const = 0;
virtual unsigned int getMaxRenderTargets() const = 0; virtual unsigned int getMaxRenderTargets() const = 0;
......
...@@ -2482,6 +2482,13 @@ int Renderer11::getMaxSupportedSamples() const ...@@ -2482,6 +2482,13 @@ int Renderer11::getMaxSupportedSamples() const
return mMaxSupportedSamples; return mMaxSupportedSamples;
} }
GLsizei Renderer11::getMaxSupportedFormatSamples(GLint internalFormat) const
{
DXGI_FORMAT format = gl_d3d11::GetTexFormat(internalFormat, getCurrentClientVersion());
MultisampleSupportMap::const_iterator iter = mMultisampleSupportMap.find(format);
return (iter != mMultisampleSupportMap.end()) ? iter->second.maxSupportedSamples : 0;
}
int Renderer11::getNearestSupportedSamples(DXGI_FORMAT format, unsigned int requested) const int Renderer11::getNearestSupportedSamples(DXGI_FORMAT format, unsigned int requested) const
{ {
if (requested == 0) if (requested == 0)
......
...@@ -142,6 +142,7 @@ class Renderer11 : public Renderer ...@@ -142,6 +142,7 @@ class Renderer11 : public Renderer
virtual int getMaxSwapInterval() const; virtual int getMaxSwapInterval() const;
virtual GLsizei getMaxSupportedSamples() const; virtual GLsizei getMaxSupportedSamples() const;
virtual GLsizei getMaxSupportedFormatSamples(GLint internalFormat) const;
int getNearestSupportedSamples(DXGI_FORMAT format, unsigned int requested) const; int getNearestSupportedSamples(DXGI_FORMAT format, unsigned int requested) const;
virtual unsigned int getMaxRenderTargets() const; virtual unsigned int getMaxRenderTargets() const;
......
...@@ -2436,6 +2436,13 @@ int Renderer9::getMaxSupportedSamples() const ...@@ -2436,6 +2436,13 @@ int Renderer9::getMaxSupportedSamples() const
return mMaxSupportedSamples; return mMaxSupportedSamples;
} }
GLsizei Renderer9::getMaxSupportedFormatSamples(GLint internalFormat) const
{
D3DFORMAT format = gl_d3d9::GetTexureFormat(internalFormat, this);
MultisampleSupportMap::const_iterator itr = mMultiSampleSupport.find(format);
return (itr != mMultiSampleSupport.end()) ? mMaxSupportedSamples : 0;
}
int Renderer9::getNearestSupportedSamples(D3DFORMAT format, int requested) const int Renderer9::getNearestSupportedSamples(D3DFORMAT format, int requested) const
{ {
if (requested == 0) if (requested == 0)
......
...@@ -158,6 +158,7 @@ class Renderer9 : public Renderer ...@@ -158,6 +158,7 @@ class Renderer9 : public Renderer
virtual int getMaxSwapInterval() const; virtual int getMaxSwapInterval() const;
virtual GLsizei getMaxSupportedSamples() const; virtual GLsizei getMaxSupportedSamples() const;
virtual GLsizei getMaxSupportedFormatSamples(GLint internalFormat) const;
int getNearestSupportedSamples(D3DFORMAT format, int requested) const; int getNearestSupportedSamples(D3DFORMAT format, int requested) const;
virtual unsigned int getMaxRenderTargets() const; virtual unsigned int getMaxRenderTargets() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment