[dxvk] Implement getShader method for graphics pipelines

This commit is contained in:
Philip Rebohle 2018-09-04 02:41:34 +02:00
parent e5f3019524
commit eff81c7edf
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 30 additions and 0 deletions

View File

@ -81,6 +81,25 @@ namespace dxvk {
}
Rc<DxvkShader> DxvkGraphicsPipeline::getShader(
VkShaderStageFlagBits stage) const {
switch (stage) {
case VK_SHADER_STAGE_VERTEX_BIT:
return m_vs != nullptr ? m_vs->shader() : nullptr;
case VK_SHADER_STAGE_GEOMETRY_BIT:
return m_gs != nullptr ? m_gs->shader() : nullptr;
case VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT:
return m_tcs != nullptr ? m_tcs->shader() : nullptr;
case VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT:
return m_tes != nullptr ? m_tes->shader() : nullptr;
case VK_SHADER_STAGE_FRAGMENT_BIT:
return m_fs != nullptr ? m_fs->shader() : nullptr;
default:
return nullptr;
}
}
VkPipeline DxvkGraphicsPipeline::getPipelineHandle(
const DxvkGraphicsPipelineStateInfo& state,
const DxvkRenderPass& renderPass) {

View File

@ -168,6 +168,17 @@ namespace dxvk {
return m_layout.ptr();
}
/**
* \brief Queries shader for a given stage
*
* In case no shader is specified for the
* given stage, \c nullptr will be returned.
* \param [in] stage The shader stage
* \returns Shader of the given stage
*/
Rc<DxvkShader> getShader(
VkShaderStageFlagBits stage) const;
/**
* \brief Pipeline handle
*