IDirect3DDevice9::GetRenderTargetData

本文介绍Direct3D9中GetRenderTargetData方法的使用,该方法用于将渲染目标表面的内容复制到系统内存表面。文章详细说明了源表面与目标表面的要求,并提供了一系列测试案例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

Copies the render-target data from device memory to system memory.

Syntax

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

Parameters

pRenderTarget [in]

Type: IDirect3DSurface9*

Pointer to an IDirect3DSurface9 object, representing a render target.

pDestSurface [in]

Type: IDirect3DSurface9*

Pointer to an IDirect3DSurface9 object, representing a destination surface.

Return Value

Type: HRESULT

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.


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值