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

Method InitFromGLSL

tests/framework/shader_helper.cpp:497–509  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

495}
496
497bool VkShaderObj::InitFromGLSL(const void* shader_module_ci_pNext) {
498 std::vector<uint32_t> spv;
499 GLSLtoSPV(m_device->Physical().limits_, m_stage_info.stage, m_source, spv, m_spv_env);
500
501 VkShaderModuleCreateInfo module_ci = vku::InitStructHelper();
502 module_ci.pNext = shader_module_ci_pNext;
503 module_ci.codeSize = spv.size() * sizeof(uint32_t);
504 module_ci.pCode = spv.data();
505
506 Init(*m_device, module_ci);
507 m_stage_info.module = handle();
508 return VK_NULL_HANDLE != handle();
509}
510
511// Because shaders are currently validated at pipeline creation time, there are test cases that might fail shader module
512// creation due to supplying an invalid/unknown SPIR-V capability/operation. This is called after VkShaderObj creation when

Callers

nothing calls this directly

Calls 3

GLSLtoSPVFunction · 0.85
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected