您的位置:首页 > 其它

IDirect3DDevice9::GetRenderTargetData

2011-07-07 17:25 239 查看
Copies the render-target data from device memory to system memory.

Syntax

Copy
HRESULT GetRenderTargetData(
  [in]  IDirect3DSurface9 *pRenderTarget,
  [in]  IDirect3DSurface9 *pDestSurface
);

Parameters

pRenderTarget [in]Type: [b]IDirect3DSurface9*[/b]
Pointer to an IDirect3DSurface9 object, representing a render target.
pDestSurface [in]Type: [b]IDirect3DSurface9*[/b]
Pointer to an IDirect3DSurface9 object, representing a destination surface.

Return Value

Type: [b]HRESULT[/b]
If the method succeeds, the return value is D3D_OK. If the method fails, the return value can be one of the following: D3DERR_DRIVERINTERNALERROR, D3DERR_DEVICELOST, D3DERR_INVALIDCALL.

Remarks

The destination surface must be either an off-screen plain surface or a level of a texture (mipmap or cube texture) created with D3DPOOL_SYSTEMMEM.
The source surface must be a regular render target or a level of a render-target texture (mipmap or cube texture) created with POOL_DEFAULT.
This method will fail if:
The render target is multisampled.
The source render target is a different size than the destination surface.
The source render target and destination surface formats do not match.

Requirements

Header
D3D9.h
Library
D3D9.lib
GetRenderTargetData()能够把GPU上Render Target的一个纹理直接完整拷贝到系统内存

GetRenderTargetData - Backbuffer and Render Target

Overview

The GetRenderTargetData - Backbuffer and Render Target test verifies that the IDirect3DDevice9::GetRenderTargetData method (Microsoft Direct3D 9) can be used to extract the contents of back buffers and basic render targets.

Details

This test validates the functional and operational specifications for the IDirect3DDevice9::GetRenderTargetData method. The GetRenderTargetData method provides a way to copy the contents of a render-target surface to a system-memory surface. There are several restrictions on the source and destination surfaces that you must meet for this copy to succeed:
The source surface must be a regular render-target surface or a specific level of a render-target texture (MIP map or cube texture).
The source source must be POOL_DEFAULT and D3DMULTISAMPLE_NONE.
The destination surface must be either an off-screen plain surface or a texture (MIP map or cube) that is created with POOL_SYSTEMMEM.
The source and destination surfaces must be the same dimension and format.
The following table shows the matrix of surface combinations that this test covers and the command options that the test uses to select the type of surface.
SurfaceOffscreen plainMIP-map textureCube texture
Back buffer-grtdbb-grtdbbt-grtdbbct
Render target-grtdrt-grtdrtt-grtdrtct
MIP-map texture-grtdts-grtdtt-grtdtct
Cube texture-grtdcts-grtdctt-grtdctct
The test first creates the source and destination surfaces. The test then cycles through various surface formats and usage specifications. If either surface cannot be created, that configuration is skipped. After the surfaces are created, the render-target surface is filled with a textured quad. Next, the source is copied to the destination with the GetRenderTargetData method and a surface comparison is performed to verify that the two surface contents are the same.
To run this test, you must have Microsoft DirectX 9.0.
The test writes the test results to a log file called GetRenderTargetData.xml and displays on-screen pass or fail compliance. The test log is written to the %USERPROFILE%\dxlogs directory.
Run Time:
Log File:

System Restart Required:
Test Category:
Supported operating systems for Logo or Signature testing:


Windows 7
Windows Server 2008 R2

Requirements

Software Requirements
The test tool requires the following software:
Software components included with the device that is being tested.
Hardware Requirements
Device to be tested
Computer that meets the minimum software requirements
Windows keyboard
Two-button pointing device
Color display monitor capable of at least 1024 by 768 resolution, 32-bits per pixel, 60 Hz
Hard drive with a minimum of 20 GB available on partition C:

Running GetRenderTargetData - Backbuffer and Render Target

There is no special setup or configuration that you need to complete to run this test.

Command Syntax

Command optionDescription
getrendertargetdata.exe [ option ]Options for specific surfaces. For more information about which option to use, see the table earlier in this topic.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: