| 495 | } |
| 496 | |
| 497 | bool 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 |