mirror of
https://github.com/KhronosGroup/SPIRV-Cross.git
synced 2024-11-12 15:10:30 +00:00
Run format_all.sh.
This commit is contained in:
parent
df6aa0e609
commit
d89d0e01fc
41
main.cpp
41
main.cpp
@ -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);
|
||||
|
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user