June 2006: Overview of Direct3D 10 Header and Behavior Updates

A series of API and behavioral changes have been implemented in the core Direct3D 10 and DXGI API's in Windows Vista Beta 2 (corresponding to the Direct3D 10 June 2006 Tech Preview). It is recommended that you review the list below before porting an application to the new API's.

Direct3D 10 applications developed against the April 2006 Tech Preview or earlier will need to make changes accordingly. The changes include:

Windows Vista Beta2改变了D3D10核心部分的一系列API接口行为以及DXGI的部分接口(与之对应的是D3D10 20066月技术预览中的说明)。我们推荐用户在使用新的API为程序重新编写接口前查看下文列出的要点。

20064月技术预览或者更早版本中规定有出入的D3D10程序需要做对应的改动。这些改动包括:

D3D10 Changes

API Changes:

  • The ID3D10Device::Enter and ID3D10Device::Leave methods to enter and leave the device's critical section have been moved onto the ID3D10Multithread interface which can be accessed via QueryInterface off of the device.

API 改变:

用以进入和离开device核心数据段ID3D10Device::EnterID3D10Device::Leave函数被移到了ID3D10Multithread接口中。ID3D10Multithread能够被ID3D10DeviceQueryInterface函数得到。

  • ID3D10Device::CheckMultisampleQualityLevels now takes a DXGI_FORMAT to specify the surface format. This allows multisample counts and quality levels to vary per-format for a device.

ID3D10Device::CheckMultisampleQualityLevels现在需要一个DXGI_FORMAT类型的参数来定义surface格式。对于一个device而言,每种surface格式的纹理多采样的数量和质量等级会各不相同。

  • All API's that take wide characters (wchar) have been converted to take char's.

所有使用宽字符(wchar)作为参数的API现在全部接受普通字符。

  • The ID3D10TextureCube resource type (and associated descriptors) has been removed. Cubemap textures are no longer a unique resource type at the API, but are rather a special-case of Texture2D-Array. When creating a shader resource view on the resource, a cubemap-specific descriptor must be provided (D3D10_TEXCUBE_SRV)

