Merge pull request #1741 from linkmauve/iwyu-video_core

Fix video_core includes (and dependencies) using include-what-you-use
This commit is contained in:
bunnei 2016-05-01 17:44:57 -04:00
commit 15d0e98267
46 changed files with 234 additions and 88 deletions

View file

@ -2,6 +2,9 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <algorithm>
#include <array>
#include <iterator>
#include <memory>
#include <boost/range/algorithm/copy.hpp>
@ -18,6 +21,7 @@
#include "core/hw/gpu.h"
#include "core/hw/lcd.h"
#include "core/tracer/recorder.h"
#include "nihstro/float24.h"

View file

@ -186,5 +186,5 @@ private:
#pragma pack()
#if (__GNUC__ >= 5) || defined(__clang__) || defined(_MSC_VER)
static_assert(std::is_trivially_copyable<BitField<0, 1, u32>>::value, "BitField must be trivially copyable");
static_assert(std::is_trivially_copyable<BitField<0, 1, unsigned>>::value, "BitField must be trivially copyable");
#endif

View file

@ -7,6 +7,7 @@
#include <intrin.h>
#endif
#include <initializer_list>
#include <new>
#include <type_traits>
#include "common/common_types.h"
@ -186,4 +187,4 @@ public:
typedef Common::BitSet<u8> BitSet8;
typedef Common::BitSet<u16> BitSet16;
typedef Common::BitSet<u32> BitSet32;
typedef Common::BitSet<u64> BitSet64;
typedef Common::BitSet<u64> BitSet64;

View file

@ -4,8 +4,10 @@
#pragma once
#include "common_types.h"
#include "memory_util.h"
#include <cstddef>
#include "common/common_types.h"
#include "common/memory_util.h"
// Everything that needs to generate code should inherit from this.
// You get memory management for free, plus, you can use all emitter functions without

View file

@ -4,6 +4,10 @@
#pragma once
#if !defined(ARCHITECTURE_x86_64) && !defined(_M_ARM)
#include <cstdlib> // for exit
#endif
#include "common_types.h"
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))

View file

@ -7,9 +7,9 @@
#include <array>
#include <fstream>
#include <functional>
#include <cstddef>
#include <cstdio>
#include <string>
#include <type_traits>
#include <vector>
#include "common/common_types.h"

View file

@ -17,6 +17,8 @@
#pragma once
#include <cstddef>
#include "common/assert.h"
#include "common/bit_set.h"
#include "common/common_types.h"

View file

@ -5,7 +5,6 @@
#pragma once
#include <new>
#include <type_traits>
#include <utility>
#include "common/assert.h"

View file

@ -10,6 +10,7 @@
#include "common/bit_field.h"
#include "common/common_types.h"
#include "core/hle/result.h"
#include "core/hle/service/service.h"
////////////////////////////////////////////////////////////////////////////////////////////////////

View file

@ -52,8 +52,6 @@ struct Regs {
return content[index];
}
#undef ASSERT_MEMBER_SIZE
};
static_assert(std::is_standard_layout<Regs>::value, "Structure does not use standard layout");

View file

