Commit 1acf438b by Cooper Partin Committed by Jamie Madill

Added define to enable/disable uniform precision validation for shaders.

This feature was requested by developers to allow non-conformant shaders to be used which contain mismatched precisions. Change-Id: I57899efe064f7ffed1c0e43a508930ac70f6aa03 Reviewed-on: https://chromium-review.googlesource.com/277340Tested-by: 's avatarCooper Partin <coopp@microsoft.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent a0b8a41c
...@@ -1533,7 +1533,13 @@ bool Program::linkValidateVariablesBase(InfoLog &infoLog, const std::string &var ...@@ -1533,7 +1533,13 @@ bool Program::linkValidateVariablesBase(InfoLog &infoLog, const std::string &var
bool Program::linkValidateUniforms(InfoLog &infoLog, const std::string &uniformName, const sh::Uniform &vertexUniform, const sh::Uniform &fragmentUniform) bool Program::linkValidateUniforms(InfoLog &infoLog, const std::string &uniformName, const sh::Uniform &vertexUniform, const sh::Uniform &fragmentUniform)
{ {
if (!linkValidateVariablesBase(infoLog, uniformName, vertexUniform, fragmentUniform, true)) #if ANGLE_PROGRAM_LINK_VALIDATE_UNIFORM_PRECISION == ANGLE_ENABLED
const bool validatePrecision = true;
#else
const bool validatePrecision = false;
#endif
if (!linkValidateVariablesBase(infoLog, uniformName, vertexUniform, fragmentUniform, validatePrecision))
{ {
return false; return false;
} }
......
...@@ -37,4 +37,13 @@ ...@@ -37,4 +37,13 @@
#define ANGLE_SHADER_DEBUG_INFO ANGLE_DISABLED #define ANGLE_SHADER_DEBUG_INFO ANGLE_DISABLED
#endif #endif
// Program link validation of precisions for uniforms. This feature was
// requested by developers to allow non-conformant shaders to be used which
// contain mismatched precisions.
// ENABLED validate that precision for uniforms match between vertex and fragment shaders
// DISABLED allow precision for uniforms to differ between vertex and fragment shaders
#if !defined(ANGLE_PROGRAM_LINK_VALIDATE_UNIFORM_PRECISION)
#define ANGLE_PROGRAM_LINK_VALIDATE_UNIFORM_PRECISION ANGLE_ENABLED
#endif
#endif // LIBANGLE_FEATURES_H_ #endif // LIBANGLE_FEATURES_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment