Closed fhoenig closed 2 years ago
I haven't worked with Metal for years, now, so unable to check its status (no HW to test).
We have multiple Metal users at the moment so hopefully some fixes will come through.
PRs are always welcome.
Understandable. Actually 1.0 is also not working. Seems like some major changes broke most of it. On a first quick look I can see that some calls are not the right size of parameters etc.
Using the CPU only side of the tool, it looks pretty awesome though :-) I just wanted something quick, since I've been using Microprofile and there is no Metal. Neither does it exist in Tracy.
A quick look over the code doesn't point to anything obvious.
It's unfortunate that you can only sample Metal at the command buffer level, though. But I guess that's tiled GPUs for you.
I did this in the main file and some other stuff in the .m file. It seems to work, but hits an assert on shutdown.
assert(allocator->nb_inuse == 0); // remotery.c ObjectAllocator_Destructor
9514c9514
< rmtTryMallocArray(Metal, *metal);
---
> rmtTryMalloc(Metal, *metal);
9519c9519,9520
< return error;
---
> //return error;
> return RMT_ERROR_NONE;
9646c9647
< RMT_API void _rmt_BeginMetalSample(rmtPStr name, rmtU32* hash_cache)
---
> RMT_API rmtError _rmt_BeginMetalSample(rmtPStr name, rmtU32* hash_cache)
9651c9652
< return;
---
> return RMT_ERROR_UNKNOWN;
9663d9663
< rmtError error;
9666,9667d9665
< if (error != RMT_ERROR_NONE)
< return;
9677a9676
> return RMT_ERROR_NONE;
Yeah, that's a known assert and not caused by your change. Safe to comment it out as it's really only for debug to track unreleased allocations.
Okay got it.
Btw, not sure if I broke this, but properties don't show up in the web GUI.
rmt_PropertyDefine_U64(entityCount, 0, NoFlags, "Entity Count");
void gameupdate(int frameNumber)
{
rmt_PropertySet_U64(entityCount, world.size());
}
You need to call these once at the end of each of your frames:
rmt_PropertySnapshotAll();
rmt_PropertyFrameResetAll();
Okay good. Out of context here but in case I get the time to commit this, making sure I understand all.
Right now that API is in flux because I'm uncomfortable requiring people call a per-frame function to kick this all off. However, there's no way to do automatic frame resets of some of your properties if you don't tell Remotery when your frame is.
Still nothing shows up. I tried to put them in all threads.
Those calls need to be only on one of your main threads. This is very odd; we have builds across all of the Apple platforms showing properties at the moment. What happens if you add it to a group?
rmt_PropertyDefine_Group(Groupy, "Groupy");
rmt_PropertyDefine_U64(entityCount, 0, NoFlags, "Entity Count", &Groupy);
Nothing.
rmt_PropertyDefine_Group(GamePlay, "GamePlay");
rmt_PropertyDefine_U64(entityCount, 0, NoFlags, "Entity Count", &GamePlay);
// gameplay thread func
void gameupdate(int frameNumber)
{
//Log::debug("gameplay frame %llu", frameNumber);
rmt_PropertySet_U64(entityCount, world.size());
}
rmt_SetCurrentThreadName("Main");
while (running)
{
rmt_MarkFrame();
rmt_BeginCPUSample(EventLoop, 0);
// do stuff
rmt_EndCPUSample();
rmt_PropertySnapshotAll();
rmt_PropertyFrameResetAll();
}
I am on main branch.
Thanks for you help on this, I have copied over your fixes.
If you are still having issues with properties, can you compile and run sample/dump.c
and see if it works? If so, try to copy what it's doing. If nothing works, please open a new Issue.
Hi Don- Metal build is broken at version > v1.0.0.