Files
UnrealEngineUWP/Engine/Source/Developer/ShaderCompilerCommon/Public/ShaderCompilerCommon.h
Ben Marsh 149375b14b Update copyright notices to 2015.
[CL 2379638 by Ben Marsh in Main branch]
2014-12-07 19:09:38 -05:00

74 lines
2.1 KiB
C

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Core.h"
#include "ShaderCore.h"
/**
* This function looks for resources specified in ResourceTableMap in the
* parameter map, adds them to the resource table, and removes them from the
* parameter map. If a resource is used from a currently unmapped uniform
* buffer we allocate a slot for it from UsedUniformBufferSlots.
*/
extern SHADERCOMPILERCOMMON_API void BuildResourceTableMapping(
const TMap<FString,FResourceTableEntry>& ResourceTableMap,
const TMap<FString,uint32>& ResourceTableLayoutHashes,
TBitArray<>& UsedUniformBufferSlots,
FShaderParameterMap& ParameterMap,
FShaderResourceTable& OutSRT
);
/**
* Builds a token stream out of the resource map. The resource map is one
* of the arrays generated by BuildResourceTableMapping. The token stream
* is used at runtime to gather resources from tables and bind them to the
* appropriate slots.
*/
extern SHADERCOMPILERCOMMON_API void BuildResourceTableTokenStream(
const TArray<uint32>& InResourceMap,
int32 MaxBoundResourceTable,
TArray<uint32>& OutTokenStream
);
// Finds the number of used uniform buffers in a resource map
extern SHADERCOMPILERCOMMON_API int16 GetNumUniformBuffersUsed(const FShaderResourceTable& InSRT);
// This function goes through the shader source and converts
// static struct
// {
// TYPE Member;
// [...]
// } UniformBuffer = { [...] };
//
// TYPE Function([...])
// {
// [...]UniformBuffer.Member[...]
// }
//
//into
//
// /*atic struct
// {
// TYPE Member;
// [...]
// } UniformBuffer = { [...] */
//
// TYPE Function([...])
// {
// [...]UniformBuffer_Member[...]
// }
extern SHADERCOMPILERCOMMON_API bool RemoveUniformBuffersFromSource(FString& SourceCode);
// Cross compiler support/common functionality
extern SHADERCOMPILERCOMMON_API FString CreateCrossCompilerBatchFileContents(
const FString& ShaderFile,
const FString& OutputFile,
const FString& FrequencySwitch,
const FString& EntryPoint,
const FString& VersionSwitch,
const FString& ExtraArguments = TEXT(""));