Comments (7)
The texture that has been created in Unity with DX11 API, will have the type DXGI_FORMAT_R32G32B32A32_TYPELESS
in native plugin. Therefore, they can't be used like that to be registered in CUDA with cudaGraphicsD3D11RegisterResource
, because it doesn't accept this format.
from interopunitycuda.
I use this code to see that :
ID3D11Texture2D *d3dtex = (ID3D11Texture2D *)_textureHandle;
assert(d3dtex);
D3D11_TEXTURE2D_DESC texDesc;
d3dtex->GetDesc(&texDesc);
DXGI_FORMAT format = texDesc.Format;
Log::log().debugLog(std::to_string(format));
from interopunitycuda.
This issue was already reported here : see issue tracker
from interopunitycuda.
To solve this issue I have to create another texture and copy the content of the texture created in Unity into it. This will cause an overhead...
from interopunitycuda.
Hello @davidAlgis,
we also plan to use Unity with Cuda and got some code working. During my research I stumbled over your project which looks very promising.
Because we focus on windows + directx I started to implement d3d11.
https://github.com/deibich/InteropUnityCUDA/commits/d3d11
As you can see I used Texture2D and Texture2DArray instead of RenderTexture to get rid of the problem with format ..._TYPLESS.
To solve this issue I have to create another texture and copy the content of the texture created in Unity into it. This will cause an overhead...
Does the "action_sample_texture_array" work with this workaround?
from interopunitycuda.
Hi @deibich,
Nice to see that my work is being useful to someone.
Thanks for the tips to change RenderTexture
to Texture2D
, after I saw the issue tracker, I had completely given up to make it work without a copy.
This morning I push a first version that work for texture 2D with this copy, but as I except it cause a big overhead. Thanks to you, I push another version that work for texture 2D without a copy and the performances are better ! Now I will tackle the problem of the texture 2D array.
To solve this issue I have to create another texture and copy the content of the texture created in Unity into it. This will cause an overhead...
Does the "action_sample_texture_array" work with this workaround?
On OpenGL, I could registered directly the texture array into a cuda surface object, that was then written with surf3DWrite
. Therefore, no copy was needed. I hope to find a similar solution for dx11. Do not hesitate if you have any questions.
from interopunitycuda.
One drawback of using Texture2D
instead of RenderTexture
is that a Texture2D
cannot be written in a compute shader. You get the following error if you try :
Attempting to bind texture as UAV but the texture wasn't created with the UAV usage flag set!
I think I will let the 2 options (with and without copy), just in case.
from interopunitycuda.
Related Issues (11)
- Reading of compute buffer stops after a few seconds (only on OpenGL API) HOT 2
- Add a hook to allow push only if unit tests have passed HOT 1
- Add a Unit test for texture array
- Unify the way texture array are handled for DX11 and OpenGL HOT 3
- Porting the plugin to HIP to support more GPU
- Add better error support HOT 2
- Unable to generate mips with DX11 and Texture2D HOT 1
- Render doc makes the function IsSupported return false HOT 1
- Add a unit test HOT 1
- Create a full package of the C# code HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from interopunitycuda.