当前位置: 首页>>代码示例>>C++>>正文


C++ TArray::AddZeroed方法代码示例

本文整理汇总了C++中TArray::AddZeroed方法的典型用法代码示例。如果您正苦于以下问题:C++ TArray::AddZeroed方法的具体用法?C++ TArray::AddZeroed怎么用?C++ TArray::AddZeroed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TArray的用法示例。


在下文中一共展示了TArray::AddZeroed方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: BuildSkeleton

// function is similar to part of CSkelMeshInstance::SetMesh()
static void BuildSkeleton(TArray<CCoords> &Coords, const TArray<RJoint> &Bones, const TArray<AnalogTrack> &Anim)
{
	guard(BuildSkeleton);

	int numBones = Anim.Num();
	Coords.Empty(numBones);
	Coords.AddZeroed(numBones);

	for (int i = 0; i < numBones; i++)
	{
		const AnalogTrack &A = Anim[i];
		const RJoint &B = Bones[i];
		CCoords &BC = Coords[i];
		// compute reference bone coords
		CVec3 BP;
		CQuat BO;
		// get default pose
		BP = CVT(A.KeyPos[0]);
		BO = CVT(A.KeyQuat[0]);
		if (!i) BO.Conjugate();

		BC.origin = BP;
		BO.ToAxis(BC.axis);
		// move bone position to global coordinate space
		if (i)	// do not rotate root bone
		{
			assert(B.parent >= 0);
			Coords[B.parent].UnTransformCoords(BC, BC);
		}
	}

	unguard;
}
开发者ID:gildor2,项目名称:UModel,代码行数:34,代码来源:UnMeshRune.cpp

示例2: Decode

/**
 * Decodes a Base64 string into a FString
 *
 * @param Source the stringified data to convert
 * @param Dest the out buffer that will be filled with the decoded data
 */
bool FBase64::Decode(const FString& Source, FString& Dest)
{
	uint32 Length = Source.Len();
	// Size must be a multiple of 4
	if (Length % 4)
	{
		return false;
	}
	// Each 4 uint8 chunk of characters is 3 bytes of data
	uint32 ExpectedLength = Length / 4 * 3;
	TArray<ANSICHAR> TempDest;
	TempDest.AddZeroed(ExpectedLength);
	uint8* Buffer = (uint8*)TempDest.GetData();
	uint32 PadCount = 0;

	bool bWasSuccessful = Decode(TCHAR_TO_ANSI(*Source), Length, Buffer, PadCount);
	if (bWasSuccessful)
	{
		if (PadCount > 0)
		{
			Buffer[ExpectedLength - PadCount] = 0;
		}
		else
		{
			TempDest.Add('\0');
		}
		Dest = ANSI_TO_TCHAR(TempDest.GetData());
	}
	return bWasSuccessful;
}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:36,代码来源:Base64.cpp

示例3: ReadSpriteTexture

bool FPaperAtlasTextureHelpers::ReadSpriteTexture(UTexture* SourceTexture, const FIntPoint& SourceXY, const FIntPoint& SourceSize, TArray<uint8>& TargetBuffer)
{
	{
		const int32 BytesPerPixel = 4;
		TargetBuffer.Empty();
		TargetBuffer.AddZeroed(SourceSize.X * SourceSize.Y * BytesPerPixel);
	}

	check(SourceTexture);
	FTextureSource& SourceData = SourceTexture->Source;
	if (SourceData.GetFormat() == TSF_BGRA8)
	{
		uint32 BytesPerPixel = SourceData.GetBytesPerPixel();
		uint8* OffsetSource = SourceData.LockMip(0) + (SourceXY.X + SourceXY.Y * SourceData.GetSizeX()) * BytesPerPixel;
		uint8* OffsetDest = TargetBuffer.GetData();
		CopyTextureData(OffsetSource, OffsetDest, SourceSize.X, SourceSize.Y, BytesPerPixel, SourceData.GetSizeX() * BytesPerPixel, SourceSize.X * BytesPerPixel);
		SourceData.UnlockMip(0);
	}
	else
	{
		UE_LOG(LogPaper2DEditor, Error, TEXT("Sprite texture %s is not BGRA8, which isn't supported in atlases yet"), *SourceTexture->GetName());
	}

	return true;
}
开发者ID:AndyHuang7601,项目名称:EpicGames-UnrealEngine,代码行数:25,代码来源:PaperAtlasTextureHelpers.cpp

