diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index a1950c38..9fb0344a 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -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& query) { m_queryManager.enableQuery(m_cmd, query); diff --git a/src/dxvk/dxvk_context.h b/src/dxvk/dxvk_context.h index cbba27de..6660d678 100644 --- a/src/dxvk/dxvk_context.h +++ b/src/dxvk/dxvk_context.h @@ -12,6 +12,17 @@ namespace dxvk { + /** + * \brief Context-provided objects + * + * Useful when submitting raw Vulkan commands to a command list. + */ + struct DxvkContextObjects { + Rc cmd; + Rc descriptorPool; + }; + + /** * \brief DXVK context * @@ -25,7 +36,7 @@ namespace dxvk { DxvkContext(const Rc& 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