[dxbc] Implemnted SV_ViewportArrayIndex for geometry shaders

Required by Final Fantasy XIV.
This commit is contained in:
Philip Rebohle 2018-03-26 23:32:07 +02:00
parent fc47fb8f6c
commit 60d6416e5f
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 20 additions and 0 deletions

View File

@ -5175,6 +5175,25 @@ namespace dxvk {
DxbcRegMask(true, false, false, false));
} break;
case DxbcSystemValue::ViewportId: {
if (m_gs.builtinViewportId == 0) {
m_gs.builtinViewportId = emitNewBuiltinVariable({
{ DxbcScalarType::Uint32, 1, 0 },
spv::StorageClassOutput },
spv::BuiltInViewportIndex,
"gs_viewport_id");
}
DxbcRegisterPointer ptr;
ptr.type.ctype = DxbcScalarType::Uint32;
ptr.type.ccount = 1;
ptr.id = m_gs.builtinViewportId;
emitValueStore(
ptr, emitRegisterExtract(value, mask),
DxbcRegMask(true, false, false, false));
} break;
default:
Logger::warn(str::format(
"DxbcCompiler: Unhandled GS SV output: ", sv));

View File

@ -119,6 +119,7 @@ namespace dxvk {
uint32_t functionId = 0;
uint32_t builtinLayer = 0;
uint32_t builtinViewportId = 0;
};