This commit is contained in:
Hans-Kristian Arntzen 2017-03-25 16:28:44 +01:00
Родитель b2c2e6483b
Коммит bf5c07532c
5 изменённых файлов: 18 добавлений и 17 удалений

Просмотреть файл

@ -17,8 +17,8 @@
#ifndef SPIRV_CROSS_CFG_HPP
#define SPIRV_CROSS_CFG_HPP
#include <assert.h>
#include "spirv_common.hpp"
#include <assert.h>
namespace spirv_cross
{

Просмотреть файл

@ -17,14 +17,14 @@
#ifndef SPIRV_CROSS_COMMON_HPP
#define SPIRV_CROSS_COMMON_HPP
#include "spirv.hpp"
#include <cstdio>
#include <cstring>
#include <functional>
#include <locale>
#include <sstream>
#include <vector>
#include <unordered_set>
#include "spirv.hpp"
#include <vector>
namespace spirv_cross
{

Просмотреть файл

@ -2802,8 +2802,7 @@ const SPIRConstant &Compiler::get_constant(uint32_t id) const
return get<SPIRConstant>(id);
}
static bool exists_unaccessed_path_to_return(const CFG &cfg, uint32_t block,
const unordered_set<uint32_t> &blocks)
static bool exists_unaccessed_path_to_return(const CFG &cfg, uint32_t block, const unordered_set<uint32_t> &blocks)
{
// This block accesses the variable.
if (blocks.find(block) != end(blocks))
@ -2821,8 +2820,8 @@ static bool exists_unaccessed_path_to_return(const CFG &cfg, uint32_t block,
return false;
}
void Compiler::analyze_parameter_preservation(SPIRFunction &entry, const CFG &cfg,
const unordered_map<uint32_t, unordered_set<uint32_t>> &variable_to_blocks)
void Compiler::analyze_parameter_preservation(
SPIRFunction &entry, const CFG &cfg, const unordered_map<uint32_t, unordered_set<uint32_t>> &variable_to_blocks)
{
for (auto &arg : entry.arguments)
{

Просмотреть файл

@ -28,10 +28,10 @@
#include <vector>
#include "spirv_common.hpp"
#include "spirv_cfg.hpp"
namespace spirv_cross
{
class CFG;
struct Resource
{
// Resources are identified with their SPIR-V ID.
@ -616,7 +616,9 @@ protected:
// Traverses all reachable opcodes and sets active_builtins to a bitmask of all builtin variables which are accessed in the shader.
void update_active_builtins();
void analyze_parameter_preservation(SPIRFunction &entry, const CFG &cfg, const std::unordered_map<uint32_t, std::unordered_set<uint32_t>> &variable_to_blocks);
void analyze_parameter_preservation(
SPIRFunction &entry, const CFG &cfg,
const std::unordered_map<uint32_t, std::unordered_set<uint32_t>> &variable_to_blocks);
};
}

Просмотреть файл

@ -1404,7 +1404,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction)
if (expression_type(ops[2]).vecsize > 1)
emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "==");
else
BOP_CAST(== , SPIRType::Int);
BOP_CAST(==, SPIRType::Int);
break;
}
@ -1417,7 +1417,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction)
if (expression_type(ops[2]).vecsize > 1)
emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "==");
else
BOP(== );
BOP(==);
break;
}
@ -1429,7 +1429,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction)
if (expression_type(ops[2]).vecsize > 1)
emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "!=");
else
BOP_CAST(!= , SPIRType::Int);
BOP_CAST(!=, SPIRType::Int);
break;
}
@ -1442,7 +1442,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction)
if (expression_type(ops[2]).vecsize > 1)
emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "!=");
else
BOP(!= );
BOP(!=);
break;
}
@ -1482,7 +1482,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction)
if (expression_type(ops[2]).vecsize > 1)
emit_unrolled_binary_op(result_type, id, ops[2], ops[3], ">=");
else
BOP_CAST(>= , type);
BOP_CAST(>=, type);
break;
}
@ -1494,7 +1494,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction)
if (expression_type(ops[2]).vecsize > 1)
emit_unrolled_binary_op(result_type, id, ops[2], ops[3], ">=");
else
BOP(>= );
BOP(>=);
break;
}
@ -1534,7 +1534,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction)
if (expression_type(ops[2]).vecsize > 1)
emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "<=");
else
BOP_CAST(<= , type);
BOP_CAST(<=, type);
break;
}
@ -1546,7 +1546,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction)
if (expression_type(ops[2]).vecsize > 1)
emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "<=");
else
BOP(<= );
BOP(<=);
break;
}