Add statically disabled geometry shaders on mobile

This commit is contained in:
Wojtek Figat
2024-03-30 22:08:44 +01:00
parent 369c19bd5d
commit e1944bce96
17 changed files with 74 additions and 8 deletions

View File

@@ -45,6 +45,11 @@
#define GPU_ALLOW_TESSELLATION_SHADERS 1
#endif
// True if allow geometry shaders
#ifndef GPU_ALLOW_GEOMETRY_SHADERS
#define GPU_ALLOW_GEOMETRY_SHADERS 1
#endif
// Enable/disable creating GPU resources on separate threads (otherwise only the main thread can be used)
#define GPU_ENABLE_ASYNC_RESOURCES_CREATION 1

View File

@@ -103,7 +103,11 @@ public:
/// <returns>The shader object.</returns>
API_FUNCTION() FORCE_INLINE GPUShaderProgramHS* GetHS(const StringAnsiView& name, int32 permutationIndex = 0) const
{
#if GPU_ALLOW_TESSELLATION_SHADERS
return static_cast<GPUShaderProgramHS*>(GetShader(ShaderStage::Hull, name, permutationIndex));
#else
return nullptr;
#endif
}
/// <summary>
@@ -114,7 +118,11 @@ public:
/// <returns>The shader object.</returns>
API_FUNCTION() FORCE_INLINE GPUShaderProgramDS* GetDS(const StringAnsiView& name, int32 permutationIndex = 0) const
{
#if GPU_ALLOW_TESSELLATION_SHADERS
return static_cast<GPUShaderProgramDS*>(GetShader(ShaderStage::Domain, name, permutationIndex));
#else
return nullptr;
#endif
}
/// <summary>
@@ -125,7 +133,11 @@ public:
/// <returns>The shader object.</returns>
API_FUNCTION() FORCE_INLINE GPUShaderProgramGS* GetGS(const StringAnsiView& name, int32 permutationIndex = 0) const
{
#if GPU_ALLOW_GEOMETRY_SHADERS
return static_cast<GPUShaderProgramGS*>(GetShader(ShaderStage::Geometry, name, permutationIndex));
#else
return nullptr;
#endif
}
/// <summary>