mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-04 16:24:29 +01:00
[d3d11] Add GetImageUsageFlags and GetBufferUsageFlags helpers
This commit is contained in:
parent
1a4b17d607
commit
cdc85a1238
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -40,4 +40,10 @@ namespace dxvk {
|
|||||||
VkShaderStageFlagBits GetShaderStage(
|
VkShaderStageFlagBits GetShaderStage(
|
||||||
DxbcProgramType ProgramType);
|
DxbcProgramType ProgramType);
|
||||||
|
|
||||||
|
VkBufferUsageFlags GetBufferUsageFlags(
|
||||||
|
UINT BindFlags);
|
||||||
|
|
||||||
|
VkImageUsageFlags GetImageUsageFlags(
|
||||||
|
UINT BindFlags);
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user