mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-18 11:52:12 +01:00
[dxbc] Implement SV_ViewportID as pixel shader input
This commit is contained in:
parent
0e6e985210
commit
6cc303c5ef
@ -5283,7 +5283,7 @@ namespace dxvk {
|
||||
{ DxbcScalarType::Uint32, 1, 0 },
|
||||
spv::StorageClassInput },
|
||||
spv::BuiltInLayer,
|
||||
"ps_layer");
|
||||
"v_layer");
|
||||
}
|
||||
|
||||
DxbcRegisterPointer ptr;
|
||||
@ -5294,6 +5294,25 @@ namespace dxvk {
|
||||
return emitValueLoad(ptr);
|
||||
} break;
|
||||
|
||||
case DxbcSystemValue::ViewportId: {
|
||||
if (m_ps.builtinViewportId == 0) {
|
||||
m_module.enableCapability(spv::CapabilityMultiViewport);
|
||||
|
||||
m_ps.builtinViewportId = emitNewBuiltinVariable({
|
||||
{ DxbcScalarType::Uint32, 1, 0 },
|
||||
spv::StorageClassInput },
|
||||
spv::BuiltInViewportIndex,
|
||||
"v_viewport");
|
||||
}
|
||||
|
||||
DxbcRegisterPointer ptr;
|
||||
ptr.type.ctype = DxbcScalarType::Uint32;
|
||||
ptr.type.ccount = 1;
|
||||
ptr.id = m_ps.builtinViewportId;
|
||||
|
||||
return emitValueLoad(ptr);
|
||||
} break;
|
||||
|
||||
default:
|
||||
throw DxvkError(str::format(
|
||||
"DxbcCompiler: Unhandled PS SV input: ", sv));
|
||||
@ -5338,6 +5357,8 @@ namespace dxvk {
|
||||
enableShaderViewportIndexLayer();
|
||||
|
||||
if (m_gs.builtinLayer == 0) {
|
||||
m_module.enableCapability(spv::CapabilityGeometry);
|
||||
|
||||
m_gs.builtinLayer = emitNewBuiltinVariable({
|
||||
{ DxbcScalarType::Uint32, 1, 0 },
|
||||
spv::StorageClassOutput },
|
||||
|
@ -165,6 +165,7 @@ namespace dxvk {
|
||||
uint32_t builtinSampleMaskIn = 0;
|
||||
uint32_t builtinSampleMaskOut = 0;
|
||||
uint32_t builtinLayer = 0;
|
||||
uint32_t builtinViewportId = 0;
|
||||
|
||||
uint32_t killState = 0;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user