Skip to content

Commit

Permalink
VertexLoader_Position: Make lookup tables immutable
Browse files Browse the repository at this point in the history
Allows the compiler to place these arrays within the read-only segment.
  • Loading branch information
lioncash committed May 30, 2019
1 parent be9a03b commit 14e544e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Source/Core/VideoCommon/VertexLoader_Position.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void Pos_ReadIndex(VertexLoader* loader)
LOG_VTX();
}

TPipelineFunction tableReadPosition[4][8][2] = {
constexpr TPipelineFunction s_table_read_position[4][8][2] = {
{
{
nullptr,
Expand Down Expand Up @@ -168,7 +168,7 @@ TPipelineFunction tableReadPosition[4][8][2] = {
},
};

int tableReadPositionVertexSize[4][8][2] = {
constexpr int s_table_read_position_vertex_size[4][8][2] = {
{
{0, 0},
{0, 0},
Expand Down Expand Up @@ -202,11 +202,11 @@ int tableReadPositionVertexSize[4][8][2] = {

unsigned int VertexLoader_Position::GetSize(u64 _type, unsigned int _format, unsigned int _elements)
{
return tableReadPositionVertexSize[_type][_format][_elements];
return s_table_read_position_vertex_size[_type][_format][_elements];
}

TPipelineFunction VertexLoader_Position::GetFunction(u64 _type, unsigned int _format,
unsigned int _elements)
{
return tableReadPosition[_type][_format][_elements];
return s_table_read_position[_type][_format][_elements];
}

0 comments on commit 14e544e

Please sign in to comment.