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)
Library Gdi32.lib
DLL Gdi32.dll

另请参阅

D3DKMT_SETALLOCATIONPRIORITY