mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-11-30 04:24:11 +01:00
[dxvk] Added DxvkMetaClearObjects stub
This commit is contained in:
parent
9970dfaeca
commit
676b0cb476
@ -7,11 +7,13 @@
|
||||
namespace dxvk {
|
||||
|
||||
DxvkContext::DxvkContext(
|
||||
const Rc<DxvkDevice>& device,
|
||||
const Rc<DxvkPipelineCache>& pipelineCache)
|
||||
: m_device (device),
|
||||
m_pipeCache (pipelineCache),
|
||||
m_pipeMgr (new DxvkPipelineManager(device.ptr())) { }
|
||||
const Rc<DxvkDevice>& device,
|
||||
const Rc<DxvkPipelineCache>& pipelineCache,
|
||||
const Rc<DxvkMetaClearObjects>& metaClearObjects)
|
||||
: m_device (device),
|
||||
m_pipeCache (pipelineCache),
|
||||
m_pipeMgr (new DxvkPipelineManager(device.ptr())),
|
||||
m_metaClear (metaClearObjects) { }
|
||||
|
||||
|
||||
DxvkContext::~DxvkContext() {
|
||||
@ -235,6 +237,15 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::clearBufferView(
|
||||
const Rc<DxvkBufferView>& bufferView,
|
||||
VkDeviceSize offset,
|
||||
VkDeviceSize length,
|
||||
VkClearColorValue value) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::clearColorImage(
|
||||
const Rc<DxvkImage>& image,
|
||||
const VkClearColorValue& value,
|
||||
@ -355,6 +366,15 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::clearImageView(
|
||||
const Rc<DxvkBufferView>& bufferView,
|
||||
VkOffset3D offset,
|
||||
VkExtent3D extent,
|
||||
VkClearColorValue value) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::copyBuffer(
|
||||
const Rc<DxvkBuffer>& dstBuffer,
|
||||
VkDeviceSize dstOffset,
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "dxvk_context_state.h"
|
||||
#include "dxvk_data.h"
|
||||
#include "dxvk_event.h"
|
||||
#include "dxvk_meta_clear.h"
|
||||
#include "dxvk_meta_resolve.h"
|
||||
#include "dxvk_pipecache.h"
|
||||
#include "dxvk_pipemanager.h"
|
||||
@ -27,8 +28,9 @@ namespace dxvk {
|
||||
public:
|
||||
|
||||
DxvkContext(
|
||||
const Rc<DxvkDevice>& device,
|
||||
const Rc<DxvkPipelineCache>& pipelineCache);
|
||||
const Rc<DxvkDevice>& device,
|
||||
const Rc<DxvkPipelineCache>& pipelineCache,
|
||||
const Rc<DxvkMetaClearObjects>& metaClearObjects);
|
||||
~DxvkContext();
|
||||
|
||||
/**
|
||||
@ -165,6 +167,22 @@ namespace dxvk {
|
||||
VkDeviceSize length,
|
||||
uint32_t value);
|
||||
|
||||
/**
|
||||
* \brief Clears a buffer view
|
||||
*
|
||||
* Unlike \c clearBuffer, this method can be used
|
||||
* to clear a buffer view with format conversion.
|
||||
* \param [in] bufferView The buffer view
|
||||
* \param [in] offset Offset of the region to clear
|
||||
* \param [in] length Extent of the region to clear
|
||||
* \param [in] value The clear value
|
||||
*/
|
||||
void clearBufferView(
|
||||
const Rc<DxvkBufferView>& bufferView,
|
||||
VkDeviceSize offset,
|
||||
VkDeviceSize length,
|
||||
VkClearColorValue value);
|
||||
|
||||
/**
|
||||
* \brief Clears subresources of a color image
|
||||
*
|
||||
@ -203,6 +221,23 @@ namespace dxvk {
|
||||
VkImageAspectFlags clearAspects,
|
||||
const VkClearValue& clearValue);
|
||||
|
||||
/**
|
||||
* \brief Clears an image view
|
||||
*
|
||||
* Can be used to clear sub-regions of storage images
|
||||
* that are not going to be used as render targets.
|
||||
* Implicit format conversion will be applied.
|
||||
* \param [in] bufferView The buffer view
|
||||
* \param [in] offset Offset of the rect to clear
|
||||
* \param [in] extent Extent of the rect to clear
|
||||
* \param [in] value The clear value
|
||||
*/
|
||||
void clearImageView(
|
||||
const Rc<DxvkBufferView>& bufferView,
|
||||
VkOffset3D offset,
|
||||
VkExtent3D extent,
|
||||
VkClearColorValue value);
|
||||
|
||||
/**
|
||||
* \brief Copies data from one buffer to another
|
||||
*
|
||||
@ -568,6 +603,7 @@ namespace dxvk {
|
||||
const Rc<DxvkDevice> m_device;
|
||||
const Rc<DxvkPipelineCache> m_pipeCache;
|
||||
const Rc<DxvkPipelineManager> m_pipeMgr;
|
||||
const Rc<DxvkMetaClearObjects> m_metaClear;
|
||||
|
||||
Rc<DxvkCommandList> m_cmd;
|
||||
DxvkContextFlags m_flags;
|
||||
|
@ -12,9 +12,10 @@ namespace dxvk {
|
||||
m_vkd (vkd),
|
||||
m_extensions (extensions),
|
||||
m_features (features),
|
||||
m_memory (new DxvkMemoryAllocator(adapter, vkd)),
|
||||
m_renderPassPool (new DxvkRenderPassPool (vkd)),
|
||||
m_pipelineCache (new DxvkPipelineCache (vkd)),
|
||||
m_memory (new DxvkMemoryAllocator (adapter, vkd)),
|
||||
m_renderPassPool (new DxvkRenderPassPool (vkd)),
|
||||
m_pipelineCache (new DxvkPipelineCache (vkd)),
|
||||
m_metaClearObjects(new DxvkMetaClearObjects (vkd)),
|
||||
m_unboundResources(this),
|
||||
m_submissionQueue (this) {
|
||||
m_vkd->vkGetDeviceQueue(m_vkd->device(),
|
||||
@ -98,7 +99,9 @@ namespace dxvk {
|
||||
|
||||
|
||||
Rc<DxvkContext> DxvkDevice::createContext() {
|
||||
return new DxvkContext(this, m_pipelineCache);
|
||||
return new DxvkContext(this,
|
||||
m_pipelineCache,
|
||||
m_metaClearObjects);
|
||||
}
|
||||
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "dxvk_framebuffer.h"
|
||||
#include "dxvk_image.h"
|
||||
#include "dxvk_memory.h"
|
||||
#include "dxvk_meta_clear.h"
|
||||
#include "dxvk_pipecache.h"
|
||||
#include "dxvk_pipemanager.h"
|
||||
#include "dxvk_queue.h"
|
||||
@ -310,6 +311,7 @@ namespace dxvk {
|
||||
Rc<DxvkMemoryAllocator> m_memory;
|
||||
Rc<DxvkRenderPassPool> m_renderPassPool;
|
||||
Rc<DxvkPipelineCache> m_pipelineCache;
|
||||
Rc<DxvkMetaClearObjects> m_metaClearObjects;
|
||||
|
||||
DxvkUnboundResources m_unboundResources;
|
||||
|
||||
|
15
src/dxvk/dxvk_meta_clear.cpp
Normal file
15
src/dxvk/dxvk_meta_clear.cpp
Normal file
@ -0,0 +1,15 @@
|
||||
#include "dxvk_meta_clear.h"
|
||||
|
||||
namespace dxvk {
|
||||
|
||||
DxvkMetaClearObjects::DxvkMetaClearObjects(const Rc<vk::DeviceFn>& vkd)
|
||||
: m_vkd(vkd) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
DxvkMetaClearObjects::~DxvkMetaClearObjects() {
|
||||
|
||||
}
|
||||
|
||||
}
|
43
src/dxvk/dxvk_meta_clear.h
Normal file
43
src/dxvk/dxvk_meta_clear.h
Normal file
@ -0,0 +1,43 @@
|
||||
#pragma once
|
||||
|
||||
#include "dxvk_barrier.h"
|
||||
#include "dxvk_cmdlist.h"
|
||||
#include "dxvk_resource.h"
|
||||
|
||||
namespace dxvk {
|
||||
|
||||
/**
|
||||
* \brief Clear args
|
||||
*
|
||||
* The data structure that can be passed
|
||||
* to the clear shaders as push constants.
|
||||
*/
|
||||
struct DxvkMetaClearArgs {
|
||||
VkClearColorValue clearValue;
|
||||
|
||||
alignas(16) VkOffset3D offset;
|
||||
alignas(16) VkExtent3D extent;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \brief Clear shaders and related objects
|
||||
*
|
||||
* Creates the shaders, pipeline layouts, and
|
||||
* compute pipelines that are going to be used
|
||||
* for clear operations.
|
||||
*/
|
||||
class DxvkMetaClearObjects : public RcObject {
|
||||
|
||||
public:
|
||||
|
||||
DxvkMetaClearObjects(const Rc<vk::DeviceFn>& vkd);
|
||||
~DxvkMetaClearObjects();
|
||||
|
||||
private:
|
||||
|
||||
Rc<vk::DeviceFn> m_vkd;
|
||||
|
||||
};
|
||||
|
||||
}
|
@ -35,6 +35,7 @@ dxvk_src = files([
|
||||
'dxvk_lifetime.cpp',
|
||||
'dxvk_main.cpp',
|
||||
'dxvk_memory.cpp',
|
||||
'dxvk_meta_clear.cpp',
|
||||
'dxvk_meta_resolve.cpp',
|
||||
'dxvk_pipecache.cpp',
|
||||
'dxvk_pipelayout.cpp',
|
||||
|
Loading…
Reference in New Issue
Block a user