取消了ID3D10TextureCube资源类型(和相关的描述符)。Cubemap纹理在API中不再是一种单一的资源类型,但是可以作为一种特殊的2维纹理数组存在。在对资源创建Shader资源视图的时候必须提供一个定义cubemap的描述符(D3D10_TEXCUBE_SRV

  • The D3D10_SUBRESOURCE_UP structure was renamed to D3D10_SUBRESOURCE_DATA

D3D10_SUBRESOURCE_UP结构被重命名为D3D10_SUBRESOURCE_DATA

  • The CopySubresourceRegion, CopyResource, and UpdateSubresource methods have been moved onto the ID3D10Device interface. In multi-device scenarios, this clarifies which device is performing the operation on a shared resource.

CopySubresourceRegionCopyResourceUpdateSubresource函数被放在ID3D10Device接口中。在多设备的场景中,这些操作能够表示哪个设备在对共享资源做操作。

  • Multisample Resolve changes:
    • Resolve (downsample) of a multisampled resource is now explicit: it has been separated from the copy methods. Resolve is performed by calling ResolveSubresource on the device.
    • Get/SetMultisampleRemoveFormat has been removed (no longer needed with explicit resolve)

纹理多采样方式改动:

      对多采样资源向下采样方式现在明确了:它和资源复制函数区分开来,通过执行IDD3D10DeviceResolveSubresource函数实现。

      除去了Get/SetMultisampleRemoveFormat函数(有了明确方式之后就不再需要它们了)。

  • The data types for a D3D10_VIEWPORT have been changed to INT for TopLeftX and TopLeftY and changed to UINT for Width and Height. MinDepth and MaxDepth remain floats.

D3D10_VIEWPORT数据类型的TopLeftXTopLeftY类型改为INTWidthHeight类型改为UINTMinDepthMaxDepth还是float类型。

  • Resource View Creation: All resource view types (shader resource view, render target view, etc.) now have a unique enum defined listing what kinds of resource dimensions (i.e. texture2d vs texture3d, etc.) are valid for each view. In other words, D3D10_RESOURCE has been specialized for each description: D3D10_SRV_DIMENSION, D3D10_RTV_DIMENSION, etc.

资源视图创建:所有资源视图类型(Shader资源视图,RT资源视图等等)现在使用一个统一的enum定义,在定义视图时列出了资源所需的维数(比如texture2dtexture3d等等)是有效的。这就是说,D3D10_RESOURCE需要使用这些描述符描述:D3D10_SRV_DIMENSIOND3D10_RTV_DEMENSION等等。

  • Texture1D and 3D resources can no longer be created with multi-samples. The DXGI_SAMPLE_DESC has been removed from D3D10_TEXTURE1D_DESC.

Texture1DTexture3D纹理资源不能使用多采样形式创建。DXGI_SAMPLE_DESC已经从D3D10_TEXTURE1D_DESC中移除。

  • ID3D10StateMirror has been renamed ID3D10ShaderMirror. The corresponding device creation flag has changed from D3D10_CREATE_DEVICE_MIRROR_STATE to D3D10_CREATE_DEVICE_SHADER_MIRROR. Its GetDesc methods have been removed.

ID3D10StateMirror已经被重命名维ID3D10ShaderMirror。对应的设备创建标记符从D3D10_CREATE_DEVICE_MIRROR_STATE转化为D3D10_CREATE_DEVICE_SHADER_MIRROR.它的GetDesc函数已经被移除。

Syntax Removed

  • D3D10_VERTEX_CACHE_DESC and CheckVertexCache have been removed
  • D3D10_RESOURCE_MISC_COPY_DESTINATION has been removed. You no longer have to explicitly declare if a resource can be used as a destination for a Copy.

语法改动:

 

D3D10_VERTEX_CACHE_DESCCheckVertexCache已经被移除了。

D3D10_RESOURCE_MISC_COPY_DESTINATION被移除了。用户不需要对一个复制时能够作为目标对象的资源作出申明。

  • ID3D10Device::ClearState has been added
  • Syntax for MSAA readback in the shader: Texture2DMS and Texture2DMSArray view dimensions have been added, to support sample-by-sample readback of un-resolved MSAA resources in the pixel shader.
  • Syntax for shared resources (shared resources not yet available in Ref10)
    • The D3D10_RESOURCE_MISC_SHARED resource creation flag has been added to allow an application to create a resource that can be shared among multiple devices.
    • ID3D10Device::OpenSharedResource has been added.
  • ID3D10Query::GetDesc and ID3D10Counter::GetDesc have been added to retrieve counter and query creation descriptors

增加了ID3D10Device::ClearState函数

 

Shader中的MSAA读回语法:为了支持对未知MSAA资源采样到采样的读会操作,Texture2DMSTexture2DMSArray增加了视图维数参数。

 

共享资源语法(在D3D10Reference中,共享资源还没有支持)

      增加了D3D10_RESOURCE_MISC_SHARED资源创建标记用以允许程序创建可以被多个device共享的的资源。

      增加了ID3D10Device::OpenSharedResource函数

 

增加了ID3D10Query::GetDescID3D10Counter::GetDesc函数来获得计数值和查询创建描述符。

Minor Changes: the following changes should have minimal-to-no impact on an existing codebase.

  • API's that take size and pitch parameters for user data have had the parameters changed from SIZE_T to UINT.
  • The flags parameter for the Map() API has been renamed from Flags to MapFlags.
  • The flags parameter for the ID3D10Asynchronous::GetData() method has been renamed from Flags to GetDataFlags.
  • The flags parameter for the ClearDepthStencilView() method has been renamed from Flags to ClearFlags.
  • D3D10__GETDATA_DONOTFLUSH has been moved into the D3D10_ASYNC_GETDATA_FLAG enum and renamed to D3D10_ASYNC_GETDATA_DONOTFLUSH.
  • The D3D10_QUERY_MISCFLAG_PREDICATEHINT flag has been moved into the D3D10_QUERY_MISC_FLAG enum and renamed to D3D10_QUERY_MISC_PREDICATEHINT
  • The StartConstantSlot parameter in the __Get/__SetConstantBuffers and IAGet/IASetVertexBuffers methods have been renamed to Offset.
  • GenerateMips() previously returned an HRESULT. Now it returns a void.

较小的改动:下面的改动会对已有的代码库产生一定影响。

用以操作用户数据的API函数如果有sizepitch参数的需要把它们类型从SIZE_T转为UINT

 

Map()类型函数的flag参数名从Flags转变为MapFlags

 

ID3D10Asynchronous::GetData()函数的flag参数名从Flag转变为GetDataFlag

 

GetDepthStencilView()函数的flag参数从Floag转变为ClearFlag

 

D3D10_GETDAT_DONOTFLUSH被移到了D3D10_ASNYC_GETDATA_FLAG枚举类型中,被重命名为D3D10_ASNYC_GETDATA_DONOTFLUSH

 

D3D10_QUERY_MISCFLAG_PREDICATEHINT 被移到了D3D10_QUERY_MISC_FLAG枚举类型中,重命名为D3D10_QUERY_MISC_PREDICATEHINT

 

Get/SetConstantBuffersIAGet/IASetVertexBuffers函数中的StartConstantSlot被重命名为Offset

 

GenerateMips()函数从返回HRESULT改为返回void.

 

Behavior Changes: the following changes will not cause compilation errors, but will affect the behavior of Direct3D 10 applications.

  • Prior to the Direct3D 10 June Technology Preview/Windows Vista Beta 2, the UpdateSubresource destination box parameter (pDstBox) was applied to both the source and the destination. Now, the box is only applied to the destination.

行为改变:下面的改动不会造成编译错误,但是会影响D3D10应用程序的行为:

 

D3D10 20066月技术预览/Windows Vista Beta2之前的版本,UpdateSubresource目标对象参数(pDstBox)同时作为输入和输出。现在只作为输出目标参数。

DXGI Changes

  • APIs that take size and pitch parameters for user data have had the parameters changed from SIZE_T to UINT.
  • IDXGIAdapter::RegisterDriver was renamed to IDXGIFactory::CreateSoftwareAdapter
  • IDXGIOutput::EnumDisplayModes was renamed to IDXGIOutput::GetDisplayModeList
  • IDXGIOutput::GetDisplayMode has been removed
  • IDXGISwapChain::GetBackBuffer was renamed IDXGISwapChain::GetBuffer, IDXGISwapChain::ResizeBackBuffer was renamed IDXGISwapChain::ResizeBuffer
  • IDXGISwapChain::Present no longer takes source and destination RECTs
  • Swap effects are now DXGI_SWAP_EFFECT_DISCARD or DXGI_SWAP_EFFECT_SEQUENTIAL
  • The flags parameter for the Map() API has been renamed from Flags to MapFlags.
  • DXGI_MAX_BACKBUFFERS has been renamed to DXGI_MAX_SWAP_CHAIN_BUFFERS

DXGI改动:

 

使用sizepitch参数的API函数需要把它们的数据类型从SIZE_T转化为UINT

 

IDXGIAdapter::RegisterDriver被重命名为IDXGIFactory::CreateSoftwareAdapter

 

IDXGIOutput::EnumDisplayModes被重命名为IDXGIOutput::GetDisplayModeList

 

IDXGIOutput::GetDisplayMode被移除

 

IDXGISwapChain::GetBackBuffer被重命名为IDXGISwapChain::GetBuffer, IDXGISwapChain::ResizeBackBuffer被重命名为IDXGISwapChain::ResizeBuffer

 

IDXGISwapChain::Present不再需要输入源区域方框参数和目标区域方框参数

 

切换效果现在只有DXGI_SWAP_EFFECT_DISCARD或者DXGI_SWAP_EFFECT_SEQUENTIAL

Map()类型参数的APIFlags改为MapFlags

DXGI_MAX_BACKBUFFERS被重命名为DXGI_MAX_SWAP_CHAIN_BUFFERS

posted on 2006-07-28 14:39  王大牛的幸福生活  阅读(2240)  评论(0编辑  收藏  举报