Equalizer
1.4.1
|
00001 00002 /* Copyright (c) 2005-2012, Stefan Eilemann <eile@equalizergraphics.com> 00003 * 2010, Cedric Stalder <cedric.stalder@gmail.com> 00004 * 00005 * This library is free software; you can redistribute it and/or modify it under 00006 * the terms of the GNU Lesser General Public License version 2.1 as published 00007 * by the Free Software Foundation. 00008 * 00009 * This library is distributed in the hope that it will be useful, but WITHOUT 00010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00012 * details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public License 00015 * along with this library; if not, write to the Free Software Foundation, Inc., 00016 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00017 */ 00018 00019 #ifndef EQ_CHANNELPACKETS_H 00020 #define EQ_CHANNELPACKETS_H 00021 00022 #include <eq/client/packets.h> // base structs 00023 #include <eq/client/statistic.h> // member 00024 #include <eq/fabric/renderContext.h> // member 00025 00027 namespace eq 00028 { 00029 namespace detail { struct RBStat; } 00030 00031 struct ChannelConfigInitPacket : public ChannelPacket 00032 { 00033 ChannelConfigInitPacket( const uint128_t& initID_ ) 00034 : initID( initID_ ) 00035 { 00036 command = fabric::CMD_CHANNEL_CONFIG_INIT; 00037 size = sizeof( ChannelConfigInitPacket ); 00038 } 00039 00040 const uint128_t initID; 00041 }; 00042 00043 struct ChannelConfigInitReplyPacket : public ChannelPacket 00044 { 00045 ChannelConfigInitReplyPacket() 00046 { 00047 command = fabric::CMD_CHANNEL_CONFIG_INIT_REPLY; 00048 size = sizeof( ChannelConfigInitReplyPacket ); 00049 } 00050 00051 uint64_t result; // bool, padded for valgrind 00052 }; 00053 00054 struct ChannelConfigExitPacket : public ChannelPacket 00055 { 00056 ChannelConfigExitPacket() 00057 { 00058 command = fabric::CMD_CHANNEL_CONFIG_EXIT; 00059 size = sizeof( ChannelConfigExitPacket ); 00060 } 00061 }; 00062 00063 struct ChannelDeleteTransferContextPacket: public ChannelPacket 00064 { 00065 ChannelDeleteTransferContextPacket( const uint32_t req ) 00066 : requestID( req ) 00067 { 00068 command = fabric::CMD_CHANNEL_DELETE_TRANSFER_CONTEXT; 00069 size = sizeof( ChannelDeleteTransferContextPacket ); 00070 } 00071 const uint32_t requestID; 00072 }; 00073 00074 struct ChannelConfigExitReplyPacket : public ChannelPacket 00075 { 00076 ChannelConfigExitReplyPacket( const UUID& channelID, const bool res ) 00077 : result( res ) 00078 { 00079 command = fabric::CMD_CHANNEL_CONFIG_EXIT_REPLY; 00080 size = sizeof( ChannelConfigExitReplyPacket ); 00081 objectID = channelID; 00082 } 00083 00084 const bool result; 00085 }; 00086 00087 struct ChannelTaskPacket : public ChannelPacket 00088 { 00089 RenderContext context; 00090 }; 00091 00092 struct ChannelFrameStartPacket : public ChannelTaskPacket 00093 { 00094 ChannelFrameStartPacket() 00095 { 00096 command = fabric::CMD_CHANNEL_FRAME_START; 00097 size = sizeof( ChannelFrameStartPacket ); 00098 } 00099 00100 uint128_t version; 00101 uint32_t frameNumber; 00102 }; 00103 00104 struct ChannelStopFramePacket : public co::ObjectPacket 00105 { 00106 ChannelStopFramePacket() 00107 { 00108 command = fabric::CMD_CHANNEL_STOP_FRAME; 00109 size = sizeof( ChannelStopFramePacket ); 00110 } 00111 uint32_t lastFrameNumber; 00112 }; 00113 00114 struct ChannelFrameFinishPacket : public ChannelTaskPacket 00115 { 00116 ChannelFrameFinishPacket() 00117 { 00118 command = fabric::CMD_CHANNEL_FRAME_FINISH; 00119 size = sizeof( ChannelFrameFinishPacket ); 00120 } 00121 00122 uint32_t frameNumber; 00123 }; 00124 00125 struct ChannelFrameFinishReplyPacket : public ChannelPacket 00126 { 00127 ChannelFrameFinishReplyPacket( ) 00128 { 00129 command = fabric::CMD_CHANNEL_FRAME_FINISH_REPLY; 00130 size = sizeof( ChannelFrameFinishReplyPacket ); 00131 } 00132 00133 Viewport region; 00134 uint32_t frameNumber; 00135 uint32_t nStatistics; 00136 LB_ALIGN8( Statistic statistics[1] ); 00137 }; 00138 00139 00140 struct ChannelFrameDrawFinishPacket : public ChannelPacket 00141 { 00142 ChannelFrameDrawFinishPacket() 00143 { 00144 command = fabric::CMD_CHANNEL_FRAME_DRAW_FINISH; 00145 size = sizeof( ChannelFrameDrawFinishPacket ); 00146 } 00147 00148 uint128_t frameID; 00149 uint32_t frameNumber; 00150 }; 00151 00152 struct ChannelFrameClearPacket : public ChannelTaskPacket 00153 { 00154 ChannelFrameClearPacket() 00155 { 00156 command = fabric::CMD_CHANNEL_FRAME_CLEAR; 00157 size = sizeof( ChannelFrameClearPacket ); 00158 } 00159 }; 00160 00161 struct ChannelFrameDrawPacket : public ChannelTaskPacket 00162 { 00163 ChannelFrameDrawPacket() 00164 : finish( false ) 00165 { 00166 command = fabric::CMD_CHANNEL_FRAME_DRAW; 00167 size = sizeof( ChannelFrameDrawPacket ); 00168 } 00169 bool finish; 00170 }; 00171 00172 struct ChannelFrameAssemblePacket : public ChannelTaskPacket 00173 { 00174 ChannelFrameAssemblePacket() 00175 { 00176 command = fabric::CMD_CHANNEL_FRAME_ASSEMBLE; 00177 size = sizeof( ChannelFrameAssemblePacket ); 00178 } 00179 00180 uint32_t nFrames; 00181 LB_ALIGN8( co::ObjectVersion frames[1] ); 00182 }; 00183 00184 struct ChannelFrameReadbackPacket : public ChannelTaskPacket 00185 { 00186 ChannelFrameReadbackPacket() 00187 { 00188 command = fabric::CMD_CHANNEL_FRAME_READBACK; 00189 size = sizeof( ChannelFrameReadbackPacket ); 00190 } 00191 00192 uint32_t nFrames; 00193 LB_ALIGN8( co::ObjectVersion frames[1] ); 00194 }; 00195 00196 struct ChannelFrameTransmitImagePacket : public ChannelPacket 00197 { 00198 ChannelFrameTransmitImagePacket() 00199 { 00200 command = fabric::CMD_CHANNEL_FRAME_TRANSMIT_IMAGE; 00201 size = sizeof( ChannelFrameTransmitImagePacket ); 00202 } 00203 00204 co::ObjectVersion frameData; 00205 uint128_t nodeID; 00206 uint128_t netNodeID; 00207 uint64_t imageIndex; 00208 uint32_t frameNumber; 00209 uint32_t taskID; 00210 }; 00211 00212 struct ChannelFrameSetReadyPacket : public ChannelPacket 00213 { 00214 ChannelFrameSetReadyPacket( const co::ObjectVersion& fd, 00215 detail::RBStat* s, const uint32_t n ) 00216 : frameData( fd ), stat( s ), nNodes( n ) 00217 { 00218 command = fabric::CMD_CHANNEL_FRAME_SET_READY; 00219 size = sizeof( ChannelFrameSetReadyPacket ); 00220 } 00221 00222 const co::ObjectVersion frameData; 00223 detail::RBStat* stat; 00224 const uint32_t nNodes; 00225 LB_ALIGN8( uint128_t IDs[1] ); 00226 }; 00227 00228 struct ChannelFrameSetReadyNodePacket : public ChannelPacket 00229 { 00230 ChannelFrameSetReadyNodePacket( const co::ObjectVersion& fd, 00231 const uint128_t& n, const uint128_t nn, 00232 const uint32_t f ) 00233 : frameData( fd ), nodeID( n ), netNodeID( nn ), frameNumber(f) 00234 { 00235 command = fabric::CMD_CHANNEL_FRAME_SET_READY_NODE; 00236 size = sizeof( ChannelFrameSetReadyNodePacket ); 00237 } 00238 00239 const co::ObjectVersion frameData; 00240 const uint128_t nodeID; 00241 const uint128_t netNodeID; 00242 const uint32_t frameNumber; 00243 }; 00244 00245 struct ChannelFinishReadbackPacket : public ChannelPacket 00246 { 00247 ChannelFinishReadbackPacket() 00248 { 00249 command = fabric::CMD_CHANNEL_FINISH_READBACK; 00250 size = sizeof( ChannelFinishReadbackPacket ); 00251 } 00252 00253 co::ObjectVersion frameData; 00254 uint64_t imageIndex; 00255 uint32_t frameNumber; 00256 uint32_t taskID; 00257 uint32_t nNodes; 00258 LB_ALIGN8( uint128_t IDs[1] ); 00259 }; 00260 00261 struct ChannelFrameViewStartPacket : public ChannelTaskPacket 00262 { 00263 ChannelFrameViewStartPacket() 00264 { 00265 command = fabric::CMD_CHANNEL_FRAME_VIEW_START; 00266 size = sizeof( ChannelFrameViewStartPacket ); 00267 } 00268 }; 00269 00270 struct ChannelFrameViewFinishPacket : public ChannelTaskPacket 00271 { 00272 ChannelFrameViewFinishPacket() 00273 { 00274 command = fabric::CMD_CHANNEL_FRAME_VIEW_FINISH; 00275 size = sizeof( ChannelFrameViewFinishPacket ); 00276 } 00277 }; 00278 00279 struct ChannelFrameTilesPacket : public ChannelTaskPacket 00280 { 00281 ChannelFrameTilesPacket() 00282 { 00283 command = fabric::CMD_CHANNEL_FRAME_TILES; 00284 size = sizeof( ChannelFrameTilesPacket ); 00285 } 00286 00287 bool isLocal; 00288 co::ObjectVersion queueVersion; 00289 uint32_t tasks; 00290 uint32_t nFrames; 00291 LB_ALIGN8( co::ObjectVersion frames[1] ); 00292 }; 00293 00294 inline std::ostream& operator << ( std::ostream& os, 00295 const ChannelConfigInitReplyPacket* packet ) 00296 { 00297 os << (co::ObjectPacket*)packet << " result " << packet->result; 00298 return os; 00299 } 00300 00301 inline std::ostream& operator << ( std::ostream& os, 00302 const ChannelFrameStartPacket* packet ) 00303 { 00304 os << (co::ObjectPacket*)packet << " frame " << packet->frameNumber; 00305 return os; 00306 } 00307 inline std::ostream& operator << ( std::ostream& os, 00308 const ChannelFrameFinishReplyPacket* packet ) 00309 { 00310 os << (co::ObjectPacket*)packet << " frame " << packet->frameNumber; 00311 return os; 00312 } 00313 inline std::ostream& operator << ( std::ostream& os, 00314 const ChannelFrameDrawFinishPacket* packet ) 00315 { 00316 os << (co::ObjectPacket*)packet << " frame " << packet->frameNumber 00317 << " id " << packet->frameID; 00318 return os; 00319 } 00320 inline std::ostream& operator << ( std::ostream& os, 00321 const ChannelTaskPacket* packet ) 00322 { 00323 os << (co::ObjectPacket*)packet << " " << packet->context; 00324 return os; 00325 } 00326 inline std::ostream& operator << ( std::ostream& os, 00327 const ChannelFrameReadbackPacket* packet ) 00328 { 00329 os << (ChannelTaskPacket*)packet << " nFrames " << packet->nFrames; 00330 return os; 00331 } 00332 inline std::ostream& operator << ( std::ostream& os, 00333 const ChannelFrameTransmitImagePacket* packet ) 00334 { 00335 os << (co::ObjectPacket*)packet << " frame data " << packet->frameData 00336 << " receiver " << packet->nodeID << " on " << packet->netNodeID; 00337 return os; 00338 } 00339 inline std::ostream& operator << ( std::ostream& os, 00340 const ChannelFrameAssemblePacket* packet ) 00341 { 00342 os << (ChannelTaskPacket*)packet << " nFrames " << packet->nFrames; 00343 return os; 00344 } 00345 } 00347 #endif //EQ_CHANNELPACKETS_H