Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pbkit: Enable flip stall; expose ramin, print_char, depth buffer internals #628

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions lib/pbkit/pbkit.c
Original file line number Diff line number Diff line change
Expand Up @@ -3712,3 +3712,16 @@ static NTAPI VOID pb_shutdown_notification_routine (PHAL_SHUTDOWN_REGISTRATION S
{
pb_kill();
}

uint8_t* pb_depth_stencil_buffer()
{
return (uint8_t*)pb_DepthStencilAddr;
}

DWORD pb_depth_stencil_pitch() {
return pb_DepthStencilPitch;
}

DWORD pb_depth_stencil_size() {
return pb_DSSize;
}
4 changes: 4 additions & 0 deletions lib/pbkit/pbkit.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ void pb_create_gr_ctx( int ChannelID,
struct s_CtxDma *pGrObject );
void pb_bind_channel(struct s_CtxDma *pCtxDmaObject);

uint8_t *pb_depth_stencil_buffer();
DWORD pb_depth_stencil_pitch();
DWORD pb_depth_stencil_size();
Copy link
Member

@JayFoxRox JayFoxRox Mar 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always thought pbkit had this interface backwards. Currently pbkit is a mix of a low-level and high-level driver.

pbkit can submit pushbuffers, but it also constructs them, some using rather high level operations.
Instead, I believe that pbkit should allow submission of pushbuffers, but it should primarily be the users responsibility to construct them.
pbkit should only control the hardware so it can process commands from the pushbuffers.

More importantly, pbkit also manages buffers internally (sometimes like a singleton), but doesn't allow the user to manually create or control these buffers.
Instead, I believe that pbkit should provide the user with buffer creation / managing functions, but the user should always explicitly create these buffers and keep track of them.

This means I'd prefer to see something like pb_create_depth_stencil_buffer(size, pitch) and then the user should be responsible for creating these buffers.
So, in an ideal world, the application would never even have to query for the buffer address / pitch / size, because it created the buffer itself.

This (explicit buffer creation by application) is also required (or at least helpful) for more advanced applications which want to switch render-targets.


#ifdef __cplusplus
}
#endif
Expand Down