1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 19:24:12 +01:00

[dxbc] Ignore system value components when declaring inputs

This commit is contained in:
Philip Rebohle 2024-04-16 14:48:52 +02:00
parent 571948cfc0
commit 7441137a33
2 changed files with 29 additions and 2 deletions

View File

@ -7728,6 +7728,21 @@ namespace dxvk {
return DxbcRegMask::firstN(getTexCoordDim(imageType));
}
bool DxbcCompiler::ignoreInputSystemValue(DxbcSystemValue sv) const {
switch (sv) {
case DxbcSystemValue::Position:
case DxbcSystemValue::IsFrontFace:
case DxbcSystemValue::SampleIndex:
case DxbcSystemValue::PrimitiveId:
case DxbcSystemValue::Coverage:
return m_programInfo.type() == DxbcProgramType::PixelShader;
default:
return false;
}
}
DxbcVectorType DxbcCompiler::getInputRegType(uint32_t regIdx) const {
switch (m_programInfo.type()) {
@ -7758,8 +7773,17 @@ namespace dxvk {
result.ctype = DxbcScalarType::Float32;
result.ccount = 4;
if (m_isgn->findByRegister(regIdx))
result.ccount = m_isgn->regMask(regIdx).minComponents();
if (m_isgn == nullptr || !m_isgn->findByRegister(regIdx))
return result;
DxbcRegMask mask(0u);
for (const auto& e : *m_isgn) {
if (e.registerId == regIdx && !ignoreInputSystemValue(e.systemValue))
mask |= e.componentMask;
}
result.ccount = mask.minComponents();
return result;
}
}

View File

@ -1221,6 +1221,9 @@ namespace dxvk {
uint32_t getUavCoherence(
uint32_t registerId,
DxbcUavFlags flags);
bool ignoreInputSystemValue(
DxbcSystemValue sv) const;
///////////////////////////
// Type definition methods