Run format_all.sh.

This commit is contained in:
Hans-Kristian Arntzen 2017-07-24 09:29:20 +02:00
parent df6aa0e609
commit d89d0e01fc
2 changed files with 23 additions and 21 deletions

View File

@ -417,11 +417,11 @@ struct VariableTypeRemap
string new_variable_type;
};
struct InterfaceVariableRename
{
StorageClass storageClass;
uint32_t location;
string variable_name;
struct InterfaceVariableRename
{
StorageClass storageClass;
uint32_t location;
string variable_name;
};
struct CLIArguments
@ -473,7 +473,7 @@ static void print_help()
"[--flatten-multidimensional-arrays] "
"[--remap-variable-type <variable_name> <new_variable_type>] "
"[--rename-interface-variable <in|out> <location> <new_variable_name>] "
"\n");
"\n");
}
static bool remap_generic(Compiler &compiler, const vector<Resource> &resources, const Remap &remap)
@ -560,19 +560,20 @@ static PlsFormat pls_format(const char *str)
return PlsNone;
}
void rename_interface_variable(Compiler &compiler, const vector<Resource> &resources, const InterfaceVariableRename &rename)
{
for (auto &v : resources)
{
if (!compiler.has_decoration(v.id, spv::DecorationLocation))
continue;
auto loc = compiler.get_decoration(v.id, spv::DecorationLocation);
if (loc != rename.location)
continue;
compiler.set_name(v.id, rename.variable_name);
}
void rename_interface_variable(Compiler &compiler, const vector<Resource> &resources,
const InterfaceVariableRename &rename)
{
for (auto &v : resources)
{
if (!compiler.has_decoration(v.id, spv::DecorationLocation))
continue;
auto loc = compiler.get_decoration(v.id, spv::DecorationLocation);
if (loc != rename.location)
continue;
compiler.set_name(v.id, rename.variable_name);
}
}
int main(int argc, char *argv[])
@ -796,7 +797,7 @@ int main(int argc, char *argv[])
continue;
}
for (auto &rename : args.interface_variable_renames)
for (auto &rename : args.interface_variable_renames)
{
if (rename.storageClass == StorageClassInput)
rename_interface_variable(*compiler, res.stage_inputs, rename);

View File

@ -909,7 +909,8 @@ void CompilerHLSL::emit_buffer_block(const SPIRVariable &var)
if (options.shader_model >= 51) // SM 5.1 uses ConstantBuffer<T> instead of cbuffer.
{
statement("ConstantBuffer<", struct_name, "> ", to_name(var.self), type_to_array_glsl(type), to_resource_binding(var), ";");
statement("ConstantBuffer<", struct_name, "> ", to_name(var.self), type_to_array_glsl(type),
to_resource_binding(var), ";");
}
else
{