Because shaders are currently validated at pipeline creation time, there are test cases that might fail shader module creation due to supplying an invalid/unknown SPIR-V capability/operation. This is called after VkShaderObj creation when tests are found to crash on a CI device
| 512 | // creation due to supplying an invalid/unknown SPIR-V capability/operation. This is called after VkShaderObj creation when |
| 513 | // tests are found to crash on a CI device |
| 514 | VkResult VkShaderObj::InitFromGLSLTry(const vkt::Device* custom_device) { |
| 515 | std::vector<uint32_t> spv; |
| 516 | // 99% of tests just use the framework's VkDevice, but this allows for tests to use custom device object |
| 517 | // Can't set at contructor time since all reference members need to be initialized then. |
| 518 | VkPhysicalDeviceLimits limits = (custom_device) ? custom_device->Physical().limits_ : m_device->Physical().limits_; |
| 519 | GLSLtoSPV(limits, m_stage_info.stage, m_source, spv, m_spv_env); |
| 520 | |
| 521 | VkShaderModuleCreateInfo moduleCreateInfo = vku::InitStructHelper(); |
| 522 | moduleCreateInfo.codeSize = spv.size() * sizeof(uint32_t); |
| 523 | moduleCreateInfo.pCode = spv.data(); |
| 524 | |
| 525 | const auto result = InitTry(((custom_device) ? *custom_device : *m_device), moduleCreateInfo); |
| 526 | m_stage_info.module = handle(); |
| 527 | return result; |
| 528 | } |
| 529 | |
| 530 | bool VkShaderObj::InitFromASM() { |
| 531 | std::vector<uint32_t> spv; |