Game Development Community

[T3D1.1 B1] GenericConstBufferLayout::set bug? - LOGGED

by Aneroun · in Torque 3D Professional · 03/05/2010 (6:59 am) · 3 replies

I have an error in some cases when engine starts rendering terrain block.

Shader's uniform variable inLightSpotDir not assigned because of dMemcmp in GenericConstBufferLayout::set() tells there are no difference in memory, so the function return false.

inside: GenericConstBufferLayout::set() around line 89:

... skipped
   if (dMemcmp(basePointer+pd.offset, data, size) != 0)      
   {
      dMemcpy(basePointer+pd.offset, data, size);      
      return true;
   }   
   return false;

So, inside inline void GenericConstBuffer::internalSet the following code never called:

... skipped
   if ( mLayout->set( pd, constType, size, data, mBuffer ) )
   {
      #ifdef TORQUE_DEBUG
         
         // Update the debug assignment tracking.
         mWasAssigned[ pd.index ] = true;

      #endif

      // Keep track of the dirty range so it can be queried
      // later in GenericConstBuffer::getDirtyBuffer.
      mDirtyStart = getMin( pd.offset, mDirtyStart );
      mDirtyEnd = getMax( pd.offset + pd.size, mDirtyEnd );
   }

And at the end, mWasAssigned[] has one unassinged index and when engine calls DIP, it leads to assertUnassignedConstants error.

About the author

Dedicated Logic - Empowering AfterWorld


#1
03/09/2010 (10:58 pm)
Hum... i haven't seen this before.

Is this in BL? Do you have a spotlight in the scene?
#2
03/10/2010 (11:52 am)
Not, in BL it does not appear, and i have no spotlight in the scene, scatterSky only.
#3
08/21/2010 (8:59 am)
Logged as TQA-876.