mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-08-25 15:46:45 +00:00
fix for static imgui
This commit is contained in:
@@ -82,7 +82,7 @@
|
||||
<IncludePath>$(SolutionDir)external\vulkan\include;$(SolutionDir)external\nvngx_dlss_sdk;$(SolutionDir)external\xess\inc\xess;$(SolutionDir)external\simpleini;$(SolutionDir)external\unordered_dense\include;$(SolutionDir)external\spdlog\include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(SolutionDir)CyberXess\cas\lib;$(SolutionDir)CyberXess\fsr2\lib;$(SolutionDir)CyberXess\fsr2_212\lib;$(SolutionDir)CyberXess\vulkan;$(SolutionDir)external\xess\lib;$(SolutionDir)CyberXess\d3dx;$(LibraryPath)</LibraryPath>
|
||||
<TargetName>nvngx</TargetName>
|
||||
<OutDir>D:\Games\Stranger of Paradise - Final Fantasy Origin\</OutDir>
|
||||
<OutDir>E:\Games\Epic\Control\</OutDir>
|
||||
<IntDir>.\x64\Debug</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
|
||||
@@ -72,7 +72,7 @@ bool XeSSFeatureDx12::Evaluate(ID3D12GraphicsCommandList* InCommandList, const N
|
||||
|
||||
GetRenderResolution(InParameters, ¶ms.inputWidth, ¶ms.inputHeight);
|
||||
|
||||
// UE5 weird color fix2
|
||||
// UE5 weird color fix2 - not helped :/
|
||||
if (Config::Instance()->NVNGX_Engine == NVSDK_NGX_ENGINE_TYPE_UNREAL && Config::Instance()->NVNGX_EngineVersion5)
|
||||
{
|
||||
params.inputWidth -= (params.inputWidth % 2);
|
||||
@@ -87,7 +87,6 @@ bool XeSSFeatureDx12::Evaluate(ID3D12GraphicsCommandList* InCommandList, const N
|
||||
if (InParameters->Get(NVSDK_NGX_Parameter_Color, ¶mColor) != NVSDK_NGX_Result_Success)
|
||||
InParameters->Get(NVSDK_NGX_Parameter_Color, (void**)¶mColor);
|
||||
|
||||
|
||||
if (paramColor)
|
||||
{
|
||||
spdlog::debug("XeSSFeatureDx12::Evaluate Color exist..");
|
||||
|
||||
@@ -11,6 +11,20 @@ void Imgui_Dx11::CreateRenderTarget(ID3D11Resource* out)
|
||||
D3D11_TEXTURE2D_DESC outDesc{};
|
||||
outTexture2D->GetDesc(&outDesc);
|
||||
|
||||
if (_renderTargetTexture != nullptr)
|
||||
{
|
||||
D3D11_TEXTURE2D_DESC rtDesc;
|
||||
_renderTargetTexture->GetDesc(&rtDesc);
|
||||
|
||||
if (outDesc.Width != rtDesc.Width || outDesc.Height != rtDesc.Height || outDesc.Format != rtDesc.Format)
|
||||
{
|
||||
_renderTargetTexture->Release();
|
||||
_renderTargetTexture = nullptr;
|
||||
}
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
if ((outDesc.BindFlags & D3D11_BIND_RENDER_TARGET) > 0)
|
||||
{
|
||||
D3D11_RENDER_TARGET_VIEW_DESC rtvDesc;
|
||||
|
||||
@@ -210,8 +210,23 @@ Imgui_Dx12::~Imgui_Dx12()
|
||||
|
||||
void Imgui_Dx12::CreateRenderTarget(const D3D12_RESOURCE_DESC& InDesc)
|
||||
{
|
||||
for (UINT i = 0; i < 2; ++i) {
|
||||
if (_renderTargetResource[0] != nullptr)
|
||||
{
|
||||
auto rtDesc = _renderTargetResource[0]->GetDesc();
|
||||
|
||||
if (InDesc.Width != rtDesc.Width || InDesc.Height != rtDesc.Height || InDesc.Format != rtDesc.Format)
|
||||
{
|
||||
_renderTargetResource[0]->Release();
|
||||
_renderTargetResource[0] = nullptr;
|
||||
_renderTargetResource[1]->Release();
|
||||
_renderTargetResource[1] = nullptr;
|
||||
}
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
for (UINT i = 0; i < 2; ++i)
|
||||
{
|
||||
D3D12_RESOURCE_DESC desc = {};
|
||||
desc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
|
||||
desc.Width = InDesc.Width;
|
||||
@@ -224,13 +239,11 @@ void Imgui_Dx12::CreateRenderTarget(const D3D12_RESOURCE_DESC& InDesc)
|
||||
desc.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
|
||||
desc.Flags = D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET;
|
||||
|
||||
|
||||
D3D12_HEAP_PROPERTIES heapProps = CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_DEFAULT);
|
||||
|
||||
ID3D12Resource* renderTarget;
|
||||
auto result = _device->CreateCommittedResource(&heapProps, D3D12_HEAP_FLAG_NONE, &desc, D3D12_RESOURCE_STATE_RENDER_TARGET, nullptr, IID_PPV_ARGS(&renderTarget));
|
||||
|
||||
|
||||
if (result == S_OK) {
|
||||
renderTarget->SetName(L"Imgui_Dx12_renderTarget");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user