Commit 8eeb2bd1 by Jamie Madill

Add multisample render target info to DXGI tables.

Saves us some time on startup. Also assume every multisample format can support 1x multisampling, and that if we support a higher format we support all lower sample counts (eg - if we support 16x we support 8x and 4x, etc) BUG=angleproject:1014 Change-Id: I62143e5db561b717edd1a0c96f5e3acd4de3d154 Reviewed-on: https://chromium-review.googlesource.com/275777Reviewed-by: 's avatarBrandon Jones <bajones@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarKenneth Russell <kbr@chromium.org>
parent 405f3471
...@@ -58,7 +58,7 @@ GLuint TextureCaps::getNearestSamples(GLuint requestedSamples) const ...@@ -58,7 +58,7 @@ GLuint TextureCaps::getNearestSamples(GLuint requestedSamples) const
void TextureCapsMap::insert(GLenum internalFormat, const TextureCaps &caps) void TextureCapsMap::insert(GLenum internalFormat, const TextureCaps &caps)
{ {
mCapsMap.insert(std::make_pair(internalFormat, caps)); mCapsMap[internalFormat] = caps;
} }
void TextureCapsMap::remove(GLenum internalFormat) void TextureCapsMap::remove(GLenum internalFormat)
......
...@@ -320,12 +320,19 @@ static gl::TextureCaps GenerateTextureFormatCaps(GLint maxClientVersion, GLenum ...@@ -320,12 +320,19 @@ static gl::TextureCaps GenerateTextureFormatCaps(GLint maxClientVersion, GLenum
if (support.query(formatInfo.renderFormat, D3D11_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET)) if (support.query(formatInfo.renderFormat, D3D11_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET))
{ {
for (size_t sampleCount = 1; sampleCount <= D3D11_MAX_MULTISAMPLE_SAMPLE_COUNT; sampleCount *= 2) // Assume 1x
textureCaps.sampleCounts.insert(1);
for (size_t sampleCount = 2; sampleCount <= D3D11_MAX_MULTISAMPLE_SAMPLE_COUNT; sampleCount *= 2)
{ {
UINT qualityCount = 0; UINT qualityCount = 0;
if (SUCCEEDED(device->CheckMultisampleQualityLevels(formatInfo.renderFormat, sampleCount, &qualityCount)) && if (SUCCEEDED(device->CheckMultisampleQualityLevels(formatInfo.renderFormat, sampleCount, &qualityCount)))
qualityCount > 0)
{ {
// Assume we always support lower sample counts
if (qualityCount == 0)
{
break;
}
textureCaps.sampleCounts.insert(sampleCount); textureCaps.sampleCounts.insert(sampleCount);
} }
} }
......
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