1
0
mirror of https://github.com/EduApps-CDG/OpenDX synced 2024-12-30 09:45:37 +01:00
OpenDX/src/dxvk/dxvk_compute.h
Philip Rebohle 0c2058e8c4
[dxvk] Introduced DxvkComputePipelineStateInfo
Will be used to re-compile compute pipelines against the current
state, just like graphics pipelines. May fix GPU lockups etc.
2018-02-14 17:54:35 +01:00

78 lines
1.8 KiB
C++

#pragma once
#include "dxvk_binding.h"
#include "dxvk_pipecache.h"
#include "dxvk_pipelayout.h"
#include "dxvk_resource.h"
#include "dxvk_shader.h"
namespace dxvk {
class DxvkDevice;
/**
* \brief Compute pipeline state info
*/
struct DxvkComputePipelineStateInfo {
bool operator == (const DxvkComputePipelineStateInfo& other) const;
bool operator != (const DxvkComputePipelineStateInfo& other) const;
DxvkBindingState bsBindingState;
};
/**
* \brief Compute pipeline
*
* Stores a compute pipeline object and the corresponding
* pipeline layout. Unlike graphics pipelines, compute
* pipelines do not need to be recompiled against any sort
* of pipeline state.
*/
class DxvkComputePipeline : public DxvkResource {
public:
DxvkComputePipeline(
const DxvkDevice* device,
const Rc<DxvkPipelineCache>& cache,
const Rc<DxvkShader>& cs);
~DxvkComputePipeline();
/**
* \brief Pipeline layout
*
* Stores the pipeline layout and the descriptor set
* layout, as well as information on the resource
* slots used by the pipeline.
* \returns Pipeline layout
*/
Rc<DxvkPipelineLayout> layout() const {
return m_layout;
}
/**
* \brief Pipeline handle
*
* \param [in] state Pipeline state
* \returns Pipeline handle
*/
VkPipeline getPipelineHandle(
const DxvkComputePipelineStateInfo& state) const;
private:
const DxvkDevice* const m_device;
const Rc<vk::DeviceFn> m_vkd;
Rc<DxvkPipelineCache> m_cache;
Rc<DxvkPipelineLayout> m_layout;
Rc<DxvkShaderModule> m_cs;
VkPipeline m_pipeline = VK_NULL_HANDLE;
void compilePipeline();
};
}