Only print legalization warning if optimizer disabled
This commit is contained in:
@@ -200,7 +200,7 @@ public:
|
||||
glslang::EShTargetClientVersion clientTargetVersion,
|
||||
bool flattenUniformArrays = false,
|
||||
EShTextureSamplerTransformMode texSampTransMode = EShTexSampTransKeep,
|
||||
bool disableOptimizer = true,
|
||||
bool enableOptimizer = false,
|
||||
bool automap = true)
|
||||
{
|
||||
const EShLanguage stage = GetShaderStage(GetSuffix(shaderName));
|
||||
@@ -242,7 +242,7 @@ public:
|
||||
if (success && (controls & EShMsgSpvRules)) {
|
||||
std::vector<uint32_t> spirv_binary;
|
||||
glslang::SpvOptions options;
|
||||
options.disableOptimizer = disableOptimizer;
|
||||
options.disableOptimizer = !enableOptimizer;
|
||||
glslang::GlslangToSpv(*program.getIntermediate(stage),
|
||||
spirv_binary, &logger, &options);
|
||||
|
||||
@@ -412,7 +412,7 @@ public:
|
||||
bool automap = true,
|
||||
const std::string& entryPointName="",
|
||||
const std::string& baseDir="/baseResults/",
|
||||
const bool disableOptimizer = true)
|
||||
const bool enableOptimizer = false)
|
||||
{
|
||||
const std::string inputFname = testDir + "/" + testName;
|
||||
const std::string expectedOutputFname =
|
||||
@@ -422,9 +422,11 @@ public:
|
||||
tryLoadFile(inputFname, "input", &input);
|
||||
tryLoadFile(expectedOutputFname, "expected output", &expectedOutput);
|
||||
|
||||
const EShMessages controls = DeriveOptions(source, semantics, target);
|
||||
EShMessages controls = DeriveOptions(source, semantics, target);
|
||||
if (enableOptimizer)
|
||||
controls = static_cast<EShMessages>(controls & ~EShMsgHlslLegalization);
|
||||
GlslangResult result = compileAndLink(testName, input, entryPointName, controls, clientTargetVersion, false,
|
||||
EShTexSampTransKeep, disableOptimizer, automap);
|
||||
EShTexSampTransKeep, enableOptimizer, automap);
|
||||
|
||||
// Generate the hybrid output in the way of glslangValidator.
|
||||
std::ostringstream stream;
|
||||
|
||||
Reference in New Issue
Block a user