Copy Texture to Texture

巧了我就是萌 提交于 2019-12-02 20:02:54

问题


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


回答1:


What about CopyResource() or CopySubresourceRegion()? I don't know SlimDX, but these should work fine in native D3D10.



来源:https://stackoverflow.com/questions/3249279/copy-texture-to-texture

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!