示例4: DumpAllocs

/**
 * Dump allocation information.
 */
void FBestFitAllocator::DumpAllocs( FOutputDevice& Ar/*=*GLog*/ )
{		
	// Memory usage stats.
	INT				UsedSize		= 0;
	INT				FreeSize		= 0;
	INT				NumUsedChunks	= 0;
	INT				NumFreeChunks	= 0;
	
	// Fragmentation and allocation size visualization.
	INT				NumBlocks		= MemorySize / AllocationAlignment;
	INT				Dimension		= 1 + NumBlocks / appTrunc(appSqrt(NumBlocks));			
	TArray<FColor>	AllocationVisualization;
	AllocationVisualization.AddZeroed( Dimension * Dimension );
	INT				VisIndex		= 0;

	// Traverse linked list and gather allocation information.
	FMemoryChunk*	CurrentChunk	= FirstChunk;	
	while( CurrentChunk )
	{
		FColor VisColor;
		// Free chunk.
		if( CurrentChunk->bIsAvailable )
		{
			NumFreeChunks++;
			FreeSize += CurrentChunk->Size;
			VisColor = FColor(0,255,0);
		}
		// Allocated chunk.
		else
		{
			NumUsedChunks++;
			UsedSize += CurrentChunk->Size;
			
			// Slightly alternate coloration to also visualize allocation sizes.
			if( NumUsedChunks % 2 == 0 )
			{
				VisColor = FColor(255,0,0);
			}
			else
			{
				VisColor = FColor(192,0,0);
			}
		}

		for( INT i=0; i<(CurrentChunk->Size/AllocationAlignment); i++ )
		{
			AllocationVisualization(VisIndex++) = VisColor;
		}

		CurrentChunk = CurrentChunk->NextChunk;
	}

	check(UsedSize == AllocatedMemorySize);
	check(FreeSize == AvailableMemorySize);

	// Write out bitmap for visualization of fragmentation and allocation patterns.
	appCreateBitmap( TEXT("..\\..\\Binaries\\TextureMemory"), Dimension, Dimension, AllocationVisualization.GetTypedData() );
	Ar.Logf( TEXT("BestFitAllocator: Allocated %i KByte in %i chunks, leaving %i KByte in %i chunks."), UsedSize / 1024, NumUsedChunks, FreeSize / 1024, NumFreeChunks );
	Ar.Logf( TEXT("BestFitAllocator: %5.2f ms in allocator"), TimeSpentInAllocator * 1000 );
}
开发者ID:LiuKeHua,项目名称:colorful-engine,代码行数:63,代码来源:BestFitAllocator.cpp

示例5:

TArray<uint8> UGTCaptureComponent::CapturePng(FString Mode)
{
	// Flush location and rotation
	check(CaptureComponents.Num() != 0);
	USceneCaptureComponent2D* CaptureComponent = CaptureComponents.FindRef(Mode);

	TArray<uint8> ImgData;
	if (CaptureComponent == nullptr)
		return ImgData;

	// Attach this to something, for example, a real camera
	const FRotator PawnViewRotation = Pawn->GetViewRotation();
	if (!PawnViewRotation.Equals(CaptureComponent->GetComponentRotation()))
	{
		CaptureComponent->SetWorldRotation(PawnViewRotation);
	}

	UTextureRenderTarget2D* RenderTarget = CaptureComponent->TextureTarget;
	static IImageWrapperModule& ImageWrapperModule = FModuleManager::LoadModuleChecked<IImageWrapperModule>(FName("ImageWrapper"));
	static TSharedPtr<IImageWrapper> ImageWrapper = ImageWrapperModule.CreateImageWrapper(EImageFormat::PNG);
	int32 Width = RenderTarget->SizeX, Height = RenderTarget->SizeY;
	TArray<FColor> Image;
	FTextureRenderTargetResource* RenderTargetResource;
	Image.AddZeroed(Width * Height);
	RenderTargetResource = RenderTarget->GameThread_GetRenderTargetResource();

	FReadSurfaceDataFlags ReadSurfaceDataFlags;
	ReadSurfaceDataFlags.SetLinearToGamma(false); // This is super important to disable this!
												  // Instead of using this flag, we will set the gamma to the correct value directly
	RenderTargetResource->ReadPixels(Image, ReadSurfaceDataFlags);
	ImageWrapper->SetRaw(Image.GetData(), Image.GetAllocatedSize(), Width, Height, ERGBFormat::BGRA, 8);
	ImgData = ImageWrapper->GetCompressed();

	return ImgData;
}
开发者ID:Batname,项目名称:unrealcv,代码行数:35,代码来源:GTCaptureComponent.cpp

