directx11渲染到纹理没有数据 [英] directx11 render to texture no data

查看:240
本文介绍了directx11渲染到纹理没有数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

    I 渲染到texture1 然后使用纹理渲染到texture2但纹理2没有 数据 

   i  render to texture1  then use texture render to texture2 but texture2 no  data 

当 我使用  

when  i use  

g_pd3dDeviceContext->结束(cg_pQuery);

  while(g_pd3dDeviceContext-> GetData(cg_pQuery,NULL,0,D3D11_ASYNC_GETDATA_DONOTFLUSH )!= S_OK)

  {

 } 

g_pd3dDeviceContext->End(cg_pQuery);
 while(g_pd3dDeviceContext->GetData(cg_pQuery,NULL,0,D3D11_ASYNC_GETDATA_DONOTFLUSH) != S_OK)
 {
 }  

at 每 绘制结束它的工作但是慢慢地  

at  every  draw end it work but slowly  

如何解决这个问题

推荐答案

你好ksdg ,

Hi ksdg,

感谢您在此处发帖。

>> i 渲染到texture1 然后使用纹理渲染到texture2但纹理2没有 数据

请提供有关如何渲染纹理2的更多信息。

Please provide more information about how do you render your texture2.

您是否尝试过使用ID3D11DeviceContext: :OMSetRenderTargets方法绑定多个渲染目标?

Have you tried to use ID3D11DeviceContext::OMSetRenderTargets method to bind multiple render targets?

这是一个示例文档供您参考。

Here is a sample document for you as a reference.

https://msdn.microsoft.com/en-us/library/windows/desktop/dn643746 (v = vs.85).aspx

还有类似的案例。

https://stackoverflow.com/questions/12730309/rendering-to-multiple-textures -with-pass-in-directx-11

希望这可以帮助你。

最诚挚的问候,

Baron Bi


这篇关于directx11渲染到纹理没有数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