mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-18 20:52:10 +01:00
[dxvk] Disable depthWriteEnable if depth attachment has read-only layout
Fixes water rendering in SpellForce 3.
This commit is contained in:
parent
6eeb3b6da9
commit
53aa27336b
@ -121,7 +121,7 @@ namespace dxvk {
|
||||
|
||||
// If no pipeline instance exists with the given state
|
||||
// vector, create a new one and add it to the list.
|
||||
newPipelineHandle = this->compilePipeline(state, renderPassHandle, m_basePipeline);
|
||||
newPipelineHandle = this->compilePipeline(state, renderPass, m_basePipeline);
|
||||
|
||||
// Add new pipeline to the set
|
||||
m_pipelines.emplace_back(state, renderPassHandle, newPipelineHandle);
|
||||
@ -152,12 +152,15 @@ namespace dxvk {
|
||||
|
||||
VkPipeline DxvkGraphicsPipeline::compilePipeline(
|
||||
const DxvkGraphicsPipelineStateInfo& state,
|
||||
VkRenderPass renderPass,
|
||||
const DxvkRenderPass& renderPass,
|
||||
VkPipeline baseHandle) const {
|
||||
if (Logger::logLevel() <= LogLevel::Debug) {
|
||||
Logger::debug("Compiling graphics pipeline...");
|
||||
this->logPipelineState(LogLevel::Debug, state);
|
||||
}
|
||||
|
||||
// Render pass format and image layouts
|
||||
DxvkRenderPassFormat passFormat = renderPass.format();
|
||||
|
||||
// Set up dynamic states as needed
|
||||
std::array<VkDynamicState, 5> dynamicStates;
|
||||
@ -349,7 +352,7 @@ namespace dxvk {
|
||||
dsInfo.pNext = nullptr;
|
||||
dsInfo.flags = 0;
|
||||
dsInfo.depthTestEnable = state.dsEnableDepthTest;
|
||||
dsInfo.depthWriteEnable = state.dsEnableDepthWrite;
|
||||
dsInfo.depthWriteEnable = state.dsEnableDepthWrite && !util::isDepthReadOnlyLayout(passFormat.depth.layout);
|
||||
dsInfo.depthCompareOp = state.dsDepthCompareOp;
|
||||
dsInfo.depthBoundsTestEnable = VK_FALSE;
|
||||
dsInfo.stencilTestEnable = state.dsEnableStencilTest;
|
||||
@ -393,7 +396,7 @@ namespace dxvk {
|
||||
info.pColorBlendState = &cbInfo;
|
||||
info.pDynamicState = &dyInfo;
|
||||
info.layout = m_layout->pipelineLayout();
|
||||
info.renderPass = renderPass;
|
||||
info.renderPass = renderPass.getDefaultHandle();
|
||||
info.subpass = 0;
|
||||
info.basePipelineHandle = baseHandle;
|
||||
info.basePipelineIndex = -1;
|
||||
|
@ -274,7 +274,7 @@ namespace dxvk {
|
||||
|
||||
VkPipeline compilePipeline(
|
||||
const DxvkGraphicsPipelineStateInfo& state,
|
||||
VkRenderPass renderPass,
|
||||
const DxvkRenderPass& renderPass,
|
||||
VkPipeline baseHandle) const;
|
||||
|
||||
void destroyPipeline(
|
||||
|
Loading…
x
Reference in New Issue
Block a user