1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-05 01:24:14 +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

@ -114,6 +114,18 @@ namespace dxvk {
} }
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) { void DxvkContext::beginQuery(const Rc<DxvkGpuQuery>& query) {
m_queryManager.enableQuery(m_cmd, query); m_queryManager.enableQuery(m_cmd, query);
} }

View File

@ -12,6 +12,17 @@
namespace dxvk { 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 * \brief DXVK context
* *
@ -67,6 +78,14 @@ namespace dxvk {
*/ */
void flushCommandList(DxvkSubmitStatus* status); 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 * \brief Begins generating query data
* \param [in] query The query to end * \param [in] query The query to end