Files
UnrealEngineUWP/Engine/Shaders/Definitions.usf
Marcus Wassmer ac56844346 Add permutations to various global shaders to compile out ClearCoat handling if there are no clearcoat materials in the given view.
Also FViewInfo now accumulates a mask of all lightingprofiles used in a given view during the relevancy calculation.
#codereview daniel.wright,martin.mittring

[CL 2505772 by Marcus Wassmer in Main branch]
2015-04-08 16:15:25 -04:00

205 lines
4.5 KiB
Plaintext

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
/*=============================================================================
Definitions.usf: Defines undefined defines to 0 as Cg can't handle them.
=============================================================================*/
#ifndef MATERIAL_TWOSIDED
#define MATERIAL_TWOSIDED 0
#endif
#ifndef MATERIAL_TANGENTSPACENORMAL
#define MATERIAL_TANGENTSPACENORMAL 0
#endif
#ifndef MATERIAL_TWOSIDED_SEPARATE_PASS
#define MATERIAL_TWOSIDED_SEPARATE_PASS 0
#endif
#ifndef MATERIALBLENDING_MASKED
#define MATERIALBLENDING_MASKED 0
#endif
#ifndef MATERIALBLENDING_TRANSLUCENT
#define MATERIALBLENDING_TRANSLUCENT 0
#endif
#ifndef MATERIALBLENDING_ADDITIVE
#define MATERIALBLENDING_ADDITIVE 0
#endif
#ifndef MATERIALBLENDING_MODULATE
#define MATERIALBLENDING_MODULATE 0
#endif
#ifndef MATERIAL_SHADINGMODEL_DEFAULT_LIT
#define MATERIAL_SHADINGMODEL_DEFAULT_LIT 0
#endif
#ifndef MATERIAL_SHADINGMODEL_SUBSURFACE
#define MATERIAL_SHADINGMODEL_SUBSURFACE 0
#endif
#ifndef MATERIAL_SHADINGMODEL_PREINTEGRATED_SKIN
#define MATERIAL_SHADINGMODEL_PREINTEGRATED_SKIN 0
#endif
#ifndef MATERIAL_SHADINGMODEL_UNLIT
#define MATERIAL_SHADINGMODEL_UNLIT 0
#endif
#ifndef HAS_PRIMITIVE_UNIFORM_BUFFER
#define HAS_PRIMITIVE_UNIFORM_BUFFER 0
#endif
#ifndef OUTPUT_DEPTH_TO_ALPHA
#define OUTPUT_DEPTH_TO_ALPHA 0
#endif
#ifndef COMPILER_CG
#define COMPILER_CG 0
#endif
#ifndef COMPILER_HLSL
#define COMPILER_HLSL 0
#endif
#ifndef COMPILER_GLSL
#define COMPILER_GLSL 0
#endif
#ifndef COMPILER_GLSL_ES2
#define COMPILER_GLSL_ES2 0
#endif
#ifndef COMPILER_SUPPORTS_ATTRIBUTES
#define COMPILER_SUPPORTS_ATTRIBUTES 0
#endif
#ifndef SM5_PROFILE
#define SM5_PROFILE 0
#endif
#ifndef SM4_PROFILE
#define SM4_PROFILE 0
#endif
#ifndef ES2_PROFILE
#define ES2_PROFILE 0
#endif
#ifndef ES3_1_PROFILE
#define ES3_1_PROFILE 0
#endif
#ifndef METAL_PROFILE
#define METAL_PROFILE 0
#endif
#ifndef METAL_MRT_PROFILE
#define METAL_MRT_PROFILE 0
#endif
#ifndef IOS
#define IOS 0
#endif
#ifndef MAC
#define MAC 0
#endif
#ifndef USING_TESSELLATION
#define USING_TESSELLATION 0
#endif
#ifndef OUTPUT_GBUFFER_VELOCITY
#define OUTPUT_GBUFFER_VELOCITY 0
#endif
#define PC_D3D SM5_PROFILE
#ifndef NEEDS_LIGHTMAP_COORDINATE
#define NEEDS_LIGHTMAP_COORDINATE 0
#endif
#ifndef TESSELLATION_TYPE_FLAT
#define TESSELLATION_TYPE_FLAT 0
#endif
#ifndef TESSELLATION_TYPE_PNTRIANGLES
#define TESSELLATION_TYPE_PNTRIANGLES 0
#endif
#ifndef USE_ADAPTIVE_TESSELLATION_FACTOR
#define USE_ADAPTIVE_TESSELLATION_FACTOR 1
#endif
#ifndef LANDSCAPE_XYOFFSET
#define LANDSCAPE_XYOFFSET 0
#endif
#ifndef MATERIAL_ATMOSPHERIC_FOG
#define MATERIAL_ATMOSPHERIC_FOG 0
#endif
#ifndef BASEPASS_ATMOSPHERIC_FOG
#define BASEPASS_ATMOSPHERIC_FOG 0
#endif
#ifndef NUM_VF_PACKED_INTERPOLANTS
#define NUM_VF_PACKED_INTERPOLANTS 0
#endif
#ifndef USE_CLEARCOAT
#define USE_CLEARCOAT 0
#endif
#if SM5_PROFILE || COMPILER_SUPPORTS_ATTRIBUTES
/** Avoids flow control constructs. */
#define UNROLL [unroll]
/** Gives preference to flow control constructs. */
#define LOOP [loop]
/** Performs branching by using control flow instructions like jmp and label. */
#define BRANCH [branch]
/** Performs branching by using the cnd instructions. */
#define FLATTEN [flatten]
/** Executes the conditional part of an if statement when the condition is true for all threads on which the current shader is running. */
#define IFALL [ifAll]
/** Executes the conditional part of an if statement when the condition is true for any thread on which the current shader is running. */
#define IFANY [ifAny]
/** Allows a compute shader loop termination condition to be based off of a UAV read. The loop must not contain synchronization intrinsics. */
#define ALLOW_UAV_CONDITION [allow_uav_condition]
#else
#ifndef UNROLL
#define UNROLL
#endif
#ifndef LOOP
#define LOOP
#endif
#ifndef BRANCH
#define BRANCH
#endif
#ifndef FLATTEN
#define FLATTEN
#endif
#ifndef IFALL
#define IFALL
#endif
#ifndef IFANY
#define IFANY
#endif
#endif
#define ISOLATE
#define NOEXPRESSIONOPTIMIZATIONS
#if SM5_PROFILE
#define EARLYDEPTHSTENCIL [earlydepthstencil]
#else
#define EARLYDEPTHSTENCIL
#endif
#ifndef HAS_INVERTED_Z_BUFFER
#define HAS_INVERTED_Z_BUFFER 1
#endif