mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[dxvk] Removed Recorder interface and deferred context
This commit is contained in:
parent
004bc88e0c
commit
27905d0711
@ -33,8 +33,7 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DxvkBarrierSet::recordCommands(
|
void DxvkBarrierSet::recordCommands(DxvkCommandList& commandList) {
|
||||||
DxvkRecorder& recorder) {
|
|
||||||
if ((m_srcStages | m_dstStages) != 0) {
|
if ((m_srcStages | m_dstStages) != 0) {
|
||||||
VkPipelineStageFlags srcFlags = m_srcStages;
|
VkPipelineStageFlags srcFlags = m_srcStages;
|
||||||
VkPipelineStageFlags dstFlags = m_dstStages;
|
VkPipelineStageFlags dstFlags = m_dstStages;
|
||||||
@ -42,7 +41,7 @@ namespace dxvk {
|
|||||||
if (srcFlags == 0) srcFlags = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT;
|
if (srcFlags == 0) srcFlags = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT;
|
||||||
if (dstFlags == 0) dstFlags = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT;
|
if (dstFlags == 0) dstFlags = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT;
|
||||||
|
|
||||||
recorder.cmdPipelineBarrier(
|
commandList.cmdPipelineBarrier(
|
||||||
srcFlags, dstFlags, 0,
|
srcFlags, dstFlags, 0,
|
||||||
m_memBarriers.size(), m_memBarriers.data(),
|
m_memBarriers.size(), m_memBarriers.data(),
|
||||||
m_bufBarriers.size(), m_bufBarriers.data(),
|
m_bufBarriers.size(), m_bufBarriers.data(),
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "dxvk_buffer.h"
|
#include "dxvk_buffer.h"
|
||||||
|
#include "dxvk_cmdlist.h"
|
||||||
#include "dxvk_image.h"
|
#include "dxvk_image.h"
|
||||||
#include "dxvk_recorder.h"
|
|
||||||
|
|
||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ namespace dxvk {
|
|||||||
VkAccessFlags access);
|
VkAccessFlags access);
|
||||||
|
|
||||||
void recordCommands(
|
void recordCommands(
|
||||||
DxvkRecorder& recorder);
|
DxvkCommandList& commandList);
|
||||||
|
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
#include "dxvk_descriptor.h"
|
#include "dxvk_descriptor.h"
|
||||||
#include "dxvk_lifetime.h"
|
#include "dxvk_lifetime.h"
|
||||||
#include "dxvk_recorder.h"
|
|
||||||
|
|
||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
@ -17,7 +16,7 @@ namespace dxvk {
|
|||||||
* When the command list has completed execution, resources that
|
* When the command list has completed execution, resources that
|
||||||
* are no longer used may get destroyed.
|
* are no longer used may get destroyed.
|
||||||
*/
|
*/
|
||||||
class DxvkCommandList : public DxvkRecorder {
|
class DxvkCommandList : public RcObject {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -40,7 +39,7 @@ namespace dxvk {
|
|||||||
* Resets the command buffer and
|
* Resets the command buffer and
|
||||||
* begins command buffer recording.
|
* begins command buffer recording.
|
||||||
*/
|
*/
|
||||||
void beginRecording() final;
|
void beginRecording();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Ends recording
|
* \brief Ends recording
|
||||||
@ -48,7 +47,7 @@ namespace dxvk {
|
|||||||
* Ends command buffer recording, making
|
* Ends command buffer recording, making
|
||||||
* the command list ready for submission.
|
* the command list ready for submission.
|
||||||
*/
|
*/
|
||||||
void endRecording() final;
|
void endRecording();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Adds a resource to track
|
* \brief Adds a resource to track
|
||||||
@ -59,7 +58,7 @@ namespace dxvk {
|
|||||||
* completed.
|
* completed.
|
||||||
*/
|
*/
|
||||||
void trackResource(
|
void trackResource(
|
||||||
const Rc<DxvkResource>& rc) final;
|
const Rc<DxvkResource>& rc);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Resets the command list
|
* \brief Resets the command list
|
||||||
@ -69,72 +68,72 @@ namespace dxvk {
|
|||||||
* command list to the device, this method will be called once
|
* command list to the device, this method will be called once
|
||||||
* the command list completes execution.
|
* the command list completes execution.
|
||||||
*/
|
*/
|
||||||
void reset() final;
|
void reset();
|
||||||
|
|
||||||
void bindShaderResources(
|
void bindShaderResources(
|
||||||
VkPipelineBindPoint pipeline,
|
VkPipelineBindPoint pipeline,
|
||||||
VkPipelineLayout pipelineLayout,
|
VkPipelineLayout pipelineLayout,
|
||||||
VkDescriptorSetLayout descriptorLayout,
|
VkDescriptorSetLayout descriptorLayout,
|
||||||
uint32_t bindingCount,
|
uint32_t bindingCount,
|
||||||
const DxvkResourceBinding* bindings) final;
|
const DxvkResourceBinding* bindings);
|
||||||
|
|
||||||
void cmdBeginRenderPass(
|
void cmdBeginRenderPass(
|
||||||
const VkRenderPassBeginInfo* pRenderPassBegin,
|
const VkRenderPassBeginInfo* pRenderPassBegin,
|
||||||
VkSubpassContents contents) final;
|
VkSubpassContents contents);
|
||||||
|
|
||||||
void cmdBindIndexBuffer(
|
void cmdBindIndexBuffer(
|
||||||
VkBuffer buffer,
|
VkBuffer buffer,
|
||||||
VkDeviceSize offset,
|
VkDeviceSize offset,
|
||||||
VkIndexType indexType) final;
|
VkIndexType indexType);
|
||||||
|
|
||||||
void cmdBindPipeline(
|
void cmdBindPipeline(
|
||||||
VkPipelineBindPoint pipelineBindPoint,
|
VkPipelineBindPoint pipelineBindPoint,
|
||||||
VkPipeline pipeline) final;
|
VkPipeline pipeline);
|
||||||
|
|
||||||
void cmdBindVertexBuffers(
|
void cmdBindVertexBuffers(
|
||||||
uint32_t firstBinding,
|
uint32_t firstBinding,
|
||||||
uint32_t bindingCount,
|
uint32_t bindingCount,
|
||||||
const VkBuffer* pBuffers,
|
const VkBuffer* pBuffers,
|
||||||
const VkDeviceSize* pOffsets) final;
|
const VkDeviceSize* pOffsets);
|
||||||
|
|
||||||
void cmdClearAttachments(
|
void cmdClearAttachments(
|
||||||
uint32_t attachmentCount,
|
uint32_t attachmentCount,
|
||||||
const VkClearAttachment* pAttachments,
|
const VkClearAttachment* pAttachments,
|
||||||
uint32_t rectCount,
|
uint32_t rectCount,
|
||||||
const VkClearRect* pRects) final;
|
const VkClearRect* pRects);
|
||||||
|
|
||||||
void cmdClearColorImage(
|
void cmdClearColorImage(
|
||||||
VkImage image,
|
VkImage image,
|
||||||
VkImageLayout imageLayout,
|
VkImageLayout imageLayout,
|
||||||
const VkClearColorValue* pColor,
|
const VkClearColorValue* pColor,
|
||||||
uint32_t rangeCount,
|
uint32_t rangeCount,
|
||||||
const VkImageSubresourceRange* pRanges) final;
|
const VkImageSubresourceRange* pRanges);
|
||||||
|
|
||||||
void cmdCopyBuffer(
|
void cmdCopyBuffer(
|
||||||
VkBuffer srcBuffer,
|
VkBuffer srcBuffer,
|
||||||
VkBuffer dstBuffer,
|
VkBuffer dstBuffer,
|
||||||
uint32_t regionCount,
|
uint32_t regionCount,
|
||||||
const VkBufferCopy* pRegions) final;
|
const VkBufferCopy* pRegions);
|
||||||
|
|
||||||
void cmdDispatch(
|
void cmdDispatch(
|
||||||
uint32_t x,
|
uint32_t x,
|
||||||
uint32_t y,
|
uint32_t y,
|
||||||
uint32_t z) final;
|
uint32_t z);
|
||||||
|
|
||||||
void cmdDraw(
|
void cmdDraw(
|
||||||
uint32_t vertexCount,
|
uint32_t vertexCount,
|
||||||
uint32_t instanceCount,
|
uint32_t instanceCount,
|
||||||
uint32_t firstVertex,
|
uint32_t firstVertex,
|
||||||
uint32_t firstInstance) final;
|
uint32_t firstInstance);
|
||||||
|
|
||||||
void cmdDrawIndexed(
|
void cmdDrawIndexed(
|
||||||
uint32_t indexCount,
|
uint32_t indexCount,
|
||||||
uint32_t instanceCount,
|
uint32_t instanceCount,
|
||||||
uint32_t firstIndex,
|
uint32_t firstIndex,
|
||||||
uint32_t vertexOffset,
|
uint32_t vertexOffset,
|
||||||
uint32_t firstInstance) final;
|
uint32_t firstInstance);
|
||||||
|
|
||||||
void cmdEndRenderPass() final;
|
void cmdEndRenderPass();
|
||||||
|
|
||||||
void cmdPipelineBarrier(
|
void cmdPipelineBarrier(
|
||||||
VkPipelineStageFlags srcStageMask,
|
VkPipelineStageFlags srcStageMask,
|
||||||
@ -145,17 +144,17 @@ namespace dxvk {
|
|||||||
uint32_t bufferMemoryBarrierCount,
|
uint32_t bufferMemoryBarrierCount,
|
||||||
const VkBufferMemoryBarrier* pBufferMemoryBarriers,
|
const VkBufferMemoryBarrier* pBufferMemoryBarriers,
|
||||||
uint32_t imageMemoryBarrierCount,
|
uint32_t imageMemoryBarrierCount,
|
||||||
const VkImageMemoryBarrier* pImageMemoryBarriers) final;
|
const VkImageMemoryBarrier* pImageMemoryBarriers);
|
||||||
|
|
||||||
void cmdSetScissor(
|
void cmdSetScissor(
|
||||||
uint32_t firstScissor,
|
uint32_t firstScissor,
|
||||||
uint32_t scissorCount,
|
uint32_t scissorCount,
|
||||||
const VkRect2D* scissors) final;
|
const VkRect2D* scissors);
|
||||||
|
|
||||||
void cmdSetViewport(
|
void cmdSetViewport(
|
||||||
uint32_t firstViewport,
|
uint32_t firstViewport,
|
||||||
uint32_t viewportCount,
|
uint32_t viewportCount,
|
||||||
const VkViewport* viewports) final;
|
const VkViewport* viewports);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -18,9 +18,8 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DxvkContext::beginRecording(
|
void DxvkContext::beginRecording(const Rc<DxvkCommandList>& cmdList) {
|
||||||
const Rc<DxvkRecorder>& recorder) {
|
m_cmd = cmdList;
|
||||||
m_cmd = recorder;
|
|
||||||
m_cmd->beginRecording();
|
m_cmd->beginRecording();
|
||||||
|
|
||||||
// The current state of the internal command buffer is
|
// The current state of the internal command buffer is
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
#include "dxvk_barrier.h"
|
#include "dxvk_barrier.h"
|
||||||
#include "dxvk_cmdlist.h"
|
#include "dxvk_cmdlist.h"
|
||||||
#include "dxvk_context_state.h"
|
#include "dxvk_context_state.h"
|
||||||
#include "dxvk_deferred.h"
|
|
||||||
#include "dxvk_pipemgr.h"
|
#include "dxvk_pipemgr.h"
|
||||||
#include "dxvk_util.h"
|
#include "dxvk_util.h"
|
||||||
|
|
||||||
@ -31,10 +30,10 @@ namespace dxvk {
|
|||||||
* Begins recording a command list. This does
|
* Begins recording a command list. This does
|
||||||
* not alter any context state other than the
|
* not alter any context state other than the
|
||||||
* active command list.
|
* active command list.
|
||||||
* \param [in] recorder Target recorder
|
* \param [in] cmdList Target command list
|
||||||
*/
|
*/
|
||||||
void beginRecording(
|
void beginRecording(
|
||||||
const Rc<DxvkRecorder>& recorder);
|
const Rc<DxvkCommandList>& cmdList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Ends command buffer recording
|
* \brief Ends command buffer recording
|
||||||
@ -225,9 +224,9 @@ namespace dxvk {
|
|||||||
const Rc<DxvkDevice> m_device;
|
const Rc<DxvkDevice> m_device;
|
||||||
const Rc<DxvkPipelineManager> m_pipeMgr;
|
const Rc<DxvkPipelineManager> m_pipeMgr;
|
||||||
|
|
||||||
Rc<DxvkRecorder> m_cmd;
|
Rc<DxvkCommandList> m_cmd;
|
||||||
DxvkContextState m_state;
|
DxvkContextState m_state;
|
||||||
DxvkBarrierSet m_barriers;
|
DxvkBarrierSet m_barriers;
|
||||||
|
|
||||||
void renderPassBegin();
|
void renderPassBegin();
|
||||||
void renderPassEnd();
|
void renderPassEnd();
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
#include "dxvk_deferred.h"
|
|
||||||
|
|
||||||
namespace dxvk {
|
|
||||||
|
|
||||||
DxvkDeferredCommands:: DxvkDeferredCommands() { }
|
|
||||||
DxvkDeferredCommands::~DxvkDeferredCommands() { }
|
|
||||||
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <unordered_set>
|
|
||||||
|
|
||||||
#include "dxvk_lifetime.h"
|
|
||||||
#include "dxvk_recorder.h"
|
|
||||||
|
|
||||||
namespace dxvk {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief DXVK deferred command list
|
|
||||||
*
|
|
||||||
* Buffers Vulkan commands so that they can be recorded
|
|
||||||
* into an actual Vulkan command buffer later. This is
|
|
||||||
* used to implement D3D11 Deferred Contexts, which do
|
|
||||||
* not map particularly well to Vulkan's command buffers.
|
|
||||||
*/
|
|
||||||
class DxvkDeferredCommands : public DxvkRecorder {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
DxvkDeferredCommands();
|
|
||||||
~DxvkDeferredCommands();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
#include "dxvk_recorder.h"
|
|
||||||
|
|
||||||
namespace dxvk {
|
|
||||||
|
|
||||||
DxvkRecorder::~DxvkRecorder() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,119 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "dxvk_descriptor.h"
|
|
||||||
#include "dxvk_lifetime.h"
|
|
||||||
|
|
||||||
namespace dxvk {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief DXVK command recorder
|
|
||||||
*
|
|
||||||
* An interface that wraps Vulkan calls. \ref DxvkCommandList
|
|
||||||
* implements this interface to record Vulkan commands into a
|
|
||||||
* primary command buffer, whereas \ref DxvkDeferredCommands
|
|
||||||
* buffers the calls and provides methods to record them into
|
|
||||||
* a \ref DxvkCommandList on demand.
|
|
||||||
*/
|
|
||||||
class DxvkRecorder : public RcObject {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
virtual ~DxvkRecorder();
|
|
||||||
|
|
||||||
virtual void beginRecording() = 0;
|
|
||||||
virtual void endRecording() = 0;
|
|
||||||
|
|
||||||
virtual void trackResource(
|
|
||||||
const Rc<DxvkResource>& rc) = 0;
|
|
||||||
|
|
||||||
virtual void reset() = 0;
|
|
||||||
|
|
||||||
virtual void bindShaderResources(
|
|
||||||
VkPipelineBindPoint pipeline,
|
|
||||||
VkPipelineLayout pipelineLayout,
|
|
||||||
VkDescriptorSetLayout descriptorLayout,
|
|
||||||
uint32_t bindingCount,
|
|
||||||
const DxvkResourceBinding* bindings) = 0;
|
|
||||||
|
|
||||||
virtual void cmdBeginRenderPass(
|
|
||||||
const VkRenderPassBeginInfo* pRenderPassBegin,
|
|
||||||
VkSubpassContents contents) = 0;
|
|
||||||
|
|
||||||
virtual void cmdBindIndexBuffer(
|
|
||||||
VkBuffer buffer,
|
|
||||||
VkDeviceSize offset,
|
|
||||||
VkIndexType indexType) = 0;
|
|
||||||
|
|
||||||
virtual void cmdBindPipeline(
|
|
||||||
VkPipelineBindPoint pipelineBindPoint,
|
|
||||||
VkPipeline pipeline) = 0;
|
|
||||||
|
|
||||||
virtual void cmdBindVertexBuffers(
|
|
||||||
uint32_t firstBinding,
|
|
||||||
uint32_t bindingCount,
|
|
||||||
const VkBuffer* pBuffers,
|
|
||||||
const VkDeviceSize* pOffsets) = 0;
|
|
||||||
|
|
||||||
virtual void cmdClearAttachments(
|
|
||||||
uint32_t attachmentCount,
|
|
||||||
const VkClearAttachment* pAttachments,
|
|
||||||
uint32_t rectCount,
|
|
||||||
const VkClearRect* pRects) = 0;
|
|
||||||
|
|
||||||
virtual void cmdClearColorImage(
|
|
||||||
VkImage image,
|
|
||||||
VkImageLayout imageLayout,
|
|
||||||
const VkClearColorValue* pColor,
|
|
||||||
uint32_t rangeCount,
|
|
||||||
const VkImageSubresourceRange* pRanges) = 0;
|
|
||||||
|
|
||||||
virtual void cmdCopyBuffer(
|
|
||||||
VkBuffer srcBuffer,
|
|
||||||
VkBuffer dstBuffer,
|
|
||||||
uint32_t regionCount,
|
|
||||||
const VkBufferCopy* pRegions) = 0;
|
|
||||||
|
|
||||||
virtual void cmdDispatch(
|
|
||||||
uint32_t x,
|
|
||||||
uint32_t y,
|
|
||||||
uint32_t z) = 0;
|
|
||||||
|
|
||||||
virtual void cmdDraw(
|
|
||||||
uint32_t vertexCount,
|
|
||||||
uint32_t instanceCount,
|
|
||||||
uint32_t firstVertex,
|
|
||||||
uint32_t firstInstance) = 0;
|
|
||||||
|
|
||||||
virtual void cmdDrawIndexed(
|
|
||||||
uint32_t indexCount,
|
|
||||||
uint32_t instanceCount,
|
|
||||||
uint32_t firstIndex,
|
|
||||||
uint32_t vertexOffset,
|
|
||||||
uint32_t firstInstance) = 0;
|
|
||||||
|
|
||||||
virtual void cmdEndRenderPass() = 0;
|
|
||||||
|
|
||||||
virtual void cmdPipelineBarrier(
|
|
||||||
VkPipelineStageFlags srcStageMask,
|
|
||||||
VkPipelineStageFlags dstStageMask,
|
|
||||||
VkDependencyFlags dependencyFlags,
|
|
||||||
uint32_t memoryBarrierCount,
|
|
||||||
const VkMemoryBarrier* pMemoryBarriers,
|
|
||||||
uint32_t bufferMemoryBarrierCount,
|
|
||||||
const VkBufferMemoryBarrier* pBufferMemoryBarriers,
|
|
||||||
uint32_t imageMemoryBarrierCount,
|
|
||||||
const VkImageMemoryBarrier* pImageMemoryBarriers) = 0;
|
|
||||||
|
|
||||||
virtual void cmdSetScissor(
|
|
||||||
uint32_t firstScissor,
|
|
||||||
uint32_t scissorCount,
|
|
||||||
const VkRect2D* scissors) = 0;
|
|
||||||
|
|
||||||
virtual void cmdSetViewport(
|
|
||||||
uint32_t firstViewport,
|
|
||||||
uint32_t viewportCount,
|
|
||||||
const VkViewport* viewports) = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
@ -6,7 +6,6 @@ dxvk_src = files([
|
|||||||
'dxvk_compute.cpp',
|
'dxvk_compute.cpp',
|
||||||
'dxvk_constant_state.cpp',
|
'dxvk_constant_state.cpp',
|
||||||
'dxvk_context.cpp',
|
'dxvk_context.cpp',
|
||||||
'dxvk_deferred.cpp',
|
|
||||||
'dxvk_descriptor.cpp',
|
'dxvk_descriptor.cpp',
|
||||||
'dxvk_device.cpp',
|
'dxvk_device.cpp',
|
||||||
'dxvk_framebuffer.cpp',
|
'dxvk_framebuffer.cpp',
|
||||||
@ -17,7 +16,6 @@ dxvk_src = files([
|
|||||||
'dxvk_main.cpp',
|
'dxvk_main.cpp',
|
||||||
'dxvk_memory.cpp',
|
'dxvk_memory.cpp',
|
||||||
'dxvk_pipemgr.cpp',
|
'dxvk_pipemgr.cpp',
|
||||||
'dxvk_recorder.cpp',
|
|
||||||
'dxvk_renderpass.cpp',
|
'dxvk_renderpass.cpp',
|
||||||
'dxvk_resource.cpp',
|
'dxvk_resource.cpp',
|
||||||
'dxvk_shader.cpp',
|
'dxvk_shader.cpp',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user