1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 20:52:10 +01:00

[d3d11] Implement MultiDrawIndirectCount extension

This commit is contained in:
Philip Rebohle 2019-04-24 22:06:23 +02:00
parent 492b7db07b
commit 3867270812
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 27 additions and 2 deletions

View File

@ -69,7 +69,17 @@ namespace dxvk {
ID3D11Buffer* pBufferForArgs,
UINT ByteOffsetForArgs,
UINT ByteStrideForArgs) {
D3D10DeviceLock lock = m_ctx->LockContext();
m_ctx->SetDrawBuffers(pBufferForArgs, pBufferForCount);
m_ctx->EmitCs([
cMaxCount = MaxDrawCount,
cArgOffset = ByteOffsetForArgs,
cCntOffset = ByteOffsetForCount,
cStride = ByteStrideForArgs
] (DxvkContext* ctx) {
ctx->drawIndirectCount(cArgOffset, cCntOffset, cMaxCount, cStride);
});
}
@ -80,7 +90,17 @@ namespace dxvk {
ID3D11Buffer* pBufferForArgs,
UINT ByteOffsetForArgs,
UINT ByteStrideForArgs) {
D3D10DeviceLock lock = m_ctx->LockContext();
m_ctx->SetDrawBuffers(pBufferForArgs, pBufferForCount);
m_ctx->EmitCs([
cMaxCount = MaxDrawCount,
cArgOffset = ByteOffsetForArgs,
cCntOffset = ByteOffsetForCount,
cStride = ByteStrideForArgs
] (DxvkContext* ctx) {
ctx->drawIndexedIndirectCount(cArgOffset, cCntOffset, cMaxCount, cStride);
});
}

View File

@ -1773,6 +1773,7 @@ namespace dxvk {
BOOL STDMETHODCALLTYPE D3D11DeviceExt::GetExtensionSupport(
D3D11_VK_EXTENSION Extension) {
const auto& deviceFeatures = m_device->GetDXVKDevice()->features();
const auto& deviceExtensions = m_device->GetDXVKDevice()->extensions();
switch (Extension) {
case D3D11_VK_EXT_BARRIER_CONTROL:
@ -1781,6 +1782,10 @@ namespace dxvk {
case D3D11_VK_EXT_MULTI_DRAW_INDIRECT:
return deviceFeatures.core.features.multiDrawIndirect;
case D3D11_VK_EXT_MULTI_DRAW_INDIRECT_COUNT:
return deviceFeatures.core.features.multiDrawIndirect
&& deviceExtensions.khrDrawIndirectCount;
default:
return false;
}