Add simple test for extended debug operations.

This commit is contained in:
Hans-Kristian Arntzen 2019-07-05 10:25:18 +02:00
parent 6d9c502a3a
commit 13378ad1ac
4 changed files with 104 additions and 0 deletions

View File

@ -0,0 +1,18 @@
#version 430
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
layout(binding = 0, std430) buffer _8_9
{
float _m0[];
} _9;
layout(binding = 1, std430) buffer _8_10
{
float _m0[];
} _10;
void main()
{
_10._m0[gl_GlobalInvocationID.x] = -_9._m0[gl_GlobalInvocationID.x];
}

View File

@ -0,0 +1,18 @@
#version 430
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
layout(binding = 0, std430) buffer _8_9
{
float _m0[];
} _9;
layout(binding = 1, std430) buffer _8_10
{
float _m0[];
} _10;
void main()
{
_10._m0[gl_GlobalInvocationID.x] = -_9._m0[gl_GlobalInvocationID.x];
}

View File

@ -0,0 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 37
; Schema: 0
OpCapability Shader
%1 = OpExtInstImport "DebugInfo"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %2 "main" %3
OpExecutionMode %2 LocalSize 1 1 1
%4 = OpString "negateInputs.comp"
%5 = OpString "negateInputs"
%6 = OpString "main"
%7 = OpString ""
OpSource GLSL 430
OpName %2 "main"
OpName %3 "gl_GlobalInvocationID"
OpDecorate %3 BuiltIn GlobalInvocationId
OpDecorate %8 BufferBlock
OpDecorate %9 DescriptorSet 0
OpDecorate %9 Binding 0
OpDecorate %10 DescriptorSet 0
OpDecorate %10 Binding 1
OpDecorate %11 ArrayStride 4
OpMemberDecorate %8 0 Offset 0
OpLine %4 0 0
%12 = OpTypeBool
%13 = OpTypeVoid
%14 = OpTypeFunction %13
%15 = OpTypeInt 32 0
%16 = OpTypeInt 32 1
%17 = OpTypeFloat 32
%18 = OpTypeVector %15 3
%19 = OpTypeVector %17 3
%20 = OpTypePointer Input %18
%21 = OpTypePointer Uniform %16
%22 = OpTypePointer Uniform %17
%23 = OpTypeRuntimeArray %16
%11 = OpTypeRuntimeArray %17
%8 = OpTypeStruct %11
%24 = OpTypePointer Uniform %8
%9 = OpVariable %24 Uniform
%10 = OpVariable %24 Uniform
OpLine %4 0 1
OpLine %5 1 0
OpLine %4 1000 100000
%3 = OpVariable %20 Input
%25 = OpConstant %16 0
OpNoLine
OpLine %4 1 1
%26 = OpExtInst %13 %1 DebugInfoNone
%27 = OpExtInst %13 %1 DebugTypeFunction %13
%28 = OpExtInst %13 %1 DebugFunction %6 %27 %4 1 1 %4 %7 FlagIsDefinition|FlagPrototyped|FlagIsOptimized 1 %26 %26
%2 = OpFunction %13 None %14
%29 = OpLabel
%30 = OpExtInst %13 %1 DebugScope %28
OpLine %4 1 1
%31 = OpLoad %18 %3
%32 = OpCompositeExtract %15 %31 0
%33 = OpAccessChain %22 %9 %25 %32
%34 = OpLoad %17 %33
%35 = OpFNegate %17 %34
%36 = OpAccessChain %22 %10 %25 %32
OpStore %36 %35
OpNoLine
OpReturn
OpFunctionEnd

View File

@ -1071,6 +1071,7 @@ void Parser::parse(const Instruction &instruction)
// OpNoLine might come at global scope.
if (current_block)
current_block->ops.push_back(instruction);
break;
}
// Actual opcodes.