mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-12 22:56:09 +00:00
d3d12: add implicit transition for subpass attachments
This commit is contained in:
committed by
Kai Ninomiya
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
|
||||
|
||||
Reference in New Issue
Block a user