GNM Driver API Reference¶
The gnmdriver.h header declares the full runtime driver API for the PS4's Graphics Next Microarchitecture (GNM) library. This is the primary interface between user-space applications and the GPU command processor. It contains 265 functions spanning draw/dispatch command emission, shader binding, command-buffer submission, SDMA transfers, compute-queue management, resource registration, workload tracking, thread tracing (Sqtt), performance monitoring (Spm), debugging, Razor profiling, markers, validation, and internal packet builders.
All functions use the PS4_SYSV_ABI calling convention. Functions with a void parameter list are retail stubs — they exist in the firmware export table but return a fixed error code (typically ORBIS_GNM_ERROR_UNIMPLEMENTED or 0) on retail consoles and are only functional on devkits.
Header: include/gnmdriver.h
SceGnmDrawFlags¶
Bitfield structure controlling draw-call behaviour. Passed to draw functions and their indirect variants.
typedef struct {
uint32_t predication : 1;
uint32_t _unused : 28;
uint32_t rendertargetsliceoffset : 3;
} SceGnmDrawFlags;
_Static_assert(sizeof(SceGnmDrawFlags) == 0x4, "");
| Field | Bits | Description |
|---|---|---|
predication |
1 | If set, the draw is conditional on the current predication query result. |
_unused |
28 | Reserved — must be zero. |
rendertargetsliceoffset |
3 | Slice offset into the bound render target array (0–7). |
Draw Commands¶
Functions that emit PM4 draw packets into a command buffer. Each takes a pointer to the command buffer (cmdbuf), the remaining size in dwords (size), and draw-specific parameters.
sceGnmDrawIndex¶
int32_t PS4_SYSV_ABI sceGnmDrawIndex(uint32_t* cmdbuf, uint32_t size,
uint32_t index_count, uintptr_t index_addr,
uint32_t flags, uint32_t type);
Emits an indexed draw using an explicit GPU-side index buffer address.
sceGnmDrawIndexAuto¶
int32_t PS4_SYSV_ABI sceGnmDrawIndexAuto(uint32_t* cmdbuf, uint32_t size,
uint32_t index_count, uint32_t flags);
Emits an auto-indexed draw (sequential indices generated by hardware).
sceGnmDrawIndexIndirect¶
int32_t PS4_SYSV_ABI sceGnmDrawIndexIndirect(uint32_t* cmdbuf, uint32_t size,
uint32_t data_offset,
uint32_t shader_stage,
uint32_t vertex_sgpr_offset,
uint32_t instance_sgpr_offset,
uint32_t flags);
Emits an indirect indexed draw whose parameters are read from a GPU buffer at data_offset.
sceGnmDrawIndexIndirectCountMulti¶
int32_t PS4_SYSV_ABI sceGnmDrawIndexIndirectCountMulti(
uint32_t* cmdbuf, uint32_t size, uint32_t data_offset, uint32_t max_count,
uint64_t count_addr, uint32_t shader_stage, uint32_t vertex_sgpr_offset,
uint32_t instance_sgpr_offset, uint32_t flags);
Emits multiple indirect indexed draws, with the actual count read from count_addr.
sceGnmDrawIndexIndirectMulti¶
int PS4_SYSV_ABI sceGnmDrawIndexIndirectMulti(uint32_t* cmdbuf, uint32_t size,
uint32_t data_offset,
uint32_t max_count,
uint32_t shader_stage,
uint32_t vertex_sgpr_offset,
uint32_t instance_sgpr_offset,
uint32_t flags);
Emits a fixed number (max_count) of indirect indexed draws.
sceGnmDrawIndexMultiInstanced¶
Retail stub — no parameters available on retail firmware.
sceGnmDrawIndexOffset¶
int32_t PS4_SYSV_ABI sceGnmDrawIndexOffset(uint32_t* cmdbuf, uint32_t size,
uint32_t index_offset,
uint32_t index_count,
uint32_t flags);
Emits an indexed draw with a dword offset into the currently bound index buffer.
sceGnmDrawIndirect¶
int32_t PS4_SYSV_ABI sceGnmDrawIndirect(uint32_t* cmdbuf, uint32_t size,
uint32_t data_offset,
uint32_t shader_stage,
uint32_t vertex_sgpr_offset,
uint32_t instance_sgpr_offset,
uint32_t flags);
Emits a non-indexed indirect draw.
sceGnmDrawIndirectCountMulti¶
Retail stub — no parameters available on retail firmware.
sceGnmDrawIndirectMulti¶
int32_t PS4_SYSV_ABI sceGnmDrawIndirectMulti(uint32_t* cmdbuf, uint32_t size,
uint32_t data_offset,
uint32_t max_count,
uint32_t shader_stage,
uint32_t vertex_sgpr_offset,
uint32_t instance_sgpr_offset,
uint32_t flags);
Emits a fixed number (max_count) of non-indexed indirect draws.
sceGnmDrawOpaqueAuto¶
Retail stub — no parameters available on retail firmware.
Dispatch Commands¶
Compute-dispatch functions that launch thread groups on the compute units.
sceGnmDispatchDirect¶
int32_t PS4_SYSV_ABI sceGnmDispatchDirect(uint32_t* cmdbuf, uint32_t size,
uint32_t threads_x,
uint32_t threads_y,
uint32_t threads_z,
uint32_t flags);
Dispatches a compute shader with explicit thread-group dimensions.
sceGnmDispatchIndirect¶
int32_t PS4_SYSV_ABI sceGnmDispatchIndirect(uint32_t* cmdbuf, uint32_t size,
uint32_t data_offset,
uint32_t flags);
Dispatches a compute shader whose dimensions are read from a GPU buffer.
sceGnmDispatchIndirectOnMec¶
int32_t PS4_SYSV_ABI sceGnmDispatchIndirectOnMec(uint32_t* cmdbuf,
uint32_t size,
uintptr_t args,
uint32_t modifier);
Dispatches indirectly on the MEC (Micro-Engine Compute) pipe.
Shader Set Commands¶
Functions that bind shader programs to specific pipeline stages.
sceGnmSetCsShader¶
Binds a compute shader.
sceGnmSetCsShaderWithModifier¶
int32_t PS4_SYSV_ABI sceGnmSetCsShaderWithModifier(uint32_t* cmdbuf,
uint32_t size,
const uint32_t* cs_regs,
uint32_t modifier);
Binds a compute shader with an additional modifier (e.g. trap present).
sceGnmSetEmbeddedPsShader¶
int32_t PS4_SYSV_ABI sceGnmSetEmbeddedPsShader(uint32_t* cmdbuf,
uint32_t size,
uint32_t shader_id,
uint32_t shader_modifier);
Binds an embedded (firmware-provided) pixel shader by ID.
sceGnmSetEmbeddedVsShader¶
int32_t PS4_SYSV_ABI sceGnmSetEmbeddedVsShader(uint32_t* cmdbuf,
uint32_t size,
uint32_t shader_id,
uint32_t modifier);
Binds an embedded (firmware-provided) vertex shader by ID.
sceGnmSetEsShader¶
int32_t PS4_SYSV_ABI sceGnmSetEsShader(uint32_t* cmdbuf, uint32_t size,
const uint32_t* es_regs,
uint32_t shader_modifier);
Binds an export shader (geometry-shader amplification path).
sceGnmSetGsRingSizes¶
Retail stub — no parameters available on retail firmware.
sceGnmSetGsShader¶
Binds a geometry shader.
sceGnmSetHsShader¶
int32_t PS4_SYSV_ABI sceGnmSetHsShader(uint32_t* cmdbuf, uint32_t size,
const uint32_t* hs_regs,
uint32_t param4);
Binds a hull shader (tessellation control stage).
sceGnmSetLsShader¶
int32_t PS4_SYSV_ABI sceGnmSetLsShader(uint32_t* cmdbuf, uint32_t size,
const uint32_t* ls_regs,
uint32_t shader_modifier);
Binds a local shader (tessellation vertex-fetch / LS stage).
sceGnmSetPsShader¶
Binds a pixel shader.
sceGnmSetPsShader350¶
int32_t PS4_SYSV_ABI sceGnmSetPsShader350(uint32_t* cmdbuf, uint32_t size,
const uint32_t* ps_regs);
Binds a pixel shader using the GFX 3.50 (Neo-enhanced) register layout.
sceGnmSetVsShader¶
int32_t PS4_SYSV_ABI sceGnmSetVsShader(uint32_t* cmdbuf, uint32_t size,
const uint32_t* vs_regs,
uint32_t shader_modifier);
Binds a vertex shader.
Shader Update Commands¶
Functions that update already-bound shader registers without a full re-bind. Useful for partial state changes (e.g. updating resource descriptors).
sceGnmUpdateGsShader¶
int32_t PS4_SYSV_ABI sceGnmUpdateGsShader(uint32_t* cmdbuf, uint32_t size,
const uint32_t* gs_regs);
Updates the currently bound geometry shader registers.
sceGnmUpdateHsShader¶
int PS4_SYSV_ABI sceGnmUpdateHsShader(uint32_t* cmdbuf, uint32_t size,
const uint32_t* ps_regs,
uint32_t ls_hs_config);
Updates the currently bound hull shader registers.
sceGnmUpdatePsShader¶
int32_t PS4_SYSV_ABI sceGnmUpdatePsShader(uint32_t* cmdbuf, uint32_t size,
const uint32_t* ps_regs);
Updates the currently bound pixel shader registers.
sceGnmUpdatePsShader350¶
int32_t PS4_SYSV_ABI sceGnmUpdatePsShader350(uint32_t* cmdbuf, uint32_t size,
const uint32_t* ps_regs);
Updates the currently bound pixel shader registers (GFX 3.50 layout).
sceGnmUpdateVsShader¶
int32_t PS4_SYSV_ABI sceGnmUpdateVsShader(uint32_t* cmdbuf, uint32_t size,
const uint32_t* vs_regs,
uint32_t shader_modifier);
Updates the currently bound vertex shader registers.
Submit Commands¶
Functions that submit command buffers to the GPU for execution. The draw command buffer (DCB) contains draw/state packets; the constant command buffer (CCB) contains constant updates.
sceGnmAreSubmitsAllowed¶
Returns whether command-buffer submission is currently permitted.
sceGnmRequestFlipAndSubmitDone¶
Retail stub — requests a flip and signals submit completion.
sceGnmRequestFlipAndSubmitDoneForWorkload¶
Retail stub — requests a flip and signals submit completion for a specific workload.
sceGnmSubmitAndFlipCommandBuffers¶
int PS4_SYSV_ABI sceGnmSubmitAndFlipCommandBuffers(
uint32_t count, void* const dcb_gpu_addrs[],
uint32_t* dcb_sizes_in_bytes, void* const ccb_gpu_addrs[],
uint32_t* ccb_sizes_in_bytes, uint32_t vo_handle, uint32_t buf_idx,
uint32_t flip_mode, int64_t flip_arg);
Submits command buffers and requests a display flip on completion.
sceGnmSubmitAndFlipCommandBuffersForWorkload¶
int PS4_SYSV_ABI sceGnmSubmitAndFlipCommandBuffersForWorkload(
uint32_t workload, uint32_t count, void* const dcb_gpu_addrs[],
uint32_t* dcb_sizes_in_bytes, void* const ccb_gpu_addrs[],
uint32_t* ccb_sizes_in_bytes, uint32_t vo_handle, uint32_t buf_idx,
uint32_t flip_mode, int64_t flip_arg);
Submits command buffers for a specific workload and requests a display flip.
sceGnmSubmitCommandBuffers¶
int32_t PS4_SYSV_ABI sceGnmSubmitCommandBuffers(
uint32_t count, void* const dcb_gpu_addrs[],
uint32_t* dcb_sizes_in_bytes, void* const ccb_gpu_addrs[],
uint32_t* ccb_sizes_in_bytes);
Submits one or more draw/constant command-buffer pairs to the GPU.
sceGnmSubmitCommandBuffersForWorkload¶
int PS4_SYSV_ABI sceGnmSubmitCommandBuffersForWorkload(
uint32_t workload, uint32_t count, void* const dcb_gpu_addrs[],
uint32_t* dcb_sizes_in_bytes, void* const ccb_gpu_addrs[],
uint32_t* ccb_sizes_in_bytes);
Submits command buffers associated with a specific workload stream.
sceGnmSubmitDone¶
Signals that all command-buffer submission for the current frame is complete.
Init / Default Hardware State¶
Functions that emit the initial hardware-state setup packets into a command buffer. These should be called once at the start of a command buffer before any draw or dispatch.
sceGnmDispatchInitDefaultHardwareState¶
Emits default compute hardware state into cmdbuf. Returns the number of dwords written.
sceGnmDrawInitDefaultHardwareState¶
Emits default graphics hardware state into cmdbuf. Returns the number of dwords written.
sceGnmDrawInitDefaultHardwareState175¶
Emits default graphics state for GFX 1.75 (base PS4 GPU).
sceGnmDrawInitDefaultHardwareState200¶
Emits default graphics state for GFX 2.00.
sceGnmDrawInitDefaultHardwareState350¶
Emits default graphics state for GFX 3.50 (PS4 Pro / Neo).
sceGnmDrawInitToDefaultContextState¶
Emits packets that initialise the GPU context state to defaults.
sceGnmDrawInitToDefaultContextState400¶
Emits packets that initialise the GPU context state to defaults (GFX 4.00 layout).
sceGnmDrawInitToDefaultContextStateInternalCommand¶
int PS4_SYSV_ABI sceGnmDrawInitToDefaultContextStateInternalCommand(
uint32_t* cmdbuf, uint32_t size);
Emits the internal command portion of the default context-state initialisation.
sceGnmDrawInitToDefaultContextStateInternalSize¶
Returns the size (in dwords) of the internal default-context-state command.
SDMA Commands¶
The SDMA (System DMA) engine performs asynchronous memory copies and fills independently of the graphics/compute pipes. All SDMA functions in this header are retail stubs.
sceGnmSdmaClose¶
Retail stub — closes the SDMA engine session.
sceGnmSdmaConstFill¶
Retail stub — fills a memory range with a constant value via SDMA.
sceGnmSdmaCopyLinear¶
Retail stub — copies linear memory via SDMA.
sceGnmSdmaCopyTiled¶
Retail stub — copies tiled memory via SDMA.
sceGnmSdmaCopyWindow¶
Retail stub — copies a rectangular window of memory via SDMA.
sceGnmSdmaFlush¶
Retail stub — flushes pending SDMA operations.
sceGnmSdmaGetMinCmdSize¶
Retail stub — returns the minimum SDMA command-buffer size.
sceGnmSdmaOpen¶
Retail stub — opens an SDMA engine session.
Compute Queue Management¶
Functions for managing the ACE (Asynchronous Compute Engine) compute queues, including queue mapping, signalling, and waiting.
sceGnmComputeWaitOnAddress¶
int32_t PS4_SYSV_ABI sceGnmComputeWaitOnAddress(uint32_t* cmdbuf,
uint32_t size,
uintptr_t addr,
uint32_t mask,
uint32_t cmp_func,
uint32_t ref);
Emits a compute-pipe wait on a memory address with a comparison function.
sceGnmComputeWaitSemaphore¶
Retail stub — emits a compute-pipe semaphore wait.
sceGnmDingDong¶
Signals a compute queue (VQ) that new work is available up to next_offs_dw.
sceGnmDingDongForWorkload¶
void PS4_SYSV_ABI sceGnmDingDongForWorkload(uint32_t gnm_vqid,
uint32_t next_offs_dw,
uint64_t workload_id);
Signals a compute queue for a specific workload.
sceGnmMapComputeQueue¶
int PS4_SYSV_ABI sceGnmMapComputeQueue(uint32_t pipe_id, uint32_t queue_id,
uintptr_t ring_base_addr,
uint32_t ring_size_dw,
uint32_t* read_ptr_addr);
Maps a compute queue on the specified ACE pipe and queue slot.
sceGnmMapComputeQueueWithPriority¶
int PS4_SYSV_ABI sceGnmMapComputeQueueWithPriority(
uint32_t pipe_id, uint32_t queue_id, uintptr_t ring_base_addr,
uint32_t ring_size_dw, uint32_t* read_ptr_addr, uint32_t pipePriority);
Maps a compute queue with an explicit priority level.
sceGnmUnmapComputeQueue¶
Unmaps a previously mapped compute queue.
VGT / Wave Control¶
Functions that configure the Vertex Grouper / Tessellator (VGT) and shader-wave scheduling.
sceGnmResetVgtControl¶
Resets VGT control registers to their default state.
sceGnmSetVgtControl¶
int32_t PS4_SYSV_ABI sceGnmSetVgtControl(uint32_t* cmdbuf, uint32_t size,
uint32_t prim_group_sz_minus_one,
uint32_t partial_vs_wave_mode,
uint32_t wd_switch_only_on_eop_mode);
Configures VGT primitive-group size and wave-dispatch modes.
sceGnmSetWaveLimitMultiplier¶
Retail stub — sets the global wave-limit multiplier.
sceGnmSetWaveLimitMultipliers¶
Retail stub — sets per-pipe wave-limit multipliers.
sceGnmSetSpiEnableSqCounters¶
Retail stub — enables SQ performance counters via the SPI block.
sceGnmSetSpiEnableSqCountersForUnitInstance¶
Retail stub — enables SQ counters for a specific unit/instance.
Validation¶
Functions for command-buffer validation. On devkits these perform runtime checks; on retail they are stubs.
sceGnmValidateCommandBuffers¶
Retail stub — validates draw and constant command buffers before submission.
sceGnmValidateDisableDiagnostics¶
Retail stub — disables validation diagnostics.
sceGnmValidateDisableDiagnostics2¶
Retail stub — disables validation diagnostics (variant 2).
sceGnmValidateDispatchCommandBuffers¶
Retail stub — validates compute-dispatch command buffers.
sceGnmValidateDrawCommandBuffers¶
Retail stub — validates draw command buffers.
sceGnmValidateGetDiagnosticInfo¶
Retail stub — retrieves detailed validation diagnostic information.
sceGnmValidateGetDiagnostics¶
Retail stub — retrieves validation diagnostics.
sceGnmValidateGetVersion¶
Retail stub — returns the validation engine version.
sceGnmValidateOnSubmitEnabled¶
Returns true if on-submit validation is enabled.
sceGnmValidateResetState¶
Retail stub — resets the validation engine state.
sceGnmValidationRegisterMemoryCheckCallback¶
Retail stub — registers a memory-check callback for validation.
Resource Registration¶
Functions for registering GPU resources (buffers, textures, etc.) with the driver for tracking, debugging, and validation.
sceGnmFindResourcesPublic¶
Retail stub — finds publicly registered resources.
sceGnmFindResources¶
Retail stub — finds registered resources.
sceGnmGetResourceBaseAddressAndSizeInBytes¶
Retail stub — retrieves a resource's base address and size.
sceGnmGetResourceName¶
Retail stub — retrieves a resource's name string.
sceGnmGetResourceRegistrationBuffers¶
Retail stub — retrieves the resource-registration buffer pointers.
sceGnmGetResourceShaderGuid¶
Retail stub — retrieves a resource's shader GUID.
sceGnmGetResourceType¶
Retail stub — retrieves a resource's type.
sceGnmGetResourceUserData¶
Retail stub — retrieves a resource's user-data pointer.
sceGnmQueryResourceRegistrationUserMemoryRequirements¶
Retail stub — queries the memory requirements for resource-registration user memory.
sceGnmRegisterGdsResource¶
Retail stub — registers a GDS (Global Data Share) resource.
sceGnmRegisterOwner¶
Registers a resource owner (e.g. a process or context) with the driver.
sceGnmRegisterOwnerForSystem¶
Retail stub — registers a system-level resource owner.
sceGnmRegisterResource¶
int32_t PS4_SYSV_ABI sceGnmRegisterResource(void* res_handle,
void* owner_handle,
const void* addr, size_t size,
const char* name, int res_type,
uint64_t user_data);
Registers a GPU-accessible resource with the driver for tracking.
sceGnmSetResourceRegistrationUserMemory¶
Retail stub — sets user-memory buffers for resource registration.
sceGnmSetResourceUserData¶
Retail stub — sets user data on a registered resource.
sceGnmUnregisterAllResourcesForOwner¶
Retail stub — unregisters all resources belonging to an owner.
sceGnmUnregisterOwnerAndResources¶
Retail stub — unregisters an owner and all its resources.
sceGnmUnregisterResource¶
Retail stub — unregisters a single resource.
Workload Management¶
Functions for creating and managing workload streams, which group related command-buffer submissions.
sceGnmBeginWorkload¶
Begins a new workload within a workload stream. Returns a workload handle in *workload.
sceGnmCreateWorkloadStream¶
Creates a new workload stream. Returns a stream handle in *workload_stream.
sceGnmDestroyWorkloadStream¶
Retail stub — destroys a workload stream.
sceGnmEndWorkload¶
Ends a previously begun workload.
Event Queue¶
Functions for managing GPU event-queue (EQ) notifications.
sceGnmAddEqEvent¶
Adds an event to a kernel event queue. eq is an OrbisKernelEqueue (opaque void*).
sceGnmDeleteEqEvent¶
Deletes an event from a kernel event queue.
sceGnmGetEqEventType¶
Returns the event type from a kernel event object. ev is an OrbisKernelEvent (opaque void*).
sceGnmGetEqTimeStamp¶
Retail stub — retrieves the timestamp from an EQ event.
Thread Trace / Sqtt¶
Software Queue Thread Trace (Sqtt) functions for GPU profiling. All Sqtt functions in this header are retail stubs.
sceGnmInsertThreadTraceMarker¶
Retail stub — inserts a thread-trace marker into the command stream.
sceGnmSqttFini¶
Retail stub — finalises the Sqtt subsystem.
sceGnmSqttFinishTrace¶
Retail stub — finishes an in-progress trace.
sceGnmSqttGetBcInfo¶
Retail stub — retrieves block-compressor info from the trace.
sceGnmSqttGetGpuClocks¶
Retail stub — retrieves GPU clock snapshot from the trace.
sceGnmSqttGetHiWater¶
Retail stub — retrieves the high-water mark of the trace buffer.
sceGnmSqttGetStatus¶
Retail stub — retrieves the current Sqtt status.
sceGnmSqttGetTraceCounter¶
Retail stub — retrieves the trace counter value.
sceGnmSqttGetTraceWptr¶
Retail stub — retrieves the trace buffer write pointer.
sceGnmSqttGetWrapCounts¶
Retail stub — retrieves trace buffer wrap-around counts.
sceGnmSqttGetWrapCounts2¶
Retail stub — retrieves trace buffer wrap-around counts (variant 2).
sceGnmSqttGetWritebackLabels¶
Retail stub — retrieves writeback labels from the trace.
sceGnmSqttInit¶
Retail stub — initialises the Sqtt subsystem.
sceGnmSqttSelectMode¶
Retail stub — selects the Sqtt trace mode.
sceGnmSqttSelectTarget¶
Retail stub — selects the Sqtt trace target.
sceGnmSqttSelectTokens¶
Retail stub — selects which Sqtt token types to capture.
sceGnmSqttSetCuPerfMask¶
Retail stub — sets the CU performance mask for tracing.
sceGnmSqttSetDceEventWrite¶
Retail stub — configures DCE event-write tracing.
sceGnmSqttSetHiWater¶
Retail stub — sets the trace buffer high-water mark.
sceGnmSqttSetTraceBuffer2¶
Retail stub — sets the secondary trace buffer.
sceGnmSqttSetTraceBuffers¶
Retail stub — sets the primary and secondary trace buffers.
sceGnmSqttSetUserData¶
Retail stub — sets user-data tokens for the trace.
sceGnmSqttSetUserdataTimer¶
Retail stub — sets a timer for user-data token emission.
sceGnmSqttStartTrace¶
Retail stub — starts a thread trace.
sceGnmSqttStopTrace¶
Retail stub — stops an in-progress thread trace.
sceGnmSqttSwitchTraceBuffer¶
Retail stub — switches to the alternate trace buffer.
sceGnmSqttSwitchTraceBuffer2¶
Retail stub — switches to the alternate trace buffer (variant 2).
sceGnmSqttWaitForEvent¶
Retail stub — waits for an Sqtt event.
Performance Monitoring / Spm¶
Shader Performance Monitor (Spm) functions for hardware counter-based profiling. All Spm functions in this header are retail stubs.
sceGnmSpmEndSpm¶
Retail stub — ends Spm counter collection.
sceGnmSpmInit¶
Retail stub — initialises the Spm subsystem.
sceGnmSpmInit2¶
Retail stub — initialises the Spm subsystem (variant 2).
sceGnmSpmSetDelay¶
Retail stub — sets the Spm sampling delay.
sceGnmSpmSetMuxRam¶
Retail stub — sets the Spm mux RAM configuration.
sceGnmSpmSetMuxRam2¶
Retail stub — sets the Spm mux RAM configuration (variant 2).
sceGnmSpmSetSelectCounter¶
Retail stub — selects an Spm counter.
sceGnmSpmSetSpmSelects¶
Retail stub — sets Spm select registers.
sceGnmSpmSetSpmSelects2¶
Retail stub — sets Spm select registers (variant 2).
sceGnmSpmStartSpm¶
Retail stub — starts Spm counter collection.
Debugger¶
GPU debugger functions for hardware-level debugging (wavefront halting, GDS access, address watchpoints). All debugger functions in this header are retail stubs.
sceGnmDebugHardwareStatus¶
Retail stub — retrieves the current hardware debug status.
sceGnmDebugModuleReset¶
Retail stub — resets a debug module.
sceGnmDebugReset¶
Retail stub — resets the entire debug subsystem.
sceGnmDebuggerGetAddressWatch¶
Retail stub — retrieves an address-watchpoint configuration.
sceGnmDebuggerHaltWavefront¶
Retail stub — halts a wavefront for debugging.
sceGnmDebuggerReadGds¶
Retail stub — reads from the Global Data Share.
sceGnmDebuggerReadSqIndirectRegister¶
Retail stub — reads an SQ indirect register.
sceGnmDebuggerResumeWavefront¶
Retail stub — resumes a halted wavefront.
sceGnmDebuggerResumeWavefrontCreation¶
Retail stub — resumes wavefront creation.
sceGnmDebuggerSetAddressWatch¶
Retail stub — sets an address watchpoint.
sceGnmDebuggerWriteGds¶
Retail stub — writes to the Global Data Share.
sceGnmDebuggerWriteSqIndirectRegister¶
Retail stub — writes an SQ indirect register.
sceGnmGetDbgGcHandle¶
Retail stub — retrieves the graphics-compute debug handle.
Razor¶
Razor GPU profiler/debugger exports. All Razor functions in this header are retail stubs.
sceRazorCaptureCommandBuffersOnlyImmediate¶
Retail stub — triggers an immediate Razor capture of command buffers only.
sceRazorCaptureCommandBuffersOnlySinceLastFlip¶
Retail stub — triggers a Razor capture of command buffers since the last flip.
sceRazorCaptureImmediate¶
Retail stub — triggers an immediate Razor capture.
sceRazorCaptureSinceLastFlip¶
Retail stub — triggers a Razor capture of all work since the last flip.
sceRazorIsLoaded¶
Returns true if the Razor profiler is loaded.
Markers¶
Functions that insert debug markers into the command stream for profiling and debugging tools.
sceGnmInsertDingDongMarker¶
Inserts a ding-dong (compute-signal) marker into the command buffer.
sceGnmInsertPopMarker¶
Pops the current debug marker scope.
sceGnmInsertPushColorMarker¶
int32_t PS4_SYSV_ABI sceGnmInsertPushColorMarker(uint32_t* cmdbuf,
uint32_t size,
const char* marker,
uint32_t color);
Pushes a new coloured debug marker scope.
sceGnmInsertPushMarker¶
Pushes a new debug marker scope.
sceGnmInsertSetColorMarker¶
Retail stub — sets a coloured marker without pushing a scope.
sceGnmInsertSetMarker¶
Sets a debug marker without pushing a scope.
sceGnmInsertWaitFlipDone¶
int32_t PS4_SYSV_ABI sceGnmInsertWaitFlipDone(uint32_t* cmdbuf, uint32_t size,
int32_t vo_handle,
uint32_t buf_idx);
Inserts a wait-for-flip-completion command into the command buffer.
Coredump / Misc¶
Miscellaneous driver query and control functions.
sceGnmFlushGarlic¶
Flushes the Garlic (GPU-visible CPU) memory bus.
sceGnmGetCoredumpAddress¶
Retail stub — retrieves the GPU coredump buffer address.
sceGnmGetCoredumpMode¶
Retail stub — retrieves the current coredump mode.
sceGnmGetCoredumpProtectionFaultTimestamp¶
Retail stub — retrieves the timestamp of the last protection fault.
sceGnmGetDebugTimestamp¶
Retail stub — retrieves a debug timestamp.
sceGnmGetGpuBlockStatus¶
Retail stub — retrieves the GPU block status.
sceGnmGetGpuCoreClockFrequency¶
Returns the current GPU core clock frequency in Hz.
sceGnmGetGpuInfoStatus¶
Retail stub — retrieves the GPU info status.
sceGnmGetLastWaitedAddress¶
Retail stub — retrieves the last memory address the GPU waited on.
sceGnmGetNumTcaUnits¶
Retail stub — returns the number of TCA (Texture Cache Array) units.
sceGnmGetOffChipTessellationBufferSize¶
Retail stub — returns the off-chip tessellation buffer size.
sceGnmGetOwnerName¶
Retail stub — retrieves a resource owner's name.
sceGnmGetPhysicalCounterFromVirtualized¶
Retail stub — maps a virtualised performance counter to its physical index.
sceGnmGetProtectionFaultTimeStamp¶
Returns the timestamp of the last GPU protection fault.
sceGnmGetShaderProgramBaseAddress¶
Retail stub — retrieves the base address of a shader program.
sceGnmGetShaderStatus¶
Retail stub — retrieves the status of a shader program.
sceGnmGetTheTessellationFactorRingBufferBaseAddress¶
Returns the base address of the tessellation factor ring buffer.
sceGnmIsCoredumpValid¶
Retail stub — checks whether the current coredump is valid.
sceGnmRaiseUserExceptionEvent¶
Retail stub — raises a user exception event on the GPU.
Driver Internal¶
Internal driver interface retrieval and capture-control functions.
sceGnmDriverCaptureInProgress¶
Returns true if a driver capture is in progress.
sceGnmDriverInternalRetrieveGnmInterface¶
Retrieves the internal GNM interface function table.
sceGnmDriverInternalRetrieveGnmInterfaceForGpuDebugger¶
Retrieves the GNM interface function table for the GPU debugger.
sceGnmDriverInternalRetrieveGnmInterfaceForGpuException¶
Retrieves the GNM interface function table for GPU exception handling.
sceGnmDriverInternalRetrieveGnmInterfaceForHDRScopes¶
Retrieves the GNM interface function table for HDR scopes.
sceGnmDriverInternalRetrieveGnmInterfaceForReplay¶
Retrieves the GNM interface function table for replay.
sceGnmDriverInternalRetrieveGnmInterfaceForResourceRegistration¶
Retrieves the GNM interface function table for resource registration.
sceGnmDriverInternalRetrieveGnmInterfaceForValidation¶
Retrieves the GNM interface function table for validation.
sceGnmDriverInternalVirtualQuery¶
Retail stub — performs an internal virtual-memory query.
sceGnmDriverTraceInProgress¶
Returns true if a driver trace is in progress.
sceGnmDriverTriggerCapture¶
Retail stub — triggers a driver capture.
sceGnmRegisterGnmLiveCallbackConfig¶
Retail stub — registers a GNM live-callback configuration.
Logical CU / GPU PA¶
Functions for logical-to-physical compute-unit mapping and GPU Performance Analysis (PA) debug callbacks.
sceGnmGpuPaDebugEnter¶
Retail stub — enters a GPU PA debug session.
sceGnmGpuPaDebugLeave¶
Retail stub — leaves a GPU PA debug session.
sceGnmIsUserPaEnabled¶
Returns true if user performance analysis is enabled.
sceGnmLogicalCuIndexToPhysicalCuIndex¶
Retail stub — converts a logical CU index to a physical CU index.
sceGnmLogicalCuMaskToPhysicalCuMask¶
Converts a logical CU bitmask to a physical CU bitmask.
sceGnmLogicalTcaUnitToPhysical¶
Retail stub — converts a logical TCA unit to a physical TCA unit.
sceGnmPaDisableFlipCallbacks¶
Retail stub — disables PA flip callbacks.
sceGnmPaEnableFlipCallbacks¶
Retail stub — enables PA flip callbacks.
sceGnmPaHeartbeat¶
Retail stub — sends a PA heartbeat signal.
Mip Stats¶
Functions for per-mip-level statistics reporting.
sceGnmDisableMipStatsReport¶
Retail stub — disables mip-level statistics reporting.
sceGnmRequestMipStatsReportAndReset¶
Retail stub — requests a mip-stats report and resets counters.
sceGnmSetupMipStatsReport¶
Retail stub — sets up mip-level statistics reporting.
NID-only Stubs¶
The following functions are exported by the gnmdriver module but have no publicly known names — they are referenced only by their NID (a 64-bit hash of the symbol name). They are all retail stubs with void parameter lists.
| NID Symbol | Signature |
|---|---|
Func_063D065A2D6359C3 |
int PS4_SYSV_ABI Func_063D065A2D6359C3(void); |
Func_0CABACAFB258429D |
int PS4_SYSV_ABI Func_0CABACAFB258429D(void); |
Func_150CF336FC2E99A3 |
int PS4_SYSV_ABI Func_150CF336FC2E99A3(void); |
Func_17CA687F9EE52D49 |
int PS4_SYSV_ABI Func_17CA687F9EE52D49(void); |
Func_1870B89F759C6B45 |
int PS4_SYSV_ABI Func_1870B89F759C6B45(void); |
Func_26F9029EF68A955E |
int PS4_SYSV_ABI Func_26F9029EF68A955E(void); |
Func_301E3DBBAB092DB0 |
int PS4_SYSV_ABI Func_301E3DBBAB092DB0(void); |
Func_30BAFE172AF17FEF |
int PS4_SYSV_ABI Func_30BAFE172AF17FEF(void); |
Func_3E6A3E8203D95317 |
int PS4_SYSV_ABI Func_3E6A3E8203D95317(void); |
Func_40FEEF0C6534C434 |
int PS4_SYSV_ABI Func_40FEEF0C6534C434(void); |
Func_416B9079DE4CBACE |
int PS4_SYSV_ABI Func_416B9079DE4CBACE(void); |
Func_4774D83BB4DDBF9A |
int PS4_SYSV_ABI Func_4774D83BB4DDBF9A(void); |
Func_50678F1CCEEB9A00 |
int PS4_SYSV_ABI Func_50678F1CCEEB9A00(void); |
Func_54A2EC5FA4C62413 |
int PS4_SYSV_ABI Func_54A2EC5FA4C62413(void); |
Func_5A9C52C83138AE6B |
int PS4_SYSV_ABI Func_5A9C52C83138AE6B(void); |
Func_5D22193A31EA1142 |
int PS4_SYSV_ABI Func_5D22193A31EA1142(void); |
Func_725A36DEBB60948D |
int PS4_SYSV_ABI Func_725A36DEBB60948D(void); |
Func_8021A502FA61B9BB |
int PS4_SYSV_ABI Func_8021A502FA61B9BB(void); |
Func_9D002FE0FA40F0E6 |
int PS4_SYSV_ABI Func_9D002FE0FA40F0E6(void); |
Func_9D297F36A7028B71 |
int PS4_SYSV_ABI Func_9D297F36A7028B71(void); |
Func_A2D7EC7A7BCF79B3 |
int PS4_SYSV_ABI Func_A2D7EC7A7BCF79B3(void); |
Func_AA12A3CB8990854A |
int PS4_SYSV_ABI Func_AA12A3CB8990854A(void); |
Func_ADC8DDC005020BC6 |
int PS4_SYSV_ABI Func_ADC8DDC005020BC6(void); |
Func_B0A8688B679CB42D |
int PS4_SYSV_ABI Func_B0A8688B679CB42D(void); |
Func_B489020B5157A5FF |
int PS4_SYSV_ABI Func_B489020B5157A5FF(void); |
Func_BADE7B4C199140DD |
int PS4_SYSV_ABI Func_BADE7B4C199140DD(void); |
Func_C4C328B7CF3B4171 |
int PS4_SYSV_ABI Func_C4C328B7CF3B4171(void); |
Func_D1511B9DCFFB3DD9 |
int PS4_SYSV_ABI Func_D1511B9DCFFB3DD9(void); |
Func_D53446649B02E58E |
int PS4_SYSV_ABI Func_D53446649B02E58E(void); |
Func_D8B6E8E28E1EF0A3 |
int PS4_SYSV_ABI Func_D8B6E8E28E1EF0A3(void); |
Func_D93D733A19DD7454 |
int PS4_SYSV_ABI Func_D93D733A19DD7454(void); |
Func_DE995443BC2A8317 |
int PS4_SYSV_ABI Func_DE995443BC2A8317(void); |
Func_DF6E9528150C23FF |
int PS4_SYSV_ABI Func_DF6E9528150C23FF(void); |
Func_ECB4C6BA41FE3350 |
int PS4_SYSV_ABI Func_ECB4C6BA41FE3350(void); |
Func_1C43886B16EE5530 |
int PS4_SYSV_ABI Func_1C43886B16EE5530(void); |
Func_81037019ECCD0E01 |
int PS4_SYSV_ABI Func_81037019ECCD0E01(void); |
Func_BFB41C057478F0BF |
int PS4_SYSV_ABI Func_BFB41C057478F0BF(void); |
Func_E51D44DB8151238C |
int PS4_SYSV_ABI Func_E51D44DB8151238C(void); |
Func_F916890425496553 |
int PS4_SYSV_ABI Func_F916890425496553(void); |
sceGnmDriver* Packet Builders¶
Internal PM4 packet-builder wrappers. On Orbis these delegate to the firmware's sceGnm* functions. On the generic (non-Orbis) build path they emit PM4 packets directly. These match the original driver.h API surface and are called by drawcommandbuffer.c.
sceGnmDriverDrawInitDefaultHardwareState350¶
Emits the GFX 3.50 default-hardware-state init packet into cmd.
sceGnmDriverDrawIndex¶
int32_t sceGnmDriverDrawIndex(
uint32_t* cmd, uint32_t numdwords, uint32_t indexcount,
const void* indexaddr, SceGnmDrawFlags flags
);
Builds an indexed-draw PM4 packet.
sceGnmDriverDrawIndexAuto¶
int32_t sceGnmDriverDrawIndexAuto(
uint32_t* cmd, uint32_t numdwords, uint32_t indexcount,
SceGnmDrawFlags flags
);
Builds an auto-indexed-draw PM4 packet.
sceGnmDriverDrawIndexIndirect¶
int32_t sceGnmDriverDrawIndexIndirect(
uint32_t* cmd, uint32_t numdwords, uint32_t dataoffset, uint32_t stage,
uint8_t vertexoffusgpr, uint8_t instanceoffusgpr, SceGnmDrawFlags flags
);
Builds an indirect-indexed-draw PM4 packet.
sceGnmDriverDrawIndirect¶
int32_t sceGnmDriverDrawIndirect(
uint32_t* cmd, uint32_t numdwords, uint32_t dataoffset, uint32_t stage,
uint8_t vertexoffusgpr, uint8_t instanceoffusgpr, SceGnmDrawFlags flags
);
Builds an indirect (non-indexed) draw PM4 packet.
sceGnmDriverDrawIndexIndirectMulti¶
int32_t sceGnmDriverDrawIndexIndirectMulti(
uint32_t* cmd, uint32_t numdwords, uint32_t dataoffset, uint32_t maxcount,
uint32_t stage, uint8_t vertexoffusgpr, uint8_t instanceoffusgpr,
SceGnmDrawFlags flags
);
Builds a multi-indirect-indexed-draw PM4 packet.
sceGnmDriverDrawIndirectMulti¶
int32_t sceGnmDriverDrawIndirectMulti(
uint32_t* cmd, uint32_t numdwords, uint32_t dataoffset, uint32_t maxcount,
uint32_t stage, uint8_t vertexoffusgpr, uint8_t instanceoffusgpr,
SceGnmDrawFlags flags
);
Builds a multi-indirect (non-indexed) draw PM4 packet.
sceGnmDriverDrawIndexIndirectCountMulti¶
int32_t sceGnmDriverDrawIndexIndirectCountMulti(
uint32_t* cmd, uint32_t numdwords, uint32_t dataoffset, uint32_t maxcount,
uint64_t countaddr, uint32_t stage, uint8_t vertexoffusgpr,
uint8_t instanceoffusgpr, SceGnmDrawFlags flags
);
Builds a count-multi-indirect-indexed-draw PM4 packet.
sceGnmDriverSetVsShader¶
int32_t sceGnmDriverSetVsShader(
uint32_t* cmd, uint32_t numdwords, const void* vsregs,
uint32_t shadermodifier
);
Builds a vertex-shader bind PM4 packet.
sceGnmDriverSetPsShader¶
Builds a pixel-shader bind PM4 packet.
sceGnmDriverSetPsShader350¶
Builds a pixel-shader bind PM4 packet (GFX 3.50 layout).
sceGnmDriverSetEmbeddedVsShader¶
int32_t sceGnmDriverSetEmbeddedVsShader(
uint32_t* cmd, uint32_t numdwords, int32_t shaderid, uint32_t shadermodifier
);
Binds an embedded (built-in) vertex shader. Uses runtime HLE detection:
on real hardware, emits the PM4 register-write sequence locally using the
embedded fullscreen VS register blob and pads with PKT3_NOP (avoids the
FW 9.00 crash in firmware shader-set helpers); on HLE emulators, forwards
to sceGnmSetEmbeddedVsShader. Only GNM_EMBEDDED_VSH_FULLSCREEN is
supported; any other ID returns GNM_ERROR_INTERNAL_FAILURE. The
shadermodifier encodes the fetch shader configuration (see
sceGnmVsRegsSetFetchShaderModifier).
sceGnmDriverSetEmbeddedPsShader¶
Binds an embedded (built-in) pixel shader. Uses runtime HLE detection:
on real hardware, emits the PM4 register-write sequence locally using the
embedded dummy PS register blob (standard or RG32 variant by ID) and pads
the reserved 40-dword space with PKT3_NOP (avoids the FW 9.00 crash in
firmware shader-set helpers); on HLE emulators, forwards to
sceGnmSetEmbeddedPsShader. Supports GNM_EMBEDDED_PSH_DUMMY and
GNM_EMBEDDED_PSH_DUMMY_RG32; any other ID returns
GNM_ERROR_INTERNAL_FAILURE.
sceGnmDriverInsertWaitFlipDone¶
int32_t sceGnmDriverInsertWaitFlipDone(
uint32_t* cmd, uint32_t numdwords, int32_t videohandle,
uint32_t displaybufidx
);
Builds a wait-for-flip-done PM4 packet.
See Also¶
- GPU Address API — surface tiling, decompression, and address computation
- Helpers API — direct memory, VideoOut, texture/render-target creation, shader metadata
- API Index — complete function listing across all headers