D3DKMTSetAllocationPriority 函数 (d3dkmthk.h)
D3DKMTSetAllocationPriority 函数设置资源或分配列表的优先级。
语法
NTSTATUS D3DKMTSetAllocationPriority(
[in] const D3DKMT_SETALLOCATIONPRIORITY *unnamedParam1
);
参数
[in] unnamedParam1
指向 D3DKMT_SETALLOCATIONPRIORITY 结构的指针,其中包含用于设置资源或分配列表优先级的信息。
返回值
D3DKMTSetAllocationPriority 返回以下值之一:
返回代码 | 描述 |
---|---|
STATUS_SUCCESS | 已成功设置分配的优先级。 |
STATUS_DEVICE_REMOVED | 图形适配器已停止或显示设备已重置。 |
STATUS_INVALID_PARAMETER | 参数已验证并确定不正确。 |
此函数还可以返回其他 NTSTATUS 值。
言论
下面的代码示例演示了 OpenGL ICD 如何使用 D3DKMTSetAllocationPriority 设置资源优先级(因此与资源关联的所有分配)。
VOID SetResourcePriority(D3DKMT_HANDLE hDevice, D3DKMT_HANDLE hResource, UINT uiPriority)
{
D3DKMT_SETALLOCATIONPRIORITY SetAllocationPriorityData;
SetAllocationPriorityData.hDevice = hDevice;
SetAllocationPriorityData.hResource = hResource;
SetAllocationPriorityData.phAllocationList = NULL;
SetAllocationPriorityData.AllocationCount = 0;
SetAllocationPriorityData.Priorities = &uiPriority;
(*pfnKTSetAllocationPriority)(&SetAllocationPriorityData);
}
要求
要求 | 价值 |
---|---|
最低支持的客户端 | Windows Vista |
目标平台 | 普遍 |
标头 | d3dkmthk.h (包括 D3dkmthk.h) |
库 | Gdi32.lib |
DLL | Gdi32.dll |