2017-12-08 22:30:41 +01:00
|
|
|
#include "dxbc_util.h"
|
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
2017-12-18 16:41:05 +01:00
|
|
|
uint32_t primitiveVertexCount(DxbcPrimitive primitive) {
|
|
|
|
static const std::array<uint32_t, 8> s_vertexCounts = {
|
|
|
|
0, // Undefined
|
|
|
|
1, // Point
|
|
|
|
2, // Line
|
|
|
|
3, // Triangle
|
|
|
|
0, // Undefined
|
|
|
|
0, // Undefined
|
|
|
|
4, // Line with adjacency
|
|
|
|
6, // Triangle with adjacency
|
|
|
|
};
|
|
|
|
|
|
|
|
if (primitive >= DxbcPrimitive::Patch1) {
|
2022-08-09 02:44:05 +02:00
|
|
|
return uint32_t(primitive)
|
|
|
|
- uint32_t(DxbcPrimitive::Patch1)
|
|
|
|
+ 1u;
|
2017-12-18 16:41:05 +01:00
|
|
|
} else {
|
2022-08-09 02:44:05 +02:00
|
|
|
return s_vertexCounts.at(uint32_t(primitive));
|
2017-12-18 16:41:05 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-08 22:30:41 +01:00
|
|
|
}
|