Driver Commands

Enums

enum class DriverBackgroundProcessingMode : uint32_t

Values:

enumerator ALLOWED
enumerator ALLOW_INTRUSIVE_MEASUREMENTS
enumerator DISABLE_BACKGROUND_WORK
enumerator DISABLE_PROFILING_BY_SYSTEM
enumerator KEEP_CURRENT
enum class DriverMeasurementsAction : uint32_t

Values:

enumerator KEEP_ALL
enumerator COMMIT_RESULTS
enumerator COMMIT_RESULTS_HIGH_PRIORITY
enumerator DISCARD_PREVIOUS
enum class Drv3dCommand

Values:

enumerator GETVISIBILITYBEGIN
enumerator GETVISIBILITYEND
enumerator GETVISIBILITYCOUNT
enumerator RELEASE_QUERY
enumerator ACQUIRE_OWNERSHIP

acquire/release D3D lock (to perform rendering in non-primary thread)

enumerator RELEASE_OWNERSHIP
enumerator ACQUIRE_LOADING

acquire/release a mutex to perform resource loading in non-primary thread and postpone GPU resets, the lock is nonexclusive.

enumerator RELEASE_LOADING
enumerator GET_GPU_FRAME_TIME
enumerator GET_VSYNC_REFRESH_RATE
enumerator ASYNC_PIPELINE_COMPILE_RANGE_BEGIN
enumerator ASYNC_PIPELINE_COMPILE_RANGE_END
enumerator GET_PIPELINE_COMPILATION_QUEUE_LENGTH
enumerator ASYNC_PIPELINE_COMPILATION_FEEDBACK_BEGIN
enumerator ASYNC_PIPELINE_COMPILATION_FEEDBACK_END
enumerator TIMESTAMPFREQ
enumerator TIMESTAMPISSUE
enumerator TIMESTAMPGET
enumerator TIMESTAMP_FLIP_STALL_ISSUE

Gets timestamp queries to measure gpu stalls on backbuffer flip waits.

enumerator TIMESTAMP_FLIP_STALL_RELEASE

Releases timestamp issued with TIMESTAMP_FLIP_STALL_ISSUE.

enumerator TIMECLOCKCALIBRATION

Gets CPU and GPU time nearly at the same moment.

enumerator FLUSH_STATES
enumerator D3D_FLUSH
enumerator GPU_BARRIER_WAIT_ALL_COMMANDS
enumerator COMPILE_PIPELINE

flush pipeline states to compile pipeline

enumerator GET_SECONDARY_BACKBUFFER
enumerator GET_VENDOR
enumerator OVERRIDE_MAX_ANISOTROPY_LEVEL
enumerator MAKE_TEXTURE
enumerator GET_TEXTURE_HANDLE
enumerator BEGIN_EXTERNAL_ACCESS
enumerator END_EXTERNAL_ACCESS
enumerator SET_VS_DEBUG_INFO
enumerator SET_PS_DEBUG_INFO
enumerator SET_CS_DEBUG_INFO
enumerator BEGIN_MRT_CLEAR_SEQUENCE
enumerator END_MRT_CLEAR_SEQUENCE
enumerator GET_SHADER_CACHE_UUID
enumerator AFTERMATH_MARKER
enumerator START_CAPTURE_FRAME
enumerator IS_HDR_AVAILABLE
enumerator IS_HDR_ENABLED
enumerator INT10_HDR_BUFFER
enumerator HDR_OUTPUT_MODE
enumerator HDR_HEADROOM
enumerator GET_LUMINANCE
enumerator MEM_STAT
enumerator REGISTER_SHADER_DUMP
enumerator GET_SHADER
enumerator PIX_GPU_BEGIN_CAPTURE
enumerator PIX_GPU_END_CAPTURE
enumerator PIX_GPU_CAPTURE_NEXT_FRAMES
enumerator PIX_GPU_CAPTURE_AFTER_LONG_FRAMES
enumerator GET_FRAMERATE_LIMITING_FACTOR
enumerator LOAD_PIPELINE_CACHE
enumerator SAVE_PIPELINE_CACHE
enumerator GET_STREAMLINE
enumerator GET_DLSS
enumerator GET_XESS_STATE
enumerator IS_XESS_QUALITY_AVAILABLE_AT_RESOLUTION
enumerator GET_XESS_RESOLUTION
enumerator GET_XESS_VERSION
enumerator EXECUTE_DLSS_NO_STREAMLINE
enumerator EXECUTE_DLSS
enumerator EXECUTE_DLSS_G
enumerator EXECUTE_XESS
enumerator SET_XESS_VELOCITY_SCALE
enumerator GET_XESS_SUPPORTED_GEN_FRAMES
enumerator GET_XESS_PRESENTED_FRAME_COUNT
enumerator GET_XESS_FG_ENABLED
enumerator XESS_ENABLE_FG
enumerator XESS_SUPPRESS_FG
enumerator XESS_SCHEDULE_GEN_FRAME
enumerator EXECUTE_FSR
enumerator EXECUTE_FSR_FG
enumerator EXECUTE_FSR2
enumerator GET_FSR2_STATE
enumerator GET_FSR2_RESOLUTION
enumerator EXECUTE_PSSR
enumerator GET_METALFX_UPSCALE_STATE
enumerator EXECUTE_METALFX_UPSCALE
enumerator GET_TIMINGS
enumerator GET_RAYTRACE_ACCELERATION_STRUCTURES_MEMORY_USAGE
enumerator DEBUG_MESSAGE
enumerator GET_MONITORS
enumerator GET_MONITOR_INFO
enumerator GET_RESOLUTIONS_FROM_MONITOR
enumerator GET_VIDEO_MEMORY_BUDGET

