Ejemplo n.º 1
0
void TrieadOwner::readyReady()
{
	markReady();
	app_->waitReady();
	appReady_ = true;
	triead_->setAppReady();
}
Ejemplo n.º 2
0
/*************************************************************
*
*  exceptionHandler - Wait for Messages that indicate some problem
*    with the system. Then perform appropriate recovery.
*
*					Author Greg Brissey 12-7-94
*/
pHandler(MSG_Q_ID msges)
{
   Cntlr_Comm msge;
   int *val;
   int bytes;
   void recovery(Cntlr_Comm *);
   void extrecovery(Cntlr_Comm *);

   DPRINT(1,"pHandler :Server LOOP Ready & Waiting.\n");
   FOREVER
   {
     markReady(PHANDLER_FLAGBIT);
     memset( &msge, 0, sizeof( Cntlr_Comm ) );
     bytes = msgQReceive(pMsgesToPHandlr, (char*) &msge, 
			  sizeof( Cntlr_Comm ), WAIT_FOREVER);
     markBusy(PHANDLER_FLAGBIT);
     DPRINT5(-1,"'%s': pHandler: recv: %d bytes, From Cntlr: '%s', Exception Type: %d, Event: %d \n",
			hostName,bytes, msge.cntlrId, msge.cmd, msge.arg1);

     if (strcmp(msge.cntlrId,hostName) == 0)
     {
        recovery( &msge );
     }
     else
     {
        extrecovery( &msge );
	DPRINT(-1,"From another Controller, No action yet.\n");
     }
     /* prevent false starts from Sync glitches, controller reboots, or FPGA reloads */
     cntrlFifoClearStartMode();
   } 
}
Ejemplo n.º 3
0
//////////////////////////////////////////////////////////////////////////
// create
//virtual
void ScnSound::create()
{	
	if( SsCore::pImpl() != nullptr )
	{
		// Create a new sample.
		pSource_ = SsCore::pImpl()->createSource( SsSourceParams(), pFileData_ );
	}

	markReady();
}
Ejemplo n.º 4
0
//////////////////////////////////////////////////////////////////////////
// create
//virtual
void ScnRenderTarget::create()
{
	// Create render target.
	pRenderTarget_ = RsCore::pImpl()->createRenderTarget( 
		RsRenderTargetDesc( Header_.Width_, Header_.Height_ )
			.renderSurface( 0, rsCF_A8R8G8B8 )
			.depthStencilSurface( rsDSF_D24S8 )
		);
	
	// Get texture from target.
	pTexture_ = pRenderTarget_->getTexture( 0 );
	
	// Ready to go.
	markReady();
}
Ejemplo n.º 5
0
/*************************************************************
*
*  probHandler - Wait for Messages that indicate some problem
*    with the system. Then perform appropriate recovery.
*
*					Author Greg Brissey 12-7-94
*/
pHandler(MSG_Q_ID msges)
{
   CNTLR_COMM_MSG msge;
   int *val;
   int bytes;
   void recovery(CNTLR_COMM_MSG *, int externflag);

   DPRINT(1,"pHandler :Server LOOP Ready & Waiting.\n");
   FOREVER
   {
     markReady(PHANDLER_FLAGBIT);
     memset( &msge, 0, sizeof( CNTLR_COMM_MSG ) );
     bytes = msgQReceive(pMsgesToPHandlr, (char*) &msge, 
			  sizeof( CNTLR_COMM_MSG ), WAIT_FOREVER);
     markBusy(PHANDLER_FLAGBIT);

     /* if aborted during the MRI read user byte, priorties maybe still high, so reset them. */
     resetParserPriority();   /* use this order to retain priority relationship */
     resetShandlerPriority();

     errLogRet(LOGIT,debugInfo,"vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n");
     errLogRet(LOGIT,debugInfo,"'%s': Exception from: -> '%s' <-, Type: %d, ErrorCode: %d \n",
			hostName, msge.cntlrId, msge.cmd, msge.errorcode);
     errLogRet(LOGIT,debugInfo,"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n");

     /* they are all fatal so stop Spy if it was running */
     if (enableSpyFlag > 0)
     {
        spyReport();   /* report CPU usage */
        spyClkStop();  /* turn off spy clock interrupts, etc. */
     }

     if (strcmp(msge.cntlrId,hostName) == 0)
     {
        recovery( &msge, 0 );
     }
     else
     {
        recovery( &msge, 1 );
     }
     /* prevent false starts from Sync glitches, controller reboots, or FPGA reloads */
     cntrlFifoClearStartMode();
   } 
}
Ejemplo n.º 6
0
/*************************************************************
*
*  probHandler - Wait for Messages that indecate some problem
*    with the system. Then perform appropriate recovery.
*
*					Author Greg Brissey 12-7-94
*/
pHandler(MSG_Q_ID msges)
{
   EXCEPTION_MSGE msge;
   int *val;
   int bytes;
   void recovery(EXCEPTION_MSGE *);

   DPRINT(1,"pHandler :Server LOOP Ready & Waiting.\n");
   FOREVER
   {
     markReady(PHANDLER_FLAGBIT);
     memset( &msge, 0, sizeof( EXCEPTION_MSGE ) );
     bytes = msgQReceive(pMsgesToPHandlr, (char*) &msge, 
			  sizeof( EXCEPTION_MSGE ), WAIT_FOREVER);
     markBusy(PHANDLER_FLAGBIT);
     DPRINT3(1,"pHandler: recv: %d bytes, Exception Type: %d, Event: %d \n",
			bytes, msge.exceptionType, msge.reportEvent);

      
     recovery( &msge );
   } 
}
Ejemplo n.º 7
0
//////////////////////////////////////////////////////////////////////////
// create
//virtual
void ScnModel::create()
{
	// NOTE: This should try and compact index and vertex buffers so we create less
	//       GPU resources. This could be done import time, but it could vary
	//       platform to platform.
	//       Also, if we compact, we will need to split it all up by vertex format,
	//       possibly even sort it by vertex format.
	
	// Setup primitive runtime.
	MeshRuntimes_.reserve( pHeader_->NoofPrimitives_ );
	
	BcU8* pVertexBufferData = pVertexBufferData_;
	BcU8* pIndexBufferData = pIndexBufferData_;
	
	for( BcU32 PrimitiveIdx = 0; PrimitiveIdx < pHeader_->NoofPrimitives_; ++PrimitiveIdx )
	{
		ScnModelMeshData* pMeshData = &pMeshData_[ PrimitiveIdx ];
		
		//ScnModelNodeTransformData* pNodeTransformData = &pNodeTransformData_[ pMeshData->NodeIndex_ ];
		
		// Create GPU resources.
		RsVertexDeclarationDesc VertexDeclarationDesc( pMeshData_->NoofVertexElements_ );
		for( BcU32 Idx = 0; Idx < pMeshData->NoofVertexElements_; ++Idx )
		{
			VertexDeclarationDesc.addElement( pMeshData_->VertexElements_[ Idx ] );
		}
		
		RsVertexDeclaration* pVertexDeclaration = RsCore::pImpl()->createVertexDeclaration( VertexDeclarationDesc );
		BcU32 VertexBufferSize = pMeshData->NoofVertices_ * pMeshData->VertexStride_;
		RsBuffer* pVertexBuffer = RsCore::pImpl()->createBuffer( 
			RsBufferDesc( 
				RsBufferType::VERTEX, 
				RsResourceCreationFlags::STATIC,
				VertexBufferSize ) );

		RsCore::pImpl()->updateBuffer( 
			pVertexBuffer, 0, pMeshData->NoofVertices_ * pMeshData->VertexStride_, 
			RsResourceUpdateFlags::ASYNC,
			[ pVertexBufferData, VertexBufferSize ]
			( RsBuffer* Buffer, const RsBufferLock& BufferLock )
			{
				BcAssert( Buffer->getDesc().SizeBytes_ == VertexBufferSize );
				BcMemCopy( BufferLock.Buffer_, pVertexBufferData, 
					VertexBufferSize );
			} );
	
		BcU32 IndexBufferSize = pMeshData->NoofIndices_ * sizeof( BcU16 );
		RsBuffer* pIndexBuffer = 
			RsCore::pImpl()->createBuffer( 
				RsBufferDesc( 
					RsBufferType::INDEX, 
					RsResourceCreationFlags::STATIC, 
					IndexBufferSize ) );

		RsCore::pImpl()->updateBuffer( 
			pIndexBuffer, 0, pMeshData->NoofIndices_ * sizeof( BcU16 ), 
			RsResourceUpdateFlags::ASYNC,
			[ pIndexBufferData, IndexBufferSize ]
			( RsBuffer* Buffer, const RsBufferLock& BufferLock )
			{
				BcAssert( Buffer->getDesc().SizeBytes_ == IndexBufferSize );
				BcMemCopy( BufferLock.Buffer_, pIndexBufferData, 
					IndexBufferSize );
			} );
		
		// Setup runtime structure.
		ScnModelMeshRuntime MeshRuntime = 
		{
			PrimitiveIdx,
			pVertexDeclaration,
			pVertexBuffer,
			pIndexBuffer,
			nullptr
		};
		
		// Get resource.
		auto Resource = getPackage()->getCrossRefResource( pMeshData->MaterialRef_ );
		MeshRuntime.MaterialRef_ = Resource;
		BcAssertMsg( MeshRuntime.MaterialRef_.isValid(), "ScnModel: Material reference is invalid. Packing error." );

		// Push into array.
		MeshRuntimes_.push_back( MeshRuntime );
		
		// Advance vertex and index buffers.
		pVertexBufferData += pMeshData->NoofVertices_ * pMeshData->VertexStride_;
		pIndexBufferData += pMeshData->NoofIndices_ * sizeof( BcU16 );
	}

	// Mark as ready.
	markReady();
}