Commit d28f6113 by Cooper Partin Committed by Geoff Lang

Fixed compressed texture support reporting for feature level 9_3

Change-Id: If6e27db912711532e184a3a716728a19653c0471 Reviewed-on: https://chromium-review.googlesource.com/249550Tested-by: 's avatarCooper Partin <coopp@microsoft.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 12892c91
...@@ -3275,6 +3275,11 @@ gl::Error Renderer11::blitRenderbufferRect(const gl::Rectangle &readRect, const ...@@ -3275,6 +3275,11 @@ gl::Error Renderer11::blitRenderbufferRect(const gl::Rectangle &readRect, const
return result; return result;
} }
bool Renderer11::isES3Capable() const
{
return (d3d11_gl::GetMaximumClientVersion(mFeatureLevel) > 2);
};
ID3D11Texture2D *Renderer11::resolveMultisampledTexture(ID3D11Texture2D *source, unsigned int subresource) ID3D11Texture2D *Renderer11::resolveMultisampledTexture(ID3D11Texture2D *source, unsigned int subresource)
{ {
D3D11_TEXTURE2D_DESC textureDesc; D3D11_TEXTURE2D_DESC textureDesc;
......
...@@ -209,7 +209,7 @@ class Renderer11 : public RendererD3D ...@@ -209,7 +209,7 @@ class Renderer11 : public RendererD3D
RenderTargetD3D *drawRenderTarget, GLenum filter, const gl::Rectangle *scissor, RenderTargetD3D *drawRenderTarget, GLenum filter, const gl::Rectangle *scissor,
bool colorBlit, bool depthBlit, bool stencilBlit); bool colorBlit, bool depthBlit, bool stencilBlit);
bool isES3Capable() const { return mFeatureLevel >= D3D_FEATURE_LEVEL_10_0; }; bool isES3Capable() const;
D3D_FEATURE_LEVEL getFeatureLevel() const { return mFeatureLevel; }; D3D_FEATURE_LEVEL getFeatureLevel() const { return mFeatureLevel; };
private: private:
......
...@@ -228,7 +228,24 @@ D3D11_QUERY ConvertQueryType(GLenum queryType) ...@@ -228,7 +228,24 @@ D3D11_QUERY ConvertQueryType(GLenum queryType)
namespace d3d11_gl namespace d3d11_gl
{ {
static gl::TextureCaps GenerateTextureFormatCaps(GLenum internalFormat, ID3D11Device *device) GLint GetMaximumClientVersion(D3D_FEATURE_LEVEL featureLevel)
{
switch (featureLevel)
{
case D3D_FEATURE_LEVEL_11_1:
case D3D_FEATURE_LEVEL_11_0:
case D3D_FEATURE_LEVEL_10_1:
case D3D_FEATURE_LEVEL_10_0: return 3;
case D3D_FEATURE_LEVEL_9_3:
case D3D_FEATURE_LEVEL_9_2:
case D3D_FEATURE_LEVEL_9_1: return 2;
default: UNREACHABLE(); return 0;
}
}
static gl::TextureCaps GenerateTextureFormatCaps(GLint maxClientVersion, GLenum internalFormat, ID3D11Device *device)
{ {
gl::TextureCaps textureCaps; gl::TextureCaps textureCaps;
...@@ -244,9 +261,12 @@ static gl::TextureCaps GenerateTextureFormatCaps(GLenum internalFormat, ID3D11De ...@@ -244,9 +261,12 @@ static gl::TextureCaps GenerateTextureFormatCaps(GLenum internalFormat, ID3D11De
} }
else else
{ {
textureCaps.texturable = ((formatSupport & D3D11_FORMAT_SUPPORT_TEXTURE2D) != 0) && UINT formatSupportMask = D3D11_FORMAT_SUPPORT_TEXTURE2D | D3D11_FORMAT_SUPPORT_TEXTURECUBE;
((formatSupport & D3D11_FORMAT_SUPPORT_TEXTURECUBE) != 0) && if (maxClientVersion > 2)
((formatSupport & D3D11_FORMAT_SUPPORT_TEXTURE3D) != 0); {
formatSupportMask |= D3D11_FORMAT_SUPPORT_TEXTURE3D;
}
textureCaps.texturable = ((formatSupport & formatSupportMask) == formatSupportMask);
} }
} }
...@@ -916,11 +936,13 @@ static size_t GetMaximumStreamOutputSeparateComponents(D3D_FEATURE_LEVEL feature ...@@ -916,11 +936,13 @@ static size_t GetMaximumStreamOutputSeparateComponents(D3D_FEATURE_LEVEL feature
void GenerateCaps(ID3D11Device *device, gl::Caps *caps, gl::TextureCapsMap *textureCapsMap, gl::Extensions *extensions) void GenerateCaps(ID3D11Device *device, gl::Caps *caps, gl::TextureCapsMap *textureCapsMap, gl::Extensions *extensions)
{ {
D3D_FEATURE_LEVEL featureLevel = device->GetFeatureLevel();
GLuint maxSamples = 0; GLuint maxSamples = 0;
const gl::FormatSet &allFormats = gl::GetAllSizedInternalFormats(); const gl::FormatSet &allFormats = gl::GetAllSizedInternalFormats();
for (gl::FormatSet::const_iterator internalFormat = allFormats.begin(); internalFormat != allFormats.end(); ++internalFormat) for (gl::FormatSet::const_iterator internalFormat = allFormats.begin(); internalFormat != allFormats.end(); ++internalFormat)
{ {
gl::TextureCaps textureCaps = GenerateTextureFormatCaps(*internalFormat, device); gl::TextureCaps textureCaps = GenerateTextureFormatCaps(GetMaximumClientVersion(featureLevel), *internalFormat, device);
textureCapsMap->insert(*internalFormat, textureCaps); textureCapsMap->insert(*internalFormat, textureCaps);
maxSamples = std::max(maxSamples, textureCaps.getMaxSamples()); maxSamples = std::max(maxSamples, textureCaps.getMaxSamples());
...@@ -931,8 +953,6 @@ void GenerateCaps(ID3D11Device *device, gl::Caps *caps, gl::TextureCapsMap *text ...@@ -931,8 +953,6 @@ void GenerateCaps(ID3D11Device *device, gl::Caps *caps, gl::TextureCapsMap *text
} }
} }
D3D_FEATURE_LEVEL featureLevel = device->GetFeatureLevel();
// GL core feature limits // GL core feature limits
caps->maxElementIndex = static_cast<GLint64>(std::numeric_limits<unsigned int>::max()); caps->maxElementIndex = static_cast<GLint64>(std::numeric_limits<unsigned int>::max());
caps->max3DTextureSize = GetMaximum3DTextureSize(featureLevel); caps->max3DTextureSize = GetMaximum3DTextureSize(featureLevel);
......
...@@ -50,6 +50,7 @@ D3D11_QUERY ConvertQueryType(GLenum queryType); ...@@ -50,6 +50,7 @@ D3D11_QUERY ConvertQueryType(GLenum queryType);
namespace d3d11_gl namespace d3d11_gl
{ {
GLint GetMaximumClientVersion(D3D_FEATURE_LEVEL featureLevel);
void GenerateCaps(ID3D11Device *device, gl::Caps *caps, gl::TextureCapsMap *textureCapsMap, gl::Extensions *extensions); void GenerateCaps(ID3D11Device *device, gl::Caps *caps, gl::TextureCapsMap *textureCapsMap, gl::Extensions *extensions);
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#include "media/pixel.inl" #include "media/pixel.inl"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. // Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_TYPED_TEST_CASE(CompressedTextureTest, ES2_D3D9, ES2_D3D11); ANGLE_TYPED_TEST_CASE(CompressedTextureTest, ES2_D3D9, ES2_D3D11, ES2_D3D11_FL9_3);
template<typename T> template<typename T>
class CompressedTextureTest : public ANGLETest class CompressedTextureTest : public ANGLETest
...@@ -171,7 +171,7 @@ ANGLE_TYPED_TEST_CASE(CompressedTextureTestES3, ES3_D3D11); ...@@ -171,7 +171,7 @@ ANGLE_TYPED_TEST_CASE(CompressedTextureTestES3, ES3_D3D11);
template<typename T> template<typename T>
class CompressedTextureTestES3 : public CompressedTextureTest<T> { }; class CompressedTextureTestES3 : public CompressedTextureTest<T> { };
ANGLE_TYPED_TEST_CASE(CompressedTextureTestD3D11, ES2_D3D11, ES3_D3D11); ANGLE_TYPED_TEST_CASE(CompressedTextureTestD3D11, ES2_D3D11, ES3_D3D11, ES2_D3D11_FL9_3);
template<typename T> template<typename T>
class CompressedTextureTestD3D11 : public CompressedTextureTest<T> { }; class CompressedTextureTestD3D11 : public CompressedTextureTest<T> { };
......
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