mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-23 19:54:16 +01:00
[d3d11] Add queue parameter to CS chunk injection
This commit is contained in:
parent
b686d95e71
commit
75617db76e
@ -214,7 +214,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
void D3D11Buffer::SetDebugName(const char* pName) {
|
void D3D11Buffer::SetDebugName(const char* pName) {
|
||||||
if (m_buffer) {
|
if (m_buffer) {
|
||||||
m_parent->GetContext()->InjectCs([
|
m_parent->GetContext()->InjectCs(DxvkCsQueue::HighPriority, [
|
||||||
cBuffer = m_buffer,
|
cBuffer = m_buffer,
|
||||||
cName = std::string(pName ? pName : "")
|
cName = std::string(pName ? pName : "")
|
||||||
] (DxvkContext* ctx) {
|
] (DxvkContext* ctx) {
|
||||||
|
@ -920,11 +920,12 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
void D3D11ImmediateContext::InjectCsChunk(
|
void D3D11ImmediateContext::InjectCsChunk(
|
||||||
|
DxvkCsQueue Queue,
|
||||||
DxvkCsChunkRef&& Chunk,
|
DxvkCsChunkRef&& Chunk,
|
||||||
bool Synchronize) {
|
bool Synchronize) {
|
||||||
// Do not update the sequence number when emitting a chunk
|
// Do not update the sequence number when emitting a chunk
|
||||||
// from an external source since that would break tracking
|
// from an external source since that would break tracking
|
||||||
m_csThread.injectChunk(DxvkCsQueue::HighPriority, std::move(Chunk), Synchronize);
|
m_csThread.injectChunk(Queue, std::move(Chunk), Synchronize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -98,16 +98,18 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void InjectCsChunk(
|
void InjectCsChunk(
|
||||||
|
DxvkCsQueue Queue,
|
||||||
DxvkCsChunkRef&& Chunk,
|
DxvkCsChunkRef&& Chunk,
|
||||||
bool Synchronize);
|
bool Synchronize);
|
||||||
|
|
||||||
template<typename Fn>
|
template<typename Fn>
|
||||||
void InjectCs(
|
void InjectCs(
|
||||||
|
DxvkCsQueue Queue,
|
||||||
Fn&& Command) {
|
Fn&& Command) {
|
||||||
auto chunk = AllocCsChunk();
|
auto chunk = AllocCsChunk();
|
||||||
chunk->push(std::move(Command));
|
chunk->push(std::move(Command));
|
||||||
|
|
||||||
InjectCsChunk(std::move(chunk), false);
|
InjectCsChunk(Queue, std::move(chunk), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -2828,7 +2828,7 @@ namespace dxvk {
|
|||||||
feedback = ctx->ensureImageCompatibility(cImage, usageInfo);
|
feedback = ctx->ensureImageCompatibility(cImage, usageInfo);
|
||||||
});
|
});
|
||||||
|
|
||||||
m_device->GetContext()->InjectCsChunk(std::move(chunk), true);
|
m_device->GetContext()->InjectCsChunk(DxvkCsQueue::HighPriority, std::move(chunk), true);
|
||||||
|
|
||||||
if (!feedback) {
|
if (!feedback) {
|
||||||
Logger::err(str::format("Failed to lock image:"
|
Logger::err(str::format("Failed to lock image:"
|
||||||
@ -2852,7 +2852,7 @@ namespace dxvk {
|
|||||||
ctx->ensureBufferAddress(cBuffer);
|
ctx->ensureBufferAddress(cBuffer);
|
||||||
});
|
});
|
||||||
|
|
||||||
m_device->GetContext()->InjectCsChunk(std::move(chunk), true);
|
m_device->GetContext()->InjectCsChunk(DxvkCsQueue::HighPriority, std::move(chunk), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -371,7 +371,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
void D3D11Initializer::FlushCsChunkLocked() {
|
void D3D11Initializer::FlushCsChunkLocked() {
|
||||||
m_parent->GetContext()->InjectCsChunk(std::move(m_csChunk), false);
|
m_parent->GetContext()->InjectCsChunk(DxvkCsQueue::HighPriority, std::move(m_csChunk), false);
|
||||||
m_csChunk = m_parent->AllocCsChunk(DxvkCsChunkFlag::SingleUse);
|
m_csChunk = m_parent->AllocCsChunk(DxvkCsChunkFlag::SingleUse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -576,7 +576,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
// Initialize images so that we can use them. Clearing
|
// Initialize images so that we can use them. Clearing
|
||||||
// to black prevents garbled output for the first frame.
|
// to black prevents garbled output for the first frame.
|
||||||
m_parent->GetContext()->InjectCs([
|
m_parent->GetContext()->InjectCs(DxvkCsQueue::HighPriority, [
|
||||||
cImages = std::move(images)
|
cImages = std::move(images)
|
||||||
] (DxvkContext* ctx) {
|
] (DxvkContext* ctx) {
|
||||||
for (size_t i = 0; i < cImages.size(); i++) {
|
for (size_t i = 0; i < cImages.size(); i++) {
|
||||||
@ -612,7 +612,7 @@ namespace dxvk {
|
|||||||
void D3D11SwapChain::DestroyLatencyTracker() {
|
void D3D11SwapChain::DestroyLatencyTracker() {
|
||||||
// Need to make sure the context stops using
|
// Need to make sure the context stops using
|
||||||
// the tracker for submissions
|
// the tracker for submissions
|
||||||
m_parent->GetContext()->InjectCs([
|
m_parent->GetContext()->InjectCs(DxvkCsQueue::Ordered, [
|
||||||
cLatency = m_latency
|
cLatency = m_latency
|
||||||
] (DxvkContext* ctx) {
|
] (DxvkContext* ctx) {
|
||||||
ctx->endLatencyTracking(cLatency);
|
ctx->endLatencyTracking(cLatency);
|
||||||
|
@ -377,7 +377,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
void D3D11CommonTexture::SetDebugName(const char* pName) {
|
void D3D11CommonTexture::SetDebugName(const char* pName) {
|
||||||
if (m_image) {
|
if (m_image) {
|
||||||
m_device->GetContext()->InjectCs([
|
m_device->GetContext()->InjectCs(DxvkCsQueue::HighPriority, [
|
||||||
cImage = m_image,
|
cImage = m_image,
|
||||||
cName = std::string(pName ? pName : "")
|
cName = std::string(pName ? pName : "")
|
||||||
] (DxvkContext* ctx) {
|
] (DxvkContext* ctx) {
|
||||||
@ -387,7 +387,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
if (m_mapMode == D3D11_COMMON_TEXTURE_MAP_MODE_STAGING) {
|
if (m_mapMode == D3D11_COMMON_TEXTURE_MAP_MODE_STAGING) {
|
||||||
for (uint32_t i = 0; i < m_buffers.size(); i++) {
|
for (uint32_t i = 0; i < m_buffers.size(); i++) {
|
||||||
m_device->GetContext()->InjectCs([
|
m_device->GetContext()->InjectCs(DxvkCsQueue::HighPriority, [
|
||||||
cBuffer = m_buffers[i].buffer,
|
cBuffer = m_buffers[i].buffer,
|
||||||
cName = std::string(pName ? pName : "")
|
cName = std::string(pName ? pName : "")
|
||||||
] (DxvkContext* ctx) {
|
] (DxvkContext* ctx) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user