2017-12-03 00:40:58 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "dxvk_include.h"
|
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Shader interface binding
|
|
|
|
*
|
|
|
|
* Corresponds to a single descriptor binding in
|
|
|
|
* Vulkan. DXVK does not use descriptor arrays.
|
|
|
|
* Instead, each binding stores one descriptor.
|
|
|
|
*/
|
2017-12-03 20:23:26 +01:00
|
|
|
struct DxvkDescriptorSlot {
|
|
|
|
uint32_t slot; ///< Resource slot index for the context
|
|
|
|
VkDescriptorType type; ///< Descriptor type (aka resource type)
|
|
|
|
VkShaderStageFlags stages; ///< Stages that can use the resource
|
2017-12-03 00:40:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Shader interface
|
|
|
|
*
|
|
|
|
* Describes shader resource bindings
|
|
|
|
* for a graphics or compute pipeline.
|
|
|
|
*/
|
|
|
|
class DxvkBindingLayout : public RcObject {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
DxvkBindingLayout(
|
2017-12-03 20:23:26 +01:00
|
|
|
const Rc<vk::DeviceFn>& vkd,
|
|
|
|
uint32_t bindingCount,
|
|
|
|
const DxvkDescriptorSlot* bindingInfos);
|
2017-12-03 00:40:58 +01:00
|
|
|
|
|
|
|
~DxvkBindingLayout();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Number of resource bindings
|
|
|
|
* \returns Resource binding count
|
|
|
|
*/
|
2017-12-03 20:23:26 +01:00
|
|
|
uint32_t bindingCount() const {
|
|
|
|
return m_bindingSlots.size();
|
2017-12-03 00:40:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-12-03 20:23:26 +01:00
|
|
|
* \brief Resource binding info
|
|
|
|
* \returns Resource binding info
|
2017-12-03 00:40:58 +01:00
|
|
|
*/
|
2017-12-03 20:23:26 +01:00
|
|
|
const DxvkDescriptorSlot* bindings() const {
|
|
|
|
return m_bindingSlots.data();
|
|
|
|
}
|
2017-12-03 00:40:58 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Descriptor set layout handle
|
|
|
|
* \returns Descriptor set layout handle
|
|
|
|
*/
|
|
|
|
VkDescriptorSetLayout descriptorSetLayout() const {
|
|
|
|
return m_descriptorSetLayout;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Pipeline layout handle
|
|
|
|
* \returns Pipeline layout handle
|
|
|
|
*/
|
|
|
|
VkPipelineLayout pipelineLayout() const {
|
|
|
|
return m_pipelineLayout;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
Rc<vk::DeviceFn> m_vkd;
|
|
|
|
|
|
|
|
VkDescriptorSetLayout m_descriptorSetLayout = VK_NULL_HANDLE;
|
|
|
|
VkPipelineLayout m_pipelineLayout = VK_NULL_HANDLE;
|
|
|
|
|
2017-12-03 20:23:26 +01:00
|
|
|
std::vector<DxvkDescriptorSlot> m_bindingSlots;
|
2017-12-03 00:40:58 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|