MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-ValidationLayers / Shader

Method Shader

tests/framework/binding.cpp:1731–1749  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1729}
1730
1731Shader::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
1751Shader::Shader(const Device& dev, const VkShaderStageFlagBits stage, const char* code,
1752 const VkDescriptorSetLayout* descriptorSetLayout, const VkPushConstantRange* pushConstRange) {

Callers

nothing calls this directly

Calls 4

SetNextStageFunction · 0.85
GLSLtoSPVFunction · 0.85
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected