diff options
author | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
commit | 15740faf9fe9fe4be08965098bbf2947e096aeeb (patch) | |
tree | a730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/Utilities/GLSLUtilities.h |
Diffstat (limited to 'Runtime/Utilities/GLSLUtilities.h')
-rw-r--r-- | Runtime/Utilities/GLSLUtilities.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Runtime/Utilities/GLSLUtilities.h b/Runtime/Utilities/GLSLUtilities.h new file mode 100644 index 0000000..147339d --- /dev/null +++ b/Runtime/Utilities/GLSLUtilities.h @@ -0,0 +1,30 @@ +#ifndef GLSLUTILITIES_H +#define GLSLUTILITIES_H + +#include "Runtime/GfxDevice/GfxDeviceTypes.h" + +class ShaderErrors; + +enum GLSLErrorType +{ + kErrorCompileVertexShader, + kErrorCompileFragShader, + kErrorLinkProgram, + kErrorCount +}; +void OutputGLSLShaderError (const char* log, GLSLErrorType errorType, ShaderErrors& outErrors); + +bool CanUseOptimizedFogCodeGLES(const std::string& srcVS); + +bool PatchShaderFogGLSL (std::string& src, FogMode fog); +bool PatchShaderFogGLES (std::string& srcVS, std::string& srcPS, FogMode fog, bool useOptimizedFogCode); + +// TODO: might be better to share whole parm filling procedure, but good enough for now +// TODO: as for now all gles impls we know returns first elem name +// in case of using array[0] only - arraySize would be 1 +// in case of using array[1] only - arraySize would be 2 and uniform name would be array[0] +// but this behaviour might change in future +bool IsShaderParameterArray(const char* name, unsigned nameLen, int arraySize, bool* isZeroElem=0); + + +#endif |