Announcement

Collapse
No announcement yet.

Getting GPU pointer of Vertex Buffer, Index Buffer and so on (Integrating CUDA in UE4)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [FEATURE REQUEST] Getting GPU pointer of Vertex Buffer, Index Buffer and so on (Integrating CUDA in UE4)

    There already have been some posts on this topic, but don't seem to have the solution.
    I'd like to use the Vertex lists, Index lists, Normal lists and so on calculated in custom CUDA code directly for the information of Procedural Mesh Component.

    I managed to call CUDA function inside the UE4 c++ code 2 year ago, and made GPGPU based marching cubes like the following.
    https://forums.unrealengine.com/comm...nreal-engine-4



    The bottleneck was Procedural Mesh Component cannot use vertices, indices or normal vector array on GPU generated using CUDA directly, so I had to transfer the huge array from GPU to CPU, and UE4 resent the transferred CPU data to GPU again. The time necessary for GPU->CPU->GPU is much longer than the CUDA calculation time.

    So it would be great if we can get the GPU memory pointer directly, or we can use CUDA DirectX interoperability function.
    https://docs.nvidia.com/cuda/cuda-ru...RT__D3D11.html
    (This would limit the UE4 project to only Windows, Nvidia GPU PC, though.)

    There are some comments from the Epic staff,

    https://answers.unrealengine.com/que...3134/view.html
    but this is about ComputeShader.

    There are other similar questions, but it does not seem to have the answer.

    CUDA interoperability
    https://answers.unrealengine.com/que...erability.html


    Allow UE4 to read custom data stored in GPU RAM?
    https://answers.unrealengine.com/que...2231/view.html


    I know I might have to write some custom procedural mesh component like CUDA Mesh Component by myself, but I'd like to know if this kind of thing is possible without custom engine build.

    So first of all, (I think) I need to know which version of directX (11 or 12) is used in a UE4 project to use CUDA DirectX interoperability function. Is it possible which directX is used in the UE4 project in C++? (like #ifdef DXD11 #endif)
    And Is it possible to get some Direct3D pointer like ID3D11Device* and ID3D11Resource* at a Procedural Mesh Component?

    I believe this kind of feature would be really useful for real-time visualization using GPGPU, rendered in UE4.

    Any comments or suggestions are very welcome.
    Thanks.
Working...
X