aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Fedchin <anightik@gmail.com>2018-02-19 11:36:26 +0300
committerLukas Rusak <lorusak@gmail.com>2018-02-20 10:43:09 -0800
commit185ddcf6746c3968dcd89bc9c431bb7f63ed9b3a (patch)
treeeceeb87a1b21b123a7c1396ce9f1a979745f1340
parentb240f459d55dde805d68830bd61b6be23bac4d80 (diff)
[rendering] RenderSystemDX: drop render caps.
-rw-r--r--xbmc/rendering/dx/RenderSystemDX.cpp47
-rw-r--r--xbmc/rendering/dx/RenderSystemDX.h1
2 files changed, 13 insertions, 35 deletions
diff --git a/xbmc/rendering/dx/RenderSystemDX.cpp b/xbmc/rendering/dx/RenderSystemDX.cpp
index f48bf94824..3870a5303e 100644
--- a/xbmc/rendering/dx/RenderSystemDX.cpp
+++ b/xbmc/rendering/dx/RenderSystemDX.cpp
@@ -56,7 +56,6 @@ using namespace Microsoft::WRL;
CRenderSystemDX::CRenderSystemDX() : CRenderSystemBase()
, m_interlaced(false)
{
- m_enumRenderingSystem = RENDERING_SYSTEM_DIRECTX;
m_bVSync = true;
memset(&m_viewPort, 0, sizeof m_viewPort);
@@ -704,40 +703,6 @@ void CRenderSystemDX::CheckDeviceCaps()
// 11_x and greater feature level. Limit this size to avoid memory overheads
m_maxTextureSize = D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION >> 1;
- m_renderCaps = 0;
- unsigned int usage = D3D11_FORMAT_SUPPORT_TEXTURE2D | D3D11_FORMAT_SUPPORT_SHADER_SAMPLE;
-
- if ( IsFormatSupport(DXGI_FORMAT_BC1_UNORM, usage)
- && IsFormatSupport(DXGI_FORMAT_BC2_UNORM, usage)
- && IsFormatSupport(DXGI_FORMAT_BC3_UNORM, usage))
- m_renderCaps |= RENDER_CAPS_DXT;
-
- // MSDN: At feature levels 9_1, 9_2 and 9_3, the display device supports the use of 2D textures with dimensions that are not powers of two under two conditions.
- // First, only one MIP-map level for each texture can be created - we are using only 1 mip level)
- // Second, no wrap sampler modes for textures are allowed - we are using clamp everywhere
- // At feature levels 10_0, 10_1 and 11_0, the display device unconditionally supports the use of 2D textures with dimensions that are not powers of two.
- // so, setup caps NPOT
- m_renderCaps |= feature_level > D3D_FEATURE_LEVEL_9_3 ? RENDER_CAPS_NPOT : 0;
- if ((m_renderCaps & RENDER_CAPS_DXT) != 0)
- {
- if (feature_level > D3D_FEATURE_LEVEL_9_3 ||
- (!IsFormatSupport(DXGI_FORMAT_BC1_UNORM, D3D11_FORMAT_SUPPORT_MIP_AUTOGEN)
- && !IsFormatSupport(DXGI_FORMAT_BC2_UNORM, D3D11_FORMAT_SUPPORT_MIP_AUTOGEN)
- && !IsFormatSupport(DXGI_FORMAT_BC3_UNORM, D3D11_FORMAT_SUPPORT_MIP_AUTOGEN)))
- m_renderCaps |= RENDER_CAPS_DXT_NPOT;
- }
-
- // Temporary - allow limiting the caps to debug a texture problem
- if (g_advancedSettings.m_RestrictCapsMask != 0)
- m_renderCaps &= ~g_advancedSettings.m_RestrictCapsMask;
-
- if (m_renderCaps & RENDER_CAPS_DXT)
- CLog::Log(LOGDEBUG, "%s - RENDER_CAPS_DXT", __FUNCTION__);
- if (m_renderCaps & RENDER_CAPS_NPOT)
- CLog::Log(LOGDEBUG, "%s - RENDER_CAPS_NPOT", __FUNCTION__);
- if (m_renderCaps & RENDER_CAPS_DXT_NPOT)
- CLog::Log(LOGDEBUG, "%s - RENDER_CAPS_DXT_NPOT", __FUNCTION__);
-
m_processorFormats.clear();
m_sharedFormats.clear();
m_shaderFormats.clear();
@@ -828,3 +793,15 @@ void CRenderSystemDX::CheckDeviceCaps()
m_shaderFormats.push_back(AV_PIX_FMT_UYVY422);
}
}
+
+bool CRenderSystemDX::SupportsNPOT(bool dxt) const
+{
+ // MSDN says:
+ // At feature levels 9_1, 9_2 and 9_3, the display device supports the use
+ // of 2D textures with dimensions that are not powers of two under two conditions:
+ // 1) only one MIP-map level for each texture can be created - we are using both 1 and 0 mipmap levels
+ // 2) no wrap sampler modes for textures are allowed - we are using clamp everywhere
+ // At feature levels 10_0, 10_1 and 11_0, the display device unconditionally supports the use of 2D textures with dimensions that are not powers of two.
+ // taking in account first condition we setup caps NPOT for FE > 9.x only
+ return m_deviceResources->GetDeviceFeatureLevel() > D3D_FEATURE_LEVEL_9_3 ? true : false;
+}
diff --git a/xbmc/rendering/dx/RenderSystemDX.h b/xbmc/rendering/dx/RenderSystemDX.h
index 6da7b8135e..ccb816c9c9 100644
--- a/xbmc/rendering/dx/RenderSystemDX.h
+++ b/xbmc/rendering/dx/RenderSystemDX.h
@@ -71,6 +71,7 @@ public:
bool SupportsStereo(RENDER_STEREO_MODE mode) const override;
bool TestRender() override;
void Project(float &x, float &y, float &z) override;
+ bool SupportsNPOT(bool dxt) const override;
// IDeviceNotify overrides
void OnDXDeviceLost() override;