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

32 lines
1.1 KiB
C++
Raw Normal View History

#include "dxvk_compute.h"
namespace dxvk {
DxvkComputePipeline::DxvkComputePipeline(
const Rc<vk::DeviceFn>& vkd,
const Rc<DxvkBindingLayout>& layout,
const Rc<DxvkShader>& cs)
: m_vkd(vkd), m_layout(layout), m_cs(cs) {
2017-10-14 23:52:47 +02:00
std::vector<VkDescriptorSetLayoutBinding> bindings;
VkComputePipelineCreateInfo info;
info.sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO;
info.pNext = nullptr;
info.flags = 0;
info.stage = cs->stageInfo();
info.layout = this->pipelineLayout();
2017-10-14 23:52:47 +02:00
info.basePipelineHandle = VK_NULL_HANDLE;
info.basePipelineIndex = 0;
if (m_vkd->vkCreateComputePipelines(m_vkd->device(),
VK_NULL_HANDLE, 1, &info, nullptr, &m_pipeline) != VK_SUCCESS)
throw DxvkError("DxvkComputePipeline::DxvkComputePipeline: Failed to compile pipeline");
}
DxvkComputePipeline::~DxvkComputePipeline() {
2017-10-14 23:52:47 +02:00
if (m_pipeline != VK_NULL_HANDLE)
m_vkd->vkDestroyPipeline(m_vkd->device(), m_pipeline, nullptr);
}
}