Skip to content

Commit e86e2a2

Browse files
committed
Preliminary HDR patch
Meaningful changes picked from doodlum#1019 Get rid of tonemapping code and settings I plan on letting DXVK or the compositor to handle proper PQ Set DXGI buffer types based on HDR option Move HDR state from ShaderCache to State Fix menu Fix warning Add more debugging info More fixes Fix fix style: 🎨 apply clang-format changes Try with 10bit backbuffers Fix Some format changes Attempt to apply PQ only once style: 🎨 apply clang-format changes Revert format change for upgrades Try again Not being ran Fix style: 🎨 apply clang-format changes Fix upscaling Some more fixes Try without frame generation
1 parent f9dcd69 commit e86e2a2

File tree

12 files changed

+334
-13
lines changed

12 files changed

+334
-13
lines changed

src/DX12SwapChain.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ WrappedResource::WrappedResource(D3D11_TEXTURE2D_DESC a_texDesc, ID3D11Device5*
187187
flags |= D3D12_RESOURCE_FLAG_DENY_SHADER_RESOURCE;
188188
if (!(a_texDesc.BindFlags & D3D11_BIND_RENDER_TARGET))
189189
flags |= D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET;
190-
D3D12_RESOURCE_DESC desc12{ D3D12_RESOURCE_DIMENSION_TEXTURE2D, 0, a_texDesc.Width, a_texDesc.Height, (UINT16)a_texDesc.ArraySize, (UINT16)a_texDesc.MipLevels, a_texDesc.Format, { a_texDesc.SampleDesc.Count, a_texDesc.SampleDesc.Quality }, D3D12_TEXTURE_LAYOUT_UNKNOWN, flags };
190+
D3D12_RESOURCE_DESC desc12{ D3D12_RESOURCE_DIMENSION_TEXTURE2D, 0, a_texDesc.Width, a_texDesc.Height, (UINT16)a_texDesc.ArraySize,
191+
(UINT16)a_texDesc.MipLevels, a_texDesc.Format, { a_texDesc.SampleDesc.Count, a_texDesc.SampleDesc.Quality }, D3D12_TEXTURE_LAYOUT_UNKNOWN, flags };
191192
D3D12_HEAP_PROPERTIES heapProp = { D3D12_HEAP_TYPE_DEFAULT, D3D12_CPU_PAGE_PROPERTY_UNKNOWN, D3D12_MEMORY_POOL_UNKNOWN, 1, 1 };
192193

193194
DX::ThrowIfFailed(a_d3d12Device->CreateCommittedResource(&heapProp, D3D12_HEAP_FLAG_SHARED, &desc12, D3D12_RESOURCE_STATE_COMMON, nullptr, IID_PPV_ARGS(&resource)));

src/Deferred.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ void Deferred::SetupResources()
9595
// TEMPORAL_AA_WATER_2
9696

9797
// Albedo
98-
SetupRenderTarget(ALBEDO, texDesc, srvDesc, rtvDesc, uavDesc, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE);
98+
SetupRenderTarget(ALBEDO, texDesc, srvDesc, rtvDesc, uavDesc, globals::state->UpgradeDxgiFormat(DXGI_FORMAT_R8G8B8A8_UNORM), D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE);
9999
// Specular
100-
SetupRenderTarget(SPECULAR, texDesc, srvDesc, rtvDesc, uavDesc, DXGI_FORMAT_R11G11B10_FLOAT, D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE);
100+
SetupRenderTarget(SPECULAR, texDesc, srvDesc, rtvDesc, uavDesc, globals::state->UpgradeDxgiFormat(DXGI_FORMAT_R11G11B10_FLOAT), D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE);
101101
// Reflectance
102-
SetupRenderTarget(REFLECTANCE, texDesc, srvDesc, rtvDesc, uavDesc, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE);
102+
SetupRenderTarget(REFLECTANCE, texDesc, srvDesc, rtvDesc, uavDesc, globals::state->UpgradeDxgiFormat(DXGI_FORMAT_R8G8B8A8_UNORM), D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE);
103103
// Normal + Roughness
104-
SetupRenderTarget(NORMALROUGHNESS, texDesc, srvDesc, rtvDesc, uavDesc, DXGI_FORMAT_R10G10B10A2_UNORM, D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE);
104+
SetupRenderTarget(NORMALROUGHNESS, texDesc, srvDesc, rtvDesc, uavDesc, globals::state->UpgradeDxgiFormat(DXGI_FORMAT_R10G10B10A2_UNORM), D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE);
105105
// Masks
106-
SetupRenderTarget(MASKS, texDesc, srvDesc, rtvDesc, uavDesc, DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE);
106+
SetupRenderTarget(MASKS, texDesc, srvDesc, rtvDesc, uavDesc, globals::state->UpgradeDxgiFormat(DXGI_FORMAT_R8G8B8A8_UNORM), D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE);
107107
}
108108

