d3d12: add implicit transition for subpass attachments
This commit is contained in:
parent
ee7b6b1b62
commit
720a5d9366
|
@ -277,6 +277,16 @@ namespace d3d12 {
|
|||
uint32_t attachmentSlot = subpass.colorAttachments[location];
|
||||
const auto& attachmentInfo = currentRenderPass->GetAttachmentInfo(attachmentSlot);
|
||||
|
||||
Texture* texture = ToBackend(currentFramebuffer->GetTextureView(attachmentSlot)->GetTexture());
|
||||
constexpr auto usage = nxt::TextureUsageBit::OutputAttachment;
|
||||
if (!texture->IsFrozen()) {
|
||||
D3D12_RESOURCE_BARRIER barrier;
|
||||
if (texture->GetResourceTransitionBarrier(texture->GetUsage(), usage, &barrier)) {
|
||||
commandList->ResourceBarrier(1, &barrier);
|
||||
}
|
||||
texture->UpdateUsageInternal(usage);
|
||||
}
|
||||
|
||||
// Only perform load op on first use
|
||||
if (attachmentInfo.firstSubpass == currentSubpass) {
|
||||
// Load op - color
|
||||
|
|
|
@ -142,7 +142,7 @@ void NXTTest::SetUp() {
|
|||
swapchain = device.CreateSwapChainBuilder()
|
||||
.SetImplementation(binding->GetSwapChainImplementation())
|
||||
.GetResult();
|
||||
swapchain.Configure(nxt::TextureFormat::R8G8B8A8Unorm, 400, 400);
|
||||
swapchain.Configure(nxt::TextureFormat::R8G8B8A8Unorm, nxt::TextureUsageBit::OutputAttachment, nxt::TextureUsageBit::OutputAttachment, 400, 400);
|
||||
|
||||
device.SetErrorCallback(DeviceErrorCauseTestFailure, 0);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue