Graphics: Add forceDisableFeatures config

This commit is contained in:
Jérôme Leclercq 2021-07-09 12:37:11 +02:00
parent 9f410302d2
commit c72dfc8004
2 changed files with 4 additions and 3 deletions

View File

@ -42,6 +42,7 @@ namespace Nz
struct Config
{
RenderDeviceFeatures forceDisableFeatures;
bool useDedicatedRenderDevice = true;
};

View File

@ -52,9 +52,9 @@ namespace Nz
}
RenderDeviceFeatures enabledFeatures;
enabledFeatures.anisotropicFiltering = renderDeviceInfo[bestRenderDeviceIndex].features.anisotropicFiltering;
enabledFeatures.depthClamping = renderDeviceInfo[bestRenderDeviceIndex].features.depthClamping;
enabledFeatures.nonSolidFaceFilling = renderDeviceInfo[bestRenderDeviceIndex].features.nonSolidFaceFilling;
enabledFeatures.anisotropicFiltering = !config.forceDisableFeatures.anisotropicFiltering && renderDeviceInfo[bestRenderDeviceIndex].features.anisotropicFiltering;
enabledFeatures.depthClamping = !config.forceDisableFeatures.depthClamping && renderDeviceInfo[bestRenderDeviceIndex].features.depthClamping;
enabledFeatures.nonSolidFaceFilling = !config.forceDisableFeatures.nonSolidFaceFilling && renderDeviceInfo[bestRenderDeviceIndex].features.nonSolidFaceFilling;
m_renderDevice = renderer->InstanciateRenderDevice(bestRenderDeviceIndex, enabledFeatures);
if (!m_renderDevice)