diff --git a/NVIDIA/NVIDIA.cpp b/NVIDIA/NVIDIA.cpp index 3f01b2a..df86178 100644 --- a/NVIDIA/NVIDIA.cpp +++ b/NVIDIA/NVIDIA.cpp @@ -48,7 +48,6 @@ ReflexOptions options = {}; options.mode = mode; options.frameLimitUs = frameLimitUs; - options.useMarkersToOptimize = mode == ReflexMode::eLowLatencyWithBoost; if (SL_FAILED(r, slReflexSetOptions(options))) { return; diff --git a/NVIDIA/sl.h b/NVIDIA/sl.h index ca5aa71..b6246ee 100644 --- a/NVIDIA/sl.h +++ b/NVIDIA/sl.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2022 NVIDIA CORPORATION. All rights reserved +* Copyright (c) 2022-2023 NVIDIA CORPORATION. All rights reserved * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -167,6 +167,8 @@ //!Optional - Butffer to be used in addition to TransparencyLayer which allows 3-channels of Opacity versus 1-channel. // In this case, TransparencyLayer represents Color (RcGcBc), TransparencyLayerOpacity represents alpha (RaGaBa)' constexpr BufferType kBufferTypeTransparencyLayerOpacity = 52; +//! Optional - Swapchain buffer to be presented +constexpr BufferType kBufferTypeBackbuffer = 53; //! Features supported with this SDK //! @@ -183,15 +185,24 @@ //! NVIDIA Image Scaling constexpr Feature kFeatureNIS = 2; -//! Low-Latency +//! Reflex constexpr Feature kFeatureReflex = 3; +//! PC Latency +constexpr Feature kFeaturePCL = 4; + +//! DeepDVC +constexpr Feature kFeatureDeepDVC = 5; + + //! DLSS Frame Generation constexpr Feature kFeatureDLSS_G = 1000; //! DLSS Ray Reconstruction constexpr Feature kFeatureDLSS_RR = 1001; +constexpr Feature kFeatureNvPerf = 1002; + // ImGUI constexpr Feature kFeatureImGUI = 9999; diff --git a/NVIDIA/sl_consts.h b/NVIDIA/sl_consts.h index e13d88f..64192d1 100644 --- a/NVIDIA/sl_consts.h +++ b/NVIDIA/sl_consts.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2022 NVIDIA CORPORATION. All rights reserved +* Copyright (c) 2022-2023 NVIDIA CORPORATION. All rights reserved * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -25,6 +25,7 @@ #include #include #include +#include "sl_struct.h" #define SL_ENUM_OPERATORS_64(T) \ inline bool operator&(T a, T b) \ diff --git a/NVIDIA/sl_reflex.h b/NVIDIA/sl_reflex.h index 9612592..53adf22 100644 --- a/NVIDIA/sl_reflex.h +++ b/NVIDIA/sl_reflex.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2022 NVIDIA CORPORATION. All rights reserved +* Copyright (c) 2022-2023 NVIDIA CORPORATION. All rights reserved * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,6 +22,8 @@ #pragma once +#include "sl_pcl.h" + namespace sl { @@ -38,17 +40,17 @@ ReflexMode mode = ReflexMode::eOff; //! Specifies if frame limiting (FPS cap) is enabled (0 to disable, microseconds otherwise). //! One benefit of using Reflex's FPS cap over other implementations is the driver would be aware and can provide better optimizations. - //! This setting is independent of ReflexOptions::mode; it can even be used with eReflexModeOff. + //! This setting is independent of ReflexOptions::mode; it can even be used with mode == ReflexMode::eOff. + //! The value is used each time you call slReflexSetOptions/slSetData, make sure to initialize when changing one of the other Reflex options during frame limiting. + //! It is overridden (ignored) by frameLimitUs if set in sl.reflex.json in non-production builds. uint32_t frameLimitUs = 0; - //! Specifies if markers can be used for optimization or not. Set to true UNLESS (if any of the below apply, set to false): - //! - The game is single threaded (i.e. simulation for frame X+1 cannot start until render submission for frame X is done) - //! - The present call is not called right after render submission - //! - Simulation does not happen exactly once per render frame + //! This should only be enabled in specific scenarios with subtle caveats. + //! Most integrations should leave it unset unless advised otherwise by the Reflex team bool useMarkersToOptimize = false; //! Specifies the hot-key which should be used instead of custom message for PC latency marker //! Possible values: VK_F13, VK_F14, VK_F15 uint16_t virtualKey = 0; - //! ThreadID for reflex messages + //! ThreadID for PCL Stats messages uint32_t idThread = 0; //! IMPORTANT: New members go here or if optional can be chained in a new struct, see sl_struct.h for details @@ -93,29 +95,16 @@ //! IMPORTANT: New members go here or if optional can be chained in a new struct, see sl_struct.h for details }; -enum ReflexMarker -{ - eSimulationStart, - eSimulationEnd, - eRenderSubmitStart, - eRenderSubmitEnd, - ePresentStart, - ePresentEnd, - eInputSample, - eTriggerFlash, - ePCLatencyPing, - eOutOfBandRenderSubmitStart, - eOutOfBandRenderSubmitEnd, - eOutOfBandPresentStart, - eOutOfBandPresentEnd -}; +using MarkerUnderlying = std::underlying_type_t; // {E268B3DC-F963-4C37-9776-AF048E132621} SL_STRUCT(ReflexHelper, StructType({ 0xe268b3dc, 0xf963, 0x4c37, { 0x97, 0x76, 0xaf, 0x4, 0x8e, 0x13, 0x26, 0x21 } }), kStructVersion1) - ReflexHelper(ReflexMarker m) : BaseStructure(ReflexHelper::s_structType, kStructVersion1), marker(m) {}; - operator ReflexMarker () const { return marker; }; + ReflexHelper(MarkerUnderlying m) : BaseStructure(ReflexHelper::s_structType, kStructVersion1), marker(m) {}; + ReflexHelper(PCLMarker m) : BaseStructure(ReflexHelper::s_structType, kStructVersion1), marker(to_underlying(m)) {}; + operator MarkerUnderlying () const { return marker; }; private: - ReflexMarker marker; + // May be kReflexMarkerSleep which is not a valid PCLMarker value + MarkerUnderlying marker; }; @@ -131,17 +120,6 @@ //! This method is NOT thread safe. using PFun_slReflexGetState = sl::Result(sl::ReflexState& state); -//! Sets Reflex marker -//! -//! Call this method to set specific Reflex marker -//! -//! @param marker Specifies which marker to use -//! @param frame Specifies current frame -//! @return sl::ResultCode::eOk if successful, error code otherwise (see sl_result.h for details) -//! -//! This method is thread safe. -using PFun_slReflexSetMarker = sl::Result(sl::ReflexMarker marker, const sl::FrameToken& frame); - //! Tells reflex to sleep the app //! //! Call this method to invoke Reflex sleep in your application. @@ -170,12 +148,6 @@ return s_slReflexGetState(state); } -inline sl::Result slReflexSetMarker(sl::ReflexMarker marker, const sl::FrameToken& frame) -{ - SL_FEATURE_FUN_IMPORT_STATIC(sl::kFeatureReflex, slReflexSetMarker); - return s_slReflexSetMarker(marker, frame); -} - inline sl::Result slReflexSleep(const sl::FrameToken& frame) { SL_FEATURE_FUN_IMPORT_STATIC(sl::kFeatureReflex, slReflexSleep); diff --git a/NVIDIA/sl_result.h b/NVIDIA/sl_result.h index 05a3c7e..cbe7afb 100644 --- a/NVIDIA/sl_result.h +++ b/NVIDIA/sl_result.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2022 NVIDIA CORPORATION. All rights reserved +* Copyright (c) 2022-2023 NVIDIA CORPORATION. All rights reserved * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/NVIDIA/sl_struct.h b/NVIDIA/sl_struct.h index 7080985..0c6d40f 100644 --- a/NVIDIA/sl_struct.h +++ b/NVIDIA/sl_struct.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2022 NVIDIA CORPORATION. All rights reserved +* Copyright (c) 2022-2023 NVIDIA CORPORATION. All rights reserved * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -31,10 +31,10 @@ //! GUID struct StructType { - unsigned long data1; - unsigned short data2; - unsigned short data3; - unsigned char data4[8]; + uint32_t data1; + uint16_t data2; + uint16_t data3; + uint8_t data4[8]; inline bool operator==(const StructType& rhs) const { return memcmp(this, &rhs, sizeof(*this)) == 0; } inline bool operator!=(const StructType& rhs) const { return memcmp(this, &rhs, sizeof(*this)) != 0; } diff --git a/NVIDIA/sl_version.h b/NVIDIA/sl_version.h index a24e159..8d23f36 100644 --- a/NVIDIA/sl_version.h +++ b/NVIDIA/sl_version.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2022 NVIDIA CORPORATION. All rights reserved +* Copyright (c) 2022-2023 NVIDIA CORPORATION. All rights reserved * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,8 +22,8 @@ #pragma once #define SL_VERSION_MAJOR 2 -#define SL_VERSION_MINOR 2 -#define SL_VERSION_PATCH 1 +#define SL_VERSION_MINOR 4 +#define SL_VERSION_PATCH 0 #include diff --git a/Qwilight/Assets/x64/avcodec-60.dll b/Qwilight/Assets/x64/avcodec-60.dll deleted file mode 100644 index 16d55f9..0000000 --- a/Qwilight/Assets/x64/avcodec-60.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b8ba83ff43cf8596586cbb015497d3cbe054d989a812b26b4b89cb9cd64a7a6b -size 79826944 diff --git a/Qwilight/Assets/x64/avcodec-61.dll b/Qwilight/Assets/x64/avcodec-61.dll new file mode 100644 index 0000000..fab630e --- /dev/null +++ b/Qwilight/Assets/x64/avcodec-61.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:253843a4ab34e608b253dbc3899036dc07e4157ede9c63cbfbb13bafaba7b7da +size 82667520 diff --git a/Qwilight/Assets/x64/avdevice-60.dll b/Qwilight/Assets/x64/avdevice-60.dll deleted file mode 100644 index 8e732fb..0000000 --- a/Qwilight/Assets/x64/avdevice-60.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:15a54a835d207cb92a2562804ac7d6b678d6ab62fe4cc4fe596bcadbaf67dcff -size 4417024 diff --git a/Qwilight/Assets/x64/avdevice-61.dll b/Qwilight/Assets/x64/avdevice-61.dll new file mode 100644 index 0000000..bb9bab8 --- /dev/null +++ b/Qwilight/Assets/x64/avdevice-61.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c77afd1f787b548e758b87f8bf93662f336bc98f31e2ccaa4206eed67ca56603 +size 4424192 diff --git a/Qwilight/Assets/x64/avfilter-10.dll b/Qwilight/Assets/x64/avfilter-10.dll new file mode 100644 index 0000000..452fc07 --- /dev/null +++ b/Qwilight/Assets/x64/avfilter-10.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7615b672af06710a04f5f476332153f3d95c2a917649aa5814e556d7b76e0b03 +size 40719872 diff --git a/Qwilight/Assets/x64/avfilter-9.dll b/Qwilight/Assets/x64/avfilter-9.dll deleted file mode 100644 index 6c35b8f..0000000 --- a/Qwilight/Assets/x64/avfilter-9.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5640ad1e25727b3bf092c0f2f3cd1bdc65d7854958f824fadb2959c252eb7fbe -size 39759872 diff --git a/Qwilight/Assets/x64/avformat-60.dll b/Qwilight/Assets/x64/avformat-60.dll deleted file mode 100644 index 54dfc0e..0000000 --- a/Qwilight/Assets/x64/avformat-60.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:01c35f9e157bf16b9b9ea416c0299ffc64a7626775857d7bc19ba1bc9b498208 -size 17132544 diff --git a/Qwilight/Assets/x64/avformat-61.dll b/Qwilight/Assets/x64/avformat-61.dll new file mode 100644 index 0000000..a9081f3 --- /dev/null +++ b/Qwilight/Assets/x64/avformat-61.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f7a7d6ace9cc4aaa9865ee28de95c9897f92d31d7953134df65162f34e7f2509 +size 18246144 diff --git a/Qwilight/Assets/x64/avutil-58.dll b/Qwilight/Assets/x64/avutil-58.dll deleted file mode 100644 index 539121a..0000000 --- a/Qwilight/Assets/x64/avutil-58.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c086635f541df5bfd9982b94b80197a211c3a82bfec1e9a34ecafac2c1e826a1 -size 2302976 diff --git a/Qwilight/Assets/x64/avutil-59.dll b/Qwilight/Assets/x64/avutil-59.dll new file mode 100644 index 0000000..2bfa128 --- /dev/null +++ b/Qwilight/Assets/x64/avutil-59.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f02c1eea2970d8256bbb6979d617e3e96fa340aa374dc42bd548b730aec4ee1 +size 2701824 diff --git a/Qwilight/Assets/x64/ffmpeg.exe b/Qwilight/Assets/x64/ffmpeg.exe index e6d50dd..b147c83 100644 --- a/Qwilight/Assets/x64/ffmpeg.exe +++ b/Qwilight/Assets/x64/ffmpeg.exe @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fc635444b2a75d3c709b586ddd1e51e2d7c5b74126c7903db9658592af872ba7 -size 388608 +oid sha256:1eb21ec75b4fb18d4b804e2a2bc4b641e6f5731a43279591a99e6c18ba67fd48 +size 430592 diff --git a/Qwilight/Assets/x64/ffprobe.exe b/Qwilight/Assets/x64/ffprobe.exe index 4705039..a9f7866 100644 --- a/Qwilight/Assets/x64/ffprobe.exe +++ b/Qwilight/Assets/x64/ffprobe.exe @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:05bf9449818a2a0c76fabc332ae314d202dea8d10143934b1d9dfe9da2d672dd -size 192000 +oid sha256:b7682303dcc91c28d03c4541b5fde378d87efff68ab7e54930aa2bc72e6a563c +size 207360 diff --git a/Qwilight/Assets/x64/postproc-57.dll b/Qwilight/Assets/x64/postproc-57.dll deleted file mode 100644 index ed06597..0000000 --- a/Qwilight/Assets/x64/postproc-57.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2447e3a91171892143a168ffc30e7a3f8470c2acdb422e7cf0eebbde2f1655d5 -size 76288 diff --git a/Qwilight/Assets/x64/postproc-58.dll b/Qwilight/Assets/x64/postproc-58.dll new file mode 100644 index 0000000..73ab1ad --- /dev/null +++ b/Qwilight/Assets/x64/postproc-58.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00dedfa6eaf4e10eaf14101e5aa922723f86541a5500ec7488316fa7c5e776f3 +size 86016 diff --git a/Qwilight/Assets/x64/sl.common.dll b/Qwilight/Assets/x64/sl.common.dll index e1715a6..63c8cec 100644 --- a/Qwilight/Assets/x64/sl.common.dll +++ b/Qwilight/Assets/x64/sl.common.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:89757451c31aaef5c6e9787ef340e5e47948b69a3a6ab23aa52449b2deb9be5a -size 643544 +oid sha256:ce3cee16ecbbe2ff15fd17ab0f394c68527a7f1eefca5aa410dccea209ba44fb +size 655840 diff --git a/Qwilight/Assets/x64/sl.interposer.dll b/Qwilight/Assets/x64/sl.interposer.dll index f43a3ca..fbdd339 100644 --- a/Qwilight/Assets/x64/sl.interposer.dll +++ b/Qwilight/Assets/x64/sl.interposer.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b15b4060b25a57f9c3293582489720b4ee1895e0610b20b3aa0f2e3f6c151106 -size 519640 +oid sha256:78c1696ba125f5c7656510481b38035a4f1e9d7a8928705dba45933075608260 +size 532960 diff --git a/Qwilight/Assets/x64/sl.reflex.dll b/Qwilight/Assets/x64/sl.reflex.dll index 79bfb4e..f0c1d79 100644 --- a/Qwilight/Assets/x64/sl.reflex.dll +++ b/Qwilight/Assets/x64/sl.reflex.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a069419c7e4cad6dad443515af3a61112e16f9a442914c274c09fc8a8c4dba2b -size 175576 +oid sha256:bb11d3b0ca9ad48c2e75bd2c220608ed8b7be50f088dcea50944918f6d84d6c8 +size 177120 diff --git a/Qwilight/Assets/x64/swresample-4.dll b/Qwilight/Assets/x64/swresample-4.dll deleted file mode 100644 index 25329a5..0000000 --- a/Qwilight/Assets/x64/swresample-4.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9c14cda52325bca290815a21fd4f8d10e9547d41dd9c1edc12c40fbc61b02ac1 -size 436224 diff --git a/Qwilight/Assets/x64/swresample-5.dll b/Qwilight/Assets/x64/swresample-5.dll new file mode 100644 index 0000000..28d3e11 --- /dev/null +++ b/Qwilight/Assets/x64/swresample-5.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00aaef5000537d1ba22ab2a792222f4e26439960fda8cd6386d368b5780fefb0 +size 434176 diff --git a/Qwilight/Assets/x64/swscale-7.dll b/Qwilight/Assets/x64/swscale-7.dll deleted file mode 100644 index 43b1df8..0000000 --- a/Qwilight/Assets/x64/swscale-7.dll +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8a2ff15b48672535ee70667148a902dba9cc9bb580d93a98dc83a3667dde7a56 -size 643072 diff --git a/Qwilight/Assets/x64/swscale-8.dll b/Qwilight/Assets/x64/swscale-8.dll new file mode 100644 index 0000000..df400ea --- /dev/null +++ b/Qwilight/Assets/x64/swscale-8.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e8f4706019a33ace0bee7d397c6dea5778d76f8fc2aecf4ab03cfd9369aba2ce +size 643072 diff --git a/Qwilight/Qwilight.csproj b/Qwilight/Qwilight.csproj index 499d065..dfb842a 100644 --- a/Qwilight/Qwilight.csproj +++ b/Qwilight/Qwilight.csproj @@ -235,19 +235,19 @@ - + Always - + Always - + Always - + Always - + Always @@ -268,7 +268,7 @@ Always - + Always @@ -283,10 +283,10 @@ Always - + Always - + Always diff --git a/Qwilight/QwilightComponent.cs b/Qwilight/QwilightComponent.cs index 2c96269..d1f49b3 100644 --- a/Qwilight/QwilightComponent.cs +++ b/Qwilight/QwilightComponent.cs @@ -34,7 +34,7 @@ public static readonly string[] AudioFileFormats = [".aif", ".aiff", ".asf", ".flac", ".m4a", ".mid", ".midi", ".mp2", ".mp3", ".ogg", ".opus", ".raw", ".wav", ".wma"]; public static readonly string[] DrawingFileFormats = [".bmp", ".gif", ".jpeg", ".jpg", ".png"]; public static readonly string[] MediaFileFormats = [".avi", ".flv", ".m1v", ".mkv", ".mov", ".mp4", ".mpeg", ".mpg", ".wmv"]; - public static readonly string[] ModifiedMediaFileFormats = [".avi", ".flv", ".m1v", ".mpeg", ".mpg"]; + public static readonly string[] ModifyMediaFileFormats = [".avi", ".flv", ".m1v", ".mpeg", ".mpg"]; public static readonly string HashText = Utility.GetID512(File.ReadAllBytes(Path.Combine(AppContext.BaseDirectory, "Qwilight.dll"))); public static readonly Version Date = Assembly.GetEntryAssembly().GetName().Version; public static readonly string DateText = $"{Date.Major}.{Date.Minor}.{Date.Build}"; diff --git a/Qwilight/System/MediaSystem/MediaSystem.cs b/Qwilight/System/MediaSystem/MediaSystem.cs index 06c8f01..220c22d 100644 --- a/Qwilight/System/MediaSystem/MediaSystem.cs +++ b/Qwilight/System/MediaSystem/MediaSystem.cs @@ -18,10 +18,6 @@ "25da64204262bc0636baa0622e2aed80", // Can't it be true "e82d6a96a58c9a01098fa4a53f95c5ad" }; - static readonly string[] _wrongMedia = new string[] - { - "ed7f217838d78942898e53d5dbee64ec" // Celestial Axes - }; readonly ConcurrentDictionary> _mediaMap = new(); readonly ConcurrentDictionary> _mediaHandlerMap = new(); @@ -114,7 +110,7 @@ } else { - var isWrongMedia = Array.IndexOf(_wrongMedia, hash) != -1 || Array.IndexOf(_validMedia, hash) == -1; + var isWrongMedia = QwilightComponent.ModifyMediaFileFormats.Any(format => mediaFilePath.IsTailCaselsss(format)) && Array.IndexOf(_validMedia, hash) == -1; var hasAudio = HasAudio(mediaFilePath); if (isWrongMedia || hasAudio || isCounterWave) {