示例6: MontagePreview_FindLastSection

int32 UAnimPreviewInstance::MontagePreview_FindLastSection(int32 StartSectionIdx)
{
	int32 ResultIdx = StartSectionIdx;
	if (UAnimMontage* Montage = Cast<UAnimMontage>(CurrentAsset))
	{
		if (FAnimMontageInstance* CurMontageInstance = GetActiveMontageInstance())
		{
			int32 TotalSection = Montage->CompositeSections.Num();
			if (TotalSection > 0)
			{
				TArray<bool> AlreadyVisited;
				AlreadyVisited.AddZeroed(TotalSection);
				int32 CurrentSectionIdx = StartSectionIdx;
				while (CurrentSectionIdx != INDEX_NONE && ! AlreadyVisited[CurrentSectionIdx])
				{
					AlreadyVisited[CurrentSectionIdx] = true;
					ResultIdx = CurrentSectionIdx;
					if (CurMontageInstance->NextSections.IsValidIndex(CurrentSectionIdx))
					{
						CurrentSectionIdx = CurMontageInstance->NextSections[CurrentSectionIdx];
					}
				}
			}
		}
	}
	return ResultIdx;
}
开发者ID:didixp,项目名称:Ark-Dev-Kit,代码行数:27,代码来源:AnimPreviewInstance.cpp

示例7: AddSprite

	const FAtlasedTextureSlot* AddSprite(UPaperSprite* Sprite)
	{
		const FVector2D SpriteSizeFloat = Sprite->GetSourceSize();
		const FIntPoint SpriteSize(FMath::TruncToInt(SpriteSizeFloat.X), FMath::TruncToInt(SpriteSizeFloat.Y));

		TArray<uint8> DummyBuffer;
		DummyBuffer.AddZeroed(SpriteSize.X * SpriteSize.Y * Stride);
		
		check(Sprite->GetSourceTexture());
		FTextureSource& SourceData = Sprite->GetSourceTexture()->Source;

		//@TODO: Handle different texture formats!
		if (SourceData.GetFormat() == TSF_BGRA8)
		{
			uint32 BytesPerPixel = SourceData.GetBytesPerPixel();
			uint8* OffsetSource = SourceData.LockMip(0) + (FMath::TruncToInt(Sprite->GetSourceUV().X) + FMath::TruncToInt(Sprite->GetSourceUV().Y) * SourceData.GetSizeX()) * BytesPerPixel;
			uint8* OffsetDest = DummyBuffer.GetData();

			CopyTextureData(OffsetSource, OffsetDest, SpriteSize.X, SpriteSize.Y, BytesPerPixel, SourceData.GetSizeX() * BytesPerPixel, SpriteSize.X * BytesPerPixel);

			SourceData.UnlockMip(0);
		}
		else
		{
			UE_LOG(LogPaper2DEditor, Error, TEXT("Sprite %s is not BGRA8, which isn't supported in atlases yet"), *(Sprite->GetPathName()));
		}

		const FAtlasedTextureSlot* Slot = AddTexture(SpriteSize.X, SpriteSize.Y, DummyBuffer);
		if (Slot != nullptr)
		{
			SpriteToSlotMap.Add(Sprite, Slot);
		}

		return Slot;
	}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:35,代码来源:PaperAtlasGenerator.cpp

示例8: Recompress

	virtual int32 Recompress(FName Format, const TArray<uint8>& SrcBuffer, FSoundQualityInfo& QualityInfo, TArray<uint8>& OutBuffer) const override
	{
		check(Format == NAME_OPUS);
		FOpusAudioInfo	AudioInfo;

		// Cannot quality preview multichannel sounds
		if( QualityInfo.NumChannels > 2 )
		{
			return 0;
		}

		TArray<uint8> CompressedDataStore;
		if( !Cook( Format, SrcBuffer, QualityInfo, CompressedDataStore ) )
		{
			return 0;
		}

		// Parse the opus header for the relevant information
		if( !AudioInfo.ReadCompressedInfo( CompressedDataStore.GetData(), CompressedDataStore.Num(), &QualityInfo ) )
		{
			return 0;
		}

		// Decompress all the sample data
		OutBuffer.Empty(QualityInfo.SampleDataSize);
		OutBuffer.AddZeroed(QualityInfo.SampleDataSize);
		AudioInfo.ExpandFile( OutBuffer.GetData(), &QualityInfo );

		return CompressedDataStore.Num();
	}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:30,代码来源:AudioFormatOpus.cpp

