3330 Commits

Author SHA1 Message Date
Kawe Mazidjatari
1f7bbe5b92 Recast: make detail mesh edge detection more robust
Merge recastnavitagion/recastnavitagion@c393777d26
Instead of using a distance check which can fail at large magnitudes due
to low precision we can check whether the edges are actually on the
hull.
2024-04-05 17:19:29 +02:00
Kawe Mazidjatari
e3bf2036b3 Recast: fix:rcBuildLayerRegions missing areaType
Merge recastnavitagion/recastnavitagion@ddaa361b08
2024-04-05 17:19:28 +02:00
Kawe Mazidjatari
714674ae33 Engine: reversed some CGame field names
Reversable thanks to the CInputSystem rebuild.
2024-04-05 17:19:28 +02:00
Kawe Mazidjatari
365448b8c7 MaterialSystem: fix console not drawing in the 4:3/5:4 aspect ratio modes
DrawImGui should be called BEFORE ID3D11DeviceContext::ClearRenderTargetView() or ID3D11DeviceContext::End(). Moved drawing code to SpinPresent which is just before the clear/end calls are being made. Console now draws in the 4:3/5:4 aspect ratio video modes.
2024-04-05 17:19:28 +02:00
Kawe Mazidjatari
77a20f4d9e NVIDIA: move markers to actual IDXGISwapChain::Present runtime call
Testing revealed better latency reduction when moved directly here as we also take into account the additional buffy copy's the game does in SpinPresent, our new render thread frame limiter and and ImGui. The difference is very large when the render thread frame limiter is used. The code still passes NVIDIA's reflex testing utility after this patch.
2024-04-05 17:19:28 +02:00
Kawe Mazidjatari
fde79e9f93 NVIDIA: only run latency on success
Only run latency markers if NvAPI_D3D_SetSleepMode returned NVAPI_OK.
2024-04-05 17:19:28 +02:00
Kawe Mazidjatari
81ccefb74d NVIDIA: limit to 1 sleep per frame
The purpose of this bool was to only limit nv sleep to 1 per frame, but the bool was never reset.
2024-04-05 17:19:28 +02:00
Kawe Mazidjatari
c954640527 InputSystem: rename function parameter 2024-04-05 17:12:53 +02:00
Kawe Mazidjatari
b162b10598 NVIDIA: always run PC Latency stats
PCLStats is not NVIDIA hardware bound as per Reflex's documentation, and runs separately from the NVIDIA Reflex code. Always enable!
2024-04-05 17:12:52 +02:00
Kawe Mazidjatari
735a9e0489 NVIDIA: properly enqueue frame ID
Sync Frame ID between main thread and render thread, this changes makes the integration PASS the reflex test utility.
2024-04-05 17:12:52 +02:00
Kawe Mazidjatari
83b95d23c9 MaterialSystem: Expose the proper pointer
The first pointer was a pointing to a pointer to g_MaterialSystem. The new pointer points directly to g_MaterialSystem. Also added CMaterialSystem::GetCurrentFrameCount() for g_FrameNum.
2024-04-05 17:12:52 +02:00
Kawe Mazidjatari
4d521b60c9 Engine: fix incorrect function names
Was actually pointing to Host_Init_DuringVideo, not Host_Init. Added all Host_Init functions to avoid confusion in the future.
2024-04-05 17:12:52 +02:00
Kawe Mazidjatari
65bff96db1 NVIDIA: low latency code decouple 2024-04-05 17:12:52 +02:00
Kawe Mazidjatari
fd8b2f255e NVIDIA: add TRIGGER_FLASH marker to input event handler 2024-04-05 17:12:52 +02:00
Kawe Mazidjatari
47dfc39ad5 NVIDIA: add PC_LATENCY_PING marker to msg pump 2024-04-05 17:12:51 +02:00
Kawe Mazidjatari
053a1ca9e0 Tier0: add template inline for FindPatternSIMD
This allows for directly setting a function pointer without double casting it, and significantly reduce code verbosity.
2024-04-05 17:12:51 +02:00
Kawe Mazidjatari
05352d9d17 Tier1: temporarily comment
Unused and causes errors due to unimplemented mutex class (needs to be reversed still).
2024-04-05 17:12:51 +02:00
Kawe Mazidjatari
13fa6d902b EngineAPI: key event dispatcher rebuild 2024-04-05 17:12:51 +02:00
Kawe Mazidjatari
02b0a5c7df InputSystem: make InputEventCallback_t return type bool 2024-04-05 17:12:51 +02:00
Kawe Mazidjatari
99a24d9254 InputSystem: add reversed KeyInfo_t and KeyEvent_t struct
Almost fully mapped out, the unknown fields seem to be unused or padding.
2024-04-05 17:10:59 +02:00
Kawe Mazidjatari
44cf99acc1 InputSystem: add comment to field 2024-04-05 17:10:59 +02:00
Kawe Mazidjatari
0067a57aa8 InputSystem: add inline helpers 2024-04-05 17:10:58 +02:00
Kawe Mazidjatari
b72f02d123 InputSystem: fixup enumerants and controller structs
Enumerants:
* ButtonCode_t::JOYSTICK_MAX_BUTTON_COUNT = 32 (previously 26, incorrect...).
* AnalogCode_t::JOYSTICK_FIRST_AXIS = 2 (previously 4, incorrect...).
* Added: ButtonCode_t::KEY_CREDITSIGN (k104, last key).
* Fixed up Xbox controller enums.

Structs xdevice_t:
* Added partially reversed unkownhiddevice_t structure (used for non-xbox hardware).

