summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexShaderManager.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2019-06-06 13:35:57 +0200
committerGitHub <noreply@github.com>2019-06-06 13:35:57 +0200
commit3f4952d57c49dee21a2f92d2559f906d4c253af2 (patch)
tree5511ef288aa216539a3b4fea5a0c52496a5c445f /Source/Core/VideoCommon/VertexShaderManager.cpp
parent824ec84e82ca259e0786b23bf3729bb6126409c8 (diff)
parenta9663669dc1037a04e37ae30efe18c0650547ac5 (diff)
Merge pull request #8152 from lioncash/array-size
Common/CommonFuncs: Remove now-unneccessary ArraySize function
Diffstat (limited to 'Source/Core/VideoCommon/VertexShaderManager.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexShaderManager.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/Source/Core/VideoCommon/VertexShaderManager.cpp b/Source/Core/VideoCommon/VertexShaderManager.cpp
index 58ecf198c8..0301795e10 100644
--- a/Source/Core/VideoCommon/VertexShaderManager.cpp
+++ b/Source/Core/VideoCommon/VertexShaderManager.cpp
@@ -2,15 +2,15 @@
// Licensed under GPLv2+
// Refer to the license.txt file included.
-#include <cfloat>
+#include "VideoCommon/VertexShaderManager.h"
+
+#include <array>
#include <cmath>
#include <cstring>
-#include <sstream>
-#include <string>
+#include <iterator>
#include "Common/BitSet.h"
#include "Common/ChunkFile.h"
-#include "Common/CommonFuncs.h"
#include "Common/CommonTypes.h"
#include "Common/Logging/Log.h"
#include "Common/Matrix.h"
@@ -22,7 +22,6 @@
#include "VideoCommon/RenderBase.h"
#include "VideoCommon/Statistics.h"
#include "VideoCommon/VertexManagerBase.h"
-#include "VideoCommon/VertexShaderManager.h"
#include "VideoCommon/VideoCommon.h"
#include "VideoCommon/VideoConfig.h"
#include "VideoCommon/XFMemory.h"
@@ -251,13 +250,14 @@ void VertexShaderManager::SetConstants()
if (bTexMatricesChanged[0])
{
bTexMatricesChanged[0] = false;
- const float* pos_matrix_ptrs[] = {
+ const std::array<const float*, 4> pos_matrix_ptrs{
&xfmem.posMatrices[g_main_cp_state.matrix_index_a.Tex0MtxIdx * 4],
&xfmem.posMatrices[g_main_cp_state.matrix_index_a.Tex1MtxIdx * 4],
&xfmem.posMatrices[g_main_cp_state.matrix_index_a.Tex2MtxIdx * 4],
- &xfmem.posMatrices[g_main_cp_state.matrix_index_a.Tex3MtxIdx * 4]};
+ &xfmem.posMatrices[g_main_cp_state.matrix_index_a.Tex3MtxIdx * 4],
+ };
- for (size_t i = 0; i < ArraySize(pos_matrix_ptrs); ++i)
+ for (size_t i = 0; i < pos_matrix_ptrs.size(); ++i)
{
memcpy(constants.texmatrices[3 * i].data(), pos_matrix_ptrs[i], 3 * sizeof(float4));
}
@@ -267,13 +267,14 @@ void VertexShaderManager::SetConstants()
if (bTexMatricesChanged[1])
{
bTexMatricesChanged[1] = false;
- const float* pos_matrix_ptrs[] = {
+ const std::array<const float*, 4> pos_matrix_ptrs{
&xfmem.posMatrices[g_main_cp_state.matrix_index_b.Tex4MtxIdx * 4],
&xfmem.posMatrices[g_main_cp_state.matrix_index_b.Tex5MtxIdx * 4],
&xfmem.posMatrices[g_main_cp_state.matrix_index_b.Tex6MtxIdx * 4],
- &xfmem.posMatrices[g_main_cp_state.matrix_index_b.Tex7MtxIdx * 4]};
+ &xfmem.posMatrices[g_main_cp_state.matrix_index_b.Tex7MtxIdx * 4],
+ };
- for (size_t i = 0; i < ArraySize(pos_matrix_ptrs); ++i)
+ for (size_t i = 0; i < pos_matrix_ptrs.size(); ++i)
{
memcpy(constants.texmatrices[3 * i + 12].data(), pos_matrix_ptrs[i], 3 * sizeof(float4));
}
@@ -461,9 +462,9 @@ void VertexShaderManager::SetConstants()
{
bTexMtxInfoChanged = false;
constants.xfmem_dualTexInfo = xfmem.dualTexTrans.enabled;
- for (size_t i = 0; i < ArraySize(xfmem.texMtxInfo); i++)
+ for (size_t i = 0; i < std::size(xfmem.texMtxInfo); i++)
constants.xfmem_pack1[i][0] = xfmem.texMtxInfo[i].hex;
- for (size_t i = 0; i < ArraySize(xfmem.postMtxInfo); i++)
+ for (size_t i = 0; i < std::size(xfmem.postMtxInfo); i++)
constants.xfmem_pack1[i][1] = xfmem.postMtxInfo[i].hex;
dirty = true;