File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
PluginInteropUnityCUDA/src/Texture Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ Texture_OpenGLCoreES::~Texture_OpenGLCoreES()
16
16
CUDA_CHECK (cudaGetLastError ());
17
17
};
18
18
19
-
20
19
int Texture_OpenGLCoreES::registerTextureInCUDA ()
21
20
{
22
21
// if depth is < 2 it's a texture2D, else it's a texture2DArray
@@ -40,19 +39,27 @@ int Texture_OpenGLCoreES::unregisterTextureInCUDA()
40
39
41
40
int Texture_OpenGLCoreES::copyUnityTextureToAPITexture ()
42
41
{
43
- Log::log ().debugLogError (" copyUnityTextureToAPITexture - Not implemented yet" );
42
+ Log::log ().debugLogError (
43
+ " copyUnityTextureToAPITexture - Not implemented yet" );
44
44
return -1 ;
45
45
}
46
46
47
47
int Texture_OpenGLCoreES::copyAPITextureToUnityTexture ()
48
48
{
49
- Log::log ().debugLogError (" copyAPITextureToUnityTexture - Not implemented yet" );
49
+ Log::log ().debugLogError (
50
+ " copyAPITextureToUnityTexture - Not implemented yet" );
50
51
return -1 ;
51
52
}
52
53
53
54
int Texture_OpenGLCoreES::generateMips ()
54
55
{
55
- glGenerateMipmap (_texUnityGL);
56
+ // bind the texture
57
+ glBindTexture (_texTarget, _texUnityGL);
58
+ GL_CHECK ();
59
+ glGenerateMipmap (_texTarget);
60
+ GL_CHECK ();
61
+ // unbind the texture
62
+ glBindTexture (_texTarget, 0 );
56
63
GL_CHECK ();
57
64
return SUCCESS_INTEROP_CODE;
58
65
}
Original file line number Diff line number Diff line change @@ -30,9 +30,6 @@ int ActionSampleTexture::Update()
30
30
_texture->getSurfaceObject (), GetTime (),
31
31
_texture->getWidth (), _texture->getHeight ());
32
32
cudaDeviceSynchronize ();
33
- // GRUMBLE(_texture->generateMips(),
34
- // "There has been an error during the mip map generation."
35
- // "Abord ActionSampleTexture !");
36
33
GRUMBLE (CUDA_CHECK (cudaGetLastError ()),
37
34
" There has been an error during the update. "
38
35
" Abort ActionSampleTexture !" );
You can’t perform that action at this time.
0 commit comments