Returns video memory budget in KiByte values par1: pointer to uint32_t: Total memory budget on the device, possibly less than physical memory of the device par2: pointer to uint32_t: Free memory budget on the device, this is *par1 minus used memory par3: pointer to uint32_t: Used memory, this is *par1 minus *par2 Return: uint32_t: Physical memory of the device

enumerator GET_RENDERING_COMMAND_QUEUE
enumerator GET_INSTANCE
enumerator GET_PHYSICAL_DEVICE
enumerator GET_QUEUE_FAMILY_INDEX
enumerator GET_QUEUE_INDEX
enumerator PROCESS_APP_INACTIVE_UPDATE
enumerator BEGIN_GENERIC_RENDER_PASS_CHECKS
enumerator END_GENERIC_RENDER_PASS_CHECKS
enumerator REGISTER_FRAME_COMPLETION_EVENT
enumerator REGISTER_ONE_TIME_FRAME_EXECUTION_EVENT_CALLBACKS
enumerator REPORT_RESOURCE_STATE_TRANSITIONS
enumerator REGISTER_DEVICE_RESET_EVENT_HANDLER
enumerator UNREGISTER_DEVICE_RESET_EVENT_HANDLER
enumerator PREPARE_TEXTURES_FOR_VR_CONSUMPTION
enumerator SET_APP_INFO
enumerator SEND_GPU_CRASH_DUMP
enumerator PROCESS_PENDING_RESOURCE_UPDATED
enumerator GET_PS5_PSSR_STATUS
enumerator SET_FREQ_LEVEL
enumerator ENABLE_IMMEDIATE_FLUSH
enumerator DISABLE_IMMEDIATE_FLUSH
enumerator GET_WORKER_CPU_CORE
enumerator SET_PS5_FSR_VIEW
enumerator SET_HDR
enumerator DEBUG_BREAK
enumerator ADD_DEBUG_BREAK_STRING_SEARCH
enumerator REMOVE_DEBUG_BREAK_STRING_SEARCH
enumerator IS_DEFRAG_REQUESTED
enumerator PROCESS_PENDING_DEFRAG_REQUESTS
enumerator CONVERT_TLAS_INSTANCES
enumerator COMPILE_PIPELINE_SET
enumerator PAUSE_PIPELINE_SET_COMPILATION
enumerator GET_BUFFER_GPU_ADDRESS
enumerator ENABLE_WORKER_LOW_LATENCY_MODE
enumerator DRIVER_BACKGROUND_PROCESSING_MODE
enumerator LOGERR_ON_SYNC
enumerator SET_DRIVER_NETWORD_MANAGER
enumerator GET_CONSOLE_HFR_STATUS
enumerator GET_CONSOLE_HFR_SUPPORTED
enumerator GET_RESOURCE_STATISTICS
enumerator GET_PS5_COMPACTED_BLAS_SIZE
enumerator COMPACT_BLAS
enumerator CREATE_GPU_LATENCY
enumerator DELAY_SYNC
enumerator CONTINUE_SYNC
enumerator COMPLETE_SYNC
enumerator CHANGE_QUEUE
enumerator IS_PIX_CAPTURE_LOADED
enumerator SET_RT_VALIDATION_CALLBACK
enumerator CAUSE_GPU_PAGE_FAULT
enumerator SET_COMPUTE_ON_RAY_TRACE_SHADER_BINDING_TABLE_CONST_BUFFER

This command set a driver internal const buffer to a a slot of a pipeline stage with the shader binding table data of the given compute program. The provided data will be provided as raytrace::RayDispatchGroupTableSet defines it. To help with padding with constant buffers, the provided buffer is aligned to the 256 byte boundary and padded with zeros. This makes it easier to copy the table as a series of uint4’s (table is 26 uints, so 7 uint4s with padding) into argument buffers. This command will activate a override for the given const buffer slot, for the given shader stage, when the provided program is a compute program that uses the RayGen on CS mode, otherwise it will deactivate previous overrides of that slot. When the override is disabled, the originally set buffer will be used again. When an override is activated, it will remain active until it was deactivated, as described above. param1: uintptr_t: Stage: valid values are STAGE_VS, STAGE_PS or STAGE_CS. param2: uintptr_t: Slot: any valid const buffer slot index. param3: uintptr_t: Program: any compute program that uses the RayGen as CS mode, or BAD_PROGRAM.

