Revert "Translator: Remove the SH_VALIDATE flag"

This reverts commit 4ca3d7d643.

Reason for revert: breaks roll into Chromium crrev.com/c/3213239
SH_VALIDATE is used in gpu_unittests.

Original change's description:
> Translator: Remove the SH_VALIDATE flag
>
> The SH_VALIDATE flag is a noop, defined as zero (0).
>
> Also move option descriptions up in the file.
>
> Bug: angleproject:6501
> Change-Id: I898106eb68b4508d8f94534cbff66652a69f4f3e
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3207360
> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
> Commit-Queue: Cody Northrop <cnorthrop@google.com>

Bug: angleproject:6501
Change-Id: Ia9983eac58a07e2a6e3d5fe4d1bfccfb9c48ccd0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3212709
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
This commit is contained in:
Yuly Novikov 2021-10-08 02:56:38 +00:00 коммит произвёл Angle LUCI CQ
Родитель fab8834323
Коммит 701e8892f4
2 изменённых файлов: 19 добавлений и 15 удалений

Просмотреть файл

@ -82,19 +82,8 @@ enum ShShaderOutput
// Compile options.
// The Compile options type is defined in ShaderVars.h, to allow ANGLE to import the ShaderVars
// header without needing the ShaderLang header. This avoids some conflicts with glslang.
// SH_VALIDATE_LOOP_INDEXING: Validates loop and indexing in the shader to
// ensure that they do not exceed the minimum
// functionality mandated in GLSL 1.0 spec,
// Appendix A, Section 4 and 5.
// There is no need to specify this parameter when
// compiling for WebGL - it is implied.
// SH_OBJECT_CODE: Translates intermediate tree to glsl or hlsl shader, or SPIR-V binary.
// Can be queried by calling sh::GetObjectCode().
// SH_VARIABLES: Extracts attributes, uniforms, and varyings.
// Can be queried by calling ShGetVariableInfo().
// SH_LINE_DIRECTIVES: Emits #line directives in HLSL.
// SH_SOURCE_PATH: Tracks the source path for shaders.
// Can be queried with getSourcePath().
const ShCompileOptions SH_VALIDATE = 0;
const ShCompileOptions SH_VALIDATE_LOOP_INDEXING = UINT64_C(1) << 0;
const ShCompileOptions SH_INTERMEDIATE_TREE = UINT64_C(1) << 1;
const ShCompileOptions SH_OBJECT_CODE = UINT64_C(1) << 2;
@ -656,7 +645,22 @@ void Destruct(ShHandle handle);
// shaderStrings: Specifies an array of pointers to null-terminated strings containing the shader
// source code.
// numStrings: Specifies the number of elements in shaderStrings array.
// compileOptions: A mask of compile options defined above.
// compileOptions: A mask containing the following parameters:
// SH_VALIDATE: Validates shader to ensure that it conforms to the spec
// specified during compiler construction.
// SH_VALIDATE_LOOP_INDEXING: Validates loop and indexing in the shader to
// ensure that they do not exceed the minimum
// functionality mandated in GLSL 1.0 spec,
// Appendix A, Section 4 and 5.
// There is no need to specify this parameter when
// compiling for WebGL - it is implied.
// SH_INTERMEDIATE_TREE: Writes intermediate tree to info log.
// Can be queried by calling sh::GetInfoLog().
// SH_OBJECT_CODE: Translates intermediate tree to glsl or hlsl shader, or SPIR-V binary.
// Can be queried by calling sh::GetObjectCode().
// SH_VARIABLES: Extracts attributes, uniforms, and varyings.
// Can be queried by calling ShGetVariableInfo().
//
bool Compile(const ShHandle handle,
const char *const shaderStrings[],
size_t numStrings,

Просмотреть файл

@ -24,7 +24,7 @@ namespace
// Options supported by any output
constexpr ShCompileOptions kCommonOptions =
SH_VALIDATE_LOOP_INDEXING | SH_INTERMEDIATE_TREE | SH_OBJECT_CODE | SH_VARIABLES |
SH_VALIDATE | SH_VALIDATE_LOOP_INDEXING | SH_INTERMEDIATE_TREE | SH_OBJECT_CODE | SH_VARIABLES |
SH_LINE_DIRECTIVES | SH_SOURCE_PATH | SH_REMOVE_INVARIANT_AND_CENTROID_FOR_ESSL3 |
SH_EMULATE_ABS_INT_FUNCTION | SH_ENFORCE_PACKING_RESTRICTIONS | SH_CLAMP_INDIRECT_ARRAY_BOUNDS |
SH_LIMIT_EXPRESSION_COMPLEXITY | SH_LIMIT_CALL_STACK_DEPTH | SH_INIT_GL_POSITION |