1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-13 19:29:14 +01:00

[d3d9] Treat largest element in Stream 0 as vertex decl size

Closes #2059
This commit is contained in:
Joshua Ashton 2021-05-13 01:32:40 +01:00
parent b84a03b4d4
commit 0520ce9448
No known key found for this signature in database
GPG Key ID: C85A08669126BE8D
2 changed files with 7 additions and 5 deletions

View File

@ -208,6 +208,9 @@ namespace dxvk {
void D3D9VertexDecl::Classify() {
for (const auto& element : m_elements) {
if (element.Stream == 0 && element.Type != D3DDECLTYPE_UNUSED)
m_size = std::max(m_size, element.Offset + GetDecltypeSize(D3DDECLTYPE(element.Type)));
if (element.Usage == D3DDECLUSAGE_COLOR && element.UsageIndex == 0)
m_flags.set(D3D9VertexDeclFlag::HasColor0);
else if (element.Usage == D3DDECLUSAGE_COLOR && element.UsageIndex == 1)

View File

@ -51,11 +51,7 @@ namespace dxvk {
}
UINT GetSize() const {
if (m_elements.size() == 0)
return 0;
auto& end = m_elements.back();
return end.Offset + GetDecltypeSize(D3DDECLTYPE(end.Type));
return m_size;
}
bool TestFlag(D3D9VertexDeclFlag flag) const {
@ -78,6 +74,9 @@ namespace dxvk {
uint32_t m_texcoordMask = 0;
// The size of Stream 0. That's all we care about.
uint32_t m_size = 0;
};
}