General:
* Added static assertions for structure sizes.
2024-04-05 17:10:58 +02:00
Kawe Mazidjatari
94d01c39b3 Tier1: make CTier1AppSystem iface public 2024-04-05 17:10:58 +02:00
Kawe Mazidjatari
4e3fdab7e7 InputSystem: joystick deadzone indices and event input callback types
Adjust iface accordingly.
2024-04-05 17:10:58 +02:00
Kawe Mazidjatari
bbebbdac13 InputSystem: largely reversed struct and fully reversed iface
Struct has been largely mapped out (still requires a bit of work, mostly the Xbox/Hid data structures). The vftable has been fully mapped out.
2024-04-05 17:09:47 +02:00
Kawe Mazidjatari
bd35ec6525 Create utlstringmap.h 2024-04-05 17:04:53 +02:00
Kawe Mazidjatari
e64e5674c8 InputSystem: update button codes
Xbox enumerants have changed as the game supports Xbox One controllers. Since the joystick button count has changed, 'JOYSTICK_MAX_BUTTON_COUNT' has also changed which affects the size of datatypes used by the CInputSystem class.
2024-04-05 16:55:29 +02:00
Kawe Mazidjatari
7d0b2d7450 Add/update core headers 2024-04-05 16:53:51 +02:00
Kawe Mazidjatari
1b2ce75e81 Add PCLSTATS marker 2024-04-05 16:49:30 +02:00
Kawe Mazidjatari
59e0bfa10b NVIDIA: initial implementation of latency markers 2024-04-05 16:45:05 +02:00
Kawe Mazidjatari
d3d80398e3 Add new reversed packet header flags
These flags only exist in the respawn version of the engine. Renamed 'CNetChan::unknown_challenge_var' to 'CNetChan::m_nRealTimePackets'. This field counts the number of packets sent while the frame time wasn't prescaled with the 'host_timescale' cvar, see r5apex.exe+0x3093C0 (140309FC0).
2024-04-05 16:41:11 +02:00
Kawe Mazidjatari
c8b5f47c80 Add packet header flags 2024-04-05 16:41:11 +02:00
Kawe Mazidjatari
51b866f6a1 NVIDIA: check if adapter is from NVIDIA in GFX_SetLatencyMarker()
Moved adapter vendor check to its own func, added a global which could be used to fully disable the low latency system. Also added groundwork for the (future) PCL stats implementation.
2024-04-05 16:41:11 +02:00
Kawe Mazidjatari
82c522a424 Use size types for keyvaluesystem interface 2024-04-05 16:41:11 +02:00
Kawe Mazidjatari
f609f16427 Don't compile debug code in cert builds 2024-04-05 16:41:11 +02:00
Kawe Mazidjatari
fe650711c2 ConCommand: marked 'script(_...)' FCVAR_DEVELOPMENTONLY 2024-04-05 16:41:11 +02:00
Kawe Mazidjatari
144d5f62e1 IDetour: code refactor
Utilize the new IDetour::DetourSetup() code, IDetour::Attach and IDetour::Detach have been removed in favor of this (significantly reduces chance of user error). Since the template check happens in the idetour header, it is much more aggressive on type mismatches, such as a difference in parameter types, between the function and detour, will now raise a compile time error. As a result, some type mismatches have been fixed in this commit as well.
2024-04-05 16:41:09 +02:00
Kawe Mazidjatari
3831058f81 New method for IDetour
This will deprecate IDetour::Attach and IDetour::Detatch. This should reduce the chances of potential errors caused by using the wrong function in the wrong method (e.g. using DetourAttach in IDetour::Detatch).
2024-04-05 16:41:09 +02:00
Kawe Mazidjatari
c86f0c5c6a Check if we have enough room for new execution markers
Make sure we always have enough room for new execution markers. Engine normally truncates the head of the vector if out of room; we want to avoid it as this will cause the cookies to shift, and thus cause them to misalign with their respective commands.
2024-04-05 16:41:08 +02:00
Kawe Mazidjatari
699a4ce464 Implement CCommandBuffer
Code is based on Valve's implementation, with the following changes:
- Usage of 64bit signed size types.
- Usage of const where possible.
- Removal of field 'CCommandBuffer::m_nLastUsedArgSSize'.
2024-04-05 16:39:22 +02:00
Kawe Mazidjatari
ea8074dff9 Fix bug in utllinkedlist
Should return template type (default 'unsigned short') instead of int as Count.
2024-04-05 16:34:30 +02:00
Kawe Mazidjatari
a8312517f4 CCommand adjustments
Moved inlines to header; made ArgC return 32bit integer instead.
2024-04-05 16:34:30 +02:00
Kawe Mazidjatari
5967a0d011 Add additional warning codes to thirdparty warning suppressor 2024-04-05 16:34:29 +02:00
Kawe Mazidjatari
8c22d9ed80 Fix compiler warnings on Visual Studio 2017
Should not be a constexpr, this caused cryptic errors in template code when compiling the code with older compilers.
2024-04-05 16:34:29 +02:00
Kawe Mazidjatari
e2b231f4e0 Fix declaration/implementation mismatch 2024-04-05 16:34:29 +02:00
Kawe Mazidjatari
16156ffd3a Add missing help strings 2024-04-05 16:34:29 +02:00
Kawe Mazidjatari
d57d3f0838 Add promo version cvars
Used for showing promo's like events such as tournaments.
2024-04-05 16:34:29 +02:00
Kawe Mazidjatari
8400ee769f Fix emblem misalignment 2024-04-05 16:34:29 +02:00
Kawe Mazidjatari
37139130be Update emblem for 2.4 release 2024-04-05 16:34:29 +02:00