109109
{

src/Features/DynamicCubemaps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void DynamicCubemaps::DrawSettings()
5252
auto context = globals::d3d::context;
5353

5454
D3D11_TEXTURE2D_DESC texDesc{};
55-
texDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
55+
texDesc.Format = globals::state->UpgradeDxgiFormat(DXGI_FORMAT_R8G8B8A8_UNORM);
5656
texDesc.Height = 1;
5757
texDesc.Width = 1;
5858
texDesc.ArraySize = 6;

src/FidelityFX.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,12 @@ void FidelityFX::CreateFSRResources()
178178
contextDescription.flags = FFX_FSR3_ENABLE_UPSCALING_ONLY | FFX_FSR3_ENABLE_AUTO_EXPOSURE;
179179
contextDescription.backBufferFormat = FFX_SURFACE_FORMAT_R8G8B8A8_UNORM;
180180

181+
if (globals::state->IsHdrRendering()) {
182+
logger::info("[FidelityFX] Enabling HDR rendering");
183+
contextDescription.flags |= FFX_FSR3_ENABLE_HIGH_DYNAMIC_RANGE;
184+
contextDescription.backBufferFormat = FFX_SURFACE_FORMAT_R10G10B10A2_UNORM;
185+
}
186+
181187
contextDescription.backendInterfaceUpscaling = fsrInterface;
182188

183189
if (ffxFsr3ContextCreate(&fsrContext, &contextDescription) != FFX_OK)

src/Hooks.cpp

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,13 @@ HRESULT WINAPI hk_D3D11CreateDeviceAndSwapChain(
360360
if (streamline->featureDLSSG) {
361361
logger::info("[Frame Generation] Using D3D12 proxy via Streamline");
362362

363+
if (globals::state->IsHdrRendering()) {
364+
logger::info("[Streamline] Enabling 10bit swapchain");
365+
pSwapChainDesc->BufferDesc.Format = DXGI_FORMAT_R10G10B10A2_UNORM;
366+
logger::info("[Streamline] Enabling BT.2020 ST2084 (PQ) HDR colorspace");
367+
pSwapChainDesc->BufferDesc.ColorSpace = DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020;
368+
}
369+
363370
auto ret = streamline->slD3D11CreateDeviceAndSwapChain(pAdapter,
364371
DriverType,
365372
Software,
@@ -434,6 +441,13 @@ HRESULT WINAPI hk_D3D11CreateDeviceAndSwapChain(
434441
}
435442
}
436443

444+
if (globals::state->IsHdrRendering()) {
445+
logger::info("[Hooks] Enabling 10bit swapchain");
446+
pSwapChainDesc->BufferDesc.Format = DXGI_FORMAT_R10G10B10A2_UNORM;
447+
logger::info("[Hooks] Enabling HDR colorspace");
448+
pSwapChainDesc->BufferDesc.ColorSpace = DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020;
449+
}
450+
437451
auto ret = ptrD3D11CreateDeviceAndSwapChain(pAdapter,
438452
DriverType,
439453
Software,
@@ -447,7 +461,63 @@ HRESULT WINAPI hk_D3D11CreateDeviceAndSwapChain(
447461
pFeatureLevel,
448462
ppImmediateContext);
449463

464+
if (globals::state->IsHdrRendering()) {
465+
logger::info("[Hooks] Setting HDR metadata");
466+
IDXGISwapChain4* swapChain4 = nullptr;
467+
IDXGIOutput* output = nullptr;
468+
IDXGIOutput6* output6 = nullptr;
469+
DXGI_OUTPUT_DESC1 displayDesc = {};
470+
DXGI_HDR_METADATA_HDR10 metadata = {};
471+
472+
if (SUCCEEDED((*ppSwapChain)->QueryInterface(__uuidof(IDXGISwapChain4), (void**)&swapChain4))) {
473+
swapChain4->GetContainingOutput(&output);
474+
output->QueryInterface(IID_PPV_ARGS(&output6));
475+
output6->GetDesc1(&displayDesc);
476+
477+
// Log color primaries
478+
logger::info("Display Color Primaries:");
479+
logger::info("Red Primary: ({:.4f}, {:.4f})", displayDesc.RedPrimary[0], displayDesc.RedPrimary[1]);
480+
logger::info("Green Primary: ({:.4f}, {:.4f})", displayDesc.GreenPrimary[0], displayDesc.GreenPrimary[1]);
481+
logger::info("Blue Primary: ({:.4f}, {:.4f})", displayDesc.BluePrimary[0], displayDesc.BluePrimary[1]);
482+
logger::info("White Point: ({:.4f}, {:.4f})", displayDesc.WhitePoint[0], displayDesc.WhitePoint[1]);
483+
484+
// Log luminance values
485+
logger::info("Display Luminance Range:");
486+
logger::info("Min Luminance: {:.2f} nits", displayDesc.MinLuminance);
487+
logger::info("Max Luminance: {:.2f} nits", displayDesc.MaxLuminance);
488+
logger::info("MaxFullFrameLuminance: {:.2f} nits", displayDesc.MaxFullFrameLuminance);
489+
490+
// Convert display primaries (display values are 0-1, metadata needs them scaled by 50000)
491+
metadata.RedPrimary[0] = static_cast<UINT16>(displayDesc.RedPrimary[0] * 50000);
492+
metadata.RedPrimary[1] = static_cast<UINT16>(displayDesc.RedPrimary[1] * 50000);
493+
494+
metadata.GreenPrimary[0] = static_cast<UINT16>(displayDesc.GreenPrimary[0] * 50000);
495+
metadata.GreenPrimary[1] = static_cast<UINT16>(displayDesc.GreenPrimary[1] * 50000);
496+
497+
metadata.BluePrimary[0] = static_cast<UINT16>(displayDesc.BluePrimary[0] * 50000);
498+
metadata.BluePrimary[1] = static_cast<UINT16>(displayDesc.BluePrimary[1] * 50000);
499+
500+
metadata.WhitePoint[0] = static_cast<UINT16>(displayDesc.WhitePoint[0] * 50000);
501+
metadata.WhitePoint[1] = static_cast<UINT16>(displayDesc.WhitePoint[1] * 50000);
502+
503+
metadata.MaxMasteringLuminance = 1000; // Pulled out of my ass, 10 times the SDR, whole nits
504+
metadata.MinMasteringLuminance = 1000; // 0.1 nits = 1000 * 0.0001, black is black, 1/10000th of a nit
505+
506+
// Set content light levels (these are in actual nits)
507+
metadata.MaxContentLightLevel = static_cast<UINT16>(displayDesc.MaxLuminance);
508+
metadata.MaxFrameAverageLightLevel = static_cast<UINT16>(displayDesc.MaxFullFrameLuminance);
509+
510+
swapChain4->SetColorSpace1(DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020);
511+
swapChain4->SetHDRMetaData(DXGI_HDR_METADATA_TYPE_HDR10, sizeof(metadata), &metadata);
512+
513+
output6->Release();
514+
output->Release();
515+
swapChain4->Release();
516+
}
517+
}
518+
450519
if (streamline->initialized) {
520+
logger::info("[Hooks] Setting Streamline D3D device");
451521
streamline->slSetD3DDevice(*ppDevice);
452522
streamline->PostDevice();
453523
}
@@ -563,12 +633,99 @@ namespace Hooks
563633
{
564634
static void thunk(RE::BSGraphics::Renderer* This, RE::RENDER_TARGETS::RENDER_TARGET a_target, RE::BSGraphics::RenderTargetProperties* a_properties)
565635
{
636+
if (globals::state->IsHdrRendering()) {
637+
a_properties->format = RE::BSGraphics::Format::kR16G16B16A16_FLOAT;
638+
}
566639
globals::state->ModifyRenderTarget(a_target, a_properties);
567640
func(This, a_target, a_properties);
568641
}
569642
static inline REL::Relocation<decltype(thunk)> func;
570643
};
571644

645+
struct CreateRenderTarget_ImagespaceTempCopy
646+
{
647+
static void thunk(RE::BSGraphics::Renderer* This, RE::RENDER_TARGETS::RENDER_TARGET a_target, RE::BSGraphics::RenderTargetProperties* a_properties)
648+
{
649+
if (globals::state->IsHdrRendering()) {
650+
a_properties->format = RE::BSGraphics::Format::kR16G16B16A16_FLOAT;
651+
}
652+
globals::state->ModifyRenderTarget(a_target, a_properties);
653+
func(This, a_target, a_properties);
654+
}
655+
656+
static inline REL::Relocation<decltype(thunk)> func;
657+
};
658+
659+
struct CreateRenderTarget_ImagespaceTempCopy2
660+
{
661+
static void thunk(RE::BSGraphics::Renderer* This, RE::RENDER_TARGETS::RENDER_TARGET a_target, RE::BSGraphics::RenderTargetProperties* a_properties)
662+
{
663+
if (globals::state->IsHdrRendering()) {
664+
a_properties->format = RE::BSGraphics::Format::kR16G16B16A16_FLOAT;
665+
}
666+
globals::state->ModifyRenderTarget(a_target, a_properties);
667+
func(This, a_target, a_properties);
668+
}
669+
670+
static inline REL::Relocation<decltype(thunk)> func;
671+
};
672+
673+
struct CreateRenderTarget_LDRBlurSwap
674+
{
675+
static void thunk(RE::BSGraphics::Renderer* This, RE::RENDER_TARGETS::RENDER_TARGET a_target, RE::BSGraphics::RenderTargetProperties* a_properties)
676+
{
677+
if (globals::state->IsHdrRendering()) {
678+
a_properties->format = RE::BSGraphics::Format::kR16G16B16A16_FLOAT;
679+
}
680+
globals::state->ModifyRenderTarget(a_target, a_properties);
681+
func(This, a_target, a_properties);
682+
}
683+
684+
static inline REL::Relocation<decltype(thunk)> func;
685+
};
686+
687+
struct CreateRenderTarget_LDRDownsample
688+
{
689+
static void thunk(RE::BSGraphics::Renderer* This, RE::RENDER_TARGETS::RENDER_TARGET a_target, RE::BSGraphics::RenderTargetProperties* a_properties)
690+
{
691+
if (globals::state->IsHdrRendering()) {
692+
a_properties->format = RE::BSGraphics::Format::kR16G16B16A16_FLOAT;
693+
}
694+
globals::state->ModifyRenderTarget(a_target, a_properties);
695+
func(This, a_target, a_properties);
696+
}
697+
698+
static inline REL::Relocation<decltype(thunk)> func;
699+
};
700+
701+
struct CreateRenderTarget_TemporalAAAccumulation0
702+
{
703+
static void thunk(RE::BSGraphics::Renderer* This, RE::RENDER_TARGETS::RENDER_TARGET a_target, RE::BSGraphics::RenderTargetProperties* a_properties)
704+
{
705+
if (globals::state->IsHdrRendering()) {
706+
a_properties->format = RE::BSGraphics::Format::kR16G16B16A16_FLOAT;
707+
}
708+
globals::state->ModifyRenderTarget(a_target, a_properties);
709+
func(This, a_target, a_properties);
710+
}
711+
712+
static inline REL::Relocation<decltype(thunk)> func;
713+
};
714+
715+
struct CreateRenderTarget_TemporalAAAccumulation1
716+
{
717+
static void thunk(RE::BSGraphics::Renderer* This, RE::RENDER_TARGETS::RENDER_TARGET a_target, RE::BSGraphics::RenderTargetProperties* a_properties)
718+
{
719+
if (globals::state->IsHdrRendering()) {
720+
a_properties->format = RE::BSGraphics::Format::kR16G16B16A16_FLOAT;
721+
}
722+
globals::state->ModifyRenderTarget(a_target, a_properties);
723+
func(This, a_target, a_properties);
724+
}
725+
726+
static inline REL::Relocation<decltype(thunk)> func;
727+
};
728+
572729
struct CreateRenderTarget_Normals
573730
{
574731
static void thunk(RE::BSGraphics::Renderer* This, RE::RENDER_TARGETS::RENDER_TARGET a_target, RE::BSGraphics::RenderTargetProperties* a_properties)
@@ -958,6 +1115,12 @@ namespace Hooks
9581115

9591116
logger::info("Hooking BSShaderRenderTargets::Create::CreateRenderTarget(s)");
9601117
stl::write_thunk_call<CreateRenderTarget_Main>(REL::RelocationID(100458, 107175).address() + REL::Relocate(0x3F0, 0x3F3, 0x548));
1118+
stl::write_thunk_call<CreateRenderTarget_ImagespaceTempCopy>(REL::RelocationID(100458, 107175).address() + REL::Relocate(0x62F, 0x62E));
1119+
stl::write_thunk_call<CreateRenderTarget_ImagespaceTempCopy2>(REL::RelocationID(100458, 107175).address() + REL::Relocate(0x642, 0x641));
1120+
stl::write_thunk_call<CreateRenderTarget_LDRBlurSwap>(REL::RelocationID(100458, 107175).address() + REL::Relocate(0x529, 0x528));
1121+
stl::write_thunk_call<CreateRenderTarget_LDRDownsample>(REL::RelocationID(100458, 107175).address() + REL::Relocate(0xB2E, 0xB2E));
1122+
stl::write_thunk_call<CreateRenderTarget_TemporalAAAccumulation0>(REL::RelocationID(100458, 107175).address() + REL::Relocate(0xE68, 0xE6A));
1123+
stl::write_thunk_call<CreateRenderTarget_TemporalAAAccumulation1>(REL::RelocationID(100458, 107175).address() + REL::Relocate(0xE7E, 0xE80));
9611124
stl::write_thunk_call<CreateRenderTarget_Normals>(REL::RelocationID(100458, 107175).address() + REL::Relocate(0x458, 0x45B, 0x5B0));
9621125
stl::write_thunk_call<CreateRenderTarget_NormalsSwap>(REL::RelocationID(100458, 107175).address() + REL::Relocate(0x46B, 0x46E, 0x5C3));
9631126
stl::write_thunk_call<CreateRenderTarget_Snow>(REL::RelocationID(100458, 107175).address() + REL::Relocate(0x406, 0x409, 0x55e));

src/Menu.cpp

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,8 +598,116 @@ void Menu::DrawGeneralSettings()
598598
ImGui::Text("Skips a shader being replaced if it hasn't been compiled yet. Also makes compilation blazingly fast!");
599599
}
600600

601+
bool useHdrRendering = globals::state->IsHdrRendering();
602+
ImGui::TableNextColumn();
603+
if (ImGui::Checkbox("Enable HDR", &useHdrRendering)) {
604+
globals::state->SetHdrRendering(useHdrRendering);
605+
}
606+
if (auto _tt = Util::HoverTooltipWrapper()) {
607+
ImGui::Text("Vittu meni ikuisuus koodata -tssge");
608+
}
609+
601610
ImGui::EndTable();
602611
}
612+
613+
ImGui::Spacing();
614+
615+
// Get buffer description
616+
DXGI_SWAP_CHAIN_DESC swapChainDesc;
617+
globals::d3d::swapChain->GetDesc(&swapChainDesc);
618+
619+
ImGui::Text("Buffer format: %s",
620+
swapChainDesc.BufferDesc.Format == DXGI_FORMAT_R8G8B8A8_UNORM ? "RGBA8_UNORM" :
621+
swapChainDesc.BufferDesc.Format == DXGI_FORMAT_R10G10B10A2_UNORM ? "RGB10A2_UNORM" :
622+
swapChainDesc.BufferDesc.Format == DXGI_FORMAT_R16G16B16A16_FLOAT ? "RGBA16_FLOAT" :
623+
"Other");
624+
ImGui::Text("Buffer size: %dx%d",
625+
swapChainDesc.BufferDesc.Width,
626+
swapChainDesc.BufferDesc.Height);
627+
ImGui::Text("Buffer count: %d", swapChainDesc.BufferCount);
628+
ImGui::Text("Refresh rate: %d/%d Hz",
629+
swapChainDesc.BufferDesc.RefreshRate.Numerator,
630+
swapChainDesc.BufferDesc.RefreshRate.Denominator);
631+
632+
// Check VRR
633+
BOOL allowTearing = FALSE;
634+
if (IDXGIFactory5* factory = nullptr; SUCCEEDED(CreateDXGIFactory2(0, IID_PPV_ARGS(&factory)))) {
635+
factory->CheckFeatureSupport(DXGI_FEATURE_PRESENT_ALLOW_TEARING, &allowTearing, sizeof(allowTearing));
636+
factory->Release();
637+
}
638+
ImGui::Text("VRR Support: %s", allowTearing ? "Yes" : "No");
639+
640+
// Get HDR metadata and display capabilities
641+
if (IDXGISwapChain4* swapChain4 = nullptr;
642+
SUCCEEDED(globals::d3d::swapChain->QueryInterface(__uuidof(IDXGISwapChain4), (void**)&swapChain4))) {
643+
ImGui::Spacing();
644+
645+
// Get display capabilities
646+
IDXGIOutput* output = nullptr;
647+
if (SUCCEEDED(globals::d3d::swapChain->GetContainingOutput(&output))) {
648+
IDXGIOutput6* output6 = nullptr;
649+
if (SUCCEEDED(output->QueryInterface(IID_PPV_ARGS(&output6)))) {
650+
DXGI_OUTPUT_DESC1 desc1;
651+
if (SUCCEEDED(output6->GetDesc1(&desc1))) {
652+
ImGui::Spacing();
653+
ImGui::Text("Display Capabilities:");
654+
ImGui::Text("HDR Support: %s", desc1.ColorSpace == DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 ? "Yes" : "No");
655+
ImGui::Text("Display Max Luminance: %.2f nits", desc1.MaxLuminance);
656+
ImGui::Text("Display Min Luminance: %.2f nits", desc1.MinLuminance);
657+
ImGui::Text("Max Full Frame Luminance: %.2f nits", desc1.MaxFullFrameLuminance);
658+
659+
const char* bpcStr = "Unknown";
660+
switch (desc1.BitsPerColor) {
661+
case 8:
662+
bpcStr = "8-bit";
663+
break;
664+
case 10:
665+
bpcStr = "10-bit";
666+
break;
667+
case 12:
668+
bpcStr = "12-bit";
669+
break;
670+
case 16:
671+
bpcStr = "16-bit";
672+
break;
673+
}
674+
ImGui::Text("Bits Per Channel: %s", bpcStr);
675+
}
676+
output6->Release();
677+
}
678+
output->Release();
679+
}
680+
681+
swapChain4->Release();
682+
}
683+
684+
// D3D12 Proxy Section
685+
ImGui::Spacing();
686+
ImGui::Text("D3D12 Proxy Swapchain Info:");
687+
688+
if (DX12SwapChain* dx12 = DX12SwapChain::GetSingleton()) {
689+
if (dx12->swapChain) {
690+
DXGI_SWAP_CHAIN_DESC1 desc12 = dx12->swapChainDesc; // Using the stored desc
691+
692+
ImGui::Text("Buffer format: %s",
693+
desc12.Format == DXGI_FORMAT_R8G8B8A8_UNORM ? "RGBA8_UNORM" :
694+
desc12.Format == DXGI_FORMAT_R10G10B10A2_UNORM ? "RGB10A2_UNORM" :
695+
desc12.Format == DXGI_FORMAT_R16G16B16A16_FLOAT ? "RGBA16_FLOAT" :
696+
"Other");
697+
ImGui::Text("Buffer size: %dx%d", desc12.Width, desc12.Height);
698+
ImGui::Text("Buffer count: %d", desc12.BufferCount);
699+
700+
// Add refresh rate info if available
701+
if (dx12->refreshRate > 0) {
702+
ImGui::Text("Refresh Rate: %.2f Hz", dx12->refreshRate);
703+
}
704+
705+
} else {
706+
ImGui::TextColored(ImVec4(1.0f, 0.4f, 0.4f, 1.0f), "DX12 swapchain not initialized");
707+
}
708+
} else {
709+
ImGui::TextColored(ImVec4(1.0f, 0.4f, 0.4f, 1.0f), "DX12 proxy not available");
710+
}
603711
}
604712

605713
if (ImGui::CollapsingHeader("Keybindings", ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick)) {

src/Menu.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#pragma once
22

3+
#include <d3d11.h> // For D3D11 types
34
#include <dxgi1_4.h>
5+
#include <dxgi1_6.h> // For advanced DXGI features
46

57
using namespace std::chrono;
68
#define BUFFER_VIEWER_NODE(a_value, a_scale) \

src/ShaderCache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,6 @@ namespace SIE
322322
void SetAsync(bool value);
323323
bool IsDump() const;
324324
void SetDump(bool value);
325-
326325
bool IsDiskCache() const;
327326
void SetDiskCache(bool value);
328327
void DeleteDiskCache();
@@ -660,6 +659,7 @@ namespace SIE
660659
bool isEnabled = true;
661660
bool isDiskCache = true;
662661
bool isAsync = true;
662+
bool isHdrRendering = true;
663663
bool isDump = false;
664664
bool hideError = false;
665665
bool useFileWatcher = false;

0 commit comments

Comments
 (0)