1
0
mirror of https://github.com/EduApps-CDG/OpenDX synced 2024-12-30 09:45:37 +01:00
OpenDX/src/dxvk/dxvk_graphics.h

77 lines
1.7 KiB
C
Raw Normal View History

2017-10-14 23:52:47 +02:00
#pragma once
#include <mutex>
2017-10-15 13:02:59 +02:00
#include <unordered_map>
2017-10-14 23:52:47 +02:00
2017-10-15 13:02:59 +02:00
#include "dxvk_hash.h"
2017-10-14 23:52:47 +02:00
#include "dxvk_shader.h"
#include "dxvk_resource.h"
namespace dxvk {
/**
* \brief Graphics pipeline state info
*
*
*/
struct DxvkGraphicsPipelineStateInfo {
2017-10-15 13:02:59 +02:00
VkRenderPass renderPass;
size_t hash() const;
bool operator == (const DxvkGraphicsPipelineStateInfo& other) const;
bool operator != (const DxvkGraphicsPipelineStateInfo& other) const;
2017-10-15 13:02:59 +02:00
};
2017-10-14 23:52:47 +02:00
/**
* \brief Graphics pipeline
*
* Stores the pipeline layout as well as methods to
* recompile the graphics pipeline against a given
* pipeline state vector.
*/
class DxvkGraphicsPipeline : public DxvkResource {
public:
DxvkGraphicsPipeline(
const Rc<vk::DeviceFn>& vkd,
const Rc<DxvkShader>& vs,
const Rc<DxvkShader>& tcs,
const Rc<DxvkShader>& tes,
const Rc<DxvkShader>& gs,
const Rc<DxvkShader>& fs);
~DxvkGraphicsPipeline();
2017-10-15 13:02:59 +02:00
VkDescriptorSetLayout descriptorSetLayout() const {
return m_descriptorSetLayout;
}
VkPipeline getPipelineHandle(
const DxvkGraphicsPipelineStateInfo& state);
2017-10-15 13:02:59 +02:00
2017-10-14 23:52:47 +02:00
private:
2017-10-15 13:02:59 +02:00
Rc<vk::DeviceFn> m_vkd;
Rc<DxvkShader> m_vs;
Rc<DxvkShader> m_tcs;
Rc<DxvkShader> m_tes;
Rc<DxvkShader> m_gs;
Rc<DxvkShader> m_fs;
VkDescriptorSetLayout m_descriptorSetLayout = VK_NULL_HANDLE;
VkPipelineLayout m_pipelineLayout = VK_NULL_HANDLE;
2017-10-14 23:52:47 +02:00
std::mutex m_mutex;
2017-10-15 13:02:59 +02:00
std::unordered_map<
DxvkGraphicsPipelineStateInfo,
2017-10-15 13:02:59 +02:00
VkPipeline, DxvkHash> m_pipelines;
VkPipeline compilePipeline(
const DxvkGraphicsPipelineStateInfo& state) const;
2017-10-15 13:02:59 +02:00
2017-10-14 23:52:47 +02:00
};
}