diff options
author | Tony Wasserka <neobrainx@gmail.com> | 2014-12-07 22:22:04 +0100 |
---|---|---|
committer | Tony Wasserka <neobrainx@gmail.com> | 2014-12-07 23:52:17 +0100 |
commit | 4d4572c697616c43ce47f43fc5de1a1b9ae27d5f (patch) | |
tree | 8562e5e0b520cb7faae514595871e76c250553b5 | |
parent | externals: Add boost submodule. (diff) | |
download | yuzu-4d4572c697616c43ce47f43fc5de1a1b9ae27d5f.tar yuzu-4d4572c697616c43ce47f43fc5de1a1b9ae27d5f.tar.gz yuzu-4d4572c697616c43ce47f43fc5de1a1b9ae27d5f.tar.bz2 yuzu-4d4572c697616c43ce47f43fc5de1a1b9ae27d5f.tar.lz yuzu-4d4572c697616c43ce47f43fc5de1a1b9ae27d5f.tar.xz yuzu-4d4572c697616c43ce47f43fc5de1a1b9ae27d5f.tar.zst yuzu-4d4572c697616c43ce47f43fc5de1a1b9ae27d5f.zip |
-rw-r--r-- | CMakeLists.txt | 8 | ||||
-rw-r--r-- | src/video_core/vertex_shader.cpp | 16 |
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) add_definitions(-DHAVE_PNG) endif () +find_package(Boost) +if (Boost_FOUND) + include_directories(${Boost_INCLUDE_DIRS}) +else() + message(STATUS "Boost not found, falling back to externals") + include_directories(externals/boost) +endif() + # Include bundled CMake modules list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/externals/cmake-modules") 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 @@ // Licensed under GPLv2 // Refer to the license.txt file included. +#include <boost/range/algorithm.hpp> + +#include <common/file_util.h> + +#include <core/mem_map.h> + +#include "debug_utils/debug_utils.h" + #include "pica.h" #include "vertex_shader.h" -#include "debug_utils/debug_utils.h" -#include <core/mem_map.h> -#include <common/file_util.h> namespace Pica { @@ -238,7 +243,7 @@ OutputVertex RunShader(const InputVertex& input, int num_attributes) // Setup input register table const auto& attribute_register_map = registers.vs_input_register_map; float24 dummy_register; - std::fill(&state.input_register_table[0], &state.input_register_table[16], &dummy_register); + boost::fill(state.input_register_table, &dummy_register); if(num_attributes > 0) state.input_register_table[attribute_register_map.attribute0_register] = &input.attr[0].x; if(num_attributes > 1) state.input_register_table[attribute_register_map.attribute1_register] = &input.attr[1].x; 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) state.status_registers[0] = false; state.status_registers[1] = false; - std::fill(state.call_stack, state.call_stack + sizeof(state.call_stack) / sizeof(state.call_stack[0]), - VertexShaderState::INVALID_ADDRESS); + boost::fill(state.call_stack, VertexShaderState::INVALID_ADDRESS); state.call_stack_pointer = &state.call_stack[0]; ProcessShaderCode(state); |