VertexLoader_Position: Make lookup tables immutable

Allows the compiler to place these arrays within the read-only segment.
This commit is contained in:
Lioncash 2019-05-30 09:30:50 -04:00
parent be9a03b35f
commit 14e544eef8
1 changed files with 4 additions and 4 deletions

View File

@ -77,7 +77,7 @@ void Pos_ReadIndex(VertexLoader* loader)
LOG_VTX(); LOG_VTX();
} }
TPipelineFunction tableReadPosition[4][8][2] = { constexpr TPipelineFunction s_table_read_position[4][8][2] = {
{ {
{ {
nullptr, nullptr,
@ -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},
{0, 0}, {0, 0},
@ -202,11 +202,11 @@ int tableReadPositionVertexSize[4][8][2] = {
unsigned int VertexLoader_Position::GetSize(u64 _type, unsigned int _format, unsigned int _elements) 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, TPipelineFunction VertexLoader_Position::GetFunction(u64 _type, unsigned int _format,
unsigned int _elements) unsigned int _elements)
{ {
return tableReadPosition[_type][_format][_elements]; return s_table_read_position[_type][_format][_elements];
} }