@ -6,7 +6,8 @@
#include <string>
#include <array>
#include <common/file_util.h>
#include "common/common_types.h"
namespace Settings {

View file

@ -4,6 +4,7 @@
#pragma once
#include <string>
#include <unordered_map>
#include <vector>

View file

@ -2,13 +2,24 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <algorithm>
#include <array>
#include <cstddef>
#include <boost/container/static_vector.hpp>
#include <boost/container/vector.hpp>
#include "common/bit_field.h"
#include "common/common_types.h"
#include "common/logging/log.h"
#include "common/vector_math.h"
#include "video_core/clipper.h"
#include "video_core/pica.h"
#include "video_core/pica_state.h"
#include "video_core/pica_types.h"
#include "video_core/rasterizer.h"
#include "video_core/shader/shader_interpreter.h"
#include "video_core/shader/shader.h"
namespace Pica {

View file

@ -2,26 +2,32 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <cmath>
#include <boost/range/algorithm/fill.hpp>
#include <array>
#include <cstddef>
#include <memory>
#include <utility>
#include "common/alignment.h"
#include "common/assert.h"
#include "common/logging/log.h"
#include "common/microprofile.h"
#include "common/vector_math.h"
#include "core/settings.h"
#include "core/hle/service/gsp_gpu.h"
#include "core/hw/gpu.h"
#include "core/memory.h"
#include "core/tracer/recorder.h"
#include "video_core/clipper.h"
#include "video_core/command_processor.h"
#include "video_core/debug_utils/debug_utils.h"
#include "video_core/pica.h"
#include "video_core/pica_state.h"
#include "video_core/pica_types.h"
#include "video_core/primitive_assembly.h"
#include "video_core/rasterizer_interface.h"
#include "video_core/renderer_base.h"
#include "video_core/video_core.h"
#include "video_core/debug_utils/debug_utils.h"
#include "video_core/shader/shader_interpreter.h"
#include "video_core/shader/shader.h"
#include "video_core/vertex_loader.h"
#include "video_core/video_core.h"
namespace Pica {

View file

@ -4,35 +4,41 @@
#include <algorithm>
#include <condition_variable>
#include <cstdint>
#include <cstring>
#include <fstream>
#include <list>
#include <map>
#include <mutex>
#include <stdexcept>
#include <string>
#ifdef HAVE_PNG
#include <png.h>
#include <setjmp.h>
#endif
#include <nihstro/bit_field.h>
#include <nihstro/float24.h>
#include <nihstro/shader_binary.h>
#include "common/assert.h"
#include "common/bit_field.h"
#include "common/color.h"
#include "common/common_types.h"
#include "common/file_util.h"
#include "common/logging/log.h"
#include "common/math_util.h"
#include "common/vector_math.h"
#include "core/settings.h"
#include "video_core/debug_utils/debug_utils.h"
#include "video_core/pica.h"
#include "video_core/pica_state.h"
#include "video_core/pica_types.h"
#include "video_core/rasterizer_interface.h"
#include "video_core/renderer_base.h"
#include "video_core/shader/shader.h"
#include "video_core/utils.h"
#include "video_core/video_core.h"
#include "video_core/debug_utils/debug_utils.h"
using nihstro::DVLBHeader;
using nihstro::DVLEHeader;

View file

@ -4,23 +4,33 @@
#pragma once
#include <algorithm>
#include <array>
#include <condition_variable>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <mutex>
#include <string>
#include <utility>
#include <vector>
#include "common/common_types.h"
#include "common/vector_math.h"
#include "core/tracer/recorder.h"
#include "video_core/pica.h"
#include "video_core/shader/shader.h"
namespace CiTrace {
class Recorder;
}
namespace Pica {
namespace Shader {
struct ShaderSetup;
}
class DebugContext {
public:
enum class Event {

View file

@ -3,10 +3,13 @@
// Refer to the license.txt file included.
#include <cstring>
#include <iterator>
#include <unordered_map>
#include <utility>
#include "video_core/pica.h"
#include "video_core/pica_state.h"
#include "video_core/primitive_assembly.h"
#include "video_core/shader/shader.h"
namespace Pica {
@ -480,7 +483,7 @@ std::string Regs::GetCommandName(int index) {
static std::unordered_map<u32, const char*> map;
if (map.empty()) {
map.insert(begin(register_names), end(register_names));
map.insert(std::begin(register_names), std::end(register_names));
}
// Return empty string if no match is found

View file

@ -5,10 +5,13 @@
#pragma once
#include <array>
#include <cmath>
#include <cstddef>
#include <string>
#ifndef _MSC_VER
#include <type_traits> // for std::enable_if
#endif
#include "common/assert.h"
#include "common/bit_field.h"
#include "common/common_funcs.h"
@ -16,8 +19,6 @@
#include "common/vector_math.h"
#include "common/logging/log.h"
#include "pica_types.h"
namespace Pica {
// Returns index corresponding to the Regs member labeled by field_name

View file

@ -4,6 +4,11 @@
#pragma once
#include <array>
#include "common/bit_field.h"
#include "common/common_types.h"
#include "video_core/pica.h"
#include "video_core/primitive_assembly.h"
#include "video_core/shader/shader.h"

View file

@ -4,6 +4,7 @@
#pragma once
#include <cmath>
#include <cstring>
#include "common/common_types.h"

View file

@ -6,8 +6,7 @@
#include "video_core/pica.h"
#include "video_core/primitive_assembly.h"
#include "video_core/debug_utils/debug_utils.h"
#include "video_core/shader/shader_interpreter.h"
#include "video_core/shader/shader.h"
namespace Pica {

View file

@ -3,22 +3,28 @@
// Refer to the license.txt file included.
#include <algorithm>
#include <array>
#include <cmath>
#include "common/assert.h"
#include "common/bit_field.h"
#include "common/color.h"
#include "common/common_types.h"
#include "common/logging/log.h"
#include "common/math_util.h"
#include "common/microprofile.h"
#include "common/vector_math.h"
#include "core/memory.h"
#include "core/hw/gpu.h"
#include "video_core/debug_utils/debug_utils.h"
#include "video_core/pica.h"
#include "video_core/pica_state.h"
#include "video_core/pica_types.h"
#include "video_core/rasterizer.h"
#include "video_core/utils.h"
#include "video_core/debug_utils/debug_utils.h"
#include "video_core/shader/shader_interpreter.h"
#include "video_core/shader/shader.h"
namespace Pica {

View file

@ -2,10 +2,9 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <atomic>
#include <memory>
#include "core/settings.h"
#include "video_core/renderer_base.h"
#include "video_core/video_core.h"
#include "video_core/swrasterizer.h"

View file

@ -2,27 +2,28 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <cstring>
#include <memory>
#include <string>
#include <tuple>
#include <utility>
#include <glad/glad.h>
#include "common/assert.h"
#include "common/color.h"
#include "common/file_util.h"
#include "common/logging/log.h"
#include "common/math_util.h"
#include "common/microprofile.h"
#include "common/vector_math.h"
#include "core/memory.h"
#include "core/settings.h"
#include "core/hw/gpu.h"
#include "video_core/pica.h"
#include "video_core/pica_state.h"
#include "video_core/utils.h"
#include "video_core/renderer_opengl/gl_rasterizer.h"
#include "video_core/renderer_opengl/gl_shader_gen.h"
#include "video_core/renderer_opengl/gl_shader_util.h"
#include "video_core/renderer_opengl/pica_to_gl.h"
#include "video_core/renderer_opengl/renderer_opengl.h"
static bool IsPassThroughTevStage(const Pica::Regs::TevStageConfig& stage) {
return (stage.color_op == Pica::Regs::TevStageConfig::Operation::Replace &&

View file

@ -4,23 +4,33 @@
#pragma once
#include <array>
#include <cstddef>
#include <cstring>
#include <memory>
#include <vector>
#include <unordered_map>
#include <glad/glad.h>
#include "common/bit_field.h"
#include "common/common_types.h"
#include "common/hash.h"
#include "common/vector_math.h"
#include "core/hw/gpu.h"
#include "video_core/pica.h"
#include "video_core/pica_state.h"
#include "video_core/pica_types.h"
#include "video_core/rasterizer_interface.h"
#include "video_core/renderer_opengl/gl_rasterizer_cache.h"
#include "video_core/renderer_opengl/gl_resource_manager.h"
#include "video_core/renderer_opengl/gl_state.h"
#include "video_core/renderer_opengl/pica_to_gl.h"
#include "video_core/renderer_opengl/renderer_opengl.h"
#include "video_core/shader/shader_interpreter.h"
#include "video_core/shader/shader.h"
struct ScreenInfo;
/**
* This struct contains all state used to generate the GLSL shader program that emulates the current

View file

@ -2,10 +2,19 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <algorithm>
#include <atomic>
#include <cstring>
#include <iterator>
#include <unordered_set>
#include <utility>
#include <vector>
#include <glad/glad.h>
#include "common/bit_field.h"
#include "common/emu_window.h"
#include "common/hash.h"
#include "common/logging/log.h"
#include "common/math_util.h"
#include "common/microprofile.h"
#include "common/vector_math.h"
@ -15,7 +24,7 @@
#include "video_core/debug_utils/debug_utils.h"
#include "video_core/pica_state.h"
#include "video_core/renderer_opengl/gl_rasterizer_cache.h"
#include "video_core/renderer_opengl/pica_to_gl.h"
#include "video_core/renderer_opengl/gl_state.h"
#include "video_core/utils.h"
#include "video_core/video_core.h"

View file

@ -4,20 +4,26 @@
#pragma once
#include <map>
#include <array>
#include <memory>
#include <set>
#include <tuple>
#include <boost/icl/interval_map.hpp>
#include <glad/glad.h>
#include "common/math_util.h"
#include "common/assert.h"
#include "common/common_funcs.h"
#include "common/common_types.h"
#include "core/hw/gpu.h"
#include "video_core/pica.h"
#include "video_core/debug_utils/debug_utils.h"
#include "video_core/renderer_opengl/gl_resource_manager.h"
#include "video_core/renderer_opengl/gl_state.h"
namespace MathUtil {
template <class T> struct Rectangle;
}
struct CachedSurface;

View file

@ -2,9 +2,17 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <array>
#include <cstddef>
#include "common/assert.h"
#include "common/bit_field.h"
#include "common/logging/log.h"
#include "video_core/pica.h"
#include "video_core/renderer_opengl/gl_rasterizer.h"
#include "video_core/renderer_opengl/gl_shader_gen.h"
#include "video_core/renderer_opengl/gl_shader_util.h"
using Pica::Regs;
using TevStageConfig = Regs::TevStageConfig;

View file

@ -6,7 +6,7 @@
#include <string>
#include "video_core/renderer_opengl/gl_rasterizer.h"
struct PicaShaderConfig;
namespace GLShader {

View file

@ -2,9 +2,10 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <algorithm>
#include <vector>
#include <glad/glad.h>
#include "common/logging/log.h"
#include "video_core/renderer_opengl/gl_shader_util.h"

View file

@ -2,8 +2,11 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "video_core/pica.h"
#include "video_core/renderer_opengl/gl_resource_manager.h"
#include <glad/glad.h>
#include "common/common_funcs.h"
#include "common/logging/log.h"
#include "video_core/renderer_opengl/gl_state.h"
OpenGLState OpenGLState::cur_state;

View file

@ -5,7 +5,6 @@
#pragma once
#include <glad/glad.h>
#include <memory>
class OpenGLState {
public:

View file

@ -4,9 +4,16 @@
#pragma once
#include <array>
#include <cstddef>
#include <glad/glad.h>
#include "common/assert.h"
#include "common/bit_field.h"
#include "common/common_funcs.h"
#include "common/common_types.h"
#include "common/logging/log.h"
#include "video_core/pica.h"

View file

@ -5,23 +5,28 @@
#include <algorithm>
#include <cstddef>
#include <cstdlib>
#include <memory>
#include <glad/glad.h>
#include "common/assert.h"
#include "common/bit_field.h"
#include "common/emu_window.h"
#include "common/logging/log.h"
#include "common/profiler_reporting.h"
#include "common/synchronized_wrapper.h"
#include "core/memory.h"
#include "core/settings.h"
#include "core/hw/gpu.h"
#include "core/hw/hw.h"
#include "core/hw/lcd.h"
#include "core/memory.h"
#include "core/settings.h"
#include "core/tracer/recorder.h"
#include "video_core/video_core.h"
#include "video_core/debug_utils/debug_utils.h"
#include "video_core/renderer_opengl/gl_rasterizer.h"
#include "video_core/renderer_opengl/gl_shader_util.h"
#include "video_core/rasterizer_interface.h"
#include "video_core/renderer_opengl/renderer_opengl.h"
#include "video_core/video_core.h"
static const char vertex_shader[] = R"(
#version 150 core

View file

@ -8,6 +8,9 @@
#include <glad/glad.h>
#include "common/common_types.h"
#include "common/math_util.h"
#include "core/hw/gpu.h"
#include "video_core/renderer_base.h"

View file

@ -2,26 +2,30 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <memory>
#include <atomic>
#include <cmath>
#include <cstring>
#include <unordered_map>
#include <utility>
#include <boost/range/algorithm/fill.hpp>
#include "common/bit_field.h"
#include "common/hash.h"
#include "common/logging/log.h"
#include "common/microprofile.h"
#include "video_core/debug_utils/debug_utils.h"
#include "video_core/pica.h"
#include "video_core/pica_state.h"
#include "video_core/video_core.h"
#include "shader.h"
#include "shader_interpreter.h"
#include "video_core/shader/shader.h"
#include "video_core/shader/shader_interpreter.h"
#ifdef ARCHITECTURE_x86_64
#include "shader_jit_x64.h"
#include "video_core/shader/shader_jit_x64.h"
#endif // ARCHITECTURE_x86_64
#include "video_core/video_core.h"
namespace Pica {
namespace Shader {

View file

@ -4,17 +4,23 @@
#pragma once
#include <array>
#include <cstddef>
#include <memory>
#include <type_traits>
#include <vector>
#include <boost/container/static_vector.hpp>
#include <nihstro/shader_binary.h>
#include <nihstro/shader_bytecode.h>
#include "common/assert.h"
#include "common/common_funcs.h"
#include "common/common_types.h"
#include "common/vector_math.h"
#include "video_core/pica.h"
#include "video_core/pica_types.h"
using nihstro::RegisterType;
using nihstro::SourceRegister;

View file

@ -2,12 +2,20 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <algorithm>
#include <array>
#include <cmath>
#include <numeric>
#include <nihstro/shader_bytecode.h>
#include "common/file_util.h"
#include "video_core/pica.h"
#include "common/assert.h"
#include "common/common_types.h"
#include "common/logging/log.h"
#include "common/vector_math.h"
#include "video_core/pica_state.h"
#include "video_core/pica_types.h"
#include "video_core/shader/shader.h"
#include "video_core/shader/shader_interpreter.h"

View file

@ -4,12 +4,12 @@
#pragma once
#include "video_core/shader/shader.h"
namespace Pica {
namespace Shader {
template <bool Debug> struct UnitState;
template<bool Debug>
void RunInterpreter(UnitState<Debug>& state);

View file

@ -3,8 +3,15 @@
// Refer to the license.txt file included.
#include <algorithm>
#include <smmintrin.h>
#include <cmath>
#include <cstdint>
#include <xmmintrin.h>
#include <nihstro/shader_bytecode.h>
#include "common/assert.h"
#include "common/logging/log.h"
#include "common/vector_math.h"
#include "common/x64/abi.h"
#include "common/x64/cpu_detect.h"
#include "common/x64/emitter.h"
@ -13,6 +20,7 @@
#include "shader_jit_x64.h"
#include "video_core/pica_state.h"
#include "video_core/pica_types.h"
namespace Pica {

View file

@ -4,14 +4,17 @@
#pragma once
#include <array>
#include <cstddef>
#include <utility>
#include <vector>
#include <nihstro/shader_bytecode.h>
#include "common/bit_set.h"
#include "common/common_types.h"
#include "common/x64/emitter.h"
#include "video_core/pica.h"
#include "video_core/shader/shader.h"
using nihstro::Instruction;

View file

@ -8,6 +8,12 @@
#include "video_core/rasterizer_interface.h"
namespace Pica {
namespace Shader {
struct OutputVertex;
}
}
namespace VideoCore {
class SWRasterizer : public RasterizerInterface {

View file

@ -4,8 +4,6 @@
#pragma once
#include <string>
#include "common/common_types.h"
namespace VideoCore {

View file

@ -1,14 +1,13 @@
#include <cmath>
#include <string>
#include <memory>
#include "boost/range/algorithm/fill.hpp"
#include <boost/range/algorithm/fill.hpp>
#include "common/assert.h"
#include "common/alignment.h"
#include "common/bit_field.h"
#include "common/common_funcs.h"
#include "common/common_types.h"
#include "common/logging/log.h"
#include "common/vector_math.h"
#include "core/memory.h"
@ -16,6 +15,7 @@
#include "video_core/pica.h"
#include "video_core/pica_state.h"
#include "video_core/pica_types.h"
#include "video_core/shader/shader.h"
#include "video_core/vertex_loader.h"
namespace Pica {
@ -137,4 +137,4 @@ void VertexLoader::LoadVertex(u32 base_address, int index, int vertex, Shader::I
}
}
} // namespace Pica
} // namespace Pica

View file

@ -1,14 +1,19 @@
#pragma once
#include <iterator>
#include <algorithm>
#include "common/common_types.h"
#include "video_core/pica.h"
#include "video_core/shader/shader.h"
#include "video_core/debug_utils/debug_utils.h"
namespace Pica {
namespace DebugUtils {
class MemoryAccessTracker;
}
namespace Shader {
class InputVertex;
}
class VertexLoader {
public:
void Setup(const Pica::Regs& regs);

View file

@ -4,12 +4,8 @@
#include <memory>
#include "common/emu_window.h"
#include "common/logging/log.h"
#include "core/core.h"
#include "core/settings.h"
#include "video_core/pica.h"
#include "video_core/renderer_base.h"
#include "video_core/video_core.h"