mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-12 04:08:52 +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;
|
| VK_ACCESS_TRANSFER_WRITE_BIT;
|
||||||
imageInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
|
imageInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
|
||||||
imageInfo.layout = VK_IMAGE_LAYOUT_GENERAL;
|
imageInfo.layout = VK_IMAGE_LAYOUT_GENERAL;
|
||||||
|
imageInfo.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
||||||
|
|
||||||
DecodeSampleCount(m_desc.SampleDesc.Count, &imageInfo.sampleCount);
|
DecodeSampleCount(m_desc.SampleDesc.Count, &imageInfo.sampleCount);
|
||||||
|
|
||||||
@ -128,6 +129,7 @@ namespace dxvk {
|
|||||||
if (m_mapMode == D3D11_COMMON_TEXTURE_MAP_MODE_DIRECT) {
|
if (m_mapMode == D3D11_COMMON_TEXTURE_MAP_MODE_DIRECT) {
|
||||||
imageInfo.stages |= VK_PIPELINE_STAGE_HOST_BIT;
|
imageInfo.stages |= VK_PIPELINE_STAGE_HOST_BIT;
|
||||||
imageInfo.tiling = VK_IMAGE_TILING_LINEAR;
|
imageInfo.tiling = VK_IMAGE_TILING_LINEAR;
|
||||||
|
imageInfo.initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED;
|
||||||
|
|
||||||
if (m_desc.CPUAccessFlags & D3D11_CPU_ACCESS_WRITE)
|
if (m_desc.CPUAccessFlags & D3D11_CPU_ACCESS_WRITE)
|
||||||
imageInfo.access |= VK_ACCESS_HOST_WRITE_BIT;
|
imageInfo.access |= VK_ACCESS_HOST_WRITE_BIT;
|
||||||
|
Loading…
Reference in New Issue
Block a user