Skip to content

Commit

Permalink
[d3d11] Fix usage and access flags for multisampled images
Browse files Browse the repository at this point in the history
Meta-resolve operations will use the image in a fragment shader.
  • Loading branch information
doitsujin committed Jun 28, 2018
1 parent db2b6e1 commit 4520b1c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/d3d11/d3d11_texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace dxvk {
| VK_ACCESS_TRANSFER_WRITE_BIT;
imageInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
imageInfo.layout = VK_IMAGE_LAYOUT_GENERAL;

DecodeSampleCount(m_desc.SampleDesc.Count, &imageInfo.sampleCount);

// Typeless formats need the MUTABLE_FORMAT_BIT to be set
Expand Down Expand Up @@ -72,6 +72,13 @@ namespace dxvk {
| VK_ACCESS_SHADER_WRITE_BIT;
}

// Access pattern for meta-resolve operations
if (imageInfo.sampleCount != VK_SAMPLE_COUNT_1_BIT) {
imageInfo.usage |= VK_IMAGE_USAGE_SAMPLED_BIT;
imageInfo.stages |= VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT;
imageInfo.access |= VK_ACCESS_SHADER_READ_BIT;
}

if (m_desc.MiscFlags & D3D11_RESOURCE_MISC_TEXTURECUBE)
imageInfo.flags |= VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT;

Expand Down

0 comments on commit 4520b1c

Please sign in to comment.