mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-15 07:29:17 +01:00
[dxbc] Properly implement Input/Output coverage masks
This commit is contained in:
parent
858107278f
commit
00f6262ff3
@ -912,6 +912,7 @@ namespace dxvk {
|
|||||||
ID3D11ClassLinkage* pClassLinkage,
|
ID3D11ClassLinkage* pClassLinkage,
|
||||||
ID3D11HullShader** ppHullShader) {
|
ID3D11HullShader** ppHullShader) {
|
||||||
D3D11ShaderModule module;
|
D3D11ShaderModule module;
|
||||||
|
*ppHullShader = nullptr;
|
||||||
|
|
||||||
if (FAILED(this->CreateShaderModule(&module,
|
if (FAILED(this->CreateShaderModule(&module,
|
||||||
pShaderBytecode, BytecodeLength, pClassLinkage)))
|
pShaderBytecode, BytecodeLength, pClassLinkage)))
|
||||||
@ -932,7 +933,7 @@ namespace dxvk {
|
|||||||
ID3D11ClassLinkage* pClassLinkage,
|
ID3D11ClassLinkage* pClassLinkage,
|
||||||
ID3D11DomainShader** ppDomainShader) {
|
ID3D11DomainShader** ppDomainShader) {
|
||||||
D3D11ShaderModule module;
|
D3D11ShaderModule module;
|
||||||
|
*ppDomainShader = nullptr;
|
||||||
if (FAILED(this->CreateShaderModule(&module,
|
if (FAILED(this->CreateShaderModule(&module,
|
||||||
pShaderBytecode, BytecodeLength, pClassLinkage)))
|
pShaderBytecode, BytecodeLength, pClassLinkage)))
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
@ -425,13 +425,22 @@ namespace dxvk {
|
|||||||
"vThreadIndexInGroup");
|
"vThreadIndexInGroup");
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
case DxbcOperandType::InputCoverageMask: {
|
||||||
|
m_module.enableCapability(spv::CapabilitySampleRateShading);
|
||||||
|
m_ps.builtinSampleMaskIn = emitNewBuiltinVariable({
|
||||||
|
{ DxbcScalarType::Uint32, 1, 1 },
|
||||||
|
spv::StorageClassInput },
|
||||||
|
spv::BuiltInSampleMask,
|
||||||
|
"vCoverage");
|
||||||
|
} break;
|
||||||
|
|
||||||
case DxbcOperandType::OutputCoverageMask: {
|
case DxbcOperandType::OutputCoverageMask: {
|
||||||
m_module.enableCapability(spv::CapabilitySampleRateShading);
|
m_module.enableCapability(spv::CapabilitySampleRateShading);
|
||||||
m_ps.builtinSampleMaskOut = emitNewBuiltinVariable({
|
m_ps.builtinSampleMaskOut = emitNewBuiltinVariable({
|
||||||
{ DxbcScalarType::Uint32, 1, 0 },
|
{ DxbcScalarType::Uint32, 1, 1 },
|
||||||
spv::StorageClassOutput },
|
spv::StorageClassOutput },
|
||||||
spv::BuiltInSampleMask,
|
spv::BuiltInSampleMask,
|
||||||
"oCoverage");
|
"oMask");
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case DxbcOperandType::OutputDepth: {
|
case DxbcOperandType::OutputDepth: {
|
||||||
@ -3723,9 +3732,8 @@ namespace dxvk {
|
|||||||
|
|
||||||
const uint32_t ptrTypeId = getPointerTypeId(info);
|
const uint32_t ptrTypeId = getPointerTypeId(info);
|
||||||
|
|
||||||
const std::array<uint32_t, 2> indices = {
|
const std::array<uint32_t, 2> indices =
|
||||||
m_module.consti32(0), constId.id
|
{{ m_module.consti32(0), constId.id }};
|
||||||
};
|
|
||||||
|
|
||||||
DxbcRegisterPointer result;
|
DxbcRegisterPointer result;
|
||||||
result.type.ctype = info.type.ctype;
|
result.type.ctype = info.type.ctype;
|
||||||
@ -3802,10 +3810,37 @@ namespace dxvk {
|
|||||||
{ DxbcScalarType::Uint32, 1 },
|
{ DxbcScalarType::Uint32, 1 },
|
||||||
m_cs.builtinLocalInvocationIndex };
|
m_cs.builtinLocalInvocationIndex };
|
||||||
|
|
||||||
case DxbcOperandType::OutputCoverageMask:
|
case DxbcOperandType::InputCoverageMask: {
|
||||||
return DxbcRegisterPointer {
|
const std::array<uint32_t, 1> indices
|
||||||
{ DxbcScalarType::Uint32, 1 },
|
= {{ m_module.constu32(0) }};
|
||||||
m_ps.builtinSampleMaskOut };
|
|
||||||
|
DxbcRegisterPointer result;
|
||||||
|
result.type.ctype = DxbcScalarType::Uint32;
|
||||||
|
result.type.ccount = 1;
|
||||||
|
result.id = m_module.opAccessChain(
|
||||||
|
m_module.defPointerType(
|
||||||
|
getVectorTypeId(result.type),
|
||||||
|
spv::StorageClassInput),
|
||||||
|
m_ps.builtinSampleMaskIn,
|
||||||
|
indices.size(), indices.data());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
case DxbcOperandType::OutputCoverageMask: {
|
||||||
|
const std::array<uint32_t, 1> indices
|
||||||
|
= {{ m_module.constu32(0) }};
|
||||||
|
|
||||||
|
DxbcRegisterPointer result;
|
||||||
|
result.type.ctype = DxbcScalarType::Uint32;
|
||||||
|
result.type.ccount = 1;
|
||||||
|
result.id = m_module.opAccessChain(
|
||||||
|
m_module.defPointerType(
|
||||||
|
getVectorTypeId(result.type),
|
||||||
|
spv::StorageClassOutput),
|
||||||
|
m_ps.builtinSampleMaskOut,
|
||||||
|
indices.size(), indices.data());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
case DxbcOperandType::OutputDepth:
|
case DxbcOperandType::OutputDepth:
|
||||||
case DxbcOperandType::OutputDepthGe:
|
case DxbcOperandType::OutputDepthGe:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user