Make reverse z define dynamic
This commit is contained in:
@@ -264,6 +264,9 @@ bool ShaderCompiler::OnCompileBegin()
|
|||||||
const auto profile = GetProfile();
|
const auto profile = GetProfile();
|
||||||
const auto featureLevel = RenderTools::GetFeatureLevel(profile);
|
const auto featureLevel = RenderTools::GetFeatureLevel(profile);
|
||||||
_globalMacros.Add({ "FEATURE_LEVEL", Numbers[(int32)featureLevel] });
|
_globalMacros.Add({ "FEATURE_LEVEL", Numbers[(int32)featureLevel] });
|
||||||
|
#if FLAX_REVERSE_Z
|
||||||
|
_globalMacros.Add({ "FLAX_REVERSE_Z", "1"});
|
||||||
|
#endif
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,22 +4,26 @@
|
|||||||
#define __COMMON__
|
#define __COMMON__
|
||||||
|
|
||||||
// Platform macros
|
// Platform macros
|
||||||
#if !defined(DIRECTX)
|
#ifndef DIRECTX
|
||||||
#define DIRECTX 0
|
#define DIRECTX 0
|
||||||
#endif
|
#endif
|
||||||
#if !defined(OPENGL)
|
#ifndef OPENGL
|
||||||
#define OPENGL 0
|
#define OPENGL 0
|
||||||
#endif
|
#endif
|
||||||
#if !defined(VULKAN)
|
#ifndef VULKAN
|
||||||
#define VULKAN 0
|
#define VULKAN 0
|
||||||
#endif
|
#endif
|
||||||
#if defined(PLATFORM_PS4)
|
#ifdef PLATFORM_PS4
|
||||||
#include "./FlaxPlatforms/PS4/Shaders/PS4Common.hlsl"
|
#include "./FlaxPlatforms/PS4/Shaders/PS4Common.hlsl"
|
||||||
#endif
|
#endif
|
||||||
#if defined(PLATFORM_PS5)
|
#ifdef PLATFORM_PS5
|
||||||
#include "./FlaxPlatforms/PS5/Shaders/PS5Common.hlsl"
|
#include "./FlaxPlatforms/PS5/Shaders/PS5Common.hlsl"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef FLAX_REVERSE_Z
|
||||||
|
#define FLAX_REVERSE_Z 0
|
||||||
|
#endif
|
||||||
|
|
||||||
// Feature levels
|
// Feature levels
|
||||||
#define FEATURE_LEVEL_ES2 0
|
#define FEATURE_LEVEL_ES2 0
|
||||||
#define FEATURE_LEVEL_ES3 1
|
#define FEATURE_LEVEL_ES3 1
|
||||||
@@ -53,9 +57,6 @@
|
|||||||
#define SHADING_MODEL_SUBSURFACE 2
|
#define SHADING_MODEL_SUBSURFACE 2
|
||||||
#define SHADING_MODEL_FOLIAGE 3
|
#define SHADING_MODEL_FOLIAGE 3
|
||||||
|
|
||||||
// Didn't figure out how to pass compilation flags via C++, so hardcode it temporarily
|
|
||||||
#define FLAX_REVERSE_Z 1
|
|
||||||
|
|
||||||
// Detect feature level support
|
// Detect feature level support
|
||||||
#if FEATURE_LEVEL >= FEATURE_LEVEL_SM5
|
#if FEATURE_LEVEL >= FEATURE_LEVEL_SM5
|
||||||
#define CAN_USE_GATHER 1
|
#define CAN_USE_GATHER 1
|
||||||
|
|||||||
Reference in New Issue
Block a user