1
1
#pragma once
2
2
#include " vertex_buffer_D3D11.h"
3
3
4
-
5
-
6
4
#if SUPPORT_D3D11
7
5
8
- VertexBuffer_D3D11::VertexBuffer_D3D11 (void * bufferHandle, int size)
9
- : VertexBuffer(bufferHandle, size)
6
+ VertexBuffer_D3D11::VertexBuffer_D3D11 (void * bufferHandle, int size)
7
+ : VertexBuffer(bufferHandle, size)
10
8
{
11
- Log::log (). debugLogError ( " Vertex buffer interoperability on DX11 is not yet supported " );
9
+
12
10
}
13
11
14
12
VertexBuffer_D3D11::~VertexBuffer_D3D11 ()
15
13
{
16
- // final check to be sure there was no mistake
17
- CUDA_CHECK (cudaGetLastError ());
14
+ // final check to be sure there was no mistake
15
+ CUDA_CHECK (cudaGetLastError ());
18
16
};
19
17
20
18
// / <summary>
@@ -23,16 +21,17 @@ VertexBuffer_D3D11::~VertexBuffer_D3D11()
23
21
void VertexBuffer_D3D11::registerBufferInCUDA ()
24
22
{
25
23
26
- Log::log ().debugLogError (" Register buffer on DX11 is not yet supported" );
27
- // register the texture to cuda : it initialize the _pGraphicsResource
28
- // CUDA_CHECK(cudaGraphicsD3D11RegisterResource(&_pGraphicsResource, (ID3D11Resource*)_bufferHandle, cudaGraphicsRegisterFlagsWriteDiscard));
24
+ ID3D11Buffer *bufferUnityDX11 = (ID3D11Buffer *)_bufferHandle;
25
+ // Log::log().debugLogError("Register buffer on DX11 is not yet supported");
26
+ // register the texture to cuda : it initialize the _pGraphicsResource
27
+ CUDA_CHECK (cudaGraphicsD3D11RegisterResource (
28
+ &_pGraphicsResource, (ID3D11Resource *)bufferUnityDX11,
29
+ cudaGraphicsRegisterFlagsNone));
29
30
}
30
31
31
32
void VertexBuffer_D3D11::unRegisterBufferInCUDA ()
32
33
{
33
- Log::log ().debugLogError (" Unregister buffer on DX11 is not yet supported" );
34
- // CUDA_CHECK(cudaGraphicsUnregisterResource(_pGraphicsResource));
34
+ CUDA_CHECK (cudaGraphicsUnregisterResource (_pGraphicsResource));
35
35
}
36
36
37
-
38
37
#endif // #if SUPPORT_D3D11
0 commit comments