summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Tony Wasserka2014-12-07 22:22:04 +0100
committerGravatar Tony Wasserka2014-12-07 23:52:17 +0100
commit4d4572c697616c43ce47f43fc5de1a1b9ae27d5f (patch)
tree8562e5e0b520cb7faae514595871e76c250553b5
parentexternals: Add boost submodule. (diff)
downloadyuzu-4d4572c697616c43ce47f43fc5de1a1b9ae27d5f.tar.gz
yuzu-4d4572c697616c43ce47f43fc5de1a1b9ae27d5f.tar.xz
yuzu-4d4572c697616c43ce47f43fc5de1a1b9ae27d5f.zip
Integrate Boost into build system and perform a trivial cleanup in vertex_shader.cpp.
Diffstat (limited to '')
-rw-r--r--CMakeLists.txt8
-rw-r--r--src/video_core/vertex_shader.cpp16
2 files changed, 18 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 05a560404..61d5d524a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,6 +19,14 @@ if (PNG_FOUND)
19 add_definitions(-DHAVE_PNG) 19 add_definitions(-DHAVE_PNG)
20endif () 20endif ()
21 21
22find_package(Boost)
23if (Boost_FOUND)
24 include_directories(${Boost_INCLUDE_DIRS})
25else()
26 message(STATUS "Boost not found, falling back to externals")
27 include_directories(externals/boost)
28endif()
29
22# Include bundled CMake modules 30# Include bundled CMake modules
23list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/externals/cmake-modules") 31list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/externals/cmake-modules")
24 32
diff --git a/src/video_core/vertex_shader.cpp b/src/video_core/vertex_shader.cpp
index 96625791c..0dff11a0f 100644
--- a/src/video_core/vertex_shader.cpp
+++ b/src/video_core/vertex_shader.cpp
@@ -2,11 +2,16 @@
2// Licensed under GPLv2 2// Licensed under GPLv2
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <boost/range/algorithm.hpp>
6
7#include <common/file_util.h>
8
9#include <core/mem_map.h>
10
11#include "debug_utils/debug_utils.h"
12
5#include "pica.h" 13#include "pica.h"
6#include "vertex_shader.h" 14#include "vertex_shader.h"
7#include "debug_utils/debug_utils.h"
8#include <core/mem_map.h>
9#include <common/file_util.h>
10 15
11namespace Pica { 16namespace Pica {
12 17
@@ -238,7 +243,7 @@ OutputVertex RunShader(const InputVertex& input, int num_attributes)
238 // Setup input register table 243 // Setup input register table
239 const auto& attribute_register_map = registers.vs_input_register_map; 244 const auto& attribute_register_map = registers.vs_input_register_map;
240 float24 dummy_register; 245 float24 dummy_register;
241 std::fill(&state.input_register_table[0], &state.input_register_table[16], &dummy_register); 246 boost::fill(state.input_register_table, &dummy_register);
242 if(num_attributes > 0) state.input_register_table[attribute_register_map.attribute0_register] = &input.attr[0].x; 247 if(num_attributes > 0) state.input_register_table[attribute_register_map.attribute0_register] = &input.attr[0].x;
243 if(num_attributes > 1) state.input_register_table[attribute_register_map.attribute1_register] = &input.attr[1].x; 248 if(num_attributes > 1) state.input_register_table[attribute_register_map.attribute1_register] = &input.attr[1].x;
244 if(num_attributes > 2) state.input_register_table[attribute_register_map.attribute2_register] = &input.attr[2].x; 249 if(num_attributes > 2) state.input_register_table[attribute_register_map.attribute2_register] = &input.attr[2].x;
@@ -272,8 +277,7 @@ OutputVertex RunShader(const InputVertex& input, int num_attributes)
272 277
273 state.status_registers[0] = false; 278 state.status_registers[0] = false;
274 state.status_registers[1] = false; 279 state.status_registers[1] = false;
275 std::fill(state.call_stack, state.call_stack + sizeof(state.call_stack) / sizeof(state.call_stack[0]), 280 boost::fill(state.call_stack, VertexShaderState::INVALID_ADDRESS);
276 VertexShaderState::INVALID_ADDRESS);
277 state.call_stack_pointer = &state.call_stack[0]; 281 state.call_stack_pointer = &state.call_stack[0];
278 282
279 ProcessShaderCode(state); 283 ProcessShaderCode(state);