将纹理复制到纹理
我已经完成了 2 个使用共享资源的程序,在 SlimDX 和 SlimDX 上运行。 DirectX10。一个程序将在 3D 网格上显示共享纹理。第二个程序将加载图像作为纹理。到目前为止,每次从新图像更新纹理时,我都需要传递共享处理。
现在,有没有一种方法可以初始化固定大小的共享纹理(Texture2D),然后每次加载新图像时,我所需要做的就是将其加载为纹理,然后将其复制到现有纹理。这样共享句柄就不会改变,并且我可以节省一些传递共享句柄的开销。对于 DirectX9,我确实知道有一个函数可以做到这一点,“StretchRectangle”,但我在 DirectX10 中找不到该函数或类似的函数。
中间格式可以是任何东西,甚至是表面,只要我将其更新为共享纹理即可。
谢谢
I've done 2 programs to use Shared Resources, running on SlimDX & DirectX10. One program will display the shared texture on a 3D mesh. The 2nd program will load an image as texture. So far I need to pass the shared handled everytime the texture is update from a new image.
Now, is there a way that I can initialize a fixed size shared texture (Texture2D), then everytime when I load a new image, all I need to do is load it as texture, then copy it to the existing texture. This way the shared handle would not change, and I can save some overhead of passing the shared handle. For DirectX9, I do know there a function to do just that, "StretchRectangle" but I can't find that or anything similar in DirectX10.
The intermediate format can be anything, even surface, as long as I get to update it to the shared texture.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
CopyResource() 或 CopySubresourceRegion() 怎么样?我不知道 SlimDX,但这些应该可以在原生 D3D10 中正常工作。
What about CopyResource() or CopySubresourceRegion()? I don't know SlimDX, but these should work fine in native D3D10.