Remove cfg_analysis option.
Not using this is broken, and won't work anymore.
This commit is contained in:
Родитель
17f9026248
Коммит
bfe6f50b8e
5
main.cpp
5
main.cpp
|
@ -479,12 +479,11 @@ struct CLIArguments
|
|||
bool flatten_multidimensional_arrays = false;
|
||||
bool use_420pack_extension = true;
|
||||
bool remove_unused = false;
|
||||
bool cfg_analysis = true;
|
||||
};
|
||||
|
||||
static void print_help()
|
||||
{
|
||||
fprintf(stderr, "Usage: spirv-cross [--output <output path>] [SPIR-V file] [--es] [--no-es] [--no-cfg-analysis] "
|
||||
fprintf(stderr, "Usage: spirv-cross [--output <output path>] [SPIR-V file] [--es] [--no-es] "
|
||||
"[--version <GLSL version>] [--dump-resources] [--help] [--force-temporary] "
|
||||
"[--vulkan-semantics] [--flatten-ubo] [--fixup-clipspace] [--flip-vert-y] [--iterations iter] "
|
||||
"[--cpp] [--cpp-interface-name <name>] "
|
||||
|
@ -634,7 +633,6 @@ static int main_inner(int argc, char *argv[])
|
|||
args.version = parser.next_uint();
|
||||
args.set_version = true;
|
||||
});
|
||||
cbs.add("--no-cfg-analysis", [&args](CLIParser &) { args.cfg_analysis = false; });
|
||||
cbs.add("--dump-resources", [&args](CLIParser &) { args.dump_resources = true; });
|
||||
cbs.add("--force-temporary", [&args](CLIParser &) { args.force_temporary = true; });
|
||||
cbs.add("--flatten-ubo", [&args](CLIParser &) { args.flatten_ubo = true; });
|
||||
|
@ -796,7 +794,6 @@ static int main_inner(int argc, char *argv[])
|
|||
opts.vulkan_semantics = args.vulkan_semantics;
|
||||
opts.vertex.fixup_clipspace = args.fixup;
|
||||
opts.vertex.flip_vert_y = args.yflip;
|
||||
opts.cfg_analysis = args.cfg_analysis;
|
||||
compiler->set_options(opts);
|
||||
|
||||
// Set HLSL specific options.
|
||||
|
|
|
@ -7701,41 +7701,36 @@ void CompilerGLSL::emit_function(SPIRFunction &func, uint64_t return_flags)
|
|||
|
||||
if (!func.analyzed_variable_scope)
|
||||
{
|
||||
if (options.cfg_analysis)
|
||||
analyze_variable_scope(func);
|
||||
|
||||
// Check if we can actually use the loop variables we found in analyze_variable_scope.
|
||||
// To use multiple initializers, we need the same type and qualifiers.
|
||||
for (auto block : func.blocks)
|
||||
{
|
||||
analyze_variable_scope(func);
|
||||
auto &b = get<SPIRBlock>(block);
|
||||
if (b.loop_variables.size() < 2)
|
||||
continue;
|
||||
|
||||
// Check if we can actually use the loop variables we found in analyze_variable_scope.
|
||||
// To use multiple initializers, we need the same type and qualifiers.
|
||||
for (auto block : func.blocks)
|
||||
uint64_t flags = get_decoration_mask(b.loop_variables.front());
|
||||
uint32_t type = get<SPIRVariable>(b.loop_variables.front()).basetype;
|
||||
bool invalid_initializers = false;
|
||||
for (auto loop_variable : b.loop_variables)
|
||||
{
|
||||
auto &b = get<SPIRBlock>(block);
|
||||
if (b.loop_variables.size() < 2)
|
||||
continue;
|
||||
|
||||
uint64_t flags = get_decoration_mask(b.loop_variables.front());
|
||||
uint32_t type = get<SPIRVariable>(b.loop_variables.front()).basetype;
|
||||
bool invalid_initializers = false;
|
||||
for (auto loop_variable : b.loop_variables)
|
||||
if (flags != get_decoration_mask(loop_variable) ||
|
||||
type != get<SPIRVariable>(b.loop_variables.front()).basetype)
|
||||
{
|
||||
if (flags != get_decoration_mask(loop_variable) ||
|
||||
type != get<SPIRVariable>(b.loop_variables.front()).basetype)
|
||||
{
|
||||
invalid_initializers = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (invalid_initializers)
|
||||
{
|
||||
for (auto loop_variable : b.loop_variables)
|
||||
get<SPIRVariable>(loop_variable).loop_variable = false;
|
||||
b.loop_variables.clear();
|
||||
invalid_initializers = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (invalid_initializers)
|
||||
{
|
||||
for (auto loop_variable : b.loop_variables)
|
||||
get<SPIRVariable>(loop_variable).loop_variable = false;
|
||||
b.loop_variables.clear();
|
||||
}
|
||||
}
|
||||
else
|
||||
entry_block.dominated_variables = func.local_variables;
|
||||
func.analyzed_variable_scope = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -65,9 +65,6 @@ public:
|
|||
// Debug option to always emit temporary variables for all expressions.
|
||||
bool force_temporary = false;
|
||||
|
||||
// If true, variables will be moved to their appropriate scope through CFG analysis.
|
||||
bool cfg_analysis = true;
|
||||
|
||||
// If true, Vulkan GLSL features are used instead of GL-compatible features.
|
||||
// Mostly useful for debugging SPIR-V files.
|
||||
bool vulkan_semantics = false;
|
||||
|
|
Загрузка…
Ссылка в новой задаче