[dxbc] Added support for SV_SampleIndex

This commit is contained in:
Philip Rebohle 2018-01-28 15:32:35 +01:00
parent 0c62ca027f
commit 8a3dcf7c99
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 17 additions and 0 deletions

View File

@ -4337,6 +4337,16 @@ namespace dxvk {
return result;
} break;
case DxbcSystemValue::SampleIndex: {
DxbcRegisterPointer ptrIn;
ptrIn.type.ctype = DxbcScalarType::Uint32;
ptrIn.type.ccount = 1;
ptrIn.id = m_ps.builtinSampleId;
return emitRegisterExtract(
emitValueLoad(ptrIn), mask);
} break;
default:
throw DxvkError(str::format(
"DxbcCompiler: Unhandled PS SV input: ", sv));
@ -4445,6 +4455,12 @@ namespace dxvk {
spv::StorageClassInput },
spv::BuiltInFrontFacing,
"ps_is_front_face");
m_ps.builtinSampleId = emitNewBuiltinVariable({
{ DxbcScalarType::Uint32, 1, 0 },
spv::StorageClassInput },
spv::BuiltInSampleId,
"ps_sample_id");
}

View File

@ -128,6 +128,7 @@ namespace dxvk {
uint32_t builtinFragCoord = 0;
uint32_t builtinDepth = 0;
uint32_t builtinIsFrontFace = 0;
uint32_t builtinSampleId = 0;
std::array<DxbcVectorType, DxbcMaxInterfaceRegs> oTypes;
};