| 57 | } |
| 58 | |
| 59 | TEST_F(NegativeGpuAVShaderDebugInfo, OpLine) { |
| 60 | TEST_DESCRIPTION("Make sure basic OpLine works"); |
| 61 | |
| 62 | const char* shader_source = R"( |
| 63 | OpCapability Shader |
| 64 | OpCapability PhysicalStorageBufferAddresses |
| 65 | %2 = OpExtInstImport "GLSL.std.450" |
| 66 | OpMemoryModel PhysicalStorageBuffer64 GLSL450 |
| 67 | OpEntryPoint GLCompute %main "main" %_ |
| 68 | OpExecutionMode %main LocalSize 1 1 1 |
| 69 | %1 = OpString "" |
| 70 | OpMemberDecorate %foo 0 Offset 0 |
| 71 | OpMemberDecorate %foo 1 Offset 8 |
| 72 | OpDecorate %foo Block |
| 73 | OpDecorate %_runtimearr_int ArrayStride 4 |
| 74 | OpMemberDecorate %IndexBuffer 0 NonWritable |
| 75 | OpMemberDecorate %IndexBuffer 0 Offset 0 |
| 76 | OpDecorate %IndexBuffer Block |
| 77 | OpDecorate %_ DescriptorSet 0 |
| 78 | OpDecorate %_ Binding 0 |
| 79 | %void = OpTypeVoid |
| 80 | %4 = OpTypeFunction %void |
| 81 | OpTypeForwardPointer %_ptr_PhysicalStorageBuffer_IndexBuffer PhysicalStorageBuffer |
| 82 | %int = OpTypeInt 32 1 |
| 83 | %foo = OpTypeStruct %_ptr_PhysicalStorageBuffer_IndexBuffer %int |
| 84 | %_runtimearr_int = OpTypeRuntimeArray %int |
| 85 | %IndexBuffer = OpTypeStruct %_runtimearr_int |
| 86 | %_ptr_PhysicalStorageBuffer_IndexBuffer = OpTypePointer PhysicalStorageBuffer %IndexBuffer |
| 87 | %_ptr_StorageBuffer_foo = OpTypePointer StorageBuffer %foo |
| 88 | %_ = OpVariable %_ptr_StorageBuffer_foo StorageBuffer |
| 89 | %int_1 = OpConstant %int 1 |
| 90 | %int_0 = OpConstant %int 0 |
| 91 | %_ptr_StorageBuffer__ptr_PhysicalStorageBuffer_IndexBuffer = OpTypePointer StorageBuffer %_ptr_PhysicalStorageBuffer_IndexBuffer |
| 92 | %int_16 = OpConstant %int 16 |
| 93 | %_ptr_PhysicalStorageBuffer_int = OpTypePointer PhysicalStorageBuffer %int |
| 94 | %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int |
| 95 | %main = OpFunction %void None %4 |
| 96 | %6 = OpLabel |
| 97 | %17 = OpAccessChain %_ptr_StorageBuffer__ptr_PhysicalStorageBuffer_IndexBuffer %_ %int_0 |
| 98 | OpLine %1 42 24 |
| 99 | %18 = OpLoad %_ptr_PhysicalStorageBuffer_IndexBuffer %17 |
| 100 | %21 = OpAccessChain %_ptr_PhysicalStorageBuffer_int %18 %int_0 %int_16 |
| 101 | %22 = OpLoad %int %21 Aligned 4 |
| 102 | %24 = OpAccessChain %_ptr_StorageBuffer_int %_ %int_1 |
| 103 | OpStore %24 %22 |
| 104 | OpReturn |
| 105 | OpFunctionEnd |
| 106 | )"; |
| 107 | |
| 108 | BasicSingleStorageBufferComputeOOB(shader_source, "Shader validation error occurred at <source>:42:24"); |
| 109 | } |
| 110 | |
| 111 | TEST_F(NegativeGpuAVShaderDebugInfo, OpLineColumn) { |
| 112 | TEST_DESCRIPTION("Make sure the column in OpLine will add value to show which part the error occurred"); |
nothing calls this directly
no test coverage detected