Option cleanup (WIP)

cpu: Make it clear this does nothing since there's no backends other than x64.
native_2x_msaa: Disabling this only makes performance worse, and idiots think this disables anti-aliasing for some reason.
This commit is contained in:
Margen67 2024-03-12 22:54:40 -07:00
parent b9061e6292
commit af4dabe8b4
4 changed files with 49 additions and 2 deletions

View File

@ -9,7 +9,7 @@
#include "xenia/cpu/cpu_flags.h" #include "xenia/cpu/cpu_flags.h"
DEFINE_string(cpu, "any", "CPU backend [any, x64].", "CPU"); DEFINE_string(cpu, "any", "Does nothing. CPU backend [any, x64].", "CPU");
DEFINE_string( DEFINE_string(
load_module_map, "", load_module_map, "",
@ -31,6 +31,7 @@ DEFINE_bool(trace_function_data, false,
"Generate tracing for function result data.", "CPU"); "Generate tracing for function result data.", "CPU");
DEFINE_bool(validate_hir, false, DEFINE_bool(validate_hir, false,
"Only does anything on debug builds. "
"Perform validation checks on the HIR during compilation.", "CPU"); "Perform validation checks on the HIR during compilation.", "CPU");
DEFINE_uint64( DEFINE_uint64(

View File

@ -45,7 +45,12 @@ PPCTranslator::PPCTranslator(PPCFrontend* frontend) : frontend_(frontend) {
assembler_ = backend->CreateAssembler(); assembler_ = backend->CreateAssembler();
assembler_->Initialize(); assembler_->Initialize();
bool validate = cvars::validate_hir; bool validate =
#ifdef DEBUG
cvars::validate_hir;
#else
0;
#endif
// Merge blocks early. This will let us use more context in other passes. // Merge blocks early. This will let us use more context in other passes.
// The CFG is required for simplification and dirtied by it. // The CFG is required for simplification and dirtied by it.

View File

@ -447,7 +447,9 @@ bool D3D12RenderTargetCache::Initialize() {
// Using the cvar on emulator initialization so used pipelines are consistent // Using the cvar on emulator initialization so used pipelines are consistent
// across different titles launched in one emulator instance. // across different titles launched in one emulator instance.
use_stencil_reference_output_ = use_stencil_reference_output_ =
#ifdef DEBUG
cvars::native_stencil_value_output && cvars::native_stencil_value_output &&
#endif
provider.IsPSSpecifiedStencilReferenceSupported() && provider.IsPSSpecifiedStencilReferenceSupported() &&
(cvars::native_stencil_value_output_d3d12_intel || (cvars::native_stencil_value_output_d3d12_intel ||
provider.GetAdapterVendorID() != provider.GetAdapterVendorID() !=
@ -464,6 +466,7 @@ bool D3D12RenderTargetCache::Initialize() {
// Check if 2x MSAA is supported or needs to be emulated with 4x MSAA // Check if 2x MSAA is supported or needs to be emulated with 4x MSAA
// instead. // instead.
#ifdef DEBUG
if (cvars::native_2x_msaa) { if (cvars::native_2x_msaa) {
msaa_2x_supported_ = true; msaa_2x_supported_ = true;
static const DXGI_FORMAT kRenderTargetDXGIFormats[] = { static const DXGI_FORMAT kRenderTargetDXGIFormats[] = {
@ -502,6 +505,42 @@ bool D3D12RenderTargetCache::Initialize() {
} else { } else {
msaa_2x_supported_ = false; msaa_2x_supported_ = false;
} }
#else // DEBUG
msaa_2x_supported_ = true;
static const DXGI_FORMAT kRenderTargetDXGIFormats[] = {
DXGI_FORMAT_R16G16B16A16_FLOAT,
DXGI_FORMAT_R16G16B16A16_SNORM,
DXGI_FORMAT_R32G32_FLOAT,
DXGI_FORMAT_D32_FLOAT_S8X24_UINT,
DXGI_FORMAT_R10G10B10A2_UNORM,
DXGI_FORMAT_R8G8B8A8_UNORM,
DXGI_FORMAT_R16G16_FLOAT,
DXGI_FORMAT_R16G16_SNORM,
DXGI_FORMAT_R32_FLOAT,
DXGI_FORMAT_D24_UNORM_S8_UINT,
// For ownership transfer.
DXGI_FORMAT_R16G16B16A16_UINT,
DXGI_FORMAT_R32G32_UINT,
DXGI_FORMAT_R16G16_UINT,
DXGI_FORMAT_R32_UINT,
};
D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS multisample_quality_levels;
multisample_quality_levels.SampleCount = 2;
multisample_quality_levels.Flags =
D3D12_MULTISAMPLE_QUALITY_LEVELS_FLAG_NONE;
for (size_t i = 0; i < xe::countof(kRenderTargetDXGIFormats); ++i) {
multisample_quality_levels.Format = kRenderTargetDXGIFormats[i];
multisample_quality_levels.NumQualityLevels = 0;
if (FAILED(device->CheckFeatureSupport(
D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS,
&multisample_quality_levels,
sizeof(multisample_quality_levels))) ||
!multisample_quality_levels.NumQualityLevels) {
msaa_2x_supported_ = false;
break;
}
}
#endif // DEBUG
if (!msaa_2x_supported_) { if (!msaa_2x_supported_) {
XELOGW( XELOGW(
"2x MSAA is not supported, emulated via top-left and bottom-right " "2x MSAA is not supported, emulated via top-left and bottom-right "

View File

@ -172,6 +172,7 @@ DEFINE_bool(
"GPU"); "GPU");
DEFINE_bool( DEFINE_bool(
native_2x_msaa, true, native_2x_msaa, true,
"Only does anything in debug builds."
"Use host 2x MSAA when available. Can be disabled for scalability testing " "Use host 2x MSAA when available. Can be disabled for scalability testing "
"on host GPU APIs where 2x is not mandatory, in this case, 2 samples of 4x " "on host GPU APIs where 2x is not mandatory, in this case, 2 samples of 4x "
"MSAA will be used instead (with similar or worse quality and higher " "MSAA will be used instead (with similar or worse quality and higher "
@ -179,6 +180,7 @@ DEFINE_bool(
"GPU"); "GPU");
DEFINE_bool( DEFINE_bool(
native_stencil_value_output, true, native_stencil_value_output, true,
"Only does anything in debug builds."
"Use pixel shader stencil reference output where available for purposes " "Use pixel shader stencil reference output where available for purposes "
"like copying between render targets. Can be disabled for scalability " "like copying between render targets. Can be disabled for scalability "
"testing, in this case, much more expensive drawing of 8 quads will be " "testing, in this case, much more expensive drawing of 8 quads will be "