MCPcopy Create free account
hub / github.com/PacktPublishing/3D-Graphics-Rendering-Cookbook / createShaderModule

Function createShaderModule

shared/UtilsVulkan.cpp:236–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234}
235
236VkResult createShaderModule(VkDevice device, ShaderModule* shader, const char* fileName)
237{
238 if (compileShaderFile(fileName, *shader) < 1)
239 return VK_NOT_READY;
240
241 const VkShaderModuleCreateInfo createInfo =
242 {
243 .sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO,
244 .codeSize = shader->SPIRV.size() * sizeof(unsigned int),
245 .pCode = shader->SPIRV.data(),
246 };
247
248 return vkCreateShaderModule(device, &createInfo, nullptr, &shader->shaderModule);
249}
250
251void createInstance(VkInstance* instance)
252{

Callers 6

createGraphicsPipelineFunction · 0.85
addComputePipelineMethod · 0.85
ComputeBaseMethod · 0.85
ComputedVertexBufferMethod · 0.85
ComputedImageMethod · 0.85

Calls 1

compileShaderFileFunction · 0.85

Tested by

no test coverage detected