Jump to content

Image crash on copy


photo

Recommended Posts

Hi,

 

Does anyone know why the following bit of code might be crashing on the last line?  Am I using the Image class correctly here?

 

Image alpha = new Image();
alpha.create2D(m_coarseDiffuseAlpha.getWidth(),m_coarseDiffuseAlpha.getHeight(), IMAGE_FORMAT_R8);
alpha.copy(m_coarseDiffuseAlpha);
alpha.resize(newDiffuse.getWidth(),newDiffuse.getHeight());

 

// CRASHING HERE ON COPY()

newDiffuse.copy(alpha, 3, 0);  

 

 

Not sure why this might be happening.  I suspect I'm trashing memory elsewhere in the code but not sure where.

 

Thanks,

Simon

Link to comment

yes I am (2013)  - and sorry, it's tied into a lot of code.  It's hard to separate out as it is tightly coupled to thousands of lines of code.

 

Just to be clear - this code only crashes when unigine is in the middle of loading and our user interface and assets are all being initialised.

 

This code gets called again once everything is up and running (say, 1min after initialisation).  And it works fine.

 

Not sure what's going on here.

Link to comment

I know, I know - upgrading 50,000 lines of code is something I have to justify with management unfortunately :(

 

 

However, I think I have tracked down the issue - and the problem seems to be in unigine:

 

 

This crashes with channel targets: newDiffuse.copy(alpha, 3, 0);

 

This doesn't (no channel targets):  newDiffuse.copy(alpha)

 

Is there 

 

 

So, either some initialisation has to be done at the channel level, or it's a bug in unigine.

 

Any ideas?

Link to comment
×
×
  • Create New...