mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
parent
1150121606
commit
a9339ae832
@ -324,10 +324,14 @@ namespace dxvk {
|
|||||||
: VK_IMAGE_LAYOUT_GENERAL;
|
: VK_IMAGE_LAYOUT_GENERAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
VkImageLayout DetermineDepthStencilLayout(bool hazardous) const {
|
VkImageLayout DetermineDepthStencilLayout(bool write, bool hazardous) const {
|
||||||
VkImageLayout layout = hazardous
|
VkImageLayout layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
|
||||||
? VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
|
|
||||||
: 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))
|
if (unlikely(m_image->info().tiling != VK_IMAGE_TILING_OPTIMAL))
|
||||||
layout = VK_IMAGE_LAYOUT_GENERAL;
|
layout = VK_IMAGE_LAYOUT_GENERAL;
|
||||||
|
@ -1783,10 +1783,16 @@ namespace dxvk {
|
|||||||
m_flags.set(D3D9DeviceFlag::DirtyMultiSampleState);
|
m_flags.set(D3D9DeviceFlag::DirtyMultiSampleState);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case D3DRS_ZWRITEENABLE:
|
||||||
|
if (m_activeHazardsDS != 0)
|
||||||
|
m_flags.set(D3D9DeviceFlag::DirtyFramebuffer);
|
||||||
|
|
||||||
|
m_flags.set(D3D9DeviceFlag::DirtyDepthStencilState);
|
||||||
|
break;
|
||||||
|
|
||||||
case D3DRS_ZENABLE:
|
case D3DRS_ZENABLE:
|
||||||
case D3DRS_ZFUNC:
|
case D3DRS_ZFUNC:
|
||||||
case D3DRS_TWOSIDEDSTENCILMODE:
|
case D3DRS_TWOSIDEDSTENCILMODE:
|
||||||
case D3DRS_ZWRITEENABLE:
|
|
||||||
case D3DRS_STENCILENABLE:
|
case D3DRS_STENCILENABLE:
|
||||||
case D3DRS_STENCILFAIL:
|
case D3DRS_STENCILFAIL:
|
||||||
case D3DRS_STENCILZFAIL:
|
case D3DRS_STENCILZFAIL:
|
||||||
@ -4962,11 +4968,12 @@ namespace dxvk {
|
|||||||
|
|
||||||
if (m_state.depthStencil != nullptr) {
|
if (m_state.depthStencil != nullptr) {
|
||||||
const DxvkImageCreateInfo& dsImageInfo = m_state.depthStencil->GetCommonTexture()->GetImage()->info();
|
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)) {
|
if (likely(sampleCount == VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM || sampleCount == dsImageInfo.sampleCount)) {
|
||||||
attachments.depth = {
|
attachments.depth = {
|
||||||
m_state.depthStencil->GetDepthStencilView(),
|
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;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
VkImageLayout GetDepthStencilLayout(bool hazardous) const {
|
VkImageLayout GetDepthStencilLayout(bool write, bool hazardous) const {
|
||||||
return m_texture->DetermineDepthStencilLayout(hazardous);
|
return m_texture->DetermineDepthStencilLayout(write, hazardous);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsNull() {
|
bool IsNull() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user