enumerator SET_PRESENT_ASYNC_MODE

Set how the d3d::update_screen behaves in manner of syncronisation. param1: bool*: AsyncMode: If true then the d3d::update_screen and the underlying present call can execute asynchronously. If false then the d3d::update_screen will wait to the present return. If the param1 is nullptr, then reset the behavior to the default. On DX11 the default is the false case, on other drivers e.g. DX12 the true case is the default. Currently it is implemented in DX12 driver.

enumerator SET_GPU_POSTMORTEM_DATA_TRACE_ENABLED
enumerator UNLOAD_SHADER_MEMORY
enumerator REPORT_BINDLESS_HEAP_ALLOCATION_STATUS_TO_DEBUG_LOG
enumerator REPORT_BINDLESS_HEAP_SLOT_STATUS_TO_DEBUG_LOG
enumerator SONY_ATTACH_CRASH_DUMP_INFO
enumerator PIPELINE_STATS_BEGIN
enumerator PIPELINE_STATS_END
enumerator PIPELINE_STATS_RASTERIZED_PRIMITIVES
enumerator PIPELINE_STATS_CREATE_QUERY
enumerator PIPELINE_STATS_RELEASE_QUERY
enumerator USER

Values:

enumerator DRV3D_CPU_FREQ_TYPE_QPC
enumerator DRV3D_CPU_FREQ_TYPE_REF
enumerator DRV3D_CPU_FREQ_NSEC
enumerator DRV3D_CPU_FREQ_TYPE_PROFILE
enumerator DRV3D_CPU_FREQ_TYPE_UNKNOWN
struct FrameEvents
#include <dag_commands.h>

Public Functions

virtual ~FrameEvents() = default
virtual void beginFrameEvent() = 0
virtual void endFrameEvent() = 0
struct DeviceResetEventHandler
#include <dag_commands.h>

Public Functions

virtual ~DeviceResetEventHandler() = default
virtual void preRecovery() = 0
virtual void recovery() = 0
struct Drv3dTimings
#include <dag_commands.h>

Public Members

long long frontendUpdateScreenInterval
long long frontendToBackendUpdateScreenLatency
long long frontendBackendWaitDuration
long long backendFrontendWaitDuration
long long gpuWaitDuration
long long presentDuration
long long backbufferAcquireDuration
long long frontendWaitForSwapchainDuration
struct CompilePipelineSet
#include <dag_commands.h>

All values are optional, but graphics and mesh pipelines can not be created without output and render state sets.

Public Members

const char *defaultFormat

V1 and V2 value. When not specified, the driver assumes its driver specific format (if supported) and otherwise engine.

const DataBlock *featureSet

V1 and V2 block. A block with a set of feature sets referenced by pipelines in the pipeline sets to indicate required features.

const DataBlock *inputLayoutSet

V1 and V2 block. A block with a set of blocks describing input layouts.

const DataBlock *renderStateSet

V1 and V2 block. A block with a set of blocks describing render states. The driver will ignore render states that are incompatible with the system.

const DataBlock *outputFormatSet

V1 and V2 block. A block with a set of blocks describing output format states. The driver will ignore output format states that are incompatible wit the system.

const DataBlock *graphicsPipelineSet

V1 block. A block with a set of blocks describing graphics pipelines. The driver will ignore pipelines using unsupported input layouts, render states or output formats.

const DataBlock *meshPipelineSet

V1 block. A block with a set of blocks describing mesh pipelines. The driver will ignore pipelines using unsupported render states or output formats.

const DataBlock *computePipelineSet

V1 block. A block with a set of blocks describing compute pipelines.

const DataBlock *signature

V2 block, this block stores shader class signatures, this ensures we try not to load incompatible shader class uses.

const DataBlock *computeSet

V2 block, new compute use set, uses shader class names and codes.

const DataBlock *graphicsSet

V2 block, new graphics use set, uses shader class names and codes.

const DataBlock *graphicsNullPixelOverrideSet

V2 block, new graphics use set, uses shader class names and codes. This set has pipelines where the paired pixel shader is replaced by the null pixel shader.

const DataBlock *graphicsPixelOverrideSet

V2 block, new graphics use set, uses shader class names and codes. This set has pipelines where the paired pixel shader uses a differen shader class name and codes than the vertex shader.

struct Drv3dMakeTextureParams
#include <dag_commands.h>

Public Members

void *tex
const char *name
int flg
int w
int h
int layers
int mips
ResourceBarrier currentState
namespace d3d

Functions

int driver_command(Drv3dCommand command, void *par1 = nullptr, void *par2 = nullptr, void *par3 = nullptr)

send specific command to driver