mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-21 22:54:16 +01:00
[d3d11] Do not use separate context to initialize back buffers
This commit is contained in:
parent
89ebabd8fd
commit
129efdaba6
@ -30,6 +30,10 @@ namespace dxvk {
|
|||||||
|
|
||||||
ctx->setBarrierControl(cBarrierControlFlags);
|
ctx->setBarrierControl(cBarrierControlFlags);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Stall here so that external submissions to the
|
||||||
|
// CS thread can actually access the command list
|
||||||
|
SynchronizeCsThread(DxvkCsThread::SynchronizeAll);
|
||||||
|
|
||||||
ClearState();
|
ClearState();
|
||||||
}
|
}
|
||||||
|
@ -101,6 +101,15 @@ namespace dxvk {
|
|||||||
DxvkCsChunkRef&& Chunk,
|
DxvkCsChunkRef&& Chunk,
|
||||||
bool Synchronize);
|
bool Synchronize);
|
||||||
|
|
||||||
|
template<typename Fn>
|
||||||
|
void InjectCsCommand(
|
||||||
|
Fn&& Command) {
|
||||||
|
auto chunk = AllocCsChunk();
|
||||||
|
chunk->push(std::move(Command));
|
||||||
|
|
||||||
|
EmitCsChunkExternal(std::move(chunk), false);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
DxvkCsThread m_csThread;
|
DxvkCsThread m_csThread;
|
||||||
|
@ -626,22 +626,13 @@ namespace dxvk {
|
|||||||
|
|
||||||
// Initialize the image so that we can use it. Clearing
|
// Initialize the image so that we can use it. Clearing
|
||||||
// to black prevents garbled output for the first frame.
|
// to black prevents garbled output for the first frame.
|
||||||
VkImageSubresourceRange subresources;
|
m_parent->GetContext()->InjectCsCommand([
|
||||||
subresources.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
cSwapImage = m_swapImage
|
||||||
subresources.baseMipLevel = 0;
|
] (DxvkContext* ctx) {
|
||||||
subresources.levelCount = 1;
|
ctx->initImage(cSwapImage,
|
||||||
subresources.baseArrayLayer = 0;
|
cSwapImage->getAvailableSubresources(),
|
||||||
subresources.layerCount = 1;
|
VK_IMAGE_LAYOUT_UNDEFINED);
|
||||||
|
});
|
||||||
m_context->beginRecording(
|
|
||||||
m_device->createCommandList());
|
|
||||||
|
|
||||||
m_context->initImage(m_swapImage,
|
|
||||||
subresources, VK_IMAGE_LAYOUT_UNDEFINED);
|
|
||||||
|
|
||||||
m_device->submitCommandList(
|
|
||||||
m_context->endRecording(),
|
|
||||||
nullptr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user