mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-20 10:54:16 +01:00
parent
1150121606
commit
a9339ae832
@ -324,10 +324,14 @@ namespace dxvk {
|
||||
: VK_IMAGE_LAYOUT_GENERAL;
|
||||
}
|
||||
|
||||
VkImageLayout DetermineDepthStencilLayout(bool hazardous) const {
|
||||
VkImageLayout layout = hazardous
|
||||
? VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
|
||||
: VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
|
||||
VkImageLayout DetermineDepthStencilLayout(bool write, bool hazardous) const {
|
||||
VkImageLayout layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
|
||||
|
||||
if (unlikely(hazardous)) {
|
||||
layout = write
|
||||
? VK_IMAGE_LAYOUT_GENERAL
|
||||
: VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL;
|
||||
}
|
||||
|
||||
if (unlikely(m_image->info().tiling != VK_IMAGE_TILING_OPTIMAL))
|
||||
layout = VK_IMAGE_LAYOUT_GENERAL;
|
||||
|
@ -1783,10 +1783,16 @@ namespace dxvk {
|
||||
m_flags.set(D3D9DeviceFlag::DirtyMultiSampleState);
|
||||
break;
|
||||
|
||||
case D3DRS_ZWRITEENABLE:
|
||||
if (m_activeHazardsDS != 0)
|
||||
m_flags.set(D3D9DeviceFlag::DirtyFramebuffer);
|
||||
|
||||
m_flags.set(D3D9DeviceFlag::DirtyDepthStencilState);
|
||||
break;
|
||||
|
||||
case D3DRS_ZENABLE:
|
||||
case D3DRS_ZFUNC:
|
||||
case D3DRS_TWOSIDEDSTENCILMODE:
|
||||
case D3DRS_ZWRITEENABLE:
|
||||
case D3DRS_STENCILENABLE:
|
||||
case D3DRS_STENCILFAIL:
|
||||
case D3DRS_STENCILZFAIL:
|
||||
@ -4962,11 +4968,12 @@ namespace dxvk {
|
||||
|
||||
if (m_state.depthStencil != nullptr) {
|
||||
const DxvkImageCreateInfo& dsImageInfo = m_state.depthStencil->GetCommonTexture()->GetImage()->info();
|
||||
const bool depthWrite = m_state.renderStates[D3DRS_ZWRITEENABLE];
|
||||
|
||||
if (likely(sampleCount == VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM || sampleCount == dsImageInfo.sampleCount)) {
|
||||
attachments.depth = {
|
||||
m_state.depthStencil->GetDepthStencilView(),
|
||||
m_state.depthStencil->GetDepthStencilLayout(m_activeHazardsDS != 0) };
|
||||
m_state.depthStencil->GetDepthStencilLayout(depthWrite, m_activeHazardsDS != 0) };
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -99,8 +99,8 @@ namespace dxvk {
|
||||
return view;
|
||||
}
|
||||
|
||||
VkImageLayout GetDepthStencilLayout(bool hazardous) const {
|
||||
return m_texture->DetermineDepthStencilLayout(hazardous);
|
||||
VkImageLayout GetDepthStencilLayout(bool write, bool hazardous) const {
|
||||
return m_texture->DetermineDepthStencilLayout(write, hazardous);
|
||||
}
|
||||
|
||||
bool IsNull() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user