mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-13 19:29:14 +01:00
[dxvk] Add method to retrieve shader key from shader module
This commit is contained in:
parent
f3a23ab81f
commit
0e2d63f6d2
@ -12,6 +12,7 @@
|
||||
namespace dxvk {
|
||||
|
||||
class DxvkShader;
|
||||
class DxvkShaderModule;
|
||||
|
||||
/**
|
||||
* \brief Built-in specialization constants
|
||||
@ -88,59 +89,6 @@ namespace dxvk {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \brief Shader module object
|
||||
*
|
||||
* Manages a Vulkan shader module. This will not
|
||||
* perform any shader compilation. Instead, the
|
||||
* context will create pipeline objects on the
|
||||
* fly when executing draw calls.
|
||||
*/
|
||||
class DxvkShaderModule : public RcObject {
|
||||
|
||||
public:
|
||||
|
||||
DxvkShaderModule(
|
||||
const Rc<vk::DeviceFn>& vkd,
|
||||
const Rc<DxvkShader>& shader,
|
||||
const SpirvCodeBuffer& code);
|
||||
|
||||
~DxvkShaderModule();
|
||||
|
||||
/**
|
||||
* \brief Shader module handle
|
||||
* \returns Shader module handle
|
||||
*/
|
||||
VkShaderModule handle() const {
|
||||
return m_module;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Shader stage creation info
|
||||
*
|
||||
* \param [in] specInfo Specialization info
|
||||
* \returns Shader stage create info
|
||||
*/
|
||||
VkPipelineShaderStageCreateInfo stageInfo(
|
||||
const VkSpecializationInfo* specInfo) const;
|
||||
|
||||
/**
|
||||
* \brief Shader object
|
||||
* \returns The shader
|
||||
*/
|
||||
Rc<DxvkShader> shader() const {
|
||||
return m_shader;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Rc<vk::DeviceFn> m_vkd;
|
||||
Rc<DxvkShader> m_shader;
|
||||
VkShaderModule m_module;
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \brief Shader object
|
||||
*
|
||||
@ -273,4 +221,65 @@ namespace dxvk {
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \brief Shader module object
|
||||
*
|
||||
* Manages a Vulkan shader module. This will not
|
||||
* perform any shader compilation. Instead, the
|
||||
* context will create pipeline objects on the
|
||||
* fly when executing draw calls.
|
||||
*/
|
||||
class DxvkShaderModule : public RcObject {
|
||||
|
||||
public:
|
||||
|
||||
DxvkShaderModule(
|
||||
const Rc<vk::DeviceFn>& vkd,
|
||||
const Rc<DxvkShader>& shader,
|
||||
const SpirvCodeBuffer& code);
|
||||
|
||||
~DxvkShaderModule();
|
||||
|
||||
/**
|
||||
* \brief Shader module handle
|
||||
* \returns Shader module handle
|
||||
*/
|
||||
VkShaderModule handle() const {
|
||||
return m_module;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Shader stage creation info
|
||||
*
|
||||
* \param [in] specInfo Specialization info
|
||||
* \returns Shader stage create info
|
||||
*/
|
||||
VkPipelineShaderStageCreateInfo stageInfo(
|
||||
const VkSpecializationInfo* specInfo) const;
|
||||
|
||||
/**
|
||||
* \brief Shader object
|
||||
* \returns The shader
|
||||
*/
|
||||
Rc<DxvkShader> shader() const {
|
||||
return m_shader;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Retrieves shader key
|
||||
* \returns Unique shader key
|
||||
*/
|
||||
DxvkShaderKey getShaderKey() const {
|
||||
return m_shader->getShaderKey();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Rc<vk::DeviceFn> m_vkd;
|
||||
Rc<DxvkShader> m_shader;
|
||||
VkShaderModule m_module;
|
||||
|
||||
};
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user