排除延迟上下文的 DDI 函数
本部分仅适用于 Windows 7 及更高版本以及 Windows Server 2008 R2 及更高版本的 Windows 操作系统。
当 Microsoft Direct3D 运行时调用用户模式显示驱动程序的 CreateDeferredContext 函数来创建延迟上下文时,驱动程序会提供运行时可为该延迟上下文调用的函数。 驱动程序填充 D3D11DDIARG_CREATEDEFERREDCONTEXT 结构的 p11ContextFuncs 成员指向 的 D3D11DDI_DEVICEFUNCS 结构的成员。 驱动程序仅为延迟上下文提供函数子集,就像驱动程序为即时上下文提供函数子集一样。
驱动程序通过将 D3D11DDI_DEVICEFUNCS 或 D3D11_1DDI_DEVICEFUNCS 的以下成员设置为 NULL 来排除延迟上下文的许多函数:
typedef struct D3D11DDI_DEVICEFUNCS {
...
PFND3D10DDI_RESOURCEMAP pfnStagingResourceMap;
PFND3D10DDI_RESOURCEUNMAP pfnStagingResourceUnmap;
PFND3D10DDI_QUERYGETDATA pfnQueryGetData;
PFND3D10DDI_FLUSH pfnFlush;
PFND3D10DDI_RESOURCEMAP pfnResourceMap;
PFND3D10DDI_RESOURCEUNMAP pfnResourceUnmap;
PFND3D10DDI_RESOURCEISSTAGINGBUSY pfnResourceIsStagingBusy;
PFND3D11DDI_CALCPRIVATERESOURCESIZE pfnCalcPrivateResourceSize;
PFND3D10DDI_CALCPRIVATEOPENEDRESOURCESIZE pfnCalcPrivateOpenedResourceSize;
PFND3D10DDI_OPENRESOURCE fnOpenResource;
PFND3D11DDI_CALCPRIVATESHADERRESOURCEVIEWSIZE pfnCalcPrivateShaderResourceViewSize;
PFND3D10DDI_CALCPRIVATERENDERTARGETVIEWSIZE pfnCalcPrivateRenderTargetViewSize;
PFND3D11DDI_CALCPRIVATEDEPTHSTENCILVIEWSIZE pfnCalcPrivateDepthStencilViewSize;
PFND3D10DDI_CALCPRIVATEELEMENTLAYOUTSIZE pfnCalcPrivateElementLayoutSize;
PFND3D10_1DDI_CALCPRIVATEBLENDSTATESIZE pfnCalcPrivateBlendStateSize;
PFND3D10DDI_CALCPRIVATEDEPTHSTENCILSTATESIZE pfnCalcPrivateDepthStencilStateSize;
PFND3D10DDI_CALCPRIVATERASTERIZERSTATESIZE pfnCalcPrivateRasterizerStateSize;
PFND3D10DDI_CALCPRIVATESHADERSIZE pfnCalcPrivateShaderSize;
PFND3D11DDI_CALCPRIVATEGEOMETRYSHADERWITHSTREAMOUTPUT pfnCalcPrivateGeometryShaderWithStreamOutput;
PFND3D10DDI_CALCPRIVATESAMPLERSIZE pfnCalcPrivateSamplerSize;
PFND3D10DDI_CALCPRIVATEQUERYSIZE pfnCalcPrivateQuerySize;
PFND3D10DDI_CHECKFORMATSUPPORT pfnCheckFormatSupport;
PFND3D10DDI_CHECKMULTISAMPLEQUALITYLEVELS pfnCheckMultisampleQualityLevels;
PFND3D10DDI_CHECKCOUNTERINFO pfnCheckCounterInfo;
PFND3D10DDI_CHECKCOUNTER pfnCheckCounter;
PFND3D11DDI_CHECKDEFERREDCONTEXTHANDLESIZES pfnCheckDeferredContextHandleSizes;
PFND3D11DDI_CALCDEFERREDCONTEXTHANDLESIZE pfnCalcDeferredContextHandleSize;
PFND3D11DDI_CALCPRIVATEDEFERREDCONTEXTSIZE pfnCalcPrivateDeferredContextSize;
PFND3D11DDI_CREATEDEFERREDCONTEXT pfnCreateDeferredContext;
PFND3D11DDI_CALCPRIVATECOMMANDLISTSIZE pfnCalcPrivateCommandListSize;
PFND3D11DDI_CALCPRIVATETESSELLATIONSHADERSIZE pfnCalcPrivateTessellationShaderSize;
PFND3D11DDI_CALCPRIVATEUNORDEREDACCESSVIEWSIZE pfnCalcPrivateUnorderedAccessViewSize;
PFND3D11DDI_SETRESOURCEMINLOD pfnSetResourceMinLOD;
} D3D11DDI_DEVICEFUNCS;
typedef struct D3D11_1DDI_DEVICEFUNCS {
...
PFND3D10DDI_RESOURCEMAP pfnStagingResourceMap;
PFND3D10DDI_RESOURCEUNMAP pfnStagingResourceUnmap;
PFND3D10DDI_QUERYGETDATA pfnQueryGetData;
PFND3D11_1DDI_FLUSH pfnFlush;
PFND3D10DDI_RESOURCEMAP pfnResourceMap;
PFND3D10DDI_RESOURCEUNMAP pfnResourceUnmap;
PFND3D10DDI_RESOURCEISSTAGINGBUSY pfnResourceIsStagingBusy;
PFND3D11DDI_CALCPRIVATERESOURCESIZE pfnCalcPrivateResourceSize;
PFND3D10DDI_CALCPRIVATEOPENEDRESOURCESIZE pfnCalcPrivateOpenedResourceSize;
PFND3D10DDI_OPENRESOURCE fnOpenResource;
PFND3D11DDI_CALCPRIVATESHADERRESOURCEVIEWSIZE pfnCalcPrivateShaderResourceViewSize;
PFND3D10DDI_CALCPRIVATERENDERTARGETVIEWSIZE pfnCalcPrivateRenderTargetViewSize;
PFND3D11DDI_CALCPRIVATEDEPTHSTENCILVIEWSIZE pfnCalcPrivateDepthStencilViewSize;
PFND3D10DDI_CALCPRIVATEELEMENTLAYOUTSIZE pfnCalcPrivateElementLayoutSize;
PFND3D11_1DDI_CALCPRIVATEBLENDSTATESIZE pfnCalcPrivateBlendStateSize;
PFND3D10DDI_CALCPRIVATEDEPTHSTENCILSTATESIZE pfnCalcPrivateDepthStencilStateSize;
PFND3D11_1DDI_CALCPRIVATERASTERIZERSTATESIZE pfnCalcPrivateRasterizerStateSize;
PFND3D11_1DDI_CALCPRIVATESHADERSIZE pfnCalcPrivateShaderSize;
PFND3D11_1DDI_CALCPRIVATEGEOMETRYSHADERWITHSTREAMOUTPUT pfnCalcPrivateGeometryShaderWithStreamOutput;
PFND3D10DDI_CALCPRIVATESAMPLERSIZE pfnCalcPrivateSamplerSize;
PFND3D10DDI_CALCPRIVATEQUERYSIZE pfnCalcPrivateQuerySize;
PFND3D10DDI_CHECKFORMATSUPPORT pfnCheckFormatSupport;
PFND3D10DDI_CHECKMULTISAMPLEQUALITYLEVELS pfnCheckMultisampleQualityLevels;
PFND3D10DDI_CHECKCOUNTERINFO pfnCheckCounterInfo;
PFND3D10DDI_CHECKCOUNTER pfnCheckCounter;
PFND3D11DDI_CHECKDEFERREDCONTEXTHANDLESIZES pfnCheckDeferredContextHandleSizes;
PFND3D11DDI_CALCDEFERREDCONTEXTHANDLESIZE pfnCalcDeferredContextHandleSize;
PFND3D11DDI_CALCPRIVATEDEFERREDCONTEXTSIZE pfnCalcPrivateDeferredContextSize;
PFND3D11DDI_CREATEDEFERREDCONTEXT pfnCreateDeferredContext;
PFND3D11DDI_CALCPRIVATECOMMANDLISTSIZE pfnCalcPrivateCommandListSize;
PFND3D11_1DDI_CALCPRIVATETESSELLATIONSHADERSIZE pfnCalcPrivateTessellationShaderSize;
PFND3D11DDI_CALCPRIVATEUNORDEREDACCESSVIEWSIZE pfnCalcPrivateUnorderedAccessViewSize;
PFND3D11DDI_SETRESOURCEMINLOD pfnSetResourceMinLOD;
} D3D11DDI_DEVICEFUNCS;