DebugTypeVectorIdEXT (opcode 109) must be emitted for OpTypeCooperativeVectorNV when NonSemantic debug info is enabled.
| 82 | // DebugTypeVectorIdEXT (opcode 109) must be emitted for OpTypeCooperativeVectorNV |
| 83 | // when NonSemantic debug info is enabled. |
| 84 | TEST_F(SpvDebugInfoTest, CooperativeVectorNVEmitsDebugTypeVectorIdEXT) |
| 85 | { |
| 86 | const std::string source = R"( |
| 87 | #version 450 core |
| 88 | #extension GL_KHR_memory_scope_semantics : enable |
| 89 | #extension GL_NV_cooperative_vector : enable |
| 90 | #extension GL_EXT_shader_explicit_arithmetic_types : enable |
| 91 | layout(local_size_x = 64) in; |
| 92 | layout(set = 0, binding = 0) buffer B { float data[]; } buf; |
| 93 | void main() { |
| 94 | coopvecNV<float, 8> v = coopvecNV<float, 8>(0.0); |
| 95 | v = v + v; |
| 96 | buf.data[gl_GlobalInvocationID.x] = v[0]; |
| 97 | } |
| 98 | )"; |
| 99 | std::string spirv = compileWithDebugInfo(source); |
| 100 | EXPECT_NE(spirv.find("DebugTypeVectorIdEXT"), std::string::npos) |
| 101 | << "Expected DebugTypeVectorIdEXT in disassembly.\nSPIR-V:\n" << spirv; |
| 102 | EXPECT_NE(spirv.find("TypeCooperativeVectorNV"), std::string::npos) |
| 103 | << "Expected TypeCooperativeVectorNV in disassembly.\nSPIR-V:\n" << spirv; |
| 104 | } |
| 105 | |
| 106 | // DebugTypeVectorIdEXT must also be emitted when the component count is a |
| 107 | // specialization constant (OpSpecConstant), since the spec allows any constant |