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_NODEPACKETS_H 00020 #define EQ_NODEPACKETS_H 00021 00022 #include <eq/client/packets.h> // base structs 00023 #include <eq/client/frameData.h> // member 00024 00026 namespace eq 00027 { 00028 00029 struct NodeConfigInitPacket : public co::ObjectPacket 00030 { 00031 NodeConfigInitPacket() 00032 { 00033 command = fabric::CMD_NODE_CONFIG_INIT; 00034 size = sizeof( NodeConfigInitPacket ); 00035 } 00036 00037 uint128_t initID; 00038 uint32_t frameNumber; 00039 }; 00040 00041 struct NodeConfigInitReplyPacket : public co::ObjectPacket 00042 { 00043 NodeConfigInitReplyPacket() 00044 { 00045 command = fabric::CMD_NODE_CONFIG_INIT_REPLY; 00046 size = sizeof( NodeConfigInitReplyPacket ); 00047 } 00048 00049 uint64_t result; // bool, padded for valgrind 00050 }; 00051 00052 struct NodeConfigExitPacket : public NodePacket 00053 { 00054 NodeConfigExitPacket() 00055 { 00056 command = fabric::CMD_NODE_CONFIG_EXIT; 00057 size = sizeof( NodeConfigExitPacket ); 00058 } 00059 }; 00060 00061 struct NodeConfigExitReplyPacket : public NodePacket 00062 { 00063 NodeConfigExitReplyPacket( const UUID& nodeID, const bool res ) 00064 : result( res ) 00065 { 00066 command = fabric::CMD_NODE_CONFIG_EXIT_REPLY; 00067 size = sizeof( NodeConfigExitReplyPacket ); 00068 objectID = nodeID; 00069 } 00070 00071 const uint64_t result; // bool, padded for valgrind 00072 }; 00073 00074 struct NodeCreatePipePacket : public NodePacket 00075 { 00076 NodeCreatePipePacket() 00077 { 00078 command = fabric::CMD_NODE_CREATE_PIPE; 00079 size = sizeof( NodeCreatePipePacket ); 00080 } 00081 00082 UUID pipeID; 00083 uint64_t threaded; // bool, padded for valgrind 00084 }; 00085 00086 struct NodeDestroyPipePacket : public NodePacket 00087 { 00088 NodeDestroyPipePacket( const UUID& id ) 00089 : pipeID( id ) 00090 { 00091 command = fabric::CMD_NODE_DESTROY_PIPE; 00092 size = sizeof( NodeDestroyPipePacket ); 00093 } 00094 00095 const UUID pipeID; 00096 }; 00097 00098 struct NodeFrameStartPacket : public NodePacket 00099 { 00100 NodeFrameStartPacket() : configVersion( co::VERSION_INVALID ) 00101 { 00102 command = fabric::CMD_NODE_FRAME_START; 00103 size = sizeof( NodeFrameStartPacket ); 00104 } 00105 00106 uint128_t version; 00107 uint128_t configVersion; 00108 uint128_t frameID; 00109 uint32_t frameNumber; 00110 }; 00111 00112 struct NodeFrameFinishPacket : public NodePacket 00113 { 00114 NodeFrameFinishPacket() 00115 { 00116 command = fabric::CMD_NODE_FRAME_FINISH; 00117 size = sizeof( NodeFrameFinishPacket ); 00118 } 00119 00120 uint128_t frameID; 00121 uint32_t frameNumber; 00122 }; 00123 00124 struct NodeFrameFinishReplyPacket : public NodePacket 00125 { 00126 NodeFrameFinishReplyPacket() 00127 { 00128 command = fabric::CMD_NODE_FRAME_FINISH_REPLY; 00129 size = sizeof( NodeFrameFinishReplyPacket ); 00130 } 00131 00132 uint32_t frameNumber; 00133 }; 00134 00135 struct NodeFrameDrawFinishPacket : public NodePacket 00136 { 00137 NodeFrameDrawFinishPacket() 00138 { 00139 command = fabric::CMD_NODE_FRAME_DRAW_FINISH; 00140 size = sizeof( NodeFrameDrawFinishPacket ); 00141 } 00142 uint128_t frameID; 00143 uint32_t frameNumber; 00144 }; 00145 00146 struct NodeFrameDataTransmitPacket : public NodePacket 00147 { 00148 NodeFrameDataTransmitPacket() 00149 { 00150 command = fabric::CMD_NODE_FRAMEDATA_TRANSMIT; 00151 size = sizeof( NodeFrameDataTransmitPacket ); 00152 } 00153 00154 co::ObjectVersion frameData; 00155 PixelViewport pvp; 00156 Zoom zoom; 00157 uint32_t buffers; 00158 uint32_t frameNumber; 00159 uint64_t useAlpha; // bool + valgrind padding 00160 00161 LB_ALIGN8( uint8_t data[8] ); 00162 }; 00163 00164 struct NodeFrameDataReadyPacket : public NodePacket 00165 { 00166 NodeFrameDataReadyPacket( const FrameDataPtr fd ) 00167 : frameData( fd ), data( fd->_data ) 00168 { 00169 command = fabric::CMD_NODE_FRAMEDATA_READY; 00170 size = sizeof( NodeFrameDataReadyPacket ); 00171 } 00172 00173 const co::ObjectVersion frameData; 00174 const FrameData::Data data; 00175 }; 00176 00177 struct NodeFrameTasksFinishPacket : public NodePacket 00178 { 00179 NodeFrameTasksFinishPacket() 00180 { 00181 command = fabric::CMD_NODE_FRAME_TASKS_FINISH; 00182 size = sizeof( NodeFrameTasksFinishPacket ); 00183 } 00184 00185 uint128_t frameID; 00186 uint32_t frameNumber; 00187 }; 00188 00189 struct NodeAffinityPacket : public NodePacket 00190 { 00191 NodeAffinityPacket() 00192 { 00193 command = fabric::CMD_NODE_SET_AFFINITY; 00194 size = sizeof(NodeAffinityPacket); 00195 } 00196 00197 int32_t affinity; 00198 }; 00199 00200 inline std::ostream& operator << ( std::ostream& os, 00201 const NodeCreatePipePacket* packet ) 00202 { 00203 os << (co::ObjectPacket*)packet << " id " << packet->pipeID; 00204 return os; 00205 } 00206 inline std::ostream& operator << ( std::ostream& os, 00207 const NodeFrameStartPacket* packet ) 00208 { 00209 os << (co::ObjectPacket*)packet << " frame " << packet->frameNumber 00210 << " id " << packet->frameID; 00211 return os; 00212 } 00213 inline std::ostream& operator << ( std::ostream& os, 00214 const NodeFrameDrawFinishPacket* packet ) 00215 { 00216 os << (co::ObjectPacket*)packet << " frame " << packet->frameNumber 00217 << " id " << packet->frameID; 00218 return os; 00219 } 00220 inline std::ostream& operator << ( std::ostream& os, 00221 const NodeFrameFinishPacket* packet ) 00222 { 00223 os << (co::ObjectPacket*)packet << " frame " << packet->frameNumber 00224 << " id " << packet->frameID; 00225 return os; 00226 } 00227 } 00229 #endif //EQ_NODEPACKETS_H