casting fixes

This commit is contained in:
cdozdil
2024-06-05 21:57:23 +03:00
parent b9a7d70a78
commit 62559f7366
6 changed files with 25 additions and 19 deletions
+7 -2
View File
@@ -167,7 +167,10 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_Init_Ext(unsigned long long InApp
spdlog::info("NVSDK_NGX_D3D12_Init_Ext AppId: {0}", InApplicationId);
spdlog::info("NVSDK_NGX_D3D12_Init_Ext SDK: {0:x}", (unsigned int)InSDKVersion);
appDataPath = InApplicationDataPath;
std::string str(appDataPath.begin(), appDataPath.end());
std::string str(appDataPath.length(), 0);
std::transform(appDataPath.begin(), appDataPath.end(), str.begin(), [](wchar_t c) { return (char)c; });
spdlog::info("NVSDK_NGX_D3D12_Init_Ext InApplicationDataPath {0}", str);
Config::Instance()->NVNGX_FeatureInfo_Paths.clear();
@@ -181,7 +184,9 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_Init_Ext(unsigned long long InApp
Config::Instance()->NVNGX_FeatureInfo_Paths.push_back(std::wstring(path));
std::wstring iniPathW(path);
std::string iniPath(iniPathW.begin(), iniPathW.end());
std::string iniPath(iniPathW.length(), 0);
std::transform(iniPathW.begin(), iniPathW.end(), iniPath.begin(), [](wchar_t c) { return (char)c; });
spdlog::debug("NVSDK_NGX_D3D12_Init_Ext PathListInfo[{1}] checking nvngx.ini file in: {0}", iniPath, i);
+3 -2
View File
@@ -27,10 +27,11 @@ inline static std::string ResultToString(FfxErrorCode result)
}
}
inline void FfxLogCallback(FfxFsr2MsgType type, const wchar_t* message)
inline static void FfxLogCallback(FfxFsr2MsgType type, const wchar_t* message)
{
std::wstring string(message);
std::string str(string.begin(), string.end());
std::string str(string.length(), 0);
std::transform(string.begin(), string.end(), str.begin(), [](wchar_t c) { return (char)c; });
//if (type == FFX_FSR2_MESSAGE_TYPE_ERROR)
// spdlog::error("FSR2Feature::LogCallback FSR Runtime: {0}", str);
+6 -6
View File
@@ -174,10 +174,10 @@ bool BS_Dx12::Dispatch(ID3D12Device* InDevice, ID3D12GraphicsCommandList* InCmdL
InDevice->CreateUnorderedAccessView(OutResource, nullptr, &uavDesc, _cpuUavHandle[_counter]);
// Create CBV for Constants
Constants constants;
constants.srcWidth = inDesc.Width;
Constants constants{};
constants.srcWidth = static_cast<uint32_t>(inDesc.Width);
constants.srcHeight = inDesc.Height;
constants.destWidth = outDesc.Width;
constants.destWidth = static_cast<uint32_t>(outDesc.Width);
constants.destHeight = outDesc.Height;
// Copy the updated constant buffer data to the constant buffer resource
@@ -208,12 +208,12 @@ bool BS_Dx12::Dispatch(ID3D12Device* InDevice, ID3D12GraphicsCommandList* InCmdL
if (_upsample)
{
dispatchWidth = (outDesc.Width + InNumThreadsX - 1) / InNumThreadsX;
dispatchWidth = static_cast<UINT>((outDesc.Width + InNumThreadsX - 1) / InNumThreadsX);
dispatchHeight = (outDesc.Height + InNumThreadsY - 1) / InNumThreadsY;
}
else
{
dispatchWidth = (inDesc.Width + InNumThreadsX - 1) / InNumThreadsX;
dispatchWidth = static_cast<UINT>((inDesc.Width + InNumThreadsX - 1) / InNumThreadsX);
dispatchHeight = (inDesc.Height + InNumThreadsY - 1) / InNumThreadsY;
}
@@ -335,7 +335,7 @@ BS_Dx12::BS_Dx12(std::string InName, ID3D12Device* InDevice, bool InUpsample) :
// Compile shader blobs
ID3DBlob* _recEncodeShader = CompileShader(_upsample ? upsampleCode.c_str() : downsampleCode.c_str(), "CSMain", "cs_5_0");
if (_recEncodeShader == nullptr)
{
spdlog::error("CS_Dx12::CS_Dx12 [{0}] CompileShader error!", _name);
+6 -6
View File
@@ -425,7 +425,7 @@ private:
{
if (ImGui_ImplWin32_WndProcHandler(hWnd, msg, wParam, lParam))
{
spdlog::trace("WndProc ImGui handled, hWnd:{0:X} msg:{1:X} wParam:{2:X} lParam:{3:X}", (unsigned long)hWnd, msg, (unsigned long)wParam, (unsigned long)lParam);
spdlog::trace("WndProc ImGui handled, hWnd:{0:X} msg:{1:X} wParam:{2:X} lParam:{3:X}", (ULONG64)hWnd, msg, (ULONG64)wParam, (ULONG64)lParam);
return TRUE;
}
@@ -489,7 +489,7 @@ private:
case WM_XBUTTONDOWN:
case WM_XBUTTONUP:
case WM_XBUTTONDBLCLK:
spdlog::trace("WndProc switch handled, hWnd:{0:X} msg:{1:X} wParam:{2:X} lParam:{3:X}", (unsigned long)hWnd, msg, (unsigned long)wParam, (unsigned long)lParam);
spdlog::trace("WndProc switch handled, hWnd:{0:X} msg:{1:X} wParam:{2:X} lParam:{3:X}", (ULONG64)hWnd, msg, (ULONG64)wParam, (ULONG64)lParam);
return TRUE;
case WM_INPUT:
@@ -516,7 +516,7 @@ private:
}
else
spdlog::trace("WndProc WM_INPUT hWnd:{0:X} msg:{1:X} wParam:{2:X} lParam:{3:X}", (unsigned long)hWnd, msg, (unsigned long)wParam, (unsigned long)lParam);
spdlog::trace("WndProc WM_INPUT hWnd:{0:X} msg:{1:X} wParam:{2:X} lParam:{3:X}", (ULONG64)hWnd, msg, (ULONG64)wParam, (ULONG64)lParam);
return TRUE;
@@ -1432,7 +1432,7 @@ public:
if (_displayWidth == 0)
{
_displayWidth = Config::Instance()->CurrentFeature->DisplayWidth();
_renderWidth = _displayWidth / 3.0;
_renderWidth = _displayWidth / 3.0f;
_mipmapUpscalerQuality = 0;
_mipmapUpscalerRatio = 3.0f;
_mipBiasCalculated = log2((float)_renderWidth / (float)_displayWidth);
@@ -1556,7 +1556,7 @@ public:
_isVisible = false;
_isResetRequested = false;
spdlog::debug("ImGuiCommon::Init Handle: {0:X}", (unsigned long)_handle);
spdlog::debug("ImGuiCommon::Init Handle: {0:X}", (ULONG64)_handle);
// Setup Dear ImGui context
IMGUI_CHECKVERSION();
@@ -1580,7 +1580,7 @@ public:
if (_oWndProc == nullptr)
_oWndProc = (WNDPROC)SetWindowLongPtr(InHwnd, GWLP_WNDPROC, (LONG_PTR)WndProc);
spdlog::debug("ImGuiCommon::Init _oWndProc: {0:X}", (unsigned long)_oWndProc);
spdlog::debug("ImGuiCommon::Init _oWndProc: {0:X}", (ULONG64)_oWndProc);
if (!pfn_SetCursorPos_hooked)
+1 -1
View File
@@ -489,7 +489,7 @@ void ImGuiOverlayVk::ReInitVk(HWND InNewHwnd)
if (!_isInited || !g_bInitialized)
return;
spdlog::debug("ImGuiOverlayVk::ReInitVk hwnd: {0:X}", (unsigned long)InNewHwnd);
spdlog::debug("ImGuiOverlayVk::ReInitVk hwnd: {0:X}", (UINT64)InNewHwnd);
ImGui_ImplVulkan_Shutdown();
ImGuiOverlayBase::Shutdown();
+2 -2
View File
@@ -51,8 +51,8 @@ private:
ID3D12Resource* _constantBuffer = nullptr;
D3D12_RESOURCE_STATES _bufferState = D3D12_RESOURCE_STATE_COMMON;
uint32_t InNumThreadsX = 32;
uint32_t InNumThreadsY = 32;
UINT InNumThreadsX = 32;
UINT InNumThreadsY = 32;
public:
bool CreateBufferResource(ID3D12Device* InDevice, ID3D12Resource* InSource, D3D12_RESOURCE_STATES InState);