mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 07:09:48 -06:00
VideoCommon: Move backend_info out of VideoConfig struct.
This commit is contained in:
@ -75,68 +75,67 @@ void VideoBackend::InitBackendInfo(const WindowSystemInfo& wsi)
|
||||
|
||||
void VideoBackend::FillBackendInfo()
|
||||
{
|
||||
g_Config.backend_info.api_type = APIType::D3D;
|
||||
g_Config.backend_info.MaxTextureSize = D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION;
|
||||
g_Config.backend_info.bUsesLowerLeftOrigin = false;
|
||||
g_Config.backend_info.bSupportsExclusiveFullscreen = true;
|
||||
g_Config.backend_info.bSupportsDualSourceBlend = true;
|
||||
g_Config.backend_info.bSupportsPrimitiveRestart = true;
|
||||
g_Config.backend_info.bSupportsGeometryShaders = true;
|
||||
g_Config.backend_info.bSupportsComputeShaders = false;
|
||||
g_Config.backend_info.bSupports3DVision = true;
|
||||
g_Config.backend_info.bSupportsPostProcessing = true;
|
||||
g_Config.backend_info.bSupportsPaletteConversion = true;
|
||||
g_Config.backend_info.bSupportsClipControl = true;
|
||||
g_Config.backend_info.bSupportsDepthClamp = true;
|
||||
g_Config.backend_info.bSupportsReversedDepthRange = false;
|
||||
g_Config.backend_info.bSupportsMultithreading = false;
|
||||
g_Config.backend_info.bSupportsGPUTextureDecoding = true;
|
||||
g_Config.backend_info.bSupportsCopyToVram = true;
|
||||
g_Config.backend_info.bSupportsLargePoints = false;
|
||||
g_Config.backend_info.bSupportsDepthReadback = true;
|
||||
g_Config.backend_info.bSupportsPartialDepthCopies = false;
|
||||
g_Config.backend_info.bSupportsBitfield = false;
|
||||
g_Config.backend_info.bSupportsDynamicSamplerIndexing = false;
|
||||
g_Config.backend_info.bSupportsFramebufferFetch = false;
|
||||
g_Config.backend_info.bSupportsBackgroundCompiling = true;
|
||||
g_Config.backend_info.bSupportsST3CTextures = true;
|
||||
g_Config.backend_info.bSupportsBPTCTextures = true;
|
||||
g_Config.backend_info.bSupportsEarlyZ = true;
|
||||
g_Config.backend_info.bSupportsBBox = true;
|
||||
g_Config.backend_info.bSupportsFragmentStoresAndAtomics = true;
|
||||
g_Config.backend_info.bSupportsGSInstancing = true;
|
||||
g_Config.backend_info.bSupportsSSAA = true;
|
||||
g_Config.backend_info.bSupportsShaderBinaries = true;
|
||||
g_Config.backend_info.bSupportsPipelineCacheData = false;
|
||||
g_Config.backend_info.bSupportsCoarseDerivatives = true;
|
||||
g_Config.backend_info.bSupportsTextureQueryLevels = true;
|
||||
g_Config.backend_info.bSupportsLodBiasInSampler = true;
|
||||
g_Config.backend_info.bSupportsLogicOp = D3D::SupportsLogicOp(g_Config.iAdapter);
|
||||
g_Config.backend_info.bSupportsSettingObjectNames = true;
|
||||
g_Config.backend_info.bSupportsPartialMultisampleResolve = true;
|
||||
g_Config.backend_info.bSupportsDynamicVertexLoader = false;
|
||||
g_Config.backend_info.bSupportsHDROutput = true;
|
||||
g_backend_info.api_type = APIType::D3D;
|
||||
g_backend_info.MaxTextureSize = D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION;
|
||||
g_backend_info.bUsesLowerLeftOrigin = false;
|
||||
g_backend_info.bSupportsExclusiveFullscreen = true;
|
||||
g_backend_info.bSupportsDualSourceBlend = true;
|
||||
g_backend_info.bSupportsPrimitiveRestart = true;
|
||||
g_backend_info.bSupportsGeometryShaders = true;
|
||||
g_backend_info.bSupportsComputeShaders = false;
|
||||
g_backend_info.bSupports3DVision = true;
|
||||
g_backend_info.bSupportsPostProcessing = true;
|
||||
g_backend_info.bSupportsPaletteConversion = true;
|
||||
g_backend_info.bSupportsClipControl = true;
|
||||
g_backend_info.bSupportsDepthClamp = true;
|
||||
g_backend_info.bSupportsReversedDepthRange = false;
|
||||
g_backend_info.bSupportsMultithreading = false;
|
||||
g_backend_info.bSupportsGPUTextureDecoding = true;
|
||||
g_backend_info.bSupportsCopyToVram = true;
|
||||
g_backend_info.bSupportsLargePoints = false;
|
||||
g_backend_info.bSupportsDepthReadback = true;
|
||||
g_backend_info.bSupportsPartialDepthCopies = false;
|
||||
g_backend_info.bSupportsBitfield = false;
|
||||
g_backend_info.bSupportsDynamicSamplerIndexing = false;
|
||||
g_backend_info.bSupportsFramebufferFetch = false;
|
||||
g_backend_info.bSupportsBackgroundCompiling = true;
|
||||
g_backend_info.bSupportsST3CTextures = true;
|
||||
g_backend_info.bSupportsBPTCTextures = true;
|
||||
g_backend_info.bSupportsEarlyZ = true;
|
||||
g_backend_info.bSupportsBBox = true;
|
||||
g_backend_info.bSupportsFragmentStoresAndAtomics = true;
|
||||
g_backend_info.bSupportsGSInstancing = true;
|
||||
g_backend_info.bSupportsSSAA = true;
|
||||
g_backend_info.bSupportsShaderBinaries = true;
|
||||
g_backend_info.bSupportsPipelineCacheData = false;
|
||||
g_backend_info.bSupportsCoarseDerivatives = true;
|
||||
g_backend_info.bSupportsTextureQueryLevels = true;
|
||||
g_backend_info.bSupportsLodBiasInSampler = true;
|
||||
g_backend_info.bSupportsLogicOp = D3D::SupportsLogicOp(g_Config.iAdapter);
|
||||
g_backend_info.bSupportsSettingObjectNames = true;
|
||||
g_backend_info.bSupportsPartialMultisampleResolve = true;
|
||||
g_backend_info.bSupportsDynamicVertexLoader = false;
|
||||
g_backend_info.bSupportsHDROutput = true;
|
||||
|
||||
g_Config.backend_info.Adapters = D3DCommon::GetAdapterNames();
|
||||
g_Config.backend_info.AAModes = D3D::GetAAModes(g_Config.iAdapter);
|
||||
g_backend_info.Adapters = D3DCommon::GetAdapterNames();
|
||||
g_backend_info.AAModes = D3D::GetAAModes(g_Config.iAdapter);
|
||||
|
||||
// Override optional features if we are actually booting.
|
||||
if (D3D::device)
|
||||
{
|
||||
g_Config.backend_info.bSupportsST3CTextures =
|
||||
D3D::SupportsTextureFormat(DXGI_FORMAT_BC1_UNORM) &&
|
||||
D3D::SupportsTextureFormat(DXGI_FORMAT_BC2_UNORM) &&
|
||||
D3D::SupportsTextureFormat(DXGI_FORMAT_BC3_UNORM);
|
||||
g_Config.backend_info.bSupportsBPTCTextures = D3D::SupportsTextureFormat(DXGI_FORMAT_BC7_UNORM);
|
||||
g_backend_info.bSupportsST3CTextures = D3D::SupportsTextureFormat(DXGI_FORMAT_BC1_UNORM) &&
|
||||
D3D::SupportsTextureFormat(DXGI_FORMAT_BC2_UNORM) &&
|
||||
D3D::SupportsTextureFormat(DXGI_FORMAT_BC3_UNORM);
|
||||
g_backend_info.bSupportsBPTCTextures = D3D::SupportsTextureFormat(DXGI_FORMAT_BC7_UNORM);
|
||||
|
||||
// Features only supported with a FL11.0+ device.
|
||||
const bool shader_model_5_supported = D3D::feature_level >= D3D_FEATURE_LEVEL_11_0;
|
||||
g_Config.backend_info.bSupportsEarlyZ = shader_model_5_supported;
|
||||
g_Config.backend_info.bSupportsBBox = shader_model_5_supported;
|
||||
g_Config.backend_info.bSupportsFragmentStoresAndAtomics = shader_model_5_supported;
|
||||
g_Config.backend_info.bSupportsGSInstancing = shader_model_5_supported;
|
||||
g_Config.backend_info.bSupportsSSAA = shader_model_5_supported;
|
||||
g_Config.backend_info.bSupportsGPUTextureDecoding = shader_model_5_supported;
|
||||
g_backend_info.bSupportsEarlyZ = shader_model_5_supported;
|
||||
g_backend_info.bSupportsBBox = shader_model_5_supported;
|
||||
g_backend_info.bSupportsFragmentStoresAndAtomics = shader_model_5_supported;
|
||||
g_backend_info.bSupportsGSInstancing = shader_model_5_supported;
|
||||
g_backend_info.bSupportsSSAA = shader_model_5_supported;
|
||||
g_backend_info.bSupportsGPUTextureDecoding = shader_model_5_supported;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ void StateManager::Apply()
|
||||
// our bindings and sets them to null to prevent hazards.
|
||||
if (m_dirtyFlags.test(DirtyFlag_Framebuffer))
|
||||
{
|
||||
if (g_ActiveConfig.backend_info.bSupportsBBox)
|
||||
if (g_backend_info.bSupportsBBox)
|
||||
{
|
||||
D3D::context->OMSetRenderTargetsAndUnorderedAccessViews(
|
||||
m_pending.framebuffer->GetNumRTVs(),
|
||||
@ -363,7 +363,7 @@ ID3D11BlendState* StateCache::Get(BlendingState state)
|
||||
if (it != m_blend.end())
|
||||
return it->second.Get();
|
||||
|
||||
if (state.logicopenable && g_ActiveConfig.backend_info.bSupportsLogicOp)
|
||||
if (state.logicopenable && g_backend_info.bSupportsLogicOp)
|
||||
{
|
||||
D3D11_BLEND_DESC1 desc = {};
|
||||
D3D11_RENDER_TARGET_BLEND_DESC1& tdesc = desc.RenderTarget[0];
|
||||
|
@ -54,8 +54,7 @@ std::unique_ptr<DXPipeline> DXPipeline::Create(const AbstractPipelineConfig& con
|
||||
nullptr;
|
||||
|
||||
// Only use the integer RTV if logic op is supported, and enabled.
|
||||
const bool use_logic_op =
|
||||
config.blending_state.logicopenable && g_ActiveConfig.backend_info.bSupportsLogicOp;
|
||||
const bool use_logic_op = config.blending_state.logicopenable && g_backend_info.bSupportsLogicOp;
|
||||
|
||||
return std::make_unique<DXPipeline>(config, input_layout, vertex_shader->GetD3DVertexShader(),
|
||||
geometry_shader ? geometry_shader->GetD3DGeometryShader() :
|
||||
|
@ -452,7 +452,7 @@ DXFramebuffer::Create(DXTexture* color_attachment, DXTexture* depth_attachment,
|
||||
// Only create the integer RTV when logic ops are supported (Win8+).
|
||||
DXGI_FORMAT integer_format =
|
||||
D3DCommon::GetRTVFormatForAbstractFormat(color_attachment->GetFormat(), true);
|
||||
if (g_ActiveConfig.backend_info.bSupportsLogicOp && integer_format != desc.Format)
|
||||
if (g_backend_info.bSupportsLogicOp && integer_format != desc.Format)
|
||||
{
|
||||
desc.Format = integer_format;
|
||||
hr = D3D::device->CreateRenderTargetView(color_attachment->GetD3DTexture(), &desc,
|
||||
|
Reference in New Issue
Block a user