mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-03 04:24:11 +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:
parent
eb0a492f51
commit
ae4a5232aa
@ -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);
|
||||
|
||||
@ -126,8 +127,9 @@ namespace dxvk {
|
||||
// to enable linear tiling, and DXVK needs to be aware that
|
||||
// the image can be accessed by the host.
|
||||
if (m_mapMode == D3D11_COMMON_TEXTURE_MAP_MODE_DIRECT) {
|
||||
imageInfo.stages |= VK_PIPELINE_STAGE_HOST_BIT;
|
||||
imageInfo.tiling = VK_IMAGE_TILING_LINEAR;
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user