Added a Renderer11::getNearestSupportedSamples method.

TRAC #22417 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods Author: Geoff Lang git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1862 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent df2fd572
......@@ -2207,6 +2207,29 @@ int Renderer11::getMaxSupportedSamples() const
return mMaxSupportedSamples;
}
int Renderer11::getNearestSupportedSamples(DXGI_FORMAT format, unsigned int requested) const
{
if (requested == 0)
{
return 0;
}
MultisampleSupportMap::const_iterator iter = mMultisampleSupportMap.find(format);
if (iter != mMultisampleSupportMap.end())
{
const MultisampleSupportInfo& info = iter->second;
for (unsigned int i = requested - 1; i < D3D11_MAX_MULTISAMPLE_SAMPLE_COUNT; i++)
{
if (info.qualityLevels[i] > 0)
{
return i + 1;
}
}
}
return -1;
}
bool Renderer11::copyToRenderTarget(TextureStorageInterface2D *dest, TextureStorageInterface2D *source)
{
if (source && dest)
......
......@@ -127,6 +127,7 @@ class Renderer11 : public Renderer
virtual int getMaxSwapInterval() const;
virtual GLsizei getMaxSupportedSamples() const;
int getNearestSupportedSamples(DXGI_FORMAT format, unsigned int requested) const;
// Pixel operations
virtual bool copyToRenderTarget(TextureStorageInterface2D *dest, TextureStorageInterface2D *source);
......
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