Skip to content

Commit

Permalink
GnmDriver: define indexed indirect and offset draw
Browse files Browse the repository at this point in the history
The description of the other draws and embedded PS shaders were improved.

There's also a definition for InsertWaitFlip
  • Loading branch information
Leonid Pavel committed Nov 15, 2023
1 parent 2d6c6ad commit c93d18d
Showing 1 changed file with 38 additions and 11 deletions.
49 changes: 38 additions & 11 deletions include/orbis/GnmDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void sceGnmDispatchIndirect();
void sceGnmDispatchIndirectOnMec();
// Empty Comment
void sceGnmDispatchInitDefaultHardwareState();
// Queue a draw indexed instruction into the command buffer.
// Queue an indexed draw instruction into the command buffer.
// numdwords must be 10, and 10 DWORDS must be available in cmd.
int32_t sceGnmDrawIndex(
uint32_t* cmd, uint32_t numdwords, uint32_t indexcount,
Expand All @@ -51,20 +51,41 @@ int32_t sceGnmDrawIndexAuto(
uint32_t* cmd, uint32_t numdwords, uint32_t indexcount,
OrbisGnmDrawFlags flags
);
// Empty Comment
void sceGnmDrawIndexIndirect();
// Queue an indirect indexed draw instruction into the command buffer.
// numdwords must be 9, and 9 DWORDS must be available in cmd.
// dataoffset is an offset to the instance data.
// stage must be 2 for Vertex shader usage.
// vertexoffusgpr optionally specifies which user SGPR should have
// the base vertex written. Set to 0 if not needed.
// instanceoffusgpr optionally specifies which user SGPR should have
// the start instance written. Set to 0 if not needed.
int32_t sceGnmDrawIndexIndirect(
uint32_t* cmd, uint32_t numdwords, uint32_t dataoffset, uint32_t stage,
uint32_t vertexoffusgpr, uint32_t instanceoffusgpr, OrbisGnmDrawFlags flags
);
// Empty Comment
void sceGnmDrawIndexIndirectMulti();
// Empty Comment
void sceGnmDrawIndexMultiInstanced();
// Empty Comment
void sceGnmDrawIndexOffset();
// Queue an indexed draw instruction into the command buffer.
// The index buffer must be set in a previous INDEX_BASE command.
// numdwords must be 9, and 9 DWORDS must be available in cmd.
int32_t sceGnmDrawIndexOffset(
uint32_t* cmd, uint32_t numdwords, uint32_t offset,
uint32_t indexcount, OrbisGnmDrawFlags flags
);
// Queue an indirect draw instruction into the command buffer.
// numdwords must be 9, and 9 DWORDS must be available in cmd.
// dataoffset is an offset to the instance data.
// stage must be 2 for Vertex shader usage.
// vertexoffusgpr optionally specifies which user SGPR should have
// the base vertex written. Set to 0 if not needed.
// instanceoffusgpr optionally specifies which user SGPR should have
// the start instance written. Set to 0 if not needed.
int32_t sceGnmDrawIndirect(
uint32_t* cmd, uint32_t numdwords, uint32_t dataoffset,
uint32_t stage, uint8_t vertexoffusersgpr, uint8_t instanceoffusersgpr,
OrbisGnmDrawFlags flags
uint32_t* cmd, uint32_t numdwords, uint32_t dataoffset, uint32_t stage,
uint32_t vertexoffusgpr, uint32_t instanceoffusgpr, OrbisGnmDrawFlags flags
);
// Empty Comment
void sceGnmDrawIndirectMulti();
Expand Down Expand Up @@ -139,8 +160,13 @@ void sceGnmInsertSetColorMarker();
void sceGnmInsertSetMarker();
// Empty Comment
void sceGnmInsertThreadTraceMarker();
// Empty Comment
void sceGnmInsertWaitFlipDone();
// Instructs the command processor (CP) to wait for writes
// to a VideoOut display buffer to be complete
// numdwords must be 7, and 7 DWORDS must be available in cmd.
int32_t sceGnmInsertWaitFlipDone(
uint32_t* cmd, uint32_t numdwords, uint32_t videohandle,
uint32_t displaybufidx
);
// Empty Comment
void sceGnmIsUserPaEnabled();
// Empty Comment
Expand Down Expand Up @@ -176,8 +202,8 @@ void sceGnmSetCsShaderWithModifier();
// Sets a predefined pixel shader according to the shader ID
// to be used in the command buffer.
// Available shader IDs:
// - 0: Empty shader
// - 1: Empty shader exporting 32 bit R and G
// - 0: Exports zeros in 16 bit floats, RGBA
// - 1: Exports zeros in 32 bit floats, RGBA
// Any other ID will return an error.
// numdwords must be 40, and 40 DWORDS must be available in cmd.
int32_t sceGnmSetEmbeddedPsShader(
Expand All @@ -204,6 +230,7 @@ void sceGnmSetHsShader();
// Empty Comment
void sceGnmSetLsShader();
// Set the pixel shader to be used in the command buffer.
// numdwords must be 40, and 40 DWORDS must be available in cmd.
int32_t sceGnmSetPsShader(
uint32_t* cmd, uint32_t numdwords, const void* psregs
);
Expand Down

0 comments on commit c93d18d

Please sign in to comment.