Пример #1
0
void FSlateTextureAtlas::MarkTextureDirty()
{
	check( 
		(GSlateLoadingThreadId != 0) || 
		// Note: For Game thread ownership, there is a point at which multiple worker threads operate on text simulatenously while the game thread is blocked
		// Access to the font cache is controlled through mutexes so we simply need to check that we are not accessing it from the render thread
		// Game thread access is also allowed when the game thread and render thread are the same
		(AtlasOwnerThread == ESlateTextureAtlasOwnerThread::Game && !IsInActualRenderingThread()) || 
		(AtlasOwnerThread == ESlateTextureAtlasOwnerThread::Render && IsInRenderingThread()) 
		);

	bNeedsUpdate = true;
}
Пример #2
0
void FStreetMapVertexFactory::InitVertexFactory( const FStreetMapVertexBuffer& VertexBuffer )
{
	// Setup the vertex factory streams
	FDataType DataType;
	DataType.PositionComponent = STRUCTMEMBER_VERTEXSTREAMCOMPONENT( &VertexBuffer, FStreetMapVertex, Position, VET_Float3 );
	DataType.TextureCoordinates.Add( STRUCTMEMBER_VERTEXSTREAMCOMPONENT( &VertexBuffer, FStreetMapVertex, TextureCoordinate, VET_Float2 ) );
	DataType.TangentBasisComponents[0] = STRUCTMEMBER_VERTEXSTREAMCOMPONENT( &VertexBuffer, FStreetMapVertex, TangentX, VET_PackedNormal);
	DataType.TangentBasisComponents[1] = STRUCTMEMBER_VERTEXSTREAMCOMPONENT( &VertexBuffer, FStreetMapVertex, TangentZ, VET_PackedNormal);
	DataType.ColorComponent = STRUCTMEMBER_VERTEXSTREAMCOMPONENT( &VertexBuffer, FStreetMapVertex, Color, VET_Color );
	
	// Send it off to the rendering thread
	check( !IsInActualRenderingThread() );
	ENQUEUE_UNIQUE_RENDER_COMMAND_TWOPARAMETER(
											   InitStreetMapVertexFactory,
											   FStreetMapVertexFactory*, VertexFactory, this,
											   FDataType, DataType, DataType,
											   {
												   VertexFactory->SetData( DataType );
											   });