| 1729 | } |
| 1730 | |
| 1731 | Shader::Shader(const Device& dev, const VkShaderStageFlagBits stage, const std::vector<uint32_t>& spv, |
| 1732 | const VkDescriptorSetLayout* descriptorSetLayout, const VkPushConstantRange* pushConstRange) { |
| 1733 | VkShaderCreateInfoEXT createInfo = vku::InitStructHelper(); |
| 1734 | createInfo.stage = stage; |
| 1735 | SetNextStage(createInfo, dev.GetFeatures().tessellationShader, dev.GetFeatures().geometryShader); |
| 1736 | createInfo.codeType = VK_SHADER_CODE_TYPE_SPIRV_EXT; |
| 1737 | createInfo.codeSize = spv.size() * sizeof(spv[0]); |
| 1738 | createInfo.pCode = spv.data(); |
| 1739 | createInfo.pName = "main"; |
| 1740 | if (descriptorSetLayout) { |
| 1741 | createInfo.setLayoutCount = 1u; |
| 1742 | createInfo.pSetLayouts = descriptorSetLayout; |
| 1743 | } |
| 1744 | if (pushConstRange) { |
| 1745 | createInfo.pushConstantRangeCount = 1u; |
| 1746 | createInfo.pPushConstantRanges = pushConstRange; |
| 1747 | } |
| 1748 | Init(dev, createInfo); |
| 1749 | } |
| 1750 | |
| 1751 | Shader::Shader(const Device& dev, const VkShaderStageFlagBits stage, const char* code, |
| 1752 | const VkDescriptorSetLayout* descriptorSetLayout, const VkPushConstantRange* pushConstRange) { |
nothing calls this directly
no test coverage detected