1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-03 04:24:11 +01:00

[d3d11] Optimize viewport updates if there is only one single viewport

This commit is contained in:
Philip Rebohle 2019-09-13 14:38:51 +02:00
parent 160b684d5a
commit c852b6de34
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -3219,16 +3219,27 @@ namespace dxvk {
}
}
EmitCs([
cViewportCount = viewportCount,
cViewports = viewports,
cScissors = scissors
] (DxvkContext* ctx) {
ctx->setViewports(
cViewportCount,
cViewports.data(),
cScissors.data());
});
if (likely(viewportCount == 1)) {
EmitCs([
cViewport = viewports[0],
cScissor = scissors[0]
] (DxvkContext* ctx) {
ctx->setViewports(1,
&cViewport,
&cScissor);
});
} else {
EmitCs([
cViewportCount = viewportCount,
cViewports = viewports,
cScissors = scissors
] (DxvkContext* ctx) {
ctx->setViewports(
cViewportCount,
cViewports.data(),
cScissors.data());
});
}
}