Run format_all.sh.

This commit is contained in:
Hans-Kristian Arntzen 2019-01-11 12:56:00 +01:00
parent 81cb8b54a3
commit 6e1c3ccb72
6 changed files with 12 additions and 17 deletions

View File

@ -707,7 +707,8 @@ static int main_inner(int argc, char *argv[])
cbs.add("--msl", [&args](CLIParser &) { args.msl = true; }); cbs.add("--msl", [&args](CLIParser &) { args.msl = true; });
cbs.add("--hlsl", [&args](CLIParser &) { args.hlsl = true; }); cbs.add("--hlsl", [&args](CLIParser &) { args.hlsl = true; });
cbs.add("--hlsl-enable-compat", [&args](CLIParser &) { args.hlsl_compat = true; }); cbs.add("--hlsl-enable-compat", [&args](CLIParser &) { args.hlsl_compat = true; });
cbs.add("--hlsl-support-nonzero-basevertex-baseinstance", [&args](CLIParser &) { args.hlsl_support_nonzero_base = true; }); cbs.add("--hlsl-support-nonzero-basevertex-baseinstance",
[&args](CLIParser &) { args.hlsl_support_nonzero_base = true; });
cbs.add("--vulkan-semantics", [&args](CLIParser &) { args.vulkan_semantics = true; }); cbs.add("--vulkan-semantics", [&args](CLIParser &) { args.vulkan_semantics = true; });
cbs.add("--flatten-multidimensional-arrays", [&args](CLIParser &) { args.flatten_multidimensional_arrays = true; }); cbs.add("--flatten-multidimensional-arrays", [&args](CLIParser &) { args.flatten_multidimensional_arrays = true; });
cbs.add("--no-420pack-extension", [&args](CLIParser &) { args.use_420pack_extension = false; }); cbs.add("--no-420pack-extension", [&args](CLIParser &) { args.use_420pack_extension = false; });

View File

@ -779,8 +779,7 @@ ShaderResources Compiler::get_shader_resources(const unordered_set<uint32_t> *ac
{ {
// There can only be one push constant block, but keep the vector in case this restriction is lifted // There can only be one push constant block, but keep the vector in case this restriction is lifted
// in the future. // in the future.
res.push_constant_buffers.push_back( res.push_constant_buffers.push_back({ var.self, var.basetype, type.self, get_name(var.self) });
{ var.self, var.basetype, type.self, get_name(var.self) });
} }
// Images // Images
else if (type.storage == StorageClassUniformConstant && type.basetype == SPIRType::Image && else if (type.storage == StorageClassUniformConstant && type.basetype == SPIRType::Image &&

View File

@ -15,8 +15,8 @@
*/ */
#include "spirv_cross_parsed_ir.hpp" #include "spirv_cross_parsed_ir.hpp"
#include <assert.h>
#include <algorithm> #include <algorithm>
#include <assert.h>
using namespace std; using namespace std;
using namespace spv; using namespace spv;

View File

@ -296,9 +296,7 @@ void CompilerGLSL::reset()
func.flush_undeclared = true; func.flush_undeclared = true;
}); });
ir.for_each_typed_id<SPIRVariable>([&](uint32_t, SPIRVariable &var) { ir.for_each_typed_id<SPIRVariable>([&](uint32_t, SPIRVariable &var) { var.dependees.clear(); });
var.dependees.clear();
});
ir.reset_all_of_type<SPIRExpression>(); ir.reset_all_of_type<SPIRExpression>();
ir.reset_all_of_type<SPIRAccessChain>(); ir.reset_all_of_type<SPIRAccessChain>();
@ -1942,8 +1940,7 @@ void CompilerGLSL::replace_fragment_outputs()
ir.for_each_typed_id<SPIRVariable>([&](uint32_t, SPIRVariable &var) { ir.for_each_typed_id<SPIRVariable>([&](uint32_t, SPIRVariable &var) {
auto &type = this->get<SPIRType>(var.basetype); auto &type = this->get<SPIRType>(var.basetype);
if (!is_builtin_variable(var) && !var.remapped_variable && type.pointer && if (!is_builtin_variable(var) && !var.remapped_variable && type.pointer && var.storage == StorageClassOutput)
var.storage == StorageClassOutput)
replace_fragment_output(var); replace_fragment_output(var);
}); });
} }

View File

@ -1192,8 +1192,7 @@ void CompilerHLSL::emit_resources()
} }
if (var.storage != StorageClassFunction && !is_builtin_variable(var) && !var.remapped_variable && if (var.storage != StorageClassFunction && !is_builtin_variable(var) && !var.remapped_variable &&
type.pointer && type.pointer && (type.storage == StorageClassUniformConstant || type.storage == StorageClassAtomicCounter))
(type.storage == StorageClassUniformConstant || type.storage == StorageClassAtomicCounter))
{ {
emit_uniform(var); emit_uniform(var);
emitted = true; emitted = true;

View File

@ -4366,8 +4366,7 @@ string CompilerMSL::entry_point_args(bool append_comma)
auto &entry_func = this->get<SPIRFunction>(ir.default_entry_point); auto &entry_func = this->get<SPIRFunction>(ir.default_entry_point);
entry_func.fixup_hooks_in.push_back([=]() { entry_func.fixup_hooks_in.push_back([=]() {
statement(builtin_type_decl(bi_type), " ", to_expression(var_id), statement(builtin_type_decl(bi_type), " ", to_expression(var_id), " = simd_is_helper_thread();");
" = simd_is_helper_thread();");
}); });
} }
else else