1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-13 07:08:50 +01:00

[dxvk] Add more dynamic state to DxvkCommandList

This commit is contained in:
Philip Rebohle 2022-07-06 03:46:32 +02:00
parent a683ecd525
commit e01ffc02a8
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -699,12 +699,39 @@ namespace dxvk {
}
void cmdSetDepthBoundsState(
VkBool32 depthBoundsTestEnable) {
m_vkd->vkCmdSetDepthBoundsTestEnableEXT(m_execBuffer, depthBoundsTestEnable);
}
void cmdSetDepthState(
VkBool32 depthTestEnable,
VkBool32 depthWriteEnable,
VkCompareOp depthCompareOp) {
m_vkd->vkCmdSetDepthTestEnableEXT(m_execBuffer, depthTestEnable);
if (depthTestEnable) {
m_vkd->vkCmdSetDepthWriteEnableEXT(m_execBuffer, depthWriteEnable);
m_vkd->vkCmdSetDepthCompareOpEXT(m_execBuffer, depthCompareOp);
}
}
void cmdSetEvent(
VkEvent event,
VkPipelineStageFlags stages) {
m_vkd->vkCmdSetEvent(m_execBuffer, event, stages);
}
void cmdSetRasterizerState(
VkCullModeFlags cullMode,
VkFrontFace frontFace) {
m_vkd->vkCmdSetCullModeEXT(m_execBuffer, cullMode);
m_vkd->vkCmdSetFrontFaceEXT(m_execBuffer, frontFace);
}
void cmdSetScissor(
uint32_t scissorCount,
@ -714,6 +741,33 @@ namespace dxvk {
}
void cmdSetStencilState(
VkBool32 enableStencilTest,
const VkStencilOpState& front,
const VkStencilOpState& back) {
m_vkd->vkCmdSetStencilTestEnableEXT(
m_execBuffer, enableStencilTest);
if (enableStencilTest) {
m_vkd->vkCmdSetStencilOpEXT(m_execBuffer,
VK_STENCIL_FACE_FRONT_BIT, front.failOp,
front.passOp, front.depthFailOp, front.compareOp);
m_vkd->vkCmdSetStencilCompareMask(m_execBuffer,
VK_STENCIL_FACE_FRONT_BIT, front.compareMask);
m_vkd->vkCmdSetStencilWriteMask(m_execBuffer,
VK_STENCIL_FACE_FRONT_BIT, front.writeMask);
m_vkd->vkCmdSetStencilOpEXT(m_execBuffer,
VK_STENCIL_FACE_BACK_BIT, back.failOp,
back.passOp, back.depthFailOp, back.compareOp);
m_vkd->vkCmdSetStencilCompareMask(m_execBuffer,
VK_STENCIL_FACE_BACK_BIT, back.compareMask);
m_vkd->vkCmdSetStencilWriteMask(m_execBuffer,
VK_STENCIL_FACE_BACK_BIT, back.writeMask);
}
}
void cmdSetStencilReference(
VkStencilFaceFlags faceMask,
uint32_t reference) {