From 0e2d63f6d2c279d35087ddaaa204097331ba2533 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Fri, 21 Sep 2018 19:01:33 +0200 Subject: [PATCH] [dxvk] Add method to retrieve shader key from shader module --- src/dxvk/dxvk_shader.h | 115 ++++++++++++++++++++++------------------- 1 file changed, 62 insertions(+), 53 deletions(-) diff --git a/src/dxvk/dxvk_shader.h b/src/dxvk/dxvk_shader.h index ddf596dc..b6d414b5 100644 --- a/src/dxvk/dxvk_shader.h +++ b/src/dxvk/dxvk_shader.h @@ -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& vkd, - const Rc& 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 shader() const { - return m_shader; - } - - private: - - Rc m_vkd; - Rc 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& vkd, + const Rc& 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 shader() const { + return m_shader; + } + + /** + * \brief Retrieves shader key + * \returns Unique shader key + */ + DxvkShaderKey getShaderKey() const { + return m_shader->getShaderKey(); + } + + private: + + Rc m_vkd; + Rc m_shader; + VkShaderModule m_module; + + }; + } \ No newline at end of file