1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-04 16:24:29 +01:00

[dxvk] Add method to use a context's command list directly

Also provide the descriptor pool for convenience.
This commit is contained in:
Philip Rebohle 2024-09-30 13:52:54 +02:00 committed by Philip Rebohle
parent 09284988ff
commit 1c06431e18
2 changed files with 33 additions and 2 deletions

View File

@ -112,7 +112,19 @@ namespace dxvk {
this->beginRecording(
m_device->createCommandList());
}
DxvkContextObjects DxvkContext::beginExternalRendering() {
// Flush and invalidate everything
endCurrentCommands();
beginCurrentCommands();
DxvkContextObjects result;
result.cmd = m_cmd;
result.descriptorPool = m_descriptorPool;
return result;
}
void DxvkContext::beginQuery(const Rc<DxvkGpuQuery>& query) {
m_queryManager.enableQuery(m_cmd, query);

View File

@ -12,6 +12,17 @@
namespace dxvk {
/**
* \brief Context-provided objects
*
* Useful when submitting raw Vulkan commands to a command list.
*/
struct DxvkContextObjects {
Rc<DxvkCommandList> cmd;
Rc<DxvkDescriptorPool> descriptorPool;
};
/**
* \brief DXVK context
*
@ -25,7 +36,7 @@ namespace dxvk {
DxvkContext(const Rc<DxvkDevice>& device, DxvkContextType type);
~DxvkContext();
/**
* \brief Begins command buffer recording
*
@ -67,6 +78,14 @@ namespace dxvk {
*/
void flushCommandList(DxvkSubmitStatus* status);
/**
* \brief Begins external rendering
*
* Invalidates all state and provides the caller
* with the objects necessary to start drawing.
*/
DxvkContextObjects beginExternalRendering();
/**
* \brief Begins generating query data
* \param [in] query The query to end