PresentMon icon indicating copy to clipboard operation
PresentMon copied to clipboard

Do you know of any presentmon clients that use PresentData/PresentMon headers, or do they all use PresentMon.exe? Asking to guide vcpkg usage

Open aggieNick02 opened this issue 3 years ago • 5 comments

There is a spiffy microsoft project, vcpkg, which manages library dependencies for C++ projects: https://github.com/microsoft/vcpkg . It is pretty powerful and solves a lot of pain points for C++ developers.

I have been using presentmon by having it as a subrepo in my repo, but thought I'd try moving my usage of it to vcpkg, as I can then remove the subrepo from my repo and let vcpkg deal with grabbing and building presentmon.exe . I did this locally and it was pretty straightforward and painless, and I'm now trying to get it merged into the vcpkg repo.

I had a couple questions that would help guide how this project would best be served by vcpkg. Most vcpkg "ports" (when a project is suppported by vcpkg) are for projects where there are clients using .lib/.dll and header files for project libraries. But for me, I only use presentmon via command-line as presentmon.exe. Do you know if any of your clients actually use some of the headers in PresentData/PresentMon, or do you expect that all clients use the executable? Is a non-command line interface (e.g. an API) something that is planned at any point?

Thanks for your help. Feel free to close this issue if you'd like to talk another way. Thanks!

aggieNick02 avatar Apr 01 '21 18:04 aggieNick02

There's several instances of using the static .lib directly, though that's not something that can really be portable, it needs to be built with the same configuration settings as your project. I don't see any reason that the PresentData library couldn't also be built as a DLL, we'd just need to define a bit of a cleaner interface into it.

jenatali avatar Apr 01 '21 19:04 jenatali

Yeah, the intention is that PresentData/ is the API (though it evolved over time and could be better-defined).

PresentMon/ is the console app, and is one example of a tool that uses the PresentData/ API. There are various other tools that use only PresentData/ either via lib or including the source files directly.

Ah ok, thanks. That is helpful to know. I did not realize it was used that way, so I had just been aiming to get the presentmon.exe supported.

The vcpkg tooling offers a cmake-based approach which allows for more easily configuring building the same way as client projects. Do you see any obvious issues that I should be aware of as I look at that approach?

If either of you are interested in providing input or following the port creation, let me know. Happy to have your input but didn't want to add extra burden.

aggieNick02 avatar Apr 01 '21 19:04 aggieNick02

No I don't foresee any issues, though I haven't looked at vcpkg yet. Curious how it goes!

Do you have any pointers to projects that use the PresentData API? I was hoping to use one to verify that the vcpkg port of PresentMon would allow for the project to easily depend on PresentMon without having to use a subrepo/submodule/code copying/etc.

I looked real quick, and it looks like FrameView and CapFrameX use PresentMon.exe directly, while OCAT uses functions defined in PresentMon/PresentMon (basically very similar to calling PresentMon.exe, but keeps everything in a single process; it even includes PresentMon/main.cpp like a header file). PIX does not use PresentMon.exe, so I'm guessing they are actually using PresentData.lib, but their source isn't available. I can reach out to them if you don't know of source-available projects using the PresentData API.

Thanks!

aggieNick02 avatar Apr 05 '21 18:04 aggieNick02