| 3965 | } |
| 3966 | |
| 3967 | void UpdateRtPerObjectData( const EveSpaceObjectPSData& psData, const Matrix* instanceTransform, Tr2PrimaryRenderContext& renderContext, Tr2ConstantBufferAL& perObjectData ) |
| 3968 | { |
| 3969 | auto size = sizeof( EveSpaceObjectPSData ) + ( instanceTransform ? sizeof( Matrix ) : 0 ); |
| 3970 | |
| 3971 | if( !perObjectData.IsValid() || perObjectData.GetSize() != size ) |
| 3972 | { |
| 3973 | perObjectData.Create( uint32_t( size ), renderContext ); |
| 3974 | } |
| 3975 | |
| 3976 | EveSpaceObjectPSData* bufferPtr; |
| 3977 | perObjectData.Lock( (void**)&bufferPtr, renderContext ); |
| 3978 | *bufferPtr = psData; |
| 3979 | if( instanceTransform ) |
| 3980 | { |
| 3981 | *reinterpret_cast<Matrix*>( bufferPtr + 1 ) = Transpose( *instanceTransform ); |
| 3982 | } |
| 3983 | perObjectData.Unlock( renderContext ); |
| 3984 | } |
| 3985 | |
| 3986 | void EveSpaceObject2::PushRtGeometry( Tr2RaytracingManager& rtManager ) const |
| 3987 | { |