1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-14 13:29:15 +01:00
dxvk/src/dxbc/dxbc_util.cpp
Philip Rebohle b44cad4d32
[dxbc] Replace computeResourceSlotId by light-weight alternatives
Slightly reduces overhead of D3D11 binding methods.
2019-04-18 10:06:15 +02:00

26 lines
626 B
C++

#include "dxbc_util.h"
namespace dxvk {
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) {
return static_cast<uint32_t>(primitive)
- static_cast<uint32_t>(DxbcPrimitive::Patch1);
} else {
return s_vertexCounts.at(
static_cast<uint32_t>(primitive));
}
}
}