summaryrefslogtreecommitdiff
path: root/Source/UnitTests/VideoCommon/VertexLoaderTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/UnitTests/VideoCommon/VertexLoaderTest.cpp')
-rw-r--r--Source/UnitTests/VideoCommon/VertexLoaderTest.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/Source/UnitTests/VideoCommon/VertexLoaderTest.cpp b/Source/UnitTests/VideoCommon/VertexLoaderTest.cpp
index 24f975d8fc..eedbff0304 100644
--- a/Source/UnitTests/VideoCommon/VertexLoaderTest.cpp
+++ b/Source/UnitTests/VideoCommon/VertexLoaderTest.cpp
@@ -121,7 +121,9 @@ INSTANTIATE_TEST_SUITE_P(
::testing::Values(VertexComponentFormat::Direct, VertexComponentFormat::Index8,
VertexComponentFormat::Index16),
::testing::Values(ComponentFormat::UByte, ComponentFormat::Byte, ComponentFormat::UShort,
- ComponentFormat::Short, ComponentFormat::Float),
+ ComponentFormat::Short, ComponentFormat::Float,
+ ComponentFormat::InvalidFloat5, ComponentFormat::InvalidFloat6,
+ ComponentFormat::InvalidFloat7),
::testing::Values(CoordComponentCount::XY, CoordComponentCount::XYZ),
::testing::Values(0, 1, 31) // frac
));
@@ -170,10 +172,12 @@ TEST_P(VertexLoaderParamTest, PositionAll)
{
input_size = addr == VertexComponentFormat::Index8 ? 1 : 2;
for (int i = 0; i < count; i++)
+ {
if (addr == VertexComponentFormat::Index8)
Input<u8>(i);
else
Input<u16>(i);
+ }
VertexLoaderManager::cached_arraybases[CPArray::Position] = m_src.GetPointer();
g_main_cp_state.array_strides[CPArray::Position] = elem_count * elem_size;
}
@@ -195,6 +199,9 @@ TEST_P(VertexLoaderParamTest, PositionAll)
Input(MathUtil::SaturatingCast<s16>(value));
break;
case ComponentFormat::Float:
+ case ComponentFormat::InvalidFloat5:
+ case ComponentFormat::InvalidFloat6:
+ case ComponentFormat::InvalidFloat7:
Input(value);
break;
}
@@ -202,7 +209,7 @@ TEST_P(VertexLoaderParamTest, PositionAll)
RunVertices(count);
- float scale = 1.f / (1u << (format == ComponentFormat::Float ? 0 : frac));
+ float scale = 1.f / (1u << (format >= ComponentFormat::Float ? 0 : frac));
for (auto iter = values.begin(); iter != values.end();)
{
float f, g;
@@ -225,6 +232,9 @@ TEST_P(VertexLoaderParamTest, PositionAll)
g = MathUtil::SaturatingCast<s16>(*iter++);
break;
case ComponentFormat::Float:
+ case ComponentFormat::InvalidFloat5:
+ case ComponentFormat::InvalidFloat6:
+ case ComponentFormat::InvalidFloat7:
f = *iter++;
g = *iter++;
break;
@@ -543,7 +553,9 @@ INSTANTIATE_TEST_SUITE_P(
::testing::Values(VertexComponentFormat::NotPresent, VertexComponentFormat::Direct,
VertexComponentFormat::Index8, VertexComponentFormat::Index16),
::testing::Values(ComponentFormat::UByte, ComponentFormat::Byte, ComponentFormat::UShort,
- ComponentFormat::Short, ComponentFormat::Float),
+ ComponentFormat::Short, ComponentFormat::Float,
+ ComponentFormat::InvalidFloat5, ComponentFormat::InvalidFloat6,
+ ComponentFormat::InvalidFloat7),
::testing::Values(NormalComponentCount::N, NormalComponentCount::NTB),
::testing::Values(false, true)));
@@ -609,7 +621,9 @@ TEST_P(VertexLoaderNormalTest, NormalAll)
Input<s16>(value * (1 << 14));
break;
case ComponentFormat::Float:
- default:
+ case ComponentFormat::InvalidFloat5:
+ case ComponentFormat::InvalidFloat6:
+ case ComponentFormat::InvalidFloat7:
Input<float>(value);
break;
}