GithubHelp home page GithubHelp logo

Metal broken about remotery HOT 13 CLOSED

fhoenig avatar fhoenig commented on August 22, 2024
Metal broken

from remotery.

Comments (13)

dwilliamson avatar dwilliamson commented on August 22, 2024

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.

from remotery.

fhoenig avatar fhoenig commented on August 22, 2024

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.

from remotery.

dwilliamson avatar dwilliamson commented on August 22, 2024

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.

from remotery.

fhoenig avatar fhoenig commented on August 22, 2024

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;

from remotery.

dwilliamson avatar dwilliamson commented on August 22, 2024

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.

from remotery.

fhoenig avatar fhoenig commented on August 22, 2024

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());   
}

from remotery.

dwilliamson avatar dwilliamson commented on August 22, 2024

You need to call these once at the end of each of your frames:

rmt_PropertySnapshotAll();
rmt_PropertyFrameResetAll();

from remotery.

fhoenig avatar fhoenig commented on August 22, 2024

Okay good. Out of context here but in case I get the time to commit this, making sure I understand all.

from remotery.

dwilliamson avatar dwilliamson commented on August 22, 2024

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.

from remotery.

fhoenig avatar fhoenig commented on August 22, 2024

Still nothing shows up. I tried to put them in all threads.

from remotery.

dwilliamson avatar dwilliamson commented on August 22, 2024

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);

from remotery.

fhoenig avatar fhoenig commented on August 22, 2024

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.

from remotery.

dwilliamson avatar dwilliamson commented on August 22, 2024

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.

from remotery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.