MSI AB / RTSS development news thread

Discussion in 'MSI AfterBurner Application Development Forum' started by Unwinder, Feb 20, 2017.

  1. MrBeer

    MrBeer Member

    Messages:
    47
    Likes Received:
    8
    GPU:
    --
    I think that if people don;t like the program tell them to go use something else.
    Only use this fourm for support and that way it is easy to tell prople if there is a problem or not.
    I love this program and support is great i have a 3090 evga ftw3. been using it for years even got you to add support for the 1080ti back when i had that card.
    Kept up the good work.
     
    Unwinder likes this.
  2. Unwinder

    Unwinder Ancient Guru Staff Member

    Messages:
    17,083
    Likes Received:
    6,567
    But that's not a question of checking which D3D runtime DLL do I need to load. I do not need to load it, game process does that. It is a question of knowing target addresses for injection into such custom version of D3D runtime loaded by game. DirectX is a COM interface, which means that functions it exports cannot be directly imported from DLL by names on the fly, target addresses for injection can only be peeked inside vtable of D3D interfaces created by it. Such addresses will be specific to D3D runtime version. For D3D runtimes located into system OS folder and shared between the processes such addresses are the same for any application using such interface, so RTSS creates dummy D3D objects inside itself on injection cache initialization event just once (and each time D3D runtimes are upgraded by OS) then simply reuse cached addresses when injecting other D3D processes. For processes using custom local version of D3D runtimes it won’t work, so dummy D3D objects detecting injection targets must be created in context of such process immediately before injection. That’s what “Custom Direct3D support” option does. But that’s not the best solution too because some games may dislike such dummy D3D object creation, especially if the game uses any form of own in-game overlay (which may see dummy D3D creation and try to attach own overlay to it).
     
  3. Astyanax

    Astyanax Ancient Guru

    Messages:
    16,996
    Likes Received:
    7,337
    GPU:
    GTX 1080ti
    You might be making this more complicated than it is?

    These d3d12core files are supplied by microsoft as part of the Agility SDK, so far there are 1.4.9 and 1.4.10 versions, these should be fully fledged D3D12core files that contain the same functions as the system dll and vtable lookup should still work.

    You could retrieve the target addresses of these via vtable and cache them on first encounter, the concern is that RTSS needs to know that these are agility dlls instead of system dlls and that the address caching should be handled differently so that a game loading 1.4.11 doesn't overwrite or load the cached addresses for 1.4.10 (or the system d3d12core), as well as matching the address cache to the dll.

    obviously more complicated in making it work, but theres always a way.
     
    Last edited: Sep 26, 2021
  4. Unwinder

    Unwinder Ancient Guru Staff Member

    Messages:
    17,083
    Likes Received:
    6,567
    You're missing the key factor making it troublesome. It is not a question of caching addresses on the first encounter or doing that on each startup. It is a question of place where cache initialization is being performed. Even if you detect target addresses for such application just once - you anyway need to do it in the context of that process that loaded custom D3D runtime to detect offsets specific to it. Which automatically takes all possible application specific compatibility issues with "custom Direct3D support" out of pocket.
     

  5. Unwinder

    Unwinder Ancient Guru Staff Member

    Messages:
    17,083
    Likes Received:
    6,567
    Some additional info about Halo Infinite.

    While some highly intellectual and extremely polite Halo Infinite fanboys play their fun RTSS downvoting game @ reddit, other users help me to do something useful. I still have no access to game beta so I can only diagnose the issues distantly, but thanks goes to Ax4x Nelly again (Halo Infinite (Beta) | 3840x1600 Test | RTX 3080Ti & i9 9900K - YouTube). With his help we identified why some players cannot get suggested "Custom Direct3D support" option working. Those who get game crashes immediately after enabling it also enable "High" application detection level in HaloInfinite profile due to some odd reason. I'll repeat once again: do not try to do it, use default "Low" mode, never try using "High" mode globally, risks of enabling it globally were discussed in this thread just a couple pages ago.
    Enabling both options in tandem results in early injection event on loading D3D12.dll loader due to High mode, then combining it with "Custom Direct3D support" it simply results in dummy hooking D3D device loading OS specific D3D runtimes instead of custom ones bundled with game, which breaks the process.
     
    Paul B, toyo and Nelly D Gamer like this.
  6. Nelly D Gamer

    Nelly D Gamer Member

    Messages:
    22
    Likes Received:
    26
    GPU:
    RTX 3080 Ti
    I hate myself, I just followed your reddit link and then instantly realised why I never use reddit

    Like other's have said Rivatuner is an amazing piece of software and people like me that create content for YouTube would be pretty much lost without it.

    Personally I really appreciate the work you do and I really hope the small minority of haters don't put you off working on it
     
    eGGroLLiO, Unwinder and EpsilonsQc like this.
  7. EpsilonsQc

    EpsilonsQc Member

    Messages:
    47
    Likes Received:
    10
    GPU:
    Radeon RX 6800 XT
    To fix the issue for those highly intellectual players, i suggest you lock / grey-out the 'Medium' and 'High' "Application detection level" options as soon as "Custom Direct3D Support" is turned ON ? And also revert to "Low" "Application detection level" by default as soon as "Custom Direct3D Support" is turned ON ?

    I understand it's a edge-case but that would definitly make the app more "dumb-friendly".
     
  8. Unwinder

    Unwinder Ancient Guru Staff Member

    Messages:
    17,083
    Likes Received:
    6,567
    No. Both are application specific compatibility options, which may work together, may be required to be enabled at the same time and may be mutually exclusive depending on application behaviour. So kewl gamerz who never RTFM will always be able to screw the system by blindly pressing buttons in random order. It is not swiss knife fault that some idiot can cut his finger with it.
     
    Andy_K, eGGroLLiO and EpsilonsQc like this.
  9. Unwinder

    Unwinder Ancient Guru Staff Member

    Messages:
    17,083
    Likes Received:
    6,567
    Halo Infinite hate show not gonna stop @ reddit. Just permanently killed my account there, that’s not a tech community that worth posting anything for sure.
     
    CrazY_Milojko and apophis like this.
  10. Astyanax

    Astyanax Ancient Guru

    Messages:
    16,996
    Likes Received:
    7,337
    GPU:
    GTX 1080ti
    They call it a hive mind for a reason, i forced the techsupport sub to ban me because every question was a google search away and most of the replies were not only wrong but potentially corruptive of the OS in many cases lmao.
     

  11. Unwinder

    Unwinder Ancient Guru Staff Member

    Messages:
    17,083
    Likes Received:
    6,567
    After analyzing possible workaround ways and their pros and cons, I see the following compromise concept for Agility compatibile hooking mode:

    - RTSS will automatically internally enable an equivalent of GUI "Custom Direct3D support" mode, and will do it only for applications which load local copy of D3D12Core.dll instead of system one. So only Halo Infinite and some future games compiled with Agility will be affected and use this codepath, so it won't have a chance to impact compatibility with currently released D3D12 games.
    - Considering that in case of using Agility the only local runtime located in game folder is D3D12Core.dll, and DXGI.dll is a still system one, full functionality of "Custom Direct3D support" is overabundant. It is aimed to support local customized DXGI runtimes as well so it also performs in-process detection of all hooked DXGI functions. It is not necessary in case of Agility, the only local D3D12Core runtime specific function that needs to be hooked differently is ID3D12CommandQueue::ExecuteCommandLists. So RTSS won't use full functionality of "Custom Direct3D support" mode in Agility compatible codepath, it will use more lite form of it and dynamically create a dummy D3D12 command buffer to detect ID3D12CommandQueue::ExecuteCommandLists via vtable but it won't need to create dummy D3D12 and DXGI interfaces specific to custom DXGI.DLL hooking. It will greatly reduce risk of possible application specifc conflicts.
    - I'll add a profile switch for disabling Agility compatible hooking mode, so it will be posssible to disable it for troublehooting or performance testing in application profiles.
    - I'll add retry counter to OSD hooks, so it will stop retrying to initialize itself after a few failed attempts. This way it won't tank performance if hooking is impossible (e.g. if you disable Agility compatible hooking mode).

    I'll be able to implement this concept in a day or two, and most likely I still won't have access to Halo Infinite beta by that time. So I'm not sure if I'll release this future beta and let Halo insiders to test it themselves or wail for getting a copy of beta here.
     
    Astyanax, EpsilonsQc and toyo like this.
  12. Unwinder

    Unwinder Ancient Guru Staff Member

    Messages:
    17,083
    Likes Received:
    6,567
    One of forum visitors shared Halo Infinite key, so I can finally install and debug it here, thanks a lot! It is still not a fully working beta because the game is not activated on my Microsoft account yet, so I cannot get past start screen, but I don't need it anyway - just loading the game and ensuring that overlay is hooked and displayed properly is everything I needed to debug everything. Got it working here with public beta 4 after just a few minutes:

    [​IMG]

    Beta 4 can be launched with it by creating HaloInfinite.exe.cfg profile template with the following content:

    [Hooking]
    EnableDynamicOffsetDetection = 1
    [RendererDirect3D12]
    QueueDetection = 1

    EnableDynamicOffsetDetection is mapped to "Custom Direct3D support" option, which was already mentioned by @Nelly D Gamer as required compatibility option before. Additional QueueDetection is a compatibility D3D12 command queue detection mode switch, which can be necessary for those who cannot get it working by just enabling "Custom Direct3D support" in the application profile.

    Now I'll work on built-in Agility compatibility path for the next beta (I mentioned planned implementation details in the previous post), so next version of RTSS won't need any additional profiles for this game and will work with it out of box. Guess it won't take long and I'll make it downloadable before next Halo Infinite test weekends start.
     
  13. Unwinder

    Unwinder Ancient Guru Staff Member

    Messages:
    17,083
    Likes Received:
    6,567
    For those, who will be testing next RTSS build with Agility hooking support and have no Halo Infinite, I've compiled small D3D12 sample application using Agility, so it is also distibuted with local copy of D3D12 runtimes, newer than OS specific ones. Grab it here:

    https://1drv.ms/u/s!Arz7fwUwKnlToHYTx8LxnbHxvLpM?e=gn7hCP

    Current beta 4 is expected to have no OSD displayed in this sample without creating profile for it and enabling custom D3D support there. Beta 5 is expected to work with it as is.
     
  14. Unwinder

    Unwinder Ancient Guru Staff Member

    Messages:
    17,083
    Likes Received:
    6,567
    RTSS 7.3.2 beta 5 build 25272 is online. It includes hooking support for games compiled with Agility and should work with HI without any additional profiles. I’ll document full changes list a bit later, too sleepy now.

    https://download-eu2.guru3d.com/rtss/[Guru3D.com]-RTSSSetup732Beta5Build25272.rar

    Edit:

    Changes list includes:

    · Various compatibility improvements in the hook engine:
    o Added hooking support for Microsoft DirectX 12 Agility SDK based Direct3D12 applications (e.g. Halo Infinite insider tech preview and possibly other future Direct3D 12 applications compiled with Agility). New DirectX 12 Agility model assumes that the game can be shipped with a local copy of Direct3D 12 runtimes, which can be newer than your system Direct3D12 runtimes. By default RivaTuner Statistics Server’s hook engine is configured to block injection into any custom Direct3D runtimes located outside OS system folder because such case is typical to Direct3D proxy libraries used in third party game mods, which are frequently fundamentally incompatible with overlays. So hooks were blocked on purpose in such environment, making overlay invisible. Running RivaTuner Statistics Server in such environment also reduced performance due to periodically repeating and failing overlay injection attempts. Previously this could be solved by creating application profile for such game with enabled “Custom Direct3D support” option, which is intended to allow injecting custom Direct3D runtimes located outside system OS folders. New Agility compatible hooking path automatically addresses it in the following way:
    § Simplified form of “Custom Direct3D support” mode is now internally engaged by RivaTuner Statistics Server when Agility SDK based Direct3D12 application is detected. Full “Custom Direct3D support” mode functionality is overabundant and not necessary for Agility case. New Agility compatible hooking path is optional and can be disabled by power users at application profiles level for troubleshooting or performance testing
    § Added retry counter for reinjection attempts, aimed to minimize performance penalty for situations when Agility SDK based Direct3D12 application cannot be injected
    § DXGI swapchain hooks are now suspended during dynamic hook offsets initialization, this change is aimed to reduce risk of incompatibilities caused by enabling “Custom Direct3D support” profile in conjunction with application detection level set to “High” for Agility based Direct3D12 applications
    · Added unified Direct3D12 command queue caching based algorithm for handling periodic swapchain recreation in some Blizzard games (e.g. Diablo 2 : Resurrected and World of Warcraft). This makes previosly added On-Screen Display rendering profiles for these games optional, they are no longer mandatory
     
    Last edited: Sep 29, 2021
    Kaminari, The1, Nelly D Gamer and 4 others like this.
  15. Squidmaster7

    Squidmaster7 Member

    Messages:
    10
    Likes Received:
    1
    GPU:
    EVGA 1080ti SC2
    @Unwinder, the post you reference in the thread is one I created. I think you unfortunately mischaracterize my post. I have used your software for several years and have absolutely no complaints, and was not complaining about Afterburner/RTSS and Halo: Infinite. My post was merely to spread the word to others that there could be potential conflicts with the programs at this point in time. If others in the reddit thread do not like Afterburner that is not my cause and not an intention I have.

    Please understand that the intent of my post was to help others and not disparage your program or work at all. I was unable to get the workaround I saw above (detection level: low, custom3dsupport:yes) to work. I never said it was the fault of your or the software, and certainly would not consider it hate. I would be more than happy to test out betas and try anything suggested in this thread. I wont post anymore about this since it is the development thread, but I do think it is important that I provide clarification. In my thread I merely mentioned that the two programs had compatibility issues at the moment. I cannot control others but please re-read my post and I think you'll see I have nothing negative to say about your work or software at all and consider it a valuable resource for any GPU owner.
     
    Last edited: Sep 28, 2021
    Unwinder likes this.

  16. Unwinder

    Unwinder Ancient Guru Staff Member

    Messages:
    17,083
    Likes Received:
    6,567
    @Squidmaster7

    No worries, I didn’t mean your OP which simply quoted known workaround. I referenced flow of comments left by gamers under it.
     
  17. Nelly D Gamer

    Nelly D Gamer Member

    Messages:
    22
    Likes Received:
    26
    GPU:
    RTX 3080 Ti
    Beta 5 works perfect, nice work :)

    [​IMG]
    [​IMG]

    Halo Beta opens back up sometime on Thursday so I'll give it a proper test.
     
    Unwinder likes this.
  18. Richie

    Richie Guest

    Messages:
    1
    Likes Received:
    2
    GPU:
    GTX 1070 / 8 GB
    People with access to the beta now get friend codes, however, I have an extra code and barely any friends. You can have it if you want it. I'd rather it go to someone like you so you can test more efficiently and make RTTS even better!
     
    Andy_K and Unwinder like this.
  19. Unwinder

    Unwinder Ancient Guru Staff Member

    Messages:
    17,083
    Likes Received:
    6,567
    Thanks for offering, but I've already got the code ;)
     
  20. Astyanax

    Astyanax Ancient Guru

    Messages:
    16,996
    Likes Received:
    7,337
    GPU:
    GTX 1080ti
    the code hes talking about activates your Live account to take part in matches (also grants you a steam key)

    I only just got email announcing it today myself.
     

Share This Page