mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
VideoCommon: Move backend_info out of VideoConfig struct.
This commit is contained in:
@@ -396,32 +396,31 @@ void DolphinAnalytics::MakePerGameBuilder()
|
||||
builder.AddData("cfg-gfx-vertex-rounding", g_Config.UseVertexRounding());
|
||||
|
||||
// GPU features.
|
||||
if (g_Config.iAdapter < static_cast<int>(g_Config.backend_info.Adapters.size()))
|
||||
if (g_Config.iAdapter < static_cast<int>(g_backend_info.Adapters.size()))
|
||||
{
|
||||
builder.AddData("gpu-adapter", g_Config.backend_info.Adapters[g_Config.iAdapter]);
|
||||
builder.AddData("gpu-adapter", g_backend_info.Adapters[g_Config.iAdapter]);
|
||||
}
|
||||
else if (!g_Config.backend_info.AdapterName.empty())
|
||||
else if (!g_backend_info.AdapterName.empty())
|
||||
{
|
||||
builder.AddData("gpu-adapter", g_Config.backend_info.AdapterName);
|
||||
builder.AddData("gpu-adapter", g_backend_info.AdapterName);
|
||||
}
|
||||
builder.AddData("gpu-has-exclusive-fullscreen",
|
||||
g_Config.backend_info.bSupportsExclusiveFullscreen);
|
||||
builder.AddData("gpu-has-dual-source-blend", g_Config.backend_info.bSupportsDualSourceBlend);
|
||||
builder.AddData("gpu-has-primitive-restart", g_Config.backend_info.bSupportsPrimitiveRestart);
|
||||
builder.AddData("gpu-has-geometry-shaders", g_Config.backend_info.bSupportsGeometryShaders);
|
||||
builder.AddData("gpu-has-3d-vision", g_Config.backend_info.bSupports3DVision);
|
||||
builder.AddData("gpu-has-early-z", g_Config.backend_info.bSupportsEarlyZ);
|
||||
builder.AddData("gpu-has-binding-layout", g_Config.backend_info.bSupportsBindingLayout);
|
||||
builder.AddData("gpu-has-bbox", g_Config.backend_info.bSupportsBBox);
|
||||
builder.AddData("gpu-has-exclusive-fullscreen", g_backend_info.bSupportsExclusiveFullscreen);
|
||||
builder.AddData("gpu-has-dual-source-blend", g_backend_info.bSupportsDualSourceBlend);
|
||||
builder.AddData("gpu-has-primitive-restart", g_backend_info.bSupportsPrimitiveRestart);
|
||||
builder.AddData("gpu-has-geometry-shaders", g_backend_info.bSupportsGeometryShaders);
|
||||
builder.AddData("gpu-has-3d-vision", g_backend_info.bSupports3DVision);
|
||||
builder.AddData("gpu-has-early-z", g_backend_info.bSupportsEarlyZ);
|
||||
builder.AddData("gpu-has-binding-layout", g_backend_info.bSupportsBindingLayout);
|
||||
builder.AddData("gpu-has-bbox", g_backend_info.bSupportsBBox);
|
||||
builder.AddData("gpu-has-fragment-stores-and-atomics",
|
||||
g_Config.backend_info.bSupportsFragmentStoresAndAtomics);
|
||||
builder.AddData("gpu-has-gs-instancing", g_Config.backend_info.bSupportsGSInstancing);
|
||||
builder.AddData("gpu-has-post-processing", g_Config.backend_info.bSupportsPostProcessing);
|
||||
builder.AddData("gpu-has-palette-conversion", g_Config.backend_info.bSupportsPaletteConversion);
|
||||
builder.AddData("gpu-has-clip-control", g_Config.backend_info.bSupportsClipControl);
|
||||
builder.AddData("gpu-has-ssaa", g_Config.backend_info.bSupportsSSAA);
|
||||
builder.AddData("gpu-has-logic-ops", g_Config.backend_info.bSupportsLogicOp);
|
||||
builder.AddData("gpu-has-framebuffer-fetch", g_Config.backend_info.bSupportsFramebufferFetch);
|
||||
g_backend_info.bSupportsFragmentStoresAndAtomics);
|
||||
builder.AddData("gpu-has-gs-instancing", g_backend_info.bSupportsGSInstancing);
|
||||
builder.AddData("gpu-has-post-processing", g_backend_info.bSupportsPostProcessing);
|
||||
builder.AddData("gpu-has-palette-conversion", g_backend_info.bSupportsPaletteConversion);
|
||||
builder.AddData("gpu-has-clip-control", g_backend_info.bSupportsClipControl);
|
||||
builder.AddData("gpu-has-ssaa", g_backend_info.bSupportsSSAA);
|
||||
builder.AddData("gpu-has-logic-ops", g_backend_info.bSupportsLogicOp);
|
||||
builder.AddData("gpu-has-framebuffer-fetch", g_backend_info.bSupportsFramebufferFetch);
|
||||
|
||||
// NetPlay / recording.
|
||||
builder.AddData("netplay", NetPlay::IsNetPlayRunning());
|
||||
|
||||
@@ -271,10 +271,9 @@ void AdvancedWidget::ConnectWidgets()
|
||||
|
||||
void AdvancedWidget::OnBackendChanged()
|
||||
{
|
||||
m_backend_multithreading->setEnabled(g_Config.backend_info.bSupportsMultithreading);
|
||||
m_prefer_vs_for_point_line_expansion->setEnabled(
|
||||
g_Config.backend_info.bSupportsGeometryShaders &&
|
||||
g_Config.backend_info.bSupportsVSLinePointExpand);
|
||||
m_backend_multithreading->setEnabled(g_backend_info.bSupportsMultithreading);
|
||||
m_prefer_vs_for_point_line_expansion->setEnabled(g_backend_info.bSupportsGeometryShaders &&
|
||||
g_backend_info.bSupportsVSLinePointExpand);
|
||||
AddDescriptions();
|
||||
}
|
||||
|
||||
@@ -492,12 +491,12 @@ void AdvancedWidget::AddDescriptions()
|
||||
m_enable_prog_scan->SetDescription(tr(TR_PROGRESSIVE_SCAN_DESCRIPTION));
|
||||
m_backend_multithreading->SetDescription(tr(TR_BACKEND_MULTITHREADING_DESCRIPTION));
|
||||
QString vsexpand_extra;
|
||||
if (!g_Config.backend_info.bSupportsGeometryShaders)
|
||||
if (!g_backend_info.bSupportsGeometryShaders)
|
||||
vsexpand_extra = tr("Forced on because %1 doesn't support geometry shaders.")
|
||||
.arg(tr(g_Config.backend_info.DisplayName.c_str()));
|
||||
else if (!g_Config.backend_info.bSupportsVSLinePointExpand)
|
||||
.arg(tr(g_backend_info.DisplayName.c_str()));
|
||||
else if (!g_backend_info.bSupportsVSLinePointExpand)
|
||||
vsexpand_extra = tr("Forced off because %1 doesn't support VS expansion.")
|
||||
.arg(tr(g_Config.backend_info.DisplayName.c_str()));
|
||||
.arg(tr(g_backend_info.DisplayName.c_str()));
|
||||
else
|
||||
vsexpand_extra = tr(IF_UNSURE_UNCHECKED);
|
||||
m_prefer_vs_for_point_line_expansion->SetDescription(
|
||||
|
||||
@@ -343,19 +343,19 @@ void EnhancementsWidget::LoadPPShaders()
|
||||
|
||||
void EnhancementsWidget::OnBackendChanged()
|
||||
{
|
||||
m_output_resampling_combo->setEnabled(g_Config.backend_info.bSupportsPostProcessing);
|
||||
m_configure_color_correction->setEnabled(g_Config.backend_info.bSupportsPostProcessing);
|
||||
m_hdr->setEnabled(g_Config.backend_info.bSupportsHDROutput);
|
||||
m_output_resampling_combo->setEnabled(g_backend_info.bSupportsPostProcessing);
|
||||
m_configure_color_correction->setEnabled(g_backend_info.bSupportsPostProcessing);
|
||||
m_hdr->setEnabled(g_backend_info.bSupportsHDROutput);
|
||||
|
||||
// Stereoscopy
|
||||
const bool supports_stereoscopy = g_Config.backend_info.bSupportsGeometryShaders;
|
||||
const bool supports_stereoscopy = g_backend_info.bSupportsGeometryShaders;
|
||||
m_3d_mode->setEnabled(supports_stereoscopy);
|
||||
m_3d_convergence->setEnabled(supports_stereoscopy);
|
||||
m_3d_depth->setEnabled(supports_stereoscopy);
|
||||
m_3d_swap_eyes->setEnabled(supports_stereoscopy);
|
||||
|
||||
// PostProcessing
|
||||
const bool supports_postprocessing = g_Config.backend_info.bSupportsPostProcessing;
|
||||
const bool supports_postprocessing = g_backend_info.bSupportsPostProcessing;
|
||||
if (!supports_postprocessing)
|
||||
{
|
||||
m_configure_pp_effect->setEnabled(false);
|
||||
@@ -421,14 +421,14 @@ void EnhancementsWidget::UpdateAAOptions()
|
||||
m_aa_combo->Reset();
|
||||
m_aa_combo->Add(tr("None"), (u32)1, false);
|
||||
|
||||
std::vector<u32> aa_modes = g_Config.backend_info.AAModes;
|
||||
const std::vector<u32>& aa_modes = g_backend_info.AAModes;
|
||||
for (const u32 aa_mode : aa_modes)
|
||||
{
|
||||
if (aa_mode > 1)
|
||||
m_aa_combo->Add(tr("%1x MSAA").arg(aa_mode), aa_mode, false);
|
||||
}
|
||||
|
||||
if (g_Config.backend_info.bSupportsSSAA)
|
||||
if (g_backend_info.bSupportsSSAA)
|
||||
{
|
||||
for (const u32 aa_mode : aa_modes)
|
||||
{
|
||||
|
||||
@@ -226,7 +226,7 @@ void GeneralWidget::OnEmulationStateChanged(bool running)
|
||||
m_render_main_window->setEnabled(!running);
|
||||
m_enable_fullscreen->setEnabled(!running);
|
||||
|
||||
const bool supports_adapters = !g_Config.backend_info.Adapters.empty();
|
||||
const bool supports_adapters = !g_backend_info.Adapters.empty();
|
||||
m_adapter_combo->setEnabled(!running && supports_adapters);
|
||||
|
||||
std::string current_backend = m_backend_combo->currentData().toString().toStdString();
|
||||
@@ -362,7 +362,7 @@ void GeneralWidget::OnBackendChanged(const QString& backend_name)
|
||||
|
||||
m_adapter_combo->clear();
|
||||
|
||||
const auto& adapters = g_Config.backend_info.Adapters;
|
||||
const auto& adapters = g_backend_info.Adapters;
|
||||
|
||||
for (const auto& adapter : adapters)
|
||||
m_adapter_combo->addItem(QString::fromStdString(adapter));
|
||||
|
||||
@@ -11,14 +11,11 @@
|
||||
|
||||
#include "Core/Config/GraphicsSettings.h"
|
||||
#include "Core/Config/MainSettings.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
|
||||
#include "DolphinQt/Config/ConfigControls/ConfigBool.h"
|
||||
#include "DolphinQt/Config/ConfigControls/ConfigSlider.h"
|
||||
#include "DolphinQt/Config/GameConfigWidget.h"
|
||||
#include "DolphinQt/Config/Graphics/GraphicsWindow.h"
|
||||
#include "DolphinQt/Config/ToolTipControls/ToolTipSlider.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
||||
#include "VideoCommon/VideoConfig.h"
|
||||
|
||||
@@ -135,8 +132,8 @@ void HacksWidget::CreateWidgets()
|
||||
|
||||
void HacksWidget::OnBackendChanged(const QString& backend_name)
|
||||
{
|
||||
const bool bbox = g_Config.backend_info.bSupportsBBox;
|
||||
const bool gpu_texture_decoding = g_Config.backend_info.bSupportsGPUTextureDecoding;
|
||||
const bool bbox = g_backend_info.bSupportsBBox;
|
||||
const bool gpu_texture_decoding = g_backend_info.bSupportsGPUTextureDecoding;
|
||||
|
||||
m_gpu_texture_decoding->setEnabled(gpu_texture_decoding);
|
||||
m_disable_bounding_box->setEnabled(bbox);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -23,8 +23,7 @@ namespace DX12
|
||||
static bool UsesDynamicVertexLoader(const AbstractPipeline* pipeline)
|
||||
{
|
||||
const AbstractPipelineUsage usage = static_cast<const DXPipeline*>(pipeline)->GetUsage();
|
||||
return (g_ActiveConfig.backend_info.bSupportsDynamicVertexLoader &&
|
||||
usage == AbstractPipelineUsage::GXUber) ||
|
||||
return (g_backend_info.bSupportsDynamicVertexLoader && usage == AbstractPipelineUsage::GXUber) ||
|
||||
(g_ActiveConfig.UseVSForLinePointExpand() && usage != AbstractPipelineUsage::Utility);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,59 +47,59 @@ void VideoBackend::InitBackendInfo(const WindowSystemInfo& wsi)
|
||||
|
||||
void VideoBackend::FillBackendInfo()
|
||||
{
|
||||
g_Config.backend_info.api_type = APIType::D3D;
|
||||
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.bSupports3DVision = false;
|
||||
g_Config.backend_info.bSupportsEarlyZ = true;
|
||||
g_Config.backend_info.bSupportsBindingLayout = false;
|
||||
g_Config.backend_info.bSupportsBBox = true;
|
||||
g_Config.backend_info.bSupportsGSInstancing = true;
|
||||
g_Config.backend_info.bSupportsPaletteConversion = true;
|
||||
g_Config.backend_info.bSupportsPostProcessing = true;
|
||||
g_Config.backend_info.bSupportsClipControl = true;
|
||||
g_Config.backend_info.bSupportsSSAA = true;
|
||||
g_Config.backend_info.bSupportsFragmentStoresAndAtomics = true;
|
||||
g_Config.backend_info.bSupportsDepthClamp = true;
|
||||
g_Config.backend_info.bSupportsReversedDepthRange = false;
|
||||
g_Config.backend_info.bSupportsComputeShaders = true;
|
||||
g_Config.backend_info.bSupportsLogicOp = true;
|
||||
g_Config.backend_info.bSupportsMultithreading = false;
|
||||
g_Config.backend_info.bSupportsGPUTextureDecoding = true;
|
||||
g_Config.backend_info.bSupportsST3CTextures = false;
|
||||
g_Config.backend_info.bSupportsCopyToVram = true;
|
||||
g_Config.backend_info.bSupportsBitfield = false;
|
||||
g_Config.backend_info.bSupportsDynamicSamplerIndexing = false;
|
||||
g_Config.backend_info.bSupportsBPTCTextures = false;
|
||||
g_Config.backend_info.bSupportsFramebufferFetch = false;
|
||||
g_Config.backend_info.bSupportsBackgroundCompiling = true;
|
||||
g_Config.backend_info.bSupportsLargePoints = false;
|
||||
g_Config.backend_info.bSupportsDepthReadback = true;
|
||||
g_Config.backend_info.bSupportsPartialDepthCopies = false;
|
||||
g_Config.backend_info.Adapters = D3DCommon::GetAdapterNames();
|
||||
g_Config.backend_info.AAModes = DXContext::GetAAModes(g_Config.iAdapter);
|
||||
g_Config.backend_info.bSupportsShaderBinaries = true;
|
||||
g_Config.backend_info.bSupportsPipelineCacheData = true;
|
||||
g_Config.backend_info.bSupportsCoarseDerivatives = true;
|
||||
g_Config.backend_info.bSupportsTextureQueryLevels = true;
|
||||
g_Config.backend_info.bSupportsLodBiasInSampler = true;
|
||||
g_Config.backend_info.bSupportsSettingObjectNames = true;
|
||||
g_Config.backend_info.bSupportsPartialMultisampleResolve = true;
|
||||
g_Config.backend_info.bSupportsDynamicVertexLoader = true;
|
||||
g_Config.backend_info.bSupportsVSLinePointExpand = true;
|
||||
g_Config.backend_info.bSupportsHDROutput = true;
|
||||
g_backend_info.api_type = APIType::D3D;
|
||||
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.bSupports3DVision = false;
|
||||
g_backend_info.bSupportsEarlyZ = true;
|
||||
g_backend_info.bSupportsBindingLayout = false;
|
||||
g_backend_info.bSupportsBBox = true;
|
||||
g_backend_info.bSupportsGSInstancing = true;
|
||||
g_backend_info.bSupportsPaletteConversion = true;
|
||||
g_backend_info.bSupportsPostProcessing = true;
|
||||
g_backend_info.bSupportsClipControl = true;
|
||||
g_backend_info.bSupportsSSAA = true;
|
||||
g_backend_info.bSupportsFragmentStoresAndAtomics = true;
|
||||
g_backend_info.bSupportsDepthClamp = true;
|
||||
g_backend_info.bSupportsReversedDepthRange = false;
|
||||
g_backend_info.bSupportsComputeShaders = true;
|
||||
g_backend_info.bSupportsLogicOp = true;
|
||||
g_backend_info.bSupportsMultithreading = false;
|
||||
g_backend_info.bSupportsGPUTextureDecoding = true;
|
||||
g_backend_info.bSupportsST3CTextures = false;
|
||||
g_backend_info.bSupportsCopyToVram = true;
|
||||
g_backend_info.bSupportsBitfield = false;
|
||||
g_backend_info.bSupportsDynamicSamplerIndexing = false;
|
||||
g_backend_info.bSupportsBPTCTextures = false;
|
||||
g_backend_info.bSupportsFramebufferFetch = false;
|
||||
g_backend_info.bSupportsBackgroundCompiling = true;
|
||||
g_backend_info.bSupportsLargePoints = false;
|
||||
g_backend_info.bSupportsDepthReadback = true;
|
||||
g_backend_info.bSupportsPartialDepthCopies = false;
|
||||
g_backend_info.Adapters = D3DCommon::GetAdapterNames();
|
||||
g_backend_info.AAModes = DXContext::GetAAModes(g_Config.iAdapter);
|
||||
g_backend_info.bSupportsShaderBinaries = true;
|
||||
g_backend_info.bSupportsPipelineCacheData = true;
|
||||
g_backend_info.bSupportsCoarseDerivatives = true;
|
||||
g_backend_info.bSupportsTextureQueryLevels = true;
|
||||
g_backend_info.bSupportsLodBiasInSampler = true;
|
||||
g_backend_info.bSupportsSettingObjectNames = true;
|
||||
g_backend_info.bSupportsPartialMultisampleResolve = true;
|
||||
g_backend_info.bSupportsDynamicVertexLoader = true;
|
||||
g_backend_info.bSupportsVSLinePointExpand = true;
|
||||
g_backend_info.bSupportsHDROutput = true;
|
||||
|
||||
// We can only check texture support once we have a device.
|
||||
if (g_dx_context)
|
||||
{
|
||||
g_Config.backend_info.bSupportsST3CTextures =
|
||||
g_backend_info.bSupportsST3CTextures =
|
||||
g_dx_context->SupportsTextureFormat(DXGI_FORMAT_BC1_UNORM) &&
|
||||
g_dx_context->SupportsTextureFormat(DXGI_FORMAT_BC2_UNORM) &&
|
||||
g_dx_context->SupportsTextureFormat(DXGI_FORMAT_BC3_UNORM);
|
||||
g_Config.backend_info.bSupportsBPTCTextures =
|
||||
g_backend_info.bSupportsBPTCTextures =
|
||||
g_dx_context->SupportsTextureFormat(DXGI_FORMAT_BC7_UNORM);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -334,7 +334,7 @@ void Metal::Gfx::ClearRegion(const MathUtil::Rectangle<int>& target_rc, bool col
|
||||
static_cast<double>((color >> 24) & 0xFF) / 255.0);
|
||||
// clang-format on
|
||||
float z_normalized = static_cast<float>(z & 0xFFFFFF) / 16777216.0f;
|
||||
if (!g_Config.backend_info.bSupportsReversedDepthRange)
|
||||
if (!g_backend_info.bSupportsReversedDepthRange)
|
||||
z_normalized = 1.f - z_normalized;
|
||||
g_state_tracker->BeginClearRenderPass(clear_color, z_normalized);
|
||||
return;
|
||||
|
||||
@@ -81,8 +81,8 @@ bool Metal::VideoBackend::Initialize(const WindowSystemInfo& wsi)
|
||||
return false;
|
||||
}
|
||||
|
||||
Util::PopulateBackendInfo(&g_Config);
|
||||
Util::PopulateBackendInfoAdapters(&g_Config, devs);
|
||||
Util::PopulateBackendInfo(&g_backend_info);
|
||||
Util::PopulateBackendInfoAdapters(&g_backend_info, devs);
|
||||
|
||||
// Since we haven't called InitializeShared yet, iAdapter may be out of range,
|
||||
// so we have to check it ourselves.
|
||||
@@ -93,7 +93,7 @@ bool Metal::VideoBackend::Initialize(const WindowSystemInfo& wsi)
|
||||
selected_adapter_index = 0;
|
||||
}
|
||||
MRCOwned<id<MTLDevice>> adapter = std::move(devs[selected_adapter_index]);
|
||||
Util::PopulateBackendInfoFeatures(&g_Config, adapter);
|
||||
Util::PopulateBackendInfoFeatures(g_Config, &g_backend_info, adapter);
|
||||
|
||||
#if TARGET_OS_OSX
|
||||
// This should be available on all macOS 13.3+ systems – but when using OCLP drivers, some devices
|
||||
@@ -143,16 +143,16 @@ void Metal::VideoBackend::InitBackendInfo(const WindowSystemInfo& wsi)
|
||||
{
|
||||
@autoreleasepool
|
||||
{
|
||||
Util::PopulateBackendInfo(&g_Config);
|
||||
Util::PopulateBackendInfo(&g_backend_info);
|
||||
auto adapters = Util::GetAdapterList();
|
||||
Util::PopulateBackendInfoAdapters(&g_Config, adapters);
|
||||
Util::PopulateBackendInfoAdapters(&g_backend_info, adapters);
|
||||
if (!adapters.empty())
|
||||
{
|
||||
// Use the selected adapter, or the first to fill features.
|
||||
size_t index = static_cast<size_t>(g_Config.iAdapter);
|
||||
if (index >= adapters.size())
|
||||
index = 0;
|
||||
Util::PopulateBackendInfoFeatures(&g_Config, adapters[index]);
|
||||
Util::PopulateBackendInfoFeatures(g_Config, &g_backend_info, adapters[index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -165,9 +165,9 @@ void Metal::VideoBackend::PrepareWindow(WindowSystemInfo& wsi)
|
||||
NSView* view = static_cast<NSView*>(wsi.render_surface);
|
||||
CAMetalLayer* layer = [CAMetalLayer layer];
|
||||
|
||||
Util::PopulateBackendInfo(&g_Config);
|
||||
Util::PopulateBackendInfo(&g_backend_info);
|
||||
|
||||
if (g_Config.backend_info.bSupportsHDROutput && g_Config.bHDR)
|
||||
if (g_backend_info.bSupportsHDROutput && g_Config.bHDR)
|
||||
{
|
||||
[layer setWantsExtendedDynamicRangeContent:YES];
|
||||
[layer setPixelFormat:MTLPixelFormatRGBA16Float];
|
||||
|
||||
@@ -57,7 +57,7 @@ void Metal::ObjectCache::Shutdown()
|
||||
|
||||
static MTLCompareFunction Convert(CompareMode mode)
|
||||
{
|
||||
const bool invert_depth = !g_Config.backend_info.bSupportsReversedDepthRange;
|
||||
const bool invert_depth = !g_backend_info.bSupportsReversedDepthRange;
|
||||
switch (mode)
|
||||
{
|
||||
case CompareMode::Never: return MTLCompareFunctionNever;
|
||||
|
||||
@@ -737,9 +737,8 @@ void Metal::StateTracker::PrepareRender()
|
||||
m_current.depth_stencil = pipe->DepthStencil();
|
||||
[enc setDepthStencilState:g_object_cache->GetDepthStencil(m_current.depth_stencil)];
|
||||
}
|
||||
MTLDepthClipMode clip = is_gx && g_ActiveConfig.backend_info.bSupportsDepthClamp ?
|
||||
MTLDepthClipModeClamp :
|
||||
MTLDepthClipModeClip;
|
||||
MTLDepthClipMode clip =
|
||||
is_gx && g_backend_info.bSupportsDepthClamp ? MTLDepthClipModeClamp : MTLDepthClipModeClip;
|
||||
if (clip != m_current.depth_clip_mode)
|
||||
{
|
||||
m_current.depth_clip_mode = clip;
|
||||
|
||||
@@ -41,10 +41,11 @@ struct Viewport
|
||||
|
||||
/// Gets the list of Metal devices, ordered so the system default device is first
|
||||
std::vector<MRCOwned<id<MTLDevice>>> GetAdapterList();
|
||||
void PopulateBackendInfo(VideoConfig* config);
|
||||
void PopulateBackendInfoAdapters(VideoConfig* config,
|
||||
void PopulateBackendInfo(BackendInfo* backend_info);
|
||||
void PopulateBackendInfoAdapters(BackendInfo* backend_info,
|
||||
const std::vector<MRCOwned<id<MTLDevice>>>& adapters);
|
||||
void PopulateBackendInfoFeatures(VideoConfig* config, id<MTLDevice> device);
|
||||
void PopulateBackendInfoFeatures(const VideoConfig& config, BackendInfo* backend_info,
|
||||
id<MTLDevice> device);
|
||||
|
||||
AbstractTextureFormat ToAbstract(MTLPixelFormat format);
|
||||
MTLPixelFormat FromAbstract(AbstractTextureFormat format);
|
||||
|
||||
@@ -36,58 +36,58 @@ std::vector<MRCOwned<id<MTLDevice>>> Metal::Util::GetAdapterList()
|
||||
return list;
|
||||
}
|
||||
|
||||
void Metal::Util::PopulateBackendInfo(VideoConfig* config)
|
||||
void Metal::Util::PopulateBackendInfo(BackendInfo* backend_info)
|
||||
{
|
||||
config->backend_info.api_type = APIType::Metal;
|
||||
config->backend_info.bUsesLowerLeftOrigin = false;
|
||||
config->backend_info.bSupportsExclusiveFullscreen = false;
|
||||
config->backend_info.bSupportsDualSourceBlend = true;
|
||||
config->backend_info.bSupportsPrimitiveRestart = true;
|
||||
config->backend_info.bSupportsGeometryShaders = false;
|
||||
config->backend_info.bSupportsComputeShaders = true;
|
||||
config->backend_info.bSupports3DVision = false;
|
||||
config->backend_info.bSupportsEarlyZ = true;
|
||||
config->backend_info.bSupportsBindingLayout = true;
|
||||
config->backend_info.bSupportsBBox = true;
|
||||
config->backend_info.bSupportsGSInstancing = false;
|
||||
config->backend_info.bSupportsPostProcessing = true;
|
||||
config->backend_info.bSupportsPaletteConversion = true;
|
||||
config->backend_info.bSupportsClipControl = true;
|
||||
config->backend_info.bSupportsSSAA = true;
|
||||
config->backend_info.bSupportsFragmentStoresAndAtomics = true;
|
||||
config->backend_info.bSupportsReversedDepthRange = false;
|
||||
config->backend_info.bSupportsLogicOp = false;
|
||||
config->backend_info.bSupportsMultithreading = false;
|
||||
config->backend_info.bSupportsGPUTextureDecoding = true;
|
||||
config->backend_info.bSupportsCopyToVram = true;
|
||||
config->backend_info.bSupportsBitfield = true;
|
||||
config->backend_info.bSupportsDynamicSamplerIndexing = true;
|
||||
config->backend_info.bSupportsFramebufferFetch = false;
|
||||
config->backend_info.bSupportsBackgroundCompiling = true;
|
||||
config->backend_info.bSupportsLargePoints = true;
|
||||
config->backend_info.bSupportsPartialDepthCopies = true;
|
||||
config->backend_info.bSupportsDepthReadback = true;
|
||||
config->backend_info.bSupportsShaderBinaries = false;
|
||||
config->backend_info.bSupportsPipelineCacheData = false;
|
||||
config->backend_info.bSupportsCoarseDerivatives = false;
|
||||
config->backend_info.bSupportsTextureQueryLevels = true;
|
||||
config->backend_info.bSupportsLodBiasInSampler = false;
|
||||
config->backend_info.bSupportsSettingObjectNames = true;
|
||||
backend_info->api_type = APIType::Metal;
|
||||
backend_info->bUsesLowerLeftOrigin = false;
|
||||
backend_info->bSupportsExclusiveFullscreen = false;
|
||||
backend_info->bSupportsDualSourceBlend = true;
|
||||
backend_info->bSupportsPrimitiveRestart = true;
|
||||
backend_info->bSupportsGeometryShaders = false;
|
||||
backend_info->bSupportsComputeShaders = true;
|
||||
backend_info->bSupports3DVision = false;
|
||||
backend_info->bSupportsEarlyZ = true;
|
||||
backend_info->bSupportsBindingLayout = true;
|
||||
backend_info->bSupportsBBox = true;
|
||||
backend_info->bSupportsGSInstancing = false;
|
||||
backend_info->bSupportsPostProcessing = true;
|
||||
backend_info->bSupportsPaletteConversion = true;
|
||||
backend_info->bSupportsClipControl = true;
|
||||
backend_info->bSupportsSSAA = true;
|
||||
backend_info->bSupportsFragmentStoresAndAtomics = true;
|
||||
backend_info->bSupportsReversedDepthRange = false;
|
||||
backend_info->bSupportsLogicOp = false;
|
||||
backend_info->bSupportsMultithreading = false;
|
||||
backend_info->bSupportsGPUTextureDecoding = true;
|
||||
backend_info->bSupportsCopyToVram = true;
|
||||
backend_info->bSupportsBitfield = true;
|
||||
backend_info->bSupportsDynamicSamplerIndexing = true;
|
||||
backend_info->bSupportsFramebufferFetch = false;
|
||||
backend_info->bSupportsBackgroundCompiling = true;
|
||||
backend_info->bSupportsLargePoints = true;
|
||||
backend_info->bSupportsPartialDepthCopies = true;
|
||||
backend_info->bSupportsDepthReadback = true;
|
||||
backend_info->bSupportsShaderBinaries = false;
|
||||
backend_info->bSupportsPipelineCacheData = false;
|
||||
backend_info->bSupportsCoarseDerivatives = false;
|
||||
backend_info->bSupportsTextureQueryLevels = true;
|
||||
backend_info->bSupportsLodBiasInSampler = false;
|
||||
backend_info->bSupportsSettingObjectNames = true;
|
||||
// Metal requires multisample resolve to be done on a render pass
|
||||
config->backend_info.bSupportsPartialMultisampleResolve = false;
|
||||
config->backend_info.bSupportsDynamicVertexLoader = true;
|
||||
config->backend_info.bSupportsVSLinePointExpand = true;
|
||||
config->backend_info.bSupportsHDROutput =
|
||||
backend_info->bSupportsPartialMultisampleResolve = false;
|
||||
backend_info->bSupportsDynamicVertexLoader = true;
|
||||
backend_info->bSupportsVSLinePointExpand = true;
|
||||
backend_info->bSupportsHDROutput =
|
||||
1.0 < [[NSScreen deepestScreen] maximumPotentialExtendedDynamicRangeColorComponentValue];
|
||||
}
|
||||
|
||||
void Metal::Util::PopulateBackendInfoAdapters(VideoConfig* config,
|
||||
void Metal::Util::PopulateBackendInfoAdapters(BackendInfo* backend_info,
|
||||
const std::vector<MRCOwned<id<MTLDevice>>>& adapters)
|
||||
{
|
||||
config->backend_info.Adapters.clear();
|
||||
backend_info->Adapters.clear();
|
||||
for (id<MTLDevice> adapter : adapters)
|
||||
{
|
||||
config->backend_info.Adapters.push_back([[adapter name] UTF8String]);
|
||||
backend_info->Adapters.push_back([[adapter name] UTF8String]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -238,7 +238,8 @@ fragment float4 is_helper_test() {
|
||||
return DetectionResult::Unsure;
|
||||
}
|
||||
|
||||
void Metal::Util::PopulateBackendInfoFeatures(VideoConfig* config, id<MTLDevice> device)
|
||||
void Metal::Util::PopulateBackendInfoFeatures(const VideoConfig& config, BackendInfo* backend_info,
|
||||
id<MTLDevice> device)
|
||||
{
|
||||
// Initialize DriverDetails first so we can use it later
|
||||
DriverDetails::Vendor vendor = DriverDetails::VENDOR_UNKNOWN;
|
||||
@@ -257,9 +258,9 @@ void Metal::Util::PopulateBackendInfoFeatures(VideoConfig* config, id<MTLDevice>
|
||||
DriverDetails::Family::UNKNOWN, std::move(name));
|
||||
|
||||
#if TARGET_OS_OSX
|
||||
config->backend_info.bSupportsDepthClamp = true;
|
||||
config->backend_info.bSupportsST3CTextures = true;
|
||||
config->backend_info.bSupportsBPTCTextures = true;
|
||||
backend_info->bSupportsDepthClamp = true;
|
||||
backend_info->bSupportsST3CTextures = true;
|
||||
backend_info->bSupportsBPTCTextures = true;
|
||||
#else
|
||||
bool supports_apple4 = false;
|
||||
bool supports_bcn = false;
|
||||
@@ -269,21 +270,21 @@ void Metal::Util::PopulateBackendInfoFeatures(VideoConfig* config, id<MTLDevice>
|
||||
supports_apple4 = [device supportsFeatureSet:MTLFeatureSet_iOS_GPUFamily4_v1];
|
||||
if (@available(iOS 16.4, *))
|
||||
supports_bcn = [device supportsBCTextureCompression];
|
||||
config->backend_info.bSupportsDepthClamp = supports_apple4;
|
||||
config->backend_info.bSupportsST3CTextures = supports_bcn;
|
||||
config->backend_info.bSupportsBPTCTextures = supports_bcn;
|
||||
backend_info->bSupportsDepthClamp = supports_apple4;
|
||||
backend_info->bSupportsST3CTextures = supports_bcn;
|
||||
backend_info->bSupportsBPTCTextures = supports_bcn;
|
||||
|
||||
config->backend_info.bSupportsFramebufferFetch = true;
|
||||
backend_info->bSupportsFramebufferFetch = true;
|
||||
#endif
|
||||
|
||||
config->backend_info.AAModes.clear();
|
||||
backend_info->AAModes.clear();
|
||||
for (u32 i = 1; i <= 64; i <<= 1)
|
||||
{
|
||||
if ([device supportsTextureSampleCount:i])
|
||||
config->backend_info.AAModes.push_back(i);
|
||||
backend_info->AAModes.push_back(i);
|
||||
}
|
||||
|
||||
switch (config->iManuallyUploadBuffers)
|
||||
switch (config.iManuallyUploadBuffers)
|
||||
{
|
||||
case TriState::Off:
|
||||
g_features.manual_buffer_upload = false;
|
||||
@@ -310,7 +311,7 @@ void Metal::Util::PopulateBackendInfoFeatures(VideoConfig* config, id<MTLDevice>
|
||||
// Requires SIMD-scoped reduction operations
|
||||
g_features.subgroup_ops =
|
||||
[device supportsFamily:MTLGPUFamilyMac2] || [device supportsFamily:MTLGPUFamilyApple7];
|
||||
config->backend_info.bSupportsFramebufferFetch = [device supportsFamily:MTLGPUFamilyApple1];
|
||||
backend_info->bSupportsFramebufferFetch = [device supportsFamily:MTLGPUFamilyApple1];
|
||||
}
|
||||
if (g_features.subgroup_ops)
|
||||
{
|
||||
@@ -325,10 +326,10 @@ void Metal::Util::PopulateBackendInfoFeatures(VideoConfig* config, id<MTLDevice>
|
||||
#if TARGET_OS_OSX
|
||||
if (@available(macOS 11, *))
|
||||
if (vendor == DriverDetails::VENDOR_INTEL)
|
||||
config->backend_info.bSupportsFramebufferFetch |= DetectIntelGPUFBFetch(device);
|
||||
backend_info->bSupportsFramebufferFetch |= DetectIntelGPUFBFetch(device);
|
||||
#endif
|
||||
if (DriverDetails::HasBug(DriverDetails::BUG_BROKEN_DYNAMIC_SAMPLER_INDEXING))
|
||||
config->backend_info.bSupportsDynamicSamplerIndexing = false;
|
||||
backend_info->bSupportsDynamicSamplerIndexing = false;
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "VideoBackends/Null/VideoBackend.h"
|
||||
|
||||
#include "Common/Common.h"
|
||||
#include "Common/MsgHandler.h"
|
||||
|
||||
#include "VideoBackends/Null/NullBoundingBox.h"
|
||||
#include "VideoBackends/Null/NullGfx.h"
|
||||
@@ -17,9 +16,6 @@
|
||||
#include "VideoBackends/Null/PerfQuery.h"
|
||||
#include "VideoBackends/Null/TextureCache.h"
|
||||
|
||||
#include "VideoCommon/FramebufferManager.h"
|
||||
#include "VideoCommon/Present.h"
|
||||
#include "VideoCommon/VideoBackendBase.h"
|
||||
#include "VideoCommon/VideoCommon.h"
|
||||
#include "VideoCommon/VideoConfig.h"
|
||||
|
||||
@@ -27,46 +23,46 @@ namespace Null
|
||||
{
|
||||
void VideoBackend::InitBackendInfo(const WindowSystemInfo& wsi)
|
||||
{
|
||||
g_Config.backend_info.api_type = APIType::Nothing;
|
||||
g_Config.backend_info.MaxTextureSize = 16384;
|
||||
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 = false;
|
||||
g_Config.backend_info.bSupportsEarlyZ = true;
|
||||
g_Config.backend_info.bSupportsBindingLayout = true;
|
||||
g_Config.backend_info.bSupportsBBox = true;
|
||||
g_Config.backend_info.bSupportsGSInstancing = true;
|
||||
g_Config.backend_info.bSupportsPostProcessing = false;
|
||||
g_Config.backend_info.bSupportsPaletteConversion = true;
|
||||
g_Config.backend_info.bSupportsClipControl = true;
|
||||
g_Config.backend_info.bSupportsSSAA = true;
|
||||
g_Config.backend_info.bSupportsDepthClamp = true;
|
||||
g_Config.backend_info.bSupportsReversedDepthRange = true;
|
||||
g_Config.backend_info.bSupportsMultithreading = false;
|
||||
g_Config.backend_info.bSupportsGPUTextureDecoding = false;
|
||||
g_Config.backend_info.bSupportsST3CTextures = false;
|
||||
g_Config.backend_info.bSupportsBPTCTextures = false;
|
||||
g_Config.backend_info.bSupportsFramebufferFetch = false;
|
||||
g_Config.backend_info.bSupportsBackgroundCompiling = false;
|
||||
g_Config.backend_info.bSupportsLogicOp = false;
|
||||
g_Config.backend_info.bSupportsLargePoints = false;
|
||||
g_Config.backend_info.bSupportsDepthReadback = false;
|
||||
g_Config.backend_info.bSupportsPartialDepthCopies = false;
|
||||
g_Config.backend_info.bSupportsShaderBinaries = false;
|
||||
g_Config.backend_info.bSupportsPipelineCacheData = false;
|
||||
g_Config.backend_info.bSupportsCoarseDerivatives = false;
|
||||
g_Config.backend_info.bSupportsTextureQueryLevels = false;
|
||||
g_Config.backend_info.bSupportsLodBiasInSampler = false;
|
||||
g_Config.backend_info.bSupportsSettingObjectNames = false;
|
||||
g_Config.backend_info.bSupportsPartialMultisampleResolve = true;
|
||||
g_Config.backend_info.bSupportsDynamicVertexLoader = false;
|
||||
g_backend_info.api_type = APIType::Nothing;
|
||||
g_backend_info.MaxTextureSize = 16384;
|
||||
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 = false;
|
||||
g_backend_info.bSupportsEarlyZ = true;
|
||||
g_backend_info.bSupportsBindingLayout = true;
|
||||
g_backend_info.bSupportsBBox = true;
|
||||
g_backend_info.bSupportsGSInstancing = true;
|
||||
g_backend_info.bSupportsPostProcessing = false;
|
||||
g_backend_info.bSupportsPaletteConversion = true;
|
||||
g_backend_info.bSupportsClipControl = true;
|
||||
g_backend_info.bSupportsSSAA = true;
|
||||
g_backend_info.bSupportsDepthClamp = true;
|
||||
g_backend_info.bSupportsReversedDepthRange = true;
|
||||
g_backend_info.bSupportsMultithreading = false;
|
||||
g_backend_info.bSupportsGPUTextureDecoding = false;
|
||||
g_backend_info.bSupportsST3CTextures = false;
|
||||
g_backend_info.bSupportsBPTCTextures = false;
|
||||
g_backend_info.bSupportsFramebufferFetch = false;
|
||||
g_backend_info.bSupportsBackgroundCompiling = false;
|
||||
g_backend_info.bSupportsLogicOp = false;
|
||||
g_backend_info.bSupportsLargePoints = false;
|
||||
g_backend_info.bSupportsDepthReadback = false;
|
||||
g_backend_info.bSupportsPartialDepthCopies = false;
|
||||
g_backend_info.bSupportsShaderBinaries = false;
|
||||
g_backend_info.bSupportsPipelineCacheData = false;
|
||||
g_backend_info.bSupportsCoarseDerivatives = false;
|
||||
g_backend_info.bSupportsTextureQueryLevels = false;
|
||||
g_backend_info.bSupportsLodBiasInSampler = false;
|
||||
g_backend_info.bSupportsSettingObjectNames = false;
|
||||
g_backend_info.bSupportsPartialMultisampleResolve = true;
|
||||
g_backend_info.bSupportsDynamicVertexLoader = false;
|
||||
|
||||
// aamodes: We only support 1 sample, so no MSAA
|
||||
g_Config.backend_info.Adapters.clear();
|
||||
g_Config.backend_info.AAModes = {1};
|
||||
g_backend_info.Adapters.clear();
|
||||
g_backend_info.AAModes = {1};
|
||||
}
|
||||
|
||||
bool VideoBackend::Initialize(const WindowSystemInfo& wsi)
|
||||
|
||||
@@ -283,25 +283,24 @@ bool PopulateConfig(GLContext* m_main_gl_context)
|
||||
}
|
||||
|
||||
// Copy the GPU name to g_Config, so Analytics can see it.
|
||||
g_Config.backend_info.AdapterName = g_ogl_config.gl_renderer;
|
||||
g_backend_info.AdapterName = g_ogl_config.gl_renderer;
|
||||
|
||||
g_Config.backend_info.bSupportsDualSourceBlend =
|
||||
(GLExtensions::Supports("GL_ARB_blend_func_extended") ||
|
||||
GLExtensions::Supports("GL_EXT_blend_func_extended"));
|
||||
g_Config.backend_info.bSupportsPrimitiveRestart =
|
||||
g_backend_info.bSupportsDualSourceBlend = (GLExtensions::Supports("GL_ARB_blend_func_extended") ||
|
||||
GLExtensions::Supports("GL_EXT_blend_func_extended"));
|
||||
g_backend_info.bSupportsPrimitiveRestart =
|
||||
!DriverDetails::HasBug(DriverDetails::BUG_PRIMITIVE_RESTART) &&
|
||||
((GLExtensions::Version() >= 310) || GLExtensions::Supports("GL_NV_primitive_restart"));
|
||||
g_Config.backend_info.bSupportsGSInstancing = GLExtensions::Supports("GL_ARB_gpu_shader5");
|
||||
g_Config.backend_info.bSupportsSSAA = GLExtensions::Supports("GL_ARB_gpu_shader5") &&
|
||||
GLExtensions::Supports("GL_ARB_sample_shading");
|
||||
g_Config.backend_info.bSupportsGeometryShaders =
|
||||
g_backend_info.bSupportsGSInstancing = GLExtensions::Supports("GL_ARB_gpu_shader5");
|
||||
g_backend_info.bSupportsSSAA = GLExtensions::Supports("GL_ARB_gpu_shader5") &&
|
||||
GLExtensions::Supports("GL_ARB_sample_shading");
|
||||
g_backend_info.bSupportsGeometryShaders =
|
||||
GLExtensions::Version() >= 320 &&
|
||||
!DriverDetails::HasBug(DriverDetails::BUG_BROKEN_GEOMETRY_SHADERS);
|
||||
g_Config.backend_info.bSupportsPaletteConversion =
|
||||
g_backend_info.bSupportsPaletteConversion =
|
||||
GLExtensions::Supports("GL_ARB_texture_buffer_object") ||
|
||||
GLExtensions::Supports("GL_OES_texture_buffer") ||
|
||||
GLExtensions::Supports("GL_EXT_texture_buffer");
|
||||
g_Config.backend_info.bSupportsClipControl = GLExtensions::Supports("GL_ARB_clip_control");
|
||||
g_backend_info.bSupportsClipControl = GLExtensions::Supports("GL_ARB_clip_control");
|
||||
g_ogl_config.bSupportsCopySubImage =
|
||||
(GLExtensions::Supports("GL_ARB_copy_image") || GLExtensions::Supports("GL_NV_copy_image") ||
|
||||
GLExtensions::Supports("GL_EXT_copy_image") ||
|
||||
@@ -311,17 +310,15 @@ bool PopulateConfig(GLContext* m_main_gl_context)
|
||||
|
||||
// Desktop OpenGL supports the binding layout if it supports 420pack
|
||||
// OpenGL ES 3.1 supports it implicitly without an extension
|
||||
g_Config.backend_info.bSupportsBindingLayout =
|
||||
GLExtensions::Supports("GL_ARB_shading_language_420pack");
|
||||
g_backend_info.bSupportsBindingLayout = GLExtensions::Supports("GL_ARB_shading_language_420pack");
|
||||
|
||||
// Clip distance support is useless without a method to clamp the depth range
|
||||
g_Config.backend_info.bSupportsDepthClamp = GLExtensions::Supports("GL_ARB_depth_clamp");
|
||||
g_backend_info.bSupportsDepthClamp = GLExtensions::Supports("GL_ARB_depth_clamp");
|
||||
|
||||
// Desktop OpenGL supports bitfield manulipation and dynamic sampler indexing if it supports
|
||||
// shader5. OpenGL ES 3.1 supports it implicitly without an extension
|
||||
g_Config.backend_info.bSupportsBitfield = GLExtensions::Supports("GL_ARB_gpu_shader5");
|
||||
g_Config.backend_info.bSupportsDynamicSamplerIndexing =
|
||||
GLExtensions::Supports("GL_ARB_gpu_shader5");
|
||||
g_backend_info.bSupportsBitfield = GLExtensions::Supports("GL_ARB_gpu_shader5");
|
||||
g_backend_info.bSupportsDynamicSamplerIndexing = GLExtensions::Supports("GL_ARB_gpu_shader5");
|
||||
|
||||
g_ogl_config.bIsES = m_main_gl_context->IsGLES();
|
||||
supports_glsl_cache = GLExtensions::Supports("GL_ARB_get_program_binary");
|
||||
@@ -341,14 +338,12 @@ bool PopulateConfig(GLContext* m_main_gl_context)
|
||||
g_ogl_config.bSupportsImageLoadStore = GLExtensions::Supports("GL_ARB_shader_image_load_store");
|
||||
g_ogl_config.bSupportsConservativeDepth = GLExtensions::Supports("GL_ARB_conservative_depth");
|
||||
g_ogl_config.bSupportsAniso = GLExtensions::Supports("GL_EXT_texture_filter_anisotropic");
|
||||
g_Config.backend_info.bSupportsComputeShaders = GLExtensions::Supports("GL_ARB_compute_shader");
|
||||
g_Config.backend_info.bSupportsST3CTextures =
|
||||
GLExtensions::Supports("GL_EXT_texture_compression_s3tc");
|
||||
g_Config.backend_info.bSupportsBPTCTextures =
|
||||
GLExtensions::Supports("GL_ARB_texture_compression_bptc");
|
||||
g_Config.backend_info.bSupportsCoarseDerivatives =
|
||||
g_backend_info.bSupportsComputeShaders = GLExtensions::Supports("GL_ARB_compute_shader");
|
||||
g_backend_info.bSupportsST3CTextures = GLExtensions::Supports("GL_EXT_texture_compression_s3tc");
|
||||
g_backend_info.bSupportsBPTCTextures = GLExtensions::Supports("GL_ARB_texture_compression_bptc");
|
||||
g_backend_info.bSupportsCoarseDerivatives =
|
||||
GLExtensions::Supports("GL_ARB_derivative_control") || GLExtensions::Version() >= 450;
|
||||
g_Config.backend_info.bSupportsTextureQueryLevels =
|
||||
g_backend_info.bSupportsTextureQueryLevels =
|
||||
GLExtensions::Supports("GL_ARB_texture_query_levels") || GLExtensions::Version() >= 430;
|
||||
|
||||
if (GLExtensions::Supports("GL_ARB_shader_storage_buffer_object"))
|
||||
@@ -357,13 +352,13 @@ bool PopulateConfig(GLContext* m_main_gl_context)
|
||||
GLint vs = 0;
|
||||
glGetIntegerv(GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS, &fs);
|
||||
glGetIntegerv(GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS, &vs);
|
||||
g_Config.backend_info.bSupportsFragmentStoresAndAtomics = fs >= 1;
|
||||
g_Config.backend_info.bSupportsVSLinePointExpand = vs >= 1;
|
||||
g_backend_info.bSupportsFragmentStoresAndAtomics = fs >= 1;
|
||||
g_backend_info.bSupportsVSLinePointExpand = vs >= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_Config.backend_info.bSupportsFragmentStoresAndAtomics = false;
|
||||
g_Config.backend_info.bSupportsVSLinePointExpand = false;
|
||||
g_backend_info.bSupportsFragmentStoresAndAtomics = false;
|
||||
g_backend_info.bSupportsVSLinePointExpand = false;
|
||||
}
|
||||
|
||||
if (GLExtensions::Supports("GL_EXT_shader_framebuffer_fetch"))
|
||||
@@ -378,7 +373,7 @@ bool PopulateConfig(GLContext* m_main_gl_context)
|
||||
{
|
||||
g_ogl_config.SupportedFramebufferFetch = EsFbFetchType::FbFetchNone;
|
||||
}
|
||||
g_Config.backend_info.bSupportsFramebufferFetch =
|
||||
g_backend_info.bSupportsFramebufferFetch =
|
||||
g_ogl_config.SupportedFramebufferFetch != EsFbFetchType::FbFetchNone;
|
||||
|
||||
if (m_main_gl_context->IsGLES())
|
||||
@@ -398,67 +393,67 @@ bool PopulateConfig(GLContext* m_main_gl_context)
|
||||
|
||||
// TODO: Implement support for GL_EXT_clip_cull_distance when there is an extension for
|
||||
// depth clamping.
|
||||
g_Config.backend_info.bSupportsDepthClamp = false;
|
||||
g_backend_info.bSupportsDepthClamp = false;
|
||||
|
||||
// GLES does not support logic op.
|
||||
g_Config.backend_info.bSupportsLogicOp = false;
|
||||
g_backend_info.bSupportsLogicOp = false;
|
||||
|
||||
// glReadPixels() can't be used with non-color formats. But, if we support
|
||||
// ARB_get_texture_sub_image (unlikely, except maybe on NVIDIA), we can use that instead.
|
||||
g_Config.backend_info.bSupportsDepthReadback = g_ogl_config.bSupportsTextureSubImage;
|
||||
g_backend_info.bSupportsDepthReadback = g_ogl_config.bSupportsTextureSubImage;
|
||||
|
||||
// GL_TEXTURE_LOD_BIAS is not supported on GLES.
|
||||
g_Config.backend_info.bSupportsLodBiasInSampler = false;
|
||||
g_backend_info.bSupportsLodBiasInSampler = false;
|
||||
|
||||
if (GLExtensions::Version() == 300)
|
||||
{
|
||||
g_ogl_config.eSupportedGLSLVersion = GlslEs300;
|
||||
g_ogl_config.bSupportsAEP = false;
|
||||
g_ogl_config.bSupportsTextureStorage = true;
|
||||
g_Config.backend_info.bSupportsGeometryShaders = false;
|
||||
g_backend_info.bSupportsGeometryShaders = false;
|
||||
}
|
||||
else if (GLExtensions::Version() == 310)
|
||||
{
|
||||
g_ogl_config.eSupportedGLSLVersion = GlslEs310;
|
||||
g_ogl_config.bSupportsAEP = GLExtensions::Supports("GL_ANDROID_extension_pack_es31a");
|
||||
g_Config.backend_info.bSupportsBindingLayout = true;
|
||||
g_backend_info.bSupportsBindingLayout = true;
|
||||
g_ogl_config.bSupportsImageLoadStore = true;
|
||||
g_Config.backend_info.bSupportsGeometryShaders = g_ogl_config.bSupportsAEP;
|
||||
g_Config.backend_info.bSupportsComputeShaders = true;
|
||||
g_Config.backend_info.bSupportsGSInstancing =
|
||||
g_Config.backend_info.bSupportsGeometryShaders &&
|
||||
g_backend_info.bSupportsGeometryShaders = g_ogl_config.bSupportsAEP;
|
||||
g_backend_info.bSupportsComputeShaders = true;
|
||||
g_backend_info.bSupportsGSInstancing =
|
||||
g_backend_info.bSupportsGeometryShaders &&
|
||||
g_ogl_config.SupportedESPointSize != EsPointSizeType::PointSizeNone;
|
||||
g_Config.backend_info.bSupportsSSAA = g_ogl_config.bSupportsAEP;
|
||||
g_Config.backend_info.bSupportsFragmentStoresAndAtomics = true;
|
||||
g_backend_info.bSupportsSSAA = g_ogl_config.bSupportsAEP;
|
||||
g_backend_info.bSupportsFragmentStoresAndAtomics = true;
|
||||
g_ogl_config.bSupportsMSAA = true;
|
||||
g_ogl_config.bSupportsTextureStorage = true;
|
||||
if (GLExtensions::Supports("GL_OES_texture_storage_multisample_2d_array"))
|
||||
g_ogl_config.SupportedMultisampleTexStorage = MultisampleTexStorageType::TexStorageOes;
|
||||
g_Config.backend_info.bSupportsBitfield = true;
|
||||
g_Config.backend_info.bSupportsDynamicSamplerIndexing = g_ogl_config.bSupportsAEP;
|
||||
g_backend_info.bSupportsBitfield = true;
|
||||
g_backend_info.bSupportsDynamicSamplerIndexing = g_ogl_config.bSupportsAEP;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_ogl_config.eSupportedGLSLVersion = GlslEs320;
|
||||
g_ogl_config.bSupportsAEP = GLExtensions::Supports("GL_ANDROID_extension_pack_es31a");
|
||||
g_Config.backend_info.bSupportsBindingLayout = true;
|
||||
g_backend_info.bSupportsBindingLayout = true;
|
||||
g_ogl_config.bSupportsImageLoadStore = true;
|
||||
g_Config.backend_info.bSupportsGeometryShaders = true;
|
||||
g_Config.backend_info.bSupportsComputeShaders = true;
|
||||
g_Config.backend_info.bSupportsGSInstancing =
|
||||
g_backend_info.bSupportsGeometryShaders = true;
|
||||
g_backend_info.bSupportsComputeShaders = true;
|
||||
g_backend_info.bSupportsGSInstancing =
|
||||
g_ogl_config.SupportedESPointSize != EsPointSizeType::PointSizeNone;
|
||||
g_Config.backend_info.bSupportsPaletteConversion = true;
|
||||
g_Config.backend_info.bSupportsSSAA = true;
|
||||
g_Config.backend_info.bSupportsFragmentStoresAndAtomics = true;
|
||||
g_backend_info.bSupportsPaletteConversion = true;
|
||||
g_backend_info.bSupportsSSAA = true;
|
||||
g_backend_info.bSupportsFragmentStoresAndAtomics = true;
|
||||
g_ogl_config.bSupportsCopySubImage = true;
|
||||
g_ogl_config.bSupportsGLBaseVertex = true;
|
||||
g_ogl_config.bSupportsDebug = true;
|
||||
g_ogl_config.bSupportsMSAA = true;
|
||||
g_ogl_config.bSupportsTextureStorage = true;
|
||||
g_ogl_config.SupportedMultisampleTexStorage = MultisampleTexStorageType::TexStorageCore;
|
||||
g_Config.backend_info.bSupportsBitfield = true;
|
||||
g_Config.backend_info.bSupportsDynamicSamplerIndexing = true;
|
||||
g_Config.backend_info.bSupportsSettingObjectNames = true;
|
||||
g_backend_info.bSupportsBitfield = true;
|
||||
g_backend_info.bSupportsDynamicSamplerIndexing = true;
|
||||
g_backend_info.bSupportsSettingObjectNames = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -480,7 +475,7 @@ bool PopulateConfig(GLContext* m_main_gl_context)
|
||||
g_ogl_config.bSupportsImageLoadStore = false; // layout keyword is only supported on glsl150+
|
||||
g_ogl_config.bSupportsConservativeDepth =
|
||||
false; // layout keyword is only supported on glsl150+
|
||||
g_Config.backend_info.bSupportsGeometryShaders =
|
||||
g_backend_info.bSupportsGeometryShaders =
|
||||
false; // geometry shaders are only supported on glsl150+
|
||||
}
|
||||
else if (GLExtensions::Version() == 310)
|
||||
@@ -489,7 +484,7 @@ bool PopulateConfig(GLContext* m_main_gl_context)
|
||||
g_ogl_config.bSupportsImageLoadStore = false; // layout keyword is only supported on glsl150+
|
||||
g_ogl_config.bSupportsConservativeDepth =
|
||||
false; // layout keyword is only supported on glsl150+
|
||||
g_Config.backend_info.bSupportsGeometryShaders =
|
||||
g_backend_info.bSupportsGeometryShaders =
|
||||
false; // geometry shaders are only supported on glsl150+
|
||||
}
|
||||
else if (GLExtensions::Version() == 320)
|
||||
@@ -517,18 +512,18 @@ bool PopulateConfig(GLContext* m_main_gl_context)
|
||||
g_ogl_config.SupportedMultisampleTexStorage = MultisampleTexStorageType::TexStorageCore;
|
||||
g_ogl_config.bSupportsImageLoadStore = true;
|
||||
g_ogl_config.bSupportsExplicitLayoutInShader = true;
|
||||
g_Config.backend_info.bSupportsSSAA = true;
|
||||
g_Config.backend_info.bSupportsSettingObjectNames = true;
|
||||
g_backend_info.bSupportsSSAA = true;
|
||||
g_backend_info.bSupportsSettingObjectNames = true;
|
||||
|
||||
// Compute shaders are core in GL4.3.
|
||||
g_Config.backend_info.bSupportsComputeShaders = true;
|
||||
g_backend_info.bSupportsComputeShaders = true;
|
||||
if (GLExtensions::Version() >= 450)
|
||||
g_ogl_config.bSupportsTextureSubImage = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_ogl_config.eSupportedGLSLVersion = Glsl400;
|
||||
g_Config.backend_info.bSupportsSSAA = true;
|
||||
g_backend_info.bSupportsSSAA = true;
|
||||
|
||||
if (GLExtensions::Version() == 420)
|
||||
{
|
||||
@@ -547,16 +542,16 @@ bool PopulateConfig(GLContext* m_main_gl_context)
|
||||
}
|
||||
|
||||
// Supported by all GS-supporting ES and 4.3+
|
||||
g_Config.backend_info.bSupportsGLLayerInFS = g_Config.backend_info.bSupportsGeometryShaders &&
|
||||
g_ogl_config.eSupportedGLSLVersion >= Glsl430;
|
||||
g_backend_info.bSupportsGLLayerInFS =
|
||||
g_backend_info.bSupportsGeometryShaders && g_ogl_config.eSupportedGLSLVersion >= Glsl430;
|
||||
|
||||
g_Config.backend_info.bSupportsBBox = g_Config.backend_info.bSupportsFragmentStoresAndAtomics;
|
||||
g_backend_info.bSupportsBBox = g_backend_info.bSupportsFragmentStoresAndAtomics;
|
||||
|
||||
// Either method can do early-z tests. See PixelShaderGen for details.
|
||||
g_Config.backend_info.bSupportsEarlyZ =
|
||||
g_backend_info.bSupportsEarlyZ =
|
||||
g_ogl_config.bSupportsImageLoadStore || g_ogl_config.bSupportsConservativeDepth;
|
||||
|
||||
g_Config.backend_info.AAModes.clear();
|
||||
g_backend_info.AAModes.clear();
|
||||
if (g_ogl_config.bSupportsMSAA)
|
||||
{
|
||||
bool supportsGetInternalFormat =
|
||||
@@ -628,13 +623,13 @@ bool PopulateConfig(GLContext* m_main_gl_context)
|
||||
// It also says "Only positive values are returned", but does not specify whether 1 is
|
||||
// included or not; it seems like NVIDIA and Intel GPUs do not include it.
|
||||
// We've inserted 1 at the back of both if not present to handle this.
|
||||
g_Config.backend_info.AAModes.clear();
|
||||
g_Config.backend_info.AAModes.reserve(std::min(color_aa_modes.size(), depth_aa_modes.size()));
|
||||
g_backend_info.AAModes.clear();
|
||||
g_backend_info.AAModes.reserve(std::min(color_aa_modes.size(), depth_aa_modes.size()));
|
||||
// We only want AA modes that are supported for both the color and depth textures. Probably
|
||||
// the support is the same, though. views::reverse is used to swap the order ahead of time.
|
||||
std::ranges::set_intersection(color_aa_modes | std::views::reverse,
|
||||
depth_aa_modes | std::views::reverse,
|
||||
std::back_inserter(g_Config.backend_info.AAModes));
|
||||
std::back_inserter(g_backend_info.AAModes));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -656,17 +651,17 @@ bool PopulateConfig(GLContext* m_main_gl_context)
|
||||
|
||||
while (supported_max_samples > 1)
|
||||
{
|
||||
g_Config.backend_info.AAModes.push_back(supported_max_samples);
|
||||
g_backend_info.AAModes.push_back(supported_max_samples);
|
||||
supported_max_samples /= 2;
|
||||
}
|
||||
g_Config.backend_info.AAModes.push_back(1);
|
||||
g_backend_info.AAModes.push_back(1);
|
||||
// The UI wants ascending order
|
||||
std::ranges::reverse(g_Config.backend_info.AAModes);
|
||||
std::ranges::reverse(g_backend_info.AAModes);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
g_Config.backend_info.AAModes = {1};
|
||||
g_backend_info.AAModes = {1};
|
||||
}
|
||||
|
||||
const bool bSupportsIsHelperInvocation = g_ogl_config.bIsES ?
|
||||
@@ -690,12 +685,12 @@ bool PopulateConfig(GLContext* m_main_gl_context)
|
||||
// We require texel buffers, image load store, and compute shaders to enable GPU texture decoding.
|
||||
// If the driver doesn't expose the extensions, but supports GL4.3/GLES3.1, it will still be
|
||||
// enabled in the version check below.
|
||||
g_Config.backend_info.bSupportsGPUTextureDecoding =
|
||||
g_Config.backend_info.bSupportsPaletteConversion &&
|
||||
g_Config.backend_info.bSupportsComputeShaders && g_ogl_config.bSupportsImageLoadStore;
|
||||
g_backend_info.bSupportsGPUTextureDecoding = g_backend_info.bSupportsPaletteConversion &&
|
||||
g_backend_info.bSupportsComputeShaders &&
|
||||
g_ogl_config.bSupportsImageLoadStore;
|
||||
|
||||
// Background compiling is supported only when shared contexts aren't broken.
|
||||
g_Config.backend_info.bSupportsBackgroundCompiling =
|
||||
g_backend_info.bSupportsBackgroundCompiling =
|
||||
!DriverDetails::HasBug(DriverDetails::BUG_SHARED_CONTEXT_SHADER_COMPILATION);
|
||||
|
||||
// Program binaries are supported on GL4.1+, ARB_get_program_binary, or ES3.
|
||||
@@ -706,7 +701,7 @@ bool PopulateConfig(GLContext* m_main_gl_context)
|
||||
glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &num_formats);
|
||||
supports_glsl_cache = num_formats > 0;
|
||||
}
|
||||
g_Config.backend_info.bSupportsPipelineCacheData = supports_glsl_cache;
|
||||
g_backend_info.bSupportsPipelineCacheData = supports_glsl_cache;
|
||||
|
||||
int samples;
|
||||
glGetIntegerv(GL_SAMPLES, &samples);
|
||||
@@ -746,19 +741,19 @@ bool PopulateConfig(GLContext* m_main_gl_context)
|
||||
|
||||
const std::string missing_extensions = fmt::format(
|
||||
"{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
|
||||
g_ActiveConfig.backend_info.bSupportsDualSourceBlend ? "" : "DualSourceBlend ",
|
||||
g_ActiveConfig.backend_info.bSupportsPrimitiveRestart ? "" : "PrimitiveRestart ",
|
||||
g_ActiveConfig.backend_info.bSupportsEarlyZ ? "" : "EarlyZ ",
|
||||
g_backend_info.bSupportsDualSourceBlend ? "" : "DualSourceBlend ",
|
||||
g_backend_info.bSupportsPrimitiveRestart ? "" : "PrimitiveRestart ",
|
||||
g_backend_info.bSupportsEarlyZ ? "" : "EarlyZ ",
|
||||
g_ogl_config.bSupportsGLPinnedMemory ? "" : "PinnedMemory ",
|
||||
supports_glsl_cache ? "" : "ShaderCache ",
|
||||
g_ogl_config.bSupportsGLBaseVertex ? "" : "BaseVertex ",
|
||||
g_ogl_config.bSupportsGLBufferStorage ? "" : "BufferStorage ",
|
||||
g_ogl_config.bSupportsGLSync ? "" : "Sync ", g_ogl_config.bSupportsMSAA ? "" : "MSAA ",
|
||||
g_ActiveConfig.backend_info.bSupportsSSAA ? "" : "SSAA ",
|
||||
g_ActiveConfig.backend_info.bSupportsGSInstancing ? "" : "GSInstancing ",
|
||||
g_ActiveConfig.backend_info.bSupportsClipControl ? "" : "ClipControl ",
|
||||
g_backend_info.bSupportsSSAA ? "" : "SSAA ",
|
||||
g_backend_info.bSupportsGSInstancing ? "" : "GSInstancing ",
|
||||
g_backend_info.bSupportsClipControl ? "" : "ClipControl ",
|
||||
g_ogl_config.bSupportsCopySubImage ? "" : "CopyImageSubData ",
|
||||
g_ActiveConfig.backend_info.bSupportsDepthClamp ? "" : "DepthClamp ");
|
||||
g_backend_info.bSupportsDepthClamp ? "" : "DepthClamp ");
|
||||
|
||||
if (missing_extensions.empty())
|
||||
INFO_LOG_FMT(VIDEO, "All used OGL Extensions are available.");
|
||||
|
||||
@@ -177,10 +177,10 @@ OGLGfx::OGLGfx(std::unique_ptr<GLContext> main_gl_context, float backbuffer_scal
|
||||
if (!DriverDetails::HasBug(DriverDetails::BUG_BROKEN_VSYNC))
|
||||
m_main_gl_context->SwapInterval(g_ActiveConfig.bVSyncActive);
|
||||
|
||||
if (g_ActiveConfig.backend_info.bSupportsClipControl)
|
||||
if (g_backend_info.bSupportsClipControl)
|
||||
glClipControl(GL_LOWER_LEFT, GL_ZERO_TO_ONE);
|
||||
|
||||
if (g_ActiveConfig.backend_info.bSupportsDepthClamp)
|
||||
if (g_backend_info.bSupportsDepthClamp)
|
||||
{
|
||||
glEnable(GL_CLIP_DISTANCE0);
|
||||
glEnable(GL_CLIP_DISTANCE1);
|
||||
@@ -192,7 +192,7 @@ OGLGfx::OGLGfx(std::unique_ptr<GLContext> main_gl_context, float backbuffer_scal
|
||||
glGenFramebuffers(1, &m_shared_read_framebuffer);
|
||||
glGenFramebuffers(1, &m_shared_draw_framebuffer);
|
||||
|
||||
if (g_ActiveConfig.backend_info.bSupportsPrimitiveRestart)
|
||||
if (g_backend_info.bSupportsPrimitiveRestart)
|
||||
GLUtil::EnablePrimitiveRestart(m_main_gl_context.get());
|
||||
|
||||
UpdateActiveConfig();
|
||||
@@ -487,7 +487,7 @@ void OGLGfx::CheckForSurfaceResize()
|
||||
void OGLGfx::BeginUtilityDrawing()
|
||||
{
|
||||
AbstractGfx::BeginUtilityDrawing();
|
||||
if (g_ActiveConfig.backend_info.bSupportsDepthClamp)
|
||||
if (g_backend_info.bSupportsDepthClamp)
|
||||
{
|
||||
glDisable(GL_CLIP_DISTANCE0);
|
||||
glDisable(GL_CLIP_DISTANCE1);
|
||||
@@ -497,7 +497,7 @@ void OGLGfx::BeginUtilityDrawing()
|
||||
void OGLGfx::EndUtilityDrawing()
|
||||
{
|
||||
AbstractGfx::EndUtilityDrawing();
|
||||
if (g_ActiveConfig.backend_info.bSupportsDepthClamp)
|
||||
if (g_backend_info.bSupportsDepthClamp)
|
||||
{
|
||||
glEnable(GL_CLIP_DISTANCE0);
|
||||
glEnable(GL_CLIP_DISTANCE1);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user