[dxbc] Support parsing the ISG1 and OSG1 signature chunks

Required to get the Resident Evil 2 demo to work.
This commit is contained in:
Philip Rebohle 2019-01-12 15:17:51 +01:00
parent 3935d2540e
commit bee21e7539
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 10 additions and 3 deletions

View File

@ -10,10 +10,14 @@ namespace dxvk {
DxbcScalarType::Uint32, DxbcScalarType::Uint32,
DxbcScalarType::Sint32, DxbcScalarType::Float32,
};
// https://github.com/DarkStarSword/3d-fixes/blob/master/dx11shaderanalyse.py#L101
bool hasStream = (tag == "ISG1") || (tag == "OSG1") || (tag == "PSG1") || (tag == "OSG5");
bool hasPrecision = (tag == "ISG1") || (tag == "OSG1") || (tag == "PSG1");
for (uint32_t i = 0; i < elementCount; i++) {
DxbcSgnEntry entry;
entry.streamId = tag == "OSG5" ? reader.readu32() : 0;
entry.streamId = hasStream ? reader.readu32() : 0;
entry.semanticName = reader.clone(reader.readu32()).readString();
entry.semanticIndex = reader.readu32();
entry.systemValue = static_cast<DxbcSystemValue>(reader.readu32());
@ -21,6 +25,9 @@ namespace dxvk {
entry.registerId = reader.readu32();
entry.componentMask = bit::extract(reader.readu32(), 0, 3);
if (hasPrecision)
reader.readu32();
m_entries.push_back(entry);
}
}

View File

@ -23,10 +23,10 @@ namespace dxvk {
if ((tag == "SHDR") || (tag == "SHEX"))
m_shexChunk = new DxbcShex(chunkReader);
if ((tag == "ISGN"))
if ((tag == "ISGN") || (tag == "ISG1"))
m_isgnChunk = new DxbcIsgn(chunkReader, tag);
if ((tag == "OSGN") || (tag == "OSG5"))
if ((tag == "OSGN") || (tag == "OSG5") || (tag == "OSG1"))
m_osgnChunk = new DxbcIsgn(chunkReader, tag);
}
}