mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-15 07:29:17 +01:00
[d3d11] Fix D3D11 bind flags and DXGI usage for swap chain images
This commit is contained in:
parent
c98c5f5d17
commit
2787ba8450
@ -523,12 +523,17 @@ namespace dxvk {
|
|||||||
desc.Format = m_desc.Format;
|
desc.Format = m_desc.Format;
|
||||||
desc.SampleDesc = m_desc.SampleDesc;
|
desc.SampleDesc = m_desc.SampleDesc;
|
||||||
desc.Usage = D3D11_USAGE_DEFAULT;
|
desc.Usage = D3D11_USAGE_DEFAULT;
|
||||||
desc.BindFlags = D3D11_BIND_RENDER_TARGET
|
desc.BindFlags = 0;
|
||||||
| D3D11_BIND_SHADER_RESOURCE;
|
|
||||||
desc.CPUAccessFlags = 0;
|
desc.CPUAccessFlags = 0;
|
||||||
desc.MiscFlags = 0;
|
desc.MiscFlags = 0;
|
||||||
desc.TextureLayout = D3D11_TEXTURE_LAYOUT_UNDEFINED;
|
desc.TextureLayout = D3D11_TEXTURE_LAYOUT_UNDEFINED;
|
||||||
|
|
||||||
|
if (m_desc.BufferUsage & DXGI_USAGE_RENDER_TARGET_OUTPUT)
|
||||||
|
desc.BindFlags |= D3D11_BIND_RENDER_TARGET;
|
||||||
|
|
||||||
|
if (m_desc.BufferUsage & DXGI_USAGE_SHADER_INPUT)
|
||||||
|
desc.BindFlags |= D3D11_BIND_SHADER_RESOURCE;
|
||||||
|
|
||||||
if (m_desc.BufferUsage & DXGI_USAGE_UNORDERED_ACCESS)
|
if (m_desc.BufferUsage & DXGI_USAGE_UNORDERED_ACCESS)
|
||||||
desc.BindFlags |= D3D11_BIND_UNORDERED_ACCESS;
|
desc.BindFlags |= D3D11_BIND_UNORDERED_ACCESS;
|
||||||
|
|
||||||
|
@ -118,6 +118,13 @@ namespace dxvk {
|
|||||||
(m_desc.BindFlags & D3D11_BIND_RENDER_TARGET))
|
(m_desc.BindFlags & D3D11_BIND_RENDER_TARGET))
|
||||||
imageInfo.flags |= VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT;
|
imageInfo.flags |= VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT;
|
||||||
|
|
||||||
|
// Swap chain back buffers need to be shader readable
|
||||||
|
if (DxgiUsage & DXGI_USAGE_BACK_BUFFER) {
|
||||||
|
imageInfo.usage |= VK_IMAGE_USAGE_SAMPLED_BIT;
|
||||||
|
imageInfo.stages |= VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT;
|
||||||
|
imageInfo.access |= VK_ACCESS_SHADER_READ_BIT;
|
||||||
|
}
|
||||||
|
|
||||||
// Some image formats (i.e. the R32G32B32 ones) are
|
// Some image formats (i.e. the R32G32B32 ones) are
|
||||||
// only supported with linear tiling on most GPUs
|
// only supported with linear tiling on most GPUs
|
||||||
if (!CheckImageSupport(&imageInfo, VK_IMAGE_TILING_OPTIMAL))
|
if (!CheckImageSupport(&imageInfo, VK_IMAGE_TILING_OPTIMAL))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user