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

[d3d11] Use VK_IMAGE_LAYOUT_PREINITIALIZED for mapped images

This way we can directly write image data directly to the image
without having to do it on the GPU.
This commit is contained in:
Philip Rebohle 2019-09-19 18:22:04 +02:00
parent eb0a492f51
commit ae4a5232aa
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -29,6 +29,7 @@ namespace dxvk {
| VK_ACCESS_TRANSFER_WRITE_BIT;
imageInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
imageInfo.layout = VK_IMAGE_LAYOUT_GENERAL;
imageInfo.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
DecodeSampleCount(m_desc.SampleDesc.Count, &imageInfo.sampleCount);
@ -128,6 +129,7 @@ namespace dxvk {
if (m_mapMode == D3D11_COMMON_TEXTURE_MAP_MODE_DIRECT) {
imageInfo.stages |= VK_PIPELINE_STAGE_HOST_BIT;
imageInfo.tiling = VK_IMAGE_TILING_LINEAR;
imageInfo.initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED;
if (m_desc.CPUAccessFlags & D3D11_CPU_ACCESS_WRITE)
imageInfo.access |= VK_ACCESS_HOST_WRITE_BIT;