示例9: IsLoop

bool SAnimMontageSectionsPanel::IsLoop(int32 SectionIdx)
{
	if(Montage && Montage->CompositeSections.IsValidIndex(SectionIdx))
	{
		TArray<bool>	Used;
		Used.AddZeroed(Montage->CompositeSections.Num());
		int32 CurrentIdx = SectionIdx;
		while(true)
		{
			CurrentIdx = Montage->GetSectionIndex(Montage->CompositeSections[CurrentIdx].NextSectionName);
			if(CurrentIdx == INDEX_NONE)
			{
				// End of the chain
				return false;
			}
			if(CurrentIdx == SectionIdx)
			{
				// Hit the starting position, return true
				return true;
			}
			if(Used[CurrentIdx])
			{
				// Hit a loop but the starting section was part of it, so return false
				return false;
			}
			Used[CurrentIdx]=true;
		}
	}
	return false;
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:30,代码来源:SAnimMontageSectionsPanel.cpp

示例10: while

bool UMP3Decoder::Decode(TArray<uint8> &OutBuffer)
{
	check(OutBuffer.Num() == 0);
	check(OutBuffer.GetAllocatedSize() >= WAV_HEADER_SIZE);
	OutBuffer.AddZeroed(WAV_HEADER_SIZE / OutBuffer.GetTypeSize());

	FDateTime tStart = FDateTime::Now();

	unsigned char* BlockBuffer = (unsigned char*)FMemory::Malloc(BlockBufferSize);
	size_t bytesRead = 0;
	size_t done = 0;
	int result;

	do
	{
		result = mpg123_read(Handle, BlockBuffer, BlockBufferSize, &done);
		bytesRead += done;
		OutBuffer.Append(BlockBuffer, done);
	} while (result == MPG123_OK);

	uint8 header[WAV_HEADER_SIZE];
	
	WriteWaveHeader(header, bytesRead, Samplerate, Channels);
	
	FMemory::Memcpy(OutBuffer.GetData(), header, WAV_HEADER_SIZE);
	FMemory::Free(BlockBuffer);

	SizeInBytes = bytesRead;
	bool bSuccess = result == MPG123_OK || result == MPG123_DONE;

	UE_LOG(MP3ImporterLog, Display, TEXT("Decoding finished. %s bytes in %d ms. Success: %s"), 
		*FString::FormatAsNumber((int32)bytesRead), (int32)(FDateTime::Now() - tStart).GetTotalMilliseconds(), bSuccess ? TEXT("True") : TEXT("False"));

	return bSuccess;
}
开发者ID:amyvmiwei,项目名称:UE4_MP3Importer,代码行数:35,代码来源:MP3Decoder.cpp

示例11: BuildResourceTableTokenStream

void BuildResourceTableTokenStream(const TArray<uint32>& InResourceMap, int32 MaxBoundResourceTable, TArray<uint32>& OutTokenStream)
{
	// First we sort the resource map.
	TArray<uint32> SortedResourceMap = InResourceMap;
	SortedResourceMap.Sort();

	// The token stream begins with a table that contains offsets per bound uniform buffer.
	// This offset provides the start of the token stream.
	OutTokenStream.AddZeroed(MaxBoundResourceTable+1);
	auto LastBufferIndex = FRHIResourceTableEntry::GetEndOfStreamToken();
	for (int32 i = 0; i < SortedResourceMap.Num(); ++i)
	{
		auto BufferIndex = FRHIResourceTableEntry::GetUniformBufferIndex(SortedResourceMap[i]);
		if (BufferIndex != LastBufferIndex)
		{
			// Store the offset for resources from this buffer.
			OutTokenStream[BufferIndex] = OutTokenStream.Num();
			LastBufferIndex = BufferIndex;
		}
		OutTokenStream.Add(SortedResourceMap[i]);
	}

	// Add a token to mark the end of the stream. Not needed if there are no bound resources.
	if (OutTokenStream.Num())
	{
		OutTokenStream.Add(FRHIResourceTableEntry::GetEndOfStreamToken());
	}
}
开发者ID:johndpope,项目名称:UE4,代码行数:28,代码来源:ShaderCompilerCommon.cpp

示例12: OnRep_UpdateEQS

void UGameplayDebuggingComponent::OnRep_UpdateEQS()
{
#if  USE_EQS_DEBUGGER
    // decode scoring data
    if (World && World->GetNetMode() == NM_Client)
    {
        TArray<uint8> UncompressedBuffer;
        int32 UncompressedSize = 0;
        const int32 HeaderSize = sizeof(int32);
        uint8* SrcBuffer = (uint8*)EQSRepData.GetData();
        FMemory::Memcpy(&UncompressedSize, SrcBuffer, HeaderSize);
        SrcBuffer += HeaderSize;
        const int32 CompressedSize = EQSRepData.Num() - HeaderSize;

        UncompressedBuffer.AddZeroed(UncompressedSize);

        FCompression::UncompressMemory((ECompressionFlags)(COMPRESS_ZLIB), (void*)UncompressedBuffer.GetData(), UncompressedSize, SrcBuffer, CompressedSize);
        FMemoryReader ArReader(UncompressedBuffer);

        ArReader << EQSLocalData;
    }

    UpdateBounds();
    MarkRenderStateDirty();
#endif //USE_EQS_DEBUGGER
}
开发者ID:Art1stical,项目名称:AHRUnrealEngine,代码行数:26,代码来源:GameplayDebuggingComponent.cpp

示例13: FillSpaceBases

void USkeletalMeshComponent::FillSpaceBases()
{
	SCOPE_CYCLE_COUNTER(STAT_SkelComposeTime);

	if( !SkeletalMesh )
	{
		return;
	}

	// right now all this does is to convert to SpaceBases
	check( SkeletalMesh->RefSkeleton.GetNum() == LocalAtoms.Num() );
	check( SkeletalMesh->RefSkeleton.GetNum() == SpaceBases.Num() );
	check( SkeletalMesh->RefSkeleton.GetNum() == BoneVisibilityStates.Num() );

	const int32 NumBones = LocalAtoms.Num();

#if (UE_BUILD_DEBUG || UE_BUILD_DEVELOPMENT)
	/** Keep track of which bones have been processed for fast look up */
	TArray<uint8> BoneProcessed;
	BoneProcessed.AddZeroed(NumBones);
#endif

	FTransform * LocalTransformsData = LocalAtoms.GetTypedData(); 
	FTransform * SpaceBasesData = SpaceBases.GetTypedData();

	// First bone is always root bone, and it doesn't have a parent.
	{
		check( RequiredBones[0] == 0 );
		SpaceBases[0] = LocalAtoms[0];

#if (UE_BUILD_DEBUG || UE_BUILD_DEVELOPMENT)
		// Mark bone as processed
		BoneProcessed[0] = 1;
#endif
	}

	for(int32 i=1; i<RequiredBones.Num(); i++)
	{
		const int32 BoneIndex = RequiredBones[i];
		FPlatformMisc::Prefetch(SpaceBasesData + BoneIndex);

#if (UE_BUILD_DEBUG || UE_BUILD_DEVELOPMENT)
		// Mark bone as processed
		BoneProcessed[BoneIndex] = 1;
#endif
		// For all bones below the root, final component-space transform is relative transform * component-space transform of parent.
		const int32 ParentIndex = SkeletalMesh->RefSkeleton.GetParentIndex(BoneIndex);
		FPlatformMisc::Prefetch(SpaceBasesData + ParentIndex);

#if (UE_BUILD_DEBUG || UE_BUILD_DEVELOPMENT)
		// Check the precondition that Parents occur before Children in the RequiredBones array.
		checkSlow(BoneProcessed[ParentIndex] == 1);
#endif
		FTransform::Multiply(SpaceBasesData + BoneIndex, LocalTransformsData + BoneIndex, SpaceBasesData + ParentIndex);

		checkSlow( SpaceBases[BoneIndex].IsRotationNormalized() );
		checkSlow( !SpaceBases[BoneIndex].ContainsNaN() );
	}
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:59,代码来源:SkeletalMeshComponent.cpp

示例14: CreateDiskEntryRuntimeObjects

void FVulkanPipelineStateCache::CreateDiskEntryRuntimeObjects(FDiskEntry* DiskEntry)
{
	{
		// Descriptor Set Layouts
		DiskEntry->DescriptorSetLayouts.AddZeroed(DiskEntry->DescriptorSetLayoutBindings.Num());
		for (int32 SetIndex = 0; SetIndex < DiskEntry->DescriptorSetLayoutBindings.Num(); ++SetIndex)
		{
			TArray<VkDescriptorSetLayoutBinding> DescriptorBindings;
			DescriptorBindings.AddZeroed(DiskEntry->DescriptorSetLayoutBindings[SetIndex].Num());
			for (int32 Index = 0; Index < DiskEntry->DescriptorSetLayoutBindings[SetIndex].Num(); ++Index)
			{
				DiskEntry->DescriptorSetLayoutBindings[SetIndex][Index].WriteInto(DescriptorBindings[Index]);
			}

			VkDescriptorSetLayoutCreateInfo DescriptorLayoutInfo;
			FMemory::Memzero(DescriptorLayoutInfo);
			DescriptorLayoutInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO;
			DescriptorLayoutInfo.pNext = nullptr;
			DescriptorLayoutInfo.bindingCount = DescriptorBindings.Num();
			DescriptorLayoutInfo.pBindings = DescriptorBindings.GetData();

			VERIFYVULKANRESULT(VulkanRHI::vkCreateDescriptorSetLayout(Device->GetInstanceHandle(), &DescriptorLayoutInfo, nullptr, &DiskEntry->DescriptorSetLayouts[SetIndex]));
		}

		// Pipeline layout
		VkPipelineLayoutCreateInfo PipelineLayoutInfo;
		FMemory::Memzero(PipelineLayoutInfo);
		PipelineLayoutInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO;
		//PipelineLayoutInfo.pNext = nullptr;
		PipelineLayoutInfo.setLayoutCount = DiskEntry->DescriptorSetLayouts.Num();
		PipelineLayoutInfo.pSetLayouts = DiskEntry->DescriptorSetLayouts.GetData();
		//PipelineLayoutInfo.pushConstantRangeCount = 0;
		//PipelineLayoutInfo.pPushConstantRanges = nullptr;

		VERIFYVULKANRESULT(VulkanRHI::vkCreatePipelineLayout(Device->GetInstanceHandle(), &PipelineLayoutInfo, nullptr, &DiskEntry->PipelineLayout));
	}

	{
		// Shaders
		for (int32 Index = 0; Index < ARRAY_COUNT(DiskEntry->ShaderMicrocodes); ++Index)
		{
			if (DiskEntry->ShaderMicrocodes[Index].Num() != 0)
			{
				VkShaderModuleCreateInfo ModuleCreateInfo;
				FMemory::Memzero(ModuleCreateInfo);
				ModuleCreateInfo.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO;
				ModuleCreateInfo.codeSize = DiskEntry->ShaderMicrocodes[Index].Num();
				ModuleCreateInfo.pCode = (uint32*)DiskEntry->ShaderMicrocodes[Index].GetData();
				VERIFYVULKANRESULT(VulkanRHI::vkCreateShaderModule(Device->GetInstanceHandle(), &ModuleCreateInfo, nullptr, &DiskEntry->ShaderModules[Index]));
			}
		}
	}

	{
		FVulkanRenderTargetLayout RTLayout;
		DiskEntry->RenderTargets.WriteInto(RTLayout);
		DiskEntry->RenderPass = new FVulkanRenderPass(*Device, RTLayout);
	}
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:59,代码来源:VulkanPipeline.cpp

示例15: RegisterResource

	void RegisterResource(const FAIResourceID& Resource)
	{
		if (FAIResourceID::GetSize() > static_cast<uint32>(FAIResources::ResourceIDs.Num()))
		{
			ResourceIDs.AddZeroed(FAIResourceID::GetSize() - FAIResources::ResourceIDs.Num());
		}
		ResourceIDs[Resource.Index] = Resource;
	}
开发者ID:colwalder,项目名称:unrealengine,代码行数:8,代码来源:AITypes.cpp


注:本文中的TArray::AddZeroed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。