Fix include paths.

Bug b/117152542

Change-Id: I341f03ad3fcc8d52723ec9575685eeb28519e7dc
Reviewed-on: https://swiftshader-review.googlesource.com/c/22328
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/Device/Blitter.cpp b/src/Device/Blitter.cpp
index 6522a13..c3b7b08 100644
--- a/src/Device/Blitter.cpp
+++ b/src/Device/Blitter.cpp
@@ -14,10 +14,10 @@
 
 #include "Blitter.hpp"
 
-#include "Shader/ShaderCore.hpp"
+#include "Pipeline/ShaderCore.hpp"
 #include "Reactor/Reactor.hpp"
-#include "Common/Memory.hpp"
-#include "Common/Debug.hpp"
+#include "System/Memory.hpp"
+#include "System/Debug.hpp"
 
 namespace sw
 {
diff --git a/src/Device/Clipper.cpp b/src/Device/Clipper.cpp
index a100f05..e42c12f 100644
--- a/src/Device/Clipper.cpp
+++ b/src/Device/Clipper.cpp
@@ -16,7 +16,7 @@
 
 #include "Polygon.hpp"
 #include "Renderer.hpp"
-#include "Common/Debug.hpp"
+#include "System/Debug.hpp"
 
 namespace sw
 {
diff --git a/src/Device/Clipper.hpp b/src/Device/Clipper.hpp
index 057153a..1c181d2 100644
--- a/src/Device/Clipper.hpp
+++ b/src/Device/Clipper.hpp
@@ -16,7 +16,7 @@
 #define sw_Clipper_hpp
 
 #include "Plane.hpp"
-#include "Common/Types.hpp"
+#include "System/Types.hpp"
 
 namespace sw
 {
diff --git a/src/Device/Color.hpp b/src/Device/Color.hpp
index 7afe61f..a87f5db 100644
--- a/src/Device/Color.hpp
+++ b/src/Device/Color.hpp
@@ -15,8 +15,8 @@
 #ifndef sw_Color_hpp
 #define sw_Color_hpp
 
-#include "Common/Types.hpp"
-#include "Common/Math.hpp"
+#include "System/Types.hpp"
+#include "System/Math.hpp"
 
 namespace sw
 {
@@ -71,7 +71,7 @@
 	};
 }
 
-#include "Common/Math.hpp"
+#include "System/Math.hpp"
 
 namespace sw
 {
diff --git a/src/Device/Config.cpp b/src/Device/Config.cpp
index 7cb309a..10e84e9 100644
--- a/src/Device/Config.cpp
+++ b/src/Device/Config.cpp
@@ -14,8 +14,8 @@
 
 #include "Config.hpp"
 
-#include "Common/Thread.hpp"
-#include "Common/Timer.hpp"
+#include "System/Thread.hpp"
+#include "System/Timer.hpp"
 
 namespace sw
 {
diff --git a/src/Device/Config.hpp b/src/Device/Config.hpp
index 017e38b..5d99047 100644
--- a/src/Device/Config.hpp
+++ b/src/Device/Config.hpp
@@ -15,7 +15,7 @@
 #ifndef sw_Config_hpp
 #define sw_Config_hpp
 
-#include "Common/Types.hpp"
+#include "System/Types.hpp"
 
 #define PERF_HUD 0       // Display time spent on vertex, setup and pixel processing for each thread
 #define PERF_PROFILE 0   // Profile various pipeline stages and display the timing in SwiftConfig
diff --git a/src/Device/Context.cpp b/src/Device/Context.cpp
index 25c5775..33f3041 100644
--- a/src/Device/Context.cpp
+++ b/src/Device/Context.cpp
@@ -16,10 +16,10 @@
 
 #include "Primitive.hpp"
 #include "Surface.hpp"
-#include "Shader/PixelShader.hpp"
-#include "Shader/VertexShader.hpp"
-#include "Common/Memory.hpp"
-#include "Common/Debug.hpp"
+#include "Pipeline/PixelShader.hpp"
+#include "Pipeline/VertexShader.hpp"
+#include "System/Memory.hpp"
+#include "System/Debug.hpp"
 
 #include <string.h>
 
diff --git a/src/Device/Context.hpp b/src/Device/Context.hpp
index d9110d8..6ad2aef 100644
--- a/src/Device/Context.hpp
+++ b/src/Device/Context.hpp
@@ -20,7 +20,7 @@
 #include "Stream.hpp"
 #include "Point.hpp"
 #include "Vertex.hpp"
-#include "Common/Types.hpp"
+#include "System/Types.hpp"
 
 namespace sw
 {
diff --git a/src/Device/LRUCache.hpp b/src/Device/LRUCache.hpp
index 1a1a302..68c7332 100644
--- a/src/Device/LRUCache.hpp
+++ b/src/Device/LRUCache.hpp
@@ -15,7 +15,7 @@
 #ifndef sw_LRUCache_hpp
 #define sw_LRUCache_hpp
 
-#include "Common/Math.hpp"
+#include "System/Math.hpp"
 
 namespace sw
 {
diff --git a/src/Device/Matrix.cpp b/src/Device/Matrix.cpp
index 0da07e5..f449841 100644
--- a/src/Device/Matrix.cpp
+++ b/src/Device/Matrix.cpp
@@ -15,7 +15,7 @@
 #include "Matrix.hpp"
 
 #include "Point.hpp"
-#include "Common/Math.hpp"
+#include "System/Math.hpp"
 
 namespace sw
 {
diff --git a/src/Device/PixelProcessor.cpp b/src/Device/PixelProcessor.cpp
index 8bc40c2..4ee287d 100644
--- a/src/Device/PixelProcessor.cpp
+++ b/src/Device/PixelProcessor.cpp
@@ -16,11 +16,11 @@
 
 #include "Surface.hpp"
 #include "Primitive.hpp"
-#include "Shader/PixelPipeline.hpp"
-#include "Shader/PixelProgram.hpp"
-#include "Shader/PixelShader.hpp"
-#include "Shader/Constants.hpp"
-#include "Common/Debug.hpp"
+#include "Pipeline/PixelPipeline.hpp"
+#include "Pipeline/PixelProgram.hpp"
+#include "Pipeline/PixelShader.hpp"
+#include "Pipeline/Constants.hpp"
+#include "System/Debug.hpp"
 
 #include <string.h>
 
diff --git a/src/Device/Primitive.hpp b/src/Device/Primitive.hpp
index 52daa18..a6aaa43 100644
--- a/src/Device/Primitive.hpp
+++ b/src/Device/Primitive.hpp
@@ -16,7 +16,7 @@
 #define sw_Primitive_hpp
 
 #include "Vertex.hpp"
-#include "Main/Config.hpp"
+#include "Device/Config.hpp"
 
 namespace sw
 {
diff --git a/src/Device/QuadRasterizer.cpp b/src/Device/QuadRasterizer.cpp
index 6b319b4..0ab41c8 100644
--- a/src/Device/QuadRasterizer.cpp
+++ b/src/Device/QuadRasterizer.cpp
@@ -16,9 +16,9 @@
 
 #include "Primitive.hpp"
 #include "Renderer.hpp"
-#include "Shader/Constants.hpp"
-#include "Common/Math.hpp"
-#include "Common/Debug.hpp"
+#include "Pipeline/Constants.hpp"
+#include "System/Math.hpp"
+#include "System/Debug.hpp"
 
 namespace sw
 {
@@ -340,7 +340,7 @@
 
 	bool QuadRasterizer::interpolateZ() const
 	{
-		return state.depthTestActive || state.pixelFogActive() || (shader && shader->isVPosDeclared() && fullPixelPositionRegister);
+		return state.depthTestActive || (shader && shader->isVPosDeclared() && fullPixelPositionRegister);
 	}
 
 	bool QuadRasterizer::interpolateW() const
diff --git a/src/Device/QuadRasterizer.hpp b/src/Device/QuadRasterizer.hpp
index 1d7681d..e702f8a 100644
--- a/src/Device/QuadRasterizer.hpp
+++ b/src/Device/QuadRasterizer.hpp
@@ -16,9 +16,9 @@
 #define sw_QuadRasterizer_hpp
 
 #include "Rasterizer.hpp"
-#include "Shader/ShaderCore.hpp"
-#include "Shader/PixelShader.hpp"
-#include "Common/Types.hpp"
+#include "Pipeline/ShaderCore.hpp"
+#include "Pipeline/PixelShader.hpp"
+#include "System/Types.hpp"
 
 namespace sw
 {
diff --git a/src/Device/Rasterizer.hpp b/src/Device/Rasterizer.hpp
index 3811a25..8a2f0f3 100644
--- a/src/Device/Rasterizer.hpp
+++ b/src/Device/Rasterizer.hpp
@@ -17,7 +17,7 @@
 
 #include "Context.hpp"
 #include "PixelProcessor.hpp"
-#include "Main/Config.hpp"
+#include "Device/Config.hpp"
 
 namespace sw
 {
diff --git a/src/Device/Renderer.cpp b/src/Device/Renderer.cpp
index e7ec20a..71b22a5 100644
--- a/src/Device/Renderer.cpp
+++ b/src/Device/Renderer.cpp
@@ -18,18 +18,18 @@
 #include "Surface.hpp"
 #include "Primitive.hpp"
 #include "Polygon.hpp"
-#include "Main/FrameBuffer.hpp"
-#include "Main/SwiftConfig.hpp"
+#include "WSI/FrameBuffer.hpp"
+#include "Device/SwiftConfig.hpp"
 #include "Reactor/Reactor.hpp"
-#include "Shader/Constants.hpp"
-#include "Common/MutexLock.hpp"
-#include "Common/CPUID.hpp"
-#include "Common/Memory.hpp"
-#include "Common/Resource.hpp"
-#include "Common/Half.hpp"
-#include "Common/Math.hpp"
-#include "Common/Timer.hpp"
-#include "Common/Debug.hpp"
+#include "Pipeline/Constants.hpp"
+#include "System/MutexLock.hpp"
+#include "System/CPUID.hpp"
+#include "System/Memory.hpp"
+#include "System/Resource.hpp"
+#include "System/Half.hpp"
+#include "System/Math.hpp"
+#include "System/Timer.hpp"
+#include "System/Debug.hpp"
 
 #undef max
 
diff --git a/src/Device/Renderer.hpp b/src/Device/Renderer.hpp
index ce22866..2f5e23f 100644
--- a/src/Device/Renderer.hpp
+++ b/src/Device/Renderer.hpp
@@ -20,9 +20,9 @@
 #include "SetupProcessor.hpp"
 #include "Plane.hpp"
 #include "Blitter.hpp"
-#include "Common/MutexLock.hpp"
-#include "Common/Thread.hpp"
-#include "Main/Config.hpp"
+#include "System/MutexLock.hpp"
+#include "System/Thread.hpp"
+#include "Device/Config.hpp"
 
 #include <list>
 
diff --git a/src/Device/Sampler.cpp b/src/Device/Sampler.cpp
index efac4c6..f0bd1a8 100644
--- a/src/Device/Sampler.cpp
+++ b/src/Device/Sampler.cpp
@@ -16,8 +16,8 @@
 
 #include "Context.hpp"
 #include "Surface.hpp"
-#include "Shader/PixelRoutine.hpp"
-#include "Common/Debug.hpp"
+#include "Pipeline/PixelRoutine.hpp"
+#include "System/Debug.hpp"
 
 #include <memory.h>
 #include <string.h>
diff --git a/src/Device/Sampler.hpp b/src/Device/Sampler.hpp
index af225c5..c6fc90c 100644
--- a/src/Device/Sampler.hpp
+++ b/src/Device/Sampler.hpp
@@ -15,9 +15,9 @@
 #ifndef sw_Sampler_hpp
 #define sw_Sampler_hpp
 
-#include "Main/Config.hpp"
-#include "Renderer/Surface.hpp"
-#include "Common/Types.hpp"
+#include "Device/Config.hpp"
+#include "Device/Surface.hpp"
+#include "System/Types.hpp"
 
 namespace sw
 {
diff --git a/src/Device/SetupProcessor.cpp b/src/Device/SetupProcessor.cpp
index c5c2a16..dffff48 100644
--- a/src/Device/SetupProcessor.cpp
+++ b/src/Device/SetupProcessor.cpp
@@ -18,9 +18,9 @@
 #include "Polygon.hpp"
 #include "Context.hpp"
 #include "Renderer.hpp"
-#include "Shader/SetupRoutine.hpp"
-#include "Shader/Constants.hpp"
-#include "Common/Debug.hpp"
+#include "Pipeline/SetupRoutine.hpp"
+#include "Pipeline/Constants.hpp"
+#include "System/Debug.hpp"
 
 namespace sw
 {
diff --git a/src/Device/SetupProcessor.hpp b/src/Device/SetupProcessor.hpp
index be0adc7..4e080dd 100644
--- a/src/Device/SetupProcessor.hpp
+++ b/src/Device/SetupProcessor.hpp
@@ -17,9 +17,9 @@
 
 #include "Context.hpp"
 #include "RoutineCache.hpp"
-#include "Shader/VertexShader.hpp"
-#include "Shader/PixelShader.hpp"
-#include "Common/Types.hpp"
+#include "Pipeline/VertexShader.hpp"
+#include "Pipeline/PixelShader.hpp"
+#include "System/Types.hpp"
 
 namespace sw
 {
diff --git a/src/Device/Stream.hpp b/src/Device/Stream.hpp
index 969d8b2..1bc9b96 100644
--- a/src/Device/Stream.hpp
+++ b/src/Device/Stream.hpp
@@ -15,7 +15,7 @@
 #ifndef sw_Stream_hpp
 #define sw_Stream_hpp
 
-#include "Common/Types.hpp"
+#include "System/Types.hpp"
 
 namespace sw
 {
diff --git a/src/Device/Surface.cpp b/src/Device/Surface.cpp
index e06f2bd..15e1c77 100644
--- a/src/Device/Surface.cpp
+++ b/src/Device/Surface.cpp
@@ -18,11 +18,11 @@
 #include "Context.hpp"
 #include "ETC_Decoder.hpp"
 #include "Renderer.hpp"
-#include "Common/Half.hpp"
-#include "Common/Memory.hpp"
-#include "Common/CPUID.hpp"
-#include "Common/Resource.hpp"
-#include "Common/Debug.hpp"
+#include "System/Half.hpp"
+#include "System/Memory.hpp"
+#include "System/CPUID.hpp"
+#include "System/Resource.hpp"
+#include "System/Debug.hpp"
 #include "Reactor/Reactor.hpp"
 
 #if defined(__i386__) || defined(__x86_64__)
diff --git a/src/Device/Surface.hpp b/src/Device/Surface.hpp
index 10c5364..5b5ee68 100644
--- a/src/Device/Surface.hpp
+++ b/src/Device/Surface.hpp
@@ -16,8 +16,8 @@
 #define sw_Surface_hpp
 
 #include "Color.hpp"
-#include "Main/Config.hpp"
-#include "Common/Resource.hpp"
+#include "Device/Config.hpp"
+#include "System/Resource.hpp"
 
 namespace sw
 {
diff --git a/src/Device/SwiftConfig.cpp b/src/Device/SwiftConfig.cpp
index aa17aa8..e691c1b 100644
--- a/src/Device/SwiftConfig.cpp
+++ b/src/Device/SwiftConfig.cpp
@@ -15,9 +15,9 @@
 #include "SwiftConfig.hpp"
 
 #include "Config.hpp"
-#include "Common/Configurator.hpp"
-#include "Common/Debug.hpp"
-#include "Common/Version.h"
+#include "System/Configurator.hpp"
+#include "System/Debug.hpp"
+#include "Vulkan/Version.h"
 
 #include <sstream>
 #include <stdio.h>
diff --git a/src/Device/SwiftConfig.hpp b/src/Device/SwiftConfig.hpp
index ad3dcb5..f940c5d 100644
--- a/src/Device/SwiftConfig.hpp
+++ b/src/Device/SwiftConfig.hpp
@@ -17,9 +17,9 @@
 
 #include "Reactor/Nucleus.hpp"
 
-#include "Common/Thread.hpp"
-#include "Common/MutexLock.hpp"
-#include "Common/Socket.hpp"
+#include "System/Thread.hpp"
+#include "System/MutexLock.hpp"
+#include "System/Socket.hpp"
 
 #include <string>
 
diff --git a/src/Device/TextureStage.hpp b/src/Device/TextureStage.hpp
index 2c9ecbd..8e71b25 100644
--- a/src/Device/TextureStage.hpp
+++ b/src/Device/TextureStage.hpp
@@ -15,9 +15,9 @@
 #ifndef sw_TextureStage_hpp
 #define sw_TextureStage_hpp
 
-#include "Common/Types.hpp"
-#include "Common/Math.hpp"
-#include "Renderer/Color.hpp"
+#include "System/Types.hpp"
+#include "System/Math.hpp"
+#include "Device/Color.hpp"
 
 namespace sw
 {
diff --git a/src/Device/Vector.cpp b/src/Device/Vector.cpp
index 4a02534..258233b 100644
--- a/src/Device/Vector.cpp
+++ b/src/Device/Vector.cpp
@@ -15,7 +15,7 @@
 #include "Vector.hpp"
 
 #include "Matrix.hpp"
-#include "Common/Math.hpp"
+#include "System/Math.hpp"
 
 namespace sw
 {
diff --git a/src/Device/Vertex.hpp b/src/Device/Vertex.hpp
index 9ae8d14..972bbf3 100644
--- a/src/Device/Vertex.hpp
+++ b/src/Device/Vertex.hpp
@@ -16,8 +16,8 @@
 #define Vertex_hpp
 
 #include "Color.hpp"
-#include "Common/Types.hpp"
-#include "Main/Config.hpp"
+#include "System/Types.hpp"
+#include "Device/Config.hpp"
 
 namespace sw
 {
diff --git a/src/Device/VertexProcessor.cpp b/src/Device/VertexProcessor.cpp
index 976ea2b..5c5e1fd 100644
--- a/src/Device/VertexProcessor.cpp
+++ b/src/Device/VertexProcessor.cpp
@@ -14,13 +14,13 @@
 
 #include "VertexProcessor.hpp"
 
-#include "Shader/VertexPipeline.hpp"
-#include "Shader/VertexProgram.hpp"
-#include "Shader/VertexShader.hpp"
-#include "Shader/PixelShader.hpp"
-#include "Shader/Constants.hpp"
-#include "Common/Math.hpp"
-#include "Common/Debug.hpp"
+#include "Pipeline/VertexPipeline.hpp"
+#include "Pipeline/VertexProgram.hpp"
+#include "Pipeline/VertexShader.hpp"
+#include "Pipeline/PixelShader.hpp"
+#include "Pipeline/Constants.hpp"
+#include "System/Math.hpp"
+#include "System/Debug.hpp"
 
 #include <string.h>
 
diff --git a/src/Device/VertexProcessor.hpp b/src/Device/VertexProcessor.hpp
index 277a155..cfb90b8 100644
--- a/src/Device/VertexProcessor.hpp
+++ b/src/Device/VertexProcessor.hpp
@@ -18,7 +18,7 @@
 #include "Matrix.hpp"
 #include "Context.hpp"
 #include "RoutineCache.hpp"
-#include "Shader/VertexShader.hpp"
+#include "Pipeline/VertexShader.hpp"
 
 namespace sw
 {
diff --git a/src/OpenGL/libGLESv2/Context.cpp b/src/OpenGL/libGLESv2/Context.cpp
index 18aa8d9..a62f82a 100644
--- a/src/OpenGL/libGLESv2/Context.cpp
+++ b/src/OpenGL/libGLESv2/Context.cpp
@@ -1072,9 +1072,9 @@
 	TransformFeedback *transformFeedbackObject = mTransformFeedbackNameSpace.remove(transformFeedback);
 
 	// Detach if currently bound.
-	if(mState.transformFeedback == transformFeedback)

-	{

-		mState.transformFeedback = 0;

+	if(mState.transformFeedback == transformFeedback)
+	{
+		mState.transformFeedback = 0;
 	}
 
 	if(transformFeedbackObject)
diff --git a/src/Pipeline/Constants.cpp b/src/Pipeline/Constants.cpp
index 06dda32..25f08e2 100644
--- a/src/Pipeline/Constants.cpp
+++ b/src/Pipeline/Constants.cpp
@@ -14,8 +14,8 @@
 
 #include "Constants.hpp"
 
-#include "Common/Math.hpp"
-#include "Common/Half.hpp"
+#include "System/Math.hpp"
+#include "System/Half.hpp"
 
 #include <memory.h>
 
diff --git a/src/Pipeline/Constants.hpp b/src/Pipeline/Constants.hpp
index 6b70e04..eac6e6a 100644
--- a/src/Pipeline/Constants.hpp
+++ b/src/Pipeline/Constants.hpp
@@ -15,7 +15,7 @@
 #ifndef sw_Constants_hpp
 #define sw_Constants_hpp
 
-#include "Common/Types.hpp"
+#include "System/Types.hpp"
 
 namespace sw
 {
diff --git a/src/Pipeline/PixelProgram.cpp b/src/Pipeline/PixelProgram.cpp
index 473712b..8f285f0 100644
--- a/src/Pipeline/PixelProgram.cpp
+++ b/src/Pipeline/PixelProgram.cpp
@@ -15,8 +15,8 @@
 #include "PixelProgram.hpp"
 
 #include "SamplerCore.hpp"
-#include "Renderer/Primitive.hpp"
-#include "Renderer/Renderer.hpp"
+#include "Device/Primitive.hpp"
+#include "Device/Renderer.hpp"
 
 namespace sw
 {
diff --git a/src/Pipeline/PixelRoutine.cpp b/src/Pipeline/PixelRoutine.cpp
index 146e42d..31bcab3 100644
--- a/src/Pipeline/PixelRoutine.cpp
+++ b/src/Pipeline/PixelRoutine.cpp
@@ -16,11 +16,11 @@
 
 #include "SamplerCore.hpp"
 #include "Constants.hpp"
-#include "Renderer/Renderer.hpp"
-#include "Renderer/QuadRasterizer.hpp"
-#include "Renderer/Surface.hpp"
-#include "Renderer/Primitive.hpp"
-#include "Common/Debug.hpp"
+#include "Device/Renderer.hpp"
+#include "Device/QuadRasterizer.hpp"
+#include "Device/Surface.hpp"
+#include "Device/Primitive.hpp"
+#include "System/Debug.hpp"
 
 namespace sw
 {
diff --git a/src/Pipeline/PixelRoutine.hpp b/src/Pipeline/PixelRoutine.hpp
index 1cd076e..0c5fd63 100644
--- a/src/Pipeline/PixelRoutine.hpp
+++ b/src/Pipeline/PixelRoutine.hpp
@@ -15,7 +15,7 @@
 #ifndef sw_PixelRoutine_hpp
 #define sw_PixelRoutine_hpp
 
-#include "Renderer/QuadRasterizer.hpp"
+#include "Device/QuadRasterizer.hpp"
 
 namespace sw
 {
diff --git a/src/Pipeline/PixelShader.cpp b/src/Pipeline/PixelShader.cpp
index d24e7c2..88b3e1e 100644
--- a/src/Pipeline/PixelShader.cpp
+++ b/src/Pipeline/PixelShader.cpp
@@ -14,7 +14,7 @@
 
 #include "PixelShader.hpp"
 
-#include "Common/Debug.hpp"
+#include "System/Debug.hpp"
 
 #include <string.h>
 
diff --git a/src/Pipeline/PixelShader.hpp b/src/Pipeline/PixelShader.hpp
index a06aaaa..659c9f2 100644
--- a/src/Pipeline/PixelShader.hpp
+++ b/src/Pipeline/PixelShader.hpp
@@ -16,7 +16,7 @@
 #define sw_PixelShader_hpp
 
 #include "Shader.hpp"
-#include "Main/Config.hpp"
+#include "Device/Config.hpp"
 
 namespace sw
 {
diff --git a/src/Pipeline/SamplerCore.cpp b/src/Pipeline/SamplerCore.cpp
index 8a2aa39..a7acf2b 100644
--- a/src/Pipeline/SamplerCore.cpp
+++ b/src/Pipeline/SamplerCore.cpp
@@ -15,7 +15,7 @@
 #include "SamplerCore.hpp"
 
 #include "Constants.hpp"
-#include "Common/Debug.hpp"
+#include "System/Debug.hpp"
 
 namespace
 {
diff --git a/src/Pipeline/SetupRoutine.cpp b/src/Pipeline/SetupRoutine.cpp
index d733c2d..7d12326 100644
--- a/src/Pipeline/SetupRoutine.cpp
+++ b/src/Pipeline/SetupRoutine.cpp
@@ -15,9 +15,9 @@
 #include "SetupRoutine.hpp"
 
 #include "Constants.hpp"
-#include "Renderer/Primitive.hpp"
-#include "Renderer/Polygon.hpp"
-#include "Renderer/Renderer.hpp"
+#include "Device/Primitive.hpp"
+#include "Device/Polygon.hpp"
+#include "Device/Renderer.hpp"
 #include "Reactor/Reactor.hpp"
 
 namespace sw
diff --git a/src/Pipeline/SetupRoutine.hpp b/src/Pipeline/SetupRoutine.hpp
index c1c3205..977eb8f 100644
--- a/src/Pipeline/SetupRoutine.hpp
+++ b/src/Pipeline/SetupRoutine.hpp
@@ -15,7 +15,7 @@
 #ifndef sw_SetupRoutine_hpp
 #define sw_SetupRoutine_hpp
 
-#include "Renderer/SetupProcessor.hpp"
+#include "Device/SetupProcessor.hpp"
 #include "Reactor/Reactor.hpp"
 
 namespace sw
diff --git a/src/Pipeline/Shader.cpp b/src/Pipeline/Shader.cpp
index 36192c9..2c1f07e 100644
--- a/src/Pipeline/Shader.cpp
+++ b/src/Pipeline/Shader.cpp
@@ -16,8 +16,8 @@
 
 #include "VertexShader.hpp"
 #include "PixelShader.hpp"
-#include "Common/Math.hpp"
-#include "Common/Debug.hpp"
+#include "System/Math.hpp"
+#include "System/Debug.hpp"
 
 #include <set>
 #include <fstream>
diff --git a/src/Pipeline/Shader.hpp b/src/Pipeline/Shader.hpp
index 9e4a810..dc39494 100644
--- a/src/Pipeline/Shader.hpp
+++ b/src/Pipeline/Shader.hpp
@@ -15,7 +15,7 @@
 #ifndef sw_Shader_hpp
 #define sw_Shader_hpp
 
-#include "Common/Types.hpp"
+#include "System/Types.hpp"
 
 #include <string>
 #include <vector>
diff --git a/src/Pipeline/ShaderCore.cpp b/src/Pipeline/ShaderCore.cpp
index 4ea3260..9600b50 100644
--- a/src/Pipeline/ShaderCore.cpp
+++ b/src/Pipeline/ShaderCore.cpp
@@ -14,8 +14,8 @@
 
 #include "ShaderCore.hpp"
 
-#include "Renderer/Renderer.hpp"
-#include "Common/Debug.hpp"
+#include "Device/Renderer.hpp"
+#include "System/Debug.hpp"
 
 #include <limits.h>
 
diff --git a/src/Pipeline/ShaderCore.hpp b/src/Pipeline/ShaderCore.hpp
index fd12bf0..2a0a676 100644
--- a/src/Pipeline/ShaderCore.hpp
+++ b/src/Pipeline/ShaderCore.hpp
@@ -17,7 +17,7 @@
 
 #include "Shader.hpp"
 #include "Reactor/Reactor.hpp"
-#include "Common/Debug.hpp"
+#include "System/Debug.hpp"
 
 namespace sw
 {
diff --git a/src/Pipeline/VertexPipeline.hpp b/src/Pipeline/VertexPipeline.hpp
index 0736afb..852c76a 100644
--- a/src/Pipeline/VertexPipeline.hpp
+++ b/src/Pipeline/VertexPipeline.hpp
@@ -17,8 +17,8 @@
 
 #include "VertexRoutine.hpp"
 
-#include "Renderer/Context.hpp"
-#include "Renderer/VertexProcessor.hpp"
+#include "Device/Context.hpp"
+#include "Device/VertexProcessor.hpp"
 
 namespace sw
 {
diff --git a/src/Pipeline/VertexProgram.cpp b/src/Pipeline/VertexProgram.cpp
index ad4e37b..a24bb40 100644
--- a/src/Pipeline/VertexProgram.cpp
+++ b/src/Pipeline/VertexProgram.cpp
@@ -16,10 +16,10 @@
 
 #include "VertexShader.hpp"
 #include "SamplerCore.hpp"
-#include "Renderer/Renderer.hpp"
-#include "Renderer/Vertex.hpp"
-#include "Common/Half.hpp"
-#include "Common/Debug.hpp"
+#include "Device/Renderer.hpp"
+#include "Device/Vertex.hpp"
+#include "System/Half.hpp"
+#include "System/Debug.hpp"
 
 namespace sw
 {
diff --git a/src/Pipeline/VertexProgram.hpp b/src/Pipeline/VertexProgram.hpp
index 3c4199c..b008d91 100644
--- a/src/Pipeline/VertexProgram.hpp
+++ b/src/Pipeline/VertexProgram.hpp
@@ -19,8 +19,8 @@
 #include "ShaderCore.hpp"
 
 #include "SamplerCore.hpp"
-#include "Renderer/Stream.hpp"
-#include "Common/Types.hpp"
+#include "Device/Stream.hpp"
+#include "System/Types.hpp"
 
 namespace sw
 {
diff --git a/src/Pipeline/VertexRoutine.cpp b/src/Pipeline/VertexRoutine.cpp
index 9b8d336..916230f 100644
--- a/src/Pipeline/VertexRoutine.cpp
+++ b/src/Pipeline/VertexRoutine.cpp
@@ -16,10 +16,10 @@
 
 #include "VertexShader.hpp"
 #include "Constants.hpp"
-#include "Renderer/Vertex.hpp"
-#include "Renderer/Renderer.hpp"
-#include "Common/Half.hpp"
-#include "Common/Debug.hpp"
+#include "Device/Vertex.hpp"
+#include "Device/Renderer.hpp"
+#include "System/Half.hpp"
+#include "System/Debug.hpp"
 
 namespace sw
 {
diff --git a/src/Pipeline/VertexRoutine.hpp b/src/Pipeline/VertexRoutine.hpp
index 905118b..9837fdc 100644
--- a/src/Pipeline/VertexRoutine.hpp
+++ b/src/Pipeline/VertexRoutine.hpp
@@ -15,8 +15,8 @@
 #ifndef sw_VertexRoutine_hpp
 #define sw_VertexRoutine_hpp
 
-#include "Renderer/Color.hpp"
-#include "Renderer/VertexProcessor.hpp"
+#include "Device/Color.hpp"
+#include "Device/VertexProcessor.hpp"
 #include "ShaderCore.hpp"
 #include "VertexShader.hpp"
 
diff --git a/src/Pipeline/VertexShader.cpp b/src/Pipeline/VertexShader.cpp
index 8f1c4f8..425ed4d 100644
--- a/src/Pipeline/VertexShader.cpp
+++ b/src/Pipeline/VertexShader.cpp
@@ -14,8 +14,8 @@
 
 #include "VertexShader.hpp"
 
-#include "Renderer/Vertex.hpp"
-#include "Common/Debug.hpp"
+#include "Device/Vertex.hpp"
+#include "System/Debug.hpp"
 
 #include <string.h>
 
diff --git a/src/Pipeline/VertexShader.hpp b/src/Pipeline/VertexShader.hpp
index 9a9a0a6..fc0a405 100644
--- a/src/Pipeline/VertexShader.hpp
+++ b/src/Pipeline/VertexShader.hpp
@@ -16,7 +16,7 @@
 #define sw_VertexShader_hpp
 
 #include "Shader.hpp"
-#include "Main/Config.hpp"
+#include "Device/Config.hpp"
 
 namespace sw
 {
diff --git a/src/Vulkan/vulkan.vcxproj b/src/Vulkan/vulkan.vcxproj
index 6ab6569..252979f 100644
--- a/src/Vulkan/vulkan.vcxproj
+++ b/src/Vulkan/vulkan.vcxproj
@@ -184,6 +184,7 @@
   </ItemGroup>

   <ItemGroup>

     <ClInclude Include="resource.h" />

+    <ClInclude Include="Version.h" />

     <ClInclude Include="VkBuffer.hpp" />

     <ClInclude Include="VkBufferView.hpp" />

     <ClInclude Include="VkCommandBuffer.hpp" />

diff --git a/src/Vulkan/vulkan.vcxproj.filters b/src/Vulkan/vulkan.vcxproj.filters
index b134e04..f8661bd 100644
--- a/src/Vulkan/vulkan.vcxproj.filters
+++ b/src/Vulkan/vulkan.vcxproj.filters
@@ -488,6 +488,7 @@
     <ClInclude Include="VkDestroy.h">

       <Filter>Header Files\Vulkan</Filter>

     </ClInclude>

+    <ClInclude Include="Version.h" />

   </ItemGroup>

   <ItemGroup>

     <None Include="swiftshader_icd.def" />

diff --git a/src/WSI/FrameBuffer.cpp b/src/WSI/FrameBuffer.cpp
index 7a8ddc1..01838fe 100644
--- a/src/WSI/FrameBuffer.cpp
+++ b/src/WSI/FrameBuffer.cpp
@@ -14,10 +14,10 @@
 
 #include "FrameBuffer.hpp"
 
-#include "Renderer/Surface.hpp"
+#include "Device/Surface.hpp"
 #include "Reactor/Reactor.hpp"
-#include "Common/Timer.hpp"
-#include "Common/Debug.hpp"
+#include "System/Timer.hpp"
+#include "System/Debug.hpp"
 
 #include <stdio.h>
 #include <string.h>
diff --git a/src/WSI/FrameBuffer.hpp b/src/WSI/FrameBuffer.hpp
index f07feb3..7ce1d17 100644
--- a/src/WSI/FrameBuffer.hpp
+++ b/src/WSI/FrameBuffer.hpp
@@ -16,8 +16,8 @@
 #define	sw_FrameBuffer_hpp
 
 #include "Reactor/Reactor.hpp"
-#include "Renderer/Surface.hpp"
-#include "Common/Thread.hpp"
+#include "Device/Surface.hpp"
+#include "System/Thread.hpp"
 
 namespace sw
 {
diff --git a/src/WSI/FrameBufferAndroid.cpp b/src/WSI/FrameBufferAndroid.cpp
index 0ae5f09..8bc114e 100644
--- a/src/WSI/FrameBufferAndroid.cpp
+++ b/src/WSI/FrameBufferAndroid.cpp
@@ -14,7 +14,7 @@
 
 #include "FrameBufferAndroid.hpp"
 
-#include "Common/GrallocAndroid.hpp"
+#include "System/GrallocAndroid.hpp"
 
 #include <system/window.h>
 
diff --git a/src/WSI/FrameBufferAndroid.hpp b/src/WSI/FrameBufferAndroid.hpp
index b71c32b..fd6a016 100644
--- a/src/WSI/FrameBufferAndroid.hpp
+++ b/src/WSI/FrameBufferAndroid.hpp
@@ -15,8 +15,8 @@
 #ifndef sw_FrameBufferAndroid_hpp
 #define sw_FrameBufferAndroid_hpp
 
-#include "Main/FrameBuffer.hpp"
-#include "Common/Debug.hpp"
+#include "WSI/FrameBuffer.hpp"
+#include "System/Debug.hpp"
 
 struct ANativeWindow;
 struct ANativeWindowBuffer;
diff --git a/src/WSI/FrameBufferDD.cpp b/src/WSI/FrameBufferDD.cpp
index 46ed89f..9625a13 100644
--- a/src/WSI/FrameBufferDD.cpp
+++ b/src/WSI/FrameBufferDD.cpp
@@ -14,7 +14,7 @@
 
 #include "FrameBufferDD.hpp"
 
-#include "Common/Debug.hpp"
+#include "System/Debug.hpp"
 
 namespace sw
 {
diff --git a/src/WSI/FrameBufferGDI.cpp b/src/WSI/FrameBufferGDI.cpp
index 90a469e..5c80bd7 100644
--- a/src/WSI/FrameBufferGDI.cpp
+++ b/src/WSI/FrameBufferGDI.cpp
@@ -14,7 +14,7 @@
 
 #include "FrameBufferGDI.hpp"
 
-#include "Common/Debug.hpp"
+#include "System/Debug.hpp"
 
 namespace sw
 {
diff --git a/src/WSI/FrameBufferOSX.hpp b/src/WSI/FrameBufferOSX.hpp
index 07f8d63..85a2621 100644
--- a/src/WSI/FrameBufferOSX.hpp
+++ b/src/WSI/FrameBufferOSX.hpp
@@ -15,7 +15,7 @@
 #ifndef sw_FrameBufferOSX_hpp
 #define sw_FrameBufferOSX_hpp
 
-#include "Main/FrameBuffer.hpp"
+#include "WSI/FrameBuffer.hpp"
 
 #import <Cocoa/Cocoa.h>
 
diff --git a/src/WSI/FrameBufferOSX.mm b/src/WSI/FrameBufferOSX.mm
index 6d58ae7..0403a54 100644
--- a/src/WSI/FrameBufferOSX.mm
+++ b/src/WSI/FrameBufferOSX.mm
@@ -14,7 +14,7 @@
 
 #include "FrameBufferOSX.hpp"
 
-#include "Common/Debug.hpp"
+#include "System/Debug.hpp"
 
 #include <EGL/egl.h>
 #import <QuartzCore/QuartzCore.h>
diff --git a/src/WSI/FrameBufferOzone.hpp b/src/WSI/FrameBufferOzone.hpp
index 0dc9f60..1f253fa 100644
--- a/src/WSI/FrameBufferOzone.hpp
+++ b/src/WSI/FrameBufferOzone.hpp
@@ -15,7 +15,7 @@
 #ifndef sw_FrameBufferOzone_hpp
 #define sw_FrameBufferOzone_hpp
 
-#include "Main/FrameBuffer.hpp"
+#include "WSI/FrameBuffer.hpp"
 
 namespace sw
 {
diff --git a/src/WSI/FrameBufferWin.cpp b/src/WSI/FrameBufferWin.cpp
index cad8954..e23487a 100644
--- a/src/WSI/FrameBufferWin.cpp
+++ b/src/WSI/FrameBufferWin.cpp
@@ -53,7 +53,7 @@
 
 #include "FrameBufferDD.hpp"
 #include "FrameBufferGDI.hpp"
-#include "Common/Configurator.hpp"
+#include "System/Configurator.hpp"
 
 sw::FrameBufferWin *createFrameBufferWin(HWND windowHandle, int width, int height, bool fullscreen, bool topLeftOrigin)
 {
diff --git a/src/WSI/FrameBufferX11.cpp b/src/WSI/FrameBufferX11.cpp
index b3ae3b4..aa9f38e 100644
--- a/src/WSI/FrameBufferX11.cpp
+++ b/src/WSI/FrameBufferX11.cpp
@@ -15,7 +15,7 @@
 #include "FrameBufferX11.hpp"
 
 #include "libX11.hpp"
-#include "Common/Timer.hpp"
+#include "System/Timer.hpp"
 
 #include <sys/ipc.h>
 #include <sys/shm.h>
diff --git a/src/WSI/FrameBufferX11.hpp b/src/WSI/FrameBufferX11.hpp
index dc96331..d40bed9 100644
--- a/src/WSI/FrameBufferX11.hpp
+++ b/src/WSI/FrameBufferX11.hpp
@@ -15,8 +15,8 @@
 #ifndef sw_FrameBufferX11_hpp
 #define sw_FrameBufferX11_hpp
 
-#include "Main/FrameBuffer.hpp"
-#include "Common/Debug.hpp"
+#include "WSI/FrameBuffer.hpp"
+#include "System/Debug.hpp"
 
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
diff --git a/src/WSI/libX11.cpp b/src/WSI/libX11.cpp
index f3723ff..5cca9f8 100644
--- a/src/WSI/libX11.cpp
+++ b/src/WSI/libX11.cpp
@@ -14,7 +14,7 @@
 
 #include "libX11.hpp"
 
-#include "Common/SharedLibrary.hpp"
+#include "System/SharedLibrary.hpp"
 
 #define Bool int