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

[d3d9] Mark images as shared if necessary

This commit is contained in:
Philip Rebohle 2021-02-14 03:42:40 +01:00 committed by Philip Rebohle
parent 6564895a32
commit 4f184b3424
4 changed files with 11 additions and 0 deletions

View File

@ -220,6 +220,7 @@ namespace dxvk {
| VK_ACCESS_SHADER_READ_BIT;
imageInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
imageInfo.layout = VK_IMAGE_LAYOUT_GENERAL;
imageInfo.shared = m_desc.IsBackBuffer;
if (m_mapping.ConversionFormatInfo.FormatType != D3D9ConversionFormat_None) {
imageInfo.usage |= VK_IMAGE_USAGE_STORAGE_BIT;

View File

@ -42,6 +42,7 @@ namespace dxvk {
BOOL Discard;
D3DMULTISAMPLE_TYPE MultiSample;
DWORD MultisampleQuality;
BOOL IsBackBuffer;
};
struct D3D9ColorView {

View File

@ -393,6 +393,7 @@ namespace dxvk {
desc.Discard = FALSE;
desc.MultiSample = D3DMULTISAMPLE_NONE;
desc.MultisampleQuality = 0;
desc.IsBackBuffer = FALSE;
if (FAILED(D3D9CommonTexture::NormalizeTextureProperties(this, &desc)))
return D3DERR_INVALIDCALL;
@ -447,6 +448,7 @@ namespace dxvk {
desc.Discard = FALSE;
desc.MultiSample = D3DMULTISAMPLE_NONE;
desc.MultisampleQuality = 0;
desc.IsBackBuffer = FALSE;
if (FAILED(D3D9CommonTexture::NormalizeTextureProperties(this, &desc)))
return D3DERR_INVALIDCALL;
@ -491,6 +493,7 @@ namespace dxvk {
desc.Discard = FALSE;
desc.MultiSample = D3DMULTISAMPLE_NONE;
desc.MultisampleQuality = 0;
desc.IsBackBuffer = FALSE;
if (FAILED(D3D9CommonTexture::NormalizeTextureProperties(this, &desc)))
return D3DERR_INVALIDCALL;
@ -3334,6 +3337,7 @@ namespace dxvk {
desc.Discard = FALSE;
desc.MultiSample = MultiSample;
desc.MultisampleQuality = MultisampleQuality;
desc.IsBackBuffer = FALSE;
if (FAILED(D3D9CommonTexture::NormalizeTextureProperties(this, &desc)))
return D3DERR_INVALIDCALL;
@ -3377,6 +3381,7 @@ namespace dxvk {
desc.Discard = FALSE;
desc.MultiSample = D3DMULTISAMPLE_NONE;
desc.MultisampleQuality = 0;
desc.IsBackBuffer = FALSE;
if (FAILED(D3D9CommonTexture::NormalizeTextureProperties(this, &desc)))
return D3DERR_INVALIDCALL;
@ -3422,6 +3427,7 @@ namespace dxvk {
desc.Discard = Discard;
desc.MultiSample = MultiSample;
desc.MultisampleQuality = MultisampleQuality;
desc.IsBackBuffer = FALSE;
if (FAILED(D3D9CommonTexture::NormalizeTextureProperties(this, &desc)))
return D3DERR_INVALIDCALL;
@ -6898,6 +6904,7 @@ namespace dxvk {
desc.Discard = FALSE;
desc.MultiSample = pPresentationParameters->MultiSampleType;
desc.MultisampleQuality = pPresentationParameters->MultiSampleQuality;
desc.IsBackBuffer = FALSE;
if (FAILED(D3D9CommonTexture::NormalizeTextureProperties(this, &desc)))
return D3DERR_NOTAVAILABLE;

View File

@ -1012,6 +1012,7 @@ namespace dxvk {
imageInfo.access = 0;
imageInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
imageInfo.layout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
imageInfo.shared = VK_TRUE;
DxvkImageViewCreateInfo viewInfo;
viewInfo.type = VK_IMAGE_VIEW_TYPE_2D;
@ -1067,6 +1068,7 @@ namespace dxvk {
desc.Pool = D3DPOOL_DEFAULT;
desc.Usage = D3DUSAGE_RENDERTARGET;
desc.Discard = FALSE;
desc.IsBackBuffer = TRUE;
for (uint32_t i = 0; i < m_backBuffers.size(); i++)
m_backBuffers[i] = new D3D9Surface(m_parent, &desc, this);