diff --git a/src/d3d11/d3d11_util.cpp b/src/d3d11/d3d11_util.cpp index 24b4e63a..8a5f0200 100644 --- a/src/d3d11/d3d11_util.cpp +++ b/src/d3d11/d3d11_util.cpp @@ -129,4 +129,32 @@ namespace dxvk { } } + + VkBufferUsageFlags GetBufferUsageFlags(UINT BindFlags) { + VkBufferUsageFlags usage = 0; + + if (BindFlags & D3D11_BIND_SHADER_RESOURCE) + usage |= VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT; + if (BindFlags & D3D11_BIND_UNORDERED_ACCESS) + usage |= VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT; + + return 0; + } + + + VkImageUsageFlags GetImageUsageFlags(UINT BindFlags) { + VkImageUsageFlags usage = 0; + + if (BindFlags & D3D11_BIND_DEPTH_STENCIL) + usage |= VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT; + if (BindFlags & D3D11_BIND_RENDER_TARGET) + usage |= VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; + if (BindFlags & D3D11_BIND_SHADER_RESOURCE) + usage |= VK_IMAGE_USAGE_SAMPLED_BIT; + if (BindFlags & D3D11_BIND_UNORDERED_ACCESS) + usage |= VK_IMAGE_USAGE_STORAGE_BIT; + + return usage; + } + } \ No newline at end of file diff --git a/src/d3d11/d3d11_util.h b/src/d3d11/d3d11_util.h index b562d368..d2fb375a 100644 --- a/src/d3d11/d3d11_util.h +++ b/src/d3d11/d3d11_util.h @@ -40,4 +40,10 @@ namespace dxvk { VkShaderStageFlagBits GetShaderStage( DxbcProgramType ProgramType); + VkBufferUsageFlags GetBufferUsageFlags( + UINT BindFlags); + + VkImageUsageFlags GetImageUsageFlags( + UINT BindFlags); + } \ No newline at end of file