Skip to content

[GSP] Fine grained control over GSPGPU state #573

@kynex7510

Description

@kynex7510

I built a library which is a custom implementation of the GX subsystem. The reason for this is to support both userland and baremetal homebrew with a unified interface, as this library will be used by my opengl implementation.

For what concerns the userland part, this library completely relies on GSP callbacks to collect interrupts, and the integration works nice, with no conflicts with libctru's own GX implementation (so long applications stick to one or the other). The only part where I had to diverge and fork libctru is the initialization, as to work, my library needs access to GSP shared memory, in particular to the command queue. There is currently no way to access GSP shared memory directly from libctru, and I believe this is fair, because I'm sure libctru was designed for tight integration with Citro3D, and flexibility on that regard wasn't really a requirement.

With the current code, the changes I need for my library to work correctly are minimal: a function to expose the GSP shared memory pointer (gspSharedMem in gspgpu.c), and another to expose the thread ID gspThreadId in gspgpu.c). However, I'm aware there's an ongoing (done, perhaps?) rewrite of the libctru graphics system, which is why this is an issue, and not a pull request.

Therefore, I'm asking you to consider implementing a flexible way of handling GSP internal state, perhaps by being able to register one particular GX implementation, akin to how an application can set event callbacks right now, so for example, a library like Citro3D would use libctru's default implementation, while an external library like mine could be used by my opengl implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions