游戏开发论坛

 找回密码
 立即注册
搜索
查看: 1458|回复: 2

Occulsion Query and RednerTraget texture

[复制链接]

414

主题

611

帖子

621

积分

高级会员

Rank: 4

积分
621
发表于 2008-4-17 19:51:00 | 显示全部楼层 |阅读模式
Can occlusion query calculate the changed pixel number in the RenderTraget texture that was SetrenderTarget in Drawing Function bracketed between the begin and end of Occulsion Query?


  1. IDirect3DQuery9* pOcclusionQuery;
  2. DWORD numberOfPixelsDrawn;

  3. m_pD3DDevice->CreateQuery(D3DQUERYTYPE_OCCLUSION, &pOcclusionQuery);

  4. // Add an end marker to the command buffer queue.
  5. pOcclusionQuery->Issue(D3DISSUE_BEGIN);

  6. // API render loop
  7. ...
  8. Draw(...) <<==Drawing Function, using SetRenderTarget
  9. ...

  10. // Add an end marker to the command buffer queue.
  11. pOcclusionQuery->Issue(D3DISSUE_END);

  12. // Force the driver to execute the commands from the command buffer.
  13. // Empty the command buffer and wait until the GPU is idle.
  14. while(S_FALSE == pOcclusionQuery->GetData( &numberOfPixelsDrawn,
  15.                                   sizeof(DWORD), D3DGETDATA_FLUSH ))
  16.     ;
复制代码

36

主题

1047

帖子

1147

积分

金牌会员

Rank: 6Rank: 6

积分
1147
发表于 2008-4-17 22:32:00 | 显示全部楼层

Re:Occulsion Query and RednerTraget texture

Yes,GPU OQ hasn't any relation with rendertarget, it just amount the number of pixel be rendered in one DIP of d3d render pipeline..

414

主题

611

帖子

621

积分

高级会员

Rank: 4

积分
621
 楼主| 发表于 2008-4-24 00:11:00 | 显示全部楼层

Re:Occulsion Query and RednerTraget texture

Could you tell me where is you see the information about "amount the number of pixel be rendered in one DIP of d3d render pipeline"?
What is DIP? DrawIndexedPrimitive?
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-22 17:52

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表